@stll/folio-vue 0.8.1 → 0.9.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/ListButtons-C1rU_Y1e.cjs +4 -0
- package/dist/{ListButtons-DXqMvba3.js → ListButtons-DMnOM2pN.js} +385 -410
- package/dist/{WatermarkDialog-r4wmldt4.js → WatermarkDialog-Cf9ISDvv.js} +1378 -1445
- package/dist/WatermarkDialog-ChJtT7Bs.cjs +15 -0
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +2 -3
- package/dist/composables/index.d.ts +1 -2
- package/dist/composables/useDocxEditor.d.ts +26 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +1 -0
- package/dist/composables/useFindReplace.d.ts +24 -22
- package/dist/composables/usePagesPointer.d.ts +9 -13
- package/dist/composables/useRemoteSelectionSync.d.ts +10 -0
- package/dist/composables/useSelectionSync.d.ts +17 -30
- package/dist/composables.cjs +2 -2
- package/dist/composables.js +80 -68
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +1 -1
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1578 -1174
- package/dist/styles/zIndex.d.ts +1 -0
- package/dist/styles.cjs +1 -1
- package/dist/styles.js +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +2 -2
- package/dist/useFindReplace-CL8Rbc3y.js +59 -0
- package/dist/useFindReplace-ZCrdvwEk.cjs +1 -0
- package/dist/useZoom-BYEcnpS0.cjs +1 -0
- package/dist/useZoom-C0p0o54p.js +656 -0
- package/dist/zIndex-CYoLNG_N.cjs +1 -0
- package/dist/{zIndex-BY0qa8Au.js → zIndex-Ei9BbHSW.js} +1 -0
- package/package.json +1 -1
- package/dist/ListButtons-BvsV1yti.cjs +0 -4
- package/dist/WatermarkDialog-DHfk8jrg.cjs +0 -15
- package/dist/components/sidebar/resolveItemPositions.d.ts +0 -22
- package/dist/useZoom-C7jhL696.cjs +0 -1
- package/dist/useZoom-zJvuJlUd.js +0 -615
- package/dist/zIndex-dFsQbASx.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,76 +1,84 @@
|
|
|
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-
|
|
2
|
-
import { D as m, E as h, d as g, f as _, i as v, n as
|
|
3
|
-
import { t as
|
|
4
|
-
import { a as
|
|
5
|
-
import { FindReplaceDialog as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { createStyleResolver as
|
|
8
|
-
import { extractSelectionContext as
|
|
9
|
-
import { inspectDocxCompatibility as
|
|
10
|
-
import { clearAllCaches as
|
|
11
|
-
import { onFontsLoaded as
|
|
12
|
-
import { twipsToPixels as
|
|
13
|
-
import { createLatestRequestGate as
|
|
14
|
-
import { measureDirectiveGutter as
|
|
15
|
-
import { prefersReducedMotionBehavior as
|
|
16
|
-
import { anonymizationDecorationsKey as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
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 {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
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-Cf9ISDvv.js";
|
|
2
|
+
import { D as m, E as h, d as g, f as _, i as v, n as ee, r as y, t as b, v as te, w as x, y as ne } from "./ListButtons-DMnOM2pN.js";
|
|
3
|
+
import { t as re } from "./zIndex-Ei9BbHSW.js";
|
|
4
|
+
import { a as ie, i as ae, o as S, r as oe, t as se } from "./useZoom-C0p0o54p.js";
|
|
5
|
+
import { FindReplaceDialog as C, FootnotePropertiesDialog as ce, HyperlinkDialog as w, ImagePositionDialog as le, ImagePropertiesDialog as ue, InsertImageDialog as de, InsertSymbolDialog as T, InsertTableDialog as fe, PageSetupDialog as pe, PasteSpecialDialog as me, SplitCellDialog as he, TablePropertiesDialog as E, WatermarkDialog as D } from "./dialogs.js";
|
|
6
|
+
import { Fragment as O, Teleport as ge, computed as k, createApp as A, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createSlots as _e, createStaticVNode as ve, createTextVNode as F, createVNode as I, defineComponent as L, h as ye, inject as be, mergeProps as xe, nextTick as R, normalizeClass as z, normalizeStyle as B, onBeforeUnmount as Se, onMounted as Ce, onScopeDispose as we, openBlock as V, provide as Te, ref as H, renderList as U, renderSlot as Ee, shallowRef as De, toDisplayString as W, unref as G, vModelText as Oe, watch as K, withCtx as ke, withDirectives as Ae, withKeys as je, withModifiers as q } from "vue";
|
|
7
|
+
import { createStyleResolver as Me, extractSelectionState as Ne, getSelectedText as Pe, insertImageFromFile as Fe, insertImageFromFile as Ie, insertPageBreakInView as Le, insertPageBreakInView as Re, insertTableInView as ze, insertTableInView as Be, insertTableOfContentsInView as J, insertTableOfContentsInView as Ve, schema as He } from "@stll/folio-core/prosemirror";
|
|
8
|
+
import { extractSelectionContext as Ue } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
|
|
9
|
+
import { inspectDocxCompatibility as We } from "@stll/folio-core/docx/compatibility";
|
|
10
|
+
import { clearAllCaches as Ge, resetCanvasContext as Ke } from "@stll/folio-core/layout-bridge/engine/measuring";
|
|
11
|
+
import { onFontsLoaded as qe } from "@stll/folio-core/utils/fontLoader";
|
|
12
|
+
import { twipsToPixels as Je } from "@stll/folio-core/paged-layout/sectionGeometry";
|
|
13
|
+
import { createLatestRequestGate as Ye } from "@stll/folio-core/controller/latestRequestGate";
|
|
14
|
+
import { measureDirectiveGutter as Xe, projectRangesToRects as Ze } from "@stll/folio-core/paged-layout/rangeProjection";
|
|
15
|
+
import { prefersReducedMotionBehavior as Qe } from "@stll/folio-core/paged-layout/scrollNavigation";
|
|
16
|
+
import { anonymizationDecorationsKey as $e, getAnonymizationMatches as et, getAnonymizationMatches as tt, setAnonymizationTermsMeta as nt, slugAnonymizationLabel as rt } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
17
|
+
import { createRenderedDomContext as it } from "@stll/folio-core/render-dom/RenderedDomContext";
|
|
18
|
+
import { NodeSelection as at, Selection as ot, TextSelection as Y } from "prosemirror-state";
|
|
19
|
+
import { pixelsToEmu as st } from "@stll/folio-core/utils/units";
|
|
20
|
+
import { IMAGE_LAYOUT_OPTIONS as ct, captureInlinePositionEmu as lt, deriveLayoutChoice as ut, findImageElement as dt, isImageLayoutOptionEnabled as ft, toolbarValueToLayoutTarget as X } from "@stll/folio-core/layout-painter/imageLayout";
|
|
21
|
+
import { isTrackChangesMode as pt, toggledTrackChangesMode as mt } from "@stll/folio-core/managers/EditorModeManager";
|
|
22
|
+
import { clickToPositionDom as ht } from "@stll/folio-core/layout-bridge/dom/clickToPositionDom";
|
|
23
|
+
import { calculateResizedImageDimensions as gt, commitImageFloatMove as _t, commitImageInlineMove as vt, commitImageResize as yt, isFloatingImage as bt } from "@stll/folio-core/prosemirror/imageCommit";
|
|
24
|
+
import { findBodyPmAnchor as xt, findBodyPmSpans as St } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
|
|
25
|
+
import { PAINTER_PAINTED_EVENT as Ct } from "@stll/folio-core/layout-painter/renderPage";
|
|
26
|
+
import { HeaderFooterSelectionOverlay as wt } from "@stll/folio-core/render-dom/HeaderFooterSelectionOverlay";
|
|
27
|
+
import { getTemplateDirectives as Tt, getTemplateDirectives as Et, scanDirectives as Dt } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
28
|
+
import { closeHistory as Ot } from "prosemirror-history";
|
|
29
|
+
import { clearFormatting as kt } from "@stll/folio-core/prosemirror/commands/formatting";
|
|
30
|
+
import { getTableContext as At } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
|
|
31
|
+
import { PENDING_COMMENT_ID as Z, createCommentIdAllocator as jt, seedCommentAllocator as Mt } from "@stll/folio-core/prosemirror/commentIdAllocator";
|
|
32
|
+
import { createComment as Nt } from "@stll/folio-core/prosemirror/commentOps";
|
|
33
|
+
import { findChangeRange as Pt } from "@stll/folio-core/prosemirror/queries";
|
|
34
|
+
import { acceptAIEditRevision as Ft, acceptChange as It, findAIEditRevisionRange as Lt, rejectAIEditRevision as Rt, rejectChange as zt } from "@stll/folio-core/prosemirror/commands/comments";
|
|
35
|
+
import { makeRevisionInfo as Bt } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
36
|
+
import { findPageIndexContainingPmPos as Vt } from "@stll/folio-core/layout-engine";
|
|
37
|
+
import { proseDocToBlocks as Ht } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
|
|
38
|
+
import { setTemplatePreviewValues as Ut } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
39
|
+
import { clearTemplateSlashMenu as Wt, consumeTemplateSlashQuery as Gt, getTemplateSlashMenu as Kt, resetTemplateSlashQuery as qt, templateSlashMenuKey as Jt } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
40
|
+
import { createEmptyHeaderFooter as Yt, pickActiveHeaderFooterRId as Xt, removeHeaderFooter as Zt, resolveHeaderFooterContent as Qt, saveHeaderFooterContent as $t } from "@stll/folio-core/utils/headerFooter";
|
|
41
|
+
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as en, applyFolioAIEditOperations as Q, applyFolioAIEditOperations as tn, applyFolioDocumentOperations as $, assertSupportedFolioDocumentOperationVersion as nn, createFolioAIEditSnapshot as rn, createFolioAIEditSnapshot as an, diffWordSegments as on, getCommentAnchorsFromDoc as sn, getFolioDocumentOperationIssues as cn, getTrackedChangesFromDoc as ln, hashFolioAIBlockText as un, normalizeFolioAIBlockText as dn } from "@stll/folio-core/ai-edits";
|
|
42
|
+
import { findParagraphFragmentsByParaId as fn, flashParagraphElements as pn } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
43
|
+
import { blockSdtAttrsToSdtProperties as mn, findBlockSdtMatch as hn, findBlockSdtMatches as gn, removeContentControlTr as _n, setContentControlContentTr as vn, setContentControlValueTr as yn } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
44
|
+
import { setContentControlContentBlocksTr as bn } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
45
|
+
import { clampRangeToDocSize as xn, resolveFolioAIBlockRange as Sn, resolveFolioAITextRange as Cn } from "@stll/folio-core/ai-edits/blockRange";
|
|
46
|
+
import { getPageTextFromLayout as wn } from "@stll/folio-core/paged-layout/pageText";
|
|
47
|
+
import { applyStyle as Tn, removeTabStop as En, setIndentFirstLine as Dn, setIndentLeft as On, setIndentRight as kn } from "@stll/folio-core/prosemirror/commands/paragraph";
|
|
48
|
+
import { getCachedNumberingMap as An } from "@stll/folio-core/docx";
|
|
49
|
+
import { insertPageBreak as jn } from "@stll/folio-core/prosemirror/commands/pageBreak";
|
|
50
|
+
import { insertSectionBreakContinuous as Mn, insertSectionBreakNextPage as Nn } from "@stll/folio-core/prosemirror/commands/sectionBreak";
|
|
51
|
+
import { editHyperlinkAtCursor as Pn, removeHyperlinkAtCursor as Fn } from "@stll/folio-core/prosemirror/commands/hyperlink";
|
|
52
|
+
import { collectHeadings as In } from "@stll/folio-core/utils/headingCollector";
|
|
53
|
+
import { clickToPositionInHfSlot as Ln } from "@stll/folio-core/layout-bridge/dom/findHfPmSpans";
|
|
54
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as Rn, detectTableInsertHover as zn } from "@stll/folio-core/layout-bridge/tableInsertHover";
|
|
55
|
+
import { createCellDragTracker as Bn, findCellPosFromPmPos as Vn } from "@stll/folio-core/prosemirror/cellDragSelection";
|
|
56
|
+
import { RemoteSelectionOverlay as Hn } from "@stll/folio-core/render-dom/RemoteSelectionOverlay";
|
|
57
|
+
import { BodySelectionOverlay as Un } from "@stll/folio-core/render-dom/BodySelectionOverlay";
|
|
58
|
+
import { getDocumentWatermark as Wn, setDocumentWatermark as Gn } from "@stll/folio-core/watermark";
|
|
59
|
+
import { createEmptyDocument as Kn } from "@stll/folio-core/utils/createDocument";
|
|
60
|
+
import { extractDocumentStyleSet as qn, extractDocumentStyleSetFromDocx as Jn, inspectDocumentStyles as Yn, inspectDocumentStylesFromDocx as Xn } from "@stll/folio-core/style-sets/extract";
|
|
61
|
+
import { STELLA_STYLE_SET_NAME as Zn, createStellaStyleDocumentPreset as Qn, createStellaStyleSet as $n } from "@stll/folio-core/style-sets/stellaStyle";
|
|
62
|
+
import { DOCUMENT_PRESET_VERSION as er, DOCUMENT_STYLE_SET_VERSION as tr } from "@stll/folio-core/style-sets/types";
|
|
63
|
+
import { createDocx as nr } from "@stll/folio-core/docx/rezip";
|
|
64
|
+
import { deriveBlockId as rr, getFolioParaIdFromBlockId as ir, isFolioBlockId as ar, isSequentialFolioBlockId as or } from "@stll/folio-core/types/block-id";
|
|
65
|
+
import { DEFAULT_AI_SUGGESTION_PRESETS as sr } from "@stll/folio-core/ai-suggestions/types";
|
|
66
|
+
import { applySuggestions as cr } from "@stll/folio-core/ai-suggestions/apply";
|
|
67
|
+
import { isSuggestionStale as lr, resolveSuggestionAnchor as ur } from "@stll/folio-core/ai-suggestions/conflict";
|
|
68
|
+
import { buildPositionalText as dr } from "@stll/folio-core/ai-suggestions/text-positions";
|
|
69
|
+
import { setAISuggestionsMeta as fr, setFocusedSuggestionMeta as pr } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
70
|
+
import { scrollFolioPositionIntoView as mr } from "@stll/folio-core/paged-layout/scrollToPmPosition";
|
|
71
|
+
import { getFolioCaretViewportRect as hr, getFolioSelectionViewportRect as gr } from "@stll/folio-core/paged-layout/selectionViewportRect";
|
|
72
|
+
import { createAICitationDecorationsPlugin as _r, setAICitationsMeta as vr, setActiveCitationMeta as yr } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
73
|
+
import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as br, acceptAutocompleteSuggestion as xr, acceptAutocompleteWord as Sr, appendAutocompleteToken as Cr, autocompleteSuggestionKey as wr, autocompleteSuggestionPlugin as Tr, clearAutocompleteSuggestion as Er, finishAutocompleteSuggestion as Dr, getAutocompleteSuggestion as Or, shouldTriggerAutocomplete as kr, startAutocompleteSuggestion as Ar } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
74
|
+
import { fromMarkdown as jr, toMarkdown as Mr, toMarkdownResult as Nr } from "@stll/folio-core/markdown";
|
|
67
75
|
//#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
68
|
-
var
|
|
76
|
+
var Pr = [
|
|
69
77
|
"data-folio-anonymization-label",
|
|
70
78
|
"data-folio-anonymization-canonical",
|
|
71
79
|
"data-folio-anonymization-selected",
|
|
72
80
|
"title"
|
|
73
|
-
],
|
|
81
|
+
], Fr = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
74
82
|
__name: "AnonymizationRectsOverlay",
|
|
75
83
|
props: {
|
|
76
84
|
getView: { type: Function },
|
|
@@ -85,7 +93,7 @@ var yr = [
|
|
|
85
93
|
selectionSeq: {}
|
|
86
94
|
},
|
|
87
95
|
setup(e) {
|
|
88
|
-
let t = e, n =
|
|
96
|
+
let t = e, n = H(null), r = H([]), i = Ye(), a = null;
|
|
89
97
|
function o() {
|
|
90
98
|
a !== null && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
91
99
|
a = null, s();
|
|
@@ -97,12 +105,12 @@ var yr = [
|
|
|
97
105
|
r.value = [];
|
|
98
106
|
return;
|
|
99
107
|
}
|
|
100
|
-
let s =
|
|
108
|
+
let s = tt(o);
|
|
101
109
|
if (s.length === 0) {
|
|
102
110
|
r.value = [];
|
|
103
111
|
return;
|
|
104
112
|
}
|
|
105
|
-
let c = await
|
|
113
|
+
let c = await Ze(s, {
|
|
106
114
|
pagesContainer: a,
|
|
107
115
|
zoom: t.zoom,
|
|
108
116
|
layout: t.layout,
|
|
@@ -122,7 +130,7 @@ var yr = [
|
|
|
122
130
|
}))
|
|
123
131
|
}));
|
|
124
132
|
}
|
|
125
|
-
|
|
133
|
+
K(() => [
|
|
126
134
|
t.editorState,
|
|
127
135
|
t.zoom,
|
|
128
136
|
t.layout,
|
|
@@ -144,10 +152,10 @@ var yr = [
|
|
|
144
152
|
index: a
|
|
145
153
|
}, i.item(a)?.scrollIntoView({
|
|
146
154
|
block: "center",
|
|
147
|
-
behavior:
|
|
155
|
+
behavior: Qe()
|
|
148
156
|
});
|
|
149
157
|
}
|
|
150
|
-
|
|
158
|
+
K(() => [t.selectedCanonical, t.selectionSeq], () => l(), { flush: "post" });
|
|
151
159
|
function u(e) {
|
|
152
160
|
if (e.button !== 0 || !t.onTermClick) return;
|
|
153
161
|
let r = n.value;
|
|
@@ -164,35 +172,147 @@ var yr = [
|
|
|
164
172
|
}
|
|
165
173
|
}
|
|
166
174
|
}
|
|
167
|
-
return
|
|
175
|
+
return Ce(() => {
|
|
168
176
|
document.addEventListener("click", u), o();
|
|
169
|
-
}),
|
|
177
|
+
}), Se(() => {
|
|
170
178
|
i.invalidate(), document.removeEventListener("click", u), a !== null && (cancelAnimationFrame(a), a = null);
|
|
171
|
-
}), (t, i) => (
|
|
179
|
+
}), (t, i) => (V(), N("div", {
|
|
172
180
|
ref_key: "rootRef",
|
|
173
181
|
ref: n,
|
|
174
182
|
class: "folio-anonymization-overlay",
|
|
175
183
|
"data-folio-anonymization-overlay": ""
|
|
176
|
-
}, [(
|
|
184
|
+
}, [(V(!0), N(O, null, U(r.value, (t) => (V(), N(O, { key: `${t.label}:${t.canonical}` }, [(V(!0), N(O, null, U(t.rects, (n, r) => (V(), N("span", {
|
|
177
185
|
key: `${t.canonical}:${r}:${n.left}:${n.top}`,
|
|
178
|
-
class:
|
|
186
|
+
class: z(["folio-anonymization-term", `folio-anonymization-term--${G(rt)(t.label)}`]),
|
|
179
187
|
"data-folio-anonymization-label": t.label,
|
|
180
188
|
"data-folio-anonymization-canonical": t.canonical,
|
|
181
189
|
"data-folio-anonymization-selected": t.canonical === e.selectedCanonical ? "true" : void 0,
|
|
182
190
|
title: `Anonymized: ${t.canonical}`,
|
|
183
|
-
style:
|
|
191
|
+
style: B({
|
|
184
192
|
position: "absolute",
|
|
185
193
|
left: `${n.left}px`,
|
|
186
194
|
top: `${n.top}px`,
|
|
187
195
|
width: `${n.width}px`,
|
|
188
196
|
height: `${n.height}px`
|
|
189
197
|
})
|
|
190
|
-
}, null, 14,
|
|
198
|
+
}, null, 14, Pr))), 128))], 64))), 128))], 512));
|
|
191
199
|
}
|
|
192
|
-
}), [["__scopeId", "data-v-df8fe7df"]]),
|
|
200
|
+
}), [["__scopeId", "data-v-df8fe7df"]]), Ir = /* @__PURE__ */ L({
|
|
201
|
+
__name: "DecorationLayer",
|
|
202
|
+
props: {
|
|
203
|
+
getView: { type: Function },
|
|
204
|
+
getPagesContainer: { type: Function },
|
|
205
|
+
zoom: {},
|
|
206
|
+
transactionVersion: {},
|
|
207
|
+
syncCoordinator: {}
|
|
208
|
+
},
|
|
209
|
+
setup(e) {
|
|
210
|
+
let t = e, n = H(null), r = H(0), i = null, a = null;
|
|
211
|
+
function o() {
|
|
212
|
+
i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
|
|
213
|
+
i = null;
|
|
214
|
+
let e = t.getView(), r = t.getPagesContainer(), a = n.value;
|
|
215
|
+
!e || !r || !a || t.syncCoordinator.isSafeToRender() && s(e, r, a, t.zoom);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
Ce(() => {
|
|
219
|
+
a = t.syncCoordinator.onRender(() => {
|
|
220
|
+
r.value++;
|
|
221
|
+
}), o();
|
|
222
|
+
}), Se(() => {
|
|
223
|
+
i !== null && (cancelAnimationFrame(i), i = null), a?.();
|
|
224
|
+
}), K(() => [
|
|
225
|
+
t.zoom,
|
|
226
|
+
t.transactionVersion,
|
|
227
|
+
r.value
|
|
228
|
+
], () => o());
|
|
229
|
+
function s(e, t, n, r) {
|
|
230
|
+
let i = c(e.state);
|
|
231
|
+
if (i.length === 0) {
|
|
232
|
+
n.firstChild && n.replaceChildren();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
let a = it(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
|
|
236
|
+
for (let { decoration: t, from: n, to: r } of i) {
|
|
237
|
+
if (n === r) {
|
|
238
|
+
let r = u(t, e);
|
|
239
|
+
if (!r) continue;
|
|
240
|
+
let i = a.getCoordinatesForPosition(n);
|
|
241
|
+
if (!i) continue;
|
|
242
|
+
let c = document.createElement("div");
|
|
243
|
+
c.style.cssText = `position:absolute;left:${i.x + o.x}px;top:${i.y + o.y}px;height:${i.height}px;`, c.appendChild(r), s.appendChild(c);
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
let i = d(t);
|
|
247
|
+
if (!i) continue;
|
|
248
|
+
let c = a.getRectsForRange(n, r);
|
|
249
|
+
for (let e of c) {
|
|
250
|
+
let t = document.createElement("div");
|
|
251
|
+
for (let [e, n] of Object.entries(i)) e !== "nodeName" && t.setAttribute(e, n);
|
|
252
|
+
let n = `position:absolute;left:${e.x + o.x}px;top:${e.y + o.y}px;width:${e.width}px;height:${e.height}px;`;
|
|
253
|
+
t.style.cssText = n + (i.style ?? ""), s.appendChild(t);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
n.replaceChildren(s);
|
|
257
|
+
}
|
|
258
|
+
function c(e) {
|
|
259
|
+
let t = [];
|
|
260
|
+
for (let n of e.plugins) {
|
|
261
|
+
let r = n.props.decorations;
|
|
262
|
+
if (!r) continue;
|
|
263
|
+
let i = r.call(n, e);
|
|
264
|
+
if (!i) continue;
|
|
265
|
+
let a = l(i, "forEachSet");
|
|
266
|
+
typeof a == "function" && a.call(i, (e) => {
|
|
267
|
+
e.find().forEach((e) => {
|
|
268
|
+
let n = l(e, "spec");
|
|
269
|
+
typeof n == "object" && n && l(n, "noOverlay") || t.push({
|
|
270
|
+
decoration: e,
|
|
271
|
+
from: e.from,
|
|
272
|
+
to: e.to
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return t;
|
|
278
|
+
}
|
|
279
|
+
function l(e, t) {
|
|
280
|
+
return Reflect.get(e, t);
|
|
281
|
+
}
|
|
282
|
+
function u(e, t) {
|
|
283
|
+
let n = l(e, "type");
|
|
284
|
+
if (typeof n != "object" || !n) return null;
|
|
285
|
+
let r = l(n, "toDOM");
|
|
286
|
+
if (typeof r == "function") {
|
|
287
|
+
let n = r(t, () => e.from);
|
|
288
|
+
return n instanceof HTMLElement ? n : null;
|
|
289
|
+
}
|
|
290
|
+
if (r instanceof HTMLElement) {
|
|
291
|
+
let e = r.cloneNode(!0);
|
|
292
|
+
return e instanceof HTMLElement ? e : null;
|
|
293
|
+
}
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
function d(e) {
|
|
297
|
+
let t = l(e, "type");
|
|
298
|
+
if (typeof t != "object" || !t) return null;
|
|
299
|
+
let n = l(t, "attrs");
|
|
300
|
+
if (typeof n != "object" || !n) return null;
|
|
301
|
+
let r = {};
|
|
302
|
+
for (let [e, t] of Object.entries(n)) typeof t == "string" && (r[e] = t);
|
|
303
|
+
return r;
|
|
304
|
+
}
|
|
305
|
+
return (e, t) => (V(), N("div", {
|
|
306
|
+
ref_key: "overlayRef",
|
|
307
|
+
ref: n,
|
|
308
|
+
class: "paged-editor__decoration-overlay",
|
|
309
|
+
"aria-hidden": "true"
|
|
310
|
+
}, null, 512));
|
|
311
|
+
}
|
|
312
|
+
}), Lr = { class: "doc-outline__header" }, Rr = { class: "doc-outline__body" }, zr = {
|
|
193
313
|
key: 0,
|
|
194
314
|
class: "doc-outline__empty"
|
|
195
|
-
},
|
|
315
|
+
}, Br = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
196
316
|
__name: "DocumentOutline",
|
|
197
317
|
props: {
|
|
198
318
|
isOpen: { type: Boolean },
|
|
@@ -203,7 +323,7 @@ var yr = [
|
|
|
203
323
|
},
|
|
204
324
|
emits: ["close", "navigate"],
|
|
205
325
|
setup(e, { emit: t }) {
|
|
206
|
-
let n = e, { OutlineRail: i } = p(), a =
|
|
326
|
+
let n = e, { OutlineRail: i } = p(), a = k(() => n.headings.length ? Math.min(...n.headings.map((e) => e.level)) : 0), o = k(() => n.headings.map((e) => ({
|
|
207
327
|
id: String(e.pmPos),
|
|
208
328
|
label: e.text || "(untitled)",
|
|
209
329
|
level: e.level - a.value
|
|
@@ -211,39 +331,40 @@ var yr = [
|
|
|
211
331
|
function c(e) {
|
|
212
332
|
s("navigate", Number(e));
|
|
213
333
|
}
|
|
214
|
-
return (t, n) => e.isOpen ? (
|
|
334
|
+
return (t, n) => e.isOpen ? (V(), N("nav", {
|
|
215
335
|
key: 0,
|
|
216
336
|
class: "doc-outline",
|
|
217
|
-
style:
|
|
337
|
+
style: B({
|
|
218
338
|
left: e.leftOffset + "px",
|
|
219
339
|
top: e.topPx + "px"
|
|
220
340
|
}),
|
|
221
341
|
role: "navigation",
|
|
222
342
|
"aria-label": "Document outline",
|
|
223
|
-
onMousedown: n[1] ||=
|
|
224
|
-
}, [
|
|
343
|
+
onMousedown: n[1] ||= q(() => {}, ["stop"])
|
|
344
|
+
}, [P("div", Lr, [P("button", {
|
|
225
345
|
class: "doc-outline__back",
|
|
226
346
|
title: "Close outline",
|
|
227
347
|
"aria-label": "Close outline",
|
|
228
348
|
onClick: n[0] ||= (e) => t.$emit("close")
|
|
229
|
-
}, [
|
|
349
|
+
}, [I(r, {
|
|
230
350
|
name: "arrow_back",
|
|
231
351
|
size: 20
|
|
232
|
-
})]), n[2] ||=
|
|
352
|
+
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div", Rr, [e.headings.length === 0 ? (V(), N("div", zr, "No headings found")) : (V(), j(G(i), {
|
|
233
353
|
key: 1,
|
|
234
354
|
items: o.value,
|
|
235
355
|
"get-scroll-container": e.getScrollContainer ?? (() => null),
|
|
236
356
|
"on-jump": c,
|
|
237
357
|
"aria-label": "Document outline"
|
|
238
|
-
}, null, 8, ["items", "get-scroll-container"]))])], 36)) :
|
|
358
|
+
}, null, 8, ["items", "get-scroll-container"]))])], 36)) : M("", !0);
|
|
239
359
|
}
|
|
240
|
-
}), [["__scopeId", "data-v-0797b3b1"]]),
|
|
360
|
+
}), [["__scopeId", "data-v-0797b3b1"]]), Vr = /* @__PURE__ */ L({
|
|
241
361
|
__name: "DocxEditorDialogs",
|
|
242
362
|
props: {
|
|
243
363
|
view: {},
|
|
244
364
|
bookmarks: {},
|
|
245
365
|
selectedImagePmPos: {},
|
|
246
366
|
sectionProperties: {},
|
|
367
|
+
scrollVisiblePositionIntoView: { type: Function },
|
|
247
368
|
showFindReplace: { type: Boolean },
|
|
248
369
|
showHyperlink: { type: Boolean },
|
|
249
370
|
showInsertSymbol: { type: Boolean },
|
|
@@ -263,13 +384,18 @@ var yr = [
|
|
|
263
384
|
],
|
|
264
385
|
setup(e, { emit: t }) {
|
|
265
386
|
let n = t;
|
|
266
|
-
return (t, r) => (
|
|
267
|
-
|
|
387
|
+
return (t, r) => (V(), N(O, null, [
|
|
388
|
+
I(u, {
|
|
268
389
|
"is-open": e.showFindReplace,
|
|
269
390
|
view: e.view,
|
|
391
|
+
"scroll-visible-position-into-view": e.scrollVisiblePositionIntoView,
|
|
270
392
|
onClose: r[0] ||= (e) => n("update:showFindReplace", !1)
|
|
271
|
-
}, null, 8, [
|
|
272
|
-
|
|
393
|
+
}, null, 8, [
|
|
394
|
+
"is-open",
|
|
395
|
+
"view",
|
|
396
|
+
"scroll-visible-position-into-view"
|
|
397
|
+
]),
|
|
398
|
+
I(d, {
|
|
273
399
|
"is-open": e.showHyperlink,
|
|
274
400
|
view: e.view,
|
|
275
401
|
bookmarks: e.bookmarks,
|
|
@@ -281,12 +407,12 @@ var yr = [
|
|
|
281
407
|
"view",
|
|
282
408
|
"bookmarks"
|
|
283
409
|
]),
|
|
284
|
-
|
|
410
|
+
I(a, {
|
|
285
411
|
"is-open": e.showInsertSymbol,
|
|
286
412
|
onClose: r[4] ||= (e) => n("update:showInsertSymbol", !1),
|
|
287
413
|
onInsert: r[5] ||= (e) => n("insert-symbol", e)
|
|
288
414
|
}, null, 8, ["is-open"]),
|
|
289
|
-
|
|
415
|
+
I(o, {
|
|
290
416
|
"is-open": e.showImageProperties,
|
|
291
417
|
view: e.view,
|
|
292
418
|
"pm-pos": e.selectedImagePmPos,
|
|
@@ -296,7 +422,7 @@ var yr = [
|
|
|
296
422
|
"view",
|
|
297
423
|
"pm-pos"
|
|
298
424
|
]),
|
|
299
|
-
|
|
425
|
+
I(f, {
|
|
300
426
|
"is-open": e.showPageSetup,
|
|
301
427
|
"section-properties": e.sectionProperties,
|
|
302
428
|
onClose: r[7] ||= (e) => n("update:showPageSetup", !1),
|
|
@@ -304,10 +430,10 @@ var yr = [
|
|
|
304
430
|
}, null, 8, ["is-open", "section-properties"])
|
|
305
431
|
], 64));
|
|
306
432
|
}
|
|
307
|
-
}),
|
|
433
|
+
}), Hr = {
|
|
308
434
|
key: 0,
|
|
309
435
|
class: "docx-editor-vue__title-bar"
|
|
310
|
-
},
|
|
436
|
+
}, Ur = { class: "docx-editor-vue__title-bar-left" }, Wr = { class: "docx-editor-vue__title-bar-center" }, Gr = { class: "docx-editor-vue__title-bar-right" }, Kr = /* @__PURE__ */ L({
|
|
311
437
|
__name: "DocxEditorMenuBar",
|
|
312
438
|
props: {
|
|
313
439
|
showMenuBar: {
|
|
@@ -339,13 +465,13 @@ var yr = [
|
|
|
339
465
|
],
|
|
340
466
|
setup(e, { emit: t }) {
|
|
341
467
|
let n = t;
|
|
342
|
-
return (t, r) => e.showMenuBar ? (
|
|
343
|
-
|
|
344
|
-
|
|
468
|
+
return (t, r) => e.showMenuBar ? (V(), N("div", Hr, [
|
|
469
|
+
P("div", Ur, [Ee(t.$slots, "title-bar-left")]),
|
|
470
|
+
P("div", Wr, [I(h, {
|
|
345
471
|
"model-value": e.documentName,
|
|
346
472
|
editable: e.documentNameEditable,
|
|
347
473
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
348
|
-
}, null, 8, ["model-value", "editable"]),
|
|
474
|
+
}, null, 8, ["model-value", "editable"]), I(x, {
|
|
349
475
|
"show-file-open": e.showFileOpen,
|
|
350
476
|
"show-help-menu": e.showHelpMenu,
|
|
351
477
|
"show-table-insert": e.showTableInsert,
|
|
@@ -356,40 +482,40 @@ var yr = [
|
|
|
356
482
|
"show-help-menu",
|
|
357
483
|
"show-table-insert"
|
|
358
484
|
])]),
|
|
359
|
-
|
|
360
|
-
])) :
|
|
485
|
+
P("div", Gr, [Ee(t.$slots, "title-bar-right")])
|
|
486
|
+
])) : M("", !0);
|
|
361
487
|
}
|
|
362
|
-
}),
|
|
363
|
-
function
|
|
364
|
-
|
|
488
|
+
}), qr = Symbol("docx-portal-class");
|
|
489
|
+
function Jr(e) {
|
|
490
|
+
Te(qr, k(() => ({
|
|
365
491
|
"ep-root": !0,
|
|
366
|
-
dark: !!
|
|
492
|
+
dark: !!G(e)
|
|
367
493
|
})));
|
|
368
494
|
}
|
|
369
|
-
function
|
|
370
|
-
return
|
|
495
|
+
function Yr() {
|
|
496
|
+
return be(qr, k(() => ({ "ep-root": !0 })));
|
|
371
497
|
}
|
|
372
498
|
//#endregion
|
|
373
499
|
//#region src/components/ImageContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
374
|
-
var
|
|
500
|
+
var Xr = ["aria-label"], Zr = { class: "image-ctx-menu__icon" }, Qr = { class: "image-ctx-menu__label" }, $r = {
|
|
375
501
|
key: 1,
|
|
376
502
|
class: "image-ctx-menu__divider",
|
|
377
503
|
role: "separator"
|
|
378
|
-
},
|
|
504
|
+
}, ei = [
|
|
379
505
|
"data-wrap-type",
|
|
380
506
|
"data-current",
|
|
381
507
|
"data-disabled",
|
|
382
508
|
"disabled",
|
|
383
509
|
"title",
|
|
384
510
|
"onClick"
|
|
385
|
-
],
|
|
511
|
+
], ti = { class: "image-ctx-menu__icon" }, ni = { class: "image-ctx-menu__label" }, ri = ["aria-label"], ii = ["disabled", "onClick"], ai = { class: "image-ctx-menu__label" }, oi = {
|
|
386
512
|
key: 0,
|
|
387
513
|
class: "image-ctx-menu__shortcut"
|
|
388
|
-
},
|
|
514
|
+
}, si = {
|
|
389
515
|
key: 0,
|
|
390
516
|
class: "image-ctx-menu__divider",
|
|
391
517
|
role: "separator"
|
|
392
|
-
},
|
|
518
|
+
}, ci = 18, li = 260, ui = 10, di = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
393
519
|
__name: "ImageContextMenu",
|
|
394
520
|
props: {
|
|
395
521
|
state: {},
|
|
@@ -410,7 +536,7 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
410
536
|
function a() {
|
|
411
537
|
i("open-properties"), i("close");
|
|
412
538
|
}
|
|
413
|
-
let { t: o } = c(), s =
|
|
539
|
+
let { t: o } = c(), s = Yr(), l = ct, u = k(() => n.state ? ut(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
|
|
414
540
|
inline: "wrap_text",
|
|
415
541
|
squareLeft: "format_image_left",
|
|
416
542
|
squareRight: "format_image_right",
|
|
@@ -420,19 +546,19 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
420
546
|
function f(e) {
|
|
421
547
|
return d[e];
|
|
422
548
|
}
|
|
423
|
-
let p =
|
|
549
|
+
let p = k(() => {
|
|
424
550
|
if (!n.state) return {};
|
|
425
|
-
let e =
|
|
426
|
-
return typeof window < "u" && (t +
|
|
551
|
+
let e = ct.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
552
|
+
return typeof window < "u" && (t + li > window.innerWidth && (t = window.innerWidth - li - ui), r + e > window.innerHeight && (r = window.innerHeight - e - ui), t < ui && (t = ui), r < ui && (r = ui)), {
|
|
427
553
|
position: "fixed",
|
|
428
554
|
left: `${t}px`,
|
|
429
555
|
top: `${r}px`,
|
|
430
|
-
minWidth: `${
|
|
556
|
+
minWidth: `${li}px`,
|
|
431
557
|
zIndex: 400
|
|
432
558
|
};
|
|
433
559
|
});
|
|
434
560
|
function m(e) {
|
|
435
|
-
return n.state ?
|
|
561
|
+
return n.state ? ft(e, n.state.currentWrapType) : !1;
|
|
436
562
|
}
|
|
437
563
|
function h(e) {
|
|
438
564
|
m(e) && (i("select", e.choice), i("close"));
|
|
@@ -446,78 +572,78 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
446
572
|
function v(e) {
|
|
447
573
|
e.key === "Escape" && (e.preventDefault(), i("close"));
|
|
448
574
|
}
|
|
449
|
-
return (t, n) => (
|
|
575
|
+
return (t, n) => (V(), j(ge, { to: "body" }, [e.state && e.state.open ? (V(), N("div", {
|
|
450
576
|
key: 0,
|
|
451
577
|
class: "image-ctx-menu-backdrop",
|
|
452
578
|
onMousedown: _,
|
|
453
|
-
onContextmenu: n[0] ||=
|
|
454
|
-
}, null, 32)) :
|
|
579
|
+
onContextmenu: n[0] ||= q((e) => t.$emit("close"), ["prevent"])
|
|
580
|
+
}, null, 32)) : M("", !0), e.state && e.state.open ? (V(), N("div", {
|
|
455
581
|
key: 1,
|
|
456
|
-
class:
|
|
582
|
+
class: z(["image-ctx-menu", G(s)]),
|
|
457
583
|
role: "menu",
|
|
458
|
-
"aria-label":
|
|
584
|
+
"aria-label": G(o)("imageWrap.menu.ariaLabel"),
|
|
459
585
|
"data-testid": "image-context-menu",
|
|
460
|
-
style:
|
|
461
|
-
onContextmenu: n[4] ||=
|
|
586
|
+
style: B(p.value),
|
|
587
|
+
onContextmenu: n[4] ||= q(() => {}, ["prevent"]),
|
|
462
588
|
onKeydown: v
|
|
463
589
|
}, [
|
|
464
|
-
e.canOpenProperties ? (
|
|
590
|
+
e.canOpenProperties ? (V(), N("button", {
|
|
465
591
|
key: 0,
|
|
466
592
|
type: "button",
|
|
467
593
|
role: "menuitem",
|
|
468
594
|
class: "image-ctx-menu__item",
|
|
469
595
|
"data-action": "open-properties",
|
|
470
|
-
onMousedown: n[1] ||=
|
|
596
|
+
onMousedown: n[1] ||= q(() => {}, ["prevent"]),
|
|
471
597
|
onClick: a
|
|
472
|
-
}, [
|
|
598
|
+
}, [P("span", Zr, [I(r, {
|
|
473
599
|
name: "settings",
|
|
474
|
-
size:
|
|
475
|
-
})]),
|
|
476
|
-
e.canOpenProperties ? (
|
|
477
|
-
(
|
|
600
|
+
size: ci
|
|
601
|
+
})]), P("span", Qr, W(G(o)("imageWrap.menu.imageProperties")), 1)], 32)) : M("", !0),
|
|
602
|
+
e.canOpenProperties ? (V(), N("div", $r)) : M("", !0),
|
|
603
|
+
(V(!0), N(O, null, U(G(l), (e) => (V(), N("button", {
|
|
478
604
|
key: e.choice,
|
|
479
605
|
type: "button",
|
|
480
606
|
role: "menuitem",
|
|
481
|
-
class:
|
|
607
|
+
class: z(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
|
|
482
608
|
"data-wrap-type": e.choice,
|
|
483
609
|
"data-current": e.choice === u.value ? "true" : "false",
|
|
484
610
|
"data-disabled": m(e) ? "false" : "true",
|
|
485
611
|
disabled: !m(e),
|
|
486
|
-
title:
|
|
487
|
-
onMousedown: n[2] ||=
|
|
612
|
+
title: G(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
|
|
613
|
+
onMousedown: n[2] ||= q(() => {}, ["prevent"]),
|
|
488
614
|
onClick: (t) => h(e)
|
|
489
615
|
}, [
|
|
490
|
-
|
|
616
|
+
P("span", ti, [I(r, {
|
|
491
617
|
name: f(e.iconHint),
|
|
492
|
-
size:
|
|
618
|
+
size: ci
|
|
493
619
|
}, null, 8, ["name"])]),
|
|
494
|
-
|
|
495
|
-
e.choice === u.value ? (
|
|
620
|
+
P("span", ni, W(G(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
621
|
+
e.choice === u.value ? (V(), N("span", {
|
|
496
622
|
key: 0,
|
|
497
623
|
class: "image-ctx-menu__current-dot",
|
|
498
|
-
"aria-label":
|
|
499
|
-
}, "●", 8,
|
|
500
|
-
], 42,
|
|
501
|
-
e.textActions && e.textActions.length > 0 ? (
|
|
624
|
+
"aria-label": G(o)("imageWrap.menu.ariaLabel")
|
|
625
|
+
}, "●", 8, ri)) : M("", !0)
|
|
626
|
+
], 42, ei))), 128)),
|
|
627
|
+
e.textActions && e.textActions.length > 0 ? (V(), N(O, { key: 2 }, [n[5] ||= P("div", {
|
|
502
628
|
class: "image-ctx-menu__divider",
|
|
503
629
|
role: "separator"
|
|
504
|
-
}, null, -1), (
|
|
630
|
+
}, null, -1), (V(!0), N(O, null, U(e.textActions, (e, t) => (V(), N(O, { key: `${e.action}-${t}` }, [P("button", {
|
|
505
631
|
type: "button",
|
|
506
632
|
role: "menuitem",
|
|
507
633
|
class: "image-ctx-menu__item image-ctx-menu__item--text",
|
|
508
634
|
disabled: e.disabled,
|
|
509
|
-
onMousedown: n[3] ||=
|
|
635
|
+
onMousedown: n[3] ||= q(() => {}, ["prevent"]),
|
|
510
636
|
onClick: (t) => g(e)
|
|
511
|
-
}, [
|
|
512
|
-
], 46,
|
|
637
|
+
}, [P("span", ai, W(e.label), 1), e.shortcut ? (V(), N("span", oi, W(e.shortcut), 1)) : M("", !0)], 40, ii), e.dividerAfter ? (V(), N("div", si)) : M("", !0)], 64))), 128))], 64)) : M("", !0)
|
|
638
|
+
], 46, Xr)) : M("", !0)]));
|
|
513
639
|
}
|
|
514
|
-
}), [["__scopeId", "data-v-fc8f35bc"]]),
|
|
640
|
+
}), [["__scopeId", "data-v-fc8f35bc"]]), fi = ["disabled", "onMousedown"], pi = {
|
|
515
641
|
key: 0,
|
|
516
642
|
class: "ctx-menu__icon"
|
|
517
|
-
},
|
|
643
|
+
}, mi = { class: "ctx-menu__label" }, hi = {
|
|
518
644
|
key: 1,
|
|
519
645
|
class: "ctx-menu__shortcut"
|
|
520
|
-
},
|
|
646
|
+
}, gi = 220, _i = 32, vi = 10, yi = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
521
647
|
__name: "TextContextMenu",
|
|
522
648
|
props: {
|
|
523
649
|
isOpen: { type: Boolean },
|
|
@@ -534,7 +660,7 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
534
660
|
setup(e, { emit: t }) {
|
|
535
661
|
let n = e, r = ({ node: e }) => e;
|
|
536
662
|
r.props = ["node"];
|
|
537
|
-
let i = t, { t: a } = c(), o =
|
|
663
|
+
let i = t, { t: a } = c(), o = Yr(), s = H(null), l = k(() => {
|
|
538
664
|
let e = [], t = n.customItems ?? [];
|
|
539
665
|
for (let [n, r] of t.entries()) e.push({
|
|
540
666
|
id: `custom-${r.id}`,
|
|
@@ -669,9 +795,9 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
669
795
|
label: a("table.deleteTable"),
|
|
670
796
|
action: "deleteTable"
|
|
671
797
|
}), e;
|
|
672
|
-
}), u =
|
|
673
|
-
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 *
|
|
674
|
-
return typeof window < "u" && (e +
|
|
798
|
+
}), u = k(() => {
|
|
799
|
+
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 * _i + i * 9;
|
|
800
|
+
return typeof window < "u" && (e + gi + vi > window.innerWidth && (e = window.innerWidth - gi - vi), t + a + vi > window.innerHeight && (t = window.innerHeight - a - vi)), {
|
|
675
801
|
position: "fixed",
|
|
676
802
|
left: `${e}px`,
|
|
677
803
|
top: `${t}px`,
|
|
@@ -684,37 +810,37 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
684
810
|
function f(e) {
|
|
685
811
|
e.key === "Escape" && i("close");
|
|
686
812
|
}
|
|
687
|
-
return
|
|
688
|
-
e &&
|
|
689
|
-
}), (t, n) => (
|
|
813
|
+
return K(() => n.isOpen, (e) => {
|
|
814
|
+
e && R(() => s.value?.focus());
|
|
815
|
+
}), (t, n) => (V(), j(ge, { to: "body" }, [e.isOpen ? (V(), N("div", {
|
|
690
816
|
key: 0,
|
|
691
817
|
class: "ctx-menu-backdrop",
|
|
692
818
|
onMousedown: n[0] ||= (e) => t.$emit("close"),
|
|
693
|
-
onContextmenu: n[1] ||=
|
|
694
|
-
}, null, 32)) :
|
|
819
|
+
onContextmenu: n[1] ||= q((e) => t.$emit("close"), ["prevent"])
|
|
820
|
+
}, null, 32)) : M("", !0), e.isOpen ? (V(), N("div", {
|
|
695
821
|
key: 1,
|
|
696
822
|
ref_key: "menuRef",
|
|
697
823
|
ref: s,
|
|
698
|
-
class:
|
|
699
|
-
style:
|
|
700
|
-
onContextmenu: n[2] ||=
|
|
824
|
+
class: z(["ctx-menu", G(o)]),
|
|
825
|
+
style: B(u.value),
|
|
826
|
+
onContextmenu: n[2] ||= q(() => {}, ["prevent"]),
|
|
701
827
|
onKeydown: f
|
|
702
|
-
}, [(
|
|
828
|
+
}, [(V(!0), N(O, null, U(l.value, (e, t) => (V(), N("button", {
|
|
703
829
|
key: e.id || t,
|
|
704
|
-
class:
|
|
830
|
+
class: z(["ctx-menu__item", {
|
|
705
831
|
"ctx-menu__item--disabled": e.disabled,
|
|
706
832
|
"ctx-menu__item--divider": e.divider,
|
|
707
833
|
"ctx-menu__item--emphasis": e.emphasis
|
|
708
834
|
}]),
|
|
709
835
|
disabled: e.disabled,
|
|
710
|
-
onMousedown:
|
|
836
|
+
onMousedown: q((t) => d(e.action), ["prevent"])
|
|
711
837
|
}, [
|
|
712
|
-
e.icon ? (
|
|
713
|
-
|
|
714
|
-
e.shortcut ? (
|
|
715
|
-
], 42,
|
|
838
|
+
e.icon ? (V(), N("span", pi, [I(r, { node: e.icon }, null, 8, ["node"])])) : M("", !0),
|
|
839
|
+
P("span", mi, W(e.label), 1),
|
|
840
|
+
e.shortcut ? (V(), N("span", hi, W(e.shortcut), 1)) : M("", !0)
|
|
841
|
+
], 42, fi))), 128))], 38)) : M("", !0)]));
|
|
716
842
|
}
|
|
717
|
-
}), [["__scopeId", "data-v-c1416e84"]]),
|
|
843
|
+
}), [["__scopeId", "data-v-c1416e84"]]), bi = /* @__PURE__ */ L({
|
|
718
844
|
__name: "DocxEditorOverlays",
|
|
719
845
|
props: {
|
|
720
846
|
readOnly: { type: Boolean },
|
|
@@ -733,7 +859,7 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
733
859
|
],
|
|
734
860
|
setup(e, { emit: t }) {
|
|
735
861
|
let n = t;
|
|
736
|
-
return (t, r) => (
|
|
862
|
+
return (t, r) => (V(), N(O, null, [I(yi, {
|
|
737
863
|
"is-open": e.contextMenu.isOpen,
|
|
738
864
|
position: e.contextMenu.position,
|
|
739
865
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -755,7 +881,7 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
755
881
|
"can-merge-cells",
|
|
756
882
|
"can-split-cell",
|
|
757
883
|
"custom-items"
|
|
758
|
-
]),
|
|
884
|
+
]), I(di, {
|
|
759
885
|
state: e.imageContextMenu,
|
|
760
886
|
"text-actions": e.imageContextMenuTextActions,
|
|
761
887
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -772,7 +898,7 @@ var Pr = ["aria-label"], Fr = { class: "image-ctx-menu__icon" }, Ir = { class: "
|
|
|
772
898
|
});
|
|
773
899
|
//#endregion
|
|
774
900
|
//#region src/composables/imageOverlayRect.ts
|
|
775
|
-
function
|
|
901
|
+
function xi(e) {
|
|
776
902
|
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
777
903
|
return {
|
|
778
904
|
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
@@ -783,13 +909,13 @@ function ai(e) {
|
|
|
783
909
|
}
|
|
784
910
|
//#endregion
|
|
785
911
|
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
786
|
-
var
|
|
912
|
+
var Si = ["data-handle", "onMousedown"], Ci = ["title"], wi = {
|
|
787
913
|
key: 0,
|
|
788
914
|
class: "image-overlay__dim"
|
|
789
|
-
},
|
|
915
|
+
}, Ti = {
|
|
790
916
|
key: 1,
|
|
791
917
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
792
|
-
},
|
|
918
|
+
}, Ei = 4, Di = 15, Oi = 250, ki = 700, Ai = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
793
919
|
__name: "ImageSelectionOverlay",
|
|
794
920
|
props: {
|
|
795
921
|
imageInfo: {},
|
|
@@ -803,8 +929,8 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
803
929
|
"context-menu"
|
|
804
930
|
],
|
|
805
931
|
setup(e, { emit: t }) {
|
|
806
|
-
let { t: n } = c(), r = e, i = t, a =
|
|
807
|
-
function
|
|
932
|
+
let { t: n } = c(), r = e, i = t, a = H(null), o = H(!1), s = H(!1), l = H(!1), u = H(0), d = H(0), f = H(0), p = H(null), m = "se", h = 0, g = 0, _ = 0, v = 0, ee = null, y = null, b = null, te = null;
|
|
933
|
+
function x(e, t) {
|
|
808
934
|
if (!e) return null;
|
|
809
935
|
try {
|
|
810
936
|
let n = e.state.doc.nodeAt(t);
|
|
@@ -813,25 +939,25 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
813
939
|
return null;
|
|
814
940
|
}
|
|
815
941
|
}
|
|
816
|
-
function
|
|
942
|
+
function ne(e) {
|
|
817
943
|
if (!e) return null;
|
|
818
944
|
let t = e.attrs.transform;
|
|
819
945
|
return typeof t == "string" ? t : null;
|
|
820
946
|
}
|
|
821
|
-
function
|
|
947
|
+
function ie() {
|
|
822
948
|
return a.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
|
|
823
949
|
}
|
|
824
|
-
function
|
|
950
|
+
function ae() {
|
|
825
951
|
let e = r.imageInfo;
|
|
826
952
|
if (!e) return null;
|
|
827
953
|
if (e.element.isConnected) return e.element;
|
|
828
|
-
let t =
|
|
954
|
+
let t = ie();
|
|
829
955
|
if (!t) return null;
|
|
830
|
-
let n =
|
|
831
|
-
return n ?
|
|
956
|
+
let n = xt(t, e.pmPos);
|
|
957
|
+
return n ? dt(n) : null;
|
|
832
958
|
}
|
|
833
|
-
function
|
|
834
|
-
let e =
|
|
959
|
+
function S() {
|
|
960
|
+
let e = ae();
|
|
835
961
|
if (!e || !a.value) {
|
|
836
962
|
p.value = null;
|
|
837
963
|
return;
|
|
@@ -842,7 +968,7 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
842
968
|
return;
|
|
843
969
|
}
|
|
844
970
|
let n = t.getBoundingClientRect(), i = e.getBoundingClientRect();
|
|
845
|
-
p.value =
|
|
971
|
+
p.value = xi({
|
|
846
972
|
imageRect: i,
|
|
847
973
|
parentRect: n,
|
|
848
974
|
scrollLeft: t.scrollLeft,
|
|
@@ -852,49 +978,49 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
852
978
|
zoom: r.zoom
|
|
853
979
|
});
|
|
854
980
|
}
|
|
855
|
-
let
|
|
856
|
-
function
|
|
857
|
-
|
|
981
|
+
let oe = null;
|
|
982
|
+
function se() {
|
|
983
|
+
oe?.();
|
|
858
984
|
let e = 0, t = "", n = 0, r = 0, i = (a) => {
|
|
859
985
|
r === 0 && (r = a);
|
|
860
986
|
let o = a - r;
|
|
861
|
-
|
|
987
|
+
S();
|
|
862
988
|
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
863
|
-
n = c === t ? n + 1 : 0, t = c, !(o >=
|
|
989
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= Oi && n >= 2) && o < ki && (e = requestAnimationFrame(i));
|
|
864
990
|
};
|
|
865
991
|
e = requestAnimationFrame(i);
|
|
866
|
-
let a = setTimeout(
|
|
867
|
-
|
|
992
|
+
let a = setTimeout(S, Oi);
|
|
993
|
+
oe = () => {
|
|
868
994
|
cancelAnimationFrame(e), clearTimeout(a);
|
|
869
995
|
};
|
|
870
996
|
}
|
|
871
|
-
|
|
997
|
+
K(() => r.imageInfo, (e, t, n) => {
|
|
872
998
|
if (!r.imageInfo) {
|
|
873
999
|
p.value = null;
|
|
874
1000
|
return;
|
|
875
1001
|
}
|
|
876
|
-
|
|
877
|
-
}, { immediate: !0 }),
|
|
878
|
-
r.imageInfo &&
|
|
879
|
-
}),
|
|
1002
|
+
se(), n(() => oe?.());
|
|
1003
|
+
}, { immediate: !0 }), K(() => r.zoom, () => {
|
|
1004
|
+
r.imageInfo && se();
|
|
1005
|
+
}), K(() => r.imageInfo, (e, t, n) => {
|
|
880
1006
|
if (!r.imageInfo) return;
|
|
881
1007
|
let i = () => {
|
|
882
|
-
|
|
1008
|
+
y && cancelAnimationFrame(y), y = requestAnimationFrame(S);
|
|
883
1009
|
}, o = a.value?.closest(".docx-editor-vue__pages-viewport");
|
|
884
1010
|
o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
|
|
885
1011
|
let s = null, c = !1;
|
|
886
|
-
|
|
1012
|
+
R(() => {
|
|
887
1013
|
if (c || !r.imageInfo) return;
|
|
888
|
-
let e =
|
|
889
|
-
e && (s = new MutationObserver(() =>
|
|
1014
|
+
let e = ie();
|
|
1015
|
+
e && (s = new MutationObserver(() => se()), s.observe(e, {
|
|
890
1016
|
attributes: !0,
|
|
891
1017
|
attributeFilter: ["style"]
|
|
892
1018
|
}));
|
|
893
1019
|
}), n(() => {
|
|
894
|
-
c = !0, o?.removeEventListener("scroll", i), window.removeEventListener("resize", i), s?.disconnect(),
|
|
1020
|
+
c = !0, o?.removeEventListener("scroll", i), window.removeEventListener("resize", i), s?.disconnect(), y && cancelAnimationFrame(y);
|
|
895
1021
|
});
|
|
896
1022
|
}, { immediate: !0 });
|
|
897
|
-
let
|
|
1023
|
+
let C = k(() => o.value ? u.value : p.value?.width || 0), ce = k(() => o.value ? d.value : p.value?.height || 0), w = k(() => {
|
|
898
1024
|
let e = p.value;
|
|
899
1025
|
if (!e) return {
|
|
900
1026
|
position: "absolute",
|
|
@@ -912,11 +1038,11 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
912
1038
|
height: `${n}px`,
|
|
913
1039
|
transform: i === 1 ? void 0 : `scale(${i})`,
|
|
914
1040
|
transformOrigin: "top left",
|
|
915
|
-
zIndex:
|
|
1041
|
+
zIndex: re.imageOverlay,
|
|
916
1042
|
pointerEvents: "auto"
|
|
917
1043
|
};
|
|
918
|
-
}),
|
|
919
|
-
let e =
|
|
1044
|
+
}), le = k(() => {
|
|
1045
|
+
let e = C.value, t = ce.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
|
|
920
1046
|
return [
|
|
921
1047
|
{
|
|
922
1048
|
pos: "nw",
|
|
@@ -984,13 +1110,13 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
984
1110
|
}
|
|
985
1111
|
];
|
|
986
1112
|
});
|
|
987
|
-
function
|
|
988
|
-
!r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height,
|
|
1113
|
+
function ue(e, t) {
|
|
1114
|
+
!r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, ee = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", de), document.addEventListener("mouseup", T));
|
|
989
1115
|
}
|
|
990
|
-
function
|
|
991
|
-
let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o =
|
|
1116
|
+
function de(e) {
|
|
1117
|
+
let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = gt(m, n, i, _, v, a);
|
|
992
1118
|
u.value = Math.round(o.width), d.value = Math.round(o.height);
|
|
993
|
-
let s =
|
|
1119
|
+
let s = ee;
|
|
994
1120
|
if (s) {
|
|
995
1121
|
let e = m.includes("w") ? s.left + (s.width - o.width) : s.left, t = m.includes("n") ? s.top + (s.height - o.height) : s.top;
|
|
996
1122
|
p.value = {
|
|
@@ -1001,80 +1127,80 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1001
1127
|
};
|
|
1002
1128
|
}
|
|
1003
1129
|
}
|
|
1004
|
-
function
|
|
1005
|
-
document.removeEventListener("mousemove",
|
|
1130
|
+
function T() {
|
|
1131
|
+
document.removeEventListener("mousemove", de), document.removeEventListener("mouseup", T), o.value = !1, ee = null, i("interact-end");
|
|
1006
1132
|
let e = r.view, t = r.imageInfo;
|
|
1007
1133
|
if (!e || !t) {
|
|
1008
|
-
|
|
1134
|
+
S();
|
|
1009
1135
|
return;
|
|
1010
1136
|
}
|
|
1011
|
-
let n =
|
|
1012
|
-
n !== null &&
|
|
1137
|
+
let n = yt(e, t.pmPos, u.value, d.value);
|
|
1138
|
+
n !== null && be(n), R(() => S());
|
|
1013
1139
|
}
|
|
1014
|
-
let
|
|
1015
|
-
function
|
|
1140
|
+
let fe = 0, pe = 0, me = 0, he = 0, E = null, D = null;
|
|
1141
|
+
function ge(e) {
|
|
1016
1142
|
if (!e) return 0;
|
|
1017
1143
|
let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/)?.[1];
|
|
1018
1144
|
return t ? parseFloat(t) : 0;
|
|
1019
1145
|
}
|
|
1020
|
-
function
|
|
1146
|
+
function A(e, t) {
|
|
1021
1147
|
let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
|
|
1022
1148
|
return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
|
|
1023
1149
|
}
|
|
1024
|
-
function
|
|
1025
|
-
return Math.atan2(e -
|
|
1150
|
+
function j(e, t) {
|
|
1151
|
+
return Math.atan2(e - fe, -(t - pe)) * 180 / Math.PI;
|
|
1026
1152
|
}
|
|
1027
|
-
function
|
|
1153
|
+
function _e(e) {
|
|
1028
1154
|
if (!r.imageInfo) return;
|
|
1029
1155
|
let t = r.imageInfo.element.getBoundingClientRect();
|
|
1030
|
-
|
|
1156
|
+
fe = t.left + t.width / 2, pe = t.top + t.height / 2, E = ne(x(r.view, r.imageInfo.pmPos)), he = ge(E), D = r.imageInfo.element.querySelector("img"), me = j(e.clientX, e.clientY), f.value = he, l.value = !0, i("interact-start"), document.addEventListener("mousemove", ve), document.addEventListener("mouseup", F);
|
|
1031
1157
|
}
|
|
1032
|
-
function
|
|
1033
|
-
let t =
|
|
1034
|
-
e.shiftKey || (n = Math.round(n /
|
|
1158
|
+
function ve(e) {
|
|
1159
|
+
let t = j(e.clientX, e.clientY) - me, n = he + t;
|
|
1160
|
+
e.shiftKey || (n = Math.round(n / Di) * Di), f.value = (n % 360 + 360) % 360, D && (D.style.transform = A(E, f.value) || "");
|
|
1035
1161
|
}
|
|
1036
|
-
function
|
|
1037
|
-
document.removeEventListener("mousemove",
|
|
1162
|
+
function F() {
|
|
1163
|
+
document.removeEventListener("mousemove", ve), document.removeEventListener("mouseup", F), l.value = !1, i("interact-end");
|
|
1038
1164
|
let e = r.view, t = r.imageInfo;
|
|
1039
1165
|
try {
|
|
1040
|
-
let n = e && t ?
|
|
1166
|
+
let n = e && t ? x(e, t.pmPos) : null;
|
|
1041
1167
|
e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
|
|
1042
1168
|
...n.attrs,
|
|
1043
|
-
transform:
|
|
1044
|
-
})),
|
|
1169
|
+
transform: A(ne(n), f.value)
|
|
1170
|
+
})), be(t.pmPos));
|
|
1045
1171
|
} catch {} finally {
|
|
1046
|
-
|
|
1172
|
+
D && (D.style.transform = ""), D = null, E = null;
|
|
1047
1173
|
}
|
|
1048
|
-
|
|
1174
|
+
R(() => S());
|
|
1049
1175
|
}
|
|
1050
|
-
let
|
|
1051
|
-
function
|
|
1176
|
+
let I = null;
|
|
1177
|
+
function L(e) {
|
|
1052
1178
|
if (!r.imageInfo || !p.value) return;
|
|
1053
1179
|
let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
|
|
1054
1180
|
let c = e.clientX - t, l = e.clientY - n;
|
|
1055
|
-
if (!(!o && Math.sqrt(c * c + l * l) <
|
|
1181
|
+
if (!(!o && Math.sqrt(c * c + l * l) < Ei)) {
|
|
1056
1182
|
if (!o) {
|
|
1057
|
-
o = !0, s.value = !0, i("interact-start"),
|
|
1183
|
+
o = !0, s.value = !0, i("interact-start"), I = document.createElement("div"), I.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);";
|
|
1058
1184
|
let e = r.zoom;
|
|
1059
|
-
|
|
1185
|
+
I.style.width = `${a.width * e}px`, I.style.height = `${a.height * e}px`, document.body.appendChild(I);
|
|
1060
1186
|
}
|
|
1061
|
-
if (
|
|
1187
|
+
if (I) {
|
|
1062
1188
|
let t = r.zoom;
|
|
1063
|
-
|
|
1189
|
+
I.style.left = `${e.clientX - a.width * t / 2}px`, I.style.top = `${e.clientY - a.height * t / 2}px`;
|
|
1064
1190
|
}
|
|
1065
1191
|
}
|
|
1066
1192
|
}, l = (e) => {
|
|
1067
|
-
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", l),
|
|
1193
|
+
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", l), b = null, te = null, I &&= (I.remove(), null), s.value = !1, o && (i("interact-end"), ye(e.clientX, e.clientY));
|
|
1068
1194
|
};
|
|
1069
|
-
|
|
1195
|
+
b = c, te = l, document.addEventListener("mousemove", c), document.addEventListener("mouseup", l);
|
|
1070
1196
|
}
|
|
1071
|
-
function
|
|
1197
|
+
function ye(e, t) {
|
|
1072
1198
|
let n = r.view, i = r.imageInfo;
|
|
1073
1199
|
if (!n || !i) return;
|
|
1074
|
-
let o =
|
|
1200
|
+
let o = x(n, i.pmPos);
|
|
1075
1201
|
if (!o) return;
|
|
1076
1202
|
let s;
|
|
1077
|
-
if (
|
|
1203
|
+
if (bt(o)) {
|
|
1078
1204
|
let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
|
|
1079
1205
|
if (!o || o.length === 0) return;
|
|
1080
1206
|
let c = null;
|
|
@@ -1090,60 +1216,177 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1090
1216
|
c = e ? e.querySelector(".layout-page-content") : null;
|
|
1091
1217
|
}
|
|
1092
1218
|
if (!c) return;
|
|
1093
|
-
let l = c.getBoundingClientRect(), u = r.zoom, d =
|
|
1094
|
-
s =
|
|
1219
|
+
let l = c.getBoundingClientRect(), u = r.zoom, d = st((e - l.left) / u), f = st((t - l.top) / u);
|
|
1220
|
+
s = _t(n, i.pmPos, d, f);
|
|
1095
1221
|
} else {
|
|
1096
|
-
let r =
|
|
1222
|
+
let r = ie();
|
|
1097
1223
|
if (!r) return;
|
|
1098
|
-
let a =
|
|
1224
|
+
let a = ht(r, e, t, 1);
|
|
1099
1225
|
if (a == null || a < 0) return;
|
|
1100
|
-
s =
|
|
1226
|
+
s = vt(n, i.pmPos, a);
|
|
1101
1227
|
}
|
|
1102
|
-
s !== null &&
|
|
1228
|
+
s !== null && be(s), R(() => S());
|
|
1103
1229
|
}
|
|
1104
|
-
function
|
|
1230
|
+
function be(e) {
|
|
1105
1231
|
let t = r.view;
|
|
1106
1232
|
if (t) try {
|
|
1107
|
-
let n =
|
|
1233
|
+
let n = at.create(t.state.doc, e);
|
|
1108
1234
|
t.dispatch(t.state.tr.setSelection(n));
|
|
1109
1235
|
} catch {}
|
|
1110
1236
|
}
|
|
1111
|
-
return
|
|
1112
|
-
document.removeEventListener("mousemove",
|
|
1113
|
-
}), (t, r) => e.imageInfo ? (
|
|
1237
|
+
return Se(() => {
|
|
1238
|
+
document.removeEventListener("mousemove", de), document.removeEventListener("mouseup", T), document.removeEventListener("mousemove", ve), document.removeEventListener("mouseup", F), b && document.removeEventListener("mousemove", b), te && document.removeEventListener("mouseup", te), I &&= (I.remove(), null), y && cancelAnimationFrame(y), oe?.();
|
|
1239
|
+
}), (t, r) => e.imageInfo ? (V(), N("div", {
|
|
1114
1240
|
key: 0,
|
|
1115
1241
|
ref_key: "overlayRootRef",
|
|
1116
1242
|
ref: a,
|
|
1117
1243
|
class: "image-overlay",
|
|
1118
|
-
style:
|
|
1119
|
-
onMousedown: r[3] ||=
|
|
1244
|
+
style: B(w.value),
|
|
1245
|
+
onMousedown: r[3] ||= q(() => {}, ["stop"])
|
|
1120
1246
|
}, [
|
|
1121
|
-
r[4] ||=
|
|
1122
|
-
|
|
1247
|
+
r[4] ||= P("div", { class: "image-overlay__border" }, null, -1),
|
|
1248
|
+
P("div", {
|
|
1123
1249
|
class: "image-overlay__body",
|
|
1124
|
-
style:
|
|
1125
|
-
onMousedown: r[0] ||=
|
|
1126
|
-
onContextmenu: r[1] ||=
|
|
1250
|
+
style: B({ cursor: s.value ? "grabbing" : "grab" }),
|
|
1251
|
+
onMousedown: r[0] ||= q((e) => L(e), ["prevent", "stop"]),
|
|
1252
|
+
onContextmenu: r[1] ||= q((e) => t.$emit("context-menu", e), ["prevent", "stop"])
|
|
1127
1253
|
}, null, 36),
|
|
1128
|
-
(
|
|
1254
|
+
(V(!0), N(O, null, U(le.value, (e) => (V(), N("div", {
|
|
1129
1255
|
key: e.pos,
|
|
1130
1256
|
class: "image-overlay__handle",
|
|
1131
|
-
style:
|
|
1257
|
+
style: B(e.style),
|
|
1132
1258
|
"data-handle": e.pos,
|
|
1133
|
-
onMousedown:
|
|
1134
|
-
}, null, 44,
|
|
1135
|
-
r[5] ||=
|
|
1136
|
-
|
|
1259
|
+
onMousedown: q((t) => ue(t, e.pos), ["prevent", "stop"])
|
|
1260
|
+
}, null, 44, Si))), 128)),
|
|
1261
|
+
r[5] ||= P("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
1262
|
+
P("div", {
|
|
1137
1263
|
class: "image-overlay__rotate-handle",
|
|
1138
|
-
style:
|
|
1139
|
-
title:
|
|
1140
|
-
onMousedown: r[2] ||=
|
|
1141
|
-
}, null, 44,
|
|
1142
|
-
o.value ? (
|
|
1143
|
-
l.value ? (
|
|
1144
|
-
], 36)) :
|
|
1264
|
+
style: B({ left: `${C.value / 2 - 7}px` }),
|
|
1265
|
+
title: G(n)("imageOverlay.rotate"),
|
|
1266
|
+
onMousedown: r[2] ||= q((e) => _e(e), ["prevent", "stop"])
|
|
1267
|
+
}, null, 44, Ci),
|
|
1268
|
+
o.value ? (V(), N("div", wi, W(Math.round(u.value)) + " × " + W(Math.round(d.value)), 1)) : M("", !0),
|
|
1269
|
+
l.value ? (V(), N("div", Ti, W(Math.round(f.value)) + "° ", 1)) : M("", !0)
|
|
1270
|
+
], 36)) : M("", !0);
|
|
1145
1271
|
}
|
|
1146
|
-
}), [["__scopeId", "data-v-4c3d1a1d"]]),
|
|
1272
|
+
}), [["__scopeId", "data-v-4c3d1a1d"]]), ji = /* @__PURE__ */ L({
|
|
1273
|
+
__name: "HeaderFooterSelectionOverlay",
|
|
1274
|
+
props: {
|
|
1275
|
+
pagesContainer: {},
|
|
1276
|
+
selection: {},
|
|
1277
|
+
zoom: {}
|
|
1278
|
+
},
|
|
1279
|
+
setup(e) {
|
|
1280
|
+
let t = e, n = new wt(), r = () => {
|
|
1281
|
+
t.pagesContainer && n.sync(t.pagesContainer, t.selection, t.zoom);
|
|
1282
|
+
};
|
|
1283
|
+
return K(() => t.pagesContainer, (e, t, i) => {
|
|
1284
|
+
e && (e.addEventListener(Ct, r), r(), i(() => {
|
|
1285
|
+
e.removeEventListener(Ct, r), n.clear(e);
|
|
1286
|
+
}));
|
|
1287
|
+
}, { immediate: !0 }), K(() => [
|
|
1288
|
+
t.selection?.rId,
|
|
1289
|
+
t.selection?.kind,
|
|
1290
|
+
t.selection?.from,
|
|
1291
|
+
t.selection?.to,
|
|
1292
|
+
t.selection?.pageNumber,
|
|
1293
|
+
t.zoom
|
|
1294
|
+
], r), (e, t) => null;
|
|
1295
|
+
}
|
|
1296
|
+
}), Mi = { class: "hf-editor-label" }, Ni = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
1297
|
+
__name: "InlineHeaderFooterEditor",
|
|
1298
|
+
props: {
|
|
1299
|
+
edit: {},
|
|
1300
|
+
getView: { type: Function }
|
|
1301
|
+
},
|
|
1302
|
+
emits: ["close", "remove"],
|
|
1303
|
+
setup(e, { emit: t }) {
|
|
1304
|
+
let n = e, r = t, { Button: i } = p(), { t: a } = c(), o = H(!1), s = k(() => n.edit.position === "header" ? a("headerFooter.header") : a("headerFooter.footer")), l = k(() => ({
|
|
1305
|
+
position: "absolute",
|
|
1306
|
+
top: `${n.edit.targetRect?.top ?? 0}px`,
|
|
1307
|
+
left: `${n.edit.targetRect?.left ?? 0}px`,
|
|
1308
|
+
width: `${n.edit.targetRect?.width ?? 0}px`,
|
|
1309
|
+
height: `${n.edit.targetRect?.height ?? 0}px`,
|
|
1310
|
+
pointerEvents: "none",
|
|
1311
|
+
zIndex: 10
|
|
1312
|
+
})), u = (e) => {
|
|
1313
|
+
o.value = !1;
|
|
1314
|
+
let t = n.getView(), r = He.nodes.field;
|
|
1315
|
+
if (!t || !r) return;
|
|
1316
|
+
let { $from: i, from: a } = t.state.selection, s = t.state.storedMarks ?? i.marks(), c = r.create({
|
|
1317
|
+
fieldType: e,
|
|
1318
|
+
instruction: ` ${e} \\* MERGEFORMAT `,
|
|
1319
|
+
fieldKind: "simple",
|
|
1320
|
+
dirty: !0
|
|
1321
|
+
});
|
|
1322
|
+
t.dispatch(t.state.tr.insert(a, c.mark(s))), t.focus();
|
|
1323
|
+
}, d = (e) => {
|
|
1324
|
+
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), r("close"));
|
|
1325
|
+
}, f = null;
|
|
1326
|
+
return Ce(() => {
|
|
1327
|
+
document.addEventListener("keydown", d, !0);
|
|
1328
|
+
let e = 0, t = () => {
|
|
1329
|
+
let r = n.getView();
|
|
1330
|
+
r && !r.hasFocus() && r.focus(), e++, e < 30 && (f = requestAnimationFrame(t));
|
|
1331
|
+
};
|
|
1332
|
+
f = requestAnimationFrame(t);
|
|
1333
|
+
}), Se(() => {
|
|
1334
|
+
document.removeEventListener("keydown", d, !0), f !== null && cancelAnimationFrame(f);
|
|
1335
|
+
}), (t, n) => (V(), N("div", {
|
|
1336
|
+
class: "hf-inline-editor",
|
|
1337
|
+
style: B(l.value),
|
|
1338
|
+
role: "presentation"
|
|
1339
|
+
}, [P("div", { class: z(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span", Mi, W(s.value), 1), P("div", {
|
|
1340
|
+
class: "hf-options",
|
|
1341
|
+
onMousedown: n[5] ||= q(() => {}, ["stop"])
|
|
1342
|
+
}, [I(G(i), {
|
|
1343
|
+
variant: "ghost",
|
|
1344
|
+
size: "xs",
|
|
1345
|
+
"class-name": "hf-options-button",
|
|
1346
|
+
onClick: n[0] ||= q((e) => o.value = !o.value, ["stop"])
|
|
1347
|
+
}, {
|
|
1348
|
+
default: ke(() => [F(W(G(a)("headerFooter.options")) + " ▾ ", 1)]),
|
|
1349
|
+
_: 1
|
|
1350
|
+
}), o.value ? (V(), N("div", {
|
|
1351
|
+
key: 0,
|
|
1352
|
+
class: z(["hf-options-dropdown", { "hf-options-dropdown--up": e.edit.position === "footer" }])
|
|
1353
|
+
}, [
|
|
1354
|
+
I(G(i), {
|
|
1355
|
+
variant: "ghost",
|
|
1356
|
+
size: "xs",
|
|
1357
|
+
onClick: n[1] ||= (e) => u("PAGE")
|
|
1358
|
+
}, {
|
|
1359
|
+
default: ke(() => [F(W(G(a)("headerFooter.insertPageNumber")), 1)]),
|
|
1360
|
+
_: 1
|
|
1361
|
+
}),
|
|
1362
|
+
I(G(i), {
|
|
1363
|
+
variant: "ghost",
|
|
1364
|
+
size: "xs",
|
|
1365
|
+
onClick: n[2] ||= (e) => u("NUMPAGES")
|
|
1366
|
+
}, {
|
|
1367
|
+
default: ke(() => [F(W(G(a)("headerFooter.insertPageCount")), 1)]),
|
|
1368
|
+
_: 1
|
|
1369
|
+
}),
|
|
1370
|
+
n[6] ||= P("div", { class: "hf-options-divider" }, null, -1),
|
|
1371
|
+
I(G(i), {
|
|
1372
|
+
variant: "ghost",
|
|
1373
|
+
size: "xs",
|
|
1374
|
+
onClick: n[3] ||= (e) => r("remove")
|
|
1375
|
+
}, {
|
|
1376
|
+
default: ke(() => [F(W(e.edit.position === "header" ? G(a)("headerFooter.removeHeader") : G(a)("headerFooter.removeFooter")), 1)]),
|
|
1377
|
+
_: 1
|
|
1378
|
+
}),
|
|
1379
|
+
I(G(i), {
|
|
1380
|
+
variant: "ghost",
|
|
1381
|
+
size: "xs",
|
|
1382
|
+
onClick: n[4] ||= (e) => r("close")
|
|
1383
|
+
}, {
|
|
1384
|
+
default: ke(() => [F(W(e.edit.position === "header" ? G(a)("headerFooter.closeHeaderEditing") : G(a)("headerFooter.closeFooterEditing")), 1)]),
|
|
1385
|
+
_: 1
|
|
1386
|
+
})
|
|
1387
|
+
], 2)) : M("", !0)], 32)], 2)], 4));
|
|
1388
|
+
}
|
|
1389
|
+
}), [["__scopeId", "data-v-a0bd3730"]]), Pi = ["title", "aria-label"], Fi = /* @__PURE__ */ L({
|
|
1147
1390
|
__name: "OutlineToggleButton",
|
|
1148
1391
|
props: {
|
|
1149
1392
|
leftOffset: {},
|
|
@@ -1152,23 +1395,23 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1152
1395
|
emits: ["toggle"],
|
|
1153
1396
|
setup(e) {
|
|
1154
1397
|
let { t } = c();
|
|
1155
|
-
return (n, i) => (
|
|
1398
|
+
return (n, i) => (V(), N("button", {
|
|
1156
1399
|
type: "button",
|
|
1157
1400
|
class: "docx-outline-toggle docx-editor-vue__outline-toggle",
|
|
1158
|
-
style:
|
|
1401
|
+
style: B({
|
|
1159
1402
|
left: e.leftOffset + "px",
|
|
1160
1403
|
top: e.topPx + "px"
|
|
1161
1404
|
}),
|
|
1162
|
-
title:
|
|
1163
|
-
"aria-label":
|
|
1405
|
+
title: G(t)("editor.showDocumentOutline"),
|
|
1406
|
+
"aria-label": G(t)("editor.showDocumentOutline"),
|
|
1164
1407
|
onClick: i[0] ||= (e) => n.$emit("toggle"),
|
|
1165
|
-
onMousedown: i[1] ||=
|
|
1166
|
-
}, [
|
|
1408
|
+
onMousedown: i[1] ||= q(() => {}, ["stop"])
|
|
1409
|
+
}, [I(r, {
|
|
1167
1410
|
name: "format_list_bulleted",
|
|
1168
1411
|
size: 20
|
|
1169
|
-
})], 44,
|
|
1412
|
+
})], 44, Pi));
|
|
1170
1413
|
}
|
|
1171
|
-
}),
|
|
1414
|
+
}), Ii = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
1172
1415
|
__name: "PageIndicator",
|
|
1173
1416
|
props: {
|
|
1174
1417
|
currentPage: {},
|
|
@@ -1177,17 +1420,17 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1177
1420
|
},
|
|
1178
1421
|
setup(e) {
|
|
1179
1422
|
let { t } = c();
|
|
1180
|
-
return (n, r) => (
|
|
1423
|
+
return (n, r) => (V(), N("div", {
|
|
1181
1424
|
class: "docx-editor-vue__page-indicator",
|
|
1182
|
-
style:
|
|
1425
|
+
style: B({ opacity: +!!e.visible }),
|
|
1183
1426
|
"aria-live": "polite",
|
|
1184
1427
|
role: "status"
|
|
1185
|
-
},
|
|
1428
|
+
}, W(G(t)("viewer.pageIndicator", {
|
|
1186
1429
|
current: e.currentPage,
|
|
1187
1430
|
total: e.totalPages
|
|
1188
1431
|
})), 5));
|
|
1189
1432
|
}
|
|
1190
|
-
}), [["__scopeId", "data-v-f1904974"]]),
|
|
1433
|
+
}), [["__scopeId", "data-v-f1904974"]]), Li = ["data-folio-block-id"], Ri = ["data-folio-block-id", "title"], zi = 2.5, Bi = 5, Vi = 6, Hi = 2, Ui = 2, Wi = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
1191
1434
|
__name: "TemplateDirectivesOverlay",
|
|
1192
1435
|
props: {
|
|
1193
1436
|
getView: { type: Function },
|
|
@@ -1201,19 +1444,19 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1201
1444
|
setup(e) {
|
|
1202
1445
|
let t = e, n = /* @__PURE__ */ new Set(["if", "each"]), r = /* @__PURE__ */ new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
|
|
1203
1446
|
function a(e) {
|
|
1204
|
-
let t = e -
|
|
1205
|
-
return t <= 0 ? 0 : Math.floor(t /
|
|
1447
|
+
let t = e - Vi - zi - Hi;
|
|
1448
|
+
return t <= 0 ? 0 : Math.floor(t / Bi);
|
|
1206
1449
|
}
|
|
1207
1450
|
function o(e, t, n) {
|
|
1208
1451
|
let r = a(n), i = Math.min(Math.max(0, e), r);
|
|
1209
|
-
return t -
|
|
1452
|
+
return t - Vi - zi - (r - i) * Bi;
|
|
1210
1453
|
}
|
|
1211
1454
|
function s(e, t) {
|
|
1212
|
-
if (t.length === 0) return e.bottom - e.top >=
|
|
1455
|
+
if (t.length === 0) return e.bottom - e.top >= Ui ? [e] : [];
|
|
1213
1456
|
let n = [];
|
|
1214
1457
|
for (let r of t) {
|
|
1215
1458
|
let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
|
|
1216
|
-
i - t >=
|
|
1459
|
+
i - t >= Ui && n.push({
|
|
1217
1460
|
top: t,
|
|
1218
1461
|
bottom: i
|
|
1219
1462
|
});
|
|
@@ -1278,24 +1521,24 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1278
1521
|
}
|
|
1279
1522
|
return i;
|
|
1280
1523
|
}
|
|
1281
|
-
let f =
|
|
1282
|
-
function
|
|
1524
|
+
let f = H([]), p = H([]), m = H(null), h = H(null), g = H(null), _ = Ye(), v = null;
|
|
1525
|
+
function ee() {
|
|
1283
1526
|
v !== null && cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
1284
|
-
v = null,
|
|
1527
|
+
v = null, y();
|
|
1285
1528
|
});
|
|
1286
1529
|
}
|
|
1287
|
-
async function
|
|
1530
|
+
async function y() {
|
|
1288
1531
|
let e = _.begin(), n = t.getView(), r = t.getPagesContainer(), i = t.editorState;
|
|
1289
1532
|
if (!n || !r || !i) {
|
|
1290
1533
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1291
1534
|
return;
|
|
1292
1535
|
}
|
|
1293
|
-
let a =
|
|
1536
|
+
let a = Et(i);
|
|
1294
1537
|
if (a.length === 0) {
|
|
1295
1538
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1296
1539
|
return;
|
|
1297
1540
|
}
|
|
1298
|
-
let o =
|
|
1541
|
+
let o = Xe(r, t.zoom), s = await Ze(a, {
|
|
1299
1542
|
pagesContainer: r,
|
|
1300
1543
|
zoom: t.zoom,
|
|
1301
1544
|
layout: t.layout,
|
|
@@ -1304,95 +1547,95 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1304
1547
|
});
|
|
1305
1548
|
e() && (f.value = a, h.value = i.selection.head, m.value = o, p.value = s);
|
|
1306
1549
|
}
|
|
1307
|
-
|
|
1550
|
+
K(() => [
|
|
1308
1551
|
t.editorState,
|
|
1309
1552
|
t.zoom,
|
|
1310
1553
|
t.layout,
|
|
1311
1554
|
t.blocks,
|
|
1312
1555
|
t.measures
|
|
1313
|
-
], () =>
|
|
1314
|
-
let
|
|
1556
|
+
], () => ee());
|
|
1557
|
+
let b = k(() => c(f.value)), te = k(() => m.value ? d(b.value, p.value, m.value) : []), x = k(() => {
|
|
1315
1558
|
let e = /* @__PURE__ */ new Map();
|
|
1316
|
-
for (let t of
|
|
1559
|
+
for (let t of b.value) e.set(t.openerFrom, t.blockId), e.set(t.closerFrom, t.blockId);
|
|
1317
1560
|
return e;
|
|
1318
|
-
}),
|
|
1561
|
+
}), ne = k(() => {
|
|
1319
1562
|
let e = /* @__PURE__ */ new Map();
|
|
1320
|
-
for (let t of
|
|
1563
|
+
for (let t of b.value) e.set(t.closerFrom, l(t.kind, t.openerExpr));
|
|
1321
1564
|
return e;
|
|
1322
|
-
}),
|
|
1323
|
-
function re(e) {
|
|
1324
|
-
return e === g.value || e === ne.value;
|
|
1325
|
-
}
|
|
1565
|
+
}), re = k(() => u(b.value, h.value));
|
|
1326
1566
|
function ie(e) {
|
|
1327
|
-
return e
|
|
1328
|
-
}
|
|
1329
|
-
function C(e) {
|
|
1330
|
-
return e.block ? S.value.get(e.from) : void 0;
|
|
1567
|
+
return e === g.value || e === re.value;
|
|
1331
1568
|
}
|
|
1332
1569
|
function ae(e) {
|
|
1333
|
-
return e.block
|
|
1570
|
+
return e.block && (n.has(e.kind) || r.has(e.kind));
|
|
1571
|
+
}
|
|
1572
|
+
function S(e) {
|
|
1573
|
+
return e.block ? x.value.get(e.from) : void 0;
|
|
1334
1574
|
}
|
|
1335
1575
|
function oe(e) {
|
|
1336
|
-
|
|
1576
|
+
return e.block ? ne.value.get(e.from) : void 0;
|
|
1577
|
+
}
|
|
1578
|
+
function se(e) {
|
|
1579
|
+
let t = S(e), n = t !== void 0 && ie(t);
|
|
1337
1580
|
return [
|
|
1338
1581
|
"folio-template-directive",
|
|
1339
1582
|
`folio-template-directive--${e.kind}`,
|
|
1340
|
-
{ "folio-template-directive--block":
|
|
1583
|
+
{ "folio-template-directive--block": ae(e) },
|
|
1341
1584
|
{ "folio-template-directive--active": n }
|
|
1342
1585
|
];
|
|
1343
1586
|
}
|
|
1344
|
-
function
|
|
1587
|
+
function C(e) {
|
|
1345
1588
|
if (!(e instanceof HTMLElement)) return null;
|
|
1346
1589
|
let t = e.dataset.folioBlockId;
|
|
1347
1590
|
return t === void 0 ? null : Number(t);
|
|
1348
1591
|
}
|
|
1349
|
-
function
|
|
1350
|
-
let t =
|
|
1592
|
+
function ce(e) {
|
|
1593
|
+
let t = C(e.target);
|
|
1351
1594
|
t !== null && (g.value = t);
|
|
1352
1595
|
}
|
|
1353
|
-
function
|
|
1354
|
-
let t =
|
|
1596
|
+
function w(e) {
|
|
1597
|
+
let t = C(e.target);
|
|
1355
1598
|
if (t === null) return;
|
|
1356
|
-
let n =
|
|
1599
|
+
let n = C(e.relatedTarget);
|
|
1357
1600
|
n !== t && g.value === t && (g.value = n);
|
|
1358
1601
|
}
|
|
1359
|
-
return
|
|
1602
|
+
return Ce(() => ee()), Se(() => {
|
|
1360
1603
|
_.invalidate(), v !== null && (cancelAnimationFrame(v), v = null);
|
|
1361
|
-
}), (t, n) => (
|
|
1604
|
+
}), (t, n) => (V(), N("div", {
|
|
1362
1605
|
class: "folio-template-directives-overlay",
|
|
1363
1606
|
"data-folio-template-directives-overlay": "",
|
|
1364
|
-
onPointerover:
|
|
1365
|
-
onPointerout:
|
|
1366
|
-
}, [(
|
|
1607
|
+
onPointerover: ce,
|
|
1608
|
+
onPointerout: w
|
|
1609
|
+
}, [(V(!0), N(O, null, U(te.value, (t) => (V(), N(O, { key: `rail:${t.blockId}` }, [(V(!0), N(O, null, U(t.segments, (n, r) => (V(), N("div", {
|
|
1367
1610
|
key: `rail:${t.blockId}:${r}`,
|
|
1368
|
-
class:
|
|
1611
|
+
class: z([
|
|
1369
1612
|
"folio-template-band-rail",
|
|
1370
1613
|
`folio-template-band-rail--${t.kind}`,
|
|
1371
|
-
{ "folio-template-band-rail--active":
|
|
1614
|
+
{ "folio-template-band-rail--active": ie(t.blockId) }
|
|
1372
1615
|
]),
|
|
1373
1616
|
"data-folio-block-id": t.blockId,
|
|
1374
|
-
style:
|
|
1617
|
+
style: B({
|
|
1375
1618
|
position: "absolute",
|
|
1376
1619
|
left: `${t.railX * e.zoom}px`,
|
|
1377
1620
|
top: `${n.top * e.zoom}px`,
|
|
1378
|
-
width: `${
|
|
1621
|
+
width: `${zi * e.zoom}px`,
|
|
1379
1622
|
height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
|
|
1380
1623
|
})
|
|
1381
|
-
}, null, 14,
|
|
1624
|
+
}, null, 14, Li))), 128))], 64))), 128)), (V(!0), N(O, null, U(p.value, (t, n) => (V(), N(O, { key: `d:${n}` }, [(V(!0), N(O, null, U(t.rects, (r, i) => (V(), N("span", {
|
|
1382
1625
|
key: `d:${n}:${i}`,
|
|
1383
|
-
class:
|
|
1384
|
-
"data-folio-block-id":
|
|
1385
|
-
title:
|
|
1386
|
-
style:
|
|
1626
|
+
class: z(se(t.range)),
|
|
1627
|
+
"data-folio-block-id": S(t.range),
|
|
1628
|
+
title: oe(t.range),
|
|
1629
|
+
style: B({
|
|
1387
1630
|
position: "absolute",
|
|
1388
1631
|
left: `${(r.x - 1) * e.zoom}px`,
|
|
1389
1632
|
top: `${(r.y + 1) * e.zoom}px`,
|
|
1390
1633
|
width: `${(r.width + 2) * e.zoom}px`,
|
|
1391
1634
|
height: `${Math.max(0, r.height - 2) * e.zoom}px`
|
|
1392
1635
|
})
|
|
1393
|
-
}, null, 14,
|
|
1636
|
+
}, null, 14, Ri))), 128))], 64))), 128))], 32));
|
|
1394
1637
|
}
|
|
1395
|
-
}), [["__scopeId", "data-v-c72dfa21"]]),
|
|
1638
|
+
}), [["__scopeId", "data-v-c72dfa21"]]), Gi = ["href", "title"], Ki = ["title"], qi = ["title"], Ji = ["title"], Yi = { class: "docx-hyperlink-popup__edit-row" }, Xi = ["placeholder", "onKeydown"], Zi = { class: "docx-hyperlink-popup__edit-row" }, Qi = ["onKeydown"], $i = ["disabled"], ea = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
1396
1639
|
__name: "HyperlinkPopup",
|
|
1397
1640
|
props: {
|
|
1398
1641
|
data: {},
|
|
@@ -1406,25 +1649,25 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1406
1649
|
"close"
|
|
1407
1650
|
],
|
|
1408
1651
|
setup(e, { emit: t }) {
|
|
1409
|
-
let { t: n } = c(), r = e, i = t, a =
|
|
1652
|
+
let { t: n } = c(), r = e, i = t, a = H(!1), o = H(""), s = H(""), l = H(null), u = k(() => ({
|
|
1410
1653
|
left: (r.data?.position.left ?? 0) + "px",
|
|
1411
1654
|
top: (r.data?.position.top ?? 0) + "px"
|
|
1412
1655
|
}));
|
|
1413
|
-
|
|
1656
|
+
K(() => r.data?.href, () => {
|
|
1414
1657
|
a.value = !1;
|
|
1415
1658
|
});
|
|
1416
1659
|
let d = null, f = null;
|
|
1417
1660
|
function p() {
|
|
1418
1661
|
f &&= (clearTimeout(f), null), d &&= (document.removeEventListener("mousedown", d), null);
|
|
1419
1662
|
}
|
|
1420
|
-
|
|
1663
|
+
K(() => r.data, (e) => {
|
|
1421
1664
|
p(), e && (d = (e) => {
|
|
1422
1665
|
let t = l.value, n = e.target;
|
|
1423
1666
|
t && n instanceof Node && !t.contains(n) && i("close");
|
|
1424
1667
|
}, f = setTimeout(() => {
|
|
1425
1668
|
d && document.addEventListener("mousedown", d);
|
|
1426
1669
|
}, 0));
|
|
1427
|
-
}, { immediate: !0 }),
|
|
1670
|
+
}, { immediate: !0 }), Se(p);
|
|
1428
1671
|
function m() {
|
|
1429
1672
|
r.data && (o.value = r.data.displayText, s.value = r.data.href, a.value = !0);
|
|
1430
1673
|
}
|
|
@@ -1434,41 +1677,41 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1434
1677
|
function g() {
|
|
1435
1678
|
r.data && (i("copy", r.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(r.data.href).catch(() => {}));
|
|
1436
1679
|
}
|
|
1437
|
-
return (t, r) => e.data ? (
|
|
1680
|
+
return (t, r) => e.data ? (V(), N("div", {
|
|
1438
1681
|
key: 0,
|
|
1439
1682
|
ref_key: "popupRef",
|
|
1440
1683
|
ref: l,
|
|
1441
|
-
class:
|
|
1442
|
-
style:
|
|
1443
|
-
onMousedown: r[6] ||=
|
|
1444
|
-
}, [a.value ? (
|
|
1684
|
+
class: z(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
|
|
1685
|
+
style: B(u.value),
|
|
1686
|
+
onMousedown: r[6] ||= q(() => {}, ["stop"])
|
|
1687
|
+
}, [a.value ? (V(), N(O, { key: 1 }, [P("div", Yi, [Ae(P("input", {
|
|
1445
1688
|
class: "docx-hyperlink-popup__input",
|
|
1446
|
-
placeholder:
|
|
1689
|
+
placeholder: G(n)("displayText"),
|
|
1447
1690
|
"onUpdate:modelValue": r[2] ||= (e) => o.value = e,
|
|
1448
|
-
onKeydown: [
|
|
1449
|
-
}, null, 40,
|
|
1691
|
+
onKeydown: [je(q(h, ["prevent"]), ["enter"]), r[3] ||= je((e) => t.$emit("close"), ["esc"])]
|
|
1692
|
+
}, null, 40, Xi), [[Oe, o.value]])]), P("div", Zi, [Ae(P("input", {
|
|
1450
1693
|
class: "docx-hyperlink-popup__input",
|
|
1451
1694
|
placeholder: "https://...",
|
|
1452
1695
|
"onUpdate:modelValue": r[4] ||= (e) => s.value = e,
|
|
1453
|
-
onKeydown: [
|
|
1454
|
-
}, null, 40,
|
|
1696
|
+
onKeydown: [je(q(h, ["prevent"]), ["enter"]), r[5] ||= je((e) => t.$emit("close"), ["esc"])]
|
|
1697
|
+
}, null, 40, Qi), [[Oe, s.value]]), P("button", {
|
|
1455
1698
|
class: "docx-hyperlink-popup__apply",
|
|
1456
1699
|
disabled: !s.value.trim(),
|
|
1457
|
-
onClick:
|
|
1458
|
-
},
|
|
1459
|
-
r[10] ||=
|
|
1460
|
-
|
|
1700
|
+
onClick: q(h, ["prevent"])
|
|
1701
|
+
}, W(G(n)("common.apply")), 9, $i)])], 64)) : (V(), N(O, { key: 0 }, [
|
|
1702
|
+
r[10] ||= ve("<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),
|
|
1703
|
+
P("a", {
|
|
1461
1704
|
class: "docx-hyperlink-popup__url",
|
|
1462
1705
|
href: e.data.href,
|
|
1463
1706
|
title: e.data.href,
|
|
1464
|
-
onClick: r[0] ||=
|
|
1465
|
-
},
|
|
1466
|
-
r[11] ||=
|
|
1467
|
-
|
|
1707
|
+
onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1708
|
+
}, W(e.data.href), 9, Gi),
|
|
1709
|
+
r[11] ||= P("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1710
|
+
P("button", {
|
|
1468
1711
|
class: "docx-hyperlink-popup__btn",
|
|
1469
|
-
title:
|
|
1470
|
-
onClick:
|
|
1471
|
-
}, [...r[7] ||= [
|
|
1712
|
+
title: G(n)("copyLink"),
|
|
1713
|
+
onClick: q(g, ["prevent"])
|
|
1714
|
+
}, [...r[7] ||= [P("svg", {
|
|
1472
1715
|
width: "18",
|
|
1473
1716
|
height: "18",
|
|
1474
1717
|
viewBox: "0 0 24 24",
|
|
@@ -1477,20 +1720,20 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1477
1720
|
"stroke-width": "2",
|
|
1478
1721
|
"stroke-linecap": "round",
|
|
1479
1722
|
"stroke-linejoin": "round"
|
|
1480
|
-
}, [
|
|
1723
|
+
}, [P("rect", {
|
|
1481
1724
|
x: "9",
|
|
1482
1725
|
y: "9",
|
|
1483
1726
|
width: "13",
|
|
1484
1727
|
height: "13",
|
|
1485
1728
|
rx: "2",
|
|
1486
1729
|
ry: "2"
|
|
1487
|
-
}),
|
|
1488
|
-
e.readOnly ?
|
|
1730
|
+
}), P("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Ki),
|
|
1731
|
+
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
1489
1732
|
key: 0,
|
|
1490
1733
|
class: "docx-hyperlink-popup__btn",
|
|
1491
|
-
title:
|
|
1492
|
-
onClick:
|
|
1493
|
-
}, [...r[8] ||= [
|
|
1734
|
+
title: G(n)("editLink"),
|
|
1735
|
+
onClick: q(m, ["prevent"])
|
|
1736
|
+
}, [...r[8] ||= [P("svg", {
|
|
1494
1737
|
width: "18",
|
|
1495
1738
|
height: "18",
|
|
1496
1739
|
viewBox: "0 0 24 24",
|
|
@@ -1499,44 +1742,44 @@ var oi = ["data-handle", "onMousedown"], si = ["title"], ci = {
|
|
|
1499
1742
|
"stroke-width": "2",
|
|
1500
1743
|
"stroke-linecap": "round",
|
|
1501
1744
|
"stroke-linejoin": "round"
|
|
1502
|
-
}, [
|
|
1503
|
-
e.readOnly ?
|
|
1745
|
+
}, [P("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), P("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, qi)),
|
|
1746
|
+
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
1504
1747
|
key: 1,
|
|
1505
1748
|
class: "docx-hyperlink-popup__btn",
|
|
1506
|
-
title:
|
|
1507
|
-
onClick: r[1] ||=
|
|
1508
|
-
}, [...r[9] ||= [
|
|
1509
|
-
], 64))], 38)) :
|
|
1749
|
+
title: G(n)("removeLink"),
|
|
1750
|
+
onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
|
|
1751
|
+
}, [...r[9] ||= [ve("<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, Ji))
|
|
1752
|
+
], 64))], 38)) : M("", !0);
|
|
1510
1753
|
}
|
|
1511
1754
|
}), [["__scopeId", "data-v-366df18c"]]);
|
|
1512
1755
|
//#endregion
|
|
1513
1756
|
//#region src/composables/commentMarks.ts
|
|
1514
|
-
function
|
|
1757
|
+
function ta(e, t) {
|
|
1515
1758
|
let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
|
|
1516
1759
|
return n === r ? null : {
|
|
1517
1760
|
from: n,
|
|
1518
1761
|
to: r
|
|
1519
1762
|
};
|
|
1520
1763
|
}
|
|
1521
|
-
function
|
|
1764
|
+
function na({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
|
|
1522
1765
|
let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
|
|
1523
|
-
return i ?
|
|
1766
|
+
return i ? ta(e, i) : null;
|
|
1524
1767
|
}
|
|
1525
|
-
function
|
|
1526
|
-
let i = e.state.schema.marks.comment, a =
|
|
1768
|
+
function ra(e, t, n, r) {
|
|
1769
|
+
let i = e.state.schema.marks.comment, a = ta(e.state.doc.content.size, t);
|
|
1527
1770
|
if (!i || !a) return !1;
|
|
1528
1771
|
let o = e.state.tr;
|
|
1529
|
-
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId:
|
|
1772
|
+
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: Z }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(ot.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
|
|
1530
1773
|
}
|
|
1531
|
-
function
|
|
1532
|
-
let n = e.state.schema.marks.comment, r =
|
|
1533
|
-
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId:
|
|
1774
|
+
function ia(e, t) {
|
|
1775
|
+
let n = e.state.schema.marks.comment, r = ta(e.state.doc.content.size, t);
|
|
1776
|
+
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: Z })));
|
|
1534
1777
|
}
|
|
1535
1778
|
//#endregion
|
|
1536
1779
|
//#region src/composables/useCommentLifecycle.ts
|
|
1537
|
-
var
|
|
1538
|
-
function
|
|
1539
|
-
let t =
|
|
1780
|
+
var aa = 408, oa = 12;
|
|
1781
|
+
function sa(e) {
|
|
1782
|
+
let t = H(!1), n = H(null), r = H(null), i = H(null), a = H(null);
|
|
1540
1783
|
function o(t) {
|
|
1541
1784
|
let n = e.editorView.value, r = e.pagesContainer.value;
|
|
1542
1785
|
if (!n || !r) return null;
|
|
@@ -1568,7 +1811,7 @@ function Hi(e) {
|
|
|
1568
1811
|
r.value = null;
|
|
1569
1812
|
return;
|
|
1570
1813
|
}
|
|
1571
|
-
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left +
|
|
1814
|
+
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + oa : l.width / 2 + aa;
|
|
1572
1815
|
r.value = {
|
|
1573
1816
|
top: c.top - l.top,
|
|
1574
1817
|
left: Math.max(16, Math.min(d, l.width - 16)),
|
|
@@ -1579,7 +1822,7 @@ function Hi(e) {
|
|
|
1579
1822
|
function c() {
|
|
1580
1823
|
let s = e.editorView.value;
|
|
1581
1824
|
if (!s) return;
|
|
1582
|
-
let c = r.value, l = s.state.selection, u =
|
|
1825
|
+
let c = r.value, l = s.state.selection, u = na({
|
|
1583
1826
|
docSize: s.state.doc.content.size,
|
|
1584
1827
|
capturedRange: c ? {
|
|
1585
1828
|
from: c.from,
|
|
@@ -1598,7 +1841,7 @@ function Hi(e) {
|
|
|
1598
1841
|
r.value = null;
|
|
1599
1842
|
return;
|
|
1600
1843
|
}
|
|
1601
|
-
if (!
|
|
1844
|
+
if (!ra(s, u, Z, { selectEnd: !0 })) {
|
|
1602
1845
|
r.value = null, i.value = null;
|
|
1603
1846
|
return;
|
|
1604
1847
|
}
|
|
@@ -1611,11 +1854,11 @@ function Hi(e) {
|
|
|
1611
1854
|
let n = e.editorView.value, r = i.value;
|
|
1612
1855
|
if (!n || !r) return !1;
|
|
1613
1856
|
let a = e.createComment(t);
|
|
1614
|
-
return
|
|
1857
|
+
return ra(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
|
|
1615
1858
|
}
|
|
1616
1859
|
function d() {
|
|
1617
1860
|
let t = e.editorView.value;
|
|
1618
|
-
t && i.value &&
|
|
1861
|
+
t && i.value && ia(t, i.value), l();
|
|
1619
1862
|
}
|
|
1620
1863
|
return {
|
|
1621
1864
|
isAddingComment: t,
|
|
@@ -1629,15 +1872,15 @@ function Hi(e) {
|
|
|
1629
1872
|
}
|
|
1630
1873
|
//#endregion
|
|
1631
1874
|
//#region src/composables/useCommentManagement.ts
|
|
1632
|
-
function
|
|
1633
|
-
let t =
|
|
1875
|
+
function ca(e) {
|
|
1876
|
+
let t = jt(), n = H([]), r = H(!1);
|
|
1634
1877
|
function i() {
|
|
1635
1878
|
r.value = !0;
|
|
1636
1879
|
}
|
|
1637
1880
|
function a() {
|
|
1638
1881
|
r.value = !1;
|
|
1639
1882
|
}
|
|
1640
|
-
let o =
|
|
1883
|
+
let o = k(() => e.commentsProp() !== void 0), s = k(() => o.value ? e.commentsProp() ?? [] : n.value);
|
|
1641
1884
|
function c(t) {
|
|
1642
1885
|
o.value || (n.value = t), e.onCommentsChange(t);
|
|
1643
1886
|
}
|
|
@@ -1645,12 +1888,12 @@ function Ui(e) {
|
|
|
1645
1888
|
i(), c([...s.value, e]);
|
|
1646
1889
|
}
|
|
1647
1890
|
function u(n, r) {
|
|
1648
|
-
return
|
|
1891
|
+
return Mt(t, s.value, e.editorView.value), Nt(t, n, e.author(), r);
|
|
1649
1892
|
}
|
|
1650
1893
|
function d() {
|
|
1651
1894
|
if (a(), o.value) return;
|
|
1652
1895
|
let n = e.getDocument()?.package.document.comments;
|
|
1653
|
-
|
|
1896
|
+
Mt(t, n, e.editorView.value), c(n && n.length > 0 ? n : []);
|
|
1654
1897
|
}
|
|
1655
1898
|
function f(e, t) {
|
|
1656
1899
|
l(u(t, e));
|
|
@@ -1676,26 +1919,26 @@ function Ui(e) {
|
|
|
1676
1919
|
function _(t, n) {
|
|
1677
1920
|
let r = e.editorView.value;
|
|
1678
1921
|
if (!r) return;
|
|
1679
|
-
let i =
|
|
1680
|
-
i && (n ?
|
|
1922
|
+
let i = Pt(r, t);
|
|
1923
|
+
i && (n ? It : zt)(i.from, i.to)(r.state, r.dispatch);
|
|
1681
1924
|
}
|
|
1682
1925
|
function v(e) {
|
|
1683
1926
|
_(e, !0);
|
|
1684
1927
|
}
|
|
1685
|
-
function
|
|
1928
|
+
function ee(e) {
|
|
1686
1929
|
_(e, !1);
|
|
1687
1930
|
}
|
|
1688
|
-
function
|
|
1931
|
+
function y(t, n) {
|
|
1689
1932
|
let r = e.editorView.value;
|
|
1690
|
-
r &&
|
|
1933
|
+
r && It(t, n)(r.state, r.dispatch);
|
|
1691
1934
|
}
|
|
1692
|
-
function
|
|
1935
|
+
function b(t, n) {
|
|
1693
1936
|
let r = e.editorView.value;
|
|
1694
|
-
r &&
|
|
1937
|
+
r && zt(t, n)(r.state, r.dispatch);
|
|
1695
1938
|
}
|
|
1696
1939
|
return {
|
|
1697
1940
|
comments: s,
|
|
1698
|
-
commentsDirty:
|
|
1941
|
+
commentsDirty: k(() => r.value),
|
|
1699
1942
|
clearCommentsDirty: a,
|
|
1700
1943
|
createComment: u,
|
|
1701
1944
|
pushComment: l,
|
|
@@ -1707,15 +1950,15 @@ function Ui(e) {
|
|
|
1707
1950
|
handleDelete: h,
|
|
1708
1951
|
handleTrackedChangeReply: g,
|
|
1709
1952
|
handleAcceptChangeById: v,
|
|
1710
|
-
handleRejectChangeById:
|
|
1711
|
-
handleAcceptChange:
|
|
1712
|
-
handleRejectChange:
|
|
1953
|
+
handleRejectChangeById: ee,
|
|
1954
|
+
handleAcceptChange: y,
|
|
1955
|
+
handleRejectChange: b
|
|
1713
1956
|
};
|
|
1714
1957
|
}
|
|
1715
1958
|
//#endregion
|
|
1716
1959
|
//#region src/utils/imageClipboard.ts
|
|
1717
|
-
function
|
|
1718
|
-
let r =
|
|
1960
|
+
function la(e, t, n) {
|
|
1961
|
+
let r = Bt(e.state), i = e.state.schema.marks.insertion;
|
|
1719
1962
|
if (!r || !i) return;
|
|
1720
1963
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
1721
1964
|
o < 0 || t.addMark(o, a, i.create({
|
|
@@ -1724,7 +1967,7 @@ function Wi(e, t, n) {
|
|
|
1724
1967
|
date: r.date
|
|
1725
1968
|
}));
|
|
1726
1969
|
}
|
|
1727
|
-
function
|
|
1970
|
+
function ua(e, t) {
|
|
1728
1971
|
let n = e.state.doc.nodeAt(t);
|
|
1729
1972
|
if (!n || n.type.name !== "image") return;
|
|
1730
1973
|
let r = n.attrs.src;
|
|
@@ -1738,7 +1981,7 @@ function Gi(e, t) {
|
|
|
1738
1981
|
e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
1739
1982
|
});
|
|
1740
1983
|
}
|
|
1741
|
-
function
|
|
1984
|
+
function da(e) {
|
|
1742
1985
|
return new Promise((t, n) => {
|
|
1743
1986
|
let r = new FileReader();
|
|
1744
1987
|
r.onload = () => {
|
|
@@ -1746,7 +1989,7 @@ function Ki(e) {
|
|
|
1746
1989
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
|
|
1747
1990
|
});
|
|
1748
1991
|
}
|
|
1749
|
-
function
|
|
1992
|
+
function fa(e) {
|
|
1750
1993
|
return new Promise((t) => {
|
|
1751
1994
|
let n = new Image();
|
|
1752
1995
|
n.onload = () => t({
|
|
@@ -1758,7 +2001,7 @@ function qi(e) {
|
|
|
1758
2001
|
}), n.src = e;
|
|
1759
2002
|
});
|
|
1760
2003
|
}
|
|
1761
|
-
function
|
|
2004
|
+
function pa(e, t, n, r) {
|
|
1762
2005
|
let i = e.state.schema.nodes.image;
|
|
1763
2006
|
if (!i) return;
|
|
1764
2007
|
let a = i.create({
|
|
@@ -1769,23 +2012,23 @@ function Ji(e, t, n, r) {
|
|
|
1769
2012
|
wrapType: "inline",
|
|
1770
2013
|
displayMode: "inline"
|
|
1771
2014
|
}), o = e.state.tr.replaceSelectionWith(a);
|
|
1772
|
-
|
|
2015
|
+
la(e, o, a), e.dispatch(o);
|
|
1773
2016
|
}
|
|
1774
|
-
async function
|
|
2017
|
+
async function ma(e) {
|
|
1775
2018
|
try {
|
|
1776
2019
|
let t = await navigator.clipboard.read();
|
|
1777
2020
|
for (let n of t) {
|
|
1778
2021
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
1779
2022
|
if (t) {
|
|
1780
|
-
let r = await
|
|
1781
|
-
a > 612 && (o = Math.round(612 / a * o), a = 612),
|
|
2023
|
+
let r = await da(await n.getType(t)), i = await fa(r), a = i.width, o = i.height;
|
|
2024
|
+
a > 612 && (o = Math.round(612 / a * o), a = 612), pa(e, r, a, o);
|
|
1782
2025
|
return;
|
|
1783
2026
|
}
|
|
1784
2027
|
if (n.types.includes("text/html")) {
|
|
1785
2028
|
let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
|
|
1786
2029
|
if (r) {
|
|
1787
2030
|
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;
|
|
1788
|
-
|
|
2031
|
+
pa(e, r, a || 200, o || 200);
|
|
1789
2032
|
return;
|
|
1790
2033
|
}
|
|
1791
2034
|
}
|
|
@@ -1806,14 +2049,14 @@ async function Yi(e) {
|
|
|
1806
2049
|
}
|
|
1807
2050
|
}
|
|
1808
2051
|
}
|
|
1809
|
-
function
|
|
2052
|
+
function ha(e, t) {
|
|
1810
2053
|
let n = e.state.doc.nodeAt(t);
|
|
1811
2054
|
if (!n || n.type.name !== "image") return;
|
|
1812
2055
|
let r = document.createElement("input");
|
|
1813
2056
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
1814
2057
|
let i = r.files?.[0];
|
|
1815
2058
|
if (!i) return;
|
|
1816
|
-
let a = await
|
|
2059
|
+
let a = await da(i), o = await fa(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);
|
|
1817
2060
|
try {
|
|
1818
2061
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
1819
2062
|
...n.attrs,
|
|
@@ -1828,7 +2071,7 @@ function Xi(e, t) {
|
|
|
1828
2071
|
}
|
|
1829
2072
|
//#endregion
|
|
1830
2073
|
//#region src/composables/useContextMenus.ts
|
|
1831
|
-
var
|
|
2074
|
+
var ga = /* @__PURE__ */ new Set([
|
|
1832
2075
|
"inline",
|
|
1833
2076
|
"square",
|
|
1834
2077
|
"tight",
|
|
@@ -1837,17 +2080,17 @@ var Zi = /* @__PURE__ */ new Set([
|
|
|
1837
2080
|
"behind",
|
|
1838
2081
|
"inFront"
|
|
1839
2082
|
]);
|
|
1840
|
-
function
|
|
1841
|
-
return typeof e == "string" &&
|
|
2083
|
+
function _a(e) {
|
|
2084
|
+
return typeof e == "string" && ga.has(e);
|
|
1842
2085
|
}
|
|
1843
|
-
function
|
|
1844
|
-
return
|
|
2086
|
+
function va(e) {
|
|
2087
|
+
return _a(e) ? e : "inline";
|
|
1845
2088
|
}
|
|
1846
|
-
function
|
|
2089
|
+
function ya(e) {
|
|
1847
2090
|
return e === "left" || e === "right" || e === "none" ? e : null;
|
|
1848
2091
|
}
|
|
1849
|
-
function
|
|
1850
|
-
let { t } = c(), n =
|
|
2092
|
+
function ba(e) {
|
|
2093
|
+
let { t } = c(), n = H({
|
|
1851
2094
|
isOpen: !1,
|
|
1852
2095
|
position: {
|
|
1853
2096
|
x: 0,
|
|
@@ -1858,10 +2101,10 @@ function ta(e) {
|
|
|
1858
2101
|
onImage: !1,
|
|
1859
2102
|
canMergeCells: !1,
|
|
1860
2103
|
canSplitCell: !1
|
|
1861
|
-
}), r =
|
|
2104
|
+
}), r = H(null), i = H({
|
|
1862
2105
|
from: 0,
|
|
1863
2106
|
to: 0
|
|
1864
|
-
}), a =
|
|
2107
|
+
}), a = k(() => (e.customContextMenuItems?.() ?? []).filter((e) => !e.requiresSelection || n.value.hasSelection)), o = k(() => [
|
|
1865
2108
|
{
|
|
1866
2109
|
action: "cut",
|
|
1867
2110
|
label: t("contextMenu.cut"),
|
|
@@ -1888,7 +2131,7 @@ function ta(e) {
|
|
|
1888
2131
|
t(e.state, (t) => e.dispatch(t), e);
|
|
1889
2132
|
}
|
|
1890
2133
|
function l(t, n, r, i, a) {
|
|
1891
|
-
let o = i === "inline" ?
|
|
2134
|
+
let o = i === "inline" ? lt(t, e.zoom.value) : void 0;
|
|
1892
2135
|
return {
|
|
1893
2136
|
open: !0,
|
|
1894
2137
|
position: r,
|
|
@@ -1901,12 +2144,12 @@ function ta(e) {
|
|
|
1901
2144
|
function u(t) {
|
|
1902
2145
|
let a = e.editorView.value;
|
|
1903
2146
|
if (!a) return;
|
|
1904
|
-
let o =
|
|
2147
|
+
let o = dt(t.target);
|
|
1905
2148
|
if (o) {
|
|
1906
2149
|
let i = Number(o.dataset.pmStart);
|
|
1907
2150
|
if (!Number.isNaN(i)) {
|
|
1908
2151
|
try {
|
|
1909
|
-
let e =
|
|
2152
|
+
let e = at.create(a.state.doc, i);
|
|
1910
2153
|
a.dispatch(a.state.tr.setSelection(e));
|
|
1911
2154
|
} catch {}
|
|
1912
2155
|
e.selectedImage.value = {
|
|
@@ -1920,7 +2163,7 @@ function ta(e) {
|
|
|
1920
2163
|
r.value = l(o, i, {
|
|
1921
2164
|
x: t.clientX,
|
|
1922
2165
|
y: t.clientY
|
|
1923
|
-
},
|
|
2166
|
+
}, va(s.attrs.wrapType), ya(s.attrs.cssFloat)), n.value.isOpen = !1;
|
|
1924
2167
|
return;
|
|
1925
2168
|
}
|
|
1926
2169
|
}
|
|
@@ -1931,7 +2174,7 @@ function ta(e) {
|
|
|
1931
2174
|
e.setPmSelection(i);
|
|
1932
2175
|
} catch {}
|
|
1933
2176
|
}
|
|
1934
|
-
let s =
|
|
2177
|
+
let s = At(a.state), { empty: c, from: u, to: d } = a.state.selection;
|
|
1935
2178
|
i.value = {
|
|
1936
2179
|
from: u,
|
|
1937
2180
|
to: d
|
|
@@ -1955,7 +2198,7 @@ function ta(e) {
|
|
|
1955
2198
|
!o || o.type.name !== "image" || (r.value = l(a.element, a.pmPos, {
|
|
1956
2199
|
x: t.clientX,
|
|
1957
2200
|
y: t.clientY
|
|
1958
|
-
},
|
|
2201
|
+
}, va(o.attrs.wrapType), ya(o.attrs.cssFloat)), n.value.isOpen = !1);
|
|
1959
2202
|
}
|
|
1960
2203
|
function f(t) {
|
|
1961
2204
|
let n = e.editorView.value, i = r.value;
|
|
@@ -1979,16 +2222,16 @@ function ta(e) {
|
|
|
1979
2222
|
case "cut":
|
|
1980
2223
|
if (e.selectedImage.value) {
|
|
1981
2224
|
let t = e.selectedImage.value.pmPos;
|
|
1982
|
-
|
|
2225
|
+
ua(n, t);
|
|
1983
2226
|
let r = n.state.doc.nodeAt(t);
|
|
1984
2227
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
|
|
1985
2228
|
} else n.focus(), document.execCommand("cut");
|
|
1986
2229
|
break;
|
|
1987
2230
|
case "copy":
|
|
1988
|
-
e.selectedImage.value ?
|
|
2231
|
+
e.selectedImage.value ? ua(n, e.selectedImage.value.pmPos) : (n.focus(), document.execCommand("copy"));
|
|
1989
2232
|
break;
|
|
1990
2233
|
case "paste":
|
|
1991
|
-
|
|
2234
|
+
ma(n);
|
|
1992
2235
|
break;
|
|
1993
2236
|
case "pasteAsPlainText":
|
|
1994
2237
|
navigator.clipboard.readText().then((e) => {
|
|
@@ -2001,7 +2244,7 @@ function ta(e) {
|
|
|
2001
2244
|
break;
|
|
2002
2245
|
}
|
|
2003
2246
|
case "selectAll": {
|
|
2004
|
-
let e =
|
|
2247
|
+
let e = Y.create(n.state.doc, 0, n.state.doc.content.size);
|
|
2005
2248
|
n.dispatch(n.state.tr.setSelection(e));
|
|
2006
2249
|
break;
|
|
2007
2250
|
}
|
|
@@ -2009,7 +2252,7 @@ function ta(e) {
|
|
|
2009
2252
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2010
2253
|
break;
|
|
2011
2254
|
case "replaceImage":
|
|
2012
|
-
e.selectedImage.value &&
|
|
2255
|
+
e.selectedImage.value && ha(n, e.selectedImage.value.pmPos);
|
|
2013
2256
|
break;
|
|
2014
2257
|
case "deleteImage":
|
|
2015
2258
|
if (e.selectedImage.value) {
|
|
@@ -2047,27 +2290,27 @@ function ta(e) {
|
|
|
2047
2290
|
}
|
|
2048
2291
|
//#endregion
|
|
2049
2292
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2050
|
-
function
|
|
2293
|
+
function xa(e) {
|
|
2051
2294
|
async function t(t) {
|
|
2052
2295
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2053
2296
|
}
|
|
2054
2297
|
function n(t) {
|
|
2055
2298
|
e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
|
|
2056
2299
|
}
|
|
2057
|
-
|
|
2300
|
+
K(e.documentBuffer, (e) => {
|
|
2058
2301
|
e && t(e);
|
|
2059
|
-
}),
|
|
2302
|
+
}), K(e.document, (e) => {
|
|
2060
2303
|
e && n(e);
|
|
2061
|
-
}),
|
|
2062
|
-
await
|
|
2304
|
+
}), Ce(async () => {
|
|
2305
|
+
await R();
|
|
2063
2306
|
let r = e.documentBuffer(), i = e.document();
|
|
2064
2307
|
r ? await t(r) : i && n(i);
|
|
2065
2308
|
});
|
|
2066
2309
|
}
|
|
2067
2310
|
//#endregion
|
|
2068
2311
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2069
|
-
var
|
|
2070
|
-
function
|
|
2312
|
+
var Sa = Date.now();
|
|
2313
|
+
function Ca(e) {
|
|
2071
2314
|
let t = [];
|
|
2072
2315
|
function n() {
|
|
2073
2316
|
e.onPrint?.(), window.print();
|
|
@@ -2081,11 +2324,11 @@ function ia(e) {
|
|
|
2081
2324
|
function i(t, n) {
|
|
2082
2325
|
let r = e.pagesRef.value;
|
|
2083
2326
|
if (!r) return !1;
|
|
2084
|
-
let i =
|
|
2327
|
+
let i = fn(r, t), a = i.at(0);
|
|
2085
2328
|
return a ? (a.scrollIntoView({
|
|
2086
2329
|
block: "center",
|
|
2087
2330
|
behavior: "smooth"
|
|
2088
|
-
}), n?.highlight &&
|
|
2331
|
+
}), n?.highlight && pn(i, n.highlight), !0) : !1;
|
|
2089
2332
|
}
|
|
2090
2333
|
function a() {
|
|
2091
2334
|
return e.zoom.value;
|
|
@@ -2097,7 +2340,7 @@ function ia(e) {
|
|
|
2097
2340
|
getDocument: () => e.editor.getDocument(),
|
|
2098
2341
|
getState: () => e.editor.getState(),
|
|
2099
2342
|
getView: () => e.editor.getView(),
|
|
2100
|
-
getHfView: () =>
|
|
2343
|
+
getHfView: (t) => e.getHeaderFooterView(t),
|
|
2101
2344
|
ensureView: () => e.editor.ensureView(),
|
|
2102
2345
|
focus: () => e.editor.focus(),
|
|
2103
2346
|
blur: () => e.editor.blur(),
|
|
@@ -2116,7 +2359,7 @@ function ia(e) {
|
|
|
2116
2359
|
getPageNumberForPmPos: (t) => {
|
|
2117
2360
|
let n = e.layout.value;
|
|
2118
2361
|
if (!n) return null;
|
|
2119
|
-
let r =
|
|
2362
|
+
let r = Vt(n, t);
|
|
2120
2363
|
return r == null ? null : r + 1;
|
|
2121
2364
|
}
|
|
2122
2365
|
}, o;
|
|
@@ -2127,7 +2370,7 @@ function ia(e) {
|
|
|
2127
2370
|
function l() {
|
|
2128
2371
|
let t = e.layout.value, n = e.editorView.value;
|
|
2129
2372
|
if (!t || !n) return 0;
|
|
2130
|
-
let r =
|
|
2373
|
+
let r = Vt(t, n.state.selection.from);
|
|
2131
2374
|
return r == null ? 0 : r + 1;
|
|
2132
2375
|
}
|
|
2133
2376
|
function u(t) {
|
|
@@ -2160,10 +2403,10 @@ function ia(e) {
|
|
|
2160
2403
|
ensureEditorView: () => e.editor.ensureView(),
|
|
2161
2404
|
createAIEditSnapshot: () => {
|
|
2162
2405
|
let t = e.editorView.value;
|
|
2163
|
-
return t ?
|
|
2406
|
+
return t ? an(t.state.doc) : null;
|
|
2164
2407
|
},
|
|
2165
2408
|
applyDocumentOperations: ({ snapshot: n, batch: r, author: i = e.author() }) => {
|
|
2166
|
-
|
|
2409
|
+
nn(r.version);
|
|
2167
2410
|
let a = e.editorView.value;
|
|
2168
2411
|
if (!a) {
|
|
2169
2412
|
let e = "committed";
|
|
@@ -2173,11 +2416,11 @@ function ia(e) {
|
|
|
2173
2416
|
reason: "unsupportedBlock"
|
|
2174
2417
|
}));
|
|
2175
2418
|
return {
|
|
2176
|
-
version:
|
|
2419
|
+
version: en,
|
|
2177
2420
|
status: e,
|
|
2178
2421
|
applied: [],
|
|
2179
2422
|
skipped: t,
|
|
2180
|
-
issues:
|
|
2423
|
+
issues: cn(r.operations, t),
|
|
2181
2424
|
receipts: [],
|
|
2182
2425
|
undoHandle: null
|
|
2183
2426
|
};
|
|
@@ -2187,9 +2430,9 @@ function ia(e) {
|
|
|
2187
2430
|
let s = e.getComments(), c = {
|
|
2188
2431
|
state: a.state,
|
|
2189
2432
|
dispatch: (e) => {
|
|
2190
|
-
a.dispatch(
|
|
2433
|
+
a.dispatch(Ot(e)), c.state = a.state;
|
|
2191
2434
|
}
|
|
2192
|
-
}, l =
|
|
2435
|
+
}, l = $({
|
|
2193
2436
|
view: c,
|
|
2194
2437
|
snapshot: n,
|
|
2195
2438
|
batch: r,
|
|
@@ -2197,7 +2440,7 @@ function ia(e) {
|
|
|
2197
2440
|
createCommentId: e.createAIEditComment,
|
|
2198
2441
|
createUndoHandle: () => ({
|
|
2199
2442
|
type: "documentOperationUndo",
|
|
2200
|
-
id: `vue-${String(
|
|
2443
|
+
id: `vue-${String(Sa++)}`
|
|
2201
2444
|
})
|
|
2202
2445
|
});
|
|
2203
2446
|
return l.undoHandle !== null && t.push({
|
|
@@ -2235,7 +2478,7 @@ function ia(e) {
|
|
|
2235
2478
|
},
|
|
2236
2479
|
applyAIEditOperations: ({ snapshot: t, operations: n, mode: r = "tracked-changes", author: i = e.author() }) => {
|
|
2237
2480
|
let a = e.editorView.value;
|
|
2238
|
-
return a ?
|
|
2481
|
+
return a ? tn({
|
|
2239
2482
|
view: a,
|
|
2240
2483
|
snapshot: t,
|
|
2241
2484
|
operations: n,
|
|
@@ -2252,56 +2495,86 @@ function ia(e) {
|
|
|
2252
2495
|
},
|
|
2253
2496
|
acceptAIEditOperation: (t) => {
|
|
2254
2497
|
let n = e.editorView.value;
|
|
2255
|
-
return n ?
|
|
2498
|
+
return n ? Ft(t)(n.state, n.dispatch) : !1;
|
|
2256
2499
|
},
|
|
2257
2500
|
rejectAIEditOperation: (t) => {
|
|
2258
2501
|
let n = e.editorView.value;
|
|
2259
|
-
return n ?
|
|
2502
|
+
return n ? Rt(t)(n.state, n.dispatch) : !1;
|
|
2260
2503
|
},
|
|
2261
2504
|
undo: () => e.editor.undo(),
|
|
2262
2505
|
redo: () => e.editor.redo(),
|
|
2263
2506
|
scrollToAIEditOperation: (t) => {
|
|
2264
2507
|
let n = e.editorView.value;
|
|
2265
2508
|
if (!n) return !1;
|
|
2266
|
-
let r =
|
|
2509
|
+
let r = Lt(n.state, t);
|
|
2267
2510
|
if (!r) return !1;
|
|
2268
|
-
let { from: i, to: a } =
|
|
2269
|
-
return n.dispatch(n.state.tr.setSelection(
|
|
2511
|
+
let { from: i, to: a } = xn(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2512
|
+
return n.dispatch(n.state.tr.setSelection(Y.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2270
2513
|
},
|
|
2271
2514
|
scrollToBlock: (t, n) => {
|
|
2272
2515
|
let r = e.editorView.value;
|
|
2273
2516
|
if (!r) return !1;
|
|
2274
|
-
let i =
|
|
2517
|
+
let i = Sn({
|
|
2275
2518
|
blockId: t,
|
|
2276
2519
|
doc: r.state.doc,
|
|
2277
2520
|
snapshot: n
|
|
2278
2521
|
});
|
|
2279
2522
|
if (i === null) return !1;
|
|
2280
2523
|
let { from: a, to: o } = i, s = r.state.doc.resolve(a), c = r.state.doc.resolve(o);
|
|
2281
|
-
return r.dispatch(r.state.tr.setSelection(
|
|
2524
|
+
return r.dispatch(r.state.tr.setSelection(Y.between(s, c))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(a)), !0;
|
|
2525
|
+
},
|
|
2526
|
+
showInDocument: (t, n) => {
|
|
2527
|
+
let r = e.editorView.value;
|
|
2528
|
+
if (!r) return !1;
|
|
2529
|
+
let i = t.type === "textRange" ? Cn({
|
|
2530
|
+
range: t,
|
|
2531
|
+
doc: r.state.doc,
|
|
2532
|
+
snapshot: n
|
|
2533
|
+
}) : Sn({
|
|
2534
|
+
blockId: t.blockId,
|
|
2535
|
+
doc: r.state.doc,
|
|
2536
|
+
snapshot: n
|
|
2537
|
+
});
|
|
2538
|
+
if (i === null) return !1;
|
|
2539
|
+
let { from: a, to: o } = i, s = r.state.doc.resolve(a), c = r.state.doc.resolve(o);
|
|
2540
|
+
return r.dispatch(r.state.tr.setSelection(Y.between(s, c))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(a)), !0;
|
|
2282
2541
|
},
|
|
2283
|
-
showInDocument: () => !1,
|
|
2284
2542
|
getTrackedChanges: () => {
|
|
2285
2543
|
let t = e.editorView.value;
|
|
2286
|
-
return t ?
|
|
2544
|
+
return t ? ln(t.state.doc) : [];
|
|
2287
2545
|
},
|
|
2288
2546
|
getCommentAnchors: () => {
|
|
2289
2547
|
let t = e.editorView.value;
|
|
2290
|
-
return t ?
|
|
2548
|
+
return t ? sn(t.state.doc) : [];
|
|
2291
2549
|
},
|
|
2292
2550
|
getSelectionText: () => {
|
|
2293
2551
|
let t = e.editorView.value;
|
|
2294
|
-
return t ?
|
|
2552
|
+
return t ? Pe(t.state) : "";
|
|
2295
2553
|
},
|
|
2296
2554
|
getPageText: (t) => {
|
|
2297
2555
|
let n = e.editorView.value;
|
|
2298
|
-
return n ?
|
|
2556
|
+
return n ? wn(e.layout.value, n.state.doc, t) : null;
|
|
2557
|
+
},
|
|
2558
|
+
getTargetPage: (t, n) => {
|
|
2559
|
+
let r = e.editorView.value, i = e.layout.value;
|
|
2560
|
+
if (!r || !i) return null;
|
|
2561
|
+
let a = t.type === "textRange" ? Cn({
|
|
2562
|
+
range: t,
|
|
2563
|
+
doc: r.state.doc,
|
|
2564
|
+
snapshot: n
|
|
2565
|
+
}) : Sn({
|
|
2566
|
+
blockId: t.blockId,
|
|
2567
|
+
doc: r.state.doc,
|
|
2568
|
+
snapshot: n
|
|
2569
|
+
});
|
|
2570
|
+
if (a === null) return null;
|
|
2571
|
+
let o = Vt(i, a.from);
|
|
2572
|
+
return o == null ? null : o + 1;
|
|
2299
2573
|
},
|
|
2300
|
-
getTargetPage: () => null,
|
|
2301
2574
|
getContentControls: (t = {}) => {
|
|
2302
2575
|
let n = e.editorView.value;
|
|
2303
|
-
return n ?
|
|
2304
|
-
properties:
|
|
2576
|
+
return n ? gn(n.state.doc, t).map((e) => ({
|
|
2577
|
+
properties: mn(e.node),
|
|
2305
2578
|
path: e.path,
|
|
2306
2579
|
pmPos: e.pos
|
|
2307
2580
|
})) : [];
|
|
@@ -2309,60 +2582,60 @@ function ia(e) {
|
|
|
2309
2582
|
scrollToContentControl: (t) => {
|
|
2310
2583
|
let n = e.editorView.value;
|
|
2311
2584
|
if (!n) return !1;
|
|
2312
|
-
let r =
|
|
2585
|
+
let r = hn(n.state.doc, t);
|
|
2313
2586
|
if (!r) return !1;
|
|
2314
2587
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
2315
|
-
return n.dispatch(n.state.tr.setSelection(
|
|
2588
|
+
return n.dispatch(n.state.tr.setSelection(Y.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2316
2589
|
},
|
|
2317
2590
|
setContentControlContent: (t, n, r = {}) => {
|
|
2318
2591
|
let i = e.editorView.value;
|
|
2319
2592
|
if (!i) return !1;
|
|
2320
|
-
let a = typeof n == "string" ?
|
|
2593
|
+
let a = typeof n == "string" ? vn(i.state, t, n, r) : bn(i.state, t, n, r);
|
|
2321
2594
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2322
2595
|
},
|
|
2323
2596
|
setContentControlValue: (t, n, r = {}) => {
|
|
2324
2597
|
let i = e.editorView.value;
|
|
2325
2598
|
if (!i) return !1;
|
|
2326
|
-
let a =
|
|
2599
|
+
let a = yn(i.state, t, n, r);
|
|
2327
2600
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2328
2601
|
},
|
|
2329
2602
|
removeContentControl: (t, n = {}) => {
|
|
2330
2603
|
let r = e.editorView.value;
|
|
2331
2604
|
if (!r) return !1;
|
|
2332
|
-
let i =
|
|
2605
|
+
let i = _n(r.state, t, n);
|
|
2333
2606
|
return i ? (r.dispatch(i), !0) : !1;
|
|
2334
2607
|
}
|
|
2335
2608
|
} };
|
|
2336
2609
|
}
|
|
2337
2610
|
//#endregion
|
|
2338
2611
|
//#region src/composables/useFormattingActions.ts
|
|
2339
|
-
function
|
|
2612
|
+
function wa(e) {
|
|
2340
2613
|
let t = () => e.activeView?.value ?? e.editorView.value;
|
|
2341
2614
|
function n() {
|
|
2342
2615
|
let e = t();
|
|
2343
|
-
e && (
|
|
2616
|
+
e && (kt(e.state, e.dispatch, e), e.focus());
|
|
2344
2617
|
}
|
|
2345
2618
|
function r(n) {
|
|
2346
2619
|
let r = t();
|
|
2347
2620
|
if (!r) return;
|
|
2348
2621
|
let i = e.getDocument(), a = i?.package?.styles;
|
|
2349
2622
|
if (a) {
|
|
2350
|
-
let e =
|
|
2351
|
-
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting),
|
|
2352
|
-
} else
|
|
2623
|
+
let e = Me(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ? An(i.package.numbering) : null };
|
|
2624
|
+
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting), Tn(n, t)(r.state, (e) => r.dispatch(e));
|
|
2625
|
+
} else Tn(n)(r.state, (e) => r.dispatch(e));
|
|
2353
2626
|
r.focus();
|
|
2354
2627
|
}
|
|
2355
2628
|
function i() {
|
|
2356
2629
|
let t = e.editorView.value;
|
|
2357
|
-
t && (
|
|
2630
|
+
t && (jn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2358
2631
|
}
|
|
2359
2632
|
function a() {
|
|
2360
2633
|
let t = e.editorView.value;
|
|
2361
|
-
t && (
|
|
2634
|
+
t && (Nn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2362
2635
|
}
|
|
2363
2636
|
function o() {
|
|
2364
2637
|
let t = e.editorView.value;
|
|
2365
|
-
t && (
|
|
2638
|
+
t && (Mn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2366
2639
|
}
|
|
2367
2640
|
function s(e) {
|
|
2368
2641
|
let n = t();
|
|
@@ -2381,8 +2654,8 @@ function aa(e) {
|
|
|
2381
2654
|
}
|
|
2382
2655
|
//#endregion
|
|
2383
2656
|
//#region src/composables/useHyperlinkManagement.ts
|
|
2384
|
-
function
|
|
2385
|
-
let t =
|
|
2657
|
+
function Ta(e) {
|
|
2658
|
+
let t = H(null);
|
|
2386
2659
|
function n(e, t) {
|
|
2387
2660
|
t(e.state, (t) => e.dispatch(t), e);
|
|
2388
2661
|
}
|
|
@@ -2412,14 +2685,14 @@ function oa(e) {
|
|
|
2412
2685
|
}
|
|
2413
2686
|
function o(n, r) {
|
|
2414
2687
|
let i = e.editorView.value;
|
|
2415
|
-
i && (
|
|
2688
|
+
i && (Pn(i, {
|
|
2416
2689
|
displayText: n,
|
|
2417
2690
|
href: r
|
|
2418
2691
|
}), t.value = null, i.focus());
|
|
2419
2692
|
}
|
|
2420
2693
|
function s() {
|
|
2421
2694
|
let n = e.editorView.value;
|
|
2422
|
-
n && (
|
|
2695
|
+
n && (Fn(n, { popupHref: t.value?.href }), t.value = null, n.focus());
|
|
2423
2696
|
}
|
|
2424
2697
|
return {
|
|
2425
2698
|
hyperlinkPopupData: t,
|
|
@@ -2432,8 +2705,8 @@ function oa(e) {
|
|
|
2432
2705
|
}
|
|
2433
2706
|
//#endregion
|
|
2434
2707
|
//#region src/composables/useImageActions.ts
|
|
2435
|
-
function
|
|
2436
|
-
let t =
|
|
2708
|
+
function Ea(e) {
|
|
2709
|
+
let t = De(null), n = H(!1), r = k(() => {
|
|
2437
2710
|
e.stateTick.value;
|
|
2438
2711
|
let n = e.editorView.value, r = t.value;
|
|
2439
2712
|
if (!n || !r) return null;
|
|
@@ -2452,9 +2725,9 @@ function sa(e) {
|
|
|
2452
2725
|
function a(n) {
|
|
2453
2726
|
let r = e.editorView.value, a = t.value;
|
|
2454
2727
|
if (!r || !a) return;
|
|
2455
|
-
let o =
|
|
2728
|
+
let o = X(n);
|
|
2456
2729
|
if (!o) return;
|
|
2457
|
-
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu:
|
|
2730
|
+
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu: lt(a.element, e.zoom.value) } : void 0, c = e.getCommands().setImageWrapType;
|
|
2458
2731
|
c && (i(r, c(a.pmPos, o, s)), r.focus());
|
|
2459
2732
|
}
|
|
2460
2733
|
function o(n) {
|
|
@@ -2482,7 +2755,7 @@ function sa(e) {
|
|
|
2482
2755
|
}
|
|
2483
2756
|
//#endregion
|
|
2484
2757
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
2485
|
-
function
|
|
2758
|
+
function Da(e) {
|
|
2486
2759
|
function t(t) {
|
|
2487
2760
|
if (t.key === "F1") {
|
|
2488
2761
|
t.preventDefault(), e.showKeyboardShortcuts.value = !0;
|
|
@@ -2497,14 +2770,14 @@ function ca(e) {
|
|
|
2497
2770
|
e.disableFindReplaceShortcuts?.() && (t.key === "f" || t.key === "h") || (t.key === "f" || t.key === "h" ? (t.preventDefault(), e.showFindReplace.value = !0) : t.key === "k" ? (t.preventDefault(), e.showHyperlink.value = !0) : t.key === "/" && (t.preventDefault(), e.showKeyboardShortcuts.value = !e.showKeyboardShortcuts.value));
|
|
2498
2771
|
}
|
|
2499
2772
|
}
|
|
2500
|
-
return
|
|
2773
|
+
return Ce(() => window.addEventListener("keydown", t)), Se(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
|
|
2501
2774
|
}
|
|
2502
2775
|
//#endregion
|
|
2503
2776
|
//#region src/composables/useOutlineSidebar.ts
|
|
2504
|
-
function
|
|
2777
|
+
function Oa(e) {
|
|
2505
2778
|
function t() {
|
|
2506
2779
|
let t = e.editorView.value;
|
|
2507
|
-
t && (e.outlineHeadings.value =
|
|
2780
|
+
t && (e.outlineHeadings.value = In(t.state.doc));
|
|
2508
2781
|
}
|
|
2509
2782
|
function n() {
|
|
2510
2783
|
e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
|
|
@@ -2515,7 +2788,7 @@ function la(e) {
|
|
|
2515
2788
|
function i(t) {
|
|
2516
2789
|
let n = e.editorView.value;
|
|
2517
2790
|
if (!n) return;
|
|
2518
|
-
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i =
|
|
2791
|
+
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = Y.near(r);
|
|
2519
2792
|
n.dispatch(n.state.tr.setSelection(i)), e.scrollToVisiblePosition(t), n.focus();
|
|
2520
2793
|
}
|
|
2521
2794
|
function a() {
|
|
@@ -2535,7 +2808,7 @@ function la(e) {
|
|
|
2535
2808
|
}
|
|
2536
2809
|
//#endregion
|
|
2537
2810
|
//#region src/composables/usePageSetupControls.ts
|
|
2538
|
-
function
|
|
2811
|
+
function ka(e) {
|
|
2539
2812
|
function t(t) {
|
|
2540
2813
|
let n = e.getDocument();
|
|
2541
2814
|
if (!n?.package?.document) return;
|
|
@@ -2562,19 +2835,19 @@ function ua(e) {
|
|
|
2562
2835
|
}
|
|
2563
2836
|
function s(t) {
|
|
2564
2837
|
let n = e.editorView.value;
|
|
2565
|
-
n &&
|
|
2838
|
+
n && On(t)(n.state, n.dispatch);
|
|
2566
2839
|
}
|
|
2567
2840
|
function c(t) {
|
|
2568
2841
|
let n = e.editorView.value;
|
|
2569
|
-
n &&
|
|
2842
|
+
n && kn(t)(n.state, n.dispatch);
|
|
2570
2843
|
}
|
|
2571
2844
|
function l(t) {
|
|
2572
2845
|
let n = e.editorView.value;
|
|
2573
|
-
n && (t < 0 ?
|
|
2846
|
+
n && (t < 0 ? Dn(-t, !0)(n.state, n.dispatch) : Dn(t, !1)(n.state, n.dispatch));
|
|
2574
2847
|
}
|
|
2575
2848
|
function u(t) {
|
|
2576
2849
|
let n = e.editorView.value;
|
|
2577
|
-
n &&
|
|
2850
|
+
n && En(t)(n.state, n.dispatch);
|
|
2578
2851
|
}
|
|
2579
2852
|
return {
|
|
2580
2853
|
handlePageSetupApply: t,
|
|
@@ -2590,45 +2863,45 @@ function ua(e) {
|
|
|
2590
2863
|
}
|
|
2591
2864
|
//#endregion
|
|
2592
2865
|
//#region src/utils/textSelection.ts
|
|
2593
|
-
var
|
|
2594
|
-
function
|
|
2595
|
-
return !e || e.length === 0 ? !1 :
|
|
2866
|
+
var Aa = /[\p{L}\p{N}\p{M}_''-]/u, ja = /\s/;
|
|
2867
|
+
function Ma(e) {
|
|
2868
|
+
return !e || e.length === 0 ? !1 : Aa.test(e);
|
|
2596
2869
|
}
|
|
2597
|
-
function
|
|
2598
|
-
return !e || e.length === 0 ? !1 :
|
|
2870
|
+
function Na(e) {
|
|
2871
|
+
return !e || e.length === 0 ? !1 : ja.test(e);
|
|
2599
2872
|
}
|
|
2600
|
-
function
|
|
2873
|
+
function Pa(e, t) {
|
|
2601
2874
|
if (!e || e.length === 0) return [0, 0];
|
|
2602
2875
|
t = Math.max(0, Math.min(t, e.length - 1));
|
|
2603
2876
|
let n = e[t];
|
|
2604
|
-
if (
|
|
2877
|
+
if (Na(n)) {
|
|
2605
2878
|
let n = t, r = t;
|
|
2606
|
-
for (; n > 0 &&
|
|
2607
|
-
for (; r < e.length &&
|
|
2879
|
+
for (; n > 0 && Na(e[n - 1]);) n--;
|
|
2880
|
+
for (; r < e.length && Na(e[r]);) r++;
|
|
2608
2881
|
return [n, r];
|
|
2609
2882
|
}
|
|
2610
|
-
if (
|
|
2883
|
+
if (Ma(n)) {
|
|
2611
2884
|
let n = t, r = t;
|
|
2612
|
-
for (; n > 0 &&
|
|
2613
|
-
for (; r < e.length &&
|
|
2885
|
+
for (; n > 0 && Ma(e[n - 1]);) n--;
|
|
2886
|
+
for (; r < e.length && Ma(e[r]);) r++;
|
|
2614
2887
|
return [n, r];
|
|
2615
2888
|
}
|
|
2616
2889
|
return [t, t + 1];
|
|
2617
2890
|
}
|
|
2618
2891
|
//#endregion
|
|
2619
2892
|
//#region src/utils/domQueries.ts
|
|
2620
|
-
function
|
|
2621
|
-
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) :
|
|
2893
|
+
function Fa(e, t, n) {
|
|
2894
|
+
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : St(e);
|
|
2622
2895
|
for (let e of r) {
|
|
2623
2896
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
2624
2897
|
if (!Number.isNaN(n) && !Number.isNaN(r) && t >= n && t <= r) return e;
|
|
2625
2898
|
}
|
|
2626
2899
|
return null;
|
|
2627
2900
|
}
|
|
2628
|
-
function
|
|
2901
|
+
function Ia(e, t, n) {
|
|
2629
2902
|
if (!e || !t) return;
|
|
2630
|
-
let r =
|
|
2631
|
-
if (!r) for (let t of
|
|
2903
|
+
let r = xt(e, n);
|
|
2904
|
+
if (!r) for (let t of St(e)) {
|
|
2632
2905
|
let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
|
|
2633
2906
|
if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
|
|
2634
2907
|
r = t;
|
|
@@ -2642,21 +2915,21 @@ function _a(e, t, n) {
|
|
|
2642
2915
|
behavior: "smooth"
|
|
2643
2916
|
});
|
|
2644
2917
|
}
|
|
2645
|
-
function
|
|
2918
|
+
function La(e, t, n, r) {
|
|
2646
2919
|
if (!e || !t) return null;
|
|
2647
|
-
let i =
|
|
2920
|
+
let i = ht(e, n, r, 1);
|
|
2648
2921
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
2649
2922
|
}
|
|
2650
|
-
function
|
|
2923
|
+
function Ra(e, t, n, r) {
|
|
2651
2924
|
if (!e) return;
|
|
2652
|
-
let i =
|
|
2925
|
+
let i = Fa(e, t, r);
|
|
2653
2926
|
if (!i) return;
|
|
2654
|
-
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] =
|
|
2927
|
+
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = Pa(a, t - o), l = o + s, u = o + c;
|
|
2655
2928
|
l < u && n(l, u);
|
|
2656
2929
|
}
|
|
2657
|
-
function
|
|
2930
|
+
function za(e, t, n, r) {
|
|
2658
2931
|
if (!e) return;
|
|
2659
|
-
let i =
|
|
2932
|
+
let i = Fa(e, t, r);
|
|
2660
2933
|
if (!i) return;
|
|
2661
2934
|
let a = i.closest(".layout-paragraph");
|
|
2662
2935
|
if (!a) return;
|
|
@@ -2665,50 +2938,58 @@ function ba(e, t, n, r) {
|
|
|
2665
2938
|
}
|
|
2666
2939
|
//#endregion
|
|
2667
2940
|
//#region src/composables/usePagesPointer.ts
|
|
2668
|
-
var
|
|
2669
|
-
function
|
|
2670
|
-
let t =
|
|
2941
|
+
var Ba = 500;
|
|
2942
|
+
function Va(e) {
|
|
2943
|
+
let t = H(null), n = null;
|
|
2671
2944
|
function r() {
|
|
2672
2945
|
n !== null && (clearTimeout(n), n = null);
|
|
2673
2946
|
}
|
|
2674
|
-
let i =
|
|
2947
|
+
let i = De(null), a = 0, o = null, s = 0, c = !1, l = null, u = Bn(), d = ie({
|
|
2675
2948
|
pagesContainer: e.pagesRef,
|
|
2676
2949
|
onScrollExtendSelection: (e, t) => {
|
|
2677
2950
|
if (!c || l === null) return;
|
|
2678
2951
|
let n = m(e, t);
|
|
2679
|
-
n !== null && n !== l &&
|
|
2952
|
+
n !== null && n !== l && _(l, n);
|
|
2680
2953
|
}
|
|
2681
|
-
}), f =
|
|
2954
|
+
}), f = H({
|
|
2682
2955
|
currentPage: 1,
|
|
2683
2956
|
totalPages: 1,
|
|
2684
2957
|
visible: !1
|
|
2685
2958
|
}), p = null;
|
|
2686
2959
|
function m(t, n) {
|
|
2687
|
-
return
|
|
2960
|
+
return La(e.pagesRef.value, e.editorView.value, t, n);
|
|
2688
2961
|
}
|
|
2689
2962
|
function h() {
|
|
2690
2963
|
let t = i.value;
|
|
2691
|
-
if (t?.
|
|
2692
|
-
let n = e.getHfPmView(t.
|
|
2964
|
+
if (t?.rId) {
|
|
2965
|
+
let n = e.getHfPmView(t.rId);
|
|
2693
2966
|
if (n) return n;
|
|
2694
2967
|
}
|
|
2695
2968
|
return e.editorView.value;
|
|
2696
2969
|
}
|
|
2697
|
-
function g(
|
|
2970
|
+
function g(t, n) {
|
|
2971
|
+
let r = i.value, a = e.pagesRef.value, o = h();
|
|
2972
|
+
if (r?.rId && a && o !== e.editorView.value) {
|
|
2973
|
+
let e = Ln(a, r.position, r.rId, t, n);
|
|
2974
|
+
return e === null || e < 0 ? null : Math.min(e, o?.state.doc.content.size ?? e);
|
|
2975
|
+
}
|
|
2976
|
+
return m(t, n);
|
|
2977
|
+
}
|
|
2978
|
+
function _(e, t) {
|
|
2698
2979
|
let n = h();
|
|
2699
2980
|
if (n) try {
|
|
2700
|
-
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a =
|
|
2981
|
+
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = Y.between(r, i);
|
|
2701
2982
|
n.dispatch(n.state.tr.setSelection(a));
|
|
2702
2983
|
} catch {}
|
|
2703
2984
|
}
|
|
2704
|
-
function _(t) {
|
|
2705
|
-
_a(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2706
|
-
}
|
|
2707
2985
|
function v(t) {
|
|
2708
|
-
|
|
2986
|
+
Ia(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2987
|
+
}
|
|
2988
|
+
function ee(t) {
|
|
2989
|
+
Ra(e.pagesRef.value, t, _, i.value?.position);
|
|
2709
2990
|
}
|
|
2710
2991
|
function y(t) {
|
|
2711
|
-
|
|
2992
|
+
za(e.pagesRef.value, t, _, i.value?.position);
|
|
2712
2993
|
}
|
|
2713
2994
|
function b(t) {
|
|
2714
2995
|
let n = e.editorView.value;
|
|
@@ -2723,21 +3004,21 @@ function Sa(e) {
|
|
|
2723
3004
|
}
|
|
2724
3005
|
return !0;
|
|
2725
3006
|
}), r !== null) {
|
|
2726
|
-
|
|
3007
|
+
v(r);
|
|
2727
3008
|
try {
|
|
2728
|
-
|
|
3009
|
+
_(Math.min(r + 1, n.state.doc.content.size));
|
|
2729
3010
|
} catch {
|
|
2730
|
-
|
|
3011
|
+
_(r);
|
|
2731
3012
|
}
|
|
2732
3013
|
}
|
|
2733
3014
|
}
|
|
2734
|
-
function
|
|
3015
|
+
function te(a) {
|
|
2735
3016
|
if (e.readOnly.value || c) return;
|
|
2736
3017
|
let o = e.pagesRef.value;
|
|
2737
3018
|
if (!o) return;
|
|
2738
3019
|
let s = e.pagesViewportRef.value;
|
|
2739
3020
|
if (!s || !(a.target instanceof HTMLElement)) return;
|
|
2740
|
-
let l =
|
|
3021
|
+
let l = zn({
|
|
2741
3022
|
mouseX: a.clientX,
|
|
2742
3023
|
mouseY: a.clientY,
|
|
2743
3024
|
pagesContainer: o,
|
|
@@ -2747,7 +3028,7 @@ function Sa(e) {
|
|
|
2747
3028
|
if (!l) {
|
|
2748
3029
|
n === null && (n = setTimeout(() => {
|
|
2749
3030
|
t.value = null, n = null;
|
|
2750
|
-
},
|
|
3031
|
+
}, Rn));
|
|
2751
3032
|
return;
|
|
2752
3033
|
}
|
|
2753
3034
|
let u = e.zoom.value || 1, d = s.getBoundingClientRect();
|
|
@@ -2758,16 +3039,16 @@ function Sa(e) {
|
|
|
2758
3039
|
cellPmPos: l.cellPmPos
|
|
2759
3040
|
}, r();
|
|
2760
3041
|
}
|
|
2761
|
-
function
|
|
3042
|
+
function x(n) {
|
|
2762
3043
|
n.preventDefault(), n.stopPropagation();
|
|
2763
3044
|
let r = t.value, i = e.editorView.value;
|
|
2764
3045
|
if (!r || !i) return;
|
|
2765
|
-
let a = i.state.tr.setSelection(
|
|
3046
|
+
let a = i.state.tr.setSelection(Y.create(i.state.doc, r.cellPmPos + 1));
|
|
2766
3047
|
i.dispatch(a);
|
|
2767
3048
|
let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow : o.addColumnRight;
|
|
2768
3049
|
s && (s()(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
|
|
2769
3050
|
}
|
|
2770
|
-
function
|
|
3051
|
+
function ne(t) {
|
|
2771
3052
|
let n = t.target, r = n instanceof HTMLElement ? n.closest("a[href]") : null;
|
|
2772
3053
|
if (!r) return;
|
|
2773
3054
|
t.preventDefault();
|
|
@@ -2792,128 +3073,102 @@ function Sa(e) {
|
|
|
2792
3073
|
...l ? { tooltip: l } : {}
|
|
2793
3074
|
};
|
|
2794
3075
|
}
|
|
2795
|
-
function
|
|
2796
|
-
if (!(t.target instanceof HTMLElement)) return;
|
|
3076
|
+
function re(t) {
|
|
3077
|
+
if (e.readOnly.value || !e.showHeaderFooterEditing.value || i.value || !(t.target instanceof HTMLElement)) return;
|
|
2797
3078
|
let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
|
|
2798
3079
|
if (!o) return;
|
|
2799
3080
|
let s = r ? "header" : "footer", c = e.getDocument();
|
|
2800
3081
|
if (!c?.package) return;
|
|
2801
|
-
let l =
|
|
3082
|
+
let l = o.closest("[data-page-number]"), u = Number.parseInt(l?.dataset.pageNumber ?? "1", 10), d = Qt(c.package), f = d.hasTitlePg && u === 1, p = Xt(d, s, f);
|
|
2802
3083
|
if (!p) {
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
hdrFtrType: t,
|
|
2807
|
-
content: [{
|
|
2808
|
-
type: "paragraph",
|
|
2809
|
-
content: []
|
|
2810
|
-
}]
|
|
2811
|
-
}, i = s === "header" ? "headers" : "footers", a = s === "header" ? "headerReferences" : "footerReferences", o = new Map(c.package[i] ?? []);
|
|
2812
|
-
o.set(n, r);
|
|
2813
|
-
let u = c.package.relationships, d = /* @__PURE__ */ new Set();
|
|
2814
|
-
for (let e of u?.values() ?? []) e.target && d.add(e.target);
|
|
2815
|
-
let m = 1;
|
|
2816
|
-
for (; d.has(`${s}${m}.xml`);) m++;
|
|
2817
|
-
let h = s === "header" ? "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" : "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", g = new Map(u);
|
|
2818
|
-
g.set(n, {
|
|
2819
|
-
id: n,
|
|
2820
|
-
type: h,
|
|
2821
|
-
target: `${s}${m}.xml`
|
|
2822
|
-
});
|
|
2823
|
-
let _ = {
|
|
2824
|
-
type: t,
|
|
2825
|
-
rId: n
|
|
2826
|
-
}, v = {
|
|
2827
|
-
...l,
|
|
2828
|
-
[a]: [...l[a] ?? [], _]
|
|
2829
|
-
}, y = c.package.document, b = y?.sections?.map((e, t) => t === 0 ? {
|
|
2830
|
-
...e,
|
|
2831
|
-
properties: v
|
|
2832
|
-
} : e), x = y?.finalSectionProperties === l ? v : y?.finalSectionProperties, ee = {
|
|
2833
|
-
...c,
|
|
2834
|
-
package: {
|
|
2835
|
-
...c.package,
|
|
2836
|
-
[i]: o,
|
|
2837
|
-
relationships: g,
|
|
2838
|
-
document: y && {
|
|
2839
|
-
...y,
|
|
2840
|
-
...b !== void 0 && { sections: b },
|
|
2841
|
-
...x !== void 0 && { finalSectionProperties: x }
|
|
2842
|
-
}
|
|
2843
|
-
}
|
|
2844
|
-
};
|
|
2845
|
-
f = n, p = r, e.setDocument?.(ee), e.syncHfPMs?.(), e.reLayout(), e.emit("change", ee);
|
|
3084
|
+
let t = Yt(c, s, f);
|
|
3085
|
+
if (!t) return;
|
|
3086
|
+
e.setDocument(t), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(t), d = Qt(t.package), p = Xt(d, s, f);
|
|
2846
3087
|
}
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
3088
|
+
if (!p) return;
|
|
3089
|
+
let m = p, h = e.pagesViewportRef.value;
|
|
3090
|
+
if (!h) return;
|
|
3091
|
+
let g = o.getBoundingClientRect(), _ = h.getBoundingClientRect(), v = e.zoom.value || 1;
|
|
2850
3092
|
i.value = {
|
|
3093
|
+
isFirstPage: f,
|
|
3094
|
+
pageNumber: u,
|
|
2851
3095
|
position: s,
|
|
2852
|
-
rId:
|
|
2853
|
-
headerFooter: p,
|
|
3096
|
+
rId: m,
|
|
2854
3097
|
targetRect: {
|
|
2855
|
-
top: (
|
|
2856
|
-
left: (
|
|
2857
|
-
width:
|
|
2858
|
-
height:
|
|
3098
|
+
top: (g.top - _.top + h.scrollTop) / v,
|
|
3099
|
+
left: (g.left - _.left + h.scrollLeft) / v,
|
|
3100
|
+
width: g.width / v,
|
|
3101
|
+
height: g.height / v
|
|
2859
3102
|
}
|
|
2860
|
-
}
|
|
3103
|
+
}, requestAnimationFrame(() => {
|
|
3104
|
+
let n = e.getHfPmView(m);
|
|
3105
|
+
if (!n) return;
|
|
3106
|
+
let r = Ln(e.pagesRef.value ?? o, s, m, t.clientX, t.clientY);
|
|
3107
|
+
if (r !== null) {
|
|
3108
|
+
let e = Math.max(0, Math.min(r, n.state.doc.content.size));
|
|
3109
|
+
n.dispatch(n.state.tr.setSelection(Y.create(n.state.doc, e)));
|
|
3110
|
+
}
|
|
3111
|
+
n.focus();
|
|
3112
|
+
});
|
|
2861
3113
|
}
|
|
2862
|
-
function
|
|
2863
|
-
let
|
|
2864
|
-
if (!
|
|
2865
|
-
let
|
|
2866
|
-
if (!
|
|
2867
|
-
let
|
|
2868
|
-
|
|
3114
|
+
function ae() {
|
|
3115
|
+
let t = e.getDocument(), n = i.value;
|
|
3116
|
+
if (!t?.package || !n?.rId) return;
|
|
3117
|
+
let r = e.getHfPmView(n.rId);
|
|
3118
|
+
if (!r) return;
|
|
3119
|
+
let a = $t({
|
|
3120
|
+
document: t,
|
|
3121
|
+
position: n.position,
|
|
3122
|
+
isFirstPage: n.isFirstPage,
|
|
3123
|
+
activeRId: n.rId,
|
|
3124
|
+
blocks: Ht(r.state.doc)
|
|
3125
|
+
});
|
|
3126
|
+
a && (i.value = null, e.setDocument(a), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(a));
|
|
2869
3127
|
}
|
|
2870
|
-
function
|
|
3128
|
+
function S() {
|
|
2871
3129
|
let t = e.getDocument(), n = i.value;
|
|
2872
3130
|
if (!t?.package || !n || !n.rId) {
|
|
2873
3131
|
i.value = null;
|
|
2874
3132
|
return;
|
|
2875
3133
|
}
|
|
2876
|
-
let r =
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
...e,
|
|
2883
|
-
sectionProperties: c(e.sectionProperties)
|
|
2884
|
-
} : e, u = t.package.document, d = u?.sections?.map((e) => ({
|
|
2885
|
-
...e,
|
|
2886
|
-
properties: c(e.properties)
|
|
2887
|
-
})), f = u?.finalSectionProperties ? c(u.finalSectionProperties) : void 0, p = {
|
|
2888
|
-
...t,
|
|
2889
|
-
package: {
|
|
2890
|
-
...t.package,
|
|
2891
|
-
[r]: s,
|
|
2892
|
-
document: u && {
|
|
2893
|
-
...u,
|
|
2894
|
-
content: u.content.map(l),
|
|
2895
|
-
...d !== void 0 && { sections: d },
|
|
2896
|
-
...f !== void 0 && { finalSectionProperties: f }
|
|
2897
|
-
}
|
|
2898
|
-
}
|
|
2899
|
-
};
|
|
2900
|
-
i.value = null, e.setDocument?.(p), e.syncHfPMs?.(), e.reLayout(), e.emit("change", p);
|
|
3134
|
+
let r = Zt({
|
|
3135
|
+
document: t,
|
|
3136
|
+
position: n.position,
|
|
3137
|
+
activeRId: n.rId
|
|
3138
|
+
});
|
|
3139
|
+
i.value = null, e.setDocument(r), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(r);
|
|
2901
3140
|
}
|
|
2902
|
-
function
|
|
3141
|
+
function oe(t) {
|
|
2903
3142
|
if (t.button !== 0 || e.imageInteracting.value) return;
|
|
2904
3143
|
let n = e.editorView.value;
|
|
2905
3144
|
if (!n) return;
|
|
2906
3145
|
let r = t.target, d = r instanceof HTMLElement ? r : null;
|
|
2907
|
-
i.value && d
|
|
3146
|
+
if (i.value && d) if (!(d.closest(".layout-page-header") || d.closest(".layout-page-footer") || d.closest(".hf-inline-editor"))) ae(), n.focus();
|
|
3147
|
+
else {
|
|
3148
|
+
let t = i.value, n = d.closest(`.layout-page-${t.position}`), r = n?.closest("[data-page-number]"), a = e.pagesViewportRef.value;
|
|
3149
|
+
if (n && r && a) {
|
|
3150
|
+
let o = Number.parseInt(r.dataset.pageNumber ?? "1", 10), s = n.getBoundingClientRect(), c = a.getBoundingClientRect(), l = e.zoom.value || 1;
|
|
3151
|
+
i.value = {
|
|
3152
|
+
...t,
|
|
3153
|
+
pageNumber: o,
|
|
3154
|
+
targetRect: {
|
|
3155
|
+
top: (s.top - c.top + a.scrollTop) / l,
|
|
3156
|
+
left: (s.left - c.left + a.scrollLeft) / l,
|
|
3157
|
+
width: s.width / l,
|
|
3158
|
+
height: s.height / l
|
|
3159
|
+
}
|
|
3160
|
+
};
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
2908
3163
|
let f = h() ?? n;
|
|
2909
3164
|
if (!e.readOnly.value && e.tableResize.tryStartResize(t, f)) return;
|
|
2910
|
-
let p =
|
|
3165
|
+
let p = dt(r);
|
|
2911
3166
|
if (p) {
|
|
2912
3167
|
t.preventDefault(), t.stopPropagation();
|
|
2913
3168
|
let n = Number(p.dataset.pmStart);
|
|
2914
3169
|
if (!Number.isNaN(n)) {
|
|
2915
3170
|
try {
|
|
2916
|
-
f.dispatch(f.state.tr.setSelection(
|
|
3171
|
+
f.dispatch(f.state.tr.setSelection(at.create(f.state.doc, n)));
|
|
2917
3172
|
} catch {}
|
|
2918
3173
|
e.selectedImage.value = {
|
|
2919
3174
|
element: p,
|
|
@@ -2926,37 +3181,37 @@ function Sa(e) {
|
|
|
2926
3181
|
return;
|
|
2927
3182
|
}
|
|
2928
3183
|
e.selectedImage.value = null, t.preventDefault();
|
|
2929
|
-
let
|
|
2930
|
-
if (
|
|
3184
|
+
let m = g(t.clientX, t.clientY);
|
|
3185
|
+
if (m === null) {
|
|
2931
3186
|
f.focus();
|
|
2932
3187
|
return;
|
|
2933
3188
|
}
|
|
2934
|
-
let
|
|
2935
|
-
if (
|
|
2936
|
-
else if (s >= 3) y(
|
|
3189
|
+
let v = Date.now();
|
|
3190
|
+
if (v - a < Ba && o === m ? s++ : s = 1, a = v, o = m, s === 2) ee(m);
|
|
3191
|
+
else if (s >= 3) y(m), s = 0;
|
|
2937
3192
|
else if (t.shiftKey) {
|
|
2938
3193
|
let { from: e } = f.state.selection;
|
|
2939
|
-
|
|
2940
|
-
} else
|
|
3194
|
+
_(e, m);
|
|
3195
|
+
} else _(m), l = m, c = !0, u.begin(Vn(f, m));
|
|
2941
3196
|
f.focus();
|
|
2942
3197
|
}
|
|
2943
|
-
function
|
|
3198
|
+
function se(e) {
|
|
2944
3199
|
if (!c || l === null) return;
|
|
2945
|
-
let t =
|
|
3200
|
+
let t = g(e.clientX, e.clientY);
|
|
2946
3201
|
if (t !== null) {
|
|
2947
3202
|
let n = h();
|
|
2948
3203
|
if (n && u.update(n, t, e.clientX)) {
|
|
2949
3204
|
d.updateMousePosition(e.clientX, e.clientY);
|
|
2950
3205
|
return;
|
|
2951
3206
|
}
|
|
2952
|
-
t !== l &&
|
|
3207
|
+
t !== l && _(l, t);
|
|
2953
3208
|
}
|
|
2954
3209
|
d.updateMousePosition(e.clientX, e.clientY);
|
|
2955
3210
|
}
|
|
2956
|
-
function
|
|
3211
|
+
function C() {
|
|
2957
3212
|
c = !1, u.end(), d.stopAutoScroll();
|
|
2958
3213
|
}
|
|
2959
|
-
function
|
|
3214
|
+
function ce() {
|
|
2960
3215
|
let t = e.pagesViewportRef.value, n = e.layout.value;
|
|
2961
3216
|
if (!t || !n || n.pages.length === 0) return;
|
|
2962
3217
|
let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
|
|
@@ -2981,41 +3236,107 @@ function Sa(e) {
|
|
|
2981
3236
|
};
|
|
2982
3237
|
}, 600);
|
|
2983
3238
|
}
|
|
2984
|
-
return
|
|
2985
|
-
window.addEventListener("mousemove",
|
|
2986
|
-
}),
|
|
2987
|
-
r(), window.removeEventListener("mousemove",
|
|
3239
|
+
return Ce(() => {
|
|
3240
|
+
window.addEventListener("mousemove", se), window.addEventListener("mouseup", C), e.pagesViewportRef.value?.addEventListener("scroll", ce, { passive: !0 });
|
|
3241
|
+
}), Se(() => {
|
|
3242
|
+
r(), window.removeEventListener("mousemove", se), window.removeEventListener("mouseup", C), e.pagesViewportRef.value?.removeEventListener("scroll", ce), p && clearTimeout(p);
|
|
2988
3243
|
}), {
|
|
2989
3244
|
tableInsertButton: t,
|
|
2990
3245
|
hfEdit: i,
|
|
2991
3246
|
scrollPageInfo: f,
|
|
2992
3247
|
resolvePos: m,
|
|
2993
|
-
setPmSelection:
|
|
2994
|
-
scrollVisiblePositionIntoView:
|
|
3248
|
+
setPmSelection: _,
|
|
3249
|
+
scrollVisiblePositionIntoView: v,
|
|
2995
3250
|
navigateToBookmark: b,
|
|
2996
|
-
handlePagesMouseDown:
|
|
2997
|
-
handlePagesMouseMove:
|
|
2998
|
-
handlePagesClick:
|
|
2999
|
-
handlePagesDoubleClick:
|
|
3000
|
-
handleTableInsertClick:
|
|
3251
|
+
handlePagesMouseDown: oe,
|
|
3252
|
+
handlePagesMouseMove: te,
|
|
3253
|
+
handlePagesClick: ne,
|
|
3254
|
+
handlePagesDoubleClick: re,
|
|
3255
|
+
handleTableInsertClick: x,
|
|
3001
3256
|
clearTableInsertTimer: r,
|
|
3002
|
-
handleHfSave:
|
|
3003
|
-
handleHfRemove:
|
|
3257
|
+
handleHfSave: ae,
|
|
3258
|
+
handleHfRemove: S
|
|
3004
3259
|
};
|
|
3005
3260
|
}
|
|
3006
3261
|
//#endregion
|
|
3262
|
+
//#region src/composables/useRemoteSelectionSync.ts
|
|
3263
|
+
var Ha = (e) => {
|
|
3264
|
+
let t = new Hn(), n = null, r = () => {
|
|
3265
|
+
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3266
|
+
let r = e.pagesRef.value;
|
|
3267
|
+
r && t.clear(r);
|
|
3268
|
+
}, i = () => {
|
|
3269
|
+
n !== null && cancelAnimationFrame(n), n = requestAnimationFrame(() => {
|
|
3270
|
+
if (n = null, !e.syncCoordinator.isSafeToRender()) return;
|
|
3271
|
+
let r = e.pagesRef.value;
|
|
3272
|
+
r && t.sync({
|
|
3273
|
+
pagesContainer: r,
|
|
3274
|
+
selections: e.remoteSelections.value,
|
|
3275
|
+
zoom: e.zoom.value,
|
|
3276
|
+
zIndex: re.remoteSelection
|
|
3277
|
+
});
|
|
3278
|
+
});
|
|
3279
|
+
}, a = e.syncCoordinator.onRender(i);
|
|
3280
|
+
K([
|
|
3281
|
+
e.pagesRef,
|
|
3282
|
+
e.remoteSelections,
|
|
3283
|
+
e.zoom
|
|
3284
|
+
], i, { flush: "post" }), we(() => {
|
|
3285
|
+
a(), r();
|
|
3286
|
+
});
|
|
3287
|
+
}, Ua = (e) => {
|
|
3288
|
+
let t = new Un(), n = null, r = () => {
|
|
3289
|
+
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3290
|
+
let r = e.pagesRef.value;
|
|
3291
|
+
r && t.clear(r);
|
|
3292
|
+
}, i = () => {
|
|
3293
|
+
n !== null && cancelAnimationFrame(n), n = requestAnimationFrame(() => {
|
|
3294
|
+
if (n = null, !e.syncCoordinator.isSafeToRender()) return;
|
|
3295
|
+
let r = e.pagesRef.value, i = e.editorView.value;
|
|
3296
|
+
if (!r || !i) return;
|
|
3297
|
+
let a = t.sync({
|
|
3298
|
+
pagesContainer: r,
|
|
3299
|
+
state: i.state,
|
|
3300
|
+
zoom: e.zoom.value,
|
|
3301
|
+
zIndex: re.selectionOverlay
|
|
3302
|
+
});
|
|
3303
|
+
if (a.type === "image") {
|
|
3304
|
+
let t = e.selectedImage.value, n = a.element.offsetWidth, r = a.element.offsetHeight;
|
|
3305
|
+
(t?.element !== a.element || t.pmPos !== a.pmPos || t.width !== n || t.height !== r) && (e.selectedImage.value = {
|
|
3306
|
+
element: a.element,
|
|
3307
|
+
pmPos: a.pmPos,
|
|
3308
|
+
width: n,
|
|
3309
|
+
height: r
|
|
3310
|
+
});
|
|
3311
|
+
return;
|
|
3312
|
+
}
|
|
3313
|
+
e.imageInteracting?.value || (e.selectedImage.value = null);
|
|
3314
|
+
});
|
|
3315
|
+
}, a = e.syncCoordinator.onRender(i);
|
|
3316
|
+
return K([
|
|
3317
|
+
e.zoom,
|
|
3318
|
+
e.editorView,
|
|
3319
|
+
e.pagesRef
|
|
3320
|
+
], i, { flush: "post" }), we(() => {
|
|
3321
|
+
a(), r();
|
|
3322
|
+
}), {
|
|
3323
|
+
clearOverlay: r,
|
|
3324
|
+
updateSelectionOverlay: i
|
|
3325
|
+
};
|
|
3326
|
+
};
|
|
3327
|
+
//#endregion
|
|
3007
3328
|
//#region src/utils/hostFonts.ts
|
|
3008
|
-
function
|
|
3329
|
+
function Wa(e) {
|
|
3009
3330
|
return typeof e == "string" && e.trim().length > 0;
|
|
3010
3331
|
}
|
|
3011
|
-
function
|
|
3012
|
-
return typeof e != "object" || !e ? !1 :
|
|
3332
|
+
function Ga(e) {
|
|
3333
|
+
return typeof e != "object" || !e ? !1 : Wa(Reflect.get(e, "family")) && Wa(Reflect.get(e, "src"));
|
|
3013
3334
|
}
|
|
3014
|
-
function
|
|
3335
|
+
function Ka(e) {
|
|
3015
3336
|
if (!e) return [];
|
|
3016
3337
|
let t = [];
|
|
3017
3338
|
for (let n of e) {
|
|
3018
|
-
if (!
|
|
3339
|
+
if (!Ga(n)) continue;
|
|
3019
3340
|
let e = { display: "swap" };
|
|
3020
3341
|
(typeof n.weight == "number" || typeof n.weight == "string") && (e.weight = String(n.weight)), t.push({
|
|
3021
3342
|
family: n.family.trim(),
|
|
@@ -3025,10 +3346,10 @@ function Ta(e) {
|
|
|
3025
3346
|
}
|
|
3026
3347
|
return t;
|
|
3027
3348
|
}
|
|
3028
|
-
function
|
|
3349
|
+
function qa() {
|
|
3029
3350
|
return typeof document > "u" || !("fonts" in document) ? null : document.fonts;
|
|
3030
3351
|
}
|
|
3031
|
-
async function
|
|
3352
|
+
async function Ja(e, t, n, r) {
|
|
3032
3353
|
let i;
|
|
3033
3354
|
try {
|
|
3034
3355
|
i = new FontFace(t, n, r), e.add(i);
|
|
@@ -3037,39 +3358,39 @@ async function Da(e, t, n, r) {
|
|
|
3037
3358
|
}
|
|
3038
3359
|
return await i.load().then(() => !0, () => !1) ? i : (e.delete(i), null);
|
|
3039
3360
|
}
|
|
3040
|
-
async function
|
|
3041
|
-
let t =
|
|
3361
|
+
async function Ya(e) {
|
|
3362
|
+
let t = qa();
|
|
3042
3363
|
if (!t) return [];
|
|
3043
|
-
let n =
|
|
3364
|
+
let n = Ka(e);
|
|
3044
3365
|
if (n.length === 0) return [];
|
|
3045
3366
|
let r = [];
|
|
3046
3367
|
return await Promise.all(n.map(async ({ family: e, source: n, descriptors: i }) => {
|
|
3047
|
-
let a = await
|
|
3368
|
+
let a = await Ja(t, e, n, i);
|
|
3048
3369
|
a && r.push(a);
|
|
3049
3370
|
})), r;
|
|
3050
3371
|
}
|
|
3051
|
-
function
|
|
3052
|
-
let t =
|
|
3372
|
+
function Xa(e) {
|
|
3373
|
+
let t = qa();
|
|
3053
3374
|
if (t) for (let n of e) t.delete(n);
|
|
3054
3375
|
}
|
|
3055
3376
|
//#endregion
|
|
3056
3377
|
//#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
|
|
3057
|
-
var
|
|
3378
|
+
var Za = { class: "docx-editor-vue__toolbar-shell" }, Qa = {
|
|
3058
3379
|
key: 0,
|
|
3059
3380
|
class: "docx-editor-vue__error"
|
|
3060
|
-
},
|
|
3381
|
+
}, $a = {
|
|
3061
3382
|
key: 1,
|
|
3062
3383
|
class: "docx-editor-vue__loading"
|
|
3063
|
-
},
|
|
3384
|
+
}, eo = {
|
|
3064
3385
|
key: 2,
|
|
3065
3386
|
class: "docx-editor-vue__placeholder"
|
|
3066
|
-
},
|
|
3387
|
+
}, to = { class: "docx-editor-vue__editor-area" }, no = {
|
|
3067
3388
|
key: 0,
|
|
3068
3389
|
class: "docx-editor-vue__ruler-h"
|
|
3069
|
-
},
|
|
3390
|
+
}, ro = {
|
|
3070
3391
|
key: 1,
|
|
3071
3392
|
class: "docx-editor-vue__ruler-v"
|
|
3072
|
-
},
|
|
3393
|
+
}, io = {
|
|
3073
3394
|
class: "docx-editor-vue__editor-content-wrapper",
|
|
3074
3395
|
style: {
|
|
3075
3396
|
position: "relative",
|
|
@@ -3077,11 +3398,11 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3077
3398
|
flexDirection: "column",
|
|
3078
3399
|
minHeight: "100%"
|
|
3079
3400
|
}
|
|
3080
|
-
},
|
|
3401
|
+
}, ao = {
|
|
3081
3402
|
"data-testid": "selection-overlay",
|
|
3082
3403
|
class: "docx-editor-vue__decoration-origin",
|
|
3083
3404
|
"aria-hidden": "true"
|
|
3084
|
-
},
|
|
3405
|
+
}, oo = ["aria-label"], so = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
3085
3406
|
__name: "DocxEditor",
|
|
3086
3407
|
props: {
|
|
3087
3408
|
documentBuffer: { default: null },
|
|
@@ -3110,7 +3431,10 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3110
3431
|
type: Boolean,
|
|
3111
3432
|
default: !0
|
|
3112
3433
|
},
|
|
3113
|
-
showHeaderFooterEditing: {
|
|
3434
|
+
showHeaderFooterEditing: {
|
|
3435
|
+
type: Boolean,
|
|
3436
|
+
default: !0
|
|
3437
|
+
},
|
|
3114
3438
|
showMarginGuides: { type: Boolean },
|
|
3115
3439
|
marginGuideColor: {},
|
|
3116
3440
|
showRuler: { type: Boolean },
|
|
@@ -3201,39 +3525,41 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3201
3525
|
],
|
|
3202
3526
|
setup(t, { expose: n, emit: a }) {
|
|
3203
3527
|
let o = t, s = a;
|
|
3204
|
-
e(), i(o.components),
|
|
3205
|
-
let l =
|
|
3528
|
+
e(), i(o.components), Jr(H(!1));
|
|
3529
|
+
let l = H(o.mode), u = k(() => o.readOnly || l.value === "viewing"), d = k(() => o.showReviewControls), f = k(() => pt(l.value)), p = H("all-markup");
|
|
3206
3530
|
function h() {
|
|
3207
|
-
|
|
3531
|
+
Dn(mt(l.value));
|
|
3208
3532
|
}
|
|
3209
|
-
function
|
|
3533
|
+
function ee(e) {
|
|
3210
3534
|
p.value = e;
|
|
3211
3535
|
}
|
|
3212
|
-
let
|
|
3213
|
-
|
|
3214
|
-
let
|
|
3215
|
-
|
|
3216
|
-
e || (
|
|
3536
|
+
let y = k(() => p.value === "all-markup" ? "" : `folio-root--${p.value}`), { t: b } = c(), x = ({ node: e }) => e;
|
|
3537
|
+
x.props = ["node"];
|
|
3538
|
+
let re = k(() => o.documentBuffer != null || o.document != null), ie = H(!1);
|
|
3539
|
+
K(re, (e) => {
|
|
3540
|
+
e || (ie.value = !1);
|
|
3217
3541
|
});
|
|
3218
|
-
let
|
|
3219
|
-
function
|
|
3220
|
-
o.enableWheelZoom !== !1 &&
|
|
3542
|
+
let C = H(null), ce = H(null), w = H(null), le = H(null), ue = H(null), de = k(() => o.showRuler ?? !1), T = H(0), fe = H(!1), pe = H(!1), me = H(!1), he = H(!1), E = H(!1), D = H(!1), ge = H(o.showOutline), A = H(!1), ve = H(null), L = H(null), ye = De([]), be = De([]), { zoom: R, zoomPercent: we, isMinZoom: Te, isMaxZoom: U, setZoom: Oe, zoomIn: Ae, zoomOut: je, handleWheel: Me, handleKeyDown: Pe, ZOOM_PRESETS: Fe } = se(o.initialZoom);
|
|
3543
|
+
function Le(e) {
|
|
3544
|
+
o.enableWheelZoom !== !1 && Me(e);
|
|
3221
3545
|
}
|
|
3222
|
-
|
|
3223
|
-
showKeyboardShortcuts:
|
|
3224
|
-
showFindReplace:
|
|
3225
|
-
showHyperlink:
|
|
3226
|
-
handleZoomKeyDown:
|
|
3546
|
+
Da({
|
|
3547
|
+
showKeyboardShortcuts: me,
|
|
3548
|
+
showFindReplace: fe,
|
|
3549
|
+
showHyperlink: pe,
|
|
3550
|
+
handleZoomKeyDown: Pe
|
|
3227
3551
|
});
|
|
3228
|
-
let { editor:
|
|
3229
|
-
hiddenContainer:
|
|
3230
|
-
|
|
3552
|
+
let { editor: ze, editorView: J, editorState: He, remoteSelections: Ye, headerFooterSelection: Xe, isReady: Ze, isDirty: Qe, parseError: $e, layout: et, blocks: tt, measures: nt, syncCoordinator: rt, loadBuffer: it, loadDocument: at, save: ot, getDocument: Y, setDocument: st, getHeaderFooterView: ct, syncHeaderFooterViews: lt, getCommands: ut, focus: dt, reLayout: ft } = S({
|
|
3553
|
+
hiddenContainer: C,
|
|
3554
|
+
hiddenHeaderFooterContainer: ce,
|
|
3555
|
+
pagesContainer: w,
|
|
3231
3556
|
readOnly: u,
|
|
3232
3557
|
editorMode: l,
|
|
3233
3558
|
author: () => o.author,
|
|
3234
3559
|
password: () => o.password,
|
|
3235
3560
|
documentKey: () => o.documentKey,
|
|
3236
3561
|
externalPlugins: [],
|
|
3562
|
+
collaboration: () => o.collaboration,
|
|
3237
3563
|
onAnonymizationMatchesChange: (e) => o.onAnonymizationMatchesChange?.(e),
|
|
3238
3564
|
showTemplateDirectives: () => o.showTemplateDirectives,
|
|
3239
3565
|
onSlashMenuChange: (e) => o.onSlashMenuChange?.(e),
|
|
@@ -3245,7 +3571,7 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3245
3571
|
o.onError?.(e), s("error", e);
|
|
3246
3572
|
},
|
|
3247
3573
|
onSelectionUpdate: (e) => {
|
|
3248
|
-
if (o.onSelectionChange?.(
|
|
3574
|
+
if (o.onSelectionChange?.(Ne(e)), o.onSelectionTextChange) {
|
|
3249
3575
|
let { from: t, to: n } = e.selection, r = t === n ? "" : e.doc.textBetween(t, n, " ", " ");
|
|
3250
3576
|
o.onSelectionTextChange({
|
|
3251
3577
|
from: t,
|
|
@@ -3258,117 +3584,147 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3258
3584
|
onReadOnlyEditAttempt: () => o.onReadonlyEditAttempt?.(),
|
|
3259
3585
|
featureFlags: () => o.featureFlags,
|
|
3260
3586
|
onSelectiveSaveTripwire: o.onSelectiveSaveTripwire ? (e) => o.onSelectiveSaveTripwire?.(e) : void 0
|
|
3261
|
-
}),
|
|
3262
|
-
function
|
|
3263
|
-
|
|
3587
|
+
}), X = k(() => (L.value ? ct(L.value) : null) ?? J.value), ht = k(() => !Ze.value && re.value && !(o.preserveDocumentWhileLoading === !0 && ie.value));
|
|
3588
|
+
function gt() {
|
|
3589
|
+
J.value && (Ke(), Ge(), ft());
|
|
3264
3590
|
}
|
|
3265
|
-
|
|
3591
|
+
K(() => o.fonts, (e, t, n) => {
|
|
3266
3592
|
if (!e || e.length === 0) return;
|
|
3267
3593
|
let r = !1, i = [];
|
|
3268
|
-
|
|
3594
|
+
Ya(e).then((e) => {
|
|
3269
3595
|
if (r) {
|
|
3270
|
-
|
|
3596
|
+
Xa(e);
|
|
3271
3597
|
return;
|
|
3272
3598
|
}
|
|
3273
|
-
i = e, e.length !== 0 &&
|
|
3599
|
+
i = e, e.length !== 0 && gt();
|
|
3274
3600
|
}), n(() => {
|
|
3275
|
-
r = !0, i.length !== 0 && (
|
|
3601
|
+
r = !0, i.length !== 0 && (Xa(i), gt());
|
|
3276
3602
|
});
|
|
3277
3603
|
}, { immediate: !0 });
|
|
3278
|
-
let { selectedImage:
|
|
3279
|
-
editorView: X,
|
|
3280
|
-
zoom: B,
|
|
3281
|
-
stateTick: E,
|
|
3282
|
-
getCommands: et
|
|
3283
|
-
}), { hyperlinkPopupData: ft, handleHyperlinkSubmit: pt, handleHyperlinkRemove: mt, handleHyperlinkPopupNavigate: ht, handleHyperlinkPopupEdit: gt, handleHyperlinkPopupRemove: _t } = oa({
|
|
3604
|
+
let { selectedImage: _t, imageInteracting: vt, imageToolbarContext: yt, handleToolbarImageWrap: bt, handleImageTransform: xt } = Ea({
|
|
3284
3605
|
editorView: X,
|
|
3285
|
-
|
|
3286
|
-
|
|
3606
|
+
zoom: R,
|
|
3607
|
+
stateTick: T,
|
|
3608
|
+
getCommands: ut
|
|
3609
|
+
}), St = Ua({
|
|
3610
|
+
editorView: J,
|
|
3611
|
+
pagesRef: w,
|
|
3612
|
+
zoom: R,
|
|
3613
|
+
selectedImage: _t,
|
|
3614
|
+
syncCoordinator: rt,
|
|
3615
|
+
imageInteracting: vt
|
|
3616
|
+
});
|
|
3617
|
+
Ha({
|
|
3618
|
+
pagesRef: w,
|
|
3619
|
+
remoteSelections: Ye,
|
|
3620
|
+
syncCoordinator: rt,
|
|
3621
|
+
zoom: R
|
|
3622
|
+
});
|
|
3623
|
+
let { hyperlinkPopupData: Ct, handleHyperlinkSubmit: wt, handleHyperlinkRemove: Tt, handleHyperlinkPopupNavigate: Et, handleHyperlinkPopupEdit: Dt, handleHyperlinkPopupRemove: Ot } = Ta({
|
|
3287
3624
|
editorView: X,
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3625
|
+
getCommands: ut
|
|
3626
|
+
}), kt = ae(), { tableInsertButton: At, hfEdit: Z, scrollPageInfo: jt, resolvePos: Mt, setPmSelection: Nt, scrollVisiblePositionIntoView: Pt, handlePagesMouseDown: Ft, handlePagesMouseMove: It, handlePagesClick: Lt, handlePagesDoubleClick: Rt, handleTableInsertClick: zt, handleHfSave: Bt, handleHfRemove: Vt } = Va({
|
|
3627
|
+
editorView: J,
|
|
3628
|
+
pagesRef: w,
|
|
3629
|
+
pagesViewportRef: le,
|
|
3630
|
+
selectedImage: _t,
|
|
3631
|
+
imageInteracting: vt,
|
|
3632
|
+
hyperlinkPopupData: Ct,
|
|
3293
3633
|
readOnly: u,
|
|
3294
|
-
|
|
3295
|
-
|
|
3634
|
+
showHeaderFooterEditing: k(() => o.showHeaderFooterEditing),
|
|
3635
|
+
zoom: R,
|
|
3636
|
+
layout: et,
|
|
3296
3637
|
tableResize: {
|
|
3297
|
-
tryStartResize:
|
|
3298
|
-
isResizing:
|
|
3638
|
+
tryStartResize: kt.tryStartResize,
|
|
3639
|
+
isResizing: k(() => kt.isResizing())
|
|
3299
3640
|
},
|
|
3300
|
-
getCommands:
|
|
3301
|
-
getDocument:
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3641
|
+
getCommands: ut,
|
|
3642
|
+
getDocument: Y,
|
|
3643
|
+
getHfPmView: ct,
|
|
3644
|
+
syncHfPMs: lt,
|
|
3645
|
+
setDocument: st,
|
|
3646
|
+
reLayout: ft,
|
|
3647
|
+
onDocumentChange: (e) => {
|
|
3648
|
+
o.onChange?.(e), s("change", e), s("update:document", e);
|
|
3649
|
+
},
|
|
3650
|
+
clearOverlay: St.clearOverlay
|
|
3651
|
+
}), Ht = () => Z.value?.rId ? ct(Z.value.rId) : null, Ut = k(() => {
|
|
3652
|
+
let e = Z.value, t = Xe.value;
|
|
3653
|
+
return !e?.rId || !t || t.rId !== e.rId ? null : {
|
|
3654
|
+
...t,
|
|
3655
|
+
pageNumber: e.pageNumber
|
|
3656
|
+
};
|
|
3657
|
+
});
|
|
3658
|
+
K(Z, (e) => {
|
|
3659
|
+
L.value = e?.rId ?? null, e && St.clearOverlay();
|
|
3660
|
+
}, { immediate: !0 });
|
|
3661
|
+
let Wt = Oa({
|
|
3662
|
+
editorView: J,
|
|
3663
|
+
showOutline: ge,
|
|
3664
|
+
showSidebar: A,
|
|
3665
|
+
outlineHeadings: be,
|
|
3666
|
+
activeSidebarItem: ve,
|
|
3311
3667
|
extractCommentsAndChanges: () => {},
|
|
3312
|
-
scrollToVisiblePosition:
|
|
3313
|
-
}), { contextMenu:
|
|
3668
|
+
scrollToVisiblePosition: Pt
|
|
3669
|
+
}), { contextMenu: Gt, imageContextMenu: Kt, imageContextMenuTextActions: qt, customTextMenuItems: Jt, handleContextMenu: Yt, handleSelectedImageContextMenu: Xt, handleImageWrapSelect: Zt, handleContextMenuAction: Qt } = ba({
|
|
3314
3670
|
editorView: X,
|
|
3315
|
-
selectedImage:
|
|
3316
|
-
zoom:
|
|
3317
|
-
showImageProperties:
|
|
3318
|
-
getCommands:
|
|
3319
|
-
clearOverlay:
|
|
3320
|
-
setPmSelection:
|
|
3321
|
-
resolvePos:
|
|
3671
|
+
selectedImage: _t,
|
|
3672
|
+
zoom: R,
|
|
3673
|
+
showImageProperties: E,
|
|
3674
|
+
getCommands: ut,
|
|
3675
|
+
clearOverlay: St.clearOverlay,
|
|
3676
|
+
setPmSelection: Nt,
|
|
3677
|
+
resolvePos: Mt,
|
|
3322
3678
|
customContextMenuItems: () => u.value ? void 0 : o.customContextMenuItems,
|
|
3323
3679
|
onCustomContextAction: (e, t) => o.onCustomContextAction?.(e, t)
|
|
3324
|
-
}),
|
|
3325
|
-
editorView:
|
|
3326
|
-
getDocument:
|
|
3680
|
+
}), $t = oe(J, T), en = k(() => $t.value.entries), Q = ca({
|
|
3681
|
+
editorView: J,
|
|
3682
|
+
getDocument: Y,
|
|
3327
3683
|
author: () => o.author,
|
|
3328
3684
|
commentsProp: () => o.comments,
|
|
3329
3685
|
onCommentsChange: (e) => {
|
|
3330
3686
|
o.onCommentsChange?.(e), s("comments-change", e);
|
|
3331
3687
|
},
|
|
3332
|
-
reLayout:
|
|
3333
|
-
}),
|
|
3334
|
-
editorView:
|
|
3335
|
-
pagesViewport:
|
|
3336
|
-
pagesContainer:
|
|
3688
|
+
reLayout: ft
|
|
3689
|
+
}), tn = Q.comments, $ = sa({
|
|
3690
|
+
editorView: J,
|
|
3691
|
+
pagesViewport: le,
|
|
3692
|
+
pagesContainer: w,
|
|
3337
3693
|
readOnly: u,
|
|
3338
3694
|
createComment: Q.createComment,
|
|
3339
3695
|
pushComment: Q.pushComment,
|
|
3340
|
-
reLayout:
|
|
3341
|
-
showSidebar:
|
|
3696
|
+
reLayout: ft,
|
|
3697
|
+
showSidebar: A,
|
|
3342
3698
|
setActiveSidebarItem: (e) => {
|
|
3343
|
-
|
|
3699
|
+
ve.value = e;
|
|
3344
3700
|
}
|
|
3345
3701
|
});
|
|
3346
|
-
function
|
|
3347
|
-
navigator.clipboard?.writeText(e),
|
|
3702
|
+
function nn(e) {
|
|
3703
|
+
navigator.clipboard?.writeText(e), Ct.value = null;
|
|
3348
3704
|
}
|
|
3349
|
-
let
|
|
3350
|
-
|
|
3351
|
-
let e =
|
|
3705
|
+
let rn = k(() => {
|
|
3706
|
+
T.value;
|
|
3707
|
+
let e = Y()?.package.document;
|
|
3352
3708
|
return e ? e.finalSectionProperties ?? e.sections?.[0]?.properties ?? null : null;
|
|
3353
|
-
}),
|
|
3354
|
-
|
|
3709
|
+
}), an = k(() => {
|
|
3710
|
+
T.value;
|
|
3355
3711
|
let e = {};
|
|
3356
3712
|
o.fontFamilies !== void 0 && (e.fontFamilies = o.fontFamilies);
|
|
3357
|
-
let t =
|
|
3713
|
+
let t = Y()?.package.styles?.styles;
|
|
3358
3714
|
return t !== void 0 && (e.documentStyles = t), e;
|
|
3359
|
-
}),
|
|
3715
|
+
}), on = k(() => Je(rn.value?.pageWidth ?? 12240) * R.value), sn = k(() => {
|
|
3360
3716
|
let e = /* @__PURE__ */ new Set();
|
|
3361
|
-
for (let t of
|
|
3717
|
+
for (let t of tn.value) t.done && e.add(t.id);
|
|
3362
3718
|
return e;
|
|
3363
|
-
}),
|
|
3364
|
-
transform:
|
|
3719
|
+
}), cn = k(() => ({
|
|
3720
|
+
transform: R.value === 1 ? void 0 : `scale(${R.value})`,
|
|
3365
3721
|
transformOrigin: "top center",
|
|
3366
3722
|
transition: "transform 0.2s ease"
|
|
3367
|
-
})), { handleApplyStyle:
|
|
3723
|
+
})), { handleApplyStyle: ln, handleInsertSymbol: un, handleInsertSectionBreakNextPage: dn, handleInsertSectionBreakContinuous: fn } = wa({
|
|
3368
3724
|
editorView: X,
|
|
3369
|
-
getDocument:
|
|
3725
|
+
getDocument: Y
|
|
3370
3726
|
});
|
|
3371
|
-
function
|
|
3727
|
+
function pn() {
|
|
3372
3728
|
if (o.onInsertImage) {
|
|
3373
3729
|
o.onInsertImage();
|
|
3374
3730
|
return;
|
|
@@ -3378,45 +3734,45 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3378
3734
|
let t = document.createElement("input");
|
|
3379
3735
|
t.type = "file", t.accept = "image/*", t.style.display = "none", t.addEventListener("change", () => {
|
|
3380
3736
|
let n = t.files?.[0];
|
|
3381
|
-
n &&
|
|
3737
|
+
n && Ie(e, n, () => e.focus()), t.remove();
|
|
3382
3738
|
}), document.body.appendChild(t), t.click();
|
|
3383
3739
|
}
|
|
3384
|
-
function
|
|
3740
|
+
function mn(e, t) {
|
|
3385
3741
|
if (o.onInsertTable) {
|
|
3386
3742
|
o.onInsertTable(e, t);
|
|
3387
3743
|
return;
|
|
3388
3744
|
}
|
|
3389
3745
|
let n = X.value;
|
|
3390
|
-
n && (
|
|
3746
|
+
n && (Be(n, e, t), n.focus());
|
|
3391
3747
|
}
|
|
3392
|
-
function
|
|
3748
|
+
function hn() {
|
|
3393
3749
|
if (o.onInsertPageBreak) {
|
|
3394
3750
|
o.onInsertPageBreak();
|
|
3395
3751
|
return;
|
|
3396
3752
|
}
|
|
3397
|
-
let e =
|
|
3398
|
-
e && (
|
|
3753
|
+
let e = J.value;
|
|
3754
|
+
e && (Re(e), e.focus());
|
|
3399
3755
|
}
|
|
3400
|
-
function
|
|
3756
|
+
function gn() {
|
|
3401
3757
|
if (o.onInsertTOC) {
|
|
3402
3758
|
o.onInsertTOC();
|
|
3403
3759
|
return;
|
|
3404
3760
|
}
|
|
3405
|
-
let e =
|
|
3406
|
-
e && (
|
|
3761
|
+
let e = J.value;
|
|
3762
|
+
e && (Ve(e), e.focus());
|
|
3407
3763
|
}
|
|
3408
|
-
let { handlePageSetupApply:
|
|
3409
|
-
editorView:
|
|
3410
|
-
getDocument:
|
|
3764
|
+
let { handlePageSetupApply: _n, handleLeftMarginChange: vn, handleRightMarginChange: yn, handleTopMarginChange: bn, handleBottomMarginChange: xn, handleIndentLeftChange: Sn, handleIndentRightChange: Cn, handleFirstLineIndentChange: wn, handleTabStopRemove: Tn } = ka({
|
|
3765
|
+
editorView: J,
|
|
3766
|
+
getDocument: Y,
|
|
3411
3767
|
readOnly: u,
|
|
3412
|
-
stateTick:
|
|
3413
|
-
reLayout:
|
|
3768
|
+
stateTick: T,
|
|
3769
|
+
reLayout: ft,
|
|
3414
3770
|
onChange: (e) => {
|
|
3415
3771
|
o.onChange?.(e), s("change", e), s("update:document", e);
|
|
3416
3772
|
}
|
|
3417
|
-
}),
|
|
3418
|
-
|
|
3419
|
-
let e = X.value, t = e ?
|
|
3773
|
+
}), En = k(() => {
|
|
3774
|
+
T.value;
|
|
3775
|
+
let e = X.value, t = e ? Ue(e.state).paragraphFormatting : {};
|
|
3420
3776
|
return {
|
|
3421
3777
|
indentLeft: t.indentLeft ?? 0,
|
|
3422
3778
|
indentRight: t.indentRight ?? 0,
|
|
@@ -3425,108 +3781,108 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3425
3781
|
tabs: t.tabs ?? null
|
|
3426
3782
|
};
|
|
3427
3783
|
});
|
|
3428
|
-
function
|
|
3784
|
+
function Dn(e) {
|
|
3429
3785
|
l.value !== e && (l.value = e, o.onModeChange?.(e), s("mode-change", e));
|
|
3430
3786
|
}
|
|
3431
|
-
function
|
|
3787
|
+
function On(e) {
|
|
3432
3788
|
switch (e) {
|
|
3433
3789
|
case "find":
|
|
3434
3790
|
case "findReplace":
|
|
3435
|
-
|
|
3791
|
+
fe.value = !0;
|
|
3436
3792
|
break;
|
|
3437
3793
|
case "insertSymbol":
|
|
3438
|
-
|
|
3794
|
+
he.value = !0;
|
|
3439
3795
|
break;
|
|
3440
3796
|
case "insertHyperlink":
|
|
3441
|
-
|
|
3797
|
+
pe.value = !0;
|
|
3442
3798
|
break;
|
|
3443
3799
|
case "pageSetup":
|
|
3444
|
-
|
|
3800
|
+
D.value = !0;
|
|
3445
3801
|
break;
|
|
3446
3802
|
case "toggleOutline":
|
|
3447
|
-
|
|
3803
|
+
Wt.handleToggleOutline();
|
|
3448
3804
|
break;
|
|
3449
3805
|
case "toggleSidebar":
|
|
3450
|
-
|
|
3806
|
+
A.value = !A.value;
|
|
3451
3807
|
break;
|
|
3452
3808
|
case "insertImage":
|
|
3453
|
-
|
|
3809
|
+
pn();
|
|
3454
3810
|
break;
|
|
3455
3811
|
case "insertPageBreak":
|
|
3456
|
-
|
|
3812
|
+
hn();
|
|
3457
3813
|
break;
|
|
3458
3814
|
case "insertSectionBreakNextPage":
|
|
3459
|
-
|
|
3815
|
+
dn();
|
|
3460
3816
|
break;
|
|
3461
3817
|
case "insertSectionBreakContinuous":
|
|
3462
|
-
|
|
3818
|
+
fn();
|
|
3463
3819
|
break;
|
|
3464
3820
|
case "insertTOC":
|
|
3465
|
-
|
|
3821
|
+
gn();
|
|
3466
3822
|
break;
|
|
3467
3823
|
default: break;
|
|
3468
3824
|
}
|
|
3469
3825
|
s("menu-action", e);
|
|
3470
3826
|
}
|
|
3471
|
-
function
|
|
3472
|
-
|
|
3827
|
+
function kn(e, t) {
|
|
3828
|
+
mn(e, t);
|
|
3473
3829
|
}
|
|
3474
|
-
let
|
|
3475
|
-
|
|
3830
|
+
let An = H(!1);
|
|
3831
|
+
xa({
|
|
3476
3832
|
documentBuffer: () => o.documentBuffer ?? null,
|
|
3477
3833
|
document: () => o.document ?? null,
|
|
3478
|
-
loadDocumentBuffer:
|
|
3479
|
-
loadDocument:
|
|
3480
|
-
sidebarAutoOpenedRef:
|
|
3481
|
-
}),
|
|
3834
|
+
loadDocumentBuffer: it,
|
|
3835
|
+
loadDocument: at,
|
|
3836
|
+
sidebarAutoOpenedRef: An
|
|
3837
|
+
}), K(() => o.mode, (e) => {
|
|
3482
3838
|
e && e !== l.value && (l.value = e);
|
|
3483
|
-
}),
|
|
3484
|
-
|
|
3839
|
+
}), K(() => o.showOutline, (e) => {
|
|
3840
|
+
ge.value = !!e, Wt.recomputeHeadingsIfOpen();
|
|
3485
3841
|
});
|
|
3486
|
-
let
|
|
3487
|
-
function
|
|
3842
|
+
let jn = H(!1);
|
|
3843
|
+
function Mn(e) {
|
|
3488
3844
|
let t = e.currentTarget;
|
|
3489
3845
|
t instanceof HTMLElement && o.onScrollTopChange?.(t.scrollTop);
|
|
3490
3846
|
}
|
|
3491
|
-
function
|
|
3492
|
-
if (o.initialScrollTop === void 0 ||
|
|
3493
|
-
|
|
3847
|
+
function Nn() {
|
|
3848
|
+
if (o.initialScrollTop === void 0 || jn.value) return;
|
|
3849
|
+
jn.value = !0;
|
|
3494
3850
|
let e = o.initialScrollTop;
|
|
3495
3851
|
requestAnimationFrame(() => {
|
|
3496
|
-
|
|
3852
|
+
ue.value && (ue.value.scrollTop = e);
|
|
3497
3853
|
});
|
|
3498
3854
|
}
|
|
3499
|
-
|
|
3855
|
+
K(Ze, (e) => {
|
|
3500
3856
|
if (!e) {
|
|
3501
|
-
|
|
3857
|
+
jn.value = !1;
|
|
3502
3858
|
return;
|
|
3503
3859
|
}
|
|
3504
|
-
|
|
3505
|
-
let t =
|
|
3506
|
-
t && o.onCompatibilityChange?.(
|
|
3507
|
-
}),
|
|
3508
|
-
let e =
|
|
3509
|
-
|
|
3510
|
-
}), t =
|
|
3511
|
-
|
|
3512
|
-
}), n =
|
|
3513
|
-
|
|
3514
|
-
}), r =
|
|
3515
|
-
|
|
3860
|
+
ie.value = !0, Wt.recomputeHeadingsIfOpen(), Q.seedFromDocument();
|
|
3861
|
+
let t = Y();
|
|
3862
|
+
t && o.onCompatibilityChange?.(We(t)), o.autoOpenReviewSidebar !== !1 && !An.value && (tn.value.length > 0 || en.value.length > 0) && (An.value = !0, A.value = !0), Nn(), s("ready");
|
|
3863
|
+
}), Ce(() => {
|
|
3864
|
+
let e = ze.on("selectionChange", () => {
|
|
3865
|
+
T.value++, $.updateFloatingButton();
|
|
3866
|
+
}), t = ze.on("docChange", () => {
|
|
3867
|
+
T.value++, Wt.recomputeHeadingsIfOpen();
|
|
3868
|
+
}), n = ze.on("layoutComplete", () => {
|
|
3869
|
+
T.value++;
|
|
3870
|
+
}), r = kt.install(), i = qe(() => o.onFontsLoaded?.());
|
|
3871
|
+
Se(() => {
|
|
3516
3872
|
e(), t(), n(), r(), i();
|
|
3517
3873
|
});
|
|
3518
3874
|
});
|
|
3519
|
-
let { exposed:
|
|
3520
|
-
editor:
|
|
3521
|
-
editorView:
|
|
3522
|
-
isDirty:
|
|
3875
|
+
let { exposed: Pn } = Ca({
|
|
3876
|
+
editor: ze,
|
|
3877
|
+
editorView: J,
|
|
3878
|
+
isDirty: Qe,
|
|
3523
3879
|
commentsDirty: Q.commentsDirty,
|
|
3524
3880
|
clearCommentsDirty: Q.clearCommentsDirty,
|
|
3525
|
-
layout:
|
|
3526
|
-
pagesRef:
|
|
3527
|
-
pagesViewportRef:
|
|
3528
|
-
zoom:
|
|
3529
|
-
scrollVisiblePositionIntoView:
|
|
3881
|
+
layout: et,
|
|
3882
|
+
pagesRef: w,
|
|
3883
|
+
pagesViewportRef: le,
|
|
3884
|
+
zoom: R,
|
|
3885
|
+
scrollVisiblePositionIntoView: Pt,
|
|
3530
3886
|
author: () => o.author,
|
|
3531
3887
|
createAIEditComment: (e) => {
|
|
3532
3888
|
let t = Q.createComment(e);
|
|
@@ -3534,74 +3890,75 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3534
3890
|
},
|
|
3535
3891
|
getComments: () => Q.comments.value,
|
|
3536
3892
|
setComments: Q.setComments,
|
|
3537
|
-
focus:
|
|
3538
|
-
getDocument:
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3893
|
+
focus: dt,
|
|
3894
|
+
getDocument: Y,
|
|
3895
|
+
getHeaderFooterView: ct,
|
|
3896
|
+
setZoom: Oe,
|
|
3897
|
+
save: ot,
|
|
3898
|
+
loadDocument: at,
|
|
3899
|
+
loadDocumentBuffer: it,
|
|
3543
3900
|
onPrint: o.onPrint,
|
|
3544
3901
|
onSave: o.onSave
|
|
3545
3902
|
});
|
|
3546
|
-
return n(
|
|
3547
|
-
class:
|
|
3903
|
+
return n(Pn), (e, n) => (V(), N("div", {
|
|
3904
|
+
class: z([
|
|
3548
3905
|
"docx-editor-vue ep-root paged-editor",
|
|
3549
3906
|
t.className,
|
|
3550
|
-
|
|
3907
|
+
y.value,
|
|
3551
3908
|
{ "paged-editor--readonly": u.value }
|
|
3552
3909
|
]),
|
|
3553
|
-
style:
|
|
3910
|
+
style: B(t.style)
|
|
3554
3911
|
}, [
|
|
3555
|
-
|
|
3912
|
+
P("div", Za, [I(Kr, {
|
|
3556
3913
|
"show-table-insert": o.showTableInsert !== !1,
|
|
3557
3914
|
onRename: n[0] ||= (e) => s("rename", e),
|
|
3558
|
-
onMenuAction:
|
|
3559
|
-
onInsertTable:
|
|
3915
|
+
onMenuAction: On,
|
|
3916
|
+
onInsertTable: kn
|
|
3560
3917
|
}, {
|
|
3561
|
-
"title-bar-left":
|
|
3562
|
-
"title-bar-right":
|
|
3918
|
+
"title-bar-left": ke(() => [Ee(e.$slots, "title-bar-left", {}, void 0, !0)]),
|
|
3919
|
+
"title-bar-right": ke(() => [Ee(e.$slots, "title-bar-right", {}, void 0, !0)]),
|
|
3563
3920
|
_: 3
|
|
3564
|
-
}, 8, ["show-table-insert"]), t.showToolbar ? (
|
|
3921
|
+
}, 8, ["show-table-insert"]), t.showToolbar ? (V(), j(ne, xe({
|
|
3565
3922
|
key: 0,
|
|
3566
|
-
view:
|
|
3567
|
-
"get-commands":
|
|
3568
|
-
"state-tick":
|
|
3569
|
-
"zoom-percent":
|
|
3570
|
-
"is-min-zoom":
|
|
3571
|
-
"is-max-zoom":
|
|
3572
|
-
"zoom-presets":
|
|
3923
|
+
view: X.value,
|
|
3924
|
+
"get-commands": G(ut),
|
|
3925
|
+
"state-tick": T.value,
|
|
3926
|
+
"zoom-percent": G(we),
|
|
3927
|
+
"is-min-zoom": G(Te),
|
|
3928
|
+
"is-max-zoom": G(U),
|
|
3929
|
+
"zoom-presets": G(Fe),
|
|
3573
3930
|
"show-zoom-control": t.showZoomControl,
|
|
3574
3931
|
"editor-mode": l.value,
|
|
3575
3932
|
"show-review-controls": d.value,
|
|
3576
3933
|
"track-changes-on": f.value,
|
|
3577
3934
|
"display-mode": p.value,
|
|
3578
3935
|
"read-only": u.value,
|
|
3579
|
-
"comments-sidebar-open":
|
|
3580
|
-
"image-context":
|
|
3936
|
+
"comments-sidebar-open": A.value,
|
|
3937
|
+
"image-context": G(yt),
|
|
3581
3938
|
theme: t.theme ?? null
|
|
3582
|
-
},
|
|
3583
|
-
onFindReplace: n[1] ||= (e) =>
|
|
3584
|
-
onInsertLink: n[2] ||= (e) =>
|
|
3585
|
-
onInsertSymbol: n[3] ||= (e) =>
|
|
3586
|
-
onInsertPageBreak:
|
|
3587
|
-
onPageSetup: n[4] ||= (e) =>
|
|
3588
|
-
onToggleOutline:
|
|
3589
|
-
onApplyStyle:
|
|
3590
|
-
onZoomIn:
|
|
3591
|
-
onZoomOut:
|
|
3592
|
-
onZoomSet:
|
|
3593
|
-
onToggleSidebar: n[5] ||= (e) =>
|
|
3594
|
-
onModeChange:
|
|
3939
|
+
}, an.value, {
|
|
3940
|
+
onFindReplace: n[1] ||= (e) => fe.value = !0,
|
|
3941
|
+
onInsertLink: n[2] ||= (e) => pe.value = !0,
|
|
3942
|
+
onInsertSymbol: n[3] ||= (e) => he.value = !0,
|
|
3943
|
+
onInsertPageBreak: hn,
|
|
3944
|
+
onPageSetup: n[4] ||= (e) => D.value = !0,
|
|
3945
|
+
onToggleOutline: G(Wt).handleToggleOutline,
|
|
3946
|
+
onApplyStyle: G(ln),
|
|
3947
|
+
onZoomIn: G(Ae),
|
|
3948
|
+
onZoomOut: G(je),
|
|
3949
|
+
onZoomSet: G(Oe),
|
|
3950
|
+
onToggleSidebar: n[5] ||= (e) => A.value = !A.value,
|
|
3951
|
+
onModeChange: Dn,
|
|
3595
3952
|
onToggleTrackChanges: h,
|
|
3596
|
-
"onUpdate:displayMode":
|
|
3597
|
-
onImageProperties: n[6] ||= (e) =>
|
|
3598
|
-
onImageWrapType:
|
|
3599
|
-
onImageTransform:
|
|
3600
|
-
}),
|
|
3601
|
-
"table-context":
|
|
3602
|
-
view:
|
|
3603
|
-
"get-commands":
|
|
3604
|
-
"state-tick":
|
|
3953
|
+
"onUpdate:displayMode": ee,
|
|
3954
|
+
onImageProperties: n[6] ||= (e) => E.value = !0,
|
|
3955
|
+
onImageWrapType: G(bt),
|
|
3956
|
+
onImageTransform: G(xt)
|
|
3957
|
+
}), _e({
|
|
3958
|
+
"table-context": ke(() => [I(_, {
|
|
3959
|
+
view: X.value,
|
|
3960
|
+
"get-commands": G(ut),
|
|
3961
|
+
"state-tick": T.value,
|
|
3605
3962
|
theme: t.theme ?? null
|
|
3606
3963
|
}, null, 8, [
|
|
3607
3964
|
"view",
|
|
@@ -3612,10 +3969,10 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3612
3969
|
_: 2
|
|
3613
3970
|
}, [e.$slots["toolbar-extra"] || t.toolbarExtra ? {
|
|
3614
3971
|
name: "toolbar-extra",
|
|
3615
|
-
fn:
|
|
3972
|
+
fn: ke(() => [Ee(e.$slots, "toolbar-extra", {}, () => [t.toolbarExtra ? (V(), j(x, {
|
|
3616
3973
|
key: 0,
|
|
3617
3974
|
node: t.toolbarExtra
|
|
3618
|
-
}, null, 8, ["node"])) :
|
|
3975
|
+
}, null, 8, ["node"])) : M("", !0)], !0)]),
|
|
3619
3976
|
key: "0"
|
|
3620
3977
|
} : void 0]), 1040, [
|
|
3621
3978
|
"view",
|
|
@@ -3641,26 +3998,27 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3641
3998
|
"onZoomSet",
|
|
3642
3999
|
"onImageWrapType",
|
|
3643
4000
|
"onImageTransform"
|
|
3644
|
-
])) :
|
|
3645
|
-
|
|
3646
|
-
"show-find-replace":
|
|
3647
|
-
"onUpdate:showFindReplace": n[7] ||= (e) =>
|
|
3648
|
-
"show-hyperlink":
|
|
3649
|
-
"onUpdate:showHyperlink": n[8] ||= (e) =>
|
|
3650
|
-
"show-insert-symbol":
|
|
3651
|
-
"onUpdate:showInsertSymbol": n[9] ||= (e) =>
|
|
3652
|
-
"show-image-properties":
|
|
3653
|
-
"onUpdate:showImageProperties": n[10] ||= (e) =>
|
|
3654
|
-
"show-page-setup":
|
|
3655
|
-
"onUpdate:showPageSetup": n[11] ||= (e) =>
|
|
3656
|
-
view:
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
"
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
4001
|
+
])) : M("", !0)]),
|
|
4002
|
+
I(Vr, {
|
|
4003
|
+
"show-find-replace": fe.value,
|
|
4004
|
+
"onUpdate:showFindReplace": n[7] ||= (e) => fe.value = e,
|
|
4005
|
+
"show-hyperlink": pe.value,
|
|
4006
|
+
"onUpdate:showHyperlink": n[8] ||= (e) => pe.value = e,
|
|
4007
|
+
"show-insert-symbol": he.value,
|
|
4008
|
+
"onUpdate:showInsertSymbol": n[9] ||= (e) => he.value = e,
|
|
4009
|
+
"show-image-properties": E.value,
|
|
4010
|
+
"onUpdate:showImageProperties": n[10] ||= (e) => E.value = e,
|
|
4011
|
+
"show-page-setup": D.value,
|
|
4012
|
+
"onUpdate:showPageSetup": n[11] ||= (e) => D.value = e,
|
|
4013
|
+
view: X.value,
|
|
4014
|
+
"scroll-visible-position-into-view": G(Pt),
|
|
4015
|
+
bookmarks: ye.value,
|
|
4016
|
+
"selected-image-pm-pos": G(_t)?.pmPos ?? null,
|
|
4017
|
+
"section-properties": rn.value,
|
|
4018
|
+
onInsertSymbol: G(un),
|
|
4019
|
+
onHyperlinkSubmit: G(wt),
|
|
4020
|
+
onHyperlinkRemove: G(Tt),
|
|
4021
|
+
onPageSetupApply: G(_n)
|
|
3664
4022
|
}, null, 8, [
|
|
3665
4023
|
"show-find-replace",
|
|
3666
4024
|
"show-hyperlink",
|
|
@@ -3668,6 +4026,7 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3668
4026
|
"show-image-properties",
|
|
3669
4027
|
"show-page-setup",
|
|
3670
4028
|
"view",
|
|
4029
|
+
"scroll-visible-position-into-view",
|
|
3671
4030
|
"bookmarks",
|
|
3672
4031
|
"selected-image-pm-pos",
|
|
3673
4032
|
"section-properties",
|
|
@@ -3676,41 +4035,46 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3676
4035
|
"onHyperlinkRemove",
|
|
3677
4036
|
"onPageSetupApply"
|
|
3678
4037
|
]),
|
|
3679
|
-
|
|
4038
|
+
G($e) ? (V(), N("div", Qa, W(G($e)), 1)) : ht.value ? (V(), N("div", $a, [Ee(e.$slots, "loading-indicator", {}, () => [t.loadingIndicator ? (V(), j(x, {
|
|
3680
4039
|
key: 0,
|
|
3681
4040
|
node: t.loadingIndicator
|
|
3682
|
-
}, null, 8, ["node"])) : (
|
|
4041
|
+
}, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [F(W(G(b)("loadingDocument")), 1)], 64))], !0)])) : !G(Ze) && !re.value ? (V(), N("div", eo, [Ee(e.$slots, "placeholder", {}, () => [t.placeholder ? (V(), j(x, {
|
|
3683
4042
|
key: 0,
|
|
3684
4043
|
node: t.placeholder
|
|
3685
|
-
}, null, 8, ["node"])) : (
|
|
3686
|
-
|
|
4044
|
+
}, null, 8, ["node"])) : (V(), N(O, { key: 1 }, [F("No document loaded")], 64))], !0)])) : M("", !0),
|
|
4045
|
+
P("div", {
|
|
3687
4046
|
ref_key: "hiddenPmRef",
|
|
3688
|
-
ref:
|
|
4047
|
+
ref: C,
|
|
3689
4048
|
class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
|
|
3690
4049
|
}, null, 512),
|
|
3691
|
-
|
|
3692
|
-
ref_key: "
|
|
4050
|
+
P("div", {
|
|
4051
|
+
ref_key: "hiddenHfPmRef",
|
|
3693
4052
|
ref: ce,
|
|
4053
|
+
class: "docx-editor-vue__hidden-pm paged-editor__hidden-hf-pm"
|
|
4054
|
+
}, null, 512),
|
|
4055
|
+
P("div", {
|
|
4056
|
+
ref_key: "editorScrollRef",
|
|
4057
|
+
ref: ue,
|
|
3694
4058
|
class: "docx-editor-vue__editor-scroll",
|
|
3695
|
-
onScroll:
|
|
3696
|
-
}, [
|
|
3697
|
-
|
|
3698
|
-
"section-props":
|
|
3699
|
-
zoom:
|
|
4059
|
+
onScroll: Mn
|
|
4060
|
+
}, [P("div", to, [
|
|
4061
|
+
de.value && !u.value ? (V(), N("div", no, [I(te, {
|
|
4062
|
+
"section-props": rn.value,
|
|
4063
|
+
zoom: G(R),
|
|
3700
4064
|
unit: t.rulerUnit ?? "inch",
|
|
3701
4065
|
editable: !u.value,
|
|
3702
|
-
"indent-left":
|
|
3703
|
-
"indent-right":
|
|
3704
|
-
"first-line-indent":
|
|
3705
|
-
"hanging-indent":
|
|
4066
|
+
"indent-left": En.value.indentLeft,
|
|
4067
|
+
"indent-right": En.value.indentRight,
|
|
4068
|
+
"first-line-indent": En.value.firstLineIndent,
|
|
4069
|
+
"hanging-indent": En.value.hangingIndent,
|
|
3706
4070
|
"show-first-line-indent": !0,
|
|
3707
|
-
"tab-stops":
|
|
3708
|
-
onLeftMarginChange:
|
|
3709
|
-
onRightMarginChange:
|
|
3710
|
-
onIndentLeftChange:
|
|
3711
|
-
onIndentRightChange:
|
|
3712
|
-
onFirstLineIndentChange:
|
|
3713
|
-
onTabStopRemove:
|
|
4071
|
+
"tab-stops": En.value.tabs,
|
|
4072
|
+
onLeftMarginChange: G(vn),
|
|
4073
|
+
onRightMarginChange: G(yn),
|
|
4074
|
+
onIndentLeftChange: G(Sn),
|
|
4075
|
+
onIndentRightChange: G(Cn),
|
|
4076
|
+
onFirstLineIndentChange: G(wn),
|
|
4077
|
+
onTabStopRemove: G(Tn)
|
|
3714
4078
|
}, null, 8, [
|
|
3715
4079
|
"section-props",
|
|
3716
4080
|
"zoom",
|
|
@@ -3727,14 +4091,14 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3727
4091
|
"onIndentRightChange",
|
|
3728
4092
|
"onFirstLineIndentChange",
|
|
3729
4093
|
"onTabStopRemove"
|
|
3730
|
-
])])) :
|
|
3731
|
-
|
|
3732
|
-
"section-props":
|
|
3733
|
-
zoom:
|
|
4094
|
+
])])) : M("", !0),
|
|
4095
|
+
de.value && !u.value ? (V(), N("div", ro, [I(g, {
|
|
4096
|
+
"section-props": rn.value,
|
|
4097
|
+
zoom: G(R),
|
|
3734
4098
|
unit: t.rulerUnit ?? "inch",
|
|
3735
4099
|
editable: !u.value,
|
|
3736
|
-
onTopMarginChange:
|
|
3737
|
-
onBottomMarginChange:
|
|
4100
|
+
onTopMarginChange: G(bn),
|
|
4101
|
+
onBottomMarginChange: G(xn)
|
|
3738
4102
|
}, null, 8, [
|
|
3739
4103
|
"section-props",
|
|
3740
4104
|
"zoom",
|
|
@@ -3742,84 +4106,124 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3742
4106
|
"editable",
|
|
3743
4107
|
"onTopMarginChange",
|
|
3744
4108
|
"onBottomMarginChange"
|
|
3745
|
-
])])) :
|
|
3746
|
-
|
|
4109
|
+
])])) : M("", !0),
|
|
4110
|
+
P("div", {
|
|
3747
4111
|
ref_key: "pagesViewportRef",
|
|
3748
|
-
ref:
|
|
4112
|
+
ref: le,
|
|
3749
4113
|
class: "docx-editor-vue__pages-viewport",
|
|
3750
|
-
onWheel:
|
|
3751
|
-
onMousedown: n[20] ||= (...e) =>
|
|
3752
|
-
onMousemove: n[21] ||= (...e) =>
|
|
3753
|
-
onClick: n[22] ||= (...e) =>
|
|
3754
|
-
|
|
4114
|
+
onWheel: Le,
|
|
4115
|
+
onMousedown: n[20] ||= (...e) => G(Ft) && G(Ft)(...e),
|
|
4116
|
+
onMousemove: n[21] ||= (...e) => G(It) && G(It)(...e),
|
|
4117
|
+
onClick: n[22] ||= (...e) => G(Lt) && G(Lt)(...e),
|
|
4118
|
+
onDblclick: n[23] ||= (...e) => G(Rt) && G(Rt)(...e),
|
|
4119
|
+
onContextmenu: n[24] ||= q((...e) => G(Yt) && G(Yt)(...e), ["prevent"])
|
|
3755
4120
|
}, [
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
4121
|
+
P("div", io, [
|
|
4122
|
+
P("div", {
|
|
4123
|
+
ref_key: "pagesRef",
|
|
4124
|
+
ref: w,
|
|
4125
|
+
class: z(["docx-editor-vue__pages paged-editor__pages", G(Z) ? `paged-editor--hf-editing paged-editor--editing-${G(Z).position}` : ""]),
|
|
4126
|
+
style: B(cn.value)
|
|
4127
|
+
}, null, 6),
|
|
4128
|
+
I(ji, {
|
|
4129
|
+
"pages-container": w.value,
|
|
4130
|
+
selection: Ut.value,
|
|
4131
|
+
zoom: G(R)
|
|
4132
|
+
}, null, 8, [
|
|
4133
|
+
"pages-container",
|
|
4134
|
+
"selection",
|
|
4135
|
+
"zoom"
|
|
4136
|
+
]),
|
|
4137
|
+
P("div", ao, [
|
|
4138
|
+
I(Fr, {
|
|
4139
|
+
"get-view": () => G(J),
|
|
4140
|
+
"get-pages-container": () => w.value,
|
|
4141
|
+
"editor-state": G(He),
|
|
4142
|
+
zoom: G(R),
|
|
4143
|
+
layout: G(et),
|
|
4144
|
+
blocks: G(tt),
|
|
4145
|
+
measures: G(nt),
|
|
4146
|
+
"on-term-click": o.onAnonymizationTermClick,
|
|
4147
|
+
"selected-canonical": o.selectedAnonymizationCanonical,
|
|
4148
|
+
"selection-seq": o.anonymizationSelectionSeq
|
|
4149
|
+
}, null, 8, [
|
|
4150
|
+
"get-view",
|
|
4151
|
+
"get-pages-container",
|
|
4152
|
+
"editor-state",
|
|
4153
|
+
"zoom",
|
|
4154
|
+
"layout",
|
|
4155
|
+
"blocks",
|
|
4156
|
+
"measures",
|
|
4157
|
+
"on-term-click",
|
|
4158
|
+
"selected-canonical",
|
|
4159
|
+
"selection-seq"
|
|
4160
|
+
]),
|
|
4161
|
+
o.showTemplateDirectives ? (V(), j(Wi, {
|
|
4162
|
+
key: 0,
|
|
4163
|
+
"get-view": () => G(J),
|
|
4164
|
+
"get-pages-container": () => w.value,
|
|
4165
|
+
"editor-state": G(He),
|
|
4166
|
+
zoom: G(R),
|
|
4167
|
+
layout: G(et),
|
|
4168
|
+
blocks: G(tt),
|
|
4169
|
+
measures: G(nt)
|
|
4170
|
+
}, null, 8, [
|
|
4171
|
+
"get-view",
|
|
4172
|
+
"get-pages-container",
|
|
4173
|
+
"editor-state",
|
|
4174
|
+
"zoom",
|
|
4175
|
+
"layout",
|
|
4176
|
+
"blocks",
|
|
4177
|
+
"measures"
|
|
4178
|
+
])) : M("", !0),
|
|
4179
|
+
I(Ir, {
|
|
4180
|
+
"get-view": () => G(J),
|
|
4181
|
+
"get-pages-container": () => w.value,
|
|
4182
|
+
zoom: G(R),
|
|
4183
|
+
"transaction-version": T.value,
|
|
4184
|
+
"sync-coordinator": G(rt)
|
|
4185
|
+
}, null, 8, [
|
|
4186
|
+
"get-view",
|
|
4187
|
+
"get-pages-container",
|
|
4188
|
+
"zoom",
|
|
4189
|
+
"transaction-version",
|
|
4190
|
+
"sync-coordinator"
|
|
4191
|
+
])
|
|
4192
|
+
])
|
|
4193
|
+
]),
|
|
4194
|
+
G(Z) ? (V(), j(Ni, {
|
|
3784
4195
|
key: 0,
|
|
3785
|
-
|
|
3786
|
-
"get-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
layout: q(Je),
|
|
3790
|
-
blocks: q(Ye),
|
|
3791
|
-
measures: q(Xe)
|
|
4196
|
+
edit: G(Z),
|
|
4197
|
+
"get-view": Ht,
|
|
4198
|
+
onClose: G(Bt),
|
|
4199
|
+
onRemove: G(Vt)
|
|
3792
4200
|
}, null, 8, [
|
|
3793
|
-
"
|
|
3794
|
-
"
|
|
3795
|
-
"
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
"
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
onDeselect: n[12] ||= (e) => at.value = null,
|
|
3806
|
-
onInteractStart: n[13] ||= (e) => ot.value = !0,
|
|
3807
|
-
onInteractEnd: n[14] ||= (e) => ot.value = !1,
|
|
3808
|
-
onContextMenu: q(Pt)
|
|
4201
|
+
"edit",
|
|
4202
|
+
"onClose",
|
|
4203
|
+
"onRemove"
|
|
4204
|
+
])) : M("", !0),
|
|
4205
|
+
I(Ai, {
|
|
4206
|
+
"image-info": G(_t),
|
|
4207
|
+
zoom: G(R),
|
|
4208
|
+
view: X.value,
|
|
4209
|
+
onDeselect: n[12] ||= (e) => _t.value = null,
|
|
4210
|
+
onInteractStart: n[13] ||= (e) => vt.value = !0,
|
|
4211
|
+
onInteractEnd: n[14] ||= (e) => vt.value = !1,
|
|
4212
|
+
onContextMenu: G(Xt)
|
|
3809
4213
|
}, null, 8, [
|
|
3810
4214
|
"image-info",
|
|
3811
4215
|
"zoom",
|
|
3812
4216
|
"view",
|
|
3813
4217
|
"onContextMenu"
|
|
3814
4218
|
]),
|
|
3815
|
-
|
|
3816
|
-
data:
|
|
4219
|
+
I(ea, {
|
|
4220
|
+
data: G(Ct),
|
|
3817
4221
|
"read-only": u.value,
|
|
3818
|
-
onNavigate:
|
|
3819
|
-
onCopy:
|
|
3820
|
-
onEdit:
|
|
3821
|
-
onRemove:
|
|
3822
|
-
onClose: n[15] ||= (e) =>
|
|
4222
|
+
onNavigate: G(Et),
|
|
4223
|
+
onCopy: nn,
|
|
4224
|
+
onEdit: G(Dt),
|
|
4225
|
+
onRemove: G(Ot),
|
|
4226
|
+
onClose: n[15] ||= (e) => Ct.value = null
|
|
3823
4227
|
}, null, 8, [
|
|
3824
4228
|
"data",
|
|
3825
4229
|
"read-only",
|
|
@@ -3827,24 +4231,24 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3827
4231
|
"onEdit",
|
|
3828
4232
|
"onRemove"
|
|
3829
4233
|
]),
|
|
3830
|
-
|
|
3831
|
-
key:
|
|
4234
|
+
G(At) ? (V(), N("button", {
|
|
4235
|
+
key: 1,
|
|
3832
4236
|
type: "button",
|
|
3833
4237
|
class: "docx-editor-vue__table-insert-btn",
|
|
3834
|
-
style:
|
|
3835
|
-
left:
|
|
3836
|
-
top:
|
|
4238
|
+
style: B({
|
|
4239
|
+
left: G(At).x + "px",
|
|
4240
|
+
top: G(At).y + "px"
|
|
3837
4241
|
}),
|
|
3838
|
-
"aria-label":
|
|
3839
|
-
onMousedown: n[16] ||= (...e) =>
|
|
3840
|
-
}, " + ", 44,
|
|
3841
|
-
|
|
3842
|
-
comments:
|
|
3843
|
-
"pages-container":
|
|
3844
|
-
zoom:
|
|
3845
|
-
"page-width-px":
|
|
3846
|
-
"sidebar-open":
|
|
3847
|
-
"resolved-comment-ids":
|
|
4242
|
+
"aria-label": G(At).type === "row" ? "Insert row" : "Insert column",
|
|
4243
|
+
onMousedown: n[16] ||= (...e) => G(zt) && G(zt)(...e)
|
|
4244
|
+
}, " + ", 44, oo)) : M("", !0),
|
|
4245
|
+
I(m, {
|
|
4246
|
+
comments: G(tn),
|
|
4247
|
+
"pages-container": w.value,
|
|
4248
|
+
zoom: G(R),
|
|
4249
|
+
"page-width-px": on.value,
|
|
4250
|
+
"sidebar-open": A.value,
|
|
4251
|
+
"resolved-comment-ids": sn.value,
|
|
3848
4252
|
onMarkerClick: () => {}
|
|
3849
4253
|
}, null, 8, [
|
|
3850
4254
|
"comments",
|
|
@@ -3854,30 +4258,30 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3854
4258
|
"sidebar-open",
|
|
3855
4259
|
"resolved-comment-ids"
|
|
3856
4260
|
]),
|
|
3857
|
-
|
|
3858
|
-
"is-open":
|
|
3859
|
-
comments:
|
|
3860
|
-
"tracked-changes":
|
|
4261
|
+
I(v, {
|
|
4262
|
+
"is-open": A.value,
|
|
4263
|
+
comments: G(tn),
|
|
4264
|
+
"tracked-changes": en.value,
|
|
3861
4265
|
"show-resolved": !0,
|
|
3862
|
-
"is-adding-comment":
|
|
3863
|
-
"add-comment-y-position":
|
|
3864
|
-
"pages-container":
|
|
3865
|
-
"page-width-px":
|
|
3866
|
-
zoom:
|
|
3867
|
-
"active-item-id":
|
|
3868
|
-
onClose: n[17] ||= (e) =>
|
|
3869
|
-
"onUpdate:activeItemId": n[18] ||= (e) =>
|
|
3870
|
-
onAddComment:
|
|
3871
|
-
onCancelAddComment:
|
|
3872
|
-
onCommentReply:
|
|
3873
|
-
onCommentResolve:
|
|
3874
|
-
onCommentUnresolve:
|
|
3875
|
-
onCommentDelete:
|
|
3876
|
-
onAcceptChange:
|
|
3877
|
-
onRejectChange:
|
|
3878
|
-
onAcceptChangeById:
|
|
3879
|
-
onRejectChangeById:
|
|
3880
|
-
onTrackedChangeReply:
|
|
4266
|
+
"is-adding-comment": G($).isAddingComment.value,
|
|
4267
|
+
"add-comment-y-position": G($).addCommentYPosition.value,
|
|
4268
|
+
"pages-container": w.value,
|
|
4269
|
+
"page-width-px": on.value,
|
|
4270
|
+
zoom: G(R),
|
|
4271
|
+
"active-item-id": ve.value,
|
|
4272
|
+
onClose: n[17] ||= (e) => A.value = !1,
|
|
4273
|
+
"onUpdate:activeItemId": n[18] ||= (e) => ve.value = e,
|
|
4274
|
+
onAddComment: G($).handleAddComment,
|
|
4275
|
+
onCancelAddComment: G($).handleCancelAddComment,
|
|
4276
|
+
onCommentReply: G(Q).handleReply,
|
|
4277
|
+
onCommentResolve: G(Q).handleResolve,
|
|
4278
|
+
onCommentUnresolve: G(Q).handleUnresolve,
|
|
4279
|
+
onCommentDelete: G(Q).handleDelete,
|
|
4280
|
+
onAcceptChange: G(Q).handleAcceptChange,
|
|
4281
|
+
onRejectChange: G(Q).handleRejectChange,
|
|
4282
|
+
onAcceptChangeById: G(Q).handleAcceptChangeById,
|
|
4283
|
+
onRejectChangeById: G(Q).handleRejectChangeById,
|
|
4284
|
+
onTrackedChangeReply: G(Q).handleTrackedChangeReply
|
|
3881
4285
|
}, null, 8, [
|
|
3882
4286
|
"is-open",
|
|
3883
4287
|
"comments",
|
|
@@ -3900,43 +4304,43 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3900
4304
|
"onRejectChangeById",
|
|
3901
4305
|
"onTrackedChangeReply"
|
|
3902
4306
|
]),
|
|
3903
|
-
|
|
3904
|
-
key:
|
|
4307
|
+
G($).floatingCommentButton.value && !u.value ? (V(), N("button", {
|
|
4308
|
+
key: 2,
|
|
3905
4309
|
type: "button",
|
|
3906
4310
|
class: "docx-editor-vue__add-comment-btn",
|
|
3907
|
-
style:
|
|
3908
|
-
top:
|
|
3909
|
-
left:
|
|
4311
|
+
style: B({
|
|
4312
|
+
top: G($).floatingCommentButton.value.top + "px",
|
|
4313
|
+
left: G($).floatingCommentButton.value.left + "px"
|
|
3910
4314
|
}),
|
|
3911
4315
|
"aria-label": "Add comment",
|
|
3912
4316
|
title: "Add comment",
|
|
3913
|
-
onMousedown: n[19] ||=
|
|
3914
|
-
}, [
|
|
4317
|
+
onMousedown: n[19] ||= q((...e) => G($).startAddComment && G($).startAddComment(...e), ["prevent", "stop"])
|
|
4318
|
+
}, [I(r, {
|
|
3915
4319
|
name: "add_comment",
|
|
3916
4320
|
size: 18
|
|
3917
|
-
})], 36)) :
|
|
4321
|
+
})], 36)) : M("", !0)
|
|
3918
4322
|
], 544),
|
|
3919
|
-
|
|
4323
|
+
ge.value ? M("", !0) : (V(), j(Fi, {
|
|
3920
4324
|
key: 2,
|
|
3921
4325
|
"left-offset": 12,
|
|
3922
|
-
onToggle:
|
|
4326
|
+
onToggle: G(Wt).handleToggleOutline
|
|
3923
4327
|
}, null, 8, ["onToggle"])),
|
|
3924
|
-
|
|
4328
|
+
G(jt).totalPages > 1 ? (V(), j(Ii, {
|
|
3925
4329
|
key: 3,
|
|
3926
|
-
"current-page":
|
|
3927
|
-
"total-pages":
|
|
3928
|
-
visible:
|
|
4330
|
+
"current-page": G(jt).currentPage,
|
|
4331
|
+
"total-pages": G(jt).totalPages,
|
|
4332
|
+
visible: G(jt).visible
|
|
3929
4333
|
}, null, 8, [
|
|
3930
4334
|
"current-page",
|
|
3931
4335
|
"total-pages",
|
|
3932
4336
|
"visible"
|
|
3933
|
-
])) :
|
|
3934
|
-
|
|
3935
|
-
"is-open":
|
|
3936
|
-
headings:
|
|
3937
|
-
"get-scroll-container": () =>
|
|
3938
|
-
onClose: n[
|
|
3939
|
-
onNavigate:
|
|
4337
|
+
])) : M("", !0),
|
|
4338
|
+
I(Br, {
|
|
4339
|
+
"is-open": ge.value,
|
|
4340
|
+
headings: be.value,
|
|
4341
|
+
"get-scroll-container": () => w.value,
|
|
4342
|
+
onClose: n[25] ||= (e) => ge.value = !1,
|
|
4343
|
+
onNavigate: G(Wt).handleOutlineNavigate
|
|
3940
4344
|
}, null, 8, [
|
|
3941
4345
|
"is-open",
|
|
3942
4346
|
"headings",
|
|
@@ -3944,18 +4348,18 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3944
4348
|
"onNavigate"
|
|
3945
4349
|
])
|
|
3946
4350
|
])], 544),
|
|
3947
|
-
|
|
4351
|
+
I(bi, {
|
|
3948
4352
|
"read-only": u.value,
|
|
3949
|
-
"context-menu":
|
|
3950
|
-
"image-context-menu":
|
|
3951
|
-
"image-context-menu-text-actions":
|
|
3952
|
-
"custom-text-menu-items":
|
|
3953
|
-
"can-open-image-properties":
|
|
3954
|
-
onContextMenuAction:
|
|
3955
|
-
onCloseContextMenu: n[
|
|
3956
|
-
onImageWrapSelect:
|
|
3957
|
-
onCloseImageContextMenu: n[
|
|
3958
|
-
onOpenImageProperties: n[
|
|
4353
|
+
"context-menu": G(Gt),
|
|
4354
|
+
"image-context-menu": G(Kt),
|
|
4355
|
+
"image-context-menu-text-actions": G(qt),
|
|
4356
|
+
"custom-text-menu-items": G(Jt),
|
|
4357
|
+
"can-open-image-properties": G(_t) !== null,
|
|
4358
|
+
onContextMenuAction: G(Qt),
|
|
4359
|
+
onCloseContextMenu: n[26] ||= (e) => G(Gt).isOpen = !1,
|
|
4360
|
+
onImageWrapSelect: G(Zt),
|
|
4361
|
+
onCloseImageContextMenu: n[27] ||= (e) => Kt.value = null,
|
|
4362
|
+
onOpenImageProperties: n[28] ||= (e) => E.value = !0
|
|
3959
4363
|
}, null, 8, [
|
|
3960
4364
|
"read-only",
|
|
3961
4365
|
"context-menu",
|
|
@@ -3968,10 +4372,10 @@ var Aa = { class: "docx-editor-vue__toolbar-shell" }, ja = {
|
|
|
3968
4372
|
])
|
|
3969
4373
|
], 6));
|
|
3970
4374
|
}
|
|
3971
|
-
}), [["__scopeId", "data-v-
|
|
4375
|
+
}), [["__scopeId", "data-v-76d03259"]]);
|
|
3972
4376
|
//#endregion
|
|
3973
4377
|
//#region src/utils/listState.ts
|
|
3974
|
-
function
|
|
4378
|
+
function co() {
|
|
3975
4379
|
return {
|
|
3976
4380
|
type: "none",
|
|
3977
4381
|
level: 0,
|
|
@@ -3980,30 +4384,30 @@ function Va() {
|
|
|
3980
4384
|
}
|
|
3981
4385
|
//#endregion
|
|
3982
4386
|
//#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
|
|
3983
|
-
var
|
|
4387
|
+
var lo = ["aria-label"], uo = ["aria-label"], fo = [
|
|
3984
4388
|
"disabled",
|
|
3985
4389
|
"title",
|
|
3986
4390
|
"aria-label"
|
|
3987
|
-
],
|
|
4391
|
+
], po = [
|
|
3988
4392
|
"disabled",
|
|
3989
4393
|
"title",
|
|
3990
4394
|
"aria-label"
|
|
3991
|
-
],
|
|
4395
|
+
], mo = ["aria-label"], ho = [
|
|
3992
4396
|
"disabled",
|
|
3993
4397
|
"title",
|
|
3994
4398
|
"aria-label",
|
|
3995
4399
|
"aria-pressed"
|
|
3996
|
-
],
|
|
4400
|
+
], go = [
|
|
3997
4401
|
"disabled",
|
|
3998
4402
|
"title",
|
|
3999
4403
|
"aria-label",
|
|
4000
4404
|
"aria-pressed"
|
|
4001
|
-
],
|
|
4405
|
+
], _o = [
|
|
4002
4406
|
"disabled",
|
|
4003
4407
|
"title",
|
|
4004
4408
|
"aria-label",
|
|
4005
4409
|
"aria-pressed"
|
|
4006
|
-
],
|
|
4410
|
+
], vo = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
4007
4411
|
__name: "FormattingBar",
|
|
4008
4412
|
props: {
|
|
4009
4413
|
currentFormatting: {},
|
|
@@ -4045,10 +4449,10 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4045
4449
|
"redo"
|
|
4046
4450
|
],
|
|
4047
4451
|
setup(e, { emit: t }) {
|
|
4048
|
-
let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s =
|
|
4452
|
+
let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s = k(() => i.currentFormatting ?? {}), l = k(() => i.documentStyles ? { styles: i.documentStyles } : {}), u = k(() => s.value.listState ?? co()), d = k(() => {
|
|
4049
4453
|
let e = s.value.color;
|
|
4050
4454
|
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
4051
|
-
}), f =
|
|
4455
|
+
}), f = k(() => {
|
|
4052
4456
|
let e = u.value;
|
|
4053
4457
|
return e.isInList && e.level > 0 || (s.value.indentLeft ?? 0) > 0;
|
|
4054
4458
|
});
|
|
@@ -4058,97 +4462,97 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4058
4462
|
value: e
|
|
4059
4463
|
});
|
|
4060
4464
|
}
|
|
4061
|
-
return (t, i) => (
|
|
4062
|
-
class:
|
|
4465
|
+
return (t, i) => (V(), N("div", {
|
|
4466
|
+
class: z(["docx-formatting-bar", e.className]),
|
|
4063
4467
|
role: "toolbar",
|
|
4064
|
-
"aria-label":
|
|
4468
|
+
"aria-label": G(o)("formattingToolbar"),
|
|
4065
4469
|
"data-folio-toolbar": "true"
|
|
4066
4470
|
}, [
|
|
4067
|
-
|
|
4471
|
+
P("span", {
|
|
4068
4472
|
class: "docx-formatting-bar__group",
|
|
4069
4473
|
role: "group",
|
|
4070
|
-
"aria-label":
|
|
4071
|
-
}, [
|
|
4474
|
+
"aria-label": G(o)("historyGroup")
|
|
4475
|
+
}, [P("button", {
|
|
4072
4476
|
type: "button",
|
|
4073
4477
|
class: "docx-formatting-bar__btn",
|
|
4074
4478
|
disabled: e.disabled || !e.canUndo,
|
|
4075
|
-
title:
|
|
4076
|
-
"aria-label":
|
|
4077
|
-
onMousedown: i[0] ||=
|
|
4078
|
-
}, [
|
|
4479
|
+
title: G(o)("undoShortcut"),
|
|
4480
|
+
"aria-label": G(o)("undo"),
|
|
4481
|
+
onMousedown: i[0] ||= q((e) => a("undo"), ["prevent"])
|
|
4482
|
+
}, [I(r, {
|
|
4079
4483
|
name: "undo",
|
|
4080
4484
|
size: 18
|
|
4081
|
-
})], 40,
|
|
4485
|
+
})], 40, fo), P("button", {
|
|
4082
4486
|
type: "button",
|
|
4083
4487
|
class: "docx-formatting-bar__btn",
|
|
4084
4488
|
disabled: e.disabled || !e.canRedo,
|
|
4085
|
-
title:
|
|
4086
|
-
"aria-label":
|
|
4087
|
-
onMousedown: i[1] ||=
|
|
4088
|
-
}, [
|
|
4489
|
+
title: G(o)("redoShortcut"),
|
|
4490
|
+
"aria-label": G(o)("redo"),
|
|
4491
|
+
onMousedown: i[1] ||= q((e) => a("redo"), ["prevent"])
|
|
4492
|
+
}, [I(r, {
|
|
4089
4493
|
name: "redo",
|
|
4090
4494
|
size: 18
|
|
4091
|
-
})], 40,
|
|
4092
|
-
i[13] ||=
|
|
4495
|
+
})], 40, po)], 8, uo),
|
|
4496
|
+
i[13] ||= P("span", {
|
|
4093
4497
|
class: "docx-formatting-bar__divider",
|
|
4094
4498
|
role: "separator"
|
|
4095
4499
|
}, null, -1),
|
|
4096
|
-
e.showStylePicker ? (
|
|
4500
|
+
e.showStylePicker ? (V(), N(O, { key: 0 }, [I(y, xe({ value: s.value.styleId ?? "Normal" }, l.value, {
|
|
4097
4501
|
disabled: e.disabled,
|
|
4098
4502
|
onChange: i[2] ||= (e) => a("format", {
|
|
4099
4503
|
type: "applyStyle",
|
|
4100
4504
|
value: e
|
|
4101
4505
|
})
|
|
4102
|
-
}), null, 16, ["value", "disabled"]), i[11] ||=
|
|
4506
|
+
}), null, 16, ["value", "disabled"]), i[11] ||= P("span", {
|
|
4103
4507
|
class: "docx-formatting-bar__divider",
|
|
4104
4508
|
role: "separator"
|
|
4105
|
-
}, null, -1)], 64)) :
|
|
4106
|
-
|
|
4509
|
+
}, null, -1)], 64)) : M("", !0),
|
|
4510
|
+
P("span", {
|
|
4107
4511
|
class: "docx-formatting-bar__group",
|
|
4108
4512
|
role: "group",
|
|
4109
|
-
"aria-label":
|
|
4513
|
+
"aria-label": G(o)("textFormattingGroup")
|
|
4110
4514
|
}, [
|
|
4111
|
-
|
|
4515
|
+
P("button", {
|
|
4112
4516
|
type: "button",
|
|
4113
|
-
class:
|
|
4517
|
+
class: z(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.bold }]),
|
|
4114
4518
|
disabled: e.disabled,
|
|
4115
|
-
title:
|
|
4116
|
-
"aria-label":
|
|
4519
|
+
title: G(o)("boldShortcut"),
|
|
4520
|
+
"aria-label": G(o)("bold"),
|
|
4117
4521
|
"aria-pressed": !!s.value.bold,
|
|
4118
|
-
onMousedown: i[3] ||=
|
|
4119
|
-
}, [
|
|
4522
|
+
onMousedown: i[3] ||= q((e) => a("format", "bold"), ["prevent"])
|
|
4523
|
+
}, [I(r, {
|
|
4120
4524
|
name: "format_bold",
|
|
4121
4525
|
size: 18
|
|
4122
|
-
})], 42,
|
|
4123
|
-
|
|
4526
|
+
})], 42, ho),
|
|
4527
|
+
P("button", {
|
|
4124
4528
|
type: "button",
|
|
4125
|
-
class:
|
|
4529
|
+
class: z(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.italic }]),
|
|
4126
4530
|
disabled: e.disabled,
|
|
4127
|
-
title:
|
|
4128
|
-
"aria-label":
|
|
4531
|
+
title: G(o)("italicShortcut"),
|
|
4532
|
+
"aria-label": G(o)("italic"),
|
|
4129
4533
|
"aria-pressed": !!s.value.italic,
|
|
4130
|
-
onMousedown: i[4] ||=
|
|
4131
|
-
}, [
|
|
4534
|
+
onMousedown: i[4] ||= q((e) => a("format", "italic"), ["prevent"])
|
|
4535
|
+
}, [I(r, {
|
|
4132
4536
|
name: "format_italic",
|
|
4133
4537
|
size: 18
|
|
4134
|
-
})], 42,
|
|
4135
|
-
|
|
4538
|
+
})], 42, go),
|
|
4539
|
+
P("button", {
|
|
4136
4540
|
type: "button",
|
|
4137
|
-
class:
|
|
4541
|
+
class: z(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.underline }]),
|
|
4138
4542
|
disabled: e.disabled,
|
|
4139
|
-
title:
|
|
4140
|
-
"aria-label":
|
|
4543
|
+
title: G(o)("underlineShortcut"),
|
|
4544
|
+
"aria-label": G(o)("underline"),
|
|
4141
4545
|
"aria-pressed": !!s.value.underline,
|
|
4142
|
-
onMousedown: i[5] ||=
|
|
4143
|
-
}, [
|
|
4546
|
+
onMousedown: i[5] ||= q((e) => a("format", "underline"), ["prevent"])
|
|
4547
|
+
}, [I(r, {
|
|
4144
4548
|
name: "format_underlined",
|
|
4145
4549
|
size: 18
|
|
4146
|
-
})], 42,
|
|
4147
|
-
], 8,
|
|
4148
|
-
e.showTextColorPicker ? (
|
|
4550
|
+
})], 42, _o)
|
|
4551
|
+
], 8, mo),
|
|
4552
|
+
e.showTextColorPicker ? (V(), N(O, { key: 1 }, [i[12] ||= P("span", {
|
|
4149
4553
|
class: "docx-formatting-bar__divider",
|
|
4150
4554
|
role: "separator"
|
|
4151
|
-
}, null, -1),
|
|
4555
|
+
}, null, -1), I(G(n), {
|
|
4152
4556
|
mode: "text",
|
|
4153
4557
|
value: d.value,
|
|
4154
4558
|
theme: e.theme ?? null,
|
|
@@ -4158,12 +4562,12 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4158
4562
|
"value",
|
|
4159
4563
|
"theme",
|
|
4160
4564
|
"disabled"
|
|
4161
|
-
])], 64)) :
|
|
4162
|
-
i[14] ||=
|
|
4565
|
+
])], 64)) : M("", !0),
|
|
4566
|
+
i[14] ||= P("span", {
|
|
4163
4567
|
class: "docx-formatting-bar__divider",
|
|
4164
4568
|
role: "separator"
|
|
4165
4569
|
}, null, -1),
|
|
4166
|
-
e.showAlignmentButtons ? (
|
|
4570
|
+
e.showAlignmentButtons ? (V(), j(ee, {
|
|
4167
4571
|
key: 2,
|
|
4168
4572
|
value: s.value.alignment ?? "left",
|
|
4169
4573
|
disabled: e.disabled,
|
|
@@ -4171,8 +4575,8 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4171
4575
|
type: "alignment",
|
|
4172
4576
|
value: e
|
|
4173
4577
|
})
|
|
4174
|
-
}, null, 8, ["value", "disabled"])) :
|
|
4175
|
-
e.showListButtons ? (
|
|
4578
|
+
}, null, 8, ["value", "disabled"])) : M("", !0),
|
|
4579
|
+
e.showListButtons ? (V(), j(b, {
|
|
4176
4580
|
key: 3,
|
|
4177
4581
|
"list-state": u.value,
|
|
4178
4582
|
disabled: e.disabled,
|
|
@@ -4185,10 +4589,10 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4185
4589
|
"list-state",
|
|
4186
4590
|
"disabled",
|
|
4187
4591
|
"can-outdent"
|
|
4188
|
-
])) :
|
|
4189
|
-
], 10,
|
|
4592
|
+
])) : M("", !0)
|
|
4593
|
+
], 10, lo));
|
|
4190
4594
|
}
|
|
4191
|
-
}), [["__scopeId", "data-v-fc03de2e"]]),
|
|
4595
|
+
}), [["__scopeId", "data-v-fc03de2e"]]), yo = [
|
|
4192
4596
|
{
|
|
4193
4597
|
value: .5,
|
|
4194
4598
|
label: "50%"
|
|
@@ -4213,7 +4617,7 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4213
4617
|
value: 2,
|
|
4214
4618
|
label: "200%"
|
|
4215
4619
|
}
|
|
4216
|
-
],
|
|
4620
|
+
], bo = /*#__PURE__*/ t(/* @__PURE__ */ L({
|
|
4217
4621
|
__name: "ZoomControl",
|
|
4218
4622
|
props: {
|
|
4219
4623
|
value: { default: 1 },
|
|
@@ -4230,7 +4634,7 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4230
4634
|
},
|
|
4231
4635
|
emits: ["change"],
|
|
4232
4636
|
setup(e, { emit: t }) {
|
|
4233
|
-
let { Select: n } = p(), r = e, i = t, a =
|
|
4637
|
+
let { Select: n } = p(), r = e, i = t, a = k(() => r.levels ?? yo), o = k(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = k(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = k(() => o.value ? String(o.value.value) : String(r.value)), l = k(() => {
|
|
4234
4638
|
let e = a.value.map((e) => ({
|
|
4235
4639
|
value: String(e.value),
|
|
4236
4640
|
label: e.label
|
|
@@ -4244,8 +4648,8 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4244
4648
|
let t = Number.parseFloat(e);
|
|
4245
4649
|
Number.isNaN(t) || i("change", t);
|
|
4246
4650
|
}
|
|
4247
|
-
return (t, r) => (
|
|
4248
|
-
class:
|
|
4651
|
+
return (t, r) => (V(), j(G(n), {
|
|
4652
|
+
class: z(["docx-zoom-control", [{ "docx-zoom-control--compact": e.compact }, e.className]]),
|
|
4249
4653
|
value: c.value,
|
|
4250
4654
|
items: l.value,
|
|
4251
4655
|
disabled: e.disabled,
|
|
@@ -4258,10 +4662,10 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4258
4662
|
"disabled"
|
|
4259
4663
|
]));
|
|
4260
4664
|
}
|
|
4261
|
-
}), [["__scopeId", "data-v-8079e07f"]]),
|
|
4665
|
+
}), [["__scopeId", "data-v-8079e07f"]]), xo = (e, t, n = {}) => {
|
|
4262
4666
|
let { locale: r = "en", ...i } = n;
|
|
4263
4667
|
return new Promise((n, a) => {
|
|
4264
|
-
let o =
|
|
4668
|
+
let o = H(null), s = null, c = !1, u = {
|
|
4265
4669
|
save: async () => {
|
|
4266
4670
|
let e = await (o.value?.save() ?? Promise.resolve(null));
|
|
4267
4671
|
return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
|
|
@@ -4283,8 +4687,8 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4283
4687
|
c || (c = !0, a(/* @__PURE__ */ Error("Editor was destroyed before mounting completed."))), s?.unmount(), s = null;
|
|
4284
4688
|
}
|
|
4285
4689
|
};
|
|
4286
|
-
s =
|
|
4287
|
-
return () =>
|
|
4690
|
+
s = A({ setup() {
|
|
4691
|
+
return () => ye(so, {
|
|
4288
4692
|
...i,
|
|
4289
4693
|
documentBuffer: e,
|
|
4290
4694
|
ref: o,
|
|
@@ -4299,4 +4703,4 @@ var Ha = ["aria-label"], Ua = ["aria-label"], Wa = [
|
|
|
4299
4703
|
});
|
|
4300
4704
|
};
|
|
4301
4705
|
//#endregion
|
|
4302
|
-
export {
|
|
4706
|
+
export { sr as DEFAULT_AI_SUGGESTION_PRESETS, br as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, er as DOCUMENT_PRESET_VERSION, tr as DOCUMENT_STYLE_SET_VERSION, so as DocxEditor, C as FindReplaceDialog, s as FolioUIProvider, ce as FootnotePropertiesDialog, vo as FormattingBar, w as HyperlinkDialog, le as ImagePositionDialog, ue as ImagePropertiesDialog, de as InsertImageDialog, T as InsertSymbolDialog, fe as InsertTableDialog, pe as PageSetupDialog, me as PasteSpecialDialog, Zn as STELLA_STYLE_SET_NAME, he as SplitCellDialog, E as TablePropertiesDialog, D as WatermarkDialog, bo as ZoomControl, xr as acceptAutocompleteSuggestion, Sr as acceptAutocompleteWord, $e as anonymizationDecorationsKey, Cr as appendAutocompleteToken, Q as applyFolioAIEditOperations, cr as applySuggestions, wr as autocompleteSuggestionKey, Tr as autocompleteSuggestionPlugin, dr as buildPositionalText, Er as clearAutocompleteSuggestion, Wt as clearTemplateSlashMenu, Gt as consumeTemplateSlashQuery, _r as createAICitationDecorationsPlugin, nr as createDocx, Kn as createEmptyDocument, rn as createFolioAIEditSnapshot, Qn as createStellaStyleDocumentPreset, $n as createStellaStyleSet, n as defaultLocale, rr as deriveBlockId, on as diffWordSegments, qn as extractDocumentStyleSet, Jn as extractDocumentStyleSetFromDocx, Dr as finishAutocompleteSuggestion, jr as fromMarkdown, et as getAnonymizationMatches, Or as getAutocompleteSuggestion, Wn as getDocumentWatermark, hr as getFolioCaretViewportRect, ir as getFolioParaIdFromBlockId, gr as getFolioSelectionViewportRect, Tt as getTemplateDirectives, Kt as getTemplateSlashMenu, un as hashFolioAIBlockText, l as i18nPlugin, Fe as insertImageFromFile, Le as insertPageBreakInView, ze as insertTableInView, J as insertTableOfContentsInView, Yn as inspectDocumentStyles, Xn as inspectDocumentStylesFromDocx, ar as isFolioBlockId, or as isSequentialFolioBlockId, lr as isSuggestionStale, dn as normalizeFolioAIBlockText, e as provideLocale, xo as renderAsync, qt as resetTemplateSlashQuery, ur as resolveSuggestionAnchor, Dt as scanDirectives, mr as scrollFolioPositionIntoView, vr as setAICitationsMeta, fr as setAISuggestionsMeta, yr as setActiveCitationMeta, nt as setAnonymizationTermsMeta, Gn as setDocumentWatermark, pr as setFocusedSuggestionMeta, Ut as setTemplatePreviewValues, kr as shouldTriggerAutocomplete, Ar as startAutocompleteSuggestion, Jt as templateSlashMenuKey, Mr as toMarkdown, Nr as toMarkdownResult, c as useTranslation, se as useWheelZoom };
|