@stll/folio-vue 0.12.6 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +9 -0
- package/dist/components/DocxEditor/types.d.ts +9 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +2 -0
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +396 -368
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -45,47 +45,48 @@ import { clearTemplateSlashMenu as Cn, consumeTemplateSlashQuery as wn, getTempl
|
|
|
45
45
|
import { createEmptyHeaderFooter as On, pickActiveHeaderFooterRId as kn, removeHeaderFooter as An, resolveHeaderFooterContent as jn, saveHeaderFooterContent as Mn } from "@stll/folio-core/utils/headerFooter";
|
|
46
46
|
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as Nn, applyFolioAIEditOperations as Pn, applyFolioAIEditOperations as Fn, applyFolioDocumentOperations as In, assertSupportedFolioDocumentOperationVersion as Ln, createFolioAIEditSnapshot as Rn, createFolioAIEditSnapshot as zn, diffWordSegments as Bn, getCommentAnchorsFromDoc as Vn, getFolioDocumentOperationIssues as Hn, getTrackedChangesFromDoc as Un, hashFolioAIBlockText as Wn, normalizeFolioAIBlockText as Gn } from "@stll/folio-core/ai-edits";
|
|
47
47
|
import { findParagraphFragmentsByParaId as Kn, flashParagraphElements as qn } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
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 {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
48
|
+
import { onPaintedLayoutChange as Jn, readBlockRects as Yn } from "@stll/folio-core/paged-layout/blockGeometry";
|
|
49
|
+
import { blockSdtAttrsToSdtProperties as Xn, findBlockSdtMatch as Zn, findBlockSdtMatches as Qn, removeContentControlTr as $n, setContentControlContentTr as er, setContentControlValueTr as tr } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
50
|
+
import { setContentControlContentBlocksTr as nr } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
51
|
+
import { clampRangeToDocSize as rr, resolveFolioAIBlockRange as ir, resolveFolioAITextRange as ar, resolvePassageRange as or } from "@stll/folio-core/ai-edits/blockRange";
|
|
52
|
+
import { deriveBlockId as sr, getFolioParaIdFromBlockId as cr, getFolioParaIdFromBlockId as lr, isFolioBlockId as ur, isSequentialFolioBlockId as dr } from "@stll/folio-core/types/block-id";
|
|
53
|
+
import { getPageTextFromLayout as fr } from "@stll/folio-core/paged-layout/pageText";
|
|
54
|
+
import { applyStyle as pr, removeTabStop as mr, setIndentFirstLine as hr, setIndentLeft as gr, setIndentRight as _r } from "@stll/folio-core/prosemirror/commands/paragraph";
|
|
55
|
+
import { getCachedNumberingMap as vr } from "@stll/folio-core/docx";
|
|
56
|
+
import { insertPageBreak as yr } from "@stll/folio-core/prosemirror/commands/pageBreak";
|
|
57
|
+
import { insertSectionBreakContinuous as br, insertSectionBreakNextPage as xr } from "@stll/folio-core/prosemirror/commands/sectionBreak";
|
|
58
|
+
import { setEmbeddedFontFamilyMap as Sr } from "@stll/folio-core/utils/fontResolver";
|
|
59
|
+
import { buildEmbeddedFontFamilyMap as Cr, extractEmbeddedFonts as wr } from "@stll/folio-core/fonts/embeddedFonts";
|
|
60
|
+
import { editHyperlinkAtCursor as Tr, removeHyperlinkAtCursor as Er } from "@stll/folio-core/prosemirror/commands/hyperlink";
|
|
61
|
+
import { sanitizeExternalUrl as Dr } from "@stll/folio-core/utils/urlSecurity";
|
|
62
|
+
import { collectHeadings as Or } from "@stll/folio-core/utils/headingCollector";
|
|
63
|
+
import { clickToPositionInHfSlot as kr } from "@stll/folio-core/layout-bridge/dom/findHfPmSpans";
|
|
64
|
+
import { findNoteStoryForTarget as Ar } from "@stll/folio-core/layout-bridge/dom/noteStoryDom";
|
|
65
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as jr, detectTableInsertHover as Mr } from "@stll/folio-core/layout-bridge/tableInsertHover";
|
|
66
|
+
import { createCellDragTracker as Nr, findCellPosFromPmPos as Pr } from "@stll/folio-core/prosemirror/cellDragSelection";
|
|
67
|
+
import { RemoteSelectionOverlay as Fr } from "@stll/folio-core/render-dom/RemoteSelectionOverlay";
|
|
68
|
+
import { BodySelectionOverlay as Ir } from "@stll/folio-core/render-dom/BodySelectionOverlay";
|
|
69
|
+
import { createEmptyDocument as Lr } from "@stll/folio-core/utils/createDocument";
|
|
70
|
+
import { extractDocumentStyleSet as Rr, extractDocumentStyleSetFromDocx as zr, inspectDocumentStyles as Br, inspectDocumentStylesFromDocx as Vr } from "@stll/folio-core/style-sets/extract";
|
|
71
|
+
import { STELLA_STYLE_SET_NAME as Hr, createStellaStyleDocumentPreset as Ur, createStellaStyleSet as Wr } from "@stll/folio-core/style-sets/stellaStyle";
|
|
72
|
+
import { DOCUMENT_PRESET_VERSION as Gr, DOCUMENT_STYLE_SET_VERSION as Kr } from "@stll/folio-core/style-sets/types";
|
|
73
|
+
import { createDocx as qr } from "@stll/folio-core/docx/rezip";
|
|
74
|
+
import { DEFAULT_AI_SUGGESTION_PRESETS as Jr } from "@stll/folio-core/ai-suggestions/types";
|
|
75
|
+
import { applySuggestions as Yr } from "@stll/folio-core/ai-suggestions/apply";
|
|
76
|
+
import { isSuggestionStale as Xr, resolveSuggestionAnchor as Zr } from "@stll/folio-core/ai-suggestions/conflict";
|
|
77
|
+
import { buildPositionalText as Qr } from "@stll/folio-core/ai-suggestions/text-positions";
|
|
78
|
+
import { setAISuggestionsMeta as $r, setFocusedSuggestionMeta as ei } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
79
|
+
import { scrollFolioPositionIntoView as ti } from "@stll/folio-core/paged-layout/scrollToPmPosition";
|
|
80
|
+
import { getFolioCaretViewportRect as ni, getFolioSelectionViewportRect as ri } from "@stll/folio-core/paged-layout/selectionViewportRect";
|
|
81
|
+
import { createAICitationDecorationsPlugin as ii, setAICitationsMeta as ai, setActiveCitationMeta as oi } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
82
|
+
import { fromMarkdown as si, toMarkdown as ci, toMarkdownResult as li } from "@stll/folio-core/markdown";
|
|
82
83
|
//#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
83
|
-
var
|
|
84
|
+
var ui = [
|
|
84
85
|
"data-folio-anonymization-label",
|
|
85
86
|
"data-folio-anonymization-canonical",
|
|
86
87
|
"data-folio-anonymization-selected",
|
|
87
88
|
"title"
|
|
88
|
-
],
|
|
89
|
+
], di = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
89
90
|
__name: "AnonymizationRectsOverlay",
|
|
90
91
|
props: {
|
|
91
92
|
getView: { type: Function },
|
|
@@ -202,12 +203,12 @@ var ci = [
|
|
|
202
203
|
width: `${n.width}px`,
|
|
203
204
|
height: `${n.height}px`
|
|
204
205
|
})
|
|
205
|
-
}, null, 14,
|
|
206
|
+
}, null, 14, ui))), 128))], 64))), 128))], 512));
|
|
206
207
|
}
|
|
207
|
-
}), [["__scopeId", "data-v-df8fe7df"]]),
|
|
208
|
+
}), [["__scopeId", "data-v-df8fe7df"]]), fi = {
|
|
208
209
|
class: "folio-passage-highlight-overlay",
|
|
209
210
|
"data-folio-passage-highlight-overlay": ""
|
|
210
|
-
},
|
|
211
|
+
}, pi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
211
212
|
__name: "PassageHighlightOverlay",
|
|
212
213
|
props: {
|
|
213
214
|
range: {},
|
|
@@ -254,7 +255,7 @@ var ci = [
|
|
|
254
255
|
t.measures
|
|
255
256
|
], () => a(), { immediate: !0 }), B(() => {
|
|
256
257
|
r.invalidate(), i !== null && (cancelAnimationFrame(i), i = null);
|
|
257
|
-
}), (e, t) => (V(), N("div",
|
|
258
|
+
}), (e, t) => (V(), N("div", fi, [(V(!0), N(O, null, U(n.value, (e, t) => (V(), N("span", {
|
|
258
259
|
key: `${t}:${e.left}:${e.top}`,
|
|
259
260
|
class: "folio-passage-highlight",
|
|
260
261
|
style: z({
|
|
@@ -266,11 +267,11 @@ var ci = [
|
|
|
266
267
|
})
|
|
267
268
|
}, null, 4))), 128))]));
|
|
268
269
|
}
|
|
269
|
-
}), [["__scopeId", "data-v-bde9f41b"]]),
|
|
270
|
+
}), [["__scopeId", "data-v-bde9f41b"]]), mi = {
|
|
270
271
|
key: 0,
|
|
271
272
|
class: "folio-autocomplete-overlay",
|
|
272
273
|
"data-folio-autocomplete-overlay": ""
|
|
273
|
-
},
|
|
274
|
+
}, hi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
274
275
|
__name: "AutocompleteCaretOverlay",
|
|
275
276
|
props: {
|
|
276
277
|
caret: {},
|
|
@@ -278,7 +279,7 @@ var ci = [
|
|
|
278
279
|
isStreaming: { type: Boolean }
|
|
279
280
|
},
|
|
280
281
|
setup(e) {
|
|
281
|
-
return (t, n) => e.caret && e.text.length > 0 ? (V(), N("div",
|
|
282
|
+
return (t, n) => e.caret && e.text.length > 0 ? (V(), N("div", mi, [P("span", {
|
|
282
283
|
class: "folio-autocomplete-ghost",
|
|
283
284
|
style: z({
|
|
284
285
|
left: `${e.caret.x}px`,
|
|
@@ -291,7 +292,7 @@ var ci = [
|
|
|
291
292
|
"aria-hidden": "true"
|
|
292
293
|
}, "stella", 2)], 4)])) : M("", !0);
|
|
293
294
|
}
|
|
294
|
-
}), [["__scopeId", "data-v-00299904"]]),
|
|
295
|
+
}), [["__scopeId", "data-v-00299904"]]), gi = 48, _i = /* @__PURE__ */ I({
|
|
295
296
|
__name: "AutocompleteSuggestionOverlay",
|
|
296
297
|
props: {
|
|
297
298
|
getPagesContainer: { type: Function },
|
|
@@ -308,7 +309,7 @@ var ci = [
|
|
|
308
309
|
let c = r.querySelector(".layout-page-content");
|
|
309
310
|
if (!c) return;
|
|
310
311
|
let l = (c.getBoundingClientRect().right - a.left) / i;
|
|
311
|
-
return Math.max(
|
|
312
|
+
return Math.max(gi, l - t);
|
|
312
313
|
}
|
|
313
314
|
}, s = () => {
|
|
314
315
|
let e = t.getPagesContainer(), r = t.editorState;
|
|
@@ -357,7 +358,7 @@ var ci = [
|
|
|
357
358
|
t.editorState,
|
|
358
359
|
t.zoom,
|
|
359
360
|
r.value
|
|
360
|
-
], () => c()), (e, t) => (V(), j(
|
|
361
|
+
], () => c()), (e, t) => (V(), j(hi, {
|
|
361
362
|
caret: n.value?.caret ?? null,
|
|
362
363
|
text: n.value?.text ?? "",
|
|
363
364
|
"is-streaming": n.value?.isStreaming ?? !1
|
|
@@ -367,33 +368,33 @@ var ci = [
|
|
|
367
368
|
"is-streaming"
|
|
368
369
|
]));
|
|
369
370
|
}
|
|
370
|
-
}),
|
|
371
|
-
function
|
|
372
|
-
je(
|
|
371
|
+
}), vi = Symbol("docx-portal-class");
|
|
372
|
+
function yi(e) {
|
|
373
|
+
je(vi, A(() => ({
|
|
373
374
|
"ep-root": !0,
|
|
374
375
|
dark: !!G(e)
|
|
375
376
|
})));
|
|
376
377
|
}
|
|
377
|
-
function
|
|
378
|
-
return L(
|
|
378
|
+
function bi() {
|
|
379
|
+
return L(vi, A(() => ({ "ep-root": !0 })));
|
|
379
380
|
}
|
|
380
381
|
//#endregion
|
|
381
382
|
//#region src/components/ContentControlWidgetsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
382
|
-
var
|
|
383
|
+
var xi = ["aria-label"], Si = {
|
|
383
384
|
key: 0,
|
|
384
385
|
class: "content-control-picker__items",
|
|
385
386
|
role: "menu"
|
|
386
|
-
},
|
|
387
|
+
}, Ci = {
|
|
387
388
|
key: 0,
|
|
388
389
|
class: "content-control-picker__empty"
|
|
389
|
-
},
|
|
390
|
+
}, wi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
390
391
|
__name: "ContentControlWidgetsOverlay",
|
|
391
392
|
props: {
|
|
392
393
|
eventRoot: {},
|
|
393
394
|
view: {}
|
|
394
395
|
},
|
|
395
396
|
setup(e) {
|
|
396
|
-
let t = e, { t: n } = r(), { Button: i, DatePickerPopover: a } = h(), o =
|
|
397
|
+
let t = e, { t: n } = r(), { Button: i, DatePickerPopover: a } = h(), o = bi(), s = new kt(), c = Ne(s.getSnapshot()), l = s.subscribe(() => {
|
|
397
398
|
c.value = s.getSnapshot();
|
|
398
399
|
});
|
|
399
400
|
K([() => t.view, () => t.eventRoot], ([e, t]) => s.bind(e, t), { immediate: !0 }), B(() => {
|
|
@@ -412,7 +413,7 @@ var yi = ["aria-label"], bi = {
|
|
|
412
413
|
role: "dialog",
|
|
413
414
|
"aria-label": c.value.status === "dropdown" ? G(n)("contentControlDropdownAriaLabel") : G(n)("contentControlDateAriaLabel"),
|
|
414
415
|
onMousedown: t[1] ||= q(() => {}, ["stop"])
|
|
415
|
-
}, [c.value.status === "dropdown" ? (V(), N("div",
|
|
416
|
+
}, [c.value.status === "dropdown" ? (V(), N("div", Si, [c.value.items.length === 0 ? (V(), N("div", Ci, W(G(n)("contentControlDropdownNoOptions")), 1)) : (V(!0), N(O, { key: 1 }, U(c.value.items, (e) => (V(), j(G(i), {
|
|
416
417
|
key: `${e.value}::${e.displayText}`,
|
|
417
418
|
"class-name": "content-control-picker__item",
|
|
418
419
|
type: "button",
|
|
@@ -429,9 +430,9 @@ var yi = ["aria-label"], bi = {
|
|
|
429
430
|
value: c.value.currentValue,
|
|
430
431
|
"default-open": !0,
|
|
431
432
|
onChange: d
|
|
432
|
-
}, null, 8, ["value"])) : M("", !0)], 46,
|
|
433
|
+
}, null, 8, ["value"])) : M("", !0)], 46, xi))]));
|
|
433
434
|
}
|
|
434
|
-
}), [["__scopeId", "data-v-19e067b7"]]),
|
|
435
|
+
}), [["__scopeId", "data-v-19e067b7"]]), Ti = /* @__PURE__ */ I({
|
|
435
436
|
__name: "DecorationLayer",
|
|
436
437
|
props: {
|
|
437
438
|
getView: { type: Function },
|
|
@@ -543,10 +544,10 @@ var yi = ["aria-label"], bi = {
|
|
|
543
544
|
"aria-hidden": "true"
|
|
544
545
|
}, null, 512));
|
|
545
546
|
}
|
|
546
|
-
}),
|
|
547
|
+
}), Ei = { class: "doc-outline__header" }, Di = { class: "doc-outline__body" }, Oi = {
|
|
547
548
|
key: 0,
|
|
548
549
|
class: "doc-outline__empty"
|
|
549
|
-
},
|
|
550
|
+
}, ki = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
550
551
|
__name: "DocumentOutline",
|
|
551
552
|
props: {
|
|
552
553
|
isOpen: { type: Boolean },
|
|
@@ -575,7 +576,7 @@ var yi = ["aria-label"], bi = {
|
|
|
575
576
|
role: "navigation",
|
|
576
577
|
"aria-label": "Document outline",
|
|
577
578
|
onMousedown: n[1] ||= q(() => {}, ["stop"])
|
|
578
|
-
}, [P("div",
|
|
579
|
+
}, [P("div", Ei, [P("button", {
|
|
579
580
|
class: "doc-outline__back",
|
|
580
581
|
title: "Close outline",
|
|
581
582
|
"aria-label": "Close outline",
|
|
@@ -583,7 +584,7 @@ var yi = ["aria-label"], bi = {
|
|
|
583
584
|
}, [F(i, {
|
|
584
585
|
name: "arrow_back",
|
|
585
586
|
size: 20
|
|
586
|
-
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div",
|
|
587
|
+
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div", Di, [e.headings.length === 0 ? (V(), N("div", Oi, "No headings found")) : (V(), j(G(r), {
|
|
587
588
|
key: 1,
|
|
588
589
|
items: o.value,
|
|
589
590
|
"get-scroll-container": e.getScrollContainer ?? (() => null),
|
|
@@ -591,7 +592,7 @@ var yi = ["aria-label"], bi = {
|
|
|
591
592
|
"aria-label": "Document outline"
|
|
592
593
|
}, null, 8, ["items", "get-scroll-container"]))])], 36)) : M("", !0);
|
|
593
594
|
}
|
|
594
|
-
}), [["__scopeId", "data-v-0797b3b1"]]),
|
|
595
|
+
}), [["__scopeId", "data-v-0797b3b1"]]), Ai = /* @__PURE__ */ I({
|
|
595
596
|
__name: "DocxEditorDialogs",
|
|
596
597
|
props: {
|
|
597
598
|
view: {},
|
|
@@ -684,10 +685,10 @@ var yi = ["aria-label"], bi = {
|
|
|
684
685
|
}, null, 8, ["is-open", "current-watermark"])
|
|
685
686
|
], 64));
|
|
686
687
|
}
|
|
687
|
-
}),
|
|
688
|
+
}), ji = {
|
|
688
689
|
key: 0,
|
|
689
690
|
class: "docx-editor-vue__title-bar"
|
|
690
|
-
},
|
|
691
|
+
}, Mi = { class: "docx-editor-vue__title-bar-left" }, Ni = { class: "docx-editor-vue__title-bar-center" }, Pi = { class: "docx-editor-vue__title-bar-right" }, Fi = /* @__PURE__ */ I({
|
|
691
692
|
__name: "DocxEditorMenuBar",
|
|
692
693
|
props: {
|
|
693
694
|
showMenuBar: {
|
|
@@ -719,9 +720,9 @@ var yi = ["aria-label"], bi = {
|
|
|
719
720
|
],
|
|
720
721
|
setup(e, { emit: t }) {
|
|
721
722
|
let n = t;
|
|
722
|
-
return (t, r) => e.showMenuBar ? (V(), N("div",
|
|
723
|
-
P("div",
|
|
724
|
-
P("div",
|
|
723
|
+
return (t, r) => e.showMenuBar ? (V(), N("div", ji, [
|
|
724
|
+
P("div", Mi, [Me(t.$slots, "title-bar-left")]),
|
|
725
|
+
P("div", Ni, [F(_, {
|
|
725
726
|
"model-value": e.documentName,
|
|
726
727
|
editable: e.documentNameEditable,
|
|
727
728
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
@@ -736,28 +737,28 @@ var yi = ["aria-label"], bi = {
|
|
|
736
737
|
"show-help-menu",
|
|
737
738
|
"show-table-insert"
|
|
738
739
|
])]),
|
|
739
|
-
P("div",
|
|
740
|
+
P("div", Pi, [Me(t.$slots, "title-bar-right")])
|
|
740
741
|
])) : M("", !0);
|
|
741
742
|
}
|
|
742
|
-
}),
|
|
743
|
+
}), Ii = ["aria-label"], Li = { class: "image-ctx-menu__icon" }, Ri = { class: "image-ctx-menu__label" }, zi = {
|
|
743
744
|
key: 1,
|
|
744
745
|
class: "image-ctx-menu__divider",
|
|
745
746
|
role: "separator"
|
|
746
|
-
},
|
|
747
|
+
}, Bi = [
|
|
747
748
|
"data-wrap-type",
|
|
748
749
|
"data-current",
|
|
749
750
|
"data-disabled",
|
|
750
751
|
"disabled",
|
|
751
752
|
"title",
|
|
752
753
|
"onClick"
|
|
753
|
-
],
|
|
754
|
+
], Vi = { class: "image-ctx-menu__icon" }, Hi = { class: "image-ctx-menu__label" }, Ui = ["aria-label"], Wi = ["disabled", "onClick"], Gi = { class: "image-ctx-menu__label" }, Ki = {
|
|
754
755
|
key: 0,
|
|
755
756
|
class: "image-ctx-menu__shortcut"
|
|
756
|
-
},
|
|
757
|
+
}, qi = {
|
|
757
758
|
key: 0,
|
|
758
759
|
class: "image-ctx-menu__divider",
|
|
759
760
|
role: "separator"
|
|
760
|
-
},
|
|
761
|
+
}, Ji = 18, Yi = 260, Xi = 10, Zi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
761
762
|
__name: "ImageContextMenu",
|
|
762
763
|
props: {
|
|
763
764
|
state: {},
|
|
@@ -778,7 +779,7 @@ var yi = ["aria-label"], bi = {
|
|
|
778
779
|
function o() {
|
|
779
780
|
a("open-properties"), a("close");
|
|
780
781
|
}
|
|
781
|
-
let { t: s } = r(), c =
|
|
782
|
+
let { t: s } = r(), c = bi(), l = Nt, u = A(() => n.state ? Ft(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
|
|
782
783
|
inline: "wrap_text",
|
|
783
784
|
squareLeft: "format_image_left",
|
|
784
785
|
squareRight: "format_image_right",
|
|
@@ -791,11 +792,11 @@ var yi = ["aria-label"], bi = {
|
|
|
791
792
|
let p = A(() => {
|
|
792
793
|
if (!n.state) return {};
|
|
793
794
|
let e = Nt.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
794
|
-
return typeof window < "u" && (t +
|
|
795
|
+
return typeof window < "u" && (t + Yi > window.innerWidth && (t = window.innerWidth - Yi - Xi), r + e > window.innerHeight && (r = window.innerHeight - e - Xi), t < Xi && (t = Xi), r < Xi && (r = Xi)), {
|
|
795
796
|
position: "fixed",
|
|
796
797
|
left: `${t}px`,
|
|
797
798
|
top: `${r}px`,
|
|
798
|
-
minWidth: `${
|
|
799
|
+
minWidth: `${Yi}px`,
|
|
799
800
|
zIndex: 400
|
|
800
801
|
};
|
|
801
802
|
});
|
|
@@ -837,11 +838,11 @@ var yi = ["aria-label"], bi = {
|
|
|
837
838
|
"data-action": "open-properties",
|
|
838
839
|
onMousedown: n[1] ||= q(() => {}, ["prevent"]),
|
|
839
840
|
onClick: o
|
|
840
|
-
}, [P("span",
|
|
841
|
+
}, [P("span", Li, [F(i, {
|
|
841
842
|
name: "settings",
|
|
842
|
-
size:
|
|
843
|
-
})]), P("span",
|
|
844
|
-
e.canOpenProperties ? (V(), N("div",
|
|
843
|
+
size: Ji
|
|
844
|
+
})]), P("span", Ri, W(G(s)("imageWrap.menu.imageProperties")), 1)], 32)) : M("", !0),
|
|
845
|
+
e.canOpenProperties ? (V(), N("div", zi)) : M("", !0),
|
|
845
846
|
(V(!0), N(O, null, U(G(l), (e) => (V(), N("button", {
|
|
846
847
|
key: e.choice,
|
|
847
848
|
type: "button",
|
|
@@ -855,17 +856,17 @@ var yi = ["aria-label"], bi = {
|
|
|
855
856
|
onMousedown: n[2] ||= q(() => {}, ["prevent"]),
|
|
856
857
|
onClick: (t) => h(e)
|
|
857
858
|
}, [
|
|
858
|
-
P("span",
|
|
859
|
+
P("span", Vi, [F(i, {
|
|
859
860
|
name: f(e.iconHint),
|
|
860
|
-
size:
|
|
861
|
+
size: Ji
|
|
861
862
|
}, null, 8, ["name"])]),
|
|
862
|
-
P("span",
|
|
863
|
+
P("span", Hi, W(G(s)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
863
864
|
e.choice === u.value ? (V(), N("span", {
|
|
864
865
|
key: 0,
|
|
865
866
|
class: "image-ctx-menu__current-dot",
|
|
866
867
|
"aria-label": G(s)("imageWrap.menu.ariaLabel")
|
|
867
|
-
}, "●", 8,
|
|
868
|
-
], 42,
|
|
868
|
+
}, "●", 8, Ui)) : M("", !0)
|
|
869
|
+
], 42, Bi))), 128)),
|
|
869
870
|
e.textActions && e.textActions.length > 0 ? (V(), N(O, { key: 2 }, [n[5] ||= P("div", {
|
|
870
871
|
class: "image-ctx-menu__divider",
|
|
871
872
|
role: "separator"
|
|
@@ -876,16 +877,16 @@ var yi = ["aria-label"], bi = {
|
|
|
876
877
|
disabled: e.disabled,
|
|
877
878
|
onMousedown: n[3] ||= q(() => {}, ["prevent"]),
|
|
878
879
|
onClick: (t) => g(e)
|
|
879
|
-
}, [P("span",
|
|
880
|
-
], 46,
|
|
880
|
+
}, [P("span", Gi, W(e.label), 1), e.shortcut ? (V(), N("span", Ki, W(e.shortcut), 1)) : M("", !0)], 40, Wi), e.dividerAfter ? (V(), N("div", qi)) : M("", !0)], 64))), 128))], 64)) : M("", !0)
|
|
881
|
+
], 46, Ii)) : M("", !0)]));
|
|
881
882
|
}
|
|
882
|
-
}), [["__scopeId", "data-v-fc8f35bc"]]),
|
|
883
|
+
}), [["__scopeId", "data-v-fc8f35bc"]]), Qi = ["disabled", "onMousedown"], $i = {
|
|
883
884
|
key: 0,
|
|
884
885
|
class: "ctx-menu__icon"
|
|
885
|
-
},
|
|
886
|
+
}, ea = { class: "ctx-menu__label" }, ta = {
|
|
886
887
|
key: 1,
|
|
887
888
|
class: "ctx-menu__shortcut"
|
|
888
|
-
},
|
|
889
|
+
}, na = 220, ra = 32, ia = 10, aa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
889
890
|
__name: "TextContextMenu",
|
|
890
891
|
props: {
|
|
891
892
|
isOpen: { type: Boolean },
|
|
@@ -902,7 +903,7 @@ var yi = ["aria-label"], bi = {
|
|
|
902
903
|
setup(e, { emit: t }) {
|
|
903
904
|
let n = e, i = ({ node: e }) => e;
|
|
904
905
|
i.props = ["node"];
|
|
905
|
-
let a = t, { t: o } = r(), s =
|
|
906
|
+
let a = t, { t: o } = r(), s = bi(), c = H(null), l = A(() => {
|
|
906
907
|
let e = [], t = n.customItems ?? [];
|
|
907
908
|
for (let [n, r] of t.entries()) e.push({
|
|
908
909
|
id: `custom-${r.id}`,
|
|
@@ -1038,8 +1039,8 @@ var yi = ["aria-label"], bi = {
|
|
|
1038
1039
|
action: "deleteTable"
|
|
1039
1040
|
}), e;
|
|
1040
1041
|
}), u = A(() => {
|
|
1041
|
-
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 *
|
|
1042
|
-
return typeof window < "u" && (e +
|
|
1042
|
+
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 * ra + i * 9;
|
|
1043
|
+
return typeof window < "u" && (e + na + ia > window.innerWidth && (e = window.innerWidth - na - ia), t + a + ia > window.innerHeight && (t = window.innerHeight - a - ia)), {
|
|
1043
1044
|
position: "fixed",
|
|
1044
1045
|
left: `${e}px`,
|
|
1045
1046
|
top: `${t}px`,
|
|
@@ -1077,12 +1078,12 @@ var yi = ["aria-label"], bi = {
|
|
|
1077
1078
|
disabled: e.disabled,
|
|
1078
1079
|
onMousedown: q((t) => d(e.action), ["prevent"])
|
|
1079
1080
|
}, [
|
|
1080
|
-
e.icon ? (V(), N("span",
|
|
1081
|
-
P("span",
|
|
1082
|
-
e.shortcut ? (V(), N("span",
|
|
1083
|
-
], 42,
|
|
1081
|
+
e.icon ? (V(), N("span", $i, [F(i, { node: e.icon }, null, 8, ["node"])])) : M("", !0),
|
|
1082
|
+
P("span", ea, W(e.label), 1),
|
|
1083
|
+
e.shortcut ? (V(), N("span", ta, W(e.shortcut), 1)) : M("", !0)
|
|
1084
|
+
], 42, Qi))), 128))], 38)) : M("", !0)]));
|
|
1084
1085
|
}
|
|
1085
|
-
}), [["__scopeId", "data-v-c1416e84"]]),
|
|
1086
|
+
}), [["__scopeId", "data-v-c1416e84"]]), oa = /* @__PURE__ */ I({
|
|
1086
1087
|
__name: "DocxEditorOverlays",
|
|
1087
1088
|
props: {
|
|
1088
1089
|
readOnly: { type: Boolean },
|
|
@@ -1101,7 +1102,7 @@ var yi = ["aria-label"], bi = {
|
|
|
1101
1102
|
],
|
|
1102
1103
|
setup(e, { emit: t }) {
|
|
1103
1104
|
let n = t;
|
|
1104
|
-
return (t, r) => (V(), N(O, null, [F(
|
|
1105
|
+
return (t, r) => (V(), N(O, null, [F(aa, {
|
|
1105
1106
|
"is-open": e.contextMenu.isOpen,
|
|
1106
1107
|
position: e.contextMenu.position,
|
|
1107
1108
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -1123,7 +1124,7 @@ var yi = ["aria-label"], bi = {
|
|
|
1123
1124
|
"can-merge-cells",
|
|
1124
1125
|
"can-split-cell",
|
|
1125
1126
|
"custom-items"
|
|
1126
|
-
]), F(
|
|
1127
|
+
]), F(Zi, {
|
|
1127
1128
|
state: e.imageContextMenu,
|
|
1128
1129
|
"text-actions": e.imageContextMenuTextActions,
|
|
1129
1130
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -1140,7 +1141,7 @@ var yi = ["aria-label"], bi = {
|
|
|
1140
1141
|
});
|
|
1141
1142
|
//#endregion
|
|
1142
1143
|
//#region src/composables/imageOverlayRect.ts
|
|
1143
|
-
function
|
|
1144
|
+
function sa(e) {
|
|
1144
1145
|
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
1145
1146
|
return {
|
|
1146
1147
|
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
@@ -1151,13 +1152,13 @@ function aa(e) {
|
|
|
1151
1152
|
}
|
|
1152
1153
|
//#endregion
|
|
1153
1154
|
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
1154
|
-
var
|
|
1155
|
+
var ca = ["data-handle", "onMousedown"], la = ["title"], ua = {
|
|
1155
1156
|
key: 0,
|
|
1156
1157
|
class: "image-overlay__dim"
|
|
1157
|
-
},
|
|
1158
|
+
}, da = {
|
|
1158
1159
|
key: 1,
|
|
1159
1160
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
1160
|
-
},
|
|
1161
|
+
}, fa = 4, pa = 15, ma = 250, ha = 700, ga = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1161
1162
|
__name: "ImageSelectionOverlay",
|
|
1162
1163
|
props: {
|
|
1163
1164
|
imageInfo: {},
|
|
@@ -1210,7 +1211,7 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1210
1211
|
return;
|
|
1211
1212
|
}
|
|
1212
1213
|
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
1213
|
-
p.value =
|
|
1214
|
+
p.value = sa({
|
|
1214
1215
|
imageRect: r,
|
|
1215
1216
|
parentRect: n,
|
|
1216
1217
|
scrollLeft: t.scrollLeft,
|
|
@@ -1228,10 +1229,10 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1228
1229
|
let o = a - r;
|
|
1229
1230
|
S();
|
|
1230
1231
|
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
1231
|
-
n = c === t ? n + 1 : 0, t = c, !(o >=
|
|
1232
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= ma && n >= 2) && o < ha && (e = requestAnimationFrame(i));
|
|
1232
1233
|
};
|
|
1233
1234
|
e = requestAnimationFrame(i);
|
|
1234
|
-
let a = setTimeout(S,
|
|
1235
|
+
let a = setTimeout(S, ma);
|
|
1235
1236
|
C = () => {
|
|
1236
1237
|
cancelAnimationFrame(e), clearTimeout(a);
|
|
1237
1238
|
};
|
|
@@ -1399,7 +1400,7 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1399
1400
|
}
|
|
1400
1401
|
function xe(e) {
|
|
1401
1402
|
let t = ye(e.clientX, e.clientY) - T, n = he + t;
|
|
1402
|
-
e.shiftKey || (n = Math.round(n /
|
|
1403
|
+
e.shiftKey || (n = Math.round(n / pa) * pa), f.value = (n % 360 + 360) % 360, E && (E.style.transform = ve(ge, f.value) || "");
|
|
1403
1404
|
}
|
|
1404
1405
|
function D() {
|
|
1405
1406
|
document.removeEventListener("mousemove", xe), document.removeEventListener("mouseup", D), l.value = !1, a("interact-end");
|
|
@@ -1420,7 +1421,7 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1420
1421
|
if (!i.imageInfo || !p.value) return;
|
|
1421
1422
|
let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
|
|
1422
1423
|
let s = e.clientX - t, l = e.clientY - n;
|
|
1423
|
-
if (!(!o && Math.sqrt(s * s + l * l) <
|
|
1424
|
+
if (!(!o && Math.sqrt(s * s + l * l) < fa)) {
|
|
1424
1425
|
if (!o) {
|
|
1425
1426
|
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);";
|
|
1426
1427
|
let e = i.zoom;
|
|
@@ -1499,19 +1500,19 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1499
1500
|
style: z(e.style),
|
|
1500
1501
|
"data-handle": e.pos,
|
|
1501
1502
|
onMousedown: q((t) => ue(t, e.pos), ["prevent", "stop"])
|
|
1502
|
-
}, null, 44,
|
|
1503
|
+
}, null, 44, ca))), 128)),
|
|
1503
1504
|
r[5] ||= P("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
1504
1505
|
P("div", {
|
|
1505
1506
|
class: "image-overlay__rotate-handle",
|
|
1506
1507
|
style: z({ left: `${w.value / 2 - 7}px` }),
|
|
1507
1508
|
title: G(n)("imageOverlay.rotate"),
|
|
1508
1509
|
onMousedown: r[2] ||= q((e) => be(e), ["prevent", "stop"])
|
|
1509
|
-
}, null, 44,
|
|
1510
|
-
s.value ? (V(), N("div",
|
|
1511
|
-
l.value ? (V(), N("div",
|
|
1510
|
+
}, null, 44, la),
|
|
1511
|
+
s.value ? (V(), N("div", ua, W(Math.round(u.value)) + " × " + W(Math.round(d.value)), 1)) : M("", !0),
|
|
1512
|
+
l.value ? (V(), N("div", da, W(Math.round(f.value)) + "° ", 1)) : M("", !0)
|
|
1512
1513
|
], 36)) : M("", !0);
|
|
1513
1514
|
}
|
|
1514
|
-
}), [["__scopeId", "data-v-4c3d1a1d"]]),
|
|
1515
|
+
}), [["__scopeId", "data-v-4c3d1a1d"]]), _a = /* @__PURE__ */ I({
|
|
1515
1516
|
__name: "HeaderFooterSelectionOverlay",
|
|
1516
1517
|
props: {
|
|
1517
1518
|
pagesContainer: {},
|
|
@@ -1561,7 +1562,7 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1561
1562
|
i !== null && cancelAnimationFrame(i), o?.removeEventListener("scroll", a, !0), Xt(t.hiddenContainer);
|
|
1562
1563
|
}), (e, t) => null;
|
|
1563
1564
|
}
|
|
1564
|
-
}),
|
|
1565
|
+
}), va = { class: "hf-editor-label" }, ya = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1565
1566
|
__name: "InlineHeaderFooterEditor",
|
|
1566
1567
|
props: {
|
|
1567
1568
|
edit: {},
|
|
@@ -1604,7 +1605,7 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1604
1605
|
class: "hf-inline-editor",
|
|
1605
1606
|
style: z(l.value),
|
|
1606
1607
|
role: "presentation"
|
|
1607
|
-
}, [P("div", { class: R(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span",
|
|
1608
|
+
}, [P("div", { class: R(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span", va, W(c.value), 1), P("div", {
|
|
1608
1609
|
class: "hf-options",
|
|
1609
1610
|
onMousedown: n[5] ||= q(() => {}, ["stop"])
|
|
1610
1611
|
}, [F(G(a), {
|
|
@@ -1654,7 +1655,7 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1654
1655
|
})
|
|
1655
1656
|
], 2)) : M("", !0)], 32)], 2)], 4));
|
|
1656
1657
|
}
|
|
1657
|
-
}), [["__scopeId", "data-v-a0bd3730"]]),
|
|
1658
|
+
}), [["__scopeId", "data-v-a0bd3730"]]), ba = ["title", "aria-label"], xa = /* @__PURE__ */ I({
|
|
1658
1659
|
__name: "OutlineToggleButton",
|
|
1659
1660
|
props: {
|
|
1660
1661
|
leftOffset: {},
|
|
@@ -1677,9 +1678,9 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1677
1678
|
}, [F(i, {
|
|
1678
1679
|
name: "format_list_bulleted",
|
|
1679
1680
|
size: 20
|
|
1680
|
-
})], 44,
|
|
1681
|
+
})], 44, ba));
|
|
1681
1682
|
}
|
|
1682
|
-
}),
|
|
1683
|
+
}), Sa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1683
1684
|
__name: "PageIndicator",
|
|
1684
1685
|
props: {
|
|
1685
1686
|
currentPage: {},
|
|
@@ -1698,7 +1699,7 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1698
1699
|
total: e.totalPages
|
|
1699
1700
|
})), 5));
|
|
1700
1701
|
}
|
|
1701
|
-
}), [["__scopeId", "data-v-f1904974"]]),
|
|
1702
|
+
}), [["__scopeId", "data-v-f1904974"]]), Ca = ["data-folio-block-id"], wa = ["data-folio-block-id", "title"], Ta = 2.5, Ea = 5, Da = 6, Oa = 2, ka = 2, Aa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1702
1703
|
__name: "TemplateDirectivesOverlay",
|
|
1703
1704
|
props: {
|
|
1704
1705
|
getView: { type: Function },
|
|
@@ -1712,19 +1713,19 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1712
1713
|
setup(e) {
|
|
1713
1714
|
let t = e, n = /* @__PURE__ */ new Set(["if", "each"]), r = /* @__PURE__ */ new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
|
|
1714
1715
|
function a(e) {
|
|
1715
|
-
let t = e -
|
|
1716
|
-
return t <= 0 ? 0 : Math.floor(t /
|
|
1716
|
+
let t = e - Da - Ta - Oa;
|
|
1717
|
+
return t <= 0 ? 0 : Math.floor(t / Ea);
|
|
1717
1718
|
}
|
|
1718
1719
|
function o(e, t, n) {
|
|
1719
1720
|
let r = a(n), i = Math.min(Math.max(0, e), r);
|
|
1720
|
-
return t -
|
|
1721
|
+
return t - Da - Ta - (r - i) * Ea;
|
|
1721
1722
|
}
|
|
1722
1723
|
function s(e, t) {
|
|
1723
|
-
if (t.length === 0) return e.bottom - e.top >=
|
|
1724
|
+
if (t.length === 0) return e.bottom - e.top >= ka ? [e] : [];
|
|
1724
1725
|
let n = [];
|
|
1725
1726
|
for (let r of t) {
|
|
1726
1727
|
let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
|
|
1727
|
-
i - t >=
|
|
1728
|
+
i - t >= ka && n.push({
|
|
1728
1729
|
top: t,
|
|
1729
1730
|
bottom: i
|
|
1730
1731
|
});
|
|
@@ -1886,10 +1887,10 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1886
1887
|
position: "absolute",
|
|
1887
1888
|
left: `${t.railX * e.zoom}px`,
|
|
1888
1889
|
top: `${n.top * e.zoom}px`,
|
|
1889
|
-
width: `${
|
|
1890
|
+
width: `${Ta * e.zoom}px`,
|
|
1890
1891
|
height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
|
|
1891
1892
|
})
|
|
1892
|
-
}, null, 14,
|
|
1893
|
+
}, null, 14, Ca))), 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", {
|
|
1893
1894
|
key: `d:${n}:${i}`,
|
|
1894
1895
|
class: R(oe(t.range)),
|
|
1895
1896
|
"data-folio-block-id": S(t.range),
|
|
@@ -1901,9 +1902,9 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1901
1902
|
width: `${(r.width + 2) * e.zoom}px`,
|
|
1902
1903
|
height: `${Math.max(0, r.height - 2) * e.zoom}px`
|
|
1903
1904
|
})
|
|
1904
|
-
}, null, 14,
|
|
1905
|
+
}, null, 14, wa))), 128))], 64))), 128))], 32));
|
|
1905
1906
|
}
|
|
1906
|
-
}), [["__scopeId", "data-v-c72dfa21"]]),
|
|
1907
|
+
}), [["__scopeId", "data-v-c72dfa21"]]), ja = ["href", "title"], Ma = ["title"], Na = ["title"], Pa = ["title"], Fa = { class: "docx-hyperlink-popup__edit-row" }, Ia = ["placeholder", "onKeydown"], La = { class: "docx-hyperlink-popup__edit-row" }, Ra = ["onKeydown"], za = ["disabled"], Ba = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1907
1908
|
__name: "HyperlinkPopup",
|
|
1908
1909
|
props: {
|
|
1909
1910
|
data: {},
|
|
@@ -1952,28 +1953,28 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1952
1953
|
class: R(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
|
|
1953
1954
|
style: z(u.value),
|
|
1954
1955
|
onMousedown: r[6] ||= q(() => {}, ["stop"])
|
|
1955
|
-
}, [o.value ? (V(), N(O, { key: 1 }, [P("div",
|
|
1956
|
+
}, [o.value ? (V(), N(O, { key: 1 }, [P("div", Fa, [Le(P("input", {
|
|
1956
1957
|
class: "docx-hyperlink-popup__input",
|
|
1957
1958
|
placeholder: G(n)("displayText"),
|
|
1958
1959
|
"onUpdate:modelValue": r[2] ||= (e) => s.value = e,
|
|
1959
1960
|
onKeydown: [Re(q(h, ["prevent"]), ["enter"]), r[3] ||= Re((e) => t.$emit("close"), ["esc"])]
|
|
1960
|
-
}, null, 40,
|
|
1961
|
+
}, null, 40, Ia), [[Pe, s.value]])]), P("div", La, [Le(P("input", {
|
|
1961
1962
|
class: "docx-hyperlink-popup__input",
|
|
1962
1963
|
placeholder: "https://...",
|
|
1963
1964
|
"onUpdate:modelValue": r[4] ||= (e) => c.value = e,
|
|
1964
1965
|
onKeydown: [Re(q(h, ["prevent"]), ["enter"]), r[5] ||= Re((e) => t.$emit("close"), ["esc"])]
|
|
1965
|
-
}, null, 40,
|
|
1966
|
+
}, null, 40, Ra), [[Pe, c.value]]), P("button", {
|
|
1966
1967
|
class: "docx-hyperlink-popup__apply",
|
|
1967
1968
|
disabled: !c.value.trim(),
|
|
1968
1969
|
onClick: q(h, ["prevent"])
|
|
1969
|
-
}, W(G(n)("common.apply")), 9,
|
|
1970
|
+
}, W(G(n)("common.apply")), 9, za)])], 64)) : (V(), N(O, { key: 0 }, [
|
|
1970
1971
|
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),
|
|
1971
1972
|
P("a", {
|
|
1972
1973
|
class: "docx-hyperlink-popup__url",
|
|
1973
1974
|
href: e.data.href,
|
|
1974
1975
|
title: e.data.href,
|
|
1975
1976
|
onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1976
|
-
}, W(e.data.href), 9,
|
|
1977
|
+
}, W(e.data.href), 9, ja),
|
|
1977
1978
|
r[11] ||= P("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1978
1979
|
P("button", {
|
|
1979
1980
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1995,7 +1996,7 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
1995
1996
|
height: "13",
|
|
1996
1997
|
rx: "2",
|
|
1997
1998
|
ry: "2"
|
|
1998
|
-
}), 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,
|
|
1999
|
+
}), 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, Ma),
|
|
1999
2000
|
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
2000
2001
|
key: 0,
|
|
2001
2002
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -2010,43 +2011,43 @@ var oa = ["data-handle", "onMousedown"], sa = ["title"], ca = {
|
|
|
2010
2011
|
"stroke-width": "2",
|
|
2011
2012
|
"stroke-linecap": "round",
|
|
2012
2013
|
"stroke-linejoin": "round"
|
|
2013
|
-
}, [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,
|
|
2014
|
+
}, [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, Na)),
|
|
2014
2015
|
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
2015
2016
|
key: 1,
|
|
2016
2017
|
class: "docx-hyperlink-popup__btn",
|
|
2017
2018
|
title: G(n)("removeLink"),
|
|
2018
2019
|
onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
|
|
2019
|
-
}, [...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,
|
|
2020
|
+
}, [...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, Pa))
|
|
2020
2021
|
], 64))], 38)) : M("", !0);
|
|
2021
2022
|
}
|
|
2022
2023
|
}), [["__scopeId", "data-v-366df18c"]]);
|
|
2023
2024
|
//#endregion
|
|
2024
2025
|
//#region src/composables/commentMarks.ts
|
|
2025
|
-
function
|
|
2026
|
+
function Va(e, t) {
|
|
2026
2027
|
let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
|
|
2027
2028
|
return n === r ? null : {
|
|
2028
2029
|
from: n,
|
|
2029
2030
|
to: r
|
|
2030
2031
|
};
|
|
2031
2032
|
}
|
|
2032
|
-
function
|
|
2033
|
+
function Ha({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
|
|
2033
2034
|
let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
|
|
2034
|
-
return i ?
|
|
2035
|
+
return i ? Va(e, i) : null;
|
|
2035
2036
|
}
|
|
2036
|
-
function
|
|
2037
|
-
let i = e.state.schema.marks.comment, a =
|
|
2037
|
+
function Ua(e, t, n, r) {
|
|
2038
|
+
let i = e.state.schema.marks.comment, a = Va(e.state.doc.content.size, t);
|
|
2038
2039
|
if (!i || !a) return !1;
|
|
2039
2040
|
let o = e.state.tr;
|
|
2040
2041
|
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: cn }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(jt.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
|
|
2041
2042
|
}
|
|
2042
|
-
function
|
|
2043
|
-
let n = e.state.schema.marks.comment, r =
|
|
2043
|
+
function Wa(e, t) {
|
|
2044
|
+
let n = e.state.schema.marks.comment, r = Va(e.state.doc.content.size, t);
|
|
2044
2045
|
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: cn })));
|
|
2045
2046
|
}
|
|
2046
2047
|
//#endregion
|
|
2047
2048
|
//#region src/composables/useCommentLifecycle.ts
|
|
2048
|
-
var
|
|
2049
|
-
function
|
|
2049
|
+
var Ga = 408, Ka = 12;
|
|
2050
|
+
function qa(e) {
|
|
2050
2051
|
let t = H(!1), n = H(null), r = H(null), i = H(null), a = H(null);
|
|
2051
2052
|
function o(t) {
|
|
2052
2053
|
let n = e.editorView.value, r = e.pagesContainer.value;
|
|
@@ -2079,7 +2080,7 @@ function Ga(e) {
|
|
|
2079
2080
|
r.value = null;
|
|
2080
2081
|
return;
|
|
2081
2082
|
}
|
|
2082
|
-
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left +
|
|
2083
|
+
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + Ka : l.width / 2 + Ga;
|
|
2083
2084
|
r.value = {
|
|
2084
2085
|
top: c.top - l.top,
|
|
2085
2086
|
left: Math.max(16, Math.min(d, l.width - 16)),
|
|
@@ -2090,7 +2091,7 @@ function Ga(e) {
|
|
|
2090
2091
|
function c() {
|
|
2091
2092
|
let s = e.editorView.value;
|
|
2092
2093
|
if (!s) return;
|
|
2093
|
-
let c = r.value, l = s.state.selection, u =
|
|
2094
|
+
let c = r.value, l = s.state.selection, u = Ha({
|
|
2094
2095
|
docSize: s.state.doc.content.size,
|
|
2095
2096
|
capturedRange: c ? {
|
|
2096
2097
|
from: c.from,
|
|
@@ -2109,7 +2110,7 @@ function Ga(e) {
|
|
|
2109
2110
|
r.value = null;
|
|
2110
2111
|
return;
|
|
2111
2112
|
}
|
|
2112
|
-
if (!
|
|
2113
|
+
if (!Ua(s, u, cn, { selectEnd: !0 })) {
|
|
2113
2114
|
r.value = null, i.value = null;
|
|
2114
2115
|
return;
|
|
2115
2116
|
}
|
|
@@ -2122,11 +2123,11 @@ function Ga(e) {
|
|
|
2122
2123
|
let n = e.editorView.value, r = i.value;
|
|
2123
2124
|
if (!n || !r) return !1;
|
|
2124
2125
|
let a = e.createComment(t);
|
|
2125
|
-
return
|
|
2126
|
+
return Ua(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
|
|
2126
2127
|
}
|
|
2127
2128
|
function d() {
|
|
2128
2129
|
let t = e.editorView.value;
|
|
2129
|
-
t && i.value &&
|
|
2130
|
+
t && i.value && Wa(t, i.value), l();
|
|
2130
2131
|
}
|
|
2131
2132
|
return {
|
|
2132
2133
|
isAddingComment: t,
|
|
@@ -2140,7 +2141,7 @@ function Ga(e) {
|
|
|
2140
2141
|
}
|
|
2141
2142
|
//#endregion
|
|
2142
2143
|
//#region src/composables/useCommentManagement.ts
|
|
2143
|
-
function
|
|
2144
|
+
function Ja(e) {
|
|
2144
2145
|
let t = ln(), n = H([]), r = H(!1);
|
|
2145
2146
|
function i() {
|
|
2146
2147
|
r.value = !0;
|
|
@@ -2223,7 +2224,7 @@ function Ka(e) {
|
|
|
2223
2224
|
}
|
|
2224
2225
|
//#endregion
|
|
2225
2226
|
//#region src/utils/imageClipboard.ts
|
|
2226
|
-
function
|
|
2227
|
+
function Ya(e, t, n) {
|
|
2227
2228
|
let r = $(e.state), i = e.state.schema.marks.insertion;
|
|
2228
2229
|
if (!r || !i) return;
|
|
2229
2230
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
@@ -2233,7 +2234,7 @@ function qa(e, t, n) {
|
|
|
2233
2234
|
date: r.date
|
|
2234
2235
|
}));
|
|
2235
2236
|
}
|
|
2236
|
-
function
|
|
2237
|
+
function Xa(e, t) {
|
|
2237
2238
|
let n = e.state.doc.nodeAt(t);
|
|
2238
2239
|
if (!n || n.type.name !== "image") return;
|
|
2239
2240
|
let r = n.attrs.src;
|
|
@@ -2247,7 +2248,7 @@ function Ja(e, t) {
|
|
|
2247
2248
|
e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
2248
2249
|
});
|
|
2249
2250
|
}
|
|
2250
|
-
function
|
|
2251
|
+
function Za(e) {
|
|
2251
2252
|
return new Promise((t, n) => {
|
|
2252
2253
|
let r = new FileReader();
|
|
2253
2254
|
r.onload = () => {
|
|
@@ -2255,7 +2256,7 @@ function Ya(e) {
|
|
|
2255
2256
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
|
|
2256
2257
|
});
|
|
2257
2258
|
}
|
|
2258
|
-
function
|
|
2259
|
+
function Qa(e) {
|
|
2259
2260
|
return new Promise((t) => {
|
|
2260
2261
|
let n = new Image();
|
|
2261
2262
|
n.onload = () => t({
|
|
@@ -2267,7 +2268,7 @@ function Xa(e) {
|
|
|
2267
2268
|
}), n.src = e;
|
|
2268
2269
|
});
|
|
2269
2270
|
}
|
|
2270
|
-
function
|
|
2271
|
+
function $a(e, t, n, r) {
|
|
2271
2272
|
let i = e.state.schema.nodes.image;
|
|
2272
2273
|
if (!i) return;
|
|
2273
2274
|
let a = i.create({
|
|
@@ -2278,23 +2279,23 @@ function Za(e, t, n, r) {
|
|
|
2278
2279
|
wrapType: "inline",
|
|
2279
2280
|
displayMode: "inline"
|
|
2280
2281
|
}), o = e.state.tr.replaceSelectionWith(a);
|
|
2281
|
-
|
|
2282
|
+
Ya(e, o, a), e.dispatch(o);
|
|
2282
2283
|
}
|
|
2283
|
-
async function
|
|
2284
|
+
async function eo(e) {
|
|
2284
2285
|
try {
|
|
2285
2286
|
let t = await navigator.clipboard.read();
|
|
2286
2287
|
for (let n of t) {
|
|
2287
2288
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
2288
2289
|
if (t) {
|
|
2289
|
-
let r = await
|
|
2290
|
-
a > 612 && (o = Math.round(612 / a * o), a = 612),
|
|
2290
|
+
let r = await Za(await n.getType(t)), i = await Qa(r), a = i.width, o = i.height;
|
|
2291
|
+
a > 612 && (o = Math.round(612 / a * o), a = 612), $a(e, r, a, o);
|
|
2291
2292
|
return;
|
|
2292
2293
|
}
|
|
2293
2294
|
if (n.types.includes("text/html")) {
|
|
2294
2295
|
let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
|
|
2295
2296
|
if (r) {
|
|
2296
2297
|
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;
|
|
2297
|
-
|
|
2298
|
+
$a(e, r, a || 200, o || 200);
|
|
2298
2299
|
return;
|
|
2299
2300
|
}
|
|
2300
2301
|
}
|
|
@@ -2315,14 +2316,14 @@ async function Qa(e) {
|
|
|
2315
2316
|
}
|
|
2316
2317
|
}
|
|
2317
2318
|
}
|
|
2318
|
-
function
|
|
2319
|
+
function to(e, t) {
|
|
2319
2320
|
let n = e.state.doc.nodeAt(t);
|
|
2320
2321
|
if (!n || n.type.name !== "image") return;
|
|
2321
2322
|
let r = document.createElement("input");
|
|
2322
2323
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
2323
2324
|
let i = r.files?.[0];
|
|
2324
2325
|
if (!i) return;
|
|
2325
|
-
let a = await
|
|
2326
|
+
let a = await Za(i), o = await Qa(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);
|
|
2326
2327
|
try {
|
|
2327
2328
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
2328
2329
|
...n.attrs,
|
|
@@ -2337,7 +2338,7 @@ function $a(e, t) {
|
|
|
2337
2338
|
}
|
|
2338
2339
|
//#endregion
|
|
2339
2340
|
//#region src/composables/useContextMenus.ts
|
|
2340
|
-
var
|
|
2341
|
+
var no = /* @__PURE__ */ new Set([
|
|
2341
2342
|
"inline",
|
|
2342
2343
|
"square",
|
|
2343
2344
|
"tight",
|
|
@@ -2346,16 +2347,16 @@ var eo = /* @__PURE__ */ new Set([
|
|
|
2346
2347
|
"behind",
|
|
2347
2348
|
"inFront"
|
|
2348
2349
|
]);
|
|
2349
|
-
function
|
|
2350
|
-
return typeof e == "string" &&
|
|
2350
|
+
function ro(e) {
|
|
2351
|
+
return typeof e == "string" && no.has(e);
|
|
2351
2352
|
}
|
|
2352
|
-
function
|
|
2353
|
-
return
|
|
2353
|
+
function io(e) {
|
|
2354
|
+
return ro(e) ? e : "inline";
|
|
2354
2355
|
}
|
|
2355
|
-
function
|
|
2356
|
+
function ao(e) {
|
|
2356
2357
|
return e === "left" || e === "right" || e === "none" ? e : null;
|
|
2357
2358
|
}
|
|
2358
|
-
function
|
|
2359
|
+
function oo(e) {
|
|
2359
2360
|
let { t } = r(), n = H({
|
|
2360
2361
|
isOpen: !1,
|
|
2361
2362
|
position: {
|
|
@@ -2429,7 +2430,7 @@ function io(e) {
|
|
|
2429
2430
|
i.value = l(o, a, {
|
|
2430
2431
|
x: t.clientX,
|
|
2431
2432
|
y: t.clientY
|
|
2432
|
-
},
|
|
2433
|
+
}, io(s.attrs.wrapType), ao(s.attrs.cssFloat)), n.value.isOpen = !1;
|
|
2433
2434
|
return;
|
|
2434
2435
|
}
|
|
2435
2436
|
}
|
|
@@ -2464,7 +2465,7 @@ function io(e) {
|
|
|
2464
2465
|
!o || o.type.name !== "image" || (i.value = l(a.element, a.pmPos, {
|
|
2465
2466
|
x: t.clientX,
|
|
2466
2467
|
y: t.clientY
|
|
2467
|
-
},
|
|
2468
|
+
}, io(o.attrs.wrapType), ao(o.attrs.cssFloat)), n.value.isOpen = !1);
|
|
2468
2469
|
}
|
|
2469
2470
|
function f(t) {
|
|
2470
2471
|
let n = e.editorView.value, r = i.value;
|
|
@@ -2488,16 +2489,16 @@ function io(e) {
|
|
|
2488
2489
|
case "cut":
|
|
2489
2490
|
if (e.selectedImage.value) {
|
|
2490
2491
|
let t = e.selectedImage.value.pmPos;
|
|
2491
|
-
|
|
2492
|
+
Xa(n, t);
|
|
2492
2493
|
let r = n.state.doc.nodeAt(t);
|
|
2493
2494
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null, e.onCut?.());
|
|
2494
2495
|
} else n.focus(), document.execCommand("cut");
|
|
2495
2496
|
break;
|
|
2496
2497
|
case "copy":
|
|
2497
|
-
e.selectedImage.value ? (
|
|
2498
|
+
e.selectedImage.value ? (Xa(n, e.selectedImage.value.pmPos), e.onCopy?.()) : (n.focus(), document.execCommand("copy"));
|
|
2498
2499
|
break;
|
|
2499
2500
|
case "paste":
|
|
2500
|
-
|
|
2501
|
+
eo(n).then(() => e.onPaste?.()).catch(() => void 0);
|
|
2501
2502
|
break;
|
|
2502
2503
|
case "pasteAsPlainText":
|
|
2503
2504
|
navigator.clipboard.readText().then((t) => {
|
|
@@ -2518,7 +2519,7 @@ function io(e) {
|
|
|
2518
2519
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2519
2520
|
break;
|
|
2520
2521
|
case "replaceImage":
|
|
2521
|
-
e.selectedImage.value &&
|
|
2522
|
+
e.selectedImage.value && to(n, e.selectedImage.value.pmPos);
|
|
2522
2523
|
break;
|
|
2523
2524
|
case "deleteImage":
|
|
2524
2525
|
if (e.selectedImage.value) {
|
|
@@ -2556,7 +2557,7 @@ function io(e) {
|
|
|
2556
2557
|
}
|
|
2557
2558
|
//#endregion
|
|
2558
2559
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2559
|
-
function
|
|
2560
|
+
function so(e) {
|
|
2560
2561
|
async function t(t) {
|
|
2561
2562
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2562
2563
|
}
|
|
@@ -2575,8 +2576,8 @@ function ao(e) {
|
|
|
2575
2576
|
}
|
|
2576
2577
|
//#endregion
|
|
2577
2578
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2578
|
-
var
|
|
2579
|
-
function
|
|
2579
|
+
var co = Date.now();
|
|
2580
|
+
function lo(e) {
|
|
2580
2581
|
let t = [];
|
|
2581
2582
|
function n() {
|
|
2582
2583
|
e.onPrint?.(), window.print();
|
|
@@ -2620,7 +2621,23 @@ function so(e) {
|
|
|
2620
2621
|
let t = e.getActiveView();
|
|
2621
2622
|
t?.hasFocus() && t.dom instanceof HTMLElement && t.dom.blur();
|
|
2622
2623
|
}
|
|
2623
|
-
function f() {
|
|
2624
|
+
function f(t) {
|
|
2625
|
+
let n = e.editorView.value, r = e.pagesRef.value, i = e.scrollRootRef.value;
|
|
2626
|
+
return !n || !r || !i ? /* @__PURE__ */ new Map() : Yn({
|
|
2627
|
+
blockIds: t,
|
|
2628
|
+
snapshot: zn(n.state.doc),
|
|
2629
|
+
pagesContainer: r,
|
|
2630
|
+
scrollRoot: i
|
|
2631
|
+
});
|
|
2632
|
+
}
|
|
2633
|
+
function p(e) {
|
|
2634
|
+
return f([e]).get(e) ?? null;
|
|
2635
|
+
}
|
|
2636
|
+
function m(t) {
|
|
2637
|
+
let n = e.pagesRef.value;
|
|
2638
|
+
return n ? Jn(n, t) : () => {};
|
|
2639
|
+
}
|
|
2640
|
+
function h() {
|
|
2624
2641
|
return o ??= {
|
|
2625
2642
|
getEditor: () => e.editor,
|
|
2626
2643
|
getDocument: () => e.editor.getDocument(),
|
|
@@ -2642,7 +2659,7 @@ function so(e) {
|
|
|
2642
2659
|
getLayout: () => e.editor.getLayout(),
|
|
2643
2660
|
relayout: () => e.editor.relayout(),
|
|
2644
2661
|
scrollToPosition: (t) => e.scrollVisiblePositionIntoView(t),
|
|
2645
|
-
scrollToPage:
|
|
2662
|
+
scrollToPage: v,
|
|
2646
2663
|
scrollToParaId: i,
|
|
2647
2664
|
setPassageHighlight: e.setPassageHighlight,
|
|
2648
2665
|
getPageNumberForPmPos: (t) => {
|
|
@@ -2650,19 +2667,23 @@ function so(e) {
|
|
|
2650
2667
|
if (!n) return null;
|
|
2651
2668
|
let r = bn(n, t);
|
|
2652
2669
|
return r == null ? null : r + 1;
|
|
2653
|
-
}
|
|
2670
|
+
},
|
|
2671
|
+
getBlockRect: p,
|
|
2672
|
+
getBlockRects: f,
|
|
2673
|
+
getScrollRoot: () => e.scrollRootRef.value,
|
|
2674
|
+
onLayoutChange: m
|
|
2654
2675
|
}, o;
|
|
2655
2676
|
}
|
|
2656
|
-
function
|
|
2677
|
+
function g() {
|
|
2657
2678
|
return e.layout.value?.pages.length ?? 0;
|
|
2658
2679
|
}
|
|
2659
|
-
function
|
|
2680
|
+
function _() {
|
|
2660
2681
|
let t = e.layout.value, n = e.editorView.value;
|
|
2661
2682
|
if (!t || !n) return 0;
|
|
2662
2683
|
let r = bn(t, n.state.selection.from);
|
|
2663
2684
|
return r == null ? 0 : r + 1;
|
|
2664
2685
|
}
|
|
2665
|
-
function
|
|
2686
|
+
function v(t) {
|
|
2666
2687
|
if (!Number.isInteger(t) || t < 1) return;
|
|
2667
2688
|
let n = e.pagesViewportRef.value, r = e.pagesRef.value?.querySelector(`[data-page-number="${t}"]`);
|
|
2668
2689
|
if (!n || !r) return;
|
|
@@ -2675,15 +2696,15 @@ function so(e) {
|
|
|
2675
2696
|
return { exposed: {
|
|
2676
2697
|
getDocument: e.getDocument,
|
|
2677
2698
|
hasPendingChanges: () => e.editorView.value ? e.isDirty.value || e.commentsDirty.value : !1,
|
|
2678
|
-
getEditorRef:
|
|
2699
|
+
getEditorRef: h,
|
|
2679
2700
|
getEditor: () => e.editor,
|
|
2680
2701
|
save: r,
|
|
2681
2702
|
setZoom: e.setZoom,
|
|
2682
2703
|
getZoom: a,
|
|
2683
2704
|
focus: e.focus,
|
|
2684
|
-
getCurrentPage:
|
|
2685
|
-
getTotalPages:
|
|
2686
|
-
scrollToPage:
|
|
2705
|
+
getCurrentPage: _,
|
|
2706
|
+
getTotalPages: g,
|
|
2707
|
+
scrollToPage: v,
|
|
2687
2708
|
scrollToParaId: i,
|
|
2688
2709
|
openPrintPreview: () => n(),
|
|
2689
2710
|
print: n,
|
|
@@ -2729,7 +2750,7 @@ function so(e) {
|
|
|
2729
2750
|
createCommentId: (t) => e.createAIEditComment(t, i),
|
|
2730
2751
|
createUndoHandle: () => ({
|
|
2731
2752
|
type: "documentOperationUndo",
|
|
2732
|
-
id: `vue-${String(
|
|
2753
|
+
id: `vue-${String(co++)}`
|
|
2733
2754
|
})
|
|
2734
2755
|
});
|
|
2735
2756
|
return l.undoHandle !== null && t.push({
|
|
@@ -2797,13 +2818,13 @@ function so(e) {
|
|
|
2797
2818
|
if (!n) return !1;
|
|
2798
2819
|
let r = hn(n.state, t);
|
|
2799
2820
|
if (!r) return !1;
|
|
2800
|
-
let { from: i, to: a } =
|
|
2821
|
+
let { from: i, to: a } = rr(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2801
2822
|
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2802
2823
|
},
|
|
2803
2824
|
scrollToBlock: (t, n) => {
|
|
2804
2825
|
let r = e.editorView.value;
|
|
2805
2826
|
if (!r) return !1;
|
|
2806
|
-
let i =
|
|
2827
|
+
let i = ir({
|
|
2807
2828
|
blockId: t,
|
|
2808
2829
|
doc: r.state.doc,
|
|
2809
2830
|
snapshot: n
|
|
@@ -2815,7 +2836,7 @@ function so(e) {
|
|
|
2815
2836
|
highlightPassage: ({ blockId: t, text: n, snapshot: r }) => {
|
|
2816
2837
|
let a = e.editorView.value;
|
|
2817
2838
|
if (!a) return "none";
|
|
2818
|
-
let o =
|
|
2839
|
+
let o = or({
|
|
2819
2840
|
blockId: t,
|
|
2820
2841
|
text: n,
|
|
2821
2842
|
doc: a.state.doc,
|
|
@@ -2823,13 +2844,13 @@ function so(e) {
|
|
|
2823
2844
|
});
|
|
2824
2845
|
if (o !== null) return e.setPassageHighlight(o), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(o.from)), "passage";
|
|
2825
2846
|
e.setPassageHighlight(null);
|
|
2826
|
-
let s =
|
|
2847
|
+
let s = ir({
|
|
2827
2848
|
blockId: t,
|
|
2828
2849
|
doc: a.state.doc,
|
|
2829
2850
|
snapshot: r
|
|
2830
2851
|
});
|
|
2831
2852
|
if (s === null) return "none";
|
|
2832
|
-
let c =
|
|
2853
|
+
let c = lr(t);
|
|
2833
2854
|
if (c !== null && i(c, { highlight: {} })) return "block";
|
|
2834
2855
|
let { from: l, to: u } = s, d = a.state.doc.resolve(l), f = a.state.doc.resolve(u);
|
|
2835
2856
|
return a.dispatch(a.state.tr.setSelection(Z.between(d, f))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(l)), "block";
|
|
@@ -2840,11 +2861,11 @@ function so(e) {
|
|
|
2840
2861
|
showInDocument: (t, n) => {
|
|
2841
2862
|
let r = e.editorView.value;
|
|
2842
2863
|
if (!r) return !1;
|
|
2843
|
-
let i = t.type === "textRange" ?
|
|
2864
|
+
let i = t.type === "textRange" ? ar({
|
|
2844
2865
|
range: t,
|
|
2845
2866
|
doc: r.state.doc,
|
|
2846
2867
|
snapshot: n
|
|
2847
|
-
}) :
|
|
2868
|
+
}) : ir({
|
|
2848
2869
|
blockId: t.blockId,
|
|
2849
2870
|
doc: r.state.doc,
|
|
2850
2871
|
snapshot: n
|
|
@@ -2878,7 +2899,7 @@ function so(e) {
|
|
|
2878
2899
|
if (!n) return !1;
|
|
2879
2900
|
let r = gn(n.state, t);
|
|
2880
2901
|
if (!r) return !1;
|
|
2881
|
-
let { from: i, to: a } =
|
|
2902
|
+
let { from: i, to: a } = rr(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2882
2903
|
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2883
2904
|
},
|
|
2884
2905
|
getTrackedChanges: () => {
|
|
@@ -2895,16 +2916,16 @@ function so(e) {
|
|
|
2895
2916
|
},
|
|
2896
2917
|
getPageText: (t) => {
|
|
2897
2918
|
let n = e.editorView.value;
|
|
2898
|
-
return n ?
|
|
2919
|
+
return n ? fr(e.layout.value, n.state.doc, t) : null;
|
|
2899
2920
|
},
|
|
2900
2921
|
getTargetPage: (t, n) => {
|
|
2901
2922
|
let r = e.editorView.value, i = e.layout.value;
|
|
2902
2923
|
if (!r || !i) return null;
|
|
2903
|
-
let a = t.type === "textRange" ?
|
|
2924
|
+
let a = t.type === "textRange" ? ar({
|
|
2904
2925
|
range: t,
|
|
2905
2926
|
doc: r.state.doc,
|
|
2906
2927
|
snapshot: n
|
|
2907
|
-
}) :
|
|
2928
|
+
}) : ir({
|
|
2908
2929
|
blockId: t.blockId,
|
|
2909
2930
|
doc: r.state.doc,
|
|
2910
2931
|
snapshot: n
|
|
@@ -2913,10 +2934,14 @@ function so(e) {
|
|
|
2913
2934
|
let o = bn(i, a.from);
|
|
2914
2935
|
return o == null ? null : o + 1;
|
|
2915
2936
|
},
|
|
2937
|
+
getBlockRect: p,
|
|
2938
|
+
getBlockRects: f,
|
|
2939
|
+
getScrollRoot: () => e.scrollRootRef.value,
|
|
2940
|
+
onLayoutChange: m,
|
|
2916
2941
|
getContentControls: (t = {}) => {
|
|
2917
2942
|
let n = e.editorView.value;
|
|
2918
|
-
return n ?
|
|
2919
|
-
properties:
|
|
2943
|
+
return n ? Qn(n.state.doc, t).map((e) => ({
|
|
2944
|
+
properties: Xn(e.node),
|
|
2920
2945
|
path: e.path,
|
|
2921
2946
|
pmPos: e.pos
|
|
2922
2947
|
})) : [];
|
|
@@ -2924,7 +2949,7 @@ function so(e) {
|
|
|
2924
2949
|
scrollToContentControl: (t) => {
|
|
2925
2950
|
let n = e.editorView.value;
|
|
2926
2951
|
if (!n) return !1;
|
|
2927
|
-
let r =
|
|
2952
|
+
let r = Zn(n.state.doc, t);
|
|
2928
2953
|
if (!r) return !1;
|
|
2929
2954
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
2930
2955
|
return n.dispatch(n.state.tr.setSelection(Z.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
@@ -2932,26 +2957,26 @@ function so(e) {
|
|
|
2932
2957
|
setContentControlContent: (t, n, r = {}) => {
|
|
2933
2958
|
let i = e.editorView.value;
|
|
2934
2959
|
if (!i) return !1;
|
|
2935
|
-
let a = typeof n == "string" ?
|
|
2960
|
+
let a = typeof n == "string" ? er(i.state, t, n, r) : nr(i.state, t, n, r);
|
|
2936
2961
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2937
2962
|
},
|
|
2938
2963
|
setContentControlValue: (t, n, r = {}) => {
|
|
2939
2964
|
let i = e.editorView.value;
|
|
2940
2965
|
if (!i) return !1;
|
|
2941
|
-
let a =
|
|
2966
|
+
let a = tr(i.state, t, n, r);
|
|
2942
2967
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2943
2968
|
},
|
|
2944
2969
|
removeContentControl: (t, n = {}) => {
|
|
2945
2970
|
let r = e.editorView.value;
|
|
2946
2971
|
if (!r) return !1;
|
|
2947
|
-
let i =
|
|
2972
|
+
let i = $n(r.state, t, n);
|
|
2948
2973
|
return i ? (r.dispatch(i), !0) : !1;
|
|
2949
2974
|
}
|
|
2950
2975
|
} };
|
|
2951
2976
|
}
|
|
2952
2977
|
//#endregion
|
|
2953
2978
|
//#region src/composables/useFormattingActions.ts
|
|
2954
|
-
function
|
|
2979
|
+
function uo(e) {
|
|
2955
2980
|
let t = () => e.activeView?.value ?? e.editorView.value;
|
|
2956
2981
|
function n() {
|
|
2957
2982
|
let e = t();
|
|
@@ -2962,22 +2987,24 @@ function co(e) {
|
|
|
2962
2987
|
if (!r) return;
|
|
2963
2988
|
let i = e.getDocument(), a = i?.package?.styles;
|
|
2964
2989
|
if (a) {
|
|
2965
|
-
let e = ze(a).resolveParagraphStyle(n),
|
|
2966
|
-
|
|
2967
|
-
|
|
2990
|
+
let e = ze(a), t = e.resolveParagraphStyle(n), o = { numbering: i?.package?.numbering ? vr(i.package.numbering) : null };
|
|
2991
|
+
t.paragraphFormatting && (o.paragraphFormatting = t.paragraphFormatting), t.runFormatting && (o.runFormatting = t.runFormatting);
|
|
2992
|
+
let s = e.getStyle(n)?.name;
|
|
2993
|
+
s && (o.styleName = s), pr(n, o)(r.state, (e) => r.dispatch(e));
|
|
2994
|
+
} else pr(n)(r.state, (e) => r.dispatch(e));
|
|
2968
2995
|
r.focus();
|
|
2969
2996
|
}
|
|
2970
2997
|
function i() {
|
|
2971
2998
|
let t = e.editorView.value;
|
|
2972
|
-
t && (
|
|
2999
|
+
t && (yr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2973
3000
|
}
|
|
2974
3001
|
function a() {
|
|
2975
3002
|
let t = e.editorView.value;
|
|
2976
|
-
t && (
|
|
3003
|
+
t && (xr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2977
3004
|
}
|
|
2978
3005
|
function o() {
|
|
2979
3006
|
let t = e.editorView.value;
|
|
2980
|
-
t && (
|
|
3007
|
+
t && (br(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2981
3008
|
}
|
|
2982
3009
|
function s(e) {
|
|
2983
3010
|
let n = t();
|
|
@@ -2996,10 +3023,10 @@ function co(e) {
|
|
|
2996
3023
|
}
|
|
2997
3024
|
//#endregion
|
|
2998
3025
|
//#region src/utils/fontFaces.ts
|
|
2999
|
-
function
|
|
3026
|
+
function fo() {
|
|
3000
3027
|
return typeof document > "u" || !("fonts" in document) ? null : document.fonts;
|
|
3001
3028
|
}
|
|
3002
|
-
async function
|
|
3029
|
+
async function po(e, t, n, r) {
|
|
3003
3030
|
let i;
|
|
3004
3031
|
try {
|
|
3005
3032
|
i = new FontFace(t, n, r), e.add(i);
|
|
@@ -3008,46 +3035,46 @@ async function uo(e, t, n, r) {
|
|
|
3008
3035
|
}
|
|
3009
3036
|
return await i.load().then(() => !0, () => !1) ? i : (e.delete(i), null);
|
|
3010
3037
|
}
|
|
3011
|
-
function
|
|
3012
|
-
let t =
|
|
3038
|
+
function mo(e) {
|
|
3039
|
+
let t = fo();
|
|
3013
3040
|
if (t) for (let n of e) t.delete(n);
|
|
3014
3041
|
}
|
|
3015
3042
|
//#endregion
|
|
3016
3043
|
//#region src/utils/embeddedFonts.ts
|
|
3017
|
-
var
|
|
3044
|
+
var ho = {
|
|
3018
3045
|
faces: [],
|
|
3019
3046
|
familyMap: /* @__PURE__ */ new Map()
|
|
3020
3047
|
};
|
|
3021
|
-
async function
|
|
3022
|
-
let t =
|
|
3023
|
-
if (!t) return
|
|
3048
|
+
async function go(e) {
|
|
3049
|
+
let t = fo();
|
|
3050
|
+
if (!t) return ho;
|
|
3024
3051
|
let n;
|
|
3025
3052
|
try {
|
|
3026
|
-
n = await
|
|
3053
|
+
n = await wr(e);
|
|
3027
3054
|
} catch {
|
|
3028
|
-
return
|
|
3055
|
+
return ho;
|
|
3029
3056
|
}
|
|
3030
3057
|
return {
|
|
3031
|
-
faces: (await Promise.all(n.map((e) =>
|
|
3058
|
+
faces: (await Promise.all(n.map((e) => po(t, e.family, e.bytes, {
|
|
3032
3059
|
weight: String(e.weight),
|
|
3033
3060
|
style: e.style
|
|
3034
3061
|
})))).filter((e) => e !== null),
|
|
3035
|
-
familyMap:
|
|
3062
|
+
familyMap: Cr(n)
|
|
3036
3063
|
};
|
|
3037
3064
|
}
|
|
3038
3065
|
//#endregion
|
|
3039
3066
|
//#region src/utils/hostFonts.ts
|
|
3040
|
-
function
|
|
3067
|
+
function _o(e) {
|
|
3041
3068
|
return typeof e == "string" && e.trim().length > 0;
|
|
3042
3069
|
}
|
|
3043
|
-
function
|
|
3044
|
-
return typeof e != "object" || !e ? !1 :
|
|
3070
|
+
function vo(e) {
|
|
3071
|
+
return typeof e != "object" || !e ? !1 : _o(Reflect.get(e, "family")) && _o(Reflect.get(e, "src"));
|
|
3045
3072
|
}
|
|
3046
|
-
function
|
|
3073
|
+
function yo(e) {
|
|
3047
3074
|
if (!e) return [];
|
|
3048
3075
|
let t = [];
|
|
3049
3076
|
for (let n of e) {
|
|
3050
|
-
if (!
|
|
3077
|
+
if (!vo(n)) continue;
|
|
3051
3078
|
let e = { display: "swap" };
|
|
3052
3079
|
(typeof n.weight == "number" || typeof n.weight == "string") && (e.weight = String(n.weight)), t.push({
|
|
3053
3080
|
family: n.family.trim(),
|
|
@@ -3057,20 +3084,20 @@ function _o(e) {
|
|
|
3057
3084
|
}
|
|
3058
3085
|
return t;
|
|
3059
3086
|
}
|
|
3060
|
-
async function
|
|
3061
|
-
let t =
|
|
3087
|
+
async function bo(e) {
|
|
3088
|
+
let t = fo();
|
|
3062
3089
|
if (!t) return [];
|
|
3063
|
-
let n =
|
|
3064
|
-
return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) =>
|
|
3090
|
+
let n = yo(e);
|
|
3091
|
+
return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) => po(t, e, n, r)))).filter((e) => e !== null);
|
|
3065
3092
|
}
|
|
3066
3093
|
//#endregion
|
|
3067
3094
|
//#region src/composables/useFontLifecycle.ts
|
|
3068
|
-
var
|
|
3069
|
-
loadEmbedded:
|
|
3070
|
-
loadHost:
|
|
3071
|
-
remove:
|
|
3095
|
+
var xo = {
|
|
3096
|
+
loadEmbedded: go,
|
|
3097
|
+
loadHost: bo,
|
|
3098
|
+
remove: mo
|
|
3072
3099
|
};
|
|
3073
|
-
function
|
|
3100
|
+
function So(e, t = xo) {
|
|
3074
3101
|
K(() => e.isReady.value ? e.getDocument()?.originalBuffer ?? null : null, (n, r, i) => {
|
|
3075
3102
|
if (!n) return;
|
|
3076
3103
|
let a = !1, o = [];
|
|
@@ -3079,9 +3106,9 @@ function bo(e, t = yo) {
|
|
|
3079
3106
|
t.remove(n);
|
|
3080
3107
|
return;
|
|
3081
3108
|
}
|
|
3082
|
-
o = n, !(n.length === 0 && r.size === 0) && (
|
|
3109
|
+
o = n, !(n.length === 0 && r.size === 0) && (Sr(r.size > 0 ? r : null), e.remeasure());
|
|
3083
3110
|
}), i(() => {
|
|
3084
|
-
a = !0, t.remove(o),
|
|
3111
|
+
a = !0, t.remove(o), Sr(null);
|
|
3085
3112
|
});
|
|
3086
3113
|
}, { immediate: !0 }), K(e.fonts, (n, r, i) => {
|
|
3087
3114
|
if (!n || n.length === 0) return;
|
|
@@ -3099,7 +3126,7 @@ function bo(e, t = yo) {
|
|
|
3099
3126
|
}
|
|
3100
3127
|
//#endregion
|
|
3101
3128
|
//#region src/composables/useHyperlinkManagement.ts
|
|
3102
|
-
function
|
|
3129
|
+
function Co(e) {
|
|
3103
3130
|
let t = H(null);
|
|
3104
3131
|
function n(e, t) {
|
|
3105
3132
|
t(e.state, (t) => e.dispatch(t), e);
|
|
@@ -3126,19 +3153,19 @@ function xo(e) {
|
|
|
3126
3153
|
r && n(t, r()), t.focus();
|
|
3127
3154
|
}
|
|
3128
3155
|
function a(e) {
|
|
3129
|
-
let n =
|
|
3156
|
+
let n = Dr(e);
|
|
3130
3157
|
n && (window.open(n, "_blank", "noopener,noreferrer"), t.value = null);
|
|
3131
3158
|
}
|
|
3132
3159
|
function o(n, r) {
|
|
3133
3160
|
let i = e.editorView.value;
|
|
3134
|
-
i && (
|
|
3161
|
+
i && (Tr(i, {
|
|
3135
3162
|
displayText: n,
|
|
3136
3163
|
href: r
|
|
3137
3164
|
}), t.value = null, i.focus());
|
|
3138
3165
|
}
|
|
3139
3166
|
function s() {
|
|
3140
3167
|
let n = e.editorView.value;
|
|
3141
|
-
n && (
|
|
3168
|
+
n && (Er(n, { popupHref: t.value?.href }), t.value = null, n.focus());
|
|
3142
3169
|
}
|
|
3143
3170
|
return {
|
|
3144
3171
|
hyperlinkPopupData: t,
|
|
@@ -3151,7 +3178,7 @@ function xo(e) {
|
|
|
3151
3178
|
}
|
|
3152
3179
|
//#endregion
|
|
3153
3180
|
//#region src/composables/useImageActions.ts
|
|
3154
|
-
function
|
|
3181
|
+
function wo(e) {
|
|
3155
3182
|
let t = Ne(null), n = H(!1), r = A(() => {
|
|
3156
3183
|
e.stateTick.value;
|
|
3157
3184
|
let n = e.editorView.value, r = t.value;
|
|
@@ -3201,7 +3228,7 @@ function So(e) {
|
|
|
3201
3228
|
}
|
|
3202
3229
|
//#endregion
|
|
3203
3230
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
3204
|
-
function
|
|
3231
|
+
function To(e) {
|
|
3205
3232
|
function t(t) {
|
|
3206
3233
|
if (e.handleZoomKeyDown(t), t.ctrlKey || t.metaKey) {
|
|
3207
3234
|
if (t.key === "o") {
|
|
@@ -3216,10 +3243,10 @@ function Co(e) {
|
|
|
3216
3243
|
}
|
|
3217
3244
|
//#endregion
|
|
3218
3245
|
//#region src/composables/useOutlineSidebar.ts
|
|
3219
|
-
function
|
|
3246
|
+
function Eo(e) {
|
|
3220
3247
|
function t() {
|
|
3221
3248
|
let t = e.editorView.value;
|
|
3222
|
-
t && (e.outlineHeadings.value =
|
|
3249
|
+
t && (e.outlineHeadings.value = Or(t.state.doc));
|
|
3223
3250
|
}
|
|
3224
3251
|
function n() {
|
|
3225
3252
|
e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
|
|
@@ -3250,7 +3277,7 @@ function wo(e) {
|
|
|
3250
3277
|
}
|
|
3251
3278
|
//#endregion
|
|
3252
3279
|
//#region src/composables/usePageSetupControls.ts
|
|
3253
|
-
function
|
|
3280
|
+
function Do(e) {
|
|
3254
3281
|
function t(t) {
|
|
3255
3282
|
if (e.readOnly.value) return;
|
|
3256
3283
|
let n = e.getDocument();
|
|
@@ -3278,19 +3305,19 @@ function To(e) {
|
|
|
3278
3305
|
}
|
|
3279
3306
|
function s(t) {
|
|
3280
3307
|
let n = e.editorView.value;
|
|
3281
|
-
n &&
|
|
3308
|
+
n && gr(t)(n.state, n.dispatch);
|
|
3282
3309
|
}
|
|
3283
3310
|
function c(t) {
|
|
3284
3311
|
let n = e.editorView.value;
|
|
3285
|
-
n &&
|
|
3312
|
+
n && _r(t)(n.state, n.dispatch);
|
|
3286
3313
|
}
|
|
3287
3314
|
function l(t) {
|
|
3288
3315
|
let n = e.editorView.value;
|
|
3289
|
-
n && (t < 0 ?
|
|
3316
|
+
n && (t < 0 ? hr(-t, !0)(n.state, n.dispatch) : hr(t, !1)(n.state, n.dispatch));
|
|
3290
3317
|
}
|
|
3291
3318
|
function u(t) {
|
|
3292
3319
|
let n = e.editorView.value;
|
|
3293
|
-
n &&
|
|
3320
|
+
n && mr(t)(n.state, n.dispatch);
|
|
3294
3321
|
}
|
|
3295
3322
|
return {
|
|
3296
3323
|
handlePageSetupApply: t,
|
|
@@ -3306,34 +3333,34 @@ function To(e) {
|
|
|
3306
3333
|
}
|
|
3307
3334
|
//#endregion
|
|
3308
3335
|
//#region src/utils/textSelection.ts
|
|
3309
|
-
var
|
|
3310
|
-
function
|
|
3311
|
-
return !e || e.length === 0 ? !1 :
|
|
3336
|
+
var Oo = /[\p{L}\p{N}\p{M}_''-]/u, ko = /\s/;
|
|
3337
|
+
function Ao(e) {
|
|
3338
|
+
return !e || e.length === 0 ? !1 : Oo.test(e);
|
|
3312
3339
|
}
|
|
3313
|
-
function
|
|
3314
|
-
return !e || e.length === 0 ? !1 :
|
|
3340
|
+
function jo(e) {
|
|
3341
|
+
return !e || e.length === 0 ? !1 : ko.test(e);
|
|
3315
3342
|
}
|
|
3316
|
-
function
|
|
3343
|
+
function Mo(e, t) {
|
|
3317
3344
|
if (!e || e.length === 0) return [0, 0];
|
|
3318
3345
|
t = Math.max(0, Math.min(t, e.length - 1));
|
|
3319
3346
|
let n = e[t];
|
|
3320
|
-
if (
|
|
3347
|
+
if (jo(n)) {
|
|
3321
3348
|
let n = t, r = t;
|
|
3322
|
-
for (; n > 0 &&
|
|
3323
|
-
for (; r < e.length &&
|
|
3349
|
+
for (; n > 0 && jo(e[n - 1]);) n--;
|
|
3350
|
+
for (; r < e.length && jo(e[r]);) r++;
|
|
3324
3351
|
return [n, r];
|
|
3325
3352
|
}
|
|
3326
|
-
if (
|
|
3353
|
+
if (Ao(n)) {
|
|
3327
3354
|
let n = t, r = t;
|
|
3328
|
-
for (; n > 0 &&
|
|
3329
|
-
for (; r < e.length &&
|
|
3355
|
+
for (; n > 0 && Ao(e[n - 1]);) n--;
|
|
3356
|
+
for (; r < e.length && Ao(e[r]);) r++;
|
|
3330
3357
|
return [n, r];
|
|
3331
3358
|
}
|
|
3332
3359
|
return [t, t + 1];
|
|
3333
3360
|
}
|
|
3334
3361
|
//#endregion
|
|
3335
3362
|
//#region src/utils/domQueries.ts
|
|
3336
|
-
function
|
|
3363
|
+
function No(e, t, n) {
|
|
3337
3364
|
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : Yt(e);
|
|
3338
3365
|
for (let e of r) {
|
|
3339
3366
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
@@ -3341,7 +3368,7 @@ function jo(e, t, n) {
|
|
|
3341
3368
|
}
|
|
3342
3369
|
return null;
|
|
3343
3370
|
}
|
|
3344
|
-
function
|
|
3371
|
+
function Po(e, t, n) {
|
|
3345
3372
|
if (!e || !t) return;
|
|
3346
3373
|
let r = Jt(e, n);
|
|
3347
3374
|
if (!r) for (let t of Yt(e)) {
|
|
@@ -3358,21 +3385,21 @@ function Mo(e, t, n) {
|
|
|
3358
3385
|
behavior: "smooth"
|
|
3359
3386
|
});
|
|
3360
3387
|
}
|
|
3361
|
-
function
|
|
3388
|
+
function Fo(e, t, n, r) {
|
|
3362
3389
|
if (!e || !t) return null;
|
|
3363
3390
|
let i = Vt(e, n, r, 1);
|
|
3364
3391
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
3365
3392
|
}
|
|
3366
|
-
function
|
|
3393
|
+
function Io(e, t, n, r) {
|
|
3367
3394
|
if (!e) return;
|
|
3368
|
-
let i =
|
|
3395
|
+
let i = No(e, t, r);
|
|
3369
3396
|
if (!i) return;
|
|
3370
|
-
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] =
|
|
3397
|
+
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = Mo(a, t - o), l = o + s, u = o + c;
|
|
3371
3398
|
l < u && n(l, u);
|
|
3372
3399
|
}
|
|
3373
|
-
function
|
|
3400
|
+
function Lo(e, t, n, r) {
|
|
3374
3401
|
if (!e) return;
|
|
3375
|
-
let i =
|
|
3402
|
+
let i = No(e, t, r);
|
|
3376
3403
|
if (!i) return;
|
|
3377
3404
|
let a = i.closest(".layout-paragraph");
|
|
3378
3405
|
if (!a) return;
|
|
@@ -3381,13 +3408,13 @@ function Fo(e, t, n, r) {
|
|
|
3381
3408
|
}
|
|
3382
3409
|
//#endregion
|
|
3383
3410
|
//#region src/composables/usePagesPointer.ts
|
|
3384
|
-
var
|
|
3385
|
-
function
|
|
3411
|
+
var Ro = 500;
|
|
3412
|
+
function zo(e) {
|
|
3386
3413
|
let t = H(null), n = null;
|
|
3387
3414
|
function r() {
|
|
3388
3415
|
n !== null && (clearTimeout(n), n = null);
|
|
3389
3416
|
}
|
|
3390
|
-
let i = Ne(null), a = 0, o = null, s = 0, c = !1, l = null, u =
|
|
3417
|
+
let i = Ne(null), a = 0, o = null, s = 0, c = !1, l = null, u = Nr(), d = S({
|
|
3391
3418
|
pagesContainer: e.pagesRef,
|
|
3392
3419
|
onScrollExtendSelection: (e, t) => {
|
|
3393
3420
|
if (!c || l === null) return;
|
|
@@ -3400,7 +3427,7 @@ function Lo(e) {
|
|
|
3400
3427
|
visible: !1
|
|
3401
3428
|
}), p = null;
|
|
3402
3429
|
function m(t, n) {
|
|
3403
|
-
return
|
|
3430
|
+
return Fo(e.pagesRef.value, e.editorView.value, t, n);
|
|
3404
3431
|
}
|
|
3405
3432
|
function h() {
|
|
3406
3433
|
let t = i.value;
|
|
@@ -3413,7 +3440,7 @@ function Lo(e) {
|
|
|
3413
3440
|
function g(t, n) {
|
|
3414
3441
|
let r = i.value, a = e.pagesRef.value, o = h();
|
|
3415
3442
|
if (r?.rId && a && o !== e.editorView.value) {
|
|
3416
|
-
let e =
|
|
3443
|
+
let e = kr(a, r.position, r.rId, t, n);
|
|
3417
3444
|
return e === null || e < 0 ? null : Math.min(e, o?.state.doc.content.size ?? e);
|
|
3418
3445
|
}
|
|
3419
3446
|
return m(t, n);
|
|
@@ -3426,13 +3453,13 @@ function Lo(e) {
|
|
|
3426
3453
|
} catch {}
|
|
3427
3454
|
}
|
|
3428
3455
|
function v(t) {
|
|
3429
|
-
|
|
3456
|
+
Po(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
3430
3457
|
}
|
|
3431
3458
|
function y(t) {
|
|
3432
|
-
|
|
3459
|
+
Io(e.pagesRef.value, t, _, i.value?.position);
|
|
3433
3460
|
}
|
|
3434
3461
|
function b(t) {
|
|
3435
|
-
|
|
3462
|
+
Lo(e.pagesRef.value, t, _, i.value?.position);
|
|
3436
3463
|
}
|
|
3437
3464
|
function x(t) {
|
|
3438
3465
|
let n = e.editorView.value;
|
|
@@ -3461,7 +3488,7 @@ function Lo(e) {
|
|
|
3461
3488
|
if (!o) return;
|
|
3462
3489
|
let s = e.pagesViewportRef.value;
|
|
3463
3490
|
if (!s || !(a.target instanceof HTMLElement) || a.target.closest(".docx-editor-vue__note-editor")) return;
|
|
3464
|
-
let l =
|
|
3491
|
+
let l = Mr({
|
|
3465
3492
|
mouseX: a.clientX,
|
|
3466
3493
|
mouseY: a.clientY,
|
|
3467
3494
|
pagesContainer: o,
|
|
@@ -3471,7 +3498,7 @@ function Lo(e) {
|
|
|
3471
3498
|
if (!l) {
|
|
3472
3499
|
n === null && (n = setTimeout(() => {
|
|
3473
3500
|
t.value = null, n = null;
|
|
3474
|
-
},
|
|
3501
|
+
}, jr));
|
|
3475
3502
|
return;
|
|
3476
3503
|
}
|
|
3477
3504
|
let u = e.zoom.value || 1, d = s.getBoundingClientRect();
|
|
@@ -3522,7 +3549,7 @@ function Lo(e) {
|
|
|
3522
3549
|
if (e.readOnly.value || !(t.target instanceof HTMLElement)) return;
|
|
3523
3550
|
let n = t.target;
|
|
3524
3551
|
if (n.closest(".docx-editor-vue__note-editor")) return;
|
|
3525
|
-
let r =
|
|
3552
|
+
let r = Ar(n);
|
|
3526
3553
|
if (r) {
|
|
3527
3554
|
t.preventDefault(), t.stopPropagation(), i.value && ie(), e.openNoteStory(r);
|
|
3528
3555
|
return;
|
|
@@ -3556,7 +3583,7 @@ function Lo(e) {
|
|
|
3556
3583
|
}, requestAnimationFrame(() => {
|
|
3557
3584
|
let n = e.getHfPmView(h);
|
|
3558
3585
|
if (!n) return;
|
|
3559
|
-
let r =
|
|
3586
|
+
let r = kr(e.pagesRef.value ?? s, c, h, t.clientX, t.clientY);
|
|
3560
3587
|
if (r !== null) {
|
|
3561
3588
|
let e = Math.max(0, Math.min(r, n.state.doc.content.size));
|
|
3562
3589
|
n.dispatch(n.state.tr.setSelection(Z.create(n.state.doc, e)));
|
|
@@ -3645,12 +3672,12 @@ function Lo(e) {
|
|
|
3645
3672
|
return;
|
|
3646
3673
|
}
|
|
3647
3674
|
let v = Date.now();
|
|
3648
|
-
if (v - a <
|
|
3675
|
+
if (v - a < Ro && o === m ? s++ : s = 1, a = v, o = m, s === 2) y(m);
|
|
3649
3676
|
else if (s >= 3) b(m), s = 0;
|
|
3650
3677
|
else if (t.shiftKey) {
|
|
3651
3678
|
let { from: e } = f.state.selection;
|
|
3652
3679
|
_(e, m);
|
|
3653
|
-
} else _(m), l = m, c = !0, u.begin(
|
|
3680
|
+
} else _(m), l = m, c = !0, u.begin(Pr(f, m));
|
|
3654
3681
|
f.focus();
|
|
3655
3682
|
}
|
|
3656
3683
|
function oe(e) {
|
|
@@ -3718,8 +3745,8 @@ function Lo(e) {
|
|
|
3718
3745
|
}
|
|
3719
3746
|
//#endregion
|
|
3720
3747
|
//#region src/composables/useRemoteSelectionSync.ts
|
|
3721
|
-
var
|
|
3722
|
-
let t = new
|
|
3748
|
+
var Bo = (e) => {
|
|
3749
|
+
let t = new Fr(), n = null, r = () => {
|
|
3723
3750
|
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3724
3751
|
let r = e.pagesRef.value;
|
|
3725
3752
|
r && t.clear(r);
|
|
@@ -3742,8 +3769,8 @@ var Ro = (e) => {
|
|
|
3742
3769
|
], i, { flush: "post" }), Ae(() => {
|
|
3743
3770
|
a(), r();
|
|
3744
3771
|
});
|
|
3745
|
-
},
|
|
3746
|
-
let t = new
|
|
3772
|
+
}, Vo = (e) => {
|
|
3773
|
+
let t = new Ir(), n = null, r = () => {
|
|
3747
3774
|
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3748
3775
|
let r = e.pagesRef.value;
|
|
3749
3776
|
r && t.clear(r);
|
|
@@ -3794,22 +3821,22 @@ var Ro = (e) => {
|
|
|
3794
3821
|
clearOverlay: r,
|
|
3795
3822
|
updateSelectionOverlay: i
|
|
3796
3823
|
};
|
|
3797
|
-
},
|
|
3824
|
+
}, Ho = { class: "docx-editor-vue__toolbar-shell" }, Uo = {
|
|
3798
3825
|
key: 0,
|
|
3799
3826
|
class: "docx-editor-vue__error"
|
|
3800
|
-
},
|
|
3827
|
+
}, Wo = {
|
|
3801
3828
|
key: 1,
|
|
3802
3829
|
class: "docx-editor-vue__loading"
|
|
3803
|
-
},
|
|
3830
|
+
}, Go = {
|
|
3804
3831
|
key: 2,
|
|
3805
3832
|
class: "docx-editor-vue__placeholder"
|
|
3806
|
-
},
|
|
3833
|
+
}, Ko = { class: "docx-editor-vue__editor-area" }, qo = {
|
|
3807
3834
|
key: 0,
|
|
3808
3835
|
class: "docx-editor-vue__ruler-h"
|
|
3809
|
-
},
|
|
3836
|
+
}, Jo = {
|
|
3810
3837
|
key: 1,
|
|
3811
3838
|
class: "docx-editor-vue__ruler-v"
|
|
3812
|
-
},
|
|
3839
|
+
}, Yo = {
|
|
3813
3840
|
class: "docx-editor-vue__editor-content-wrapper",
|
|
3814
3841
|
style: {
|
|
3815
3842
|
position: "relative",
|
|
@@ -3817,11 +3844,11 @@ var Ro = (e) => {
|
|
|
3817
3844
|
flexDirection: "column",
|
|
3818
3845
|
minHeight: "100%"
|
|
3819
3846
|
}
|
|
3820
|
-
},
|
|
3847
|
+
}, Xo = {
|
|
3821
3848
|
"data-testid": "selection-overlay",
|
|
3822
3849
|
class: "docx-editor-vue__decoration-origin",
|
|
3823
3850
|
"aria-hidden": "true"
|
|
3824
|
-
},
|
|
3851
|
+
}, Zo = ["aria-label"], Qo = { class: "docx-editor-vue__note-editor-header" }, $o = ["aria-label"], es = ["aria-label"], ts = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
3825
3852
|
__name: "DocxEditor",
|
|
3826
3853
|
props: {
|
|
3827
3854
|
documentBuffer: { default: null },
|
|
@@ -3945,7 +3972,7 @@ var Ro = (e) => {
|
|
|
3945
3972
|
let o = e, s = n;
|
|
3946
3973
|
a(o.components);
|
|
3947
3974
|
let c = de();
|
|
3948
|
-
|
|
3975
|
+
yi(c);
|
|
3949
3976
|
function l(e) {
|
|
3950
3977
|
o.onChange?.(e), s("change", e), s("update:document", e);
|
|
3951
3978
|
}
|
|
@@ -3966,7 +3993,7 @@ var Ro = (e) => {
|
|
|
3966
3993
|
function Ke(e) {
|
|
3967
3994
|
o.enableWheelZoom !== !1 && Ve(e);
|
|
3968
3995
|
}
|
|
3969
|
-
|
|
3996
|
+
To({
|
|
3970
3997
|
showFindReplace: he,
|
|
3971
3998
|
showHyperlink: ge,
|
|
3972
3999
|
handleZoomKeyDown: He
|
|
@@ -4024,18 +4051,18 @@ var Ro = (e) => {
|
|
|
4024
4051
|
function jt() {
|
|
4025
4052
|
J.value && (nt(), tt(), Ot());
|
|
4026
4053
|
}
|
|
4027
|
-
|
|
4054
|
+
So({
|
|
4028
4055
|
isReady: dt,
|
|
4029
4056
|
getDocument: Y,
|
|
4030
4057
|
fonts: () => o.fonts,
|
|
4031
4058
|
remeasure: jt
|
|
4032
4059
|
});
|
|
4033
|
-
let { selectedImage: Z, imageInteracting: Mt, imageToolbarContext: Nt, handleToolbarImageWrap: Pt, handleImageTransform: Ft } =
|
|
4060
|
+
let { selectedImage: Z, imageInteracting: Mt, imageToolbarContext: Nt, handleToolbarImageWrap: Pt, handleImageTransform: Ft } = wo({
|
|
4034
4061
|
editorView: X,
|
|
4035
4062
|
zoom: L,
|
|
4036
4063
|
stateTick: T,
|
|
4037
4064
|
getCommands: Dt
|
|
4038
|
-
}), It =
|
|
4065
|
+
}), It = Vo({
|
|
4039
4066
|
editorView: J,
|
|
4040
4067
|
hiddenContainer: S,
|
|
4041
4068
|
pagesRef: w,
|
|
@@ -4044,16 +4071,16 @@ var Ro = (e) => {
|
|
|
4044
4071
|
syncCoordinator: _t,
|
|
4045
4072
|
imageInteracting: Mt
|
|
4046
4073
|
});
|
|
4047
|
-
|
|
4074
|
+
Bo({
|
|
4048
4075
|
pagesRef: w,
|
|
4049
4076
|
remoteSelections: st,
|
|
4050
4077
|
syncCoordinator: _t,
|
|
4051
4078
|
zoom: L
|
|
4052
4079
|
});
|
|
4053
|
-
let { hyperlinkPopupData: Lt, handleHyperlinkSubmit: Rt, handleHyperlinkRemove: Vt, handleHyperlinkPopupNavigate: Ht, handleHyperlinkPopupEdit: Ut, handleHyperlinkPopupRemove: Wt } =
|
|
4080
|
+
let { hyperlinkPopupData: Lt, handleHyperlinkSubmit: Rt, handleHyperlinkRemove: Vt, handleHyperlinkPopupNavigate: Ht, handleHyperlinkPopupEdit: Ut, handleHyperlinkPopupRemove: Wt } = Co({
|
|
4054
4081
|
editorView: X,
|
|
4055
4082
|
getCommands: Dt
|
|
4056
|
-
}), Gt = oe(), { tableInsertButton: Kt, hfEdit: qt, scrollPageInfo: Jt, resolvePos: Yt, setPmSelection: Xt, scrollVisiblePositionIntoView: Zt, handlePagesMouseDown: Qt, handlePagesMouseMove: $t, handlePagesClick: en, handlePagesDoubleClick: tn, handleTableInsertClick: nn, handleHfSave: rn, handleHfRemove: an } =
|
|
4083
|
+
}), Gt = oe(), { tableInsertButton: Kt, hfEdit: qt, scrollPageInfo: Jt, resolvePos: Yt, setPmSelection: Xt, scrollVisiblePositionIntoView: Zt, handlePagesMouseDown: Qt, handlePagesMouseMove: $t, handlePagesClick: en, handlePagesDoubleClick: tn, handleTableInsertClick: nn, handleHfSave: rn, handleHfRemove: an } = zo({
|
|
4057
4084
|
editorView: J,
|
|
4058
4085
|
pagesRef: w,
|
|
4059
4086
|
pagesViewportRef: le,
|
|
@@ -4091,7 +4118,7 @@ var Ro = (e) => {
|
|
|
4091
4118
|
K(qt, (e) => {
|
|
4092
4119
|
Se.value = e?.rId ?? null, e && It.clearOverlay();
|
|
4093
4120
|
}, { immediate: !0 });
|
|
4094
|
-
let cn =
|
|
4121
|
+
let cn = Eo({
|
|
4095
4122
|
editorView: J,
|
|
4096
4123
|
showOutline: xe,
|
|
4097
4124
|
showSidebar: D,
|
|
@@ -4099,7 +4126,7 @@ var Ro = (e) => {
|
|
|
4099
4126
|
activeSidebarItem: k,
|
|
4100
4127
|
extractCommentsAndChanges: () => {},
|
|
4101
4128
|
scrollToVisiblePosition: Zt
|
|
4102
|
-
}), { contextMenu: ln, imageContextMenu: un, imageContextMenuTextActions: dn, customTextMenuItems: fn, handleContextMenu: pn, handleSelectedImageContextMenu: mn, handleImageWrapSelect: hn, handleContextMenuAction: gn } =
|
|
4129
|
+
}), { contextMenu: ln, imageContextMenu: un, imageContextMenuTextActions: dn, customTextMenuItems: fn, handleContextMenu: pn, handleSelectedImageContextMenu: mn, handleImageWrapSelect: hn, handleContextMenuAction: gn } = oo({
|
|
4103
4130
|
editorView: X,
|
|
4104
4131
|
selectedImage: Z,
|
|
4105
4132
|
zoom: L,
|
|
@@ -4113,7 +4140,7 @@ var Ro = (e) => {
|
|
|
4113
4140
|
onCopy: () => o.onCopy?.(),
|
|
4114
4141
|
onCut: () => o.onCut?.(),
|
|
4115
4142
|
onPaste: () => o.onPaste?.()
|
|
4116
|
-
}), _n = ce(J, T), vn = A(() => _n.value.entries), Q =
|
|
4143
|
+
}), _n = ce(J, T), vn = A(() => _n.value.entries), Q = Ja({
|
|
4117
4144
|
editorView: J,
|
|
4118
4145
|
getDocument: Y,
|
|
4119
4146
|
author: () => o.author,
|
|
@@ -4122,7 +4149,7 @@ var Ro = (e) => {
|
|
|
4122
4149
|
o.onCommentsChange?.(e), s("comments-change", e);
|
|
4123
4150
|
},
|
|
4124
4151
|
reLayout: Ot
|
|
4125
|
-
}), yn = Q.comments, $ =
|
|
4152
|
+
}), yn = Q.comments, $ = qa({
|
|
4126
4153
|
editorView: J,
|
|
4127
4154
|
pagesViewport: le,
|
|
4128
4155
|
pagesContainer: w,
|
|
@@ -4166,7 +4193,7 @@ var Ro = (e) => {
|
|
|
4166
4193
|
transform: L.value === 1 ? void 0 : `scale(${L.value})`,
|
|
4167
4194
|
transformOrigin: "top center",
|
|
4168
4195
|
transition: "transform 0.2s ease"
|
|
4169
|
-
})), { handleApplyStyle: On, handleInsertSymbol: kn, handleInsertSectionBreakNextPage: An, handleInsertSectionBreakContinuous: jn } =
|
|
4196
|
+
})), { handleApplyStyle: On, handleInsertSymbol: kn, handleInsertSectionBreakNextPage: An, handleInsertSectionBreakContinuous: jn } = uo({
|
|
4170
4197
|
editorView: X,
|
|
4171
4198
|
getDocument: Y
|
|
4172
4199
|
});
|
|
@@ -4207,7 +4234,7 @@ var Ro = (e) => {
|
|
|
4207
4234
|
let e = J.value;
|
|
4208
4235
|
e && (Ye(e), e.focus());
|
|
4209
4236
|
}
|
|
4210
|
-
let { handlePageSetupApply: In, handleLeftMarginChange: Ln, handleRightMarginChange: Rn, handleTopMarginChange: zn, handleBottomMarginChange: Bn, handleIndentLeftChange: Vn, handleIndentRightChange: Hn, handleFirstLineIndentChange: Un, handleTabStopRemove: Wn } =
|
|
4237
|
+
let { handlePageSetupApply: In, handleLeftMarginChange: Ln, handleRightMarginChange: Rn, handleTopMarginChange: zn, handleBottomMarginChange: Bn, handleIndentLeftChange: Vn, handleIndentRightChange: Hn, handleFirstLineIndentChange: Un, handleTabStopRemove: Wn } = Do({
|
|
4211
4238
|
editorView: J,
|
|
4212
4239
|
getDocument: Y,
|
|
4213
4240
|
readOnly: d,
|
|
@@ -4286,7 +4313,7 @@ var Ro = (e) => {
|
|
|
4286
4313
|
!t || !n || (n(e)(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
4287
4314
|
}
|
|
4288
4315
|
let Zn = H(!1);
|
|
4289
|
-
|
|
4316
|
+
so({
|
|
4290
4317
|
documentBuffer: () => o.documentBuffer ?? null,
|
|
4291
4318
|
document: () => o.document ?? null,
|
|
4292
4319
|
loadDocumentBuffer: vt,
|
|
@@ -4330,7 +4357,7 @@ var Ro = (e) => {
|
|
|
4330
4357
|
e(), t(), n(), r(), i();
|
|
4331
4358
|
});
|
|
4332
4359
|
});
|
|
4333
|
-
let { exposed: tr } =
|
|
4360
|
+
let { exposed: tr } = lo({
|
|
4334
4361
|
editor: Je,
|
|
4335
4362
|
editorView: J,
|
|
4336
4363
|
isDirty: ft,
|
|
@@ -4339,6 +4366,7 @@ var Ro = (e) => {
|
|
|
4339
4366
|
layout: mt,
|
|
4340
4367
|
pagesRef: w,
|
|
4341
4368
|
pagesViewportRef: le,
|
|
4369
|
+
scrollRootRef: fe,
|
|
4342
4370
|
zoom: L,
|
|
4343
4371
|
scrollVisiblePositionIntoView: Zt,
|
|
4344
4372
|
setPassageHighlight: (e) => {
|
|
@@ -4375,7 +4403,7 @@ var Ro = (e) => {
|
|
|
4375
4403
|
]),
|
|
4376
4404
|
style: z(e.style)
|
|
4377
4405
|
}, [
|
|
4378
|
-
P("div",
|
|
4406
|
+
P("div", Ho, [F(Fi, {
|
|
4379
4407
|
"show-table-insert": o.showTableInsert !== !1,
|
|
4380
4408
|
onRename: n[0] ||= (e) => s("rename", e),
|
|
4381
4409
|
onMenuAction: qn,
|
|
@@ -4466,7 +4494,7 @@ var Ro = (e) => {
|
|
|
4466
4494
|
"onImageWrapType",
|
|
4467
4495
|
"onImageTransform"
|
|
4468
4496
|
])) : M("", !0)]),
|
|
4469
|
-
F(
|
|
4497
|
+
F(Ai, {
|
|
4470
4498
|
"show-find-replace": he.value,
|
|
4471
4499
|
"onUpdate:showFindReplace": n[8] ||= (e) => he.value = e,
|
|
4472
4500
|
"show-hyperlink": ge.value,
|
|
@@ -4514,10 +4542,10 @@ var Ro = (e) => {
|
|
|
4514
4542
|
"onHyperlinkRemove",
|
|
4515
4543
|
"onPageSetupApply"
|
|
4516
4544
|
]),
|
|
4517
|
-
G(pt) ? (V(), N("div",
|
|
4545
|
+
G(pt) ? (V(), N("div", Uo, W(G(pt)), 1)) : At.value ? (V(), N("div", Wo, [Me(t.$slots, "loading-indicator", {}, () => [e.loadingIndicator ? (V(), j(te, {
|
|
4518
4546
|
key: 0,
|
|
4519
4547
|
node: e.loadingIndicator
|
|
4520
|
-
}, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te(W(G(ee)("loadingDocument")), 1)], 64))], !0)])) : !G(dt) && !re.value ? (V(), N("div",
|
|
4548
|
+
}, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te(W(G(ee)("loadingDocument")), 1)], 64))], !0)])) : !G(dt) && !re.value ? (V(), N("div", Go, [Me(t.$slots, "placeholder", {}, () => [e.placeholder ? (V(), j(te, {
|
|
4521
4549
|
key: 0,
|
|
4522
4550
|
node: e.placeholder
|
|
4523
4551
|
}, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [Te("No document loaded")], 64))], !0)])) : M("", !0),
|
|
@@ -4536,8 +4564,8 @@ var Ro = (e) => {
|
|
|
4536
4564
|
ref: fe,
|
|
4537
4565
|
class: "docx-editor-vue__editor-scroll",
|
|
4538
4566
|
onScroll: $n
|
|
4539
|
-
}, [P("div",
|
|
4540
|
-
me.value && !d.value ? (V(), N("div",
|
|
4567
|
+
}, [P("div", Ko, [
|
|
4568
|
+
me.value && !d.value ? (V(), N("div", qo, [F(ne, {
|
|
4541
4569
|
"section-props": xn.value,
|
|
4542
4570
|
zoom: G(L),
|
|
4543
4571
|
unit: e.rulerUnit ?? "inch",
|
|
@@ -4571,7 +4599,7 @@ var Ro = (e) => {
|
|
|
4571
4599
|
"onFirstLineIndentChange",
|
|
4572
4600
|
"onTabStopRemove"
|
|
4573
4601
|
])])) : M("", !0),
|
|
4574
|
-
me.value && !d.value ? (V(), N("div",
|
|
4602
|
+
me.value && !d.value ? (V(), N("div", Jo, [F(v, {
|
|
4575
4603
|
"section-props": xn.value,
|
|
4576
4604
|
zoom: G(L),
|
|
4577
4605
|
unit: e.rulerUnit ?? "inch",
|
|
@@ -4597,14 +4625,14 @@ var Ro = (e) => {
|
|
|
4597
4625
|
onDblclick: n[28] ||= (...e) => G(tn) && G(tn)(...e),
|
|
4598
4626
|
onContextmenu: n[29] ||= q((...e) => G(pn) && G(pn)(...e), ["prevent"])
|
|
4599
4627
|
}, [
|
|
4600
|
-
P("div",
|
|
4628
|
+
P("div", Yo, [
|
|
4601
4629
|
P("div", {
|
|
4602
4630
|
ref_key: "pagesRef",
|
|
4603
4631
|
ref: w,
|
|
4604
4632
|
class: R(["docx-editor-vue__pages paged-editor__pages", G(qt) ? `paged-editor--hf-editing paged-editor--editing-${G(qt).position}` : ""]),
|
|
4605
4633
|
style: z(Dn.value)
|
|
4606
4634
|
}, null, 6),
|
|
4607
|
-
F(
|
|
4635
|
+
F(_a, {
|
|
4608
4636
|
"editor-view": on(),
|
|
4609
4637
|
"hidden-container": C.value,
|
|
4610
4638
|
"pages-container": w.value,
|
|
@@ -4617,8 +4645,8 @@ var Ro = (e) => {
|
|
|
4617
4645
|
"selection",
|
|
4618
4646
|
"zoom"
|
|
4619
4647
|
]),
|
|
4620
|
-
P("div",
|
|
4621
|
-
F(
|
|
4648
|
+
P("div", Xo, [
|
|
4649
|
+
F(di, {
|
|
4622
4650
|
"get-view": () => G(J),
|
|
4623
4651
|
"get-pages-container": () => w.value,
|
|
4624
4652
|
"editor-state": G(at),
|
|
@@ -4641,7 +4669,7 @@ var Ro = (e) => {
|
|
|
4641
4669
|
"selected-canonical",
|
|
4642
4670
|
"selection-seq"
|
|
4643
4671
|
]),
|
|
4644
|
-
F(
|
|
4672
|
+
F(pi, {
|
|
4645
4673
|
range: pe.value,
|
|
4646
4674
|
"get-pages-container": () => w.value,
|
|
4647
4675
|
zoom: G(L),
|
|
@@ -4656,7 +4684,7 @@ var Ro = (e) => {
|
|
|
4656
4684
|
"blocks",
|
|
4657
4685
|
"measures"
|
|
4658
4686
|
]),
|
|
4659
|
-
o.showTemplateDirectives ? (V(), j(
|
|
4687
|
+
o.showTemplateDirectives ? (V(), j(Aa, {
|
|
4660
4688
|
key: 0,
|
|
4661
4689
|
"get-view": () => G(J),
|
|
4662
4690
|
"get-pages-container": () => w.value,
|
|
@@ -4674,7 +4702,7 @@ var Ro = (e) => {
|
|
|
4674
4702
|
"blocks",
|
|
4675
4703
|
"measures"
|
|
4676
4704
|
])) : M("", !0),
|
|
4677
|
-
F(
|
|
4705
|
+
F(_i, {
|
|
4678
4706
|
"get-pages-container": () => w.value,
|
|
4679
4707
|
"editor-state": G(at),
|
|
4680
4708
|
zoom: G(L),
|
|
@@ -4685,7 +4713,7 @@ var Ro = (e) => {
|
|
|
4685
4713
|
"zoom",
|
|
4686
4714
|
"sync-coordinator"
|
|
4687
4715
|
]),
|
|
4688
|
-
F(
|
|
4716
|
+
F(Ti, {
|
|
4689
4717
|
"get-view": () => G(J),
|
|
4690
4718
|
"get-pages-container": () => w.value,
|
|
4691
4719
|
zoom: G(L),
|
|
@@ -4700,7 +4728,7 @@ var Ro = (e) => {
|
|
|
4700
4728
|
])
|
|
4701
4729
|
])
|
|
4702
4730
|
]),
|
|
4703
|
-
G(qt) ? (V(), j(
|
|
4731
|
+
G(qt) ? (V(), j(ya, {
|
|
4704
4732
|
key: 0,
|
|
4705
4733
|
edit: G(qt),
|
|
4706
4734
|
"get-view": on,
|
|
@@ -4715,16 +4743,16 @@ var Ro = (e) => {
|
|
|
4715
4743
|
class: "docx-editor-vue__note-editor",
|
|
4716
4744
|
"aria-label": kt.value,
|
|
4717
4745
|
onKeydown: n[16] ||= Re(q((...e) => G(Tt) && G(Tt)(...e), ["stop", "prevent"]), ["esc"])
|
|
4718
|
-
}, [P("header",
|
|
4746
|
+
}, [P("header", Qo, [P("span", null, W(kt.value), 1), P("button", {
|
|
4719
4747
|
type: "button",
|
|
4720
4748
|
"aria-label": G(ee)("common.closeDialog"),
|
|
4721
4749
|
onClick: n[15] ||= (...e) => G(Tt) && G(Tt)(...e)
|
|
4722
|
-
}, " × ", 8,
|
|
4750
|
+
}, " × ", 8, $o)]), P("div", {
|
|
4723
4751
|
ref_key: "notePmRef",
|
|
4724
4752
|
ref: we,
|
|
4725
4753
|
class: "docx-editor-vue__note-editor-host"
|
|
4726
|
-
}, null, 512)], 40,
|
|
4727
|
-
F(
|
|
4754
|
+
}, null, 512)], 40, Zo), [[Fe, G(ut)]]),
|
|
4755
|
+
F(ga, {
|
|
4728
4756
|
"image-info": G(Z),
|
|
4729
4757
|
zoom: G(L),
|
|
4730
4758
|
view: X.value,
|
|
@@ -4738,7 +4766,7 @@ var Ro = (e) => {
|
|
|
4738
4766
|
"view",
|
|
4739
4767
|
"onContextMenu"
|
|
4740
4768
|
]),
|
|
4741
|
-
F(
|
|
4769
|
+
F(Ba, {
|
|
4742
4770
|
data: G(Lt),
|
|
4743
4771
|
"read-only": d.value,
|
|
4744
4772
|
onNavigate: G(Ht),
|
|
@@ -4763,7 +4791,7 @@ var Ro = (e) => {
|
|
|
4763
4791
|
}),
|
|
4764
4792
|
"aria-label": G(Kt).type === "row" ? "Insert row" : "Insert column",
|
|
4765
4793
|
onMousedown: n[21] ||= (...e) => G(nn) && G(nn)(...e)
|
|
4766
|
-
}, " + ", 44,
|
|
4794
|
+
}, " + ", 44, es)) : M("", !0),
|
|
4767
4795
|
F(g, {
|
|
4768
4796
|
comments: G(yn),
|
|
4769
4797
|
"pages-container": w.value,
|
|
@@ -4842,12 +4870,12 @@ var Ro = (e) => {
|
|
|
4842
4870
|
size: 18
|
|
4843
4871
|
})], 36)) : M("", !0)
|
|
4844
4872
|
], 544),
|
|
4845
|
-
xe.value ? M("", !0) : (V(), j(
|
|
4873
|
+
xe.value ? M("", !0) : (V(), j(xa, {
|
|
4846
4874
|
key: 2,
|
|
4847
4875
|
"left-offset": 12,
|
|
4848
4876
|
onToggle: G(cn).handleToggleOutline
|
|
4849
4877
|
}, null, 8, ["onToggle"])),
|
|
4850
|
-
G(Jt).totalPages > 1 ? (V(), j(
|
|
4878
|
+
G(Jt).totalPages > 1 ? (V(), j(Sa, {
|
|
4851
4879
|
key: 3,
|
|
4852
4880
|
"current-page": G(Jt).currentPage,
|
|
4853
4881
|
"total-pages": G(Jt).totalPages,
|
|
@@ -4857,7 +4885,7 @@ var Ro = (e) => {
|
|
|
4857
4885
|
"total-pages",
|
|
4858
4886
|
"visible"
|
|
4859
4887
|
])) : M("", !0),
|
|
4860
|
-
F(
|
|
4888
|
+
F(ki, {
|
|
4861
4889
|
"is-open": xe.value,
|
|
4862
4890
|
headings: Ee.value,
|
|
4863
4891
|
"get-scroll-container": () => w.value,
|
|
@@ -4870,7 +4898,7 @@ var Ro = (e) => {
|
|
|
4870
4898
|
"onNavigate"
|
|
4871
4899
|
])
|
|
4872
4900
|
])], 544),
|
|
4873
|
-
F(
|
|
4901
|
+
F(oa, {
|
|
4874
4902
|
"read-only": d.value,
|
|
4875
4903
|
"context-menu": G(ln),
|
|
4876
4904
|
"image-context-menu": G(un),
|
|
@@ -4892,16 +4920,16 @@ var Ro = (e) => {
|
|
|
4892
4920
|
"onContextMenuAction",
|
|
4893
4921
|
"onImageWrapSelect"
|
|
4894
4922
|
]),
|
|
4895
|
-
F(
|
|
4923
|
+
F(wi, {
|
|
4896
4924
|
"event-root": d.value ? null : w.value,
|
|
4897
4925
|
view: G(J)
|
|
4898
4926
|
}, null, 8, ["event-root", "view"])
|
|
4899
4927
|
], 6));
|
|
4900
4928
|
}
|
|
4901
|
-
}), [["__scopeId", "data-v-
|
|
4929
|
+
}), [["__scopeId", "data-v-f9e968f0"]]);
|
|
4902
4930
|
//#endregion
|
|
4903
4931
|
//#region src/utils/listState.ts
|
|
4904
|
-
function
|
|
4932
|
+
function ns() {
|
|
4905
4933
|
return {
|
|
4906
4934
|
type: "none",
|
|
4907
4935
|
level: 0,
|
|
@@ -4910,30 +4938,30 @@ function es() {
|
|
|
4910
4938
|
}
|
|
4911
4939
|
//#endregion
|
|
4912
4940
|
//#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
|
|
4913
|
-
var
|
|
4941
|
+
var rs = ["aria-label"], is = ["aria-label"], as = [
|
|
4914
4942
|
"disabled",
|
|
4915
4943
|
"title",
|
|
4916
4944
|
"aria-label"
|
|
4917
|
-
],
|
|
4945
|
+
], os = [
|
|
4918
4946
|
"disabled",
|
|
4919
4947
|
"title",
|
|
4920
4948
|
"aria-label"
|
|
4921
|
-
],
|
|
4949
|
+
], ss = ["aria-label"], cs = [
|
|
4922
4950
|
"disabled",
|
|
4923
4951
|
"title",
|
|
4924
4952
|
"aria-label",
|
|
4925
4953
|
"aria-pressed"
|
|
4926
|
-
],
|
|
4954
|
+
], ls = [
|
|
4927
4955
|
"disabled",
|
|
4928
4956
|
"title",
|
|
4929
4957
|
"aria-label",
|
|
4930
4958
|
"aria-pressed"
|
|
4931
|
-
],
|
|
4959
|
+
], us = [
|
|
4932
4960
|
"disabled",
|
|
4933
4961
|
"title",
|
|
4934
4962
|
"aria-label",
|
|
4935
4963
|
"aria-pressed"
|
|
4936
|
-
],
|
|
4964
|
+
], ds = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
4937
4965
|
__name: "FormattingBar",
|
|
4938
4966
|
props: {
|
|
4939
4967
|
currentFormatting: {},
|
|
@@ -4975,7 +5003,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
4975
5003
|
"redo"
|
|
4976
5004
|
],
|
|
4977
5005
|
setup(e, { emit: t }) {
|
|
4978
|
-
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 ??
|
|
5006
|
+
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 ?? ns()), d = A(() => {
|
|
4979
5007
|
let e = c.value.color;
|
|
4980
5008
|
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
4981
5009
|
}), f = A(() => {
|
|
@@ -5008,7 +5036,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5008
5036
|
}, [F(i, {
|
|
5009
5037
|
name: "undo",
|
|
5010
5038
|
size: 18
|
|
5011
|
-
})], 40,
|
|
5039
|
+
})], 40, as), P("button", {
|
|
5012
5040
|
type: "button",
|
|
5013
5041
|
class: "docx-formatting-bar__btn",
|
|
5014
5042
|
disabled: e.disabled || !e.canRedo,
|
|
@@ -5018,7 +5046,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5018
5046
|
}, [F(i, {
|
|
5019
5047
|
name: "redo",
|
|
5020
5048
|
size: 18
|
|
5021
|
-
})], 40,
|
|
5049
|
+
})], 40, os)], 8, is),
|
|
5022
5050
|
r[13] ||= P("span", {
|
|
5023
5051
|
class: "docx-formatting-bar__divider",
|
|
5024
5052
|
role: "separator"
|
|
@@ -5049,7 +5077,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5049
5077
|
}, [F(i, {
|
|
5050
5078
|
name: "format_bold",
|
|
5051
5079
|
size: 18
|
|
5052
|
-
})], 42,
|
|
5080
|
+
})], 42, cs),
|
|
5053
5081
|
P("button", {
|
|
5054
5082
|
type: "button",
|
|
5055
5083
|
class: R(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.italic }]),
|
|
@@ -5061,7 +5089,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5061
5089
|
}, [F(i, {
|
|
5062
5090
|
name: "format_italic",
|
|
5063
5091
|
size: 18
|
|
5064
|
-
})], 42,
|
|
5092
|
+
})], 42, ls),
|
|
5065
5093
|
P("button", {
|
|
5066
5094
|
type: "button",
|
|
5067
5095
|
class: R(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.underline }]),
|
|
@@ -5073,8 +5101,8 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5073
5101
|
}, [F(i, {
|
|
5074
5102
|
name: "format_underlined",
|
|
5075
5103
|
size: 18
|
|
5076
|
-
})], 42,
|
|
5077
|
-
], 8,
|
|
5104
|
+
})], 42, us)
|
|
5105
|
+
], 8, ss),
|
|
5078
5106
|
e.showTextColorPicker ? (V(), N(O, { key: 1 }, [r[12] ||= P("span", {
|
|
5079
5107
|
class: "docx-formatting-bar__divider",
|
|
5080
5108
|
role: "separator"
|
|
@@ -5116,9 +5144,9 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5116
5144
|
"disabled",
|
|
5117
5145
|
"can-outdent"
|
|
5118
5146
|
])) : M("", !0)
|
|
5119
|
-
], 10,
|
|
5147
|
+
], 10, rs));
|
|
5120
5148
|
}
|
|
5121
|
-
}), [["__scopeId", "data-v-fc03de2e"]]),
|
|
5149
|
+
}), [["__scopeId", "data-v-fc03de2e"]]), fs = [
|
|
5122
5150
|
{
|
|
5123
5151
|
value: .5,
|
|
5124
5152
|
label: "50%"
|
|
@@ -5143,7 +5171,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5143
5171
|
value: 2,
|
|
5144
5172
|
label: "200%"
|
|
5145
5173
|
}
|
|
5146
|
-
],
|
|
5174
|
+
], ps = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
5147
5175
|
__name: "ZoomControl",
|
|
5148
5176
|
props: {
|
|
5149
5177
|
value: { default: 1 },
|
|
@@ -5160,7 +5188,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5160
5188
|
},
|
|
5161
5189
|
emits: ["change"],
|
|
5162
5190
|
setup(e, { emit: t }) {
|
|
5163
|
-
let { Select: n } = h(), r = e, i = t, a = A(() => r.levels ??
|
|
5191
|
+
let { Select: n } = h(), r = e, i = t, a = A(() => r.levels ?? fs), 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(() => {
|
|
5164
5192
|
let e = a.value.map((e) => ({
|
|
5165
5193
|
value: String(e.value),
|
|
5166
5194
|
label: e.label
|
|
@@ -5188,7 +5216,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5188
5216
|
"disabled"
|
|
5189
5217
|
]));
|
|
5190
5218
|
}
|
|
5191
|
-
}), [["__scopeId", "data-v-8079e07f"]]),
|
|
5219
|
+
}), [["__scopeId", "data-v-8079e07f"]]), ms = (e, t, n = {}) => {
|
|
5192
5220
|
let { colorMode: r = C, locale: i = "en", ...a } = n;
|
|
5193
5221
|
return new Promise((n, o) => {
|
|
5194
5222
|
let s = H(null), c = null, l = !1, d = {
|
|
@@ -5214,7 +5242,7 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5214
5242
|
}
|
|
5215
5243
|
};
|
|
5216
5244
|
c = Se({ setup() {
|
|
5217
|
-
return () => Ee(
|
|
5245
|
+
return () => Ee(ts, {
|
|
5218
5246
|
...a,
|
|
5219
5247
|
documentBuffer: e,
|
|
5220
5248
|
ref: s,
|
|
@@ -5229,4 +5257,4 @@ var ts = ["aria-label"], ns = ["aria-label"], rs = [
|
|
|
5229
5257
|
});
|
|
5230
5258
|
};
|
|
5231
5259
|
//#endregion
|
|
5232
|
-
export {
|
|
5260
|
+
export { hi as AutocompleteCaretOverlay, Jr as DEFAULT_AI_SUGGESTION_PRESETS, vt as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Gr as DOCUMENT_PRESET_VERSION, Kr as DOCUMENT_STYLE_SET_VERSION, ts as DocxEditor, fe as FindReplaceDialog, l as FolioUIProvider, pe as FootnotePropertiesDialog, ds as FormattingBar, me as HyperlinkDialog, T as ImagePositionDialog, he as ImagePropertiesDialog, ge as InsertImageDialog, E as InsertSymbolDialog, _e as InsertTableDialog, ve as PageSetupDialog, ye as PasteSpecialDialog, Hr as STELLA_STYLE_SET_NAME, be as SplitCellDialog, xe as TablePropertiesDialog, D as WatermarkDialog, ps as ZoomControl, yt as acceptAutocompleteSuggestion, bt as acceptAutocompleteWord, pt as anonymizationDecorationsKey, Y as appendAutocompleteToken, Pn as applyFolioAIEditOperations, Yr as applySuggestions, xt as autocompleteSuggestionKey, St as autocompleteSuggestionPlugin, Qr as buildPositionalText, Ct as clearAutocompleteSuggestion, Cn as clearTemplateSlashMenu, le as colorModePlugin, wn as consumeTemplateSlashQuery, ii as createAICitationDecorationsPlugin, qr as createDocx, Lr as createEmptyDocument, Rn as createFolioAIEditSnapshot, Ur as createStellaStyleDocumentPreset, Wr as createStellaStyleSet, C as defaultColorMode, e as defaultLocale, sr as deriveBlockId, Bn as diffWordSegments, Rr as extractDocumentStyleSet, zr as extractDocumentStyleSetFromDocx, wt as finishAutocompleteSuggestion, si as fromMarkdown, mt as getAnonymizationMatches, Tt as getAutocompleteSuggestion, at as getDocumentWatermark, ni as getFolioCaretViewportRect, cr as getFolioParaIdFromBlockId, ri as getFolioSelectionViewportRect, en as getTemplateDirectives, Tn as getTemplateSlashMenu, Wn as hashFolioAIBlockText, u as i18nPlugin, He as insertImageFromFile, We as insertPageBreakInView, Ke as insertTableInView, Je as insertTableOfContentsInView, Br as inspectDocumentStyles, Vr as inspectDocumentStylesFromDocx, ur as isFolioBlockId, dr as isSequentialFolioBlockId, Xr as isSuggestionStale, Gn as normalizeFolioAIBlockText, w as provideColorMode, n as provideLocale, ms as renderAsync, En as resetTemplateSlashQuery, Zr as resolveSuggestionAnchor, nn as scanDirectives, ti as scrollFolioPositionIntoView, ai as setAICitationsMeta, $r as setAISuggestionsMeta, oi as setActiveCitationMeta, gt as setAnonymizationTermsMeta, st as setDocumentWatermark, ei as setFocusedSuggestionMeta, Sn as setTemplatePreviewValues, Dt as shouldTriggerAutocomplete, Ot as startAutocompleteSuggestion, Dn as templateSlashMenuKey, ci as toMarkdown, li as toMarkdownResult, de as useColorMode, r as useTranslation, ue as useWheelZoom };
|