github udecode/plate @udecode/plate-diff@30.8.0

latest releases: @udecode/plate-trailing-block@40.0.0, @udecode/plate-yjs@40.0.0, @udecode/plate-toggle@40.0.0...
8 months ago

Minor Changes

  • #3009 by @12joan
    • Add shouldDiffDescendants option to computeDiff to control whether a pair of descendant lists should be diffed. If false, the parent node will be deleted and re-inserted. Defaults to () => true.
      • Example use case: To prevent computeDiff from diffing the text of unrelated paragraphs, use a text similarity checking algorithm to determine whether the paragraphs are sufficiently similar, and return false if not.
    • When multiple consecutive nodes have been deleted and inserted, computeDiff now groups all consecutive deletions together and does the same with all consecutive insertions.
      • Example of a diff prior to this change:
        - Old paragraph 1
        + New paragraph 1
        - Old paragraph 2
        + New paragraph 2
      • Example of a diff after this change:
        - Old paragraph 1
        - Old paragraph 2
        + New paragraph 1
        + New paragraph 2

Don't miss a new plate release

NewReleases is sending notifications on new releases.