@ones-editor/editor 2.1.1-beta.91 → 2.1.1-beta.93

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
@@ -41395,6 +41395,13 @@ ${codeText}
41395
41395
  this.menu.close();
41396
41396
  return true;
41397
41397
  }
41398
+ if (isEnterOnly(event)) {
41399
+ const item = this.menu.menu.getSelectedItem();
41400
+ if (!item) {
41401
+ this.menu.close();
41402
+ return true;
41403
+ }
41404
+ }
41398
41405
  return this.menu.handleKeydown(event);
41399
41406
  }
41400
41407
  popup(block, offset, leftText, trigger) {
@@ -44478,7 +44485,7 @@ ${codeText}
44478
44485
  };
44479
44486
  editor.updateBlockData(tableBlock, newBlockData);
44480
44487
  }
44481
- const DEFAULT_COLUMN_WIDTH = 200;
44488
+ const DEFAULT_COLUMN_WIDTH$1 = 200;
44482
44489
  const MIN_COLUMN_WIDTH = 40;
44483
44490
  const logger$2i = getLogger("table-insert-column");
44484
44491
  function insertColumn(editor, tableBlock, insertIndex) {
@@ -44512,7 +44519,7 @@ ${codeText}
44512
44519
  oldBlockData[key] = oldSpan + 1;
44513
44520
  });
44514
44521
  const colsWidth = ((_a = oldBlockData.colsWidth) == null ? void 0 : _a.concat()) || new Array(oldBlockData.cols).fill(0);
44515
- colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH);
44522
+ colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH$1);
44516
44523
  const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
44517
44524
  const newBlockData = {
44518
44525
  ...oldBlockData,
@@ -69466,7 +69473,7 @@ ${codeText}
69466
69473
  children.push(createEmptyContainer(editor.doc, i === 0 ? text2 : ""));
69467
69474
  });
69468
69475
  }
69469
- const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH);
69476
+ const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH$1);
69470
69477
  const focusContainerId = children[emptyBlock ? 0 : cols];
69471
69478
  const focusBlockId = editor.doc.getContainerBlocks(focusContainerId)[0].id;
69472
69479
  const blockData = {
@@ -69494,7 +69501,7 @@ ${codeText}
69494
69501
  children.push(createEmptyContainer(editor.doc));
69495
69502
  }
69496
69503
  }
69497
- const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH);
69504
+ const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH$1);
69498
69505
  const focusContainerId = children[0];
69499
69506
  const focusBlockId = editor.doc.getContainerBlocks(focusContainerId)[0].id;
69500
69507
  const blockData = {
@@ -79793,6 +79800,10 @@ ${content}
79793
79800
  if (!isRootBlock(focusBlock)) {
79794
79801
  return list2.filter((id) => id !== "insert-table");
79795
79802
  }
79803
+ const o = this.editor.getComponentOptions("mobile");
79804
+ if (o == null ? void 0 : o.isAndroidApp) {
79805
+ return list2.filter((id) => id !== "insert-image");
79806
+ }
79796
79807
  return list2;
79797
79808
  }
79798
79809
  }
@@ -86009,6 +86020,34 @@ ${data2.flowchartText}
86009
86020
  return ret;
86010
86021
  }
86011
86022
  const logger$4 = getLogger("to-docx");
