@stll/folio-vue 0.32.0 → 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 (68) 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-RAC5uYts.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-DULmbU_P.js → folio-ui-ctJdVP-s.js} +713 -2743
  34. package/dist/folio-ui-u7h3WXUO.cjs +15 -0
  35. package/dist/folio-vue.css +1 -1
  36. package/dist/i18n/LocaleLoading.d.ts +3 -0
  37. package/dist/i18n/index.d.ts +18 -3
  38. package/dist/index.cjs +1 -1
  39. package/dist/index.d.ts +1 -2
  40. package/dist/index.js +1661 -2039
  41. package/dist/messages/ar.cjs +1 -1
  42. package/dist/messages/cs.cjs +1 -1
  43. package/dist/messages/de.cjs +1 -1
  44. package/dist/messages/en.cjs +1 -1
  45. package/dist/messages/es.cjs +1 -1
  46. package/dist/messages/et.cjs +1 -1
  47. package/dist/messages/fr.cjs +1 -1
  48. package/dist/messages/he.cjs +1 -1
  49. package/dist/messages/hi.cjs +1 -1
  50. package/dist/messages/hu.cjs +1 -1
  51. package/dist/messages/lt.cjs +1 -1
  52. package/dist/messages/lv.cjs +1 -1
  53. package/dist/messages/pl.cjs +1 -1
  54. package/dist/messages/pt-BR.cjs +1 -1
  55. package/dist/messages/sk.cjs +1 -1
  56. package/dist/messages/tr.cjs +1 -1
  57. package/dist/messages/zh-CN.cjs +1 -1
  58. package/dist/rolldown-runtime-DbbDpzbe.cjs +1 -0
  59. package/dist/ui.cjs +1 -1
  60. package/dist/ui.js +28 -18
  61. package/dist/useZoom-CX69Me_z.js +1010 -0
  62. package/dist/useZoom-QSSrGY_r.cjs +1 -0
  63. package/package.json +2 -2
  64. package/dist/SplitCellDialog-Bc2TjxMb.cjs +0 -15
  65. package/dist/StylePicker-Bb0FkLYi.cjs +0 -4
  66. package/dist/rolldown-runtime-5iZMYShA.cjs +0 -1
  67. package/dist/useZoom-HGLyQ-Y0.js +0 -1007
  68. package/dist/useZoom-vZRWHzC-.cjs +0 -1
