plitejs 54.0.0-beta.7 → 54.0.0-beta.8

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.
Files changed (54) hide show
  1. package/dist/authored/index.d.ts +44 -41
  2. package/dist/authored/index.js +16489 -16181
  3. package/dist/{authored-veto-CferDljr.js → authored-veto-DLmBMIcy.js} +1 -1
  4. package/dist/{clipboard-format-key-CLFcThXH.js → clipboard-format-key-SzffxWqa.js} +1 -1
  5. package/dist/{comparison-plan-7iIABSWG.js → comparison-plan-BqFJWjO4.js} +36 -14
  6. package/dist/{create-editor-acDgsovY.js → create-editor-kU8fg-PF.js} +6 -30
  7. package/dist/diff/index.d.ts +2 -32
  8. package/dist/diff/index.js +7 -378
  9. package/dist/dom/index.d.ts +2 -2
  10. package/dist/dom/index.js +2 -2
  11. package/dist/{dom-B5bAma7X.js → dom-SUWlnfT9.js} +562 -145
  12. package/dist/history/index.d.ts +5 -5
  13. package/dist/history/index.js +2041 -1833
  14. package/dist/history-skip-CcEhIzak.js +35 -0
  15. package/dist/hyperscript/index.d.ts +1 -1
  16. package/dist/hyperscript/index.js +1 -1
  17. package/dist/{hyperscript-BXUV6sdO.js → hyperscript-DdeGYoSc.js} +3 -2
  18. package/dist/{index-CTTjpWgb.d.ts → index-4PpawhYe.d.ts} +1 -1
  19. package/dist/{index-DJvrmSRP.d.ts → index-BsOySJwr.d.ts} +9 -9
  20. package/dist/{index-D8DQ1YFB.d.ts → index-CHEKdrHP.d.ts} +12 -4
  21. package/dist/{comparison-types-CsmDG5r2.d.ts → index-DM-b6jEe.d.ts} +21 -57
  22. package/dist/{index-LhVJuuEf.d.ts → index-DqmhcD_0.d.ts} +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +5 -4
  25. package/dist/internal/index.d.ts +2 -2
  26. package/dist/internal/index.js +66 -5
  27. package/dist/law-check-Bvnz2EKh.js +19271 -0
  28. package/dist/pagination/index.d.ts +1 -1
  29. package/dist/pagination/index.js +1 -1
  30. package/dist/pagination/react.d.ts +2 -2
  31. package/dist/pagination/react.js +92 -46
  32. package/dist/{pagination-CwjmxPoX.js → pagination-XEnxZ1DX.js} +2 -1
  33. package/dist/{plugin-BZCGtqMI.js → plugin-B8uCi-Hr.js} +8758 -19452
  34. package/dist/{range-geometry-CZari453.d.ts → range-geometry-B2f67yLv.d.ts} +1 -1
  35. package/dist/{range-geometry-CqWrwkjH.js → range-geometry-BGKYQHqO.js} +3 -2
  36. package/dist/react/index.d.ts +3 -3
  37. package/dist/react/index.js +7 -6
  38. package/dist/react/virtualized.d.ts +2 -2
  39. package/dist/react/virtualized.js +59 -38
  40. package/dist/{react-DO9IETEQ.js → react-B6B-5z7t.js} +24 -55
  41. package/dist/{retraction-RHEKiF3h.js → retraction-BMzQ2on5.js} +1 -1
  42. package/dist/scroll-root-DudA40xj.js +25 -0
  43. package/dist/{src-fLbHzUjC.js → src--BZ7fZY4.js} +60 -26
  44. package/dist/testing/index.d.ts +2 -2
  45. package/dist/testing/index.js +4 -3
  46. package/dist/{tx-only-1FM45FSj.d.ts → tx-only-D8lpB-sT.d.ts} +338 -147
  47. package/dist/{update-policy-C32RjjGt.js → update-policy-J-4sHmrg.js} +2 -1
  48. package/dist/{use-editor-dom-scope-CUBnNAZV.js → use-editor-dom-scope-BFWvutxn.js} +2837 -2093
  49. package/dist/yjs/index.d.ts +1 -1
  50. package/dist/yjs/index.js +1 -1
  51. package/dist/yjs/react/index.d.ts +3 -3
  52. package/dist/yjs/react/index.js +3 -3
  53. package/dist/{yjs-BMguSAX_.js → yjs-DPngKQWQ.js} +114 -39
  54. package/package.json +2 -3
