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