@stll/folio-vue 0.2.0 → 0.4.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-BaILr4AO.js +3612 -0
- package/dist/ListButtons-CC7_7-e3.cjs +4 -0
- package/dist/WatermarkDialog-D-uTab0-.js +7022 -0
- package/dist/WatermarkDialog-SzyoSZmL.cjs +15 -0
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +9 -4
- package/dist/components/DocxEditor/types.d.ts +25 -1
- package/dist/components/dialogs/index.d.ts +13 -9
- package/dist/components/tableStylePresets.d.ts +2 -6
- package/dist/composables/useDocxEditor.d.ts +2 -0
- package/dist/composables/useOutlineSidebar.d.ts +1 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +5 -3
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1371 -1218
- package/dist/ui/folio-ui.d.ts +120 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +14 -2
- package/dist/ui.js +97 -98
- package/dist/useZoom-8M2AQIMJ.cjs +1 -0
- package/dist/{useZoom-CIIRid8U.js → useZoom-BR--m9w3.js} +140 -140
- package/dist/utils/pageText.d.ts +14 -0
- package/package.json +1 -1
- package/dist/ListButtons-B498PX1d.js +0 -4256
- package/dist/ListButtons-D-zMJ7rl.cjs +0 -4
- package/dist/PageSetupDialog-CGBaBVzo.cjs +0 -15
- package/dist/PageSetupDialog-DsjAfJy0.js +0 -4873
- package/dist/TablePropertiesDialog-A-1Pm1f9.cjs +0 -1
- package/dist/TablePropertiesDialog-PyXEJC_o.js +0 -887
- package/dist/useZoom-BryUw3Cu.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,68 +1,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { a as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
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 {
|
|
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-D-uTab0-.js";
|
|
2
|
+
import { D as m, O as h, T as g, a as _, b as v, f as y, i as b, n as x, p as ee, r as S, t as te, y as ne } from "./ListButtons-BaILr4AO.js";
|
|
3
|
+
import { t as re } from "./zIndex-BY0qa8Au.js";
|
|
4
|
+
import { a as ie, i as C, o as ae, r as oe, t as w } from "./useZoom-BR--m9w3.js";
|
|
5
|
+
import { FindReplaceDialog as T, FootnotePropertiesDialog as se, HyperlinkDialog as ce, ImagePositionDialog as le, ImagePropertiesDialog as E, InsertImageDialog as D, InsertSymbolDialog as ue, InsertTableDialog as de, PageSetupDialog as fe, PasteSpecialDialog as O, SplitCellDialog as k, TablePropertiesDialog as A, WatermarkDialog as j } from "./dialogs.js";
|
|
6
|
+
import { Fragment as M, Teleport as pe, computed as N, createApp as me, createBlock as P, createCommentVNode as F, createElementBlock as I, createElementVNode as L, createSlots as he, createStaticVNode as ge, createTextVNode as R, createVNode as z, defineComponent as B, h as _e, inject as ve, mergeProps as ye, nextTick as be, normalizeClass as V, normalizeStyle as H, onBeforeUnmount as xe, onMounted as Se, openBlock as U, provide as Ce, ref as W, renderList as G, renderSlot as we, shallowRef as Te, toDisplayString as K, unref as q, vModelText as Ee, watch as J, withCtx as De, withDirectives as Oe, withKeys as ke, withModifiers as Y } from "vue";
|
|
7
|
+
import { createStyleResolver as Ae, extractSelectionState as je, getSelectedText as Me, insertImageFromFile as Ne, insertImageFromFile as Pe, insertPageBreakInView as X, insertPageBreakInView as Fe, insertTableInView as Ie, insertTableInView as Le, insertTableOfContentsInView as Re, insertTableOfContentsInView as ze } from "@stll/folio-core/prosemirror";
|
|
8
|
+
import { extractSelectionContext as Be } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
|
|
9
|
+
import { inspectDocxCompatibility as Ve } from "@stll/folio-core/docx/compatibility";
|
|
10
|
+
import { clearAllCaches as He, resetCanvasContext as Ue } from "@stll/folio-core/layout-bridge/engine/measuring";
|
|
11
|
+
import { onFontsLoaded as We } from "@stll/folio-core/utils/fontLoader";
|
|
12
|
+
import { twipsToPixels as Ge } from "@stll/folio-core/paged-layout/sectionGeometry";
|
|
13
|
+
import { measureDirectiveGutter as Ke, projectRangesToRects as qe } from "@stll/folio-core/paged-layout/rangeProjection";
|
|
14
|
+
import { prefersReducedMotionBehavior as Je } from "@stll/folio-core/paged-layout/scrollNavigation";
|
|
15
|
+
import { anonymizationDecorationsKey as Ye, getAnonymizationMatches as Xe, getAnonymizationMatches as Ze, setAnonymizationTermsMeta as Qe, slugAnonymizationLabel as $e } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
16
|
+
import { NodeSelection as Z, Selection as et, TextSelection as tt } from "prosemirror-state";
|
|
17
|
+
import { pixelsToEmu as nt } from "@stll/folio-core/utils/units";
|
|
18
|
+
import { IMAGE_LAYOUT_OPTIONS as rt, captureInlinePositionEmu as it, deriveLayoutChoice as at, findImageElement as ot, isImageLayoutOptionEnabled as st, toolbarValueToLayoutTarget as ct } from "@stll/folio-core/layout-painter/imageLayout";
|
|
19
|
+
import { isTrackChangesMode as lt, toggledTrackChangesMode as ut } from "@stll/folio-core/managers/EditorModeManager";
|
|
20
|
+
import { clickToPositionDom as dt } from "@stll/folio-core/layout-bridge/dom/clickToPositionDom";
|
|
21
|
+
import { calculateResizedImageDimensions as ft, commitImageFloatMove as pt, commitImageInlineMove as mt, commitImageResize as ht, isFloatingImage as gt } from "@stll/folio-core/prosemirror/imageCommit";
|
|
22
|
+
import { findBodyPmAnchor as _t, findBodyPmSpans as vt } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
|
|
23
|
+
import { getTemplateDirectives as yt, getTemplateDirectives as bt, scanDirectives as xt } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
24
|
+
import { clearFormatting as St } from "@stll/folio-core/prosemirror/commands/formatting";
|
|
25
|
+
import { getTableContext as Ct } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
|
|
26
|
+
import { PENDING_COMMENT_ID as wt, createCommentIdAllocator as Tt, seedCommentAllocator as Et } from "@stll/folio-core/prosemirror/commentIdAllocator";
|
|
27
|
+
import { createComment as Dt } from "@stll/folio-core/prosemirror/commentOps";
|
|
28
|
+
import { findChangeRange as Ot } from "@stll/folio-core/prosemirror/queries";
|
|
29
|
+
import { acceptAIEditRevision as kt, acceptChange as At, findAIEditRevisionRange as jt, rejectAIEditRevision as Mt, rejectChange as Nt } from "@stll/folio-core/prosemirror/commands/comments";
|
|
30
|
+
import { makeRevisionInfo as Pt } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
31
|
+
import { setTemplatePreviewValues as Ft } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
32
|
+
import { clearTemplateSlashMenu as It, consumeTemplateSlashQuery as Lt, getTemplateSlashMenu as Rt, resetTemplateSlashQuery as Q, templateSlashMenuKey as zt } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
33
|
+
import { applyFolioAIEditOperations as $, applyFolioAIEditOperations as Bt, createFolioAIEditSnapshot as Vt, createFolioAIEditSnapshot as Ht, diffWordSegments as Ut, getCommentAnchorsFromDoc as Wt, getTrackedChangesFromDoc as Gt, hashFolioAIBlockText as Kt, normalizeFolioAIBlockText as qt } from "@stll/folio-core/ai-edits";
|
|
34
|
+
import { findPageIndexContainingPmPos as Jt } from "@stll/folio-core/layout-engine";
|
|
35
|
+
import { findParagraphFragmentsByParaId as Yt, flashParagraphElements as Xt } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
36
|
+
import { blockSdtAttrsToSdtProperties as Zt, findBlockSdtMatch as Qt, findBlockSdtMatches as $t, removeContentControlTr as en, setContentControlContentTr as tn, setContentControlValueTr as nn } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
37
|
+
import { setContentControlContentBlocksTr as rn } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
38
|
+
import { createFolioAIEditSnapshot as an } from "@stll/folio-core/ai-edits/snapshot";
|
|
39
|
+
import { findParagraphByParaId as on } from "@stll/folio-core/prosemirror/utils/findParagraphByParaId";
|
|
40
|
+
import { deriveBlockId as sn, getFolioParaIdFromBlockId as cn, getFolioParaIdFromBlockId as ln, getSequentialFolioBlockIdIndex as un, isFolioBlockId as dn, isSequentialFolioBlockId as fn } from "@stll/folio-core/types/block-id";
|
|
41
|
+
import { applyStyle as pn, removeTabStop as mn, setIndentFirstLine as hn, setIndentLeft as gn, setIndentRight as _n } from "@stll/folio-core/prosemirror/commands/paragraph";
|
|
42
|
+
import { getCachedNumberingMap as vn } from "@stll/folio-core/docx";
|
|
43
|
+
import { insertPageBreak as yn } from "@stll/folio-core/prosemirror/commands/pageBreak";
|
|
44
|
+
import { insertSectionBreakContinuous as bn, insertSectionBreakNextPage as xn } from "@stll/folio-core/prosemirror/commands/sectionBreak";
|
|
45
|
+
import { editHyperlinkAtCursor as Sn, removeHyperlinkAtCursor as Cn } from "@stll/folio-core/prosemirror/commands/hyperlink";
|
|
46
|
+
import { collectHeadings as wn } from "@stll/folio-core/utils/headingCollector";
|
|
47
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as Tn, detectTableInsertHover as En } from "@stll/folio-core/layout-bridge/tableInsertHover";
|
|
48
|
+
import { createCellDragTracker as Dn, findCellPosFromPmPos as On } from "@stll/folio-core/prosemirror/cellDragSelection";
|
|
49
|
+
import { getDocumentWatermark as kn, setDocumentWatermark as An } from "@stll/folio-core/watermark";
|
|
50
|
+
import { createEmptyDocument as jn } from "@stll/folio-core/utils/createDocument";
|
|
51
|
+
import { createDocx as Mn } from "@stll/folio-core/docx/rezip";
|
|
52
|
+
import { DEFAULT_AI_SUGGESTION_PRESETS as Nn } from "@stll/folio-core/ai-suggestions/types";
|
|
53
|
+
import { applySuggestions as Pn } from "@stll/folio-core/ai-suggestions/apply";
|
|
54
|
+
import { isSuggestionStale as Fn, resolveSuggestionAnchor as In } from "@stll/folio-core/ai-suggestions/conflict";
|
|
55
|
+
import { buildPositionalText as Ln } from "@stll/folio-core/ai-suggestions/text-positions";
|
|
56
|
+
import { setAISuggestionsMeta as Rn, setFocusedSuggestionMeta as zn } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
57
|
+
import { scrollFolioPositionIntoView as Bn } from "@stll/folio-core/paged-layout/scrollToPmPosition";
|
|
58
|
+
import { getFolioCaretViewportRect as Vn, getFolioSelectionViewportRect as Hn } from "@stll/folio-core/paged-layout/selectionViewportRect";
|
|
59
|
+
import { createAICitationDecorationsPlugin as Un, setAICitationsMeta as Wn, setActiveCitationMeta as Gn } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
60
|
+
import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as Kn, acceptAutocompleteSuggestion as qn, acceptAutocompleteWord as Jn, appendAutocompleteToken as Yn, autocompleteSuggestionKey as Xn, autocompleteSuggestionPlugin as Zn, clearAutocompleteSuggestion as Qn, finishAutocompleteSuggestion as $n, getAutocompleteSuggestion as er, shouldTriggerAutocomplete as tr, startAutocompleteSuggestion as nr } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
61
|
+
import { fromMarkdown as rr, toMarkdown as ir, toMarkdownResult as ar } from "@stll/folio-core/markdown";
|
|
59
62
|
//#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
60
|
-
var
|
|
63
|
+
var or = [
|
|
61
64
|
"data-folio-anonymization-label",
|
|
62
65
|
"data-folio-anonymization-canonical",
|
|
63
66
|
"data-folio-anonymization-selected",
|
|
64
67
|
"title"
|
|
65
|
-
],
|
|
68
|
+
], sr = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
66
69
|
__name: "AnonymizationRectsOverlay",
|
|
67
70
|
props: {
|
|
68
71
|
getView: { type: Function },
|
|
@@ -77,7 +80,7 @@ var Vn = [
|
|
|
77
80
|
selectionSeq: {}
|
|
78
81
|
},
|
|
79
82
|
setup(e) {
|
|
80
|
-
let t = e, n =
|
|
83
|
+
let t = e, n = W(null), r = W([]), i = 0, a = null;
|
|
81
84
|
function o() {
|
|
82
85
|
a !== null && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
83
86
|
a = null, s();
|
|
@@ -89,12 +92,12 @@ var Vn = [
|
|
|
89
92
|
r.value = [];
|
|
90
93
|
return;
|
|
91
94
|
}
|
|
92
|
-
let s =
|
|
95
|
+
let s = Ze(o);
|
|
93
96
|
if (s.length === 0) {
|
|
94
97
|
r.value = [];
|
|
95
98
|
return;
|
|
96
99
|
}
|
|
97
|
-
let c = await
|
|
100
|
+
let c = await qe(s, {
|
|
98
101
|
pagesContainer: a,
|
|
99
102
|
zoom: t.zoom,
|
|
100
103
|
layout: t.layout,
|
|
@@ -114,7 +117,7 @@ var Vn = [
|
|
|
114
117
|
}))
|
|
115
118
|
}));
|
|
116
119
|
}
|
|
117
|
-
|
|
120
|
+
J(() => [
|
|
118
121
|
t.editorState,
|
|
119
122
|
t.zoom,
|
|
120
123
|
t.layout,
|
|
@@ -136,10 +139,10 @@ var Vn = [
|
|
|
136
139
|
index: a
|
|
137
140
|
}, i.item(a)?.scrollIntoView({
|
|
138
141
|
block: "center",
|
|
139
|
-
behavior:
|
|
142
|
+
behavior: Je()
|
|
140
143
|
});
|
|
141
144
|
}
|
|
142
|
-
|
|
145
|
+
J(() => [t.selectedCanonical, t.selectionSeq], () => l(), { flush: "post" });
|
|
143
146
|
function u(e) {
|
|
144
147
|
if (e.button !== 0 || !t.onTermClick) return;
|
|
145
148
|
let r = n.value;
|
|
@@ -156,71 +159,80 @@ var Vn = [
|
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
|
-
return
|
|
162
|
+
return Se(() => {
|
|
160
163
|
document.addEventListener("click", u), o();
|
|
161
|
-
}),
|
|
164
|
+
}), xe(() => {
|
|
162
165
|
document.removeEventListener("click", u), a !== null && (cancelAnimationFrame(a), a = null);
|
|
163
|
-
}), (t, i) => (
|
|
166
|
+
}), (t, i) => (U(), I("div", {
|
|
164
167
|
ref_key: "rootRef",
|
|
165
168
|
ref: n,
|
|
166
169
|
class: "folio-anonymization-overlay",
|
|
167
170
|
"data-folio-anonymization-overlay": ""
|
|
168
|
-
}, [(
|
|
171
|
+
}, [(U(!0), I(M, null, G(r.value, (t) => (U(), I(M, { key: `${t.label}:${t.canonical}` }, [(U(!0), I(M, null, G(t.rects, (n, r) => (U(), I("span", {
|
|
169
172
|
key: `${t.canonical}:${r}:${n.left}:${n.top}`,
|
|
170
|
-
class:
|
|
173
|
+
class: V(["folio-anonymization-term", `folio-anonymization-term--${q($e)(t.label)}`]),
|
|
171
174
|
"data-folio-anonymization-label": t.label,
|
|
172
175
|
"data-folio-anonymization-canonical": t.canonical,
|
|
173
176
|
"data-folio-anonymization-selected": t.canonical === e.selectedCanonical ? "true" : void 0,
|
|
174
177
|
title: `Anonymized: ${t.canonical}`,
|
|
175
|
-
style:
|
|
178
|
+
style: H({
|
|
176
179
|
position: "absolute",
|
|
177
180
|
left: `${n.left}px`,
|
|
178
181
|
top: `${n.top}px`,
|
|
179
182
|
width: `${n.width}px`,
|
|
180
183
|
height: `${n.height}px`
|
|
181
184
|
})
|
|
182
|
-
}, null, 14,
|
|
185
|
+
}, null, 14, or))), 128))], 64))), 128))], 512));
|
|
183
186
|
}
|
|
184
|
-
}), [["__scopeId", "data-v-c7db88e1"]]),
|
|
187
|
+
}), [["__scopeId", "data-v-c7db88e1"]]), cr = { class: "doc-outline__header" }, lr = { class: "doc-outline__body" }, ur = {
|
|
185
188
|
key: 0,
|
|
186
189
|
class: "doc-outline__empty"
|
|
187
|
-
},
|
|
190
|
+
}, dr = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
188
191
|
__name: "DocumentOutline",
|
|
189
192
|
props: {
|
|
190
193
|
isOpen: { type: Boolean },
|
|
191
194
|
headings: {},
|
|
192
195
|
leftOffset: { default: 12 },
|
|
193
|
-
topPx: { default: 24 }
|
|
196
|
+
topPx: { default: 24 },
|
|
197
|
+
getScrollContainer: {}
|
|
194
198
|
},
|
|
195
199
|
emits: ["close", "navigate"],
|
|
196
|
-
setup(e) {
|
|
197
|
-
let
|
|
198
|
-
|
|
200
|
+
setup(e, { emit: t }) {
|
|
201
|
+
let n = e, { OutlineRail: i } = p(), a = N(() => n.headings.length ? Math.min(...n.headings.map((e) => e.level)) : 0), o = N(() => n.headings.map((e) => ({
|
|
202
|
+
id: String(e.pmPos),
|
|
203
|
+
label: e.text || "(untitled)",
|
|
204
|
+
level: e.level - a.value
|
|
205
|
+
}))), s = t;
|
|
206
|
+
function c(e) {
|
|
207
|
+
s("navigate", Number(e));
|
|
208
|
+
}
|
|
209
|
+
return (t, n) => e.isOpen ? (U(), I("nav", {
|
|
199
210
|
key: 0,
|
|
200
211
|
class: "doc-outline",
|
|
201
|
-
style:
|
|
212
|
+
style: H({
|
|
202
213
|
left: e.leftOffset + "px",
|
|
203
214
|
top: e.topPx + "px"
|
|
204
215
|
}),
|
|
205
216
|
role: "navigation",
|
|
206
217
|
"aria-label": "Document outline",
|
|
207
|
-
onMousedown:
|
|
208
|
-
}, [
|
|
218
|
+
onMousedown: n[1] ||= Y(() => {}, ["stop"])
|
|
219
|
+
}, [L("div", cr, [L("button", {
|
|
209
220
|
class: "doc-outline__back",
|
|
210
221
|
title: "Close outline",
|
|
211
222
|
"aria-label": "Close outline",
|
|
212
|
-
onClick:
|
|
213
|
-
}, [
|
|
223
|
+
onClick: n[0] ||= (e) => t.$emit("close")
|
|
224
|
+
}, [z(r, {
|
|
214
225
|
name: "arrow_back",
|
|
215
226
|
size: 20
|
|
216
|
-
})]),
|
|
217
|
-
key:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
227
|
+
})]), n[2] ||= L("span", { class: "doc-outline__title" }, "Document Outline", -1)]), L("div", lr, [e.headings.length === 0 ? (U(), I("div", ur, "No headings found")) : (U(), P(q(i), {
|
|
228
|
+
key: 1,
|
|
229
|
+
items: o.value,
|
|
230
|
+
"get-scroll-container": e.getScrollContainer ?? (() => null),
|
|
231
|
+
"on-jump": c,
|
|
232
|
+
"aria-label": "Document outline"
|
|
233
|
+
}, null, 8, ["items", "get-scroll-container"]))])], 36)) : F("", !0);
|
|
234
|
+
}
|
|
235
|
+
}), [["__scopeId", "data-v-92482e57"]]), fr = /* @__PURE__ */ B({
|
|
224
236
|
__name: "DocxEditorDialogs",
|
|
225
237
|
props: {
|
|
226
238
|
view: {},
|
|
@@ -244,53 +256,53 @@ var Vn = [
|
|
|
244
256
|
"hyperlink-remove",
|
|
245
257
|
"page-setup-apply"
|
|
246
258
|
],
|
|
247
|
-
setup(
|
|
248
|
-
let
|
|
249
|
-
return (
|
|
250
|
-
|
|
251
|
-
"is-open":
|
|
252
|
-
view:
|
|
253
|
-
onClose:
|
|
259
|
+
setup(e, { emit: t }) {
|
|
260
|
+
let n = t;
|
|
261
|
+
return (t, r) => (U(), I(M, null, [
|
|
262
|
+
z(u, {
|
|
263
|
+
"is-open": e.showFindReplace,
|
|
264
|
+
view: e.view,
|
|
265
|
+
onClose: r[0] ||= (e) => n("update:showFindReplace", !1)
|
|
254
266
|
}, null, 8, ["is-open", "view"]),
|
|
255
|
-
|
|
256
|
-
"is-open":
|
|
257
|
-
view:
|
|
258
|
-
bookmarks:
|
|
259
|
-
onClose:
|
|
260
|
-
onSubmit:
|
|
261
|
-
onRemove:
|
|
267
|
+
z(d, {
|
|
268
|
+
"is-open": e.showHyperlink,
|
|
269
|
+
view: e.view,
|
|
270
|
+
bookmarks: e.bookmarks,
|
|
271
|
+
onClose: r[1] ||= (e) => n("update:showHyperlink", !1),
|
|
272
|
+
onSubmit: r[2] ||= (e) => n("hyperlink-submit", e),
|
|
273
|
+
onRemove: r[3] ||= (e) => n("hyperlink-remove")
|
|
262
274
|
}, null, 8, [
|
|
263
275
|
"is-open",
|
|
264
276
|
"view",
|
|
265
277
|
"bookmarks"
|
|
266
278
|
]),
|
|
267
|
-
|
|
268
|
-
"is-open":
|
|
269
|
-
onClose:
|
|
270
|
-
onInsert:
|
|
279
|
+
z(a, {
|
|
280
|
+
"is-open": e.showInsertSymbol,
|
|
281
|
+
onClose: r[4] ||= (e) => n("update:showInsertSymbol", !1),
|
|
282
|
+
onInsert: r[5] ||= (e) => n("insert-symbol", e)
|
|
271
283
|
}, null, 8, ["is-open"]),
|
|
272
|
-
|
|
273
|
-
"is-open":
|
|
274
|
-
view:
|
|
275
|
-
"pm-pos":
|
|
276
|
-
onClose:
|
|
284
|
+
z(o, {
|
|
285
|
+
"is-open": e.showImageProperties,
|
|
286
|
+
view: e.view,
|
|
287
|
+
"pm-pos": e.selectedImagePmPos,
|
|
288
|
+
onClose: r[6] ||= (e) => n("update:showImageProperties", !1)
|
|
277
289
|
}, null, 8, [
|
|
278
290
|
"is-open",
|
|
279
291
|
"view",
|
|
280
292
|
"pm-pos"
|
|
281
293
|
]),
|
|
282
|
-
|
|
283
|
-
"is-open":
|
|
284
|
-
"section-properties":
|
|
285
|
-
onClose:
|
|
286
|
-
onApply:
|
|
294
|
+
z(f, {
|
|
295
|
+
"is-open": e.showPageSetup,
|
|
296
|
+
"section-properties": e.sectionProperties,
|
|
297
|
+
onClose: r[7] ||= (e) => n("update:showPageSetup", !1),
|
|
298
|
+
onApply: r[8] ||= (e) => n("page-setup-apply", e)
|
|
287
299
|
}, null, 8, ["is-open", "section-properties"])
|
|
288
300
|
], 64));
|
|
289
301
|
}
|
|
290
|
-
}),
|
|
302
|
+
}), pr = {
|
|
291
303
|
key: 0,
|
|
292
304
|
class: "docx-editor-vue__title-bar"
|
|
293
|
-
},
|
|
305
|
+
}, mr = { class: "docx-editor-vue__title-bar-left" }, hr = { class: "docx-editor-vue__title-bar-center" }, gr = { class: "docx-editor-vue__title-bar-right" }, _r = /* @__PURE__ */ B({
|
|
294
306
|
__name: "DocxEditorMenuBar",
|
|
295
307
|
props: {
|
|
296
308
|
showMenuBar: {
|
|
@@ -322,13 +334,13 @@ var Vn = [
|
|
|
322
334
|
],
|
|
323
335
|
setup(e, { emit: t }) {
|
|
324
336
|
let n = t;
|
|
325
|
-
return (t, r) => e.showMenuBar ? (
|
|
326
|
-
|
|
327
|
-
|
|
337
|
+
return (t, r) => e.showMenuBar ? (U(), I("div", pr, [
|
|
338
|
+
L("div", mr, [we(t.$slots, "title-bar-left")]),
|
|
339
|
+
L("div", hr, [z(m, {
|
|
328
340
|
"model-value": e.documentName,
|
|
329
341
|
editable: e.documentNameEditable,
|
|
330
342
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
331
|
-
}, null, 8, ["model-value", "editable"]),
|
|
343
|
+
}, null, 8, ["model-value", "editable"]), z(g, {
|
|
332
344
|
"show-file-open": e.showFileOpen,
|
|
333
345
|
"show-help-menu": e.showHelpMenu,
|
|
334
346
|
"show-table-insert": e.showTableInsert,
|
|
@@ -339,40 +351,40 @@ var Vn = [
|
|
|
339
351
|
"show-help-menu",
|
|
340
352
|
"show-table-insert"
|
|
341
353
|
])]),
|
|
342
|
-
|
|
343
|
-
])) :
|
|
354
|
+
L("div", gr, [we(t.$slots, "title-bar-right")])
|
|
355
|
+
])) : F("", !0);
|
|
344
356
|
}
|
|
345
|
-
}),
|
|
346
|
-
function
|
|
347
|
-
|
|
357
|
+
}), vr = Symbol("docx-portal-class");
|
|
358
|
+
function yr(e) {
|
|
359
|
+
Ce(vr, N(() => ({
|
|
348
360
|
"ep-root": !0,
|
|
349
|
-
dark: !!
|
|
361
|
+
dark: !!q(e)
|
|
350
362
|
})));
|
|
351
363
|
}
|
|
352
|
-
function
|
|
353
|
-
return
|
|
364
|
+
function br() {
|
|
365
|
+
return ve(vr, N(() => ({ "ep-root": !0 })));
|
|
354
366
|
}
|
|
355
367
|
//#endregion
|
|
356
368
|
//#region src/components/ImageContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
357
|
-
var
|
|
369
|
+
var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "image-ctx-menu__label" }, wr = {
|
|
358
370
|
key: 1,
|
|
359
371
|
class: "image-ctx-menu__divider",
|
|
360
372
|
role: "separator"
|
|
361
|
-
},
|
|
373
|
+
}, Tr = [
|
|
362
374
|
"data-wrap-type",
|
|
363
375
|
"data-current",
|
|
364
376
|
"data-disabled",
|
|
365
377
|
"disabled",
|
|
366
378
|
"title",
|
|
367
379
|
"onClick"
|
|
368
|
-
],
|
|
380
|
+
], Er = { class: "image-ctx-menu__icon" }, Dr = { class: "image-ctx-menu__label" }, Or = ["aria-label"], kr = ["disabled", "onClick"], Ar = { class: "image-ctx-menu__label" }, jr = {
|
|
369
381
|
key: 0,
|
|
370
382
|
class: "image-ctx-menu__shortcut"
|
|
371
|
-
},
|
|
383
|
+
}, Mr = {
|
|
372
384
|
key: 0,
|
|
373
385
|
class: "image-ctx-menu__divider",
|
|
374
386
|
role: "separator"
|
|
375
|
-
},
|
|
387
|
+
}, Nr = 18, Pr = 260, Fr = 10, Ir = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
376
388
|
__name: "ImageContextMenu",
|
|
377
389
|
props: {
|
|
378
390
|
state: {},
|
|
@@ -393,29 +405,29 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
393
405
|
function a() {
|
|
394
406
|
i("open-properties"), i("close");
|
|
395
407
|
}
|
|
396
|
-
let { t: o } =
|
|
408
|
+
let { t: o } = c(), s = br(), l = rt, u = N(() => n.state ? at(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
|
|
397
409
|
inline: "wrap_text",
|
|
398
410
|
squareLeft: "format_image_left",
|
|
399
411
|
squareRight: "format_image_right",
|
|
400
412
|
behind: "flip_to_back",
|
|
401
413
|
inFront: "flip_to_front"
|
|
402
414
|
};
|
|
403
|
-
function
|
|
404
|
-
return
|
|
415
|
+
function f(e) {
|
|
416
|
+
return d[e];
|
|
405
417
|
}
|
|
406
|
-
let
|
|
418
|
+
let p = N(() => {
|
|
407
419
|
if (!n.state) return {};
|
|
408
|
-
let e =
|
|
409
|
-
return typeof window < "u" && (t +
|
|
420
|
+
let e = rt.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
421
|
+
return typeof window < "u" && (t + Pr > window.innerWidth && (t = window.innerWidth - Pr - Fr), r + e > window.innerHeight && (r = window.innerHeight - e - Fr), t < Fr && (t = Fr), r < Fr && (r = Fr)), {
|
|
410
422
|
position: "fixed",
|
|
411
423
|
left: `${t}px`,
|
|
412
424
|
top: `${r}px`,
|
|
413
|
-
minWidth: `${
|
|
425
|
+
minWidth: `${Pr}px`,
|
|
414
426
|
zIndex: 400
|
|
415
427
|
};
|
|
416
428
|
});
|
|
417
429
|
function m(e) {
|
|
418
|
-
return n.state ?
|
|
430
|
+
return n.state ? st(e, n.state.currentWrapType) : !1;
|
|
419
431
|
}
|
|
420
432
|
function h(e) {
|
|
421
433
|
m(e) && (i("select", e.choice), i("close"));
|
|
@@ -429,22 +441,22 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
429
441
|
function v(e) {
|
|
430
442
|
e.key === "Escape" && (e.preventDefault(), i("close"));
|
|
431
443
|
}
|
|
432
|
-
return (t, n) => (
|
|
444
|
+
return (t, n) => (U(), P(pe, { to: "body" }, [e.state && e.state.open ? (U(), I("div", {
|
|
433
445
|
key: 0,
|
|
434
446
|
class: "image-ctx-menu-backdrop",
|
|
435
447
|
onMousedown: _,
|
|
436
448
|
onContextmenu: n[0] ||= Y((e) => t.$emit("close"), ["prevent"])
|
|
437
|
-
}, null, 32)) :
|
|
449
|
+
}, null, 32)) : F("", !0), e.state && e.state.open ? (U(), I("div", {
|
|
438
450
|
key: 1,
|
|
439
|
-
class:
|
|
451
|
+
class: V(["image-ctx-menu", q(s)]),
|
|
440
452
|
role: "menu",
|
|
441
|
-
"aria-label":
|
|
453
|
+
"aria-label": q(o)("imageWrap.menu.ariaLabel"),
|
|
442
454
|
"data-testid": "image-context-menu",
|
|
443
|
-
style:
|
|
455
|
+
style: H(p.value),
|
|
444
456
|
onContextmenu: n[4] ||= Y(() => {}, ["prevent"]),
|
|
445
457
|
onKeydown: v
|
|
446
458
|
}, [
|
|
447
|
-
e.canOpenProperties ? (
|
|
459
|
+
e.canOpenProperties ? (U(), I("button", {
|
|
448
460
|
key: 0,
|
|
449
461
|
type: "button",
|
|
450
462
|
role: "menuitem",
|
|
@@ -452,55 +464,55 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
452
464
|
"data-action": "open-properties",
|
|
453
465
|
onMousedown: n[1] ||= Y(() => {}, ["prevent"]),
|
|
454
466
|
onClick: a
|
|
455
|
-
}, [
|
|
467
|
+
}, [L("span", Sr, [z(r, {
|
|
456
468
|
name: "settings",
|
|
457
|
-
size:
|
|
458
|
-
})]),
|
|
459
|
-
e.canOpenProperties ? (
|
|
460
|
-
(
|
|
469
|
+
size: Nr
|
|
470
|
+
})]), L("span", Cr, K(q(o)("imageWrap.menu.imageProperties")), 1)], 32)) : F("", !0),
|
|
471
|
+
e.canOpenProperties ? (U(), I("div", wr)) : F("", !0),
|
|
472
|
+
(U(!0), I(M, null, G(q(l), (e) => (U(), I("button", {
|
|
461
473
|
key: e.choice,
|
|
462
474
|
type: "button",
|
|
463
475
|
role: "menuitem",
|
|
464
|
-
class:
|
|
476
|
+
class: V(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === u.value }]),
|
|
465
477
|
"data-wrap-type": e.choice,
|
|
466
|
-
"data-current": e.choice ===
|
|
478
|
+
"data-current": e.choice === u.value ? "true" : "false",
|
|
467
479
|
"data-disabled": m(e) ? "false" : "true",
|
|
468
480
|
disabled: !m(e),
|
|
469
|
-
title:
|
|
481
|
+
title: q(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
|
|
470
482
|
onMousedown: n[2] ||= Y(() => {}, ["prevent"]),
|
|
471
483
|
onClick: (t) => h(e)
|
|
472
484
|
}, [
|
|
473
|
-
|
|
474
|
-
name:
|
|
475
|
-
size:
|
|
485
|
+
L("span", Er, [z(r, {
|
|
486
|
+
name: f(e.iconHint),
|
|
487
|
+
size: Nr
|
|
476
488
|
}, null, 8, ["name"])]),
|
|
477
|
-
|
|
478
|
-
e.choice ===
|
|
489
|
+
L("span", Dr, K(q(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
490
|
+
e.choice === u.value ? (U(), I("span", {
|
|
479
491
|
key: 0,
|
|
480
492
|
class: "image-ctx-menu__current-dot",
|
|
481
|
-
"aria-label":
|
|
482
|
-
}, "●", 8,
|
|
483
|
-
], 42,
|
|
484
|
-
e.textActions && e.textActions.length > 0 ? (
|
|
493
|
+
"aria-label": q(o)("imageWrap.menu.ariaLabel")
|
|
494
|
+
}, "●", 8, Or)) : F("", !0)
|
|
495
|
+
], 42, Tr))), 128)),
|
|
496
|
+
e.textActions && e.textActions.length > 0 ? (U(), I(M, { key: 2 }, [n[5] ||= L("div", {
|
|
485
497
|
class: "image-ctx-menu__divider",
|
|
486
498
|
role: "separator"
|
|
487
|
-
}, null, -1), (
|
|
499
|
+
}, null, -1), (U(!0), I(M, null, G(e.textActions, (e, t) => (U(), I(M, { key: `${e.action}-${t}` }, [L("button", {
|
|
488
500
|
type: "button",
|
|
489
501
|
role: "menuitem",
|
|
490
502
|
class: "image-ctx-menu__item image-ctx-menu__item--text",
|
|
491
503
|
disabled: e.disabled,
|
|
492
504
|
onMousedown: n[3] ||= Y(() => {}, ["prevent"]),
|
|
493
505
|
onClick: (t) => g(e)
|
|
494
|
-
}, [
|
|
495
|
-
], 46,
|
|
506
|
+
}, [L("span", Ar, K(e.label), 1), e.shortcut ? (U(), I("span", jr, K(e.shortcut), 1)) : F("", !0)], 40, kr), e.dividerAfter ? (U(), I("div", Mr)) : F("", !0)], 64))), 128))], 64)) : F("", !0)
|
|
507
|
+
], 46, xr)) : F("", !0)]));
|
|
496
508
|
}
|
|
497
|
-
}), [["__scopeId", "data-v-
|
|
509
|
+
}), [["__scopeId", "data-v-37e33eb5"]]), Lr = ["disabled", "onMousedown"], Rr = {
|
|
498
510
|
key: 0,
|
|
499
511
|
class: "ctx-menu__icon"
|
|
500
|
-
},
|
|
512
|
+
}, zr = { class: "ctx-menu__label" }, Br = {
|
|
501
513
|
key: 1,
|
|
502
514
|
class: "ctx-menu__shortcut"
|
|
503
|
-
},
|
|
515
|
+
}, Vr = 220, Hr = 32, Ur = 10, Wr = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
504
516
|
__name: "TextContextMenu",
|
|
505
517
|
props: {
|
|
506
518
|
isOpen: { type: Boolean },
|
|
@@ -515,9 +527,9 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
515
527
|
},
|
|
516
528
|
emits: ["close", "action"],
|
|
517
529
|
setup(e, { emit: t }) {
|
|
518
|
-
let n = e,
|
|
519
|
-
|
|
520
|
-
let
|
|
530
|
+
let n = e, r = ({ node: e }) => e;
|
|
531
|
+
r.props = ["node"];
|
|
532
|
+
let i = t, { t: a } = c(), o = br(), s = W(null), l = N(() => {
|
|
521
533
|
let e = [], t = n.customItems ?? [];
|
|
522
534
|
for (let [n, r] of t.entries()) e.push({
|
|
523
535
|
id: `custom-${r.id}`,
|
|
@@ -533,27 +545,27 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
533
545
|
});
|
|
534
546
|
return e.push({
|
|
535
547
|
id: "cut",
|
|
536
|
-
label:
|
|
548
|
+
label: a("cut"),
|
|
537
549
|
action: "cut",
|
|
538
|
-
shortcut:
|
|
550
|
+
shortcut: a("contextMenu.cutShortcut"),
|
|
539
551
|
disabled: !n.hasSelection || !n.isEditable
|
|
540
552
|
}, {
|
|
541
553
|
id: "copy",
|
|
542
|
-
label:
|
|
554
|
+
label: a("copy"),
|
|
543
555
|
action: "copy",
|
|
544
|
-
shortcut:
|
|
556
|
+
shortcut: a("contextMenu.copyShortcut"),
|
|
545
557
|
disabled: !n.hasSelection
|
|
546
558
|
}, {
|
|
547
559
|
id: "paste",
|
|
548
|
-
label:
|
|
560
|
+
label: a("paste"),
|
|
549
561
|
action: "paste",
|
|
550
|
-
shortcut:
|
|
562
|
+
shortcut: a("contextMenu.pasteShortcut"),
|
|
551
563
|
disabled: !n.isEditable
|
|
552
564
|
}, {
|
|
553
565
|
id: "pasteAsPlainText",
|
|
554
|
-
label:
|
|
566
|
+
label: a("pasteUnformatted"),
|
|
555
567
|
action: "pasteAsPlainText",
|
|
556
|
-
shortcut:
|
|
568
|
+
shortcut: a("contextMenu.pastePlainTextShortcut"),
|
|
557
569
|
disabled: !n.isEditable
|
|
558
570
|
}, {
|
|
559
571
|
id: "div1",
|
|
@@ -562,15 +574,15 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
562
574
|
divider: !0
|
|
563
575
|
}, {
|
|
564
576
|
id: "delete",
|
|
565
|
-
label:
|
|
577
|
+
label: a("delete"),
|
|
566
578
|
action: "delete",
|
|
567
|
-
shortcut:
|
|
579
|
+
shortcut: a("contextMenu.deleteShortcut"),
|
|
568
580
|
disabled: !n.hasSelection || !n.isEditable
|
|
569
581
|
}, {
|
|
570
582
|
id: "selectAll",
|
|
571
|
-
label:
|
|
583
|
+
label: a("selectAll"),
|
|
572
584
|
action: "selectAll",
|
|
573
|
-
shortcut:
|
|
585
|
+
shortcut: a("contextMenu.selectAllShortcut")
|
|
574
586
|
}), n.onImage && n.isEditable && e.push({
|
|
575
587
|
id: "div-img",
|
|
576
588
|
label: "",
|
|
@@ -578,17 +590,17 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
578
590
|
divider: !0
|
|
579
591
|
}, {
|
|
580
592
|
id: "replaceImage",
|
|
581
|
-
label:
|
|
593
|
+
label: a("imageOverlay.replaceImage"),
|
|
582
594
|
action: "replaceImage"
|
|
583
595
|
}, {
|
|
584
596
|
id: "imageProperties",
|
|
585
|
-
label:
|
|
597
|
+
label: a("imageWrap.menu.imageProperties"),
|
|
586
598
|
action: "imageProperties"
|
|
587
599
|
}, {
|
|
588
600
|
id: "deleteImage",
|
|
589
|
-
label:
|
|
601
|
+
label: a("imageOverlay.deleteImage"),
|
|
590
602
|
action: "deleteImage",
|
|
591
|
-
shortcut:
|
|
603
|
+
shortcut: a("contextMenu.deleteShortcut")
|
|
592
604
|
}), n.inTable && n.isEditable && e.push({
|
|
593
605
|
id: "div2",
|
|
594
606
|
label: "",
|
|
@@ -596,15 +608,15 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
596
608
|
divider: !0
|
|
597
609
|
}, {
|
|
598
610
|
id: "addRowAbove",
|
|
599
|
-
label:
|
|
611
|
+
label: a("insertRowAbove"),
|
|
600
612
|
action: "addRowAbove"
|
|
601
613
|
}, {
|
|
602
614
|
id: "addRowBelow",
|
|
603
|
-
label:
|
|
615
|
+
label: a("insertRowBelow"),
|
|
604
616
|
action: "addRowBelow"
|
|
605
617
|
}, {
|
|
606
618
|
id: "deleteRow",
|
|
607
|
-
label:
|
|
619
|
+
label: a("deleteRow"),
|
|
608
620
|
action: "deleteRow"
|
|
609
621
|
}, {
|
|
610
622
|
id: "div3",
|
|
@@ -613,15 +625,15 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
613
625
|
divider: !0
|
|
614
626
|
}, {
|
|
615
627
|
id: "addColLeft",
|
|
616
|
-
label:
|
|
628
|
+
label: a("insertColumnLeft"),
|
|
617
629
|
action: "addColumnLeft"
|
|
618
630
|
}, {
|
|
619
631
|
id: "addColRight",
|
|
620
|
-
label:
|
|
632
|
+
label: a("insertColumnRight"),
|
|
621
633
|
action: "addColumnRight"
|
|
622
634
|
}, {
|
|
623
635
|
id: "deleteCol",
|
|
624
|
-
label:
|
|
636
|
+
label: a("deleteColumn"),
|
|
625
637
|
action: "deleteColumn"
|
|
626
638
|
}, {
|
|
627
639
|
id: "div4",
|
|
@@ -630,12 +642,12 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
630
642
|
divider: !0
|
|
631
643
|
}, {
|
|
632
644
|
id: "mergeCells",
|
|
633
|
-
label:
|
|
645
|
+
label: a("table.mergeCells"),
|
|
634
646
|
action: "mergeCells",
|
|
635
647
|
disabled: !n.canMergeCells
|
|
636
648
|
}, {
|
|
637
649
|
id: "splitCell",
|
|
638
|
-
label:
|
|
650
|
+
label: a("table.splitCell"),
|
|
639
651
|
action: "splitCell",
|
|
640
652
|
disabled: !n.canSplitCell
|
|
641
653
|
}, {
|
|
@@ -645,16 +657,16 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
645
657
|
divider: !0
|
|
646
658
|
}, {
|
|
647
659
|
id: "selectTable",
|
|
648
|
-
label:
|
|
660
|
+
label: a("table.selectTable"),
|
|
649
661
|
action: "selectTable"
|
|
650
662
|
}, {
|
|
651
663
|
id: "deleteTable",
|
|
652
|
-
label:
|
|
664
|
+
label: a("table.deleteTable"),
|
|
653
665
|
action: "deleteTable"
|
|
654
666
|
}), e;
|
|
655
|
-
}), u =
|
|
656
|
-
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 *
|
|
657
|
-
return typeof window < "u" && (e +
|
|
667
|
+
}), u = N(() => {
|
|
668
|
+
let e = n.position.x, t = n.position.y, r = l.value.filter((e) => !e.divider).length, i = l.value.filter((e) => e.divider).length, a = r * Hr + i * 9;
|
|
669
|
+
return typeof window < "u" && (e + Vr + Ur > window.innerWidth && (e = window.innerWidth - Vr - Ur), t + a + Ur > window.innerHeight && (t = window.innerHeight - a - Ur)), {
|
|
658
670
|
position: "fixed",
|
|
659
671
|
left: `${e}px`,
|
|
660
672
|
top: `${t}px`,
|
|
@@ -662,29 +674,29 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
662
674
|
};
|
|
663
675
|
});
|
|
664
676
|
function d(e) {
|
|
665
|
-
e && (
|
|
677
|
+
e && (i("action", e), i("close"));
|
|
666
678
|
}
|
|
667
679
|
function f(e) {
|
|
668
|
-
e.key === "Escape" &&
|
|
680
|
+
e.key === "Escape" && i("close");
|
|
669
681
|
}
|
|
670
|
-
return
|
|
671
|
-
e &&
|
|
672
|
-
}), (t, n) => (
|
|
682
|
+
return J(() => n.isOpen, (e) => {
|
|
683
|
+
e && be(() => s.value?.focus());
|
|
684
|
+
}), (t, n) => (U(), P(pe, { to: "body" }, [e.isOpen ? (U(), I("div", {
|
|
673
685
|
key: 0,
|
|
674
686
|
class: "ctx-menu-backdrop",
|
|
675
687
|
onMousedown: n[0] ||= (e) => t.$emit("close"),
|
|
676
688
|
onContextmenu: n[1] ||= Y((e) => t.$emit("close"), ["prevent"])
|
|
677
|
-
}, null, 32)) :
|
|
689
|
+
}, null, 32)) : F("", !0), e.isOpen ? (U(), I("div", {
|
|
678
690
|
key: 1,
|
|
679
691
|
ref_key: "menuRef",
|
|
680
|
-
ref:
|
|
681
|
-
class:
|
|
682
|
-
style:
|
|
692
|
+
ref: s,
|
|
693
|
+
class: V(["ctx-menu", q(o)]),
|
|
694
|
+
style: H(u.value),
|
|
683
695
|
onContextmenu: n[2] ||= Y(() => {}, ["prevent"]),
|
|
684
696
|
onKeydown: f
|
|
685
|
-
}, [(
|
|
697
|
+
}, [(U(!0), I(M, null, G(l.value, (e, t) => (U(), I("button", {
|
|
686
698
|
key: e.id || t,
|
|
687
|
-
class:
|
|
699
|
+
class: V(["ctx-menu__item", {
|
|
688
700
|
"ctx-menu__item--disabled": e.disabled,
|
|
689
701
|
"ctx-menu__item--divider": e.divider,
|
|
690
702
|
"ctx-menu__item--emphasis": e.emphasis
|
|
@@ -692,12 +704,12 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
692
704
|
disabled: e.disabled,
|
|
693
705
|
onMousedown: Y((t) => d(e.action), ["prevent"])
|
|
694
706
|
}, [
|
|
695
|
-
e.icon ? (
|
|
696
|
-
|
|
697
|
-
e.shortcut ? (
|
|
698
|
-
], 42,
|
|
707
|
+
e.icon ? (U(), I("span", Rr, [z(r, { node: e.icon }, null, 8, ["node"])])) : F("", !0),
|
|
708
|
+
L("span", zr, K(e.label), 1),
|
|
709
|
+
e.shortcut ? (U(), I("span", Br, K(e.shortcut), 1)) : F("", !0)
|
|
710
|
+
], 42, Lr))), 128))], 38)) : F("", !0)]));
|
|
699
711
|
}
|
|
700
|
-
}), [["__scopeId", "data-v-
|
|
712
|
+
}), [["__scopeId", "data-v-f7db4540"]]), Gr = /* @__PURE__ */ B({
|
|
701
713
|
__name: "DocxEditorOverlays",
|
|
702
714
|
props: {
|
|
703
715
|
readOnly: { type: Boolean },
|
|
@@ -716,7 +728,7 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
716
728
|
],
|
|
717
729
|
setup(e, { emit: t }) {
|
|
718
730
|
let n = t;
|
|
719
|
-
return (t, r) => (
|
|
731
|
+
return (t, r) => (U(), I(M, null, [z(Wr, {
|
|
720
732
|
"is-open": e.contextMenu.isOpen,
|
|
721
733
|
position: e.contextMenu.position,
|
|
722
734
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -738,7 +750,7 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
738
750
|
"can-merge-cells",
|
|
739
751
|
"can-split-cell",
|
|
740
752
|
"custom-items"
|
|
741
|
-
]),
|
|
753
|
+
]), z(Ir, {
|
|
742
754
|
state: e.imageContextMenu,
|
|
743
755
|
"text-actions": e.imageContextMenuTextActions,
|
|
744
756
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -755,7 +767,7 @@ var rr = ["aria-label"], ir = { class: "image-ctx-menu__icon" }, ar = { class: "
|
|
|
755
767
|
});
|
|
756
768
|
//#endregion
|
|
757
769
|
//#region src/composables/imageOverlayRect.ts
|
|
758
|
-
function
|
|
770
|
+
function Kr(e) {
|
|
759
771
|
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
760
772
|
return {
|
|
761
773
|
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
@@ -766,13 +778,13 @@ function Or(e) {
|
|
|
766
778
|
}
|
|
767
779
|
//#endregion
|
|
768
780
|
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
769
|
-
var
|
|
781
|
+
var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
770
782
|
key: 0,
|
|
771
783
|
class: "image-overlay__dim"
|
|
772
|
-
},
|
|
784
|
+
}, Xr = {
|
|
773
785
|
key: 1,
|
|
774
786
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
775
|
-
},
|
|
787
|
+
}, Zr = 4, Qr = 15, $r = 250, ei = 700, ti = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
776
788
|
__name: "ImageSelectionOverlay",
|
|
777
789
|
props: {
|
|
778
790
|
imageInfo: {},
|
|
@@ -786,8 +798,8 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
786
798
|
"context-menu"
|
|
787
799
|
],
|
|
788
800
|
setup(e, { emit: t }) {
|
|
789
|
-
let { t: n } =
|
|
790
|
-
function
|
|
801
|
+
let { t: n } = c(), r = e, i = t, a = W(null), o = W(!1), s = W(!1), l = W(!1), u = W(0), d = W(0), f = W(0), p = W(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, ee = null;
|
|
802
|
+
function S(e, t) {
|
|
791
803
|
if (!e) return null;
|
|
792
804
|
try {
|
|
793
805
|
let n = e.state.doc.nodeAt(t);
|
|
@@ -796,88 +808,88 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
796
808
|
return null;
|
|
797
809
|
}
|
|
798
810
|
}
|
|
799
|
-
function
|
|
811
|
+
function te(e) {
|
|
800
812
|
if (!e) return null;
|
|
801
813
|
let t = e.attrs.transform;
|
|
802
814
|
return typeof t == "string" ? t : null;
|
|
803
815
|
}
|
|
804
|
-
function
|
|
805
|
-
return
|
|
816
|
+
function ne() {
|
|
817
|
+
return a.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
|
|
806
818
|
}
|
|
807
|
-
function
|
|
808
|
-
let e =
|
|
819
|
+
function ie() {
|
|
820
|
+
let e = r.imageInfo;
|
|
809
821
|
if (!e) return null;
|
|
810
822
|
if (e.element.isConnected) return e.element;
|
|
811
|
-
let t =
|
|
823
|
+
let t = ne();
|
|
812
824
|
if (!t) return null;
|
|
813
|
-
let n =
|
|
814
|
-
return n ?
|
|
825
|
+
let n = _t(t, e.pmPos);
|
|
826
|
+
return n ? ot(n) : null;
|
|
815
827
|
}
|
|
816
|
-
function
|
|
817
|
-
let e =
|
|
818
|
-
if (!e || !
|
|
828
|
+
function C() {
|
|
829
|
+
let e = ie();
|
|
830
|
+
if (!e || !a.value) {
|
|
819
831
|
p.value = null;
|
|
820
832
|
return;
|
|
821
833
|
}
|
|
822
|
-
let t =
|
|
834
|
+
let t = a.value.offsetParent;
|
|
823
835
|
if (!(t instanceof HTMLElement)) {
|
|
824
836
|
p.value = null;
|
|
825
837
|
return;
|
|
826
838
|
}
|
|
827
839
|
let n = t.getBoundingClientRect();
|
|
828
|
-
p.value =
|
|
840
|
+
p.value = Kr({
|
|
829
841
|
imageRect: e.getBoundingClientRect(),
|
|
830
842
|
parentRect: n,
|
|
831
843
|
scrollLeft: t.scrollLeft,
|
|
832
844
|
scrollTop: t.scrollTop,
|
|
833
845
|
parentOffsetWidth: t.offsetWidth,
|
|
834
846
|
parentClientWidth: t.clientWidth,
|
|
835
|
-
zoom:
|
|
847
|
+
zoom: r.zoom
|
|
836
848
|
});
|
|
837
849
|
}
|
|
838
|
-
let
|
|
839
|
-
function
|
|
840
|
-
|
|
850
|
+
let ae = null;
|
|
851
|
+
function oe() {
|
|
852
|
+
ae?.();
|
|
841
853
|
let e = 0, t = "", n = 0, r = 0, i = (a) => {
|
|
842
854
|
r === 0 && (r = a);
|
|
843
855
|
let o = a - r;
|
|
844
|
-
|
|
856
|
+
C();
|
|
845
857
|
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
846
|
-
n = c === t ? n + 1 : 0, t = c, !(o >=
|
|
858
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= $r && n >= 2) && o < ei && (e = requestAnimationFrame(i));
|
|
847
859
|
};
|
|
848
860
|
e = requestAnimationFrame(i);
|
|
849
|
-
let a = setTimeout(
|
|
850
|
-
|
|
861
|
+
let a = setTimeout(C, $r);
|
|
862
|
+
ae = () => {
|
|
851
863
|
cancelAnimationFrame(e), clearTimeout(a);
|
|
852
864
|
};
|
|
853
865
|
}
|
|
854
|
-
|
|
855
|
-
if (!
|
|
866
|
+
J(() => r.imageInfo, (e, t, n) => {
|
|
867
|
+
if (!r.imageInfo) {
|
|
856
868
|
p.value = null;
|
|
857
869
|
return;
|
|
858
870
|
}
|
|
859
|
-
|
|
860
|
-
}, { immediate: !0 }),
|
|
861
|
-
|
|
862
|
-
}),
|
|
863
|
-
if (!
|
|
864
|
-
let
|
|
865
|
-
b && cancelAnimationFrame(b), b = requestAnimationFrame(
|
|
866
|
-
},
|
|
867
|
-
|
|
871
|
+
oe(), n(() => ae?.());
|
|
872
|
+
}, { immediate: !0 }), J(() => r.zoom, () => {
|
|
873
|
+
r.imageInfo && oe();
|
|
874
|
+
}), J(() => r.imageInfo, (e, t, n) => {
|
|
875
|
+
if (!r.imageInfo) return;
|
|
876
|
+
let i = () => {
|
|
877
|
+
b && cancelAnimationFrame(b), b = requestAnimationFrame(C);
|
|
878
|
+
}, o = a.value?.closest(".docx-editor-vue__pages-viewport");
|
|
879
|
+
o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
|
|
868
880
|
let s = null, c = !1;
|
|
869
|
-
|
|
870
|
-
if (c || !
|
|
871
|
-
let e =
|
|
872
|
-
e && (s = new MutationObserver(() =>
|
|
881
|
+
be(() => {
|
|
882
|
+
if (c || !r.imageInfo) return;
|
|
883
|
+
let e = ne();
|
|
884
|
+
e && (s = new MutationObserver(() => oe()), s.observe(e, {
|
|
873
885
|
attributes: !0,
|
|
874
886
|
attributeFilter: ["style"]
|
|
875
887
|
}));
|
|
876
888
|
}), n(() => {
|
|
877
|
-
c = !0,
|
|
889
|
+
c = !0, o?.removeEventListener("scroll", i), window.removeEventListener("resize", i), s?.disconnect(), b && cancelAnimationFrame(b);
|
|
878
890
|
});
|
|
879
891
|
}, { immediate: !0 });
|
|
880
|
-
let
|
|
892
|
+
let w = N(() => o.value ? u.value : p.value?.width || 0), T = N(() => o.value ? d.value : p.value?.height || 0), se = N(() => {
|
|
881
893
|
let e = p.value;
|
|
882
894
|
if (!e) return {
|
|
883
895
|
position: "absolute",
|
|
@@ -886,20 +898,20 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
886
898
|
visibility: "hidden",
|
|
887
899
|
pointerEvents: "none"
|
|
888
900
|
};
|
|
889
|
-
let t =
|
|
901
|
+
let t = o.value ? u.value : e.width, n = o.value ? d.value : e.height, i = r.zoom || 1;
|
|
890
902
|
return {
|
|
891
903
|
position: "absolute",
|
|
892
|
-
left: `${e.left *
|
|
893
|
-
top: `${e.top *
|
|
904
|
+
left: `${e.left * i}px`,
|
|
905
|
+
top: `${e.top * i}px`,
|
|
894
906
|
width: `${t}px`,
|
|
895
907
|
height: `${n}px`,
|
|
896
|
-
transform:
|
|
908
|
+
transform: i === 1 ? void 0 : `scale(${i})`,
|
|
897
909
|
transformOrigin: "top left",
|
|
898
|
-
zIndex:
|
|
910
|
+
zIndex: re.imageOverlay,
|
|
899
911
|
pointerEvents: "auto"
|
|
900
912
|
};
|
|
901
|
-
}),
|
|
902
|
-
let e =
|
|
913
|
+
}), ce = N(() => {
|
|
914
|
+
let e = w.value, t = T.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
|
|
903
915
|
return [
|
|
904
916
|
{
|
|
905
917
|
pos: "nw",
|
|
@@ -967,11 +979,11 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
967
979
|
}
|
|
968
980
|
];
|
|
969
981
|
});
|
|
970
|
-
function
|
|
971
|
-
!
|
|
982
|
+
function le(e, t) {
|
|
983
|
+
!r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", E), document.addEventListener("mouseup", D));
|
|
972
984
|
}
|
|
973
|
-
function
|
|
974
|
-
let t =
|
|
985
|
+
function E(e) {
|
|
986
|
+
let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = ft(m, n, i, _, v, a);
|
|
975
987
|
u.value = Math.round(o.width), d.value = Math.round(o.height);
|
|
976
988
|
let s = y;
|
|
977
989
|
s && (p.value = {
|
|
@@ -981,83 +993,83 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
981
993
|
height: s.height
|
|
982
994
|
});
|
|
983
995
|
}
|
|
984
|
-
function
|
|
985
|
-
document.removeEventListener("mousemove",
|
|
986
|
-
let e =
|
|
996
|
+
function D() {
|
|
997
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), o.value = !1, y = null, i("interact-end");
|
|
998
|
+
let e = r.view, t = r.imageInfo;
|
|
987
999
|
if (!e || !t) {
|
|
988
|
-
|
|
1000
|
+
C();
|
|
989
1001
|
return;
|
|
990
1002
|
}
|
|
991
|
-
let n =
|
|
992
|
-
n !== null &&
|
|
1003
|
+
let n = ht(e, t.pmPos, u.value, d.value);
|
|
1004
|
+
n !== null && _e(n), be(() => C());
|
|
993
1005
|
}
|
|
994
|
-
let
|
|
995
|
-
function
|
|
1006
|
+
let ue = 0, de = 0, fe = 0, O = 0, k = null, A = null;
|
|
1007
|
+
function j(e) {
|
|
996
1008
|
if (!e) return 0;
|
|
997
1009
|
let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/)?.[1];
|
|
998
1010
|
return t ? parseFloat(t) : 0;
|
|
999
1011
|
}
|
|
1000
|
-
function
|
|
1012
|
+
function pe(e, t) {
|
|
1001
1013
|
let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
|
|
1002
1014
|
return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
|
|
1003
1015
|
}
|
|
1004
|
-
function
|
|
1005
|
-
return Math.atan2(e -
|
|
1016
|
+
function me(e, t) {
|
|
1017
|
+
return Math.atan2(e - ue, -(t - de)) * 180 / Math.PI;
|
|
1006
1018
|
}
|
|
1007
|
-
function
|
|
1008
|
-
if (!
|
|
1009
|
-
let t =
|
|
1010
|
-
|
|
1019
|
+
function P(e) {
|
|
1020
|
+
if (!r.imageInfo) return;
|
|
1021
|
+
let t = r.imageInfo.element.getBoundingClientRect();
|
|
1022
|
+
ue = t.left + t.width / 2, de = t.top + t.height / 2, k = te(S(r.view, r.imageInfo.pmPos)), O = j(k), A = r.imageInfo.element.querySelector("img"), fe = me(e.clientX, e.clientY), f.value = O, l.value = !0, i("interact-start"), document.addEventListener("mousemove", he), document.addEventListener("mouseup", ge);
|
|
1011
1023
|
}
|
|
1012
|
-
function
|
|
1013
|
-
let t =
|
|
1014
|
-
e.shiftKey || (n = Math.round(n /
|
|
1024
|
+
function he(e) {
|
|
1025
|
+
let t = me(e.clientX, e.clientY) - fe, n = O + t;
|
|
1026
|
+
e.shiftKey || (n = Math.round(n / Qr) * Qr), f.value = (n % 360 + 360) % 360, A && (A.style.transform = pe(k, f.value) || "");
|
|
1015
1027
|
}
|
|
1016
1028
|
function ge() {
|
|
1017
|
-
document.removeEventListener("mousemove",
|
|
1018
|
-
let e =
|
|
1029
|
+
document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), l.value = !1, i("interact-end");
|
|
1030
|
+
let e = r.view, t = r.imageInfo;
|
|
1019
1031
|
try {
|
|
1020
|
-
let n = e && t ?
|
|
1032
|
+
let n = e && t ? S(e, t.pmPos) : null;
|
|
1021
1033
|
e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
|
|
1022
1034
|
...n.attrs,
|
|
1023
|
-
transform:
|
|
1024
|
-
})),
|
|
1035
|
+
transform: pe(te(n), f.value)
|
|
1036
|
+
})), _e(t.pmPos));
|
|
1025
1037
|
} catch {} finally {
|
|
1026
|
-
|
|
1038
|
+
A && (A.style.transform = ""), A = null, k = null;
|
|
1027
1039
|
}
|
|
1028
|
-
|
|
1029
|
-
}
|
|
1030
|
-
let
|
|
1031
|
-
function
|
|
1032
|
-
if (!
|
|
1033
|
-
let t = e.clientX, n = e.clientY,
|
|
1034
|
-
let
|
|
1035
|
-
if (!(!o && Math.sqrt(
|
|
1040
|
+
be(() => C());
|
|
1041
|
+
}
|
|
1042
|
+
let R = null;
|
|
1043
|
+
function z(e) {
|
|
1044
|
+
if (!r.imageInfo || !p.value) return;
|
|
1045
|
+
let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
|
|
1046
|
+
let c = e.clientX - t, l = e.clientY - n;
|
|
1047
|
+
if (!(!o && Math.sqrt(c * c + l * l) < Zr)) {
|
|
1036
1048
|
if (!o) {
|
|
1037
|
-
o = !0,
|
|
1038
|
-
let e =
|
|
1039
|
-
|
|
1049
|
+
o = !0, s.value = !0, i("interact-start"), R = document.createElement("div"), R.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
|
|
1050
|
+
let e = r.zoom;
|
|
1051
|
+
R.style.width = `${a.width * e}px`, R.style.height = `${a.height * e}px`, document.body.appendChild(R);
|
|
1040
1052
|
}
|
|
1041
|
-
if (
|
|
1042
|
-
let t =
|
|
1043
|
-
|
|
1053
|
+
if (R) {
|
|
1054
|
+
let t = r.zoom;
|
|
1055
|
+
R.style.left = `${e.clientX - a.width * t / 2}px`, R.style.top = `${e.clientY - a.height * t / 2}px`;
|
|
1044
1056
|
}
|
|
1045
1057
|
}
|
|
1046
1058
|
}, l = (e) => {
|
|
1047
|
-
document.removeEventListener("mousemove",
|
|
1059
|
+
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", l), x = null, ee = null, R &&= (R.remove(), null), s.value = !1, o && (i("interact-end"), B(e.clientX, e.clientY));
|
|
1048
1060
|
};
|
|
1049
|
-
x =
|
|
1050
|
-
}
|
|
1051
|
-
function
|
|
1052
|
-
let n =
|
|
1053
|
-
if (!n || !
|
|
1054
|
-
let
|
|
1055
|
-
if (
|
|
1056
|
-
if (
|
|
1057
|
-
let
|
|
1058
|
-
if (!
|
|
1061
|
+
x = c, ee = l, document.addEventListener("mousemove", c), document.addEventListener("mouseup", l);
|
|
1062
|
+
}
|
|
1063
|
+
function B(e, t) {
|
|
1064
|
+
let n = r.view, i = r.imageInfo;
|
|
1065
|
+
if (!n || !i) return;
|
|
1066
|
+
let o = S(n, i.pmPos);
|
|
1067
|
+
if (o) {
|
|
1068
|
+
if (gt(o)) {
|
|
1069
|
+
let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
|
|
1070
|
+
if (!o || o.length === 0) return;
|
|
1059
1071
|
let s = null;
|
|
1060
|
-
for (let e of
|
|
1072
|
+
for (let e of o) {
|
|
1061
1073
|
let n = e.getBoundingClientRect();
|
|
1062
1074
|
if (t >= n.top && t <= n.bottom) {
|
|
1063
1075
|
s = e.querySelector(".layout-page-content");
|
|
@@ -1065,66 +1077,66 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1065
1077
|
}
|
|
1066
1078
|
}
|
|
1067
1079
|
if (!s) {
|
|
1068
|
-
let e =
|
|
1080
|
+
let e = o.item(o.length - 1);
|
|
1069
1081
|
s = e ? e.querySelector(".layout-page-content") : null;
|
|
1070
1082
|
}
|
|
1071
1083
|
if (!s) return;
|
|
1072
|
-
let c = s.getBoundingClientRect(), l =
|
|
1073
|
-
f !== null &&
|
|
1084
|
+
let c = s.getBoundingClientRect(), l = r.zoom, u = nt((e - c.left) / l), d = nt((t - c.top) / l), f = pt(n, i.pmPos, u, d);
|
|
1085
|
+
f !== null && _e(f);
|
|
1074
1086
|
} else {
|
|
1075
|
-
let
|
|
1076
|
-
if (!
|
|
1077
|
-
let a =
|
|
1087
|
+
let r = ne();
|
|
1088
|
+
if (!r) return;
|
|
1089
|
+
let a = dt(r, e, t, 1);
|
|
1078
1090
|
if (a == null || a < 0) return;
|
|
1079
|
-
let o =
|
|
1080
|
-
o !== null &&
|
|
1091
|
+
let o = mt(n, i.pmPos, a);
|
|
1092
|
+
o !== null && _e(o);
|
|
1081
1093
|
}
|
|
1082
|
-
|
|
1094
|
+
be(() => C());
|
|
1083
1095
|
}
|
|
1084
1096
|
}
|
|
1085
|
-
function
|
|
1086
|
-
let t =
|
|
1097
|
+
function _e(e) {
|
|
1098
|
+
let t = r.view;
|
|
1087
1099
|
if (t) try {
|
|
1088
|
-
let n =
|
|
1100
|
+
let n = Z.create(t.state.doc, e);
|
|
1089
1101
|
t.dispatch(t.state.tr.setSelection(n));
|
|
1090
1102
|
} catch {}
|
|
1091
1103
|
}
|
|
1092
|
-
return
|
|
1093
|
-
document.removeEventListener("mousemove",
|
|
1094
|
-
}), (t, r) => e.imageInfo ? (
|
|
1104
|
+
return xe(() => {
|
|
1105
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), x && document.removeEventListener("mousemove", x), ee && document.removeEventListener("mouseup", ee), R &&= (R.remove(), null), b && cancelAnimationFrame(b), ae?.();
|
|
1106
|
+
}), (t, r) => e.imageInfo ? (U(), I("div", {
|
|
1095
1107
|
key: 0,
|
|
1096
1108
|
ref_key: "overlayRootRef",
|
|
1097
|
-
ref:
|
|
1109
|
+
ref: a,
|
|
1098
1110
|
class: "image-overlay",
|
|
1099
|
-
style:
|
|
1111
|
+
style: H(se.value),
|
|
1100
1112
|
onMousedown: r[3] ||= Y(() => {}, ["stop"])
|
|
1101
1113
|
}, [
|
|
1102
|
-
r[4] ||=
|
|
1103
|
-
|
|
1114
|
+
r[4] ||= L("div", { class: "image-overlay__border" }, null, -1),
|
|
1115
|
+
L("div", {
|
|
1104
1116
|
class: "image-overlay__body",
|
|
1105
|
-
style:
|
|
1106
|
-
onMousedown: r[0] ||= Y((e) =>
|
|
1117
|
+
style: H({ cursor: s.value ? "grabbing" : "grab" }),
|
|
1118
|
+
onMousedown: r[0] ||= Y((e) => z(e), ["prevent", "stop"]),
|
|
1107
1119
|
onContextmenu: r[1] ||= Y((e) => t.$emit("context-menu", e), ["prevent", "stop"])
|
|
1108
1120
|
}, null, 36),
|
|
1109
|
-
(
|
|
1121
|
+
(U(!0), I(M, null, G(ce.value, (e) => (U(), I("div", {
|
|
1110
1122
|
key: e.pos,
|
|
1111
1123
|
class: "image-overlay__handle",
|
|
1112
|
-
style:
|
|
1124
|
+
style: H(e.style),
|
|
1113
1125
|
"data-handle": e.pos,
|
|
1114
|
-
onMousedown: Y((t) =>
|
|
1115
|
-
}, null, 44,
|
|
1116
|
-
r[5] ||=
|
|
1117
|
-
|
|
1126
|
+
onMousedown: Y((t) => le(t, e.pos), ["prevent", "stop"])
|
|
1127
|
+
}, null, 44, qr))), 128)),
|
|
1128
|
+
r[5] ||= L("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
1129
|
+
L("div", {
|
|
1118
1130
|
class: "image-overlay__rotate-handle",
|
|
1119
|
-
style:
|
|
1120
|
-
title:
|
|
1121
|
-
onMousedown: r[2] ||= Y((e) =>
|
|
1122
|
-
}, null, 44,
|
|
1123
|
-
|
|
1124
|
-
l.value ? (
|
|
1125
|
-
], 36)) :
|
|
1126
|
-
}
|
|
1127
|
-
}), [["__scopeId", "data-v-
|
|
1131
|
+
style: H({ left: `${w.value / 2 - 7}px` }),
|
|
1132
|
+
title: q(n)("imageOverlay.rotate"),
|
|
1133
|
+
onMousedown: r[2] ||= Y((e) => P(e), ["prevent", "stop"])
|
|
1134
|
+
}, null, 44, Jr),
|
|
1135
|
+
o.value ? (U(), I("div", Yr, K(Math.round(u.value)) + " × " + K(Math.round(d.value)), 1)) : F("", !0),
|
|
1136
|
+
l.value ? (U(), I("div", Xr, K(Math.round(f.value)) + "° ", 1)) : F("", !0)
|
|
1137
|
+
], 36)) : F("", !0);
|
|
1138
|
+
}
|
|
1139
|
+
}), [["__scopeId", "data-v-4741c675"]]), ni = ["title", "aria-label"], ri = /* @__PURE__ */ B({
|
|
1128
1140
|
__name: "OutlineToggleButton",
|
|
1129
1141
|
props: {
|
|
1130
1142
|
leftOffset: {},
|
|
@@ -1132,24 +1144,24 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1132
1144
|
},
|
|
1133
1145
|
emits: ["toggle"],
|
|
1134
1146
|
setup(e) {
|
|
1135
|
-
let { t } =
|
|
1136
|
-
return (n,
|
|
1147
|
+
let { t } = c();
|
|
1148
|
+
return (n, i) => (U(), I("button", {
|
|
1137
1149
|
type: "button",
|
|
1138
1150
|
class: "docx-outline-toggle docx-editor-vue__outline-toggle",
|
|
1139
|
-
style:
|
|
1151
|
+
style: H({
|
|
1140
1152
|
left: e.leftOffset + "px",
|
|
1141
1153
|
top: e.topPx + "px"
|
|
1142
1154
|
}),
|
|
1143
|
-
title:
|
|
1144
|
-
"aria-label":
|
|
1145
|
-
onClick:
|
|
1146
|
-
onMousedown:
|
|
1147
|
-
}, [
|
|
1155
|
+
title: q(t)("editor.showDocumentOutline"),
|
|
1156
|
+
"aria-label": q(t)("editor.showDocumentOutline"),
|
|
1157
|
+
onClick: i[0] ||= (e) => n.$emit("toggle"),
|
|
1158
|
+
onMousedown: i[1] ||= Y(() => {}, ["stop"])
|
|
1159
|
+
}, [z(r, {
|
|
1148
1160
|
name: "format_list_bulleted",
|
|
1149
1161
|
size: 20
|
|
1150
|
-
})], 44,
|
|
1162
|
+
})], 44, ni));
|
|
1151
1163
|
}
|
|
1152
|
-
}),
|
|
1164
|
+
}), ii = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
1153
1165
|
__name: "PageIndicator",
|
|
1154
1166
|
props: {
|
|
1155
1167
|
currentPage: {},
|
|
@@ -1157,18 +1169,18 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1157
1169
|
visible: { type: Boolean }
|
|
1158
1170
|
},
|
|
1159
1171
|
setup(e) {
|
|
1160
|
-
let { t } =
|
|
1161
|
-
return (n, r) => (
|
|
1172
|
+
let { t } = c();
|
|
1173
|
+
return (n, r) => (U(), I("div", {
|
|
1162
1174
|
class: "docx-editor-vue__page-indicator",
|
|
1163
|
-
style:
|
|
1175
|
+
style: H({ opacity: +!!e.visible }),
|
|
1164
1176
|
"aria-live": "polite",
|
|
1165
1177
|
role: "status"
|
|
1166
|
-
},
|
|
1178
|
+
}, K(q(t)("viewer.pageIndicator", {
|
|
1167
1179
|
current: e.currentPage,
|
|
1168
1180
|
total: e.totalPages
|
|
1169
1181
|
})), 5));
|
|
1170
1182
|
}
|
|
1171
|
-
}), [["__scopeId", "data-v-
|
|
1183
|
+
}), [["__scopeId", "data-v-877b9ee2"]]), ai = ["data-folio-block-id"], oi = ["data-folio-block-id", "title"], si = 2.5, ci = 5, li = 6, ui = 2, di = 2, fi = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
1172
1184
|
__name: "TemplateDirectivesOverlay",
|
|
1173
1185
|
props: {
|
|
1174
1186
|
getView: { type: Function },
|
|
@@ -1182,19 +1194,19 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1182
1194
|
setup(e) {
|
|
1183
1195
|
let t = e, n = new Set(["if", "each"]), r = new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
|
|
1184
1196
|
function a(e) {
|
|
1185
|
-
let t = e -
|
|
1186
|
-
return t <= 0 ? 0 : Math.floor(t /
|
|
1197
|
+
let t = e - li - si - ui;
|
|
1198
|
+
return t <= 0 ? 0 : Math.floor(t / ci);
|
|
1187
1199
|
}
|
|
1188
1200
|
function o(e, t, n) {
|
|
1189
1201
|
let r = a(n), i = Math.min(Math.max(0, e), r);
|
|
1190
|
-
return t -
|
|
1202
|
+
return t - li - si - (r - i) * ci;
|
|
1191
1203
|
}
|
|
1192
1204
|
function s(e, t) {
|
|
1193
|
-
if (t.length === 0) return e.bottom - e.top >=
|
|
1205
|
+
if (t.length === 0) return e.bottom - e.top >= di ? [e] : [];
|
|
1194
1206
|
let n = [];
|
|
1195
1207
|
for (let r of t) {
|
|
1196
1208
|
let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
|
|
1197
|
-
i - t >=
|
|
1209
|
+
i - t >= di && n.push({
|
|
1198
1210
|
top: t,
|
|
1199
1211
|
bottom: i
|
|
1200
1212
|
});
|
|
@@ -1259,7 +1271,7 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1259
1271
|
}
|
|
1260
1272
|
return i;
|
|
1261
1273
|
}
|
|
1262
|
-
let f =
|
|
1274
|
+
let f = W([]), p = W([]), m = W(null), h = W(null), g = W(null), _ = 0, v = null;
|
|
1263
1275
|
function y() {
|
|
1264
1276
|
v !== null && cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
1265
1277
|
v = null, b();
|
|
@@ -1271,12 +1283,12 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1271
1283
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1272
1284
|
return;
|
|
1273
1285
|
}
|
|
1274
|
-
let a =
|
|
1286
|
+
let a = bt(i);
|
|
1275
1287
|
if (a.length === 0) {
|
|
1276
1288
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1277
1289
|
return;
|
|
1278
1290
|
}
|
|
1279
|
-
let o =
|
|
1291
|
+
let o = Ke(r, t.zoom), s = await qe(a, {
|
|
1280
1292
|
pagesContainer: r,
|
|
1281
1293
|
zoom: t.zoom,
|
|
1282
1294
|
layout: t.layout,
|
|
@@ -1285,95 +1297,95 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1285
1297
|
});
|
|
1286
1298
|
e === _ && (f.value = a, h.value = i.selection.head, m.value = o, p.value = s);
|
|
1287
1299
|
}
|
|
1288
|
-
|
|
1300
|
+
J(() => [
|
|
1289
1301
|
t.editorState,
|
|
1290
1302
|
t.zoom,
|
|
1291
1303
|
t.layout,
|
|
1292
1304
|
t.blocks,
|
|
1293
1305
|
t.measures
|
|
1294
1306
|
], () => y());
|
|
1295
|
-
let x =
|
|
1307
|
+
let x = N(() => c(f.value)), ee = N(() => m.value ? d(x.value, p.value, m.value) : []), S = N(() => {
|
|
1296
1308
|
let e = /* @__PURE__ */ new Map();
|
|
1297
1309
|
for (let t of x.value) e.set(t.openerFrom, t.blockId), e.set(t.closerFrom, t.blockId);
|
|
1298
1310
|
return e;
|
|
1299
|
-
}),
|
|
1311
|
+
}), te = N(() => {
|
|
1300
1312
|
let e = /* @__PURE__ */ new Map();
|
|
1301
1313
|
for (let t of x.value) e.set(t.closerFrom, l(t.kind, t.openerExpr));
|
|
1302
1314
|
return e;
|
|
1303
|
-
}),
|
|
1304
|
-
function ne(e) {
|
|
1305
|
-
return e === g.value || e === te.value;
|
|
1306
|
-
}
|
|
1315
|
+
}), ne = N(() => u(x.value, h.value));
|
|
1307
1316
|
function re(e) {
|
|
1308
|
-
return e
|
|
1309
|
-
}
|
|
1310
|
-
function w(e) {
|
|
1311
|
-
return e.block ? C.value.get(e.from) : void 0;
|
|
1317
|
+
return e === g.value || e === ne.value;
|
|
1312
1318
|
}
|
|
1313
1319
|
function ie(e) {
|
|
1314
|
-
return e.block
|
|
1320
|
+
return e.block && (n.has(e.kind) || r.has(e.kind));
|
|
1321
|
+
}
|
|
1322
|
+
function C(e) {
|
|
1323
|
+
return e.block ? S.value.get(e.from) : void 0;
|
|
1315
1324
|
}
|
|
1316
1325
|
function ae(e) {
|
|
1317
|
-
|
|
1326
|
+
return e.block ? te.value.get(e.from) : void 0;
|
|
1327
|
+
}
|
|
1328
|
+
function oe(e) {
|
|
1329
|
+
let t = C(e), n = t !== void 0 && re(t);
|
|
1318
1330
|
return [
|
|
1319
1331
|
"folio-template-directive",
|
|
1320
1332
|
`folio-template-directive--${e.kind}`,
|
|
1321
|
-
{ "folio-template-directive--block":
|
|
1333
|
+
{ "folio-template-directive--block": ie(e) },
|
|
1322
1334
|
{ "folio-template-directive--active": n }
|
|
1323
1335
|
];
|
|
1324
1336
|
}
|
|
1325
|
-
function
|
|
1337
|
+
function w(e) {
|
|
1326
1338
|
if (!(e instanceof HTMLElement)) return null;
|
|
1327
1339
|
let t = e.dataset.folioBlockId;
|
|
1328
1340
|
return t === void 0 ? null : Number(t);
|
|
1329
1341
|
}
|
|
1330
|
-
function
|
|
1331
|
-
let t =
|
|
1342
|
+
function T(e) {
|
|
1343
|
+
let t = w(e.target);
|
|
1332
1344
|
t !== null && (g.value = t);
|
|
1333
1345
|
}
|
|
1334
|
-
function
|
|
1335
|
-
let t =
|
|
1346
|
+
function se(e) {
|
|
1347
|
+
let t = w(e.target);
|
|
1336
1348
|
if (t === null) return;
|
|
1337
|
-
let n =
|
|
1349
|
+
let n = w(e.relatedTarget);
|
|
1338
1350
|
n !== t && g.value === t && (g.value = n);
|
|
1339
1351
|
}
|
|
1340
|
-
return
|
|
1352
|
+
return Se(() => y()), xe(() => {
|
|
1341
1353
|
v !== null && (cancelAnimationFrame(v), v = null);
|
|
1342
|
-
}), (t, n) => (
|
|
1354
|
+
}), (t, n) => (U(), I("div", {
|
|
1343
1355
|
class: "folio-template-directives-overlay",
|
|
1344
1356
|
"data-folio-template-directives-overlay": "",
|
|
1345
|
-
onPointerover:
|
|
1346
|
-
onPointerout:
|
|
1347
|
-
}, [(
|
|
1357
|
+
onPointerover: T,
|
|
1358
|
+
onPointerout: se
|
|
1359
|
+
}, [(U(!0), I(M, null, G(ee.value, (t) => (U(), I(M, { key: `rail:${t.blockId}` }, [(U(!0), I(M, null, G(t.segments, (n, r) => (U(), I("div", {
|
|
1348
1360
|
key: `rail:${t.blockId}:${r}`,
|
|
1349
|
-
class:
|
|
1361
|
+
class: V([
|
|
1350
1362
|
"folio-template-band-rail",
|
|
1351
1363
|
`folio-template-band-rail--${t.kind}`,
|
|
1352
|
-
{ "folio-template-band-rail--active":
|
|
1364
|
+
{ "folio-template-band-rail--active": re(t.blockId) }
|
|
1353
1365
|
]),
|
|
1354
1366
|
"data-folio-block-id": t.blockId,
|
|
1355
|
-
style:
|
|
1367
|
+
style: H({
|
|
1356
1368
|
position: "absolute",
|
|
1357
1369
|
left: `${t.railX * e.zoom}px`,
|
|
1358
1370
|
top: `${n.top * e.zoom}px`,
|
|
1359
|
-
width: `${
|
|
1371
|
+
width: `${si * e.zoom}px`,
|
|
1360
1372
|
height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
|
|
1361
1373
|
})
|
|
1362
|
-
}, null, 14,
|
|
1374
|
+
}, null, 14, ai))), 128))], 64))), 128)), (U(!0), I(M, null, G(p.value, (t, n) => (U(), I(M, { key: `d:${n}` }, [(U(!0), I(M, null, G(t.rects, (r, i) => (U(), I("span", {
|
|
1363
1375
|
key: `d:${n}:${i}`,
|
|
1364
|
-
class:
|
|
1365
|
-
"data-folio-block-id":
|
|
1366
|
-
title:
|
|
1367
|
-
style:
|
|
1376
|
+
class: V(oe(t.range)),
|
|
1377
|
+
"data-folio-block-id": C(t.range),
|
|
1378
|
+
title: ae(t.range),
|
|
1379
|
+
style: H({
|
|
1368
1380
|
position: "absolute",
|
|
1369
1381
|
left: `${(r.x - 1) * e.zoom}px`,
|
|
1370
1382
|
top: `${(r.y + 1) * e.zoom}px`,
|
|
1371
1383
|
width: `${(r.width + 2) * e.zoom}px`,
|
|
1372
1384
|
height: `${Math.max(0, r.height - 2) * e.zoom}px`
|
|
1373
1385
|
})
|
|
1374
|
-
}, null, 14,
|
|
1386
|
+
}, null, 14, oi))), 128))], 64))), 128))], 32));
|
|
1375
1387
|
}
|
|
1376
|
-
}), [["__scopeId", "data-v-142d2ac6"]]),
|
|
1388
|
+
}), [["__scopeId", "data-v-142d2ac6"]]), pi = ["href", "title"], mi = ["title"], hi = ["title"], gi = ["title"], _i = { class: "docx-hyperlink-popup__edit-row" }, vi = ["placeholder", "onKeydown"], yi = { class: "docx-hyperlink-popup__edit-row" }, bi = ["onKeydown"], xi = ["disabled"], Si = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
1377
1389
|
__name: "HyperlinkPopup",
|
|
1378
1390
|
props: {
|
|
1379
1391
|
data: {},
|
|
@@ -1387,69 +1399,69 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1387
1399
|
"close"
|
|
1388
1400
|
],
|
|
1389
1401
|
setup(e, { emit: t }) {
|
|
1390
|
-
let { t: n } =
|
|
1391
|
-
left: (
|
|
1392
|
-
top: (
|
|
1402
|
+
let { t: n } = c(), r = e, i = t, a = W(!1), o = W(""), s = W(""), l = W(null), u = N(() => ({
|
|
1403
|
+
left: (r.data?.position.left ?? 0) + "px",
|
|
1404
|
+
top: (r.data?.position.top ?? 0) + "px"
|
|
1393
1405
|
}));
|
|
1394
|
-
|
|
1395
|
-
|
|
1406
|
+
J(() => r.data?.href, () => {
|
|
1407
|
+
a.value = !1;
|
|
1396
1408
|
});
|
|
1397
1409
|
let d = null, f = null;
|
|
1398
1410
|
function p() {
|
|
1399
1411
|
f &&= (clearTimeout(f), null), d &&= (document.removeEventListener("mousedown", d), null);
|
|
1400
1412
|
}
|
|
1401
|
-
|
|
1413
|
+
J(() => r.data, (e) => {
|
|
1402
1414
|
p(), e && (d = (e) => {
|
|
1403
1415
|
let t = l.value, n = e.target;
|
|
1404
|
-
t && n instanceof Node && !t.contains(n) &&
|
|
1416
|
+
t && n instanceof Node && !t.contains(n) && i("close");
|
|
1405
1417
|
}, f = setTimeout(() => {
|
|
1406
1418
|
d && document.addEventListener("mousedown", d);
|
|
1407
1419
|
}, 0));
|
|
1408
|
-
}, { immediate: !0 }),
|
|
1420
|
+
}, { immediate: !0 }), xe(p);
|
|
1409
1421
|
function m() {
|
|
1410
|
-
|
|
1422
|
+
r.data && (o.value = r.data.displayText, s.value = r.data.href, a.value = !0);
|
|
1411
1423
|
}
|
|
1412
1424
|
function h() {
|
|
1413
|
-
|
|
1425
|
+
s.value.trim() && (i("edit", o.value, s.value), a.value = !1);
|
|
1414
1426
|
}
|
|
1415
1427
|
function g() {
|
|
1416
|
-
|
|
1428
|
+
r.data && (i("copy", r.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(r.data.href).catch(() => {}));
|
|
1417
1429
|
}
|
|
1418
|
-
return (t, r) => e.data ? (
|
|
1430
|
+
return (t, r) => e.data ? (U(), I("div", {
|
|
1419
1431
|
key: 0,
|
|
1420
1432
|
ref_key: "popupRef",
|
|
1421
1433
|
ref: l,
|
|
1422
|
-
class:
|
|
1423
|
-
style:
|
|
1434
|
+
class: V(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
|
|
1435
|
+
style: H(u.value),
|
|
1424
1436
|
onMousedown: r[6] ||= Y(() => {}, ["stop"])
|
|
1425
|
-
}, [
|
|
1437
|
+
}, [a.value ? (U(), I(M, { key: 1 }, [L("div", _i, [Oe(L("input", {
|
|
1426
1438
|
class: "docx-hyperlink-popup__input",
|
|
1427
|
-
placeholder:
|
|
1428
|
-
"onUpdate:modelValue": r[2] ||= (e) =>
|
|
1429
|
-
onKeydown: [
|
|
1430
|
-
}, null, 40,
|
|
1439
|
+
placeholder: q(n)("displayText"),
|
|
1440
|
+
"onUpdate:modelValue": r[2] ||= (e) => o.value = e,
|
|
1441
|
+
onKeydown: [ke(Y(h, ["prevent"]), ["enter"]), r[3] ||= ke((e) => t.$emit("close"), ["esc"])]
|
|
1442
|
+
}, null, 40, vi), [[Ee, o.value]])]), L("div", yi, [Oe(L("input", {
|
|
1431
1443
|
class: "docx-hyperlink-popup__input",
|
|
1432
1444
|
placeholder: "https://...",
|
|
1433
|
-
"onUpdate:modelValue": r[4] ||= (e) =>
|
|
1434
|
-
onKeydown: [
|
|
1435
|
-
}, null, 40,
|
|
1445
|
+
"onUpdate:modelValue": r[4] ||= (e) => s.value = e,
|
|
1446
|
+
onKeydown: [ke(Y(h, ["prevent"]), ["enter"]), r[5] ||= ke((e) => t.$emit("close"), ["esc"])]
|
|
1447
|
+
}, null, 40, bi), [[Ee, s.value]]), L("button", {
|
|
1436
1448
|
class: "docx-hyperlink-popup__apply",
|
|
1437
|
-
disabled: !
|
|
1449
|
+
disabled: !s.value.trim(),
|
|
1438
1450
|
onClick: Y(h, ["prevent"])
|
|
1439
|
-
},
|
|
1440
|
-
r[10] ||=
|
|
1441
|
-
|
|
1451
|
+
}, K(q(n)("common.apply")), 9, xi)])], 64)) : (U(), I(M, { key: 0 }, [
|
|
1452
|
+
r[10] ||= ge("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-8bc31a34><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-8bc31a34><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-8bc31a34></circle><path d=\"M2 12h20\" data-v-8bc31a34></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-8bc31a34></path></svg></span>", 1),
|
|
1453
|
+
L("a", {
|
|
1442
1454
|
class: "docx-hyperlink-popup__url",
|
|
1443
1455
|
href: e.data.href,
|
|
1444
1456
|
title: e.data.href,
|
|
1445
1457
|
onClick: r[0] ||= Y((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1446
|
-
},
|
|
1447
|
-
r[11] ||=
|
|
1448
|
-
|
|
1458
|
+
}, K(e.data.href), 9, pi),
|
|
1459
|
+
r[11] ||= L("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1460
|
+
L("button", {
|
|
1449
1461
|
class: "docx-hyperlink-popup__btn",
|
|
1450
|
-
title:
|
|
1462
|
+
title: q(n)("copyLink"),
|
|
1451
1463
|
onClick: Y(g, ["prevent"])
|
|
1452
|
-
}, [...r[7] ||= [
|
|
1464
|
+
}, [...r[7] ||= [L("svg", {
|
|
1453
1465
|
width: "18",
|
|
1454
1466
|
height: "18",
|
|
1455
1467
|
viewBox: "0 0 24 24",
|
|
@@ -1458,20 +1470,20 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1458
1470
|
"stroke-width": "2",
|
|
1459
1471
|
"stroke-linecap": "round",
|
|
1460
1472
|
"stroke-linejoin": "round"
|
|
1461
|
-
}, [
|
|
1473
|
+
}, [L("rect", {
|
|
1462
1474
|
x: "9",
|
|
1463
1475
|
y: "9",
|
|
1464
1476
|
width: "13",
|
|
1465
1477
|
height: "13",
|
|
1466
1478
|
rx: "2",
|
|
1467
1479
|
ry: "2"
|
|
1468
|
-
}),
|
|
1469
|
-
e.readOnly ?
|
|
1480
|
+
}), L("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, mi),
|
|
1481
|
+
e.readOnly ? F("", !0) : (U(), I("button", {
|
|
1470
1482
|
key: 0,
|
|
1471
1483
|
class: "docx-hyperlink-popup__btn",
|
|
1472
|
-
title:
|
|
1484
|
+
title: q(n)("editLink"),
|
|
1473
1485
|
onClick: Y(m, ["prevent"])
|
|
1474
|
-
}, [...r[8] ||= [
|
|
1486
|
+
}, [...r[8] ||= [L("svg", {
|
|
1475
1487
|
width: "18",
|
|
1476
1488
|
height: "18",
|
|
1477
1489
|
viewBox: "0 0 24 24",
|
|
@@ -1480,44 +1492,44 @@ var kr = ["data-handle", "onMousedown"], Ar = ["title"], jr = {
|
|
|
1480
1492
|
"stroke-width": "2",
|
|
1481
1493
|
"stroke-linecap": "round",
|
|
1482
1494
|
"stroke-linejoin": "round"
|
|
1483
|
-
}, [
|
|
1484
|
-
e.readOnly ?
|
|
1495
|
+
}, [L("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), L("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, hi)),
|
|
1496
|
+
e.readOnly ? F("", !0) : (U(), I("button", {
|
|
1485
1497
|
key: 1,
|
|
1486
1498
|
class: "docx-hyperlink-popup__btn",
|
|
1487
|
-
title:
|
|
1499
|
+
title: q(n)("removeLink"),
|
|
1488
1500
|
onClick: r[1] ||= Y((e) => t.$emit("remove"), ["prevent"])
|
|
1489
|
-
}, [...r[9] ||= [
|
|
1490
|
-
], 64))], 38)) :
|
|
1501
|
+
}, [...r[9] ||= [ge("<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-8bc31a34><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-8bc31a34></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-8bc31a34></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-8bc31a34></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-8bc31a34></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-8bc31a34></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-8bc31a34></line></svg>", 1)]], 8, gi))
|
|
1502
|
+
], 64))], 38)) : F("", !0);
|
|
1491
1503
|
}
|
|
1492
|
-
}), [["__scopeId", "data-v-
|
|
1504
|
+
}), [["__scopeId", "data-v-8bc31a34"]]);
|
|
1493
1505
|
//#endregion
|
|
1494
1506
|
//#region src/composables/commentMarks.ts
|
|
1495
|
-
function
|
|
1507
|
+
function Ci(e, t) {
|
|
1496
1508
|
let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
|
|
1497
1509
|
return n === r ? null : {
|
|
1498
1510
|
from: n,
|
|
1499
1511
|
to: r
|
|
1500
1512
|
};
|
|
1501
1513
|
}
|
|
1502
|
-
function
|
|
1514
|
+
function wi({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
|
|
1503
1515
|
let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
|
|
1504
|
-
return i ?
|
|
1516
|
+
return i ? Ci(e, i) : null;
|
|
1505
1517
|
}
|
|
1506
|
-
function
|
|
1507
|
-
let i = e.state.schema.marks.comment, a =
|
|
1518
|
+
function Ti(e, t, n, r) {
|
|
1519
|
+
let i = e.state.schema.marks.comment, a = Ci(e.state.doc.content.size, t);
|
|
1508
1520
|
if (!i || !a) return !1;
|
|
1509
1521
|
let o = e.state.tr;
|
|
1510
|
-
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId:
|
|
1522
|
+
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: wt }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(et.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
|
|
1511
1523
|
}
|
|
1512
|
-
function
|
|
1513
|
-
let n = e.state.schema.marks.comment, r =
|
|
1514
|
-
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId:
|
|
1524
|
+
function Ei(e, t) {
|
|
1525
|
+
let n = e.state.schema.marks.comment, r = Ci(e.state.doc.content.size, t);
|
|
1526
|
+
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: wt })));
|
|
1515
1527
|
}
|
|
1516
1528
|
//#endregion
|
|
1517
1529
|
//#region src/composables/useCommentLifecycle.ts
|
|
1518
|
-
var
|
|
1519
|
-
function
|
|
1520
|
-
let t =
|
|
1530
|
+
var Di = 408, Oi = 12;
|
|
1531
|
+
function ki(e) {
|
|
1532
|
+
let t = W(!1), n = W(null), r = W(null), i = W(null), a = W(null);
|
|
1521
1533
|
function o(t) {
|
|
1522
1534
|
let n = e.editorView.value, r = e.pagesContainer.value;
|
|
1523
1535
|
if (!n || !r) return null;
|
|
@@ -1549,7 +1561,7 @@ function di(e) {
|
|
|
1549
1561
|
r.value = null;
|
|
1550
1562
|
return;
|
|
1551
1563
|
}
|
|
1552
|
-
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left +
|
|
1564
|
+
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + Oi : l.width / 2 + Di;
|
|
1553
1565
|
r.value = {
|
|
1554
1566
|
top: c.top - l.top,
|
|
1555
1567
|
left: Math.max(16, Math.min(d, l.width - 16)),
|
|
@@ -1560,7 +1572,7 @@ function di(e) {
|
|
|
1560
1572
|
function c() {
|
|
1561
1573
|
let s = e.editorView.value;
|
|
1562
1574
|
if (!s) return;
|
|
1563
|
-
let c = r.value, l = s.state.selection, u =
|
|
1575
|
+
let c = r.value, l = s.state.selection, u = wi({
|
|
1564
1576
|
docSize: s.state.doc.content.size,
|
|
1565
1577
|
capturedRange: c ? {
|
|
1566
1578
|
from: c.from,
|
|
@@ -1579,7 +1591,7 @@ function di(e) {
|
|
|
1579
1591
|
r.value = null;
|
|
1580
1592
|
return;
|
|
1581
1593
|
}
|
|
1582
|
-
if (!
|
|
1594
|
+
if (!Ti(s, u, wt, { selectEnd: !0 })) {
|
|
1583
1595
|
r.value = null, i.value = null;
|
|
1584
1596
|
return;
|
|
1585
1597
|
}
|
|
@@ -1592,11 +1604,11 @@ function di(e) {
|
|
|
1592
1604
|
let n = e.editorView.value, r = i.value;
|
|
1593
1605
|
if (!n || !r) return !1;
|
|
1594
1606
|
let a = e.createComment(t);
|
|
1595
|
-
return
|
|
1607
|
+
return Ti(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
|
|
1596
1608
|
}
|
|
1597
1609
|
function d() {
|
|
1598
1610
|
let t = e.editorView.value;
|
|
1599
|
-
t && i.value &&
|
|
1611
|
+
t && i.value && Ei(t, i.value), l();
|
|
1600
1612
|
}
|
|
1601
1613
|
return {
|
|
1602
1614
|
isAddingComment: t,
|
|
@@ -1610,15 +1622,15 @@ function di(e) {
|
|
|
1610
1622
|
}
|
|
1611
1623
|
//#endregion
|
|
1612
1624
|
//#region src/composables/useCommentManagement.ts
|
|
1613
|
-
function
|
|
1614
|
-
let t =
|
|
1625
|
+
function Ai(e) {
|
|
1626
|
+
let t = Tt(), n = W([]), r = W(!1);
|
|
1615
1627
|
function i() {
|
|
1616
1628
|
r.value = !0;
|
|
1617
1629
|
}
|
|
1618
1630
|
function a() {
|
|
1619
1631
|
r.value = !1;
|
|
1620
1632
|
}
|
|
1621
|
-
let o =
|
|
1633
|
+
let o = N(() => e.commentsProp() !== void 0), s = N(() => o.value ? e.commentsProp() ?? [] : n.value);
|
|
1622
1634
|
function c(t) {
|
|
1623
1635
|
o.value || (n.value = t), e.onCommentsChange(t);
|
|
1624
1636
|
}
|
|
@@ -1626,12 +1638,12 @@ function fi(e) {
|
|
|
1626
1638
|
i(), c([...s.value, e]);
|
|
1627
1639
|
}
|
|
1628
1640
|
function u(n, r) {
|
|
1629
|
-
return
|
|
1641
|
+
return Et(t, s.value, e.editorView.value), Dt(t, n, e.author(), r);
|
|
1630
1642
|
}
|
|
1631
1643
|
function d() {
|
|
1632
1644
|
if (a(), o.value) return;
|
|
1633
1645
|
let n = e.getDocument()?.package.document.comments;
|
|
1634
|
-
|
|
1646
|
+
Et(t, n, e.editorView.value), c(n && n.length > 0 ? n : []);
|
|
1635
1647
|
}
|
|
1636
1648
|
function f(e, t) {
|
|
1637
1649
|
l(u(t, e));
|
|
@@ -1657,8 +1669,8 @@ function fi(e) {
|
|
|
1657
1669
|
function _(t, n) {
|
|
1658
1670
|
let r = e.editorView.value;
|
|
1659
1671
|
if (!r) return;
|
|
1660
|
-
let i =
|
|
1661
|
-
i && (n ?
|
|
1672
|
+
let i = Ot(r, t);
|
|
1673
|
+
i && (n ? At : Nt)(i.from, i.to)(r.state, r.dispatch);
|
|
1662
1674
|
}
|
|
1663
1675
|
function v(e) {
|
|
1664
1676
|
_(e, !0);
|
|
@@ -1668,15 +1680,15 @@ function fi(e) {
|
|
|
1668
1680
|
}
|
|
1669
1681
|
function b(t, n) {
|
|
1670
1682
|
let r = e.editorView.value;
|
|
1671
|
-
r &&
|
|
1683
|
+
r && At(t, n)(r.state, r.dispatch);
|
|
1672
1684
|
}
|
|
1673
1685
|
function x(t, n) {
|
|
1674
1686
|
let r = e.editorView.value;
|
|
1675
|
-
r &&
|
|
1687
|
+
r && Nt(t, n)(r.state, r.dispatch);
|
|
1676
1688
|
}
|
|
1677
1689
|
return {
|
|
1678
1690
|
comments: s,
|
|
1679
|
-
commentsDirty:
|
|
1691
|
+
commentsDirty: N(() => r.value),
|
|
1680
1692
|
clearCommentsDirty: a,
|
|
1681
1693
|
createComment: u,
|
|
1682
1694
|
pushComment: l,
|
|
@@ -1695,8 +1707,8 @@ function fi(e) {
|
|
|
1695
1707
|
}
|
|
1696
1708
|
//#endregion
|
|
1697
1709
|
//#region src/utils/imageClipboard.ts
|
|
1698
|
-
function
|
|
1699
|
-
let r =
|
|
1710
|
+
function ji(e, t, n) {
|
|
1711
|
+
let r = Pt(e.state), i = e.state.schema.marks.insertion;
|
|
1700
1712
|
if (!r || !i) return;
|
|
1701
1713
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
1702
1714
|
o < 0 || t.addMark(o, a, i.create({
|
|
@@ -1705,7 +1717,7 @@ function pi(e, t, n) {
|
|
|
1705
1717
|
date: r.date
|
|
1706
1718
|
}));
|
|
1707
1719
|
}
|
|
1708
|
-
function
|
|
1720
|
+
function Mi(e, t) {
|
|
1709
1721
|
let n = e.state.doc.nodeAt(t);
|
|
1710
1722
|
if (!n || n.type.name !== "image") return;
|
|
1711
1723
|
let r = n.attrs.src;
|
|
@@ -1719,7 +1731,7 @@ function mi(e, t) {
|
|
|
1719
1731
|
e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
1720
1732
|
});
|
|
1721
1733
|
}
|
|
1722
|
-
function
|
|
1734
|
+
function Ni(e) {
|
|
1723
1735
|
return new Promise((t, n) => {
|
|
1724
1736
|
let r = new FileReader();
|
|
1725
1737
|
r.onload = () => {
|
|
@@ -1727,7 +1739,7 @@ function hi(e) {
|
|
|
1727
1739
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
|
|
1728
1740
|
});
|
|
1729
1741
|
}
|
|
1730
|
-
function
|
|
1742
|
+
function Pi(e) {
|
|
1731
1743
|
return new Promise((t) => {
|
|
1732
1744
|
let n = new Image();
|
|
1733
1745
|
n.onload = () => t({
|
|
@@ -1739,7 +1751,7 @@ function gi(e) {
|
|
|
1739
1751
|
}), n.src = e;
|
|
1740
1752
|
});
|
|
1741
1753
|
}
|
|
1742
|
-
function
|
|
1754
|
+
function Fi(e, t, n, r) {
|
|
1743
1755
|
let i = e.state.schema.nodes.image;
|
|
1744
1756
|
if (!i) return;
|
|
1745
1757
|
let a = i.create({
|
|
@@ -1750,23 +1762,23 @@ function _i(e, t, n, r) {
|
|
|
1750
1762
|
wrapType: "inline",
|
|
1751
1763
|
displayMode: "inline"
|
|
1752
1764
|
}), o = e.state.tr.replaceSelectionWith(a);
|
|
1753
|
-
|
|
1765
|
+
ji(e, o, a), e.dispatch(o);
|
|
1754
1766
|
}
|
|
1755
|
-
async function
|
|
1767
|
+
async function Ii(e) {
|
|
1756
1768
|
try {
|
|
1757
1769
|
let t = await navigator.clipboard.read();
|
|
1758
1770
|
for (let n of t) {
|
|
1759
1771
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
1760
1772
|
if (t) {
|
|
1761
|
-
let r = await
|
|
1762
|
-
a > 612 && (o = Math.round(612 / a * o), a = 612),
|
|
1773
|
+
let r = await Ni(await n.getType(t)), i = await Pi(r), a = i.width, o = i.height;
|
|
1774
|
+
a > 612 && (o = Math.round(612 / a * o), a = 612), Fi(e, r, a, o);
|
|
1763
1775
|
return;
|
|
1764
1776
|
}
|
|
1765
1777
|
if (n.types.includes("text/html")) {
|
|
1766
1778
|
let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
|
|
1767
1779
|
if (r) {
|
|
1768
1780
|
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;
|
|
1769
|
-
|
|
1781
|
+
Fi(e, r, a || 200, o || 200);
|
|
1770
1782
|
return;
|
|
1771
1783
|
}
|
|
1772
1784
|
}
|
|
@@ -1787,14 +1799,14 @@ async function vi(e) {
|
|
|
1787
1799
|
}
|
|
1788
1800
|
}
|
|
1789
1801
|
}
|
|
1790
|
-
function
|
|
1802
|
+
function Li(e, t) {
|
|
1791
1803
|
let n = e.state.doc.nodeAt(t);
|
|
1792
1804
|
if (!n || n.type.name !== "image") return;
|
|
1793
1805
|
let r = document.createElement("input");
|
|
1794
1806
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
1795
1807
|
let i = r.files?.[0];
|
|
1796
1808
|
if (!i) return;
|
|
1797
|
-
let a = await
|
|
1809
|
+
let a = await Ni(i), o = await Pi(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);
|
|
1798
1810
|
try {
|
|
1799
1811
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
1800
1812
|
...n.attrs,
|
|
@@ -1809,7 +1821,7 @@ function yi(e, t) {
|
|
|
1809
1821
|
}
|
|
1810
1822
|
//#endregion
|
|
1811
1823
|
//#region src/composables/useContextMenus.ts
|
|
1812
|
-
var
|
|
1824
|
+
var Ri = new Set([
|
|
1813
1825
|
"inline",
|
|
1814
1826
|
"square",
|
|
1815
1827
|
"tight",
|
|
@@ -1818,17 +1830,17 @@ var bi = new Set([
|
|
|
1818
1830
|
"behind",
|
|
1819
1831
|
"inFront"
|
|
1820
1832
|
]);
|
|
1821
|
-
function
|
|
1822
|
-
return typeof e == "string" &&
|
|
1833
|
+
function zi(e) {
|
|
1834
|
+
return typeof e == "string" && Ri.has(e);
|
|
1823
1835
|
}
|
|
1824
|
-
function
|
|
1825
|
-
return
|
|
1836
|
+
function Bi(e) {
|
|
1837
|
+
return zi(e) ? e : "inline";
|
|
1826
1838
|
}
|
|
1827
|
-
function
|
|
1839
|
+
function Vi(e) {
|
|
1828
1840
|
return e === "left" || e === "right" || e === "none" ? e : null;
|
|
1829
1841
|
}
|
|
1830
|
-
function
|
|
1831
|
-
let { t } =
|
|
1842
|
+
function Hi(e) {
|
|
1843
|
+
let { t } = c(), n = W({
|
|
1832
1844
|
isOpen: !1,
|
|
1833
1845
|
position: {
|
|
1834
1846
|
x: 0,
|
|
@@ -1839,10 +1851,10 @@ function wi(e) {
|
|
|
1839
1851
|
onImage: !1,
|
|
1840
1852
|
canMergeCells: !1,
|
|
1841
1853
|
canSplitCell: !1
|
|
1842
|
-
}),
|
|
1854
|
+
}), r = W(null), i = W({
|
|
1843
1855
|
from: 0,
|
|
1844
1856
|
to: 0
|
|
1845
|
-
}),
|
|
1857
|
+
}), a = N(() => (e.customContextMenuItems?.() ?? []).filter((e) => !e.requiresSelection || n.value.hasSelection)), o = N(() => [
|
|
1846
1858
|
{
|
|
1847
1859
|
action: "cut",
|
|
1848
1860
|
label: t("contextMenu.cut"),
|
|
@@ -1865,11 +1877,11 @@ function wi(e) {
|
|
|
1865
1877
|
shortcut: t("contextMenu.deleteShortcut")
|
|
1866
1878
|
}
|
|
1867
1879
|
]);
|
|
1868
|
-
function
|
|
1880
|
+
function s(e, t) {
|
|
1869
1881
|
t(e.state, (t) => e.dispatch(t), e);
|
|
1870
1882
|
}
|
|
1871
1883
|
function l(t, n, r, i, a) {
|
|
1872
|
-
let o = i === "inline" ?
|
|
1884
|
+
let o = i === "inline" ? it(t, e.zoom.value) : void 0;
|
|
1873
1885
|
return {
|
|
1874
1886
|
open: !0,
|
|
1875
1887
|
position: r,
|
|
@@ -1880,43 +1892,43 @@ function wi(e) {
|
|
|
1880
1892
|
};
|
|
1881
1893
|
}
|
|
1882
1894
|
function u(t) {
|
|
1883
|
-
let
|
|
1884
|
-
if (!
|
|
1885
|
-
let o =
|
|
1895
|
+
let a = e.editorView.value;
|
|
1896
|
+
if (!a) return;
|
|
1897
|
+
let o = ot(t.target);
|
|
1886
1898
|
if (o) {
|
|
1887
|
-
let
|
|
1888
|
-
if (!Number.isNaN(
|
|
1899
|
+
let i = Number(o.dataset.pmStart);
|
|
1900
|
+
if (!Number.isNaN(i)) {
|
|
1889
1901
|
try {
|
|
1890
|
-
let e =
|
|
1891
|
-
|
|
1902
|
+
let e = Z.create(a.state.doc, i);
|
|
1903
|
+
a.dispatch(a.state.tr.setSelection(e));
|
|
1892
1904
|
} catch {}
|
|
1893
1905
|
e.selectedImage.value = {
|
|
1894
1906
|
element: o,
|
|
1895
|
-
pmPos:
|
|
1907
|
+
pmPos: i,
|
|
1896
1908
|
width: o.offsetWidth,
|
|
1897
1909
|
height: o.offsetHeight
|
|
1898
1910
|
}, e.clearOverlay();
|
|
1899
|
-
let s =
|
|
1911
|
+
let s = a.state.doc.nodeAt(i);
|
|
1900
1912
|
if (s && s.type.name === "image") {
|
|
1901
|
-
|
|
1913
|
+
r.value = l(o, i, {
|
|
1902
1914
|
x: t.clientX,
|
|
1903
1915
|
y: t.clientY
|
|
1904
|
-
},
|
|
1916
|
+
}, Bi(s.attrs.wrapType), Vi(s.attrs.cssFloat)), n.value.isOpen = !1;
|
|
1905
1917
|
return;
|
|
1906
1918
|
}
|
|
1907
1919
|
}
|
|
1908
1920
|
}
|
|
1909
1921
|
{
|
|
1910
|
-
let { from: n, to:
|
|
1911
|
-
if (
|
|
1912
|
-
e.setPmSelection(
|
|
1922
|
+
let { from: n, to: r } = a.state.selection, i = e.resolvePos(t.clientX, t.clientY);
|
|
1923
|
+
if (i !== null && (i < n || i > r)) try {
|
|
1924
|
+
e.setPmSelection(i);
|
|
1913
1925
|
} catch {}
|
|
1914
1926
|
}
|
|
1915
|
-
let s =
|
|
1916
|
-
|
|
1927
|
+
let s = Ct(a.state), { empty: c, from: u, to: d } = a.state.selection;
|
|
1928
|
+
i.value = {
|
|
1917
1929
|
from: u,
|
|
1918
1930
|
to: d
|
|
1919
|
-
},
|
|
1931
|
+
}, r.value &&= null, n.value = {
|
|
1920
1932
|
isOpen: !0,
|
|
1921
1933
|
position: {
|
|
1922
1934
|
x: t.clientX,
|
|
@@ -1930,46 +1942,46 @@ function wi(e) {
|
|
|
1930
1942
|
};
|
|
1931
1943
|
}
|
|
1932
1944
|
function d(t) {
|
|
1933
|
-
let
|
|
1934
|
-
if (!
|
|
1935
|
-
let o =
|
|
1936
|
-
!o || o.type.name !== "image" || (
|
|
1945
|
+
let i = e.editorView.value, a = e.selectedImage.value;
|
|
1946
|
+
if (!i || !a) return;
|
|
1947
|
+
let o = i.state.doc.nodeAt(a.pmPos);
|
|
1948
|
+
!o || o.type.name !== "image" || (r.value = l(a.element, a.pmPos, {
|
|
1937
1949
|
x: t.clientX,
|
|
1938
1950
|
y: t.clientY
|
|
1939
|
-
},
|
|
1951
|
+
}, Bi(o.attrs.wrapType), Vi(o.attrs.cssFloat)), n.value.isOpen = !1);
|
|
1940
1952
|
}
|
|
1941
1953
|
function f(t) {
|
|
1942
|
-
let n = e.editorView.value,
|
|
1943
|
-
if (!n || !
|
|
1944
|
-
let a =
|
|
1945
|
-
o && (
|
|
1954
|
+
let n = e.editorView.value, i = r.value;
|
|
1955
|
+
if (!n || !i) return;
|
|
1956
|
+
let a = i.inlinePositionEmu && t !== "inline" ? { initialPositionEmu: i.inlinePositionEmu } : void 0, o = e.getCommands().setImageWrapType;
|
|
1957
|
+
o && (s(n, o(i.pmPos, t, a)), n.focus());
|
|
1946
1958
|
}
|
|
1947
1959
|
function p(t) {
|
|
1948
1960
|
let n = e.editorView.value;
|
|
1949
1961
|
if (!n) return;
|
|
1950
1962
|
let r = e.getCommands();
|
|
1951
1963
|
if (t.startsWith("custom:")) {
|
|
1952
|
-
let r =
|
|
1964
|
+
let r = i.value, a = r.from === r.to ? {
|
|
1953
1965
|
from: n.state.selection.from,
|
|
1954
1966
|
to: n.state.selection.to
|
|
1955
1967
|
} : r;
|
|
1956
|
-
e.onCustomContextAction?.(t.slice(7),
|
|
1968
|
+
e.onCustomContextAction?.(t.slice(7), a), n.focus();
|
|
1957
1969
|
return;
|
|
1958
1970
|
}
|
|
1959
1971
|
switch (t) {
|
|
1960
1972
|
case "cut":
|
|
1961
1973
|
if (e.selectedImage.value) {
|
|
1962
1974
|
let t = e.selectedImage.value.pmPos;
|
|
1963
|
-
|
|
1975
|
+
Mi(n, t);
|
|
1964
1976
|
let r = n.state.doc.nodeAt(t);
|
|
1965
1977
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
|
|
1966
1978
|
} else n.focus(), document.execCommand("cut");
|
|
1967
1979
|
break;
|
|
1968
1980
|
case "copy":
|
|
1969
|
-
e.selectedImage.value ?
|
|
1981
|
+
e.selectedImage.value ? Mi(n, e.selectedImage.value.pmPos) : (n.focus(), document.execCommand("copy"));
|
|
1970
1982
|
break;
|
|
1971
1983
|
case "paste":
|
|
1972
|
-
|
|
1984
|
+
Ii(n);
|
|
1973
1985
|
break;
|
|
1974
1986
|
case "pasteAsPlainText":
|
|
1975
1987
|
navigator.clipboard.readText().then((e) => {
|
|
@@ -1982,7 +1994,7 @@ function wi(e) {
|
|
|
1982
1994
|
break;
|
|
1983
1995
|
}
|
|
1984
1996
|
case "selectAll": {
|
|
1985
|
-
let e =
|
|
1997
|
+
let e = tt.create(n.state.doc, 0, n.state.doc.content.size);
|
|
1986
1998
|
n.dispatch(n.state.tr.setSelection(e));
|
|
1987
1999
|
break;
|
|
1988
2000
|
}
|
|
@@ -1990,7 +2002,7 @@ function wi(e) {
|
|
|
1990
2002
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
1991
2003
|
break;
|
|
1992
2004
|
case "replaceImage":
|
|
1993
|
-
e.selectedImage.value &&
|
|
2005
|
+
e.selectedImage.value && Li(n, e.selectedImage.value.pmPos);
|
|
1994
2006
|
break;
|
|
1995
2007
|
case "deleteImage":
|
|
1996
2008
|
if (e.selectedImage.value) {
|
|
@@ -2009,7 +2021,7 @@ function wi(e) {
|
|
|
2009
2021
|
case "selectTable":
|
|
2010
2022
|
case "deleteTable": {
|
|
2011
2023
|
let e = r[t];
|
|
2012
|
-
e &&
|
|
2024
|
+
e && s(n, e());
|
|
2013
2025
|
break;
|
|
2014
2026
|
}
|
|
2015
2027
|
}
|
|
@@ -2017,9 +2029,9 @@ function wi(e) {
|
|
|
2017
2029
|
}
|
|
2018
2030
|
return {
|
|
2019
2031
|
contextMenu: n,
|
|
2020
|
-
imageContextMenu:
|
|
2021
|
-
imageContextMenuTextActions:
|
|
2022
|
-
customTextMenuItems:
|
|
2032
|
+
imageContextMenu: r,
|
|
2033
|
+
imageContextMenuTextActions: o,
|
|
2034
|
+
customTextMenuItems: a,
|
|
2023
2035
|
handleContextMenu: u,
|
|
2024
2036
|
handleSelectedImageContextMenu: d,
|
|
2025
2037
|
handleImageWrapSelect: f,
|
|
@@ -2028,51 +2040,61 @@ function wi(e) {
|
|
|
2028
2040
|
}
|
|
2029
2041
|
//#endregion
|
|
2030
2042
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2031
|
-
function
|
|
2043
|
+
function Ui(e) {
|
|
2032
2044
|
async function t(t) {
|
|
2033
2045
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2034
2046
|
}
|
|
2035
2047
|
function n(t) {
|
|
2036
2048
|
e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
|
|
2037
2049
|
}
|
|
2038
|
-
|
|
2050
|
+
J(e.documentBuffer, (e) => {
|
|
2039
2051
|
e && t(e);
|
|
2040
|
-
}),
|
|
2052
|
+
}), J(e.document, (e) => {
|
|
2041
2053
|
e && n(e);
|
|
2042
|
-
}),
|
|
2043
|
-
await
|
|
2054
|
+
}), Se(async () => {
|
|
2055
|
+
await be();
|
|
2044
2056
|
let r = e.documentBuffer(), i = e.document();
|
|
2045
2057
|
r ? await t(r) : i && n(i);
|
|
2046
2058
|
});
|
|
2047
2059
|
}
|
|
2048
2060
|
//#endregion
|
|
2049
2061
|
//#region src/utils/aiEditRange.ts
|
|
2050
|
-
var
|
|
2051
|
-
let r =
|
|
2062
|
+
var Wi = ({ blockId: e, doc: t, snapshot: n }) => {
|
|
2063
|
+
let r = ln(e);
|
|
2052
2064
|
if (r !== null) {
|
|
2053
|
-
let e =
|
|
2065
|
+
let e = on(t, r);
|
|
2054
2066
|
if (e !== null) return {
|
|
2055
2067
|
from: e.from,
|
|
2056
2068
|
to: e.to
|
|
2057
2069
|
};
|
|
2058
2070
|
}
|
|
2059
|
-
let i = n ??
|
|
2060
|
-
return a ?
|
|
2061
|
-
},
|
|
2062
|
-
let n =
|
|
2071
|
+
let i = n ?? an(t), a = i.anchors[e] ?? Gi(e, i);
|
|
2072
|
+
return a ? Ki(t.content.size, a) : null;
|
|
2073
|
+
}, Gi = (e, t) => {
|
|
2074
|
+
let n = un(e);
|
|
2063
2075
|
if (n === null) return;
|
|
2064
2076
|
let r = t.blocks.at(n - 1);
|
|
2065
2077
|
return r ? t.anchors[r.id] : void 0;
|
|
2066
2078
|
};
|
|
2067
|
-
function
|
|
2079
|
+
function Ki(e, t) {
|
|
2068
2080
|
return {
|
|
2069
2081
|
from: Math.min(Math.max(t.from, 0), e),
|
|
2070
2082
|
to: Math.min(Math.max(t.to, 0), e)
|
|
2071
2083
|
};
|
|
2072
2084
|
}
|
|
2073
2085
|
//#endregion
|
|
2086
|
+
//#region src/utils/pageText.ts
|
|
2087
|
+
var qi = (e, t, n) => {
|
|
2088
|
+
if (!e || !Number.isInteger(n) || n < 1) return null;
|
|
2089
|
+
let r = e.pages[n - 1];
|
|
2090
|
+
if (!r) return null;
|
|
2091
|
+
let i = [];
|
|
2092
|
+
for (let e of r.fragments) typeof e.pmStart != "number" || typeof e.pmEnd != "number" || i.push(t.textBetween(e.pmStart, e.pmEnd, "\n"));
|
|
2093
|
+
return i.join("\n");
|
|
2094
|
+
};
|
|
2095
|
+
//#endregion
|
|
2074
2096
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2075
|
-
function
|
|
2097
|
+
function Ji(e) {
|
|
2076
2098
|
function t() {
|
|
2077
2099
|
e.onPrint?.(), window.print();
|
|
2078
2100
|
}
|
|
@@ -2085,25 +2107,56 @@ function ki(e) {
|
|
|
2085
2107
|
function r(t, n) {
|
|
2086
2108
|
let r = e.pagesRef.value;
|
|
2087
2109
|
if (!r) return !1;
|
|
2088
|
-
let i =
|
|
2110
|
+
let i = Yt(r, t), a = i.at(0);
|
|
2089
2111
|
return a ? (a.scrollIntoView({
|
|
2090
2112
|
block: "center",
|
|
2091
2113
|
behavior: "smooth"
|
|
2092
|
-
}), n?.highlight &&
|
|
2114
|
+
}), n?.highlight && Xt(i, n.highlight), !0) : !1;
|
|
2093
2115
|
}
|
|
2094
2116
|
function i() {
|
|
2095
2117
|
return e.zoom.value;
|
|
2096
2118
|
}
|
|
2097
|
-
|
|
2119
|
+
let a = null;
|
|
2120
|
+
function o() {
|
|
2121
|
+
return a ??= {
|
|
2122
|
+
getEditor: () => e.editor,
|
|
2123
|
+
getDocument: () => e.editor.getDocument(),
|
|
2124
|
+
getState: () => e.editor.getState(),
|
|
2125
|
+
getView: () => e.editor.getView(),
|
|
2126
|
+
getHfView: () => null,
|
|
2127
|
+
ensureView: () => e.editor.ensureView(),
|
|
2128
|
+
focus: () => e.editor.focus(),
|
|
2129
|
+
blur: () => e.editor.blur(),
|
|
2130
|
+
isFocused: () => e.editor.isFocused(),
|
|
2131
|
+
dispatch: (t) => e.editor.dispatch(t),
|
|
2132
|
+
undo: () => e.editor.undo(),
|
|
2133
|
+
redo: () => e.editor.redo(),
|
|
2134
|
+
canUndo: () => e.editor.canUndo(),
|
|
2135
|
+
canRedo: () => e.editor.canRedo(),
|
|
2136
|
+
setSelection: (t, n) => e.editor.setSelection(t, n),
|
|
2137
|
+
getLayout: () => e.editor.getLayout(),
|
|
2138
|
+
relayout: () => e.editor.relayout(),
|
|
2139
|
+
scrollToPosition: (t) => e.scrollVisiblePositionIntoView(t),
|
|
2140
|
+
scrollToPage: l,
|
|
2141
|
+
scrollToParaId: r,
|
|
2142
|
+
getPageNumberForPmPos: (t) => {
|
|
2143
|
+
let n = e.layout.value;
|
|
2144
|
+
if (!n) return null;
|
|
2145
|
+
let r = Jt(n, t);
|
|
2146
|
+
return r == null ? null : r + 1;
|
|
2147
|
+
}
|
|
2148
|
+
}, a;
|
|
2149
|
+
}
|
|
2150
|
+
function s() {
|
|
2098
2151
|
return e.layout.value?.pages.length ?? 0;
|
|
2099
2152
|
}
|
|
2100
|
-
function
|
|
2153
|
+
function c() {
|
|
2101
2154
|
let t = e.layout.value, n = e.editorView.value;
|
|
2102
2155
|
if (!t || !n) return 0;
|
|
2103
|
-
let r =
|
|
2156
|
+
let r = Jt(t, n.state.selection.from);
|
|
2104
2157
|
return r == null ? 0 : r + 1;
|
|
2105
2158
|
}
|
|
2106
|
-
function
|
|
2159
|
+
function l(t) {
|
|
2107
2160
|
if (!Number.isInteger(t) || t < 1) return;
|
|
2108
2161
|
let n = e.pagesViewportRef.value, r = e.pagesRef.value?.querySelector(`[data-page-number="${t}"]`);
|
|
2109
2162
|
if (!n || !r) return;
|
|
@@ -2116,15 +2169,15 @@ function ki(e) {
|
|
|
2116
2169
|
return { exposed: {
|
|
2117
2170
|
getDocument: e.getDocument,
|
|
2118
2171
|
hasPendingChanges: () => e.editorView.value ? e.isDirty.value || e.commentsDirty.value : !1,
|
|
2119
|
-
getEditorRef:
|
|
2172
|
+
getEditorRef: o,
|
|
2120
2173
|
getEditor: () => e.editor,
|
|
2121
2174
|
save: n,
|
|
2122
2175
|
setZoom: e.setZoom,
|
|
2123
2176
|
getZoom: i,
|
|
2124
2177
|
focus: e.focus,
|
|
2125
|
-
getCurrentPage:
|
|
2126
|
-
getTotalPages:
|
|
2127
|
-
scrollToPage:
|
|
2178
|
+
getCurrentPage: c,
|
|
2179
|
+
getTotalPages: s,
|
|
2180
|
+
scrollToPage: l,
|
|
2128
2181
|
scrollToParaId: r,
|
|
2129
2182
|
openPrintPreview: () => t(),
|
|
2130
2183
|
print: t,
|
|
@@ -2133,11 +2186,11 @@ function ki(e) {
|
|
|
2133
2186
|
ensureEditorView: () => e.editor.ensureView(),
|
|
2134
2187
|
createAIEditSnapshot: () => {
|
|
2135
2188
|
let t = e.editorView.value;
|
|
2136
|
-
return t ?
|
|
2189
|
+
return t ? Ht(t.state.doc) : null;
|
|
2137
2190
|
},
|
|
2138
2191
|
applyAIEditOperations: ({ snapshot: t, operations: n, mode: r = "tracked-changes", author: i = e.author() }) => {
|
|
2139
2192
|
let a = e.editorView.value;
|
|
2140
|
-
return a ?
|
|
2193
|
+
return a ? Bt({
|
|
2141
2194
|
view: a,
|
|
2142
2195
|
snapshot: t,
|
|
2143
2196
|
operations: n,
|
|
@@ -2154,38 +2207,54 @@ function ki(e) {
|
|
|
2154
2207
|
},
|
|
2155
2208
|
acceptAIEditOperation: (t) => {
|
|
2156
2209
|
let n = e.editorView.value;
|
|
2157
|
-
return n ?
|
|
2210
|
+
return n ? kt(t)(n.state, n.dispatch) : !1;
|
|
2158
2211
|
},
|
|
2159
2212
|
rejectAIEditOperation: (t) => {
|
|
2160
2213
|
let n = e.editorView.value;
|
|
2161
|
-
return n ?
|
|
2214
|
+
return n ? Mt(t)(n.state, n.dispatch) : !1;
|
|
2162
2215
|
},
|
|
2163
2216
|
undo: () => e.editor.undo(),
|
|
2164
2217
|
redo: () => e.editor.redo(),
|
|
2165
2218
|
scrollToAIEditOperation: (t) => {
|
|
2166
2219
|
let n = e.editorView.value;
|
|
2167
2220
|
if (!n) return !1;
|
|
2168
|
-
let r =
|
|
2221
|
+
let r = jt(n.state, t);
|
|
2169
2222
|
if (!r) return !1;
|
|
2170
|
-
let { from: i, to: a } =
|
|
2171
|
-
return n.dispatch(n.state.tr.setSelection(
|
|
2223
|
+
let { from: i, to: a } = Ki(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2224
|
+
return n.dispatch(n.state.tr.setSelection(tt.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2172
2225
|
},
|
|
2173
2226
|
scrollToBlock: (t, n) => {
|
|
2174
2227
|
let r = e.editorView.value;
|
|
2175
2228
|
if (!r) return !1;
|
|
2176
|
-
let i =
|
|
2229
|
+
let i = Wi({
|
|
2177
2230
|
blockId: t,
|
|
2178
2231
|
doc: r.state.doc,
|
|
2179
2232
|
snapshot: n
|
|
2180
2233
|
});
|
|
2181
2234
|
if (i === null) return !1;
|
|
2182
2235
|
let { from: a, to: o } = i, s = r.state.doc.resolve(a), c = r.state.doc.resolve(o);
|
|
2183
|
-
return r.dispatch(r.state.tr.setSelection(
|
|
2236
|
+
return r.dispatch(r.state.tr.setSelection(tt.between(s, c))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(a)), !0;
|
|
2237
|
+
},
|
|
2238
|
+
getTrackedChanges: () => {
|
|
2239
|
+
let t = e.editorView.value;
|
|
2240
|
+
return t ? Gt(t.state.doc) : [];
|
|
2241
|
+
},
|
|
2242
|
+
getCommentAnchors: () => {
|
|
2243
|
+
let t = e.editorView.value;
|
|
2244
|
+
return t ? Wt(t.state.doc) : [];
|
|
2245
|
+
},
|
|
2246
|
+
getSelectionText: () => {
|
|
2247
|
+
let t = e.editorView.value;
|
|
2248
|
+
return t ? Me(t.state) : "";
|
|
2249
|
+
},
|
|
2250
|
+
getPageText: (t) => {
|
|
2251
|
+
let n = e.editorView.value;
|
|
2252
|
+
return n ? qi(e.layout.value, n.state.doc, t) : null;
|
|
2184
2253
|
},
|
|
2185
2254
|
getContentControls: (t = {}) => {
|
|
2186
2255
|
let n = e.editorView.value;
|
|
2187
|
-
return n ?
|
|
2188
|
-
properties:
|
|
2256
|
+
return n ? $t(n.state.doc, t).map((e) => ({
|
|
2257
|
+
properties: Zt(e.node),
|
|
2189
2258
|
path: e.path,
|
|
2190
2259
|
pmPos: e.pos
|
|
2191
2260
|
})) : [];
|
|
@@ -2193,60 +2262,60 @@ function ki(e) {
|
|
|
2193
2262
|
scrollToContentControl: (t) => {
|
|
2194
2263
|
let n = e.editorView.value;
|
|
2195
2264
|
if (!n) return !1;
|
|
2196
|
-
let r =
|
|
2265
|
+
let r = Qt(n.state.doc, t);
|
|
2197
2266
|
if (!r) return !1;
|
|
2198
2267
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
2199
|
-
return n.dispatch(n.state.tr.setSelection(
|
|
2268
|
+
return n.dispatch(n.state.tr.setSelection(tt.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2200
2269
|
},
|
|
2201
2270
|
setContentControlContent: (t, n, r = {}) => {
|
|
2202
2271
|
let i = e.editorView.value;
|
|
2203
2272
|
if (!i) return !1;
|
|
2204
|
-
let a = typeof n == "string" ?
|
|
2273
|
+
let a = typeof n == "string" ? tn(i.state, t, n, r) : rn(i.state, t, n, r);
|
|
2205
2274
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2206
2275
|
},
|
|
2207
2276
|
setContentControlValue: (t, n, r = {}) => {
|
|
2208
2277
|
let i = e.editorView.value;
|
|
2209
2278
|
if (!i) return !1;
|
|
2210
|
-
let a =
|
|
2279
|
+
let a = nn(i.state, t, n, r);
|
|
2211
2280
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2212
2281
|
},
|
|
2213
2282
|
removeContentControl: (t, n = {}) => {
|
|
2214
2283
|
let r = e.editorView.value;
|
|
2215
2284
|
if (!r) return !1;
|
|
2216
|
-
let i =
|
|
2285
|
+
let i = en(r.state, t, n);
|
|
2217
2286
|
return i ? (r.dispatch(i), !0) : !1;
|
|
2218
2287
|
}
|
|
2219
2288
|
} };
|
|
2220
2289
|
}
|
|
2221
2290
|
//#endregion
|
|
2222
2291
|
//#region src/composables/useFormattingActions.ts
|
|
2223
|
-
function
|
|
2292
|
+
function Yi(e) {
|
|
2224
2293
|
let t = () => e.activeView?.value ?? e.editorView.value;
|
|
2225
2294
|
function n() {
|
|
2226
2295
|
let e = t();
|
|
2227
|
-
e && (
|
|
2296
|
+
e && (St(e.state, e.dispatch, e), e.focus());
|
|
2228
2297
|
}
|
|
2229
2298
|
function r(n) {
|
|
2230
2299
|
let r = t();
|
|
2231
2300
|
if (!r) return;
|
|
2232
2301
|
let i = e.getDocument(), a = i?.package?.styles;
|
|
2233
2302
|
if (a) {
|
|
2234
|
-
let e =
|
|
2235
|
-
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting),
|
|
2236
|
-
} else
|
|
2303
|
+
let e = Ae(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ? vn(i.package.numbering) : null };
|
|
2304
|
+
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting), pn(n, t)(r.state, (e) => r.dispatch(e));
|
|
2305
|
+
} else pn(n)(r.state, (e) => r.dispatch(e));
|
|
2237
2306
|
r.focus();
|
|
2238
2307
|
}
|
|
2239
2308
|
function i() {
|
|
2240
2309
|
let t = e.editorView.value;
|
|
2241
|
-
t && (
|
|
2310
|
+
t && (yn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2242
2311
|
}
|
|
2243
2312
|
function a() {
|
|
2244
2313
|
let t = e.editorView.value;
|
|
2245
|
-
t && (
|
|
2314
|
+
t && (xn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2246
2315
|
}
|
|
2247
2316
|
function o() {
|
|
2248
2317
|
let t = e.editorView.value;
|
|
2249
|
-
t && (
|
|
2318
|
+
t && (bn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2250
2319
|
}
|
|
2251
2320
|
function s(e) {
|
|
2252
2321
|
let n = t();
|
|
@@ -2265,8 +2334,8 @@ function Ai(e) {
|
|
|
2265
2334
|
}
|
|
2266
2335
|
//#endregion
|
|
2267
2336
|
//#region src/composables/useHyperlinkManagement.ts
|
|
2268
|
-
function
|
|
2269
|
-
let t =
|
|
2337
|
+
function Xi(e) {
|
|
2338
|
+
let t = W(null);
|
|
2270
2339
|
function n(e, t) {
|
|
2271
2340
|
t(e.state, (t) => e.dispatch(t), e);
|
|
2272
2341
|
}
|
|
@@ -2296,14 +2365,14 @@ function ji(e) {
|
|
|
2296
2365
|
}
|
|
2297
2366
|
function o(n, r) {
|
|
2298
2367
|
let i = e.editorView.value;
|
|
2299
|
-
i && (
|
|
2368
|
+
i && (Sn(i, {
|
|
2300
2369
|
displayText: n,
|
|
2301
2370
|
href: r
|
|
2302
2371
|
}), t.value = null, i.focus());
|
|
2303
2372
|
}
|
|
2304
2373
|
function s() {
|
|
2305
2374
|
let n = e.editorView.value;
|
|
2306
|
-
n && (
|
|
2375
|
+
n && (Cn(n, { popupHref: t.value?.href }), t.value = null, n.focus());
|
|
2307
2376
|
}
|
|
2308
2377
|
return {
|
|
2309
2378
|
hyperlinkPopupData: t,
|
|
@@ -2316,8 +2385,8 @@ function ji(e) {
|
|
|
2316
2385
|
}
|
|
2317
2386
|
//#endregion
|
|
2318
2387
|
//#region src/composables/useImageActions.ts
|
|
2319
|
-
function
|
|
2320
|
-
let t =
|
|
2388
|
+
function Zi(e) {
|
|
2389
|
+
let t = Te(null), n = W(!1), r = N(() => {
|
|
2321
2390
|
e.stateTick.value;
|
|
2322
2391
|
let n = e.editorView.value, r = t.value;
|
|
2323
2392
|
if (!n || !r) return null;
|
|
@@ -2336,9 +2405,9 @@ function Mi(e) {
|
|
|
2336
2405
|
function a(n) {
|
|
2337
2406
|
let r = e.editorView.value, a = t.value;
|
|
2338
2407
|
if (!r || !a) return;
|
|
2339
|
-
let o =
|
|
2408
|
+
let o = ct(n);
|
|
2340
2409
|
if (!o) return;
|
|
2341
|
-
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu:
|
|
2410
|
+
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu: it(a.element, e.zoom.value) } : void 0, c = e.getCommands().setImageWrapType;
|
|
2342
2411
|
c && (i(r, c(a.pmPos, o, s)), r.focus());
|
|
2343
2412
|
}
|
|
2344
2413
|
function o(n) {
|
|
@@ -2365,8 +2434,61 @@ function Mi(e) {
|
|
|
2365
2434
|
};
|
|
2366
2435
|
}
|
|
2367
2436
|
//#endregion
|
|
2437
|
+
//#region src/composables/useKeyboardShortcuts.ts
|
|
2438
|
+
function Qi(e) {
|
|
2439
|
+
function t(t) {
|
|
2440
|
+
if (t.key === "F1") {
|
|
2441
|
+
t.preventDefault(), e.showKeyboardShortcuts.value = !0;
|
|
2442
|
+
return;
|
|
2443
|
+
}
|
|
2444
|
+
if (e.handleZoomKeyDown(t), t.ctrlKey || t.metaKey) {
|
|
2445
|
+
if (t.key === "o") {
|
|
2446
|
+
if (!e.showFileOpen?.() || !e.onOpenDocument) return;
|
|
2447
|
+
t.preventDefault(), e.onOpenDocument();
|
|
2448
|
+
return;
|
|
2449
|
+
}
|
|
2450
|
+
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));
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
return Se(() => window.addEventListener("keydown", t)), xe(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
|
|
2454
|
+
}
|
|
2455
|
+
//#endregion
|
|
2456
|
+
//#region src/composables/useOutlineSidebar.ts
|
|
2457
|
+
function $i(e) {
|
|
2458
|
+
function t() {
|
|
2459
|
+
let t = e.editorView.value;
|
|
2460
|
+
t && (e.outlineHeadings.value = wn(t.state.doc));
|
|
2461
|
+
}
|
|
2462
|
+
function n() {
|
|
2463
|
+
e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
|
|
2464
|
+
}
|
|
2465
|
+
function r() {
|
|
2466
|
+
e.showOutline.value && t();
|
|
2467
|
+
}
|
|
2468
|
+
function i(t) {
|
|
2469
|
+
let n = e.editorView.value;
|
|
2470
|
+
if (!n) return;
|
|
2471
|
+
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = tt.near(r);
|
|
2472
|
+
n.dispatch(n.state.tr.setSelection(i)), e.scrollToVisiblePosition(t), n.focus();
|
|
2473
|
+
}
|
|
2474
|
+
function a() {
|
|
2475
|
+
e.showSidebar.value || e.extractCommentsAndChanges(), e.showSidebar.value = !e.showSidebar.value;
|
|
2476
|
+
}
|
|
2477
|
+
function o(t) {
|
|
2478
|
+
let n = t.target;
|
|
2479
|
+
n instanceof HTMLElement && (n.closest(".paged-editor__pages") || n.closest(".unified-sidebar") || n.closest(".docx-comment-margin-markers") || (e.activeSidebarItem.value = null));
|
|
2480
|
+
}
|
|
2481
|
+
return {
|
|
2482
|
+
handleToggleOutline: n,
|
|
2483
|
+
handleOutlineNavigate: i,
|
|
2484
|
+
handleToggleSidebar: a,
|
|
2485
|
+
handleEditorScrollMouseDown: o,
|
|
2486
|
+
recomputeHeadingsIfOpen: r
|
|
2487
|
+
};
|
|
2488
|
+
}
|
|
2489
|
+
//#endregion
|
|
2368
2490
|
//#region src/composables/usePageSetupControls.ts
|
|
2369
|
-
function
|
|
2491
|
+
function ea(e) {
|
|
2370
2492
|
function t(t) {
|
|
2371
2493
|
let n = e.getDocument();
|
|
2372
2494
|
if (!n?.package?.document) return;
|
|
@@ -2393,19 +2515,19 @@ function Ni(e) {
|
|
|
2393
2515
|
}
|
|
2394
2516
|
function s(t) {
|
|
2395
2517
|
let n = e.editorView.value;
|
|
2396
|
-
n &&
|
|
2518
|
+
n && gn(t)(n.state, n.dispatch);
|
|
2397
2519
|
}
|
|
2398
2520
|
function c(t) {
|
|
2399
2521
|
let n = e.editorView.value;
|
|
2400
|
-
n &&
|
|
2522
|
+
n && _n(t)(n.state, n.dispatch);
|
|
2401
2523
|
}
|
|
2402
2524
|
function l(t) {
|
|
2403
2525
|
let n = e.editorView.value;
|
|
2404
|
-
n && (t < 0 ?
|
|
2526
|
+
n && (t < 0 ? hn(-t, !0)(n.state, n.dispatch) : hn(t, !1)(n.state, n.dispatch));
|
|
2405
2527
|
}
|
|
2406
2528
|
function u(t) {
|
|
2407
2529
|
let n = e.editorView.value;
|
|
2408
|
-
n &&
|
|
2530
|
+
n && mn(t)(n.state, n.dispatch);
|
|
2409
2531
|
}
|
|
2410
2532
|
return {
|
|
2411
2533
|
handlePageSetupApply: t,
|
|
@@ -2421,45 +2543,45 @@ function Ni(e) {
|
|
|
2421
2543
|
}
|
|
2422
2544
|
//#endregion
|
|
2423
2545
|
//#region src/utils/textSelection.ts
|
|
2424
|
-
var
|
|
2425
|
-
function
|
|
2426
|
-
return !e || e.length === 0 ? !1 :
|
|
2546
|
+
var ta = /[\p{L}\p{N}\p{M}_''-]/u, na = /\s/;
|
|
2547
|
+
function ra(e) {
|
|
2548
|
+
return !e || e.length === 0 ? !1 : ta.test(e);
|
|
2427
2549
|
}
|
|
2428
|
-
function
|
|
2429
|
-
return !e || e.length === 0 ? !1 :
|
|
2550
|
+
function ia(e) {
|
|
2551
|
+
return !e || e.length === 0 ? !1 : na.test(e);
|
|
2430
2552
|
}
|
|
2431
|
-
function
|
|
2553
|
+
function aa(e, t) {
|
|
2432
2554
|
if (!e || e.length === 0) return [0, 0];
|
|
2433
2555
|
t = Math.max(0, Math.min(t, e.length - 1));
|
|
2434
2556
|
let n = e[t];
|
|
2435
|
-
if (
|
|
2557
|
+
if (ia(n)) {
|
|
2436
2558
|
let n = t, r = t;
|
|
2437
|
-
for (; n > 0 &&
|
|
2438
|
-
for (; r < e.length &&
|
|
2559
|
+
for (; n > 0 && ia(e[n - 1]);) n--;
|
|
2560
|
+
for (; r < e.length && ia(e[r]);) r++;
|
|
2439
2561
|
return [n, r];
|
|
2440
2562
|
}
|
|
2441
|
-
if (
|
|
2563
|
+
if (ra(n)) {
|
|
2442
2564
|
let n = t, r = t;
|
|
2443
|
-
for (; n > 0 &&
|
|
2444
|
-
for (; r < e.length &&
|
|
2565
|
+
for (; n > 0 && ra(e[n - 1]);) n--;
|
|
2566
|
+
for (; r < e.length && ra(e[r]);) r++;
|
|
2445
2567
|
return [n, r];
|
|
2446
2568
|
}
|
|
2447
2569
|
return [t, t + 1];
|
|
2448
2570
|
}
|
|
2449
2571
|
//#endregion
|
|
2450
2572
|
//#region src/utils/domQueries.ts
|
|
2451
|
-
function
|
|
2452
|
-
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) :
|
|
2573
|
+
function oa(e, t, n) {
|
|
2574
|
+
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : vt(e);
|
|
2453
2575
|
for (let e of r) {
|
|
2454
2576
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
2455
2577
|
if (!Number.isNaN(n) && !Number.isNaN(r) && t >= n && t <= r) return e;
|
|
2456
2578
|
}
|
|
2457
2579
|
return null;
|
|
2458
2580
|
}
|
|
2459
|
-
function
|
|
2581
|
+
function sa(e, t, n) {
|
|
2460
2582
|
if (!e || !t) return;
|
|
2461
|
-
let r =
|
|
2462
|
-
if (!r) for (let t of
|
|
2583
|
+
let r = _t(e, n);
|
|
2584
|
+
if (!r) for (let t of vt(e)) {
|
|
2463
2585
|
let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
|
|
2464
2586
|
if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
|
|
2465
2587
|
r = t;
|
|
@@ -2473,21 +2595,21 @@ function Bi(e, t, n) {
|
|
|
2473
2595
|
behavior: "smooth"
|
|
2474
2596
|
});
|
|
2475
2597
|
}
|
|
2476
|
-
function
|
|
2598
|
+
function ca(e, t, n, r) {
|
|
2477
2599
|
if (!e || !t) return null;
|
|
2478
|
-
let i =
|
|
2600
|
+
let i = dt(e, n, r, 1);
|
|
2479
2601
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
2480
2602
|
}
|
|
2481
|
-
function
|
|
2603
|
+
function la(e, t, n, r) {
|
|
2482
2604
|
if (!e) return;
|
|
2483
|
-
let i =
|
|
2605
|
+
let i = oa(e, t, r);
|
|
2484
2606
|
if (!i) return;
|
|
2485
|
-
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] =
|
|
2607
|
+
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = aa(a, t - o), l = o + s, u = o + c;
|
|
2486
2608
|
l < u && n(l, u);
|
|
2487
2609
|
}
|
|
2488
|
-
function
|
|
2610
|
+
function ua(e, t, n, r) {
|
|
2489
2611
|
if (!e) return;
|
|
2490
|
-
let i =
|
|
2612
|
+
let i = oa(e, t, r);
|
|
2491
2613
|
if (!i) return;
|
|
2492
2614
|
let a = i.closest(".layout-paragraph");
|
|
2493
2615
|
if (!a) return;
|
|
@@ -2496,26 +2618,26 @@ function Ui(e, t, n, r) {
|
|
|
2496
2618
|
}
|
|
2497
2619
|
//#endregion
|
|
2498
2620
|
//#region src/composables/usePagesPointer.ts
|
|
2499
|
-
var
|
|
2500
|
-
function
|
|
2501
|
-
let t =
|
|
2621
|
+
var da = 500;
|
|
2622
|
+
function fa(e) {
|
|
2623
|
+
let t = W(null), n = null;
|
|
2502
2624
|
function r() {
|
|
2503
2625
|
n !== null && (clearTimeout(n), n = null);
|
|
2504
2626
|
}
|
|
2505
|
-
let i =
|
|
2627
|
+
let i = Te(null), a = 0, o = null, s = 0, c = !1, l = null, u = Dn(), d = ie({
|
|
2506
2628
|
pagesContainer: e.pagesRef,
|
|
2507
2629
|
onScrollExtendSelection: (e, t) => {
|
|
2508
2630
|
if (!c || l === null) return;
|
|
2509
2631
|
let n = m(e, t);
|
|
2510
2632
|
n !== null && n !== l && g(l, n);
|
|
2511
2633
|
}
|
|
2512
|
-
}), f =
|
|
2634
|
+
}), f = W({
|
|
2513
2635
|
currentPage: 1,
|
|
2514
2636
|
totalPages: 1,
|
|
2515
2637
|
visible: !1
|
|
2516
2638
|
}), p = null;
|
|
2517
2639
|
function m(t, n) {
|
|
2518
|
-
return
|
|
2640
|
+
return ca(e.pagesRef.value, e.editorView.value, t, n);
|
|
2519
2641
|
}
|
|
2520
2642
|
function h() {
|
|
2521
2643
|
let t = i.value;
|
|
@@ -2528,18 +2650,18 @@ function Gi(e) {
|
|
|
2528
2650
|
function g(e, t) {
|
|
2529
2651
|
let n = h();
|
|
2530
2652
|
if (n) try {
|
|
2531
|
-
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a =
|
|
2653
|
+
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = tt.between(r, i);
|
|
2532
2654
|
n.dispatch(n.state.tr.setSelection(a));
|
|
2533
2655
|
} catch {}
|
|
2534
2656
|
}
|
|
2535
2657
|
function _(t) {
|
|
2536
|
-
|
|
2658
|
+
sa(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2537
2659
|
}
|
|
2538
2660
|
function v(t) {
|
|
2539
|
-
|
|
2661
|
+
la(e.pagesRef.value, t, g, i.value?.position);
|
|
2540
2662
|
}
|
|
2541
2663
|
function y(t) {
|
|
2542
|
-
|
|
2664
|
+
ua(e.pagesRef.value, t, g, i.value?.position);
|
|
2543
2665
|
}
|
|
2544
2666
|
function b(t) {
|
|
2545
2667
|
let n = e.editorView.value;
|
|
@@ -2568,7 +2690,7 @@ function Gi(e) {
|
|
|
2568
2690
|
if (!o) return;
|
|
2569
2691
|
let s = e.pagesViewportRef.value;
|
|
2570
2692
|
if (!s || !(a.target instanceof HTMLElement)) return;
|
|
2571
|
-
let l =
|
|
2693
|
+
let l = En({
|
|
2572
2694
|
mouseX: a.clientX,
|
|
2573
2695
|
mouseY: a.clientY,
|
|
2574
2696
|
pagesContainer: o,
|
|
@@ -2578,7 +2700,7 @@ function Gi(e) {
|
|
|
2578
2700
|
if (!l) {
|
|
2579
2701
|
n === null && (n = setTimeout(() => {
|
|
2580
2702
|
t.value = null, n = null;
|
|
2581
|
-
},
|
|
2703
|
+
}, Tn));
|
|
2582
2704
|
return;
|
|
2583
2705
|
}
|
|
2584
2706
|
let u = e.zoom.value || 1, d = s.getBoundingClientRect();
|
|
@@ -2589,16 +2711,16 @@ function Gi(e) {
|
|
|
2589
2711
|
cellPmPos: l.cellPmPos
|
|
2590
2712
|
}, r();
|
|
2591
2713
|
}
|
|
2592
|
-
function
|
|
2714
|
+
function ee(n) {
|
|
2593
2715
|
n.preventDefault(), n.stopPropagation();
|
|
2594
2716
|
let r = t.value, i = e.editorView.value;
|
|
2595
2717
|
if (!r || !i) return;
|
|
2596
|
-
let a = i.state.tr.setSelection(
|
|
2718
|
+
let a = i.state.tr.setSelection(tt.create(i.state.doc, r.cellPmPos + 1));
|
|
2597
2719
|
i.dispatch(a);
|
|
2598
2720
|
let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow : o.addColumnRight;
|
|
2599
2721
|
s && (s()(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
|
|
2600
2722
|
}
|
|
2601
|
-
function
|
|
2723
|
+
function S(t) {
|
|
2602
2724
|
let n = t.target, r = n instanceof HTMLElement ? n.closest("a[href]") : null;
|
|
2603
2725
|
if (!r) return;
|
|
2604
2726
|
t.preventDefault();
|
|
@@ -2623,7 +2745,7 @@ function Gi(e) {
|
|
|
2623
2745
|
...l ? { tooltip: l } : {}
|
|
2624
2746
|
};
|
|
2625
2747
|
}
|
|
2626
|
-
function
|
|
2748
|
+
function te(t) {
|
|
2627
2749
|
if (!(t.target instanceof HTMLElement)) return;
|
|
2628
2750
|
let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
|
|
2629
2751
|
if (!o) return;
|
|
@@ -2660,7 +2782,7 @@ function Gi(e) {
|
|
|
2660
2782
|
}, y = c.package.document, b = y?.sections?.map((e, t) => t === 0 ? {
|
|
2661
2783
|
...e,
|
|
2662
2784
|
properties: v
|
|
2663
|
-
} : e), x = y?.finalSectionProperties === l ? v : y?.finalSectionProperties,
|
|
2785
|
+
} : e), x = y?.finalSectionProperties === l ? v : y?.finalSectionProperties, ee = {
|
|
2664
2786
|
...c,
|
|
2665
2787
|
package: {
|
|
2666
2788
|
...c.package,
|
|
@@ -2673,7 +2795,7 @@ function Gi(e) {
|
|
|
2673
2795
|
}
|
|
2674
2796
|
}
|
|
2675
2797
|
};
|
|
2676
|
-
f = n, p = r, e.setDocument?.(
|
|
2798
|
+
f = n, p = r, e.setDocument?.(ee), e.syncHfPMs?.(), e.reLayout(), e.emit("change", ee);
|
|
2677
2799
|
}
|
|
2678
2800
|
let m = e.pagesViewportRef.value;
|
|
2679
2801
|
if (!m) return;
|
|
@@ -2690,7 +2812,7 @@ function Gi(e) {
|
|
|
2690
2812
|
}
|
|
2691
2813
|
};
|
|
2692
2814
|
}
|
|
2693
|
-
function
|
|
2815
|
+
function ne(t) {
|
|
2694
2816
|
let n = e.getDocument(), r = i.value;
|
|
2695
2817
|
if (!n?.package || !r) return;
|
|
2696
2818
|
let a = r.position === "header" ? n.package.headers : n.package.footers;
|
|
@@ -2698,7 +2820,7 @@ function Gi(e) {
|
|
|
2698
2820
|
let o = a.get(r.rId);
|
|
2699
2821
|
o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
|
|
2700
2822
|
}
|
|
2701
|
-
function
|
|
2823
|
+
function re() {
|
|
2702
2824
|
let t = e.getDocument(), n = i.value;
|
|
2703
2825
|
if (!t?.package || !n || !n.rId) {
|
|
2704
2826
|
i.value = null;
|
|
@@ -2730,7 +2852,7 @@ function Gi(e) {
|
|
|
2730
2852
|
};
|
|
2731
2853
|
i.value = null, e.setDocument?.(p), e.syncHfPMs?.(), e.reLayout(), e.emit("change", p);
|
|
2732
2854
|
}
|
|
2733
|
-
function
|
|
2855
|
+
function C(t) {
|
|
2734
2856
|
if (t.button !== 0 || e.imageInteracting.value) return;
|
|
2735
2857
|
let n = e.editorView.value;
|
|
2736
2858
|
if (!n) return;
|
|
@@ -2738,13 +2860,13 @@ function Gi(e) {
|
|
|
2738
2860
|
i.value && d && (d.closest(".layout-page-header") || d.closest(".layout-page-footer") || d.closest(".hf-editor") || (i.value = null, n.focus()));
|
|
2739
2861
|
let f = h() ?? n;
|
|
2740
2862
|
if (!e.readOnly.value && e.tableResize.tryStartResize(t, f)) return;
|
|
2741
|
-
let p =
|
|
2863
|
+
let p = ot(r);
|
|
2742
2864
|
if (p) {
|
|
2743
2865
|
t.preventDefault(), t.stopPropagation();
|
|
2744
2866
|
let n = Number(p.dataset.pmStart);
|
|
2745
2867
|
if (!Number.isNaN(n)) {
|
|
2746
2868
|
try {
|
|
2747
|
-
f.dispatch(f.state.tr.setSelection(
|
|
2869
|
+
f.dispatch(f.state.tr.setSelection(Z.create(f.state.doc, n)));
|
|
2748
2870
|
} catch {}
|
|
2749
2871
|
e.selectedImage.value = {
|
|
2750
2872
|
element: p,
|
|
@@ -2763,15 +2885,15 @@ function Gi(e) {
|
|
|
2763
2885
|
return;
|
|
2764
2886
|
}
|
|
2765
2887
|
let b = Date.now();
|
|
2766
|
-
if (b - a <
|
|
2888
|
+
if (b - a < da && o === _ ? s++ : s = 1, a = b, o = _, s === 2) v(_);
|
|
2767
2889
|
else if (s >= 3) y(_), s = 0;
|
|
2768
2890
|
else if (t.shiftKey) {
|
|
2769
2891
|
let { from: e } = f.state.selection;
|
|
2770
2892
|
g(e, _);
|
|
2771
|
-
} else g(_), l = _, c = !0, u.begin(
|
|
2893
|
+
} else g(_), l = _, c = !0, u.begin(On(f, _));
|
|
2772
2894
|
f.focus();
|
|
2773
2895
|
}
|
|
2774
|
-
function
|
|
2896
|
+
function ae(e) {
|
|
2775
2897
|
if (!c || l === null) return;
|
|
2776
2898
|
let t = m(e.clientX, e.clientY);
|
|
2777
2899
|
if (t !== null) {
|
|
@@ -2784,10 +2906,10 @@ function Gi(e) {
|
|
|
2784
2906
|
}
|
|
2785
2907
|
d.updateMousePosition(e.clientX, e.clientY);
|
|
2786
2908
|
}
|
|
2787
|
-
function
|
|
2909
|
+
function oe() {
|
|
2788
2910
|
c = !1, u.end(), d.stopAutoScroll();
|
|
2789
2911
|
}
|
|
2790
|
-
function
|
|
2912
|
+
function w() {
|
|
2791
2913
|
let t = e.pagesViewportRef.value, n = e.layout.value;
|
|
2792
2914
|
if (!t || !n || n.pages.length === 0) return;
|
|
2793
2915
|
let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
|
|
@@ -2812,10 +2934,10 @@ function Gi(e) {
|
|
|
2812
2934
|
};
|
|
2813
2935
|
}, 600);
|
|
2814
2936
|
}
|
|
2815
|
-
return
|
|
2816
|
-
window.addEventListener("mousemove",
|
|
2817
|
-
}),
|
|
2818
|
-
r(), window.removeEventListener("mousemove",
|
|
2937
|
+
return Se(() => {
|
|
2938
|
+
window.addEventListener("mousemove", ae), window.addEventListener("mouseup", oe), e.pagesViewportRef.value?.addEventListener("scroll", w, { passive: !0 });
|
|
2939
|
+
}), xe(() => {
|
|
2940
|
+
r(), window.removeEventListener("mousemove", ae), window.removeEventListener("mouseup", oe), e.pagesViewportRef.value?.removeEventListener("scroll", w), p && clearTimeout(p);
|
|
2819
2941
|
}), {
|
|
2820
2942
|
tableInsertButton: t,
|
|
2821
2943
|
hfEdit: i,
|
|
@@ -2824,29 +2946,29 @@ function Gi(e) {
|
|
|
2824
2946
|
setPmSelection: g,
|
|
2825
2947
|
scrollVisiblePositionIntoView: _,
|
|
2826
2948
|
navigateToBookmark: b,
|
|
2827
|
-
handlePagesMouseDown:
|
|
2949
|
+
handlePagesMouseDown: C,
|
|
2828
2950
|
handlePagesMouseMove: x,
|
|
2829
|
-
handlePagesClick:
|
|
2830
|
-
handlePagesDoubleClick:
|
|
2831
|
-
handleTableInsertClick:
|
|
2951
|
+
handlePagesClick: S,
|
|
2952
|
+
handlePagesDoubleClick: te,
|
|
2953
|
+
handleTableInsertClick: ee,
|
|
2832
2954
|
clearTableInsertTimer: r,
|
|
2833
|
-
handleHfSave:
|
|
2834
|
-
handleHfRemove:
|
|
2955
|
+
handleHfSave: ne,
|
|
2956
|
+
handleHfRemove: re
|
|
2835
2957
|
};
|
|
2836
2958
|
}
|
|
2837
2959
|
//#endregion
|
|
2838
2960
|
//#region src/utils/hostFonts.ts
|
|
2839
|
-
function
|
|
2961
|
+
function pa(e) {
|
|
2840
2962
|
return typeof e == "string" && e.trim().length > 0;
|
|
2841
2963
|
}
|
|
2842
|
-
function
|
|
2843
|
-
return typeof e != "object" || !e ? !1 :
|
|
2964
|
+
function ma(e) {
|
|
2965
|
+
return typeof e != "object" || !e ? !1 : pa(Reflect.get(e, "family")) && pa(Reflect.get(e, "src"));
|
|
2844
2966
|
}
|
|
2845
|
-
function
|
|
2967
|
+
function ha(e) {
|
|
2846
2968
|
if (!e) return [];
|
|
2847
2969
|
let t = [];
|
|
2848
2970
|
for (let n of e) {
|
|
2849
|
-
if (!
|
|
2971
|
+
if (!ma(n)) continue;
|
|
2850
2972
|
let e = { display: "swap" };
|
|
2851
2973
|
(typeof n.weight == "number" || typeof n.weight == "string") && (e.weight = String(n.weight)), t.push({
|
|
2852
2974
|
family: n.family.trim(),
|
|
@@ -2856,10 +2978,10 @@ function Ji(e) {
|
|
|
2856
2978
|
}
|
|
2857
2979
|
return t;
|
|
2858
2980
|
}
|
|
2859
|
-
function
|
|
2981
|
+
function ga() {
|
|
2860
2982
|
return typeof document > "u" || !("fonts" in document) ? null : document.fonts;
|
|
2861
2983
|
}
|
|
2862
|
-
async function
|
|
2984
|
+
async function _a(e, t, n, r) {
|
|
2863
2985
|
let i;
|
|
2864
2986
|
try {
|
|
2865
2987
|
i = new FontFace(t, n, r), e.add(i);
|
|
@@ -2868,39 +2990,39 @@ async function Xi(e, t, n, r) {
|
|
|
2868
2990
|
}
|
|
2869
2991
|
return await i.load().then(() => !0, () => !1) ? i : (e.delete(i), null);
|
|
2870
2992
|
}
|
|
2871
|
-
async function
|
|
2872
|
-
let t =
|
|
2993
|
+
async function va(e) {
|
|
2994
|
+
let t = ga();
|
|
2873
2995
|
if (!t) return [];
|
|
2874
|
-
let n =
|
|
2996
|
+
let n = ha(e);
|
|
2875
2997
|
if (n.length === 0) return [];
|
|
2876
2998
|
let r = [];
|
|
2877
2999
|
return await Promise.all(n.map(async ({ family: e, source: n, descriptors: i }) => {
|
|
2878
|
-
let a = await
|
|
3000
|
+
let a = await _a(t, e, n, i);
|
|
2879
3001
|
a && r.push(a);
|
|
2880
3002
|
})), r;
|
|
2881
3003
|
}
|
|
2882
|
-
function
|
|
2883
|
-
let t =
|
|
3004
|
+
function ya(e) {
|
|
3005
|
+
let t = ga();
|
|
2884
3006
|
if (t) for (let n of e) t.delete(n);
|
|
2885
3007
|
}
|
|
2886
3008
|
//#endregion
|
|
2887
3009
|
//#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
|
|
2888
|
-
var
|
|
3010
|
+
var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
2889
3011
|
key: 0,
|
|
2890
3012
|
class: "docx-editor-vue__error"
|
|
2891
|
-
},
|
|
3013
|
+
}, Sa = {
|
|
2892
3014
|
key: 1,
|
|
2893
3015
|
class: "docx-editor-vue__loading"
|
|
2894
|
-
},
|
|
3016
|
+
}, Ca = {
|
|
2895
3017
|
key: 2,
|
|
2896
3018
|
class: "docx-editor-vue__placeholder"
|
|
2897
|
-
},
|
|
3019
|
+
}, wa = { class: "docx-editor-vue__editor-area" }, Ta = {
|
|
2898
3020
|
key: 0,
|
|
2899
3021
|
class: "docx-editor-vue__ruler-h"
|
|
2900
|
-
},
|
|
3022
|
+
}, Ea = {
|
|
2901
3023
|
key: 1,
|
|
2902
3024
|
class: "docx-editor-vue__ruler-v"
|
|
2903
|
-
},
|
|
3025
|
+
}, Da = {
|
|
2904
3026
|
class: "docx-editor-vue__editor-content-wrapper",
|
|
2905
3027
|
style: {
|
|
2906
3028
|
position: "relative",
|
|
@@ -2908,14 +3030,15 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
2908
3030
|
flexDirection: "column",
|
|
2909
3031
|
minHeight: "100%"
|
|
2910
3032
|
}
|
|
2911
|
-
},
|
|
3033
|
+
}, Oa = {
|
|
2912
3034
|
"data-testid": "selection-overlay",
|
|
2913
3035
|
class: "docx-editor-vue__decoration-origin",
|
|
2914
3036
|
"aria-hidden": "true"
|
|
2915
|
-
},
|
|
3037
|
+
}, ka = ["aria-label"], Aa = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
2916
3038
|
__name: "DocxEditor",
|
|
2917
3039
|
props: {
|
|
2918
3040
|
documentBuffer: { default: null },
|
|
3041
|
+
password: {},
|
|
2919
3042
|
document: { default: null },
|
|
2920
3043
|
documentKey: {},
|
|
2921
3044
|
onSave: {},
|
|
@@ -3029,209 +3152,224 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3029
3152
|
"mode-change",
|
|
3030
3153
|
"comments-change"
|
|
3031
3154
|
],
|
|
3032
|
-
setup(
|
|
3033
|
-
let
|
|
3034
|
-
|
|
3035
|
-
let
|
|
3155
|
+
setup(t, { expose: n, emit: a }) {
|
|
3156
|
+
let o = t, s = a;
|
|
3157
|
+
e(), i(o.components), yr(W(!1));
|
|
3158
|
+
let l = W(o.mode), u = N(() => o.readOnly || l.value === "viewing"), d = N(() => o.showReviewControls), f = N(() => lt(l.value)), p = W("all-markup");
|
|
3036
3159
|
function m() {
|
|
3037
|
-
|
|
3160
|
+
dn(ut(l.value));
|
|
3038
3161
|
}
|
|
3039
|
-
function
|
|
3040
|
-
|
|
3162
|
+
function g(e) {
|
|
3163
|
+
p.value = e;
|
|
3164
|
+
}
|
|
3165
|
+
let b = N(() => p.value === "all-markup" ? "" : `folio-root--${p.value}`), { t: x } = c(), S = ({ node: e }) => e;
|
|
3166
|
+
S.props = ["node"];
|
|
3167
|
+
let te = N(() => o.documentBuffer != null || o.document != null), re = W(!1);
|
|
3168
|
+
J(te, (e) => {
|
|
3169
|
+
e || (re.value = !1);
|
|
3170
|
+
});
|
|
3171
|
+
let ie = W(null), T = W(null), se = W(null), ce = W(null), le = N(() => o.showRuler ?? !1), E = W(0), D = W(!1), ue = W(!1), de = W(!1), fe = W(!1), O = W(!1), k = W(!1), A = W(o.showOutline), j = W(!1), pe = W(null), me = Te([]), ge = Te([]), { zoom: B, zoomPercent: _e, isMinZoom: ve, isMaxZoom: be, setZoom: Ce, zoomIn: G, zoomOut: Ee, handleWheel: Oe, handleKeyDown: ke, ZOOM_PRESETS: Ae } = w(o.initialZoom);
|
|
3172
|
+
function Me(e) {
|
|
3173
|
+
o.enableWheelZoom !== !1 && Oe(e);
|
|
3041
3174
|
}
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3175
|
+
Qi({
|
|
3176
|
+
showKeyboardShortcuts: de,
|
|
3177
|
+
showFindReplace: D,
|
|
3178
|
+
showHyperlink: ue,
|
|
3179
|
+
handleZoomKeyDown: ke
|
|
3047
3180
|
});
|
|
3048
|
-
let
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
editorMode: s,
|
|
3057
|
-
author: () => a.author,
|
|
3058
|
-
documentKey: () => a.documentKey,
|
|
3181
|
+
let { editor: Ne, editorView: X, editorState: Ie, isReady: Re, isDirty: Ke, parseError: qe, layout: Je, blocks: Ye, measures: Xe, loadBuffer: Ze, loadDocument: Qe, save: $e, getDocument: Z, getCommands: et, focus: tt, reLayout: nt } = ae({
|
|
3182
|
+
hiddenContainer: ie,
|
|
3183
|
+
pagesContainer: T,
|
|
3184
|
+
readOnly: u,
|
|
3185
|
+
editorMode: l,
|
|
3186
|
+
author: () => o.author,
|
|
3187
|
+
password: () => o.password,
|
|
3188
|
+
documentKey: () => o.documentKey,
|
|
3059
3189
|
externalPlugins: [],
|
|
3060
|
-
onAnonymizationMatchesChange: (e) =>
|
|
3061
|
-
showTemplateDirectives: () =>
|
|
3062
|
-
onSlashMenuChange: (e) =>
|
|
3063
|
-
onSlashMenuKeyAction: (e) =>
|
|
3190
|
+
onAnonymizationMatchesChange: (e) => o.onAnonymizationMatchesChange?.(e),
|
|
3191
|
+
showTemplateDirectives: () => o.showTemplateDirectives,
|
|
3192
|
+
onSlashMenuChange: (e) => o.onSlashMenuChange?.(e),
|
|
3193
|
+
onSlashMenuKeyAction: (e) => o.onSlashMenuKeyAction?.(e) ?? !1,
|
|
3064
3194
|
onChange: (e) => {
|
|
3065
|
-
|
|
3195
|
+
o.onChange?.(e), s("change", e), s("update:document", e);
|
|
3066
3196
|
},
|
|
3067
3197
|
onError: (e) => {
|
|
3068
|
-
|
|
3198
|
+
o.onError?.(e), s("error", e);
|
|
3069
3199
|
},
|
|
3070
3200
|
onSelectionUpdate: (e) => {
|
|
3071
|
-
if (
|
|
3201
|
+
if (o.onSelectionChange?.(je(e)), o.onSelectionTextChange) {
|
|
3072
3202
|
let { from: t, to: n } = e.selection, r = t === n ? "" : e.doc.textBetween(t, n, " ", " ");
|
|
3073
|
-
|
|
3203
|
+
o.onSelectionTextChange({
|
|
3074
3204
|
from: t,
|
|
3075
3205
|
to: n,
|
|
3076
3206
|
text: r
|
|
3077
3207
|
});
|
|
3078
3208
|
}
|
|
3079
3209
|
},
|
|
3080
|
-
onEditorViewReady: (e) =>
|
|
3081
|
-
onReadOnlyEditAttempt: () =>
|
|
3082
|
-
featureFlags: () =>
|
|
3083
|
-
onSelectiveSaveTripwire:
|
|
3084
|
-
}), rt =
|
|
3210
|
+
onEditorViewReady: (e) => o.onEditorViewReady?.(e),
|
|
3211
|
+
onReadOnlyEditAttempt: () => o.onReadonlyEditAttempt?.(),
|
|
3212
|
+
featureFlags: () => o.featureFlags,
|
|
3213
|
+
onSelectiveSaveTripwire: o.onSelectiveSaveTripwire ? (e) => o.onSelectiveSaveTripwire?.(e) : void 0
|
|
3214
|
+
}), rt = N(() => !Re.value && te.value && !(o.preserveDocumentWhileLoading === !0 && re.value));
|
|
3085
3215
|
function it() {
|
|
3086
|
-
|
|
3216
|
+
X.value && (Ue(), He(), nt());
|
|
3087
3217
|
}
|
|
3088
|
-
|
|
3218
|
+
J(() => o.fonts, (e, t, n) => {
|
|
3089
3219
|
if (!e || e.length === 0) return;
|
|
3090
3220
|
let r = !1, i = [];
|
|
3091
|
-
|
|
3221
|
+
va(e).then((e) => {
|
|
3092
3222
|
if (r) {
|
|
3093
|
-
|
|
3223
|
+
ya(e);
|
|
3094
3224
|
return;
|
|
3095
3225
|
}
|
|
3096
3226
|
i = e, e.length !== 0 && it();
|
|
3097
3227
|
}), n(() => {
|
|
3098
|
-
r = !0, i.length !== 0 && (
|
|
3228
|
+
r = !0, i.length !== 0 && (ya(i), it());
|
|
3099
3229
|
});
|
|
3100
3230
|
}, { immediate: !0 });
|
|
3101
|
-
let { selectedImage: at, imageInteracting: ot, imageToolbarContext: st, handleToolbarImageWrap: ct, handleImageTransform:
|
|
3102
|
-
editorView:
|
|
3103
|
-
zoom:
|
|
3104
|
-
stateTick:
|
|
3231
|
+
let { selectedImage: at, imageInteracting: ot, imageToolbarContext: st, handleToolbarImageWrap: ct, handleImageTransform: dt } = Zi({
|
|
3232
|
+
editorView: X,
|
|
3233
|
+
zoom: B,
|
|
3234
|
+
stateTick: E,
|
|
3105
3235
|
getCommands: et
|
|
3106
|
-
}), { hyperlinkPopupData:
|
|
3107
|
-
editorView:
|
|
3236
|
+
}), { hyperlinkPopupData: ft, handleHyperlinkSubmit: pt, handleHyperlinkRemove: mt, handleHyperlinkPopupNavigate: ht, handleHyperlinkPopupEdit: gt, handleHyperlinkPopupRemove: _t } = Xi({
|
|
3237
|
+
editorView: X,
|
|
3108
3238
|
getCommands: et
|
|
3109
|
-
}),
|
|
3110
|
-
editorView:
|
|
3111
|
-
pagesRef:
|
|
3112
|
-
pagesViewportRef:
|
|
3239
|
+
}), vt = C(), { tableInsertButton: yt, scrollPageInfo: bt, resolvePos: xt, setPmSelection: St, scrollVisiblePositionIntoView: Ct, handlePagesMouseDown: wt, handlePagesMouseMove: Tt, handlePagesClick: Et, handleTableInsertClick: Dt } = fa({
|
|
3240
|
+
editorView: X,
|
|
3241
|
+
pagesRef: T,
|
|
3242
|
+
pagesViewportRef: se,
|
|
3113
3243
|
selectedImage: at,
|
|
3114
3244
|
imageInteracting: ot,
|
|
3115
|
-
hyperlinkPopupData:
|
|
3116
|
-
readOnly:
|
|
3117
|
-
zoom:
|
|
3118
|
-
layout:
|
|
3245
|
+
hyperlinkPopupData: ft,
|
|
3246
|
+
readOnly: u,
|
|
3247
|
+
zoom: B,
|
|
3248
|
+
layout: Je,
|
|
3119
3249
|
tableResize: {
|
|
3120
|
-
tryStartResize:
|
|
3121
|
-
isResizing:
|
|
3250
|
+
tryStartResize: vt.tryStartResize,
|
|
3251
|
+
isResizing: N(() => vt.isResizing())
|
|
3122
3252
|
},
|
|
3123
3253
|
getCommands: et,
|
|
3124
|
-
getDocument:
|
|
3254
|
+
getDocument: Z,
|
|
3125
3255
|
reLayout: nt,
|
|
3126
3256
|
emit: () => {},
|
|
3127
3257
|
clearOverlay: () => {}
|
|
3128
|
-
}),
|
|
3129
|
-
editorView:
|
|
3258
|
+
}), Ot = $i({
|
|
3259
|
+
editorView: X,
|
|
3260
|
+
showOutline: A,
|
|
3261
|
+
showSidebar: j,
|
|
3262
|
+
outlineHeadings: ge,
|
|
3263
|
+
activeSidebarItem: pe,
|
|
3264
|
+
extractCommentsAndChanges: () => {},
|
|
3265
|
+
scrollToVisiblePosition: Ct
|
|
3266
|
+
}), { contextMenu: kt, imageContextMenu: At, imageContextMenuTextActions: jt, customTextMenuItems: Mt, handleContextMenu: Nt, handleSelectedImageContextMenu: Pt, handleImageWrapSelect: Ft, handleContextMenuAction: It } = Hi({
|
|
3267
|
+
editorView: X,
|
|
3130
3268
|
selectedImage: at,
|
|
3131
|
-
zoom:
|
|
3132
|
-
showImageProperties:
|
|
3269
|
+
zoom: B,
|
|
3270
|
+
showImageProperties: O,
|
|
3133
3271
|
getCommands: et,
|
|
3134
3272
|
clearOverlay: () => {},
|
|
3135
|
-
setPmSelection:
|
|
3136
|
-
resolvePos:
|
|
3137
|
-
customContextMenuItems: () =>
|
|
3138
|
-
onCustomContextAction: (e, t) =>
|
|
3139
|
-
}),
|
|
3140
|
-
editorView:
|
|
3141
|
-
getDocument:
|
|
3142
|
-
author: () =>
|
|
3143
|
-
commentsProp: () =>
|
|
3273
|
+
setPmSelection: St,
|
|
3274
|
+
resolvePos: xt,
|
|
3275
|
+
customContextMenuItems: () => u.value ? void 0 : o.customContextMenuItems,
|
|
3276
|
+
onCustomContextAction: (e, t) => o.onCustomContextAction?.(e, t)
|
|
3277
|
+
}), Lt = oe(X, E), Rt = N(() => Lt.value.entries), Q = Ai({
|
|
3278
|
+
editorView: X,
|
|
3279
|
+
getDocument: Z,
|
|
3280
|
+
author: () => o.author,
|
|
3281
|
+
commentsProp: () => o.comments,
|
|
3144
3282
|
onCommentsChange: (e) => {
|
|
3145
|
-
|
|
3283
|
+
o.onCommentsChange?.(e), s("comments-change", e);
|
|
3146
3284
|
},
|
|
3147
3285
|
reLayout: nt
|
|
3148
|
-
}),
|
|
3149
|
-
editorView:
|
|
3150
|
-
pagesViewport:
|
|
3151
|
-
pagesContainer:
|
|
3152
|
-
readOnly:
|
|
3286
|
+
}), zt = Q.comments, $ = ki({
|
|
3287
|
+
editorView: X,
|
|
3288
|
+
pagesViewport: se,
|
|
3289
|
+
pagesContainer: T,
|
|
3290
|
+
readOnly: u,
|
|
3153
3291
|
createComment: Q.createComment,
|
|
3154
3292
|
pushComment: Q.pushComment,
|
|
3155
3293
|
reLayout: nt,
|
|
3156
|
-
showSidebar:
|
|
3294
|
+
showSidebar: j,
|
|
3157
3295
|
setActiveSidebarItem: (e) => {
|
|
3158
|
-
|
|
3296
|
+
pe.value = e;
|
|
3159
3297
|
}
|
|
3160
3298
|
});
|
|
3161
|
-
function
|
|
3162
|
-
navigator.clipboard?.writeText(e),
|
|
3299
|
+
function Bt(e) {
|
|
3300
|
+
navigator.clipboard?.writeText(e), ft.value = null;
|
|
3163
3301
|
}
|
|
3164
|
-
let
|
|
3165
|
-
|
|
3166
|
-
let e =
|
|
3302
|
+
let Vt = N(() => {
|
|
3303
|
+
E.value;
|
|
3304
|
+
let e = Z()?.package.document;
|
|
3167
3305
|
return e ? e.finalSectionProperties ?? e.sections?.[0]?.properties ?? null : null;
|
|
3168
|
-
}),
|
|
3169
|
-
|
|
3306
|
+
}), Ht = N(() => {
|
|
3307
|
+
E.value;
|
|
3170
3308
|
let e = {};
|
|
3171
|
-
|
|
3172
|
-
let t =
|
|
3309
|
+
o.fontFamilies !== void 0 && (e.fontFamilies = o.fontFamilies);
|
|
3310
|
+
let t = Z()?.package.styles?.styles;
|
|
3173
3311
|
return t !== void 0 && (e.documentStyles = t), e;
|
|
3174
|
-
}),
|
|
3312
|
+
}), Ut = N(() => Ge(Vt.value?.pageWidth ?? 12240) * B.value), Wt = N(() => {
|
|
3175
3313
|
let e = /* @__PURE__ */ new Set();
|
|
3176
|
-
for (let t of
|
|
3314
|
+
for (let t of zt.value) t.done && e.add(t.id);
|
|
3177
3315
|
return e;
|
|
3178
|
-
}),
|
|
3179
|
-
transform:
|
|
3316
|
+
}), Gt = N(() => ({
|
|
3317
|
+
transform: B.value === 1 ? void 0 : `scale(${B.value})`,
|
|
3180
3318
|
transformOrigin: "top center",
|
|
3181
3319
|
transition: "transform 0.2s ease"
|
|
3182
|
-
})), { handleApplyStyle:
|
|
3183
|
-
editorView:
|
|
3184
|
-
getDocument:
|
|
3320
|
+
})), { handleApplyStyle: Kt, handleInsertSymbol: qt, handleInsertSectionBreakNextPage: Jt, handleInsertSectionBreakContinuous: Yt } = Yi({
|
|
3321
|
+
editorView: X,
|
|
3322
|
+
getDocument: Z
|
|
3185
3323
|
});
|
|
3186
|
-
function
|
|
3187
|
-
if (
|
|
3188
|
-
|
|
3324
|
+
function Xt() {
|
|
3325
|
+
if (o.onInsertImage) {
|
|
3326
|
+
o.onInsertImage();
|
|
3189
3327
|
return;
|
|
3190
3328
|
}
|
|
3191
|
-
let e =
|
|
3329
|
+
let e = X.value;
|
|
3192
3330
|
if (!e) return;
|
|
3193
3331
|
let t = document.createElement("input");
|
|
3194
3332
|
t.type = "file", t.accept = "image/*", t.style.display = "none", t.addEventListener("change", () => {
|
|
3195
3333
|
let n = t.files?.[0];
|
|
3196
|
-
n &&
|
|
3334
|
+
n && Pe(e, n, () => e.focus()), t.remove();
|
|
3197
3335
|
}), document.body.appendChild(t), t.click();
|
|
3198
3336
|
}
|
|
3199
|
-
function
|
|
3200
|
-
if (
|
|
3201
|
-
|
|
3337
|
+
function Zt(e, t) {
|
|
3338
|
+
if (o.onInsertTable) {
|
|
3339
|
+
o.onInsertTable(e, t);
|
|
3202
3340
|
return;
|
|
3203
3341
|
}
|
|
3204
|
-
let n =
|
|
3205
|
-
n && (
|
|
3342
|
+
let n = X.value;
|
|
3343
|
+
n && (Le(n, e, t), n.focus());
|
|
3206
3344
|
}
|
|
3207
|
-
function
|
|
3208
|
-
if (
|
|
3209
|
-
|
|
3345
|
+
function Qt() {
|
|
3346
|
+
if (o.onInsertPageBreak) {
|
|
3347
|
+
o.onInsertPageBreak();
|
|
3210
3348
|
return;
|
|
3211
3349
|
}
|
|
3212
|
-
let e =
|
|
3213
|
-
e && (
|
|
3350
|
+
let e = X.value;
|
|
3351
|
+
e && (Fe(e), e.focus());
|
|
3214
3352
|
}
|
|
3215
|
-
function
|
|
3216
|
-
if (
|
|
3217
|
-
|
|
3353
|
+
function $t() {
|
|
3354
|
+
if (o.onInsertTOC) {
|
|
3355
|
+
o.onInsertTOC();
|
|
3218
3356
|
return;
|
|
3219
3357
|
}
|
|
3220
|
-
let e =
|
|
3221
|
-
e && (
|
|
3222
|
-
}
|
|
3223
|
-
let { handlePageSetupApply:
|
|
3224
|
-
editorView:
|
|
3225
|
-
getDocument:
|
|
3226
|
-
readOnly:
|
|
3227
|
-
stateTick:
|
|
3358
|
+
let e = X.value;
|
|
3359
|
+
e && (ze(e), e.focus());
|
|
3360
|
+
}
|
|
3361
|
+
let { handlePageSetupApply: en, handleLeftMarginChange: tn, handleRightMarginChange: nn, handleTopMarginChange: rn, handleBottomMarginChange: an, handleIndentLeftChange: on, handleIndentRightChange: sn, handleFirstLineIndentChange: cn, handleTabStopRemove: ln } = ea({
|
|
3362
|
+
editorView: X,
|
|
3363
|
+
getDocument: Z,
|
|
3364
|
+
readOnly: u,
|
|
3365
|
+
stateTick: E,
|
|
3228
3366
|
reLayout: nt,
|
|
3229
3367
|
onChange: (e) => {
|
|
3230
|
-
|
|
3368
|
+
o.onChange?.(e), s("change", e), s("update:document", e);
|
|
3231
3369
|
}
|
|
3232
|
-
}),
|
|
3233
|
-
|
|
3234
|
-
let e =
|
|
3370
|
+
}), un = N(() => {
|
|
3371
|
+
E.value;
|
|
3372
|
+
let e = X.value, t = e ? Be(e.state).paragraphFormatting : {};
|
|
3235
3373
|
return {
|
|
3236
3374
|
indentLeft: t.indentLeft ?? 0,
|
|
3237
3375
|
indentRight: t.indentRight ?? 0,
|
|
@@ -3240,182 +3378,182 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3240
3378
|
tabs: t.tabs ?? null
|
|
3241
3379
|
};
|
|
3242
3380
|
});
|
|
3243
|
-
function
|
|
3244
|
-
|
|
3381
|
+
function dn(e) {
|
|
3382
|
+
l.value !== e && (l.value = e, o.onModeChange?.(e), s("mode-change", e));
|
|
3245
3383
|
}
|
|
3246
|
-
function
|
|
3384
|
+
function fn(e) {
|
|
3247
3385
|
switch (e) {
|
|
3248
3386
|
case "find":
|
|
3249
3387
|
case "findReplace":
|
|
3250
|
-
|
|
3388
|
+
D.value = !0;
|
|
3251
3389
|
break;
|
|
3252
3390
|
case "insertSymbol":
|
|
3253
|
-
|
|
3391
|
+
fe.value = !0;
|
|
3254
3392
|
break;
|
|
3255
3393
|
case "insertHyperlink":
|
|
3256
|
-
|
|
3394
|
+
ue.value = !0;
|
|
3257
3395
|
break;
|
|
3258
3396
|
case "pageSetup":
|
|
3259
|
-
|
|
3397
|
+
k.value = !0;
|
|
3260
3398
|
break;
|
|
3261
3399
|
case "toggleOutline":
|
|
3262
|
-
|
|
3400
|
+
Ot.handleToggleOutline();
|
|
3263
3401
|
break;
|
|
3264
3402
|
case "toggleSidebar":
|
|
3265
|
-
|
|
3403
|
+
j.value = !j.value;
|
|
3266
3404
|
break;
|
|
3267
3405
|
case "insertImage":
|
|
3268
|
-
|
|
3406
|
+
Xt();
|
|
3269
3407
|
break;
|
|
3270
3408
|
case "insertPageBreak":
|
|
3271
|
-
|
|
3409
|
+
Qt();
|
|
3272
3410
|
break;
|
|
3273
3411
|
case "insertSectionBreakNextPage":
|
|
3274
|
-
|
|
3412
|
+
Jt();
|
|
3275
3413
|
break;
|
|
3276
3414
|
case "insertSectionBreakContinuous":
|
|
3277
|
-
|
|
3415
|
+
Yt();
|
|
3278
3416
|
break;
|
|
3279
3417
|
case "insertTOC":
|
|
3280
|
-
|
|
3418
|
+
$t();
|
|
3281
3419
|
break;
|
|
3282
3420
|
default: break;
|
|
3283
3421
|
}
|
|
3284
|
-
|
|
3285
|
-
}
|
|
3286
|
-
function
|
|
3287
|
-
|
|
3288
|
-
}
|
|
3289
|
-
let
|
|
3290
|
-
|
|
3291
|
-
documentBuffer: () =>
|
|
3292
|
-
document: () =>
|
|
3293
|
-
loadDocumentBuffer:
|
|
3294
|
-
loadDocument:
|
|
3295
|
-
sidebarAutoOpenedRef:
|
|
3296
|
-
}),
|
|
3297
|
-
e && e !==
|
|
3298
|
-
}),
|
|
3299
|
-
|
|
3422
|
+
s("menu-action", e);
|
|
3423
|
+
}
|
|
3424
|
+
function pn(e, t) {
|
|
3425
|
+
Zt(e, t);
|
|
3426
|
+
}
|
|
3427
|
+
let mn = W(!1);
|
|
3428
|
+
Ui({
|
|
3429
|
+
documentBuffer: () => o.documentBuffer ?? null,
|
|
3430
|
+
document: () => o.document ?? null,
|
|
3431
|
+
loadDocumentBuffer: Ze,
|
|
3432
|
+
loadDocument: Qe,
|
|
3433
|
+
sidebarAutoOpenedRef: mn
|
|
3434
|
+
}), J(() => o.mode, (e) => {
|
|
3435
|
+
e && e !== l.value && (l.value = e);
|
|
3436
|
+
}), J(() => o.showOutline, (e) => {
|
|
3437
|
+
A.value = !!e, Ot.recomputeHeadingsIfOpen();
|
|
3300
3438
|
});
|
|
3301
|
-
let
|
|
3302
|
-
function
|
|
3439
|
+
let hn = W(!1);
|
|
3440
|
+
function gn(e) {
|
|
3303
3441
|
let t = e.currentTarget;
|
|
3304
|
-
t instanceof HTMLElement &&
|
|
3442
|
+
t instanceof HTMLElement && o.onScrollTopChange?.(t.scrollTop);
|
|
3305
3443
|
}
|
|
3306
|
-
function
|
|
3307
|
-
if (
|
|
3308
|
-
|
|
3309
|
-
let e =
|
|
3444
|
+
function _n() {
|
|
3445
|
+
if (o.initialScrollTop === void 0 || hn.value) return;
|
|
3446
|
+
hn.value = !0;
|
|
3447
|
+
let e = o.initialScrollTop;
|
|
3310
3448
|
requestAnimationFrame(() => {
|
|
3311
3449
|
ce.value && (ce.value.scrollTop = e);
|
|
3312
3450
|
});
|
|
3313
3451
|
}
|
|
3314
|
-
|
|
3452
|
+
J(Re, (e) => {
|
|
3315
3453
|
if (!e) {
|
|
3316
|
-
|
|
3454
|
+
hn.value = !1;
|
|
3317
3455
|
return;
|
|
3318
3456
|
}
|
|
3319
|
-
|
|
3320
|
-
let t =
|
|
3321
|
-
t &&
|
|
3322
|
-
}),
|
|
3323
|
-
let e =
|
|
3324
|
-
|
|
3325
|
-
}), t =
|
|
3326
|
-
|
|
3327
|
-
}), n =
|
|
3328
|
-
|
|
3329
|
-
}), r =
|
|
3330
|
-
|
|
3457
|
+
re.value = !0, Ot.recomputeHeadingsIfOpen(), Q.seedFromDocument();
|
|
3458
|
+
let t = Z();
|
|
3459
|
+
t && o.onCompatibilityChange?.(Ve(t)), o.autoOpenReviewSidebar !== !1 && !mn.value && (zt.value.length > 0 || Rt.value.length > 0) && (mn.value = !0, j.value = !0), _n(), s("ready");
|
|
3460
|
+
}), Se(() => {
|
|
3461
|
+
let e = Ne.on("selectionChange", () => {
|
|
3462
|
+
E.value++, $.updateFloatingButton();
|
|
3463
|
+
}), t = Ne.on("docChange", () => {
|
|
3464
|
+
E.value++, Ot.recomputeHeadingsIfOpen();
|
|
3465
|
+
}), n = Ne.on("layoutComplete", () => {
|
|
3466
|
+
E.value++;
|
|
3467
|
+
}), r = vt.install(), i = We(() => o.onFontsLoaded?.());
|
|
3468
|
+
xe(() => {
|
|
3331
3469
|
e(), t(), n(), r(), i();
|
|
3332
3470
|
});
|
|
3333
3471
|
});
|
|
3334
|
-
let { exposed:
|
|
3335
|
-
editor:
|
|
3336
|
-
editorView:
|
|
3337
|
-
isDirty:
|
|
3472
|
+
let { exposed: vn } = Ji({
|
|
3473
|
+
editor: Ne,
|
|
3474
|
+
editorView: X,
|
|
3475
|
+
isDirty: Ke,
|
|
3338
3476
|
commentsDirty: Q.commentsDirty,
|
|
3339
3477
|
clearCommentsDirty: Q.clearCommentsDirty,
|
|
3340
|
-
layout:
|
|
3341
|
-
pagesRef:
|
|
3342
|
-
pagesViewportRef:
|
|
3343
|
-
zoom:
|
|
3344
|
-
scrollVisiblePositionIntoView:
|
|
3345
|
-
author: () =>
|
|
3478
|
+
layout: Je,
|
|
3479
|
+
pagesRef: T,
|
|
3480
|
+
pagesViewportRef: se,
|
|
3481
|
+
zoom: B,
|
|
3482
|
+
scrollVisiblePositionIntoView: Ct,
|
|
3483
|
+
author: () => o.author,
|
|
3346
3484
|
createAIEditComment: (e) => {
|
|
3347
3485
|
let t = Q.createComment(e);
|
|
3348
3486
|
return Q.pushComment(t), t.id;
|
|
3349
3487
|
},
|
|
3350
3488
|
focus: tt,
|
|
3351
|
-
getDocument:
|
|
3352
|
-
setZoom:
|
|
3353
|
-
save:
|
|
3354
|
-
loadDocument:
|
|
3355
|
-
loadDocumentBuffer:
|
|
3356
|
-
onPrint:
|
|
3357
|
-
onSave:
|
|
3489
|
+
getDocument: Z,
|
|
3490
|
+
setZoom: Ce,
|
|
3491
|
+
save: $e,
|
|
3492
|
+
loadDocument: Qe,
|
|
3493
|
+
loadDocumentBuffer: Ze,
|
|
3494
|
+
onPrint: o.onPrint,
|
|
3495
|
+
onSave: o.onSave
|
|
3358
3496
|
});
|
|
3359
|
-
return n(
|
|
3360
|
-
class:
|
|
3497
|
+
return n(vn), (e, n) => (U(), I("div", {
|
|
3498
|
+
class: V([
|
|
3361
3499
|
"docx-editor-vue ep-root paged-editor",
|
|
3362
|
-
|
|
3500
|
+
t.className,
|
|
3363
3501
|
b.value,
|
|
3364
|
-
{ "paged-editor--readonly":
|
|
3502
|
+
{ "paged-editor--readonly": u.value }
|
|
3365
3503
|
]),
|
|
3366
|
-
style:
|
|
3504
|
+
style: H(t.style)
|
|
3367
3505
|
}, [
|
|
3368
|
-
|
|
3369
|
-
"show-table-insert":
|
|
3370
|
-
onRename: n[0] ||= (e) =>
|
|
3371
|
-
onMenuAction:
|
|
3372
|
-
onInsertTable:
|
|
3506
|
+
L("div", ba, [z(_r, {
|
|
3507
|
+
"show-table-insert": o.showTableInsert !== !1,
|
|
3508
|
+
onRename: n[0] ||= (e) => s("rename", e),
|
|
3509
|
+
onMenuAction: fn,
|
|
3510
|
+
onInsertTable: pn
|
|
3373
3511
|
}, {
|
|
3374
|
-
"title-bar-left":
|
|
3375
|
-
"title-bar-right":
|
|
3512
|
+
"title-bar-left": De(() => [we(e.$slots, "title-bar-left", {}, void 0, !0)]),
|
|
3513
|
+
"title-bar-right": De(() => [we(e.$slots, "title-bar-right", {}, void 0, !0)]),
|
|
3376
3514
|
_: 3
|
|
3377
|
-
}, 8, ["show-table-insert"]),
|
|
3515
|
+
}, 8, ["show-table-insert"]), t.showToolbar ? (U(), P(v, ye({
|
|
3378
3516
|
key: 0,
|
|
3379
|
-
view:
|
|
3380
|
-
"get-commands":
|
|
3381
|
-
"state-tick":
|
|
3382
|
-
"zoom-percent":
|
|
3383
|
-
"is-min-zoom":
|
|
3384
|
-
"is-max-zoom":
|
|
3385
|
-
"zoom-presets":
|
|
3386
|
-
"show-zoom-control":
|
|
3387
|
-
"editor-mode":
|
|
3388
|
-
"show-review-controls":
|
|
3389
|
-
"track-changes-on":
|
|
3390
|
-
"display-mode":
|
|
3391
|
-
"read-only":
|
|
3392
|
-
"comments-sidebar-open":
|
|
3393
|
-
"image-context":
|
|
3394
|
-
theme:
|
|
3395
|
-
},
|
|
3396
|
-
onFindReplace: n[1] ||= (e) =>
|
|
3397
|
-
onInsertLink: n[2] ||= (e) =>
|
|
3398
|
-
onInsertSymbol: n[3] ||= (e) =>
|
|
3399
|
-
onInsertPageBreak:
|
|
3400
|
-
onPageSetup: n[4] ||= (e) =>
|
|
3401
|
-
onToggleOutline:
|
|
3402
|
-
onApplyStyle:
|
|
3403
|
-
onZoomIn:
|
|
3404
|
-
onZoomOut:
|
|
3405
|
-
onZoomSet:
|
|
3406
|
-
onToggleSidebar: n[
|
|
3407
|
-
onModeChange:
|
|
3517
|
+
view: q(X),
|
|
3518
|
+
"get-commands": q(et),
|
|
3519
|
+
"state-tick": E.value,
|
|
3520
|
+
"zoom-percent": q(_e),
|
|
3521
|
+
"is-min-zoom": q(ve),
|
|
3522
|
+
"is-max-zoom": q(be),
|
|
3523
|
+
"zoom-presets": q(Ae),
|
|
3524
|
+
"show-zoom-control": t.showZoomControl,
|
|
3525
|
+
"editor-mode": l.value,
|
|
3526
|
+
"show-review-controls": d.value,
|
|
3527
|
+
"track-changes-on": f.value,
|
|
3528
|
+
"display-mode": p.value,
|
|
3529
|
+
"read-only": u.value,
|
|
3530
|
+
"comments-sidebar-open": j.value,
|
|
3531
|
+
"image-context": q(st),
|
|
3532
|
+
theme: t.theme ?? null
|
|
3533
|
+
}, Ht.value, {
|
|
3534
|
+
onFindReplace: n[1] ||= (e) => D.value = !0,
|
|
3535
|
+
onInsertLink: n[2] ||= (e) => ue.value = !0,
|
|
3536
|
+
onInsertSymbol: n[3] ||= (e) => fe.value = !0,
|
|
3537
|
+
onInsertPageBreak: Qt,
|
|
3538
|
+
onPageSetup: n[4] ||= (e) => k.value = !0,
|
|
3539
|
+
onToggleOutline: q(Ot).handleToggleOutline,
|
|
3540
|
+
onApplyStyle: q(Kt),
|
|
3541
|
+
onZoomIn: q(G),
|
|
3542
|
+
onZoomOut: q(Ee),
|
|
3543
|
+
onZoomSet: q(Ce),
|
|
3544
|
+
onToggleSidebar: n[5] ||= (e) => j.value = !j.value,
|
|
3545
|
+
onModeChange: dn,
|
|
3408
3546
|
onToggleTrackChanges: m,
|
|
3409
|
-
"onUpdate:displayMode":
|
|
3410
|
-
onImageProperties: n[
|
|
3411
|
-
onImageWrapType:
|
|
3412
|
-
onImageTransform:
|
|
3413
|
-
}),
|
|
3414
|
-
"table-context":
|
|
3415
|
-
view:
|
|
3416
|
-
"get-commands":
|
|
3417
|
-
"state-tick":
|
|
3418
|
-
theme:
|
|
3547
|
+
"onUpdate:displayMode": g,
|
|
3548
|
+
onImageProperties: n[6] ||= (e) => O.value = !0,
|
|
3549
|
+
onImageWrapType: q(ct),
|
|
3550
|
+
onImageTransform: q(dt)
|
|
3551
|
+
}), he({
|
|
3552
|
+
"table-context": De(() => [z(ee, {
|
|
3553
|
+
view: q(X),
|
|
3554
|
+
"get-commands": q(et),
|
|
3555
|
+
"state-tick": E.value,
|
|
3556
|
+
theme: t.theme ?? null
|
|
3419
3557
|
}, null, 8, [
|
|
3420
3558
|
"view",
|
|
3421
3559
|
"get-commands",
|
|
@@ -3423,12 +3561,12 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3423
3561
|
"theme"
|
|
3424
3562
|
])]),
|
|
3425
3563
|
_: 2
|
|
3426
|
-
}, [
|
|
3564
|
+
}, [e.$slots["toolbar-extra"] || t.toolbarExtra ? {
|
|
3427
3565
|
name: "toolbar-extra",
|
|
3428
|
-
fn:
|
|
3566
|
+
fn: De(() => [we(e.$slots, "toolbar-extra", {}, () => [t.toolbarExtra ? (U(), P(S, {
|
|
3429
3567
|
key: 0,
|
|
3430
|
-
node:
|
|
3431
|
-
}, null, 8, ["node"])) :
|
|
3568
|
+
node: t.toolbarExtra
|
|
3569
|
+
}, null, 8, ["node"])) : F("", !0)], !0)]),
|
|
3432
3570
|
key: "0"
|
|
3433
3571
|
} : void 0]), 1040, [
|
|
3434
3572
|
"view",
|
|
@@ -3447,32 +3585,33 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3447
3585
|
"comments-sidebar-open",
|
|
3448
3586
|
"image-context",
|
|
3449
3587
|
"theme",
|
|
3588
|
+
"onToggleOutline",
|
|
3450
3589
|
"onApplyStyle",
|
|
3451
3590
|
"onZoomIn",
|
|
3452
3591
|
"onZoomOut",
|
|
3453
3592
|
"onZoomSet",
|
|
3454
3593
|
"onImageWrapType",
|
|
3455
3594
|
"onImageTransform"
|
|
3456
|
-
])) :
|
|
3457
|
-
|
|
3458
|
-
"show-find-replace":
|
|
3459
|
-
"onUpdate:showFindReplace": n[
|
|
3460
|
-
"show-hyperlink":
|
|
3461
|
-
"onUpdate:showHyperlink": n[
|
|
3462
|
-
"show-insert-symbol":
|
|
3463
|
-
"onUpdate:showInsertSymbol": n[
|
|
3464
|
-
"show-image-properties":
|
|
3465
|
-
"onUpdate:showImageProperties": n[
|
|
3466
|
-
"show-page-setup":
|
|
3467
|
-
"onUpdate:showPageSetup": n[
|
|
3468
|
-
view:
|
|
3469
|
-
bookmarks:
|
|
3470
|
-
"selected-image-pm-pos":
|
|
3471
|
-
"section-properties":
|
|
3472
|
-
onInsertSymbol:
|
|
3473
|
-
onHyperlinkSubmit:
|
|
3474
|
-
onHyperlinkRemove:
|
|
3475
|
-
onPageSetupApply:
|
|
3595
|
+
])) : F("", !0)]),
|
|
3596
|
+
z(fr, {
|
|
3597
|
+
"show-find-replace": D.value,
|
|
3598
|
+
"onUpdate:showFindReplace": n[7] ||= (e) => D.value = e,
|
|
3599
|
+
"show-hyperlink": ue.value,
|
|
3600
|
+
"onUpdate:showHyperlink": n[8] ||= (e) => ue.value = e,
|
|
3601
|
+
"show-insert-symbol": fe.value,
|
|
3602
|
+
"onUpdate:showInsertSymbol": n[9] ||= (e) => fe.value = e,
|
|
3603
|
+
"show-image-properties": O.value,
|
|
3604
|
+
"onUpdate:showImageProperties": n[10] ||= (e) => O.value = e,
|
|
3605
|
+
"show-page-setup": k.value,
|
|
3606
|
+
"onUpdate:showPageSetup": n[11] ||= (e) => k.value = e,
|
|
3607
|
+
view: q(X),
|
|
3608
|
+
bookmarks: me.value,
|
|
3609
|
+
"selected-image-pm-pos": q(at)?.pmPos ?? null,
|
|
3610
|
+
"section-properties": Vt.value,
|
|
3611
|
+
onInsertSymbol: q(qt),
|
|
3612
|
+
onHyperlinkSubmit: q(pt),
|
|
3613
|
+
onHyperlinkRemove: q(mt),
|
|
3614
|
+
onPageSetupApply: q(en)
|
|
3476
3615
|
}, null, 8, [
|
|
3477
3616
|
"show-find-replace",
|
|
3478
3617
|
"show-hyperlink",
|
|
@@ -3488,41 +3627,41 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3488
3627
|
"onHyperlinkRemove",
|
|
3489
3628
|
"onPageSetupApply"
|
|
3490
3629
|
]),
|
|
3491
|
-
|
|
3630
|
+
q(qe) ? (U(), I("div", xa, K(q(qe)), 1)) : rt.value ? (U(), I("div", Sa, [we(e.$slots, "loading-indicator", {}, () => [t.loadingIndicator ? (U(), P(S, {
|
|
3492
3631
|
key: 0,
|
|
3493
|
-
node:
|
|
3494
|
-
}, null, 8, ["node"])) : (
|
|
3632
|
+
node: t.loadingIndicator
|
|
3633
|
+
}, null, 8, ["node"])) : (U(), I(M, { key: 1 }, [R(K(q(x)("loadingDocument")), 1)], 64))], !0)])) : !q(Re) && !te.value ? (U(), I("div", Ca, [we(e.$slots, "placeholder", {}, () => [t.placeholder ? (U(), P(S, {
|
|
3495
3634
|
key: 0,
|
|
3496
|
-
node:
|
|
3497
|
-
}, null, 8, ["node"])) : (
|
|
3498
|
-
|
|
3635
|
+
node: t.placeholder
|
|
3636
|
+
}, null, 8, ["node"])) : (U(), I(M, { key: 1 }, [R("No document loaded")], 64))], !0)])) : F("", !0),
|
|
3637
|
+
L("div", {
|
|
3499
3638
|
ref_key: "hiddenPmRef",
|
|
3500
|
-
ref:
|
|
3639
|
+
ref: ie,
|
|
3501
3640
|
class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
|
|
3502
3641
|
}, null, 512),
|
|
3503
|
-
|
|
3642
|
+
L("div", {
|
|
3504
3643
|
ref_key: "editorScrollRef",
|
|
3505
3644
|
ref: ce,
|
|
3506
3645
|
class: "docx-editor-vue__editor-scroll",
|
|
3507
|
-
onScroll:
|
|
3508
|
-
}, [
|
|
3509
|
-
|
|
3510
|
-
"section-props":
|
|
3511
|
-
zoom:
|
|
3512
|
-
unit:
|
|
3513
|
-
editable: !
|
|
3514
|
-
"indent-left":
|
|
3515
|
-
"indent-right":
|
|
3516
|
-
"first-line-indent":
|
|
3517
|
-
"hanging-indent":
|
|
3646
|
+
onScroll: gn
|
|
3647
|
+
}, [L("div", wa, [
|
|
3648
|
+
le.value && !u.value ? (U(), I("div", Ta, [z(ne, {
|
|
3649
|
+
"section-props": Vt.value,
|
|
3650
|
+
zoom: q(B),
|
|
3651
|
+
unit: t.rulerUnit ?? "inch",
|
|
3652
|
+
editable: !u.value,
|
|
3653
|
+
"indent-left": un.value.indentLeft,
|
|
3654
|
+
"indent-right": un.value.indentRight,
|
|
3655
|
+
"first-line-indent": un.value.firstLineIndent,
|
|
3656
|
+
"hanging-indent": un.value.hangingIndent,
|
|
3518
3657
|
"show-first-line-indent": !0,
|
|
3519
|
-
"tab-stops":
|
|
3520
|
-
onLeftMarginChange:
|
|
3521
|
-
onRightMarginChange:
|
|
3522
|
-
onIndentLeftChange:
|
|
3523
|
-
onIndentRightChange:
|
|
3524
|
-
onFirstLineIndentChange:
|
|
3525
|
-
onTabStopRemove:
|
|
3658
|
+
"tab-stops": un.value.tabs,
|
|
3659
|
+
onLeftMarginChange: q(tn),
|
|
3660
|
+
onRightMarginChange: q(nn),
|
|
3661
|
+
onIndentLeftChange: q(on),
|
|
3662
|
+
onIndentRightChange: q(sn),
|
|
3663
|
+
onFirstLineIndentChange: q(cn),
|
|
3664
|
+
onTabStopRemove: q(ln)
|
|
3526
3665
|
}, null, 8, [
|
|
3527
3666
|
"section-props",
|
|
3528
3667
|
"zoom",
|
|
@@ -3539,14 +3678,14 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3539
3678
|
"onIndentRightChange",
|
|
3540
3679
|
"onFirstLineIndentChange",
|
|
3541
3680
|
"onTabStopRemove"
|
|
3542
|
-
])])) :
|
|
3543
|
-
|
|
3544
|
-
"section-props":
|
|
3545
|
-
zoom:
|
|
3546
|
-
unit:
|
|
3547
|
-
editable: !
|
|
3548
|
-
onTopMarginChange:
|
|
3549
|
-
onBottomMarginChange:
|
|
3681
|
+
])])) : F("", !0),
|
|
3682
|
+
le.value && !u.value ? (U(), I("div", Ea, [z(y, {
|
|
3683
|
+
"section-props": Vt.value,
|
|
3684
|
+
zoom: q(B),
|
|
3685
|
+
unit: t.rulerUnit ?? "inch",
|
|
3686
|
+
editable: !u.value,
|
|
3687
|
+
onTopMarginChange: q(rn),
|
|
3688
|
+
onBottomMarginChange: q(an)
|
|
3550
3689
|
}, null, 8, [
|
|
3551
3690
|
"section-props",
|
|
3552
3691
|
"zoom",
|
|
@@ -3554,33 +3693,33 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3554
3693
|
"editable",
|
|
3555
3694
|
"onTopMarginChange",
|
|
3556
3695
|
"onBottomMarginChange"
|
|
3557
|
-
])])) :
|
|
3558
|
-
|
|
3696
|
+
])])) : F("", !0),
|
|
3697
|
+
L("div", {
|
|
3559
3698
|
ref_key: "pagesViewportRef",
|
|
3560
|
-
ref:
|
|
3699
|
+
ref: se,
|
|
3561
3700
|
class: "docx-editor-vue__pages-viewport",
|
|
3562
|
-
onWheel:
|
|
3563
|
-
onMousedown: n[
|
|
3564
|
-
onMousemove: n[
|
|
3565
|
-
onClick: n[
|
|
3566
|
-
onContextmenu: n[
|
|
3701
|
+
onWheel: Me,
|
|
3702
|
+
onMousedown: n[20] ||= (...e) => q(wt) && q(wt)(...e),
|
|
3703
|
+
onMousemove: n[21] ||= (...e) => q(Tt) && q(Tt)(...e),
|
|
3704
|
+
onClick: n[22] ||= (...e) => q(Et) && q(Et)(...e),
|
|
3705
|
+
onContextmenu: n[23] ||= Y((...e) => q(Nt) && q(Nt)(...e), ["prevent"])
|
|
3567
3706
|
}, [
|
|
3568
|
-
|
|
3707
|
+
L("div", Da, [L("div", {
|
|
3569
3708
|
ref_key: "pagesRef",
|
|
3570
|
-
ref:
|
|
3709
|
+
ref: T,
|
|
3571
3710
|
class: "docx-editor-vue__pages paged-editor__pages",
|
|
3572
|
-
style:
|
|
3573
|
-
}, null, 4),
|
|
3574
|
-
"get-view": () =>
|
|
3575
|
-
"get-pages-container": () =>
|
|
3576
|
-
"editor-state":
|
|
3577
|
-
zoom:
|
|
3578
|
-
layout:
|
|
3579
|
-
blocks:
|
|
3580
|
-
measures:
|
|
3581
|
-
"on-term-click":
|
|
3582
|
-
"selected-canonical":
|
|
3583
|
-
"selection-seq":
|
|
3711
|
+
style: H(Gt.value)
|
|
3712
|
+
}, null, 4), L("div", Oa, [z(sr, {
|
|
3713
|
+
"get-view": () => q(X),
|
|
3714
|
+
"get-pages-container": () => T.value,
|
|
3715
|
+
"editor-state": q(Ie),
|
|
3716
|
+
zoom: q(B),
|
|
3717
|
+
layout: q(Je),
|
|
3718
|
+
blocks: q(Ye),
|
|
3719
|
+
measures: q(Xe),
|
|
3720
|
+
"on-term-click": o.onAnonymizationTermClick,
|
|
3721
|
+
"selected-canonical": o.selectedAnonymizationCanonical,
|
|
3722
|
+
"selection-seq": o.anonymizationSelectionSeq
|
|
3584
3723
|
}, null, 8, [
|
|
3585
3724
|
"get-view",
|
|
3586
3725
|
"get-pages-container",
|
|
@@ -3592,15 +3731,15 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3592
3731
|
"on-term-click",
|
|
3593
3732
|
"selected-canonical",
|
|
3594
3733
|
"selection-seq"
|
|
3595
|
-
]),
|
|
3734
|
+
]), o.showTemplateDirectives ? (U(), P(fi, {
|
|
3596
3735
|
key: 0,
|
|
3597
|
-
"get-view": () =>
|
|
3598
|
-
"get-pages-container": () =>
|
|
3599
|
-
"editor-state":
|
|
3600
|
-
zoom:
|
|
3601
|
-
layout:
|
|
3602
|
-
blocks:
|
|
3603
|
-
measures:
|
|
3736
|
+
"get-view": () => q(X),
|
|
3737
|
+
"get-pages-container": () => T.value,
|
|
3738
|
+
"editor-state": q(Ie),
|
|
3739
|
+
zoom: q(B),
|
|
3740
|
+
layout: q(Je),
|
|
3741
|
+
blocks: q(Ye),
|
|
3742
|
+
measures: q(Xe)
|
|
3604
3743
|
}, null, 8, [
|
|
3605
3744
|
"get-view",
|
|
3606
3745
|
"get-pages-container",
|
|
@@ -3609,29 +3748,29 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3609
3748
|
"layout",
|
|
3610
3749
|
"blocks",
|
|
3611
3750
|
"measures"
|
|
3612
|
-
])) :
|
|
3613
|
-
|
|
3614
|
-
"image-info":
|
|
3615
|
-
zoom:
|
|
3616
|
-
view:
|
|
3617
|
-
onDeselect: n[
|
|
3618
|
-
onInteractStart: n[
|
|
3619
|
-
onInteractEnd: n[
|
|
3620
|
-
onContextMenu:
|
|
3751
|
+
])) : F("", !0)])]),
|
|
3752
|
+
z(ti, {
|
|
3753
|
+
"image-info": q(at),
|
|
3754
|
+
zoom: q(B),
|
|
3755
|
+
view: q(X),
|
|
3756
|
+
onDeselect: n[12] ||= (e) => at.value = null,
|
|
3757
|
+
onInteractStart: n[13] ||= (e) => ot.value = !0,
|
|
3758
|
+
onInteractEnd: n[14] ||= (e) => ot.value = !1,
|
|
3759
|
+
onContextMenu: q(Pt)
|
|
3621
3760
|
}, null, 8, [
|
|
3622
3761
|
"image-info",
|
|
3623
3762
|
"zoom",
|
|
3624
3763
|
"view",
|
|
3625
3764
|
"onContextMenu"
|
|
3626
3765
|
]),
|
|
3627
|
-
|
|
3628
|
-
data:
|
|
3629
|
-
"read-only":
|
|
3630
|
-
onNavigate:
|
|
3631
|
-
onCopy:
|
|
3632
|
-
onEdit:
|
|
3633
|
-
onRemove:
|
|
3634
|
-
onClose: n[
|
|
3766
|
+
z(Si, {
|
|
3767
|
+
data: q(ft),
|
|
3768
|
+
"read-only": u.value,
|
|
3769
|
+
onNavigate: q(ht),
|
|
3770
|
+
onCopy: Bt,
|
|
3771
|
+
onEdit: q(gt),
|
|
3772
|
+
onRemove: q(_t),
|
|
3773
|
+
onClose: n[15] ||= (e) => ft.value = null
|
|
3635
3774
|
}, null, 8, [
|
|
3636
3775
|
"data",
|
|
3637
3776
|
"read-only",
|
|
@@ -3639,24 +3778,24 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3639
3778
|
"onEdit",
|
|
3640
3779
|
"onRemove"
|
|
3641
3780
|
]),
|
|
3642
|
-
|
|
3781
|
+
q(yt) ? (U(), I("button", {
|
|
3643
3782
|
key: 0,
|
|
3644
3783
|
type: "button",
|
|
3645
3784
|
class: "docx-editor-vue__table-insert-btn",
|
|
3646
|
-
style:
|
|
3647
|
-
left:
|
|
3648
|
-
top:
|
|
3785
|
+
style: H({
|
|
3786
|
+
left: q(yt).x + "px",
|
|
3787
|
+
top: q(yt).y + "px"
|
|
3649
3788
|
}),
|
|
3650
|
-
"aria-label":
|
|
3651
|
-
onMousedown: n[
|
|
3652
|
-
}, " + ", 44,
|
|
3653
|
-
|
|
3654
|
-
comments:
|
|
3655
|
-
"pages-container":
|
|
3656
|
-
zoom:
|
|
3657
|
-
"page-width-px":
|
|
3658
|
-
"sidebar-open":
|
|
3659
|
-
"resolved-comment-ids":
|
|
3789
|
+
"aria-label": q(yt).type === "row" ? "Insert row" : "Insert column",
|
|
3790
|
+
onMousedown: n[16] ||= (...e) => q(Dt) && q(Dt)(...e)
|
|
3791
|
+
}, " + ", 44, ka)) : F("", !0),
|
|
3792
|
+
z(h, {
|
|
3793
|
+
comments: q(zt),
|
|
3794
|
+
"pages-container": T.value,
|
|
3795
|
+
zoom: q(B),
|
|
3796
|
+
"page-width-px": Ut.value,
|
|
3797
|
+
"sidebar-open": j.value,
|
|
3798
|
+
"resolved-comment-ids": Wt.value,
|
|
3660
3799
|
onMarkerClick: () => {}
|
|
3661
3800
|
}, null, 8, [
|
|
3662
3801
|
"comments",
|
|
@@ -3666,30 +3805,30 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3666
3805
|
"sidebar-open",
|
|
3667
3806
|
"resolved-comment-ids"
|
|
3668
3807
|
]),
|
|
3669
|
-
|
|
3670
|
-
"is-open":
|
|
3671
|
-
comments:
|
|
3672
|
-
"tracked-changes":
|
|
3808
|
+
z(_, {
|
|
3809
|
+
"is-open": j.value,
|
|
3810
|
+
comments: q(zt),
|
|
3811
|
+
"tracked-changes": Rt.value,
|
|
3673
3812
|
"show-resolved": !0,
|
|
3674
|
-
"is-adding-comment":
|
|
3675
|
-
"add-comment-y-position":
|
|
3676
|
-
"pages-container":
|
|
3677
|
-
"page-width-px":
|
|
3678
|
-
zoom:
|
|
3679
|
-
"active-item-id":
|
|
3680
|
-
onClose: n[
|
|
3681
|
-
"onUpdate:activeItemId": n[
|
|
3682
|
-
onAddComment:
|
|
3683
|
-
onCancelAddComment:
|
|
3684
|
-
onCommentReply:
|
|
3685
|
-
onCommentResolve:
|
|
3686
|
-
onCommentUnresolve:
|
|
3687
|
-
onCommentDelete:
|
|
3688
|
-
onAcceptChange:
|
|
3689
|
-
onRejectChange:
|
|
3690
|
-
onAcceptChangeById:
|
|
3691
|
-
onRejectChangeById:
|
|
3692
|
-
onTrackedChangeReply:
|
|
3813
|
+
"is-adding-comment": q($).isAddingComment.value,
|
|
3814
|
+
"add-comment-y-position": q($).addCommentYPosition.value,
|
|
3815
|
+
"pages-container": T.value,
|
|
3816
|
+
"page-width-px": Ut.value,
|
|
3817
|
+
zoom: q(B),
|
|
3818
|
+
"active-item-id": pe.value,
|
|
3819
|
+
onClose: n[17] ||= (e) => j.value = !1,
|
|
3820
|
+
"onUpdate:activeItemId": n[18] ||= (e) => pe.value = e,
|
|
3821
|
+
onAddComment: q($).handleAddComment,
|
|
3822
|
+
onCancelAddComment: q($).handleCancelAddComment,
|
|
3823
|
+
onCommentReply: q(Q).handleReply,
|
|
3824
|
+
onCommentResolve: q(Q).handleResolve,
|
|
3825
|
+
onCommentUnresolve: q(Q).handleUnresolve,
|
|
3826
|
+
onCommentDelete: q(Q).handleDelete,
|
|
3827
|
+
onAcceptChange: q(Q).handleAcceptChange,
|
|
3828
|
+
onRejectChange: q(Q).handleRejectChange,
|
|
3829
|
+
onAcceptChangeById: q(Q).handleAcceptChangeById,
|
|
3830
|
+
onRejectChangeById: q(Q).handleRejectChangeById,
|
|
3831
|
+
onTrackedChangeReply: q(Q).handleTrackedChangeReply
|
|
3693
3832
|
}, null, 8, [
|
|
3694
3833
|
"is-open",
|
|
3695
3834
|
"comments",
|
|
@@ -3712,56 +3851,62 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3712
3851
|
"onRejectChangeById",
|
|
3713
3852
|
"onTrackedChangeReply"
|
|
3714
3853
|
]),
|
|
3715
|
-
|
|
3854
|
+
q($).floatingCommentButton.value && !u.value ? (U(), I("button", {
|
|
3716
3855
|
key: 1,
|
|
3717
3856
|
type: "button",
|
|
3718
3857
|
class: "docx-editor-vue__add-comment-btn",
|
|
3719
|
-
style:
|
|
3720
|
-
top:
|
|
3721
|
-
left:
|
|
3858
|
+
style: H({
|
|
3859
|
+
top: q($).floatingCommentButton.value.top + "px",
|
|
3860
|
+
left: q($).floatingCommentButton.value.left + "px"
|
|
3722
3861
|
}),
|
|
3723
3862
|
"aria-label": "Add comment",
|
|
3724
3863
|
title: "Add comment",
|
|
3725
|
-
onMousedown: n[
|
|
3726
|
-
}, [
|
|
3864
|
+
onMousedown: n[19] ||= Y((...e) => q($).startAddComment && q($).startAddComment(...e), ["prevent", "stop"])
|
|
3865
|
+
}, [z(r, {
|
|
3727
3866
|
name: "add_comment",
|
|
3728
3867
|
size: 18
|
|
3729
|
-
})], 36)) :
|
|
3868
|
+
})], 36)) : F("", !0)
|
|
3730
3869
|
], 544),
|
|
3731
|
-
|
|
3870
|
+
A.value ? F("", !0) : (U(), P(ri, {
|
|
3732
3871
|
key: 2,
|
|
3733
3872
|
"left-offset": 12,
|
|
3734
|
-
onToggle:
|
|
3735
|
-
})),
|
|
3736
|
-
|
|
3873
|
+
onToggle: q(Ot).handleToggleOutline
|
|
3874
|
+
}, null, 8, ["onToggle"])),
|
|
3875
|
+
q(bt).totalPages > 1 ? (U(), P(ii, {
|
|
3737
3876
|
key: 3,
|
|
3738
|
-
"current-page":
|
|
3739
|
-
"total-pages":
|
|
3740
|
-
visible:
|
|
3877
|
+
"current-page": q(bt).currentPage,
|
|
3878
|
+
"total-pages": q(bt).totalPages,
|
|
3879
|
+
visible: q(bt).visible
|
|
3741
3880
|
}, null, 8, [
|
|
3742
3881
|
"current-page",
|
|
3743
3882
|
"total-pages",
|
|
3744
3883
|
"visible"
|
|
3745
|
-
])) :
|
|
3746
|
-
|
|
3747
|
-
"is-open":
|
|
3748
|
-
headings:
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3884
|
+
])) : F("", !0),
|
|
3885
|
+
z(dr, {
|
|
3886
|
+
"is-open": A.value,
|
|
3887
|
+
headings: ge.value,
|
|
3888
|
+
"get-scroll-container": () => T.value,
|
|
3889
|
+
onClose: n[24] ||= (e) => A.value = !1,
|
|
3890
|
+
onNavigate: q(Ot).handleOutlineNavigate
|
|
3891
|
+
}, null, 8, [
|
|
3892
|
+
"is-open",
|
|
3893
|
+
"headings",
|
|
3894
|
+
"get-scroll-container",
|
|
3895
|
+
"onNavigate"
|
|
3896
|
+
])
|
|
3752
3897
|
])], 544),
|
|
3753
|
-
|
|
3754
|
-
"read-only":
|
|
3755
|
-
"context-menu":
|
|
3756
|
-
"image-context-menu":
|
|
3757
|
-
"image-context-menu-text-actions":
|
|
3758
|
-
"custom-text-menu-items":
|
|
3759
|
-
"can-open-image-properties":
|
|
3760
|
-
onContextMenuAction:
|
|
3761
|
-
onCloseContextMenu: n[
|
|
3762
|
-
onImageWrapSelect:
|
|
3763
|
-
onCloseImageContextMenu: n[
|
|
3764
|
-
onOpenImageProperties: n[
|
|
3898
|
+
z(Gr, {
|
|
3899
|
+
"read-only": u.value,
|
|
3900
|
+
"context-menu": q(kt),
|
|
3901
|
+
"image-context-menu": q(At),
|
|
3902
|
+
"image-context-menu-text-actions": q(jt),
|
|
3903
|
+
"custom-text-menu-items": q(Mt),
|
|
3904
|
+
"can-open-image-properties": q(at) !== null,
|
|
3905
|
+
onContextMenuAction: q(It),
|
|
3906
|
+
onCloseContextMenu: n[25] ||= (e) => q(kt).isOpen = !1,
|
|
3907
|
+
onImageWrapSelect: q(Ft),
|
|
3908
|
+
onCloseImageContextMenu: n[26] ||= (e) => At.value = null,
|
|
3909
|
+
onOpenImageProperties: n[27] ||= (e) => O.value = !0
|
|
3765
3910
|
}, null, 8, [
|
|
3766
3911
|
"read-only",
|
|
3767
3912
|
"context-menu",
|
|
@@ -3774,30 +3919,30 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3774
3919
|
])
|
|
3775
3920
|
], 6));
|
|
3776
3921
|
}
|
|
3777
|
-
}), [["__scopeId", "data-v-
|
|
3922
|
+
}), [["__scopeId", "data-v-1313e086"]]), ja = ["aria-label"], Ma = ["aria-label"], Na = [
|
|
3778
3923
|
"disabled",
|
|
3779
3924
|
"title",
|
|
3780
3925
|
"aria-label"
|
|
3781
|
-
],
|
|
3926
|
+
], Pa = [
|
|
3782
3927
|
"disabled",
|
|
3783
3928
|
"title",
|
|
3784
3929
|
"aria-label"
|
|
3785
|
-
],
|
|
3930
|
+
], Fa = ["aria-label"], Ia = [
|
|
3786
3931
|
"disabled",
|
|
3787
3932
|
"title",
|
|
3788
3933
|
"aria-label",
|
|
3789
3934
|
"aria-pressed"
|
|
3790
|
-
],
|
|
3935
|
+
], La = [
|
|
3791
3936
|
"disabled",
|
|
3792
3937
|
"title",
|
|
3793
3938
|
"aria-label",
|
|
3794
3939
|
"aria-pressed"
|
|
3795
|
-
],
|
|
3940
|
+
], Ra = [
|
|
3796
3941
|
"disabled",
|
|
3797
3942
|
"title",
|
|
3798
3943
|
"aria-label",
|
|
3799
3944
|
"aria-pressed"
|
|
3800
|
-
],
|
|
3945
|
+
], za = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
3801
3946
|
__name: "FormattingBar",
|
|
3802
3947
|
props: {
|
|
3803
3948
|
currentFormatting: {},
|
|
@@ -3839,11 +3984,11 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3839
3984
|
"redo"
|
|
3840
3985
|
],
|
|
3841
3986
|
setup(e, { emit: t }) {
|
|
3842
|
-
let { ColorPicker: n } =
|
|
3987
|
+
let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s = N(() => i.currentFormatting ?? {}), l = N(() => i.documentStyles ? { styles: i.documentStyles } : {}), u = N(() => s.value.listState ?? x()), d = N(() => {
|
|
3843
3988
|
let e = s.value.color;
|
|
3844
3989
|
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
3845
|
-
}), f =
|
|
3846
|
-
let e =
|
|
3990
|
+
}), f = N(() => {
|
|
3991
|
+
let e = u.value;
|
|
3847
3992
|
return e.isInList && e.level > 0 || (s.value.indentLeft ?? 0) > 0;
|
|
3848
3993
|
});
|
|
3849
3994
|
function m(e) {
|
|
@@ -3852,99 +3997,99 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3852
3997
|
value: e
|
|
3853
3998
|
});
|
|
3854
3999
|
}
|
|
3855
|
-
return (t,
|
|
3856
|
-
class:
|
|
4000
|
+
return (t, i) => (U(), I("div", {
|
|
4001
|
+
class: V(["docx-formatting-bar", e.className]),
|
|
3857
4002
|
role: "toolbar",
|
|
3858
|
-
"aria-label":
|
|
4003
|
+
"aria-label": q(o)("formattingToolbar"),
|
|
3859
4004
|
"data-folio-toolbar": "true"
|
|
3860
4005
|
}, [
|
|
3861
|
-
|
|
4006
|
+
L("span", {
|
|
3862
4007
|
class: "docx-formatting-bar__group",
|
|
3863
4008
|
role: "group",
|
|
3864
|
-
"aria-label":
|
|
3865
|
-
}, [
|
|
4009
|
+
"aria-label": q(o)("historyGroup")
|
|
4010
|
+
}, [L("button", {
|
|
3866
4011
|
type: "button",
|
|
3867
4012
|
class: "docx-formatting-bar__btn",
|
|
3868
4013
|
disabled: e.disabled || !e.canUndo,
|
|
3869
|
-
title:
|
|
3870
|
-
"aria-label":
|
|
3871
|
-
onMousedown:
|
|
3872
|
-
}, [
|
|
4014
|
+
title: q(o)("undoShortcut"),
|
|
4015
|
+
"aria-label": q(o)("undo"),
|
|
4016
|
+
onMousedown: i[0] ||= Y((e) => a("undo"), ["prevent"])
|
|
4017
|
+
}, [z(r, {
|
|
3873
4018
|
name: "undo",
|
|
3874
4019
|
size: 18
|
|
3875
|
-
})], 40,
|
|
4020
|
+
})], 40, Na), L("button", {
|
|
3876
4021
|
type: "button",
|
|
3877
4022
|
class: "docx-formatting-bar__btn",
|
|
3878
4023
|
disabled: e.disabled || !e.canRedo,
|
|
3879
|
-
title:
|
|
3880
|
-
"aria-label":
|
|
3881
|
-
onMousedown:
|
|
3882
|
-
}, [
|
|
4024
|
+
title: q(o)("redoShortcut"),
|
|
4025
|
+
"aria-label": q(o)("redo"),
|
|
4026
|
+
onMousedown: i[1] ||= Y((e) => a("redo"), ["prevent"])
|
|
4027
|
+
}, [z(r, {
|
|
3883
4028
|
name: "redo",
|
|
3884
4029
|
size: 18
|
|
3885
|
-
})], 40,
|
|
3886
|
-
|
|
4030
|
+
})], 40, Pa)], 8, Ma),
|
|
4031
|
+
i[13] ||= L("span", {
|
|
3887
4032
|
class: "docx-formatting-bar__divider",
|
|
3888
4033
|
role: "separator"
|
|
3889
4034
|
}, null, -1),
|
|
3890
|
-
e.showStylePicker ? (
|
|
4035
|
+
e.showStylePicker ? (U(), I(M, { key: 0 }, [z(b, ye({ value: s.value.styleId ?? "Normal" }, l.value, {
|
|
3891
4036
|
disabled: e.disabled,
|
|
3892
|
-
onChange:
|
|
4037
|
+
onChange: i[2] ||= (e) => a("format", {
|
|
3893
4038
|
type: "applyStyle",
|
|
3894
4039
|
value: e
|
|
3895
4040
|
})
|
|
3896
|
-
}), null, 16, ["value", "disabled"]),
|
|
4041
|
+
}), null, 16, ["value", "disabled"]), i[11] ||= L("span", {
|
|
3897
4042
|
class: "docx-formatting-bar__divider",
|
|
3898
4043
|
role: "separator"
|
|
3899
|
-
}, null, -1)], 64)) :
|
|
3900
|
-
|
|
4044
|
+
}, null, -1)], 64)) : F("", !0),
|
|
4045
|
+
L("span", {
|
|
3901
4046
|
class: "docx-formatting-bar__group",
|
|
3902
4047
|
role: "group",
|
|
3903
|
-
"aria-label":
|
|
4048
|
+
"aria-label": q(o)("textFormattingGroup")
|
|
3904
4049
|
}, [
|
|
3905
|
-
|
|
4050
|
+
L("button", {
|
|
3906
4051
|
type: "button",
|
|
3907
|
-
class:
|
|
4052
|
+
class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.bold }]),
|
|
3908
4053
|
disabled: e.disabled,
|
|
3909
|
-
title:
|
|
3910
|
-
"aria-label":
|
|
4054
|
+
title: q(o)("boldShortcut"),
|
|
4055
|
+
"aria-label": q(o)("bold"),
|
|
3911
4056
|
"aria-pressed": !!s.value.bold,
|
|
3912
|
-
onMousedown:
|
|
3913
|
-
}, [
|
|
4057
|
+
onMousedown: i[3] ||= Y((e) => a("format", "bold"), ["prevent"])
|
|
4058
|
+
}, [z(r, {
|
|
3914
4059
|
name: "format_bold",
|
|
3915
4060
|
size: 18
|
|
3916
|
-
})], 42,
|
|
3917
|
-
|
|
4061
|
+
})], 42, Ia),
|
|
4062
|
+
L("button", {
|
|
3918
4063
|
type: "button",
|
|
3919
|
-
class:
|
|
4064
|
+
class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.italic }]),
|
|
3920
4065
|
disabled: e.disabled,
|
|
3921
|
-
title:
|
|
3922
|
-
"aria-label":
|
|
4066
|
+
title: q(o)("italicShortcut"),
|
|
4067
|
+
"aria-label": q(o)("italic"),
|
|
3923
4068
|
"aria-pressed": !!s.value.italic,
|
|
3924
|
-
onMousedown:
|
|
3925
|
-
}, [
|
|
4069
|
+
onMousedown: i[4] ||= Y((e) => a("format", "italic"), ["prevent"])
|
|
4070
|
+
}, [z(r, {
|
|
3926
4071
|
name: "format_italic",
|
|
3927
4072
|
size: 18
|
|
3928
|
-
})], 42,
|
|
3929
|
-
|
|
4073
|
+
})], 42, La),
|
|
4074
|
+
L("button", {
|
|
3930
4075
|
type: "button",
|
|
3931
|
-
class:
|
|
4076
|
+
class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.underline }]),
|
|
3932
4077
|
disabled: e.disabled,
|
|
3933
|
-
title:
|
|
3934
|
-
"aria-label":
|
|
4078
|
+
title: q(o)("underlineShortcut"),
|
|
4079
|
+
"aria-label": q(o)("underline"),
|
|
3935
4080
|
"aria-pressed": !!s.value.underline,
|
|
3936
|
-
onMousedown:
|
|
3937
|
-
}, [
|
|
4081
|
+
onMousedown: i[5] ||= Y((e) => a("format", "underline"), ["prevent"])
|
|
4082
|
+
}, [z(r, {
|
|
3938
4083
|
name: "format_underlined",
|
|
3939
4084
|
size: 18
|
|
3940
|
-
})], 42,
|
|
3941
|
-
], 8,
|
|
3942
|
-
e.showTextColorPicker ? (
|
|
4085
|
+
})], 42, Ra)
|
|
4086
|
+
], 8, Fa),
|
|
4087
|
+
e.showTextColorPicker ? (U(), I(M, { key: 1 }, [i[12] ||= L("span", {
|
|
3943
4088
|
class: "docx-formatting-bar__divider",
|
|
3944
4089
|
role: "separator"
|
|
3945
|
-
}, null, -1),
|
|
4090
|
+
}, null, -1), z(q(n), {
|
|
3946
4091
|
mode: "text",
|
|
3947
|
-
value:
|
|
4092
|
+
value: d.value,
|
|
3948
4093
|
theme: e.theme ?? null,
|
|
3949
4094
|
disabled: e.disabled,
|
|
3950
4095
|
onChange: m
|
|
@@ -3952,37 +4097,37 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
3952
4097
|
"value",
|
|
3953
4098
|
"theme",
|
|
3954
4099
|
"disabled"
|
|
3955
|
-
])], 64)) :
|
|
3956
|
-
|
|
4100
|
+
])], 64)) : F("", !0),
|
|
4101
|
+
i[14] ||= L("span", {
|
|
3957
4102
|
class: "docx-formatting-bar__divider",
|
|
3958
4103
|
role: "separator"
|
|
3959
4104
|
}, null, -1),
|
|
3960
|
-
e.showAlignmentButtons ? (
|
|
4105
|
+
e.showAlignmentButtons ? (U(), P(S, {
|
|
3961
4106
|
key: 2,
|
|
3962
4107
|
value: s.value.alignment ?? "left",
|
|
3963
4108
|
disabled: e.disabled,
|
|
3964
|
-
onChange:
|
|
4109
|
+
onChange: i[6] ||= (e) => a("format", {
|
|
3965
4110
|
type: "alignment",
|
|
3966
4111
|
value: e
|
|
3967
4112
|
})
|
|
3968
|
-
}, null, 8, ["value", "disabled"])) :
|
|
3969
|
-
e.showListButtons ? (
|
|
4113
|
+
}, null, 8, ["value", "disabled"])) : F("", !0),
|
|
4114
|
+
e.showListButtons ? (U(), P(te, {
|
|
3970
4115
|
key: 3,
|
|
3971
|
-
"list-state":
|
|
4116
|
+
"list-state": u.value,
|
|
3972
4117
|
disabled: e.disabled,
|
|
3973
4118
|
"can-outdent": f.value,
|
|
3974
|
-
onBulletList:
|
|
3975
|
-
onNumberedList:
|
|
3976
|
-
onIndent:
|
|
3977
|
-
onOutdent:
|
|
4119
|
+
onBulletList: i[7] ||= (e) => a("format", "bulletList"),
|
|
4120
|
+
onNumberedList: i[8] ||= (e) => a("format", "numberedList"),
|
|
4121
|
+
onIndent: i[9] ||= (e) => a("format", "indent"),
|
|
4122
|
+
onOutdent: i[10] ||= (e) => a("format", "outdent")
|
|
3978
4123
|
}, null, 8, [
|
|
3979
4124
|
"list-state",
|
|
3980
4125
|
"disabled",
|
|
3981
4126
|
"can-outdent"
|
|
3982
|
-
])) :
|
|
3983
|
-
], 10,
|
|
4127
|
+
])) : F("", !0)
|
|
4128
|
+
], 10, ja));
|
|
3984
4129
|
}
|
|
3985
|
-
}), [["__scopeId", "data-v-225f770f"]]),
|
|
4130
|
+
}), [["__scopeId", "data-v-225f770f"]]), Ba = [
|
|
3986
4131
|
{
|
|
3987
4132
|
value: .5,
|
|
3988
4133
|
label: "50%"
|
|
@@ -4007,7 +4152,7 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
4007
4152
|
value: 2,
|
|
4008
4153
|
label: "200%"
|
|
4009
4154
|
}
|
|
4010
|
-
],
|
|
4155
|
+
], Va = /*#__PURE__*/ t(/* @__PURE__ */ B({
|
|
4011
4156
|
__name: "ZoomControl",
|
|
4012
4157
|
props: {
|
|
4013
4158
|
value: { default: 1 },
|
|
@@ -4024,30 +4169,38 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
4024
4169
|
},
|
|
4025
4170
|
emits: ["change"],
|
|
4026
4171
|
setup(e, { emit: t }) {
|
|
4027
|
-
let n =
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4172
|
+
let { Select: n } = p(), r = e, i = t, a = N(() => r.levels ?? Ba), o = N(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = N(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = N(() => o.value ? String(o.value.value) : String(r.value)), l = N(() => {
|
|
4173
|
+
let e = a.value.map((e) => ({
|
|
4174
|
+
value: String(e.value),
|
|
4175
|
+
label: e.label
|
|
4176
|
+
}));
|
|
4177
|
+
return o.value || e.unshift({
|
|
4178
|
+
value: c.value,
|
|
4179
|
+
label: s.value
|
|
4180
|
+
}), e;
|
|
4181
|
+
});
|
|
4182
|
+
function u(e) {
|
|
4183
|
+
let t = Number.parseFloat(e);
|
|
4184
|
+
Number.isNaN(t) || i("change", t);
|
|
4032
4185
|
}
|
|
4033
|
-
return (t,
|
|
4034
|
-
class:
|
|
4035
|
-
value:
|
|
4186
|
+
return (t, r) => (U(), P(q(n), {
|
|
4187
|
+
class: V(["docx-zoom-control", [{ "docx-zoom-control--compact": e.compact }, e.className]]),
|
|
4188
|
+
value: c.value,
|
|
4189
|
+
items: l.value,
|
|
4036
4190
|
disabled: e.disabled,
|
|
4037
4191
|
"aria-label": "Zoom level",
|
|
4038
|
-
onChange:
|
|
4039
|
-
},
|
|
4040
|
-
|
|
4041
|
-
value
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
}, U(e.label), 9, xa))), 128))], 42, ya));
|
|
4192
|
+
onChange: u
|
|
4193
|
+
}, null, 8, [
|
|
4194
|
+
"class",
|
|
4195
|
+
"value",
|
|
4196
|
+
"items",
|
|
4197
|
+
"disabled"
|
|
4198
|
+
]));
|
|
4046
4199
|
}
|
|
4047
|
-
}), [["__scopeId", "data-v-
|
|
4200
|
+
}), [["__scopeId", "data-v-8079e07f"]]), Ha = (e, t, n = {}) => {
|
|
4048
4201
|
let { locale: r = "en", ...i } = n;
|
|
4049
4202
|
return new Promise((n, a) => {
|
|
4050
|
-
let o =
|
|
4203
|
+
let o = W(null), s = null, c = !1, u = {
|
|
4051
4204
|
save: async () => {
|
|
4052
4205
|
let e = await (o.value?.save() ?? Promise.resolve(null));
|
|
4053
4206
|
return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
|
|
@@ -4066,23 +4219,23 @@ var $i = { class: "docx-editor-vue__toolbar-shell" }, ea = {
|
|
|
4066
4219
|
o.value?.scrollToPage(e);
|
|
4067
4220
|
},
|
|
4068
4221
|
destroy: () => {
|
|
4069
|
-
|
|
4222
|
+
c || (c = !0, a(/* @__PURE__ */ Error("Editor was destroyed before mounting completed."))), s?.unmount(), s = null;
|
|
4070
4223
|
}
|
|
4071
4224
|
};
|
|
4072
|
-
|
|
4073
|
-
return () =>
|
|
4225
|
+
s = me({ setup() {
|
|
4226
|
+
return () => _e(Aa, {
|
|
4074
4227
|
...i,
|
|
4075
4228
|
documentBuffer: e,
|
|
4076
4229
|
ref: o,
|
|
4077
4230
|
onReady: () => {
|
|
4078
|
-
|
|
4231
|
+
c || (c = !0, n(u));
|
|
4079
4232
|
},
|
|
4080
4233
|
onError: (e) => {
|
|
4081
|
-
i.onError?.(e),
|
|
4234
|
+
i.onError?.(e), c || (c = !0, s?.unmount(), s = null, a(e));
|
|
4082
4235
|
}
|
|
4083
4236
|
});
|
|
4084
|
-
} }),
|
|
4237
|
+
} }), s.use(l, r), s.mount(t);
|
|
4085
4238
|
});
|
|
4086
4239
|
};
|
|
4087
4240
|
//#endregion
|
|
4088
|
-
export {
|
|
4241
|
+
export { Nn as DEFAULT_AI_SUGGESTION_PRESETS, Kn as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Aa as DocxEditor, T as FindReplaceDialog, s as FolioUIProvider, se as FootnotePropertiesDialog, za as FormattingBar, ce as HyperlinkDialog, le as ImagePositionDialog, E as ImagePropertiesDialog, D as InsertImageDialog, ue as InsertSymbolDialog, de as InsertTableDialog, fe as PageSetupDialog, O as PasteSpecialDialog, k as SplitCellDialog, A as TablePropertiesDialog, j as WatermarkDialog, Va as ZoomControl, qn as acceptAutocompleteSuggestion, Jn as acceptAutocompleteWord, Ye as anonymizationDecorationsKey, Yn as appendAutocompleteToken, $ as applyFolioAIEditOperations, Pn as applySuggestions, Xn as autocompleteSuggestionKey, Zn as autocompleteSuggestionPlugin, Ln as buildPositionalText, Qn as clearAutocompleteSuggestion, It as clearTemplateSlashMenu, Lt as consumeTemplateSlashQuery, Un as createAICitationDecorationsPlugin, Mn as createDocx, jn as createEmptyDocument, Vt as createFolioAIEditSnapshot, n as defaultLocale, sn as deriveBlockId, Ut as diffWordSegments, $n as finishAutocompleteSuggestion, rr as fromMarkdown, Xe as getAnonymizationMatches, er as getAutocompleteSuggestion, kn as getDocumentWatermark, Vn as getFolioCaretViewportRect, cn as getFolioParaIdFromBlockId, Hn as getFolioSelectionViewportRect, yt as getTemplateDirectives, Rt as getTemplateSlashMenu, Kt as hashFolioAIBlockText, l as i18nPlugin, Ne as insertImageFromFile, X as insertPageBreakInView, Ie as insertTableInView, Re as insertTableOfContentsInView, dn as isFolioBlockId, fn as isSequentialFolioBlockId, Fn as isSuggestionStale, qt as normalizeFolioAIBlockText, e as provideLocale, Ha as renderAsync, Q as resetTemplateSlashQuery, In as resolveSuggestionAnchor, xt as scanDirectives, Bn as scrollFolioPositionIntoView, Wn as setAICitationsMeta, Rn as setAISuggestionsMeta, Gn as setActiveCitationMeta, Qe as setAnonymizationTermsMeta, An as setDocumentWatermark, zn as setFocusedSuggestionMeta, Ft as setTemplatePreviewValues, tr as shouldTriggerAutocomplete, nr as startAutocompleteSuggestion, zt as templateSlashMenuKey, ir as toMarkdown, ar as toMarkdownResult, c as useTranslation, w as useWheelZoom };
|