@stll/folio-vue 0.17.3 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ListButtons-0NZvOgUE.js → ListButtons-BXF-tbt2.js} +445 -419
- package/dist/ListButtons-h2cB3ivL.cjs +4 -0
- package/dist/{SplitCellDialog-D2wgbGwH.js → SplitCellDialog-Cp5O_btz.js} +785 -780
- package/dist/SplitCellDialog-DuxO5ttQ.cjs +15 -0
- package/dist/components/DocxEditor/types.d.ts +4 -11
- package/dist/components/tableStylePresets.d.ts +7 -7
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +1 -1
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +550 -557
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +2 -2
- package/dist/utils/listState.d.ts +2 -13
- package/package.json +2 -2
- package/dist/ListButtons-C7LKOgVn.cjs +0 -4
- package/dist/SplitCellDialog-Ds7yb_gS.cjs +0 -15
package/dist/index.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import { A as e, F as t, M as n, N as r, P as i, _ as a, c as o, d as s, f as c, g as l, j as u, l as d, m as f, p, u as m, y as h } from "./SplitCellDialog-
|
|
2
|
-
import { D as g, E as _, d as v, f as y, i as b, n as x, r as ee, t as te, v as ne, w as re, y as ie } from "./ListButtons-
|
|
1
|
+
import { A as e, F as t, M as n, N as r, P as i, _ as a, c as o, d as s, f as c, g as l, j as u, l as d, m as f, p, u as m, y as h } from "./SplitCellDialog-Cp5O_btz.js";
|
|
2
|
+
import { D as g, E as _, d as v, f as y, i as b, n as x, r as ee, t as te, v as ne, w as re, y as ie } from "./ListButtons-BXF-tbt2.js";
|
|
3
3
|
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 {
|
|
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 { anchorTargetAttrs as
|
|
38
|
-
import { PENDING_COMMENT_ID as
|
|
39
|
-
import { createComment as
|
|
40
|
-
import { acceptAIEditRevision as
|
|
41
|
-
import { makeRevisionInfo as
|
|
42
|
-
import { findPageIndexContainingPmPos as
|
|
43
|
-
import { proseDocToBlocks as
|
|
44
|
-
import { setTemplatePreviewValues as
|
|
45
|
-
import { clearTemplateSlashMenu as
|
|
46
|
-
import { createEmptyHeaderFooter as
|
|
47
|
-
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as
|
|
48
|
-
import { findParagraphFragmentsByParaId as
|
|
49
|
-
import { onPaintedLayoutChange as
|
|
50
|
-
import { blockSdtAttrsToSdtProperties as
|
|
51
|
-
import { setContentControlContentBlocksTr as
|
|
52
|
-
import { clampRangeToDocSize as
|
|
53
|
-
import { deriveBlockId as
|
|
54
|
-
import { getPageTextFromLayout as
|
|
55
|
-
import { applyStyle as
|
|
56
|
-
import { getCachedNumberingMap as
|
|
57
|
-
import { insertPageBreak as
|
|
58
|
-
import { insertSectionBreakContinuous as
|
|
59
|
-
import { setEmbeddedFontFamilyMap as
|
|
60
|
-
import { buildEmbeddedFontFamilyMap as
|
|
61
|
-
import { editHyperlinkAtCursor 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 { NO_LIST_STATE as ze, createStyleResolver as Be, extractSelectionState as Ve, getDocumentBuiltInStyles as He, getDocumentStyleResolver as Ue, getSelectedText as We, insertImageFromFile as Ge, insertImageFromFile as Ke, insertPageBreakInView as qe, insertPageBreakInView as Je, insertTableInView as Ye, insertTableInView as Xe, insertTableOfContentsInView as J, insertTableOfContentsInView as Ze, listStateLevel as Qe, schema as $e } from "@stll/folio-core/prosemirror";
|
|
8
|
+
import { expectTableAttrs as et } from "@stll/folio-core/prosemirror/attrs";
|
|
9
|
+
import { getTableContext as tt } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
|
|
10
|
+
import { extractSelectionContext as nt } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
|
|
11
|
+
import { inspectDocxCompatibility as rt } from "@stll/folio-core/docx/compatibility";
|
|
12
|
+
import { resolveActiveEditorStory as it } from "@stll/folio-core/controller/activeEditorStory";
|
|
13
|
+
import { clearAllCaches as at, resetCanvasContext as ot } from "@stll/folio-core/layout-bridge/engine/measuring";
|
|
14
|
+
import { onFontsLoaded as st } from "@stll/folio-core/utils/fontLoader";
|
|
15
|
+
import { twipsToPixels as ct } from "@stll/folio-core/paged-layout/sectionGeometry";
|
|
16
|
+
import { getDocumentWatermark as lt, getDocumentWatermark as ut, setDocumentWatermark as dt, setDocumentWatermark as ft } from "@stll/folio-core/watermark";
|
|
17
|
+
import { createLatestRequestGate as pt } from "@stll/folio-core/controller/latestRequestGate";
|
|
18
|
+
import { measureDirectiveGutter as mt, projectRangesToRects as ht } from "@stll/folio-core/paged-layout/rangeProjection";
|
|
19
|
+
import { prefersReducedMotionBehavior as gt } from "@stll/folio-core/paged-layout/scrollNavigation";
|
|
20
|
+
import { anonymizationDecorationsKey as _t, getAnonymizationMatches as vt, getAnonymizationMatches as yt, setAnonymizationTermsMeta as bt, slugAnonymizationLabel as xt } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
21
|
+
import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES as St, acceptAutocompleteSuggestion as Y, acceptAutocompleteWord as Ct, appendAutocompleteToken as wt, autocompleteSuggestionKey as Tt, autocompleteSuggestionPlugin as Et, clearAutocompleteSuggestion as Dt, finishAutocompleteSuggestion as Ot, getAutocompleteSuggestion as kt, getAutocompleteSuggestion as At, shouldTriggerAutocomplete as X, startAutocompleteSuggestion as jt } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
22
|
+
import { createRenderedDomContext as Mt } from "@stll/folio-core/render-dom/RenderedDomContext";
|
|
23
|
+
import { ContentControlWidgetController as Nt } from "@stll/folio-core/controller/contentControlWidgetController";
|
|
24
|
+
import { NodeSelection as Pt, Selection as Ft, TextSelection as Z } from "prosemirror-state";
|
|
25
|
+
import { pixelsToEmu as It } from "@stll/folio-core/utils/units";
|
|
26
|
+
import { IMAGE_LAYOUT_OPTIONS as Lt, captureInlinePositionEmu as Rt, deriveLayoutChoice as zt, findImageElement as Bt, isImageLayoutOptionEnabled as Vt, toolbarValueToLayoutTarget as Ht } from "@stll/folio-core/layout-painter/imageLayout";
|
|
27
|
+
import { isTrackChangesMode as Ut, toggledTrackChangesMode as Wt } from "@stll/folio-core/managers/EditorModeManager";
|
|
28
|
+
import { clickToPositionDom as Gt, getCaretPositionFromDom as Kt } from "@stll/folio-core/layout-bridge/dom/clickToPositionDom";
|
|
29
|
+
import { calculateResizedImageDimensions as qt, commitImageFloatMove as Jt, commitImageInlineMove as Yt, commitImageResize as Xt, isFloatingImage as Zt } from "@stll/folio-core/prosemirror/imageCommit";
|
|
30
|
+
import { findBodyPmAnchor as Qt, findBodyPmSpans as $t } from "@stll/folio-core/layout-bridge/dom/findBodyPmSpans";
|
|
31
|
+
import { resetImeCaretAnchor as en, syncImeCaretAnchor as tn } from "@stll/folio-core/layout-bridge/dom/imeCaretAnchor";
|
|
32
|
+
import { PAINTER_PAINTED_EVENT as nn } from "@stll/folio-core/layout-painter/renderPage";
|
|
33
|
+
import { HeaderFooterSelectionOverlay as rn } from "@stll/folio-core/render-dom/HeaderFooterSelectionOverlay";
|
|
34
|
+
import { getTemplateDirectives as an, getTemplateDirectives as on, scanDirectives as sn } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
35
|
+
import { closeHistory as cn, redo as ln, undo as un } from "prosemirror-history";
|
|
36
|
+
import { clearFormatting as dn } from "@stll/folio-core/prosemirror/commands/formatting";
|
|
37
|
+
import { anchorTargetAttrs as fn, sanitizeExternalUrl as pn, windowFeaturesFor as mn } from "@stll/folio-core/utils/urlSecurity";
|
|
38
|
+
import { PENDING_COMMENT_ID as hn, createCommentIdAllocator as gn, seedCommentAllocator as _n } from "@stll/folio-core/prosemirror/commentIdAllocator";
|
|
39
|
+
import { createComment as vn } from "@stll/folio-core/prosemirror/commentOps";
|
|
40
|
+
import { acceptAIEditRevision as yn, acceptChange as bn, acceptSuggestion as Q, findAIEditRevisionRange as xn, findSuggestionRange as $, getSuggestions as Sn, rejectAIEditRevision as Cn, rejectChange as wn, rejectSuggestion as Tn } from "@stll/folio-core/prosemirror/commands/comments";
|
|
41
|
+
import { makeRevisionInfo as En } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
42
|
+
import { findPageIndexContainingPmPos as Dn } from "@stll/folio-core/layout-engine";
|
|
43
|
+
import { proseDocToBlocks as On } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
|
|
44
|
+
import { setTemplatePreviewValues as kn } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
45
|
+
import { clearTemplateSlashMenu as An, consumeTemplateSlashQuery as jn, getTemplateSlashMenu as Mn, resetTemplateSlashQuery as Nn, templateSlashMenuKey as Pn } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
46
|
+
import { createEmptyHeaderFooter as Fn, pickActiveHeaderFooterRId as In, removeHeaderFooter as Ln, resolveHeaderFooterContent as Rn, saveHeaderFooterContent as zn } from "@stll/folio-core/utils/headerFooter";
|
|
47
|
+
import { FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION as Bn, applyFolioAIEditOperations as Vn, applyFolioAIEditOperations as Hn, applyFolioDocumentOperations as Un, assertSupportedFolioDocumentOperationVersion as Wn, createFolioAIEditSnapshot as Gn, createFolioAIEditSnapshot as Kn, createFolioAIEditSnapshotWithStyleResolver as qn, diffWordSegments as Jn, getCommentAnchorsFromDoc as Yn, getFolioDocumentOperationIssues as Xn, getTrackedChangesFromDoc as Zn, hashFolioAIBlockText as Qn, normalizeFolioAIBlockText as $n } from "@stll/folio-core/ai-edits";
|
|
48
|
+
import { findParagraphFragmentsByParaId as er, flashParagraphElements as tr } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
49
|
+
import { onPaintedLayoutChange as nr, readBlockRects as rr } from "@stll/folio-core/paged-layout/blockGeometry";
|
|
50
|
+
import { blockSdtAttrsToSdtProperties as ir, findBlockSdtMatch as ar, findBlockSdtMatches as or, removeContentControlTr as sr, setContentControlContentTr as cr, setContentControlValueTr as lr } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
51
|
+
import { setContentControlContentBlocksTr as ur } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
52
|
+
import { clampRangeToDocSize as dr, resolveFolioAIBlockRange as fr, resolveFolioAITextRange as pr, resolvePassageRange as mr } from "@stll/folio-core/ai-edits/blockRange";
|
|
53
|
+
import { deriveBlockId as hr, getFolioParaIdFromBlockId as gr, getFolioParaIdFromBlockId as _r, isFolioBlockId as vr, isSequentialFolioBlockId as yr } from "@stll/folio-core/types/block-id";
|
|
54
|
+
import { getPageTextFromLayout as br } from "@stll/folio-core/paged-layout/pageText";
|
|
55
|
+
import { applyStyle as xr, removeTabStop as Sr, setIndentFirstLine as Cr, setIndentLeft as wr, setIndentRight as Tr } from "@stll/folio-core/prosemirror/commands/paragraph";
|
|
56
|
+
import { getCachedNumberingMap as Er } from "@stll/folio-core/docx";
|
|
57
|
+
import { insertPageBreak as Dr } from "@stll/folio-core/prosemirror/commands/pageBreak";
|
|
58
|
+
import { insertSectionBreakContinuous as Or, insertSectionBreakNextPage as kr } from "@stll/folio-core/prosemirror/commands/sectionBreak";
|
|
59
|
+
import { setEmbeddedFontFamilyMap as Ar } from "@stll/folio-core/utils/fontResolver";
|
|
60
|
+
import { buildEmbeddedFontFamilyMap as jr, extractEmbeddedFonts as Mr } from "@stll/folio-core/fonts/embeddedFonts";
|
|
61
|
+
import { editHyperlinkAtCursor as Nr, removeHyperlinkAtCursor as Pr } from "@stll/folio-core/prosemirror/commands/hyperlink";
|
|
62
|
+
import { isKeydownInShortcutScope as Fr } from "@stll/folio-core/managers/editorShortcuts";
|
|
63
|
+
import { collectHeadings as Ir } from "@stll/folio-core/utils/headingCollector";
|
|
64
|
+
import { clickToPositionInHfSlot as Lr } from "@stll/folio-core/layout-bridge/dom/findHfPmSpans";
|
|
65
|
+
import { findNoteStoryForTarget as Rr } from "@stll/folio-core/layout-bridge/dom/noteStoryDom";
|
|
66
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as zr, detectTableInsertHover as Br } from "@stll/folio-core/layout-bridge/tableInsertHover";
|
|
67
|
+
import { createCellDragTracker as Vr, findCellPosFromPmPos as Hr } from "@stll/folio-core/prosemirror/cellDragSelection";
|
|
68
|
+
import { RemoteSelectionOverlay as Ur } from "@stll/folio-core/render-dom/RemoteSelectionOverlay";
|
|
69
|
+
import { BodySelectionOverlay as Wr } from "@stll/folio-core/render-dom/BodySelectionOverlay";
|
|
70
|
+
import { createEmptyDocument as Gr } from "@stll/folio-core/utils/createDocument";
|
|
71
|
+
import { extractDocumentStyleSet as Kr, extractDocumentStyleSetFromDocx as qr, inspectDocumentStyles as Jr, inspectDocumentStylesFromDocx as Yr } from "@stll/folio-core/style-sets/extract";
|
|
72
|
+
import { STELLA_STYLE_SET_NAME as Xr, createStellaStyleDocumentPreset as Zr, createStellaStyleSet as Qr } from "@stll/folio-core/style-sets/stellaStyle";
|
|
73
|
+
import { DOCUMENT_PRESET_VERSION as $r, DOCUMENT_STYLE_SET_VERSION as ei } from "@stll/folio-core/style-sets/types";
|
|
74
|
+
import { createDocx as ti } from "@stll/folio-core/docx/rezip";
|
|
75
|
+
import { DEFAULT_AI_SUGGESTION_PRESETS as ni } from "@stll/folio-core/ai-suggestions/types";
|
|
76
|
+
import { applySuggestions as ri } from "@stll/folio-core/ai-suggestions/apply";
|
|
77
|
+
import { isSuggestionStale as ii, resolveSuggestionAnchor as ai } from "@stll/folio-core/ai-suggestions/conflict";
|
|
78
|
+
import { buildPositionalText as oi } from "@stll/folio-core/ai-suggestions/text-positions";
|
|
79
|
+
import { setAISuggestionsMeta as si, setFocusedSuggestionMeta as ci } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
80
|
+
import { scrollFolioPositionIntoView as li } from "@stll/folio-core/paged-layout/scrollToPmPosition";
|
|
81
|
+
import { getFolioCaretViewportRect as ui, getFolioSelectionViewportRect as di } from "@stll/folio-core/paged-layout/selectionViewportRect";
|
|
82
|
+
import { createAICitationDecorationsPlugin as fi, setAICitationsMeta as pi, setActiveCitationMeta as mi } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
83
|
+
import { fromMarkdown as hi, toMarkdown as gi, toMarkdownResult as _i } from "@stll/folio-core/markdown";
|
|
84
84
|
//#region src/components/AnonymizationRectsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
85
|
-
var
|
|
85
|
+
var vi = [
|
|
86
86
|
"data-folio-anonymization-label",
|
|
87
87
|
"data-folio-anonymization-canonical",
|
|
88
88
|
"data-folio-anonymization-selected",
|
|
89
89
|
"title"
|
|
90
|
-
],
|
|
90
|
+
], yi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
91
91
|
__name: "AnonymizationRectsOverlay",
|
|
92
92
|
props: {
|
|
93
93
|
getView: { type: Function },
|
|
@@ -102,7 +102,7 @@ var gi = [
|
|
|
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 = pt(), a = null;
|
|
106
106
|
function o() {
|
|
107
107
|
a !== null && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
|
|
108
108
|
a = null, s();
|
|
@@ -114,12 +114,12 @@ var gi = [
|
|
|
114
114
|
r.value = [];
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
let s =
|
|
117
|
+
let s = yt(o);
|
|
118
118
|
if (s.length === 0) {
|
|
119
119
|
r.value = [];
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
let c = await
|
|
122
|
+
let c = await ht(s, {
|
|
123
123
|
pagesContainer: a,
|
|
124
124
|
zoom: t.zoom,
|
|
125
125
|
layout: t.layout,
|
|
@@ -161,7 +161,7 @@ var gi = [
|
|
|
161
161
|
index: a
|
|
162
162
|
}, i.item(a)?.scrollIntoView({
|
|
163
163
|
block: "center",
|
|
164
|
-
behavior:
|
|
164
|
+
behavior: gt()
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
K(() => [t.selectedCanonical, t.selectionSeq], () => l(), { flush: "post" });
|
|
@@ -192,7 +192,7 @@ var gi = [
|
|
|
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(xt)(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 gi = [
|
|
|
204
204
|
width: `${n.width}px`,
|
|
205
205
|
height: `${n.height}px`
|
|
206
206
|
})
|
|
207
|
-
}, null, 14,
|
|
207
|
+
}, null, 14, vi))), 128))], 64))), 128))], 512));
|
|
208
208
|
}
|
|
209
|
-
}), [["__scopeId", "data-v-df8fe7df"]]),
|
|
209
|
+
}), [["__scopeId", "data-v-df8fe7df"]]), bi = {
|
|
210
210
|
class: "folio-passage-highlight-overlay",
|
|
211
211
|
"data-folio-passage-highlight-overlay": ""
|
|
212
|
-
},
|
|
212
|
+
}, xi = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
213
213
|
__name: "PassageHighlightOverlay",
|
|
214
214
|
props: {
|
|
215
215
|
range: {},
|
|
@@ -220,7 +220,7 @@ var gi = [
|
|
|
220
220
|
measures: {}
|
|
221
221
|
},
|
|
222
222
|
setup(e) {
|
|
223
|
-
let t = e, n = H([]), r =
|
|
223
|
+
let t = e, n = H([]), r = pt(), i = null;
|
|
224
224
|
function a() {
|
|
225
225
|
i !== null && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
|
|
226
226
|
i = null, o();
|
|
@@ -232,7 +232,7 @@ var gi = [
|
|
|
232
232
|
n.value = [];
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
235
|
-
let o = await
|
|
235
|
+
let o = await ht([i], {
|
|
236
236
|
pagesContainer: a,
|
|
237
237
|
zoom: t.zoom,
|
|
238
238
|
layout: t.layout,
|
|
@@ -256,7 +256,7 @@ var gi = [
|
|
|
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", bi, [(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 gi = [
|
|
|
268
268
|
})
|
|
269
269
|
}, null, 4))), 128))]));
|
|
270
270
|
}
|
|
271
|
-
}), [["__scopeId", "data-v-bde9f41b"]]),
|
|
271
|
+
}), [["__scopeId", "data-v-bde9f41b"]]), Si = {
|
|
272
272
|
key: 0,
|
|
273
273
|
class: "folio-autocomplete-overlay",
|
|
274
274
|
"data-folio-autocomplete-overlay": ""
|
|
275
|
-
},
|
|
275
|
+
}, Ci = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
276
276
|
__name: "AutocompleteCaretOverlay",
|
|
277
277
|
props: {
|
|
278
278
|
caret: {},
|
|
@@ -280,7 +280,7 @@ var gi = [
|
|
|
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", Si, [P("span", {
|
|
284
284
|
class: "folio-autocomplete-ghost",
|
|
285
285
|
style: R({
|
|
286
286
|
left: `${e.caret.x}px`,
|
|
@@ -293,7 +293,7 @@ var gi = [
|
|
|
293
293
|
"aria-hidden": "true"
|
|
294
294
|
}, "stella", 2)], 4)])) : M("", !0);
|
|
295
295
|
}
|
|
296
|
-
}), [["__scopeId", "data-v-00299904"]]),
|
|
296
|
+
}), [["__scopeId", "data-v-00299904"]]), wi = 48, Ti = /* @__PURE__ */ I({
|
|
297
297
|
__name: "AutocompleteSuggestionOverlay",
|
|
298
298
|
props: {
|
|
299
299
|
getPagesContainer: { type: Function },
|
|
@@ -310,7 +310,7 @@ var gi = [
|
|
|
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(wi, l - t);
|
|
314
314
|
}
|
|
315
315
|
}, s = () => {
|
|
316
316
|
let e = t.getPagesContainer(), r = t.editorState;
|
|
@@ -318,12 +318,12 @@ var gi = [
|
|
|
318
318
|
n.value = null;
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
let i =
|
|
321
|
+
let i = At(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 = Mt(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 gi = [
|
|
|
359
359
|
t.editorState,
|
|
360
360
|
t.zoom,
|
|
361
361
|
r.value
|
|
362
|
-
], () => c()), (e, t) => (V(), j(
|
|
362
|
+
], () => c()), (e, t) => (V(), j(Ci, {
|
|
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 gi = [
|
|
|
369
369
|
"is-streaming"
|
|
370
370
|
]));
|
|
371
371
|
}
|
|
372
|
-
}),
|
|
373
|
-
function
|
|
374
|
-
je(
|
|
372
|
+
}), Ei = Symbol("docx-portal-class");
|
|
373
|
+
function Di(e) {
|
|
374
|
+
je(Ei, k(() => ({
|
|
375
375
|
"ep-root": !0,
|
|
376
376
|
dark: !!G(e)
|
|
377
377
|
})));
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
return De(
|
|
379
|
+
function Oi() {
|
|
380
|
+
return De(Ei, 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 ki = ["aria-label"], Ai = {
|
|
385
385
|
key: 0,
|
|
386
386
|
class: "content-control-picker__items",
|
|
387
387
|
role: "menu"
|
|
388
|
-
},
|
|
388
|
+
}, ji = {
|
|
389
389
|
key: 0,
|
|
390
390
|
class: "content-control-picker__empty"
|
|
391
|
-
},
|
|
391
|
+
}, Mi = /*#__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 = Oi(), s = new Nt(), 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(() => {
|
|
@@ -415,7 +415,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
415
415
|
"aria-label": c.value.status === "dropdown" ? G(n)("contentControlDropdownAriaLabel") : G(n)("contentControlDateAriaLabel"),
|
|
416
416
|
onMousedown: t[1] ||= q(() => {}, ["stop"]),
|
|
417
417
|
onPointerdown: t[2] ||= q(() => {}, ["stop"])
|
|
418
|
-
}, [c.value.status === "dropdown" ? (V(), N("div",
|
|
418
|
+
}, [c.value.status === "dropdown" ? (V(), N("div", Ai, [c.value.items.length === 0 ? (V(), N("div", ji, W(G(n)("contentControlDropdownNoOptions")), 1)) : (V(!0), N(D, { key: 1 }, U(c.value.items, (e) => (V(), j(G(i), {
|
|
419
419
|
key: `${e.value}::${e.displayText}`,
|
|
420
420
|
"class-name": "content-control-picker__item",
|
|
421
421
|
type: "button",
|
|
@@ -432,9 +432,9 @@ var Di = ["aria-label"], Oi = {
|
|
|
432
432
|
value: c.value.currentValue,
|
|
433
433
|
"default-open": !0,
|
|
434
434
|
onChange: d
|
|
435
|
-
}, null, 8, ["value"])) : M("", !0)], 46,
|
|
435
|
+
}, null, 8, ["value"])) : M("", !0)], 46, ki))]));
|
|
436
436
|
}
|
|
437
|
-
}), [["__scopeId", "data-v-f88b41c9"]]),
|
|
437
|
+
}), [["__scopeId", "data-v-f88b41c9"]]), Ni = /* @__PURE__ */ I({
|
|
438
438
|
__name: "DecorationLayer",
|
|
439
439
|
props: {
|
|
440
440
|
getView: { type: Function },
|
|
@@ -469,7 +469,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
469
469
|
n.firstChild && n.replaceChildren();
|
|
470
470
|
return;
|
|
471
471
|
}
|
|
472
|
-
let a =
|
|
472
|
+
let a = Mt(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
|
|
473
473
|
for (let { decoration: t, from: n, to: r } of i) {
|
|
474
474
|
if (n === r) {
|
|
475
475
|
let r = u(t, e);
|
|
@@ -546,10 +546,10 @@ var Di = ["aria-label"], Oi = {
|
|
|
546
546
|
"aria-hidden": "true"
|
|
547
547
|
}, null, 512));
|
|
548
548
|
}
|
|
549
|
-
}),
|
|
549
|
+
}), Pi = { class: "doc-outline__header" }, Fi = { class: "doc-outline__body" }, Ii = {
|
|
550
550
|
key: 0,
|
|
551
551
|
class: "doc-outline__empty"
|
|
552
|
-
},
|
|
552
|
+
}, Li = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
553
553
|
__name: "DocumentOutline",
|
|
554
554
|
props: {
|
|
555
555
|
isOpen: { type: Boolean },
|
|
@@ -578,7 +578,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
578
578
|
role: "navigation",
|
|
579
579
|
"aria-label": "Document outline",
|
|
580
580
|
onMousedown: n[1] ||= q(() => {}, ["stop"])
|
|
581
|
-
}, [P("div",
|
|
581
|
+
}, [P("div", Pi, [P("button", {
|
|
582
582
|
class: "doc-outline__back",
|
|
583
583
|
title: "Close outline",
|
|
584
584
|
"aria-label": "Close outline",
|
|
@@ -586,7 +586,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
586
586
|
}, [F(i, {
|
|
587
587
|
name: "arrow_back",
|
|
588
588
|
size: 20
|
|
589
|
-
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div",
|
|
589
|
+
})]), n[2] ||= P("span", { class: "doc-outline__title" }, "Document Outline", -1)]), P("div", Fi, [e.headings.length === 0 ? (V(), N("div", Ii, "No headings found")) : (V(), j(G(r), {
|
|
590
590
|
key: 1,
|
|
591
591
|
items: o.value,
|
|
592
592
|
"get-scroll-container": e.getScrollContainer ?? (() => null),
|
|
@@ -594,7 +594,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
594
594
|
"aria-label": "Document outline"
|
|
595
595
|
}, null, 8, ["items", "get-scroll-container"]))])], 36)) : M("", !0);
|
|
596
596
|
}
|
|
597
|
-
}), [["__scopeId", "data-v-0797b3b1"]]),
|
|
597
|
+
}), [["__scopeId", "data-v-0797b3b1"]]), Ri = /* @__PURE__ */ I({
|
|
598
598
|
__name: "DocxEditorDialogs",
|
|
599
599
|
props: {
|
|
600
600
|
view: {},
|
|
@@ -687,10 +687,10 @@ var Di = ["aria-label"], Oi = {
|
|
|
687
687
|
}, null, 8, ["is-open", "current-watermark"])
|
|
688
688
|
], 64));
|
|
689
689
|
}
|
|
690
|
-
}),
|
|
690
|
+
}), zi = {
|
|
691
691
|
key: 0,
|
|
692
692
|
class: "docx-editor-vue__title-bar"
|
|
693
|
-
},
|
|
693
|
+
}, Bi = { class: "docx-editor-vue__title-bar-left" }, Vi = { class: "docx-editor-vue__title-bar-center" }, Hi = { class: "docx-editor-vue__title-bar-right" }, Ui = /* @__PURE__ */ I({
|
|
694
694
|
__name: "DocxEditorMenuBar",
|
|
695
695
|
props: {
|
|
696
696
|
showMenuBar: {
|
|
@@ -722,9 +722,9 @@ var Di = ["aria-label"], Oi = {
|
|
|
722
722
|
],
|
|
723
723
|
setup(e, { emit: t }) {
|
|
724
724
|
let n = t;
|
|
725
|
-
return (t, r) => e.showMenuBar ? (V(), N("div",
|
|
726
|
-
P("div",
|
|
727
|
-
P("div",
|
|
725
|
+
return (t, r) => e.showMenuBar ? (V(), N("div", zi, [
|
|
726
|
+
P("div", Bi, [Me(t.$slots, "title-bar-left")]),
|
|
727
|
+
P("div", Vi, [F(_, {
|
|
728
728
|
"model-value": e.documentName,
|
|
729
729
|
editable: e.documentNameEditable,
|
|
730
730
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
@@ -739,28 +739,28 @@ var Di = ["aria-label"], Oi = {
|
|
|
739
739
|
"show-help-menu",
|
|
740
740
|
"show-table-insert"
|
|
741
741
|
])]),
|
|
742
|
-
P("div",
|
|
742
|
+
P("div", Hi, [Me(t.$slots, "title-bar-right")])
|
|
743
743
|
])) : M("", !0);
|
|
744
744
|
}
|
|
745
|
-
}),
|
|
745
|
+
}), Wi = ["aria-label"], Gi = { class: "image-ctx-menu__icon" }, Ki = { class: "image-ctx-menu__label" }, qi = {
|
|
746
746
|
key: 1,
|
|
747
747
|
class: "image-ctx-menu__divider",
|
|
748
748
|
role: "separator"
|
|
749
|
-
},
|
|
749
|
+
}, Ji = [
|
|
750
750
|
"data-wrap-type",
|
|
751
751
|
"data-current",
|
|
752
752
|
"data-disabled",
|
|
753
753
|
"disabled",
|
|
754
754
|
"title",
|
|
755
755
|
"onClick"
|
|
756
|
-
],
|
|
756
|
+
], Yi = { class: "image-ctx-menu__icon" }, Xi = { class: "image-ctx-menu__label" }, Zi = ["aria-label"], Qi = ["disabled", "onClick"], $i = { class: "image-ctx-menu__label" }, ea = {
|
|
757
757
|
key: 0,
|
|
758
758
|
class: "image-ctx-menu__shortcut"
|
|
759
|
-
},
|
|
759
|
+
}, ta = {
|
|
760
760
|
key: 0,
|
|
761
761
|
class: "image-ctx-menu__divider",
|
|
762
762
|
role: "separator"
|
|
763
|
-
},
|
|
763
|
+
}, na = 18, ra = 260, ia = 10, aa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
764
764
|
__name: "ImageContextMenu",
|
|
765
765
|
props: {
|
|
766
766
|
state: {},
|
|
@@ -781,7 +781,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
781
781
|
function o() {
|
|
782
782
|
a("open-properties"), a("close");
|
|
783
783
|
}
|
|
784
|
-
let { t: s } = r(), c =
|
|
784
|
+
let { t: s } = r(), c = Oi(), l = Lt, u = k(() => n.state ? zt(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), d = {
|
|
785
785
|
inline: "wrap_text",
|
|
786
786
|
squareLeft: "format_image_left",
|
|
787
787
|
squareRight: "format_image_right",
|
|
@@ -793,17 +793,17 @@ var Di = ["aria-label"], Oi = {
|
|
|
793
793
|
}
|
|
794
794
|
let p = k(() => {
|
|
795
795
|
if (!n.state) return {};
|
|
796
|
-
let e =
|
|
797
|
-
return typeof window < "u" && (t +
|
|
796
|
+
let e = Lt.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
797
|
+
return typeof window < "u" && (t + ra > window.innerWidth && (t = window.innerWidth - ra - ia), r + e > window.innerHeight && (r = window.innerHeight - e - ia), t < ia && (t = ia), r < ia && (r = ia)), {
|
|
798
798
|
position: "fixed",
|
|
799
799
|
left: `${t}px`,
|
|
800
800
|
top: `${r}px`,
|
|
801
|
-
minWidth: `${
|
|
801
|
+
minWidth: `${ra}px`,
|
|
802
802
|
zIndex: 400
|
|
803
803
|
};
|
|
804
804
|
});
|
|
805
805
|
function m(e) {
|
|
806
|
-
return n.state ?
|
|
806
|
+
return n.state ? Vt(e, n.state.currentWrapType) : !1;
|
|
807
807
|
}
|
|
808
808
|
function h(e) {
|
|
809
809
|
m(e) && (a("select", e.choice), a("close"));
|
|
@@ -840,11 +840,11 @@ var Di = ["aria-label"], Oi = {
|
|
|
840
840
|
"data-action": "open-properties",
|
|
841
841
|
onMousedown: n[1] ||= q(() => {}, ["prevent"]),
|
|
842
842
|
onClick: o
|
|
843
|
-
}, [P("span",
|
|
843
|
+
}, [P("span", Gi, [F(i, {
|
|
844
844
|
name: "settings",
|
|
845
|
-
size:
|
|
846
|
-
})]), P("span",
|
|
847
|
-
e.canOpenProperties ? (V(), N("div",
|
|
845
|
+
size: na
|
|
846
|
+
})]), P("span", Ki, W(G(s)("imageWrap.menu.imageProperties")), 1)], 32)) : M("", !0),
|
|
847
|
+
e.canOpenProperties ? (V(), N("div", qi)) : M("", !0),
|
|
848
848
|
(V(!0), N(D, null, U(G(l), (e) => (V(), N("button", {
|
|
849
849
|
key: e.choice,
|
|
850
850
|
type: "button",
|
|
@@ -858,17 +858,17 @@ var Di = ["aria-label"], Oi = {
|
|
|
858
858
|
onMousedown: n[2] ||= q(() => {}, ["prevent"]),
|
|
859
859
|
onClick: (t) => h(e)
|
|
860
860
|
}, [
|
|
861
|
-
P("span",
|
|
861
|
+
P("span", Yi, [F(i, {
|
|
862
862
|
name: f(e.iconHint),
|
|
863
|
-
size:
|
|
863
|
+
size: na
|
|
864
864
|
}, null, 8, ["name"])]),
|
|
865
|
-
P("span",
|
|
865
|
+
P("span", Xi, W(G(s)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
866
866
|
e.choice === u.value ? (V(), N("span", {
|
|
867
867
|
key: 0,
|
|
868
868
|
class: "image-ctx-menu__current-dot",
|
|
869
869
|
"aria-label": G(s)("imageWrap.menu.ariaLabel")
|
|
870
|
-
}, "●", 8,
|
|
871
|
-
], 42,
|
|
870
|
+
}, "●", 8, Zi)) : M("", !0)
|
|
871
|
+
], 42, Ji))), 128)),
|
|
872
872
|
e.textActions && e.textActions.length > 0 ? (V(), N(D, { key: 2 }, [n[5] ||= P("div", {
|
|
873
873
|
class: "image-ctx-menu__divider",
|
|
874
874
|
role: "separator"
|
|
@@ -879,16 +879,16 @@ var Di = ["aria-label"], Oi = {
|
|
|
879
879
|
disabled: e.disabled,
|
|
880
880
|
onMousedown: n[3] ||= q(() => {}, ["prevent"]),
|
|
881
881
|
onClick: (t) => g(e)
|
|
882
|
-
}, [P("span",
|
|
883
|
-
], 46,
|
|
882
|
+
}, [P("span", $i, W(e.label), 1), e.shortcut ? (V(), N("span", ea, W(e.shortcut), 1)) : M("", !0)], 40, Qi), e.dividerAfter ? (V(), N("div", ta)) : M("", !0)], 64))), 128))], 64)) : M("", !0)
|
|
883
|
+
], 46, Wi)) : M("", !0)]));
|
|
884
884
|
}
|
|
885
|
-
}), [["__scopeId", "data-v-fc8f35bc"]]),
|
|
885
|
+
}), [["__scopeId", "data-v-fc8f35bc"]]), oa = ["disabled", "onMousedown"], sa = {
|
|
886
886
|
key: 0,
|
|
887
887
|
class: "ctx-menu__icon"
|
|
888
|
-
},
|
|
888
|
+
}, ca = { class: "ctx-menu__label" }, la = {
|
|
889
889
|
key: 1,
|
|
890
890
|
class: "ctx-menu__shortcut"
|
|
891
|
-
},
|
|
891
|
+
}, ua = 220, da = 32, fa = 10, pa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
892
892
|
__name: "TextContextMenu",
|
|
893
893
|
props: {
|
|
894
894
|
isOpen: { type: Boolean },
|
|
@@ -905,7 +905,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
905
905
|
setup(e, { emit: t }) {
|
|
906
906
|
let n = e, i = ({ node: e }) => e;
|
|
907
907
|
i.props = ["node"];
|
|
908
|
-
let a = t, { t: o } = r(), s =
|
|
908
|
+
let a = t, { t: o } = r(), s = Oi(), c = H(null), l = k(() => {
|
|
909
909
|
let e = [], t = n.customItems ?? [];
|
|
910
910
|
for (let [n, r] of t.entries()) e.push({
|
|
911
911
|
id: `custom-${r.id}`,
|
|
@@ -1041,8 +1041,8 @@ var Di = ["aria-label"], Oi = {
|
|
|
1041
1041
|
action: "deleteTable"
|
|
1042
1042
|
}), e;
|
|
1043
1043
|
}), u = k(() => {
|
|
1044
|
-
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 *
|
|
1045
|
-
return typeof window < "u" && (e +
|
|
1044
|
+
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 * da + i * 9;
|
|
1045
|
+
return typeof window < "u" && (e + ua + fa > window.innerWidth && (e = window.innerWidth - ua - fa), t + a + fa > window.innerHeight && (t = window.innerHeight - a - fa)), {
|
|
1046
1046
|
position: "fixed",
|
|
1047
1047
|
left: `${e}px`,
|
|
1048
1048
|
top: `${t}px`,
|
|
@@ -1080,12 +1080,12 @@ var Di = ["aria-label"], Oi = {
|
|
|
1080
1080
|
disabled: e.disabled,
|
|
1081
1081
|
onMousedown: q((t) => d(e.action), ["prevent"])
|
|
1082
1082
|
}, [
|
|
1083
|
-
e.icon ? (V(), N("span",
|
|
1084
|
-
P("span",
|
|
1085
|
-
e.shortcut ? (V(), N("span",
|
|
1086
|
-
], 42,
|
|
1083
|
+
e.icon ? (V(), N("span", sa, [F(i, { node: e.icon }, null, 8, ["node"])])) : M("", !0),
|
|
1084
|
+
P("span", ca, W(e.label), 1),
|
|
1085
|
+
e.shortcut ? (V(), N("span", la, W(e.shortcut), 1)) : M("", !0)
|
|
1086
|
+
], 42, oa))), 128))], 38)) : M("", !0)]));
|
|
1087
1087
|
}
|
|
1088
|
-
}), [["__scopeId", "data-v-c1416e84"]]),
|
|
1088
|
+
}), [["__scopeId", "data-v-c1416e84"]]), ma = /* @__PURE__ */ I({
|
|
1089
1089
|
__name: "DocxEditorOverlays",
|
|
1090
1090
|
props: {
|
|
1091
1091
|
readOnly: { type: Boolean },
|
|
@@ -1104,7 +1104,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
1104
1104
|
],
|
|
1105
1105
|
setup(e, { emit: t }) {
|
|
1106
1106
|
let n = t;
|
|
1107
|
-
return (t, r) => (V(), N(D, null, [F(
|
|
1107
|
+
return (t, r) => (V(), N(D, null, [F(pa, {
|
|
1108
1108
|
"is-open": e.contextMenu.isOpen,
|
|
1109
1109
|
position: e.contextMenu.position,
|
|
1110
1110
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -1126,7 +1126,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
1126
1126
|
"can-merge-cells",
|
|
1127
1127
|
"can-split-cell",
|
|
1128
1128
|
"custom-items"
|
|
1129
|
-
]), F(
|
|
1129
|
+
]), F(aa, {
|
|
1130
1130
|
state: e.imageContextMenu,
|
|
1131
1131
|
"text-actions": e.imageContextMenuTextActions,
|
|
1132
1132
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -1143,7 +1143,7 @@ var Di = ["aria-label"], Oi = {
|
|
|
1143
1143
|
});
|
|
1144
1144
|
//#endregion
|
|
1145
1145
|
//#region src/composables/imageOverlayRect.ts
|
|
1146
|
-
function
|
|
1146
|
+
function ha(e) {
|
|
1147
1147
|
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
1148
1148
|
return {
|
|
1149
1149
|
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
@@ -1154,13 +1154,13 @@ function pa(e) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
//#endregion
|
|
1156
1156
|
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
1157
|
-
var
|
|
1157
|
+
var ga = ["data-handle", "onMousedown"], _a = ["title"], va = {
|
|
1158
1158
|
key: 0,
|
|
1159
1159
|
class: "image-overlay__dim"
|
|
1160
|
-
},
|
|
1160
|
+
}, ya = {
|
|
1161
1161
|
key: 1,
|
|
1162
1162
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
1163
|
-
},
|
|
1163
|
+
}, ba = 4, xa = 15, Sa = 250, Ca = 700, wa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1164
1164
|
__name: "ImageSelectionOverlay",
|
|
1165
1165
|
props: {
|
|
1166
1166
|
imageInfo: {},
|
|
@@ -1198,8 +1198,8 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1198
1198
|
if (e.element.isConnected) return e.element;
|
|
1199
1199
|
let t = re();
|
|
1200
1200
|
if (!t) return null;
|
|
1201
|
-
let n =
|
|
1202
|
-
return n ?
|
|
1201
|
+
let n = Qt(t, e.pmPos);
|
|
1202
|
+
return n ? Bt(n) : null;
|
|
1203
1203
|
}
|
|
1204
1204
|
function S() {
|
|
1205
1205
|
let e = ie();
|
|
@@ -1213,7 +1213,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1213
1213
|
return;
|
|
1214
1214
|
}
|
|
1215
1215
|
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
1216
|
-
p.value =
|
|
1216
|
+
p.value = ha({
|
|
1217
1217
|
imageRect: r,
|
|
1218
1218
|
parentRect: n,
|
|
1219
1219
|
scrollLeft: t.scrollLeft,
|
|
@@ -1231,10 +1231,10 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1231
1231
|
let o = a - r;
|
|
1232
1232
|
S();
|
|
1233
1233
|
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
1234
|
-
n = c === t ? n + 1 : 0, t = c, !(o >=
|
|
1234
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= Sa && n >= 2) && o < Ca && (e = requestAnimationFrame(i));
|
|
1235
1235
|
};
|
|
1236
1236
|
e = requestAnimationFrame(i);
|
|
1237
|
-
let a = setTimeout(S,
|
|
1237
|
+
let a = setTimeout(S, Sa);
|
|
1238
1238
|
oe = () => {
|
|
1239
1239
|
cancelAnimationFrame(e), clearTimeout(a);
|
|
1240
1240
|
};
|
|
@@ -1359,7 +1359,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1359
1359
|
!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));
|
|
1360
1360
|
}
|
|
1361
1361
|
function fe(e) {
|
|
1362
|
-
let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o =
|
|
1362
|
+
let t = i.zoom, n = (e.clientX - h) / t, r = (e.clientY - g) / t, a = !e.shiftKey, o = qt(m, n, r, _, v, a);
|
|
1363
1363
|
u.value = Math.round(o.width), d.value = Math.round(o.height);
|
|
1364
1364
|
let s = y;
|
|
1365
1365
|
if (s) {
|
|
@@ -1379,7 +1379,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1379
1379
|
S();
|
|
1380
1380
|
return;
|
|
1381
1381
|
}
|
|
1382
|
-
let n =
|
|
1382
|
+
let n = Xt(e, t.pmPos, u.value, d.value);
|
|
1383
1383
|
n !== null && Ce(n), ke(() => S());
|
|
1384
1384
|
}
|
|
1385
1385
|
let pe = 0, me = 0, he = 0, ge = 0, T = null, E = null;
|
|
@@ -1402,7 +1402,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
function xe(e) {
|
|
1404
1404
|
let t = ye(e.clientX, e.clientY) - he, n = ge + t;
|
|
1405
|
-
e.shiftKey || (n = Math.round(n /
|
|
1405
|
+
e.shiftKey || (n = Math.round(n / xa) * xa), f.value = (n % 360 + 360) % 360, E && (E.style.transform = ve(T, f.value) || "");
|
|
1406
1406
|
}
|
|
1407
1407
|
function Se() {
|
|
1408
1408
|
document.removeEventListener("mousemove", xe), document.removeEventListener("mouseup", Se), l.value = !1, a("interact-end");
|
|
@@ -1423,7 +1423,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1423
1423
|
if (!i.imageInfo || !p.value) return;
|
|
1424
1424
|
let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
|
|
1425
1425
|
let s = e.clientX - t, l = e.clientY - n;
|
|
1426
|
-
if (!(!o && Math.sqrt(s * s + l * l) <
|
|
1426
|
+
if (!(!o && Math.sqrt(s * s + l * l) < ba)) {
|
|
1427
1427
|
if (!o) {
|
|
1428
1428
|
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);";
|
|
1429
1429
|
let e = i.zoom;
|
|
@@ -1445,7 +1445,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1445
1445
|
let a = te(n, r.pmPos);
|
|
1446
1446
|
if (!a) return;
|
|
1447
1447
|
let s;
|
|
1448
|
-
if (
|
|
1448
|
+
if (Zt(a)) {
|
|
1449
1449
|
let a = (o.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
|
|
1450
1450
|
if (!a || a.length === 0) return;
|
|
1451
1451
|
let c = null;
|
|
@@ -1461,21 +1461,21 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1461
1461
|
c = e ? e.querySelector(".layout-page-content") : null;
|
|
1462
1462
|
}
|
|
1463
1463
|
if (!c) return;
|
|
1464
|
-
let l = c.getBoundingClientRect(), u = i.zoom, d =
|
|
1465
|
-
s =
|
|
1464
|
+
let l = c.getBoundingClientRect(), u = i.zoom, d = It((e - l.left) / u), f = It((t - l.top) / u);
|
|
1465
|
+
s = Jt(n, r.pmPos, d, f);
|
|
1466
1466
|
} else {
|
|
1467
1467
|
let i = re();
|
|
1468
1468
|
if (!i) return;
|
|
1469
|
-
let a =
|
|
1469
|
+
let a = Gt(i, e, t, 1);
|
|
1470
1470
|
if (a == null || a < 0) return;
|
|
1471
|
-
s =
|
|
1471
|
+
s = Yt(n, r.pmPos, a);
|
|
1472
1472
|
}
|
|
1473
1473
|
s !== null && Ce(s), ke(() => S());
|
|
1474
1474
|
}
|
|
1475
1475
|
function Ce(e) {
|
|
1476
1476
|
let t = i.view;
|
|
1477
1477
|
if (t) try {
|
|
1478
|
-
let n =
|
|
1478
|
+
let n = Pt.create(t.state.doc, e);
|
|
1479
1479
|
t.dispatch(t.state.tr.setSelection(n));
|
|
1480
1480
|
} catch {}
|
|
1481
1481
|
}
|
|
@@ -1502,19 +1502,19 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1502
1502
|
style: R(e.style),
|
|
1503
1503
|
"data-handle": e.pos,
|
|
1504
1504
|
onMousedown: q((t) => de(t, e.pos), ["prevent", "stop"])
|
|
1505
|
-
}, null, 44,
|
|
1505
|
+
}, null, 44, ga))), 128)),
|
|
1506
1506
|
r[5] ||= P("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
1507
1507
|
P("div", {
|
|
1508
1508
|
class: "image-overlay__rotate-handle",
|
|
1509
1509
|
style: R({ left: `${C.value / 2 - 7}px` }),
|
|
1510
1510
|
title: G(n)("imageOverlay.rotate"),
|
|
1511
1511
|
onMousedown: r[2] ||= q((e) => be(e), ["prevent", "stop"])
|
|
1512
|
-
}, null, 44,
|
|
1513
|
-
s.value ? (V(), N("div",
|
|
1514
|
-
l.value ? (V(), N("div",
|
|
1512
|
+
}, null, 44, _a),
|
|
1513
|
+
s.value ? (V(), N("div", va, W(Math.round(u.value)) + " × " + W(Math.round(d.value)), 1)) : M("", !0),
|
|
1514
|
+
l.value ? (V(), N("div", ya, W(Math.round(f.value)) + "° ", 1)) : M("", !0)
|
|
1515
1515
|
], 36)) : M("", !0);
|
|
1516
1516
|
}
|
|
1517
|
-
}), [["__scopeId", "data-v-4c3d1a1d"]]),
|
|
1517
|
+
}), [["__scopeId", "data-v-4c3d1a1d"]]), Ta = /* @__PURE__ */ I({
|
|
1518
1518
|
__name: "HeaderFooterSelectionOverlay",
|
|
1519
1519
|
props: {
|
|
1520
1520
|
pagesContainer: {},
|
|
@@ -1524,11 +1524,11 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1524
1524
|
zoom: {}
|
|
1525
1525
|
},
|
|
1526
1526
|
setup(e) {
|
|
1527
|
-
let t = e, n = new
|
|
1527
|
+
let t = e, n = new rn(), r = () => {
|
|
1528
1528
|
if (!t.pagesContainer) return;
|
|
1529
1529
|
n.sync(t.pagesContainer, t.selection, t.zoom);
|
|
1530
1530
|
let e = t.pagesContainer.querySelector("[data-testid='hf-caret']")?.getBoundingClientRect();
|
|
1531
|
-
|
|
1531
|
+
tn({
|
|
1532
1532
|
hiddenHost: t.hiddenContainer,
|
|
1533
1533
|
editorView: t.editorView,
|
|
1534
1534
|
visibleCaret: e ? {
|
|
@@ -1538,8 +1538,8 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1538
1538
|
});
|
|
1539
1539
|
};
|
|
1540
1540
|
K(() => t.pagesContainer, (e, t, i) => {
|
|
1541
|
-
e && (e.addEventListener(
|
|
1542
|
-
e.removeEventListener(
|
|
1541
|
+
e && (e.addEventListener(nn, r), r(), i(() => {
|
|
1542
|
+
e.removeEventListener(nn, r), n.clear(e);
|
|
1543
1543
|
}));
|
|
1544
1544
|
}, { immediate: !0 }), K(() => [
|
|
1545
1545
|
t.selection?.rId,
|
|
@@ -1561,10 +1561,10 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1561
1561
|
});
|
|
1562
1562
|
}, o = typeof window > "u" ? null : window;
|
|
1563
1563
|
return o?.addEventListener("scroll", a, !0), B(() => {
|
|
1564
|
-
i !== null && cancelAnimationFrame(i), o?.removeEventListener("scroll", a, !0),
|
|
1564
|
+
i !== null && cancelAnimationFrame(i), o?.removeEventListener("scroll", a, !0), en(t.hiddenContainer);
|
|
1565
1565
|
}), (e, t) => null;
|
|
1566
1566
|
}
|
|
1567
|
-
}),
|
|
1567
|
+
}), Ea = { class: "hf-editor-label" }, Da = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1568
1568
|
__name: "InlineHeaderFooterEditor",
|
|
1569
1569
|
props: {
|
|
1570
1570
|
edit: {},
|
|
@@ -1582,7 +1582,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1582
1582
|
zIndex: 10
|
|
1583
1583
|
})), u = (e) => {
|
|
1584
1584
|
s.value = !1;
|
|
1585
|
-
let t = n.getView(), r =
|
|
1585
|
+
let t = n.getView(), r = $e.nodes.field;
|
|
1586
1586
|
if (!t || !r) return;
|
|
1587
1587
|
let { $from: i, from: a } = t.state.selection, o = t.state.storedMarks ?? i.marks(), c = r.create({
|
|
1588
1588
|
fieldType: e,
|
|
@@ -1607,7 +1607,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1607
1607
|
class: "hf-inline-editor",
|
|
1608
1608
|
style: R(l.value),
|
|
1609
1609
|
role: "presentation"
|
|
1610
|
-
}, [P("div", { class: L(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span",
|
|
1610
|
+
}, [P("div", { class: L(["hf-separator-bar", { "hf-separator-bar--footer": e.edit.position === "footer" }]) }, [P("span", Ea, W(c.value), 1), P("div", {
|
|
1611
1611
|
class: "hf-options",
|
|
1612
1612
|
onMousedown: n[5] ||= q(() => {}, ["stop"])
|
|
1613
1613
|
}, [F(G(a), {
|
|
@@ -1657,7 +1657,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1657
1657
|
})
|
|
1658
1658
|
], 2)) : M("", !0)], 32)], 2)], 4));
|
|
1659
1659
|
}
|
|
1660
|
-
}), [["__scopeId", "data-v-a0bd3730"]]),
|
|
1660
|
+
}), [["__scopeId", "data-v-a0bd3730"]]), Oa = ["title", "aria-label"], ka = /* @__PURE__ */ I({
|
|
1661
1661
|
__name: "OutlineToggleButton",
|
|
1662
1662
|
props: {
|
|
1663
1663
|
leftOffset: {},
|
|
@@ -1680,9 +1680,9 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1680
1680
|
}, [F(i, {
|
|
1681
1681
|
name: "format_list_bulleted",
|
|
1682
1682
|
size: 20
|
|
1683
|
-
})], 44,
|
|
1683
|
+
})], 44, Oa));
|
|
1684
1684
|
}
|
|
1685
|
-
}),
|
|
1685
|
+
}), Aa = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1686
1686
|
__name: "PageIndicator",
|
|
1687
1687
|
props: {
|
|
1688
1688
|
currentPage: {},
|
|
@@ -1701,7 +1701,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1701
1701
|
total: e.totalPages
|
|
1702
1702
|
})), 5));
|
|
1703
1703
|
}
|
|
1704
|
-
}), [["__scopeId", "data-v-f1904974"]]),
|
|
1704
|
+
}), [["__scopeId", "data-v-f1904974"]]), ja = ["data-folio-block-id"], Ma = ["data-folio-block-id", "title"], Na = 2.5, Pa = 5, Fa = 6, Ia = 2, La = 2, Ra = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1705
1705
|
__name: "TemplateDirectivesOverlay",
|
|
1706
1706
|
props: {
|
|
1707
1707
|
getView: { type: Function },
|
|
@@ -1715,19 +1715,19 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1715
1715
|
setup(e) {
|
|
1716
1716
|
let t = e, n = /* @__PURE__ */ new Set(["if", "for"]), r = /* @__PURE__ */ new Set(["endif", "endfor"]), i = (e) => e === "for" ? "for" : "if";
|
|
1717
1717
|
function a(e) {
|
|
1718
|
-
let t = e -
|
|
1719
|
-
return t <= 0 ? 0 : Math.floor(t /
|
|
1718
|
+
let t = e - Fa - Na - Ia;
|
|
1719
|
+
return t <= 0 ? 0 : Math.floor(t / Pa);
|
|
1720
1720
|
}
|
|
1721
1721
|
function o(e, t, n) {
|
|
1722
1722
|
let r = a(n), i = Math.min(Math.max(0, e), r);
|
|
1723
|
-
return t -
|
|
1723
|
+
return t - Fa - Na - (r - i) * Pa;
|
|
1724
1724
|
}
|
|
1725
1725
|
function s(e, t) {
|
|
1726
|
-
if (t.length === 0) return e.bottom - e.top >=
|
|
1726
|
+
if (t.length === 0) return e.bottom - e.top >= La ? [e] : [];
|
|
1727
1727
|
let n = [];
|
|
1728
1728
|
for (let r of t) {
|
|
1729
1729
|
let t = Math.max(e.top, r.top), i = Math.min(e.bottom, r.bottom);
|
|
1730
|
-
i - t >=
|
|
1730
|
+
i - t >= La && n.push({
|
|
1731
1731
|
top: t,
|
|
1732
1732
|
bottom: i
|
|
1733
1733
|
});
|
|
@@ -1792,7 +1792,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1792
1792
|
}
|
|
1793
1793
|
return i;
|
|
1794
1794
|
}
|
|
1795
|
-
let f = H([]), p = H([]), m = H(null), h = H(null), g = H(null), _ =
|
|
1795
|
+
let f = H([]), p = H([]), m = H(null), h = H(null), g = H(null), _ = pt(), v = null;
|
|
1796
1796
|
function y() {
|
|
1797
1797
|
v !== null && cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
1798
1798
|
v = null, b();
|
|
@@ -1804,12 +1804,12 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1804
1804
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1805
1805
|
return;
|
|
1806
1806
|
}
|
|
1807
|
-
let a =
|
|
1807
|
+
let a = on(i);
|
|
1808
1808
|
if (a.length === 0) {
|
|
1809
1809
|
f.value = [], p.value = [], m.value = null, h.value = null;
|
|
1810
1810
|
return;
|
|
1811
1811
|
}
|
|
1812
|
-
let o =
|
|
1812
|
+
let o = mt(r, t.zoom), s = await ht(a, {
|
|
1813
1813
|
pagesContainer: r,
|
|
1814
1814
|
zoom: t.zoom,
|
|
1815
1815
|
layout: t.layout,
|
|
@@ -1889,10 +1889,10 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1889
1889
|
position: "absolute",
|
|
1890
1890
|
left: `${t.railX * e.zoom}px`,
|
|
1891
1891
|
top: `${n.top * e.zoom}px`,
|
|
1892
|
-
width: `${
|
|
1892
|
+
width: `${Na * e.zoom}px`,
|
|
1893
1893
|
height: `${Math.max(0, n.bottom - n.top) * e.zoom}px`
|
|
1894
1894
|
})
|
|
1895
|
-
}, null, 14,
|
|
1895
|
+
}, null, 14, ja))), 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", {
|
|
1896
1896
|
key: `d:${n}:${i}`,
|
|
1897
1897
|
class: L(se(t.range)),
|
|
1898
1898
|
"data-folio-block-id": S(t.range),
|
|
@@ -1904,14 +1904,14 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1904
1904
|
width: `${(r.width + 2) * e.zoom}px`,
|
|
1905
1905
|
height: `${Math.max(0, r.height - 2) * e.zoom}px`
|
|
1906
1906
|
})
|
|
1907
|
-
}, null, 14,
|
|
1907
|
+
}, null, 14, Ma))), 128))], 64))), 128))], 32));
|
|
1908
1908
|
}
|
|
1909
|
-
}), [["__scopeId", "data-v-101928bf"]]),
|
|
1909
|
+
}), [["__scopeId", "data-v-101928bf"]]), za = [
|
|
1910
1910
|
"href",
|
|
1911
1911
|
"rel",
|
|
1912
1912
|
"target",
|
|
1913
1913
|
"title"
|
|
1914
|
-
],
|
|
1914
|
+
], Ba = ["title"], Va = ["title"], Ha = ["title"], Ua = { class: "docx-hyperlink-popup__edit-row" }, Wa = ["placeholder", "onKeydown"], Ga = { class: "docx-hyperlink-popup__edit-row" }, Ka = ["onKeydown"], qa = ["disabled"], Ja = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
1915
1915
|
__name: "HyperlinkPopup",
|
|
1916
1916
|
props: {
|
|
1917
1917
|
data: {},
|
|
@@ -1925,7 +1925,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1925
1925
|
"close"
|
|
1926
1926
|
],
|
|
1927
1927
|
setup(e, { emit: t }) {
|
|
1928
|
-
let { t: n } = r(), i =
|
|
1928
|
+
let { t: n } = r(), i = fn(void 0), a = e, o = t, s = H(!1), c = H(""), l = H(""), u = H(null), d = k(() => ({
|
|
1929
1929
|
left: (a.data?.position.left ?? 0) + "px",
|
|
1930
1930
|
top: (a.data?.position.top ?? 0) + "px"
|
|
1931
1931
|
}));
|
|
@@ -1960,21 +1960,21 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1960
1960
|
class: L(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": s.value }]),
|
|
1961
1961
|
style: R(d.value),
|
|
1962
1962
|
onMousedown: r[6] ||= q(() => {}, ["stop"])
|
|
1963
|
-
}, [s.value ? (V(), N(D, { key: 1 }, [P("div",
|
|
1963
|
+
}, [s.value ? (V(), N(D, { key: 1 }, [P("div", Ua, [Le(P("input", {
|
|
1964
1964
|
class: "docx-hyperlink-popup__input",
|
|
1965
1965
|
placeholder: G(n)("displayText"),
|
|
1966
1966
|
"onUpdate:modelValue": r[2] ||= (e) => c.value = e,
|
|
1967
1967
|
onKeydown: [Re(q(g, ["prevent"]), ["enter"]), r[3] ||= Re((e) => t.$emit("close"), ["esc"])]
|
|
1968
|
-
}, null, 40,
|
|
1968
|
+
}, null, 40, Wa), [[Pe, c.value]])]), P("div", Ga, [Le(P("input", {
|
|
1969
1969
|
class: "docx-hyperlink-popup__input",
|
|
1970
1970
|
placeholder: "https://...",
|
|
1971
1971
|
"onUpdate:modelValue": r[4] ||= (e) => l.value = e,
|
|
1972
1972
|
onKeydown: [Re(q(g, ["prevent"]), ["enter"]), r[5] ||= Re((e) => t.$emit("close"), ["esc"])]
|
|
1973
|
-
}, null, 40,
|
|
1973
|
+
}, null, 40, Ka), [[Pe, l.value]]), P("button", {
|
|
1974
1974
|
class: "docx-hyperlink-popup__apply",
|
|
1975
1975
|
disabled: !l.value.trim(),
|
|
1976
1976
|
onClick: q(g, ["prevent"])
|
|
1977
|
-
}, W(G(n)("common.apply")), 9,
|
|
1977
|
+
}, W(G(n)("common.apply")), 9, qa)])], 64)) : (V(), N(D, { key: 0 }, [
|
|
1978
1978
|
r[10] ||= we("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-370ef571><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-370ef571><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-370ef571></circle><path d=\"M2 12h20\" data-v-370ef571></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-370ef571></path></svg></span>", 1),
|
|
1979
1979
|
P("a", {
|
|
1980
1980
|
class: "docx-hyperlink-popup__url",
|
|
@@ -1983,7 +1983,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
1983
1983
|
target: G(i).target,
|
|
1984
1984
|
title: e.data.href,
|
|
1985
1985
|
onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1986
|
-
}, W(e.data.href), 9,
|
|
1986
|
+
}, W(e.data.href), 9, za),
|
|
1987
1987
|
r[11] ||= P("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1988
1988
|
P("button", {
|
|
1989
1989
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -2005,7 +2005,7 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
2005
2005
|
height: "13",
|
|
2006
2006
|
rx: "2",
|
|
2007
2007
|
ry: "2"
|
|
2008
|
-
}), 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,
|
|
2008
|
+
}), 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, Ba),
|
|
2009
2009
|
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
2010
2010
|
key: 0,
|
|
2011
2011
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -2020,43 +2020,43 @@ var ma = ["data-handle", "onMousedown"], ha = ["title"], ga = {
|
|
|
2020
2020
|
"stroke-width": "2",
|
|
2021
2021
|
"stroke-linecap": "round",
|
|
2022
2022
|
"stroke-linejoin": "round"
|
|
2023
|
-
}, [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,
|
|
2023
|
+
}, [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, Va)),
|
|
2024
2024
|
e.readOnly ? M("", !0) : (V(), N("button", {
|
|
2025
2025
|
key: 1,
|
|
2026
2026
|
class: "docx-hyperlink-popup__btn",
|
|
2027
2027
|
title: G(n)("removeLink"),
|
|
2028
2028
|
onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
|
|
2029
|
-
}, [...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-370ef571><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-370ef571></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-370ef571></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-370ef571></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-370ef571></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-370ef571></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-370ef571></line></svg>", 1)]], 8,
|
|
2029
|
+
}, [...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-370ef571><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-370ef571></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-370ef571></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-370ef571></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-370ef571></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-370ef571></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-370ef571></line></svg>", 1)]], 8, Ha))
|
|
2030
2030
|
], 64))], 38)) : M("", !0);
|
|
2031
2031
|
}
|
|
2032
2032
|
}), [["__scopeId", "data-v-370ef571"]]);
|
|
2033
2033
|
//#endregion
|
|
2034
2034
|
//#region src/composables/commentMarks.ts
|
|
2035
|
-
function
|
|
2035
|
+
function Ya(e, t) {
|
|
2036
2036
|
let n = Math.max(0, Math.min(t.from, e)), r = Math.max(n, Math.min(t.to, e));
|
|
2037
2037
|
return n === r ? null : {
|
|
2038
2038
|
from: n,
|
|
2039
2039
|
to: r
|
|
2040
2040
|
};
|
|
2041
2041
|
}
|
|
2042
|
-
function
|
|
2042
|
+
function Xa({ docSize: e, capturedRange: t, currentRange: n, savedRange: r }) {
|
|
2043
2043
|
let i = t.from === t.to ? n.from === n.to ? r && r.from !== r.to ? r : null : n : t;
|
|
2044
|
-
return i ?
|
|
2044
|
+
return i ? Ya(e, i) : null;
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2047
|
-
let i = e.state.schema.marks.comment, a =
|
|
2046
|
+
function Za(e, t, n, r) {
|
|
2047
|
+
let i = e.state.schema.marks.comment, a = Ya(e.state.doc.content.size, t);
|
|
2048
2048
|
if (!i || !a) return !1;
|
|
2049
2049
|
let o = e.state.tr;
|
|
2050
|
-
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId:
|
|
2050
|
+
return r?.replacePending && (o = o.removeMark(a.from, a.to, i.create({ commentId: hn }))), o = o.addMark(a.from, a.to, i.create({ commentId: n })), r?.selectEnd && (o = o.setSelection(Ft.near(o.doc.resolve(a.to), -1))), e.dispatch(o), !0;
|
|
2051
2051
|
}
|
|
2052
|
-
function
|
|
2053
|
-
let n = e.state.schema.marks.comment, r =
|
|
2054
|
-
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId:
|
|
2052
|
+
function Qa(e, t) {
|
|
2053
|
+
let n = e.state.schema.marks.comment, r = Ya(e.state.doc.content.size, t);
|
|
2054
|
+
!n || !r || e.dispatch(e.state.tr.removeMark(r.from, r.to, n.create({ commentId: hn })));
|
|
2055
2055
|
}
|
|
2056
2056
|
//#endregion
|
|
2057
2057
|
//#region src/composables/useCommentLifecycle.ts
|
|
2058
|
-
var
|
|
2059
|
-
function
|
|
2058
|
+
var $a = 408, eo = 12;
|
|
2059
|
+
function to(e) {
|
|
2060
2060
|
let t = H(!1), n = H(null), r = H(null), i = H(null), a = H(null);
|
|
2061
2061
|
function o(t) {
|
|
2062
2062
|
let n = e.editorView.value, r = e.pagesContainer.value;
|
|
@@ -2089,7 +2089,7 @@ function $a(e) {
|
|
|
2089
2089
|
r.value = null;
|
|
2090
2090
|
return;
|
|
2091
2091
|
}
|
|
2092
|
-
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left +
|
|
2092
|
+
let l = i.getBoundingClientRect(), u = e.pagesContainer.value?.getBoundingClientRect(), d = u ? u.right - l.left + eo : l.width / 2 + $a;
|
|
2093
2093
|
r.value = {
|
|
2094
2094
|
top: c.top - l.top,
|
|
2095
2095
|
left: Math.max(16, Math.min(d, l.width - 16)),
|
|
@@ -2100,7 +2100,7 @@ function $a(e) {
|
|
|
2100
2100
|
function c() {
|
|
2101
2101
|
let s = e.editorView.value;
|
|
2102
2102
|
if (!s) return;
|
|
2103
|
-
let c = r.value, l = s.state.selection, u =
|
|
2103
|
+
let c = r.value, l = s.state.selection, u = Xa({
|
|
2104
2104
|
docSize: s.state.doc.content.size,
|
|
2105
2105
|
capturedRange: c ? {
|
|
2106
2106
|
from: c.from,
|
|
@@ -2119,7 +2119,7 @@ function $a(e) {
|
|
|
2119
2119
|
r.value = null;
|
|
2120
2120
|
return;
|
|
2121
2121
|
}
|
|
2122
|
-
if (!
|
|
2122
|
+
if (!Za(s, u, hn, { selectEnd: !0 })) {
|
|
2123
2123
|
r.value = null, i.value = null;
|
|
2124
2124
|
return;
|
|
2125
2125
|
}
|
|
@@ -2132,11 +2132,11 @@ function $a(e) {
|
|
|
2132
2132
|
let n = e.editorView.value, r = i.value;
|
|
2133
2133
|
if (!n || !r) return !1;
|
|
2134
2134
|
let a = e.createComment(t);
|
|
2135
|
-
return
|
|
2135
|
+
return Za(n, r, a.id, { replacePending: !0 }) ? (e.pushComment(a), e.reLayout(), e.setActiveSidebarItem(`comment-${a.id}`), l(), !0) : !1;
|
|
2136
2136
|
}
|
|
2137
2137
|
function d() {
|
|
2138
2138
|
let t = e.editorView.value;
|
|
2139
|
-
t && i.value &&
|
|
2139
|
+
t && i.value && Qa(t, i.value), l();
|
|
2140
2140
|
}
|
|
2141
2141
|
return {
|
|
2142
2142
|
isAddingComment: t,
|
|
@@ -2150,8 +2150,8 @@ function $a(e) {
|
|
|
2150
2150
|
}
|
|
2151
2151
|
//#endregion
|
|
2152
2152
|
//#region src/composables/useCommentManagement.ts
|
|
2153
|
-
function
|
|
2154
|
-
let t =
|
|
2153
|
+
function no(e) {
|
|
2154
|
+
let t = gn(), n = H([]), r = H(!1);
|
|
2155
2155
|
function i() {
|
|
2156
2156
|
r.value = !0;
|
|
2157
2157
|
}
|
|
@@ -2166,12 +2166,12 @@ function eo(e) {
|
|
|
2166
2166
|
i(), c([...s.value, e]);
|
|
2167
2167
|
}
|
|
2168
2168
|
function u(n, r, i) {
|
|
2169
|
-
return
|
|
2169
|
+
return _n(t, s.value, e.editorView.value), vn(t, n, i ?? e.author(), r);
|
|
2170
2170
|
}
|
|
2171
2171
|
function d() {
|
|
2172
2172
|
if (a(), o.value) return;
|
|
2173
2173
|
let n = e.getDocument()?.package.document.comments;
|
|
2174
|
-
|
|
2174
|
+
_n(t, n, e.editorView.value), c(n && n.length > 0 ? n : []);
|
|
2175
2175
|
}
|
|
2176
2176
|
function f(e, t) {
|
|
2177
2177
|
l(u(t, e));
|
|
@@ -2196,7 +2196,7 @@ function eo(e) {
|
|
|
2196
2196
|
}
|
|
2197
2197
|
function _(t, n) {
|
|
2198
2198
|
let r = e.editorView.value;
|
|
2199
|
-
r && (n ?
|
|
2199
|
+
r && (n ? yn : Cn)(t)(r.state, r.dispatch);
|
|
2200
2200
|
}
|
|
2201
2201
|
function v(e) {
|
|
2202
2202
|
_(e, !0);
|
|
@@ -2206,11 +2206,11 @@ function eo(e) {
|
|
|
2206
2206
|
}
|
|
2207
2207
|
function b(t, n) {
|
|
2208
2208
|
let r = e.editorView.value;
|
|
2209
|
-
r &&
|
|
2209
|
+
r && bn(t, n)(r.state, r.dispatch);
|
|
2210
2210
|
}
|
|
2211
2211
|
function x(t, n) {
|
|
2212
2212
|
let r = e.editorView.value;
|
|
2213
|
-
r &&
|
|
2213
|
+
r && wn(t, n)(r.state, r.dispatch);
|
|
2214
2214
|
}
|
|
2215
2215
|
return {
|
|
2216
2216
|
comments: s,
|
|
@@ -2233,8 +2233,8 @@ function eo(e) {
|
|
|
2233
2233
|
}
|
|
2234
2234
|
//#endregion
|
|
2235
2235
|
//#region src/utils/imageClipboard.ts
|
|
2236
|
-
function
|
|
2237
|
-
let r =
|
|
2236
|
+
function ro(e, t, n) {
|
|
2237
|
+
let r = En(e.state), i = e.state.schema.marks.insertion;
|
|
2238
2238
|
if (!r || !i) return;
|
|
2239
2239
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
2240
2240
|
o < 0 || t.addMark(o, a, i.create({
|
|
@@ -2243,7 +2243,7 @@ function to(e, t, n) {
|
|
|
2243
2243
|
date: r.date
|
|
2244
2244
|
}));
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2246
|
+
function io(e, t) {
|
|
2247
2247
|
let n = e.state.doc.nodeAt(t);
|
|
2248
2248
|
if (!n || n.type.name !== "image") return;
|
|
2249
2249
|
let r = n.attrs.src;
|
|
@@ -2257,7 +2257,7 @@ function no(e, t) {
|
|
|
2257
2257
|
e.value = i, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
2258
2258
|
});
|
|
2259
2259
|
}
|
|
2260
|
-
function
|
|
2260
|
+
function ao(e) {
|
|
2261
2261
|
return new Promise((t, n) => {
|
|
2262
2262
|
let r = new FileReader();
|
|
2263
2263
|
r.onload = () => {
|
|
@@ -2265,7 +2265,7 @@ function ro(e) {
|
|
|
2265
2265
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
|
|
2266
2266
|
});
|
|
2267
2267
|
}
|
|
2268
|
-
function
|
|
2268
|
+
function oo(e) {
|
|
2269
2269
|
return new Promise((t) => {
|
|
2270
2270
|
let n = new Image();
|
|
2271
2271
|
n.onload = () => t({
|
|
@@ -2277,7 +2277,7 @@ function io(e) {
|
|
|
2277
2277
|
}), n.src = e;
|
|
2278
2278
|
});
|
|
2279
2279
|
}
|
|
2280
|
-
function
|
|
2280
|
+
function so(e, t, n, r) {
|
|
2281
2281
|
let i = e.state.schema.nodes.image;
|
|
2282
2282
|
if (!i) return;
|
|
2283
2283
|
let a = i.create({
|
|
@@ -2288,23 +2288,23 @@ function ao(e, t, n, r) {
|
|
|
2288
2288
|
wrapType: "inline",
|
|
2289
2289
|
displayMode: "inline"
|
|
2290
2290
|
}), o = e.state.tr.replaceSelectionWith(a);
|
|
2291
|
-
|
|
2291
|
+
ro(e, o, a), e.dispatch(o);
|
|
2292
2292
|
}
|
|
2293
|
-
async function
|
|
2293
|
+
async function co(e) {
|
|
2294
2294
|
try {
|
|
2295
2295
|
let t = await navigator.clipboard.read();
|
|
2296
2296
|
for (let n of t) {
|
|
2297
2297
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
2298
2298
|
if (t) {
|
|
2299
|
-
let r = await
|
|
2300
|
-
a > 612 && (o = Math.round(612 / a * o), a = 612),
|
|
2299
|
+
let r = await ao(await n.getType(t)), i = await oo(r), a = i.width, o = i.height;
|
|
2300
|
+
a > 612 && (o = Math.round(612 / a * o), a = 612), so(e, r, a, o);
|
|
2301
2301
|
return;
|
|
2302
2302
|
}
|
|
2303
2303
|
if (n.types.includes("text/html")) {
|
|
2304
2304
|
let t = await (await n.getType("text/html")).text(), r = /<img[^>]+src="(?<src>[^"]+)"[^>]*>/iu.exec(t)?.groups?.src;
|
|
2305
2305
|
if (r) {
|
|
2306
2306
|
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;
|
|
2307
|
-
|
|
2307
|
+
so(e, r, a || 200, o || 200);
|
|
2308
2308
|
return;
|
|
2309
2309
|
}
|
|
2310
2310
|
}
|
|
@@ -2325,14 +2325,14 @@ async function oo(e) {
|
|
|
2325
2325
|
}
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
|
-
function
|
|
2328
|
+
function lo(e, t) {
|
|
2329
2329
|
let n = e.state.doc.nodeAt(t);
|
|
2330
2330
|
if (!n || n.type.name !== "image") return;
|
|
2331
2331
|
let r = document.createElement("input");
|
|
2332
2332
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
2333
2333
|
let i = r.files?.[0];
|
|
2334
2334
|
if (!i) return;
|
|
2335
|
-
let a = await
|
|
2335
|
+
let a = await ao(i), o = await oo(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);
|
|
2336
2336
|
try {
|
|
2337
2337
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
2338
2338
|
...n.attrs,
|
|
@@ -2347,7 +2347,7 @@ function so(e, t) {
|
|
|
2347
2347
|
}
|
|
2348
2348
|
//#endregion
|
|
2349
2349
|
//#region src/composables/useContextMenus.ts
|
|
2350
|
-
var
|
|
2350
|
+
var uo = /* @__PURE__ */ new Set([
|
|
2351
2351
|
"inline",
|
|
2352
2352
|
"square",
|
|
2353
2353
|
"tight",
|
|
@@ -2356,16 +2356,16 @@ var co = /* @__PURE__ */ new Set([
|
|
|
2356
2356
|
"behind",
|
|
2357
2357
|
"inFront"
|
|
2358
2358
|
]);
|
|
2359
|
-
function
|
|
2360
|
-
return typeof e == "string" &&
|
|
2359
|
+
function fo(e) {
|
|
2360
|
+
return typeof e == "string" && uo.has(e);
|
|
2361
2361
|
}
|
|
2362
|
-
function
|
|
2363
|
-
return
|
|
2362
|
+
function po(e) {
|
|
2363
|
+
return fo(e) ? e : "inline";
|
|
2364
2364
|
}
|
|
2365
|
-
function
|
|
2365
|
+
function mo(e) {
|
|
2366
2366
|
return e === "left" || e === "right" || e === "none" ? e : null;
|
|
2367
2367
|
}
|
|
2368
|
-
function
|
|
2368
|
+
function ho(e) {
|
|
2369
2369
|
let { t } = r(), n = H({
|
|
2370
2370
|
isOpen: !1,
|
|
2371
2371
|
position: {
|
|
@@ -2407,7 +2407,7 @@ function po(e) {
|
|
|
2407
2407
|
t(e.state, (t) => e.dispatch(t), e);
|
|
2408
2408
|
}
|
|
2409
2409
|
function l(t, n, r, i, a) {
|
|
2410
|
-
let o = i === "inline" ?
|
|
2410
|
+
let o = i === "inline" ? Rt(t, e.zoom.value) : void 0;
|
|
2411
2411
|
return {
|
|
2412
2412
|
open: !0,
|
|
2413
2413
|
position: r,
|
|
@@ -2420,12 +2420,12 @@ function po(e) {
|
|
|
2420
2420
|
function u(t) {
|
|
2421
2421
|
let r = e.editorView.value;
|
|
2422
2422
|
if (!r) return;
|
|
2423
|
-
let o =
|
|
2423
|
+
let o = Bt(t.target);
|
|
2424
2424
|
if (o) {
|
|
2425
2425
|
let a = Number(o.dataset.pmStart);
|
|
2426
2426
|
if (!Number.isNaN(a)) {
|
|
2427
2427
|
try {
|
|
2428
|
-
let e =
|
|
2428
|
+
let e = Pt.create(r.state.doc, a);
|
|
2429
2429
|
r.dispatch(r.state.tr.setSelection(e));
|
|
2430
2430
|
} catch {}
|
|
2431
2431
|
e.selectedImage.value = {
|
|
@@ -2439,7 +2439,7 @@ function po(e) {
|
|
|
2439
2439
|
i.value = l(o, a, {
|
|
2440
2440
|
x: t.clientX,
|
|
2441
2441
|
y: t.clientY
|
|
2442
|
-
},
|
|
2442
|
+
}, po(s.attrs.wrapType), mo(s.attrs.cssFloat)), n.value.isOpen = !1;
|
|
2443
2443
|
return;
|
|
2444
2444
|
}
|
|
2445
2445
|
}
|
|
@@ -2450,7 +2450,7 @@ function po(e) {
|
|
|
2450
2450
|
e.setPmSelection(a);
|
|
2451
2451
|
} catch {}
|
|
2452
2452
|
}
|
|
2453
|
-
let s =
|
|
2453
|
+
let s = tt(r.state), { empty: c, from: u, to: d } = r.state.selection;
|
|
2454
2454
|
a.value = {
|
|
2455
2455
|
from: u,
|
|
2456
2456
|
to: d
|
|
@@ -2474,7 +2474,7 @@ function po(e) {
|
|
|
2474
2474
|
!o || o.type.name !== "image" || (i.value = l(a.element, a.pmPos, {
|
|
2475
2475
|
x: t.clientX,
|
|
2476
2476
|
y: t.clientY
|
|
2477
|
-
},
|
|
2477
|
+
}, po(o.attrs.wrapType), mo(o.attrs.cssFloat)), n.value.isOpen = !1);
|
|
2478
2478
|
}
|
|
2479
2479
|
function f(t) {
|
|
2480
2480
|
let n = e.editorView.value, r = i.value;
|
|
@@ -2498,16 +2498,16 @@ function po(e) {
|
|
|
2498
2498
|
case "cut":
|
|
2499
2499
|
if (e.selectedImage.value) {
|
|
2500
2500
|
let t = e.selectedImage.value.pmPos;
|
|
2501
|
-
|
|
2501
|
+
io(n, t);
|
|
2502
2502
|
let r = n.state.doc.nodeAt(t);
|
|
2503
2503
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null, e.onCut?.());
|
|
2504
2504
|
} else n.focus(), document.execCommand("cut");
|
|
2505
2505
|
break;
|
|
2506
2506
|
case "copy":
|
|
2507
|
-
e.selectedImage.value ? (
|
|
2507
|
+
e.selectedImage.value ? (io(n, e.selectedImage.value.pmPos), e.onCopy?.()) : (n.focus(), document.execCommand("copy"));
|
|
2508
2508
|
break;
|
|
2509
2509
|
case "paste":
|
|
2510
|
-
|
|
2510
|
+
co(n).then(() => e.onPaste?.()).catch(() => void 0);
|
|
2511
2511
|
break;
|
|
2512
2512
|
case "pasteAsPlainText":
|
|
2513
2513
|
navigator.clipboard.readText().then((t) => {
|
|
@@ -2528,7 +2528,7 @@ function po(e) {
|
|
|
2528
2528
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2529
2529
|
break;
|
|
2530
2530
|
case "replaceImage":
|
|
2531
|
-
e.selectedImage.value &&
|
|
2531
|
+
e.selectedImage.value && lo(n, e.selectedImage.value.pmPos);
|
|
2532
2532
|
break;
|
|
2533
2533
|
case "deleteImage":
|
|
2534
2534
|
if (e.selectedImage.value) {
|
|
@@ -2566,7 +2566,7 @@ function po(e) {
|
|
|
2566
2566
|
}
|
|
2567
2567
|
//#endregion
|
|
2568
2568
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2569
|
-
function
|
|
2569
|
+
function go(e) {
|
|
2570
2570
|
async function t(t) {
|
|
2571
2571
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2572
2572
|
}
|
|
@@ -2585,19 +2585,19 @@ function mo(e) {
|
|
|
2585
2585
|
}
|
|
2586
2586
|
//#endregion
|
|
2587
2587
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2588
|
-
var
|
|
2588
|
+
var _o = Date.now(), vo = async (e, t) => {
|
|
2589
2589
|
let n = await e.saveDocument(t);
|
|
2590
2590
|
if (!n) return null;
|
|
2591
2591
|
let r = await n.arrayBuffer();
|
|
2592
2592
|
return e.clearCommentsDirty(), e.onSave?.(r), r;
|
|
2593
2593
|
};
|
|
2594
|
-
function
|
|
2594
|
+
function yo(e) {
|
|
2595
2595
|
let t = [];
|
|
2596
2596
|
function n() {
|
|
2597
2597
|
e.onPrint?.(), window.print();
|
|
2598
2598
|
}
|
|
2599
2599
|
function r(t) {
|
|
2600
|
-
return
|
|
2600
|
+
return vo({
|
|
2601
2601
|
clearCommentsDirty: e.clearCommentsDirty,
|
|
2602
2602
|
onSave: e.onSave,
|
|
2603
2603
|
saveDocument: e.saveDocument
|
|
@@ -2606,11 +2606,11 @@ function _o(e) {
|
|
|
2606
2606
|
function i(t, n) {
|
|
2607
2607
|
let r = e.pagesRef.value;
|
|
2608
2608
|
if (!r) return !1;
|
|
2609
|
-
let i =
|
|
2609
|
+
let i = er(r, t), a = i.at(0);
|
|
2610
2610
|
return a ? (a.scrollIntoView({
|
|
2611
2611
|
block: "center",
|
|
2612
2612
|
behavior: "smooth"
|
|
2613
|
-
}), n?.highlight &&
|
|
2613
|
+
}), n?.highlight && tr(i, n.highlight), !0) : !1;
|
|
2614
2614
|
}
|
|
2615
2615
|
function a() {
|
|
2616
2616
|
return e.zoom.value;
|
|
@@ -2618,19 +2618,19 @@ function _o(e) {
|
|
|
2618
2618
|
let o = null;
|
|
2619
2619
|
function s() {
|
|
2620
2620
|
let t = e.getActiveView();
|
|
2621
|
-
return t ?
|
|
2621
|
+
return t ? un(t.state, t.dispatch) : !1;
|
|
2622
2622
|
}
|
|
2623
2623
|
function c() {
|
|
2624
2624
|
let t = e.getActiveView();
|
|
2625
|
-
return t ?
|
|
2625
|
+
return t ? ln(t.state, t.dispatch) : !1;
|
|
2626
2626
|
}
|
|
2627
2627
|
function l() {
|
|
2628
2628
|
let t = e.getActiveView();
|
|
2629
|
-
return t ?
|
|
2629
|
+
return t ? un(t.state) : !1;
|
|
2630
2630
|
}
|
|
2631
2631
|
function u() {
|
|
2632
2632
|
let t = e.getActiveView();
|
|
2633
|
-
return t ?
|
|
2633
|
+
return t ? ln(t.state) : !1;
|
|
2634
2634
|
}
|
|
2635
2635
|
function d() {
|
|
2636
2636
|
let t = e.getActiveView();
|
|
@@ -2638,9 +2638,9 @@ function _o(e) {
|
|
|
2638
2638
|
}
|
|
2639
2639
|
function f(t) {
|
|
2640
2640
|
let n = e.editorView.value, r = e.pagesRef.value, i = e.scrollRootRef.value;
|
|
2641
|
-
return !n || !r || !i ? /* @__PURE__ */ new Map() :
|
|
2641
|
+
return !n || !r || !i ? /* @__PURE__ */ new Map() : rr({
|
|
2642
2642
|
blockIds: t,
|
|
2643
|
-
snapshot:
|
|
2643
|
+
snapshot: Kn(n.state.doc),
|
|
2644
2644
|
pagesContainer: r,
|
|
2645
2645
|
scrollRoot: i
|
|
2646
2646
|
});
|
|
@@ -2650,7 +2650,7 @@ function _o(e) {
|
|
|
2650
2650
|
}
|
|
2651
2651
|
function m(t) {
|
|
2652
2652
|
let n = e.pagesRef.value;
|
|
2653
|
-
return n ?
|
|
2653
|
+
return n ? nr(n, t) : () => {};
|
|
2654
2654
|
}
|
|
2655
2655
|
function h() {
|
|
2656
2656
|
return o ??= {
|
|
@@ -2680,7 +2680,7 @@ function _o(e) {
|
|
|
2680
2680
|
getPageNumberForPmPos: (t) => {
|
|
2681
2681
|
let n = e.layout.value;
|
|
2682
2682
|
if (!n) return null;
|
|
2683
|
-
let r =
|
|
2683
|
+
let r = Dn(n, t);
|
|
2684
2684
|
return r == null ? null : r + 1;
|
|
2685
2685
|
},
|
|
2686
2686
|
getBlockRect: p,
|
|
@@ -2695,7 +2695,7 @@ function _o(e) {
|
|
|
2695
2695
|
function _() {
|
|
2696
2696
|
let t = e.layout.value, n = e.editorView.value;
|
|
2697
2697
|
if (!t || !n) return 0;
|
|
2698
|
-
let r =
|
|
2698
|
+
let r = Dn(t, n.state.selection.from);
|
|
2699
2699
|
return r == null ? 0 : r + 1;
|
|
2700
2700
|
}
|
|
2701
2701
|
function v(t) {
|
|
@@ -2730,10 +2730,10 @@ function _o(e) {
|
|
|
2730
2730
|
ensureEditorView: () => e.editor.ensureView(),
|
|
2731
2731
|
createAIEditSnapshot: () => {
|
|
2732
2732
|
let t = e.editorView.value;
|
|
2733
|
-
return t ?
|
|
2733
|
+
return t ? qn(t.state.doc, Ue(t.state)) : null;
|
|
2734
2734
|
},
|
|
2735
2735
|
applyDocumentOperations: ({ snapshot: n, batch: r, author: i = e.author() }) => {
|
|
2736
|
-
|
|
2736
|
+
Wn(r.version);
|
|
2737
2737
|
let a = e.editorView.value;
|
|
2738
2738
|
if (!a) {
|
|
2739
2739
|
let e = "committed";
|
|
@@ -2743,11 +2743,11 @@ function _o(e) {
|
|
|
2743
2743
|
reason: "unsupportedBlock"
|
|
2744
2744
|
}));
|
|
2745
2745
|
return {
|
|
2746
|
-
version:
|
|
2746
|
+
version: Bn,
|
|
2747
2747
|
status: e,
|
|
2748
2748
|
applied: [],
|
|
2749
2749
|
skipped: t,
|
|
2750
|
-
issues:
|
|
2750
|
+
issues: Xn(r.operations, t),
|
|
2751
2751
|
receipts: [],
|
|
2752
2752
|
undoHandle: null
|
|
2753
2753
|
};
|
|
@@ -2757,9 +2757,9 @@ function _o(e) {
|
|
|
2757
2757
|
let s = e.getComments(), c = {
|
|
2758
2758
|
state: a.state,
|
|
2759
2759
|
dispatch: (e) => {
|
|
2760
|
-
a.dispatch(
|
|
2760
|
+
a.dispatch(cn(e)), c.state = a.state;
|
|
2761
2761
|
}
|
|
2762
|
-
}, l =
|
|
2762
|
+
}, l = Un({
|
|
2763
2763
|
view: c,
|
|
2764
2764
|
snapshot: n,
|
|
2765
2765
|
batch: r,
|
|
@@ -2767,7 +2767,7 @@ function _o(e) {
|
|
|
2767
2767
|
createCommentId: (t) => e.createAIEditComment(t, i),
|
|
2768
2768
|
createUndoHandle: () => ({
|
|
2769
2769
|
type: "documentOperationUndo",
|
|
2770
|
-
id: `vue-${String(
|
|
2770
|
+
id: `vue-${String(_o++)}`
|
|
2771
2771
|
})
|
|
2772
2772
|
});
|
|
2773
2773
|
return l.undoHandle !== null && t.push({
|
|
@@ -2805,7 +2805,7 @@ function _o(e) {
|
|
|
2805
2805
|
},
|
|
2806
2806
|
applyAIEditOperations: ({ snapshot: t, operations: n, mode: r = "tracked-changes", author: i = e.author() }) => {
|
|
2807
2807
|
let a = e.editorView.value;
|
|
2808
|
-
return a ?
|
|
2808
|
+
return a ? Hn({
|
|
2809
2809
|
view: a,
|
|
2810
2810
|
snapshot: t,
|
|
2811
2811
|
operations: n,
|
|
@@ -2822,26 +2822,26 @@ function _o(e) {
|
|
|
2822
2822
|
},
|
|
2823
2823
|
acceptAIEditOperation: (t) => {
|
|
2824
2824
|
let n = e.editorView.value;
|
|
2825
|
-
return n ?
|
|
2825
|
+
return n ? yn(t)(n.state, n.dispatch) : !1;
|
|
2826
2826
|
},
|
|
2827
2827
|
rejectAIEditOperation: (t) => {
|
|
2828
2828
|
let n = e.editorView.value;
|
|
2829
|
-
return n ?
|
|
2829
|
+
return n ? Cn(t)(n.state, n.dispatch) : !1;
|
|
2830
2830
|
},
|
|
2831
2831
|
undo: s,
|
|
2832
2832
|
redo: c,
|
|
2833
2833
|
scrollToAIEditOperation: (t) => {
|
|
2834
2834
|
let n = e.editorView.value;
|
|
2835
2835
|
if (!n) return !1;
|
|
2836
|
-
let r =
|
|
2836
|
+
let r = xn(n.state, t);
|
|
2837
2837
|
if (!r) return !1;
|
|
2838
|
-
let { from: i, to: a } =
|
|
2838
|
+
let { from: i, to: a } = dr(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2839
2839
|
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2840
2840
|
},
|
|
2841
2841
|
scrollToBlock: (t, n) => {
|
|
2842
2842
|
let r = e.editorView.value;
|
|
2843
2843
|
if (!r) return !1;
|
|
2844
|
-
let i =
|
|
2844
|
+
let i = fr({
|
|
2845
2845
|
blockId: t,
|
|
2846
2846
|
doc: r.state.doc,
|
|
2847
2847
|
snapshot: n
|
|
@@ -2853,7 +2853,7 @@ function _o(e) {
|
|
|
2853
2853
|
highlightPassage: ({ blockId: t, text: n, snapshot: r }) => {
|
|
2854
2854
|
let a = e.editorView.value;
|
|
2855
2855
|
if (!a) return "none";
|
|
2856
|
-
let o =
|
|
2856
|
+
let o = mr({
|
|
2857
2857
|
blockId: t,
|
|
2858
2858
|
text: n,
|
|
2859
2859
|
doc: a.state.doc,
|
|
@@ -2861,13 +2861,13 @@ function _o(e) {
|
|
|
2861
2861
|
});
|
|
2862
2862
|
if (o !== null) return e.setPassageHighlight(o), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(o.from)), "passage";
|
|
2863
2863
|
e.setPassageHighlight(null);
|
|
2864
|
-
let s =
|
|
2864
|
+
let s = fr({
|
|
2865
2865
|
blockId: t,
|
|
2866
2866
|
doc: a.state.doc,
|
|
2867
2867
|
snapshot: r
|
|
2868
2868
|
});
|
|
2869
2869
|
if (s === null) return "none";
|
|
2870
|
-
let c =
|
|
2870
|
+
let c = _r(t);
|
|
2871
2871
|
if (c !== null && i(c, { highlight: {} })) return "block";
|
|
2872
2872
|
let { from: l, to: u } = s, d = a.state.doc.resolve(l), f = a.state.doc.resolve(u);
|
|
2873
2873
|
return a.dispatch(a.state.tr.setSelection(Z.between(d, f))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(l)), "block";
|
|
@@ -2878,11 +2878,11 @@ function _o(e) {
|
|
|
2878
2878
|
showInDocument: (t, n) => {
|
|
2879
2879
|
let r = e.editorView.value;
|
|
2880
2880
|
if (!r) return !1;
|
|
2881
|
-
let i = t.type === "textRange" ?
|
|
2881
|
+
let i = t.type === "textRange" ? pr({
|
|
2882
2882
|
range: t,
|
|
2883
2883
|
doc: r.state.doc,
|
|
2884
2884
|
snapshot: n
|
|
2885
|
-
}) :
|
|
2885
|
+
}) : fr({
|
|
2886
2886
|
blockId: t.blockId,
|
|
2887
2887
|
doc: r.state.doc,
|
|
2888
2888
|
snapshot: n
|
|
@@ -2893,7 +2893,7 @@ function _o(e) {
|
|
|
2893
2893
|
},
|
|
2894
2894
|
getSuggestions: () => {
|
|
2895
2895
|
let t = e.editorView.value;
|
|
2896
|
-
return t ?
|
|
2896
|
+
return t ? Sn(t.state) : [];
|
|
2897
2897
|
},
|
|
2898
2898
|
acceptSuggestion: (t, n) => {
|
|
2899
2899
|
let r = e.editorView.value;
|
|
@@ -2901,7 +2901,7 @@ function _o(e) {
|
|
|
2901
2901
|
accepted: !1,
|
|
2902
2902
|
appliedAs: null
|
|
2903
2903
|
};
|
|
2904
|
-
let i =
|
|
2904
|
+
let i = Sn(r.state).find((e) => e.suggestionId === t)?.appliedAs ?? null, a = Q(t, { author: n?.author ?? e.author() })(r.state, r.dispatch);
|
|
2905
2905
|
return {
|
|
2906
2906
|
accepted: a,
|
|
2907
2907
|
appliedAs: a ? i : null
|
|
@@ -2909,46 +2909,46 @@ function _o(e) {
|
|
|
2909
2909
|
},
|
|
2910
2910
|
rejectSuggestion: (t) => {
|
|
2911
2911
|
let n = e.editorView.value;
|
|
2912
|
-
return n ?
|
|
2912
|
+
return n ? Tn(t)(n.state, n.dispatch) : !1;
|
|
2913
2913
|
},
|
|
2914
2914
|
scrollToSuggestion: (t) => {
|
|
2915
2915
|
let n = e.editorView.value;
|
|
2916
2916
|
if (!n) return !1;
|
|
2917
|
-
let r =
|
|
2917
|
+
let r = $(n.state, t);
|
|
2918
2918
|
if (!r) return !1;
|
|
2919
|
-
let { from: i, to: a } =
|
|
2919
|
+
let { from: i, to: a } = dr(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
2920
2920
|
return n.dispatch(n.state.tr.setSelection(Z.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
2921
2921
|
},
|
|
2922
2922
|
getTrackedChanges: () => {
|
|
2923
2923
|
let t = e.editorView.value;
|
|
2924
|
-
return t ?
|
|
2924
|
+
return t ? Zn(t.state.doc) : [];
|
|
2925
2925
|
},
|
|
2926
2926
|
getCommentAnchors: () => {
|
|
2927
2927
|
let t = e.editorView.value;
|
|
2928
|
-
return t ?
|
|
2928
|
+
return t ? Yn(t.state.doc) : [];
|
|
2929
2929
|
},
|
|
2930
2930
|
getSelectionText: () => {
|
|
2931
2931
|
let t = e.editorView.value;
|
|
2932
|
-
return t ?
|
|
2932
|
+
return t ? We(t.state) : "";
|
|
2933
2933
|
},
|
|
2934
2934
|
getPageText: (t) => {
|
|
2935
2935
|
let n = e.editorView.value;
|
|
2936
|
-
return n ?
|
|
2936
|
+
return n ? br(e.layout.value, n.state.doc, t) : null;
|
|
2937
2937
|
},
|
|
2938
2938
|
getTargetPage: (t, n) => {
|
|
2939
2939
|
let r = e.editorView.value, i = e.layout.value;
|
|
2940
2940
|
if (!r || !i) return null;
|
|
2941
|
-
let a = t.type === "textRange" ?
|
|
2941
|
+
let a = t.type === "textRange" ? pr({
|
|
2942
2942
|
range: t,
|
|
2943
2943
|
doc: r.state.doc,
|
|
2944
2944
|
snapshot: n
|
|
2945
|
-
}) :
|
|
2945
|
+
}) : fr({
|
|
2946
2946
|
blockId: t.blockId,
|
|
2947
2947
|
doc: r.state.doc,
|
|
2948
2948
|
snapshot: n
|
|
2949
2949
|
});
|
|
2950
2950
|
if (a === null) return null;
|
|
2951
|
-
let o =
|
|
2951
|
+
let o = Dn(i, a.from);
|
|
2952
2952
|
return o == null ? null : o + 1;
|
|
2953
2953
|
},
|
|
2954
2954
|
getBlockRect: p,
|
|
@@ -2957,8 +2957,8 @@ function _o(e) {
|
|
|
2957
2957
|
onLayoutChange: m,
|
|
2958
2958
|
getContentControls: (t = {}) => {
|
|
2959
2959
|
let n = e.editorView.value;
|
|
2960
|
-
return n ?
|
|
2961
|
-
properties:
|
|
2960
|
+
return n ? or(n.state.doc, t).map((e) => ({
|
|
2961
|
+
properties: ir(e.node),
|
|
2962
2962
|
path: e.path,
|
|
2963
2963
|
pmPos: e.pos
|
|
2964
2964
|
})) : [];
|
|
@@ -2966,7 +2966,7 @@ function _o(e) {
|
|
|
2966
2966
|
scrollToContentControl: (t) => {
|
|
2967
2967
|
let n = e.editorView.value;
|
|
2968
2968
|
if (!n) return !1;
|
|
2969
|
-
let r =
|
|
2969
|
+
let r = ar(n.state.doc, t);
|
|
2970
2970
|
if (!r) return !1;
|
|
2971
2971
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
2972
2972
|
return n.dispatch(n.state.tr.setSelection(Z.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
@@ -2974,54 +2974,54 @@ function _o(e) {
|
|
|
2974
2974
|
setContentControlContent: (t, n, r = {}) => {
|
|
2975
2975
|
let i = e.editorView.value;
|
|
2976
2976
|
if (!i) return !1;
|
|
2977
|
-
let a = typeof n == "string" ?
|
|
2977
|
+
let a = typeof n == "string" ? cr(i.state, t, n, r) : ur(i.state, t, n, r);
|
|
2978
2978
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2979
2979
|
},
|
|
2980
2980
|
setContentControlValue: (t, n, r = {}) => {
|
|
2981
2981
|
let i = e.editorView.value;
|
|
2982
2982
|
if (!i) return !1;
|
|
2983
|
-
let a =
|
|
2983
|
+
let a = lr(i.state, t, n, r);
|
|
2984
2984
|
return a ? (i.dispatch(a), !0) : !1;
|
|
2985
2985
|
},
|
|
2986
2986
|
removeContentControl: (t, n = {}) => {
|
|
2987
2987
|
let r = e.editorView.value;
|
|
2988
2988
|
if (!r) return !1;
|
|
2989
|
-
let i =
|
|
2989
|
+
let i = sr(r.state, t, n);
|
|
2990
2990
|
return i ? (r.dispatch(i), !0) : !1;
|
|
2991
2991
|
}
|
|
2992
2992
|
} };
|
|
2993
2993
|
}
|
|
2994
2994
|
//#endregion
|
|
2995
2995
|
//#region src/composables/useFormattingActions.ts
|
|
2996
|
-
function
|
|
2996
|
+
function bo(e) {
|
|
2997
2997
|
let t = () => e.activeView?.value ?? e.editorView.value;
|
|
2998
2998
|
function n() {
|
|
2999
2999
|
let e = t();
|
|
3000
|
-
e && (
|
|
3000
|
+
e && (dn(e.state, e.dispatch, e), e.focus());
|
|
3001
3001
|
}
|
|
3002
3002
|
function r(n) {
|
|
3003
3003
|
let r = t();
|
|
3004
3004
|
if (!r) return;
|
|
3005
3005
|
let i = e.getDocument(), a = i?.package?.styles;
|
|
3006
3006
|
if (a) {
|
|
3007
|
-
let e =
|
|
3007
|
+
let e = Be(a), t = e.resolveParagraphStyle(n), o = { numbering: i?.package?.numbering ? Er(i.package.numbering) : null };
|
|
3008
3008
|
t.paragraphFormatting && (o.paragraphFormatting = t.paragraphFormatting), t.runFormatting && (o.runFormatting = t.runFormatting);
|
|
3009
3009
|
let s = e.getStyle(n)?.name;
|
|
3010
|
-
s && (o.styleName = s),
|
|
3011
|
-
} else
|
|
3010
|
+
s && (o.styleName = s), xr(n, o)(r.state, (e) => r.dispatch(e));
|
|
3011
|
+
} else xr(n)(r.state, (e) => r.dispatch(e));
|
|
3012
3012
|
r.focus();
|
|
3013
3013
|
}
|
|
3014
3014
|
function i() {
|
|
3015
3015
|
let t = e.editorView.value;
|
|
3016
|
-
t && (
|
|
3016
|
+
t && (Dr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
3017
3017
|
}
|
|
3018
3018
|
function a() {
|
|
3019
3019
|
let t = e.editorView.value;
|
|
3020
|
-
t && (
|
|
3020
|
+
t && (kr(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
3021
3021
|
}
|
|
3022
3022
|
function o() {
|
|
3023
3023
|
let t = e.editorView.value;
|
|
3024
|
-
t && (
|
|
3024
|
+
t && (Or(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
3025
3025
|
}
|
|
3026
3026
|
function s(e) {
|
|
3027
3027
|
let n = t();
|
|
@@ -3040,10 +3040,10 @@ function vo(e) {
|
|
|
3040
3040
|
}
|
|
3041
3041
|
//#endregion
|
|
3042
3042
|
//#region src/utils/fontFaces.ts
|
|
3043
|
-
function
|
|
3043
|
+
function xo() {
|
|
3044
3044
|
return typeof document > "u" || !("fonts" in document) ? null : document.fonts;
|
|
3045
3045
|
}
|
|
3046
|
-
async function
|
|
3046
|
+
async function So(e, t, n, r) {
|
|
3047
3047
|
let i;
|
|
3048
3048
|
try {
|
|
3049
3049
|
i = new FontFace(t, n, r), e.add(i);
|
|
@@ -3052,46 +3052,46 @@ async function bo(e, t, n, r) {
|
|
|
3052
3052
|
}
|
|
3053
3053
|
return await i.load().then(() => !0, () => !1) ? i : (e.delete(i), null);
|
|
3054
3054
|
}
|
|
3055
|
-
function
|
|
3056
|
-
let t =
|
|
3055
|
+
function Co(e) {
|
|
3056
|
+
let t = xo();
|
|
3057
3057
|
if (t) for (let n of e) t.delete(n);
|
|
3058
3058
|
}
|
|
3059
3059
|
//#endregion
|
|
3060
3060
|
//#region src/utils/embeddedFonts.ts
|
|
3061
|
-
var
|
|
3061
|
+
var wo = {
|
|
3062
3062
|
faces: [],
|
|
3063
3063
|
familyMap: /* @__PURE__ */ new Map()
|
|
3064
3064
|
};
|
|
3065
|
-
async function
|
|
3066
|
-
let t =
|
|
3067
|
-
if (!t) return
|
|
3065
|
+
async function To(e) {
|
|
3066
|
+
let t = xo();
|
|
3067
|
+
if (!t) return wo;
|
|
3068
3068
|
let n;
|
|
3069
3069
|
try {
|
|
3070
|
-
n = await
|
|
3070
|
+
n = await Mr(e);
|
|
3071
3071
|
} catch {
|
|
3072
|
-
return
|
|
3072
|
+
return wo;
|
|
3073
3073
|
}
|
|
3074
3074
|
return {
|
|
3075
|
-
faces: (await Promise.all(n.map((e) =>
|
|
3075
|
+
faces: (await Promise.all(n.map((e) => So(t, e.family, e.bytes, {
|
|
3076
3076
|
weight: String(e.weight),
|
|
3077
3077
|
style: e.style
|
|
3078
3078
|
})))).filter((e) => e !== null),
|
|
3079
|
-
familyMap:
|
|
3079
|
+
familyMap: jr(n)
|
|
3080
3080
|
};
|
|
3081
3081
|
}
|
|
3082
3082
|
//#endregion
|
|
3083
3083
|
//#region src/utils/hostFonts.ts
|
|
3084
|
-
function
|
|
3084
|
+
function Eo(e) {
|
|
3085
3085
|
return typeof e == "string" && e.trim().length > 0;
|
|
3086
3086
|
}
|
|
3087
|
-
function
|
|
3088
|
-
return typeof e != "object" || !e ? !1 :
|
|
3087
|
+
function Do(e) {
|
|
3088
|
+
return typeof e != "object" || !e ? !1 : Eo(Reflect.get(e, "family")) && Eo(Reflect.get(e, "src"));
|
|
3089
3089
|
}
|
|
3090
|
-
function
|
|
3090
|
+
function Oo(e) {
|
|
3091
3091
|
if (!e) return [];
|
|
3092
3092
|
let t = [];
|
|
3093
3093
|
for (let n of e) {
|
|
3094
|
-
if (!
|
|
3094
|
+
if (!Do(n)) continue;
|
|
3095
3095
|
let e = { display: "swap" };
|
|
3096
3096
|
(typeof n.weight == "number" || typeof n.weight == "string") && (e.weight = String(n.weight)), t.push({
|
|
3097
3097
|
family: n.family.trim(),
|
|
@@ -3101,20 +3101,20 @@ function Eo(e) {
|
|
|
3101
3101
|
}
|
|
3102
3102
|
return t;
|
|
3103
3103
|
}
|
|
3104
|
-
async function
|
|
3105
|
-
let t =
|
|
3104
|
+
async function ko(e) {
|
|
3105
|
+
let t = xo();
|
|
3106
3106
|
if (!t) return [];
|
|
3107
|
-
let n =
|
|
3108
|
-
return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) =>
|
|
3107
|
+
let n = Oo(e);
|
|
3108
|
+
return n.length === 0 ? [] : (await Promise.all(n.map(({ family: e, source: n, descriptors: r }) => So(t, e, n, r)))).filter((e) => e !== null);
|
|
3109
3109
|
}
|
|
3110
3110
|
//#endregion
|
|
3111
3111
|
//#region src/composables/useFontLifecycle.ts
|
|
3112
|
-
var
|
|
3113
|
-
loadEmbedded:
|
|
3114
|
-
loadHost:
|
|
3115
|
-
remove:
|
|
3112
|
+
var Ao = {
|
|
3113
|
+
loadEmbedded: To,
|
|
3114
|
+
loadHost: ko,
|
|
3115
|
+
remove: Co
|
|
3116
3116
|
};
|
|
3117
|
-
function
|
|
3117
|
+
function jo(e, t = Ao) {
|
|
3118
3118
|
K(() => e.isReady.value ? e.getDocument()?.originalBuffer ?? null : null, (n, r, i) => {
|
|
3119
3119
|
if (!n) return;
|
|
3120
3120
|
let a = !1, o = [];
|
|
@@ -3123,9 +3123,9 @@ function ko(e, t = Oo) {
|
|
|
3123
3123
|
t.remove(n);
|
|
3124
3124
|
return;
|
|
3125
3125
|
}
|
|
3126
|
-
o = n, !(n.length === 0 && r.size === 0) && (
|
|
3126
|
+
o = n, !(n.length === 0 && r.size === 0) && (Ar(r.size > 0 ? r : null), e.remeasure());
|
|
3127
3127
|
}), i(() => {
|
|
3128
|
-
a = !0, t.remove(o),
|
|
3128
|
+
a = !0, t.remove(o), Ar(null);
|
|
3129
3129
|
});
|
|
3130
3130
|
}, { immediate: !0 }), K(e.fonts, (n, r, i) => {
|
|
3131
3131
|
if (!n || n.length === 0) return;
|
|
@@ -3143,7 +3143,7 @@ function ko(e, t = Oo) {
|
|
|
3143
3143
|
}
|
|
3144
3144
|
//#endregion
|
|
3145
3145
|
//#region src/composables/useHyperlinkManagement.ts
|
|
3146
|
-
function
|
|
3146
|
+
function Mo(e) {
|
|
3147
3147
|
let t = H(null);
|
|
3148
3148
|
function n(e, t) {
|
|
3149
3149
|
t(e.state, (t) => e.dispatch(t), e);
|
|
@@ -3170,21 +3170,21 @@ function Ao(e) {
|
|
|
3170
3170
|
r && n(t, r()), t.focus();
|
|
3171
3171
|
}
|
|
3172
3172
|
function a(e) {
|
|
3173
|
-
let n =
|
|
3173
|
+
let n = pn(e);
|
|
3174
3174
|
if (!n) return;
|
|
3175
|
-
let r =
|
|
3176
|
-
window.open(n, r.target,
|
|
3175
|
+
let r = fn(void 0);
|
|
3176
|
+
window.open(n, r.target, mn(r)), t.value = null;
|
|
3177
3177
|
}
|
|
3178
3178
|
function o(n, r) {
|
|
3179
3179
|
let i = e.editorView.value;
|
|
3180
|
-
i && (
|
|
3180
|
+
i && (Nr(i, {
|
|
3181
3181
|
displayText: n,
|
|
3182
3182
|
href: r
|
|
3183
3183
|
}), t.value = null, i.focus());
|
|
3184
3184
|
}
|
|
3185
3185
|
function s() {
|
|
3186
3186
|
let n = e.editorView.value;
|
|
3187
|
-
n && (
|
|
3187
|
+
n && (Pr(n, { popupHref: t.value?.href }), t.value = null, n.focus());
|
|
3188
3188
|
}
|
|
3189
3189
|
return {
|
|
3190
3190
|
hyperlinkPopupData: t,
|
|
@@ -3197,7 +3197,7 @@ function Ao(e) {
|
|
|
3197
3197
|
}
|
|
3198
3198
|
//#endregion
|
|
3199
3199
|
//#region src/composables/useImageActions.ts
|
|
3200
|
-
function
|
|
3200
|
+
function No(e) {
|
|
3201
3201
|
let t = Ne(null), n = H(!1), r = k(() => {
|
|
3202
3202
|
e.stateTick.value;
|
|
3203
3203
|
let n = e.editorView.value, r = t.value;
|
|
@@ -3217,9 +3217,9 @@ function jo(e) {
|
|
|
3217
3217
|
function a(n) {
|
|
3218
3218
|
let r = e.editorView.value, a = t.value;
|
|
3219
3219
|
if (!r || !a) return;
|
|
3220
|
-
let o =
|
|
3220
|
+
let o = Ht(n);
|
|
3221
3221
|
if (!o) return;
|
|
3222
|
-
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu:
|
|
3222
|
+
let s = r.state.doc.nodeAt(a.pmPos)?.attrs.wrapType === "inline" && o !== "inline" ? { initialPositionEmu: Rt(a.element, e.zoom.value) } : void 0, c = e.getCommands().setImageWrapType;
|
|
3223
3223
|
c && (i(r, c(a.pmPos, o, s)), r.focus());
|
|
3224
3224
|
}
|
|
3225
3225
|
function o(n) {
|
|
@@ -3247,9 +3247,9 @@ function jo(e) {
|
|
|
3247
3247
|
}
|
|
3248
3248
|
//#endregion
|
|
3249
3249
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
3250
|
-
function
|
|
3250
|
+
function Po(e) {
|
|
3251
3251
|
function t(t) {
|
|
3252
|
-
if (
|
|
3252
|
+
if (Fr(t, {
|
|
3253
3253
|
scope: e.scope(),
|
|
3254
3254
|
roots: e.roots.map((e) => e.value)
|
|
3255
3255
|
}) && (e.handleZoomKeyDown(t), t.ctrlKey || t.metaKey)) {
|
|
@@ -3265,10 +3265,10 @@ function Mo(e) {
|
|
|
3265
3265
|
}
|
|
3266
3266
|
//#endregion
|
|
3267
3267
|
//#region src/composables/useOutlineSidebar.ts
|
|
3268
|
-
function
|
|
3268
|
+
function Fo(e) {
|
|
3269
3269
|
function t() {
|
|
3270
3270
|
let t = e.editorView.value;
|
|
3271
|
-
t && (e.outlineHeadings.value =
|
|
3271
|
+
t && (e.outlineHeadings.value = Ir(t.state.doc, He(t.state)));
|
|
3272
3272
|
}
|
|
3273
3273
|
function n() {
|
|
3274
3274
|
e.showOutline.value || t(), e.showOutline.value = !e.showOutline.value;
|
|
@@ -3299,7 +3299,7 @@ function No(e) {
|
|
|
3299
3299
|
}
|
|
3300
3300
|
//#endregion
|
|
3301
3301
|
//#region src/composables/usePageSetupControls.ts
|
|
3302
|
-
function
|
|
3302
|
+
function Io(e) {
|
|
3303
3303
|
function t(t) {
|
|
3304
3304
|
if (e.readOnly.value) return;
|
|
3305
3305
|
let n = e.getDocument();
|
|
@@ -3327,19 +3327,19 @@ function Po(e) {
|
|
|
3327
3327
|
}
|
|
3328
3328
|
function s(t) {
|
|
3329
3329
|
let n = e.editorView.value;
|
|
3330
|
-
n &&
|
|
3330
|
+
n && wr(t)(n.state, n.dispatch);
|
|
3331
3331
|
}
|
|
3332
3332
|
function c(t) {
|
|
3333
3333
|
let n = e.editorView.value;
|
|
3334
|
-
n &&
|
|
3334
|
+
n && Tr(t)(n.state, n.dispatch);
|
|
3335
3335
|
}
|
|
3336
3336
|
function l(t) {
|
|
3337
3337
|
let n = e.editorView.value;
|
|
3338
|
-
n && (t < 0 ?
|
|
3338
|
+
n && (t < 0 ? Cr(-t, !0)(n.state, n.dispatch) : Cr(t, !1)(n.state, n.dispatch));
|
|
3339
3339
|
}
|
|
3340
3340
|
function u(t) {
|
|
3341
3341
|
let n = e.editorView.value;
|
|
3342
|
-
n &&
|
|
3342
|
+
n && Sr(t)(n.state, n.dispatch);
|
|
3343
3343
|
}
|
|
3344
3344
|
return {
|
|
3345
3345
|
handlePageSetupApply: t,
|
|
@@ -3355,45 +3355,45 @@ function Po(e) {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
//#endregion
|
|
3357
3357
|
//#region src/utils/textSelection.ts
|
|
3358
|
-
var
|
|
3359
|
-
function
|
|
3360
|
-
return !e || e.length === 0 ? !1 :
|
|
3358
|
+
var Lo = /[\p{L}\p{N}\p{M}_''-]/u, Ro = /\s/;
|
|
3359
|
+
function zo(e) {
|
|
3360
|
+
return !e || e.length === 0 ? !1 : Lo.test(e);
|
|
3361
3361
|
}
|
|
3362
|
-
function
|
|
3363
|
-
return !e || e.length === 0 ? !1 :
|
|
3362
|
+
function Bo(e) {
|
|
3363
|
+
return !e || e.length === 0 ? !1 : Ro.test(e);
|
|
3364
3364
|
}
|
|
3365
|
-
function
|
|
3365
|
+
function Vo(e, t) {
|
|
3366
3366
|
if (!e || e.length === 0) return [0, 0];
|
|
3367
3367
|
t = Math.max(0, Math.min(t, e.length - 1));
|
|
3368
3368
|
let n = e[t];
|
|
3369
|
-
if (
|
|
3369
|
+
if (Bo(n)) {
|
|
3370
3370
|
let n = t, r = t;
|
|
3371
|
-
for (; n > 0 &&
|
|
3372
|
-
for (; r < e.length &&
|
|
3371
|
+
for (; n > 0 && Bo(e[n - 1]);) n--;
|
|
3372
|
+
for (; r < e.length && Bo(e[r]);) r++;
|
|
3373
3373
|
return [n, r];
|
|
3374
3374
|
}
|
|
3375
|
-
if (
|
|
3375
|
+
if (zo(n)) {
|
|
3376
3376
|
let n = t, r = t;
|
|
3377
|
-
for (; n > 0 &&
|
|
3378
|
-
for (; r < e.length &&
|
|
3377
|
+
for (; n > 0 && zo(e[n - 1]);) n--;
|
|
3378
|
+
for (; r < e.length && zo(e[r]);) r++;
|
|
3379
3379
|
return [n, r];
|
|
3380
3380
|
}
|
|
3381
3381
|
return [t, t + 1];
|
|
3382
3382
|
}
|
|
3383
3383
|
//#endregion
|
|
3384
3384
|
//#region src/utils/domQueries.ts
|
|
3385
|
-
function
|
|
3386
|
-
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) :
|
|
3385
|
+
function Ho(e, t, n) {
|
|
3386
|
+
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : $t(e);
|
|
3387
3387
|
for (let e of r) {
|
|
3388
3388
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
3389
3389
|
if (!Number.isNaN(n) && !Number.isNaN(r) && t >= n && t <= r) return e;
|
|
3390
3390
|
}
|
|
3391
3391
|
return null;
|
|
3392
3392
|
}
|
|
3393
|
-
function
|
|
3393
|
+
function Uo(e, t, n) {
|
|
3394
3394
|
if (!e || !t) return;
|
|
3395
|
-
let r =
|
|
3396
|
-
if (!r) for (let t of
|
|
3395
|
+
let r = Qt(e, n);
|
|
3396
|
+
if (!r) for (let t of $t(e)) {
|
|
3397
3397
|
let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
|
|
3398
3398
|
if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
|
|
3399
3399
|
r = t;
|
|
@@ -3407,21 +3407,21 @@ function Vo(e, t, n) {
|
|
|
3407
3407
|
behavior: "smooth"
|
|
3408
3408
|
});
|
|
3409
3409
|
}
|
|
3410
|
-
function
|
|
3410
|
+
function Wo(e, t, n, r) {
|
|
3411
3411
|
if (!e || !t) return null;
|
|
3412
|
-
let i =
|
|
3412
|
+
let i = Gt(e, n, r, 1);
|
|
3413
3413
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
3414
3414
|
}
|
|
3415
|
-
function
|
|
3415
|
+
function Go(e, t, n, r) {
|
|
3416
3416
|
if (!e) return;
|
|
3417
|
-
let i =
|
|
3417
|
+
let i = Ho(e, t, r);
|
|
3418
3418
|
if (!i) return;
|
|
3419
|
-
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] =
|
|
3419
|
+
let a = i.textContent ?? "", o = Number(i.dataset.pmStart) || 0, [s, c] = Vo(a, t - o), l = o + s, u = o + c;
|
|
3420
3420
|
l < u && n(l, u);
|
|
3421
3421
|
}
|
|
3422
|
-
function
|
|
3422
|
+
function Ko(e, t, n, r) {
|
|
3423
3423
|
if (!e) return;
|
|
3424
|
-
let i =
|
|
3424
|
+
let i = Ho(e, t, r);
|
|
3425
3425
|
if (!i) return;
|
|
3426
3426
|
let a = i.closest(".layout-paragraph");
|
|
3427
3427
|
if (!a) return;
|
|
@@ -3430,7 +3430,7 @@ function Wo(e, t, n, r) {
|
|
|
3430
3430
|
}
|
|
3431
3431
|
//#endregion
|
|
3432
3432
|
//#region src/composables/usePagesPointer.ts
|
|
3433
|
-
var
|
|
3433
|
+
var qo = 500, Jo = ({ editState: e, getDocument: t, getHfPmView: n, onDocumentChange: r, reLayout: i, setDocument: a, syncHfPMs: o }) => {
|
|
3434
3434
|
let s = e.value, c = t();
|
|
3435
3435
|
if (!c?.package || !s?.rId) {
|
|
3436
3436
|
e.value = null;
|
|
@@ -3446,21 +3446,21 @@ var Go = 500, Ko = ({ editState: e, getDocument: t, getHfPmView: n, onDocumentCh
|
|
|
3446
3446
|
e.value = null;
|
|
3447
3447
|
return;
|
|
3448
3448
|
}
|
|
3449
|
-
let d =
|
|
3449
|
+
let d = zn({
|
|
3450
3450
|
document: c,
|
|
3451
3451
|
position: s.position,
|
|
3452
3452
|
isFirstPage: s.isFirstPage,
|
|
3453
3453
|
activeRId: s.rId,
|
|
3454
|
-
blocks:
|
|
3454
|
+
blocks: On(l.state.doc, u.content)
|
|
3455
3455
|
});
|
|
3456
3456
|
e.value = null, d && (a(d), o(), i(), r(d));
|
|
3457
3457
|
};
|
|
3458
|
-
function
|
|
3458
|
+
function Yo(e) {
|
|
3459
3459
|
let t = H(null), n = null;
|
|
3460
3460
|
function r() {
|
|
3461
3461
|
n !== null && (clearTimeout(n), n = null);
|
|
3462
3462
|
}
|
|
3463
|
-
let i = Ne(null), a = 0, o = null, s = 0, c = !1, l = null, u =
|
|
3463
|
+
let i = Ne(null), a = 0, o = null, s = 0, c = !1, l = null, u = Vr(), d = S({
|
|
3464
3464
|
pagesContainer: e.pagesRef,
|
|
3465
3465
|
onScrollExtendSelection: (e, t) => {
|
|
3466
3466
|
if (!c || l === null) return;
|
|
@@ -3473,7 +3473,7 @@ function qo(e) {
|
|
|
3473
3473
|
visible: !1
|
|
3474
3474
|
}), p = null;
|
|
3475
3475
|
function m(t, n) {
|
|
3476
|
-
return
|
|
3476
|
+
return Wo(e.pagesRef.value, e.editorView.value, t, n);
|
|
3477
3477
|
}
|
|
3478
3478
|
function h() {
|
|
3479
3479
|
let t = i.value;
|
|
@@ -3486,7 +3486,7 @@ function qo(e) {
|
|
|
3486
3486
|
function g(t, n) {
|
|
3487
3487
|
let r = i.value, a = e.pagesRef.value, o = h();
|
|
3488
3488
|
if (r?.rId && a && o !== e.editorView.value) {
|
|
3489
|
-
let e =
|
|
3489
|
+
let e = Lr(a, r.position, r.rId, t, n);
|
|
3490
3490
|
return e === null || e < 0 ? null : Math.min(e, o?.state.doc.content.size ?? e);
|
|
3491
3491
|
}
|
|
3492
3492
|
return m(t, n);
|
|
@@ -3499,13 +3499,13 @@ function qo(e) {
|
|
|
3499
3499
|
} catch {}
|
|
3500
3500
|
}
|
|
3501
3501
|
function v(t) {
|
|
3502
|
-
|
|
3502
|
+
Uo(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
3503
3503
|
}
|
|
3504
3504
|
function y(t) {
|
|
3505
|
-
|
|
3505
|
+
Go(e.pagesRef.value, t, _, i.value?.position);
|
|
3506
3506
|
}
|
|
3507
3507
|
function b(t) {
|
|
3508
|
-
|
|
3508
|
+
Ko(e.pagesRef.value, t, _, i.value?.position);
|
|
3509
3509
|
}
|
|
3510
3510
|
function x(t) {
|
|
3511
3511
|
let n = e.editorView.value;
|
|
@@ -3534,7 +3534,7 @@ function qo(e) {
|
|
|
3534
3534
|
if (!o) return;
|
|
3535
3535
|
let s = e.pagesViewportRef.value;
|
|
3536
3536
|
if (!s || !(a.target instanceof HTMLElement) || a.target.closest(".docx-editor-vue__note-editor")) return;
|
|
3537
|
-
let l =
|
|
3537
|
+
let l = Br({
|
|
3538
3538
|
mouseX: a.clientX,
|
|
3539
3539
|
mouseY: a.clientY,
|
|
3540
3540
|
pagesContainer: o,
|
|
@@ -3544,7 +3544,7 @@ function qo(e) {
|
|
|
3544
3544
|
if (!l) {
|
|
3545
3545
|
n === null && (n = setTimeout(() => {
|
|
3546
3546
|
t.value = null, n = null;
|
|
3547
|
-
},
|
|
3547
|
+
}, zr));
|
|
3548
3548
|
return;
|
|
3549
3549
|
}
|
|
3550
3550
|
let u = e.zoom.value || 1, d = s.getBoundingClientRect();
|
|
@@ -3595,7 +3595,7 @@ function qo(e) {
|
|
|
3595
3595
|
if (e.readOnly.value || !(t.target instanceof HTMLElement)) return;
|
|
3596
3596
|
let n = t.target;
|
|
3597
3597
|
if (n.closest(".docx-editor-vue__note-editor")) return;
|
|
3598
|
-
let r =
|
|
3598
|
+
let r = Rr(n);
|
|
3599
3599
|
if (r) {
|
|
3600
3600
|
t.preventDefault(), t.stopPropagation(), i.value && ie(), e.openNoteStory(r);
|
|
3601
3601
|
return;
|
|
@@ -3605,11 +3605,11 @@ function qo(e) {
|
|
|
3605
3605
|
if (!s) return;
|
|
3606
3606
|
let c = a ? "header" : "footer", l = e.getDocument();
|
|
3607
3607
|
if (!l?.package) return;
|
|
3608
|
-
let u = s.closest("[data-page-number]"), d = Number.parseInt(u?.dataset.pageNumber ?? "1", 10), f =
|
|
3608
|
+
let u = s.closest("[data-page-number]"), d = Number.parseInt(u?.dataset.pageNumber ?? "1", 10), f = Rn(l.package), p = f.hasTitlePg && d === 1, m = In(f, c, p);
|
|
3609
3609
|
if (!m) {
|
|
3610
|
-
let t =
|
|
3610
|
+
let t = Fn(l, c, p);
|
|
3611
3611
|
if (!t) return;
|
|
3612
|
-
e.setDocument(t), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(t), f =
|
|
3612
|
+
e.setDocument(t), e.syncHfPMs(), e.reLayout(), e.onDocumentChange(t), f = Rn(t.package), m = In(f, c, p);
|
|
3613
3613
|
}
|
|
3614
3614
|
if (!m) return;
|
|
3615
3615
|
let h = m, g = e.pagesViewportRef.value;
|
|
@@ -3629,7 +3629,7 @@ function qo(e) {
|
|
|
3629
3629
|
}, requestAnimationFrame(() => {
|
|
3630
3630
|
let n = e.getHfPmView(h);
|
|
3631
3631
|
if (!n) return;
|
|
3632
|
-
let r =
|
|
3632
|
+
let r = Lr(e.pagesRef.value ?? s, c, h, t.clientX, t.clientY);
|
|
3633
3633
|
if (r !== null) {
|
|
3634
3634
|
let e = Math.max(0, Math.min(r, n.state.doc.content.size));
|
|
3635
3635
|
n.dispatch(n.state.tr.setSelection(Z.create(n.state.doc, e)));
|
|
@@ -3638,7 +3638,7 @@ function qo(e) {
|
|
|
3638
3638
|
});
|
|
3639
3639
|
}
|
|
3640
3640
|
function ie() {
|
|
3641
|
-
|
|
3641
|
+
Jo({
|
|
3642
3642
|
editState: i,
|
|
3643
3643
|
getDocument: e.getDocument,
|
|
3644
3644
|
getHfPmView: e.getHfPmView,
|
|
@@ -3654,7 +3654,7 @@ function qo(e) {
|
|
|
3654
3654
|
i.value = null;
|
|
3655
3655
|
return;
|
|
3656
3656
|
}
|
|
3657
|
-
let r =
|
|
3657
|
+
let r = Ln({
|
|
3658
3658
|
document: t,
|
|
3659
3659
|
position: n.position,
|
|
3660
3660
|
activeRId: n.rId
|
|
@@ -3690,13 +3690,13 @@ function qo(e) {
|
|
|
3690
3690
|
}
|
|
3691
3691
|
let f = h() ?? n;
|
|
3692
3692
|
if (!e.readOnly.value && e.tableResize.tryStartResize(t, f)) return;
|
|
3693
|
-
let p =
|
|
3693
|
+
let p = Bt(r);
|
|
3694
3694
|
if (p) {
|
|
3695
3695
|
t.preventDefault(), t.stopPropagation();
|
|
3696
3696
|
let n = Number(p.dataset.pmStart);
|
|
3697
3697
|
if (!Number.isNaN(n)) {
|
|
3698
3698
|
try {
|
|
3699
|
-
f.dispatch(f.state.tr.setSelection(
|
|
3699
|
+
f.dispatch(f.state.tr.setSelection(Pt.create(f.state.doc, n)));
|
|
3700
3700
|
} catch {}
|
|
3701
3701
|
e.selectedImage.value = {
|
|
3702
3702
|
element: p,
|
|
@@ -3715,12 +3715,12 @@ function qo(e) {
|
|
|
3715
3715
|
return;
|
|
3716
3716
|
}
|
|
3717
3717
|
let v = Date.now();
|
|
3718
|
-
if (v - a <
|
|
3718
|
+
if (v - a < qo && o === m ? s++ : s = 1, a = v, o = m, s === 2) y(m);
|
|
3719
3719
|
else if (s >= 3) b(m), s = 0;
|
|
3720
3720
|
else if (t.shiftKey) {
|
|
3721
3721
|
let { from: e } = f.state.selection;
|
|
3722
3722
|
_(e, m);
|
|
3723
|
-
} else _(m), l = m, c = !0, u.begin(
|
|
3723
|
+
} else _(m), l = m, c = !0, u.begin(Hr(f, m));
|
|
3724
3724
|
f.focus();
|
|
3725
3725
|
}
|
|
3726
3726
|
function se(e) {
|
|
@@ -3788,8 +3788,8 @@ function qo(e) {
|
|
|
3788
3788
|
}
|
|
3789
3789
|
//#endregion
|
|
3790
3790
|
//#region src/composables/useRemoteSelectionSync.ts
|
|
3791
|
-
var
|
|
3792
|
-
let t = new
|
|
3791
|
+
var Xo = (e) => {
|
|
3792
|
+
let t = new Ur(), n = null, r = () => {
|
|
3793
3793
|
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3794
3794
|
let r = e.pagesRef.value;
|
|
3795
3795
|
r && t.clear(r);
|
|
@@ -3812,8 +3812,8 @@ var Jo = (e) => {
|
|
|
3812
3812
|
], i, { flush: "post" }), B(() => {
|
|
3813
3813
|
a(), r();
|
|
3814
3814
|
});
|
|
3815
|
-
},
|
|
3816
|
-
let t = new
|
|
3815
|
+
}, Zo = (e) => {
|
|
3816
|
+
let t = new Wr(), n = null, r = () => {
|
|
3817
3817
|
n !== null && (cancelAnimationFrame(n), n = null);
|
|
3818
3818
|
let r = e.pagesRef.value;
|
|
3819
3819
|
r && t.clear(r);
|
|
@@ -3827,8 +3827,8 @@ var Jo = (e) => {
|
|
|
3827
3827
|
state: i.state,
|
|
3828
3828
|
zoom: e.zoom.value,
|
|
3829
3829
|
zIndex: ae.selectionOverlay
|
|
3830
|
-
}), { selection: o } = i.state, s = r.getBoundingClientRect(), c = o.empty ?
|
|
3831
|
-
if (
|
|
3830
|
+
}), { selection: o } = i.state, s = r.getBoundingClientRect(), c = o.empty ? Kt(r, o.head, s) : null;
|
|
3831
|
+
if (tn({
|
|
3832
3832
|
hiddenHost: e.hiddenContainer.value,
|
|
3833
3833
|
editorView: i,
|
|
3834
3834
|
visibleCaret: c ? {
|
|
@@ -3859,27 +3859,27 @@ var Jo = (e) => {
|
|
|
3859
3859
|
}, { immediate: !0 });
|
|
3860
3860
|
let o = typeof window > "u" ? null : window;
|
|
3861
3861
|
return o?.addEventListener("scroll", i, !0), B(() => {
|
|
3862
|
-
a(), r(), o?.removeEventListener("scroll", i, !0),
|
|
3862
|
+
a(), r(), o?.removeEventListener("scroll", i, !0), en(e.hiddenContainer.value);
|
|
3863
3863
|
}), {
|
|
3864
3864
|
clearOverlay: r,
|
|
3865
3865
|
updateSelectionOverlay: i
|
|
3866
3866
|
};
|
|
3867
|
-
},
|
|
3867
|
+
}, Qo = { class: "docx-editor-vue__toolbar-shell" }, $o = {
|
|
3868
3868
|
key: 0,
|
|
3869
3869
|
class: "docx-editor-vue__error"
|
|
3870
|
-
},
|
|
3870
|
+
}, es = {
|
|
3871
3871
|
key: 1,
|
|
3872
3872
|
class: "docx-editor-vue__loading"
|
|
3873
|
-
},
|
|
3873
|
+
}, ts = {
|
|
3874
3874
|
key: 2,
|
|
3875
3875
|
class: "docx-editor-vue__placeholder"
|
|
3876
|
-
},
|
|
3876
|
+
}, ns = { class: "docx-editor-vue__editor-area" }, rs = {
|
|
3877
3877
|
key: 0,
|
|
3878
3878
|
class: "docx-editor-vue__ruler-h"
|
|
3879
|
-
},
|
|
3879
|
+
}, is = {
|
|
3880
3880
|
key: 1,
|
|
3881
3881
|
class: "docx-editor-vue__ruler-v"
|
|
3882
|
-
},
|
|
3882
|
+
}, as = {
|
|
3883
3883
|
class: "docx-editor-vue__editor-content-wrapper",
|
|
3884
3884
|
style: {
|
|
3885
3885
|
position: "relative",
|
|
@@ -3887,11 +3887,11 @@ var Jo = (e) => {
|
|
|
3887
3887
|
flexDirection: "column",
|
|
3888
3888
|
minHeight: "100%"
|
|
3889
3889
|
}
|
|
3890
|
-
},
|
|
3890
|
+
}, os = {
|
|
3891
3891
|
"data-testid": "selection-overlay",
|
|
3892
3892
|
class: "docx-editor-vue__decoration-origin",
|
|
3893
3893
|
"aria-hidden": "true"
|
|
3894
|
-
},
|
|
3894
|
+
}, ss = ["aria-label"], cs = { class: "docx-editor-vue__note-editor-header" }, ls = ["aria-label"], us = ["aria-label"], ds = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
3895
3895
|
__name: "DocxEditor",
|
|
3896
3896
|
props: {
|
|
3897
3897
|
documentBuffer: { default: null },
|
|
@@ -4018,13 +4018,13 @@ var Jo = (e) => {
|
|
|
4018
4018
|
let o = e, s = o.plugins ?? [], c = n;
|
|
4019
4019
|
a(o.components);
|
|
4020
4020
|
let l = fe();
|
|
4021
|
-
|
|
4021
|
+
Di(l);
|
|
4022
4022
|
function u(e) {
|
|
4023
4023
|
o.onChange?.(e), c("change", e), c("update:document", e);
|
|
4024
4024
|
}
|
|
4025
|
-
let d = H(o.mode), f = k(() => o.readOnly || d.value === "viewing"), p = k(() => o.showReviewControls), m = k(() =>
|
|
4025
|
+
let d = H(o.mode), f = k(() => o.readOnly || d.value === "viewing"), p = k(() => o.showReviewControls), m = k(() => Ut(d.value)), h = H("all-markup");
|
|
4026
4026
|
function _() {
|
|
4027
|
-
Jn(
|
|
4027
|
+
Jn(Wt(d.value));
|
|
4028
4028
|
}
|
|
4029
4029
|
function x(e) {
|
|
4030
4030
|
h.value = e;
|
|
@@ -4035,18 +4035,18 @@ var Jo = (e) => {
|
|
|
4035
4035
|
K(ae, (e) => {
|
|
4036
4036
|
e || (S.value = !1);
|
|
4037
4037
|
});
|
|
4038
|
-
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:
|
|
4039
|
-
function
|
|
4038
|
+
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: Be, zoomOut: He, handleWheel: Ue, handleKeyDown: We, ZOOM_PRESETS: Ge } = de(o.initialZoom);
|
|
4039
|
+
function qe(e) {
|
|
4040
4040
|
o.enableWheelZoom !== !1 && Ue(e);
|
|
4041
4041
|
}
|
|
4042
|
-
|
|
4042
|
+
Po({
|
|
4043
4043
|
showFindReplace: E,
|
|
4044
4044
|
showHyperlink: _e,
|
|
4045
4045
|
handleZoomKeyDown: We,
|
|
4046
4046
|
scope: () => o.keyboardShortcuts ?? "document",
|
|
4047
4047
|
roots: [oe]
|
|
4048
4048
|
});
|
|
4049
|
-
let { editor:
|
|
4049
|
+
let { editor: Ye, editorView: J, editorState: Qe, remoteSelections: $e, headerFooterSelection: lt, activeNoteStory: dt, 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({
|
|
4050
4050
|
hiddenContainer: C,
|
|
4051
4051
|
hiddenHeaderFooterContainer: ue,
|
|
4052
4052
|
noteEditorContainer: Ee,
|
|
@@ -4069,7 +4069,7 @@ var Jo = (e) => {
|
|
|
4069
4069
|
o.onError?.(e), c("error", e);
|
|
4070
4070
|
},
|
|
4071
4071
|
onSelectionUpdate: (e) => {
|
|
4072
|
-
if (o.onSelectionChange?.(
|
|
4072
|
+
if (o.onSelectionChange?.(Ve(e)), o.onSelectionTextChange) {
|
|
4073
4073
|
let { from: t, to: n } = e.selection, r = t === n ? "" : e.doc.textBetween(t, n, " ", " ");
|
|
4074
4074
|
o.onSelectionTextChange({
|
|
4075
4075
|
from: t,
|
|
@@ -4086,55 +4086,55 @@ var Jo = (e) => {
|
|
|
4086
4086
|
featureFlags: () => o.featureFlags,
|
|
4087
4087
|
onSelectiveSaveTripwire: o.onSelectiveSaveTripwire ? (e) => o.onSelectiveSaveTripwire?.(e) : void 0
|
|
4088
4088
|
});
|
|
4089
|
-
K(
|
|
4089
|
+
K(Qe, (e, t) => {
|
|
4090
4090
|
he.value !== null && e && t && !e.doc.eq(t.doc) && (he.value = null);
|
|
4091
4091
|
});
|
|
4092
|
-
let X = k(() =>
|
|
4092
|
+
let X = k(() => it({
|
|
4093
4093
|
bodyView: J.value,
|
|
4094
4094
|
headerFooterView: I.value ? wt(I.value) : null,
|
|
4095
4095
|
noteView: Ot()
|
|
4096
4096
|
}).view), jt = k(() => {
|
|
4097
|
-
let e =
|
|
4097
|
+
let e = dt.value;
|
|
4098
4098
|
return e ? te(e.kind === "footnote" ? "dialogs.footnoteProperties.footnotes" : "dialogs.footnoteProperties.endnotes") : "";
|
|
4099
4099
|
}), Mt = k(() => !pt.value && ae.value && !(o.preserveDocumentWhileLoading === !0 && S.value));
|
|
4100
4100
|
function Nt() {
|
|
4101
|
-
J.value && (
|
|
4101
|
+
J.value && (ot(), at(), At());
|
|
4102
4102
|
}
|
|
4103
|
-
|
|
4103
|
+
jo({
|
|
4104
4104
|
isReady: pt,
|
|
4105
4105
|
getDocument: Y,
|
|
4106
4106
|
fonts: () => o.fonts,
|
|
4107
4107
|
remeasure: Nt
|
|
4108
4108
|
});
|
|
4109
|
-
let { selectedImage:
|
|
4109
|
+
let { selectedImage: Pt, imageInteracting: Ft, imageToolbarContext: Z, handleToolbarImageWrap: It, handleImageTransform: Lt } = No({
|
|
4110
4110
|
editorView: X,
|
|
4111
4111
|
zoom: B,
|
|
4112
4112
|
stateTick: T,
|
|
4113
4113
|
getCommands: kt
|
|
4114
|
-
}), Rt =
|
|
4114
|
+
}), Rt = Zo({
|
|
4115
4115
|
editorView: J,
|
|
4116
4116
|
hiddenContainer: C,
|
|
4117
4117
|
pagesRef: w,
|
|
4118
4118
|
zoom: B,
|
|
4119
|
-
selectedImage:
|
|
4119
|
+
selectedImage: Pt,
|
|
4120
4120
|
syncCoordinator: yt,
|
|
4121
|
-
imageInteracting:
|
|
4121
|
+
imageInteracting: Ft
|
|
4122
4122
|
});
|
|
4123
|
-
|
|
4123
|
+
Xo({
|
|
4124
4124
|
pagesRef: w,
|
|
4125
|
-
remoteSelections:
|
|
4125
|
+
remoteSelections: $e,
|
|
4126
4126
|
syncCoordinator: yt,
|
|
4127
4127
|
zoom: B
|
|
4128
4128
|
});
|
|
4129
|
-
let { hyperlinkPopupData: zt, handleHyperlinkSubmit: Bt, handleHyperlinkRemove:
|
|
4129
|
+
let { hyperlinkPopupData: zt, handleHyperlinkSubmit: Bt, handleHyperlinkRemove: Vt, handleHyperlinkPopupNavigate: Ht, handleHyperlinkPopupEdit: Gt, handleHyperlinkPopupRemove: Kt } = Mo({
|
|
4130
4130
|
editorView: X,
|
|
4131
4131
|
getCommands: kt
|
|
4132
|
-
}), 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 } =
|
|
4132
|
+
}), 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 } = Yo({
|
|
4133
4133
|
editorView: J,
|
|
4134
4134
|
pagesRef: w,
|
|
4135
4135
|
pagesViewportRef: pe,
|
|
4136
|
-
selectedImage:
|
|
4137
|
-
imageInteracting:
|
|
4136
|
+
selectedImage: Pt,
|
|
4137
|
+
imageInteracting: Ft,
|
|
4138
4138
|
hyperlinkPopupData: zt,
|
|
4139
4139
|
readOnly: f,
|
|
4140
4140
|
showHeaderFooterEditing: k(() => o.showHeaderFooterEditing),
|
|
@@ -4158,7 +4158,7 @@ var Jo = (e) => {
|
|
|
4158
4158
|
onDocumentChange: u,
|
|
4159
4159
|
clearOverlay: Rt.clearOverlay
|
|
4160
4160
|
}), cn = () => Yt.value?.rId ? wt(Yt.value.rId) : null, ln = k(() => {
|
|
4161
|
-
let e = Yt.value, t =
|
|
4161
|
+
let e = Yt.value, t = lt.value;
|
|
4162
4162
|
return !e?.rId || !t || t.rId !== e.rId ? null : {
|
|
4163
4163
|
...t,
|
|
4164
4164
|
pageNumber: e.pageNumber
|
|
@@ -4167,7 +4167,7 @@ var Jo = (e) => {
|
|
|
4167
4167
|
K(Yt, (e) => {
|
|
4168
4168
|
I.value = e?.rId ?? null, e && Rt.clearOverlay();
|
|
4169
4169
|
}, { immediate: !0 });
|
|
4170
|
-
let un =
|
|
4170
|
+
let un = Fo({
|
|
4171
4171
|
editorView: J,
|
|
4172
4172
|
showOutline: O,
|
|
4173
4173
|
showSidebar: A,
|
|
@@ -4175,9 +4175,9 @@ var Jo = (e) => {
|
|
|
4175
4175
|
activeSidebarItem: we,
|
|
4176
4176
|
extractCommentsAndChanges: () => {},
|
|
4177
4177
|
scrollToVisiblePosition: $t
|
|
4178
|
-
}), { contextMenu: dn, imageContextMenu: fn, imageContextMenuTextActions: pn, customTextMenuItems: mn, handleContextMenu: hn, handleSelectedImageContextMenu: gn, handleImageWrapSelect: _n, handleContextMenuAction: vn } =
|
|
4178
|
+
}), { contextMenu: dn, imageContextMenu: fn, imageContextMenuTextActions: pn, customTextMenuItems: mn, handleContextMenu: hn, handleSelectedImageContextMenu: gn, handleImageWrapSelect: _n, handleContextMenuAction: vn } = ho({
|
|
4179
4179
|
editorView: X,
|
|
4180
|
-
selectedImage:
|
|
4180
|
+
selectedImage: Pt,
|
|
4181
4181
|
zoom: B,
|
|
4182
4182
|
showImageProperties: ye,
|
|
4183
4183
|
getCommands: kt,
|
|
@@ -4189,7 +4189,7 @@ var Jo = (e) => {
|
|
|
4189
4189
|
onCopy: () => o.onCopy?.(),
|
|
4190
4190
|
onCut: () => o.onCut?.(),
|
|
4191
4191
|
onPaste: () => o.onPaste?.()
|
|
4192
|
-
}), yn = le(J, T), bn = k(() => yn.value.entries), Q =
|
|
4192
|
+
}), yn = le(J, T), bn = k(() => yn.value.entries), Q = no({
|
|
4193
4193
|
editorView: J,
|
|
4194
4194
|
getDocument: Y,
|
|
4195
4195
|
author: () => o.author,
|
|
@@ -4198,7 +4198,7 @@ var Jo = (e) => {
|
|
|
4198
4198
|
o.onCommentsChange?.(e), c("comments-change", e);
|
|
4199
4199
|
},
|
|
4200
4200
|
reLayout: At
|
|
4201
|
-
}), xn = Q.comments, $ =
|
|
4201
|
+
}), xn = Q.comments, $ = to({
|
|
4202
4202
|
editorView: J,
|
|
4203
4203
|
pagesViewport: pe,
|
|
4204
4204
|
pagesContainer: w,
|
|
@@ -4221,20 +4221,20 @@ var Jo = (e) => {
|
|
|
4221
4221
|
}), wn = k(() => {
|
|
4222
4222
|
T.value;
|
|
4223
4223
|
let e = Y();
|
|
4224
|
-
return e ?
|
|
4224
|
+
return e ? ut(e) : void 0;
|
|
4225
4225
|
}), Tn = k(() => {
|
|
4226
4226
|
T.value;
|
|
4227
4227
|
let e = X.value;
|
|
4228
4228
|
if (!e) return {};
|
|
4229
|
-
let t =
|
|
4230
|
-
return t ?
|
|
4229
|
+
let t = tt(e.state).table;
|
|
4230
|
+
return t ? et(t) : {};
|
|
4231
4231
|
}), En = k(() => {
|
|
4232
4232
|
T.value;
|
|
4233
4233
|
let e = {};
|
|
4234
4234
|
o.fontFamilies !== void 0 && (e.fontFamilies = o.fontFamilies);
|
|
4235
4235
|
let t = Y()?.package.styles?.styles;
|
|
4236
4236
|
return t !== void 0 && (e.documentStyles = t), e;
|
|
4237
|
-
}), Dn = k(() =>
|
|
4237
|
+
}), Dn = k(() => ct(Cn.value?.pageWidth ?? 12240) * B.value), On = k(() => {
|
|
4238
4238
|
let e = /* @__PURE__ */ new Set();
|
|
4239
4239
|
for (let t of xn.value) t.done && e.add(t.id);
|
|
4240
4240
|
return e;
|
|
@@ -4242,7 +4242,7 @@ var Jo = (e) => {
|
|
|
4242
4242
|
transform: B.value === 1 ? void 0 : `scale(${B.value})`,
|
|
4243
4243
|
transformOrigin: "top center",
|
|
4244
4244
|
transition: "transform 0.2s ease"
|
|
4245
|
-
})), { handleApplyStyle: An, handleInsertSymbol: jn, handleInsertSectionBreakNextPage: Mn, handleInsertSectionBreakContinuous: Nn } =
|
|
4245
|
+
})), { handleApplyStyle: An, handleInsertSymbol: jn, handleInsertSectionBreakNextPage: Mn, handleInsertSectionBreakContinuous: Nn } = bo({
|
|
4246
4246
|
editorView: X,
|
|
4247
4247
|
getDocument: Y
|
|
4248
4248
|
});
|
|
@@ -4256,7 +4256,7 @@ var Jo = (e) => {
|
|
|
4256
4256
|
let t = document.createElement("input");
|
|
4257
4257
|
t.type = "file", t.accept = "image/*", t.style.display = "none", t.addEventListener("change", () => {
|
|
4258
4258
|
let n = t.files?.[0];
|
|
4259
|
-
n &&
|
|
4259
|
+
n && Ke(e, n, () => e.focus()), t.remove();
|
|
4260
4260
|
}), document.body.appendChild(t), t.click();
|
|
4261
4261
|
}
|
|
4262
4262
|
function Fn(e, t) {
|
|
@@ -4265,7 +4265,7 @@ var Jo = (e) => {
|
|
|
4265
4265
|
return;
|
|
4266
4266
|
}
|
|
4267
4267
|
let n = X.value;
|
|
4268
|
-
n && (
|
|
4268
|
+
n && (Xe(n, e, t), n.focus());
|
|
4269
4269
|
}
|
|
4270
4270
|
function In() {
|
|
4271
4271
|
if (o.onInsertPageBreak) {
|
|
@@ -4273,7 +4273,7 @@ var Jo = (e) => {
|
|
|
4273
4273
|
return;
|
|
4274
4274
|
}
|
|
4275
4275
|
let e = J.value;
|
|
4276
|
-
e && (
|
|
4276
|
+
e && (Je(e), e.focus());
|
|
4277
4277
|
}
|
|
4278
4278
|
function Ln() {
|
|
4279
4279
|
if (o.onInsertTOC) {
|
|
@@ -4283,7 +4283,7 @@ var Jo = (e) => {
|
|
|
4283
4283
|
let e = J.value;
|
|
4284
4284
|
e && (Ze(e, { title: te("toolbar.tableOfContents") }), e.focus());
|
|
4285
4285
|
}
|
|
4286
|
-
let { handlePageSetupApply: Rn, handleLeftMarginChange: zn, handleRightMarginChange: Bn, handleTopMarginChange: Vn, handleBottomMarginChange: Hn, handleIndentLeftChange: Un, handleIndentRightChange: Wn, handleFirstLineIndentChange: Gn, handleTabStopRemove: Kn } =
|
|
4286
|
+
let { handlePageSetupApply: Rn, handleLeftMarginChange: zn, handleRightMarginChange: Bn, handleTopMarginChange: Vn, handleBottomMarginChange: Hn, handleIndentLeftChange: Un, handleIndentRightChange: Wn, handleFirstLineIndentChange: Gn, handleTabStopRemove: Kn } = Io({
|
|
4287
4287
|
editorView: J,
|
|
4288
4288
|
getDocument: Y,
|
|
4289
4289
|
readOnly: f,
|
|
@@ -4292,7 +4292,7 @@ var Jo = (e) => {
|
|
|
4292
4292
|
onChange: u
|
|
4293
4293
|
}), qn = k(() => {
|
|
4294
4294
|
T.value;
|
|
4295
|
-
let e = X.value, t = e ?
|
|
4295
|
+
let e = X.value, t = e ? nt(e.state).paragraphFormatting : {};
|
|
4296
4296
|
return {
|
|
4297
4297
|
indentLeft: t.indentLeft ?? 0,
|
|
4298
4298
|
indentRight: t.indentRight ?? 0,
|
|
@@ -4351,7 +4351,7 @@ var Jo = (e) => {
|
|
|
4351
4351
|
if (f.value) return;
|
|
4352
4352
|
let t = Y();
|
|
4353
4353
|
if (!t) return;
|
|
4354
|
-
let n =
|
|
4354
|
+
let n = ft(t, e);
|
|
4355
4355
|
Ct(n), mt.value = !0, T.value++, At(), u(n);
|
|
4356
4356
|
}
|
|
4357
4357
|
function Zn(e, t) {
|
|
@@ -4362,7 +4362,7 @@ var Jo = (e) => {
|
|
|
4362
4362
|
!t || !n || (n(e)(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
4363
4363
|
}
|
|
4364
4364
|
let $n = H(!1);
|
|
4365
|
-
|
|
4365
|
+
go({
|
|
4366
4366
|
documentBuffer: () => o.documentBuffer ?? null,
|
|
4367
4367
|
document: () => o.document ?? null,
|
|
4368
4368
|
loadDocumentBuffer: bt,
|
|
@@ -4393,21 +4393,21 @@ var Jo = (e) => {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
me.value && (me.value.scrollTop = 0, me.value.scrollLeft = 0), S.value = !0, un.recomputeHeadingsIfOpen(), Q.seedFromDocument();
|
|
4395
4395
|
let t = Y();
|
|
4396
|
-
t && o.onCompatibilityChange?.(
|
|
4396
|
+
t && o.onCompatibilityChange?.(rt(t)), o.autoOpenReviewSidebar !== !1 && !$n.value && (xn.value.length > 0 || bn.value.length > 0) && ($n.value = !0, A.value = !0), nr(), c("ready");
|
|
4397
4397
|
}), Ae(() => {
|
|
4398
|
-
let e =
|
|
4398
|
+
let e = Ye.on("selectionChange", () => {
|
|
4399
4399
|
T.value++, $.updateFloatingButton();
|
|
4400
|
-
}), t =
|
|
4400
|
+
}), t = Ye.on("docChange", () => {
|
|
4401
4401
|
T.value++, un.recomputeHeadingsIfOpen();
|
|
4402
|
-
}), n =
|
|
4402
|
+
}), n = Ye.on("layoutComplete", () => {
|
|
4403
4403
|
T.value++;
|
|
4404
|
-
}), r = qt.install(), i =
|
|
4404
|
+
}), r = qt.install(), i = st(() => o.onFontsLoaded?.());
|
|
4405
4405
|
z(() => {
|
|
4406
4406
|
e(), t(), n(), r(), i();
|
|
4407
4407
|
});
|
|
4408
4408
|
});
|
|
4409
|
-
let { exposed: rr } =
|
|
4410
|
-
editor:
|
|
4409
|
+
let { exposed: rr } = yo({
|
|
4410
|
+
editor: Ye,
|
|
4411
4411
|
editorView: J,
|
|
4412
4412
|
isDirty: mt,
|
|
4413
4413
|
commentsDirty: Q.commentsDirty,
|
|
@@ -4455,7 +4455,7 @@ var Jo = (e) => {
|
|
|
4455
4455
|
]),
|
|
4456
4456
|
style: R(e.style)
|
|
4457
4457
|
}, [
|
|
4458
|
-
P("div",
|
|
4458
|
+
P("div", Qo, [F(Ui, {
|
|
4459
4459
|
"show-table-insert": o.showTableInsert !== !1,
|
|
4460
4460
|
onRename: n[0] ||= (e) => c("rename", e),
|
|
4461
4461
|
onMenuAction: Yn,
|
|
@@ -4472,7 +4472,7 @@ var Jo = (e) => {
|
|
|
4472
4472
|
"zoom-percent": G(je),
|
|
4473
4473
|
"is-min-zoom": G(U),
|
|
4474
4474
|
"is-max-zoom": G(Pe),
|
|
4475
|
-
"zoom-presets": G(
|
|
4475
|
+
"zoom-presets": G(Ge),
|
|
4476
4476
|
"show-zoom-control": e.showZoomControl,
|
|
4477
4477
|
"editor-mode": d.value,
|
|
4478
4478
|
"show-review-controls": p.value,
|
|
@@ -4480,7 +4480,7 @@ var Jo = (e) => {
|
|
|
4480
4480
|
"display-mode": h.value,
|
|
4481
4481
|
"read-only": f.value,
|
|
4482
4482
|
"comments-sidebar-open": A.value,
|
|
4483
|
-
"image-context": G(
|
|
4483
|
+
"image-context": G(Z),
|
|
4484
4484
|
theme: e.theme ?? null
|
|
4485
4485
|
}, En.value, {
|
|
4486
4486
|
onFindReplace: n[2] ||= (e) => E.value = !0,
|
|
@@ -4490,7 +4490,7 @@ var Jo = (e) => {
|
|
|
4490
4490
|
onPageSetup: n[5] ||= (e) => be.value = !0,
|
|
4491
4491
|
onToggleOutline: G(un).handleToggleOutline,
|
|
4492
4492
|
onApplyStyle: G(An),
|
|
4493
|
-
onZoomIn: G(
|
|
4493
|
+
onZoomIn: G(Be),
|
|
4494
4494
|
onZoomOut: G(He),
|
|
4495
4495
|
onZoomSet: G(ze),
|
|
4496
4496
|
onToggleSidebar: n[6] ||= (e) => A.value = !A.value,
|
|
@@ -4546,7 +4546,7 @@ var Jo = (e) => {
|
|
|
4546
4546
|
"onImageWrapType",
|
|
4547
4547
|
"onImageTransform"
|
|
4548
4548
|
])) : M("", !0)]),
|
|
4549
|
-
F(
|
|
4549
|
+
F(Ri, {
|
|
4550
4550
|
"show-find-replace": E.value,
|
|
4551
4551
|
"onUpdate:showFindReplace": n[8] ||= (e) => E.value = e,
|
|
4552
4552
|
"show-hyperlink": _e.value,
|
|
@@ -4565,12 +4565,12 @@ var Jo = (e) => {
|
|
|
4565
4565
|
"scroll-visible-position-into-view": G($t),
|
|
4566
4566
|
bookmarks: De.value,
|
|
4567
4567
|
"current-watermark": wn.value,
|
|
4568
|
-
"selected-image-pm-pos": G(
|
|
4568
|
+
"selected-image-pm-pos": G(Pt)?.pmPos ?? null,
|
|
4569
4569
|
"section-properties": Cn.value,
|
|
4570
4570
|
"table-properties": Tn.value,
|
|
4571
4571
|
onInsertSymbol: G(jn),
|
|
4572
4572
|
onHyperlinkSubmit: G(Bt),
|
|
4573
|
-
onHyperlinkRemove: G(
|
|
4573
|
+
onHyperlinkRemove: G(Vt),
|
|
4574
4574
|
onPageSetupApply: G(Rn),
|
|
4575
4575
|
onTablePropertiesApply: Qn,
|
|
4576
4576
|
onWatermarkApply: Xn
|
|
@@ -4594,10 +4594,10 @@ var Jo = (e) => {
|
|
|
4594
4594
|
"onHyperlinkRemove",
|
|
4595
4595
|
"onPageSetupApply"
|
|
4596
4596
|
]),
|
|
4597
|
-
G(ht) ? (V(), N("div",
|
|
4597
|
+
G(ht) ? (V(), N("div", $o, W(G(ht)), 1)) : Mt.value ? (V(), N("div", es, [Me(t.$slots, "loading-indicator", {}, () => [e.loadingIndicator ? (V(), j(re, {
|
|
4598
4598
|
key: 0,
|
|
4599
4599
|
node: e.loadingIndicator
|
|
4600
|
-
}, null, 8, ["node"])) : (V(), N(D, { key: 1 }, [Te(W(G(te)("loadingDocument")), 1)], 64))], !0)])) : !G(pt) && !ae.value ? (V(), N("div",
|
|
4600
|
+
}, null, 8, ["node"])) : (V(), N(D, { key: 1 }, [Te(W(G(te)("loadingDocument")), 1)], 64))], !0)])) : !G(pt) && !ae.value ? (V(), N("div", ts, [Me(t.$slots, "placeholder", {}, () => [e.placeholder ? (V(), j(re, {
|
|
4601
4601
|
key: 0,
|
|
4602
4602
|
node: e.placeholder
|
|
4603
4603
|
}, null, 8, ["node"])) : (V(), N(D, { key: 1 }, [Te("No document loaded")], 64))], !0)])) : M("", !0),
|
|
@@ -4616,8 +4616,8 @@ var Jo = (e) => {
|
|
|
4616
4616
|
ref: me,
|
|
4617
4617
|
class: "docx-editor-vue__editor-scroll",
|
|
4618
4618
|
onScroll: tr
|
|
4619
|
-
}, [P("div",
|
|
4620
|
-
ge.value && !f.value ? (V(), N("div",
|
|
4619
|
+
}, [P("div", ns, [
|
|
4620
|
+
ge.value && !f.value ? (V(), N("div", rs, [F(ne, {
|
|
4621
4621
|
"section-props": Cn.value,
|
|
4622
4622
|
zoom: G(B),
|
|
4623
4623
|
unit: e.rulerUnit ?? "inch",
|
|
@@ -4651,7 +4651,7 @@ var Jo = (e) => {
|
|
|
4651
4651
|
"onFirstLineIndentChange",
|
|
4652
4652
|
"onTabStopRemove"
|
|
4653
4653
|
])])) : M("", !0),
|
|
4654
|
-
ge.value && !f.value ? (V(), N("div",
|
|
4654
|
+
ge.value && !f.value ? (V(), N("div", is, [F(v, {
|
|
4655
4655
|
"section-props": Cn.value,
|
|
4656
4656
|
zoom: G(B),
|
|
4657
4657
|
unit: e.rulerUnit ?? "inch",
|
|
@@ -4670,21 +4670,21 @@ var Jo = (e) => {
|
|
|
4670
4670
|
ref_key: "pagesViewportRef",
|
|
4671
4671
|
ref: pe,
|
|
4672
4672
|
class: "docx-editor-vue__pages-viewport",
|
|
4673
|
-
onWheel:
|
|
4673
|
+
onWheel: qe,
|
|
4674
4674
|
onMousedown: n[25] ||= (...e) => G(en) && G(en)(...e),
|
|
4675
4675
|
onMousemove: n[26] ||= (...e) => G(tn) && G(tn)(...e),
|
|
4676
4676
|
onClick: n[27] ||= (...e) => G(nn) && G(nn)(...e),
|
|
4677
4677
|
onDblclick: n[28] ||= (...e) => G(rn) && G(rn)(...e),
|
|
4678
4678
|
onContextmenu: n[29] ||= q((...e) => G(hn) && G(hn)(...e), ["prevent"])
|
|
4679
4679
|
}, [
|
|
4680
|
-
P("div",
|
|
4680
|
+
P("div", as, [
|
|
4681
4681
|
P("div", {
|
|
4682
4682
|
ref_key: "pagesRef",
|
|
4683
4683
|
ref: w,
|
|
4684
4684
|
class: L(["docx-editor-vue__pages paged-editor__pages", G(Yt) ? `paged-editor--hf-editing paged-editor--editing-${G(Yt).position}` : ""]),
|
|
4685
4685
|
style: R(kn.value)
|
|
4686
4686
|
}, null, 6),
|
|
4687
|
-
F(
|
|
4687
|
+
F(Ta, {
|
|
4688
4688
|
"editor-view": cn(),
|
|
4689
4689
|
"hidden-container": ue.value,
|
|
4690
4690
|
"pages-container": w.value,
|
|
@@ -4697,11 +4697,11 @@ var Jo = (e) => {
|
|
|
4697
4697
|
"selection",
|
|
4698
4698
|
"zoom"
|
|
4699
4699
|
]),
|
|
4700
|
-
P("div",
|
|
4701
|
-
F(
|
|
4700
|
+
P("div", os, [
|
|
4701
|
+
F(yi, {
|
|
4702
4702
|
"get-view": () => G(J),
|
|
4703
4703
|
"get-pages-container": () => w.value,
|
|
4704
|
-
"editor-state": G(
|
|
4704
|
+
"editor-state": G(Qe),
|
|
4705
4705
|
zoom: G(B),
|
|
4706
4706
|
layout: G(gt),
|
|
4707
4707
|
blocks: G(_t),
|
|
@@ -4721,7 +4721,7 @@ var Jo = (e) => {
|
|
|
4721
4721
|
"selected-canonical",
|
|
4722
4722
|
"selection-seq"
|
|
4723
4723
|
]),
|
|
4724
|
-
F(
|
|
4724
|
+
F(xi, {
|
|
4725
4725
|
range: he.value,
|
|
4726
4726
|
"get-pages-container": () => w.value,
|
|
4727
4727
|
zoom: G(B),
|
|
@@ -4736,11 +4736,11 @@ var Jo = (e) => {
|
|
|
4736
4736
|
"blocks",
|
|
4737
4737
|
"measures"
|
|
4738
4738
|
]),
|
|
4739
|
-
o.showTemplateDirectives ? (V(), j(
|
|
4739
|
+
o.showTemplateDirectives ? (V(), j(Ra, {
|
|
4740
4740
|
key: 0,
|
|
4741
4741
|
"get-view": () => G(J),
|
|
4742
4742
|
"get-pages-container": () => w.value,
|
|
4743
|
-
"editor-state": G(
|
|
4743
|
+
"editor-state": G(Qe),
|
|
4744
4744
|
zoom: G(B),
|
|
4745
4745
|
layout: G(gt),
|
|
4746
4746
|
blocks: G(_t),
|
|
@@ -4754,9 +4754,9 @@ var Jo = (e) => {
|
|
|
4754
4754
|
"blocks",
|
|
4755
4755
|
"measures"
|
|
4756
4756
|
])) : M("", !0),
|
|
4757
|
-
F(
|
|
4757
|
+
F(Ti, {
|
|
4758
4758
|
"get-pages-container": () => w.value,
|
|
4759
|
-
"editor-state": G(
|
|
4759
|
+
"editor-state": G(Qe),
|
|
4760
4760
|
zoom: G(B),
|
|
4761
4761
|
"sync-coordinator": G(yt)
|
|
4762
4762
|
}, null, 8, [
|
|
@@ -4765,7 +4765,7 @@ var Jo = (e) => {
|
|
|
4765
4765
|
"zoom",
|
|
4766
4766
|
"sync-coordinator"
|
|
4767
4767
|
]),
|
|
4768
|
-
F(
|
|
4768
|
+
F(Ni, {
|
|
4769
4769
|
"get-view": () => G(J),
|
|
4770
4770
|
"get-pages-container": () => w.value,
|
|
4771
4771
|
zoom: G(B),
|
|
@@ -4780,7 +4780,7 @@ var Jo = (e) => {
|
|
|
4780
4780
|
])
|
|
4781
4781
|
])
|
|
4782
4782
|
]),
|
|
4783
|
-
G(Yt) ? (V(), j(
|
|
4783
|
+
G(Yt) ? (V(), j(Da, {
|
|
4784
4784
|
key: 0,
|
|
4785
4785
|
edit: G(Yt),
|
|
4786
4786
|
"get-view": cn,
|
|
@@ -4795,22 +4795,22 @@ var Jo = (e) => {
|
|
|
4795
4795
|
class: "docx-editor-vue__note-editor",
|
|
4796
4796
|
"aria-label": jt.value,
|
|
4797
4797
|
onKeydown: n[16] ||= Re(q((...e) => G(Dt) && G(Dt)(...e), ["stop", "prevent"]), ["esc"])
|
|
4798
|
-
}, [P("header",
|
|
4798
|
+
}, [P("header", cs, [P("span", null, W(jt.value), 1), P("button", {
|
|
4799
4799
|
type: "button",
|
|
4800
4800
|
"aria-label": G(te)("common.closeDialog"),
|
|
4801
4801
|
onClick: n[15] ||= (...e) => G(Dt) && G(Dt)(...e)
|
|
4802
|
-
}, " × ", 8,
|
|
4802
|
+
}, " × ", 8, ls)]), P("div", {
|
|
4803
4803
|
ref_key: "notePmRef",
|
|
4804
4804
|
ref: Ee,
|
|
4805
4805
|
class: "docx-editor-vue__note-editor-host"
|
|
4806
|
-
}, null, 512)], 40,
|
|
4807
|
-
F(
|
|
4808
|
-
"image-info": G(
|
|
4806
|
+
}, null, 512)], 40, ss), [[Fe, G(dt)]]),
|
|
4807
|
+
F(wa, {
|
|
4808
|
+
"image-info": G(Pt),
|
|
4809
4809
|
zoom: G(B),
|
|
4810
4810
|
view: X.value,
|
|
4811
|
-
onDeselect: n[17] ||= (e) =>
|
|
4812
|
-
onInteractStart: n[18] ||= (e) =>
|
|
4813
|
-
onInteractEnd: n[19] ||= (e) =>
|
|
4811
|
+
onDeselect: n[17] ||= (e) => Pt.value = null,
|
|
4812
|
+
onInteractStart: n[18] ||= (e) => Ft.value = !0,
|
|
4813
|
+
onInteractEnd: n[19] ||= (e) => Ft.value = !1,
|
|
4814
4814
|
onContextMenu: G(gn)
|
|
4815
4815
|
}, null, 8, [
|
|
4816
4816
|
"image-info",
|
|
@@ -4818,10 +4818,10 @@ var Jo = (e) => {
|
|
|
4818
4818
|
"view",
|
|
4819
4819
|
"onContextMenu"
|
|
4820
4820
|
]),
|
|
4821
|
-
F(
|
|
4821
|
+
F(Ja, {
|
|
4822
4822
|
data: G(zt),
|
|
4823
4823
|
"read-only": f.value,
|
|
4824
|
-
onNavigate: G(
|
|
4824
|
+
onNavigate: G(Ht),
|
|
4825
4825
|
onCopy: Sn,
|
|
4826
4826
|
onEdit: G(Gt),
|
|
4827
4827
|
onRemove: G(Kt),
|
|
@@ -4843,7 +4843,7 @@ var Jo = (e) => {
|
|
|
4843
4843
|
}),
|
|
4844
4844
|
"aria-label": G(Jt).type === "row" ? "Insert row" : "Insert column",
|
|
4845
4845
|
onMousedown: n[21] ||= (...e) => G(an) && G(an)(...e)
|
|
4846
|
-
}, " + ", 44,
|
|
4846
|
+
}, " + ", 44, us)) : M("", !0),
|
|
4847
4847
|
F(g, {
|
|
4848
4848
|
comments: G(xn),
|
|
4849
4849
|
"pages-container": w.value,
|
|
@@ -4922,12 +4922,12 @@ var Jo = (e) => {
|
|
|
4922
4922
|
size: 18
|
|
4923
4923
|
})], 36)) : M("", !0)
|
|
4924
4924
|
], 544),
|
|
4925
|
-
O.value ? M("", !0) : (V(), j(
|
|
4925
|
+
O.value ? M("", !0) : (V(), j(ka, {
|
|
4926
4926
|
key: 2,
|
|
4927
4927
|
"left-offset": 12,
|
|
4928
4928
|
onToggle: G(un).handleToggleOutline
|
|
4929
4929
|
}, null, 8, ["onToggle"])),
|
|
4930
|
-
G(Xt).totalPages > 1 ? (V(), j(
|
|
4930
|
+
G(Xt).totalPages > 1 ? (V(), j(Aa, {
|
|
4931
4931
|
key: 3,
|
|
4932
4932
|
"current-page": G(Xt).currentPage,
|
|
4933
4933
|
"total-pages": G(Xt).totalPages,
|
|
@@ -4937,7 +4937,7 @@ var Jo = (e) => {
|
|
|
4937
4937
|
"total-pages",
|
|
4938
4938
|
"visible"
|
|
4939
4939
|
])) : M("", !0),
|
|
4940
|
-
F(
|
|
4940
|
+
F(Li, {
|
|
4941
4941
|
"is-open": O.value,
|
|
4942
4942
|
headings: ke.value,
|
|
4943
4943
|
"get-scroll-container": () => w.value,
|
|
@@ -4950,13 +4950,13 @@ var Jo = (e) => {
|
|
|
4950
4950
|
"onNavigate"
|
|
4951
4951
|
])
|
|
4952
4952
|
])], 544),
|
|
4953
|
-
F(
|
|
4953
|
+
F(ma, {
|
|
4954
4954
|
"read-only": f.value,
|
|
4955
4955
|
"context-menu": G(dn),
|
|
4956
4956
|
"image-context-menu": G(fn),
|
|
4957
4957
|
"image-context-menu-text-actions": G(pn),
|
|
4958
4958
|
"custom-text-menu-items": G(mn),
|
|
4959
|
-
"can-open-image-properties": G(
|
|
4959
|
+
"can-open-image-properties": G(Pt) !== null,
|
|
4960
4960
|
onContextMenuAction: G(vn),
|
|
4961
4961
|
onCloseContextMenu: n[31] ||= (e) => G(dn).isOpen = !1,
|
|
4962
4962
|
onImageWrapSelect: G(_n),
|
|
@@ -4972,48 +4972,44 @@ var Jo = (e) => {
|
|
|
4972
4972
|
"onContextMenuAction",
|
|
4973
4973
|
"onImageWrapSelect"
|
|
4974
4974
|
]),
|
|
4975
|
-
F(
|
|
4975
|
+
F(Mi, {
|
|
4976
4976
|
"event-root": f.value ? null : w.value,
|
|
4977
4977
|
view: G(J)
|
|
4978
4978
|
}, null, 8, ["event-root", "view"])
|
|
4979
4979
|
], 6));
|
|
4980
4980
|
}
|
|
4981
|
-
}), [["__scopeId", "data-v-
|
|
4981
|
+
}), [["__scopeId", "data-v-35e765f7"]]);
|
|
4982
4982
|
//#endregion
|
|
4983
4983
|
//#region src/utils/listState.ts
|
|
4984
|
-
function
|
|
4985
|
-
return
|
|
4986
|
-
type: "none",
|
|
4987
|
-
level: 0,
|
|
4988
|
-
isInList: !1
|
|
4989
|
-
};
|
|
4984
|
+
function fs() {
|
|
4985
|
+
return ze;
|
|
4990
4986
|
}
|
|
4991
4987
|
//#endregion
|
|
4992
4988
|
//#region src/components/FormattingBar.vue?vue&type=script&setup=true&lang.ts
|
|
4993
|
-
var
|
|
4989
|
+
var ps = ["aria-label"], ms = ["aria-label"], hs = [
|
|
4994
4990
|
"disabled",
|
|
4995
4991
|
"title",
|
|
4996
4992
|
"aria-label"
|
|
4997
|
-
],
|
|
4993
|
+
], gs = [
|
|
4998
4994
|
"disabled",
|
|
4999
4995
|
"title",
|
|
5000
4996
|
"aria-label"
|
|
5001
|
-
],
|
|
4997
|
+
], _s = ["aria-label"], vs = [
|
|
5002
4998
|
"disabled",
|
|
5003
4999
|
"title",
|
|
5004
5000
|
"aria-label",
|
|
5005
5001
|
"aria-pressed"
|
|
5006
|
-
],
|
|
5002
|
+
], ys = [
|
|
5007
5003
|
"disabled",
|
|
5008
5004
|
"title",
|
|
5009
5005
|
"aria-label",
|
|
5010
5006
|
"aria-pressed"
|
|
5011
|
-
],
|
|
5007
|
+
], bs = [
|
|
5012
5008
|
"disabled",
|
|
5013
5009
|
"title",
|
|
5014
5010
|
"aria-label",
|
|
5015
5011
|
"aria-pressed"
|
|
5016
|
-
],
|
|
5012
|
+
], xs = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
5017
5013
|
__name: "FormattingBar",
|
|
5018
5014
|
props: {
|
|
5019
5015
|
currentFormatting: {},
|
|
@@ -5055,13 +5051,10 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5055
5051
|
"redo"
|
|
5056
5052
|
],
|
|
5057
5053
|
setup(e, { emit: t }) {
|
|
5058
|
-
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 ??
|
|
5054
|
+
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 ?? fs()), d = k(() => {
|
|
5059
5055
|
let e = c.value.color;
|
|
5060
5056
|
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
5061
|
-
}), f = k(() =>
|
|
5062
|
-
let e = u.value;
|
|
5063
|
-
return e.isInList && e.level > 0 || (c.value.indentLeft ?? 0) > 0;
|
|
5064
|
-
});
|
|
5057
|
+
}), f = k(() => Qe(u.value) > 0 || (c.value.indentLeft ?? 0) > 0);
|
|
5065
5058
|
function p(e) {
|
|
5066
5059
|
o("format", {
|
|
5067
5060
|
type: "textColor",
|
|
@@ -5088,7 +5081,7 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5088
5081
|
}, [F(i, {
|
|
5089
5082
|
name: "undo",
|
|
5090
5083
|
size: 18
|
|
5091
|
-
})], 40,
|
|
5084
|
+
})], 40, hs), P("button", {
|
|
5092
5085
|
type: "button",
|
|
5093
5086
|
class: "docx-formatting-bar__btn",
|
|
5094
5087
|
disabled: e.disabled || !e.canRedo,
|
|
@@ -5098,7 +5091,7 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5098
5091
|
}, [F(i, {
|
|
5099
5092
|
name: "redo",
|
|
5100
5093
|
size: 18
|
|
5101
|
-
})], 40,
|
|
5094
|
+
})], 40, gs)], 8, ms),
|
|
5102
5095
|
r[13] ||= P("span", {
|
|
5103
5096
|
class: "docx-formatting-bar__divider",
|
|
5104
5097
|
role: "separator"
|
|
@@ -5129,7 +5122,7 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5129
5122
|
}, [F(i, {
|
|
5130
5123
|
name: "format_bold",
|
|
5131
5124
|
size: 18
|
|
5132
|
-
})], 42,
|
|
5125
|
+
})], 42, vs),
|
|
5133
5126
|
P("button", {
|
|
5134
5127
|
type: "button",
|
|
5135
5128
|
class: L(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.italic }]),
|
|
@@ -5141,7 +5134,7 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5141
5134
|
}, [F(i, {
|
|
5142
5135
|
name: "format_italic",
|
|
5143
5136
|
size: 18
|
|
5144
|
-
})], 42,
|
|
5137
|
+
})], 42, ys),
|
|
5145
5138
|
P("button", {
|
|
5146
5139
|
type: "button",
|
|
5147
5140
|
class: L(["docx-formatting-bar__btn", { "docx-formatting-bar__btn--active": c.value.underline }]),
|
|
@@ -5153,8 +5146,8 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5153
5146
|
}, [F(i, {
|
|
5154
5147
|
name: "format_underlined",
|
|
5155
5148
|
size: 18
|
|
5156
|
-
})], 42,
|
|
5157
|
-
], 8,
|
|
5149
|
+
})], 42, bs)
|
|
5150
|
+
], 8, _s),
|
|
5158
5151
|
e.showTextColorPicker ? (V(), N(D, { key: 1 }, [r[12] ||= P("span", {
|
|
5159
5152
|
class: "docx-formatting-bar__divider",
|
|
5160
5153
|
role: "separator"
|
|
@@ -5196,9 +5189,9 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5196
5189
|
"disabled",
|
|
5197
5190
|
"can-outdent"
|
|
5198
5191
|
])) : M("", !0)
|
|
5199
|
-
], 10,
|
|
5192
|
+
], 10, ps));
|
|
5200
5193
|
}
|
|
5201
|
-
}), [["__scopeId", "data-v-
|
|
5194
|
+
}), [["__scopeId", "data-v-d8fef805"]]), Ss = [
|
|
5202
5195
|
{
|
|
5203
5196
|
value: .5,
|
|
5204
5197
|
label: "50%"
|
|
@@ -5223,7 +5216,7 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5223
5216
|
value: 2,
|
|
5224
5217
|
label: "200%"
|
|
5225
5218
|
}
|
|
5226
|
-
],
|
|
5219
|
+
], Cs = /*#__PURE__*/ t(/* @__PURE__ */ I({
|
|
5227
5220
|
__name: "ZoomControl",
|
|
5228
5221
|
props: {
|
|
5229
5222
|
value: { default: 1 },
|
|
@@ -5240,7 +5233,7 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5240
5233
|
},
|
|
5241
5234
|
emits: ["change"],
|
|
5242
5235
|
setup(e, { emit: t }) {
|
|
5243
|
-
let { Select: n } = h(), r = e, i = t, a = k(() => r.levels ??
|
|
5236
|
+
let { Select: n } = h(), r = e, i = t, a = k(() => r.levels ?? Ss), 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(() => {
|
|
5244
5237
|
let e = a.value.map((e) => ({
|
|
5245
5238
|
value: String(e.value),
|
|
5246
5239
|
label: e.label
|
|
@@ -5268,7 +5261,7 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5268
5261
|
"disabled"
|
|
5269
5262
|
]));
|
|
5270
5263
|
}
|
|
5271
|
-
}), [["__scopeId", "data-v-8079e07f"]]),
|
|
5264
|
+
}), [["__scopeId", "data-v-8079e07f"]]), ws = (e, t, n = {}) => {
|
|
5272
5265
|
let { colorMode: r = oe, locale: i = "en", ...a } = n;
|
|
5273
5266
|
return new Promise((n, o) => {
|
|
5274
5267
|
let s = H(null), c = null, l = !1, d = {
|
|
@@ -5294,7 +5287,7 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5294
5287
|
}
|
|
5295
5288
|
};
|
|
5296
5289
|
c = A({ setup() {
|
|
5297
|
-
return () => Ee(
|
|
5290
|
+
return () => Ee(ds, {
|
|
5298
5291
|
...a,
|
|
5299
5292
|
documentBuffer: e,
|
|
5300
5293
|
ref: s,
|
|
@@ -5309,4 +5302,4 @@ var ds = ["aria-label"], fs = ["aria-label"], ps = [
|
|
|
5309
5302
|
});
|
|
5310
5303
|
};
|
|
5311
5304
|
//#endregion
|
|
5312
|
-
export {
|
|
5305
|
+
export { Ci as AutocompleteCaretOverlay, ni as DEFAULT_AI_SUGGESTION_PRESETS, St as DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, $r as DOCUMENT_PRESET_VERSION, ei as DOCUMENT_STYLE_SET_VERSION, ds as DocxEditor, w as FindReplaceDialog, l as FolioUIProvider, pe as FootnotePropertiesDialog, xs 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, Xr as STELLA_STYLE_SET_NAME, be as SplitCellDialog, xe as TablePropertiesDialog, Se as WatermarkDialog, Cs as ZoomControl, Y as acceptAutocompleteSuggestion, Ct as acceptAutocompleteWord, _t as anonymizationDecorationsKey, wt as appendAutocompleteToken, Vn as applyFolioAIEditOperations, ri as applySuggestions, Tt as autocompleteSuggestionKey, Et as autocompleteSuggestionPlugin, oi as buildPositionalText, Dt as clearAutocompleteSuggestion, An as clearTemplateSlashMenu, ue as colorModePlugin, jn as consumeTemplateSlashQuery, fi as createAICitationDecorationsPlugin, ti as createDocx, Gr as createEmptyDocument, Gn as createFolioAIEditSnapshot, Zr as createStellaStyleDocumentPreset, Qr as createStellaStyleSet, oe as defaultColorMode, e as defaultLocale, hr as deriveBlockId, Jn as diffWordSegments, Kr as extractDocumentStyleSet, qr as extractDocumentStyleSetFromDocx, Ot as finishAutocompleteSuggestion, hi as fromMarkdown, vt as getAnonymizationMatches, kt as getAutocompleteSuggestion, lt as getDocumentWatermark, ui as getFolioCaretViewportRect, gr as getFolioParaIdFromBlockId, di as getFolioSelectionViewportRect, an as getTemplateDirectives, Mn as getTemplateSlashMenu, Qn as hashFolioAIBlockText, u as i18nPlugin, Ge as insertImageFromFile, qe as insertPageBreakInView, Ye as insertTableInView, J as insertTableOfContentsInView, Jr as inspectDocumentStyles, Yr as inspectDocumentStylesFromDocx, vr as isFolioBlockId, yr as isSequentialFolioBlockId, ii as isSuggestionStale, $n as normalizeFolioAIBlockText, C as provideColorMode, n as provideLocale, ws as renderAsync, Nn as resetTemplateSlashQuery, ai as resolveSuggestionAnchor, sn as scanDirectives, li as scrollFolioPositionIntoView, pi as setAICitationsMeta, si as setAISuggestionsMeta, mi as setActiveCitationMeta, bt as setAnonymizationTermsMeta, dt as setDocumentWatermark, ci as setFocusedSuggestionMeta, kn as setTemplatePreviewValues, X as shouldTriggerAutocomplete, jt as startAutocompleteSuggestion, Pn as templateSlashMenuKey, gi as toMarkdown, _i as toMarkdownResult, fe as useColorMode, r as useTranslation, de as useWheelZoom };
|