@stll/folio-vue 0.32.1 → 0.33.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 (65) hide show
  1. package/dist/FindReplaceDialog-CfcTl2Ra.cjs +1 -0
  2. package/dist/FindReplaceDialog-DEWjhuOw.js +168 -0
  3. package/dist/HorizontalRuler-Cuk0l4Us.cjs +1 -0
  4. package/dist/HorizontalRuler-TM9dg--R.js +341 -0
  5. package/dist/HyperlinkDialog-BEse_y7R.js +175 -0
  6. package/dist/HyperlinkDialog-Cs1y6aol.cjs +1 -0
  7. package/dist/ImagePropertiesDialog-CTbX2GrE.cjs +1 -0
  8. package/dist/ImagePropertiesDialog-mrJ8S3sl.js +186 -0
  9. package/dist/ImageSelectionOverlay-DULrvfOJ.js +386 -0
  10. package/dist/ImageSelectionOverlay-Dr0lg9WZ.cjs +1 -0
  11. package/dist/InsertSymbolDialog-BjB-Q9EO.js +93 -0
  12. package/dist/InsertSymbolDialog-BsjgPYM-.cjs +1 -0
  13. package/dist/PageSetupDialog-CZ5fE9rz.cjs +1 -0
  14. package/dist/PageSetupDialog-DNNSezj3.js +208 -0
  15. package/dist/SetNumberingValueDialog-ClCYr37D.cjs +1 -0
  16. package/dist/SetNumberingValueDialog-CwLHfO7f.js +54 -0
  17. package/dist/SplitCellDialog-Bfuo5WCO.cjs +1 -0
  18. package/dist/SplitCellDialog-HIg4ZEqt.js +1031 -0
  19. package/dist/StylePicker-BnGGlXOX.cjs +4 -0
  20. package/dist/{StylePicker-DmTN56Yg.js → StylePicker-F3cLPvRE.js} +593 -1100
  21. package/dist/TablePropertiesDialog-CRX9Xgdr.js +102 -0
  22. package/dist/TablePropertiesDialog-ClJSuB0F.cjs +1 -0
  23. package/dist/VerticalRuler-D973NTMv.js +178 -0
  24. package/dist/VerticalRuler-DVi2P_TO.cjs +1 -0
  25. package/dist/WatermarkDialog-BYyBTlDK.cjs +1 -0
  26. package/dist/WatermarkDialog-BoAdQ-qK.js +161 -0
  27. package/dist/components/dialogs/recentSymbols.d.ts +7 -0
  28. package/dist/composables/useDocxEditor.d.ts +4 -1
  29. package/dist/composables.cjs +1 -1
  30. package/dist/composables.js +1 -1
  31. package/dist/dialogs.cjs +1 -1
  32. package/dist/dialogs.js +9 -1
  33. package/dist/{SplitCellDialog-BczVYfpm.js → folio-ui-ctJdVP-s.js} +678 -2753
  34. package/dist/folio-ui-u7h3WXUO.cjs +15 -0
  35. package/dist/folio-vue.css +1 -1
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.ts +0 -1
  38. package/dist/index.js +1665 -2064
  39. package/dist/messages/ar.cjs +1 -1
  40. package/dist/messages/cs.cjs +1 -1
  41. package/dist/messages/de.cjs +1 -1
  42. package/dist/messages/en.cjs +1 -1
  43. package/dist/messages/es.cjs +1 -1
  44. package/dist/messages/et.cjs +1 -1
  45. package/dist/messages/fr.cjs +1 -1
  46. package/dist/messages/he.cjs +1 -1
  47. package/dist/messages/hi.cjs +1 -1
  48. package/dist/messages/hu.cjs +1 -1
  49. package/dist/messages/lt.cjs +1 -1
  50. package/dist/messages/lv.cjs +1 -1
  51. package/dist/messages/pl.cjs +1 -1
  52. package/dist/messages/pt-BR.cjs +1 -1
  53. package/dist/messages/sk.cjs +1 -1
  54. package/dist/messages/tr.cjs +1 -1
  55. package/dist/messages/zh-CN.cjs +1 -1
  56. package/dist/rolldown-runtime-DbbDpzbe.cjs +1 -0
  57. package/dist/ui.cjs +1 -1
  58. package/dist/ui.js +28 -18
  59. package/dist/{useZoom-1kmdkmJ4.js → useZoom-CX69Me_z.js} +289 -285
  60. package/dist/useZoom-QSSrGY_r.cjs +1 -0
  61. package/package.json +2 -2
  62. package/dist/SplitCellDialog-CrLHwVLc.cjs +0 -15
  63. package/dist/StylePicker-C0iEQnw6.cjs +0 -4
  64. package/dist/rolldown-runtime-5iZMYShA.cjs +0 -1
  65. package/dist/useZoom-Bj5B9uT1.cjs +0 -1
