@stll/folio-vue 0.9.0 → 0.11.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 (40) hide show
  1. package/dist/{ListButtons-C1rU_Y1e.cjs → ListButtons-24sQYGSe.cjs} +2 -2
  2. package/dist/{ListButtons-DMnOM2pN.js → ListButtons-CAw3PKiv.js} +388 -384
  3. package/dist/SplitCellDialog-DJ-z75hr.cjs +15 -0
  4. package/dist/{WatermarkDialog-Cf9ISDvv.js → SplitCellDialog-DUzOQhr6.js} +990 -978
  5. package/dist/components/AutocompleteCaretOverlay.types.d.ts +18 -0
  6. package/dist/components/DocxEditor/pagedEditorRef.d.ts +14 -0
  7. package/dist/components/DocxEditor/types.d.ts +60 -0
  8. package/dist/composables/index.d.ts +1 -0
  9. package/dist/composables/useColorMode.d.ts +17 -4
  10. package/dist/composables/useCommentManagement.d.ts +8 -2
  11. package/dist/composables/useContextMenus.d.ts +3 -0
  12. package/dist/composables/useDocxEditor.d.ts +21 -0
  13. package/dist/composables/useDocxEditorRefApi.d.ts +18 -2
  14. package/dist/composables/useFontLifecycle.d.ts +22 -0
  15. package/dist/composables/useKeyboardShortcuts.d.ts +0 -1
  16. package/dist/composables/usePagesPointer.d.ts +5 -0
  17. package/dist/composables.cjs +2 -2
  18. package/dist/composables.js +75 -75
  19. package/dist/dialogs.cjs +1 -1
  20. package/dist/dialogs.js +2 -2
  21. package/dist/folio-vue.css +1 -1
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.d.ts +5 -1
  24. package/dist/index.js +1762 -1278
  25. package/dist/renderAsync.d.ts +4 -0
  26. package/dist/ui/folio-ui.d.ts +1 -1
  27. package/dist/ui.cjs +1 -1
  28. package/dist/ui.js +10 -10
  29. package/dist/useZoom-DBbzwfMG.cjs +1 -0
  30. package/dist/useZoom-DwDDS7hq.js +749 -0
  31. package/dist/utils/colorMode.d.ts +3 -4
  32. package/dist/utils/embeddedFonts.d.ts +20 -0
  33. package/dist/utils/fontFaces.d.ts +10 -0
  34. package/dist/utils/hostFonts.d.ts +1 -5
  35. package/package.json +2 -2
  36. package/dist/WatermarkDialog-ChJtT7Bs.cjs +0 -15
  37. package/dist/composables/useHostCallbacks.d.ts +0 -24
  38. package/dist/composables/useMenuActions.d.ts +0 -36
  39. package/dist/useZoom-BYEcnpS0.cjs +0 -1
  40. package/dist/useZoom-C0p0o54p.js +0 -656
@@ -1,35 +1,35 @@
1
1
  import { t as e } from "./useFindReplace-CL8Rbc3y.js";
2
- import { a as t, i as n, n as r, o as i, r as a, t as o } from "./useZoom-C0p0o54p.js";
3
- import { computed as s, onBeforeUnmount as c, onMounted as l, onScopeDispose as u, ref as d, watch as f } from "vue";
4
- import { redo as p, redoDepth as m, undo as h, undoDepth as g } from "prosemirror-history";
5
- import { copyRuns as _, parseClipboardHtml as v, runsToClipboardContent as y } from "@stll/folio-core/utils/clipboard";
6
- import { createSelectionFromDOM as b, getSelectionRuns as x } from "@stll/folio-core/managers/ClipboardManager";
7
- import { TableSelectionManager as S, findTableFromClick as C } from "@stll/folio-core/managers/TableSelectionManager";
8
- import { createVisualLineState as w, findLineElementAtPosition as T, findPositionOnLineAtClientX as E, getCaretClientX as D, handleVisualLineKeyDown as O } from "@stll/folio-core/prosemirror/utils/visualLineNavigation";
2
+ import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./useZoom-DwDDS7hq.js";
3
+ import { computed as d, onBeforeUnmount as f, onMounted as p, onScopeDispose as m, ref as h, watch as g } from "vue";
4
+ import { redo as _, redoDepth as v, undo as y, undoDepth as b } from "prosemirror-history";
5
+ import { copyRuns as x, parseClipboardHtml as S, runsToClipboardContent as C } from "@stll/folio-core/utils/clipboard";
6
+ import { createSelectionFromDOM as w, getSelectionRuns as T } from "@stll/folio-core/managers/ClipboardManager";
7
+ import { TableSelectionManager as E, findTableFromClick as D } from "@stll/folio-core/managers/TableSelectionManager";
8
+ import { createVisualLineState as O, findLineElementAtPosition as k, findPositionOnLineAtClientX as A, getCaretClientX as j, handleVisualLineKeyDown as M } from "@stll/folio-core/prosemirror/utils/visualLineNavigation";
9
9
  //#region src/composables/useClipboard.ts
