@stll/folio-vue 0.23.0 → 0.25.0

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 (116) hide show
  1. package/README.md +24 -0
  2. package/dist/ListButtons-B8HxA64I.cjs +4 -0
  3. package/dist/{ListButtons-DjLPhg8p.js → ListButtons-BeELtp_-.js} +201 -188
  4. package/dist/{SplitCellDialog-Id6nLwrR.js → SplitCellDialog-CSqbtDum.js} +748 -732
  5. package/dist/SplitCellDialog-DzKBu09z.cjs +15 -0
  6. package/dist/components/AnonymizationRectsOverlay.vue.d.ts +20 -0
  7. package/dist/components/AutocompleteCaretOverlay.vue.d.ts +4 -0
  8. package/dist/components/AutocompleteSuggestionOverlay.vue.d.ts +11 -0
  9. package/dist/components/CommentMarginMarkers.vue.d.ts +16 -0
  10. package/dist/components/ContentControlWidgetsOverlay.vue.d.ts +8 -0
  11. package/dist/components/DecorationLayer.vue.d.ts +12 -0
  12. package/dist/components/DocumentName.vue.d.ts +13 -0
  13. package/dist/components/DocumentOutline.vue.d.ts +28 -0
  14. package/dist/components/DocxEditor/DocxEditorDialogs.vue.d.ts +73 -0
  15. package/dist/components/DocxEditor/DocxEditorMenuBar.vue.d.ts +39 -0
  16. package/dist/components/DocxEditor/DocxEditorOverlays.vue.d.ts +42 -0
  17. package/dist/components/DocxEditor/types.d.ts +11 -4
  18. package/dist/components/DocxEditor.vue.d.ts +58 -0
  19. package/dist/components/EditingModeDropdown.vue.d.ts +11 -0
  20. package/dist/components/EditorToolbar.vue.d.ts +30 -0
  21. package/dist/components/FormattingBar.vue.d.ts +20 -0
  22. package/dist/components/HeaderFooterSelectionOverlay.vue.d.ts +12 -0
  23. package/dist/components/ImageContextMenu.vue.d.ts +24 -0
  24. package/dist/components/ImageSelectionOverlay.vue.d.ts +21 -0
  25. package/dist/components/InlineHeaderFooterEditor.vue.d.ts +15 -0
  26. package/dist/components/MenuBar.vue.d.ts +18 -0
  27. package/dist/components/PageIndicator.vue.d.ts +8 -0
  28. package/dist/components/PassageHighlightOverlay.vue.d.ts +16 -0
  29. package/dist/components/PrintButton.vue.d.ts +16 -0
  30. package/dist/components/ReviewControls.vue.d.ts +17 -0
  31. package/dist/components/TemplateDirectivesOverlay.vue.d.ts +15 -0
  32. package/dist/components/TextContextMenu.vue.d.ts +46 -0
  33. package/dist/components/TitleBar.vue.d.ts +17 -0
  34. package/dist/components/Toolbar.vue.d.ts +139 -0
  35. package/dist/components/UnifiedSidebar.vue.d.ts +55 -0
  36. package/dist/components/dialogs/FindReplaceDialog.vue.d.ts +20 -0
  37. package/dist/components/dialogs/FootnotePropertiesDialog.vue.d.ts +15 -0
  38. package/dist/components/dialogs/HyperlinkDialog.vue.d.ts +30 -0
  39. package/dist/components/dialogs/ImagePositionDialog.vue.d.ts +29 -0
  40. package/dist/components/dialogs/ImagePropertiesDialog.vue.d.ts +13 -0
  41. package/dist/components/dialogs/InsertImageDialog.vue.d.ts +21 -0
  42. package/dist/components/dialogs/InsertSymbolDialog.vue.d.ts +12 -0
  43. package/dist/components/dialogs/InsertTableDialog.vue.d.ts +22 -0
  44. package/dist/components/dialogs/PageSetupDialog.vue.d.ts +14 -0
  45. package/dist/components/dialogs/PasteSpecialDialog.vue.d.ts +16 -0
  46. package/dist/components/dialogs/SetNumberingValueDialog.vue.d.ts +12 -0
  47. package/dist/components/dialogs/SplitCellDialog.vue.d.ts +22 -0
  48. package/dist/components/dialogs/TablePropertiesDialog.vue.d.ts +15 -0
  49. package/dist/components/dialogs/WatermarkDialog.vue.d.ts +14 -0
  50. package/dist/components/dialogs/index.d.ts +13 -13
  51. package/dist/components/sidebar/AddCommentCard.vue.d.ts +9 -0
  52. package/dist/components/sidebar/Avatar.vue.d.ts +10 -0
  53. package/dist/components/sidebar/CommentCard.vue.d.ts +21 -0
  54. package/dist/components/sidebar/ReplyInput.vue.d.ts +7 -0
  55. package/dist/components/sidebar/ReplyThread.vue.d.ts +8 -0
  56. package/dist/components/sidebar/ResolvedCommentMarker.vue.d.ts +11 -0
  57. package/dist/components/sidebar/TrackedChangeCard.vue.d.ts +20 -0
  58. package/dist/components/ui/AlignmentButtons.vue.d.ts +15 -0
  59. package/dist/components/ui/Button.vue.d.ts +30 -0
  60. package/dist/components/ui/Checkbox.vue.d.ts +11 -0
  61. package/dist/components/ui/ColorPicker.vue.d.ts +30 -0
  62. package/dist/components/ui/DatePickerPopover.vue.d.ts +13 -0
  63. package/dist/components/ui/Dialog.vue.d.ts +28 -0
  64. package/dist/components/ui/FontPicker.vue.d.ts +21 -0
  65. package/dist/components/ui/FontSizePicker.vue.d.ts +27 -0
  66. package/dist/components/ui/HorizontalRuler.vue.d.ts +39 -0
  67. package/dist/components/ui/HyperlinkPopup.vue.d.ts +21 -0
  68. package/dist/components/ui/IconGridDropdown.vue.d.ts +32 -0
  69. package/dist/components/ui/ImageTransformDropdown.vue.d.ts +11 -0
  70. package/dist/components/ui/ImageWrapDropdown.vue.d.ts +15 -0
  71. package/dist/components/ui/Input.vue.d.ts +17 -0
  72. package/dist/components/ui/LineSpacingPicker.vue.d.ts +20 -0
  73. package/dist/components/ui/ListButtons.vue.d.ts +30 -0
  74. package/dist/components/ui/MaterialSymbol.vue.d.ts +13 -0
  75. package/dist/components/ui/MenuDropdown.vue.d.ts +42 -0
  76. package/dist/components/ui/OutlineRail.vue.d.ts +19 -0
  77. package/dist/components/ui/Popover.vue.d.ts +40 -0
  78. package/dist/components/ui/Select.vue.d.ts +15 -0
  79. package/dist/components/ui/StylePicker.vue.d.ts +16 -0
  80. package/dist/components/ui/TableBorderColorPicker.vue.d.ts +14 -0
  81. package/dist/components/ui/TableBorderPicker.vue.d.ts +11 -0
  82. package/dist/components/ui/TableBorderWidthPicker.vue.d.ts +10 -0
  83. package/dist/components/ui/TableCellFillPicker.vue.d.ts +14 -0
  84. package/dist/components/ui/TableGridInline.vue.d.ts +14 -0
  85. package/dist/components/ui/TableGridPicker.vue.d.ts +18 -0
  86. package/dist/components/ui/TableMoreDropdown.vue.d.ts +51 -0
  87. package/dist/components/ui/TableStyleGallery.vue.d.ts +10 -0
  88. package/dist/components/ui/TableToolbar.vue.d.ts +61 -0
  89. package/dist/components/ui/VerticalRuler.vue.d.ts +20 -0
  90. package/dist/components/ui/ZoomControl.vue.d.ts +12 -0
  91. package/dist/components/ui/icon-paths.json.d.ts +276 -0
  92. package/dist/composables/useDocxEditor.d.ts +3 -0
  93. package/dist/composables/useDocxEditorRefApi.d.ts +3 -0
  94. package/dist/composables/useFindReplace.d.ts +5 -1
  95. package/dist/composables/useFontLifecycle.d.ts +1 -0
  96. package/dist/composables.cjs +2 -2
  97. package/dist/composables.js +45 -44
  98. package/dist/dialogs.cjs +1 -1
  99. package/dist/dialogs.js +2 -5
  100. package/dist/folio-vue.css +1 -156
  101. package/dist/index.cjs +1 -1
  102. package/dist/index.d.ts +2 -0
  103. package/dist/index.js +1456 -1409
  104. package/dist/ui.cjs +1 -1
  105. package/dist/ui.js +2 -2
  106. package/dist/useFindReplace-BbW0xWo7.js +74 -0
  107. package/dist/useFindReplace-neQmDh2i.cjs +1 -0
  108. package/dist/useZoom-B1miNAf_.cjs +1 -0
  109. package/dist/{useZoom-D8Wi1XkB.js → useZoom-Bw5gp69V.js} +262 -252
  110. package/dist/utils/embeddedFonts.d.ts +1 -1
  111. package/package.json +22 -10
  112. package/dist/ListButtons-DIWR-Q8d.cjs +0 -4
  113. package/dist/SplitCellDialog-B_z6ynxm.cjs +0 -15
  114. package/dist/useFindReplace-CL8Rbc3y.js +0 -59
  115. package/dist/useFindReplace-ZCrdvwEk.cjs +0 -1
  116. package/dist/useZoom-CkbPWZ64.cjs +0 -1
