@stll/folio-vue 0.26.5 → 0.27.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.
@@ -37,46 +37,46 @@ import { templateSlashMenuPlugin as Ve } from "@stll/folio-core/prosemirror/plug
37
37
  import { resolveHeaderFooterContent as He } from "@stll/folio-core/utils/headerFooter";
38
38
  import { FindReplaceManager as Ue } from "@stll/folio-core/managers/FindReplaceManager";
39
39
  import { findInDisplayedDocument as We, resolveFindMatchRange as Ge } from "@stll/folio-core/prosemirror/findReplaceSelection";
40
- import { createFindMatchView as Ke, getRenderedSearchStories as E } from "@stll/folio-core/utils/findMatchView";
41
- import { createDefaultFindOptions as qe, replaceEligibility as Je } from "@stll/folio-core/utils/findReplace";
40
+ import { createFindMatchView as Ke, getRenderedSearchStories as qe } from "@stll/folio-core/utils/findMatchView";
41
+ import { createDefaultFindOptions as E, replaceEligibility as Je } from "@stll/folio-core/utils/findReplace";
42
42
  import { createFindSearchKey as Ye, sameFindSearchKey as Xe } from "@stll/folio-core/utils/findSearchKey";
43
- import { MIN_CELL_WIDTH_TWIPS as Ze, MIN_ROW_HEIGHT_TWIPS as D, TWIPS_PER_PIXEL as O, clampRowResizeDelta as Qe, commitColumnResize as $e, commitRightEdgeResize as et, commitRowResize as tt, readColumnWidthAt as nt, readColumnWidths as rt, readRowHeight as it } from "@stll/folio-core/prosemirror/tableResize";
44
- import { extractTrackedChanges as at } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
45
- import { ZOOM_MAX as ot, ZOOM_MIN as k, ZOOM_STEP as A } from "@stll/folio-core/utils/zoom";
43
+ import { MIN_CELL_WIDTH_TWIPS as Ze, MIN_ROW_HEIGHT_TWIPS as Qe, TWIPS_PER_PIXEL as D, clampRowResizeDelta as $e, commitColumnResize as et, commitRightEdgeResize as tt, commitRowResize as nt, readColumnWidthAt as rt, readColumnWidths as it, readRowHeight as at } from "@stll/folio-core/prosemirror/tableResize";
44
+ import { extractTrackedChanges as ot } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
45
+ import { ZOOM_MAX as st, ZOOM_MIN as ct, ZOOM_STEP as O } from "@stll/folio-core/utils/zoom";
46
46
  // src/utils/colorMode.ts
