@stll/folio-vue 0.10.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ListButtons-BcB7qvzQ.cjs → ListButtons-24sQYGSe.cjs} +1 -1
- package/dist/{ListButtons-rpVlLZJ8.js → ListButtons-CAw3PKiv.js} +1 -1
- package/dist/SplitCellDialog-DJ-z75hr.cjs +15 -0
- package/dist/{SplitCellDialog-DRQuZsA3.js → SplitCellDialog-DUzOQhr6.js} +767 -755
- package/dist/components/DocxEditor/types.d.ts +33 -0
- package/dist/composables/useCommentManagement.d.ts +8 -2
- package/dist/composables/useDocxEditorRefApi.d.ts +5 -2
- package/dist/composables/useFontLifecycle.d.ts +2 -1
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +1 -1
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +617 -577
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +2 -2
- package/dist/utils/embeddedFonts.d.ts +14 -1
- package/package.json +2 -2
- package/dist/SplitCellDialog-B_TOoiMw.cjs +0 -15
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as e, F as t, M as n, N as r, P as i, _ as a, c as o, d as s, f as c, g as l, j as u, l as d, m as f, p, u as m, y as h } from "./SplitCellDialog-
|
|
2
|
-
import { D as g, E as _, d as v, f as y, i as b, n as x, r as
|
|
3
|
-
import { t as
|
|
4
|
-
import { a as
|
|
5
|
-
import { FindReplaceDialog as
|
|
1
|
+
import { A as e, F as t, M as n, N as r, P as i, _ as a, c as o, d as s, f as c, g as l, j as u, l as d, m as f, p, u as m, y as h } from "./SplitCellDialog-DUzOQhr6.js";
|
|
2
|
+
import { D as g, E as _, d as v, f as y, i as b, n as x, r as ee, t as te, v as ne, w as re, y as ie } from "./ListButtons-CAw3PKiv.js";
|
|
3
|
+
import { t as ae } from "./zIndex-Ei9BbHSW.js";
|
|
4
|
+
import { a as S, c as oe, i as se, l as C, o as ce, r as le, s as ue, t as de, u as fe } from "./useZoom-DwDDS7hq.js";
|
|
5
|
+
import { FindReplaceDialog as pe, FootnotePropertiesDialog as me, HyperlinkDialog as he, ImagePositionDialog as w, ImagePropertiesDialog as ge, InsertImageDialog as T, InsertSymbolDialog as E, InsertTableDialog as _e, PageSetupDialog as ve, PasteSpecialDialog as ye, SplitCellDialog as be, TablePropertiesDialog as xe, WatermarkDialog as D } from "./dialogs.js";
|
|
6
6
|
import { Fragment as O, Teleport as k, computed as A, createApp as Se, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createSlots as Ce, createStaticVNode as we, createTextVNode as Te, createVNode as F, defineComponent as I, h as Ee, inject as L, mergeProps as De, nextTick as Oe, normalizeClass as R, normalizeStyle as z, onBeforeUnmount as B, onMounted as ke, onScopeDispose as Ae, openBlock as V, provide as je, ref as H, renderList as U, renderSlot as Me, shallowRef as Ne, toDisplayString as W, unref as G, vModelText as Pe, vShow as Fe, watch as K, withCtx as Ie, withDirectives as Le, withKeys as Re, withModifiers as q } from "vue";
|
|
7
7
|
import { createStyleResolver as ze, extractSelectionState as Be, getSelectedText as Ve, insertImageFromFile as He, insertImageFromFile as Ue, insertPageBreakInView as We, insertPageBreakInView as Ge, insertTableInView as Ke, insertTableInView as qe, insertTableOfContentsInView as Je, insertTableOfContentsInView as Ye, schema as J } from "@stll/folio-core/prosemirror";
|
|
8
8
|
import { getTableContext as Xe } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
|
|
@@ -34,55 +34,56 @@ import { closeHistory as $t, redo as en, undo as tn } from "prosemirror-history"
|
|
|
34
34
|
import { clearFormatting as nn } from "@stll/folio-core/prosemirror/commands/formatting";
|
|
35
35
|
import { PENDING_COMMENT_ID as rn, createCommentIdAllocator as an, seedCommentAllocator as on } from "@stll/folio-core/prosemirror/commentIdAllocator";
|
|
36
36
|
import { createComment as sn } from "@stll/folio-core/prosemirror/commentOps";
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import { extractEmbeddedFonts as
|
|
57
|
-
import { editHyperlinkAtCursor as
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
37
|
+
import { acceptAIEditRevision as cn, acceptChange as ln, acceptSuggestion as un, findAIEditRevisionRange as dn, findSuggestionRange as fn, getSuggestions as pn, rejectAIEditRevision as mn, rejectChange as hn, rejectSuggestion as gn } from "@stll/folio-core/prosemirror/commands/comments";
|
|
38
|
+
import { makeRevisionInfo as _n } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
39
|
+
import { findPageIndexContainingPmPos as Q } from "@stll/folio-core/layout-engine";
|
|
40
|
+
import { proseDocToBlocks as vn } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
|
|
41
|
+
import { setTemplatePreviewValues as $ } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
42
|
+
import { clearTemplateSlashMenu as yn, consumeTemplateSlashQuery as bn, getTemplateSlashMenu as xn, resetTemplateSlashQuery as Sn, templateSlashMenuKey as Cn } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
43
|
+
import { createEmptyHeaderFooter as wn, pickActiveHeaderFooterRId as Tn, removeHeaderFooter as En, resolveHeaderFooterContent as Dn, saveHeaderFooterContent as On } from "@stll/folio-core/utils/headerFooter";
|
|
44
|
+
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as kn, applyFolioAIEditOperations as An, applyFolioAIEditOperations as jn, applyFolioDocumentOperations as Mn, assertSupportedFolioDocumentOperationVersion as Nn, createFolioAIEditSnapshot as Pn, createFolioAIEditSnapshot as Fn, diffWordSegments as In, getCommentAnchorsFromDoc as Ln, getFolioDocumentOperationIssues as Rn, getTrackedChangesFromDoc as zn, hashFolioAIBlockText as Bn, normalizeFolioAIBlockText as Vn } from "@stll/folio-core/ai-edits";
|
|
45
|
+
import { findParagraphFragmentsByParaId as Hn, flashParagraphElements as Un } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
46
|
+
import { blockSdtAttrsToSdtProperties as Wn, findBlockSdtMatch as Gn, findBlockSdtMatches as Kn, removeContentControlTr as qn, setContentControlContentTr as Jn, setContentControlValueTr as Yn } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
47
|
+
import { setContentControlContentBlocksTr as Xn } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
48
|
+
import { clampRangeToDocSize as Zn, resolveFolioAIBlockRange as Qn, resolveFolioAITextRange as $n, resolvePassageRange as er } from "@stll/folio-core/ai-edits/blockRange";
|
|
49
|
+
import { deriveBlockId as tr, getFolioParaIdFromBlockId as nr, getFolioParaIdFromBlockId as rr, isFolioBlockId as ir, isSequentialFolioBlockId as ar } from "@stll/folio-core/types/block-id";
|
|
50
|
+
import { getPageTextFromLayout as or } from "@stll/folio-core/paged-layout/pageText";
|
|
51
|
+
import { applyStyle as sr, removeTabStop as cr, setIndentFirstLine as lr, setIndentLeft as ur, setIndentRight as dr } from "@stll/folio-core/prosemirror/commands/paragraph";
|
|
52
|
+
import { getCachedNumberingMap as fr } from "@stll/folio-core/docx";
|
|
53
|
+
import { insertPageBreak as pr } from "@stll/folio-core/prosemirror/commands/pageBreak";
|
|
54
|
+
import { insertSectionBreakContinuous as mr, insertSectionBreakNextPage as hr } from "@stll/folio-core/prosemirror/commands/sectionBreak";
|
|
55
|
+
import { setEmbeddedFontFamilyMap as gr } from "@stll/folio-core/utils/fontResolver";
|
|
56
|
+
import { buildEmbeddedFontFamilyMap as _r, extractEmbeddedFonts as vr } from "@stll/folio-core/fonts/embeddedFonts";
|
|
57
|
+
import { editHyperlinkAtCursor as yr, removeHyperlinkAtCursor as br } from "@stll/folio-core/prosemirror/commands/hyperlink";
|
|
58
|
+
import { sanitizeExternalUrl as xr } from "@stll/folio-core/utils/urlSecurity";
|
|
59
|
+
import { collectHeadings as Sr } from "@stll/folio-core/utils/headingCollector";
|
|
60
|
+
import { clickToPositionInHfSlot as Cr } from "@stll/folio-core/layout-bridge/dom/findHfPmSpans";
|
|
61
|
+
import { findNoteStoryForTarget as wr } from "@stll/folio-core/layout-bridge/dom/noteStoryDom";
|
|
62
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as Tr, detectTableInsertHover as Er } from "@stll/folio-core/layout-bridge/tableInsertHover";
|
|
63
|
+
import { createCellDragTracker as Dr, findCellPosFromPmPos as Or } from "@stll/folio-core/prosemirror/cellDragSelection";
|
|
64
|
+
import { RemoteSelectionOverlay as kr } from "@stll/folio-core/render-dom/RemoteSelectionOverlay";
|
|
65
|
+
import { BodySelectionOverlay as Ar } from "@stll/folio-core/render-dom/BodySelectionOverlay";
|
|
66
|
+
import { createEmptyDocument as jr } from "@stll/folio-core/utils/createDocument";
|
|
67
|
+
import { extractDocumentStyleSet as Mr, extractDocumentStyleSetFromDocx as Nr, inspectDocumentStyles as Pr, inspectDocumentStylesFromDocx as Fr } from "@stll/folio-core/style-sets/extract";
|
|
68
|
+
import { STELLA_STYLE_SET_NAME as Ir, createStellaStyleDocumentPreset as Lr, createStellaStyleSet as Rr } from "@stll/folio-core/style-sets/stellaStyle";
|
|
69
|
+
import { DOCUMENT_PRESET_VERSION as zr, DOCUMENT_STYLE_SET_VERSION as Br } from "@stll/folio-core/style-sets/types";
|
|
70
|
+
import { createDocx as Vr } from "@stll/folio-core/docx/rezip";
|
|
71
|
+
import { DEFAULT_AI_SUGGESTION_PRESETS as Hr } from "@stll/folio-core/ai-suggestions/types";
|
|
72
|
+
import { applySuggestions as Ur } from "@stll/folio-core/ai-suggestions/apply";
|
|
73
|
+
import { isSuggestionStale as Wr, resolveSuggestionAnchor as Gr } from "@stll/folio-core/ai-suggestions/conflict";
|
|
74
|
+
import { buildPositionalText as Kr } from "@stll/folio-core/ai-suggestions/text-positions";
|
|
75
|
+
import { setAISuggestionsMeta as qr, setFocusedSuggestionMeta as Jr } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
76
|
+
import { scrollFolioPositionIntoView as Yr } from "@stll/folio-core/paged-layout/scrollToPmPosition";
|
|
77
|
+
import { getFolioCaretViewportRect as Xr, getFolioSelectionViewportRect as Zr } from "@stll/folio-core/paged-layout/selectionViewportRect";
|
|
78
|
+
import { createAICitationDecorationsPlugin as Qr, setAICitationsMeta as $r, setActiveCitationMeta as ei } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
79
|
+
import { fromMarkdown as ti, toMarkdown as ni, toMarkdownResult as ri } from "@stll/folio-core/markdown";
|
|
79
80
|
//#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
80
|
-
var
|
|
81
|
+
var ii = [
|
|
81
82
|
"data-folio-anonymization-label",
|
|
82
83
|
"data-folio-anonymization-canonical",
|
|
83
84
|
"data-folio-anonymization-selected",
|
|
84
85
|
"title"
|
|
85
|
-
],
|
|
86
|
+
], ai = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
86
87
|
__name: "AnonymizationRectsOverlay",
|
|
87
88
|
props: {
|
|
88
89
|
getView: { type: Function },
|
|
@@ -199,12 +200,12 @@ var Qr = [
|
|
|
199
200
|
width: `${n.width}px`,
|
|
200
201
|
height: `${n.height}px`
|
|
201
202
|
})
|
|
202
|
-
}, null, 14,
|
|
203
|
+
}, null, 14, ii))), 128))], 64))), 128))], 512));
|
|
203
204
|
}
|
|
204
|
-
}), [["__scopeId", "data-v-df8fe7df"]]),
|
|
205
|
+
}), [["__scopeId", "data-v-df8fe7df"]]), oi = {
|
|
205
206
|
class: "folio-passage-highlight-overlay",
|
|
206
207
|
"data-folio-passage-highlight-overlay": ""
|
|
207
|
-
},
|
|
208
|
+
}, si = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
208
209
|
__name: "PassageHighlightOverlay",
|
|
209
210
|
props: {
|
|
210
211
|
range: {},
|
|
@@ -251,7 +252,7 @@ var Qr = [
|
|
|
251
252
|
t.measures
|
|
252
253
|
], () => a(), { immediate: !0 }), B(() => {
|
|
253
254
|
r.invalidate(), i !== null && (cancelAnimationFrame(i), i = null);
|
|
254
|
-
}), (e, t) => (V(), N("div",
|
|
255
|
+
}), (e, t) => (V(), N("div", oi, [(V(!0), N(O, null, U(n.value, (e, t) => (V(), N("span", {
|
|
255
256
|
key: `${t}:${e.left}:${e.top}`,
|
|
256
257
|
class: "folio-passage-highlight",
|
|
257
258
|
style: z({
|
|
@@ -263,11 +264,11 @@ var Qr = [
|
|
|
263
264
|
})
|
|
264
265
|
}, null, 4))), 128))]));
|
|
265
266
|
}
|
|
266
|
-
}), [["__scopeId", "data-v-bde9f41b"]]),
|
|
267
|
+
}), [["__scopeId", "data-v-bde9f41b"]]), ci = {
|
|
267
268
|
key: 0,
|
|
268
269
|
class: "folio-autocomplete-overlay",
|
|
269
270
|
"data-folio-autocomplete-overlay": ""
|
|
270
|
-
},
|
|
271
|
+
}, li = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
271
272
|
__name: "AutocompleteCaretOverlay",
|
|
272
273
|
props: {
|
|
273
274
|
caret: {},
|
|
@@ -275,7 +276,7 @@ var Qr = [
|
|
|
275
276
|
isStreaming: { type: Boolean }
|
|
276
277
|
},
|
|
277
278
|
setup(e) {
|
|
278
|
-
return (t, n) => e.caret && e.text.length > 0 ? (V(), N("div",
|
|
279
|
+
return (t, n) => e.caret && e.text.length > 0 ? (V(), N("div", ci, [P("span", {
|
|
279
280
|
class: "folio-autocomplete-ghost",
|
|
280
281
|
style: z({
|
|
281
282
|
left: `${e.caret.x}px`,
|
|
@@ -288,7 +289,7 @@ var Qr = [
|
|
|
288
289
|
"aria-hidden": "true"
|
|
289
290
|
}, "stella", 2)], 4)])) : M("", !0);
|
|
290
291
|
}
|
|
291
|
-
}), [["__scopeId", "data-v-00299904"]]),
|
|
292
|
+
}), [["__scopeId", "data-v-00299904"]]), ui = 48, di = /* @__PURE__ */ I({
|
|
292
293
|
__name: "AutocompleteSuggestionOverlay",
|
|
293
294
|
props: {
|
|
294
295
|
getPagesContainer: { type: Function },
|
|
@@ -305,7 +306,7 @@ var Qr = [
|
|
|
305
306
|
let c = r.querySelector(".layout-page-content");
|
|
306
307
|
if (!c) return;
|
|
307
308
|
let l = (c.getBoundingClientRect().right - a.left) / i;
|
|
308
|
-
return Math.max(
|
|
309
|
+
return Math.max(ui, l - t);
|
|
309
310
|
}
|
|
310
311
|
}, s = () => {
|
|
311
312
|
let e = t.getPagesContainer(), r = t.editorState;
|
|
@@ -354,7 +355,7 @@ var Qr = [
|
|
|
354
355
|
t.editorState,
|
|
355
356
|
t.zoom,
|
|
356
357
|
r.value
|
|
357
|
-
], () => c()), (e, t) => (V(), j(
|
|
358
|
+
], () => c()), (e, t) => (V(), j(li, {
|
|
358
359
|
caret: n.value?.caret ?? null,
|
|
359
360
|
text: n.value?.text ?? "",
|
|
360
361
|
"is-streaming": n.value?.isStreaming ?? !1
|
|
@@ -364,33 +365,33 @@ var Qr = [
|
|
|
364
365
|
"is-streaming"
|
|
365
366
|
]));
|
|
366
367
|
}
|
|
367
|
-
}),
|
|
368
|
-
function
|
|
369
|
-
je(
|
|
368
|
+
}), fi = Symbol("docx-portal-class");
|
|
369
|
+
function pi(e) {
|
|
370
|
+
je(fi, A(() => ({
|
|
370
371
|
"ep-root": !0,
|
|
371
372
|
dark: !!G(e)
|
|
372
373
|
})));
|
|
373
374
|
}
|
|
374
|
-
function
|
|
375
|
-
return L(
|
|
375
|
+
function mi() {
|
|
376
|
+
return L(fi, A(() => ({ "ep-root": !0 })));
|
|
376
377
|
}
|
|
377
378
|
//#endregion
|
|
378
379
|
//#region src/components/ContentControlWidgetsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
379
|
-
var
|
|
380
|
+
var hi = ["aria-label"], gi = {
|
|
380
381
|
key: 0,
|
|
381
382
|
class: "content-control-picker__items",
|
|
382
383
|
role: "menu"
|
|
383
|
-
},
|
|
384
|
+
}, _i = {
|
|
384
385
|
key: 0,
|
|
385
386
|
class: "content-control-picker__empty"
|
|
386
|
-
},
|
|
387
|
+
}, vi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
387
388
|
__name: "ContentControlWidgetsOverlay",
|
|
388
389
|
props: {
|
|
389
390
|
eventRoot: {},
|
|
390
391
|
view: {}
|
|
391
392
|
},
|
|
392
393
|
setup(e) {
|
|
393
|
-
let t = e, { t: n } = r(), { Button: i, DatePickerPopover: a } = h(), o =
|
|
394
|
+
let t = e, { t: n } = r(), { Button: i, DatePickerPopover: a } = h(), o = mi(), s = new Ot(), c = Ne(s.getSnapshot()), l = s.subscribe(() => {
|
|
394
395
|
c.value = s.getSnapshot();
|
|
395
396
|
});
|
|
396
397
|
K([() => t.view, () => t.eventRoot], ([e, t]) => s.bind(e, t), { immediate: !0 }), B(() => {
|
|
@@ -409,7 +410,7 @@ var li = ["aria-label"], ui = {
|
|
|
409
410
|
role: "dialog",
|
|
410
411
|
"aria-label": c.value.status === "dropdown" ? G(n)("contentControlDropdownAriaLabel") : G(n)("contentControlDateAriaLabel"),
|
|
411
412
|
onMousedown: t[1] ||= q(() => {}, ["stop"])
|
|
412
|
-
}, [c.value.status === "dropdown" ? (V(), N("div",
|
|
413
|
+
}, [c.value.status === "dropdown" ? (V(), N("div", gi, [c.value.items.length === 0 ? (V(), N("div", _i, W(G(n)("contentControlDropdownNoOptions")), 1)) : (V(!0), N(O, { key: 1 }, U(c.value.items, (e) => (V(), j(G(i), {
|
|
413
414
|
key: `${e.value}::${e.displayText}`,
|
|
414
415
|
"class-name": "content-control-picker__item",
|
|
415
416
|
type: "button",
|
|
@@ -426,9 +427,9 @@ var li = ["aria-label"], ui = {
|
|
|
426
427
|
value: c.value.currentValue,
|
|
427
428
|
"default-open": !0,
|
|
428
429
|
onChange: d
|
|
429
|
-
}, null, 8, ["value"])) : M("", !0)], 46,
|
|
430
|
+
}, null, 8, ["value"])) : M("", !0)], 46, hi))]));
|
|
430
431
|
}
|
|
431
|
-
}), [["__scopeId", "data-v-19e067b7"]]),
|
|
432
|
+
}), [["__scopeId", "data-v-19e067b7"]]), yi = /* @__PURE__ */ I({
|
|
432
433
|
__name: "DecorationLayer",
|
|
433
434
|
props: {
|
|
434
435
|
getView: { type: Function },
|
|
@@ -540,10 +541,10 @@ var li = ["aria-label"], ui = {
|
|
|
540
541
|
"aria-hidden": "true"
|
|
541
542
|
}, null, 512));
|
|
542
543
|
}
|
|
543
|
-
}),
|
|
544
|
+
}), bi = { class: "doc-outline__header" }, xi = { class: "doc-outline__body" }, Si = {
|
|
544
545
|
key: 0,
|
|
545
546
|
class: "doc-outline__empty"
|
|
546
|
-
},
|
|
547
|
+
}, Ci = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
547
548
|
__name: "DocumentOutline",
|
|
548
549
|
props: {
|
|
549
550
|
isOpen: { type: Boolean },
|
|
@@ -572,7 +573,7 @@ var li = ["aria-label"], ui = {
|
|
|
572
573
|
role: "navigation",
|
|
573
574
|
"aria-label": "Document outline",
|
|
574
575
|
onMousedown: n[1] ||= q(() => {}, ["stop"])
|
|
575
|
-
}, [P("div",
|
|
576
|
+
}, [P("div", bi, [P("button", {
|
|
576
577
|
class: "doc-outline__back",
|
|
577
578
|
title: "Close outline",
|
|
578
579
|
"aria-label": "Close outline",
|
|
@@ -580,7 +581,7 @@ var li = ["aria-label"], ui = {
|
|
|
580
581
|
}, [F(i, {
|
|
581
582
|
name: "arrow_back",
|
|
582
583
|
size: 20
|
|
583
|
-
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div",
|
|
584
|
+
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div", xi, [e.headings.length === 0 ? (V(), N("div", Si, "No headings found")) : (V(), j(G(r), {
|
|
584
585
|
key: 1,
|
|
585
586
|
items: o.value,
|
|
586
587
|
"get-scroll-container": e.getScrollContainer ?? (() => null),
|
|
@@ -588,7 +589,7 @@ var li = ["aria-label"], ui = {
|
|
|
588
589
|
"aria-label": "Document outline"
|
|
589
590
|
}, null, 8, ["items", "get-scroll-container"]))])], 36)) : M("", !0);
|
|
590
591
|
}
|
|
591
|
-
}), [["__scopeId", "data-v-0797b3b1"]]),
|
|
592
|
+
}), [["__scopeId", "data-v-0797b3b1"]]), wi = /* @__PURE__ */ I({
|
|
592
593
|
__name: "DocxEditorDialogs",
|
|
593
594
|
props: {
|
|
594
595
|
view: {},
|
|
@@ -681,10 +682,10 @@ var li = ["aria-label"], ui = {
|
|
|
681
682
|
}, null, 8, ["is-open", "current-watermark"])
|
|
682
683
|
], 64));
|
|
683
684
|
}
|
|
684
|
-
}),
|
|
685
|
+
}), Ti = {
|
|
685
686
|
key: 0,
|
|
686
687
|
class: "docx-editor-vue__title-bar"
|
|
687
|
-
},
|
|
688
|
+
}, Ei = { class: "docx-editor-vue__title-bar-left" }, Di = { class: "docx-editor-vue__title-bar-center" }, Oi = { class: "docx-editor-vue__title-bar-right" }, ki = /* @__PURE__ */ I({
|
|
688
689
|
__name: "DocxEditorMenuBar",
|
|
689
690
|
props: {
|
|
690
691
|
showMenuBar: {
|
|
@@ -716,13 +717,13 @@ var li = ["aria-label"], ui = {
|
|
|
716
717
|
],
|
|
717
718
|
setup(e, { emit: t }) {
|
|
718
719
|
let n = t;
|
|
719
|
-
return (t, r) => e.showMenuBar ? (V(), N("div",
|
|
720
|
-
P("div",
|
|
721
|
-
P("div",
|
|
720
|
+
return (t, r) => e.showMenuBar ? (V(), N("div", Ti, [
|
|
721
|
+
P("div", Ei, [Me(t.$slots, "title-bar-left")]),
|
|
722
|
+
P("div", Di, [F(_, {
|
|
722
723
|
"model-value": e.documentName,
|
|
723
724
|
editable: e.documentNameEditable,
|
|
724
725
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
725
|
-
}, null, 8, ["model-value", "editable"]), F(
|
|
726
|
+
}, null, 8, ["model-value", "editable"]), F(re, {
|
|
726
727
|
"show-file-open": e.showFileOpen,
|
|
727
728
|
"show-help-menu": e.showHelpMenu,
|
|
728
729
|
"show-table-insert": e.showTableInsert,
|
|
@@ -733,28 +734,28 @@ var li = ["aria-label"], ui = {
|
|
|
733
734
|
"show-help-menu",
|
|
734
735
|
"show-table-insert"
|
|
735
736
|
])]),
|
|
736
|
-
P("div",
|
|
737
|
+
P("div", Oi, [Me(t.$slots, "title-bar-right")])
|
|
737
738
|
])) : M("", !0);
|
|
738
739
|
}
|
|
739
|
-
}),
|
|
740
|
+
}), Ai = ["aria-label"], ji = { class: "image-ctx-menu__icon" }, Mi = { class: "image-ctx-menu__label" }, Ni = {
|
|
740
741
|
key: 1,
|
|
741
742
|
class: "image-ctx-menu__divider",
|
|
742
743
|
role: "separator"
|
|
743
|
-
},
|
|
744
|
+
}, Pi = [
|
|
744
745
|
"data-wrap-type",
|
|
745
746
|
"data-current",
|
|
746
747
|
"data-disabled",
|
|
747
748
|
"disabled",
|
|
748
749
|
"title",
|
|
749
750
|
"onClick"
|
|
750
|
-
],
|
|
751
|
+
], Fi = { class: "image-ctx-menu__icon" }, Ii = { class: "image-ctx-menu__label" }, Li = ["aria-label"], Ri = ["disabled", "onClick"], zi = { class: "image-ctx-menu__label" }, Bi = {
|
|
751
752
|
key: 0,
|
|
752
753
|
class: "image-ctx-menu__shortcut"
|
|
753
|
-
},
|
|
754
|
+
}, Vi = {
|
|
754
755
|
key: 0,
|
|
755
756
|
class: "image-ctx-menu__divider",
|
|
756
757
|
role: "separator"
|
|
757
|
-
},
|
|
758
|
+
}, Hi = 18, Ui = 260, Wi = 10, Gi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
758
759
|
__name: "ImageContextMenu",
|
|
759
760
|
props: {
|
|
760
761
|
state: {},
|
|
@@ -775,7 +776,7 @@ var li = ["aria-label"], ui = {
|
|
|
775
776
|
function o() {
|
|
776
777
|
a("open-properties"), a("close");
|
|
777
778
|
}
|
|
778
|
-
let { t: s } = r(), c =
|
|
779
|
+
let { t: s } = r(), c = mi(), l = Mt, u = A(() => n.state ? Pt(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
|
|
779
780
|
inline: "wrap_text",
|
|
780
781
|
squareLeft: "format_image_left",
|
|
781
782
|
squareRight: "format_image_right",
|
|
@@ -788,11 +789,11 @@ var li = ["aria-label"], ui = {
|
|
|
788
789
|
let p = A(() => {
|
|
789
790
|
if (!n.state) return {};
|
|
790
791
|
let e = Mt.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
791
|
-
return typeof window < "u" && (t +
|
|
792
|
+
return typeof window < "u" && (t + Ui > window.innerWidth && (t = window.innerWidth - Ui - Wi), r + e > window.innerHeight && (r = window.innerHeight - e - Wi), t < Wi && (t = Wi), r < Wi && (r = Wi)), {
|
|
792
793
|
position: "fixed",
|
|
793
794
|
left: `${t}px`,
|
|
794
795
|
top: `${r}px`,
|
|
795
|
-
minWidth: `${
|
|
796
|
+
minWidth: `${Ui}px`,
|
|
796
797
|
zIndex: 400
|
|
797
798
|
};
|
|
798
799
|
});
|
|
@@ -834,11 +835,11 @@ var li = ["aria-label"], ui = {
|
|
|
834
835
|
"data-action": "open-properties",
|
|
835
836
|
onMousedown: n[1] ||= q(() => {}, ["prevent"]),
|
|
836
837
|
onClick: o
|
|
837
|
-
}, [P("span",
|
|
838
|
+
}, [P("span", ji, [F(i, {
|
|
838
839
|
name: "settings",
|
|
839
|
-
size:
|
|
840
|
-
})]), P("span",
|
|
841
|
-
e.canOpenProperties ? (V(), N("div",
|
|
840
|
+
size: Hi
|
|
841
|
+
})]), P("span", Mi, W(G(s)("imageWrap.menu.imageProperties")), 1)], 32)) : M("", !0),
|
|
842
|
+
e.canOpenProperties ? (V(), N("div", Ni)) : M("", !0),
|
|
842
843
|
(V(!0), N(O, null, U(G(l), (e) => (V(), N("button", {
|
|
843
844
|
key: e.choice,
|
|
844
845
|
type: "button",
|
|
@@ -852,17 +853,17 @@ var li = ["aria-label"], ui = {
|
|
|
852
853
|
onMousedown: n[2] ||= q(() => {}, ["prevent"]),
|
|
853
854
|
onClick: (t) => h(e)
|
|
854
855
|
}, [
|
|
855
|
-
P("span",
|
|
856
|
+
P("span", Fi, [F(i, {
|
|
856
857
|
name: f(e.iconHint),
|
|
857
|
-
size:
|
|
858
|
+
size: Hi
|
|
858
859
|
}, null, 8, ["name"])]),
|
|
859
|
-
P("span",
|
|
860
|
+
P("span", Ii, W(G(s)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
860
861
|
e.choice === u.value ? (V(), N("span", {
|
|
861
862
|
key: 0,
|
|
862
863
|
class: "image-ctx-menu__current-dot",
|
|
863
864
|
"aria-label": G(s)("imageWrap.menu.ariaLabel")
|
|
864
|
-
}, "●", 8,
|
|
865
|
-
], 42,
|
|
865
|
+
}, "●", 8, Li)) : M("", !0)
|
|
866
|
+
], 42, Pi))), 128)),
|
|
866
867
|
e.textActions && e.textActions.length > 0 ? (V(), N(O, { key: 2 }, [n[5] ||= P("div", {
|
|
867
868
|
class: "image-ctx-menu__divider",
|
|
868
869
|
role: "separator"
|
|
@@ -873,16 +874,16 @@ var li = ["aria-label"], ui = {
|
|
|
873
874
|
disabled: e.disabled,
|
|
874
875
|
onMousedown: n[3] ||= q(() => {}, ["prevent"]),
|
|
875
876
|
onClick: (t) => g(e)
|
|
876
|
-
}, [P("span",
|
|
877
|
-
], 46,
|
|
877
|
+
}, [P("span", zi, W(e.label), 1), e.shortcut ? (V(), N("span", Bi, W(e.shortcut), 1)) : M("", !0)], 40, Ri), e.dividerAfter ? (V(), N("div", Vi)) : M("", !0)], 64))), 128))], 64)) : M("", !0)
|
|
878
|
+
], 46, Ai)) : M("", !0)]));
|
|
878
879
|
}
|
|
879
|
-
}), [["__scopeId", "data-v-fc8f35bc"]]),
|
|
880
|
+
}), [["__scopeId", "data-v-fc8f35bc"]]), Ki = ["disabled", "onMousedown"], qi = {
|
|
880
881
|
key: 0,
|
|
881
882
|
class: "ctx-menu__icon"
|
|
882
|
-
},
|
|
883
|
+
}, Ji = { class: "ctx-menu__label" }, Yi = {
|
|
883
884
|
key: 1,
|
|
884
885
|
class: "ctx-menu__shortcut"
|
|
885
|
-
},
|
|
886
|
+
}, Xi = 220, Zi = 32, Qi = 10, $i = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
886
887
|
__name: "TextContextMenu",
|
|
887
888
|
props: {
|
|
888
889
|
isOpen: { type: Boolean },
|
|
@@ -899,7 +900,7 @@ var li = ["aria-label"], ui = {
|
|
|
899
900
|
setup(e, { emit: t }) {
|
|
900
901
|
let n = e, i = ({ node: e }) => e;
|
|
901
902
|
i.props = ["node"];
|
|
902
|
-
let a = t, { t: o } = r(), s =
|
|
903
|
+
let a = t, { t: o } = r(), s = mi(), c = H(null), l = A(() => {
|
|
903
904
|
let e = [], t = n.customItems ?? [];
|
|
904
905
|
for (let [n, r] of t.entries()) e.push({
|
|
905
906
|
id: `custom-${r.id}`,
|
|
@@ -1035,8 +1036,8 @@ var li = ["aria-label"], ui = {
|
|
|
1035
1036
|
action: "deleteTable"
|
|
1036
1037
|
}), e;
|
|
1037
1038
|
}), u = A(() => {
|
|
1038
|
-
let e = n.position.x, t = n.position.y, r = l.value.filter((e) => !e.divider).length, i = l.value.filter((e) => e.divider).length, a = r *
|
|
1039
|
-
return typeof window < "u" && (e +
|
|
1039
|
+
let e = n.position.x, t = n.position.y, r = l.value.filter((e) => !e.divider).length, i = l.value.filter((e) => e.divider).length, a = r * Zi + i * 9;
|
|
1040
|
+
return typeof window < "u" && (e + Xi + Qi > window.innerWidth && (e = window.innerWidth - Xi - Qi), t + a + Qi > window.innerHeight && (t = window.innerHeight - a - Qi)), {
|
|
1040
1041
|
position: "fixed",
|
|
1041
1042
|
left: `${e}px`,
|
|
1042
1043
|
top: `${t}px`,
|
|
@@ -1074,12 +1075,12 @@ var li = ["aria-label"], ui = {
|
|
|
1074
1075
|
disabled: e.disabled,
|
|
1075
1076
|
onMousedown: q((t) => d(e.action), ["prevent"])
|
|
1076
1077
|
}, [
|
|
1077
|
-
e.icon ? (V(), N("span",
|
|
1078
|
-
P("span",
|
|
1079
|
-
e.shortcut ? (V(), N("span",
|
|
1080
|
-
], 42,
|
|
1078
|
+
e.icon ? (V(), N("span", qi, [F(i, { node: e.icon }, null, 8, ["node"])])) : M("", !0),
|
|
1079
|
+
P("span", Ji, W(e.label), 1),
|
|
1080
|
+
e.shortcut ? (V(), N("span", Yi, W(e.shortcut), 1)) : M("", !0)
|
|
1081
|
+
], 42, Ki))), 128))], 38)) : M("", !0)]));
|
|
1081
1082
|
}
|
|
1082
|
-
}), [["__scopeId", "data-v-c1416e84"]]),
|
|
1083
|
+
}), [["__scopeId", "data-v-c1416e84"]]), ea = /* @__PURE__ */ I({
|
|
1083
1084
|
__name: "DocxEditorOverlays",
|
|
1084
1085
|
props: {
|
|
1085
1086
|
readOnly: { type: Boolean },
|
|
@@ -1098,7 +1099,7 @@ var li = ["aria-label"], ui = {
|
|
|
1098
1099
|
],
|
|
1099
1100
|
setup(e, { emit: t }) {
|
|
1100
1101
|
let n = t;
|
|
1101
|
-
return (t, r) => (V(), N(O, null, [F(
|
|
1102
|
+
return (t, r) => (V(), N(O, null, [F($i, {
|
|
1102
1103
|
"is-open": e.contextMenu.isOpen,
|
|
1103
1104
|
position: e.contextMenu.position,
|
|
1104
1105
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -1120,7 +1121,7 @@ var li = ["aria-label"], ui = {
|
|
|
1120
1121
|
"can-merge-cells",
|
|
1121
1122
|
"can-split-cell",
|
|
1122
1123
|
"custom-items"
|
|
1123
|
-
]), F(
|
|
1124
|
+
]), F(Gi, {
|
|
1124
1125
|
state: e.imageContextMenu,
|
|
1125
1126
|
"text-actions": e.imageContextMenuTextActions,
|
|
1126
1127
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -1137,7 +1138,7 @@ var li = ["aria-label"], ui = {
|
|
|
1137
1138
|
});
|
|
1138
1139
|
//#endregion
|
|
1139
1140
|
//#region src/composables/imageOverlayRect.ts
|
|
1140
|
-
function
|
|
1141
|
+
function ta(e) {
|
|
1141
1142
|
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
1142
1143
|
return {
|
|
1143
1144
|
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
@@ -1148,13 +1149,13 @@ function Yi(e) {
|
|
|
1148
1149
|
}
|
|
1149
1150
|
//#endregion
|
|
1150
1151
|
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
1151
|
-
var
|
|
1152
|
+
var na = ["data-handle", "onMousedown"], ra = ["title"], ia = {
|
|
1152
1153
|
key: 0,
|
|
1153
1154
|
class: "image-overlay__dim"
|
|
1154
|
-
},
|
|
1155
|
+
}, aa = {
|
|
1155
1156
|
key: 1,
|
|
1156
1157
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
1157
|
-
},
|
|
1158
|
+
}, oa = 4, sa = 15, ca = 250, la = 700, ua = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1158
1159
|
__name: "ImageSelectionOverlay",
|
|
1159
1160
|
props: {
|
|
1160
1161
|
imageInfo: {},
|
|
@@ -1168,8 +1169,8 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1168
1169
|
"context-menu"
|
|
1169
1170
|
],
|
|
1170
1171
|
setup(e, { emit: t }) {
|
|
1171
|
-
let { t: n } = r(), i = e, a = t, o = H(null), s = H(!1), c = H(!1), l = H(!1), u = H(0), d = H(0), f = H(0), p = H(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null,
|
|
1172
|
-
function
|
|
1172
|
+
let { t: n } = r(), i = e, a = t, o = H(null), s = H(!1), c = H(!1), l = H(!1), u = H(0), d = H(0), f = H(0), p = H(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, ee = null;
|
|
1173
|
+
function te(e, t) {
|
|
1173
1174
|
if (!e) return null;
|
|
1174
1175
|
try {
|
|
1175
1176
|
let n = e.state.doc.nodeAt(t);
|
|
@@ -1178,25 +1179,25 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1178
1179
|
return null;
|
|
1179
1180
|
}
|
|
1180
1181
|
}
|
|
1181
|
-
function
|
|
1182
|
+
function ne(e) {
|
|
1182
1183
|
if (!e) return null;
|
|
1183
1184
|
let t = e.attrs.transform;
|
|
1184
1185
|
return typeof t == "string" ? t : null;
|
|
1185
1186
|
}
|
|
1186
|
-
function
|
|
1187
|
+
function re() {
|
|
1187
1188
|
return o.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
|
|
1188
1189
|
}
|
|
1189
|
-
function
|
|
1190
|
+
function ie() {
|
|
1190
1191
|
let e = i.imageInfo;
|
|
1191
1192
|
if (!e) return null;
|
|
1192
1193
|
if (e.element.isConnected) return e.element;
|
|
1193
|
-
let t =
|
|
1194
|
+
let t = re();
|
|
1194
1195
|
if (!t) return null;
|
|
1195
1196
|
let n = Kt(t, e.pmPos);
|
|
1196
1197
|
return n ? Ft(n) : null;
|
|
1197
1198
|
}
|
|
1198
|
-
function
|
|
1199
|
-
let e =
|
|
1199
|
+
function S() {
|
|
1200
|
+
let e = ie();
|
|
1200
1201
|
if (!e || !o.value) {
|
|
1201
1202
|
p.value = null;
|
|
1202
1203
|
return;
|
|
@@ -1207,7 +1208,7 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1207
1208
|
return;
|
|
1208
1209
|
}
|
|
1209
1210
|
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
1210
|
-
p.value =
|
|
1211
|
+
p.value = ta({
|
|
1211
1212
|
imageRect: r,
|
|
1212
1213
|
parentRect: n,
|
|
1213
1214
|
scrollLeft: t.scrollLeft,
|
|
@@ -1217,19 +1218,19 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1217
1218
|
zoom: i.zoom
|
|
1218
1219
|
});
|
|
1219
1220
|
}
|
|
1220
|
-
let
|
|
1221
|
-
function
|
|
1222
|
-
|
|
1221
|
+
let oe = null;
|
|
1222
|
+
function se() {
|
|
1223
|
+
oe?.();
|
|
1223
1224
|
let e = 0, t = "", n = 0, r = 0, i = (a) => {
|
|
1224
1225
|
r === 0 && (r = a);
|
|
1225
1226
|
let o = a - r;
|
|
1226
|
-
|
|
1227
|
+
S();
|
|
1227
1228
|
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
1228
|
-
n = c === t ? n + 1 : 0, t = c, !(o >=
|
|
1229
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= ca && n >= 2) && o < la && (e = requestAnimationFrame(i));
|
|
1229
1230
|
};
|
|
1230
1231
|
e = requestAnimationFrame(i);
|
|
1231
|
-
let a = setTimeout(
|
|
1232
|
-
|
|
1232
|
+
let a = setTimeout(S, ca);
|
|
1233
|
+
oe = () => {
|
|
1233
1234
|
cancelAnimationFrame(e), clearTimeout(a);
|
|
1234
1235
|
};
|
|
1235
1236
|
}
|
|
@@ -1238,20 +1239,20 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1238
1239
|
p.value = null;
|
|
1239
1240
|
return;
|
|
1240
1241
|
}
|
|
1241
|
-
|
|
1242
|
+
se(), n(() => oe?.());
|
|
1242
1243
|
}, { immediate: !0 }), K(() => i.zoom, () => {
|
|
1243
|
-
i.imageInfo &&
|
|
1244
|
+
i.imageInfo && se();
|
|
1244
1245
|
}), K(() => i.imageInfo, (e, t, n) => {
|
|
1245
1246
|
if (!i.imageInfo) return;
|
|
1246
1247
|
let r = () => {
|
|
1247
|
-
b && cancelAnimationFrame(b), b = requestAnimationFrame(
|
|
1248
|
+
b && cancelAnimationFrame(b), b = requestAnimationFrame(S);
|
|
1248
1249
|
}, a = o.value?.closest(".docx-editor-vue__pages-viewport");
|
|
1249
1250
|
a?.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r, { passive: !0 });
|
|
1250
1251
|
let s = null, c = !1;
|
|
1251
1252
|
Oe(() => {
|
|
1252
1253
|
if (c || !i.imageInfo) return;
|
|
1253
|
-
let e =
|
|
1254
|
-
e && (s = new MutationObserver(() =>
|
|
1254
|
+
let e = re();
|
|
1255
|
+
e && (s = new MutationObserver(() => se()), s.observe(e, {
|
|
1255
1256
|
attributes: !0,
|
|
1256
1257
|
attributeFilter: ["style"]
|
|
1257
1258
|
}));
|
|
@@ -1259,7 +1260,7 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1259
1260
|
c = !0, a?.removeEventListener("scroll", r), window.removeEventListener("resize", r), s?.disconnect(), b && cancelAnimationFrame(b);
|
|
1260
1261
|
});
|
|
1261
1262
|
}, { immediate: !0 });
|
|
1262
|
-
let
|
|
1263
|
+
let C = A(() => s.value ? u.value : p.value?.width || 0), ce = A(() => s.value ? d.value : p.value?.height || 0), le = A(() => {
|
|
1263
1264
|
let e = p.value;
|
|
1264
1265
|
if (!e) return {
|
|
1265
1266
|
position: "absolute",
|
|
@@ -1277,11 +1278,11 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1277
1278
|
height: `${n}px`,
|
|
1278
1279
|
transform: r === 1 ? void 0 : `scale(${r})`,
|
|
1279
1280
|
transformOrigin: "top left",
|
|
1280
|
-
zIndex:
|
|
1281
|
+
zIndex: ae.imageOverlay,
|
|
1281
1282
|
pointerEvents: "auto"
|
|
1282
1283
|
};
|
|
1283
|
-
}),
|
|
1284
|
-
let e =
|
|
1284
|
+
}), ue = A(() => {
|
|
1285
|
+
let e = C.value, t = ce.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
|
|
1285
1286
|
return [
|
|
1286
1287
|
{
|
|
1287
1288
|
pos: "nw",
|
|
@@ -1349,10 +1350,10 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1349
1350
|
}
|
|
1350
1351
|
];
|
|
1351
1352
|
});
|
|
1352
|
-
function
|
|
1353
|
-
!i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove",
|
|
1353
|
+
function de(e, t) {
|
|
1354
|
+
!i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove", fe), document.addEventListener("mouseup", pe));
|
|
1354
1355
|
}
|
|
1355
|
-
function
|
|
1356
|
+
function fe(e) {
|
|
1356
1357
|
let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = Vt(m, n, r, _, v, a);
|
|
1357
1358
|
u.value = Math.round(o.width), d.value = Math.round(o.height);
|
|
1358
1359
|
let s = y;
|
|
@@ -1366,17 +1367,17 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1366
1367
|
};
|
|
1367
1368
|
}
|
|
1368
1369
|
}
|
|
1369
|
-
function
|
|
1370
|
-
document.removeEventListener("mousemove",
|
|
1370
|
+
function pe() {
|
|
1371
|
+
document.removeEventListener("mousemove", fe), document.removeEventListener("mouseup", pe), s.value = !1, y = null, a("interact-end");
|
|
1371
1372
|
let e = i.view, t = i.imageInfo;
|
|
1372
1373
|
if (!e || !t) {
|
|
1373
|
-
|
|
1374
|
+
S();
|
|
1374
1375
|
return;
|
|
1375
1376
|
}
|
|
1376
1377
|
let n = Wt(e, t.pmPos, u.value, d.value);
|
|
1377
|
-
n !== null && Ce(n), Oe(() =>
|
|
1378
|
+
n !== null && Ce(n), Oe(() => S());
|
|
1378
1379
|
}
|
|
1379
|
-
let
|
|
1380
|
+
let me = 0, he = 0, w = 0, ge = 0, T = null, E = null;
|
|
1380
1381
|
function _e(e) {
|
|
1381
1382
|
if (!e) return 0;
|
|
1382
1383
|
let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/)?.[1];
|
|
@@ -1387,37 +1388,37 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1387
1388
|
return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
|
|
1388
1389
|
}
|
|
1389
1390
|
function ye(e, t) {
|
|
1390
|
-
return Math.atan2(e -
|
|
1391
|
+
return Math.atan2(e - me, -(t - he)) * 180 / Math.PI;
|
|
1391
1392
|
}
|
|
1392
1393
|
function be(e) {
|
|
1393
1394
|
if (!i.imageInfo) return;
|
|
1394
1395
|
let t = i.imageInfo.element.getBoundingClientRect();
|
|
1395
|
-
|
|
1396
|
+
me = t.left + t.width / 2, he = t.top + t.height / 2, T = ne(te(i.view, i.imageInfo.pmPos)), ge = _e(T), E = i.imageInfo.element.querySelector("img"), w = ye(e.clientX, e.clientY), f.value = ge, l.value = !0, a("interact-start"), document.addEventListener("mousemove", xe), document.addEventListener("mouseup", D);
|
|
1396
1397
|
}
|
|
1397
1398
|
function xe(e) {
|
|
1398
|
-
let t = ye(e.clientX, e.clientY) -
|
|
1399
|
-
e.shiftKey || (n = Math.round(n /
|
|
1399
|
+
let t = ye(e.clientX, e.clientY) - w, n = ge + t;
|
|
1400
|
+
e.shiftKey || (n = Math.round(n / sa) * sa), f.value = (n % 360 + 360) % 360, E && (E.style.transform = ve(T, f.value) || "");
|
|
1400
1401
|
}
|
|
1401
1402
|
function D() {
|
|
1402
1403
|
document.removeEventListener("mousemove", xe), document.removeEventListener("mouseup", D), l.value = !1, a("interact-end");
|
|
1403
1404
|
let e = i.view, t = i.imageInfo;
|
|
1404
1405
|
try {
|
|
1405
|
-
let n = e && t ?
|
|
1406
|
+
let n = e && t ? te(e, t.pmPos) : null;
|
|
1406
1407
|
e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
|
|
1407
1408
|
...n.attrs,
|
|
1408
|
-
transform: ve(
|
|
1409
|
+
transform: ve(ne(n), f.value)
|
|
1409
1410
|
})), Ce(t.pmPos));
|
|
1410
1411
|
} catch {} finally {
|
|
1411
|
-
E && (E.style.transform = ""), E = null,
|
|
1412
|
+
E && (E.style.transform = ""), E = null, T = null;
|
|
1412
1413
|
}
|
|
1413
|
-
Oe(() =>
|
|
1414
|
+
Oe(() => S());
|
|
1414
1415
|
}
|
|
1415
1416
|
let k = null;
|
|
1416
1417
|
function Se(e) {
|
|
1417
1418
|
if (!i.imageInfo || !p.value) return;
|
|
1418
1419
|
let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
|
|
1419
1420
|
let s = e.clientX - t, l = e.clientY - n;
|
|
1420
|
-
if (!(!o && Math.sqrt(s * s + l * l) <
|
|
1421
|
+
if (!(!o && Math.sqrt(s * s + l * l) < oa)) {
|
|
1421
1422
|
if (!o) {
|
|
1422
1423
|
o = !0, c.value = !0, a("interact-start"), k = document.createElement("div"), k.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);";
|
|
1423
1424
|
let e = i.zoom;
|
|
@@ -1429,14 +1430,14 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1429
1430
|
}
|
|
1430
1431
|
}
|
|
1431
1432
|
}, l = (e) => {
|
|
1432
|
-
document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null,
|
|
1433
|
+
document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", l), x = null, ee = null, k &&= (k.remove(), null), c.value = !1, o && (a("interact-end"), j(e.clientX, e.clientY));
|
|
1433
1434
|
};
|
|
1434
|
-
x = s,
|
|
1435
|
+
x = s, ee = l, document.addEventListener("mousemove", s), document.addEventListener("mouseup", l);
|
|
1435
1436
|
}
|
|
1436
1437
|
function j(e, t) {
|
|
1437
1438
|
let n = i.view, r = i.imageInfo;
|
|
1438
1439
|
if (!n || !r) return;
|
|
1439
|
-
let a =
|
|
1440
|
+
let a = te(n, r.pmPos);
|
|
1440
1441
|
if (!a) return;
|
|
1441
1442
|
let s;
|
|
1442
1443
|
if (Gt(a)) {
|
|
@@ -1458,13 +1459,13 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1458
1459
|
let l = c.getBoundingClientRect(), u = i.zoom, d = jt((e - l.left) / u), f = jt((t - l.top) / u);
|
|
1459
1460
|
s = Ht(n, r.pmPos, d, f);
|
|
1460
1461
|
} else {
|
|
1461
|
-
let i =
|
|
1462
|
+
let i = re();
|
|
1462
1463
|
if (!i) return;
|
|
1463
1464
|
let a = Bt(i, e, t, 1);
|
|
1464
1465
|
if (a == null || a < 0) return;
|
|
1465
1466
|
s = Ut(n, r.pmPos, a);
|
|
1466
1467
|
}
|
|
1467
|
-
s !== null && Ce(s), Oe(() =>
|
|
1468
|
+
s !== null && Ce(s), Oe(() => S());
|
|
1468
1469
|
}
|
|
1469
1470
|
function Ce(e) {
|
|
1470
1471
|
let t = i.view;
|
|
@@ -1474,13 +1475,13 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1474
1475
|
} catch {}
|
|
1475
1476
|
}
|
|
1476
1477
|
return B(() => {
|
|
1477
|
-
document.removeEventListener("mousemove",
|
|
1478
|
+
document.removeEventListener("mousemove", fe), document.removeEventListener("mouseup", pe), document.removeEventListener("mousemove", xe), document.removeEventListener("mouseup", D), x && document.removeEventListener("mousemove", x), ee && document.removeEventListener("mouseup", ee), k &&= (k.remove(), null), b && cancelAnimationFrame(b), oe?.();
|
|
1478
1479
|
}), (t, r) => e.imageInfo ? (V(), N("div", {
|
|
1479
1480
|
key: 0,
|
|
1480
1481
|
ref_key: "overlayRootRef",
|
|
1481
1482
|
ref: o,
|
|
1482
1483
|
class: "image-overlay",
|
|
1483
|
-
style: z(
|
|
1484
|
+
style: z(le.value),
|
|
1484
1485
|
onMousedown: r[3] ||= q(() => {}, ["stop"])
|
|
1485
1486
|
}, [
|
|
1486
1487
|
r[4] ||= P("div", { class: "image-overlay__border" }, null, -1),
|
|
@@ -1490,25 +1491,25 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1490
1491
|
onMousedown: r[0] ||= q((e) => Se(e), ["prevent", "stop"]),
|
|
1491
1492
|
onContextmenu: r[1] ||= q((e) => t.$emit("context-menu", e), ["prevent", "stop"])
|
|
1492
1493
|
}, null, 36),
|
|
1493
|
-
(V(!0), N(O, null, U(
|
|
1494
|
+
(V(!0), N(O, null, U(ue.value, (e) => (V(), N("div", {
|
|
1494
1495
|
key: e.pos,
|
|
1495
1496
|
class: "image-overlay__handle",
|
|
1496
1497
|
style: z(e.style),
|
|
1497
1498
|
"data-handle": e.pos,
|
|
1498
|
-
onMousedown: q((t) =>
|
|
1499
|
-
}, null, 44,
|
|
1499
|
+
onMousedown: q((t) => de(t, e.pos), ["prevent", "stop"])
|
|
1500
|
+
}, null, 44, na))), 128)),
|
|
1500
1501
|
r[5] ||= P("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
1501
1502
|
P("div", {
|
|
1502
1503
|
class: "image-overlay__rotate-handle",
|
|
1503
|
-
style: z({ left: `${
|
|
1504
|
+
style: z({ left: `${C.value / 2 - 7}px` }),
|
|
1504
1505
|
title: G(n)("imageOverlay.rotate"),
|
|
1505
1506
|
onMousedown: r[2] ||= q((e) => be(e), ["prevent", "stop"])
|
|
1506
|
-
}, null, 44,
|
|
1507
|
-
s.value ? (V(), N("div",
|
|
1508
|
-
l.value ? (V(), N("div",
|
|
1507
|
+
}, null, 44, ra),
|
|
1508
|
+
s.value ? (V(), N("div", ia, W(Math.round(u.value)) + " × " + W(Math.round(d.value)), 1)) : M("", !0),
|
|
1509
|
+
l.value ? (V(), N("div", aa, W(Math.round(f.value)) + "° ", 1)) : M("", !0)
|
|
1509
1510
|
], 36)) : M("", !0);
|
|
1510
1511
|
}
|
|
1511
|
-
}), [["__scopeId", "data-v-4c3d1a1d"]]),
|
|
1512
|
+
}), [["__scopeId", "data-v-4c3d1a1d"]]), da = /* @__PURE__ */ I({
|
|
1512
1513
|
__name: "HeaderFooterSelectionOverlay",
|
|
1513
1514
|
props: {
|
|
1514
1515
|
pagesContainer: {},
|
|
@@ -1532,7 +1533,7 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1532
1533
|
t.zoom
|
|
1533
1534
|
], r), (e, t) => null;
|
|
1534
1535
|
}
|
|
1535
|
-
}),
|
|
1536
|
+
}), fa = { class: "hf-editor-label" }, pa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1536
1537
|
__name: "InlineHeaderFooterEditor",
|
|
1537
1538
|
props: {
|
|
1538
1539
|
edit: {},
|
|
@@ -1575,7 +1576,7 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1575
1576
|
class: "hf-inline-editor",
|
|
1576
1577
|
style: z(l.value),
|
|
1577
1578
|
role: "presentation"
|
|
1578
|
-
}, [P("div", { class: R(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span",
|
|
1579
|
+
}, [P("div", { class: R(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span", fa, W(c.value), 1), P("div", {
|
|
1579
1580
|
class: "hf-options",
|
|
1580
1581
|
onMousedown: n[5] ||= q(() => {}, ["stop"])
|
|
1581
1582
|
}, [F(G(a), {
|
|
@@ -1625,7 +1626,7 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1625
1626
|
})
|
|
1626
1627
|
], 2)) : M("", !0)], 32)], 2)], 4));
|
|
1627
1628
|
}
|
|
1628
|
-
}), [["__scopeId", "data-v-a0bd3730"]]),
|
|
1629
|
+
}), [["__scopeId", "data-v-a0bd3730"]]), ma = ["title", "aria-label"], ha = /* @__PURE__ */ I({
|
|
1629
1630
|
__name: "OutlineToggleButton",
|
|
1630
1631
|
props: {
|
|
1631
1632
|
leftOffset: {},
|
|
@@ -1648,9 +1649,9 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1648
1649
|
}, [F(i, {
|
|
1649
1650
|
name: "format_list_bulleted",
|
|
1650
1651
|
size: 20
|
|
1651
|
-
})], 44,
|
|
1652
|
+
})], 44, ma));
|
|
1652
1653
|
}
|
|
1653
|
-
}),
|
|
1654
|
+
}), ga = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1654
1655
|
__name: "PageIndicator",
|
|
1655
1656
|
props: {
|
|
1656
1657
|
currentPage: {},
|
|
@@ -1669,7 +1670,7 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1669
1670
|
total: e.totalPages
|
|
1670
1671
|
})), 5));
|
|
1671
1672
|
}
|
|
1672
|
-
}), [["__scopeId", "data-v-f1904974"]]),
|
|
1673
|
+
}), [["__scopeId", "data-v-f1904974"]]), _a = ["data-folio-block-id"], va = ["data-folio-block-id", "title"], ya = 2.5, ba = 5, xa = 6, Sa = 2, Ca = 2, wa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1673
1674
|
__name: "TemplateDirectivesOverlay",
|
|
1674
1675
|
props: {
|
|
1675
1676
|
getView: { type: Function },
|
|
@@ -1683,19 +1684,19 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1683
1684
|
setup(e) {
|
|
1684
1685
|
let t = e, n = /* @__PURE__ */ new Set(["if", "each"]), r = /* @__PURE__ */ new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
|
|
1685
1686
|
function a(e) {
|
|
1686
|
-
let t = e -
|
|
1687
|
-
return t <= 0 ? 0 : Math.floor(t /
|
|
1687
|
+
let t = e - xa - ya - Sa;
|
|
1688
|
+
return t <= 0 ? 0 : Math.floor(t / ba);
|
|
1688
1689
|
}
|
|
1689
1690
|
function o(e, t, n) {
|
|
1690
1691
|
let r = a(n), i = Math.min(Math.max(0, e), r);
|
|
1691
|
-
return t -
|
|
1692
|
+
return t - xa - ya - (r - i) * ba;
|
|
1692
1693
|
}
|
|
1693
1694
|
function s(e, t) {
|
|
1694
|
-
if (t.length === 0) return e.bottom - e.top >=
|
|
1695
|
+
if (t.length === 0) return e.bottom - e.top >= Ca ? [e] : [];
|
|
1695
1696
|
let n = [];
|
|
1696
1697
|
for (let r of t) {
|
|
1697
1698
|
let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
|
|
1698
|
-
i - t >=
|
|
1699
|
+
i - t >= Ca && n.push({
|
|
1699
1700
|
top: t,
|
|
1700
1701
|
bottom: i
|
|
1701
1702
|
});
|
|
@@ -1793,49 +1794,49 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1793
1794
|
t.blocks,
|
|
1794
1795
|
t.measures
|
|
1795
1796
|
], () => y());
|
|
1796
|
-
let x = A(() => c(f.value)),
|
|
1797
|
+
let x = A(() => c(f.value)), ee = A(() => m.value ? d(x.value, p.value, m.value) : []), te = A(() => {
|
|
1797
1798
|
let e = /* @__PURE__ */ new Map();
|
|
1798
1799
|
for (let t of x.value) e.set(t.openerFrom, t.blockId), e.set(t.closerFrom, t.blockId);
|
|
1799
1800
|
return e;
|
|
1800
|
-
}),
|
|
1801
|
+
}), ne = A(() => {
|
|
1801
1802
|
let e = /* @__PURE__ */ new Map();
|
|
1802
1803
|
for (let t of x.value) e.set(t.closerFrom, l(t.kind, t.openerExpr));
|
|
1803
1804
|
return e;
|
|
1804
|
-
}),
|
|
1805
|
-
function re(e) {
|
|
1806
|
-
return e === g.value || e === ne.value;
|
|
1807
|
-
}
|
|
1805
|
+
}), re = A(() => u(x.value, h.value));
|
|
1808
1806
|
function ie(e) {
|
|
1809
|
-
return e
|
|
1810
|
-
}
|
|
1811
|
-
function C(e) {
|
|
1812
|
-
return e.block ? ee.value.get(e.from) : void 0;
|
|
1807
|
+
return e === g.value || e === re.value;
|
|
1813
1808
|
}
|
|
1814
1809
|
function ae(e) {
|
|
1810
|
+
return e.block && (n.has(e.kind) || r.has(e.kind));
|
|
1811
|
+
}
|
|
1812
|
+
function S(e) {
|
|
1815
1813
|
return e.block ? te.value.get(e.from) : void 0;
|
|
1816
1814
|
}
|
|
1817
1815
|
function oe(e) {
|
|
1818
|
-
|
|
1816
|
+
return e.block ? ne.value.get(e.from) : void 0;
|
|
1817
|
+
}
|
|
1818
|
+
function se(e) {
|
|
1819
|
+
let t = S(e), n = t !== void 0 && ie(t);
|
|
1819
1820
|
return [
|
|
1820
1821
|
"folio-template-directive",
|
|
1821
1822
|
`folio-template-directive--${e.kind}`,
|
|
1822
|
-
{ "folio-template-directive--block":
|
|
1823
|
+
{ "folio-template-directive--block": ae(e) },
|
|
1823
1824
|
{ "folio-template-directive--active": n }
|
|
1824
1825
|
];
|
|
1825
1826
|
}
|
|
1826
|
-
function
|
|
1827
|
+
function C(e) {
|
|
1827
1828
|
if (!(e instanceof HTMLElement)) return null;
|
|
1828
1829
|
let t = e.dataset.folioBlockId;
|
|
1829
1830
|
return t === void 0 ? null : Number(t);
|
|
1830
1831
|
}
|
|
1831
|
-
function
|
|
1832
|
-
let t =
|
|
1832
|
+
function ce(e) {
|
|
1833
|
+
let t = C(e.target);
|
|
1833
1834
|
t !== null && (g.value = t);
|
|
1834
1835
|
}
|
|
1835
|
-
function
|
|
1836
|
-
let t =
|
|
1836
|
+
function le(e) {
|
|
1837
|
+
let t = C(e.target);
|
|
1837
1838
|
if (t === null) return;
|
|
1838
|
-
let n =
|
|
1839
|
+
let n = C(e.relatedTarget);
|
|
1839
1840
|
n !== t && g.value === t && (g.value = n);
|
|
1840
1841
|
}
|
|
1841
1842
|
return ke(() => y()), B(() => {
|
|
@@ -1843,28 +1844,28 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1843
1844
|
}), (t, n) => (V(), N("div", {
|
|
1844
1845
|
class: "folio-template-directives-overlay",
|
|
1845
1846
|
"data-folio-template-directives-overlay": "",
|
|
1846
|
-
onPointerover:
|
|
1847
|
-
onPointerout:
|
|
1848
|
-
}, [(V(!0), N(O, null, U(
|
|
1847
|
+
onPointerover: ce,
|
|
1848
|
+
onPointerout: le
|
|
1849
|
+
}, [(V(!0), N(O, null, U(ee.value, (t) => (V(), N(O, { key: `rail:${t.blockId}` }, [(V(!0), N(O, null, U(t.segments, (n, r) => (V(), N("div", {
|
|
1849
1850
|
key: `rail:${t.blockId}:${r}`,
|
|
1850
1851
|
class: R([
|
|
1851
1852
|
"folio-template-band-rail",
|
|
1852
1853
|
`folio-template-band-rail--${t.kind}`,
|
|
1853
|
-
{ "folio-template-band-rail--active":
|
|
1854
|
+
{ "folio-template-band-rail--active": ie(t.blockId) }
|
|
1854
1855
|
]),
|
|
1855
1856
|
"data-folio-block-id": t.blockId,
|
|
1856
1857
|
style: z({
|
|
1857
1858
|
position: "absolute",
|
|
1858
1859
|
left: `${t.railX * e.zoom}px`,
|
|
1859
1860
|
top: `${n.top * e.zoom}px`,
|
|
1860
|
-
width: `${
|
|
1861
|
+
width: `${ya * e.zoom}px`,
|
|
1861
1862
|
height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
|
|
1862
1863
|
})
|
|
1863
|
-
}, null, 14,
|
|
1864
|
+
}, null, 14, _a))), 128))], 64))), 128)), (V(!0), N(O, null, U(p.value, (t, n) => (V(), N(O, { key: `d:${n}` }, [(V(!0), N(O, null, U(t.rects, (r, i) => (V(), N("span", {
|
|
1864
1865
|
key: `d:${n}:${i}`,
|
|
1865
|
-
class: R(
|
|
1866
|
-
"data-folio-block-id":
|
|
1867
|
-
title:
|
|
1866
|
+
class: R(se(t.range)),
|
|
1867
|
+
"data-folio-block-id": S(t.range),
|
|
1868
|
+
title: oe(t.range),
|
|
1868
1869
|
style: z({
|
|
1869
1870
|
position: "absolute",
|
|
1870
1871
|
left: `${(r.x - 1) * e.zoom}px`,
|
|
@@ -1872,9 +1873,9 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1872
1873
|
width: `${(r.width + 2) * e.zoom}px`,
|
|
1873
1874
|
height: `${Math.max(0, r.height - 2) * e.zoom}px`
|
|
1874
1875
|
})
|
|
1875
|
-
}, null, 14,
|
|
1876
|
+
}, null, 14, va))), 128))], 64))), 128))], 32));
|
|
1876
1877
|
}
|
|
1877
|
-
}), [["__scopeId", "data-v-c72dfa21"]]),
|
|
1878
|
+
}), [["__scopeId", "data-v-c72dfa21"]]), Ta = ["href", "title"], Ea = ["title"], Da = ["title"], Oa = ["title"], ka = { class: "docx-hyperlink-popup__edit-row" }, Aa = ["placeholder", "onKeydown"], ja = { class: "docx-hyperlink-popup__edit-row" }, Ma = ["onKeydown"], Na = ["disabled"], Pa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1878
1879
|
__name: "HyperlinkPopup",
|
|
1879
1880
|
props: {
|
|
1880
1881
|
data: {},
|
|
@@ -1923,28 +1924,28 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1923
1924
|
class: R(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
|
|
1924
1925
|
style: z(u.value),
|
|
1925
1926
|
onMousedown: r[6] ||= q(() => {}, ["stop"])
|
|
1926
|
-
}, [o.value ? (V(), N(O, { key: 1 }, [P("div",
|
|
1927
|
+
}, [o.value ? (V(), N(O, { key: 1 }, [P("div", ka, [Le(P("input", {
|
|
1927
1928
|
class: "docx-hyperlink-popup__input",
|
|
1928
1929
|
placeholder: G(n)("displayText"),
|
|
1929
1930
|
"onUpdate:modelValue": r[2] ||= (e) => s.value = e,
|
|
1930
1931
|
onKeydown: [Re(q(h, ["prevent"]), ["enter"]), r[3] ||= Re((e) => t.$emit("close"), ["esc"])]
|
|
1931
|
-
}, null, 40,
|
|
1932
|
+
}, null, 40, Aa), [[Pe, s.value]])]), P("div", ja, [Le(P("input", {
|
|
1932
1933
|
class: "docx-hyperlink-popup__input",
|
|
1933
1934
|
placeholder: "https://...",
|
|
1934
1935
|
"onUpdate:modelValue": r[4] ||= (e) => c.value = e,
|
|
1935
1936
|
onKeydown: [Re(q(h, ["prevent"]), ["enter"]), r[5] ||= Re((e) => t.$emit("close"), ["esc"])]
|
|
1936
|
-
}, null, 40,
|
|
1937
|
+
}, null, 40, Ma), [[Pe, c.value]]), P("button", {
|
|
1937
1938
|
class: "docx-hyperlink-popup__apply",
|
|
1938
1939
|
disabled: !c.value.trim(),
|
|
1939
1940
|
onClick: q(h, ["prevent"])
|
|
1940
|
-
}, W(G(n)("common.apply")), 9,
|
|
1941
|
+
}, W(G(n)("common.apply")), 9, Na)])], 64)) : (V(), N(O, { key: 0 }, [
|
|
1941
1942
|
r[10] ||= we("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-366df18c><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-366df18c><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-366df18c></circle><path d=\"M2 12h20\" data-v-366df18c></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-366df18c></path></svg></span>", 1),
|
|
1942
1943
|
P("a", {
|
|
1943
1944
|
class: "docx-hyperlink-popup__url",
|
|
1944
1945
|
href: e.data.href,
|
|
1945
1946
|
title: e.data.href,
|
|
1946
1947
|
onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1947
|
-
}, W(e.data.href), 9,
|
|
1948
|
+
}, W(e.data.href), 9, Ta),
|
|
1948
1949
|
r[11] ||= P("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1949
1950
|
P("button", {
|
|
1950
1951
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1966,7 +1967,7 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1966
1967
|
height: "13",
|
|
1967
1968
|
rx: "2",
|
|
1968
1969
|
ry: "2"
|
|
1969
|
-
}), P("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8,
|
|
1970
|
+
}), P("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Ea),
|
|
1970
1971
|
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
1971
1972
|
key: 0,
|
|
1972
1973
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1981,43 +1982,43 @@ var Xi = ["data-handle", "onMousedown"], Zi = ["title"], Qi = {
|
|
|
1981
1982
|
"stroke-width": "2",
|
|
1982
1983
|
"stroke-linecap": "round",
|
|
1983
1984
|
"stroke-linejoin": "round"
|
|
1984
|
-
}, [P("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), P("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,
|
|
1985
|
+
}, [P("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), P("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, Da)),
|
|
1985
1986
|
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
1986
1987
|
key: 1,
|
|
1987
1988
|
class: "docx-hyperlink-popup__btn",
|
|
1988
1989
|
title: G(n)("removeLink"),
|
|
1989
1990
|
onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
|
|
1990
|
-
}, [...r[9] ||= [we("<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-366df18c><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-366df18c></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-366df18c></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-366df18c></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-366df18c></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-366df18c></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-366df18c></line></svg>", 1)]], 8,
|
|
1991
|
+
}, [...r[9] ||= [we("<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-366df18c><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-366df18c></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-366df18c></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-366df18c></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-366df18c></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-366df18c></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-366df18c></line></svg>", 1)]], 8, Oa))
|
|
1991
1992
|
], 64))], 38)) : M("", !0);
|
|
1992
1993
|
}
|
|
1993
1994
|
}), [["__scopeId", "data-v-366df18c"]]);
|
|
1994
1995
|
//#endregion
|
|
1995
1996
|
//#region src/composables/commentMarks.ts
|
|
1996
|
-
function
|
|
1997
|
+
function Fa(e, t) {
|
|
1997
1998
|
let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
|
|
1998
1999
|
return n === r ? null : {
|
|
1999
2000
|
from: n,
|
|
2000
2001
|
to: r
|
|
2001
2002
|
};
|
|
2002
2003
|
}
|
|
2003
|
-
function
|
|
2004
|
+
function Ia({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
|
|
2004
2005
|
let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
|
|
2005
|
-
return i ?
|
|
2006
|
+
return i ? Fa(e, i) : null;
|
|
2006
2007
|
}
|
|
2007
|
-
function
|
|
2008
|
-
let i = e.state.schema.marks.comment, a =
|
|
2008
|
+
function La(e, t, n, r) {
|
|
2009
|
+
let i = e.state.schema.marks.comment, a = Fa(e.state.doc.content.size, t);
|
|
2009
2010
|
if (!i || !a) return !1;
|
|
2010
2011
|
let o = e.state.tr;
|
|
2011
2012
|
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: rn }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(At.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
|
|
2012
2013
|
}
|
|
2013
|
-
function
|
|
2014
|
-
let n = e.state.schema.marks.comment, r =
|
|
2014
|
+
function Ra(e, t) {
|
|
2015
|
+
let n = e.state.schema.marks.comment, r = Fa(e.state.doc.content.size, t);
|
|
2015
2016
|
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: rn })));
|
|
2016
2017
|
}
|
|
2017
2018
|
//#endregion
|
|
2018
2019
|
//#region src/composables/useCommentLifecycle.ts
|
|
2019
|
-
var
|
|
2020
|
-
function
|
|
2020
|
+
var za = 408, Ba = 12;
|
|
2021
|
+
function Va(e) {
|
|
2021
2022
|
let t = H(!1), n = H(null), r = H(null), i = H(null), a = H(null);
|
|
2022
2023
|
function o(t) {
|
|
2023
2024
|
let n = e.editorView.value, r = e.pagesContainer.value;
|
|
@@ -2050,7 +2051,7 @@ function Fa(e) {
|
|
|
2050
2051
|
r.value = null;
|
|
2051
2052
|
return;
|
|
2052
2053
|
}
|
|
2053
|
-
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left +
|
|
2054
|
+
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + Ba : l.width / 2 + za;
|
|
2054
2055
|
r.value = {
|
|
2055
2056
|
top: c.top - l.top,
|
|
2056
2057
|
left: Math.max(16, Math.min(d, l.width - 16)),
|
|
@@ -2061,7 +2062,7 @@ function Fa(e) {
|
|
|
2061
2062
|
function c() {
|
|
2062
2063
|
let s = e.editorView.value;
|
|
2063
2064
|
if (!s) return;
|
|
2064
|
-
let c = r.value, l = s.state.selection, u =
|
|
2065
|
+
let c = r.value, l = s.state.selection, u = Ia({
|
|
2065
2066
|
docSize: s.state.doc.content.size,
|
|
2066
2067
|
capturedRange: c ? {
|
|
2067
2068
|
from: c.from,
|
|
@@ -2080,7 +2081,7 @@ function Fa(e) {
|
|
|
2080
2081
|
r.value = null;
|
|
2081
2082
|
return;
|
|
2082
2083
|
}
|
|
2083
|
-
if (!
|
|
2084
|
+
if (!La(s, u, rn, { selectEnd: !0 })) {
|
|
2084
2085
|
r.value = null, i.value = null;
|
|
2085
2086
|
return;
|
|
2086
2087
|
}
|
|
@@ -2093,11 +2094,11 @@ function Fa(e) {
|
|
|
2093
2094
|
let n = e.editorView.value, r = i.value;
|
|
2094
2095
|
if (!n || !r) return !1;
|
|
2095
2096
|
let a = e.createComment(t);
|
|
2096
|
-
return
|
|
2097
|
+
return La(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
|
|
2097
2098
|
}
|
|
2098
2099
|
function d() {
|
|
2099
2100
|
let t = e.editorView.value;
|
|
2100
|
-
t && i.value &&
|
|
2101
|
+
t && i.value && Ra(t, i.value), l();
|
|
2101
2102
|
}
|
|
2102
2103
|
return {
|
|
2103
2104
|
isAddingComment: t,
|
|
@@ -2111,7 +2112,7 @@ function Fa(e) {
|
|
|
2111
2112
|
}
|
|
2112
2113
|
//#endregion
|
|
2113
2114
|
//#region src/composables/useCommentManagement.ts
|
|
2114
|
-
function
|
|
2115
|
+
function Ha(e) {
|
|
2115
2116
|
let t = an(), n = H([]), r = H(!1);
|
|
2116
2117
|
function i() {
|
|
2117
2118
|
r.value = !0;
|
|
@@ -2126,8 +2127,8 @@ function Ia(e) {
|
|
|
2126
2127
|
function l(e) {
|
|
2127
2128
|
i(), c([...s.value, e]);
|
|
2128
2129
|
}
|
|
2129
|
-
function u(n, r) {
|
|
2130
|
-
return on(t, s.value, e.editorView.value), sn(t, n, e.author(), r);
|
|
2130
|
+
function u(n, r, i) {
|
|
2131
|
+
return on(t, s.value, e.editorView.value), sn(t, n, i ?? e.author(), r);
|
|
2131
2132
|
}
|
|
2132
2133
|
function d() {
|
|
2133
2134
|
if (a(), o.value) return;
|
|
@@ -2157,9 +2158,7 @@ function Ia(e) {
|
|
|
2157
2158
|
}
|
|
2158
2159
|
function _(t, n) {
|
|
2159
2160
|
let r = e.editorView.value;
|
|
2160
|
-
|
|
2161
|
-
let i = cn(r, t);
|
|
2162
|
-
i && (n ? un : pn)(i.from, i.to)(r.state, r.dispatch);
|
|
2161
|
+
r && (n ? cn : mn)(t)(r.state, r.dispatch);
|
|
2163
2162
|
}
|
|
2164
2163
|
function v(e) {
|
|
2165
2164
|
_(e, !0);
|
|
@@ -2169,11 +2168,11 @@ function Ia(e) {
|
|
|
2169
2168
|
}
|
|
2170
2169
|
function b(t, n) {
|
|
2171
2170
|
let r = e.editorView.value;
|
|
2172
|
-
r &&
|
|
2171
|
+
r && ln(t, n)(r.state, r.dispatch);
|
|
2173
2172
|
}
|
|
2174
2173
|
function x(t, n) {
|
|
2175
2174
|
let r = e.editorView.value;
|
|
2176
|
-
r &&
|
|
2175
|
+
r && hn(t, n)(r.state, r.dispatch);
|
|
2177
2176
|
}
|
|
2178
2177
|
return {
|
|
2179
2178
|
comments: s,
|
|
@@ -2196,8 +2195,8 @@ function Ia(e) {
|
|
|
2196
2195
|
}
|
|
2197
2196
|
//#endregion
|
|
2198
2197
|
//#region src/utils/imageClipboard.ts
|
|
2199
|
-
function
|
|
2200
|
-
let r =
|
|
2198
|
+
function Ua(e, t, n) {
|
|
2199
|
+
let r = _n(e.state), i = e.state.schema.marks.insertion;
|
|
2201
2200
|
if (!r || !i) return;
|
|
2202
2201
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
2203
2202
|
o < 0 || t.addMark(o, a, i.create({
|
|
@@ -2206,7 +2205,7 @@ function La(e, t, n) {
|
|
|
2206
2205
|
date: r.date
|
|
2207
2206
|
}));
|
|
2208
2207
|
}
|
|
2209
|
-
function
|
|
2208
|
+
function Wa(e, t) {
|
|
2210
2209
|
let n = e.state.doc.nodeAt(t);
|
|
2211
2210
|
if (!n || n.type.name !== "image") return;
|
|
2212
2211
|
let r = n.attrs.src;
|
|
@@ -2220,7 +2219,7 @@ function Ra(e, t) {
|
|
|
2220
2219
|
e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
2221
2220
|
});
|
|
2222
2221
|
}
|
|
2223
|
-
function
|
|
2222
|
+
function Ga(e) {
|
|
2224
2223
|
return new Promise((t, n) => {
|
|
2225
2224
|
let r = new FileReader();
|
|
2226
2225
|
r.onload = () => {
|
|
@@ -2228,7 +2227,7 @@ function za(e) {
|
|
|
2228
2227
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
|
|
2229
2228
|
});
|
|
2230
2229
|
}
|
|
2231
|
-
function
|
|
2230
|
+
function Ka(e) {
|
|
2232
2231
|
return new Promise((t) => {
|
|
2233
2232
|
let n = new Image();
|
|
2234
2233
|
n.onload = () => t({
|
|
@@ -2240,7 +2239,7 @@ function Ba(e) {
|
|
|
2240
2239
|
}), n.src = e;
|
|
2241
2240
|
});
|
|
2242
2241
|
}
|
|
2243
|
-
function
|
|
2242
|
+
function qa(e, t, n, r) {
|
|
2244
2243
|
let i = e.state.schema.nodes.image;
|
|
2245
2244
|
if (!i) return;
|
|
2246
2245
|
let a = i.create({
|
|
@@ -2251,23 +2250,23 @@ function Va(e, t, n, r) {
|
|
|
2251
2250
|
wrapType: "inline",
|
|
2252
2251
|
displayMode: "inline"
|
|
2253
2252
|
}), o = e.state.tr.replaceSelectionWith(a);
|
|
2254
|
-
|
|
2253
|
+
Ua(e, o, a), e.dispatch(o);
|
|
2255
2254
|
}
|
|
2256
|
-
async function
|
|
2255
|
+
async function Ja(e) {
|
|
2257
2256
|
try {
|
|
2258
2257
|
let t = await navigator.clipboard.read();
|
|
2259
2258
|
for (let n of t) {
|
|
2260
2259
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
2261
2260
|
if (t) {
|
|
2262
|
-
let r = await
|
|
2263
|
-
a > 612 && (o = Math.round(612 / a * o), a = 612),
|
|
2261
|
+
let r = await Ga(await n.getType(t)), i = await Ka(r), a = i.width, o = i.height;
|
|
2262
|
+
a > 612 && (o = Math.round(612 / a * o), a = 612), qa(e, r, a, o);
|
|
2264
2263
|
return;
|
|
2265
2264
|
}
|
|
2266
2265
|
if (n.types.includes("text/html")) {
|
|
2267
2266
|
let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
|
|
2268
2267
|
if (r) {
|
|
2269
2268
|
let n = /data-width="(?<w>\d+)"/u.exec(t)?.groups?.w, i = /data-height="(?<h>\d+)"/u.exec(t)?.groups?.h, a = n ? Number(n) : 200, o = i ? Number(i) : 200;
|
|
2270
|
-
|
|
2269
|
+
qa(e, r, a || 200, o || 200);
|
|
2271
2270
|
return;
|
|
2272
2271
|
}
|
|
2273
2272
|
}
|
|
@@ -2288,14 +2287,14 @@ async function Ha(e) {
|
|
|
2288
2287
|
}
|
|
2289
2288
|
}
|
|
2290
2289
|
}
|
|
2291
|
-
function
|
|
2290
|
+
function Ya(e, t) {
|
|
2292
2291
|
let n = e.state.doc.nodeAt(t);
|
|
2293
2292
|
if (!n || n.type.name !== "image") return;
|
|
2294
2293
|
let r = document.createElement("input");
|
|
2295
2294
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
2296
2295
|
let i = r.files?.[0];
|
|
2297
2296
|
if (!i) return;
|
|
2298
|
-
let a = await
|
|
2297
|
+
let a = await Ga(i), o = await Ka(a), s = n.attrs.width, c = n.attrs.height, l = typeof s == "number" ? s : o.width, u = typeof c == "number" ? c : o.height, d = Math.min(l / o.width, u / o.height), f = Math.round(o.width * d), p = Math.round(o.height * d);
|
|
2299
2298
|
try {
|
|
2300
2299
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
2301
2300
|
...n.attrs,
|
|
@@ -2310,7 +2309,7 @@ function Ua(e, t) {
|
|
|
2310
2309
|
}
|
|
2311
2310
|
//#endregion
|
|
2312
2311
|
//#region src/composables/useContextMenus.ts
|
|
2313
|
-
var
|
|
2312
|
+
var Xa = /* @__PURE__ */ new Set([
|
|
2314
2313
|
"inline",
|
|
2315
2314
|
"square",
|
|
2316
2315
|
"tight",
|
|
@@ -2319,16 +2318,16 @@ var Wa = /* @__PURE__ */ new Set([
|
|
|
2319
2318
|
"behind",
|
|
2320
2319
|
"inFront"
|
|
2321
2320
|
]);
|
|
2322
|
-
function
|
|
2323
|
-
return typeof e == "string" &&
|
|
2321
|
+
function Za(e) {
|
|
2322
|
+
return typeof e == "string" && Xa.has(e);
|
|
2324
2323
|
}
|
|
2325
|
-
function
|
|
2326
|
-
return
|
|
2324
|
+
function Qa(e) {
|
|
2325
|
+
return Za(e) ? e : "inline";
|
|
2327
2326
|
}
|
|
2328
|
-
function
|
|
2327
|
+
function $a(e) {
|
|
2329
2328
|
return e === "left" || e === "right" || e === "none" ? e : null;
|
|
2330
2329
|
}
|
|
2331
|
-
function
|
|
2330
|
+
function eo(e) {
|
|
2332
2331
|
let { t } = r(), n = H({
|
|
2333
2332
|
isOpen: !1,
|
|
2334
2333
|
position: {
|
|
@@ -2402,7 +2401,7 @@ function Ja(e) {
|
|
|
2402
2401
|
i.value = l(o, a, {
|
|
2403
2402
|
x: t.clientX,
|
|
2404
2403
|
y: t.clientY
|
|
2405
|
-
},
|
|
2404
|
+
}, Qa(s.attrs.wrapType), $a(s.attrs.cssFloat)), n.value.isOpen = !1;
|
|
2406
2405
|
return;
|
|
2407
2406
|
}
|
|
2408
2407
|
}
|
|
@@ -2437,7 +2436,7 @@ function Ja(e) {
|
|
|
2437
2436
|
!o || o.type.name !== "image" || (i.value = l(a.element, a.pmPos, {
|
|
2438
2437
|
x: t.clientX,
|
|
2439
2438
|
y: t.clientY
|
|
2440
|
-
},
|
|
2439
|
+
}, Qa(o.attrs.wrapType), $a(o.attrs.cssFloat)), n.value.isOpen = !1);
|
|
2441
2440
|
}
|
|
2442
2441
|
function f(t) {
|
|
2443
2442
|
let n = e.editorView.value, r = i.value;
|
|
@@ -2461,16 +2460,16 @@ function Ja(e) {
|
|
|
2461
2460
|
case "cut":
|
|
2462
2461
|
if (e.selectedImage.value) {
|
|
2463
2462
|
let t = e.selectedImage.value.pmPos;
|
|
2464
|
-
|
|
2463
|
+
Wa(n, t);
|
|
2465
2464
|
let r = n.state.doc.nodeAt(t);
|
|
2466
2465
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null, e.onCut?.());
|
|
2467
2466
|
} else n.focus(), document.execCommand("cut");
|
|
2468
2467
|
break;
|
|
2469
2468
|
case "copy":
|
|
2470
|
-
e.selectedImage.value ? (
|
|
2469
|
+
e.selectedImage.value ? (Wa(n, e.selectedImage.value.pmPos), e.onCopy?.()) : (n.focus(), document.execCommand("copy"));
|
|
2471
2470
|
break;
|
|
2472
2471
|
case "paste":
|
|
2473
|
-
|
|
2472
|
+
Ja(n).then(() => e.onPaste?.()).catch(() => void 0);
|
|
2474
2473
|
break;
|
|
2475
2474
|
case "pasteAsPlainText":
|
|
2476
2475
|
navigator.clipboard.readText().then((t) => {
|
|
@@ -2491,7 +2490,7 @@ function Ja(e) {
|
|
|
2491
2490
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2492
2491
|
break;
|
|
2493
2492
|
case "replaceImage":
|
|
2494
|
-
e.selectedImage.value &&
|
|
2493
|
+
e.selectedImage.value && Ya(n, e.selectedImage.value.pmPos);
|
|
2495
2494
|
break;
|
|
2496
2495
|
case "deleteImage":
|
|
2497
2496
|
if (e.selectedImage.value) {
|
|
@@ -2529,7 +2528,7 @@ function Ja(e) {
|
|
|
2529
2528
|
}
|
|
2530
2529
|
//#endregion
|
|
2531
2530
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2532
|
-
function
|
|
2531
|
+
function to(e) {
|
|
2533
2532
|
async function t(t) {
|
|
2534
2533
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2535
2534
|
}
|
|
@@ -2548,8 +2547,8 @@ function Ya(e) {
|
|
|
2548
2547
|
}
|
|
2549
2548
|
//#endregion
|
|
2550
2549
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2551
|
-
var
|
|
2552
|
-
function
|
|
2550
|
+
var no = Date.now();
|
|
2551
|
+
function ro(e) {
|
|
2553
2552
|
let t = [];
|
|
2554
2553
|
function n() {
|
|
2555
2554
|
e.onPrint?.(), window.print();
|
|
@@ -2563,11 +2562,11 @@ function Za(e) {
|
|
|
2563
2562
|
function i(t, n) {
|
|
2564
2563
|
let r = e.pagesRef.value;
|
|
2565
2564
|
if (!r) return !1;
|
|
2566
|
-
let i =
|
|
2565
|
+
let i = Hn(r, t), a = i.at(0);
|
|
2567
2566
|
return a ? (a.scrollIntoView({
|
|
2568
2567
|
block: "center",
|
|
2569
2568
|
behavior: "smooth"
|
|
2570
|
-
}), n?.highlight &&
|
|
2569
|
+
}), n?.highlight && Un(i, n.highlight), !0) : !1;
|
|
2571
2570
|
}
|
|
2572
2571
|
function a() {
|
|
2573
2572
|
return e.zoom.value;
|
|
@@ -2621,7 +2620,7 @@ function Za(e) {
|
|
|
2621
2620
|
getPageNumberForPmPos: (t) => {
|
|
2622
2621
|
let n = e.layout.value;
|
|
2623
2622
|
if (!n) return null;
|
|
2624
|
-
let r =
|
|
2623
|
+
let r = Q(n, t);
|
|
2625
2624
|
return r == null ? null : r + 1;
|
|
2626
2625
|
}
|
|
2627
2626
|
}, o;
|
|
@@ -2632,7 +2631,7 @@ function Za(e) {
|
|
|
2632
2631
|
function m() {
|
|
2633
2632
|
let t = e.layout.value, n = e.editorView.value;
|
|
2634
2633
|
if (!t || !n) return 0;
|
|
2635
|
-
let r =
|
|
2634
|
+
let r = Q(t, n.state.selection.from);
|
|
2636
2635
|
return r == null ? 0 : r + 1;
|
|
2637
2636
|
}
|
|
2638
2637
|
function h(t) {
|
|
@@ -2665,10 +2664,10 @@ function Za(e) {
|
|
|
2665
2664
|
ensureEditorView: () => e.editor.ensureView(),
|
|
2666
2665
|
createAIEditSnapshot: () => {
|
|
2667
2666
|
let t = e.editorView.value;
|
|
2668
|
-
return t ?
|
|
2667
|
+
return t ? Fn(t.state.doc) : null;
|
|
2669
2668
|
},
|
|
2670
2669
|
applyDocumentOperations: ({ snapshot: n, batch: r, author: i = e.author() }) => {
|
|
2671
|
-
|
|
2670
|
+
Nn(r.version);
|
|
2672
2671
|
let a = e.editorView.value;
|
|
2673
2672
|
if (!a) {
|
|
2674
2673
|
let e = "committed";
|
|
@@ -2678,11 +2677,11 @@ function Za(e) {
|
|
|
2678
2677
|
reason: "unsupportedBlock"
|
|
2679
2678
|
}));
|
|
2680
2679
|
return {
|
|
2681
|
-
version:
|
|
2680
|
+
version: kn,
|
|
2682
2681
|
status: e,
|
|
2683
2682
|
applied: [],
|
|
2684
2683
|
skipped: t,
|
|
2685
|
-
issues:
|
|
2684
|
+
issues: Rn(r.operations, t),
|
|
2686
2685
|
receipts: [],
|
|
2687
2686
|
undoHandle: null
|
|
2688
2687
|
};
|
|
@@ -2694,15 +2693,15 @@ function Za(e) {
|
|
|
2694
2693
|
dispatch: (e) => {
|
|
2695
2694
|
a.dispatch($t(e)), c.state = a.state;
|
|
2696
2695
|
}
|
|
2697
|
-
}, l =
|
|
2696
|
+
}, l = Mn({
|
|
2698
2697
|
view: c,
|
|
2699
2698
|
snapshot: n,
|
|
2700
2699
|
batch: r,
|
|
2701
2700
|
author: i,
|
|
2702
|
-
createCommentId: e.createAIEditComment,
|
|
2701
|
+
createCommentId: (t) => e.createAIEditComment(t, i),
|
|
2703
2702
|
createUndoHandle: () => ({
|
|
2704
2703
|
type: "documentOperationUndo",
|
|
2705
|
-
id: `vue-${String(
|
|
2704
|
+
id: `vue-${String(no++)}`
|
|
2706
2705
|
})
|
|
2707
2706
|
});
|
|
2708
2707
|
return l.undoHandle !== null && t.push({
|
|
@@ -2740,13 +2739,13 @@ function Za(e) {
|
|
|
2740
2739
|
},
|
|
2741
2740
|
applyAIEditOperations: ({ snapshot: t, operations: n, mode: r = "tracked-changes", author: i = e.author() }) => {
|
|
2742
2741
|
let a = e.editorView.value;
|
|
2743
|
-
return a ?
|
|
2742
|
+
return a ? jn({
|
|
2744
2743
|
view: a,
|
|
2745
2744
|
snapshot: t,
|
|
2746
2745
|
operations: n,
|
|
2747
2746
|
mode: r,
|
|
2748
2747
|
author: i,
|
|
2749
|
-
createCommentId: e.createAIEditComment
|
|
2748
|
+
createCommentId: (t) => e.createAIEditComment(t, i)
|
|
2750
2749
|
}) : {
|
|
2751
2750
|
applied: [],
|
|
2752
2751
|
skipped: n.map((e) => ({
|
|
@@ -2757,11 +2756,11 @@ function Za(e) {
|
|
|
2757
2756
|
},
|
|
2758
2757
|
acceptAIEditOperation: (t) => {
|
|
2759
2758
|
let n = e.editorView.value;
|
|
2760
|
-
return n ?
|
|
2759
|
+
return n ? cn(t)(n.state, n.dispatch) : !1;
|
|
2761
2760
|
},
|
|
2762
2761
|
rejectAIEditOperation: (t) => {
|
|
2763
2762
|
let n = e.editorView.value;
|
|
2764
|
-
return n ?
|
|
2763
|
+
return n ? mn(t)(n.state, n.dispatch) : !1;
|
|
2765
2764
|
},
|
|
2766
2765
|
undo: s,
|
|
2767
2766
|
redo: c,
|
|
@@ -2770,13 +2769,13 @@ function Za(e) {
|
|
|
2770
2769
|
if (!n) return !1;
|
|
2771
2770
|
let r = dn(n.state, t);
|
|
2772
2771
|
if (!r) return !1;
|
|
2773
|
-
let { from: i, to: a } =
|
|
2772
|
+
let { from: i, to: a } = Zn(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2774
2773
|
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2775
2774
|
},
|
|
2776
2775
|
scrollToBlock: (t, n) => {
|
|
2777
2776
|
let r = e.editorView.value;
|
|
2778
2777
|
if (!r) return !1;
|
|
2779
|
-
let i =
|
|
2778
|
+
let i = Qn({
|
|
2780
2779
|
blockId: t,
|
|
2781
2780
|
doc: r.state.doc,
|
|
2782
2781
|
snapshot: n
|
|
@@ -2788,7 +2787,7 @@ function Za(e) {
|
|
|
2788
2787
|
highlightPassage: ({ blockId: t, text: n, snapshot: r }) => {
|
|
2789
2788
|
let a = e.editorView.value;
|
|
2790
2789
|
if (!a) return "none";
|
|
2791
|
-
let o =
|
|
2790
|
+
let o = er({
|
|
2792
2791
|
blockId: t,
|
|
2793
2792
|
text: n,
|
|
2794
2793
|
doc: a.state.doc,
|
|
@@ -2796,13 +2795,13 @@ function Za(e) {
|
|
|
2796
2795
|
});
|
|
2797
2796
|
if (o !== null) return e.setPassageHighlight(o), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(o.from)), "passage";
|
|
2798
2797
|
e.setPassageHighlight(null);
|
|
2799
|
-
let s =
|
|
2798
|
+
let s = Qn({
|
|
2800
2799
|
blockId: t,
|
|
2801
2800
|
doc: a.state.doc,
|
|
2802
2801
|
snapshot: r
|
|
2803
2802
|
});
|
|
2804
2803
|
if (s === null) return "none";
|
|
2805
|
-
let c =
|
|
2804
|
+
let c = rr(t);
|
|
2806
2805
|
if (c !== null && i(c, { highlight: {} })) return "block";
|
|
2807
2806
|
let { from: l, to: u } = s, d = a.state.doc.resolve(l), f = a.state.doc.resolve(u);
|
|
2808
2807
|
return a.dispatch(a.state.tr.setSelection(Z.between(d, f))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(l)), "block";
|
|
@@ -2813,11 +2812,11 @@ function Za(e) {
|
|
|
2813
2812
|
showInDocument: (t, n) => {
|
|
2814
2813
|
let r = e.editorView.value;
|
|
2815
2814
|
if (!r) return !1;
|
|
2816
|
-
let i = t.type === "textRange" ?
|
|
2815
|
+
let i = t.type === "textRange" ? $n({
|
|
2817
2816
|
range: t,
|
|
2818
2817
|
doc: r.state.doc,
|
|
2819
2818
|
snapshot: n
|
|
2820
|
-
}) :
|
|
2819
|
+
}) : Qn({
|
|
2821
2820
|
blockId: t.blockId,
|
|
2822
2821
|
doc: r.state.doc,
|
|
2823
2822
|
snapshot: n
|
|
@@ -2826,13 +2825,41 @@ function Za(e) {
|
|
|
2826
2825
|
let { from: a, to: o } = i, s = r.state.doc.resolve(a), c = r.state.doc.resolve(o);
|
|
2827
2826
|
return r.dispatch(r.state.tr.setSelection(Z.between(s, c))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(a)), !0;
|
|
2828
2827
|
},
|
|
2828
|
+
getSuggestions: () => {
|
|
2829
|
+
let t = e.editorView.value;
|
|
2830
|
+
return t ? pn(t.state) : [];
|
|
2831
|
+
},
|
|
2832
|
+
acceptSuggestion: (t, n) => {
|
|
2833
|
+
let r = e.editorView.value;
|
|
2834
|
+
if (!r) return {
|
|
2835
|
+
accepted: !1,
|
|
2836
|
+
appliedAs: null
|
|
2837
|
+
};
|
|
2838
|
+
let i = pn(r.state).find((e) => e.suggestionId === t)?.appliedAs ?? null, a = un(t, { author: n?.author ?? e.author() })(r.state, r.dispatch);
|
|
2839
|
+
return {
|
|
2840
|
+
accepted: a,
|
|
2841
|
+
appliedAs: a ? i : null
|
|
2842
|
+
};
|
|
2843
|
+
},
|
|
2844
|
+
rejectSuggestion: (t) => {
|
|
2845
|
+
let n = e.editorView.value;
|
|
2846
|
+
return n ? gn(t)(n.state, n.dispatch) : !1;
|
|
2847
|
+
},
|
|
2848
|
+
scrollToSuggestion: (t) => {
|
|
2849
|
+
let n = e.editorView.value;
|
|
2850
|
+
if (!n) return !1;
|
|
2851
|
+
let r = fn(n.state, t);
|
|
2852
|
+
if (!r) return !1;
|
|
2853
|
+
let { from: i, to: a } = Zn(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2854
|
+
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2855
|
+
},
|
|
2829
2856
|
getTrackedChanges: () => {
|
|
2830
2857
|
let t = e.editorView.value;
|
|
2831
|
-
return t ?
|
|
2858
|
+
return t ? zn(t.state.doc) : [];
|
|
2832
2859
|
},
|
|
2833
2860
|
getCommentAnchors: () => {
|
|
2834
2861
|
let t = e.editorView.value;
|
|
2835
|
-
return t ?
|
|
2862
|
+
return t ? Ln(t.state.doc) : [];
|
|
2836
2863
|
},
|
|
2837
2864
|
getSelectionText: () => {
|
|
2838
2865
|
let t = e.editorView.value;
|
|
@@ -2840,28 +2867,28 @@ function Za(e) {
|
|
|
2840
2867
|
},
|
|
2841
2868
|
getPageText: (t) => {
|
|
2842
2869
|
let n = e.editorView.value;
|
|
2843
|
-
return n ?
|
|
2870
|
+
return n ? or(e.layout.value, n.state.doc, t) : null;
|
|
2844
2871
|
},
|
|
2845
2872
|
getTargetPage: (t, n) => {
|
|
2846
2873
|
let r = e.editorView.value, i = e.layout.value;
|
|
2847
2874
|
if (!r || !i) return null;
|
|
2848
|
-
let a = t.type === "textRange" ?
|
|
2875
|
+
let a = t.type === "textRange" ? $n({
|
|
2849
2876
|
range: t,
|
|
2850
2877
|
doc: r.state.doc,
|
|
2851
2878
|
snapshot: n
|
|
2852
|
-
}) :
|
|
2879
|
+
}) : Qn({
|
|
2853
2880
|
blockId: t.blockId,
|
|
2854
2881
|
doc: r.state.doc,
|
|
2855
2882
|
snapshot: n
|
|
2856
2883
|
});
|
|
2857
2884
|
if (a === null) return null;
|
|
2858
|
-
let o =
|
|
2885
|
+
let o = Q(i, a.from);
|
|
2859
2886
|
return o == null ? null : o + 1;
|
|
2860
2887
|
},
|
|
2861
2888
|
getContentControls: (t = {}) => {
|
|
2862
2889
|
let n = e.editorView.value;
|
|
2863
|
-
return n ?
|
|
2864
|
-
properties:
|
|
2890
|
+
return n ? Kn(n.state.doc, t).map((e) => ({
|
|
2891
|
+
properties: Wn(e.node),
|
|
2865
2892
|
path: e.path,
|
|
2866
2893
|
pmPos: e.pos
|
|
2867
2894
|
})) : [];
|
|
@@ -2869,7 +2896,7 @@ function Za(e) {
|
|
|
2869
2896
|
scrollToContentControl: (t) => {
|
|
2870
2897
|
let n = e.editorView.value;
|
|
2871
2898
|
if (!n) return !1;
|
|
2872
|
-
let r =
|
|
2899
|
+
let r = Gn(n.state.doc, t);
|
|
2873
2900
|
if (!r) return !1;
|
|
2874
2901
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
2875
2902
|
return n.dispatch(n.state.tr.setSelection(Z.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
@@ -2877,26 +2904,26 @@ function Za(e) {
|
|
|
2877
2904
|
setContentControlContent: (t, n, r = {}) => {
|
|
2878
2905
|
let i = e.editorView.value;
|
|
2879
2906
|
if (!i) return !1;
|
|
2880
|
-
let a = typeof n == "string" ?
|
|
2907
|
+
let a = typeof n == "string" ? Jn(i.state, t, n, r) : Xn(i.state, t, n, r);
|
|
2881
2908
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2882
2909
|
},
|
|
2883
2910
|
setContentControlValue: (t, n, r = {}) => {
|
|
2884
2911
|
let i = e.editorView.value;
|
|
2885
2912
|
if (!i) return !1;
|
|
2886
|
-
let a =
|
|
2913
|
+
let a = Yn(i.state, t, n, r);
|
|
2887
2914
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2888
2915
|
},
|
|
2889
2916
|
removeContentControl: (t, n = {}) => {
|
|
2890
2917
|
let r = e.editorView.value;
|
|
2891
2918
|
if (!r) return !1;
|
|
2892
|
-
let i =
|
|
2919
|
+
let i = qn(r.state, t, n);
|
|
2893
2920
|
return i ? (r.dispatch(i), !0) : !1;
|
|
2894
2921
|
}
|
|
2895
2922
|
} };
|
|
2896
2923
|
}
|
|
2897
2924
|
//#endregion
|
|
2898
2925
|
//#region src/composables/useFormattingActions.ts
|
|
2899
|
-
function
|
|
2926
|
+
function io(e) {
|
|
2900
2927
|
let t = () => e.activeView?.value ?? e.editorView.value;
|
|
2901
2928
|
function n() {
|
|
2902
2929
|
let e = t();
|
|
@@ -2907,22 +2934,22 @@ function Qa(e) {
|
|
|
2907
2934
|
if (!r) return;
|
|
2908
2935
|
let i = e.getDocument(), a = i?.package?.styles;
|
|
2909
2936
|
if (a) {
|
|
2910
|
-
let e = ze(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ?
|
|
2911
|
-
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting),
|
|
2912
|
-
} else
|
|
2937
|
+
let e = ze(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ? fr(i.package.numbering) : null };
|
|
2938
|
+
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting), sr(n, t)(r.state, (e) => r.dispatch(e));
|
|
2939
|
+
} else sr(n)(r.state, (e) => r.dispatch(e));
|
|
2913
2940
|
r.focus();
|
|
2914
2941
|
}
|
|
2915
2942
|
function i() {
|
|
2916
2943
|
let t = e.editorView.value;
|
|
2917
|
-
t && (
|
|
2944
|
+
t && (pr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2918
2945
|
}
|
|
2919
2946
|
function a() {
|
|
2920
2947
|
let t = e.editorView.value;
|
|
2921
|
-
t && (
|
|
2948
|
+
t && (hr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2922
2949
|
}
|
|
2923
2950
|
function o() {
|
|
2924
2951
|
let t = e.editorView.value;
|
|
2925
|
-
t && (
|
|
2952
|
+
t && (mr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2926
2953
|
}
|
|
2927
2954
|
function s(e) {
|
|
2928
2955
|
let n = t();
|
|
@@ -2941,10 +2968,10 @@ function Qa(e) {
|
|
|
2941
2968
|
}
|
|
2942
2969
|
//#endregion
|
|
2943
2970
|
//#region src/utils/fontFaces.ts
|
|
2944
|
-
function
|
|
2971
|
+
function ao() {
|
|
2945
2972
|
return typeof document > "u" || !("fonts" in document) ? null : document.fonts;
|
|
2946
2973
|
}
|
|
2947
|
-
async function
|
|
2974
|
+
async function oo(e, t, n, r) {
|
|
2948
2975
|
let i;
|
|
2949
2976
|
try {
|
|
2950
2977
|
i = new FontFace(t, n, r), e.add(i);
|
|
@@ -2953,39 +2980,46 @@ async function eo(e, t, n, r) {
|
|
|
2953
2980
|
}
|
|
2954
2981
|
return await i.load().then(() => !0, () => !1) ? i : (e.delete(i), null);
|
|
2955
2982
|
}
|
|
2956
|
-
function
|
|
2957
|
-
let t =
|
|
2983
|
+
function so(e) {
|
|
2984
|
+
let t = ao();
|
|
2958
2985
|
if (t) for (let n of e) t.delete(n);
|
|
2959
2986
|
}
|
|
2960
2987
|
//#endregion
|
|
2961
2988
|
//#region src/utils/embeddedFonts.ts
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2989
|
+
var co = {
|
|
2990
|
+
faces: [],
|
|
2991
|
+
familyMap: /* @__PURE__ */ new Map()
|
|
2992
|
+
};
|
|
2993
|
+
async function lo(e) {
|
|
2994
|
+
let t = ao();
|
|
2995
|
+
if (!t) return co;
|
|
2965
2996
|
let n;
|
|
2966
2997
|
try {
|
|
2967
|
-
n = await
|
|
2998
|
+
n = await vr(e);
|
|
2968
2999
|
} catch {
|
|
2969
|
-
return
|
|
3000
|
+
return co;
|
|
2970
3001
|
}
|
|
2971
|
-
return
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
3002
|
+
return {
|
|
3003
|
+
faces: (await Promise.all(n.map((e) => oo(t, e.family, e.bytes, {
|
|
3004
|
+
weight: String(e.weight),
|
|
3005
|
+
style: e.style
|
|
3006
|
+
})))).filter((e) => e !== null),
|
|
3007
|
+
familyMap: _r(n)
|
|
3008
|
+
};
|
|
2975
3009
|
}
|
|
2976
3010
|
//#endregion
|
|
2977
3011
|
//#region src/utils/hostFonts.ts
|
|
2978
|
-
function
|
|
3012
|
+
function uo(e) {
|
|
2979
3013
|
return typeof e == "string" && e.trim().length > 0;
|
|
2980
3014
|
}
|
|
2981
|
-
function
|
|
2982
|
-
return typeof e != "object" || !e ? !1 :
|
|
3015
|
+
function fo(e) {
|
|
3016
|
+
return typeof e != "object" || !e ? !1 : uo(Reflect.get(e, "family")) && uo(Reflect.get(e, "src"));
|
|
2983
3017
|
}
|
|
2984
|
-
function
|
|
3018
|
+
function po(e) {
|
|
2985
3019
|
if (!e) return [];
|
|
2986
3020
|
let t = [];
|
|
2987
3021
|
for (let n of e) {
|
|
2988
|
-
if (!
|
|
3022
|
+
if (!fo(n)) continue;
|
|
2989
3023
|
let e = { display: "swap" };
|
|
2990
3024
|
(typeof n.weight == "number" || typeof n.weight == "string") && (e.weight = String(n.weight)), t.push({
|
|
2991
3025
|
family: n.family.trim(),
|
|
@@ -2995,31 +3029,31 @@ function ao(e) {
|
|
|
2995
3029
|
}
|
|
2996
3030
|
return t;
|
|
2997
3031
|
}
|
|
2998
|
-
async function
|
|
2999
|
-
let t =
|
|
3032
|
+
async function mo(e) {
|
|
3033
|
+
let t = ao();
|
|
3000
3034
|
if (!t) return [];
|
|
3001
|
-
let n =
|
|
3002
|
-
return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) =>
|
|
3035
|
+
let n = po(e);
|
|
3036
|
+
return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) => oo(t, e, n, r)))).filter((e) => e !== null);
|
|
3003
3037
|
}
|
|
3004
3038
|
//#endregion
|
|
3005
3039
|
//#region src/composables/useFontLifecycle.ts
|
|
3006
|
-
var
|
|
3007
|
-
loadEmbedded:
|
|
3008
|
-
loadHost:
|
|
3009
|
-
remove:
|
|
3040
|
+
var ho = {
|
|
3041
|
+
loadEmbedded: lo,
|
|
3042
|
+
loadHost: mo,
|
|
3043
|
+
remove: so
|
|
3010
3044
|
};
|
|
3011
|
-
function
|
|
3045
|
+
function go(e, t = ho) {
|
|
3012
3046
|
K(() => e.isReady.value ? e.getDocument()?.originalBuffer ?? null : null, (n, r, i) => {
|
|
3013
3047
|
if (!n) return;
|
|
3014
3048
|
let a = !1, o = [];
|
|
3015
|
-
t.loadEmbedded(n).then((n) => {
|
|
3049
|
+
t.loadEmbedded(n).then(({ faces: n, familyMap: r }) => {
|
|
3016
3050
|
if (a) {
|
|
3017
3051
|
t.remove(n);
|
|
3018
3052
|
return;
|
|
3019
3053
|
}
|
|
3020
|
-
o = n, n.length
|
|
3054
|
+
o = n, !(n.length === 0 && r.size === 0) && (gr(r.size > 0 ? r : null), e.remeasure());
|
|
3021
3055
|
}), i(() => {
|
|
3022
|
-
a = !0, t.remove(o);
|
|
3056
|
+
a = !0, t.remove(o), gr(null);
|
|
3023
3057
|
});
|
|
3024
3058
|
}, { immediate: !0 }), K(e.fonts, (n, r, i) => {
|
|
3025
3059
|
if (!n || n.length === 0) return;
|
|
@@ -3037,7 +3071,7 @@ function co(e, t = so) {
|
|
|
3037
3071
|
}
|
|
3038
3072
|
//#endregion
|
|
3039
3073
|
//#region src/composables/useHyperlinkManagement.ts
|
|
3040
|
-
function
|
|
3074
|
+
function _o(e) {
|
|
3041
3075
|
let t = H(null);
|
|
3042
3076
|
function n(e, t) {
|
|
3043
3077
|
t(e.state, (t) => e.dispatch(t), e);
|
|
@@ -3064,18 +3098,19 @@ function lo(e) {
|
|
|
3064
3098
|
r && n(t, r()), t.focus();
|
|
3065
3099
|
}
|
|
3066
3100
|
function a(e) {
|
|
3067
|
-
|
|
3101
|
+
let n = xr(e);
|
|
3102
|
+
n && (window.open(n, "_blank", "noopener,noreferrer"), t.value = null);
|
|
3068
3103
|
}
|
|
3069
3104
|
function o(n, r) {
|
|
3070
3105
|
let i = e.editorView.value;
|
|
3071
|
-
i && (
|
|
3106
|
+
i && (yr(i, {
|
|
3072
3107
|
displayText: n,
|
|
3073
3108
|
href: r
|
|
3074
3109
|
}), t.value = null, i.focus());
|
|
3075
3110
|
}
|
|
3076
3111
|
function s() {
|
|
3077
3112
|
let n = e.editorView.value;
|
|
3078
|
-
n && (
|
|
3113
|
+
n && (br(n, { popupHref: t.value?.href }), t.value = null, n.focus());
|
|
3079
3114
|
}
|
|
3080
3115
|
return {
|
|
3081
3116
|
hyperlinkPopupData: t,
|
|
@@ -3088,7 +3123,7 @@ function lo(e) {
|
|
|
3088
3123
|
}
|
|
3089
3124
|
//#endregion
|
|
3090
3125
|
//#region src/composables/useImageActions.ts
|
|
3091
|
-
function
|
|
3126
|
+
function vo(e) {
|
|
3092
3127
|
let t = Ne(null), n = H(!1), r = A(() => {
|
|
3093
3128
|
e.stateTick.value;
|
|
3094
3129
|
let n = e.editorView.value, r = t.value;
|
|
@@ -3138,7 +3173,7 @@ function uo(e) {
|
|
|
3138
3173
|
}
|
|
3139
3174
|
//#endregion
|
|
3140
3175
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
3141
|
-
function
|
|
3176
|
+
function yo(e) {
|
|
3142
3177
|
function t(t) {
|
|
3143
3178
|
if (e.handleZoomKeyDown(t), t.ctrlKey || t.metaKey) {
|
|
3144
3179
|
if (t.key === "o") {
|
|
@@ -3153,10 +3188,10 @@ function fo(e) {
|
|
|
3153
3188
|
}
|
|
3154
3189
|
//#endregion
|
|
3155
3190
|
//#region src/composables/useOutlineSidebar.ts
|
|
3156
|
-
function
|
|
3191
|
+
function bo(e) {
|
|
3157
3192
|
function t() {
|
|
3158
3193
|
let t = e.editorView.value;
|
|
3159
|
-
t && (e.outlineHeadings.value =
|
|
3194
|
+
t && (e.outlineHeadings.value = Sr(t.state.doc));
|
|
3160
3195
|
}
|
|
3161
3196
|
function n() {
|
|
3162
3197
|
e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
|
|
@@ -3187,8 +3222,9 @@ function po(e) {
|
|
|
3187
3222
|
}
|
|
3188
3223
|
//#endregion
|
|
3189
3224
|
//#region src/composables/usePageSetupControls.ts
|
|
3190
|
-
function
|
|
3225
|
+
function xo(e) {
|
|
3191
3226
|
function t(t) {
|
|
3227
|
+
if (e.readOnly.value) return;
|
|
3192
3228
|
let n = e.getDocument();
|
|
3193
3229
|
if (!n?.package?.document) return;
|
|
3194
3230
|
let r = n.package.document.finalSectionProperties ?? {};
|
|
@@ -3214,19 +3250,19 @@ function mo(e) {
|
|
|
3214
3250
|
}
|
|
3215
3251
|
function s(t) {
|
|
3216
3252
|
let n = e.editorView.value;
|
|
3217
|
-
n &&
|
|
3253
|
+
n && ur(t)(n.state, n.dispatch);
|
|
3218
3254
|
}
|
|
3219
3255
|
function c(t) {
|
|
3220
3256
|
let n = e.editorView.value;
|
|
3221
|
-
n &&
|
|
3257
|
+
n && dr(t)(n.state, n.dispatch);
|
|
3222
3258
|
}
|
|
3223
3259
|
function l(t) {
|
|
3224
3260
|
let n = e.editorView.value;
|
|
3225
|
-
n && (t < 0 ?
|
|
3261
|
+
n && (t < 0 ? lr(-t, !0)(n.state, n.dispatch) : lr(t, !1)(n.state, n.dispatch));
|
|
3226
3262
|
}
|
|
3227
3263
|
function u(t) {
|
|
3228
3264
|
let n = e.editorView.value;
|
|
3229
|
-
n &&
|
|
3265
|
+
n && cr(t)(n.state, n.dispatch);
|
|
3230
3266
|
}
|
|
3231
3267
|
return {
|
|
3232
3268
|
handlePageSetupApply: t,
|
|
@@ -3242,34 +3278,34 @@ function mo(e) {
|
|
|
3242
3278
|
}
|
|
3243
3279
|
//#endregion
|
|
3244
3280
|
//#region src/utils/textSelection.ts
|
|
3245
|
-
var
|
|
3246
|
-
function
|
|
3247
|
-
return !e || e.length === 0 ? !1 :
|
|
3281
|
+
var So = /[\p{L}\p{N}\p{M}_''-]/u, Co = /\s/;
|
|
3282
|
+
function wo(e) {
|
|
3283
|
+
return !e || e.length === 0 ? !1 : So.test(e);
|
|
3248
3284
|
}
|
|
3249
|
-
function
|
|
3250
|
-
return !e || e.length === 0 ? !1 :
|
|
3285
|
+
function To(e) {
|
|
3286
|
+
return !e || e.length === 0 ? !1 : Co.test(e);
|
|
3251
3287
|
}
|
|
3252
|
-
function
|
|
3288
|
+
function Eo(e, t) {
|
|
3253
3289
|
if (!e || e.length === 0) return [0, 0];
|
|
3254
3290
|
t = Math.max(0, Math.min(t, e.length - 1));
|
|
3255
3291
|
let n = e[t];
|
|
3256
|
-
if (
|
|
3292
|
+
if (To(n)) {
|
|
3257
3293
|
let n = t, r = t;
|
|
3258
|
-
for (; n > 0 &&
|
|
3259
|
-
for (; r < e.length &&
|
|
3294
|
+
for (; n > 0 && To(e[n - 1]);) n--;
|
|
3295
|
+
for (; r < e.length && To(e[r]);) r++;
|
|
3260
3296
|
return [n, r];
|
|
3261
3297
|
}
|
|
3262
|
-
if (
|
|
3298
|
+
if (wo(n)) {
|
|
3263
3299
|
let n = t, r = t;
|
|
3264
|
-
for (; n > 0 &&
|
|
3265
|
-
for (; r < e.length &&
|
|
3300
|
+
for (; n > 0 && wo(e[n - 1]);) n--;
|
|
3301
|
+
for (; r < e.length && wo(e[r]);) r++;
|
|
3266
3302
|
return [n, r];
|
|
3267
3303
|
}
|
|
3268
3304
|
return [t, t + 1];
|
|
3269
3305
|
}
|
|
3270
3306
|
//#endregion
|
|
3271
3307
|
//#region src/utils/domQueries.ts
|
|
3272
|
-
function
|
|
3308
|
+
function Do(e, t, n) {
|
|
3273
3309
|
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : qt(e);
|
|
3274
3310
|
for (let e of r) {
|
|
3275
3311
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
@@ -3277,7 +3313,7 @@ function bo(e, t, n) {
|
|
|
3277
3313
|
}
|
|
3278
3314
|
return null;
|
|
3279
3315
|
}
|
|
3280
|
-
function
|
|
3316
|
+
function Oo(e, t, n) {
|
|
3281
3317
|
if (!e || !t) return;
|
|
3282
3318
|
let r = Kt(e, n);
|
|
3283
3319
|
if (!r) for (let t of qt(e)) {
|
|
@@ -3294,21 +3330,21 @@ function xo(e, t, n) {
|
|
|
3294
3330
|
behavior: "smooth"
|
|
3295
3331
|
});
|
|
3296
3332
|
}
|
|
3297
|
-
function
|
|
3333
|
+
function ko(e, t, n, r) {
|
|
3298
3334
|
if (!e || !t) return null;
|
|
3299
3335
|
let i = Bt(e, n, r, 1);
|
|
3300
3336
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
3301
3337
|
}
|
|
3302
|
-
function
|
|
3338
|
+
function Ao(e, t, n, r) {
|
|
3303
3339
|
if (!e) return;
|
|
3304
|
-
let i =
|
|
3340
|
+
let i = Do(e, t, r);
|
|
3305
3341
|
if (!i) return;
|
|
3306
|
-
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] =
|
|
3342
|
+
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = Eo(a, t - o), l = o + s, u = o + c;
|
|
3307
3343
|
l < u && n(l, u);
|
|
3308
3344
|
}
|
|
3309
|
-
function
|
|
3345
|
+
function jo(e, t, n, r) {
|
|
3310
3346
|
if (!e) return;
|
|
3311
|
-
let i =
|
|
3347
|
+
let i = Do(e, t, r);
|
|
3312
3348
|
if (!i) return;
|
|
3313
3349
|
let a = i.closest(".layout-paragraph");
|
|
3314
3350
|
if (!a) return;
|
|
@@ -3317,13 +3353,13 @@ function wo(e, t, n, r) {
|
|
|
3317
3353
|
}
|
|
3318
3354
|
//#endregion
|
|
3319
3355
|
//#region src/composables/usePagesPointer.ts
|
|
3320
|
-
var
|
|
3321
|
-
function
|
|
3356
|
+
var Mo = 500;
|
|
3357
|
+
function No(e) {
|
|
3322
3358
|
let t = H(null), n = null;
|
|
3323
3359
|
function r() {
|
|
3324
3360
|
n !== null && (clearTimeout(n), n = null);
|
|
3325
3361
|
}
|
|
3326
|
-
let i = Ne(null), a = 0, o = null, s = 0, c = !1, l = null, u =
|
|
3362
|
+
let i = Ne(null), a = 0, o = null, s = 0, c = !1, l = null, u = Dr(), d = S({
|
|
3327
3363
|
pagesContainer: e.pagesRef,
|
|
3328
3364
|
onScrollExtendSelection: (e, t) => {
|
|
3329
3365
|
if (!c || l === null) return;
|
|
@@ -3336,7 +3372,7 @@ function Eo(e) {
|
|
|
3336
3372
|
visible: !1
|
|
3337
3373
|
}), p = null;
|
|
3338
3374
|
function m(t, n) {
|
|
3339
|
-
return
|
|
3375
|
+
return ko(e.pagesRef.value, e.editorView.value, t, n);
|
|
3340
3376
|
}
|
|
3341
3377
|
function h() {
|
|
3342
3378
|
let t = i.value;
|
|
@@ -3349,7 +3385,7 @@ function Eo(e) {
|
|
|
3349
3385
|
function g(t, n) {
|
|
3350
3386
|
let r = i.value, a = e.pagesRef.value, o = h();
|
|
3351
3387
|
if (r?.rId && a && o !== e.editorView.value) {
|
|
3352
|
-
let e =
|
|
3388
|
+
let e = Cr(a, r.position, r.rId, t, n);
|
|
3353
3389
|
return e === null || e < 0 ? null : Math.min(e, o?.state.doc.content.size ?? e);
|
|
3354
3390
|
}
|
|
3355
3391
|
return m(t, n);
|
|
@@ -3362,13 +3398,13 @@ function Eo(e) {
|
|
|
3362
3398
|
} catch {}
|
|
3363
3399
|
}
|
|
3364
3400
|
function v(t) {
|
|
3365
|
-
|
|
3401
|
+
Oo(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
3366
3402
|
}
|
|
3367
3403
|
function y(t) {
|
|
3368
|
-
|
|
3404
|
+
Ao(e.pagesRef.value, t, _, i.value?.position);
|
|
3369
3405
|
}
|
|
3370
3406
|
function b(t) {
|
|
3371
|
-
|
|
3407
|
+
jo(e.pagesRef.value, t, _, i.value?.position);
|
|
3372
3408
|
}
|
|
3373
3409
|
function x(t) {
|
|
3374
3410
|
let n = e.editorView.value;
|
|
@@ -3391,13 +3427,13 @@ function Eo(e) {
|
|
|
3391
3427
|
}
|
|
3392
3428
|
}
|
|
3393
3429
|
}
|
|
3394
|
-
function
|
|
3430
|
+
function ee(a) {
|
|
3395
3431
|
if (e.readOnly.value || c) return;
|
|
3396
3432
|
let o = e.pagesRef.value;
|
|
3397
3433
|
if (!o) return;
|
|
3398
3434
|
let s = e.pagesViewportRef.value;
|
|
3399
3435
|
if (!s || !(a.target instanceof HTMLElement) || a.target.closest(".docx-editor-vue__note-editor")) return;
|
|
3400
|
-
let l =
|
|
3436
|
+
let l = Er({
|
|
3401
3437
|
mouseX: a.clientX,
|
|
3402
3438
|
mouseY: a.clientY,
|
|
3403
3439
|
pagesContainer: o,
|
|
@@ -3407,7 +3443,7 @@ function Eo(e) {
|
|
|
3407
3443
|
if (!l) {
|
|
3408
3444
|
n === null && (n = setTimeout(() => {
|
|
3409
3445
|
t.value = null, n = null;
|
|
3410
|
-
},
|
|
3446
|
+
}, Tr));
|
|
3411
3447
|
return;
|
|
3412
3448
|
}
|
|
3413
3449
|
let u = e.zoom.value || 1, d = s.getBoundingClientRect();
|
|
@@ -3418,7 +3454,7 @@ function Eo(e) {
|
|
|
3418
3454
|
cellPmPos: l.cellPmPos
|
|
3419
3455
|
}, r();
|
|
3420
3456
|
}
|
|
3421
|
-
function
|
|
3457
|
+
function te(n) {
|
|
3422
3458
|
n.preventDefault(), n.stopPropagation();
|
|
3423
3459
|
let r = t.value, i = e.editorView.value;
|
|
3424
3460
|
if (!r || !i) return;
|
|
@@ -3427,7 +3463,7 @@ function Eo(e) {
|
|
|
3427
3463
|
let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow : o.addColumnRight;
|
|
3428
3464
|
s && (s()(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
|
|
3429
3465
|
}
|
|
3430
|
-
function
|
|
3466
|
+
function ne(t) {
|
|
3431
3467
|
let n = t.target;
|
|
3432
3468
|
if (n instanceof HTMLElement && n.closest(".docx-editor-vue__note-editor")) return;
|
|
3433
3469
|
let r = n instanceof HTMLElement ? n.closest("a[href]") : null;
|
|
@@ -3454,13 +3490,13 @@ function Eo(e) {
|
|
|
3454
3490
|
...l ? { tooltip: l } : {}
|
|
3455
3491
|
};
|
|
3456
3492
|
}
|
|
3457
|
-
function
|
|
3493
|
+
function re(t) {
|
|
3458
3494
|
if (e.readOnly.value || !(t.target instanceof HTMLElement)) return;
|
|
3459
3495
|
let n = t.target;
|
|
3460
3496
|
if (n.closest(".docx-editor-vue__note-editor")) return;
|
|
3461
|
-
let r =
|
|
3497
|
+
let r = wr(n);
|
|
3462
3498
|
if (r) {
|
|
3463
|
-
t.preventDefault(), t.stopPropagation(), i.value &&
|
|
3499
|
+
t.preventDefault(), t.stopPropagation(), i.value && ie(), e.openNoteStory(r);
|
|
3464
3500
|
return;
|
|
3465
3501
|
}
|
|
3466
3502
|
if (!e.showHeaderFooterEditing.value || i.value) return;
|
|
@@ -3468,11 +3504,11 @@ function Eo(e) {
|
|
|
3468
3504
|
if (!s) return;
|
|
3469
3505
|
let c = a ? "header" : "footer", l = e.getDocument();
|
|
3470
3506
|
if (!l?.package) return;
|
|
3471
|
-
let u = s.closest("[data-page-number]"), d = Number.parseInt(u?.dataset.pageNumber ?? "1", 10), f =
|
|
3507
|
+
let u = s.closest("[data-page-number]"), d = Number.parseInt(u?.dataset.pageNumber ?? "1", 10), f = Dn(l.package), p = f.hasTitlePg && d === 1, m = Tn(f, c, p);
|
|
3472
3508
|
if (!m) {
|
|
3473
|
-
let t =
|
|
3509
|
+
let t = wn(l, c, p);
|
|
3474
3510
|
if (!t) return;
|
|
3475
|
-
e.setDocument(t), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(t), f =
|
|
3511
|
+
e.setDocument(t), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(t), f = Dn(t.package), m = Tn(f, c, p);
|
|
3476
3512
|
}
|
|
3477
3513
|
if (!m) return;
|
|
3478
3514
|
let h = m, g = e.pagesViewportRef.value;
|
|
@@ -3492,7 +3528,7 @@ function Eo(e) {
|
|
|
3492
3528
|
}, requestAnimationFrame(() => {
|
|
3493
3529
|
let n = e.getHfPmView(h);
|
|
3494
3530
|
if (!n) return;
|
|
3495
|
-
let r =
|
|
3531
|
+
let r = Cr(e.pagesRef.value ?? s, c, h, t.clientX, t.clientY);
|
|
3496
3532
|
if (r !== null) {
|
|
3497
3533
|
let e = Math.max(0, Math.min(r, n.state.doc.content.size));
|
|
3498
3534
|
n.dispatch(n.state.tr.setSelection(Z.create(n.state.doc, e)));
|
|
@@ -3500,40 +3536,44 @@ function Eo(e) {
|
|
|
3500
3536
|
n.focus();
|
|
3501
3537
|
});
|
|
3502
3538
|
}
|
|
3503
|
-
function
|
|
3539
|
+
function ie() {
|
|
3504
3540
|
let t = e.getDocument(), n = i.value;
|
|
3505
3541
|
if (!t?.package || !n?.rId) return;
|
|
3506
3542
|
let r = e.getHfPmView(n.rId);
|
|
3507
3543
|
if (!r) return;
|
|
3508
|
-
let a =
|
|
3544
|
+
let a = On({
|
|
3509
3545
|
document: t,
|
|
3510
3546
|
position: n.position,
|
|
3511
3547
|
isFirstPage: n.isFirstPage,
|
|
3512
3548
|
activeRId: n.rId,
|
|
3513
|
-
blocks:
|
|
3549
|
+
blocks: vn(r.state.doc)
|
|
3514
3550
|
});
|
|
3515
3551
|
a && (i.value = null, e.setDocument(a), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(a));
|
|
3516
3552
|
}
|
|
3517
|
-
function
|
|
3553
|
+
function ae() {
|
|
3518
3554
|
let t = e.getDocument(), n = i.value;
|
|
3519
3555
|
if (!t?.package || !n || !n.rId) {
|
|
3520
3556
|
i.value = null;
|
|
3521
3557
|
return;
|
|
3522
3558
|
}
|
|
3523
|
-
let r =
|
|
3559
|
+
let r = En({
|
|
3524
3560
|
document: t,
|
|
3525
3561
|
position: n.position,
|
|
3526
3562
|
activeRId: n.rId
|
|
3527
3563
|
});
|
|
3528
3564
|
i.value = null, e.setDocument(r), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(r);
|
|
3529
3565
|
}
|
|
3530
|
-
function
|
|
3531
|
-
if (t.button !== 0
|
|
3566
|
+
function oe(t) {
|
|
3567
|
+
if (t.button !== 0) {
|
|
3568
|
+
(t.target instanceof HTMLElement ? t.target : null)?.closest("a[href]") && t.preventDefault();
|
|
3569
|
+
return;
|
|
3570
|
+
}
|
|
3571
|
+
if (e.imageInteracting.value) return;
|
|
3532
3572
|
let n = e.editorView.value;
|
|
3533
3573
|
if (!n) return;
|
|
3534
3574
|
let r = t.target, d = r instanceof HTMLElement ? r : null;
|
|
3535
3575
|
if (d?.closest(".docx-editor-vue__note-editor")) return;
|
|
3536
|
-
if (e.getActiveNoteView() && e.closeNoteStory(), i.value && d) if (!(d.closest(".layout-page-header") || d.closest(".layout-page-footer") || d.closest(".hf-inline-editor")))
|
|
3576
|
+
if (e.getActiveNoteView() && e.closeNoteStory(), i.value && d) if (!(d.closest(".layout-page-header") || d.closest(".layout-page-footer") || d.closest(".hf-inline-editor"))) ie(), n.focus();
|
|
3537
3577
|
else {
|
|
3538
3578
|
let t = i.value, n = d.closest(`.layout-page-${t.position}`), r = n?.closest("[data-page-number]"), a = e.pagesViewportRef.value;
|
|
3539
3579
|
if (n && r && a) {
|
|
@@ -3577,15 +3617,15 @@ function Eo(e) {
|
|
|
3577
3617
|
return;
|
|
3578
3618
|
}
|
|
3579
3619
|
let v = Date.now();
|
|
3580
|
-
if (v - a <
|
|
3620
|
+
if (v - a < Mo && o === m ? s++ : s = 1, a = v, o = m, s === 2) y(m);
|
|
3581
3621
|
else if (s >= 3) b(m), s = 0;
|
|
3582
3622
|
else if (t.shiftKey) {
|
|
3583
3623
|
let { from: e } = f.state.selection;
|
|
3584
3624
|
_(e, m);
|
|
3585
|
-
} else _(m), l = m, c = !0, u.begin(
|
|
3625
|
+
} else _(m), l = m, c = !0, u.begin(Or(f, m));
|
|
3586
3626
|
f.focus();
|
|
3587
3627
|
}
|
|
3588
|
-
function
|
|
3628
|
+
function se(e) {
|
|
3589
3629
|
if (!c || l === null) return;
|
|
3590
3630
|
let t = g(e.clientX, e.clientY);
|
|
3591
3631
|
if (t !== null) {
|
|
@@ -3598,10 +3638,10 @@ function Eo(e) {
|
|
|
3598
3638
|
}
|
|
3599
3639
|
d.updateMousePosition(e.clientX, e.clientY);
|
|
3600
3640
|
}
|
|
3601
|
-
function
|
|
3641
|
+
function C() {
|
|
3602
3642
|
c = !1, u.end(), d.stopAutoScroll();
|
|
3603
3643
|
}
|
|
3604
|
-
function
|
|
3644
|
+
function ce() {
|
|
3605
3645
|
let t = e.pagesViewportRef.value, n = e.layout.value;
|
|
3606
3646
|
if (!t || !n || n.pages.length === 0) return;
|
|
3607
3647
|
let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
|
|
@@ -3627,9 +3667,9 @@ function Eo(e) {
|
|
|
3627
3667
|
}, 600);
|
|
3628
3668
|
}
|
|
3629
3669
|
return ke(() => {
|
|
3630
|
-
window.addEventListener("mousemove",
|
|
3670
|
+
window.addEventListener("mousemove", se), window.addEventListener("mouseup", C), e.pagesViewportRef.value?.addEventListener("scroll", ce, { passive: !0 });
|
|
3631
3671
|
}), B(() => {
|
|
3632
|
-
r(), window.removeEventListener("mousemove",
|
|
3672
|
+
r(), window.removeEventListener("mousemove", se), window.removeEventListener("mouseup", C), e.pagesViewportRef.value?.removeEventListener("scroll", ce), p && clearTimeout(p);
|
|
3633
3673
|
}), {
|
|
3634
3674
|
tableInsertButton: t,
|
|
3635
3675
|
hfEdit: i,
|
|
@@ -3638,20 +3678,20 @@ function Eo(e) {
|
|
|
3638
3678
|
setPmSelection: _,
|
|
3639
3679
|
scrollVisiblePositionIntoView: v,
|
|
3640
3680
|
navigateToBookmark: x,
|
|
3641
|
-
handlePagesMouseDown:
|
|
3642
|
-
handlePagesMouseMove:
|
|
3643
|
-
handlePagesClick:
|
|
3644
|
-
handlePagesDoubleClick:
|
|
3645
|
-
handleTableInsertClick:
|
|
3681
|
+
handlePagesMouseDown: oe,
|
|
3682
|
+
handlePagesMouseMove: ee,
|
|
3683
|
+
handlePagesClick: ne,
|
|
3684
|
+
handlePagesDoubleClick: re,
|
|
3685
|
+
handleTableInsertClick: te,
|
|
3646
3686
|
clearTableInsertTimer: r,
|
|
3647
|
-
handleHfSave:
|
|
3648
|
-
handleHfRemove:
|
|
3687
|
+
handleHfSave: ie,
|
|
3688
|
+
handleHfRemove: ae
|
|
3649
3689
|
};
|
|
3650
3690
|
}
|
|
3651
3691
|
//#endregion
|
|
3652
3692
|
//#region src/composables/useRemoteSelectionSync.ts
|
|
3653
|
-
var
|
|
3654
|
-
let t = new
|
|
3693
|
+
var Po = (e) => {
|
|
3694
|
+
let t = new kr(), n = null, r = () => {
|
|
3655
3695
|
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3656
3696
|
let r = e.pagesRef.value;
|
|
3657
3697
|
r && t.clear(r);
|
|
@@ -3663,7 +3703,7 @@ var Do = (e) => {
|
|
|
3663
3703
|
pagesContainer: r,
|
|
3664
3704
|
selections: e.remoteSelections.value,
|
|
3665
3705
|
zoom: e.zoom.value,
|
|
3666
|
-
zIndex:
|
|
3706
|
+
zIndex: ae.remoteSelection
|
|
3667
3707
|
});
|
|
3668
3708
|
});
|
|
3669
3709
|
}, a = e.syncCoordinator.onRender(i);
|
|
@@ -3674,8 +3714,8 @@ var Do = (e) => {
|
|
|
3674
3714
|
], i, { flush: "post" }), Ae(() => {
|
|
3675
3715
|
a(), r();
|
|
3676
3716
|
});
|
|
3677
|
-
},
|
|
3678
|
-
let t = new
|
|
3717
|
+
}, Fo = (e) => {
|
|
3718
|
+
let t = new Ar(), n = null, r = () => {
|
|
3679
3719
|
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3680
3720
|
let r = e.pagesRef.value;
|
|
3681
3721
|
r && t.clear(r);
|
|
@@ -3688,7 +3728,7 @@ var Do = (e) => {
|
|
|
3688
3728
|
pagesContainer: r,
|
|
3689
3729
|
state: i.state,
|
|
3690
3730
|
zoom: e.zoom.value,
|
|
3691
|
-
zIndex:
|
|
3731
|
+
zIndex: ae.selectionOverlay
|
|
3692
3732
|
});
|
|
3693
3733
|
if (a.type === "image") {
|
|
3694
3734
|
let t = e.selectedImage.value, n = a.element.offsetWidth, r = a.element.offsetHeight;
|
|
@@ -3713,22 +3753,22 @@ var Do = (e) => {
|
|
|
3713
3753
|
clearOverlay: r,
|
|
3714
3754
|
updateSelectionOverlay: i
|
|
3715
3755
|
};
|
|
3716
|
-
},
|
|
3756
|
+
}, Io = { class: "docx-editor-vue__toolbar-shell" }, Lo = {
|
|
3717
3757
|
key: 0,
|
|
3718
3758
|
class: "docx-editor-vue__error"
|
|
3719
|
-
},
|
|
3759
|
+
}, Ro = {
|
|
3720
3760
|
key: 1,
|
|
3721
3761
|
class: "docx-editor-vue__loading"
|
|
3722
|
-
},
|
|
3762
|
+
}, zo = {
|
|
3723
3763
|
key: 2,
|
|
3724
3764
|
class: "docx-editor-vue__placeholder"
|
|
3725
|
-
},
|
|
3765
|
+
}, Bo = { class: "docx-editor-vue__editor-area" }, Vo = {
|
|
3726
3766
|
key: 0,
|
|
3727
3767
|
class: "docx-editor-vue__ruler-h"
|
|
3728
|
-
},
|
|
3768
|
+
}, Ho = {
|
|
3729
3769
|
key: 1,
|
|
3730
3770
|
class: "docx-editor-vue__ruler-v"
|
|
3731
|
-
},
|
|
3771
|
+
}, Uo = {
|
|
3732
3772
|
class: "docx-editor-vue__editor-content-wrapper",
|
|
3733
3773
|
style: {
|
|
3734
3774
|
position: "relative",
|
|
@@ -3736,11 +3776,11 @@ var Do = (e) => {
|
|
|
3736
3776
|
flexDirection: "column",
|
|
3737
3777
|
minHeight: "100%"
|
|
3738
3778
|
}
|
|
3739
|
-
},
|
|
3779
|
+
}, Wo = {
|
|
3740
3780
|
"data-testid": "selection-overlay",
|
|
3741
3781
|
class: "docx-editor-vue__decoration-origin",
|
|
3742
3782
|
"aria-hidden": "true"
|
|
3743
|
-
},
|
|
3783
|
+
}, Go = ["aria-label"], Ko = { class: "docx-editor-vue__note-editor-header" }, qo = ["aria-label"], Jo = ["aria-label"], Yo = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
3744
3784
|
__name: "DocxEditor",
|
|
3745
3785
|
props: {
|
|
3746
3786
|
documentBuffer: { default: null },
|
|
@@ -3864,8 +3904,8 @@ var Do = (e) => {
|
|
|
3864
3904
|
setup(e, { expose: t, emit: n }) {
|
|
3865
3905
|
let o = e, s = n;
|
|
3866
3906
|
a(o.components);
|
|
3867
|
-
let c =
|
|
3868
|
-
|
|
3907
|
+
let c = fe();
|
|
3908
|
+
pi(c);
|
|
3869
3909
|
function l(e) {
|
|
3870
3910
|
o.onChange?.(e), s("change", e), s("update:document", e);
|
|
3871
3911
|
}
|
|
@@ -3876,26 +3916,26 @@ var Do = (e) => {
|
|
|
3876
3916
|
function _(e) {
|
|
3877
3917
|
m.value = e;
|
|
3878
3918
|
}
|
|
3879
|
-
let x = A(() => m.value === "all-markup" ? "" : `folio-root--${m.value}`), { t:
|
|
3880
|
-
|
|
3881
|
-
let
|
|
3882
|
-
K(
|
|
3883
|
-
e || (
|
|
3919
|
+
let x = A(() => m.value === "all-markup" ? "" : `folio-root--${m.value}`), { t: ee } = r(), te = ({ node: e }) => e;
|
|
3920
|
+
te.props = ["node"];
|
|
3921
|
+
let re = A(() => o.documentBuffer != null || o.document != null), ae = H(!1);
|
|
3922
|
+
K(re, (e) => {
|
|
3923
|
+
e || (ae.value = !1);
|
|
3884
3924
|
});
|
|
3885
|
-
let
|
|
3925
|
+
let S = H(null), oe = H(null), C = H(null), ue = H(null), pe = H(null), me = H(null), he = A(() => o.showRuler ?? !1), w = H(0), ge = H(!1), T = H(!1), E = H(!1), _e = H(!1), ve = H(!1), ye = H(!1), be = H(!1), xe = H(o.showOutline), D = H(!1), k = H(null), Se = H(null), we = H(null), I = Ne([]), Ee = Ne([]), { zoom: L, zoomPercent: Oe, isMinZoom: Ae, isMaxZoom: je, setZoom: U, zoomIn: Pe, zoomOut: ze, handleWheel: Ve, handleKeyDown: He, ZOOM_PRESETS: We } = de(o.initialZoom);
|
|
3886
3926
|
function Ke(e) {
|
|
3887
3927
|
o.enableWheelZoom !== !1 && Ve(e);
|
|
3888
3928
|
}
|
|
3889
|
-
|
|
3890
|
-
showFindReplace:
|
|
3891
|
-
showHyperlink:
|
|
3929
|
+
yo({
|
|
3930
|
+
showFindReplace: ge,
|
|
3931
|
+
showHyperlink: T,
|
|
3892
3932
|
handleZoomKeyDown: He
|
|
3893
3933
|
});
|
|
3894
|
-
let { editor: Je, editorView: J, editorState: it, remoteSelections: ot, headerFooterSelection: ct, activeNoteStory: lt, isReady: ut, isDirty: dt, parseError: ft, layout: pt, blocks: mt, measures: ht, syncCoordinator: gt, loadBuffer: _t, loadDocument: vt, save: yt, getDocument: Y, setDocument: bt, getHeaderFooterView: xt, syncHeaderFooterViews: St, openNoteStory: Ct, closeNoteStory: wt, getActiveNoteView: Tt, getCommands: Et, reLayout: Dt } =
|
|
3895
|
-
hiddenContainer:
|
|
3896
|
-
hiddenHeaderFooterContainer:
|
|
3934
|
+
let { editor: Je, editorView: J, editorState: it, remoteSelections: ot, headerFooterSelection: ct, activeNoteStory: lt, isReady: ut, isDirty: dt, parseError: ft, layout: pt, blocks: mt, measures: ht, syncCoordinator: gt, loadBuffer: _t, loadDocument: vt, save: yt, getDocument: Y, setDocument: bt, getHeaderFooterView: xt, syncHeaderFooterViews: St, openNoteStory: Ct, closeNoteStory: wt, getActiveNoteView: Tt, getCommands: Et, reLayout: Dt } = ce({
|
|
3935
|
+
hiddenContainer: S,
|
|
3936
|
+
hiddenHeaderFooterContainer: oe,
|
|
3897
3937
|
noteEditorContainer: we,
|
|
3898
|
-
pagesContainer:
|
|
3938
|
+
pagesContainer: C,
|
|
3899
3939
|
readOnly: d,
|
|
3900
3940
|
editorMode: u,
|
|
3901
3941
|
author: () => o.author,
|
|
@@ -3932,7 +3972,7 @@ var Do = (e) => {
|
|
|
3932
3972
|
onSelectiveSaveTripwire: o.onSelectiveSaveTripwire ? (e) => o.onSelectiveSaveTripwire?.(e) : void 0
|
|
3933
3973
|
});
|
|
3934
3974
|
K(it, (e, t) => {
|
|
3935
|
-
|
|
3975
|
+
me.value !== null && e && t && !e.doc.eq(t.doc) && (me.value = null);
|
|
3936
3976
|
});
|
|
3937
3977
|
let X = A(() => $e({
|
|
3938
3978
|
bodyView: J.value,
|
|
@@ -3940,43 +3980,43 @@ var Do = (e) => {
|
|
|
3940
3980
|
noteView: Tt()
|
|
3941
3981
|
}).view), Ot = A(() => {
|
|
3942
3982
|
let e = lt.value;
|
|
3943
|
-
return e ?
|
|
3944
|
-
}), kt = A(() => !ut.value &&
|
|
3983
|
+
return e ? ee(e.kind === "footnote" ? "dialogs.footnoteProperties.footnotes" : "dialogs.footnoteProperties.endnotes") : "";
|
|
3984
|
+
}), kt = A(() => !ut.value && re.value && !(o.preserveDocumentWhileLoading === !0 && ae.value));
|
|
3945
3985
|
function At() {
|
|
3946
3986
|
J.value && (tt(), et(), Dt());
|
|
3947
3987
|
}
|
|
3948
|
-
|
|
3988
|
+
go({
|
|
3949
3989
|
isReady: ut,
|
|
3950
3990
|
getDocument: Y,
|
|
3951
3991
|
fonts: () => o.fonts,
|
|
3952
3992
|
remeasure: At
|
|
3953
3993
|
});
|
|
3954
|
-
let { selectedImage: Z, imageInteracting: jt, imageToolbarContext: Mt, handleToolbarImageWrap: Nt, handleImageTransform: Pt } =
|
|
3994
|
+
let { selectedImage: Z, imageInteracting: jt, imageToolbarContext: Mt, handleToolbarImageWrap: Nt, handleImageTransform: Pt } = vo({
|
|
3955
3995
|
editorView: X,
|
|
3956
3996
|
zoom: L,
|
|
3957
|
-
stateTick:
|
|
3997
|
+
stateTick: w,
|
|
3958
3998
|
getCommands: Et
|
|
3959
|
-
}), Ft =
|
|
3999
|
+
}), Ft = Fo({
|
|
3960
4000
|
editorView: J,
|
|
3961
|
-
pagesRef:
|
|
4001
|
+
pagesRef: C,
|
|
3962
4002
|
zoom: L,
|
|
3963
4003
|
selectedImage: Z,
|
|
3964
4004
|
syncCoordinator: gt,
|
|
3965
4005
|
imageInteracting: jt
|
|
3966
4006
|
});
|
|
3967
|
-
|
|
3968
|
-
pagesRef:
|
|
4007
|
+
Po({
|
|
4008
|
+
pagesRef: C,
|
|
3969
4009
|
remoteSelections: ot,
|
|
3970
4010
|
syncCoordinator: gt,
|
|
3971
4011
|
zoom: L
|
|
3972
4012
|
});
|
|
3973
|
-
let { hyperlinkPopupData: It, handleHyperlinkSubmit: Lt, handleHyperlinkRemove: Bt, handleHyperlinkPopupNavigate: Vt, handleHyperlinkPopupEdit: Ht, handleHyperlinkPopupRemove: Ut } =
|
|
4013
|
+
let { hyperlinkPopupData: It, handleHyperlinkSubmit: Lt, handleHyperlinkRemove: Bt, handleHyperlinkPopupNavigate: Vt, handleHyperlinkPopupEdit: Ht, handleHyperlinkPopupRemove: Ut } = _o({
|
|
3974
4014
|
editorView: X,
|
|
3975
4015
|
getCommands: Et
|
|
3976
|
-
}), Wt =
|
|
4016
|
+
}), Wt = se(), { tableInsertButton: Gt, hfEdit: Kt, scrollPageInfo: qt, resolvePos: Jt, setPmSelection: Yt, scrollVisiblePositionIntoView: Xt, handlePagesMouseDown: Zt, handlePagesMouseMove: Qt, handlePagesClick: $t, handlePagesDoubleClick: en, handleTableInsertClick: tn, handleHfSave: nn, handleHfRemove: rn } = No({
|
|
3977
4017
|
editorView: J,
|
|
3978
|
-
pagesRef:
|
|
3979
|
-
pagesViewportRef:
|
|
4018
|
+
pagesRef: C,
|
|
4019
|
+
pagesViewportRef: ue,
|
|
3980
4020
|
selectedImage: Z,
|
|
3981
4021
|
imageInteracting: jt,
|
|
3982
4022
|
hyperlinkPopupData: It,
|
|
@@ -4011,7 +4051,7 @@ var Do = (e) => {
|
|
|
4011
4051
|
K(Kt, (e) => {
|
|
4012
4052
|
Se.value = e?.rId ?? null, e && Ft.clearOverlay();
|
|
4013
4053
|
}, { immediate: !0 });
|
|
4014
|
-
let sn =
|
|
4054
|
+
let sn = bo({
|
|
4015
4055
|
editorView: J,
|
|
4016
4056
|
showOutline: xe,
|
|
4017
4057
|
showSidebar: D,
|
|
@@ -4019,7 +4059,7 @@ var Do = (e) => {
|
|
|
4019
4059
|
activeSidebarItem: k,
|
|
4020
4060
|
extractCommentsAndChanges: () => {},
|
|
4021
4061
|
scrollToVisiblePosition: Xt
|
|
4022
|
-
}), { contextMenu: cn, imageContextMenu: ln, imageContextMenuTextActions: un, customTextMenuItems: dn, handleContextMenu: fn, handleSelectedImageContextMenu: pn, handleImageWrapSelect: mn, handleContextMenuAction: hn } =
|
|
4062
|
+
}), { contextMenu: cn, imageContextMenu: ln, imageContextMenuTextActions: un, customTextMenuItems: dn, handleContextMenu: fn, handleSelectedImageContextMenu: pn, handleImageWrapSelect: mn, handleContextMenuAction: hn } = eo({
|
|
4023
4063
|
editorView: X,
|
|
4024
4064
|
selectedImage: Z,
|
|
4025
4065
|
zoom: L,
|
|
@@ -4033,7 +4073,7 @@ var Do = (e) => {
|
|
|
4033
4073
|
onCopy: () => o.onCopy?.(),
|
|
4034
4074
|
onCut: () => o.onCut?.(),
|
|
4035
4075
|
onPaste: () => o.onPaste?.()
|
|
4036
|
-
}), gn =
|
|
4076
|
+
}), gn = le(J, w), _n = A(() => gn.value.entries), Q = Ha({
|
|
4037
4077
|
editorView: J,
|
|
4038
4078
|
getDocument: Y,
|
|
4039
4079
|
author: () => o.author,
|
|
@@ -4042,10 +4082,10 @@ var Do = (e) => {
|
|
|
4042
4082
|
o.onCommentsChange?.(e), s("comments-change", e);
|
|
4043
4083
|
},
|
|
4044
4084
|
reLayout: Dt
|
|
4045
|
-
}), vn = Q.comments, $ =
|
|
4085
|
+
}), vn = Q.comments, $ = Va({
|
|
4046
4086
|
editorView: J,
|
|
4047
|
-
pagesViewport:
|
|
4048
|
-
pagesContainer:
|
|
4087
|
+
pagesViewport: ue,
|
|
4088
|
+
pagesContainer: C,
|
|
4049
4089
|
readOnly: d,
|
|
4050
4090
|
createComment: Q.createComment,
|
|
4051
4091
|
pushComment: Q.pushComment,
|
|
@@ -4059,23 +4099,23 @@ var Do = (e) => {
|
|
|
4059
4099
|
navigator.clipboard?.writeText(e), It.value = null;
|
|
4060
4100
|
}
|
|
4061
4101
|
let bn = A(() => {
|
|
4062
|
-
|
|
4102
|
+
w.value;
|
|
4063
4103
|
let e = Y()?.package.document;
|
|
4064
4104
|
return e ? e.finalSectionProperties ?? e.sections?.[0]?.properties ?? null : null;
|
|
4065
4105
|
}), xn = A(() => {
|
|
4066
|
-
|
|
4106
|
+
w.value;
|
|
4067
4107
|
let e = Y();
|
|
4068
4108
|
return e ? at(e) : void 0;
|
|
4069
4109
|
}), Sn = A(() => {
|
|
4070
|
-
|
|
4071
|
-
let e =
|
|
4110
|
+
w.value;
|
|
4111
|
+
let e = X.value;
|
|
4072
4112
|
if (!e) return {};
|
|
4073
4113
|
let t = Xe(e.state).table;
|
|
4074
4114
|
if (!t) return {};
|
|
4075
4115
|
let n = {}, r = t.attrs.width, i = t.attrs.widthType, a = t.attrs.justification;
|
|
4076
4116
|
return typeof r == "number" && (n.width = r), typeof i == "string" && (n.widthType = i), typeof a == "string" && (n.justification = a), n;
|
|
4077
4117
|
}), Cn = A(() => {
|
|
4078
|
-
|
|
4118
|
+
w.value;
|
|
4079
4119
|
let e = {};
|
|
4080
4120
|
o.fontFamilies !== void 0 && (e.fontFamilies = o.fontFamilies);
|
|
4081
4121
|
let t = Y()?.package.styles?.styles;
|
|
@@ -4088,7 +4128,7 @@ var Do = (e) => {
|
|
|
4088
4128
|
transform: L.value === 1 ? void 0 : `scale(${L.value})`,
|
|
4089
4129
|
transformOrigin: "top center",
|
|
4090
4130
|
transition: "transform 0.2s ease"
|
|
4091
|
-
})), { handleApplyStyle: Dn, handleInsertSymbol: On, handleInsertSectionBreakNextPage: kn, handleInsertSectionBreakContinuous: An } =
|
|
4131
|
+
})), { handleApplyStyle: Dn, handleInsertSymbol: On, handleInsertSectionBreakNextPage: kn, handleInsertSectionBreakContinuous: An } = io({
|
|
4092
4132
|
editorView: X,
|
|
4093
4133
|
getDocument: Y
|
|
4094
4134
|
});
|
|
@@ -4129,15 +4169,15 @@ var Do = (e) => {
|
|
|
4129
4169
|
let e = J.value;
|
|
4130
4170
|
e && (Ye(e), e.focus());
|
|
4131
4171
|
}
|
|
4132
|
-
let { handlePageSetupApply: Fn, handleLeftMarginChange: In, handleRightMarginChange: Ln, handleTopMarginChange: Rn, handleBottomMarginChange: zn, handleIndentLeftChange: Bn, handleIndentRightChange: Vn, handleFirstLineIndentChange: Hn, handleTabStopRemove: Un } =
|
|
4172
|
+
let { handlePageSetupApply: Fn, handleLeftMarginChange: In, handleRightMarginChange: Ln, handleTopMarginChange: Rn, handleBottomMarginChange: zn, handleIndentLeftChange: Bn, handleIndentRightChange: Vn, handleFirstLineIndentChange: Hn, handleTabStopRemove: Un } = xo({
|
|
4133
4173
|
editorView: J,
|
|
4134
4174
|
getDocument: Y,
|
|
4135
4175
|
readOnly: d,
|
|
4136
|
-
stateTick:
|
|
4176
|
+
stateTick: w,
|
|
4137
4177
|
reLayout: Dt,
|
|
4138
4178
|
onChange: l
|
|
4139
4179
|
}), Wn = A(() => {
|
|
4140
|
-
|
|
4180
|
+
w.value;
|
|
4141
4181
|
let e = X.value, t = e ? Ze(e.state).paragraphFormatting : {};
|
|
4142
4182
|
return {
|
|
4143
4183
|
indentLeft: t.indentLeft ?? 0,
|
|
@@ -4154,13 +4194,13 @@ var Do = (e) => {
|
|
|
4154
4194
|
switch (e) {
|
|
4155
4195
|
case "find":
|
|
4156
4196
|
case "findReplace":
|
|
4157
|
-
|
|
4197
|
+
ge.value = !0;
|
|
4158
4198
|
break;
|
|
4159
4199
|
case "insertSymbol":
|
|
4160
4200
|
E.value = !0;
|
|
4161
4201
|
break;
|
|
4162
4202
|
case "insertHyperlink":
|
|
4163
|
-
|
|
4203
|
+
T.value = !0;
|
|
4164
4204
|
break;
|
|
4165
4205
|
case "pageSetup":
|
|
4166
4206
|
ve.value = !0;
|
|
@@ -4198,17 +4238,17 @@ var Do = (e) => {
|
|
|
4198
4238
|
let t = Y();
|
|
4199
4239
|
if (!t) return;
|
|
4200
4240
|
let n = st(t, e);
|
|
4201
|
-
bt(n), dt.value = !0,
|
|
4241
|
+
bt(n), dt.value = !0, w.value++, Dt(), l(n);
|
|
4202
4242
|
}
|
|
4203
4243
|
function Jn(e, t) {
|
|
4204
4244
|
Mn(e, t);
|
|
4205
4245
|
}
|
|
4206
4246
|
function Yn(e) {
|
|
4207
|
-
let t =
|
|
4247
|
+
let t = X.value, n = Et().setTableProperties;
|
|
4208
4248
|
!t || !n || (n(e)(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
4209
4249
|
}
|
|
4210
4250
|
let Xn = H(!1);
|
|
4211
|
-
|
|
4251
|
+
to({
|
|
4212
4252
|
documentBuffer: () => o.documentBuffer ?? null,
|
|
4213
4253
|
document: () => o.document ?? null,
|
|
4214
4254
|
loadDocumentBuffer: _t,
|
|
@@ -4229,7 +4269,7 @@ var Do = (e) => {
|
|
|
4229
4269
|
Zn.value = !0;
|
|
4230
4270
|
let e = o.initialScrollTop;
|
|
4231
4271
|
requestAnimationFrame(() => {
|
|
4232
|
-
|
|
4272
|
+
pe.value && (pe.value.scrollTop = e);
|
|
4233
4273
|
});
|
|
4234
4274
|
}
|
|
4235
4275
|
K(ut, (e) => {
|
|
@@ -4237,39 +4277,39 @@ var Do = (e) => {
|
|
|
4237
4277
|
Zn.value = !1;
|
|
4238
4278
|
return;
|
|
4239
4279
|
}
|
|
4240
|
-
|
|
4280
|
+
ae.value = !0, sn.recomputeHeadingsIfOpen(), Q.seedFromDocument();
|
|
4241
4281
|
let t = Y();
|
|
4242
4282
|
t && o.onCompatibilityChange?.(Qe(t)), o.autoOpenReviewSidebar !== !1 && !Xn.value && (vn.value.length > 0 || _n.value.length > 0) && (Xn.value = !0, D.value = !0), $n(), s("ready");
|
|
4243
4283
|
}), ke(() => {
|
|
4244
4284
|
let e = Je.on("selectionChange", () => {
|
|
4245
|
-
|
|
4285
|
+
w.value++, $.updateFloatingButton();
|
|
4246
4286
|
}), t = Je.on("docChange", () => {
|
|
4247
|
-
|
|
4287
|
+
w.value++, sn.recomputeHeadingsIfOpen();
|
|
4248
4288
|
}), n = Je.on("layoutComplete", () => {
|
|
4249
|
-
|
|
4289
|
+
w.value++;
|
|
4250
4290
|
}), r = Wt.install(), i = nt(() => o.onFontsLoaded?.());
|
|
4251
4291
|
B(() => {
|
|
4252
4292
|
e(), t(), n(), r(), i();
|
|
4253
4293
|
});
|
|
4254
4294
|
});
|
|
4255
|
-
let { exposed: er } =
|
|
4295
|
+
let { exposed: er } = ro({
|
|
4256
4296
|
editor: Je,
|
|
4257
4297
|
editorView: J,
|
|
4258
4298
|
isDirty: dt,
|
|
4259
4299
|
commentsDirty: Q.commentsDirty,
|
|
4260
4300
|
clearCommentsDirty: Q.clearCommentsDirty,
|
|
4261
4301
|
layout: pt,
|
|
4262
|
-
pagesRef:
|
|
4263
|
-
pagesViewportRef:
|
|
4302
|
+
pagesRef: C,
|
|
4303
|
+
pagesViewportRef: ue,
|
|
4264
4304
|
zoom: L,
|
|
4265
4305
|
scrollVisiblePositionIntoView: Xt,
|
|
4266
4306
|
setPassageHighlight: (e) => {
|
|
4267
|
-
|
|
4307
|
+
me.value = e;
|
|
4268
4308
|
},
|
|
4269
4309
|
author: () => o.author,
|
|
4270
|
-
createAIEditComment: (e) => {
|
|
4271
|
-
let
|
|
4272
|
-
return Q.pushComment(
|
|
4310
|
+
createAIEditComment: (e, t) => {
|
|
4311
|
+
let n = Q.createComment(e, void 0, t);
|
|
4312
|
+
return Q.pushComment(n), n.id;
|
|
4273
4313
|
},
|
|
4274
4314
|
getComments: () => Q.comments.value,
|
|
4275
4315
|
setComments: Q.setComments,
|
|
@@ -4297,7 +4337,7 @@ var Do = (e) => {
|
|
|
4297
4337
|
]),
|
|
4298
4338
|
style: z(e.style)
|
|
4299
4339
|
}, [
|
|
4300
|
-
P("div",
|
|
4340
|
+
P("div", Io, [F(ki, {
|
|
4301
4341
|
"show-table-insert": o.showTableInsert !== !1,
|
|
4302
4342
|
onRename: n[0] ||= (e) => s("rename", e),
|
|
4303
4343
|
onMenuAction: Kn,
|
|
@@ -4306,11 +4346,11 @@ var Do = (e) => {
|
|
|
4306
4346
|
"title-bar-left": Ie(() => [Me(t.$slots, "title-bar-left", {}, void 0, !0)]),
|
|
4307
4347
|
"title-bar-right": Ie(() => [Me(t.$slots, "title-bar-right", {}, void 0, !0)]),
|
|
4308
4348
|
_: 3
|
|
4309
|
-
}, 8, ["show-table-insert"]), e.showToolbar ? (V(), j(
|
|
4349
|
+
}, 8, ["show-table-insert"]), e.showToolbar ? (V(), j(ie, De({
|
|
4310
4350
|
key: 0,
|
|
4311
4351
|
view: X.value,
|
|
4312
4352
|
"get-commands": G(Et),
|
|
4313
|
-
"state-tick":
|
|
4353
|
+
"state-tick": w.value,
|
|
4314
4354
|
"zoom-percent": G(Oe),
|
|
4315
4355
|
"is-min-zoom": G(Ae),
|
|
4316
4356
|
"is-max-zoom": G(je),
|
|
@@ -4325,8 +4365,8 @@ var Do = (e) => {
|
|
|
4325
4365
|
"image-context": G(Mt),
|
|
4326
4366
|
theme: e.theme ?? null
|
|
4327
4367
|
}, Cn.value, {
|
|
4328
|
-
onFindReplace: n[2] ||= (e) =>
|
|
4329
|
-
onInsertLink: n[3] ||= (e) =>
|
|
4368
|
+
onFindReplace: n[2] ||= (e) => ge.value = !0,
|
|
4369
|
+
onInsertLink: n[3] ||= (e) => T.value = !0,
|
|
4330
4370
|
onInsertSymbol: n[4] ||= (e) => E.value = !0,
|
|
4331
4371
|
onInsertPageBreak: Nn,
|
|
4332
4372
|
onPageSetup: n[5] ||= (e) => ve.value = !0,
|
|
@@ -4346,7 +4386,7 @@ var Do = (e) => {
|
|
|
4346
4386
|
"table-context": Ie(() => [F(y, {
|
|
4347
4387
|
view: X.value,
|
|
4348
4388
|
"get-commands": G(Et),
|
|
4349
|
-
"state-tick":
|
|
4389
|
+
"state-tick": w.value,
|
|
4350
4390
|
theme: e.theme ?? null,
|
|
4351
4391
|
onOpenTableProperties: n[1] ||= (e) => ye.value = !0
|
|
4352
4392
|
}, null, 8, [
|
|
@@ -4358,7 +4398,7 @@ var Do = (e) => {
|
|
|
4358
4398
|
_: 2
|
|
4359
4399
|
}, [t.$slots["toolbar-extra"] || e.toolbarExtra ? {
|
|
4360
4400
|
name: "toolbar-extra",
|
|
4361
|
-
fn: Ie(() => [Me(t.$slots, "toolbar-extra", {}, () => [e.toolbarExtra ? (V(), j(
|
|
4401
|
+
fn: Ie(() => [Me(t.$slots, "toolbar-extra", {}, () => [e.toolbarExtra ? (V(), j(te, {
|
|
4362
4402
|
key: 0,
|
|
4363
4403
|
node: e.toolbarExtra
|
|
4364
4404
|
}, null, 8, ["node"])) : M("", !0)], !0)]),
|
|
@@ -4388,11 +4428,11 @@ var Do = (e) => {
|
|
|
4388
4428
|
"onImageWrapType",
|
|
4389
4429
|
"onImageTransform"
|
|
4390
4430
|
])) : M("", !0)]),
|
|
4391
|
-
F(
|
|
4392
|
-
"show-find-replace":
|
|
4393
|
-
"onUpdate:showFindReplace": n[8] ||= (e) =>
|
|
4394
|
-
"show-hyperlink":
|
|
4395
|
-
"onUpdate:showHyperlink": n[9] ||= (e) =>
|
|
4431
|
+
F(wi, {
|
|
4432
|
+
"show-find-replace": ge.value,
|
|
4433
|
+
"onUpdate:showFindReplace": n[8] ||= (e) => ge.value = e,
|
|
4434
|
+
"show-hyperlink": T.value,
|
|
4435
|
+
"onUpdate:showHyperlink": n[9] ||= (e) => T.value = e,
|
|
4396
4436
|
"show-insert-symbol": E.value,
|
|
4397
4437
|
"onUpdate:showInsertSymbol": n[10] ||= (e) => E.value = e,
|
|
4398
4438
|
"show-image-properties": _e.value,
|
|
@@ -4436,30 +4476,30 @@ var Do = (e) => {
|
|
|
4436
4476
|
"onHyperlinkRemove",
|
|
4437
4477
|
"onPageSetupApply"
|
|
4438
4478
|
]),
|
|
4439
|
-
G(ft) ? (V(), N("div",
|
|
4479
|
+
G(ft) ? (V(), N("div", Lo, W(G(ft)), 1)) : kt.value ? (V(), N("div", Ro, [Me(t.$slots, "loading-indicator", {}, () => [e.loadingIndicator ? (V(), j(te, {
|
|
4440
4480
|
key: 0,
|
|
4441
4481
|
node: e.loadingIndicator
|
|
4442
|
-
}, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te(W(G(
|
|
4482
|
+
}, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te(W(G(ee)("loadingDocument")), 1)], 64))], !0)])) : !G(ut) && !re.value ? (V(), N("div", zo, [Me(t.$slots, "placeholder", {}, () => [e.placeholder ? (V(), j(te, {
|
|
4443
4483
|
key: 0,
|
|
4444
4484
|
node: e.placeholder
|
|
4445
4485
|
}, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te("No document loaded")], 64))], !0)])) : M("", !0),
|
|
4446
4486
|
P("div", {
|
|
4447
4487
|
ref_key: "hiddenPmRef",
|
|
4448
|
-
ref:
|
|
4488
|
+
ref: S,
|
|
4449
4489
|
class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
|
|
4450
4490
|
}, null, 512),
|
|
4451
4491
|
P("div", {
|
|
4452
4492
|
ref_key: "hiddenHfPmRef",
|
|
4453
|
-
ref:
|
|
4493
|
+
ref: oe,
|
|
4454
4494
|
class: "docx-editor-vue__hidden-pm paged-editor__hidden-hf-pm"
|
|
4455
4495
|
}, null, 512),
|
|
4456
4496
|
P("div", {
|
|
4457
4497
|
ref_key: "editorScrollRef",
|
|
4458
|
-
ref:
|
|
4498
|
+
ref: pe,
|
|
4459
4499
|
class: "docx-editor-vue__editor-scroll",
|
|
4460
4500
|
onScroll: Qn
|
|
4461
|
-
}, [P("div",
|
|
4462
|
-
|
|
4501
|
+
}, [P("div", Bo, [
|
|
4502
|
+
he.value && !d.value ? (V(), N("div", Vo, [F(ne, {
|
|
4463
4503
|
"section-props": bn.value,
|
|
4464
4504
|
zoom: G(L),
|
|
4465
4505
|
unit: e.rulerUnit ?? "inch",
|
|
@@ -4493,7 +4533,7 @@ var Do = (e) => {
|
|
|
4493
4533
|
"onFirstLineIndentChange",
|
|
4494
4534
|
"onTabStopRemove"
|
|
4495
4535
|
])])) : M("", !0),
|
|
4496
|
-
|
|
4536
|
+
he.value && !d.value ? (V(), N("div", Ho, [F(v, {
|
|
4497
4537
|
"section-props": bn.value,
|
|
4498
4538
|
zoom: G(L),
|
|
4499
4539
|
unit: e.rulerUnit ?? "inch",
|
|
@@ -4510,7 +4550,7 @@ var Do = (e) => {
|
|
|
4510
4550
|
])])) : M("", !0),
|
|
4511
4551
|
P("div", {
|
|
4512
4552
|
ref_key: "pagesViewportRef",
|
|
4513
|
-
ref:
|
|
4553
|
+
ref: ue,
|
|
4514
4554
|
class: "docx-editor-vue__pages-viewport",
|
|
4515
4555
|
onWheel: Ke,
|
|
4516
4556
|
onMousedown: n[25] ||= (...e) => G(Zt) && G(Zt)(...e),
|
|
@@ -4519,15 +4559,15 @@ var Do = (e) => {
|
|
|
4519
4559
|
onDblclick: n[28] ||= (...e) => G(en) && G(en)(...e),
|
|
4520
4560
|
onContextmenu: n[29] ||= q((...e) => G(fn) && G(fn)(...e), ["prevent"])
|
|
4521
4561
|
}, [
|
|
4522
|
-
P("div",
|
|
4562
|
+
P("div", Uo, [
|
|
4523
4563
|
P("div", {
|
|
4524
4564
|
ref_key: "pagesRef",
|
|
4525
|
-
ref:
|
|
4565
|
+
ref: C,
|
|
4526
4566
|
class: R(["docx-editor-vue__pages paged-editor__pages", G(Kt) ? `paged-editor--hf-editing paged-editor--editing-${G(Kt).position}` : ""]),
|
|
4527
4567
|
style: z(En.value)
|
|
4528
4568
|
}, null, 6),
|
|
4529
|
-
F(
|
|
4530
|
-
"pages-container":
|
|
4569
|
+
F(da, {
|
|
4570
|
+
"pages-container": C.value,
|
|
4531
4571
|
selection: on.value,
|
|
4532
4572
|
zoom: G(L)
|
|
4533
4573
|
}, null, 8, [
|
|
@@ -4535,10 +4575,10 @@ var Do = (e) => {
|
|
|
4535
4575
|
"selection",
|
|
4536
4576
|
"zoom"
|
|
4537
4577
|
]),
|
|
4538
|
-
P("div",
|
|
4539
|
-
F(
|
|
4578
|
+
P("div", Wo, [
|
|
4579
|
+
F(ai, {
|
|
4540
4580
|
"get-view": () => G(J),
|
|
4541
|
-
"get-pages-container": () =>
|
|
4581
|
+
"get-pages-container": () => C.value,
|
|
4542
4582
|
"editor-state": G(it),
|
|
4543
4583
|
zoom: G(L),
|
|
4544
4584
|
layout: G(pt),
|
|
@@ -4559,9 +4599,9 @@ var Do = (e) => {
|
|
|
4559
4599
|
"selected-canonical",
|
|
4560
4600
|
"selection-seq"
|
|
4561
4601
|
]),
|
|
4562
|
-
F(
|
|
4563
|
-
range:
|
|
4564
|
-
"get-pages-container": () =>
|
|
4602
|
+
F(si, {
|
|
4603
|
+
range: me.value,
|
|
4604
|
+
"get-pages-container": () => C.value,
|
|
4565
4605
|
zoom: G(L),
|
|
4566
4606
|
layout: G(pt),
|
|
4567
4607
|
blocks: G(mt),
|
|
@@ -4574,10 +4614,10 @@ var Do = (e) => {
|
|
|
4574
4614
|
"blocks",
|
|
4575
4615
|
"measures"
|
|
4576
4616
|
]),
|
|
4577
|
-
o.showTemplateDirectives ? (V(), j(
|
|
4617
|
+
o.showTemplateDirectives ? (V(), j(wa, {
|
|
4578
4618
|
key: 0,
|
|
4579
4619
|
"get-view": () => G(J),
|
|
4580
|
-
"get-pages-container": () =>
|
|
4620
|
+
"get-pages-container": () => C.value,
|
|
4581
4621
|
"editor-state": G(it),
|
|
4582
4622
|
zoom: G(L),
|
|
4583
4623
|
layout: G(pt),
|
|
@@ -4592,8 +4632,8 @@ var Do = (e) => {
|
|
|
4592
4632
|
"blocks",
|
|
4593
4633
|
"measures"
|
|
4594
4634
|
])) : M("", !0),
|
|
4595
|
-
F(
|
|
4596
|
-
"get-pages-container": () =>
|
|
4635
|
+
F(di, {
|
|
4636
|
+
"get-pages-container": () => C.value,
|
|
4597
4637
|
"editor-state": G(it),
|
|
4598
4638
|
zoom: G(L),
|
|
4599
4639
|
"sync-coordinator": G(gt)
|
|
@@ -4603,11 +4643,11 @@ var Do = (e) => {
|
|
|
4603
4643
|
"zoom",
|
|
4604
4644
|
"sync-coordinator"
|
|
4605
4645
|
]),
|
|
4606
|
-
F(
|
|
4646
|
+
F(yi, {
|
|
4607
4647
|
"get-view": () => G(J),
|
|
4608
|
-
"get-pages-container": () =>
|
|
4648
|
+
"get-pages-container": () => C.value,
|
|
4609
4649
|
zoom: G(L),
|
|
4610
|
-
"transaction-version":
|
|
4650
|
+
"transaction-version": w.value,
|
|
4611
4651
|
"sync-coordinator": G(gt)
|
|
4612
4652
|
}, null, 8, [
|
|
4613
4653
|
"get-view",
|
|
@@ -4618,7 +4658,7 @@ var Do = (e) => {
|
|
|
4618
4658
|
])
|
|
4619
4659
|
])
|
|
4620
4660
|
]),
|
|
4621
|
-
G(Kt) ? (V(), j(
|
|
4661
|
+
G(Kt) ? (V(), j(pa, {
|
|
4622
4662
|
key: 0,
|
|
4623
4663
|
edit: G(Kt),
|
|
4624
4664
|
"get-view": an,
|
|
@@ -4633,16 +4673,16 @@ var Do = (e) => {
|
|
|
4633
4673
|
class: "docx-editor-vue__note-editor",
|
|
4634
4674
|
"aria-label": Ot.value,
|
|
4635
4675
|
onKeydown: n[16] ||= Re(q((...e) => G(wt) && G(wt)(...e), ["stop", "prevent"]), ["esc"])
|
|
4636
|
-
}, [P("header",
|
|
4676
|
+
}, [P("header", Ko, [P("span", null, W(Ot.value), 1), P("button", {
|
|
4637
4677
|
type: "button",
|
|
4638
|
-
"aria-label": G(
|
|
4678
|
+
"aria-label": G(ee)("common.closeDialog"),
|
|
4639
4679
|
onClick: n[15] ||= (...e) => G(wt) && G(wt)(...e)
|
|
4640
|
-
}, " × ", 8,
|
|
4680
|
+
}, " × ", 8, qo)]), P("div", {
|
|
4641
4681
|
ref_key: "notePmRef",
|
|
4642
4682
|
ref: we,
|
|
4643
4683
|
class: "docx-editor-vue__note-editor-host"
|
|
4644
|
-
}, null, 512)], 40,
|
|
4645
|
-
F(
|
|
4684
|
+
}, null, 512)], 40, Go), [[Fe, G(lt)]]),
|
|
4685
|
+
F(ua, {
|
|
4646
4686
|
"image-info": G(Z),
|
|
4647
4687
|
zoom: G(L),
|
|
4648
4688
|
view: X.value,
|
|
@@ -4656,7 +4696,7 @@ var Do = (e) => {
|
|
|
4656
4696
|
"view",
|
|
4657
4697
|
"onContextMenu"
|
|
4658
4698
|
]),
|
|
4659
|
-
F(
|
|
4699
|
+
F(Pa, {
|
|
4660
4700
|
data: G(It),
|
|
4661
4701
|
"read-only": d.value,
|
|
4662
4702
|
onNavigate: G(Vt),
|
|
@@ -4681,10 +4721,10 @@ var Do = (e) => {
|
|
|
4681
4721
|
}),
|
|
4682
4722
|
"aria-label": G(Gt).type === "row" ? "Insert row" : "Insert column",
|
|
4683
4723
|
onMousedown: n[21] ||= (...e) => G(tn) && G(tn)(...e)
|
|
4684
|
-
}, " + ", 44,
|
|
4724
|
+
}, " + ", 44, Jo)) : M("", !0),
|
|
4685
4725
|
F(g, {
|
|
4686
4726
|
comments: G(vn),
|
|
4687
|
-
"pages-container":
|
|
4727
|
+
"pages-container": C.value,
|
|
4688
4728
|
zoom: G(L),
|
|
4689
4729
|
"page-width-px": wn.value,
|
|
4690
4730
|
"sidebar-open": D.value,
|
|
@@ -4705,7 +4745,7 @@ var Do = (e) => {
|
|
|
4705
4745
|
"show-resolved": !0,
|
|
4706
4746
|
"is-adding-comment": G($).isAddingComment.value,
|
|
4707
4747
|
"add-comment-y-position": G($).addCommentYPosition.value,
|
|
4708
|
-
"pages-container":
|
|
4748
|
+
"pages-container": C.value,
|
|
4709
4749
|
"page-width-px": wn.value,
|
|
4710
4750
|
zoom: G(L),
|
|
4711
4751
|
"active-item-id": k.value,
|
|
@@ -4760,12 +4800,12 @@ var Do = (e) => {
|
|
|
4760
4800
|
size: 18
|
|
4761
4801
|
})], 36)) : M("", !0)
|
|
4762
4802
|
], 544),
|
|
4763
|
-
xe.value ? M("", !0) : (V(), j(
|
|
4803
|
+
xe.value ? M("", !0) : (V(), j(ha, {
|
|
4764
4804
|
key: 2,
|
|
4765
4805
|
"left-offset": 12,
|
|
4766
4806
|
onToggle: G(sn).handleToggleOutline
|
|
4767
4807
|
}, null, 8, ["onToggle"])),
|
|
4768
|
-
G(qt).totalPages > 1 ? (V(), j(
|
|
4808
|
+
G(qt).totalPages > 1 ? (V(), j(ga, {
|
|
4769
4809
|
key: 3,
|
|
4770
4810
|
"current-page": G(qt).currentPage,
|
|
4771
4811
|
"total-pages": G(qt).totalPages,
|
|
@@ -4775,10 +4815,10 @@ var Do = (e) => {
|
|
|
4775
4815
|
"total-pages",
|
|
4776
4816
|
"visible"
|
|
4777
4817
|
])) : M("", !0),
|
|
4778
|
-
F(
|
|
4818
|
+
F(Ci, {
|
|
4779
4819
|
"is-open": xe.value,
|
|
4780
4820
|
headings: Ee.value,
|
|
4781
|
-
"get-scroll-container": () =>
|
|
4821
|
+
"get-scroll-container": () => C.value,
|
|
4782
4822
|
onClose: n[30] ||= (e) => xe.value = !1,
|
|
4783
4823
|
onNavigate: G(sn).handleOutlineNavigate
|
|
4784
4824
|
}, null, 8, [
|
|
@@ -4788,7 +4828,7 @@ var Do = (e) => {
|
|
|
4788
4828
|
"onNavigate"
|
|
4789
4829
|
])
|
|
4790
4830
|
])], 544),
|
|
4791
|
-
F(
|
|
4831
|
+
F(ea, {
|
|
4792
4832
|
"read-only": d.value,
|
|
4793
4833
|
"context-menu": G(cn),
|
|
4794
4834
|
"image-context-menu": G(ln),
|
|
@@ -4810,16 +4850,16 @@ var Do = (e) => {
|
|
|
4810
4850
|
"onContextMenuAction",
|
|
4811
4851
|
"onImageWrapSelect"
|
|
4812
4852
|
]),
|
|
4813
|
-
F(
|
|
4814
|
-
"event-root": d.value ? null :
|
|
4853
|
+
F(vi, {
|
|
4854
|
+
"event-root": d.value ? null : C.value,
|
|
4815
4855
|
view: G(J)
|
|
4816
4856
|
}, null, 8, ["event-root", "view"])
|
|
4817
4857
|
], 6));
|
|
4818
4858
|
}
|
|
4819
|
-
}), [["__scopeId", "data-v-
|
|
4859
|
+
}), [["__scopeId", "data-v-3eaed64d"]]);
|
|
4820
4860
|
//#endregion
|
|
4821
4861
|
//#region src/utils/listState.ts
|
|
4822
|
-
function
|
|
4862
|
+
function Xo() {
|
|
4823
4863
|
return {
|
|
4824
4864
|
type: "none",
|
|
4825
4865
|
level: 0,
|
|
@@ -4828,30 +4868,30 @@ function Uo() {
|
|
|
4828
4868
|
}
|
|
4829
4869
|
//#endregion
|
|
4830
4870
|
//#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
|
|
4831
|
-
var
|
|
4871
|
+
var Zo = ["aria-label"], Qo = ["aria-label"], $o = [
|
|
4832
4872
|
"disabled",
|
|
4833
4873
|
"title",
|
|
4834
4874
|
"aria-label"
|
|
4835
|
-
],
|
|
4875
|
+
], es = [
|
|
4836
4876
|
"disabled",
|
|
4837
4877
|
"title",
|
|
4838
4878
|
"aria-label"
|
|
4839
|
-
],
|
|
4879
|
+
], ts = ["aria-label"], ns = [
|
|
4840
4880
|
"disabled",
|
|
4841
4881
|
"title",
|
|
4842
4882
|
"aria-label",
|
|
4843
4883
|
"aria-pressed"
|
|
4844
|
-
],
|
|
4884
|
+
], rs = [
|
|
4845
4885
|
"disabled",
|
|
4846
4886
|
"title",
|
|
4847
4887
|
"aria-label",
|
|
4848
4888
|
"aria-pressed"
|
|
4849
|
-
],
|
|
4889
|
+
], is = [
|
|
4850
4890
|
"disabled",
|
|
4851
4891
|
"title",
|
|
4852
4892
|
"aria-label",
|
|
4853
4893
|
"aria-pressed"
|
|
4854
|
-
],
|
|
4894
|
+
], as = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
4855
4895
|
__name: "FormattingBar",
|
|
4856
4896
|
props: {
|
|
4857
4897
|
currentFormatting: {},
|
|
@@ -4893,7 +4933,7 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
4893
4933
|
"redo"
|
|
4894
4934
|
],
|
|
4895
4935
|
setup(e, { emit: t }) {
|
|
4896
|
-
let { ColorPicker: n } = h(), a = e, o = t, { t: s } = r(), c = A(() => a.currentFormatting ?? {}), l = A(() => a.documentStyles ? { styles: a.documentStyles } : {}), u = A(() => c.value.listState ??
|
|
4936
|
+
let { ColorPicker: n } = h(), a = e, o = t, { t: s } = r(), c = A(() => a.currentFormatting ?? {}), l = A(() => a.documentStyles ? { styles: a.documentStyles } : {}), u = A(() => c.value.listState ?? Xo()), d = A(() => {
|
|
4897
4937
|
let e = c.value.color;
|
|
4898
4938
|
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
4899
4939
|
}), f = A(() => {
|
|
@@ -4926,7 +4966,7 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
4926
4966
|
}, [F(i, {
|
|
4927
4967
|
name: "undo",
|
|
4928
4968
|
size: 18
|
|
4929
|
-
})], 40,
|
|
4969
|
+
})], 40, $o), P("button", {
|
|
4930
4970
|
type: "button",
|
|
4931
4971
|
class: "docx-formatting-bar__btn",
|
|
4932
4972
|
disabled: e.disabled || !e.canRedo,
|
|
@@ -4936,12 +4976,12 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
4936
4976
|
}, [F(i, {
|
|
4937
4977
|
name: "redo",
|
|
4938
4978
|
size: 18
|
|
4939
|
-
})], 40,
|
|
4979
|
+
})], 40, es)], 8, Qo),
|
|
4940
4980
|
r[13] ||= P("span", {
|
|
4941
4981
|
class: "docx-formatting-bar__divider",
|
|
4942
4982
|
role: "separator"
|
|
4943
4983
|
}, null, -1),
|
|
4944
|
-
e.showStylePicker ? (V(), N(O, { key: 0 }, [F(
|
|
4984
|
+
e.showStylePicker ? (V(), N(O, { key: 0 }, [F(ee, De({ value: c.value.styleId ?? "Normal" }, l.value, {
|
|
4945
4985
|
disabled: e.disabled,
|
|
4946
4986
|
onChange: r[2] ||= (e) => o("format", {
|
|
4947
4987
|
type: "applyStyle",
|
|
@@ -4967,7 +5007,7 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
4967
5007
|
}, [F(i, {
|
|
4968
5008
|
name: "format_bold",
|
|
4969
5009
|
size: 18
|
|
4970
|
-
})], 42,
|
|
5010
|
+
})], 42, ns),
|
|
4971
5011
|
P("button", {
|
|
4972
5012
|
type: "button",
|
|
4973
5013
|
class: R(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.italic }]),
|
|
@@ -4979,7 +5019,7 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
4979
5019
|
}, [F(i, {
|
|
4980
5020
|
name: "format_italic",
|
|
4981
5021
|
size: 18
|
|
4982
|
-
})], 42,
|
|
5022
|
+
})], 42, rs),
|
|
4983
5023
|
P("button", {
|
|
4984
5024
|
type: "button",
|
|
4985
5025
|
class: R(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.underline }]),
|
|
@@ -4991,8 +5031,8 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
4991
5031
|
}, [F(i, {
|
|
4992
5032
|
name: "format_underlined",
|
|
4993
5033
|
size: 18
|
|
4994
|
-
})], 42,
|
|
4995
|
-
], 8,
|
|
5034
|
+
})], 42, is)
|
|
5035
|
+
], 8, ts),
|
|
4996
5036
|
e.showTextColorPicker ? (V(), N(O, { key: 1 }, [r[12] ||= P("span", {
|
|
4997
5037
|
class: "docx-formatting-bar__divider",
|
|
4998
5038
|
role: "separator"
|
|
@@ -5020,7 +5060,7 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
5020
5060
|
value: e
|
|
5021
5061
|
})
|
|
5022
5062
|
}, null, 8, ["value", "disabled"])) : M("", !0),
|
|
5023
|
-
e.showListButtons ? (V(), j(
|
|
5063
|
+
e.showListButtons ? (V(), j(te, {
|
|
5024
5064
|
key: 3,
|
|
5025
5065
|
"list-state": u.value,
|
|
5026
5066
|
disabled: e.disabled,
|
|
@@ -5034,9 +5074,9 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
5034
5074
|
"disabled",
|
|
5035
5075
|
"can-outdent"
|
|
5036
5076
|
])) : M("", !0)
|
|
5037
|
-
], 10,
|
|
5077
|
+
], 10, Zo));
|
|
5038
5078
|
}
|
|
5039
|
-
}), [["__scopeId", "data-v-fc03de2e"]]),
|
|
5079
|
+
}), [["__scopeId", "data-v-fc03de2e"]]), os = [
|
|
5040
5080
|
{
|
|
5041
5081
|
value: .5,
|
|
5042
5082
|
label: "50%"
|
|
@@ -5061,7 +5101,7 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
5061
5101
|
value: 2,
|
|
5062
5102
|
label: "200%"
|
|
5063
5103
|
}
|
|
5064
|
-
],
|
|
5104
|
+
], ss = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
5065
5105
|
__name: "ZoomControl",
|
|
5066
5106
|
props: {
|
|
5067
5107
|
value: { default: 1 },
|
|
@@ -5078,7 +5118,7 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
5078
5118
|
},
|
|
5079
5119
|
emits: ["change"],
|
|
5080
5120
|
setup(e, { emit: t }) {
|
|
5081
|
-
let { Select: n } = h(), r = e, i = t, a = A(() => r.levels ??
|
|
5121
|
+
let { Select: n } = h(), r = e, i = t, a = A(() => r.levels ?? os), o = A(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = A(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = A(() => o.value ? String(o.value.value) : String(r.value)), l = A(() => {
|
|
5082
5122
|
let e = a.value.map((e) => ({
|
|
5083
5123
|
value: String(e.value),
|
|
5084
5124
|
label: e.label
|
|
@@ -5106,8 +5146,8 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
5106
5146
|
"disabled"
|
|
5107
5147
|
]));
|
|
5108
5148
|
}
|
|
5109
|
-
}), [["__scopeId", "data-v-8079e07f"]]),
|
|
5110
|
-
let { colorMode: r =
|
|
5149
|
+
}), [["__scopeId", "data-v-8079e07f"]]), cs = (e, t, n = {}) => {
|
|
5150
|
+
let { colorMode: r = oe, locale: i = "en", ...a } = n;
|
|
5111
5151
|
return new Promise((n, o) => {
|
|
5112
5152
|
let s = H(null), c = null, l = !1, d = {
|
|
5113
5153
|
save: async () => {
|
|
@@ -5132,7 +5172,7 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
5132
5172
|
}
|
|
5133
5173
|
};
|
|
5134
5174
|
c = Se({ setup() {
|
|
5135
|
-
return () => Ee(
|
|
5175
|
+
return () => Ee(Yo, {
|
|
5136
5176
|
...a,
|
|
5137
5177
|
documentBuffer: e,
|
|
5138
5178
|
ref: s,
|
|
@@ -5143,8 +5183,8 @@ var Wo = ["aria-label"], Go = ["aria-label"], Ko = [
|
|
|
5143
5183
|
a.onError?.(e), l || (l = !0, c?.unmount(), c = null, o(e));
|
|
5144
5184
|
}
|
|
5145
5185
|
});
|
|
5146
|
-
} }), c.use(u, i), c.use(
|
|
5186
|
+
} }), c.use(u, i), c.use(ue, r), c.mount(t);
|
|
5147
5187
|
});
|
|
5148
5188
|
};
|
|
5149
5189
|
//#endregion
|
|
5150
|
-
export {
|
|
5190
|
+
export { li as AutocompleteCaretOverlay, Hr as DEFAULT_AI_SUGGESTION_PRESETS, _t as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, zr as DOCUMENT_PRESET_VERSION, Br as DOCUMENT_STYLE_SET_VERSION, Yo as DocxEditor, pe as FindReplaceDialog, l as FolioUIProvider, me as FootnotePropertiesDialog, as as FormattingBar, he as HyperlinkDialog, w as ImagePositionDialog, ge as ImagePropertiesDialog, T as InsertImageDialog, E as InsertSymbolDialog, _e as InsertTableDialog, ve as PageSetupDialog, ye as PasteSpecialDialog, Ir as STELLA_STYLE_SET_NAME, be as SplitCellDialog, xe as TablePropertiesDialog, D as WatermarkDialog, ss as ZoomControl, vt as acceptAutocompleteSuggestion, yt as acceptAutocompleteWord, ft as anonymizationDecorationsKey, Y as appendAutocompleteToken, An as applyFolioAIEditOperations, Ur as applySuggestions, bt as autocompleteSuggestionKey, xt as autocompleteSuggestionPlugin, Kr as buildPositionalText, St as clearAutocompleteSuggestion, yn as clearTemplateSlashMenu, ue as colorModePlugin, bn as consumeTemplateSlashQuery, Qr as createAICitationDecorationsPlugin, Vr as createDocx, jr as createEmptyDocument, Pn as createFolioAIEditSnapshot, Lr as createStellaStyleDocumentPreset, Rr as createStellaStyleSet, oe as defaultColorMode, e as defaultLocale, tr as deriveBlockId, In as diffWordSegments, Mr as extractDocumentStyleSet, Nr as extractDocumentStyleSetFromDocx, Ct as finishAutocompleteSuggestion, ti as fromMarkdown, pt as getAnonymizationMatches, wt as getAutocompleteSuggestion, it as getDocumentWatermark, Xr as getFolioCaretViewportRect, nr as getFolioParaIdFromBlockId, Zr as getFolioSelectionViewportRect, Xt as getTemplateDirectives, xn as getTemplateSlashMenu, Bn as hashFolioAIBlockText, u as i18nPlugin, He as insertImageFromFile, We as insertPageBreakInView, Ke as insertTableInView, Je as insertTableOfContentsInView, Pr as inspectDocumentStyles, Fr as inspectDocumentStylesFromDocx, ir as isFolioBlockId, ar as isSequentialFolioBlockId, Wr as isSuggestionStale, Vn as normalizeFolioAIBlockText, C as provideColorMode, n as provideLocale, cs as renderAsync, Sn as resetTemplateSlashQuery, Gr as resolveSuggestionAnchor, Qt as scanDirectives, Yr as scrollFolioPositionIntoView, $r as setAICitationsMeta, qr as setAISuggestionsMeta, ei as setActiveCitationMeta, ht as setAnonymizationTermsMeta, ot as setDocumentWatermark, Jr as setFocusedSuggestionMeta, $ as setTemplatePreviewValues, Et as shouldTriggerAutocomplete, Dt as startAutocompleteSuggestion, Cn as templateSlashMenuKey, ni as toMarkdown, ri as toMarkdownResult, fe as useColorMode, r as useTranslation, de as useWheelZoom };
|