superdoc 1.0.0-beta.10 → 1.0.0-beta.12

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--YMlVUNN.es.js → PdfViewer-BL2O6Y4C.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-H8A08hnq.cjs → PdfViewer-CWb8_m3N.cjs} +1 -1
  3. package/dist/chunks/{index-B7kE5mis.cjs → index-ANaY3G41.cjs} +3 -3
  4. package/dist/chunks/{index-BrS4iO03.es.js → index-Bs29IidK.es.js} +3 -3
  5. package/dist/chunks/{index-CC6Vsniy-D24AMjnI.cjs → index-Cha-6AFg-28WIXlKN.cjs} +1 -1
  6. package/dist/chunks/{index-CC6Vsniy-En79I7vb.es.js → index-Cha-6AFg-3WCQFN4m.es.js} +1 -1
  7. package/dist/chunks/{super-editor.es-C3Mtq3FL.es.js → super-editor.es-C-5T9RJI.es.js} +214 -73
  8. package/dist/chunks/{super-editor.es-Bf7zv4k5.cjs → super-editor.es-CBMp55sv.cjs} +214 -73
  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-xQmDrmCk.js → converter-B4P0mjU2.js} +1 -1
  12. package/dist/super-editor/chunks/{docx-zipper-BKkVPA0E.js → docx-zipper-D5Do5rOh.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-C0RiU_sq.js → editor-CoLzF_z4.js} +171 -55
  14. package/dist/super-editor/chunks/{index-CC6Vsniy.js → index-Cha-6AFg.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-BznN8wrp.js → toolbar-Bt8ifcaq.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 +2 -2
  20. package/dist/super-editor/style.css +6 -6
  21. package/dist/super-editor/super-editor.es.js +49 -24
  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 +216 -75
  28. package/dist/superdoc.umd.js.map +1 -1
  29. package/package.json +1 -1
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-Bf7zv4k5.cjs");
4
- const superdoc = require("./chunks/index-B7kE5mis.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CBMp55sv.cjs");
4
+ const superdoc = require("./chunks/index-ANaY3G41.cjs");
5
5
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
7
7
  exports.Editor = superEditor_es.Editor;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-C3Mtq3FL.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-BrS4iO03.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-C-5T9RJI.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-Bs29IidK.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,
@@ -35606,7 +35606,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35606
35606
  static getStoredSuperdocVersion(docx) {
35607
35607
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
35608
35608
  }
35609
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.10") {
35609
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.12") {
35610
35610
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
35611
35611
  }
35612
35612
  /**
@@ -60094,7 +60094,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
60094
60094
  const shouldSkipNodeView = (editor) => {
60095
60095
  return isHeadless(editor);
60096
60096
  };
60097
- const summaryVersion = "1.0.0-beta.10";
60097
+ const summaryVersion = "1.0.0-beta.12";
60098
60098
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
60099
60099
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
60100
60100
  function mapAttributes(attrs) {
@@ -60873,7 +60873,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
60873
60873
  { default: remarkStringify2 },
60874
60874
  { default: remarkGfm2 }
60875
60875
  ] = await Promise.all([
60876
- Promise.resolve().then(() => indexCC6Vsniy),
60876
+ Promise.resolve().then(() => indexCha6AFg),
60877
60877
  Promise.resolve().then(() => indexDRCvimau),
60878
60878
  Promise.resolve().then(() => indexC_x_N6Uh),
60879
60879
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -61078,7 +61078,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61078
61078
  * Process collaboration migrations
61079
61079
  */
