v50 Releases

RSS
v50.3.7

@platejs/ai

Bug Fixes

  • Import createZustandStore from platejs/react (#4689)

@platejs/core

Bug Fixes

  • Decouple createSlateEditor from React: (#4689)

    • createZustandStore from @platejs/core (or platejs) is now a vanilla store without React-specific functionality (hooks).
    • The previous behavior of 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

Bug Fixes

  • Import createZustandStore from platejs/react (#4689)

CHANGELOG · v50.3.6...v50.3.7 · By @felixfeng33

v50.3.2

@platejs/floating

Bug Fixes

  • 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:

    • Infinite re-rendering was caused by the open dependency in the useEffect hook.
    • The open dependency was removed and the setOpen function was called with a functional update to access the previous state.

    HOW a consumer should update their code:

    • No action required. The change is internal and does not affect consumer code.

CHANGELOG · v50.3.1...v50.3.2 · By @narraje

v50.2.0

@platejs/ai

Features

  • Add applyAISuggestions utility for applying AI-generated content as suggestions with diff tracking (#4626)
  • Add replacePlaceholders template system supporting {prompt}, {block}, {blockSelection}, {editor} placeholders
  • Improve acceptAIChat transform to handle transient suggestions properly
  • Add block selection mode support with _replaceIds tracking
  • Fix suggestion acceptance and cleanup in chat mode

@platejs/diff

Features

  • Improve diffing of inline elements with same type (#4626)

@platejs/markdown

Features

  • Add plainMarks option to exclude specific marks from markdown serialization (#4626)
  • Improve mark handling in text serialization

@platejs/suggestion

Features

  • Add SkipSuggestionDeletes utility to extract text while excluding removed suggestions (#4626)
  • Add transient suggestions support with getTransientSuggestionKey and filtering options
  • Unify adjacent insert/remove suggestion IDs for better UI handling
  • Improve acceptSuggestion to support inline elements like links
  • Add transient parameter to getSuggestionProps and suggestion.nodes() APIs

@platejs/comment

Bug Fixes

  • Add getTransientCommentKey utility for temporary comments (#4626)

@platejs/list

Bug Fixes

  • Fix list operations with improved selection handling (#4626)

@platejs/selection

Bug Fixes

  • Improve insertBlocksAndSelect to handle fragment insertion better (#4626)

CHANGELOG · v50.1.2...v50.2.0 · By @felixfeng33

v50.0.0

@platejs/ai

Breaking Changes

  • Added AI Comment functionality to provide AI-powered text feedback and suggestions.And upgrade to AI SDK 5. (#4587)

    New Features:

    • AI Comment Integration: New utilities for AI-generated comments on selected text

      • aiCommentToRange() - Convert AI comments to text ranges with proper block mapping
      • findTextRangeInBlock() - Find text ranges within blocks for accurate comment positioning
    • Enhanced AI Chat: Improved chat functionality with comment support

      • New toolName property in chat helpers for tracking AI tools
      • Support for AI comment prompts in chat submissions
      • Added mode, toolName params to submitAIChat
      • New toolName plugin option.
    • Text Matching: Advanced text matching algorithms

      • Longest Common Subsequence (LCS) algorithm for fuzzy text matching
      • Support for multi-block text selection and comment ranges
      • Accurate text position tracking across block boundaries

    Example:

    typescript
    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});

    Breaking Changes:

    • 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.
    • The placeholder {selection} has been renamed to {blockSelection}.

@platejs/comment

Bug Fixes

  • Enhanced comment plugin to support AI-generated comments. (#4587)

    Changes:

    • Added a transient option to tf.unsetMark to allow removing all AI comments at once.

@platejs/markdown

Bug Fixes

  • Added support for preserving block IDs in markdown serialization to enable AI comment tracking. (#4587)

    Changes:

    • Enhanced Serialization: Updated serializeMd to support withBlockId option for maintaining block references

    Example:

    typescript
    1// Serialize with block IDs preserved 2const markdown = serializeMd(editor, { 3 withBlockId: true, 4}); 5// Output: <block id="block-1">Content here</block>

@platejs/selection

Bug Fixes

  • Added a selectionFallback option to api.getNodes. (#4587)
    • If selectionFallback is set to true, and no nodes are selected by blockSelection, the method will use the editor's original selection to retrieve blocks.

CHANGELOG · v49.2.22...v50.0.0 · By @felixfeng33