@stll/folio-vue 0.8.1 → 0.10.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-BcB7qvzQ.cjs +4 -0
- package/dist/{ListButtons-DXqMvba3.js → ListButtons-rpVlLZJ8.js} +689 -710
- package/dist/SplitCellDialog-B_TOoiMw.cjs +15 -0
- package/dist/{WatermarkDialog-r4wmldt4.js → SplitCellDialog-DRQuZsA3.js} +1537 -1604
- package/dist/components/AutocompleteCaretOverlay.types.d.ts +18 -0
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +16 -3
- package/dist/components/DocxEditor/types.d.ts +27 -0
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/useColorMode.d.ts +17 -4
- package/dist/composables/useContextMenus.d.ts +3 -0
- package/dist/composables/useDocxEditor.d.ts +47 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +14 -0
- package/dist/composables/useFindReplace.d.ts +24 -22
- package/dist/composables/useFontLifecycle.d.ts +21 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +0 -1
- package/dist/composables/usePagesPointer.d.ts +14 -13
- package/dist/composables/useRemoteSelectionSync.d.ts +10 -0
- package/dist/composables/useSelectionSync.d.ts +17 -30
- package/dist/composables.cjs +2 -2
- package/dist/composables.js +93 -81
- 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 +4 -1
- package/dist/index.js +2249 -1401
- package/dist/renderAsync.d.ts +4 -0
- package/dist/styles/zIndex.d.ts +1 -0
- package/dist/styles.cjs +1 -1
- package/dist/styles.js +1 -1
- package/dist/ui/folio-ui.d.ts +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +10 -10
- package/dist/useFindReplace-CL8Rbc3y.js +59 -0
- package/dist/useFindReplace-ZCrdvwEk.cjs +1 -0
- 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 +7 -0
- package/dist/utils/fontFaces.d.ts +10 -0
- package/dist/utils/hostFonts.d.ts +1 -5
- package/dist/zIndex-CYoLNG_N.cjs +1 -0
- package/dist/{zIndex-BY0qa8Au.js → zIndex-Ei9BbHSW.js} +1 -0
- package/package.json +1 -1
- package/dist/ListButtons-BvsV1yti.cjs +0 -4
- package/dist/WatermarkDialog-DHfk8jrg.cjs +0 -15
- package/dist/components/sidebar/resolveItemPositions.d.ts +0 -22
- package/dist/composables/useHostCallbacks.d.ts +0 -24
- package/dist/composables/useMenuActions.d.ts +0 -36
- package/dist/useZoom-C7jhL696.cjs +0 -1
- package/dist/useZoom-zJvuJlUd.js +0 -615
- package/dist/zIndex-dFsQbASx.cjs +0 -1
package/dist/composables.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { t as e } from "./useFindReplace-CL8Rbc3y.js";
|
|
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";
|
|
8
9
|
//#region src/composables/useClipboard.ts
|
|
9
|
-
function
|
|
10
|
-
let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o } = e, s =
|
|
11
|
-
async function
|
|
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
|
+
async function u(e) {
|
|
12
13
|
if (s.value) return !1;
|
|
13
14
|
s.value = !0;
|
|
14
15
|
try {
|
|
15
|
-
let n = await
|
|
16
|
+
let n = await x(e.runs, l);
|
|
16
17
|
return n && t?.(e), n;
|
|
17
18
|
} finally {
|
|
18
19
|
s.value = !1;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
async function
|
|
22
|
+
async function d(e) {
|
|
22
23
|
if (s.value || !a) return !1;
|
|
23
24
|
s.value = !0;
|
|
24
25
|
try {
|
|
25
|
-
let t = await
|
|
26
|
+
let t = await x(e.runs, l);
|
|
26
27
|
return t && n?.(e), t;
|
|
27
28
|
} finally {
|
|
28
29
|
s.value = !1;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
async function
|
|
32
|
+
async function f(e = !1) {
|
|
32
33
|
if (s.value || !a) return null;
|
|
33
34
|
s.value = !0;
|
|
34
35
|
try {
|
|
@@ -36,7 +37,7 @@ function O(e = {}) {
|
|
|
36
37
|
let t = await navigator.clipboard.read(), n = "", a = "";
|
|
37
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());
|
|
38
39
|
e && (n = "");
|
|
39
|
-
let o =
|
|
40
|
+
let o = S(n, a, i);
|
|
40
41
|
return c.value = o, r?.(o, e), o;
|
|
41
42
|
}
|
|
42
43
|
return null;
|
|
@@ -47,17 +48,17 @@ function O(e = {}) {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
return {
|
|
50
|
-
copy:
|
|
51
|
-
cut:
|
|
52
|
-
paste:
|
|
51
|
+
copy: u,
|
|
52
|
+
cut: d,
|
|
53
|
+
paste: f,
|
|
53
54
|
isProcessing: s,
|
|
54
55
|
lastPastedContent: c
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
//#endregion
|
|
58
59
|
//#region src/composables/useFixedDropdown.ts
|
|
59
|
-
function
|
|
60
|
-
let r =
|
|
60
|
+
function P({ isOpen: e, onClose: t, align: n = "left" }) {
|
|
61
|
+
let r = h(null), i = h(null), a = h({
|
|
61
62
|
position: "fixed",
|
|
62
63
|
top: "0px",
|
|
63
64
|
left: "0px",
|
|
@@ -78,19 +79,19 @@ function k({ isOpen: e, onClose: t, align: n = "left" }) {
|
|
|
78
79
|
function c(e) {
|
|
79
80
|
e.key === "Escape" && t();
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function l(e) {
|
|
82
83
|
let n = e.target;
|
|
83
84
|
n instanceof Node && i.value && i.value.contains(n) || t();
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
-
document.addEventListener("mousedown", s), document.addEventListener("keydown", c), window.addEventListener("scroll",
|
|
86
|
+
function u() {
|
|
87
|
+
document.addEventListener("mousedown", s), document.addEventListener("keydown", c), window.addEventListener("scroll", l, !0);
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
document.removeEventListener("mousedown", s), document.removeEventListener("keydown", c), window.removeEventListener("scroll",
|
|
89
|
+
function d() {
|
|
90
|
+
document.removeEventListener("mousedown", s), document.removeEventListener("keydown", c), window.removeEventListener("scroll", l, !0);
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
+
g(e, (e) => {
|
|
92
93
|
if (!e) {
|
|
93
|
-
|
|
94
|
+
d();
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
97
|
let t = r.value;
|
|
@@ -102,37 +103,37 @@ function k({ isOpen: e, onClose: t, align: n = "left" }) {
|
|
|
102
103
|
let t = e.getBoundingClientRect();
|
|
103
104
|
o(a.bottom + 4, a.right - t.width);
|
|
104
105
|
} else o(a.bottom + 4, a.left);
|
|
105
|
-
}) : o(a.bottom + 4, a.left),
|
|
106
|
-
}),
|
|
107
|
-
function
|
|
106
|
+
}) : o(a.bottom + 4, a.left), u();
|
|
107
|
+
}), m(d);
|
|
108
|
+
function f(e) {
|
|
108
109
|
e.preventDefault(), e.stopPropagation();
|
|
109
110
|
}
|
|
110
111
|
return {
|
|
111
112
|
containerRef: r,
|
|
112
113
|
dropdownRef: i,
|
|
113
114
|
dropdownStyle: a,
|
|
114
|
-
handleMouseDown:
|
|
115
|
+
handleMouseDown: f
|
|
115
116
|
};
|
|
116
117
|
}
|
|
117
118
|
//#endregion
|
|
118
119
|
//#region src/composables/useHistory.ts
|
|
119
|
-
function
|
|
120
|
-
let n =
|
|
120
|
+
function F(e, t) {
|
|
121
|
+
let n = d(() => {
|
|
121
122
|
t.value;
|
|
122
123
|
let n = e.value;
|
|
123
|
-
return n ?
|
|
124
|
-
}), r =
|
|
124
|
+
return n ? b(n.state) > 0 : !1;
|
|
125
|
+
}), r = d(() => {
|
|
125
126
|
t.value;
|
|
126
127
|
let n = e.value;
|
|
127
|
-
return n ?
|
|
128
|
+
return n ? v(n.state) > 0 : !1;
|
|
128
129
|
});
|
|
129
130
|
function i() {
|
|
130
131
|
let t = e.value;
|
|
131
|
-
return t ?
|
|
132
|
+
return t ? y(t.state, t.dispatch) : !1;
|
|
132
133
|
}
|
|
133
134
|
function a() {
|
|
134
135
|
let t = e.value;
|
|
135
|
-
return t ?
|
|
136
|
+
return t ? _(t.state, t.dispatch) : !1;
|
|
136
137
|
}
|
|
137
138
|
return {
|
|
138
139
|
canUndo: n,
|
|
@@ -143,14 +144,14 @@ function A(e, t) {
|
|
|
143
144
|
}
|
|
144
145
|
//#endregion
|
|
145
146
|
//#region src/utils/selectionHighlight.ts
|
|
146
|
-
var
|
|
147
|
+
var I = {
|
|
147
148
|
backgroundColor: "rgba(26, 115, 232, 0.3)",
|
|
148
149
|
borderRadius: 0,
|
|
149
150
|
zIndex: 0,
|
|
150
151
|
opacity: 1,
|
|
151
152
|
mixBlendMode: "multiply"
|
|
152
153
|
};
|
|
153
|
-
function
|
|
154
|
+
function L(e) {
|
|
154
155
|
let t = window.getSelection();
|
|
155
156
|
if (!t || t.rangeCount === 0 || t.isCollapsed) return [];
|
|
156
157
|
let n = t.getRangeAt(0);
|
|
@@ -169,7 +170,7 @@ function M(e) {
|
|
|
169
170
|
});
|
|
170
171
|
return a;
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
+
function R(e, t = 2) {
|
|
173
174
|
if (e.length <= 1) return e;
|
|
174
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];
|
|
175
176
|
if (!r) return e;
|
|
@@ -185,23 +186,23 @@ function N(e, t = 2) {
|
|
|
185
186
|
}
|
|
186
187
|
return i.push(a), i;
|
|
187
188
|
}
|
|
188
|
-
function
|
|
189
|
-
return
|
|
189
|
+
function z(e) {
|
|
190
|
+
return R(L(e));
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
+
function B() {
|
|
192
193
|
let e = window.getSelection();
|
|
193
194
|
return e !== null && !e.isCollapsed && e.rangeCount > 0;
|
|
194
195
|
}
|
|
195
|
-
function
|
|
196
|
+
function V(e) {
|
|
196
197
|
let t = window.getSelection();
|
|
197
198
|
return !t || t.rangeCount === 0 ? !1 : e.contains(t.getRangeAt(0).commonAncestorContainer);
|
|
198
199
|
}
|
|
199
|
-
var
|
|
200
|
-
function
|
|
201
|
-
|
|
200
|
+
var H = "docx-selection-styles", U = null;
|
|
201
|
+
function W() {
|
|
202
|
+
U &&= (U.remove(), null), document.getElementById(H)?.remove();
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
204
|
+
function G(e = I) {
|
|
205
|
+
W();
|
|
205
206
|
let t = `
|
|
206
207
|
/* DOCX Editor Selection Highlighting */
|
|
207
208
|
|
|
@@ -263,21 +264,21 @@ function B(e = j) {
|
|
|
263
264
|
border-bottom: 2px dashed rgba(156, 39, 176, 0.6);
|
|
264
265
|
}
|
|
265
266
|
`;
|
|
266
|
-
|
|
267
|
+
U = document.createElement("style"), U.id = H, U.textContent = t, document.head.appendChild(U);
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
-
return
|
|
269
|
+
function K() {
|
|
270
|
+
return U !== null || document.getElementById(H) !== null;
|
|
270
271
|
}
|
|
271
272
|
//#endregion
|
|
272
273
|
//#region src/composables/useSelectionHighlight.ts
|
|
273
|
-
function
|
|
274
|
+
function q() {
|
|
274
275
|
return window.getSelection()?.toString() ?? "";
|
|
275
276
|
}
|
|
276
|
-
function
|
|
277
|
-
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;
|
|
278
279
|
function v() {
|
|
279
|
-
let e = t.value, n =
|
|
280
|
-
|
|
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);
|
|
281
282
|
}
|
|
282
283
|
function y() {
|
|
283
284
|
v();
|
|
@@ -285,8 +286,8 @@ function U(e) {
|
|
|
285
286
|
function b() {
|
|
286
287
|
let e = performance.now();
|
|
287
288
|
if (e - _ < a) {
|
|
288
|
-
|
|
289
|
-
_ = performance.now(), v(),
|
|
289
|
+
m && clearTimeout(m), m = setTimeout(() => {
|
|
290
|
+
_ = performance.now(), v(), m = null;
|
|
290
291
|
}, a);
|
|
291
292
|
return;
|
|
292
293
|
}
|
|
@@ -305,23 +306,23 @@ function U(e) {
|
|
|
305
306
|
};
|
|
306
307
|
return r.borderRadius && (t.borderRadius = `${r.borderRadius}px`), r.borderColor && (t.border = `1px solid ${r.borderColor}`), t;
|
|
307
308
|
}
|
|
308
|
-
return
|
|
309
|
-
n && (
|
|
310
|
-
}),
|
|
311
|
-
document.removeEventListener("selectionchange", b),
|
|
312
|
-
}),
|
|
313
|
-
hasSelection:
|
|
314
|
-
selectedText:
|
|
315
|
-
highlightRects:
|
|
316
|
-
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),
|
|
317
318
|
refresh: y,
|
|
318
319
|
getOverlayStyle: x
|
|
319
320
|
};
|
|
320
321
|
}
|
|
321
322
|
//#endregion
|
|
322
323
|
//#region src/composables/useTableSelection.ts
|
|
323
|
-
function
|
|
324
|
-
let e = new
|
|
324
|
+
function Y() {
|
|
325
|
+
let e = new E(), t = h(null), n = () => {
|
|
325
326
|
let n = e.getSnapshot();
|
|
326
327
|
t.value = n.tableIndex !== null && n.rowIndex !== null && n.columnIndex !== null ? {
|
|
327
328
|
tableIndex: n.tableIndex,
|
|
@@ -329,10 +330,21 @@ function W() {
|
|
|
329
330
|
columnIndex: n.columnIndex
|
|
330
331
|
} : null;
|
|
331
332
|
}, r = e.subscribe(n);
|
|
332
|
-
n(),
|
|
333
|
-
function i(
|
|
333
|
+
n(), m(r);
|
|
334
|
+
function i(t, n, r) {
|
|
335
|
+
e.selectCellCoordinates({
|
|
336
|
+
tableIndex: t,
|
|
337
|
+
rowIndex: n,
|
|
338
|
+
columnIndex: r
|
|
339
|
+
});
|
|
340
|
+
}
|
|
334
341
|
function a(t, n) {
|
|
335
|
-
|
|
342
|
+
let r = D(t, n);
|
|
343
|
+
if (!r) {
|
|
344
|
+
e.clearSelection();
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
e.selectCellCoordinates(r);
|
|
336
348
|
}
|
|
337
349
|
function o() {
|
|
338
350
|
e.clearSelection();
|
|
@@ -350,21 +362,21 @@ function W() {
|
|
|
350
362
|
}
|
|
351
363
|
//#endregion
|
|
352
364
|
//#region src/composables/useVisualLineNavigation.ts
|
|
353
|
-
function
|
|
354
|
-
let t =
|
|
365
|
+
function X(e) {
|
|
366
|
+
let t = O();
|
|
355
367
|
function n(t) {
|
|
356
368
|
let n = e.value;
|
|
357
|
-
return n ?
|
|
369
|
+
return n ? j(n, t) : null;
|
|
358
370
|
}
|
|
359
371
|
function r(t) {
|
|
360
372
|
let n = e.value;
|
|
361
|
-
return n ?
|
|
373
|
+
return n ? k(n, t) : null;
|
|
362
374
|
}
|
|
363
375
|
function i(e, t) {
|
|
364
|
-
return
|
|
376
|
+
return A(e, t);
|
|
365
377
|
}
|
|
366
378
|
function a(n, r) {
|
|
367
|
-
return
|
|
379
|
+
return M(t, n, r, e.value);
|
|
368
380
|
}
|
|
369
381
|
return {
|
|
370
382
|
state: t,
|
|
@@ -375,4 +387,4 @@ function G(e) {
|
|
|
375
387
|
};
|
|
376
388
|
}
|
|
377
389
|
//#endregion
|
|
378
|
-
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-B_TOoiMw.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-DRQuZsA3.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 };
|