61080
61080
  processCollaborationMigrations() {
61081
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.10");
61081
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.12");
61082
61082
  if (!this.options.ydoc) return;
61083
61083
  const metaMap = this.options.ydoc.getMap("meta");
61084
61084
  let docVersion = metaMap.get("version");
@@ -65179,28 +65179,42 @@ Please report this to https://github.com/markedjs/marked.`, e) {
65179
65179
  const indentSource = attrs.indent ?? paragraphProps.indent ?? hydrated?.indent;
65180
65180
  const normalizedIndent = normalizePxIndent(indentSource) ?? normalizeParagraphIndent(indentSource ?? attrs.textIndent);
65181
65181
  const unwrapTabStops = (tabStops) => {
65182
- if (!Array.isArray(tabStops)) return void 0;
65182
+ if (!Array.isArray(tabStops)) {
65183
+ return void 0;
65184
+ }
65183
65185
  const unwrapped = [];
65184
65186
  for (const entry of tabStops) {
65185
- if (entry && typeof entry === "object" && "tab" in entry) {
65186
- const tab = entry.tab;
65187
- if (tab && typeof tab === "object") {
65188
- const tabObj = tab;
65189
- const val = typeof tabObj.tabType === "string" ? tabObj.tabType : typeof tabObj.val === "string" ? tabObj.val : void 0;
65190
- const pos = pickNumber(tabObj.originalPos ?? tabObj.pos);
65191
- if (val && pos != null) {
65192
- const normalized = { val, pos };
65193
- const leader = tabObj.leader;
65194
- if (typeof leader === "string") normalized.leader = leader;
65195
- const originalPos = pickNumber(tabObj.originalPos);
65196
- if (originalPos != null) normalized.originalPos = originalPos;
65197
- unwrapped.push(normalized);
65198
- continue;
65199
- }
65187
+ if (!entry || typeof entry !== "object") {
65188
+ continue;
65189
+ }
65190
+ if ("tab" in entry) {
65191
+ const entryRecord2 = entry;
65192
+ const tab = entryRecord2.tab;
65193
+ if (!tab || typeof tab !== "object") {
65194
+ continue;
65200
65195
  }
65196
+ const tabObj = tab;
65197
+ const val = typeof tabObj.tabType === "string" ? tabObj.tabType : typeof tabObj.val === "string" ? tabObj.val : void 0;
65198
+ const pos = pickNumber(tabObj.originalPos ?? tabObj.pos);
65199
+ if (!val || pos == null) {
65200
+ continue;
65201
+ }
65202
+ const normalized = { val, pos };
65203
+ const leader = tabObj.leader;
65204
+ if (typeof leader === "string" && leader.length > 0) {
65205
+ normalized.leader = leader;
65206
+ }
65207
+ const originalPos = pickNumber(tabObj.originalPos);
65208
+ if (originalPos != null && Number.isFinite(originalPos)) {
65209
+ normalized.originalPos = originalPos;
65210
+ }
65211
+ unwrapped.push(normalized);
65212
+ continue;
65201
65213
  }
65202
- if (entry && typeof entry === "object") {
65203
- unwrapped.push(entry);
65214
+ const entryRecord = entry;
65215
+ const hasValidStructure = ("val" in entryRecord || "tabType" in entryRecord) && ("pos" in entryRecord || "originalPos" in entryRecord);
65216
+ if (hasValidStructure) {
65217
+ unwrapped.push(entryRecord);
65204
65218
  }
65205
65219
  }
65206
65220
  return unwrapped.length > 0 ? unwrapped : void 0;
@@ -73035,7 +73049,7 @@ ${l}
73035
73049
  };
73036
73050
  };
73037
73051
  const renderTableCell = (deps) => {
73038
- const { doc: doc2, x: x2, y: y2, rowHeight, cellMeasure, cell: cell2, borders, useDefaultBorder, renderLine, context, applySdtDataset } = deps;
73052
+ const { doc: doc2, x: x2, y: y2, rowHeight, cellMeasure, cell: cell2, borders, renderLine, context, applySdtDataset } = deps;
73039
73053
  const cellEl = doc2.createElement("div");
73040
73054
  cellEl.style.position = "absolute";
73041
73055
  cellEl.style.left = `${x2}px`;
@@ -73045,8 +73059,6 @@ ${l}
73045
73059
  cellEl.style.boxSizing = "border-box";
73046
73060
  if (borders) {
73047
73061
  applyCellBorders(cellEl, borders);
73048
- } else if (useDefaultBorder) {
73049
- cellEl.style.border = "1px solid rgba(0,0,0,0.6)";
73050
73062
  }
73051
73063
  if (cell2?.attrs?.background) {
73052
73064
  cellEl.style.backgroundColor = cell2.attrs.background;
@@ -73088,25 +73100,55 @@ ${l}
73088
73100
  row: row2,
73089
73101
  totalRows,
73090
73102
  tableBorders,
73103
+ columnWidths,
73104
+ allRowHeights,
73091
73105
  context,
73092
73106
  renderLine,
73093
73107
  applySdtDataset
73094
73108
  } = deps;
73095
- let x2 = 0;
73109
+ const calculateXPosition = (gridColumnStart) => {
73110
+ let x2 = 0;
73111
+ for (let i2 = 0; i2 < gridColumnStart && i2 < columnWidths.length; i2++) {
73112
+ x2 += columnWidths[i2];
73113
+ }
73114
+ return x2;
73115
+ };
73116
+ const calculateRowspanHeight = (startRowIndex, rowSpan) => {
73117
+ let totalHeight = 0;
73118
+ for (let i2 = 0; i2 < rowSpan && startRowIndex + i2 < allRowHeights.length; i2++) {
73119
+ totalHeight += allRowHeights[startRowIndex + i2];
73120
+ }
73121
+ return totalHeight;
73122
+ };
73096
73123
  for (let cellIndex = 0; cellIndex < rowMeasure.cells.length; cellIndex += 1) {
73097
73124
  const cellMeasure = rowMeasure.cells[cellIndex];
73098
73125
  const cell2 = row2?.cells?.[cellIndex];
73099
- const hasExplicitBorders = Boolean(cell2?.attrs?.borders);
73100
- const resolvedBorders = hasExplicitBorders ? cell2?.attrs?.borders : tableBorders ? resolveTableCellBorders(tableBorders, rowIndex, cellIndex, totalRows, rowMeasure.cells.length) : void 0;
73126
+ const x2 = cellMeasure.gridColumnStart != null ? calculateXPosition(cellMeasure.gridColumnStart) : cellIndex === 0 ? 0 : calculateXPosition(cellIndex);
73127
+ const cellBordersAttr = cell2?.attrs?.borders;
73128
+ const hasBordersAttribute = cellBordersAttr !== void 0;
73129
+ const hasExplicitBorders = hasBordersAttribute && cellBordersAttr && (cellBordersAttr.top !== void 0 || cellBordersAttr.right !== void 0 || cellBordersAttr.bottom !== void 0 || cellBordersAttr.left !== void 0);
73130
+ const gridColIndex = cellMeasure.gridColumnStart ?? cellIndex;
73131
+ const totalCols = columnWidths.length;
73132
+ let resolvedBorders;
73133
+ if (hasExplicitBorders) {
73134
+ resolvedBorders = cellBordersAttr;
73135
+ } else if (hasBordersAttribute) {
73136
+ resolvedBorders = void 0;
73137
+ } else if (tableBorders) {
73138
+ resolvedBorders = resolveTableCellBorders(tableBorders, rowIndex, gridColIndex, totalRows, totalCols);
73139
+ } else {
73140
+ resolvedBorders = void 0;
73141
+ }
73142
+ const rowSpan = cellMeasure.rowSpan ?? 1;
73143
+ const cellHeight = rowSpan > 1 ? calculateRowspanHeight(rowIndex, rowSpan) : rowMeasure.height;
73101
73144
  const { cellElement, contentElement } = renderTableCell({
73102
73145
  doc: doc2,
73103
73146
  x: x2,
73104
73147
  y: y2,
73105
- rowHeight: rowMeasure.height,
73148
+ rowHeight: cellHeight,
73106
73149
  cellMeasure,
73107
73150
  cell: cell2,
73108
73151
  borders: resolvedBorders,
73109
- useDefaultBorder: !hasExplicitBorders && !tableBorders,
73110
73152
  renderLine,
73111
73153
  context,
73112
73154
  applySdtDataset
@@ -73115,7 +73157,6 @@ ${l}
73115
73157
  if (contentElement) {
73116
73158
  container.appendChild(contentElement);
73117
73159
  }
73118
- x2 += cellMeasure.width;
73119
73160
  }
73120
73161
  };
73121
73162
  const renderTableFragment = (deps) => {
@@ -73157,6 +73198,45 @@ ${l}
73157
73198
  applySdtDataset(container, block.attrs?.sdt);
73158
73199
  container.classList.add("superdoc-table-fragment");
73159
73200
  if (fragment.metadata?.columnBoundaries) {
73201
+ const columnCount = measure.columnWidths.length;
73202
+ const rowCount = block.rows.length;
73203
+ const boundarySegments = [];
73204
+ for (let i2 = 0; i2 < columnCount; i2++) {
73205
+ boundarySegments.push([]);
73206
+ }
73207
+ let rowY = 0;
73208
+ for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
73209
+ const rowMeasure = measure.rows[rowIndex];
73210
+ if (!rowMeasure) continue;
73211
+ const boundariesInRow = /* @__PURE__ */ new Set();
73212
+ for (const cellMeasure of rowMeasure.cells) {
73213
+ const startCol = cellMeasure.gridColumnStart ?? 0;
73214
+ const colSpan = cellMeasure.colSpan ?? 1;
73215
+ const endCol = startCol + colSpan;
73216
+ if (startCol > 0) {
73217
+ boundariesInRow.add(startCol);
73218
+ }
73219
+ if (endCol < columnCount) {
73220
+ boundariesInRow.add(endCol);
73221
+ }
73222
+ }
73223
+ for (const boundaryCol of boundariesInRow) {
73224
+ const segments = boundarySegments[boundaryCol];
73225
+ const lastSegment = segments[segments.length - 1];
73226
+ if (lastSegment && lastSegment.toRow === rowIndex) {
73227
+ lastSegment.toRow = rowIndex + 1;
73228
+ lastSegment.height += rowMeasure.height;
73229
+ } else {
73230
+ segments.push({
73231
+ fromRow: rowIndex,
73232
+ toRow: rowIndex + 1,
73233
+ y: rowY,
73234
+ height: rowMeasure.height
73235
+ });
73236
+ }
73237
+ }
73238
+ rowY += rowMeasure.height;
73239
+ }
73160
73240
  const metadata = {
73161
73241
  columns: fragment.metadata.columnBoundaries.map((boundary) => ({
73162
73242
  i: boundary.index,
@@ -73164,7 +73244,18 @@ ${l}
73164
73244
  w: boundary.width,
73165
73245
  min: boundary.minWidth,
73166
73246
  r: boundary.resizable ? 1 : 0
73167
- }))
73247
+ })),
73248
+ // Add segments for each column boundary (segments where resize handle should appear)
73249
+ segments: boundarySegments.map(
73250
+ (segs, colIndex) => segs.map((seg) => ({
73251
+ c: colIndex,
73252
+ // column index
73253
+ y: seg.y,
73254
+ // y position
73255
+ h: seg.height
73256
+ // height of segment
73257
+ }))
73258
+ )
73168
73259
  };
73169
73260
  container.setAttribute("data-table-boundaries", JSON.stringify(metadata));
73170
73261
  }
@@ -73175,6 +73266,7 @@ ${l}
73175
73266
  if (borderCollapse === "separate" && block.attrs?.cellSpacing) {
73176
73267
  container.style.borderSpacing = `${block.attrs.cellSpacing}px`;
73177
73268
  }
73269
+ const allRowHeights = measure.rows.map((r2) => r2.height);
73178
73270
  let y2 = 0;
73179
73271
  for (let r2 = fragment.fromRow; r2 < fragment.toRow; r2 += 1) {
73180
73272
  const rowMeasure = measure.rows[r2];
@@ -73188,6 +73280,8 @@ ${l}
73188
73280
  row: block.rows[r2],
73189
73281
  totalRows: block.rows.length,
73190
73282
  tableBorders,
73283
+ columnWidths: measure.columnWidths,
73284
+ allRowHeights,
73191
73285
  context,
73192
73286
  renderLine,
73193
73287
  applySdtDataset
@@ -75829,21 +75923,9 @@ ${l}
75829
75923
  }
75830
75924
  async function measureTableBlock(block, constraints) {
75831
75925
  const maxWidth = typeof constraints === "number" ? constraints : constraints.maxWidth;
75832
- const columnCount = Math.max(1, Math.max(...block.rows.map((r2) => r2.cells.length)));
75833
75926
  let columnWidths;
75834
75927
  if (block.columnWidths && block.columnWidths.length > 0) {
75835
75928
  columnWidths = [...block.columnWidths];
75836
- if (columnWidths.length < columnCount) {
75837
- const usedWidth = columnWidths.reduce((a2, b2) => a2 + b2, 0);
75838
- const remainingWidth = Math.max(0, maxWidth - usedWidth);
75839
- const missingCount = columnCount - columnWidths.length;
75840
- const defaultWidth = missingCount > 0 ? Math.max(1, Math.floor(remainingWidth / missingCount)) : 0;
75841
- for (let i2 = columnWidths.length; i2 < columnCount; i2++) {
75842
- columnWidths.push(defaultWidth);
75843
- }
75844
- } else if (columnWidths.length > columnCount) {
75845
- columnWidths = columnWidths.slice(0, columnCount);
75846
- }
75847
75929
  const totalWidth2 = columnWidths.reduce((a2, b2) => a2 + b2, 0);
75848
75930
  const hasExplicitWidth = block.attrs?.tableWidth != null;
75849
75931
  if (!hasExplicitWidth && totalWidth2 > maxWidth) {
@@ -75851,22 +75933,56 @@ ${l}
75851
75933
  columnWidths = columnWidths.map((w2) => Math.max(1, Math.floor(w2 * scale)));
75852
75934
  }
75853
75935
  } else {
75854
- const columnWidth = Math.max(1, Math.floor(maxWidth / columnCount));
75855
- columnWidths = Array.from({ length: columnCount }, () => columnWidth);
75936
+ const maxCellCount = Math.max(1, Math.max(...block.rows.map((r2) => r2.cells.length)));
75937
+ const columnWidth = Math.max(1, Math.floor(maxWidth / maxCellCount));
75938
+ columnWidths = Array.from({ length: maxCellCount }, () => columnWidth);
75856
75939
  }
75940
+ const gridColumnCount = columnWidths.length;
75941
+ const calculateCellWidth = (startCol, colspan) => {
75942
+ let width = 0;
75943
+ for (let i2 = 0; i2 < colspan && startCol + i2 < columnWidths.length; i2++) {
75944
+ width += columnWidths[startCol + i2];
75945
+ }
75946
+ return Math.max(1, width);
75947
+ };
75948
+ const rowspanTracker = new Array(gridColumnCount).fill(0);
75857
75949
  const rows = [];
75858
- for (const row2 of block.rows) {
75950
+ for (let rowIndex = 0; rowIndex < block.rows.length; rowIndex++) {
75951
+ const row2 = block.rows[rowIndex];
75859
75952
  const cellMeasures = [];
75860
- for (let col = 0; col < columnCount; col++) {
75861
- const cell2 = row2.cells[col];
75862
- const cellWidth = columnWidths[col] || columnWidths[0] || Math.floor(maxWidth / columnCount);
75863
- if (!cell2) {
75864
- cellMeasures.push({ paragraph: { kind: "paragraph", lines: [], totalHeight: 0 }, width: cellWidth, height: 0 });
75865
- continue;
75953
+ let gridColIndex = 0;
75954
+ for (const cell2 of row2.cells) {
75955
+ const colspan = cell2.colSpan ?? 1;
75956
+ const rowspan = cell2.rowSpan ?? 1;
75957
+ while (gridColIndex < gridColumnCount && rowspanTracker[gridColIndex] > 0) {
75958
+ rowspanTracker[gridColIndex]--;
75959
+ gridColIndex++;
75960
+ }
75961
+ if (gridColIndex >= gridColumnCount) {
75962
+ break;
75963
+ }
75964
+ const cellWidth = calculateCellWidth(gridColIndex, colspan);
75965
+ if (rowspan > 1) {
75966
+ for (let c2 = 0; c2 < colspan && gridColIndex + c2 < gridColumnCount; c2++) {
75967
+ rowspanTracker[gridColIndex + c2] = rowspan - 1;
75968
+ }
75866
75969
  }
75867
75970
  const paraMeasure = await measureParagraphBlock(cell2.paragraph, cellWidth);
75868
75971
  const height = paraMeasure.totalHeight;
75869
- cellMeasures.push({ paragraph: paraMeasure, width: cellWidth, height });
75972
+ cellMeasures.push({
75973
+ paragraph: paraMeasure,
75974
+ width: cellWidth,
75975
+ height,
75976
+ gridColumnStart: gridColIndex,
75977
+ colSpan: colspan,
75978
+ rowSpan: rowspan
75979
+ });
75980
+ gridColIndex += colspan;
75981
+ }
75982
+ for (let col = gridColIndex; col < gridColumnCount; col++) {
75983
+ if (rowspanTracker[col] > 0) {
75984
+ rowspanTracker[col]--;
75985
+ }
75870
75986
  }
75871
75987
  const rowHeight = Math.max(0, ...cellMeasures.map((c2) => c2.height));
75872
75988
  rows.push({ cells: cellMeasures, height: rowHeight });
@@ -109057,7 +109173,7 @@ ${style2}
109057
109173
  blobs.forEach((blob, index2) => {
109058
109174
  zip.file(fileNames[index2], blob);
109059
109175
  });
109060
- const zipBlob = await zip.generateAsync({ type: "blob" });
109176
+ const zipBlob = await zip.generateAsync({ type: "blob", compression: "DEFLATE" });
109061
109177
  return zipBlob;
109062
109178
  }
109063
109179
  var __defProp = Object.defineProperty;
@@ -113886,13 +114002,31 @@ ${style2}
113886
114002
  });
113887
114003
  return boundaries;
113888
114004
  });
113889
- function getHandleStyle(boundary) {
114005
+ function getBoundarySegments(boundary) {
114006
+ if (boundary.type === "right-edge") {
114007
+ return [{ y: 0, h: null }];
114008
+ }
114009
+ const segmentsData = tableMetadata.value?.segments;
114010
+ if (!segmentsData || !Array.isArray(segmentsData)) {
114011
+ return [{ y: 0, h: null }];
114012
+ }
114013
+ const boundaryColIndex = boundary.index + 1;
114014
+ const colSegments = segmentsData[boundaryColIndex];
114015
+ if (!colSegments || colSegments.length === 0) {
114016
+ return [];
114017
+ }
114018
+ return colSegments.map((seg) => ({
114019
+ y: seg.y,
114020
+ h: seg.h
114021
+ }));
114022
+ }
114023
+ function getSegmentHandleStyle(boundary, segment) {
113890
114024
  return {
113891
114025
  position: "absolute",
113892
114026
  left: `${boundary.x}px`,
113893
- top: "0",
114027
+ top: segment.y != null ? `${segment.y}px` : "0",
113894
114028
  width: "9px",
113895
- height: "100%",
114029
+ height: segment.h != null ? `${segment.h}px` : "100%",
113896
114030
  transform: "translateX(-4px)",
113897
114031
  cursor: "col-resize",
113898
114032
  pointerEvents: "auto"
@@ -113947,7 +114081,8 @@ ${style2}
113947
114081
  });
113948
114082
  return;
113949
114083
  }
113950
- tableMetadata.value = { columns: validatedColumns };
114084
+ const segments = Array.isArray(parsed.segments) ? parsed.segments : void 0;
114085
+ tableMetadata.value = { columns: validatedColumns, segments };
113951
114086
  } catch (error) {
113952
114087
  tableMetadata.value = null;
113953
114088
  emit2("resize-error", {
@@ -114109,7 +114244,7 @@ ${style2}
114109
114244
  updateCellColwidths(tr, tableNode, tablePos, affectedColumns, newWidths);
114110
114245
  dispatch(tr);
114111
114246
  const blockId = props.tableElement?.getAttribute("data-sd-block-id");
114112
- if (blockId) {
114247
+ if (blockId && blockId.trim()) {
114113
114248
  measureCache.invalidate([blockId]);
114114
114249
  }
114115
114250
  emit2("resize-success", { columnIndex, newWidths });
@@ -114212,18 +114347,24 @@ ${style2}
114212
114347
  onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
114213
114348
  }, ["stop"]))
114214
114349
  }, [
114215
- (openBlock(true), createElementBlock(Fragment, null, renderList(resizableBoundaries.value, (boundary, index2) => {
114216
- return openBlock(), createElementBlock("div", {
114217
- key: `handle-${boundary.type}-${boundary.index}`,
114218
- class: normalizeClass(["resize-handle", {
114219
- "resize-handle--active": dragState.value && dragState.value.boundaryIndex === index2,
114220
- "resize-handle--edge": boundary.type === "right-edge"
114221
- }]),
114222
- "data-boundary-index": index2,
114223
- "data-boundary-type": boundary.type,
114224
- style: normalizeStyle(getHandleStyle(boundary)),
114225
- onMousedown: ($event) => onHandleMouseDown($event, index2)
114226
- }, null, 46, _hoisted_1$2$1);
114350
+ (openBlock(true), createElementBlock(Fragment, null, renderList(resizableBoundaries.value, (boundary, boundaryIndex) => {
114351
+ return openBlock(), createElementBlock(Fragment, {
114352
+ key: `boundary-${boundaryIndex}`
114353
+ }, [
114354
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getBoundarySegments(boundary), (segment, segmentIndex) => {
114355
+ return openBlock(), createElementBlock("div", {
114356
+ key: `handle-${boundary.type}-${boundary.index}-${segmentIndex}`,
114357
+ class: normalizeClass(["resize-handle", {
114358
+ "resize-handle--active": dragState.value && dragState.value.boundaryIndex === boundaryIndex,
114359
+ "resize-handle--edge": boundary.type === "right-edge"
114360
+ }]),
114361
+ "data-boundary-index": boundaryIndex,
114362
+ "data-boundary-type": boundary.type,
114363
+ style: normalizeStyle(getSegmentHandleStyle(boundary, segment)),
114364
+ onMousedown: ($event) => onHandleMouseDown($event, boundaryIndex)
114365
+ }, null, 46, _hoisted_1$2$1);
114366
+ }), 128))
114367
+ ], 64);
114227
114368
  }), 128)),
114228
114369
  dragState.value ? (openBlock(), createElementBlock("div", {
114229
114370
  key: 0,
@@ -114234,7 +114375,7 @@ ${style2}
114234
114375
  };
114235
114376
  }
114236
114377
  };
114237
- const TableResizeOverlay = /* @__PURE__ */ _export_sfc$1(_sfc_main$2$1, [["__scopeId", "data-v-acc51d8d"]]);
114378
+ const TableResizeOverlay = /* @__PURE__ */ _export_sfc$1(_sfc_main$2$1, [["__scopeId", "data-v-d4258885"]]);
114238
114379
  function adjustPaginationBreaks(editorElem, editor) {
114239
114380
  if (!editorElem.value || !editor?.value?.options?.scale || isHeadless(editor)) return;
114240
114381
  const zoom = editor.value.options.scale;
@@ -131833,7 +131974,7 @@ ${style2}
131833
131974
  this.config.colors = shuffleArray(this.config.colors);
131834
131975
  this.userColorMap = /* @__PURE__ */ new Map();
131835
131976
  this.colorIndex = 0;
131836
- this.version = "1.0.0-beta.10";
131977
+ this.version = "1.0.0-beta.12";
131837
131978
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
131838
131979
  this.superdocId = config2.superdocId || v4();
131839
131980
  this.colors = this.config.colors;
@@ -134276,7 +134417,7 @@ ${style2}
134276
134417
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
134277
134418
  );
134278
134419
  }
134279
- const indexCC6Vsniy = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
134420
+ const indexCha6AFg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
134280
134421
  __proto__: null,
134281
134422
  unified
134282
134423
  }, Symbol.toStringTag, { value: "Module" }));