Skip to content

Releases: udecode/plate

@udecode/[email protected]

05 Mar 01:51
24514fd
Compare
Choose a tag to compare

@udecode/[email protected]

02 Mar 15:46
79f5a49
Compare
Choose a tag to compare

@udecode/[email protected]

02 Mar 15:46
79f5a49
Compare
Choose a tag to compare

@udecode/[email protected]

02 Mar 15:46
79f5a49
Compare
Choose a tag to compare

Minor Changes

  • #3011 by @12joan

    • Remove shouldDiffDescendants option in favour of elementsAreRelated.

    • The elementsAreRelated option controls whether computeDiff treats a given pair of elements as "related" and thus tries to diff them. By default, elements are related if they have the same children OR they differ only in their children. Return null to use the default logic for a pair of elements.

      • Use case: In addition to supporting the same use case as the deprecated shouldDiffDescendants, elementsAreRelated can be used to ensure that computeDiff compares the correct pair of paragraphs.

        For example, by default, computeDiff would compare My slightly modified paragraph. with New paragraph in the following diff.

        - My slightly modified paragraph.
        + New paragraph
        + My slightly modified paragraph!

        If a custom elementsAreRelated function is provided that returns true for mostly similar paragraphs, computeDiff would instead compare My slightly modified paragraph. with My slightly modified paragraph!.

@udecode/[email protected]

01 Mar 17:01
c4696af
Compare
Choose a tag to compare

@udecode/[email protected]

01 Mar 17:01
c4696af
Compare
Choose a tag to compare

@udecode/[email protected]

01 Mar 17:01
c4696af
Compare
Choose a tag to compare

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

@udecode/[email protected]

01 Mar 10:18
a501e81
Compare
Choose a tag to compare

Patch Changes

@udecode/[email protected]

23 Feb 09:03
7571ede
Compare
Choose a tag to compare

@udecode/[email protected]

23 Feb 09:03
7571ede
Compare
Choose a tag to compare