@@ -0,0 +1,1010 @@
1
+ import { computed as e, inject as t, onBeforeUnmount as n, onMounted as r, onScopeDispose as i, provide as a, reactive as o, ref as s, shallowRef as c, toRaw as l, toValue as u, watch as d, watchEffect as f } from "vue";
2
+ import { CanonicalSessionRefusalError as p, createHiddenEditorManager as m, createHiddenEditorState as h } from "@stll/folio-core/controller/hiddenEditorManager";
3
+ import { getEditorReadOnlyReason as ee } from "@stll/folio-core/managers/EditorModeManager";
4
+ import { getEditorScrollRoot as g, scrollEditorBy as _ } from "@stll/folio-core/paged-layout/editorScrollRoot";
5
+ import { getMargins as te, getPageSize as ne, twipsToPixels as v } from "@stll/folio-core/paged-layout/sectionGeometry";
6
+ import { readModel as y } from "@stll/folio-core/types/documentModel";
7
+ import { readPaintedTableStart as b } from "@stll/folio-core/utils/paintedPositions";
8
+ import { NO_ANONYMIZATION_TERMS as re } from "@stll/folio-core/controller/anonymizationHighlights";
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";
44
+ // src/utils/colorMode.ts
45
+ var M = "(prefers-color-scheme: dark)";
46
+ function N() {
47
+ return typeof window < "u" && typeof window.matchMedia == "function";
48
+ }
49
+ function P(e, t) {
50
+ return e === "dark" || e === "system" && t;
51
+ }
52
+ function F(e) {
53
+ if (!N()) return () => {};
54
+ let t = window.matchMedia(M);
55
+ e(t.matches);
56
+ let n = (t) => e(t.matches);
57
+ return t.addEventListener("change", n), () => t.removeEventListener("change", n);
58
+ }
59
+ // src/composables/useColorMode.ts
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)));
64
+ } };
65
+ function z() {
66
+ let n = t(L, e(() => I)), i = s(!1), a = s(!1);
67
+ return r(() => {
68
+ i.value = !0;
69
+ }), f((e) => {
70
+ i.value && n.value === "system" && e(F((e) => {
71
+ a.value = e;
72
+ }));
73
+ }), e(() => P(n.value, i.value && a.value));
74
+ }
75
+ // src/utils/rawDocument.ts
76
+ var tt = (e) => B(e, /* @__PURE__ */ new Map()), B = (e, t) => {
77
+ if (typeof e != "object" || !e) return e;
78
+ let n = l(e), r = t.get(n);
79
+ if (r !== void 0) return r;
80
+ t.set(n, n);
81
+ let i = nt(n, t);
82
+ return t.set(n, i), i;
83
+ }, nt = (e, t) => {
84
+ if (ArrayBuffer.isView(e) || e instanceof ArrayBuffer) return e;
85
+ if (e instanceof Map) {
86
+ let n = !1, r = [];
87
+ for (let [i, a] of e) {
88
+ let e = B(i, t), o = B(a, t);
89
+ (e !== i || o !== a) && (n = !0), r.push([e, o]);
90
+ }
91
+ return n ? new Map(r) : e;
92
+ }
93
+ if (e instanceof Set) {
94
+ let n = !1, r = [];
95
+ for (let i of e) {
96
+ let e = B(i, t);
97
+ e !== i && (n = !0), r.push(e);
98
+ }
99
+ return n ? new Set(r) : e;
100
+ }
101
+ if (Array.isArray(e)) {
102
+ let n = !1, r = e.map((e) => {
103
+ let r = B(e, t);
104
+ return r !== e && (n = !0), r;
105
+ });
106
+ return n ? r : e;
107
+ }
108
+ let n = Object.getOwnPropertyDescriptors(e), r = !1;
109
+ for (let e of Reflect.ownKeys(n)) {
110
+ let i = Reflect.get(n, e);
111
+ if (!rt(i)) continue;
112
+ let a = B(i.value, t);
113
+ a !== i.value && (r = !0, i.value = a);
114
+ }
115
+ if (!r) return e;
116
+ let i = Object.create(Reflect.getPrototypeOf(e), n);
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) {
120
+ let t = e?.columnCount ?? 1;
121
+ if (t <= 1) return;
122
+ let n = {
123
+ count: t,
124
+ gap: v(e?.columnSpace ?? 720),
125
+ equalWidth: e?.equalWidth ?? !0
126
+ };
127
+ return e?.separator !== void 0 && (n.separator = e.separator), n;
128
+ }
129
+ function lt(e, t, n, r, i, a) {
130
+ if (!e) return;
131
+ let o = t ? {
132
+ ...a,
133
+ rId: t
134
+ } : a, s = t ? n?.getView(t) : null;
135
+ return s ? xe(s.state.doc, r, i, o) : Se(e, r, i, o);
136
+ }
137
+ function ut(e, t, n, r, i) {
138
+ if (!e || e.size === 0) return;
139
+ let a = /* @__PURE__ */ new Map();
140
+ for (let [o, s] of e) {
141
+ let e = lt(s, o, t, n, r, i);
142
+ e && a.set(o, e);
143
+ }
144
+ return a.size > 0 ? a : void 0;
145
+ }
146
+ function dt(e, t, n) {
147
+ let r = /* @__PURE__ */ new Map();
148
+ if (!n || !n.package.footnotes) return r;
149
+ let i = /* @__PURE__ */ new Map();
150
+ for (let e of n.package.footnotes) e.noteType && e.noteType !== "normal" || i.set(e.id, e);
151
+ for (let [n, a] of e) {
152
+ let e = [];
153
+ for (let n of a) {
154
+ let r = i.get(n);
155
+ if (!r) continue;
156
+ let a = t.get(n), o = a?.displayNumber ?? 0;
157
+ e.push({
158
+ displayNumber: String(o),
159
+ noteId: n,
160
+ text: be(r),
161
+ ...a ? { content: {
162
+ blocks: a.blocks,
163
+ measures: a.measures,
164
+ height: a.height
165
+ } } : {}
166
+ });
167
+ }
168
+ e.length > 0 && r.set(n, e);
169
+ }
170
+ return r;
171
+ }
172
+ var V = /* @__PURE__ */ new Set([
173
+ "black",
174
+ "blue",
175
+ "cyan",
176
+ "darkBlue",
177
+ "darkCyan",
178
+ "darkGray",
179
+ "darkGreen",
180
+ "darkMagenta",
181
+ "darkRed",
182
+ "darkYellow",
183
+ "green",
184
+ "lightGray",
185
+ "magenta",
186
+ "none",
187
+ "red",
188
+ "white",
189
+ "yellow"
190
+ ]);
191
+ function ft(e) {
192
+ let t = [], n = (e, r) => {
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)}`);
194
+ e.forEach((e, t, i) => {
195
+ n(e, `${r}.content[${i}]`);
196
+ });
197
+ };
198
+ return n(e, "doc"), t.join("; ");
199
+ }
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 = () => {
202
+ let e = k.value;
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() {
214
+ return [
215
+ ...Se,
216
+ ...vt() ? [ht, gt] : [],
217
+ _t
218
+ ];
219
+ }
220
+ let G = C(), K = new Ee(), q = fe(), bt = ce({
221
+ relayout: () => {
222
+ let e = P.value?.state ?? q.lastEditorState;
223
+ e && X(e, { reason: "hyphenation-ready" });
224
+ },
225
+ onError: (e) => D?.(e)
226
+ });
227
+ i(bt.cancel), i(se({
228
+ measuredFontSet: () => q.lastMeasureInputs?.fontSet ?? null,
229
+ relayout: () => {
230
+ if (N) return;
231
+ let e = P.value?.state ?? q.lastEditorState;
232
+ e && X(e, { reason: "font-ready" });
233
+ }
234
+ }));
235
+ let xt = new we({
236
+ pageGap: l,
237
+ showShadow: !0
238
+ }), St = T({
239
+ getHost: () => Xe.value,
240
+ getReadOnly: () => u(o),
241
+ getCanonicalApi: () => $.api,
242
+ readCanonicalDocument: () => $.readCanonicalDocument(),
243
+ onSessionRefusal: (e, t, n) => {
244
+ H.value = e, D?.(n ?? new p({
245
+ ground: t,
246
+ message: e
247
+ }));
248
+ },
249
+ getStyles: Qe,
250
+ onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
251
+ if (r && (U.value = !0, Z.schedule()), r || i) {
252
+ let { from: r, to: i } = n.state.selection;
253
+ et.value = {
254
+ from: r,
255
+ kind: t,
256
+ rId: e,
257
+ to: i
258
+ }, Ue?.(n.state), G.emit("selectionChange", {
259
+ from: r,
260
+ to: i
261
+ });
262
+ }
263
+ K.requestRender();
264
+ }
265
+ }), J = pe({
266
+ getHost: () => r?.value ?? null,
267
+ getCanonicalApi: () => $.api,
268
+ readCanonicalDocument: () => $.readCanonicalDocument(),
269
+ onSessionRefusal: (e, t, n) => {
270
+ H.value = e, D?.(n ?? new p({
271
+ ground: t,
272
+ message: e
273
+ }));
274
+ },
275
+ getStyles: Qe,
276
+ onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
277
+ if (e) {
278
+ U.value = !0;
279
+ let e = k.value;
280
+ e && (k.value = $.readCanonicalDocument() ?? e, Ot()), Z.schedule();
281
+ }
282
+ if (e || t) {
283
+ Ue?.(n.state);
284
+ let { from: e, to: t } = n.state.selection;
285
+ G.emit("selectionChange", {
286
+ from: e,
287
+ to: t
288
+ });
289
+ }
290
+ }
291
+ }), Y = () => {
292
+ St.sync(), J.sync();
293
+ };
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
+ });
307
+ function X(e, t = {}) {
308
+ if (N) return;
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);
314
+ try {
315
+ Ct(le({
316
+ contentWidth: ie,
317
+ columns: re,
318
+ pageSize: m,
319
+ margins: h,
320
+ pageGap: l,
321
+ showMarginGuides: u(v) === !0,
322
+ marginGuideColor: u(b),
323
+ ...r ? { displayListPagePainter: r } : {},
324
+ syncCoordinator: K,
325
+ headerContent: w.headerContent,
326
+ footerContent: w.footerContent,
327
+ firstPageHeaderContent: w.firstPageHeaderContent,
328
+ firstPageFooterContent: w.firstPageFooterContent,
329
+ headerContentRId: w.activeHeaderRId,
330
+ footerContentRId: w.activeFooterRId,
331
+ firstPageHeaderContentRId: w.activeFirstHeaderRId,
332
+ firstPageFooterContentRId: w.activeFirstFooterRId,
333
+ sectionHeaderFooterRefs: Ce(c),
334
+ theme: x,
335
+ sectionProperties: p,
336
+ document: s,
337
+ defaultTabStop: S,
338
+ mirrorMargins: C,
339
+ styles: ae,
340
+ layout: z.value,
341
+ hfPMs: St,
342
+ painter: xt,
343
+ pagesContainer: o,
344
+ session: q,
345
+ renderHfFromContentOrPm: lt,
346
+ renderHeaderFooterContentByRId: ut,
347
+ readFontSetSignature: oe,
348
+ buildFootnoteRenderItems: dt,
349
+ describeInvalidHighlightMarks: ft,
350
+ emptyTemplatePreviewEntries: ot,
351
+ emptyTemplatePreviewHidden: st,
352
+ hyphenationReadiness: bt,
353
+ markupView: u(ee),
354
+ showCommentHighlights: u(g),
355
+ ..._ === void 0 ? {} : { altChunkMarkerText: u(_) }
356
+ }, e, t));
357
+ } catch (e) {
358
+ let t = e instanceof Error ? e : Error(String(e));
359
+ D?.(t);
360
+ }
361
+ }
362
+ let Z = E({
363
+ readState: () => P.value?.state ?? null,
364
+ runLayout: (e, t) => X(e, t),
365
+ ...ue,
366
+ clock: de
367
+ }), Q = null;
368
+ function Tt() {
369
+ if (Q !== null && (window.clearTimeout(Q), Q = null), P.value && k.value) try {
370
+ let e = $.readCanonicalDocument();
371
+ if (!e) return;
372
+ k.value = e, Y(), Dt(), mt(e);
373
+ } catch (e) {
374
+ D?.(e instanceof Error ? e : Error(String(e)));
375
+ }
376
+ }
377
+ let Et = null;
378
+ function Dt() {
379
+ Et !== null && (window.clearTimeout(Et), Et = null);
380
+ }
381
+ function Ot() {
382
+ Dt(), Et = window.setTimeout(() => {
383
+ if (Et = null, Q !== null) return;
384
+ let e = k.value;
385
+ e && mt(e);
386
+ }, ae);
387
+ }
388
+ function kt() {
389
+ Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
390
+ Q = null, Tt();
391
+ }, ae);
392
+ }
393
+ let $ = m({
394
+ getHost: () => t.value,
395
+ getDocument: () => k.value,
396
+ getStyles: Qe,
397
+ getExtensionManager: () => W,
398
+ getExternalPlugins: yt,
399
+ getAnonymizationTerms: () => Le?.() ?? re,
400
+ getDerivedFields: () => Re?.(),
401
+ getCanonicalRoom: I,
402
+ getReadOnly: () => u(o),
403
+ getHistoryShortcuts: () => Ne,
404
+ onCanonicalHistory: (e) => Pe?.(e),
405
+ onCanonicalHistoryDrop: (e) => Fe?.(e),
406
+ getEditingMode: () => u(be) ?? "editing",
407
+ getSuggestionAuthor: Ze,
408
+ onSessionRefusal: (e, t, n) => {
409
+ D?.(n ?? new p({
410
+ ground: t,
411
+ message: e
412
+ }));
413
+ },
414
+ getDocumentIdentity: () => String(A),
415
+ getDocumentContext: () => k.value,
416
+ onTransaction: jt,
417
+ onCanonicalCompositionLayout: Mt,
418
+ getEmbeddedFontFamilyMap: () => q.embeddedFontFamilyMap,
419
+ onSelectionChange: (e) => {
420
+ F.value = e, Ue?.(e), G.emit("selectionChange", {
421
+ from: e.selection.from,
422
+ to: e.selection.to
423
+ });
424
+ },
425
+ onKeyDown: () => !1,
426
+ onCopy: () => Ge?.(),
427
+ onCut: () => O?.(),
428
+ onPaste: () => Ke?.(),
429
+ onReadOnlyEditAttempt: () => qe?.(),
430
+ onEditorViewReady: Nt,
431
+ onEditorViewDestroy: () => {
432
+ P.value = null, V.value = !1, We?.(null);
433
+ },
434
+ onRemoteSelectionsChange: (e) => {
435
+ L.value = e;
436
+ }
437
+ }), At = $.api.autocomplete.subscribe((t) => e.onAutocompleteChange?.(t));
438
+ d(() => u(Ie), () => {
439
+ L.value = [], $.retryViewCreation(), $.syncExternalDocument();
440
+ }, { immediate: !0 });
441
+ function jt({ newState: e, docChanged: t }) {
442
+ if (F.value = e, t) {
443
+ let e = $.readCanonicalDocument();
444
+ e && (k.value = e, Y()), U.value = !0, K.incrementStateSeq(), Z.schedule(), kt();
445
+ }
446
+ K.requestRender();
447
+ }
448
+ function Mt() {
449
+ let e = P.value;
450
+ e && (F.value = e.state), K.incrementStateSeq(), Z.schedule(), K.requestRender();
451
+ }
452
+ function Nt(e) {
453
+ P.value = e, F.value = e.state, V.value = !0;
454
+ let t = k.value, n = A, r = ++M;
455
+ N = !0;
456
+ let i = () => {
457
+ M === r && (N = !1, j || A !== n || $.getView() !== e || (X(e.state, { reason: "initial" }), K.requestRender()));
458
+ };
459
+ w(t, e.state.doc).then(i, i), We?.(e), u(o) || requestAnimationFrame(() => {
460
+ P.value === e && !e.hasFocus() && e.focus();
461
+ });
462
+ }
463
+ let Pt = {
464
+ getDocx: async (e) => {
465
+ let t = await Gt(e);
466
+ return t?.tripwireResult && Ye?.(t.tripwireResult), t?.buffer ?? null;
467
+ },
468
+ loadDocument: Ht,
469
+ loadDocx: Vt
470
+ }, Ft = S({
471
+ getEditorApi: () => $.api,
472
+ getLayout: () => z.value,
473
+ runLayout: (e, t) => X(e, t),
474
+ getDocumentIO: () => Pt,
475
+ emitter: G
476
+ });
477
+ d([() => u(be), Ze], () => {
478
+ Ft.setCanonicalMode(u(be) === "suggesting" ? {
479
+ type: "suggesting",
480
+ author: Ze()
481
+ } : { type: "editing" });
482
+ }), d(() => u(o), (e) => {
483
+ $.syncEditable(), e && en(), St.sync();
484
+ });
485
+ function It(e) {
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);
489
+ if (t) {
490
+ let e = n.indexOf(_t), t = e === -1 ? n.length : e;
491
+ n.splice(t, 0, ht, gt);
492
+ }
493
+ e.updateState(e.state.reconfigure({ plugins: n }));
494
+ }
495
+ d(() => vt(), () => {
496
+ let e = P.value;
497
+ e && It(e);
498
+ });
499
+ function Lt() {
500
+ $.ensureView();
501
+ }
502
+ function Rt() {
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();
504
+ }
505
+ function zt() {
506
+ let e = k.value;
507
+ if (e) try {
508
+ let t = h({
509
+ document: e,
510
+ styles: y(e).package.styles ?? null,
511
+ manager: W,
512
+ externalPlugins: yt(),
513
+ reason: "mount"
514
+ });
515
+ F.value = t;
516
+ let n = A, r = ++M;
517
+ N = !0;
518
+ let i = () => {
519
+ M === r && (N = !1, j || A !== n || k.value !== e || $.getView() || X(t, { reason: "initial" }));
520
+ };
521
+ w(e, t.doc).then(i, i);
522
+ } catch (e) {
523
+ D?.(e instanceof Error ? e : Error(String(e)));
524
+ }
525
+ }
526
+ d([
527
+ t,
528
+ a,
529
+ Xe,
530
+ ...r ? [r] : []
531
+ ], () => {
532
+ t.value && k.value && !$.getView() && Lt(), Y();
533
+ }, { flush: "post" });
534
+ let Bt = 0;
535
+ async function Vt(e) {
536
+ Bt += 1, H.value = null, V.value = !1;
537
+ try {
538
+ let t = await ge(e, { password: u(ve) });
539
+ if (t.isErr()) throw t.error;
540
+ let n = t.value.document;
541
+ k.value = n, Rt();
542
+ } catch (e) {
543
+ let t = e instanceof Error ? e : Error(String(e));
544
+ H.value = t.message, D?.(t);
545
+ }
546
+ }
547
+ function Ht(e) {
548
+ let t = Bt += 1;
549
+ H.value = null;
550
+ let n = tt(e);
551
+ he(n) ? Wt(n) : Ut(n, t);
552
+ }
553
+ async function Ut(e, t) {
554
+ let n = await _e(e);
555
+ t === Bt && (n.isErr() ? (H.value = n.error.message, D?.(n.error)) : Wt(n.value));
556
+ }
557
+ function Wt(e) {
558
+ k.value = e, Rt();
559
+ }
560
+ async function Gt(e) {
561
+ let t = P.value, n = k.value;
562
+ if (!t || !n) return null;
563
+ try {
564
+ let t = $.api.captureCanonicalSave();
565
+ if (t) {
566
+ let n = u(Je), { canonicalSaveDiagnosticError: r, serializeCanonicalSave: i } = await import("@stll/folio-core/docx/canonicalSave"), a = await i({
567
+ snapshot: t,
568
+ options: e,
569
+ featureFlags: n
570
+ });
571
+ for (let t of a.diagnostics) e?.onDiagnostic || D?.(r(t));
572
+ return a;
573
+ }
574
+ return null;
575
+ } catch (e) {
576
+ return D?.(e instanceof Error ? e : Error(String(e))), null;
577
+ }
578
+ }
579
+ async function Kt(e) {
580
+ let t = P.value, n = t?.state, r = await Gt({
581
+ onDiagnostic: e?.onDiagnostic,
582
+ onSelectiveDecline: e?.onSelectiveDecline,
583
+ onSerializationPath: e?.onSerializationPath,
584
+ mode: e?.selective === !1 ? x.full : x.preferSelective
585
+ });
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, {
587
+ buffer: r.buffer,
588
+ path: r.path
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;
590
+ }
591
+ function qt() {
592
+ return $.readCanonicalDocument();
593
+ }
594
+ function Jt() {
595
+ return qt();
596
+ }
597
+ function Yt() {
598
+ let e = Jt();
599
+ return e && pt(e);
600
+ }
601
+ function Xt(e) {
602
+ Ht(e);
603
+ }
604
+ function Zt(e) {
605
+ return St.getView(e);
606
+ }
607
+ function Qt() {
608
+ Y();
609
+ }
610
+ function $t(e) {
611
+ let t = J.activate(e);
612
+ t && (R.value = e, requestAnimationFrame(() => t.focus()));
613
+ }
614
+ function en() {
615
+ J.activate(null), R.value = null;
616
+ }
617
+ function tn() {
618
+ let e = R.value;
619
+ return e ? J.getView(e) : null;
620
+ }
621
+ function nn() {
622
+ return W.getCommands();
623
+ }
624
+ function rn() {
625
+ let e = tn();
626
+ e ? e.focus() : P.value?.focus();
627
+ }
628
+ function an() {
629
+ let e = P.value;
630
+ e && X(e.state, { reason: "manual" });
631
+ }
632
+ d([
633
+ () => u(v),
634
+ () => u(b),
635
+ () => u(f),
636
+ () => u(ee),
637
+ () => u(g),
638
+ () => u(_)
639
+ ], () => an());
640
+ function on() {
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;
642
+ }
643
+ return i(() => {
644
+ on(), At();
645
+ }), {
646
+ setEmbeddedFontFamilies: (e) => {
647
+ e ? q.embeddedFontFamilyMap = new Map(e) : delete q.embeddedFontFamilyMap, $.refreshFonts();
648
+ },
649
+ editor: Ft,
650
+ editorView: P,
651
+ editorState: F,
652
+ remoteSelections: L,
653
+ headerFooterSelection: et,
654
+ activeNoteStory: R,
655
+ isReady: V,
656
+ isDirty: U,
657
+ parseError: H,
658
+ modelDocument: k,
659
+ readDocumentModel: qt,
660
+ sourceBuffer: $e,
661
+ hiddenEditorWidth: B,
662
+ layout: z,
663
+ blocks: nt,
664
+ measures: rt,
665
+ syncCoordinator: K,
666
+ loadBuffer: Vt,
667
+ loadDocument: Ht,
668
+ save: Kt,
669
+ getDocument: Yt,
670
+ readDocument: Jt,
671
+ setDocument: Xt,
672
+ getHeaderFooterView: Zt,
673
+ syncHeaderFooterViews: Qt,
674
+ openNoteStory: $t,
675
+ closeNoteStory: en,
676
+ getActiveNoteView: tn,
677
+ getCommands: nn,
678
+ focus: rn,
679
+ reLayout: an,
680
+ destroy: on
681
+ };
682
+ }
683
+ // src/composables/useFindReplace.ts
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({
686
+ editingMode: t.value?.editable === !1 ? "viewing" : "editing",
687
+ readOnlyProp: p.value,
688
+ displayMode: f.value
689
+ }), ie = e(re), ae = e(() => {
690
+ let e = b.value;
691
+ return re() === null && !!t.value && !!e && w() && He(e).status === "allowed";
692
+ }), x = null, S, C = null, oe = (e) => {
693
+ let n = t.value?.state.doc;
694
+ return {
695
+ query: _.value,
696
+ options: {
697
+ ...ne,
698
+ displayMode: f.value,
699
+ includeComments: !!l
700
+ },
701
+ document: e,
702
+ ...n ? { bodyVersion: n } : {},
703
+ context: { renderedStories: Be(a.value) }
704
+ };
705
+ }, w = () => {
706
+ let e = r();
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;
712
+ }, ue = () => {
713
+ le(), _.value = "", T();
714
+ }, de = (e) => (y.value = e, x?.navigate(e, u), T(), !0), E = (e = "query") => {
715
+ ce();
716
+ let i = r(), o = n.value, s = t.value?.state.doc;
717
+ if (!i || !_.value.trim()) return ue(), [];
718
+ let c = oe(i), u = Ie({
719
+ document: c.document,
720
+ state: t.value?.state ?? null,
721
+ searchText: c.query,
722
+ options: c.options,
723
+ context: c.context
724
+ });
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({
728
+ container: o,
729
+ document: i,
730
+ bodyDoc: s,
731
+ matches: u,
732
+ commentRoot: l?.value ?? void 0,
733
+ layout: a.value
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) => {
738
+ let t = g.goTo(e);
739
+ return t ? de(t.index) : !1;
740
+ }, he = (e) => {
741
+ let t = g.navigate(e);
742
+ return t ? (de(t.index), t.match) : null;
743
+ }, ge = () => !w() && (E("refresh"), !0), _e = () => {
744
+ let e = re();
745
+ return e !== null && (m?.(e), !0);
746
+ };
747
+ return d(f, () => {
748
+ _.value.trim() && E();
749
+ }), i(() => {
750
+ ce(), x?.destroy();
751
+ }), {
752
+ searchText: _,
753
+ replaceText: te,
754
+ options: ne,
755
+ matches: v,
756
+ currentIndex: y,
757
+ currentMatch: b,
758
+ canReplaceCurrent: ae,
759
+ replacementRefusal: ie,
760
+ performSearch: E,
761
+ scheduleSearch: fe,
762
+ find: pe,
763
+ getFindResult: se,
764
+ goToMatch: me,
765
+ findNext: () => he("next"),
766
+ findPrevious: () => he("previous"),
767
+ replaceCurrent: () => {
768
+ let e = t.value;
769
+ if (!e || _e() || ge()) return !1;
770
+ let n = b.value;
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;
774
+ },
775
+ replaceAll: () => {
776
+ let e = t.value, n = v.value.length;
777
+ if (!e || _e() || ge()) return {
778
+ replacedCount: 0,
779
+ skippedCount: n
780
+ };
781
+ let r = e.state.doc, i = Re(e, v.value, te.value);
782
+ return e.state.doc !== r && E(), i;
783
+ },
784
+ clear: ue
785
+ };
786
+ }
787
+ function pt(e, t) {
788
+ if (t < e.top + 40) {
789
+ let n = Math.max(0, e.top + 40 - t);
790
+ return -Math.min(12, n / 40 * 12);
791
+ }
792
+ if (t > e.bottom - 40) {
793
+ let n = Math.max(0, t - (e.bottom - 40));
794
+ return Math.min(12, n / 40 * 12);
795
+ }
796
+ return 0;
797
+ }
798
+ // src/composables/useDragAutoScroll.ts
799
+ function mt({ pagesContainer: e, onScrollExtendSelection: t }) {
800
+ let n = null, r = 0, a = 0, o = !1;
801
+ function s() {
802
+ return g(e.value);
803
+ }
804
+ function c() {
805
+ o = !1, n !== null && (cancelAnimationFrame(n), n = null);
806
+ }
807
+ function l() {
808
+ if (!o) return;
809
+ let e = s();
810
+ if (!e) return;
811
+ let i = pt(e.getBoundingClientRect(), a);
812
+ i !== 0 && (_(e, i), t(r, a)), n = requestAnimationFrame(l);
813
+ }
814
+ function u() {
815
+ o || (o = !0, n = requestAnimationFrame(l));
816
+ }
817
+ function d(e, t) {
818
+ if (r = e, a = t, !o) {
819
+ let e = s();
820
+ if (!e) return;
821
+ let n = e.getBoundingClientRect();
822
+ (t < n.top + 40 || t > n.bottom - 40) && u();
823
+ }
824
+ }
825
+ return i(() => c()), {
826
+ updateMousePosition: d,
827
+ stopAutoScroll: c
828
+ };
829
+ }
830
+ // src/composables/useTableResize.ts
831
+ function W({ runCommand: e }) {
832
+ let t = {
833
+ active: !1,
834
+ startX: 0,
835
+ handle: null,
836
+ columnIndex: 0,
837
+ tablePmStart: 0,
838
+ origWidths: {
839
+ left: 0,
840
+ right: 0
841
+ }
842
+ }, n = {
843
+ active: !1,
844
+ startY: 0,
845
+ handle: null,
846
+ rowIndex: 0,
847
+ isEdge: !1,
848
+ tablePmStart: 0,
849
+ origHeight: 0,
850
+ minimumHeight: Ge
851
+ }, r = {
852
+ active: !1,
853
+ startX: 0,
854
+ handle: null,
855
+ columnIndex: 0,
856
+ tablePmStart: 0,
857
+ origWidth: 0
858
+ }, i = null;
859
+ function a() {
860
+ return t.active || n.active || r.active;
861
+ }
862
+ function o(e, a) {
863
+ let o = e.target;
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;
865
+ }
866
+ function s(e) {
867
+ if (t.active && t.handle) {
868
+ e.preventDefault();
869
+ let n = e.clientX - t.startX, r = parseFloat(t.handle.style.left);
870
+ t.handle.style.left = `${r + n}px`, t.startX = e.clientX;
871
+ let i = Math.round(n * O), a = t.origWidths.left + i, o = t.origWidths.right - i;
872
+ a >= We && o >= We && (t.origWidths = {
873
+ left: a,
874
+ right: o
875
+ });
876
+ } else if (n.active && n.handle) {
877
+ e.preventDefault();
878
+ let t = e.clientY - n.startY, r = parseFloat(n.handle.style.top);
879
+ n.startY = e.clientY;
880
+ let i = Math.round(t * O), a = Ke({
881
+ currentHeight: n.origHeight,
882
+ delta: i,
883
+ minimumHeight: n.minimumHeight
884
+ });
885
+ n.handle.style.top = `${r + a / O}px`, n.origHeight += a;
886
+ } else if (r.active && r.handle) {
887
+ e.preventDefault();
888
+ let t = e.clientX - r.startX, n = parseFloat(r.handle.style.left);
889
+ r.handle.style.left = `${n + t}px`, r.startX = e.clientX;
890
+ let i = Math.round(t * O), a = r.origWidth + i;
891
+ a >= We && (r.origWidth = a);
892
+ }
893
+ }
894
+ function c(a) {
895
+ t.active ? (t.active = !1, t.handle?.classList.remove("dragging"), i && e(i, qe({
896
+ pmStart: t.tablePmStart,
897
+ colIdx: t.columnIndex,
898
+ newLeft: t.origWidths.left,
899
+ newRight: t.origWidths.right
900
+ })), t.handle = null) : n.active ? (n.active = !1, n.handle?.classList.remove("dragging"), i && e(i, k({
901
+ pmStart: n.tablePmStart,
902
+ rowIdx: n.rowIndex,
903
+ newHeight: n.origHeight
904
+ })), n.handle = null) : r.active && (r.active = !1, r.handle?.classList.remove("dragging"), i && e(i, Ze({
905
+ pmStart: r.tablePmStart,
906
+ colIdx: r.columnIndex,
907
+ newWidth: r.origWidth
908
+ })), r.handle = null);
909
+ }
910
+ function l() {
911
+ return document.addEventListener("mousemove", s), document.addEventListener("mouseup", c), () => {
912
+ document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", c);
913
+ };
914
+ }
915
+ return {
916
+ tryStartResize: o,
917
+ install: l,
918
+ isResizing: a
919
+ };
920
+ }
921
+ function ht(e, t) {
922
+ let n = Ye(e, t.tablePmStart, t.columnIndex);
923
+ n && (t.origWidths = n);
924
+ }
925
+ function gt(e, t, n) {
926
+ let r = Xe(e, t.tablePmStart, t.rowIndex);
927
+ if (r != null) t.origHeight = r;
928
+ else {
929
+ let e = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), r = e ? e.getBoundingClientRect().height : 30;
930
+ t.origHeight = Math.round(r * O);
931
+ }
932
+ t.minimumHeight = Math.min(Ge, t.origHeight);
933
+ }
934
+ function _t(e, t) {
935
+ let n = Je(e, t.tablePmStart, t.columnIndex);
936
+ n != null && (t.origWidth = n);
937
+ }
938
+ // src/composables/useTrackedChanges.ts
939
+ function vt(t, n) {
940
+ return e(() => {
941
+ n.value;
942
+ let e = t.value?.state ?? null, r = Qe(e);
943
+ if (e === null) return r;
944
+ let i = {
945
+ accept: Ne(e, "accept"),
946
+ reject: Ne(e, "reject")
947
+ };
948
+ if (i.accept.size === 0 && i.reject.size === 0) return r;
949
+ let a = r.entries;
950
+ for (let e of a) {
951
+ let t = Pe(e);
952
+ e.heldByLock = {
953
+ accept: t.some((e) => i.accept.has(e)),
954
+ reject: t.some((e) => i.reject.has(e))
955
+ };
956
+ }
957
+ return {
958
+ ...r,
959
+ entries: a
960
+ };
961
+ });
962
+ }
963
+ // src/composables/useZoom.ts
964
+ var yt = A, G = $e, K = [
965
+ .5,
966
+ .75,
967
+ 1,
968
+ 1.25,
969
+ 1.5,
970
+ 2
971
+ ];
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);
974
+ function l(e) {
975
+ i.value = Math.max(yt, Math.min(G, Math.round(e * 100) / 100));
976
+ }
977
+ function u() {
978
+ l(i.value + j);
979
+ }
980
+ function d() {
981
+ l(i.value - j);
982
+ }
983
+ function f() {
984
+ l(1);
985
+ }
986
+ function p(e) {
987
+ (e.ctrlKey || e.metaKey) && (e.preventDefault(), e.deltaY < 0 ? u() : d());
988
+ }
989
+ function m(e) {
990
+ (e.ctrlKey || e.metaKey) && (e.shiftKey || e.altKey || (e.key === "=" || e.key === "+" ? (e.preventDefault(), u()) : e.key === "-" ? (e.preventDefault(), d()) : e.key === "0" && (e.preventDefault(), f())));
991
+ }
992
+ function h() {
993
+ r(() => document.addEventListener("keydown", m)), n(() => document.removeEventListener("keydown", m));
994
+ }
995
+ return {
996
+ zoom: i,
997
+ zoomPercent: a,
998
+ isMinZoom: o,
999
+ isMaxZoom: c,
1000
+ setZoom: l,
1001
+ zoomIn: u,
1002
+ zoomOut: d,
1003
+ resetZoom: f,
1004
+ handleWheel: p,
1005
+ handleKeyDown: m,
1006
+ installShortcuts: h,
1007
+ ZOOM_PRESETS: K
1008
+ };
1009
+ }
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 };