@@ -34,45 +34,45 @@ import { createStarterKit as We } from "@stll/folio-core/prosemirror/extensions/
34
34
  import { createTemplatePreviewValuesPlugin as Ge } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
35
35
  import { templateSlashMenuPlugin as Ke } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
36
36
  import { resolveHeaderFooterContent as qe } from "@stll/folio-core/utils/headerFooter";
37
- import { MIN_CELL_WIDTH_TWIPS as v, MIN_ROW_HEIGHT_TWIPS as y, TWIPS_PER_PIXEL as b, commitColumnResize as Je, commitRightEdgeResize as Ye, commitRowResize as x, readColumnWidthAt as Xe, readColumnWidths as Ze, readRowHeight as Qe } from "@stll/folio-core/prosemirror/tableResize";
38
- import { extractTrackedChanges as $e } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
39
- import { ZOOM_MAX as et, ZOOM_MIN as S, ZOOM_STEP as C } from "@stll/folio-core/utils/zoom";
37
+ import { MIN_CELL_WIDTH_TWIPS as v, MIN_ROW_HEIGHT_TWIPS as Je, TWIPS_PER_PIXEL as y, commitColumnResize as Ye, commitRightEdgeResize as Xe, commitRowResize as Ze, readColumnWidthAt as b, readColumnWidths as Qe, readRowHeight as $e } from "@stll/folio-core/prosemirror/tableResize";
38
+ import { extractTrackedChanges as et } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
39
+ import { ZOOM_MAX as tt, ZOOM_MIN as nt, ZOOM_STEP as x } from "@stll/folio-core/utils/zoom";
40
40
  //#region src/utils/colorMode.ts
