plitejs 54.0.0-beta.3 → 54.0.0-beta.5

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 (56) hide show
  1. package/dist/annotations/index.d.ts +1 -1
  2. package/dist/annotations/index.js +1 -1
  3. package/dist/authored/index.d.ts +2 -2
  4. package/dist/authored/index.js +168 -46
  5. package/dist/{authored-veto-DSnQcHGR.js → authored-veto-Cu-5JdVj.js} +1 -1
  6. package/dist/{comparison-plan-CEQL0ooW.js → comparison-plan-BJxnVPcS.js} +1 -1
  7. package/dist/{comparison-types-Dt-unJZY.d.ts → comparison-types-Bvvxzxq2.d.ts} +1 -1
  8. package/dist/{create-editor-CkHtPWXV.js → create-editor-XvI_4sYc.js} +2 -1
  9. package/dist/diff/index.d.ts +2 -2
  10. package/dist/diff/index.js +2 -2
  11. package/dist/dom/index.d.ts +1 -1
  12. package/dist/dom/index.js +1 -1
  13. package/dist/{dom-Cgfscvnm.js → dom-BjspML2h.js} +71 -46
  14. package/dist/{editor-owner-IUmkTeXz.js → editor-owner-CRgIQ625.js} +1 -1
  15. package/dist/history/index.d.ts +1 -1
  16. package/dist/history/index.js +2 -2
  17. package/dist/hyperscript/index.d.ts +1 -1
  18. package/dist/hyperscript/index.js +1 -1
  19. package/dist/{hyperscript-FPuoArEi.js → hyperscript-BFypA5qW.js} +2 -2
  20. package/dist/{index-Cw-oC2ps.d.ts → index-BUJsM0oV.d.ts} +1 -1
  21. package/dist/{index-HPYawTae.d.ts → index-BwmXxqbi.d.ts} +1 -1
  22. package/dist/{index-DPWyk3lG.d.ts → index-CRmyGzS8.d.ts} +7 -1
  23. package/dist/{index-K0Za9YXc.d.ts → index-CYac3_ID.d.ts} +26 -22
  24. package/dist/{index-BpQx2UG4.d.ts → index-DaXz-4c7.d.ts} +10 -8
  25. package/dist/{index-DpltOCot.d.ts → index-QuqD4Dyj.d.ts} +109 -27
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js +4 -4
  28. package/dist/internal/index.d.ts +2 -2
  29. package/dist/internal/index.js +4 -4
  30. package/dist/{mapped-view-store-ld-6uxEU.js → mapped-view-store-XUJ-fnHE.js} +1 -1
  31. package/dist/{native-grouping-input-DMNcsIaW.js → native-grouping-input-8kO12VK9.js} +1 -1
  32. package/dist/pagination/index.d.ts +1 -1
  33. package/dist/pagination/index.js +1 -1
  34. package/dist/pagination/react.d.ts +2 -2
  35. package/dist/pagination/react.js +5 -5
  36. package/dist/{pagination-D_A8iPJP.js → pagination-ChDBJtdC.js} +1 -1
  37. package/dist/{plugin-DWzkJbnJ.js → plugin-BvM4s-Lr.js} +1481 -964
  38. package/dist/{range-geometry-BjeLHOnl.js → range-geometry-B5CITwMp.js} +2 -2
  39. package/dist/{range-geometry-BLAHRE11.d.ts → range-geometry-wFuJaBlA.d.ts} +1 -1
  40. package/dist/react/index.d.ts +5 -5
  41. package/dist/react/index.js +6 -6
  42. package/dist/react/virtualized.d.ts +2 -2
  43. package/dist/react/virtualized.js +1 -1
  44. package/dist/{react-DZ15gmz2.js → react-cmFeNP6P.js} +16 -8
  45. package/dist/{retraction-BMem8Rfk.js → retraction-lXQwo2Ia.js} +1 -1
  46. package/dist/{src-cT1OTKP_.js → src-BA6F9yxN.js} +195 -3
  47. package/dist/{store-Cz2mXyDe.js → store-Bllfuqp4.js} +24 -11
  48. package/dist/testing/index.d.ts +2 -2
  49. package/dist/testing/index.js +3 -3
  50. package/dist/{use-editor-dom-scope-BbMDSCpW.js → use-editor-dom-scope-B4gF9t_Y.js} +572 -524
  51. package/dist/yjs/index.d.ts +1 -1
  52. package/dist/yjs/index.js +1 -1
  53. package/dist/yjs/react/index.d.ts +3 -3
  54. package/dist/yjs/react/index.js +3 -3
  55. package/dist/{yjs-DOK-m7kl.js → yjs-CWdWDrpv.js} +5 -2
  56. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import { a as AnnotationSnapshot, c as OwnedAnnotationStore, i as AnnotationRefreshOptions, l as ResolvedAnnotation, n as AnnotationAnchor, o as AnnotationStore, r as AnnotationChange, s as AnnotationStoreOptions, t as Annotation, u as createAnnotationStore } from "../index-DPWyk3lG.js";
1
+ import { a as AnnotationSnapshot, c as OwnedAnnotationStore, i as AnnotationRefreshOptions, l as ResolvedAnnotation, n as AnnotationAnchor, o as AnnotationStore, r as AnnotationChange, s as AnnotationStoreOptions, t as Annotation, u as createAnnotationStore } from "../index-CRmyGzS8.js";
2
2
  export { type Annotation, type AnnotationAnchor, type AnnotationChange, type AnnotationRefreshOptions, type AnnotationSnapshot, type AnnotationStore, type AnnotationStoreOptions, type OwnedAnnotationStore, type ResolvedAnnotation, createAnnotationStore };
@@ -1,2 +1,2 @@
1
- import { t as createAnnotationStore } from "../store-Cz2mXyDe.js";
1
+ import { t as createAnnotationStore } from "../store-Bllfuqp4.js";
2
2
  export { createAnnotationStore };
@@ -1,5 +1,5 @@
1
- import { Am as TxOnlyMethod, As as SchemaPropertyTypeChangePolicy, Es as SchemaPropertyLandingPolicy, Fd as PluginDependencyReferenceFor, Lg as EditorJsonValue, Mg as Path, Og as Point, Om as TxDeclaredMethod, Oo as PropertySetDescriptor, Os as SchemaPropertyRole, _g as Range, bc as AnyEditor, bf as Value, dd as EditorViewOptions, dn as AuthoredProjectionDiagnostic, fn as AuthoredProjectionRefusal, ks as SchemaPropertySplitPolicy, nl as EditorDocumentValue, un as AuthoredDocumentProjection, vd as NodeKey, wc as ContentSlice, wo as PropertyJsonDescriptor, xd as Plugin, xg as Location, xs as SchemaPropertyExclusiveGroup, ys as SchemaPropertyCopyPolicy } from "../index-DpltOCot.js";
2
- import { h as TwoWayComparison } from "../comparison-types-Dt-unJZY.js";
1
+ import { As as SchemaPropertyLandingPolicy, Cs as SchemaPropertyCopyPolicy, Hd as PluginDependencyReferenceFor, Jg as EditorJsonValue, Lm as TxDeclaredMethod, Mg as Location, Mo as PropertySetDescriptor, Ms as SchemaPropertyRole, Ns as SchemaPropertySplitPolicy, Oc as ContentSlice, Od as Plugin, Of as Value, Og as Range, Oo as PropertyJsonDescriptor, Ps as SchemaPropertyTypeChangePolicy, Ts as SchemaPropertyExclusiveGroup, Ug as Path, dn as AuthoredDocumentProjection, fn as AuthoredProjectionDiagnostic, gd as EditorViewOptions, ol as EditorDocumentValue, pn as AuthoredProjectionRefusal, wc as AnyEditor, wd as NodeKey, zg as Point, zm as TxOnlyMethod } from "../index-QuqD4Dyj.js";
2
+ import { h as TwoWayComparison } from "../comparison-types-Bvvxzxq2.js";
3
3
  //#region src/authored/tree/layers.d.ts
