feat(image-editor): add Angular image editor#36236
Conversation
…Store (#36063) New @dotcms/image-editor library — a full-screen "Edit image" modal that renders a live, server-side preview by building dotCMS /contentAsset/image filter URLs (a viewer of the endpoint). State is an @ngrx/signals events-based store (eventGroup/withReducer/ on/injectDispatch + rxMethod effects) with adjust/transform/crop/focalPoint/fileInfo/ zoom slices and a coalesced command history (undo/redo + removable applied edits). - DotImageEditorComponent (OnPush) opened via PrimeNG DialogService - Canvas with two-layer image crossfade + skeleton/spinner/error+retry - Tool rail (move/crop/focal), accordion panels (Adjust/Transform/File info/History), footer (Cancel/Download/Save split button) - IMAGE_EDITOR_LAUNCHER seam (Angular/Legacy/Noop); binary field 'Edit image' now opens the new editor and saves via the _imageToolSaveFile temp-file flow - 79 edit.content.image-editor.* i18n keys; Storybook story for isolated testing Closes #36063
|
Claude finished @oidacra's task in 1m 11s —— View job Rollback Safety Analysis
Result: ✅ Safe To RollbackAll 81 changed files are pure frontend changes:
No matches against any unsafe category:
The PR introduces a brand-new standalone Angular library ( The label |
🤖 Bedrock Review —
|
03448ba to
c2f4635
Compare
c2f4635 to
a1d5b80
Compare
- Accordion: design-aligned header (13px title, 11px subtitle, primary icon chip when open), collapsed by default, open sections persisted to localStorage - Adjust values are editable number fields synced with the sliders (clamped) - Undo/redo keyboard shortcuts on the dialog (Ctrl/Cmd+Z, Ctrl/Cmd+Shift+Z, Ctrl+Y); ignored while a text field is focused - Crop: Shift-drag a corner locks the starting aspect ratio - Address bar text/icon use the design's 78%-white dark-chrome tone - Canvas/footer layout + padding, gradient adjust sliders, taller dialog - Store: split panel events into Adjust/Transform/File-info groups, one withReducer per group, and move async effects to withEventHandlers - Remove unused Storybook wiring (story + .storybook glob) and the unused legacy Dojo and noop launchers Refs #36063
a1d5b80 to
5f38ef3
Compare
…y/focal fixes - Accordion: flatten app-wide via CustomLaraPreset (square corners, opaque sticky section headers, animated chevron); smaller control labels/values - Transform: editable Scale/Rotate number inputs; Scale now resizes (scale% x natural size) instead of being a no-op - Preview: store-owned auto-retry on transient load failure, decode() + natural-dimension completeness guard, hidden pending preloader so half-painted frames never show - History: removing an applied edit replays the remaining flow (field-level delta replay) instead of leaving stale effects baked in; de-duplicated and shrunk applied-edit labels - Focal point: set live on drag (no Set click), no preview reload; focal- centered aspect crop (1:1 / 16:9 / 4:3) presented in the canvas dark bar; removed the no-op FocalPoint preview filter (save-time anchor only) - File info: Original Size row - Store: split panel events into Adjust/Transform/File-info groups with per-group reducers; effects via withEventHandlers - i18n: remove orphaned history.category.*, transform.aspect, focal.done keys Refs #36063
Summary
Replaces the legacy Dojo `ImageEditor.js` with a new standalone Angular library `@dotcms/image-editor`, wired into Edit Content's binary field through an `IMAGE_EDITOR_LAUNCHER` seam (Angular-only path).
The editor is a viewer of a dotCMS endpoint: the `
` `src` is a computed `/contentAsset/image/{id}/{field}/filter/...` URL, so every control change rebuilds the URL and the server renders the adjusted image. Live preview uses a two-layer crossfade with debounced sizing.
State is an events-based NgRx Signal Store (`@ngrx/signals/events`) — a deliberate departure from the repo's `withMethods` convention, chosen for the removable applied-edits list + named undo/redo (a replayable command stream).
What's included
Testing
Closes #36063