@portabletext/editor 8.0.1 → 8.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1633,98 +1633,6 @@ type SetSelectionOperation = {
1633
1633
  * @beta
1634
1634
  */
1635
1635
  type EngineOperation = InsertOperation | SetOperation | UnsetOperation | SetSelectionOperation | InsertTextOperation | RemoveTextOperation;
1636
- type DecoratedRange = Range & {
1637
- rangeDecoration: RangeDecoration;
1638
- };
1639
- /**
1640
- * The operation channel is the single place to observe every `EngineOperation` the
1641
- * engine applies.
1642
- *
1643
- * Guarantees:
1644
- *
1645
- * - Listeners run synchronously, in subscription order.
1646
- * - `before` listeners run before the operation touches the editor state,
1647
- * `after` listeners run once the operation (including any normalization it
1648
- * triggered) has been fully applied.
1649
- * - Normalization fixes re-enter `editor.apply`, so a fix operation's events
1650
- * fire nested between the triggering operation's `before` and `after`
1651
- * events — a fix's `after` listeners run before the triggering
1652
- * operation's.
1653
- */
1654
- type OperationOrigin = 'local' | 'remote' | 'undo' | 'redo' | 'normalization';
1655
- type OperationEvent = {
1656
- /**
1657
- * The operation object is enriched in place during apply — `inverse` gets
1658
- * populated and inserted nodes may be re-keyed — so `after` listeners
1659
- * observe the final operation.
1660
- */
1661
- operation: EngineOperation;
1662
- /**
1663
- * `editor.snapshot.context.value` captured at apply entry. Operations
1664
- * replace the value array instead of mutating it, so this reference keeps
1665
- * pointing at the pre-apply value.
1666
- */
1667
- beforeValue: Array<PortableTextBlock>;
1668
- /**
1669
- * `editor.snapshot.context.selection` captured at apply entry. Selections
1670
- * are replaced, not mutated, so this reference stays pre-apply.
1671
- */
1672
- beforeSelection: EditorSelection;
1673
- /**
1674
- * Whether `editor.operations` already held unflushed operations at apply
1675
- * entry.
1676
- */
1677
- operationsInProgress: boolean;
1678
- isNormalizingNode: boolean;
1679
- isPatching: boolean;
1680
- isProcessingRemoteChanges: boolean;
1681
- isUndoing: boolean;
1682
- isRedoing: boolean;
1683
- withHistory: boolean;
1684
- undoStepId: string | undefined;
1685
- /**
1686
- * Derived from the engine flags above, for declarative filtering.
1687
- */
1688
- origin: OperationOrigin;
1689
- };
1690
- type OperationListener = (event: OperationEvent) => void;
1691
- /**
1692
- * The `Location` interface is a union of the ways to refer to a specific
1693
- * location in a document: paths, points or ranges.
1694
- *
1695
- * Methods will often accept a `Location` instead of requiring only a `Path`,
1696
- * `Point` or `Range`. This eliminates the need for developers to manage
1697
- * converting between the different interfaces in their own code base.
1698
- */
1699
- type Location = Path | Point | Range;
1700
- /**
1701
- * `PathRef` objects keep a specific path in a document synced over time as new
1702
- * operations are applied to the editor. You can access their `current` property
1703
- * at any time for the up-to-date path value.
1704
- */
1705
- interface PathRef {
1706
- current: Path | null;
1707
- affinity: 'forward' | 'backward' | null;
1708
- unref(): Path | null;
1709
- }
1710
- interface PathRefInterface {
1711
- transform: (ref: PathRef, op: EngineOperation) => void;
1712
- }
1713
- declare const PathRef: PathRefInterface;
1714
- /**
1715
- * `PointRef` objects keep a specific point in a document synced over time as new
1716
- * operations are applied to the editor. You can access their `current` property
1717
- * at any time for the up-to-date point value.
1718
- */
1719
- interface PointRef {
1720
- current: Point | null;
1721
- affinity: TextDirection | null;
1722
- unref(): Point | null;
1723
- }
1724
- interface PointRefInterface {
1725
- transform: (ref: PointRef, op: EngineOperation) => void;
1726
- }
1727
- declare const PointRef: PointRefInterface;
1728
1636
  /**
1729
1637
  * `RangeRef` objects keep a specific range in a document synced over time as new
1730
1638
  * operations are applied to the editor. You can access their `current` property
@@ -1735,40 +1643,6 @@ interface RangeRef {
1735
1643
  affinity: 'forward' | 'backward' | 'outward' | 'inward' | null;
1736
1644
  unref(): Range | null;
1737
1645
  }
1738
- /**
1739
- * The `Editor` interface stores all the state of a editor. It is extended
1740
- * by plugins that wish to add their own helpers and implement new behaviors.
1741
- */
1742
- interface BaseEditor {
1743
- operations: EngineOperation[];
1744
- operationListeners: {
1745
- before: Array<OperationListener>;
1746
- after: Array<OperationListener>;
1747
- };
1748
- dirtyPaths: Path[];
1749
- dirtyPathKeys: Set<string>;
1750
- flushing: boolean;
1751
- normalizing: boolean;
1752
- pathRefs: Set<PathRef>;
1753
- pointRefs: Set<PointRef>;
1754
- rangeRefs: Set<RangeRef>;
1755
- apply: (operation: EngineOperation) => void;
1756
- normalizeNode: (entry: [Editor$1 | Node$1, Path], options?: {
1757
- operation?: EngineOperation;
1758
- }) => void;
1759
- onChange: (options?: {
1760
- operation?: EngineOperation;
1761
- }) => void;
1762
- shouldNormalize: ({ iteration, dirtyPaths, operation }: {
1763
- iteration: number;
1764
- initialDirtyPathsLength: number;
1765
- dirtyPaths: Path[];
1766
- operation?: EngineOperation;
1767
- }) => boolean;
1768
- select: (target: Location) => void;
1769
- setSelection: (props: Partial<Range>) => void;
1770
- }
1771
- type Editor$1 = BaseEditor & DOMEditor & PortableTextEditorEngine;
1772
1646
  type StringDiff = {
1773
1647
  start: number;
1774
1648
  end: number;
@@ -1902,6 +1776,132 @@ interface DOMEditorInterface {
1902
1776
  }) => T extends true ? Range | null : Range;
1903
1777
  }
