@stll/folio-vue 0.17.0 → 0.17.1
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/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +542 -542
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,90 +4,90 @@ import { t as ae } from "./zIndex-Ei9BbHSW.js";
|
|
|
4
4
|
import { a as S, c as oe, i as se, l as C, o as ce, r as le, s as ue, t as de, u as fe } from "./useZoom-CBI44HNj.js";
|
|
5
5
|
import { FindReplaceDialog as w, FootnotePropertiesDialog as pe, HyperlinkDialog as me, ImagePositionDialog as he, ImagePropertiesDialog as ge, InsertImageDialog as T, InsertSymbolDialog as E, InsertTableDialog as _e, PageSetupDialog as ve, PasteSpecialDialog as ye, SplitCellDialog as be, TablePropertiesDialog as xe, WatermarkDialog as Se } from "./dialogs.js";
|
|
6
6
|
import { Fragment as D, Teleport as O, computed as k, createApp as A, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createSlots as Ce, createStaticVNode as we, createTextVNode as Te, createVNode as F, defineComponent as I, h as Ee, inject as De, mergeProps as Oe, nextTick as ke, normalizeClass as L, normalizeStyle as R, onBeforeUnmount as z, onMounted as Ae, onScopeDispose as B, openBlock as V, provide as je, ref as H, renderList as U, renderSlot as Me, shallowRef as Ne, toDisplayString as W, unref as G, vModelText as Pe, vShow as Fe, watch as K, withCtx as Ie, withDirectives as Le, withKeys as Re, withModifiers as q } from "vue";
|
|
7
|
-
import { createStyleResolver as ze, extractSelectionState as Be,
|
|
8
|
-
import { expectTableAttrs as
|
|
9
|
-
import { getTableContext as
|
|
10
|
-
import { extractSelectionContext as
|
|
11
|
-
import { inspectDocxCompatibility as
|
|
12
|
-
import { resolveActiveEditorStory as
|
|
13
|
-
import { clearAllCaches as
|
|
14
|
-
import { onFontsLoaded as
|
|
15
|
-
import { twipsToPixels as
|
|
16
|
-
import { getDocumentWatermark as
|
|
17
|
-
import { createLatestRequestGate as
|
|
18
|
-
import { measureDirectiveGutter as
|
|
19
|
-
import { prefersReducedMotionBehavior as
|
|
20
|
-
import { anonymizationDecorationsKey as
|
|
21
|
-
import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as
|
|
22
|
-
import { createRenderedDomContext as
|
|
23
|
-
import { ContentControlWidgetController as
|
|
24
|
-
import { NodeSelection as
|
|
25
|
-
import { pixelsToEmu as
|
|
26
|
-
import { IMAGE_LAYOUT_OPTIONS as
|
|
27
|
-
import { isTrackChangesMode as
|
|
28
|
-
import { clickToPositionDom as
|
|
29
|
-
import { calculateResizedImageDimensions as
|
|
30
|
-
import { findBodyPmAnchor as
|
|
31
|
-
import { resetImeCaretAnchor as
|
|
32
|
-
import { PAINTER_PAINTED_EVENT as
|
|
33
|
-
import { HeaderFooterSelectionOverlay as
|
|
34
|
-
import { getTemplateDirectives as
|
|
35
|
-
import { closeHistory as
|
|
36
|
-
import { clearFormatting as
|
|
37
|
-
import { PENDING_COMMENT_ID as
|
|
38
|
-
import { createComment as
|
|
39
|
-
import { acceptAIEditRevision as
|
|
40
|
-
import { makeRevisionInfo as
|
|
41
|
-
import { findPageIndexContainingPmPos as
|
|
42
|
-
import { proseDocToBlocks as
|
|
43
|
-
import { setTemplatePreviewValues as
|
|
44
|
-
import { clearTemplateSlashMenu as
|
|
45
|
-
import { createEmptyHeaderFooter as
|
|
46
|
-
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as
|
|
47
|
-
import { findParagraphFragmentsByParaId as
|
|
48
|
-
import { onPaintedLayoutChange as
|
|
49
|
-
import { blockSdtAttrsToSdtProperties as
|
|
50
|
-
import { setContentControlContentBlocksTr as
|
|
51
|
-
import { clampRangeToDocSize as
|
|
52
|
-
import { deriveBlockId as
|
|
53
|
-
import { getPageTextFromLayout as
|
|
54
|
-
import { applyStyle as
|
|
55
|
-
import { getCachedNumberingMap as
|
|
56
|
-
import { insertPageBreak as
|
|
57
|
-
import { insertSectionBreakContinuous as
|
|
58
|
-
import { setEmbeddedFontFamilyMap as
|
|
59
|
-
import { buildEmbeddedFontFamilyMap as
|
|
60
|
-
import { editHyperlinkAtCursor as
|
|
61
|
-
import { sanitizeExternalUrl as
|
|
62
|
-
import { isKeydownInShortcutScope as
|
|
63
|
-
import { collectHeadings as
|
|
64
|
-
import { clickToPositionInHfSlot as
|
|
65
|
-
import { findNoteStoryForTarget as
|
|
66
|
-
import { TABLE_INSERT_HIDE_DELAY_MS as
|
|
67
|
-
import { createCellDragTracker as
|
|
68
|
-
import { RemoteSelectionOverlay as
|
|
69
|
-
import { BodySelectionOverlay as
|
|
70
|
-
import { createEmptyDocument as
|
|
71
|
-
import { extractDocumentStyleSet as
|
|
72
|
-
import { STELLA_STYLE_SET_NAME as
|
|
73
|
-
import { DOCUMENT_PRESET_VERSION as
|
|
74
|
-
import { createDocx as
|
|
75
|
-
import { DEFAULT_AI_SUGGESTION_PRESETS as
|
|
76
|
-
import { applySuggestions as
|
|
77
|
-
import { isSuggestionStale as
|
|
78
|
-
import { buildPositionalText as
|
|
79
|
-
import { setAISuggestionsMeta as
|
|
80
|
-
import { scrollFolioPositionIntoView as
|
|
81
|
-
import { getFolioCaretViewportRect as
|
|
82
|
-
import { createAICitationDecorationsPlugin as
|
|
83
|
-
import { fromMarkdown as
|
|
7
|
+
import { createStyleResolver as ze, extractSelectionState as Be, getDocumentBuiltInStyles as Ve, getDocumentStyleResolver as He, getSelectedText as Ue, insertImageFromFile as We, insertImageFromFile as Ge, insertPageBreakInView as Ke, insertPageBreakInView as qe, insertTableInView as Je, insertTableInView as Ye, insertTableOfContentsInView as Xe, insertTableOfContentsInView as Ze, schema as J } from "@stll/folio-core/prosemirror";
|
|
8
|
+
import { expectTableAttrs as Qe } from "@stll/folio-core/prosemirror/attrs";
|
|
9
|
+
import { getTableContext as $e } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
|
|
10
|
+
import { extractSelectionContext as et } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
|
|
11
|
+
import { inspectDocxCompatibility as tt } from "@stll/folio-core/docx/compatibility";
|
|
12
|
+
import { resolveActiveEditorStory as nt } from "@stll/folio-core/controller/activeEditorStory";
|
|
13
|
+
import { clearAllCaches as rt, resetCanvasContext as it } from "@stll/folio-core/layout-bridge/engine/measuring";
|
|
14
|
+
import { onFontsLoaded as at } from "@stll/folio-core/utils/fontLoader";
|
|
15
|
+
import { twipsToPixels as ot } from "@stll/folio-core/paged-layout/sectionGeometry";
|
|
16
|
+
import { getDocumentWatermark as st, getDocumentWatermark as ct, setDocumentWatermark as lt, setDocumentWatermark as ut } from "@stll/folio-core/watermark";
|
|
17
|
+
import { createLatestRequestGate as dt } from "@stll/folio-core/controller/latestRequestGate";
|
|
18
|
+
import { measureDirectiveGutter as ft, projectRangesToRects as pt } from "@stll/folio-core/paged-layout/rangeProjection";
|
|
19
|
+
import { prefersReducedMotionBehavior as mt } from "@stll/folio-core/paged-layout/scrollNavigation";
|
|
20
|
+
import { anonymizationDecorationsKey as ht, getAnonymizationMatches as gt, getAnonymizationMatches as _t, setAnonymizationTermsMeta as vt, slugAnonymizationLabel as yt } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
21
|
+
import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as bt, acceptAutocompleteSuggestion as xt, acceptAutocompleteWord as St, appendAutocompleteToken as Y, autocompleteSuggestionKey as Ct, autocompleteSuggestionPlugin as wt, clearAutocompleteSuggestion as Tt, finishAutocompleteSuggestion as Et, getAutocompleteSuggestion as Dt, getAutocompleteSuggestion as Ot, shouldTriggerAutocomplete as kt, startAutocompleteSuggestion as At } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
22
|
+
import { createRenderedDomContext as X } from "@stll/folio-core/render-dom/RenderedDomContext";
|
|
23
|
+
import { ContentControlWidgetController as jt } from "@stll/folio-core/controller/contentControlWidgetController";
|
|
24
|
+
import { NodeSelection as Mt, Selection as Nt, TextSelection as Z } from "prosemirror-state";
|
|
25
|
+
import { pixelsToEmu as Pt } from "@stll/folio-core/utils/units";
|
|
26
|
+
import { IMAGE_LAYOUT_OPTIONS as Ft, captureInlinePositionEmu as It, deriveLayoutChoice as Lt, findImageElement as Rt, isImageLayoutOptionEnabled as zt, toolbarValueToLayoutTarget as Bt } from "@stll/folio-core/layout-painter/imageLayout";
|
|
27
|
+
import { isTrackChangesMode as Vt, toggledTrackChangesMode as Ht } from "@stll/folio-core/managers/EditorModeManager";
|
|
28
|
+
import { clickToPositionDom as Ut, getCaretPositionFromDom as Wt } from "@stll/folio-core/layout-bridge/dom/clickToPositionDom";
|
|
29
|
+
import { calculateResizedImageDimensions as Gt, commitImageFloatMove as Kt, commitImageInlineMove as qt, commitImageResize as Jt, isFloatingImage as Yt } from "@stll/folio-core/prosemirror/imageCommit";
|
|
30
|
+
import { findBodyPmAnchor as Xt, findBodyPmSpans as Zt } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
|
|
31
|
+
import { resetImeCaretAnchor as Qt, syncImeCaretAnchor as $t } from "@stll/folio-core/layout-bridge/dom/imeCaretAnchor";
|
|
32
|
+
import { PAINTER_PAINTED_EVENT as en } from "@stll/folio-core/layout-painter/renderPage";
|
|
33
|
+
import { HeaderFooterSelectionOverlay as tn } from "@stll/folio-core/render-dom/HeaderFooterSelectionOverlay";
|
|
34
|
+
import { getTemplateDirectives as nn, getTemplateDirectives as rn, scanDirectives as an } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
35
|
+
import { closeHistory as on, redo as sn, undo as cn } from "prosemirror-history";
|
|
36
|
+
import { clearFormatting as ln } from "@stll/folio-core/prosemirror/commands/formatting";
|
|
37
|
+
import { PENDING_COMMENT_ID as un, createCommentIdAllocator as dn, seedCommentAllocator as fn } from "@stll/folio-core/prosemirror/commentIdAllocator";
|
|
38
|
+
import { createComment as pn } from "@stll/folio-core/prosemirror/commentOps";
|
|
39
|
+
import { acceptAIEditRevision as mn, acceptChange as hn, acceptSuggestion as gn, findAIEditRevisionRange as _n, findSuggestionRange as vn, getSuggestions as yn, rejectAIEditRevision as bn, rejectChange as Q, rejectSuggestion as xn } from "@stll/folio-core/prosemirror/commands/comments";
|
|
40
|
+
import { makeRevisionInfo as $ } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
41
|
+
import { findPageIndexContainingPmPos as Sn } from "@stll/folio-core/layout-engine";
|
|
42
|
+
import { proseDocToBlocks as Cn } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
|
|
43
|
+
import { setTemplatePreviewValues as wn } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
44
|
+
import { clearTemplateSlashMenu as Tn, consumeTemplateSlashQuery as En, getTemplateSlashMenu as Dn, resetTemplateSlashQuery as On, templateSlashMenuKey as kn } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
45
|
+
import { createEmptyHeaderFooter as An, pickActiveHeaderFooterRId as jn, removeHeaderFooter as Mn, resolveHeaderFooterContent as Nn, saveHeaderFooterContent as Pn } from "@stll/folio-core/utils/headerFooter";
|
|
46
|
+
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as Fn, applyFolioAIEditOperations as In, applyFolioAIEditOperations as Ln, applyFolioDocumentOperations as Rn, assertSupportedFolioDocumentOperationVersion as zn, createFolioAIEditSnapshot as Bn, createFolioAIEditSnapshot as Vn, createFolioAIEditSnapshotWithStyleResolver as Hn, diffWordSegments as Un, getCommentAnchorsFromDoc as Wn, getFolioDocumentOperationIssues as Gn, getTrackedChangesFromDoc as Kn, hashFolioAIBlockText as qn, normalizeFolioAIBlockText as Jn } from "@stll/folio-core/ai-edits";
|
|
47
|
+
import { findParagraphFragmentsByParaId as Yn, flashParagraphElements as Xn } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
48
|
+
import { onPaintedLayoutChange as Zn, readBlockRects as Qn } from "@stll/folio-core/paged-layout/blockGeometry";
|
|
49
|
+
import { blockSdtAttrsToSdtProperties as $n, findBlockSdtMatch as er, findBlockSdtMatches as tr, removeContentControlTr as nr, setContentControlContentTr as rr, setContentControlValueTr as ir } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
50
|
+
import { setContentControlContentBlocksTr as ar } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
51
|
+
import { clampRangeToDocSize as or, resolveFolioAIBlockRange as sr, resolveFolioAITextRange as cr, resolvePassageRange as lr } from "@stll/folio-core/ai-edits/blockRange";
|
|
52
|
+
import { deriveBlockId as ur, getFolioParaIdFromBlockId as dr, getFolioParaIdFromBlockId as fr, isFolioBlockId as pr, isSequentialFolioBlockId as mr } from "@stll/folio-core/types/block-id";
|
|
53
|
+
import { getPageTextFromLayout as hr } from "@stll/folio-core/paged-layout/pageText";
|
|
54
|
+
import { applyStyle as gr, removeTabStop as _r, setIndentFirstLine as vr, setIndentLeft as yr, setIndentRight as br } from "@stll/folio-core/prosemirror/commands/paragraph";
|
|
55
|
+
import { getCachedNumberingMap as xr } from "@stll/folio-core/docx";
|
|
56
|
+
import { insertPageBreak as Sr } from "@stll/folio-core/prosemirror/commands/pageBreak";
|
|
57
|
+
import { insertSectionBreakContinuous as Cr, insertSectionBreakNextPage as wr } from "@stll/folio-core/prosemirror/commands/sectionBreak";
|
|
58
|
+
import { setEmbeddedFontFamilyMap as Tr } from "@stll/folio-core/utils/fontResolver";
|
|
59
|
+
import { buildEmbeddedFontFamilyMap as Er, extractEmbeddedFonts as Dr } from "@stll/folio-core/fonts/embeddedFonts";
|
|
60
|
+
import { editHyperlinkAtCursor as Or, removeHyperlinkAtCursor as kr } from "@stll/folio-core/prosemirror/commands/hyperlink";
|
|
61
|
+
import { sanitizeExternalUrl as Ar } from "@stll/folio-core/utils/urlSecurity";
|
|
62
|
+
import { isKeydownInShortcutScope as jr } from "@stll/folio-core/managers/editorShortcuts";
|
|
63
|
+
import { collectHeadings as Mr } from "@stll/folio-core/utils/headingCollector";
|
|
64
|
+
import { clickToPositionInHfSlot as Nr } from "@stll/folio-core/layout-bridge/dom/findHfPmSpans";
|
|
65
|
+
import { findNoteStoryForTarget as Pr } from "@stll/folio-core/layout-bridge/dom/noteStoryDom";
|
|
66
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as Fr, detectTableInsertHover as Ir } from "@stll/folio-core/layout-bridge/tableInsertHover";
|
|
67
|
+
import { createCellDragTracker as Lr, findCellPosFromPmPos as Rr } from "@stll/folio-core/prosemirror/cellDragSelection";
|
|
68
|
+
import { RemoteSelectionOverlay as zr } from "@stll/folio-core/render-dom/RemoteSelectionOverlay";
|
|
69
|
+
import { BodySelectionOverlay as Br } from "@stll/folio-core/render-dom/BodySelectionOverlay";
|
|
70
|
+
import { createEmptyDocument as Vr } from "@stll/folio-core/utils/createDocument";
|
|
71
|
+
import { extractDocumentStyleSet as Hr, extractDocumentStyleSetFromDocx as Ur, inspectDocumentStyles as Wr, inspectDocumentStylesFromDocx as Gr } from "@stll/folio-core/style-sets/extract";
|
|
72
|
+
import { STELLA_STYLE_SET_NAME as Kr, createStellaStyleDocumentPreset as qr, createStellaStyleSet as Jr } from "@stll/folio-core/style-sets/stellaStyle";
|
|
73
|
+
import { DOCUMENT_PRESET_VERSION as Yr, DOCUMENT_STYLE_SET_VERSION as Xr } from "@stll/folio-core/style-sets/types";
|
|
74
|
+
import { createDocx as Zr } from "@stll/folio-core/docx/rezip";
|
|
75
|
+
import { DEFAULT_AI_SUGGESTION_PRESETS as Qr } from "@stll/folio-core/ai-suggestions/types";
|
|
76
|
+
import { applySuggestions as $r } from "@stll/folio-core/ai-suggestions/apply";
|
|
77
|
+
import { isSuggestionStale as ei, resolveSuggestionAnchor as ti } from "@stll/folio-core/ai-suggestions/conflict";
|
|
78
|
+
import { buildPositionalText as ni } from "@stll/folio-core/ai-suggestions/text-positions";
|
|
79
|
+
import { setAISuggestionsMeta as ri, setFocusedSuggestionMeta as ii } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
80
|
+
import { scrollFolioPositionIntoView as ai } from "@stll/folio-core/paged-layout/scrollToPmPosition";
|
|
81
|
+
import { getFolioCaretViewportRect as oi, getFolioSelectionViewportRect as si } from "@stll/folio-core/paged-layout/selectionViewportRect";
|
|
82
|
+
import { createAICitationDecorationsPlugin as ci, setAICitationsMeta as li, setActiveCitationMeta as ui } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
83
|
+
import { fromMarkdown as di, toMarkdown as fi, toMarkdownResult as pi } from "@stll/folio-core/markdown";
|
|
84
84
|
//#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
85
|
-
var
|
|
85
|
+
var mi = [
|
|
86
86
|
"data-folio-anonymization-label",
|
|
87
87
|
"data-folio-anonymization-canonical",
|
|
88
88
|
"data-folio-anonymization-selected",
|
|
89
89
|
"title"
|
|
90
|
-
],
|
|
90
|
+
], hi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
91
91
|
__name: "AnonymizationRectsOverlay",
|
|
92
92
|
props: {
|
|
93
93
|
getView: { type: Function },
|
|
@@ -102,7 +102,7 @@ var di = [
|
|
|
102
102
|
selectionSeq: {}
|
|
103
103
|
},
|
|
104
104
|
setup(e) {
|
|
105
|
-
let t = e, n = H(null), r = H([]), i =
|
|
105
|
+
let t = e, n = H(null), r = H([]), i = dt(), a = null;
|
|
106
106
|
function o() {
|
|
107
107
|
a !== null && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
108
108
|
a = null, s();
|
|
@@ -114,12 +114,12 @@ var di = [
|
|
|
114
114
|
r.value = [];
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
let s =
|
|
117
|
+
let s = _t(o);
|
|
118
118
|
if (s.length === 0) {
|
|
119
119
|
r.value = [];
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
let c = await
|
|
122
|
+
let c = await pt(s, {
|
|
123
123
|
pagesContainer: a,
|
|
124
124
|
zoom: t.zoom,
|
|
125
125
|
layout: t.layout,
|
|
@@ -161,7 +161,7 @@ var di = [
|
|
|
161
161
|
index: a
|
|
162
162
|
}, i.item(a)?.scrollIntoView({
|
|
163
163
|
block: "center",
|
|
164
|
-
behavior:
|
|
164
|
+
behavior: mt()
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
K(() => [t.selectedCanonical, t.selectionSeq], () => l(), { flush: "post" });
|
|
@@ -192,7 +192,7 @@ var di = [
|
|
|
192
192
|
"data-folio-anonymization-overlay": ""
|
|
193
193
|
}, [(V(!0), N(D, null, U(r.value, (t) => (V(), N(D, { key: `${t.label}:${t.canonical}` }, [(V(!0), N(D, null, U(t.rects, (n, r) => (V(), N("span", {
|
|
194
194
|
key: `${t.canonical}:${r}:${n.left}:${n.top}`,
|
|
195
|
-
class: L(["folio-anonymization-term", `folio-anonymization-term--${G(
|
|
195
|
+
class: L(["folio-anonymization-term", `folio-anonymization-term--${G(yt)(t.label)}`]),
|
|
196
196
|
"data-folio-anonymization-label": t.label,
|
|
197
197
|
"data-folio-anonymization-canonical": t.canonical,
|
|
198
198
|
"data-folio-anonymization-selected": t.canonical === e.selectedCanonical ? "true" : void 0,
|
|
@@ -204,12 +204,12 @@ var di = [
|
|
|
204
204
|
width: `${n.width}px`,
|
|
205
205
|
height: `${n.height}px`
|
|
206
206
|
})
|
|
207
|
-
}, null, 14,
|
|
207
|
+
}, null, 14, mi))), 128))], 64))), 128))], 512));
|
|
208
208
|
}
|
|
209
|
-
}), [["__scopeId", "data-v-df8fe7df"]]),
|
|
209
|
+
}), [["__scopeId", "data-v-df8fe7df"]]), gi = {
|
|
210
210
|
class: "folio-passage-highlight-overlay",
|
|
211
211
|
"data-folio-passage-highlight-overlay": ""
|
|
212
|
-
},
|
|
212
|
+
}, _i = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
213
213
|
__name: "PassageHighlightOverlay",
|
|
214
214
|
props: {
|
|
215
215
|
range: {},
|
|
@@ -220,7 +220,7 @@ var di = [
|
|
|
220
220
|
measures: {}
|
|
221
221
|
},
|
|
222
222
|
setup(e) {
|
|
223
|
-
let t = e, n = H([]), r =
|
|
223
|
+
let t = e, n = H([]), r = dt(), i = null;
|
|
224
224
|
function a() {
|
|
225
225
|
i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
|
|
226
226
|
i = null, o();
|
|
@@ -232,7 +232,7 @@ var di = [
|
|
|
232
232
|
n.value = [];
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
235
|
-
let o = await
|
|
235
|
+
let o = await pt([i], {
|
|
236
236
|
pagesContainer: a,
|
|
237
237
|
zoom: t.zoom,
|
|
238
238
|
layout: t.layout,
|
|
@@ -256,7 +256,7 @@ var di = [
|
|
|
256
256
|
t.measures
|
|
257
257
|
], () => a(), { immediate: !0 }), z(() => {
|
|
258
258
|
r.invalidate(), i !== null && (cancelAnimationFrame(i), i = null);
|
|
259
|
-
}), (e, t) => (V(), N("div",
|
|
259
|
+
}), (e, t) => (V(), N("div", gi, [(V(!0), N(D, null, U(n.value, (e, t) => (V(), N("span", {
|
|
260
260
|
key: `${t}:${e.left}:${e.top}`,
|
|
261
261
|
class: "folio-passage-highlight",
|
|
262
262
|
style: R({
|
|
@@ -268,11 +268,11 @@ var di = [
|
|
|
268
268
|
})
|
|
269
269
|
}, null, 4))), 128))]));
|
|
270
270
|
}
|
|
271
|
-
}), [["__scopeId", "data-v-bde9f41b"]]),
|
|
271
|
+
}), [["__scopeId", "data-v-bde9f41b"]]), vi = {
|
|
272
272
|
key: 0,
|
|
273
273
|
class: "folio-autocomplete-overlay",
|
|
274
274
|
"data-folio-autocomplete-overlay": ""
|
|
275
|
-
},
|
|
275
|
+
}, yi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
276
276
|
__name: "AutocompleteCaretOverlay",
|
|
277
277
|
props: {
|
|
278
278
|
caret: {},
|
|
@@ -280,7 +280,7 @@ var di = [
|
|
|
280
280
|
isStreaming: { type: Boolean }
|
|
281
281
|
},
|
|
282
282
|
setup(e) {
|
|
283
|
-
return (t, n) => e.caret && e.text.length > 0 ? (V(), N("div",
|
|
283
|
+
return (t, n) => e.caret && e.text.length > 0 ? (V(), N("div", vi, [P("span", {
|
|
284
284
|
class: "folio-autocomplete-ghost",
|
|
285
285
|
style: R({
|
|
286
286
|
left: `${e.caret.x}px`,
|
|
@@ -293,7 +293,7 @@ var di = [
|
|
|
293
293
|
"aria-hidden": "true"
|
|
294
294
|
}, "stella", 2)], 4)])) : M("", !0);
|
|
295
295
|
}
|
|
296
|
-
}), [["__scopeId", "data-v-00299904"]]),
|
|
296
|
+
}), [["__scopeId", "data-v-00299904"]]), bi = 48, xi = /* @__PURE__ */ I({
|
|
297
297
|
__name: "AutocompleteSuggestionOverlay",
|
|
298
298
|
props: {
|
|
299
299
|
getPagesContainer: { type: Function },
|
|
@@ -310,7 +310,7 @@ var di = [
|
|
|
310
310
|
let c = r.querySelector(".layout-page-content");
|
|
311
311
|
if (!c) return;
|
|
312
312
|
let l = (c.getBoundingClientRect().right - a.left) / i;
|
|
313
|
-
return Math.max(
|
|
313
|
+
return Math.max(bi, l - t);
|
|
314
314
|
}
|
|
315
315
|
}, s = () => {
|
|
316
316
|
let e = t.getPagesContainer(), r = t.editorState;
|
|
@@ -318,12 +318,12 @@ var di = [
|
|
|
318
318
|
n.value = null;
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
let i =
|
|
321
|
+
let i = Ot(r);
|
|
322
322
|
if (i.status === "idle" || i.text.length === 0) {
|
|
323
323
|
n.value = null;
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
|
-
let a =
|
|
326
|
+
let a = X(e, t.zoom), s = a.getCoordinatesForPosition(i.anchor);
|
|
327
327
|
if (!s) {
|
|
328
328
|
n.value = null;
|
|
329
329
|
return;
|
|
@@ -359,7 +359,7 @@ var di = [
|
|
|
359
359
|
t.editorState,
|
|
360
360
|
t.zoom,
|
|
361
361
|
r.value
|
|
362
|
-
], () => c()), (e, t) => (V(), j(
|
|
362
|
+
], () => c()), (e, t) => (V(), j(yi, {
|
|
363
363
|
caret: n.value?.caret ?? null,
|
|
364
364
|
text: n.value?.text ?? "",
|
|
365
365
|
"is-streaming": n.value?.isStreaming ?? !1
|
|
@@ -369,33 +369,33 @@ var di = [
|
|
|
369
369
|
"is-streaming"
|
|
370
370
|
]));
|
|
371
371
|
}
|
|
372
|
-
}),
|
|
373
|
-
function
|
|
374
|
-
je(
|
|
372
|
+
}), Si = Symbol("docx-portal-class");
|
|
373
|
+
function Ci(e) {
|
|
374
|
+
je(Si, k(() => ({
|
|
375
375
|
"ep-root": !0,
|
|
376
376
|
dark: !!G(e)
|
|
377
377
|
})));
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
return De(
|
|
379
|
+
function wi() {
|
|
380
|
+
return De(Si, k(() => ({ "ep-root": !0 })));
|
|
381
381
|
}
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region src/components/ContentControlWidgetsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
384
|
-
var
|
|
384
|
+
var Ti = ["aria-label"], Ei = {
|
|
385
385
|
key: 0,
|
|
386
386
|
class: "content-control-picker__items",
|
|
387
387
|
role: "menu"
|
|
388
|
-
},
|
|
388
|
+
}, Di = {
|
|
389
389
|
key: 0,
|
|
390
390
|
class: "content-control-picker__empty"
|
|
391
|
-
},
|
|
391
|
+
}, Oi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
392
392
|
__name: "ContentControlWidgetsOverlay",
|
|
393
393
|
props: {
|
|
394
394
|
eventRoot: {},
|
|
395
395
|
view: {}
|
|
396
396
|
},
|
|
397
397
|
setup(e) {
|
|
398
|
-
let t = e, { t: n } = r(), { Button: i, DatePickerPopover: a } = h(), o =
|
|
398
|
+
let t = e, { t: n } = r(), { Button: i, DatePickerPopover: a } = h(), o = wi(), s = new jt(), c = Ne(s.getSnapshot()), l = s.subscribe(() => {
|
|
399
399
|
c.value = s.getSnapshot();
|
|
400
400
|
});
|
|
401
401
|
K([() => t.view, () => t.eventRoot], ([e, t]) => s.bind(e, t), { immediate: !0 }), z(() => {
|
|
@@ -414,7 +414,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
414
414
|
role: "dialog",
|
|
415
415
|
"aria-label": c.value.status === "dropdown" ? G(n)("contentControlDropdownAriaLabel") : G(n)("contentControlDateAriaLabel"),
|
|
416
416
|
onMousedown: t[1] ||= q(() => {}, ["stop"])
|
|
417
|
-
}, [c.value.status === "dropdown" ? (V(), N("div",
|
|
417
|
+
}, [c.value.status === "dropdown" ? (V(), N("div", Ei, [c.value.items.length === 0 ? (V(), N("div", Di, W(G(n)("contentControlDropdownNoOptions")), 1)) : (V(!0), N(D, { key: 1 }, U(c.value.items, (e) => (V(), j(G(i), {
|
|
418
418
|
key: `${e.value}::${e.displayText}`,
|
|
419
419
|
"class-name": "content-control-picker__item",
|
|
420
420
|
type: "button",
|
|
@@ -431,9 +431,9 @@ var Si = ["aria-label"], Ci = {
|
|
|
431
431
|
value: c.value.currentValue,
|
|
432
432
|
"default-open": !0,
|
|
433
433
|
onChange: d
|
|
434
|
-
}, null, 8, ["value"])) : M("", !0)], 46,
|
|
434
|
+
}, null, 8, ["value"])) : M("", !0)], 46, Ti))]));
|
|
435
435
|
}
|
|
436
|
-
}), [["__scopeId", "data-v-19e067b7"]]),
|
|
436
|
+
}), [["__scopeId", "data-v-19e067b7"]]), ki = /* @__PURE__ */ I({
|
|
437
437
|
__name: "DecorationLayer",
|
|
438
438
|
props: {
|
|
439
439
|
getView: { type: Function },
|
|
@@ -468,7 +468,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
468
468
|
n.firstChild && n.replaceChildren();
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
|
-
let a =
|
|
471
|
+
let a = X(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
|
|
472
472
|
for (let { decoration: t, from: n, to: r } of i) {
|
|
473
473
|
if (n === r) {
|
|
474
474
|
let r = u(t, e);
|
|
@@ -545,10 +545,10 @@ var Si = ["aria-label"], Ci = {
|
|
|
545
545
|
"aria-hidden": "true"
|
|
546
546
|
}, null, 512));
|
|
547
547
|
}
|
|
548
|
-
}),
|
|
548
|
+
}), Ai = { class: "doc-outline__header" }, ji = { class: "doc-outline__body" }, Mi = {
|
|
549
549
|
key: 0,
|
|
550
550
|
class: "doc-outline__empty"
|
|
551
|
-
},
|
|
551
|
+
}, Ni = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
552
552
|
__name: "DocumentOutline",
|
|
553
553
|
props: {
|
|
554
554
|
isOpen: { type: Boolean },
|
|
@@ -577,7 +577,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
577
577
|
role: "navigation",
|
|
578
578
|
"aria-label": "Document outline",
|
|
579
579
|
onMousedown: n[1] ||= q(() => {}, ["stop"])
|
|
580
|
-
}, [P("div",
|
|
580
|
+
}, [P("div", Ai, [P("button", {
|
|
581
581
|
class: "doc-outline__back",
|
|
582
582
|
title: "Close outline",
|
|
583
583
|
"aria-label": "Close outline",
|
|
@@ -585,7 +585,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
585
585
|
}, [F(i, {
|
|
586
586
|
name: "arrow_back",
|
|
587
587
|
size: 20
|
|
588
|
-
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div",
|
|
588
|
+
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div", ji, [e.headings.length === 0 ? (V(), N("div", Mi, "No headings found")) : (V(), j(G(r), {
|
|
589
589
|
key: 1,
|
|
590
590
|
items: o.value,
|
|
591
591
|
"get-scroll-container": e.getScrollContainer ?? (() => null),
|
|
@@ -593,7 +593,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
593
593
|
"aria-label": "Document outline"
|
|
594
594
|
}, null, 8, ["items", "get-scroll-container"]))])], 36)) : M("", !0);
|
|
595
595
|
}
|
|
596
|
-
}), [["__scopeId", "data-v-0797b3b1"]]),
|
|
596
|
+
}), [["__scopeId", "data-v-0797b3b1"]]), Pi = /* @__PURE__ */ I({
|
|
597
597
|
__name: "DocxEditorDialogs",
|
|
598
598
|
props: {
|
|
599
599
|
view: {},
|
|
@@ -686,10 +686,10 @@ var Si = ["aria-label"], Ci = {
|
|
|
686
686
|
}, null, 8, ["is-open", "current-watermark"])
|
|
687
687
|
], 64));
|
|
688
688
|
}
|
|
689
|
-
}),
|
|
689
|
+
}), Fi = {
|
|
690
690
|
key: 0,
|
|
691
691
|
class: "docx-editor-vue__title-bar"
|
|
692
|
-
},
|
|
692
|
+
}, Ii = { class: "docx-editor-vue__title-bar-left" }, Li = { class: "docx-editor-vue__title-bar-center" }, Ri = { class: "docx-editor-vue__title-bar-right" }, zi = /* @__PURE__ */ I({
|
|
693
693
|
__name: "DocxEditorMenuBar",
|
|
694
694
|
props: {
|
|
695
695
|
showMenuBar: {
|
|
@@ -721,9 +721,9 @@ var Si = ["aria-label"], Ci = {
|
|
|
721
721
|
],
|
|
722
722
|
setup(e, { emit: t }) {
|
|
723
723
|
let n = t;
|
|
724
|
-
return (t, r) => e.showMenuBar ? (V(), N("div",
|
|
725
|
-
P("div",
|
|
726
|
-
P("div",
|
|
724
|
+
return (t, r) => e.showMenuBar ? (V(), N("div", Fi, [
|
|
725
|
+
P("div", Ii, [Me(t.$slots, "title-bar-left")]),
|
|
726
|
+
P("div", Li, [F(_, {
|
|
727
727
|
"model-value": e.documentName,
|
|
728
728
|
editable: e.documentNameEditable,
|
|
729
729
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
@@ -738,28 +738,28 @@ var Si = ["aria-label"], Ci = {
|
|
|
738
738
|
"show-help-menu",
|
|
739
739
|
"show-table-insert"
|
|
740
740
|
])]),
|
|
741
|
-
P("div",
|
|
741
|
+
P("div", Ri, [Me(t.$slots, "title-bar-right")])
|
|
742
742
|
])) : M("", !0);
|
|
743
743
|
}
|
|
744
|
-
}),
|
|
744
|
+
}), Bi = ["aria-label"], Vi = { class: "image-ctx-menu__icon" }, Hi = { class: "image-ctx-menu__label" }, Ui = {
|
|
745
745
|
key: 1,
|
|
746
746
|
class: "image-ctx-menu__divider",
|
|
747
747
|
role: "separator"
|
|
748
|
-
},
|
|
748
|
+
}, Wi = [
|
|
749
749
|
"data-wrap-type",
|
|
750
750
|
"data-current",
|
|
751
751
|
"data-disabled",
|
|
752
752
|
"disabled",
|
|
753
753
|
"title",
|
|
754
754
|
"onClick"
|
|
755
|
-
],
|
|
755
|
+
], Gi = { class: "image-ctx-menu__icon" }, Ki = { class: "image-ctx-menu__label" }, qi = ["aria-label"], Ji = ["disabled", "onClick"], Yi = { class: "image-ctx-menu__label" }, Xi = {
|
|
756
756
|
key: 0,
|
|
757
757
|
class: "image-ctx-menu__shortcut"
|
|
758
|
-
},
|
|
758
|
+
}, Zi = {
|
|
759
759
|
key: 0,
|
|
760
760
|
class: "image-ctx-menu__divider",
|
|
761
761
|
role: "separator"
|
|
762
|
-
},
|
|
762
|
+
}, Qi = 18, $i = 260, ea = 10, ta = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
763
763
|
__name: "ImageContextMenu",
|
|
764
764
|
props: {
|
|
765
765
|
state: {},
|
|
@@ -780,7 +780,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
780
780
|
function o() {
|
|
781
781
|
a("open-properties"), a("close");
|
|
782
782
|
}
|
|
783
|
-
let { t: s } = r(), c =
|
|
783
|
+
let { t: s } = r(), c = wi(), l = Ft, u = k(() => n.state ? Lt(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
|
|
784
784
|
inline: "wrap_text",
|
|
785
785
|
squareLeft: "format_image_left",
|
|
786
786
|
squareRight: "format_image_right",
|
|
@@ -792,17 +792,17 @@ var Si = ["aria-label"], Ci = {
|
|
|
792
792
|
}
|
|
793
793
|
let p = k(() => {
|
|
794
794
|
if (!n.state) return {};
|
|
795
|
-
let e =
|
|
796
|
-
return typeof window < "u" && (t +
|
|
795
|
+
let e = Ft.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
796
|
+
return typeof window < "u" && (t + $i > window.innerWidth && (t = window.innerWidth - $i - ea), r + e > window.innerHeight && (r = window.innerHeight - e - ea), t < ea && (t = ea), r < ea && (r = ea)), {
|
|
797
797
|
position: "fixed",
|
|
798
798
|
left: `${t}px`,
|
|
799
799
|
top: `${r}px`,
|
|
800
|
-
minWidth: `${
|
|
800
|
+
minWidth: `${$i}px`,
|
|
801
801
|
zIndex: 400
|
|
802
802
|
};
|
|
803
803
|
});
|
|
804
804
|
function m(e) {
|
|
805
|
-
return n.state ?
|
|
805
|
+
return n.state ? zt(e, n.state.currentWrapType) : !1;
|
|
806
806
|
}
|
|
807
807
|
function h(e) {
|
|
808
808
|
m(e) && (a("select", e.choice), a("close"));
|
|
@@ -839,11 +839,11 @@ var Si = ["aria-label"], Ci = {
|
|
|
839
839
|
"data-action": "open-properties",
|
|
840
840
|
onMousedown: n[1] ||= q(() => {}, ["prevent"]),
|
|
841
841
|
onClick: o
|
|
842
|
-
}, [P("span",
|
|
842
|
+
}, [P("span", Vi, [F(i, {
|
|
843
843
|
name: "settings",
|
|
844
|
-
size:
|
|
845
|
-
})]), P("span",
|
|
846
|
-
e.canOpenProperties ? (V(), N("div",
|
|
844
|
+
size: Qi
|
|
845
|
+
})]), P("span", Hi, W(G(s)("imageWrap.menu.imageProperties")), 1)], 32)) : M("", !0),
|
|
846
|
+
e.canOpenProperties ? (V(), N("div", Ui)) : M("", !0),
|
|
847
847
|
(V(!0), N(D, null, U(G(l), (e) => (V(), N("button", {
|
|
848
848
|
key: e.choice,
|
|
849
849
|
type: "button",
|
|
@@ -857,17 +857,17 @@ var Si = ["aria-label"], Ci = {
|
|
|
857
857
|
onMousedown: n[2] ||= q(() => {}, ["prevent"]),
|
|
858
858
|
onClick: (t) => h(e)
|
|
859
859
|
}, [
|
|
860
|
-
P("span",
|
|
860
|
+
P("span", Gi, [F(i, {
|
|
861
861
|
name: f(e.iconHint),
|
|
862
|
-
size:
|
|
862
|
+
size: Qi
|
|
863
863
|
}, null, 8, ["name"])]),
|
|
864
|
-
P("span",
|
|
864
|
+
P("span", Ki, W(G(s)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
865
865
|
e.choice === u.value ? (V(), N("span", {
|
|
866
866
|
key: 0,
|
|
867
867
|
class: "image-ctx-menu__current-dot",
|
|
868
868
|
"aria-label": G(s)("imageWrap.menu.ariaLabel")
|
|
869
|
-
}, "●", 8,
|
|
870
|
-
], 42,
|
|
869
|
+
}, "●", 8, qi)) : M("", !0)
|
|
870
|
+
], 42, Wi))), 128)),
|
|
871
871
|
e.textActions && e.textActions.length > 0 ? (V(), N(D, { key: 2 }, [n[5] ||= P("div", {
|
|
872
872
|
class: "image-ctx-menu__divider",
|
|
873
873
|
role: "separator"
|
|
@@ -878,16 +878,16 @@ var Si = ["aria-label"], Ci = {
|
|
|
878
878
|
disabled: e.disabled,
|
|
879
879
|
onMousedown: n[3] ||= q(() => {}, ["prevent"]),
|
|
880
880
|
onClick: (t) => g(e)
|
|
881
|
-
}, [P("span",
|
|
882
|
-
], 46,
|
|
881
|
+
}, [P("span", Yi, W(e.label), 1), e.shortcut ? (V(), N("span", Xi, W(e.shortcut), 1)) : M("", !0)], 40, Ji), e.dividerAfter ? (V(), N("div", Zi)) : M("", !0)], 64))), 128))], 64)) : M("", !0)
|
|
882
|
+
], 46, Bi)) : M("", !0)]));
|
|
883
883
|
}
|
|
884
|
-
}), [["__scopeId", "data-v-fc8f35bc"]]),
|
|
884
|
+
}), [["__scopeId", "data-v-fc8f35bc"]]), na = ["disabled", "onMousedown"], ra = {
|
|
885
885
|
key: 0,
|
|
886
886
|
class: "ctx-menu__icon"
|
|
887
|
-
},
|
|
887
|
+
}, ia = { class: "ctx-menu__label" }, aa = {
|
|
888
888
|
key: 1,
|
|
889
889
|
class: "ctx-menu__shortcut"
|
|
890
|
-
},
|
|
890
|
+
}, oa = 220, sa = 32, ca = 10, la = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
891
891
|
__name: "TextContextMenu",
|
|
892
892
|
props: {
|
|
893
893
|
isOpen: { type: Boolean },
|
|
@@ -904,7 +904,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
904
904
|
setup(e, { emit: t }) {
|
|
905
905
|
let n = e, i = ({ node: e }) => e;
|
|
906
906
|
i.props = ["node"];
|
|
907
|
-
let a = t, { t: o } = r(), s =
|
|
907
|
+
let a = t, { t: o } = r(), s = wi(), c = H(null), l = k(() => {
|
|
908
908
|
let e = [], t = n.customItems ?? [];
|
|
909
909
|
for (let [n, r] of t.entries()) e.push({
|
|
910
910
|
id: `custom-${r.id}`,
|
|
@@ -1040,8 +1040,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
1040
1040
|
action: "deleteTable"
|
|
1041
1041
|
}), e;
|
|
1042
1042
|
}), u = k(() => {
|
|
1043
|
-
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 *
|
|
1044
|
-
return typeof window < "u" && (e +
|
|
1043
|
+
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 * sa + i * 9;
|
|
1044
|
+
return typeof window < "u" && (e + oa + ca > window.innerWidth && (e = window.innerWidth - oa - ca), t + a + ca > window.innerHeight && (t = window.innerHeight - a - ca)), {
|
|
1045
1045
|
position: "fixed",
|
|
1046
1046
|
left: `${e}px`,
|
|
1047
1047
|
top: `${t}px`,
|
|
@@ -1079,12 +1079,12 @@ var Si = ["aria-label"], Ci = {
|
|
|
1079
1079
|
disabled: e.disabled,
|
|
1080
1080
|
onMousedown: q((t) => d(e.action), ["prevent"])
|
|
1081
1081
|
}, [
|
|
1082
|
-
e.icon ? (V(), N("span",
|
|
1083
|
-
P("span",
|
|
1084
|
-
e.shortcut ? (V(), N("span",
|
|
1085
|
-
], 42,
|
|
1082
|
+
e.icon ? (V(), N("span", ra, [F(i, { node: e.icon }, null, 8, ["node"])])) : M("", !0),
|
|
1083
|
+
P("span", ia, W(e.label), 1),
|
|
1084
|
+
e.shortcut ? (V(), N("span", aa, W(e.shortcut), 1)) : M("", !0)
|
|
1085
|
+
], 42, na))), 128))], 38)) : M("", !0)]));
|
|
1086
1086
|
}
|
|
1087
|
-
}), [["__scopeId", "data-v-c1416e84"]]),
|
|
1087
|
+
}), [["__scopeId", "data-v-c1416e84"]]), ua = /* @__PURE__ */ I({
|
|
1088
1088
|
__name: "DocxEditorOverlays",
|
|
1089
1089
|
props: {
|
|
1090
1090
|
readOnly: { type: Boolean },
|
|
@@ -1103,7 +1103,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
1103
1103
|
],
|
|
1104
1104
|
setup(e, { emit: t }) {
|
|
1105
1105
|
let n = t;
|
|
1106
|
-
return (t, r) => (V(), N(D, null, [F(
|
|
1106
|
+
return (t, r) => (V(), N(D, null, [F(la, {
|
|
1107
1107
|
"is-open": e.contextMenu.isOpen,
|
|
1108
1108
|
position: e.contextMenu.position,
|
|
1109
1109
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -1125,7 +1125,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
1125
1125
|
"can-merge-cells",
|
|
1126
1126
|
"can-split-cell",
|
|
1127
1127
|
"custom-items"
|
|
1128
|
-
]), F(
|
|
1128
|
+
]), F(ta, {
|
|
1129
1129
|
state: e.imageContextMenu,
|
|
1130
1130
|
"text-actions": e.imageContextMenuTextActions,
|
|
1131
1131
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -1142,7 +1142,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
1142
1142
|
});
|
|
1143
1143
|
//#endregion
|
|
1144
1144
|
//#region src/composables/imageOverlayRect.ts
|
|
1145
|
-
function
|
|
1145
|
+
function da(e) {
|
|
1146
1146
|
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
1147
1147
|
return {
|
|
1148
1148
|
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
@@ -1153,13 +1153,13 @@ function ca(e) {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
//#endregion
|
|
1155
1155
|
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
1156
|
-
var
|
|
1156
|
+
var fa = ["data-handle", "onMousedown"], pa = ["title"], ma = {
|
|
1157
1157
|
key: 0,
|
|
1158
1158
|
class: "image-overlay__dim"
|
|
1159
|
-
},
|
|
1159
|
+
}, ha = {
|
|
1160
1160
|
key: 1,
|
|
1161
1161
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
1162
|
-
},
|
|
1162
|
+
}, ga = 4, _a = 15, va = 250, ya = 700, ba = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1163
1163
|
__name: "ImageSelectionOverlay",
|
|
1164
1164
|
props: {
|
|
1165
1165
|
imageInfo: {},
|
|
@@ -1197,8 +1197,8 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1197
1197
|
if (e.element.isConnected) return e.element;
|
|
1198
1198
|
let t = re();
|
|
1199
1199
|
if (!t) return null;
|
|
1200
|
-
let n =
|
|
1201
|
-
return n ?
|
|
1200
|
+
let n = Xt(t, e.pmPos);
|
|
1201
|
+
return n ? Rt(n) : null;
|
|
1202
1202
|
}
|
|
1203
1203
|
function S() {
|
|
1204
1204
|
let e = ie();
|
|
@@ -1212,7 +1212,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1212
1212
|
return;
|
|
1213
1213
|
}
|
|
1214
1214
|
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
1215
|
-
p.value =
|
|
1215
|
+
p.value = da({
|
|
1216
1216
|
imageRect: r,
|
|
1217
1217
|
parentRect: n,
|
|
1218
1218
|
scrollLeft: t.scrollLeft,
|
|
@@ -1230,10 +1230,10 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1230
1230
|
let o = a - r;
|
|
1231
1231
|
S();
|
|
1232
1232
|
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
1233
|
-
n = c === t ? n + 1 : 0, t = c, !(o >=
|
|
1233
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= va && n >= 2) && o < ya && (e = requestAnimationFrame(i));
|
|
1234
1234
|
};
|
|
1235
1235
|
e = requestAnimationFrame(i);
|
|
1236
|
-
let a = setTimeout(S,
|
|
1236
|
+
let a = setTimeout(S, va);
|
|
1237
1237
|
oe = () => {
|
|
1238
1238
|
cancelAnimationFrame(e), clearTimeout(a);
|
|
1239
1239
|
};
|
|
@@ -1358,7 +1358,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1358
1358
|
!i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove", fe), document.addEventListener("mouseup", w));
|
|
1359
1359
|
}
|
|
1360
1360
|
function fe(e) {
|
|
1361
|
-
let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o =
|
|
1361
|
+
let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = Gt(m, n, r, _, v, a);
|
|
1362
1362
|
u.value = Math.round(o.width), d.value = Math.round(o.height);
|
|
1363
1363
|
let s = y;
|
|
1364
1364
|
if (s) {
|
|
@@ -1378,7 +1378,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1378
1378
|
S();
|
|
1379
1379
|
return;
|
|
1380
1380
|
}
|
|
1381
|
-
let n =
|
|
1381
|
+
let n = Jt(e, t.pmPos, u.value, d.value);
|
|
1382
1382
|
n !== null && Ce(n), ke(() => S());
|
|
1383
1383
|
}
|
|
1384
1384
|
let pe = 0, me = 0, he = 0, ge = 0, T = null, E = null;
|
|
@@ -1401,7 +1401,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
function xe(e) {
|
|
1403
1403
|
let t = ye(e.clientX, e.clientY) - he, n = ge + t;
|
|
1404
|
-
e.shiftKey || (n = Math.round(n /
|
|
1404
|
+
e.shiftKey || (n = Math.round(n / _a) * _a), f.value = (n % 360 + 360) % 360, E && (E.style.transform = ve(T, f.value) || "");
|
|
1405
1405
|
}
|
|
1406
1406
|
function Se() {
|
|
1407
1407
|
document.removeEventListener("mousemove", xe), document.removeEventListener("mouseup", Se), l.value = !1, a("interact-end");
|
|
@@ -1422,7 +1422,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1422
1422
|
if (!i.imageInfo || !p.value) return;
|
|
1423
1423
|
let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
|
|
1424
1424
|
let s = e.clientX - t, l = e.clientY - n;
|
|
1425
|
-
if (!(!o && Math.sqrt(s * s + l * l) <
|
|
1425
|
+
if (!(!o && Math.sqrt(s * s + l * l) < ga)) {
|
|
1426
1426
|
if (!o) {
|
|
1427
1427
|
o = !0, c.value = !0, a("interact-start"), O = document.createElement("div"), O.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);";
|
|
1428
1428
|
let e = i.zoom;
|
|
@@ -1444,7 +1444,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1444
1444
|
let a = te(n, r.pmPos);
|
|
1445
1445
|
if (!a) return;
|
|
1446
1446
|
let s;
|
|
1447
|
-
if (
|
|
1447
|
+
if (Yt(a)) {
|
|
1448
1448
|
let a = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
|
|
1449
1449
|
if (!a || a.length === 0) return;
|
|
1450
1450
|
let c = null;
|
|
@@ -1460,21 +1460,21 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1460
1460
|
c = e ? e.querySelector(".layout-page-content") : null;
|
|
1461
1461
|
}
|
|
1462
1462
|
if (!c) return;
|
|
1463
|
-
let l = c.getBoundingClientRect(), u = i.zoom, d =
|
|
1464
|
-
s =
|
|
1463
|
+
let l = c.getBoundingClientRect(), u = i.zoom, d = Pt((e - l.left) / u), f = Pt((t - l.top) / u);
|
|
1464
|
+
s = Kt(n, r.pmPos, d, f);
|
|
1465
1465
|
} else {
|
|
1466
1466
|
let i = re();
|
|
1467
1467
|
if (!i) return;
|
|
1468
|
-
let a =
|
|
1468
|
+
let a = Ut(i, e, t, 1);
|
|
1469
1469
|
if (a == null || a < 0) return;
|
|
1470
|
-
s =
|
|
1470
|
+
s = qt(n, r.pmPos, a);
|
|
1471
1471
|
}
|
|
1472
1472
|
s !== null && Ce(s), ke(() => S());
|
|
1473
1473
|
}
|
|
1474
1474
|
function Ce(e) {
|
|
1475
1475
|
let t = i.view;
|
|
1476
1476
|
if (t) try {
|
|
1477
|
-
let n =
|
|
1477
|
+
let n = Mt.create(t.state.doc, e);
|
|
1478
1478
|
t.dispatch(t.state.tr.setSelection(n));
|
|
1479
1479
|
} catch {}
|
|
1480
1480
|
}
|
|
@@ -1501,19 +1501,19 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1501
1501
|
style: R(e.style),
|
|
1502
1502
|
"data-handle": e.pos,
|
|
1503
1503
|
onMousedown: q((t) => de(t, e.pos), ["prevent", "stop"])
|
|
1504
|
-
}, null, 44,
|
|
1504
|
+
}, null, 44, fa))), 128)),
|
|
1505
1505
|
r[5] ||= P("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
1506
1506
|
P("div", {
|
|
1507
1507
|
class: "image-overlay__rotate-handle",
|
|
1508
1508
|
style: R({ left: `${C.value / 2 - 7}px` }),
|
|
1509
1509
|
title: G(n)("imageOverlay.rotate"),
|
|
1510
1510
|
onMousedown: r[2] ||= q((e) => be(e), ["prevent", "stop"])
|
|
1511
|
-
}, null, 44,
|
|
1512
|
-
s.value ? (V(), N("div",
|
|
1513
|
-
l.value ? (V(), N("div",
|
|
1511
|
+
}, null, 44, pa),
|
|
1512
|
+
s.value ? (V(), N("div", ma, W(Math.round(u.value)) + " × " + W(Math.round(d.value)), 1)) : M("", !0),
|
|
1513
|
+
l.value ? (V(), N("div", ha, W(Math.round(f.value)) + "° ", 1)) : M("", !0)
|
|
1514
1514
|
], 36)) : M("", !0);
|
|
1515
1515
|
}
|
|
1516
|
-
}), [["__scopeId", "data-v-4c3d1a1d"]]),
|
|
1516
|
+
}), [["__scopeId", "data-v-4c3d1a1d"]]), xa = /* @__PURE__ */ I({
|
|
1517
1517
|
__name: "HeaderFooterSelectionOverlay",
|
|
1518
1518
|
props: {
|
|
1519
1519
|
pagesContainer: {},
|
|
@@ -1523,11 +1523,11 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1523
1523
|
zoom: {}
|
|
1524
1524
|
},
|
|
1525
1525
|
setup(e) {
|
|
1526
|
-
let t = e, n = new
|
|
1526
|
+
let t = e, n = new tn(), r = () => {
|
|
1527
1527
|
if (!t.pagesContainer) return;
|
|
1528
1528
|
n.sync(t.pagesContainer, t.selection, t.zoom);
|
|
1529
1529
|
let e = t.pagesContainer.querySelector("[data-testid='hf-caret']")?.getBoundingClientRect();
|
|
1530
|
-
|
|
1530
|
+
$t({
|
|
1531
1531
|
hiddenHost: t.hiddenContainer,
|
|
1532
1532
|
editorView: t.editorView,
|
|
1533
1533
|
visibleCaret: e ? {
|
|
@@ -1537,8 +1537,8 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1537
1537
|
});
|
|
1538
1538
|
};
|
|
1539
1539
|
K(() => t.pagesContainer, (e, t, i) => {
|
|
1540
|
-
e && (e.addEventListener(
|
|
1541
|
-
e.removeEventListener(
|
|
1540
|
+
e && (e.addEventListener(en, r), r(), i(() => {
|
|
1541
|
+
e.removeEventListener(en, r), n.clear(e);
|
|
1542
1542
|
}));
|
|
1543
1543
|
}, { immediate: !0 }), K(() => [
|
|
1544
1544
|
t.selection?.rId,
|
|
@@ -1560,10 +1560,10 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1560
1560
|
});
|
|
1561
1561
|
}, o = typeof window > "u" ? null : window;
|
|
1562
1562
|
return o?.addEventListener("scroll", a, !0), B(() => {
|
|
1563
|
-
i !== null && cancelAnimationFrame(i), o?.removeEventListener("scroll", a, !0),
|
|
1563
|
+
i !== null && cancelAnimationFrame(i), o?.removeEventListener("scroll", a, !0), Qt(t.hiddenContainer);
|
|
1564
1564
|
}), (e, t) => null;
|
|
1565
1565
|
}
|
|
1566
|
-
}),
|
|
1566
|
+
}), Sa = { class: "hf-editor-label" }, Ca = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1567
1567
|
__name: "InlineHeaderFooterEditor",
|
|
1568
1568
|
props: {
|
|
1569
1569
|
edit: {},
|
|
@@ -1581,7 +1581,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1581
1581
|
zIndex: 10
|
|
1582
1582
|
})), u = (e) => {
|
|
1583
1583
|
s.value = !1;
|
|
1584
|
-
let t = n.getView(), r =
|
|
1584
|
+
let t = n.getView(), r = J.nodes.field;
|
|
1585
1585
|
if (!t || !r) return;
|
|
1586
1586
|
let { $from: i, from: a } = t.state.selection, o = t.state.storedMarks ?? i.marks(), c = r.create({
|
|
1587
1587
|
fieldType: e,
|
|
@@ -1606,7 +1606,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1606
1606
|
class: "hf-inline-editor",
|
|
1607
1607
|
style: R(l.value),
|
|
1608
1608
|
role: "presentation"
|
|
1609
|
-
}, [P("div", { class: L(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span",
|
|
1609
|
+
}, [P("div", { class: L(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span", Sa, W(c.value), 1), P("div", {
|
|
1610
1610
|
class: "hf-options",
|
|
1611
1611
|
onMousedown: n[5] ||= q(() => {}, ["stop"])
|
|
1612
1612
|
}, [F(G(a), {
|
|
@@ -1656,7 +1656,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1656
1656
|
})
|
|
1657
1657
|
], 2)) : M("", !0)], 32)], 2)], 4));
|
|
1658
1658
|
}
|
|
1659
|
-
}), [["__scopeId", "data-v-a0bd3730"]]),
|
|
1659
|
+
}), [["__scopeId", "data-v-a0bd3730"]]), wa = ["title", "aria-label"], Ta = /* @__PURE__ */ I({
|
|
1660
1660
|
__name: "OutlineToggleButton",
|
|
1661
1661
|
props: {
|
|
1662
1662
|
leftOffset: {},
|
|
@@ -1679,9 +1679,9 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1679
1679
|
}, [F(i, {
|
|
1680
1680
|
name: "format_list_bulleted",
|
|
1681
1681
|
size: 20
|
|
1682
|
-
})], 44,
|
|
1682
|
+
})], 44, wa));
|
|
1683
1683
|
}
|
|
1684
|
-
}),
|
|
1684
|
+
}), Ea = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1685
1685
|
__name: "PageIndicator",
|
|
1686
1686
|
props: {
|
|
1687
1687
|
currentPage: {},
|
|
@@ -1700,7 +1700,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1700
1700
|
total: e.totalPages
|
|
1701
1701
|
})), 5));
|
|
1702
1702
|
}
|
|
1703
|
-
}), [["__scopeId", "data-v-f1904974"]]),
|
|
1703
|
+
}), [["__scopeId", "data-v-f1904974"]]), Da = ["data-folio-block-id"], Oa = ["data-folio-block-id", "title"], ka = 2.5, Aa = 5, ja = 6, Ma = 2, Na = 2, Pa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1704
1704
|
__name: "TemplateDirectivesOverlay",
|
|
1705
1705
|
props: {
|
|
1706
1706
|
getView: { type: Function },
|
|
@@ -1714,19 +1714,19 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1714
1714
|
setup(e) {
|
|
1715
1715
|
let t = e, n = /* @__PURE__ */ new Set(["if", "for"]), r = /* @__PURE__ */ new Set(["endif", "endfor"]), i = (e) => e === "for" ? "for" : "if";
|
|
1716
1716
|
function a(e) {
|
|
1717
|
-
let t = e -
|
|
1718
|
-
return t <= 0 ? 0 : Math.floor(t /
|
|
1717
|
+
let t = e - ja - ka - Ma;
|
|
1718
|
+
return t <= 0 ? 0 : Math.floor(t / Aa);
|
|
1719
1719
|
}
|
|
1720
1720
|
function o(e, t, n) {
|
|
1721
1721
|
let r = a(n), i = Math.min(Math.max(0, e), r);
|
|
1722
|
-
return t -
|
|
1722
|
+
return t - ja - ka - (r - i) * Aa;
|
|
1723
1723
|
}
|
|
1724
1724
|
function s(e, t) {
|
|
1725
|
-
if (t.length === 0) return e.bottom - e.top >=
|
|
1725
|
+
if (t.length === 0) return e.bottom - e.top >= Na ? [e] : [];
|
|
1726
1726
|
let n = [];
|
|
1727
1727
|
for (let r of t) {
|
|
1728
1728
|
let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
|
|
1729
|
-
i - t >=
|
|
1729
|
+
i - t >= Na && n.push({
|
|
1730
1730
|
top: t,
|
|
1731
1731
|
bottom: i
|
|
1732
1732
|
});
|
|
@@ -1791,7 +1791,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1791
1791
|
}
|
|
1792
1792
|
return i;
|
|
1793
1793
|
}
|
|
1794
|
-
let f = H([]), p = H([]), m = H(null), h = H(null), g = H(null), _ =
|
|
1794
|
+
let f = H([]), p = H([]), m = H(null), h = H(null), g = H(null), _ = dt(), v = null;
|
|
1795
1795
|
function y() {
|
|
1796
1796
|
v !== null && cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
1797
1797
|
v = null, b();
|
|
@@ -1803,12 +1803,12 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1803
1803
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1804
1804
|
return;
|
|
1805
1805
|
}
|
|
1806
|
-
let a =
|
|
1806
|
+
let a = rn(i);
|
|
1807
1807
|
if (a.length === 0) {
|
|
1808
1808
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1809
1809
|
return;
|
|
1810
1810
|
}
|
|
1811
|
-
let o =
|
|
1811
|
+
let o = ft(r, t.zoom), s = await pt(a, {
|
|
1812
1812
|
pagesContainer: r,
|
|
1813
1813
|
zoom: t.zoom,
|
|
1814
1814
|
layout: t.layout,
|
|
@@ -1888,10 +1888,10 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1888
1888
|
position: "absolute",
|
|
1889
1889
|
left: `${t.railX * e.zoom}px`,
|
|
1890
1890
|
top: `${n.top * e.zoom}px`,
|
|
1891
|
-
width: `${
|
|
1891
|
+
width: `${ka * e.zoom}px`,
|
|
1892
1892
|
height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
|
|
1893
1893
|
})
|
|
1894
|
-
}, null, 14,
|
|
1894
|
+
}, null, 14, Da))), 128))], 64))), 128)), (V(!0), N(D, null, U(p.value, (t, n) => (V(), N(D, { key: `d:${n}` }, [(V(!0), N(D, null, U(t.rects, (r, i) => (V(), N("span", {
|
|
1895
1895
|
key: `d:${n}:${i}`,
|
|
1896
1896
|
class: L(se(t.range)),
|
|
1897
1897
|
"data-folio-block-id": S(t.range),
|
|
@@ -1903,9 +1903,9 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1903
1903
|
width: `${(r.width + 2) * e.zoom}px`,
|
|
1904
1904
|
height: `${Math.max(0, r.height - 2) * e.zoom}px`
|
|
1905
1905
|
})
|
|
1906
|
-
}, null, 14,
|
|
1906
|
+
}, null, 14, Oa))), 128))], 64))), 128))], 32));
|
|
1907
1907
|
}
|
|
1908
|
-
}), [["__scopeId", "data-v-101928bf"]]),
|
|
1908
|
+
}), [["__scopeId", "data-v-101928bf"]]), Fa = ["href", "title"], Ia = ["title"], La = ["title"], Ra = ["title"], za = { class: "docx-hyperlink-popup__edit-row" }, Ba = ["placeholder", "onKeydown"], Va = { class: "docx-hyperlink-popup__edit-row" }, Ha = ["onKeydown"], Ua = ["disabled"], Wa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1909
1909
|
__name: "HyperlinkPopup",
|
|
1910
1910
|
props: {
|
|
1911
1911
|
data: {},
|
|
@@ -1954,28 +1954,28 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1954
1954
|
class: L(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
|
|
1955
1955
|
style: R(u.value),
|
|
1956
1956
|
onMousedown: r[6] ||= q(() => {}, ["stop"])
|
|
1957
|
-
}, [o.value ? (V(), N(D, { key: 1 }, [P("div",
|
|
1957
|
+
}, [o.value ? (V(), N(D, { key: 1 }, [P("div", za, [Le(P("input", {
|
|
1958
1958
|
class: "docx-hyperlink-popup__input",
|
|
1959
1959
|
placeholder: G(n)("displayText"),
|
|
1960
1960
|
"onUpdate:modelValue": r[2] ||= (e) => s.value = e,
|
|
1961
1961
|
onKeydown: [Re(q(h, ["prevent"]), ["enter"]), r[3] ||= Re((e) => t.$emit("close"), ["esc"])]
|
|
1962
|
-
}, null, 40,
|
|
1962
|
+
}, null, 40, Ba), [[Pe, s.value]])]), P("div", Va, [Le(P("input", {
|
|
1963
1963
|
class: "docx-hyperlink-popup__input",
|
|
1964
1964
|
placeholder: "https://...",
|
|
1965
1965
|
"onUpdate:modelValue": r[4] ||= (e) => c.value = e,
|
|
1966
1966
|
onKeydown: [Re(q(h, ["prevent"]), ["enter"]), r[5] ||= Re((e) => t.$emit("close"), ["esc"])]
|
|
1967
|
-
}, null, 40,
|
|
1967
|
+
}, null, 40, Ha), [[Pe, c.value]]), P("button", {
|
|
1968
1968
|
class: "docx-hyperlink-popup__apply",
|
|
1969
1969
|
disabled: !c.value.trim(),
|
|
1970
1970
|
onClick: q(h, ["prevent"])
|
|
1971
|
-
}, W(G(n)("common.apply")), 9,
|
|
1971
|
+
}, W(G(n)("common.apply")), 9, Ua)])], 64)) : (V(), N(D, { key: 0 }, [
|
|
1972
1972
|
r[10] ||= we("<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),
|
|
1973
1973
|
P("a", {
|
|
1974
1974
|
class: "docx-hyperlink-popup__url",
|
|
1975
1975
|
href: e.data.href,
|
|
1976
1976
|
title: e.data.href,
|
|
1977
1977
|
onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1978
|
-
}, W(e.data.href), 9,
|
|
1978
|
+
}, W(e.data.href), 9, Fa),
|
|
1979
1979
|
r[11] ||= P("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1980
1980
|
P("button", {
|
|
1981
1981
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1997,7 +1997,7 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
1997
1997
|
height: "13",
|
|
1998
1998
|
rx: "2",
|
|
1999
1999
|
ry: "2"
|
|
2000
|
-
}), P("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8,
|
|
2000
|
+
}), P("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Ia),
|
|
2001
2001
|
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
2002
2002
|
key: 0,
|
|
2003
2003
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -2012,43 +2012,43 @@ var la = ["data-handle", "onMousedown"], ua = ["title"], da = {
|
|
|
2012
2012
|
"stroke-width": "2",
|
|
2013
2013
|
"stroke-linecap": "round",
|
|
2014
2014
|
"stroke-linejoin": "round"
|
|
2015
|
-
}, [P("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), P("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8,
|
|
2015
|
+
}, [P("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), P("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, La)),
|
|
2016
2016
|
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
2017
2017
|
key: 1,
|
|
2018
2018
|
class: "docx-hyperlink-popup__btn",
|
|
2019
2019
|
title: G(n)("removeLink"),
|
|
2020
2020
|
onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
|
|
2021
|
-
}, [...r[9] ||= [we("<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,
|
|
2021
|
+
}, [...r[9] ||= [we("<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, Ra))
|
|
2022
2022
|
], 64))], 38)) : M("", !0);
|
|
2023
2023
|
}
|
|
2024
2024
|
}), [["__scopeId", "data-v-366df18c"]]);
|
|
2025
2025
|
//#endregion
|
|
2026
2026
|
//#region src/composables/commentMarks.ts
|
|
2027
|
-
function
|
|
2027
|
+
function Ga(e, t) {
|
|
2028
2028
|
let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
|
|
2029
2029
|
return n === r ? null : {
|
|
2030
2030
|
from: n,
|
|
2031
2031
|
to: r
|
|
2032
2032
|
};
|
|
2033
2033
|
}
|
|
2034
|
-
function
|
|
2034
|
+
function Ka({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
|
|
2035
2035
|
let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
|
|
2036
|
-
return i ?
|
|
2036
|
+
return i ? Ga(e, i) : null;
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2039
|
-
let i = e.state.schema.marks.comment, a =
|
|
2038
|
+
function qa(e, t, n, r) {
|
|
2039
|
+
let i = e.state.schema.marks.comment, a = Ga(e.state.doc.content.size, t);
|
|
2040
2040
|
if (!i || !a) return !1;
|
|
2041
2041
|
let o = e.state.tr;
|
|
2042
|
-
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId:
|
|
2042
|
+
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: un }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(Nt.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2045
|
-
let n = e.state.schema.marks.comment, r =
|
|
2046
|
-
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId:
|
|
2044
|
+
function Ja(e, t) {
|
|
2045
|
+
let n = e.state.schema.marks.comment, r = Ga(e.state.doc.content.size, t);
|
|
2046
|
+
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: un })));
|
|
2047
2047
|
}
|
|
2048
2048
|
//#endregion
|
|
2049
2049
|
//#region src/composables/useCommentLifecycle.ts
|
|
2050
|
-
var
|
|
2051
|
-
function
|
|
2050
|
+
var Ya = 408, Xa = 12;
|
|
2051
|
+
function Za(e) {
|
|
2052
2052
|
let t = H(!1), n = H(null), r = H(null), i = H(null), a = H(null);
|
|
2053
2053
|
function o(t) {
|
|
2054
2054
|
let n = e.editorView.value, r = e.pagesContainer.value;
|
|
@@ -2081,7 +2081,7 @@ function Ja(e) {
|
|
|
2081
2081
|
r.value = null;
|
|
2082
2082
|
return;
|
|
2083
2083
|
}
|
|
2084
|
-
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left +
|
|
2084
|
+
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + Xa : l.width / 2 + Ya;
|
|
2085
2085
|
r.value = {
|
|
2086
2086
|
top: c.top - l.top,
|
|
2087
2087
|
left: Math.max(16, Math.min(d, l.width - 16)),
|
|
@@ -2092,7 +2092,7 @@ function Ja(e) {
|
|
|
2092
2092
|
function c() {
|
|
2093
2093
|
let s = e.editorView.value;
|
|
2094
2094
|
if (!s) return;
|
|
2095
|
-
let c = r.value, l = s.state.selection, u =
|
|
2095
|
+
let c = r.value, l = s.state.selection, u = Ka({
|
|
2096
2096
|
docSize: s.state.doc.content.size,
|
|
2097
2097
|
capturedRange: c ? {
|
|
2098
2098
|
from: c.from,
|
|
@@ -2111,7 +2111,7 @@ function Ja(e) {
|
|
|
2111
2111
|
r.value = null;
|
|
2112
2112
|
return;
|
|
2113
2113
|
}
|
|
2114
|
-
if (!
|
|
2114
|
+
if (!qa(s, u, un, { selectEnd: !0 })) {
|
|
2115
2115
|
r.value = null, i.value = null;
|
|
2116
2116
|
return;
|
|
2117
2117
|
}
|
|
@@ -2124,11 +2124,11 @@ function Ja(e) {
|
|
|
2124
2124
|
let n = e.editorView.value, r = i.value;
|
|
2125
2125
|
if (!n || !r) return !1;
|
|
2126
2126
|
let a = e.createComment(t);
|
|
2127
|
-
return
|
|
2127
|
+
return qa(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
|
|
2128
2128
|
}
|
|
2129
2129
|
function d() {
|
|
2130
2130
|
let t = e.editorView.value;
|
|
2131
|
-
t && i.value &&
|
|
2131
|
+
t && i.value && Ja(t, i.value), l();
|
|
2132
2132
|
}
|
|
2133
2133
|
return {
|
|
2134
2134
|
isAddingComment: t,
|
|
@@ -2142,8 +2142,8 @@ function Ja(e) {
|
|
|
2142
2142
|
}
|
|
2143
2143
|
//#endregion
|
|
2144
2144
|
//#region src/composables/useCommentManagement.ts
|
|
2145
|
-
function
|
|
2146
|
-
let t =
|
|
2145
|
+
function Qa(e) {
|
|
2146
|
+
let t = dn(), n = H([]), r = H(!1);
|
|
2147
2147
|
function i() {
|
|
2148
2148
|
r.value = !0;
|
|
2149
2149
|
}
|
|
@@ -2158,12 +2158,12 @@ function Ya(e) {
|
|
|
2158
2158
|
i(), c([...s.value, e]);
|
|
2159
2159
|
}
|
|
2160
2160
|
function u(n, r, i) {
|
|
2161
|
-
return
|
|
2161
|
+
return fn(t, s.value, e.editorView.value), pn(t, n, i ?? e.author(), r);
|
|
2162
2162
|
}
|
|
2163
2163
|
function d() {
|
|
2164
2164
|
if (a(), o.value) return;
|
|
2165
2165
|
let n = e.getDocument()?.package.document.comments;
|
|
2166
|
-
|
|
2166
|
+
fn(t, n, e.editorView.value), c(n && n.length > 0 ? n : []);
|
|
2167
2167
|
}
|
|
2168
2168
|
function f(e, t) {
|
|
2169
2169
|
l(u(t, e));
|
|
@@ -2188,7 +2188,7 @@ function Ya(e) {
|
|
|
2188
2188
|
}
|
|
2189
2189
|
function _(t, n) {
|
|
2190
2190
|
let r = e.editorView.value;
|
|
2191
|
-
r && (n ?
|
|
2191
|
+
r && (n ? mn : bn)(t)(r.state, r.dispatch);
|
|
2192
2192
|
}
|
|
2193
2193
|
function v(e) {
|
|
2194
2194
|
_(e, !0);
|
|
@@ -2198,11 +2198,11 @@ function Ya(e) {
|
|
|
2198
2198
|
}
|
|
2199
2199
|
function b(t, n) {
|
|
2200
2200
|
let r = e.editorView.value;
|
|
2201
|
-
r &&
|
|
2201
|
+
r && hn(t, n)(r.state, r.dispatch);
|
|
2202
2202
|
}
|
|
2203
2203
|
function x(t, n) {
|
|
2204
2204
|
let r = e.editorView.value;
|
|
2205
|
-
r &&
|
|
2205
|
+
r && Q(t, n)(r.state, r.dispatch);
|
|
2206
2206
|
}
|
|
2207
2207
|
return {
|
|
2208
2208
|
comments: s,
|
|
@@ -2225,8 +2225,8 @@ function Ya(e) {
|
|
|
2225
2225
|
}
|
|
2226
2226
|
//#endregion
|
|
2227
2227
|
//#region src/utils/imageClipboard.ts
|
|
2228
|
-
function
|
|
2229
|
-
let r =
|
|
2228
|
+
function $a(e, t, n) {
|
|
2229
|
+
let r = $(e.state), i = e.state.schema.marks.insertion;
|
|
2230
2230
|
if (!r || !i) return;
|
|
2231
2231
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
2232
2232
|
o < 0 || t.addMark(o, a, i.create({
|
|
@@ -2235,7 +2235,7 @@ function Xa(e, t, n) {
|
|
|
2235
2235
|
date: r.date
|
|
2236
2236
|
}));
|
|
2237
2237
|
}
|
|
2238
|
-
function
|
|
2238
|
+
function eo(e, t) {
|
|
2239
2239
|
let n = e.state.doc.nodeAt(t);
|
|
2240
2240
|
if (!n || n.type.name !== "image") return;
|
|
2241
2241
|
let r = n.attrs.src;
|
|
@@ -2249,7 +2249,7 @@ function Za(e, t) {
|
|
|
2249
2249
|
e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
2250
2250
|
});
|
|
2251
2251
|
}
|
|
2252
|
-
function
|
|
2252
|
+
function to(e) {
|
|
2253
2253
|
return new Promise((t, n) => {
|
|
2254
2254
|
let r = new FileReader();
|
|
2255
2255
|
r.onload = () => {
|
|
@@ -2257,7 +2257,7 @@ function Qa(e) {
|
|
|
2257
2257
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
|
|
2258
2258
|
});
|
|
2259
2259
|
}
|
|
2260
|
-
function
|
|
2260
|
+
function no(e) {
|
|
2261
2261
|
return new Promise((t) => {
|
|
2262
2262
|
let n = new Image();
|
|
2263
2263
|
n.onload = () => t({
|
|
@@ -2269,7 +2269,7 @@ function $a(e) {
|
|
|
2269
2269
|
}), n.src = e;
|
|
2270
2270
|
});
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function ro(e, t, n, r) {
|
|
2273
2273
|
let i = e.state.schema.nodes.image;
|
|
2274
2274
|
if (!i) return;
|
|
2275
2275
|
let a = i.create({
|
|
@@ -2280,23 +2280,23 @@ function eo(e, t, n, r) {
|
|
|
2280
2280
|
wrapType: "inline",
|
|
2281
2281
|
displayMode: "inline"
|
|
2282
2282
|
}), o = e.state.tr.replaceSelectionWith(a);
|
|
2283
|
-
|
|
2283
|
+
$a(e, o, a), e.dispatch(o);
|
|
2284
2284
|
}
|
|
2285
|
-
async function
|
|
2285
|
+
async function io(e) {
|
|
2286
2286
|
try {
|
|
2287
2287
|
let t = await navigator.clipboard.read();
|
|
2288
2288
|
for (let n of t) {
|
|
2289
2289
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
2290
2290
|
if (t) {
|
|
2291
|
-
let r = await
|
|
2292
|
-
a > 612 && (o = Math.round(612 / a * o), a = 612),
|
|
2291
|
+
let r = await to(await n.getType(t)), i = await no(r), a = i.width, o = i.height;
|
|
2292
|
+
a > 612 && (o = Math.round(612 / a * o), a = 612), ro(e, r, a, o);
|
|
2293
2293
|
return;
|
|
2294
2294
|
}
|
|
2295
2295
|
if (n.types.includes("text/html")) {
|
|
2296
2296
|
let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
|
|
2297
2297
|
if (r) {
|
|
2298
2298
|
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;
|
|
2299
|
-
|
|
2299
|
+
ro(e, r, a || 200, o || 200);
|
|
2300
2300
|
return;
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
@@ -2317,14 +2317,14 @@ async function to(e) {
|
|
|
2317
2317
|
}
|
|
2318
2318
|
}
|
|
2319
2319
|
}
|
|
2320
|
-
function
|
|
2320
|
+
function ao(e, t) {
|
|
2321
2321
|
let n = e.state.doc.nodeAt(t);
|
|
2322
2322
|
if (!n || n.type.name !== "image") return;
|
|
2323
2323
|
let r = document.createElement("input");
|
|
2324
2324
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
2325
2325
|
let i = r.files?.[0];
|
|
2326
2326
|
if (!i) return;
|
|
2327
|
-
let a = await
|
|
2327
|
+
let a = await to(i), o = await no(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);
|
|
2328
2328
|
try {
|
|
2329
2329
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
2330
2330
|
...n.attrs,
|
|
@@ -2339,7 +2339,7 @@ function no(e, t) {
|
|
|
2339
2339
|
}
|
|
2340
2340
|
//#endregion
|
|
2341
2341
|
//#region src/composables/useContextMenus.ts
|
|
2342
|
-
var
|
|
2342
|
+
var oo = /* @__PURE__ */ new Set([
|
|
2343
2343
|
"inline",
|
|
2344
2344
|
"square",
|
|
2345
2345
|
"tight",
|
|
@@ -2348,16 +2348,16 @@ var ro = /* @__PURE__ */ new Set([
|
|
|
2348
2348
|
"behind",
|
|
2349
2349
|
"inFront"
|
|
2350
2350
|
]);
|
|
2351
|
-
function
|
|
2352
|
-
return typeof e == "string" &&
|
|
2351
|
+
function so(e) {
|
|
2352
|
+
return typeof e == "string" && oo.has(e);
|
|
2353
2353
|
}
|
|
2354
|
-
function
|
|
2355
|
-
return
|
|
2354
|
+
function co(e) {
|
|
2355
|
+
return so(e) ? e : "inline";
|
|
2356
2356
|
}
|
|
2357
|
-
function
|
|
2357
|
+
function lo(e) {
|
|
2358
2358
|
return e === "left" || e === "right" || e === "none" ? e : null;
|
|
2359
2359
|
}
|
|
2360
|
-
function
|
|
2360
|
+
function uo(e) {
|
|
2361
2361
|
let { t } = r(), n = H({
|
|
2362
2362
|
isOpen: !1,
|
|
2363
2363
|
position: {
|
|
@@ -2399,7 +2399,7 @@ function so(e) {
|
|
|
2399
2399
|
t(e.state, (t) => e.dispatch(t), e);
|
|
2400
2400
|
}
|
|
2401
2401
|
function l(t, n, r, i, a) {
|
|
2402
|
-
let o = i === "inline" ?
|
|
2402
|
+
let o = i === "inline" ? It(t, e.zoom.value) : void 0;
|
|
2403
2403
|
return {
|
|
2404
2404
|
open: !0,
|
|
2405
2405
|
position: r,
|
|
@@ -2412,12 +2412,12 @@ function so(e) {
|
|
|
2412
2412
|
function u(t) {
|
|
2413
2413
|
let r = e.editorView.value;
|
|
2414
2414
|
if (!r) return;
|
|
2415
|
-
let o =
|
|
2415
|
+
let o = Rt(t.target);
|
|
2416
2416
|
if (o) {
|
|
2417
2417
|
let a = Number(o.dataset.pmStart);
|
|
2418
2418
|
if (!Number.isNaN(a)) {
|
|
2419
2419
|
try {
|
|
2420
|
-
let e =
|
|
2420
|
+
let e = Mt.create(r.state.doc, a);
|
|
2421
2421
|
r.dispatch(r.state.tr.setSelection(e));
|
|
2422
2422
|
} catch {}
|
|
2423
2423
|
e.selectedImage.value = {
|
|
@@ -2431,7 +2431,7 @@ function so(e) {
|
|
|
2431
2431
|
i.value = l(o, a, {
|
|
2432
2432
|
x: t.clientX,
|
|
2433
2433
|
y: t.clientY
|
|
2434
|
-
},
|
|
2434
|
+
}, co(s.attrs.wrapType), lo(s.attrs.cssFloat)), n.value.isOpen = !1;
|
|
2435
2435
|
return;
|
|
2436
2436
|
}
|
|
2437
2437
|
}
|
|
@@ -2442,7 +2442,7 @@ function so(e) {
|
|
|
2442
2442
|
e.setPmSelection(a);
|
|
2443
2443
|
} catch {}
|
|
2444
2444
|
}
|
|
2445
|
-
let s =
|
|
2445
|
+
let s = $e(r.state), { empty: c, from: u, to: d } = r.state.selection;
|
|
2446
2446
|
a.value = {
|
|
2447
2447
|
from: u,
|
|
2448
2448
|
to: d
|
|
@@ -2466,7 +2466,7 @@ function so(e) {
|
|
|
2466
2466
|
!o || o.type.name !== "image" || (i.value = l(a.element, a.pmPos, {
|
|
2467
2467
|
x: t.clientX,
|
|
2468
2468
|
y: t.clientY
|
|
2469
|
-
},
|
|
2469
|
+
}, co(o.attrs.wrapType), lo(o.attrs.cssFloat)), n.value.isOpen = !1);
|
|
2470
2470
|
}
|
|
2471
2471
|
function f(t) {
|
|
2472
2472
|
let n = e.editorView.value, r = i.value;
|
|
@@ -2490,16 +2490,16 @@ function so(e) {
|
|
|
2490
2490
|
case "cut":
|
|
2491
2491
|
if (e.selectedImage.value) {
|
|
2492
2492
|
let t = e.selectedImage.value.pmPos;
|
|
2493
|
-
|
|
2493
|
+
eo(n, t);
|
|
2494
2494
|
let r = n.state.doc.nodeAt(t);
|
|
2495
2495
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null, e.onCut?.());
|
|
2496
2496
|
} else n.focus(), document.execCommand("cut");
|
|
2497
2497
|
break;
|
|
2498
2498
|
case "copy":
|
|
2499
|
-
e.selectedImage.value ? (
|
|
2499
|
+
e.selectedImage.value ? (eo(n, e.selectedImage.value.pmPos), e.onCopy?.()) : (n.focus(), document.execCommand("copy"));
|
|
2500
2500
|
break;
|
|
2501
2501
|
case "paste":
|
|
2502
|
-
|
|
2502
|
+
io(n).then(() => e.onPaste?.()).catch(() => void 0);
|
|
2503
2503
|
break;
|
|
2504
2504
|
case "pasteAsPlainText":
|
|
2505
2505
|
navigator.clipboard.readText().then((t) => {
|
|
@@ -2520,7 +2520,7 @@ function so(e) {
|
|
|
2520
2520
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2521
2521
|
break;
|
|
2522
2522
|
case "replaceImage":
|
|
2523
|
-
e.selectedImage.value &&
|
|
2523
|
+
e.selectedImage.value && ao(n, e.selectedImage.value.pmPos);
|
|
2524
2524
|
break;
|
|
2525
2525
|
case "deleteImage":
|
|
2526
2526
|
if (e.selectedImage.value) {
|
|
@@ -2558,7 +2558,7 @@ function so(e) {
|
|
|
2558
2558
|
}
|
|
2559
2559
|
//#endregion
|
|
2560
2560
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2561
|
-
function
|
|
2561
|
+
function fo(e) {
|
|
2562
2562
|
async function t(t) {
|
|
2563
2563
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2564
2564
|
}
|
|
@@ -2577,19 +2577,19 @@ function co(e) {
|
|
|
2577
2577
|
}
|
|
2578
2578
|
//#endregion
|
|
2579
2579
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2580
|
-
var
|
|
2580
|
+
var po = Date.now(), mo = async (e, t) => {
|
|
2581
2581
|
let n = await e.saveDocument(t);
|
|
2582
2582
|
if (!n) return null;
|
|
2583
2583
|
let r = await n.arrayBuffer();
|
|
2584
2584
|
return e.clearCommentsDirty(), e.onSave?.(r), r;
|
|
2585
2585
|
};
|
|
2586
|
-
function
|
|
2586
|
+
function ho(e) {
|
|
2587
2587
|
let t = [];
|
|
2588
2588
|
function n() {
|
|
2589
2589
|
e.onPrint?.(), window.print();
|
|
2590
2590
|
}
|
|
2591
2591
|
function r(t) {
|
|
2592
|
-
return
|
|
2592
|
+
return mo({
|
|
2593
2593
|
clearCommentsDirty: e.clearCommentsDirty,
|
|
2594
2594
|
onSave: e.onSave,
|
|
2595
2595
|
saveDocument: e.saveDocument
|
|
@@ -2598,11 +2598,11 @@ function fo(e) {
|
|
|
2598
2598
|
function i(t, n) {
|
|
2599
2599
|
let r = e.pagesRef.value;
|
|
2600
2600
|
if (!r) return !1;
|
|
2601
|
-
let i =
|
|
2601
|
+
let i = Yn(r, t), a = i.at(0);
|
|
2602
2602
|
return a ? (a.scrollIntoView({
|
|
2603
2603
|
block: "center",
|
|
2604
2604
|
behavior: "smooth"
|
|
2605
|
-
}), n?.highlight &&
|
|
2605
|
+
}), n?.highlight && Xn(i, n.highlight), !0) : !1;
|
|
2606
2606
|
}
|
|
2607
2607
|
function a() {
|
|
2608
2608
|
return e.zoom.value;
|
|
@@ -2610,19 +2610,19 @@ function fo(e) {
|
|
|
2610
2610
|
let o = null;
|
|
2611
2611
|
function s() {
|
|
2612
2612
|
let t = e.getActiveView();
|
|
2613
|
-
return t ?
|
|
2613
|
+
return t ? cn(t.state, t.dispatch) : !1;
|
|
2614
2614
|
}
|
|
2615
2615
|
function c() {
|
|
2616
2616
|
let t = e.getActiveView();
|
|
2617
|
-
return t ?
|
|
2617
|
+
return t ? sn(t.state, t.dispatch) : !1;
|
|
2618
2618
|
}
|
|
2619
2619
|
function l() {
|
|
2620
2620
|
let t = e.getActiveView();
|
|
2621
|
-
return t ?
|
|
2621
|
+
return t ? cn(t.state) : !1;
|
|
2622
2622
|
}
|
|
2623
2623
|
function u() {
|
|
2624
2624
|
let t = e.getActiveView();
|
|
2625
|
-
return t ?
|
|
2625
|
+
return t ? sn(t.state) : !1;
|
|
2626
2626
|
}
|
|
2627
2627
|
function d() {
|
|
2628
2628
|
let t = e.getActiveView();
|
|
@@ -2630,9 +2630,9 @@ function fo(e) {
|
|
|
2630
2630
|
}
|
|
2631
2631
|
function f(t) {
|
|
2632
2632
|
let n = e.editorView.value, r = e.pagesRef.value, i = e.scrollRootRef.value;
|
|
2633
|
-
return !n || !r || !i ? /* @__PURE__ */ new Map() :
|
|
2633
|
+
return !n || !r || !i ? /* @__PURE__ */ new Map() : Qn({
|
|
2634
2634
|
blockIds: t,
|
|
2635
|
-
snapshot:
|
|
2635
|
+
snapshot: Vn(n.state.doc),
|
|
2636
2636
|
pagesContainer: r,
|
|
2637
2637
|
scrollRoot: i
|
|
2638
2638
|
});
|
|
@@ -2642,7 +2642,7 @@ function fo(e) {
|
|
|
2642
2642
|
}
|
|
2643
2643
|
function m(t) {
|
|
2644
2644
|
let n = e.pagesRef.value;
|
|
2645
|
-
return n ?
|
|
2645
|
+
return n ? Zn(n, t) : () => {};
|
|
2646
2646
|
}
|
|
2647
2647
|
function h() {
|
|
2648
2648
|
return o ??= {
|
|
@@ -2672,7 +2672,7 @@ function fo(e) {
|
|
|
2672
2672
|
getPageNumberForPmPos: (t) => {
|
|
2673
2673
|
let n = e.layout.value;
|
|
2674
2674
|
if (!n) return null;
|
|
2675
|
-
let r =
|
|
2675
|
+
let r = Sn(n, t);
|
|
2676
2676
|
return r == null ? null : r + 1;
|
|
2677
2677
|
},
|
|
2678
2678
|
getBlockRect: p,
|
|
@@ -2687,7 +2687,7 @@ function fo(e) {
|
|
|
2687
2687
|
function _() {
|
|
2688
2688
|
let t = e.layout.value, n = e.editorView.value;
|
|
2689
2689
|
if (!t || !n) return 0;
|
|
2690
|
-
let r =
|
|
2690
|
+
let r = Sn(t, n.state.selection.from);
|
|
2691
2691
|
return r == null ? 0 : r + 1;
|
|
2692
2692
|
}
|
|
2693
2693
|
function v(t) {
|
|
@@ -2722,10 +2722,10 @@ function fo(e) {
|
|
|
2722
2722
|
ensureEditorView: () => e.editor.ensureView(),
|
|
2723
2723
|
createAIEditSnapshot: () => {
|
|
2724
2724
|
let t = e.editorView.value;
|
|
2725
|
-
return t ?
|
|
2725
|
+
return t ? Hn(t.state.doc, He(t.state)) : null;
|
|
2726
2726
|
},
|
|
2727
2727
|
applyDocumentOperations: ({ snapshot: n, batch: r, author: i = e.author() }) => {
|
|
2728
|
-
|
|
2728
|
+
zn(r.version);
|
|
2729
2729
|
let a = e.editorView.value;
|
|
2730
2730
|
if (!a) {
|
|
2731
2731
|
let e = "committed";
|
|
@@ -2735,11 +2735,11 @@ function fo(e) {
|
|
|
2735
2735
|
reason: "unsupportedBlock"
|
|
2736
2736
|
}));
|
|
2737
2737
|
return {
|
|
2738
|
-
version:
|
|
2738
|
+
version: Fn,
|
|
2739
2739
|
status: e,
|
|
2740
2740
|
applied: [],
|
|
2741
2741
|
skipped: t,
|
|
2742
|
-
issues:
|
|
2742
|
+
issues: Gn(r.operations, t),
|
|
2743
2743
|
receipts: [],
|
|
2744
2744
|
undoHandle: null
|
|
2745
2745
|
};
|
|
@@ -2749,9 +2749,9 @@ function fo(e) {
|
|
|
2749
2749
|
let s = e.getComments(), c = {
|
|
2750
2750
|
state: a.state,
|
|
2751
2751
|
dispatch: (e) => {
|
|
2752
|
-
a.dispatch(
|
|
2752
|
+
a.dispatch(on(e)), c.state = a.state;
|
|
2753
2753
|
}
|
|
2754
|
-
}, l =
|
|
2754
|
+
}, l = Rn({
|
|
2755
2755
|
view: c,
|
|
2756
2756
|
snapshot: n,
|
|
2757
2757
|
batch: r,
|
|
@@ -2759,7 +2759,7 @@ function fo(e) {
|
|
|
2759
2759
|
createCommentId: (t) => e.createAIEditComment(t, i),
|
|
2760
2760
|
createUndoHandle: () => ({
|
|
2761
2761
|
type: "documentOperationUndo",
|
|
2762
|
-
id: `vue-${String(
|
|
2762
|
+
id: `vue-${String(po++)}`
|
|
2763
2763
|
})
|
|
2764
2764
|
});
|
|
2765
2765
|
return l.undoHandle !== null && t.push({
|
|
@@ -2797,7 +2797,7 @@ function fo(e) {
|
|
|
2797
2797
|
},
|
|
2798
2798
|
applyAIEditOperations: ({ snapshot: t, operations: n, mode: r = "tracked-changes", author: i = e.author() }) => {
|
|
2799
2799
|
let a = e.editorView.value;
|
|
2800
|
-
return a ?
|
|
2800
|
+
return a ? Ln({
|
|
2801
2801
|
view: a,
|
|
2802
2802
|
snapshot: t,
|
|
2803
2803
|
operations: n,
|
|
@@ -2814,26 +2814,26 @@ function fo(e) {
|
|
|
2814
2814
|
},
|
|
2815
2815
|
acceptAIEditOperation: (t) => {
|
|
2816
2816
|
let n = e.editorView.value;
|
|
2817
|
-
return n ?
|
|
2817
|
+
return n ? mn(t)(n.state, n.dispatch) : !1;
|
|
2818
2818
|
},
|
|
2819
2819
|
rejectAIEditOperation: (t) => {
|
|
2820
2820
|
let n = e.editorView.value;
|
|
2821
|
-
return n ?
|
|
2821
|
+
return n ? bn(t)(n.state, n.dispatch) : !1;
|
|
2822
2822
|
},
|
|
2823
2823
|
undo: s,
|
|
2824
2824
|
redo: c,
|
|
2825
2825
|
scrollToAIEditOperation: (t) => {
|
|
2826
2826
|
let n = e.editorView.value;
|
|
2827
2827
|
if (!n) return !1;
|
|
2828
|
-
let r =
|
|
2828
|
+
let r = _n(n.state, t);
|
|
2829
2829
|
if (!r) return !1;
|
|
2830
|
-
let { from: i, to: a } =
|
|
2830
|
+
let { from: i, to: a } = or(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2831
2831
|
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2832
2832
|
},
|
|
2833
2833
|
scrollToBlock: (t, n) => {
|
|
2834
2834
|
let r = e.editorView.value;
|
|
2835
2835
|
if (!r) return !1;
|
|
2836
|
-
let i =
|
|
2836
|
+
let i = sr({
|
|
2837
2837
|
blockId: t,
|
|
2838
2838
|
doc: r.state.doc,
|
|
2839
2839
|
snapshot: n
|
|
@@ -2845,7 +2845,7 @@ function fo(e) {
|
|
|
2845
2845
|
highlightPassage: ({ blockId: t, text: n, snapshot: r }) => {
|
|
2846
2846
|
let a = e.editorView.value;
|
|
2847
2847
|
if (!a) return "none";
|
|
2848
|
-
let o =
|
|
2848
|
+
let o = lr({
|
|
2849
2849
|
blockId: t,
|
|
2850
2850
|
text: n,
|
|
2851
2851
|
doc: a.state.doc,
|
|
@@ -2853,13 +2853,13 @@ function fo(e) {
|
|
|
2853
2853
|
});
|
|
2854
2854
|
if (o !== null) return e.setPassageHighlight(o), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(o.from)), "passage";
|
|
2855
2855
|
e.setPassageHighlight(null);
|
|
2856
|
-
let s =
|
|
2856
|
+
let s = sr({
|
|
2857
2857
|
blockId: t,
|
|
2858
2858
|
doc: a.state.doc,
|
|
2859
2859
|
snapshot: r
|
|
2860
2860
|
});
|
|
2861
2861
|
if (s === null) return "none";
|
|
2862
|
-
let c =
|
|
2862
|
+
let c = fr(t);
|
|
2863
2863
|
if (c !== null && i(c, { highlight: {} })) return "block";
|
|
2864
2864
|
let { from: l, to: u } = s, d = a.state.doc.resolve(l), f = a.state.doc.resolve(u);
|
|
2865
2865
|
return a.dispatch(a.state.tr.setSelection(Z.between(d, f))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(l)), "block";
|
|
@@ -2870,11 +2870,11 @@ function fo(e) {
|
|
|
2870
2870
|
showInDocument: (t, n) => {
|
|
2871
2871
|
let r = e.editorView.value;
|
|
2872
2872
|
if (!r) return !1;
|
|
2873
|
-
let i = t.type === "textRange" ?
|
|
2873
|
+
let i = t.type === "textRange" ? cr({
|
|
2874
2874
|
range: t,
|
|
2875
2875
|
doc: r.state.doc,
|
|
2876
2876
|
snapshot: n
|
|
2877
|
-
}) :
|
|
2877
|
+
}) : sr({
|
|
2878
2878
|
blockId: t.blockId,
|
|
2879
2879
|
doc: r.state.doc,
|
|
2880
2880
|
snapshot: n
|
|
@@ -2885,7 +2885,7 @@ function fo(e) {
|
|
|
2885
2885
|
},
|
|
2886
2886
|
getSuggestions: () => {
|
|
2887
2887
|
let t = e.editorView.value;
|
|
2888
|
-
return t ?
|
|
2888
|
+
return t ? yn(t.state) : [];
|
|
2889
2889
|
},
|
|
2890
2890
|
acceptSuggestion: (t, n) => {
|
|
2891
2891
|
let r = e.editorView.value;
|
|
@@ -2893,7 +2893,7 @@ function fo(e) {
|
|
|
2893
2893
|
accepted: !1,
|
|
2894
2894
|
appliedAs: null
|
|
2895
2895
|
};
|
|
2896
|
-
let i =
|
|
2896
|
+
let i = yn(r.state).find((e) => e.suggestionId === t)?.appliedAs ?? null, a = gn(t, { author: n?.author ?? e.author() })(r.state, r.dispatch);
|
|
2897
2897
|
return {
|
|
2898
2898
|
accepted: a,
|
|
2899
2899
|
appliedAs: a ? i : null
|
|
@@ -2901,46 +2901,46 @@ function fo(e) {
|
|
|
2901
2901
|
},
|
|
2902
2902
|
rejectSuggestion: (t) => {
|
|
2903
2903
|
let n = e.editorView.value;
|
|
2904
|
-
return n ?
|
|
2904
|
+
return n ? xn(t)(n.state, n.dispatch) : !1;
|
|
2905
2905
|
},
|
|
2906
2906
|
scrollToSuggestion: (t) => {
|
|
2907
2907
|
let n = e.editorView.value;
|
|
2908
2908
|
if (!n) return !1;
|
|
2909
|
-
let r =
|
|
2909
|
+
let r = vn(n.state, t);
|
|
2910
2910
|
if (!r) return !1;
|
|
2911
|
-
let { from: i, to: a } =
|
|
2911
|
+
let { from: i, to: a } = or(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2912
2912
|
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2913
2913
|
},
|
|
2914
2914
|
getTrackedChanges: () => {
|
|
2915
2915
|
let t = e.editorView.value;
|
|
2916
|
-
return t ?
|
|
2916
|
+
return t ? Kn(t.state.doc) : [];
|
|
2917
2917
|
},
|
|
2918
2918
|
getCommentAnchors: () => {
|
|
2919
2919
|
let t = e.editorView.value;
|
|
2920
|
-
return t ?
|
|
2920
|
+
return t ? Wn(t.state.doc) : [];
|
|
2921
2921
|
},
|
|
2922
2922
|
getSelectionText: () => {
|
|
2923
2923
|
let t = e.editorView.value;
|
|
2924
|
-
return t ?
|
|
2924
|
+
return t ? Ue(t.state) : "";
|
|
2925
2925
|
},
|
|
2926
2926
|
getPageText: (t) => {
|
|
2927
2927
|
let n = e.editorView.value;
|
|
2928
|
-
return n ?
|
|
2928
|
+
return n ? hr(e.layout.value, n.state.doc, t) : null;
|
|
2929
2929
|
},
|
|
2930
2930
|
getTargetPage: (t, n) => {
|
|
2931
2931
|
let r = e.editorView.value, i = e.layout.value;
|
|
2932
2932
|
if (!r || !i) return null;
|
|
2933
|
-
let a = t.type === "textRange" ?
|
|
2933
|
+
let a = t.type === "textRange" ? cr({
|
|
2934
2934
|
range: t,
|
|
2935
2935
|
doc: r.state.doc,
|
|
2936
2936
|
snapshot: n
|
|
2937
|
-
}) :
|
|
2937
|
+
}) : sr({
|
|
2938
2938
|
blockId: t.blockId,
|
|
2939
2939
|
doc: r.state.doc,
|
|
2940
2940
|
snapshot: n
|
|
2941
2941
|
});
|
|
2942
2942
|
if (a === null) return null;
|
|
2943
|
-
let o =
|
|
2943
|
+
let o = Sn(i, a.from);
|
|
2944
2944
|
return o == null ? null : o + 1;
|
|
2945
2945
|
},
|
|
2946
2946
|
getBlockRect: p,
|
|
@@ -2949,8 +2949,8 @@ function fo(e) {
|
|
|
2949
2949
|
onLayoutChange: m,
|
|
2950
2950
|
getContentControls: (t = {}) => {
|
|
2951
2951
|
let n = e.editorView.value;
|
|
2952
|
-
return n ?
|
|
2953
|
-
properties:
|
|
2952
|
+
return n ? tr(n.state.doc, t).map((e) => ({
|
|
2953
|
+
properties: $n(e.node),
|
|
2954
2954
|
path: e.path,
|
|
2955
2955
|
pmPos: e.pos
|
|
2956
2956
|
})) : [];
|
|
@@ -2958,7 +2958,7 @@ function fo(e) {
|
|
|
2958
2958
|
scrollToContentControl: (t) => {
|
|
2959
2959
|
let n = e.editorView.value;
|
|
2960
2960
|
if (!n) return !1;
|
|
2961
|
-
let r =
|
|
2961
|
+
let r = er(n.state.doc, t);
|
|
2962
2962
|
if (!r) return !1;
|
|
2963
2963
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
2964
2964
|
return n.dispatch(n.state.tr.setSelection(Z.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
@@ -2966,54 +2966,54 @@ function fo(e) {
|
|
|
2966
2966
|
setContentControlContent: (t, n, r = {}) => {
|
|
2967
2967
|
let i = e.editorView.value;
|
|
2968
2968
|
if (!i) return !1;
|
|
2969
|
-
let a = typeof n == "string" ?
|
|
2969
|
+
let a = typeof n == "string" ? rr(i.state, t, n, r) : ar(i.state, t, n, r);
|
|
2970
2970
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2971
2971
|
},
|
|
2972
2972
|
setContentControlValue: (t, n, r = {}) => {
|
|
2973
2973
|
let i = e.editorView.value;
|
|
2974
2974
|
if (!i) return !1;
|
|
2975
|
-
let a =
|
|
2975
|
+
let a = ir(i.state, t, n, r);
|
|
2976
2976
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2977
2977
|
},
|
|
2978
2978
|
removeContentControl: (t, n = {}) => {
|
|
2979
2979
|
let r = e.editorView.value;
|
|
2980
2980
|
if (!r) return !1;
|
|
2981
|
-
let i =
|
|
2981
|
+
let i = nr(r.state, t, n);
|
|
2982
2982
|
return i ? (r.dispatch(i), !0) : !1;
|
|
2983
2983
|
}
|
|
2984
2984
|
} };
|
|
2985
2985
|
}
|
|
2986
2986
|
//#endregion
|
|
2987
2987
|
//#region src/composables/useFormattingActions.ts
|
|
2988
|
-
function
|
|
2988
|
+
function go(e) {
|
|
2989
2989
|
let t = () => e.activeView?.value ?? e.editorView.value;
|
|
2990
2990
|
function n() {
|
|
2991
2991
|
let e = t();
|
|
2992
|
-
e && (
|
|
2992
|
+
e && (ln(e.state, e.dispatch, e), e.focus());
|
|
2993
2993
|
}
|
|
2994
2994
|
function r(n) {
|
|
2995
2995
|
let r = t();
|
|
2996
2996
|
if (!r) return;
|
|
2997
2997
|
let i = e.getDocument(), a = i?.package?.styles;
|
|
2998
2998
|
if (a) {
|
|
2999
|
-
let e = ze(a), t = e.resolveParagraphStyle(n), o = { numbering: i?.package?.numbering ?
|
|
2999
|
+
let e = ze(a), t = e.resolveParagraphStyle(n), o = { numbering: i?.package?.numbering ? xr(i.package.numbering) : null };
|
|
3000
3000
|
t.paragraphFormatting && (o.paragraphFormatting = t.paragraphFormatting), t.runFormatting && (o.runFormatting = t.runFormatting);
|
|
3001
3001
|
let s = e.getStyle(n)?.name;
|
|
3002
|
-
s && (o.styleName = s),
|
|
3003
|
-
} else
|
|
3002
|
+
s && (o.styleName = s), gr(n, o)(r.state, (e) => r.dispatch(e));
|
|
3003
|
+
} else gr(n)(r.state, (e) => r.dispatch(e));
|
|
3004
3004
|
r.focus();
|
|
3005
3005
|
}
|
|
3006
3006
|
function i() {
|
|
3007
3007
|
let t = e.editorView.value;
|
|
3008
|
-
t && (
|
|
3008
|
+
t && (Sr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
3009
3009
|
}
|
|
3010
3010
|
function a() {
|
|
3011
3011
|
let t = e.editorView.value;
|
|
3012
|
-
t && (
|
|
3012
|
+
t && (wr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
3013
3013
|
}
|
|
3014
3014
|
function o() {
|
|
3015
3015
|
let t = e.editorView.value;
|
|
3016
|
-
t && (
|
|
3016
|
+
t && (Cr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
3017
3017
|
}
|
|
3018
3018
|
function s(e) {
|
|
3019
3019
|
let n = t();
|
|
@@ -3032,10 +3032,10 @@ function po(e) {
|
|
|
3032
3032
|
}
|
|
3033
3033
|
//#endregion
|
|
3034
3034
|
//#region src/utils/fontFaces.ts
|
|
3035
|
-
function
|
|
3035
|
+
function _o() {
|
|
3036
3036
|
return typeof document > "u" || !("fonts" in document) ? null : document.fonts;
|
|
3037
3037
|
}
|
|
3038
|
-
async function
|
|
3038
|
+
async function vo(e, t, n, r) {
|
|
3039
3039
|
let i;
|
|
3040
3040
|
try {
|
|
3041
3041
|
i = new FontFace(t, n, r), e.add(i);
|
|
@@ -3044,46 +3044,46 @@ async function ho(e, t, n, r) {
|
|
|
3044
3044
|
}
|
|
3045
3045
|
return await i.load().then(() => !0, () => !1) ? i : (e.delete(i), null);
|
|
3046
3046
|
}
|
|
3047
|
-
function
|
|
3048
|
-
let t =
|
|
3047
|
+
function yo(e) {
|
|
3048
|
+
let t = _o();
|
|
3049
3049
|
if (t) for (let n of e) t.delete(n);
|
|
3050
3050
|
}
|
|
3051
3051
|
//#endregion
|
|
3052
3052
|
//#region src/utils/embeddedFonts.ts
|
|
3053
|
-
var
|
|
3053
|
+
var bo = {
|
|
3054
3054
|
faces: [],
|
|
3055
3055
|
familyMap: /* @__PURE__ */ new Map()
|
|
3056
3056
|
};
|
|
3057
|
-
async function
|
|
3058
|
-
let t =
|
|
3059
|
-
if (!t) return
|
|
3057
|
+
async function xo(e) {
|
|
3058
|
+
let t = _o();
|
|
3059
|
+
if (!t) return bo;
|
|
3060
3060
|
let n;
|
|
3061
3061
|
try {
|
|
3062
|
-
n = await
|
|
3062
|
+
n = await Dr(e);
|
|
3063
3063
|
} catch {
|
|
3064
|
-
return
|
|
3064
|
+
return bo;
|
|
3065
3065
|
}
|
|
3066
3066
|
return {
|
|
3067
|
-
faces: (await Promise.all(n.map((e) =>
|
|
3067
|
+
faces: (await Promise.all(n.map((e) => vo(t, e.family, e.bytes, {
|
|
3068
3068
|
weight: String(e.weight),
|
|
3069
3069
|
style: e.style
|
|
3070
3070
|
})))).filter((e) => e !== null),
|
|
3071
|
-
familyMap:
|
|
3071
|
+
familyMap: Er(n)
|
|
3072
3072
|
};
|
|
3073
3073
|
}
|
|
3074
3074
|
//#endregion
|
|
3075
3075
|
//#region src/utils/hostFonts.ts
|
|
3076
|
-
function
|
|
3076
|
+
function So(e) {
|
|
3077
3077
|
return typeof e == "string" && e.trim().length > 0;
|
|
3078
3078
|
}
|
|
3079
|
-
function
|
|
3080
|
-
return typeof e != "object" || !e ? !1 :
|
|
3079
|
+
function Co(e) {
|
|
3080
|
+
return typeof e != "object" || !e ? !1 : So(Reflect.get(e, "family")) && So(Reflect.get(e, "src"));
|
|
3081
3081
|
}
|
|
3082
|
-
function
|
|
3082
|
+
function wo(e) {
|
|
3083
3083
|
if (!e) return [];
|
|
3084
3084
|
let t = [];
|
|
3085
3085
|
for (let n of e) {
|
|
3086
|
-
if (!
|
|
3086
|
+
if (!Co(n)) continue;
|
|
3087
3087
|
let e = { display: "swap" };
|
|
3088
3088
|
(typeof n.weight == "number" || typeof n.weight == "string") && (e.weight = String(n.weight)), t.push({
|
|
3089
3089
|
family: n.family.trim(),
|
|
@@ -3093,20 +3093,20 @@ function xo(e) {
|
|
|
3093
3093
|
}
|
|
3094
3094
|
return t;
|
|
3095
3095
|
}
|
|
3096
|
-
async function
|
|
3097
|
-
let t =
|
|
3096
|
+
async function To(e) {
|
|
3097
|
+
let t = _o();
|
|
3098
3098
|
if (!t) return [];
|
|
3099
|
-
let n =
|
|
3100
|
-
return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) =>
|
|
3099
|
+
let n = wo(e);
|
|
3100
|
+
return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) => vo(t, e, n, r)))).filter((e) => e !== null);
|
|
3101
3101
|
}
|
|
3102
3102
|
//#endregion
|
|
3103
3103
|
//#region src/composables/useFontLifecycle.ts
|
|
3104
|
-
var
|
|
3105
|
-
loadEmbedded:
|
|
3106
|
-
loadHost:
|
|
3107
|
-
remove:
|
|
3104
|
+
var Eo = {
|
|
3105
|
+
loadEmbedded: xo,
|
|
3106
|
+
loadHost: To,
|
|
3107
|
+
remove: yo
|
|
3108
3108
|
};
|
|
3109
|
-
function
|
|
3109
|
+
function Do(e, t = Eo) {
|
|
3110
3110
|
K(() => e.isReady.value ? e.getDocument()?.originalBuffer ?? null : null, (n, r, i) => {
|
|
3111
3111
|
if (!n) return;
|
|
3112
3112
|
let a = !1, o = [];
|
|
@@ -3115,9 +3115,9 @@ function wo(e, t = Co) {
|
|
|
3115
3115
|
t.remove(n);
|
|
3116
3116
|
return;
|
|
3117
3117
|
}
|
|
3118
|
-
o = n, !(n.length === 0 && r.size === 0) && (
|
|
3118
|
+
o = n, !(n.length === 0 && r.size === 0) && (Tr(r.size > 0 ? r : null), e.remeasure());
|
|
3119
3119
|
}), i(() => {
|
|
3120
|
-
a = !0, t.remove(o),
|
|
3120
|
+
a = !0, t.remove(o), Tr(null);
|
|
3121
3121
|
});
|
|
3122
3122
|
}, { immediate: !0 }), K(e.fonts, (n, r, i) => {
|
|
3123
3123
|
if (!n || n.length === 0) return;
|
|
@@ -3135,7 +3135,7 @@ function wo(e, t = Co) {
|
|
|
3135
3135
|
}
|
|
3136
3136
|
//#endregion
|
|
3137
3137
|
//#region src/composables/useHyperlinkManagement.ts
|
|
3138
|
-
function
|
|
3138
|
+
function Oo(e) {
|
|
3139
3139
|
let t = H(null);
|
|
3140
3140
|
function n(e, t) {
|
|
3141
3141
|
t(e.state, (t) => e.dispatch(t), e);
|
|
@@ -3162,19 +3162,19 @@ function To(e) {
|
|
|
3162
3162
|
r && n(t, r()), t.focus();
|
|
3163
3163
|
}
|
|
3164
3164
|
function a(e) {
|
|
3165
|
-
let n =
|
|
3165
|
+
let n = Ar(e);
|
|
3166
3166
|
n && (window.open(n, "_blank", "noopener,noreferrer"), t.value = null);
|
|
3167
3167
|
}
|
|
3168
3168
|
function o(n, r) {
|
|
3169
3169
|
let i = e.editorView.value;
|
|
3170
|
-
i && (
|
|
3170
|
+
i && (Or(i, {
|
|
3171
3171
|
displayText: n,
|
|
3172
3172
|
href: r
|
|
3173
3173
|
}), t.value = null, i.focus());
|
|
3174
3174
|
}
|
|
3175
3175
|
function s() {
|
|
3176
3176
|
let n = e.editorView.value;
|
|
3177
|
-
n && (
|
|
3177
|
+
n && (kr(n, { popupHref: t.value?.href }), t.value = null, n.focus());
|
|
3178
3178
|
}
|
|
3179
3179
|
return {
|
|
3180
3180
|
hyperlinkPopupData: t,
|
|
@@ -3187,7 +3187,7 @@ function To(e) {
|
|
|
3187
3187
|
}
|
|
3188
3188
|
//#endregion
|
|
3189
3189
|
//#region src/composables/useImageActions.ts
|
|
3190
|
-
function
|
|
3190
|
+
function ko(e) {
|
|
3191
3191
|
let t = Ne(null), n = H(!1), r = k(() => {
|
|
3192
3192
|
e.stateTick.value;
|
|
3193
3193
|
let n = e.editorView.value, r = t.value;
|
|
@@ -3207,9 +3207,9 @@ function Eo(e) {
|
|
|
3207
3207
|
function a(n) {
|
|
3208
3208
|
let r = e.editorView.value, a = t.value;
|
|
3209
3209
|
if (!r || !a) return;
|
|
3210
|
-
let o =
|
|
3210
|
+
let o = Bt(n);
|
|
3211
3211
|
if (!o) return;
|
|
3212
|
-
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu:
|
|
3212
|
+
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu: It(a.element, e.zoom.value) } : void 0, c = e.getCommands().setImageWrapType;
|
|
3213
3213
|
c && (i(r, c(a.pmPos, o, s)), r.focus());
|
|
3214
3214
|
}
|
|
3215
3215
|
function o(n) {
|
|
@@ -3237,9 +3237,9 @@ function Eo(e) {
|
|
|
3237
3237
|
}
|
|
3238
3238
|
//#endregion
|
|
3239
3239
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
3240
|
-
function
|
|
3240
|
+
function Ao(e) {
|
|
3241
3241
|
function t(t) {
|
|
3242
|
-
if (
|
|
3242
|
+
if (jr(t, {
|
|
3243
3243
|
scope: e.scope(),
|
|
3244
3244
|
roots: e.roots.map((e) => e.value)
|
|
3245
3245
|
}) && (e.handleZoomKeyDown(t), t.ctrlKey || t.metaKey)) {
|
|
@@ -3255,10 +3255,10 @@ function Do(e) {
|
|
|
3255
3255
|
}
|
|
3256
3256
|
//#endregion
|
|
3257
3257
|
//#region src/composables/useOutlineSidebar.ts
|
|
3258
|
-
function
|
|
3258
|
+
function jo(e) {
|
|
3259
3259
|
function t() {
|
|
3260
3260
|
let t = e.editorView.value;
|
|
3261
|
-
t && (e.outlineHeadings.value =
|
|
3261
|
+
t && (e.outlineHeadings.value = Mr(t.state.doc, Ve(t.state)));
|
|
3262
3262
|
}
|
|
3263
3263
|
function n() {
|
|
3264
3264
|
e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
|
|
@@ -3289,7 +3289,7 @@ function Oo(e) {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
//#endregion
|
|
3291
3291
|
//#region src/composables/usePageSetupControls.ts
|
|
3292
|
-
function
|
|
3292
|
+
function Mo(e) {
|
|
3293
3293
|
function t(t) {
|
|
3294
3294
|
if (e.readOnly.value) return;
|
|
3295
3295
|
let n = e.getDocument();
|
|
@@ -3317,19 +3317,19 @@ function ko(e) {
|
|
|
3317
3317
|
}
|
|
3318
3318
|
function s(t) {
|
|
3319
3319
|
let n = e.editorView.value;
|
|
3320
|
-
n &&
|
|
3320
|
+
n && yr(t)(n.state, n.dispatch);
|
|
3321
3321
|
}
|
|
3322
3322
|
function c(t) {
|
|
3323
3323
|
let n = e.editorView.value;
|
|
3324
|
-
n &&
|
|
3324
|
+
n && br(t)(n.state, n.dispatch);
|
|
3325
3325
|
}
|
|
3326
3326
|
function l(t) {
|
|
3327
3327
|
let n = e.editorView.value;
|
|
3328
|
-
n && (t < 0 ?
|
|
3328
|
+
n && (t < 0 ? vr(-t, !0)(n.state, n.dispatch) : vr(t, !1)(n.state, n.dispatch));
|
|
3329
3329
|
}
|
|
3330
3330
|
function u(t) {
|
|
3331
3331
|
let n = e.editorView.value;
|
|
3332
|
-
n &&
|
|
3332
|
+
n && _r(t)(n.state, n.dispatch);
|
|
3333
3333
|
}
|
|
3334
3334
|
return {
|
|
3335
3335
|
handlePageSetupApply: t,
|
|
@@ -3345,45 +3345,45 @@ function ko(e) {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
//#endregion
|
|
3347
3347
|
//#region src/utils/textSelection.ts
|
|
3348
|
-
var
|
|
3349
|
-
function
|
|
3350
|
-
return !e || e.length === 0 ? !1 :
|
|
3348
|
+
var No = /[\p{L}\p{N}\p{M}_''-]/u, Po = /\s/;
|
|
3349
|
+
function Fo(e) {
|
|
3350
|
+
return !e || e.length === 0 ? !1 : No.test(e);
|
|
3351
3351
|
}
|
|
3352
|
-
function
|
|
3353
|
-
return !e || e.length === 0 ? !1 :
|
|
3352
|
+
function Io(e) {
|
|
3353
|
+
return !e || e.length === 0 ? !1 : Po.test(e);
|
|
3354
3354
|
}
|
|
3355
|
-
function
|
|
3355
|
+
function Lo(e, t) {
|
|
3356
3356
|
if (!e || e.length === 0) return [0, 0];
|
|
3357
3357
|
t = Math.max(0, Math.min(t, e.length - 1));
|
|
3358
3358
|
let n = e[t];
|
|
3359
|
-
if (
|
|
3359
|
+
if (Io(n)) {
|
|
3360
3360
|
let n = t, r = t;
|
|
3361
|
-
for (; n > 0 &&
|
|
3362
|
-
for (; r < e.length &&
|
|
3361
|
+
for (; n > 0 && Io(e[n - 1]);) n--;
|
|
3362
|
+
for (; r < e.length && Io(e[r]);) r++;
|
|
3363
3363
|
return [n, r];
|
|
3364
3364
|
}
|
|
3365
|
-
if (
|
|
3365
|
+
if (Fo(n)) {
|
|
3366
3366
|
let n = t, r = t;
|
|
3367
|
-
for (; n > 0 &&
|
|
3368
|
-
for (; r < e.length &&
|
|
3367
|
+
for (; n > 0 && Fo(e[n - 1]);) n--;
|
|
3368
|
+
for (; r < e.length && Fo(e[r]);) r++;
|
|
3369
3369
|
return [n, r];
|
|
3370
3370
|
}
|
|
3371
3371
|
return [t, t + 1];
|
|
3372
3372
|
}
|
|
3373
3373
|
//#endregion
|
|
3374
3374
|
//#region src/utils/domQueries.ts
|
|
3375
|
-
function
|
|
3376
|
-
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) :
|
|
3375
|
+
function Ro(e, t, n) {
|
|
3376
|
+
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : Zt(e);
|
|
3377
3377
|
for (let e of r) {
|
|
3378
3378
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
3379
3379
|
if (!Number.isNaN(n) && !Number.isNaN(r) && t >= n && t <= r) return e;
|
|
3380
3380
|
}
|
|
3381
3381
|
return null;
|
|
3382
3382
|
}
|
|
3383
|
-
function
|
|
3383
|
+
function zo(e, t, n) {
|
|
3384
3384
|
if (!e || !t) return;
|
|
3385
|
-
let r =
|
|
3386
|
-
if (!r) for (let t of
|
|
3385
|
+
let r = Xt(e, n);
|
|
3386
|
+
if (!r) for (let t of Zt(e)) {
|
|
3387
3387
|
let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
|
|
3388
3388
|
if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
|
|
3389
3389
|
r = t;
|
|
@@ -3397,21 +3397,21 @@ function Io(e, t, n) {
|
|
|
3397
3397
|
behavior: "smooth"
|
|
3398
3398
|
});
|
|
3399
3399
|
}
|
|
3400
|
-
function
|
|
3400
|
+
function Bo(e, t, n, r) {
|
|
3401
3401
|
if (!e || !t) return null;
|
|
3402
|
-
let i =
|
|
3402
|
+
let i = Ut(e, n, r, 1);
|
|
3403
3403
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
3404
3404
|
}
|
|
3405
|
-
function
|
|
3405
|
+
function Vo(e, t, n, r) {
|
|
3406
3406
|
if (!e) return;
|
|
3407
|
-
let i =
|
|
3407
|
+
let i = Ro(e, t, r);
|
|
3408
3408
|
if (!i) return;
|
|
3409
|
-
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] =
|
|
3409
|
+
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = Lo(a, t - o), l = o + s, u = o + c;
|
|
3410
3410
|
l < u && n(l, u);
|
|
3411
3411
|
}
|
|
3412
|
-
function
|
|
3412
|
+
function Ho(e, t, n, r) {
|
|
3413
3413
|
if (!e) return;
|
|
3414
|
-
let i =
|
|
3414
|
+
let i = Ro(e, t, r);
|
|
3415
3415
|
if (!i) return;
|
|
3416
3416
|
let a = i.closest(".layout-paragraph");
|
|
3417
3417
|
if (!a) return;
|
|
@@ -3420,7 +3420,7 @@ function zo(e, t, n, r) {
|
|
|
3420
3420
|
}
|
|
3421
3421
|
//#endregion
|
|
3422
3422
|
//#region src/composables/usePagesPointer.ts
|
|
3423
|
-
var
|
|
3423
|
+
var Uo = 500, Wo = ({ editState: e, getDocument: t, getHfPmView: n, onDocumentChange: r, reLayout: i, setDocument: a, syncHfPMs: o }) => {
|
|
3424
3424
|
let s = e.value, c = t();
|
|
3425
3425
|
if (!c?.package || !s?.rId) {
|
|
3426
3426
|
e.value = null;
|
|
@@ -3436,21 +3436,21 @@ var Bo = 500, Vo = ({ editState: e, getDocument: t, getHfPmView: n, onDocumentCh
|
|
|
3436
3436
|
e.value = null;
|
|
3437
3437
|
return;
|
|
3438
3438
|
}
|
|
3439
|
-
let d =
|
|
3439
|
+
let d = Pn({
|
|
3440
3440
|
document: c,
|
|
3441
3441
|
position: s.position,
|
|
3442
3442
|
isFirstPage: s.isFirstPage,
|
|
3443
3443
|
activeRId: s.rId,
|
|
3444
|
-
blocks:
|
|
3444
|
+
blocks: Cn(l.state.doc, u.content)
|
|
3445
3445
|
});
|
|
3446
3446
|
e.value = null, d && (a(d), o(), i(), r(d));
|
|
3447
3447
|
};
|
|
3448
|
-
function
|
|
3448
|
+
function Go(e) {
|
|
3449
3449
|
let t = H(null), n = null;
|
|
3450
3450
|
function r() {
|
|
3451
3451
|
n !== null && (clearTimeout(n), n = null);
|
|
3452
3452
|
}
|
|
3453
|
-
let i = Ne(null), a = 0, o = null, s = 0, c = !1, l = null, u =
|
|
3453
|
+
let i = Ne(null), a = 0, o = null, s = 0, c = !1, l = null, u = Lr(), d = S({
|
|
3454
3454
|
pagesContainer: e.pagesRef,
|
|
3455
3455
|
onScrollExtendSelection: (e, t) => {
|
|
3456
3456
|
if (!c || l === null) return;
|
|
@@ -3463,7 +3463,7 @@ function Ho(e) {
|
|
|
3463
3463
|
visible: !1
|
|
3464
3464
|
}), p = null;
|
|
3465
3465
|
function m(t, n) {
|
|
3466
|
-
return
|
|
3466
|
+
return Bo(e.pagesRef.value, e.editorView.value, t, n);
|
|
3467
3467
|
}
|
|
3468
3468
|
function h() {
|
|
3469
3469
|
let t = i.value;
|
|
@@ -3476,7 +3476,7 @@ function Ho(e) {
|
|
|
3476
3476
|
function g(t, n) {
|
|
3477
3477
|
let r = i.value, a = e.pagesRef.value, o = h();
|
|
3478
3478
|
if (r?.rId && a && o !== e.editorView.value) {
|
|
3479
|
-
let e =
|
|
3479
|
+
let e = Nr(a, r.position, r.rId, t, n);
|
|
3480
3480
|
return e === null || e < 0 ? null : Math.min(e, o?.state.doc.content.size ?? e);
|
|
3481
3481
|
}
|
|
3482
3482
|
return m(t, n);
|
|
@@ -3489,13 +3489,13 @@ function Ho(e) {
|
|
|
3489
3489
|
} catch {}
|
|
3490
3490
|
}
|
|
3491
3491
|
function v(t) {
|
|
3492
|
-
|
|
3492
|
+
zo(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
3493
3493
|
}
|
|
3494
3494
|
function y(t) {
|
|
3495
|
-
|
|
3495
|
+
Vo(e.pagesRef.value, t, _, i.value?.position);
|
|
3496
3496
|
}
|
|
3497
3497
|
function b(t) {
|
|
3498
|
-
|
|
3498
|
+
Ho(e.pagesRef.value, t, _, i.value?.position);
|
|
3499
3499
|
}
|
|
3500
3500
|
function x(t) {
|
|
3501
3501
|
let n = e.editorView.value;
|
|
@@ -3524,7 +3524,7 @@ function Ho(e) {
|
|
|
3524
3524
|
if (!o) return;
|
|
3525
3525
|
let s = e.pagesViewportRef.value;
|
|
3526
3526
|
if (!s || !(a.target instanceof HTMLElement) || a.target.closest(".docx-editor-vue__note-editor")) return;
|
|
3527
|
-
let l =
|
|
3527
|
+
let l = Ir({
|
|
3528
3528
|
mouseX: a.clientX,
|
|
3529
3529
|
mouseY: a.clientY,
|
|
3530
3530
|
pagesContainer: o,
|
|
@@ -3534,7 +3534,7 @@ function Ho(e) {
|
|
|
3534
3534
|
if (!l) {
|
|
3535
3535
|
n === null && (n = setTimeout(() => {
|
|
3536
3536
|
t.value = null, n = null;
|
|
3537
|
-
},
|
|
3537
|
+
}, Fr));
|
|
3538
3538
|
return;
|
|
3539
3539
|
}
|
|
3540
3540
|
let u = e.zoom.value || 1, d = s.getBoundingClientRect();
|
|
@@ -3585,7 +3585,7 @@ function Ho(e) {
|
|
|
3585
3585
|
if (e.readOnly.value || !(t.target instanceof HTMLElement)) return;
|
|
3586
3586
|
let n = t.target;
|
|
3587
3587
|
if (n.closest(".docx-editor-vue__note-editor")) return;
|
|
3588
|
-
let r =
|
|
3588
|
+
let r = Pr(n);
|
|
3589
3589
|
if (r) {
|
|
3590
3590
|
t.preventDefault(), t.stopPropagation(), i.value && ie(), e.openNoteStory(r);
|
|
3591
3591
|
return;
|
|
@@ -3595,11 +3595,11 @@ function Ho(e) {
|
|
|
3595
3595
|
if (!s) return;
|
|
3596
3596
|
let c = a ? "header" : "footer", l = e.getDocument();
|
|
3597
3597
|
if (!l?.package) return;
|
|
3598
|
-
let u = s.closest("[data-page-number]"), d = Number.parseInt(u?.dataset.pageNumber ?? "1", 10), f =
|
|
3598
|
+
let u = s.closest("[data-page-number]"), d = Number.parseInt(u?.dataset.pageNumber ?? "1", 10), f = Nn(l.package), p = f.hasTitlePg && d === 1, m = jn(f, c, p);
|
|
3599
3599
|
if (!m) {
|
|
3600
|
-
let t =
|
|
3600
|
+
let t = An(l, c, p);
|
|
3601
3601
|
if (!t) return;
|
|
3602
|
-
e.setDocument(t), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(t), f =
|
|
3602
|
+
e.setDocument(t), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(t), f = Nn(t.package), m = jn(f, c, p);
|
|
3603
3603
|
}
|
|
3604
3604
|
if (!m) return;
|
|
3605
3605
|
let h = m, g = e.pagesViewportRef.value;
|
|
@@ -3619,7 +3619,7 @@ function Ho(e) {
|
|
|
3619
3619
|
}, requestAnimationFrame(() => {
|
|
3620
3620
|
let n = e.getHfPmView(h);
|
|
3621
3621
|
if (!n) return;
|
|
3622
|
-
let r =
|
|
3622
|
+
let r = Nr(e.pagesRef.value ?? s, c, h, t.clientX, t.clientY);
|
|
3623
3623
|
if (r !== null) {
|
|
3624
3624
|
let e = Math.max(0, Math.min(r, n.state.doc.content.size));
|
|
3625
3625
|
n.dispatch(n.state.tr.setSelection(Z.create(n.state.doc, e)));
|
|
@@ -3628,7 +3628,7 @@ function Ho(e) {
|
|
|
3628
3628
|
});
|
|
3629
3629
|
}
|
|
3630
3630
|
function ie() {
|
|
3631
|
-
|
|
3631
|
+
Wo({
|
|
3632
3632
|
editState: i,
|
|
3633
3633
|
getDocument: e.getDocument,
|
|
3634
3634
|
getHfPmView: e.getHfPmView,
|
|
@@ -3644,7 +3644,7 @@ function Ho(e) {
|
|
|
3644
3644
|
i.value = null;
|
|
3645
3645
|
return;
|
|
3646
3646
|
}
|
|
3647
|
-
let r =
|
|
3647
|
+
let r = Mn({
|
|
3648
3648
|
document: t,
|
|
3649
3649
|
position: n.position,
|
|
3650
3650
|
activeRId: n.rId
|
|
@@ -3680,13 +3680,13 @@ function Ho(e) {
|
|
|
3680
3680
|
}
|
|
3681
3681
|
let f = h() ?? n;
|
|
3682
3682
|
if (!e.readOnly.value && e.tableResize.tryStartResize(t, f)) return;
|
|
3683
|
-
let p =
|
|
3683
|
+
let p = Rt(r);
|
|
3684
3684
|
if (p) {
|
|
3685
3685
|
t.preventDefault(), t.stopPropagation();
|
|
3686
3686
|
let n = Number(p.dataset.pmStart);
|
|
3687
3687
|
if (!Number.isNaN(n)) {
|
|
3688
3688
|
try {
|
|
3689
|
-
f.dispatch(f.state.tr.setSelection(
|
|
3689
|
+
f.dispatch(f.state.tr.setSelection(Mt.create(f.state.doc, n)));
|
|
3690
3690
|
} catch {}
|
|
3691
3691
|
e.selectedImage.value = {
|
|
3692
3692
|
element: p,
|
|
@@ -3705,12 +3705,12 @@ function Ho(e) {
|
|
|
3705
3705
|
return;
|
|
3706
3706
|
}
|
|
3707
3707
|
let v = Date.now();
|
|
3708
|
-
if (v - a <
|
|
3708
|
+
if (v - a < Uo && o === m ? s++ : s = 1, a = v, o = m, s === 2) y(m);
|
|
3709
3709
|
else if (s >= 3) b(m), s = 0;
|
|
3710
3710
|
else if (t.shiftKey) {
|
|
3711
3711
|
let { from: e } = f.state.selection;
|
|
3712
3712
|
_(e, m);
|
|
3713
|
-
} else _(m), l = m, c = !0, u.begin(
|
|
3713
|
+
} else _(m), l = m, c = !0, u.begin(Rr(f, m));
|
|
3714
3714
|
f.focus();
|
|
3715
3715
|
}
|
|
3716
3716
|
function se(e) {
|
|
@@ -3778,8 +3778,8 @@ function Ho(e) {
|
|
|
3778
3778
|
}
|
|
3779
3779
|
//#endregion
|
|
3780
3780
|
//#region src/composables/useRemoteSelectionSync.ts
|
|
3781
|
-
var
|
|
3782
|
-
let t = new
|
|
3781
|
+
var Ko = (e) => {
|
|
3782
|
+
let t = new zr(), n = null, r = () => {
|
|
3783
3783
|
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3784
3784
|
let r = e.pagesRef.value;
|
|
3785
3785
|
r && t.clear(r);
|
|
@@ -3802,8 +3802,8 @@ var Uo = (e) => {
|
|
|
3802
3802
|
], i, { flush: "post" }), B(() => {
|
|
3803
3803
|
a(), r();
|
|
3804
3804
|
});
|
|
3805
|
-
},
|
|
3806
|
-
let t = new
|
|
3805
|
+
}, qo = (e) => {
|
|
3806
|
+
let t = new Br(), n = null, r = () => {
|
|
3807
3807
|
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3808
3808
|
let r = e.pagesRef.value;
|
|
3809
3809
|
r && t.clear(r);
|
|
@@ -3817,8 +3817,8 @@ var Uo = (e) => {
|
|
|
3817
3817
|
state: i.state,
|
|
3818
3818
|
zoom: e.zoom.value,
|
|
3819
3819
|
zIndex: ae.selectionOverlay
|
|
3820
|
-
}), { selection: o } = i.state, s = r.getBoundingClientRect(), c = o.empty ?
|
|
3821
|
-
if (
|
|
3820
|
+
}), { selection: o } = i.state, s = r.getBoundingClientRect(), c = o.empty ? Wt(r, o.head, s) : null;
|
|
3821
|
+
if ($t({
|
|
3822
3822
|
hiddenHost: e.hiddenContainer.value,
|
|
3823
3823
|
editorView: i,
|
|
3824
3824
|
visibleCaret: c ? {
|
|
@@ -3849,27 +3849,27 @@ var Uo = (e) => {
|
|
|
3849
3849
|
}, { immediate: !0 });
|
|
3850
3850
|
let o = typeof window > "u" ? null : window;
|
|
3851
3851
|
return o?.addEventListener("scroll", i, !0), B(() => {
|
|
3852
|
-
a(), r(), o?.removeEventListener("scroll", i, !0),
|
|
3852
|
+
a(), r(), o?.removeEventListener("scroll", i, !0), Qt(e.hiddenContainer.value);
|
|
3853
3853
|
}), {
|
|
3854
3854
|
clearOverlay: r,
|
|
3855
3855
|
updateSelectionOverlay: i
|
|
3856
3856
|
};
|
|
3857
|
-
},
|
|
3857
|
+
}, Jo = { class: "docx-editor-vue__toolbar-shell" }, Yo = {
|
|
3858
3858
|
key: 0,
|
|
3859
3859
|
class: "docx-editor-vue__error"
|
|
3860
|
-
},
|
|
3860
|
+
}, Xo = {
|
|
3861
3861
|
key: 1,
|
|
3862
3862
|
class: "docx-editor-vue__loading"
|
|
3863
|
-
},
|
|
3863
|
+
}, Zo = {
|
|
3864
3864
|
key: 2,
|
|
3865
3865
|
class: "docx-editor-vue__placeholder"
|
|
3866
|
-
},
|
|
3866
|
+
}, Qo = { class: "docx-editor-vue__editor-area" }, $o = {
|
|
3867
3867
|
key: 0,
|
|
3868
3868
|
class: "docx-editor-vue__ruler-h"
|
|
3869
|
-
},
|
|
3869
|
+
}, es = {
|
|
3870
3870
|
key: 1,
|
|
3871
3871
|
class: "docx-editor-vue__ruler-v"
|
|
3872
|
-
},
|
|
3872
|
+
}, ts = {
|
|
3873
3873
|
class: "docx-editor-vue__editor-content-wrapper",
|
|
3874
3874
|
style: {
|
|
3875
3875
|
position: "relative",
|
|
@@ -3877,11 +3877,11 @@ var Uo = (e) => {
|
|
|
3877
3877
|
flexDirection: "column",
|
|
3878
3878
|
minHeight: "100%"
|
|
3879
3879
|
}
|
|
3880
|
-
},
|
|
3880
|
+
}, ns = {
|
|
3881
3881
|
"data-testid": "selection-overlay",
|
|
3882
3882
|
class: "docx-editor-vue__decoration-origin",
|
|
3883
3883
|
"aria-hidden": "true"
|
|
3884
|
-
},
|
|
3884
|
+
}, rs = ["aria-label"], is = { class: "docx-editor-vue__note-editor-header" }, as = ["aria-label"], os = ["aria-label"], ss = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
3885
3885
|
__name: "DocxEditor",
|
|
3886
3886
|
props: {
|
|
3887
3887
|
documentBuffer: { default: null },
|
|
@@ -4008,13 +4008,13 @@ var Uo = (e) => {
|
|
|
4008
4008
|
let o = e, s = o.plugins ?? [], c = n;
|
|
4009
4009
|
a(o.components);
|
|
4010
4010
|
let l = fe();
|
|
4011
|
-
|
|
4011
|
+
Ci(l);
|
|
4012
4012
|
function u(e) {
|
|
4013
4013
|
o.onChange?.(e), c("change", e), c("update:document", e);
|
|
4014
4014
|
}
|
|
4015
|
-
let d = H(o.mode), f = k(() => o.readOnly || d.value === "viewing"), p = k(() => o.showReviewControls), m = k(() =>
|
|
4015
|
+
let d = H(o.mode), f = k(() => o.readOnly || d.value === "viewing"), p = k(() => o.showReviewControls), m = k(() => Vt(d.value)), h = H("all-markup");
|
|
4016
4016
|
function _() {
|
|
4017
|
-
Jn(
|
|
4017
|
+
Jn(Ht(d.value));
|
|
4018
4018
|
}
|
|
4019
4019
|
function x(e) {
|
|
4020
4020
|
h.value = e;
|
|
@@ -4025,18 +4025,18 @@ var Uo = (e) => {
|
|
|
4025
4025
|
K(ae, (e) => {
|
|
4026
4026
|
e || (S.value = !1);
|
|
4027
4027
|
});
|
|
4028
|
-
let oe = H(null), C = H(null), ue = H(null), w = H(null), pe = H(null), me = H(null), he = H(null), ge = k(() => o.showRuler ?? !1), T = H(0), E = H(!1), _e = H(!1), ve = H(!1), ye = H(!1), be = H(!1), xe = H(!1), Se = H(!1), O = H(o.showOutline), A = H(!1), we = H(null), I = H(null), Ee = H(null), De = Ne([]), ke = Ne([]), { zoom: B, zoomPercent: je, isMinZoom: U, isMaxZoom: Pe, setZoom: ze, zoomIn: Ve, zoomOut: He, handleWheel:
|
|
4029
|
-
function
|
|
4030
|
-
o.enableWheelZoom !== !1 &&
|
|
4028
|
+
let oe = H(null), C = H(null), ue = H(null), w = H(null), pe = H(null), me = H(null), he = H(null), ge = k(() => o.showRuler ?? !1), T = H(0), E = H(!1), _e = H(!1), ve = H(!1), ye = H(!1), be = H(!1), xe = H(!1), Se = H(!1), O = H(o.showOutline), A = H(!1), we = H(null), I = H(null), Ee = H(null), De = Ne([]), ke = Ne([]), { zoom: B, zoomPercent: je, isMinZoom: U, isMaxZoom: Pe, setZoom: ze, zoomIn: Ve, zoomOut: He, handleWheel: Ue, handleKeyDown: We, ZOOM_PRESETS: Ke } = de(o.initialZoom);
|
|
4029
|
+
function Je(e) {
|
|
4030
|
+
o.enableWheelZoom !== !1 && Ue(e);
|
|
4031
4031
|
}
|
|
4032
|
-
|
|
4032
|
+
Ao({
|
|
4033
4033
|
showFindReplace: E,
|
|
4034
4034
|
showHyperlink: _e,
|
|
4035
|
-
handleZoomKeyDown:
|
|
4035
|
+
handleZoomKeyDown: We,
|
|
4036
4036
|
scope: () => o.keyboardShortcuts ?? "document",
|
|
4037
4037
|
roots: [oe]
|
|
4038
4038
|
});
|
|
4039
|
-
let { editor:
|
|
4039
|
+
let { editor: Xe, editorView: J, editorState: st, remoteSelections: lt, headerFooterSelection: dt, activeNoteStory: ft, isReady: pt, isDirty: mt, parseError: ht, layout: gt, blocks: _t, measures: vt, syncCoordinator: yt, loadBuffer: bt, loadDocument: xt, save: St, getDocument: Y, setDocument: Ct, getHeaderFooterView: wt, syncHeaderFooterViews: Tt, openNoteStory: Et, closeNoteStory: Dt, getActiveNoteView: Ot, getCommands: kt, reLayout: At } = ce({
|
|
4040
4040
|
hiddenContainer: C,
|
|
4041
4041
|
hiddenHeaderFooterContainer: ue,
|
|
4042
4042
|
noteEditorContainer: Ee,
|
|
@@ -4076,56 +4076,56 @@ var Uo = (e) => {
|
|
|
4076
4076
|
featureFlags: () => o.featureFlags,
|
|
4077
4077
|
onSelectiveSaveTripwire: o.onSelectiveSaveTripwire ? (e) => o.onSelectiveSaveTripwire?.(e) : void 0
|
|
4078
4078
|
});
|
|
4079
|
-
K(
|
|
4079
|
+
K(st, (e, t) => {
|
|
4080
4080
|
he.value !== null && e && t && !e.doc.eq(t.doc) && (he.value = null);
|
|
4081
4081
|
});
|
|
4082
|
-
let X = k(() =>
|
|
4082
|
+
let X = k(() => nt({
|
|
4083
4083
|
bodyView: J.value,
|
|
4084
4084
|
headerFooterView: I.value ? wt(I.value) : null,
|
|
4085
4085
|
noteView: Ot()
|
|
4086
4086
|
}).view), jt = k(() => {
|
|
4087
4087
|
let e = ft.value;
|
|
4088
4088
|
return e ? te(e.kind === "footnote" ? "dialogs.footnoteProperties.footnotes" : "dialogs.footnoteProperties.endnotes") : "";
|
|
4089
|
-
}),
|
|
4090
|
-
function
|
|
4091
|
-
J.value && (
|
|
4089
|
+
}), Mt = k(() => !pt.value && ae.value && !(o.preserveDocumentWhileLoading === !0 && S.value));
|
|
4090
|
+
function Nt() {
|
|
4091
|
+
J.value && (it(), rt(), At());
|
|
4092
4092
|
}
|
|
4093
|
-
|
|
4093
|
+
Do({
|
|
4094
4094
|
isReady: pt,
|
|
4095
4095
|
getDocument: Y,
|
|
4096
4096
|
fonts: () => o.fonts,
|
|
4097
|
-
remeasure:
|
|
4097
|
+
remeasure: Nt
|
|
4098
4098
|
});
|
|
4099
|
-
let { selectedImage:
|
|
4099
|
+
let { selectedImage: Z, imageInteracting: Pt, imageToolbarContext: Ft, handleToolbarImageWrap: It, handleImageTransform: Lt } = ko({
|
|
4100
4100
|
editorView: X,
|
|
4101
4101
|
zoom: B,
|
|
4102
4102
|
stateTick: T,
|
|
4103
4103
|
getCommands: kt
|
|
4104
|
-
}), Rt =
|
|
4104
|
+
}), Rt = qo({
|
|
4105
4105
|
editorView: J,
|
|
4106
4106
|
hiddenContainer: C,
|
|
4107
4107
|
pagesRef: w,
|
|
4108
4108
|
zoom: B,
|
|
4109
|
-
selectedImage:
|
|
4109
|
+
selectedImage: Z,
|
|
4110
4110
|
syncCoordinator: yt,
|
|
4111
4111
|
imageInteracting: Pt
|
|
4112
4112
|
});
|
|
4113
|
-
|
|
4113
|
+
Ko({
|
|
4114
4114
|
pagesRef: w,
|
|
4115
|
-
remoteSelections:
|
|
4115
|
+
remoteSelections: lt,
|
|
4116
4116
|
syncCoordinator: yt,
|
|
4117
4117
|
zoom: B
|
|
4118
4118
|
});
|
|
4119
|
-
let { hyperlinkPopupData:
|
|
4119
|
+
let { hyperlinkPopupData: zt, handleHyperlinkSubmit: Bt, handleHyperlinkRemove: Ut, handleHyperlinkPopupNavigate: Wt, handleHyperlinkPopupEdit: Gt, handleHyperlinkPopupRemove: Kt } = Oo({
|
|
4120
4120
|
editorView: X,
|
|
4121
4121
|
getCommands: kt
|
|
4122
|
-
}), qt = se(), { tableInsertButton: Jt, hfEdit: Yt, scrollPageInfo: Xt, resolvePos: Zt, setPmSelection: Qt, scrollVisiblePositionIntoView: $t, handlePagesMouseDown: en, handlePagesMouseMove: tn, handlePagesClick: nn, handlePagesDoubleClick: rn, handleTableInsertClick: an, handleHfSave: on, handleHfRemove: sn } =
|
|
4122
|
+
}), qt = se(), { tableInsertButton: Jt, hfEdit: Yt, scrollPageInfo: Xt, resolvePos: Zt, setPmSelection: Qt, scrollVisiblePositionIntoView: $t, handlePagesMouseDown: en, handlePagesMouseMove: tn, handlePagesClick: nn, handlePagesDoubleClick: rn, handleTableInsertClick: an, handleHfSave: on, handleHfRemove: sn } = Go({
|
|
4123
4123
|
editorView: J,
|
|
4124
4124
|
pagesRef: w,
|
|
4125
4125
|
pagesViewportRef: pe,
|
|
4126
|
-
selectedImage:
|
|
4126
|
+
selectedImage: Z,
|
|
4127
4127
|
imageInteracting: Pt,
|
|
4128
|
-
hyperlinkPopupData:
|
|
4128
|
+
hyperlinkPopupData: zt,
|
|
4129
4129
|
readOnly: f,
|
|
4130
4130
|
showHeaderFooterEditing: k(() => o.showHeaderFooterEditing),
|
|
4131
4131
|
zoom: B,
|
|
@@ -4157,7 +4157,7 @@ var Uo = (e) => {
|
|
|
4157
4157
|
K(Yt, (e) => {
|
|
4158
4158
|
I.value = e?.rId ?? null, e && Rt.clearOverlay();
|
|
4159
4159
|
}, { immediate: !0 });
|
|
4160
|
-
let un =
|
|
4160
|
+
let un = jo({
|
|
4161
4161
|
editorView: J,
|
|
4162
4162
|
showOutline: O,
|
|
4163
4163
|
showSidebar: A,
|
|
@@ -4165,9 +4165,9 @@ var Uo = (e) => {
|
|
|
4165
4165
|
activeSidebarItem: we,
|
|
4166
4166
|
extractCommentsAndChanges: () => {},
|
|
4167
4167
|
scrollToVisiblePosition: $t
|
|
4168
|
-
}), { contextMenu: dn, imageContextMenu: fn, imageContextMenuTextActions: pn, customTextMenuItems: mn, handleContextMenu: hn, handleSelectedImageContextMenu: gn, handleImageWrapSelect: _n, handleContextMenuAction: vn } =
|
|
4168
|
+
}), { contextMenu: dn, imageContextMenu: fn, imageContextMenuTextActions: pn, customTextMenuItems: mn, handleContextMenu: hn, handleSelectedImageContextMenu: gn, handleImageWrapSelect: _n, handleContextMenuAction: vn } = uo({
|
|
4169
4169
|
editorView: X,
|
|
4170
|
-
selectedImage:
|
|
4170
|
+
selectedImage: Z,
|
|
4171
4171
|
zoom: B,
|
|
4172
4172
|
showImageProperties: ye,
|
|
4173
4173
|
getCommands: kt,
|
|
@@ -4179,7 +4179,7 @@ var Uo = (e) => {
|
|
|
4179
4179
|
onCopy: () => o.onCopy?.(),
|
|
4180
4180
|
onCut: () => o.onCut?.(),
|
|
4181
4181
|
onPaste: () => o.onPaste?.()
|
|
4182
|
-
}), yn = le(J, T), bn = k(() => yn.value.entries), Q =
|
|
4182
|
+
}), yn = le(J, T), bn = k(() => yn.value.entries), Q = Qa({
|
|
4183
4183
|
editorView: J,
|
|
4184
4184
|
getDocument: Y,
|
|
4185
4185
|
author: () => o.author,
|
|
@@ -4188,7 +4188,7 @@ var Uo = (e) => {
|
|
|
4188
4188
|
o.onCommentsChange?.(e), c("comments-change", e);
|
|
4189
4189
|
},
|
|
4190
4190
|
reLayout: At
|
|
4191
|
-
}), xn = Q.comments, $ =
|
|
4191
|
+
}), xn = Q.comments, $ = Za({
|
|
4192
4192
|
editorView: J,
|
|
4193
4193
|
pagesViewport: pe,
|
|
4194
4194
|
pagesContainer: w,
|
|
@@ -4202,7 +4202,7 @@ var Uo = (e) => {
|
|
|
4202
4202
|
}
|
|
4203
4203
|
});
|
|
4204
4204
|
function Sn(e) {
|
|
4205
|
-
navigator.clipboard?.writeText(e),
|
|
4205
|
+
navigator.clipboard?.writeText(e), zt.value = null;
|
|
4206
4206
|
}
|
|
4207
4207
|
let Cn = k(() => {
|
|
4208
4208
|
T.value;
|
|
@@ -4211,20 +4211,20 @@ var Uo = (e) => {
|
|
|
4211
4211
|
}), wn = k(() => {
|
|
4212
4212
|
T.value;
|
|
4213
4213
|
let e = Y();
|
|
4214
|
-
return e ?
|
|
4214
|
+
return e ? ct(e) : void 0;
|
|
4215
4215
|
}), Tn = k(() => {
|
|
4216
4216
|
T.value;
|
|
4217
4217
|
let e = X.value;
|
|
4218
4218
|
if (!e) return {};
|
|
4219
|
-
let t =
|
|
4220
|
-
return t ?
|
|
4219
|
+
let t = $e(e.state).table;
|
|
4220
|
+
return t ? Qe(t) : {};
|
|
4221
4221
|
}), En = k(() => {
|
|
4222
4222
|
T.value;
|
|
4223
4223
|
let e = {};
|
|
4224
4224
|
o.fontFamilies !== void 0 && (e.fontFamilies = o.fontFamilies);
|
|
4225
4225
|
let t = Y()?.package.styles?.styles;
|
|
4226
4226
|
return t !== void 0 && (e.documentStyles = t), e;
|
|
4227
|
-
}), Dn = k(() =>
|
|
4227
|
+
}), Dn = k(() => ot(Cn.value?.pageWidth ?? 12240) * B.value), On = k(() => {
|
|
4228
4228
|
let e = /* @__PURE__ */ new Set();
|
|
4229
4229
|
for (let t of xn.value) t.done && e.add(t.id);
|
|
4230
4230
|
return e;
|
|
@@ -4232,7 +4232,7 @@ var Uo = (e) => {
|
|
|
4232
4232
|
transform: B.value === 1 ? void 0 : `scale(${B.value})`,
|
|
4233
4233
|
transformOrigin: "top center",
|
|
4234
4234
|
transition: "transform 0.2s ease"
|
|
4235
|
-
})), { handleApplyStyle: An, handleInsertSymbol: jn, handleInsertSectionBreakNextPage: Mn, handleInsertSectionBreakContinuous: Nn } =
|
|
4235
|
+
})), { handleApplyStyle: An, handleInsertSymbol: jn, handleInsertSectionBreakNextPage: Mn, handleInsertSectionBreakContinuous: Nn } = go({
|
|
4236
4236
|
editorView: X,
|
|
4237
4237
|
getDocument: Y
|
|
4238
4238
|
});
|
|
@@ -4246,7 +4246,7 @@ var Uo = (e) => {
|
|
|
4246
4246
|
let t = document.createElement("input");
|
|
4247
4247
|
t.type = "file", t.accept = "image/*", t.style.display = "none", t.addEventListener("change", () => {
|
|
4248
4248
|
let n = t.files?.[0];
|
|
4249
|
-
n &&
|
|
4249
|
+
n && Ge(e, n, () => e.focus()), t.remove();
|
|
4250
4250
|
}), document.body.appendChild(t), t.click();
|
|
4251
4251
|
}
|
|
4252
4252
|
function Fn(e, t) {
|
|
@@ -4255,7 +4255,7 @@ var Uo = (e) => {
|
|
|
4255
4255
|
return;
|
|
4256
4256
|
}
|
|
4257
4257
|
let n = X.value;
|
|
4258
|
-
n && (
|
|
4258
|
+
n && (Ye(n, e, t), n.focus());
|
|
4259
4259
|
}
|
|
4260
4260
|
function In() {
|
|
4261
4261
|
if (o.onInsertPageBreak) {
|
|
@@ -4263,7 +4263,7 @@ var Uo = (e) => {
|
|
|
4263
4263
|
return;
|
|
4264
4264
|
}
|
|
4265
4265
|
let e = J.value;
|
|
4266
|
-
e && (
|
|
4266
|
+
e && (qe(e), e.focus());
|
|
4267
4267
|
}
|
|
4268
4268
|
function Ln() {
|
|
4269
4269
|
if (o.onInsertTOC) {
|
|
@@ -4271,9 +4271,9 @@ var Uo = (e) => {
|
|
|
4271
4271
|
return;
|
|
4272
4272
|
}
|
|
4273
4273
|
let e = J.value;
|
|
4274
|
-
e && (
|
|
4274
|
+
e && (Ze(e, { title: te("toolbar.tableOfContents") }), e.focus());
|
|
4275
4275
|
}
|
|
4276
|
-
let { handlePageSetupApply: Rn, handleLeftMarginChange: zn, handleRightMarginChange: Bn, handleTopMarginChange: Vn, handleBottomMarginChange: Hn, handleIndentLeftChange: Un, handleIndentRightChange: Wn, handleFirstLineIndentChange: Gn, handleTabStopRemove: Kn } =
|
|
4276
|
+
let { handlePageSetupApply: Rn, handleLeftMarginChange: zn, handleRightMarginChange: Bn, handleTopMarginChange: Vn, handleBottomMarginChange: Hn, handleIndentLeftChange: Un, handleIndentRightChange: Wn, handleFirstLineIndentChange: Gn, handleTabStopRemove: Kn } = Mo({
|
|
4277
4277
|
editorView: J,
|
|
4278
4278
|
getDocument: Y,
|
|
4279
4279
|
readOnly: f,
|
|
@@ -4282,7 +4282,7 @@ var Uo = (e) => {
|
|
|
4282
4282
|
onChange: u
|
|
4283
4283
|
}), qn = k(() => {
|
|
4284
4284
|
T.value;
|
|
4285
|
-
let e = X.value, t = e ?
|
|
4285
|
+
let e = X.value, t = e ? et(e.state).paragraphFormatting : {};
|
|
4286
4286
|
return {
|
|
4287
4287
|
indentLeft: t.indentLeft ?? 0,
|
|
4288
4288
|
indentRight: t.indentRight ?? 0,
|
|
@@ -4341,7 +4341,7 @@ var Uo = (e) => {
|
|
|
4341
4341
|
if (f.value) return;
|
|
4342
4342
|
let t = Y();
|
|
4343
4343
|
if (!t) return;
|
|
4344
|
-
let n =
|
|
4344
|
+
let n = ut(t, e);
|
|
4345
4345
|
Ct(n), mt.value = !0, T.value++, At(), u(n);
|
|
4346
4346
|
}
|
|
4347
4347
|
function Zn(e, t) {
|
|
@@ -4352,7 +4352,7 @@ var Uo = (e) => {
|
|
|
4352
4352
|
!t || !n || (n(e)(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
4353
4353
|
}
|
|
4354
4354
|
let $n = H(!1);
|
|
4355
|
-
|
|
4355
|
+
fo({
|
|
4356
4356
|
documentBuffer: () => o.documentBuffer ?? null,
|
|
4357
4357
|
document: () => o.document ?? null,
|
|
4358
4358
|
loadDocumentBuffer: bt,
|
|
@@ -4383,21 +4383,21 @@ var Uo = (e) => {
|
|
|
4383
4383
|
}
|
|
4384
4384
|
S.value = !0, un.recomputeHeadingsIfOpen(), Q.seedFromDocument();
|
|
4385
4385
|
let t = Y();
|
|
4386
|
-
t && o.onCompatibilityChange?.(
|
|
4386
|
+
t && o.onCompatibilityChange?.(tt(t)), o.autoOpenReviewSidebar !== !1 && !$n.value && (xn.value.length > 0 || bn.value.length > 0) && ($n.value = !0, A.value = !0), nr(), c("ready");
|
|
4387
4387
|
}), Ae(() => {
|
|
4388
|
-
let e =
|
|
4388
|
+
let e = Xe.on("selectionChange", () => {
|
|
4389
4389
|
T.value++, $.updateFloatingButton();
|
|
4390
|
-
}), t =
|
|
4390
|
+
}), t = Xe.on("docChange", () => {
|
|
4391
4391
|
T.value++, un.recomputeHeadingsIfOpen();
|
|
4392
|
-
}), n =
|
|
4392
|
+
}), n = Xe.on("layoutComplete", () => {
|
|
4393
4393
|
T.value++;
|
|
4394
|
-
}), r = qt.install(), i =
|
|
4394
|
+
}), r = qt.install(), i = at(() => o.onFontsLoaded?.());
|
|
4395
4395
|
z(() => {
|
|
4396
4396
|
e(), t(), n(), r(), i();
|
|
4397
4397
|
});
|
|
4398
4398
|
});
|
|
4399
|
-
let { exposed: rr } =
|
|
4400
|
-
editor:
|
|
4399
|
+
let { exposed: rr } = ho({
|
|
4400
|
+
editor: Xe,
|
|
4401
4401
|
editorView: J,
|
|
4402
4402
|
isDirty: mt,
|
|
4403
4403
|
commentsDirty: Q.commentsDirty,
|
|
@@ -4445,7 +4445,7 @@ var Uo = (e) => {
|
|
|
4445
4445
|
]),
|
|
4446
4446
|
style: R(e.style)
|
|
4447
4447
|
}, [
|
|
4448
|
-
P("div",
|
|
4448
|
+
P("div", Jo, [F(zi, {
|
|
4449
4449
|
"show-table-insert": o.showTableInsert !== !1,
|
|
4450
4450
|
onRename: n[0] ||= (e) => c("rename", e),
|
|
4451
4451
|
onMenuAction: Yn,
|
|
@@ -4462,7 +4462,7 @@ var Uo = (e) => {
|
|
|
4462
4462
|
"zoom-percent": G(je),
|
|
4463
4463
|
"is-min-zoom": G(U),
|
|
4464
4464
|
"is-max-zoom": G(Pe),
|
|
4465
|
-
"zoom-presets": G(
|
|
4465
|
+
"zoom-presets": G(Ke),
|
|
4466
4466
|
"show-zoom-control": e.showZoomControl,
|
|
4467
4467
|
"editor-mode": d.value,
|
|
4468
4468
|
"show-review-controls": p.value,
|
|
@@ -4536,7 +4536,7 @@ var Uo = (e) => {
|
|
|
4536
4536
|
"onImageWrapType",
|
|
4537
4537
|
"onImageTransform"
|
|
4538
4538
|
])) : M("", !0)]),
|
|
4539
|
-
F(
|
|
4539
|
+
F(Pi, {
|
|
4540
4540
|
"show-find-replace": E.value,
|
|
4541
4541
|
"onUpdate:showFindReplace": n[8] ||= (e) => E.value = e,
|
|
4542
4542
|
"show-hyperlink": _e.value,
|
|
@@ -4555,11 +4555,11 @@ var Uo = (e) => {
|
|
|
4555
4555
|
"scroll-visible-position-into-view": G($t),
|
|
4556
4556
|
bookmarks: De.value,
|
|
4557
4557
|
"current-watermark": wn.value,
|
|
4558
|
-
"selected-image-pm-pos": G(
|
|
4558
|
+
"selected-image-pm-pos": G(Z)?.pmPos ?? null,
|
|
4559
4559
|
"section-properties": Cn.value,
|
|
4560
4560
|
"table-properties": Tn.value,
|
|
4561
4561
|
onInsertSymbol: G(jn),
|
|
4562
|
-
onHyperlinkSubmit: G(
|
|
4562
|
+
onHyperlinkSubmit: G(Bt),
|
|
4563
4563
|
onHyperlinkRemove: G(Ut),
|
|
4564
4564
|
onPageSetupApply: G(Rn),
|
|
4565
4565
|
onTablePropertiesApply: Qn,
|
|
@@ -4584,10 +4584,10 @@ var Uo = (e) => {
|
|
|
4584
4584
|
"onHyperlinkRemove",
|
|
4585
4585
|
"onPageSetupApply"
|
|
4586
4586
|
]),
|
|
4587
|
-
G(ht) ? (V(), N("div",
|
|
4587
|
+
G(ht) ? (V(), N("div", Yo, W(G(ht)), 1)) : Mt.value ? (V(), N("div", Xo, [Me(t.$slots, "loading-indicator", {}, () => [e.loadingIndicator ? (V(), j(re, {
|
|
4588
4588
|
key: 0,
|
|
4589
4589
|
node: e.loadingIndicator
|
|
4590
|
-
}, null, 8, ["node"])) : (V(), N(D, { key: 1 }, [Te(W(G(te)("loadingDocument")), 1)], 64))], !0)])) : !G(pt) && !ae.value ? (V(), N("div",
|
|
4590
|
+
}, null, 8, ["node"])) : (V(), N(D, { key: 1 }, [Te(W(G(te)("loadingDocument")), 1)], 64))], !0)])) : !G(pt) && !ae.value ? (V(), N("div", Zo, [Me(t.$slots, "placeholder", {}, () => [e.placeholder ? (V(), j(re, {
|
|
4591
4591
|
key: 0,
|
|
4592
4592
|
node: e.placeholder
|
|
4593
4593
|
}, null, 8, ["node"])) : (V(), N(D, { key: 1 }, [Te("No document loaded")], 64))], !0)])) : M("", !0),
|
|
@@ -4606,8 +4606,8 @@ var Uo = (e) => {
|
|
|
4606
4606
|
ref: me,
|
|
4607
4607
|
class: "docx-editor-vue__editor-scroll",
|
|
4608
4608
|
onScroll: tr
|
|
4609
|
-
}, [P("div",
|
|
4610
|
-
ge.value && !f.value ? (V(), N("div",
|
|
4609
|
+
}, [P("div", Qo, [
|
|
4610
|
+
ge.value && !f.value ? (V(), N("div", $o, [F(ne, {
|
|
4611
4611
|
"section-props": Cn.value,
|
|
4612
4612
|
zoom: G(B),
|
|
4613
4613
|
unit: e.rulerUnit ?? "inch",
|
|
@@ -4641,7 +4641,7 @@ var Uo = (e) => {
|
|
|
4641
4641
|
"onFirstLineIndentChange",
|
|
4642
4642
|
"onTabStopRemove"
|
|
4643
4643
|
])])) : M("", !0),
|
|
4644
|
-
ge.value && !f.value ? (V(), N("div",
|
|
4644
|
+
ge.value && !f.value ? (V(), N("div", es, [F(v, {
|
|
4645
4645
|
"section-props": Cn.value,
|
|
4646
4646
|
zoom: G(B),
|
|
4647
4647
|
unit: e.rulerUnit ?? "inch",
|
|
@@ -4660,21 +4660,21 @@ var Uo = (e) => {
|
|
|
4660
4660
|
ref_key: "pagesViewportRef",
|
|
4661
4661
|
ref: pe,
|
|
4662
4662
|
class: "docx-editor-vue__pages-viewport",
|
|
4663
|
-
onWheel:
|
|
4663
|
+
onWheel: Je,
|
|
4664
4664
|
onMousedown: n[25] ||= (...e) => G(en) && G(en)(...e),
|
|
4665
4665
|
onMousemove: n[26] ||= (...e) => G(tn) && G(tn)(...e),
|
|
4666
4666
|
onClick: n[27] ||= (...e) => G(nn) && G(nn)(...e),
|
|
4667
4667
|
onDblclick: n[28] ||= (...e) => G(rn) && G(rn)(...e),
|
|
4668
4668
|
onContextmenu: n[29] ||= q((...e) => G(hn) && G(hn)(...e), ["prevent"])
|
|
4669
4669
|
}, [
|
|
4670
|
-
P("div",
|
|
4670
|
+
P("div", ts, [
|
|
4671
4671
|
P("div", {
|
|
4672
4672
|
ref_key: "pagesRef",
|
|
4673
4673
|
ref: w,
|
|
4674
4674
|
class: L(["docx-editor-vue__pages paged-editor__pages", G(Yt) ? `paged-editor--hf-editing paged-editor--editing-${G(Yt).position}` : ""]),
|
|
4675
4675
|
style: R(kn.value)
|
|
4676
4676
|
}, null, 6),
|
|
4677
|
-
F(
|
|
4677
|
+
F(xa, {
|
|
4678
4678
|
"editor-view": cn(),
|
|
4679
4679
|
"hidden-container": ue.value,
|
|
4680
4680
|
"pages-container": w.value,
|
|
@@ -4687,11 +4687,11 @@ var Uo = (e) => {
|
|
|
4687
4687
|
"selection",
|
|
4688
4688
|
"zoom"
|
|
4689
4689
|
]),
|
|
4690
|
-
P("div",
|
|
4691
|
-
F(
|
|
4690
|
+
P("div", ns, [
|
|
4691
|
+
F(hi, {
|
|
4692
4692
|
"get-view": () => G(J),
|
|
4693
4693
|
"get-pages-container": () => w.value,
|
|
4694
|
-
"editor-state": G(
|
|
4694
|
+
"editor-state": G(st),
|
|
4695
4695
|
zoom: G(B),
|
|
4696
4696
|
layout: G(gt),
|
|
4697
4697
|
blocks: G(_t),
|
|
@@ -4711,7 +4711,7 @@ var Uo = (e) => {
|
|
|
4711
4711
|
"selected-canonical",
|
|
4712
4712
|
"selection-seq"
|
|
4713
4713
|
]),
|
|
4714
|
-
F(
|
|
4714
|
+
F(_i, {
|
|
4715
4715
|
range: he.value,
|
|
4716
4716
|
"get-pages-container": () => w.value,
|
|
4717
4717
|
zoom: G(B),
|
|
@@ -4726,11 +4726,11 @@ var Uo = (e) => {
|
|
|
4726
4726
|
"blocks",
|
|
4727
4727
|
"measures"
|
|
4728
4728
|
]),
|
|
4729
|
-
o.showTemplateDirectives ? (V(), j(
|
|
4729
|
+
o.showTemplateDirectives ? (V(), j(Pa, {
|
|
4730
4730
|
key: 0,
|
|
4731
4731
|
"get-view": () => G(J),
|
|
4732
4732
|
"get-pages-container": () => w.value,
|
|
4733
|
-
"editor-state": G(
|
|
4733
|
+
"editor-state": G(st),
|
|
4734
4734
|
zoom: G(B),
|
|
4735
4735
|
layout: G(gt),
|
|
4736
4736
|
blocks: G(_t),
|
|
@@ -4744,9 +4744,9 @@ var Uo = (e) => {
|
|
|
4744
4744
|
"blocks",
|
|
4745
4745
|
"measures"
|
|
4746
4746
|
])) : M("", !0),
|
|
4747
|
-
F(
|
|
4747
|
+
F(xi, {
|
|
4748
4748
|
"get-pages-container": () => w.value,
|
|
4749
|
-
"editor-state": G(
|
|
4749
|
+
"editor-state": G(st),
|
|
4750
4750
|
zoom: G(B),
|
|
4751
4751
|
"sync-coordinator": G(yt)
|
|
4752
4752
|
}, null, 8, [
|
|
@@ -4755,7 +4755,7 @@ var Uo = (e) => {
|
|
|
4755
4755
|
"zoom",
|
|
4756
4756
|
"sync-coordinator"
|
|
4757
4757
|
]),
|
|
4758
|
-
F(
|
|
4758
|
+
F(ki, {
|
|
4759
4759
|
"get-view": () => G(J),
|
|
4760
4760
|
"get-pages-container": () => w.value,
|
|
4761
4761
|
zoom: G(B),
|
|
@@ -4770,7 +4770,7 @@ var Uo = (e) => {
|
|
|
4770
4770
|
])
|
|
4771
4771
|
])
|
|
4772
4772
|
]),
|
|
4773
|
-
G(Yt) ? (V(), j(
|
|
4773
|
+
G(Yt) ? (V(), j(Ca, {
|
|
4774
4774
|
key: 0,
|
|
4775
4775
|
edit: G(Yt),
|
|
4776
4776
|
"get-view": cn,
|
|
@@ -4785,20 +4785,20 @@ var Uo = (e) => {
|
|
|
4785
4785
|
class: "docx-editor-vue__note-editor",
|
|
4786
4786
|
"aria-label": jt.value,
|
|
4787
4787
|
onKeydown: n[16] ||= Re(q((...e) => G(Dt) && G(Dt)(...e), ["stop", "prevent"]), ["esc"])
|
|
4788
|
-
}, [P("header",
|
|
4788
|
+
}, [P("header", is, [P("span", null, W(jt.value), 1), P("button", {
|
|
4789
4789
|
type: "button",
|
|
4790
4790
|
"aria-label": G(te)("common.closeDialog"),
|
|
4791
4791
|
onClick: n[15] ||= (...e) => G(Dt) && G(Dt)(...e)
|
|
4792
|
-
}, " × ", 8,
|
|
4792
|
+
}, " × ", 8, as)]), P("div", {
|
|
4793
4793
|
ref_key: "notePmRef",
|
|
4794
4794
|
ref: Ee,
|
|
4795
4795
|
class: "docx-editor-vue__note-editor-host"
|
|
4796
|
-
}, null, 512)], 40,
|
|
4797
|
-
F(
|
|
4798
|
-
"image-info": G(
|
|
4796
|
+
}, null, 512)], 40, rs), [[Fe, G(ft)]]),
|
|
4797
|
+
F(ba, {
|
|
4798
|
+
"image-info": G(Z),
|
|
4799
4799
|
zoom: G(B),
|
|
4800
4800
|
view: X.value,
|
|
4801
|
-
onDeselect: n[17] ||= (e) =>
|
|
4801
|
+
onDeselect: n[17] ||= (e) => Z.value = null,
|
|
4802
4802
|
onInteractStart: n[18] ||= (e) => Pt.value = !0,
|
|
4803
4803
|
onInteractEnd: n[19] ||= (e) => Pt.value = !1,
|
|
4804
4804
|
onContextMenu: G(gn)
|
|
@@ -4808,14 +4808,14 @@ var Uo = (e) => {
|
|
|
4808
4808
|
"view",
|
|
4809
4809
|
"onContextMenu"
|
|
4810
4810
|
]),
|
|
4811
|
-
F(
|
|
4812
|
-
data: G(
|
|
4811
|
+
F(Wa, {
|
|
4812
|
+
data: G(zt),
|
|
4813
4813
|
"read-only": f.value,
|
|
4814
4814
|
onNavigate: G(Wt),
|
|
4815
4815
|
onCopy: Sn,
|
|
4816
4816
|
onEdit: G(Gt),
|
|
4817
4817
|
onRemove: G(Kt),
|
|
4818
|
-
onClose: n[20] ||= (e) =>
|
|
4818
|
+
onClose: n[20] ||= (e) => zt.value = null
|
|
4819
4819
|
}, null, 8, [
|
|
4820
4820
|
"data",
|
|
4821
4821
|
"read-only",
|
|
@@ -4833,7 +4833,7 @@ var Uo = (e) => {
|
|
|
4833
4833
|
}),
|
|
4834
4834
|
"aria-label": G(Jt).type === "row" ? "Insert row" : "Insert column",
|
|
4835
4835
|
onMousedown: n[21] ||= (...e) => G(an) && G(an)(...e)
|
|
4836
|
-
}, " + ", 44,
|
|
4836
|
+
}, " + ", 44, os)) : M("", !0),
|
|
4837
4837
|
F(g, {
|
|
4838
4838
|
comments: G(xn),
|
|
4839
4839
|
"pages-container": w.value,
|
|
@@ -4912,12 +4912,12 @@ var Uo = (e) => {
|
|
|
4912
4912
|
size: 18
|
|
4913
4913
|
})], 36)) : M("", !0)
|
|
4914
4914
|
], 544),
|
|
4915
|
-
O.value ? M("", !0) : (V(), j(
|
|
4915
|
+
O.value ? M("", !0) : (V(), j(Ta, {
|
|
4916
4916
|
key: 2,
|
|
4917
4917
|
"left-offset": 12,
|
|
4918
4918
|
onToggle: G(un).handleToggleOutline
|
|
4919
4919
|
}, null, 8, ["onToggle"])),
|
|
4920
|
-
G(Xt).totalPages > 1 ? (V(), j(
|
|
4920
|
+
G(Xt).totalPages > 1 ? (V(), j(Ea, {
|
|
4921
4921
|
key: 3,
|
|
4922
4922
|
"current-page": G(Xt).currentPage,
|
|
4923
4923
|
"total-pages": G(Xt).totalPages,
|
|
@@ -4927,7 +4927,7 @@ var Uo = (e) => {
|
|
|
4927
4927
|
"total-pages",
|
|
4928
4928
|
"visible"
|
|
4929
4929
|
])) : M("", !0),
|
|
4930
|
-
F(
|
|
4930
|
+
F(Ni, {
|
|
4931
4931
|
"is-open": O.value,
|
|
4932
4932
|
headings: ke.value,
|
|
4933
4933
|
"get-scroll-container": () => w.value,
|
|
@@ -4940,13 +4940,13 @@ var Uo = (e) => {
|
|
|
4940
4940
|
"onNavigate"
|
|
4941
4941
|
])
|
|
4942
4942
|
])], 544),
|
|
4943
|
-
F(
|
|
4943
|
+
F(ua, {
|
|
4944
4944
|
"read-only": f.value,
|
|
4945
4945
|
"context-menu": G(dn),
|
|
4946
4946
|
"image-context-menu": G(fn),
|
|
4947
4947
|
"image-context-menu-text-actions": G(pn),
|
|
4948
4948
|
"custom-text-menu-items": G(mn),
|
|
4949
|
-
"can-open-image-properties": G(
|
|
4949
|
+
"can-open-image-properties": G(Z) !== null,
|
|
4950
4950
|
onContextMenuAction: G(vn),
|
|
4951
4951
|
onCloseContextMenu: n[31] ||= (e) => G(dn).isOpen = !1,
|
|
4952
4952
|
onImageWrapSelect: G(_n),
|
|
@@ -4962,16 +4962,16 @@ var Uo = (e) => {
|
|
|
4962
4962
|
"onContextMenuAction",
|
|
4963
4963
|
"onImageWrapSelect"
|
|
4964
4964
|
]),
|
|
4965
|
-
F(
|
|
4965
|
+
F(Oi, {
|
|
4966
4966
|
"event-root": f.value ? null : w.value,
|
|
4967
4967
|
view: G(J)
|
|
4968
4968
|
}, null, 8, ["event-root", "view"])
|
|
4969
4969
|
], 6));
|
|
4970
4970
|
}
|
|
4971
|
-
}), [["__scopeId", "data-v-
|
|
4971
|
+
}), [["__scopeId", "data-v-3a7b54e3"]]);
|
|
4972
4972
|
//#endregion
|
|
4973
4973
|
//#region src/utils/listState.ts
|
|
4974
|
-
function
|
|
4974
|
+
function cs() {
|
|
4975
4975
|
return {
|
|
4976
4976
|
type: "none",
|
|
4977
4977
|
level: 0,
|
|
@@ -4980,30 +4980,30 @@ function as() {
|
|
|
4980
4980
|
}
|
|
4981
4981
|
//#endregion
|
|
4982
4982
|
//#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
|
|
4983
|
-
var
|
|
4983
|
+
var ls = ["aria-label"], us = ["aria-label"], ds = [
|
|
4984
4984
|
"disabled",
|
|
4985
4985
|
"title",
|
|
4986
4986
|
"aria-label"
|
|
4987
|
-
],
|
|
4987
|
+
], fs = [
|
|
4988
4988
|
"disabled",
|
|
4989
4989
|
"title",
|
|
4990
4990
|
"aria-label"
|
|
4991
|
-
],
|
|
4991
|
+
], ps = ["aria-label"], ms = [
|
|
4992
4992
|
"disabled",
|
|
4993
4993
|
"title",
|
|
4994
4994
|
"aria-label",
|
|
4995
4995
|
"aria-pressed"
|
|
4996
|
-
],
|
|
4996
|
+
], hs = [
|
|
4997
4997
|
"disabled",
|
|
4998
4998
|
"title",
|
|
4999
4999
|
"aria-label",
|
|
5000
5000
|
"aria-pressed"
|
|
5001
|
-
],
|
|
5001
|
+
], gs = [
|
|
5002
5002
|
"disabled",
|
|
5003
5003
|
"title",
|
|
5004
5004
|
"aria-label",
|
|
5005
5005
|
"aria-pressed"
|
|
5006
|
-
],
|
|
5006
|
+
], _s = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
5007
5007
|
__name: "FormattingBar",
|
|
5008
5008
|
props: {
|
|
5009
5009
|
currentFormatting: {},
|
|
@@ -5045,7 +5045,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5045
5045
|
"redo"
|
|
5046
5046
|
],
|
|
5047
5047
|
setup(e, { emit: t }) {
|
|
5048
|
-
let { ColorPicker: n } = h(), a = e, o = t, { t: s } = r(), c = k(() => a.currentFormatting ?? {}), l = k(() => a.documentStyles ? { styles: a.documentStyles } : {}), u = k(() => c.value.listState ??
|
|
5048
|
+
let { ColorPicker: n } = h(), a = e, o = t, { t: s } = r(), c = k(() => a.currentFormatting ?? {}), l = k(() => a.documentStyles ? { styles: a.documentStyles } : {}), u = k(() => c.value.listState ?? cs()), d = k(() => {
|
|
5049
5049
|
let e = c.value.color;
|
|
5050
5050
|
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
5051
5051
|
}), f = k(() => {
|
|
@@ -5078,7 +5078,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5078
5078
|
}, [F(i, {
|
|
5079
5079
|
name: "undo",
|
|
5080
5080
|
size: 18
|
|
5081
|
-
})], 40,
|
|
5081
|
+
})], 40, ds), P("button", {
|
|
5082
5082
|
type: "button",
|
|
5083
5083
|
class: "docx-formatting-bar__btn",
|
|
5084
5084
|
disabled: e.disabled || !e.canRedo,
|
|
@@ -5088,7 +5088,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5088
5088
|
}, [F(i, {
|
|
5089
5089
|
name: "redo",
|
|
5090
5090
|
size: 18
|
|
5091
|
-
})], 40,
|
|
5091
|
+
})], 40, fs)], 8, us),
|
|
5092
5092
|
r[13] ||= P("span", {
|
|
5093
5093
|
class: "docx-formatting-bar__divider",
|
|
5094
5094
|
role: "separator"
|
|
@@ -5119,7 +5119,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5119
5119
|
}, [F(i, {
|
|
5120
5120
|
name: "format_bold",
|
|
5121
5121
|
size: 18
|
|
5122
|
-
})], 42,
|
|
5122
|
+
})], 42, ms),
|
|
5123
5123
|
P("button", {
|
|
5124
5124
|
type: "button",
|
|
5125
5125
|
class: L(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.italic }]),
|
|
@@ -5131,7 +5131,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5131
5131
|
}, [F(i, {
|
|
5132
5132
|
name: "format_italic",
|
|
5133
5133
|
size: 18
|
|
5134
|
-
})], 42,
|
|
5134
|
+
})], 42, hs),
|
|
5135
5135
|
P("button", {
|
|
5136
5136
|
type: "button",
|
|
5137
5137
|
class: L(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.underline }]),
|
|
@@ -5143,8 +5143,8 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5143
5143
|
}, [F(i, {
|
|
5144
5144
|
name: "format_underlined",
|
|
5145
5145
|
size: 18
|
|
5146
|
-
})], 42,
|
|
5147
|
-
], 8,
|
|
5146
|
+
})], 42, gs)
|
|
5147
|
+
], 8, ps),
|
|
5148
5148
|
e.showTextColorPicker ? (V(), N(D, { key: 1 }, [r[12] ||= P("span", {
|
|
5149
5149
|
class: "docx-formatting-bar__divider",
|
|
5150
5150
|
role: "separator"
|
|
@@ -5186,9 +5186,9 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5186
5186
|
"disabled",
|
|
5187
5187
|
"can-outdent"
|
|
5188
5188
|
])) : M("", !0)
|
|
5189
|
-
], 10,
|
|
5189
|
+
], 10, ls));
|
|
5190
5190
|
}
|
|
5191
|
-
}), [["__scopeId", "data-v-fc03de2e"]]),
|
|
5191
|
+
}), [["__scopeId", "data-v-fc03de2e"]]), vs = [
|
|
5192
5192
|
{
|
|
5193
5193
|
value: .5,
|
|
5194
5194
|
label: "50%"
|
|
@@ -5213,7 +5213,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5213
5213
|
value: 2,
|
|
5214
5214
|
label: "200%"
|
|
5215
5215
|
}
|
|
5216
|
-
],
|
|
5216
|
+
], ys = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
5217
5217
|
__name: "ZoomControl",
|
|
5218
5218
|
props: {
|
|
5219
5219
|
value: { default: 1 },
|
|
@@ -5230,7 +5230,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5230
5230
|
},
|
|
5231
5231
|
emits: ["change"],
|
|
5232
5232
|
setup(e, { emit: t }) {
|
|
5233
|
-
let { Select: n } = h(), r = e, i = t, a = k(() => r.levels ??
|
|
5233
|
+
let { Select: n } = h(), r = e, i = t, a = k(() => r.levels ?? vs), o = k(() => a.value.find((e) => Math.abs(e.value - r.value) < .001)), s = k(() => o.value ? o.value.label : `${Math.round(r.value * 100)}%`), c = k(() => o.value ? String(o.value.value) : String(r.value)), l = k(() => {
|
|
5234
5234
|
let e = a.value.map((e) => ({
|
|
5235
5235
|
value: String(e.value),
|
|
5236
5236
|
label: e.label
|
|
@@ -5258,7 +5258,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5258
5258
|
"disabled"
|
|
5259
5259
|
]));
|
|
5260
5260
|
}
|
|
5261
|
-
}), [["__scopeId", "data-v-8079e07f"]]),
|
|
5261
|
+
}), [["__scopeId", "data-v-8079e07f"]]), bs = (e, t, n = {}) => {
|
|
5262
5262
|
let { colorMode: r = oe, locale: i = "en", ...a } = n;
|
|
5263
5263
|
return new Promise((n, o) => {
|
|
5264
5264
|
let s = H(null), c = null, l = !1, d = {
|
|
@@ -5284,7 +5284,7 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5284
5284
|
}
|
|
5285
5285
|
};
|
|
5286
5286
|
c = A({ setup() {
|
|
5287
|
-
return () => Ee(
|
|
5287
|
+
return () => Ee(ss, {
|
|
5288
5288
|
...a,
|
|
5289
5289
|
documentBuffer: e,
|
|
5290
5290
|
ref: s,
|
|
@@ -5299,4 +5299,4 @@ var os = ["aria-label"], ss = ["aria-label"], cs = [
|
|
|
5299
5299
|
});
|
|
5300
5300
|
};
|
|
5301
5301
|
//#endregion
|
|
5302
|
-
export {
|
|
5302
|
+
export { yi as AutocompleteCaretOverlay, Qr as DEFAULT_AI_SUGGESTION_PRESETS, bt as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, Yr as DOCUMENT_PRESET_VERSION, Xr as DOCUMENT_STYLE_SET_VERSION, ss as DocxEditor, w as FindReplaceDialog, l as FolioUIProvider, pe as FootnotePropertiesDialog, _s as FormattingBar, me as HyperlinkDialog, he as ImagePositionDialog, ge as ImagePropertiesDialog, T as InsertImageDialog, E as InsertSymbolDialog, _e as InsertTableDialog, ve as PageSetupDialog, ye as PasteSpecialDialog, Kr as STELLA_STYLE_SET_NAME, be as SplitCellDialog, xe as TablePropertiesDialog, Se as WatermarkDialog, ys as ZoomControl, xt as acceptAutocompleteSuggestion, St as acceptAutocompleteWord, ht as anonymizationDecorationsKey, Y as appendAutocompleteToken, In as applyFolioAIEditOperations, $r as applySuggestions, Ct as autocompleteSuggestionKey, wt as autocompleteSuggestionPlugin, ni as buildPositionalText, Tt as clearAutocompleteSuggestion, Tn as clearTemplateSlashMenu, ue as colorModePlugin, En as consumeTemplateSlashQuery, ci as createAICitationDecorationsPlugin, Zr as createDocx, Vr as createEmptyDocument, Bn as createFolioAIEditSnapshot, qr as createStellaStyleDocumentPreset, Jr as createStellaStyleSet, oe as defaultColorMode, e as defaultLocale, ur as deriveBlockId, Un as diffWordSegments, Hr as extractDocumentStyleSet, Ur as extractDocumentStyleSetFromDocx, Et as finishAutocompleteSuggestion, di as fromMarkdown, gt as getAnonymizationMatches, Dt as getAutocompleteSuggestion, st as getDocumentWatermark, oi as getFolioCaretViewportRect, dr as getFolioParaIdFromBlockId, si as getFolioSelectionViewportRect, nn as getTemplateDirectives, Dn as getTemplateSlashMenu, qn as hashFolioAIBlockText, u as i18nPlugin, We as insertImageFromFile, Ke as insertPageBreakInView, Je as insertTableInView, Xe as insertTableOfContentsInView, Wr as inspectDocumentStyles, Gr as inspectDocumentStylesFromDocx, pr as isFolioBlockId, mr as isSequentialFolioBlockId, ei as isSuggestionStale, Jn as normalizeFolioAIBlockText, C as provideColorMode, n as provideLocale, bs as renderAsync, On as resetTemplateSlashQuery, ti as resolveSuggestionAnchor, an as scanDirectives, ai as scrollFolioPositionIntoView, li as setAICitationsMeta, ri as setAISuggestionsMeta, ui as setActiveCitationMeta, vt as setAnonymizationTermsMeta, lt as setDocumentWatermark, ii as setFocusedSuggestionMeta, wn as setTemplatePreviewValues, kt as shouldTriggerAutocomplete, At as startAutocompleteSuggestion, kn as templateSlashMenuKey, fi as toMarkdown, pi as toMarkdownResult, fe as useColorMode, r as useTranslation, de as useWheelZoom };
|