@stll/folio-vue 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ListButtons-CC7_7-e3.cjs → ListButtons-BvsV1yti.cjs} +2 -2
- package/dist/{ListButtons-BaILr4AO.js → ListButtons-DXqMvba3.js} +37 -49
- package/dist/WatermarkDialog-DHfk8jrg.cjs +15 -0
- package/dist/{WatermarkDialog-D-uTab0-.js → WatermarkDialog-r4wmldt4.js} +674 -1176
- package/dist/components/DocxEditor/types.d.ts +10 -1
- package/dist/components/sidebar/cardStyles.d.ts +1 -1
- package/dist/composables/useDocxEditorRefApi.d.ts +4 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +1 -1
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +567 -512
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +14 -14
- package/dist/useZoom-BB6hSMvM.cjs +1 -0
- package/dist/{useZoom-BR--m9w3.js → useZoom-BxDANpqb.js} +178 -175
- package/package.json +11 -6
- package/dist/WatermarkDialog-SzyoSZmL.cjs +0 -15
- package/dist/useZoom-8M2AQIMJ.cjs +0 -1
- package/dist/utils/aiEditRange.d.ts +0 -26
- package/dist/utils/pageText.d.ts +0 -14
package/dist/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { A as e, F as t, O as n, P as r, _ as i, d as a, f as o, g as s, j as c, k as l, m as u, p as d, u as f, y as p } from "./WatermarkDialog-
|
|
2
|
-
import { D as m,
|
|
3
|
-
import { t as
|
|
4
|
-
import { a as
|
|
5
|
-
import { FindReplaceDialog as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { createStyleResolver as
|
|
8
|
-
import { extractSelectionContext as
|
|
9
|
-
import { inspectDocxCompatibility as
|
|
10
|
-
import { clearAllCaches as
|
|
11
|
-
import { onFontsLoaded as
|
|
12
|
-
import { twipsToPixels as
|
|
13
|
-
import { measureDirectiveGutter as
|
|
14
|
-
import { prefersReducedMotionBehavior as
|
|
15
|
-
import { anonymizationDecorationsKey as
|
|
16
|
-
import { NodeSelection as
|
|
17
|
-
import { pixelsToEmu as
|
|
18
|
-
import { IMAGE_LAYOUT_OPTIONS as
|
|
19
|
-
import { isTrackChangesMode as
|
|
20
|
-
import { clickToPositionDom as
|
|
21
|
-
import { calculateResizedImageDimensions as
|
|
22
|
-
import { findBodyPmAnchor as
|
|
23
|
-
import { getTemplateDirectives as
|
|
1
|
+
import { A as e, F as t, O as n, P as r, _ as i, d as a, f as o, g as s, j as c, k as l, m as u, p as d, u as f, y as p } from "./WatermarkDialog-r4wmldt4.js";
|
|
2
|
+
import { D as m, E as h, d as g, f as _, i as v, n as y, r as b, t as x, v as ee, w as S, y as te } from "./ListButtons-DXqMvba3.js";
|
|
3
|
+
import { t as ne } from "./zIndex-BY0qa8Au.js";
|
|
4
|
+
import { a as re, i as ie, o as C, r as ae, t as oe } from "./useZoom-BxDANpqb.js";
|
|
5
|
+
import { FindReplaceDialog as w, FootnotePropertiesDialog as T, HyperlinkDialog as se, ImagePositionDialog as ce, ImagePropertiesDialog as le, InsertImageDialog as E, InsertSymbolDialog as D, InsertTableDialog as ue, PageSetupDialog as de, PasteSpecialDialog as fe, SplitCellDialog as O, TablePropertiesDialog as k, WatermarkDialog as A } from "./dialogs.js";
|
|
6
|
+
import { Fragment as j, Teleport as M, computed as N, createApp as pe, createBlock as P, createCommentVNode as F, createElementBlock as I, createElementVNode as L, createSlots as me, createStaticVNode as he, createTextVNode as ge, createVNode as R, defineComponent as z, h as B, inject as _e, mergeProps as ve, nextTick as ye, normalizeClass as V, normalizeStyle as H, onBeforeUnmount as be, onMounted as xe, openBlock as U, provide as Se, ref as W, renderList as G, renderSlot as Ce, shallowRef as we, toDisplayString as K, unref as q, vModelText as Te, watch as J, withCtx as Ee, withDirectives as De, withKeys as Oe, withModifiers as Y } from "vue";
|
|
7
|
+
import { createStyleResolver as ke, extractSelectionState as Ae, getSelectedText as je, insertImageFromFile as Me, insertImageFromFile as Ne, insertPageBreakInView as Pe, insertPageBreakInView as Fe, insertTableInView as X, insertTableInView as Ie, insertTableOfContentsInView as Le, insertTableOfContentsInView as Re } from "@stll/folio-core/prosemirror";
|
|
8
|
+
import { extractSelectionContext as ze } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
|
|
9
|
+
import { inspectDocxCompatibility as Be } from "@stll/folio-core/docx/compatibility";
|
|
10
|
+
import { clearAllCaches as Ve, resetCanvasContext as He } from "@stll/folio-core/layout-bridge/engine/measuring";
|
|
11
|
+
import { onFontsLoaded as Ue } from "@stll/folio-core/utils/fontLoader";
|
|
12
|
+
import { twipsToPixels as We } from "@stll/folio-core/paged-layout/sectionGeometry";
|
|
13
|
+
import { measureDirectiveGutter as Ge, projectRangesToRects as Ke } from "@stll/folio-core/paged-layout/rangeProjection";
|
|
14
|
+
import { prefersReducedMotionBehavior as qe } from "@stll/folio-core/paged-layout/scrollNavigation";
|
|
15
|
+
import { anonymizationDecorationsKey as Je, getAnonymizationMatches as Ye, getAnonymizationMatches as Xe, setAnonymizationTermsMeta as Ze, slugAnonymizationLabel as Qe } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
16
|
+
import { NodeSelection as $e, Selection as et, TextSelection as Z } from "prosemirror-state";
|
|
17
|
+
import { pixelsToEmu as tt } from "@stll/folio-core/utils/units";
|
|
18
|
+
import { IMAGE_LAYOUT_OPTIONS as nt, captureInlinePositionEmu as rt, deriveLayoutChoice as it, findImageElement as at, isImageLayoutOptionEnabled as ot, toolbarValueToLayoutTarget as st } from "@stll/folio-core/layout-painter/imageLayout";
|
|
19
|
+
import { isTrackChangesMode as ct, toggledTrackChangesMode as lt } from "@stll/folio-core/managers/EditorModeManager";
|
|
20
|
+
import { clickToPositionDom as ut } from "@stll/folio-core/layout-bridge/dom/clickToPositionDom";
|
|
21
|
+
import { calculateResizedImageDimensions as dt, commitImageFloatMove as ft, commitImageInlineMove as pt, commitImageResize as mt, isFloatingImage as ht } from "@stll/folio-core/prosemirror/imageCommit";
|
|
22
|
+
import { findBodyPmAnchor as gt, findBodyPmSpans as _t } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
|
|
23
|
+
import { getTemplateDirectives as vt, getTemplateDirectives as yt, scanDirectives as bt } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
24
|
+
import { closeHistory as xt } from "prosemirror-history";
|
|
24
25
|
import { clearFormatting as St } from "@stll/folio-core/prosemirror/commands/formatting";
|
|
25
26
|
import { getTableContext as Ct } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
|
|
26
27
|
import { PENDING_COMMENT_ID as wt, createCommentIdAllocator as Tt, seedCommentAllocator as Et } from "@stll/folio-core/prosemirror/commentIdAllocator";
|
|
@@ -30,42 +31,42 @@ import { acceptAIEditRevision as kt, acceptChange as At, findAIEditRevisionRange
|
|
|
30
31
|
import { makeRevisionInfo as Pt } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
31
32
|
import { setTemplatePreviewValues as Ft } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
32
33
|
import { clearTemplateSlashMenu as It, consumeTemplateSlashQuery as Lt, getTemplateSlashMenu as Rt, resetTemplateSlashQuery as Q, templateSlashMenuKey as zt } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
33
|
-
import {
|
|
34
|
-
import { findPageIndexContainingPmPos as
|
|
35
|
-
import { findParagraphFragmentsByParaId as
|
|
36
|
-
import { blockSdtAttrsToSdtProperties as
|
|
37
|
-
import { setContentControlContentBlocksTr as
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import { DEFAULT_AI_SUGGESTION_PRESETS as
|
|
53
|
-
import { applySuggestions as
|
|
54
|
-
import { isSuggestionStale as
|
|
55
|
-
import { buildPositionalText as
|
|
56
|
-
import { setAISuggestionsMeta as
|
|
57
|
-
import { scrollFolioPositionIntoView as
|
|
58
|
-
import { getFolioCaretViewportRect as
|
|
59
|
-
import { createAICitationDecorationsPlugin as
|
|
60
|
-
import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as
|
|
61
|
-
import { fromMarkdown as
|
|
34
|
+
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as $, applyFolioAIEditOperations as Bt, applyFolioAIEditOperations as Vt, applyFolioDocumentOperations as Ht, assertSupportedFolioDocumentOperationVersion as Ut, createFolioAIEditSnapshot as Wt, createFolioAIEditSnapshot as Gt, diffWordSegments as Kt, getCommentAnchorsFromDoc as qt, getFolioDocumentOperationIssues as Jt, getTrackedChangesFromDoc as Yt, hashFolioAIBlockText as Xt, normalizeFolioAIBlockText as Zt } from "@stll/folio-core/ai-edits";
|
|
35
|
+
import { findPageIndexContainingPmPos as Qt } from "@stll/folio-core/layout-engine";
|
|
36
|
+
import { findParagraphFragmentsByParaId as $t, flashParagraphElements as en } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
37
|
+
import { blockSdtAttrsToSdtProperties as tn, findBlockSdtMatch as nn, findBlockSdtMatches as rn, removeContentControlTr as an, setContentControlContentTr as on, setContentControlValueTr as sn } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
38
|
+
import { setContentControlContentBlocksTr as cn } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
39
|
+
import { clampRangeToDocSize as ln, resolveFolioAIBlockRange as un } from "@stll/folio-core/ai-edits/blockRange";
|
|
40
|
+
import { getPageTextFromLayout as dn } from "@stll/folio-core/paged-layout/pageText";
|
|
41
|
+
import { applyStyle as fn, removeTabStop as pn, setIndentFirstLine as mn, setIndentLeft as hn, setIndentRight as gn } from "@stll/folio-core/prosemirror/commands/paragraph";
|
|
42
|
+
import { getCachedNumberingMap as _n } from "@stll/folio-core/docx";
|
|
43
|
+
import { insertPageBreak as vn } from "@stll/folio-core/prosemirror/commands/pageBreak";
|
|
44
|
+
import { insertSectionBreakContinuous as yn, insertSectionBreakNextPage as bn } from "@stll/folio-core/prosemirror/commands/sectionBreak";
|
|
45
|
+
import { editHyperlinkAtCursor as xn, removeHyperlinkAtCursor as Sn } from "@stll/folio-core/prosemirror/commands/hyperlink";
|
|
46
|
+
import { collectHeadings as Cn } from "@stll/folio-core/utils/headingCollector";
|
|
47
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as wn, detectTableInsertHover as Tn } from "@stll/folio-core/layout-bridge/tableInsertHover";
|
|
48
|
+
import { createCellDragTracker as En, findCellPosFromPmPos as Dn } from "@stll/folio-core/prosemirror/cellDragSelection";
|
|
49
|
+
import { getDocumentWatermark as On, setDocumentWatermark as kn } from "@stll/folio-core/watermark";
|
|
50
|
+
import { createEmptyDocument as An } from "@stll/folio-core/utils/createDocument";
|
|
51
|
+
import { createDocx as jn } from "@stll/folio-core/docx/rezip";
|
|
52
|
+
import { deriveBlockId as Mn, getFolioParaIdFromBlockId as Nn, isFolioBlockId as Pn, isSequentialFolioBlockId as Fn } from "@stll/folio-core/types/block-id";
|
|
53
|
+
import { DEFAULT_AI_SUGGESTION_PRESETS as In } from "@stll/folio-core/ai-suggestions/types";
|
|
54
|
+
import { applySuggestions as Ln } from "@stll/folio-core/ai-suggestions/apply";
|
|
55
|
+
import { isSuggestionStale as Rn, resolveSuggestionAnchor as zn } from "@stll/folio-core/ai-suggestions/conflict";
|
|
56
|
+
import { buildPositionalText as Bn } from "@stll/folio-core/ai-suggestions/text-positions";
|
|
57
|
+
import { setAISuggestionsMeta as Vn, setFocusedSuggestionMeta as Hn } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
58
|
+
import { scrollFolioPositionIntoView as Un } from "@stll/folio-core/paged-layout/scrollToPmPosition";
|
|
59
|
+
import { getFolioCaretViewportRect as Wn, getFolioSelectionViewportRect as Gn } from "@stll/folio-core/paged-layout/selectionViewportRect";
|
|
60
|
+
import { createAICitationDecorationsPlugin as Kn, setAICitationsMeta as qn, setActiveCitationMeta as Jn } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
61
|
+
import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as Yn, acceptAutocompleteSuggestion as Xn, acceptAutocompleteWord as Zn, appendAutocompleteToken as Qn, autocompleteSuggestionKey as $n, autocompleteSuggestionPlugin as er, clearAutocompleteSuggestion as tr, finishAutocompleteSuggestion as nr, getAutocompleteSuggestion as rr, shouldTriggerAutocomplete as ir, startAutocompleteSuggestion as ar } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
62
|
+
import { fromMarkdown as or, toMarkdown as sr, toMarkdownResult as cr } from "@stll/folio-core/markdown";
|
|
62
63
|
//#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
63
|
-
var
|
|
64
|
+
var lr = [
|
|
64
65
|
"data-folio-anonymization-label",
|
|
65
66
|
"data-folio-anonymization-canonical",
|
|
66
67
|
"data-folio-anonymization-selected",
|
|
67
68
|
"title"
|
|
68
|
-
],
|
|
69
|
+
], ur = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
69
70
|
__name: "AnonymizationRectsOverlay",
|
|
70
71
|
props: {
|
|
71
72
|
getView: { type: Function },
|
|
@@ -92,12 +93,12 @@ var or = [
|
|
|
92
93
|
r.value = [];
|
|
93
94
|
return;
|
|
94
95
|
}
|
|
95
|
-
let s =
|
|
96
|
+
let s = Xe(o);
|
|
96
97
|
if (s.length === 0) {
|
|
97
98
|
r.value = [];
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
100
|
-
let c = await
|
|
101
|
+
let c = await Ke(s, {
|
|
101
102
|
pagesContainer: a,
|
|
102
103
|
zoom: t.zoom,
|
|
103
104
|
layout: t.layout,
|
|
@@ -139,7 +140,7 @@ var or = [
|
|
|
139
140
|
index: a
|
|
140
141
|
}, i.item(a)?.scrollIntoView({
|
|
141
142
|
block: "center",
|
|
142
|
-
behavior:
|
|
143
|
+
behavior: qe()
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
146
|
J(() => [t.selectedCanonical, t.selectionSeq], () => l(), { flush: "post" });
|
|
@@ -159,18 +160,18 @@ var or = [
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
|
-
return
|
|
163
|
+
return xe(() => {
|
|
163
164
|
document.addEventListener("click", u), o();
|
|
164
|
-
}),
|
|
165
|
+
}), be(() => {
|
|
165
166
|
document.removeEventListener("click", u), a !== null && (cancelAnimationFrame(a), a = null);
|
|
166
167
|
}), (t, i) => (U(), I("div", {
|
|
167
168
|
ref_key: "rootRef",
|
|
168
169
|
ref: n,
|
|
169
170
|
class: "folio-anonymization-overlay",
|
|
170
171
|
"data-folio-anonymization-overlay": ""
|
|
171
|
-
}, [(U(!0), I(
|
|
172
|
+
}, [(U(!0), I(j, null, G(r.value, (t) => (U(), I(j, { key: `${t.label}:${t.canonical}` }, [(U(!0), I(j, null, G(t.rects, (n, r) => (U(), I("span", {
|
|
172
173
|
key: `${t.canonical}:${r}:${n.left}:${n.top}`,
|
|
173
|
-
class: V(["folio-anonymization-term", `folio-anonymization-term--${q(
|
|
174
|
+
class: V(["folio-anonymization-term", `folio-anonymization-term--${q(Qe)(t.label)}`]),
|
|
174
175
|
"data-folio-anonymization-label": t.label,
|
|
175
176
|
"data-folio-anonymization-canonical": t.canonical,
|
|
176
177
|
"data-folio-anonymization-selected": t.canonical === e.selectedCanonical ? "true" : void 0,
|
|
@@ -182,12 +183,12 @@ var or = [
|
|
|
182
183
|
width: `${n.width}px`,
|
|
183
184
|
height: `${n.height}px`
|
|
184
185
|
})
|
|
185
|
-
}, null, 14,
|
|
186
|
+
}, null, 14, lr))), 128))], 64))), 128))], 512));
|
|
186
187
|
}
|
|
187
|
-
}), [["__scopeId", "data-v-c7db88e1"]]),
|
|
188
|
+
}), [["__scopeId", "data-v-c7db88e1"]]), dr = { class: "doc-outline__header" }, fr = { class: "doc-outline__body" }, pr = {
|
|
188
189
|
key: 0,
|
|
189
190
|
class: "doc-outline__empty"
|
|
190
|
-
},
|
|
191
|
+
}, mr = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
191
192
|
__name: "DocumentOutline",
|
|
192
193
|
props: {
|
|
193
194
|
isOpen: { type: Boolean },
|
|
@@ -216,15 +217,15 @@ var or = [
|
|
|
216
217
|
role: "navigation",
|
|
217
218
|
"aria-label": "Document outline",
|
|
218
219
|
onMousedown: n[1] ||= Y(() => {}, ["stop"])
|
|
219
|
-
}, [L("div",
|
|
220
|
+
}, [L("div", dr, [L("button", {
|
|
220
221
|
class: "doc-outline__back",
|
|
221
222
|
title: "Close outline",
|
|
222
223
|
"aria-label": "Close outline",
|
|
223
224
|
onClick: n[0] ||= (e) => t.$emit("close")
|
|
224
|
-
}, [
|
|
225
|
+
}, [R(r, {
|
|
225
226
|
name: "arrow_back",
|
|
226
227
|
size: 20
|
|
227
|
-
})]), n[2] ||= L("span", { class: "doc-outline__title" }, "Document Outline", -1)]), L("div",
|
|
228
|
+
})]), n[2] ||= L("span", { class: "doc-outline__title" }, "Document Outline", -1)]), L("div", fr, [e.headings.length === 0 ? (U(), I("div", pr, "No headings found")) : (U(), P(q(i), {
|
|
228
229
|
key: 1,
|
|
229
230
|
items: o.value,
|
|
230
231
|
"get-scroll-container": e.getScrollContainer ?? (() => null),
|
|
@@ -232,7 +233,7 @@ var or = [
|
|
|
232
233
|
"aria-label": "Document outline"
|
|
233
234
|
}, null, 8, ["items", "get-scroll-container"]))])], 36)) : F("", !0);
|
|
234
235
|
}
|
|
235
|
-
}), [["__scopeId", "data-v-
|
|
236
|
+
}), [["__scopeId", "data-v-0797b3b1"]]), hr = /* @__PURE__ */ z({
|
|
236
237
|
__name: "DocxEditorDialogs",
|
|
237
238
|
props: {
|
|
238
239
|
view: {},
|
|
@@ -258,13 +259,13 @@ var or = [
|
|
|
258
259
|
],
|
|
259
260
|
setup(e, { emit: t }) {
|
|
260
261
|
let n = t;
|
|
261
|
-
return (t, r) => (U(), I(
|
|
262
|
-
|
|
262
|
+
return (t, r) => (U(), I(j, null, [
|
|
263
|
+
R(u, {
|
|
263
264
|
"is-open": e.showFindReplace,
|
|
264
265
|
view: e.view,
|
|
265
266
|
onClose: r[0] ||= (e) => n("update:showFindReplace", !1)
|
|
266
267
|
}, null, 8, ["is-open", "view"]),
|
|
267
|
-
|
|
268
|
+
R(d, {
|
|
268
269
|
"is-open": e.showHyperlink,
|
|
269
270
|
view: e.view,
|
|
270
271
|
bookmarks: e.bookmarks,
|
|
@@ -276,12 +277,12 @@ var or = [
|
|
|
276
277
|
"view",
|
|
277
278
|
"bookmarks"
|
|
278
279
|
]),
|
|
279
|
-
|
|
280
|
+
R(a, {
|
|
280
281
|
"is-open": e.showInsertSymbol,
|
|
281
282
|
onClose: r[4] ||= (e) => n("update:showInsertSymbol", !1),
|
|
282
283
|
onInsert: r[5] ||= (e) => n("insert-symbol", e)
|
|
283
284
|
}, null, 8, ["is-open"]),
|
|
284
|
-
|
|
285
|
+
R(o, {
|
|
285
286
|
"is-open": e.showImageProperties,
|
|
286
287
|
view: e.view,
|
|
287
288
|
"pm-pos": e.selectedImagePmPos,
|
|
@@ -291,7 +292,7 @@ var or = [
|
|
|
291
292
|
"view",
|
|
292
293
|
"pm-pos"
|
|
293
294
|
]),
|
|
294
|
-
|
|
295
|
+
R(f, {
|
|
295
296
|
"is-open": e.showPageSetup,
|
|
296
297
|
"section-properties": e.sectionProperties,
|
|
297
298
|
onClose: r[7] ||= (e) => n("update:showPageSetup", !1),
|
|
@@ -299,10 +300,10 @@ var or = [
|
|
|
299
300
|
}, null, 8, ["is-open", "section-properties"])
|
|
300
301
|
], 64));
|
|
301
302
|
}
|
|
302
|
-
}),
|
|
303
|
+
}), gr = {
|
|
303
304
|
key: 0,
|
|
304
305
|
class: "docx-editor-vue__title-bar"
|
|
305
|
-
},
|
|
306
|
+
}, _r = { class: "docx-editor-vue__title-bar-left" }, vr = { class: "docx-editor-vue__title-bar-center" }, yr = { class: "docx-editor-vue__title-bar-right" }, br = /* @__PURE__ */ z({
|
|
306
307
|
__name: "DocxEditorMenuBar",
|
|
307
308
|
props: {
|
|
308
309
|
showMenuBar: {
|
|
@@ -334,13 +335,13 @@ var or = [
|
|
|
334
335
|
],
|
|
335
336
|
setup(e, { emit: t }) {
|
|
336
337
|
let n = t;
|
|
337
|
-
return (t, r) => e.showMenuBar ? (U(), I("div",
|
|
338
|
-
L("div",
|
|
339
|
-
L("div",
|
|
338
|
+
return (t, r) => e.showMenuBar ? (U(), I("div", gr, [
|
|
339
|
+
L("div", _r, [Ce(t.$slots, "title-bar-left")]),
|
|
340
|
+
L("div", vr, [R(h, {
|
|
340
341
|
"model-value": e.documentName,
|
|
341
342
|
editable: e.documentNameEditable,
|
|
342
343
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
343
|
-
}, null, 8, ["model-value", "editable"]),
|
|
344
|
+
}, null, 8, ["model-value", "editable"]), R(S, {
|
|
344
345
|
"show-file-open": e.showFileOpen,
|
|
345
346
|
"show-help-menu": e.showHelpMenu,
|
|
346
347
|
"show-table-insert": e.showTableInsert,
|
|
@@ -351,40 +352,40 @@ var or = [
|
|
|
351
352
|
"show-help-menu",
|
|
352
353
|
"show-table-insert"
|
|
353
354
|
])]),
|
|
354
|
-
L("div",
|
|
355
|
+
L("div", yr, [Ce(t.$slots, "title-bar-right")])
|
|
355
356
|
])) : F("", !0);
|
|
356
357
|
}
|
|
357
|
-
}),
|
|
358
|
-
function
|
|
359
|
-
|
|
358
|
+
}), xr = Symbol("docx-portal-class");
|
|
359
|
+
function Sr(e) {
|
|
360
|
+
Se(xr, N(() => ({
|
|
360
361
|
"ep-root": !0,
|
|
361
362
|
dark: !!q(e)
|
|
362
363
|
})));
|
|
363
364
|
}
|
|
364
|
-
function
|
|
365
|
-
return
|
|
365
|
+
function Cr() {
|
|
366
|
+
return _e(xr, N(() => ({ "ep-root": !0 })));
|
|
366
367
|
}
|
|
367
368
|
//#endregion
|
|
368
369
|
//#region src/components/ImageContextMenu.vue?vue&type=script&setup=true&lang.ts
|
|
369
|
-
var
|
|
370
|
+
var wr = ["aria-label"], Tr = { class: "image-ctx-menu__icon" }, Er = { class: "image-ctx-menu__label" }, Dr = {
|
|
370
371
|
key: 1,
|
|
371
372
|
class: "image-ctx-menu__divider",
|
|
372
373
|
role: "separator"
|
|
373
|
-
},
|
|
374
|
+
}, Or = [
|
|
374
375
|
"data-wrap-type",
|
|
375
376
|
"data-current",
|
|
376
377
|
"data-disabled",
|
|
377
378
|
"disabled",
|
|
378
379
|
"title",
|
|
379
380
|
"onClick"
|
|
380
|
-
],
|
|
381
|
+
], kr = { class: "image-ctx-menu__icon" }, Ar = { class: "image-ctx-menu__label" }, jr = ["aria-label"], Mr = ["disabled", "onClick"], Nr = { class: "image-ctx-menu__label" }, Pr = {
|
|
381
382
|
key: 0,
|
|
382
383
|
class: "image-ctx-menu__shortcut"
|
|
383
|
-
},
|
|
384
|
+
}, Fr = {
|
|
384
385
|
key: 0,
|
|
385
386
|
class: "image-ctx-menu__divider",
|
|
386
387
|
role: "separator"
|
|
387
|
-
},
|
|
388
|
+
}, Ir = 18, Lr = 260, Rr = 10, zr = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
388
389
|
__name: "ImageContextMenu",
|
|
389
390
|
props: {
|
|
390
391
|
state: {},
|
|
@@ -405,7 +406,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
405
406
|
function a() {
|
|
406
407
|
i("open-properties"), i("close");
|
|
407
408
|
}
|
|
408
|
-
let { t: o } = c(), s =
|
|
409
|
+
let { t: o } = c(), s = Cr(), l = nt, u = N(() => n.state ? it(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
|
|
409
410
|
inline: "wrap_text",
|
|
410
411
|
squareLeft: "format_image_left",
|
|
411
412
|
squareRight: "format_image_right",
|
|
@@ -417,17 +418,17 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
417
418
|
}
|
|
418
419
|
let p = N(() => {
|
|
419
420
|
if (!n.state) return {};
|
|
420
|
-
let e =
|
|
421
|
-
return typeof window < "u" && (t +
|
|
421
|
+
let e = nt.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
422
|
+
return typeof window < "u" && (t + Lr > window.innerWidth && (t = window.innerWidth - Lr - Rr), r + e > window.innerHeight && (r = window.innerHeight - e - Rr), t < Rr && (t = Rr), r < Rr && (r = Rr)), {
|
|
422
423
|
position: "fixed",
|
|
423
424
|
left: `${t}px`,
|
|
424
425
|
top: `${r}px`,
|
|
425
|
-
minWidth: `${
|
|
426
|
+
minWidth: `${Lr}px`,
|
|
426
427
|
zIndex: 400
|
|
427
428
|
};
|
|
428
429
|
});
|
|
429
430
|
function m(e) {
|
|
430
|
-
return n.state ?
|
|
431
|
+
return n.state ? ot(e, n.state.currentWrapType) : !1;
|
|
431
432
|
}
|
|
432
433
|
function h(e) {
|
|
433
434
|
m(e) && (i("select", e.choice), i("close"));
|
|
@@ -441,7 +442,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
441
442
|
function v(e) {
|
|
442
443
|
e.key === "Escape" && (e.preventDefault(), i("close"));
|
|
443
444
|
}
|
|
444
|
-
return (t, n) => (U(), P(
|
|
445
|
+
return (t, n) => (U(), P(M, { to: "body" }, [e.state && e.state.open ? (U(), I("div", {
|
|
445
446
|
key: 0,
|
|
446
447
|
class: "image-ctx-menu-backdrop",
|
|
447
448
|
onMousedown: _,
|
|
@@ -464,12 +465,12 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
464
465
|
"data-action": "open-properties",
|
|
465
466
|
onMousedown: n[1] ||= Y(() => {}, ["prevent"]),
|
|
466
467
|
onClick: a
|
|
467
|
-
}, [L("span",
|
|
468
|
+
}, [L("span", Tr, [R(r, {
|
|
468
469
|
name: "settings",
|
|
469
|
-
size:
|
|
470
|
-
})]), L("span",
|
|
471
|
-
e.canOpenProperties ? (U(), I("div",
|
|
472
|
-
(U(!0), I(
|
|
470
|
+
size: Ir
|
|
471
|
+
})]), L("span", Er, K(q(o)("imageWrap.menu.imageProperties")), 1)], 32)) : F("", !0),
|
|
472
|
+
e.canOpenProperties ? (U(), I("div", Dr)) : F("", !0),
|
|
473
|
+
(U(!0), I(j, null, G(q(l), (e) => (U(), I("button", {
|
|
473
474
|
key: e.choice,
|
|
474
475
|
type: "button",
|
|
475
476
|
role: "menuitem",
|
|
@@ -482,37 +483,37 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
482
483
|
onMousedown: n[2] ||= Y(() => {}, ["prevent"]),
|
|
483
484
|
onClick: (t) => h(e)
|
|
484
485
|
}, [
|
|
485
|
-
L("span",
|
|
486
|
+
L("span", kr, [R(r, {
|
|
486
487
|
name: f(e.iconHint),
|
|
487
|
-
size:
|
|
488
|
+
size: Ir
|
|
488
489
|
}, null, 8, ["name"])]),
|
|
489
|
-
L("span",
|
|
490
|
+
L("span", Ar, K(q(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
490
491
|
e.choice === u.value ? (U(), I("span", {
|
|
491
492
|
key: 0,
|
|
492
493
|
class: "image-ctx-menu__current-dot",
|
|
493
494
|
"aria-label": q(o)("imageWrap.menu.ariaLabel")
|
|
494
|
-
}, "●", 8,
|
|
495
|
-
], 42,
|
|
496
|
-
e.textActions && e.textActions.length > 0 ? (U(), I(
|
|
495
|
+
}, "●", 8, jr)) : F("", !0)
|
|
496
|
+
], 42, Or))), 128)),
|
|
497
|
+
e.textActions && e.textActions.length > 0 ? (U(), I(j, { key: 2 }, [n[5] ||= L("div", {
|
|
497
498
|
class: "image-ctx-menu__divider",
|
|
498
499
|
role: "separator"
|
|
499
|
-
}, null, -1), (U(!0), I(
|
|
500
|
+
}, null, -1), (U(!0), I(j, null, G(e.textActions, (e, t) => (U(), I(j, { key: `${e.action}-${t}` }, [L("button", {
|
|
500
501
|
type: "button",
|
|
501
502
|
role: "menuitem",
|
|
502
503
|
class: "image-ctx-menu__item image-ctx-menu__item--text",
|
|
503
504
|
disabled: e.disabled,
|
|
504
505
|
onMousedown: n[3] ||= Y(() => {}, ["prevent"]),
|
|
505
506
|
onClick: (t) => g(e)
|
|
506
|
-
}, [L("span",
|
|
507
|
-
], 46,
|
|
507
|
+
}, [L("span", Nr, K(e.label), 1), e.shortcut ? (U(), I("span", Pr, K(e.shortcut), 1)) : F("", !0)], 40, Mr), e.dividerAfter ? (U(), I("div", Fr)) : F("", !0)], 64))), 128))], 64)) : F("", !0)
|
|
508
|
+
], 46, wr)) : F("", !0)]));
|
|
508
509
|
}
|
|
509
|
-
}), [["__scopeId", "data-v-
|
|
510
|
+
}), [["__scopeId", "data-v-fc8f35bc"]]), Br = ["disabled", "onMousedown"], Vr = {
|
|
510
511
|
key: 0,
|
|
511
512
|
class: "ctx-menu__icon"
|
|
512
|
-
},
|
|
513
|
+
}, Hr = { class: "ctx-menu__label" }, Ur = {
|
|
513
514
|
key: 1,
|
|
514
515
|
class: "ctx-menu__shortcut"
|
|
515
|
-
},
|
|
516
|
+
}, Wr = 220, Gr = 32, Kr = 10, qr = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
516
517
|
__name: "TextContextMenu",
|
|
517
518
|
props: {
|
|
518
519
|
isOpen: { type: Boolean },
|
|
@@ -529,7 +530,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
529
530
|
setup(e, { emit: t }) {
|
|
530
531
|
let n = e, r = ({ node: e }) => e;
|
|
531
532
|
r.props = ["node"];
|
|
532
|
-
let i = t, { t: a } = c(), o =
|
|
533
|
+
let i = t, { t: a } = c(), o = Cr(), s = W(null), l = N(() => {
|
|
533
534
|
let e = [], t = n.customItems ?? [];
|
|
534
535
|
for (let [n, r] of t.entries()) e.push({
|
|
535
536
|
id: `custom-${r.id}`,
|
|
@@ -665,8 +666,8 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
665
666
|
action: "deleteTable"
|
|
666
667
|
}), e;
|
|
667
668
|
}), u = N(() => {
|
|
668
|
-
let e = n.position.x, t = n.position.y, r = l.value.filter((e) => !e.divider).length, i = l.value.filter((e) => e.divider).length, a = r *
|
|
669
|
-
return typeof window < "u" && (e +
|
|
669
|
+
let e = n.position.x, t = n.position.y, r = l.value.filter((e) => !e.divider).length, i = l.value.filter((e) => e.divider).length, a = r * Gr + i * 9;
|
|
670
|
+
return typeof window < "u" && (e + Wr + Kr > window.innerWidth && (e = window.innerWidth - Wr - Kr), t + a + Kr > window.innerHeight && (t = window.innerHeight - a - Kr)), {
|
|
670
671
|
position: "fixed",
|
|
671
672
|
left: `${e}px`,
|
|
672
673
|
top: `${t}px`,
|
|
@@ -680,8 +681,8 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
680
681
|
e.key === "Escape" && i("close");
|
|
681
682
|
}
|
|
682
683
|
return J(() => n.isOpen, (e) => {
|
|
683
|
-
e &&
|
|
684
|
-
}), (t, n) => (U(), P(
|
|
684
|
+
e && ye(() => s.value?.focus());
|
|
685
|
+
}), (t, n) => (U(), P(M, { to: "body" }, [e.isOpen ? (U(), I("div", {
|
|
685
686
|
key: 0,
|
|
686
687
|
class: "ctx-menu-backdrop",
|
|
687
688
|
onMousedown: n[0] ||= (e) => t.$emit("close"),
|
|
@@ -694,7 +695,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
694
695
|
style: H(u.value),
|
|
695
696
|
onContextmenu: n[2] ||= Y(() => {}, ["prevent"]),
|
|
696
697
|
onKeydown: f
|
|
697
|
-
}, [(U(!0), I(
|
|
698
|
+
}, [(U(!0), I(j, null, G(l.value, (e, t) => (U(), I("button", {
|
|
698
699
|
key: e.id || t,
|
|
699
700
|
class: V(["ctx-menu__item", {
|
|
700
701
|
"ctx-menu__item--disabled": e.disabled,
|
|
@@ -704,12 +705,12 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
704
705
|
disabled: e.disabled,
|
|
705
706
|
onMousedown: Y((t) => d(e.action), ["prevent"])
|
|
706
707
|
}, [
|
|
707
|
-
e.icon ? (U(), I("span",
|
|
708
|
-
L("span",
|
|
709
|
-
e.shortcut ? (U(), I("span",
|
|
710
|
-
], 42,
|
|
708
|
+
e.icon ? (U(), I("span", Vr, [R(r, { node: e.icon }, null, 8, ["node"])])) : F("", !0),
|
|
709
|
+
L("span", Hr, K(e.label), 1),
|
|
710
|
+
e.shortcut ? (U(), I("span", Ur, K(e.shortcut), 1)) : F("", !0)
|
|
711
|
+
], 42, Br))), 128))], 38)) : F("", !0)]));
|
|
711
712
|
}
|
|
712
|
-
}), [["__scopeId", "data-v-
|
|
713
|
+
}), [["__scopeId", "data-v-c1416e84"]]), Jr = /* @__PURE__ */ z({
|
|
713
714
|
__name: "DocxEditorOverlays",
|
|
714
715
|
props: {
|
|
715
716
|
readOnly: { type: Boolean },
|
|
@@ -728,7 +729,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
728
729
|
],
|
|
729
730
|
setup(e, { emit: t }) {
|
|
730
731
|
let n = t;
|
|
731
|
-
return (t, r) => (U(), I(
|
|
732
|
+
return (t, r) => (U(), I(j, null, [R(qr, {
|
|
732
733
|
"is-open": e.contextMenu.isOpen,
|
|
733
734
|
position: e.contextMenu.position,
|
|
734
735
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -750,7 +751,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
750
751
|
"can-merge-cells",
|
|
751
752
|
"can-split-cell",
|
|
752
753
|
"custom-items"
|
|
753
|
-
]),
|
|
754
|
+
]), R(zr, {
|
|
754
755
|
state: e.imageContextMenu,
|
|
755
756
|
"text-actions": e.imageContextMenuTextActions,
|
|
756
757
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -767,7 +768,7 @@ var xr = ["aria-label"], Sr = { class: "image-ctx-menu__icon" }, Cr = { class: "
|
|
|
767
768
|
});
|
|
768
769
|
//#endregion
|
|
769
770
|
//#region src/composables/imageOverlayRect.ts
|
|
770
|
-
function
|
|
771
|
+
function Yr(e) {
|
|
771
772
|
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
772
773
|
return {
|
|
773
774
|
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
@@ -778,13 +779,13 @@ function Kr(e) {
|
|
|
778
779
|
}
|
|
779
780
|
//#endregion
|
|
780
781
|
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
781
|
-
var
|
|
782
|
+
var Xr = ["data-handle", "onMousedown"], Zr = ["title"], Qr = {
|
|
782
783
|
key: 0,
|
|
783
784
|
class: "image-overlay__dim"
|
|
784
|
-
},
|
|
785
|
+
}, $r = {
|
|
785
786
|
key: 1,
|
|
786
787
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
787
|
-
},
|
|
788
|
+
}, ei = 4, ti = 15, ni = 250, ri = 700, ii = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
788
789
|
__name: "ImageSelectionOverlay",
|
|
789
790
|
props: {
|
|
790
791
|
imageInfo: {},
|
|
@@ -813,17 +814,17 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
813
814
|
let t = e.attrs.transform;
|
|
814
815
|
return typeof t == "string" ? t : null;
|
|
815
816
|
}
|
|
816
|
-
function
|
|
817
|
+
function re() {
|
|
817
818
|
return a.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
|
|
818
819
|
}
|
|
819
820
|
function ie() {
|
|
820
821
|
let e = r.imageInfo;
|
|
821
822
|
if (!e) return null;
|
|
822
823
|
if (e.element.isConnected) return e.element;
|
|
823
|
-
let t =
|
|
824
|
+
let t = re();
|
|
824
825
|
if (!t) return null;
|
|
825
|
-
let n =
|
|
826
|
-
return n ?
|
|
826
|
+
let n = gt(t, e.pmPos);
|
|
827
|
+
return n ? at(n) : null;
|
|
827
828
|
}
|
|
828
829
|
function C() {
|
|
829
830
|
let e = ie();
|
|
@@ -836,9 +837,9 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
836
837
|
p.value = null;
|
|
837
838
|
return;
|
|
838
839
|
}
|
|
839
|
-
let n = t.getBoundingClientRect();
|
|
840
|
-
p.value =
|
|
841
|
-
imageRect:
|
|
840
|
+
let n = t.getBoundingClientRect(), i = e.getBoundingClientRect();
|
|
841
|
+
p.value = Yr({
|
|
842
|
+
imageRect: i,
|
|
842
843
|
parentRect: n,
|
|
843
844
|
scrollLeft: t.scrollLeft,
|
|
844
845
|
scrollTop: t.scrollTop,
|
|
@@ -855,10 +856,10 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
855
856
|
let o = a - r;
|
|
856
857
|
C();
|
|
857
858
|
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
858
|
-
n = c === t ? n + 1 : 0, t = c, !(o >=
|
|
859
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= ni && n >= 2) && o < ri && (e = requestAnimationFrame(i));
|
|
859
860
|
};
|
|
860
861
|
e = requestAnimationFrame(i);
|
|
861
|
-
let a = setTimeout(C,
|
|
862
|
+
let a = setTimeout(C, ni);
|
|
862
863
|
ae = () => {
|
|
863
864
|
cancelAnimationFrame(e), clearTimeout(a);
|
|
864
865
|
};
|
|
@@ -878,9 +879,9 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
878
879
|
}, o = a.value?.closest(".docx-editor-vue__pages-viewport");
|
|
879
880
|
o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
|
|
880
881
|
let s = null, c = !1;
|
|
881
|
-
|
|
882
|
+
ye(() => {
|
|
882
883
|
if (c || !r.imageInfo) return;
|
|
883
|
-
let e =
|
|
884
|
+
let e = re();
|
|
884
885
|
e && (s = new MutationObserver(() => oe()), s.observe(e, {
|
|
885
886
|
attributes: !0,
|
|
886
887
|
attributeFilter: ["style"]
|
|
@@ -907,7 +908,7 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
907
908
|
height: `${n}px`,
|
|
908
909
|
transform: i === 1 ? void 0 : `scale(${i})`,
|
|
909
910
|
transformOrigin: "top left",
|
|
910
|
-
zIndex:
|
|
911
|
+
zIndex: ne.imageOverlay,
|
|
911
912
|
pointerEvents: "auto"
|
|
912
913
|
};
|
|
913
914
|
}), ce = N(() => {
|
|
@@ -983,15 +984,18 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
983
984
|
!r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", E), document.addEventListener("mouseup", D));
|
|
984
985
|
}
|
|
985
986
|
function E(e) {
|
|
986
|
-
let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o =
|
|
987
|
+
let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = dt(m, n, i, _, v, a);
|
|
987
988
|
u.value = Math.round(o.width), d.value = Math.round(o.height);
|
|
988
989
|
let s = y;
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
990
|
+
if (s) {
|
|
991
|
+
let e = m.includes("w") ? s.left + (s.width - o.width) : s.left, t = m.includes("n") ? s.top + (s.height - o.height) : s.top;
|
|
992
|
+
p.value = {
|
|
993
|
+
left: e,
|
|
994
|
+
top: t,
|
|
995
|
+
width: s.width,
|
|
996
|
+
height: s.height
|
|
997
|
+
};
|
|
998
|
+
}
|
|
995
999
|
}
|
|
996
1000
|
function D() {
|
|
997
1001
|
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), o.value = !1, y = null, i("interact-end");
|
|
@@ -1000,11 +1004,11 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1000
1004
|
C();
|
|
1001
1005
|
return;
|
|
1002
1006
|
}
|
|
1003
|
-
let n =
|
|
1004
|
-
n !== null && _e(n),
|
|
1007
|
+
let n = mt(e, t.pmPos, u.value, d.value);
|
|
1008
|
+
n !== null && _e(n), ye(() => C());
|
|
1005
1009
|
}
|
|
1006
1010
|
let ue = 0, de = 0, fe = 0, O = 0, k = null, A = null;
|
|
1007
|
-
function
|
|
1011
|
+
function M(e) {
|
|
1008
1012
|
if (!e) return 0;
|
|
1009
1013
|
let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/)?.[1];
|
|
1010
1014
|
return t ? parseFloat(t) : 0;
|
|
@@ -1013,17 +1017,17 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1013
1017
|
let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
|
|
1014
1018
|
return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
|
|
1015
1019
|
}
|
|
1016
|
-
function
|
|
1020
|
+
function P(e, t) {
|
|
1017
1021
|
return Math.atan2(e - ue, -(t - de)) * 180 / Math.PI;
|
|
1018
1022
|
}
|
|
1019
|
-
function
|
|
1023
|
+
function me(e) {
|
|
1020
1024
|
if (!r.imageInfo) return;
|
|
1021
1025
|
let t = r.imageInfo.element.getBoundingClientRect();
|
|
1022
|
-
ue = t.left + t.width / 2, de = t.top + t.height / 2, k = te(S(r.view, r.imageInfo.pmPos)), O =
|
|
1026
|
+
ue = t.left + t.width / 2, de = t.top + t.height / 2, k = te(S(r.view, r.imageInfo.pmPos)), O = M(k), A = r.imageInfo.element.querySelector("img"), fe = P(e.clientX, e.clientY), f.value = O, l.value = !0, i("interact-start"), document.addEventListener("mousemove", he), document.addEventListener("mouseup", ge);
|
|
1023
1027
|
}
|
|
1024
1028
|
function he(e) {
|
|
1025
|
-
let t =
|
|
1026
|
-
e.shiftKey || (n = Math.round(n /
|
|
1029
|
+
let t = P(e.clientX, e.clientY) - fe, n = O + t;
|
|
1030
|
+
e.shiftKey || (n = Math.round(n / ti) * ti), f.value = (n % 360 + 360) % 360, A && (A.style.transform = pe(k, f.value) || "");
|
|
1027
1031
|
}
|
|
1028
1032
|
function ge() {
|
|
1029
1033
|
document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), l.value = !1, i("interact-end");
|
|
@@ -1037,14 +1041,14 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1037
1041
|
} catch {} finally {
|
|
1038
1042
|
A && (A.style.transform = ""), A = null, k = null;
|
|
1039
1043
|
}
|
|
1040
|
-
|
|
1044
|
+
ye(() => C());
|
|
1041
1045
|
}
|
|
1042
1046
|
let R = null;
|
|
1043
1047
|
function z(e) {
|
|
1044
1048
|
if (!r.imageInfo || !p.value) return;
|
|
1045
1049
|
let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
|
|
1046
1050
|
let c = e.clientX - t, l = e.clientY - n;
|
|
1047
|
-
if (!(!o && Math.sqrt(c * c + l * l) <
|
|
1051
|
+
if (!(!o && Math.sqrt(c * c + l * l) < ei)) {
|
|
1048
1052
|
if (!o) {
|
|
1049
1053
|
o = !0, s.value = !0, i("interact-start"), R = document.createElement("div"), R.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
|
|
1050
1054
|
let e = r.zoom;
|
|
@@ -1064,44 +1068,43 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1064
1068
|
let n = r.view, i = r.imageInfo;
|
|
1065
1069
|
if (!n || !i) return;
|
|
1066
1070
|
let o = S(n, i.pmPos);
|
|
1067
|
-
if (o)
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
}
|
|
1079
|
-
if (!s) {
|
|
1080
|
-
let e = o.item(o.length - 1);
|
|
1081
|
-
s = e ? e.querySelector(".layout-page-content") : null;
|
|
1071
|
+
if (!o) return;
|
|
1072
|
+
let s;
|
|
1073
|
+
if (ht(o)) {
|
|
1074
|
+
let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
|
|
1075
|
+
if (!o || o.length === 0) return;
|
|
1076
|
+
let c = null;
|
|
1077
|
+
for (let e of o) {
|
|
1078
|
+
let n = e.getBoundingClientRect();
|
|
1079
|
+
if (t >= n.top && t <= n.bottom) {
|
|
1080
|
+
c = e.querySelector(".layout-page-content");
|
|
1081
|
+
break;
|
|
1082
1082
|
}
|
|
1083
|
-
if (!s) return;
|
|
1084
|
-
let c = s.getBoundingClientRect(), l = r.zoom, u = nt((e - c.left) / l), d = nt((t - c.top) / l), f = pt(n, i.pmPos, u, d);
|
|
1085
|
-
f !== null && _e(f);
|
|
1086
|
-
} else {
|
|
1087
|
-
let r = ne();
|
|
1088
|
-
if (!r) return;
|
|
1089
|
-
let a = dt(r, e, t, 1);
|
|
1090
|
-
if (a == null || a < 0) return;
|
|
1091
|
-
let o = mt(n, i.pmPos, a);
|
|
1092
|
-
o !== null && _e(o);
|
|
1093
1083
|
}
|
|
1094
|
-
|
|
1084
|
+
if (!c) {
|
|
1085
|
+
let e = o.item(o.length - 1);
|
|
1086
|
+
c = e ? e.querySelector(".layout-page-content") : null;
|
|
1087
|
+
}
|
|
1088
|
+
if (!c) return;
|
|
1089
|
+
let l = c.getBoundingClientRect(), u = r.zoom, d = tt((e - l.left) / u), f = tt((t - l.top) / u);
|
|
1090
|
+
s = ft(n, i.pmPos, d, f);
|
|
1091
|
+
} else {
|
|
1092
|
+
let r = re();
|
|
1093
|
+
if (!r) return;
|
|
1094
|
+
let a = ut(r, e, t, 1);
|
|
1095
|
+
if (a == null || a < 0) return;
|
|
1096
|
+
s = pt(n, i.pmPos, a);
|
|
1095
1097
|
}
|
|
1098
|
+
s !== null && _e(s), ye(() => C());
|
|
1096
1099
|
}
|
|
1097
1100
|
function _e(e) {
|
|
1098
1101
|
let t = r.view;
|
|
1099
1102
|
if (t) try {
|
|
1100
|
-
let n =
|
|
1103
|
+
let n = $e.create(t.state.doc, e);
|
|
1101
1104
|
t.dispatch(t.state.tr.setSelection(n));
|
|
1102
1105
|
} catch {}
|
|
1103
1106
|
}
|
|
1104
|
-
return
|
|
1107
|
+
return be(() => {
|
|
1105
1108
|
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), document.removeEventListener("mousemove", he), document.removeEventListener("mouseup", ge), x && document.removeEventListener("mousemove", x), ee && document.removeEventListener("mouseup", ee), R &&= (R.remove(), null), b && cancelAnimationFrame(b), ae?.();
|
|
1106
1109
|
}), (t, r) => e.imageInfo ? (U(), I("div", {
|
|
1107
1110
|
key: 0,
|
|
@@ -1118,25 +1121,25 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1118
1121
|
onMousedown: r[0] ||= Y((e) => z(e), ["prevent", "stop"]),
|
|
1119
1122
|
onContextmenu: r[1] ||= Y((e) => t.$emit("context-menu", e), ["prevent", "stop"])
|
|
1120
1123
|
}, null, 36),
|
|
1121
|
-
(U(!0), I(
|
|
1124
|
+
(U(!0), I(j, null, G(ce.value, (e) => (U(), I("div", {
|
|
1122
1125
|
key: e.pos,
|
|
1123
1126
|
class: "image-overlay__handle",
|
|
1124
1127
|
style: H(e.style),
|
|
1125
1128
|
"data-handle": e.pos,
|
|
1126
1129
|
onMousedown: Y((t) => le(t, e.pos), ["prevent", "stop"])
|
|
1127
|
-
}, null, 44,
|
|
1130
|
+
}, null, 44, Xr))), 128)),
|
|
1128
1131
|
r[5] ||= L("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
1129
1132
|
L("div", {
|
|
1130
1133
|
class: "image-overlay__rotate-handle",
|
|
1131
1134
|
style: H({ left: `${w.value / 2 - 7}px` }),
|
|
1132
1135
|
title: q(n)("imageOverlay.rotate"),
|
|
1133
|
-
onMousedown: r[2] ||= Y((e) =>
|
|
1134
|
-
}, null, 44,
|
|
1135
|
-
o.value ? (U(), I("div",
|
|
1136
|
-
l.value ? (U(), I("div",
|
|
1136
|
+
onMousedown: r[2] ||= Y((e) => me(e), ["prevent", "stop"])
|
|
1137
|
+
}, null, 44, Zr),
|
|
1138
|
+
o.value ? (U(), I("div", Qr, K(Math.round(u.value)) + " × " + K(Math.round(d.value)), 1)) : F("", !0),
|
|
1139
|
+
l.value ? (U(), I("div", $r, K(Math.round(f.value)) + "° ", 1)) : F("", !0)
|
|
1137
1140
|
], 36)) : F("", !0);
|
|
1138
1141
|
}
|
|
1139
|
-
}), [["__scopeId", "data-v-
|
|
1142
|
+
}), [["__scopeId", "data-v-4c3d1a1d"]]), ai = ["title", "aria-label"], oi = /* @__PURE__ */ z({
|
|
1140
1143
|
__name: "OutlineToggleButton",
|
|
1141
1144
|
props: {
|
|
1142
1145
|
leftOffset: {},
|
|
@@ -1156,12 +1159,12 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1156
1159
|
"aria-label": q(t)("editor.showDocumentOutline"),
|
|
1157
1160
|
onClick: i[0] ||= (e) => n.$emit("toggle"),
|
|
1158
1161
|
onMousedown: i[1] ||= Y(() => {}, ["stop"])
|
|
1159
|
-
}, [
|
|
1162
|
+
}, [R(r, {
|
|
1160
1163
|
name: "format_list_bulleted",
|
|
1161
1164
|
size: 20
|
|
1162
|
-
})], 44,
|
|
1165
|
+
})], 44, ai));
|
|
1163
1166
|
}
|
|
1164
|
-
}),
|
|
1167
|
+
}), si = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
1165
1168
|
__name: "PageIndicator",
|
|
1166
1169
|
props: {
|
|
1167
1170
|
currentPage: {},
|
|
@@ -1180,7 +1183,7 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1180
1183
|
total: e.totalPages
|
|
1181
1184
|
})), 5));
|
|
1182
1185
|
}
|
|
1183
|
-
}), [["__scopeId", "data-v-
|
|
1186
|
+
}), [["__scopeId", "data-v-f1904974"]]), ci = ["data-folio-block-id"], li = ["data-folio-block-id", "title"], ui = 2.5, di = 5, fi = 6, pi = 2, mi = 2, hi = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
1184
1187
|
__name: "TemplateDirectivesOverlay",
|
|
1185
1188
|
props: {
|
|
1186
1189
|
getView: { type: Function },
|
|
@@ -1192,21 +1195,21 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1192
1195
|
measures: {}
|
|
1193
1196
|
},
|
|
1194
1197
|
setup(e) {
|
|
1195
|
-
let t = e, n = new Set(["if", "each"]), r = new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
|
|
1198
|
+
let t = e, n = /* @__PURE__ */ new Set(["if", "each"]), r = /* @__PURE__ */ new Set(["endif", "endeach"]), i = (e) => e === "each" ? "each" : "if";
|
|
1196
1199
|
function a(e) {
|
|
1197
|
-
let t = e -
|
|
1198
|
-
return t <= 0 ? 0 : Math.floor(t /
|
|
1200
|
+
let t = e - fi - ui - pi;
|
|
1201
|
+
return t <= 0 ? 0 : Math.floor(t / di);
|
|
1199
1202
|
}
|
|
1200
1203
|
function o(e, t, n) {
|
|
1201
1204
|
let r = a(n), i = Math.min(Math.max(0, e), r);
|
|
1202
|
-
return t -
|
|
1205
|
+
return t - fi - ui - (r - i) * di;
|
|
1203
1206
|
}
|
|
1204
1207
|
function s(e, t) {
|
|
1205
|
-
if (t.length === 0) return e.bottom - e.top >=
|
|
1208
|
+
if (t.length === 0) return e.bottom - e.top >= mi ? [e] : [];
|
|
1206
1209
|
let n = [];
|
|
1207
1210
|
for (let r of t) {
|
|
1208
1211
|
let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
|
|
1209
|
-
i - t >=
|
|
1212
|
+
i - t >= mi && n.push({
|
|
1210
1213
|
top: t,
|
|
1211
1214
|
bottom: i
|
|
1212
1215
|
});
|
|
@@ -1283,12 +1286,12 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1283
1286
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1284
1287
|
return;
|
|
1285
1288
|
}
|
|
1286
|
-
let a =
|
|
1289
|
+
let a = yt(i);
|
|
1287
1290
|
if (a.length === 0) {
|
|
1288
1291
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1289
1292
|
return;
|
|
1290
1293
|
}
|
|
1291
|
-
let o =
|
|
1294
|
+
let o = Ge(r, t.zoom), s = await Ke(a, {
|
|
1292
1295
|
pagesContainer: r,
|
|
1293
1296
|
zoom: t.zoom,
|
|
1294
1297
|
layout: t.layout,
|
|
@@ -1349,14 +1352,14 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1349
1352
|
let n = w(e.relatedTarget);
|
|
1350
1353
|
n !== t && g.value === t && (g.value = n);
|
|
1351
1354
|
}
|
|
1352
|
-
return
|
|
1355
|
+
return xe(() => y()), be(() => {
|
|
1353
1356
|
v !== null && (cancelAnimationFrame(v), v = null);
|
|
1354
1357
|
}), (t, n) => (U(), I("div", {
|
|
1355
1358
|
class: "folio-template-directives-overlay",
|
|
1356
1359
|
"data-folio-template-directives-overlay": "",
|
|
1357
1360
|
onPointerover: T,
|
|
1358
1361
|
onPointerout: se
|
|
1359
|
-
}, [(U(!0), I(
|
|
1362
|
+
}, [(U(!0), I(j, null, G(ee.value, (t) => (U(), I(j, { key: `rail:${t.blockId}` }, [(U(!0), I(j, null, G(t.segments, (n, r) => (U(), I("div", {
|
|
1360
1363
|
key: `rail:${t.blockId}:${r}`,
|
|
1361
1364
|
class: V([
|
|
1362
1365
|
"folio-template-band-rail",
|
|
@@ -1368,10 +1371,10 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1368
1371
|
position: "absolute",
|
|
1369
1372
|
left: `${t.railX * e.zoom}px`,
|
|
1370
1373
|
top: `${n.top * e.zoom}px`,
|
|
1371
|
-
width: `${
|
|
1374
|
+
width: `${ui * e.zoom}px`,
|
|
1372
1375
|
height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
|
|
1373
1376
|
})
|
|
1374
|
-
}, null, 14,
|
|
1377
|
+
}, null, 14, ci))), 128))], 64))), 128)), (U(!0), I(j, null, G(p.value, (t, n) => (U(), I(j, { key: `d:${n}` }, [(U(!0), I(j, null, G(t.rects, (r, i) => (U(), I("span", {
|
|
1375
1378
|
key: `d:${n}:${i}`,
|
|
1376
1379
|
class: V(oe(t.range)),
|
|
1377
1380
|
"data-folio-block-id": C(t.range),
|
|
@@ -1383,9 +1386,9 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1383
1386
|
width: `${(r.width + 2) * e.zoom}px`,
|
|
1384
1387
|
height: `${Math.max(0, r.height - 2) * e.zoom}px`
|
|
1385
1388
|
})
|
|
1386
|
-
}, null, 14,
|
|
1389
|
+
}, null, 14, li))), 128))], 64))), 128))], 32));
|
|
1387
1390
|
}
|
|
1388
|
-
}), [["__scopeId", "data-v-142d2ac6"]]),
|
|
1391
|
+
}), [["__scopeId", "data-v-142d2ac6"]]), gi = ["href", "title"], _i = ["title"], vi = ["title"], yi = ["title"], bi = { class: "docx-hyperlink-popup__edit-row" }, xi = ["placeholder", "onKeydown"], Si = { class: "docx-hyperlink-popup__edit-row" }, Ci = ["onKeydown"], wi = ["disabled"], Ti = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
1389
1392
|
__name: "HyperlinkPopup",
|
|
1390
1393
|
props: {
|
|
1391
1394
|
data: {},
|
|
@@ -1417,7 +1420,7 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1417
1420
|
}, f = setTimeout(() => {
|
|
1418
1421
|
d && document.addEventListener("mousedown", d);
|
|
1419
1422
|
}, 0));
|
|
1420
|
-
}, { immediate: !0 }),
|
|
1423
|
+
}, { immediate: !0 }), be(p);
|
|
1421
1424
|
function m() {
|
|
1422
1425
|
r.data && (o.value = r.data.displayText, s.value = r.data.href, a.value = !0);
|
|
1423
1426
|
}
|
|
@@ -1434,28 +1437,28 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1434
1437
|
class: V(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
|
|
1435
1438
|
style: H(u.value),
|
|
1436
1439
|
onMousedown: r[6] ||= Y(() => {}, ["stop"])
|
|
1437
|
-
}, [a.value ? (U(), I(
|
|
1440
|
+
}, [a.value ? (U(), I(j, { key: 1 }, [L("div", bi, [De(L("input", {
|
|
1438
1441
|
class: "docx-hyperlink-popup__input",
|
|
1439
1442
|
placeholder: q(n)("displayText"),
|
|
1440
1443
|
"onUpdate:modelValue": r[2] ||= (e) => o.value = e,
|
|
1441
|
-
onKeydown: [
|
|
1442
|
-
}, null, 40,
|
|
1444
|
+
onKeydown: [Oe(Y(h, ["prevent"]), ["enter"]), r[3] ||= Oe((e) => t.$emit("close"), ["esc"])]
|
|
1445
|
+
}, null, 40, xi), [[Te, o.value]])]), L("div", Si, [De(L("input", {
|
|
1443
1446
|
class: "docx-hyperlink-popup__input",
|
|
1444
1447
|
placeholder: "https://...",
|
|
1445
1448
|
"onUpdate:modelValue": r[4] ||= (e) => s.value = e,
|
|
1446
|
-
onKeydown: [
|
|
1447
|
-
}, null, 40,
|
|
1449
|
+
onKeydown: [Oe(Y(h, ["prevent"]), ["enter"]), r[5] ||= Oe((e) => t.$emit("close"), ["esc"])]
|
|
1450
|
+
}, null, 40, Ci), [[Te, s.value]]), L("button", {
|
|
1448
1451
|
class: "docx-hyperlink-popup__apply",
|
|
1449
1452
|
disabled: !s.value.trim(),
|
|
1450
1453
|
onClick: Y(h, ["prevent"])
|
|
1451
|
-
}, K(q(n)("common.apply")), 9,
|
|
1452
|
-
r[10] ||=
|
|
1454
|
+
}, K(q(n)("common.apply")), 9, wi)])], 64)) : (U(), I(j, { key: 0 }, [
|
|
1455
|
+
r[10] ||= he("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-366df18c><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-366df18c><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-366df18c></circle><path d=\"M2 12h20\" data-v-366df18c></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-366df18c></path></svg></span>", 1),
|
|
1453
1456
|
L("a", {
|
|
1454
1457
|
class: "docx-hyperlink-popup__url",
|
|
1455
1458
|
href: e.data.href,
|
|
1456
1459
|
title: e.data.href,
|
|
1457
1460
|
onClick: r[0] ||= Y((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1458
|
-
}, K(e.data.href), 9,
|
|
1461
|
+
}, K(e.data.href), 9, gi),
|
|
1459
1462
|
r[11] ||= L("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1460
1463
|
L("button", {
|
|
1461
1464
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1477,7 +1480,7 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1477
1480
|
height: "13",
|
|
1478
1481
|
rx: "2",
|
|
1479
1482
|
ry: "2"
|
|
1480
|
-
}), L("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8,
|
|
1483
|
+
}), L("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, _i),
|
|
1481
1484
|
e.readOnly ? F("", !0) : (U(), I("button", {
|
|
1482
1485
|
key: 0,
|
|
1483
1486
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1492,43 +1495,43 @@ var qr = ["data-handle", "onMousedown"], Jr = ["title"], Yr = {
|
|
|
1492
1495
|
"stroke-width": "2",
|
|
1493
1496
|
"stroke-linecap": "round",
|
|
1494
1497
|
"stroke-linejoin": "round"
|
|
1495
|
-
}, [L("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), L("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8,
|
|
1498
|
+
}, [L("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), L("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, vi)),
|
|
1496
1499
|
e.readOnly ? F("", !0) : (U(), I("button", {
|
|
1497
1500
|
key: 1,
|
|
1498
1501
|
class: "docx-hyperlink-popup__btn",
|
|
1499
1502
|
title: q(n)("removeLink"),
|
|
1500
1503
|
onClick: r[1] ||= Y((e) => t.$emit("remove"), ["prevent"])
|
|
1501
|
-
}, [...r[9] ||= [
|
|
1504
|
+
}, [...r[9] ||= [he("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-366df18c><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-366df18c></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-366df18c></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-366df18c></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-366df18c></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-366df18c></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-366df18c></line></svg>", 1)]], 8, yi))
|
|
1502
1505
|
], 64))], 38)) : F("", !0);
|
|
1503
1506
|
}
|
|
1504
|
-
}), [["__scopeId", "data-v-
|
|
1507
|
+
}), [["__scopeId", "data-v-366df18c"]]);
|
|
1505
1508
|
//#endregion
|
|
1506
1509
|
//#region src/composables/commentMarks.ts
|
|
1507
|
-
function
|
|
1510
|
+
function Ei(e, t) {
|
|
1508
1511
|
let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
|
|
1509
1512
|
return n === r ? null : {
|
|
1510
1513
|
from: n,
|
|
1511
1514
|
to: r
|
|
1512
1515
|
};
|
|
1513
1516
|
}
|
|
1514
|
-
function
|
|
1517
|
+
function Di({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
|
|
1515
1518
|
let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
|
|
1516
|
-
return i ?
|
|
1519
|
+
return i ? Ei(e, i) : null;
|
|
1517
1520
|
}
|
|
1518
|
-
function
|
|
1519
|
-
let i = e.state.schema.marks.comment, a =
|
|
1521
|
+
function Oi(e, t, n, r) {
|
|
1522
|
+
let i = e.state.schema.marks.comment, a = Ei(e.state.doc.content.size, t);
|
|
1520
1523
|
if (!i || !a) return !1;
|
|
1521
1524
|
let o = e.state.tr;
|
|
1522
1525
|
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: wt }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(et.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
|
|
1523
1526
|
}
|
|
1524
|
-
function
|
|
1525
|
-
let n = e.state.schema.marks.comment, r =
|
|
1527
|
+
function ki(e, t) {
|
|
1528
|
+
let n = e.state.schema.marks.comment, r = Ei(e.state.doc.content.size, t);
|
|
1526
1529
|
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: wt })));
|
|
1527
1530
|
}
|
|
1528
1531
|
//#endregion
|
|
1529
1532
|
//#region src/composables/useCommentLifecycle.ts
|
|
1530
|
-
var
|
|
1531
|
-
function
|
|
1533
|
+
var Ai = 408, ji = 12;
|
|
1534
|
+
function Mi(e) {
|
|
1532
1535
|
let t = W(!1), n = W(null), r = W(null), i = W(null), a = W(null);
|
|
1533
1536
|
function o(t) {
|
|
1534
1537
|
let n = e.editorView.value, r = e.pagesContainer.value;
|
|
@@ -1561,7 +1564,7 @@ function ki(e) {
|
|
|
1561
1564
|
r.value = null;
|
|
1562
1565
|
return;
|
|
1563
1566
|
}
|
|
1564
|
-
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left +
|
|
1567
|
+
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + ji : l.width / 2 + Ai;
|
|
1565
1568
|
r.value = {
|
|
1566
1569
|
top: c.top - l.top,
|
|
1567
1570
|
left: Math.max(16, Math.min(d, l.width - 16)),
|
|
@@ -1572,7 +1575,7 @@ function ki(e) {
|
|
|
1572
1575
|
function c() {
|
|
1573
1576
|
let s = e.editorView.value;
|
|
1574
1577
|
if (!s) return;
|
|
1575
|
-
let c = r.value, l = s.state.selection, u =
|
|
1578
|
+
let c = r.value, l = s.state.selection, u = Di({
|
|
1576
1579
|
docSize: s.state.doc.content.size,
|
|
1577
1580
|
capturedRange: c ? {
|
|
1578
1581
|
from: c.from,
|
|
@@ -1591,7 +1594,7 @@ function ki(e) {
|
|
|
1591
1594
|
r.value = null;
|
|
1592
1595
|
return;
|
|
1593
1596
|
}
|
|
1594
|
-
if (!
|
|
1597
|
+
if (!Oi(s, u, wt, { selectEnd: !0 })) {
|
|
1595
1598
|
r.value = null, i.value = null;
|
|
1596
1599
|
return;
|
|
1597
1600
|
}
|
|
@@ -1604,11 +1607,11 @@ function ki(e) {
|
|
|
1604
1607
|
let n = e.editorView.value, r = i.value;
|
|
1605
1608
|
if (!n || !r) return !1;
|
|
1606
1609
|
let a = e.createComment(t);
|
|
1607
|
-
return
|
|
1610
|
+
return Oi(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
|
|
1608
1611
|
}
|
|
1609
1612
|
function d() {
|
|
1610
1613
|
let t = e.editorView.value;
|
|
1611
|
-
t && i.value &&
|
|
1614
|
+
t && i.value && ki(t, i.value), l();
|
|
1612
1615
|
}
|
|
1613
1616
|
return {
|
|
1614
1617
|
isAddingComment: t,
|
|
@@ -1622,7 +1625,7 @@ function ki(e) {
|
|
|
1622
1625
|
}
|
|
1623
1626
|
//#endregion
|
|
1624
1627
|
//#region src/composables/useCommentManagement.ts
|
|
1625
|
-
function
|
|
1628
|
+
function Ni(e) {
|
|
1626
1629
|
let t = Tt(), n = W([]), r = W(!1);
|
|
1627
1630
|
function i() {
|
|
1628
1631
|
r.value = !0;
|
|
@@ -1707,7 +1710,7 @@ function Ai(e) {
|
|
|
1707
1710
|
}
|
|
1708
1711
|
//#endregion
|
|
1709
1712
|
//#region src/utils/imageClipboard.ts
|
|
1710
|
-
function
|
|
1713
|
+
function Pi(e, t, n) {
|
|
1711
1714
|
let r = Pt(e.state), i = e.state.schema.marks.insertion;
|
|
1712
1715
|
if (!r || !i) return;
|
|
1713
1716
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
@@ -1717,7 +1720,7 @@ function ji(e, t, n) {
|
|
|
1717
1720
|
date: r.date
|
|
1718
1721
|
}));
|
|
1719
1722
|
}
|
|
1720
|
-
function
|
|
1723
|
+
function Fi(e, t) {
|
|
1721
1724
|
let n = e.state.doc.nodeAt(t);
|
|
1722
1725
|
if (!n || n.type.name !== "image") return;
|
|
1723
1726
|
let r = n.attrs.src;
|
|
@@ -1731,7 +1734,7 @@ function Mi(e, t) {
|
|
|
1731
1734
|
e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
1732
1735
|
});
|
|
1733
1736
|
}
|
|
1734
|
-
function
|
|
1737
|
+
function Ii(e) {
|
|
1735
1738
|
return new Promise((t, n) => {
|
|
1736
1739
|
let r = new FileReader();
|
|
1737
1740
|
r.onload = () => {
|
|
@@ -1739,7 +1742,7 @@ function Ni(e) {
|
|
|
1739
1742
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
|
|
1740
1743
|
});
|
|
1741
1744
|
}
|
|
1742
|
-
function
|
|
1745
|
+
function Li(e) {
|
|
1743
1746
|
return new Promise((t) => {
|
|
1744
1747
|
let n = new Image();
|
|
1745
1748
|
n.onload = () => t({
|
|
@@ -1751,7 +1754,7 @@ function Pi(e) {
|
|
|
1751
1754
|
}), n.src = e;
|
|
1752
1755
|
});
|
|
1753
1756
|
}
|
|
1754
|
-
function
|
|
1757
|
+
function Ri(e, t, n, r) {
|
|
1755
1758
|
let i = e.state.schema.nodes.image;
|
|
1756
1759
|
if (!i) return;
|
|
1757
1760
|
let a = i.create({
|
|
@@ -1762,23 +1765,23 @@ function Fi(e, t, n, r) {
|
|
|
1762
1765
|
wrapType: "inline",
|
|
1763
1766
|
displayMode: "inline"
|
|
1764
1767
|
}), o = e.state.tr.replaceSelectionWith(a);
|
|
1765
|
-
|
|
1768
|
+
Pi(e, o, a), e.dispatch(o);
|
|
1766
1769
|
}
|
|
1767
|
-
async function
|
|
1770
|
+
async function zi(e) {
|
|
1768
1771
|
try {
|
|
1769
1772
|
let t = await navigator.clipboard.read();
|
|
1770
1773
|
for (let n of t) {
|
|
1771
1774
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
1772
1775
|
if (t) {
|
|
1773
|
-
let r = await
|
|
1774
|
-
a > 612 && (o = Math.round(612 / a * o), a = 612),
|
|
1776
|
+
let r = await Ii(await n.getType(t)), i = await Li(r), a = i.width, o = i.height;
|
|
1777
|
+
a > 612 && (o = Math.round(612 / a * o), a = 612), Ri(e, r, a, o);
|
|
1775
1778
|
return;
|
|
1776
1779
|
}
|
|
1777
1780
|
if (n.types.includes("text/html")) {
|
|
1778
1781
|
let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
|
|
1779
1782
|
if (r) {
|
|
1780
1783
|
let n = /data-width="(?<w>\d+)"/u.exec(t)?.groups?.w, i = /data-height="(?<h>\d+)"/u.exec(t)?.groups?.h, a = n ? Number(n) : 200, o = i ? Number(i) : 200;
|
|
1781
|
-
|
|
1784
|
+
Ri(e, r, a || 200, o || 200);
|
|
1782
1785
|
return;
|
|
1783
1786
|
}
|
|
1784
1787
|
}
|
|
@@ -1799,14 +1802,14 @@ async function Ii(e) {
|
|
|
1799
1802
|
}
|
|
1800
1803
|
}
|
|
1801
1804
|
}
|
|
1802
|
-
function
|
|
1805
|
+
function Bi(e, t) {
|
|
1803
1806
|
let n = e.state.doc.nodeAt(t);
|
|
1804
1807
|
if (!n || n.type.name !== "image") return;
|
|
1805
1808
|
let r = document.createElement("input");
|
|
1806
1809
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
1807
1810
|
let i = r.files?.[0];
|
|
1808
1811
|
if (!i) return;
|
|
1809
|
-
let a = await
|
|
1812
|
+
let a = await Ii(i), o = await Li(a), s = n.attrs.width, c = n.attrs.height, l = typeof s == "number" ? s : o.width, u = typeof c == "number" ? c : o.height, d = Math.min(l / o.width, u / o.height), f = Math.round(o.width * d), p = Math.round(o.height * d);
|
|
1810
1813
|
try {
|
|
1811
1814
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
1812
1815
|
...n.attrs,
|
|
@@ -1821,7 +1824,7 @@ function Li(e, t) {
|
|
|
1821
1824
|
}
|
|
1822
1825
|
//#endregion
|
|
1823
1826
|
//#region src/composables/useContextMenus.ts
|
|
1824
|
-
var
|
|
1827
|
+
var Vi = /* @__PURE__ */ new Set([
|
|
1825
1828
|
"inline",
|
|
1826
1829
|
"square",
|
|
1827
1830
|
"tight",
|
|
@@ -1830,16 +1833,16 @@ var Ri = new Set([
|
|
|
1830
1833
|
"behind",
|
|
1831
1834
|
"inFront"
|
|
1832
1835
|
]);
|
|
1833
|
-
function
|
|
1834
|
-
return typeof e == "string" &&
|
|
1836
|
+
function Hi(e) {
|
|
1837
|
+
return typeof e == "string" && Vi.has(e);
|
|
1835
1838
|
}
|
|
1836
|
-
function
|
|
1837
|
-
return
|
|
1839
|
+
function Ui(e) {
|
|
1840
|
+
return Hi(e) ? e : "inline";
|
|
1838
1841
|
}
|
|
1839
|
-
function
|
|
1842
|
+
function Wi(e) {
|
|
1840
1843
|
return e === "left" || e === "right" || e === "none" ? e : null;
|
|
1841
1844
|
}
|
|
1842
|
-
function
|
|
1845
|
+
function Gi(e) {
|
|
1843
1846
|
let { t } = c(), n = W({
|
|
1844
1847
|
isOpen: !1,
|
|
1845
1848
|
position: {
|
|
@@ -1881,7 +1884,7 @@ function Hi(e) {
|
|
|
1881
1884
|
t(e.state, (t) => e.dispatch(t), e);
|
|
1882
1885
|
}
|
|
1883
1886
|
function l(t, n, r, i, a) {
|
|
1884
|
-
let o = i === "inline" ?
|
|
1887
|
+
let o = i === "inline" ? rt(t, e.zoom.value) : void 0;
|
|
1885
1888
|
return {
|
|
1886
1889
|
open: !0,
|
|
1887
1890
|
position: r,
|
|
@@ -1894,12 +1897,12 @@ function Hi(e) {
|
|
|
1894
1897
|
function u(t) {
|
|
1895
1898
|
let a = e.editorView.value;
|
|
1896
1899
|
if (!a) return;
|
|
1897
|
-
let o =
|
|
1900
|
+
let o = at(t.target);
|
|
1898
1901
|
if (o) {
|
|
1899
1902
|
let i = Number(o.dataset.pmStart);
|
|
1900
1903
|
if (!Number.isNaN(i)) {
|
|
1901
1904
|
try {
|
|
1902
|
-
let e =
|
|
1905
|
+
let e = $e.create(a.state.doc, i);
|
|
1903
1906
|
a.dispatch(a.state.tr.setSelection(e));
|
|
1904
1907
|
} catch {}
|
|
1905
1908
|
e.selectedImage.value = {
|
|
@@ -1913,7 +1916,7 @@ function Hi(e) {
|
|
|
1913
1916
|
r.value = l(o, i, {
|
|
1914
1917
|
x: t.clientX,
|
|
1915
1918
|
y: t.clientY
|
|
1916
|
-
},
|
|
1919
|
+
}, Ui(s.attrs.wrapType), Wi(s.attrs.cssFloat)), n.value.isOpen = !1;
|
|
1917
1920
|
return;
|
|
1918
1921
|
}
|
|
1919
1922
|
}
|
|
@@ -1948,7 +1951,7 @@ function Hi(e) {
|
|
|
1948
1951
|
!o || o.type.name !== "image" || (r.value = l(a.element, a.pmPos, {
|
|
1949
1952
|
x: t.clientX,
|
|
1950
1953
|
y: t.clientY
|
|
1951
|
-
},
|
|
1954
|
+
}, Ui(o.attrs.wrapType), Wi(o.attrs.cssFloat)), n.value.isOpen = !1);
|
|
1952
1955
|
}
|
|
1953
1956
|
function f(t) {
|
|
1954
1957
|
let n = e.editorView.value, i = r.value;
|
|
@@ -1972,16 +1975,16 @@ function Hi(e) {
|
|
|
1972
1975
|
case "cut":
|
|
1973
1976
|
if (e.selectedImage.value) {
|
|
1974
1977
|
let t = e.selectedImage.value.pmPos;
|
|
1975
|
-
|
|
1978
|
+
Fi(n, t);
|
|
1976
1979
|
let r = n.state.doc.nodeAt(t);
|
|
1977
1980
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
|
|
1978
1981
|
} else n.focus(), document.execCommand("cut");
|
|
1979
1982
|
break;
|
|
1980
1983
|
case "copy":
|
|
1981
|
-
e.selectedImage.value ?
|
|
1984
|
+
e.selectedImage.value ? Fi(n, e.selectedImage.value.pmPos) : (n.focus(), document.execCommand("copy"));
|
|
1982
1985
|
break;
|
|
1983
1986
|
case "paste":
|
|
1984
|
-
|
|
1987
|
+
zi(n);
|
|
1985
1988
|
break;
|
|
1986
1989
|
case "pasteAsPlainText":
|
|
1987
1990
|
navigator.clipboard.readText().then((e) => {
|
|
@@ -1994,7 +1997,7 @@ function Hi(e) {
|
|
|
1994
1997
|
break;
|
|
1995
1998
|
}
|
|
1996
1999
|
case "selectAll": {
|
|
1997
|
-
let e =
|
|
2000
|
+
let e = Z.create(n.state.doc, 0, n.state.doc.content.size);
|
|
1998
2001
|
n.dispatch(n.state.tr.setSelection(e));
|
|
1999
2002
|
break;
|
|
2000
2003
|
}
|
|
@@ -2002,7 +2005,7 @@ function Hi(e) {
|
|
|
2002
2005
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2003
2006
|
break;
|
|
2004
2007
|
case "replaceImage":
|
|
2005
|
-
e.selectedImage.value &&
|
|
2008
|
+
e.selectedImage.value && Bi(n, e.selectedImage.value.pmPos);
|
|
2006
2009
|
break;
|
|
2007
2010
|
case "deleteImage":
|
|
2008
2011
|
if (e.selectedImage.value) {
|
|
@@ -2040,7 +2043,7 @@ function Hi(e) {
|
|
|
2040
2043
|
}
|
|
2041
2044
|
//#endregion
|
|
2042
2045
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2043
|
-
function
|
|
2046
|
+
function Ki(e) {
|
|
2044
2047
|
async function t(t) {
|
|
2045
2048
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2046
2049
|
}
|
|
@@ -2051,74 +2054,41 @@ function Ui(e) {
|
|
|
2051
2054
|
e && t(e);
|
|
2052
2055
|
}), J(e.document, (e) => {
|
|
2053
2056
|
e && n(e);
|
|
2054
|
-
}),
|
|
2055
|
-
await
|
|
2057
|
+
}), xe(async () => {
|
|
2058
|
+
await ye();
|
|
2056
2059
|
let r = e.documentBuffer(), i = e.document();
|
|
2057
2060
|
r ? await t(r) : i && n(i);
|
|
2058
2061
|
});
|
|
2059
2062
|
}
|
|
2060
2063
|
//#endregion
|
|
2061
|
-
//#region src/utils/aiEditRange.ts
|
|
2062
|
-
var Wi = ({ blockId: e, doc: t, snapshot: n }) => {
|
|
2063
|
-
let r = ln(e);
|
|
2064
|
-
if (r !== null) {
|
|
2065
|
-
let e = on(t, r);
|
|
2066
|
-
if (e !== null) return {
|
|
2067
|
-
from: e.from,
|
|
2068
|
-
to: e.to
|
|
2069
|
-
};
|
|
2070
|
-
}
|
|
2071
|
-
let i = n ?? an(t), a = i.anchors[e] ?? Gi(e, i);
|
|
2072
|
-
return a ? Ki(t.content.size, a) : null;
|
|
2073
|
-
}, Gi = (e, t) => {
|
|
2074
|
-
let n = un(e);
|
|
2075
|
-
if (n === null) return;
|
|
2076
|
-
let r = t.blocks.at(n - 1);
|
|
2077
|
-
return r ? t.anchors[r.id] : void 0;
|
|
2078
|
-
};
|
|
2079
|
-
function Ki(e, t) {
|
|
2080
|
-
return {
|
|
2081
|
-
from: Math.min(Math.max(t.from, 0), e),
|
|
2082
|
-
to: Math.min(Math.max(t.to, 0), e)
|
|
2083
|
-
};
|
|
2084
|
-
}
|
|
2085
|
-
//#endregion
|
|
2086
|
-
//#region src/utils/pageText.ts
|
|
2087
|
-
var qi = (e, t, n) => {
|
|
2088
|
-
if (!e || !Number.isInteger(n) || n < 1) return null;
|
|
2089
|
-
let r = e.pages[n - 1];
|
|
2090
|
-
if (!r) return null;
|
|
2091
|
-
let i = [];
|
|
2092
|
-
for (let e of r.fragments) typeof e.pmStart != "number" || typeof e.pmEnd != "number" || i.push(t.textBetween(e.pmStart, e.pmEnd, "\n"));
|
|
2093
|
-
return i.join("\n");
|
|
2094
|
-
};
|
|
2095
|
-
//#endregion
|
|
2096
2064
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2065
|
+
var qi = Date.now();
|
|
2097
2066
|
function Ji(e) {
|
|
2098
|
-
|
|
2067
|
+
let t = [];
|
|
2068
|
+
function n() {
|
|
2099
2069
|
e.onPrint?.(), window.print();
|
|
2100
2070
|
}
|
|
2101
|
-
async function
|
|
2071
|
+
async function r(t) {
|
|
2102
2072
|
let n = await e.save(t);
|
|
2103
2073
|
if (!n) return null;
|
|
2104
2074
|
let r = await n.arrayBuffer();
|
|
2105
2075
|
return e.clearCommentsDirty(), e.onSave?.(r), r;
|
|
2106
2076
|
}
|
|
2107
|
-
function
|
|
2077
|
+
function i(t, n) {
|
|
2108
2078
|
let r = e.pagesRef.value;
|
|
2109
2079
|
if (!r) return !1;
|
|
2110
|
-
let i =
|
|
2080
|
+
let i = $t(r, t), a = i.at(0);
|
|
2111
2081
|
return a ? (a.scrollIntoView({
|
|
2112
2082
|
block: "center",
|
|
2113
2083
|
behavior: "smooth"
|
|
2114
|
-
}), n?.highlight &&
|
|
2084
|
+
}), n?.highlight && en(i, n.highlight), !0) : !1;
|
|
2115
2085
|
}
|
|
2116
|
-
function
|
|
2086
|
+
function a() {
|
|
2117
2087
|
return e.zoom.value;
|
|
2118
2088
|
}
|
|
2119
|
-
let
|
|
2120
|
-
function
|
|
2121
|
-
return
|
|
2089
|
+
let o = null;
|
|
2090
|
+
function s() {
|
|
2091
|
+
return o ??= {
|
|
2122
2092
|
getEditor: () => e.editor,
|
|
2123
2093
|
getDocument: () => e.editor.getDocument(),
|
|
2124
2094
|
getState: () => e.editor.getState(),
|
|
@@ -2137,26 +2107,26 @@ function Ji(e) {
|
|
|
2137
2107
|
getLayout: () => e.editor.getLayout(),
|
|
2138
2108
|
relayout: () => e.editor.relayout(),
|
|
2139
2109
|
scrollToPosition: (t) => e.scrollVisiblePositionIntoView(t),
|
|
2140
|
-
scrollToPage:
|
|
2141
|
-
scrollToParaId:
|
|
2110
|
+
scrollToPage: u,
|
|
2111
|
+
scrollToParaId: i,
|
|
2142
2112
|
getPageNumberForPmPos: (t) => {
|
|
2143
2113
|
let n = e.layout.value;
|
|
2144
2114
|
if (!n) return null;
|
|
2145
|
-
let r =
|
|
2115
|
+
let r = Qt(n, t);
|
|
2146
2116
|
return r == null ? null : r + 1;
|
|
2147
2117
|
}
|
|
2148
|
-
},
|
|
2118
|
+
}, o;
|
|
2149
2119
|
}
|
|
2150
|
-
function
|
|
2120
|
+
function c() {
|
|
2151
2121
|
return e.layout.value?.pages.length ?? 0;
|
|
2152
2122
|
}
|
|
2153
|
-
function
|
|
2123
|
+
function l() {
|
|
2154
2124
|
let t = e.layout.value, n = e.editorView.value;
|
|
2155
2125
|
if (!t || !n) return 0;
|
|
2156
|
-
let r =
|
|
2126
|
+
let r = Qt(t, n.state.selection.from);
|
|
2157
2127
|
return r == null ? 0 : r + 1;
|
|
2158
2128
|
}
|
|
2159
|
-
function
|
|
2129
|
+
function u(t) {
|
|
2160
2130
|
if (!Number.isInteger(t) || t < 1) return;
|
|
2161
2131
|
let n = e.pagesViewportRef.value, r = e.pagesRef.value?.querySelector(`[data-page-number="${t}"]`);
|
|
2162
2132
|
if (!n || !r) return;
|
|
@@ -2169,28 +2139,99 @@ function Ji(e) {
|
|
|
2169
2139
|
return { exposed: {
|
|
2170
2140
|
getDocument: e.getDocument,
|
|
2171
2141
|
hasPendingChanges: () => e.editorView.value ? e.isDirty.value || e.commentsDirty.value : !1,
|
|
2172
|
-
getEditorRef:
|
|
2142
|
+
getEditorRef: s,
|
|
2173
2143
|
getEditor: () => e.editor,
|
|
2174
|
-
save:
|
|
2144
|
+
save: r,
|
|
2175
2145
|
setZoom: e.setZoom,
|
|
2176
|
-
getZoom:
|
|
2146
|
+
getZoom: a,
|
|
2177
2147
|
focus: e.focus,
|
|
2178
|
-
getCurrentPage:
|
|
2179
|
-
getTotalPages:
|
|
2180
|
-
scrollToPage:
|
|
2181
|
-
scrollToParaId:
|
|
2182
|
-
openPrintPreview: () =>
|
|
2183
|
-
print:
|
|
2148
|
+
getCurrentPage: l,
|
|
2149
|
+
getTotalPages: c,
|
|
2150
|
+
scrollToPage: u,
|
|
2151
|
+
scrollToParaId: i,
|
|
2152
|
+
openPrintPreview: () => n(),
|
|
2153
|
+
print: n,
|
|
2184
2154
|
loadDocument: e.loadDocument,
|
|
2185
2155
|
loadDocumentBuffer: e.loadDocumentBuffer,
|
|
2186
2156
|
ensureEditorView: () => e.editor.ensureView(),
|
|
2187
2157
|
createAIEditSnapshot: () => {
|
|
2188
2158
|
let t = e.editorView.value;
|
|
2189
|
-
return t ?
|
|
2159
|
+
return t ? Gt(t.state.doc) : null;
|
|
2160
|
+
},
|
|
2161
|
+
applyDocumentOperations: ({ snapshot: n, batch: r, author: i = e.author() }) => {
|
|
2162
|
+
Ut(r.version);
|
|
2163
|
+
let a = e.editorView.value;
|
|
2164
|
+
if (!a) {
|
|
2165
|
+
let e = "committed";
|
|
2166
|
+
r.dryRun === !0 ? e = "previewed" : r.atomic === !0 && (e = "rejected");
|
|
2167
|
+
let t = r.operations.map((e) => ({
|
|
2168
|
+
id: e.id,
|
|
2169
|
+
reason: "unsupportedBlock"
|
|
2170
|
+
}));
|
|
2171
|
+
return {
|
|
2172
|
+
version: $,
|
|
2173
|
+
status: e,
|
|
2174
|
+
applied: [],
|
|
2175
|
+
skipped: t,
|
|
2176
|
+
issues: Jt(r.operations, t),
|
|
2177
|
+
receipts: [],
|
|
2178
|
+
undoHandle: null
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
let o = t.at(-1);
|
|
2182
|
+
o && (!a.state.doc.eq(o.afterState.doc) || e.getComments() !== o.commentsAfter) && (t.length = 0);
|
|
2183
|
+
let s = e.getComments(), c = {
|
|
2184
|
+
state: a.state,
|
|
2185
|
+
dispatch: (e) => {
|
|
2186
|
+
a.dispatch(xt(e)), c.state = a.state;
|
|
2187
|
+
}
|
|
2188
|
+
}, l = Ht({
|
|
2189
|
+
view: c,
|
|
2190
|
+
snapshot: n,
|
|
2191
|
+
batch: r,
|
|
2192
|
+
author: i,
|
|
2193
|
+
createCommentId: e.createAIEditComment,
|
|
2194
|
+
createUndoHandle: () => ({
|
|
2195
|
+
type: "documentOperationUndo",
|
|
2196
|
+
id: `vue-${String(qi++)}`
|
|
2197
|
+
})
|
|
2198
|
+
});
|
|
2199
|
+
return l.undoHandle !== null && t.push({
|
|
2200
|
+
undoHandle: l.undoHandle,
|
|
2201
|
+
afterState: a.state,
|
|
2202
|
+
commentsBefore: s,
|
|
2203
|
+
commentsAfter: e.getComments()
|
|
2204
|
+
}), l;
|
|
2205
|
+
},
|
|
2206
|
+
undoDocumentOperations: (n) => {
|
|
2207
|
+
let r = t.findIndex((e) => e.undoHandle.type === n.type && e.undoHandle.id === n.id);
|
|
2208
|
+
if (r === -1) return {
|
|
2209
|
+
status: "rejected",
|
|
2210
|
+
undoHandle: n,
|
|
2211
|
+
reason: "unknownHandle"
|
|
2212
|
+
};
|
|
2213
|
+
if (r !== t.length - 1) return {
|
|
2214
|
+
status: "rejected",
|
|
2215
|
+
undoHandle: n,
|
|
2216
|
+
reason: "notLatest"
|
|
2217
|
+
};
|
|
2218
|
+
let i = t.at(-1), a = e.editorView.value;
|
|
2219
|
+
return !i || !a ? {
|
|
2220
|
+
status: "rejected",
|
|
2221
|
+
undoHandle: n,
|
|
2222
|
+
reason: "unknownHandle"
|
|
2223
|
+
} : !a.state.doc.eq(i.afterState.doc) || e.getComments() !== i.commentsAfter || !e.editor.undo() ? {
|
|
2224
|
+
status: "rejected",
|
|
2225
|
+
undoHandle: n,
|
|
2226
|
+
reason: "documentChanged"
|
|
2227
|
+
} : (e.setComments(i.commentsBefore), t.pop(), {
|
|
2228
|
+
status: "undone",
|
|
2229
|
+
undoHandle: n
|
|
2230
|
+
});
|
|
2190
2231
|
},
|
|
2191
2232
|
applyAIEditOperations: ({ snapshot: t, operations: n, mode: r = "tracked-changes", author: i = e.author() }) => {
|
|
2192
2233
|
let a = e.editorView.value;
|
|
2193
|
-
return a ?
|
|
2234
|
+
return a ? Vt({
|
|
2194
2235
|
view: a,
|
|
2195
2236
|
snapshot: t,
|
|
2196
2237
|
operations: n,
|
|
@@ -2220,41 +2261,41 @@ function Ji(e) {
|
|
|
2220
2261
|
if (!n) return !1;
|
|
2221
2262
|
let r = jt(n.state, t);
|
|
2222
2263
|
if (!r) return !1;
|
|
2223
|
-
let { from: i, to: a } =
|
|
2224
|
-
return n.dispatch(n.state.tr.setSelection(
|
|
2264
|
+
let { from: i, to: a } = ln(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2265
|
+
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2225
2266
|
},
|
|
2226
2267
|
scrollToBlock: (t, n) => {
|
|
2227
2268
|
let r = e.editorView.value;
|
|
2228
2269
|
if (!r) return !1;
|
|
2229
|
-
let i =
|
|
2270
|
+
let i = un({
|
|
2230
2271
|
blockId: t,
|
|
2231
2272
|
doc: r.state.doc,
|
|
2232
2273
|
snapshot: n
|
|
2233
2274
|
});
|
|
2234
2275
|
if (i === null) return !1;
|
|
2235
2276
|
let { from: a, to: o } = i, s = r.state.doc.resolve(a), c = r.state.doc.resolve(o);
|
|
2236
|
-
return r.dispatch(r.state.tr.setSelection(
|
|
2277
|
+
return r.dispatch(r.state.tr.setSelection(Z.between(s, c))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(a)), !0;
|
|
2237
2278
|
},
|
|
2238
2279
|
getTrackedChanges: () => {
|
|
2239
2280
|
let t = e.editorView.value;
|
|
2240
|
-
return t ?
|
|
2281
|
+
return t ? Yt(t.state.doc) : [];
|
|
2241
2282
|
},
|
|
2242
2283
|
getCommentAnchors: () => {
|
|
2243
2284
|
let t = e.editorView.value;
|
|
2244
|
-
return t ?
|
|
2285
|
+
return t ? qt(t.state.doc) : [];
|
|
2245
2286
|
},
|
|
2246
2287
|
getSelectionText: () => {
|
|
2247
2288
|
let t = e.editorView.value;
|
|
2248
|
-
return t ?
|
|
2289
|
+
return t ? je(t.state) : "";
|
|
2249
2290
|
},
|
|
2250
2291
|
getPageText: (t) => {
|
|
2251
2292
|
let n = e.editorView.value;
|
|
2252
|
-
return n ?
|
|
2293
|
+
return n ? dn(e.layout.value, n.state.doc, t) : null;
|
|
2253
2294
|
},
|
|
2254
2295
|
getContentControls: (t = {}) => {
|
|
2255
2296
|
let n = e.editorView.value;
|
|
2256
|
-
return n ?
|
|
2257
|
-
properties:
|
|
2297
|
+
return n ? rn(n.state.doc, t).map((e) => ({
|
|
2298
|
+
properties: tn(e.node),
|
|
2258
2299
|
path: e.path,
|
|
2259
2300
|
pmPos: e.pos
|
|
2260
2301
|
})) : [];
|
|
@@ -2262,27 +2303,27 @@ function Ji(e) {
|
|
|
2262
2303
|
scrollToContentControl: (t) => {
|
|
2263
2304
|
let n = e.editorView.value;
|
|
2264
2305
|
if (!n) return !1;
|
|
2265
|
-
let r =
|
|
2306
|
+
let r = nn(n.state.doc, t);
|
|
2266
2307
|
if (!r) return !1;
|
|
2267
2308
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
2268
|
-
return n.dispatch(n.state.tr.setSelection(
|
|
2309
|
+
return n.dispatch(n.state.tr.setSelection(Z.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2269
2310
|
},
|
|
2270
2311
|
setContentControlContent: (t, n, r = {}) => {
|
|
2271
2312
|
let i = e.editorView.value;
|
|
2272
2313
|
if (!i) return !1;
|
|
2273
|
-
let a = typeof n == "string" ?
|
|
2314
|
+
let a = typeof n == "string" ? on(i.state, t, n, r) : cn(i.state, t, n, r);
|
|
2274
2315
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2275
2316
|
},
|
|
2276
2317
|
setContentControlValue: (t, n, r = {}) => {
|
|
2277
2318
|
let i = e.editorView.value;
|
|
2278
2319
|
if (!i) return !1;
|
|
2279
|
-
let a =
|
|
2320
|
+
let a = sn(i.state, t, n, r);
|
|
2280
2321
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2281
2322
|
},
|
|
2282
2323
|
removeContentControl: (t, n = {}) => {
|
|
2283
2324
|
let r = e.editorView.value;
|
|
2284
2325
|
if (!r) return !1;
|
|
2285
|
-
let i =
|
|
2326
|
+
let i = an(r.state, t, n);
|
|
2286
2327
|
return i ? (r.dispatch(i), !0) : !1;
|
|
2287
2328
|
}
|
|
2288
2329
|
} };
|
|
@@ -2300,22 +2341,22 @@ function Yi(e) {
|
|
|
2300
2341
|
if (!r) return;
|
|
2301
2342
|
let i = e.getDocument(), a = i?.package?.styles;
|
|
2302
2343
|
if (a) {
|
|
2303
|
-
let e =
|
|
2304
|
-
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting),
|
|
2305
|
-
} else
|
|
2344
|
+
let e = ke(a).resolveParagraphStyle(n), t = { numbering: i?.package?.numbering ? _n(i.package.numbering) : null };
|
|
2345
|
+
e.paragraphFormatting && (t.paragraphFormatting = e.paragraphFormatting), e.runFormatting && (t.runFormatting = e.runFormatting), fn(n, t)(r.state, (e) => r.dispatch(e));
|
|
2346
|
+
} else fn(n)(r.state, (e) => r.dispatch(e));
|
|
2306
2347
|
r.focus();
|
|
2307
2348
|
}
|
|
2308
2349
|
function i() {
|
|
2309
2350
|
let t = e.editorView.value;
|
|
2310
|
-
t && (
|
|
2351
|
+
t && (vn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2311
2352
|
}
|
|
2312
2353
|
function a() {
|
|
2313
2354
|
let t = e.editorView.value;
|
|
2314
|
-
t && (
|
|
2355
|
+
t && (bn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2315
2356
|
}
|
|
2316
2357
|
function o() {
|
|
2317
2358
|
let t = e.editorView.value;
|
|
2318
|
-
t && (
|
|
2359
|
+
t && (yn(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
2319
2360
|
}
|
|
2320
2361
|
function s(e) {
|
|
2321
2362
|
let n = t();
|
|
@@ -2365,14 +2406,14 @@ function Xi(e) {
|
|
|
2365
2406
|
}
|
|
2366
2407
|
function o(n, r) {
|
|
2367
2408
|
let i = e.editorView.value;
|
|
2368
|
-
i && (
|
|
2409
|
+
i && (xn(i, {
|
|
2369
2410
|
displayText: n,
|
|
2370
2411
|
href: r
|
|
2371
2412
|
}), t.value = null, i.focus());
|
|
2372
2413
|
}
|
|
2373
2414
|
function s() {
|
|
2374
2415
|
let n = e.editorView.value;
|
|
2375
|
-
n && (
|
|
2416
|
+
n && (Sn(n, { popupHref: t.value?.href }), t.value = null, n.focus());
|
|
2376
2417
|
}
|
|
2377
2418
|
return {
|
|
2378
2419
|
hyperlinkPopupData: t,
|
|
@@ -2386,7 +2427,7 @@ function Xi(e) {
|
|
|
2386
2427
|
//#endregion
|
|
2387
2428
|
//#region src/composables/useImageActions.ts
|
|
2388
2429
|
function Zi(e) {
|
|
2389
|
-
let t =
|
|
2430
|
+
let t = we(null), n = W(!1), r = N(() => {
|
|
2390
2431
|
e.stateTick.value;
|
|
2391
2432
|
let n = e.editorView.value, r = t.value;
|
|
2392
2433
|
if (!n || !r) return null;
|
|
@@ -2405,9 +2446,9 @@ function Zi(e) {
|
|
|
2405
2446
|
function a(n) {
|
|
2406
2447
|
let r = e.editorView.value, a = t.value;
|
|
2407
2448
|
if (!r || !a) return;
|
|
2408
|
-
let o =
|
|
2449
|
+
let o = st(n);
|
|
2409
2450
|
if (!o) return;
|
|
2410
|
-
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu:
|
|
2451
|
+
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu: rt(a.element, e.zoom.value) } : void 0, c = e.getCommands().setImageWrapType;
|
|
2411
2452
|
c && (i(r, c(a.pmPos, o, s)), r.focus());
|
|
2412
2453
|
}
|
|
2413
2454
|
function o(n) {
|
|
@@ -2450,14 +2491,14 @@ function Qi(e) {
|
|
|
2450
2491
|
e.disableFindReplaceShortcuts?.() && (t.key === "f" || t.key === "h") || (t.key === "f" || t.key === "h" ? (t.preventDefault(), e.showFindReplace.value = !0) : t.key === "k" ? (t.preventDefault(), e.showHyperlink.value = !0) : t.key === "/" && (t.preventDefault(), e.showKeyboardShortcuts.value = !e.showKeyboardShortcuts.value));
|
|
2451
2492
|
}
|
|
2452
2493
|
}
|
|
2453
|
-
return
|
|
2494
|
+
return xe(() => window.addEventListener("keydown", t)), be(() => window.removeEventListener("keydown", t)), { handleKeyDown: t };
|
|
2454
2495
|
}
|
|
2455
2496
|
//#endregion
|
|
2456
2497
|
//#region src/composables/useOutlineSidebar.ts
|
|
2457
2498
|
function $i(e) {
|
|
2458
2499
|
function t() {
|
|
2459
2500
|
let t = e.editorView.value;
|
|
2460
|
-
t && (e.outlineHeadings.value =
|
|
2501
|
+
t && (e.outlineHeadings.value = Cn(t.state.doc));
|
|
2461
2502
|
}
|
|
2462
2503
|
function n() {
|
|
2463
2504
|
e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
|
|
@@ -2468,7 +2509,7 @@ function $i(e) {
|
|
|
2468
2509
|
function i(t) {
|
|
2469
2510
|
let n = e.editorView.value;
|
|
2470
2511
|
if (!n) return;
|
|
2471
|
-
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i =
|
|
2512
|
+
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = Z.near(r);
|
|
2472
2513
|
n.dispatch(n.state.tr.setSelection(i)), e.scrollToVisiblePosition(t), n.focus();
|
|
2473
2514
|
}
|
|
2474
2515
|
function a() {
|
|
@@ -2515,19 +2556,19 @@ function ea(e) {
|
|
|
2515
2556
|
}
|
|
2516
2557
|
function s(t) {
|
|
2517
2558
|
let n = e.editorView.value;
|
|
2518
|
-
n &&
|
|
2559
|
+
n && hn(t)(n.state, n.dispatch);
|
|
2519
2560
|
}
|
|
2520
2561
|
function c(t) {
|
|
2521
2562
|
let n = e.editorView.value;
|
|
2522
|
-
n &&
|
|
2563
|
+
n && gn(t)(n.state, n.dispatch);
|
|
2523
2564
|
}
|
|
2524
2565
|
function l(t) {
|
|
2525
2566
|
let n = e.editorView.value;
|
|
2526
|
-
n && (t < 0 ?
|
|
2567
|
+
n && (t < 0 ? mn(-t, !0)(n.state, n.dispatch) : mn(t, !1)(n.state, n.dispatch));
|
|
2527
2568
|
}
|
|
2528
2569
|
function u(t) {
|
|
2529
2570
|
let n = e.editorView.value;
|
|
2530
|
-
n &&
|
|
2571
|
+
n && pn(t)(n.state, n.dispatch);
|
|
2531
2572
|
}
|
|
2532
2573
|
return {
|
|
2533
2574
|
handlePageSetupApply: t,
|
|
@@ -2571,7 +2612,7 @@ function aa(e, t) {
|
|
|
2571
2612
|
//#endregion
|
|
2572
2613
|
//#region src/utils/domQueries.ts
|
|
2573
2614
|
function oa(e, t, n) {
|
|
2574
|
-
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) :
|
|
2615
|
+
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : _t(e);
|
|
2575
2616
|
for (let e of r) {
|
|
2576
2617
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
2577
2618
|
if (!Number.isNaN(n) && !Number.isNaN(r) && t >= n && t <= r) return e;
|
|
@@ -2580,8 +2621,8 @@ function oa(e, t, n) {
|
|
|
2580
2621
|
}
|
|
2581
2622
|
function sa(e, t, n) {
|
|
2582
2623
|
if (!e || !t) return;
|
|
2583
|
-
let r =
|
|
2584
|
-
if (!r) for (let t of
|
|
2624
|
+
let r = gt(e, n);
|
|
2625
|
+
if (!r) for (let t of _t(e)) {
|
|
2585
2626
|
let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
|
|
2586
2627
|
if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
|
|
2587
2628
|
r = t;
|
|
@@ -2597,7 +2638,7 @@ function sa(e, t, n) {
|
|
|
2597
2638
|
}
|
|
2598
2639
|
function ca(e, t, n, r) {
|
|
2599
2640
|
if (!e || !t) return null;
|
|
2600
|
-
let i =
|
|
2641
|
+
let i = ut(e, n, r, 1);
|
|
2601
2642
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
2602
2643
|
}
|
|
2603
2644
|
function la(e, t, n, r) {
|
|
@@ -2624,7 +2665,7 @@ function fa(e) {
|
|
|
2624
2665
|
function r() {
|
|
2625
2666
|
n !== null && (clearTimeout(n), n = null);
|
|
2626
2667
|
}
|
|
2627
|
-
let i =
|
|
2668
|
+
let i = we(null), a = 0, o = null, s = 0, c = !1, l = null, u = En(), d = re({
|
|
2628
2669
|
pagesContainer: e.pagesRef,
|
|
2629
2670
|
onScrollExtendSelection: (e, t) => {
|
|
2630
2671
|
if (!c || l === null) return;
|
|
@@ -2650,7 +2691,7 @@ function fa(e) {
|
|
|
2650
2691
|
function g(e, t) {
|
|
2651
2692
|
let n = h();
|
|
2652
2693
|
if (n) try {
|
|
2653
|
-
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a =
|
|
2694
|
+
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = Z.between(r, i);
|
|
2654
2695
|
n.dispatch(n.state.tr.setSelection(a));
|
|
2655
2696
|
} catch {}
|
|
2656
2697
|
}
|
|
@@ -2690,7 +2731,7 @@ function fa(e) {
|
|
|
2690
2731
|
if (!o) return;
|
|
2691
2732
|
let s = e.pagesViewportRef.value;
|
|
2692
2733
|
if (!s || !(a.target instanceof HTMLElement)) return;
|
|
2693
|
-
let l =
|
|
2734
|
+
let l = Tn({
|
|
2694
2735
|
mouseX: a.clientX,
|
|
2695
2736
|
mouseY: a.clientY,
|
|
2696
2737
|
pagesContainer: o,
|
|
@@ -2700,7 +2741,7 @@ function fa(e) {
|
|
|
2700
2741
|
if (!l) {
|
|
2701
2742
|
n === null && (n = setTimeout(() => {
|
|
2702
2743
|
t.value = null, n = null;
|
|
2703
|
-
},
|
|
2744
|
+
}, wn));
|
|
2704
2745
|
return;
|
|
2705
2746
|
}
|
|
2706
2747
|
let u = e.zoom.value || 1, d = s.getBoundingClientRect();
|
|
@@ -2715,7 +2756,7 @@ function fa(e) {
|
|
|
2715
2756
|
n.preventDefault(), n.stopPropagation();
|
|
2716
2757
|
let r = t.value, i = e.editorView.value;
|
|
2717
2758
|
if (!r || !i) return;
|
|
2718
|
-
let a = i.state.tr.setSelection(
|
|
2759
|
+
let a = i.state.tr.setSelection(Z.create(i.state.doc, r.cellPmPos + 1));
|
|
2719
2760
|
i.dispatch(a);
|
|
2720
2761
|
let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow : o.addColumnRight;
|
|
2721
2762
|
s && (s()(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
|
|
@@ -2820,7 +2861,7 @@ function fa(e) {
|
|
|
2820
2861
|
let o = a.get(r.rId);
|
|
2821
2862
|
o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
|
|
2822
2863
|
}
|
|
2823
|
-
function
|
|
2864
|
+
function ie() {
|
|
2824
2865
|
let t = e.getDocument(), n = i.value;
|
|
2825
2866
|
if (!t?.package || !n || !n.rId) {
|
|
2826
2867
|
i.value = null;
|
|
@@ -2860,13 +2901,13 @@ function fa(e) {
|
|
|
2860
2901
|
i.value && d && (d.closest(".layout-page-header") || d.closest(".layout-page-footer") || d.closest(".hf-editor") || (i.value = null, n.focus()));
|
|
2861
2902
|
let f = h() ?? n;
|
|
2862
2903
|
if (!e.readOnly.value && e.tableResize.tryStartResize(t, f)) return;
|
|
2863
|
-
let p =
|
|
2904
|
+
let p = at(r);
|
|
2864
2905
|
if (p) {
|
|
2865
2906
|
t.preventDefault(), t.stopPropagation();
|
|
2866
2907
|
let n = Number(p.dataset.pmStart);
|
|
2867
2908
|
if (!Number.isNaN(n)) {
|
|
2868
2909
|
try {
|
|
2869
|
-
f.dispatch(f.state.tr.setSelection(
|
|
2910
|
+
f.dispatch(f.state.tr.setSelection($e.create(f.state.doc, n)));
|
|
2870
2911
|
} catch {}
|
|
2871
2912
|
e.selectedImage.value = {
|
|
2872
2913
|
element: p,
|
|
@@ -2890,7 +2931,7 @@ function fa(e) {
|
|
|
2890
2931
|
else if (t.shiftKey) {
|
|
2891
2932
|
let { from: e } = f.state.selection;
|
|
2892
2933
|
g(e, _);
|
|
2893
|
-
} else g(_), l = _, c = !0, u.begin(
|
|
2934
|
+
} else g(_), l = _, c = !0, u.begin(Dn(f, _));
|
|
2894
2935
|
f.focus();
|
|
2895
2936
|
}
|
|
2896
2937
|
function ae(e) {
|
|
@@ -2934,9 +2975,9 @@ function fa(e) {
|
|
|
2934
2975
|
};
|
|
2935
2976
|
}, 600);
|
|
2936
2977
|
}
|
|
2937
|
-
return
|
|
2978
|
+
return xe(() => {
|
|
2938
2979
|
window.addEventListener("mousemove", ae), window.addEventListener("mouseup", oe), e.pagesViewportRef.value?.addEventListener("scroll", w, { passive: !0 });
|
|
2939
|
-
}),
|
|
2980
|
+
}), be(() => {
|
|
2940
2981
|
r(), window.removeEventListener("mousemove", ae), window.removeEventListener("mouseup", oe), e.pagesViewportRef.value?.removeEventListener("scroll", w), p && clearTimeout(p);
|
|
2941
2982
|
}), {
|
|
2942
2983
|
tableInsertButton: t,
|
|
@@ -2953,7 +2994,7 @@ function fa(e) {
|
|
|
2953
2994
|
handleTableInsertClick: ee,
|
|
2954
2995
|
clearTableInsertTimer: r,
|
|
2955
2996
|
handleHfSave: ne,
|
|
2956
|
-
handleHfRemove:
|
|
2997
|
+
handleHfRemove: ie
|
|
2957
2998
|
};
|
|
2958
2999
|
}
|
|
2959
3000
|
//#endregion
|
|
@@ -3034,7 +3075,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3034
3075
|
"data-testid": "selection-overlay",
|
|
3035
3076
|
class: "docx-editor-vue__decoration-origin",
|
|
3036
3077
|
"aria-hidden": "true"
|
|
3037
|
-
}, ka = ["aria-label"], Aa = /*#__PURE__*/ t(/* @__PURE__ */
|
|
3078
|
+
}, ka = ["aria-label"], Aa = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
3038
3079
|
__name: "DocxEditor",
|
|
3039
3080
|
props: {
|
|
3040
3081
|
documentBuffer: { default: null },
|
|
@@ -3154,21 +3195,21 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3154
3195
|
],
|
|
3155
3196
|
setup(t, { expose: n, emit: a }) {
|
|
3156
3197
|
let o = t, s = a;
|
|
3157
|
-
e(), i(o.components),
|
|
3158
|
-
let l = W(o.mode), u = N(() => o.readOnly || l.value === "viewing"), d = N(() => o.showReviewControls), f = N(() =>
|
|
3159
|
-
function
|
|
3160
|
-
dn(
|
|
3198
|
+
e(), i(o.components), Sr(W(!1));
|
|
3199
|
+
let l = W(o.mode), u = N(() => o.readOnly || l.value === "viewing"), d = N(() => o.showReviewControls), f = N(() => ct(l.value)), p = W("all-markup");
|
|
3200
|
+
function h() {
|
|
3201
|
+
dn(lt(l.value));
|
|
3161
3202
|
}
|
|
3162
|
-
function
|
|
3203
|
+
function y(e) {
|
|
3163
3204
|
p.value = e;
|
|
3164
3205
|
}
|
|
3165
3206
|
let b = N(() => p.value === "all-markup" ? "" : `folio-root--${p.value}`), { t: x } = c(), S = ({ node: e }) => e;
|
|
3166
3207
|
S.props = ["node"];
|
|
3167
|
-
let
|
|
3168
|
-
J(
|
|
3208
|
+
let ne = N(() => o.documentBuffer != null || o.document != null), re = W(!1);
|
|
3209
|
+
J(ne, (e) => {
|
|
3169
3210
|
e || (re.value = !1);
|
|
3170
3211
|
});
|
|
3171
|
-
let
|
|
3212
|
+
let w = W(null), T = W(null), se = W(null), ce = W(null), le = N(() => o.showRuler ?? !1), E = W(0), D = W(!1), ue = W(!1), de = W(!1), fe = W(!1), O = W(!1), k = W(!1), A = W(o.showOutline), M = W(!1), pe = W(null), he = we([]), z = we([]), { zoom: B, zoomPercent: _e, isMinZoom: ye, isMaxZoom: Se, setZoom: G, zoomIn: Te, zoomOut: De, handleWheel: Oe, handleKeyDown: ke, ZOOM_PRESETS: je } = oe(o.initialZoom);
|
|
3172
3213
|
function Me(e) {
|
|
3173
3214
|
o.enableWheelZoom !== !1 && Oe(e);
|
|
3174
3215
|
}
|
|
@@ -3178,8 +3219,8 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3178
3219
|
showHyperlink: ue,
|
|
3179
3220
|
handleZoomKeyDown: ke
|
|
3180
3221
|
});
|
|
3181
|
-
let { editor:
|
|
3182
|
-
hiddenContainer:
|
|
3222
|
+
let { editor: Pe, editorView: X, editorState: Le, isReady: Ge, isDirty: Ke, parseError: qe, layout: Je, blocks: Ye, measures: Xe, loadBuffer: Ze, loadDocument: Qe, save: $e, getDocument: et, getCommands: Z, focus: tt, reLayout: nt } = C({
|
|
3223
|
+
hiddenContainer: w,
|
|
3183
3224
|
pagesContainer: T,
|
|
3184
3225
|
readOnly: u,
|
|
3185
3226
|
editorMode: l,
|
|
@@ -3198,7 +3239,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3198
3239
|
o.onError?.(e), s("error", e);
|
|
3199
3240
|
},
|
|
3200
3241
|
onSelectionUpdate: (e) => {
|
|
3201
|
-
if (o.onSelectionChange?.(
|
|
3242
|
+
if (o.onSelectionChange?.(Ae(e)), o.onSelectionTextChange) {
|
|
3202
3243
|
let { from: t, to: n } = e.selection, r = t === n ? "" : e.doc.textBetween(t, n, " ", " ");
|
|
3203
3244
|
o.onSelectionTextChange({
|
|
3204
3245
|
from: t,
|
|
@@ -3211,9 +3252,9 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3211
3252
|
onReadOnlyEditAttempt: () => o.onReadonlyEditAttempt?.(),
|
|
3212
3253
|
featureFlags: () => o.featureFlags,
|
|
3213
3254
|
onSelectiveSaveTripwire: o.onSelectiveSaveTripwire ? (e) => o.onSelectiveSaveTripwire?.(e) : void 0
|
|
3214
|
-
}), rt = N(() => !
|
|
3255
|
+
}), rt = N(() => !Ge.value && ne.value && !(o.preserveDocumentWhileLoading === !0 && re.value));
|
|
3215
3256
|
function it() {
|
|
3216
|
-
X.value && (
|
|
3257
|
+
X.value && (He(), Ve(), nt());
|
|
3217
3258
|
}
|
|
3218
3259
|
J(() => o.fonts, (e, t, n) => {
|
|
3219
3260
|
if (!e || e.length === 0) return;
|
|
@@ -3228,15 +3269,15 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3228
3269
|
r = !0, i.length !== 0 && (ya(i), it());
|
|
3229
3270
|
});
|
|
3230
3271
|
}, { immediate: !0 });
|
|
3231
|
-
let { selectedImage: at, imageInteracting: ot, imageToolbarContext: st, handleToolbarImageWrap:
|
|
3272
|
+
let { selectedImage: at, imageInteracting: ot, imageToolbarContext: st, handleToolbarImageWrap: ut, handleImageTransform: dt } = Zi({
|
|
3232
3273
|
editorView: X,
|
|
3233
3274
|
zoom: B,
|
|
3234
3275
|
stateTick: E,
|
|
3235
|
-
getCommands:
|
|
3276
|
+
getCommands: Z
|
|
3236
3277
|
}), { hyperlinkPopupData: ft, handleHyperlinkSubmit: pt, handleHyperlinkRemove: mt, handleHyperlinkPopupNavigate: ht, handleHyperlinkPopupEdit: gt, handleHyperlinkPopupRemove: _t } = Xi({
|
|
3237
3278
|
editorView: X,
|
|
3238
|
-
getCommands:
|
|
3239
|
-
}), vt =
|
|
3279
|
+
getCommands: Z
|
|
3280
|
+
}), vt = ie(), { tableInsertButton: yt, scrollPageInfo: bt, resolvePos: xt, setPmSelection: St, scrollVisiblePositionIntoView: Ct, handlePagesMouseDown: wt, handlePagesMouseMove: Tt, handlePagesClick: Et, handleTableInsertClick: Dt } = fa({
|
|
3240
3281
|
editorView: X,
|
|
3241
3282
|
pagesRef: T,
|
|
3242
3283
|
pagesViewportRef: se,
|
|
@@ -3250,40 +3291,40 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3250
3291
|
tryStartResize: vt.tryStartResize,
|
|
3251
3292
|
isResizing: N(() => vt.isResizing())
|
|
3252
3293
|
},
|
|
3253
|
-
getCommands:
|
|
3254
|
-
getDocument:
|
|
3294
|
+
getCommands: Z,
|
|
3295
|
+
getDocument: et,
|
|
3255
3296
|
reLayout: nt,
|
|
3256
3297
|
emit: () => {},
|
|
3257
3298
|
clearOverlay: () => {}
|
|
3258
3299
|
}), Ot = $i({
|
|
3259
3300
|
editorView: X,
|
|
3260
3301
|
showOutline: A,
|
|
3261
|
-
showSidebar:
|
|
3262
|
-
outlineHeadings:
|
|
3302
|
+
showSidebar: M,
|
|
3303
|
+
outlineHeadings: z,
|
|
3263
3304
|
activeSidebarItem: pe,
|
|
3264
3305
|
extractCommentsAndChanges: () => {},
|
|
3265
3306
|
scrollToVisiblePosition: Ct
|
|
3266
|
-
}), { contextMenu: kt, imageContextMenu: At, imageContextMenuTextActions: jt, customTextMenuItems: Mt, handleContextMenu: Nt, handleSelectedImageContextMenu: Pt, handleImageWrapSelect: Ft, handleContextMenuAction: It } =
|
|
3307
|
+
}), { contextMenu: kt, imageContextMenu: At, imageContextMenuTextActions: jt, customTextMenuItems: Mt, handleContextMenu: Nt, handleSelectedImageContextMenu: Pt, handleImageWrapSelect: Ft, handleContextMenuAction: It } = Gi({
|
|
3267
3308
|
editorView: X,
|
|
3268
3309
|
selectedImage: at,
|
|
3269
3310
|
zoom: B,
|
|
3270
3311
|
showImageProperties: O,
|
|
3271
|
-
getCommands:
|
|
3312
|
+
getCommands: Z,
|
|
3272
3313
|
clearOverlay: () => {},
|
|
3273
3314
|
setPmSelection: St,
|
|
3274
3315
|
resolvePos: xt,
|
|
3275
3316
|
customContextMenuItems: () => u.value ? void 0 : o.customContextMenuItems,
|
|
3276
3317
|
onCustomContextAction: (e, t) => o.onCustomContextAction?.(e, t)
|
|
3277
|
-
}), Lt =
|
|
3318
|
+
}), Lt = ae(X, E), Rt = N(() => Lt.value.entries), Q = Ni({
|
|
3278
3319
|
editorView: X,
|
|
3279
|
-
getDocument:
|
|
3320
|
+
getDocument: et,
|
|
3280
3321
|
author: () => o.author,
|
|
3281
3322
|
commentsProp: () => o.comments,
|
|
3282
3323
|
onCommentsChange: (e) => {
|
|
3283
3324
|
o.onCommentsChange?.(e), s("comments-change", e);
|
|
3284
3325
|
},
|
|
3285
3326
|
reLayout: nt
|
|
3286
|
-
}), zt = Q.comments, $ =
|
|
3327
|
+
}), zt = Q.comments, $ = Mi({
|
|
3287
3328
|
editorView: X,
|
|
3288
3329
|
pagesViewport: se,
|
|
3289
3330
|
pagesContainer: T,
|
|
@@ -3291,7 +3332,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3291
3332
|
createComment: Q.createComment,
|
|
3292
3333
|
pushComment: Q.pushComment,
|
|
3293
3334
|
reLayout: nt,
|
|
3294
|
-
showSidebar:
|
|
3335
|
+
showSidebar: M,
|
|
3295
3336
|
setActiveSidebarItem: (e) => {
|
|
3296
3337
|
pe.value = e;
|
|
3297
3338
|
}
|
|
@@ -3301,15 +3342,15 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3301
3342
|
}
|
|
3302
3343
|
let Vt = N(() => {
|
|
3303
3344
|
E.value;
|
|
3304
|
-
let e =
|
|
3345
|
+
let e = et()?.package.document;
|
|
3305
3346
|
return e ? e.finalSectionProperties ?? e.sections?.[0]?.properties ?? null : null;
|
|
3306
3347
|
}), Ht = N(() => {
|
|
3307
3348
|
E.value;
|
|
3308
3349
|
let e = {};
|
|
3309
3350
|
o.fontFamilies !== void 0 && (e.fontFamilies = o.fontFamilies);
|
|
3310
|
-
let t =
|
|
3351
|
+
let t = et()?.package.styles?.styles;
|
|
3311
3352
|
return t !== void 0 && (e.documentStyles = t), e;
|
|
3312
|
-
}), Ut = N(() =>
|
|
3353
|
+
}), Ut = N(() => We(Vt.value?.pageWidth ?? 12240) * B.value), Wt = N(() => {
|
|
3313
3354
|
let e = /* @__PURE__ */ new Set();
|
|
3314
3355
|
for (let t of zt.value) t.done && e.add(t.id);
|
|
3315
3356
|
return e;
|
|
@@ -3319,7 +3360,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3319
3360
|
transition: "transform 0.2s ease"
|
|
3320
3361
|
})), { handleApplyStyle: Kt, handleInsertSymbol: qt, handleInsertSectionBreakNextPage: Jt, handleInsertSectionBreakContinuous: Yt } = Yi({
|
|
3321
3362
|
editorView: X,
|
|
3322
|
-
getDocument:
|
|
3363
|
+
getDocument: et
|
|
3323
3364
|
});
|
|
3324
3365
|
function Xt() {
|
|
3325
3366
|
if (o.onInsertImage) {
|
|
@@ -3331,7 +3372,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3331
3372
|
let t = document.createElement("input");
|
|
3332
3373
|
t.type = "file", t.accept = "image/*", t.style.display = "none", t.addEventListener("change", () => {
|
|
3333
3374
|
let n = t.files?.[0];
|
|
3334
|
-
n &&
|
|
3375
|
+
n && Ne(e, n, () => e.focus()), t.remove();
|
|
3335
3376
|
}), document.body.appendChild(t), t.click();
|
|
3336
3377
|
}
|
|
3337
3378
|
function Zt(e, t) {
|
|
@@ -3340,7 +3381,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3340
3381
|
return;
|
|
3341
3382
|
}
|
|
3342
3383
|
let n = X.value;
|
|
3343
|
-
n && (
|
|
3384
|
+
n && (Ie(n, e, t), n.focus());
|
|
3344
3385
|
}
|
|
3345
3386
|
function Qt() {
|
|
3346
3387
|
if (o.onInsertPageBreak) {
|
|
@@ -3356,11 +3397,11 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3356
3397
|
return;
|
|
3357
3398
|
}
|
|
3358
3399
|
let e = X.value;
|
|
3359
|
-
e && (
|
|
3400
|
+
e && (Re(e), e.focus());
|
|
3360
3401
|
}
|
|
3361
3402
|
let { handlePageSetupApply: en, handleLeftMarginChange: tn, handleRightMarginChange: nn, handleTopMarginChange: rn, handleBottomMarginChange: an, handleIndentLeftChange: on, handleIndentRightChange: sn, handleFirstLineIndentChange: cn, handleTabStopRemove: ln } = ea({
|
|
3362
3403
|
editorView: X,
|
|
3363
|
-
getDocument:
|
|
3404
|
+
getDocument: et,
|
|
3364
3405
|
readOnly: u,
|
|
3365
3406
|
stateTick: E,
|
|
3366
3407
|
reLayout: nt,
|
|
@@ -3369,7 +3410,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3369
3410
|
}
|
|
3370
3411
|
}), un = N(() => {
|
|
3371
3412
|
E.value;
|
|
3372
|
-
let e = X.value, t = e ?
|
|
3413
|
+
let e = X.value, t = e ? ze(e.state).paragraphFormatting : {};
|
|
3373
3414
|
return {
|
|
3374
3415
|
indentLeft: t.indentLeft ?? 0,
|
|
3375
3416
|
indentRight: t.indentRight ?? 0,
|
|
@@ -3400,7 +3441,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3400
3441
|
Ot.handleToggleOutline();
|
|
3401
3442
|
break;
|
|
3402
3443
|
case "toggleSidebar":
|
|
3403
|
-
|
|
3444
|
+
M.value = !M.value;
|
|
3404
3445
|
break;
|
|
3405
3446
|
case "insertImage":
|
|
3406
3447
|
Xt();
|
|
@@ -3425,7 +3466,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3425
3466
|
Zt(e, t);
|
|
3426
3467
|
}
|
|
3427
3468
|
let mn = W(!1);
|
|
3428
|
-
|
|
3469
|
+
Ki({
|
|
3429
3470
|
documentBuffer: () => o.documentBuffer ?? null,
|
|
3430
3471
|
document: () => o.document ?? null,
|
|
3431
3472
|
loadDocumentBuffer: Ze,
|
|
@@ -3449,28 +3490,28 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3449
3490
|
ce.value && (ce.value.scrollTop = e);
|
|
3450
3491
|
});
|
|
3451
3492
|
}
|
|
3452
|
-
J(
|
|
3493
|
+
J(Ge, (e) => {
|
|
3453
3494
|
if (!e) {
|
|
3454
3495
|
hn.value = !1;
|
|
3455
3496
|
return;
|
|
3456
3497
|
}
|
|
3457
3498
|
re.value = !0, Ot.recomputeHeadingsIfOpen(), Q.seedFromDocument();
|
|
3458
|
-
let t =
|
|
3459
|
-
t && o.onCompatibilityChange?.(
|
|
3460
|
-
}),
|
|
3461
|
-
let e =
|
|
3499
|
+
let t = et();
|
|
3500
|
+
t && o.onCompatibilityChange?.(Be(t)), o.autoOpenReviewSidebar !== !1 && !mn.value && (zt.value.length > 0 || Rt.value.length > 0) && (mn.value = !0, M.value = !0), _n(), s("ready");
|
|
3501
|
+
}), xe(() => {
|
|
3502
|
+
let e = Pe.on("selectionChange", () => {
|
|
3462
3503
|
E.value++, $.updateFloatingButton();
|
|
3463
|
-
}), t =
|
|
3504
|
+
}), t = Pe.on("docChange", () => {
|
|
3464
3505
|
E.value++, Ot.recomputeHeadingsIfOpen();
|
|
3465
|
-
}), n =
|
|
3506
|
+
}), n = Pe.on("layoutComplete", () => {
|
|
3466
3507
|
E.value++;
|
|
3467
|
-
}), r = vt.install(), i =
|
|
3468
|
-
|
|
3508
|
+
}), r = vt.install(), i = Ue(() => o.onFontsLoaded?.());
|
|
3509
|
+
be(() => {
|
|
3469
3510
|
e(), t(), n(), r(), i();
|
|
3470
3511
|
});
|
|
3471
3512
|
});
|
|
3472
3513
|
let { exposed: vn } = Ji({
|
|
3473
|
-
editor:
|
|
3514
|
+
editor: Pe,
|
|
3474
3515
|
editorView: X,
|
|
3475
3516
|
isDirty: Ke,
|
|
3476
3517
|
commentsDirty: Q.commentsDirty,
|
|
@@ -3485,9 +3526,11 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3485
3526
|
let t = Q.createComment(e);
|
|
3486
3527
|
return Q.pushComment(t), t.id;
|
|
3487
3528
|
},
|
|
3529
|
+
getComments: () => Q.comments.value,
|
|
3530
|
+
setComments: Q.setComments,
|
|
3488
3531
|
focus: tt,
|
|
3489
|
-
getDocument:
|
|
3490
|
-
setZoom:
|
|
3532
|
+
getDocument: et,
|
|
3533
|
+
setZoom: G,
|
|
3491
3534
|
save: $e,
|
|
3492
3535
|
loadDocument: Qe,
|
|
3493
3536
|
loadDocumentBuffer: Ze,
|
|
@@ -3503,31 +3546,31 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3503
3546
|
]),
|
|
3504
3547
|
style: H(t.style)
|
|
3505
3548
|
}, [
|
|
3506
|
-
L("div", ba, [
|
|
3549
|
+
L("div", ba, [R(br, {
|
|
3507
3550
|
"show-table-insert": o.showTableInsert !== !1,
|
|
3508
3551
|
onRename: n[0] ||= (e) => s("rename", e),
|
|
3509
3552
|
onMenuAction: fn,
|
|
3510
3553
|
onInsertTable: pn
|
|
3511
3554
|
}, {
|
|
3512
|
-
"title-bar-left":
|
|
3513
|
-
"title-bar-right":
|
|
3555
|
+
"title-bar-left": Ee(() => [Ce(e.$slots, "title-bar-left", {}, void 0, !0)]),
|
|
3556
|
+
"title-bar-right": Ee(() => [Ce(e.$slots, "title-bar-right", {}, void 0, !0)]),
|
|
3514
3557
|
_: 3
|
|
3515
|
-
}, 8, ["show-table-insert"]), t.showToolbar ? (U(), P(
|
|
3558
|
+
}, 8, ["show-table-insert"]), t.showToolbar ? (U(), P(te, ve({
|
|
3516
3559
|
key: 0,
|
|
3517
3560
|
view: q(X),
|
|
3518
|
-
"get-commands": q(
|
|
3561
|
+
"get-commands": q(Z),
|
|
3519
3562
|
"state-tick": E.value,
|
|
3520
3563
|
"zoom-percent": q(_e),
|
|
3521
|
-
"is-min-zoom": q(
|
|
3522
|
-
"is-max-zoom": q(
|
|
3523
|
-
"zoom-presets": q(
|
|
3564
|
+
"is-min-zoom": q(ye),
|
|
3565
|
+
"is-max-zoom": q(Se),
|
|
3566
|
+
"zoom-presets": q(je),
|
|
3524
3567
|
"show-zoom-control": t.showZoomControl,
|
|
3525
3568
|
"editor-mode": l.value,
|
|
3526
3569
|
"show-review-controls": d.value,
|
|
3527
3570
|
"track-changes-on": f.value,
|
|
3528
3571
|
"display-mode": p.value,
|
|
3529
3572
|
"read-only": u.value,
|
|
3530
|
-
"comments-sidebar-open":
|
|
3573
|
+
"comments-sidebar-open": M.value,
|
|
3531
3574
|
"image-context": q(st),
|
|
3532
3575
|
theme: t.theme ?? null
|
|
3533
3576
|
}, Ht.value, {
|
|
@@ -3538,20 +3581,20 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3538
3581
|
onPageSetup: n[4] ||= (e) => k.value = !0,
|
|
3539
3582
|
onToggleOutline: q(Ot).handleToggleOutline,
|
|
3540
3583
|
onApplyStyle: q(Kt),
|
|
3541
|
-
onZoomIn: q(
|
|
3542
|
-
onZoomOut: q(
|
|
3543
|
-
onZoomSet: q(
|
|
3544
|
-
onToggleSidebar: n[5] ||= (e) =>
|
|
3584
|
+
onZoomIn: q(Te),
|
|
3585
|
+
onZoomOut: q(De),
|
|
3586
|
+
onZoomSet: q(G),
|
|
3587
|
+
onToggleSidebar: n[5] ||= (e) => M.value = !M.value,
|
|
3545
3588
|
onModeChange: dn,
|
|
3546
|
-
onToggleTrackChanges:
|
|
3547
|
-
"onUpdate:displayMode":
|
|
3589
|
+
onToggleTrackChanges: h,
|
|
3590
|
+
"onUpdate:displayMode": y,
|
|
3548
3591
|
onImageProperties: n[6] ||= (e) => O.value = !0,
|
|
3549
|
-
onImageWrapType: q(
|
|
3592
|
+
onImageWrapType: q(ut),
|
|
3550
3593
|
onImageTransform: q(dt)
|
|
3551
|
-
}),
|
|
3552
|
-
"table-context":
|
|
3594
|
+
}), me({
|
|
3595
|
+
"table-context": Ee(() => [R(_, {
|
|
3553
3596
|
view: q(X),
|
|
3554
|
-
"get-commands": q(
|
|
3597
|
+
"get-commands": q(Z),
|
|
3555
3598
|
"state-tick": E.value,
|
|
3556
3599
|
theme: t.theme ?? null
|
|
3557
3600
|
}, null, 8, [
|
|
@@ -3563,7 +3606,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3563
3606
|
_: 2
|
|
3564
3607
|
}, [e.$slots["toolbar-extra"] || t.toolbarExtra ? {
|
|
3565
3608
|
name: "toolbar-extra",
|
|
3566
|
-
fn:
|
|
3609
|
+
fn: Ee(() => [Ce(e.$slots, "toolbar-extra", {}, () => [t.toolbarExtra ? (U(), P(S, {
|
|
3567
3610
|
key: 0,
|
|
3568
3611
|
node: t.toolbarExtra
|
|
3569
3612
|
}, null, 8, ["node"])) : F("", !0)], !0)]),
|
|
@@ -3593,7 +3636,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3593
3636
|
"onImageWrapType",
|
|
3594
3637
|
"onImageTransform"
|
|
3595
3638
|
])) : F("", !0)]),
|
|
3596
|
-
|
|
3639
|
+
R(hr, {
|
|
3597
3640
|
"show-find-replace": D.value,
|
|
3598
3641
|
"onUpdate:showFindReplace": n[7] ||= (e) => D.value = e,
|
|
3599
3642
|
"show-hyperlink": ue.value,
|
|
@@ -3605,7 +3648,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3605
3648
|
"show-page-setup": k.value,
|
|
3606
3649
|
"onUpdate:showPageSetup": n[11] ||= (e) => k.value = e,
|
|
3607
3650
|
view: q(X),
|
|
3608
|
-
bookmarks:
|
|
3651
|
+
bookmarks: he.value,
|
|
3609
3652
|
"selected-image-pm-pos": q(at)?.pmPos ?? null,
|
|
3610
3653
|
"section-properties": Vt.value,
|
|
3611
3654
|
onInsertSymbol: q(qt),
|
|
@@ -3627,16 +3670,16 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3627
3670
|
"onHyperlinkRemove",
|
|
3628
3671
|
"onPageSetupApply"
|
|
3629
3672
|
]),
|
|
3630
|
-
q(qe) ? (U(), I("div", xa, K(q(qe)), 1)) : rt.value ? (U(), I("div", Sa, [
|
|
3673
|
+
q(qe) ? (U(), I("div", xa, K(q(qe)), 1)) : rt.value ? (U(), I("div", Sa, [Ce(e.$slots, "loading-indicator", {}, () => [t.loadingIndicator ? (U(), P(S, {
|
|
3631
3674
|
key: 0,
|
|
3632
3675
|
node: t.loadingIndicator
|
|
3633
|
-
}, null, 8, ["node"])) : (U(), I(
|
|
3676
|
+
}, null, 8, ["node"])) : (U(), I(j, { key: 1 }, [ge(K(q(x)("loadingDocument")), 1)], 64))], !0)])) : !q(Ge) && !ne.value ? (U(), I("div", Ca, [Ce(e.$slots, "placeholder", {}, () => [t.placeholder ? (U(), P(S, {
|
|
3634
3677
|
key: 0,
|
|
3635
3678
|
node: t.placeholder
|
|
3636
|
-
}, null, 8, ["node"])) : (U(), I(
|
|
3679
|
+
}, null, 8, ["node"])) : (U(), I(j, { key: 1 }, [ge("No document loaded")], 64))], !0)])) : F("", !0),
|
|
3637
3680
|
L("div", {
|
|
3638
3681
|
ref_key: "hiddenPmRef",
|
|
3639
|
-
ref:
|
|
3682
|
+
ref: w,
|
|
3640
3683
|
class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
|
|
3641
3684
|
}, null, 512),
|
|
3642
3685
|
L("div", {
|
|
@@ -3645,7 +3688,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3645
3688
|
class: "docx-editor-vue__editor-scroll",
|
|
3646
3689
|
onScroll: gn
|
|
3647
3690
|
}, [L("div", wa, [
|
|
3648
|
-
le.value && !u.value ? (U(), I("div", Ta, [
|
|
3691
|
+
le.value && !u.value ? (U(), I("div", Ta, [R(ee, {
|
|
3649
3692
|
"section-props": Vt.value,
|
|
3650
3693
|
zoom: q(B),
|
|
3651
3694
|
unit: t.rulerUnit ?? "inch",
|
|
@@ -3679,7 +3722,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3679
3722
|
"onFirstLineIndentChange",
|
|
3680
3723
|
"onTabStopRemove"
|
|
3681
3724
|
])])) : F("", !0),
|
|
3682
|
-
le.value && !u.value ? (U(), I("div", Ea, [
|
|
3725
|
+
le.value && !u.value ? (U(), I("div", Ea, [R(g, {
|
|
3683
3726
|
"section-props": Vt.value,
|
|
3684
3727
|
zoom: q(B),
|
|
3685
3728
|
unit: t.rulerUnit ?? "inch",
|
|
@@ -3709,10 +3752,10 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3709
3752
|
ref: T,
|
|
3710
3753
|
class: "docx-editor-vue__pages paged-editor__pages",
|
|
3711
3754
|
style: H(Gt.value)
|
|
3712
|
-
}, null, 4), L("div", Oa, [
|
|
3755
|
+
}, null, 4), L("div", Oa, [R(ur, {
|
|
3713
3756
|
"get-view": () => q(X),
|
|
3714
3757
|
"get-pages-container": () => T.value,
|
|
3715
|
-
"editor-state": q(
|
|
3758
|
+
"editor-state": q(Le),
|
|
3716
3759
|
zoom: q(B),
|
|
3717
3760
|
layout: q(Je),
|
|
3718
3761
|
blocks: q(Ye),
|
|
@@ -3731,11 +3774,11 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3731
3774
|
"on-term-click",
|
|
3732
3775
|
"selected-canonical",
|
|
3733
3776
|
"selection-seq"
|
|
3734
|
-
]), o.showTemplateDirectives ? (U(), P(
|
|
3777
|
+
]), o.showTemplateDirectives ? (U(), P(hi, {
|
|
3735
3778
|
key: 0,
|
|
3736
3779
|
"get-view": () => q(X),
|
|
3737
3780
|
"get-pages-container": () => T.value,
|
|
3738
|
-
"editor-state": q(
|
|
3781
|
+
"editor-state": q(Le),
|
|
3739
3782
|
zoom: q(B),
|
|
3740
3783
|
layout: q(Je),
|
|
3741
3784
|
blocks: q(Ye),
|
|
@@ -3749,7 +3792,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3749
3792
|
"blocks",
|
|
3750
3793
|
"measures"
|
|
3751
3794
|
])) : F("", !0)])]),
|
|
3752
|
-
|
|
3795
|
+
R(ii, {
|
|
3753
3796
|
"image-info": q(at),
|
|
3754
3797
|
zoom: q(B),
|
|
3755
3798
|
view: q(X),
|
|
@@ -3763,7 +3806,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3763
3806
|
"view",
|
|
3764
3807
|
"onContextMenu"
|
|
3765
3808
|
]),
|
|
3766
|
-
|
|
3809
|
+
R(Ti, {
|
|
3767
3810
|
data: q(ft),
|
|
3768
3811
|
"read-only": u.value,
|
|
3769
3812
|
onNavigate: q(ht),
|
|
@@ -3789,12 +3832,12 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3789
3832
|
"aria-label": q(yt).type === "row" ? "Insert row" : "Insert column",
|
|
3790
3833
|
onMousedown: n[16] ||= (...e) => q(Dt) && q(Dt)(...e)
|
|
3791
3834
|
}, " + ", 44, ka)) : F("", !0),
|
|
3792
|
-
|
|
3835
|
+
R(m, {
|
|
3793
3836
|
comments: q(zt),
|
|
3794
3837
|
"pages-container": T.value,
|
|
3795
3838
|
zoom: q(B),
|
|
3796
3839
|
"page-width-px": Ut.value,
|
|
3797
|
-
"sidebar-open":
|
|
3840
|
+
"sidebar-open": M.value,
|
|
3798
3841
|
"resolved-comment-ids": Wt.value,
|
|
3799
3842
|
onMarkerClick: () => {}
|
|
3800
3843
|
}, null, 8, [
|
|
@@ -3805,8 +3848,8 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3805
3848
|
"sidebar-open",
|
|
3806
3849
|
"resolved-comment-ids"
|
|
3807
3850
|
]),
|
|
3808
|
-
|
|
3809
|
-
"is-open":
|
|
3851
|
+
R(v, {
|
|
3852
|
+
"is-open": M.value,
|
|
3810
3853
|
comments: q(zt),
|
|
3811
3854
|
"tracked-changes": Rt.value,
|
|
3812
3855
|
"show-resolved": !0,
|
|
@@ -3816,7 +3859,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3816
3859
|
"page-width-px": Ut.value,
|
|
3817
3860
|
zoom: q(B),
|
|
3818
3861
|
"active-item-id": pe.value,
|
|
3819
|
-
onClose: n[17] ||= (e) =>
|
|
3862
|
+
onClose: n[17] ||= (e) => M.value = !1,
|
|
3820
3863
|
"onUpdate:activeItemId": n[18] ||= (e) => pe.value = e,
|
|
3821
3864
|
onAddComment: q($).handleAddComment,
|
|
3822
3865
|
onCancelAddComment: q($).handleCancelAddComment,
|
|
@@ -3862,17 +3905,17 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3862
3905
|
"aria-label": "Add comment",
|
|
3863
3906
|
title: "Add comment",
|
|
3864
3907
|
onMousedown: n[19] ||= Y((...e) => q($).startAddComment && q($).startAddComment(...e), ["prevent", "stop"])
|
|
3865
|
-
}, [
|
|
3908
|
+
}, [R(r, {
|
|
3866
3909
|
name: "add_comment",
|
|
3867
3910
|
size: 18
|
|
3868
3911
|
})], 36)) : F("", !0)
|
|
3869
3912
|
], 544),
|
|
3870
|
-
A.value ? F("", !0) : (U(), P(
|
|
3913
|
+
A.value ? F("", !0) : (U(), P(oi, {
|
|
3871
3914
|
key: 2,
|
|
3872
3915
|
"left-offset": 12,
|
|
3873
3916
|
onToggle: q(Ot).handleToggleOutline
|
|
3874
3917
|
}, null, 8, ["onToggle"])),
|
|
3875
|
-
q(bt).totalPages > 1 ? (U(), P(
|
|
3918
|
+
q(bt).totalPages > 1 ? (U(), P(si, {
|
|
3876
3919
|
key: 3,
|
|
3877
3920
|
"current-page": q(bt).currentPage,
|
|
3878
3921
|
"total-pages": q(bt).totalPages,
|
|
@@ -3882,9 +3925,9 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3882
3925
|
"total-pages",
|
|
3883
3926
|
"visible"
|
|
3884
3927
|
])) : F("", !0),
|
|
3885
|
-
|
|
3928
|
+
R(mr, {
|
|
3886
3929
|
"is-open": A.value,
|
|
3887
|
-
headings:
|
|
3930
|
+
headings: z.value,
|
|
3888
3931
|
"get-scroll-container": () => T.value,
|
|
3889
3932
|
onClose: n[24] ||= (e) => A.value = !1,
|
|
3890
3933
|
onNavigate: q(Ot).handleOutlineNavigate
|
|
@@ -3895,7 +3938,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3895
3938
|
"onNavigate"
|
|
3896
3939
|
])
|
|
3897
3940
|
])], 544),
|
|
3898
|
-
|
|
3941
|
+
R(Jr, {
|
|
3899
3942
|
"read-only": u.value,
|
|
3900
3943
|
"context-menu": q(kt),
|
|
3901
3944
|
"image-context-menu": q(At),
|
|
@@ -3919,30 +3962,42 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3919
3962
|
])
|
|
3920
3963
|
], 6));
|
|
3921
3964
|
}
|
|
3922
|
-
}), [["__scopeId", "data-v-
|
|
3965
|
+
}), [["__scopeId", "data-v-69ec23e0"]]);
|
|
3966
|
+
//#endregion
|
|
3967
|
+
//#region src/utils/listState.ts
|
|
3968
|
+
function ja() {
|
|
3969
|
+
return {
|
|
3970
|
+
type: "none",
|
|
3971
|
+
level: 0,
|
|
3972
|
+
isInList: !1
|
|
3973
|
+
};
|
|
3974
|
+
}
|
|
3975
|
+
//#endregion
|
|
3976
|
+
//#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
|
|
3977
|
+
var Ma = ["aria-label"], Na = ["aria-label"], Pa = [
|
|
3923
3978
|
"disabled",
|
|
3924
3979
|
"title",
|
|
3925
3980
|
"aria-label"
|
|
3926
|
-
],
|
|
3981
|
+
], Fa = [
|
|
3927
3982
|
"disabled",
|
|
3928
3983
|
"title",
|
|
3929
3984
|
"aria-label"
|
|
3930
|
-
],
|
|
3985
|
+
], Ia = ["aria-label"], La = [
|
|
3931
3986
|
"disabled",
|
|
3932
3987
|
"title",
|
|
3933
3988
|
"aria-label",
|
|
3934
3989
|
"aria-pressed"
|
|
3935
|
-
],
|
|
3990
|
+
], Ra = [
|
|
3936
3991
|
"disabled",
|
|
3937
3992
|
"title",
|
|
3938
3993
|
"aria-label",
|
|
3939
3994
|
"aria-pressed"
|
|
3940
|
-
],
|
|
3995
|
+
], za = [
|
|
3941
3996
|
"disabled",
|
|
3942
3997
|
"title",
|
|
3943
3998
|
"aria-label",
|
|
3944
3999
|
"aria-pressed"
|
|
3945
|
-
],
|
|
4000
|
+
], Ba = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
3946
4001
|
__name: "FormattingBar",
|
|
3947
4002
|
props: {
|
|
3948
4003
|
currentFormatting: {},
|
|
@@ -3984,7 +4039,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
3984
4039
|
"redo"
|
|
3985
4040
|
],
|
|
3986
4041
|
setup(e, { emit: t }) {
|
|
3987
|
-
let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s = N(() => i.currentFormatting ?? {}), l = N(() => i.documentStyles ? { styles: i.documentStyles } : {}), u = N(() => s.value.listState ??
|
|
4042
|
+
let { ColorPicker: n } = p(), i = e, a = t, { t: o } = c(), s = N(() => i.currentFormatting ?? {}), l = N(() => i.documentStyles ? { styles: i.documentStyles } : {}), u = N(() => s.value.listState ?? ja()), d = N(() => {
|
|
3988
4043
|
let e = s.value.color;
|
|
3989
4044
|
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
3990
4045
|
}), f = N(() => {
|
|
@@ -4014,25 +4069,25 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4014
4069
|
title: q(o)("undoShortcut"),
|
|
4015
4070
|
"aria-label": q(o)("undo"),
|
|
4016
4071
|
onMousedown: i[0] ||= Y((e) => a("undo"), ["prevent"])
|
|
4017
|
-
}, [
|
|
4072
|
+
}, [R(r, {
|
|
4018
4073
|
name: "undo",
|
|
4019
4074
|
size: 18
|
|
4020
|
-
})], 40,
|
|
4075
|
+
})], 40, Pa), L("button", {
|
|
4021
4076
|
type: "button",
|
|
4022
4077
|
class: "docx-formatting-bar__btn",
|
|
4023
4078
|
disabled: e.disabled || !e.canRedo,
|
|
4024
4079
|
title: q(o)("redoShortcut"),
|
|
4025
4080
|
"aria-label": q(o)("redo"),
|
|
4026
4081
|
onMousedown: i[1] ||= Y((e) => a("redo"), ["prevent"])
|
|
4027
|
-
}, [
|
|
4082
|
+
}, [R(r, {
|
|
4028
4083
|
name: "redo",
|
|
4029
4084
|
size: 18
|
|
4030
|
-
})], 40,
|
|
4085
|
+
})], 40, Fa)], 8, Na),
|
|
4031
4086
|
i[13] ||= L("span", {
|
|
4032
4087
|
class: "docx-formatting-bar__divider",
|
|
4033
4088
|
role: "separator"
|
|
4034
4089
|
}, null, -1),
|
|
4035
|
-
e.showStylePicker ? (U(), I(
|
|
4090
|
+
e.showStylePicker ? (U(), I(j, { key: 0 }, [R(b, ve({ value: s.value.styleId ?? "Normal" }, l.value, {
|
|
4036
4091
|
disabled: e.disabled,
|
|
4037
4092
|
onChange: i[2] ||= (e) => a("format", {
|
|
4038
4093
|
type: "applyStyle",
|
|
@@ -4055,10 +4110,10 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4055
4110
|
"aria-label": q(o)("bold"),
|
|
4056
4111
|
"aria-pressed": !!s.value.bold,
|
|
4057
4112
|
onMousedown: i[3] ||= Y((e) => a("format", "bold"), ["prevent"])
|
|
4058
|
-
}, [
|
|
4113
|
+
}, [R(r, {
|
|
4059
4114
|
name: "format_bold",
|
|
4060
4115
|
size: 18
|
|
4061
|
-
})], 42,
|
|
4116
|
+
})], 42, La),
|
|
4062
4117
|
L("button", {
|
|
4063
4118
|
type: "button",
|
|
4064
4119
|
class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.italic }]),
|
|
@@ -4067,10 +4122,10 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4067
4122
|
"aria-label": q(o)("italic"),
|
|
4068
4123
|
"aria-pressed": !!s.value.italic,
|
|
4069
4124
|
onMousedown: i[4] ||= Y((e) => a("format", "italic"), ["prevent"])
|
|
4070
|
-
}, [
|
|
4125
|
+
}, [R(r, {
|
|
4071
4126
|
name: "format_italic",
|
|
4072
4127
|
size: 18
|
|
4073
|
-
})], 42,
|
|
4128
|
+
})], 42, Ra),
|
|
4074
4129
|
L("button", {
|
|
4075
4130
|
type: "button",
|
|
4076
4131
|
class: V(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": s.value.underline }]),
|
|
@@ -4079,15 +4134,15 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4079
4134
|
"aria-label": q(o)("underline"),
|
|
4080
4135
|
"aria-pressed": !!s.value.underline,
|
|
4081
4136
|
onMousedown: i[5] ||= Y((e) => a("format", "underline"), ["prevent"])
|
|
4082
|
-
}, [
|
|
4137
|
+
}, [R(r, {
|
|
4083
4138
|
name: "format_underlined",
|
|
4084
4139
|
size: 18
|
|
4085
|
-
})], 42,
|
|
4086
|
-
], 8,
|
|
4087
|
-
e.showTextColorPicker ? (U(), I(
|
|
4140
|
+
})], 42, za)
|
|
4141
|
+
], 8, Ia),
|
|
4142
|
+
e.showTextColorPicker ? (U(), I(j, { key: 1 }, [i[12] ||= L("span", {
|
|
4088
4143
|
class: "docx-formatting-bar__divider",
|
|
4089
4144
|
role: "separator"
|
|
4090
|
-
}, null, -1),
|
|
4145
|
+
}, null, -1), R(q(n), {
|
|
4091
4146
|
mode: "text",
|
|
4092
4147
|
value: d.value,
|
|
4093
4148
|
theme: e.theme ?? null,
|
|
@@ -4102,7 +4157,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4102
4157
|
class: "docx-formatting-bar__divider",
|
|
4103
4158
|
role: "separator"
|
|
4104
4159
|
}, null, -1),
|
|
4105
|
-
e.showAlignmentButtons ? (U(), P(
|
|
4160
|
+
e.showAlignmentButtons ? (U(), P(y, {
|
|
4106
4161
|
key: 2,
|
|
4107
4162
|
value: s.value.alignment ?? "left",
|
|
4108
4163
|
disabled: e.disabled,
|
|
@@ -4111,7 +4166,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4111
4166
|
value: e
|
|
4112
4167
|
})
|
|
4113
4168
|
}, null, 8, ["value", "disabled"])) : F("", !0),
|
|
4114
|
-
e.showListButtons ? (U(), P(
|
|
4169
|
+
e.showListButtons ? (U(), P(x, {
|
|
4115
4170
|
key: 3,
|
|
4116
4171
|
"list-state": u.value,
|
|
4117
4172
|
disabled: e.disabled,
|
|
@@ -4125,9 +4180,9 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4125
4180
|
"disabled",
|
|
4126
4181
|
"can-outdent"
|
|
4127
4182
|
])) : F("", !0)
|
|
4128
|
-
], 10,
|
|
4183
|
+
], 10, Ma));
|
|
4129
4184
|
}
|
|
4130
|
-
}), [["__scopeId", "data-v-
|
|
4185
|
+
}), [["__scopeId", "data-v-fc03de2e"]]), Va = [
|
|
4131
4186
|
{
|
|
4132
4187
|
value: .5,
|
|
4133
4188
|
label: "50%"
|
|
@@ -4152,7 +4207,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4152
4207
|
value: 2,
|
|
4153
4208
|
label: "200%"
|
|
4154
4209
|
}
|
|
4155
|
-
],
|
|
4210
|
+
], Ha = /*#__PURE__*/ t(/* @__PURE__ */ z({
|
|
4156
4211
|
__name: "ZoomControl",
|
|
4157
4212
|
props: {
|
|
4158
4213
|
value: { default: 1 },
|
|
@@ -4169,7 +4224,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4169
4224
|
},
|
|
4170
4225
|
emits: ["change"],
|
|
4171
4226
|
setup(e, { emit: t }) {
|
|
4172
|
-
let { Select: n } = p(), r = e, i = t, a = N(() => r.levels ??
|
|
4227
|
+
let { Select: n } = p(), r = e, i = t, a = N(() => r.levels ?? Va), o = N(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = N(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = N(() => o.value ? String(o.value.value) : String(r.value)), l = N(() => {
|
|
4173
4228
|
let e = a.value.map((e) => ({
|
|
4174
4229
|
value: String(e.value),
|
|
4175
4230
|
label: e.label
|
|
@@ -4197,7 +4252,7 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4197
4252
|
"disabled"
|
|
4198
4253
|
]));
|
|
4199
4254
|
}
|
|
4200
|
-
}), [["__scopeId", "data-v-8079e07f"]]),
|
|
4255
|
+
}), [["__scopeId", "data-v-8079e07f"]]), Ua = (e, t, n = {}) => {
|
|
4201
4256
|
let { locale: r = "en", ...i } = n;
|
|
4202
4257
|
return new Promise((n, a) => {
|
|
4203
4258
|
let o = W(null), s = null, c = !1, u = {
|
|
@@ -4222,8 +4277,8 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4222
4277
|
c || (c = !0, a(/* @__PURE__ */ Error("Editor was destroyed before mounting completed."))), s?.unmount(), s = null;
|
|
4223
4278
|
}
|
|
4224
4279
|
};
|
|
4225
|
-
s =
|
|
4226
|
-
return () =>
|
|
4280
|
+
s = pe({ setup() {
|
|
4281
|
+
return () => B(Aa, {
|
|
4227
4282
|
...i,
|
|
4228
4283
|
documentBuffer: e,
|
|
4229
4284
|
ref: o,
|
|
@@ -4238,4 +4293,4 @@ var ba = { class: "docx-editor-vue__toolbar-shell" }, xa = {
|
|
|
4238
4293
|
});
|
|
4239
4294
|
};
|
|
4240
4295
|
//#endregion
|
|
4241
|
-
export {
|
|
4296
|
+
export { In as DEFAULT_AI_SUGGESTION_PRESETS, Yn as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Aa as DocxEditor, w as FindReplaceDialog, s as FolioUIProvider, T as FootnotePropertiesDialog, Ba as FormattingBar, se as HyperlinkDialog, ce as ImagePositionDialog, le as ImagePropertiesDialog, E as InsertImageDialog, D as InsertSymbolDialog, ue as InsertTableDialog, de as PageSetupDialog, fe as PasteSpecialDialog, O as SplitCellDialog, k as TablePropertiesDialog, A as WatermarkDialog, Ha as ZoomControl, Xn as acceptAutocompleteSuggestion, Zn as acceptAutocompleteWord, Je as anonymizationDecorationsKey, Qn as appendAutocompleteToken, Bt as applyFolioAIEditOperations, Ln as applySuggestions, $n as autocompleteSuggestionKey, er as autocompleteSuggestionPlugin, Bn as buildPositionalText, tr as clearAutocompleteSuggestion, It as clearTemplateSlashMenu, Lt as consumeTemplateSlashQuery, Kn as createAICitationDecorationsPlugin, jn as createDocx, An as createEmptyDocument, Wt as createFolioAIEditSnapshot, n as defaultLocale, Mn as deriveBlockId, Kt as diffWordSegments, nr as finishAutocompleteSuggestion, or as fromMarkdown, Ye as getAnonymizationMatches, rr as getAutocompleteSuggestion, On as getDocumentWatermark, Wn as getFolioCaretViewportRect, Nn as getFolioParaIdFromBlockId, Gn as getFolioSelectionViewportRect, vt as getTemplateDirectives, Rt as getTemplateSlashMenu, Xt as hashFolioAIBlockText, l as i18nPlugin, Me as insertImageFromFile, Pe as insertPageBreakInView, X as insertTableInView, Le as insertTableOfContentsInView, Pn as isFolioBlockId, Fn as isSequentialFolioBlockId, Rn as isSuggestionStale, Zt as normalizeFolioAIBlockText, e as provideLocale, Ua as renderAsync, Q as resetTemplateSlashQuery, zn as resolveSuggestionAnchor, bt as scanDirectives, Un as scrollFolioPositionIntoView, qn as setAICitationsMeta, Vn as setAISuggestionsMeta, Jn as setActiveCitationMeta, Ze as setAnonymizationTermsMeta, kn as setDocumentWatermark, Hn as setFocusedSuggestionMeta, Ft as setTemplatePreviewValues, ir as shouldTriggerAutocomplete, ar as startAutocompleteSuggestion, zt as templateSlashMenuKey, sr as toMarkdown, cr as toMarkdownResult, c as useTranslation, oe as useWheelZoom };
|