86023
+ function initEmptyLayoutMatrix(cols) {
86024
+ return Array.from({ length: cols }, () => ({
86025
+ cellId: void 0,
86026
+ originalWidth: 0,
86027
+ width: 0
86028
+ }));
86029
+ }
86030
+ function buildLayoutMatrix(block, maxWidth) {
86031
+ assert(logger$4, block.children, "no layout children");
86032
+ const cols = block.children.length;
86033
+ const colsWidth = block.colsWidth;
86034
+ if (colsWidth) {
86035
+ for (let i = 0; i < colsWidth.length; i++) {
86036
+ if (colsWidth[i] === 0) {
86037
+ colsWidth[i] = 1 / colsWidth.length;
86038
+ }
86039
+ }
86040
+ }
86041
+ const matrix = initEmptyLayoutMatrix(cols);
86042
+ for (let i = 0; i < cols; ++i) {
86043
+ matrix[i].cellId = block.children[i];
86044
+ matrix[i].originalWidth = colsWidth[i] * maxWidth;
86045
+ matrix[i].width = colsWidth[i] * maxWidth;
86046
+ }
86047
+ return matrix;
86048
+ }
86049
+ const logger$3 = getLogger("to-docx");
86050
+ const DEFAULT_COLUMN_WIDTH = 200;
86012
86051
  function initEmptyTableMatrix(rows, cols) {
86013
86052
  return Array(rows).fill(0).map(() => Array(cols).fill(0).map(() => ({
86014
86053
  cellId: void 0,
@@ -86035,14 +86074,14 @@ ${data2.flowchartText}
86035
86074
  }
86036
86075
  }
86037
86076
  function buildTableMatrix(block) {
86038
- assert(logger$4, block.children, "no table children");
86077
+ assert(logger$3, block.children, "no table children");
86039
86078
  const rows = block.rows;
86040
86079
  const cols = block.cols;
86041
- const colsWidth = block.colsWidth;
86080
+ const colsWidth = new Array(block.cols).fill(DEFAULT_COLUMN_WIDTH).map((_2, i) => block.colsWidth[i] || _2);
86042
86081
  if (colsWidth) {
86043
86082
  for (let i = 0; i < colsWidth.length; i++) {
86044
86083
  if (colsWidth[i] === 0) {
86045
- colsWidth[i] = 100;
86084
+ colsWidth[i] = DEFAULT_COLUMN_WIDTH;
86046
86085
  }
86047
86086
  }
86048
86087
  }
@@ -86084,33 +86123,6 @@ ${data2.flowchartText}
86084
86123
  updateMatrixByStripe(block, rows, cols, matrix);
86085
86124
  return matrix;
86086
86125
  }
86087
- const logger$3 = getLogger("to-docx");
86088
- function initEmptyLayoutMatrix(cols) {
86089
- return Array.from({ length: cols }, () => ({
86090
- cellId: void 0,
86091
- originalWidth: 0,
86092
- width: 0
86093
- }));
86094
- }
86095
- function buildLayoutMatrix(block, maxWidth) {
86096
- assert(logger$3, block.children, "no layout children");
86097
- const cols = block.children.length;
86098
- const colsWidth = block.colsWidth;
86099
- if (colsWidth) {
86100
- for (let i = 0; i < colsWidth.length; i++) {
86101
- if (colsWidth[i] === 0) {
86102
- colsWidth[i] = 1 / colsWidth.length;
86103
- }
86104
- }
86105
- }
86106
- const matrix = initEmptyLayoutMatrix(cols);
86107
- for (let i = 0; i < cols; ++i) {
86108
- matrix[i].cellId = block.children[i];
86109
- matrix[i].originalWidth = colsWidth[i] * maxWidth;
86110
- matrix[i].width = colsWidth[i] * maxWidth;
86111
- }
86112
- return matrix;
86113
- }
86114
86126
  async function convertBlocksOfDoc(parent, blocks, data2, dbg, appId, docId, md5HexFunc, getDocByBlock2, getTextsByBox, maxWidth) {
86115
86127
  async function convertBlock(block) {
86116
86128
  if (getDocByBlock2 && block.type !== "_exportVirtualBlock") {
@@ -86161,11 +86173,11 @@ ${data2.flowchartText}
86161
86173
  const cols = block.cols;
86162
86174
  colsWidth = new Array(cols);
86163
86175
  for (let i = 0; i < colsWidth.length; i++) {
86164
- colsWidth[i] = 100;
86176
+ colsWidth[i] = DEFAULT_COLUMN_WIDTH;
86165
86177
  }
86166
86178
  block.colsWidth = colsWidth;
86167
86179
  } else {
86168
- colsWidth = block.colsWidth;
86180
+ colsWidth = new Array(block.cols).fill(DEFAULT_COLUMN_WIDTH).map((_2, i) => block.colsWidth[i] || _2);
86169
86181
  }
86170
86182
  const matrix = buildTableMatrix(block);
86171
86183
  await dbg.addTableMatrix(colsWidth, matrix, data2);
@@ -86848,7 +86860,7 @@ ${data2.flowchartText}
86848
86860
  }
86849
86861
  }
86850
86862
  });
86851
- editor.version = "2.1.1-beta.91";
86863
+ editor.version = "2.1.1-beta.93";
86852
86864
  if (Logger$2.level === LogLevel.DEBUG) {
86853
86865
  window.setReauthFail = (fail) => {
86854
86866
  window.isReauthError = fail;
@@ -86949,7 +86961,7 @@ ${data2.flowchartText}
86949
86961
  });
86950
86962
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
86951
86963
  OnesEditorToolbar.register(editor);
86952
- editor.version = "2.1.1-beta.91";
86964
+ editor.version = "2.1.1-beta.93";
86953
86965
  return editor;
86954
86966
  }
86955
86967
  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.1-beta.91",
3
+ "version": "2.1.1-beta.93",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",