@stll/folio-vue 0.2.0 → 0.4.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.
package/dist/ui.js CHANGED
@@ -1,10 +1,9 @@
1
- import { a as e, i as t, n, r, t as i, u as a } from "./PageSetupDialog-DsjAfJy0.js";
2
- import { A as o, D as s, E as c, F as l, I as u, M as d, N as f, O as ee, P as p, T as m, _ as h, a as g, b as _, c as v, d as y, f as b, g as x, h as S, i as te, j as ne, k as re, l as ie, m as ae, o as oe, p as se, r as ce, s as le, t as ue, u as de, v as C, w, y as T } from "./ListButtons-B498PX1d.js";
3
- import { a as E, i as D, n as O, r as k, t as A } from "./TablePropertiesDialog-PyXEJC_o.js";
4
- import { Fragment as j, computed as M, createBlock as N, createCommentVNode as P, createElementBlock as F, createElementVNode as I, createTextVNode as L, createVNode as R, defineComponent as z, guardReactiveProps as B, normalizeClass as V, normalizeProps as H, normalizeStyle as U, openBlock as W, ref as G, renderList as K, renderSlot as q, toDisplayString as J, withCtx as Y, withKeys as X, withModifiers as Z } from "vue";
1
+ import { C as e, D as t, E as n, F as r, M as i, N as a, P as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as ee, f as te, h as ne, i as re, l as ie, m as ae, n as oe, o as se, p as ce, r as p, s as le, t as ue, u as de, v as fe, w as m, x as pe, y as h } from "./WatermarkDialog-D-uTab0-.js";
2
+ import { C as me, D as he, E as ge, O as _e, S as ve, T as g, _ as ye, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as w, l as T, m as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as be, y as xe } from "./ListButtons-BaILr4AO.js";
3
+ import { Fragment as F, computed as I, createBlock as L, createCommentVNode as R, createElementBlock as z, createElementVNode as B, createTextVNode as Se, createVNode as V, defineComponent as H, guardReactiveProps as Ce, normalizeClass as U, normalizeProps as we, normalizeStyle as W, openBlock as G, ref as K, renderList as q, renderSlot as J, toDisplayString as Y, unref as Te, withCtx as X, withKeys as Z, withModifiers as Q } from "vue";
5
4
  import "@stll/folio-core/utils/units";
6
5
  //#region src/components/EditorToolbar.vue?vue&type=script&setup=true&lang.ts