1904
1778
  declare const DOMEditor: DOMEditorInterface;
1779
+ /**
1780
+ * The `Location` interface is a union of the ways to refer to a specific
1781
+ * location in a document: paths, points or ranges.
1782
+ *
1783
+ * Methods will often accept a `Location` instead of requiring only a `Path`,
1784
+ * `Point` or `Range`. This eliminates the need for developers to manage
1785
+ * converting between the different interfaces in their own code base.
1786
+ */
1787
+ type Location = Path | Point | Range;
1788
+ /**
1789
+ * `PathRef` objects keep a specific path in a document synced over time as new
1790
+ * operations are applied to the editor. You can access their `current` property
1791
+ * at any time for the up-to-date path value.
1792
+ */
1793
+ interface PathRef {
1794
+ current: Path | null;
1795
+ affinity: 'forward' | 'backward' | null;
1796
+ unref(): Path | null;
1797
+ }
1798
+ interface PathRefInterface {
1799
+ transform: (ref: PathRef, op: EngineOperation) => void;
1800
+ }
1801
+ declare const PathRef: PathRefInterface;
1802
+ /**
1803
+ * `PointRef` objects keep a specific point in a document synced over time as new
1804
+ * operations are applied to the editor. You can access their `current` property
1805
+ * at any time for the up-to-date point value.
1806
+ */
1807
+ interface PointRef {
1808
+ current: Point | null;
1809
+ affinity: TextDirection | null;
1810
+ unref(): Point | null;
1811
+ }
1812
+ interface PointRefInterface {
1813
+ transform: (ref: PointRef, op: EngineOperation) => void;
1814
+ }
1815
+ declare const PointRef: PointRefInterface;
1816
+ /**
1817
+ * The `Editor` interface stores all the state of a editor. It is extended
1818
+ * by plugins that wish to add their own helpers and implement new behaviors.
1819
+ */
1820
+ interface BaseEditor {
1821
+ operations: EngineOperation[];
1822
+ operationListeners: {
1823
+ before: Array<OperationListener>;
1824
+ after: Array<OperationListener>;
1825
+ };
1826
+ dirtyPaths: Path[];
1827
+ dirtyPathKeys: Set<string>;
1828
+ flushing: boolean;
1829
+ normalizing: boolean;
1830
+ pathRefs: Set<PathRef>;
1831
+ pointRefs: Set<PointRef>;
1832
+ rangeRefs: Set<RangeRef>;
1833
+ apply: (operation: EngineOperation) => void;
1834
+ normalizeNode: (entry: [Editor$1 | Node$1, Path], options?: {
1835
+ operation?: EngineOperation;
1836
+ }) => void;
1837
+ onChange: (options?: {
1838
+ operation?: EngineOperation;
1839
+ }) => void;
1840
+ shouldNormalize: ({ iteration, dirtyPaths, operation }: {
1841
+ iteration: number;
1842
+ initialDirtyPathsLength: number;
1843
+ dirtyPaths: Path[];
1844
+ operation?: EngineOperation;
1845
+ }) => boolean;
1846
+ select: (target: Location) => void;
1847
+ setSelection: (props: Partial<Range>) => void;
1848
+ }
1849
+ type Editor$1 = BaseEditor & DOMEditor & PortableTextEditorEngine;
1850
+ /**
1851
+ * The operation channel is the single place to observe every `EngineOperation` the
1852
+ * engine applies.
1853
+ *
1854
+ * Guarantees:
1855
+ *
1856
+ * - Listeners run synchronously, in subscription order.
1857
+ * - `before` listeners run before the operation touches the editor state,
1858
+ * `after` listeners run once the operation (including any normalization it
1859
+ * triggered) has been fully applied.
1860
+ * - Normalization fixes re-enter `editor.apply`, so a fix operation's events
1861
+ * fire nested between the triggering operation's `before` and `after`
1862
+ * events — a fix's `after` listeners run before the triggering
1863
+ * operation's.
1864
+ */
1865
+ type OperationOrigin = 'local' | 'remote' | 'undo' | 'redo' | 'normalization';
1866
+ type OperationEvent = {
1867
+ /**
1868
+ * The operation object is enriched in place during apply — `inverse` gets
1869
+ * populated and inserted nodes may be re-keyed — so `after` listeners
1870
+ * observe the final operation.
1871
+ */
1872
+ operation: EngineOperation;
1873
+ /**
1874
+ * `editor.snapshot.context.value` captured at apply entry. Operations
1875
+ * replace the value array instead of mutating it, so this reference keeps
1876
+ * pointing at the pre-apply value.
1877
+ */
1878
+ beforeValue: Array<PortableTextBlock>;
1879
+ /**
1880
+ * `editor.snapshot.context.selection` captured at apply entry. Selections
1881
+ * are replaced, not mutated, so this reference stays pre-apply.
1882
+ */
1883
+ beforeSelection: EditorSelection;
1884
+ /**
1885
+ * Whether `editor.operations` already held unflushed operations at apply
1886
+ * entry.
1887
+ */
1888
+ operationsInProgress: boolean;
1889
+ isNormalizingNode: boolean;
1890
+ isPatching: boolean;
1891
+ isProcessingRemoteChanges: boolean;
1892
+ isUndoing: boolean;
1893
+ isRedoing: boolean;
1894
+ withHistory: boolean;
1895
+ undoStepId: string | undefined;
1896
+ /**
1897
+ * Derived from the engine flags above, for declarative filtering.
1898
+ */
1899
+ origin: OperationOrigin;
1900
+ };
1901
+ type OperationListener = (event: OperationEvent) => void;
1902
+ type DecoratedRange = Range & {
1903
+ rangeDecoration: RangeDecoration;
1904
+ };
1905
1905
  type HistoryItem = {
1906
1906
  operations: EngineOperation[];
1907
1907
  timestamp: Date;
@@ -3395,4 +3395,4 @@ type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (payload: {
3395
3395
  dom: EditorDom;
3396
3396
  }, guardResponse: TGuardResponse) => Array<BehaviorAction>;
3397
3397
  export { BehaviorGuard as $, defineBlockObject as $t, PortableTextSpan$1 as A, Annotation as At, usePortableTextEditor as B, DecoratorRender as Bt, ListDefinition as C, EditorSchema as Ct, PortableTextBlock$1 as D, RegisteredInlineObject as Dt, Patch$1 as E, RegisteredContainer as Et, defineSchema as F, BlockObjectRenderProps as Ft, Editor as G, RegistrableNode as Gt, useEditorSelector as H, InlineObject as Ht, BlockOffset as I, Container as It, EditorEmittedEvent as J, SpanRenderProps as Jt, EditorConfig as K, Span as Kt, useEditor as L, ContainerRender as Lt, SchemaDefinition$1 as M, AnnotationRenderProps as Mt, StyleDefinition as N, BlockObject as Nt, PortableTextChild$1 as O, RegisteredPositional as Ot, StyleSchemaType as P, BlockObjectRender as Pt, defineBehavior as Q, defineAnnotation as Qt, defaultKeyGenerator as R, ContainerRenderProps as Rt, InlineObjectSchemaType as S, Node$1 as St, OfDefinition$1 as T, RegisteredBlockObject as Tt, EditorProvider as U, InlineObjectRender as Ut, EditorSelector as V, DecoratorRenderProps as Vt, EditorProviderProps as W, InlineObjectRenderProps as Wt, Operation as X, TextBlockRender as Xt, MutationEvent as Y, TextBlock as Yt, Behavior as Z, TextBlockRenderProps as Zt, BlockObjectSchemaType as _, PortableTextEditable as _t, forward as a, AnnotationPath as an, EditorSelectionPoint as at, FieldDefinition$1 as b, PortableTextEditor as bt, CustomBehaviorEvent as c, KeyedSegment as cn, OnPasteFn as ct, SyntheticBehaviorEvent as d, PasteData as dt, defineContainer as en, EditorContext as et, PatchesEvent as f, RangeDecoration as ft, BlockObjectDefinition as g, ScrollSelectionIntoViewFunction as gt, BaseDefinition as h, RenderPlaceholderFunction as ht, execute as i, defineTextBlock as in, EditorSelection as it, PortableTextTextBlock$1 as j, AnnotationRender as jt, PortableTextObject$1 as k, RegisteredSpan as kt, InsertPlacement as l, Path as ln, OnPasteResult as lt, AnnotationSchemaType as m, RenderEditableFunction as mt, BehaviorActionSet as n, defineInlineObject as nn, AddedAnnotationPaths as nt, raise$1 as o, BlockPath as on, InvalidValueResolution as ot, AnnotationDefinition as p, RangeDecorationOnMovedDetails as pt, EditorEvent as q, SpanRender as qt, effect as r, defineSpan as rn, EditableAPIDeleteOptions as rt, BehaviorEvent as s, ChildPath as sn, OnCopyFn as st, BehaviorAction as t, defineDecorator as tn, EditorSnapshot as tt, NativeBehaviorEvent as u, PathSegment as un, OnPasteResultOrPromise as ut, DecoratorDefinition as v, PortableTextEditableProps as vt, ListSchemaType as w, Containers as wt, InlineObjectDefinition as x, TraversalSnapshot as xt, DecoratorSchemaType as y, HotkeyOptions as yt, usePortableTextEditorSelection as z, Decorator as zt };
3398
- //# sourceMappingURL=behavior.types.action-CcO4rAdL.d.ts.map
3398
+ //# sourceMappingURL=behavior.types.action-C6D8CCF9.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"behavior.types.action-C6D8CCF9.d.ts","names":[],"sources":["../src/internal-utils/mime-type.ts","../src/type-utils.ts","../src/converters/converter.types.ts","../src/types/paths.ts","../src/renderers/renderer.types.ts","../src/schema/container-types.ts","../src/editor/editor-schema.ts","../src/engine/interfaces/node.ts","../src/traversal/traversal-snapshot.ts","../src/editor/PortableTextEditor.tsx","../src/types/options.ts","../src/editor/Editable.tsx","../src/types/editor.ts","../src/engine/types/types.ts","../src/engine/interfaces/point.ts","../src/engine/interfaces/range.ts","../src/engine/interfaces/operation.ts","../src/engine/interfaces/range-ref.ts","../src/engine/dom/utils/diff-text.ts","../src/engine/dom/utils/dom.ts","../src/engine/dom/plugin/dom-editor.ts","../src/engine/interfaces/location.ts","../src/engine/interfaces/path-ref.ts","../src/engine/interfaces/point-ref.ts","../src/engine/interfaces/editor.ts","../src/engine/core/operation-channel.ts","../src/editor/range-decorations-machine.ts","../src/types/editor-engine.ts","../src/editor/editor-snapshot.ts","../src/behaviors/behavior.types.guard.ts","../src/behaviors/behavior.types.behavior.ts","../src/types/operation.ts","../src/editor/relay.ts","../src/editor.ts","../src/editor/editor-provider.tsx","../src/editor/editor-selector.ts","../src/editor/usePortableTextEditor.ts","../src/editor/usePortableTextEditorSelection.tsx","../src/utils/key-generator.ts","../src/editor/use-editor.ts","../src/types/block-offset.ts","../src/priority/priority.types.ts","../src/behaviors/behavior.config.ts","../src/editor/editor-machine.ts","../src/internal-utils/event-position.ts","../src/types/block-with-optional-key.ts","../src/behaviors/behavior.types.event.ts","../src/editor/editor-dom.ts","../src/behaviors/behavior.types.action.ts"],"mappings":";;;;KAAY;;;;KCGA,cACV,QACA,sBAAsB,QACtB,oBAAoB,OAAO,YACzB,eAAe,OAAO,SAAS,eAAe;KAWtC,eAAe,QAAQ,6BAA6B;EAC9D,YAAY;OAGP,WAAW,SAAS,sBACd,cAAc,wBACjB,OAAO;KAIL,cAAc,GAAG,UAAU,KAAK;KCvBhC,UAAU,kBAAkB,WAAW;EACjD,UAAU;EACV,WAAW,WAAW;EACtB,aAAa,aAAa;;KASvB,eAAe,kBAAkB,WAAW;EAE3C;EACA;;EAGA;EACA,UAAU;EACV;EACA;;EAGA;EACA;EACA,UAAU;EACV;;EAGA;EACA;;EAGA;EACA,UAAU;EACV;;EAGA;EACA,MAAM,MAAM;EACZ,UAAU;;KAGJ,WAAW,kBAAkB,eACvC,UACA;EAEA,UAAU;EACV,OAAO,cAAc,eAAe;MAChC,cACJ,eAAe;KAKL,aAAa,kBAAkB,eACzC,UACA;EAEA,UAAU;EACV,OAAO,cAAc,eAAe;MAChC,cACJ,eAAe;;;;;UChEA;EACf;;;;;;KAOU;;;;;;;;;KAUA,gCAAgC,eAAe;;;;;KAM/C,OAAO;;;;;;KAOP,YAAY;;;;;;KAOZ,iBAAiB;;;;;;KAOjB,YAAY;;;;;;;;;;;;KC7BZ;EACV,YAAY;EACZ,UAAU;EACV;EACA,MAAM;EACN,MAAM;EACN;EACA;;;;;;;;;;;;;;EAcA,gBAAgB,OAAO,yBAAyB;;;;;KAKtC,mBAAmB,OAAO,yBAAyB;;;;;;;;;;KAWnD;EACV,YAAY;EACZ,UAAU;EACV;EACA,MAAM;EACN,MAAM;EACN;EACA;;;;;EAKA,gBAAgB,OAAO,oBAAoB;;;;;KAKjC,cAAc,OAAO,oBAAoB;;;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;EAKxB,mBAAmB,UAAU,mBAAmB;;;;;;;;EAQhD,wBAAwB;IACtB;IACA;QACI;EACN,uBAAuB,UAAU,mBAAmB;EACpD,qBAAqB,UAAU,mBAAmB;;;;;EAKlD,iBACE,OACA;IAEA,OAAO,cAAc;IACrB;MACE,SAAS;MACT;MACA;;;;;;;KCrCM;EAEN;EACA,OAAO;;EAGP;EACA,OAAO,sBAAsB,yBAAyB;;EAGtD;EACA,OAAO,yBAAyB;;EAGhC;EACA,SAAS;;;;;;;;;;;;;;;;;;;;;;;IAuBP,OAAO,OAAO;;;;;;;;;;;;;;;;;;;;iBAqBN,QACd,OAAO,yBACN,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyCD,QACd,OAAO,sBAAsB,yBAAyB,sBACrD,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCD,QACd,OAAO,yBAAyB,sBAC/B,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8CD,OACd,QAAQ,cAAc,8CACrB,cAAc;;;;KAOL,kBAAkB,gBAAgB,mBAC5C;EACE,UAAU;EACV,OAAO;EACP,KAAK;GAEP,eAAe,mBACZ,MAAM"}
@@ -1,2 +1,2 @@
1
- import { $ as BehaviorGuard, Q as defineBehavior, Z as Behavior, a as forward, c as CustomBehaviorEvent, d as SyntheticBehaviorEvent, i as execute, l as InsertPlacement, n as BehaviorActionSet, o as raise, r as effect, s as BehaviorEvent, t as BehaviorAction, u as NativeBehaviorEvent } from "../behavior.types.action-CcO4rAdL.js";
1
+ import { $ as BehaviorGuard, Q as defineBehavior, Z as Behavior, a as forward, c as CustomBehaviorEvent, d as SyntheticBehaviorEvent, i as execute, l as InsertPlacement, n as BehaviorActionSet, o as raise, r as effect, s as BehaviorEvent, t as BehaviorAction, u as NativeBehaviorEvent } from "../behavior.types.action-C6D8CCF9.js";
2
2
  export { type Behavior, type BehaviorAction, type BehaviorActionSet, type BehaviorEvent, type BehaviorGuard, type CustomBehaviorEvent, type InsertPlacement, type NativeBehaviorEvent, type SyntheticBehaviorEvent, defineBehavior, effect, execute, forward, raise };
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $t as defineBlockObject, A as PortableTextSpan, At as Annotation, B as usePortableTextEditor, Bt as DecoratorRender, C as ListDefinition, Ct as EditorSchema, D as PortableTextBlock, Dt as RegisteredInlineObject, E as Patch, Et as RegisteredContainer, F as defineSchema, Ft as BlockObjectRenderProps, G as Editor, Gt as RegistrableNode, H as useEditorSelector, Ht as InlineObject, I as BlockOffset, It as Container, J as EditorEmittedEvent, Jt as SpanRenderProps, K as EditorConfig, Kt as Span, L as useEditor, Lt as ContainerRender, M as SchemaDefinition, Mt as AnnotationRenderProps, N as StyleDefinition, Nt as BlockObject, O as PortableTextChild, Ot as RegisteredPositional, P as StyleSchemaType, Pt as BlockObjectRender, Qt as defineAnnotation, R as defaultKeyGenerator, Rt as ContainerRenderProps, S as InlineObjectSchemaType, T as OfDefinition, Tt as RegisteredBlockObject, U as EditorProvider, Ut as InlineObjectRender, V as EditorSelector, Vt as DecoratorRenderProps, W as EditorProviderProps, Wt as InlineObjectRenderProps, X as Operation, Xt as TextBlockRender, Y as MutationEvent, Yt as TextBlock, Zt as TextBlockRenderProps, _ as BlockObjectSchemaType, _t as PortableTextEditable, an as AnnotationPath, at as EditorSelectionPoint, b as FieldDefinition, bt as PortableTextEditor, ct as OnPasteFn, dt as PasteData, en as defineContainer, et as EditorContext, f as PatchesEvent, ft as RangeDecoration, g as BlockObjectDefinition, gt as ScrollSelectionIntoViewFunction, h as BaseDefinition, ht as RenderPlaceholderFunction, in as defineTextBlock, it as EditorSelection, j as PortableTextTextBlock, jt as AnnotationRender, k as PortableTextObject, kt as RegisteredSpan, ln as Path, lt as OnPasteResult, m as AnnotationSchemaType, mt as RenderEditableFunction, nn as defineInlineObject, nt as AddedAnnotationPaths, on as BlockPath, ot as InvalidValueResolution, p as AnnotationDefinition, pt as RangeDecorationOnMovedDetails, q as EditorEvent, qt as SpanRender, rn as defineSpan, rt as EditableAPIDeleteOptions, sn as ChildPath, st as OnCopyFn, tn as defineDecorator, tt as EditorSnapshot, ut as OnPasteResultOrPromise, v as DecoratorDefinition, vt as PortableTextEditableProps, w as ListSchemaType, wt as Containers, x as InlineObjectDefinition, y as DecoratorSchemaType, yt as HotkeyOptions, z as usePortableTextEditorSelection, zt as Decorator } from "./behavior.types.action-CcO4rAdL.js";
1
+ import { $t as defineBlockObject, A as PortableTextSpan, At as Annotation, B as usePortableTextEditor, Bt as DecoratorRender, C as ListDefinition, Ct as EditorSchema, D as PortableTextBlock, Dt as RegisteredInlineObject, E as Patch, Et as RegisteredContainer, F as defineSchema, Ft as BlockObjectRenderProps, G as Editor, Gt as RegistrableNode, H as useEditorSelector, Ht as InlineObject, I as BlockOffset, It as Container, J as EditorEmittedEvent, Jt as SpanRenderProps, K as EditorConfig, Kt as Span, L as useEditor, Lt as ContainerRender, M as SchemaDefinition, Mt as AnnotationRenderProps, N as StyleDefinition, Nt as BlockObject, O as PortableTextChild, Ot as RegisteredPositional, P as StyleSchemaType, Pt as BlockObjectRender, Qt as defineAnnotation, R as defaultKeyGenerator, Rt as ContainerRenderProps, S as InlineObjectSchemaType, T as OfDefinition, Tt as RegisteredBlockObject, U as EditorProvider, Ut as InlineObjectRender, V as EditorSelector, Vt as DecoratorRenderProps, W as EditorProviderProps, Wt as InlineObjectRenderProps, X as Operation, Xt as TextBlockRender, Y as MutationEvent, Yt as TextBlock, Zt as TextBlockRenderProps, _ as BlockObjectSchemaType, _t as PortableTextEditable, an as AnnotationPath, at as EditorSelectionPoint, b as FieldDefinition, bt as PortableTextEditor, ct as OnPasteFn, dt as PasteData, en as defineContainer, et as EditorContext, f as PatchesEvent, ft as RangeDecoration, g as BlockObjectDefinition, gt as ScrollSelectionIntoViewFunction, h as BaseDefinition, ht as RenderPlaceholderFunction, in as defineTextBlock, it as EditorSelection, j as PortableTextTextBlock, jt as AnnotationRender, k as PortableTextObject, kt as RegisteredSpan, ln as Path, lt as OnPasteResult, m as AnnotationSchemaType, mt as RenderEditableFunction, nn as defineInlineObject, nt as AddedAnnotationPaths, on as BlockPath, ot as InvalidValueResolution, p as AnnotationDefinition, pt as RangeDecorationOnMovedDetails, q as EditorEvent, qt as SpanRender, rn as defineSpan, rt as EditableAPIDeleteOptions, sn as ChildPath, st as OnCopyFn, tn as defineDecorator, tt as EditorSnapshot, ut as OnPasteResultOrPromise, v as DecoratorDefinition, vt as PortableTextEditableProps, w as ListSchemaType, wt as Containers, x as InlineObjectDefinition, y as DecoratorSchemaType, yt as HotkeyOptions, z as usePortableTextEditorSelection, zt as Decorator } from "./behavior.types.action-C6D8CCF9.js";
2
2
  export { type AddedAnnotationPaths, type Annotation, type AnnotationDefinition, type AnnotationPath, type AnnotationRender, type AnnotationRenderProps, type AnnotationSchemaType, type BaseDefinition, type BlockObject, type BlockObjectDefinition, type BlockObjectRender, type BlockObjectRenderProps, type BlockObjectSchemaType, type BlockOffset, type BlockPath, type ChildPath, type Container, type ContainerRender, type ContainerRenderProps, type Containers, type Decorator, type DecoratorDefinition, type DecoratorRender, type DecoratorRenderProps, type DecoratorSchemaType, type EditableAPIDeleteOptions, type Editor, type EditorConfig, type EditorContext, type EditorEmittedEvent, type EditorEvent, EditorProvider, type EditorProviderProps, type EditorSchema, type EditorSelection, type EditorSelectionPoint, type EditorSelector, type EditorSnapshot, type FieldDefinition, type HotkeyOptions, type InlineObject, type InlineObjectDefinition, type InlineObjectRender, type InlineObjectRenderProps, type InlineObjectSchemaType, type InvalidValueResolution, type ListDefinition, type ListSchemaType, type MutationEvent, type OfDefinition, type OnCopyFn, type OnPasteFn, type OnPasteResult, type OnPasteResultOrPromise, type Operation, type PasteData, type Patch, type PatchesEvent, type Path, type PortableTextBlock, type PortableTextChild, PortableTextEditable, type PortableTextEditableProps, PortableTextEditor, type PortableTextObject, type PortableTextSpan, type PortableTextTextBlock, type RangeDecoration, type RangeDecorationOnMovedDetails, type RegisteredBlockObject, type RegisteredContainer, type RegisteredInlineObject, type RegisteredPositional, type RegisteredSpan, type RegistrableNode, type RenderEditableFunction, type RenderPlaceholderFunction, type SchemaDefinition, type ScrollSelectionIntoViewFunction, type Span, type SpanRender, type SpanRenderProps, type StyleDefinition, type StyleSchemaType, type TextBlock, type TextBlockRender, type TextBlockRenderProps, defineAnnotation, defineBlockObject, defineContainer, defineDecorator, defineInlineObject, defineSchema, defineSpan, defineTextBlock, defaultKeyGenerator as keyGenerator, useEditor, useEditorSelector, usePortableTextEditor, usePortableTextEditorSelection };
