@platejs/core
Bug Fixes
- Moved
getNodeDataAttributeKeysandkeyToDataAttributefunctions from static utilities to regular utilities to decouple React dependencies. (#4693)
@platejs/core
getNodeDataAttributeKeys and keyToDataAttribute functions from static utilities to regular utilities to decouple React dependencies. (#4693)@platejs/core
editor.setOption to properly handle function values (#4691)CHANGELOG · v50.3.7...v50.3.8 · By @zbeyens
@platejs/ai
createZustandStore from platejs/react (#4689)@platejs/core
Decouple createSlateEditor from React: (#4689)
createZustandStore from @platejs/core (or platejs) is now a vanilla store without React-specific functionality (hooks).createZustandStore is now available in @platejs/core/react (or platejs/react). This is not part of our public API so it won't be a breaking change, but if you're using it, you'll need to import it from @platejs/core/react (or platejs/react) instead.@platejs/media
createZustandStore from platejs/react (#4689)@platejs/selection
onKeyDownSelecting callback to include editor parameter (#4673)@platejs/floating
Fix: Resolve infinite loop in useFloatingToolbar hook (v2) Problem: The floating toolbar was causing infinite re-renders under certain conditions, leading to performance issues and potential browser hangs. This occurred when users interacted with text selections while the toolbar was visible. (#4646)
WHY the change was made:
HOW a consumer should update their code:
CHANGELOG · v50.3.1...v50.3.2 · By @narraje
@platejs/dnd
CHANGELOG · v50.3.0...v50.3.1 · By @sneridagh
@platejs/yjs
CHANGELOG · v50.2.5...v50.2.6 · By @dpnova
@platejs/floating
CHANGELOG · v50.2.2...v50.2.3 · By @narraje
@platejs/ai
applyAISuggestions utility for applying AI-generated content as suggestions with diff tracking (#4626)replacePlaceholders template system supporting {prompt}, {block}, {blockSelection}, {editor} placeholdersacceptAIChat transform to handle transient suggestions properly_replaceIds tracking@platejs/diff
@platejs/markdown
plainMarks option to exclude specific marks from markdown serialization (#4626)@platejs/suggestion
SkipSuggestionDeletes utility to extract text while excluding removed suggestions (#4626)getTransientSuggestionKey and filtering optionsacceptSuggestion to support inline elements like linkstransient parameter to getSuggestionProps and suggestion.nodes() APIs@platejs/comment
getTransientCommentKey utility for temporary comments (#4626)@platejs/list
@platejs/selection
insertBlocksAndSelect to handle fragment insertion better (#4626)@platejs/ai
Added AI Comment functionality to provide AI-powered text feedback and suggestions.And upgrade to AI SDK 5. (#4587)
AI Comment Integration: New utilities for AI-generated comments on selected text
aiCommentToRange() - Convert AI comments to text ranges with proper block mappingfindTextRangeInBlock() - Find text ranges within blocks for accurate comment positioningEnhanced AI Chat: Improved chat functionality with comment support
toolName property in chat helpers for tracking AI toolsmode, toolName params to submitAIChattoolName plugin option.Text Matching: Advanced text matching algorithms
1// Convert AI comment to text range
2const range = aiCommentToRange(editor, {
3 blockId: 'block-1',
4 content: 'Selected text',
5 comment: 'Consider adding more detail here',
6});streamInsertChunk has been moved from @platejs/ai to @platejs/ai/react.getEditorPrompt has been moved from @platejs/ai/react to @platejs/ai.getMarkdown has been moved from @platejs/ai/react to @platejs/ai.promptTemplate and systemTemplate have been removed. They are now used directly in api/ai/command/route.ts.{selection} has been renamed to {blockSelection}.@platejs/comment
Enhanced comment plugin to support AI-generated comments. (#4587)
transient option to tf.unsetMark to allow removing all AI comments at once.@platejs/markdown
Added support for preserving block IDs in markdown serialization to enable AI comment tracking. (#4587)
serializeMd to support withBlockId option for maintaining block references1// Serialize with block IDs preserved
2const markdown = serializeMd(editor, {
3 withBlockId: true,
4});
5// Output: <block id="block-1">Content here</block>@platejs/selection
selectionFallback option to api.getNodes. (#4587)
selectionFallback is set to true, and no nodes are selected by blockSelection, the method will use the editor's original selection to retrieve blocks.