superdoc 1.0.0-beta.13 → 1.0.0-beta.15

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.
Files changed (40) hide show
  1. package/dist/chunks/{PdfViewer-D0cPi5hG.es.js → PdfViewer-CjlHzt9e.es.js} +2 -2
  2. package/dist/chunks/{PdfViewer-D_E86Mtr.cjs → PdfViewer-DltPlBWC.cjs} +2 -2
  3. package/dist/chunks/{eventemitter3-ByBH0NYV.es.js → eventemitter3-CcXAdeql.es.js} +1 -1
  4. package/dist/chunks/{eventemitter3-CFCpOk3d.cjs → eventemitter3-DQmQUge-.cjs} +1 -1
  5. package/dist/chunks/{index-CL4VptDO.cjs → index-BZnlco_f.cjs} +6 -6
  6. package/dist/chunks/{index-BMAfbNel-DBZCkkMj.cjs → index-Bds7gW4r-JPDW6c39.cjs} +1 -1
  7. package/dist/chunks/{index-BMAfbNel-CvPc3jnD.es.js → index-Bds7gW4r-Pk_xAuWe.es.js} +1 -1
  8. package/dist/chunks/{index-BHmLKAul.es.js → index-qg0AxQJC.es.js} +6 -6
  9. package/dist/chunks/{jszip-BwsONqK5.es.js → jszip-5vvIqAEE.es.js} +1 -1
  10. package/dist/chunks/{jszip-B99MTu59.cjs → jszip-BdEez1WM.cjs} +1 -1
  11. package/dist/chunks/{super-editor.es-5gtBhP8I.es.js → super-editor.es-CQTkj_nb.es.js} +5926 -940
  12. package/dist/chunks/{super-editor.es-riuOlaxm.cjs → super-editor.es-CuAhqbzW.cjs} +5925 -939
  13. package/dist/chunks/{vue-CztqUvm1.es.js → vue-Dysv_7z5.es.js} +101 -12
  14. package/dist/chunks/{vue-ARQSyfaw.cjs → vue-jWLMl8Ts.cjs} +89 -0
  15. package/dist/chunks/xml-js-ClO_jHnq.es.js +2 -0
  16. package/dist/chunks/xml-js-Dz51sEbr.cjs +3 -0
  17. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  18. package/dist/style.css +56 -17
  19. package/dist/super-editor/ai-writer.es.js +2 -2
  20. package/dist/super-editor/chunks/{converter-D9KiDgXx.js → converter-qMoZOGGn.js} +918 -342
  21. package/dist/super-editor/chunks/{docx-zipper-DQmUj-ef.js → docx-zipper-QKiyORxV.js} +1 -1
  22. package/dist/super-editor/chunks/{editor-ByPqJ2k8.js → editor-D8ZdjC2V.js} +4471 -502
  23. package/dist/super-editor/chunks/{index-BMAfbNel.js → index-Bds7gW4r.js} +1 -1
  24. package/dist/super-editor/chunks/{toolbar-Da2cOhJ-.js → toolbar-Spi7vpev.js} +36 -22
  25. package/dist/super-editor/converter.es.js +1 -1
  26. package/dist/super-editor/docx-zipper.es.js +2 -2
  27. package/dist/super-editor/editor.es.js +3 -3
  28. package/dist/super-editor/file-zipper.es.js +1 -1
  29. package/dist/super-editor/style.css +56 -17
  30. package/dist/super-editor/super-editor.es.js +560 -160
  31. package/dist/super-editor/toolbar.es.js +2 -2
  32. package/dist/super-editor.cjs +4 -4
  33. package/dist/super-editor.es.js +2 -2
  34. package/dist/superdoc.cjs +2 -2
  35. package/dist/superdoc.es.js +2 -2
  36. package/dist/superdoc.umd.js +5990 -928
  37. package/dist/superdoc.umd.js.map +1 -1
  38. package/package.json +1 -1
  39. package/dist/chunks/xml-js-BZPSMmVo.es.js +0 -2
  40. 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 { aJ as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aM as vClickOutside, aN as getActiveFormatting, aC as isInTable, U as findParentNode, aq as calculateResolvedParagraphProperties, a7 as twipsToLines, V as isList, al as parseSizeUnit, a8 as pixelsToTwips, aO as getFileObject, aP as translator, aQ as translator$1, aR as translator$2, aS as translator$3, aT as translator$4, aU as translator$5, aV as translator$6, aW as translator$7, aX as translator$8, aY as translator$9, aZ as translator$a, a_ as translator$b, a$ as translator$c, b0 as translator$d, b1 as translator$e, b2 as commentRangeEndTranslator, b3 as commentRangeStartTranslator, b4 as translator$f, b5 as translator$g, b6 as translator$h, b7 as translator$i, b8 as translator$j, b9 as translator$k, ba as translator$l, bb as translator$m, bc as translator$n, bd as translator$o, be as translator$p, bf as translator$q, bg as translator$r, bh as translator$s, bi as translator$t, bj as translator$u, bk as translator$v, bl as translator$w, bm as translator$x, bn as translator$y, bo as translator$z, bp as translator$A, bq as translator$B, br as translator$C, bs as translator$D, bt as translator$E, bu as translator$F, bv as translator$G, bw as translator$H, bx as translator$I, by as translator$J, bz as translator$K, bA as translator$L, bB as translator$M, bC as translator$N, bD as translator$O, bE as translator$P, bF as translator$Q, bG as translator$R, bH as translator$S, bI as translator$T, bJ as translator$U, bK as translator$V, bL as translator$W, bM as translator$X, bN as translator$Y, bO as translator$Z, bP as translator$_, bQ as translator$$, bR as translator$10, bS as translator$11, bT as translator$12, bU as translator$13, bV as translator$14, bW as translator$15, bX as translator$16, bY as translator$17, bZ as translator$18, b_ as translator$19, b$ as translator$1a, c0 as translator$1b, c1 as translator$1c, c2 as translator$1d, c3 as translator$1e, c4 as translator$1f, c5 as translator$1g, c6 as translator$1h, c7 as translator$1i, c8 as translator$1j, P as PluginKey, a as Plugin } from "./chunks/converter-D9KiDgXx.js";
