@ones-editor/editor 2.1.1-beta.90 → 2.1.1-beta.92

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
@@ -3519,6 +3519,9 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
3519
3519
  bottom: 0;
3520
3520
  content: attr(data-title-placeholder);
3521
3521
  color: #bebfc2;
3522
+ white-space: nowrap;
3523
+ overflow: hidden;
3524
+ text-overflow: ellipsis;
3522
3525
  }
3523
3526
  div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-content][data-content-placeholder]::before {
3524
3527
  position: absolute;
@@ -41392,6 +41395,13 @@ ${codeText}
41392
41395
  this.menu.close();
41393
41396
  return true;
41394
41397
  }
41398
+ if (isEnterOnly(event)) {
41399
+ const item = this.menu.menu.getSelectedItem();
41400
+ if (!item) {
41401
+ this.menu.close();
41402
+ return true;
41403
+ }
41404
+ }
41395
41405
  return this.menu.handleKeydown(event);
41396
41406
  }
41397
41407
  popup(block, offset, leftText, trigger) {
@@ -44475,7 +44485,7 @@ ${codeText}
44475
44485
  };
44476
44486
  editor.updateBlockData(tableBlock, newBlockData);
44477
44487
  }
44478
- const DEFAULT_COLUMN_WIDTH = 200;
44488
+ const DEFAULT_COLUMN_WIDTH$1 = 200;
44479
44489
  const MIN_COLUMN_WIDTH = 40;
44480
44490
  const logger$2i = getLogger("table-insert-column");
44481
44491
  function insertColumn(editor, tableBlock, insertIndex) {
@@ -44509,7 +44519,7 @@ ${codeText}
44509
44519
  oldBlockData[key] = oldSpan + 1;
44510
44520
  });
44511
44521
  const colsWidth = ((_a = oldBlockData.colsWidth) == null ? void 0 : _a.concat()) || new Array(oldBlockData.cols).fill(0);
44512
- colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH);
44522
+ colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH$1);
44513
44523
  const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
44514
44524
  const newBlockData = {
44515
44525
  ...oldBlockData,
@@ -69463,7 +69473,7 @@ ${codeText}
69463
69473
  children.push(createEmptyContainer(editor.doc, i === 0 ? text2 : ""));
69464
69474
  });
69465
69475
  }
69466
- const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH);
69476
+ const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH$1);
69467
69477
  const focusContainerId = children[emptyBlock ? 0 : cols];
69468
69478
  const focusBlockId = editor.doc.getContainerBlocks(focusContainerId)[0].id;
69469
69479
  const blockData = {
@@ -69491,7 +69501,7 @@ ${codeText}
69491
69501
  children.push(createEmptyContainer(editor.doc));
69492
69502
  }
69493
69503
  }
69494
- const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH);
69504
+ const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH$1);
69495
69505
  const focusContainerId = children[0];
69496
69506
  const focusBlockId = editor.doc.getContainerBlocks(focusContainerId)[0].id;
69497
69507
  const blockData = {
@@ -86006,6 +86016,34 @@ ${data2.flowchartText}
86006
86016
  return ret;
86007
86017
  }
86008
86018
  const logger$4 = getLogger("to-docx");
