@stll/folio-vue 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { A as e, F as t, O as n, P as r, _ as i, d as a, f as o, g as s, j as c, k as l, m as u, p as d, u as f, y as p } from "./WatermarkDialog-r4wmldt4.js";
|
|
2
|
-
import { D as m, E as h, d as g, f as _, i as v, n as y, r as b, t as x, v as
|
|
3
|
-
import { t as
|
|
4
|
-
import { a as
|
|
5
|
-
import { FindReplaceDialog as
|
|
2
|
+
import { D as m, E as h, d as g, f as _, i as v, n as y, r as b, t as x, v as ee, w as S, y as te } from "./ListButtons-DXqMvba3.js";
|
|
3
|
+
import { t as ne } from "./zIndex-BY0qa8Au.js";
|
|
4
|
+
import { a as re, i as ie, o as C, r as ae, t as oe } from "./useZoom-BxDANpqb.js";
|
|
5
|
+
import { FindReplaceDialog as w, FootnotePropertiesDialog as T, HyperlinkDialog as se, ImagePositionDialog as ce, ImagePropertiesDialog as le, InsertImageDialog as E, InsertSymbolDialog as D, InsertTableDialog as ue, PageSetupDialog as de, PasteSpecialDialog as fe, SplitCellDialog as O, TablePropertiesDialog as k, WatermarkDialog as A } from "./dialogs.js";
|
|
6
6
|
import { Fragment as j, Teleport as M, computed as N, createApp as pe, createBlock as P, createCommentVNode as F, createElementBlock as I, createElementVNode as L, createSlots as me, createStaticVNode as he, createTextVNode as ge, createVNode as R, defineComponent as z, h as B, inject as _e, mergeProps as ve, nextTick as ye, normalizeClass as V, normalizeStyle as H, onBeforeUnmount as be, onMounted as xe, openBlock as U, provide as Se, ref as W, renderList as G, renderSlot as Ce, shallowRef as we, toDisplayString as K, unref as q, vModelText as Te, watch as J, withCtx as Ee, withDirectives as De, withKeys as Oe, withModifiers as Y } from "vue";
|
|
7
7
|
import { createStyleResolver as ke, extractSelectionState as Ae, getSelectedText as je, insertImageFromFile as Me, insertImageFromFile as Ne, insertPageBreakInView as Pe, insertPageBreakInView as Fe, insertTableInView as X, insertTableInView as Ie, insertTableOfContentsInView as Le, insertTableOfContentsInView as Re } from "@stll/folio-core/prosemirror";
|
|
8
8
|
import { extractSelectionContext as ze } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
|
|
@@ -21,51 +21,52 @@ import { clickToPositionDom as ut } from "@stll/folio-core/layout-bridge/dom/cli
|
|
|
21
21
|
import { calculateResizedImageDimensions as dt, commitImageFloatMove as ft, commitImageInlineMove as pt, commitImageResize as mt, isFloatingImage as ht } from "@stll/folio-core/prosemirror/imageCommit";
|
|
22
22
|
import { findBodyPmAnchor as gt, findBodyPmSpans as _t } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
|
|
23
23
|
import { getTemplateDirectives as vt, getTemplateDirectives as yt, scanDirectives as bt } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
24
|
+
import { closeHistory as xt } from "prosemirror-history";
|
|
25
|
+
import { clearFormatting as St } from "@stll/folio-core/prosemirror/commands/formatting";
|
|
26
|
+
import { getTableContext as Ct } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
|
|
27
|
+
import { PENDING_COMMENT_ID as wt, createCommentIdAllocator as Tt, seedCommentAllocator as Et } from "@stll/folio-core/prosemirror/commentIdAllocator";
|
|
28
|
+
import { createComment as Dt } from "@stll/folio-core/prosemirror/commentOps";
|
|
29
|
+
import { findChangeRange as Ot } from "@stll/folio-core/prosemirror/queries";
|
|
30
|
+
import { acceptAIEditRevision as kt, acceptChange as At, findAIEditRevisionRange as jt, rejectAIEditRevision as Mt, rejectChange as Nt } from "@stll/folio-core/prosemirror/commands/comments";
|
|
31
|
+
import { makeRevisionInfo as Pt } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
32
|
+
import { setTemplatePreviewValues as Ft } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
33
|
+
import { clearTemplateSlashMenu as It, consumeTemplateSlashQuery as Lt, getTemplateSlashMenu as Rt, resetTemplateSlashQuery as Q, templateSlashMenuKey as zt } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
34
|
+
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as $, applyFolioAIEditOperations as Bt, applyFolioAIEditOperations as Vt, applyFolioDocumentOperations as Ht, assertSupportedFolioDocumentOperationVersion as Ut, createFolioAIEditSnapshot as Wt, createFolioAIEditSnapshot as Gt, diffWordSegments as Kt, getCommentAnchorsFromDoc as qt, getFolioDocumentOperationIssues as Jt, getTrackedChangesFromDoc as Yt, hashFolioAIBlockText as Xt, normalizeFolioAIBlockText as Zt } from "@stll/folio-core/ai-edits";
|
|
35
|
+
import { findPageIndexContainingPmPos as Qt } from "@stll/folio-core/layout-engine";
|
|
36
|
+
import { findParagraphFragmentsByParaId as $t, flashParagraphElements as en } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
37
|
+
import { blockSdtAttrsToSdtProperties as tn, findBlockSdtMatch as nn, findBlockSdtMatches as rn, removeContentControlTr as an, setContentControlContentTr as on, setContentControlValueTr as sn } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
38
|
+
import { setContentControlContentBlocksTr as cn } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
39
|
+
import { clampRangeToDocSize as ln, resolveFolioAIBlockRange as un } from "@stll/folio-core/ai-edits/blockRange";
|
|
40
|
+
import { getPageTextFromLayout as dn } from "@stll/folio-core/paged-layout/pageText";
|
|
41
|
+
import { applyStyle as fn, removeTabStop as pn, setIndentFirstLine as mn, setIndentLeft as hn, setIndentRight as gn } from "@stll/folio-core/prosemirror/commands/paragraph";
|
|
42
|
+
import { getCachedNumberingMap as _n } from "@stll/folio-core/docx";
|
|
43
|
+
import { insertPageBreak as vn } from "@stll/folio-core/prosemirror/commands/pageBreak";
|
|
44
|
+
import { insertSectionBreakContinuous as yn, insertSectionBreakNextPage as bn } from "@stll/folio-core/prosemirror/commands/sectionBreak";
|
|
45
|
+
import { editHyperlinkAtCursor as xn, removeHyperlinkAtCursor as Sn } from "@stll/folio-core/prosemirror/commands/hyperlink";
|
|
46
|
+
import { collectHeadings as Cn } from "@stll/folio-core/utils/headingCollector";
|
|
47
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as wn, detectTableInsertHover as Tn } from "@stll/folio-core/layout-bridge/tableInsertHover";
|
|
48
|
+
import { createCellDragTracker as En, findCellPosFromPmPos as Dn } from "@stll/folio-core/prosemirror/cellDragSelection";
|
|
49
|
+
import { getDocumentWatermark as On, setDocumentWatermark as kn } from "@stll/folio-core/watermark";
|
|
50
|
+
import { createEmptyDocument as An } from "@stll/folio-core/utils/createDocument";
|
|
51
|
+
import { createDocx as jn } from "@stll/folio-core/docx/rezip";
|
|
52
|
+
import { deriveBlockId as Mn, getFolioParaIdFromBlockId as Nn, isFolioBlockId as Pn, isSequentialFolioBlockId as Fn } from "@stll/folio-core/types/block-id";
|
|
53
|
+
import { DEFAULT_AI_SUGGESTION_PRESETS as In } from "@stll/folio-core/ai-suggestions/types";
|
|
54
|
+
import { applySuggestions as Ln } from "@stll/folio-core/ai-suggestions/apply";
|
|
55
|
+
import { isSuggestionStale as Rn, resolveSuggestionAnchor as zn } from "@stll/folio-core/ai-suggestions/conflict";
|
|
56
|
+
import { buildPositionalText as Bn } from "@stll/folio-core/ai-suggestions/text-positions";
|
|
57
|
+
import { setAISuggestionsMeta as Vn, setFocusedSuggestionMeta as Hn } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
58
|
+
import { scrollFolioPositionIntoView as Un } from "@stll/folio-core/paged-layout/scrollToPmPosition";
|
|
59
|
+
import { getFolioCaretViewportRect as Wn, getFolioSelectionViewportRect as Gn } from "@stll/folio-core/paged-layout/selectionViewportRect";
|
|
60
|
+
import { createAICitationDecorationsPlugin as Kn, setAICitationsMeta as qn, setActiveCitationMeta as Jn } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
61
|
+
import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as Yn, acceptAutocompleteSuggestion as Xn, acceptAutocompleteWord as Zn, appendAutocompleteToken as Qn, autocompleteSuggestionKey as $n, autocompleteSuggestionPlugin as er, clearAutocompleteSuggestion as tr, finishAutocompleteSuggestion as nr, getAutocompleteSuggestion as rr, shouldTriggerAutocomplete as ir, startAutocompleteSuggestion as ar } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
62
|
+
import { fromMarkdown as or, toMarkdown as sr, toMarkdownResult as cr } from "@stll/folio-core/markdown";
|
|
62
63
|
//#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
63
|
-
var
|
|
64
|
+
var lr = [
|
|
64
65
|
"data-folio-anonymization-label",
|
|
65
66
|
"data-folio-anonymization-canonical",
|
|
66
67
|
"data-folio-anonymization-selected",
|
|
67
68
|
"title"
|
|
68
|
-
],
|
|
69
|
+
], ur = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
69
70
|
__name: "AnonymizationRectsOverlay",
|
|
70
71
|
props: {
|
|
71
72
|
getView: { type: Function },
|
|
@@ -182,12 +183,12 @@ var cr = [
|
|
|
182
183
|
width: `${n.width}px`,
|
|
183
184
|
height: `${n.height}px`
|
|
184
185
|
})
|
|
185
|
-
}, null, 14,
|
|
186
|
+
}, null, 14, lr))), 128))], 64))), 128))], 512));
|
|
186
187
|
}
|
|
187
|
-
}), [["__scopeId", "data-v-c7db88e1"]]),
|
|
188
|
+
}), [["__scopeId", "data-v-c7db88e1"]]), dr = { class: "doc-outline__header" }, fr = { class: "doc-outline__body" }, pr = {
|
|
188
189
|
key: 0,
|
|
189
190
|
class: "doc-outline__empty"
|
|
190
|
-
},
|
|
191
|
+
}, mr = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
191
192
|
__name: "DocumentOutline",
|
|
192
193
|
props: {
|
|
193
194
|
isOpen: { type: Boolean },
|
|
@@ -216,7 +217,7 @@ var cr = [
|
|
|
216
217
|
role: "navigation",
|
|
217
218
|
"aria-label": "Document outline",
|
|
218
219
|
onMousedown: n[1] ||= Y(() => {}, ["stop"])
|
|
219
|
-
}, [L("div",
|
|
220
|
+
}, [L("div", dr, [L("button", {
|
|
220
221
|
class: "doc-outline__back",
|
|
221
222
|
title: "Close outline",
|
|
222
223
|
"aria-label": "Close outline",
|
|
@@ -224,7 +225,7 @@ var cr = [
|
|
|
224
225
|
}, [R(r, {
|
|
225
226
|
name: "arrow_back",
|
|
226
227
|
size: 20
|
|
227
|
-
})]), n[2] ||= L("span", { class: "doc-outline__title" }, "Document Outline", -1)]), L("div",
|
|
228
|
+
})]), n[2] ||= L("span", { class: "doc-outline__title" }, "Document Outline", -1)]), L("div", fr, [e.headings.length === 0 ? (U(), I("div", pr, "No headings found")) : (U(), P(q(i), {
|
|
228
229
|
key: 1,
|
|
229
230
|
items: o.value,
|
|
230
231
|
"get-scroll-container": e.getScrollContainer ?? (() => null),
|
|
@@ -232,7 +233,7 @@ var cr = [
|
|
|
232
233
|
"aria-label": "Document outline"
|
|
233
234
|
}, null, 8, ["items", "get-scroll-container"]))])], 36)) : F("", !0);
|
|
234
235
|
}
|
|
235
|
-
}), [["__scopeId", "data-v-0797b3b1"]]),
|
|
236
|
+
}), [["__scopeId", "data-v-0797b3b1"]]), hr = /* @__PURE__ */ z({
|
|
236
237
|
__name: "DocxEditorDialogs",
|
|
237
238
|
props: {
|
|
238
239
|
view: {},
|
|
@@ -299,10 +300,10 @@ var cr = [
|
|
|
299
300
|
}, null, 8, ["is-open", "section-properties"])
|
|
300
301
|
], 64));
|
|
301
302
|
}
|
|
302
|
-
}),
|
|
303
|
+
}), gr = {
|
|
303
304
|
key: 0,
|
|
304
305
|
class: "docx-editor-vue__title-bar"
|
|
305
|
-
},
|
|
306
|
+
}, _r = { class: "docx-editor-vue__title-bar-left" }, vr = { class: "docx-editor-vue__title-bar-center" }, yr = { class: "docx-editor-vue__title-bar-right" }, br = /* @__PURE__ */ z({
|
|
306
307
|
__name: "DocxEditorMenuBar",
|
|
307
308
|
props: {
|
|
308
309
|
showMenuBar: {
|
|
@@ -334,13 +335,13 @@ var cr = [
|
|
|
334
335
|
],
|
|
335
336
|
setup(e, { emit: t }) {
|
|
336
337
|
let n = t;
|
|
337
|
-
return (t, r) => e.showMenuBar ? (U(), I("div",
|
|
338
|
-
L("div",
|
|
339
|
-
L("div",
|
|
338
|
+
return (t, r) => e.showMenuBar ? (U(), I("div", gr, [
|
|
339
|
+
L("div", _r, [Ce(t.$slots, "title-bar-left")]),
|
|
340
|
+
L("div", vr, [R(h, {
|
|
340
341
|
"model-value": e.documentName,
|
|
341
342
|
editable: e.documentNameEditable,
|
|
342
343
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
343
|
-
}, null, 8, ["model-value", "editable"]), R(
|
|
344
|
+
}, null, 8, ["model-value", "editable"]), R(S, {
|
|
344
345
|
"show-file-open": e.showFileOpen,
|
|
345
346
|
"show-help-menu": e.showHelpMenu,
|
|
346
347
|
"show-table-insert": e.showTableInsert,
|
|
@@ -351,40 +352,40 @@ var cr = [
|
|
|
351
352
|
"show-help-menu",
|
|
352
353
|
"show-table-insert"
|
|
353
354
|
])]),
|
|
354
|
-
L("div",
|
|
355
|
+
L("div", yr, [Ce(t.$slots, "title-bar-right")])
|
|
355
356
|
])) : F("", !0);
|
|
356
357
|
}
|
|
357
|
-
}),
|
|
358
|
-
function
|
|
359
|
-
Se(
|
|
358
|
+
}), xr = Symbol("docx-portal-class");
|
|
359
|
+
function Sr(e) {
|
|
360
|
+
Se(xr, N(() => ({
|
|
360
361
|
"ep-root": !0,
|
|
361
362
|
dark: !!q(e)
|
|
362
363
|
})));
|
|
363
364
|
}
|
|
364
|
-
function
|
|
365
|
-
return _e(
|
|
365
|
+
function Cr() {
|
|
366
|
+
return _e(xr, N(() => ({ "ep-root": !0 })));
|
|
366
367
|
}
|
|
367
368
|
//#endregion
|
|
368
369
|
//#region src/components/ImageContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
369
|
-
var
|
|
370
|
+
var wr = ["aria-label"], Tr = { class: "image-ctx-menu__icon" }, Er = { class: "image-ctx-menu__label" }, Dr = {
|
|
370
371
|
key: 1,
|
|
371
372
|
class: "image-ctx-menu__divider",
|
|
372
373
|
role: "separator"
|
|
373
|
-
},
|
|
374
|
+
}, Or = [
|
|
374
375
|
"data-wrap-type",
|
|
375
376
|
"data-current",
|
|
376
377
|
"data-disabled",
|
|
377
378
|
"disabled",
|
|
378
379
|
"title",
|
|
379
380
|
"onClick"
|
|
380
|
-
],
|
|
381
|
+
], kr = { class: "image-ctx-menu__icon" }, Ar = { class: "image-ctx-menu__label" }, jr = ["aria-label"], Mr = ["disabled", "onClick"], Nr = { class: "image-ctx-menu__label" }, Pr = {
|
|
381
382
|
key: 0,
|
|
382
383
|
class: "image-ctx-menu__shortcut"
|
|
383
|
-
},
|
|
384
|
+
}, Fr = {
|
|
384
385
|
key: 0,
|
|
385
386
|
class: "image-ctx-menu__divider",
|
|
386
387
|
role: "separator"
|
|
387
|
-
},
|
|
388
|
+
}, Ir = 18, Lr = 260, Rr = 10, zr = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
388
389
|
__name: "ImageContextMenu",
|
|
389
390
|
props: {
|
|
390
391
|
state: {},
|
|
@@ -405,7 +406,7 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
405
406
|
function a() {
|
|
406
407
|
i("open-properties"), i("close");
|
|
407
408
|
}
|
|
408
|
-
let { t: o } = c(), s =
|
|
409
|
+
let { t: o } = c(), s = Cr(), l = nt, u = N(() => n.state ? it(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
|
|
409
410
|
inline: "wrap_text",
|
|
410
411
|
squareLeft: "format_image_left",
|
|
411
412
|
squareRight: "format_image_right",
|
|
@@ -418,11 +419,11 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
418
419
|
let p = N(() => {
|
|
419
420
|
if (!n.state) return {};
|
|
420
421
|
let e = nt.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
421
|
-
return typeof window < "u" && (t +
|
|
422
|
+
return typeof window < "u" && (t + Lr > window.innerWidth && (t = window.innerWidth - Lr - Rr), r + e > window.innerHeight && (r = window.innerHeight - e - Rr), t < Rr && (t = Rr), r < Rr && (r = Rr)), {
|
|
422
423
|
position: "fixed",
|
|
423
424
|
left: `${t}px`,
|
|
424
425
|
top: `${r}px`,
|
|
425
|
-
minWidth: `${
|
|
426
|
+
minWidth: `${Lr}px`,
|
|
426
427
|
zIndex: 400
|
|
427
428
|
};
|
|
428
429
|
});
|
|
@@ -464,11 +465,11 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
464
465
|
"data-action": "open-properties",
|
|
465
466
|
onMousedown: n[1] ||= Y(() => {}, ["prevent"]),
|
|
466
467
|
onClick: a
|
|
467
|
-
}, [L("span",
|
|
468
|
+
}, [L("span", Tr, [R(r, {
|
|
468
469
|
name: "settings",
|
|
469
|
-
size:
|
|
470
|
-
})]), L("span",
|
|
471
|
-
e.canOpenProperties ? (U(), I("div",
|
|
470
|
+
size: Ir
|
|
471
|
+
})]), L("span", Er, K(q(o)("imageWrap.menu.imageProperties")), 1)], 32)) : F("", !0),
|
|
472
|
+
e.canOpenProperties ? (U(), I("div", Dr)) : F("", !0),
|
|
472
473
|
(U(!0), I(j, null, G(q(l), (e) => (U(), I("button", {
|
|
473
474
|
key: e.choice,
|
|
474
475
|
type: "button",
|
|
@@ -482,17 +483,17 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
482
483
|
onMousedown: n[2] ||= Y(() => {}, ["prevent"]),
|
|
483
484
|
onClick: (t) => h(e)
|
|
484
485
|
}, [
|
|
485
|
-
L("span",
|
|
486
|
+
L("span", kr, [R(r, {
|
|
486
487
|
name: f(e.iconHint),
|
|
487
|
-
size:
|
|
488
|
+
size: Ir
|
|
488
489
|
}, null, 8, ["name"])]),
|
|
489
|
-
L("span",
|
|
490
|
+
L("span", Ar, K(q(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
490
491
|
e.choice === u.value ? (U(), I("span", {
|
|
491
492
|
key: 0,
|
|
492
493
|
class: "image-ctx-menu__current-dot",
|
|
493
494
|
"aria-label": q(o)("imageWrap.menu.ariaLabel")
|
|
494
|
-
}, "●", 8,
|
|
495
|
-
], 42,
|
|
495
|
+
}, "●", 8, jr)) : F("", !0)
|
|
496
|
+
], 42, Or))), 128)),
|
|
496
497
|
e.textActions && e.textActions.length > 0 ? (U(), I(j, { key: 2 }, [n[5] ||= L("div", {
|
|
497
498
|
class: "image-ctx-menu__divider",
|
|
498
499
|
role: "separator"
|
|
@@ -503,16 +504,16 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
503
504
|
disabled: e.disabled,
|
|
504
505
|
onMousedown: n[3] ||= Y(() => {}, ["prevent"]),
|
|
505
506
|
onClick: (t) => g(e)
|
|
506
|
-
}, [L("span",
|
|
507
|
-
], 46,
|
|
507
|
+
}, [L("span", Nr, K(e.label), 1), e.shortcut ? (U(), I("span", Pr, K(e.shortcut), 1)) : F("", !0)], 40, Mr), e.dividerAfter ? (U(), I("div", Fr)) : F("", !0)], 64))), 128))], 64)) : F("", !0)
|
|
508
|
+
], 46, wr)) : F("", !0)]));
|
|
508
509
|
}
|
|
509
|
-
}), [["__scopeId", "data-v-fc8f35bc"]]),
|
|
510
|
+
}), [["__scopeId", "data-v-fc8f35bc"]]), Br = ["disabled", "onMousedown"], Vr = {
|
|
510
511
|
key: 0,
|
|
511
512
|
class: "ctx-menu__icon"
|
|
512
|
-
},
|
|
513
|
+
}, Hr = { class: "ctx-menu__label" }, Ur = {
|
|
513
514
|
key: 1,
|
|
514
515
|
class: "ctx-menu__shortcut"
|
|
515
|
-
},
|
|
516
|
+
}, Wr = 220, Gr = 32, Kr = 10, qr = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
516
517
|
__name: "TextContextMenu",
|
|
517
518
|
props: {
|
|
518
519
|
isOpen: { type: Boolean },
|
|
@@ -529,7 +530,7 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
529
530
|
setup(e, { emit: t }) {
|
|
530
531
|
let n = e, r = ({ node: e }) => e;
|
|
531
532
|
r.props = ["node"];
|
|
532
|
-
let i = t, { t: a } = c(), o =
|
|
533
|
+
let i = t, { t: a } = c(), o = Cr(), s = W(null), l = N(() => {
|
|
533
534
|
let e = [], t = n.customItems ?? [];
|
|
534
535
|
for (let [n, r] of t.entries()) e.push({
|
|
535
536
|
id: `custom-${r.id}`,
|
|
@@ -665,8 +666,8 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
665
666
|
action: "deleteTable"
|
|
666
667
|
}), e;
|
|
667
668
|
}), u = N(() => {
|
|
668
|
-
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 *
|
|
669
|
-
return typeof window < "u" && (e +
|
|
669
|
+
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 * Gr + i * 9;
|
|
670
|
+
return typeof window < "u" && (e + Wr + Kr > window.innerWidth && (e = window.innerWidth - Wr - Kr), t + a + Kr > window.innerHeight && (t = window.innerHeight - a - Kr)), {
|
|
670
671
|
position: "fixed",
|
|
671
672
|
left: `${e}px`,
|
|
672
673
|
top: `${t}px`,
|
|
@@ -704,12 +705,12 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
704
705
|
disabled: e.disabled,
|
|
705
706
|
onMousedown: Y((t) => d(e.action), ["prevent"])
|
|
706
707
|
}, [
|
|
707
|
-
e.icon ? (U(), I("span",
|
|
708
|
-
L("span",
|
|
709
|
-
e.shortcut ? (U(), I("span",
|
|
710
|
-
], 42,
|
|
708
|
+
e.icon ? (U(), I("span", Vr, [R(r, { node: e.icon }, null, 8, ["node"])])) : F("", !0),
|
|
709
|
+
L("span", Hr, K(e.label), 1),
|
|
710
|
+
e.shortcut ? (U(), I("span", Ur, K(e.shortcut), 1)) : F("", !0)
|
|
711
|
+
], 42, Br))), 128))], 38)) : F("", !0)]));
|
|
711
712
|
}
|
|
712
|
-
}), [["__scopeId", "data-v-c1416e84"]]),
|
|
713
|
+
}), [["__scopeId", "data-v-c1416e84"]]), Jr = /* @__PURE__ */ z({
|
|
713
714
|
__name: "DocxEditorOverlays",
|
|
714
715
|
props: {
|
|
715
716
|
readOnly: { type: Boolean },
|
|
@@ -728,7 +729,7 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
728
729
|
],
|
|
729
730
|
setup(e, { emit: t }) {
|
|
730
731
|
let n = t;
|
|
731
|
-
return (t, r) => (U(), I(j, null, [R(
|
|
732
|
+
return (t, r) => (U(), I(j, null, [R(qr, {
|
|
732
733
|
"is-open": e.contextMenu.isOpen,
|
|
733
734
|
position: e.contextMenu.position,
|
|
734
735
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -750,7 +751,7 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
750
751
|
"can-merge-cells",
|
|
751
752
|
"can-split-cell",
|
|
752
753
|
"custom-items"
|
|
753
|
-
]), R(
|
|
754
|
+
]), R(zr, {
|
|
754
755
|
state: e.imageContextMenu,
|
|
755
756
|
"text-actions": e.imageContextMenuTextActions,
|
|
756
757
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -767,7 +768,7 @@ var Cr = ["aria-label"], wr = { class: "image-ctx-menu__icon" }, Tr = { class: "
|
|
|
767
768
|
});
|
|
768
769
|
//#endregion
|
|
769
770
|
//#region src/composables/imageOverlayRect.ts
|
|
770
|
-
function
|
|
771
|
+
function Yr(e) {
|
|
771
772
|
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
772
773
|
return {
|
|
773
774
|
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
@@ -778,13 +779,13 @@ function Jr(e) {
|
|
|
778
779
|
}
|
|
779
780
|
//#endregion
|
|
780
781
|
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
781
|
-
var
|
|
782
|
+
var Xr = ["data-handle", "onMousedown"], Zr = ["title"], Qr = {
|
|
782
783
|
key: 0,
|
|
783
784
|
class: "image-overlay__dim"
|
|
784
|
-
},
|
|
785
|
+
}, $r = {
|
|
785
786
|
key: 1,
|
|
786
787
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
787
|
-
},
|
|
788
|
+
}, ei = 4, ti = 15, ni = 250, ri = 700, ii = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
788
789
|
__name: "ImageSelectionOverlay",
|
|
789
790
|
props: {
|
|
790
791
|
imageInfo: {},
|
|
@@ -798,8 +799,8 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
798
799
|
"context-menu"
|
|
799
800
|
],
|
|
800
801
|
setup(e, { emit: t }) {
|
|
801
|
-
let { t: n } = c(), r = e, i = t, a = W(null), o = W(!1), s = W(!1), l = W(!1), u = W(0), d = W(0), f = W(0), p = W(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null,
|
|
802
|
-
function
|
|
802
|
+
let { t: n } = c(), r = e, i = t, a = W(null), o = W(!1), s = W(!1), l = W(!1), u = W(0), d = W(0), f = W(0), p = W(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, ee = null;
|
|
803
|
+
function S(e, t) {
|
|
803
804
|
if (!e) return null;
|
|
804
805
|
try {
|
|
805
806
|
let n = e.state.doc.nodeAt(t);
|
|
@@ -808,25 +809,25 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
808
809
|
return null;
|
|
809
810
|
}
|
|
810
811
|
}
|
|
811
|
-
function
|
|
812
|
+
function te(e) {
|
|
812
813
|
if (!e) return null;
|
|
813
814
|
let t = e.attrs.transform;
|
|
814
815
|
return typeof t == "string" ? t : null;
|
|
815
816
|
}
|
|
816
|
-
function
|
|
817
|
+
function re() {
|
|
817
818
|
return a.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
|
|
818
819
|
}
|
|
819
|
-
function
|
|
820
|
+
function ie() {
|
|
820
821
|
let e = r.imageInfo;
|
|
821
822
|
if (!e) return null;
|
|
822
823
|
if (e.element.isConnected) return e.element;
|
|
823
|
-
let t =
|
|
824
|
+
let t = re();
|
|
824
825
|
if (!t) return null;
|
|
825
826
|
let n = gt(t, e.pmPos);
|
|
826
827
|
return n ? at(n) : null;
|
|
827
828
|
}
|
|
828
|
-
function
|
|
829
|
-
let e =
|
|
829
|
+
function C() {
|
|
830
|
+
let e = ie();
|
|
830
831
|
if (!e || !a.value) {
|
|
831
832
|
p.value = null;
|
|
832
833
|
return;
|
|
@@ -837,7 +838,7 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
837
838
|
return;
|
|
838
839
|
}
|
|
839
840
|
let n = t.getBoundingClientRect(), i = e.getBoundingClientRect();
|
|
840
|
-
p.value =
|
|
841
|
+
p.value = Yr({
|
|
841
842
|
imageRect: i,
|
|
842
843
|
parentRect: n,
|
|
843
844
|
scrollLeft: t.scrollLeft,
|
|
@@ -847,19 +848,19 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
847
848
|
zoom: r.zoom
|
|
848
849
|
});
|
|
849
850
|
}
|
|
850
|
-
let
|
|
851
|
-
function
|
|
852
|
-
|
|
851
|
+
let ae = null;
|
|
852
|
+
function oe() {
|
|
853
|
+
ae?.();
|
|
853
854
|
let e = 0, t = "", n = 0, r = 0, i = (a) => {
|
|
854
855
|
r === 0 && (r = a);
|
|
855
856
|
let o = a - r;
|
|
856
|
-
|
|
857
|
+
C();
|
|
857
858
|
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
858
|
-
n = c === t ? n + 1 : 0, t = c, !(o >=
|
|
859
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= ni && n >= 2) && o < ri && (e = requestAnimationFrame(i));
|
|
859
860
|
};
|
|
860
861
|
e = requestAnimationFrame(i);
|
|
861
|
-
let a = setTimeout(
|
|
862
|
-
|
|
862
|
+
let a = setTimeout(C, ni);
|
|
863
|
+
ae = () => {
|
|
863
864
|
cancelAnimationFrame(e), clearTimeout(a);
|
|
864
865
|
};
|
|
865
866
|
}
|
|
@@ -868,20 +869,20 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
868
869
|
p.value = null;
|
|
869
870
|
return;
|
|
870
871
|
}
|
|
871
|
-
|
|
872
|
+
oe(), n(() => ae?.());
|
|
872
873
|
}, { immediate: !0 }), J(() => r.zoom, () => {
|
|
873
|
-
r.imageInfo &&
|
|
874
|
+
r.imageInfo && oe();
|
|
874
875
|
}), J(() => r.imageInfo, (e, t, n) => {
|
|
875
876
|
if (!r.imageInfo) return;
|
|
876
877
|
let i = () => {
|
|
877
|
-
b && cancelAnimationFrame(b), b = requestAnimationFrame(
|
|
878
|
+
b && cancelAnimationFrame(b), b = requestAnimationFrame(C);
|
|
878
879
|
}, o = a.value?.closest(".docx-editor-vue__pages-viewport");
|
|
879
880
|
o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
|
|
880
881
|
let s = null, c = !1;
|
|
881
882
|
ye(() => {
|
|
882
883
|
if (c || !r.imageInfo) return;
|
|
883
|
-
let e =
|
|
884
|
-
e && (s = new MutationObserver(() =>
|
|
884
|
+
let e = re();
|
|
885
|
+
e && (s = new MutationObserver(() => oe()), s.observe(e, {
|
|
885
886
|
attributes: !0,
|
|
886
887
|
attributeFilter: ["style"]
|
|
887
888
|
}));
|
|
@@ -889,7 +890,7 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
889
890
|
c = !0, o?.removeEventListener("scroll", i), window.removeEventListener("resize", i), s?.disconnect(), b && cancelAnimationFrame(b);
|
|
890
891
|
});
|
|
891
892
|
}, { immediate: !0 });
|
|
892
|
-
let
|
|
893
|
+
let w = N(() => o.value ? u.value : p.value?.width || 0), T = N(() => o.value ? d.value : p.value?.height || 0), se = N(() => {
|
|
893
894
|
let e = p.value;
|
|
894
895
|
if (!e) return {
|
|
895
896
|
position: "absolute",
|
|
@@ -907,11 +908,11 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
907
908
|
height: `${n}px`,
|
|
908
909
|
transform: i === 1 ? void 0 : `scale(${i})`,
|
|
909
910
|
transformOrigin: "top left",
|
|
910
|
-
zIndex:
|
|
911
|
+
zIndex: ne.imageOverlay,
|
|
911
912
|
pointerEvents: "auto"
|
|
912
913
|
};
|
|
913
|
-
}),
|
|
914
|
-
let e =
|
|
914
|
+
}), ce = N(() => {
|
|
915
|
+
let e = w.value, t = T.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
|
|
915
916
|
return [
|
|
916
917
|
{
|
|
917
918
|
pos: "nw",
|
|
@@ -979,10 +980,10 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
979
980
|
}
|
|
980
981
|
];
|
|
981
982
|
});
|
|
982
|
-
function
|
|
983
|
-
!r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove",
|
|
983
|
+
function le(e, t) {
|
|
984
|
+
!r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", E), document.addEventListener("mouseup", D));
|
|
984
985
|
}
|
|
985
|
-
function
|
|
986
|
+
function E(e) {
|
|
986
987
|
let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = dt(m, n, i, _, v, a);
|
|
987
988
|
u.value = Math.round(o.width), d.value = Math.round(o.height);
|
|
988
989
|
let s = y;
|
|
@@ -996,17 +997,17 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
996
997
|
};
|
|
997
998
|
}
|
|
998
999
|
}
|
|
999
|
-
function
|
|
1000
|
-
document.removeEventListener("mousemove",
|
|
1000
|
+
function D() {
|
|
1001
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), o.value = !1, y = null, i("interact-end");
|
|
1001
1002
|
let e = r.view, t = r.imageInfo;
|
|
1002
1003
|
if (!e || !t) {
|
|
1003
|
-
|
|
1004
|
+
C();
|
|
1004
1005
|
return;
|
|
1005
1006
|
}
|
|
1006
1007
|
let n = mt(e, t.pmPos, u.value, d.value);
|
|
1007
|
-
n !== null && _e(n), ye(() =>
|
|
1008
|
+
n !== null && _e(n), ye(() => C());
|
|
1008
1009
|
}
|
|
1009
|
-
let
|
|
1010
|
+
let ue = 0, de = 0, fe = 0, O = 0, k = null, A = null;
|
|
1010
1011
|
function M(e) {
|
|
1011
1012
|
if (!e) return 0;
|
|
1012
1013
|
let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/)?.[1];
|
|
@@ -1017,37 +1018,37 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1017
1018
|
return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
|
|
1018
1019
|
}
|
|
1019
1020
|
function P(e, t) {
|
|
1020
|
-
return Math.atan2(e -
|
|
1021
|
+
return Math.atan2(e - ue, -(t - de)) * 180 / Math.PI;
|
|
1021
1022
|
}
|
|
1022
1023
|
function me(e) {
|
|
1023
1024
|
if (!r.imageInfo) return;
|
|
1024
1025
|
let t = r.imageInfo.element.getBoundingClientRect();
|
|
1025
|
-
|
|
1026
|
+
ue = t.left + t.width / 2, de = t.top + t.height / 2, k = te(S(r.view, r.imageInfo.pmPos)), O = M(k), A = r.imageInfo.element.querySelector("img"), fe = P(e.clientX, e.clientY), f.value = O, l.value = !0, i("interact-start"), document.addEventListener("mousemove", he), document.addEventListener("mouseup", ge);
|
|
1026
1027
|
}
|
|
1027
1028
|
function he(e) {
|
|
1028
|
-
let t = P(e.clientX, e.clientY) -
|
|
1029
|
-
e.shiftKey || (n = Math.round(n /
|
|
1029
|
+
let t = P(e.clientX, e.clientY) - fe, n = O + t;
|
|
1030
|
+
e.shiftKey || (n = Math.round(n / ti) * ti), f.value = (n % 360 + 360) % 360, A && (A.style.transform = pe(k, f.value) || "");
|
|
1030
1031
|
}
|
|
1031
1032
|
function ge() {
|
|
1032
1033
|
document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), l.value = !1, i("interact-end");
|
|
1033
1034
|
let e = r.view, t = r.imageInfo;
|
|
1034
1035
|
try {
|
|
1035
|
-
let n = e && t ?
|
|
1036
|
+
let n = e && t ? S(e, t.pmPos) : null;
|
|
1036
1037
|
e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
|
|
1037
1038
|
...n.attrs,
|
|
1038
|
-
transform: pe(
|
|
1039
|
+
transform: pe(te(n), f.value)
|
|
1039
1040
|
})), _e(t.pmPos));
|
|
1040
1041
|
} catch {} finally {
|
|
1041
|
-
A && (A.style.transform = ""), A = null,
|
|
1042
|
+
A && (A.style.transform = ""), A = null, k = null;
|
|
1042
1043
|
}
|
|
1043
|
-
ye(() =>
|
|
1044
|
+
ye(() => C());
|
|
1044
1045
|
}
|
|
1045
1046
|
let R = null;
|
|
1046
1047
|
function z(e) {
|
|
1047
1048
|
if (!r.imageInfo || !p.value) return;
|
|
1048
1049
|
let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
|
|
1049
1050
|
let c = e.clientX - t, l = e.clientY - n;
|
|
1050
|
-
if (!(!o && Math.sqrt(c * c + l * l) <
|
|
1051
|
+
if (!(!o && Math.sqrt(c * c + l * l) < ei)) {
|
|
1051
1052
|
if (!o) {
|
|
1052
1053
|
o = !0, s.value = !0, i("interact-start"), R = document.createElement("div"), R.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);";
|
|
1053
1054
|
let e = r.zoom;
|
|
@@ -1059,14 +1060,14 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1059
1060
|
}
|
|
1060
1061
|
}
|
|
1061
1062
|
}, l = (e) => {
|
|
1062
|
-
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", l), x = null,
|
|
1063
|
+
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", l), x = null, ee = null, R &&= (R.remove(), null), s.value = !1, o && (i("interact-end"), B(e.clientX, e.clientY));
|
|
1063
1064
|
};
|
|
1064
|
-
x = c,
|
|
1065
|
+
x = c, ee = l, document.addEventListener("mousemove", c), document.addEventListener("mouseup", l);
|
|
1065
1066
|
}
|
|
1066
1067
|
function B(e, t) {
|
|
1067
1068
|
let n = r.view, i = r.imageInfo;
|
|
1068
1069
|
if (!n || !i) return;
|
|
1069
|
-
let o =
|
|
1070
|
+
let o = S(n, i.pmPos);
|
|
1070
1071
|
if (!o) return;
|
|
1071
1072
|
let s;
|
|
1072
1073
|
if (ht(o)) {
|
|
@@ -1088,13 +1089,13 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1088
1089
|
let l = c.getBoundingClientRect(), u = r.zoom, d = tt((e - l.left) / u), f = tt((t - l.top) / u);
|
|
1089
1090
|
s = ft(n, i.pmPos, d, f);
|
|
1090
1091
|
} else {
|
|
1091
|
-
let r =
|
|
1092
|
+
let r = re();
|
|
1092
1093
|
if (!r) return;
|
|
1093
1094
|
let a = ut(r, e, t, 1);
|
|
1094
1095
|
if (a == null || a < 0) return;
|
|
1095
1096
|
s = pt(n, i.pmPos, a);
|
|
1096
1097
|
}
|
|
1097
|
-
s !== null && _e(s), ye(() =>
|
|
1098
|
+
s !== null && _e(s), ye(() => C());
|
|
1098
1099
|
}
|
|
1099
1100
|
function _e(e) {
|
|
1100
1101
|
let t = r.view;
|
|
@@ -1104,13 +1105,13 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1104
1105
|
} catch {}
|
|
1105
1106
|
}
|
|
1106
1107
|
return be(() => {
|
|
1107
|
-
document.removeEventListener("mousemove",
|
|
1108
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), x && document.removeEventListener("mousemove", x), ee && document.removeEventListener("mouseup", ee), R &&= (R.remove(), null), b && cancelAnimationFrame(b), ae?.();
|
|
1108
1109
|
}), (t, r) => e.imageInfo ? (U(), I("div", {
|
|
1109
1110
|
key: 0,
|
|
1110
1111
|
ref_key: "overlayRootRef",
|
|
1111
1112
|
ref: a,
|
|
1112
1113
|
class: "image-overlay",
|
|
1113
|
-
style: H(
|
|
1114
|
+
style: H(se.value),
|
|
1114
1115
|
onMousedown: r[3] ||= Y(() => {}, ["stop"])
|
|
1115
1116
|
}, [
|
|
1116
1117
|
r[4] ||= L("div", { class: "image-overlay__border" }, null, -1),
|
|
@@ -1120,25 +1121,25 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1120
1121
|
onMousedown: r[0] ||= Y((e) => z(e), ["prevent", "stop"]),
|
|
1121
1122
|
onContextmenu: r[1] ||= Y((e) => t.$emit("context-menu", e), ["prevent", "stop"])
|
|
1122
1123
|
}, null, 36),
|
|
1123
|
-
(U(!0), I(j, null, G(
|
|
1124
|
+
(U(!0), I(j, null, G(ce.value, (e) => (U(), I("div", {
|
|
1124
1125
|
key: e.pos,
|
|
1125
1126
|
class: "image-overlay__handle",
|
|
1126
1127
|
style: H(e.style),
|
|
1127
1128
|
"data-handle": e.pos,
|
|
1128
|
-
onMousedown: Y((t) =>
|
|
1129
|
-
}, null, 44,
|
|
1129
|
+
onMousedown: Y((t) => le(t, e.pos), ["prevent", "stop"])
|
|
1130
|
+
}, null, 44, Xr))), 128)),
|
|
1130
1131
|
r[5] ||= L("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
1131
1132
|
L("div", {
|
|
1132
1133
|
class: "image-overlay__rotate-handle",
|
|
1133
|
-
style: H({ left: `${
|
|
1134
|
+
style: H({ left: `${w.value / 2 - 7}px` }),
|
|
1134
1135
|
title: q(n)("imageOverlay.rotate"),
|
|
1135
1136
|
onMousedown: r[2] ||= Y((e) => me(e), ["prevent", "stop"])
|
|
1136
|
-
}, null, 44,
|
|
1137
|
-
o.value ? (U(), I("div",
|
|
1138
|
-
l.value ? (U(), I("div",
|
|
1137
|
+
}, null, 44, Zr),
|
|
1138
|
+
o.value ? (U(), I("div", Qr, K(Math.round(u.value)) + " × " + K(Math.round(d.value)), 1)) : F("", !0),
|
|
1139
|
+
l.value ? (U(), I("div", $r, K(Math.round(f.value)) + "° ", 1)) : F("", !0)
|
|
1139
1140
|
], 36)) : F("", !0);
|
|
1140
1141
|
}
|
|
1141
|
-
}), [["__scopeId", "data-v-4c3d1a1d"]]),
|
|
1142
|
+
}), [["__scopeId", "data-v-4c3d1a1d"]]), ai = ["title", "aria-label"], oi = /* @__PURE__ */ z({
|
|
1142
1143
|
__name: "OutlineToggleButton",
|
|
1143
1144
|
props: {
|
|
1144
1145
|
leftOffset: {},
|
|
@@ -1161,9 +1162,9 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1161
1162
|
}, [R(r, {
|
|
1162
1163
|
name: "format_list_bulleted",
|
|
1163
1164
|
size: 20
|
|
1164
|
-
})], 44,
|
|
1165
|
+
})], 44, ai));
|
|
1165
1166
|
}
|
|
1166
|
-
}),
|
|
1167
|
+
}), si = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
1167
1168
|
__name: "PageIndicator",
|
|
1168
1169
|
props: {
|
|
1169
1170
|
currentPage: {},
|
|
@@ -1182,7 +1183,7 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1182
1183
|
total: e.totalPages
|
|
1183
1184
|
})), 5));
|
|
1184
1185
|
}
|
|
1185
|
-
}), [["__scopeId", "data-v-f1904974"]]),
|
|
1186
|
+
}), [["__scopeId", "data-v-f1904974"]]), ci = ["data-folio-block-id"], li = ["data-folio-block-id", "title"], ui = 2.5, di = 5, fi = 6, pi = 2, mi = 2, hi = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
1186
1187
|
__name: "TemplateDirectivesOverlay",
|
|
1187
1188
|
props: {
|
|
1188
1189
|
getView: { type: Function },
|
|
@@ -1196,19 +1197,19 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1196
1197
|
setup(e) {
|
|
1197
1198
|
let t = e, n = /* @__PURE__ */ new Set(["if", "each"]), r = /* @__PURE__ */ new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
|
|
1198
1199
|
function a(e) {
|
|
1199
|
-
let t = e -
|
|
1200
|
-
return t <= 0 ? 0 : Math.floor(t /
|
|
1200
|
+
let t = e - fi - ui - pi;
|
|
1201
|
+
return t <= 0 ? 0 : Math.floor(t / di);
|
|
1201
1202
|
}
|
|
1202
1203
|
function o(e, t, n) {
|
|
1203
1204
|
let r = a(n), i = Math.min(Math.max(0, e), r);
|
|
1204
|
-
return t -
|
|
1205
|
+
return t - fi - ui - (r - i) * di;
|
|
1205
1206
|
}
|
|
1206
1207
|
function s(e, t) {
|
|
1207
|
-
if (t.length === 0) return e.bottom - e.top >=
|
|
1208
|
+
if (t.length === 0) return e.bottom - e.top >= mi ? [e] : [];
|
|
1208
1209
|
let n = [];
|
|
1209
1210
|
for (let r of t) {
|
|
1210
1211
|
let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
|
|
1211
|
-
i - t >=
|
|
1212
|
+
i - t >= mi && n.push({
|
|
1212
1213
|
top: t,
|
|
1213
1214
|
bottom: i
|
|
1214
1215
|
});
|
|
@@ -1306,49 +1307,49 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1306
1307
|
t.blocks,
|
|
1307
1308
|
t.measures
|
|
1308
1309
|
], () => y());
|
|
1309
|
-
let x = N(() => c(f.value)),
|
|
1310
|
+
let x = N(() => c(f.value)), ee = N(() => m.value ? d(x.value, p.value, m.value) : []), S = N(() => {
|
|
1310
1311
|
let e = /* @__PURE__ */ new Map();
|
|
1311
1312
|
for (let t of x.value) e.set(t.openerFrom, t.blockId), e.set(t.closerFrom, t.blockId);
|
|
1312
1313
|
return e;
|
|
1313
|
-
}),
|
|
1314
|
+
}), te = N(() => {
|
|
1314
1315
|
let e = /* @__PURE__ */ new Map();
|
|
1315
1316
|
for (let t of x.value) e.set(t.closerFrom, l(t.kind, t.openerExpr));
|
|
1316
1317
|
return e;
|
|
1317
|
-
}),
|
|
1318
|
-
function
|
|
1319
|
-
return e === g.value || e ===
|
|
1318
|
+
}), ne = N(() => u(x.value, h.value));
|
|
1319
|
+
function re(e) {
|
|
1320
|
+
return e === g.value || e === ne.value;
|
|
1320
1321
|
}
|
|
1321
|
-
function
|
|
1322
|
+
function ie(e) {
|
|
1322
1323
|
return e.block && (n.has(e.kind) || r.has(e.kind));
|
|
1323
1324
|
}
|
|
1324
|
-
function
|
|
1325
|
-
return e.block ?
|
|
1325
|
+
function C(e) {
|
|
1326
|
+
return e.block ? S.value.get(e.from) : void 0;
|
|
1326
1327
|
}
|
|
1327
|
-
function
|
|
1328
|
-
return e.block ?
|
|
1328
|
+
function ae(e) {
|
|
1329
|
+
return e.block ? te.value.get(e.from) : void 0;
|
|
1329
1330
|
}
|
|
1330
|
-
function
|
|
1331
|
-
let t =
|
|
1331
|
+
function oe(e) {
|
|
1332
|
+
let t = C(e), n = t !== void 0 && re(t);
|
|
1332
1333
|
return [
|
|
1333
1334
|
"folio-template-directive",
|
|
1334
1335
|
`folio-template-directive--${e.kind}`,
|
|
1335
|
-
{ "folio-template-directive--block":
|
|
1336
|
+
{ "folio-template-directive--block": ie(e) },
|
|
1336
1337
|
{ "folio-template-directive--active": n }
|
|
1337
1338
|
];
|
|
1338
1339
|
}
|
|
1339
|
-
function
|
|
1340
|
+
function w(e) {
|
|
1340
1341
|
if (!(e instanceof HTMLElement)) return null;
|
|
1341
1342
|
let t = e.dataset.folioBlockId;
|
|
1342
1343
|
return t === void 0 ? null : Number(t);
|
|
1343
1344
|
}
|
|
1344
|
-
function
|
|
1345
|
-
let t =
|
|
1345
|
+
function T(e) {
|
|
1346
|
+
let t = w(e.target);
|
|
1346
1347
|
t !== null && (g.value = t);
|
|
1347
1348
|
}
|
|
1348
|
-
function
|
|
1349
|
-
let t =
|
|
1349
|
+
function se(e) {
|
|
1350
|
+
let t = w(e.target);
|
|
1350
1351
|
if (t === null) return;
|
|
1351
|
-
let n =
|
|
1352
|
+
let n = w(e.relatedTarget);
|
|
1352
1353
|
n !== t && g.value === t && (g.value = n);
|
|
1353
1354
|
}
|
|
1354
1355
|
return xe(() => y()), be(() => {
|
|
@@ -1356,28 +1357,28 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1356
1357
|
}), (t, n) => (U(), I("div", {
|
|
1357
1358
|
class: "folio-template-directives-overlay",
|
|
1358
1359
|
"data-folio-template-directives-overlay": "",
|
|
1359
|
-
onPointerover:
|
|
1360
|
-
onPointerout:
|
|
1361
|
-
}, [(U(!0), I(j, null, G(
|
|
1360
|
+
onPointerover: T,
|
|
1361
|
+
onPointerout: se
|
|
1362
|
+
}, [(U(!0), I(j, null, G(ee.value, (t) => (U(), I(j, { key: `rail:${t.blockId}` }, [(U(!0), I(j, null, G(t.segments, (n, r) => (U(), I("div", {
|
|
1362
1363
|
key: `rail:${t.blockId}:${r}`,
|
|
1363
1364
|
class: V([
|
|
1364
1365
|
"folio-template-band-rail",
|
|
1365
1366
|
`folio-template-band-rail--${t.kind}`,
|
|
1366
|
-
{ "folio-template-band-rail--active":
|
|
1367
|
+
{ "folio-template-band-rail--active": re(t.blockId) }
|
|
1367
1368
|
]),
|
|
1368
1369
|
"data-folio-block-id": t.blockId,
|
|
1369
1370
|
style: H({
|
|
1370
1371
|
position: "absolute",
|
|
1371
1372
|
left: `${t.railX * e.zoom}px`,
|
|
1372
1373
|
top: `${n.top * e.zoom}px`,
|
|
1373
|
-
width: `${
|
|
1374
|
+
width: `${ui * e.zoom}px`,
|
|
1374
1375
|
height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
|
|
1375
1376
|
})
|
|
1376
|
-
}, null, 14,
|
|
1377
|
+
}, null, 14, ci))), 128))], 64))), 128)), (U(!0), I(j, null, G(p.value, (t, n) => (U(), I(j, { key: `d:${n}` }, [(U(!0), I(j, null, G(t.rects, (r, i) => (U(), I("span", {
|
|
1377
1378
|
key: `d:${n}:${i}`,
|
|
1378
|
-
class: V(
|
|
1379
|
-
"data-folio-block-id":
|
|
1380
|
-
title:
|
|
1379
|
+
class: V(oe(t.range)),
|
|
1380
|
+
"data-folio-block-id": C(t.range),
|
|
1381
|
+
title: ae(t.range),
|
|
1381
1382
|
style: H({
|
|
1382
1383
|
position: "absolute",
|
|
1383
1384
|
left: `${(r.x - 1) * e.zoom}px`,
|
|
@@ -1385,9 +1386,9 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1385
1386
|
width: `${(r.width + 2) * e.zoom}px`,
|
|
1386
1387
|
height: `${Math.max(0, r.height - 2) * e.zoom}px`
|
|
1387
1388
|
})
|
|
1388
|
-
}, null, 14,
|
|
1389
|
+
}, null, 14, li))), 128))], 64))), 128))], 32));
|
|
1389
1390
|
}
|
|
1390
|
-
}), [["__scopeId", "data-v-142d2ac6"]]),
|
|
1391
|
+
}), [["__scopeId", "data-v-142d2ac6"]]), gi = ["href", "title"], _i = ["title"], vi = ["title"], yi = ["title"], bi = { class: "docx-hyperlink-popup__edit-row" }, xi = ["placeholder", "onKeydown"], Si = { class: "docx-hyperlink-popup__edit-row" }, Ci = ["onKeydown"], wi = ["disabled"], Ti = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
1391
1392
|
__name: "HyperlinkPopup",
|
|
1392
1393
|
props: {
|
|
1393
1394
|
data: {},
|
|
@@ -1436,28 +1437,28 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1436
1437
|
class: V(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
|
|
1437
1438
|
style: H(u.value),
|
|
1438
1439
|
onMousedown: r[6] ||= Y(() => {}, ["stop"])
|
|
1439
|
-
}, [a.value ? (U(), I(j, { key: 1 }, [L("div",
|
|
1440
|
+
}, [a.value ? (U(), I(j, { key: 1 }, [L("div", bi, [De(L("input", {
|
|
1440
1441
|
class: "docx-hyperlink-popup__input",
|
|
1441
1442
|
placeholder: q(n)("displayText"),
|
|
1442
1443
|
"onUpdate:modelValue": r[2] ||= (e) => o.value = e,
|
|
1443
1444
|
onKeydown: [Oe(Y(h, ["prevent"]), ["enter"]), r[3] ||= Oe((e) => t.$emit("close"), ["esc"])]
|
|
1444
|
-
}, null, 40,
|
|
1445
|
+
}, null, 40, xi), [[Te, o.value]])]), L("div", Si, [De(L("input", {
|
|
1445
1446
|
class: "docx-hyperlink-popup__input",
|
|
1446
1447
|
placeholder: "https://...",
|
|
1447
1448
|
"onUpdate:modelValue": r[4] ||= (e) => s.value = e,
|
|
1448
1449
|
onKeydown: [Oe(Y(h, ["prevent"]), ["enter"]), r[5] ||= Oe((e) => t.$emit("close"), ["esc"])]
|
|
1449
|
-
}, null, 40,
|
|
1450
|
+
}, null, 40, Ci), [[Te, s.value]]), L("button", {
|
|
1450
1451
|
class: "docx-hyperlink-popup__apply",
|
|
1451
1452
|
disabled: !s.value.trim(),
|
|
1452
1453
|
onClick: Y(h, ["prevent"])
|
|
1453
|
-
}, K(q(n)("common.apply")), 9,
|
|
1454
|
+
}, K(q(n)("common.apply")), 9, wi)])], 64)) : (U(), I(j, { key: 0 }, [
|
|
1454
1455
|
r[10] ||= he("<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),
|
|
1455
1456
|
L("a", {
|
|
1456
1457
|
class: "docx-hyperlink-popup__url",
|
|
1457
1458
|
href: e.data.href,
|
|
1458
1459
|
title: e.data.href,
|
|
1459
1460
|
onClick: r[0] ||= Y((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1460
|
-
}, K(e.data.href), 9,
|
|
1461
|
+
}, K(e.data.href), 9, gi),
|
|
1461
1462
|
r[11] ||= L("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1462
1463
|
L("button", {
|
|
1463
1464
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1479,7 +1480,7 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1479
1480
|
height: "13",
|
|
1480
1481
|
rx: "2",
|
|
1481
1482
|
ry: "2"
|
|
1482
|
-
}), L("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8,
|
|
1483
|
+
}), L("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, _i),
|
|
1483
1484
|
e.readOnly ? F("", !0) : (U(), I("button", {
|
|
1484
1485
|
key: 0,
|
|
1485
1486
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1494,43 +1495,43 @@ var Yr = ["data-handle", "onMousedown"], Xr = ["title"], Zr = {
|
|
|
1494
1495
|
"stroke-width": "2",
|
|
1495
1496
|
"stroke-linecap": "round",
|
|
1496
1497
|
"stroke-linejoin": "round"
|
|
1497
|
-
}, [L("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), L("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,
|
|
1498
|
+
}, [L("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), L("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, vi)),
|
|
1498
1499
|
e.readOnly ? F("", !0) : (U(), I("button", {
|
|
1499
1500
|
key: 1,
|
|
1500
1501
|
class: "docx-hyperlink-popup__btn",
|
|
1501
1502
|
title: q(n)("removeLink"),
|
|
1502
1503
|
onClick: r[1] ||= Y((e) => t.$emit("remove"), ["prevent"])
|
|
1503
|
-
}, [...r[9] ||= [he("<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,
|
|
1504
|
+
}, [...r[9] ||= [he("<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, yi))
|
|
1504
1505
|
], 64))], 38)) : F("", !0);
|
|
1505
1506
|
}
|
|
1506
1507
|
}), [["__scopeId", "data-v-366df18c"]]);
|
|
1507
1508
|
//#endregion
|
|
1508
1509
|
//#region src/composables/commentMarks.ts
|
|
1509
|
-
function
|
|
1510
|
+
function Ei(e, t) {
|
|
1510
1511
|
let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
|
|
1511
1512
|
return n === r ? null : {
|
|
1512
1513
|
from: n,
|
|
1513
1514
|
to: r
|
|
1514
1515
|
};
|
|
1515
1516
|
}
|
|
1516
|
-
function
|
|
1517
|
+
function Di({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
|
|
1517
1518
|
let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
|
|
1518
|
-
return i ?
|
|
1519
|
+
return i ? Ei(e, i) : null;
|
|
1519
1520
|
}
|
|
1520
|
-
function
|
|
1521
|
-
let i = e.state.schema.marks.comment, a =
|
|
1521
|
+
function Oi(e, t, n, r) {
|
|
1522
|
+
let i = e.state.schema.marks.comment, a = Ei(e.state.doc.content.size, t);
|
|
1522
1523
|
if (!i || !a) return !1;
|
|
1523
1524
|
let o = e.state.tr;
|
|
1524
|
-
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId:
|
|
1525
|
+
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: wt }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(et.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
|
|
1525
1526
|
}
|
|
1526
|
-
function
|
|
1527
|
-
let n = e.state.schema.marks.comment, r =
|
|
1528
|
-
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId:
|
|
1527
|
+
function ki(e, t) {
|
|
1528
|
+
let n = e.state.schema.marks.comment, r = Ei(e.state.doc.content.size, t);
|
|
1529
|
+
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: wt })));
|
|
1529
1530
|
}
|
|
1530
1531
|
//#endregion
|
|
1531
1532
|
//#region src/composables/useCommentLifecycle.ts
|
|
1532
|
-
var
|
|
1533
|
-
function
|
|
1533
|
+
var Ai = 408, ji = 12;
|
|
1534
|
+
function Mi(e) {
|
|
1534
1535
|
let t = W(!1), n = W(null), r = W(null), i = W(null), a = W(null);
|
|
1535
1536
|
function o(t) {
|
|
1536
1537
|
let n = e.editorView.value, r = e.pagesContainer.value;
|
|
@@ -1563,7 +1564,7 @@ function ji(e) {
|
|
|
1563
1564
|
r.value = null;
|
|
1564
1565
|
return;
|
|
1565
1566
|
}
|
|
1566
|
-
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left +
|
|
1567
|
+
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + ji : l.width / 2 + Ai;
|
|
1567
1568
|
r.value = {
|
|
1568
1569
|
top: c.top - l.top,
|
|
1569
1570
|
left: Math.max(16, Math.min(d, l.width - 16)),
|
|
@@ -1574,7 +1575,7 @@ function ji(e) {
|
|
|
1574
1575
|
function c() {
|
|
1575
1576
|
let s = e.editorView.value;
|
|
1576
1577
|
if (!s) return;
|
|
1577
|
-
let c = r.value, l = s.state.selection, u =
|
|
1578
|
+
let c = r.value, l = s.state.selection, u = Di({
|
|
1578
1579
|
docSize: s.state.doc.content.size,
|
|
1579
1580
|
capturedRange: c ? {
|
|
1580
1581
|
from: c.from,
|
|
@@ -1593,7 +1594,7 @@ function ji(e) {
|
|
|
1593
1594
|
r.value = null;
|
|
1594
1595
|
return;
|
|
1595
1596
|
}
|
|
1596
|
-
if (!
|
|
1597
|
+
if (!Oi(s, u, wt, { selectEnd: !0 })) {
|
|
1597
1598
|
r.value = null, i.value = null;
|
|
1598
1599
|
return;
|
|
1599
1600
|
}
|
|
@@ -1606,11 +1607,11 @@ function ji(e) {
|
|
|
1606
1607
|
let n = e.editorView.value, r = i.value;
|
|
1607
1608
|
if (!n || !r) return !1;
|
|
1608
1609
|
let a = e.createComment(t);
|
|
1609
|
-
return
|
|
1610
|
+
return Oi(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
|
|
1610
1611
|
}
|
|
1611
1612
|
function d() {
|
|
1612
1613
|
let t = e.editorView.value;
|
|
1613
|
-
t && i.value &&
|
|
1614
|
+
t && i.value && ki(t, i.value), l();
|
|
1614
1615
|
}
|
|
1615
1616
|
return {
|
|
1616
1617
|
isAddingComment: t,
|
|
@@ -1624,8 +1625,8 @@ function ji(e) {
|
|
|
1624
1625
|
}
|
|
1625
1626
|
//#endregion
|
|
1626
1627
|
//#region src/composables/useCommentManagement.ts
|
|
1627
|
-
function
|
|
1628
|
-
let t =
|
|
1628
|
+
function Ni(e) {
|
|
1629
|
+
let t = Tt(), n = W([]), r = W(!1);
|
|
1629
1630
|
function i() {
|
|
1630
1631
|
r.value = !0;
|
|
1631
1632
|
}
|
|
@@ -1640,12 +1641,12 @@ function Mi(e) {
|
|
|
1640
1641
|
i(), c([...s.value, e]);
|
|
1641
1642
|
}
|
|
1642
1643
|
function u(n, r) {
|
|
1643
|
-
return
|
|
1644
|
+
return Et(t, s.value, e.editorView.value), Dt(t, n, e.author(), r);
|
|
1644
1645
|
}
|
|
1645
1646
|
function d() {
|
|
1646
1647
|
if (a(), o.value) return;
|
|
1647
1648
|
let n = e.getDocument()?.package.document.comments;
|
|
1648
|
-
|
|
1649
|
+
Et(t, n, e.editorView.value), c(n && n.length > 0 ? n : []);
|
|
1649
1650
|
}
|
|
1650
1651
|
function f(e, t) {
|
|
1651
1652
|
l(u(t, e));
|
|
@@ -1671,8 +1672,8 @@ function Mi(e) {
|
|
|
1671
1672
|
function _(t, n) {
|
|
1672
1673
|
let r = e.editorView.value;
|
|
1673
1674
|
if (!r) return;
|
|
1674
|
-
let i =
|
|
1675
|
-
i && (n ?
|
|
1675
|
+
let i = Ot(r, t);
|
|
1676
|
+
i && (n ? At : Nt)(i.from, i.to)(r.state, r.dispatch);
|
|
1676
1677
|
}
|
|
1677
1678
|
function v(e) {
|
|
1678
1679
|
_(e, !0);
|
|
@@ -1682,11 +1683,11 @@ function Mi(e) {
|
|
|
1682
1683
|
}
|
|
1683
1684
|
function b(t, n) {
|
|
1684
1685
|
let r = e.editorView.value;
|
|
1685
|
-
r &&
|
|
1686
|
+
r && At(t, n)(r.state, r.dispatch);
|
|
1686
1687
|
}
|
|
1687
1688
|
function x(t, n) {
|
|
1688
1689
|
let r = e.editorView.value;
|
|
1689
|
-
r &&
|
|
1690
|
+
r && Nt(t, n)(r.state, r.dispatch);
|
|
1690
1691
|
}
|
|
1691
1692
|
return {
|
|
1692
1693
|
comments: s,
|
|
@@ -1709,8 +1710,8 @@ function Mi(e) {
|
|
|
1709
1710
|
}
|
|
1710
1711
|
//#endregion
|
|
1711
1712
|
//#region src/utils/imageClipboard.ts
|
|
1712
|
-
function
|
|
1713
|
-
let r =
|
|
1713
|
+
function Pi(e, t, n) {
|
|
1714
|
+
let r = Pt(e.state), i = e.state.schema.marks.insertion;
|
|
1714
1715
|
if (!r || !i) return;
|
|
1715
1716
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
1716
1717
|
o < 0 || t.addMark(o, a, i.create({
|
|
@@ -1719,7 +1720,7 @@ function Ni(e, t, n) {
|
|
|
1719
1720
|
date: r.date
|
|
1720
1721
|
}));
|
|
1721
1722
|
}
|
|
1722
|
-
function
|
|
1723
|
+
function Fi(e, t) {
|
|
1723
1724
|
let n = e.state.doc.nodeAt(t);
|
|
1724
1725
|
if (!n || n.type.name !== "image") return;
|
|
1725
1726
|
let r = n.attrs.src;
|
|
@@ -1733,7 +1734,7 @@ function Pi(e, t) {
|
|
|
1733
1734
|
e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
1734
1735
|
});
|
|
1735
1736
|
}
|
|
1736
|
-
function
|
|
1737
|
+
function Ii(e) {
|
|
1737
1738
|
return new Promise((t, n) => {
|
|
1738
1739
|
let r = new FileReader();
|
|
1739
1740
|
r.onload = () => {
|
|
@@ -1741,7 +1742,7 @@ function Fi(e) {
|
|
|
1741
1742
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
|
|
1742
1743
|
});
|
|
1743
1744
|
}
|
|
1744
|
-
function
|
|
1745
|
+
function Li(e) {
|
|
1745
1746
|
return new Promise((t) => {
|
|
1746
1747
|
let n = new Image();
|
|
1747
1748
|
n.onload = () => t({
|
|
@@ -1753,7 +1754,7 @@ function Ii(e) {
|
|
|
1753
1754
|
}), n.src = e;
|
|
1754
1755
|
});
|
|
1755
1756
|
}
|
|
1756
|
-
function
|
|
1757
|
+
function Ri(e, t, n, r) {
|
|
1757
1758
|
let i = e.state.schema.nodes.image;
|
|
1758
1759
|
if (!i) return;
|
|
1759
1760
|
let a = i.create({
|
|
@@ -1764,23 +1765,23 @@ function Li(e, t, n, r) {
|
|
|
1764
1765
|
wrapType: "inline",
|
|
1765
1766
|
displayMode: "inline"
|
|
1766
1767
|
}), o = e.state.tr.replaceSelectionWith(a);
|
|
1767
|
-
|
|
1768
|
+
Pi(e, o, a), e.dispatch(o);
|
|
1768
1769
|
}
|
|
1769
|
-
async function
|
|
1770
|
+
async function zi(e) {
|
|
1770
1771
|
try {
|
|
1771
1772
|
let t = await navigator.clipboard.read();
|
|
1772
1773
|
for (let n of t) {
|
|
1773
1774
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
1774
1775
|
if (t) {
|
|
1775
|
-
let r = await
|
|
1776
|
-
a > 612 && (o = Math.round(612 / a * o), a = 612),
|
|
1776
|
+
let r = await Ii(await n.getType(t)), i = await Li(r), a = i.width, o = i.height;
|
|
1777
|
+
a > 612 && (o = Math.round(612 / a * o), a = 612), Ri(e, r, a, o);
|
|
1777
1778
|
return;
|
|
1778
1779
|
}
|
|
1779
1780
|
if (n.types.includes("text/html")) {
|
|
1780
1781
|
let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
|
|
1781
1782
|
if (r) {
|
|
1782
1783
|
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;
|
|
1783
|
-
|
|
1784
|
+
Ri(e, r, a || 200, o || 200);
|
|
1784
1785
|
return;
|
|
1785
1786
|
}
|
|
1786
1787
|
}
|
|
@@ -1801,14 +1802,14 @@ async function Ri(e) {
|
|
|
1801
1802
|
}
|
|
1802
1803
|
}
|
|
1803
1804
|
}
|
|
1804
|
-
function
|
|
1805
|
+
function Bi(e, t) {
|
|
1805
1806
|
let n = e.state.doc.nodeAt(t);
|
|
1806
1807
|
if (!n || n.type.name !== "image") return;
|
|
1807
1808
|
let r = document.createElement("input");
|
|
1808
1809
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
1809
1810
|
let i = r.files?.[0];
|
|
1810
1811
|
if (!i) return;
|
|
1811
|
-
let a = await
|
|
1812
|
+
let a = await Ii(i), o = await Li(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);
|
|
1812
1813
|
try {
|
|
1813
1814
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
1814
1815
|
...n.attrs,
|
|
@@ -1823,7 +1824,7 @@ function zi(e, t) {
|
|
|
1823
1824
|
}
|
|
1824
1825
|
//#endregion
|
|
1825
1826
|
//#region src/composables/useContextMenus.ts
|
|
1826
|
-
var
|
|
1827
|
+
var Vi = /* @__PURE__ */ new Set([
|
|
1827
1828
|
"inline",
|
|
1828
1829
|
"square",
|
|
1829
1830
|
"tight",
|
|
@@ -1832,16 +1833,16 @@ var Bi = /* @__PURE__ */ new Set([
|
|
|
1832
1833
|
"behind",
|
|
1833
1834
|
"inFront"
|
|
1834
1835
|
]);
|
|
1835
|
-
function Vi(e) {
|
|
1836
|
-
return typeof e == "string" && Bi.has(e);
|
|
1837
|
-
}
|
|
1838
1836
|
function Hi(e) {
|
|
1839
|
-
return
|
|
1837
|
+
return typeof e == "string" && Vi.has(e);
|
|
1840
1838
|
}
|
|
1841
1839
|
function Ui(e) {
|
|
1842
|
-
return e
|
|
1840
|
+
return Hi(e) ? e : "inline";
|
|
1843
1841
|
}
|
|
1844
1842
|
function Wi(e) {
|
|
1843
|
+
return e === "left" || e === "right" || e === "none" ? e : null;
|
|
1844
|
+
}
|
|
1845
|
+
function Gi(e) {
|
|
1845
1846
|
let { t } = c(), n = W({
|
|
1846
1847
|
isOpen: !1,
|
|
1847
1848
|
position: {
|
|
@@ -1915,7 +1916,7 @@ function Wi(e) {
|
|
|
1915
1916
|
r.value = l(o, i, {
|
|
1916
1917
|
x: t.clientX,
|
|
1917
1918
|
y: t.clientY
|
|
1918
|
-
},
|
|
1919
|
+
}, Ui(s.attrs.wrapType), Wi(s.attrs.cssFloat)), n.value.isOpen = !1;
|
|
1919
1920
|
return;
|
|
1920
1921
|
}
|
|
1921
1922
|
}
|
|
@@ -1926,7 +1927,7 @@ function Wi(e) {
|
|
|
1926
1927
|
e.setPmSelection(i);
|
|
1927
1928
|
} catch {}
|
|
1928
1929
|
}
|
|
1929
|
-
let s =
|
|
1930
|
+
let s = Ct(a.state), { empty: c, from: u, to: d } = a.state.selection;
|
|
1930
1931
|
i.value = {
|
|
1931
1932
|
from: u,
|
|
1932
1933
|
to: d
|
|
@@ -1950,7 +1951,7 @@ function Wi(e) {
|
|
|
1950
1951
|
!o || o.type.name !== "image" || (r.value = l(a.element, a.pmPos, {
|
|
1951
1952
|
x: t.clientX,
|
|
1952
1953
|
y: t.clientY
|
|
1953
|
-
},
|
|
1954
|
+
}, Ui(o.attrs.wrapType), Wi(o.attrs.cssFloat)), n.value.isOpen = !1);
|
|
1954
1955
|
}
|
|
1955
1956
|
function f(t) {
|
|
1956
1957
|
let n = e.editorView.value, i = r.value;
|
|
@@ -1974,16 +1975,16 @@ function Wi(e) {
|
|
|
1974
1975
|
case "cut":
|
|
1975
1976
|
if (e.selectedImage.value) {
|
|
1976
1977
|
let t = e.selectedImage.value.pmPos;
|
|
1977
|
-
|
|
1978
|
+
Fi(n, t);
|
|
1978
1979
|
let r = n.state.doc.nodeAt(t);
|
|
1979
1980
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
|
|
1980
1981
|
} else n.focus(), document.execCommand("cut");
|
|
1981
1982
|
break;
|
|
1982
1983
|
case "copy":
|
|
1983
|
-
e.selectedImage.value ?
|
|
1984
|
+
e.selectedImage.value ? Fi(n, e.selectedImage.value.pmPos) : (n.focus(), document.execCommand("copy"));
|
|
1984
1985
|
break;
|
|
1985
1986
|
case "paste":
|
|
1986
|
-
|
|
1987
|
+
zi(n);
|
|
1987
1988
|
break;
|
|
1988
1989
|
case "pasteAsPlainText":
|
|
1989
1990
|
navigator.clipboard.readText().then((e) => {
|
|
@@ -2004,7 +2005,7 @@ function Wi(e) {
|
|
|
2004
2005
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2005
2006
|
break;
|
|
2006
2007
|
case "replaceImage":
|
|
2007
|
-
e.selectedImage.value &&
|
|
2008
|
+
e.selectedImage.value && Bi(n, e.selectedImage.value.pmPos);
|
|
2008
2009
|
break;
|
|
2009
2010
|
case "deleteImage":
|
|
2010
2011
|
if (e.selectedImage.value) {
|
|
@@ -2042,7 +2043,7 @@ function Wi(e) {
|
|
|
2042
2043
|
}
|
|
2043
2044
|
//#endregion
|
|
2044
2045
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2045
|
-
function
|
|
2046
|
+
function Ki(e) {
|
|
2046
2047
|
async function t(t) {
|
|
2047
2048
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2048
2049
|
}
|
|
@@ -2061,31 +2062,33 @@ function Gi(e) {
|
|
|
2061
2062
|
}
|
|
2062
2063
|
//#endregion
|
|
2063
2064
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2064
|
-
|
|
2065
|
-
|
|
2065
|
+
var qi = Date.now();
|
|
2066
|
+
function Ji(e) {
|
|
2067
|
+
let t = [];
|
|
2068
|
+
function n() {
|
|
2066
2069
|
e.onPrint?.(), window.print();
|
|
2067
2070
|
}
|
|
2068
|
-
async function
|
|
2071
|
+
async function r(t) {
|
|
2069
2072
|
let n = await e.save(t);
|
|
2070
2073
|
if (!n) return null;
|
|
2071
2074
|
let r = await n.arrayBuffer();
|
|
2072
2075
|
return e.clearCommentsDirty(), e.onSave?.(r), r;
|
|
2073
2076
|
}
|
|
2074
|
-
function
|
|
2077
|
+
function i(t, n) {
|
|
2075
2078
|
let r = e.pagesRef.value;
|
|
2076
2079
|
if (!r) return !1;
|
|
2077
|
-
let i =
|
|
2080
|
+
let i = $t(r, t), a = i.at(0);
|
|
2078
2081
|
return a ? (a.scrollIntoView({
|
|
2079
2082
|
block: "center",
|
|
2080
2083
|
behavior: "smooth"
|
|
2081
|
-
}), n?.highlight &&
|
|
2084
|
+
}), n?.highlight && en(i, n.highlight), !0) : !1;
|
|
2082
2085
|
}
|
|
2083
|
-
function
|
|
2086
|
+
function a() {
|
|
2084
2087
|
return e.zoom.value;
|
|
2085
2088
|
}
|
|
2086
|
-
let
|
|
2087
|
-
function
|
|
2088
|
-
return
|
|
2089
|
+
let o = null;
|
|
2090
|
+
function s() {
|
|
2091
|
+
return o ??= {
|
|
2089
2092
|
getEditor: () => e.editor,
|
|
2090
2093
|
getDocument: () => e.editor.getDocument(),
|
|
2091
2094
|
getState: () => e.editor.getState(),
|
|
@@ -2104,26 +2107,26 @@ function Ki(e) {
|
|
|
2104
2107
|
getLayout: () => e.editor.getLayout(),
|
|
2105
2108
|
relayout: () => e.editor.relayout(),
|
|
2106
2109
|
scrollToPosition: (t) => e.scrollVisiblePositionIntoView(t),
|
|
2107
|
-
scrollToPage:
|
|
2108
|
-
scrollToParaId:
|
|
2110
|
+
scrollToPage: u,
|
|
2111
|
+
scrollToParaId: i,
|
|
2109
2112
|
getPageNumberForPmPos: (t) => {
|
|
2110
2113
|
let n = e.layout.value;
|
|
2111
2114
|
if (!n) return null;
|
|
2112
|
-
let r =
|
|
2115
|
+
let r = Qt(n, t);
|
|
2113
2116
|
return r == null ? null : r + 1;
|
|
2114
2117
|
}
|
|
2115
|
-
},
|
|
2118
|
+
}, o;
|
|
2116
2119
|
}
|
|
2117
|
-
function
|
|
2120
|
+
function c() {
|
|
2118
2121
|
return e.layout.value?.pages.length ?? 0;
|
|
2119
2122
|
}
|
|
2120
|
-
function
|
|
2123
|
+
function l() {
|
|
2121
2124
|
let t = e.layout.value, n = e.editorView.value;
|
|
2122
2125
|
if (!t || !n) return 0;
|
|
2123
|
-
let r =
|
|
2126
|
+
let r = Qt(t, n.state.selection.from);
|
|
2124
2127
|
return r == null ? 0 : r + 1;
|
|
2125
2128
|
}
|
|
2126
|
-
function
|
|
2129
|
+
function u(t) {
|
|
2127
2130
|
if (!Number.isInteger(t) || t < 1) return;
|
|
2128
2131
|
let n = e.pagesViewportRef.value, r = e.pagesRef.value?.querySelector(`[data-page-number="${t}"]`);
|
|
2129
2132
|
if (!n || !r) return;
|
|
@@ -2136,55 +2139,99 @@ function Ki(e) {
|
|
|
2136
2139
|
return { exposed: {
|
|
2137
2140
|
getDocument: e.getDocument,
|
|
2138
2141
|
hasPendingChanges: () => e.editorView.value ? e.isDirty.value || e.commentsDirty.value : !1,
|
|
2139
|
-
getEditorRef:
|
|
2142
|
+
getEditorRef: s,
|
|
2140
2143
|
getEditor: () => e.editor,
|
|
2141
|
-
save:
|
|
2144
|
+
save: r,
|
|
2142
2145
|
setZoom: e.setZoom,
|
|
2143
|
-
getZoom:
|
|
2146
|
+
getZoom: a,
|
|
2144
2147
|
focus: e.focus,
|
|
2145
|
-
getCurrentPage:
|
|
2146
|
-
getTotalPages:
|
|
2147
|
-
scrollToPage:
|
|
2148
|
-
scrollToParaId:
|
|
2149
|
-
openPrintPreview: () =>
|
|
2150
|
-
print:
|
|
2148
|
+
getCurrentPage: l,
|
|
2149
|
+
getTotalPages: c,
|
|
2150
|
+
scrollToPage: u,
|
|
2151
|
+
scrollToParaId: i,
|
|
2152
|
+
openPrintPreview: () => n(),
|
|
2153
|
+
print: n,
|
|
2151
2154
|
loadDocument: e.loadDocument,
|
|
2152
2155
|
loadDocumentBuffer: e.loadDocumentBuffer,
|
|
2153
2156
|
ensureEditorView: () => e.editor.ensureView(),
|
|
2154
2157
|
createAIEditSnapshot: () => {
|
|
2155
2158
|
let t = e.editorView.value;
|
|
2156
|
-
return t ?
|
|
2159
|
+
return t ? Gt(t.state.doc) : null;
|
|
2157
2160
|
},
|
|
2158
|
-
applyDocumentOperations: ({ snapshot:
|
|
2159
|
-
|
|
2160
|
-
let
|
|
2161
|
-
if (!
|
|
2161
|
+
applyDocumentOperations: ({ snapshot: n, batch: r, author: i = e.author() }) => {
|
|
2162
|
+
Ut(r.version);
|
|
2163
|
+
let a = e.editorView.value;
|
|
2164
|
+
if (!a) {
|
|
2162
2165
|
let e = "committed";
|
|
2163
|
-
|
|
2164
|
-
let t =
|
|
2166
|
+
r.dryRun === !0 ? e = "previewed" : r.atomic === !0 && (e = "rejected");
|
|
2167
|
+
let t = r.operations.map((e) => ({
|
|
2165
2168
|
id: e.id,
|
|
2166
2169
|
reason: "unsupportedBlock"
|
|
2167
2170
|
}));
|
|
2168
2171
|
return {
|
|
2169
|
-
version:
|
|
2172
|
+
version: $,
|
|
2170
2173
|
status: e,
|
|
2171
2174
|
applied: [],
|
|
2172
2175
|
skipped: t,
|
|
2173
|
-
issues:
|
|
2174
|
-
receipts: []
|
|
2176
|
+
issues: Jt(r.operations, t),
|
|
2177
|
+
receipts: [],
|
|
2178
|
+
undoHandle: null
|
|
2175
2179
|
};
|
|
2176
2180
|
}
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2181
|
+
let o = t.at(-1);
|
|
2182
|
+
o && (!a.state.doc.eq(o.afterState.doc) || e.getComments() !== o.commentsAfter) && (t.length = 0);
|
|
2183
|
+
let s = e.getComments(), c = {
|
|
2184
|
+
state: a.state,
|
|
2185
|
+
dispatch: (e) => {
|
|
2186
|
+
a.dispatch(xt(e)), c.state = a.state;
|
|
2187
|
+
}
|
|
2188
|
+
}, l = Ht({
|
|
2189
|
+
view: c,
|
|
2190
|
+
snapshot: n,
|
|
2191
|
+
batch: r,
|
|
2192
|
+
author: i,
|
|
2193
|
+
createCommentId: e.createAIEditComment,
|
|
2194
|
+
createUndoHandle: () => ({
|
|
2195
|
+
type: "documentOperationUndo",
|
|
2196
|
+
id: `vue-${String(qi++)}`
|
|
2197
|
+
})
|
|
2198
|
+
});
|
|
2199
|
+
return l.undoHandle !== null && t.push({
|
|
2200
|
+
undoHandle: l.undoHandle,
|
|
2201
|
+
afterState: a.state,
|
|
2202
|
+
commentsBefore: s,
|
|
2203
|
+
commentsAfter: e.getComments()
|
|
2204
|
+
}), l;
|
|
2205
|
+
},
|
|
2206
|
+
undoDocumentOperations: (n) => {
|
|
2207
|
+
let r = t.findIndex((e) => e.undoHandle.type === n.type && e.undoHandle.id === n.id);
|
|
2208
|
+
if (r === -1) return {
|
|
2209
|
+
status: "rejected",
|
|
2210
|
+
undoHandle: n,
|
|
2211
|
+
reason: "unknownHandle"
|
|
2212
|
+
};
|
|
2213
|
+
if (r !== t.length - 1) return {
|
|
2214
|
+
status: "rejected",
|
|
2215
|
+
undoHandle: n,
|
|
2216
|
+
reason: "notLatest"
|
|
2217
|
+
};
|
|
2218
|
+
let i = t.at(-1), a = e.editorView.value;
|
|
2219
|
+
return !i || !a ? {
|
|
2220
|
+
status: "rejected",
|
|
2221
|
+
undoHandle: n,
|
|
2222
|
+
reason: "unknownHandle"
|
|
2223
|
+
} : !a.state.doc.eq(i.afterState.doc) || e.getComments() !== i.commentsAfter || !e.editor.undo() ? {
|
|
2224
|
+
status: "rejected",
|
|
2225
|
+
undoHandle: n,
|
|
2226
|
+
reason: "documentChanged"
|
|
2227
|
+
} : (e.setComments(i.commentsBefore), t.pop(), {
|
|
2228
|
+
status: "undone",
|
|
2229
|
+
undoHandle: n
|
|
2183
2230
|
});
|
|
2184
2231
|
},
|
|
2185
2232
|
applyAIEditOperations: ({ snapshot: t, operations: n, mode: r = "tracked-changes", author: i = e.author() }) => {
|
|
2186
2233
|
let a = e.editorView.value;
|
|
2187
|
-
return a ?
|
|
2234
|
+
return a ? Vt({
|
|
2188
2235
|
view: a,
|
|
2189
2236
|
snapshot: t,
|
|
2190
2237
|
operations: n,
|
|
@@ -2201,26 +2248,26 @@ function Ki(e) {
|
|
|
2201
2248
|
},
|
|
2202
2249
|
acceptAIEditOperation: (t) => {
|
|
2203
2250
|
let n = e.editorView.value;
|
|
2204
|
-
return n ?
|
|
2251
|
+
return n ? kt(t)(n.state, n.dispatch) : !1;
|
|
2205
2252
|
},
|
|
2206
2253
|
rejectAIEditOperation: (t) => {
|
|
2207
2254
|
let n = e.editorView.value;
|
|
2208
|
-
return n ?
|
|
2255
|
+
return n ? Mt(t)(n.state, n.dispatch) : !1;
|
|
2209
2256
|
},
|
|
2210
2257
|
undo: () => e.editor.undo(),
|
|
2211
2258
|
redo: () => e.editor.redo(),
|
|
2212
2259
|
scrollToAIEditOperation: (t) => {
|
|
2213
2260
|
let n = e.editorView.value;
|
|
2214
2261
|
if (!n) return !1;
|
|
2215
|
-
let r =
|
|
2262
|
+
let r = jt(n.state, t);
|
|
2216
2263
|
if (!r) return !1;
|
|
2217
|
-
let { from: i, to: a } =
|
|
2264
|
+
let { from: i, to: a } = ln(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2218
2265
|
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2219
2266
|
},
|
|
2220
2267
|
scrollToBlock: (t, n) => {
|
|
2221
2268
|
let r = e.editorView.value;
|
|
2222
2269
|
if (!r) return !1;
|
|
2223
|
-
let i =
|
|
2270
|
+
let i = un({
|
|
2224
2271
|
blockId: t,
|
|
2225
2272
|
doc: r.state.doc,
|
|
2226
2273
|
snapshot: n
|
|
@@ -2231,11 +2278,11 @@ function Ki(e) {
|
|
|
2231
2278
|
},
|
|
2232
2279
|
getTrackedChanges: () => {
|
|
2233
2280
|
let t = e.editorView.value;
|
|
2234
|
-
return t ?
|
|
2281
|
+
return t ? Yt(t.state.doc) : [];
|
|
2235
2282
|
},
|
|
2236
2283
|
getCommentAnchors: () => {
|
|
2237
2284
|
let t = e.editorView.value;
|
|
2238
|
-
return t ?
|
|
2285
|
+
return t ? qt(t.state.doc) : [];
|
|
2239
2286
|
},
|
|
2240
2287
|
getSelectionText: () => {
|
|
2241
2288
|
let t = e.editorView.value;
|
|
@@ -2243,12 +2290,12 @@ function Ki(e) {
|
|
|
2243
2290
|
},
|
|
2244
2291
|
getPageText: (t) => {
|
|
2245
2292
|
let n = e.editorView.value;
|
|
2246
|
-
return n ?
|
|
2293
|
+
return n ? dn(e.layout.value, n.state.doc, t) : null;
|
|
2247
2294
|
},
|
|
2248
2295
|
getContentControls: (t = {}) => {
|
|
2249
2296
|
let n = e.editorView.value;
|
|
2250
|
-
return n ?
|
|
2251
|
-
properties:
|
|
2297
|
+
return n ? rn(n.state.doc, t).map((e) => ({
|
|
2298
|
+
properties: tn(e.node),
|
|
2252
2299
|
path: e.path,
|
|
2253
2300
|
pmPos: e.pos
|
|
2254
2301
|
})) : [];
|
|
@@ -2256,7 +2303,7 @@ function Ki(e) {
|
|
|
2256
2303
|
scrollToContentControl: (t) => {
|
|
2257
2304
|
let n = e.editorView.value;
|
|
2258
2305
|
if (!n) return !1;
|
|
2259
|
-
let r =
|
|
2306
|
+
let r = nn(n.state.doc, t);
|
|
2260
2307
|
if (!r) return !1;
|
|
2261
2308
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
2262
2309
|
return n.dispatch(n.state.tr.setSelection(Z.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
@@ -2264,52 +2311,52 @@ function Ki(e) {
|
|
|
2264
2311
|
setContentControlContent: (t, n, r = {}) => {
|
|
2265
2312
|
let i = e.editorView.value;
|
|
2266
2313
|
if (!i) return !1;
|
|
2267
|
-
let a = typeof n == "string" ?
|
|
2314
|
+
let a = typeof n == "string" ? on(i.state, t, n, r) : cn(i.state, t, n, r);
|
|
2268
2315
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2269
2316
|
},
|
|
2270
2317
|
setContentControlValue: (t, n, r = {}) => {
|
|
2271
2318
|
let i = e.editorView.value;
|
|
2272
2319
|
if (!i) return !1;
|
|
2273
|
-
let a =
|
|
2320
|
+
let a = sn(i.state, t, n, r);
|
|
2274
2321
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2275
2322
|
},
|
|
2276
2323
|
removeContentControl: (t, n = {}) => {
|
|
2277
2324
|
let r = e.editorView.value;
|
|
2278
2325
|
if (!r) return !1;
|
|
2279
|
-
let i =
|
|
2326
|
+
let i = an(r.state, t, n);
|
|
2280
2327
|
return i ? (r.dispatch(i), !0) : !1;
|
|
2281
2328
|
}
|
|
2282
2329
|
} };
|
|
2283
2330
|
}
|
|
2284
2331
|
//#endregion
|
|
2285
2332
|
//#region src/composables/useFormattingActions.ts
|
|
2286
|
-
function
|
|
2333
|
+
function Yi(e) {
|
|
2287
2334
|
let t = () => e.activeView?.value ?? e.editorView.value;
|
|
2288
2335
|
function n() {
|
|
2289
2336
|
let e = t();
|
|
2290
|
-
e && (
|
|
2337
|
+
e && (St(e.state, e.dispatch, e), e.focus());
|
|
2291
2338
|
}
|
|
2292
2339
|
function r(n) {
|
|
2293
2340
|
let r = t();
|
|
2294
2341
|
if (!r) return;
|
|
2295
2342
|
let i = e.getDocument(), a = i?.package?.styles;
|
|
2296
2343
|
if (a) {
|
|
2297
|
-
let e = ke(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ?
|
|
2298
|
-
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting),
|
|
2299
|
-
} else
|
|
2344
|
+
let e = ke(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ? _n(i.package.numbering) : null };
|
|
2345
|
+
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting), fn(n, t)(r.state, (e) => r.dispatch(e));
|
|
2346
|
+
} else fn(n)(r.state, (e) => r.dispatch(e));
|
|
2300
2347
|
r.focus();
|
|
2301
2348
|
}
|
|
2302
2349
|
function i() {
|
|
2303
2350
|
let t = e.editorView.value;
|
|
2304
|
-
t && (
|
|
2351
|
+
t && (vn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2305
2352
|
}
|
|
2306
2353
|
function a() {
|
|
2307
2354
|
let t = e.editorView.value;
|
|
2308
|
-
t && (
|
|
2355
|
+
t && (bn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2309
2356
|
}
|
|
2310
2357
|
function o() {
|
|
2311
2358
|
let t = e.editorView.value;
|
|
2312
|
-
t && (
|
|
2359
|
+
t && (yn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2313
2360
|
}
|
|
2314
2361
|
function s(e) {
|
|
2315
2362
|
let n = t();
|
|
@@ -2328,7 +2375,7 @@ function qi(e) {
|
|
|
2328
2375
|
}
|
|
2329
2376
|
//#endregion
|
|
2330
2377
|
//#region src/composables/useHyperlinkManagement.ts
|
|
2331
|
-
function
|
|
2378
|
+
function Xi(e) {
|
|
2332
2379
|
let t = W(null);
|
|
2333
2380
|
function n(e, t) {
|
|
2334
2381
|
t(e.state, (t) => e.dispatch(t), e);
|
|
@@ -2359,14 +2406,14 @@ function Ji(e) {
|
|
|
2359
2406
|
}
|
|
2360
2407
|
function o(n, r) {
|
|
2361
2408
|
let i = e.editorView.value;
|
|
2362
|
-
i && (
|
|
2409
|
+
i && (xn(i, {
|
|
2363
2410
|
displayText: n,
|
|
2364
2411
|
href: r
|
|
2365
2412
|
}), t.value = null, i.focus());
|
|
2366
2413
|
}
|
|
2367
2414
|
function s() {
|
|
2368
2415
|
let n = e.editorView.value;
|
|
2369
|
-
n && (
|
|
2416
|
+
n && (Sn(n, { popupHref: t.value?.href }), t.value = null, n.focus());
|
|
2370
2417
|
}
|
|
2371
2418
|
return {
|
|
2372
2419
|
hyperlinkPopupData: t,
|
|
@@ -2379,7 +2426,7 @@ function Ji(e) {
|
|
|
2379
2426
|
}
|
|
2380
2427
|
//#endregion
|
|
2381
2428
|
//#region src/composables/useImageActions.ts
|
|
2382
|
-
function
|
|
2429
|
+
function Zi(e) {
|
|
2383
2430
|
let t = we(null), n = W(!1), r = N(() => {
|
|
2384
2431
|
e.stateTick.value;
|
|
2385
2432
|
let n = e.editorView.value, r = t.value;
|
|
@@ -2429,7 +2476,7 @@ function Yi(e) {
|
|
|
2429
2476
|
}
|
|
2430
2477
|
//#endregion
|
|
2431
2478
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
2432
|
-
function
|
|
2479
|
+
function Qi(e) {
|
|
2433
2480
|
function t(t) {
|
|
2434
2481
|
if (t.key === "F1") {
|
|
2435
2482
|
t.preventDefault(), e.showKeyboardShortcuts.value = !0;
|
|
@@ -2448,10 +2495,10 @@ function Xi(e) {
|
|
|
2448
2495
|
}
|
|
2449
2496
|
//#endregion
|
|
2450
2497
|
//#region src/composables/useOutlineSidebar.ts
|
|
2451
|
-
function
|
|
2498
|
+
function $i(e) {
|
|
2452
2499
|
function t() {
|
|
2453
2500
|
let t = e.editorView.value;
|
|
2454
|
-
t && (e.outlineHeadings.value =
|
|
2501
|
+
t && (e.outlineHeadings.value = Cn(t.state.doc));
|
|
2455
2502
|
}
|
|
2456
2503
|
function n() {
|
|
2457
2504
|
e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
|
|
@@ -2482,7 +2529,7 @@ function Zi(e) {
|
|
|
2482
2529
|
}
|
|
2483
2530
|
//#endregion
|
|
2484
2531
|
//#region src/composables/usePageSetupControls.ts
|
|
2485
|
-
function
|
|
2532
|
+
function ea(e) {
|
|
2486
2533
|
function t(t) {
|
|
2487
2534
|
let n = e.getDocument();
|
|
2488
2535
|
if (!n?.package?.document) return;
|
|
@@ -2509,19 +2556,19 @@ function Qi(e) {
|
|
|
2509
2556
|
}
|
|
2510
2557
|
function s(t) {
|
|
2511
2558
|
let n = e.editorView.value;
|
|
2512
|
-
n &&
|
|
2559
|
+
n && hn(t)(n.state, n.dispatch);
|
|
2513
2560
|
}
|
|
2514
2561
|
function c(t) {
|
|
2515
2562
|
let n = e.editorView.value;
|
|
2516
|
-
n &&
|
|
2563
|
+
n && gn(t)(n.state, n.dispatch);
|
|
2517
2564
|
}
|
|
2518
2565
|
function l(t) {
|
|
2519
2566
|
let n = e.editorView.value;
|
|
2520
|
-
n && (t < 0 ?
|
|
2567
|
+
n && (t < 0 ? mn(-t, !0)(n.state, n.dispatch) : mn(t, !1)(n.state, n.dispatch));
|
|
2521
2568
|
}
|
|
2522
2569
|
function u(t) {
|
|
2523
2570
|
let n = e.editorView.value;
|
|
2524
|
-
n &&
|
|
2571
|
+
n && pn(t)(n.state, n.dispatch);
|
|
2525
2572
|
}
|
|
2526
2573
|
return {
|
|
2527
2574
|
handlePageSetupApply: t,
|
|
@@ -2537,34 +2584,34 @@ function Qi(e) {
|
|
|
2537
2584
|
}
|
|
2538
2585
|
//#endregion
|
|
2539
2586
|
//#region src/utils/textSelection.ts
|
|
2540
|
-
var
|
|
2541
|
-
function
|
|
2542
|
-
return !e || e.length === 0 ? !1 :
|
|
2587
|
+
var ta = /[\p{L}\p{N}\p{M}_''-]/u, na = /\s/;
|
|
2588
|
+
function ra(e) {
|
|
2589
|
+
return !e || e.length === 0 ? !1 : ta.test(e);
|
|
2543
2590
|
}
|
|
2544
|
-
function
|
|
2545
|
-
return !e || e.length === 0 ? !1 :
|
|
2591
|
+
function ia(e) {
|
|
2592
|
+
return !e || e.length === 0 ? !1 : na.test(e);
|
|
2546
2593
|
}
|
|
2547
|
-
function
|
|
2594
|
+
function aa(e, t) {
|
|
2548
2595
|
if (!e || e.length === 0) return [0, 0];
|
|
2549
2596
|
t = Math.max(0, Math.min(t, e.length - 1));
|
|
2550
2597
|
let n = e[t];
|
|
2551
|
-
if (
|
|
2598
|
+
if (ia(n)) {
|
|
2552
2599
|
let n = t, r = t;
|
|
2553
|
-
for (; n > 0 &&
|
|
2554
|
-
for (; r < e.length &&
|
|
2600
|
+
for (; n > 0 && ia(e[n - 1]);) n--;
|
|
2601
|
+
for (; r < e.length && ia(e[r]);) r++;
|
|
2555
2602
|
return [n, r];
|
|
2556
2603
|
}
|
|
2557
|
-
if (
|
|
2604
|
+
if (ra(n)) {
|
|
2558
2605
|
let n = t, r = t;
|
|
2559
|
-
for (; n > 0 &&
|
|
2560
|
-
for (; r < e.length &&
|
|
2606
|
+
for (; n > 0 && ra(e[n - 1]);) n--;
|
|
2607
|
+
for (; r < e.length && ra(e[r]);) r++;
|
|
2561
2608
|
return [n, r];
|
|
2562
2609
|
}
|
|
2563
2610
|
return [t, t + 1];
|
|
2564
2611
|
}
|
|
2565
2612
|
//#endregion
|
|
2566
2613
|
//#region src/utils/domQueries.ts
|
|
2567
|
-
function
|
|
2614
|
+
function oa(e, t, n) {
|
|
2568
2615
|
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : _t(e);
|
|
2569
2616
|
for (let e of r) {
|
|
2570
2617
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
@@ -2572,7 +2619,7 @@ function ia(e, t, n) {
|
|
|
2572
2619
|
}
|
|
2573
2620
|
return null;
|
|
2574
2621
|
}
|
|
2575
|
-
function
|
|
2622
|
+
function sa(e, t, n) {
|
|
2576
2623
|
if (!e || !t) return;
|
|
2577
2624
|
let r = gt(e, n);
|
|
2578
2625
|
if (!r) for (let t of _t(e)) {
|
|
@@ -2589,21 +2636,21 @@ function aa(e, t, n) {
|
|
|
2589
2636
|
behavior: "smooth"
|
|
2590
2637
|
});
|
|
2591
2638
|
}
|
|
2592
|
-
function
|
|
2639
|
+
function ca(e, t, n, r) {
|
|
2593
2640
|
if (!e || !t) return null;
|
|
2594
2641
|
let i = ut(e, n, r, 1);
|
|
2595
2642
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
2596
2643
|
}
|
|
2597
|
-
function
|
|
2644
|
+
function la(e, t, n, r) {
|
|
2598
2645
|
if (!e) return;
|
|
2599
|
-
let i =
|
|
2646
|
+
let i = oa(e, t, r);
|
|
2600
2647
|
if (!i) return;
|
|
2601
|
-
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] =
|
|
2648
|
+
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = aa(a, t - o), l = o + s, u = o + c;
|
|
2602
2649
|
l < u && n(l, u);
|
|
2603
2650
|
}
|
|
2604
|
-
function
|
|
2651
|
+
function ua(e, t, n, r) {
|
|
2605
2652
|
if (!e) return;
|
|
2606
|
-
let i =
|
|
2653
|
+
let i = oa(e, t, r);
|
|
2607
2654
|
if (!i) return;
|
|
2608
2655
|
let a = i.closest(".layout-paragraph");
|
|
2609
2656
|
if (!a) return;
|
|
@@ -2612,13 +2659,13 @@ function ca(e, t, n, r) {
|
|
|
2612
2659
|
}
|
|
2613
2660
|
//#endregion
|
|
2614
2661
|
//#region src/composables/usePagesPointer.ts
|
|
2615
|
-
var
|
|
2616
|
-
function
|
|
2662
|
+
var da = 500;
|
|
2663
|
+
function fa(e) {
|
|
2617
2664
|
let t = W(null), n = null;
|
|
2618
2665
|
function r() {
|
|
2619
2666
|
n !== null && (clearTimeout(n), n = null);
|
|
2620
2667
|
}
|
|
2621
|
-
let i = we(null), a = 0, o = null, s = 0, c = !1, l = null, u =
|
|
2668
|
+
let i = we(null), a = 0, o = null, s = 0, c = !1, l = null, u = En(), d = re({
|
|
2622
2669
|
pagesContainer: e.pagesRef,
|
|
2623
2670
|
onScrollExtendSelection: (e, t) => {
|
|
2624
2671
|
if (!c || l === null) return;
|
|
@@ -2631,7 +2678,7 @@ function ua(e) {
|
|
|
2631
2678
|
visible: !1
|
|
2632
2679
|
}), p = null;
|
|
2633
2680
|
function m(t, n) {
|
|
2634
|
-
return
|
|
2681
|
+
return ca(e.pagesRef.value, e.editorView.value, t, n);
|
|
2635
2682
|
}
|
|
2636
2683
|
function h() {
|
|
2637
2684
|
let t = i.value;
|
|
@@ -2649,13 +2696,13 @@ function ua(e) {
|
|
|
2649
2696
|
} catch {}
|
|
2650
2697
|
}
|
|
2651
2698
|
function _(t) {
|
|
2652
|
-
|
|
2699
|
+
sa(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2653
2700
|
}
|
|
2654
2701
|
function v(t) {
|
|
2655
|
-
|
|
2702
|
+
la(e.pagesRef.value, t, g, i.value?.position);
|
|
2656
2703
|
}
|
|
2657
2704
|
function y(t) {
|
|
2658
|
-
|
|
2705
|
+
ua(e.pagesRef.value, t, g, i.value?.position);
|
|
2659
2706
|
}
|
|
2660
2707
|
function b(t) {
|
|
2661
2708
|
let n = e.editorView.value;
|
|
@@ -2684,7 +2731,7 @@ function ua(e) {
|
|
|
2684
2731
|
if (!o) return;
|
|
2685
2732
|
let s = e.pagesViewportRef.value;
|
|
2686
2733
|
if (!s || !(a.target instanceof HTMLElement)) return;
|
|
2687
|
-
let l =
|
|
2734
|
+
let l = Tn({
|
|
2688
2735
|
mouseX: a.clientX,
|
|
2689
2736
|
mouseY: a.clientY,
|
|
2690
2737
|
pagesContainer: o,
|
|
@@ -2694,7 +2741,7 @@ function ua(e) {
|
|
|
2694
2741
|
if (!l) {
|
|
2695
2742
|
n === null && (n = setTimeout(() => {
|
|
2696
2743
|
t.value = null, n = null;
|
|
2697
|
-
},
|
|
2744
|
+
}, wn));
|
|
2698
2745
|
return;
|
|
2699
2746
|
}
|
|
2700
2747
|
let u = e.zoom.value || 1, d = s.getBoundingClientRect();
|
|
@@ -2705,7 +2752,7 @@ function ua(e) {
|
|
|
2705
2752
|
cellPmPos: l.cellPmPos
|
|
2706
2753
|
}, r();
|
|
2707
2754
|
}
|
|
2708
|
-
function
|
|
2755
|
+
function ee(n) {
|
|
2709
2756
|
n.preventDefault(), n.stopPropagation();
|
|
2710
2757
|
let r = t.value, i = e.editorView.value;
|
|
2711
2758
|
if (!r || !i) return;
|
|
@@ -2714,7 +2761,7 @@ function ua(e) {
|
|
|
2714
2761
|
let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow : o.addColumnRight;
|
|
2715
2762
|
s && (s()(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
|
|
2716
2763
|
}
|
|
2717
|
-
function
|
|
2764
|
+
function S(t) {
|
|
2718
2765
|
let n = t.target, r = n instanceof HTMLElement ? n.closest("a[href]") : null;
|
|
2719
2766
|
if (!r) return;
|
|
2720
2767
|
t.preventDefault();
|
|
@@ -2739,7 +2786,7 @@ function ua(e) {
|
|
|
2739
2786
|
...l ? { tooltip: l } : {}
|
|
2740
2787
|
};
|
|
2741
2788
|
}
|
|
2742
|
-
function
|
|
2789
|
+
function te(t) {
|
|
2743
2790
|
if (!(t.target instanceof HTMLElement)) return;
|
|
2744
2791
|
let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
|
|
2745
2792
|
if (!o) return;
|
|
@@ -2776,7 +2823,7 @@ function ua(e) {
|
|
|
2776
2823
|
}, y = c.package.document, b = y?.sections?.map((e, t) => t === 0 ? {
|
|
2777
2824
|
...e,
|
|
2778
2825
|
properties: v
|
|
2779
|
-
} : e), x = y?.finalSectionProperties === l ? v : y?.finalSectionProperties,
|
|
2826
|
+
} : e), x = y?.finalSectionProperties === l ? v : y?.finalSectionProperties, ee = {
|
|
2780
2827
|
...c,
|
|
2781
2828
|
package: {
|
|
2782
2829
|
...c.package,
|
|
@@ -2789,7 +2836,7 @@ function ua(e) {
|
|
|
2789
2836
|
}
|
|
2790
2837
|
}
|
|
2791
2838
|
};
|
|
2792
|
-
f = n, p = r, e.setDocument?.(
|
|
2839
|
+
f = n, p = r, e.setDocument?.(ee), e.syncHfPMs?.(), e.reLayout(), e.emit("change", ee);
|
|
2793
2840
|
}
|
|
2794
2841
|
let m = e.pagesViewportRef.value;
|
|
2795
2842
|
if (!m) return;
|
|
@@ -2806,7 +2853,7 @@ function ua(e) {
|
|
|
2806
2853
|
}
|
|
2807
2854
|
};
|
|
2808
2855
|
}
|
|
2809
|
-
function
|
|
2856
|
+
function ne(t) {
|
|
2810
2857
|
let n = e.getDocument(), r = i.value;
|
|
2811
2858
|
if (!n?.package || !r) return;
|
|
2812
2859
|
let a = r.position === "header" ? n.package.headers : n.package.footers;
|
|
@@ -2814,7 +2861,7 @@ function ua(e) {
|
|
|
2814
2861
|
let o = a.get(r.rId);
|
|
2815
2862
|
o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
|
|
2816
2863
|
}
|
|
2817
|
-
function
|
|
2864
|
+
function ie() {
|
|
2818
2865
|
let t = e.getDocument(), n = i.value;
|
|
2819
2866
|
if (!t?.package || !n || !n.rId) {
|
|
2820
2867
|
i.value = null;
|
|
@@ -2846,7 +2893,7 @@ function ua(e) {
|
|
|
2846
2893
|
};
|
|
2847
2894
|
i.value = null, e.setDocument?.(p), e.syncHfPMs?.(), e.reLayout(), e.emit("change", p);
|
|
2848
2895
|
}
|
|
2849
|
-
function
|
|
2896
|
+
function C(t) {
|
|
2850
2897
|
if (t.button !== 0 || e.imageInteracting.value) return;
|
|
2851
2898
|
let n = e.editorView.value;
|
|
2852
2899
|
if (!n) return;
|
|
@@ -2879,15 +2926,15 @@ function ua(e) {
|
|
|
2879
2926
|
return;
|
|
2880
2927
|
}
|
|
2881
2928
|
let b = Date.now();
|
|
2882
|
-
if (b - a <
|
|
2929
|
+
if (b - a < da && o === _ ? s++ : s = 1, a = b, o = _, s === 2) v(_);
|
|
2883
2930
|
else if (s >= 3) y(_), s = 0;
|
|
2884
2931
|
else if (t.shiftKey) {
|
|
2885
2932
|
let { from: e } = f.state.selection;
|
|
2886
2933
|
g(e, _);
|
|
2887
|
-
} else g(_), l = _, c = !0, u.begin(
|
|
2934
|
+
} else g(_), l = _, c = !0, u.begin(Dn(f, _));
|
|
2888
2935
|
f.focus();
|
|
2889
2936
|
}
|
|
2890
|
-
function
|
|
2937
|
+
function ae(e) {
|
|
2891
2938
|
if (!c || l === null) return;
|
|
2892
2939
|
let t = m(e.clientX, e.clientY);
|
|
2893
2940
|
if (t !== null) {
|
|
@@ -2900,10 +2947,10 @@ function ua(e) {
|
|
|
2900
2947
|
}
|
|
2901
2948
|
d.updateMousePosition(e.clientX, e.clientY);
|
|
2902
2949
|
}
|
|
2903
|
-
function
|
|
2950
|
+
function oe() {
|
|
2904
2951
|
c = !1, u.end(), d.stopAutoScroll();
|
|
2905
2952
|
}
|
|
2906
|
-
function
|
|
2953
|
+
function w() {
|
|
2907
2954
|
let t = e.pagesViewportRef.value, n = e.layout.value;
|
|
2908
2955
|
if (!t || !n || n.pages.length === 0) return;
|
|
2909
2956
|
let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
|
|
@@ -2929,9 +2976,9 @@ function ua(e) {
|
|
|
2929
2976
|
}, 600);
|
|
2930
2977
|
}
|
|
2931
2978
|
return xe(() => {
|
|
2932
|
-
window.addEventListener("mousemove",
|
|
2979
|
+
window.addEventListener("mousemove", ae), window.addEventListener("mouseup", oe), e.pagesViewportRef.value?.addEventListener("scroll", w, { passive: !0 });
|
|
2933
2980
|
}), be(() => {
|
|
2934
|
-
r(), window.removeEventListener("mousemove",
|
|
2981
|
+
r(), window.removeEventListener("mousemove", ae), window.removeEventListener("mouseup", oe), e.pagesViewportRef.value?.removeEventListener("scroll", w), p && clearTimeout(p);
|
|
2935
2982
|
}), {
|
|
2936
2983
|
tableInsertButton: t,
|
|
2937
2984
|
hfEdit: i,
|
|
@@ -2940,29 +2987,29 @@ function ua(e) {
|
|
|
2940
2987
|
setPmSelection: g,
|
|
2941
2988
|
scrollVisiblePositionIntoView: _,
|
|
2942
2989
|
navigateToBookmark: b,
|
|
2943
|
-
handlePagesMouseDown:
|
|
2990
|
+
handlePagesMouseDown: C,
|
|
2944
2991
|
handlePagesMouseMove: x,
|
|
2945
|
-
handlePagesClick:
|
|
2946
|
-
handlePagesDoubleClick:
|
|
2947
|
-
handleTableInsertClick:
|
|
2992
|
+
handlePagesClick: S,
|
|
2993
|
+
handlePagesDoubleClick: te,
|
|
2994
|
+
handleTableInsertClick: ee,
|
|
2948
2995
|
clearTableInsertTimer: r,
|
|
2949
|
-
handleHfSave:
|
|
2950
|
-
handleHfRemove:
|
|
2996
|
+
handleHfSave: ne,
|
|
2997
|
+
handleHfRemove: ie
|
|
2951
2998
|
};
|
|
2952
2999
|
}
|
|
2953
3000
|
//#endregion
|
|
2954
3001
|
//#region src/utils/hostFonts.ts
|
|
2955
|
-
function
|
|
3002
|
+
function pa(e) {
|
|
2956
3003
|
return typeof e == "string" && e.trim().length > 0;
|
|
2957
3004
|
}
|
|
2958
|
-
function
|
|
2959
|
-
return typeof e != "object" || !e ? !1 :
|
|
3005
|
+
function ma(e) {
|
|
3006
|
+
return typeof e != "object" || !e ? !1 : pa(Reflect.get(e, "family")) && pa(Reflect.get(e, "src"));
|
|
2960
3007
|
}
|
|
2961
|
-
function
|
|
3008
|
+
function ha(e) {
|
|
2962
3009
|
if (!e) return [];
|
|
2963
3010
|
let t = [];
|
|
2964
3011
|
for (let n of e) {
|
|
2965
|
-
if (!
|
|
3012
|
+
if (!ma(n)) continue;
|
|
2966
3013
|
let e = { display: "swap" };
|
|
2967
3014
|
(typeof n.weight == "number" || typeof n.weight == "string") && (e.weight = String(n.weight)), t.push({
|
|
2968
3015
|
family: n.family.trim(),
|
|
@@ -2972,10 +3019,10 @@ function pa(e) {
|
|
|
2972
3019
|
}
|
|
2973
3020
|
return t;
|
|
2974
3021
|
}
|
|
2975
|
-
function
|
|
3022
|
+
function ga() {
|
|
2976
3023
|
return typeof document > "u" || !("fonts" in document) ? null : document.fonts;
|
|
2977
3024
|
}
|
|
2978
|
-
async function
|
|
3025
|
+
async function _a(e, t, n, r) {
|
|
2979
3026
|
let i;
|
|
2980
3027
|
try {
|
|
2981
3028
|
i = new FontFace(t, n, r), e.add(i);
|
|
@@ -2984,39 +3031,39 @@ async function ha(e, t, n, r) {
|
|
|
2984
3031
|
}
|
|
2985
3032
|
return await i.load().then(() => !0, () => !1) ? i : (e.delete(i), null);
|
|
2986
3033
|
}
|
|
2987
|
-
async function
|
|
2988
|
-
let t =
|
|
3034
|
+
async function va(e) {
|
|
3035
|
+
let t = ga();
|
|
2989
3036
|
if (!t) return [];
|
|
2990
|
-
let n =
|
|
3037
|
+
let n = ha(e);
|
|
2991
3038
|
if (n.length === 0) return [];
|
|
2992
3039
|
let r = [];
|
|
2993
3040
|
return await Promise.all(n.map(async ({ family: e, source: n, descriptors: i }) => {
|
|
2994
|
-
let a = await
|
|
3041
|
+
let a = await _a(t, e, n, i);
|
|
2995
3042
|
a && r.push(a);
|
|
2996
3043
|
})), r;
|
|
2997
3044
|
}
|
|
2998
|
-
function
|
|
2999
|
-
let t =
|
|
3045
|
+
function ya(e) {
|
|
3046
|
+
let t = ga();
|
|
3000
3047
|
if (t) for (let n of e) t.delete(n);
|
|
3001
3048
|
}
|
|
3002
3049
|
//#endregion
|
|
3003
3050
|
//#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
|
|
3004
|
-
var
|
|
3051
|
+
var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
3005
3052
|
key: 0,
|
|
3006
3053
|
class: "docx-editor-vue__error"
|
|
3007
|
-
},
|
|
3054
|
+
}, Sa = {
|
|
3008
3055
|
key: 1,
|
|
3009
3056
|
class: "docx-editor-vue__loading"
|
|
3010
|
-
},
|
|
3057
|
+
}, Ca = {
|
|
3011
3058
|
key: 2,
|
|
3012
3059
|
class: "docx-editor-vue__placeholder"
|
|
3013
|
-
},
|
|
3060
|
+
}, wa = { class: "docx-editor-vue__editor-area" }, Ta = {
|
|
3014
3061
|
key: 0,
|
|
3015
3062
|
class: "docx-editor-vue__ruler-h"
|
|
3016
|
-
},
|
|
3063
|
+
}, Ea = {
|
|
3017
3064
|
key: 1,
|
|
3018
3065
|
class: "docx-editor-vue__ruler-v"
|
|
3019
|
-
},
|
|
3066
|
+
}, Da = {
|
|
3020
3067
|
class: "docx-editor-vue__editor-content-wrapper",
|
|
3021
3068
|
style: {
|
|
3022
3069
|
position: "relative",
|
|
@@ -3024,11 +3071,11 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3024
3071
|
flexDirection: "column",
|
|
3025
3072
|
minHeight: "100%"
|
|
3026
3073
|
}
|
|
3027
|
-
},
|
|
3074
|
+
}, Oa = {
|
|
3028
3075
|
"data-testid": "selection-overlay",
|
|
3029
3076
|
class: "docx-editor-vue__decoration-origin",
|
|
3030
3077
|
"aria-hidden": "true"
|
|
3031
|
-
},
|
|
3078
|
+
}, ka = ["aria-label"], Aa = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
3032
3079
|
__name: "DocxEditor",
|
|
3033
3080
|
props: {
|
|
3034
3081
|
documentBuffer: { default: null },
|
|
@@ -3148,7 +3195,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3148
3195
|
],
|
|
3149
3196
|
setup(t, { expose: n, emit: a }) {
|
|
3150
3197
|
let o = t, s = a;
|
|
3151
|
-
e(), i(o.components),
|
|
3198
|
+
e(), i(o.components), Sr(W(!1));
|
|
3152
3199
|
let l = W(o.mode), u = N(() => o.readOnly || l.value === "viewing"), d = N(() => o.showReviewControls), f = N(() => ct(l.value)), p = W("all-markup");
|
|
3153
3200
|
function h() {
|
|
3154
3201
|
dn(lt(l.value));
|
|
@@ -3156,25 +3203,25 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3156
3203
|
function y(e) {
|
|
3157
3204
|
p.value = e;
|
|
3158
3205
|
}
|
|
3159
|
-
let b = N(() => p.value === "all-markup" ? "" : `folio-root--${p.value}`), { t: x } = c(),
|
|
3160
|
-
|
|
3161
|
-
let
|
|
3162
|
-
J(
|
|
3163
|
-
e || (
|
|
3206
|
+
let b = N(() => p.value === "all-markup" ? "" : `folio-root--${p.value}`), { t: x } = c(), S = ({ node: e }) => e;
|
|
3207
|
+
S.props = ["node"];
|
|
3208
|
+
let ne = N(() => o.documentBuffer != null || o.document != null), re = W(!1);
|
|
3209
|
+
J(ne, (e) => {
|
|
3210
|
+
e || (re.value = !1);
|
|
3164
3211
|
});
|
|
3165
|
-
let
|
|
3212
|
+
let w = W(null), T = W(null), se = W(null), ce = W(null), le = N(() => o.showRuler ?? !1), E = W(0), D = W(!1), ue = W(!1), de = W(!1), fe = W(!1), O = W(!1), k = W(!1), A = W(o.showOutline), M = W(!1), pe = W(null), he = we([]), z = we([]), { zoom: B, zoomPercent: _e, isMinZoom: ye, isMaxZoom: Se, setZoom: G, zoomIn: Te, zoomOut: De, handleWheel: Oe, handleKeyDown: ke, ZOOM_PRESETS: je } = oe(o.initialZoom);
|
|
3166
3213
|
function Me(e) {
|
|
3167
3214
|
o.enableWheelZoom !== !1 && Oe(e);
|
|
3168
3215
|
}
|
|
3169
|
-
|
|
3170
|
-
showKeyboardShortcuts:
|
|
3171
|
-
showFindReplace:
|
|
3172
|
-
showHyperlink:
|
|
3216
|
+
Qi({
|
|
3217
|
+
showKeyboardShortcuts: de,
|
|
3218
|
+
showFindReplace: D,
|
|
3219
|
+
showHyperlink: ue,
|
|
3173
3220
|
handleZoomKeyDown: ke
|
|
3174
3221
|
});
|
|
3175
|
-
let { editor: Pe, editorView: X, editorState: Le, isReady: Ge, isDirty: Ke, parseError: qe, layout: Je, blocks: Ye, measures: Xe, loadBuffer: Ze, loadDocument: Qe, save: $e, getDocument: et, getCommands: Z, focus: tt, reLayout: nt } =
|
|
3176
|
-
hiddenContainer:
|
|
3177
|
-
pagesContainer:
|
|
3222
|
+
let { editor: Pe, editorView: X, editorState: Le, isReady: Ge, isDirty: Ke, parseError: qe, layout: Je, blocks: Ye, measures: Xe, loadBuffer: Ze, loadDocument: Qe, save: $e, getDocument: et, getCommands: Z, focus: tt, reLayout: nt } = C({
|
|
3223
|
+
hiddenContainer: w,
|
|
3224
|
+
pagesContainer: T,
|
|
3178
3225
|
readOnly: u,
|
|
3179
3226
|
editorMode: l,
|
|
3180
3227
|
author: () => o.author,
|
|
@@ -3205,35 +3252,35 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3205
3252
|
onReadOnlyEditAttempt: () => o.onReadonlyEditAttempt?.(),
|
|
3206
3253
|
featureFlags: () => o.featureFlags,
|
|
3207
3254
|
onSelectiveSaveTripwire: o.onSelectiveSaveTripwire ? (e) => o.onSelectiveSaveTripwire?.(e) : void 0
|
|
3208
|
-
}), rt = N(() => !Ge.value &&
|
|
3255
|
+
}), rt = N(() => !Ge.value && ne.value && !(o.preserveDocumentWhileLoading === !0 && re.value));
|
|
3209
3256
|
function it() {
|
|
3210
3257
|
X.value && (He(), Ve(), nt());
|
|
3211
3258
|
}
|
|
3212
3259
|
J(() => o.fonts, (e, t, n) => {
|
|
3213
3260
|
if (!e || e.length === 0) return;
|
|
3214
3261
|
let r = !1, i = [];
|
|
3215
|
-
|
|
3262
|
+
va(e).then((e) => {
|
|
3216
3263
|
if (r) {
|
|
3217
|
-
|
|
3264
|
+
ya(e);
|
|
3218
3265
|
return;
|
|
3219
3266
|
}
|
|
3220
3267
|
i = e, e.length !== 0 && it();
|
|
3221
3268
|
}), n(() => {
|
|
3222
|
-
r = !0, i.length !== 0 && (
|
|
3269
|
+
r = !0, i.length !== 0 && (ya(i), it());
|
|
3223
3270
|
});
|
|
3224
3271
|
}, { immediate: !0 });
|
|
3225
|
-
let { selectedImage: at, imageInteracting: ot, imageToolbarContext: st, handleToolbarImageWrap: ut, handleImageTransform: dt } =
|
|
3272
|
+
let { selectedImage: at, imageInteracting: ot, imageToolbarContext: st, handleToolbarImageWrap: ut, handleImageTransform: dt } = Zi({
|
|
3226
3273
|
editorView: X,
|
|
3227
3274
|
zoom: B,
|
|
3228
|
-
stateTick:
|
|
3275
|
+
stateTick: E,
|
|
3229
3276
|
getCommands: Z
|
|
3230
|
-
}), { hyperlinkPopupData: ft, handleHyperlinkSubmit: pt, handleHyperlinkRemove: mt, handleHyperlinkPopupNavigate: ht, handleHyperlinkPopupEdit: gt, handleHyperlinkPopupRemove: _t } =
|
|
3277
|
+
}), { hyperlinkPopupData: ft, handleHyperlinkSubmit: pt, handleHyperlinkRemove: mt, handleHyperlinkPopupNavigate: ht, handleHyperlinkPopupEdit: gt, handleHyperlinkPopupRemove: _t } = Xi({
|
|
3231
3278
|
editorView: X,
|
|
3232
3279
|
getCommands: Z
|
|
3233
|
-
}), vt =
|
|
3280
|
+
}), vt = ie(), { tableInsertButton: yt, scrollPageInfo: bt, resolvePos: xt, setPmSelection: St, scrollVisiblePositionIntoView: Ct, handlePagesMouseDown: wt, handlePagesMouseMove: Tt, handlePagesClick: Et, handleTableInsertClick: Dt } = fa({
|
|
3234
3281
|
editorView: X,
|
|
3235
|
-
pagesRef:
|
|
3236
|
-
pagesViewportRef:
|
|
3282
|
+
pagesRef: T,
|
|
3283
|
+
pagesViewportRef: se,
|
|
3237
3284
|
selectedImage: at,
|
|
3238
3285
|
imageInteracting: ot,
|
|
3239
3286
|
hyperlinkPopupData: ft,
|
|
@@ -3249,7 +3296,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3249
3296
|
reLayout: nt,
|
|
3250
3297
|
emit: () => {},
|
|
3251
3298
|
clearOverlay: () => {}
|
|
3252
|
-
}), Ot =
|
|
3299
|
+
}), Ot = $i({
|
|
3253
3300
|
editorView: X,
|
|
3254
3301
|
showOutline: A,
|
|
3255
3302
|
showSidebar: M,
|
|
@@ -3257,18 +3304,18 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3257
3304
|
activeSidebarItem: pe,
|
|
3258
3305
|
extractCommentsAndChanges: () => {},
|
|
3259
3306
|
scrollToVisiblePosition: Ct
|
|
3260
|
-
}), { contextMenu: kt, imageContextMenu: At, imageContextMenuTextActions: jt, customTextMenuItems: Mt, handleContextMenu: Nt, handleSelectedImageContextMenu: Pt, handleImageWrapSelect: Ft, handleContextMenuAction: It } =
|
|
3307
|
+
}), { contextMenu: kt, imageContextMenu: At, imageContextMenuTextActions: jt, customTextMenuItems: Mt, handleContextMenu: Nt, handleSelectedImageContextMenu: Pt, handleImageWrapSelect: Ft, handleContextMenuAction: It } = Gi({
|
|
3261
3308
|
editorView: X,
|
|
3262
3309
|
selectedImage: at,
|
|
3263
3310
|
zoom: B,
|
|
3264
|
-
showImageProperties:
|
|
3311
|
+
showImageProperties: O,
|
|
3265
3312
|
getCommands: Z,
|
|
3266
3313
|
clearOverlay: () => {},
|
|
3267
3314
|
setPmSelection: St,
|
|
3268
3315
|
resolvePos: xt,
|
|
3269
3316
|
customContextMenuItems: () => u.value ? void 0 : o.customContextMenuItems,
|
|
3270
3317
|
onCustomContextAction: (e, t) => o.onCustomContextAction?.(e, t)
|
|
3271
|
-
}), Lt =
|
|
3318
|
+
}), Lt = ae(X, E), Rt = N(() => Lt.value.entries), Q = Ni({
|
|
3272
3319
|
editorView: X,
|
|
3273
3320
|
getDocument: et,
|
|
3274
3321
|
author: () => o.author,
|
|
@@ -3277,10 +3324,10 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3277
3324
|
o.onCommentsChange?.(e), s("comments-change", e);
|
|
3278
3325
|
},
|
|
3279
3326
|
reLayout: nt
|
|
3280
|
-
}), zt = Q.comments, $ =
|
|
3327
|
+
}), zt = Q.comments, $ = Mi({
|
|
3281
3328
|
editorView: X,
|
|
3282
|
-
pagesViewport:
|
|
3283
|
-
pagesContainer:
|
|
3329
|
+
pagesViewport: se,
|
|
3330
|
+
pagesContainer: T,
|
|
3284
3331
|
readOnly: u,
|
|
3285
3332
|
createComment: Q.createComment,
|
|
3286
3333
|
pushComment: Q.pushComment,
|
|
@@ -3294,11 +3341,11 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3294
3341
|
navigator.clipboard?.writeText(e), ft.value = null;
|
|
3295
3342
|
}
|
|
3296
3343
|
let Vt = N(() => {
|
|
3297
|
-
|
|
3344
|
+
E.value;
|
|
3298
3345
|
let e = et()?.package.document;
|
|
3299
3346
|
return e ? e.finalSectionProperties ?? e.sections?.[0]?.properties ?? null : null;
|
|
3300
3347
|
}), Ht = N(() => {
|
|
3301
|
-
|
|
3348
|
+
E.value;
|
|
3302
3349
|
let e = {};
|
|
3303
3350
|
o.fontFamilies !== void 0 && (e.fontFamilies = o.fontFamilies);
|
|
3304
3351
|
let t = et()?.package.styles?.styles;
|
|
@@ -3311,7 +3358,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3311
3358
|
transform: B.value === 1 ? void 0 : `scale(${B.value})`,
|
|
3312
3359
|
transformOrigin: "top center",
|
|
3313
3360
|
transition: "transform 0.2s ease"
|
|
3314
|
-
})), { handleApplyStyle: Kt, handleInsertSymbol: qt, handleInsertSectionBreakNextPage: Jt, handleInsertSectionBreakContinuous: Yt } =
|
|
3361
|
+
})), { handleApplyStyle: Kt, handleInsertSymbol: qt, handleInsertSectionBreakNextPage: Jt, handleInsertSectionBreakContinuous: Yt } = Yi({
|
|
3315
3362
|
editorView: X,
|
|
3316
3363
|
getDocument: et
|
|
3317
3364
|
});
|
|
@@ -3352,17 +3399,17 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3352
3399
|
let e = X.value;
|
|
3353
3400
|
e && (Re(e), e.focus());
|
|
3354
3401
|
}
|
|
3355
|
-
let { handlePageSetupApply: en, handleLeftMarginChange: tn, handleRightMarginChange: nn, handleTopMarginChange: rn, handleBottomMarginChange: an, handleIndentLeftChange: on, handleIndentRightChange: sn, handleFirstLineIndentChange: cn, handleTabStopRemove: ln } =
|
|
3402
|
+
let { handlePageSetupApply: en, handleLeftMarginChange: tn, handleRightMarginChange: nn, handleTopMarginChange: rn, handleBottomMarginChange: an, handleIndentLeftChange: on, handleIndentRightChange: sn, handleFirstLineIndentChange: cn, handleTabStopRemove: ln } = ea({
|
|
3356
3403
|
editorView: X,
|
|
3357
3404
|
getDocument: et,
|
|
3358
3405
|
readOnly: u,
|
|
3359
|
-
stateTick:
|
|
3406
|
+
stateTick: E,
|
|
3360
3407
|
reLayout: nt,
|
|
3361
3408
|
onChange: (e) => {
|
|
3362
3409
|
o.onChange?.(e), s("change", e), s("update:document", e);
|
|
3363
3410
|
}
|
|
3364
3411
|
}), un = N(() => {
|
|
3365
|
-
|
|
3412
|
+
E.value;
|
|
3366
3413
|
let e = X.value, t = e ? ze(e.state).paragraphFormatting : {};
|
|
3367
3414
|
return {
|
|
3368
3415
|
indentLeft: t.indentLeft ?? 0,
|
|
@@ -3379,16 +3426,16 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3379
3426
|
switch (e) {
|
|
3380
3427
|
case "find":
|
|
3381
3428
|
case "findReplace":
|
|
3382
|
-
|
|
3429
|
+
D.value = !0;
|
|
3383
3430
|
break;
|
|
3384
3431
|
case "insertSymbol":
|
|
3385
|
-
|
|
3432
|
+
fe.value = !0;
|
|
3386
3433
|
break;
|
|
3387
3434
|
case "insertHyperlink":
|
|
3388
|
-
|
|
3435
|
+
ue.value = !0;
|
|
3389
3436
|
break;
|
|
3390
3437
|
case "pageSetup":
|
|
3391
|
-
|
|
3438
|
+
k.value = !0;
|
|
3392
3439
|
break;
|
|
3393
3440
|
case "toggleOutline":
|
|
3394
3441
|
Ot.handleToggleOutline();
|
|
@@ -3419,7 +3466,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3419
3466
|
Zt(e, t);
|
|
3420
3467
|
}
|
|
3421
3468
|
let mn = W(!1);
|
|
3422
|
-
|
|
3469
|
+
Ki({
|
|
3423
3470
|
documentBuffer: () => o.documentBuffer ?? null,
|
|
3424
3471
|
document: () => o.document ?? null,
|
|
3425
3472
|
loadDocumentBuffer: Ze,
|
|
@@ -3440,7 +3487,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3440
3487
|
hn.value = !0;
|
|
3441
3488
|
let e = o.initialScrollTop;
|
|
3442
3489
|
requestAnimationFrame(() => {
|
|
3443
|
-
|
|
3490
|
+
ce.value && (ce.value.scrollTop = e);
|
|
3444
3491
|
});
|
|
3445
3492
|
}
|
|
3446
3493
|
J(Ge, (e) => {
|
|
@@ -3448,30 +3495,30 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3448
3495
|
hn.value = !1;
|
|
3449
3496
|
return;
|
|
3450
3497
|
}
|
|
3451
|
-
|
|
3498
|
+
re.value = !0, Ot.recomputeHeadingsIfOpen(), Q.seedFromDocument();
|
|
3452
3499
|
let t = et();
|
|
3453
3500
|
t && o.onCompatibilityChange?.(Be(t)), o.autoOpenReviewSidebar !== !1 && !mn.value && (zt.value.length > 0 || Rt.value.length > 0) && (mn.value = !0, M.value = !0), _n(), s("ready");
|
|
3454
3501
|
}), xe(() => {
|
|
3455
3502
|
let e = Pe.on("selectionChange", () => {
|
|
3456
|
-
|
|
3503
|
+
E.value++, $.updateFloatingButton();
|
|
3457
3504
|
}), t = Pe.on("docChange", () => {
|
|
3458
|
-
|
|
3505
|
+
E.value++, Ot.recomputeHeadingsIfOpen();
|
|
3459
3506
|
}), n = Pe.on("layoutComplete", () => {
|
|
3460
|
-
|
|
3507
|
+
E.value++;
|
|
3461
3508
|
}), r = vt.install(), i = Ue(() => o.onFontsLoaded?.());
|
|
3462
3509
|
be(() => {
|
|
3463
3510
|
e(), t(), n(), r(), i();
|
|
3464
3511
|
});
|
|
3465
3512
|
});
|
|
3466
|
-
let { exposed: vn } =
|
|
3513
|
+
let { exposed: vn } = Ji({
|
|
3467
3514
|
editor: Pe,
|
|
3468
3515
|
editorView: X,
|
|
3469
3516
|
isDirty: Ke,
|
|
3470
3517
|
commentsDirty: Q.commentsDirty,
|
|
3471
3518
|
clearCommentsDirty: Q.clearCommentsDirty,
|
|
3472
3519
|
layout: Je,
|
|
3473
|
-
pagesRef:
|
|
3474
|
-
pagesViewportRef:
|
|
3520
|
+
pagesRef: T,
|
|
3521
|
+
pagesViewportRef: se,
|
|
3475
3522
|
zoom: B,
|
|
3476
3523
|
scrollVisiblePositionIntoView: Ct,
|
|
3477
3524
|
author: () => o.author,
|
|
@@ -3479,6 +3526,8 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3479
3526
|
let t = Q.createComment(e);
|
|
3480
3527
|
return Q.pushComment(t), t.id;
|
|
3481
3528
|
},
|
|
3529
|
+
getComments: () => Q.comments.value,
|
|
3530
|
+
setComments: Q.setComments,
|
|
3482
3531
|
focus: tt,
|
|
3483
3532
|
getDocument: et,
|
|
3484
3533
|
setZoom: G,
|
|
@@ -3497,7 +3546,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3497
3546
|
]),
|
|
3498
3547
|
style: H(t.style)
|
|
3499
3548
|
}, [
|
|
3500
|
-
L("div",
|
|
3549
|
+
L("div", ba, [R(br, {
|
|
3501
3550
|
"show-table-insert": o.showTableInsert !== !1,
|
|
3502
3551
|
onRename: n[0] ||= (e) => s("rename", e),
|
|
3503
3552
|
onMenuAction: fn,
|
|
@@ -3506,11 +3555,11 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3506
3555
|
"title-bar-left": Ee(() => [Ce(e.$slots, "title-bar-left", {}, void 0, !0)]),
|
|
3507
3556
|
"title-bar-right": Ee(() => [Ce(e.$slots, "title-bar-right", {}, void 0, !0)]),
|
|
3508
3557
|
_: 3
|
|
3509
|
-
}, 8, ["show-table-insert"]), t.showToolbar ? (U(), P(
|
|
3558
|
+
}, 8, ["show-table-insert"]), t.showToolbar ? (U(), P(te, ve({
|
|
3510
3559
|
key: 0,
|
|
3511
3560
|
view: q(X),
|
|
3512
3561
|
"get-commands": q(Z),
|
|
3513
|
-
"state-tick":
|
|
3562
|
+
"state-tick": E.value,
|
|
3514
3563
|
"zoom-percent": q(_e),
|
|
3515
3564
|
"is-min-zoom": q(ye),
|
|
3516
3565
|
"is-max-zoom": q(Se),
|
|
@@ -3525,11 +3574,11 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3525
3574
|
"image-context": q(st),
|
|
3526
3575
|
theme: t.theme ?? null
|
|
3527
3576
|
}, Ht.value, {
|
|
3528
|
-
onFindReplace: n[1] ||= (e) =>
|
|
3529
|
-
onInsertLink: n[2] ||= (e) =>
|
|
3530
|
-
onInsertSymbol: n[3] ||= (e) =>
|
|
3577
|
+
onFindReplace: n[1] ||= (e) => D.value = !0,
|
|
3578
|
+
onInsertLink: n[2] ||= (e) => ue.value = !0,
|
|
3579
|
+
onInsertSymbol: n[3] ||= (e) => fe.value = !0,
|
|
3531
3580
|
onInsertPageBreak: Qt,
|
|
3532
|
-
onPageSetup: n[4] ||= (e) =>
|
|
3581
|
+
onPageSetup: n[4] ||= (e) => k.value = !0,
|
|
3533
3582
|
onToggleOutline: q(Ot).handleToggleOutline,
|
|
3534
3583
|
onApplyStyle: q(Kt),
|
|
3535
3584
|
onZoomIn: q(Te),
|
|
@@ -3539,14 +3588,14 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3539
3588
|
onModeChange: dn,
|
|
3540
3589
|
onToggleTrackChanges: h,
|
|
3541
3590
|
"onUpdate:displayMode": y,
|
|
3542
|
-
onImageProperties: n[6] ||= (e) =>
|
|
3591
|
+
onImageProperties: n[6] ||= (e) => O.value = !0,
|
|
3543
3592
|
onImageWrapType: q(ut),
|
|
3544
3593
|
onImageTransform: q(dt)
|
|
3545
3594
|
}), me({
|
|
3546
3595
|
"table-context": Ee(() => [R(_, {
|
|
3547
3596
|
view: q(X),
|
|
3548
3597
|
"get-commands": q(Z),
|
|
3549
|
-
"state-tick":
|
|
3598
|
+
"state-tick": E.value,
|
|
3550
3599
|
theme: t.theme ?? null
|
|
3551
3600
|
}, null, 8, [
|
|
3552
3601
|
"view",
|
|
@@ -3557,7 +3606,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3557
3606
|
_: 2
|
|
3558
3607
|
}, [e.$slots["toolbar-extra"] || t.toolbarExtra ? {
|
|
3559
3608
|
name: "toolbar-extra",
|
|
3560
|
-
fn: Ee(() => [Ce(e.$slots, "toolbar-extra", {}, () => [t.toolbarExtra ? (U(), P(
|
|
3609
|
+
fn: Ee(() => [Ce(e.$slots, "toolbar-extra", {}, () => [t.toolbarExtra ? (U(), P(S, {
|
|
3561
3610
|
key: 0,
|
|
3562
3611
|
node: t.toolbarExtra
|
|
3563
3612
|
}, null, 8, ["node"])) : F("", !0)], !0)]),
|
|
@@ -3587,17 +3636,17 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3587
3636
|
"onImageWrapType",
|
|
3588
3637
|
"onImageTransform"
|
|
3589
3638
|
])) : F("", !0)]),
|
|
3590
|
-
R(
|
|
3591
|
-
"show-find-replace":
|
|
3592
|
-
"onUpdate:showFindReplace": n[7] ||= (e) =>
|
|
3593
|
-
"show-hyperlink":
|
|
3594
|
-
"onUpdate:showHyperlink": n[8] ||= (e) =>
|
|
3595
|
-
"show-insert-symbol":
|
|
3596
|
-
"onUpdate:showInsertSymbol": n[9] ||= (e) =>
|
|
3597
|
-
"show-image-properties":
|
|
3598
|
-
"onUpdate:showImageProperties": n[10] ||= (e) =>
|
|
3599
|
-
"show-page-setup":
|
|
3600
|
-
"onUpdate:showPageSetup": n[11] ||= (e) =>
|
|
3639
|
+
R(hr, {
|
|
3640
|
+
"show-find-replace": D.value,
|
|
3641
|
+
"onUpdate:showFindReplace": n[7] ||= (e) => D.value = e,
|
|
3642
|
+
"show-hyperlink": ue.value,
|
|
3643
|
+
"onUpdate:showHyperlink": n[8] ||= (e) => ue.value = e,
|
|
3644
|
+
"show-insert-symbol": fe.value,
|
|
3645
|
+
"onUpdate:showInsertSymbol": n[9] ||= (e) => fe.value = e,
|
|
3646
|
+
"show-image-properties": O.value,
|
|
3647
|
+
"onUpdate:showImageProperties": n[10] ||= (e) => O.value = e,
|
|
3648
|
+
"show-page-setup": k.value,
|
|
3649
|
+
"onUpdate:showPageSetup": n[11] ||= (e) => k.value = e,
|
|
3601
3650
|
view: q(X),
|
|
3602
3651
|
bookmarks: he.value,
|
|
3603
3652
|
"selected-image-pm-pos": q(at)?.pmPos ?? null,
|
|
@@ -3621,25 +3670,25 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3621
3670
|
"onHyperlinkRemove",
|
|
3622
3671
|
"onPageSetupApply"
|
|
3623
3672
|
]),
|
|
3624
|
-
q(qe) ? (U(), I("div",
|
|
3673
|
+
q(qe) ? (U(), I("div", xa, K(q(qe)), 1)) : rt.value ? (U(), I("div", Sa, [Ce(e.$slots, "loading-indicator", {}, () => [t.loadingIndicator ? (U(), P(S, {
|
|
3625
3674
|
key: 0,
|
|
3626
3675
|
node: t.loadingIndicator
|
|
3627
|
-
}, null, 8, ["node"])) : (U(), I(j, { key: 1 }, [ge(K(q(x)("loadingDocument")), 1)], 64))], !0)])) : !q(Ge) && !
|
|
3676
|
+
}, null, 8, ["node"])) : (U(), I(j, { key: 1 }, [ge(K(q(x)("loadingDocument")), 1)], 64))], !0)])) : !q(Ge) && !ne.value ? (U(), I("div", Ca, [Ce(e.$slots, "placeholder", {}, () => [t.placeholder ? (U(), P(S, {
|
|
3628
3677
|
key: 0,
|
|
3629
3678
|
node: t.placeholder
|
|
3630
3679
|
}, null, 8, ["node"])) : (U(), I(j, { key: 1 }, [ge("No document loaded")], 64))], !0)])) : F("", !0),
|
|
3631
3680
|
L("div", {
|
|
3632
3681
|
ref_key: "hiddenPmRef",
|
|
3633
|
-
ref:
|
|
3682
|
+
ref: w,
|
|
3634
3683
|
class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
|
|
3635
3684
|
}, null, 512),
|
|
3636
3685
|
L("div", {
|
|
3637
3686
|
ref_key: "editorScrollRef",
|
|
3638
|
-
ref:
|
|
3687
|
+
ref: ce,
|
|
3639
3688
|
class: "docx-editor-vue__editor-scroll",
|
|
3640
3689
|
onScroll: gn
|
|
3641
|
-
}, [L("div",
|
|
3642
|
-
|
|
3690
|
+
}, [L("div", wa, [
|
|
3691
|
+
le.value && !u.value ? (U(), I("div", Ta, [R(ee, {
|
|
3643
3692
|
"section-props": Vt.value,
|
|
3644
3693
|
zoom: q(B),
|
|
3645
3694
|
unit: t.rulerUnit ?? "inch",
|
|
@@ -3673,7 +3722,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3673
3722
|
"onFirstLineIndentChange",
|
|
3674
3723
|
"onTabStopRemove"
|
|
3675
3724
|
])])) : F("", !0),
|
|
3676
|
-
|
|
3725
|
+
le.value && !u.value ? (U(), I("div", Ea, [R(g, {
|
|
3677
3726
|
"section-props": Vt.value,
|
|
3678
3727
|
zoom: q(B),
|
|
3679
3728
|
unit: t.rulerUnit ?? "inch",
|
|
@@ -3690,7 +3739,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3690
3739
|
])])) : F("", !0),
|
|
3691
3740
|
L("div", {
|
|
3692
3741
|
ref_key: "pagesViewportRef",
|
|
3693
|
-
ref:
|
|
3742
|
+
ref: se,
|
|
3694
3743
|
class: "docx-editor-vue__pages-viewport",
|
|
3695
3744
|
onWheel: Me,
|
|
3696
3745
|
onMousedown: n[20] ||= (...e) => q(wt) && q(wt)(...e),
|
|
@@ -3698,14 +3747,14 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3698
3747
|
onClick: n[22] ||= (...e) => q(Et) && q(Et)(...e),
|
|
3699
3748
|
onContextmenu: n[23] ||= Y((...e) => q(Nt) && q(Nt)(...e), ["prevent"])
|
|
3700
3749
|
}, [
|
|
3701
|
-
L("div",
|
|
3750
|
+
L("div", Da, [L("div", {
|
|
3702
3751
|
ref_key: "pagesRef",
|
|
3703
|
-
ref:
|
|
3752
|
+
ref: T,
|
|
3704
3753
|
class: "docx-editor-vue__pages paged-editor__pages",
|
|
3705
3754
|
style: H(Gt.value)
|
|
3706
|
-
}, null, 4), L("div",
|
|
3755
|
+
}, null, 4), L("div", Oa, [R(ur, {
|
|
3707
3756
|
"get-view": () => q(X),
|
|
3708
|
-
"get-pages-container": () =>
|
|
3757
|
+
"get-pages-container": () => T.value,
|
|
3709
3758
|
"editor-state": q(Le),
|
|
3710
3759
|
zoom: q(B),
|
|
3711
3760
|
layout: q(Je),
|
|
@@ -3725,10 +3774,10 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3725
3774
|
"on-term-click",
|
|
3726
3775
|
"selected-canonical",
|
|
3727
3776
|
"selection-seq"
|
|
3728
|
-
]), o.showTemplateDirectives ? (U(), P(
|
|
3777
|
+
]), o.showTemplateDirectives ? (U(), P(hi, {
|
|
3729
3778
|
key: 0,
|
|
3730
3779
|
"get-view": () => q(X),
|
|
3731
|
-
"get-pages-container": () =>
|
|
3780
|
+
"get-pages-container": () => T.value,
|
|
3732
3781
|
"editor-state": q(Le),
|
|
3733
3782
|
zoom: q(B),
|
|
3734
3783
|
layout: q(Je),
|
|
@@ -3743,7 +3792,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3743
3792
|
"blocks",
|
|
3744
3793
|
"measures"
|
|
3745
3794
|
])) : F("", !0)])]),
|
|
3746
|
-
R(
|
|
3795
|
+
R(ii, {
|
|
3747
3796
|
"image-info": q(at),
|
|
3748
3797
|
zoom: q(B),
|
|
3749
3798
|
view: q(X),
|
|
@@ -3757,7 +3806,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3757
3806
|
"view",
|
|
3758
3807
|
"onContextMenu"
|
|
3759
3808
|
]),
|
|
3760
|
-
R(
|
|
3809
|
+
R(Ti, {
|
|
3761
3810
|
data: q(ft),
|
|
3762
3811
|
"read-only": u.value,
|
|
3763
3812
|
onNavigate: q(ht),
|
|
@@ -3782,10 +3831,10 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3782
3831
|
}),
|
|
3783
3832
|
"aria-label": q(yt).type === "row" ? "Insert row" : "Insert column",
|
|
3784
3833
|
onMousedown: n[16] ||= (...e) => q(Dt) && q(Dt)(...e)
|
|
3785
|
-
}, " + ", 44,
|
|
3834
|
+
}, " + ", 44, ka)) : F("", !0),
|
|
3786
3835
|
R(m, {
|
|
3787
3836
|
comments: q(zt),
|
|
3788
|
-
"pages-container":
|
|
3837
|
+
"pages-container": T.value,
|
|
3789
3838
|
zoom: q(B),
|
|
3790
3839
|
"page-width-px": Ut.value,
|
|
3791
3840
|
"sidebar-open": M.value,
|
|
@@ -3806,7 +3855,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3806
3855
|
"show-resolved": !0,
|
|
3807
3856
|
"is-adding-comment": q($).isAddingComment.value,
|
|
3808
3857
|
"add-comment-y-position": q($).addCommentYPosition.value,
|
|
3809
|
-
"pages-container":
|
|
3858
|
+
"pages-container": T.value,
|
|
3810
3859
|
"page-width-px": Ut.value,
|
|
3811
3860
|
zoom: q(B),
|
|
3812
3861
|
"active-item-id": pe.value,
|
|
@@ -3861,12 +3910,12 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3861
3910
|
size: 18
|
|
3862
3911
|
})], 36)) : F("", !0)
|
|
3863
3912
|
], 544),
|
|
3864
|
-
A.value ? F("", !0) : (U(), P(
|
|
3913
|
+
A.value ? F("", !0) : (U(), P(oi, {
|
|
3865
3914
|
key: 2,
|
|
3866
3915
|
"left-offset": 12,
|
|
3867
3916
|
onToggle: q(Ot).handleToggleOutline
|
|
3868
3917
|
}, null, 8, ["onToggle"])),
|
|
3869
|
-
q(bt).totalPages > 1 ? (U(), P(
|
|
3918
|
+
q(bt).totalPages > 1 ? (U(), P(si, {
|
|
3870
3919
|
key: 3,
|
|
3871
3920
|
"current-page": q(bt).currentPage,
|
|
3872
3921
|
"total-pages": q(bt).totalPages,
|
|
@@ -3876,10 +3925,10 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3876
3925
|
"total-pages",
|
|
3877
3926
|
"visible"
|
|
3878
3927
|
])) : F("", !0),
|
|
3879
|
-
R(
|
|
3928
|
+
R(mr, {
|
|
3880
3929
|
"is-open": A.value,
|
|
3881
3930
|
headings: z.value,
|
|
3882
|
-
"get-scroll-container": () =>
|
|
3931
|
+
"get-scroll-container": () => T.value,
|
|
3883
3932
|
onClose: n[24] ||= (e) => A.value = !1,
|
|
3884
3933
|
onNavigate: q(Ot).handleOutlineNavigate
|
|
3885
3934
|
}, null, 8, [
|
|
@@ -3889,7 +3938,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3889
3938
|
"onNavigate"
|
|
3890
3939
|
])
|
|
3891
3940
|
])], 544),
|
|
3892
|
-
R(
|
|
3941
|
+
R(Jr, {
|
|
3893
3942
|
"read-only": u.value,
|
|
3894
3943
|
"context-menu": q(kt),
|
|
3895
3944
|
"image-context-menu": q(At),
|
|
@@ -3900,7 +3949,7 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3900
3949
|
onCloseContextMenu: n[25] ||= (e) => q(kt).isOpen = !1,
|
|
3901
3950
|
onImageWrapSelect: q(Ft),
|
|
3902
3951
|
onCloseImageContextMenu: n[26] ||= (e) => At.value = null,
|
|
3903
|
-
onOpenImageProperties: n[27] ||= (e) =>
|
|
3952
|
+
onOpenImageProperties: n[27] ||= (e) => O.value = !0
|
|
3904
3953
|
}, null, 8, [
|
|
3905
3954
|
"read-only",
|
|
3906
3955
|
"context-menu",
|
|
@@ -3913,10 +3962,10 @@ var va = { class: "docx-editor-vue__toolbar-shell" }, ya = {
|
|
|
3913
3962
|
])
|
|
3914
3963
|
], 6));
|
|
3915
3964
|
}
|
|
3916
|
-
}), [["__scopeId", "data-v-
|
|
3965
|
+
}), [["__scopeId", "data-v-69ec23e0"]]);
|
|
3917
3966
|
//#endregion
|
|
3918
3967
|
//#region src/utils/listState.ts
|
|
3919
|
-
function
|
|
3968
|
+
function ja() {
|
|
3920
3969
|
return {
|
|
3921
3970
|
type: "none",
|
|
3922
3971
|
level: 0,
|
|
@@ -3925,30 +3974,30 @@ function ka() {
|
|
|
3925
3974
|
}
|
|
3926
3975
|
//#endregion
|
|
3927
3976
|
//#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
|
|
3928
|
-
var
|
|
3977
|
+
var Ma = ["aria-label"], Na = ["aria-label"], Pa = [
|
|
3929
3978
|
"disabled",
|
|
3930
3979
|
"title",
|
|
3931
3980
|
"aria-label"
|
|
3932
|
-
],
|
|
3981
|
+
], Fa = [
|
|
3933
3982
|
"disabled",
|
|
3934
3983
|
"title",
|
|
3935
3984
|
"aria-label"
|
|
3936
|
-
],
|
|
3985
|
+
], Ia = ["aria-label"], La = [
|
|
3937
3986
|
"disabled",
|
|
3938
3987
|
"title",
|
|
3939
3988
|
"aria-label",
|
|
3940
3989
|
"aria-pressed"
|
|
3941
|
-
],
|
|
3990
|
+
], Ra = [
|
|
3942
3991
|
"disabled",
|
|
3943
3992
|
"title",
|
|
3944
3993
|
"aria-label",
|
|
3945
3994
|
"aria-pressed"
|
|
3946
|
-
],
|
|
3995
|
+
], za = [
|
|
3947
3996
|
"disabled",
|
|
3948
3997
|
"title",
|
|
3949
3998
|
"aria-label",
|
|
3950
3999
|
"aria-pressed"
|
|
3951
|
-
],
|
|
4000
|
+
], Ba = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
3952
4001
|
__name: "FormattingBar",
|
|
3953
4002
|
props: {
|
|
3954
4003
|
currentFormatting: {},
|
|
@@ -3990,7 +4039,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
3990
4039
|
"redo"
|
|
3991
4040
|
],
|
|
3992
4041
|
setup(e, { emit: t }) {
|
|
3993
|
-
let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s = N(() => i.currentFormatting ?? {}), l = N(() => i.documentStyles ? { styles: i.documentStyles } : {}), u = N(() => s.value.listState ??
|
|
4042
|
+
let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s = N(() => i.currentFormatting ?? {}), l = N(() => i.documentStyles ? { styles: i.documentStyles } : {}), u = N(() => s.value.listState ?? ja()), d = N(() => {
|
|
3994
4043
|
let e = s.value.color;
|
|
3995
4044
|
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
3996
4045
|
}), f = N(() => {
|
|
@@ -4023,7 +4072,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4023
4072
|
}, [R(r, {
|
|
4024
4073
|
name: "undo",
|
|
4025
4074
|
size: 18
|
|
4026
|
-
})], 40,
|
|
4075
|
+
})], 40, Pa), L("button", {
|
|
4027
4076
|
type: "button",
|
|
4028
4077
|
class: "docx-formatting-bar__btn",
|
|
4029
4078
|
disabled: e.disabled || !e.canRedo,
|
|
@@ -4033,7 +4082,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4033
4082
|
}, [R(r, {
|
|
4034
4083
|
name: "redo",
|
|
4035
4084
|
size: 18
|
|
4036
|
-
})], 40,
|
|
4085
|
+
})], 40, Fa)], 8, Na),
|
|
4037
4086
|
i[13] ||= L("span", {
|
|
4038
4087
|
class: "docx-formatting-bar__divider",
|
|
4039
4088
|
role: "separator"
|
|
@@ -4064,7 +4113,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4064
4113
|
}, [R(r, {
|
|
4065
4114
|
name: "format_bold",
|
|
4066
4115
|
size: 18
|
|
4067
|
-
})], 42,
|
|
4116
|
+
})], 42, La),
|
|
4068
4117
|
L("button", {
|
|
4069
4118
|
type: "button",
|
|
4070
4119
|
class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.italic }]),
|
|
@@ -4076,7 +4125,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4076
4125
|
}, [R(r, {
|
|
4077
4126
|
name: "format_italic",
|
|
4078
4127
|
size: 18
|
|
4079
|
-
})], 42,
|
|
4128
|
+
})], 42, Ra),
|
|
4080
4129
|
L("button", {
|
|
4081
4130
|
type: "button",
|
|
4082
4131
|
class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.underline }]),
|
|
@@ -4088,8 +4137,8 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4088
4137
|
}, [R(r, {
|
|
4089
4138
|
name: "format_underlined",
|
|
4090
4139
|
size: 18
|
|
4091
|
-
})], 42,
|
|
4092
|
-
], 8,
|
|
4140
|
+
})], 42, za)
|
|
4141
|
+
], 8, Ia),
|
|
4093
4142
|
e.showTextColorPicker ? (U(), I(j, { key: 1 }, [i[12] ||= L("span", {
|
|
4094
4143
|
class: "docx-formatting-bar__divider",
|
|
4095
4144
|
role: "separator"
|
|
@@ -4131,9 +4180,9 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4131
4180
|
"disabled",
|
|
4132
4181
|
"can-outdent"
|
|
4133
4182
|
])) : F("", !0)
|
|
4134
|
-
], 10,
|
|
4183
|
+
], 10, Ma));
|
|
4135
4184
|
}
|
|
4136
|
-
}), [["__scopeId", "data-v-fc03de2e"]]),
|
|
4185
|
+
}), [["__scopeId", "data-v-fc03de2e"]]), Va = [
|
|
4137
4186
|
{
|
|
4138
4187
|
value: .5,
|
|
4139
4188
|
label: "50%"
|
|
@@ -4158,7 +4207,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4158
4207
|
value: 2,
|
|
4159
4208
|
label: "200%"
|
|
4160
4209
|
}
|
|
4161
|
-
],
|
|
4210
|
+
], Ha = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
4162
4211
|
__name: "ZoomControl",
|
|
4163
4212
|
props: {
|
|
4164
4213
|
value: { default: 1 },
|
|
@@ -4175,7 +4224,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4175
4224
|
},
|
|
4176
4225
|
emits: ["change"],
|
|
4177
4226
|
setup(e, { emit: t }) {
|
|
4178
|
-
let { Select: n } = p(), r = e, i = t, a = N(() => r.levels ??
|
|
4227
|
+
let { Select: n } = p(), r = e, i = t, a = N(() => r.levels ?? Va), o = N(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = N(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = N(() => o.value ? String(o.value.value) : String(r.value)), l = N(() => {
|
|
4179
4228
|
let e = a.value.map((e) => ({
|
|
4180
4229
|
value: String(e.value),
|
|
4181
4230
|
label: e.label
|
|
@@ -4203,7 +4252,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4203
4252
|
"disabled"
|
|
4204
4253
|
]));
|
|
4205
4254
|
}
|
|
4206
|
-
}), [["__scopeId", "data-v-8079e07f"]]),
|
|
4255
|
+
}), [["__scopeId", "data-v-8079e07f"]]), Ua = (e, t, n = {}) => {
|
|
4207
4256
|
let { locale: r = "en", ...i } = n;
|
|
4208
4257
|
return new Promise((n, a) => {
|
|
4209
4258
|
let o = W(null), s = null, c = !1, u = {
|
|
@@ -4229,7 +4278,7 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4229
4278
|
}
|
|
4230
4279
|
};
|
|
4231
4280
|
s = pe({ setup() {
|
|
4232
|
-
return () => B(
|
|
4281
|
+
return () => B(Aa, {
|
|
4233
4282
|
...i,
|
|
4234
4283
|
documentBuffer: e,
|
|
4235
4284
|
ref: o,
|
|
@@ -4244,4 +4293,4 @@ var Aa = ["aria-label"], ja = ["aria-label"], Ma = [
|
|
|
4244
4293
|
});
|
|
4245
4294
|
};
|
|
4246
4295
|
//#endregion
|
|
4247
|
-
export {
|
|
4296
|
+
export { In as DEFAULT_AI_SUGGESTION_PRESETS, Yn as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Aa as DocxEditor, w as FindReplaceDialog, s as FolioUIProvider, T as FootnotePropertiesDialog, Ba as FormattingBar, se as HyperlinkDialog, ce as ImagePositionDialog, le as ImagePropertiesDialog, E as InsertImageDialog, D as InsertSymbolDialog, ue as InsertTableDialog, de as PageSetupDialog, fe as PasteSpecialDialog, O as SplitCellDialog, k as TablePropertiesDialog, A as WatermarkDialog, Ha as ZoomControl, Xn as acceptAutocompleteSuggestion, Zn as acceptAutocompleteWord, Je as anonymizationDecorationsKey, Qn as appendAutocompleteToken, Bt as applyFolioAIEditOperations, Ln as applySuggestions, $n as autocompleteSuggestionKey, er as autocompleteSuggestionPlugin, Bn as buildPositionalText, tr as clearAutocompleteSuggestion, It as clearTemplateSlashMenu, Lt as consumeTemplateSlashQuery, Kn as createAICitationDecorationsPlugin, jn as createDocx, An as createEmptyDocument, Wt as createFolioAIEditSnapshot, n as defaultLocale, Mn as deriveBlockId, Kt as diffWordSegments, nr as finishAutocompleteSuggestion, or as fromMarkdown, Ye as getAnonymizationMatches, rr as getAutocompleteSuggestion, On as getDocumentWatermark, Wn as getFolioCaretViewportRect, Nn as getFolioParaIdFromBlockId, Gn as getFolioSelectionViewportRect, vt as getTemplateDirectives, Rt as getTemplateSlashMenu, Xt as hashFolioAIBlockText, l as i18nPlugin, Me as insertImageFromFile, Pe as insertPageBreakInView, X as insertTableInView, Le as insertTableOfContentsInView, Pn as isFolioBlockId, Fn as isSequentialFolioBlockId, Rn as isSuggestionStale, Zt as normalizeFolioAIBlockText, e as provideLocale, Ua as renderAsync, Q as resetTemplateSlashQuery, zn as resolveSuggestionAnchor, bt as scanDirectives, Un as scrollFolioPositionIntoView, qn as setAICitationsMeta, Vn as setAISuggestionsMeta, Jn as setActiveCitationMeta, Ze as setAnonymizationTermsMeta, kn as setDocumentWatermark, Hn as setFocusedSuggestionMeta, Ft as setTemplatePreviewValues, ir as shouldTriggerAutocomplete, ar as startAutocompleteSuggestion, zt as templateSlashMenuKey, sr as toMarkdown, cr as toMarkdownResult, c as useTranslation, oe as useWheelZoom };
|