superdoc 1.15.1-next.3 → 1.16.0-next.2

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.
@@ -33842,7 +33842,7 @@ var SuperConverter = class SuperConverter {
33842
33842
  static getStoredSuperdocVersion(docx) {
33843
33843
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
33844
33844
  }
33845
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.15.1-next.3") {
33845
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.16.0-next.2") {
33846
33846
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
33847
33847
  }
33848
33848
  static generateWordTimestamp() {
@@ -33856,7 +33856,7 @@ var SuperConverter = class SuperConverter {
33856
33856
  static getStoredSuperdocVersion(docx) {
33857
33857
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
33858
33858
  }
33859
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.15.1-next.3") {
33859
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.16.0-next.2") {
33860
33860
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
33861
33861
  }
33862
33862
  static generateWordTimestamp() {
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-Dp2H1eGw.cjs");
2
- const require_SuperConverter = require("./SuperConverter-CiCvm1si.cjs");
2
+ const require_SuperConverter = require("./SuperConverter-fBnRmQtP.cjs");
3
3
  const require_jszip = require("./jszip-DCT9QYaK.cjs");
4
4
  const require_uuid = require("./uuid-CHj_rjgt.cjs");
5
5
  const require_constants = require("./constants-CpniKo9Z.cjs");
@@ -243,7 +243,7 @@ var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
243
243
  const COMMUNITY_LICENSE_KEY = "community-and-eval-agplv3";
244
244
  function getSuperdocVersion() {
245
245
  try {
246
- return "1.15.1-next.3";
246
+ return "1.16.0-next.2";
247
247
  } catch {
248
248
  return "unknown";
249
249
  }
@@ -4284,7 +4284,12 @@ var DOMObserver = class {
4284
4284
  if (result.typeOver) typeOver = true;
4285
4285
  }
4286
4286
  }
4287
- if (gecko && added.length) {
4287
+ if (added.some((n) => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
4288
+ for (let node of added) if (node.nodeName == "BR" && node.parentNode) {
4289
+ let after = node.nextSibling;
4290
+ if (after && after.nodeType == 1 && after.contentEditable == "false") node.parentNode.removeChild(node);
4291
+ }
4292
+ } else if (gecko && added.length) {
4288
4293
  let brs = added.filter((n) => n.nodeName == "BR");
4289
4294
  if (brs.length == 2) {
4290
4295
  let [a, b$1] = brs;
@@ -4297,11 +4302,6 @@ var DOMObserver = class {
4297
4302
  if (parent && parent.nodeName == "LI" && (!focusNode || blockParent(view, focusNode) != parent)) br.remove();
4298
4303
  }
4299
4304
  }
4300
- } else if ((chrome || safari) && added.some((n) => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
4301
- for (let node of added) if (node.nodeName == "BR" && node.parentNode) {
4302
- let after = node.nextSibling;
4303
- if (after && after.nodeType == 1 && after.contentEditable == "false") node.parentNode.removeChild(node);
4304
- }
4305
4305
  }
4306
4306
  let readSel = null;
4307
4307
  if (from$1 < 0 && newSel && view.input.lastFocus > Date.now() - 200 && Math.max(view.input.lastTouch, view.input.lastClick.time) < Date.now() - 300 && selectionCollapsed(sel) && (readSel = selectionFromDOM(view)) && readSel.eq(require_SuperConverter.Selection.near(view.state.doc.resolve(0), 1))) {
@@ -20710,7 +20710,7 @@ const canUseDOM = () => {
20710
20710
  return false;
20711
20711
  }
20712
20712
  };
20713
- var summaryVersion = "1.15.1-next.3";
20713
+ var summaryVersion = "1.16.0-next.2";
20714
20714
  var nodeKeys = [
20715
20715
  "group",
20716
20716
  "content",
@@ -27517,7 +27517,7 @@ var Editor = class Editor extends EventEmitter$1 {
27517
27517
  return migrations.length > 0;
27518
27518
  }
27519
27519
  processCollaborationMigrations() {
27520
- console.debug("[checkVersionMigrations] Current editor version", "1.15.1-next.3");
27520
+ console.debug("[checkVersionMigrations] Current editor version", "1.16.0-next.2");
27521
27521
  if (!this.options.ydoc) return;
27522
27522
  let docVersion = this.options.ydoc.getMap("meta").get("version");
27523
27523
  if (!docVersion) docVersion = "initial";
@@ -67165,8 +67165,9 @@ function updateTableWrapper(tableWrapper, table) {
67165
67165
  borderWidth = Math.ceil(Math.max(borderLeftMax, borderRightMax));
67166
67166
  tableWrapper.style.setProperty("--table-border-width", `${borderWidth || defaultBorderWidth}px`);
67167
67167
  }
67168
- const createCell = (cellType, cellContent = null) => {
67169
- if (cellContent) return cellType.createChecked(null, cellContent);
67168
+ const createCell = (cellType, cellContent = null, attrs = null) => {
67169
+ if (cellContent) return cellType.createChecked(attrs, cellContent);
67170
+ if (attrs) return cellType.createAndFill(attrs);
67170
67171
  return cellType.createAndFill();
67171
67172
  };
67172
67173
  const createTableBorders = (borderSpec = {}) => {
@@ -67184,7 +67185,7 @@ const createTableBorders = (borderSpec = {}) => {
67184
67185
  insideV: borderSpec
67185
67186
  };
67186
67187
  };
67187
- const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null) => {
67188
+ const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null, columnWidths = null) => {
67188
67189
  const types = {
67189
67190
  table: require_SuperConverter.getNodeType("table", schema),
67190
67191
  tableRow: require_SuperConverter.getNodeType("tableRow", schema),
@@ -67194,10 +67195,11 @@ const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent =
67194
67195
  const headerCells = [];
67195
67196
  const cells = [];
67196
67197
  for (let index = 0; index < colsCount; index++) {
67197
- const cell = createCell(types.tableCell, cellContent);
67198
+ const cellAttrs = columnWidths ? { colwidth: [columnWidths[index]] } : null;
67199
+ const cell = createCell(types.tableCell, cellContent, cellAttrs);
67198
67200
  if (cell) cells.push(cell);
67199
67201
  if (withHeaderRow) {
67200
- const headerCell = createCell(types.tableHeader, cellContent);
67202
+ const headerCell = createCell(types.tableHeader, cellContent, cellAttrs);
67201
67203
  if (headerCell) headerCells.push(headerCell);
67202
67204
  }
67203
67205
  }
@@ -67613,8 +67615,19 @@ const Table = Node$1.create({
67613
67615
  return true;
67614
67616
  }).run();
67615
67617
  },
67616
- insertTable: ({ rows = 3, cols = 3, withHeaderRow = false } = {}) => ({ tr, dispatch, editor }) => {
67617
- const node = createTable(editor.schema, rows, cols, withHeaderRow);
67618
+ insertTable: ({ rows = 3, cols = 3, withHeaderRow = false, columnWidths = null } = {}) => ({ tr, dispatch, editor }) => {
67619
+ let widths = columnWidths;
67620
+ if (!widths) {
67621
+ const { pageSize = {}, pageMargins = {} } = editor.converter?.pageStyles ?? {};
67622
+ const { width: pageWidth } = pageSize;
67623
+ const { left: left$1 = 0, right: right$1 = 0 } = pageMargins;
67624
+ if (pageWidth) {
67625
+ const availableWidth = (pageWidth - left$1 - right$1) * 96;
67626
+ const columnWidth = Math.floor(availableWidth / cols);
67627
+ widths = Array(cols).fill(columnWidth);
67628
+ }
67629
+ }
67630
+ const node = createTable(editor.schema, rows, cols, withHeaderRow, null, widths);
67618
67631
  if (dispatch) {
67619
67632
  let offset$1 = tr.selection.$from.end() + 1;
67620
67633
  if (tr.selection.$from.parent?.type?.name === "run") offset$1 = tr.selection.$from.after(tr.selection.$from.depth - 1);
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, n as __esmMin, r as __export, t as __commonJSMin } from "./rolldown-runtime-B2q5OVn9.es.js";
2
- import { $ as TextSelection$1, A as findMark, At as Mark$1, B as defaultBlockAt$1, C as docxNumberingHelpers, Ct as TrackDeleteMarkName, D as posToDOMRect, Dt as DOMParser$1, E as isInTable, Et as carbonCopy, F as isMarkActive, Ft as getExtensionConfigField, G as createDocument, H as getNodeType, I as getMarkRange, J as NodeSelection, K as AllSelection, L as isTextSelection, M as isActive, Mt as Slice, N as isNodeActive, Nt as minMax, O as findChildren$1, Ot as DOMSerializer, P as getSchemaTypeNameByName, Pt as callOrGet, Q as SelectionRange, R as findParentNode, S as getResolvedParagraphProperties, St as getUnderlineCssString, T as CommandService, Tt as TrackInsertMarkName, U as cleanSchemaItem, V as getMarkType, W as getSchemaTypeByName, X as PluginKey, Y as Plugin, Z as Selection, _ as ListHelpers, _t as encodeMarksFromRPr, a as _getReferencedTableStyles, at as Transform, b as isList, bt as resolveRunProperties, c as processContent, ct as dropPoint, d as createCellBorders, dt as replaceStep$1, et as AddMarkStep, f as InputRule, ft as generateDocxRandomId, g as unflattenListsInHtml, gt as encodeCSSFromRPr, h as inputRulesPlugin, ht as encodeCSSFromPPr, it as ReplaceStep, j as getMarksFromSelection, jt as Schema$1, k as getActiveFormatting, kt as Fragment$1, l as createDocFromMarkdown, lt as joinPoint, m as htmlHandler, mt as decodeRPrFromMarks, n as kebabCase$1, nt as RemoveMarkStep, o as helpers_exports, ot as canJoin, p as handleClipboardPaste, pt as generateRandomSigned32BitIntStrId, q as EditorState, r as insertNewRelationship, rt as ReplaceAroundStep$1, s as updateDOMAttributes, st as canSplit, t as SuperConverter, tt as Mapping, u as createDocFromHTML, ut as liftTarget, v as changeListLevel, vt as resolveDocxFontFamily, w as generateOrderedListIndex, wt as TrackFormatMarkName, x as calculateResolvedParagraphProperties, xt as resolveTableCellProperties, y as updateNumberingProperties, yt as resolveParagraphProperties, z as findParentNodeClosestToPos } from "./SuperConverter-YdQBRspo.es.js";
2
+ import { $ as TextSelection$1, A as findMark, At as Mark$1, B as defaultBlockAt$1, C as docxNumberingHelpers, Ct as TrackDeleteMarkName, D as posToDOMRect, Dt as DOMParser$1, E as isInTable, Et as carbonCopy, F as isMarkActive, Ft as getExtensionConfigField, G as createDocument, H as getNodeType, I as getMarkRange, J as NodeSelection, K as AllSelection, L as isTextSelection, M as isActive, Mt as Slice, N as isNodeActive, Nt as minMax, O as findChildren$1, Ot as DOMSerializer, P as getSchemaTypeNameByName, Pt as callOrGet, Q as SelectionRange, R as findParentNode, S as getResolvedParagraphProperties, St as getUnderlineCssString, T as CommandService, Tt as TrackInsertMarkName, U as cleanSchemaItem, V as getMarkType, W as getSchemaTypeByName, X as PluginKey, Y as Plugin, Z as Selection, _ as ListHelpers, _t as encodeMarksFromRPr, a as _getReferencedTableStyles, at as Transform, b as isList, bt as resolveRunProperties, c as processContent, ct as dropPoint, d as createCellBorders, dt as replaceStep$1, et as AddMarkStep, f as InputRule, ft as generateDocxRandomId, g as unflattenListsInHtml, gt as encodeCSSFromRPr, h as inputRulesPlugin, ht as encodeCSSFromPPr, it as ReplaceStep, j as getMarksFromSelection, jt as Schema$1, k as getActiveFormatting, kt as Fragment$1, l as createDocFromMarkdown, lt as joinPoint, m as htmlHandler, mt as decodeRPrFromMarks, n as kebabCase$1, nt as RemoveMarkStep, o as helpers_exports, ot as canJoin, p as handleClipboardPaste, pt as generateRandomSigned32BitIntStrId, q as EditorState, r as insertNewRelationship, rt as ReplaceAroundStep$1, s as updateDOMAttributes, st as canSplit, t as SuperConverter, tt as Mapping, u as createDocFromHTML, ut as liftTarget, v as changeListLevel, vt as resolveDocxFontFamily, w as generateOrderedListIndex, wt as TrackFormatMarkName, x as calculateResolvedParagraphProperties, xt as resolveTableCellProperties, y as updateNumberingProperties, yt as resolveParagraphProperties, z as findParentNodeClosestToPos } from "./SuperConverter-CO1_dksN.es.js";
3
3
  import { a as init_dist$2, i as global, n as init_dist, o as Buffer$3, r as process$1, s as init_dist$1 } from "./jszip-ChlR43oI.es.js";
4
4
  import { t as v4_default } from "./uuid-2IzDu5nl.es.js";
5
5
  import { A as resolveOpcTargetPath, E as pixelsToTwips, F as twipsToLines, I as twipsToPixels, P as twipsToInches, _ as halfPointToPoints, c as convertSizeToCSS, k as ptToTwips, p as getArrayBufferFromUrl, t as COMMENT_FILE_BASENAMES, v as inchesToPixels, x as linesToTwips, y as inchesToTwips } from "./constants-DBKi0Amm.es.js";
@@ -242,7 +242,7 @@ var v_click_outside_default = {
242
242
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
243
243
  function getSuperdocVersion() {
244
244
  try {
245
- return "1.15.1-next.3";
245
+ return "1.16.0-next.2";
246
246
  } catch {
247
247
  return "unknown";
248
248
  }
@@ -4283,7 +4283,12 @@ var DOMObserver = class {
4283
4283
  if (result.typeOver) typeOver = true;
4284
4284
  }
4285
4285
  }
4286
- if (gecko && added.length) {
4286
+ if (added.some((n) => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
4287
+ for (let node of added) if (node.nodeName == "BR" && node.parentNode) {
4288
+ let after = node.nextSibling;
4289
+ if (after && after.nodeType == 1 && after.contentEditable == "false") node.parentNode.removeChild(node);
4290
+ }
4291
+ } else if (gecko && added.length) {
4287
4292
  let brs = added.filter((n) => n.nodeName == "BR");
4288
4293
  if (brs.length == 2) {
4289
4294
  let [a, b$1] = brs;
@@ -4296,11 +4301,6 @@ var DOMObserver = class {
4296
4301
  if (parent && parent.nodeName == "LI" && (!focusNode || blockParent(view, focusNode) != parent)) br.remove();
4297
4302
  }
4298
4303
  }
4299
- } else if ((chrome || safari) && added.some((n) => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
4300
- for (let node of added) if (node.nodeName == "BR" && node.parentNode) {
4301
- let after = node.nextSibling;
4302
- if (after && after.nodeType == 1 && after.contentEditable == "false") node.parentNode.removeChild(node);
4303
- }
4304
4304
  }
4305
4305
  let readSel = null;
4306
4306
  if (from$1 < 0 && newSel && view.input.lastFocus > Date.now() - 200 && Math.max(view.input.lastTouch, view.input.lastClick.time) < Date.now() - 300 && selectionCollapsed(sel) && (readSel = selectionFromDOM(view)) && readSel.eq(Selection.near(view.state.doc.resolve(0), 1))) {
@@ -20691,7 +20691,7 @@ const canUseDOM = () => {
20691
20691
  return false;
20692
20692
  }
20693
20693
  };
20694
- var summaryVersion = "1.15.1-next.3";
20694
+ var summaryVersion = "1.16.0-next.2";
20695
20695
  var nodeKeys = [
20696
20696
  "group",
20697
20697
  "content",
@@ -27270,7 +27270,7 @@ var Editor = class Editor extends EventEmitter$1 {
27270
27270
  return migrations.length > 0;
27271
27271
  }
27272
27272
  processCollaborationMigrations() {
27273
- console.debug("[checkVersionMigrations] Current editor version", "1.15.1-next.3");
27273
+ console.debug("[checkVersionMigrations] Current editor version", "1.16.0-next.2");
27274
27274
  if (!this.options.ydoc) return;
27275
27275
  let docVersion = this.options.ydoc.getMap("meta").get("version");
27276
27276
  if (!docVersion) docVersion = "initial";
@@ -66887,8 +66887,9 @@ function updateTableWrapper(tableWrapper, table) {
66887
66887
  borderWidth = Math.ceil(Math.max(borderLeftMax, borderRightMax));
66888
66888
  tableWrapper.style.setProperty("--table-border-width", `${borderWidth || defaultBorderWidth}px`);
66889
66889
  }
66890
- const createCell = (cellType, cellContent = null) => {
66891
- if (cellContent) return cellType.createChecked(null, cellContent);
66890
+ const createCell = (cellType, cellContent = null, attrs = null) => {
66891
+ if (cellContent) return cellType.createChecked(attrs, cellContent);
66892
+ if (attrs) return cellType.createAndFill(attrs);
66892
66893
  return cellType.createAndFill();
66893
66894
  };
66894
66895
  const createTableBorders = (borderSpec = {}) => {
@@ -66906,7 +66907,7 @@ const createTableBorders = (borderSpec = {}) => {
66906
66907
  insideV: borderSpec
66907
66908
  };
66908
66909
  };
66909
- const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null) => {
66910
+ const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null, columnWidths = null) => {
66910
66911
  const types = {
66911
66912
  table: getNodeType("table", schema),
66912
66913
  tableRow: getNodeType("tableRow", schema),
@@ -66916,10 +66917,11 @@ const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent =
66916
66917
  const headerCells = [];
66917
66918
  const cells = [];
66918
66919
  for (let index = 0; index < colsCount; index++) {
66919
- const cell = createCell(types.tableCell, cellContent);
66920
+ const cellAttrs = columnWidths ? { colwidth: [columnWidths[index]] } : null;
66921
+ const cell = createCell(types.tableCell, cellContent, cellAttrs);
66920
66922
  if (cell) cells.push(cell);
66921
66923
  if (withHeaderRow) {
66922
- const headerCell = createCell(types.tableHeader, cellContent);
66924
+ const headerCell = createCell(types.tableHeader, cellContent, cellAttrs);
66923
66925
  if (headerCell) headerCells.push(headerCell);
66924
66926
  }
66925
66927
  }
@@ -67335,8 +67337,19 @@ const Table = Node$1.create({
67335
67337
  return true;
67336
67338
  }).run();
67337
67339
  },
67338
- insertTable: ({ rows = 3, cols = 3, withHeaderRow = false } = {}) => ({ tr, dispatch, editor }) => {
67339
- const node = createTable(editor.schema, rows, cols, withHeaderRow);
67340
+ insertTable: ({ rows = 3, cols = 3, withHeaderRow = false, columnWidths = null } = {}) => ({ tr, dispatch, editor }) => {
67341
+ let widths = columnWidths;
67342
+ if (!widths) {
67343
+ const { pageSize = {}, pageMargins = {} } = editor.converter?.pageStyles ?? {};
67344
+ const { width: pageWidth } = pageSize;
67345
+ const { left: left$1 = 0, right: right$1 = 0 } = pageMargins;
67346
+ if (pageWidth) {
67347
+ const availableWidth = (pageWidth - left$1 - right$1) * 96;
67348
+ const columnWidth = Math.floor(availableWidth / cols);
67349
+ widths = Array(cols).fill(columnWidth);
67350
+ }
67351
+ }
67352
+ const node = createTable(editor.schema, rows, cols, withHeaderRow, null, widths);
67340
67353
  if (dispatch) {
67341
67354
  let offset$1 = tr.selection.$from.end() + 1;
67342
67355
  if (tr.selection.$from.parent?.type?.name === "run") offset$1 = tr.selection.$from.after(tr.selection.$from.depth - 1);
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_SuperConverter = require("../chunks/SuperConverter-CiCvm1si.cjs");
3
+ const require_SuperConverter = require("../chunks/SuperConverter-fBnRmQtP.cjs");
4
4
  require("../chunks/jszip-DCT9QYaK.cjs");
5
5
  require("../chunks/xml-js--DznO7Gk.cjs");
6
6
  require("../chunks/constants-CpniKo9Z.cjs");
@@ -1,4 +1,4 @@
1
- import { t as SuperConverter } from "../chunks/SuperConverter-YdQBRspo.es.js";
1
+ import { t as SuperConverter } from "../chunks/SuperConverter-CO1_dksN.es.js";
2
2
  import "../chunks/jszip-ChlR43oI.es.js";
3
3
  import "../chunks/xml-js-DLE8mr0n.es.js";
4
4
  import "../chunks/constants-DBKi0Amm.es.js";
@@ -5,6 +5,7 @@ import { Node } from '../../core/index.js';
5
5
  * @property {number} [rows=3] - Number of rows to create
6
6
  * @property {number} [cols=3] - Number of columns to create
7
7
  * @property {boolean} [withHeaderRow=false] - Create first row as header row
8
+ * @property {number[]} [columnWidths] - Explicit column widths in pixels
8
9
  */
9
10
  /**
10
11
  * Table indentation configuration
@@ -502,6 +503,10 @@ export type TableConfig = {
502
503
  * - Create first row as header row
503
504
  */
504
505
  withHeaderRow?: boolean | undefined;
506
+ /**
507
+ * - Explicit column widths in pixels
508
+ */
509
+ columnWidths?: number[] | undefined;
505
510
  };
506
511
  /**
507
512
  * Table indentation configuration
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../../super-editor/src/extensions/table/table.js"],"names":[],"mappings":"AAqOA;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;;;;;GAQG;AACH,gGA42BG;;;;yBAzpCW,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,mBAAmB,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO;;;;6BAKhN,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,uBAAuB,GAAG,gBAAgB,GAAG,eAAe,GAAG,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAqB/O,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAgGN,MAAM;;;;;;;;;;;;;;;;;;eAYN,OAAO,mBAAmB,EAAE,QAAQ;;;;gBACpC,MAAM,GAAC,IAAI;;;;eACX,KAAK,CAAC,OAAO,mBAAmB,EAAE,IAAI,CAAC;;;;;;;;;YAMvC,OAAO,mBAAmB,EAAE,MAAM;;;;eAClC,OAAO,mBAAmB,EAAE,IAAI;;;;iBAChC,OAAO,mBAAmB,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;eAUhC,MAAM,EAAE,EAAE;;;;;;;;;;;;;QAOV,OAAO,mBAAmB,EAAE,WAAW;;;;cACvC,MAAM;;;;eACN,OAAO,mBAAmB,EAAE,IAAI;;;;UAChC,OAAO,mBAAmB,EAAE,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;WAwElC,MAAM;;;;;;;;;;;;;gBAON,MAAM;;;;cACN,MAAM;;;;;2BAKP,MAAM;;;;8BAYN,MAAM;;;;;;;;UAeL,MAAM;;;;UACN,OAAO,mBAAmB,EAAE,IAAI;;;;WAChC,MAAM;;;qBAKN,eAAe;UACf,SAAS;;wBAIV,IAAI;qBAzHe,gBAAgB"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../../../super-editor/src/extensions/table/table.js"],"names":[],"mappings":"AAqOA;;;;;;;GAOG;AAEH;;;;;GAKG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;;;;;GAQG;AACH,gGA63BG;;;;yBA3qCW,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,mBAAmB,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO;;;;6BAKhN,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,uBAAuB,GAAG,gBAAgB,GAAG,eAAe,GAAG,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAqB/O,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAgGN,MAAM;;;;;;;;;;;;;;;;;;eAYN,OAAO,mBAAmB,EAAE,QAAQ;;;;gBACpC,MAAM,GAAC,IAAI;;;;eACX,KAAK,CAAC,OAAO,mBAAmB,EAAE,IAAI,CAAC;;;;;;;;;YAMvC,OAAO,mBAAmB,EAAE,MAAM;;;;eAClC,OAAO,mBAAmB,EAAE,IAAI;;;;iBAChC,OAAO,mBAAmB,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;eAUhC,MAAM,EAAE,EAAE;;;;;;;;;;;;;QAOV,OAAO,mBAAmB,EAAE,WAAW;;;;cACvC,MAAM;;;;eACN,OAAO,mBAAmB,EAAE,IAAI;;;;UAChC,OAAO,mBAAmB,EAAE,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAyElC,MAAM;;;;;;;;;;;;;gBAON,MAAM;;;;cACN,MAAM;;;;;2BAKP,MAAM;;;;8BAYN,MAAM;;;;;;;;UAeL,MAAM;;;;UACN,OAAO,mBAAmB,EAAE,IAAI;;;;WAChC,MAAM;;;qBAKN,eAAe;UACf,SAAS;;wBAIV,IAAI;qBA1He,gBAAgB"}
@@ -1,2 +1,2 @@
1
- export function createCell(cellType: any, cellContent?: null): any;
1
+ export function createCell(cellType: any, cellContent?: null, attrs?: null): any;
2
2
  //# sourceMappingURL=createCell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createCell.d.ts","sourceRoot":"","sources":["../../../../../../../super-editor/src/extensions/table/tableHelpers/createCell.js"],"names":[],"mappings":"AACO,mEAKN"}
1
+ {"version":3,"file":"createCell.d.ts","sourceRoot":"","sources":["../../../../../../../super-editor/src/extensions/table/tableHelpers/createCell.js"],"names":[],"mappings":"AACO,iFAQN"}
@@ -1,2 +1,2 @@
1
- export function createTable(schema: Object, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Object): Object;
1
+ export function createTable(schema: Object, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Object, columnWidths?: number[]): Object;
2
2
  //# sourceMappingURL=createTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTable.d.ts","sourceRoot":"","sources":["../../../../../../../super-editor/src/extensions/table/tableHelpers/createTable.js"],"names":[],"mappings":"AAoBO,oCAXI,MAAM,aACN,MAAM,aACN,MAAM,iBACN,OAAO,gBACP,MAAM,GACJ,MAAM,CAsClB"}
1
+ {"version":3,"file":"createTable.d.ts","sourceRoot":"","sources":["../../../../../../../super-editor/src/extensions/table/tableHelpers/createTable.js"],"names":[],"mappings":"AAuBO,oCAdI,MAAM,aACN,MAAM,aACN,MAAM,iBACN,OAAO,gBACP,MAAM,iBACN,MAAM,EAAE,GACN,MAAM,CAyClB"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_src = require("./chunks/src-D72XdCMl.cjs");
4
- const require_SuperConverter = require("./chunks/SuperConverter-CiCvm1si.cjs");
3
+ const require_src = require("./chunks/src-BaqD9Nl6.cjs");
4
+ const require_SuperConverter = require("./chunks/SuperConverter-fBnRmQtP.cjs");
5
5
  require("./chunks/jszip-DCT9QYaK.cjs");
6
6
  require("./chunks/xml-js--DznO7Gk.cjs");
7
7
  require("./chunks/constants-CpniKo9Z.cjs");
@@ -1,5 +1,5 @@
1
- import { $ as getAllowedImageDimensions, Bt as isMarkType, Ht as isNodeType, Q as trackChangesHelpers_exports, Rt as defineMark, Vt as assertNodeType, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, a as BasicUpload_default, at as CommentsPluginKey, c as Toolbar_default, et as SectionHelpers, i as SuperEditor_default, it as AnnotatorHelpers, n as SlashMenu, nt as Editor, o as ContextMenu_default, ot as TrackChangesBasePluginKey, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, t as Extensions, tt as PresentationEditor, zt as defineNode } from "./chunks/src-C-IaIdrG.es.js";
2
- import { i as registeredHandlers, j as getMarksFromSelection, k as getActiveFormatting, o as helpers_exports, t as SuperConverter } from "./chunks/SuperConverter-YdQBRspo.es.js";
1
+ import { $ as getAllowedImageDimensions, Bt as isMarkType, Ht as isNodeType, Q as trackChangesHelpers_exports, Rt as defineMark, Vt as assertNodeType, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, a as BasicUpload_default, at as CommentsPluginKey, c as Toolbar_default, et as SectionHelpers, i as SuperEditor_default, it as AnnotatorHelpers, n as SlashMenu, nt as Editor, o as ContextMenu_default, ot as TrackChangesBasePluginKey, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, t as Extensions, tt as PresentationEditor, zt as defineNode } from "./chunks/src-GCcrNclb.es.js";
2
+ import { i as registeredHandlers, j as getMarksFromSelection, k as getActiveFormatting, o as helpers_exports, t as SuperConverter } from "./chunks/SuperConverter-CO1_dksN.es.js";
3
3
  import "./chunks/jszip-ChlR43oI.es.js";
4
4
  import "./chunks/xml-js-DLE8mr0n.es.js";
5
5
  import "./chunks/constants-DBKi0Amm.es.js";
@@ -1,4 +1,2 @@
1
1
  export * from '../../super-editor/src/index.js';
2
- export * from '../../super-editor/src/core/DocxZipper.js';
3
- export * from '../../super-editor/src/core/super-converter/zipper.js';
4
2
  //# sourceMappingURL=super-editor.d.ts.map
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_src = require("./chunks/src-D72XdCMl.cjs");
4
- const require_SuperConverter = require("./chunks/SuperConverter-CiCvm1si.cjs");
3
+ const require_src = require("./chunks/src-BaqD9Nl6.cjs");
4
+ const require_SuperConverter = require("./chunks/SuperConverter-fBnRmQtP.cjs");
5
5
  const require_jszip = require("./chunks/jszip-DCT9QYaK.cjs");
6
6
  require("./chunks/xml-js--DznO7Gk.cjs");
7
7
  const require_uuid = require("./chunks/uuid-CHj_rjgt.cjs");
@@ -19904,7 +19904,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
19904
19904
  this.config.colors = shuffleArray(this.config.colors);
19905
19905
  this.userColorMap = /* @__PURE__ */ new Map();
19906
19906
  this.colorIndex = 0;
19907
- this.version = "1.15.1-next.3";
19907
+ this.version = "1.16.0-next.2";
19908
19908
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
19909
19909
  this.superdocId = config.superdocId || require_uuid.v4_default();
19910
19910
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
- import { A as isMounted, At as writeVarUint, B as cNotM, C as resolveWrappedSlot, Ct as createDecoder, D as warnOnce, Dt as createEncoder, E as throwError, Et as readVarUint8Array, F as changeColor, Ft as v_click_outside_default, G as ellipsis_vertical_solid_default, H as insideModal, I as c, It as getFileObject, J as comment_solid_default, K as xmark_solid_default, L as cB, Lt as comments_module_events, M as use_memo_default, Mt as create, N as on, Nt as min, O as useSsrAdapter, Ot as length, P as createId, Pt as pow, Q as trackChangesHelpers_exports, R as cE, S as configProviderInjectionKey, St as getUnixTime, T as call, Tt as readVarUint, U as insidePopover, V as createKey, W as caret_down_solid_default, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, _ as useRtl, _t as encodeAwarenessUpdate, at as CommentsPluginKey, b as useThemeClass, bt as ObservableV2, ct as createUint8ArrayFromArrayBuffer, d as Dropdown_default, dt as isNode, et as SectionHelpers, f as ConfigProvider_default, ft as offChange, g as _common_default$2, gt as applyAwarenessUpdate, h as index_cssr_default$5, ht as Awareness, i as SuperEditor_default, it as AnnotatorHelpers, j as useMergedState, jt as writeVarUint8Array, k as createInjectionKey, kt as toUint8Array, l as messageApiInjectionKey, lt as fromBase64, m as use_theme_default, mt as varStorage, nt as Editor, ot as TrackChangesBasePluginKey, p as light_default$1, pt as onChange, q as check_solid_default, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, st as getTrackChanges, t as Extensions, tt as PresentationEditor, u as messageProviderInjectionKey, ut as toBase64, v as cssrAnchorMetaName, vt as removeAwarenessStates, w as render, wt as readVarString, x as useConfig, xt as setIfUndefined, y as toString_default, yt as map, z as cM } from "./chunks/src-C-IaIdrG.es.js";
2
- import { i as registeredHandlers, o as helpers_exports, t as SuperConverter } from "./chunks/SuperConverter-YdQBRspo.es.js";
1
+ import { A as isMounted, At as writeVarUint, B as cNotM, C as resolveWrappedSlot, Ct as createDecoder, D as warnOnce, Dt as createEncoder, E as throwError, Et as readVarUint8Array, F as changeColor, Ft as v_click_outside_default, G as ellipsis_vertical_solid_default, H as insideModal, I as c, It as getFileObject, J as comment_solid_default, K as xmark_solid_default, L as cB, Lt as comments_module_events, M as use_memo_default, Mt as create, N as on, Nt as min, O as useSsrAdapter, Ot as length, P as createId, Pt as pow, Q as trackChangesHelpers_exports, R as cE, S as configProviderInjectionKey, St as getUnixTime, T as call, Tt as readVarUint, U as insidePopover, V as createKey, W as caret_down_solid_default, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, _ as useRtl, _t as encodeAwarenessUpdate, at as CommentsPluginKey, b as useThemeClass, bt as ObservableV2, ct as createUint8ArrayFromArrayBuffer, d as Dropdown_default, dt as isNode, et as SectionHelpers, f as ConfigProvider_default, ft as offChange, g as _common_default$2, gt as applyAwarenessUpdate, h as index_cssr_default$5, ht as Awareness, i as SuperEditor_default, it as AnnotatorHelpers, j as useMergedState, jt as writeVarUint8Array, k as createInjectionKey, kt as toUint8Array, l as messageApiInjectionKey, lt as fromBase64, m as use_theme_default, mt as varStorage, nt as Editor, ot as TrackChangesBasePluginKey, p as light_default$1, pt as onChange, q as check_solid_default, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, st as getTrackChanges, t as Extensions, tt as PresentationEditor, u as messageProviderInjectionKey, ut as toBase64, v as cssrAnchorMetaName, vt as removeAwarenessStates, w as render, wt as readVarString, x as useConfig, xt as setIfUndefined, y as toString_default, yt as map, z as cM } from "./chunks/src-GCcrNclb.es.js";
2
+ import { i as registeredHandlers, o as helpers_exports, t as SuperConverter } from "./chunks/SuperConverter-CO1_dksN.es.js";
3
3
  import { a as init_dist$1, i as global, n as init_dist, r as process$1 } from "./chunks/jszip-ChlR43oI.es.js";
4
4
  import "./chunks/xml-js-DLE8mr0n.es.js";
5
5
  import { t as v4_default } from "./chunks/uuid-2IzDu5nl.es.js";
@@ -19863,7 +19863,7 @@ var SuperDoc = class extends import_eventemitter3.default {
19863
19863
  this.config.colors = shuffleArray(this.config.colors);
19864
19864
  this.userColorMap = /* @__PURE__ */ new Map();
19865
19865
  this.colorIndex = 0;
19866
- this.version = "1.15.1-next.3";
19866
+ this.version = "1.16.0-next.2";
19867
19867
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
19868
19868
  this.superdocId = config.superdocId || v4_default();
19869
19869
  this.colors = this.config.colors;
@@ -33317,7 +33317,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33317
33317
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
33318
33318
  function getSuperdocVersion() {
33319
33319
  try {
33320
- return "1.15.1-next.3";
33320
+ return "1.16.0-next.2";
33321
33321
  } catch {
33322
33322
  return "unknown";
33323
33323
  }
@@ -36363,7 +36363,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36363
36363
  static getStoredSuperdocVersion(docx) {
36364
36364
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
36365
36365
  }
36366
- static setStoredSuperdocVersion(docx = this.convertedXml, version$2 = "1.15.1-next.3") {
36366
+ static setStoredSuperdocVersion(docx = this.convertedXml, version$2 = "1.16.0-next.2") {
36367
36367
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version$2, false);
36368
36368
  }
36369
36369
  static generateWordTimestamp() {
@@ -40920,7 +40920,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40920
40920
  if (result.typeOver) typeOver = true;
40921
40921
  }
40922
40922
  }
40923
- if (gecko && added.length) {
40923
+ if (added.some((n) => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
40924
+ for (let node$1 of added) if (node$1.nodeName == "BR" && node$1.parentNode) {
40925
+ let after = node$1.nextSibling;
40926
+ if (after && after.nodeType == 1 && after.contentEditable == "false") node$1.parentNode.removeChild(node$1);
40927
+ }
40928
+ } else if (gecko && added.length) {
40924
40929
  let brs = added.filter((n) => n.nodeName == "BR");
40925
40930
  if (brs.length == 2) {
40926
40931
  let [a$1, b$2] = brs;
@@ -40933,11 +40938,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40933
40938
  if (parent && parent.nodeName == "LI" && (!focusNode || blockParent(view, focusNode) != parent)) br$2.remove();
40934
40939
  }
40935
40940
  }
40936
- } else if ((chrome || safari) && added.some((n) => n.nodeName == "BR") && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
40937
- for (let node$1 of added) if (node$1.nodeName == "BR" && node$1.parentNode) {
40938
- let after = node$1.nextSibling;
40939
- if (after && after.nodeType == 1 && after.contentEditable == "false") node$1.parentNode.removeChild(node$1);
40940
- }
40941
40941
  }
40942
40942
  let readSel = null;
40943
40943
  if (from$1 < 0 && newSel && view.input.lastFocus > Date.now() - 200 && Math.max(view.input.lastTouch, view.input.lastClick.time) < Date.now() - 300 && selectionCollapsed(sel) && (readSel = selectionFromDOM(view)) && readSel.eq(Selection.near(view.state.doc.resolve(0), 1))) {
@@ -65739,7 +65739,7 @@ while (n$2 === a$3[++i$3] && n$2 === a$3[++i$3] && n$2 === a$3[++i$3] && n$2 ===
65739
65739
  return false;
65740
65740
  }
65741
65741
  };
65742
- var summaryVersion = "1.15.1-next.3";
65742
+ var summaryVersion = "1.16.0-next.2";
65743
65743
  var nodeKeys = [
65744
65744
  "group",
65745
65745
  "content",
@@ -89698,7 +89698,7 @@ while (n$2 === a$3[++i$3] && n$2 === a$3[++i$3] && n$2 === a$3[++i$3] && n$2 ===
89698
89698
  return migrations.length > 0;
89699
89699
  }
89700
89700
  processCollaborationMigrations() {
89701
- console.debug("[checkVersionMigrations] Current editor version", "1.15.1-next.3");
89701
+ console.debug("[checkVersionMigrations] Current editor version", "1.16.0-next.2");
89702
89702
  if (!this.options.ydoc) return;
89703
89703
  let docVersion = this.options.ydoc.getMap("meta").get("version");
89704
89704
  if (!docVersion) docVersion = "initial";
@@ -129244,8 +129244,9 @@ ${o}
129244
129244
  borderWidth = Math.ceil(Math.max(borderLeftMax, borderRightMax));
129245
129245
  tableWrapper.style.setProperty("--table-border-width", `${borderWidth || defaultBorderWidth}px`);
129246
129246
  }
129247
- const createCell = (cellType, cellContent = null) => {
129248
- if (cellContent) return cellType.createChecked(null, cellContent);
129247
+ const createCell = (cellType, cellContent = null, attrs = null) => {
129248
+ if (cellContent) return cellType.createChecked(attrs, cellContent);
129249
+ if (attrs) return cellType.createAndFill(attrs);
129249
129250
  return cellType.createAndFill();
129250
129251
  };
129251
129252
  const createTableBorders = (borderSpec = {}) => {
@@ -129263,7 +129264,7 @@ ${o}
129263
129264
  insideV: borderSpec
129264
129265
  };
129265
129266
  };
129266
- const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null) => {
129267
+ const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null, columnWidths = null) => {
129267
129268
  const types = {
129268
129269
  table: getNodeType("table", schema),
129269
129270
  tableRow: getNodeType("tableRow", schema),
@@ -129273,10 +129274,11 @@ ${o}
129273
129274
  const headerCells = [];
129274
129275
  const cells = [];
129275
129276
  for (let index$1 = 0; index$1 < colsCount; index$1++) {
129276
- const cell$1 = createCell(types.tableCell, cellContent);
129277
+ const cellAttrs = columnWidths ? { colwidth: [columnWidths[index$1]] } : null;
129278
+ const cell$1 = createCell(types.tableCell, cellContent, cellAttrs);
129277
129279
  if (cell$1) cells.push(cell$1);
129278
129280
  if (withHeaderRow) {
129279
- const headerCell = createCell(types.tableHeader, cellContent);
129281
+ const headerCell = createCell(types.tableHeader, cellContent, cellAttrs);
129280
129282
  if (headerCell) headerCells.push(headerCell);
129281
129283
  }
129282
129284
  }
@@ -129692,8 +129694,19 @@ ${o}
129692
129694
  return true;
129693
129695
  }).run();
129694
129696
  },
129695
- insertTable: ({ rows = 3, cols = 3, withHeaderRow = false } = {}) => ({ tr, dispatch, editor }) => {
129696
- const node$1 = createTable(editor.schema, rows, cols, withHeaderRow);
129697
+ insertTable: ({ rows = 3, cols = 3, withHeaderRow = false, columnWidths = null } = {}) => ({ tr, dispatch, editor }) => {
129698
+ let widths = columnWidths;
129699
+ if (!widths) {
129700
+ const { pageSize = {}, pageMargins = {} } = editor.converter?.pageStyles ?? {};
129701
+ const { width: pageWidth } = pageSize;
129702
+ const { left: left$1 = 0, right: right$1 = 0 } = pageMargins;
129703
+ if (pageWidth) {
129704
+ const availableWidth = (pageWidth - left$1 - right$1) * 96;
129705
+ const columnWidth = Math.floor(availableWidth / cols);
129706
+ widths = Array(cols).fill(columnWidth);
129707
+ }
129708
+ }
129709
+ const node$1 = createTable(editor.schema, rows, cols, withHeaderRow, null, widths);
129697
129710
  if (dispatch) {
129698
129711
  let offset$1 = tr.selection.$from.end() + 1;
129699
129712
  if (tr.selection.$from.parent?.type?.name === "run") offset$1 = tr.selection.$from.after(tr.selection.$from.depth - 1);
@@ -174243,7 +174256,7 @@ js: import "konva/skia-backend";
174243
174256
  this.config.colors = shuffleArray(this.config.colors);
174244
174257
  this.userColorMap = /* @__PURE__ */ new Map();
174245
174258
  this.colorIndex = 0;
174246
- this.version = "1.15.1-next.3";
174259
+ this.version = "1.16.0-next.2";
174247
174260
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
174248
174261
  this.superdocId = config$31.superdocId || v4_default();
174249
174262
  this.colors = this.config.colors;