superdoc 1.0.0-beta.19 → 1.0.0-beta.20

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 (29) hide show
  1. package/dist/chunks/{PdfViewer-D_4g-jsZ.es.js → PdfViewer-CPnD95lv.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-BLFV17De.cjs → PdfViewer-DbSf6FKU.cjs} +1 -1
  3. package/dist/chunks/{index-NPXppXmC.es.js → index-BSHAWPko.es.js} +3 -3
  4. package/dist/chunks/{index-CRpn1mWd-B4eH8Zok.es.js → index-DHhKY9FZ-CyEU4GWR.es.js} +1 -1
  5. package/dist/chunks/{index-CRpn1mWd-BUbbd3Jq.cjs → index-DHhKY9FZ-DORT-UR6.cjs} +1 -1
  6. package/dist/chunks/{index-k02voMEs.cjs → index-DLco7m-w.cjs} +3 -3
  7. package/dist/chunks/{super-editor.es-C_Gk8cDd.cjs → super-editor.es-B6lsvAAY.cjs} +117 -38
  8. package/dist/chunks/{super-editor.es-CHU4dmes.es.js → super-editor.es-C0tdU_gq.es.js} +117 -38
  9. package/dist/style.css +6 -6
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-Cu26_LdN.js → converter-m2x13P8G.js} +2 -2
  12. package/dist/super-editor/chunks/{docx-zipper-C8lozSFd.js → docx-zipper-CRSKJF-o.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-BXC2Hzba.js → editor-C9r_Jbbg.js} +56 -35
  14. package/dist/super-editor/chunks/{index-CRpn1mWd.js → index-DHhKY9FZ.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-BglLOe8y.js → toolbar-fnptYAcU.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/style.css +6 -6
  21. package/dist/super-editor/super-editor.es.js +67 -9
  22. package/dist/super-editor/toolbar.es.js +2 -2
  23. package/dist/super-editor.cjs +1 -1
  24. package/dist/super-editor.es.js +1 -1
  25. package/dist/superdoc.cjs +2 -2
  26. package/dist/superdoc.es.js +2 -2
  27. package/dist/superdoc.umd.js +119 -40
  28. package/dist/superdoc.umd.js.map +1 -1
  29. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { y as defineComponent, z as h, O as Transition, a0 as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, u as createVNode, v as unref } from "./vue-Dysv_7z5.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-NPXppXmC.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-BSHAWPko.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-jWLMl8Ts.cjs");
