@ones-editor/editor 2.1.9 → 2.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -44191,7 +44191,7 @@ ${codeText}
44191
44191
  const widths = tableCols.map((col) => col.getBoundingClientRect().width || Number.parseInt(col.style.width, 10));
44192
44192
  return widths;
44193
44193
  }
44194
- const DEFAULT_COLUMN_WIDTH = 200;
44194
+ const DEFAULT_COLUMN_WIDTH$1 = 200;
44195
44195
  const MIN_COLUMN_WIDTH = 40;
44196
44196
  const logger$24 = getLogger("table-resize-gripper");
44197
44197
  const GRIPPER_SIZE = 7;
@@ -44453,7 +44453,7 @@ ${codeText}
44453
44453
  oldBlockData[key] = oldSpan + 1;
44454
44454
  });
44455
44455
  const colsWidth = ((_a = oldBlockData.colsWidth) == null ? void 0 : _a.concat()) || new Array(oldBlockData.cols).fill(0);
44456
- colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH);
44456
+ colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH$1);
44457
44457
  const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
44458
44458
  const newBlockData = {
44459
44459
  ...oldBlockData,
@@ -57271,7 +57271,7 @@ $$${mathData.mathjaxText}$$
57271
57271
  children.push(createEmptyContainer(editor.doc, i === 0 ? text2 : ""));
57272
57272
  });
57273
57273
  }
57274
- const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH);
57274
+ const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH$1);
57275
57275
  const focusContainerId = children[emptyBlock ? 0 : cols];
57276
57276
  const focusBlockId = editor.doc.getContainerBlocks(focusContainerId)[0].id;
57277
57277
  const blockData = {
@@ -57299,7 +57299,7 @@ $$${mathData.mathjaxText}$$
57299
57299
  children.push(createEmptyContainer(editor.doc));
57300
57300
  }
57301
57301
  }
57302
- const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH);
57302
+ const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH$1);
57303
57303
  const focusContainerId = children[0];
57304
57304
  const focusBlockId = editor.doc.getContainerBlocks(focusContainerId)[0].id;
57305
57305
  const blockData = {
@@ -82280,6 +82280,34 @@ ${data2.flowchartText}
82280
82280
  return ret;
82281
82281
  }
82282
82282
  const logger$4 = getLogger("to-docx");
