You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable image resizing in the Block Editor (libs/new-block-editor) using the resize support built into @tiptap/extension-image.
Laura raised this as feedback: content authors currently have no way to change an image's displayed size from inside the editor. The only layout controls available today are textWrap (left/right) and textAlign (left/center/right), both written as <figure> classes by DotImage.
⚠️Blocked on product approval. The behavior is agreed technically but has not been signed off by Product. Do not start implementation until approval is recorded on this issue.
Current state (verified)
@tiptap/extension-image@3.22.2 — already the installed version — exposes resize natively:
The parent extension also already declares width / height node attributes and accepts them in setImage(), so DotImage's ...this.parent?.() spread picks them up for free.
Known technical constraint
DotImage overrides addNodeView() in core-web/libs/new-block-editor/src/lib/editor/extensions/nodes/image.extension.ts to build the <figure> / <a> / <img> wrapper by hand. TipTap's resize handles are provided by the parent's own resizable node view, which that override replaces — so simply setting resize: { enabled: true } will not surface handles until the custom node view is reworked to compose with the resizable node view (or to render the handles itself).
This is the main implementation cost of the ticket and should be scoped before committing to a sprint.
Description
Enable image resizing in the Block Editor (
libs/new-block-editor) using the resize support built into@tiptap/extension-image.Laura raised this as feedback: content authors currently have no way to change an image's displayed size from inside the editor. The only layout controls available today are
textWrap(left/right) andtextAlign(left/center/right), both written as<figure>classes byDotImage.Reference: https://tiptap.dev/docs/editor/extensions/nodes/image#resize
Current state (verified)
@tiptap/extension-image@3.22.2— already the installed version — exposes resize natively:The parent extension also already declares
width/heightnode attributes and accepts them insetImage(), soDotImage's...this.parent?.()spread picks them up for free.Known technical constraint
DotImageoverridesaddNodeView()incore-web/libs/new-block-editor/src/lib/editor/extensions/nodes/image.extension.tsto build the<figure>/<a>/<img>wrapper by hand. TipTap's resize handles are provided by the parent's own resizable node view, which that override replaces — so simply settingresize: { enabled: true }will not surface handles until the custom node view is reworked to compose with the resizable node view (or to render the handles itself).This is the main implementation cost of the ticket and should be scoped before committing to a sprint.
Files in scope
core-web/libs/new-block-editor/src/lib/editor/extensions/nodes/image.extension.tsresize, reworkaddNodeView()to keep handles, persistwidth/heightdotCMS/src/main/webapp/WEB-INF/velocity/static/storyblock/dotImage.vtlwidth/heighton<img>core-web/libs/sdk/**(React, Vue, Angular ×2)width/heighton<img>core-web/libs/sdk/types/src/lib/components/block-editor-renderer/internal.tswidth/heightto the image attrs typeAcceptance Criteria
Preconditions
Happy path
widthandheightas attributes on thedotImagenodeRendering parity
dotImage.vtl)Interaction with existing layout attrs
textWrapset keeps theimage-wrap-left/image-wrap-rightfigure class intacttextAlignset keeps theimage-align-*figure class intacthrefset) does not break the anchor or the node-selection fix from Block Editor: cannot add a link to an image (image properties menu not accessible) #36361Edge cases
minWidth/minHeightclamps to the minimum instead of collapsing the imagewidth/heightattributes renders unchanged (no regression)Tests
libs/new-block-editor/cover: resize persists width/height, minimum clamping, and layout-attr preservationPriority
Medium
Additional Context
libs/new-block-editoronly. The legacylibs/block-editoris not in scope.image.extension.tsanddotImage.vtl.