4
4
  type FormatWrite = Readonly<{
5
5
  kind: 'remove';
@@ -1,7 +1,7 @@
1
- import { $o as canonicalizeCompiledTextProperties, $s as ownedRootsOf, Ad as propertyDeltaFromModifications, Al as holdsUniqueKey, Au as UNSCOPED_ORIGINS, Bd as rootNodesOf, Bl as splitDroppedKeysOf, Bo as txOnly, Bs as carriesDefault, Cd as addSection, Cs as mapSelectionWithContext, Cu as getEditorRuntime, D as property, Da as gridRolesOf, Dc as authoredDocumentCapabilityPoint, Dl as handoverKeysOf, Ea as gridPartsOf, Ef as areEditorJsonValuesEqual, Eu as getEditorSchema, Fd as DocumentIndex, Gd as PreparedTokenSliceStructureError, Gf as copyRoot, Gn as getCurrentSelection, Gs as changedRootsOf, Hd as normalizeSetValues, Hl as toCompiledTargetContext, Ho as txStored, Hs as isLeftOutDefault, Id as NO_NODES, In as getActiveEditorUpdateId, Is as EditorSchemaValidationError, Jf as lazyRootOf, Js as orphanedValueRoots, Ka as nextMintedGeneration, Kd as closeToken, Kf as copyRoots, Kn as getCurrentSelectionRoot, Ko as documentAdmissionPoint, Ks as judgeProjectedRoots, Lc as registerAuthoredRuntime, Ln as getActiveEditorUpdateTags, Ls as adoptVerdicts, Ml as isSupportedGeneratedElementProperty, Mr as isPresentationComposing, Nf as isEditorJsonValue, Nl as matchesCompiledSchemaTarget, Ns as joinedAway, O as schema, Oa as leftWithNoGridPart, Od as keptRunsOf, Pc as getAuthoredUpdateView, Pr as notifyPresentationViewState, Qd as openToken, Qn as getEditorProjectionSnapshotIndex, Qs as ensureElementOwnedRootIndex, Qu as createInternalDocumentChange, Rl as resolveCompiledSchemaProperty, Rs as judgedBy, Sd as RootChange, Sl as crossesUniqueTarget, Sr as inheritEditorProjectionIndexes, Su as registerEditorCommandDocument, Ta as gridHoldersOf, Td as applyPropertyModifications, Tf as withoutValueRoots, Ts as settleSelectionMode, Tu as getEditorRuntimeRoot, Ud as classifyRootChange, Ul as tracksPlaces, Us as isSplitOutput, Vd as canonicalJsonKey, Vs as elementSplitOutput, Wd as PreparedTokenSlice, Wf as copyFields, Wl as uniquePropertiesOf, Wo as admitDocument, Ws as readsAt, Xc as toPublicRoot, Xd as isTextNode, Xf as visitRootNames, Xo as ElementGenerationMaskedError, Xs as schemaHasContentRoots, Yc as toInternalRoot, Yd as isElementNode, Yf as setLazyRoot, Yo as documentRootsOf, Ys as rootsDeletedByName, Yu as DocumentChange, Zc as getRangeEndpointAssociations, Zd as nodeProps, Zf as countCoreWork, Zo as acceptsPropertyValue, Zs as advanceElementOwnedRootIndex, _d as valueRootIndex, _f as hasRecordWithPrefix, ad as getInternalDocumentChangeEntries, af as NO_RECORD_OPS, as as getRepresentationEditorFromApi, au as ElementApi, ba as editorReads, br as hasEditorProjectionSnapshotIndex, cd as getInternalDocumentChangeRootKeys, cf as deriveValue, df as getRecordIds, dl as getCompiledEditorSchema, ds as withoutGeneration, du as registerEditorContent, ea as registerEditorDocumentRecorder, ec as rebaseElementOwnedRootIndex, ef as textToken, el as EditorRefusalError, ep as deepFreeze, es as createDetachedEditorSchema, ff as getRecordSetVersion, fs as withoutGenerationOf, gd as valueRoot, gf as hasRecord, hf as getValueRecords, ho as getViewPresentation, hu as PointApi, if as getNodeKeyForNode, il as notifyObservers, ip as getDefined, iu as SelectionApi, jd as semanticPropertyModifications, k as target, ka as survivalUnder, kd as mapRootChangePositionBackward, kl as hashSchemaIdentityString, ks as completeChildrenAt, l as definePlugin, ld as getInternalDocumentRootChange, lf as getRecordCount, mc as getEditorCommitSchemas, mf as getRecordsWithPrefix, mi as subscribePresentationComposition, mu as RangeApi, na as registerEditorDraftView, nd as filterDocumentChangeRoots, nl as subscribeEditorRefusals, no as subscribeCommittedPlacement, np as jsonEqual, ns as generateElementPropertyValue, oc as createEditorCommit, od as getInternalDocumentChangeRanges, of as canonicalRecordJson, pf as getRecordText, pl as getPluginContributions, po as getViewAuthor, qd as encodeNodes, qf as isFrozenWithRoots, qs as orphanedRoots, ra as registerEditorFitsByLook, sd as getInternalDocumentChangeRecords, sf as composeRecordOps, ss as holdsOneText, ta as registerEditorDraftGuard, tc as rootsOwnedOnlyWithin, tl as publishEditorRefusal, uf as getRecordEntries, us as readEmptyText, vc as getEditorCommitValue, vd as valueRootNodes, vr as getTransactionSnapshot, wf as withValueRecords, wl as getCompiledPropertyCandidates, wo as getBaseViewPresentation, ws as rawNodeAt, wt as isEmpty, wu as getEditorRuntimeOwner, xf as recordSetChanges, xi as withEditorDocumentProjection, xn as applyDocumentChange, xu as PathApi, ya as executeEditorRead, yd as withDocumentChangeRecords, yf as recordOpsBetween, z as prepareCommandFrame, za as getPlacementGeneration, zd as rootIndexOf, zs as readingCovered } from "../plugin-DWzkJbnJ.js";
2
- import { t as authoredVeto } from "../authored-veto-DSnQcHGR.js";
3
- import { n as EditorMissingReferenceError, t as retractionOf } from "../retraction-BMem8Rfk.js";
4
- import { S as fingerprintEditorJson, c as COMPARISON_POLICY, n as comparisonPlanOf, t as closeOverRequired } from "../comparison-plan-CEQL0ooW.js";
1
+ import { $d as isTextNode, $l as splitDroppedKeysOf, $o as documentAdmissionPoint, $s as judgeProjectedRoots, Aa as gridRolesOf, As as mapSelectionWithContext, Bc as getAuthoredUpdateView, Bl as handoverKeysOf, Bs as joinedAway, Ca as editorReads, D as property, Df as withValueRecords, Du as getEditorRuntimeOwner, Ed as addSection, El as getPluginContributions, Eu as getEditorRuntime, Fl as crossesUniqueTarget, Fn as getActiveEditorUpdateId, Gd as normalizeSetValues, Gl as isSupportedGeneratedElementProperty, Gn as getCurrentSelectionRoot, Gs as judgedBy, Ha as getPlacementGeneration, Hd as rootIndexOf, Hl as hashSchemaIdentityString, If as isEditorJsonValue, In as getActiveEditorUpdateTags, Is as completeChildrenAt, Jd as PreparedTokenSliceStructureError, Jf as RangeApi, Js as elementSplitOutput, Kd as classifyRootChange, Kl as matchesCompiledSchemaTarget, Ks as readingCovered, Ll as getCompiledPropertyCandidates, Ma as survivalUnder, Md as mapRootChangePositionBackward, Mo as getBaseViewPresentation, Mr as isPresentationComposing, Ms as settleSelectionMode, Nd as propertyDeltaFromModifications, Nu as UNSCOPED_ORIGINS, O as schema, Oa as gridHoldersOf, Od as applyPropertyModifications, Of as withoutValueRoots, Ou as getEditorRuntimeRoot, Pc as authoredDocumentCapabilityPoint, Pd as semanticPropertyModifications, Pr as notifyPresentationViewState, Qd as isElementNode, Qs as changedRootsOf, Qu as DocumentChange, Rd as DocumentIndex, Sa as executeEditorRead, Sd as withDocumentChangeRecords, Sf as recordOpsBetween, Si as withEditorDocumentProjection, Sr as inheritEditorProjectionIndexes, Tc as getEditorCommitValue, Td as RootChange, Tu as registerEditorCommandDocument, Ud as rootNodesOf, Ul as holdsUniqueKey, Us as EditorSchemaValidationError, Wc as registerAuthoredRuntime, Wd as canonicalJsonKey, Wn as getCurrentSelection, Ws as adoptVerdicts, Xc as isDocumentViewReading, Xd as encodeNodes, Xs as isSplitOutput, Ya as nextMintedGeneration, Yd as closeToken, Yo as txStored, Ys as isLeftOutDefault, Zf as PointApi, Zl as resolveCompiledSchemaProperty, Zn as getEditorProjectionSnapshotIndex, Zo as admitDocument, Zs as readsAt, _f as getRecordsWithPrefix, _l as notifyObservers, _r as getTransactionSnapshot, _s as readEmptyText, _u as SelectionApi, aa as registerEditorFitsByLook, ac as ensureElementOwnedRootIndex, ad as filterDocumentChangeRoots, ao as subscribeCommittedPlacement, ap as copyRoot, bd as valueRootIndex, bf as hasRecordWithPrefix, bn as applyDocumentChange, bo as getViewPresentation, cc as rootsOwnedOnlyWithin, cd as getInternalDocumentChangeEntries, cf as NO_RECORD_OPS, cl as toInternalRoot, cp as lazyRootOf, dd as getInternalDocumentChangeRootKeys, df as deriveValue, dp as countCoreWork, ec as orphanedRoots, ef as nodeProps, fd as getInternalDocumentRootChange, ff as getRecordCount, fs as getRepresentationEditorFromApi, gf as getRecordText, gp as jsonEqual, hf as getRecordSetVersion, hi as subscribePresentationComposition, hl as subscribeEditorRefusals, ia as registerEditorDraftView, ic as advanceElementOwnedRootIndex, if as tokenLength$1, ip as copyFields, is as acceptsPropertyValue, ja as leftWithNoGridPart, jd as keptRunsOf, js as rawNodeAt, k as target, ka as gridPartsOf, kf as areEditorJsonValuesEqual, ku as getEditorSchema, l as definePlugin, ld as getInternalDocumentChangeRanges, lf as canonicalRecordJson, ll as toPublicRoot, lp as setLazyRoot, ls as generateElementPropertyValue, mf as getRecordIds, ml as publishEditorRefusal, mp as deepFreeze, ms as holdsOneText, na as registerEditorDocumentRecorder, nc as rootsDeletedByName, np as PathApi, ns as documentRootsOf, nu as tracksPlaces, oc as ownedRootsOf, op as copyRoots, os as canonicalizeCompiledTextProperties, pc as createEditorCommit, pf as getRecordEntries, pl as EditorRefusalError, qd as PreparedTokenSlice, qo as txOnly, qs as carriesDefault, ra as registerEditorDraftGuard, rc as schemaHasContentRoots, rf as textToken, rs as ElementGenerationMaskedError, ru as uniquePropertiesOf, sc as rebaseElementOwnedRootIndex, sf as getNodeKeyForNode, sp as isFrozenWithRoots, ss as createDetachedEditorSchema, tc as orphanedValueRoots, td as createInternalDocumentChange, tf as openToken, tu as toCompiledTargetContext, ud as getInternalDocumentChangeRecords, uf as composeRecordOps, ul as getRangeEndpointAssociations, up as visitRootNames, vf as getValueRecords, vo as getViewAuthor, vp as getDefined, vs as withoutGeneration, vu as ElementApi, wf as recordSetChanges, wl as getCompiledEditorSchema, wt as isEmpty, wu as registerEditorContent, xc as getEditorCommitSchemas, xd as valueRootNodes, yd as valueRoot, yf as hasRecord, yr as hasEditorProjectionSnapshotIndex, ys as withoutGenerationOf, z as prepareCommandFrame, zd as NO_NODES } from "../plugin-BvM4s-Lr.js";
2
+ import { t as authoredVeto } from "../authored-veto-Cu-5JdVj.js";
3
+ import { n as EditorMissingReferenceError, t as retractionOf } from "../retraction-lXQwo2Ia.js";
4
+ import { S as fingerprintEditorJson, c as COMPARISON_POLICY, n as comparisonPlanOf, t as closeOverRequired } from "../comparison-plan-BJxnVPcS.js";
5
5
  //#region src/authored/ledger/roots.ts
6
6
  /** @internal */
7
7
  const rootOf = (value, root) => root === "main" ? rootIndexOf(value, "children") : rootIndexOf(value.roots ?? {}, root);
@@ -3576,10 +3576,19 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
3576
3576
  return node;
3577
3577
  };
