@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.
- package/dist/{ListButtons-C1rU_Y1e.cjs → ListButtons-24sQYGSe.cjs} +2 -2
- package/dist/{ListButtons-DMnOM2pN.js → ListButtons-CAw3PKiv.js} +388 -384
- package/dist/SplitCellDialog-DJ-z75hr.cjs +15 -0
- package/dist/{WatermarkDialog-Cf9ISDvv.js → SplitCellDialog-DUzOQhr6.js} +990 -978
- package/dist/components/AutocompleteCaretOverlay.types.d.ts +18 -0
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +14 -0
- package/dist/components/DocxEditor/types.d.ts +60 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/useColorMode.d.ts +17 -4
- package/dist/composables/useCommentManagement.d.ts +8 -2
- package/dist/composables/useContextMenus.d.ts +3 -0
- package/dist/composables/useDocxEditor.d.ts +21 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +18 -2
- package/dist/composables/useFontLifecycle.d.ts +22 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +0 -1
- package/dist/composables/usePagesPointer.d.ts +5 -0
- package/dist/composables.cjs +2 -2
- package/dist/composables.js +75 -75
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +2 -2
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1762 -1278
- package/dist/renderAsync.d.ts +4 -0
- package/dist/ui/folio-ui.d.ts +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +10 -10
- package/dist/useZoom-DBbzwfMG.cjs +1 -0
- package/dist/useZoom-DwDDS7hq.js +749 -0
- package/dist/utils/colorMode.d.ts +3 -4
- package/dist/utils/embeddedFonts.d.ts +20 -0
- package/dist/utils/fontFaces.d.ts +10 -0
- package/dist/utils/hostFonts.d.ts +1 -5
- package/package.json +2 -2
- package/dist/WatermarkDialog-ChJtT7Bs.cjs +0 -15
- package/dist/composables/useHostCallbacks.d.ts +0 -24
- package/dist/composables/useMenuActions.d.ts +0 -36
- package/dist/useZoom-BYEcnpS0.cjs +0 -1
- package/dist/useZoom-C0p0o54p.js +0 -656
package/dist/composables.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { t as e } from "./useFindReplace-CL8Rbc3y.js";
|
|
2
|
-
import { a as t,
|
|
3
|
-
import { computed as
|
|
4
|
-
import { redo as
|
|
5
|
-
import { copyRuns as
|
|
6
|
-
import { createSelectionFromDOM as
|
|
7
|
-
import { TableSelectionManager as
|
|
8
|
-
import { createVisualLineState as
|
|
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
|
|
11
|
-
let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o } = e, s =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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:
|
|
53
|
-
paste:
|
|
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
|
|
61
|
-
let r =
|
|
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
|
|
86
|
+
function u() {
|
|
87
87
|
document.addEventListener("mousedown", s), document.addEventListener("keydown", c), window.addEventListener("scroll", l, !0);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function d() {
|
|
90
90
|
document.removeEventListener("mousedown", s), document.removeEventListener("keydown", c), window.removeEventListener("scroll", l, !0);
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
g(e, (e) => {
|
|
93
93
|
if (!e) {
|
|
94
|
-
|
|
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),
|
|
107
|
-
}),
|
|
108
|
-
function
|
|
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:
|
|
115
|
+
handleMouseDown: f
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/composables/useHistory.ts
|
|
120
|
-
function
|
|
121
|
-
let n =
|
|
120
|
+
function F(e, t) {
|
|
121
|
+
let n = d(() => {
|
|
122
122
|
t.value;
|
|
123
123
|
let n = e.value;
|
|
124
|
-
return n ?
|
|
125
|
-
}), r =
|
|
124
|
+
return n ? b(n.state) > 0 : !1;
|
|
125
|
+
}), r = d(() => {
|
|
126
126
|
t.value;
|
|
127
127
|
let n = e.value;
|
|
128
|
-
return n ?
|
|
128
|
+
return n ? v(n.state) > 0 : !1;
|
|
129
129
|
});
|
|
130
130
|
function i() {
|
|
131
131
|
let t = e.value;
|
|
132
|
-
return t ?
|
|
132
|
+
return t ? y(t.state, t.dispatch) : !1;
|
|
133
133
|
}
|
|
134
134
|
function a() {
|
|
135
135
|
let t = e.value;
|
|
136
|
-
return t ?
|
|
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
|
|
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
|
|
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
|
|
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
|
|
190
|
-
return
|
|
189
|
+
function z(e) {
|
|
190
|
+
return R(L(e));
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function B() {
|
|
193
193
|
let e = window.getSelection();
|
|
194
194
|
return e !== null && !e.isCollapsed && e.rangeCount > 0;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
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
|
|
201
|
-
function
|
|
202
|
-
|
|
200
|
+
var H = "docx-selection-styles", U = null;
|
|
201
|
+
function W() {
|
|
202
|
+
U &&= (U.remove(), null), document.getElementById(H)?.remove();
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
|
|
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
|
-
|
|
267
|
+
U = document.createElement("style"), U.id = H, U.textContent = t, document.head.appendChild(U);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
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
|
|
274
|
+
function q() {
|
|
275
275
|
return window.getSelection()?.toString() ?? "";
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
let { containerRef: t, enabled: n = !0, config: r =
|
|
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 =
|
|
281
|
-
|
|
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
|
-
|
|
290
|
-
_ = performance.now(), v(),
|
|
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
|
|
310
|
-
n && (
|
|
311
|
-
}),
|
|
312
|
-
document.removeEventListener("selectionchange", b),
|
|
313
|
-
}),
|
|
314
|
-
hasSelection:
|
|
315
|
-
selectedText:
|
|
316
|
-
highlightRects:
|
|
317
|
-
isSelectionInContainer:
|
|
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
|
|
325
|
-
let e = new
|
|
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(),
|
|
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 =
|
|
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
|
|
366
|
-
let t =
|
|
365
|
+
function X(e) {
|
|
366
|
+
let t = O();
|
|
367
367
|
function n(t) {
|
|
368
368
|
let n = e.value;
|
|
369
|
-
return n ?
|
|
369
|
+
return n ? j(n, t) : null;
|
|
370
370
|
}
|
|
371
371
|
function r(t) {
|
|
372
372
|
let n = e.value;
|
|
373
|
-
return n ?
|
|
373
|
+
return n ? k(n, t) : null;
|
|
374
374
|
}
|
|
375
375
|
function i(e, t) {
|
|
376
|
-
return
|
|
376
|
+
return A(e, t);
|
|
377
377
|
}
|
|
378
378
|
function a(n, r) {
|
|
379
|
-
return
|
|
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 {
|
|
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("./
|
|
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,
|
|
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 =
|
|
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 };
|