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