3578
3578
  const ownRemovalMemo = /* @__PURE__ */ new WeakMap();
3579
+ let nextLines;
3580
+ const keptForPendingJoin = (node, removing) => {
3581
+ nextLines ??= new Map(textBlocksOf(children).flatMap(({ node: line, path }, at, lines) => {
3582
+ const next = lines[at + 1];
3583
+ return next && next.path.length === path.length && next.path.at(-1) === getDefined(path.at(-1)) + 1 && next.path.slice(0, -1).every((step, depth) => step === path[depth]) ? [[line, next.node]] : [];
3584
+ }));
3585
+ const next = nextLines.get(node);
3586
+ return !!next && !readAuthoredMarks(node).some((mark) => followsOf(mark) !== void 0) && removing.every((mark) => (mark.kind === "insert" || mark.kind === "delete") && !isEditingChange(mark.change)) && !pending(next).some((mark) => removes(mark, resultOf(mark))) && pending(next).some((mark) => mark.kind === "join" && !isEditingChange(mark.change) && decisionOf(mark) === "keep" && removing.every((removal) => removal.author !== mark.author));
3587
+ };
3579
3588
  const ownMarkRemoves = (node) => {
3580
3589
  let value = ownRemovalMemo.get(node);
3581
3590
  if (value === void 0) {
3582
- value = pending(node).some((mark) => removes(mark, resultOf(mark)));
3591
+ value = pending(node).some((mark) => removes(mark, resultOf(mark))) && !(isTextBlock(node) && keptForPendingJoin(node, pending(node).filter((mark) => removes(mark, resultOf(mark)))));
3583
3592
  ownRemovalMemo.set(node, value);
3584
3593
  }
3585
3594
  return value;
@@ -3666,9 +3675,9 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
3666
3675
  const fromLeft = leftSupplies(schema?.ownership ?? null, halves);
3667
3676
  return new Set([...Object.keys(propsOf$4(halves.right.node)), ...halves.right.pending.flatMap((mark) => mark.kind === "format" ? [mark.key] : [])].filter((name) => !fromLeft(name)));
3668
3677
  };
3669
- const cutVerdict = (key, storedLeft, halves, around) => {
3678
+ const cutVerdict = (key, storedLeft, halves, around, stays) => {
3670
3679
  let rightKeys;
3671
- const undecided = (mark) => !decidedWholeByGridPart(mark, around.place);
3680
+ const undecided = (mark) => !decidedWholeByGridPart(mark, around.place) && !stays?.(mark);
3672
3681
  const unheld = (half) => ({
3673
3682
  ...half,
3674
3683
  pending: half.pending.filter(undecided)
@@ -3689,6 +3698,15 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
3689
3698
  }
3690
3699
  return result.verdict;
3691
3700
  };
3701
+ let marksOnText;
3702
+ const textMarksIn = (nodes, into) => {
3703
+ for (const node of nodes) if (typeof node.text === "string") {
3704
+ if (node.text === "") continue;
3705
+ for (const mark of readAuthoredMarks(node)) into.add(`${mark.kind} ${incarnationOf(mark)}`);
3706
+ } else textMarksIn(node.children ?? [], into);
3707
+ return into;
3708
+ };
3709
+ const marksNonEmptyText = (mark) => (marksOnText ??= textMarksIn(children, /* @__PURE__ */ new Set())).has(`${mark.kind} ${incarnationOf(mark)}`);
3692
3710
  const contentMarksIn = (node) => [...ownMarkRemoves(node) ? [] : pending(node).filter((mark) => mark.kind === "insert" || mark.kind === "delete"), ...(node.children ?? []).flatMap(contentMarksIn)];
3693
3711
  const structureOf = (node) => {
3694
3712
  let editingJoin = false;
@@ -3712,6 +3730,8 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
3712
3730
  const blocks = textBlocksOf(children).filter(outsideTakenPart);
3713
3731
  const mergedInto = /* @__PURE__ */ new Map();
3714
3732
  const mergedBlocks = /* @__PURE__ */ new Map();
3733
+ const pendingOnMergedText = /* @__PURE__ */ new Set();
3734
+ const mergesBeyondMark = (node, mark) => pendingOnMergedText.has(incarnationOf(mark)) && (mergedBlocks.get(node) ?? []).some((block) => !pending(block).some((other) => other.kind === mark.kind && incarnationOf(other) === incarnationOf(mark)));
3715
3735
  const emptiedTargets = /* @__PURE__ */ new Set();
3716
3736
  const standsFor = /* @__PURE__ */ new Map();
3717
3737
  const standsIn = /* @__PURE__ */ new Set();
@@ -3759,7 +3779,7 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
3759
3779
  }, {
3760
3780
  between: [],
3761
3781
  place: chain
3762
- }) === "together" ? left : null;
3782
+ }, (mark) => (mark.kind === "insert" || mark.kind === "delete") && mark.author !== cut.author && decisionOf(mark) === "keep") === "together" ? left : null;
3763
3783
  };