7
- var fe = { class: "docx-editor-toolbar" }, pe = { class: "docx-editor-toolbar__title-row" }, me = { class: "docx-editor-toolbar__title-left" }, he = { class: "docx-editor-toolbar__title-center" }, ge = { class: "docx-editor-toolbar__title-right" }, _e = /*#__PURE__*/ a(/* @__PURE__ */ z({
6
+ var Ee = { class: "docx-editor-toolbar" }, De = { class: "docx-editor-toolbar__title-row" }, Oe = { class: "docx-editor-toolbar__title-left" }, ke = { class: "docx-editor-toolbar__title-center" }, Ae = { class: "docx-editor-toolbar__title-right" }, je = /*#__PURE__*/ r(/* @__PURE__ */ H({
8
7
  inheritAttrs: !1,
9
8
  __name: "EditorToolbar",
10
9
  props: { showMenuBar: {
@@ -13,27 +12,27 @@ var fe = { class: "docx-editor-toolbar" }, pe = { class: "docx-editor-toolbar__t
13
12
  } },
14
13
  emits: ["menu-action"],
15
14
  setup(e) {
16
- return (t, n) => (W(), F("div", fe, [q(t.$slots, "title-bar", {}, () => [I("div", pe, [
17
- I("div", me, [q(t.$slots, "title-bar-left", {}, void 0, !0)]),
18
- I("div", he, [q(t.$slots, "document-name", {}, void 0, !0), e.showMenuBar ? (W(), N(o, {
15
+ return (t, n) => (G(), z("div", Ee, [J(t.$slots, "title-bar", {}, () => [B("div", De, [
16
+ B("div", Oe, [J(t.$slots, "title-bar-left", {}, void 0, !0)]),
17
+ B("div", ke, [J(t.$slots, "document-name", {}, void 0, !0), e.showMenuBar ? (G(), L(g, {
19
18
  key: 0,
20
19
  onAction: n[0] ||= (e) => t.$emit("menu-action", e)
21
- })) : P("", !0)]),
22
- I("div", ge, [q(t.$slots, "title-bar-right", {}, void 0, !0)])
23
- ])], !0), q(t.$slots, "toolbar", {}, () => [R(_, H(B(t.$attrs)), null, 16)], !0)]));
20
+ })) : R("", !0)]),
21
+ B("div", Ae, [J(t.$slots, "title-bar-right", {}, void 0, !0)])
22
+ ])], !0), J(t.$slots, "toolbar", {}, () => [V(v, we(Ce(t.$attrs)), null, 16)], !0)]));
24
23
  }
25
- }), [["__scopeId", "data-v-f2023632"]]), ve = {}, ye = { class: "docx-title-bar" }, be = { class: "docx-title-bar__left" }, xe = { class: "docx-title-bar__center" }, Se = { class: "docx-title-bar__right" };
26
- function Ce(e, t) {
27
- return W(), F("div", ye, [
28
- I("div", be, [q(e.$slots, "left", {}, void 0, !0)]),
29
- I("div", xe, [q(e.$slots, "default", {}, void 0, !0)]),
30
- I("div", Se, [q(e.$slots, "right", {}, void 0, !0)])
24
+ }), [["__scopeId", "data-v-f2023632"]]), Me = {}, Ne = { class: "docx-title-bar" }, Pe = { class: "docx-title-bar__left" }, Fe = { class: "docx-title-bar__center" }, Ie = { class: "docx-title-bar__right" };
25
+ function Le(e, t) {
26
+ return G(), z("div", Ne, [
27
+ B("div", Pe, [J(e.$slots, "left", {}, void 0, !0)]),
28
+ B("div", Fe, [J(e.$slots, "default", {}, void 0, !0)]),
29
+ B("div", Ie, [J(e.$slots, "right", {}, void 0, !0)])
31
30
  ]);
32
31
  }
33
- var we = /*#__PURE__*/ a(ve, [["render", Ce], ["__scopeId", "data-v-ae11d49f"]]);
32
+ var Re = /*#__PURE__*/ r(Me, [["render", Le], ["__scopeId", "data-v-ae11d49f"]]);
34
33
  //#endregion
35
34
  //#region src/components/ui/fontPickerValue.ts
36
- function Q(e) {
35
+ function $(e) {
37
36
  let t = e.trim();
38
37
  if (!t) return "";
39
38
  let n = null, r = "";
@@ -53,19 +52,19 @@ function Q(e) {
53
52
  }
54
53
  //#endregion
55
54
  //#region src/components/ui/FontPicker.vue?vue&type=script&setup=true&lang.ts
56
- var Te = ["value", "disabled"], Ee = {
55
+ var ze = ["value", "disabled"], Be = {
57
56
  key: 0,
58
57
  label: "Sans-serif"
59
- }, De = ["value"], Oe = {
58
+ }, Ve = ["value"], He = {
60
59
  key: 1,
61
60
  label: "Serif"
62
- }, ke = ["value"], Ae = {
61
+ }, Ue = ["value"], We = {
63
62
  key: 2,
64
63
  label: "Monospace"
65
- }, je = ["value"], Me = {
64
+ }, Ge = ["value"], Ke = {
66
65
  key: 3,
67
66
  label: "Other"
68
- }, Ne = ["value"], Pe = /*#__PURE__*/ a(/* @__PURE__ */ z({
67
+ }, qe = ["value"], Je = /*#__PURE__*/ r(/* @__PURE__ */ H({
69
68
  __name: "FontPicker",
70
69
  props: {
71
70
  value: {},
@@ -144,7 +143,7 @@ var Te = ["value", "disabled"], Ee = {
144
143
  fontFamily: "Consolas, monospace",
145
144
  category: "monospace"
146
145
  }
147
- ], a = M(() => n.fonts ?? i), o = M(() => {
146
+ ], a = I(() => n.fonts ?? i), o = I(() => {
148
147
  let e = {
149
148
  "sans-serif": [],
150
149
  serif: [],
@@ -153,51 +152,51 @@ var Te = ["value", "disabled"], Ee = {
153
152
  };
154
153
  for (let t of a.value) e[t.category ?? "other"].push(t);
155
154
  return e;
156
- }), s = M(() => {
155
+ }), s = I(() => {
157
156
  let e = n.value;
158
157
  if (!e) return n.placeholder;
159
158
  let t = e.toLowerCase();
160
- return a.value.find((n) => n.fontFamily === e || n.name.toLowerCase() === t || Q(n.fontFamily).toLowerCase() === t)?.name ?? e;
159
+ return a.value.find((n) => n.fontFamily === e || n.name.toLowerCase() === t || $(n.fontFamily).toLowerCase() === t)?.name ?? e;
161
160
  });
162
161
  function c(e) {
163
162
  if (!(e.target instanceof HTMLSelectElement)) return;
164
163
  let t = e.target.value, n = a.value.find((e) => e.name === t);
165
- r("change", n ? Q(n.fontFamily) || n.name : t);
164
+ r("change", n ? $(n.fontFamily) || n.name : t);
166
165
  }
167
- return (t, n) => (W(), F("select", {
168
- class: V(["docx-font-picker", e.className]),
166
+ return (t, n) => (G(), z("select", {
167
+ class: U(["docx-font-picker", e.className]),
169
168
  value: s.value,
170
169
  disabled: e.disabled,
171
170
  "aria-label": "Font family",
172
171
  onChange: c
173
172
  }, [
174
- o.value["sans-serif"].length ? (W(), F("optgroup", Ee, [(W(!0), F(j, null, K(o.value["sans-serif"], (t) => (W(), F("option", {
173
+ o.value["sans-serif"].length ? (G(), z("optgroup", Be, [(G(!0), z(F, null, q(o.value["sans-serif"], (t) => (G(), z("option", {
175
174
  key: t.name,
176
175
  value: t.name,
177
- style: U(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
178
- }, J(t.name), 13, De))), 128))])) : P("", !0),
179
- o.value.serif.length ? (W(), F("optgroup", Oe, [(W(!0), F(j, null, K(o.value.serif, (t) => (W(), F("option", {
176
+ style: W(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
177
+ }, Y(t.name), 13, Ve))), 128))])) : R("", !0),
178
+ o.value.serif.length ? (G(), z("optgroup", He, [(G(!0), z(F, null, q(o.value.serif, (t) => (G(), z("option", {
180
179
  key: t.name,
181
180
  value: t.name,
182
- style: U(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
183
- }, J(t.name), 13, ke))), 128))])) : P("", !0),
184
- o.value.monospace.length ? (W(), F("optgroup", Ae, [(W(!0), F(j, null, K(o.value.monospace, (t) => (W(), F("option", {
181
+ style: W(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
182
+ }, Y(t.name), 13, Ue))), 128))])) : R("", !0),
183
+ o.value.monospace.length ? (G(), z("optgroup", We, [(G(!0), z(F, null, q(o.value.monospace, (t) => (G(), z("option", {
185
184
  key: t.name,
186
185
  value: t.name,
187
- style: U(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
188
- }, J(t.name), 13, je))), 128))])) : P("", !0),
189
- o.value.other.length ? (W(), F("optgroup", Me, [(W(!0), F(j, null, K(o.value.other, (t) => (W(), F("option", {
186
+ style: W(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
187
+ }, Y(t.name), 13, Ge))), 128))])) : R("", !0),
188
+ o.value.other.length ? (G(), z("optgroup", Ke, [(G(!0), z(F, null, q(o.value.other, (t) => (G(), z("option", {
190
189
  key: t.name,
191
190
  value: t.name,
192
- style: U(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
193
- }, J(t.name), 13, Ne))), 128))])) : P("", !0)
194
- ], 42, Te));
191
+ style: W(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
192
+ }, Y(t.name), 13, qe))), 128))])) : R("", !0)
193
+ ], 42, ze));
195
194
  }
196
- }), [["__scopeId", "data-v-1a9a9f88"]]), Fe = { class: "docx-font-size" }, Ie = ["disabled"], Le = [
195
+ }), [["__scopeId", "data-v-1a9a9f88"]]), Ye = { class: "docx-font-size" }, Xe = ["disabled"], Ze = [
197
196
  "value",
198
197
  "disabled",
199
198
  "placeholder"
200
- ], Re = ["disabled"], ze = /*#__PURE__*/ a(/* @__PURE__ */ z({
199
+ ], Qe = ["disabled"], $e = /*#__PURE__*/ r(/* @__PURE__ */ H({
201
200
  __name: "FontSizePicker",
202
201
  props: {
203
202
  value: {},
@@ -227,7 +226,7 @@ var Te = ["value", "disabled"], Ee = {
227
226
  36,
228
227
  48,
229
228
  72
230
- ], a = M(() => n.sizes ?? i), o = M(() => n.value ?? parseInt(n.placeholder, 10) ?? 11), s = M(() => n.value === void 0 ? n.placeholder : String(n.value));
229
+ ], a = I(() => n.sizes ?? i), o = I(() => n.value ?? parseInt(n.placeholder, 10) ?? 11), s = I(() => n.value === void 0 ? n.placeholder : String(n.value));
231
230
  function c(e) {
232
231
  return a.value.find((t) => t > e) ?? Math.min(e + 1, n.maxSize);
233
232
  }
@@ -245,41 +244,41 @@ var Te = ["value", "disabled"], Ee = {
245
244
  let t = parseFloat(e.target.value);
246
245
  !isNaN(t) && t >= n.minSize && t <= n.maxSize && r("change", Math.round(t * 2) / 2);
247
246
  }
248
- return (t, n) => (W(), F("div", Fe, [
249
- I("button", {
247
+ return (t, n) => (G(), z("div", Ye, [
248
+ B("button", {
250
249
  type: "button",
251
250
  class: "docx-font-size__btn",
252
251
  disabled: e.disabled || o.value <= e.minSize,
253
252
  title: "Decrease font size",
254
- onClick: Z(u, ["prevent"])
255
- }, "−", 8, Ie),
256
- I("input", {
253
+ onClick: Q(u, ["prevent"])
254
+ }, "−", 8, Xe),
255
+ B("input", {
257
256
  class: "docx-font-size__input",
258
257
  type: "text",
259
258
  value: s.value,
260
259
  disabled: e.disabled,
261
260
  placeholder: e.placeholder,
262
261
  onKeydown: [
263
- n[0] ||= X(Z((e) => {
262
+ n[0] ||= Z(Q((e) => {
264
263
  u(), e.stopPropagation();
265
264
  }, ["prevent"]), ["up"]),
266
- n[1] ||= X(Z((e) => {
265
+ n[1] ||= Z(Q((e) => {
267
266
  d(), e.stopPropagation();
268
267
  }, ["prevent"]), ["down"]),
269
- n[2] ||= X(Z((e) => f(e), ["prevent"]), ["enter"])
268
+ n[2] ||= Z(Q((e) => f(e), ["prevent"]), ["enter"])
270
269
  ],
271
270
  onBlur: n[3] ||= (e) => f(e)
272
- }, null, 40, Le),
273
- I("button", {
271
+ }, null, 40, Ze),
272
+ B("button", {
274
273
  type: "button",
275
274
  class: "docx-font-size__btn",
276
275
  disabled: e.disabled || o.value >= e.maxSize,
277
276
  title: "Increase font size",
278
- onClick: Z(d, ["prevent"])
279
- }, "+", 8, Re)
277
+ onClick: Q(d, ["prevent"])
278
+ }, "+", 8, Qe)
280
279
  ]));
281
280
  }
282
- }), [["__scopeId", "data-v-4e8ada55"]]), $ = ["value", "disabled"], Be = ["value"], Ve = /*#__PURE__*/ a(/* @__PURE__ */ z({
281
+ }), [["__scopeId", "data-v-4e8ada55"]]), et = ["value", "disabled"], tt = ["value"], nt = /*#__PURE__*/ r(/* @__PURE__ */ H({
283
282
  __name: "LineSpacingPicker",
284
283
  props: {
285
284
  value: {},
@@ -313,29 +312,29 @@ var Te = ["value", "disabled"], Ee = {
313
312
  value: 2,
314
313
  twipsValue: 480
315
314
  }
316
- ], a = M(() => n.options ?? i), o = M(() => n.value ?? a.value[0]?.twipsValue ?? 240);
315
+ ], a = I(() => n.options ?? i), o = I(() => n.value ?? a.value[0]?.twipsValue ?? 240);
317
316
  function s(e) {
318
317
  if (!(e.target instanceof HTMLSelectElement)) return;
319
318
  let t = parseInt(e.target.value, 10);
320
319
  isNaN(t) || r("change", t);
321
320
  }
322
- return (t, n) => (W(), F("select", {
323
- class: V(["docx-line-spacing", e.className]),
321
+ return (t, n) => (G(), z("select", {
322
+ class: U(["docx-line-spacing", e.className]),
324
323
  value: String(o.value),
325
324
  disabled: e.disabled,
326
325
  "aria-label": "Line spacing",
327
326
  onChange: s
328
- }, [(W(!0), F(j, null, K(a.value, (e) => (W(), F("option", {
327
+ }, [(G(!0), z(F, null, q(a.value, (e) => (G(), z("option", {
329
328
  key: e.twipsValue,
330
329
  value: String(e.twipsValue)
331
- }, J(e.label), 9, Be))), 128))], 42, $));
330
+ }, Y(e.label), 9, tt))), 128))], 42, et));
332
331
  }
333
- }), [["__scopeId", "data-v-fcda8ecc"]]), He = [
332
+ }), [["__scopeId", "data-v-fcda8ecc"]]), rt = [
334
333
  "disabled",
335
334
  "aria-expanded",
336
335
  "title",
337
336
  "onClick"
338
- ], Ue = { class: "docx-table-grid__panel" }, We = { class: "docx-table-grid__label" }, Ge = ["onMouseenter", "onClick"], Ke = /*#__PURE__*/ a(/* @__PURE__ */ z({
337
+ ], it = { class: "docx-table-grid__panel" }, at = { class: "docx-table-grid__label" }, ot = ["onMouseenter", "onClick"], st = /*#__PURE__*/ r(/* @__PURE__ */ H({
339
338
  __name: "TableGridPicker",
340
339
  props: {
341
340
  disabled: {
@@ -348,62 +347,62 @@ var Te = ["value", "disabled"], Ee = {
348
347
  },
349
348
  emits: ["insert"],
350
349
  setup(e, { emit: t }) {
351
- let n = e, r = t, i = G(!1), a = G({
350
+ let { Popover: n } = h(), r = e, i = t, a = K(!1), s = K({
352
351
  rows: 1,
353
352
  cols: 1
354
- }), o = M(() => {
353
+ }), c = I(() => {
355
354
  let e = [];
356
- for (let t = 1; t <= n.gridRows; t++) for (let r = 1; r <= n.gridColumns; r++) e.push({
355
+ for (let t = 1; t <= r.gridRows; t++) for (let n = 1; n <= r.gridColumns; n++) e.push({
357
356
  r: t,
358
- c: r
357
+ c: n
359
358
  });
360
359
  return e;
361
360
  });
362
- function s(e, t) {
363
- r("insert", e, t), i.value = !1;
361
+ function l(e, t) {
362
+ i("insert", e, t), a.value = !1;
364
363
  }
365
- function c() {
366
- i.value = !1, a.value = {
364
+ function u() {
365
+ a.value = !1, s.value = {
367
366
  rows: 1,
368
367
  cols: 1
369
368
  };
370
369
  }
371
- return (t, n) => (W(), N(f, {
372
- open: i.value,
373
- "onUpdate:open": n[0] ||= (e) => i.value = e,
374
- onClose: c
370
+ return (t, r) => (G(), L(Te(n), {
371
+ open: a.value,
372
+ "onUpdate:open": r[0] ||= (e) => a.value = e,
373
+ onClose: u
375
374
  }, {
376
- trigger: Y(({ toggle: t }) => [I("button", {
375
+ trigger: X(({ toggle: t }) => [B("button", {
377
376
  type: "button",
378
377
  class: "docx-table-grid__btn",
379
378
  disabled: e.disabled,
380
- "aria-expanded": i.value,
379
+ "aria-expanded": a.value,
381
380
  "aria-haspopup": "grid",
382
381
  title: e.tooltip,
383
- onClick: Z(t, ["prevent"])
384
- }, [R(u, {
382
+ onClick: Q(t, ["prevent"])
383
+ }, [V(o, {
385
384
  name: "grid_on",
386
385
  size: 20
387
- })], 8, He)]),
388
- panel: Y(() => [I("div", Ue, [I("div", We, J(a.value.rows) + " × " + J(a.value.cols), 1), I("div", {
386
+ })], 8, rt)]),
387
+ panel: X(() => [B("div", it, [B("div", at, Y(s.value.rows) + " × " + Y(s.value.cols), 1), B("div", {
389
388
  class: "docx-table-grid__grid",
390
- style: U({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` })
391
- }, [(W(!0), F(j, null, K(o.value, (e) => (W(), F("button", {
389
+ style: W({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` })
390
+ }, [(G(!0), z(F, null, q(c.value, (e) => (G(), z("button", {
392
391
  key: `${e.r}-${e.c}`,
393
- class: V(["docx-table-grid__cell", { "docx-table-grid__cell--active": e.r <= a.value.rows && e.c <= a.value.cols }]),
394
- onMouseenter: (t) => a.value = {
392
+ class: U(["docx-table-grid__cell", { "docx-table-grid__cell--active": e.r <= s.value.rows && e.c <= s.value.cols }]),
393
+ onMouseenter: (t) => s.value = {
395
394
  rows: e.r,
396
395
  cols: e.c
397
396
  },
398
- onClick: Z((t) => s(e.r, e.c), ["prevent"])
399
- }, null, 42, Ge))), 128))], 4)])]),
397
+ onClick: Q((t) => l(e.r, e.c), ["prevent"])
398
+ }, null, 42, ot))), 128))], 4)])]),
400
399
  _: 1
401
400
  }, 8, ["open"]));
402
401
  }
403
- }), [["__scopeId", "data-v-34f6875c"]]), qe = ["disabled", "title"], Je = {
402
+ }), [["__scopeId", "data-v-444ca123"]]), ct = ["disabled", "title"], lt = {
404
403
  key: 0,
405
404
  class: "print-btn__icon"
406
- }, Ye = /*#__PURE__*/ a(/* @__PURE__ */ z({
405
+ }, ut = /*#__PURE__*/ r(/* @__PURE__ */ H({
407
406
  __name: "PrintButton",
408
407
  props: {
409
408
  disabled: {
@@ -422,20 +421,20 @@ var Te = ["value", "disabled"], Ee = {
422
421
  function i() {
423
422
  n.disabled || (r("print"), window.print());
424
423
  }
425
- return (t, n) => (W(), F("button", {
424
+ return (t, n) => (G(), z("button", {
426
425
  class: "print-btn",
427
426
  disabled: e.disabled,
428
427
  title: e.label,
429
- onMousedown: Z(i, ["prevent"])
430
- }, [L(J(e.compact ? "" : e.label) + " ", 1), e.compact ? (W(), F("span", Je, "🖨")) : P("", !0)], 40, qe));
428
+ onMousedown: Q(i, ["prevent"])
429
+ }, [Se(Y(e.compact ? "" : e.label) + " ", 1), e.compact ? (G(), z("span", lt, "🖨")) : R("", !0)], 40, ct));
431
430
  }
432
- }), [["__scopeId", "data-v-3e413c06"]]), Xe = {
431
+ }), [["__scopeId", "data-v-3e413c06"]]), dt = {
433
432
  padding: "8px 10px",
434
433
  borderRadius: 8,
435
434
  backgroundColor: "var(--doc-card)",
436
435
  cursor: "pointer",
437
436
  boxShadow: "var(--doc-card-shadow)"
438
- }, Ze = {
437
+ }, ft = {
439
438
  padding: "10px 12px",
440
439
  borderRadius: 8,
441
440
  backgroundColor: "var(--doc-surface)",
@@ -443,4 +442,4 @@ var Te = ["value", "disabled"], Ee = {
443
442
  boxShadow: "var(--doc-card-shadow-strong)"
444
443
  };
445
444
  //#endregion
446
- export { oe as AddCommentCard, ce as AlignmentButtons, m as Button, Xe as CARD_STYLE_COLLAPSED, Ze as CARD_STYLE_EXPANDED, w as ColorPicker, ie as CommentCard, l as CommentMarginMarkers, p as DocumentName, c as EditingModeDropdown, _e as EditorToolbar, e as FindReplaceDialog, Pe as FontPicker, ze as FontSizePicker, D as FootnotePropertiesDialog, T as HorizontalRuler, t as HyperlinkDialog, re as IconGridDropdown, k as ImagePositionDialog, r as ImagePropertiesDialog, s as ImageTransformDropdown, ee as ImageWrapDropdown, n as InsertSymbolDialog, O as InsertTableDialog, Ve as LineSpacingPicker, ue as ListButtons, o as MenuBar, d as MenuDropdown, i as PageSetupDialog, f as Popover, Ye as PrintButton, de as ReplyInput, y as ReplyThread, v as ResolvedCommentMarker, te as StylePicker, h as TableBorderColorPicker, C as TableBorderPicker, x as TableBorderWidthPicker, S as TableCellFillPicker, ne as TableGridInline, Ke as TableGridPicker, ae as TableMoreDropdown, A as TablePropertiesDialog, E as TableStyleGallery, se as TableToolbar, we as TitleBar, _ as Toolbar, le as TrackedChangeCard, g as UnifiedSidebar, b as VerticalRuler };
445
+ export { D as AddCommentCard, k as AlignmentButtons, a as Button, dt as CARD_STYLE_COLLAPSED, ft as CARD_STYLE_EXPANDED, i as Checkbox, t as ColorPicker, T as CommentCard, _e as CommentMarginMarkers, ne as DEFAULT_COMPONENTS, n as DatePickerPopover, c as Dialog, he as DocumentName, be as EditingModeDropdown, je as EditorToolbar, ae as FindReplaceDialog, Je as FontPicker, $e as FontSizePicker, ie as FootnotePropertiesDialog, xe as HorizontalRuler, ce as HyperlinkDialog, P as IconGridDropdown, f as ImagePositionDialog, te as ImagePropertiesDialog, ve as ImageTransformDropdown, me as ImageWrapDropdown, m as Input, le as InsertImageDialog, ee as InsertSymbolDialog, u as InsertTableDialog, nt as LineSpacingPicker, j as ListButtons, g as MenuBar, s as MenuDropdown, pe as OutlineRail, de as PageSetupDialog, re as PasteSpecialDialog, e as Popover, ut as PrintButton, M as ReplyInput, b as ReplyThread, y as ResolvedCommentMarker, d as Select, p as SplitCellDialog, w as StylePicker, ye as TableBorderColorPicker, N as TableBorderPicker, S as TableBorderWidthPicker, C as TableCellFillPicker, ge as TableGridInline, st as TableGridPicker, E as TableMoreDropdown, oe as TablePropertiesDialog, se as TableStyleGallery, O as TableToolbar, Re as TitleBar, v as Toolbar, A as TrackedChangeCard, _ as UnifiedSidebar, x as VerticalRuler, ue as WatermarkDialog, l as provideFolioUI, fe as resolveFolioComponents, h as useFolioUI };
@@ -0,0 +1 @@
1
+ let e=require("vue"),t=require("@stll/folio-core/paged-layout/sectionGeometry"),n=require("@stll/folio-core/prosemirror/plugins/anonymizationDecorations"),r=require("@stll/folio-core/prosemirror/plugins/templateDirectives"),i=require("@stll/folio-core/prosemirror/plugins/suggestionMode"),a=require("@stll/folio-core/controller/folioEditor"),o=require("@stll/folio-core/controller/folioEditorEvents"),s=require("@stll/folio-core/controller/hiddenEditorManager"),c=require("@stll/folio-core/controller/layoutPipeline"),l=require("@stll/folio-core/controller/layoutScheduler"),u=require("@stll/folio-core/controller/layoutSession"),d=require("@stll/folio-core/docx/parser"),f=require("@stll/folio-core/docx/footnoteParser"),p=require("@stll/folio-core/layout-bridge/convert/headerFooterLayout"),m=require("@stll/folio-core/layout-painter"),h=require("@stll/folio-core/paged-layout/LayoutSelectionGate"),g=require("@stll/folio-core/paged-layout/transactionDirtyRange"),ee=require("@stll/folio-core/prosemirror/conversion/fromProseDoc"),te=require("@stll/folio-core/prosemirror/extensions/ExtensionManager"),_=require("@stll/folio-core/prosemirror/extensions/features/ParagraphChangeTrackerExtension"),ne=require("@stll/folio-core/prosemirror/extensions/StarterKit"),re=require("@stll/folio-core/prosemirror/plugins/templatePreviewValues"),ie=require("@stll/folio-core/prosemirror/plugins/templateSlashMenu"),v=require("@stll/folio-core/utils/findVerticalScrollParent"),y=require("@stll/folio-core/prosemirror/tableResize"),b=require("@stll/folio-core/prosemirror/utils/extractTrackedChanges");var ae=24,oe=32,se=96,ce=250,le=[];function ue(e){let n=e?.columnCount??1;if(n<=1)return;let r={count:n,gap:(0,t.twipsToPixels)(e?.columnSpace??720),equalWidth:e?.equalWidth??!0};return e?.separator!==void 0&&(r.separator=e.separator),r}function x(e){let t={};e.titlePg!==void 0&&(t.titlePg=e.titlePg);for(let n of e.headerReferences??[])n.type==="default"?t.headerDefault=n.rId:n.type===`first`?t.headerFirst=n.rId:t.headerEven=n.rId;for(let n of e.footerReferences??[])n.type==="default"?t.footerDefault=n.rId:n.type===`first`?t.footerFirst=n.rId:t.footerEven=n.rId;return t}function de(e){let t=e?.package.document;if(!t)return;let n=t.sections;if(n&&n.length>0)return n.map(e=>x(e.properties));let r=t.finalSectionProperties;if(r)return[x(r)]}var S={hf:null,rId:null};function fe(e,t){let n=e?.package;if(!n||!t)return{header:S,footer:S,firstHeader:S,firstFooter:S};let r=n.headers,i=n.footers,a=e=>e?r?.get(e)??null:null,o=e=>e?i?.get(e)??null:null,s=null,c=null;for(let e of t.headerReferences??[])e.type==="default"?s=e.rId:e.type===`first`&&(c=e.rId);let l=null,u=null;for(let e of t.footerReferences??[])e.type==="default"?l=e.rId:e.type===`first`&&(u=e.rId);return{header:{hf:a(s),rId:s},footer:{hf:o(l),rId:l},firstHeader:{hf:a(c),rId:c},firstFooter:{hf:o(u),rId:u}}}function pe(e,t,n,r,i,a){if(!e)return;let o=t?{...a,rId:t}:a,s=t?n?.getView(t):null;return s?(0,p.convertHeaderFooterPmDocToContent)(s.state.doc,r,i,o):(0,p.convertHeaderFooterToContent)(e,r,i,o)}function me(e,t,n,r,i){if(!e||e.size===0)return;let a=new Map;for(let[o,s]of e){let e=pe(s,o,t,n,r,i);e&&a.set(o,e)}return a.size>0?a:void 0}function he(e,t,n){let r=new Map;if(!n||!n.package.footnotes)return r;let i=new Map;for(let e of n.package.footnotes)e.noteType&&e.noteType!==`normal`||i.set(e.id,e);for(let[n,a]of e){let e=[];for(let n of a){let r=i.get(n);if(!r)continue;let a=t.get(n),o=a?.displayNumber??0;e.push({displayNumber:String(o),text:(0,f.getFootnoteText)(r),...a?{content:{blocks:a.blocks,measures:a.measures,height:a.height}}:{}})}e.length>0&&r.set(n,e)}return r}var C=new Set([`black`,`blue`,`cyan`,`darkBlue`,`darkCyan`,`darkGray`,`darkGreen`,`darkMagenta`,`darkRed`,`darkYellow`,`green`,`lightGray`,`magenta`,`none`,`red`,`white`,`yellow`]);function ge(e){let t=[],n=(e,r)=>{for(let[n,i]of e.marks.entries())i.type.name===`highlight`&&!C.has(String(i.attrs.color))&&t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);e.forEach((e,t,i)=>{n(e,`${r}.content[${i}]`)})};return n(e,`doc`),t.join(`; `)}function _e(){return typeof document>`u`||!(`fonts`in document)?!0:document.fonts.status===`loaded`}function w(f){let{hiddenContainer:p,pagesContainer:v,readOnly:y=!1,pageGap:b=ae,documentKey:x,password:S,editorMode:C,author:w,externalPlugins:T=[],onAnonymizationMatchesChange:E,showTemplateDirectives:D,onSlashMenuChange:O,onSlashMenuKeyAction:k,onChange:A,onError:j,onSelectionUpdate:M,onEditorViewReady:N,onReadOnlyEditAttempt:P,featureFlags:ve,onSelectiveSaveTripwire:F}=f,I=(0,e.shallowRef)(null),L=(0,e.shallowRef)(null),R=(0,e.shallowRef)(null),z=(0,e.shallowRef)(null),ye=(0,e.shallowRef)([]),be=(0,e.shallowRef)([]),B=(0,e.ref)(!1),V=(0,e.ref)(null),H=(0,e.ref)(!1),U=new te.ExtensionManager((0,ne.createStarterKit)());U.buildSchema(),U.initializeRuntime();let xe=(0,i.createSuggestionModePlugin)(!1),Se=(0,n.createAnonymizationDecorationsPlugin)({onMatchesChange:e=>E?.(e)}),W=(0,r.createTemplateDirectivesPlugin)(),G=(0,ie.templateSlashMenuPlugin)({onChange:e=>O?.(e),onKeyAction:e=>k?.(e)??!1}),Ce=(0,re.createTemplatePreviewValuesPlugin)(),K=()=>(0,e.toValue)(D)===!0;function we(){return[xe,...T,Se,...K()?[W,G]:[],Ce]}let q=(0,o.createFolioEditorEmitter)(),J=new h.LayoutSelectionGate,Te=(0,u.createLayoutSession)(),Ee=new m.LayoutPainter({pageGap:b,showShadow:!0});function De(e){e.layout&&(z.value=e.layout),e.blocks&&(ye.value=e.blocks),e.measures&&(be.value=e.measures),e.blockLookup&&Ee.setBlockLookup(e.blockLookup),e.layout&&q.emit(`layoutComplete`,e.layout)}function Y(e,n={}){let r=v.value,i=r instanceof HTMLDivElement?r:null,a=I.value,o=a?.package.document,s=o?.sections?.[0]?.properties??o?.finalSectionProperties??null,l=(0,t.getPageSize)(s),u=(0,t.getMargins)(s),d=ue(s),f=l.w-u.left-u.right,p=a?.package.styles??null,m=a?.package.theme??null,h=a?.package.settings?.defaultTabStop,g=fe(a,s);try{De((0,c.runLayoutPipeline)({contentWidth:f,columns:d,pageSize:l,margins:u,pageGap:b,syncCoordinator:J,headerContent:g.header.hf,footerContent:g.footer.hf,firstPageHeaderContent:g.firstHeader.hf,firstPageFooterContent:g.firstFooter.hf,headerContentRId:g.header.rId,footerContentRId:g.footer.rId,firstPageHeaderContentRId:g.firstHeader.rId,firstPageFooterContentRId:g.firstFooter.rId,sectionHeaderFooterRefs:de(a),theme:m,sectionProperties:s,document:a,defaultTabStop:h,styles:p,layout:z.value,hfPMs:null,painter:Ee,pagesContainer:i,session:Te,renderHfFromContentOrPm:pe,renderHeaderFooterContentByRId:me,documentFontsAreLoaded:_e,buildFootnoteRenderItems:he,describeInvalidHighlightMarks:ge,emptyTemplatePreviewEntries:le},e,n))}catch(e){let t=e instanceof Error?e:Error(String(e));j?.(t)}}let X=(0,l.createLayoutScheduler)({runLayout:(e,t)=>Y(e,t),debounceMs:oe,maxDelayMs:se,clock:l.browserClock}),Z=null;function Oe(){Z!==null&&(window.clearTimeout(Z),Z=null);let e=L.value,t=I.value;if(!(!e||!t))try{let n=(0,ee.fromProseDoc)(e.state.doc,t);I.value=n,A?.(n),q.emit(`docChange`,n)}catch(e){j?.(e instanceof Error?e:Error(String(e)))}}function ke(){Z!==null&&window.clearTimeout(Z),Z=window.setTimeout(()=>{Z=null,Oe()},ce)}let Q=(0,s.createHiddenEditorManager)({getHost:()=>p.value,getDocument:()=>I.value,getStyles:()=>I.value?.package.styles??null,getExtensionManager:()=>U,getExternalPlugins:we,getCollaboration:()=>void 0,getCollaborationModules:()=>null,getPrecomputedInitialState:()=>null,getReadOnly:()=>(0,e.toValue)(y),getDocumentKey:()=>(0,e.toValue)(x),getDocumentContext:()=>I.value,onTransaction:Ae,onSelectionChange:e=>{R.value=e,M?.(e),q.emit(`selectionChange`,{from:e.selection.from,to:e.selection.to})},onKeyDown:()=>!1,onReadOnlyEditAttempt:()=>P?.(),onEditorViewReady:je,onEditorViewDestroy:()=>{L.value=null,B.value=!1,N?.(null)},onRemoteSelectionsChange:()=>{}});function Ae(e,t){R.value=t,e.docChanged&&(H.value=!0,J.incrementStateSeq(),X.schedule(t,(0,g.getTransactionDirtyRange)(e)),ke()),J.requestRender()}function je(t){L.value=t,R.value=t.state,B.value=!0,Y(t.state,{reason:`initial`}),J.requestRender(),Ne(t),N?.(t),(0,e.toValue)(y)||requestAnimationFrame(()=>{L.value===t&&t.focus()})}let Me=(0,a.createFolioEditor)({getEditorApi:()=>Q.api,getLayout:()=>z.value,runLayout:(e,t)=>Y(e,t),emitter:q});function Ne(t){(0,i.setSuggestionMode)((0,e.toValue)(C)===`suggesting`,t.state,t.dispatch,(0,e.toValue)(w))}(0,e.watch)([()=>(0,e.toValue)(C),()=>(0,e.toValue)(w)],()=>{let e=L.value;e&&Ne(e)}),(0,e.watch)(()=>(0,e.toValue)(y),()=>Q.syncEditable());function Pe(e){let t=K();if(t===e.state.plugins.includes(W))return;let n=e.state.plugins.filter(e=>e!==W&&e!==G);if(t){let e=n.indexOf(Ce),t=e===-1?n.length:e;n.splice(t,0,W,G)}e.updateState(e.state.reconfigure({plugins:n}))}(0,e.watch)(()=>K(),()=>{let e=L.value;e&&Pe(e)});function Fe(){Q.ensureView()}function Ie(){H.value=!1,X.dispose(),Q.destroyView(),Q.ensureView(),Q.getView()||Le()}function Le(){let e=I.value;if(e)try{let t=(0,s.createHiddenEditorState)({document:e,styles:e.package.styles??null,manager:U,externalPlugins:we(),collaborationModules:null,reason:`mount`});R.value=t,Y(t,{reason:`initial`})}catch(e){j?.(e instanceof Error?e:Error(String(e)))}}(0,e.watch)([p,v],()=>{p.value&&I.value&&!Q.getView()&&Fe()},{flush:`post`});async function Re(t){V.value=null,B.value=!1;try{I.value=await(0,d.parseDocx)(t,{password:(0,e.toValue)(S)}),Ie()}catch(e){let t=e instanceof Error?e:Error(String(e));V.value=t.message,j?.(t)}}function ze(e){V.value=null,I.value=e,Ie()}async function Be(t){let n=L.value,r=I.value;if(!n||!r)return null;let i=n.state,{resolveSelectiveSaveFlags:a}=await import(`@stll/folio-core/docx/selectiveSaveFlags`),o=a((0,e.toValue)(ve)),s=(0,ee.fromProseDoc)(i.doc,r),c=s.originalBuffer??null,l=o.selectiveSave&&t?.selective!==!1,u=l||o.selectiveSaveTripwire,{repackDocx:d,createDocx:f}=await import(`@stll/folio-core/docx/rezip`),p=null;if(u&&c){let{attemptSelectiveSave:e}=await import(`@stll/folio-core/docx/selectiveSave`);p=await e(s,c,{changedParaIds:(0,_.getChangedParagraphIds)(i),structuralChange:(0,_.hasStructuralChanges)(i),hasUntrackedChanges:(0,_.hasUntrackedChanges)(i),maxBytes:o.selectiveSaveMaxBytes})}let m=l?p:null,h=null;if(!m)h=c?await d(s):await f(s),m=h;else if(o.selectiveSaveTripwire)try{h=await d(s)}catch{}if(o.selectiveSaveTripwire&&h&&F)try{let{compareSelectiveVsFull:e}=await import(`@stll/folio-core/docx/selectiveSaveTripwire`);F(await e(p,h))}catch{}return H.value=!1,new Blob([m],{type:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`})}function Ve(){return I.value}function He(e){I.value=e}function Ue(){return U.getCommands()}function We(){L.value?.focus()}function Ge(){let e=L.value;e&&Y(e.state,{reason:`manual`})}function $(){X.dispose(),Z!==null&&(window.clearTimeout(Z),Z=null),Q.destroyView(),U.destroy(),R.value=null,z.value=null,I.value=null,B.value=!1}return(0,e.onScopeDispose)($),{editor:Me,editorView:L,editorState:R,isReady:B,isDirty:H,parseError:V,layout:z,blocks:ye,measures:be,loadBuffer:Re,loadDocument:ze,save:Be,getDocument:Ve,setDocument:He,getCommands:Ue,focus:We,reLayout:Ge,destroy:$}}function T(e,t){if(t<e.top+40){let n=Math.max(0,e.top+40-t);return-Math.min(12,n/40*12)}if(t>e.bottom-40){let n=Math.max(0,t-(e.bottom-40));return Math.min(12,n/40*12)}return 0}function E({pagesContainer:t,onScrollExtendSelection:n}){let r=null,i=0,a=0,o=!1,s=null;function c(){if(s)return s;let e=t.value;return e?(s=(0,v.findVerticalScrollParent)(e),s):null}function l(){o=!1,r!==null&&(cancelAnimationFrame(r),r=null)}function u(){if(!o)return;let e=c();if(!e)return;let t=T(e.getBoundingClientRect(),a);t!==0&&(e.scrollTop+=t,n(i,a)),r=requestAnimationFrame(u)}function d(){o||(o=!0,r=requestAnimationFrame(u))}function f(e,t){if(i=e,a=t,!o){let e=c();if(!e)return;let n=e.getBoundingClientRect();(t<n.top+40||t>n.bottom-40)&&d()}}return(0,e.onScopeDispose)(()=>l()),{updateMousePosition:f,stopAutoScroll:l}}function D(){let e={active:!1,startX:0,handle:null,columnIndex:0,tablePmStart:0,origWidths:{left:0,right:0}},t={active:!1,startY:0,handle:null,rowIndex:0,isEdge:!1,tablePmStart:0,origHeight:0},n={active:!1,startX:0,handle:null,columnIndex:0,tablePmStart:0,origWidth:0},r=null;function i(){return e.active||t.active||n.active}function a(i,a){let o=i.target;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),O(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),k(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),A(a,n),!0):!1:!1}function o(r){if(e.active&&e.handle){r.preventDefault();let t=r.clientX-e.startX,n=parseFloat(e.handle.style.left);e.handle.style.left=`${n+t}px`,e.startX=r.clientX;let i=Math.round(t*y.TWIPS_PER_PIXEL),a=e.origWidths.left+i,o=e.origWidths.right-i;a>=y.MIN_CELL_WIDTH_TWIPS&&o>=y.MIN_CELL_WIDTH_TWIPS&&(e.origWidths={left:a,right:o});return}if(t.active&&t.handle){r.preventDefault();let e=r.clientY-t.startY,n=parseFloat(t.handle.style.top);t.handle.style.top=`${n+e}px`,t.startY=r.clientY;let i=Math.round(e*y.TWIPS_PER_PIXEL),a=t.origHeight+i;a>=y.MIN_ROW_HEIGHT_TWIPS&&(t.origHeight=a);return}if(n.active&&n.handle){r.preventDefault();let e=r.clientX-n.startX,t=parseFloat(n.handle.style.left);n.handle.style.left=`${t+e}px`,n.startX=r.clientX;let i=Math.round(e*y.TWIPS_PER_PIXEL),a=n.origWidth+i;a>=y.MIN_CELL_WIDTH_TWIPS&&(n.origWidth=a)}}function s(i){if(e.active){e.active=!1,e.handle?.classList.remove(`dragging`),r&&(0,y.commitColumnResize)(r,{pmStart:e.tablePmStart,colIdx:e.columnIndex,newLeft:e.origWidths.left,newRight:e.origWidths.right}),e.handle=null;return}if(t.active){t.active=!1,t.handle?.classList.remove(`dragging`),r&&(0,y.commitRowResize)(r,{pmStart:t.tablePmStart,rowIdx:t.rowIndex,newHeight:t.origHeight}),t.handle=null;return}n.active&&(n.active=!1,n.handle?.classList.remove(`dragging`),r&&(0,y.commitRightEdgeResize)(r,{pmStart:n.tablePmStart,colIdx:n.columnIndex,newWidth:n.origWidth}),n.handle=null)}function c(){return document.addEventListener(`mousemove`,o),document.addEventListener(`mouseup`,s),()=>{document.removeEventListener(`mousemove`,o),document.removeEventListener(`mouseup`,s)}}return{tryStartResize:a,install:c,isResizing:i}}function O(e,t){let n=(0,y.readColumnWidths)(e,t.tablePmStart,t.columnIndex);n&&(t.origWidths=n)}function k(e,t,n){let r=(0,y.readRowHeight)(e,t.tablePmStart,t.rowIndex);if(r!=null){t.origHeight=r;return}let i=n.closest(`.layout-table`)?.querySelector(`[data-row-index="${t.rowIndex}"]`),a=i?i.getBoundingClientRect().height:30;t.origHeight=Math.round(a*y.TWIPS_PER_PIXEL)}function A(e,t){let n=(0,y.readColumnWidthAt)(e,t.tablePmStart,t.columnIndex);n!=null&&(t.origWidth=n)}function j(t,n){return(0,e.computed)(()=>(n.value,(0,b.extractTrackedChanges)(t.value?.state??null)))}var M=.5,N=2,P=.1,ve=[.5,.75,1,1.25,1.5,2];function F(t=1){let n=(0,e.ref)(Math.max(M,Math.min(N,t))),r=(0,e.computed)(()=>Math.round(n.value*100)),i=(0,e.computed)(()=>n.value<=M),a=(0,e.computed)(()=>n.value>=N);function o(e){n.value=Math.max(M,Math.min(N,Math.round(e*100)/100))}function s(){o(n.value+P)}function c(){o(n.value-P)}function l(){o(1)}function u(e){(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.deltaY<0?s():c())}function d(e){(e.ctrlKey||e.metaKey)&&(e.shiftKey||e.altKey||(e.key===`=`||e.key===`+`?(e.preventDefault(),s()):e.key===`-`?(e.preventDefault(),c()):e.key===`0`&&(e.preventDefault(),l())))}function f(){(0,e.onMounted)(()=>document.addEventListener(`keydown`,d)),(0,e.onBeforeUnmount)(()=>document.removeEventListener(`keydown`,d))}return{zoom:n,zoomPercent:r,isMinZoom:i,isMaxZoom:a,setZoom:o,zoomIn:s,zoomOut:c,resetZoom:l,handleWheel:u,handleKeyDown:d,installShortcuts:f,ZOOM_PRESETS:ve}}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return F}});