13
- import { ac, i, a9 } from "./chunks/converter-D9KiDgXx.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-ByPqJ2k8.js";
15
- import { z, F, B, T, w, C, x } from "./chunks/editor-ByPqJ2k8.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, 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-Da2cOhJ-.js";
12
+ import { aJ as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aM as vClickOutside, aN as getActiveFormatting, aC as isInTable, U as findParentNode, aq as calculateResolvedParagraphProperties, a7 as twipsToLines, V as isList, al as parseSizeUnit, a8 as pixelsToTwips, aO as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-qMoZOGGn.js";
13
+ import { ac, i, a9, aP } from "./chunks/converter-qMoZOGGn.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-D8ZdjC2V.js";
15
+ import { z, F, B, T, w, C, x } from "./chunks/editor-D8ZdjC2V.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-Spi7vpev.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-DQmUj-ef.js";
19
+ import { D } from "./chunks/docx-zipper-QKiyORxV.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$e = ["onClick", "innerHTML", "aria-label", "onKeydown"];
315
- const _sfc_main$f = {
314
+ const _hoisted_1$f = ["onClick", "innerHTML", "aria-label", "onKeydown"];
315
+ const _sfc_main$g = {
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$e);
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$f, [["__scopeId", "data-v-d84f57b6"]]);
407
- const _hoisted_1$d = ["onClick", "onKeydown"];
406
+ const AlignmentButtons = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__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$e = {
413
+ const _sfc_main$f = {
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$d);
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$e, [["__scopeId", "data-v-8730b752"]]);
494
- const _hoisted_1$c = {
493
+ const DocumentMode = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__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$d = {
500
+ const _sfc_main$e = {
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$c, [
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$d, [["__scopeId", "data-v-ecb78965"]]);
577
- const _hoisted_1$b = {
576
+ const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__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$c = {
605
+ const _sfc_main$d = {
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$b, "Page anchor")) : isEditing.value ? (openBlock(), createElementBlock("div", _hoisted_2$7, "Edit link")) : (openBlock(), createElementBlock("div", _hoisted_3$6, "Add link")),
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$c, [["__scopeId", "data-v-ba50627b"]]);
812
- const _hoisted_1$a = ["aria-label", "onClick", "onKeydown"];
811
+ const LinkInput = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__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$b = {
816
+ const _sfc_main$c = {
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$a);
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$b, [["__scopeId", "data-v-0f479b6c"]]);
949
+ const IconGridRow = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__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$9 = { class: "options-grid-wrap" };
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$a = {
954
+ const _sfc_main$b = {
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$9, [
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$a, [["__scopeId", "data-v-3d19fedf"]]);
1014
+ const IconGrid = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__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$8 = ["data-cols", "data-rows", "onKeydown", "onClick"];
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$9 = {
1126
+ const _sfc_main$a = {
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$8);
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$9, [["__scopeId", "data-v-92e8d5fb"]]);
1256
- const _hoisted_1$7 = { class: "toolbar-table-actions" };
1255
+ const TableGrid = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__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$8 = {
1261
+ const _sfc_main$9 = {
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$7, [
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$8, [["__scopeId", "data-v-990b9a25"]]);
1297
+ const TableActions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__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$6 = { class: "search-input-ctn" };
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$7 = {
1324
+ const _sfc_main$8 = {
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$6, [
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$7, [["__scopeId", "data-v-957cbcf2"]]);
1363
+ const SearchInput = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-957cbcf2"]]);
1364
1364
  const TOOLBAR_FONTS = [
1365
1365
  {
1366
1366
  label: "Georgia",
@@ -4212,7 +4212,7 @@ function getItems(context, customItems = [], includeDefaultItems = true) {
4212
4212
  }).filter((section) => section.items.length > 0);
4213
4213
  return filteredSections;
4214
4214
  }
4215
- const _hoisted_1$5 = { class: "slash-menu-items" };
4215
+ const _hoisted_1$6 = { class: "slash-menu-items" };
4216
4216
  const _hoisted_2$1 = {
4217
4217
  key: 0,
4218
4218
  class: "slash-menu-divider",
@@ -4220,7 +4220,7 @@ const _hoisted_2$1 = {
4220
4220
  };
4221
4221
  const _hoisted_3$1 = ["onClick"];
4222
4222
  const _hoisted_4 = ["innerHTML"];
4223
- const _sfc_main$6 = {
4223
+ const _sfc_main$7 = {
4224
4224
  __name: "SlashMenu",
4225
4225
  props: {
4226
4226
  editor: {
@@ -4348,7 +4348,7 @@ const _sfc_main$6 = {
4348
4348
  customItemRefs.clear();
4349
4349
  };
4350
4350
  const handleGlobalKeyDown = (event) => {
4351
- if (event.key === "Escape") {
4351
+ if (event.key === "Escape" && isOpen.value) {
4352
4352
  event.preventDefault();
4353
4353
  event.stopPropagation();
4354
4354
  closeMenu();
@@ -4536,7 +4536,7 @@ const _sfc_main$6 = {
4536
4536
  }, null, 544), [
4537
4537
  [vModelText, searchQuery.value]
4538
4538
  ]),
4539
- createElementVNode("div", _hoisted_1$5, [
4539
+ createElementVNode("div", _hoisted_1$6, [
4540
4540
  (openBlock(true), createElementBlock(Fragment, null, renderList(filteredSections.value, (section, sectionIndex) => {
4541
4541
  return openBlock(), createElementBlock(Fragment, {
4542
4542
  key: section.id
@@ -4571,8 +4571,8 @@ const _sfc_main$6 = {
4571
4571
  };
4572
4572
  }
4573
4573
  };
4574
- const _hoisted_1$4 = ["accept"];
4575
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4574
+ const _hoisted_1$5 = ["accept"];
4575
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
4576
4576
  __name: "BasicUpload",
4577
4577
  props: {
4578
4578
  accept: { default: ".docx, .pdf, .html, .md" }
@@ -4593,15 +4593,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
4593
4593
  id: "fileInput",
4594
4594
  onChange: onFileChange,
4595
4595
  accept: __props.accept
4596
- }, null, 40, _hoisted_1$4)
4596
+ }, null, 40, _hoisted_1$5)
4597
4597
  ]);
4598
4598
  };
4599
4599
  }
4600
4600
  });
4601
- const _hoisted_1$3 = { class: "numbering" };
4601
+ const _hoisted_1$4 = { class: "numbering" };
4602
4602
  const MIN_WIDTH = 200;
4603
4603
  const alignment = "flex-end";
4604
- const _sfc_main$4 = {
4604
+ const _sfc_main$5 = {
4605
4605
  __name: "Ruler",
4606
4606
  props: {
4607
4607
  orientation: {
@@ -4786,7 +4786,7 @@ const _sfc_main$4 = {
4786
4786
  class: normalizeClass(unit.className),
4787
4787
  style: normalizeStyle(getStyle.value(unit))
4788
4788
  }, [
4789
- createElementVNode("div", _hoisted_1$3, toDisplayString(unit.numbering), 1),
4789
+ createElementVNode("div", _hoisted_1$4, toDisplayString(unit.numbering), 1),
4790
4790
  (openBlock(true), createElementBlock(Fragment, null, renderList(unit.elements, (half) => {
4791
4791
  return openBlock(), createElementBlock("div", {
4792
4792
  class: normalizeClass(half.className),
@@ -4806,8 +4806,8 @@ const _sfc_main$4 = {
4806
4806
  };
4807
4807
  }
4808
4808
  };
4809
- const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-79f9a944"]]);
4810
- const _sfc_main$3 = {
4809
+ const Ruler = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-79f9a944"]]);
4810
+ const _sfc_main$4 = {
4811
4811
  __name: "GenericPopover",
4812
4812
  props: {
4813
4813
  editor: { type: Object, required: true },
@@ -4875,9 +4875,9 @@ const _sfc_main$3 = {
4875
4875
  };
4876
4876
  }
4877
4877
  };
4878
- const GenericPopover = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-cbddcc0f"]]);
4879
- const _hoisted_1$2 = ["data-boundary-index", "data-boundary-type", "onMousedown"];
4880
- const _sfc_main$2 = {
4878
+ const GenericPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-cbddcc0f"]]);
4879
+ const _hoisted_1$3 = ["data-boundary-index", "data-boundary-type", "onMousedown"];
4880
+ const _sfc_main$3 = {
4881
4881
  __name: "TableResizeOverlay",
4882
4882
  props: {
4883
4883
  /** Editor instance for dispatching transactions */
@@ -5305,7 +5305,7 @@ const _sfc_main$2 = {
5305
5305
  "data-boundary-type": boundary.type,
5306
5306
  style: normalizeStyle(getSegmentHandleStyle(boundary, segment)),
5307
5307
  onMousedown: ($event) => onHandleMouseDown($event, boundaryIndex)
5308
- }, null, 46, _hoisted_1$2);
5308
+ }, null, 46, _hoisted_1$3);
5309
5309
  }), 128))
5310
5310
  ], 64);
5311
5311
  }), 128)),
@@ -5318,7 +5318,440 @@ const _sfc_main$2 = {
5318
5318
  };
5319
5319
  }
5320
5320
  };
5321
- const TableResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d4258885"]]);
5321
+ const TableResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-3f4a506b"]]);
5322
+ const _hoisted_1$2 = ["data-handle-position", "onMousedown"];
5323
+ const OVERLAY_EXPANSION_PX = 2e3;
5324
+ const RESIZE_HANDLE_SIZE_PX = 12;
5325
+ const MOUSE_MOVE_THROTTLE_MS = 16;
5326
+ const DIMENSION_CHANGE_THRESHOLD_PX = 1;
5327
+ const Z_INDEX_OVERLAY = 10;
5328
+ const Z_INDEX_HANDLE = 15;
5329
+ const Z_INDEX_GUIDELINE = 20;
5330
+ const _sfc_main$2 = {
5331
+ __name: "ImageResizeOverlay",
5332
+ props: {
5333
+ /** Editor instance for dispatching transactions */
5334
+ editor: {
5335
+ type: Object,
5336
+ required: true
5337
+ },
5338
+ /** Show or hide the overlay */
5339
+ visible: {
5340
+ type: Boolean,
5341
+ default: false
5342
+ },
5343
+ /** Image fragment element containing data-image-metadata */
5344
+ imageElement: {
5345
+ type: Object,
5346
+ default: null
5347
+ }
5348
+ },
5349
+ emits: ["resize-start", "resize-move", "resize-end", "resize-success", "resize-error"],
5350
+ setup(__props, { emit: __emit }) {
5351
+ useCssVars((_ctx) => ({
5352
+ "v1e81f81d": RESIZE_HANDLE_SIZE_PX + "px",
5353
+ "v12763124": Z_INDEX_HANDLE
5354
+ }));
5355
+ function isValidEditor(editor) {
5356
+ return editor && typeof editor === "object" && editor.view && typeof editor.view === "object" && editor.view.dom instanceof HTMLElement && editor.view.state && typeof editor.view.dispatch === "function";
5357
+ }
5358
+ const props = __props;
5359
+ const emit = __emit;
5360
+ const imageMetadata = ref(null);
5361
+ const dragState = ref(null);
5362
+ const forcedCleanup = ref(false);
5363
+ const overlayStyle = computed(() => {
5364
+ if (!props.imageElement || !props.imageElement.isConnected) return {};
5365
+ const imageRect = props.imageElement.getBoundingClientRect();
5366
+ const wrapper = props.imageElement.closest(".super-editor");
5367
+ if (!wrapper) {
5368
+ return {
5369
+ position: "absolute",
5370
+ left: `${props.imageElement.offsetLeft}px`,
5371
+ top: `${props.imageElement.offsetTop}px`,
5372
+ width: `${imageRect.width}px`,
5373
+ height: `${imageRect.height}px`,
5374
+ pointerEvents: dragState.value ? "auto" : "none",
5375
+ zIndex: Z_INDEX_OVERLAY
5376
+ };
5377
+ }
5378
+ const wrapperRect = wrapper.getBoundingClientRect();
5379
+ const scrollLeft = wrapper.scrollLeft || 0;
5380
+ const scrollTop = wrapper.scrollTop || 0;
5381
+ const relativeLeft = imageRect.left - wrapperRect.left + scrollLeft;
5382
+ const relativeTop = imageRect.top - wrapperRect.top + scrollTop;
5383
+ let overlayWidth = imageRect.width;
5384
+ let overlayHeight = imageRect.height;
5385
+ let offsetX = 0;
5386
+ let offsetY = 0;
5387
+ if (dragState.value) {
5388
+ const expansion = OVERLAY_EXPANSION_PX;
5389
+ overlayWidth = imageRect.width + expansion * 2;
5390
+ overlayHeight = imageRect.height + expansion * 2;
5391
+ offsetX = -expansion;
5392
+ offsetY = -expansion;
5393
+ }
5394
+ return {
5395
+ position: "absolute",
5396
+ left: `${relativeLeft + offsetX}px`,
5397
+ top: `${relativeTop + offsetY}px`,
5398
+ width: `${overlayWidth}px`,
5399
+ height: `${overlayHeight}px`,
5400
+ pointerEvents: dragState.value ? "auto" : "none",
5401
+ zIndex: Z_INDEX_OVERLAY
5402
+ };
5403
+ });
5404
+ const resizeHandles = computed(() => {
5405
+ if (!imageMetadata.value || !props.imageElement) {
5406
+ return [];
5407
+ }
5408
+ const rect = props.imageElement.getBoundingClientRect();
5409
+ const width = rect.width;
5410
+ const height = rect.height;
5411
+ const handleSize = RESIZE_HANDLE_SIZE_PX;
5412
+ const offset = handleSize / 2;
5413
+ const expansion = dragState.value ? OVERLAY_EXPANSION_PX : 0;
5414
+ return [
5415
+ {
5416
+ position: "nw",
5417
+ style: {
5418
+ left: `${expansion - offset}px`,
5419
+ top: `${expansion - offset}px`,
5420
+ cursor: "nwse-resize"
5421
+ }
5422
+ },
5423
+ {
5424
+ position: "ne",
5425
+ style: {
5426
+ left: `${expansion + width - offset}px`,
5427
+ top: `${expansion - offset}px`,
5428
+ cursor: "nesw-resize"
5429
+ }
5430
+ },
5431
+ {
5432
+ position: "sw",
5433
+ style: {
5434
+ left: `${expansion - offset}px`,
5435
+ top: `${expansion + height - offset}px`,
5436
+ cursor: "nesw-resize"
5437
+ }
5438
+ },
5439
+ {
5440
+ position: "se",
5441
+ style: {
5442
+ left: `${expansion + width - offset}px`,
5443
+ top: `${expansion + height - offset}px`,
5444
+ cursor: "nwse-resize"
5445
+ }
5446
+ }
5447
+ ];
5448
+ });
5449
+ const guidelineStyle = computed(() => {
5450
+ if (!dragState.value || !props.imageElement) {
5451
+ return { display: "none" };
5452
+ }
5453
+ const expansion = OVERLAY_EXPANSION_PX;
5454
+ return {
5455
+ position: "absolute",
5456
+ left: `${expansion}px`,
5457
+ top: `${expansion}px`,
5458
+ width: `${dragState.value.constrainedWidth}px`,
5459
+ height: `${dragState.value.constrainedHeight}px`,
5460
+ border: "2px solid #4A90E2",
5461
+ pointerEvents: "none",
5462
+ zIndex: Z_INDEX_GUIDELINE,
5463
+ boxSizing: "border-box"
5464
+ };
5465
+ });
5466
+ function parseImageMetadata() {
5467
+ if (!props.imageElement || !props.imageElement.isConnected) {
5468
+ imageMetadata.value = null;
5469
+ return;
5470
+ }
5471
+ try {
5472
+ const metadataAttr = props.imageElement.getAttribute("data-image-metadata");
5473
+ if (!metadataAttr) {
5474
+ imageMetadata.value = null;
5475
+ return;
5476
+ }
5477
+ const parsed = JSON.parse(metadataAttr);
5478
+ if (!parsed || typeof parsed !== "object") {
5479
+ imageMetadata.value = null;
5480
+ return;
5481
+ }
5482
+ const required = [
5483
+ "originalWidth",
5484
+ "originalHeight",
5485
+ "maxWidth",
5486
+ "maxHeight",
5487
+ "aspectRatio",
5488
+ "minWidth",
5489
+ "minHeight"
5490
+ ];
5491
+ for (const field of required) {
5492
+ if (!Number.isFinite(parsed[field]) || parsed[field] <= 0) {
5493
+ console.warn(`[ImageResizeOverlay] Invalid or missing metadata field: ${field}`);
5494
+ imageMetadata.value = null;
5495
+ return;
5496
+ }
5497
+ }
5498
+ imageMetadata.value = parsed;
5499
+ } catch (error) {
5500
+ imageMetadata.value = null;
5501
+ emit("resize-error", {
5502
+ error: error instanceof Error ? error.message : "Failed to parse image metadata",
5503
+ rawMetadata: props.imageElement?.getAttribute("data-image-metadata")
5504
+ });
5505
+ }
5506
+ }
5507
+ function onHandleMouseDown(event, handlePosition) {
5508
+ event.preventDefault();
5509
+ event.stopPropagation();
5510
+ if (!isValidEditor(props.editor) || !imageMetadata.value || !props.imageElement) return;
5511
+ const rect = props.imageElement.getBoundingClientRect();
5512
+ dragState.value = {
5513
+ handle: handlePosition,
5514
+ initialX: event.clientX,
5515
+ initialY: event.clientY,
5516
+ initialWidth: rect.width,
5517
+ initialHeight: rect.height,
5518
+ aspectRatio: imageMetadata.value.aspectRatio,
5519
+ constrainedWidth: rect.width,
5520
+ constrainedHeight: rect.height
5521
+ };
5522
+ const pmView = props.editor.view.dom;
5523
+ pmView.style.pointerEvents = "none";
5524
+ document.addEventListener("mousemove", onDocumentMouseMove);
5525
+ document.addEventListener("mouseup", onDocumentMouseUp);
5526
+ document.addEventListener("keydown", onEscapeKey);
5527
+ emit("resize-start", {
5528
+ blockId: props.imageElement.getAttribute("data-sd-block-id"),
5529
+ initialWidth: rect.width,
5530
+ initialHeight: rect.height
5531
+ });
5532
+ }
5533
+ function throttle(func, limit) {
5534
+ let inThrottle;
5535
+ let timeoutId = null;
5536
+ const throttled = function(...args) {
5537
+ if (!inThrottle) {
5538
+ func.apply(this, args);
5539
+ inThrottle = true;
5540
+ timeoutId = setTimeout(() => {
5541
+ inThrottle = false;
5542
+ timeoutId = null;
5543
+ }, limit);
5544
+ }
5545
+ };
5546
+ const cancel = () => {
5547
+ if (timeoutId !== null) {
5548
+ clearTimeout(timeoutId);
5549
+ timeoutId = null;
5550
+ inThrottle = false;
5551
+ }
5552
+ };
5553
+ return { throttled, cancel };
5554
+ }
5555
+ const mouseMoveThrottle = throttle((event) => {
5556
+ if (!dragState.value || !imageMetadata.value) return;
5557
+ let deltaX = event.clientX - dragState.value.initialX;
5558
+ let deltaY = event.clientY - dragState.value.initialY;
5559
+ const handle = dragState.value.handle;
5560
+ if (handle === "nw") {
5561
+ deltaX = -deltaX;
5562
+ deltaY = -deltaY;
5563
+ } else if (handle === "ne") {
5564
+ deltaY = -deltaY;
5565
+ } else if (handle === "sw") {
5566
+ deltaX = -deltaX;
5567
+ }
5568
+ const scaleX = (dragState.value.initialWidth + deltaX) / dragState.value.initialWidth;
5569
+ const scaleY = (dragState.value.initialHeight + deltaY) / dragState.value.initialHeight;
5570
+ const scale = Math.max(scaleX, scaleY);
5571
+ let newWidth = dragState.value.initialWidth * scale;
5572
+ let newHeight = dragState.value.initialHeight * scale;
5573
+ const minWidth = imageMetadata.value.minWidth;
5574
+ const minHeight = imageMetadata.value.minHeight;
5575
+ const maxWidth = imageMetadata.value.maxWidth;
5576
+ const maxHeight = imageMetadata.value.maxHeight;
5577
+ if (newWidth < minWidth) {
5578
+ newWidth = minWidth;
5579
+ newHeight = newWidth / dragState.value.aspectRatio;
5580
+ }
5581
+ if (newHeight < minHeight) {
5582
+ newHeight = minHeight;
5583
+ newWidth = newHeight * dragState.value.aspectRatio;
5584
+ }
5585
+ if (newWidth > maxWidth) {
5586
+ newWidth = maxWidth;
5587
+ newHeight = newWidth / dragState.value.aspectRatio;
5588
+ }
5589
+ if (newHeight > maxHeight) {
5590
+ newHeight = maxHeight;
5591
+ newWidth = newHeight * dragState.value.aspectRatio;
5592
+ }
5593
+ dragState.value.constrainedWidth = newWidth;
5594
+ dragState.value.constrainedHeight = newHeight;
5595
+ emit("resize-move", {
5596
+ blockId: props.imageElement.getAttribute("data-sd-block-id"),
5597
+ width: newWidth,
5598
+ height: newHeight
5599
+ });
5600
+ }, MOUSE_MOVE_THROTTLE_MS);
5601
+ const onDocumentMouseMove = mouseMoveThrottle.throttled;
5602
+ function onEscapeKey(event) {
5603
+ if (event.key === "Escape" && dragState.value) {
5604
+ forcedCleanup.value = true;
5605
+ onDocumentMouseUp(new MouseEvent("mouseup"));
5606
+ forcedCleanup.value = false;
5607
+ }
5608
+ }
5609
+ function onDocumentMouseUp(event) {
5610
+ if (!dragState.value) return;
5611
+ const finalWidth = dragState.value.constrainedWidth;
5612
+ const finalHeight = dragState.value.constrainedHeight;
5613
+ const blockId = props.imageElement?.getAttribute("data-sd-block-id");
5614
+ document.removeEventListener("mousemove", onDocumentMouseMove);
5615
+ document.removeEventListener("mouseup", onDocumentMouseUp);
5616
+ document.removeEventListener("keydown", onEscapeKey);
5617
+ if (props.editor?.view) {
5618
+ const pmView = props.editor.view.dom;
5619
+ if (pmView && pmView.style) {
5620
+ pmView.style.pointerEvents = "auto";
5621
+ }
5622
+ }
5623
+ const widthDelta = Math.abs(finalWidth - dragState.value.initialWidth);
5624
+ const heightDelta = Math.abs(finalHeight - dragState.value.initialHeight);
5625
+ if (!forcedCleanup.value && (widthDelta > DIMENSION_CHANGE_THRESHOLD_PX || heightDelta > DIMENSION_CHANGE_THRESHOLD_PX)) {
5626
+ dispatchResizeTransaction(blockId, finalWidth, finalHeight);
5627
+ emit("resize-end", {
5628
+ blockId,
5629
+ finalWidth,
5630
+ finalHeight
5631
+ });
5632
+ }
5633
+ dragState.value = null;
5634
+ }
5635
+ function dispatchResizeTransaction(blockId, newWidth, newHeight) {
5636
+ if (!isValidEditor(props.editor) || !props.imageElement) {
5637
+ return;
5638
+ }
5639
+ if (!Number.isFinite(newWidth) || !Number.isFinite(newHeight) || newWidth <= 0 || newHeight <= 0) {
5640
+ emit("resize-error", {
5641
+ blockId,
5642
+ error: "Invalid dimensions: width and height must be positive finite numbers"
5643
+ });
5644
+ return;
5645
+ }
5646
+ try {
5647
+ const { state, dispatch } = props.editor.view;
5648
+ const tr = state.tr;
5649
+ const pmStartAttr = props.imageElement.getAttribute("data-pm-start");
5650
+ if (!pmStartAttr) {
5651
+ emit("resize-error", {
5652
+ blockId,
5653
+ error: "Image position marker (data-pm-start) not found"
5654
+ });
5655
+ return;
5656
+ }
5657
+ const imagePos = parseInt(pmStartAttr, 10);
5658
+ if (!Number.isFinite(imagePos) || imagePos < 0) {
5659
+ emit("resize-error", {
5660
+ blockId,
5661
+ error: "Invalid image position marker"
5662
+ });
5663
+ return;
5664
+ }
5665
+ const imageNode = state.doc.nodeAt(imagePos);
5666
+ if (!imageNode || imageNode.type.name !== "image") {
5667
+ emit("resize-error", {
5668
+ blockId,
5669
+ error: "Invalid image node at position"
5670
+ });
5671
+ return;
5672
+ }
5673
+ const newAttrs = {
5674
+ ...imageNode.attrs,
5675
+ size: {
5676
+ width: Math.round(newWidth),
5677
+ height: Math.round(newHeight)
5678
+ }
5679
+ };
5680
+ tr.setNodeMarkup(imagePos, null, newAttrs);
5681
+ dispatch(tr);
5682
+ if (blockId && blockId.trim()) {
5683
+ measureCache.invalidate([blockId]);
5684
+ }
5685
+ emit("resize-success", { blockId, newWidth, newHeight });
5686
+ } catch (error) {
5687
+ emit("resize-error", {
5688
+ blockId,
5689
+ error: error instanceof Error ? error.message : String(error)
5690
+ });
5691
+ }
5692
+ }
5693
+ watch(
5694
+ () => props.imageElement,
5695
+ () => {
5696
+ parseImageMetadata();
5697
+ },
5698
+ { immediate: true }
5699
+ );
5700
+ watch(
5701
+ () => props.visible,
5702
+ (visible) => {
5703
+ if (visible) {
5704
+ parseImageMetadata();
5705
+ } else {
5706
+ if (dragState.value) {
5707
+ forcedCleanup.value = true;
5708
+ onDocumentMouseUp(new MouseEvent("mouseup"));
5709
+ forcedCleanup.value = false;
5710
+ }
5711
+ }
5712
+ }
5713
+ );
5714
+ onBeforeUnmount(() => {
5715
+ mouseMoveThrottle.cancel();
5716
+ if (dragState.value) {
5717
+ document.removeEventListener("mousemove", onDocumentMouseMove);
5718
+ document.removeEventListener("mouseup", onDocumentMouseUp);
5719
+ document.removeEventListener("keydown", onEscapeKey);
5720
+ if (props.editor?.view?.dom) {
5721
+ props.editor.view.dom.style.pointerEvents = "auto";
5722
+ }
5723
+ }
5724
+ });
5725
+ return (_ctx, _cache) => {
5726
+ return __props.visible && imageMetadata.value ? (openBlock(), createElementBlock("div", {
5727
+ key: 0,
5728
+ class: "superdoc-image-resize-overlay",
5729
+ style: normalizeStyle(overlayStyle.value),
5730
+ onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
5731
+ }, ["stop"]))
5732
+ }, [
5733
+ (openBlock(true), createElementBlock(Fragment, null, renderList(resizeHandles.value, (handle) => {
5734
+ return openBlock(), createElementBlock("div", {
5735
+ key: handle.position,
5736
+ class: normalizeClass(["resize-handle", {
5737
+ "resize-handle--active": dragState.value && dragState.value.handle === handle.position,
5738
+ [`resize-handle--${handle.position}`]: true
5739
+ }]),
5740
+ style: normalizeStyle(handle.style),
5741
+ "data-handle-position": handle.position,
5742
+ onMousedown: ($event) => onHandleMouseDown($event, handle.position)
5743
+ }, null, 46, _hoisted_1$2);
5744
+ }), 128)),
5745
+ dragState.value ? (openBlock(), createElementBlock("div", {
5746
+ key: 0,
5747
+ class: "resize-guideline",
5748
+ style: normalizeStyle(guidelineStyle.value)
5749
+ }, null, 4)) : createCommentVNode("", true)
5750
+ ], 36)) : createCommentVNode("", true);
5751
+ };
5752
+ }
5753
+ };
5754
+ const ImageResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-e66ec7bb"]]);
5322
5755
  function adjustPaginationBreaks(editorElem, editor) {
5323
5756
  if (!editorElem.value || !editor?.value?.options?.scale || isHeadless(editor)) return;
5324
5757
  const zoom = editor.value.options.scale;
@@ -5407,6 +5840,11 @@ const _sfc_main$1 = {
5407
5840
  visible: false,
5408
5841
  tableElement: null
5409
5842
  });
5843
+ const imageResizeState = reactive({
5844
+ visible: false,
5845
+ imageElement: null,
5846
+ blockId: null
5847
+ });
5410
5848
  const updateTableResizeOverlay = (event) => {
5411
5849
  if (!editorElem.value) return;
5412
5850
  let target = event.target;
@@ -5428,6 +5866,38 @@ const _sfc_main$1 = {
5428
5866
  tableResizeState.visible = false;
5429
5867
  tableResizeState.tableElement = null;
5430
5868
  };
5869
+ const updateImageResizeOverlay = (event) => {
5870
+ if (!editorElem.value) return;
5871
+ let target = event.target;
5872
+ while (target && target !== document.body) {
5873
+ if (target.classList?.contains("superdoc-image-resize-overlay") || target.closest?.(".superdoc-image-resize-overlay")) {
5874
+ return;
5875
+ }
5876
+ if (target.classList?.contains("superdoc-image-fragment") && target.hasAttribute("data-image-metadata")) {
5877
+ imageResizeState.visible = true;
5878
+ imageResizeState.imageElement = target;
5879
+ imageResizeState.blockId = target.getAttribute("data-sd-block-id");
5880
+ return;
5881
+ }
5882
+ target = target.parentElement;
5883
+ }
5884
+ imageResizeState.visible = false;
5885
+ imageResizeState.imageElement = null;
5886
+ imageResizeState.blockId = null;
5887
+ };
5888
+ const hideImageResizeOverlay = () => {
5889
+ imageResizeState.visible = false;
5890
+ imageResizeState.imageElement = null;
5891
+ imageResizeState.blockId = null;
5892
+ };
5893
+ const handleOverlayUpdates = (event) => {
5894
+ updateTableResizeOverlay(event);
5895
+ updateImageResizeOverlay(event);
5896
+ };
5897
+ const handleOverlayHide = () => {
5898
+ hideTableResizeOverlay();
5899
+ hideImageResizeOverlay();
5900
+ };
5431
5901
  let dataPollTimeout;
5432
5902
  const stopPolling = () => {
5433
5903
  clearTimeout(dataPollTimeout);
@@ -5514,6 +5984,22 @@ const _sfc_main$1 = {
5514
5984
  const paginationTarget = editor.value?.editor ? { value: base } : editor;
5515
5985
  adjustPaginationBreaks(editorElem, paginationTarget);
5516
5986
  });
5987
+ if (editor.value instanceof PresentationEditor) {
5988
+ editor.value.on("layoutUpdated", () => {
5989
+ if (imageResizeState.visible && imageResizeState.blockId) {
5990
+ const newElement = editorElem.value?.querySelector(
5991
+ `.superdoc-image-fragment[data-sd-block-id="${imageResizeState.blockId}"]`
5992
+ );
5993
+ if (newElement) {
5994
+ imageResizeState.imageElement = newElement;
5995
+ } else {
5996
+ imageResizeState.visible = false;
5997
+ imageResizeState.imageElement = null;
5998
+ imageResizeState.blockId = null;
5999
+ }
6000
+ }
6001
+ });
6002
+ }
5517
6003
  editor.value.on("collaborationReady", () => {
5518
6004
  setTimeout(() => {
5519
6005
  editorReady.value = true;
@@ -5598,8 +6084,8 @@ const _sfc_main$1 = {
5598
6084
  onKeydown: handleSuperEditorKeydown,
5599
6085
  onClick: handleSuperEditorClick,
5600
6086
  onMousedown: handleMarginClick,
5601
- onMousemove: updateTableResizeOverlay,
5602
- onMouseleave: hideTableResizeOverlay
6087
+ onMousemove: handleOverlayUpdates,
6088
+ onMouseleave: handleOverlayHide
5603
6089
  }, [
5604
6090
  createElementVNode("div", {
5605
6091
  ref_key: "editorElem",
@@ -5607,7 +6093,7 @@ const _sfc_main$1 = {
5607
6093
  class: "editor-element super-editor__element",
5608
6094
  role: "presentation"
5609
6095
  }, null, 512),
5610
- !contextMenuDisabled.value && editorReady.value && activeEditor.value ? (openBlock(), createBlock(_sfc_main$6, {
6096
+ !contextMenuDisabled.value && editorReady.value && activeEditor.value ? (openBlock(), createBlock(_sfc_main$7, {
5611
6097
  key: 0,
5612
6098
  editor: activeEditor.value,
5613
6099
  popoverControls,
@@ -5619,7 +6105,13 @@ const _sfc_main$1 = {
5619
6105
  editor: activeEditor.value,
5620
6106
  visible: tableResizeState.visible,
5621
6107
  tableElement: tableResizeState.tableElement
5622
- }, null, 8, ["editor", "visible", "tableElement"])) : createCommentVNode("", true)
6108
+ }, null, 8, ["editor", "visible", "tableElement"])) : createCommentVNode("", true),
6109
+ editorReady.value && activeEditor.value ? (openBlock(), createBlock(ImageResizeOverlay, {
6110
+ key: 2,
6111
+ editor: activeEditor.value,
6112
+ visible: imageResizeState.visible,
6113
+ imageElement: imageResizeState.imageElement
6114
+ }, null, 8, ["editor", "visible", "imageElement"])) : createCommentVNode("", true)
5623
6115
  ], 544),
5624
6116
  !editorReady.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
5625
6117
  createElementVNode("div", _hoisted_3, [
@@ -5682,7 +6174,7 @@ const _sfc_main$1 = {
5682
6174
  };
5683
6175
  }
5684
6176
  };
5685
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-f1e98438"]]);
6177
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-a84087aa"]]);
5686
6178
  const _hoisted_1 = ["innerHTML"];
5687
6179
  const _sfc_main = {
5688
6180
  __name: "SuperInput",
@@ -5774,98 +6266,6 @@ const _sfc_main = {
5774
6266
  }
5775
6267
  };
5776
6268
  const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
5777
- const additionalHandlers = Object.freeze({
5778
- "mc:AlternateContent": translator$1j,
5779
- "sd:pageReference": translator$1i,
5780
- "sd:tableOfContents": translator$1h,
5781
- "w:b": translator$1g,
5782
- "w:bCs": translator$1f,
5783
- "w:bidiVisual": translator$1e,
5784
- "w:bookmarkEnd": translator$1d,
5785
- "w:bookmarkStart": translator$1c,
5786
- "w:bottom": translator$1b,
5787
- "w:br": translator$1a,
5788
- "w:cantSplit": translator$19,
5789
- "w:caps": translator$18,
5790
- "w:cnfStyle": translator$17,
5791
- "w:color": translator$16,
5792
- "w:divId": translator$15,
5793
- "w:drawing": translator$14,
5794
- "w:end": translator$13,
5795
- "w:gridAfter": translator$12,
5796
- "w:gridBefore": translator$11,
5797
- "w:gridCol": translator$10,
5798
- "w:hidden": translator$$,
5799
- "w:highlight": translator$_,
5800
- "w:hyperlink": translator$Z,
5801
- "w:i": translator$Y,
5802
- "w:insideH": translator$X,
5803
- "w:insideV": translator$W,
5804
- "w:jc": translator$V,
5805
- "w:left": translator$U,
5806
- "w:p": translator$T,
5807
- "w:r": translator$S,
5808
- "w:rFonts": translator$R,
5809
- "w:rPr": translator$Q,
5810
- "w:rStyle": translator$P,
5811
- "w:right": translator$O,
5812
- "w:sdt": translator$N,
5813
- "w:shd": translator$M,
5814
- "w:start": translator$L,
5815
- "w:strike": translator$K,
5816
- "w:sz": translator$J,
5817
- "w:szCs": translator$I,
5818
- "w:tab": translator$H,
5819
- "w:tbl": translator$G,
5820
- "w:tblBorders": translator$F,
5821
- "w:tblCaption": translator$E,
5822
- "w:tblCellMar": translator$D,
5823
- "w:tblCellSpacing": translator$C,
5824
- "w:tblDescription": translator$B,
5825
- "w:tblGrid": translator$A,
5826
- "w:tblHeader": translator$z,
5827
- "w:tblInd": translator$y,
5828
- "w:tblLayout": translator$x,
5829
- "w:tblLook": translator$w,
5830
- "w:tblOverlap": translator$v,
5831
- "w:tblPr": translator$u,
5832
- "w:tblStyle": translator$t,
5833
- "w:tblStyleColBandSize": translator$s,
5834
- "w:tblStyleRowBandSize": translator$r,
5835
- "w:tblW": translator$q,
5836
- "w:tblpPr": translator$p,
5837
- "w:tc": translator$o,
5838
- "w:top": translator$n,
5839
- "w:tr": translator$m,
5840
- "w:trHeight": translator$l,
5841
- "w:trPr": translator$k,
5842
- "w:u": translator$j,
5843
- "w:wAfter": translator$i,
5844
- "w:wBefore": translator$h,
5845
- "wp:anchor": translator$g,
5846
- "wp:inline": translator$f,
5847
- "w:commentRangeStart": commentRangeStartTranslator,
5848
- "w:commentRangeEnd": commentRangeEndTranslator,
5849
- "w:vMerge": translator$e,
5850
- "w:gridSpan": translator$d,
5851
- "w:vAlign": translator$c,
5852
- "w:noWrap": translator$b,
5853
- "w:tcFitText": translator$a,
5854
- "w:tcW": translator$9,
5855
- "w:hideMark": translator$8,
5856
- "w:textDirection": translator$7,
5857
- "w:tl2br": translator$6,
5858
- "w:tr2bl": translator$5,
5859
- "w:header": translator$4,
5860
- "w:headers": translator$3,
5861
- "w:tcBorders": translator$2,
5862
- "w:tcMar": translator$1,
5863
- "w:tcPr": translator
5864
- });
5865
- const baseHandlers = {
5866
- ...additionalHandlers
5867
- };
5868
- const registeredHandlers = Object.freeze(baseHandlers);
5869
6269
  const Extensions = {
5870
6270
  Node,
5871
6271
  Attribute,
@@ -5880,14 +6280,14 @@ const Extensions = {
5880
6280
  export {
5881
6281
  AIWriter,
5882
6282
  z as AnnotatorHelpers,
5883
- _sfc_main$5 as BasicUpload,
6283
+ _sfc_main$6 as BasicUpload,
5884
6284
  F as CommentsPluginKey,
5885
6285
  D as DocxZipper,
5886
6286
  Editor,
5887
6287
  Extensions,
5888
6288
  PresentationEditor,
5889
6289
  B as SectionHelpers,
5890
- _sfc_main$6 as SlashMenu,
6290
+ _sfc_main$7 as SlashMenu,
5891
6291
  ac as SuperConverter,
5892
6292
  SuperEditor,
5893
6293
  SuperInput,
@@ -5902,6 +6302,6 @@ export {
5902
6302
  getRichTextExtensions,
5903
6303
  getStarterExtensions,
5904
6304
  a9 as helpers,
5905
- registeredHandlers,
6305
+ aP as registeredHandlers,
5906
6306
  x as trackChangesHelpers
5907
6307
  };