@eigenpal/docx-editor-vue 1.2.1 → 1.3.1
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/{KeyboardShortcutsDialog-5ZsgieYf.js → KeyboardShortcutsDialog-00eb4Ova.js} +23 -0
- package/dist/KeyboardShortcutsDialog-EW9K4wuO.cjs +1 -0
- package/dist/MenuBar-DeogoqFP.js +3330 -0
- package/dist/MenuBar-bU4-4dnA.cjs +4 -0
- package/dist/{TablePropertiesDialog-DTCcLpPC.cjs → TablePropertiesDialog-BZLpFAkg.cjs} +1 -1
- package/dist/{TablePropertiesDialog-PR4ftalH.js → TablePropertiesDialog-CBTvM4Xy.js} +1 -1
- package/dist/composables/useCommentLifecycle.d.ts +3 -0
- package/dist/composables/useCommentManagement.d.ts +6 -0
- package/dist/composables/useFormattingActions.d.ts +2 -22
- package/dist/composables/useMenuActions.d.ts +1 -0
- package/dist/composables/useSelectionSync.d.ts +16 -0
- package/dist/composables/useWatermarkControls.d.ts +15 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +124 -209
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +2 -2
- package/dist/docx-editor-vue.css +1 -1
- package/dist/index.cjs +9 -10
- package/dist/index.js +1373 -1210
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +3 -3
- package/dist/useCommentSidebarItems-BHomCzpj.js +44 -0
- package/dist/useCommentSidebarItems-CbNvNCd3.cjs +1 -0
- package/dist/useDragAutoScroll-BT6oPYBj.cjs +1 -0
- package/dist/useDragAutoScroll-C56F_WS_.js +493 -0
- package/dist/utils/domQueries.d.ts +17 -6
- package/dist/utils/refApiQueries.d.ts +8 -44
- package/package.json +4 -4
- package/dist/KeyboardShortcutsDialog-DiG-tfJT.cjs +0 -1
- package/dist/MenuBar-DLXxthZk.js +0 -3365
- package/dist/MenuBar-De3YJFpj.cjs +0 -4
- package/dist/useTableResize-BcBdSaOE.js +0 -583
- package/dist/useTableResize-DTag4SY0.cjs +0 -1
- package/dist/utils/commentFactories.d.ts +0 -7
- package/dist/utils/paraTextHelpers.d.ts +0 -29
package/dist/index.js
CHANGED
|
@@ -1,141 +1,100 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-
|
|
2
|
-
import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./KeyboardShortcutsDialog-00eb4Ova.js";
|
|
2
|
+
import { a as p, c as m, h, i as g, o as _, s as v, t as y, x as b } from "./MenuBar-DeogoqFP.js";
|
|
3
3
|
import { t as x } from "./_plugin-vue_export-helper-B52Kst-M.js";
|
|
4
4
|
import { n as ee } from "./RenderedDomContext-CHc18N_2.js";
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as ne, r as re, t as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { NodeSelection as
|
|
9
|
-
import { clickToPositionDom as
|
|
10
|
-
import {
|
|
11
|
-
import { SIDEBAR_DOCUMENT_SHIFT as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
5
|
+
import { t as S } from "./zIndex-CxELVe_L.js";
|
|
6
|
+
import { i as te, n as ne, r as re, t as C } from "./useDragAutoScroll-C56F_WS_.js";
|
|
7
|
+
import { Fragment as w, Teleport as T, computed as E, createApp as ie, createBlock as D, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createSlots as ae, createStaticVNode as oe, createTextVNode as j, createVNode as M, defineComponent as N, h as P, isRef as se, nextTick as ce, normalizeClass as le, normalizeStyle as F, onBeforeUnmount as I, onMounted as ue, openBlock as L, ref as R, renderList as z, renderSlot as de, resolveDynamicComponent as fe, shallowRef as B, toDisplayString as V, unref as H, vModelCheckbox as pe, vModelSelect as U, vModelText as W, watch as G, withCtx as me, withDirectives as K, withKeys as q, withModifiers as J } from "vue";
|
|
8
|
+
import { NodeSelection as he, TextSelection as Y } from "prosemirror-state";
|
|
9
|
+
import { applyCellSelectionHighlight as ge, clickToPositionDom as X, computeHfCaretRectFromView as _e, computeHfSelectionRectsFromView as ve, findBodyPmAnchor as ye, findBodyPmSpans as be } from "@eigenpal/docx-editor-core/layout-bridge";
|
|
10
|
+
import { findInDocument as xe, getPageContent as Se, getSelectionInfo as Ce } from "@eigenpal/docx-editor-core/prosemirror/queries";
|
|
11
|
+
import { SIDEBAR_DOCUMENT_SHIFT as we, findWordBoundaries as Te, loadFontDefinitions as Ee, onFontError as De, pixelsToEmu as Oe, readDocxFileFromInput as ke, toArrayBuffer as Ae } from "@eigenpal/docx-editor-core/utils";
|
|
12
|
+
import { extractSelectionContext as je } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
|
|
13
|
+
import { clearFormatting as Z, findHyperlinkRangeAt as Me } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
|
|
14
|
+
import { getTableContext as Ne } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
|
|
15
|
+
import { clickToPositionDom as Pe, getCaretPositionFromDom as Fe, getSelectionRectsFromDom as Ie } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
|
|
16
|
+
import { commitImageFloatMove as Le, commitImageInlineMove as Re, commitImageResize as ze, isFloatingImage as Q } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
|
|
17
|
+
import { IMAGE_LAYOUT_OPTIONS as Be, captureInlinePositionEmu as Ve, deriveLayoutChoice as He, findImageElement as Ue, isImageLayoutOptionEnabled as We, renderAllPagesNow as Ge, toolbarValueToLayoutTarget as Ke } from "@eigenpal/docx-editor-core/layout-painter";
|
|
18
|
+
import { proseDocToBlocks as qe } from "@eigenpal/docx-editor-core/prosemirror/conversion";
|
|
19
|
+
import { LayoutSelectionGate as Je, addRepeatingSectionItemTr as Ye, findContentControlPos as Xe, findContentControlsInPM as Ze, removeContentControlTr as Qe, removeRepeatingSectionItemTr as $e, schema as et, setContentControlContentTr as tt, setContentControlValueTr as nt } from "@eigenpal/docx-editor-core/prosemirror";
|
|
20
|
+
import { twipsToPixels as rt } from "@eigenpal/docx-editor-core/utils/units";
|
|
21
|
+
import { pictureWatermarkDisplayEmu as it } from "@eigenpal/docx-editor-core/types/document";
|
|
22
|
+
import { makeRevisionInfo as at } from "@eigenpal/docx-editor-core/prosemirror/plugins";
|
|
23
|
+
import { findPageIndexContainingPmPos as ot } from "@eigenpal/docx-editor-core/layout-engine";
|
|
24
|
+
import { applyStyle as st, removeTabStop as ct, setIndentFirstLine as lt, setIndentLeft as ut, setIndentRight as dt } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
|
|
25
|
+
import { createStyleResolver as ft } from "@eigenpal/docx-editor-core/prosemirror/styles";
|
|
26
|
+
import { insertPageBreak as pt } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
|
|
27
|
+
import { applyFormatting as mt, setParagraphStyle as ht } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
|
|
28
|
+
import { acceptChange as gt, acceptChangeById as _t, getWatermarkFromState as vt, insertImageNode as yt, rejectChange as bt, rejectChangeById as xt, setWatermark as St } from "@eigenpal/docx-editor-core/prosemirror/commands";
|
|
29
|
+
import { collectHeadings as Ct } from "@eigenpal/docx-editor-core/utils/headingCollector";
|
|
30
|
+
import { addCommentToRange as wt, applyProposedChange as Tt, createComment as Et } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
|
|
31
|
+
import { PENDING_COMMENT_ID as Dt, createCommentIdAllocator as Ot, seedCommentAllocator as kt } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
|
|
32
|
+
import { extractTrackedChanges as At } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
|
|
33
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as jt, detectTableInsertHover as Mt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
|
|
34
|
+
import { openReportIssue as Nt } from "@eigenpal/docx-editor-core/utils/reportIssue";
|
|
35
|
+
import { ContentControlNotFoundError as Pt } from "@eigenpal/docx-editor-core/agent";
|
|
36
|
+
import { findParaIdRange as Ft } from "@eigenpal/docx-editor-core/prosemirror/paraText";
|
|
37
|
+
import { createDocumentWithText as It, createEmptyDocument as Lt } from "@eigenpal/docx-editor-core";
|
|
38
|
+
//#region src/utils/domQueries.ts
|
|
39
|
+
function Rt(e) {
|
|
40
|
+
let t = window.document.querySelectorAll(`.layout-page-${e}`);
|
|
41
|
+
if (t.length === 0) return null;
|
|
42
|
+
let n = window.innerHeight / 2, r = t[0], i = Infinity;
|
|
43
|
+
for (let e of Array.from(t)) {
|
|
44
|
+
let t = e.getBoundingClientRect(), a = Math.abs((t.top + t.bottom) / 2 - n);
|
|
45
|
+
a < i && (i = a, r = e);
|
|
46
|
+
}
|
|
47
|
+
return r;
|
|
43
48
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
let r
|
|
47
|
-
|
|
48
|
-
if (!
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}), r.join("");
|
|
49
|
+
function zt(e, t, n) {
|
|
50
|
+
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : be(e);
|
|
51
|
+
for (let e of r) {
|
|
52
|
+
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
53
|
+
if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
52
56
|
}
|
|
53
|
-
function
|
|
54
|
-
if (!
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}), i += e.text);
|
|
61
|
-
});
|
|
62
|
-
let o = i.indexOf(r);
|
|
63
|
-
if (o === -1 || i.indexOf(r, o + 1) !== -1) return null;
|
|
64
|
-
let s = 0, c = t, l = t;
|
|
65
|
-
for (let e of a) {
|
|
66
|
-
let t = s + e.len;
|
|
67
|
-
if (s <= o && o < t && (c = e.pos + (o - s)), s <= o + r.length && o + r.length <= t) {
|
|
68
|
-
l = e.pos + (o + r.length - s);
|
|
57
|
+
function Bt(e, t, n) {
|
|
58
|
+
if (!e || !t) return;
|
|
59
|
+
let r = null;
|
|
60
|
+
for (let t of be(e)) {
|
|
61
|
+
let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
|
|
62
|
+
if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
|
|
63
|
+
r = t;
|
|
69
64
|
break;
|
|
70
65
|
}
|
|
71
|
-
s = t;
|
|
72
66
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
if (r ||= e.querySelector(`[data-pm-start="${n}"]`), !r) return;
|
|
68
|
+
let i = t.getBoundingClientRect(), a = r.getBoundingClientRect();
|
|
69
|
+
t.scrollTo({
|
|
70
|
+
top: a.top - i.top + t.scrollTop - 48,
|
|
71
|
+
behavior: "smooth"
|
|
72
|
+
});
|
|
77
73
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
let r = n?.caseSensitive ?? !1, i = n?.limit ?? 20, a = r ? t : t.toLowerCase(), o = [];
|
|
83
|
-
return e.state.doc.descendants((e) => {
|
|
84
|
-
if (o.length >= i) return !1;
|
|
85
|
-
if (!e.isTextblock) return !0;
|
|
86
|
-
let n = e.attrs?.paraId;
|
|
87
|
-
if (!n) return !1;
|
|
88
|
-
let s = mt(e), c = r ? s : s.toLowerCase(), l = c.indexOf(a);
|
|
89
|
-
return l === -1 || c.indexOf(a, l + 1) !== -1 || o.push({
|
|
90
|
-
paraId: n,
|
|
91
|
-
match: s.slice(l, l + t.length),
|
|
92
|
-
before: s.slice(Math.max(0, l - 40), l),
|
|
93
|
-
after: s.slice(l + t.length, l + t.length + 40)
|
|
94
|
-
}), !1;
|
|
95
|
-
}), o;
|
|
74
|
+
function Vt(e, t, n, r) {
|
|
75
|
+
if (!e || !t) return null;
|
|
76
|
+
let i = X(e, n, r, 1);
|
|
77
|
+
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
96
78
|
}
|
|
97
|
-
function
|
|
98
|
-
if (!e) return
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
let a = i
|
|
102
|
-
|
|
103
|
-
let o = a.attrs?.paraId ?? null, s = r.start(i), c = s + a.content.size, l = ht(n, s, t.from), u = ht(n, t.from, t.to), d = ht(n, t.to, c);
|
|
104
|
-
return {
|
|
105
|
-
paraId: o,
|
|
106
|
-
selectedText: u,
|
|
107
|
-
paragraphText: l + u + d,
|
|
108
|
-
before: l,
|
|
109
|
-
after: d
|
|
110
|
-
};
|
|
79
|
+
function Ht(e, t, n, r) {
|
|
80
|
+
if (!e) return;
|
|
81
|
+
let i = zt(e, t, r);
|
|
82
|
+
if (!i) return;
|
|
83
|
+
let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Te(a, t - o), l = o + s, u = o + c;
|
|
84
|
+
l < u && n(l, u);
|
|
111
85
|
}
|
|
112
|
-
function
|
|
113
|
-
if (!
|
|
114
|
-
let
|
|
115
|
-
if (!
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (n == null) continue;
|
|
121
|
-
let r = e.state.doc.nodeAt(n);
|
|
122
|
-
if (!r || !r.isTextblock) continue;
|
|
123
|
-
let o = r.attrs?.paraId;
|
|
124
|
-
!o || i.has(o) || (i.add(o), a.push({
|
|
125
|
-
paraId: o,
|
|
126
|
-
text: mt(r),
|
|
127
|
-
styleId: r.attrs?.styleId ?? void 0
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
pageNumber: n,
|
|
132
|
-
text: a.map((e) => `[${e.paraId}] ${e.text}`).join("\n"),
|
|
133
|
-
paragraphs: a
|
|
134
|
-
};
|
|
86
|
+
function Ut(e, t, n, r) {
|
|
87
|
+
if (!e) return;
|
|
88
|
+
let i = zt(e, t, r);
|
|
89
|
+
if (!i) return;
|
|
90
|
+
let a = i.closest(".layout-paragraph");
|
|
91
|
+
if (!a) return;
|
|
92
|
+
let o = Number(a.dataset.pmStart), s = Number(a.dataset.pmEnd);
|
|
93
|
+
!isNaN(o) && !isNaN(s) && o < s && n(o, s);
|
|
135
94
|
}
|
|
136
95
|
//#endregion
|
|
137
96
|
//#region src/components/DecorationLayer.vue
|
|
138
|
-
var
|
|
97
|
+
var Wt = /* @__PURE__ */ N({
|
|
139
98
|
__name: "DecorationLayer",
|
|
140
99
|
props: {
|
|
141
100
|
getView: { type: Function },
|
|
@@ -145,7 +104,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
145
104
|
syncCoordinator: {}
|
|
146
105
|
},
|
|
147
106
|
setup(e) {
|
|
148
|
-
let t = e, n =
|
|
107
|
+
let t = e, n = R(null), r = R(0), i = null, a = null;
|
|
149
108
|
function o() {
|
|
150
109
|
i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
|
|
151
110
|
i = null;
|
|
@@ -153,13 +112,13 @@ var bt = /* @__PURE__ */ j({
|
|
|
153
112
|
!e || !r || !a || t.syncCoordinator.isSafeToRender() && s(e, r, a, t.zoom);
|
|
154
113
|
});
|
|
155
114
|
}
|
|
156
|
-
|
|
115
|
+
ue(() => {
|
|
157
116
|
a = t.syncCoordinator.onRender(() => {
|
|
158
117
|
r.value++;
|
|
159
118
|
}), o();
|
|
160
|
-
}),
|
|
119
|
+
}), I(() => {
|
|
161
120
|
i !== null && (cancelAnimationFrame(i), i = null), a?.();
|
|
162
|
-
}),
|
|
121
|
+
}), G(() => [
|
|
163
122
|
t.zoom,
|
|
164
123
|
t.transactionVersion,
|
|
165
124
|
r.value
|
|
@@ -220,20 +179,20 @@ var bt = /* @__PURE__ */ j({
|
|
|
220
179
|
function u(e) {
|
|
221
180
|
return e.type?.attrs ?? null;
|
|
222
181
|
}
|
|
223
|
-
return (e, t) => (
|
|
182
|
+
return (e, t) => (L(), k("div", {
|
|
224
183
|
ref_key: "overlayRef",
|
|
225
184
|
ref: n,
|
|
226
185
|
class: "paged-editor__decoration-overlay",
|
|
227
186
|
"aria-hidden": "true"
|
|
228
187
|
}, null, 512));
|
|
229
188
|
}
|
|
230
|
-
}),
|
|
189
|
+
}), Gt = ["data-handle", "onMousedown"], Kt = ["title"], qt = {
|
|
231
190
|
key: 0,
|
|
232
191
|
class: "image-overlay__dim"
|
|
233
|
-
},
|
|
192
|
+
}, Jt = {
|
|
234
193
|
key: 1,
|
|
235
194
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
236
|
-
},
|
|
195
|
+
}, Yt = 4, Xt = 15, Zt = /* @__PURE__ */ x(/* @__PURE__ */ N({
|
|
237
196
|
__name: "ImageSelectionOverlay",
|
|
238
197
|
props: {
|
|
239
198
|
imageInfo: {},
|
|
@@ -247,8 +206,8 @@ var bt = /* @__PURE__ */ j({
|
|
|
247
206
|
"context-menu"
|
|
248
207
|
],
|
|
249
208
|
setup(e, { emit: t }) {
|
|
250
|
-
let { t: r } = n(), i = e, a = t, o =
|
|
251
|
-
function
|
|
209
|
+
let { t: r } = n(), i = e, a = t, o = R(null), s = R(!1), c = R(!1), l = R(!1), u = R(0), d = R(0), f = R(0), p = R(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, ee = null;
|
|
210
|
+
function te(e, t) {
|
|
252
211
|
if (!e) return null;
|
|
253
212
|
try {
|
|
254
213
|
let n = e.state.doc.nodeAt(t);
|
|
@@ -257,19 +216,19 @@ var bt = /* @__PURE__ */ j({
|
|
|
257
216
|
return null;
|
|
258
217
|
}
|
|
259
218
|
}
|
|
219
|
+
function ne() {
|
|
220
|
+
return o.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
|
|
221
|
+
}
|
|
260
222
|
function re() {
|
|
261
223
|
let e = i.imageInfo;
|
|
262
224
|
if (!e) return null;
|
|
263
225
|
if (e.element.isConnected) return e.element;
|
|
264
|
-
let t =
|
|
226
|
+
let t = ne();
|
|
265
227
|
if (!t) return null;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
if (e) return e;
|
|
269
|
-
}
|
|
270
|
-
return null;
|
|
228
|
+
let n = ye(t, e.pmPos);
|
|
229
|
+
return n ? Ue(n) : null;
|
|
271
230
|
}
|
|
272
|
-
function
|
|
231
|
+
function C() {
|
|
273
232
|
let e = re();
|
|
274
233
|
if (!e || !o.value) {
|
|
275
234
|
p.value = null;
|
|
@@ -282,24 +241,32 @@ var bt = /* @__PURE__ */ j({
|
|
|
282
241
|
}
|
|
283
242
|
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), a = i.zoom;
|
|
284
243
|
p.value = {
|
|
285
|
-
left: (r.left - n.left) / a,
|
|
286
|
-
top: (r.top - n.top) / a,
|
|
244
|
+
left: (r.left - n.left + t.scrollLeft) / a,
|
|
245
|
+
top: (r.top - n.top + t.scrollTop) / a,
|
|
287
246
|
width: r.width / a,
|
|
288
247
|
height: r.height / a
|
|
289
248
|
};
|
|
290
249
|
}
|
|
291
|
-
|
|
292
|
-
await ce(),
|
|
293
|
-
}, { immediate: !0 }),
|
|
250
|
+
G(() => i.imageInfo, async () => {
|
|
251
|
+
await ce(), C();
|
|
252
|
+
}, { immediate: !0 }), G(() => i.zoom, (e, t, n) => {
|
|
253
|
+
if (!i.imageInfo) return;
|
|
254
|
+
let r = 0, a = "", o = 0, s = 0, c = (e) => {
|
|
255
|
+
C();
|
|
256
|
+
let t = p.value, n = t ? `${t.left}|${t.top}|${t.width}|${t.height}` : "";
|
|
257
|
+
o = n === a ? o + 1 : 0, a = n, s += e, o < 2 && s < 500 && (r = requestAnimationFrame(() => c(16)));
|
|
258
|
+
};
|
|
259
|
+
r = requestAnimationFrame(() => c(16)), n(() => cancelAnimationFrame(r));
|
|
260
|
+
}), G(() => i.imageInfo, (e, t, n) => {
|
|
294
261
|
if (!i.imageInfo) return;
|
|
295
262
|
let r = () => {
|
|
296
|
-
b && cancelAnimationFrame(b), b = requestAnimationFrame(
|
|
297
|
-
}, a = o.value?.closest(".docx-editor-vue__pages-viewport")
|
|
263
|
+
b && cancelAnimationFrame(b), b = requestAnimationFrame(C);
|
|
264
|
+
}, a = o.value?.closest(".docx-editor-vue__pages-viewport");
|
|
298
265
|
a?.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r, { passive: !0 }), n(() => {
|
|
299
266
|
a?.removeEventListener("scroll", r), window.removeEventListener("resize", r), b && cancelAnimationFrame(b);
|
|
300
267
|
});
|
|
301
268
|
}, { immediate: !0 });
|
|
302
|
-
let
|
|
269
|
+
let T = E(() => s.value ? u.value : p.value?.width || 0), ie = E(() => s.value ? d.value : p.value?.height || 0), D = E(() => {
|
|
303
270
|
let e = p.value;
|
|
304
271
|
if (!e) return {
|
|
305
272
|
position: "absolute",
|
|
@@ -308,18 +275,20 @@ var bt = /* @__PURE__ */ j({
|
|
|
308
275
|
visibility: "hidden",
|
|
309
276
|
pointerEvents: "none"
|
|
310
277
|
};
|
|
311
|
-
let t = s.value ? u.value : e.width, n = s.value ? d.value : e.height;
|
|
278
|
+
let t = s.value ? u.value : e.width, n = s.value ? d.value : e.height, r = i.zoom || 1;
|
|
312
279
|
return {
|
|
313
280
|
position: "absolute",
|
|
314
|
-
left: `${e.left}px`,
|
|
315
|
-
top: `${e.top}px`,
|
|
281
|
+
left: `${e.left * r}px`,
|
|
282
|
+
top: `${e.top * r}px`,
|
|
316
283
|
width: `${t}px`,
|
|
317
284
|
height: `${n}px`,
|
|
318
|
-
|
|
285
|
+
transform: r === 1 ? void 0 : `scale(${r})`,
|
|
286
|
+
transformOrigin: "top left",
|
|
287
|
+
zIndex: S.imageOverlay,
|
|
319
288
|
pointerEvents: "auto"
|
|
320
289
|
};
|
|
321
|
-
}), ae =
|
|
322
|
-
let e =
|
|
290
|
+
}), ae = E(() => {
|
|
291
|
+
let e = T.value, t = ie.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
|
|
323
292
|
return [
|
|
324
293
|
{
|
|
325
294
|
pos: "nw",
|
|
@@ -387,7 +356,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
387
356
|
}
|
|
388
357
|
];
|
|
389
358
|
}), oe = (e) => e.length === 2;
|
|
390
|
-
function
|
|
359
|
+
function j(e, t, n, r, i, a) {
|
|
391
360
|
let o = e.includes("w") ? -1 : +!!e.includes("e"), s = e.includes("n") ? -1 : +!!e.includes("s"), c = r + t * o, l = i + n * s;
|
|
392
361
|
if (oe(e) && a) {
|
|
393
362
|
let e = Math.max(c / r, l / i);
|
|
@@ -398,11 +367,11 @@ var bt = /* @__PURE__ */ j({
|
|
|
398
367
|
height: s === 0 ? i : Math.max(20, Math.min(2e3, l))
|
|
399
368
|
};
|
|
400
369
|
}
|
|
401
|
-
function
|
|
402
|
-
!i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove",
|
|
370
|
+
function M(e, t) {
|
|
371
|
+
!i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove", N), document.addEventListener("mouseup", P));
|
|
403
372
|
}
|
|
404
|
-
function
|
|
405
|
-
let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o =
|
|
373
|
+
function N(e) {
|
|
374
|
+
let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = j(m, n, r, _, v, a);
|
|
406
375
|
u.value = Math.round(o.width), d.value = Math.round(o.height);
|
|
407
376
|
let s = y;
|
|
408
377
|
s && (p.value = {
|
|
@@ -412,181 +381,151 @@ var bt = /* @__PURE__ */ j({
|
|
|
412
381
|
height: s.height
|
|
413
382
|
});
|
|
414
383
|
}
|
|
415
|
-
function
|
|
416
|
-
document.removeEventListener("mousemove",
|
|
384
|
+
function P() {
|
|
385
|
+
document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", P), s.value = !1, y = null, a("interact-end");
|
|
417
386
|
let e = i.view, t = i.imageInfo;
|
|
418
387
|
if (!e || !t) {
|
|
419
|
-
|
|
388
|
+
C();
|
|
420
389
|
return;
|
|
421
390
|
}
|
|
422
|
-
let n =
|
|
423
|
-
|
|
424
|
-
e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
|
|
425
|
-
...n.attrs,
|
|
426
|
-
width: u.value,
|
|
427
|
-
height: d.value
|
|
428
|
-
}));
|
|
429
|
-
} catch {}
|
|
430
|
-
ce(() => S());
|
|
391
|
+
let n = ze(e, t.pmPos, u.value, d.value);
|
|
392
|
+
n !== null && _e(n), ce(() => C());
|
|
431
393
|
}
|
|
432
|
-
let
|
|
433
|
-
function
|
|
394
|
+
let se = 0, le = 0, ue = 0, de = 0, fe = null, B = null;
|
|
395
|
+
function pe(e) {
|
|
434
396
|
if (!e) return 0;
|
|
435
397
|
let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
|
|
436
398
|
return t ? parseFloat(t[1]) : 0;
|
|
437
399
|
}
|
|
438
|
-
function
|
|
400
|
+
function U(e, t) {
|
|
439
401
|
let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
|
|
440
402
|
return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
|
|
441
403
|
}
|
|
442
|
-
function
|
|
443
|
-
return Math.atan2(e -
|
|
404
|
+
function W(e, t) {
|
|
405
|
+
return Math.atan2(e - se, -(t - le)) * 180 / Math.PI;
|
|
444
406
|
}
|
|
445
407
|
function me(e) {
|
|
446
408
|
if (!i.imageInfo) return;
|
|
447
409
|
let t = i.imageInfo.element.getBoundingClientRect();
|
|
448
|
-
|
|
449
|
-
let n =
|
|
450
|
-
|
|
410
|
+
se = t.left + t.width / 2, le = t.top + t.height / 2;
|
|
411
|
+
let n = te(i.view, i.imageInfo.pmPos);
|
|
412
|
+
fe = n && n.attrs.transform || null, de = pe(fe), B = i.imageInfo.element.querySelector("img"), ue = W(e.clientX, e.clientY), f.value = de, l.value = !0, a("interact-start"), document.addEventListener("mousemove", K), document.addEventListener("mouseup", q);
|
|
451
413
|
}
|
|
452
|
-
function
|
|
453
|
-
let t =
|
|
454
|
-
e.shiftKey || (n = Math.round(n /
|
|
414
|
+
function K(e) {
|
|
415
|
+
let t = W(e.clientX, e.clientY) - ue, n = de + t;
|
|
416
|
+
e.shiftKey || (n = Math.round(n / Xt) * Xt), f.value = (n % 360 + 360) % 360, B && (B.style.transform = U(fe, f.value) || "");
|
|
455
417
|
}
|
|
456
|
-
function
|
|
457
|
-
document.removeEventListener("mousemove",
|
|
418
|
+
function q() {
|
|
419
|
+
document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", q), l.value = !1, a("interact-end");
|
|
458
420
|
let e = i.view, t = i.imageInfo;
|
|
459
421
|
try {
|
|
460
|
-
let n = e && t ?
|
|
461
|
-
e && t && n && e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
|
|
422
|
+
let n = e && t ? te(e, t.pmPos) : null;
|
|
423
|
+
e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
|
|
462
424
|
...n.attrs,
|
|
463
|
-
transform:
|
|
464
|
-
}));
|
|
425
|
+
transform: U(n.attrs.transform, f.value)
|
|
426
|
+
})), _e(t.pmPos));
|
|
465
427
|
} catch {} finally {
|
|
466
|
-
|
|
428
|
+
B && (B.style.transform = ""), B = null, fe = null;
|
|
467
429
|
}
|
|
468
|
-
ce(() =>
|
|
430
|
+
ce(() => C());
|
|
469
431
|
}
|
|
470
|
-
let
|
|
471
|
-
function
|
|
432
|
+
let Y = null;
|
|
433
|
+
function ge(e) {
|
|
472
434
|
if (!i.imageInfo || !p.value) return;
|
|
473
435
|
let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
|
|
474
436
|
let s = e.clientX - t, l = e.clientY - n;
|
|
475
|
-
if (!(!o && Math.sqrt(s * s + l * l) <
|
|
437
|
+
if (!(!o && Math.sqrt(s * s + l * l) < Yt)) {
|
|
476
438
|
if (!o) {
|
|
477
|
-
o = !0, c.value = !0, a("interact-start"),
|
|
439
|
+
o = !0, c.value = !0, a("interact-start"), Y = document.createElement("div"), Y.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
|
|
478
440
|
let e = i.zoom;
|
|
479
|
-
|
|
441
|
+
Y.style.width = `${r.width * e}px`, Y.style.height = `${r.height * e}px`, document.body.appendChild(Y);
|
|
480
442
|
}
|
|
481
|
-
if (
|
|
443
|
+
if (Y) {
|
|
482
444
|
let t = i.zoom;
|
|
483
|
-
|
|
445
|
+
Y.style.left = `${e.clientX - r.width * t / 2}px`, Y.style.top = `${e.clientY - r.height * t / 2}px`;
|
|
484
446
|
}
|
|
485
447
|
}
|
|
486
448
|
}, l = (e) => {
|
|
487
|
-
document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, ee = null,
|
|
449
|
+
document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, ee = null, Y &&= (Y.remove(), null), c.value = !1, o && (a("interact-end"), X(e.clientX, e.clientY));
|
|
488
450
|
};
|
|
489
451
|
x = s, ee = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
|
|
490
452
|
}
|
|
491
|
-
function
|
|
453
|
+
function X(e, t) {
|
|
492
454
|
let n = i.view, r = i.imageInfo;
|
|
493
455
|
if (!n || !r) return;
|
|
494
|
-
let a =
|
|
495
|
-
if (
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
try {
|
|
502
|
-
if (c) {
|
|
503
|
-
let s = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
|
|
504
|
-
if (!s || s.length === 0) return;
|
|
505
|
-
let c = null;
|
|
506
|
-
for (let e of s) {
|
|
456
|
+
let a = te(n, r.pmPos);
|
|
457
|
+
if (a) {
|
|
458
|
+
if (Q(a)) {
|
|
459
|
+
let a = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
|
|
460
|
+
if (!a || a.length === 0) return;
|
|
461
|
+
let s = null;
|
|
462
|
+
for (let e of a) {
|
|
507
463
|
let n = e.getBoundingClientRect();
|
|
508
464
|
if (t >= n.top && t <= n.bottom) {
|
|
509
|
-
|
|
465
|
+
s = e.querySelector(".layout-page-content");
|
|
510
466
|
break;
|
|
511
467
|
}
|
|
512
468
|
}
|
|
513
|
-
if (
|
|
514
|
-
let
|
|
515
|
-
|
|
516
|
-
posOffset: xe(d),
|
|
517
|
-
relativeTo: "margin"
|
|
518
|
-
},
|
|
519
|
-
vertical: {
|
|
520
|
-
posOffset: xe(f),
|
|
521
|
-
relativeTo: "margin"
|
|
522
|
-
}
|
|
523
|
-
}, m = n.state.tr.setNodeMarkup(r.pmPos, void 0, {
|
|
524
|
-
...a.attrs,
|
|
525
|
-
position: p
|
|
526
|
-
});
|
|
527
|
-
n.dispatch(m), ve(r.pmPos);
|
|
469
|
+
if (s ||= a[a.length - 1].querySelector(".layout-page-content"), !s) return;
|
|
470
|
+
let c = s.getBoundingClientRect(), l = i.zoom, u = Oe((e - c.left) / l), d = Oe((t - c.top) / l), f = Le(n, r.pmPos, u, d);
|
|
471
|
+
f !== null && _e(f);
|
|
528
472
|
} else {
|
|
529
|
-
let i =
|
|
473
|
+
let i = ne();
|
|
530
474
|
if (!i) return;
|
|
531
|
-
let
|
|
532
|
-
if (
|
|
533
|
-
let
|
|
534
|
-
|
|
535
|
-
else {
|
|
536
|
-
c = c.delete(r.pmPos, r.pmPos + l);
|
|
537
|
-
let e = Math.min(s - l, c.doc.content.size);
|
|
538
|
-
c = c.insert(e, a), n.dispatch(c), ve(Math.min(e, n.state.doc.content.size - 1));
|
|
539
|
-
}
|
|
475
|
+
let a = Pe(i, e, t, 1);
|
|
476
|
+
if (a == null || a < 0) return;
|
|
477
|
+
let o = Re(n, r.pmPos, a);
|
|
478
|
+
o !== null && _e(o);
|
|
540
479
|
}
|
|
541
|
-
|
|
542
|
-
|
|
480
|
+
ce(() => C());
|
|
481
|
+
}
|
|
543
482
|
}
|
|
544
|
-
function
|
|
483
|
+
function _e(e) {
|
|
545
484
|
let t = i.view;
|
|
546
485
|
if (t) try {
|
|
547
|
-
let n =
|
|
486
|
+
let n = he.create(t.state.doc, e);
|
|
548
487
|
t.dispatch(t.state.tr.setSelection(n));
|
|
549
488
|
} catch {}
|
|
550
489
|
}
|
|
551
|
-
return
|
|
552
|
-
document.removeEventListener("mousemove",
|
|
553
|
-
}), (t, n) => e.imageInfo ? (
|
|
490
|
+
return I(() => {
|
|
491
|
+
document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", P), document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", q), x && document.removeEventListener("mousemove", x), ee && document.removeEventListener("mouseup", ee), Y &&= (Y.remove(), null), b && cancelAnimationFrame(b);
|
|
492
|
+
}), (t, n) => e.imageInfo ? (L(), k("div", {
|
|
554
493
|
key: 0,
|
|
555
494
|
ref_key: "overlayRootRef",
|
|
556
495
|
ref: o,
|
|
557
496
|
class: "image-overlay",
|
|
558
|
-
style:
|
|
559
|
-
onMousedown: n[3] ||=
|
|
497
|
+
style: F(D.value),
|
|
498
|
+
onMousedown: n[3] ||= J(() => {}, ["stop"])
|
|
560
499
|
}, [
|
|
561
|
-
n[4] ||=
|
|
562
|
-
|
|
500
|
+
n[4] ||= A("div", { class: "image-overlay__border" }, null, -1),
|
|
501
|
+
A("div", {
|
|
563
502
|
class: "image-overlay__body",
|
|
564
|
-
style:
|
|
565
|
-
onMousedown: n[0] ||=
|
|
566
|
-
onContextmenu: n[1] ||=
|
|
503
|
+
style: F({ cursor: c.value ? "grabbing" : "grab" }),
|
|
504
|
+
onMousedown: n[0] ||= J((e) => ge(e), ["prevent", "stop"]),
|
|
505
|
+
onContextmenu: n[1] ||= J((e) => t.$emit("context-menu", e), ["prevent", "stop"])
|
|
567
506
|
}, null, 36),
|
|
568
|
-
(
|
|
507
|
+
(L(!0), k(w, null, z(ae.value, (e) => (L(), k("div", {
|
|
569
508
|
key: e.pos,
|
|
570
509
|
class: "image-overlay__handle",
|
|
571
|
-
style:
|
|
510
|
+
style: F(e.style),
|
|
572
511
|
"data-handle": e.pos,
|
|
573
|
-
onMousedown:
|
|
574
|
-
}, null, 44,
|
|
575
|
-
n[5] ||=
|
|
576
|
-
|
|
512
|
+
onMousedown: J((t) => M(t, e.pos), ["prevent", "stop"])
|
|
513
|
+
}, null, 44, Gt))), 128)),
|
|
514
|
+
n[5] ||= A("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
515
|
+
A("div", {
|
|
577
516
|
class: "image-overlay__rotate-handle",
|
|
578
|
-
style:
|
|
579
|
-
title:
|
|
580
|
-
onMousedown: n[2] ||=
|
|
581
|
-
}, null, 44,
|
|
582
|
-
s.value ? (
|
|
583
|
-
l.value ? (
|
|
584
|
-
], 36)) :
|
|
585
|
-
}
|
|
586
|
-
}), [["__scopeId", "data-v-
|
|
517
|
+
style: F({ left: `${T.value / 2 - 7}px` }),
|
|
518
|
+
title: H(r)("imageOverlay.rotate"),
|
|
519
|
+
onMousedown: n[2] ||= J((e) => me(e), ["prevent", "stop"])
|
|
520
|
+
}, null, 44, Kt),
|
|
521
|
+
s.value ? (L(), k("div", qt, V(Math.round(u.value)) + " × " + V(Math.round(d.value)), 1)) : O("", !0),
|
|
522
|
+
l.value ? (L(), k("div", Jt, V(Math.round(f.value)) + "° ", 1)) : O("", !0)
|
|
523
|
+
], 36)) : O("", !0);
|
|
524
|
+
}
|
|
525
|
+
}), [["__scopeId", "data-v-df7c380c"]]), Qt = { class: "doc-outline__header" }, $t = { class: "doc-outline__body" }, en = {
|
|
587
526
|
key: 0,
|
|
588
527
|
class: "doc-outline__empty"
|
|
589
|
-
},
|
|
528
|
+
}, tn = ["onMousedown"], nn = /* @__PURE__ */ x(/* @__PURE__ */ N({
|
|
590
529
|
__name: "DocumentOutline",
|
|
591
530
|
props: {
|
|
592
531
|
isOpen: { type: Boolean },
|
|
@@ -594,28 +533,28 @@ var bt = /* @__PURE__ */ j({
|
|
|
594
533
|
},
|
|
595
534
|
emits: ["close", "navigate"],
|
|
596
535
|
setup(e) {
|
|
597
|
-
return (t, n) => e.isOpen ? (
|
|
536
|
+
return (t, n) => e.isOpen ? (L(), k("nav", {
|
|
598
537
|
key: 0,
|
|
599
538
|
class: "doc-outline",
|
|
600
539
|
role: "navigation",
|
|
601
540
|
"aria-label": "Document outline",
|
|
602
|
-
onMousedown: n[1] ||=
|
|
603
|
-
}, [
|
|
541
|
+
onMousedown: n[1] ||= J(() => {}, ["stop"])
|
|
542
|
+
}, [A("div", Qt, [A("button", {
|
|
604
543
|
class: "doc-outline__back",
|
|
605
544
|
title: "Close outline",
|
|
606
545
|
"aria-label": "Close outline",
|
|
607
546
|
onClick: n[0] ||= (e) => t.$emit("close")
|
|
608
|
-
}, [
|
|
547
|
+
}, [M(c, {
|
|
609
548
|
name: "arrow_back",
|
|
610
549
|
size: 20
|
|
611
|
-
})]), n[2] ||=
|
|
550
|
+
})]), n[2] ||= A("span", { class: "doc-outline__title" }, "Document Outline", -1)]), A("div", $t, [e.headings.length === 0 ? (L(), k("div", en, " No headings found ")) : O("", !0), (L(!0), k(w, null, z(e.headings, (e, n) => (L(), k("button", {
|
|
612
551
|
key: n,
|
|
613
552
|
class: "doc-outline__item",
|
|
614
|
-
style:
|
|
615
|
-
onMousedown:
|
|
616
|
-
},
|
|
553
|
+
style: F({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
|
|
554
|
+
onMousedown: J((n) => t.$emit("navigate", e.pmPos), ["prevent"])
|
|
555
|
+
}, V(e.text || "(untitled)"), 45, tn))), 128))])], 32)) : O("", !0);
|
|
617
556
|
}
|
|
618
|
-
}), [["__scopeId", "data-v-cb2cdc39"]]),
|
|
557
|
+
}), [["__scopeId", "data-v-cb2cdc39"]]), rn = /* @__PURE__ */ x(/* @__PURE__ */ N({
|
|
619
558
|
__name: "PageIndicator",
|
|
620
559
|
props: {
|
|
621
560
|
currentPage: {},
|
|
@@ -624,20 +563,20 @@ var bt = /* @__PURE__ */ j({
|
|
|
624
563
|
},
|
|
625
564
|
setup(e) {
|
|
626
565
|
let { t } = n();
|
|
627
|
-
return (n, r) => (
|
|
566
|
+
return (n, r) => (L(), k("div", {
|
|
628
567
|
class: "docx-editor-vue__page-indicator",
|
|
629
|
-
style:
|
|
568
|
+
style: F({ opacity: +!!e.visible }),
|
|
630
569
|
"aria-live": "polite",
|
|
631
570
|
role: "status"
|
|
632
|
-
},
|
|
571
|
+
}, V(H(t)("viewer.pageIndicator", {
|
|
633
572
|
current: e.currentPage,
|
|
634
573
|
total: e.totalPages
|
|
635
574
|
})), 5));
|
|
636
575
|
}
|
|
637
|
-
}), [["__scopeId", "data-v-d117bf6e"]]),
|
|
576
|
+
}), [["__scopeId", "data-v-d117bf6e"]]), an = { class: "hf-editor__label" }, on = {
|
|
638
577
|
class: "hf-editor__actions",
|
|
639
578
|
style: { position: "relative" }
|
|
640
|
-
},
|
|
579
|
+
}, sn = /* @__PURE__ */ x(/* @__PURE__ */ N({
|
|
641
580
|
__name: "InlineHeaderFooterEditor",
|
|
642
581
|
props: {
|
|
643
582
|
isOpen: { type: Boolean },
|
|
@@ -651,11 +590,11 @@ var bt = /* @__PURE__ */ j({
|
|
|
651
590
|
"remove"
|
|
652
591
|
],
|
|
653
592
|
setup(e, { emit: t }) {
|
|
654
|
-
let n = e, r = t, i =
|
|
593
|
+
let n = e, r = t, i = R({}), a = R(!1);
|
|
655
594
|
function o(e) {
|
|
656
595
|
let t = n.view;
|
|
657
596
|
if (!t) return;
|
|
658
|
-
let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o =
|
|
597
|
+
let { $from: r, from: i } = t.state.selection, a = t.state.storedMarks || r.marks(), o = et.nodes.field.create({
|
|
659
598
|
fieldType: e,
|
|
660
599
|
instruction: ` ${e} \\* MERGEFORMAT `,
|
|
661
600
|
fieldKind: "simple",
|
|
@@ -675,68 +614,68 @@ var bt = /* @__PURE__ */ j({
|
|
|
675
614
|
pointerEvents: "none"
|
|
676
615
|
});
|
|
677
616
|
}
|
|
678
|
-
|
|
617
|
+
G(() => n.isOpen, (e) => {
|
|
679
618
|
e && (s(), n.view?.focus());
|
|
680
|
-
}),
|
|
619
|
+
}), G(() => n.targetRect, () => {
|
|
681
620
|
n.isOpen && s();
|
|
682
621
|
}, { deep: !0 });
|
|
683
622
|
function c() {
|
|
684
|
-
n.view && (r("save",
|
|
623
|
+
n.view && (r("save", qe(n.view.state.doc)), r("close"));
|
|
685
624
|
}
|
|
686
|
-
return (t, n) => e.isOpen ? (
|
|
625
|
+
return (t, n) => e.isOpen ? (L(), k("div", {
|
|
687
626
|
key: 0,
|
|
688
627
|
class: "hf-editor",
|
|
689
|
-
style:
|
|
690
|
-
}, [
|
|
691
|
-
class:
|
|
692
|
-
onMousedown: n[8] ||=
|
|
693
|
-
onContextmenu: n[9] ||=
|
|
694
|
-
}, [
|
|
695
|
-
|
|
628
|
+
style: F(i.value)
|
|
629
|
+
}, [A("div", {
|
|
630
|
+
class: le(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
|
|
631
|
+
onMousedown: n[8] ||= J(() => {}, ["stop"]),
|
|
632
|
+
onContextmenu: n[9] ||= J(() => {}, ["stop"])
|
|
633
|
+
}, [A("span", an, V(e.position === "header" ? "Header" : "Footer"), 1), A("div", on, [
|
|
634
|
+
A("button", {
|
|
696
635
|
class: "hf-editor__btn",
|
|
697
636
|
title: "Options",
|
|
698
|
-
onMousedown: n[0] ||=
|
|
637
|
+
onMousedown: n[0] ||= J(() => {}, ["prevent"]),
|
|
699
638
|
onClick: n[1] ||= (e) => a.value = !a.value
|
|
700
639
|
}, " Options ▾ ", 32),
|
|
701
|
-
a.value ? (
|
|
640
|
+
a.value ? (L(), k("div", {
|
|
702
641
|
key: 0,
|
|
703
642
|
class: "hf-editor__dropdown",
|
|
704
|
-
onMousedown: n[4] ||=
|
|
705
|
-
onContextmenu: n[5] ||=
|
|
706
|
-
}, [
|
|
643
|
+
onMousedown: n[4] ||= J(() => {}, ["stop"]),
|
|
644
|
+
onContextmenu: n[5] ||= J(() => {}, ["stop"])
|
|
645
|
+
}, [A("button", {
|
|
707
646
|
type: "button",
|
|
708
647
|
class: "hf-editor__dropdown-item",
|
|
709
648
|
onClick: n[2] ||= (e) => {
|
|
710
649
|
a.value = !1, o("PAGE");
|
|
711
650
|
}
|
|
712
|
-
}, " Insert current page number "),
|
|
651
|
+
}, " Insert current page number "), A("button", {
|
|
713
652
|
type: "button",
|
|
714
653
|
class: "hf-editor__dropdown-item",
|
|
715
654
|
onClick: n[3] ||= (e) => {
|
|
716
655
|
a.value = !1, o("NUMPAGES");
|
|
717
656
|
}
|
|
718
|
-
}, " Insert total page count ")], 32)) :
|
|
719
|
-
|
|
657
|
+
}, " Insert total page count ")], 32)) : O("", !0),
|
|
658
|
+
A("button", {
|
|
720
659
|
class: "hf-editor__btn",
|
|
721
660
|
title: "Remove",
|
|
722
|
-
onMousedown: n[6] ||=
|
|
661
|
+
onMousedown: n[6] ||= J((e) => t.$emit("remove"), ["prevent"])
|
|
723
662
|
}, " Remove ", 32),
|
|
724
|
-
|
|
663
|
+
A("button", {
|
|
725
664
|
class: "hf-editor__btn hf-editor__btn--primary",
|
|
726
665
|
title: "Save",
|
|
727
|
-
onMousedown:
|
|
666
|
+
onMousedown: J(c, ["prevent"])
|
|
728
667
|
}, " Save ", 32),
|
|
729
|
-
|
|
668
|
+
A("button", {
|
|
730
669
|
class: "hf-editor__btn",
|
|
731
670
|
title: "Cancel",
|
|
732
|
-
onMousedown: n[7] ||=
|
|
671
|
+
onMousedown: n[7] ||= J((e) => t.$emit("close"), ["prevent"])
|
|
733
672
|
}, " Cancel ", 32)
|
|
734
|
-
])], 34)], 4)) :
|
|
673
|
+
])], 34)], 4)) : O("", !0);
|
|
735
674
|
}
|
|
736
|
-
}), [["__scopeId", "data-v-e93a9f94"]]),
|
|
675
|
+
}), [["__scopeId", "data-v-e93a9f94"]]), cn = ["role"], ln = {
|
|
737
676
|
key: 0,
|
|
738
677
|
class: "layout-sdt-widget-empty"
|
|
739
|
-
},
|
|
678
|
+
}, un = ["aria-selected", "onClick"], dn = ["value"], fn = /* @__PURE__ */ N({
|
|
740
679
|
__name: "ContentControlWidgets",
|
|
741
680
|
props: {
|
|
742
681
|
container: {},
|
|
@@ -747,18 +686,18 @@ var bt = /* @__PURE__ */ j({
|
|
|
747
686
|
let t = /^sdt@(\d+)$/.exec(e ?? "");
|
|
748
687
|
return t ? Number(t[1]) : null;
|
|
749
688
|
}
|
|
750
|
-
let n = e, r =
|
|
689
|
+
let n = e, r = R(null), i = R(null);
|
|
751
690
|
function a(e, t) {
|
|
752
691
|
let i = n.view;
|
|
753
692
|
if (i) try {
|
|
754
|
-
i.dispatch(
|
|
693
|
+
i.dispatch(nt(i.state, { tag: e }, t)), i.focus();
|
|
755
694
|
} catch {}
|
|
756
695
|
r.value = null;
|
|
757
696
|
}
|
|
758
697
|
function o(e) {
|
|
759
698
|
let r = n.view, i = t(e.dataset.sdtGroupId);
|
|
760
699
|
if (!(!r || i == null)) try {
|
|
761
|
-
let t = e.dataset.sdtRepeat === "add" ?
|
|
700
|
+
let t = e.dataset.sdtRepeat === "add" ? Ye(r.state, i) : $e(r.state, i);
|
|
762
701
|
r.dispatch(t), r.focus();
|
|
763
702
|
} catch {}
|
|
764
703
|
}
|
|
@@ -769,7 +708,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
769
708
|
function c(e) {
|
|
770
709
|
let t = n.view, i = e.dataset.sdtTag, o = e.dataset.sdtWidget;
|
|
771
710
|
if (!t || !i || !o) return;
|
|
772
|
-
let s =
|
|
711
|
+
let s = Ze(t.state.doc, { tag: i })[0], c = e.getBoundingClientRect();
|
|
773
712
|
o === "checkbox" ? a(i, {
|
|
774
713
|
kind: "checkbox",
|
|
775
714
|
checked: !s?.checked
|
|
@@ -809,9 +748,9 @@ var bt = /* @__PURE__ */ j({
|
|
|
809
748
|
e.key === "Escape" && (r.value = null);
|
|
810
749
|
}
|
|
811
750
|
let p = null;
|
|
812
|
-
|
|
751
|
+
G(() => n.container, (e) => {
|
|
813
752
|
p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), p = e ?? null, p && (p.addEventListener("mousedown", s), p.addEventListener("click", l), p.addEventListener("keydown", u));
|
|
814
|
-
}, { immediate: !0 }),
|
|
753
|
+
}, { immediate: !0 }), G(r, (e) => {
|
|
815
754
|
e ? (document.addEventListener("mousedown", d), document.addEventListener("keydown", f), e.kind === "dropdown" && ce(() => {
|
|
816
755
|
let e = i.value?.querySelectorAll(".layout-sdt-widget-option");
|
|
817
756
|
e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
|
|
@@ -825,7 +764,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
825
764
|
let n = t.indexOf(document.activeElement);
|
|
826
765
|
t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
|
|
827
766
|
}
|
|
828
|
-
|
|
767
|
+
I(() => {
|
|
829
768
|
p && (p.removeEventListener("mousedown", s), p.removeEventListener("click", l), p.removeEventListener("keydown", u)), document.removeEventListener("mousedown", d), document.removeEventListener("keydown", f);
|
|
830
769
|
});
|
|
831
770
|
function h(e) {
|
|
@@ -835,42 +774,42 @@ var bt = /* @__PURE__ */ j({
|
|
|
835
774
|
date: t
|
|
836
775
|
});
|
|
837
776
|
}
|
|
838
|
-
return (e, t) => r.value ? (
|
|
777
|
+
return (e, t) => r.value ? (L(), k("div", {
|
|
839
778
|
key: 0,
|
|
840
779
|
ref_key: "popupEl",
|
|
841
780
|
ref: i,
|
|
842
781
|
class: "layout-sdt-widget-popup",
|
|
843
782
|
role: r.value.kind === "dropdown" ? "listbox" : void 0,
|
|
844
|
-
style:
|
|
783
|
+
style: F({
|
|
845
784
|
position: "fixed",
|
|
846
785
|
top: r.value.y + "px",
|
|
847
786
|
left: r.value.x + "px",
|
|
848
787
|
zIndex: 1e3
|
|
849
788
|
}),
|
|
850
789
|
onKeydown: m,
|
|
851
|
-
onMousedown: t[0] ||=
|
|
852
|
-
}, [r.value.kind === "dropdown" ? (
|
|
790
|
+
onMousedown: t[0] ||= J(() => {}, ["prevent"])
|
|
791
|
+
}, [r.value.kind === "dropdown" ? (L(), k(w, { key: 0 }, [r.value.items.length === 0 ? (L(), k("div", ln, "No options")) : O("", !0), (L(!0), k(w, null, z(r.value.items, (e) => (L(), k("button", {
|
|
853
792
|
key: e.value,
|
|
854
793
|
type: "button",
|
|
855
794
|
role: "option",
|
|
856
795
|
"aria-selected": e.displayText === r.value.current,
|
|
857
|
-
class:
|
|
796
|
+
class: le(["layout-sdt-widget-option", { "is-selected": e.displayText === r.value.current }]),
|
|
858
797
|
onClick: (t) => a(r.value.tag, {
|
|
859
798
|
kind: "dropdown",
|
|
860
799
|
value: e.value
|
|
861
800
|
})
|
|
862
|
-
},
|
|
801
|
+
}, V(e.displayText), 11, un))), 128))], 64)) : (L(), k("input", {
|
|
863
802
|
key: 1,
|
|
864
803
|
type: "date",
|
|
865
804
|
class: "layout-sdt-widget-date",
|
|
866
805
|
value: r.value.current,
|
|
867
806
|
onChange: h
|
|
868
|
-
}, null, 40,
|
|
807
|
+
}, null, 40, dn))], 44, cn)) : O("", !0);
|
|
869
808
|
}
|
|
870
|
-
}),
|
|
809
|
+
}), pn = {
|
|
871
810
|
key: 0,
|
|
872
811
|
class: "docx-editor-vue__title-bar"
|
|
873
|
-
},
|
|
812
|
+
}, mn = { class: "docx-editor-vue__title-bar-left" }, hn = { class: "docx-editor-vue__title-bar-center" }, gn = { class: "docx-editor-vue__title-bar-right" }, _n = /* @__PURE__ */ N({
|
|
874
813
|
__name: "DocxEditorMenuBar",
|
|
875
814
|
props: {
|
|
876
815
|
showMenuBar: { type: Boolean },
|
|
@@ -889,20 +828,256 @@ var bt = /* @__PURE__ */ j({
|
|
|
889
828
|
],
|
|
890
829
|
setup(e, { emit: t }) {
|
|
891
830
|
let n = t;
|
|
892
|
-
return (t, r) => e.showMenuBar ? (
|
|
893
|
-
|
|
894
|
-
|
|
831
|
+
return (t, r) => e.showMenuBar ? (L(), k("div", pn, [
|
|
832
|
+
A("div", mn, [e.renderLogo ? (L(), D(fe(e.renderLogo), { key: 0 })) : O("", !0), de(t.$slots, "title-bar-left")]),
|
|
833
|
+
A("div", hn, [M(g, {
|
|
895
834
|
"model-value": e.documentName,
|
|
896
835
|
editable: e.documentNameEditable,
|
|
897
836
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
898
|
-
}, null, 8, ["model-value", "editable"]),
|
|
837
|
+
}, null, 8, ["model-value", "editable"]), M(y, {
|
|
899
838
|
onAction: r[1] ||= (e) => n("menu-action", e),
|
|
900
839
|
onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
|
|
901
840
|
})]),
|
|
902
|
-
|
|
903
|
-
])) :
|
|
841
|
+
A("div", gn, [de(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), D(fe(e.renderTitleBarRight), { key: 0 })) : O("", !0)])
|
|
842
|
+
])) : O("", !0);
|
|
843
|
+
}
|
|
844
|
+
}), vn = ["aria-label"], yn = { class: "wm-header" }, bn = { class: "wm-body" }, xn = { class: "wm-radio-row" }, Sn = ["checked"], Cn = {
|
|
845
|
+
for: "wm-none",
|
|
846
|
+
class: "wm-inline-label"
|
|
847
|
+
}, wn = { class: "wm-radio-row" }, Tn = ["checked"], En = {
|
|
848
|
+
for: "wm-picture",
|
|
849
|
+
class: "wm-inline-label"
|
|
850
|
+
}, Dn = {
|
|
851
|
+
key: 0,
|
|
852
|
+
class: "wm-subform"
|
|
853
|
+
}, On = { class: "wm-row" }, $ = {
|
|
854
|
+
key: 0,
|
|
855
|
+
class: "wm-row"
|
|
856
|
+
}, kn = ["src"], An = { class: "wm-row" }, jn = { class: "wm-label" }, Mn = { class: "wm-inline-label" }, Nn = { class: "wm-radio-row" }, Pn = ["checked"], Fn = {
|
|
857
|
+
for: "wm-text",
|
|
858
|
+
class: "wm-inline-label"
|
|
859
|
+
}, In = {
|
|
860
|
+
key: 1,
|
|
861
|
+
class: "wm-subform"
|
|
862
|
+
}, Ln = { class: "wm-row" }, Rn = { class: "wm-label" }, zn = ["value"], Bn = ["value"], Vn = { class: "wm-row" }, Hn = { class: "wm-label" }, Un = { class: "wm-row" }, Wn = { class: "wm-label" }, Gn = ["value"], Kn = { class: "wm-row" }, qn = { class: "wm-label" }, Jn = { class: "wm-inline-label" }, Yn = { class: "wm-row" }, Xn = { class: "wm-label" }, Zn = { class: "wm-row" }, Qn = { class: "wm-label" }, $n = { class: "wm-inline-label" }, er = ["checked"], tr = { class: "wm-inline-label" }, nr = ["checked"], rr = { class: "wm-inline-label" }, ir = { class: "wm-footer" }, ar = ["disabled"], or = /* @__PURE__ */ x(/* @__PURE__ */ N({
|
|
863
|
+
__name: "WatermarkDialog",
|
|
864
|
+
props: {
|
|
865
|
+
isOpen: { type: Boolean },
|
|
866
|
+
current: {}
|
|
867
|
+
},
|
|
868
|
+
emits: ["close", "apply"],
|
|
869
|
+
setup(e, { emit: t }) {
|
|
870
|
+
let r = [
|
|
871
|
+
"CONFIDENTIAL",
|
|
872
|
+
"DRAFT",
|
|
873
|
+
"DO NOT COPY",
|
|
874
|
+
"SAMPLE",
|
|
875
|
+
"URGENT",
|
|
876
|
+
"ASAP"
|
|
877
|
+
], i = [
|
|
878
|
+
"Calibri",
|
|
879
|
+
"Arial",
|
|
880
|
+
"Times New Roman",
|
|
881
|
+
"Georgia",
|
|
882
|
+
"Verdana",
|
|
883
|
+
"Courier New"
|
|
884
|
+
], { t: a } = n(), o = e, s = t, c = R("none"), l = R("CONFIDENTIAL"), u = R("Calibri"), d = R(!0), f = R(54), p = R("#C0C0C0"), m = R("diagonal"), h = R(!0), g = R(void 0), _ = R(void 0), v = R(100), y = R(!0);
|
|
885
|
+
G(() => o.isOpen, (e) => {
|
|
886
|
+
if (!e) return;
|
|
887
|
+
let t = o.current;
|
|
888
|
+
t?.kind === "text" ? (c.value = "text", l.value = t.text, u.value = t.font || "Calibri", d.value = t.fontSize === void 0, t.fontSize !== void 0 && (f.value = t.fontSize), p.value = t.color || "#C0C0C0", m.value = t.layout, h.value = t.semitransparent) : t?.kind === "picture" ? (c.value = "picture", g.value = t.dataUrl, _.value = t.widthEmu !== void 0 && t.heightEmu !== void 0 ? {
|
|
889
|
+
widthEmu: t.widthEmu,
|
|
890
|
+
heightEmu: t.heightEmu
|
|
891
|
+
} : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) : c.value = "none";
|
|
892
|
+
}, { immediate: !0 });
|
|
893
|
+
let b = E(() => c.value === "picture" && !g.value);
|
|
894
|
+
function x(e) {
|
|
895
|
+
let t = e.target.value;
|
|
896
|
+
t && (l.value = t);
|
|
897
|
+
}
|
|
898
|
+
function ee(e) {
|
|
899
|
+
let t = e.target.files?.[0];
|
|
900
|
+
if (!t) return;
|
|
901
|
+
let n = new FileReader();
|
|
902
|
+
n.onload = () => {
|
|
903
|
+
let e = typeof n.result == "string" ? n.result : void 0;
|
|
904
|
+
if (g.value = e, _.value = void 0, !e) return;
|
|
905
|
+
let t = new Image();
|
|
906
|
+
t.onload = () => {
|
|
907
|
+
_.value = it(t.naturalWidth, t.naturalHeight);
|
|
908
|
+
}, t.src = e;
|
|
909
|
+
}, n.readAsDataURL(t);
|
|
910
|
+
}
|
|
911
|
+
function S() {
|
|
912
|
+
s("close");
|
|
913
|
+
}
|
|
914
|
+
function te() {
|
|
915
|
+
if (c.value === "none") s("apply", null);
|
|
916
|
+
else if (c.value === "text") s("apply", {
|
|
917
|
+
kind: "text",
|
|
918
|
+
text: l.value,
|
|
919
|
+
font: u.value,
|
|
920
|
+
color: p.value,
|
|
921
|
+
semitransparent: h.value,
|
|
922
|
+
layout: m.value,
|
|
923
|
+
fontSize: d.value ? void 0 : f.value
|
|
924
|
+
});
|
|
925
|
+
else {
|
|
926
|
+
if (!g.value) return;
|
|
927
|
+
s("apply", {
|
|
928
|
+
kind: "picture",
|
|
929
|
+
dataUrl: g.value,
|
|
930
|
+
scale: v.value / 100,
|
|
931
|
+
washout: y.value,
|
|
932
|
+
..._.value ?? {}
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
S();
|
|
936
|
+
}
|
|
937
|
+
function ne(e) {
|
|
938
|
+
e.key === "Escape" && S();
|
|
939
|
+
}
|
|
940
|
+
return (t, n) => e.isOpen ? (L(), k("div", {
|
|
941
|
+
key: 0,
|
|
942
|
+
class: "wm-overlay",
|
|
943
|
+
onMousedown: J(S, ["self"]),
|
|
944
|
+
onKeydown: ne
|
|
945
|
+
}, [A("div", {
|
|
946
|
+
class: "wm-dialog",
|
|
947
|
+
role: "dialog",
|
|
948
|
+
"aria-label": H(a)("dialogs.watermark.title"),
|
|
949
|
+
onMousedown: n[13] ||= J(() => {}, ["stop"])
|
|
950
|
+
}, [
|
|
951
|
+
A("div", yn, V(H(a)("dialogs.watermark.title")), 1),
|
|
952
|
+
A("div", bn, [
|
|
953
|
+
A("div", xn, [A("input", {
|
|
954
|
+
id: "wm-none",
|
|
955
|
+
type: "radio",
|
|
956
|
+
checked: c.value === "none",
|
|
957
|
+
onChange: n[0] ||= (e) => c.value = "none"
|
|
958
|
+
}, null, 40, Sn), A("label", Cn, V(H(a)("dialogs.watermark.noWatermark")), 1)]),
|
|
959
|
+
A("div", wn, [A("input", {
|
|
960
|
+
id: "wm-picture",
|
|
961
|
+
type: "radio",
|
|
962
|
+
checked: c.value === "picture",
|
|
963
|
+
onChange: n[1] ||= (e) => c.value = "picture"
|
|
964
|
+
}, null, 40, Tn), A("label", En, V(H(a)("dialogs.watermark.picture")), 1)]),
|
|
965
|
+
c.value === "picture" ? (L(), k("div", Dn, [
|
|
966
|
+
A("div", On, [A("input", {
|
|
967
|
+
type: "file",
|
|
968
|
+
accept: "image/*",
|
|
969
|
+
onChange: ee
|
|
970
|
+
}, null, 32)]),
|
|
971
|
+
g.value ? (L(), k("div", $, [A("img", {
|
|
972
|
+
src: g.value,
|
|
973
|
+
alt: "",
|
|
974
|
+
class: "wm-preview"
|
|
975
|
+
}, null, 8, kn)])) : O("", !0),
|
|
976
|
+
A("div", An, [
|
|
977
|
+
A("span", jn, V(H(a)("dialogs.watermark.scale")), 1),
|
|
978
|
+
K(A("input", {
|
|
979
|
+
class: "wm-input wm-input--narrow",
|
|
980
|
+
type: "number",
|
|
981
|
+
min: "10",
|
|
982
|
+
max: "500",
|
|
983
|
+
"onUpdate:modelValue": n[2] ||= (e) => v.value = e
|
|
984
|
+
}, null, 512), [[
|
|
985
|
+
W,
|
|
986
|
+
v.value,
|
|
987
|
+
void 0,
|
|
988
|
+
{ number: !0 }
|
|
989
|
+
]]),
|
|
990
|
+
n[14] ||= A("span", { class: "wm-unit" }, "%", -1)
|
|
991
|
+
]),
|
|
992
|
+
A("label", Mn, [K(A("input", {
|
|
993
|
+
type: "checkbox",
|
|
994
|
+
"onUpdate:modelValue": n[3] ||= (e) => y.value = e
|
|
995
|
+
}, null, 512), [[pe, y.value]]), j(" " + V(H(a)("dialogs.watermark.washout")), 1)])
|
|
996
|
+
])) : O("", !0),
|
|
997
|
+
A("div", Nn, [A("input", {
|
|
998
|
+
id: "wm-text",
|
|
999
|
+
type: "radio",
|
|
1000
|
+
checked: c.value === "text",
|
|
1001
|
+
onChange: n[4] ||= (e) => c.value = "text"
|
|
1002
|
+
}, null, 40, Pn), A("label", Fn, V(H(a)("dialogs.watermark.text")), 1)]),
|
|
1003
|
+
c.value === "text" ? (L(), k("div", In, [
|
|
1004
|
+
A("div", Ln, [A("span", Rn, V(H(a)("dialogs.watermark.presetLabel")), 1), A("select", {
|
|
1005
|
+
class: "wm-input",
|
|
1006
|
+
value: r.includes(l.value) ? l.value : "",
|
|
1007
|
+
onChange: x
|
|
1008
|
+
}, [n[15] ||= A("option", { value: "" }, "—", -1), (L(), k(w, null, z(r, (e) => A("option", {
|
|
1009
|
+
key: e,
|
|
1010
|
+
value: e
|
|
1011
|
+
}, V(e), 9, Bn)), 64))], 40, zn)]),
|
|
1012
|
+
A("div", Vn, [A("span", Hn, V(H(a)("dialogs.watermark.textLabel")), 1), K(A("input", {
|
|
1013
|
+
class: "wm-input",
|
|
1014
|
+
"onUpdate:modelValue": n[5] ||= (e) => l.value = e
|
|
1015
|
+
}, null, 512), [[W, l.value]])]),
|
|
1016
|
+
A("div", Un, [A("span", Wn, V(H(a)("dialogs.watermark.fontLabel")), 1), K(A("select", {
|
|
1017
|
+
class: "wm-input",
|
|
1018
|
+
"onUpdate:modelValue": n[6] ||= (e) => u.value = e
|
|
1019
|
+
}, [(L(), k(w, null, z(i, (e) => A("option", {
|
|
1020
|
+
key: e,
|
|
1021
|
+
value: e
|
|
1022
|
+
}, V(e), 9, Gn)), 64))], 512), [[U, u.value]])]),
|
|
1023
|
+
A("div", Kn, [
|
|
1024
|
+
A("span", qn, V(H(a)("dialogs.watermark.sizeLabel")), 1),
|
|
1025
|
+
A("label", Jn, [K(A("input", {
|
|
1026
|
+
type: "checkbox",
|
|
1027
|
+
"onUpdate:modelValue": n[7] ||= (e) => d.value = e
|
|
1028
|
+
}, null, 512), [[pe, d.value]]), j(" " + V(H(a)("dialogs.watermark.sizeAuto")), 1)]),
|
|
1029
|
+
d.value ? O("", !0) : K((L(), k("input", {
|
|
1030
|
+
key: 0,
|
|
1031
|
+
class: "wm-input wm-input--narrow",
|
|
1032
|
+
type: "number",
|
|
1033
|
+
min: "8",
|
|
1034
|
+
max: "200",
|
|
1035
|
+
"onUpdate:modelValue": n[8] ||= (e) => f.value = e
|
|
1036
|
+
}, null, 512)), [[
|
|
1037
|
+
W,
|
|
1038
|
+
f.value,
|
|
1039
|
+
void 0,
|
|
1040
|
+
{ number: !0 }
|
|
1041
|
+
]])
|
|
1042
|
+
]),
|
|
1043
|
+
A("div", Yn, [A("span", Xn, V(H(a)("dialogs.watermark.colorLabel")), 1), K(A("input", {
|
|
1044
|
+
type: "color",
|
|
1045
|
+
"onUpdate:modelValue": n[9] ||= (e) => p.value = e
|
|
1046
|
+
}, null, 512), [[W, p.value]])]),
|
|
1047
|
+
A("div", Zn, [
|
|
1048
|
+
A("span", Qn, V(H(a)("dialogs.watermark.layoutLabel")), 1),
|
|
1049
|
+
A("label", $n, [A("input", {
|
|
1050
|
+
type: "radio",
|
|
1051
|
+
name: "wm-layout",
|
|
1052
|
+
checked: m.value === "diagonal",
|
|
1053
|
+
onChange: n[10] ||= (e) => m.value = "diagonal"
|
|
1054
|
+
}, null, 40, er), j(" " + V(H(a)("dialogs.watermark.diagonal")), 1)]),
|
|
1055
|
+
A("label", tr, [A("input", {
|
|
1056
|
+
type: "radio",
|
|
1057
|
+
name: "wm-layout",
|
|
1058
|
+
checked: m.value === "horizontal",
|
|
1059
|
+
onChange: n[11] ||= (e) => m.value = "horizontal"
|
|
1060
|
+
}, null, 40, nr), j(" " + V(H(a)("dialogs.watermark.horizontal")), 1)])
|
|
1061
|
+
]),
|
|
1062
|
+
A("label", rr, [K(A("input", {
|
|
1063
|
+
type: "checkbox",
|
|
1064
|
+
"onUpdate:modelValue": n[12] ||= (e) => h.value = e
|
|
1065
|
+
}, null, 512), [[pe, h.value]]), j(" " + V(H(a)("dialogs.watermark.semitransparent")), 1)])
|
|
1066
|
+
])) : O("", !0)
|
|
1067
|
+
]),
|
|
1068
|
+
A("div", ir, [A("button", {
|
|
1069
|
+
type: "button",
|
|
1070
|
+
class: "wm-btn",
|
|
1071
|
+
onClick: S
|
|
1072
|
+
}, V(H(a)("dialogs.watermark.cancelButton")), 1), A("button", {
|
|
1073
|
+
type: "button",
|
|
1074
|
+
class: le(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
|
|
1075
|
+
disabled: b.value,
|
|
1076
|
+
onClick: te
|
|
1077
|
+
}, V(H(a)("dialogs.watermark.applyButton")), 11, ar)])
|
|
1078
|
+
], 40, vn)], 32)) : O("", !0);
|
|
904
1079
|
}
|
|
905
|
-
}),
|
|
1080
|
+
}), [["__scopeId", "data-v-5edfdc47"]]), sr = /* @__PURE__ */ N({
|
|
906
1081
|
__name: "DocxEditorDialogs",
|
|
907
1082
|
props: {
|
|
908
1083
|
view: {},
|
|
@@ -916,6 +1091,8 @@ var bt = /* @__PURE__ */ j({
|
|
|
916
1091
|
showInsertSymbol: { type: Boolean },
|
|
917
1092
|
showImageProperties: { type: Boolean },
|
|
918
1093
|
showPageSetup: { type: Boolean },
|
|
1094
|
+
showWatermark: { type: Boolean },
|
|
1095
|
+
currentWatermark: {},
|
|
919
1096
|
showKeyboardShortcuts: { type: Boolean }
|
|
920
1097
|
},
|
|
921
1098
|
emits: [
|
|
@@ -925,17 +1102,19 @@ var bt = /* @__PURE__ */ j({
|
|
|
925
1102
|
"update:showInsertSymbol",
|
|
926
1103
|
"update:showImageProperties",
|
|
927
1104
|
"update:showPageSetup",
|
|
1105
|
+
"update:showWatermark",
|
|
928
1106
|
"update:showKeyboardShortcuts",
|
|
929
1107
|
"insert-image",
|
|
930
1108
|
"insert-symbol",
|
|
931
1109
|
"hyperlink-submit",
|
|
932
1110
|
"hyperlink-remove",
|
|
933
|
-
"page-setup-apply"
|
|
1111
|
+
"page-setup-apply",
|
|
1112
|
+
"watermark-apply"
|
|
934
1113
|
],
|
|
935
1114
|
setup(t, { emit: n }) {
|
|
936
1115
|
let r = n;
|
|
937
|
-
return (n, a) => (
|
|
938
|
-
|
|
1116
|
+
return (n, a) => (L(), k(w, null, [
|
|
1117
|
+
M(u, {
|
|
939
1118
|
"is-open": t.showFindReplace,
|
|
940
1119
|
view: t.view,
|
|
941
1120
|
"scroll-visible-position-into-view": t.scrollVisiblePositionIntoView,
|
|
@@ -945,12 +1124,12 @@ var bt = /* @__PURE__ */ j({
|
|
|
945
1124
|
"view",
|
|
946
1125
|
"scroll-visible-position-into-view"
|
|
947
1126
|
]),
|
|
948
|
-
|
|
1127
|
+
M(s, {
|
|
949
1128
|
"is-open": t.showInsertImage,
|
|
950
1129
|
onClose: a[1] ||= (e) => r("update:showInsertImage", !1),
|
|
951
1130
|
onInsert: a[2] ||= (e) => r("insert-image", e)
|
|
952
1131
|
}, null, 8, ["is-open"]),
|
|
953
|
-
|
|
1132
|
+
M(e, {
|
|
954
1133
|
"is-open": t.showHyperlink,
|
|
955
1134
|
view: t.view,
|
|
956
1135
|
bookmarks: t.bookmarks,
|
|
@@ -962,12 +1141,12 @@ var bt = /* @__PURE__ */ j({
|
|
|
962
1141
|
"view",
|
|
963
1142
|
"bookmarks"
|
|
964
1143
|
]),
|
|
965
|
-
|
|
1144
|
+
M(i, {
|
|
966
1145
|
"is-open": t.showInsertSymbol,
|
|
967
1146
|
onClose: a[6] ||= (e) => r("update:showInsertSymbol", !1),
|
|
968
1147
|
onInsert: a[7] ||= (e) => r("insert-symbol", e)
|
|
969
1148
|
}, null, 8, ["is-open"]),
|
|
970
|
-
|
|
1149
|
+
M(l, {
|
|
971
1150
|
"is-open": t.showImageProperties,
|
|
972
1151
|
view: t.view,
|
|
973
1152
|
"pm-pos": t.selectedImagePmPos,
|
|
@@ -977,22 +1156,28 @@ var bt = /* @__PURE__ */ j({
|
|
|
977
1156
|
"view",
|
|
978
1157
|
"pm-pos"
|
|
979
1158
|
]),
|
|
980
|
-
|
|
1159
|
+
M(o, {
|
|
981
1160
|
"is-open": t.showPageSetup,
|
|
982
1161
|
"section-properties": t.sectionProperties,
|
|
983
1162
|
onClose: a[9] ||= (e) => r("update:showPageSetup", !1),
|
|
984
1163
|
onApply: a[10] ||= (e) => r("page-setup-apply", e)
|
|
985
1164
|
}, null, 8, ["is-open", "section-properties"]),
|
|
986
|
-
|
|
1165
|
+
M(or, {
|
|
1166
|
+
"is-open": t.showWatermark,
|
|
1167
|
+
current: t.currentWatermark,
|
|
1168
|
+
onClose: a[11] ||= (e) => r("update:showWatermark", !1),
|
|
1169
|
+
onApply: a[12] ||= (e) => r("watermark-apply", e)
|
|
1170
|
+
}, null, 8, ["is-open", "current"]),
|
|
1171
|
+
M(d, {
|
|
987
1172
|
"is-open": t.showKeyboardShortcuts,
|
|
988
|
-
onClose: a[
|
|
1173
|
+
onClose: a[13] ||= (e) => r("update:showKeyboardShortcuts", !1)
|
|
989
1174
|
}, null, 8, ["is-open"])
|
|
990
1175
|
], 64));
|
|
991
1176
|
}
|
|
992
|
-
}),
|
|
1177
|
+
}), cr = ["disabled", "onMousedown"], lr = { class: "ctx-menu__label" }, ur = {
|
|
993
1178
|
key: 0,
|
|
994
1179
|
class: "ctx-menu__shortcut"
|
|
995
|
-
},
|
|
1180
|
+
}, dr = 220, fr = 32, pr = 10, mr = /* @__PURE__ */ x(/* @__PURE__ */ N({
|
|
996
1181
|
__name: "TextContextMenu",
|
|
997
1182
|
props: {
|
|
998
1183
|
isOpen: { type: Boolean },
|
|
@@ -1006,7 +1191,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
1006
1191
|
},
|
|
1007
1192
|
emits: ["close", "action"],
|
|
1008
1193
|
setup(e, { emit: t }) {
|
|
1009
|
-
let n = e, r = t, i =
|
|
1194
|
+
let n = e, r = t, i = R(null), a = E(() => {
|
|
1010
1195
|
let e = [
|
|
1011
1196
|
{
|
|
1012
1197
|
id: "cut",
|
|
@@ -1124,9 +1309,9 @@ var bt = /* @__PURE__ */ j({
|
|
|
1124
1309
|
action: "splitCell",
|
|
1125
1310
|
disabled: !n.canSplitCell
|
|
1126
1311
|
}), e;
|
|
1127
|
-
}), o =
|
|
1128
|
-
let e = n.position.x, t = n.position.y, r = a.value.filter((e) => !e.divider).length, i = a.value.filter((e) => e.divider).length, o = r *
|
|
1129
|
-
return typeof window < "u" && (e +
|
|
1312
|
+
}), o = E(() => {
|
|
1313
|
+
let e = n.position.x, t = n.position.y, r = a.value.filter((e) => !e.divider).length, i = a.value.filter((e) => e.divider).length, o = r * fr + i * 9;
|
|
1314
|
+
return typeof window < "u" && (e + dr + pr > window.innerWidth && (e = window.innerWidth - dr - pr), t + o + pr > window.innerHeight && (t = window.innerHeight - o - pr)), {
|
|
1130
1315
|
position: "fixed",
|
|
1131
1316
|
left: `${e}px`,
|
|
1132
1317
|
top: `${t}px`,
|
|
@@ -1139,50 +1324,50 @@ var bt = /* @__PURE__ */ j({
|
|
|
1139
1324
|
function c(e) {
|
|
1140
1325
|
e.key === "Escape" && r("close");
|
|
1141
1326
|
}
|
|
1142
|
-
return
|
|
1327
|
+
return G(() => n.isOpen, (e) => {
|
|
1143
1328
|
e && ce(() => i.value?.focus());
|
|
1144
|
-
}), (t, n) => (
|
|
1329
|
+
}), (t, n) => (L(), D(T, { to: "body" }, [e.isOpen ? (L(), k("div", {
|
|
1145
1330
|
key: 0,
|
|
1146
1331
|
class: "ctx-menu-backdrop",
|
|
1147
1332
|
onMousedown: n[0] ||= (e) => t.$emit("close"),
|
|
1148
|
-
onContextmenu: n[1] ||=
|
|
1149
|
-
}, null, 32)) :
|
|
1333
|
+
onContextmenu: n[1] ||= J((e) => t.$emit("close"), ["prevent"])
|
|
1334
|
+
}, null, 32)) : O("", !0), e.isOpen ? (L(), k("div", {
|
|
1150
1335
|
key: 1,
|
|
1151
1336
|
ref_key: "menuRef",
|
|
1152
1337
|
ref: i,
|
|
1153
1338
|
class: "ctx-menu",
|
|
1154
|
-
style:
|
|
1155
|
-
onContextmenu: n[2] ||=
|
|
1339
|
+
style: F(o.value),
|
|
1340
|
+
onContextmenu: n[2] ||= J(() => {}, ["prevent"]),
|
|
1156
1341
|
onKeydown: c
|
|
1157
|
-
}, [(
|
|
1342
|
+
}, [(L(!0), k(w, null, z(a.value, (e, t) => (L(), k("button", {
|
|
1158
1343
|
key: e.id || t,
|
|
1159
|
-
class:
|
|
1344
|
+
class: le(["ctx-menu__item", {
|
|
1160
1345
|
"ctx-menu__item--disabled": e.disabled,
|
|
1161
1346
|
"ctx-menu__item--divider": e.divider
|
|
1162
1347
|
}]),
|
|
1163
1348
|
disabled: e.disabled,
|
|
1164
|
-
onMousedown:
|
|
1165
|
-
}, [
|
|
1349
|
+
onMousedown: J((t) => s(e.action), ["prevent"])
|
|
1350
|
+
}, [A("span", lr, V(e.label), 1), e.shortcut ? (L(), k("span", ur, V(e.shortcut), 1)) : O("", !0)], 42, cr))), 128))], 36)) : O("", !0)]));
|
|
1166
1351
|
}
|
|
1167
|
-
}), [["__scopeId", "data-v-741c4f71"]]),
|
|
1352
|
+
}), [["__scopeId", "data-v-741c4f71"]]), hr = ["aria-label"], gr = { class: "image-ctx-menu__icon" }, _r = { class: "image-ctx-menu__label" }, vr = {
|
|
1168
1353
|
key: 1,
|
|
1169
1354
|
class: "image-ctx-menu__divider",
|
|
1170
1355
|
role: "separator"
|
|
1171
|
-
},
|
|
1356
|
+
}, yr = [
|
|
1172
1357
|
"data-wrap-type",
|
|
1173
1358
|
"data-current",
|
|
1174
1359
|
"data-disabled",
|
|
1175
1360
|
"disabled",
|
|
1176
1361
|
"title",
|
|
1177
1362
|
"onClick"
|
|
1178
|
-
],
|
|
1363
|
+
], br = { class: "image-ctx-menu__icon" }, xr = { class: "image-ctx-menu__label" }, Sr = ["aria-label"], Cr = ["disabled", "onClick"], wr = { class: "image-ctx-menu__label" }, Tr = {
|
|
1179
1364
|
key: 0,
|
|
1180
1365
|
class: "image-ctx-menu__shortcut"
|
|
1181
|
-
},
|
|
1366
|
+
}, Er = {
|
|
1182
1367
|
key: 0,
|
|
1183
1368
|
class: "image-ctx-menu__divider",
|
|
1184
1369
|
role: "separator"
|
|
1185
|
-
},
|
|
1370
|
+
}, Dr = 18, Or = 260, kr = 10, Ar = /* @__PURE__ */ x(/* @__PURE__ */ N({
|
|
1186
1371
|
__name: "ImageContextMenu",
|
|
1187
1372
|
props: {
|
|
1188
1373
|
state: {},
|
|
@@ -1203,7 +1388,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
1203
1388
|
function a() {
|
|
1204
1389
|
i("open-properties"), i("close");
|
|
1205
1390
|
}
|
|
1206
|
-
let { t: o } = n(), s =
|
|
1391
|
+
let { t: o } = n(), s = R(null), l = Be, u = E(() => r.state ? He(r.state.currentWrapType, r.state.currentCssFloat ?? null) : null), d = {
|
|
1207
1392
|
inline: "wrap_text",
|
|
1208
1393
|
squareLeft: "format_image_left",
|
|
1209
1394
|
squareRight: "format_image_right",
|
|
@@ -1213,19 +1398,19 @@ var bt = /* @__PURE__ */ j({
|
|
|
1213
1398
|
function f(e) {
|
|
1214
1399
|
return d[e];
|
|
1215
1400
|
}
|
|
1216
|
-
let p =
|
|
1401
|
+
let p = E(() => {
|
|
1217
1402
|
if (!r.state) return {};
|
|
1218
|
-
let e =
|
|
1219
|
-
return typeof window < "u" && (t +
|
|
1403
|
+
let e = Be.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
|
|
1404
|
+
return typeof window < "u" && (t + Or > window.innerWidth && (t = window.innerWidth - Or - kr), n + e > window.innerHeight && (n = window.innerHeight - e - kr), t < kr && (t = kr), n < kr && (n = kr)), {
|
|
1220
1405
|
position: "fixed",
|
|
1221
1406
|
left: `${t}px`,
|
|
1222
1407
|
top: `${n}px`,
|
|
1223
|
-
minWidth: `${
|
|
1408
|
+
minWidth: `${Or}px`,
|
|
1224
1409
|
zIndex: 400
|
|
1225
1410
|
};
|
|
1226
1411
|
});
|
|
1227
1412
|
function m(e) {
|
|
1228
|
-
return r.state ?
|
|
1413
|
+
return r.state ? We(e, r.state.currentWrapType) : !1;
|
|
1229
1414
|
}
|
|
1230
1415
|
function h(e) {
|
|
1231
1416
|
m(e) && (i("select", e.choice), i("close"));
|
|
@@ -1239,74 +1424,74 @@ var bt = /* @__PURE__ */ j({
|
|
|
1239
1424
|
function v(e) {
|
|
1240
1425
|
e.key === "Escape" && (e.preventDefault(), i("close"));
|
|
1241
1426
|
}
|
|
1242
|
-
return (t, n) => (
|
|
1427
|
+
return (t, n) => (L(), D(T, { to: "body" }, [e.state && e.state.open ? (L(), k("div", {
|
|
1243
1428
|
key: 0,
|
|
1244
1429
|
class: "image-ctx-menu-backdrop",
|
|
1245
1430
|
onMousedown: _,
|
|
1246
|
-
onContextmenu: n[0] ||=
|
|
1247
|
-
}, null, 32)) :
|
|
1431
|
+
onContextmenu: n[0] ||= J((e) => t.$emit("close"), ["prevent"])
|
|
1432
|
+
}, null, 32)) : O("", !0), e.state && e.state.open ? (L(), k("div", {
|
|
1248
1433
|
key: 1,
|
|
1249
1434
|
ref_key: "menuRef",
|
|
1250
1435
|
ref: s,
|
|
1251
1436
|
class: "image-ctx-menu",
|
|
1252
1437
|
role: "menu",
|
|
1253
|
-
"aria-label":
|
|
1438
|
+
"aria-label": H(o)("imageWrap.menu.ariaLabel"),
|
|
1254
1439
|
"data-testid": "image-context-menu",
|
|
1255
|
-
style:
|
|
1256
|
-
onContextmenu: n[4] ||=
|
|
1440
|
+
style: F(p.value),
|
|
1441
|
+
onContextmenu: n[4] ||= J(() => {}, ["prevent"]),
|
|
1257
1442
|
onKeydown: v
|
|
1258
1443
|
}, [
|
|
1259
|
-
e.canOpenProperties ? (
|
|
1444
|
+
e.canOpenProperties ? (L(), k("button", {
|
|
1260
1445
|
key: 0,
|
|
1261
1446
|
type: "button",
|
|
1262
1447
|
role: "menuitem",
|
|
1263
1448
|
class: "image-ctx-menu__item",
|
|
1264
1449
|
"data-action": "open-properties",
|
|
1265
|
-
onMousedown: n[1] ||=
|
|
1450
|
+
onMousedown: n[1] ||= J(() => {}, ["prevent"]),
|
|
1266
1451
|
onClick: a
|
|
1267
|
-
}, [
|
|
1452
|
+
}, [A("span", gr, [M(c, {
|
|
1268
1453
|
name: "settings",
|
|
1269
|
-
size:
|
|
1270
|
-
})]),
|
|
1271
|
-
e.canOpenProperties ? (
|
|
1272
|
-
(
|
|
1454
|
+
size: Dr
|
|
1455
|
+
})]), A("span", _r, V(H(o)("imageWrap.menu.imageProperties")), 1)], 32)) : O("", !0),
|
|
1456
|
+
e.canOpenProperties ? (L(), k("div", vr)) : O("", !0),
|
|
1457
|
+
(L(!0), k(w, null, z(H(l), (e) => (L(), k("button", {
|
|
1273
1458
|
key: e.choice,
|
|
1274
1459
|
type: "button",
|
|
1275
1460
|
role: "menuitem",
|
|
1276
|
-
class:
|
|
1461
|
+
class: le(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
|
|
1277
1462
|
"data-wrap-type": e.choice,
|
|
1278
1463
|
"data-current": e.choice === u.value ? "true" : "false",
|
|
1279
1464
|
"data-disabled": m(e) ? "false" : "true",
|
|
1280
1465
|
disabled: !m(e),
|
|
1281
|
-
title:
|
|
1282
|
-
onMousedown: n[2] ||=
|
|
1466
|
+
title: H(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
|
|
1467
|
+
onMousedown: n[2] ||= J(() => {}, ["prevent"]),
|
|
1283
1468
|
onClick: (t) => h(e)
|
|
1284
1469
|
}, [
|
|
1285
|
-
|
|
1470
|
+
A("span", br, [M(c, {
|
|
1286
1471
|
name: f(e.iconHint),
|
|
1287
|
-
size:
|
|
1472
|
+
size: Dr
|
|
1288
1473
|
}, null, 8, ["name"])]),
|
|
1289
|
-
|
|
1290
|
-
e.choice === u.value ? (
|
|
1474
|
+
A("span", xr, V(H(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
1475
|
+
e.choice === u.value ? (L(), k("span", {
|
|
1291
1476
|
key: 0,
|
|
1292
1477
|
class: "image-ctx-menu__current-dot",
|
|
1293
|
-
"aria-label":
|
|
1294
|
-
}, "●", 8,
|
|
1295
|
-
], 42,
|
|
1296
|
-
e.textActions && e.textActions.length > 0 ? (
|
|
1478
|
+
"aria-label": H(o)("imageWrap.menu.ariaLabel")
|
|
1479
|
+
}, "●", 8, Sr)) : O("", !0)
|
|
1480
|
+
], 42, yr))), 128)),
|
|
1481
|
+
e.textActions && e.textActions.length > 0 ? (L(), k(w, { key: 2 }, [n[5] ||= A("div", {
|
|
1297
1482
|
class: "image-ctx-menu__divider",
|
|
1298
1483
|
role: "separator"
|
|
1299
|
-
}, null, -1), (
|
|
1484
|
+
}, null, -1), (L(!0), k(w, null, z(e.textActions, (e, t) => (L(), k(w, { key: `${e.action}-${t}` }, [A("button", {
|
|
1300
1485
|
type: "button",
|
|
1301
1486
|
role: "menuitem",
|
|
1302
1487
|
class: "image-ctx-menu__item image-ctx-menu__item--text",
|
|
1303
1488
|
disabled: e.disabled,
|
|
1304
|
-
onMousedown: n[3] ||=
|
|
1489
|
+
onMousedown: n[3] ||= J(() => {}, ["prevent"]),
|
|
1305
1490
|
onClick: (t) => g(e)
|
|
1306
|
-
}, [
|
|
1307
|
-
], 44,
|
|
1491
|
+
}, [A("span", wr, V(e.label), 1), e.shortcut ? (L(), k("span", Tr, V(e.shortcut), 1)) : O("", !0)], 40, Cr), e.dividerAfter ? (L(), k("div", Er)) : O("", !0)], 64))), 128))], 64)) : O("", !0)
|
|
1492
|
+
], 44, hr)) : O("", !0)]));
|
|
1308
1493
|
}
|
|
1309
|
-
}), [["__scopeId", "data-v-5c21ca8c"]]),
|
|
1494
|
+
}), [["__scopeId", "data-v-5c21ca8c"]]), jr = /* @__PURE__ */ N({
|
|
1310
1495
|
__name: "DocxEditorOverlays",
|
|
1311
1496
|
props: {
|
|
1312
1497
|
readOnly: { type: Boolean },
|
|
@@ -1324,7 +1509,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
1324
1509
|
],
|
|
1325
1510
|
setup(e, { emit: t }) {
|
|
1326
1511
|
let n = t;
|
|
1327
|
-
return (t, r) => (
|
|
1512
|
+
return (t, r) => (L(), k(w, null, [M(mr, {
|
|
1328
1513
|
"is-open": e.contextMenu.isOpen,
|
|
1329
1514
|
position: e.contextMenu.position,
|
|
1330
1515
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -1344,7 +1529,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
1344
1529
|
"on-image",
|
|
1345
1530
|
"can-merge-cells",
|
|
1346
1531
|
"can-split-cell"
|
|
1347
|
-
]),
|
|
1532
|
+
]), M(Ar, {
|
|
1348
1533
|
state: e.imageContextMenu,
|
|
1349
1534
|
"text-actions": e.imageContextMenuTextActions,
|
|
1350
1535
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -1358,7 +1543,7 @@ var bt = /* @__PURE__ */ j({
|
|
|
1358
1543
|
"can-open-properties"
|
|
1359
1544
|
])], 64));
|
|
1360
1545
|
}
|
|
1361
|
-
}),
|
|
1546
|
+
}), Mr = ["href", "title"], Nr = ["title"], Pr = ["title"], Fr = ["title"], Ir = { class: "docx-hyperlink-popup__edit-row" }, Lr = ["placeholder", "onKeydown"], Rr = { class: "docx-hyperlink-popup__edit-row" }, zr = ["onKeydown"], Br = ["disabled"], Vr = /* @__PURE__ */ x(/* @__PURE__ */ N({
|
|
1362
1547
|
__name: "HyperlinkPopup",
|
|
1363
1548
|
props: {
|
|
1364
1549
|
data: {},
|
|
@@ -1372,25 +1557,25 @@ var bt = /* @__PURE__ */ j({
|
|
|
1372
1557
|
"close"
|
|
1373
1558
|
],
|
|
1374
1559
|
setup(e, { emit: t }) {
|
|
1375
|
-
let { t: r } = n(), i = e, a = t, o =
|
|
1560
|
+
let { t: r } = n(), i = e, a = t, o = R(!1), s = R(""), c = R(""), l = R(null), u = E(() => ({
|
|
1376
1561
|
left: (i.data?.position.left ?? 0) + "px",
|
|
1377
1562
|
top: (i.data?.position.top ?? 0) + "px"
|
|
1378
1563
|
}));
|
|
1379
|
-
|
|
1564
|
+
G(() => i.data?.href, () => {
|
|
1380
1565
|
o.value = !1;
|
|
1381
1566
|
});
|
|
1382
1567
|
let d = null, f = null;
|
|
1383
1568
|
function p() {
|
|
1384
1569
|
f &&= (clearTimeout(f), null), d &&= (document.removeEventListener("mousedown", d), null);
|
|
1385
1570
|
}
|
|
1386
|
-
|
|
1571
|
+
G(() => i.data, (e) => {
|
|
1387
1572
|
p(), e && (d = (e) => {
|
|
1388
1573
|
let t = l.value;
|
|
1389
1574
|
t && !t.contains(e.target) && a("close");
|
|
1390
1575
|
}, f = setTimeout(() => {
|
|
1391
1576
|
d && document.addEventListener("mousedown", d);
|
|
1392
1577
|
}, 0));
|
|
1393
|
-
}, { immediate: !0 }),
|
|
1578
|
+
}, { immediate: !0 }), I(p);
|
|
1394
1579
|
function m() {
|
|
1395
1580
|
i.data && (s.value = i.data.displayText, c.value = i.data.href, o.value = !0);
|
|
1396
1581
|
}
|
|
@@ -1400,41 +1585,41 @@ var bt = /* @__PURE__ */ j({
|
|
|
1400
1585
|
function g() {
|
|
1401
1586
|
i.data && (a("copy", i.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(i.data.href).catch(() => {}));
|
|
1402
1587
|
}
|
|
1403
|
-
return (t, n) => e.data ? (
|
|
1588
|
+
return (t, n) => e.data ? (L(), k("div", {
|
|
1404
1589
|
key: 0,
|
|
1405
1590
|
ref_key: "popupRef",
|
|
1406
1591
|
ref: l,
|
|
1407
|
-
class:
|
|
1408
|
-
style:
|
|
1409
|
-
onMousedown: n[6] ||=
|
|
1410
|
-
}, [o.value ? (
|
|
1592
|
+
class: le(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
|
|
1593
|
+
style: F(u.value),
|
|
1594
|
+
onMousedown: n[6] ||= J(() => {}, ["stop"])
|
|
1595
|
+
}, [o.value ? (L(), k(w, { key: 1 }, [A("div", Ir, [K(A("input", {
|
|
1411
1596
|
class: "docx-hyperlink-popup__input",
|
|
1412
|
-
placeholder:
|
|
1597
|
+
placeholder: H(r)("hyperlinkPopup.displayTextPlaceholder"),
|
|
1413
1598
|
"onUpdate:modelValue": n[2] ||= (e) => s.value = e,
|
|
1414
|
-
onKeydown: [
|
|
1415
|
-
}, null, 40,
|
|
1599
|
+
onKeydown: [q(J(h, ["prevent"]), ["enter"]), n[3] ||= q((e) => t.$emit("close"), ["esc"])]
|
|
1600
|
+
}, null, 40, Lr), [[W, s.value]])]), A("div", Rr, [K(A("input", {
|
|
1416
1601
|
class: "docx-hyperlink-popup__input",
|
|
1417
1602
|
placeholder: "https://...",
|
|
1418
1603
|
"onUpdate:modelValue": n[4] ||= (e) => c.value = e,
|
|
1419
|
-
onKeydown: [
|
|
1420
|
-
}, null, 40,
|
|
1604
|
+
onKeydown: [q(J(h, ["prevent"]), ["enter"]), n[5] ||= q((e) => t.$emit("close"), ["esc"])]
|
|
1605
|
+
}, null, 40, zr), [[W, c.value]]), A("button", {
|
|
1421
1606
|
class: "docx-hyperlink-popup__apply",
|
|
1422
1607
|
disabled: !c.value.trim(),
|
|
1423
|
-
onClick:
|
|
1424
|
-
},
|
|
1608
|
+
onClick: J(h, ["prevent"])
|
|
1609
|
+
}, V(H(r)("common.apply")), 9, Br)])], 64)) : (L(), k(w, { key: 0 }, [
|
|
1425
1610
|
n[10] ||= oe("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-9d23bb12><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-9d23bb12></circle><path d=\"M2 12h20\" data-v-9d23bb12></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-9d23bb12></path></svg></span>", 1),
|
|
1426
|
-
|
|
1611
|
+
A("a", {
|
|
1427
1612
|
class: "docx-hyperlink-popup__url",
|
|
1428
1613
|
href: e.data.href,
|
|
1429
1614
|
title: e.data.href,
|
|
1430
|
-
onClick: n[0] ||=
|
|
1431
|
-
},
|
|
1432
|
-
n[11] ||=
|
|
1433
|
-
|
|
1615
|
+
onClick: n[0] ||= J((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1616
|
+
}, V(e.data.href), 9, Mr),
|
|
1617
|
+
n[11] ||= A("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1618
|
+
A("button", {
|
|
1434
1619
|
class: "docx-hyperlink-popup__btn",
|
|
1435
|
-
title:
|
|
1436
|
-
onClick:
|
|
1437
|
-
}, [...n[7] ||= [
|
|
1620
|
+
title: H(r)("hyperlinkPopup.copyLink"),
|
|
1621
|
+
onClick: J(g, ["prevent"])
|
|
1622
|
+
}, [...n[7] ||= [A("svg", {
|
|
1438
1623
|
width: "18",
|
|
1439
1624
|
height: "18",
|
|
1440
1625
|
viewBox: "0 0 24 24",
|
|
@@ -1443,20 +1628,20 @@ var bt = /* @__PURE__ */ j({
|
|
|
1443
1628
|
"stroke-width": "2",
|
|
1444
1629
|
"stroke-linecap": "round",
|
|
1445
1630
|
"stroke-linejoin": "round"
|
|
1446
|
-
}, [
|
|
1631
|
+
}, [A("rect", {
|
|
1447
1632
|
x: "9",
|
|
1448
1633
|
y: "9",
|
|
1449
1634
|
width: "13",
|
|
1450
1635
|
height: "13",
|
|
1451
1636
|
rx: "2",
|
|
1452
1637
|
ry: "2"
|
|
1453
|
-
}),
|
|
1454
|
-
e.readOnly ?
|
|
1638
|
+
}), A("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Nr),
|
|
1639
|
+
e.readOnly ? O("", !0) : (L(), k("button", {
|
|
1455
1640
|
key: 0,
|
|
1456
1641
|
class: "docx-hyperlink-popup__btn",
|
|
1457
|
-
title:
|
|
1458
|
-
onClick:
|
|
1459
|
-
}, [...n[8] ||= [
|
|
1642
|
+
title: H(r)("hyperlinkPopup.editLink"),
|
|
1643
|
+
onClick: J(m, ["prevent"])
|
|
1644
|
+
}, [...n[8] ||= [A("svg", {
|
|
1460
1645
|
width: "18",
|
|
1461
1646
|
height: "18",
|
|
1462
1647
|
viewBox: "0 0 24 24",
|
|
@@ -1465,26 +1650,26 @@ var bt = /* @__PURE__ */ j({
|
|
|
1465
1650
|
"stroke-width": "2",
|
|
1466
1651
|
"stroke-linecap": "round",
|
|
1467
1652
|
"stroke-linejoin": "round"
|
|
1468
|
-
}, [
|
|
1469
|
-
e.readOnly ?
|
|
1653
|
+
}, [A("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), A("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, Pr)),
|
|
1654
|
+
e.readOnly ? O("", !0) : (L(), k("button", {
|
|
1470
1655
|
key: 1,
|
|
1471
1656
|
class: "docx-hyperlink-popup__btn",
|
|
1472
|
-
title:
|
|
1473
|
-
onClick: n[1] ||=
|
|
1474
|
-
}, [...n[9] ||= [oe("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-9d23bb12></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8,
|
|
1475
|
-
], 64))], 38)) :
|
|
1657
|
+
title: H(r)("hyperlinkPopup.removeLink"),
|
|
1658
|
+
onClick: n[1] ||= J((e) => t.$emit("remove"), ["prevent"])
|
|
1659
|
+
}, [...n[9] ||= [oe("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-9d23bb12></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8, Fr))
|
|
1660
|
+
], 64))], 38)) : O("", !0);
|
|
1476
1661
|
}
|
|
1477
1662
|
}), [["__scopeId", "data-v-9d23bb12"]]);
|
|
1478
1663
|
//#endregion
|
|
1479
1664
|
//#region src/composables/useFileIO.ts
|
|
1480
|
-
function
|
|
1481
|
-
let t =
|
|
1665
|
+
function Hr(e) {
|
|
1666
|
+
let t = R(null);
|
|
1482
1667
|
async function n() {
|
|
1483
1668
|
await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
|
|
1484
1669
|
}
|
|
1485
1670
|
async function r(t) {
|
|
1486
1671
|
try {
|
|
1487
|
-
let r = await
|
|
1672
|
+
let r = await ke(t);
|
|
1488
1673
|
if (!r) return;
|
|
1489
1674
|
await e.loadBuffer(r.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", r.name), await n();
|
|
1490
1675
|
} catch (t) {
|
|
@@ -1523,8 +1708,8 @@ function Dn(e) {
|
|
|
1523
1708
|
}
|
|
1524
1709
|
//#endregion
|
|
1525
1710
|
//#region src/composables/useHyperlinkManagement.ts
|
|
1526
|
-
function
|
|
1527
|
-
let t =
|
|
1711
|
+
function Ur(e) {
|
|
1712
|
+
let t = R(null);
|
|
1528
1713
|
function n(t) {
|
|
1529
1714
|
let n = e.editorView.value;
|
|
1530
1715
|
if (!n) return;
|
|
@@ -1552,7 +1737,7 @@ function On(e) {
|
|
|
1552
1737
|
function a(n, r) {
|
|
1553
1738
|
let i = e.editorView.value;
|
|
1554
1739
|
if (!i) return;
|
|
1555
|
-
let a =
|
|
1740
|
+
let a = Me(i.state);
|
|
1556
1741
|
if (!a) {
|
|
1557
1742
|
t.value = null;
|
|
1558
1743
|
return;
|
|
@@ -1566,7 +1751,7 @@ function On(e) {
|
|
|
1566
1751
|
function o() {
|
|
1567
1752
|
let n = e.editorView.value;
|
|
1568
1753
|
if (!n) return;
|
|
1569
|
-
let r =
|
|
1754
|
+
let r = Me(n.state, t.value?.href);
|
|
1570
1755
|
if (!r) {
|
|
1571
1756
|
t.value = null;
|
|
1572
1757
|
return;
|
|
@@ -1585,27 +1770,27 @@ function On(e) {
|
|
|
1585
1770
|
}
|
|
1586
1771
|
//#endregion
|
|
1587
1772
|
//#region src/composables/useFormattingActions.ts
|
|
1588
|
-
function
|
|
1773
|
+
function Wr(e) {
|
|
1589
1774
|
function t() {
|
|
1590
1775
|
let t = e.editorView.value;
|
|
1591
|
-
t && (
|
|
1776
|
+
t && (Z(t.state, t.dispatch, t), t.focus());
|
|
1592
1777
|
}
|
|
1593
1778
|
function n(t) {
|
|
1594
1779
|
let n = e.editorView.value;
|
|
1595
1780
|
if (!n) return;
|
|
1596
1781
|
let r = e.getDocument()?.package?.styles;
|
|
1597
1782
|
if (r) {
|
|
1598
|
-
let e =
|
|
1599
|
-
|
|
1783
|
+
let e = ft(r).resolveParagraphStyle(t);
|
|
1784
|
+
st(t, {
|
|
1600
1785
|
paragraphFormatting: e.paragraphFormatting,
|
|
1601
1786
|
runFormatting: e.runFormatting
|
|
1602
1787
|
})(n.state, (e) => n.dispatch(e));
|
|
1603
|
-
} else
|
|
1788
|
+
} else st(t)(n.state, (e) => n.dispatch(e));
|
|
1604
1789
|
n.focus();
|
|
1605
1790
|
}
|
|
1606
1791
|
function r() {
|
|
1607
1792
|
let t = e.editorView.value;
|
|
1608
|
-
t && (
|
|
1793
|
+
t && (pt(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
1609
1794
|
}
|
|
1610
1795
|
function i(t) {
|
|
1611
1796
|
let n = e.editorView.value;
|
|
@@ -1615,46 +1800,13 @@ function kn(e) {
|
|
|
1615
1800
|
}
|
|
1616
1801
|
function a(t) {
|
|
1617
1802
|
let n = e.editorView.value;
|
|
1618
|
-
|
|
1619
|
-
let r = pt(n.state.doc, t.paraId);
|
|
1620
|
-
if (!r) return !1;
|
|
1621
|
-
let i = r.from + 1, a = r.to - 1;
|
|
1622
|
-
if (t.search) {
|
|
1623
|
-
let e = gt(n.state.doc, r.from, r.to, t.search);
|
|
1624
|
-
if (!e) return !1;
|
|
1625
|
-
i = e.from, a = e.to;
|
|
1626
|
-
}
|
|
1627
|
-
if (i >= a) return !0;
|
|
1628
|
-
let { schema: o } = n.state, s = t.marks, c = n.state.tr;
|
|
1629
|
-
if (s.bold !== void 0 && o.marks.bold && (c = s.bold ? c.addMark(i, a, o.marks.bold.create()) : c.removeMark(i, a, o.marks.bold)), s.italic !== void 0 && o.marks.italic && (c = s.italic ? c.addMark(i, a, o.marks.italic.create()) : c.removeMark(i, a, o.marks.italic)), s.underline !== void 0 && o.marks.underline) if (s.underline) {
|
|
1630
|
-
let e = typeof s.underline == "object" ? s.underline.style : void 0;
|
|
1631
|
-
c = c.addMark(i, a, o.marks.underline.create({ style: e ?? "single" }));
|
|
1632
|
-
} else c = c.removeMark(i, a, o.marks.underline);
|
|
1633
|
-
return s.strike !== void 0 && o.marks.strike && (c = s.strike ? c.addMark(i, a, o.marks.strike.create()) : c.removeMark(i, a, o.marks.strike)), s.color !== void 0 && o.marks.textColor && (c = s.color && (s.color.rgb || s.color.themeColor) ? c.addMark(i, a, o.marks.textColor.create({
|
|
1634
|
-
rgb: s.color.rgb ?? null,
|
|
1635
|
-
themeColor: s.color.themeColor ?? null
|
|
1636
|
-
})) : c.removeMark(i, a, o.marks.textColor)), s.highlight !== void 0 && o.marks.highlight && (c = s.highlight ? c.addMark(i, a, o.marks.highlight.create({ color: $e(s.highlight) || s.highlight })) : c.removeMark(i, a, o.marks.highlight)), s.fontSize !== void 0 && o.marks.fontSize && (c = s.fontSize > 0 ? c.addMark(i, a, o.marks.fontSize.create({ size: He(s.fontSize) })) : c.removeMark(i, a, o.marks.fontSize)), s.fontFamily !== void 0 && o.marks.fontFamily && (c = s.fontFamily && (s.fontFamily.ascii || s.fontFamily.hAnsi) ? c.addMark(i, a, o.marks.fontFamily.create({
|
|
1637
|
-
ascii: s.fontFamily.ascii ?? null,
|
|
1638
|
-
hAnsi: s.fontFamily.hAnsi ?? s.fontFamily.ascii ?? null
|
|
1639
|
-
})) : c.removeMark(i, a, o.marks.fontFamily)), n.dispatch(c), !0;
|
|
1803
|
+
return n ? mt(n, t) : !1;
|
|
1640
1804
|
}
|
|
1641
1805
|
function o(t) {
|
|
1642
1806
|
let n = e.editorView.value;
|
|
1643
1807
|
if (!n) return !1;
|
|
1644
|
-
let r =
|
|
1645
|
-
|
|
1646
|
-
let i = e.getDocument(), a = i?.package?.styles ? Ze(i.package.styles) : null;
|
|
1647
|
-
if (a && !a.hasParagraphStyle(t.styleId)) return !1;
|
|
1648
|
-
let o = n.state.doc.resolve(r.from + 1), s = n.state.doc.resolve(r.to - 1), c = n.state.apply(n.state.tr.setSelection(pe.between(o, s))), l = a ? (() => {
|
|
1649
|
-
let e = a.resolveParagraphStyle(t.styleId);
|
|
1650
|
-
return Ke(t.styleId, {
|
|
1651
|
-
paragraphFormatting: e.paragraphFormatting,
|
|
1652
|
-
runFormatting: e.runFormatting
|
|
1653
|
-
});
|
|
1654
|
-
})() : Ke(t.styleId), u = !1;
|
|
1655
|
-
return l(c, (e) => {
|
|
1656
|
-
u = !0, e.setSelection(n.state.selection.map(e.doc, e.mapping)), n.dispatch(e);
|
|
1657
|
-
}), u;
|
|
1808
|
+
let r = e.getDocument();
|
|
1809
|
+
return ht(n, t, { styleResolver: r?.package?.styles ? ft(r.package.styles) : null });
|
|
1658
1810
|
}
|
|
1659
1811
|
return {
|
|
1660
1812
|
handleClearFormatting: t,
|
|
@@ -1667,7 +1819,7 @@ function kn(e) {
|
|
|
1667
1819
|
}
|
|
1668
1820
|
//#endregion
|
|
1669
1821
|
//#region src/composables/usePageSetupControls.ts
|
|
1670
|
-
function
|
|
1822
|
+
function Gr(e) {
|
|
1671
1823
|
function t(t) {
|
|
1672
1824
|
let n = e.getDocument();
|
|
1673
1825
|
if (!n?.package?.document) return;
|
|
@@ -1694,19 +1846,19 @@ function An(e) {
|
|
|
1694
1846
|
}
|
|
1695
1847
|
function s(t) {
|
|
1696
1848
|
let n = e.editorView.value;
|
|
1697
|
-
n &&
|
|
1849
|
+
n && ut(t)(n.state, n.dispatch);
|
|
1698
1850
|
}
|
|
1699
1851
|
function c(t) {
|
|
1700
1852
|
let n = e.editorView.value;
|
|
1701
|
-
n &&
|
|
1853
|
+
n && dt(t)(n.state, n.dispatch);
|
|
1702
1854
|
}
|
|
1703
1855
|
function l(t) {
|
|
1704
1856
|
let n = e.editorView.value;
|
|
1705
|
-
n && (t < 0 ?
|
|
1857
|
+
n && (t < 0 ? lt(-t, !0)(n.state, n.dispatch) : lt(t, !1)(n.state, n.dispatch));
|
|
1706
1858
|
}
|
|
1707
1859
|
function u(t) {
|
|
1708
1860
|
let n = e.editorView.value;
|
|
1709
|
-
n &&
|
|
1861
|
+
n && ct(t)(n.state, n.dispatch);
|
|
1710
1862
|
}
|
|
1711
1863
|
return {
|
|
1712
1864
|
handlePageSetupApply: t,
|
|
@@ -1721,19 +1873,38 @@ function An(e) {
|
|
|
1721
1873
|
};
|
|
1722
1874
|
}
|
|
1723
1875
|
//#endregion
|
|
1876
|
+
//#region src/composables/useWatermarkControls.ts
|
|
1877
|
+
function Kr(e) {
|
|
1878
|
+
let t = R(!1), n = E(() => {
|
|
1879
|
+
e.stateTick.value;
|
|
1880
|
+
let t = e.editorView.value;
|
|
1881
|
+
return t ? vt(t.state) ?? void 0 : void 0;
|
|
1882
|
+
});
|
|
1883
|
+
function r(t) {
|
|
1884
|
+
if (e.readOnly.value) return;
|
|
1885
|
+
let n = e.editorView.value;
|
|
1886
|
+
n && (St(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
|
|
1887
|
+
}
|
|
1888
|
+
return {
|
|
1889
|
+
showWatermark: t,
|
|
1890
|
+
currentWatermark: n,
|
|
1891
|
+
handleWatermarkApply: r
|
|
1892
|
+
};
|
|
1893
|
+
}
|
|
1894
|
+
//#endregion
|
|
1724
1895
|
//#region src/composables/useOutlineSidebar.ts
|
|
1725
|
-
function
|
|
1896
|
+
function qr(e) {
|
|
1726
1897
|
function t() {
|
|
1727
1898
|
if (!e.showOutline.value) {
|
|
1728
1899
|
let t = e.editorView.value;
|
|
1729
|
-
t && (e.outlineHeadings.value =
|
|
1900
|
+
t && (e.outlineHeadings.value = Ct(t.state.doc));
|
|
1730
1901
|
}
|
|
1731
1902
|
e.showOutline.value = !e.showOutline.value;
|
|
1732
1903
|
}
|
|
1733
1904
|
function n(t) {
|
|
1734
1905
|
let n = e.editorView.value;
|
|
1735
1906
|
if (!n) return;
|
|
1736
|
-
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i =
|
|
1907
|
+
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = Y.near(r);
|
|
1737
1908
|
n.dispatch(n.state.tr.setSelection(i).scrollIntoView()), n.focus();
|
|
1738
1909
|
}
|
|
1739
1910
|
function r() {
|
|
@@ -1752,7 +1923,7 @@ function jn(e) {
|
|
|
1752
1923
|
}
|
|
1753
1924
|
//#endregion
|
|
1754
1925
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
1755
|
-
function
|
|
1926
|
+
function Jr(e) {
|
|
1756
1927
|
function t(t) {
|
|
1757
1928
|
if (t.key === "F1") {
|
|
1758
1929
|
t.preventDefault(), e.showKeyboardShortcuts.value = !0;
|
|
@@ -1760,214 +1931,111 @@ function Mn(e) {
|
|
|
1760
1931
|
}
|
|
1761
1932
|
e.handleZoomKeyDown(t), (t.ctrlKey || t.metaKey) && (e.disableFindReplaceShortcuts?.() && (t.key === "f" || t.key === "h") || (t.key === "f" || t.key === "h" ? (t.preventDefault(), e.showFindReplace.value = !0) : t.key === "k" ? (t.preventDefault(), e.showHyperlink.value = !0) : t.key === "/" && (t.preventDefault(), e.showKeyboardShortcuts.value = !e.showKeyboardShortcuts.value)));
|
|
1762
1933
|
}
|
|
1763
|
-
return
|
|
1764
|
-
}
|
|
1765
|
-
//#endregion
|
|
1766
|
-
//#region src/utils/commentFactories.ts
|
|
1767
|
-
function Nn(e, t, n, r) {
|
|
1768
|
-
return {
|
|
1769
|
-
id: e.reduce((e, t) => Math.max(e, t.id), 0) + 1,
|
|
1770
|
-
author: n,
|
|
1771
|
-
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1772
|
-
content: [{
|
|
1773
|
-
type: "paragraph",
|
|
1774
|
-
properties: {},
|
|
1775
|
-
content: [{
|
|
1776
|
-
type: "run",
|
|
1777
|
-
properties: {},
|
|
1778
|
-
content: [{
|
|
1779
|
-
type: "text",
|
|
1780
|
-
text: t
|
|
1781
|
-
}]
|
|
1782
|
-
}]
|
|
1783
|
-
}],
|
|
1784
|
-
...r == null ? {} : { parentId: r }
|
|
1785
|
-
};
|
|
1934
|
+
return ue(() => window.addEventListener("keydown", t)), I(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
|
|
1786
1935
|
}
|
|
1787
1936
|
//#endregion
|
|
1788
1937
|
//#region src/composables/useCommentManagement.ts
|
|
1789
|
-
function
|
|
1790
|
-
function t(
|
|
1791
|
-
|
|
1938
|
+
function Yr(e) {
|
|
1939
|
+
function t() {
|
|
1940
|
+
kt(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
|
|
1792
1941
|
}
|
|
1793
|
-
function n(n) {
|
|
1942
|
+
function n(n, r, i) {
|
|
1943
|
+
return t(), Et(e.commentIdAllocator, n, r, i);
|
|
1944
|
+
}
|
|
1945
|
+
function r(n) {
|
|
1794
1946
|
let r = e.getDocument(), i = e.editorView.value;
|
|
1795
1947
|
if (!r?.package?.document || !i) return null;
|
|
1796
|
-
r.package.document.comments || (r.package.document.comments = []);
|
|
1797
|
-
let a = i.
|
|
1798
|
-
|
|
1799
|
-
let o = pt(i.state.doc, n.paraId);
|
|
1800
|
-
if (!o) return null;
|
|
1801
|
-
let s = o.from + 1, c = o.to - 1;
|
|
1802
|
-
if (n.search) {
|
|
1803
|
-
let e = gt(i.state.doc, o.from, o.to, n.search);
|
|
1804
|
-
if (!e) return null;
|
|
1805
|
-
s = e.from, c = e.to;
|
|
1806
|
-
}
|
|
1807
|
-
if (s >= c) return null;
|
|
1808
|
-
let l = t(n.text, n.author);
|
|
1809
|
-
return r.package.document.comments.push(l), e.comments.value = [...r.package.document.comments], i.dispatch(i.state.tr.addMark(s, c, a.create({ commentId: l.id }))), e.showSidebar.value = !0, e.emit("change", r), e.contentChangeSubscribers.forEach((e) => e(r)), l.id;
|
|
1948
|
+
r.package.document.comments || (r.package.document.comments = []), t();
|
|
1949
|
+
let a = wt(i, n, e.commentIdAllocator);
|
|
1950
|
+
return a ? (r.package.document.comments.push(a), e.comments.value = [...r.package.document.comments], e.showSidebar.value = !0, e.emit("change", r), e.contentChangeSubscribers.forEach((e) => e(r)), a.id) : null;
|
|
1810
1951
|
}
|
|
1811
|
-
function
|
|
1952
|
+
function i(t, r, i) {
|
|
1812
1953
|
let a = e.getDocument();
|
|
1813
|
-
if (!a?.package?.document?.comments || !a.package.document.comments.some((e) => e.id ===
|
|
1814
|
-
let o =
|
|
1954
|
+
if (!a?.package?.document?.comments || !a.package.document.comments.some((e) => e.id === t)) return null;
|
|
1955
|
+
let o = n(r, i, t);
|
|
1815
1956
|
return a.package.document.comments.push(o), e.comments.value = [...a.package.document.comments], e.emit("change", a), e.contentChangeSubscribers.forEach((e) => e(a)), o.id;
|
|
1816
1957
|
}
|
|
1817
|
-
function
|
|
1958
|
+
function a(t) {
|
|
1818
1959
|
let n = e.getDocument();
|
|
1819
1960
|
if (!n?.package?.document?.comments) return;
|
|
1820
1961
|
let r = n.package.document.comments.find((e) => e.id === t);
|
|
1821
1962
|
r && (r.done = !0, e.comments.value = [...n.package.document.comments], e.emit("change", n), e.contentChangeSubscribers.forEach((e) => e(n)));
|
|
1822
1963
|
}
|
|
1823
|
-
function
|
|
1824
|
-
let
|
|
1825
|
-
if (!
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
if (!i) return !1;
|
|
1830
|
-
let a = t.search === "", o = t.replaceWith === "";
|
|
1831
|
-
if (a && o) return !1;
|
|
1832
|
-
let s, c;
|
|
1833
|
-
if (a) s = i.to - 1, c = i.to - 1;
|
|
1834
|
-
else {
|
|
1835
|
-
let e = gt(n.state.doc, i.from, i.to, t.search);
|
|
1836
|
-
if (!e) return !1;
|
|
1837
|
-
s = e.from, c = e.to;
|
|
1838
|
-
}
|
|
1839
|
-
let l = !1;
|
|
1840
|
-
if (s < c && n.state.doc.nodesBetween(s, c, (e) => {
|
|
1841
|
-
for (let t of e.marks) if (t.type === r.marks.insertion || t.type === r.marks.deletion) return l = !0, !1;
|
|
1842
|
-
return !0;
|
|
1843
|
-
}), l) return !1;
|
|
1844
|
-
let u = Math.max(0, ...e.trackedChanges.value.map((e) => e.revisionId)) + 1, d = (/* @__PURE__ */ new Date()).toISOString(), f = r.marks.deletion.create({
|
|
1845
|
-
revisionId: u,
|
|
1846
|
-
author: t.author,
|
|
1847
|
-
date: d
|
|
1848
|
-
}), p = r.marks.insertion.create({
|
|
1849
|
-
revisionId: u,
|
|
1850
|
-
author: t.author,
|
|
1851
|
-
date: d
|
|
1852
|
-
}), m = n.state.tr;
|
|
1853
|
-
return a || (m = m.addMark(s, c, f)), o || (m = m.insert(c, r.text(t.replaceWith, [p]))), n.dispatch(m), e.extractCommentsAndChanges(), e.showSidebar.value = !0, !0;
|
|
1854
|
-
}
|
|
1855
|
-
function o(e, t) {
|
|
1856
|
-
r(e, t, "User");
|
|
1964
|
+
function o(n) {
|
|
1965
|
+
let r = e.editorView.value;
|
|
1966
|
+
if (!r) return !1;
|
|
1967
|
+
t();
|
|
1968
|
+
let i = Tt(r, n, e.commentIdAllocator);
|
|
1969
|
+
return i && (e.extractCommentsAndChanges(), e.showSidebar.value = !0), i;
|
|
1857
1970
|
}
|
|
1858
|
-
function s(t) {
|
|
1971
|
+
function s(e, t) {
|
|
1972
|
+
i(e, t, "User");
|
|
1973
|
+
}
|
|
1974
|
+
function c(t) {
|
|
1859
1975
|
let n = e.getDocument();
|
|
1860
1976
|
if (!n?.package?.document?.comments) return;
|
|
1861
1977
|
let r = n.package.document.comments.find((e) => e.id === t);
|
|
1862
1978
|
r && (r.done = !1), e.comments.value = [...n.package.document.comments], e.emit("change", n);
|
|
1863
1979
|
}
|
|
1864
|
-
function
|
|
1980
|
+
function l(t) {
|
|
1865
1981
|
let n = e.getDocument();
|
|
1866
1982
|
n?.package?.document?.comments && (n.package.document.comments = n.package.document.comments.filter((e) => e.id !== t && e.parentId !== t), e.comments.value = [...n.package.document.comments], e.emit("change", n));
|
|
1867
1983
|
}
|
|
1868
|
-
function
|
|
1984
|
+
function u(t, n) {
|
|
1869
1985
|
let r = e.editorView.value;
|
|
1870
|
-
r && (
|
|
1986
|
+
r && (gt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
|
|
1871
1987
|
}
|
|
1872
|
-
function
|
|
1988
|
+
function d(t, n) {
|
|
1873
1989
|
let r = e.editorView.value;
|
|
1874
|
-
r && (
|
|
1990
|
+
r && (bt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
|
|
1875
1991
|
}
|
|
1876
|
-
function
|
|
1992
|
+
function f(t) {
|
|
1877
1993
|
let n = e.editorView.value;
|
|
1878
|
-
n && (
|
|
1994
|
+
n && (_t(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
|
|
1879
1995
|
}
|
|
1880
|
-
function
|
|
1996
|
+
function p(t) {
|
|
1881
1997
|
let n = e.editorView.value;
|
|
1882
|
-
n && (
|
|
1998
|
+
n && (xt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
|
|
1883
1999
|
}
|
|
1884
|
-
function
|
|
2000
|
+
function m(t, r) {
|
|
1885
2001
|
let i = e.getDocument(), a = e.editorView.value;
|
|
1886
2002
|
if (!i?.package?.document || !a) return;
|
|
1887
2003
|
i.package.document.comments || (i.package.document.comments = []);
|
|
1888
2004
|
let o = a.state.schema.marks.comment;
|
|
1889
2005
|
if (!o) return;
|
|
1890
2006
|
let s = null, c = a.state.schema.marks.insertion, l = a.state.schema.marks.deletion;
|
|
1891
|
-
if (a.state.doc.descendants((e,
|
|
2007
|
+
if (a.state.doc.descendants((e, n) => {
|
|
1892
2008
|
if (s !== null) return !1;
|
|
1893
|
-
for (let r of e.marks) if ((r.type === c || r.type === l) && r.attrs.revisionId ===
|
|
2009
|
+
for (let r of e.marks) if ((r.type === c || r.type === l) && r.attrs.revisionId === t) return s = n, !1;
|
|
1894
2010
|
return !0;
|
|
1895
2011
|
}), s === null) return;
|
|
1896
|
-
let u =
|
|
2012
|
+
let u = n(r, "User");
|
|
1897
2013
|
i.package.document.comments.push(u), e.comments.value = [...i.package.document.comments];
|
|
1898
2014
|
let d = s, f = Math.min(d + 1, a.state.doc.content.size);
|
|
1899
2015
|
a.dispatch(a.state.tr.addMark(d, f, o.create({ commentId: u.id }))), e.emit("change", i);
|
|
1900
2016
|
}
|
|
1901
2017
|
return {
|
|
1902
|
-
addComment:
|
|
1903
|
-
replyToComment:
|
|
1904
|
-
resolveComment:
|
|
1905
|
-
proposeChange:
|
|
1906
|
-
handleCommentReply:
|
|
1907
|
-
handleCommentUnresolve:
|
|
1908
|
-
handleCommentDelete:
|
|
1909
|
-
handleAcceptChange:
|
|
1910
|
-
handleRejectChange:
|
|
1911
|
-
handleAcceptChangeById:
|
|
1912
|
-
handleRejectChangeById:
|
|
1913
|
-
handleTrackedChangeReply:
|
|
2018
|
+
addComment: r,
|
|
2019
|
+
replyToComment: i,
|
|
2020
|
+
resolveComment: a,
|
|
2021
|
+
proposeChange: o,
|
|
2022
|
+
handleCommentReply: s,
|
|
2023
|
+
handleCommentUnresolve: c,
|
|
2024
|
+
handleCommentDelete: l,
|
|
2025
|
+
handleAcceptChange: u,
|
|
2026
|
+
handleRejectChange: d,
|
|
2027
|
+
handleAcceptChangeById: f,
|
|
2028
|
+
handleRejectChangeById: p,
|
|
2029
|
+
handleTrackedChangeReply: m
|
|
1914
2030
|
};
|
|
1915
2031
|
}
|
|
1916
2032
|
//#endregion
|
|
1917
|
-
//#region src/utils/domQueries.ts
|
|
1918
|
-
function Fn(e, t) {
|
|
1919
|
-
let n = ge(e);
|
|
1920
|
-
for (let e of n) {
|
|
1921
|
-
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
1922
|
-
if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
|
|
1923
|
-
}
|
|
1924
|
-
return null;
|
|
1925
|
-
}
|
|
1926
|
-
function In(e, t, n) {
|
|
1927
|
-
if (!e || !t) return;
|
|
1928
|
-
let r = null;
|
|
1929
|
-
for (let t of ge(e)) {
|
|
1930
|
-
let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
|
|
1931
|
-
if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
|
|
1932
|
-
r = t;
|
|
1933
|
-
break;
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
if (r ||= e.querySelector(`[data-pm-start="${n}"]`), !r) return;
|
|
1937
|
-
let i = t.getBoundingClientRect(), a = r.getBoundingClientRect();
|
|
1938
|
-
t.scrollTo({
|
|
1939
|
-
top: a.top - i.top + t.scrollTop - 48,
|
|
1940
|
-
behavior: "smooth"
|
|
1941
|
-
});
|
|
1942
|
-
}
|
|
1943
|
-
function Ln(e, t, n, r) {
|
|
1944
|
-
if (!e || !t) return null;
|
|
1945
|
-
let i = me(e, n, r, 1);
|
|
1946
|
-
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
1947
|
-
}
|
|
1948
|
-
function Rn(e, t, n) {
|
|
1949
|
-
if (!e) return;
|
|
1950
|
-
let r = Fn(e, t);
|
|
1951
|
-
if (!r) return;
|
|
1952
|
-
let i = r.textContent || "", a = Number(r.dataset.pmStart) || 0, [o, s] = ve(i, t - a), c = a + o, l = a + s;
|
|
1953
|
-
c < l && n(c, l);
|
|
1954
|
-
}
|
|
1955
|
-
function zn(e, t, n) {
|
|
1956
|
-
if (!e) return;
|
|
1957
|
-
let r = Fn(e, t);
|
|
1958
|
-
if (!r) return;
|
|
1959
|
-
let i = r.closest(".layout-paragraph");
|
|
1960
|
-
if (!i) return;
|
|
1961
|
-
let a = Number(i.dataset.pmStart), o = Number(i.dataset.pmEnd);
|
|
1962
|
-
!isNaN(a) && !isNaN(o) && a < o && n(a, o);
|
|
1963
|
-
}
|
|
1964
|
-
//#endregion
|
|
1965
2033
|
//#region src/composables/useCommentLifecycle.ts
|
|
1966
|
-
function
|
|
1967
|
-
let t =
|
|
2034
|
+
function Xr(e) {
|
|
2035
|
+
let t = R(null), n = R(null), r = R(null), i = R(!1);
|
|
1968
2036
|
function a() {
|
|
1969
2037
|
let t = e.getDocument(), n = e.editorView.value;
|
|
1970
|
-
!t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value =
|
|
2038
|
+
!t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = At(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
|
|
1971
2039
|
}
|
|
1972
2040
|
function o() {
|
|
1973
2041
|
e.stateTick.value;
|
|
@@ -1986,7 +2054,7 @@ function Bn(e) {
|
|
|
1986
2054
|
t.value = null;
|
|
1987
2055
|
return;
|
|
1988
2056
|
}
|
|
1989
|
-
let s = o.getBoundingClientRect(), c =
|
|
2057
|
+
let s = o.getBoundingClientRect(), c = zt(a, r);
|
|
1990
2058
|
if (!c) {
|
|
1991
2059
|
t.value = null;
|
|
1992
2060
|
return;
|
|
@@ -2014,7 +2082,7 @@ function Bn(e) {
|
|
|
2014
2082
|
for (let t of r) {
|
|
2015
2083
|
if (t.type.name === "comment" && t.attrs.commentId != null) {
|
|
2016
2084
|
let n = t.attrs.commentId;
|
|
2017
|
-
if (n ===
|
|
2085
|
+
if (n === Dt || e.resolvedCommentIds.value.has(n)) continue;
|
|
2018
2086
|
i = `comment-${n}`;
|
|
2019
2087
|
break;
|
|
2020
2088
|
}
|
|
@@ -2039,7 +2107,7 @@ function Bn(e) {
|
|
|
2039
2107
|
}, r.value = t.value?.top ?? null;
|
|
2040
2108
|
let s = i.state.schema.marks.comment;
|
|
2041
2109
|
if (s) {
|
|
2042
|
-
let e = i.state.tr.addMark(a, o, s.create({ commentId:
|
|
2110
|
+
let e = i.state.tr.addMark(a, o, s.create({ commentId: Dt }));
|
|
2043
2111
|
i.dispatch(e);
|
|
2044
2112
|
}
|
|
2045
2113
|
e.showSidebar.value = !0, e.isAddingComment.value = !0, t.value = null;
|
|
@@ -2047,8 +2115,8 @@ function Bn(e) {
|
|
|
2047
2115
|
function l(t) {
|
|
2048
2116
|
let i = e.getDocument(), a = e.editorView.value;
|
|
2049
2117
|
if (!i?.package) return;
|
|
2050
|
-
i.package.document.comments || (i.package.document.comments = []);
|
|
2051
|
-
let o =
|
|
2118
|
+
i.package.document.comments || (i.package.document.comments = []), kt(e.commentIdAllocator, i.package.document.comments, a);
|
|
2119
|
+
let o = Et(e.commentIdAllocator, t, "User");
|
|
2052
2120
|
i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments];
|
|
2053
2121
|
let s = n.value;
|
|
2054
2122
|
if (a && s && s.from !== s.to) {
|
|
@@ -2071,15 +2139,15 @@ function Bn(e) {
|
|
|
2071
2139
|
function d(t) {
|
|
2072
2140
|
e.showSidebar.value = !0;
|
|
2073
2141
|
}
|
|
2074
|
-
|
|
2142
|
+
G([
|
|
2075
2143
|
e.stateTick,
|
|
2076
2144
|
e.isAddingComment,
|
|
2077
2145
|
e.zoom
|
|
2078
|
-
], () => o()),
|
|
2146
|
+
], () => o()), G(e.stateTick, () => s()), G(e.stateTick, () => a());
|
|
2079
2147
|
let f = null;
|
|
2080
|
-
return
|
|
2148
|
+
return ue(() => {
|
|
2081
2149
|
f = new ResizeObserver(() => o()), e.pagesRef.value && f.observe(e.pagesRef.value), window.addEventListener("resize", o);
|
|
2082
|
-
}),
|
|
2150
|
+
}), I(() => {
|
|
2083
2151
|
f?.disconnect(), window.removeEventListener("resize", o);
|
|
2084
2152
|
}), {
|
|
2085
2153
|
floatingCommentBtn: t,
|
|
@@ -2097,8 +2165,8 @@ function Bn(e) {
|
|
|
2097
2165
|
}
|
|
2098
2166
|
//#endregion
|
|
2099
2167
|
//#region src/composables/useImageActions.ts
|
|
2100
|
-
function
|
|
2101
|
-
let t =
|
|
2168
|
+
function Zr(e) {
|
|
2169
|
+
let t = B(null), n = R(!1), r = E(() => {
|
|
2102
2170
|
e.stateTick.value;
|
|
2103
2171
|
let n = e.editorView.value, r = t.value;
|
|
2104
2172
|
if (!n || !r) return null;
|
|
@@ -2120,14 +2188,14 @@ function Vn(e) {
|
|
|
2120
2188
|
width: t.width,
|
|
2121
2189
|
height: t.height
|
|
2122
2190
|
});
|
|
2123
|
-
|
|
2191
|
+
yt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
|
|
2124
2192
|
}
|
|
2125
2193
|
function a(n) {
|
|
2126
2194
|
let r = e.editorView.value, i = t.value;
|
|
2127
2195
|
if (!r || !i) return;
|
|
2128
|
-
let a =
|
|
2196
|
+
let a = Ke(n);
|
|
2129
2197
|
if (!a) return;
|
|
2130
|
-
let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu:
|
|
2198
|
+
let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: Ve(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
|
|
2131
2199
|
l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
|
|
2132
2200
|
}
|
|
2133
2201
|
function o(n) {
|
|
@@ -2156,8 +2224,8 @@ function Vn(e) {
|
|
|
2156
2224
|
}
|
|
2157
2225
|
//#endregion
|
|
2158
2226
|
//#region src/utils/imageClipboard.ts
|
|
2159
|
-
function
|
|
2160
|
-
let r =
|
|
2227
|
+
function Qr(e, t, n) {
|
|
2228
|
+
let r = at(e.state), i = e.state.schema.marks.insertion;
|
|
2161
2229
|
if (!r || !i) return;
|
|
2162
2230
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
2163
2231
|
o < 0 || t.addMark(o, a, i.create({
|
|
@@ -2166,10 +2234,10 @@ function Hn(e, t, n) {
|
|
|
2166
2234
|
date: r.date
|
|
2167
2235
|
}));
|
|
2168
2236
|
}
|
|
2169
|
-
function
|
|
2237
|
+
function $r(e, t) {
|
|
2170
2238
|
return e.getBlob(t);
|
|
2171
2239
|
}
|
|
2172
|
-
function
|
|
2240
|
+
function ei(e, t) {
|
|
2173
2241
|
let n = e.state.doc.nodeAt(t);
|
|
2174
2242
|
if (!n || n.type.name !== "image") return;
|
|
2175
2243
|
let r = `<img src="${n.attrs.src}" data-pm-image="true" data-width="${n.attrs.width ?? ""}" data-height="${n.attrs.height ?? ""}" data-wrap-type="${n.attrs.wrapType ?? ""}" data-display-mode="${n.attrs.displayMode ?? ""}" data-rid="${n.attrs.rId ?? ""}" />`, i = new ClipboardItem({
|
|
@@ -2181,13 +2249,13 @@ function Wn(e, t) {
|
|
|
2181
2249
|
e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
2182
2250
|
});
|
|
2183
2251
|
}
|
|
2184
|
-
function
|
|
2252
|
+
function ti(e) {
|
|
2185
2253
|
return new Promise((t, n) => {
|
|
2186
2254
|
let r = new FileReader();
|
|
2187
2255
|
r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
|
|
2188
2256
|
});
|
|
2189
2257
|
}
|
|
2190
|
-
function
|
|
2258
|
+
function ni(e) {
|
|
2191
2259
|
return new Promise((t) => {
|
|
2192
2260
|
let n = new Image();
|
|
2193
2261
|
n.onload = () => t({
|
|
@@ -2199,13 +2267,13 @@ function Kn(e) {
|
|
|
2199
2267
|
}), n.src = e;
|
|
2200
2268
|
});
|
|
2201
2269
|
}
|
|
2202
|
-
async function
|
|
2270
|
+
async function ri(e) {
|
|
2203
2271
|
try {
|
|
2204
2272
|
let t = await navigator.clipboard.read();
|
|
2205
2273
|
for (let n of t) {
|
|
2206
2274
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
2207
2275
|
if (t) {
|
|
2208
|
-
let r = await
|
|
2276
|
+
let r = await ti(await $r(n, t)), i = await ni(r), a = i.width, o = i.height;
|
|
2209
2277
|
a > 612 && (o = Math.round(612 / a * o), a = 612);
|
|
2210
2278
|
let s = e.state.schema.nodes.image.create({
|
|
2211
2279
|
src: r,
|
|
@@ -2215,11 +2283,11 @@ async function qn(e) {
|
|
|
2215
2283
|
wrapType: "inline",
|
|
2216
2284
|
displayMode: "inline"
|
|
2217
2285
|
}), c = e.state.tr.replaceSelectionWith(s);
|
|
2218
|
-
|
|
2286
|
+
Qr(e, c, s), e.dispatch(c);
|
|
2219
2287
|
return;
|
|
2220
2288
|
}
|
|
2221
2289
|
if (n.types.includes("text/html")) {
|
|
2222
|
-
let t = await (await
|
|
2290
|
+
let t = await (await $r(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
|
|
2223
2291
|
if (r && r[1]) {
|
|
2224
2292
|
let n = r[1], i = t.match(/data-width="(\d+)"/), a = t.match(/data-height="(\d+)"/), o = i ? Number(i[1]) : 200, s = a ? Number(a[1]) : 200, c = e.state.schema.nodes.image.create({
|
|
2225
2293
|
src: n,
|
|
@@ -2229,12 +2297,12 @@ async function qn(e) {
|
|
|
2229
2297
|
wrapType: "inline",
|
|
2230
2298
|
displayMode: "inline"
|
|
2231
2299
|
}), l = e.state.tr.replaceSelectionWith(c);
|
|
2232
|
-
|
|
2300
|
+
Qr(e, l, c), e.dispatch(l);
|
|
2233
2301
|
return;
|
|
2234
2302
|
}
|
|
2235
2303
|
}
|
|
2236
2304
|
if (n.types.includes("text/plain")) {
|
|
2237
|
-
let t = await (await
|
|
2305
|
+
let t = await (await $r(n, "text/plain")).text();
|
|
2238
2306
|
if (t && t !== "[image]") {
|
|
2239
2307
|
let { from: n } = e.state.selection;
|
|
2240
2308
|
e.dispatch(e.state.tr.insertText(t, n));
|
|
@@ -2250,14 +2318,14 @@ async function qn(e) {
|
|
|
2250
2318
|
}
|
|
2251
2319
|
}
|
|
2252
2320
|
}
|
|
2253
|
-
function
|
|
2321
|
+
function ii(e, t) {
|
|
2254
2322
|
let n = e.state.doc.nodeAt(t);
|
|
2255
2323
|
if (!n || n.type.name !== "image") return;
|
|
2256
2324
|
let r = document.createElement("input");
|
|
2257
2325
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
2258
2326
|
let i = r.files?.[0];
|
|
2259
2327
|
if (!i) return;
|
|
2260
|
-
let a = await
|
|
2328
|
+
let a = await ti(i), o = await ni(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
|
|
2261
2329
|
try {
|
|
2262
2330
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
2263
2331
|
...n.attrs,
|
|
@@ -2272,8 +2340,8 @@ function Jn(e, t) {
|
|
|
2272
2340
|
}
|
|
2273
2341
|
//#endregion
|
|
2274
2342
|
//#region src/composables/useContextMenus.ts
|
|
2275
|
-
function
|
|
2276
|
-
let { t } = n(), r =
|
|
2343
|
+
function ai(e) {
|
|
2344
|
+
let { t } = n(), r = R({
|
|
2277
2345
|
isOpen: !1,
|
|
2278
2346
|
position: {
|
|
2279
2347
|
x: 0,
|
|
@@ -2284,7 +2352,7 @@ function Yn(e) {
|
|
|
2284
2352
|
onImage: !1,
|
|
2285
2353
|
canMergeCells: !1,
|
|
2286
2354
|
canSplitCell: !1
|
|
2287
|
-
}), i =
|
|
2355
|
+
}), i = R(null), a = E(() => [
|
|
2288
2356
|
{
|
|
2289
2357
|
action: "cut",
|
|
2290
2358
|
label: t("contextMenu.cut"),
|
|
@@ -2310,12 +2378,12 @@ function Yn(e) {
|
|
|
2310
2378
|
function o(t) {
|
|
2311
2379
|
let n = e.editorView.value;
|
|
2312
2380
|
if (!n) return;
|
|
2313
|
-
let a = t.target, o =
|
|
2381
|
+
let a = t.target, o = Ue(a);
|
|
2314
2382
|
if (o) {
|
|
2315
2383
|
let a = Number(o.dataset.pmStart);
|
|
2316
2384
|
if (!isNaN(a)) {
|
|
2317
2385
|
try {
|
|
2318
|
-
let e =
|
|
2386
|
+
let e = he.create(n.state.doc, a);
|
|
2319
2387
|
n.dispatch(n.state.tr.setSelection(e));
|
|
2320
2388
|
} catch {}
|
|
2321
2389
|
e.selectedImage.value = {
|
|
@@ -2336,7 +2404,7 @@ function Yn(e) {
|
|
|
2336
2404
|
pmPos: a,
|
|
2337
2405
|
currentWrapType: n,
|
|
2338
2406
|
currentCssFloat: c ?? null,
|
|
2339
|
-
inlinePositionEmu: n === "inline" ?
|
|
2407
|
+
inlinePositionEmu: n === "inline" ? Ve(o, e.zoom.value) : void 0
|
|
2340
2408
|
}, r.value.isOpen = !1;
|
|
2341
2409
|
return;
|
|
2342
2410
|
}
|
|
@@ -2348,7 +2416,7 @@ function Yn(e) {
|
|
|
2348
2416
|
e.setPmSelection(a);
|
|
2349
2417
|
} catch {}
|
|
2350
2418
|
}
|
|
2351
|
-
let s =
|
|
2419
|
+
let s = Ne(n.state), { empty: c } = n.state.selection;
|
|
2352
2420
|
i.value &&= null, r.value = {
|
|
2353
2421
|
isOpen: !0,
|
|
2354
2422
|
position: {
|
|
@@ -2377,7 +2445,7 @@ function Yn(e) {
|
|
|
2377
2445
|
pmPos: a.pmPos,
|
|
2378
2446
|
currentWrapType: s,
|
|
2379
2447
|
currentCssFloat: c ?? null,
|
|
2380
|
-
inlinePositionEmu: s === "inline" ?
|
|
2448
|
+
inlinePositionEmu: s === "inline" ? Ve(a.element, e.zoom.value) : void 0
|
|
2381
2449
|
}, r.value.isOpen = !1;
|
|
2382
2450
|
}
|
|
2383
2451
|
function c(t) {
|
|
@@ -2393,16 +2461,16 @@ function Yn(e) {
|
|
|
2393
2461
|
switch (t) {
|
|
2394
2462
|
case "cut":
|
|
2395
2463
|
if (e.selectedImage.value) {
|
|
2396
|
-
|
|
2464
|
+
ei(n, e.selectedImage.value.pmPos);
|
|
2397
2465
|
let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
|
|
2398
2466
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
|
|
2399
2467
|
} else document.execCommand("cut");
|
|
2400
2468
|
break;
|
|
2401
2469
|
case "copy":
|
|
2402
|
-
e.selectedImage.value ?
|
|
2470
|
+
e.selectedImage.value ? ei(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
|
|
2403
2471
|
break;
|
|
2404
2472
|
case "paste":
|
|
2405
|
-
|
|
2473
|
+
ri(n);
|
|
2406
2474
|
break;
|
|
2407
2475
|
case "pasteAsPlainText":
|
|
2408
2476
|
navigator.clipboard.readText().then((e) => {
|
|
@@ -2415,7 +2483,7 @@ function Yn(e) {
|
|
|
2415
2483
|
break;
|
|
2416
2484
|
}
|
|
2417
2485
|
case "selectAll": {
|
|
2418
|
-
let e =
|
|
2486
|
+
let e = Y.create(n.state.doc, 0, n.state.doc.content.size);
|
|
2419
2487
|
n.dispatch(n.state.tr.setSelection(e));
|
|
2420
2488
|
break;
|
|
2421
2489
|
}
|
|
@@ -2423,7 +2491,7 @@ function Yn(e) {
|
|
|
2423
2491
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2424
2492
|
break;
|
|
2425
2493
|
case "replaceImage":
|
|
2426
|
-
e.selectedImage.value &&
|
|
2494
|
+
e.selectedImage.value && ii(n, e.selectedImage.value.pmPos);
|
|
2427
2495
|
break;
|
|
2428
2496
|
case "deleteImage":
|
|
2429
2497
|
if (e.selectedImage.value) {
|
|
@@ -2458,21 +2526,28 @@ function Yn(e) {
|
|
|
2458
2526
|
}
|
|
2459
2527
|
//#endregion
|
|
2460
2528
|
//#region src/composables/usePagesPointer.ts
|
|
2461
|
-
var
|
|
2462
|
-
function
|
|
2463
|
-
let t =
|
|
2529
|
+
var oi = 500;
|
|
2530
|
+
function si(e) {
|
|
2531
|
+
let t = R(null), n = null;
|
|
2464
2532
|
function r() {
|
|
2465
2533
|
n !== null && (clearTimeout(n), n = null);
|
|
2466
2534
|
}
|
|
2467
|
-
let i =
|
|
2535
|
+
let i = B(null), a = 0, o = null, s = 0, c = !1, l = null, u = C({
|
|
2536
|
+
pagesContainer: e.pagesRef,
|
|
2537
|
+
onScrollExtendSelection: (e, t) => {
|
|
2538
|
+
if (!c || l === null) return;
|
|
2539
|
+
let n = p(e, t);
|
|
2540
|
+
n !== null && n !== l && h(l, n);
|
|
2541
|
+
}
|
|
2542
|
+
}), d = R({
|
|
2468
2543
|
currentPage: 1,
|
|
2469
2544
|
totalPages: 1,
|
|
2470
2545
|
visible: !1
|
|
2471
|
-
}),
|
|
2472
|
-
function
|
|
2473
|
-
return
|
|
2546
|
+
}), f = null;
|
|
2547
|
+
function p(t, n) {
|
|
2548
|
+
return Vt(e.pagesRef.value, e.editorView.value, t, n);
|
|
2474
2549
|
}
|
|
2475
|
-
function
|
|
2550
|
+
function m() {
|
|
2476
2551
|
let t = i.value;
|
|
2477
2552
|
if (t?.headerFooter && e.getHfPmView) {
|
|
2478
2553
|
let n = e.getHfPmView(t.headerFooter);
|
|
@@ -2480,42 +2555,42 @@ function Zn(e) {
|
|
|
2480
2555
|
}
|
|
2481
2556
|
return e.editorView.value;
|
|
2482
2557
|
}
|
|
2483
|
-
function
|
|
2484
|
-
let n =
|
|
2558
|
+
function h(e, t) {
|
|
2559
|
+
let n = m();
|
|
2485
2560
|
if (n) try {
|
|
2486
|
-
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a =
|
|
2561
|
+
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = Y.between(r, i);
|
|
2487
2562
|
n.dispatch(n.state.tr.setSelection(a));
|
|
2488
2563
|
} catch {}
|
|
2489
2564
|
}
|
|
2490
|
-
function h(t) {
|
|
2491
|
-
In(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2492
|
-
}
|
|
2493
2565
|
function g(t) {
|
|
2494
|
-
|
|
2566
|
+
Bt(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2495
2567
|
}
|
|
2496
2568
|
function _(t) {
|
|
2497
|
-
|
|
2569
|
+
Ht(e.pagesRef.value, t, h, i.value?.position);
|
|
2498
2570
|
}
|
|
2499
2571
|
function v(t) {
|
|
2572
|
+
Ut(e.pagesRef.value, t, h, i.value?.position);
|
|
2573
|
+
}
|
|
2574
|
+
function y(t) {
|
|
2500
2575
|
let n = e.editorView.value;
|
|
2501
2576
|
if (!n) return;
|
|
2502
2577
|
let r = null;
|
|
2503
2578
|
if (n.state.doc.descendants((e, n) => r === null ? (e.attrs?.bookmarks)?.some((e) => e.name === t) ? (r = n, !1) : !0 : !1), r !== null) {
|
|
2504
|
-
|
|
2579
|
+
g(r);
|
|
2505
2580
|
try {
|
|
2506
|
-
|
|
2581
|
+
h(Math.min(r + 1, n.state.doc.content.size));
|
|
2507
2582
|
} catch {
|
|
2508
|
-
|
|
2583
|
+
h(r);
|
|
2509
2584
|
}
|
|
2510
2585
|
}
|
|
2511
2586
|
}
|
|
2512
|
-
function
|
|
2587
|
+
function b(a) {
|
|
2513
2588
|
if (e.readOnly.value || c) return;
|
|
2514
2589
|
let o = e.pagesRef.value;
|
|
2515
2590
|
if (!o) return;
|
|
2516
2591
|
let s = e.pagesViewportRef.value;
|
|
2517
2592
|
if (!s) return;
|
|
2518
|
-
let l =
|
|
2593
|
+
let l = Mt({
|
|
2519
2594
|
mouseX: a.clientX,
|
|
2520
2595
|
mouseY: a.clientY,
|
|
2521
2596
|
pagesContainer: o,
|
|
@@ -2525,7 +2600,7 @@ function Zn(e) {
|
|
|
2525
2600
|
if (!l) {
|
|
2526
2601
|
n === null && (n = setTimeout(() => {
|
|
2527
2602
|
t.value = null, n = null;
|
|
2528
|
-
},
|
|
2603
|
+
}, jt));
|
|
2529
2604
|
return;
|
|
2530
2605
|
}
|
|
2531
2606
|
let u = s.getBoundingClientRect();
|
|
@@ -2536,27 +2611,26 @@ function Zn(e) {
|
|
|
2536
2611
|
cellPmPos: l.cellPmPos
|
|
2537
2612
|
}, r();
|
|
2538
2613
|
}
|
|
2539
|
-
function
|
|
2614
|
+
function x(n) {
|
|
2540
2615
|
n.preventDefault(), n.stopPropagation();
|
|
2541
2616
|
let r = t.value, i = e.editorView.value;
|
|
2542
2617
|
if (!r || !i) return;
|
|
2543
|
-
let a = i.state.tr.setSelection(
|
|
2618
|
+
let a = i.state.tr.setSelection(Y.create(i.state.doc, r.cellPmPos + 1));
|
|
2544
2619
|
i.dispatch(a);
|
|
2545
2620
|
let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
|
|
2546
2621
|
s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
|
|
2547
2622
|
}
|
|
2548
|
-
function
|
|
2623
|
+
function ee(t) {
|
|
2549
2624
|
let n = t.target?.closest("a[href]");
|
|
2550
2625
|
if (!n) return;
|
|
2551
2626
|
t.preventDefault();
|
|
2552
2627
|
let r = n.getAttribute("href") || "";
|
|
2553
|
-
if (!r) return;
|
|
2554
2628
|
if (r.startsWith("#")) {
|
|
2555
2629
|
let e = r.slice(1);
|
|
2556
|
-
e &&
|
|
2630
|
+
e && y(e);
|
|
2557
2631
|
return;
|
|
2558
2632
|
}
|
|
2559
|
-
let i =
|
|
2633
|
+
let i = m();
|
|
2560
2634
|
if (i && i.state.selection.from !== i.state.selection.to) return;
|
|
2561
2635
|
let a = e.pagesViewportRef.value;
|
|
2562
2636
|
if (!a) return;
|
|
@@ -2571,7 +2645,7 @@ function Zn(e) {
|
|
|
2571
2645
|
}
|
|
2572
2646
|
};
|
|
2573
2647
|
}
|
|
2574
|
-
function
|
|
2648
|
+
function S(t) {
|
|
2575
2649
|
let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
|
|
2576
2650
|
if (!o) return;
|
|
2577
2651
|
let s = r ? "header" : "footer", c = e.getDocument();
|
|
@@ -2647,9 +2721,35 @@ function Zn(e) {
|
|
|
2647
2721
|
}
|
|
2648
2722
|
function ne() {
|
|
2649
2723
|
let t = e.getDocument(), n = i.value;
|
|
2650
|
-
if (!t?.package || !n || !n.rId)
|
|
2651
|
-
|
|
2652
|
-
|
|
2724
|
+
if (!t?.package || !n || !n.rId) {
|
|
2725
|
+
i.value = null;
|
|
2726
|
+
return;
|
|
2727
|
+
}
|
|
2728
|
+
let r = n.position === "header" ? "headers" : "footers", a = n.position === "header" ? "headerReferences" : "footerReferences", o = n.rId, s = new Map(t.package[r] ?? []);
|
|
2729
|
+
s.delete(o);
|
|
2730
|
+
let c = (e) => ({
|
|
2731
|
+
...e,
|
|
2732
|
+
[a]: (e[a] ?? []).filter((e) => e.rId !== o)
|
|
2733
|
+
}), l = (e) => "sectionProperties" in e && e.sectionProperties ? {
|
|
2734
|
+
...e,
|
|
2735
|
+
sectionProperties: c(e.sectionProperties)
|
|
2736
|
+
} : e, u = t.package.document, d = {
|
|
2737
|
+
...t,
|
|
2738
|
+
package: {
|
|
2739
|
+
...t.package,
|
|
2740
|
+
[r]: s,
|
|
2741
|
+
document: u && {
|
|
2742
|
+
...u,
|
|
2743
|
+
content: u.content.map(l),
|
|
2744
|
+
sections: u.sections?.map((e) => ({
|
|
2745
|
+
...e,
|
|
2746
|
+
properties: c(e.properties)
|
|
2747
|
+
})),
|
|
2748
|
+
finalSectionProperties: u.finalSectionProperties ? c(u.finalSectionProperties) : u.finalSectionProperties
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
};
|
|
2752
|
+
i.value = null, e.setDocument?.(d), e.syncHfPMs?.(), e.reLayout(), e.emit("change", d);
|
|
2653
2753
|
}
|
|
2654
2754
|
function re(t) {
|
|
2655
2755
|
if (t.button !== 0 || e.imageInteracting.value) return;
|
|
@@ -2657,15 +2757,15 @@ function Zn(e) {
|
|
|
2657
2757
|
if (!n) return;
|
|
2658
2758
|
let r = t.target;
|
|
2659
2759
|
i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
|
|
2660
|
-
let u =
|
|
2760
|
+
let u = m() ?? n;
|
|
2661
2761
|
if (!e.readOnly.value && e.tableResize.tryStartResize(t, u)) return;
|
|
2662
|
-
let d =
|
|
2762
|
+
let d = Ue(r);
|
|
2663
2763
|
if (d) {
|
|
2664
2764
|
t.preventDefault(), t.stopPropagation();
|
|
2665
2765
|
let n = Number(d.dataset.pmStart);
|
|
2666
2766
|
if (!isNaN(n)) {
|
|
2667
2767
|
try {
|
|
2668
|
-
u.dispatch(u.state.tr.setSelection(
|
|
2768
|
+
u.dispatch(u.state.tr.setSelection(he.create(u.state.doc, n)));
|
|
2669
2769
|
} catch {}
|
|
2670
2770
|
e.selectedImage.value = {
|
|
2671
2771
|
element: d,
|
|
@@ -2678,32 +2778,32 @@ function Zn(e) {
|
|
|
2678
2778
|
return;
|
|
2679
2779
|
}
|
|
2680
2780
|
e.selectedImage.value = null, t.preventDefault();
|
|
2681
|
-
let
|
|
2682
|
-
if (
|
|
2781
|
+
let f = p(t.clientX, t.clientY);
|
|
2782
|
+
if (f === null) {
|
|
2683
2783
|
u.focus();
|
|
2684
2784
|
return;
|
|
2685
2785
|
}
|
|
2686
|
-
let
|
|
2687
|
-
if (
|
|
2688
|
-
else if (s >= 3)
|
|
2786
|
+
let g = Date.now();
|
|
2787
|
+
if (g - a < oi && o === f ? s++ : s = 1, a = g, o = f, s === 2) _(f);
|
|
2788
|
+
else if (s >= 3) v(f), s = 0;
|
|
2689
2789
|
else {
|
|
2690
2790
|
if (t.shiftKey) {
|
|
2691
2791
|
let { from: e } = u.state.selection;
|
|
2692
|
-
|
|
2693
|
-
} else
|
|
2694
|
-
l =
|
|
2792
|
+
h(e, f);
|
|
2793
|
+
} else h(f);
|
|
2794
|
+
l = f, c = !0;
|
|
2695
2795
|
}
|
|
2696
2796
|
u.focus();
|
|
2697
2797
|
}
|
|
2698
|
-
function
|
|
2798
|
+
function w(e) {
|
|
2699
2799
|
if (!c || l === null) return;
|
|
2700
|
-
let t =
|
|
2701
|
-
t !== null && t !== l &&
|
|
2800
|
+
let t = p(e.clientX, e.clientY);
|
|
2801
|
+
t !== null && t !== l && h(l, t), u.updateMousePosition(e.clientX, e.clientY);
|
|
2702
2802
|
}
|
|
2703
|
-
function
|
|
2704
|
-
c = !1;
|
|
2803
|
+
function T() {
|
|
2804
|
+
c = !1, u.stopAutoScroll();
|
|
2705
2805
|
}
|
|
2706
|
-
function
|
|
2806
|
+
function E() {
|
|
2707
2807
|
let t = e.pagesViewportRef.value, n = e.layout.value;
|
|
2708
2808
|
if (!t || !n || n.pages.length === 0) return;
|
|
2709
2809
|
let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
|
|
@@ -2715,34 +2815,34 @@ function Zn(e) {
|
|
|
2715
2815
|
}
|
|
2716
2816
|
o = r + 24, s = e + 2;
|
|
2717
2817
|
}
|
|
2718
|
-
s = Math.min(s, i),
|
|
2818
|
+
s = Math.min(s, i), d.value = {
|
|
2719
2819
|
currentPage: s,
|
|
2720
2820
|
totalPages: i,
|
|
2721
2821
|
visible: !0
|
|
2722
|
-
},
|
|
2723
|
-
|
|
2724
|
-
...
|
|
2822
|
+
}, f && clearTimeout(f), f = setTimeout(() => {
|
|
2823
|
+
d.value = {
|
|
2824
|
+
...d.value,
|
|
2725
2825
|
visible: !1
|
|
2726
2826
|
};
|
|
2727
2827
|
}, 600);
|
|
2728
2828
|
}
|
|
2729
|
-
return
|
|
2730
|
-
window.addEventListener("mousemove",
|
|
2731
|
-
}),
|
|
2732
|
-
r(), window.removeEventListener("mousemove",
|
|
2829
|
+
return ue(() => {
|
|
2830
|
+
window.addEventListener("mousemove", w), window.addEventListener("mouseup", T), e.pagesViewportRef.value?.addEventListener("scroll", E, { passive: !0 });
|
|
2831
|
+
}), I(() => {
|
|
2832
|
+
r(), window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", T), e.pagesViewportRef.value?.removeEventListener("scroll", E), f && clearTimeout(f);
|
|
2733
2833
|
}), {
|
|
2734
2834
|
tableInsertButton: t,
|
|
2735
2835
|
hfEdit: i,
|
|
2736
|
-
scrollPageInfo:
|
|
2737
|
-
resolvePos:
|
|
2738
|
-
setPmSelection:
|
|
2739
|
-
scrollVisiblePositionIntoView:
|
|
2740
|
-
navigateToBookmark:
|
|
2836
|
+
scrollPageInfo: d,
|
|
2837
|
+
resolvePos: p,
|
|
2838
|
+
setPmSelection: h,
|
|
2839
|
+
scrollVisiblePositionIntoView: g,
|
|
2840
|
+
navigateToBookmark: y,
|
|
2741
2841
|
handlePagesMouseDown: re,
|
|
2742
|
-
handlePagesMouseMove:
|
|
2743
|
-
handlePagesClick:
|
|
2744
|
-
handlePagesDoubleClick:
|
|
2745
|
-
handleTableInsertClick:
|
|
2842
|
+
handlePagesMouseMove: b,
|
|
2843
|
+
handlePagesClick: ee,
|
|
2844
|
+
handlePagesDoubleClick: S,
|
|
2845
|
+
handleTableInsertClick: x,
|
|
2746
2846
|
clearTableInsertTimer: r,
|
|
2747
2847
|
handleHfSave: te,
|
|
2748
2848
|
handleHfRemove: ne
|
|
@@ -2750,52 +2850,55 @@ function Zn(e) {
|
|
|
2750
2850
|
}
|
|
2751
2851
|
//#endregion
|
|
2752
2852
|
//#region src/composables/useSelectionSync.ts
|
|
2753
|
-
function
|
|
2754
|
-
let t = null, n = null;
|
|
2755
|
-
function
|
|
2853
|
+
function ci(e) {
|
|
2854
|
+
let t = null, n = null, r = null;
|
|
2855
|
+
function i() {
|
|
2756
2856
|
let r = e.pagesRef.value;
|
|
2757
2857
|
r && (r.querySelectorAll(".vue-sel-rect, .vue-caret").forEach((e) => e.remove()), t !== null && (clearInterval(t), t = null), n = null);
|
|
2758
2858
|
}
|
|
2759
|
-
function
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
let
|
|
2765
|
-
|
|
2766
|
-
let n =
|
|
2767
|
-
if (
|
|
2768
|
-
t =
|
|
2769
|
-
|
|
2859
|
+
function a() {
|
|
2860
|
+
r !== null && cancelAnimationFrame(r), r = requestAnimationFrame(() => {
|
|
2861
|
+
r = null;
|
|
2862
|
+
let t = e.pagesRef.value, n = e.editorView.value;
|
|
2863
|
+
if (!t || !n || e.isHfEditing?.value) return;
|
|
2864
|
+
let i = n.state.selection;
|
|
2865
|
+
if (i instanceof he && i.node.type.name === "image") {
|
|
2866
|
+
let n = ye(t, i.from), r = n ? Ue(n) : null;
|
|
2867
|
+
if (r) {
|
|
2868
|
+
let t = e.selectedImage.value;
|
|
2869
|
+
(!t || t.element !== r || t.pmPos !== i.from || t.width !== r.offsetWidth || t.height !== r.offsetHeight) && (e.selectedImage.value = {
|
|
2870
|
+
element: r,
|
|
2871
|
+
pmPos: i.from,
|
|
2872
|
+
width: r.offsetWidth,
|
|
2873
|
+
height: r.offsetHeight
|
|
2874
|
+
});
|
|
2875
|
+
return;
|
|
2770
2876
|
}
|
|
2771
2877
|
}
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
let { from: s, to: c, empty: l } = a.state.selection, u = i.scrollTop, d = i.scrollLeft;
|
|
2785
|
-
if (l) {
|
|
2786
|
-
let e = Ee(i, s, i.getBoundingClientRect());
|
|
2878
|
+
e.imageInteracting?.value || (e.selectedImage.value = null);
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
function o() {
|
|
2882
|
+
let r = e.pagesRef.value, o = e.editorView.value;
|
|
2883
|
+
if (!r || !o || (i(), e.isHfEditing?.value)) return;
|
|
2884
|
+
a(), ge(r, o.state);
|
|
2885
|
+
let s = o.state.selection;
|
|
2886
|
+
if (s instanceof he && s.node.type.name === "image") return;
|
|
2887
|
+
let { from: c, to: l, empty: u } = s, d = r.scrollTop, f = r.scrollLeft, p = e.zoom.value || 1;
|
|
2888
|
+
if (u) {
|
|
2889
|
+
let e = Fe(r, c, r.getBoundingClientRect());
|
|
2787
2890
|
if (e) {
|
|
2788
|
-
let
|
|
2789
|
-
|
|
2891
|
+
let i = document.createElement("div");
|
|
2892
|
+
i.className = "vue-caret", i.style.cssText = `
|
|
2790
2893
|
position: absolute;
|
|
2791
|
-
left: ${e.x +
|
|
2792
|
-
top: ${e.y +
|
|
2894
|
+
left: ${e.x / p + f}px;
|
|
2895
|
+
top: ${e.y / p + d}px;
|
|
2793
2896
|
width: 2px;
|
|
2794
2897
|
height: ${e.height}px;
|
|
2795
2898
|
background: #000;
|
|
2796
2899
|
pointer-events: none;
|
|
2797
|
-
z-index: ${
|
|
2798
|
-
`,
|
|
2900
|
+
z-index: ${S.selectionOverlay};
|
|
2901
|
+
`, r.appendChild(i), n = i;
|
|
2799
2902
|
let a = !0;
|
|
2800
2903
|
t = setInterval(() => {
|
|
2801
2904
|
a = !a, n && (n.style.opacity = a ? "1" : "0");
|
|
@@ -2803,31 +2906,31 @@ function Qn(e) {
|
|
|
2803
2906
|
}
|
|
2804
2907
|
return;
|
|
2805
2908
|
}
|
|
2806
|
-
let
|
|
2807
|
-
for (let e of
|
|
2909
|
+
let m = Ie(r, c, l, r.getBoundingClientRect());
|
|
2910
|
+
for (let e of m) {
|
|
2808
2911
|
let t = document.createElement("div");
|
|
2809
2912
|
t.className = "vue-sel-rect", t.style.cssText = `
|
|
2810
2913
|
position: absolute;
|
|
2811
|
-
left: ${e.x +
|
|
2812
|
-
top: ${e.y +
|
|
2813
|
-
width: ${e.width}px;
|
|
2814
|
-
height: ${e.height}px;
|
|
2914
|
+
left: ${e.x / p + f}px;
|
|
2915
|
+
top: ${e.y / p + d}px;
|
|
2916
|
+
width: ${e.width / p}px;
|
|
2917
|
+
height: ${e.height / p}px;
|
|
2815
2918
|
background: rgba(66, 133, 244, 0.3);
|
|
2816
2919
|
pointer-events: none;
|
|
2817
|
-
z-index: ${
|
|
2818
|
-
`,
|
|
2920
|
+
z-index: ${S.selectionOverlay};
|
|
2921
|
+
`, r.appendChild(t);
|
|
2819
2922
|
}
|
|
2820
2923
|
}
|
|
2821
|
-
return
|
|
2822
|
-
r();
|
|
2924
|
+
return I(() => {
|
|
2925
|
+
r !== null && cancelAnimationFrame(r), i();
|
|
2823
2926
|
}), {
|
|
2824
|
-
clearOverlay:
|
|
2825
|
-
updateSelectionOverlay:
|
|
2927
|
+
clearOverlay: i,
|
|
2928
|
+
updateSelectionOverlay: o
|
|
2826
2929
|
};
|
|
2827
2930
|
}
|
|
2828
2931
|
//#endregion
|
|
2829
2932
|
//#region src/composables/useMenuActions.ts
|
|
2830
|
-
function
|
|
2933
|
+
function li(e) {
|
|
2831
2934
|
function t(t) {
|
|
2832
2935
|
let n = e.editorView.value;
|
|
2833
2936
|
if (!n) return;
|
|
@@ -2851,6 +2954,9 @@ function $n(e) {
|
|
|
2851
2954
|
case "pageSetup":
|
|
2852
2955
|
e.showPageSetup.value = !0;
|
|
2853
2956
|
break;
|
|
2957
|
+
case "watermark":
|
|
2958
|
+
e.showWatermark.value = !0;
|
|
2959
|
+
break;
|
|
2854
2960
|
case "clearFormatting":
|
|
2855
2961
|
e.handleClearFormatting();
|
|
2856
2962
|
break;
|
|
@@ -2879,7 +2985,7 @@ function $n(e) {
|
|
|
2879
2985
|
e.showKeyboardShortcuts.value = !0;
|
|
2880
2986
|
break;
|
|
2881
2987
|
case "reportIssue":
|
|
2882
|
-
|
|
2988
|
+
Nt();
|
|
2883
2989
|
break;
|
|
2884
2990
|
case "dirLTR":
|
|
2885
2991
|
t("setLtr");
|
|
@@ -2897,18 +3003,18 @@ function $n(e) {
|
|
|
2897
3003
|
}
|
|
2898
3004
|
//#endregion
|
|
2899
3005
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2900
|
-
function
|
|
3006
|
+
function ui(e) {
|
|
2901
3007
|
async function t(t) {
|
|
2902
3008
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2903
3009
|
}
|
|
2904
3010
|
function n(t) {
|
|
2905
3011
|
e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
|
|
2906
3012
|
}
|
|
2907
|
-
|
|
3013
|
+
G(e.documentBuffer, (e) => {
|
|
2908
3014
|
e && t(e);
|
|
2909
|
-
}),
|
|
3015
|
+
}), G(e.document, (e) => {
|
|
2910
3016
|
e && n(e);
|
|
2911
|
-
}),
|
|
3017
|
+
}), ue(async () => {
|
|
2912
3018
|
await ce();
|
|
2913
3019
|
let r = e.documentBuffer(), i = e.document();
|
|
2914
3020
|
r ? await t(r) : i && n(i);
|
|
@@ -2916,10 +3022,10 @@ function er(e) {
|
|
|
2916
3022
|
}
|
|
2917
3023
|
//#endregion
|
|
2918
3024
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2919
|
-
function
|
|
3025
|
+
function di(e) {
|
|
2920
3026
|
function t() {
|
|
2921
3027
|
let t = e.pagesRef.value;
|
|
2922
|
-
t &&
|
|
3028
|
+
t && Ge(t), e.onPrint?.(), window.print();
|
|
2923
3029
|
}
|
|
2924
3030
|
function n() {
|
|
2925
3031
|
t();
|
|
@@ -2953,41 +3059,41 @@ function tr(e) {
|
|
|
2953
3059
|
function c() {
|
|
2954
3060
|
let t = e.layout.value, n = e.editorView.value;
|
|
2955
3061
|
if (!t || !n) return 0;
|
|
2956
|
-
let r =
|
|
3062
|
+
let r = ot(t, n.state.selection.from);
|
|
2957
3063
|
return r == null ? 0 : r + 1;
|
|
2958
3064
|
}
|
|
2959
3065
|
function l(t) {
|
|
2960
3066
|
let n = e.editorView.value;
|
|
2961
3067
|
if (!n) return !1;
|
|
2962
|
-
let r =
|
|
3068
|
+
let r = Ft(n.state.doc, t);
|
|
2963
3069
|
return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
|
|
2964
3070
|
}
|
|
2965
3071
|
function u(t, n) {
|
|
2966
|
-
return
|
|
3072
|
+
return xe(e.editorView.value, t, n);
|
|
2967
3073
|
}
|
|
2968
3074
|
function d() {
|
|
2969
|
-
return
|
|
3075
|
+
return Ce(e.editorView.value);
|
|
2970
3076
|
}
|
|
2971
3077
|
function f() {
|
|
2972
3078
|
return e.comments.value;
|
|
2973
3079
|
}
|
|
2974
3080
|
function p(t) {
|
|
2975
3081
|
let n = e.editorView.value;
|
|
2976
|
-
return n ?
|
|
3082
|
+
return n ? Ze(n.state.doc, t ?? {}) : [];
|
|
2977
3083
|
}
|
|
2978
3084
|
function m(t) {
|
|
2979
3085
|
let n = e.editorView.value;
|
|
2980
3086
|
if (!n) return !1;
|
|
2981
|
-
let r =
|
|
3087
|
+
let r = Xe(n.state.doc, t);
|
|
2982
3088
|
return r == null ? !1 : (a(r), !0);
|
|
2983
3089
|
}
|
|
2984
3090
|
function h(t, n, r) {
|
|
2985
3091
|
let i = e.editorView.value;
|
|
2986
3092
|
if (!i) return !1;
|
|
2987
3093
|
try {
|
|
2988
|
-
return i.dispatch(
|
|
3094
|
+
return i.dispatch(tt(i.state, t, n, r)), !0;
|
|
2989
3095
|
} catch (e) {
|
|
2990
|
-
if (e instanceof
|
|
3096
|
+
if (e instanceof Pt) return !1;
|
|
2991
3097
|
throw e;
|
|
2992
3098
|
}
|
|
2993
3099
|
}
|
|
@@ -2995,9 +3101,9 @@ function tr(e) {
|
|
|
2995
3101
|
let r = e.editorView.value;
|
|
2996
3102
|
if (!r) return !1;
|
|
2997
3103
|
try {
|
|
2998
|
-
return r.dispatch(
|
|
3104
|
+
return r.dispatch(Qe(r.state, t, n)), !0;
|
|
2999
3105
|
} catch (e) {
|
|
3000
|
-
if (e instanceof
|
|
3106
|
+
if (e instanceof Pt) return !1;
|
|
3001
3107
|
throw e;
|
|
3002
3108
|
}
|
|
3003
3109
|
}
|
|
@@ -3005,14 +3111,14 @@ function tr(e) {
|
|
|
3005
3111
|
let i = e.editorView.value;
|
|
3006
3112
|
if (!i) return !1;
|
|
3007
3113
|
try {
|
|
3008
|
-
return i.dispatch(
|
|
3114
|
+
return i.dispatch(nt(i.state, t, n, r)), !0;
|
|
3009
3115
|
} catch (e) {
|
|
3010
|
-
if (e instanceof
|
|
3116
|
+
if (e instanceof Pt) return !1;
|
|
3011
3117
|
throw e;
|
|
3012
3118
|
}
|
|
3013
3119
|
}
|
|
3014
3120
|
function v(t) {
|
|
3015
|
-
return
|
|
3121
|
+
return Se(e.editorView.value, e.layout.value, t);
|
|
3016
3122
|
}
|
|
3017
3123
|
function y(t) {
|
|
3018
3124
|
return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
|
|
@@ -3059,25 +3165,25 @@ function tr(e) {
|
|
|
3059
3165
|
}
|
|
3060
3166
|
//#endregion
|
|
3061
3167
|
//#region src/composables/useFontLifecycle.ts
|
|
3062
|
-
function
|
|
3063
|
-
|
|
3064
|
-
|
|
3168
|
+
function fi(e, t) {
|
|
3169
|
+
G(e, (e) => {
|
|
3170
|
+
Ee(e);
|
|
3065
3171
|
}, { immediate: !0 });
|
|
3066
|
-
let n =
|
|
3067
|
-
|
|
3172
|
+
let n = De(t);
|
|
3173
|
+
I(() => n());
|
|
3068
3174
|
}
|
|
3069
3175
|
//#endregion
|
|
3070
3176
|
//#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
|
|
3071
|
-
var
|
|
3177
|
+
var pi = { class: "docx-editor-vue__toolbar-shell" }, mi = {
|
|
3072
3178
|
key: 0,
|
|
3073
3179
|
class: "docx-editor-vue__error"
|
|
3074
|
-
},
|
|
3180
|
+
}, hi = {
|
|
3075
3181
|
key: 1,
|
|
3076
3182
|
class: "docx-editor-vue__loading"
|
|
3077
|
-
},
|
|
3183
|
+
}, gi = { class: "docx-editor-vue__editor-area" }, _i = {
|
|
3078
3184
|
key: 0,
|
|
3079
3185
|
class: "docx-editor-vue__vertical-ruler"
|
|
3080
|
-
},
|
|
3186
|
+
}, vi = ["title"], yi = ["title", "aria-label"], bi = /* @__PURE__ */ N({
|
|
3081
3187
|
__name: "DocxEditor",
|
|
3082
3188
|
props: {
|
|
3083
3189
|
documentBuffer: { default: null },
|
|
@@ -3169,44 +3275,60 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3169
3275
|
"mode-change"
|
|
3170
3276
|
],
|
|
3171
3277
|
setup(e, { expose: n, emit: r }) {
|
|
3172
|
-
let i = e, a = r, o =
|
|
3173
|
-
f(
|
|
3174
|
-
let { t: l } = t(
|
|
3175
|
-
|
|
3176
|
-
let { editorView:
|
|
3278
|
+
let i = e, a = r, o = R(i.mode), s = E(() => i.readOnly || o.value === "viewing");
|
|
3279
|
+
f(E(() => i.i18n));
|
|
3280
|
+
let { t: l } = t(E(() => i.i18n)), u = R(null), d = R(null), g = R(null), y = R(0), x = /* @__PURE__ */ new Set(), ee = /* @__PURE__ */ new Set(), S = new Je(), C = R(!1), T = R(!1), ie = R(!1), oe = R(!1), j = R(!1), N = R(!1), P = R(i.showOutline), pe = R(!1), U = R(!1), W = R(!1), K = R(null), q = B([]), he = B([]), ge = B([]), { zoom: X, zoomPercent: ye, isMinZoom: be, isMaxZoom: xe, setZoom: Se, zoomIn: Te, zoomOut: Ee, handleWheel: De, handleKeyDown: Oe, installShortcuts: ke, ZOOM_PRESETS: Ae } = re(i.initialZoom);
|
|
3281
|
+
ke();
|
|
3282
|
+
let { editorView: Z, isReady: Me, parseError: Ne, layout: Pe, loadBuffer: Fe, loadDocument: Ie, save: Le, focus: Re, destroy: ze, getDocument: Q, getCommands: Be, reLayout: Ve, getHfPmView: He, syncHfPMs: Ue, setHfTransactionListener: We, setDocument: Ge } = te({
|
|
3177
3283
|
hiddenContainer: u,
|
|
3178
3284
|
pagesContainer: d,
|
|
3179
3285
|
readOnly: s,
|
|
3180
3286
|
externalPlugins: i.externalPlugins,
|
|
3181
|
-
syncCoordinator:
|
|
3287
|
+
syncCoordinator: S,
|
|
3182
3288
|
editorMode: o,
|
|
3183
3289
|
onChange: (e) => {
|
|
3184
3290
|
a("change", e), a("update:document", e), x.forEach((t) => t(e));
|
|
3185
3291
|
},
|
|
3186
3292
|
onError: (e) => a("error", e),
|
|
3187
3293
|
onSelectionUpdate: () => {
|
|
3188
|
-
y.value++,
|
|
3189
|
-
let e =
|
|
3294
|
+
y.value++, er();
|
|
3295
|
+
let e = Ce(Z.value);
|
|
3190
3296
|
ee.forEach((t) => t(e));
|
|
3191
3297
|
}
|
|
3192
|
-
}),
|
|
3298
|
+
}), Ke = E(() => {
|
|
3193
3299
|
y.value;
|
|
3194
|
-
let e =
|
|
3300
|
+
let e = Q();
|
|
3195
3301
|
if (!e?.package?.document) return null;
|
|
3196
3302
|
let t = e.package.document;
|
|
3197
3303
|
return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
|
|
3198
|
-
}),
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3304
|
+
}), qe = E(() => {
|
|
3305
|
+
y.value;
|
|
3306
|
+
let e = Z.value, t = e ? je(e.state).paragraphFormatting : {};
|
|
3307
|
+
return {
|
|
3308
|
+
indentLeft: t.indentLeft ?? 0,
|
|
3309
|
+
indentRight: t.indentRight ?? 0,
|
|
3310
|
+
firstLineIndent: t.indentFirstLine ?? 0,
|
|
3311
|
+
hangingIndent: t.hangingIndent ?? !1,
|
|
3312
|
+
tabStops: t.tabs ?? null
|
|
3313
|
+
};
|
|
3314
|
+
}), Ye = E(() => (y.value, Q()?.package?.theme ?? i.theme ?? null)), Xe = R(null), Ze = R([]);
|
|
3315
|
+
function Qe(e, t) {
|
|
3316
|
+
Xe.value = _e(e, t), Ze.value = ve(e, t);
|
|
3317
|
+
}
|
|
3318
|
+
function $e() {
|
|
3319
|
+
Xe.value = null, Ze.value = [];
|
|
3320
|
+
}
|
|
3321
|
+
fi(() => i.fonts, (e) => a("error", e));
|
|
3322
|
+
let et = E(() => $.value?.headerFooter ? He($.value.headerFooter) ?? null : null);
|
|
3323
|
+
ue(() => {
|
|
3324
|
+
We((e, t) => {
|
|
3203
3325
|
requestAnimationFrame(() => {
|
|
3204
|
-
Ge.value = he(t);
|
|
3205
3326
|
let e = $.value;
|
|
3206
3327
|
if (!e) return;
|
|
3207
|
-
|
|
3328
|
+
Qe(t, e.position);
|
|
3329
|
+
let n = Rt(e.position), r = g.value;
|
|
3208
3330
|
if (!n || !r) return;
|
|
3209
|
-
let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o =
|
|
3331
|
+
let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = X.value || 1;
|
|
3210
3332
|
$.value = {
|
|
3211
3333
|
...e,
|
|
3212
3334
|
targetRect: {
|
|
@@ -3217,20 +3339,20 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3217
3339
|
}
|
|
3218
3340
|
};
|
|
3219
3341
|
});
|
|
3220
|
-
}),
|
|
3342
|
+
}), G(() => $.value, (e) => {
|
|
3221
3343
|
if (!e) {
|
|
3222
|
-
|
|
3344
|
+
$e();
|
|
3223
3345
|
return;
|
|
3224
3346
|
}
|
|
3225
|
-
let t =
|
|
3347
|
+
let t = Z.value;
|
|
3226
3348
|
if (t) {
|
|
3227
3349
|
try {
|
|
3228
|
-
let e = t.state.tr.setSelection(
|
|
3350
|
+
let e = t.state.tr.setSelection(Y.create(t.state.doc, 0));
|
|
3229
3351
|
t.dispatch(e);
|
|
3230
3352
|
} catch {}
|
|
3231
3353
|
t.dom.blur?.();
|
|
3232
3354
|
}
|
|
3233
|
-
|
|
3355
|
+
tr.updateSelectionOverlay();
|
|
3234
3356
|
});
|
|
3235
3357
|
let e = 0;
|
|
3236
3358
|
function t() {
|
|
@@ -3238,35 +3360,35 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3238
3360
|
e = 0;
|
|
3239
3361
|
let t = $.value;
|
|
3240
3362
|
if (!t?.headerFooter) return;
|
|
3241
|
-
let n =
|
|
3242
|
-
n && (
|
|
3363
|
+
let n = He(t.headerFooter);
|
|
3364
|
+
n && Qe(n, t.position);
|
|
3243
3365
|
}));
|
|
3244
3366
|
}
|
|
3245
|
-
window.addEventListener("scroll", t, !0), window.addEventListener("resize", t),
|
|
3367
|
+
window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), I(() => {
|
|
3246
3368
|
e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
|
|
3247
3369
|
});
|
|
3248
3370
|
});
|
|
3249
|
-
let
|
|
3371
|
+
let tt = E(() => {
|
|
3250
3372
|
let e = [];
|
|
3251
|
-
return
|
|
3373
|
+
return U.value && e.push(`translateX(-${we}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
|
|
3252
3374
|
transform: e.length > 0 ? e.join(" ") : void 0,
|
|
3253
3375
|
transformOrigin: "top center",
|
|
3254
3376
|
transition: "transform 0.2s ease"
|
|
3255
3377
|
};
|
|
3256
|
-
}),
|
|
3378
|
+
}), nt = E(() => ({
|
|
3257
3379
|
paddingLeft: "20px",
|
|
3258
|
-
paddingRight: 20 + (
|
|
3380
|
+
paddingRight: 20 + (U.value ? we * 2 : 0) + "px",
|
|
3259
3381
|
transition: "padding 0.2s ease"
|
|
3260
|
-
})),
|
|
3261
|
-
let e =
|
|
3262
|
-
return
|
|
3263
|
-
}),
|
|
3382
|
+
})), it = E(() => {
|
|
3383
|
+
let e = Ke.value;
|
|
3384
|
+
return rt(e?.pageWidth ?? 12240) * X.value;
|
|
3385
|
+
}), at = E(() => {
|
|
3264
3386
|
let e = /* @__PURE__ */ new Set();
|
|
3265
|
-
for (let t of
|
|
3387
|
+
for (let t of q.value) t.parentId == null && t.done && e.add(t.id);
|
|
3266
3388
|
return e;
|
|
3267
|
-
}),
|
|
3389
|
+
}), ot = E(() => {
|
|
3268
3390
|
y.value;
|
|
3269
|
-
let e =
|
|
3391
|
+
let e = Z.value;
|
|
3270
3392
|
if (!e) return [];
|
|
3271
3393
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
3272
3394
|
return e.state.doc.descendants((e) => {
|
|
@@ -3281,205 +3403,214 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3281
3403
|
}
|
|
3282
3404
|
return !0;
|
|
3283
3405
|
}), n.sort((e, t) => e.name.localeCompare(t.name));
|
|
3284
|
-
}), { floatingCommentBtn:
|
|
3285
|
-
editorView:
|
|
3286
|
-
getDocument:
|
|
3287
|
-
comments:
|
|
3288
|
-
trackedChanges:
|
|
3289
|
-
resolvedCommentIds:
|
|
3290
|
-
activeSidebarItem:
|
|
3291
|
-
showSidebar:
|
|
3292
|
-
isAddingComment:
|
|
3406
|
+
}), st = Ot(), { floatingCommentBtn: ct, pendingCommentRange: lt, addCommentYPosition: ut, sidebarAutoOpenedRef: dt, extractCommentsAndChanges: ft, handleAddComment: pt, handleCancelAddComment: mt, handleStartAddComment: ht, handleMarkerClick: gt } = Xr({
|
|
3407
|
+
editorView: Z,
|
|
3408
|
+
getDocument: Q,
|
|
3409
|
+
comments: q,
|
|
3410
|
+
trackedChanges: he,
|
|
3411
|
+
resolvedCommentIds: at,
|
|
3412
|
+
activeSidebarItem: K,
|
|
3413
|
+
showSidebar: U,
|
|
3414
|
+
isAddingComment: W,
|
|
3293
3415
|
readOnly: s,
|
|
3294
|
-
zoom:
|
|
3416
|
+
zoom: X,
|
|
3295
3417
|
stateTick: y,
|
|
3296
3418
|
pagesRef: d,
|
|
3297
3419
|
pagesViewportRef: g,
|
|
3298
|
-
emit: a
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3420
|
+
emit: a,
|
|
3421
|
+
commentIdAllocator: st
|
|
3422
|
+
}), { docxInputRef: _t, handleDocxFileChange: vt, handleDocumentNameChange: yt, downloadCurrentDocument: bt, loadDocumentBuffer: xt, loadDocument: St, save: Ct } = Hr({
|
|
3423
|
+
loadBuffer: Fe,
|
|
3424
|
+
loadParsedDocument: Ie,
|
|
3425
|
+
getDocument: Q,
|
|
3426
|
+
saveBlob: Le,
|
|
3427
|
+
extractCommentsAndChanges: ft,
|
|
3305
3428
|
emit: a,
|
|
3306
3429
|
documentName: () => i.documentName,
|
|
3307
3430
|
onDocumentNameChange: i.onDocumentNameChange,
|
|
3308
3431
|
nextTick: ce
|
|
3309
|
-
}), { hyperlinkPopupData:
|
|
3310
|
-
editorView:
|
|
3311
|
-
getCommands:
|
|
3312
|
-
}), { handleClearFormatting:
|
|
3313
|
-
editorView:
|
|
3314
|
-
getDocument:
|
|
3315
|
-
}), { handlePageSetupApply:
|
|
3316
|
-
editorView:
|
|
3317
|
-
getDocument:
|
|
3432
|
+
}), { hyperlinkPopupData: wt, handleHyperlinkSubmit: Tt, handleHyperlinkRemove: Et, handleHyperlinkPopupNavigate: Dt, handleHyperlinkPopupEdit: kt, handleHyperlinkPopupRemove: At } = Ur({
|
|
3433
|
+
editorView: Z,
|
|
3434
|
+
getCommands: Be
|
|
3435
|
+
}), { handleClearFormatting: jt, handleApplyStyle: Mt, handleInsertPageBreak: Nt, handleInsertSymbol: Pt, applyFormatting: Ft, setParagraphStyle: It } = Wr({
|
|
3436
|
+
editorView: Z,
|
|
3437
|
+
getDocument: Q
|
|
3438
|
+
}), { handlePageSetupApply: Lt, handleLeftMarginChange: zt, handleRightMarginChange: Bt, handleTopMarginChange: Vt, handleBottomMarginChange: Ht, handleIndentLeftChange: Ut, handleIndentRightChange: Gt, handleFirstLineIndentChange: Kt, handleTabStopRemove: qt } = Gr({
|
|
3439
|
+
editorView: Z,
|
|
3440
|
+
getDocument: Q,
|
|
3318
3441
|
readOnly: s,
|
|
3319
3442
|
stateTick: y,
|
|
3320
|
-
reLayout:
|
|
3443
|
+
reLayout: Ve,
|
|
3321
3444
|
emit: a
|
|
3322
|
-
}), {
|
|
3323
|
-
editorView:
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3445
|
+
}), { showWatermark: Jt, currentWatermark: Yt, handleWatermarkApply: Xt } = Kr({
|
|
3446
|
+
editorView: Z,
|
|
3447
|
+
readOnly: s,
|
|
3448
|
+
stateTick: y
|
|
3449
|
+
}), { handleToggleOutline: Qt, handleOutlineNavigate: $t, handleToggleSidebar: en, handleEditorScrollMouseDown: tn } = qr({
|
|
3450
|
+
editorView: Z,
|
|
3451
|
+
showOutline: P,
|
|
3452
|
+
showSidebar: U,
|
|
3453
|
+
outlineHeadings: ge,
|
|
3454
|
+
activeSidebarItem: K,
|
|
3455
|
+
extractCommentsAndChanges: ft
|
|
3329
3456
|
});
|
|
3330
|
-
|
|
3331
|
-
showKeyboardShortcuts:
|
|
3457
|
+
Jr({
|
|
3458
|
+
showKeyboardShortcuts: pe,
|
|
3332
3459
|
showFindReplace: C,
|
|
3333
3460
|
showHyperlink: ie,
|
|
3334
|
-
handleZoomKeyDown:
|
|
3461
|
+
handleZoomKeyDown: Oe,
|
|
3335
3462
|
disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
|
|
3336
3463
|
});
|
|
3337
|
-
let { addComment:
|
|
3338
|
-
editorView:
|
|
3339
|
-
getDocument:
|
|
3340
|
-
comments:
|
|
3341
|
-
trackedChanges:
|
|
3342
|
-
showSidebar:
|
|
3343
|
-
isAddingComment:
|
|
3344
|
-
pendingCommentRange:
|
|
3464
|
+
let { addComment: an, replyToComment: on, resolveComment: cn, proposeChange: ln, handleCommentReply: un, handleCommentUnresolve: dn, handleCommentDelete: pn, handleAcceptChange: mn, handleRejectChange: hn, handleAcceptChangeById: gn, handleRejectChangeById: vn, handleTrackedChangeReply: yn } = Yr({
|
|
3465
|
+
editorView: Z,
|
|
3466
|
+
getDocument: Q,
|
|
3467
|
+
comments: q,
|
|
3468
|
+
trackedChanges: he,
|
|
3469
|
+
showSidebar: U,
|
|
3470
|
+
isAddingComment: W,
|
|
3471
|
+
pendingCommentRange: lt,
|
|
3345
3472
|
contentChangeSubscribers: x,
|
|
3346
|
-
extractCommentsAndChanges:
|
|
3347
|
-
emit: a
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3473
|
+
extractCommentsAndChanges: ft,
|
|
3474
|
+
emit: a,
|
|
3475
|
+
commentIdAllocator: st
|
|
3476
|
+
}), { selectedImage: bn, imageInteracting: xn, imageToolbarContext: Sn, handleInsertImage: Cn, handleToolbarImageWrap: wn, handleImageTransform: Tn } = Zr({
|
|
3477
|
+
editorView: Z,
|
|
3478
|
+
zoom: X,
|
|
3351
3479
|
stateTick: y,
|
|
3352
|
-
getCommands:
|
|
3353
|
-
}),
|
|
3354
|
-
editorView:
|
|
3480
|
+
getCommands: Be
|
|
3481
|
+
}), En = ne(), Dn = null, { tableInsertButton: On, hfEdit: $, scrollPageInfo: kn, resolvePos: An, setPmSelection: jn, scrollVisiblePositionIntoView: Mn, handlePagesMouseDown: Nn, handlePagesMouseMove: Pn, handlePagesClick: Fn, handlePagesDoubleClick: In, handleTableInsertClick: Ln, clearTableInsertTimer: Rn, handleHfSave: zn, handleHfRemove: Bn } = si({
|
|
3482
|
+
editorView: Z,
|
|
3355
3483
|
pagesRef: d,
|
|
3356
3484
|
pagesViewportRef: g,
|
|
3357
|
-
selectedImage:
|
|
3358
|
-
imageInteracting:
|
|
3359
|
-
hyperlinkPopupData:
|
|
3485
|
+
selectedImage: bn,
|
|
3486
|
+
imageInteracting: xn,
|
|
3487
|
+
hyperlinkPopupData: wt,
|
|
3360
3488
|
readOnly: s,
|
|
3361
|
-
zoom:
|
|
3362
|
-
layout:
|
|
3363
|
-
tableResize:
|
|
3364
|
-
getCommands:
|
|
3365
|
-
getDocument:
|
|
3366
|
-
reLayout:
|
|
3489
|
+
zoom: X,
|
|
3490
|
+
layout: Pe,
|
|
3491
|
+
tableResize: En,
|
|
3492
|
+
getCommands: Be,
|
|
3493
|
+
getDocument: Q,
|
|
3494
|
+
reLayout: Ve,
|
|
3367
3495
|
emit: a,
|
|
3368
|
-
clearOverlay:
|
|
3369
|
-
syncHfPMs:
|
|
3370
|
-
getHfPmView:
|
|
3371
|
-
setDocument:
|
|
3372
|
-
}), { contextMenu:
|
|
3373
|
-
editorView:
|
|
3374
|
-
selectedImage:
|
|
3375
|
-
zoom:
|
|
3496
|
+
clearOverlay: $n,
|
|
3497
|
+
syncHfPMs: Ue,
|
|
3498
|
+
getHfPmView: He,
|
|
3499
|
+
setDocument: Ge
|
|
3500
|
+
}), { contextMenu: Vn, imageContextMenu: Hn, imageContextMenuTextActions: Un, handleContextMenu: Wn, handleSelectedImageContextMenu: Gn, handleImageWrapSelect: Kn, handleContextMenuAction: qn } = ai({
|
|
3501
|
+
editorView: Z,
|
|
3502
|
+
selectedImage: bn,
|
|
3503
|
+
zoom: X,
|
|
3376
3504
|
showImageProperties: j,
|
|
3377
|
-
getCommands:
|
|
3378
|
-
clearOverlay:
|
|
3379
|
-
setPmSelection:
|
|
3380
|
-
resolvePos:
|
|
3381
|
-
}), { handleMenuAction:
|
|
3382
|
-
editorView:
|
|
3383
|
-
getCommands:
|
|
3384
|
-
docxInputRef:
|
|
3385
|
-
showPageSetup:
|
|
3386
|
-
|
|
3505
|
+
getCommands: Be,
|
|
3506
|
+
clearOverlay: $n,
|
|
3507
|
+
setPmSelection: jn,
|
|
3508
|
+
resolvePos: An
|
|
3509
|
+
}), { handleMenuAction: Jn, handleMenuTableInsert: Yn } = li({
|
|
3510
|
+
editorView: Z,
|
|
3511
|
+
getCommands: Be,
|
|
3512
|
+
docxInputRef: _t,
|
|
3513
|
+
showPageSetup: N,
|
|
3514
|
+
showWatermark: Jt,
|
|
3515
|
+
showInsertImage: T,
|
|
3387
3516
|
showHyperlink: ie,
|
|
3388
3517
|
showInsertSymbol: oe,
|
|
3389
|
-
showKeyboardShortcuts:
|
|
3390
|
-
handleClearFormatting:
|
|
3391
|
-
handleInsertPageBreak:
|
|
3392
|
-
handleToggleOutline:
|
|
3393
|
-
handleToggleSidebar:
|
|
3394
|
-
downloadCurrentDocument:
|
|
3518
|
+
showKeyboardShortcuts: pe,
|
|
3519
|
+
handleClearFormatting: jt,
|
|
3520
|
+
handleInsertPageBreak: Nt,
|
|
3521
|
+
handleToggleOutline: Qt,
|
|
3522
|
+
handleToggleSidebar: en,
|
|
3523
|
+
downloadCurrentDocument: bt,
|
|
3395
3524
|
emit: a
|
|
3396
3525
|
});
|
|
3397
|
-
|
|
3526
|
+
ui({
|
|
3398
3527
|
documentBuffer: () => i.documentBuffer,
|
|
3399
3528
|
document: () => i.document,
|
|
3400
|
-
loadDocumentBuffer:
|
|
3401
|
-
loadDocument:
|
|
3402
|
-
sidebarAutoOpenedRef:
|
|
3529
|
+
loadDocumentBuffer: xt,
|
|
3530
|
+
loadDocument: St,
|
|
3531
|
+
sidebarAutoOpenedRef: dt
|
|
3403
3532
|
});
|
|
3404
|
-
let
|
|
3405
|
-
|
|
3533
|
+
let Xn = () => Z.value, Zn = () => d.value;
|
|
3534
|
+
G(() => i.mode, (e) => {
|
|
3406
3535
|
e && e !== o.value && (o.value = e);
|
|
3407
|
-
}),
|
|
3408
|
-
|
|
3536
|
+
}), G(() => i.showOutline, (e) => {
|
|
3537
|
+
P.value = !!e;
|
|
3409
3538
|
});
|
|
3410
|
-
function
|
|
3539
|
+
function Qn(e) {
|
|
3411
3540
|
o.value !== e && (o.value = e, a("mode-change", e));
|
|
3412
3541
|
}
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
}),
|
|
3416
|
-
|
|
3542
|
+
ue(() => {
|
|
3543
|
+
Dn = En.install();
|
|
3544
|
+
}), I(() => {
|
|
3545
|
+
Dn?.();
|
|
3417
3546
|
});
|
|
3418
|
-
function
|
|
3419
|
-
|
|
3547
|
+
function $n() {
|
|
3548
|
+
tr.clearOverlay();
|
|
3420
3549
|
}
|
|
3421
|
-
function
|
|
3422
|
-
|
|
3550
|
+
function er() {
|
|
3551
|
+
tr.updateSelectionOverlay();
|
|
3423
3552
|
}
|
|
3424
|
-
let
|
|
3425
|
-
editorView:
|
|
3553
|
+
let tr = ci({
|
|
3554
|
+
editorView: Z,
|
|
3426
3555
|
pagesRef: d,
|
|
3427
|
-
|
|
3428
|
-
|
|
3556
|
+
zoom: X,
|
|
3557
|
+
selectedImage: bn,
|
|
3558
|
+
isHfEditing: E(() => $.value !== null),
|
|
3559
|
+
imageInteracting: xn
|
|
3429
3560
|
});
|
|
3430
|
-
|
|
3431
|
-
|
|
3561
|
+
I(() => {
|
|
3562
|
+
$n();
|
|
3432
3563
|
});
|
|
3433
|
-
let { exposed:
|
|
3434
|
-
editorView:
|
|
3435
|
-
layout:
|
|
3564
|
+
let { exposed: nr } = di({
|
|
3565
|
+
editorView: Z,
|
|
3566
|
+
layout: Pe,
|
|
3436
3567
|
pagesRef: d,
|
|
3437
3568
|
pagesViewportRef: g,
|
|
3438
|
-
zoom:
|
|
3439
|
-
comments:
|
|
3440
|
-
focus:
|
|
3441
|
-
destroy:
|
|
3442
|
-
getDocument:
|
|
3443
|
-
setZoom:
|
|
3444
|
-
save:
|
|
3445
|
-
loadDocument:
|
|
3446
|
-
loadDocumentBuffer:
|
|
3447
|
-
addComment:
|
|
3448
|
-
replyToComment:
|
|
3449
|
-
resolveComment:
|
|
3450
|
-
proposeChange:
|
|
3451
|
-
applyFormatting:
|
|
3452
|
-
setParagraphStyle:
|
|
3453
|
-
scrollVisiblePositionIntoView:
|
|
3569
|
+
zoom: X,
|
|
3570
|
+
comments: q,
|
|
3571
|
+
focus: Re,
|
|
3572
|
+
destroy: ze,
|
|
3573
|
+
getDocument: Q,
|
|
3574
|
+
setZoom: Se,
|
|
3575
|
+
save: Ct,
|
|
3576
|
+
loadDocument: St,
|
|
3577
|
+
loadDocumentBuffer: xt,
|
|
3578
|
+
addComment: an,
|
|
3579
|
+
replyToComment: on,
|
|
3580
|
+
resolveComment: cn,
|
|
3581
|
+
proposeChange: ln,
|
|
3582
|
+
applyFormatting: Ft,
|
|
3583
|
+
setParagraphStyle: It,
|
|
3584
|
+
scrollVisiblePositionIntoView: Mn,
|
|
3454
3585
|
contentChangeSubscribers: x,
|
|
3455
3586
|
selectionChangeSubscribers: ee,
|
|
3456
3587
|
onPrint: i.onPrint
|
|
3457
3588
|
});
|
|
3458
|
-
return n(
|
|
3459
|
-
class:
|
|
3589
|
+
return n(nr), (t, n) => (L(), k("div", {
|
|
3590
|
+
class: le([
|
|
3460
3591
|
"docx-editor-vue ep-root paged-editor",
|
|
3461
3592
|
e.className,
|
|
3462
3593
|
{
|
|
3463
3594
|
"paged-editor--readonly": s.value,
|
|
3464
|
-
"paged-editor--hf-editing":
|
|
3465
|
-
"paged-editor--editing-header":
|
|
3466
|
-
"paged-editor--editing-footer":
|
|
3595
|
+
"paged-editor--hf-editing": H($) !== null,
|
|
3596
|
+
"paged-editor--editing-header": H($)?.position === "header",
|
|
3597
|
+
"paged-editor--editing-footer": H($)?.position === "footer"
|
|
3467
3598
|
}
|
|
3468
3599
|
]),
|
|
3469
|
-
style:
|
|
3600
|
+
style: F(e.style)
|
|
3470
3601
|
}, [
|
|
3471
|
-
|
|
3602
|
+
A("div", pi, [M(_n, {
|
|
3472
3603
|
"show-menu-bar": e.showMenuBar,
|
|
3473
3604
|
"document-name": e.documentName,
|
|
3474
3605
|
"document-name-editable": e.documentNameEditable,
|
|
3475
3606
|
"render-logo": e.renderLogo,
|
|
3476
3607
|
"render-title-bar-right": e.renderTitleBarRight,
|
|
3477
|
-
onRename:
|
|
3478
|
-
onMenuAction:
|
|
3479
|
-
onInsertTable:
|
|
3608
|
+
onRename: H(yt),
|
|
3609
|
+
onMenuAction: H(Jn),
|
|
3610
|
+
onInsertTable: H(Yn)
|
|
3480
3611
|
}, {
|
|
3481
|
-
"title-bar-left":
|
|
3482
|
-
"title-bar-right":
|
|
3612
|
+
"title-bar-left": me(() => [de(t.$slots, "title-bar-left")]),
|
|
3613
|
+
"title-bar-right": me(() => [de(t.$slots, "title-bar-right")]),
|
|
3483
3614
|
_: 3
|
|
3484
3615
|
}, 8, [
|
|
3485
3616
|
"show-menu-bar",
|
|
@@ -3490,37 +3621,37 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3490
3621
|
"onRename",
|
|
3491
3622
|
"onMenuAction",
|
|
3492
3623
|
"onInsertTable"
|
|
3493
|
-
]), e.showToolbar ? (
|
|
3624
|
+
]), e.showToolbar ? (L(), D(b, {
|
|
3494
3625
|
key: 0,
|
|
3495
|
-
view:
|
|
3496
|
-
"get-commands":
|
|
3626
|
+
view: H(Z),
|
|
3627
|
+
"get-commands": H(Be),
|
|
3497
3628
|
"state-tick": y.value,
|
|
3498
|
-
"zoom-percent":
|
|
3499
|
-
"is-min-zoom":
|
|
3500
|
-
"is-max-zoom":
|
|
3501
|
-
"zoom-presets":
|
|
3629
|
+
"zoom-percent": H(ye),
|
|
3630
|
+
"is-min-zoom": H(be),
|
|
3631
|
+
"is-max-zoom": H(xe),
|
|
3632
|
+
"zoom-presets": H(Ae),
|
|
3502
3633
|
"show-zoom-control": e.showZoomControl,
|
|
3503
3634
|
"editor-mode": o.value,
|
|
3504
|
-
"comments-sidebar-open":
|
|
3505
|
-
"image-context":
|
|
3506
|
-
theme:
|
|
3635
|
+
"comments-sidebar-open": U.value,
|
|
3636
|
+
"image-context": H(Sn),
|
|
3637
|
+
theme: Ye.value,
|
|
3507
3638
|
"font-families": e.fontFamilies,
|
|
3508
3639
|
onInsertLink: n[0] ||= (e) => ie.value = !0,
|
|
3509
|
-
onApplyStyle:
|
|
3510
|
-
onZoomIn:
|
|
3511
|
-
onZoomOut:
|
|
3512
|
-
onZoomSet:
|
|
3513
|
-
onToggleSidebar:
|
|
3514
|
-
onModeChange:
|
|
3515
|
-
onImageWrapType:
|
|
3640
|
+
onApplyStyle: H(Mt),
|
|
3641
|
+
onZoomIn: H(Te),
|
|
3642
|
+
onZoomOut: H(Ee),
|
|
3643
|
+
onZoomSet: H(Se),
|
|
3644
|
+
onToggleSidebar: H(en),
|
|
3645
|
+
onModeChange: Qn,
|
|
3646
|
+
onImageWrapType: H(wn),
|
|
3516
3647
|
onImageProperties: n[1] ||= (e) => j.value = !0,
|
|
3517
|
-
onImageTransform:
|
|
3648
|
+
onImageTransform: H(Tn)
|
|
3518
3649
|
}, ae({
|
|
3519
|
-
"table-context":
|
|
3520
|
-
view:
|
|
3521
|
-
"get-commands":
|
|
3650
|
+
"table-context": me(() => [M(h, {
|
|
3651
|
+
view: H(Z),
|
|
3652
|
+
"get-commands": H(Be),
|
|
3522
3653
|
"state-tick": y.value,
|
|
3523
|
-
theme:
|
|
3654
|
+
theme: Ye.value
|
|
3524
3655
|
}, null, 8, [
|
|
3525
3656
|
"view",
|
|
3526
3657
|
"get-commands",
|
|
@@ -3530,11 +3661,11 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3530
3661
|
_: 2
|
|
3531
3662
|
}, [e.toolbarExtra ? {
|
|
3532
3663
|
name: "toolbar-extra",
|
|
3533
|
-
fn:
|
|
3664
|
+
fn: me(() => [(L(), D(fe(e.toolbarExtra)))]),
|
|
3534
3665
|
key: "0"
|
|
3535
3666
|
} : {
|
|
3536
3667
|
name: "toolbar-extra",
|
|
3537
|
-
fn:
|
|
3668
|
+
fn: me(() => [de(t.$slots, "toolbar-extra")]),
|
|
3538
3669
|
key: "1"
|
|
3539
3670
|
}]), 1032, [
|
|
3540
3671
|
"view",
|
|
@@ -3557,32 +3688,36 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3557
3688
|
"onToggleSidebar",
|
|
3558
3689
|
"onImageWrapType",
|
|
3559
3690
|
"onImageTransform"
|
|
3560
|
-
])) :
|
|
3561
|
-
|
|
3691
|
+
])) : O("", !0)]),
|
|
3692
|
+
M(sr, {
|
|
3562
3693
|
"show-find-replace": C.value,
|
|
3563
3694
|
"onUpdate:showFindReplace": n[2] ||= (e) => C.value = e,
|
|
3564
|
-
"show-insert-image":
|
|
3565
|
-
"onUpdate:showInsertImage": n[3] ||= (e) =>
|
|
3695
|
+
"show-insert-image": T.value,
|
|
3696
|
+
"onUpdate:showInsertImage": n[3] ||= (e) => T.value = e,
|
|
3566
3697
|
"show-hyperlink": ie.value,
|
|
3567
3698
|
"onUpdate:showHyperlink": n[4] ||= (e) => ie.value = e,
|
|
3568
3699
|
"show-insert-symbol": oe.value,
|
|
3569
3700
|
"onUpdate:showInsertSymbol": n[5] ||= (e) => oe.value = e,
|
|
3570
3701
|
"show-image-properties": j.value,
|
|
3571
3702
|
"onUpdate:showImageProperties": n[6] ||= (e) => j.value = e,
|
|
3572
|
-
"show-page-setup":
|
|
3573
|
-
"onUpdate:showPageSetup": n[7] ||= (e) =>
|
|
3574
|
-
"show-
|
|
3575
|
-
"onUpdate:
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
"
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3703
|
+
"show-page-setup": N.value,
|
|
3704
|
+
"onUpdate:showPageSetup": n[7] ||= (e) => N.value = e,
|
|
3705
|
+
"show-watermark": H(Jt),
|
|
3706
|
+
"onUpdate:showWatermark": n[8] ||= (e) => se(Jt) ? Jt.value = e : null,
|
|
3707
|
+
"show-keyboard-shortcuts": pe.value,
|
|
3708
|
+
"onUpdate:showKeyboardShortcuts": n[9] ||= (e) => pe.value = e,
|
|
3709
|
+
view: H(Z),
|
|
3710
|
+
bookmarks: ot.value,
|
|
3711
|
+
"selected-image-pm-pos": H(bn)?.pmPos ?? null,
|
|
3712
|
+
"section-properties": Ke.value,
|
|
3713
|
+
"current-watermark": H(Yt),
|
|
3714
|
+
"scroll-visible-position-into-view": H(Mn),
|
|
3715
|
+
onInsertImage: H(Cn),
|
|
3716
|
+
onInsertSymbol: H(Pt),
|
|
3717
|
+
onHyperlinkSubmit: H(Tt),
|
|
3718
|
+
onHyperlinkRemove: H(Et),
|
|
3719
|
+
onPageSetupApply: H(Lt),
|
|
3720
|
+
onWatermarkApply: H(Xt)
|
|
3586
3721
|
}, null, 8, [
|
|
3587
3722
|
"show-find-replace",
|
|
3588
3723
|
"show-insert-image",
|
|
@@ -3590,96 +3725,109 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3590
3725
|
"show-insert-symbol",
|
|
3591
3726
|
"show-image-properties",
|
|
3592
3727
|
"show-page-setup",
|
|
3728
|
+
"show-watermark",
|
|
3593
3729
|
"show-keyboard-shortcuts",
|
|
3594
3730
|
"view",
|
|
3595
3731
|
"bookmarks",
|
|
3596
3732
|
"selected-image-pm-pos",
|
|
3597
3733
|
"section-properties",
|
|
3734
|
+
"current-watermark",
|
|
3598
3735
|
"scroll-visible-position-into-view",
|
|
3599
3736
|
"onInsertImage",
|
|
3600
3737
|
"onInsertSymbol",
|
|
3601
3738
|
"onHyperlinkSubmit",
|
|
3602
3739
|
"onHyperlinkRemove",
|
|
3603
|
-
"onPageSetupApply"
|
|
3740
|
+
"onPageSetupApply",
|
|
3741
|
+
"onWatermarkApply"
|
|
3604
3742
|
]),
|
|
3605
|
-
|
|
3606
|
-
!
|
|
3607
|
-
|
|
3743
|
+
H(Ne) ? (L(), k("div", mi, V(H(Ne)), 1)) : O("", !0),
|
|
3744
|
+
!H(Me) && !H(Ne) ? (L(), k("div", hi, "Loading...")) : O("", !0),
|
|
3745
|
+
A("div", {
|
|
3608
3746
|
ref_key: "hiddenPmRef",
|
|
3609
3747
|
ref: u,
|
|
3610
3748
|
class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
|
|
3611
3749
|
}, null, 512),
|
|
3612
|
-
|
|
3750
|
+
A("div", {
|
|
3613
3751
|
class: "docx-editor-vue__editor-scroll",
|
|
3614
|
-
onMousedown: n[
|
|
3615
|
-
}, [e.showRuler &&
|
|
3752
|
+
onMousedown: n[32] ||= (...e) => H(tn) && H(tn)(...e)
|
|
3753
|
+
}, [e.showRuler && Ke.value ? (L(), k("div", {
|
|
3616
3754
|
key: 0,
|
|
3617
3755
|
class: "docx-editor-vue__ruler-row",
|
|
3618
|
-
style:
|
|
3619
|
-
}, [
|
|
3620
|
-
"section-props":
|
|
3621
|
-
zoom:
|
|
3756
|
+
style: F(nt.value)
|
|
3757
|
+
}, [M(_, {
|
|
3758
|
+
"section-props": Ke.value,
|
|
3759
|
+
zoom: H(X),
|
|
3622
3760
|
editable: !s.value,
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3761
|
+
"indent-left": qe.value.indentLeft,
|
|
3762
|
+
"indent-right": qe.value.indentRight,
|
|
3763
|
+
"first-line-indent": qe.value.firstLineIndent,
|
|
3764
|
+
"hanging-indent": qe.value.hangingIndent,
|
|
3765
|
+
"tab-stops": qe.value.tabStops,
|
|
3766
|
+
onLeftMarginChange: H(zt),
|
|
3767
|
+
onRightMarginChange: H(Bt),
|
|
3768
|
+
onIndentLeftChange: H(Ut),
|
|
3769
|
+
onIndentRightChange: H(Gt),
|
|
3770
|
+
onFirstLineIndentChange: H(Kt),
|
|
3771
|
+
onTabStopRemove: H(qt)
|
|
3629
3772
|
}, null, 8, [
|
|
3630
3773
|
"section-props",
|
|
3631
3774
|
"zoom",
|
|
3632
3775
|
"editable",
|
|
3776
|
+
"indent-left",
|
|
3777
|
+
"indent-right",
|
|
3778
|
+
"first-line-indent",
|
|
3779
|
+
"hanging-indent",
|
|
3780
|
+
"tab-stops",
|
|
3633
3781
|
"onLeftMarginChange",
|
|
3634
3782
|
"onRightMarginChange",
|
|
3635
3783
|
"onIndentLeftChange",
|
|
3636
3784
|
"onIndentRightChange",
|
|
3637
3785
|
"onFirstLineIndentChange",
|
|
3638
3786
|
"onTabStopRemove"
|
|
3639
|
-
])], 4)) :
|
|
3640
|
-
|
|
3787
|
+
])], 4)) : O("", !0), A("div", gi, [
|
|
3788
|
+
A("div", {
|
|
3641
3789
|
ref_key: "pagesViewportRef",
|
|
3642
3790
|
ref: g,
|
|
3643
3791
|
class: "docx-editor-vue__pages-viewport",
|
|
3644
|
-
onMousedown: n[
|
|
3645
|
-
onMousemove: n[
|
|
3646
|
-
onClick: n[
|
|
3647
|
-
onDblclick: n[
|
|
3648
|
-
onContextmenu: n[
|
|
3649
|
-
onWheel: n[
|
|
3792
|
+
onMousedown: n[23] ||= (...e) => H(Nn) && H(Nn)(...e),
|
|
3793
|
+
onMousemove: n[24] ||= (...e) => H(Pn) && H(Pn)(...e),
|
|
3794
|
+
onClick: n[25] ||= (...e) => H(Fn) && H(Fn)(...e),
|
|
3795
|
+
onDblclick: n[26] ||= (...e) => H(In) && H(In)(...e),
|
|
3796
|
+
onContextmenu: n[27] ||= J((...e) => H(Wn) && H(Wn)(...e), ["prevent"]),
|
|
3797
|
+
onWheel: n[28] ||= (...e) => H(De) && H(De)(...e)
|
|
3650
3798
|
}, [
|
|
3651
|
-
e.showRuler &&
|
|
3652
|
-
"section-props":
|
|
3653
|
-
zoom:
|
|
3799
|
+
e.showRuler && Ke.value ? (L(), k("div", _i, [M(p, {
|
|
3800
|
+
"section-props": Ke.value,
|
|
3801
|
+
zoom: H(X),
|
|
3654
3802
|
editable: !s.value,
|
|
3655
|
-
onTopMarginChange:
|
|
3656
|
-
onBottomMarginChange:
|
|
3803
|
+
onTopMarginChange: H(Vt),
|
|
3804
|
+
onBottomMarginChange: H(Ht)
|
|
3657
3805
|
}, null, 8, [
|
|
3658
3806
|
"section-props",
|
|
3659
3807
|
"zoom",
|
|
3660
3808
|
"editable",
|
|
3661
3809
|
"onTopMarginChange",
|
|
3662
3810
|
"onBottomMarginChange"
|
|
3663
|
-
])])) :
|
|
3664
|
-
|
|
3811
|
+
])])) : O("", !0),
|
|
3812
|
+
A("div", {
|
|
3665
3813
|
ref_key: "pagesRef",
|
|
3666
3814
|
ref: d,
|
|
3667
3815
|
class: "docx-editor-vue__pages paged-editor__pages",
|
|
3668
|
-
style:
|
|
3816
|
+
style: F(tt.value)
|
|
3669
3817
|
}, null, 4),
|
|
3670
|
-
s.value ?
|
|
3818
|
+
s.value ? O("", !0) : (L(), D(fn, {
|
|
3671
3819
|
key: 1,
|
|
3672
3820
|
container: d.value,
|
|
3673
|
-
view:
|
|
3821
|
+
view: H(Z)
|
|
3674
3822
|
}, null, 8, ["container", "view"])),
|
|
3675
|
-
|
|
3676
|
-
"is-open":
|
|
3677
|
-
position:
|
|
3678
|
-
view:
|
|
3679
|
-
"target-rect":
|
|
3680
|
-
onSave:
|
|
3681
|
-
onClose: n[
|
|
3682
|
-
onRemove:
|
|
3823
|
+
M(sn, {
|
|
3824
|
+
"is-open": H($) !== null,
|
|
3825
|
+
position: H($)?.position ?? "header",
|
|
3826
|
+
view: et.value,
|
|
3827
|
+
"target-rect": H($)?.targetRect ?? null,
|
|
3828
|
+
onSave: H(zn),
|
|
3829
|
+
onClose: n[10] ||= (e) => $.value = null,
|
|
3830
|
+
onRemove: H(Bn)
|
|
3683
3831
|
}, null, 8, [
|
|
3684
3832
|
"is-open",
|
|
3685
3833
|
"position",
|
|
@@ -3688,93 +3836,108 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3688
3836
|
"onSave",
|
|
3689
3837
|
"onRemove"
|
|
3690
3838
|
]),
|
|
3691
|
-
|
|
3839
|
+
(L(!0), k(w, null, z(H($) ? Ze.value : [], (e, t) => (L(), k("div", {
|
|
3840
|
+
key: `hf-sel-${t}-${e.top}-${e.left}`,
|
|
3841
|
+
class: "vue-hf-sel-rect",
|
|
3842
|
+
"aria-hidden": "true",
|
|
3843
|
+
style: F({
|
|
3844
|
+
position: "fixed",
|
|
3845
|
+
top: `${e.top}px`,
|
|
3846
|
+
left: `${e.left}px`,
|
|
3847
|
+
width: `${e.width}px`,
|
|
3848
|
+
height: `${e.height}px`,
|
|
3849
|
+
background: "rgba(66, 133, 244, 0.25)",
|
|
3850
|
+
pointerEvents: "none",
|
|
3851
|
+
zIndex: 9998
|
|
3852
|
+
})
|
|
3853
|
+
}, null, 4))), 128)),
|
|
3854
|
+
H($) && Xe.value ? (L(), k("div", {
|
|
3692
3855
|
key: 2,
|
|
3693
3856
|
"aria-hidden": "true",
|
|
3694
|
-
style:
|
|
3857
|
+
style: F({
|
|
3695
3858
|
position: "fixed",
|
|
3696
|
-
top: `${
|
|
3697
|
-
left: `${
|
|
3859
|
+
top: `${Xe.value.top}px`,
|
|
3860
|
+
left: `${Xe.value.left}px`,
|
|
3698
3861
|
width: "2px",
|
|
3699
|
-
height: `${
|
|
3862
|
+
height: `${Xe.value.height}px`,
|
|
3700
3863
|
background: "#4285f4",
|
|
3701
3864
|
pointerEvents: "none",
|
|
3702
3865
|
zIndex: 9999,
|
|
3703
3866
|
animation: "hf-caret-blink 1.06s steps(1) infinite"
|
|
3704
3867
|
})
|
|
3705
|
-
}, null, 4)) :
|
|
3706
|
-
|
|
3707
|
-
"image-info":
|
|
3708
|
-
zoom:
|
|
3709
|
-
view:
|
|
3710
|
-
onOpenProperties: n[
|
|
3711
|
-
onDeselect: n[
|
|
3712
|
-
onInteractStart: n[
|
|
3713
|
-
onInteractEnd: n[
|
|
3714
|
-
onContextMenu:
|
|
3868
|
+
}, null, 4)) : O("", !0),
|
|
3869
|
+
M(Zt, {
|
|
3870
|
+
"image-info": H(bn),
|
|
3871
|
+
zoom: H(X),
|
|
3872
|
+
view: H(Z),
|
|
3873
|
+
onOpenProperties: n[11] ||= (e) => j.value = !0,
|
|
3874
|
+
onDeselect: n[12] ||= (e) => bn.value = null,
|
|
3875
|
+
onInteractStart: n[13] ||= (e) => xn.value = !0,
|
|
3876
|
+
onInteractEnd: n[14] ||= (e) => xn.value = !1,
|
|
3877
|
+
onContextMenu: H(Gn)
|
|
3715
3878
|
}, null, 8, [
|
|
3716
3879
|
"image-info",
|
|
3717
3880
|
"zoom",
|
|
3718
3881
|
"view",
|
|
3719
3882
|
"onContextMenu"
|
|
3720
3883
|
]),
|
|
3721
|
-
|
|
3722
|
-
"get-view":
|
|
3723
|
-
"get-pages-container":
|
|
3724
|
-
zoom:
|
|
3884
|
+
M(Wt, {
|
|
3885
|
+
"get-view": Xn,
|
|
3886
|
+
"get-pages-container": Zn,
|
|
3887
|
+
zoom: H(X),
|
|
3725
3888
|
"transaction-version": y.value,
|
|
3726
|
-
"sync-coordinator":
|
|
3889
|
+
"sync-coordinator": H(S)
|
|
3727
3890
|
}, null, 8, [
|
|
3728
3891
|
"zoom",
|
|
3729
3892
|
"transaction-version",
|
|
3730
3893
|
"sync-coordinator"
|
|
3731
3894
|
]),
|
|
3732
|
-
|
|
3895
|
+
H(ct) && !W.value && !s.value ? (L(), k("button", {
|
|
3733
3896
|
key: 3,
|
|
3734
3897
|
type: "button",
|
|
3735
3898
|
class: "docx-editor-vue__floating-comment",
|
|
3736
|
-
style:
|
|
3737
|
-
top:
|
|
3738
|
-
left:
|
|
3899
|
+
style: F({
|
|
3900
|
+
top: H(ct).top + "px",
|
|
3901
|
+
left: H(ct).left + "px"
|
|
3739
3902
|
}),
|
|
3740
|
-
title:
|
|
3741
|
-
onMousedown: n[
|
|
3742
|
-
}, [
|
|
3903
|
+
title: H(l)("comments.addComment"),
|
|
3904
|
+
onMousedown: n[15] ||= J((...e) => H(ht) && H(ht)(...e), ["prevent", "stop"])
|
|
3905
|
+
}, [M(c, {
|
|
3743
3906
|
name: "add_comment",
|
|
3744
3907
|
size: 16
|
|
3745
|
-
})], 44,
|
|
3746
|
-
|
|
3908
|
+
})], 44, vi)) : O("", !0),
|
|
3909
|
+
H(On) && !s.value ? (L(), k("button", {
|
|
3747
3910
|
key: 4,
|
|
3748
3911
|
type: "button",
|
|
3749
3912
|
class: "docx-editor-vue__table-insert-btn",
|
|
3750
|
-
style:
|
|
3751
|
-
left:
|
|
3752
|
-
top:
|
|
3913
|
+
style: F({
|
|
3914
|
+
left: H(On).x + "px",
|
|
3915
|
+
top: H(On).y + "px"
|
|
3753
3916
|
}),
|
|
3754
|
-
title:
|
|
3755
|
-
"aria-label":
|
|
3756
|
-
onMousedown: n[
|
|
3757
|
-
onMouseenter: n[
|
|
3758
|
-
onMouseleave: n[
|
|
3759
|
-
}, [...n[
|
|
3917
|
+
title: H(On).type === "row" ? "Insert row below" : "Insert column to the right",
|
|
3918
|
+
"aria-label": H(On).type === "row" ? "Insert row below" : "Insert column to the right",
|
|
3919
|
+
onMousedown: n[16] ||= (...e) => H(Ln) && H(Ln)(...e),
|
|
3920
|
+
onMouseenter: n[17] ||= (...e) => H(Rn) && H(Rn)(...e),
|
|
3921
|
+
onMouseleave: n[18] ||= (e) => On.value = null
|
|
3922
|
+
}, [...n[37] ||= [A("svg", {
|
|
3760
3923
|
width: "12",
|
|
3761
3924
|
height: "12",
|
|
3762
3925
|
viewBox: "0 0 12 12",
|
|
3763
3926
|
fill: "none"
|
|
3764
|
-
}, [
|
|
3927
|
+
}, [A("path", {
|
|
3765
3928
|
d: "M6 1v10M1 6h10",
|
|
3766
3929
|
stroke: "currentColor",
|
|
3767
3930
|
"stroke-width": "1.5",
|
|
3768
3931
|
"stroke-linecap": "round"
|
|
3769
|
-
})], -1)]], 44,
|
|
3770
|
-
|
|
3771
|
-
comments:
|
|
3932
|
+
})], -1)]], 44, yi)) : O("", !0),
|
|
3933
|
+
M(v, {
|
|
3934
|
+
comments: q.value,
|
|
3772
3935
|
"pages-container": d.value,
|
|
3773
|
-
zoom:
|
|
3774
|
-
"page-width-px":
|
|
3775
|
-
"sidebar-open":
|
|
3776
|
-
"resolved-comment-ids":
|
|
3777
|
-
onMarkerClick:
|
|
3936
|
+
zoom: H(X),
|
|
3937
|
+
"page-width-px": it.value,
|
|
3938
|
+
"sidebar-open": U.value,
|
|
3939
|
+
"resolved-comment-ids": at.value,
|
|
3940
|
+
onMarkerClick: H(gt)
|
|
3778
3941
|
}, null, 8, [
|
|
3779
3942
|
"comments",
|
|
3780
3943
|
"pages-container",
|
|
@@ -3784,30 +3947,30 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3784
3947
|
"resolved-comment-ids",
|
|
3785
3948
|
"onMarkerClick"
|
|
3786
3949
|
]),
|
|
3787
|
-
|
|
3788
|
-
"is-open":
|
|
3789
|
-
comments:
|
|
3790
|
-
"tracked-changes":
|
|
3791
|
-
"is-adding-comment":
|
|
3792
|
-
"add-comment-y-position":
|
|
3950
|
+
M(m, {
|
|
3951
|
+
"is-open": U.value,
|
|
3952
|
+
comments: q.value,
|
|
3953
|
+
"tracked-changes": he.value,
|
|
3954
|
+
"is-adding-comment": W.value,
|
|
3955
|
+
"add-comment-y-position": H(ut),
|
|
3793
3956
|
"show-resolved": !0,
|
|
3794
3957
|
"pages-container": d.value,
|
|
3795
|
-
"page-width-px":
|
|
3796
|
-
zoom:
|
|
3797
|
-
"active-item-id":
|
|
3798
|
-
onClose: n[
|
|
3799
|
-
onAddComment:
|
|
3800
|
-
onCancelAddComment:
|
|
3801
|
-
onCommentReply:
|
|
3802
|
-
onCommentResolve:
|
|
3803
|
-
onCommentUnresolve:
|
|
3804
|
-
onCommentDelete:
|
|
3805
|
-
onAcceptChange:
|
|
3806
|
-
onRejectChange:
|
|
3807
|
-
onAcceptChangeById:
|
|
3808
|
-
onRejectChangeById:
|
|
3809
|
-
onTrackedChangeReply:
|
|
3810
|
-
"onUpdate:activeItemId": n[
|
|
3958
|
+
"page-width-px": it.value,
|
|
3959
|
+
zoom: H(X),
|
|
3960
|
+
"active-item-id": K.value,
|
|
3961
|
+
onClose: n[19] ||= (e) => U.value = !1,
|
|
3962
|
+
onAddComment: H(pt),
|
|
3963
|
+
onCancelAddComment: H(mt),
|
|
3964
|
+
onCommentReply: H(un),
|
|
3965
|
+
onCommentResolve: H(cn),
|
|
3966
|
+
onCommentUnresolve: H(dn),
|
|
3967
|
+
onCommentDelete: H(pn),
|
|
3968
|
+
onAcceptChange: H(mn),
|
|
3969
|
+
onRejectChange: H(hn),
|
|
3970
|
+
onAcceptChangeById: H(gn),
|
|
3971
|
+
onRejectChangeById: H(vn),
|
|
3972
|
+
onTrackedChangeReply: H(yn),
|
|
3973
|
+
"onUpdate:activeItemId": n[20] ||= (e) => K.value = e
|
|
3811
3974
|
}, null, 8, [
|
|
3812
3975
|
"is-open",
|
|
3813
3976
|
"comments",
|
|
@@ -3830,14 +3993,14 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3830
3993
|
"onRejectChangeById",
|
|
3831
3994
|
"onTrackedChangeReply"
|
|
3832
3995
|
]),
|
|
3833
|
-
|
|
3834
|
-
data:
|
|
3996
|
+
M(Vr, {
|
|
3997
|
+
data: H(wt),
|
|
3835
3998
|
"read-only": s.value,
|
|
3836
|
-
onNavigate:
|
|
3837
|
-
onCopy: n[
|
|
3838
|
-
onEdit:
|
|
3839
|
-
onRemove:
|
|
3840
|
-
onClose: n[
|
|
3999
|
+
onNavigate: H(Dt),
|
|
4000
|
+
onCopy: n[21] ||= (e) => wt.value = null,
|
|
4001
|
+
onEdit: H(kt),
|
|
4002
|
+
onRemove: H(At),
|
|
4003
|
+
onClose: n[22] ||= (e) => wt.value = null
|
|
3841
4004
|
}, null, 8, [
|
|
3842
4005
|
"data",
|
|
3843
4006
|
"read-only",
|
|
@@ -3846,57 +4009,57 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3846
4009
|
"onRemove"
|
|
3847
4010
|
])
|
|
3848
4011
|
], 544),
|
|
3849
|
-
!
|
|
4012
|
+
!P.value && e.showOutlineButton ? (L(), k("button", {
|
|
3850
4013
|
key: 0,
|
|
3851
4014
|
type: "button",
|
|
3852
4015
|
class: "docx-editor-vue__outline-toggle",
|
|
3853
4016
|
title: "Show document outline",
|
|
3854
|
-
onClick: n[
|
|
3855
|
-
onMousedown: n[
|
|
3856
|
-
}, [
|
|
4017
|
+
onClick: n[29] ||= (...e) => H(Qt) && H(Qt)(...e),
|
|
4018
|
+
onMousedown: n[30] ||= J(() => {}, ["stop"])
|
|
4019
|
+
}, [M(c, {
|
|
3857
4020
|
name: "format_list_bulleted",
|
|
3858
4021
|
size: 20
|
|
3859
|
-
})], 32)) :
|
|
3860
|
-
|
|
4022
|
+
})], 32)) : O("", !0),
|
|
4023
|
+
H(kn).totalPages > 1 ? (L(), D(rn, {
|
|
3861
4024
|
key: 1,
|
|
3862
|
-
"current-page":
|
|
3863
|
-
"total-pages":
|
|
3864
|
-
visible:
|
|
4025
|
+
"current-page": H(kn).currentPage,
|
|
4026
|
+
"total-pages": H(kn).totalPages,
|
|
4027
|
+
visible: H(kn).visible
|
|
3865
4028
|
}, null, 8, [
|
|
3866
4029
|
"current-page",
|
|
3867
4030
|
"total-pages",
|
|
3868
4031
|
"visible"
|
|
3869
|
-
])) :
|
|
3870
|
-
|
|
3871
|
-
"is-open":
|
|
3872
|
-
headings:
|
|
3873
|
-
onClose: n[
|
|
3874
|
-
onNavigate:
|
|
4032
|
+
])) : O("", !0),
|
|
4033
|
+
M(nn, {
|
|
4034
|
+
"is-open": P.value,
|
|
4035
|
+
headings: ge.value,
|
|
4036
|
+
onClose: n[31] ||= (e) => P.value = !1,
|
|
4037
|
+
onNavigate: H($t)
|
|
3875
4038
|
}, null, 8, [
|
|
3876
4039
|
"is-open",
|
|
3877
4040
|
"headings",
|
|
3878
4041
|
"onNavigate"
|
|
3879
4042
|
])
|
|
3880
4043
|
])], 32),
|
|
3881
|
-
|
|
4044
|
+
A("input", {
|
|
3882
4045
|
ref_key: "docxInputRef",
|
|
3883
|
-
ref:
|
|
4046
|
+
ref: _t,
|
|
3884
4047
|
type: "file",
|
|
3885
4048
|
accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
3886
4049
|
style: { display: "none" },
|
|
3887
|
-
onChange: n[
|
|
4050
|
+
onChange: n[33] ||= (...e) => H(vt) && H(vt)(...e)
|
|
3888
4051
|
}, null, 544),
|
|
3889
|
-
|
|
4052
|
+
M(jr, {
|
|
3890
4053
|
"read-only": s.value,
|
|
3891
|
-
"context-menu":
|
|
3892
|
-
"image-context-menu":
|
|
3893
|
-
"image-context-menu-text-actions":
|
|
3894
|
-
"can-open-image-properties": !!
|
|
3895
|
-
onContextMenuAction:
|
|
3896
|
-
onCloseContextMenu: n[
|
|
3897
|
-
onImageWrapSelect:
|
|
3898
|
-
onCloseImageContextMenu: n[
|
|
3899
|
-
onOpenImageProperties: n[
|
|
4054
|
+
"context-menu": H(Vn),
|
|
4055
|
+
"image-context-menu": H(Hn),
|
|
4056
|
+
"image-context-menu-text-actions": H(Un),
|
|
4057
|
+
"can-open-image-properties": !!H(bn),
|
|
4058
|
+
onContextMenuAction: H(qn),
|
|
4059
|
+
onCloseContextMenu: n[34] ||= (e) => H(Vn).isOpen = !1,
|
|
4060
|
+
onImageWrapSelect: H(Kn),
|
|
4061
|
+
onCloseImageContextMenu: n[35] ||= (e) => Hn.value = null,
|
|
4062
|
+
onOpenImageProperties: n[36] ||= (e) => j.value = !0
|
|
3900
4063
|
}, null, 8, [
|
|
3901
4064
|
"read-only",
|
|
3902
4065
|
"context-menu",
|
|
@@ -3911,8 +4074,8 @@ var rr = { class: "docx-editor-vue__toolbar-shell" }, ir = {
|
|
|
3911
4074
|
});
|
|
3912
4075
|
//#endregion
|
|
3913
4076
|
//#region src/renderAsync.ts
|
|
3914
|
-
async function
|
|
3915
|
-
let r = e instanceof ArrayBuffer ? e : await
|
|
4077
|
+
async function xi(e, t, n = {}) {
|
|
4078
|
+
let r = e instanceof ArrayBuffer ? e : await Ae(e), i = null, a = null, o = !1, s = {
|
|
3916
4079
|
save: async () => {
|
|
3917
4080
|
let e = await (i?.save() ?? Promise.resolve(null));
|
|
3918
4081
|
return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
|
|
@@ -3934,7 +4097,7 @@ async function dr(e, t, n = {}) {
|
|
|
3934
4097
|
};
|
|
3935
4098
|
return new Promise((e, c) => {
|
|
3936
4099
|
a = ie({ setup() {
|
|
3937
|
-
return () =>
|
|
4100
|
+
return () => P(bi, {
|
|
3938
4101
|
...n,
|
|
3939
4102
|
documentBuffer: r,
|
|
3940
4103
|
showToolbar: n.showToolbar ?? !0,
|
|
@@ -3958,6 +4121,6 @@ async function dr(e, t, n = {}) {
|
|
|
3958
4121
|
}
|
|
3959
4122
|
//#endregion
|
|
3960
4123
|
//#region src/index.ts
|
|
3961
|
-
var
|
|
4124
|
+
var Si = "0.0.2";
|
|
3962
4125
|
//#endregion
|
|
3963
|
-
export {
|
|
4126
|
+
export { bi as DocxEditor, Si as VERSION, It as createDocumentWithText, Lt as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, xi as renderAsync, n as useTranslation };
|