4
- const superdoc = require("./index-k02voMEs.cjs");
4
+ const superdoc = require("./index-DLco7m-w.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,4 +1,4 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-CHU4dmes.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-C0tdU_gq.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-CcXAdeql.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -17214,7 +17214,7 @@ const _sfc_main = {
17214
17214
  __name: "SuperDoc",
17215
17215
  emits: ["selection-update"],
17216
17216
  setup(__props, { emit: __emit }) {
17217
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-D_4g-jsZ.es.js"));
17217
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CPnD95lv.es.js"));
17218
17218
  const superdocStore = useSuperdocStore();
17219
17219
  const commentsStore = useCommentsStore();
17220
17220
  const {
@@ -18067,7 +18067,7 @@ class SuperDoc extends EventEmitter {
18067
18067
  this.config.colors = shuffleArray(this.config.colors);
18068
18068
  this.userColorMap = /* @__PURE__ */ new Map();
18069
18069
  this.colorIndex = 0;
18070
- this.version = "1.0.0-beta.19";
18070
+ this.version = "1.0.0-beta.20";
18071
18071
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18072
18072
  this.superdocId = config.superdocId || v4();
18073
18073
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-CHU4dmes.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-C0tdU_gq.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./super-editor.es-C_Gk8cDd.cjs");
3
+ const superEditor_es = require("./super-editor.es-B6lsvAAY.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-C_Gk8cDd.cjs");
2
+ const superEditor_es = require("./super-editor.es-B6lsvAAY.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-DQmQUge-.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -17231,7 +17231,7 @@ const _sfc_main = {
17231
17231
  __name: "SuperDoc",
17232
17232
  emits: ["selection-update"],
17233
17233
  setup(__props, { emit: __emit }) {
17234
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BLFV17De.cjs")));
17234
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DbSf6FKU.cjs")));
17235
17235
  const superdocStore = useSuperdocStore();
17236
17236
  const commentsStore = useCommentsStore();
17237
17237
  const {
@@ -18084,7 +18084,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18084
18084
  this.config.colors = shuffleArray(this.config.colors);
18085
18085
  this.userColorMap = /* @__PURE__ */ new Map();
18086
18086
  this.colorIndex = 0;
18087
- this.version = "1.0.0-beta.19";
18087
+ this.version = "1.0.0-beta.20";
18088
18088
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18089
18089
  this.superdocId = config.superdocId || uuid.v4();
18090
18090
  this.colors = this.config.colors;
@@ -33485,7 +33485,7 @@ const encode$1 = (params2, encodedAttrs = {}) => {
33485
33485
  text = elements[0].text;
33486
33486
  const xmlSpace = encodedAttrs.xmlSpace ?? elements[0]?.attributes?.["xml:space"];
33487
33487
  if (xmlSpace !== "preserve" && typeof text === "string") {
33488
- text = text.replace(/^\s+/, "").replace(/\s+$/, "");
33488
+ text = text.replace(/^[ \t\n\r]+/, "").replace(/[ \t\n\r]+$/, "");
33489
33489
  }
33490
33490
  text = text.replace(/\[\[sdspace\]\]/g, "");
33491
33491
  } else if (!elements.length && encodedAttrs.xmlSpace === "preserve") {
@@ -36388,7 +36388,7 @@ const _SuperConverter = class _SuperConverter2 {
36388
36388
  static getStoredSuperdocVersion(docx) {
36389
36389
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
36390
36390
  }
36391
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.19") {
36391
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.20") {
36392
36392
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
36393
36393
  }
36394
36394
  /**
@@ -53505,7 +53505,7 @@ const isHeadless = (editor) => {
53505
53505
  const shouldSkipNodeView = (editor) => {
53506
53506
  return isHeadless(editor);
53507
53507
  };
53508
- const summaryVersion = "1.0.0-beta.19";
53508
+ const summaryVersion = "1.0.0-beta.20";
53509
53509
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
53510
53510
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
53511
53511
  function mapAttributes(attrs) {
@@ -54281,7 +54281,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
54281
54281
  { default: remarkStringify },
54282
54282
  { default: remarkGfm }
54283
54283
  ] = await Promise.all([
54284
- Promise.resolve().then(() => require("./index-CRpn1mWd-BUbbd3Jq.cjs")),
54284
+ Promise.resolve().then(() => require("./index-DHhKY9FZ-DORT-UR6.cjs")),
54285
54285
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
54286
54286
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
54287
54287
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -54486,7 +54486,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
54486
54486
  * Process collaboration migrations
54487
54487
  */
54488
54488
  processCollaborationMigrations() {
54489
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.19");
54489
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.20");
54490
54490
  if (!this.options.ydoc) return;
54491
54491
  const metaMap = this.options.ydoc.getMap("meta");
54492
54492
  let docVersion = metaMap.get("version");
@@ -56500,6 +56500,12 @@ const applyTextStyleMark = (run2, attrs, themeColors) => {
56500
56500
  run2.letterSpacing = spacing;
56501
56501
  }
56502
56502
  }
56503
+ if (typeof attrs.textTransform === "string") {
56504
+ const transform = attrs.textTransform;
56505
+ if (transform === "uppercase" || transform === "lowercase" || transform === "capitalize" || transform === "none") {
56506
+ run2.textTransform = transform;
56507
+ }
56508
+ }
56503
56509
  };
56504
56510
  const DEFAULT_HYPERLINK_CONFIG = {
56505
56511
  enableRichHyperlinks: false
@@ -58508,6 +58514,16 @@ const parseNumberAttr = (value) => {
58508
58514
  const num = typeof value === "number" ? value : Number.parseInt(String(value), 10);
58509
58515
  return Number.isFinite(num) ? num : void 0;
58510
58516
  };
58517
+ const mergeSpacingSources = (base2, paragraphProps, attrs) => {
58518
+ const isObject2 = (v2) => v2 !== null && typeof v2 === "object";
58519
+ const baseObj = isObject2(base2) ? base2 : {};
58520
+ const propsObj = isObject2(paragraphProps) ? paragraphProps : {};
58521
+ const attrsObj = isObject2(attrs) ? attrs : {};
58522
+ if (Object.keys(baseObj).length === 0 && Object.keys(propsObj).length === 0 && Object.keys(attrsObj).length === 0) {
58523
+ return void 0;
58524
+ }
58525
+ return { ...baseObj, ...propsObj, ...attrsObj };
58526
+ };
58511
58527
  const normalizeNumFmt = (value) => {
58512
58528
  if (typeof value !== "string") return void 0;
58513
58529
  switch (value) {
@@ -59042,8 +59058,8 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
59042
59058
  const attrs = para.attrs ?? {};
59043
59059
  const paragraphProps = typeof attrs.paragraphProperties === "object" && attrs.paragraphProperties !== null ? attrs.paragraphProperties : {};
59044
59060
  const hydrated = hydrationOverride ?? hydrateParagraphStyleAttrs(para, converterContext);
59045
- const spacingSource = attrs.spacing !== void 0 ? attrs.spacing : paragraphProps.spacing !== void 0 ? paragraphProps.spacing : hydrated?.spacing;
59046
- const normalizedSpacing = normalizeParagraphSpacing(spacingSource);
59061
+ const mergedSpacing = mergeSpacingSources(hydrated?.spacing, paragraphProps.spacing, attrs.spacing);
59062
+ const normalizedSpacing = normalizeParagraphSpacing(mergedSpacing);
59047
59063
  const indentSource = attrs.indent ?? paragraphProps.indent ?? hydrated?.indent;
59048
59064
  const normalizedIndent = normalizePxIndent(indentSource) ?? normalizeParagraphIndent(indentSource ?? attrs.textIndent);
59049
59065
  const unwrapTabStops = (tabStops) => {
@@ -69462,6 +69478,12 @@ const renderTableCell = (deps) => {
69462
69478
  fromLine,
69463
69479
  toLine
69464
69480
  } = deps;
69481
+ const attrs = cell?.attrs;
69482
+ const padding = attrs?.padding || { top: 2, left: 4, right: 4, bottom: 2 };
69483
+ const paddingLeft = padding.left ?? 4;
69484
+ const paddingTop = padding.top ?? 2;
69485
+ const paddingRight = padding.right ?? 4;
69486
+ const paddingBottom = padding.bottom ?? 2;
69465
69487
  const cellEl = doc2.createElement("div");
69466
69488
  cellEl.style.position = "absolute";
69467
69489
  cellEl.style.left = `${x2}px`;
@@ -69470,39 +69492,25 @@ const renderTableCell = (deps) => {
69470
69492
  cellEl.style.height = `${rowHeight}px`;
69471
69493
  cellEl.style.boxSizing = "border-box";
69472
69494
  cellEl.style.overflow = "hidden";
69495
+ cellEl.style.paddingLeft = `${paddingLeft}px`;
69496
+ cellEl.style.paddingTop = `${paddingTop}px`;
69497
+ cellEl.style.paddingRight = `${paddingRight}px`;
69498
+ cellEl.style.paddingBottom = `${paddingBottom}px`;
69473
69499
  if (borders) {
69474
69500
  applyCellBorders(cellEl, borders);
69475
69501
  }
69476
69502
  if (cell?.attrs?.background) {
69477
69503
  cellEl.style.backgroundColor = cell.attrs.background;
69478
69504
  }
69479
- if (cell?.attrs?.verticalAlign) {
69480
- cellEl.style.display = "flex";
69481
- cellEl.style.flexDirection = "column";
69482
- cellEl.style.justifyContent = cell.attrs.verticalAlign === "top" ? "flex-start" : cell.attrs.verticalAlign === "bottom" ? "flex-end" : "center";
69483
- }
69484
- let contentElement;
69485
- const attrs = cell?.attrs;
69486
- const padding = attrs?.padding || { top: 2, left: 4, right: 4, bottom: 2 };
69487
- const paddingLeft = padding.left ?? 4;
69488
- const paddingTop = padding.top ?? 2;
69489
- const paddingRight = padding.right ?? 4;
69490
- const paddingBottom = padding.bottom ?? 2;
69491
69505
  const cellBlocks = cell?.blocks ?? (cell?.paragraph ? [cell.paragraph] : []);
69492
69506
  const blockMeasures = cellMeasure?.blocks ?? (cellMeasure?.paragraph ? [cellMeasure.paragraph] : []);
69493
69507
  if (cellBlocks.length > 0 && blockMeasures.length > 0) {
69494
69508
  const content = doc2.createElement("div");
69495
- content.style.position = "absolute";
69496
- content.style.left = `${x2 + paddingLeft}px`;
69497
- content.style.top = `${y2 + paddingTop}px`;
69498
- const contentWidth = Math.max(0, cellMeasure.width - paddingLeft - paddingRight);
69499
- const contentHeight = Math.max(0, rowHeight - paddingTop - paddingBottom);
69500
- content.style.width = `${contentWidth + 1}px`;
69501
- content.style.height = `${contentHeight}px`;
69509
+ content.style.position = "relative";
69510
+ content.style.width = "100%";
69511
+ content.style.height = "100%";
69502
69512
  content.style.display = "flex";
69503
69513
  content.style.flexDirection = "column";
69504
- content.style.overflowX = "visible";
69505
- content.style.overflowY = "hidden";
69506
69514
  if (cell?.attrs?.verticalAlign === "center") {
69507
69515
  content.style.justifyContent = "center";
69508
69516
  } else if (cell?.attrs?.verticalAlign === "bottom") {
@@ -69510,6 +69518,7 @@ const renderTableCell = (deps) => {
69510
69518
  } else {
69511
69519
  content.style.justifyContent = "flex-start";
69512
69520
  }
69521
+ cellEl.appendChild(content);
69513
69522
  const blockLineCounts = [];
69514
69523
  for (let i = 0; i < Math.min(blockMeasures.length, cellBlocks.length); i++) {
69515
69524
  const bm = blockMeasures[i];
@@ -69561,14 +69570,19 @@ const renderTableCell = (deps) => {
69561
69570
  if (renderedHeight > 0) {
69562
69571
  paraWrapper.style.height = `${renderedHeight}px`;
69563
69572
  }
69573
+ if (renderedEntireBlock) {
69574
+ const spacingAfter = block.attrs?.spacing?.after;
69575
+ if (typeof spacingAfter === "number" && spacingAfter > 0) {
69576
+ paraWrapper.style.marginBottom = `${spacingAfter}px`;
69577
+ }
69578
+ }
69564
69579
  cumulativeLineCount += blockLineCount;
69565
69580
  } else {
69566
69581
  cumulativeLineCount += 0;
69567
69582
  }
69568
69583
  }
69569
- contentElement = content;
69570
69584
  }
69571
- return { cellElement: cellEl, contentElement };
69585
+ return { cellElement: cellEl };
69572
69586
  };
69573
69587
  const renderTableRow = (deps) => {
69574
69588
  const {
@@ -69671,7 +69685,7 @@ const renderTableRow = (deps) => {
69671
69685
  }
69672
69686
  const fromLine = partialRow?.fromLineByCell?.[cellIndex];
69673
69687
  const toLine = partialRow?.toLineByCell?.[cellIndex];
69674
- const { cellElement, contentElement } = renderTableCell({
69688
+ const { cellElement } = renderTableCell({
69675
69689
  doc: doc2,
69676
69690
  x: x2,
69677
69691
  y: y2,
@@ -69686,9 +69700,6 @@ const renderTableRow = (deps) => {
69686
69700
  toLine
69687
69701
  });
69688
69702
  container.appendChild(cellElement);
69689
- if (contentElement) {
69690
- container.appendChild(contentElement);
69691
- }
69692
69703
  }
69693
69704
  };
69694
69705
  const renderTableFragment = (deps) => {
@@ -72531,6 +72542,9 @@ const applyRunStyles = (element, run2, _isLink = false) => {
72531
72542
  if (run2.highlight) {
72532
72543
  element.style.backgroundColor = run2.highlight;
72533
72544
  }
72545
+ if (run2.textTransform) {
72546
+ element.style.textTransform = run2.textTransform;
72547
+ }
72534
72548
  const decorations = [];
72535
72549
  if (run2.underline) {
72536
72550
  decorations.push("underline");
@@ -73647,11 +73661,18 @@ async function measureTableBlock(block, constraints) {
73647
73661
  const blockMeasures = [];
73648
73662
  let contentHeight = 0;
73649
73663
  const cellBlocks = cell.blocks ?? (cell.paragraph ? [cell.paragraph] : []);
73650
- for (const block2 of cellBlocks) {
73664
+ for (let blockIndex = 0; blockIndex < cellBlocks.length; blockIndex++) {
73665
+ const block2 = cellBlocks[blockIndex];
73651
73666
  const measure = await measureBlock(block2, { maxWidth: contentWidth, maxHeight: Infinity });
73652
73667
  blockMeasures.push(measure);
73653
73668
  const blockHeight = "totalHeight" in measure ? measure.totalHeight : "height" in measure ? measure.height : 0;
73654
73669
  contentHeight += blockHeight;
73670
+ if (block2.kind === "paragraph") {
73671
+ const spacingAfter = block2.attrs?.spacing?.after;
73672
+ if (typeof spacingAfter === "number" && spacingAfter > 0) {
73673
+ contentHeight += spacingAfter;
73674
+ }
73675
+ }
73655
73676
  }
73656
73677
  const totalCellHeight = contentHeight + paddingTop + paddingBottom;
73657
73678
  cellMeasures.push({
@@ -114014,6 +114035,8 @@ const _hoisted_2 = {
114014
114035
  };
114015
114036
  const _hoisted_3 = { class: "placeholder-title" };
114016
114037
  const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
114038
+ const TABLE_RESIZE_HOVER_THRESHOLD = 8;
114039
+ const TABLE_RESIZE_THROTTLE_MS = 16;
114017
114040
  const _sfc_main$1 = {
114018
114041
  __name: "SuperEditor",
114019
114042
  props: {
@@ -114083,7 +114106,58 @@ const _sfc_main$1 = {
114083
114106
  imageElement: null,
114084
114107
  blockId: null
114085
114108
  });
114109
+ let lastUpdateTableResizeTimestamp = 0;
114110
+ const isNearColumnBoundary = (event, tableElement) => {
114111
+ if (!event || typeof event.clientX !== "number" || typeof event.clientY !== "number") {
114112
+ console.warn("[isNearColumnBoundary] Invalid event: missing clientX or clientY", event);
114113
+ return false;
114114
+ }
114115
+ if (!tableElement || !(tableElement instanceof HTMLElement)) {
114116
+ console.warn("[isNearColumnBoundary] Invalid tableElement: not an HTMLElement", tableElement);
114117
+ return false;
114118
+ }
114119
+ const boundariesAttr = tableElement.getAttribute("data-table-boundaries");
114120
+ if (!boundariesAttr) return false;
114121
+ try {
114122
+ const metadata = JSON.parse(boundariesAttr);
114123
+ if (!metadata.columns || !Array.isArray(metadata.columns)) return false;
114124
+ const tableRect = tableElement.getBoundingClientRect();
114125
+ const mouseX = event.clientX - tableRect.left;
114126
+ const mouseY = event.clientY - tableRect.top;
114127
+ for (let i2 = 0; i2 < metadata.columns.length; i2++) {
114128
+ const col = metadata.columns[i2];
114129
+ const boundaryX = col.x + col.w;
114130
+ if (Math.abs(mouseX - boundaryX) <= TABLE_RESIZE_HOVER_THRESHOLD) {
114131
+ const segmentColIndex = i2 + 1;
114132
+ const segments = metadata.segments?.[segmentColIndex];
114133
+ if (!segments || segments.length === 0) {
114134
+ if (i2 === metadata.columns.length - 1) return true;
114135
+ continue;
114136
+ }
114137
+ for (const seg of segments) {
114138
+ const segTop = seg.y || 0;
114139
+ const segBottom = seg.h != null ? segTop + seg.h : tableRect.height;
114140
+ if (mouseY >= segTop && mouseY <= segBottom) {
114141
+ return true;
114142
+ }
114143
+ }
114144
+ }
114145
+ }
114146
+ if (Math.abs(mouseX) <= TABLE_RESIZE_HOVER_THRESHOLD) {
114147
+ return true;
114148
+ }
114149
+ return false;
114150
+ } catch (e) {
114151
+ console.warn("[isNearColumnBoundary] Failed to parse table boundary metadata:", e);
114152
+ return false;
114153
+ }
114154
+ };
114086
114155
  const updateTableResizeOverlay = (event) => {
114156
+ const now = Date.now();
114157
+ if (now - lastUpdateTableResizeTimestamp < TABLE_RESIZE_THROTTLE_MS) {
114158
+ return;
114159
+ }
114160
+ lastUpdateTableResizeTimestamp = now;
114087
114161
  if (!editorElem.value) return;
114088
114162
  let target = event.target;
114089
114163
  while (target && target !== editorElem.value) {
@@ -114091,8 +114165,13 @@ const _sfc_main$1 = {
114091
114165
  return;
114092
114166
  }
114093
114167
  if (target.classList?.contains("superdoc-table-fragment") && target.hasAttribute("data-table-boundaries")) {
114094
- tableResizeState.visible = true;
114095
- tableResizeState.tableElement = target;
114168
+ if (isNearColumnBoundary(event, target)) {
114169
+ tableResizeState.visible = true;
114170
+ tableResizeState.tableElement = target;
114171
+ } else {
114172
+ tableResizeState.visible = false;
114173
+ tableResizeState.tableElement = null;
114174
+ }
114096
114175
  return;
114097
114176
  }
114098
114177
  target = target.parentElement;
@@ -114419,7 +114498,7 @@ const _sfc_main$1 = {
114419
114498
  };
114420
114499
  }
114421
114500
  };
114422
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-08b32c3d"]]);
114501
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ed5a08ee"]]);
114423
114502
  const _hoisted_1 = ["innerHTML"];
114424
114503
  const _sfc_main = {
114425
114504
  __name: "SuperInput",