@harbour-enterprises/superdoc 1.0.0-beta.4 → 1.0.0-beta.40
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/chunks/{PdfViewer-DUns3s8O.es.js → PdfViewer-B5MRM8r_.es.js} +2 -2
- package/dist/chunks/{PdfViewer-ZtwLhE_8.cjs → PdfViewer-IpSRU3o0.cjs} +2 -2
- package/dist/chunks/{eventemitter3-ByBH0NYV.es.js → eventemitter3-CcXAdeql.es.js} +1 -1
- package/dist/chunks/{eventemitter3-CFCpOk3d.cjs → eventemitter3-DQmQUge-.cjs} +1 -1
- package/dist/chunks/{index-BW38mdZF.cjs → index-B9PZ8RCF.cjs} +112 -41
- package/dist/chunks/{index-DIccWgYh.es.js → index-CJeY9b_E.es.js} +112 -41
- package/dist/chunks/{index-BNGaD3Up-D2cRHMMk.cjs → index-Dx9W6Dsv-D4FIlgW4.cjs} +1 -1
- package/dist/chunks/{index-BNGaD3Up-CQuoo1EF.es.js → index-Dx9W6Dsv-DbYj9Ur7.es.js} +1 -1
- package/dist/chunks/{jszip-BwsONqK5.es.js → jszip-5vvIqAEE.es.js} +1 -1
- package/dist/chunks/{jszip-B99MTu59.cjs → jszip-BdEez1WM.cjs} +1 -1
- package/dist/chunks/{super-editor.es-C06-V-Iy.cjs → super-editor.es-C7wUYMFI.cjs} +42697 -25662
- package/dist/chunks/{super-editor.es-CtCHBIPE.es.js → super-editor.es-CGmPt3mY.es.js} +42697 -25662
- package/dist/chunks/{vue-CztqUvm1.es.js → vue-Dysv_7z5.es.js} +101 -12
- package/dist/chunks/{vue-ARQSyfaw.cjs → vue-jWLMl8Ts.cjs} +89 -0
- package/dist/chunks/xml-js-ClO_jHnq.es.js +2 -0
- package/dist/chunks/xml-js-Dz51sEbr.cjs +3 -0
- package/dist/packages/superdoc/src/components/CommentsLayer/use-comment.d.ts.map +1 -1
- package/dist/packages/superdoc/src/composables/use-document.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts +2 -2
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/collaboration/collaboration.d.ts +11 -0
- package/dist/packages/superdoc/src/core/collaboration/collaboration.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/types/index.d.ts +66 -3
- package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
- package/dist/packages/superdoc/src/stores/comments-store.d.ts.map +1 -1
- package/dist/style.css +99 -60
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-ZJiSHoiq.js → converter-D6IUdu7s.js} +7090 -781
- package/dist/super-editor/chunks/{docx-zipper-B7FStorN.js → docx-zipper-C1WNNxUr.js} +1 -1
- package/dist/super-editor/chunks/{editor-DvepAjbe.js → editor-DNmem5Gg.js} +19149 -8883
- package/dist/super-editor/chunks/{index-BNGaD3Up.js → index-Dx9W6Dsv.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-CKXXbIQO.js → toolbar-CHc2RUXU.js} +39 -24
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +2 -2
- package/dist/super-editor/style.css +66 -27
- package/dist/super-editor/super-editor.es.js +1040 -235
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +4 -4
- package/dist/super-editor.es.js +2 -2
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +38013 -20831
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/xml-js-BZPSMmVo.es.js +0 -2
- package/dist/chunks/xml-js-DQa4Ye5C.cjs +0 -3
|
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
11
11
|
var _MARK_TOGGLE_NAMES, _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn, syncStickyMarksFromState_fn, restoreStickyMarksIfNeeded_fn, ensureStoredMarksForMarkToggle_fn;
|
|
12
|
-
import {
|
|
13
|
-
import { ac, i, a9 } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as getEditorSurfaceElement, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as measureCache, n as isHeadless, E as Editor, o as getStarterExtensions, P as PresentationEditor, p as Placeholder, q as getRichTextExtensions, D as DecorationSet, t as Decoration, M as Mark, v as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { z, F, B, T, w, C, x } from "./chunks/editor-
|
|
16
|
-
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, defineComponent, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-
|
|
12
|
+
import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, ar as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, al as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-D6IUdu7s.js";
|
|
13
|
+
import { ac, i, a9, aQ } from "./chunks/converter-D6IUdu7s.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as getEditorSurfaceElement, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as measureCache, n as isHeadless, E as Editor, o as getStarterExtensions, P as PresentationEditor, p as Placeholder, q as getRichTextExtensions, D as DecorationSet, t as Decoration, M as Mark, v as Extension, A as Attribute, N as Node } from "./chunks/editor-DNmem5Gg.js";
|
|
15
|
+
import { z, F, B, T, w, C, x } from "./chunks/editor-DNmem5Gg.js";
|
|
16
|
+
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, defineComponent, reactive, onUnmounted, renderSlot, useCssVars, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-CHc2RUXU.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-C1WNNxUr.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
|
@@ -311,8 +311,8 @@ const useToolbarItem = (options) => {
|
|
|
311
311
|
onDeactivate
|
|
312
312
|
};
|
|
313
313
|
};
|
|
314
|
-
const _hoisted_1$
|
|
315
|
-
const _sfc_main$
|
|
314
|
+
const _hoisted_1$f = ["onClick", "innerHTML", "aria-label", "onKeydown"];
|
|
315
|
+
const _sfc_main$h = {
|
|
316
316
|
__name: "AlignmentButtons",
|
|
317
317
|
emits: ["select"],
|
|
318
318
|
setup(__props, { emit: __emit }) {
|
|
@@ -397,20 +397,20 @@ const _sfc_main$f = {
|
|
|
397
397
|
ref_key: "alignmentButtonsRefs",
|
|
398
398
|
ref: alignmentButtonsRefs,
|
|
399
399
|
onKeydown: withModifiers((event) => handleKeyDown(event, index), ["prevent"])
|
|
400
|
-
}, null, 40, _hoisted_1$
|
|
400
|
+
}, null, 40, _hoisted_1$f);
|
|
401
401
|
}), 64))
|
|
402
402
|
], 2);
|
|
403
403
|
};
|
|
404
404
|
}
|
|
405
405
|
};
|
|
406
|
-
const AlignmentButtons = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
407
|
-
const _hoisted_1$
|
|
406
|
+
const AlignmentButtons = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-d84f57b6"]]);
|
|
407
|
+
const _hoisted_1$e = ["onClick", "onKeydown"];
|
|
408
408
|
const _hoisted_2$9 = { class: "document-mode-column icon-column" };
|
|
409
409
|
const _hoisted_3$7 = ["innerHTML"];
|
|
410
410
|
const _hoisted_4$3 = { class: "document-mode-column text-column" };
|
|
411
411
|
const _hoisted_5$2 = { class: "document-mode-type" };
|
|
412
412
|
const _hoisted_6$1 = { class: "document-mode-description" };
|
|
413
|
-
const _sfc_main$
|
|
413
|
+
const _sfc_main$g = {
|
|
414
414
|
__name: "DocumentMode",
|
|
415
415
|
props: {
|
|
416
416
|
options: {
|
|
@@ -484,19 +484,20 @@ const _sfc_main$e = {
|
|
|
484
484
|
createElementVNode("div", _hoisted_5$2, toDisplayString(option.label), 1),
|
|
485
485
|
createElementVNode("div", _hoisted_6$1, toDisplayString(option.description), 1)
|
|
486
486
|
])
|
|
487
|
-
], 42, _hoisted_1$
|
|
487
|
+
], 42, _hoisted_1$e);
|
|
488
488
|
}), 256))
|
|
489
489
|
], 2);
|
|
490
490
|
};
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
const DocumentMode = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
494
|
-
const _hoisted_1$
|
|
493
|
+
const DocumentMode = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-8730b752"]]);
|
|
494
|
+
const _hoisted_1$d = {
|
|
495
495
|
key: 0,
|
|
496
|
-
class: "linked-style-buttons"
|
|
496
|
+
class: "linked-style-buttons",
|
|
497
|
+
"data-editor-ui-surface": ""
|
|
497
498
|
};
|
|
498
499
|
const _hoisted_2$8 = ["onClick", "onKeydown", "aria-label"];
|
|
499
|
-
const _sfc_main$
|
|
500
|
+
const _sfc_main$f = {
|
|
500
501
|
__name: "LinkedStyle",
|
|
501
502
|
props: {
|
|
502
503
|
editor: {
|
|
@@ -550,7 +551,7 @@ const _sfc_main$d = {
|
|
|
550
551
|
styleRefs.value[0].focus();
|
|
551
552
|
});
|
|
552
553
|
return (_ctx, _cache) => {
|
|
553
|
-
return props.editor ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
554
|
+
return props.editor ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
554
555
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getQuickFormatList)(__props.editor), (style, index) => {
|
|
555
556
|
return openBlock(), createElementBlock("div", {
|
|
556
557
|
class: normalizeClass(["style-item", { selected: __props.selectedOption === style.id }]),
|
|
@@ -572,8 +573,8 @@ const _sfc_main$d = {
|
|
|
572
573
|
};
|
|
573
574
|
}
|
|
574
575
|
};
|
|
575
|
-
const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
576
|
-
const _hoisted_1$
|
|
576
|
+
const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-ecb78965"]]);
|
|
577
|
+
const _hoisted_1$c = {
|
|
577
578
|
key: 0,
|
|
578
579
|
class: "link-title"
|
|
579
580
|
};
|
|
@@ -601,7 +602,7 @@ const _hoisted_13 = {
|
|
|
601
602
|
key: 4,
|
|
602
603
|
class: "input-row go-to-anchor clickable"
|
|
603
604
|
};
|
|
604
|
-
const _sfc_main$
|
|
605
|
+
const _sfc_main$e = {
|
|
605
606
|
__name: "LinkInput",
|
|
606
607
|
props: {
|
|
607
608
|
showInput: {
|
|
@@ -740,7 +741,7 @@ const _sfc_main$c = {
|
|
|
740
741
|
return openBlock(), createElementBlock("div", {
|
|
741
742
|
class: normalizeClass(["link-input-ctn", { "high-contrast": unref(isHighContrastMode) }])
|
|
742
743
|
}, [
|
|
743
|
-
isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
744
|
+
isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_1$c, "Page anchor")) : isEditing.value ? (openBlock(), createElementBlock("div", _hoisted_2$7, "Edit link")) : (openBlock(), createElementBlock("div", _hoisted_3$6, "Add link")),
|
|
744
745
|
__props.showInput && !isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
745
746
|
createElementVNode("div", _hoisted_5$1, [
|
|
746
747
|
_cache[4] || (_cache[4] = createElementVNode("div", { class: "input-icon text-input-icon" }, "T", -1)),
|
|
@@ -807,12 +808,12 @@ const _sfc_main$c = {
|
|
|
807
808
|
};
|
|
808
809
|
}
|
|
809
810
|
};
|
|
810
|
-
const LinkInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
811
|
-
const _hoisted_1$
|
|
811
|
+
const LinkInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-ba50627b"]]);
|
|
812
|
+
const _hoisted_1$b = ["aria-label", "onClick", "onKeydown"];
|
|
812
813
|
const _hoisted_2$6 = ["innerHTML"];
|
|
813
814
|
const _hoisted_3$5 = ["innerHTML"];
|
|
814
815
|
const ROW_SIZE$1 = 7;
|
|
815
|
-
const _sfc_main$
|
|
816
|
+
const _sfc_main$d = {
|
|
816
817
|
__name: "IconGridRow",
|
|
817
818
|
props: {
|
|
818
819
|
icons: {
|
|
@@ -938,19 +939,19 @@ const _sfc_main$b = {
|
|
|
938
939
|
innerHTML: unref(toolbarIcons).colorOptionCheck,
|
|
939
940
|
style: normalizeStyle(getCheckStyle(option.value, optionIndex))
|
|
940
941
|
}, null, 12, _hoisted_3$5)) : createCommentVNode("", true)
|
|
941
|
-
], 40, _hoisted_1$
|
|
942
|
+
], 40, _hoisted_1$b);
|
|
942
943
|
}), 128))
|
|
943
944
|
]);
|
|
944
945
|
}), 128);
|
|
945
946
|
};
|
|
946
947
|
}
|
|
947
948
|
};
|
|
948
|
-
const IconGridRow = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
949
|
+
const IconGridRow = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-0f479b6c"]]);
|
|
949
950
|
const DropIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.2 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0l-1.8 0c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"/></svg>\n';
|
|
950
|
-
const _hoisted_1$
|
|
951
|
+
const _hoisted_1$a = { class: "options-grid-wrap" };
|
|
951
952
|
const _hoisted_2$5 = ["innerHTML"];
|
|
952
953
|
const _hoisted_3$4 = { class: "option-grid-ctn" };
|
|
953
|
-
const _sfc_main$
|
|
954
|
+
const _sfc_main$c = {
|
|
954
955
|
__name: "IconGrid",
|
|
955
956
|
props: {
|
|
956
957
|
icons: {
|
|
@@ -977,7 +978,7 @@ const _sfc_main$a = {
|
|
|
977
978
|
emit("select", option);
|
|
978
979
|
};
|
|
979
980
|
return (_ctx, _cache) => {
|
|
980
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
981
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
981
982
|
__props.hasNoneIcon ? (openBlock(), createElementBlock("div", {
|
|
982
983
|
key: 0,
|
|
983
984
|
class: "none-option",
|
|
@@ -1010,7 +1011,7 @@ const _sfc_main$a = {
|
|
|
1010
1011
|
};
|
|
1011
1012
|
}
|
|
1012
1013
|
};
|
|
1013
|
-
const IconGrid = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1014
|
+
const IconGrid = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-3d19fedf"]]);
|
|
1014
1015
|
const closeDropdown$1 = (dropdown) => {
|
|
1015
1016
|
dropdown.expand.value = false;
|
|
1016
1017
|
};
|
|
@@ -1119,10 +1120,10 @@ const icons = [
|
|
|
1119
1120
|
const getAvailableColorOptions = () => {
|
|
1120
1121
|
return icons.flat().map((item) => item.value);
|
|
1121
1122
|
};
|
|
1122
|
-
const _hoisted_1$
|
|
1123
|
+
const _hoisted_1$9 = ["data-cols", "data-rows", "onKeydown", "onClick"];
|
|
1123
1124
|
const _hoisted_2$4 = ["aria-valuetext"];
|
|
1124
1125
|
const ROW_SIZE = 5;
|
|
1125
|
-
const _sfc_main$
|
|
1126
|
+
const _sfc_main$b = {
|
|
1126
1127
|
__name: "TableGrid",
|
|
1127
1128
|
emits: ["select", "clickoutside"],
|
|
1128
1129
|
setup(__props, { emit: __emit }) {
|
|
@@ -1238,7 +1239,7 @@ const _sfc_main$9 = {
|
|
|
1238
1239
|
ref: tableGridItems,
|
|
1239
1240
|
onKeydown: withModifiers((event) => handleKeyDown(event, n, i2), ["prevent"]),
|
|
1240
1241
|
onClick: withModifiers(($event) => handleClick({ cols: n, rows: i2 }), ["stop", "prevent"])
|
|
1241
|
-
}, null, 40, _hoisted_1$
|
|
1242
|
+
}, null, 40, _hoisted_1$9);
|
|
1242
1243
|
}), 64))
|
|
1243
1244
|
], 64);
|
|
1244
1245
|
}), 64))
|
|
@@ -1251,13 +1252,13 @@ const _sfc_main$9 = {
|
|
|
1251
1252
|
};
|
|
1252
1253
|
}
|
|
1253
1254
|
};
|
|
1254
|
-
const TableGrid = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1255
|
-
const _hoisted_1$
|
|
1255
|
+
const TableGrid = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-92e8d5fb"]]);
|
|
1256
|
+
const _hoisted_1$8 = { class: "toolbar-table-actions" };
|
|
1256
1257
|
const _hoisted_2$3 = ["onClick", "data-item", "ariaLabel"];
|
|
1257
1258
|
const _hoisted_3$3 = { class: "toolbar-table-actions__icon" };
|
|
1258
1259
|
const _hoisted_4$1 = ["innerHTML"];
|
|
1259
1260
|
const _hoisted_5 = { class: "toolbar-table-actions__label" };
|
|
1260
|
-
const _sfc_main$
|
|
1261
|
+
const _sfc_main$a = {
|
|
1261
1262
|
__name: "TableActions",
|
|
1262
1263
|
props: {
|
|
1263
1264
|
options: {
|
|
@@ -1271,7 +1272,7 @@ const _sfc_main$8 = {
|
|
|
1271
1272
|
emit("select", { command: item.command });
|
|
1272
1273
|
};
|
|
1273
1274
|
return (_ctx, _cache) => {
|
|
1274
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1275
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1275
1276
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
|
|
1276
1277
|
return openBlock(), createElementBlock("div", {
|
|
1277
1278
|
class: normalizeClass(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": option.bottomBorder }]),
|
|
@@ -1293,7 +1294,7 @@ const _sfc_main$8 = {
|
|
|
1293
1294
|
};
|
|
1294
1295
|
}
|
|
1295
1296
|
};
|
|
1296
|
-
const TableActions = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1297
|
+
const TableActions = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-990b9a25"]]);
|
|
1297
1298
|
function getScrollableParent(element) {
|
|
1298
1299
|
let currentElement = element;
|
|
1299
1300
|
while (currentElement) {
|
|
@@ -1317,10 +1318,10 @@ function scrollToElement(targetElement, options = { behavior: "smooth", block: "
|
|
|
1317
1318
|
});
|
|
1318
1319
|
}
|
|
1319
1320
|
const checkIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>\n';
|
|
1320
|
-
const _hoisted_1$
|
|
1321
|
+
const _hoisted_1$7 = { class: "search-input-ctn" };
|
|
1321
1322
|
const _hoisted_2$2 = { class: "row" };
|
|
1322
1323
|
const _hoisted_3$2 = ["onKeydown"];
|
|
1323
|
-
const _sfc_main$
|
|
1324
|
+
const _sfc_main$9 = {
|
|
1324
1325
|
__name: "SearchInput",
|
|
1325
1326
|
props: {
|
|
1326
1327
|
searchRef: {
|
|
@@ -1335,7 +1336,7 @@ const _sfc_main$7 = {
|
|
|
1335
1336
|
emit("submit", { value: searchValue.value });
|
|
1336
1337
|
};
|
|
1337
1338
|
return (_ctx, _cache) => {
|
|
1338
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1339
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1339
1340
|
createElementVNode("div", _hoisted_2$2, [
|
|
1340
1341
|
withDirectives(createElementVNode("input", {
|
|
1341
1342
|
ref: __props.searchRef,
|
|
@@ -1359,7 +1360,7 @@ const _sfc_main$7 = {
|
|
|
1359
1360
|
};
|
|
1360
1361
|
}
|
|
1361
1362
|
};
|
|
1362
|
-
const SearchInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1363
|
+
const SearchInput = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-957cbcf2"]]);
|
|
1363
1364
|
const TOOLBAR_FONTS = [
|
|
1364
1365
|
{
|
|
1365
1366
|
label: "Georgia",
|
|
@@ -2555,16 +2556,6 @@ const _SuperToolbar = class _SuperToolbar extends EventEmitter {
|
|
|
2555
2556
|
if (!argument) return;
|
|
2556
2557
|
item.onActivate({ zoom: argument });
|
|
2557
2558
|
this.emit("superdoc-command", { item, argument });
|
|
2558
|
-
const layers = this.superdoc.element?.querySelector(".layers");
|
|
2559
|
-
if (!layers) return;
|
|
2560
|
-
const isMobileDevice = typeof screen.orientation !== "undefined";
|
|
2561
|
-
const isSmallScreen = window.matchMedia("(max-width: 834px)").matches;
|
|
2562
|
-
if (isMobileDevice && isSmallScreen) {
|
|
2563
|
-
layers.style.transformOrigin = "0 0";
|
|
2564
|
-
layers.style.transform = `scale(${parseInt(argument, 10) / 100})`;
|
|
2565
|
-
} else {
|
|
2566
|
-
layers.style.zoom = parseInt(argument, 10) / 100;
|
|
2567
|
-
}
|
|
2568
2559
|
this.superdoc.superdocStore.activeZoom = parseInt(argument, 10);
|
|
2569
2560
|
},
|
|
2570
2561
|
/**
|
|
@@ -2969,6 +2960,10 @@ const _SuperToolbar = class _SuperToolbar extends EventEmitter {
|
|
|
2969
2960
|
return;
|
|
2970
2961
|
}
|
|
2971
2962
|
const { state } = this.activeEditor;
|
|
2963
|
+
if (!state) {
|
|
2964
|
+
__privateMethod(this, _SuperToolbar_instances, deactivateAll_fn).call(this);
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2972
2967
|
const selection = state.selection;
|
|
2973
2968
|
const selectionTrackedChanges = __privateMethod(this, _SuperToolbar_instances, enrichTrackedChanges_fn).call(this, collectTrackedChanges({ state, from: selection.from, to: selection.to }));
|
|
2974
2969
|
const hasTrackedChanges = selectionTrackedChanges.length > 0;
|
|
@@ -3286,14 +3281,19 @@ deactivateAll_fn = function() {
|
|
|
3286
3281
|
* @returns {void}
|
|
3287
3282
|
*/
|
|
3288
3283
|
updateToolbarHistory_fn = function() {
|
|
3289
|
-
if (!this.activeEditor) return;
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3284
|
+
if (!this.activeEditor?.state) return;
|
|
3285
|
+
try {
|
|
3286
|
+
if (this.activeEditor.options.ydoc) {
|
|
3287
|
+
const undoManager = yUndoPluginKey.getState(this.activeEditor.state)?.undoManager;
|
|
3288
|
+
this.undoDepth = undoManager?.undoStack.length || 0;
|
|
3289
|
+
this.redoDepth = undoManager?.redoStack.length || 0;
|
|
3290
|
+
} else {
|
|
3291
|
+
this.undoDepth = undoDepth(this.activeEditor.state);
|
|
3292
|
+
this.redoDepth = redoDepth(this.activeEditor.state);
|
|
3293
|
+
}
|
|
3294
|
+
} catch {
|
|
3295
|
+
this.undoDepth = 0;
|
|
3296
|
+
this.redoDepth = 0;
|
|
3297
3297
|
}
|
|
3298
3298
|
};
|
|
3299
3299
|
enrichTrackedChanges_fn = function(trackedChanges = []) {
|
|
@@ -4206,7 +4206,7 @@ function getItems(context, customItems = [], includeDefaultItems = true) {
|
|
|
4206
4206
|
}).filter((section) => section.items.length > 0);
|
|
4207
4207
|
return filteredSections;
|
|
4208
4208
|
}
|
|
4209
|
-
const _hoisted_1$
|
|
4209
|
+
const _hoisted_1$6 = { class: "slash-menu-items" };
|
|
4210
4210
|
const _hoisted_2$1 = {
|
|
4211
4211
|
key: 0,
|
|
4212
4212
|
class: "slash-menu-divider",
|
|
@@ -4214,7 +4214,7 @@ const _hoisted_2$1 = {
|
|
|
4214
4214
|
};
|
|
4215
4215
|
const _hoisted_3$1 = ["onClick"];
|
|
4216
4216
|
const _hoisted_4 = ["innerHTML"];
|
|
4217
|
-
const _sfc_main$
|
|
4217
|
+
const _sfc_main$8 = {
|
|
4218
4218
|
__name: "SlashMenu",
|
|
4219
4219
|
props: {
|
|
4220
4220
|
editor: {
|
|
@@ -4342,7 +4342,7 @@ const _sfc_main$6 = {
|
|
|
4342
4342
|
customItemRefs.clear();
|
|
4343
4343
|
};
|
|
4344
4344
|
const handleGlobalKeyDown = (event) => {
|
|
4345
|
-
if (event.key === "Escape") {
|
|
4345
|
+
if (event.key === "Escape" && isOpen.value) {
|
|
4346
4346
|
event.preventDefault();
|
|
4347
4347
|
event.stopPropagation();
|
|
4348
4348
|
closeMenu();
|
|
@@ -4530,7 +4530,7 @@ const _sfc_main$6 = {
|
|
|
4530
4530
|
}, null, 544), [
|
|
4531
4531
|
[vModelText, searchQuery.value]
|
|
4532
4532
|
]),
|
|
4533
|
-
createElementVNode("div", _hoisted_1$
|
|
4533
|
+
createElementVNode("div", _hoisted_1$6, [
|
|
4534
4534
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredSections.value, (section, sectionIndex) => {
|
|
4535
4535
|
return openBlock(), createElementBlock(Fragment, {
|
|
4536
4536
|
key: section.id
|
|
@@ -4565,8 +4565,8 @@ const _sfc_main$6 = {
|
|
|
4565
4565
|
};
|
|
4566
4566
|
}
|
|
4567
4567
|
};
|
|
4568
|
-
const _hoisted_1$
|
|
4569
|
-
const _sfc_main$
|
|
4568
|
+
const _hoisted_1$5 = ["accept"];
|
|
4569
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
4570
4570
|
__name: "BasicUpload",
|
|
4571
4571
|
props: {
|
|
4572
4572
|
accept: { default: ".docx, .pdf, .html, .md" }
|
|
@@ -4587,15 +4587,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4587
4587
|
id: "fileInput",
|
|
4588
4588
|
onChange: onFileChange,
|
|
4589
4589
|
accept: __props.accept
|
|
4590
|
-
}, null, 40, _hoisted_1$
|
|
4590
|
+
}, null, 40, _hoisted_1$5)
|
|
4591
4591
|
]);
|
|
4592
4592
|
};
|
|
4593
4593
|
}
|
|
4594
4594
|
});
|
|
4595
|
-
const _hoisted_1$
|
|
4595
|
+
const _hoisted_1$4 = { class: "numbering" };
|
|
4596
4596
|
const MIN_WIDTH = 200;
|
|
4597
4597
|
const alignment = "flex-end";
|
|
4598
|
-
const _sfc_main$
|
|
4598
|
+
const _sfc_main$6 = {
|
|
4599
4599
|
__name: "Ruler",
|
|
4600
4600
|
props: {
|
|
4601
4601
|
orientation: {
|
|
@@ -4780,7 +4780,7 @@ const _sfc_main$4 = {
|
|
|
4780
4780
|
class: normalizeClass(unit.className),
|
|
4781
4781
|
style: normalizeStyle(getStyle.value(unit))
|
|
4782
4782
|
}, [
|
|
4783
|
-
createElementVNode("div", _hoisted_1$
|
|
4783
|
+
createElementVNode("div", _hoisted_1$4, toDisplayString(unit.numbering), 1),
|
|
4784
4784
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unit.elements, (half) => {
|
|
4785
4785
|
return openBlock(), createElementBlock("div", {
|
|
4786
4786
|
class: normalizeClass(half.className),
|
|
@@ -4800,8 +4800,8 @@ const _sfc_main$4 = {
|
|
|
4800
4800
|
};
|
|
4801
4801
|
}
|
|
4802
4802
|
};
|
|
4803
|
-
const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4804
|
-
const _sfc_main$
|
|
4803
|
+
const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-79f9a944"]]);
|
|
4804
|
+
const _sfc_main$5 = {
|
|
4805
4805
|
__name: "GenericPopover",
|
|
4806
4806
|
props: {
|
|
4807
4807
|
editor: { type: Object, required: true },
|
|
@@ -4829,22 +4829,22 @@ const _sfc_main$3 = {
|
|
|
4829
4829
|
() => props.visible,
|
|
4830
4830
|
(val) => {
|
|
4831
4831
|
if (val) {
|
|
4832
|
-
document.addEventListener("
|
|
4832
|
+
document.addEventListener("pointerdown", handleClickOutside);
|
|
4833
4833
|
document.addEventListener("keydown", handleEscape);
|
|
4834
4834
|
} else {
|
|
4835
|
-
document.removeEventListener("
|
|
4835
|
+
document.removeEventListener("pointerdown", handleClickOutside);
|
|
4836
4836
|
document.removeEventListener("keydown", handleEscape);
|
|
4837
4837
|
}
|
|
4838
4838
|
}
|
|
4839
4839
|
);
|
|
4840
4840
|
onMounted(() => {
|
|
4841
4841
|
if (props.visible) {
|
|
4842
|
-
document.addEventListener("
|
|
4842
|
+
document.addEventListener("pointerdown", handleClickOutside);
|
|
4843
4843
|
document.addEventListener("keydown", handleEscape);
|
|
4844
4844
|
}
|
|
4845
4845
|
});
|
|
4846
4846
|
onBeforeUnmount(() => {
|
|
4847
|
-
document.removeEventListener("
|
|
4847
|
+
document.removeEventListener("pointerdown", handleClickOutside);
|
|
4848
4848
|
document.removeEventListener("keydown", handleEscape);
|
|
4849
4849
|
});
|
|
4850
4850
|
const derivedStyles = computed(() => ({
|
|
@@ -4859,7 +4859,7 @@ const _sfc_main$3 = {
|
|
|
4859
4859
|
style: normalizeStyle(derivedStyles.value),
|
|
4860
4860
|
ref_key: "popover",
|
|
4861
4861
|
ref: popover,
|
|
4862
|
-
|
|
4862
|
+
onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
4863
4863
|
}, ["stop"])),
|
|
4864
4864
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
4865
4865
|
}, ["stop"]))
|
|
@@ -4869,9 +4869,15 @@ const _sfc_main$3 = {
|
|
|
4869
4869
|
};
|
|
4870
4870
|
}
|
|
4871
4871
|
};
|
|
4872
|
-
const GenericPopover = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4873
|
-
const _hoisted_1$
|
|
4874
|
-
const
|
|
4872
|
+
const GenericPopover = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-157855b5"]]);
|
|
4873
|
+
const _hoisted_1$3 = ["data-boundary-index", "data-boundary-type", "onMousedown"];
|
|
4874
|
+
const RESIZE_HANDLE_WIDTH_PX = 9;
|
|
4875
|
+
const RESIZE_HANDLE_OFFSET_PX = 4;
|
|
4876
|
+
const DRAG_OVERLAY_EXTENSION_PX = 1e3;
|
|
4877
|
+
const MIN_DRAG_OVERLAY_WIDTH_PX = 2e3;
|
|
4878
|
+
const THROTTLE_INTERVAL_MS = 16;
|
|
4879
|
+
const MIN_RESIZE_DELTA_PX = 1;
|
|
4880
|
+
const _sfc_main$4 = {
|
|
4875
4881
|
__name: "TableResizeOverlay",
|
|
4876
4882
|
props: {
|
|
4877
4883
|
/** Editor instance for dispatching transactions */
|
|
@@ -4894,26 +4900,86 @@ const _sfc_main$2 = {
|
|
|
4894
4900
|
setup(__props, { emit: __emit }) {
|
|
4895
4901
|
const props = __props;
|
|
4896
4902
|
const emit = __emit;
|
|
4903
|
+
const overlayRect = ref(null);
|
|
4897
4904
|
const tableMetadata = ref(null);
|
|
4905
|
+
const getZoom = () => {
|
|
4906
|
+
const editor = props.editor;
|
|
4907
|
+
if (editor && typeof editor.zoom === "number") {
|
|
4908
|
+
return editor.zoom;
|
|
4909
|
+
}
|
|
4910
|
+
if (editor?.presentationEditor && typeof editor.presentationEditor.zoom === "number") {
|
|
4911
|
+
return editor.presentationEditor.zoom;
|
|
4912
|
+
}
|
|
4913
|
+
console.warn(
|
|
4914
|
+
"[TableResizeOverlay] getZoom: Unable to retrieve zoom from editor instance, using fallback value of 1. This may indicate the editor is not fully initialized or is not a PresentationEditor instance. Table resize handles may be misaligned."
|
|
4915
|
+
);
|
|
4916
|
+
return 1;
|
|
4917
|
+
};
|
|
4898
4918
|
const dragState = ref(null);
|
|
4899
4919
|
const forcedCleanup = ref(false);
|
|
4920
|
+
let rafId = null;
|
|
4921
|
+
let isUnmounted = false;
|
|
4922
|
+
function startOverlayTracking() {
|
|
4923
|
+
if (rafId !== null) return;
|
|
4924
|
+
const step = () => {
|
|
4925
|
+
updateOverlayRect();
|
|
4926
|
+
rafId = requestAnimationFrame(step);
|
|
4927
|
+
};
|
|
4928
|
+
rafId = requestAnimationFrame(step);
|
|
4929
|
+
}
|
|
4930
|
+
function stopOverlayTracking() {
|
|
4931
|
+
if (rafId !== null) {
|
|
4932
|
+
cancelAnimationFrame(rafId);
|
|
4933
|
+
rafId = null;
|
|
4934
|
+
}
|
|
4935
|
+
}
|
|
4900
4936
|
const overlayStyle = computed(() => {
|
|
4901
|
-
if (!props.tableElement) return {};
|
|
4902
|
-
const rect =
|
|
4937
|
+
if (!overlayRect.value || !props.tableElement) return {};
|
|
4938
|
+
const rect = overlayRect.value;
|
|
4903
4939
|
let overlayWidth = rect.width;
|
|
4904
4940
|
if (dragState.value) {
|
|
4905
|
-
overlayWidth = Math.max(rect.width +
|
|
4941
|
+
overlayWidth = Math.max(rect.width + DRAG_OVERLAY_EXTENSION_PX, MIN_DRAG_OVERLAY_WIDTH_PX);
|
|
4906
4942
|
}
|
|
4907
4943
|
return {
|
|
4908
4944
|
position: "absolute",
|
|
4909
|
-
left: `${
|
|
4910
|
-
top: `${
|
|
4945
|
+
left: `${rect.left}px`,
|
|
4946
|
+
top: `${rect.top}px`,
|
|
4911
4947
|
width: `${overlayWidth}px`,
|
|
4912
4948
|
height: `${rect.height}px`,
|
|
4913
4949
|
pointerEvents: dragState.value ? "auto" : "none",
|
|
4914
4950
|
zIndex: 10
|
|
4915
4951
|
};
|
|
4916
4952
|
});
|
|
4953
|
+
function updateOverlayRect() {
|
|
4954
|
+
if (!props.tableElement) {
|
|
4955
|
+
overlayRect.value = null;
|
|
4956
|
+
return;
|
|
4957
|
+
}
|
|
4958
|
+
const parent = props.tableElement.offsetParent;
|
|
4959
|
+
const tableRect = props.tableElement.getBoundingClientRect();
|
|
4960
|
+
if (tableRect.width === 0 || tableRect.height === 0) {
|
|
4961
|
+
overlayRect.value = null;
|
|
4962
|
+
return;
|
|
4963
|
+
}
|
|
4964
|
+
if (parent) {
|
|
4965
|
+
const parentRect = parent.getBoundingClientRect();
|
|
4966
|
+
const left = tableRect.left - parentRect.left + (parent.scrollLeft || 0);
|
|
4967
|
+
const top = tableRect.top - parentRect.top + (parent.scrollTop || 0);
|
|
4968
|
+
overlayRect.value = {
|
|
4969
|
+
left,
|
|
4970
|
+
top,
|
|
4971
|
+
width: tableRect.width,
|
|
4972
|
+
height: tableRect.height
|
|
4973
|
+
};
|
|
4974
|
+
} else {
|
|
4975
|
+
overlayRect.value = {
|
|
4976
|
+
left: props.tableElement.offsetLeft,
|
|
4977
|
+
top: props.tableElement.offsetTop,
|
|
4978
|
+
width: tableRect.width,
|
|
4979
|
+
height: tableRect.height
|
|
4980
|
+
};
|
|
4981
|
+
}
|
|
4982
|
+
}
|
|
4917
4983
|
const resizableBoundaries = computed(() => {
|
|
4918
4984
|
if (!tableMetadata.value?.columns) {
|
|
4919
4985
|
return [];
|
|
@@ -4939,23 +5005,46 @@ const _sfc_main$2 = {
|
|
|
4939
5005
|
});
|
|
4940
5006
|
return boundaries;
|
|
4941
5007
|
});
|
|
4942
|
-
function
|
|
5008
|
+
function getBoundarySegments(boundary) {
|
|
5009
|
+
if (boundary.type === "right-edge") {
|
|
5010
|
+
return [{ y: 0, h: null }];
|
|
5011
|
+
}
|
|
5012
|
+
const segmentsData = tableMetadata.value?.segments;
|
|
5013
|
+
if (!segmentsData || !Array.isArray(segmentsData)) {
|
|
5014
|
+
return [{ y: 0, h: null }];
|
|
5015
|
+
}
|
|
5016
|
+
const boundaryColIndex = boundary.index + 1;
|
|
5017
|
+
const colSegments = segmentsData[boundaryColIndex];
|
|
5018
|
+
if (!colSegments || colSegments.length === 0) {
|
|
5019
|
+
return [];
|
|
5020
|
+
}
|
|
5021
|
+
return colSegments.filter((seg) => seg && typeof seg === "object").map((seg) => ({
|
|
5022
|
+
y: typeof seg.y === "number" ? seg.y : 0,
|
|
5023
|
+
h: seg.h !== null && typeof seg.h === "number" ? seg.h : null
|
|
5024
|
+
}));
|
|
5025
|
+
}
|
|
5026
|
+
function getSegmentHandleStyle(boundary, segment) {
|
|
5027
|
+
const zoom = getZoom();
|
|
5028
|
+
const scaledX = boundary.x * zoom;
|
|
5029
|
+
const scaledY = segment.y != null ? segment.y * zoom : null;
|
|
5030
|
+
const scaledH = segment.h != null ? segment.h * zoom : null;
|
|
4943
5031
|
return {
|
|
4944
5032
|
position: "absolute",
|
|
4945
|
-
left: `${
|
|
4946
|
-
top: "0",
|
|
4947
|
-
width:
|
|
4948
|
-
height: "100%",
|
|
4949
|
-
transform:
|
|
5033
|
+
left: `${scaledX}px`,
|
|
5034
|
+
top: scaledY != null ? `${scaledY}px` : "0",
|
|
5035
|
+
width: `${RESIZE_HANDLE_WIDTH_PX}px`,
|
|
5036
|
+
height: scaledH != null ? `${scaledH}px` : "100%",
|
|
5037
|
+
transform: `translateX(-${RESIZE_HANDLE_OFFSET_PX}px)`,
|
|
4950
5038
|
cursor: "col-resize",
|
|
4951
5039
|
pointerEvents: "auto"
|
|
4952
5040
|
};
|
|
4953
5041
|
}
|
|
4954
5042
|
const guidelineStyle = computed(() => {
|
|
4955
5043
|
if (!dragState.value || !tableMetadata.value) return { display: "none" };
|
|
4956
|
-
const initialBoundary = resizableBoundaries.value[dragState.value.
|
|
5044
|
+
const initialBoundary = resizableBoundaries.value[dragState.value.resizableBoundaryIndex];
|
|
4957
5045
|
if (!initialBoundary) return { display: "none" };
|
|
4958
|
-
const
|
|
5046
|
+
const zoom = getZoom();
|
|
5047
|
+
const newX = (initialBoundary.x + dragState.value.constrainedDelta) * zoom;
|
|
4959
5048
|
return {
|
|
4960
5049
|
position: "absolute",
|
|
4961
5050
|
left: `${newX}px`,
|
|
@@ -5000,7 +5089,8 @@ const _sfc_main$2 = {
|
|
|
5000
5089
|
});
|
|
5001
5090
|
return;
|
|
5002
5091
|
}
|
|
5003
|
-
|
|
5092
|
+
const segments = Array.isArray(parsed.segments) ? parsed.segments : void 0;
|
|
5093
|
+
tableMetadata.value = { columns: validatedColumns, segments };
|
|
5004
5094
|
} catch (error) {
|
|
5005
5095
|
tableMetadata.value = null;
|
|
5006
5096
|
emit("resize-error", {
|
|
@@ -5009,11 +5099,11 @@ const _sfc_main$2 = {
|
|
|
5009
5099
|
});
|
|
5010
5100
|
}
|
|
5011
5101
|
}
|
|
5012
|
-
function onHandleMouseDown(event,
|
|
5102
|
+
function onHandleMouseDown(event, resizableBoundaryIndex) {
|
|
5013
5103
|
event.preventDefault();
|
|
5014
5104
|
event.stopPropagation();
|
|
5015
5105
|
if (!tableMetadata.value?.columns) return;
|
|
5016
|
-
const boundary = resizableBoundaries.value[
|
|
5106
|
+
const boundary = resizableBoundaries.value[resizableBoundaryIndex];
|
|
5017
5107
|
if (!boundary) return;
|
|
5018
5108
|
const columns = tableMetadata.value.columns;
|
|
5019
5109
|
const isRightEdge = boundary.type === "right-edge";
|
|
@@ -5021,7 +5111,7 @@ const _sfc_main$2 = {
|
|
|
5021
5111
|
const rightColumn = isRightEdge ? null : columns[boundary.index + 1];
|
|
5022
5112
|
dragState.value = {
|
|
5023
5113
|
columnIndex: boundary.index,
|
|
5024
|
-
|
|
5114
|
+
resizableBoundaryIndex,
|
|
5025
5115
|
isRightEdge,
|
|
5026
5116
|
initialX: event.clientX,
|
|
5027
5117
|
initialWidths: columns.map((col) => col.w),
|
|
@@ -5035,15 +5125,28 @@ const _sfc_main$2 = {
|
|
|
5035
5125
|
} : null,
|
|
5036
5126
|
constrainedDelta: 0
|
|
5037
5127
|
};
|
|
5128
|
+
if (!props.editor?.view?.dom) {
|
|
5129
|
+
emit("resize-error", { error: "Editor view not available" });
|
|
5130
|
+
dragState.value = null;
|
|
5131
|
+
return;
|
|
5132
|
+
}
|
|
5038
5133
|
const pmView = props.editor.view.dom;
|
|
5039
5134
|
pmView.style.pointerEvents = "none";
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5135
|
+
try {
|
|
5136
|
+
document.addEventListener("mousemove", onDocumentMouseMove);
|
|
5137
|
+
document.addEventListener("mouseup", onDocumentMouseUp);
|
|
5138
|
+
emit("resize-start", {
|
|
5139
|
+
columnIndex: boundary.index,
|
|
5140
|
+
isRightEdge,
|
|
5141
|
+
initialWidths: dragState.value.initialWidths
|
|
5142
|
+
});
|
|
5143
|
+
} catch (error) {
|
|
5144
|
+
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5145
|
+
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
5146
|
+
pmView.style.pointerEvents = "auto";
|
|
5147
|
+
dragState.value = null;
|
|
5148
|
+
emit("resize-error", { error: error instanceof Error ? error.message : String(error) });
|
|
5149
|
+
}
|
|
5047
5150
|
}
|
|
5048
5151
|
function throttle(func, limit) {
|
|
5049
5152
|
let inThrottle;
|
|
@@ -5068,8 +5171,10 @@ const _sfc_main$2 = {
|
|
|
5068
5171
|
return { throttled, cancel };
|
|
5069
5172
|
}
|
|
5070
5173
|
const mouseMoveThrottle = throttle((event) => {
|
|
5071
|
-
if (!dragState.value) return;
|
|
5072
|
-
const
|
|
5174
|
+
if (isUnmounted || !dragState.value) return;
|
|
5175
|
+
const zoom = getZoom();
|
|
5176
|
+
const screenDelta = event.clientX - dragState.value.initialX;
|
|
5177
|
+
const delta = screenDelta / zoom;
|
|
5073
5178
|
const minDelta = -(dragState.value.leftColumn.width - dragState.value.leftColumn.minWidth);
|
|
5074
5179
|
let maxDelta;
|
|
5075
5180
|
if (dragState.value.isRightEdge) {
|
|
@@ -5080,7 +5185,7 @@ const _sfc_main$2 = {
|
|
|
5080
5185
|
const tableLeftInPage = tableRect.left - pageRect.left;
|
|
5081
5186
|
const rightMargin = tableLeftInPage;
|
|
5082
5187
|
const maxRightPosition = pageRect.right - rightMargin;
|
|
5083
|
-
const availableSpace = maxRightPosition - tableRect.right;
|
|
5188
|
+
const availableSpace = (maxRightPosition - tableRect.right) / zoom;
|
|
5084
5189
|
maxDelta = Math.max(0, availableSpace);
|
|
5085
5190
|
} else {
|
|
5086
5191
|
maxDelta = Infinity;
|
|
@@ -5094,7 +5199,7 @@ const _sfc_main$2 = {
|
|
|
5094
5199
|
columnIndex: dragState.value.columnIndex,
|
|
5095
5200
|
delta: constrainedDelta
|
|
5096
5201
|
});
|
|
5097
|
-
},
|
|
5202
|
+
}, THROTTLE_INTERVAL_MS);
|
|
5098
5203
|
const onDocumentMouseMove = mouseMoveThrottle.throttled;
|
|
5099
5204
|
function onDocumentMouseUp(event) {
|
|
5100
5205
|
if (!dragState.value) return;
|
|
@@ -5109,13 +5214,11 @@ const _sfc_main$2 = {
|
|
|
5109
5214
|
}
|
|
5110
5215
|
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5111
5216
|
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
5112
|
-
if (props.editor?.view) {
|
|
5217
|
+
if (props.editor?.view?.dom) {
|
|
5113
5218
|
const pmView = props.editor.view.dom;
|
|
5114
|
-
|
|
5115
|
-
pmView.style.pointerEvents = "auto";
|
|
5116
|
-
}
|
|
5219
|
+
pmView.style.pointerEvents = "auto";
|
|
5117
5220
|
}
|
|
5118
|
-
if (!forcedCleanup.value && Math.abs(finalDelta) >
|
|
5221
|
+
if (!forcedCleanup.value && Math.abs(finalDelta) > MIN_RESIZE_DELTA_PX) {
|
|
5119
5222
|
dispatchResizeTransaction(columnIndex, newWidths);
|
|
5120
5223
|
emit("resize-end", {
|
|
5121
5224
|
columnIndex,
|
|
@@ -5162,7 +5265,7 @@ const _sfc_main$2 = {
|
|
|
5162
5265
|
updateCellColwidths(tr, tableNode, tablePos, affectedColumns, newWidths);
|
|
5163
5266
|
dispatch(tr);
|
|
5164
5267
|
const blockId = props.tableElement?.getAttribute("data-sd-block-id");
|
|
5165
|
-
if (blockId) {
|
|
5268
|
+
if (blockId && blockId.trim()) {
|
|
5166
5269
|
measureCache.invalidate([blockId]);
|
|
5167
5270
|
}
|
|
5168
5271
|
emit("resize-success", { columnIndex, newWidths });
|
|
@@ -5178,7 +5281,14 @@ const _sfc_main$2 = {
|
|
|
5178
5281
|
if (!pmElement) {
|
|
5179
5282
|
return null;
|
|
5180
5283
|
}
|
|
5181
|
-
const
|
|
5284
|
+
const pmStartAttr = pmElement.getAttribute("data-pm-start");
|
|
5285
|
+
if (!pmStartAttr) {
|
|
5286
|
+
return null;
|
|
5287
|
+
}
|
|
5288
|
+
const pmStart = parseInt(pmStartAttr, 10);
|
|
5289
|
+
if (!Number.isFinite(pmStart)) {
|
|
5290
|
+
return null;
|
|
5291
|
+
}
|
|
5182
5292
|
let tablePos = null;
|
|
5183
5293
|
state.doc.descendants((node, pos) => {
|
|
5184
5294
|
if (node.type.name === "table") {
|
|
@@ -5230,6 +5340,12 @@ const _sfc_main$2 = {
|
|
|
5230
5340
|
() => props.tableElement,
|
|
5231
5341
|
() => {
|
|
5232
5342
|
parseTableMetadata();
|
|
5343
|
+
updateOverlayRect();
|
|
5344
|
+
if (props.visible && props.tableElement) {
|
|
5345
|
+
startOverlayTracking();
|
|
5346
|
+
} else if (!props.tableElement) {
|
|
5347
|
+
stopOverlayTracking();
|
|
5348
|
+
}
|
|
5233
5349
|
},
|
|
5234
5350
|
{ immediate: true }
|
|
5235
5351
|
);
|
|
@@ -5238,7 +5354,10 @@ const _sfc_main$2 = {
|
|
|
5238
5354
|
(visible) => {
|
|
5239
5355
|
if (visible) {
|
|
5240
5356
|
parseTableMetadata();
|
|
5357
|
+
updateOverlayRect();
|
|
5358
|
+
startOverlayTracking();
|
|
5241
5359
|
} else {
|
|
5360
|
+
stopOverlayTracking();
|
|
5242
5361
|
if (dragState.value) {
|
|
5243
5362
|
forcedCleanup.value = true;
|
|
5244
5363
|
onDocumentMouseUp(new MouseEvent("mouseup"));
|
|
@@ -5247,8 +5366,15 @@ const _sfc_main$2 = {
|
|
|
5247
5366
|
}
|
|
5248
5367
|
}
|
|
5249
5368
|
);
|
|
5369
|
+
onMounted(() => {
|
|
5370
|
+
window.addEventListener("scroll", updateOverlayRect, true);
|
|
5371
|
+
window.addEventListener("resize", updateOverlayRect);
|
|
5372
|
+
updateOverlayRect();
|
|
5373
|
+
});
|
|
5250
5374
|
onBeforeUnmount(() => {
|
|
5375
|
+
isUnmounted = true;
|
|
5251
5376
|
mouseMoveThrottle.cancel();
|
|
5377
|
+
stopOverlayTracking();
|
|
5252
5378
|
if (dragState.value) {
|
|
5253
5379
|
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5254
5380
|
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
@@ -5256,6 +5382,8 @@ const _sfc_main$2 = {
|
|
|
5256
5382
|
props.editor.view.dom.style.pointerEvents = "auto";
|
|
5257
5383
|
}
|
|
5258
5384
|
}
|
|
5385
|
+
window.removeEventListener("scroll", updateOverlayRect, true);
|
|
5386
|
+
window.removeEventListener("resize", updateOverlayRect);
|
|
5259
5387
|
});
|
|
5260
5388
|
return (_ctx, _cache) => {
|
|
5261
5389
|
return __props.visible && tableMetadata.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -5265,17 +5393,456 @@ const _sfc_main$2 = {
|
|
|
5265
5393
|
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
5266
5394
|
}, ["stop"]))
|
|
5267
5395
|
}, [
|
|
5268
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(resizableBoundaries.value, (boundary,
|
|
5396
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(resizableBoundaries.value, (boundary, resizableBoundaryIndex) => {
|
|
5397
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
5398
|
+
key: `boundary-${resizableBoundaryIndex}`
|
|
5399
|
+
}, [
|
|
5400
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getBoundarySegments(boundary), (segment, segmentIndex) => {
|
|
5401
|
+
return openBlock(), createElementBlock("div", {
|
|
5402
|
+
key: `handle-${boundary.type}-${boundary.index}-${segmentIndex}`,
|
|
5403
|
+
class: normalizeClass(["resize-handle", {
|
|
5404
|
+
"resize-handle--active": dragState.value && dragState.value.resizableBoundaryIndex === resizableBoundaryIndex,
|
|
5405
|
+
"resize-handle--edge": boundary.type === "right-edge"
|
|
5406
|
+
}]),
|
|
5407
|
+
"data-boundary-index": resizableBoundaryIndex,
|
|
5408
|
+
"data-boundary-type": boundary.type,
|
|
5409
|
+
style: normalizeStyle(getSegmentHandleStyle(boundary, segment)),
|
|
5410
|
+
onMousedown: ($event) => onHandleMouseDown($event, resizableBoundaryIndex)
|
|
5411
|
+
}, null, 46, _hoisted_1$3);
|
|
5412
|
+
}), 128))
|
|
5413
|
+
], 64);
|
|
5414
|
+
}), 128)),
|
|
5415
|
+
dragState.value ? (openBlock(), createElementBlock("div", {
|
|
5416
|
+
key: 0,
|
|
5417
|
+
class: "resize-guideline",
|
|
5418
|
+
style: normalizeStyle(guidelineStyle.value)
|
|
5419
|
+
}, null, 4)) : createCommentVNode("", true)
|
|
5420
|
+
], 36)) : createCommentVNode("", true);
|
|
5421
|
+
};
|
|
5422
|
+
}
|
|
5423
|
+
};
|
|
5424
|
+
const TableResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-814384b6"]]);
|
|
5425
|
+
const _hoisted_1$2 = ["data-handle-position", "onMousedown"];
|
|
5426
|
+
const OVERLAY_EXPANSION_PX = 2e3;
|
|
5427
|
+
const RESIZE_HANDLE_SIZE_PX = 12;
|
|
5428
|
+
const MOUSE_MOVE_THROTTLE_MS = 16;
|
|
5429
|
+
const DIMENSION_CHANGE_THRESHOLD_PX = 1;
|
|
5430
|
+
const Z_INDEX_OVERLAY = 10;
|
|
5431
|
+
const Z_INDEX_HANDLE = 15;
|
|
5432
|
+
const Z_INDEX_GUIDELINE = 20;
|
|
5433
|
+
const _sfc_main$3 = {
|
|
5434
|
+
__name: "ImageResizeOverlay",
|
|
5435
|
+
props: {
|
|
5436
|
+
/** Editor instance for dispatching transactions */
|
|
5437
|
+
editor: {
|
|
5438
|
+
type: Object,
|
|
5439
|
+
required: true
|
|
5440
|
+
},
|
|
5441
|
+
/** Show or hide the overlay */
|
|
5442
|
+
visible: {
|
|
5443
|
+
type: Boolean,
|
|
5444
|
+
default: false
|
|
5445
|
+
},
|
|
5446
|
+
/** Image fragment element containing data-image-metadata */
|
|
5447
|
+
imageElement: {
|
|
5448
|
+
type: Object,
|
|
5449
|
+
default: null
|
|
5450
|
+
}
|
|
5451
|
+
},
|
|
5452
|
+
emits: ["resize-start", "resize-move", "resize-end", "resize-success", "resize-error"],
|
|
5453
|
+
setup(__props, { emit: __emit }) {
|
|
5454
|
+
useCssVars((_ctx) => ({
|
|
5455
|
+
"v1e81f81d": RESIZE_HANDLE_SIZE_PX + "px",
|
|
5456
|
+
"v12763124": Z_INDEX_HANDLE
|
|
5457
|
+
}));
|
|
5458
|
+
function isValidEditor(editor) {
|
|
5459
|
+
return editor && typeof editor === "object" && editor.view && typeof editor.view === "object" && editor.view.dom instanceof HTMLElement && editor.view.state && typeof editor.view.dispatch === "function";
|
|
5460
|
+
}
|
|
5461
|
+
const props = __props;
|
|
5462
|
+
const emit = __emit;
|
|
5463
|
+
const imageMetadata = ref(null);
|
|
5464
|
+
const dragState = ref(null);
|
|
5465
|
+
const forcedCleanup = ref(false);
|
|
5466
|
+
const overlayStyle = computed(() => {
|
|
5467
|
+
if (!props.imageElement || !props.imageElement.isConnected) return {};
|
|
5468
|
+
const imageRect = props.imageElement.getBoundingClientRect();
|
|
5469
|
+
const wrapper = props.imageElement.closest(".super-editor");
|
|
5470
|
+
if (!wrapper) {
|
|
5471
|
+
return {
|
|
5472
|
+
position: "absolute",
|
|
5473
|
+
left: `${props.imageElement.offsetLeft}px`,
|
|
5474
|
+
top: `${props.imageElement.offsetTop}px`,
|
|
5475
|
+
width: `${imageRect.width}px`,
|
|
5476
|
+
height: `${imageRect.height}px`,
|
|
5477
|
+
pointerEvents: dragState.value ? "auto" : "none",
|
|
5478
|
+
zIndex: Z_INDEX_OVERLAY
|
|
5479
|
+
};
|
|
5480
|
+
}
|
|
5481
|
+
const wrapperRect = wrapper.getBoundingClientRect();
|
|
5482
|
+
const scrollLeft = wrapper.scrollLeft || 0;
|
|
5483
|
+
const scrollTop = wrapper.scrollTop || 0;
|
|
5484
|
+
const relativeLeft = imageRect.left - wrapperRect.left + scrollLeft;
|
|
5485
|
+
const relativeTop = imageRect.top - wrapperRect.top + scrollTop;
|
|
5486
|
+
let overlayWidth = imageRect.width;
|
|
5487
|
+
let overlayHeight = imageRect.height;
|
|
5488
|
+
let offsetX = 0;
|
|
5489
|
+
let offsetY = 0;
|
|
5490
|
+
if (dragState.value) {
|
|
5491
|
+
const expansion = OVERLAY_EXPANSION_PX;
|
|
5492
|
+
overlayWidth = imageRect.width + expansion * 2;
|
|
5493
|
+
overlayHeight = imageRect.height + expansion * 2;
|
|
5494
|
+
offsetX = -expansion;
|
|
5495
|
+
offsetY = -expansion;
|
|
5496
|
+
}
|
|
5497
|
+
return {
|
|
5498
|
+
position: "absolute",
|
|
5499
|
+
left: `${relativeLeft + offsetX}px`,
|
|
5500
|
+
top: `${relativeTop + offsetY}px`,
|
|
5501
|
+
width: `${overlayWidth}px`,
|
|
5502
|
+
height: `${overlayHeight}px`,
|
|
5503
|
+
pointerEvents: dragState.value ? "auto" : "none",
|
|
5504
|
+
zIndex: Z_INDEX_OVERLAY
|
|
5505
|
+
};
|
|
5506
|
+
});
|
|
5507
|
+
const resizeHandles = computed(() => {
|
|
5508
|
+
if (!imageMetadata.value || !props.imageElement) {
|
|
5509
|
+
return [];
|
|
5510
|
+
}
|
|
5511
|
+
const rect = props.imageElement.getBoundingClientRect();
|
|
5512
|
+
const width = rect.width;
|
|
5513
|
+
const height = rect.height;
|
|
5514
|
+
const handleSize = RESIZE_HANDLE_SIZE_PX;
|
|
5515
|
+
const offset = handleSize / 2;
|
|
5516
|
+
const expansion = dragState.value ? OVERLAY_EXPANSION_PX : 0;
|
|
5517
|
+
return [
|
|
5518
|
+
{
|
|
5519
|
+
position: "nw",
|
|
5520
|
+
style: {
|
|
5521
|
+
left: `${expansion - offset}px`,
|
|
5522
|
+
top: `${expansion - offset}px`,
|
|
5523
|
+
cursor: "nwse-resize"
|
|
5524
|
+
}
|
|
5525
|
+
},
|
|
5526
|
+
{
|
|
5527
|
+
position: "ne",
|
|
5528
|
+
style: {
|
|
5529
|
+
left: `${expansion + width - offset}px`,
|
|
5530
|
+
top: `${expansion - offset}px`,
|
|
5531
|
+
cursor: "nesw-resize"
|
|
5532
|
+
}
|
|
5533
|
+
},
|
|
5534
|
+
{
|
|
5535
|
+
position: "sw",
|
|
5536
|
+
style: {
|
|
5537
|
+
left: `${expansion - offset}px`,
|
|
5538
|
+
top: `${expansion + height - offset}px`,
|
|
5539
|
+
cursor: "nesw-resize"
|
|
5540
|
+
}
|
|
5541
|
+
},
|
|
5542
|
+
{
|
|
5543
|
+
position: "se",
|
|
5544
|
+
style: {
|
|
5545
|
+
left: `${expansion + width - offset}px`,
|
|
5546
|
+
top: `${expansion + height - offset}px`,
|
|
5547
|
+
cursor: "nwse-resize"
|
|
5548
|
+
}
|
|
5549
|
+
}
|
|
5550
|
+
];
|
|
5551
|
+
});
|
|
5552
|
+
const guidelineStyle = computed(() => {
|
|
5553
|
+
if (!dragState.value || !props.imageElement) {
|
|
5554
|
+
return { display: "none" };
|
|
5555
|
+
}
|
|
5556
|
+
const expansion = OVERLAY_EXPANSION_PX;
|
|
5557
|
+
return {
|
|
5558
|
+
position: "absolute",
|
|
5559
|
+
left: `${expansion}px`,
|
|
5560
|
+
top: `${expansion}px`,
|
|
5561
|
+
width: `${dragState.value.constrainedWidth}px`,
|
|
5562
|
+
height: `${dragState.value.constrainedHeight}px`,
|
|
5563
|
+
border: "2px solid #4A90E2",
|
|
5564
|
+
pointerEvents: "none",
|
|
5565
|
+
zIndex: Z_INDEX_GUIDELINE,
|
|
5566
|
+
boxSizing: "border-box"
|
|
5567
|
+
};
|
|
5568
|
+
});
|
|
5569
|
+
function parseImageMetadata() {
|
|
5570
|
+
if (!props.imageElement || !props.imageElement.isConnected) {
|
|
5571
|
+
imageMetadata.value = null;
|
|
5572
|
+
return;
|
|
5573
|
+
}
|
|
5574
|
+
try {
|
|
5575
|
+
const metadataAttr = props.imageElement.getAttribute("data-image-metadata");
|
|
5576
|
+
if (!metadataAttr) {
|
|
5577
|
+
imageMetadata.value = null;
|
|
5578
|
+
return;
|
|
5579
|
+
}
|
|
5580
|
+
const parsed = JSON.parse(metadataAttr);
|
|
5581
|
+
if (!parsed || typeof parsed !== "object") {
|
|
5582
|
+
imageMetadata.value = null;
|
|
5583
|
+
return;
|
|
5584
|
+
}
|
|
5585
|
+
const required = [
|
|
5586
|
+
"originalWidth",
|
|
5587
|
+
"originalHeight",
|
|
5588
|
+
"maxWidth",
|
|
5589
|
+
"maxHeight",
|
|
5590
|
+
"aspectRatio",
|
|
5591
|
+
"minWidth",
|
|
5592
|
+
"minHeight"
|
|
5593
|
+
];
|
|
5594
|
+
for (const field of required) {
|
|
5595
|
+
if (!Number.isFinite(parsed[field]) || parsed[field] <= 0) {
|
|
5596
|
+
console.warn(`[ImageResizeOverlay] Invalid or missing metadata field: ${field}`);
|
|
5597
|
+
imageMetadata.value = null;
|
|
5598
|
+
return;
|
|
5599
|
+
}
|
|
5600
|
+
}
|
|
5601
|
+
imageMetadata.value = parsed;
|
|
5602
|
+
} catch (error) {
|
|
5603
|
+
imageMetadata.value = null;
|
|
5604
|
+
emit("resize-error", {
|
|
5605
|
+
error: error instanceof Error ? error.message : "Failed to parse image metadata",
|
|
5606
|
+
rawMetadata: props.imageElement?.getAttribute("data-image-metadata")
|
|
5607
|
+
});
|
|
5608
|
+
}
|
|
5609
|
+
}
|
|
5610
|
+
function onHandleMouseDown(event, handlePosition) {
|
|
5611
|
+
event.preventDefault();
|
|
5612
|
+
event.stopPropagation();
|
|
5613
|
+
if (!isValidEditor(props.editor) || !imageMetadata.value || !props.imageElement) return;
|
|
5614
|
+
const rect = props.imageElement.getBoundingClientRect();
|
|
5615
|
+
dragState.value = {
|
|
5616
|
+
handle: handlePosition,
|
|
5617
|
+
initialX: event.clientX,
|
|
5618
|
+
initialY: event.clientY,
|
|
5619
|
+
initialWidth: rect.width,
|
|
5620
|
+
initialHeight: rect.height,
|
|
5621
|
+
aspectRatio: imageMetadata.value.aspectRatio,
|
|
5622
|
+
constrainedWidth: rect.width,
|
|
5623
|
+
constrainedHeight: rect.height
|
|
5624
|
+
};
|
|
5625
|
+
const pmView = props.editor.view.dom;
|
|
5626
|
+
pmView.style.pointerEvents = "none";
|
|
5627
|
+
document.addEventListener("mousemove", onDocumentMouseMove);
|
|
5628
|
+
document.addEventListener("mouseup", onDocumentMouseUp);
|
|
5629
|
+
document.addEventListener("keydown", onEscapeKey);
|
|
5630
|
+
emit("resize-start", {
|
|
5631
|
+
blockId: props.imageElement.getAttribute("data-sd-block-id"),
|
|
5632
|
+
initialWidth: rect.width,
|
|
5633
|
+
initialHeight: rect.height
|
|
5634
|
+
});
|
|
5635
|
+
}
|
|
5636
|
+
function throttle(func, limit) {
|
|
5637
|
+
let inThrottle;
|
|
5638
|
+
let timeoutId = null;
|
|
5639
|
+
const throttled = function(...args) {
|
|
5640
|
+
if (!inThrottle) {
|
|
5641
|
+
func.apply(this, args);
|
|
5642
|
+
inThrottle = true;
|
|
5643
|
+
timeoutId = setTimeout(() => {
|
|
5644
|
+
inThrottle = false;
|
|
5645
|
+
timeoutId = null;
|
|
5646
|
+
}, limit);
|
|
5647
|
+
}
|
|
5648
|
+
};
|
|
5649
|
+
const cancel = () => {
|
|
5650
|
+
if (timeoutId !== null) {
|
|
5651
|
+
clearTimeout(timeoutId);
|
|
5652
|
+
timeoutId = null;
|
|
5653
|
+
inThrottle = false;
|
|
5654
|
+
}
|
|
5655
|
+
};
|
|
5656
|
+
return { throttled, cancel };
|
|
5657
|
+
}
|
|
5658
|
+
const mouseMoveThrottle = throttle((event) => {
|
|
5659
|
+
if (!dragState.value || !imageMetadata.value) return;
|
|
5660
|
+
let deltaX = event.clientX - dragState.value.initialX;
|
|
5661
|
+
let deltaY = event.clientY - dragState.value.initialY;
|
|
5662
|
+
const handle = dragState.value.handle;
|
|
5663
|
+
if (handle === "nw") {
|
|
5664
|
+
deltaX = -deltaX;
|
|
5665
|
+
deltaY = -deltaY;
|
|
5666
|
+
} else if (handle === "ne") {
|
|
5667
|
+
deltaY = -deltaY;
|
|
5668
|
+
} else if (handle === "sw") {
|
|
5669
|
+
deltaX = -deltaX;
|
|
5670
|
+
}
|
|
5671
|
+
const scaleX = (dragState.value.initialWidth + deltaX) / dragState.value.initialWidth;
|
|
5672
|
+
const scaleY = (dragState.value.initialHeight + deltaY) / dragState.value.initialHeight;
|
|
5673
|
+
const scale = Math.max(scaleX, scaleY);
|
|
5674
|
+
let newWidth = dragState.value.initialWidth * scale;
|
|
5675
|
+
let newHeight = dragState.value.initialHeight * scale;
|
|
5676
|
+
const minWidth = imageMetadata.value.minWidth;
|
|
5677
|
+
const minHeight = imageMetadata.value.minHeight;
|
|
5678
|
+
const maxWidth = imageMetadata.value.maxWidth;
|
|
5679
|
+
const maxHeight = imageMetadata.value.maxHeight;
|
|
5680
|
+
if (newWidth < minWidth) {
|
|
5681
|
+
newWidth = minWidth;
|
|
5682
|
+
newHeight = newWidth / dragState.value.aspectRatio;
|
|
5683
|
+
}
|
|
5684
|
+
if (newHeight < minHeight) {
|
|
5685
|
+
newHeight = minHeight;
|
|
5686
|
+
newWidth = newHeight * dragState.value.aspectRatio;
|
|
5687
|
+
}
|
|
5688
|
+
if (newWidth > maxWidth) {
|
|
5689
|
+
newWidth = maxWidth;
|
|
5690
|
+
newHeight = newWidth / dragState.value.aspectRatio;
|
|
5691
|
+
}
|
|
5692
|
+
if (newHeight > maxHeight) {
|
|
5693
|
+
newHeight = maxHeight;
|
|
5694
|
+
newWidth = newHeight * dragState.value.aspectRatio;
|
|
5695
|
+
}
|
|
5696
|
+
dragState.value.constrainedWidth = newWidth;
|
|
5697
|
+
dragState.value.constrainedHeight = newHeight;
|
|
5698
|
+
emit("resize-move", {
|
|
5699
|
+
blockId: props.imageElement.getAttribute("data-sd-block-id"),
|
|
5700
|
+
width: newWidth,
|
|
5701
|
+
height: newHeight
|
|
5702
|
+
});
|
|
5703
|
+
}, MOUSE_MOVE_THROTTLE_MS);
|
|
5704
|
+
const onDocumentMouseMove = mouseMoveThrottle.throttled;
|
|
5705
|
+
function onEscapeKey(event) {
|
|
5706
|
+
if (event.key === "Escape" && dragState.value) {
|
|
5707
|
+
forcedCleanup.value = true;
|
|
5708
|
+
onDocumentMouseUp(new MouseEvent("mouseup"));
|
|
5709
|
+
forcedCleanup.value = false;
|
|
5710
|
+
}
|
|
5711
|
+
}
|
|
5712
|
+
function onDocumentMouseUp(event) {
|
|
5713
|
+
if (!dragState.value) return;
|
|
5714
|
+
const finalWidth = dragState.value.constrainedWidth;
|
|
5715
|
+
const finalHeight = dragState.value.constrainedHeight;
|
|
5716
|
+
const blockId = props.imageElement?.getAttribute("data-sd-block-id");
|
|
5717
|
+
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5718
|
+
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
5719
|
+
document.removeEventListener("keydown", onEscapeKey);
|
|
5720
|
+
if (props.editor?.view) {
|
|
5721
|
+
const pmView = props.editor.view.dom;
|
|
5722
|
+
if (pmView && pmView.style) {
|
|
5723
|
+
pmView.style.pointerEvents = "auto";
|
|
5724
|
+
}
|
|
5725
|
+
}
|
|
5726
|
+
const widthDelta = Math.abs(finalWidth - dragState.value.initialWidth);
|
|
5727
|
+
const heightDelta = Math.abs(finalHeight - dragState.value.initialHeight);
|
|
5728
|
+
if (!forcedCleanup.value && (widthDelta > DIMENSION_CHANGE_THRESHOLD_PX || heightDelta > DIMENSION_CHANGE_THRESHOLD_PX)) {
|
|
5729
|
+
dispatchResizeTransaction(blockId, finalWidth, finalHeight);
|
|
5730
|
+
emit("resize-end", {
|
|
5731
|
+
blockId,
|
|
5732
|
+
finalWidth,
|
|
5733
|
+
finalHeight
|
|
5734
|
+
});
|
|
5735
|
+
}
|
|
5736
|
+
dragState.value = null;
|
|
5737
|
+
}
|
|
5738
|
+
function dispatchResizeTransaction(blockId, newWidth, newHeight) {
|
|
5739
|
+
if (!isValidEditor(props.editor) || !props.imageElement) {
|
|
5740
|
+
return;
|
|
5741
|
+
}
|
|
5742
|
+
if (!Number.isFinite(newWidth) || !Number.isFinite(newHeight) || newWidth <= 0 || newHeight <= 0) {
|
|
5743
|
+
emit("resize-error", {
|
|
5744
|
+
blockId,
|
|
5745
|
+
error: "Invalid dimensions: width and height must be positive finite numbers"
|
|
5746
|
+
});
|
|
5747
|
+
return;
|
|
5748
|
+
}
|
|
5749
|
+
try {
|
|
5750
|
+
const { state, dispatch } = props.editor.view;
|
|
5751
|
+
const tr = state.tr;
|
|
5752
|
+
const pmStartAttr = props.imageElement.getAttribute("data-pm-start");
|
|
5753
|
+
if (!pmStartAttr) {
|
|
5754
|
+
emit("resize-error", {
|
|
5755
|
+
blockId,
|
|
5756
|
+
error: "Image position marker (data-pm-start) not found"
|
|
5757
|
+
});
|
|
5758
|
+
return;
|
|
5759
|
+
}
|
|
5760
|
+
const imagePos = parseInt(pmStartAttr, 10);
|
|
5761
|
+
if (!Number.isFinite(imagePos) || imagePos < 0) {
|
|
5762
|
+
emit("resize-error", {
|
|
5763
|
+
blockId,
|
|
5764
|
+
error: "Invalid image position marker"
|
|
5765
|
+
});
|
|
5766
|
+
return;
|
|
5767
|
+
}
|
|
5768
|
+
const imageNode = state.doc.nodeAt(imagePos);
|
|
5769
|
+
if (!imageNode || imageNode.type.name !== "image") {
|
|
5770
|
+
emit("resize-error", {
|
|
5771
|
+
blockId,
|
|
5772
|
+
error: "Invalid image node at position"
|
|
5773
|
+
});
|
|
5774
|
+
return;
|
|
5775
|
+
}
|
|
5776
|
+
const newAttrs = {
|
|
5777
|
+
...imageNode.attrs,
|
|
5778
|
+
size: {
|
|
5779
|
+
width: Math.round(newWidth),
|
|
5780
|
+
height: Math.round(newHeight)
|
|
5781
|
+
}
|
|
5782
|
+
};
|
|
5783
|
+
tr.setNodeMarkup(imagePos, null, newAttrs);
|
|
5784
|
+
dispatch(tr);
|
|
5785
|
+
if (blockId && blockId.trim()) {
|
|
5786
|
+
measureCache.invalidate([blockId]);
|
|
5787
|
+
}
|
|
5788
|
+
emit("resize-success", { blockId, newWidth, newHeight });
|
|
5789
|
+
} catch (error) {
|
|
5790
|
+
emit("resize-error", {
|
|
5791
|
+
blockId,
|
|
5792
|
+
error: error instanceof Error ? error.message : String(error)
|
|
5793
|
+
});
|
|
5794
|
+
}
|
|
5795
|
+
}
|
|
5796
|
+
watch(
|
|
5797
|
+
() => props.imageElement,
|
|
5798
|
+
() => {
|
|
5799
|
+
parseImageMetadata();
|
|
5800
|
+
},
|
|
5801
|
+
{ immediate: true }
|
|
5802
|
+
);
|
|
5803
|
+
watch(
|
|
5804
|
+
() => props.visible,
|
|
5805
|
+
(visible) => {
|
|
5806
|
+
if (visible) {
|
|
5807
|
+
parseImageMetadata();
|
|
5808
|
+
} else {
|
|
5809
|
+
if (dragState.value) {
|
|
5810
|
+
forcedCleanup.value = true;
|
|
5811
|
+
onDocumentMouseUp(new MouseEvent("mouseup"));
|
|
5812
|
+
forcedCleanup.value = false;
|
|
5813
|
+
}
|
|
5814
|
+
}
|
|
5815
|
+
}
|
|
5816
|
+
);
|
|
5817
|
+
onBeforeUnmount(() => {
|
|
5818
|
+
mouseMoveThrottle.cancel();
|
|
5819
|
+
if (dragState.value) {
|
|
5820
|
+
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5821
|
+
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
5822
|
+
document.removeEventListener("keydown", onEscapeKey);
|
|
5823
|
+
if (props.editor?.view?.dom) {
|
|
5824
|
+
props.editor.view.dom.style.pointerEvents = "auto";
|
|
5825
|
+
}
|
|
5826
|
+
}
|
|
5827
|
+
});
|
|
5828
|
+
return (_ctx, _cache) => {
|
|
5829
|
+
return __props.visible && imageMetadata.value ? (openBlock(), createElementBlock("div", {
|
|
5830
|
+
key: 0,
|
|
5831
|
+
class: "superdoc-image-resize-overlay",
|
|
5832
|
+
style: normalizeStyle(overlayStyle.value),
|
|
5833
|
+
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
5834
|
+
}, ["stop"]))
|
|
5835
|
+
}, [
|
|
5836
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(resizeHandles.value, (handle) => {
|
|
5269
5837
|
return openBlock(), createElementBlock("div", {
|
|
5270
|
-
key:
|
|
5838
|
+
key: handle.position,
|
|
5271
5839
|
class: normalizeClass(["resize-handle", {
|
|
5272
|
-
"resize-handle--active": dragState.value && dragState.value.
|
|
5273
|
-
|
|
5840
|
+
"resize-handle--active": dragState.value && dragState.value.handle === handle.position,
|
|
5841
|
+
[`resize-handle--${handle.position}`]: true
|
|
5274
5842
|
}]),
|
|
5275
|
-
|
|
5276
|
-
"data-
|
|
5277
|
-
|
|
5278
|
-
onMousedown: ($event) => onHandleMouseDown($event, index)
|
|
5843
|
+
style: normalizeStyle(handle.style),
|
|
5844
|
+
"data-handle-position": handle.position,
|
|
5845
|
+
onMousedown: ($event) => onHandleMouseDown($event, handle.position)
|
|
5279
5846
|
}, null, 46, _hoisted_1$2);
|
|
5280
5847
|
}), 128)),
|
|
5281
5848
|
dragState.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -5287,7 +5854,114 @@ const _sfc_main$2 = {
|
|
|
5287
5854
|
};
|
|
5288
5855
|
}
|
|
5289
5856
|
};
|
|
5290
|
-
const
|
|
5857
|
+
const ImageResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-e66ec7bb"]]);
|
|
5858
|
+
const LINK_CLICK_DEBOUNCE_MS = 300;
|
|
5859
|
+
const CURSOR_UPDATE_TIMEOUT_MS = 10;
|
|
5860
|
+
const _sfc_main$2 = {
|
|
5861
|
+
__name: "LinkClickHandler",
|
|
5862
|
+
props: {
|
|
5863
|
+
editor: {
|
|
5864
|
+
type: Object,
|
|
5865
|
+
required: true
|
|
5866
|
+
},
|
|
5867
|
+
openPopover: {
|
|
5868
|
+
type: Function,
|
|
5869
|
+
required: true
|
|
5870
|
+
},
|
|
5871
|
+
closePopover: {
|
|
5872
|
+
type: Function,
|
|
5873
|
+
required: true
|
|
5874
|
+
},
|
|
5875
|
+
popoverVisible: {
|
|
5876
|
+
type: Boolean,
|
|
5877
|
+
default: false
|
|
5878
|
+
}
|
|
5879
|
+
},
|
|
5880
|
+
setup(__props) {
|
|
5881
|
+
const props = __props;
|
|
5882
|
+
let lastLinkClickTime = 0;
|
|
5883
|
+
const handleLinkClick = (event) => {
|
|
5884
|
+
const detail = event?.detail ?? {};
|
|
5885
|
+
const linkElement = detail.element;
|
|
5886
|
+
const now = Date.now();
|
|
5887
|
+
if (now - lastLinkClickTime < LINK_CLICK_DEBOUNCE_MS) {
|
|
5888
|
+
return;
|
|
5889
|
+
}
|
|
5890
|
+
lastLinkClickTime = now;
|
|
5891
|
+
if (props.popoverVisible) {
|
|
5892
|
+
props.closePopover();
|
|
5893
|
+
return;
|
|
5894
|
+
}
|
|
5895
|
+
if (!props.editor || !props.editor.state) {
|
|
5896
|
+
return;
|
|
5897
|
+
}
|
|
5898
|
+
const surface = getEditorSurfaceElement(props.editor);
|
|
5899
|
+
if (!surface) {
|
|
5900
|
+
return;
|
|
5901
|
+
}
|
|
5902
|
+
const pmStart = linkElement?.dataset?.pmStart;
|
|
5903
|
+
if (pmStart != null) {
|
|
5904
|
+
const pos = parseInt(pmStart, 10);
|
|
5905
|
+
const state = props.editor.state;
|
|
5906
|
+
const doc = state.doc;
|
|
5907
|
+
if (!isNaN(pos) && pos >= 0 && pos <= doc.content.size) {
|
|
5908
|
+
const tr = state.tr.setSelection(TextSelection$1.create(doc, pos));
|
|
5909
|
+
props.editor.dispatch(tr);
|
|
5910
|
+
} else {
|
|
5911
|
+
console.warn(`Invalid PM position from data-pm-start: ${pmStart}, falling back to coordinate-based positioning`);
|
|
5912
|
+
moveCursorToMouseEvent(detail, props.editor);
|
|
5913
|
+
}
|
|
5914
|
+
} else {
|
|
5915
|
+
moveCursorToMouseEvent(detail, props.editor);
|
|
5916
|
+
}
|
|
5917
|
+
setTimeout(() => {
|
|
5918
|
+
const currentState = props.editor.state;
|
|
5919
|
+
const $from = currentState.selection.$from;
|
|
5920
|
+
const linkMarkType = currentState.schema.marks.link;
|
|
5921
|
+
const nodeAfter = $from.nodeAfter;
|
|
5922
|
+
const nodeBefore = $from.nodeBefore;
|
|
5923
|
+
const marksOnNodeAfter = nodeAfter?.marks || [];
|
|
5924
|
+
const marksOnNodeBefore = nodeBefore?.marks || [];
|
|
5925
|
+
const linkOnNodeAfter = linkMarkType && marksOnNodeAfter.some((m) => m.type === linkMarkType);
|
|
5926
|
+
const linkOnNodeBefore = linkMarkType && marksOnNodeBefore.some((m) => m.type === linkMarkType);
|
|
5927
|
+
const hasLinkAdjacent = linkOnNodeAfter || linkOnNodeBefore;
|
|
5928
|
+
const hasLink = selectionHasNodeOrMark(currentState, "link", { requireEnds: true });
|
|
5929
|
+
if (hasLink || hasLinkAdjacent) {
|
|
5930
|
+
const surfaceRect = surface.getBoundingClientRect();
|
|
5931
|
+
if (!surfaceRect) return;
|
|
5932
|
+
props.openPopover(
|
|
5933
|
+
markRaw(LinkInput),
|
|
5934
|
+
{
|
|
5935
|
+
showInput: true,
|
|
5936
|
+
editor: props.editor,
|
|
5937
|
+
closePopover: props.closePopover
|
|
5938
|
+
},
|
|
5939
|
+
{
|
|
5940
|
+
left: `${detail.clientX - surfaceRect.left}px`,
|
|
5941
|
+
top: `${detail.clientY - surfaceRect.top + 15}px`
|
|
5942
|
+
}
|
|
5943
|
+
);
|
|
5944
|
+
}
|
|
5945
|
+
}, CURSOR_UPDATE_TIMEOUT_MS);
|
|
5946
|
+
};
|
|
5947
|
+
let surfaceElement = null;
|
|
5948
|
+
onMounted(() => {
|
|
5949
|
+
if (!props.editor) return;
|
|
5950
|
+
surfaceElement = getEditorSurfaceElement(props.editor);
|
|
5951
|
+
if (surfaceElement) {
|
|
5952
|
+
surfaceElement.addEventListener("superdoc-link-click", handleLinkClick);
|
|
5953
|
+
}
|
|
5954
|
+
});
|
|
5955
|
+
onBeforeUnmount(() => {
|
|
5956
|
+
if (surfaceElement) {
|
|
5957
|
+
surfaceElement.removeEventListener("superdoc-link-click", handleLinkClick);
|
|
5958
|
+
}
|
|
5959
|
+
});
|
|
5960
|
+
return (_ctx, _cache) => {
|
|
5961
|
+
return null;
|
|
5962
|
+
};
|
|
5963
|
+
}
|
|
5964
|
+
};
|
|
5291
5965
|
function adjustPaginationBreaks(editorElem, editor) {
|
|
5292
5966
|
if (!editorElem.value || !editor?.value?.options?.scale || isHeadless(editor)) return;
|
|
5293
5967
|
const zoom = editor.value.options.scale;
|
|
@@ -5312,7 +5986,9 @@ const _hoisted_2 = {
|
|
|
5312
5986
|
};
|
|
5313
5987
|
const _hoisted_3 = { class: "placeholder-title" };
|
|
5314
5988
|
const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
5315
|
-
const
|
|
5989
|
+
const TABLE_RESIZE_HOVER_THRESHOLD = 8;
|
|
5990
|
+
const TABLE_RESIZE_THROTTLE_MS = 16;
|
|
5991
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
5316
5992
|
__name: "SuperEditor",
|
|
5317
5993
|
props: {
|
|
5318
5994
|
documentId: {
|
|
@@ -5376,7 +6052,94 @@ const _sfc_main$1 = {
|
|
|
5376
6052
|
visible: false,
|
|
5377
6053
|
tableElement: null
|
|
5378
6054
|
});
|
|
6055
|
+
const imageResizeState = reactive({
|
|
6056
|
+
visible: false,
|
|
6057
|
+
imageElement: null,
|
|
6058
|
+
blockId: null
|
|
6059
|
+
});
|
|
6060
|
+
const selectedImageState = reactive({
|
|
6061
|
+
element: null,
|
|
6062
|
+
blockId: null,
|
|
6063
|
+
pmStart: null
|
|
6064
|
+
});
|
|
6065
|
+
const getEditorZoom = () => {
|
|
6066
|
+
const active = activeEditor.value;
|
|
6067
|
+
if (active && typeof active.zoom === "number") {
|
|
6068
|
+
return active.zoom;
|
|
6069
|
+
}
|
|
6070
|
+
if (active?.presentationEditor && typeof active.presentationEditor.zoom === "number") {
|
|
6071
|
+
return active.presentationEditor.zoom;
|
|
6072
|
+
}
|
|
6073
|
+
console.warn(
|
|
6074
|
+
"[SuperEditor] getEditorZoom: Unable to retrieve zoom from editor instance, using fallback value of 1. This may indicate the editor is not fully initialized or is not a PresentationEditor instance."
|
|
6075
|
+
);
|
|
6076
|
+
return 1;
|
|
6077
|
+
};
|
|
6078
|
+
let lastUpdateTableResizeTimestamp = 0;
|
|
6079
|
+
const isNearColumnBoundary = (event, tableElement) => {
|
|
6080
|
+
if (!event || typeof event.clientX !== "number" || typeof event.clientY !== "number") {
|
|
6081
|
+
console.warn("[isNearColumnBoundary] Invalid event: missing clientX or clientY", event);
|
|
6082
|
+
return false;
|
|
6083
|
+
}
|
|
6084
|
+
if (!tableElement || !(tableElement instanceof HTMLElement)) {
|
|
6085
|
+
console.warn("[isNearColumnBoundary] Invalid tableElement: not an HTMLElement", tableElement);
|
|
6086
|
+
return false;
|
|
6087
|
+
}
|
|
6088
|
+
const boundariesAttr = tableElement.getAttribute("data-table-boundaries");
|
|
6089
|
+
if (!boundariesAttr) return false;
|
|
6090
|
+
try {
|
|
6091
|
+
const metadata = JSON.parse(boundariesAttr);
|
|
6092
|
+
if (!metadata.columns || !Array.isArray(metadata.columns)) return false;
|
|
6093
|
+
const zoom = getEditorZoom();
|
|
6094
|
+
const tableRect = tableElement.getBoundingClientRect();
|
|
6095
|
+
const mouseXScreen = event.clientX - tableRect.left;
|
|
6096
|
+
const mouseYScreen = event.clientY - tableRect.top;
|
|
6097
|
+
for (let i2 = 0; i2 < metadata.columns.length; i2++) {
|
|
6098
|
+
const col = metadata.columns[i2];
|
|
6099
|
+
if (!col || typeof col !== "object") {
|
|
6100
|
+
console.warn(`[isNearColumnBoundary] Invalid column at index ${i2}: not an object`, col);
|
|
6101
|
+
continue;
|
|
6102
|
+
}
|
|
6103
|
+
if (typeof col.x !== "number" || !Number.isFinite(col.x)) {
|
|
6104
|
+
console.warn(`[isNearColumnBoundary] Invalid column.x at index ${i2}:`, col.x);
|
|
6105
|
+
continue;
|
|
6106
|
+
}
|
|
6107
|
+
if (typeof col.w !== "number" || !Number.isFinite(col.w) || col.w <= 0) {
|
|
6108
|
+
console.warn(`[isNearColumnBoundary] Invalid column.w at index ${i2}:`, col.w);
|
|
6109
|
+
continue;
|
|
6110
|
+
}
|
|
6111
|
+
const boundaryXScreen = (col.x + col.w) * zoom;
|
|
6112
|
+
if (Math.abs(mouseXScreen - boundaryXScreen) <= TABLE_RESIZE_HOVER_THRESHOLD) {
|
|
6113
|
+
const segmentColIndex = i2 + 1;
|
|
6114
|
+
const segments = metadata.segments?.[segmentColIndex];
|
|
6115
|
+
if (!segments || segments.length === 0) {
|
|
6116
|
+
if (i2 === metadata.columns.length - 1) return true;
|
|
6117
|
+
continue;
|
|
6118
|
+
}
|
|
6119
|
+
for (const seg of segments) {
|
|
6120
|
+
const segTopScreen = (seg.y || 0) * zoom;
|
|
6121
|
+
const segBottomScreen = seg.h != null ? segTopScreen + seg.h * zoom : tableRect.height;
|
|
6122
|
+
if (mouseYScreen >= segTopScreen && mouseYScreen <= segBottomScreen) {
|
|
6123
|
+
return true;
|
|
6124
|
+
}
|
|
6125
|
+
}
|
|
6126
|
+
}
|
|
6127
|
+
}
|
|
6128
|
+
if (Math.abs(mouseXScreen) <= TABLE_RESIZE_HOVER_THRESHOLD) {
|
|
6129
|
+
return true;
|
|
6130
|
+
}
|
|
6131
|
+
return false;
|
|
6132
|
+
} catch (e) {
|
|
6133
|
+
console.warn("[isNearColumnBoundary] Failed to parse table boundary metadata:", e);
|
|
6134
|
+
return false;
|
|
6135
|
+
}
|
|
6136
|
+
};
|
|
5379
6137
|
const updateTableResizeOverlay = (event) => {
|
|
6138
|
+
const now = Date.now();
|
|
6139
|
+
if (now - lastUpdateTableResizeTimestamp < TABLE_RESIZE_THROTTLE_MS) {
|
|
6140
|
+
return;
|
|
6141
|
+
}
|
|
6142
|
+
lastUpdateTableResizeTimestamp = now;
|
|
5380
6143
|
if (!editorElem.value) return;
|
|
5381
6144
|
let target = event.target;
|
|
5382
6145
|
while (target && target !== editorElem.value) {
|
|
@@ -5384,8 +6147,13 @@ const _sfc_main$1 = {
|
|
|
5384
6147
|
return;
|
|
5385
6148
|
}
|
|
5386
6149
|
if (target.classList?.contains("superdoc-table-fragment") && target.hasAttribute("data-table-boundaries")) {
|
|
5387
|
-
|
|
5388
|
-
|
|
6150
|
+
if (isNearColumnBoundary(event, target)) {
|
|
6151
|
+
tableResizeState.visible = true;
|
|
6152
|
+
tableResizeState.tableElement = target;
|
|
6153
|
+
} else {
|
|
6154
|
+
tableResizeState.visible = false;
|
|
6155
|
+
tableResizeState.tableElement = null;
|
|
6156
|
+
}
|
|
5389
6157
|
return;
|
|
5390
6158
|
}
|
|
5391
6159
|
target = target.parentElement;
|
|
@@ -5397,6 +6165,59 @@ const _sfc_main$1 = {
|
|
|
5397
6165
|
tableResizeState.visible = false;
|
|
5398
6166
|
tableResizeState.tableElement = null;
|
|
5399
6167
|
};
|
|
6168
|
+
const updateImageResizeOverlay = (event) => {
|
|
6169
|
+
if (!editorElem.value) return;
|
|
6170
|
+
let target = event.target;
|
|
6171
|
+
while (target && target !== document.body) {
|
|
6172
|
+
if (target.classList?.contains("superdoc-image-resize-overlay") || target.closest?.(".superdoc-image-resize-overlay")) {
|
|
6173
|
+
return;
|
|
6174
|
+
}
|
|
6175
|
+
if (target.classList?.contains("superdoc-image-fragment") && target.hasAttribute("data-image-metadata")) {
|
|
6176
|
+
imageResizeState.visible = true;
|
|
6177
|
+
imageResizeState.imageElement = target;
|
|
6178
|
+
imageResizeState.blockId = target.getAttribute("data-sd-block-id");
|
|
6179
|
+
return;
|
|
6180
|
+
}
|
|
6181
|
+
target = target.parentElement;
|
|
6182
|
+
}
|
|
6183
|
+
imageResizeState.visible = false;
|
|
6184
|
+
imageResizeState.imageElement = null;
|
|
6185
|
+
imageResizeState.blockId = null;
|
|
6186
|
+
};
|
|
6187
|
+
const hideImageResizeOverlay = () => {
|
|
6188
|
+
imageResizeState.visible = false;
|
|
6189
|
+
imageResizeState.imageElement = null;
|
|
6190
|
+
imageResizeState.blockId = null;
|
|
6191
|
+
};
|
|
6192
|
+
const clearSelectedImage = () => {
|
|
6193
|
+
if (selectedImageState.element?.classList?.contains("superdoc-image-selected")) {
|
|
6194
|
+
selectedImageState.element.classList.remove("superdoc-image-selected");
|
|
6195
|
+
}
|
|
6196
|
+
selectedImageState.element = null;
|
|
6197
|
+
selectedImageState.blockId = null;
|
|
6198
|
+
selectedImageState.pmStart = null;
|
|
6199
|
+
};
|
|
6200
|
+
const setSelectedImage = (element, blockId, pmStart) => {
|
|
6201
|
+
if (selectedImageState.element && selectedImageState.element !== element) {
|
|
6202
|
+
selectedImageState.element.classList.remove("superdoc-image-selected");
|
|
6203
|
+
}
|
|
6204
|
+
if (element && element.classList) {
|
|
6205
|
+
element.classList.add("superdoc-image-selected");
|
|
6206
|
+
selectedImageState.element = element;
|
|
6207
|
+
selectedImageState.blockId = blockId ?? null;
|
|
6208
|
+
selectedImageState.pmStart = typeof pmStart === "number" ? pmStart : null;
|
|
6209
|
+
} else {
|
|
6210
|
+
clearSelectedImage();
|
|
6211
|
+
}
|
|
6212
|
+
};
|
|
6213
|
+
const handleOverlayUpdates = (event) => {
|
|
6214
|
+
updateTableResizeOverlay(event);
|
|
6215
|
+
updateImageResizeOverlay(event);
|
|
6216
|
+
};
|
|
6217
|
+
const handleOverlayHide = () => {
|
|
6218
|
+
hideTableResizeOverlay();
|
|
6219
|
+
hideImageResizeOverlay();
|
|
6220
|
+
};
|
|
5400
6221
|
let dataPollTimeout;
|
|
5401
6222
|
const stopPolling = () => {
|
|
5402
6223
|
clearTimeout(dataPollTimeout);
|
|
@@ -5450,17 +6271,36 @@ const _sfc_main$1 = {
|
|
|
5450
6271
|
delete props.options.content;
|
|
5451
6272
|
const ydoc = props.options.ydoc;
|
|
5452
6273
|
const provider = props.options.collaborationProvider;
|
|
5453
|
-
const
|
|
5454
|
-
|
|
5455
|
-
|
|
6274
|
+
const waitForSync = () => {
|
|
6275
|
+
if (provider.isSynced || provider.synced) return Promise.resolve();
|
|
6276
|
+
return new Promise((resolve) => {
|
|
6277
|
+
const onSync = (synced) => {
|
|
6278
|
+
if (synced === false) return;
|
|
6279
|
+
provider.off("synced", onSync);
|
|
6280
|
+
provider.off("sync", onSync);
|
|
6281
|
+
resolve();
|
|
6282
|
+
};
|
|
6283
|
+
provider.on("synced", onSync);
|
|
6284
|
+
provider.on("sync", onSync);
|
|
6285
|
+
});
|
|
5456
6286
|
};
|
|
5457
|
-
|
|
6287
|
+
waitForSync().then(async () => {
|
|
6288
|
+
const metaMap = ydoc.getMap("meta");
|
|
6289
|
+
if (metaMap.has("docx")) {
|
|
6290
|
+
pollForMetaMapData(ydoc);
|
|
6291
|
+
} else {
|
|
6292
|
+
props.options.isNewFile = true;
|
|
6293
|
+
const fileData = await loadNewFileData();
|
|
6294
|
+
if (fileData) initEditor(fileData);
|
|
6295
|
+
}
|
|
6296
|
+
});
|
|
5458
6297
|
}
|
|
5459
6298
|
};
|
|
5460
6299
|
const getExtensions = () => getStarterExtensions();
|
|
5461
6300
|
const initEditor = async ({ content, media = {}, mediaFiles = {}, fonts = {} } = {}) => {
|
|
5462
6301
|
const { editorCtor, ...editorOptions } = props.options || {};
|
|
5463
6302
|
const EditorCtor = editorCtor ?? Editor;
|
|
6303
|
+
clearSelectedImage();
|
|
5464
6304
|
editor.value = new EditorCtor({
|
|
5465
6305
|
mode: "docx",
|
|
5466
6306
|
element: editorElem.value,
|
|
@@ -5477,6 +6317,49 @@ const _sfc_main$1 = {
|
|
|
5477
6317
|
editor: activeEditor.value,
|
|
5478
6318
|
presentationEditor: editor.value instanceof PresentationEditor ? editor.value : null
|
|
5479
6319
|
});
|
|
6320
|
+
if (editor.value instanceof PresentationEditor) {
|
|
6321
|
+
const presentationEditor = editor.value;
|
|
6322
|
+
presentationEditor.on("imageSelected", ({ element, blockId, pmStart }) => {
|
|
6323
|
+
setSelectedImage(element, blockId ?? null, pmStart);
|
|
6324
|
+
});
|
|
6325
|
+
presentationEditor.on("imageDeselected", () => {
|
|
6326
|
+
clearSelectedImage();
|
|
6327
|
+
});
|
|
6328
|
+
presentationEditor.on("layoutUpdated", () => {
|
|
6329
|
+
if (imageResizeState.visible && imageResizeState.blockId) {
|
|
6330
|
+
const escapedBlockId = CSS.escape(imageResizeState.blockId);
|
|
6331
|
+
const newElement = editorElem.value?.querySelector(
|
|
6332
|
+
`.superdoc-image-fragment[data-sd-block-id="${escapedBlockId}"]`
|
|
6333
|
+
);
|
|
6334
|
+
if (newElement) {
|
|
6335
|
+
imageResizeState.imageElement = newElement;
|
|
6336
|
+
} else {
|
|
6337
|
+
imageResizeState.visible = false;
|
|
6338
|
+
imageResizeState.imageElement = null;
|
|
6339
|
+
imageResizeState.blockId = null;
|
|
6340
|
+
}
|
|
6341
|
+
}
|
|
6342
|
+
if (selectedImageState.blockId) {
|
|
6343
|
+
const escapedBlockId = CSS.escape(selectedImageState.blockId);
|
|
6344
|
+
const refreshed = editorElem.value?.querySelector(
|
|
6345
|
+
`.superdoc-image-fragment[data-sd-block-id="${escapedBlockId}"]`
|
|
6346
|
+
);
|
|
6347
|
+
if (refreshed) {
|
|
6348
|
+
setSelectedImage(refreshed, selectedImageState.blockId, selectedImageState.pmStart);
|
|
6349
|
+
} else {
|
|
6350
|
+
if (selectedImageState.pmStart != null) {
|
|
6351
|
+
const pmSelector = `.superdoc-image-fragment[data-pm-start="${selectedImageState.pmStart}"], .superdoc-inline-image[data-pm-start="${selectedImageState.pmStart}"]`;
|
|
6352
|
+
const pmElement = editorElem.value?.querySelector(pmSelector);
|
|
6353
|
+
if (pmElement) {
|
|
6354
|
+
setSelectedImage(pmElement, selectedImageState.blockId, selectedImageState.pmStart);
|
|
6355
|
+
return;
|
|
6356
|
+
}
|
|
6357
|
+
}
|
|
6358
|
+
clearSelectedImage();
|
|
6359
|
+
}
|
|
6360
|
+
}
|
|
6361
|
+
});
|
|
6362
|
+
}
|
|
5480
6363
|
editor.value.on("paginationUpdate", () => {
|
|
5481
6364
|
const base = activeEditor.value;
|
|
5482
6365
|
if (isHeadless(base)) return;
|
|
@@ -5549,6 +6432,7 @@ const _sfc_main$1 = {
|
|
|
5549
6432
|
};
|
|
5550
6433
|
onBeforeUnmount(() => {
|
|
5551
6434
|
stopPolling();
|
|
6435
|
+
clearSelectedImage();
|
|
5552
6436
|
editor.value?.destroy();
|
|
5553
6437
|
editor.value = null;
|
|
5554
6438
|
});
|
|
@@ -5567,8 +6451,8 @@ const _sfc_main$1 = {
|
|
|
5567
6451
|
onKeydown: handleSuperEditorKeydown,
|
|
5568
6452
|
onClick: handleSuperEditorClick,
|
|
5569
6453
|
onMousedown: handleMarginClick,
|
|
5570
|
-
onMousemove:
|
|
5571
|
-
onMouseleave:
|
|
6454
|
+
onMousemove: handleOverlayUpdates,
|
|
6455
|
+
onMouseleave: handleOverlayHide
|
|
5572
6456
|
}, [
|
|
5573
6457
|
createElementVNode("div", {
|
|
5574
6458
|
ref_key: "editorElem",
|
|
@@ -5576,19 +6460,32 @@ const _sfc_main$1 = {
|
|
|
5576
6460
|
class: "editor-element super-editor__element",
|
|
5577
6461
|
role: "presentation"
|
|
5578
6462
|
}, null, 512),
|
|
5579
|
-
!contextMenuDisabled.value && editorReady.value && activeEditor.value ? (openBlock(), createBlock(_sfc_main$
|
|
6463
|
+
!contextMenuDisabled.value && editorReady.value && activeEditor.value ? (openBlock(), createBlock(_sfc_main$8, {
|
|
5580
6464
|
key: 0,
|
|
5581
6465
|
editor: activeEditor.value,
|
|
5582
6466
|
popoverControls,
|
|
5583
6467
|
openPopover,
|
|
5584
6468
|
closePopover
|
|
5585
6469
|
}, null, 8, ["editor", "popoverControls"])) : createCommentVNode("", true),
|
|
5586
|
-
editorReady.value && activeEditor.value ? (openBlock(), createBlock(
|
|
6470
|
+
editorReady.value && activeEditor.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
5587
6471
|
key: 1,
|
|
5588
6472
|
editor: activeEditor.value,
|
|
6473
|
+
openPopover,
|
|
6474
|
+
closePopover,
|
|
6475
|
+
popoverVisible: popoverControls.visible
|
|
6476
|
+
}, null, 8, ["editor", "popoverVisible"])) : createCommentVNode("", true),
|
|
6477
|
+
editorReady.value && activeEditor.value ? (openBlock(), createBlock(TableResizeOverlay, {
|
|
6478
|
+
key: 2,
|
|
6479
|
+
editor: activeEditor.value,
|
|
5589
6480
|
visible: tableResizeState.visible,
|
|
5590
6481
|
tableElement: tableResizeState.tableElement
|
|
5591
|
-
}, null, 8, ["editor", "visible", "tableElement"])) : createCommentVNode("", true)
|
|
6482
|
+
}, null, 8, ["editor", "visible", "tableElement"])) : createCommentVNode("", true),
|
|
6483
|
+
editorReady.value && activeEditor.value ? (openBlock(), createBlock(ImageResizeOverlay, {
|
|
6484
|
+
key: 3,
|
|
6485
|
+
editor: activeEditor.value,
|
|
6486
|
+
visible: imageResizeState.visible,
|
|
6487
|
+
imageElement: imageResizeState.imageElement
|
|
6488
|
+
}, null, 8, ["editor", "visible", "imageElement"])) : createCommentVNode("", true)
|
|
5592
6489
|
], 544),
|
|
5593
6490
|
!editorReady.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
5594
6491
|
createElementVNode("div", _hoisted_3, [
|
|
@@ -5650,8 +6547,8 @@ const _sfc_main$1 = {
|
|
|
5650
6547
|
]);
|
|
5651
6548
|
};
|
|
5652
6549
|
}
|
|
5653
|
-
};
|
|
5654
|
-
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
6550
|
+
});
|
|
6551
|
+
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-a935d3e2"]]);
|
|
5655
6552
|
const _hoisted_1 = ["innerHTML"];
|
|
5656
6553
|
const _sfc_main = {
|
|
5657
6554
|
__name: "SuperInput",
|
|
@@ -5743,98 +6640,6 @@ const _sfc_main = {
|
|
|
5743
6640
|
}
|
|
5744
6641
|
};
|
|
5745
6642
|
const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
|
|
5746
|
-
const additionalHandlers = Object.freeze({
|
|
5747
|
-
"mc:AlternateContent": translator$1j,
|
|
5748
|
-
"sd:pageReference": translator$1i,
|
|
5749
|
-
"sd:tableOfContents": translator$1h,
|
|
5750
|
-
"w:b": translator$1g,
|
|
5751
|
-
"w:bCs": translator$1f,
|
|
5752
|
-
"w:bidiVisual": translator$1e,
|
|
5753
|
-
"w:bookmarkEnd": translator$1d,
|
|
5754
|
-
"w:bookmarkStart": translator$1c,
|
|
5755
|
-
"w:bottom": translator$1b,
|
|
5756
|
-
"w:br": translator$1a,
|
|
5757
|
-
"w:cantSplit": translator$19,
|
|
5758
|
-
"w:caps": translator$18,
|
|
5759
|
-
"w:cnfStyle": translator$17,
|
|
5760
|
-
"w:color": translator$16,
|
|
5761
|
-
"w:divId": translator$15,
|
|
5762
|
-
"w:drawing": translator$14,
|
|
5763
|
-
"w:end": translator$13,
|
|
5764
|
-
"w:gridAfter": translator$12,
|
|
5765
|
-
"w:gridBefore": translator$11,
|
|
5766
|
-
"w:gridCol": translator$10,
|
|
5767
|
-
"w:hidden": translator$$,
|
|
5768
|
-
"w:highlight": translator$_,
|
|
5769
|
-
"w:hyperlink": translator$Z,
|
|
5770
|
-
"w:i": translator$Y,
|
|
5771
|
-
"w:insideH": translator$X,
|
|
5772
|
-
"w:insideV": translator$W,
|
|
5773
|
-
"w:jc": translator$V,
|
|
5774
|
-
"w:left": translator$U,
|
|
5775
|
-
"w:p": translator$T,
|
|
5776
|
-
"w:r": translator$S,
|
|
5777
|
-
"w:rFonts": translator$R,
|
|
5778
|
-
"w:rPr": translator$Q,
|
|
5779
|
-
"w:rStyle": translator$P,
|
|
5780
|
-
"w:right": translator$O,
|
|
5781
|
-
"w:sdt": translator$N,
|
|
5782
|
-
"w:shd": translator$M,
|
|
5783
|
-
"w:start": translator$L,
|
|
5784
|
-
"w:strike": translator$K,
|
|
5785
|
-
"w:sz": translator$J,
|
|
5786
|
-
"w:szCs": translator$I,
|
|
5787
|
-
"w:tab": translator$H,
|
|
5788
|
-
"w:tbl": translator$G,
|
|
5789
|
-
"w:tblBorders": translator$F,
|
|
5790
|
-
"w:tblCaption": translator$E,
|
|
5791
|
-
"w:tblCellMar": translator$D,
|
|
5792
|
-
"w:tblCellSpacing": translator$C,
|
|
5793
|
-
"w:tblDescription": translator$B,
|
|
5794
|
-
"w:tblGrid": translator$A,
|
|
5795
|
-
"w:tblHeader": translator$z,
|
|
5796
|
-
"w:tblInd": translator$y,
|
|
5797
|
-
"w:tblLayout": translator$x,
|
|
5798
|
-
"w:tblLook": translator$w,
|
|
5799
|
-
"w:tblOverlap": translator$v,
|
|
5800
|
-
"w:tblPr": translator$u,
|
|
5801
|
-
"w:tblStyle": translator$t,
|
|
5802
|
-
"w:tblStyleColBandSize": translator$s,
|
|
5803
|
-
"w:tblStyleRowBandSize": translator$r,
|
|
5804
|
-
"w:tblW": translator$q,
|
|
5805
|
-
"w:tblpPr": translator$p,
|
|
5806
|
-
"w:tc": translator$o,
|
|
5807
|
-
"w:top": translator$n,
|
|
5808
|
-
"w:tr": translator$m,
|
|
5809
|
-
"w:trHeight": translator$l,
|
|
5810
|
-
"w:trPr": translator$k,
|
|
5811
|
-
"w:u": translator$j,
|
|
5812
|
-
"w:wAfter": translator$i,
|
|
5813
|
-
"w:wBefore": translator$h,
|
|
5814
|
-
"wp:anchor": translator$g,
|
|
5815
|
-
"wp:inline": translator$f,
|
|
5816
|
-
"w:commentRangeStart": commentRangeStartTranslator,
|
|
5817
|
-
"w:commentRangeEnd": commentRangeEndTranslator,
|
|
5818
|
-
"w:vMerge": translator$e,
|
|
5819
|
-
"w:gridSpan": translator$d,
|
|
5820
|
-
"w:vAlign": translator$c,
|
|
5821
|
-
"w:noWrap": translator$b,
|
|
5822
|
-
"w:tcFitText": translator$a,
|
|
5823
|
-
"w:tcW": translator$9,
|
|
5824
|
-
"w:hideMark": translator$8,
|
|
5825
|
-
"w:textDirection": translator$7,
|
|
5826
|
-
"w:tl2br": translator$6,
|
|
5827
|
-
"w:tr2bl": translator$5,
|
|
5828
|
-
"w:header": translator$4,
|
|
5829
|
-
"w:headers": translator$3,
|
|
5830
|
-
"w:tcBorders": translator$2,
|
|
5831
|
-
"w:tcMar": translator$1,
|
|
5832
|
-
"w:tcPr": translator
|
|
5833
|
-
});
|
|
5834
|
-
const baseHandlers = {
|
|
5835
|
-
...additionalHandlers
|
|
5836
|
-
};
|
|
5837
|
-
const registeredHandlers = Object.freeze(baseHandlers);
|
|
5838
6643
|
const Extensions = {
|
|
5839
6644
|
Node,
|
|
5840
6645
|
Attribute,
|
|
@@ -5849,14 +6654,14 @@ const Extensions = {
|
|
|
5849
6654
|
export {
|
|
5850
6655
|
AIWriter,
|
|
5851
6656
|
z as AnnotatorHelpers,
|
|
5852
|
-
_sfc_main$
|
|
6657
|
+
_sfc_main$7 as BasicUpload,
|
|
5853
6658
|
F as CommentsPluginKey,
|
|
5854
6659
|
D as DocxZipper,
|
|
5855
6660
|
Editor,
|
|
5856
6661
|
Extensions,
|
|
5857
6662
|
PresentationEditor,
|
|
5858
6663
|
B as SectionHelpers,
|
|
5859
|
-
_sfc_main$
|
|
6664
|
+
_sfc_main$8 as SlashMenu,
|
|
5860
6665
|
ac as SuperConverter,
|
|
5861
6666
|
SuperEditor,
|
|
5862
6667
|
SuperInput,
|
|
@@ -5871,6 +6676,6 @@ export {
|
|
|
5871
6676
|
getRichTextExtensions,
|
|
5872
6677
|
getStarterExtensions,
|
|
5873
6678
|
a9 as helpers,
|
|
5874
|
-
registeredHandlers,
|
|
6679
|
+
aQ as registeredHandlers,
|
|
5875
6680
|
x as trackChangesHelpers
|
|
5876
6681
|
};
|