3764
3784
  const landingOf = (node, into) => {
3765
3785
  const rejoins = rejoinsSplit(node);
@@ -3859,9 +3879,19 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
3859
3879
  blocks.forEach(({ ancestors, node }, index) => {
3860
3880
  const { editingJoin, join } = structureOf(node);
3861
3881
  if (!join) return;
3882
+ let deciders;
3883
+ const othersPendingOnText = (mark) => {
3884
+ if (editingJoin || mark.kind !== "insert" && mark.kind !== "delete") return false;
3885
+ deciders ??= new Set(pending(node).flatMap((own) => mergesUp(own, resultOf(own)) ? [own.author] : []));
3886
+ return !deciders.has(mark.author) && marksNonEmptyText(mark);
3887
+ };
3888
+ let target = null;
3862
3889
  const waited = editingJoin || (node.children ?? []).some(keptContent) ? [] : contentMarksIn(node);
3863
3890
  const land = (effect) => {
3864
- const waiting = waited.filter((mark) => !decidedWholeByGridPart(mark, ancestors));
3891
+ const waiting = waited.filter((mark) => !decidedWholeByGridPart(mark, ancestors) && !(decisionOf(mark) === "keep" && othersPendingOnText(mark)));
3892
+ if (target && effect) {
3893
+ for (const mark of waited) if (decisionOf(mark) === "keep" && othersPendingOnText(mark)) pendingOnMergedText.add(incarnationOf(mark));
3894
+ }
3865
3895
  if (waiting.some((mark) => decisionOf(mark) === "keep") && pending(node).some((mark) => mark.kind === "join" && isEditingChange(mark.change))) {
3866
3896
  retainedJoins.add(node);
3867
3897
  return;
@@ -3874,7 +3904,6 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
3874
3904
  return;
3875
3905
  }
3876
3906
  const boundary = [...ancestors].reverse().find((ancestor) => survives(ancestor) && !structureOf(ancestor).unwrap) ?? null;
3877
- let target = null;
3878
3907
  const cutFrom = rejoinsSplit(node) ? new Set(pending(node).flatMap((mark) => mark.kind === "insert" ? [incarnationOf(mark)] : [])) : null;
3879
3908
  const rejoins = (candidate) => {
3880
3909
  const removing = pending(candidate).filter((mark) => removes(mark, resultOf(mark)));
@@ -3967,11 +3996,8 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
3967
3996
  continue;
3968
3997
  }
3969
3998
  if (emptiedTargets.has(node)) continue;
3970
- const waiting = claims.filter((mark) => resultOf(mark) === "accept" && links.sourceOf([getDefined(followsOf(mark))], order) !== null);
3971
- if (waiting.length === 0) continue;
3972
- if (waiting.some((mark) => isEditingChange(mark.change))) {
3973
- if (decisionOf(source.mark) === "keep") retainFollowers(node, waiting);
3974
- } else wait([source.mark]);
3999
+ const accepted = claims.filter((mark) => resultOf(mark) === "accept" && links.sourceOf([getDefined(followsOf(mark))], order) !== null);
4000
+ if (decisionOf(source.mark) === "keep") retainFollowers(node, accepted);
3975
4001
  }
3976
4002
  const joinedCarriedTo = (node) => (mergedBlocks.get(node) ?? []).flatMap((block) => [...readAuthoredMarks(block).filter((mark) => mark.kind === "joined" && decisionOf(mark) === "keep"), ...joinedCarriedTo(block)]);
3977
4003
  const movedWith = (node) => {
@@ -4283,7 +4309,7 @@ const resolveIn = (given, outcome, schema, root, options, probe) => {
4283
4309
  if (!isText$4(node)) poolOf(original, shell);
4284
4310
  const kept = withBuiltSpares(keptMembers(shell, marks, (mark) => {
4285
4311
  const result = resultOf(mark);
4286
- return mark.kind === "format" ? formats?.kept.has(mark) ?? false : result === "keep" || mark.kind === "join" && result === "accept" && retainedJoins.has(node) || (retainedFollowers.get(node)?.has(followerKeyOf(mark)) ?? false);
4312
+ return mark.kind === "format" ? formats?.kept.has(mark) ?? false : result === "keep" && !mergesBeyondMark(node, mark) || mark.kind === "join" && result === "accept" && retainedJoins.has(node) || (retainedFollowers.get(node)?.has(followerKeyOf(mark)) ?? false);
4287
4313
  }, stores && sparesIn(shell).length > 0 && stillBuilds(shell, [...node.children ?? [], ...(mergedBlocks.get(node) ?? []).flatMap((block) => block.children ?? [])])), landedSpares.get(original) ?? landedSpares.get(node));
4288
4314
  const dropsValue = placedProps !== decidedProps;
4289
4315
  if (dropsValue) waitOnPlaceChanges([node, ...above]);
@@ -8252,9 +8278,9 @@ const remainsAfter = (value, decided, { dropped, runs }, book, resolvedIn) => {
8252
8278
  const incarnationsOf = (occurrences) => new Map(occurrences.map(({ mark }) => [incarnationOf(mark), mark])).values();
8253
8279
  const withVerdicts = (value, verdicts) => verdicts.length === 0 ? value : deriveValue(value, {}, putVerdicts(verdicts));
8254
8280
  const insideTaken = (value, root, path, takenWhole) => {
8255
- let nodes = root === "main" ? value.children : value.roots?.[root] ?? [];
8281
+ let nodes = valueRootNodes(value, root);
8256
8282
  for (const at of path) {
8257
- const node = nodes[at];
8283
+ const node = nodes.at(at);
8258
8284
  if (!node) return false;
8259
8285
  if (takenWhole.has(node)) return true;
8260
8286
  nodes = node.children ?? [];
@@ -8270,10 +8296,10 @@ const takenWithoutVerdict = (value, actions, takenWhole, ownership) => {
8270
8296
  };
8271
8297
  const removedByMark = (node) => takenWhole.has(node) && marksOf(node, facts).some(removes);
8272
8298
  const partsOn = ({ path, root }) => {
8273
- let nodes = root === "main" ? value.children : value.roots?.[root] ?? [];
8299
+ let nodes = valueRootNodes(value, root);
8274
8300
  let taken = false;
8275
8301
  for (const at of path) {
8276
- const node = nodes[at];
8302
+ const node = nodes.at(at);
8277
8303
  if (!node) break;
8278
8304
  if (removedByMark(node)) return {
8279
8305
  remover: node,
@@ -12731,6 +12757,11 @@ const settleNode = (node, pass, site) => {
12731
12757
  return insertsSettled ? pass.dependencies.props(withMembers(next, kept), [...kept.filter(isClaim), ...pendingInserts]) : withMembers(next, kept);
12732
12758
  };
12733
12759
  const deletionAccepted = (node, pass) => readAuthoredMarks(node).some((mark) => mark.kind === "delete" && outcomeOf(pass.facts, mark) === "accept");
12760
+ const keptForPendingJoin = (element, next, pass) => {
12761
+ if (!next || !isTextBlock(element) || !isTextBlock(next)) return false;
12762
+ const deleting = readAuthoredMarks(element).filter((mark) => mark.kind === "delete" && !isEditingChange(mark.change) && outcomeOf(pass.facts, mark) === "accept");
12763
+ return deleting.length > 0 && !readAuthoredMarks(element).some((mark) => followsOf(mark) !== void 0) && !deletionAccepted(next, pass) && readAuthoredMarks(next).some((mark) => mark.kind === "join" && !isEditingChange(mark.change) && outcomeOf(pass.facts, mark) === "pending" && deleting.every((deletion) => deletion.author !== mark.author));
12764
+ };
12734
12765
  const goesWhenSettled = (element, children, pass) => {
12735
12766
  const gridPart = gridPartsOf(pass.schema);
12736
12767
  return deletionAccepted(element, pass) && children.every((child) => pass.gone.has(child) || isText$1(child) && child.text === "") || leftWithNoGridPart(gridHoldersOf(pass.schema), element, children, (child) => pass.gone.has(child) && gridPart(child));
@@ -12869,7 +12900,7 @@ const leaveLevel = (level, stored, site, pass) => {
12869
12900
  waits: false
12870
12901
  };
12871
12902
  };
12872
- const settleChild = (node, at, pass, site, inline) => {
12903
+ const settleChild = (node, at, pass, site, inline, next) => {
12873
12904
  const path = [...site.parentPath, at];
12874
12905
  if (gridPartsOf(pass.schema)(node) && deletionAccepted(node, pass)) {
12875
12906
  pass.gone.add(node);
@@ -12892,7 +12923,8 @@ const settleChild = (node, at, pass, site, inline) => {
12892
12923
  root: site.root
12893
12924
  };
12894
12925
  const level = settleNodes(settled.children, pass, inner, settled.children.some(isText$1));
12895
- if (goesWhenSettled(settled, level?.nodes ?? settled.children, pass)) {
12926
+ const held = keptForPendingJoin(settled, next, pass);
12927
+ if (!held && goesWhenSettled(settled, level?.nodes ?? settled.children, pass)) {
12896
12928
  if (inline) {
12897
12929
  edits.drop(path);
12898
12930
  return null;
@@ -12905,7 +12937,7 @@ const settleChild = (node, at, pass, site, inline) => {
12905
12937
  pass.gone.add(shell);
12906
12938
  return shell;
12907
12939
  }
12908
- const kept = dropDeletionWhenContentStays(settled, level?.nodes ?? settled.children, pass);
12940
+ const kept = held ? withMembers(settled, readMembers(settled).filter((member) => member.kind !== "delete" || outcomeOf(pass.facts, member) !== "accept")) : dropDeletionWhenContentStays(settled, level?.nodes ?? settled.children, pass);
12909
12941
  const left = level ? leaveLevel(level, settled.children, inner, pass) : null;
12910
12942
  const marked = (left ? !left.waits : kept !== node) ? withSettledSpares(node, kept, left?.taken ?? NOTHING_TAKEN, pass, site.root) : kept;
12911
12943
  if (marked !== node) edits.props(path, node, marked);
@@ -12922,7 +12954,7 @@ const settleNodes = (nodes, pass, site, inline = false) => {
12922
12954
  const next = [];
12923
12955
  nodes.forEach((node, at) => {
12924
12956
  if (firstText === -1 && isText$1(node)) firstText = at;
12925
- const settled = settleChild(node, at, pass, site, inline);
12957
+ const settled = settleChild(node, at, pass, site, inline, nodes.at(at + 1));
12926
12958
  if (settleChanges(node, settled, pass)) changed = true;
12927
12959
  if (!settled) return;
12928
12960
  readIndex.push(at);
@@ -12951,7 +12983,7 @@ const settleBlocks = (index, pass, blocks, root) => {
12951
12983
  const settled = /* @__PURE__ */ new Map();
12952
12984
  for (const at of [...blocks].sort((left, right) => left - right)) {
12953
12985
  const block = index.child(at);
12954
- if (block) settled.set(at, getDefined(settleChild(block, at, pass, site, false)));
12986
+ if (block) settled.set(at, getDefined(settleChild(block, at, pass, site, false, index.child(at + 1))));
12955
12987
  }
12956
12988
  const removed = [...settled].flatMap(([at, node]) => pass.gone.has(node) ? [at] : []);
12957
12989
  const readAt = (at) => index.child(at);
@@ -13727,6 +13759,86 @@ const farEdge = (toProjected, toStored, index, caret) => {
13727
13759
  stored: to + 1
13728
13760
  };
13729
13761
  };
13762
+ const inlineRunAt = (index, line, position, isInline) => {
13763
+ let from = line.contentFrom;
13764
+ let at = line.contentFrom;
13765
+ let depth = 0;
13766
+ let inBlock = false;
13767
+ for (const token of index.slice(line.contentFrom, line.contentTo).tokens) {
13768
+ const next = at + tokenLength$1(token);
13769
+ if (token.kind === "open") {
13770
+ if (depth === 0 && token.nodeKind === "element" && !isInline(token.props)) {
13771
+ if (at >= position) return {
13772
+ from,
13773
+ to: at
13774
+ };
13775
+ inBlock = true;
13776
+ }
13777
+ depth += 1;
13778
+ } else if (token.kind === "close") {
13779
+ depth -= 1;
13780
+ if (depth === 0 && inBlock) {
13781
+ from = next;
13782
+ inBlock = false;
13783
+ }
13784
+ }
13785
+ at = next;
13786
+ }
13787
+ return {
13788
+ from,
13789
+ to: line.contentTo
13790
+ };
13791
+ };
13792
+ function* framedSections(changes) {
13793
+ let earlier = null;
13794
+ for (const change of changes) {
13795
+ const back = (position, assoc) => earlier ? getDefined(mapRootChangePositionBackward(earlier, position, assoc)) : position;
13796
+ let position = 0;
13797
+ for (let pair = 0; pair < change.sections.length; pair += 2) {
13798
+ const length = change.sections[pair];
13799
+ yield {
13800
+ back,
13801
+ inserted: change.sections[pair + 1],
13802
+ length,
13803
+ position
13804
+ };
13805
+ position += length;
13806
+ }
13807
+ earlier = earlier ? earlier.compose(change) : change;
13808
+ }
13809
+ }
13810
+ const emptiesRunThatShowed = (changes, toProjected, index, run, isInline) => {
13811
+ const removed = [];
13812
+ for (const { back, inserted, length, position } of framedSections(changes)) if (length > 0 && inserted >= 0) removed.push({
13813
+ from: back(position, 1),
13814
+ to: back(position + length, -1)
13815
+ });
13816
+ removed.sort((left, right) => left.from - right.from);
13817
+ const merged = [];
13818
+ for (const range of removed) {
13819
+ const last = merged.at(-1);
13820
+ if (last && range.from <= last.to) last.to = Math.max(last.to, range.to);
13821
+ else merged.push({ ...range });
13822
+ }
13823
+ let covering = 0;
13824
+ let at = run.from;
13825
+ let shows = false;
13826
+ for (const token of index.slice(run.from, run.to).tokens) {
13827
+ const next = at + tokenLength$1(token);
13828
+ if (token.kind === "text" || token.kind === "open" && token.nodeKind === "element" && isInline(token.props)) {
13829
+ const from = toProjected(at, "forward");
13830
+ const to = toProjected(next, "backward");
13831
+ if (from < to) {
13832
+ while (merged[covering + 1]?.from <= from) covering += 1;
13833
+ const range = merged[covering];
13834
+ if (!range || range.from > from || range.to < to) return false;
13835
+ shows = true;
13836
+ }
13837
+ }
13838
+ at = next;
13839
+ }
13840
+ return shows;
13841
+ };
13730
13842
  const bothUnclaimed = (before, after) => !Object.hasOwn(before, "authored") && !Object.hasOwn(after, "authored");
13731
13843
  const containersAt = (document, position) => document.openContextAt(position).map(({ kind, path }) => kind === "text" ? kind : String(document.node(path).type)).join(" ");
13732
13844
  const marksCannotHoldKeptRuns = (change, before, after) => {
@@ -14092,19 +14204,9 @@ const advanceBreaks = (breaks, frame, stored) => breaks.map(({ after, at, before
14092
14204
  const changedStretch = (changes) => {
14093
14205
  let from = Infinity;
14094
14206
  let to = -Infinity;
14095
- let earlier = null;
14096
- for (const change of changes) {
14097
- const back = (position, assoc) => earlier ? getDefined(mapRootChangePositionBackward(earlier, position, assoc)) : position;
14098
- let position = 0;
14099
- for (let pair = 0; pair < change.sections.length; pair += 2) {
14100
- const length = change.sections[pair];
14101
- if (change.sections[pair + 1] !== -1) {
14102
- from = Math.min(from, back(position, -1));
14103
- to = Math.max(to, back(position + length, 1));
14104
- }
14105
- position += length;
14106
- }
14107
- earlier = earlier ? earlier.compose(change) : change;
14207
+ for (const { back, inserted, length, position } of framedSections(changes)) if (inserted !== -1) {
14208
+ from = Math.min(from, back(position, -1));
14209
+ to = Math.max(to, back(position + length, 1));
14108
14210
  }
14109
14211
  return from <= to ? {
14110
14212
  from,
@@ -14468,10 +14570,21 @@ const recordSteps = (input, reading) => {
14468
14570
  for (const root of map.roots) {
14469
14571
  const fold = foldOf(root);
14470
14572
  const toStored = (position, assoc) => getDefined(map.toStored(root, position, assoc));
14573
+ const toProjected = (position, association = "forward") => getDefined(map.toProjected(root, position, association));
14574
+ const storedIndex = fold.index;
14471
14575
  const caretAt = input.selectionBefore?.root === root ? input.selectionBefore.position : null;
14472
- const far = caretAt === null ? null : farEdge((position) => getDefined(map.toProjected(root, position, "forward")), toStored, fold.index, caretAt);
14473
- const stretch = changedStretch(stepChanges.flatMap(({ changes }) => changes.flatMap(([changed, change]) => changed === root ? [change] : [])));
14576
+ const far = caretAt === null ? null : farEdge(toProjected, toStored, storedIndex, caretAt);
14577
+ const rootChanges = stepChanges.flatMap(({ changes }) => changes.flatMap(([changed, change]) => changed === root ? [change] : []));
14578
+ const stretch = changedStretch(rootChanges);
14474
14579
  const frame = getDefined(indexes.get(root));
14580
+ let caretRunEmptied;
14581
+ const emptiesCaretRun = (at) => {
14582
+ if (caretRunEmptied === void 0) {
14583
+ const line = lineHolding(storedIndex, at, input.isInline);
14584
+ caretRunEmptied = line !== void 0 && emptiesRunThatShowed(rootChanges, toProjected, storedIndex, inlineRunAt(storedIndex, line, at, input.isInline), input.isInline);
14585
+ }
14586
+ return caretRunEmptied;
14587
+ };
14475
14588
  fold.frameIndex = frame;
14476
14589
  fold.breaks = stretch ? map.breaks(root, lineHolding(frame, stretch.from, input.isInline)?.contentFrom ?? stretch.from, lineHolding(frame, stretch.to, input.isInline)?.contentTo ?? stretch.to) : [];
14477
14590
  fold.map = (position, assoc, caret) => {
@@ -14480,7 +14593,7 @@ const recordSteps = (input, reading) => {
14480
14593
  if (caret === false) return before;
14481
14594
  const other = toStored(position, assoc < 0 ? 1 : -1);
14482
14595
  if (map.added(root, position)) return other;
14483
- return caretAt !== null && before !== caretAt && other === caretAt ? caretAt : before;
14596
+ return caretAt !== null && before !== caretAt && other === caretAt && !(caret === true && emptiesCaretRun(caretAt)) ? caretAt : before;
14484
14597
  };
14485
14598
  }
14486
14599
  }
@@ -16448,18 +16561,26 @@ var RootRecorder = class {
16448
16561
  }
16449
16562
  mapPosition(recorded, position, assoc, caret, atContent) {
16450
16563
  let removed = null;
16564
+ let endKept = null;
16451
16565
  const startsInserted = atContent && assoc === 1 && this.pieces.some((piece) => piece.kind === "inserted" && piece.afterFrom === position && piece.afterTo > position);
16452
16566
  for (const piece of this.pieces) if (!startsInserted && piece.kind === "removed" && (piece.after === position || caret && this.besideRemoval(piece, position))) removed = piece;
16453
16567
  const replacing = removed && !caret && assoc === 1 ? this.insertionStartingAt(position) : void 0;
16454
16568
  if (replacing) return (recorded.mapPos(replacing.at, -1) ?? position) + (replacing.offsets[0] ?? 0);
16569
+ const throughKept = (piece) => recorded.mapPos(piece.beforeFrom + position - piece.afterFrom, assoc) ?? position;
16455
16570
  for (const piece of this.pieces) {
16456
16571
  if (piece.kind === "removed") continue;
16457
16572
  if (position < piece.afterFrom || position > piece.afterTo) continue;
16458
- if (piece.kind === "shifted") return recorded.mapPos(this.options.plainToReview(piece.plainFrom + position - piece.afterFrom, assoc, caret), assoc) ?? position;
16573
+ if (piece.kind === "shifted") {
16574
+ if (removed) break;
16575
+ return recorded.mapPos(this.options.plainToReview(piece.plainFrom + position - piece.afterFrom, assoc, caret), assoc) ?? position;
16576
+ }
16459
16577
  if (piece.kind === "kept") {
16460
16578
  if (removed) break;
16461
- if (position === piece.afterTo && assoc === 1 && piece.afterTo > piece.afterFrom) continue;
16462
- return recorded.mapPos(piece.beforeFrom + position - piece.afterFrom, assoc) ?? position;
16579
+ if (position === piece.afterTo && assoc === 1 && piece.afterTo > piece.afterFrom) {
16580
+ endKept = piece;
16581
+ continue;
16582
+ }
16583
+ return throughKept(piece);
16463
16584
  }
16464
16585
  return (recorded.mapPos(piece.at, -1) ?? position) + (piece.offsets[position - piece.afterFrom] ?? 0);
16465
16586
  }
@@ -16469,6 +16590,7 @@ var RootRecorder = class {
16469
16590
  if (!caret) return recorded.mapPos(edge, right ? 1 : -1) ?? position;
16470
16591
  return recorded.mapPos(...this.caretLanding(removed, right)) ?? position;
16471
16592
  }
16593
+ if (endKept) return throughKept(endKept);
16472
16594
  return position;
16473
16595
  }
16474
16596
  caretLanding(removed, right) {
@@ -17935,8 +18057,8 @@ const createAuthoredPlugin = (options) => {
17935
18057
  },
17936
18058
  readStored: storedRead,
17937
18059
  readView: (view, read) => {
17938
- const preview = previewModeOf(view);
17939
- if (!preview) return read();
18060
+ const preview = isDocumentViewReading(owner) ? null : previewModeOf(view);
18061
+ if (!preview) return withEditorDocumentProjection(owner, void 0, read);
17940
18062
  const stored = storedValue(owner);
17941
18063
  const root = withEditorDocumentProjection(owner, void 0, () => getCurrentSelectionRoot(owner));
17942
18064
  return withEditorDocumentProjection(owner, ledger.preview(stored, preview), read, {
@@ -1,4 +1,4 @@
1
- import { tu as definePluginPoint } from "./plugin-DWzkJbnJ.js";
1
+ import { mu as definePluginPoint } from "./plugin-BvM4s-Lr.js";
2
2
  //#region src/core/authored-veto.ts
3
3
  /** Contribute a reason Suggesting refuses a change that touches an element. */
4
4
  const authoredVeto = definePluginPoint("authored.veto");
@@ -1,4 +1,4 @@
1
- import { $f as cloneFrozen, Fd as DocumentIndex, Ff as snapshotEditorJsonValue, Sd as RootChange, Vd as canonicalJsonKey, Xd as isTextNode, Yd as isElementNode, Yu as DocumentChange, Zd as nodeProps, nc as lawCheckEnabled, np as jsonEqual, tp as isRecord } from "./plugin-DWzkJbnJ.js";
1
+ import { $d as isTextNode, Qd as isElementNode, Qu as DocumentChange, Rd as DocumentIndex, Rf as snapshotEditorJsonValue, Td as RootChange, Wd as canonicalJsonKey, ef as nodeProps, gp as jsonEqual, hp as isRecord, lc as lawCheckEnabled, pp as cloneFrozen } from "./plugin-BvM4s-Lr.js";
2
2
  //#region src/core/json-fingerprint.ts
3
3
  /** Deterministic fingerprint for already validated JSON-compatible data. */
4
4
  const fingerprintEditorJson = (value) => {
@@ -1,4 +1,4 @@
1
- import { Lm as DocumentChange, bf as Value, lo as EditorSchemaIdentity, nl as EditorDocumentValue } from "./index-DpltOCot.js";
1
+ import { Km as DocumentChange, Of as Value, ol as EditorDocumentValue, po as EditorSchemaIdentity } from "./index-QuqD4Dyj.js";
2
2
  //#region src/diff/lib/comparison-types.d.ts
3
3
  /** A comparison-local interval in the canonical document token coordinate. */
4
4
  type ComparisonSpan = Readonly<{
@@ -1,4 +1,4 @@
1
- import { $ as first$1, Aa as nodes, Ac as assertNoDocumentViewRead, Ao as subscribeCommit, At as last$1, B as NodeApi, Bf as defineEffect, Bn as getChildList, Bt as point, Ci as withEditorRootChildrenGenerator, Cn as applyTransactionSpecToDocument, Cr as initializeEditorSchemaDocument, Cu as getEditorRuntime, Dc as authoredDocumentCapabilityPoint, Dr as invalidateEditorTransactionSpecs, Er as initializePublicState, Et as isInline, Eu as getEditorSchema, Fr as readEditor, Gn as getCurrentSelection, Go as admitEditorDocument, Hc as hasActiveAnchors, Ji as getFragment, Jr as saveEditorSchemaDocument, Kn as getCurrentSelectionRoot, Ko as documentAdmissionPoint, Ma as node, Mo as createEditorReadApi, Mt as levels$1, No as createEditorUpdateApi, Nr as loadOpenedRecords, Ot as isStart$1, Ou as setEditorRuntime, Ps as isEmptyElement, Rt as parent$1, Sa as getWordDistances, Si as withEditorRootChildren, Ss as mapSelectionThroughChange, Tr as initializeEditorSchemaSnapshot, Tt as isEnd$1, U as after, V as above$1, Vn as getChildren$1, W as before, Wo as admitDocument, Wr as repairEditorValue, Wt as range, Xr as seedUniqueMaps, Yn as getEditorDocumentValue, _ as markEditorDormant, _u as MAIN_ROOT_KEY, aa as range$1, ar as getLiveNode, bt as isBlock$1, cl as assertPluginPublicationInactive, d as extendEditor, di as snapshotInitialDocumentState, dl as getCompiledEditorSchema, dn as voidEditor, dr as getPathByNodeKey, dt as hasInlines$1, eu as failInvariant, fa as elementReadOnly, fu as LocationApi, ga as after$1, gl as initializeBasePluginRegistry, gs as assertSelectionSupported, ha as before$1, hr as getSnapshot$1, hu as PointApi, ip as getDefined, ir as getLastCommit, j as createCommandDispatch, ja as normalizeNodeMatch, jo as subscribeSource, js as constructLoadedDocumentChange, kc as createEditorAnchorApi, kn as createTransactionSpec, ko as subscribe, kt as isVoid, ll as createPluginRegistry, lr as getNodeKey, lt as getSnapshot, ml as getPluginRegistry, mu as RangeApi, nu as point$1, or as getLiveSelection, pl as getPluginContributions, qn as getEditorChildrenRoot, qo as onlyDocumentAdmission, s as createEditorViewPluginApis, sl as setEditorLifecycleErrorSink, sr as getLiveText, ts as createEditorSchema, tt as getChildren, u as destroyEditor, ul as finalizePluginRegistry, uu as isEditorContent, v as prepareInitialPluginPublication, va as resolveShouldMergeNodesRemovePrevNode, vi as transformEditorSnapshotInput, vl as registerEffectTypeInRegistry, vu as getCommonLocationRoot, wr as initializeEditorSchemaSelection, wt as isEmpty$1, xa as getCharacterDistance, xu as PathApi, y as prepareScopedPluginPublication, yi as updateEditor, zt as path$1 } from "./plugin-DWzkJbnJ.js";
1
+ import { $ as first$1, $f as getCommonLocationRoot, $o as documentAdmissionPoint, At as last$1, B as NodeApi, Bn as getChildren$1, Bo as createEditorUpdateApi, Bt as point, Ci as withEditorRootChildren, Cl as finalizePluginRegistry, Cr as initializeEditorSchemaDocument, Cs as assertSelectionSupported, Cu as isEditorContent, Dl as getPluginRegistry, Dr as invalidateEditorTransactionSpecs, El as getPluginContributions, Er as initializePublicState, Et as isInline, Eu as getEditorRuntime, Fa as node, Fr as readEditor, Gn as getCurrentSelectionRoot, Gr as repairEditorValue, Ic as createEditorAnchorApi, Io as subscribe, Jc as assertNoDocumentViewRead, Jf as RangeApi, Ji as getFragment, Jn as getEditorDocumentValue, Kn as getEditorChildrenRoot, Lo as subscribeCommit, Mt as levels$1, Na as nodes, Nr as loadOpenedRecords, On as createTransactionSpec, Ot as isStart$1, Pa as normalizeNodeMatch, Pc as authoredDocumentCapabilityPoint, Qf as MAIN_ROOT_KEY, Qo as admitEditorDocument, Ro as subscribeSource, Rs as constructLoadedDocumentChange, Rt as parent$1, Sl as createPluginRegistry, Sn as applyTransactionSpecToDocument, Ta as getWordDistances, Tr as initializeEditorSchemaSnapshot, Tt as isEnd$1, U as after, Uf as defineEffect, V as above$1, Vs as isEmptyElement, W as before, Wn as getCurrentSelection, Wt as range, Yf as LocationApi, Yr as saveEditorSchemaDocument, Zf as PointApi, Zo as admitDocument, Zr as seedUniqueMaps, _ as markEditorDormant, ar as getLiveSelection, bi as updateEditor, bl as setEditorLifecycleErrorSink, bt as isBlock$1, ca as range$1, cr as getNodeKey, cs as createEditorSchema, d as extendEditor, dn as voidEditor, dt as hasInlines$1, el as hasActiveAnchors, es as onlyDocumentAdmission, fi as snapshotInitialDocumentState, ha as elementReadOnly, hu as point$1, ir as getLiveNode, j as createCommandDispatch, jl as registerEffectTypeInRegistry, ju as setEditorRuntime, kl as initializeBasePluginRegistry, ks as mapSelectionThroughChange, kt as isVoid, ku as getEditorSchema, lt as getSnapshot, mr as getSnapshot$1, np as PathApi, or as getLiveText, pu as failInvariant, rr as getLastCommit, s as createEditorViewPluginApis, tt as getChildren, u as destroyEditor, ur as getPathByNodeKey, v as prepareInitialPluginPublication, va as before$1, vp as getDefined, wa as getCharacterDistance, wi as withEditorRootChildrenGenerator, wl as getCompiledEditorSchema, wr as initializeEditorSchemaSelection, wt as isEmpty$1, xa as resolveShouldMergeNodesRemovePrevNode, xl as assertPluginPublicationInactive, y as prepareScopedPluginPublication, ya as after$1, yi as transformEditorSnapshotInput, zn as getChildList, zo as createEditorReadApi, zt as path$1 } from "./plugin-BvM4s-Lr.js";
2
2
  /**
3
3
  * Local, ephemeral screen-reader text emitted by an application command.
4
4
  *
@@ -1058,6 +1058,7 @@ const createEditorImplementation = (options, dormant) => {
1058
1058
  return withEditorRootChildren(editor, MAIN_ROOT_KEY, () => readEditor(editor, (state) => state.key(target)));
1059
1059
  });
1060
1060
  const update = createEditorUpdateApi((fn, policy) => updateEditor(editor, fn, { tags: policy.tags }), {
1061
+ caller: () => editor,
1061
1062
  hasTxGroup: (groupName) => getPluginRegistry(editor).txGroups.has(groupName),
1062
1063
  repairValue: () => updateEditor(editor, () => {
1063
1064
  repairEditorValue(editor);
@@ -1,5 +1,5 @@
1
- import { bf as Value, lu as EditorStateSchemaApi } from "../index-DpltOCot.js";
2
- import { a as ComparisonConflictAlternative, c as ComparisonEffect, d as ComparisonResolutionResult, f as ComparisonSnapshot, h as TwoWayComparison, i as ComparisonConflict, l as ComparisonEvidence, m as ThreeWayComparison, n as Comparison, o as ComparisonCorrespondence, p as ComparisonSpan, r as ComparisonBranch, s as ComparisonDiagnostic, t as ComparedChange, u as ComparisonResolution } from "../comparison-types-Dt-unJZY.js";
1
+ import { Of as Value, mu as EditorStateSchemaApi } from "../index-QuqD4Dyj.js";
2
+ import { a as ComparisonConflictAlternative, c as ComparisonEffect, d as ComparisonResolutionResult, f as ComparisonSnapshot, h as TwoWayComparison, i as ComparisonConflict, l as ComparisonEvidence, m as ThreeWayComparison, n as Comparison, o as ComparisonCorrespondence, p as ComparisonSpan, r as ComparisonBranch, s as ComparisonDiagnostic, t as ComparedChange, u as ComparisonResolution } from "../comparison-types-Bvvxzxq2.js";
3
3
  //#region src/diff/lib/compare.d.ts
4
4
  type TwoWayInput<V extends Value> = Readonly<{
5
5
  after: unknown;
@@ -1,5 +1,5 @@
1
- import { Yu as DocumentChange, np as jsonEqual } from "../plugin-DWzkJbnJ.js";
2
- import { _ as mergeGroups, a as comparisonTextRuns, b as uniqueSpans$1, c as COMPARISON_POLICY, d as comparisonDocumentsEqual, f as comparisonHash, g as disjointSets, h as detachComparisonEnvelope, i as comparisonTextPoint, l as COMPARISON_WORD, m as detachComparisonDocument, n as comparisonPlanOf, o as comparisonTextSpans, p as createComparisonSnapshot, r as planComparison, s as createComparisonIndex, t as closeOverRequired, u as assertComparisonActive, v as spanKey, x as yieldComparisonWork, y as stableStringify } from "../comparison-plan-CEQL0ooW.js";
1
+ import { Qu as DocumentChange, gp as jsonEqual } from "../plugin-BvM4s-Lr.js";
2
+ import { _ as mergeGroups, a as comparisonTextRuns, b as uniqueSpans$1, c as COMPARISON_POLICY, d as comparisonDocumentsEqual, f as comparisonHash, g as disjointSets, h as detachComparisonEnvelope, i as comparisonTextPoint, l as COMPARISON_WORD, m as detachComparisonDocument, n as comparisonPlanOf, o as comparisonTextSpans, p as createComparisonSnapshot, r as planComparison, s as createComparisonIndex, t as closeOverRequired, u as assertComparisonActive, v as spanKey, x as yieldComparisonWork, y as stableStringify } from "../comparison-plan-BJxnVPcS.js";
3
3
  import { DiffMatchPatch, DiffOp } from "diff-match-patch-ts";
4
4
  //#region src/diff/lib/comparison-matcher.ts
5
5
  const CANDIDATES_PER_NODE = 24;
@@ -1,2 +1,2 @@
1
- import { $ as ClipboardSliceWrite, $t as isAfter, A as DataTransferFormat, At as DOMCoverageMaterializeHandler, B as DOMApi, Bt as DOMElement, C as getEditorDOMRoot, Ct as DOMDropTargetOptions, D as DataTransferDecodeContext, Dt as DOMCoverageBoundaryEdge, E as usesAppleDOMHotkeys, Et as DOMCoverageBoundaryAnchor, F as writeDataTransferFragment, Ft as DOMCoveragePointResult, G as DOMEditorClipboardCapability, Gt as DOMStaticRange, H as DOMClipboardInsertDataHandler, Ht as DOMPoint, I as DOMEditorOptions, It as DOMCoverageReason, J as DOMVisualPointOptions, Jt as containsShadowAware, K as DOMResolutionError, Kt as DOMText, L as DOMPlugin, Lt as DOMCoverageRuntimeRange, M as DataTransferSchemaClaim, Mt as DOMCoverageMaterializeReason, N as DataTransferSnapshot, Nt as DOMCoverageMaterializeResult, O as DataTransferDiagnostic, Ot as DOMCoverageBoundaryState, P as dataTransferFormats, Pt as DOMCoveragePathRange, Q as ClipboardSliceRead, Qt as hasShadowRoot, R as DOMPluginTypes, Rt as DOMCoverageSelectionPolicy, S as TRIPLE_CLICK, St as DOMDropTargetInput, T as isGeckoDOMHost, Tt as DOMCoverageBoundary, U as DOMDragApi, Ut as DOMRange, V as DOMClipboardApi, Vt as DOMNode, W as DOMEditor, Wt as DOMSelection, X as ScrollIntoViewTarget, Xt as getDefaultView, Y as ScrollIntoViewOptions, Yt as getActiveElement, Z as isTrackedMutation, Zt as getSelection, _ as HotkeySpec, _t as DOMGeometryRect, a as isLeaf, an as isPlainTextOnlyPaste, at as writeDOMFragmentData, b as createCompiledHotkeyMatcher, bt as DOMDropEdge, c as isText, ct as StringDiff, d as DOMSelectionPoints, dt as mergeStringDiffs, en as isBefore, et as DOMFragmentDataHtml, f as readDOMSelectionRange, ft as normalizePoint, g as HotkeyPlatform, gt as verifyDiffState, h as HotkeyMatchOptions, ht as targetRange, i as isElement, in as isDOMText, it as getDOMClipboardFormatKey, j as DataTransferFormatPhase, jt as DOMCoverageMaterializeRangeRole, k as DataTransferEncodeContext, kt as DOMCoverageCopyPolicy, l as isVoid, lt as TextDiff, m as Hotkeys, mt as normalizeStringDiff, n as getNodeDataAttributeKeys, nn as isDOMNode, nt as cleanDOMClipboardContents, o as isNode, on as normalizeDOMPoint, ot as writeDOMRangeData, p as writeDOMSelection, pt as normalizeRange, q as DOMVisualPoint, qt as closestShadowAware, r as isEditor, rn as isDOMSelection, rt as domCommands, s as isString, st as Key, t as getElements, tn as isDOMElement, tt as DOMFragmentDataPayload, u as keyToDataAttribute, ut as applyStringDiff, v as KeyboardEventLike, vt as DropIndicator, w as CAN_USE_DOM, wt as DOMCoverage, x as isHotkey, xt as DOMDropTarget, y as ariaKeyShortcuts, yt as DOMDragStart, z as dom, zt as DOMCoverageSession } from "../index-BpQx2UG4.js";
1
+ import { $ as ClipboardSliceWrite, $t as isAfter, A as DataTransferFormat, At as DOMCoverageMaterializeHandler, B as DOMApi, Bt as DOMElement, C as getEditorDOMRoot, Ct as DOMDropTargetOptions, D as DataTransferDecodeContext, Dt as DOMCoverageBoundaryEdge, E as usesAppleDOMHotkeys, Et as DOMCoverageBoundaryAnchor, F as writeDataTransferFragment, Ft as DOMCoveragePointResult, G as DOMEditorClipboardCapability, Gt as DOMStaticRange, H as DOMClipboardInsertDataHandler, Ht as DOMPoint, I as DOMEditorOptions, It as DOMCoverageReason, J as DOMVisualPointOptions, Jt as containsShadowAware, K as DOMResolutionError, Kt as DOMText, L as DOMPlugin, Lt as DOMCoverageRuntimeRange, M as DataTransferSchemaClaim, Mt as DOMCoverageMaterializeReason, N as DataTransferSnapshot, Nt as DOMCoverageMaterializeResult, O as DataTransferDiagnostic, Ot as DOMCoverageBoundaryState, P as dataTransferFormats, Pt as DOMCoveragePathRange, Q as ClipboardSliceRead, Qt as hasShadowRoot, R as DOMPluginTypes, Rt as DOMCoverageSelectionPolicy, S as TRIPLE_CLICK, St as DOMDropTargetInput, T as isGeckoDOMHost, Tt as DOMCoverageBoundary, U as DOMDragApi, Ut as DOMRange, V as DOMClipboardApi, Vt as DOMNode, W as DOMEditor, Wt as DOMSelection, X as ScrollIntoViewTarget, Xt as getDefaultView, Y as ScrollIntoViewOptions, Yt as getActiveElement, Z as isTrackedMutation, Zt as getSelection, _ as HotkeySpec, _t as DOMGeometryRect, a as isLeaf, an as isPlainTextOnlyPaste, at as writeDOMFragmentData, b as createCompiledHotkeyMatcher, bt as DOMDropEdge, c as isText, ct as StringDiff, d as DOMSelectionPoints, dt as mergeStringDiffs, en as isBefore, et as DOMFragmentDataHtml, f as readDOMSelectionRange, ft as normalizePoint, g as HotkeyPlatform, gt as verifyDiffState, h as HotkeyMatchOptions, ht as targetRange, i as isElement, in as isDOMText, it as getDOMClipboardFormatKey, j as DataTransferFormatPhase, jt as DOMCoverageMaterializeRangeRole, k as DataTransferEncodeContext, kt as DOMCoverageCopyPolicy, l as isVoid, lt as TextDiff, m as Hotkeys, mt as normalizeStringDiff, n as getNodeDataAttributeKeys, nn as isDOMNode, nt as cleanDOMClipboardContents, o as isNode, on as normalizeDOMPoint, ot as writeDOMRangeData, p as writeDOMSelection, pt as normalizeRange, q as DOMVisualPoint, qt as closestShadowAware, r as isEditor, rn as isDOMSelection, rt as domCommands, s as isString, st as Key, t as getElements, tn as isDOMElement, tt as DOMFragmentDataPayload, u as keyToDataAttribute, ut as applyStringDiff, v as KeyboardEventLike, vt as DropIndicator, w as CAN_USE_DOM, wt as DOMCoverage, x as isHotkey, xt as DOMDropTarget, y as ariaKeyShortcuts, yt as DOMDragStart, z as dom, zt as DOMCoverageSession } from "../index-DaXz-4c7.js";
2
2
  export { CAN_USE_DOM, type ClipboardSliceRead, type ClipboardSliceWrite, type DOMApi, type DOMClipboardApi, type DOMClipboardInsertDataHandler, DOMCoverage, type DOMCoverageBoundary, type DOMCoverageBoundaryAnchor, type DOMCoverageBoundaryEdge, type DOMCoverageBoundaryState, type DOMCoverageCopyPolicy, type DOMCoverageMaterializeHandler, type DOMCoverageMaterializeRangeRole, type DOMCoverageMaterializeReason, type DOMCoverageMaterializeResult, type DOMCoveragePathRange, type DOMCoveragePointResult, type DOMCoverageReason, type DOMCoverageRuntimeRange, type DOMCoverageSelectionPolicy, type DOMCoverageSession, type DOMDragApi, type DOMDragStart, type DOMDropEdge, type DOMDropTarget, type DOMDropTargetInput, type DOMDropTargetOptions, DOMEditor, type DOMEditorClipboardCapability, type DOMEditorOptions, type DOMElement, type DOMFragmentDataHtml, type DOMFragmentDataPayload, type DOMGeometryRect, type DOMNode, type DOMPlugin, type DOMPluginTypes, type DOMPoint, type DOMRange, DOMResolutionError, type DOMSelection, type DOMSelectionPoints, type DOMStaticRange, type DOMText, type DOMVisualPoint, type DOMVisualPointOptions, type DataTransferDecodeContext, type DataTransferDiagnostic, type DataTransferEncodeContext, type DataTransferFormat, type DataTransferFormatPhase, type DataTransferSchemaClaim, type DataTransferSnapshot, type DropIndicator, type HotkeyMatchOptions, type HotkeyPlatform, type HotkeySpec, Hotkeys, Key, type KeyboardEventLike, type ScrollIntoViewOptions, type ScrollIntoViewTarget, type StringDiff, TRIPLE_CLICK, type TextDiff, applyStringDiff, ariaKeyShortcuts, cleanDOMClipboardContents, closestShadowAware, containsShadowAware, createCompiledHotkeyMatcher, dataTransferFormats, dom, domCommands, getActiveElement, getDOMClipboardFormatKey, getDefaultView, getEditorDOMRoot, getElements, getNodeDataAttributeKeys, getSelection, hasShadowRoot, isAfter, isBefore, isDOMElement, isDOMNode, isDOMSelection, isDOMText, isEditor, isElement, isGeckoDOMHost, isHotkey, isLeaf, isNode, isPlainTextOnlyPaste, isString, isText, isTrackedMutation, isVoid, keyToDataAttribute, mergeStringDiffs, normalizeDOMPoint, normalizePoint, normalizeRange, normalizeStringDiff, readDOMSelectionRange, targetRange, usesAppleDOMHotkeys, verifyDiffState, writeDOMFragmentData, writeDOMRangeData, writeDOMSelection, writeDataTransferFragment };
package/dist/dom/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { C as normalizeRange, Cr as isDOMElement, D as DOMEditor, Dr as isPlainTextOnlyPaste, E as verifyDiffState, Er as isDOMText, Hn as DOMCoverage, Ht as getEditorDOMRoot, O as DOMResolutionError, P as isTrackedMutation, S as normalizePoint, Sr as isBefore, St as dataTransferFormats, T as targetRange, Tr as isDOMSelection, Tt as Key, _ as TRIPLE_CLICK, _r as getDefaultView, _t as domCommands, a as isLeaf, an as writeDOMSelection, br as hasShadowRoot, bt as writeDOMFragmentData, c as isText, cn as CAN_USE_DOM, d as Hotkeys, en as readDOMSelectionRange, g as isHotkey, gn as usesAppleDOMHotkeys, gr as getActiveElement, gt as cleanDOMClipboardContents, h as createCompiledHotkeyMatcher, hr as containsShadowAware, i as isElement, kr as normalizeDOMPoint, l as isVoid, m as ariaKeyShortcuts, mr as closestShadowAware, n as getNodeDataAttributeKeys, o as isNode, pn as isGeckoDOMHost, r as isEditor, s as isString, t as getElements, u as keyToDataAttribute, v as dom, vt as getDOMClipboardFormatKey, w as normalizeStringDiff, wr as isDOMNode, wt as writeDataTransferFragment, x as mergeStringDiffs, xr as isAfter, xt as writeDOMRangeData, y as applyStringDiff, yr as getSelection } from "../dom-Cgfscvnm.js";
1
+ import { Ar as isDOMSelection, C as normalizeRange, Ct as writeDOMFragmentData, D as DOMEditor, Dr as isBefore, Dt as writeDataTransferFragment, E as verifyDiffState, Er as isAfter, I as isTrackedMutation, Kt as getEditorDOMRoot, Mr as isPlainTextOnlyPaste, O as DOMResolutionError, Or as isDOMElement, Ot as Key, Pr as normalizeDOMPoint, S as normalizePoint, Sr as getDefaultView, T as targetRange, Tr as hasShadowRoot, Tt as dataTransferFormats, _ as TRIPLE_CLICK, a as isLeaf, an as readDOMSelectionRange, br as containsShadowAware, bt as domCommands, c as isText, d as Hotkeys, g as isHotkey, h as createCompiledHotkeyMatcher, i as isElement, jr as isDOMText, kr as isDOMNode, l as isVoid, m as ariaKeyShortcuts, n as getNodeDataAttributeKeys, o as isNode, pn as CAN_USE_DOM, qn as DOMCoverage, r as isEditor, s as isString, t as getElements, u as keyToDataAttribute, un as writeDOMSelection, v as dom, vn as isGeckoDOMHost, w as normalizeStringDiff, wr as getSelection, wt as writeDOMRangeData, x as mergeStringDiffs, xn as usesAppleDOMHotkeys, xr as getActiveElement, xt as getDOMClipboardFormatKey, y as applyStringDiff, yr as closestShadowAware, yt as cleanDOMClipboardContents } from "../dom-BjspML2h.js";
2
2
  export { CAN_USE_DOM, DOMCoverage, DOMEditor, DOMResolutionError, Hotkeys, Key, TRIPLE_CLICK, applyStringDiff, ariaKeyShortcuts, cleanDOMClipboardContents, closestShadowAware, containsShadowAware, createCompiledHotkeyMatcher, dataTransferFormats, dom, domCommands, getActiveElement, getDOMClipboardFormatKey, getDefaultView, getEditorDOMRoot, getElements, getNodeDataAttributeKeys, getSelection, hasShadowRoot, isAfter, isBefore, isDOMElement, isDOMNode, isDOMSelection, isDOMText, isEditor, isElement, isGeckoDOMHost, isHotkey, isLeaf, isNode, isPlainTextOnlyPaste, isString, isText, isTrackedMutation, isVoid, keyToDataAttribute, mergeStringDiffs, normalizeDOMPoint, normalizePoint, normalizeRange, normalizeStringDiff, readDOMSelectionRange, targetRange, usesAppleDOMHotkeys, verifyDiffState, writeDOMFragmentData, writeDOMRangeData, writeDOMSelection, writeDataTransferFragment };