@@ -1,7 +1,9 @@
1
- import { $ as elementReadOnly, $i as sameSelectorDependencies, $o as getCarriedCaretEditor, $t as setNodes, Ad as getEditorRuntimeRoot, Al as getAnchorRuntimeId, An as didCommitChangePersistedValue, Ap as getRecordSetVersion, As as resolvePluginMethod, At as isVoid, Bi as withTransactionSpecDraftRead, Bl as readShownPreview, Bn as getActiveEditorUpdateId, Bp as recordSetIds, Bt as path, C as setPluginPortalFactory, Cd as TextApi, Cl as getDocumentChangeRelocations, Cr as getStateFieldEffectTypes, Cu as getCompiledEditorSchema, Dm as countCoreWork, Dn as attachTransactionSpecAfterCommit, Ds as mapSemanticUpdateMethodArguments, Dt as isInline, Du as inheritPluginRegistry, E as getSchemaElementSourceReference, Ei as subscribeEditorViewState, Eo as getCaretOwner, Et as isEnd, Eu as getPluginRegistry, Fl as getAuthoredViewCommit, Fn as fitSliceChildren, Fs as txStored, Ft as mergeNodes, Gp as areEditorJsonValuesEqual, Gt as range, Gu as matchesCompiledSchemaTarget, H as above, Hi as setTargetRuntime, Ho as setSelectionAsView, Hp as showValueRecords, I as getActiveCommandEditor, Ii as withEditorDocumentProjection, Il as getViewCommitSource, In as fitSlicePlacements, Ip as readRecord, Iu as getCompiledPropertyCandidates, J as deleteEditor, Jl as withDocumentViewRead, Jn as getCommitDocumentValue, Jo as createAuthoredEditorView, Jt as removeNodes, K as collapse, Kl as isDocumentView, Kn as getCollabEffectTypes, Kp as assertEditorJsonValue, Kr as readEditorCommitHistoryEntry, Kt as read, Ku as preserveCompiledSchemaPropertyIdentity, L as hasCommandHandler, Lc as readingCovered, Lt as moveNodes, Lu as getCompiledPropertyMergeStrategy, Md as hasEditorRuntime, Mt as leaf, N as dispatchCommand, Nd as setEditorRuntime, Nl as configureAuthoredView, Np as getValueRecords, Nt as levels, Nu as compileEditorSchemaContributions, Oa as subscribeShownViewUse, Od as getEditorRuntime, Oi as subscribeSharedEditorViewState, Ol as isAuthorId, Om as readCoreWork, Or as hasEditorRuntimeRoot, Os as callPluginUpdateMethod, Ot as isSelectable, P as evaluateCommand, Pi as viewStateFactsChanged, Pl as getAuthoredUpdateView, Pt as liftNodes, Q as edges, Qi as normalizeSelectorDependencies, Qt as select, R as probeCommandNativeEquivalent, Rl as readAuthoredView, Rr as isEditorPublishingCommit, Rt as next, Ru as getCompiledSchemaPropertyId, S as resolveInstalledPlugin, Sa as readShownViewUse, Sd as getTextSearchScope, Sr as getSnapshotVersion, St as isEdge, T as withPluginPortalCandidates, Tf as mapInternalDocumentChangePosition, Ti as subscribeCaretTarget, Tl as getExactDocumentChangeRelocations, Ts as createEditorReadApi, Tt as isEmpty, Tu as getPluginContributions, U as addMark, Ui as resolveStateFieldInitial, Ut as previous, Vn as getActiveEditorUpdateTags, Vt as point, Wl as withStoredAuthoredRead, Wt as projectRange, X as deleteFragment, Xr as readElementPropertyWrites, Xt as replaceChildren, Xu as resolveCompiledSchemaProperty, Yn as getCurrentMarks, Yp as decodeVersionedValue, Yr as readEditorViewStateFacts, Ys as canPlaceBlocksAtPath, Z as deselect, Zi as commitMatchesSelectorDependencies, Zn as getCurrentSelectionRoot, Zp as encodeVersionedValue, Zr as recordEditorHistoryEffect, Zs as createDetachedEditorSchema, Zt as reset, _a as readRootContentTarget, _c as getSelectionDOMRange, _i as setEditorSnapshotInputTransform, _m as getReaderRange, _s as withMountedPresentation, _t as insertNodes, _u as reportEditorLifecycleError, a as compilePluginInput, ac as landNodePropertiesAt, ad as EDITOR_DOCUMENT_FIELDS, ai as runTrustedUpdate, al as claimsHistoryReplay, an as subscribeSource, ao as exportContentSlice, ap as normalizeSetValues, as as getViewPresentation, at as getLastCommit, b as queueAfterPluginAcquisition, bc as mapDetachedSelectionThroughChange, bd as formatDebugValue, bf as hasInternalDocumentChangeRoot, bn as applyBuiltDocumentChange, bp as getNodeKeyDOMValue, bs as onPresentationRelease, bt as install, ca as markRootViewInteraction, cd as isEnvelopeInput, cf as createInternalRootChangeFromSections, cr as getEditorStateView, ct as getPluginRegistry$1, da as readCaretViewIn, dd as readPersistedEnvelope, di as setCurrentSelection, dn as update, dr as getLiveNode, ds as readShownDocument, dt as hasBlocks, du as EditorRefusalError, ea as selectorDependenciesSubscriptionKey, ec as getCompiledEditorSchemaFromApi, em as snapshotEditorJsonValue, en as setPoint, et as first, f as getCandidatePluginApi, fd as readStoredEditorDocument, fi as setEditorComposing, fl as getEditorCommitNode, fn as voidEditor, fs as readShownElementById, ft as hasInlines, g as isPlugin, gc as encodeEditorSelection, gf as getInternalDocumentChangeRanges, gm as getRangeRoot, gt as insertNode, gu as notifyObservers, h as getInstalledPluginApi, hc as decodeEditorSelection, hi as setEditorMaxLength, hl as getEditorCommitSnapshot, hs as retainViewPresentation, i as compilePlugin, ia as selectorDependenciesWantViewKind, il as createDetachedContentSlice, im as createEditorEffect, it as getFragment, iu as assertPublicRootKey, j as getPluginSlotInput, jl as restoreAnchor, jt as last, ju as EditorSchemaCompileError, ko as holdsCaret, kt as isStart, la as markRootViewUsed, ld as readDocumentRecord, li as setChildren, ln as unsetNodes, lr as getEditorUpdateRoot, m as getInstalledPlugin, mc as assertSelectionSupported, md as failInvariant, mf as getInternalDocumentChangeClassificationEntries, mm as MAIN_ROOT_KEY, mr as getMutationVersion, ms as readViewPage, mt as hasTexts, n as brandPluginDescriptor, na as selectorDependenciesWantCommits, ni as repairEditorValue, nn as shouldMergeNodesRemovePrevNode, nr as getEditorMaxLength, o as containsCompleteEditorSchema, oc as placeElementAt, od as assertEditorDocumentContainers, on as toggleBlock, or as getEditorRuntimeElementEntries, ot as getNodeKey, ou as toInternalRoot, p as getCompiledEditorConfiguration, pc as assertDetachedSelectionSupported, pd as rejectEditorRecord, pf as getInternalDocumentChangeClassification, pn as wrapNodes, pr as getLiveText, ps as readShownRecords, pt as hasPath, qp as cloneEditorJsonValue, qt as removeMark, ra as selectorDependenciesWantShownPreview, rn as splitNodes, rr as getEditorNodeKeyForNode, rs as getViewAuthor, rt as getCollabEffects, sd as getEditorDocumentShapeIssueMessage, si as scheduleAfterCommitNotification, sl as getDocumentValueNode, sn as toggleMark, sr as getEditorRuntimeRootKeys, st as getPathByNodeKey, su as toPublicRoot, ta as selectorDependenciesViewSubscription, td as tracksPlaces, ti as registerEditorTransactionGuard, tn as setSelection, tt as fragment, tu as observeAnchorStateWork, ud as readEditorDocument, ui as setCurrentMarks, um as RangeApi, un as unwrapNodes, us as projectEditorView, uu as vetoesWrite, vf as getInternalDocumentChangeRootKeys, vi as setEditorStateViewTransform, vl as getEditorCommitValue, vn as afterActiveTransactionEnds, vt as insertSoftBreak, vu as runEditorObserver, w as startEditor, wf as mapInternalDocumentChangePoint, wl as getExactDocumentChangeRelocation, wp as canonicalRecordJson, wt as isElementReadOnly, x as releaseEditor, xa as readRootViewUse, xf as isDocumentRootKey, xl as readRootEntries, ya as readRootViewContentUse, yd as ElementApi, yi as setEditorTransactionViewTransform, ym as isObject, ys as getStateViewPresentation, zi as withEditorUpdateRootScope, zl as readAuthoredViewKey, zn as getActiveEditorTransaction, zp as recordSetChanges, zt as parent } from "../plugin-BZCGtqMI.js";
2
- import { c as initializePlugins, d as assertEditorOptions, f as readEditorOptions, i as createDormantEditor, l as withCompiledEditorSchemaCapabilityEntries, o as getEditorAuthoredDocumentCapability, p as projectRangeInSnapshot, r as compileEditorSchemaContractEntries, s as initializePluginEntries, t as compileEditorSchemaCapabilityEntries } from "../create-editor-acDgsovY.js";
3
- import { a as sameResult, c as resetEditorCommitPublicationQueue, i as startOwnedEditor, n as withPliteReactPreservedSelection, o as createEditorCommitPublicationQueue, r as createEditorOwner, s as publishEditorCommitInVersionOrder } from "../update-policy-C32RjjGt.js";
4
- import { i as setDOMClipboardFormatKey } from "../clipboard-format-key-CLFcThXH.js";
1
+ import { Ai as countCoreWork, Br as encodeVersionedValue, D as getInternalDocumentChangeRanges, Dr as recordSetIds, E as getInternalDocumentChangeEntries, Er as recordSetChanges, Fr as cloneEditorJsonValue, G as mapInternalDocumentChangePosition, Gr as snapshotEditorJsonValue, L as isDocumentRootKey, N as hasInternalDocumentChangeRoot, Nr as areEditorJsonValuesEqual, Pr as assertEditorJsonValue, Rr as decodeVersionedValue, T as getInternalDocumentChangeClassificationEntries, W as mapInternalDocumentChangePoint, X as valueRootIndex, Yr as createEditorEffect, ai as MAIN_ROOT_KEY, dr as getRecordSetVersion, er as canonicalRecordJson, gi as isObject, ji as readCoreWork, k as getInternalDocumentChangeRootKeys, kr as showValueRecords, li as getRangeRoot, ln as normalizeSetValues, m as createInternalRootChangeFromSections, mr as getValueRecords, ti as RangeApi, ui as getReaderRange, w as getInternalDocumentChangeClassification, yr as readRecord, zn as getNodeKeyDOMValue } from "../law-check-Bvnz2EKh.js";
2
+ import { $ as elementReadOnly, $i as normalizeSelectorDependencies, $o as createAuthoredEditorView, $t as setNodes, Ad as getTextSearchScope, An as didCommitChangePersistedValue, As as createEditorReadApi, At as isVoid, Au as getPluginRegistry, Bd as hasEditorRuntime, Bi as withEditorUpdateRootScope, Bl as getViewCommitSource, Bn as getActiveEditorUpdateId, Bs as txStored, Bt as path, C as setPluginPortalFactory, Ca as readShownViewUse, Cc as mapDetachedSelectionThroughChange, Cr as getStateFieldEffectTypes, Dd as ElementApi, Di as subscribeEditorViewState, Dl as getExactDocumentChangeRelocation, Dn as attachTransactionSpecAfterCommit, Dt as isInline, Du as getCompiledEditorSchema, E as getSchemaElementSourceReference, Ei as subscribeCaretTarget, El as getDocumentChangeRelocations, Et as isEnd, Fi as viewStateFactsChanged, Fn as fitSliceChildren, Fs as resolvePluginMethod, Ft as mergeNodes, Gt as range, H as above, Hl as readAuthoredView, Hu as getCompiledPropertyMergeStrategy, I as getActiveCommandEditor, Id as getEditorRuntime, Il as authoredDirectProperties, In as fitSlicePlacements, Iu as EditorSchemaCompileError, J as deleteEditor, Jl as withStoredAuthoredRead, Jn as getCommitDocumentValue, Jt as removeNodes, K as collapse, Kn as getCollabEffectTypes, Kr as readEditorCommitHistoryEntry, Kt as read, L as hasCommandHandler, Li as withEditorDocumentProjection, Ll as configureAuthoredView, Lt as moveNodes, Ms as mapSemanticUpdateMethodArguments, Mt as leaf, N as dispatchCommand, Nl as getAnchorRuntimeId, Ns as callPluginUpdateMethod, Nt as levels, Od as formatDebugValue, Ol as getExactDocumentChangeRelocations, Or as hasEditorRuntimeRoot, Ot as isSelectable, P as evaluateCommand, Pc as readingCovered, Pl as restoreAnchor, Po as holdsCaret, Pt as liftNodes, Q as edges, Qi as commitMatchesSelectorDependencies, Ql as withDocumentViewRead, Qt as select, R as probeCommandNativeEquivalent, Ra as isEditorDraftView, Rd as getEditorRuntimeRoot, Rl as getAuthoredUpdateView, Rr as isEditorPublishingCommit, Rt as next, Ru as compileEditorSchemaContributions, S as resolveInstalledPlugin, Sa as readRootViewUse, Sr as getSnapshotVersion, Ss as withMountedPresentation, St as isEdge, Su as runEditorObserver, T as withPluginPortalCandidates, Ts as onPresentationRelease, Tt as isEmpty, U as addMark, Ui as setTargetRuntime, Ul as readAuthoredViewKey, Ut as previous, Uu as getCompiledSchemaPropertyId, Vd as setEditorRuntime, Vi as withTransactionSpecDraftRead, Vn as getActiveEditorUpdateTags, Vt as point, Vu as getCompiledPropertyCandidates, Wi as resolveStateFieldInitial, Wl as readShownPreview, Wt as projectRange, X as deleteFragment, Xc as createDetachedContentSlice, Xl as isDocumentView, Xr as readElementPropertyWrites, Xt as replaceChildren, Xu as matchesCompiledSchemaTarget, Yn as getCurrentMarks, Yr as readEditorViewStateFacts, Z as deselect, Zn as getCurrentSelectionRoot, Zr as recordEditorHistoryEffect, Zt as reset, Zu as preserveCompiledSchemaPropertyIdentity, _c as assertSelectionSupported, _d as readPersistedEnvelope, _o as nonWritableRoot, _s as readShownElementById, _t as insertNodes, _u as subscribeEditorRefusals, a as compilePluginInput, aa as selectorDependenciesWantViewKind, ac as getCompiledEditorSchemaFromApi, ai as resolveLocationRoot, an as subscribeSource, ao as exportContentSlice, at as getLastCommit, au as observeAnchorStateWork, b as queueAfterPluginAcquisition, ba as readRootViewContentUse, bc as getSelectionDOMRange, bd as failInvariant, bi as setEditorTransactionViewTransform, bn as applyBuiltDocumentChange, bs as retainViewPresentation, bt as install, bu as notifyObservers, ci as scheduleAfterCommitNotification, cl as claimsHistoryReplay, cr as getEditorStateView, cs as getViewAuthor, ct as getPluginRegistry$1, cu as assertPublicRootKey, dc as placeElementAt, dd as EDITOR_DOCUMENT_FIELDS, di as setCurrentMarks, dn as update, dr as getLiveNode, dt as hasBlocks, du as toPublicRoot, ea as sameSelectorDependencies, ec as canPlaceBlocksAtPath, ed as resolveCompiledSchemaProperty, en as setPoint, et as first, f as getCandidatePluginApi, fa as readCaretViewIn, fd as assertEditorDocumentContainers, fi as setCurrentSelection, fn as voidEditor, ft as hasInlines, g as isPlugin, gc as assertDetachedSelectionSupported, gd as readEditorDocument, gi as setEditorMaxLength, go as nonWritableContent, gs as readShownDocument, gt as insertNode, gu as publishEditorRefusal, h as getInstalledPluginApi, hd as readDocumentRecord, hl as getEditorCommitNode, ho as isElementNonWritable, hs as projectEditorView, hu as EditorRefusalError, i as compilePlugin, ia as selectorDependenciesWantShownPreview, is as getCarriedCaretEditor, it as getFragment, j as getPluginSlotInput, jd as TextApi, jl as isAuthorId, jo as getCaretOwner, jt as last, ju as inheritPluginRegistry, ka as subscribeShownViewUse, ki as subscribeSharedEditorViewState, kt as isStart, ku as getPluginContributions, la as markRootViewInteraction, ln as unsetNodes, lr as getEditorUpdateRoot, m as getInstalledPlugin, md as isEnvelopeInput, mo as hasNonWritableContributors, mr as getMutationVersion, mt as hasTexts, mu as vetoesWrite, n as brandPluginDescriptor, na as selectorDependenciesViewSubscription, nc as createDetachedEditorSchema, ni as repairEditorValue, nn as shouldMergeNodesRemovePrevNode, nr as getEditorMaxLength, o as containsCompleteEditorSchema, od as tracksPlaces, oi as runTrustedUpdate, on as toggleBlock, or as getEditorRuntimeElementEntries, ot as getNodeKey, p as getCompiledEditorConfiguration, pd as getEditorDocumentShapeIssueMessage, pi as setEditorComposing, pn as wrapNodes, po as hasNonWritableAt, pr as getLiveText, pt as hasPath, qo as setSelectionAsView, qt as removeMark, ra as selectorDependenciesWantCommits, rn as splitNodes, rr as getEditorNodeKeyForNode, rt as getCollabEffects, sn as toggleMark, sr as getEditorRuntimeRootKeys, st as getPathByNodeKey, ta as selectorDependenciesSubscriptionKey, ti as registerEditorTransactionGuard, tn as setSelection, tt as fragment, ua as markRootViewUsed, uc as landNodePropertiesAt, ui as setChildren, ul as getDocumentValueNode, un as unwrapNodes, us as getViewPresentation, uu as toInternalRoot, va as readRootContentTarget, vc as decodeEditorSelection, vd as readStoredEditorDocument, vi as setEditorSnapshotInputTransform, vl as getEditorCommitSnapshot, vn as afterActiveTransactionEnds, vs as readShownRecords, vt as insertSoftBreak, w as startEditor, wl as readRootEntries, ws as getStateViewPresentation, wt as isElementReadOnly, x as releaseEditor, xl as getEditorCommitValue, xu as reportEditorLifecycleError, yc as encodeEditorSelection, yd as rejectEditorRecord, yi as setEditorStateViewTransform, ys as readViewPage, zl as getAuthoredViewCommit, zn as getActiveEditorTransaction, zt as parent } from "../plugin-B8uCi-Hr.js";
3
+ import { c as initializePlugins, d as assertEditorOptions, f as readEditorOptions, i as createDormantEditor, l as withCompiledEditorSchemaCapabilityEntries, o as getEditorAuthoredDocumentCapability, p as projectRangeInSnapshot, r as compileEditorSchemaContractEntries, s as initializePluginEntries, t as compileEditorSchemaCapabilityEntries } from "../create-editor-kU8fg-PF.js";
4
+ import { a as sameResult, c as resetEditorCommitPublicationQueue, i as startOwnedEditor, n as withPliteReactPreservedSelection, o as createEditorCommitPublicationQueue, r as createEditorOwner, s as publishEditorCommitInVersionOrder } from "../update-policy-J-4sHmrg.js";
5
+ import { i as setDOMClipboardFormatKey } from "../clipboard-format-key-SzffxWqa.js";
6
+ import { n as skipHistoryIfOnlyProperties, t as shouldSkipHistoryForOnlyProperties } from "../history-skip-CcEhIzak.js";
5
7
  //#region src/core/persisted-document.ts
