- #3790 by @felixfeng33 – Fix editor crash when inserting media into an empty paragraph.
-
#3784 by @felixfeng33 – Fix the issue where pasting DOCX text triggers image uploads.
-
#3782 by @felixfeng33 – Fix error message.
-
#3753 by @felixfeng33 – PlaceholderPlugin: New
updateUploadHistory
withHistoryMark
isHistoryMarking
to fix undo to the loading state.editor.insert.insertMedia
add optionsNew option
disableEmptyPlaceholder
to hidden empty placeholder.Rename
disabledDndPlugin
todisableFileDrop
- #3728 by @felixfeng33 – Fix can't drop
- #3725 by @felixfeng33 –
insertMedia
: Should insert in the current block if it is empty.
- #3723 by @felixfeng33 – Add
at
ininsertMedia
api.
-
#3708 by @felixfeng33 – ImagePlugin:
- New
initialHeight
andinitialWidth
inTImageElement
This will display a loading placeholder while the image is still loading, which helps maintain a consistent height. - New Api: editor.insert.imageFromFiles
PlaceholderPlugin:
- Mew
placeholderId
Used to track what was converted from that placeholder plugin. - New
insertMedia
Used for inserting the placeholder at once. - New
validateFiles
utils for validate the files meet themediaConfig
.- If validation fails,stop insert placeholder and save the error message in uploadErrorMessage.
- New
option.multiple
maxFileCount
Used to limit the number of placeholders inserted. - New
option.disable
disabledDndPlugin
Used to using the browser drop. - New
error
useeditor.useOption
to watch and display a toast message.
- New
03708f9823d240db78cd9ef9206bff98c6de0488
by @zbeyens – Removeescape
handler
- #3653 by @felixfeng33 – Fix scrollbar issue.
- #3644 by @felixfeng33 – Add
editor.tf.insert.audioPlaceholder
,editor.tf.insert.filePlaceholder
,editor.tf.insert.imagePlaceholder
,editor.tf.insert.videoPlaceholder
-
d30471cb19577e53c20944ab66eab2a7ef3b3ad2
by @12joan – Add the following attributes todangerouslyAllowAttributes
:- ImagePlugin:
alt
,width
,height
- VideoPlugin:
width
,height
- ImagePlugin:
- #3420 by @zbeyens –
createMediaPlugin
->MediaPlugin
FloatingMediaUrlInput
,submitFloatingMedia
rename optionpluginKey
->plugin
insertMediaEmbed
removekey
option
- #3446 by @felixfeng33 – fix: typo
insertFilePlaceholer
=>insertFilePlaceholder
.
- #3384 by @12joan – Remove default
align
fromuseMediaState
, allowing components to choose their own defaultalign
1bc0971774fbfb770780c9bdb94746a6f0f196a0
by @12joan –- Require the
url
property returned from URL parsers passed touseMediaState
to be a valid URL and have protocolhttps:
orhttp:
, if present. - In the return value of
useMediaState
, renameurl
tounsafeUrl
to indicate that it has not been sanitised.
- Require the
- #3289 by @felixfeng33 – Add image preview
- #3253 by @hakimLyon – Fix: useMediaState
- #3241 by @felixfeng33 – Add plugins:
mediaPlaceholder
,video
,audio
andfile
4cbed7159
by @zbeyens – Move@udecode/plate-common
to peerDeps to fix a bug when multiple instances were installed
-
#2537 by @haydencarlson –
MediaEmbedElement
is now more headless with a smaller bundle size. Update the following components:npx @udecode/plate-ui@latest add media-embed-element
- now uses
react-lite-youtube-embed
for YouTube videos. - now uses
react-tweet
for Twitter tweets.
- now uses
npx @udecode/plate-ui@latest add image-element
Breaking changes:
- Moved
Resizable
to@udecode/plate-resizable
- Moved
Caption
,CaptionTextarea
to@udecode/plate-caption
- Removed
useMediaEmbed
,MediaEmbedVideo
,MediaEmbedTweet
,Tweet
,parseMediaUrl
,mediaStore
- Removed
@udecode/resizable
,scriptjs
,react-textarea-autosize
dependencies MediaPlugin
- removed
rules
. Useparsers
option instead. - removed
disableCaption
. UsecreateCaptionPlugin
instead.
- removed
- Caption is now a separate plugin. Install
@udecode/plate-caption
and add it to your plugins:
import { ELEMENT_IMAGE, ELEMENT_MEDIA_EMBED } from '@udecode/plate-media'; createCaptionPlugin({ options: { pluginKeys: [ELEMENT_IMAGE, ELEMENT_MEDIA_EMBED] }, });
- #2366 by @zbeyens –
- Fix freeze on image upload: This patch adds a check to ensure the given URL is valid before parsing and extracting video data using
js-video-url-parser
in theparseVideoUrl
function. - Fix insert CSV: This patch modifies the logic in the
withImageUpload
function to ensure that it processes file uploads only if there is no plaintext present.
- Fix freeze on image upload: This patch adds a check to ensure the given URL is valid before parsing and extracting video data using
- #2311 by @haydencarlson – Added options for twitter embeds
-
#2225 by @TomMorane – fix: hotkey
-
#2220 by @TomMorane – fix: Cannot read properties of null (reading 'toString') when image width is null
- #1832 by @zbeyens –
- Fixes udecode/editor-protocol#79
- new option
disableCaption
- image and media-embed plugins use
getWithSelectionCaption
- #1754 by @haydencarlson – Fixed twitter embed loading when using multiple plate instances
- #1721 by @zbeyens –
- removed:
useImageElement
foruseElement
MediaEmbedUrlInput
forFloatingMediaUrlInput
parseEmbedUrl
forparseMediaUrl
EmbedProviders
- renamed:
ImageImg
toImage
ImageCaptionTextarea
toCaptionTextarea
useImageCaptionString
touseCaptionString
ImageResizable
toResizable
- removed:
-
createMediaEmbedPlugin
default options:
options: { transformUrl: parseIframeUrl, rules: [ { parser: parseTwitterUrl, component: MediaEmbedTweet, }, { parser: parseVideoUrl, component: MediaEmbedVideo, }, ], },
- utils:
parseIframeUrl
parseMediaUrl
submitFloatingMedia
- components:
MediaRoot
MediaEmbed
MediaEmbedTweet
: used when provider is twitterMediaEmbedVideo
: used when provider is a video
FloatingMedia
FloatingMediaEditButton
FloatingMediaUrlInput
- stores:
mediaStore
captionGlobalStore
floatingMediaStore
resizableStore
- types:
interface TResizableElement extends TElement { width?: number; } interface TImageElement extends TMediaElement {} interface TCaptionElement extends TElement { caption?: TDescendant[]; } interface TMediaElement extends TCaptionElement, TResizableElement { url: string; } type MediaUrlParser = (url: string) => EmbedUrlData | undefined; type MediaPluginRule = { parser: MediaUrlParser; component?: RenderFunction<EmbedUrlData>; }; interface MediaPlugin { isUrl?: (text: string) => boolean; /** Transforms the url. */ transformUrl?: (url: string) => string; /** * List of rules. The first rule that matches the url will be used, i.e. its * component will be used to render the media. Used by `MediaEmbed`. */ rules?: MediaPluginRule[]; }
type EmbedUrlData = { url?: string; provider?: string; id?: string; component?: RenderFunction<EmbedUrlData>; };