41
- var tt = "(prefers-color-scheme: dark)";
42
- function nt() {
41
+ var S = "(prefers-color-scheme: dark)";
42
+ function rt() {
43
43
  return typeof window < "u" && typeof window.matchMedia == "function";
44
44
  }
45
- function rt(e, t) {
45
+ function it(e, t) {
46
46
  return e === "dark" || e === "system" && t;
47
47
  }
48
- function it(e) {
49
- if (!nt()) return () => {};
50
- let t = window.matchMedia(tt);
48
+ function at(e) {
49
+ if (!rt()) return () => {};
50
+ let t = window.matchMedia(S);
51
51
  e(t.matches);
52
52
  let n = (t) => e(t.matches);
53
53
  return t.addEventListener("change", n), () => t.removeEventListener("change", n);
54
54
  }
55
55
  //#endregion
56
56
  //#region src/composables/useColorMode.ts
57
- var w = "light", T = Symbol("folioColorMode"), at = (t = w) => {
58
- a(T, e(() => c(t)));
59
- }, ot = { install(t, n = w) {
60
- t.provide(T, e(() => c(n)));
57
+ var C = "light", ot = Symbol("folioColorMode"), st = (t = C) => {
58
+ a(ot, e(() => c(t)));
59
+ }, w = { install(t, n = C) {
60
+ t.provide(ot, e(() => c(n)));
61
61
  } };
62
- function E() {
63
- let n = t(T, e(() => w)), i = o(!1), a = o(!1);
62
+ function ct() {
63
+ let n = t(ot, e(() => C)), i = o(!1), a = o(!1);
64
64
  return r(() => {
65
65
  i.value = !0;
66
66
  }), u((e) => {
67
- !i.value || n.value !== "system" || e(it((e) => {
67
+ !i.value || n.value !== "system" || e(at((e) => {
68
68
  a.value = e;
69
69
  }));
70
- }), e(() => rt(n.value, i.value && a.value));
70
+ }), e(() => it(n.value, i.value && a.value));
71
71
  }
72
72
  //#endregion
73
73
  //#region src/composables/useDocxEditor.ts
74
- var st = 24, ct = "User", lt = 250, ut = [], dt = [];
75
- function ft(e) {
74
+ var lt = 24, ut = "User", dt = 250, ft = [], pt = [];
75
+ function mt(e) {
76
76
  let t = e?.columnCount ?? 1;
77
77
  if (t <= 1) return;
78
78
  let n = {
@@ -82,7 +82,7 @@ function ft(e) {
82
82
  };
83
83
  return e?.separator !== void 0 && (n.separator = e.separator), n;
84
84
  }
85
- function pt(e, t, n, r, i, a) {
85
+ function ht(e, t, n, r, i, a) {
86
86
  if (!e) return;
87
87
  let o = t ? {
88
88
  ...a,
@@ -90,16 +90,16 @@ function pt(e, t, n, r, i, a) {
90
90
  } : a, s = t ? n?.getView(t) : null;
91
91
  return s ? je(s.state.doc, r, i, o) : Me(e, r, i, o);
92
92
  }
93
- function mt(e, t, n, r, i) {
93
+ function gt(e, t, n, r, i) {
94
94
  if (!e || e.size === 0) return;
95
95
  let a = /* @__PURE__ */ new Map();
96
96
  for (let [o, s] of e) {
97
- let e = pt(s, o, t, n, r, i);
97
+ let e = ht(s, o, t, n, r, i);
98
98
  e && a.set(o, e);
99
99
  }
100
100
  return a.size > 0 ? a : void 0;
101
101
  }
102
- function ht(e, t, n) {
102
+ function _t(e, t, n) {
103
103
  let r = /* @__PURE__ */ new Map();
104
104
  if (!n || !n.package.footnotes) return r;
105
105
  let i = /* @__PURE__ */ new Map();
@@ -125,7 +125,7 @@ function ht(e, t, n) {
125
125
  }
126
126
  return r;
127
127
  }
128
- var D = /* @__PURE__ */ new Set([
128
+ var T = /* @__PURE__ */ new Set([
129
129
  "black",
130
130
  "blue",
131
131
  "cyan",
@@ -144,112 +144,113 @@ var D = /* @__PURE__ */ new Set([
144
144
  "white",
145
145
  "yellow"
146
146
  ]);
147
- function gt(e) {
147
+ function vt(e) {
148
148
  let t = [], n = (e, r) => {
149
- for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !D.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
149
+ for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !T.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
150
150
  e.forEach((e, t, i) => {
151
151
  n(e, `${r}.content[${i}]`);
152
152
  });
153
153
  };
154
154
  return n(e, "doc"), t.join("; ");
155
155
  }
156
- function O(e) {
157
- let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, experimentalSession: _, pageGap: se = st, pageRenderer: ce, markupView: me = "all-markup", showMarginGuides: je, marginGuideColor: Me, password: v, editorMode: y, author: b, externalPlugins: Je = [], historyShortcuts: Ye = "editor", collaboration: x, onAnonymizationMatchesChange: Xe, showTemplateDirectives: Ze, onSlashMenuChange: Qe, onSlashMenuKeyAction: $e, onChange: et, onError: S, onSelectionUpdate: C, onEditorViewReady: tt, onCopy: nt, onCut: rt, onPaste: it, onReadOnlyEditAttempt: w, featureFlags: T, onSelectiveSaveTripwire: at } = e, ot = n ?? t, E = () => c(b) ?? ct, D = s(null), O = 0, _t = !1, k = 0, A = !1, j = s(null), M = s(null), N = s(null), P = s([]), F = s(null), I = s(null), L = s(null), vt = s([]), yt = s([]), R = o(!1), z = o(null), B = o(!1), V = () => ee(c(_), d.authorityRouting), H = (e) => V() ? ie(e) : e, bt = (e, t) => {
156
+ function E(e) {
157
+ let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, experimentalSession: _, pageGap: se = lt, pageRenderer: ce, markupView: me = "all-markup", showCommentHighlights: je = !0, showMarginGuides: Me, marginGuideColor: v, password: Je, editorMode: y, author: Ye, externalPlugins: Xe = [], historyShortcuts: Ze = "editor", collaboration: b, onAnonymizationMatchesChange: Qe, showTemplateDirectives: $e, onSlashMenuChange: et, onSlashMenuKeyAction: tt, onChange: nt, onError: x, onSelectionUpdate: S, onEditorViewReady: rt, onCopy: it, onCut: at, onPaste: C, onReadOnlyEditAttempt: ot, featureFlags: st, onSelectiveSaveTripwire: w } = e, ct = n ?? t, T = () => c(Ye) ?? ut, E = s(null), D = 0, O = !1, k = 0, A = !1, j = s(null), M = s(null), N = s(null), P = s([]), F = s(null), I = s(null), L = s(null), yt = s([]), bt = s([]), R = o(!1), z = o(null), B = o(!1), V = () => ee(c(_), d.authorityRouting), H = (e) => V() ? ie(e) : e, xt = (e, t) => {
158
158
  if (!V()) return !1;
159
159
  let n = new g({
160
160
  gap: e,
161
161
  message: f(e, t)
162
162
  });
163
- return S?.(n), !0;
164
- }, U = new ze(We({ historyShortcuts: Ye }));
163
+ return x?.(n), !0;
164
+ }, U = new ze(We({ historyShortcuts: Ze }));
165
165
  U.buildSchema(), U.initializeRuntime();
166
- let xt = fe(!1), St = [xt], Ct = ue({ keymap: !0 }), wt = le({ onMatchesChange: (e) => Xe?.(e) }), Tt = de(), Et = Ke({
167
- onChange: (e) => Qe?.(e),
168
- onKeyAction: (e) => $e?.(e) ?? !1
169
- }), Dt = Ge(), Ot = () => c(Ze) === !0;
170
- function kt() {
166
+ let St = fe(!1), Ct = [St], wt = ue({ keymap: !0 }), Tt = le({ onMatchesChange: (e) => Qe?.(e) }), Et = de(), Dt = Ke({
167
+ onChange: (e) => et?.(e),
168
+ onKeyAction: (e) => tt?.(e) ?? !1
169
+ }), Ot = Ge(), kt = () => c($e) === !0;
170
+ function At() {
171
171
  return [
172
- Ct,
173
- xt,
174
- ...Je,
175
- ...c(x)?.plugins ?? [],
176
172
  wt,
177
- ...Ot() ? [Tt, Et] : [],
178
- Dt
173
+ St,
174
+ ...Xe,
175
+ ...c(b)?.plugins ?? [],
176
+ Tt,
177
+ ...kt() ? [Et, Dt] : [],
178
+ Ot
179
179
  ];
180
180
  }
181
- let W = _e(), G = new Fe(), At = ke(), jt = Te({
181
+ let W = _e(), G = new Fe(), K = ke(), jt = Te({
182
182
  relayout: () => {
183
- let e = j.value?.state ?? At.lastEditorState;
184
- e && Y(e, { reason: "hyphenation-ready" });
183
+ let e = j.value?.state ?? K.lastEditorState;
184
+ e && X(e, { reason: "hyphenation-ready" });
185
185
  },
186
- onError: (e) => S?.(e)
186
+ onError: (e) => x?.(e)
187
187
  });
188
188
  i(jt.cancel), i(Oe({
189
- measuredFontSet: () => At.lastMeasureInputs?.fontSet ?? null,
189
+ measuredFontSet: () => K.lastMeasureInputs?.fontSet ?? null,
190
190
  relayout: () => {
191
191
  if (A) return;
192
- let e = j.value?.state ?? At.lastEditorState;
193
- e && Y(e, { reason: "font-ready" });
192
+ let e = j.value?.state ?? K.lastEditorState;
193
+ e && X(e, { reason: "font-ready" });
194
194
  }
195
195
  }));
196
196
  let Mt = new Pe({
197
197
  pageGap: se,
198
198
  showShadow: !0
199
- }), K = Se({
200
- getHost: () => ot.value,
201
- getDocument: () => Q.api.getCanonicalDocument() ?? D.value,
202
- getCanonicalApi: () => Q.api,
199
+ }), q = Se({
200
+ getHost: () => ct.value,
201
+ getReadOnly: () => c(u),
202
+ getDocument: () => $.api.getCanonicalDocument() ?? E.value,
203
+ getCanonicalApi: () => $.api,
203
204
  getExperimentalSession: () => c(_),
204
205
  onSessionRefusal: (e, t, n) => {
205
- z.value = e, S?.(n ?? new g({
206
+ z.value = e, x?.(n ?? new g({
206
207
  gap: t,
207
208
  message: e
208
209
  }));
209
210
  },
210
- getStyles: () => D.value?.package.styles ?? null,
211
- getTheme: () => D.value?.package.theme ?? null,
211
+ getStyles: () => E.value?.package.styles ?? null,
212
+ getTheme: () => E.value?.package.theme ?? null,
212
213
  onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
213
- if (r && (B.value = !0, X.schedule()), r || i) {
214
+ if (r && (B.value = !0, Z.schedule()), r || i) {
214
215
  let { from: r, to: i } = n.state.selection;
215
216
  F.value = {
216
217
  from: r,
217
218
  kind: t,
218
219
  rId: e,
219
220
  to: i
220
- }, C?.(n.state), W.emit("selectionChange", {
221
+ }, S?.(n.state), W.emit("selectionChange", {
221
222
  from: r,
222
223
  to: i
223
224
  });
224
225
  }
225
226
  G.requestRender();
226
227
  }
227
- }), Nt = { current: null }, q = Ce({
228
+ }), Nt = { current: null }, J = Ce({
228
229
  getHost: () => r?.value ?? null,
229
- getPlugins: () => St,
230
- getDocument: () => Q.api.getCanonicalDocument() ?? D.value,
231
- getCanonicalApi: () => Q.api,
230
+ getPlugins: () => Ct,
231
+ getDocument: () => $.api.getCanonicalDocument() ?? E.value,
232
+ getCanonicalApi: () => $.api,
232
233
  getExperimentalSession: () => c(_),
233
234
  onSessionRefusal: (e, t, n) => {
234
- z.value = e, S?.(n ?? new g({
235
+ z.value = e, x?.(n ?? new g({
235
236
  gap: t,
236
237
  message: e
237
238
  }));
238
239
  },
239
- getStyles: () => D.value?.package.styles ?? null,
240
- getTheme: () => D.value?.package.theme ?? null,
240
+ getStyles: () => E.value?.package.styles ?? null,
241
+ getTheme: () => E.value?.package.theme ?? null,
241
242
  onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
242
243
  if (e) {
243
244
  B.value = !0;
244
- let e = D.value;
245
+ let e = E.value;
245
246
  if (e) {
246
- let t = Q.api.getCanonicalDocument() ?? Nt.current?.snapshotDocument(e) ?? e;
247
- D.value = t, et?.(H(t)), W.emit("docChange", H(t));
247
+ let t = $.api.getCanonicalDocument() ?? Nt.current?.snapshotDocument(e) ?? e;
248
+ E.value = t, nt?.(H(t)), W.emit("docChange", H(t));
248
249
  }
249
- X.schedule();
250
+ Z.schedule();
250
251
  }
251
252
  if (e || t) {
252
- C?.(n.state);
253
+ S?.(n.state);
253
254
  let { from: e, to: t } = n.state.selection;
254
255
  W.emit("selectionChange", {
255
256
  from: e,
@@ -258,17 +259,17 @@ function O(e) {
258
259
  }
259
260
  }
260
261
  });
261
- Nt.current = q;
262
- let J = () => {
263
- K.sync(), q.sync();
262
+ Nt.current = J;
263
+ let Y = () => {
264
+ q.sync(), J.sync();
264
265
  };
265
- l(() => c(_), J);
266
+ l(() => c(_), Y);
266
267
  function Pt(e) {
267
- e.layout && (L.value = e.layout), e.blocks && (vt.value = e.blocks), e.measures && (yt.value = e.measures), e.blockLookup && Mt.setBlockLookup(e.blockLookup), e.layout && W.emit("layoutComplete", e.layout);
268
+ e.layout && (L.value = e.layout), e.blocks && (yt.value = e.blocks), e.measures && (bt.value = e.measures), e.blockLookup && Mt.setBlockLookup(e.blockLookup), e.layout && W.emit("layoutComplete", e.layout);
268
269
  }
269
- function Y(e, t = {}) {
270
+ function X(e, t = {}) {
270
271
  if (A) return;
271
- let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = D.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, l = oe(s), u = ae(s), d = ft(s), f = l.w - u.left - u.right, ee = i?.package.styles ?? null, p = i?.package.theme ?? null, m = i?.package.settings?.defaultTabStop, h = i?.package.settings?.mirrorMargins === !0, g = qe(i?.package);
272
+ let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = E.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, l = oe(s), u = ae(s), d = mt(s), f = l.w - u.left - u.right, ee = i?.package.styles ?? null, p = i?.package.theme ?? null, m = i?.package.settings?.defaultTabStop, h = i?.package.settings?.mirrorMargins === !0, g = qe(i?.package);
272
273
  try {
273
274
  Pt(we({
274
275
  contentWidth: f,
@@ -276,8 +277,8 @@ function O(e) {
276
277
  pageSize: l,
277
278
  margins: u,
278
279
  pageGap: se,
279
- showMarginGuides: c(je) === !0,
280
- marginGuideColor: c(Me),
280
+ showMarginGuides: c(Me) === !0,
281
+ marginGuideColor: c(v),
281
282
  ...(() => {
282
283
  let e = c(ce);
283
284
  return e === void 0 ? {} : { pageRenderer: e };
@@ -299,107 +300,108 @@ function O(e) {
299
300
  mirrorMargins: h,
300
301
  styles: ee,
301
302
  layout: L.value,
302
- hfPMs: K,
303
+ hfPMs: q,
303
304
  painter: Mt,
304
305
  pagesContainer: r,
305
- session: At,
306
- renderHfFromContentOrPm: pt,
307
- renderHeaderFooterContentByRId: mt,
306
+ session: K,
307
+ renderHfFromContentOrPm: ht,
308
+ renderHeaderFooterContentByRId: gt,
308
309
  readFontSetSignature: Ee,
309
- buildFootnoteRenderItems: ht,
310
- describeInvalidHighlightMarks: gt,
311
- emptyTemplatePreviewEntries: ut,
312
- emptyTemplatePreviewHidden: dt,
310
+ buildFootnoteRenderItems: _t,
311
+ describeInvalidHighlightMarks: vt,
312
+ emptyTemplatePreviewEntries: ft,
313
+ emptyTemplatePreviewHidden: pt,
313
314
  hyphenationReadiness: jt,
314
- markupView: c(me)
315
+ markupView: c(me),
316
+ showCommentHighlights: c(je)
315
317
  }, e, t));
316
318
  } catch (e) {
317
319
  let t = e instanceof Error ? e : Error(String(e));
318
- S?.(t);
320
+ x?.(t);
319
321
  }
320
322
  }
321
- let X = h({
323
+ let Z = h({
322
324
  readState: () => j.value?.state ?? null,
323
- runLayout: (e, t) => Y(e, t),
325
+ runLayout: (e, t) => X(e, t),
324
326
  ...p,
325
327
  clock: m
326
- }), Z = null, Ft = Le();
328
+ }), Q = null, Ft = Le();
327
329
  function It() {
328
- Z !== null && (window.clearTimeout(Z), Z = null);
329
- let e = j.value, t = D.value;
330
+ Q !== null && (window.clearTimeout(Q), Q = null);
331
+ let e = j.value, t = E.value;
330
332
  if (!(!e || !t)) try {
331
- let n = Q.api.getCanonicalDocument();
333
+ let n = $.api.getCanonicalDocument();
332
334
  if (!n && V()) return;
333
335
  let r = n ?? Ft.reconcile(Ie(e.state.doc, t, { stylesheetSource: { type: "package" } }), e.state.doc);
334
- D.value = r, J(), et?.(H(r)), W.emit("docChange", H(r));
336
+ E.value = r, Y(), nt?.(H(r)), W.emit("docChange", H(r));
335
337
  } catch (e) {
336
- S?.(e instanceof Error ? e : Error(String(e)));
338
+ x?.(e instanceof Error ? e : Error(String(e)));
337
339
  }
338
340
  }
339
341
  function Lt() {
340
- Z !== null && window.clearTimeout(Z), Z = window.setTimeout(() => {
341
- Z = null, It();
342
- }, lt);
342
+ Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
343
+ Q = null, It();
344
+ }, dt);
343
345
  }
344
- let Q = ne({
346
+ let $ = ne({
345
347
  getHost: () => t.value,
346
- getDocument: () => D.value,
347
- getStyles: () => D.value?.package.styles ?? null,
348
+ getDocument: () => E.value,
349
+ getStyles: () => E.value?.package.styles ?? null,
348
350
  getExtensionManager: () => U,
349
- getExternalPlugins: kt,
350
- getCollaboration: () => c(x),
351
+ getExternalPlugins: At,
352
+ getCollaboration: () => c(b),
351
353
  getCollaborationModules: () => N.value,
352
354
  getPrecomputedInitialState: () => null,
353
355
  getReadOnly: () => c(u),
354
356
  getExperimentalSession: () => c(_),
355
357
  getEditingMode: () => c(y) ?? "editing",
356
- getSuggestionAuthor: E,
358
+ getSuggestionAuthor: T,
357
359
  onSessionRefusal: (e, t, n) => {
358
- S?.(n ?? new g({
360
+ x?.(n ?? new g({
359
361
  gap: t,
360
362
  message: e
361
363
  }));
362
364
  },
363
- getDocumentIdentity: () => String(O),
364
- getDocumentContext: () => D.value,
365
+ getDocumentIdentity: () => String(D),
366
+ getDocumentContext: () => E.value,
365
367
  onTransaction: zt,
366
368
  onSelectionChange: (e) => {
367
- M.value = e, C?.(e), W.emit("selectionChange", {
369
+ M.value = e, S?.(e), W.emit("selectionChange", {
368
370
  from: e.selection.from,
369
371
  to: e.selection.to
370
372
  });
371
373
  },
372
374
  onKeyDown: () => !1,
373
- onCopy: () => nt?.(),
374
- onCut: () => rt?.(),
375
- onPaste: () => it?.(),
376
- onReadOnlyEditAttempt: () => w?.(),
375
+ onCopy: () => it?.(),
376
+ onCut: () => at?.(),
377
+ onPaste: () => C?.(),
378
+ onReadOnlyEditAttempt: () => ot?.(),
377
379
  onEditorViewReady: Bt,
378
380
  onEditorViewDestroy: () => {
379
- j.value = null, R.value = !1, tt?.(null);
381
+ j.value = null, R.value = !1, rt?.(null);
380
382
  },
381
383
  onRemoteSelectionsChange: (e) => {
382
384
  P.value = e;
383
385
  }
384
386
  }), Rt = () => {
385
- let e = c(x)?.awareness, t = N.value, n = Q.getView();
387
+ let e = c(b)?.awareness, t = N.value, n = $.getView();
386
388
  P.value = e && t && n ? te(n.state, e, t) : [];
387
389
  };
388
- l(() => c(x), (e, t, n) => {
390
+ l(() => c(b), (e, t, n) => {
389
391
  if (P.value = [], !e) {
390
- N.value = null, Q.retryViewCreation(), Q.syncExternalDocument();
392
+ N.value = null, $.retryViewCreation(), $.syncExternalDocument();
391
393
  return;
392
394
  }
393
395
  let r = !1;
394
396
  n(() => {
395
397
  r = !0;
396
398
  }), N.value = null, xe().then((e) => {
397
- r || (N.value = e, Q.retryViewCreation(), Q.syncExternalDocument(), Rt());
399
+ r || (N.value = e, $.retryViewCreation(), $.syncExternalDocument(), Rt());
398
400
  }, (e) => {
399
- r || (N.value = null, S?.(e instanceof Error ? e : Error(String(e))));
401
+ r || (N.value = null, x?.(e instanceof Error ? e : Error(String(e))));
400
402
  });
401
403
  }, { immediate: !0 }), l(() => ({
402
- awareness: c(x)?.awareness,
404
+ awareness: c(b)?.awareness,
403
405
  modules: N.value,
404
406
  view: j.value
405
407
  }), ({ awareness: e, modules: t, view: n }, r, i) => {
@@ -415,101 +417,101 @@ function O(e) {
415
417
  M.value = e;
416
418
  let r = n[0]?.before;
417
419
  if (t && r && Ft.noteBase(r), t) {
418
- let e = Q.api.getCanonicalDocument();
419
- e && (D.value = e, J()), B.value = !0, G.incrementStateSeq(), X.schedule(), Lt();
420
+ let e = $.api.getCanonicalDocument();
421
+ e && (E.value = e, Y()), B.value = !0, G.incrementStateSeq(), Z.schedule(), Lt();
420
422
  }
421
423
  G.requestRender();
422
424
  }
423
425
  function Bt(e) {
424
426
  j.value = e, M.value = e.state, R.value = !0;
425
- let t = D.value, n = O, r = ++k;
427
+ let t = E.value, n = D, r = ++k;
426
428
  A = !0;
427
429
  let i = () => {
428
- k === r && (A = !1, !(_t || O !== n || Q.getView() !== e) && (Y(e.state, { reason: "initial" }), G.requestRender()));
430
+ k === r && (A = !1, !(O || D !== n || $.getView() !== e) && (X(e.state, { reason: "initial" }), G.requestRender()));
429
431
  };
430
- De(t, e.state.doc).then(i, i), $(e), tt?.(e), c(u) || requestAnimationFrame(() => {
432
+ De(t, e.state.doc).then(i, i), Ut(e), rt?.(e), c(u) || requestAnimationFrame(() => {
431
433
  j.value === e && e.focus();
432
434
  });
433
435
  }
434
436
  let Vt = {
435
- getDocx: async (e) => (await Yt(e))?.buffer ?? null,
436
- loadDocument: Jt,
437
- loadDocx: qt
437
+ getDocx: async (e) => (await Xt(e))?.buffer ?? null,
438
+ loadDocument: Yt,
439
+ loadDocx: Jt
438
440
  }, Ht = ge({
439
- getEditorApi: () => Q.api,
441
+ getEditorApi: () => $.api,
440
442
  getLayout: () => L.value,
441
- runLayout: (e, t) => Y(e, t),
443
+ runLayout: (e, t) => X(e, t),
442
444
  getDocumentIO: () => Vt,
443
445
  emitter: W
444
446
  });
445
- function $(e) {
446
- pe(c(y) === "suggesting", e.state, e.dispatch, E());
447
+ function Ut(e) {
448
+ pe(c(y) === "suggesting", e.state, e.dispatch, T());
447
449
  }
448
- l([() => c(y), E], () => {
450
+ l([() => c(y), T], () => {
449
451
  Ht.setCanonicalMode(c(y) === "suggesting" ? {
450
452
  type: "suggesting",
451
- author: E()
453
+ author: T()
452
454
  } : { type: "editing" });
453
455
  let e = j.value;
454
- e && $(e);
455
- for (let e of q.listStories()) {
456
- let t = q.getView(e);
457
- t && $(t);
456
+ e && Ut(e);
457
+ for (let e of J.listStories()) {
458
+ let t = J.getView(e);
459
+ t && Ut(t);
458
460
  }
459
461
  }), l(() => c(u), (e) => {
460
- Q.syncEditable(), e && nn();
462
+ $.syncEditable(), e && rn(), q.sync();
461
463
  });
462
- function Ut(e) {
463
- let t = Ot();
464
- if (t === e.state.plugins.includes(Tt)) return;
465
- let n = e.state.plugins.filter((e) => e !== Tt && e !== Et);
464
+ function Wt(e) {
465
+ let t = kt();
466
+ if (t === e.state.plugins.includes(Et)) return;
467
+ let n = e.state.plugins.filter((e) => e !== Et && e !== Dt);
466
468
  if (t) {
467
- let e = n.indexOf(Dt), t = e === -1 ? n.length : e;
468
- n.splice(t, 0, Tt, Et);
469
+ let e = n.indexOf(Ot), t = e === -1 ? n.length : e;
470
+ n.splice(t, 0, Et, Dt);
469
471
  }
470
472
  e.updateState(e.state.reconfigure({ plugins: n }));
471
473
  }
472
- l(() => Ot(), () => {
474
+ l(() => kt(), () => {
473
475
  let e = j.value;
474
- e && Ut(e);
476
+ e && Wt(e);
475
477
  });
476
- function Wt() {
477
- Q.ensureView();
478
- }
479
478
  function Gt() {
480
- O += 1, B.value = !1, F.value = null, I.value = null, q.activate(null), X.dispose(), Q.destroyView(), V() && Q.ensureView(), J(), Q.ensureView(), Q.getView() || Kt();
479
+ $.ensureView();
481
480
  }
482
481
  function Kt() {
483
- let e = D.value;
484
- if (!(!e || c(x))) try {
482
+ D += 1, B.value = !1, F.value = null, I.value = null, J.activate(null), Z.dispose(), $.destroyView(), V() && $.ensureView(), Y(), $.ensureView(), $.getView() || qt();
483
+ }
484
+ function qt() {
485
+ let e = E.value;
486
+ if (!(!e || c(b))) try {
485
487
  let t = re({
486
488
  document: e,
487
489
  styles: e.package.styles ?? null,
488
490
  manager: U,
489
- externalPlugins: kt(),
491
+ externalPlugins: At(),
490
492
  collaborationModules: null,
491
493
  reason: "mount"
492
494
  });
493
495
  M.value = t;
494
- let n = O, r = ++k;
496
+ let n = D, r = ++k;
495
497
  A = !0;
496
498
  let i = () => {
497
- k === r && (A = !1, !(_t || O !== n || D.value !== e || Q.getView()) && Y(t, { reason: "initial" }));
499
+ k === r && (A = !1, !(O || D !== n || E.value !== e || $.getView()) && X(t, { reason: "initial" }));
498
500
  };
499
501
  De(e, t.doc).then(i, i);
500
502
  } catch (e) {
501
- S?.(e instanceof Error ? e : Error(String(e)));
503
+ x?.(e instanceof Error ? e : Error(String(e)));
502
504
  }
503
505
  }
504
506
  l([
505
507
  t,
506
508
  a,
507
- ot,
509
+ ct,
508
510
  ...r ? [r] : []
509
511
  ], () => {
510
- t.value && D.value && !Q.getView() && Wt(), J();
512
+ t.value && E.value && !$.getView() && Gt(), Y();
511
513
  }, { flush: "post" });
512
- async function qt(e) {
514
+ async function Jt(e) {
513
515
  z.value = null, R.value = !1;
514
516
  try {
515
517
  let t = e;
@@ -518,40 +520,40 @@ function O(e) {
518
520
  if (n.isErr()) throw n.error;
519
521
  t = n.value;
520
522
  }
521
- let n = await Ae(t, { password: c(v) });
522
- D.value = n, Gt();
523
+ let n = await Ae(t, { password: c(Je) });
524
+ E.value = n, Kt();
523
525
  } catch (e) {
524
526
  let t = e instanceof Error ? e : Error(String(e));
525
- z.value = t.message, S?.(t);
527
+ z.value = t.message, x?.(t);
526
528
  }
527
529
  }
528
- function Jt(e) {
529
- z.value = null, D.value = e, Ft.reset(), Gt();
530
+ function Yt(e) {
531
+ z.value = null, E.value = e, Ft.reset(), Kt();
530
532
  }
531
- async function Yt(e) {
532
- let t = j.value, n = D.value;
533
+ async function Xt(e) {
534
+ let t = j.value, n = E.value;
533
535
  if (!t || !n) return null;
534
536
  try {
535
- let t = Q.api.captureCanonicalSave();
537
+ let t = $.api.captureCanonicalSave();
536
538
  if (t) {
537
539
  let n = await be({
538
540
  snapshot: t,
539
541
  options: e,
540
- featureFlags: c(T)
542
+ featureFlags: c(st)
541
543
  });
542
- for (let t of n.diagnostics) e?.onDiagnostic || S?.(new ye({
544
+ for (let t of n.diagnostics) e?.onDiagnostic || x?.(new ye({
543
545
  gap: d.save,
544
546
  diagnostic: t,
545
547
  message: `Canonical save used a fidelity fallback: ${t.type} (${t.part}).`
546
548
  }));
547
- return n.tripwireResult && at?.(n.tripwireResult), n;
549
+ return n.tripwireResult && w?.(n.tripwireResult), n;
548
550
  }
549
551
  } catch (e) {
550
- return S?.(e instanceof Error ? e : Error(String(e))), null;
552
+ return x?.(e instanceof Error ? e : Error(String(e))), null;
551
553
  }
552
554
  if (V()) return null;
553
- Z !== null && It();
554
- let r = q.snapshotDocument(K.snapshotDocument(n)), i = t.state, a = Re(Ie(i.doc, r, { stylesheetSource: { type: "package" } })), { resolveSelectiveSaveFlags: o } = await import("@stll/folio-core/docx/selectiveSaveFlags"), s = o(c(T)), l = a.originalBuffer ?? null, u = s.selectiveSave && e?.mode !== he.full, f = u || s.selectiveSaveTripwire, { repackDocx: ee, createDocx: p } = await import("@stll/folio-core/docx/rezip"), m = null;
555
+ Q !== null && It();
556
+ let r = J.snapshotDocument(q.snapshotDocument(n)), i = t.state, a = Re(Ie(i.doc, r, { stylesheetSource: { type: "package" } })), { resolveSelectiveSaveFlags: o } = await import("@stll/folio-core/docx/selectiveSaveFlags"), s = o(c(st)), l = a.originalBuffer ?? null, u = s.selectiveSave && e?.mode !== he.full, f = u || s.selectiveSaveTripwire, { repackDocx: ee, createDocx: p } = await import("@stll/folio-core/docx/rezip"), m = null;
555
557
  if (f && l) {
556
558
  let { attemptSelectiveSave: e } = await import("@stll/folio-core/docx/selectiveSave");
557
559
  m = await e(a, l, {
@@ -570,67 +572,75 @@ function O(e) {
570
572
  else if (s.selectiveSaveTripwire) try {
571
573
  g = await te();
572
574
  } catch {}
573
- if (s.selectiveSaveTripwire && g && at) try {
575
+ if (s.selectiveSaveTripwire && g && w) try {
574
576
  let { compareSelectiveVsFull: e } = await import("@stll/folio-core/docx/selectiveSaveTripwire");
575
- at(await e(m, g));
577
+ w(await e(m, g));
576
578
  } catch {}
577
579
  return {
578
580
  buffer: h,
579
581
  document: a
580
582
  };
581
583
  }
582
- async function Xt(e) {
583
- let t = j.value, n = t?.state, r = await Yt({ mode: e?.selective === !1 ? he.full : he.preferSelective });
584
- return r ? (j.value === t && t?.state.doc === n?.doc && (r.version === void 0 || Q.api.isCanonicalSaveCurrent(r.version)) && (D.value = r.document, J(), B.value = !1), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
584
+ async function Zt(e) {
585
+ let t = j.value, n = t?.state, r = await Xt({ mode: e?.selective === !1 ? he.full : he.preferSelective });
586
+ return r ? (j.value === t && t?.state.doc === n?.doc && (r.version === void 0 || $.api.isCanonicalSaveCurrent(r.version)) && (E.value = r.document, Y(), B.value = !1), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
585
587
  }
586
- function Zt() {
587
- let e = Q.api.getCanonicalDocument();
588
+ function Qt() {
589
+ let e = $.api.getCanonicalDocument();
588
590
  if (e) return e;
589
591
  if (V()) return null;
590
- let t = D.value;
591
- return t ? H(q.snapshotDocument(K.snapshotDocument(t))) : null;
592
- }
593
- function Qt(e) {
594
- bt(d.modelEdits, "Direct document model changes are unavailable in this session.") || (D.value = e, J(), I.value && !q.getView(I.value) && (I.value = null));
592
+ let t = E.value;
593
+ return t ? H(J.snapshotDocument(q.snapshotDocument(t))) : null;
595
594
  }
596
595
  function $t(e) {
597
- return K.getView(e);
596
+ xt(d.modelEdits, "Direct document model changes are unavailable in this session.") || (E.value = e, Y(), I.value && !J.getView(I.value) && (I.value = null));
598
597
  }
599
- function en() {
600
- J();
598
+ function en(e) {
599
+ return q.getView(e);
601
600
  }
602
- function tn(e) {
603
- let t = q.activate(e);
604
- t && ($(t), I.value = e, requestAnimationFrame(() => t.focus()));
601
+ function tn() {
602
+ Y();
605
603
  }
606
- function nn() {
607
- q.activate(null), I.value = null;
604
+ function nn(e) {
605
+ let t = J.activate(e);
606
+ t && (Ut(t), I.value = e, requestAnimationFrame(() => t.focus()));
608
607
  }
609
608
  function rn() {
610
- let e = I.value;
611
- return e ? q.getView(e) : null;
609
+ J.activate(null), I.value = null;
612
610
  }
613
611
  function an() {
614
- return U.getCommands();
612
+ let e = I.value;
613
+ return e ? J.getView(e) : null;
615
614
  }
616
615
  function on() {
617
- let e = rn();
618
- e ? e.focus() : j.value?.focus();
616
+ return U.getCommands();
619
617
  }
620
618
  function sn() {
619
+ let e = an();
620
+ e ? e.focus() : j.value?.focus();
621
+ }
622
+ function cn() {
621
623
  let e = j.value;
622
- e && Y(e.state, { reason: "manual" });
624
+ e && X(e.state, { reason: "manual" });
623
625
  }
624
626
  l([
625
- () => c(je),
626
627
  () => c(Me),
628
+ () => c(v),
627
629
  () => c(ce),
628
- () => c(me)
629
- ], () => sn());
630
- function cn() {
631
- _t = !0, k += 1, A = !1, X.dispose(), Z !== null && (window.clearTimeout(Z), Z = null), Q.destroyView(), P.value = [], K.destroy(), q.destroy(), U.destroy(), M.value = null, L.value = null, D.value = null, R.value = !1;
632
- }
633
- return i(cn), {
630
+ () => c(me),
631
+ () => c(je)
632
+ ], () => cn());
633
+ function ln() {
634
+ O = !0, k += 1, A = !1, Z.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), $.destroyView(), P.value = [], q.destroy(), J.destroy(), U.destroy(), M.value = null, L.value = null, E.value = null, R.value = !1;
635
+ }
636
+ return i(ln), {
637
+ setEmbeddedFontFamilies: (e) => {
638
+ if (e) {
639
+ K.embeddedFontFamilyMap = new Map(e);
640
+ return;
641
+ }
642
+ delete K.embeddedFontFamilyMap;
643
+ },
634
644
  editor: Ht,
635
645
  editorView: j,
636
646
  editorState: M,
@@ -641,26 +651,26 @@ function O(e) {
641
651
  isDirty: B,
642
652
  parseError: z,
643
653
  layout: L,
644
- blocks: vt,
645
- measures: yt,
654
+ blocks: yt,
655
+ measures: bt,
646
656
  syncCoordinator: G,
647
- loadBuffer: qt,
648
- loadDocument: Jt,
649
- save: Xt,
650
- getDocument: Zt,
651
- setDocument: Qt,
652
- getHeaderFooterView: $t,
653
- syncHeaderFooterViews: en,
654
- openNoteStory: tn,
655
- closeNoteStory: nn,
656
- getActiveNoteView: rn,
657
- getCommands: an,
658
- focus: on,
659
- reLayout: sn,
660
- destroy: cn
657
+ loadBuffer: Jt,
658
+ loadDocument: Yt,
659
+ save: Zt,
660
+ getDocument: Qt,
661
+ setDocument: $t,
662
+ getHeaderFooterView: en,
663
+ syncHeaderFooterViews: tn,
664
+ openNoteStory: nn,
665
+ closeNoteStory: rn,
666
+ getActiveNoteView: an,
667
+ getCommands: on,
668
+ focus: sn,
669
+ reLayout: cn,
670
+ destroy: ln
661
671
  };
662
672
  }
663
- function _t(e, t) {
673
+ function D(e, t) {
664
674
  if (t < e.top + 40) {
665
675
  let n = Math.max(0, e.top + 40 - t);
666
676
  return -Math.min(12, n / 40 * 12);
@@ -673,7 +683,7 @@ function _t(e, t) {
673
683
  }
674
684
  //#endregion
675
685
  //#region src/composables/useDragAutoScroll.ts
676
- function k({ pagesContainer: e, onScrollExtendSelection: t }) {
686
+ function O({ pagesContainer: e, onScrollExtendSelection: t }) {
677
687
  let n = null, r = 0, a = 0, o = !1;
678
688
  function s() {
679
689
  return se(e.value);
@@ -685,7 +695,7 @@ function k({ pagesContainer: e, onScrollExtendSelection: t }) {
685
695
  if (!o) return;
686
696
  let e = s();
687
697
  if (!e) return;
688
- let i = _t(e.getBoundingClientRect(), a);
698
+ let i = D(e.getBoundingClientRect(), a);
689
699
  i !== 0 && (ce(e, i), t(r, a)), n = requestAnimationFrame(l);
690
700
  }
691
701
  function u() {
@@ -706,7 +716,7 @@ function k({ pagesContainer: e, onScrollExtendSelection: t }) {
706
716
  }
707
717
  //#endregion
708
718
  //#region src/composables/useTableResize.ts
709
- function A() {
719
+ function k() {
710
720
  let e = {
711
721
  active: !1,
712
722
  startX: 0,
@@ -738,14 +748,14 @@ function A() {
738
748
  }
739
749
  function a(i, a) {
740
750
  let o = i.target;
741
- return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (i.preventDefault(), i.stopPropagation(), r = a, e.active = !0, e.startX = i.clientX, e.handle = o, o.classList.add("dragging"), e.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), e.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), j(a, e), !0) : o.classList.contains("layout-table-row-resize-handle") || o.classList.contains("layout-table-edge-handle-bottom") ? (i.preventDefault(), i.stopPropagation(), r = a, t.active = !0, t.startY = i.clientY, t.handle = o, t.isEdge = o.dataset.isEdge === "bottom", o.classList.add("dragging"), t.rowIndex = parseInt(o.dataset.rowIndex ?? "0", 10), t.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), M(a, t, o), !0) : o.classList.contains("layout-table-edge-handle-right") ? (i.preventDefault(), i.stopPropagation(), r = a, n.active = !0, n.startX = i.clientX, n.handle = o, o.classList.add("dragging"), n.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), n.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), N(a, n), !0) : !1 : !1;
751
+ return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (i.preventDefault(), i.stopPropagation(), r = a, e.active = !0, e.startX = i.clientX, e.handle = o, o.classList.add("dragging"), e.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), e.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), A(a, e), !0) : o.classList.contains("layout-table-row-resize-handle") || o.classList.contains("layout-table-edge-handle-bottom") ? (i.preventDefault(), i.stopPropagation(), r = a, t.active = !0, t.startY = i.clientY, t.handle = o, t.isEdge = o.dataset.isEdge === "bottom", o.classList.add("dragging"), t.rowIndex = parseInt(o.dataset.rowIndex ?? "0", 10), t.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), j(a, t, o), !0) : o.classList.contains("layout-table-edge-handle-right") ? (i.preventDefault(), i.stopPropagation(), r = a, n.active = !0, n.startX = i.clientX, n.handle = o, o.classList.add("dragging"), n.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), n.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), M(a, n), !0) : !1 : !1;
742
752
  }
743
753
  function o(r) {
744
754
  if (e.active && e.handle) {
745
755
  r.preventDefault();
746
756
  let t = r.clientX - e.startX, n = parseFloat(e.handle.style.left);
747
757
  e.handle.style.left = `${n + t}px`, e.startX = r.clientX;
748
- let i = Math.round(t * b), a = e.origWidths.left + i, o = e.origWidths.right - i;
758
+ let i = Math.round(t * y), a = e.origWidths.left + i, o = e.origWidths.right - i;
749
759
  a >= v && o >= v && (e.origWidths = {
750
760
  left: a,
751
761
  right: o
@@ -756,21 +766,21 @@ function A() {
756
766
  r.preventDefault();
757
767
  let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
758
768
  t.handle.style.top = `${n + e}px`, t.startY = r.clientY;
759
- let i = Math.round(e * b), a = t.origHeight + i;
760
- a >= y && (t.origHeight = a);
769
+ let i = Math.round(e * y), a = t.origHeight + i;
770
+ a >= Je && (t.origHeight = a);
761
771
  return;
762
772
  }
763
773
  if (n.active && n.handle) {
764
774
  r.preventDefault();
765
775
  let e = r.clientX - n.startX, t = parseFloat(n.handle.style.left);
766
776
  n.handle.style.left = `${t + e}px`, n.startX = r.clientX;
767
- let i = Math.round(e * b), a = n.origWidth + i;
777
+ let i = Math.round(e * y), a = n.origWidth + i;
768
778
  a >= v && (n.origWidth = a);
769
779
  }
770
780
  }
771
781
  function s(i) {
772
782
  if (e.active) {
773
- e.active = !1, e.handle?.classList.remove("dragging"), r && Je(r, {
783
+ e.active = !1, e.handle?.classList.remove("dragging"), r && Ye(r, {
774
784
  pmStart: e.tablePmStart,
775
785
  colIdx: e.columnIndex,
776
786
  newLeft: e.origWidths.left,
@@ -779,14 +789,14 @@ function A() {
779
789
  return;
780
790
  }
781
791
  if (t.active) {
782
- t.active = !1, t.handle?.classList.remove("dragging"), r && x(r, {
792
+ t.active = !1, t.handle?.classList.remove("dragging"), r && Ze(r, {
783
793
  pmStart: t.tablePmStart,
784
794
  rowIdx: t.rowIndex,
785
795
  newHeight: t.origHeight
786
796
  }), t.handle = null;
787
797
  return;
788
798
  }
789
- n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && Ye(r, {
799
+ n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && Xe(r, {
790
800
  pmStart: n.tablePmStart,
791
801
  colIdx: n.columnIndex,
792
802
  newWidth: n.origWidth
@@ -803,31 +813,31 @@ function A() {
803
813
  isResizing: i
804
814
  };
805
815
  }
806
- function j(e, t) {
807
- let n = Ze(e, t.tablePmStart, t.columnIndex);
816
+ function A(e, t) {
817
+ let n = Qe(e, t.tablePmStart, t.columnIndex);
808
818
  n && (t.origWidths = n);
809
819
  }
810
- function M(e, t, n) {
811
- let r = Qe(e, t.tablePmStart, t.rowIndex);
820
+ function j(e, t, n) {
821
+ let r = $e(e, t.tablePmStart, t.rowIndex);
812
822
  if (r != null) {
813
823
  t.origHeight = r;
814
824
  return;
815
825
  }
816
826
  let i = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), a = i ? i.getBoundingClientRect().height : 30;
817
- t.origHeight = Math.round(a * b);
827
+ t.origHeight = Math.round(a * y);
818
828
  }
819
- function N(e, t) {
820
- let n = Xe(e, t.tablePmStart, t.columnIndex);
829
+ function M(e, t) {
830
+ let n = b(e, t.tablePmStart, t.columnIndex);
821
831
  n != null && (t.origWidth = n);
822
832
  }
823
833
  //#endregion
824
834
  //#region src/composables/useTrackedChanges.ts
825
- function P(t, n) {
826
- return e(() => (n.value, $e(t.value?.state ?? null)));
835
+ function N(t, n) {
836
+ return e(() => (n.value, et(t.value?.state ?? null)));
827
837
  }
828
838
  //#endregion
829
839
  //#region src/composables/useZoom.ts
830
- var F = S, I = et, L = [
840
+ var P = nt, F = tt, I = [
831
841
  .5,
832
842
  .75,
833
843
  1,
@@ -835,16 +845,16 @@ var F = S, I = et, L = [
835
845
  1.5,
836
846
  2
837
847
  ];
838
- function vt(t = 1) {
839
- let i = o(Math.max(F, Math.min(I, t))), a = e(() => Math.round(i.value * 100)), s = e(() => i.value <= F), c = e(() => i.value >= I);
848
+ function L(t = 1) {
849
+ let i = o(Math.max(P, Math.min(F, t))), a = e(() => Math.round(i.value * 100)), s = e(() => i.value <= P), c = e(() => i.value >= F);
840
850
  function l(e) {
841
- i.value = Math.max(F, Math.min(I, Math.round(e * 100) / 100));
851
+ i.value = Math.max(P, Math.min(F, Math.round(e * 100) / 100));
842
852
  }
843
853
  function u() {
844
- l(i.value + C);
854
+ l(i.value + x);
845
855
  }
846
856
  function d() {
847
- l(i.value - C);
857
+ l(i.value - x);
848
858
  }
849
859
  function f() {
850
860
  l(1);
@@ -870,8 +880,8 @@ function vt(t = 1) {
870
880
  handleWheel: ee,
871
881
  handleKeyDown: p,
872
882
  installShortcuts: m,
873
- ZOOM_PRESETS: L
883
+ ZOOM_PRESETS: I
874
884
  };
875
885
  }
876
886
  //#endregion
877
- export { k as a, w as c, A as i, at as l, $e as n, O as o, P as r, ot as s, vt as t, E as u };
887
+ export { O as a, C as c, k as i, st as l, et as n, E as o, N as r, w as s, L as t, ct as u };