86019
+ function initEmptyLayoutMatrix(cols) {
86020
+ return Array.from({ length: cols }, () => ({
86021
+ cellId: void 0,
86022
+ originalWidth: 0,
86023
+ width: 0
86024
+ }));
86025
+ }
86026
+ function buildLayoutMatrix(block, maxWidth) {
86027
+ assert(logger$4, block.children, "no layout children");
86028
+ const cols = block.children.length;
86029
+ const colsWidth = block.colsWidth;
86030
+ if (colsWidth) {
86031
+ for (let i = 0; i < colsWidth.length; i++) {
86032
+ if (colsWidth[i] === 0) {
86033
+ colsWidth[i] = 1 / colsWidth.length;
86034
+ }
86035
+ }
86036
+ }
86037
+ const matrix = initEmptyLayoutMatrix(cols);
86038
+ for (let i = 0; i < cols; ++i) {
86039
+ matrix[i].cellId = block.children[i];
86040
+ matrix[i].originalWidth = colsWidth[i] * maxWidth;
86041
+ matrix[i].width = colsWidth[i] * maxWidth;
86042
+ }
86043
+ return matrix;
86044
+ }
86045
+ const logger$3 = getLogger("to-docx");
86046
+ const DEFAULT_COLUMN_WIDTH = 200;
86009
86047
  function initEmptyTableMatrix(rows, cols) {
86010
86048
  return Array(rows).fill(0).map(() => Array(cols).fill(0).map(() => ({
86011
86049
  cellId: void 0,
@@ -86032,14 +86070,14 @@ ${data2.flowchartText}
86032
86070
  }
86033
86071
  }
86034
86072
  function buildTableMatrix(block) {
86035
- assert(logger$4, block.children, "no table children");
86073
+ assert(logger$3, block.children, "no table children");
86036
86074
  const rows = block.rows;
86037
86075
  const cols = block.cols;
86038
- const colsWidth = block.colsWidth;
86076
+ const colsWidth = new Array(block.cols).fill(DEFAULT_COLUMN_WIDTH).map((_2, i) => block.colsWidth[i] || _2);
86039
86077
  if (colsWidth) {
86040
86078
  for (let i = 0; i < colsWidth.length; i++) {
86041
86079
  if (colsWidth[i] === 0) {
86042
- colsWidth[i] = 100;
86080
+ colsWidth[i] = DEFAULT_COLUMN_WIDTH;
86043
86081
  }
86044
86082
  }
86045
86083
  }
@@ -86081,33 +86119,6 @@ ${data2.flowchartText}
86081
86119
  updateMatrixByStripe(block, rows, cols, matrix);
86082
86120
  return matrix;
86083
86121
  }
86084
- const logger$3 = getLogger("to-docx");
86085
- function initEmptyLayoutMatrix(cols) {
86086
- return Array.from({ length: cols }, () => ({
86087
- cellId: void 0,
86088
- originalWidth: 0,
86089
- width: 0
86090
- }));
86091
- }
86092
- function buildLayoutMatrix(block, maxWidth) {
86093
- assert(logger$3, block.children, "no layout children");
86094
- const cols = block.children.length;
86095
- const colsWidth = block.colsWidth;
86096
- if (colsWidth) {
86097
- for (let i = 0; i < colsWidth.length; i++) {
86098
- if (colsWidth[i] === 0) {
86099
- colsWidth[i] = 1 / colsWidth.length;
86100
- }
86101
- }
86102
- }
86103
- const matrix = initEmptyLayoutMatrix(cols);
86104
- for (let i = 0; i < cols; ++i) {
86105
- matrix[i].cellId = block.children[i];
86106
- matrix[i].originalWidth = colsWidth[i] * maxWidth;
86107
- matrix[i].width = colsWidth[i] * maxWidth;
86108
- }
86109
- return matrix;
86110
- }
86111
86122
  async function convertBlocksOfDoc(parent, blocks, data2, dbg, appId, docId, md5HexFunc, getDocByBlock2, getTextsByBox, maxWidth) {
86112
86123
  async function convertBlock(block) {
86113
86124
  if (getDocByBlock2 && block.type !== "_exportVirtualBlock") {
@@ -86158,11 +86169,11 @@ ${data2.flowchartText}
86158
86169
  const cols = block.cols;
86159
86170
  colsWidth = new Array(cols);
86160
86171
  for (let i = 0; i < colsWidth.length; i++) {
86161
- colsWidth[i] = 100;
86172
+ colsWidth[i] = DEFAULT_COLUMN_WIDTH;
86162
86173
  }
86163
86174
  block.colsWidth = colsWidth;
86164
86175
  } else {
86165
- colsWidth = block.colsWidth;
86176
+ colsWidth = new Array(block.cols).fill(DEFAULT_COLUMN_WIDTH).map((_2, i) => block.colsWidth[i] || _2);
86166
86177
  }
86167
86178
  const matrix = buildTableMatrix(block);
86168
86179
  await dbg.addTableMatrix(colsWidth, matrix, data2);
@@ -86845,7 +86856,7 @@ ${data2.flowchartText}
86845
86856
  }
86846
86857
  }
86847
86858
  });
86848
- editor.version = "2.1.1-beta.90";
86859
+ editor.version = "2.1.1-beta.92";
86849
86860
  if (Logger$2.level === LogLevel.DEBUG) {
86850
86861
  window.setReauthFail = (fail) => {
86851
86862
  window.isReauthError = fail;
@@ -86946,7 +86957,7 @@ ${data2.flowchartText}
86946
86957
  });
86947
86958
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
86948
86959
  OnesEditorToolbar.register(editor);
86949
- editor.version = "2.1.1-beta.90";
86960
+ editor.version = "2.1.1-beta.92";
86950
86961
  return editor;
86951
86962
  }
86952
86963
  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.90",
3
+ "version": "2.1.1-beta.92",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",