6
8
  /** Decode, complete and eagerly encode all installed persistent fields. @internal */
7
9
  const completePersistedDocumentFields = (document, fields) => {
@@ -126,6 +128,65 @@ const serializeStructuralPlainText = (input, state, encode) => {
126
128
  });
127
129
  };
128
130
  //#endregion
131
+ //#region src/core/change-sections.ts
132
+ /**
133
+ * Walk each unmerged changed section of `change` across every affected root.
134
+ * Return `false` from `visit` to stop early.
135
+ *
136
+ * @internal
137
+ */
138
+ const visitDocumentChangeSections = (change, visit) => {
139
+ for (const [root, rootChange] of getInternalDocumentChangeEntries(change)) {
140
+ const { data, sections } = rootChange;
141
+ let posA = 0;
142
+ let posB = 0;
143
+ for (let index = 0; index < sections.length; index += 2) {
144
+ const length = sections[index];
145
+ const inserted = sections[index + 1];
146
+ if (length === void 0 || inserted === void 0) break;
147
+ if (inserted === -1) {
148
+ posA += length;
149
+ posB += length;
150
+ continue;
151
+ }
152
+ if (inserted === -2) {
153
+ if (visit({
154
+ fromA: posA,
155
+ fromB: posB,
156
+ kind: "properties",
157
+ modifications: data[index / 2],
158
+ root,
159
+ toA: posA + length,
160
+ toB: posB + length
161
+ }) === false) return;
162
+ posA += length;
163
+ posB += length;
164
+ continue;
165
+ }
166
+ if (visit({
167
+ fromA: posA,
168
+ fromB: posB,
169
+ kind: "replace",
170
+ root,
171
+ toA: posA + length,
172
+ toB: posB + inserted
173
+ }) === false) return;
174
+ posA += length;
175
+ posB += inserted;
176
+ }
177
+ }
178
+ };
179
+ /**
180
+ * Return the lazy `DocumentIndex` for `root` in `value`, or `null` when that
181
+ * named root does not exist in `value`.
182
+ *
183
+ * @internal
184
+ */
185
+ const readCommitRootIndex = (value, root) => {
186
+ if (root !== "main" && !Object.hasOwn(value.roots ?? {}, root)) return null;
187
+ return valueRootIndex(value, root);
188
+ };
189
+ //#endregion
129
190
  //#region src/internal/document-range.ts