@@ -3,43 +3,44 @@ import { CanonicalSessionRefusalError as p, createHiddenEditorManager as m, crea
3
3
  import { getEditorReadOnlyReason as ee } from "@stll/folio-core/managers/EditorModeManager";
4
4
  import { getEditorScrollRoot as g, scrollEditorBy as _ } from "@stll/folio-core/paged-layout/editorScrollRoot";
5
5
  import { getMargins as te, getPageSize as ne, twipsToPixels as v } from "@stll/folio-core/paged-layout/sectionGeometry";
6
- import { CANONICAL_GAP as y, canonicalRefusalMessage as b } from "@stll/folio-core/types/canonicalCapabilities";
7
- import { readModel as x } from "@stll/folio-core/types/documentModel";
8
- import { readPaintedTableStart as S } from "@stll/folio-core/utils/paintedPositions";
6
+ import { readModel as y } from "@stll/folio-core/types/documentModel";
7
+ import { readPaintedTableStart as b } from "@stll/folio-core/utils/paintedPositions";
9
8
  import { NO_ANONYMIZATION_TERMS as re } from "@stll/folio-core/controller/anonymizationHighlights";
10
- import { DOCUMENT_CHANGE_NOTIFY_DELAY_MS as C } from "@stll/folio-core/controller/documentChangeNotification";
11
- import { FOLIO_DOCX_SERIALIZATION_MODE as w, createFolioEditor as ie } from "@stll/folio-core/controller/folioEditor";
12
- import { createFolioEditorEmitter as ae } from "@stll/folio-core/controller/folioEditorEvents";
13
- import { readFontSetSignature as oe, waitForInitialLayoutFonts as se, watchLayoutFontLoads as ce } from "@stll/folio-core/controller/fontReadiness";
14
- import { createHeaderFooterEditorManager as le } from "@stll/folio-core/controller/headerFooterEditorManager";
15
- import { createHyphenationReadiness as ue } from "@stll/folio-core/controller/hyphenationReadiness";
16
- import { runLayoutPipeline as de } from "@stll/folio-core/controller/layoutPipeline";
17
- import { TRANSACTION_LAYOUT_TIMING as fe, browserClock as T, createLayoutScheduler as pe } from "@stll/folio-core/controller/layoutScheduler";
18
- import { createLayoutSession as me } from "@stll/folio-core/controller/layoutSession";
19
- import { createNoteEditorManager as he } from "@stll/folio-core/controller/noteEditorManager";
20
- import { holdsUniqueParagraphIds as ge, openCanonicalDocx as _e, prepareCanonicalDocumentInput as ve } from "@stll/folio-core/docx/canonicalSessionInput";
21
- import { carryParseFacts as ye, cloneDocumentWithParagraphPropertySources as be } from "@stll/folio-core/docx/document-clone";
22
- import { getFootnoteText as xe } from "@stll/folio-core/docx/storyPlainText";
23
- import { convertHeaderFooterPmDocToContent as Se, convertHeaderFooterToContent as Ce } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
24
- import { resolveSectionHeaderFooterRefs as we } from "@stll/folio-core/layout-engine";
25
- import { LayoutPainter as Te, releaseDisplayPageResources as Ee } from "@stll/folio-core/layout-painter";
26
- import { LayoutSelectionGate as De } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
27
- import { ExtensionManager as Oe } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
28
- import { createStarterKit as ke } from "@stll/folio-core/prosemirror/extensions/StarterKit";
29
- import { createTemplateDirectivesPlugin as Ae } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
30
- import { createTemplatePreviewValuesPlugin as je } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
31
- import { templateSlashMenuPlugin as Me } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
32
- import { resolveHeaderFooterContent as Ne } from "@stll/folio-core/utils/headerFooter";
33
- import { lockHeldRevisions as Pe, trackedChangeEntryRevisionIds as Fe } from "@stll/folio-core/prosemirror/commands/comments";
34
- import { FindReplaceManager as Ie } from "@stll/folio-core/managers/FindReplaceManager";
35
- import { findInDisplayedDocument as Le } from "@stll/folio-core/prosemirror/findReplaceSelection";
36
- import { replaceFindMatch as Re, replaceFindMatches as ze } from "@stll/folio-core/prosemirror/replaceFindMatches";
37
- import { createFindMatchView as Be, getRenderedSearchStories as Ve } from "@stll/folio-core/utils/findMatchView";
38
- import { createDefaultFindOptions as He, replaceEligibility as Ue } from "@stll/folio-core/utils/findReplace";
39
- import { createFindSearchKey as E, sameFindSearchKey as We } from "@stll/folio-core/utils/findSearchKey";
40
- import { MIN_CELL_WIDTH_TWIPS as D, MIN_ROW_HEIGHT_TWIPS as Ge, TWIPS_PER_PIXEL as O, clampRowResizeDelta as Ke, columnResizeCommand as qe, readColumnWidthAt as Je, readColumnWidths as Ye, readRowHeight as Xe, rightEdgeResizeCommand as Ze, rowResizeCommand as k } from "@stll/folio-core/prosemirror/tableResize";
41
- import { extractTrackedChanges as A } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
42
- import { ZOOM_MAX as Qe, ZOOM_MIN as j, ZOOM_STEP as $e } from "@stll/folio-core/utils/zoom";
9
+ import { createDisplayListPainterLoader as ie } from "@stll/folio-core/controller/deferredDisplayListPainter";
10
+ import { DOCUMENT_CHANGE_NOTIFY_DELAY_MS as ae } from "@stll/folio-core/controller/documentChangeNotification";
11
+ import { FOLIO_DOCX_SERIALIZATION_MODE as x, createFolioEditor as S } from "@stll/folio-core/controller/folioEditor";
12
+ import { createFolioEditorEmitter as C } from "@stll/folio-core/controller/folioEditorEvents";
13
+ import { readFontSetSignature as oe, waitForInitialLayoutFonts as w, watchLayoutFontLoads as se } from "@stll/folio-core/controller/fontReadiness";
14
+ import { createHeaderFooterEditorManager as T } from "@stll/folio-core/controller/headerFooterEditorManager";
15
+ import { createHyphenationReadiness as ce } from "@stll/folio-core/controller/hyphenationReadiness";
16
+ import { runLayoutPipelineWithPainter as le } from "@stll/folio-core/controller/layoutPipelineExecution";
17
+ import { TRANSACTION_LAYOUT_TIMING as ue, browserClock as de, createLayoutScheduler as E } from "@stll/folio-core/controller/layoutScheduler";
18
+ import { createLayoutSession as fe } from "@stll/folio-core/controller/layoutSession";
19
+ import { createNoteEditorManager as pe } from "@stll/folio-core/controller/noteEditorManager";
20
+ import { PAGE_RENDERER as me } from "@stll/folio-core/display-list/editor/pageRenderer";
21
+ import { holdsUniqueParagraphIds as he, openCanonicalDocx as ge, prepareCanonicalDocumentInput as _e } from "@stll/folio-core/docx/canonicalSessionInput";
22
+ import { carryParseFacts as ve, cloneDocumentWithParagraphPropertySources as ye } from "@stll/folio-core/docx/document-clone";
23
+ import { getFootnoteText as be } from "@stll/folio-core/docx/storyPlainText";
24
+ import { convertHeaderFooterPmDocToContent as xe, convertHeaderFooterToContent as Se } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
25
+ import { resolveSectionHeaderFooterRefs as Ce } from "@stll/folio-core/layout-engine";
26
+ import { LayoutPainter as we, releaseDisplayPageResources as Te } from "@stll/folio-core/layout-painter";
27
+ import { LayoutSelectionGate as Ee } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
28
+ import { ExtensionManager as De } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
29
+ import { createStarterKit as Oe } from "@stll/folio-core/prosemirror/extensions/StarterKit";
30
+ import { createTemplateDirectivesPlugin as ke } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
31
+ import { createTemplatePreviewValuesPlugin as Ae } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
32
+ import { templateSlashMenuPlugin as je } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
33
+ import { resolveHeaderFooterContent as Me } from "@stll/folio-core/utils/headerFooter";
34
+ import { lockHeldRevisions as Ne, trackedChangeEntryRevisionIds as Pe } from "@stll/folio-core/prosemirror/commands/comments";
35
+ import { FindReplaceManager as Fe } from "@stll/folio-core/managers/FindReplaceManager";
36
+ import { findInDisplayedDocument as Ie } from "@stll/folio-core/prosemirror/findReplaceSelection";
37
+ import { replaceFindMatch as Le, replaceFindMatches as Re } from "@stll/folio-core/prosemirror/replaceFindMatches";
38
+ import { createFindMatchView as ze, getRenderedSearchStories as Be } from "@stll/folio-core/utils/findMatchView";
39
+ import { createDefaultFindOptions as Ve, replaceEligibility as He } from "@stll/folio-core/utils/findReplace";
40
+ import { createFindSearchKey as D, sameFindSearchKey as Ue } from "@stll/folio-core/utils/findSearchKey";
41
+ import { MIN_CELL_WIDTH_TWIPS as We, MIN_ROW_HEIGHT_TWIPS as Ge, TWIPS_PER_PIXEL as O, clampRowResizeDelta as Ke, columnResizeCommand as qe, readColumnWidthAt as Je, readColumnWidths as Ye, readRowHeight as Xe, rightEdgeResizeCommand as Ze, rowResizeCommand as k } from "@stll/folio-core/prosemirror/tableResize";
42
+ import { extractTrackedChanges as Qe } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
43
+ import { ZOOM_MAX as $e, ZOOM_MIN as A, ZOOM_STEP as j } from "@stll/folio-core/utils/zoom";
43
44
  // src/utils/colorMode.ts
44
45
  var M = "(prefers-color-scheme: dark)";
45
46
  function N() {
@@ -56,13 +57,13 @@ function F(e) {
56
57
  return t.addEventListener("change", n), () => t.removeEventListener("change", n);
57
58
  }
58
59
  // src/composables/useColorMode.ts
59
- var et = "light", I = Symbol("folioColorMode"), tt = (t = et) => {
60
- a(I, e(() => u(t)));
61
- }, L = { install(t, n = et) {
62
- t.provide(I, e(() => u(n)));
60
+ var I = "light", L = Symbol("folioColorMode"), et = (t = I) => {
61
+ a(L, e(() => u(t)));
62
+ }, R = { install(t, n = I) {
63
+ t.provide(L, e(() => u(n)));
63
64
  } };
64
- function R() {
65
- let n = t(I, e(() => et)), i = s(!1), a = s(!1);
65
+ function z() {
66
+ let n = t(L, e(() => I)), i = s(!1), a = s(!1);
66
67
  return r(() => {
67
68
  i.value = !0;
68
69
  }), f((e) => {
@@ -72,19 +73,19 @@ function R() {
72
73
  }), e(() => P(n.value, i.value && a.value));
73
74
  }
74
75
  // src/utils/rawDocument.ts
75
- var nt = (e) => z(e, /* @__PURE__ */ new Map()), z = (e, t) => {
76
+ var tt = (e) => B(e, /* @__PURE__ */ new Map()), B = (e, t) => {
76
77
  if (typeof e != "object" || !e) return e;
77
78
  let n = l(e), r = t.get(n);
78
79
  if (r !== void 0) return r;
79
80
  t.set(n, n);
80
- let i = rt(n, t);
81
+ let i = nt(n, t);
81
82
  return t.set(n, i), i;
82
- }, rt = (e, t) => {
83
+ }, nt = (e, t) => {
83
84
  if (ArrayBuffer.isView(e) || e instanceof ArrayBuffer) return e;
84
85
  if (e instanceof Map) {
85
86
  let n = !1, r = [];
86
87
  for (let [i, a] of e) {
87
- let e = z(i, t), o = z(a, t);
88
+ let e = B(i, t), o = B(a, t);
88
89
  (e !== i || o !== a) && (n = !0), r.push([e, o]);
89
90
  }
90
91
  return n ? new Map(r) : e;
@@ -92,14 +93,14 @@ var nt = (e) => z(e, /* @__PURE__ */ new Map()), z = (e, t) => {
92
93
  if (e instanceof Set) {
93
94
  let n = !1, r = [];
94
95
  for (let i of e) {
95
- let e = z(i, t);
96
+ let e = B(i, t);
96
97
  e !== i && (n = !0), r.push(e);
97
98
  }
98
99
  return n ? new Set(r) : e;
99
100
  }
100
101
  if (Array.isArray(e)) {
101
102
  let n = !1, r = e.map((e) => {
102
- let r = z(e, t);
103
+ let r = B(e, t);
103
104
  return r !== e && (n = !0), r;
104
105
  });
105
106
  return n ? r : e;
@@ -107,15 +108,15 @@ var nt = (e) => z(e, /* @__PURE__ */ new Map()), z = (e, t) => {
107
108
  let n = Object.getOwnPropertyDescriptors(e), r = !1;
108
109
  for (let e of Reflect.ownKeys(n)) {
109
110
  let i = Reflect.get(n, e);
110
- if (!it(i)) continue;
111
- let a = z(i.value, t);
111
+ if (!rt(i)) continue;
112
+ let a = B(i.value, t);
112
113
  a !== i.value && (r = !0, i.value = a);
113
114
  }
114
115
  if (!r) return e;
115
116
  let i = Object.create(Reflect.getPrototypeOf(e), n);
116
- return ye(i, e), i;
117
- }, it = (e) => typeof e == "object" && !!e && "value" in e, at = 24, ot = "User", st = [], ct = [];
118
- function lt(e) {
117
+ return ve(i, e), i;
118
+ }, rt = (e) => typeof e == "object" && !!e && "value" in e, it = 24, at = "User", ot = [], st = [];
119
+ function ct(e) {
119
120
  let t = e?.columnCount ?? 1;
120
121
  if (t <= 1) return;
121
122
  let n = {
@@ -125,24 +126,24 @@ function lt(e) {
125
126
  };
126
127
  return e?.separator !== void 0 && (n.separator = e.separator), n;
127
128
  }
128
- function ut(e, t, n, r, i, a) {
129
+ function lt(e, t, n, r, i, a) {
129
130
  if (!e) return;
130
131
  let o = t ? {
131
132
  ...a,
132
133
  rId: t
133
134
  } : a, s = t ? n?.getView(t) : null;
134
- return s ? Se(s.state.doc, r, i, o) : Ce(e, r, i, o);
135
+ return s ? xe(s.state.doc, r, i, o) : Se(e, r, i, o);
135
136
  }
136
- function dt(e, t, n, r, i) {
137
+ function ut(e, t, n, r, i) {
137
138
  if (!e || e.size === 0) return;
138
139
  let a = /* @__PURE__ */ new Map();
139
140
  for (let [o, s] of e) {
140
- let e = ut(s, o, t, n, r, i);
141
+ let e = lt(s, o, t, n, r, i);
141
142
  e && a.set(o, e);
142
143
  }
143
144
  return a.size > 0 ? a : void 0;
144
145
  }
145
- function ft(e, t, n) {
146
+ function dt(e, t, n) {
146
147
  let r = /* @__PURE__ */ new Map();
147
148
  if (!n || !n.package.footnotes) return r;
148
149
  let i = /* @__PURE__ */ new Map();
@@ -156,7 +157,7 @@ function ft(e, t, n) {
156
157
  e.push({
157
158
  displayNumber: String(o),
158
159
  noteId: n,
159
- text: xe(r),
160
+ text: be(r),
160
161
  ...a ? { content: {
161
162
  blocks: a.blocks,
162
163
  measures: a.measures,
@@ -168,7 +169,7 @@ function ft(e, t, n) {
168
169
  }
169
170
  return r;
170
171
  }
171
- var B = /* @__PURE__ */ new Set([
172
+ var V = /* @__PURE__ */ new Set([
172
173
  "black",
173
174
  "blue",
174
175
  "cyan",
@@ -187,49 +188,43 @@ var B = /* @__PURE__ */ new Set([
187
188
  "white",
188
189
  "yellow"
189
190
  ]);
190
- function pt(e) {
191
+ function ft(e) {
191
192
  let t = [], n = (e, r) => {
192
- for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !B.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
193
+ for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !V.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
193
194
  e.forEach((e, t, i) => {
194
195
  n(e, `${r}.content[${i}]`);
195
196
  });
196
197
  };
197
198
  return n(e, "doc"), t.join("; ");
198
199
  }
199
- function V(e) {
200
- let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: o = !1, pageGap: l = at, pageRenderer: f, markupView: ee = "all-markup", showCommentHighlights: g = !0, altChunkMarkerText: _, showMarginGuides: v, marginGuideColor: S, password: ye, editorMode: xe, author: Se, externalPlugins: Ce = [], historyShortcuts: Pe = "editor", onCanonicalHistory: Fe, onCanonicalHistoryDrop: Ie, collaboration: Le, getAnonymizationTerms: Re, getDerivedFields: ze, showTemplateDirectives: Be, onSlashMenuChange: Ve, onSlashMenuKeyAction: He, onChange: Ue, onError: E, onSelectionUpdate: We, onEditorViewReady: D, onCopy: Ge, onCut: O, onPaste: Ke, onReadOnlyEditAttempt: qe, featureFlags: Je, onSelectiveSaveTripwire: Ye } = e, Xe = n ?? t, Ze = () => u(Se) ?? ot, k = c(null), A = () => {
200
+ function H(e) {
201
+ let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: o = !1, pageGap: l = it, pageRenderer: f, markupView: ee = "all-markup", showCommentHighlights: g = !0, altChunkMarkerText: _, showMarginGuides: v, marginGuideColor: b, password: ve, editorMode: be, author: xe, externalPlugins: Se = [], historyShortcuts: Ne = "editor", onCanonicalHistory: Pe, onCanonicalHistoryDrop: Fe, collaboration: Ie, getAnonymizationTerms: Le, getDerivedFields: Re, showTemplateDirectives: ze, onSlashMenuChange: Be, onSlashMenuKeyAction: Ve, onChange: He, onError: D, onSelectionUpdate: Ue, onEditorViewReady: We, onCopy: Ge, onCut: O, onPaste: Ke, onReadOnlyEditAttempt: qe, featureFlags: Je, onSelectiveSaveTripwire: Ye } = e, Xe = n ?? t, Ze = () => u(xe) ?? at, k = c(null), Qe = () => {
201
202
  let e = k.value;
202
- return (e && x(e).package.styles) ?? null;
203
- }, Qe = c(null), j = 0, $e = !1, M = 0, N = !1, P = c(null), F = c(null), et = () => u(Le), I = c([]), tt = c(null), L = c(null), R = c(null), z = s(0), rt = c([]), it = c([]), B = s(!1), V = s(null), H = s(!1), mt = (e) => be(e), ht = (e) => {
204
- let t = mt(e);
205
- Ue?.(t), G.emit("docChange", t);
206
- }, gt = (e, t) => {
207
- let n = new p({
208
- ground: { gap: e },
209
- message: b(e, t)
210
- });
211
- return E?.(n), !0;
212
- }, U = new Oe(ke({ historyShortcuts: Pe }));
213
- U.buildSchema(), U.initializeRuntime();
214
- let _t = Ae(), vt = Me({
215
- onChange: (e) => Ve?.(e),
216
- onKeyAction: (e) => He?.(e) ?? !1
217
- }), yt = je(), W = () => u(Be) === !0;
218
- function bt() {
203
+ return (e && y(e).package.styles) ?? null;
204
+ }, $e = c(null), A = 0, j = !1, M = 0, N = !1, P = c(null), F = c(null), I = () => u(Ie), L = c([]), et = c(null), R = c(null), z = c(null), B = s(0), nt = c([]), rt = c([]), V = s(!1), H = s(null), U = s(!1), pt = (e) => ye(e), mt = (e) => {
205
+ let t = pt(e);
206
+ He?.(t), G.emit("docChange", t);
207
+ }, W = new De(Oe({ historyShortcuts: Ne }));
208
+ W.buildSchema(), W.initializeRuntime();
209
+ let ht = ke(), gt = je({
210
+ onChange: (e) => Be?.(e),
211
+ onKeyAction: (e) => Ve?.(e) ?? !1
212
+ }), _t = Ae(), vt = () => u(ze) === !0;
213
+ function yt() {
219
214
  return [
220
- ...Ce,
221
- ...W() ? [_t, vt] : [],
222
- yt
215
+ ...Se,
216
+ ...vt() ? [ht, gt] : [],
217
+ _t
223
218
  ];
224
219
  }
225
- let G = ae(), K = new De(), q = me(), xt = ue({
220
+ let G = C(), K = new Ee(), q = fe(), bt = ce({
226
221
  relayout: () => {
227
222
  let e = P.value?.state ?? q.lastEditorState;
228
223
  e && X(e, { reason: "hyphenation-ready" });
229
224
  },
230
- onError: (e) => E?.(e)
225
+ onError: (e) => D?.(e)
231
226
  });
232
- i(xt.cancel), i(ce({
227
+ i(bt.cancel), i(se({
233
228
  measuredFontSet: () => q.lastMeasureInputs?.fontSet ?? null,
234
229
  relayout: () => {
235
230
  if (N) return;
@@ -237,55 +232,55 @@ function V(e) {
237
232
  e && X(e, { reason: "font-ready" });
238
233
  }
239
234
  }));
240
- let St = new Te({
235
+ let xt = new we({
241
236
  pageGap: l,
242
237
  showShadow: !0
243
- }), Ct = le({
238
+ }), St = T({
244
239
  getHost: () => Xe.value,
245
240
  getReadOnly: () => u(o),
246
241
  getCanonicalApi: () => $.api,
247
242
  readCanonicalDocument: () => $.readCanonicalDocument(),
248
243
  onSessionRefusal: (e, t, n) => {
249
- V.value = e, E?.(n ?? new p({
244
+ H.value = e, D?.(n ?? new p({
250
245
  ground: t,
251
246
  message: e
252
247
  }));
253
248
  },
254
- getStyles: A,
249
+ getStyles: Qe,
255
250
  onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
256
- if (r && (H.value = !0, Z.schedule()), r || i) {
251
+ if (r && (U.value = !0, Z.schedule()), r || i) {
257
252
  let { from: r, to: i } = n.state.selection;
258
- tt.value = {
253
+ et.value = {
259
254
  from: r,
260
255
  kind: t,
261
256
  rId: e,
262
257
  to: i
263
- }, We?.(n.state), G.emit("selectionChange", {
258
+ }, Ue?.(n.state), G.emit("selectionChange", {
264
259
  from: r,
265
260
  to: i
266
261
  });
267
262
  }
268
263
  K.requestRender();
269
264
  }
270
- }), J = he({
265
+ }), J = pe({
271
266
  getHost: () => r?.value ?? null,
272
267
  getCanonicalApi: () => $.api,
273
268
  readCanonicalDocument: () => $.readCanonicalDocument(),
274
269
  onSessionRefusal: (e, t, n) => {
275
- V.value = e, E?.(n ?? new p({
270
+ H.value = e, D?.(n ?? new p({
276
271
  ground: t,
277
272
  message: e
278
273
  }));
279
274
  },
280
- getStyles: A,
275
+ getStyles: Qe,
281
276
  onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
282
277
  if (e) {
283
- H.value = !0;
278
+ U.value = !0;
284
279
  let e = k.value;
285
280
  e && (k.value = $.readCanonicalDocument() ?? e, Ot()), Z.schedule();
286
281
  }
287
282
  if (e || t) {
288
- We?.(n.state);
283
+ Ue?.(n.state);
289
284
  let { from: e, to: t } = n.state.selection;
290
285
  G.emit("selectionChange", {
291
286
  from: e,
@@ -294,29 +289,38 @@ function V(e) {
294
289
  }
295
290
  }
296
291
  }), Y = () => {
297
- Ct.sync(), J.sync();
292
+ St.sync(), J.sync();
298
293
  };
299
- function wt(e) {
300
- e.layout && (R.value = e.layout), e.blocks && (rt.value = e.blocks), e.measures && (it.value = e.measures), e.blockLookup && St.setBlockLookup(e.blockLookup), e.layout && G.emit("layoutComplete", e.layout);
301
- }
294
+ function Ct(e) {
295
+ e.layout && (z.value = e.layout), e.blocks && (nt.value = e.blocks), e.measures && (rt.value = e.measures), e.blockLookup && xt.setBlockLookup(e.blockLookup), e.layout && G.emit("layoutComplete", e.layout);
296
+ }
297
+ let wt = ie({
298
+ onReady: () => {
299
+ if (j || u(f) !== me.displayList) return;
300
+ let e = P.value;
301
+ e && X(e.state, { reason: "layout-input" });
302
+ },
303
+ onError: (e) => {
304
+ !j && u(f) === me.displayList && D?.(e);
305
+ }
306
+ });
302
307
  function X(e, t = {}) {
303
308
  if (N) return;
304
- let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = k.value, o = i && x(i), s = o?.package.document, c = s?.sections?.[0]?.properties ?? s?.finalSectionProperties ?? null, d = ne(c), p = te(c), m = lt(c), h = d.w - p.left - p.right;
305
- z.value = h;
306
- let y = o?.package.styles ?? null, b = i?.package.theme ?? null, re = i?.package.settings?.defaultTabStop, C = i?.package.settings?.mirrorMargins === !0, w = Ne(o?.package);
309
+ let n = u(f), r = n === me.displayList ? wt() : void 0;
310
+ if (n === me.displayList && !r) return;
311
+ let i = a.value, o = i instanceof HTMLDivElement ? i : null, s = k.value, c = s && y(s), d = c?.package.document, p = d?.sections?.[0]?.properties ?? d?.finalSectionProperties ?? null, m = ne(p), h = te(p), re = ct(p), ie = m.w - h.left - h.right;
312
+ B.value = ie;
313
+ let ae = c?.package.styles ?? null, x = s?.package.theme ?? null, S = s?.package.settings?.defaultTabStop, C = s?.package.settings?.mirrorMargins === !0, w = Me(c?.package);
307
314
  try {
308
- wt(de({
309
- contentWidth: h,
310
- columns: m,
311
- pageSize: d,
312
- margins: p,
315
+ Ct(le({
316
+ contentWidth: ie,
317
+ columns: re,
318
+ pageSize: m,
319
+ margins: h,
313
320
  pageGap: l,
314
321
  showMarginGuides: u(v) === !0,
315
- marginGuideColor: u(S),
316
- ...(() => {
317
- let e = u(f);
318
- return e === void 0 ? {} : { pageRenderer: e };
319
- })(),
322
+ marginGuideColor: u(b),
323
+ ...r ? { displayListPagePainter: r } : {},
320
324
  syncCoordinator: K,
321
325
  headerContent: w.headerContent,
322
326
  footerContent: w.footerContent,
@@ -326,48 +330,48 @@ function V(e) {
326
330
  footerContentRId: w.activeFooterRId,
327
331
  firstPageHeaderContentRId: w.activeFirstHeaderRId,
328
332
  firstPageFooterContentRId: w.activeFirstFooterRId,
329
- sectionHeaderFooterRefs: we(o),
330
- theme: b,
331
- sectionProperties: c,
332
- document: i,
333
- defaultTabStop: re,
333
+ sectionHeaderFooterRefs: Ce(c),
334
+ theme: x,
335
+ sectionProperties: p,
336
+ document: s,
337
+ defaultTabStop: S,
334
338
  mirrorMargins: C,
335
- styles: y,
336
- layout: R.value,
337
- hfPMs: Ct,
338
- painter: St,
339
- pagesContainer: r,
339
+ styles: ae,
340
+ layout: z.value,
341
+ hfPMs: St,
342
+ painter: xt,
343
+ pagesContainer: o,
340
344
  session: q,
341
- renderHfFromContentOrPm: ut,
342
- renderHeaderFooterContentByRId: dt,
345
+ renderHfFromContentOrPm: lt,
346
+ renderHeaderFooterContentByRId: ut,
343
347
  readFontSetSignature: oe,
344
- buildFootnoteRenderItems: ft,
345
- describeInvalidHighlightMarks: pt,
346
- emptyTemplatePreviewEntries: st,
347
- emptyTemplatePreviewHidden: ct,
348
- hyphenationReadiness: xt,
348
+ buildFootnoteRenderItems: dt,
349
+ describeInvalidHighlightMarks: ft,
350
+ emptyTemplatePreviewEntries: ot,
351
+ emptyTemplatePreviewHidden: st,
352
+ hyphenationReadiness: bt,
349
353
  markupView: u(ee),
350
354
  showCommentHighlights: u(g),
351
355
  ..._ === void 0 ? {} : { altChunkMarkerText: u(_) }
352
356
  }, e, t));
353
357
  } catch (e) {
354
358
  let t = e instanceof Error ? e : Error(String(e));
355
- E?.(t);
359
+ D?.(t);
356
360
  }
357
361
  }
358
- let Z = pe({
362
+ let Z = E({
359
363
  readState: () => P.value?.state ?? null,
360
364
  runLayout: (e, t) => X(e, t),
361
- ...fe,
362
- clock: T
365
+ ...ue,
366
+ clock: de
363
367
  }), Q = null;
364
368
  function Tt() {
365
369
  if (Q !== null && (window.clearTimeout(Q), Q = null), P.value && k.value) try {
366
370
  let e = $.readCanonicalDocument();
367
371
  if (!e) return;
368
- k.value = e, Y(), Dt(), ht(e);
372
+ k.value = e, Y(), Dt(), mt(e);
369
373
  } catch (e) {
370
- E?.(e instanceof Error ? e : Error(String(e)));
374
+ D?.(e instanceof Error ? e : Error(String(e)));
371
375
  }
372
376
  }
373
377
  let Et = null;
@@ -378,42 +382,42 @@ function V(e) {
378
382
  Dt(), Et = window.setTimeout(() => {
379
383
  if (Et = null, Q !== null) return;
380
384
  let e = k.value;
381
- e && ht(e);
382
- }, C);
385
+ e && mt(e);
386
+ }, ae);
383
387
  }
384
388
  function kt() {
385
389
  Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
386
390
  Q = null, Tt();
387
- }, C);
391
+ }, ae);
388
392
  }
389
393
  let $ = m({
390
394
  getHost: () => t.value,
391
395
  getDocument: () => k.value,
392
- getStyles: A,
393
- getExtensionManager: () => U,
394
- getExternalPlugins: bt,
395
- getAnonymizationTerms: () => Re?.() ?? re,
396
- getDerivedFields: () => ze?.(),
397
- getCanonicalRoom: et,
396
+ getStyles: Qe,
397
+ getExtensionManager: () => W,
398
+ getExternalPlugins: yt,
399
+ getAnonymizationTerms: () => Le?.() ?? re,
400
+ getDerivedFields: () => Re?.(),
401
+ getCanonicalRoom: I,
398
402
  getReadOnly: () => u(o),
399
- getHistoryShortcuts: () => Pe,
400
- onCanonicalHistory: (e) => Fe?.(e),
401
- onCanonicalHistoryDrop: (e) => Ie?.(e),
402
- getEditingMode: () => u(xe) ?? "editing",
403
+ getHistoryShortcuts: () => Ne,
404
+ onCanonicalHistory: (e) => Pe?.(e),
405
+ onCanonicalHistoryDrop: (e) => Fe?.(e),
406
+ getEditingMode: () => u(be) ?? "editing",
403
407
  getSuggestionAuthor: Ze,
404
408
  onSessionRefusal: (e, t, n) => {
405
- E?.(n ?? new p({
409
+ D?.(n ?? new p({
406
410
  ground: t,
407
411
  message: e
408
412
  }));
409
413
  },
410
- getDocumentIdentity: () => String(j),
414
+ getDocumentIdentity: () => String(A),
411
415
  getDocumentContext: () => k.value,
412
416
  onTransaction: jt,
413
417
  onCanonicalCompositionLayout: Mt,
414
418
  getEmbeddedFontFamilyMap: () => q.embeddedFontFamilyMap,
415
419
  onSelectionChange: (e) => {
416
- F.value = e, We?.(e), G.emit("selectionChange", {
420
+ F.value = e, Ue?.(e), G.emit("selectionChange", {
417
421
  from: e.selection.from,
418
422
  to: e.selection.to
419
423
  });
@@ -425,19 +429,19 @@ function V(e) {
425
429
  onReadOnlyEditAttempt: () => qe?.(),
426
430
  onEditorViewReady: Nt,
427
431
  onEditorViewDestroy: () => {
428
- P.value = null, B.value = !1, D?.(null);
432
+ P.value = null, V.value = !1, We?.(null);
429
433
  },
430
434
  onRemoteSelectionsChange: (e) => {
431
- I.value = e;
435
+ L.value = e;
432
436
  }
433
437
  }), At = $.api.autocomplete.subscribe((t) => e.onAutocompleteChange?.(t));
434
- d(() => u(Le), () => {
435
- I.value = [], $.retryViewCreation(), $.syncExternalDocument();
438
+ d(() => u(Ie), () => {
439
+ L.value = [], $.retryViewCreation(), $.syncExternalDocument();
436
440
  }, { immediate: !0 });
437
441
  function jt({ newState: e, docChanged: t }) {
438
442
  if (F.value = e, t) {
439
443
  let e = $.readCanonicalDocument();
440
- e && (k.value = e, Y()), H.value = !0, K.incrementStateSeq(), Z.schedule(), kt();
444
+ e && (k.value = e, Y()), U.value = !0, K.incrementStateSeq(), Z.schedule(), kt();
441
445
  }
442
446
  K.requestRender();
443
447
  }
@@ -446,13 +450,13 @@ function V(e) {
446
450
  e && (F.value = e.state), K.incrementStateSeq(), Z.schedule(), K.requestRender();
447
451
  }
448
452
  function Nt(e) {
449
- P.value = e, F.value = e.state, B.value = !0;
450
- let t = k.value, n = j, r = ++M;
453
+ P.value = e, F.value = e.state, V.value = !0;
454
+ let t = k.value, n = A, r = ++M;
451
455
  N = !0;
452
456
  let i = () => {
453
- M === r && (N = !1, $e || j !== n || $.getView() !== e || (X(e.state, { reason: "initial" }), K.requestRender()));
457
+ M === r && (N = !1, j || A !== n || $.getView() !== e || (X(e.state, { reason: "initial" }), K.requestRender()));
454
458
  };
455
- se(t, e.state.doc).then(i, i), D?.(e), u(o) || requestAnimationFrame(() => {
459
+ w(t, e.state.doc).then(i, i), We?.(e), u(o) || requestAnimationFrame(() => {
456
460
  P.value === e && !e.hasFocus() && e.focus();
457
461
  });
458
462
  }
@@ -463,32 +467,32 @@ function V(e) {
463
467
  },
464
468
  loadDocument: Ht,
465
469
  loadDocx: Vt
466
- }, Ft = ie({
470
+ }, Ft = S({
467
471
  getEditorApi: () => $.api,
468
- getLayout: () => R.value,
472
+ getLayout: () => z.value,
469
473
  runLayout: (e, t) => X(e, t),
470
474
  getDocumentIO: () => Pt,
471
475
  emitter: G
472
476
  });
473
- d([() => u(xe), Ze], () => {
474
- Ft.setCanonicalMode(u(xe) === "suggesting" ? {
477
+ d([() => u(be), Ze], () => {
478
+ Ft.setCanonicalMode(u(be) === "suggesting" ? {
475
479
  type: "suggesting",
476
480
  author: Ze()
477
481
  } : { type: "editing" });
478
482
  }), d(() => u(o), (e) => {
479
- $.syncEditable(), e && en(), Ct.sync();
483
+ $.syncEditable(), e && en(), St.sync();
480
484
  });
481
485
  function It(e) {
482
- let t = W();
483
- if (t === e.state.plugins.includes(_t)) return;
484
- let n = e.state.plugins.filter((e) => e !== _t && e !== vt);
486
+ let t = vt();
487
+ if (t === e.state.plugins.includes(ht)) return;
488
+ let n = e.state.plugins.filter((e) => e !== ht && e !== gt);
485
489
  if (t) {
486
- let e = n.indexOf(yt), t = e === -1 ? n.length : e;
487
- n.splice(t, 0, _t, vt);
490
+ let e = n.indexOf(_t), t = e === -1 ? n.length : e;
491
+ n.splice(t, 0, ht, gt);
488
492
  }
489
493
  e.updateState(e.state.reconfigure({ plugins: n }));
490
494
  }
491
- d(() => W(), () => {
495
+ d(() => vt(), () => {
492
496
  let e = P.value;
493
497
  e && It(e);
494
498
  });
@@ -496,27 +500,27 @@ function V(e) {
496
500
  $.ensureView();
497
501
  }
498
502
  function Rt() {
499
- Dt(), j += 1, Qe.value = k.value?.originalBuffer ?? null, H.value = !1, tt.value = null, L.value = null, J.activate(null), Z.dispose(), $.destroyView(), $.ensureView(), Y(), $.ensureView(), $.getView() || zt();
503
+ Dt(), A += 1, $e.value = k.value?.originalBuffer ?? null, U.value = !1, et.value = null, R.value = null, J.activate(null), Z.dispose(), $.destroyView(), $.ensureView(), Y(), $.ensureView(), $.getView() || zt();
500
504
  }
501
505
  function zt() {
502
506
  let e = k.value;
503
507
  if (e) try {
504
508
  let t = h({
505
509
  document: e,
506
- styles: x(e).package.styles ?? null,
507
- manager: U,
508
- externalPlugins: bt(),
510
+ styles: y(e).package.styles ?? null,
511
+ manager: W,
512
+ externalPlugins: yt(),
509
513
  reason: "mount"
510
514
  });
511
515
  F.value = t;
512
- let n = j, r = ++M;
516
+ let n = A, r = ++M;
513
517
  N = !0;
514
518
  let i = () => {
515
- M === r && (N = !1, $e || j !== n || k.value !== e || $.getView() || X(t, { reason: "initial" }));
519
+ M === r && (N = !1, j || A !== n || k.value !== e || $.getView() || X(t, { reason: "initial" }));
516
520
  };
517
- se(e, t.doc).then(i, i);
521
+ w(e, t.doc).then(i, i);
518
522
  } catch (e) {
519
- E?.(e instanceof Error ? e : Error(String(e)));
523
+ D?.(e instanceof Error ? e : Error(String(e)));
520
524
  }
521
525
  }
522
526
  d([
@@ -529,26 +533,26 @@ function V(e) {
529
533
  }, { flush: "post" });
530
534
  let Bt = 0;
531
535
  async function Vt(e) {
532
- Bt += 1, V.value = null, B.value = !1;
536
+ Bt += 1, H.value = null, V.value = !1;
533
537
  try {
534
- let t = await _e(e, { password: u(ye) });
538
+ let t = await ge(e, { password: u(ve) });
535
539
  if (t.isErr()) throw t.error;
536
540
  let n = t.value.document;
537
541
  k.value = n, Rt();
538
542
  } catch (e) {
539
543
  let t = e instanceof Error ? e : Error(String(e));
540
- V.value = t.message, E?.(t);
544
+ H.value = t.message, D?.(t);
541
545
  }
542
546
  }
543
547
  function Ht(e) {
544
548
  let t = Bt += 1;
545
- V.value = null;
546
- let n = nt(e);
547
- ge(n) ? Wt(n) : Ut(n, t);
549
+ H.value = null;
550
+ let n = tt(e);
551
+ he(n) ? Wt(n) : Ut(n, t);
548
552
  }
549
553
  async function Ut(e, t) {
550
- let n = await ve(e);
551
- t === Bt && (n.isErr() ? (V.value = n.error.message, E?.(n.error)) : Wt(n.value));
554
+ let n = await _e(e);
555
+ t === Bt && (n.isErr() ? (H.value = n.error.message, D?.(n.error)) : Wt(n.value));
552
556
  }
553
557
  function Wt(e) {
554
558
  k.value = e, Rt();
@@ -564,12 +568,12 @@ function V(e) {
564
568
  options: e,
565
569
  featureFlags: n
566
570
  });
567
- for (let t of a.diagnostics) e?.onDiagnostic || E?.(r(t));
571
+ for (let t of a.diagnostics) e?.onDiagnostic || D?.(r(t));
568
572
  return a;
569
573
  }
570
574
  return null;
571
575
  } catch (e) {
572
- return E?.(e instanceof Error ? e : Error(String(e))), null;
576
+ return D?.(e instanceof Error ? e : Error(String(e))), null;
573
577
  }
574
578
  }
575
579
  async function Kt(e) {
@@ -577,12 +581,12 @@ function V(e) {
577
581
  onDiagnostic: e?.onDiagnostic,
578
582
  onSelectiveDecline: e?.onSelectiveDecline,
579
583
  onSerializationPath: e?.onSerializationPath,
580
- mode: e?.selective === !1 ? w.full : w.preferSelective
584
+ mode: e?.selective === !1 ? x.full : x.preferSelective
581
585
  });
582
586
  return r ? (P.value === t && t?.state.doc === n?.doc && (r.version === void 0 || $.api.isCanonicalSaveCurrent(r.version)) && (r.version !== void 0 && $.api.markCanonicalSaved(r.version, {
583
587
  buffer: r.buffer,
584
588
  path: r.path
585
- }), k.value = r.document, Y(), H.value = !1), r.tripwireResult && Ye?.(r.tripwireResult), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
589
+ }), k.value = r.document, Y(), U.value = !1), r.tripwireResult && Ye?.(r.tripwireResult), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
586
590
  }
587
591
  function qt() {
588
592
  return $.readCanonicalDocument();
@@ -592,30 +596,30 @@ function V(e) {
592
596
  }
593
597
  function Yt() {
594
598
  let e = Jt();
595
- return e && mt(e);
599
+ return e && pt(e);
596
600
  }
597
601
  function Xt(e) {
598
- gt(y.modelEdits, "Direct document model changes are unavailable in this session.") || (k.value = nt(e), Dt(), Qe.value = e.originalBuffer ?? null, Y(), L.value && !J.getView(L.value) && (L.value = null));
602
+ Ht(e);
599
603
  }
600
604
  function Zt(e) {
601
- return Ct.getView(e);
605
+ return St.getView(e);
602
606
  }
603
607
  function Qt() {
604
608
  Y();
605
609
  }
606
610
  function $t(e) {
607
611
  let t = J.activate(e);
608
- t && (L.value = e, requestAnimationFrame(() => t.focus()));
612
+ t && (R.value = e, requestAnimationFrame(() => t.focus()));
609
613
  }
610
614
  function en() {
611
- J.activate(null), L.value = null;
615
+ J.activate(null), R.value = null;
612
616
  }
613
617
  function tn() {
614
- let e = L.value;
618
+ let e = R.value;
615
619
  return e ? J.getView(e) : null;
616
620
  }
617
621
  function nn() {
618
- return U.getCommands();
622
+ return W.getCommands();
619
623
  }
620
624
  function rn() {
621
625
  let e = tn();
@@ -627,14 +631,14 @@ function V(e) {
627
631
  }
628
632
  d([
629
633
  () => u(v),
630
- () => u(S),
634
+ () => u(b),
631
635
  () => u(f),
632
636
  () => u(ee),
633
637
  () => u(g),
634
638
  () => u(_)
635
639
  ], () => an());
636
640
  function on() {
637
- $e = !0, a.value && Ee(a.value), M += 1, N = !1, Z.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), Dt(), $.destroyView(), I.value = [], Ct.destroy(), J.destroy(), U.destroy(), F.value = null, R.value = null, k.value = null, Qe.value = null, B.value = !1;
641
+ j = !0, a.value && Te(a.value), M += 1, N = !1, Z.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), Dt(), $.destroyView(), L.value = [], St.destroy(), J.destroy(), W.destroy(), F.value = null, z.value = null, k.value = null, $e.value = null, V.value = !1;
638
642
  }
639
643
  return i(() => {
640
644
  on(), At();
@@ -645,19 +649,19 @@ function V(e) {
645
649
  editor: Ft,
646
650
  editorView: P,
647
651
  editorState: F,
648
- remoteSelections: I,
649
- headerFooterSelection: tt,
650
- activeNoteStory: L,
651
- isReady: B,
652
- isDirty: H,
653
- parseError: V,
652
+ remoteSelections: L,
653
+ headerFooterSelection: et,
654
+ activeNoteStory: R,
655
+ isReady: V,
656
+ isDirty: U,
657
+ parseError: H,
654
658
  modelDocument: k,
655
659
  readDocumentModel: qt,
656
- sourceBuffer: Qe,
657
- hiddenEditorWidth: z,
658
- layout: R,
659
- blocks: rt,
660
- measures: it,
660
+ sourceBuffer: $e,
661
+ hiddenEditorWidth: B,
662
+ layout: z,
663
+ blocks: nt,
664
+ measures: rt,
661
665
  syncCoordinator: K,
662
666
  loadBuffer: Vt,
663
667
  loadDocument: Ht,
@@ -677,15 +681,15 @@ function V(e) {
677
681
  };
678
682
  }
679
683
  // src/composables/useFindReplace.ts
680
- function H({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot: l, revealComment: u, displayMode: f, readOnly: p, onReadonlyEditAttempt: m, onResultChange: h }) {
681
- let g = new Ie(), _ = s(""), te = s(""), ne = o(He()), v = c([]), y = s(-1), b = e(() => v.value.at(y.value) ?? null), x = () => ee({
684
+ function U({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot: l, revealComment: u, displayMode: f, readOnly: p, onReadonlyEditAttempt: m, onResultChange: h }) {
685
+ let g = new Fe(), _ = s(""), te = s(""), ne = o(Ve()), v = c([]), y = s(-1), b = e(() => v.value.at(y.value) ?? null), re = () => ee({
682
686
  editingMode: t.value?.editable === !1 ? "viewing" : "editing",
683
687
  readOnlyProp: p.value,
684
688
  displayMode: f.value
685
- }), S = e(x), re = e(() => {
689
+ }), ie = e(re), ae = e(() => {
686
690
  let e = b.value;
687
- return x() === null && !!t.value && !!e && oe() && Ue(e).status === "allowed";
688
- }), C = null, w, ie = null, ae = (e) => {
691
+ return re() === null && !!t.value && !!e && w() && He(e).status === "allowed";
692
+ }), x = null, S, C = null, oe = (e) => {
689
693
  let n = t.value?.state.doc;
690
694
  return {
691
695
  query: _.value,
@@ -696,54 +700,54 @@ function H({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot:
696
700
  },
697
701
  document: e,
698
702
  ...n ? { bodyVersion: n } : {},
699
- context: { renderedStories: Ve(a.value) }
703
+ context: { renderedStories: Be(a.value) }
700
704
  };
701
- }, oe = () => {
705
+ }, w = () => {
702
706
  let e = r();
703
- return !!e && We(ie, E(ae(e)));
704
- }, se = () => g.getResult(), ce = () => h(se()), le = () => {
705
- clearTimeout(w), w = void 0;
707
+ return !!e && Ue(C, D(oe(e)));
708
+ }, se = () => g.getResult(), T = () => h(se()), ce = () => {
709
+ clearTimeout(S), S = void 0;
710
+ }, le = () => {
711
+ ce(), g.clear(), x?.destroy(), x = null, v.value = [], C = null, y.value = -1;
706
712
  }, ue = () => {
707
- le(), g.clear(), C?.destroy(), C = null, v.value = [], ie = null, y.value = -1;
708
- }, de = () => {
709
- ue(), _.value = "", ce();
710
- }, fe = (e) => (y.value = e, C?.navigate(e, u), ce(), !0), T = (e = "query") => {
711
- le();
713
+ le(), _.value = "", T();
714
+ }, de = (e) => (y.value = e, x?.navigate(e, u), T(), !0), E = (e = "query") => {
715
+ ce();
712
716
  let i = r(), o = n.value, s = t.value?.state.doc;
713
- if (!i || !_.value.trim()) return de(), [];
714
- let c = ae(i), u = Le({
717
+ if (!i || !_.value.trim()) return ue(), [];
718
+ let c = oe(i), u = Ie({
715
719
  document: c.document,
716
720
  state: t.value?.state ?? null,
717
721
  searchText: c.query,
718
722
  options: c.options,
719
723
  context: c.context
720
724
  });
721
- if (u === null) return ue(), ce(), [];
722
- let d = E(c), f = e === "refresh" && ie?.query === d.query, p = g.setMatches(u, f ? g.getResult()?.currentIndex ?? 0 : 0);
723
- return ie = d, v.value = u, y.value = u.length > 0 ? p.currentIndex : -1, C?.destroy(), C = o ? Be({
725
+ if (u === null) return le(), T(), [];
726
+ let d = D(c), f = e === "refresh" && C?.query === d.query, p = g.setMatches(u, f ? g.getResult()?.currentIndex ?? 0 : 0);
727
+ return C = d, v.value = u, y.value = u.length > 0 ? p.currentIndex : -1, x?.destroy(), x = o ? ze({
724
728
  container: o,
725
729
  document: i,
726
730
  bodyDoc: s,
727
731
  matches: u,
728
732
  commentRoot: l?.value ?? void 0,
729
733
  layout: a.value
730
- }) : null, C?.paint(y.value), u.at(0) && !f ? fe(0) : ce(), u;
731
- }, pe = () => {
732
- le(), w = setTimeout(() => T("refresh"), 120);
733
- }, me = (e, t) => (_.value = e, Object.assign(ne, He(), t), T(), se()), he = (e) => {
734
+ }) : null, x?.paint(y.value), u.at(0) && !f ? de(0) : T(), u;
735
+ }, fe = () => {
736
+ ce(), S = setTimeout(() => E("refresh"), 120);
737
+ }, pe = (e, t) => (_.value = e, Object.assign(ne, Ve(), t), E(), se()), me = (e) => {
734
738
  let t = g.goTo(e);
735
- return t ? fe(t.index) : !1;
736
- }, ge = (e) => {
739
+ return t ? de(t.index) : !1;
740
+ }, he = (e) => {
737
741
  let t = g.navigate(e);
738
- return t ? (fe(t.index), t.match) : null;
739
- }, _e = () => !oe() && (T("refresh"), !0), ve = () => {
740
- let e = x();
742
+ return t ? (de(t.index), t.match) : null;
743
+ }, ge = () => !w() && (E("refresh"), !0), _e = () => {
744
+ let e = re();
741
745
  return e !== null && (m?.(e), !0);
742
746
  };
743
747
  return d(f, () => {
744
- _.value.trim() && T();
748
+ _.value.trim() && E();
745
749
  }), i(() => {
746
- le(), C?.destroy();
750
+ ce(), x?.destroy();
747
751
  }), {
748
752
  searchText: _,
749
753
  replaceText: te,
@@ -751,36 +755,36 @@ function H({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot:
751
755
  matches: v,
752
756
  currentIndex: y,
753
757
  currentMatch: b,
754
- canReplaceCurrent: re,
755
- replacementRefusal: S,
756
- performSearch: T,
757
- scheduleSearch: pe,
758
- find: me,
758
+ canReplaceCurrent: ae,
759
+ replacementRefusal: ie,
760
+ performSearch: E,
761
+ scheduleSearch: fe,
762
+ find: pe,
759
763
  getFindResult: se,
760
- goToMatch: he,
761
- findNext: () => ge("next"),
762
- findPrevious: () => ge("previous"),
764
+ goToMatch: me,
765
+ findNext: () => he("next"),
766
+ findPrevious: () => he("previous"),
763
767
  replaceCurrent: () => {
764
768
  let e = t.value;
765
- if (!e || ve() || _e()) return !1;
769
+ if (!e || _e() || ge()) return !1;
766
770
  let n = b.value;
767
- if (!re.value || !n) return !1;
768
- let r = e.state.doc, i = Re(e, n, te.value);
769
- return e.state.doc !== r && T("refresh"), i;
771
+ if (!ae.value || !n) return !1;
772
+ let r = e.state.doc, i = Le(e, n, te.value);
773
+ return e.state.doc !== r && E("refresh"), i;
770
774
  },
771
775
  replaceAll: () => {
772
776
  let e = t.value, n = v.value.length;
773
- if (!e || ve() || _e()) return {
777
+ if (!e || _e() || ge()) return {
774
778
  replacedCount: 0,
775
779
  skippedCount: n
776
780
  };
777
- let r = e.state.doc, i = ze(e, v.value, te.value);
778
- return e.state.doc !== r && T(), i;
781
+ let r = e.state.doc, i = Re(e, v.value, te.value);
782
+ return e.state.doc !== r && E(), i;
779
783
  },
780
- clear: de
784
+ clear: ue
781
785
  };
782
786
  }
783
- function mt(e, t) {
787
+ function pt(e, t) {
784
788
  if (t < e.top + 40) {
785
789
  let n = Math.max(0, e.top + 40 - t);
786
790
  return -Math.min(12, n / 40 * 12);
@@ -792,7 +796,7 @@ function mt(e, t) {
792
796
  return 0;
793
797
  }
794
798
  // src/composables/useDragAutoScroll.ts
795
- function ht({ pagesContainer: e, onScrollExtendSelection: t }) {
799
+ function mt({ pagesContainer: e, onScrollExtendSelection: t }) {
796
800
  let n = null, r = 0, a = 0, o = !1;
797
801
  function s() {
798
802
  return g(e.value);
@@ -804,7 +808,7 @@ function ht({ pagesContainer: e, onScrollExtendSelection: t }) {
804
808
  if (!o) return;
805
809
  let e = s();
806
810
  if (!e) return;
807
- let i = mt(e.getBoundingClientRect(), a);
811
+ let i = pt(e.getBoundingClientRect(), a);
808
812
  i !== 0 && (_(e, i), t(r, a)), n = requestAnimationFrame(l);
809
813
  }
810
814
  function u() {
@@ -824,7 +828,7 @@ function ht({ pagesContainer: e, onScrollExtendSelection: t }) {
824
828
  };
825
829
  }
826
830
  // src/composables/useTableResize.ts
827
- function gt({ runCommand: e }) {
831
+ function W({ runCommand: e }) {
828
832
  let t = {
829
833
  active: !1,
830
834
  startX: 0,
@@ -857,7 +861,7 @@ function gt({ runCommand: e }) {
857
861
  }
858
862
  function o(e, a) {
859
863
  let o = e.target;
860
- return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (e.preventDefault(), e.stopPropagation(), i = a, t.active = !0, t.startX = e.clientX, t.handle = o, o.classList.add("dragging"), t.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), t.tablePmStart = S(o) ?? 0, U(a, t), !0) : o.classList.contains("layout-table-row-resize-handle") || o.classList.contains("layout-table-edge-handle-bottom") ? (e.preventDefault(), e.stopPropagation(), i = a, n.active = !0, n.startY = e.clientY, n.handle = o, n.isEdge = o.dataset.isEdge === "bottom", o.classList.add("dragging"), n.rowIndex = parseInt(o.dataset.rowIndex ?? "0", 10), n.tablePmStart = S(o) ?? 0, _t(a, n, o), !0) : o.classList.contains("layout-table-edge-handle-right") ? (e.preventDefault(), e.stopPropagation(), i = a, r.active = !0, r.startX = e.clientX, r.handle = o, o.classList.add("dragging"), r.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), r.tablePmStart = S(o) ?? 0, vt(a, r), !0) : !1 : !1;
864
+ return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (e.preventDefault(), e.stopPropagation(), i = a, t.active = !0, t.startX = e.clientX, t.handle = o, o.classList.add("dragging"), t.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), t.tablePmStart = b(o) ?? 0, ht(a, t), !0) : o.classList.contains("layout-table-row-resize-handle") || o.classList.contains("layout-table-edge-handle-bottom") ? (e.preventDefault(), e.stopPropagation(), i = a, n.active = !0, n.startY = e.clientY, n.handle = o, n.isEdge = o.dataset.isEdge === "bottom", o.classList.add("dragging"), n.rowIndex = parseInt(o.dataset.rowIndex ?? "0", 10), n.tablePmStart = b(o) ?? 0, gt(a, n, o), !0) : o.classList.contains("layout-table-edge-handle-right") ? (e.preventDefault(), e.stopPropagation(), i = a, r.active = !0, r.startX = e.clientX, r.handle = o, o.classList.add("dragging"), r.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), r.tablePmStart = b(o) ?? 0, _t(a, r), !0) : !1 : !1;
861
865
  }
862
866
  function s(e) {
863
867
  if (t.active && t.handle) {
@@ -865,7 +869,7 @@ function gt({ runCommand: e }) {
865
869
  let n = e.clientX - t.startX, r = parseFloat(t.handle.style.left);
866
870
  t.handle.style.left = `${r + n}px`, t.startX = e.clientX;
867
871
  let i = Math.round(n * O), a = t.origWidths.left + i, o = t.origWidths.right - i;
868
- a >= D && o >= D && (t.origWidths = {
872
+ a >= We && o >= We && (t.origWidths = {
869
873
  left: a,
870
874
  right: o
871
875
  });
@@ -884,7 +888,7 @@ function gt({ runCommand: e }) {
884
888
  let t = e.clientX - r.startX, n = parseFloat(r.handle.style.left);
885
889
  r.handle.style.left = `${n + t}px`, r.startX = e.clientX;
886
890
  let i = Math.round(t * O), a = r.origWidth + i;
887
- a >= D && (r.origWidth = a);
891
+ a >= We && (r.origWidth = a);
888
892
  }
889
893
  }
890
894
  function c(a) {
@@ -914,11 +918,11 @@ function gt({ runCommand: e }) {
914
918
  isResizing: a
915
919
  };
916
920
  }
917
- function U(e, t) {
921
+ function ht(e, t) {
918
922
  let n = Ye(e, t.tablePmStart, t.columnIndex);
919
923
  n && (t.origWidths = n);
920
924
  }
921
- function _t(e, t, n) {
925
+ function gt(e, t, n) {
922
926
  let r = Xe(e, t.tablePmStart, t.rowIndex);
923
927
  if (r != null) t.origHeight = r;
924
928
  else {
@@ -927,24 +931,24 @@ function _t(e, t, n) {
927
931
  }
928
932
  t.minimumHeight = Math.min(Ge, t.origHeight);
929
933
  }
930
- function vt(e, t) {
934
+ function _t(e, t) {
931
935
  let n = Je(e, t.tablePmStart, t.columnIndex);
932
936
  n != null && (t.origWidth = n);
933
937
  }
934
938
  // src/composables/useTrackedChanges.ts
935
- function yt(t, n) {
939
+ function vt(t, n) {
936
940
  return e(() => {
937
941
  n.value;
938
- let e = t.value?.state ?? null, r = A(e);
942
+ let e = t.value?.state ?? null, r = Qe(e);
939
943
  if (e === null) return r;
940
944
  let i = {
941
- accept: Pe(e, "accept"),
942
- reject: Pe(e, "reject")
945
+ accept: Ne(e, "accept"),
946
+ reject: Ne(e, "reject")
943
947
  };
944
948
  if (i.accept.size === 0 && i.reject.size === 0) return r;
945
949
  let a = r.entries;
946
950
  for (let e of a) {
947
- let t = Fe(e);
951
+ let t = Pe(e);
948
952
  e.heldByLock = {
949
953
  accept: t.some((e) => i.accept.has(e)),
950
954
  reject: t.some((e) => i.reject.has(e))
@@ -957,7 +961,7 @@ function yt(t, n) {
957
961
  });
958
962
  }
959
963
  // src/composables/useZoom.ts
960
- var W = j, bt = Qe, G = [
964
+ var yt = A, G = $e, K = [
961
965
  .5,
962
966
  .75,
963
967
  1,
@@ -965,16 +969,16 @@ var W = j, bt = Qe, G = [
965
969
  1.5,
966
970
  2
967
971
  ];
968
- function K(t = 1) {
969
- let i = s(Math.max(W, Math.min(bt, t))), a = e(() => Math.round(i.value * 100)), o = e(() => i.value <= W), c = e(() => i.value >= bt);
972
+ function q(t = 1) {
973
+ let i = s(Math.max(yt, Math.min(G, t))), a = e(() => Math.round(i.value * 100)), o = e(() => i.value <= yt), c = e(() => i.value >= G);
970
974
  function l(e) {
971
- i.value = Math.max(W, Math.min(bt, Math.round(e * 100) / 100));
975
+ i.value = Math.max(yt, Math.min(G, Math.round(e * 100) / 100));
972
976
  }
973
977
  function u() {
974
- l(i.value + $e);
978
+ l(i.value + j);
975
979
  }
976
980
  function d() {
977
- l(i.value - $e);
981
+ l(i.value - j);
978
982
  }
979
983
  function f() {
980
984
  l(1);
@@ -1000,7 +1004,7 @@ function K(t = 1) {
1000
1004
  handleWheel: p,
1001
1005
  handleKeyDown: m,
1002
1006
  installShortcuts: h,
1003
- ZOOM_PRESETS: G
1007
+ ZOOM_PRESETS: K
1004
1008
  };
1005
1009
  }
1006
- export { ht as a, L as c, R as d, gt as i, et as l, A as n, H as o, yt as r, V as s, K as t, tt as u };
1010
+ export { mt as a, R as c, z as d, W as i, I as l, Qe as n, U as o, vt as r, H as s, q as t, et as u };