superdoc 1.0.0-beta.8 → 1.0.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/chunks/{PdfViewer-DJ7BWUbW.cjs → PdfViewer-C3_5zd7y.cjs} +2 -2
- package/dist/chunks/{PdfViewer-BfEwF25T.es.js → PdfViewer-OoqzzuS4.es.js} +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-BCZ82zY5.es.js → index-BwFit1xu.es.js} +112 -41
- package/dist/chunks/{index-DJrRlj1_-HA-nVwDO.es.js → index-CDIpuWy0-DcqcEnVR.es.js} +1 -1
- package/dist/chunks/{index-DJrRlj1_-E5dmStMF.cjs → index-CDIpuWy0-v1ZRfNmH.cjs} +1 -1
- package/dist/chunks/{index-DMwWcmrk.cjs → index-CVDEHD5c.cjs} +112 -41
- 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-Bo_fWMy6.cjs → super-editor.es-CWr0w1Tk.cjs} +37747 -20889
- package/dist/chunks/{super-editor.es-MRWI4sfo.es.js → super-editor.es-Ddl20DOa.es.js} +37747 -20889
- 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 +90 -51
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CflxlFnM.js → converter-CuIVo-Y-.js} +7295 -811
- package/dist/super-editor/chunks/{docx-zipper-DKWL4mo2.js → docx-zipper-D24ieyrf.js} +15 -11
- package/dist/super-editor/chunks/{editor-B9V7oJbW.js → editor-DyocbwIp.js} +18722 -8867
- package/dist/super-editor/chunks/{index-DJrRlj1_.js → index-CDIpuWy0.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-B5WlPN4s.js → toolbar-WQTQjgeN.js} +36 -22
- 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 +57 -18
- package/dist/super-editor/super-editor.es.js +1025 -226
- 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 +37527 -20522
- 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-CuIVo-Y-.js";
|
|
13
|
+
import { ac, i, a9, aQ } from "./chunks/converter-CuIVo-Y-.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-DyocbwIp.js";
|
|
15
|
+
import { z, F, B, T, w, C, x } from "./chunks/editor-DyocbwIp.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-WQTQjgeN.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-D24ieyrf.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,20 +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
496
|
class: "linked-style-buttons",
|
|
497
497
|
"data-editor-ui-surface": ""
|
|
498
498
|
};
|
|
499
499
|
const _hoisted_2$8 = ["onClick", "onKeydown", "aria-label"];
|
|
500
|
-
const _sfc_main$
|
|
500
|
+
const _sfc_main$f = {
|
|
501
501
|
__name: "LinkedStyle",
|
|
502
502
|
props: {
|
|
503
503
|
editor: {
|
|
@@ -551,7 +551,7 @@ const _sfc_main$d = {
|
|
|
551
551
|
styleRefs.value[0].focus();
|
|
552
552
|
});
|
|
553
553
|
return (_ctx, _cache) => {
|
|
554
|
-
return props.editor ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
554
|
+
return props.editor ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
555
555
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getQuickFormatList)(__props.editor), (style, index) => {
|
|
556
556
|
return openBlock(), createElementBlock("div", {
|
|
557
557
|
class: normalizeClass(["style-item", { selected: __props.selectedOption === style.id }]),
|
|
@@ -573,8 +573,8 @@ const _sfc_main$d = {
|
|
|
573
573
|
};
|
|
574
574
|
}
|
|
575
575
|
};
|
|
576
|
-
const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
577
|
-
const _hoisted_1$
|
|
576
|
+
const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-ecb78965"]]);
|
|
577
|
+
const _hoisted_1$c = {
|
|
578
578
|
key: 0,
|
|
579
579
|
class: "link-title"
|
|
580
580
|
};
|
|
@@ -602,7 +602,7 @@ const _hoisted_13 = {
|
|
|
602
602
|
key: 4,
|
|
603
603
|
class: "input-row go-to-anchor clickable"
|
|
604
604
|
};
|
|
605
|
-
const _sfc_main$
|
|
605
|
+
const _sfc_main$e = {
|
|
606
606
|
__name: "LinkInput",
|
|
607
607
|
props: {
|
|
608
608
|
showInput: {
|
|
@@ -741,7 +741,7 @@ const _sfc_main$c = {
|
|
|
741
741
|
return openBlock(), createElementBlock("div", {
|
|
742
742
|
class: normalizeClass(["link-input-ctn", { "high-contrast": unref(isHighContrastMode) }])
|
|
743
743
|
}, [
|
|
744
|
-
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")),
|
|
745
745
|
__props.showInput && !isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
746
746
|
createElementVNode("div", _hoisted_5$1, [
|
|
747
747
|
_cache[4] || (_cache[4] = createElementVNode("div", { class: "input-icon text-input-icon" }, "T", -1)),
|
|
@@ -808,12 +808,12 @@ const _sfc_main$c = {
|
|
|
808
808
|
};
|
|
809
809
|
}
|
|
810
810
|
};
|
|
811
|
-
const LinkInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
812
|
-
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"];
|
|
813
813
|
const _hoisted_2$6 = ["innerHTML"];
|
|
814
814
|
const _hoisted_3$5 = ["innerHTML"];
|
|
815
815
|
const ROW_SIZE$1 = 7;
|
|
816
|
-
const _sfc_main$
|
|
816
|
+
const _sfc_main$d = {
|
|
817
817
|
__name: "IconGridRow",
|
|
818
818
|
props: {
|
|
819
819
|
icons: {
|
|
@@ -939,19 +939,19 @@ const _sfc_main$b = {
|
|
|
939
939
|
innerHTML: unref(toolbarIcons).colorOptionCheck,
|
|
940
940
|
style: normalizeStyle(getCheckStyle(option.value, optionIndex))
|
|
941
941
|
}, null, 12, _hoisted_3$5)) : createCommentVNode("", true)
|
|
942
|
-
], 40, _hoisted_1$
|
|
942
|
+
], 40, _hoisted_1$b);
|
|
943
943
|
}), 128))
|
|
944
944
|
]);
|
|
945
945
|
}), 128);
|
|
946
946
|
};
|
|
947
947
|
}
|
|
948
948
|
};
|
|
949
|
-
const IconGridRow = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
949
|
+
const IconGridRow = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-0f479b6c"]]);
|
|
950
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';
|
|
951
|
-
const _hoisted_1$
|
|
951
|
+
const _hoisted_1$a = { class: "options-grid-wrap" };
|
|
952
952
|
const _hoisted_2$5 = ["innerHTML"];
|
|
953
953
|
const _hoisted_3$4 = { class: "option-grid-ctn" };
|
|
954
|
-
const _sfc_main$
|
|
954
|
+
const _sfc_main$c = {
|
|
955
955
|
__name: "IconGrid",
|
|
956
956
|
props: {
|
|
957
957
|
icons: {
|
|
@@ -978,7 +978,7 @@ const _sfc_main$a = {
|
|
|
978
978
|
emit("select", option);
|
|
979
979
|
};
|
|
980
980
|
return (_ctx, _cache) => {
|
|
981
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
981
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
982
982
|
__props.hasNoneIcon ? (openBlock(), createElementBlock("div", {
|
|
983
983
|
key: 0,
|
|
984
984
|
class: "none-option",
|
|
@@ -1011,7 +1011,7 @@ const _sfc_main$a = {
|
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
1013
|
};
|
|
1014
|
-
const IconGrid = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1014
|
+
const IconGrid = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-3d19fedf"]]);
|
|
1015
1015
|
const closeDropdown$1 = (dropdown) => {
|
|
1016
1016
|
dropdown.expand.value = false;
|
|
1017
1017
|
};
|
|
@@ -1120,10 +1120,10 @@ const icons = [
|
|
|
1120
1120
|
const getAvailableColorOptions = () => {
|
|
1121
1121
|
return icons.flat().map((item) => item.value);
|
|
1122
1122
|
};
|
|
1123
|
-
const _hoisted_1$
|
|
1123
|
+
const _hoisted_1$9 = ["data-cols", "data-rows", "onKeydown", "onClick"];
|
|
1124
1124
|
const _hoisted_2$4 = ["aria-valuetext"];
|
|
1125
1125
|
const ROW_SIZE = 5;
|
|
1126
|
-
const _sfc_main$
|
|
1126
|
+
const _sfc_main$b = {
|
|
1127
1127
|
__name: "TableGrid",
|
|
1128
1128
|
emits: ["select", "clickoutside"],
|
|
1129
1129
|
setup(__props, { emit: __emit }) {
|
|
@@ -1239,7 +1239,7 @@ const _sfc_main$9 = {
|
|
|
1239
1239
|
ref: tableGridItems,
|
|
1240
1240
|
onKeydown: withModifiers((event) => handleKeyDown(event, n, i2), ["prevent"]),
|
|
1241
1241
|
onClick: withModifiers(($event) => handleClick({ cols: n, rows: i2 }), ["stop", "prevent"])
|
|
1242
|
-
}, null, 40, _hoisted_1$
|
|
1242
|
+
}, null, 40, _hoisted_1$9);
|
|
1243
1243
|
}), 64))
|
|
1244
1244
|
], 64);
|
|
1245
1245
|
}), 64))
|
|
@@ -1252,13 +1252,13 @@ const _sfc_main$9 = {
|
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
1254
|
};
|
|
1255
|
-
const TableGrid = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1256
|
-
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" };
|
|
1257
1257
|
const _hoisted_2$3 = ["onClick", "data-item", "ariaLabel"];
|
|
1258
1258
|
const _hoisted_3$3 = { class: "toolbar-table-actions__icon" };
|
|
1259
1259
|
const _hoisted_4$1 = ["innerHTML"];
|
|
1260
1260
|
const _hoisted_5 = { class: "toolbar-table-actions__label" };
|
|
1261
|
-
const _sfc_main$
|
|
1261
|
+
const _sfc_main$a = {
|
|
1262
1262
|
__name: "TableActions",
|
|
1263
1263
|
props: {
|
|
1264
1264
|
options: {
|
|
@@ -1272,7 +1272,7 @@ const _sfc_main$8 = {
|
|
|
1272
1272
|
emit("select", { command: item.command });
|
|
1273
1273
|
};
|
|
1274
1274
|
return (_ctx, _cache) => {
|
|
1275
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1275
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1276
1276
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
|
|
1277
1277
|
return openBlock(), createElementBlock("div", {
|
|
1278
1278
|
class: normalizeClass(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": option.bottomBorder }]),
|
|
@@ -1294,7 +1294,7 @@ const _sfc_main$8 = {
|
|
|
1294
1294
|
};
|
|
1295
1295
|
}
|
|
1296
1296
|
};
|
|
1297
|
-
const TableActions = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1297
|
+
const TableActions = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-990b9a25"]]);
|
|
1298
1298
|
function getScrollableParent(element) {
|
|
1299
1299
|
let currentElement = element;
|
|
1300
1300
|
while (currentElement) {
|
|
@@ -1318,10 +1318,10 @@ function scrollToElement(targetElement, options = { behavior: "smooth", block: "
|
|
|
1318
1318
|
});
|
|
1319
1319
|
}
|
|
1320
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';
|
|
1321
|
-
const _hoisted_1$
|
|
1321
|
+
const _hoisted_1$7 = { class: "search-input-ctn" };
|
|
1322
1322
|
const _hoisted_2$2 = { class: "row" };
|
|
1323
1323
|
const _hoisted_3$2 = ["onKeydown"];
|
|
1324
|
-
const _sfc_main$
|
|
1324
|
+
const _sfc_main$9 = {
|
|
1325
1325
|
__name: "SearchInput",
|
|
1326
1326
|
props: {
|
|
1327
1327
|
searchRef: {
|
|
@@ -1336,7 +1336,7 @@ const _sfc_main$7 = {
|
|
|
1336
1336
|
emit("submit", { value: searchValue.value });
|
|
1337
1337
|
};
|
|
1338
1338
|
return (_ctx, _cache) => {
|
|
1339
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1339
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1340
1340
|
createElementVNode("div", _hoisted_2$2, [
|
|
1341
1341
|
withDirectives(createElementVNode("input", {
|
|
1342
1342
|
ref: __props.searchRef,
|
|
@@ -1360,7 +1360,7 @@ const _sfc_main$7 = {
|
|
|
1360
1360
|
};
|
|
1361
1361
|
}
|
|
1362
1362
|
};
|
|
1363
|
-
const SearchInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1363
|
+
const SearchInput = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-957cbcf2"]]);
|
|
1364
1364
|
const TOOLBAR_FONTS = [
|
|
1365
1365
|
{
|
|
1366
1366
|
label: "Georgia",
|
|
@@ -2556,16 +2556,6 @@ const _SuperToolbar = class _SuperToolbar extends EventEmitter {
|
|
|
2556
2556
|
if (!argument) return;
|
|
2557
2557
|
item.onActivate({ zoom: argument });
|
|
2558
2558
|
this.emit("superdoc-command", { item, argument });
|
|
2559
|
-
const layers = this.superdoc.element?.querySelector(".layers");
|
|
2560
|
-
if (!layers) return;
|
|
2561
|
-
const isMobileDevice = typeof screen.orientation !== "undefined";
|
|
2562
|
-
const isSmallScreen = window.matchMedia("(max-width: 834px)").matches;
|
|
2563
|
-
if (isMobileDevice && isSmallScreen) {
|
|
2564
|
-
layers.style.transformOrigin = "0 0";
|
|
2565
|
-
layers.style.transform = `scale(${parseInt(argument, 10) / 100})`;
|
|
2566
|
-
} else {
|
|
2567
|
-
layers.style.zoom = parseInt(argument, 10) / 100;
|
|
2568
|
-
}
|
|
2569
2559
|
this.superdoc.superdocStore.activeZoom = parseInt(argument, 10);
|
|
2570
2560
|
},
|
|
2571
2561
|
/**
|
|
@@ -2970,6 +2960,10 @@ const _SuperToolbar = class _SuperToolbar extends EventEmitter {
|
|
|
2970
2960
|
return;
|
|
2971
2961
|
}
|
|
2972
2962
|
const { state } = this.activeEditor;
|
|
2963
|
+
if (!state) {
|
|
2964
|
+
__privateMethod(this, _SuperToolbar_instances, deactivateAll_fn).call(this);
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2973
2967
|
const selection = state.selection;
|
|
2974
2968
|
const selectionTrackedChanges = __privateMethod(this, _SuperToolbar_instances, enrichTrackedChanges_fn).call(this, collectTrackedChanges({ state, from: selection.from, to: selection.to }));
|
|
2975
2969
|
const hasTrackedChanges = selectionTrackedChanges.length > 0;
|
|
@@ -4212,7 +4206,7 @@ function getItems(context, customItems = [], includeDefaultItems = true) {
|
|
|
4212
4206
|
}).filter((section) => section.items.length > 0);
|
|
4213
4207
|
return filteredSections;
|
|
4214
4208
|
}
|
|
4215
|
-
const _hoisted_1$
|
|
4209
|
+
const _hoisted_1$6 = { class: "slash-menu-items" };
|
|
4216
4210
|
const _hoisted_2$1 = {
|
|
4217
4211
|
key: 0,
|
|
4218
4212
|
class: "slash-menu-divider",
|
|
@@ -4220,7 +4214,7 @@ const _hoisted_2$1 = {
|
|
|
4220
4214
|
};
|
|
4221
4215
|
const _hoisted_3$1 = ["onClick"];
|
|
4222
4216
|
const _hoisted_4 = ["innerHTML"];
|
|
4223
|
-
const _sfc_main$
|
|
4217
|
+
const _sfc_main$8 = {
|
|
4224
4218
|
__name: "SlashMenu",
|
|
4225
4219
|
props: {
|
|
4226
4220
|
editor: {
|
|
@@ -4348,7 +4342,7 @@ const _sfc_main$6 = {
|
|
|
4348
4342
|
customItemRefs.clear();
|
|
4349
4343
|
};
|
|
4350
4344
|
const handleGlobalKeyDown = (event) => {
|
|
4351
|
-
if (event.key === "Escape") {
|
|
4345
|
+
if (event.key === "Escape" && isOpen.value) {
|
|
4352
4346
|
event.preventDefault();
|
|
4353
4347
|
event.stopPropagation();
|
|
4354
4348
|
closeMenu();
|
|
@@ -4536,7 +4530,7 @@ const _sfc_main$6 = {
|
|
|
4536
4530
|
}, null, 544), [
|
|
4537
4531
|
[vModelText, searchQuery.value]
|
|
4538
4532
|
]),
|
|
4539
|
-
createElementVNode("div", _hoisted_1$
|
|
4533
|
+
createElementVNode("div", _hoisted_1$6, [
|
|
4540
4534
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredSections.value, (section, sectionIndex) => {
|
|
4541
4535
|
return openBlock(), createElementBlock(Fragment, {
|
|
4542
4536
|
key: section.id
|
|
@@ -4571,8 +4565,8 @@ const _sfc_main$6 = {
|
|
|
4571
4565
|
};
|
|
4572
4566
|
}
|
|
4573
4567
|
};
|
|
4574
|
-
const _hoisted_1$
|
|
4575
|
-
const _sfc_main$
|
|
4568
|
+
const _hoisted_1$5 = ["accept"];
|
|
4569
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
4576
4570
|
__name: "BasicUpload",
|
|
4577
4571
|
props: {
|
|
4578
4572
|
accept: { default: ".docx, .pdf, .html, .md" }
|
|
@@ -4593,15 +4587,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4593
4587
|
id: "fileInput",
|
|
4594
4588
|
onChange: onFileChange,
|
|
4595
4589
|
accept: __props.accept
|
|
4596
|
-
}, null, 40, _hoisted_1$
|
|
4590
|
+
}, null, 40, _hoisted_1$5)
|
|
4597
4591
|
]);
|
|
4598
4592
|
};
|
|
4599
4593
|
}
|
|
4600
4594
|
});
|
|
4601
|
-
const _hoisted_1$
|
|
4595
|
+
const _hoisted_1$4 = { class: "numbering" };
|
|
4602
4596
|
const MIN_WIDTH = 200;
|
|
4603
4597
|
const alignment = "flex-end";
|
|
4604
|
-
const _sfc_main$
|
|
4598
|
+
const _sfc_main$6 = {
|
|
4605
4599
|
__name: "Ruler",
|
|
4606
4600
|
props: {
|
|
4607
4601
|
orientation: {
|
|
@@ -4786,7 +4780,7 @@ const _sfc_main$4 = {
|
|
|
4786
4780
|
class: normalizeClass(unit.className),
|
|
4787
4781
|
style: normalizeStyle(getStyle.value(unit))
|
|
4788
4782
|
}, [
|
|
4789
|
-
createElementVNode("div", _hoisted_1$
|
|
4783
|
+
createElementVNode("div", _hoisted_1$4, toDisplayString(unit.numbering), 1),
|
|
4790
4784
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unit.elements, (half) => {
|
|
4791
4785
|
return openBlock(), createElementBlock("div", {
|
|
4792
4786
|
class: normalizeClass(half.className),
|
|
@@ -4806,8 +4800,8 @@ const _sfc_main$4 = {
|
|
|
4806
4800
|
};
|
|
4807
4801
|
}
|
|
4808
4802
|
};
|
|
4809
|
-
const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4810
|
-
const _sfc_main$
|
|
4803
|
+
const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-79f9a944"]]);
|
|
4804
|
+
const _sfc_main$5 = {
|
|
4811
4805
|
__name: "GenericPopover",
|
|
4812
4806
|
props: {
|
|
4813
4807
|
editor: { type: Object, required: true },
|
|
@@ -4835,22 +4829,22 @@ const _sfc_main$3 = {
|
|
|
4835
4829
|
() => props.visible,
|
|
4836
4830
|
(val) => {
|
|
4837
4831
|
if (val) {
|
|
4838
|
-
document.addEventListener("
|
|
4832
|
+
document.addEventListener("pointerdown", handleClickOutside);
|
|
4839
4833
|
document.addEventListener("keydown", handleEscape);
|
|
4840
4834
|
} else {
|
|
4841
|
-
document.removeEventListener("
|
|
4835
|
+
document.removeEventListener("pointerdown", handleClickOutside);
|
|
4842
4836
|
document.removeEventListener("keydown", handleEscape);
|
|
4843
4837
|
}
|
|
4844
4838
|
}
|
|
4845
4839
|
);
|
|
4846
4840
|
onMounted(() => {
|
|
4847
4841
|
if (props.visible) {
|
|
4848
|
-
document.addEventListener("
|
|
4842
|
+
document.addEventListener("pointerdown", handleClickOutside);
|
|
4849
4843
|
document.addEventListener("keydown", handleEscape);
|
|
4850
4844
|
}
|
|
4851
4845
|
});
|
|
4852
4846
|
onBeforeUnmount(() => {
|
|
4853
|
-
document.removeEventListener("
|
|
4847
|
+
document.removeEventListener("pointerdown", handleClickOutside);
|
|
4854
4848
|
document.removeEventListener("keydown", handleEscape);
|
|
4855
4849
|
});
|
|
4856
4850
|
const derivedStyles = computed(() => ({
|
|
@@ -4865,7 +4859,7 @@ const _sfc_main$3 = {
|
|
|
4865
4859
|
style: normalizeStyle(derivedStyles.value),
|
|
4866
4860
|
ref_key: "popover",
|
|
4867
4861
|
ref: popover,
|
|
4868
|
-
|
|
4862
|
+
onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
4869
4863
|
}, ["stop"])),
|
|
4870
4864
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
4871
4865
|
}, ["stop"]))
|
|
@@ -4875,9 +4869,15 @@ const _sfc_main$3 = {
|
|
|
4875
4869
|
};
|
|
4876
4870
|
}
|
|
4877
4871
|
};
|
|
4878
|
-
const GenericPopover = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4879
|
-
const _hoisted_1$
|
|
4880
|
-
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 = {
|
|
4881
4881
|
__name: "TableResizeOverlay",
|
|
4882
4882
|
props: {
|
|
4883
4883
|
/** Editor instance for dispatching transactions */
|
|
@@ -4900,26 +4900,86 @@ const _sfc_main$2 = {
|
|
|
4900
4900
|
setup(__props, { emit: __emit }) {
|
|
4901
4901
|
const props = __props;
|
|
4902
4902
|
const emit = __emit;
|
|
4903
|
+
const overlayRect = ref(null);
|
|
4903
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
|
+
};
|
|
4904
4918
|
const dragState = ref(null);
|
|
4905
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
|
+
}
|
|
4906
4936
|
const overlayStyle = computed(() => {
|
|
4907
|
-
if (!props.tableElement) return {};
|
|
4908
|
-
const rect =
|
|
4937
|
+
if (!overlayRect.value || !props.tableElement) return {};
|
|
4938
|
+
const rect = overlayRect.value;
|
|
4909
4939
|
let overlayWidth = rect.width;
|
|
4910
4940
|
if (dragState.value) {
|
|
4911
|
-
overlayWidth = Math.max(rect.width +
|
|
4941
|
+
overlayWidth = Math.max(rect.width + DRAG_OVERLAY_EXTENSION_PX, MIN_DRAG_OVERLAY_WIDTH_PX);
|
|
4912
4942
|
}
|
|
4913
4943
|
return {
|
|
4914
4944
|
position: "absolute",
|
|
4915
|
-
left: `${
|
|
4916
|
-
top: `${
|
|
4945
|
+
left: `${rect.left}px`,
|
|
4946
|
+
top: `${rect.top}px`,
|
|
4917
4947
|
width: `${overlayWidth}px`,
|
|
4918
4948
|
height: `${rect.height}px`,
|
|
4919
4949
|
pointerEvents: dragState.value ? "auto" : "none",
|
|
4920
4950
|
zIndex: 10
|
|
4921
4951
|
};
|
|
4922
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
|
+
}
|
|
4923
4983
|
const resizableBoundaries = computed(() => {
|
|
4924
4984
|
if (!tableMetadata.value?.columns) {
|
|
4925
4985
|
return [];
|
|
@@ -4945,23 +5005,46 @@ const _sfc_main$2 = {
|
|
|
4945
5005
|
});
|
|
4946
5006
|
return boundaries;
|
|
4947
5007
|
});
|
|
4948
|
-
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;
|
|
4949
5031
|
return {
|
|
4950
5032
|
position: "absolute",
|
|
4951
|
-
left: `${
|
|
4952
|
-
top: "0",
|
|
4953
|
-
width:
|
|
4954
|
-
height: "100%",
|
|
4955
|
-
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)`,
|
|
4956
5038
|
cursor: "col-resize",
|
|
4957
5039
|
pointerEvents: "auto"
|
|
4958
5040
|
};
|
|
4959
5041
|
}
|
|
4960
5042
|
const guidelineStyle = computed(() => {
|
|
4961
5043
|
if (!dragState.value || !tableMetadata.value) return { display: "none" };
|
|
4962
|
-
const initialBoundary = resizableBoundaries.value[dragState.value.
|
|
5044
|
+
const initialBoundary = resizableBoundaries.value[dragState.value.resizableBoundaryIndex];
|
|
4963
5045
|
if (!initialBoundary) return { display: "none" };
|
|
4964
|
-
const
|
|
5046
|
+
const zoom = getZoom();
|
|
5047
|
+
const newX = (initialBoundary.x + dragState.value.constrainedDelta) * zoom;
|
|
4965
5048
|
return {
|
|
4966
5049
|
position: "absolute",
|
|
4967
5050
|
left: `${newX}px`,
|
|
@@ -5006,7 +5089,8 @@ const _sfc_main$2 = {
|
|
|
5006
5089
|
});
|
|
5007
5090
|
return;
|
|
5008
5091
|
}
|
|
5009
|
-
|
|
5092
|
+
const segments = Array.isArray(parsed.segments) ? parsed.segments : void 0;
|
|
5093
|
+
tableMetadata.value = { columns: validatedColumns, segments };
|
|
5010
5094
|
} catch (error) {
|
|
5011
5095
|
tableMetadata.value = null;
|
|
5012
5096
|
emit("resize-error", {
|
|
@@ -5015,11 +5099,11 @@ const _sfc_main$2 = {
|
|
|
5015
5099
|
});
|
|
5016
5100
|
}
|
|
5017
5101
|
}
|
|
5018
|
-
function onHandleMouseDown(event,
|
|
5102
|
+
function onHandleMouseDown(event, resizableBoundaryIndex) {
|
|
5019
5103
|
event.preventDefault();
|
|
5020
5104
|
event.stopPropagation();
|
|
5021
5105
|
if (!tableMetadata.value?.columns) return;
|
|
5022
|
-
const boundary = resizableBoundaries.value[
|
|
5106
|
+
const boundary = resizableBoundaries.value[resizableBoundaryIndex];
|
|
5023
5107
|
if (!boundary) return;
|
|
5024
5108
|
const columns = tableMetadata.value.columns;
|
|
5025
5109
|
const isRightEdge = boundary.type === "right-edge";
|
|
@@ -5027,7 +5111,7 @@ const _sfc_main$2 = {
|
|
|
5027
5111
|
const rightColumn = isRightEdge ? null : columns[boundary.index + 1];
|
|
5028
5112
|
dragState.value = {
|
|
5029
5113
|
columnIndex: boundary.index,
|
|
5030
|
-
|
|
5114
|
+
resizableBoundaryIndex,
|
|
5031
5115
|
isRightEdge,
|
|
5032
5116
|
initialX: event.clientX,
|
|
5033
5117
|
initialWidths: columns.map((col) => col.w),
|
|
@@ -5041,15 +5125,28 @@ const _sfc_main$2 = {
|
|
|
5041
5125
|
} : null,
|
|
5042
5126
|
constrainedDelta: 0
|
|
5043
5127
|
};
|
|
5128
|
+
if (!props.editor?.view?.dom) {
|
|
5129
|
+
emit("resize-error", { error: "Editor view not available" });
|
|
5130
|
+
dragState.value = null;
|
|
5131
|
+
return;
|
|
5132
|
+
}
|
|
5044
5133
|
const pmView = props.editor.view.dom;
|
|
5045
5134
|
pmView.style.pointerEvents = "none";
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
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
|
+
}
|
|
5053
5150
|
}
|
|
5054
5151
|
function throttle(func, limit) {
|
|
5055
5152
|
let inThrottle;
|
|
@@ -5074,8 +5171,10 @@ const _sfc_main$2 = {
|
|
|
5074
5171
|
return { throttled, cancel };
|
|
5075
5172
|
}
|
|
5076
5173
|
const mouseMoveThrottle = throttle((event) => {
|
|
5077
|
-
if (!dragState.value) return;
|
|
5078
|
-
const
|
|
5174
|
+
if (isUnmounted || !dragState.value) return;
|
|
5175
|
+
const zoom = getZoom();
|
|
5176
|
+
const screenDelta = event.clientX - dragState.value.initialX;
|
|
5177
|
+
const delta = screenDelta / zoom;
|
|
5079
5178
|
const minDelta = -(dragState.value.leftColumn.width - dragState.value.leftColumn.minWidth);
|
|
5080
5179
|
let maxDelta;
|
|
5081
5180
|
if (dragState.value.isRightEdge) {
|
|
@@ -5086,7 +5185,7 @@ const _sfc_main$2 = {
|
|
|
5086
5185
|
const tableLeftInPage = tableRect.left - pageRect.left;
|
|
5087
5186
|
const rightMargin = tableLeftInPage;
|
|
5088
5187
|
const maxRightPosition = pageRect.right - rightMargin;
|
|
5089
|
-
const availableSpace = maxRightPosition - tableRect.right;
|
|
5188
|
+
const availableSpace = (maxRightPosition - tableRect.right) / zoom;
|
|
5090
5189
|
maxDelta = Math.max(0, availableSpace);
|
|
5091
5190
|
} else {
|
|
5092
5191
|
maxDelta = Infinity;
|
|
@@ -5100,7 +5199,7 @@ const _sfc_main$2 = {
|
|
|
5100
5199
|
columnIndex: dragState.value.columnIndex,
|
|
5101
5200
|
delta: constrainedDelta
|
|
5102
5201
|
});
|
|
5103
|
-
},
|
|
5202
|
+
}, THROTTLE_INTERVAL_MS);
|
|
5104
5203
|
const onDocumentMouseMove = mouseMoveThrottle.throttled;
|
|
5105
5204
|
function onDocumentMouseUp(event) {
|
|
5106
5205
|
if (!dragState.value) return;
|
|
@@ -5115,13 +5214,11 @@ const _sfc_main$2 = {
|
|
|
5115
5214
|
}
|
|
5116
5215
|
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5117
5216
|
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
5118
|
-
if (props.editor?.view) {
|
|
5217
|
+
if (props.editor?.view?.dom) {
|
|
5119
5218
|
const pmView = props.editor.view.dom;
|
|
5120
|
-
|
|
5121
|
-
pmView.style.pointerEvents = "auto";
|
|
5122
|
-
}
|
|
5219
|
+
pmView.style.pointerEvents = "auto";
|
|
5123
5220
|
}
|
|
5124
|
-
if (!forcedCleanup.value && Math.abs(finalDelta) >
|
|
5221
|
+
if (!forcedCleanup.value && Math.abs(finalDelta) > MIN_RESIZE_DELTA_PX) {
|
|
5125
5222
|
dispatchResizeTransaction(columnIndex, newWidths);
|
|
5126
5223
|
emit("resize-end", {
|
|
5127
5224
|
columnIndex,
|
|
@@ -5168,7 +5265,7 @@ const _sfc_main$2 = {
|
|
|
5168
5265
|
updateCellColwidths(tr, tableNode, tablePos, affectedColumns, newWidths);
|
|
5169
5266
|
dispatch(tr);
|
|
5170
5267
|
const blockId = props.tableElement?.getAttribute("data-sd-block-id");
|
|
5171
|
-
if (blockId) {
|
|
5268
|
+
if (blockId && blockId.trim()) {
|
|
5172
5269
|
measureCache.invalidate([blockId]);
|
|
5173
5270
|
}
|
|
5174
5271
|
emit("resize-success", { columnIndex, newWidths });
|
|
@@ -5184,7 +5281,14 @@ const _sfc_main$2 = {
|
|
|
5184
5281
|
if (!pmElement) {
|
|
5185
5282
|
return null;
|
|
5186
5283
|
}
|
|
5187
|
-
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
|
+
}
|
|
5188
5292
|
let tablePos = null;
|
|
5189
5293
|
state.doc.descendants((node, pos) => {
|
|
5190
5294
|
if (node.type.name === "table") {
|
|
@@ -5236,6 +5340,12 @@ const _sfc_main$2 = {
|
|
|
5236
5340
|
() => props.tableElement,
|
|
5237
5341
|
() => {
|
|
5238
5342
|
parseTableMetadata();
|
|
5343
|
+
updateOverlayRect();
|
|
5344
|
+
if (props.visible && props.tableElement) {
|
|
5345
|
+
startOverlayTracking();
|
|
5346
|
+
} else if (!props.tableElement) {
|
|
5347
|
+
stopOverlayTracking();
|
|
5348
|
+
}
|
|
5239
5349
|
},
|
|
5240
5350
|
{ immediate: true }
|
|
5241
5351
|
);
|
|
@@ -5244,7 +5354,10 @@ const _sfc_main$2 = {
|
|
|
5244
5354
|
(visible) => {
|
|
5245
5355
|
if (visible) {
|
|
5246
5356
|
parseTableMetadata();
|
|
5357
|
+
updateOverlayRect();
|
|
5358
|
+
startOverlayTracking();
|
|
5247
5359
|
} else {
|
|
5360
|
+
stopOverlayTracking();
|
|
5248
5361
|
if (dragState.value) {
|
|
5249
5362
|
forcedCleanup.value = true;
|
|
5250
5363
|
onDocumentMouseUp(new MouseEvent("mouseup"));
|
|
@@ -5253,8 +5366,15 @@ const _sfc_main$2 = {
|
|
|
5253
5366
|
}
|
|
5254
5367
|
}
|
|
5255
5368
|
);
|
|
5369
|
+
onMounted(() => {
|
|
5370
|
+
window.addEventListener("scroll", updateOverlayRect, true);
|
|
5371
|
+
window.addEventListener("resize", updateOverlayRect);
|
|
5372
|
+
updateOverlayRect();
|
|
5373
|
+
});
|
|
5256
5374
|
onBeforeUnmount(() => {
|
|
5375
|
+
isUnmounted = true;
|
|
5257
5376
|
mouseMoveThrottle.cancel();
|
|
5377
|
+
stopOverlayTracking();
|
|
5258
5378
|
if (dragState.value) {
|
|
5259
5379
|
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5260
5380
|
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
@@ -5262,6 +5382,8 @@ const _sfc_main$2 = {
|
|
|
5262
5382
|
props.editor.view.dom.style.pointerEvents = "auto";
|
|
5263
5383
|
}
|
|
5264
5384
|
}
|
|
5385
|
+
window.removeEventListener("scroll", updateOverlayRect, true);
|
|
5386
|
+
window.removeEventListener("resize", updateOverlayRect);
|
|
5265
5387
|
});
|
|
5266
5388
|
return (_ctx, _cache) => {
|
|
5267
5389
|
return __props.visible && tableMetadata.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -5271,17 +5393,456 @@ const _sfc_main$2 = {
|
|
|
5271
5393
|
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
5272
5394
|
}, ["stop"]))
|
|
5273
5395
|
}, [
|
|
5274
|
-
(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) => {
|
|
5275
5837
|
return openBlock(), createElementBlock("div", {
|
|
5276
|
-
key:
|
|
5838
|
+
key: handle.position,
|
|
5277
5839
|
class: normalizeClass(["resize-handle", {
|
|
5278
|
-
"resize-handle--active": dragState.value && dragState.value.
|
|
5279
|
-
|
|
5840
|
+
"resize-handle--active": dragState.value && dragState.value.handle === handle.position,
|
|
5841
|
+
[`resize-handle--${handle.position}`]: true
|
|
5280
5842
|
}]),
|
|
5281
|
-
|
|
5282
|
-
"data-
|
|
5283
|
-
|
|
5284
|
-
onMousedown: ($event) => onHandleMouseDown($event, index)
|
|
5843
|
+
style: normalizeStyle(handle.style),
|
|
5844
|
+
"data-handle-position": handle.position,
|
|
5845
|
+
onMousedown: ($event) => onHandleMouseDown($event, handle.position)
|
|
5285
5846
|
}, null, 46, _hoisted_1$2);
|
|
5286
5847
|
}), 128)),
|
|
5287
5848
|
dragState.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -5293,7 +5854,114 @@ const _sfc_main$2 = {
|
|
|
5293
5854
|
};
|
|
5294
5855
|
}
|
|
5295
5856
|
};
|
|
5296
|
-
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
|
+
};
|
|
5297
5965
|
function adjustPaginationBreaks(editorElem, editor) {
|
|
5298
5966
|
if (!editorElem.value || !editor?.value?.options?.scale || isHeadless(editor)) return;
|
|
5299
5967
|
const zoom = editor.value.options.scale;
|
|
@@ -5318,7 +5986,9 @@ const _hoisted_2 = {
|
|
|
5318
5986
|
};
|
|
5319
5987
|
const _hoisted_3 = { class: "placeholder-title" };
|
|
5320
5988
|
const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
5321
|
-
const
|
|
5989
|
+
const TABLE_RESIZE_HOVER_THRESHOLD = 8;
|
|
5990
|
+
const TABLE_RESIZE_THROTTLE_MS = 16;
|
|
5991
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
5322
5992
|
__name: "SuperEditor",
|
|
5323
5993
|
props: {
|
|
5324
5994
|
documentId: {
|
|
@@ -5382,7 +6052,94 @@ const _sfc_main$1 = {
|
|
|
5382
6052
|
visible: false,
|
|
5383
6053
|
tableElement: null
|
|
5384
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
|
+
};
|
|
5385
6137
|
const updateTableResizeOverlay = (event) => {
|
|
6138
|
+
const now = Date.now();
|
|
6139
|
+
if (now - lastUpdateTableResizeTimestamp < TABLE_RESIZE_THROTTLE_MS) {
|
|
6140
|
+
return;
|
|
6141
|
+
}
|
|
6142
|
+
lastUpdateTableResizeTimestamp = now;
|
|
5386
6143
|
if (!editorElem.value) return;
|
|
5387
6144
|
let target = event.target;
|
|
5388
6145
|
while (target && target !== editorElem.value) {
|
|
@@ -5390,8 +6147,13 @@ const _sfc_main$1 = {
|
|
|
5390
6147
|
return;
|
|
5391
6148
|
}
|
|
5392
6149
|
if (target.classList?.contains("superdoc-table-fragment") && target.hasAttribute("data-table-boundaries")) {
|
|
5393
|
-
|
|
5394
|
-
|
|
6150
|
+
if (isNearColumnBoundary(event, target)) {
|
|
6151
|
+
tableResizeState.visible = true;
|
|
6152
|
+
tableResizeState.tableElement = target;
|
|
6153
|
+
} else {
|
|
6154
|
+
tableResizeState.visible = false;
|
|
6155
|
+
tableResizeState.tableElement = null;
|
|
6156
|
+
}
|
|
5395
6157
|
return;
|
|
5396
6158
|
}
|
|
5397
6159
|
target = target.parentElement;
|
|
@@ -5403,6 +6165,59 @@ const _sfc_main$1 = {
|
|
|
5403
6165
|
tableResizeState.visible = false;
|
|
5404
6166
|
tableResizeState.tableElement = null;
|
|
5405
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
|
+
};
|
|
5406
6221
|
let dataPollTimeout;
|
|
5407
6222
|
const stopPolling = () => {
|
|
5408
6223
|
clearTimeout(dataPollTimeout);
|
|
@@ -5456,17 +6271,36 @@ const _sfc_main$1 = {
|
|
|
5456
6271
|
delete props.options.content;
|
|
5457
6272
|
const ydoc = props.options.ydoc;
|
|
5458
6273
|
const provider = props.options.collaborationProvider;
|
|
5459
|
-
const
|
|
5460
|
-
|
|
5461
|
-
|
|
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
|
+
});
|
|
5462
6286
|
};
|
|
5463
|
-
|
|
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
|
+
});
|
|
5464
6297
|
}
|
|
5465
6298
|
};
|
|
5466
6299
|
const getExtensions = () => getStarterExtensions();
|
|
5467
6300
|
const initEditor = async ({ content, media = {}, mediaFiles = {}, fonts = {} } = {}) => {
|
|
5468
6301
|
const { editorCtor, ...editorOptions } = props.options || {};
|
|
5469
6302
|
const EditorCtor = editorCtor ?? Editor;
|
|
6303
|
+
clearSelectedImage();
|
|
5470
6304
|
editor.value = new EditorCtor({
|
|
5471
6305
|
mode: "docx",
|
|
5472
6306
|
element: editorElem.value,
|
|
@@ -5483,6 +6317,49 @@ const _sfc_main$1 = {
|
|
|
5483
6317
|
editor: activeEditor.value,
|
|
5484
6318
|
presentationEditor: editor.value instanceof PresentationEditor ? editor.value : null
|
|
5485
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
|
+
}
|
|
5486
6363
|
editor.value.on("paginationUpdate", () => {
|
|
5487
6364
|
const base = activeEditor.value;
|
|
5488
6365
|
if (isHeadless(base)) return;
|
|
@@ -5555,6 +6432,7 @@ const _sfc_main$1 = {
|
|
|
5555
6432
|
};
|
|
5556
6433
|
onBeforeUnmount(() => {
|
|
5557
6434
|
stopPolling();
|
|
6435
|
+
clearSelectedImage();
|
|
5558
6436
|
editor.value?.destroy();
|
|
5559
6437
|
editor.value = null;
|
|
5560
6438
|
});
|
|
@@ -5573,8 +6451,8 @@ const _sfc_main$1 = {
|
|
|
5573
6451
|
onKeydown: handleSuperEditorKeydown,
|
|
5574
6452
|
onClick: handleSuperEditorClick,
|
|
5575
6453
|
onMousedown: handleMarginClick,
|
|
5576
|
-
onMousemove:
|
|
5577
|
-
onMouseleave:
|
|
6454
|
+
onMousemove: handleOverlayUpdates,
|
|
6455
|
+
onMouseleave: handleOverlayHide
|
|
5578
6456
|
}, [
|
|
5579
6457
|
createElementVNode("div", {
|
|
5580
6458
|
ref_key: "editorElem",
|
|
@@ -5582,19 +6460,32 @@ const _sfc_main$1 = {
|
|
|
5582
6460
|
class: "editor-element super-editor__element",
|
|
5583
6461
|
role: "presentation"
|
|
5584
6462
|
}, null, 512),
|
|
5585
|
-
!contextMenuDisabled.value && editorReady.value && activeEditor.value ? (openBlock(), createBlock(_sfc_main$
|
|
6463
|
+
!contextMenuDisabled.value && editorReady.value && activeEditor.value ? (openBlock(), createBlock(_sfc_main$8, {
|
|
5586
6464
|
key: 0,
|
|
5587
6465
|
editor: activeEditor.value,
|
|
5588
6466
|
popoverControls,
|
|
5589
6467
|
openPopover,
|
|
5590
6468
|
closePopover
|
|
5591
6469
|
}, null, 8, ["editor", "popoverControls"])) : createCommentVNode("", true),
|
|
5592
|
-
editorReady.value && activeEditor.value ? (openBlock(), createBlock(
|
|
6470
|
+
editorReady.value && activeEditor.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
5593
6471
|
key: 1,
|
|
5594
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,
|
|
5595
6480
|
visible: tableResizeState.visible,
|
|
5596
6481
|
tableElement: tableResizeState.tableElement
|
|
5597
|
-
}, 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)
|
|
5598
6489
|
], 544),
|
|
5599
6490
|
!editorReady.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
5600
6491
|
createElementVNode("div", _hoisted_3, [
|
|
@@ -5656,8 +6547,8 @@ const _sfc_main$1 = {
|
|
|
5656
6547
|
]);
|
|
5657
6548
|
};
|
|
5658
6549
|
}
|
|
5659
|
-
};
|
|
5660
|
-
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"]]);
|
|
5661
6552
|
const _hoisted_1 = ["innerHTML"];
|
|
5662
6553
|
const _sfc_main = {
|
|
5663
6554
|
__name: "SuperInput",
|
|
@@ -5749,98 +6640,6 @@ const _sfc_main = {
|
|
|
5749
6640
|
}
|
|
5750
6641
|
};
|
|
5751
6642
|
const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
|
|
5752
|
-
const additionalHandlers = Object.freeze({
|
|
5753
|
-
"mc:AlternateContent": translator$1j,
|
|
5754
|
-
"sd:pageReference": translator$1i,
|
|
5755
|
-
"sd:tableOfContents": translator$1h,
|
|
5756
|
-
"w:b": translator$1g,
|
|
5757
|
-
"w:bCs": translator$1f,
|
|
5758
|
-
"w:bidiVisual": translator$1e,
|
|
5759
|
-
"w:bookmarkEnd": translator$1d,
|
|
5760
|
-
"w:bookmarkStart": translator$1c,
|
|
5761
|
-
"w:bottom": translator$1b,
|
|
5762
|
-
"w:br": translator$1a,
|
|
5763
|
-
"w:cantSplit": translator$19,
|
|
5764
|
-
"w:caps": translator$18,
|
|
5765
|
-
"w:cnfStyle": translator$17,
|
|
5766
|
-
"w:color": translator$16,
|
|
5767
|
-
"w:divId": translator$15,
|
|
5768
|
-
"w:drawing": translator$14,
|
|
5769
|
-
"w:end": translator$13,
|
|
5770
|
-
"w:gridAfter": translator$12,
|
|
5771
|
-
"w:gridBefore": translator$11,
|
|
5772
|
-
"w:gridCol": translator$10,
|
|
5773
|
-
"w:hidden": translator$$,
|
|
5774
|
-
"w:highlight": translator$_,
|
|
5775
|
-
"w:hyperlink": translator$Z,
|
|
5776
|
-
"w:i": translator$Y,
|
|
5777
|
-
"w:insideH": translator$X,
|
|
5778
|
-
"w:insideV": translator$W,
|
|
5779
|
-
"w:jc": translator$V,
|
|
5780
|
-
"w:left": translator$U,
|
|
5781
|
-
"w:p": translator$T,
|
|
5782
|
-
"w:r": translator$S,
|
|
5783
|
-
"w:rFonts": translator$R,
|
|
5784
|
-
"w:rPr": translator$Q,
|
|
5785
|
-
"w:rStyle": translator$P,
|
|
5786
|
-
"w:right": translator$O,
|
|
5787
|
-
"w:sdt": translator$N,
|
|
5788
|
-
"w:shd": translator$M,
|
|
5789
|
-
"w:start": translator$L,
|
|
5790
|
-
"w:strike": translator$K,
|
|
5791
|
-
"w:sz": translator$J,
|
|
5792
|
-
"w:szCs": translator$I,
|
|
5793
|
-
"w:tab": translator$H,
|
|
5794
|
-
"w:tbl": translator$G,
|
|
5795
|
-
"w:tblBorders": translator$F,
|
|
5796
|
-
"w:tblCaption": translator$E,
|
|
5797
|
-
"w:tblCellMar": translator$D,
|
|
5798
|
-
"w:tblCellSpacing": translator$C,
|
|
5799
|
-
"w:tblDescription": translator$B,
|
|
5800
|
-
"w:tblGrid": translator$A,
|
|
5801
|
-
"w:tblHeader": translator$z,
|
|
5802
|
-
"w:tblInd": translator$y,
|
|
5803
|
-
"w:tblLayout": translator$x,
|
|
5804
|
-
"w:tblLook": translator$w,
|
|
5805
|
-
"w:tblOverlap": translator$v,
|
|
5806
|
-
"w:tblPr": translator$u,
|
|
5807
|
-
"w:tblStyle": translator$t,
|
|
5808
|
-
"w:tblStyleColBandSize": translator$s,
|
|
5809
|
-
"w:tblStyleRowBandSize": translator$r,
|
|
5810
|
-
"w:tblW": translator$q,
|
|
5811
|
-
"w:tblpPr": translator$p,
|
|
5812
|
-
"w:tc": translator$o,
|
|
5813
|
-
"w:top": translator$n,
|
|
5814
|
-
"w:tr": translator$m,
|
|
5815
|
-
"w:trHeight": translator$l,
|
|
5816
|
-
"w:trPr": translator$k,
|
|
5817
|
-
"w:u": translator$j,
|
|
5818
|
-
"w:wAfter": translator$i,
|
|
5819
|
-
"w:wBefore": translator$h,
|
|
5820
|
-
"wp:anchor": translator$g,
|
|
5821
|
-
"wp:inline": translator$f,
|
|
5822
|
-
"w:commentRangeStart": commentRangeStartTranslator,
|
|
5823
|
-
"w:commentRangeEnd": commentRangeEndTranslator,
|
|
5824
|
-
"w:vMerge": translator$e,
|
|
5825
|
-
"w:gridSpan": translator$d,
|
|
5826
|
-
"w:vAlign": translator$c,
|
|
5827
|
-
"w:noWrap": translator$b,
|
|
5828
|
-
"w:tcFitText": translator$a,
|
|
5829
|
-
"w:tcW": translator$9,
|
|
5830
|
-
"w:hideMark": translator$8,
|
|
5831
|
-
"w:textDirection": translator$7,
|
|
5832
|
-
"w:tl2br": translator$6,
|
|
5833
|
-
"w:tr2bl": translator$5,
|
|
5834
|
-
"w:header": translator$4,
|
|
5835
|
-
"w:headers": translator$3,
|
|
5836
|
-
"w:tcBorders": translator$2,
|
|
5837
|
-
"w:tcMar": translator$1,
|
|
5838
|
-
"w:tcPr": translator
|
|
5839
|
-
});
|
|
5840
|
-
const baseHandlers = {
|
|
5841
|
-
...additionalHandlers
|
|
5842
|
-
};
|
|
5843
|
-
const registeredHandlers = Object.freeze(baseHandlers);
|
|
5844
6643
|
const Extensions = {
|
|
5845
6644
|
Node,
|
|
5846
6645
|
Attribute,
|
|
@@ -5855,14 +6654,14 @@ const Extensions = {
|
|
|
5855
6654
|
export {
|
|
5856
6655
|
AIWriter,
|
|
5857
6656
|
z as AnnotatorHelpers,
|
|
5858
|
-
_sfc_main$
|
|
6657
|
+
_sfc_main$7 as BasicUpload,
|
|
5859
6658
|
F as CommentsPluginKey,
|
|
5860
6659
|
D as DocxZipper,
|
|
5861
6660
|
Editor,
|
|
5862
6661
|
Extensions,
|
|
5863
6662
|
PresentationEditor,
|
|
5864
6663
|
B as SectionHelpers,
|
|
5865
|
-
_sfc_main$
|
|
6664
|
+
_sfc_main$8 as SlashMenu,
|
|
5866
6665
|
ac as SuperConverter,
|
|
5867
6666
|
SuperEditor,
|
|
5868
6667
|
SuperInput,
|
|
@@ -5877,6 +6676,6 @@ export {
|
|
|
5877
6676
|
getRichTextExtensions,
|
|
5878
6677
|
getStarterExtensions,
|
|
5879
6678
|
a9 as helpers,
|
|
5880
|
-
registeredHandlers,
|
|
6679
|
+
aQ as registeredHandlers,
|
|
5881
6680
|
x as trackChangesHelpers
|
|
5882
6681
|
};
|