130
191
  const isIndex = (value) => Number.isSafeInteger(value) && value >= 0;
131
192
  const readPointRoot = (point, source) => {
@@ -153,4 +214,4 @@ const readDocumentRange = (value, source) => {
153
214
  };
154
215
  };
155
216
  //#endregion
156
- export { EDITOR_DOCUMENT_FIELDS, EditorRefusalError, EditorSchemaCompileError, MAIN_ROOT_KEY, above, addMark, afterActiveTransactionEnds, applyBuiltDocumentChange, areEditorJsonValuesEqual, assertDetachedSelectionSupported, assertEditorDocumentContainers, assertEditorJsonValue, assertEditorOptions, assertPublicRootKey, assertSelectionSupported, attachTransactionSpecAfterCommit, brandPluginDescriptor, callPluginUpdateMethod, canPlaceBlocksAtPath, canonicalRecordJson, claimsHistoryReplay, cloneEditorJsonValue, collapse, commitMatchesSelectorDependencies, compileEditorSchemaCapabilityEntries, compileEditorSchemaContractEntries, compileEditorSchemaContributions, compilePlugin, compilePluginInput, completePersistedDocumentFields, configureAuthoredView, containsCompleteEditorSchema, countCoreWork, createAuthoredEditorView, createDetachedContentSlice, createDetachedEditorSchema, createDormantEditor, createEditorCommitPublicationQueue, createEditorEffect, createEditorOwner, createEditorReadApi, createInternalRootChangeFromSections, decodeEditorSelection, decodeVersionedValue, deleteEditor as delete, deleteFragment, deselect, didCommitChangePersistedValue, dispatchCommand, edges, elementReadOnly, encodeEditorSelection, encodeVersionedValue, evaluateCommand, exportContentSlice, failInvariant, first, fitSliceChildren, fitSlicePlacements, formatDebugValue, fragment, getActiveCommandEditor, getActiveEditorTransaction, getActiveEditorUpdateId, getActiveEditorUpdateTags, getAnchorRuntimeId, getAuthoredUpdateView, getAuthoredViewCommit, getCandidatePluginApi, getCaretOwner, getCarriedCaretEditor, getCollabEffectTypes, getCollabEffects, getCommitDocumentValue, getCompiledEditorConfiguration, getCompiledEditorSchema, getCompiledEditorSchemaFromApi, getCompiledPropertyCandidates, getCompiledPropertyMergeStrategy, getCompiledSchemaPropertyId, getDocumentChangeRelocations, getDocumentValueNode, getEditorAuthoredDocumentCapability, getEditorCommitNode, getEditorCommitSnapshot, getEditorCommitValue, getCurrentMarks as getEditorCurrentMarks, getEditorDocumentShapeIssueMessage, getLiveNode as getEditorLiveNode, getLiveText as getEditorLiveText, getEditorMaxLength, getEditorNodeKeyForNode, getEditorRuntime, getEditorRuntimeElementEntries, getEditorRuntimeRoot, getEditorRuntimeRootKeys, getCurrentSelectionRoot as getEditorSelectionRoot, getEditorStateView, getEditorUpdateRoot, getExactDocumentChangeRelocation, getExactDocumentChangeRelocations, getFragment, getInstalledPlugin, getInstalledPluginApi, getInternalDocumentChangeClassification, getInternalDocumentChangeClassificationEntries, getInternalDocumentChangeRanges, getInternalDocumentChangeRootKeys, getPluginRegistry as getInternalPluginRegistry, getLastCommit, getMutationVersion, getNodeKey, getNodeKeyDOMValue, getPathByNodeKey, getPluginContributions, getPluginRegistry$1 as getPluginRegistry, getPluginSlotInput, getRangeRoot, getReaderRange, getRecordSetVersion, getSchemaElementSourceReference, getSelectionDOMRange, getSnapshotVersion, getStateFieldEffectTypes, getStateViewPresentation, getTextSearchScope, getValueRecords, getViewAuthor, getViewCommitSource, getViewPresentation, hasBlocks, hasCommandHandler, hasEditorRuntime, hasEditorRuntimeRoot, hasInlines, hasInternalDocumentChangeRoot, hasPath, hasTexts, holdsCaret, inheritPluginRegistry, initializePluginEntries, initializePlugins, insertNode, insertNodes, insertSoftBreak, install, isAuthorId, isDocumentView, isEdge, isEditorPublishingCommit, isElementReadOnly, isEmpty, isEnd, isEnvelopeInput, isInline, isObject, isPlugin, isSelectable, isStart, isVoid, landNodePropertiesAt, last, leaf, levels, liftNodes, mapDetachedSelectionThroughChange, mapInternalDocumentChangePoint, mapInternalDocumentChangePosition, mapSemanticUpdateMethodArguments, markRootViewInteraction, markRootViewUsed, matchesCompiledSchemaTarget, mergeNodes, moveNodes, next, normalizeSelectorDependencies, normalizeSetValues, notifyObservers, observeAnchorStateWork, onPresentationRelease, parent, path, placeElementAt, point, preserveCompiledSchemaPropertyIdentity, previous, probeCommandNativeEquivalent, projectEditorView, projectRange, projectRangeInSnapshot, publishEditorCommitInVersionOrder, queueAfterPluginAcquisition, range, read, readAuthoredView, readAuthoredViewKey, readCaretViewIn, readCoreWork, readDocumentRange, readDocumentRecord, readEditorCommitHistoryEntry, readEditorDocument, readEditorOptions, readEditorViewStateFacts, readElementPropertyWrites, readPersistedEnvelope, readRecord, readRootContentTarget, readRootEntries, readRootViewContentUse, readRootViewUse, readShownDocument, readShownElementById, readShownPreview, readShownRecords, readShownViewUse, readStoredEditorDocument, readViewPage, readingCovered, recordEditorHistoryEffect, recordSetChanges, recordSetIds, registerEditorTransactionGuard, rejectEditorRecord, releaseEditor, removeMark, removeNodes, repairEditorValue, replaceChildren, reportEditorLifecycleError, reset, resetEditorCommitPublicationQueue, resolveCompiledSchemaProperty, resolveInstalledPlugin, resolvePluginMethod, restoreAnchor, retainViewPresentation, runEditorObserver, runTrustedUpdate, sameResult, sameSelectorDependencies, scheduleAfterCommitNotification, select, selectorDependenciesSubscriptionKey, selectorDependenciesViewSubscription, selectorDependenciesWantCommits, selectorDependenciesWantShownPreview, selectorDependenciesWantViewKind, serializeStructuralPlainText, setDOMClipboardFormatKey, setChildren as setEditorChildren, setEditorComposing, setCurrentMarks as setEditorMarks, setEditorMaxLength, setEditorRuntime, setCurrentSelection as setEditorSelection, setEditorSnapshotInputTransform, setEditorStateViewTransform, setTargetRuntime as setEditorTargetRuntime, setEditorTransactionViewTransform, setNodes, setPluginPortalFactory, setPoint, setSelection, setSelectionAsView, shouldMergeNodesRemovePrevNode, snapshotEditorJsonValue, splitNodes, startEditor, startOwnedEditor, subscribeCaretTarget, subscribeEditorViewState, subscribeSharedEditorViewState, subscribeShownViewUse, subscribeSource, toInternalRoot, toPublicRoot, toggleBlock, toggleMark, tracksPlaces, txStored, unsetNodes, unwrapNodes, update, vetoesWrite, viewStateFactsChanged, voidEditor as void, withCompiledEditorSchemaCapabilityEntries, withDocumentViewRead, withEditorDocumentProjection, withEditorUpdateRootScope, withMountedPresentation, withPliteReactPreservedSelection, withPluginPortalCandidates, withStoredAuthoredRead, withTransactionSpecDraftRead, wrapNodes };
217
+ export { EDITOR_DOCUMENT_FIELDS, EditorRefusalError, EditorSchemaCompileError, MAIN_ROOT_KEY, above, addMark, afterActiveTransactionEnds, applyBuiltDocumentChange, areEditorJsonValuesEqual, assertDetachedSelectionSupported, assertEditorDocumentContainers, assertEditorJsonValue, assertEditorOptions, assertPublicRootKey, assertSelectionSupported, attachTransactionSpecAfterCommit, authoredDirectProperties, brandPluginDescriptor, callPluginUpdateMethod, canPlaceBlocksAtPath, canonicalRecordJson, claimsHistoryReplay, cloneEditorJsonValue, collapse, commitMatchesSelectorDependencies, compileEditorSchemaCapabilityEntries, compileEditorSchemaContractEntries, compileEditorSchemaContributions, compilePlugin, compilePluginInput, completePersistedDocumentFields, configureAuthoredView, containsCompleteEditorSchema, countCoreWork, createAuthoredEditorView, createDetachedContentSlice, createDetachedEditorSchema, createDormantEditor, createEditorCommitPublicationQueue, createEditorEffect, createEditorOwner, createEditorReadApi, createInternalRootChangeFromSections, decodeEditorSelection, decodeVersionedValue, deleteEditor as delete, deleteFragment, deselect, didCommitChangePersistedValue, dispatchCommand, edges, elementReadOnly, encodeEditorSelection, encodeVersionedValue, evaluateCommand, exportContentSlice, failInvariant, first, fitSliceChildren, fitSlicePlacements, formatDebugValue, fragment, getActiveCommandEditor, getActiveEditorTransaction, getActiveEditorUpdateId, getActiveEditorUpdateTags, getAnchorRuntimeId, getAuthoredUpdateView, getAuthoredViewCommit, getCandidatePluginApi, getCaretOwner, getCarriedCaretEditor, getCollabEffectTypes, getCollabEffects, getCommitDocumentValue, getCompiledEditorConfiguration, getCompiledEditorSchema, getCompiledEditorSchemaFromApi, getCompiledPropertyCandidates, getCompiledPropertyMergeStrategy, getCompiledSchemaPropertyId, getDocumentChangeRelocations, getDocumentValueNode, getEditorAuthoredDocumentCapability, getEditorCommitNode, getEditorCommitSnapshot, getEditorCommitValue, getCurrentMarks as getEditorCurrentMarks, getEditorDocumentShapeIssueMessage, getLiveNode as getEditorLiveNode, getLiveText as getEditorLiveText, getEditorMaxLength, getEditorNodeKeyForNode, getEditorRuntime, getEditorRuntimeElementEntries, getEditorRuntimeRoot, getEditorRuntimeRootKeys, getCurrentSelectionRoot as getEditorSelectionRoot, getEditorStateView, getEditorUpdateRoot, getExactDocumentChangeRelocation, getExactDocumentChangeRelocations, getFragment, getInstalledPlugin, getInstalledPluginApi, getInternalDocumentChangeClassification, getInternalDocumentChangeClassificationEntries, getInternalDocumentChangeRanges, getInternalDocumentChangeRootKeys, getPluginRegistry as getInternalPluginRegistry, getLastCommit, getMutationVersion, getNodeKey, getNodeKeyDOMValue, getPathByNodeKey, getPluginContributions, getPluginRegistry$1 as getPluginRegistry, getPluginSlotInput, getRangeRoot, getReaderRange, getRecordSetVersion, getSchemaElementSourceReference, getSelectionDOMRange, getSnapshotVersion, getStateFieldEffectTypes, getStateViewPresentation, getTextSearchScope, getValueRecords, getViewAuthor, getViewCommitSource, getViewPresentation, hasBlocks, hasCommandHandler, hasEditorRuntime, hasEditorRuntimeRoot, hasInlines, hasInternalDocumentChangeRoot, hasNonWritableAt, hasNonWritableContributors, hasPath, hasTexts, holdsCaret, inheritPluginRegistry, initializePluginEntries, initializePlugins, insertNode, insertNodes, insertSoftBreak, install, isAuthorId, isDocumentView, isEdge, isEditorDraftView, isEditorPublishingCommit, isElementNonWritable, isElementReadOnly, isEmpty, isEnd, isEnvelopeInput, isInline, isObject, isPlugin, isSelectable, isStart, isVoid, landNodePropertiesAt, last, leaf, levels, liftNodes, mapDetachedSelectionThroughChange, mapInternalDocumentChangePoint, mapInternalDocumentChangePosition, mapSemanticUpdateMethodArguments, markRootViewInteraction, markRootViewUsed, matchesCompiledSchemaTarget, mergeNodes, moveNodes, next, nonWritableContent, nonWritableRoot, normalizeSelectorDependencies, normalizeSetValues, notifyObservers, observeAnchorStateWork, onPresentationRelease, parent, path, placeElementAt, point, preserveCompiledSchemaPropertyIdentity, previous, probeCommandNativeEquivalent, projectEditorView, projectRange, projectRangeInSnapshot, publishEditorCommitInVersionOrder, publishEditorRefusal, queueAfterPluginAcquisition, range, read, readAuthoredView, readAuthoredViewKey, readCaretViewIn, readCommitRootIndex, readCoreWork, readDocumentRange, readDocumentRecord, readEditorCommitHistoryEntry, readEditorDocument, readEditorOptions, readEditorViewStateFacts, readElementPropertyWrites, readPersistedEnvelope, readRecord, readRootContentTarget, readRootEntries, readRootViewContentUse, readRootViewUse, readShownDocument, readShownElementById, readShownPreview, readShownRecords, readShownViewUse, readStoredEditorDocument, readViewPage, readingCovered, recordEditorHistoryEffect, recordSetChanges, recordSetIds, registerEditorTransactionGuard, rejectEditorRecord, releaseEditor, removeMark, removeNodes, repairEditorValue, replaceChildren, reportEditorLifecycleError, reset, resetEditorCommitPublicationQueue, resolveCompiledSchemaProperty, resolveInstalledPlugin, resolveLocationRoot, resolvePluginMethod, restoreAnchor, retainViewPresentation, runEditorObserver, runTrustedUpdate, sameResult, sameSelectorDependencies, scheduleAfterCommitNotification, select, selectorDependenciesSubscriptionKey, selectorDependenciesViewSubscription, selectorDependenciesWantCommits, selectorDependenciesWantShownPreview, selectorDependenciesWantViewKind, serializeStructuralPlainText, setDOMClipboardFormatKey, setChildren as setEditorChildren, setEditorComposing, setCurrentMarks as setEditorMarks, setEditorMaxLength, setEditorRuntime, setCurrentSelection as setEditorSelection, setEditorSnapshotInputTransform, setEditorStateViewTransform, setTargetRuntime as setEditorTargetRuntime, setEditorTransactionViewTransform, setNodes, setPluginPortalFactory, setPoint, setSelection, setSelectionAsView, shouldMergeNodesRemovePrevNode, shouldSkipHistoryForOnlyProperties, skipHistoryIfOnlyProperties, snapshotEditorJsonValue, splitNodes, startEditor, startOwnedEditor, subscribeCaretTarget, subscribeEditorRefusals, subscribeEditorViewState, subscribeSharedEditorViewState, subscribeShownViewUse, subscribeSource, toInternalRoot, toPublicRoot, toggleBlock, toggleMark, tracksPlaces, txStored, unsetNodes, unwrapNodes, update, vetoesWrite, viewStateFactsChanged, visitDocumentChangeSections, voidEditor as void, withCompiledEditorSchemaCapabilityEntries, withDocumentViewRead, withEditorDocumentProjection, withEditorUpdateRootScope, withMountedPresentation, withPliteReactPreservedSelection, withPluginPortalCandidates, withStoredAuthoredRead, withTransactionSpecDraftRead, wrapNodes };