┌───────────────────────────────────────────────────────────┐ │ 📄 shadcn/directory/udecode/plate/components/changelog.cn │ └───────────────────────────────────────────────────────────┘
╔══════════════════════════════════════════════════════════════════════════════════════════════╗
║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║
由于 Plate UI 并非组件库,更新日志在此维护。
使用 CLI 安装最新版本的组件。
Plate 49
合并文件,使用更一致的命名约定,并删除未使用的 export 语句。
组件:
withProps(..., { as: '...' }) 插件组件。@udecode/plate 导入 KEYS 作为统一的键源。
ParagraphPlugin.key -> KEYS.pINDENT_LIST_KEYS.listStyleType -> KEYS.listTypeListStyleType.Decimal -> KEYS.olListStyleType.Disc -> KEYS.ullist (经典) -> KEYS.listClassicol (经典) -> KEYS.olClassicul (经典) -> KEYS.ulClassicli (经典) -> KEYS.liClassicaction_item (经典) -> KEYS.listTodoClassic*-element、*-leaf 文件重命名为 *-node(以及静态版本)ai-anchor-element,合并到 ai-nodeai-loading-bar,合并到 ai-menuai-menu-items,合并到 ai-menualign-dropdown-menu 重命名为 align-toolbar-button,AlignDropdownMenu 重命名为 AlignToolbarButtonapi-ai 重命名为 ai-apiapi-uploadthing 重命名为 media-uploadthing-apiBlockSelection:修复表格的块选择code-block-combobox,合并到 code-block-nodecode-line-element,合并到 code-block-node(以及静态版本)code-syntax-leaf,合并到 code-block-node(以及静态版本)color-toolbar-button 重命名为 font-color-toolbar-button,ColorDropdownMenu 重命名为 FontColorToolbarButtoncolor-* 文件,合并到 font-color-toolbar-button
color-dropdown-menu 重命名为 font-color-toolbar-buttoncolumn-group-element,合并到 column-node(以及静态版本)comment-create-form,合并到 commentdraggable 重命名为 block-draggable,DraggableAboveNodes 重命名为 BlockDraggableemoji-input-element 重命名为 emoji-nodeemoji-* 文件(除了 emoji-input-node),合并到 emoji-toolbar-button
EmojiToolbarDropdown 重命名为 EmojiPopover,EmojiDropdownMenu 重命名为 EmojiToolbarButtonEmojiPicker 的 icons 属性现在是可选的,默认为 emojiCategoryIcons 和 emojiSearchIconsimage-preview 重命名为 media-preview-dialog,ImagePreview 重命名为 MediaPreviewDialogimage-element 重命名为 media-image-node
MediaFileElement 重命名为 FileElement(以及静态版本)MediaAudioElement 重命名为 AudioElement(以及静态版本)MediaVideoElement 重命名为 VideoElement(以及静态版本)indent-list-toolbar-button 重命名为 list-toolbar-button
BulletedIndentListToolbarButton 重命名为 BulletedListToolbarButtonNumberedIndentListToolbarButton 重命名为 NumberedListToolbarButtonindent-todo-marker 重命名为 block-listindent-fire-markerindent-todo-toolbar-button,合并到 list-toolbar-buttonIndentTodoToolbarButton 重命名为 TodoListToolbarButtoninline-equation-element 和 equation-popover,合并到 equation-node(以及静态版本)inline-equation-toolbar-button,合并到 equation-toolbar-buttoninsert-dropdown-menu 重命名为 insert-toolbar-button,InsertDropdownMenu 重命名为 InsertToolbarButtonline-height-dropdown-menu 重命名为 line-height-toolbar-button,LineHeightDropdownMenu 重命名为 LineHeightToolbarButtonlink-floating-toolbar 重命名为 link-toolbarlist-indent-toolbar-button,合并到 list-classic-toolbar-buttonListIndentToolbarButton 重命名为 IndentToolbarButtonlist-node 重命名为 list-classic-nodemedia-popover 重命名为 media-toolbar,MediaPopover 重命名为 MediaToolbarmode-dropdown-menu 重命名为 mode-toolbar-button,ModeDropdownMenu 重命名为 ModeToolbarButtonmore-dropdown-menu 重命名为 more-toolbar-button,MoreDropdownMenu 重命名为 MoreToolbarButtonoutdent-toolbar-button,合并到 indent-toolbar-buttontable-icons:将 Border* 重命名为 Border*Iconslash-input-element 重命名为 slash-input-nodeSuggestionBelowNodes 重命名为 SuggestionLineBreaktable-cell-element,合并到 table-node(以及静态版本)table-row-element,合并到 table-node(以及静态版本)table-dropdown-menu 重命名为 table-toolbar-button,TableDropdownMenu 重命名为 TableToolbarButtontodo-list-node,合并到 list-classic-nodeturn-into-dropdown-menu 重命名为 turn-into-toolbar-button,TurnIntoDropdownMenu 重命名为 TurnIntoToolbarButtonexport-toolbar-button,indent-list-plugins:从 listStyleTypes 中移除 fireuseCommentEditor:使用 usePlateEditor 替代 useCreateEditorplaceholder,withPlaceholder。迁移:使用 block-placeholder-kit,BlockPlaceholderPlugin 替代。line-height-toolbar-button:删除 useLineHeightDropdownMenu 钩子。font-color-toolbar-button:删除 useColorInput 钩子。插件:
将所有 *-plugin、*-plugins 文件重命名为 -kit,将 *Plugin、*Plugins 重命名为 *Kit。插件套件是已配置插件的集合。
editor-plugins 重命名为 editor-kitequation-plugins 重命名为 math-kit,equationPlugins 重命名为 MathKitindent-list-plugins 重命名为 list-kit,indentListPlugins 重命名为 ListKitblock-list 中添加 BlockList 组件,在 list-kit 中使用use-create-editor,使用 usePlateEditor 替代ai-kit:添加 show 快捷键。从 ai-menu 中删除 useHotkeys('mod+j')
comment-kit:添加 setDraft 转换,快捷键
basic-marks-kit,basic-blocks-kit:添加快捷键
transforms,block-draggable:删除 STRUCTURE_TYPES,这些现在从 plugin.node.isContainer 推断。改用 editor.meta.containerTypes。
从 useSelectionFragmentProp 用法中删除 structuralTypes。
list (classic) -> KEYS.listClassicol (classic) -> KEYS.olClassicul (classic) -> KEYS.ulClassicli (classic) -> KEYS.liClassicaction_item (classic) -> KEYS.listTodoClassic*-element、*-leaf 文件重命名为 *-node(以及静态版本)ai-anchor-element,合并到 ai-nodeai-loading-bar,合并到 ai-menuai-menu-items,合并到 ai-menualign-dropdown-menu 重命名为 align-toolbar-button,AlignDropdownMenu 重命名为 AlignToolbarButtonapi-ai 重命名为 ai-apiapi-uploadthing 重命名为 media-uploadthing-apiBlockSelection:修复表格的块选择code-block-combobox,合并到 code-block-nodecode-line-element,合并到 code-block-node(以及静态版本)code-syntax-leaf,合并到 code-block-node(以及静态版本)color-toolbar-button 重命名为 font-color-toolbar-button,ColorDropdownMenu 重命名为 FontColorToolbarButtoncolor-* 文件,合并到 font-color-toolbar-button
color-dropdown-menu 重命名为 font-color-toolbar-buttoncolumn-group-element,合并到 column-node(以及静态版本)comment-create-form,合并到 commentdraggable 重命名为 block-draggable,DraggableAboveNodes 重命名为 BlockDraggableemoji-input-element 重命名为 emoji-nodeemoji-* 文件(除了 emoji-input-node),合并到 emoji-toolbar-button
EmojiToolbarDropdown 重命名为 EmojiPopover,EmojiDropdownMenu 重命名为 EmojiToolbarButtonEmojiPicker 的 icons 属性现在是可选的,默认为 emojiCategoryIcons 和 emojiSearchIconsimage-preview 重命名为 media-preview-dialog,ImagePreview 重命名为 MediaPreviewDialogimage-element 重命名为 media-image-node
MediaFileElement 重命名为 FileElement(以及静态版本)MediaAudioElement 重命名为 AudioElement(以及静态版本)MediaVideoElement 重命名为 VideoElement(以及静态版本)indent-list-toolbar-button 重命名为 list-toolbar-button
BulletedIndentListToolbarButton 重命名为 BulletedListToolbarButtonNumberedIndentListToolbarButton 重命名为 NumberedListToolbarButtonindent-todo-marker 重命名为 block-listindent-fire-markerindent-todo-toolbar-button,合并到 list-toolbar-buttonIndentTodoToolbarButton 重命名为 TodoListToolbarButtoninline-equation-element 和 equation-popover,合并到 equation-node(以及静态版本)inline-equation-toolbar-button,合并到 equation-toolbar-buttoninsert-dropdown-menu 重命名为 insert-toolbar-button,InsertDropdownMenu 重命名为 InsertToolbarButtonline-height-dropdown-menu 重命名为 line-height-toolbar-button,LineHeightDropdownMenu 重命名为 LineHeightToolbarButtonlink-floating-toolbar 重命名为 link-toolbarlist-indent-toolbar-button,合并到 list-classic-toolbar-buttonListIndentToolbarButton 重命名为 IndentToolbarButtonlist-node 重命名为 list-classic-nodemedia-popover 重命名为 media-toolbar,MediaPopover 重命名为 MediaToolbarmode-dropdown-menu 重命名为 mode-toolbar-button,ModeDropdownMenu 重命名为 ModeToolbarButtonmore-dropdown-menu 重命名为 more-toolbar-button,MoreDropdownMenu 重命名为 MoreToolbarButtonoutdent-toolbar-button,合并到 indent-toolbar-buttontable-icons:将 Border* 重命名为 Border*Iconslash-input-element 重命名为 slash-input-nodeSuggestionBelowNodes 重命名为 SuggestionLineBreaktable-cell-element,合并到 table-node(以及静态版本)table-row-element,合并到 table-node(以及静态版本)table-dropdown-menu 重命名为 table-toolbar-button,TableDropdownMenu 重命名为 TableToolbarButtontodo-list-node,合并到 list-classic-nodeturn-into-dropdown-menu 重命名为 turn-into-toolbar-button,TurnIntoDropdownMenu 重命名为 TurnIntoToolbarButtonexport-toolbar-button,indent-list-plugins:从 listStyleTypes 中移除 fireuseCommentEditor:使用 usePlateEditor 替代 useCreateEditorplaceholder,withPlaceholder。迁移:使用 block-placeholder-kit,BlockPlaceholderPlugin 替代。line-height-toolbar-button:删除 useLineHeightDropdownMenu 钩子。font-color-toolbar-button:删除 useColorInput 钩子。插件:
将所有 *-plugin、*-plugins 文件重命名为 -kit,将 *Plugin、*Plugins 重命名为 *Kit。插件套件是已配置插件的集合。
editor-plugins 重命名为 editor-kitequation-plugins 重命名为 math-kit,equationPlugins 重命名为 MathKitindent-list-plugins 重命名为 list-kit,indentListPlugins 重命名为 ListKitblock-list 中添加 BlockList 组件,在 list-kit 中使用use-create-editor,使用 usePlateEditor 替代ai-kit:添加 show 快捷键。从 ai-menu 中删除 useHotkeys('mod+j')
comment-kit:添加 setDraft 转换,快捷键
basic-marks-kit,basic-blocks-kit:添加快捷键
transforms,block-draggable:删除 STRUCTURE_TYPES,这些现在从 plugin.node.isContainer 推断。改用 editor.meta.containerTypes。
从 useSelectionFragmentProp 用法中删除 structuralTypes。
inline-combobox:修复组合框关闭时 insertPoint 未更新的问题。equation-popover:关闭弹出框时将焦点返回到编辑器。inline-equation-element:选择时应高亮显示。迁移到 shadcn v4:
将所有 *-element、*-leaf 文件重命名为 *-node(以及静态版本)
删除 ai-anchor-element,合并到 ai-node
删除 ai-loading-bar,合并到 ai-menu
删除 ai-menu-items,合并到 ai-menu
将 align-dropdown-menu 重命名为 align-toolbar-button,AlignDropdownMenu 重命名为 AlignToolbarButton
将 api-ai 重命名为 ai-api
将 api-uploadthing 重命名为 media-uploadthing-api
BlockSelection:修复表格的块选择
删除 code-block-combobox,合并到 code-block-node
删除 code-line-element,合并到 code-block-node(以及静态版本)
删除 code-syntax-leaf,合并到 code-block-node(以及静态版本)
将 color-toolbar-button 重命名为 font-color-toolbar-button,ColorDropdownMenu 重命名为 FontColorToolbarButton
删除所有 color-* 文件,合并到 font-color-toolbar-button
color-dropdown-menu 重命名为 font-color-toolbar-button删除 column-group-element,合并到 column-node(以及静态版本)
删除 comment-create-form,合并到 comment
将 draggable 重命名为 block-draggable,DraggableAboveNodes 重命名为 BlockDraggable
将 emoji-input-element 重命名为 emoji-node
删除所有 emoji-* 文件(除了 emoji-input-node),合并到 emoji-toolbar-button
EmojiToolbarDropdown 重命名为 EmojiPopover,EmojiDropdownMenu 重命名为 EmojiToolbarButtonEmojiPicker 的 icons 属性现在是可选的,默认为 emojiCategoryIcons 和 emojiSearchIcons将 image-preview 重命名为 media-preview-dialog,ImagePreview 重命名为 MediaPreviewDialog
将 image-element 重命名为 media-image-node
MediaFileElement 重命名为 FileElement(以及静态版本)MediaAudioElement 重命名为 AudioElement(以及静态版本)MediaVideoElement 重命名为 VideoElement(以及静态版本)将 indent-list-toolbar-button 重命名为 list-toolbar-button
BulletedIndentListToolbarButton 重命名为 BulletedListToolbarButtonNumberedIndentListToolbarButton 重命名为 NumberedListToolbarButton将 indent-todo-marker 重命名为 block-list
删除 indent-fire-marker
删除 indent-todo-toolbar-button,合并到 list-toolbar-button
将 IndentTodoToolbarButton 重命名为 TodoListToolbarButton
删除 inline-equation-element 和 equation-popover,合并到 equation-node(以及静态版本)
删除 inline-equation-toolbar-button,合并到 equation-toolbar-button
将 insert-dropdown-menu 重命名为 insert-toolbar-button,InsertDropdownMenu 重命名为 InsertToolbarButton
将 line-height-dropdown-menu 重命名为 line-height-toolbar-button,LineHeightDropdownMenu 重命名为 LineHeightToolbarButton
将 link-floating-toolbar 重命名为 link-toolbar
删除 list-indent-toolbar-button,合并到 list-classic-toolbar-button
将 ListIndentToolbarButton 重命名为 IndentToolbarButton
将 list-node 重命名为 list-classic-node
将 media-popover 重命名为 media-toolbar,MediaPopover 重命名为 MediaToolbar
将 mode-dropdown-menu 重命名为 mode-toolbar-button,ModeDropdownMenu 重命名为 ModeToolbarButton
将 more-dropdown-menu 重命名为 more-toolbar-button,MoreDropdownMenu 重命名为 MoreToolbarButton
删除 outdent-toolbar-button,合并到 indent-toolbar-button
table-icons:将 Border* 重命名为 Border*Icon
将 slash-input-element 重命名为 slash-input-node
将 SuggestionBelowNodes 重命名为 SuggestionLineBreak
删除 table-cell-element,合并到 table-node(以及静态版本)
删除 table-row-element,合并到 table-node(以及静态版本)
将 table-dropdown-menu 重命名为 table-toolbar-button,TableDropdownMenu 重命名为 TableToolbarButton
删除 todo-list-node,合并到 list-classic-node
将 turn-into-dropdown-menu 重命名为 turn-into-toolbar-button,TurnIntoDropdownMenu 重命名为 TurnIntoToolbarButton
export-toolbar-button,indent-list-plugins:从 listStyleTypes 中移除 fire
useCommentEditor:使用 usePlateEditor 替代 useCreateEditor
删除 placeholder,withPlaceholder。迁移:使用 block-placeholder-kit,BlockPlaceholderPlugin 替代。
line-height-toolbar-button:删除 useLineHeightDropdownMenu 钩子。
font-color-toolbar-button:删除 useColorInput 钩子。
插件:
将所有 *-plugin、*-plugins 文件重命名为 -kit,将 *Plugin、*Plugins 重命名为 *Kit。插件套件是已配置插件的集合。
editor-plugins 重命名为 editor-kitequation-plugins 重命名为 math-kit,equationPlugins 重命名为 MathKitindent-list-plugins 重命名为 list-kit,indentListPlugins 重命名为 ListKitblock-list 中添加 BlockList 组件,用于 list-kituse-create-editor,改用 usePlateEditorai-kit:添加 show 快捷键。从 ai-menu 中移除 useHotkeys('mod+j')
comment-kit:添加 setDraft 转换和快捷键
basic-marks-kit、basic-blocks-kit:添加快捷键
transforms、block-draggable:移除 STRUCTURE_TYPES,现在从 plugin.node.isContainer 推断。改用 editor.meta.containerTypes。
从 useSelectionFragmentProp 用法中移除 structuralTypes。
inline-combobox:修复 combobox 关闭时 insertPoint 未更新的问题。equation-popover:关闭弹出框时将焦点返回到编辑器。inline-equation-element:选中时应高亮显示。React.forwardRef。components.json 中移除 registriesnpx shadcn 替代 npx shadcxwithRef@/lib/utils 导入 cn 而不是 @udecode/cn,以保持与 shadcn/ui 的一致性className、style 属性draggable:
media-placeholder-element:重构为使用 use-upload-file 钩子而不是 uploadthing
npx shadcn@latest add https://platejs.org/r/api-uploadthingai-chat-editor:支持非标准 markdown 节点。slash-input-element:添加 callout 支持。block-selection-plugins.tsx:修复块选择不工作的问题。ai/command: 从 ai 包分叉的 smoothStream 现在默认使用 30ms 延迟(仅代码块和表格使用 100ms 延迟)。use-chat: 添加 _abortFakeStream。ai-menu: 修复菜单项显示不正确的问题。ai-loading-bar: 将 esc 按键处理移至 ai-menu。ai/command: 将分块延迟增加到 100ms(临时解决性能问题)。autoformat-plugin: 允许以非1的数字开始新的缩进列表ai-leaf: 添加 aiIndicatorVariants 以显示加载状态。cursor-overlay: 当 AI 流式传输时隐藏。api/ai/command: 修复分块问题。添加 discussion-plugin:
discussionPlugin 添加到 editor-plugins,从 suggestionPlugin 中移除 configureblock-suggestion, comment 以使用 discussionPlugincomment-create-form 在不存在讨论时创建讨论suggestion-leaf 中的样式更改link-floating-toolbar 以支持内部链接,并在建议或评论激活时顶部放置ai-anchor-element: 添加 ai-anchor-element 组件,在流式传输前插入,流式传输后移除,用于定位 ai-menuai-loading-bar: 添加 ai-loading-bar 组件,用于显示插入模式流式传输的加载进度ai-menu: 迁移到最新的 ai 包ai-menu-items: 添加 generateMarkdownSampleai-plugins: 移除提示中的单段落限制editor: 引入 PlateContainer 组件export-toolbar-button: 修复与 html2canvas-pro 的 PDF 导出问题import-toolbar-button: 修复有时无法选择文件的问题ai-toolbar-button: 添加缺失的 @platejs/ai 依赖。comment-toolbar-button: 添加缺失的 comments-plugin registry 依赖。font-size-toolbar-button: 添加缺失的 popover registry 依赖。tooltip: 添加缺失的 button registry 依赖。block-context-menu: 防止在只读模式下打开上下文菜单block-suggestion: 修复样式suggestion-leaf-static: 添加静态版本Plate 46 - 新代码块
code-block-element-static, code-block-element, code-block-combobox: 更新以使用 lowlight 类。默认为 github 主题。code-syntax-leaf-static, code-syntax-leaf: 更新以使用 lowlight token 类prismjs 依赖及相关样式lowlight 插件选项代替 prism 选项code-block-combobox: 添加 Auto 语言选项,更改语言值以匹配 lowlightautoformat-plugin: 防止在代码块上自动格式化import { all, createLowlight } from 'lowlight';
const lowlight = createLowlight(all);
CodeBlockPlugin.configure({
options: {
lowlight,
},
});
image-preview: 防止在图像预览遮罩上显示块菜单media-popover: 当图像预览打开时隐藏媒体弹出窗口Plate 45 - 新评论和建议 UI
block-discussion 作为主容器,用于 plate-elementcomment 用于单个评论显示comment-create-form 带有最小 Plate 编辑器用于输入comments-popovercomment-avatarcomment-reply-itemscomment-valuecomment-resolve-buttonblock-suggestionsuggestion-leafsuggestion-line-breakplate-element,从 platejs/react 导入 PlateElement 代替。在 block-selection-plugins 中添加:render: {
belowRootNodes: (props) => {
if (!props.className?.includes('slate-selectable')) return null;
return <BlockSelection />;
},
},
comment-more-dropdown: 移除 useCommentEditButtonState, useCommentDeleteButtonStateimage-element, media-embed-element, media-video-element, mode-dropdown-menu
const width = useResizableValue('width')image-preview: 移除 useScaleInputState, useImagePreviewStatefloating-toolbar:
useEventEditorValue 替换 useEventEditorSelectorsmedia-popover:
FloatingMediaStore.set 替换 floatingMediaActions,useFloatingMediaValue 替换 useFloatingMediaSelectorstable-element: 修复样式,折叠时显示表格边框控件table-row-element: 重构table-cell-element: 选择背景品牌色table-element, table-row-element: 支持行拖放和选择plate-element: 添加 blockSelectionClassName 属性editor: 选择区域 z-50draggable:
editor.api.blockSelection.clear 替换 editor.api.blockSelection.replaceSelectedIdsTooltipButton 作为拖动手柄column-element, table-cell-element: 添加 isSelectionAreaVisible 检查block-selection: 拖动时隐藏editor.api.blockSelection.set 替换 editor.api.blockSelection.addSelectedRow:
ai-menuequation-popoveralign-dropdown-menu: 弃用inline-equation-element 和 equation-popover: 修复: 当选择内联公式时,弹出窗口不应打开,因为它会导致选择丢失。emoji-picker-search-bar: 添加 autoFocusimport-toolbar-button 和 export-toolbar-button: 添加 markdown 支持fixed-toolbar-buttons: 添加 import-toolbar-buttonindent-fire-marker.tsx 添加 data-plate-prevent-deserialization 以防止反序列化火标记。将 span 标签更改为 li。indent-todo-marker.tsx 将 span 标签更改为 li。image-element-static.tsx 和 hr-element-static.tsx: 修复 nodeProps 未传递给 SlateElement。ai-chat-editor:const aiEditor = usePlateEditor({ plugins });
useAIChatEditor(aiEditor, content);
ai-plugins: 移除 createAIEditor,现在在 ai-chat-editor 中创建ai-chat-editor: 仅使用 useAIChatEditor (v42.1)ai-menu: 避免冲突,移除 aiEditorRefcommand: 添加 focus-visible:outline-noneeditor-static: 更新 aiChat 内边距transforms: 修复 insertBlock 被斜杠命令使用的问题: 如果新插入的块与命令类型相同,则应插入新块。block-selection-plugins: 更新 BlockSelectionPluginBlockSelectionPlugin.configure(({ editor }) => ({
options: {
enableContextMenu: true,
isSelectable: (element, path) => {
return (
!['code_line', 'column', 'td'].includes(element.type) &&
!editor.api.block({ above: true, at: path, match: { type: 'tr' } })
);
},
},
}))
table-element, table-element-static
table-iconscolgroup,列宽现在在 table-cell-element 中设置table-row-element: 移除 hideBorder 属性table-cell-element, table-cell-element-static:
table-dropdown-menu:
tooltip: 添加 TooltipButtonindent-list-toolbar-button: 移除 IndentListToolbarButton,改用 NumberedIndentListToolbarButton 和 BulletedIndentListToolbarButton。table-dropdown-menu: 新的插入表格界面。column-group-element: 修复 ColumnFloatingToolbar onColumnChangeexport-toolbar-button: 添加 katex 支持plate-element: 移除 relative 类名PlateElement 的组件已移除冗余的 relative 类名。fixed-toolbar-buttons: 添加 font-size-toolbar-buttonfloating-toolbar: 添加 inline-equation-toolbar-buttonturn-into-dropdown-menu: 修复: 转换为其他块后,编辑器应重新获得焦点。insert-dropdown-menu: 添加 inline equation 和 equation 并修复焦点问题slash-input-element: 添加 equation 和 inline equationtable-element: 修复选择isSelectingCell && '[&_*::selection]:bg-none'isSelectingCell && '[&_*::selection]:!bg-transparent'更新 tailwind.config.cjs 以在 HTML 导出中更好地支持字体:
fontFamily: {
heading: [
'var(--font-heading)',
'ui-sans-serif',
'-apple-system',
'BlinkMacSystemFont',
'Segoe UI Variable Display',
'Segoe UI',
'Helvetica',
'Apple Color Emoji',
'Arial',
'sans-serif',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji',
],
mono: ['var(--font-mono)', ...fontFamily.mono],
sans: [
'var(--font-sans)',
'ui-sans-serif',
'-apple-system',
'BlinkMacSystemFont',
'Segoe UI Variable Display',
'Segoe UI',
'Helvetica',
'Apple Color Emoji',
'Arial',
'sans-serif',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji',
],
insertColumnGroup, toggleColumnGroup: 使用 columns 选项代替 layoutwith-draggables。添加 DraggableAboveNodes 到 draggable。添加到 DndPlugin 配置:DndPlugin.configure({ render: { aboveNodes: DraggableAboveNodes } }),
column-element, image-element, media-video-element: 移除 useDraggableState。使用 const { isDragging, previewRef, handleRef } = useDraggablecolumn-group-element: 移除 useColumnState。改用:const columnGroupElement = useElement<TColumnGroupElement>(ColumnPlugin.key);
const onColumnChange = (widths: string[]) => {
setColumns(editor, {
at: findNodePath(editor, columnGroupElement),
widths,
});
};
export-toolbar-button: 添加 exportToHtmlPlate 41
-static.tsx 结尾。这些现在与默认的客户端组件一起添加。editor: 添加 select-text 到 editorVariantsdate-element: 只读时移除弹出窗口indent-todo-marker: 使用 SlateRenderElementProps 类型代替 PlateRenderElementPropshr-element, media-audio-element, media-embed-element, mention-element: 改进光标样式media-file-element: 使用 <a> 代替 div + onClickclassName 属性现在放在内联属性之前。column-element:
column-group-element:
draggable:
DraggableProvider HOCDropLine 子属性https://github.com/udecode/plate/pull/3809/files
select-editor, tag-element, label, form@udecode/cmdk 替换 cmdk 依赖。这是 cmdk 的可控版本。command: 添加变体editor: 添加 select 变体popover: 添加 animate 变体https://github.com/udecode/plate/pull/3807/files
toc-element: 移除 <nav> 标签,改用 <div> 修复 html2canvas 问题editor: 移除 role="button" 修复 html2canvas 问题Shadcn 同步:
input: 添加 text-base md:text-smtextarea: 添加 text-base md:text-smeditor(ai, aiChat 变体): 添加 text-base md:text-smtoolbar: 添加 ToolbarSplitButton, ToolbarSplitButtonPrimary, ToolbarSplitButtonSecondarymedia-toolbar-button: 使用 ToolbarSplitButtonresizable: 只读时隐藏 ResizeHandle// 插件
require("tailwind-scrollbar-hide")
// theme.extend.screens
screens: {
/**
* 匹配主指向设备可以方便悬停的设备。用法: main-hover:group-hover:bg-red-500 参见:
* https://developer.mozilla.org/en-US/docs/Web/CSS/@media/hover
*
* 在 iOS 设备上,包含 `group-hover:` CSS 规则的 .group 元素内的按钮需要点击两次才能
* 点击。作为解决方法,我们在无法方便悬停的设备上禁用这些规则,使用 `main-hover:`。
*/
'main-hover': {
raw: '(hover: hover)',
},
},
editor:
EditorContainer: 移除 ref,改用 useEditorContainerRefcaret-primary selection:bg-brand/25║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║
╚══════════════════════════════════════════════════════════════════════════════════════════════╝