Repository navigation
Remove the unused native Plate image node - #201
Merged
Merged
Conversation
Aurora always inserts images as Plone image blocks (`ploneBlock` with `@type: 'image'`), so the native Plate `img` node was dead code. - Delete `media-image-node.tsx`, `media-image-node-static.tsx` and `media-preview-dialog.tsx`. - Drop the commented-out `ImagePlugin`/`BaseImagePlugin` blocks and the commented `KEYS.img` insert transform. - Remove the Image entries from the insert and fixed toolbars (`full` preset only) and from `MediaToolbarButton`. - Remove the image branch and `ImageProgress` from the media placeholder, and guard against media types without placeholder config so an image drop in presets without `PloneImageUploadPlugin` does not crash. - Remove `KEYS.img` from the caption, align, indent and list targets and from the block suggestion labels. - Remove the `img` entry from `config.blocks.plateBlocksConfig`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aurora always inserts images as Plone image blocks (
ploneBlockwith@type: 'image', viaplone-image-upload.tsx), so the native Plateimgnode and its UI were dead code.Changes
@plone/platecomponents/ui/media-image-node.tsx,media-image-node-static.tsxandmedia-preview-dialog.tsx(nothing imported them).ImagePlugin/BaseImagePluginblocks inmedia-kit.tsx/media-base-kit.tsxand the commentedKEYS.imginsert intransforms.ts.insert-toolbar-button.tsxandfixed-toolbar-buttons.tsx(only reachable from thefullpreset) and theKEYS.imgconfig inmedia-toolbar-button.tsx.ImageProgressfrommedia-placeholder-node.tsx; video, audio and file placeholders are unchanged.PlaceholderPluginstill maps dropped image files toimgplaceholders by default, so in presets withoutPloneImageUploadPlugin(full,block-editor) the missing config would otherwise crash. Unknown media types now render an empty element.KEYS.imgfrom the caption, align, indent and list target lists and from theblock-suggestion.tsxlabels.@plone/blocksimgentry fromconfig.blocks.plateBlocksConfig.Validation
pnpm --filter @plone/plate test --run— 74 passedpnpm --filter @plone/plate check:ts— cleanpnpm --filter @plone/blocks test --run— 29 passedpnpm --filter @plone/blocks check:ts— cleanNews fragments are marked
internalsince the package is experimental and none of the removed components were wired into a preset.