47
- var st = "(prefers-color-scheme: dark)";
48
- function j() {
47
+ var k = "(prefers-color-scheme: dark)";
48
+ function lt() {
49
49
  return typeof window < "u" && typeof window.matchMedia == "function";
50
50
  }
51
- function M(e, t) {
51
+ function A(e, t) {
52
52
  return e === "dark" || e === "system" && t;
53
53
  }
54
- function N(e) {
55
- if (!j()) return () => {};
56
- let t = window.matchMedia(st);
54
+ function j(e) {
55
+ if (!lt()) return () => {};
56
+ let t = window.matchMedia(k);
57
57
  e(t.matches);
58
58
  let n = (t) => e(t.matches);
59
59
  return t.addEventListener("change", n), () => t.removeEventListener("change", n);
60
60
  }
61
61
  // src/composables/useColorMode.ts
62
- var P = "light", F = Symbol("folioColorMode"), I = (t = P) => {
63
- a(F, e(() => l(t)));
64
- }, ct = { install(t, n = P) {
65
- t.provide(F, e(() => l(n)));
62
+ var M = "light", N = Symbol("folioColorMode"), P = (t = M) => {
63
+ a(N, e(() => l(t)));
64
+ }, F = { install(t, n = M) {
65
+ t.provide(N, e(() => l(n)));
66
66
  } };
67
- function L() {
68
- let n = t(F, e(() => P)), i = s(!1), a = s(!1);
67
+ function ut() {
68
+ let n = t(N, e(() => M)), i = s(!1), a = s(!1);
69
69
  return r(() => {
70
70
  i.value = !0;
71
71
  }), d((e) => {
72
- i.value && n.value === "system" && e(N((e) => {
72
+ i.value && n.value === "system" && e(j((e) => {
73
73
  a.value = e;
74
74
  }));
75
- }), e(() => M(n.value, i.value && a.value));
75
+ }), e(() => A(n.value, i.value && a.value));
76
76
  }
77
77
  // src/composables/useDocxEditor.ts
78
- var lt = 24, ut = "User", dt = 250, ft = [], pt = [];
79
- function mt(e) {
78
+ var dt = 24, ft = "User", pt = 250, mt = [], ht = [];
79
+ function gt(e) {
80
80
  let t = e?.columnCount ?? 1;
81
81
  if (t <= 1) return;
82
82
  let n = {
@@ -86,7 +86,7 @@ function mt(e) {
86
86
  };
87
87
  return e?.separator !== void 0 && (n.separator = e.separator), n;
88
88
  }
89
- function ht(e, t, n, r, i, a) {
89
+ function _t(e, t, n, r, i, a) {
90
90
  if (!e) return;
91
91
  let o = t ? {
92
92
  ...a,
@@ -94,16 +94,16 @@ function ht(e, t, n, r, i, a) {
94
94
  } : a, s = t ? n?.getView(t) : null;
95
95
  return s ? Se(s.state.doc, r, i, o) : Ce(e, r, i, o);
96
96
  }
97
- function gt(e, t, n, r, i) {
97
+ function vt(e, t, n, r, i) {
98
98
  if (!e || e.size === 0) return;
99
99
  let a = /* @__PURE__ */ new Map();
100
100
  for (let [o, s] of e) {
101
- let e = ht(s, o, t, n, r, i);
101
+ let e = _t(s, o, t, n, r, i);
102
102
  e && a.set(o, e);
103
103
  }
104
104
  return a.size > 0 ? a : void 0;
105
105
  }
106
- function _t(e, t, n) {
106
+ function yt(e, t, n) {
107
107
  let r = /* @__PURE__ */ new Map();
108
108
  if (!n || !n.package.footnotes) return r;
109
109
  let i = /* @__PURE__ */ new Map();
@@ -129,7 +129,7 @@ function _t(e, t, n) {
129
129
  }
130
130
  return r;
131
131
  }
132
- var R = /* @__PURE__ */ new Set([
132
+ var I = /* @__PURE__ */ new Set([
133
133
  "black",
134
134
  "blue",
135
135
  "cyan",
@@ -148,146 +148,146 @@ var R = /* @__PURE__ */ new Set([
148
148
  "white",
149
149
  "yellow"
150
150
  ]);
151
- function vt(e) {
151
+ function bt(e) {
152
152
  let t = [], n = (e, r) => {
153
- for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !R.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
153
+ for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !I.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
154
154
  e.forEach((e, t, i) => {
155
155
  n(e, `${r}.content[${i}]`);
156
156
  });
157
157
  };
158
158
  return n(e, "doc"), t.join("; ");
159
159
  }
160
- function yt(e) {
161
- let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: o = !1, experimentalSession: d, pageGap: ee = lt, pageRenderer: _, markupView: v = "all-markup", showCommentHighlights: b = !0, showMarginGuides: xe, marginGuideColor: Se, password: Ce, editorMode: Ue, author: We, externalPlugins: Ge = [], historyShortcuts: Ke = "editor", collaboration: E, onAnonymizationMatchesChange: qe, showTemplateDirectives: Je, onSlashMenuChange: Ye, onSlashMenuKeyAction: Xe, onChange: Ze, onError: D, onSelectionUpdate: O, onEditorViewReady: Qe, onCopy: $e, onCut: et, onPaste: tt, onReadOnlyEditAttempt: nt, featureFlags: rt, onSelectiveSaveTripwire: it } = e, at = n ?? t, ot = () => l(We) ?? ut, k = c(null), A = 0, st = !1, j = 0, M = !1, N = c(null), P = c(null), F = c(null), I = c([]), ct = c(null), L = c(null), R = c(null), yt = c([]), bt = c([]), z = s(!1), B = s(null), V = s(!1), H = () => re(l(d), x.authorityRouting), U = (e) => H() ? g(e) : e, xt = (e, t) => {
162
- if (!H()) return !1;
160
+ function L(e) {
161
+ let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: o = !1, experimentalSession: d, pageGap: ee = dt, pageRenderer: _, markupView: v = "all-markup", showCommentHighlights: b = !0, altChunkMarkerText: xe, showMarginGuides: Se, marginGuideColor: Ce, password: Ue, editorMode: We, author: Ge, externalPlugins: Ke = [], historyShortcuts: qe = "editor", collaboration: E, onAnonymizationMatchesChange: Je, showTemplateDirectives: Ye, onSlashMenuChange: Xe, onSlashMenuKeyAction: Ze, onChange: Qe, onError: D, onSelectionUpdate: $e, onEditorViewReady: et, onCopy: tt, onCut: nt, onPaste: rt, onReadOnlyEditAttempt: it, featureFlags: at, onSelectiveSaveTripwire: ot } = e, st = n ?? t, ct = () => l(Ge) ?? ft, O = c(null), k = 0, lt = !1, A = 0, j = !1, M = c(null), N = c(null), P = c(null), F = c([]), ut = c(null), I = c(null), L = c(null), xt = c([]), St = c([]), R = s(!1), z = s(null), B = s(!1), V = () => re(l(d), x.authorityRouting), H = (e) => V() ? g(e) : e, Ct = (e, t) => {
162
+ if (!V()) return !1;
163
163
  let n = new f({
164
164
  gap: e,
165
165
  message: ne(e, t)
166
166
  });
167
167
  return D?.(n), !0;
168
- }, W = new ke(Pe({ historyShortcuts: Ke }));
169
- W.buildSchema(), W.initializeRuntime();
170
- let St = ie(!1), Ct = [St], wt = Re({ keymap: !0 }), Tt = Le({ onMatchesChange: (e) => qe?.(e) }), Et = ze(), Dt = Ve({
171
- onChange: (e) => Ye?.(e),
172
- onKeyAction: (e) => Xe?.(e) ?? !1
173
- }), Ot = Be(), kt = () => l(Je) === !0;
174
- function At() {
168
+ }, U = new ke(Pe({ historyShortcuts: qe }));
169
+ U.buildSchema(), U.initializeRuntime();
170
+ let wt = ie(!1), Tt = [wt], Et = Re({ keymap: !0 }), Dt = Le({ onMatchesChange: (e) => Je?.(e) }), Ot = ze(), kt = Ve({
171
+ onChange: (e) => Xe?.(e),
172
+ onKeyAction: (e) => Ze?.(e) ?? !1
173
+ }), At = Be(), jt = () => l(Ye) === !0;
174
+ function Mt() {
175
175
  return [
176
+ Et,
176
177
  wt,
177
- St,
178
- ...Ge,
178
+ ...Ke,
179
179
  ...l(E)?.plugins ?? [],
180
- Tt,
181
- ...kt() ? [Et, Dt] : [],
182
- Ot
180
+ Dt,
181
+ ...jt() ? [Ot, kt] : [],
182
+ At
183
183
  ];
184
184
  }
185
- let G = se(), K = new De(), q = he(), jt = de({
185
+ let W = se(), G = new De(), K = he(), Nt = de({
186
186
  relayout: () => {
187
- let e = N.value?.state ?? q.lastEditorState;
188
- e && Z(e, { reason: "hyphenation-ready" });
187
+ let e = M.value?.state ?? K.lastEditorState;
188
+ e && X(e, { reason: "hyphenation-ready" });
189
189
  },
190
190
  onError: (e) => D?.(e)
191
191
  });
192
- i(jt.cancel), i(le({
193
- measuredFontSet: () => q.lastMeasureInputs?.fontSet ?? null,
192
+ i(Nt.cancel), i(le({
193
+ measuredFontSet: () => K.lastMeasureInputs?.fontSet ?? null,
194
194
  relayout: () => {
195
- if (M) return;
196
- let e = N.value?.state ?? q.lastEditorState;
197
- e && Z(e, { reason: "font-ready" });
195
+ if (j) return;
196
+ let e = M.value?.state ?? K.lastEditorState;
197
+ e && X(e, { reason: "font-ready" });
198
198
  }
199
199
  }));
200
- let Mt = new Te({
200
+ let Pt = new Te({
201
201
  pageGap: ee,
202
202
  showShadow: !0
203
- }), J = ue({
204
- getHost: () => at.value,
203
+ }), q = ue({
204
+ getHost: () => st.value,
205
205
  getReadOnly: () => l(o),
206
- getDocument: () => $.api.getCanonicalDocument() ?? k.value,
206
+ getDocument: () => $.api.getCanonicalDocument() ?? O.value,
207
207
  getCanonicalApi: () => $.api,
208
208
  getExperimentalSession: () => l(d),
209
209
  onSessionRefusal: (e, t, n) => {
210
- B.value = e, D?.(n ?? new f({
210
+ z.value = e, D?.(n ?? new f({
211
211
  gap: t,
212
212
  message: e
213
213
  }));
214
214
  },
215
- getStyles: () => k.value?.package.styles ?? null,
216
- getTheme: () => k.value?.package.theme ?? null,
215
+ getStyles: () => O.value?.package.styles ?? null,
216
+ getTheme: () => O.value?.package.theme ?? null,
217
217
  onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
218
- if (r && (V.value = !0, Ft.schedule()), r || i) {
218
+ if (r && (B.value = !0, Z.schedule()), r || i) {
219
219
  let { from: r, to: i } = n.state.selection;
220
- ct.value = {
220
+ ut.value = {
221
221
  from: r,
222
222
  kind: t,
223
223
  rId: e,
224
224
  to: i
225
- }, O?.(n.state), G.emit("selectionChange", {
225
+ }, $e?.(n.state), W.emit("selectionChange", {
226
226
  from: r,
227
227
  to: i
228
228
  });
229
229
  }
230
- K.requestRender();
230
+ G.requestRender();
231
231
  }
232
- }), Nt = { current: null }, Y = ge({
232
+ }), Ft = { current: null }, J = ge({
233
233
  getHost: () => r?.value ?? null,
234
- getPlugins: () => Ct,
235
- getDocument: () => $.api.getCanonicalDocument() ?? k.value,
234
+ getPlugins: () => Tt,
235
+ getDocument: () => $.api.getCanonicalDocument() ?? O.value,
236
236
  getCanonicalApi: () => $.api,
237
237
  getExperimentalSession: () => l(d),
238
238
  onSessionRefusal: (e, t, n) => {
239
- B.value = e, D?.(n ?? new f({
239
+ z.value = e, D?.(n ?? new f({
240
240
  gap: t,
241
241
  message: e
242
242
  }));
243
243
  },
244
- getStyles: () => k.value?.package.styles ?? null,
245
- getTheme: () => k.value?.package.theme ?? null,
244
+ getStyles: () => O.value?.package.styles ?? null,
245
+ getTheme: () => O.value?.package.theme ?? null,
246
246
  onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
247
247
  if (e) {
248
- V.value = !0;
249
- let e = k.value;
248
+ B.value = !0;
249
+ let e = O.value;
250
250
  if (e) {
251
- let t = $.api.getCanonicalDocument() ?? Nt.current?.snapshotDocument(e) ?? e;
252
- k.value = t, Ze?.(U(t)), G.emit("docChange", U(t));
251
+ let t = $.api.getCanonicalDocument() ?? Ft.current?.snapshotDocument(e) ?? e;
252
+ O.value = t, Qe?.(H(t)), W.emit("docChange", H(t));
253
253
  }
254
- Ft.schedule();
254
+ Z.schedule();
255
255
  }
256
256
  if (e || t) {
257
- O?.(n.state);
257
+ $e?.(n.state);
258
258
  let { from: e, to: t } = n.state.selection;
259
- G.emit("selectionChange", {
259
+ W.emit("selectionChange", {
260
260
  from: e,
261
261
  to: t
262
262
  });
263
263
  }
264
264
  }
265
265
  });
266
- Nt.current = Y;
267
- let X = () => {
268
- J.sync(), Y.sync();
266
+ Ft.current = J;
267
+ let Y = () => {
268
+ q.sync(), J.sync();
269
269
  };
270
- u(() => l(d), X);
271
- function Pt(e) {
272
- e.layout && (R.value = e.layout), e.blocks && (yt.value = e.blocks), e.measures && (bt.value = e.measures), e.blockLookup && Mt.setBlockLookup(e.blockLookup), e.layout && G.emit("layoutComplete", e.layout);
270
+ u(() => l(d), Y);
271
+ function It(e) {
272
+ e.layout && (L.value = e.layout), e.blocks && (xt.value = e.blocks), e.measures && (St.value = e.measures), e.blockLookup && Pt.setBlockLookup(e.blockLookup), e.layout && W.emit("layoutComplete", e.layout);
273
273
  }
274
- function Z(e, t = {}) {
275
- if (M) return;
276
- let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = k.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, c = y(s), u = te(s), d = mt(s), f = c.w - u.left - u.right, p = i?.package.styles ?? null, m = i?.package.theme ?? null, h = i?.package.settings?.defaultTabStop, g = i?.package.settings?.mirrorMargins === !0, x = He(i?.package);
274
+ function X(e, t = {}) {
275
+ if (j) return;
276
+ let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = O.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, c = y(s), u = te(s), d = gt(s), f = c.w - u.left - u.right, p = i?.package.styles ?? null, m = i?.package.theme ?? null, h = i?.package.settings?.defaultTabStop, g = i?.package.settings?.mirrorMargins === !0, x = He(i?.package);
277
277
  try {
278
- Pt(fe({
278
+ It(fe({
279
279
  contentWidth: f,
280
280
  columns: d,
281
281
  pageSize: c,
282
282
  margins: u,
283
283
  pageGap: ee,
284
- showMarginGuides: l(xe) === !0,
285
- marginGuideColor: l(Se),
284
+ showMarginGuides: l(Se) === !0,
285
+ marginGuideColor: l(Ce),
286
286
  ...(() => {
287
287
  let e = l(_);
288
288
  return e === void 0 ? {} : { pageRenderer: e };
289
289
  })(),
290
- syncCoordinator: K,
290
+ syncCoordinator: G,
291
291
  headerContent: x.headerContent,
292
292
  footerContent: x.footerContent,
293
293
  firstPageHeaderContent: x.firstPageHeaderContent,
@@ -303,201 +303,203 @@ function yt(e) {
303
303
  defaultTabStop: h,
304
304
  mirrorMargins: g,
305
305
  styles: p,
306
- layout: R.value,
307
- hfPMs: J,
308
- painter: Mt,
306
+ layout: L.value,
307
+ hfPMs: q,
308
+ painter: Pt,
309
309
  pagesContainer: r,
310
- session: q,
311
- renderHfFromContentOrPm: ht,
312
- renderHeaderFooterContentByRId: gt,
310
+ session: K,
311
+ renderHfFromContentOrPm: _t,
312
+ renderHeaderFooterContentByRId: vt,
313
313
  readFontSetSignature: ce,
314
- buildFootnoteRenderItems: _t,
315
- describeInvalidHighlightMarks: vt,
316
- emptyTemplatePreviewEntries: ft,
317
- emptyTemplatePreviewHidden: pt,
318
- hyphenationReadiness: jt,
314
+ buildFootnoteRenderItems: yt,
315
+ describeInvalidHighlightMarks: bt,
316
+ emptyTemplatePreviewEntries: mt,
317
+ emptyTemplatePreviewHidden: ht,
318
+ hyphenationReadiness: Nt,
319
319
  markupView: l(v),
320
- showCommentHighlights: l(b)
320
+ showCommentHighlights: l(b),
321
+ ...xe === void 0 ? {} : { altChunkMarkerText: l(xe) }
321
322
  }, e, t));
322
323
  } catch (e) {
323
324
  let t = e instanceof Error ? e : Error(String(e));
324
325
  D?.(t);
325
326
  }
326
327
  }
327
- let Ft = me({
328
- readState: () => N.value?.state ?? null,
329
- runLayout: (e, t) => Z(e, t),
328
+ let Z = me({
329
+ readState: () => M.value?.state ?? null,
330
+ runLayout: (e, t) => X(e, t),
330
331
  ...T,
331
332
  clock: pe
332
- }), Q = null, It = Fe();
333
- function Lt() {
333
+ }), Q = null, Lt = Fe();
334
+ function Rt() {
334
335
  Q !== null && (window.clearTimeout(Q), Q = null);
335
- let e = N.value, t = k.value;
336
+ let e = M.value, t = O.value;
336
337
  if (e && t) try {
337
338
  let n = $.api.getCanonicalDocument();
338
- if (!n && H()) return;
339
- let r = n ?? It.reconcile(Oe(e.state.doc, t, { stylesheetSource: { type: "package" } }), e.state.doc);
340
- k.value = r, X(), Ze?.(U(r)), G.emit("docChange", U(r));
339
+ if (!n && V()) return;
340
+ let r = n ?? Lt.reconcile(Oe(e.state.doc, t, { stylesheetSource: { type: "package" } }), e.state.doc);
341
+ O.value = r, Y(), Qe?.(H(r)), W.emit("docChange", H(r));
341
342
  } catch (e) {
342
343
  D?.(e instanceof Error ? e : Error(String(e)));
343
344
  }
344
345
  }
345
- function Rt() {
346
+ function zt() {
346
347
  Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
347
- Q = null, Lt();
348
- }, dt);
348
+ Q = null, Rt();
349
+ }, pt);
349
350
  }
350
351
  let $ = m({
351
352
  getHost: () => t.value,
352
- getDocument: () => k.value,
353
- getStyles: () => k.value?.package.styles ?? null,
354
- getExtensionManager: () => W,
355
- getExternalPlugins: At,
353
+ getDocument: () => O.value,
354
+ getStyles: () => O.value?.package.styles ?? null,
355
+ getExtensionManager: () => U,
356
+ getExternalPlugins: Mt,
356
357
  getCollaboration: () => l(E),
357
- getCollaborationModules: () => F.value,
358
+ getCollaborationModules: () => P.value,
358
359
  getPrecomputedInitialState: () => null,
359
360
  getReadOnly: () => l(o),
360
361
  getExperimentalSession: () => l(d),
361
- getEditingMode: () => l(Ue) ?? "editing",
362
- getSuggestionAuthor: ot,
362
+ getEditingMode: () => l(We) ?? "editing",
363
+ getSuggestionAuthor: ct,
363
364
  onSessionRefusal: (e, t, n) => {
364
365
  D?.(n ?? new f({
365
366
  gap: t,
366
367
  message: e
367
368
  }));
368
369
  },
369
- getDocumentIdentity: () => String(A),
370
- getDocumentContext: () => k.value,
371
- onTransaction: Bt,
370
+ getDocumentIdentity: () => String(k),
371
+ getDocumentContext: () => O.value,
372
+ onTransaction: Vt,
373
+ onCanonicalCompositionEnd: () => Z.schedule(),
372
374
  onSelectionChange: (e) => {
373
- P.value = e, O?.(e), G.emit("selectionChange", {
375
+ N.value = e, $e?.(e), W.emit("selectionChange", {
374
376
  from: e.selection.from,
375
377
  to: e.selection.to
376
378
  });
377
379
  },
378
380
  onKeyDown: () => !1,
379
- onCopy: () => $e?.(),
380
- onCut: () => et?.(),
381
- onPaste: () => tt?.(),
382
- onReadOnlyEditAttempt: () => nt?.(),
383
- onEditorViewReady: Vt,
381
+ onCopy: () => tt?.(),
382
+ onCut: () => nt?.(),
383
+ onPaste: () => rt?.(),
384
+ onReadOnlyEditAttempt: () => it?.(),
385
+ onEditorViewReady: Ht,
384
386
  onEditorViewDestroy: () => {
385
- N.value = null, z.value = !1, Qe?.(null);
387
+ M.value = null, R.value = !1, et?.(null);
386
388
  },
387
389
  onRemoteSelectionsChange: (e) => {
388
- I.value = e;
390
+ F.value = e;
389
391
  }
390
- }), zt = () => {
391
- let e = l(E)?.awareness, t = F.value, n = $.getView();
392
- I.value = e && t && n ? p(n.state, e, t) : [];
392
+ }), Bt = () => {
393
+ let e = l(E)?.awareness, t = P.value, n = $.getView();
394
+ F.value = e && t && n ? p(n.state, e, t) : [];
393
395
  };
394
396
  u(() => l(E), (e, t, n) => {
395
- if (I.value = [], !e) {
396
- F.value = null, $.retryViewCreation(), $.syncExternalDocument();
397
+ if (F.value = [], !e) {
398
+ P.value = null, $.retryViewCreation(), $.syncExternalDocument();
397
399
  return;
398
400
  }
399
401
  let r = !1;
400
402
  n(() => {
401
403
  r = !0;
402
- }), F.value = null, ae().then((e) => {
403
- r || (F.value = e, $.retryViewCreation(), $.syncExternalDocument(), zt());
404
+ }), P.value = null, ae().then((e) => {
405
+ r || (P.value = e, $.retryViewCreation(), $.syncExternalDocument(), Bt());
404
406
  }, (e) => {
405
- r || (F.value = null, D?.(e instanceof Error ? e : Error(String(e))));
407
+ r || (P.value = null, D?.(e instanceof Error ? e : Error(String(e))));
406
408
  });
407
409
  }, { immediate: !0 }), u(() => ({
408
410
  awareness: l(E)?.awareness,
409
- modules: F.value,
410
- view: N.value
411
+ modules: P.value,
412
+ view: M.value
411
413
  }), ({ awareness: e, modules: t, view: n }, r, i) => {
412
- !e || !t || !n ? I.value = [] : (e.on("change", zt), zt(), i(() => {
413
- e.off("change", zt), I.value = [];
414
+ !e || !t || !n ? F.value = [] : (e.on("change", Bt), Bt(), i(() => {
415
+ e.off("change", Bt), F.value = [];
414
416
  }));
415
417
  }, { flush: "post" });
416
- function Bt({ newState: e, docChanged: t, transactions: n }) {
417
- P.value = e;
418
+ function Vt({ newState: e, docChanged: t, transactions: n }) {
419
+ N.value = e;
418
420
  let r = n[0]?.before;
419
- if (t && r && It.noteBase(r), t) {
421
+ if (t && r && Lt.noteBase(r), t) {
420
422
  let e = $.api.getCanonicalDocument();
421
- e && (k.value = e, X()), V.value = !0, K.incrementStateSeq(), Ft.schedule(), Rt();
423
+ e && (O.value = e, Y()), B.value = !0, G.incrementStateSeq(), Z.schedule(), zt();
422
424
  }
423
- K.requestRender();
425
+ G.requestRender();
424
426
  }
425
- function Vt(e) {
426
- N.value = e, P.value = e.state, z.value = !0;
427
- let t = k.value, n = A, r = ++j;
428
- M = !0;
427
+ function Ht(e) {
428
+ M.value = e, N.value = e.state, R.value = !0;
429
+ let t = O.value, n = k, r = ++A;
430
+ j = !0;
429
431
  let i = () => {
430
- j === r && (M = !1, !(st || A !== n || $.getView() !== e) && (Z(e.state, { reason: "initial" }), K.requestRender()));
432
+ A === r && (j = !1, !(lt || k !== n || $.getView() !== e) && (X(e.state, { reason: "initial" }), G.requestRender()));
431
433
  };
432
- w(t, e.state.doc).then(i, i), Wt(e), Qe?.(e), l(o) || requestAnimationFrame(() => {
433
- N.value === e && e.focus();
434
+ w(t, e.state.doc).then(i, i), Gt(e), et?.(e), l(o) || requestAnimationFrame(() => {
435
+ M.value === e && e.focus();
434
436
  });
435
437
  }
436
- let Ht = {
437
- getDocx: async (e) => (await Zt(e))?.buffer ?? null,
438
- loadDocument: Xt,
439
- loadDocx: Yt
440
- }, Ut = oe({
438
+ let Ut = {
439
+ getDocx: async (e) => (await Qt(e))?.buffer ?? null,
440
+ loadDocument: Zt,
441
+ loadDocx: Xt
442
+ }, Wt = oe({
441
443
  getEditorApi: () => $.api,
442
- getLayout: () => R.value,
443
- runLayout: (e, t) => Z(e, t),
444
- getDocumentIO: () => Ht,
445
- emitter: G
444
+ getLayout: () => L.value,
445
+ runLayout: (e, t) => X(e, t),
446
+ getDocumentIO: () => Ut,
447
+ emitter: W
446
448
  });
447
- function Wt(e) {
448
- let t = l(Ue) === "suggesting";
449
- S(t, e.state, e.dispatch, ot());
449
+ function Gt(e) {
450
+ let t = l(We) === "suggesting";
451
+ S(t, e.state, e.dispatch, ct());
450
452
  }
451
- u([() => l(Ue), ot], () => {
452
- Ut.setCanonicalMode(l(Ue) === "suggesting" ? {
453
+ u([() => l(We), ct], () => {
454
+ Wt.setCanonicalMode(l(We) === "suggesting" ? {
453
455
  type: "suggesting",
454
- author: ot()
456
+ author: ct()
455
457
  } : { type: "editing" });
456
- let e = N.value;
457
- e && Wt(e);
458
- for (let e of Y.listStories()) {
459
- let t = Y.getView(e);
460
- t && Wt(t);
458
+ let e = M.value;
459
+ e && Gt(e);
460
+ for (let e of J.listStories()) {
461
+ let t = J.getView(e);
462
+ t && Gt(t);
461
463
  }
462
464
  }), u(() => l(o), (e) => {
463
- $.syncEditable(), e && an(), J.sync();
465
+ $.syncEditable(), e && on(), q.sync();
464
466
  });
465
- function Gt(e) {
466
- let t = kt();
467
- if (t === e.state.plugins.includes(Et)) return;
468
- let n = e.state.plugins.filter((e) => e !== Et && e !== Dt);
467
+ function Kt(e) {
468
+ let t = jt();
469
+ if (t === e.state.plugins.includes(Ot)) return;
470
+ let n = e.state.plugins.filter((e) => e !== Ot && e !== kt);
469
471
  if (t) {
470
- let e = n.indexOf(Ot), t = e === -1 ? n.length : e;
471
- n.splice(t, 0, Et, Dt);
472
+ let e = n.indexOf(At), t = e === -1 ? n.length : e;
473
+ n.splice(t, 0, Ot, kt);
472
474
  }
473
475
  e.updateState(e.state.reconfigure({ plugins: n }));
474
476
  }
475
- u(() => kt(), () => {
476
- let e = N.value;
477
- e && Gt(e);
477
+ u(() => jt(), () => {
478
+ let e = M.value;
479
+ e && Kt(e);
478
480
  });
479
- function Kt() {
480
- $.ensureView();
481
- }
482
481
  function qt() {
483
- A += 1, V.value = !1, ct.value = null, L.value = null, Y.activate(null), Ft.dispose(), $.destroyView(), H() && $.ensureView(), X(), $.ensureView(), $.getView() || Jt();
482
+ $.ensureView();
484
483
  }
485
484
  function Jt() {
486
- let e = k.value;
485
+ k += 1, B.value = !1, ut.value = null, I.value = null, J.activate(null), Z.dispose(), $.destroyView(), V() && $.ensureView(), Y(), $.ensureView(), $.getView() || Yt();
486
+ }
487
+ function Yt() {
488
+ let e = O.value;
487
489
  if (e && !l(E)) try {
488
490
  let t = h({
489
491
  document: e,
490
492
  styles: e.package.styles ?? null,
491
- manager: W,
492
- externalPlugins: At(),
493
+ manager: U,
494
+ externalPlugins: Mt(),
493
495
  collaborationModules: null,
494
496
  reason: "mount"
495
497
  });
496
- P.value = t;
497
- let n = A, r = ++j;
498
- M = !0;
498
+ N.value = t;
499
+ let n = k, r = ++A;
500
+ j = !0;
499
501
  let i = () => {
500
- j === r && (M = !1, !(st || A !== n || k.value !== e || $.getView()) && Z(t, { reason: "initial" }));
502
+ A === r && (j = !1, !(lt || k !== n || O.value !== e || $.getView()) && X(t, { reason: "initial" }));
501
503
  };
502
504
  w(e, t.doc).then(i, i);
503
505
  } catch (e) {
@@ -507,32 +509,32 @@ function yt(e) {
507
509
  u([
508
510
  t,
509
511
  a,
510
- at,
512
+ st,
511
513
  ...r ? [r] : []
512
514
  ], () => {
513
- t.value && k.value && !$.getView() && Kt(), X();
515
+ t.value && O.value && !$.getView() && qt(), Y();
514
516
  }, { flush: "post" });
515
- async function Yt(e) {
516
- B.value = null, z.value = !1;
517
+ async function Xt(e) {
518
+ z.value = null, R.value = !1;
517
519
  try {
518
520
  let t = e;
519
- if (H()) {
521
+ if (V()) {
520
522
  let n = await ye(e);
521
523
  if (n.isErr()) throw n.error;
522
524
  t = n.value;
523
525
  }
524
- let n = await be(t, { password: l(Ce) });
525
- k.value = n, qt();
526
+ let n = await be(t, { password: l(Ue) });
527
+ O.value = n, Jt();
526
528
  } catch (e) {
527
529
  let t = e instanceof Error ? e : Error(String(e));
528
- B.value = t.message, D?.(t);
530
+ z.value = t.message, D?.(t);
529
531
  }
530
532
  }
531
- function Xt(e) {
532
- B.value = null, k.value = e, It.reset(), qt();
533
+ function Zt(e) {
534
+ z.value = null, O.value = e, Lt.reset(), Jt();
533
535
  }
534
- async function Zt(e) {
535
- let t = N.value, n = k.value;
536
+ async function Qt(e) {
537
+ let t = M.value, n = O.value;
536
538
  if (!t || !n) return null;
537
539
  try {
538
540
  let t = $.api.captureCanonicalSave();
@@ -540,21 +542,21 @@ function yt(e) {
540
542
  let n = await ve({
541
543
  snapshot: t,
542
544
  options: e,
543
- featureFlags: l(rt)
545
+ featureFlags: l(at)
544
546
  });
545
547
  for (let t of n.diagnostics) e?.onDiagnostic || D?.(new _e({
546
548
  gap: x.save,
547
549
  diagnostic: t,
548
550
  message: `Canonical save used a fidelity fallback: ${t.type} (${t.part}).`
549
551
  }));
550
- return n.tripwireResult && it?.(n.tripwireResult), n;
552
+ return n.tripwireResult && ot?.(n.tripwireResult), n;
551
553
  }
552
554
  } catch (e) {
553
555
  return D?.(e instanceof Error ? e : Error(String(e))), null;
554
556
  }
555
- if (H()) return null;
556
- Q !== null && Lt();
557
- let r = Y.snapshotDocument(J.snapshotDocument(n)), i = t.state, a = Ie(Oe(i.doc, r, { stylesheetSource: { type: "package" } })), { resolveSelectiveSaveFlags: o } = await import("@stll/folio-core/docx/selectiveSaveFlags"), s = o(l(rt)), c = a.originalBuffer ?? null, u = s.selectiveSave && e?.mode !== C.full, d = u || s.selectiveSaveTripwire, { repackDocx: f, createDocx: p } = await import("@stll/folio-core/docx/rezip"), m = null;
557
+ if (V()) return null;
558
+ Q !== null && Rt();
559
+ let r = J.snapshotDocument(q.snapshotDocument(n)), i = t.state, a = Ie(Oe(i.doc, r, { stylesheetSource: { type: "package" } })), { resolveSelectiveSaveFlags: o } = await import("@stll/folio-core/docx/selectiveSaveFlags"), s = o(l(at)), c = a.originalBuffer ?? null, u = s.selectiveSave && e?.mode !== C.full, d = u || s.selectiveSaveTripwire, { repackDocx: f, createDocx: p } = await import("@stll/folio-core/docx/rezip"), m = null;
558
560
  if (d && c) {
559
561
  let { attemptSelectiveSave: e } = await import("@stll/folio-core/docx/selectiveSave");
560
562
  m = await e(a, c, {
@@ -573,105 +575,106 @@ function yt(e) {
573
575
  else if (s.selectiveSaveTripwire) try {
574
576
  g = await ee();
575
577
  } catch {}
576
- if (s.selectiveSaveTripwire && g && it) try {
578
+ if (s.selectiveSaveTripwire && g && ot) try {
577
579
  let { compareSelectiveVsFull: e } = await import("@stll/folio-core/docx/selectiveSaveTripwire");
578
- it(await e(m, g));
580
+ ot(await e(m, g));
579
581
  } catch {}
580
582
  return {
581
583
  buffer: h,
582
584
  document: a
583
585
  };
584
586
  }
585
- async function Qt(e) {
586
- let t = N.value, n = t?.state, r = await Zt({ mode: e?.selective === !1 ? C.full : C.preferSelective });
587
- return r ? (N.value === t && t?.state.doc === n?.doc && (r.version === void 0 || $.api.isCanonicalSaveCurrent(r.version)) && (k.value = r.document, X(), V.value = !1), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
587
+ async function $t(e) {
588
+ let t = M.value, n = t?.state, r = await Qt({ mode: e?.selective === !1 ? C.full : C.preferSelective });
589
+ return r ? (M.value === t && t?.state.doc === n?.doc && (r.version === void 0 || $.api.isCanonicalSaveCurrent(r.version)) && (O.value = r.document, Y(), B.value = !1), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
588
590
  }
589
- function $t() {
591
+ function en() {
590
592
  let e = $.api.getCanonicalDocument();
591
593
  if (e) return e;
592
- if (H()) return null;
593
- let t = k.value;
594
+ if (V()) return null;
595
+ let t = O.value;
594
596
  if (!t) return null;
595
597
  let n = $.api.getDocument() ?? t;
596
- return U(Y.snapshotDocument(J.snapshotDocument(n)));
597
- }
598
- function en(e) {
599
- xt(x.modelEdits, "Direct document model changes are unavailable in this session.") || (k.value = e, X(), L.value && !Y.getView(L.value) && (L.value = null));
598
+ return H(J.snapshotDocument(q.snapshotDocument(n)));
600
599
  }
601
600
  function tn(e) {
602
- return J.getView(e);
601
+ Ct(x.modelEdits, "Direct document model changes are unavailable in this session.") || (O.value = e, Y(), I.value && !J.getView(I.value) && (I.value = null));
603
602
  }
604
- function nn() {
605
- X();
603
+ function nn(e) {
604
+ return q.getView(e);
606
605
  }
607
- function rn(e) {
608
- let t = Y.activate(e);
609
- t && (Wt(t), L.value = e, requestAnimationFrame(() => t.focus()));
606
+ function rn() {
607
+ Y();
610
608
  }
611
- function an() {
612
- Y.activate(null), L.value = null;
609
+ function an(e) {
610
+ let t = J.activate(e);
611
+ t && (Gt(t), I.value = e, requestAnimationFrame(() => t.focus()));
613
612
  }
614
613
  function on() {
615
- let e = L.value;
616
- return e ? Y.getView(e) : null;
614
+ J.activate(null), I.value = null;
617
615
  }
618
616
  function sn() {
619
- return W.getCommands();
617
+ let e = I.value;
618
+ return e ? J.getView(e) : null;
620
619
  }
621
620
  function cn() {
622
- let e = on();
623
- e ? e.focus() : N.value?.focus();
621
+ return U.getCommands();
624
622
  }
625
623
  function ln() {
626
- let e = N.value;
627
- e && Z(e.state, { reason: "manual" });
624
+ let e = sn();
625
+ e ? e.focus() : M.value?.focus();
626
+ }
627
+ function un() {
628
+ let e = M.value;
629
+ e && X(e.state, { reason: "manual" });
628
630
  }
629
631
  u([
630
- () => l(xe),
631
632
  () => l(Se),
633
+ () => l(Ce),
632
634
  () => l(_),
633
635
  () => l(v),
634
- () => l(b)
635
- ], () => ln());
636
- function un() {
637
- st = !0, a.value && Ee(a.value), j += 1, M = !1, Ft.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), $.destroyView(), I.value = [], J.destroy(), Y.destroy(), W.destroy(), P.value = null, R.value = null, k.value = null, z.value = !1;
636
+ () => l(b),
637
+ () => l(xe)
638
+ ], () => un());
639
+ function dn() {
640
+ lt = !0, a.value && Ee(a.value), A += 1, j = !1, Z.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), $.destroyView(), F.value = [], q.destroy(), J.destroy(), U.destroy(), N.value = null, L.value = null, O.value = null, R.value = !1;
638
641
  }
639
- return i(un), {
642
+ return i(dn), {
640
643
  setEmbeddedFontFamilies: (e) => {
641
- e ? q.embeddedFontFamilyMap = new Map(e) : delete q.embeddedFontFamilyMap;
644
+ e ? K.embeddedFontFamilyMap = new Map(e) : delete K.embeddedFontFamilyMap;
642
645
  },
643
- editor: Ut,
644
- editorView: N,
645
- editorState: P,
646
- remoteSelections: I,
647
- headerFooterSelection: ct,
648
- activeNoteStory: L,
649
- isReady: z,
650
- isDirty: V,
651
- parseError: B,
652
- layout: R,
653
- blocks: yt,
654
- measures: bt,
655
- syncCoordinator: K,
656
- loadBuffer: Yt,
657
- loadDocument: Xt,
658
- save: Qt,
659
- getDocument: $t,
660
- setDocument: en,
661
- getHeaderFooterView: tn,
662
- syncHeaderFooterViews: nn,
663
- openNoteStory: rn,
664
- closeNoteStory: an,
665
- getActiveNoteView: on,
666
- getCommands: sn,
667
- focus: cn,
668
- reLayout: ln,
669
- destroy: un
646
+ editor: Wt,
647
+ editorView: M,
648
+ editorState: N,
649
+ remoteSelections: F,
650
+ headerFooterSelection: ut,
651
+ activeNoteStory: I,
652
+ isReady: R,
653
+ isDirty: B,
654
+ parseError: z,
655
+ layout: L,
656
+ blocks: xt,
657
+ measures: St,
658
+ syncCoordinator: G,
659
+ loadBuffer: Xt,
660
+ loadDocument: Zt,
661
+ save: $t,
662
+ getDocument: en,
663
+ setDocument: tn,
664
+ getHeaderFooterView: nn,
665
+ syncHeaderFooterViews: rn,
666
+ openNoteStory: an,
667
+ closeNoteStory: on,
668
+ getActiveNoteView: sn,
669
+ getCommands: cn,
670
+ focus: ln,
671
+ reLayout: un,
672
+ destroy: dn
670
673
  };
671
674
  }
672
675
  // src/composables/useFindReplace.ts
673
- function bt({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot: l, revealComment: d, displayMode: f, readOnly: p, onReadonlyEditAttempt: m, onResultChange: h }) {
674
- let g = new Ue(), _ = s(""), v = s(""), te = o(qe()), y = c([]), b = s(-1), x = e(() => y.value.at(b.value) ?? null), ne = () => ee({
676
+ function xt({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot: l, revealComment: d, displayMode: f, readOnly: p, onReadonlyEditAttempt: m, onResultChange: h }) {
677
+ let g = new Ue(), _ = s(""), v = s(""), te = o(E()), y = c([]), b = s(-1), x = e(() => y.value.at(b.value) ?? null), ne = () => ee({
675
678
  editingMode: t.value?.editable === !1 ? "viewing" : "editing",
676
679
  readOnlyProp: p.value,
677
680
  displayMode: f.value
@@ -689,7 +692,7 @@ function bt({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot
689
692
  },
690
693
  document: e,
691
694
  ...n ? { bodyVersion: n } : {},
692
- context: { renderedStories: E(a.value) }
695
+ context: { renderedStories: qe(a.value) }
693
696
  };
694
697
  }, se = () => {
695
698
  let e = r();
@@ -723,7 +726,7 @@ function bt({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot
723
726
  }) : null, S?.paint(b.value), u.at(0) && !f ? fe(0) : w(), u;
724
727
  }, pe = () => {
725
728
  le(), ae = setTimeout(() => T("refresh"), 120);
726
- }, me = (e, t) => (_.value = e, Object.assign(te, qe(), t), T(), ce()), he = (e) => {
729
+ }, me = (e, t) => (_.value = e, Object.assign(te, E(), t), T(), ce()), he = (e) => {
727
730
  let t = g.goTo(e);
728
731
  return t ? fe(t.index) : !1;
729
732
  }, ge = (e) => {
@@ -783,7 +786,7 @@ function bt({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot
783
786
  clear: de
784
787
  };
785
788
  }
786
- function z(e, t) {
789
+ function St(e, t) {
787
790
  if (t < e.top + 40) {
788
791
  let n = Math.max(0, e.top + 40 - t);
789
792
  return -Math.min(12, n / 40 * 12);
@@ -795,7 +798,7 @@ function z(e, t) {
795
798
  return 0;
796
799
  }
797
800
  // src/composables/useDragAutoScroll.ts
798
- function B({ pagesContainer: e, onScrollExtendSelection: t }) {
801
+ function R({ pagesContainer: e, onScrollExtendSelection: t }) {
799
802
  let n = null, r = 0, a = 0, o = !1;
800
803
  function s() {
801
804
  return _(e.value);
@@ -807,7 +810,7 @@ function B({ pagesContainer: e, onScrollExtendSelection: t }) {
807
810
  if (!o) return;
808
811
  let e = s();
809
812
  if (!e) return;
810
- let i = z(e.getBoundingClientRect(), a);
813
+ let i = St(e.getBoundingClientRect(), a);
811
814
  i !== 0 && (v(e, i), t(r, a)), n = requestAnimationFrame(l);
812
815
  }
813
816
  function u() {
@@ -827,7 +830,7 @@ function B({ pagesContainer: e, onScrollExtendSelection: t }) {
827
830
  };
828
831
  }
829
832
  // src/composables/useTableResize.ts
830
- function V() {
833
+ function z() {
831
834
  let e = {
832
835
  active: !1,
833
836
  startX: 0,
@@ -846,7 +849,7 @@ function V() {
846
849
  isEdge: !1,
847
850
  tablePmStart: 0,
848
851
  origHeight: 0,
849
- minimumHeight: D
852
+ minimumHeight: Qe
850
853
  }, n = {
851
854
  active: !1,
852
855
  startX: 0,
@@ -860,14 +863,14 @@ function V() {
860
863
  }
861
864
  function a(i, a) {
862
865
  let o = i.target;
863
- return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (i.preventDefault(), i.stopPropagation(), r = a, e.active = !0, e.startX = i.clientX, e.handle = o, o.classList.add("dragging"), e.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), e.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), H(a, e), !0) : o.classList.contains("layout-table-row-resize-handle") || o.classList.contains("layout-table-edge-handle-bottom") ? (i.preventDefault(), i.stopPropagation(), r = a, t.active = !0, t.startY = i.clientY, t.handle = o, t.isEdge = o.dataset.isEdge === "bottom", o.classList.add("dragging"), t.rowIndex = parseInt(o.dataset.rowIndex ?? "0", 10), t.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), U(a, t, o), !0) : o.classList.contains("layout-table-edge-handle-right") ? (i.preventDefault(), i.stopPropagation(), r = a, n.active = !0, n.startX = i.clientX, n.handle = o, o.classList.add("dragging"), n.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), n.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), xt(a, n), !0) : !1 : !1;
866
+ return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (i.preventDefault(), i.stopPropagation(), r = a, e.active = !0, e.startX = i.clientX, e.handle = o, o.classList.add("dragging"), e.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), e.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), B(a, e), !0) : o.classList.contains("layout-table-row-resize-handle") || o.classList.contains("layout-table-edge-handle-bottom") ? (i.preventDefault(), i.stopPropagation(), r = a, t.active = !0, t.startY = i.clientY, t.handle = o, t.isEdge = o.dataset.isEdge === "bottom", o.classList.add("dragging"), t.rowIndex = parseInt(o.dataset.rowIndex ?? "0", 10), t.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), V(a, t, o), !0) : o.classList.contains("layout-table-edge-handle-right") ? (i.preventDefault(), i.stopPropagation(), r = a, n.active = !0, n.startX = i.clientX, n.handle = o, o.classList.add("dragging"), n.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), n.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), H(a, n), !0) : !1 : !1;
864
867
  }
865
868
  function o(r) {
866
869
  if (e.active && e.handle) {
867
870
  r.preventDefault();
868
871
  let t = r.clientX - e.startX, n = parseFloat(e.handle.style.left);
869
872
  e.handle.style.left = `${n + t}px`, e.startX = r.clientX;
870
- let i = Math.round(t * O), a = e.origWidths.left + i, o = e.origWidths.right - i;
873
+ let i = Math.round(t * D), a = e.origWidths.left + i, o = e.origWidths.right - i;
871
874
  a >= Ze && o >= Ze && (e.origWidths = {
872
875
  left: a,
873
876
  right: o
@@ -876,31 +879,31 @@ function V() {
876
879
  r.preventDefault();
877
880
  let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
878
881
  t.startY = r.clientY;
879
- let i = Math.round(e * O), a = Qe({
882
+ let i = Math.round(e * D), a = $e({
880
883
  currentHeight: t.origHeight,
881
884
  delta: i,
882
885
  minimumHeight: t.minimumHeight
883
886
  });
884
- t.handle.style.top = `${n + a / O}px`, t.origHeight += a;
887
+ t.handle.style.top = `${n + a / D}px`, t.origHeight += a;
885
888
  } else if (n.active && n.handle) {
886
889
  r.preventDefault();
887
890
  let e = r.clientX - n.startX, t = parseFloat(n.handle.style.left);
888
891
  n.handle.style.left = `${t + e}px`, n.startX = r.clientX;
889
- let i = Math.round(e * O), a = n.origWidth + i;
892
+ let i = Math.round(e * D), a = n.origWidth + i;
890
893
  a >= Ze && (n.origWidth = a);
891
894
  }
892
895
  }
893
896
  function s(i) {
894
- e.active ? (e.active = !1, e.handle?.classList.remove("dragging"), r && $e(r, {
897
+ e.active ? (e.active = !1, e.handle?.classList.remove("dragging"), r && et(r, {
895
898
  pmStart: e.tablePmStart,
896
899
  colIdx: e.columnIndex,
897
900
  newLeft: e.origWidths.left,
898
901
  newRight: e.origWidths.right
899
- }), e.handle = null) : t.active ? (t.active = !1, t.handle?.classList.remove("dragging"), r && tt(r, {
902
+ }), e.handle = null) : t.active ? (t.active = !1, t.handle?.classList.remove("dragging"), r && nt(r, {
900
903
  pmStart: t.tablePmStart,
901
904
  rowIdx: t.rowIndex,
902
905
  newHeight: t.origHeight
903
- }), t.handle = null) : n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && et(r, {
906
+ }), t.handle = null) : n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && tt(r, {
904
907
  pmStart: n.tablePmStart,
905
908
  colIdx: n.columnIndex,
906
909
  newWidth: n.origWidth
@@ -917,29 +920,29 @@ function V() {
917
920
  isResizing: i
918
921
  };
919
922
  }
920
- function H(e, t) {
921
- let n = rt(e, t.tablePmStart, t.columnIndex);
923
+ function B(e, t) {
924
+ let n = it(e, t.tablePmStart, t.columnIndex);
922
925
  n && (t.origWidths = n);
923
926
  }
924
- function U(e, t, n) {
925
- let r = it(e, t.tablePmStart, t.rowIndex);
927
+ function V(e, t, n) {
928
+ let r = at(e, t.tablePmStart, t.rowIndex);
926
929
  if (r != null) t.origHeight = r;
927
930
  else {
928
931
  let e = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), r = e ? e.getBoundingClientRect().height : 30;
929
- t.origHeight = Math.round(r * O);
932
+ t.origHeight = Math.round(r * D);
930
933
  }
931
- t.minimumHeight = Math.min(D, t.origHeight);
934
+ t.minimumHeight = Math.min(Qe, t.origHeight);
932
935
  }
933
- function xt(e, t) {
934
- let n = nt(e, t.tablePmStart, t.columnIndex);
936
+ function H(e, t) {
937
+ let n = rt(e, t.tablePmStart, t.columnIndex);
935
938
  n != null && (t.origWidth = n);
936
939
  }
937
940
  // src/composables/useTrackedChanges.ts
938
- function W(t, n) {
939
- return e(() => (n.value, at(t.value?.state ?? null)));
941
+ function Ct(t, n) {
942
+ return e(() => (n.value, ot(t.value?.state ?? null)));
940
943
  }
941
944
  // src/composables/useZoom.ts
942
- var St = k, Ct = ot, wt = [
945
+ var U = ct, wt = st, Tt = [
943
946
  .5,
944
947
  .75,
945
948
  1,
@@ -947,16 +950,16 @@ var St = k, Ct = ot, wt = [
947
950
  1.5,
948
951
  2
949
952
  ];
950
- function Tt(t = 1) {
951
- let i = s(Math.max(St, Math.min(Ct, t))), a = e(() => Math.round(i.value * 100)), o = e(() => i.value <= St), c = e(() => i.value >= Ct);
953
+ function Et(t = 1) {
954
+ let i = s(Math.max(U, Math.min(wt, t))), a = e(() => Math.round(i.value * 100)), o = e(() => i.value <= U), c = e(() => i.value >= wt);
952
955
  function l(e) {
953
- i.value = Math.max(St, Math.min(Ct, Math.round(e * 100) / 100));
956
+ i.value = Math.max(U, Math.min(wt, Math.round(e * 100) / 100));
954
957
  }
955
958
  function u() {
956
- l(i.value + A);
959
+ l(i.value + O);
957
960
  }
958
961
  function d() {
959
- l(i.value - A);
962
+ l(i.value - O);
960
963
  }
961
964
  function f() {
962
965
  l(1);
@@ -982,7 +985,7 @@ function Tt(t = 1) {
982
985
  handleWheel: p,
983
986
  handleKeyDown: m,
984
987
  installShortcuts: h,
985
- ZOOM_PRESETS: wt
988
+ ZOOM_PRESETS: Tt
986
989
  };
987
990
  }
988
- export { B as a, ct as c, L as d, V as i, P as l, at as n, bt as o, W as r, yt as s, Tt as t, I as u };
991
+ export { R as a, F as c, ut as d, z as i, M as l, ot as n, xt as o, Ct as r, L as s, Et as t, P as u };