10
- function k(e = {}) {
11
- let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o } = e, s = d(!1), c = d(null), l = o ? { onError: o } : {};
10
+ function N(e = {}) {
11
+ let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o } = e, s = h(!1), c = h(null), l = o ? { onError: o } : {};
12
12
  async function u(e) {
13
13
  if (s.value) return !1;
14
14
  s.value = !0;
15
15
  try {
16
- let n = await _(e.runs, l);
16
+ let n = await x(e.runs, l);
17
17
  return n && t?.(e), n;
18
18
  } finally {
19
19
  s.value = !1;
20
20
  }
21
21
  }
22
- async function f(e) {
22
+ async function d(e) {
23
23
  if (s.value || !a) return !1;
24
24
  s.value = !0;
25
25
  try {
26
- let t = await _(e.runs, l);
26
+ let t = await x(e.runs, l);
27
27
  return t && n?.(e), t;
28
28
  } finally {
29
29
  s.value = !1;
30
30
  }
31
31
  }
32
- async function p(e = !1) {
32
+ async function f(e = !1) {
33
33
  if (s.value || !a) return null;
34
34
  s.value = !0;
35
35
  try {
@@ -37,7 +37,7 @@ function k(e = {}) {
37
37
  let t = await navigator.clipboard.read(), n = "", a = "";
38
38
  for (let e of t) e.types.includes("text/html") && (n = await (await e.getType("text/html")).text()), e.types.includes("text/plain") && (a = await (await e.getType("text/plain")).text());
39
39
  e && (n = "");
40
- let o = v(n, a, i);
40
+ let o = S(n, a, i);
41
41
  return c.value = o, r?.(o, e), o;
42
42
  }
43
43
  return null;
@@ -49,16 +49,16 @@ function k(e = {}) {
49
49
  }
50
50
  return {
51
51
  copy: u,
52
- cut: f,
53
- paste: p,
52
+ cut: d,
53
+ paste: f,
54
54
  isProcessing: s,
55
55
  lastPastedContent: c
56
56
  };
57
57
  }
58
58
  //#endregion
59
59
  //#region src/composables/useFixedDropdown.ts
60
- function A({ isOpen: e, onClose: t, align: n = "left" }) {
61
- let r = d(null), i = d(null), a = d({
60
+ function P({ isOpen: e, onClose: t, align: n = "left" }) {
61
+ let r = h(null), i = h(null), a = h({
62
62
  position: "fixed",
63
63
  top: "0px",
64
64
  left: "0px",
@@ -83,15 +83,15 @@ function A({ isOpen: e, onClose: t, align: n = "left" }) {
83
83
  let n = e.target;
84
84
  n instanceof Node && i.value && i.value.contains(n) || t();
85
85
  }
86
- function p() {
86
+ function u() {
87
87
  document.addEventListener("mousedown", s), document.addEventListener("keydown", c), window.addEventListener("scroll", l, !0);
88
88
  }
89
- function m() {
89
+ function d() {
90
90
  document.removeEventListener("mousedown", s), document.removeEventListener("keydown", c), window.removeEventListener("scroll", l, !0);
91
91
  }
92
- f(e, (e) => {
92
+ g(e, (e) => {
93
93
  if (!e) {
94
- m();
94
+ d();
95
95
  return;
96
96
  }
97
97
  let t = r.value;
@@ -103,37 +103,37 @@ function A({ isOpen: e, onClose: t, align: n = "left" }) {
103
103
  let t = e.getBoundingClientRect();
104
104
  o(a.bottom + 4, a.right - t.width);
105
105
  } else o(a.bottom + 4, a.left);
106
- }) : o(a.bottom + 4, a.left), p();
107
- }), u(m);
108
- function h(e) {
106
+ }) : o(a.bottom + 4, a.left), u();
107
+ }), m(d);
108
+ function f(e) {
109
109
  e.preventDefault(), e.stopPropagation();
110
110
  }
111
111
  return {
112
112
  containerRef: r,
113
113
  dropdownRef: i,
114
114
  dropdownStyle: a,
115
- handleMouseDown: h
115
+ handleMouseDown: f
116
116
  };
117
117
  }
118
118
  //#endregion
119
119
  //#region src/composables/useHistory.ts
120
- function j(e, t) {
121
- let n = s(() => {
120
+ function F(e, t) {
121
+ let n = d(() => {
122
122
  t.value;
123
123
  let n = e.value;
124
- return n ? g(n.state) > 0 : !1;
125
- }), r = s(() => {
124
+ return n ? b(n.state) > 0 : !1;
125
+ }), r = d(() => {
126
126
  t.value;
127
127
  let n = e.value;
128
- return n ? m(n.state) > 0 : !1;
128
+ return n ? v(n.state) > 0 : !1;
129
129
  });
130
130
  function i() {
131
131
  let t = e.value;
132
- return t ? h(t.state, t.dispatch) : !1;
132
+ return t ? y(t.state, t.dispatch) : !1;
133
133
  }
134
134
  function a() {
135
135
  let t = e.value;
136
- return t ? p(t.state, t.dispatch) : !1;
136
+ return t ? _(t.state, t.dispatch) : !1;
137
137
  }
138
138
  return {
139
139
  canUndo: n,
@@ -144,14 +144,14 @@ function j(e, t) {
144
144
  }
145
145
  //#endregion
146
146
  //#region src/utils/selectionHighlight.ts
147
- var M = {
147
+ var I = {
148
148
  backgroundColor: "rgba(26, 115, 232, 0.3)",
149
149
  borderRadius: 0,
150
150
  zIndex: 0,
151
151
  opacity: 1,
152
152
  mixBlendMode: "multiply"
153
153
  };
154
- function N(e) {
154
+ function L(e) {
155
155
  let t = window.getSelection();
156
156
  if (!t || t.rangeCount === 0 || t.isCollapsed) return [];
157
157
  let n = t.getRangeAt(0);
@@ -170,7 +170,7 @@ function N(e) {
170
170
  });
171
171
  return a;
172
172
  }
173
- function P(e, t = 2) {
173
+ function R(e, t = 2) {
174
174
  if (e.length <= 1) return e;
175
175
  let n = [...e].sort((e, n) => Math.abs(e.top - n.top) < t ? e.left - n.left : e.top - n.top), r = n[0];
176
176
  if (!r) return e;
@@ -186,23 +186,23 @@ function P(e, t = 2) {
186
186
  }
187
187
  return i.push(a), i;
188
188
  }
189
- function F(e) {
190
- return P(N(e));
189
+ function z(e) {
190
+ return R(L(e));
191
191
  }
192
- function I() {
192
+ function B() {
193
193
  let e = window.getSelection();
194
194
  return e !== null && !e.isCollapsed && e.rangeCount > 0;
195
195
  }
196
- function L(e) {
196
+ function V(e) {
197
197
  let t = window.getSelection();
198
198
  return !t || t.rangeCount === 0 ? !1 : e.contains(t.getRangeAt(0).commonAncestorContainer);
199
199
  }
200
- var R = "docx-selection-styles", z = null;
201
- function B() {
202
- z &&= (z.remove(), null), document.getElementById(R)?.remove();
200
+ var H = "docx-selection-styles", U = null;
201
+ function W() {
202
+ U &&= (U.remove(), null), document.getElementById(H)?.remove();
203
203
  }
204
- function V(e = M) {
205
- B();
204
+ function G(e = I) {
205
+ W();
206
206
  let t = `
207
207
  /* DOCX Editor Selection Highlighting */
208
208
 
@@ -264,21 +264,21 @@ function V(e = M) {
264
264
  border-bottom: 2px dashed rgba(156, 39, 176, 0.6);
265
265
  }
266
266
  `;
267
- z = document.createElement("style"), z.id = R, z.textContent = t, document.head.appendChild(z);
267
+ U = document.createElement("style"), U.id = H, U.textContent = t, document.head.appendChild(U);
268
268
  }
269
- function H() {
270
- return z !== null || document.getElementById(R) !== null;
269
+ function K() {
270
+ return U !== null || document.getElementById(H) !== null;
271
271
  }
272
272
  //#endregion
273
273
  //#region src/composables/useSelectionHighlight.ts
274
- function U() {
274
+ function q() {
275
275
  return window.getSelection()?.toString() ?? "";
276
276
  }
277
- function W(e) {
278
- let { containerRef: t, enabled: n = !0, config: r = M, useOverlay: i = !1, debounceMs: a = 16, onSelectionChange: o } = e, u = d(!1), p = d(""), m = d([]), h = d(!1), g = null, _ = 0;
277
+ function J(e) {
278
+ let { containerRef: t, enabled: n = !0, config: r = I, useOverlay: i = !1, debounceMs: a = 16, onSelectionChange: o } = e, s = h(!1), c = h(""), l = h([]), u = h(!1), m = null, _ = 0;
279
279
  function v() {
280
- let e = t.value, n = I(), r = U(), a = e ? L(e) : !1;
281
- u.value = n, p.value = r, h.value = a, m.value = i && a && e ? F(e) : [], o?.(n && a, r);
280
+ let e = t.value, n = B(), r = q(), a = e ? V(e) : !1;
281
+ s.value = n, c.value = r, u.value = a, l.value = i && a && e ? z(e) : [], o?.(n && a, r);
282
282
  }
283
283
  function y() {
284
284
  v();
@@ -286,8 +286,8 @@ function W(e) {
286
286
  function b() {
287
287
  let e = performance.now();
288
288
  if (e - _ < a) {
289
- g && clearTimeout(g), g = setTimeout(() => {
290
- _ = performance.now(), v(), g = null;
289
+ m && clearTimeout(m), m = setTimeout(() => {
290
+ _ = performance.now(), v(), m = null;
291
291
  }, a);
292
292
  return;
293
293
  }
@@ -306,23 +306,23 @@ function W(e) {
306
306
  };
307
307
  return r.borderRadius && (t.borderRadius = `${r.borderRadius}px`), r.borderColor && (t.border = `1px solid ${r.borderColor}`), t;
308
308
  }
309
- return l(() => {
310
- n && (H() || V(r), document.addEventListener("selectionchange", b));
311
- }), c(() => {
312
- document.removeEventListener("selectionchange", b), g && clearTimeout(g);
313
- }), f(t, () => v()), {
314
- hasSelection: s(() => u.value),
315
- selectedText: s(() => p.value),
316
- highlightRects: s(() => m.value),
317
- isSelectionInContainer: s(() => h.value),
309
+ return p(() => {
310
+ n && (K() || G(r), document.addEventListener("selectionchange", b));
311
+ }), f(() => {
312
+ document.removeEventListener("selectionchange", b), m && clearTimeout(m);
313
+ }), g(t, () => v()), {
314
+ hasSelection: d(() => s.value),
315
+ selectedText: d(() => c.value),
316
+ highlightRects: d(() => l.value),
317
+ isSelectionInContainer: d(() => u.value),
318
318
  refresh: y,
319
319
  getOverlayStyle: x
320
320
  };
321
321
  }
322
322
  //#endregion
323
323
  //#region src/composables/useTableSelection.ts
324
- function G() {
325
- let e = new S(), t = d(null), n = () => {
324
+ function Y() {
325
+ let e = new E(), t = h(null), n = () => {
326
326
  let n = e.getSnapshot();
327
327
  t.value = n.tableIndex !== null && n.rowIndex !== null && n.columnIndex !== null ? {
328
328
  tableIndex: n.tableIndex,
@@ -330,7 +330,7 @@ function G() {
330
330
  columnIndex: n.columnIndex
331
331
  } : null;
332
332
  }, r = e.subscribe(n);
333
- n(), u(r);
333
+ n(), m(r);
334
334
  function i(t, n, r) {
335
335
  e.selectCellCoordinates({
336
336
  tableIndex: t,
@@ -339,7 +339,7 @@ function G() {
339
339
  });
340
340
  }
341
341
  function a(t, n) {
342
- let r = C(t, n);
342
+ let r = D(t, n);
343
343
  if (!r) {
344
344
  e.clearSelection();
345
345
  return;
@@ -362,21 +362,21 @@ function G() {
362
362
  }
363
363
  //#endregion
364
364
  //#region src/composables/useVisualLineNavigation.ts
365
- function K(e) {
366
- let t = w();
365
+ function X(e) {
366
+ let t = O();
367
367
  function n(t) {
368
368
  let n = e.value;
369
- return n ? D(n, t) : null;
369
+ return n ? j(n, t) : null;
370
370
  }
371
371
  function r(t) {
372
372
  let n = e.value;
373
- return n ? T(n, t) : null;
373
+ return n ? k(n, t) : null;
374
374
  }
375
375
  function i(e, t) {
376
- return E(e, t);
376
+ return A(e, t);
377
377
  }
378
378
  function a(n, r) {
379
- return O(t, n, r, e.value);
379
+ return M(t, n, r, e.value);
380
380
  }
381
381
  return {
382
382
  state: t,
@@ -387,4 +387,4 @@ function K(e) {
387
387
  };
388
388
  }
389
389
  //#endregion
390
- export { b as createSelectionFromDOM, r as extractTrackedChanges, x as getSelectionRuns, y as runsToClipboardContent, k as useClipboard, i as useDocxEditor, t as useDragAutoScroll, e as useFindReplace, A as useFixedDropdown, j as useHistory, W as useSelectionHighlight, n as useTableResize, G as useTableSelection, a as useTrackedChanges, K as useVisualLineNavigation, o as useWheelZoom, o as useZoom };
390
+ export { c as colorModePlugin, w as createSelectionFromDOM, n as defaultColorMode, a as extractTrackedChanges, T as getSelectionRuns, i as provideColorMode, C as runsToClipboardContent, N as useClipboard, u as useColorMode, o as useDocxEditor, t as useDragAutoScroll, e as useFindReplace, P as useFixedDropdown, F as useHistory, J as useSelectionHighlight, r as useTableResize, Y as useTableSelection, s as useTrackedChanges, X as useVisualLineNavigation, l as useWheelZoom, l as useZoom };
package/dist/dialogs.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./WatermarkDialog-ChJtT7Bs.cjs");var t=e.m,n=e.l,r=e.p,i=e.c,a=e.f,o=e.s,s=e.d,c=e.a,l=e.u,u=e.i,d=e.r,f=e.n,p=e.t;exports.FindReplaceDialog=t,exports.FootnotePropertiesDialog=n,exports.HyperlinkDialog=r,exports.ImagePositionDialog=i,exports.ImagePropertiesDialog=a,exports.InsertImageDialog=o,exports.InsertSymbolDialog=s,exports.InsertTableDialog=c,exports.PageSetupDialog=l,exports.PasteSpecialDialog=u,exports.SplitCellDialog=d,exports.TablePropertiesDialog=f,exports.WatermarkDialog=p;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SplitCellDialog-DJ-z75hr.cjs");var t=e.m,n=e.s,r=e.p,i=e.o,a=e.f,o=e.a,s=e.d,c=e.r,l=e.u,u=e.n,d=e.t,f=e.l,p=e.c;exports.FindReplaceDialog=t,exports.FootnotePropertiesDialog=n,exports.HyperlinkDialog=r,exports.ImagePositionDialog=i,exports.ImagePropertiesDialog=a,exports.InsertImageDialog=o,exports.InsertSymbolDialog=s,exports.InsertTableDialog=c,exports.PageSetupDialog=l,exports.PasteSpecialDialog=u,exports.SplitCellDialog=d,exports.TablePropertiesDialog=f,exports.WatermarkDialog=p;
package/dist/dialogs.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, p as c, r as l, s as u, t as d, u as f } from "./WatermarkDialog-Cf9ISDvv.js";
1
+ import { a as e, c as t, d as n, f as r, l as i, m as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./SplitCellDialog-DUzOQhr6.js";
2
2
  //#region src/components/dialogs/index.ts
3
- var p = o, m = a, h = c, g = t, _ = r, v = u, y = n, b = e, x = f, S = i, C = l, w = s, T = d;
3
+ var p = a, m = u, h = c, g = s, _ = r, v = e, y = n, b = l, x = f, S = o, C = d, w = i, T = t;
4
4
  //#endregion
5
5
  export { p as FindReplaceDialog, m as FootnotePropertiesDialog, h as HyperlinkDialog, g as ImagePositionDialog, _ as ImagePropertiesDialog, v as InsertImageDialog, y as InsertSymbolDialog, b as InsertTableDialog, x as PageSetupDialog, S as PasteSpecialDialog, C as SplitCellDialog, w as TablePropertiesDialog, T as WatermarkDialog };