package/lib/index.js CHANGED
@@ -1179,13 +1179,14 @@ function mapPointThroughStep(step, point, options = {}) {
1179
1179
  };
1180
1180
  }
1181
1181
  case "rekey": {
1182
- let path;
1183
- for (let i = 0; i < point.path.length; i++) {
1184
- let segment = point.path[i];
1185
- isKeyedSegment(segment) && segment._key === step.oldKey && (path === void 0 && (path = [...point.path]), path[i] = { _key: step.newKey });
1186
- }
1187
- return path === void 0 ? point : {
1188
- path,
1182
+ if (point.path.length <= step.path.length || !pathEquals(point.path.slice(0, step.path.length), step.path)) return point;
1183
+ let segment = point.path[step.path.length];
1184
+ return !isKeyedSegment(segment) || segment._key !== step.oldKey ? point : {
1185
+ path: [
1186
+ ...step.path,
1187
+ { _key: step.newKey },
1188
+ ...point.path.slice(step.path.length + 1)
1189
+ ],
1189
1190
  offset: point.offset
1190
1191
  };
1191
1192
  }
@@ -1303,6 +1304,7 @@ function operationToSteps(op) {
1303
1304
  let oldKey = op.inverse?.type === "set" && typeof op.inverse.value == "string" ? op.inverse.value : void 0;
1304
1305
  return oldKey ? [{
1305
1306
  type: "rekey",
1307
+ path: nodePath.slice(0, -1),
1306
1308
  oldKey,
1307
1309
  newKey: op.value
1308
1310
  }] : [];
@@ -4187,7 +4189,8 @@ function transformRange(range, op, root, options = {}) {
4187
4189
  const engineOperationCallback = ({ input, sendBack }) => subscribeToOperations(input.editorEngine, (event) => {
4188
4190
  event.operation.type !== "set.selection" && sendBack({
4189
4191
  type: "engine operation",
4190
- operation: event.operation
4192
+ operation: event.operation,
4193
+ origin: event.origin
4191
4194
  });
4192
4195
  }, { phase: "before" }), rangeDecorationsMachine = setup({
4193
4196
  types: {
@@ -4243,7 +4246,7 @@ const engineOperationCallback = ({ input, sendBack }) => subscribeToOperations(i
4243
4246
  decoratedRange.rangeDecoration.onMoved?.({
4244
4247
  newSelection: null,
4245
4248
  rangeDecoration: decoratedRange.rangeDecoration,
4246
- origin: "local"
4249
+ origin: event.origin === "remote" ? "remote" : "local"
4247
4250
  });
4248
4251
  continue;
4249
4252
  }
@@ -4251,7 +4254,7 @@ const engineOperationCallback = ({ input, sendBack }) => subscribeToOperations(i
4251
4254
  (newRange && newRange !== currentSelection || newRange === null && currentSelection) && decoratedRange.rangeDecoration.onMoved?.({
4252
4255
  newSelection: newRange,
4253
4256
  rangeDecoration: decoratedRange.rangeDecoration,
4254
- origin: "local"
4257
+ origin: event.origin === "remote" ? "remote" : "local"
4255
4258
  }), newRange !== null && rangeDecorationState.push({
4256
4259
  ...newRange || currentSelection,
4257
4260
  rangeDecoration: {
@@ -6891,13 +6894,17 @@ function applyOperation(editor, op) {
6891
6894
  case "set": {
6892
6895
  let { path, value } = op;
6893
6896
  if (!op.inverse && !editor.isProcessingRemoteChanges) {
6894
- let previousValue = getValue(editor.snapshot.context.value, path);
6897
+ let previousValue = getValue(editor.snapshot.context.value, path), inversePath = path[path.length - 1] === "_key" && typeof value == "string" && isKeyedSegment(path[path.length - 2]) ? [
6898
+ ...path.slice(0, -2),
6899
+ { _key: value },
6900
+ "_key"
6901
+ ] : path;
6895
6902
  op.inverse = previousValue === void 0 ? {
6896
6903
  type: "unset",
6897
- path
6904
+ path: inversePath
6898
6905
  } : {
6899
6906
  type: "set",
6900
- path,
6907
+ path: inversePath,
6901
6908
  value: previousValue
6902
6909
  };
6903
6910
  }
@@ -7674,23 +7681,20 @@ function setNodeProperties(editor, props, path) {
7674
7681
  keyIndex !== -1 && (keys.splice(keyIndex, 1), keys.unshift("_key"));
7675
7682
  let currentPath = path;
7676
7683
  for (let key of keys) if (propsRecord[key] !== nodeRecord[key]) if (propsRecord[key] != null) {
7677
- let hadProperty = nodeRecord.hasOwnProperty(key);
7678
- if (editor.apply({
7684
+ let hadProperty = nodeRecord.hasOwnProperty(key), lastSegment = currentPath[currentPath.length - 1], renamedPath = key === "_key" && typeof propsRecord[key] == "string" && isKeyedSegment(lastSegment) ? [...currentPath.slice(0, -1), { _key: propsRecord[key] }] : void 0, inversePath = renamedPath ? [...renamedPath, key] : [...currentPath, key];
7685
+ editor.apply({
7679
7686
  type: "set",
7680
7687
  path: [...currentPath, key],
7681
7688
  value: propsRecord[key],
7682
7689
  inverse: hadProperty ? {
7683
7690
  type: "set",
7684
- path: [...currentPath, key],
7691
+ path: inversePath,
7685
7692
  value: nodeRecord[key]
7686
7693
  } : {
7687
7694
  type: "unset",
7688
- path: [...currentPath, key]
7695
+ path: inversePath
7689
7696
  }
7690
- }), key === "_key" && typeof propsRecord[key] == "string") {
7691
- let lastSegment = currentPath[currentPath.length - 1];
7692
- isKeyedSegment(lastSegment) && (currentPath = [...currentPath.slice(0, -1), { _key: propsRecord[key] }]);
7693
- }
7697
+ }), renamedPath && (currentPath = renamedPath);
7694
7698
  } else nodeRecord.hasOwnProperty(key) && editor.apply({
7695
7699
  type: "unset",
7696
7700
  path: [...currentPath, key],
@@ -13131,16 +13135,24 @@ const abstractAnnotationBehaviors = [
13131
13135
  let previousBlock = {
13132
13136
  node: previousSibling.node,
13133
13137
  path: previousSibling.path
13134
- };
13138
+ }, previousBlockEndPoint = getBlockEndPoint({
13139
+ context: snapshot.context,
13140
+ block: previousBlock
13141
+ }), { renamedBlock, renameActions } = planMergeKeyRenames({
13142
+ context: snapshot.context,
13143
+ mergingBlockPath: focusTextBlock.path,
13144
+ mergingBlock: focusTextBlock.node,
13145
+ destinationBlock: previousBlock.node
13146
+ });
13135
13147
  return {
13136
- previousBlockEndPoint: getBlockEndPoint({
13137
- context: snapshot.context,
13138
- block: previousBlock
13139
- }),
13140
- focusTextBlock
13148
+ previousBlockEndPoint,
13149
+ focusTextBlock,
13150
+ renamedBlock,
13151
+ renameActions
13141
13152
  };
13142
13153
  },
13143
- actions: [(_, { previousBlockEndPoint, focusTextBlock }) => [
13154
+ actions: [(_, { previousBlockEndPoint, focusTextBlock, renamedBlock, renameActions }) => [
13155
+ ...renameActions,
13144
13156
  raise$1({
13145
13157
  type: "delete.block",
13146
13158
  at: focusTextBlock.path
@@ -13154,7 +13166,7 @@ const abstractAnnotationBehaviors = [
13154
13166
  }),
13155
13167
  raise$1({
13156
13168
  type: "insert.block",
13157
- block: focusTextBlock.node,
13169
+ block: renamedBlock,
13158
13170
  placement: "auto",
13159
13171
  select: "start"
13160
13172
  })
@@ -13223,20 +13235,32 @@ const abstractAnnotationBehaviors = [
13223
13235
  }, focusTextBlock = getFocusTextBlock(adjustedSnapshot);
13224
13236
  if (!focusTextBlock) return !1;
13225
13237
  let nextSibling = getSibling(adjustedSnapshot, focusTextBlock.path, { direction: "next" });
13226
- return !nextSibling || !isAtTheEndOfBlock(focusTextBlock)(adjustedSnapshot) || !isTextBlockNode(snapshot.context, nextSibling.node) ? !1 : { nextBlock: {
13227
- node: nextSibling.node,
13228
- path: nextSibling.path
13229
- } };
13238
+ if (!nextSibling || !isAtTheEndOfBlock(focusTextBlock)(adjustedSnapshot) || !isTextBlock(snapshot.context, nextSibling.node)) return !1;
13239
+ let { renamedBlock, renameActions } = planMergeKeyRenames({
13240
+ context: snapshot.context,
13241
+ mergingBlockPath: nextSibling.path,
13242
+ mergingBlock: nextSibling.node,
13243
+ destinationBlock: focusTextBlock.node
13244
+ });
13245
+ return {
13246
+ nextBlockPath: nextSibling.path,
13247
+ renamedBlock,
13248
+ renameActions
13249
+ };
13230
13250
  },
13231
- actions: [(_, { nextBlock }) => [raise$1({
13232
- type: "delete.block",
13233
- at: nextBlock.path
13234
- }), raise$1({
13235
- type: "insert.block",
13236
- block: nextBlock.node,
13237
- placement: "auto",
13238
- select: "none"
13239
- })]]
13251
+ actions: [(_, { nextBlockPath, renamedBlock, renameActions }) => [
13252
+ ...renameActions,
13253
+ raise$1({
13254
+ type: "delete.block",
13255
+ at: nextBlockPath
13256
+ }),
13257
+ raise$1({
13258
+ type: "insert.block",
13259
+ block: renamedBlock,
13260
+ placement: "auto",
13261
+ select: "none"
13262
+ })
13263
+ ]]
13240
13264
  }),
13241
13265
  defineBehavior({
13242
13266
  on: "delete.block",
@@ -13306,7 +13330,71 @@ const abstractAnnotationBehaviors = [
13306
13330
  type: "delete"
13307
13331
  })]]
13308
13332
  })
13309
- ], mimeTypePriority = [
13333
+ ];
13334
+ /**
13335
+ * A block merge folds `mergingBlock`'s children (and markDefs) into
13336
+ * `destinationBlock` by key. Any key the merging block shares with the
13337
+ * destination has to be renamed before the merge, or `insert.block`'s own
13338
+ * collision handling mints a fresh key for it, which reads on the wire as
13339
+ * that node being destroyed and a new one created instead of moved.
13340
+ *
13341
+ * Renames are raised as `set`/`child.set` events against the still-living
13342
+ * `mergingBlock`, so they land on the wire before the merge's `unset`.
13343
+ * `renamedBlock` mirrors the same renames applied to the value the caller
13344
+ * already captured, since raising the rename events now doesn't change
13345
+ * that captured value.
13346
+ */
13347
+ function planMergeKeyRenames(args) {
13348
+ let { context, mergingBlockPath, mergingBlock, destinationBlock } = args, destinationChildKeys = new Set(destinationBlock.children.map((child) => child._key)), destinationMarkDefKeys = new Set((destinationBlock.markDefs ?? []).map((markDef) => markDef._key)), markDefKeyMap = /* @__PURE__ */ new Map(), renamedMarkDefs = mergingBlock.markDefs?.map((markDef) => {
13349
+ if (!destinationMarkDefKeys.has(markDef._key)) return markDef;
13350
+ let newKey = context.keyGenerator();
13351
+ return markDefKeyMap.set(markDef._key, newKey), {
13352
+ ...markDef,
13353
+ _key: newKey
13354
+ };
13355
+ }), renameActions = [];
13356
+ for (let markDef of mergingBlock.markDefs ?? []) {
13357
+ let newKey = markDefKeyMap.get(markDef._key);
13358
+ newKey && renameActions.push(raise$1({
13359
+ type: "set",
13360
+ at: [
13361
+ ...mergingBlockPath,
13362
+ "markDefs",
13363
+ { _key: markDef._key },
13364
+ "_key"
13365
+ ],
13366
+ value: newKey
13367
+ }));
13368
+ }
13369
+ let renamedChildren = mergingBlock.children.map((child) => {
13370
+ let currentMarks = isSpan(context, child) ? child.marks : void 0, remappedMarks = currentMarks?.map((mark) => markDefKeyMap.get(mark) ?? mark), marksChanged = !!(remappedMarks && !isEqualMarks(remappedMarks, currentMarks)), newKey = destinationChildKeys.has(child._key) ? context.keyGenerator() : child._key, props = {};
13371
+ return newKey !== child._key && (props._key = newKey), marksChanged && (props.marks = remappedMarks), Object.keys(props).length > 0 && renameActions.push(raise$1({
13372
+ type: "child.set",
13373
+ at: [
13374
+ ...mergingBlockPath,
13375
+ "children",
13376
+ { _key: child._key }
13377
+ ],
13378
+ props
13379
+ })), marksChanged ? {
13380
+ ...child,
13381
+ _key: newKey,
13382
+ marks: remappedMarks
13383
+ } : {
13384
+ ...child,
13385
+ _key: newKey
13386
+ };
13387
+ });
13388
+ return {
13389
+ renamedBlock: {
13390
+ ...mergingBlock,
13391
+ children: renamedChildren,
13392
+ ...mergingBlock.markDefs ? { markDefs: renamedMarkDefs } : {}
13393
+ },
13394
+ renameActions
13395
+ };
13396
+ }
13397
+ const mimeTypePriority = [
13310
13398
  "application/x-portable-text",
13311
13399
  "application/json",
13312
13400
  "text/markdown",