82283
+ function initEmptyLayoutMatrix(cols) {
82284
+ return Array.from({ length: cols }, () => ({
82285
+ cellId: void 0,
82286
+ originalWidth: 0,
82287
+ width: 0
82288
+ }));
82289
+ }
82290
+ function buildLayoutMatrix(block, maxWidth) {
82291
+ assert(logger$4, block.children, "no layout children");
82292
+ const cols = block.children.length;
82293
+ const colsWidth = block.colsWidth;
82294
+ if (colsWidth) {
82295
+ for (let i = 0; i < colsWidth.length; i++) {
82296
+ if (colsWidth[i] === 0) {
82297
+ colsWidth[i] = 1 / colsWidth.length;
82298
+ }
82299
+ }
82300
+ }
82301
+ const matrix = initEmptyLayoutMatrix(cols);
82302
+ for (let i = 0; i < cols; ++i) {
82303
+ matrix[i].cellId = block.children[i];
82304
+ matrix[i].originalWidth = colsWidth[i] * maxWidth;
82305
+ matrix[i].width = colsWidth[i] * maxWidth;
82306
+ }
82307
+ return matrix;
82308
+ }
82309
+ const logger$3 = getLogger("to-docx");
82310
+ const DEFAULT_COLUMN_WIDTH = 200;
82283
82311
  function initEmptyTableMatrix(rows, cols) {
82284
82312
  return Array(rows).fill(0).map(() => Array(cols).fill(0).map(() => ({
82285
82313
  cellId: void 0,
@@ -82306,14 +82334,14 @@ ${data2.flowchartText}
82306
82334
  }
82307
82335
  }
82308
82336
  function buildTableMatrix(block) {
82309
- assert(logger$4, block.children, "no table children");
82337
+ assert(logger$3, block.children, "no table children");
82310
82338
  const rows = block.rows;
82311
82339
  const cols = block.cols;
82312
- const colsWidth = block.colsWidth;
82340
+ const colsWidth = new Array(block.cols).fill(DEFAULT_COLUMN_WIDTH).map((_2, i) => block.colsWidth[i] || _2);
82313
82341
  if (colsWidth) {
82314
82342
  for (let i = 0; i < colsWidth.length; i++) {
82315
82343
  if (colsWidth[i] === 0) {
82316
- colsWidth[i] = 100;
82344
+ colsWidth[i] = DEFAULT_COLUMN_WIDTH;
82317
82345
  }
82318
82346
  }
82319
82347
  }
@@ -82355,33 +82383,6 @@ ${data2.flowchartText}
82355
82383
  updateMatrixByStripe(block, rows, cols, matrix);
82356
82384
  return matrix;
82357
82385
  }
82358
- const logger$3 = getLogger("to-docx");
82359
- function initEmptyLayoutMatrix(cols) {
82360
- return Array.from({ length: cols }, () => ({
82361
- cellId: void 0,
82362
- originalWidth: 0,
82363
- width: 0
82364
- }));
82365
- }
82366
- function buildLayoutMatrix(block, maxWidth) {
82367
- assert(logger$3, block.children, "no layout children");
82368
- const cols = block.children.length;
82369
- const colsWidth = block.colsWidth;
82370
- if (colsWidth) {
82371
- for (let i = 0; i < colsWidth.length; i++) {
82372
- if (colsWidth[i] === 0) {
82373
- colsWidth[i] = 1 / colsWidth.length;
82374
- }
82375
- }
82376
- }
82377
- const matrix = initEmptyLayoutMatrix(cols);
82378
- for (let i = 0; i < cols; ++i) {
82379
- matrix[i].cellId = block.children[i];
82380
- matrix[i].originalWidth = colsWidth[i] * maxWidth;
82381
- matrix[i].width = colsWidth[i] * maxWidth;
82382
- }
82383
- return matrix;
82384
- }
82385
82386
  async function convertBlocksOfDoc(parent, blocks, data2, dbg, appId, docId, md5HexFunc, getDocByBlock2, getTextsByBox, maxWidth) {
82386
82387
  async function convertBlock(block) {
82387
82388
  if (getDocByBlock2 && block.type !== "_exportVirtualBlock") {
@@ -82432,11 +82433,11 @@ ${data2.flowchartText}
82432
82433
  const cols = block.cols;
82433
82434
  colsWidth = new Array(cols);
82434
82435
  for (let i = 0; i < colsWidth.length; i++) {
82435
- colsWidth[i] = 100;
82436
+ colsWidth[i] = DEFAULT_COLUMN_WIDTH;
82436
82437
  }
82437
82438
  block.colsWidth = colsWidth;
82438
82439
  } else {
82439
- colsWidth = block.colsWidth;
82440
+ colsWidth = new Array(block.cols).fill(DEFAULT_COLUMN_WIDTH).map((_2, i) => block.colsWidth[i] || _2);
82440
82441
  }
82441
82442
  const matrix = buildTableMatrix(block);
82442
82443
  await dbg.addTableMatrix(colsWidth, matrix, data2);
@@ -83111,7 +83112,7 @@ ${data2.flowchartText}
83111
83112
  }
83112
83113
  }
83113
83114
  });
83114
- editor.version = "2.1.9";
83115
+ editor.version = "2.1.10";
83115
83116
  if (Logger$2.level === LogLevel.DEBUG) {
83116
83117
  window.setReauthFail = (fail) => {
83117
83118
  window.isReauthError = fail;
@@ -83206,7 +83207,7 @@ ${data2.flowchartText}
83206
83207
  if (!clientType.isMobile) {
83207
83208
  OnesEditorToolbar.register(editor);
83208
83209
  }
83209
- editor.version = "2.1.9";
83210
+ editor.version = "2.1.10";
83210
83211
  return editor;
83211
83212
  }
83212
83213
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.1.9",
3
+ "version": "2.1.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",