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