@ones-editor/editor 2.9.8-beta.8 → 2.9.8

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 (31) hide show
  1. package/@ones-editor/core/src/core/composition/editor-input.d.ts +0 -1
  2. package/@ones-editor/core/src/core/doc/doc.d.ts +1 -3
  3. package/@ones-editor/core/src/core/types.d.ts +0 -1
  4. package/@ones-editor/core/src/users/remote-users.d.ts +1 -1
  5. package/@ones-editor/main-toolbar/src/index.d.ts +1 -8
  6. package/@ones-editor/main-toolbar/src/items/index.d.ts +2 -4
  7. package/@ones-editor/main-toolbar/src/locale/en-us.d.ts +0 -3
  8. package/@ones-editor/main-toolbar/src/locale/ja-jp.d.ts +0 -3
  9. package/@ones-editor/main-toolbar/src/locale/zh-cn.d.ts +0 -3
  10. package/@ones-editor/main-toolbar/src/locale/zh-hant-hk.d.ts +0 -3
  11. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  12. package/@ones-editor/ui-base/src/command-bar/types.d.ts +7 -8
  13. package/@ones-editor/ui-base/src/icons/index.d.ts +1 -3
  14. package/dist/index.d.ts +1 -2
  15. package/dist/index.js +163 -708
  16. package/dist/types.d.ts +0 -1
  17. package/package.json +1 -1
  18. package/@ones-editor/cke-html/package.json +0 -7
  19. package/@ones-editor/cke-html/src/html/cke-html.d.ts +0 -4
  20. package/@ones-editor/cke-html/src/html/combine-html.d.ts +0 -2
  21. package/@ones-editor/cke-html/src/html/comment.d.ts +0 -6
  22. package/@ones-editor/cke-html/src/html/converter.d.ts +0 -7
  23. package/@ones-editor/cke-html/src/html/data-helper/link-data.d.ts +0 -0
  24. package/@ones-editor/cke-html/src/html/image.d.ts +0 -4
  25. package/@ones-editor/cke-html/src/html/link.d.ts +0 -2
  26. package/@ones-editor/cke-html/src/html/markdown.d.ts +0 -2
  27. package/@ones-editor/cke-html/src/html/mention.d.ts +0 -4
  28. package/@ones-editor/cke-html/src/index.d.ts +0 -2
  29. package/@ones-editor/core/src/core/input-handler/remove-unknown-components.d.ts +0 -3
  30. package/@ones-editor/main-toolbar/src/items/file.d.ts +0 -8
  31. package/@ones-editor/main-toolbar/src/items/mention.d.ts +0 -8
package/dist/index.js CHANGED
@@ -3855,7 +3855,7 @@ div.comment-editor-root [data-type=editor-container].root div[data-type=editor-b
3855
3855
  min-width: 0;
3856
3856
  }
3857
3857
  .editor-root:not(.mobile) [data-type=editor-container].root div[data-type=editor-block].code-block {
3858
- min-width: 200px;
3858
+ min-width: 360px;
3859
3859
  }div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block][data-style-align=center] [data-type=block-content][data-content-placeholder]::before {
3860
3860
  justify-content: center;
3861
3861
  }
@@ -5658,11 +5658,22 @@ div.editor-root div.editor-content div[data-type=editor-container] div.embed-blo
5658
5658
  color: #87888A;
5659
5659
  font-size: 12px;
5660
5660
  }
5661
- div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info .info {
5661
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info .file-creator {
5662
+ max-width: 80px;
5663
+ white-space: nowrap;
5664
+ overflow: hidden;
5665
+ text-overflow: ellipsis;
5666
+ }
5667
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info .uploaded-time {
5668
+ margin-left: 5px;
5662
5669
  white-space: nowrap;
5663
5670
  overflow: hidden;
5664
5671
  text-overflow: ellipsis;
5665
5672
  }
5673
+ div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-info .file-size {
5674
+ margin-left: 15px;
5675
+ flex-shrink: 0;
5676
+ }
5666
5677
  div.editor-root div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root .file-actions {
5667
5678
  position: absolute;
5668
5679
  top: 0;
@@ -5717,10 +5728,10 @@ div.editor-root div.editor-content div[data-type=editor-container] div.embed-blo
5717
5728
  height: 24px;
5718
5729
  }
5719
5730
  div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] {
5720
- min-width: 200px;
5731
+ min-width: 360px;
5721
5732
  }
5722
5733
  div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container] div.embed-block[data-type=editor-block][data-embed-type=office] [data-type=block-content] .card-root {
5723
- min-width: 200px;
5734
+ min-width: 360px;
5724
5735
  }:root {
5725
5736
  --editor-version-button-border: black;
5726
5737
  --editor-bg-color: #ffffff;
@@ -8864,35 +8875,6 @@ div.editor-root.compact.no-heading-collapse.no-block-menu > .editor-content {
8864
8875
  }
8865
8876
  [data-command-bar-id=main-toolbar-more-menu] .editor-command-bar.toolbar .command-item.hidden, [data-command-bar-id=main-toolbar-more-menu] .editor-command-bar.menu .command-item.hidden {
8866
8877
  display: flex;
8867
- }
8868
- .editor-main-toolbar-root {
8869
- display: flex;
8870
- width: 100%;
8871
- min-height: 35px;
8872
- }
8873
- .editor-main-toolbar-root .editor-main-toolbar-resizer {
8874
- position: relative;
8875
- flex-grow: 1;
8876
- flex-shrink: 1;
8877
- }
8878
- .editor-main-toolbar-root .editor-main-toolbar-resizer .editor-main-toolbar-container {
8879
- position: absolute;
8880
- left: 0;
8881
- right: 0;
8882
- top: 0;
8883
- bottom: 0;
8884
- display: flex;
8885
- align-items: center;
8886
- }
8887
- .editor-main-toolbar-root .editor-main-toolbar-resizer .editor-main-toolbar-container .editor-command-bar-root {
8888
- overflow: hidden !important;
8889
- }
8890
- .editor-main-toolbar-root [data-command-bar-root-id=main-toolbar-fullscreen] {
8891
- flex-grow: 0 !important;
8892
- flex-shrink: 0 !important;
8893
- display: flex;
8894
- align-items: center;
8895
- justify-content: center;
8896
8878
  }`)),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
8897
8879
  var __defProp = Object.defineProperty;
8898
8880
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -24898,11 +24880,18 @@ var __publicField = (obj, key, value) => {
24898
24880
  };
24899
24881
  }
24900
24882
  function isEmptyDoc(doc2) {
24901
- const blocks = doc2.blocks.root;
24902
- const ret = blocks.every((block) => {
24903
- return block.type === "text" && getTextLength(block.text || []) === 0;
24904
- });
24905
- return ret;
24883
+ const root2 = doc2.blocks.root;
24884
+ if (root2.length !== 1) {
24885
+ return false;
24886
+ }
24887
+ const block = root2[0];
24888
+ if (!block.text) {
24889
+ return false;
24890
+ }
24891
+ if (getTextLength(block.text)) {
24892
+ return false;
24893
+ }
24894
+ return true;
24906
24895
  }
24907
24896
  function createContainer$1(doc2, docsOrDocObject) {
24908
24897
  const containerId = genId();
@@ -26082,11 +26071,9 @@ var __publicField = (obj, key, value) => {
26082
26071
  __publicField(this, "composingTimer");
26083
26072
  __publicField(this, "callbacks");
26084
26073
  __publicField(this, "inputElement");
26085
- __publicField(this, "focused", false);
26086
26074
  __publicField(this, "handleBlur", () => {
26087
26075
  this.editor.emit("blur", this.editor);
26088
26076
  this.callbacks.onBlur();
26089
- this.focused = false;
26090
26077
  });
26091
26078
  __publicField(this, "handleWindowFocus", () => {
26092
26079
  if (document.activeElement === this.inputElement) {
@@ -26103,7 +26090,6 @@ var __publicField = (obj, key, value) => {
26103
26090
  this.editor.emit("focus", this.editor);
26104
26091
  this.callbacks.onFocus();
26105
26092
  this.editor.input.focus();
26106
- this.focused = true;
26107
26093
  });
26108
26094
  }
26109
26095
  return;
@@ -26112,9 +26098,7 @@ var __publicField = (obj, key, value) => {
26112
26098
  return;
26113
26099
  }
26114
26100
  setTimeout(() => {
26115
- if (this.focused) {
26116
- this.handleBlur();
26117
- }
26101
+ this.handleBlur();
26118
26102
  });
26119
26103
  });
26120
26104
  __publicField(this, "handleDocumentSelectionChange", () => {
@@ -26129,9 +26113,6 @@ var __publicField = (obj, key, value) => {
26129
26113
  return;
26130
26114
  }
26131
26115
  }
26132
- if (!this.focused) {
26133
- return;
26134
- }
26135
26116
  this.handleBlur();
26136
26117
  }, 100);
26137
26118
  });
@@ -26297,7 +26278,6 @@ var __publicField = (obj, key, value) => {
26297
26278
  this.callbacks.onFocus();
26298
26279
  });
26299
26280
  }
26300
- this.focused = true;
26301
26281
  }
26302
26282
  isInDisableScrollMask(target) {
26303
26283
  let elem = target;
@@ -26334,7 +26314,7 @@ var __publicField = (obj, key, value) => {
26334
26314
  }
26335
26315
  }
26336
26316
  function moveInputToScreenCenter(editor) {
26337
- const container = getScrollContainer$1(editor.rootContainer);
26317
+ const container = editor.rootElement;
26338
26318
  const rect = container.getBoundingClientRect();
26339
26319
  const scale = getElementScale(container);
26340
26320
  const windowWidth = window.innerWidth;
@@ -26345,10 +26325,9 @@ var __publicField = (obj, key, value) => {
26345
26325
  const y2 = rect.bottom > windowHeight ? windowHeight : rect.bottom;
26346
26326
  const centerX = (x1 + x2) / 2;
26347
26327
  const centerY = (y1 + y2) / 2;
26348
- const input2 = editor.input.inputElement;
26349
- const inputHeight = input2.getBoundingClientRect().height;
26350
26328
  const x = 0 - rect.left + centerX;
26351
- const y = 0 - rect.top + centerY + container.scrollTop - inputHeight / 2;
26329
+ const y = 0 - rect.top + centerY;
26330
+ const input2 = editor.input.inputElement;
26352
26331
  input2.style.left = `${x / scale}px`;
26353
26332
  input2.style.top = `${y / scale}px`;
26354
26333
  }
@@ -29957,64 +29936,6 @@ ${codeText}
29957
29936
  }
29958
29937
  return doc2;
29959
29938
  }
29960
- function removeUnknownComponents(editor, doc2) {
29961
- const getAllBlockTypes = () => {
29962
- const types2 = [];
29963
- editor.editorBlocks.forEach((b) => {
29964
- types2.push(b.blockType);
29965
- });
29966
- return types2;
29967
- };
29968
- const getAllEmbedTypes = () => {
29969
- const embeds = [];
29970
- editor.editorEmbeds.forEach((e2) => {
29971
- embeds.push(e2.embedType);
29972
- });
29973
- return embeds;
29974
- };
29975
- const getAllBoxTypes = () => {
29976
- const boxes = [];
29977
- editor.editorBoxes.forEach((b) => {
29978
- boxes.push(b.boxType);
29979
- });
29980
- return boxes;
29981
- };
29982
- const blockTypes = new Set(getAllBlockTypes());
29983
- const embedTypes = new Set(getAllEmbedTypes());
29984
- const boxTypes = new Set(getAllBoxTypes());
29985
- Array.from(Object.keys(doc2.blocks)).forEach((containerId) => {
29986
- const blocks = doc2.blocks[containerId];
29987
- for (let i = blocks.length - 1; i >= 0; i--) {
29988
- const block = blocks[i];
29989
- const blockType = block.type;
29990
- if (isTextKindBlockType(editor, blockType)) {
29991
- const text2 = block.text;
29992
- for (let j = text2.length - 1; j >= 0; j--) {
29993
- const op = text2[j];
29994
- if (isBoxOp(op)) {
29995
- const box = op.attributes;
29996
- if (!boxTypes.has(box.type)) {
29997
- text2.splice(j, 1);
29998
- }
29999
- }
30000
- }
30001
- } else if (blockType === "embed") {
30002
- const embed = block;
30003
- const embedType = embed.embedType;
30004
- if (!embedTypes.has(embedType)) {
30005
- blocks.splice(i, 1);
30006
- }
30007
- } else {
30008
- if (!blockTypes.has(block.type)) {
30009
- blocks.splice(i, 1);
30010
- }
30011
- }
30012
- }
30013
- if (blocks.length === 0) {
30014
- blocks.push(createEmptyTextBlockData());
30015
- }
30016
- });
30017
- }
30018
29939
  class EditorInputHandlers {
30019
29940
  constructor(editor) {
30020
29941
  __publicField(this, "editor");
@@ -30273,7 +30194,6 @@ ${codeText}
30273
30194
  return;
30274
30195
  }
30275
30196
  }
30276
- removeUnknownComponents(this.editor, doc2);
30277
30197
  const cloneDocResult = { blockIdMap: /* @__PURE__ */ new Map(), containerIdMap: /* @__PURE__ */ new Map(), boxIdMap: /* @__PURE__ */ new Map() };
30278
30198
  await editorInsertDocWithResources(this.editor, doc2, cloneDocResult);
30279
30199
  for (let i = 0; i < this.handlers.length; i++) {
@@ -31950,7 +31870,6 @@ ${codeText}
31950
31870
  __publicField(this, "settingsProvider");
31951
31871
  __publicField(this, "_readonly", false);
31952
31872
  __publicField(this, "_scrollable", true);
31953
- __publicField(this, "_destroyed", false);
31954
31873
  __publicField(this, "getColor", (index2) => {
31955
31874
  const colors = this.options.colors;
31956
31875
  if (colors.length === 0) {
@@ -32090,10 +32009,6 @@ ${codeText}
32090
32009
  this.domEvents.destroy();
32091
32010
  this.removeAllListeners();
32092
32011
  this.inputHandlers.destroy();
32093
- this._destroyed = true;
32094
- }
32095
- get destroyed() {
32096
- return this._destroyed;
32097
32012
  }
32098
32013
  focus(options) {
32099
32014
  this.input.focus(options);
@@ -32385,17 +32300,11 @@ ${codeText}
32385
32300
  this.emit("change", Array.from(this.users.values()));
32386
32301
  }, 300);
32387
32302
  }
32388
- getSimpleCursors(blockId, excludeUserId) {
32303
+ getSimpleCursors(blockId) {
32389
32304
  const ret = /* @__PURE__ */ new Map();
32390
32305
  Array.from(this.cursors.values()).filter((message) => {
32391
32306
  const ret2 = message.range.anchor.blockId === blockId && isSimpleRange(message.range);
32392
- if (!ret2) {
32393
- return false;
32394
- }
32395
- if (excludeUserId && excludeUserId === message.user.userId) {
32396
- return false;
32397
- }
32398
- return true;
32307
+ return ret2;
32399
32308
  }).forEach((message) => {
32400
32309
  const offset = message.range.focus.offset;
32401
32310
  let users = ret.get(offset);
@@ -40167,7 +40076,7 @@ ${codeText}
40167
40076
  assert(logger$2S, typeof blockIndex === "number", "invalid path blockIndex");
40168
40077
  const blockData = editor.doc.getBlockData(containerId, blockIndex);
40169
40078
  const length = getTextLength(blockText);
40170
- const cursorMessages = remoteUsers.getSimpleCursors(blockData.id, editor.doc.getUser().userId);
40079
+ const cursorMessages = remoteUsers.getSimpleCursors(blockData.id);
40171
40080
  cursorMessages.forEach((messages, offset) => {
40172
40081
  if (offset > length) {
40173
40082
  offset = length;
@@ -41129,8 +41038,6 @@ ${codeText}
41129
41038
  const TableEditIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8 14.5H2.5C1.94772 14.5 1.5 14.0523 1.5 13.5V2.5C1.5 1.94772 1.94772 1.5 2.5 1.5H13.5C14.0523 1.5 14.5 1.94772 14.5 2.5V8" stroke="#2D2D2E"/>\n<path d="M1.6 4.8H14.4" stroke="#2D2D2E"/>\n<path d="M1.6 9.6H8.00078" stroke="#2D2D2E"/>\n<path d="M5.6 1.6L5.6 14.4" stroke="#2D2D2E"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5043 8.98727L11.6789 8.22924C11.7097 8.09564 11.8387 8 11.9881 8H12.8119C12.9613 8 13.0903 8.09564 13.1211 8.22924L13.2957 8.98727C13.3177 9.08256 13.3912 9.16027 13.488 9.20102C13.569 9.23514 13.648 9.2726 13.7248 9.31318C13.8018 9.35372 13.877 9.3976 13.95 9.44477C14.037 9.50098 14.1474 9.52034 14.2487 9.49008L15.0543 9.24927C15.1963 9.20683 15.3514 9.26108 15.4261 9.37933L15.9576 10.2206C16.0323 10.3389 16.0062 10.4888 15.895 10.5799L15.2639 11.0972C15.1846 11.1622 15.1477 11.2593 15.1575 11.3562C15.1657 11.4375 15.1698 11.5189 15.1697 11.6C15.1698 11.6811 15.1658 11.7625 15.1576 11.8438C15.1478 11.9407 15.1847 12.0378 15.264 12.1028L15.895 12.62C16.0062 12.7112 16.0324 12.8611 15.9577 12.9793L15.4262 13.8206C15.3515 13.9389 15.1963 13.9931 15.0544 13.9507L14.2487 13.7099C14.1474 13.6796 14.037 13.699 13.95 13.7552C13.877 13.8024 13.8018 13.8463 13.7248 13.8868C13.648 13.9274 13.569 13.9649 13.488 13.999C13.3912 14.0397 13.3177 14.1174 13.2957 14.2127L13.1211 14.9708C13.0903 15.1044 12.9613 15.2 12.8119 15.2H11.9881C11.8387 15.2 11.7097 15.1044 11.6789 14.9708L11.5043 14.2127C11.4823 14.1174 11.4088 14.0397 11.312 13.999C11.231 13.9649 11.152 13.9274 11.0752 13.8868C10.9982 13.8463 10.923 13.8024 10.85 13.7552C10.763 13.699 10.6526 13.6796 10.5513 13.7099L9.74565 13.9507C9.60366 13.9931 9.44854 13.9389 9.37384 13.8206L8.84234 12.9793C8.76764 12.8611 8.79378 12.7112 8.905 12.62L9.53602 12.1028C9.61534 12.0378 9.6522 11.9407 9.64243 11.8438C9.63424 11.7625 9.63023 11.6811 9.63031 11.6C9.63023 11.5189 9.63426 11.4375 9.64247 11.3562C9.65226 11.2593 9.61539 11.1622 9.53607 11.0972L8.90506 10.5799C8.79384 10.4888 8.7677 10.3389 8.8424 10.2206L9.3739 9.37933C9.4486 9.26108 9.60371 9.20683 9.74571 9.24927L10.5514 9.49008C10.6526 9.52034 10.7631 9.50098 10.8501 9.44477C10.923 9.3976 10.9982 9.35372 11.0752 9.31318C11.152 9.2726 11.231 9.23514 11.312 9.20102C11.4088 9.16027 11.4823 9.08256 11.5043 8.98727ZM12.3278 12.5136C12.8866 12.5136 13.3396 12.0996 13.3396 11.5889C13.3396 11.0783 12.8866 10.6643 12.3278 10.6643C11.769 10.6643 11.316 11.0783 11.316 11.5889C11.316 12.0996 11.769 12.5136 12.3278 12.5136Z" fill="#2D2D2E"/>\n</svg>\n';
41130
41039
  const AdjustWidthIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8 6H2.5C1.94772 6 1.5 6.44772 1.5 7V13.5C1.5 14.0523 1.94772 14.5 2.5 14.5H8M8 6H13.5C14.0523 6 14.5 6.44772 14.5 7V13.5C14.5 14.0523 14.0523 14.5 13.5 14.5H8M8 6V14.5" stroke="#2D2D2E"/>\n<path d="M1.5 2.5H14.5M1.5 1V4M8 1V4M14.5 1V4" stroke="#2D2D2E"/>\n</svg>\n';
41131
41040
  const TocIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2 3.5L14 3.5" stroke="#2D2D2E"/>\n<path d="M2 6.50397H10" stroke="#2D2D2E"/>\n<path d="M2 12.5L14 12.5" stroke="#2D2D2E"/>\n<path d="M6 9.5H14" stroke="#2D2D2E"/>\n</svg>\n';
41132
- const AttachmentIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.49669 1C4.80282 1 3.0118 2.3515 3.0118 3.76237L3 10.6206M6.49669 1C8.41943 1 10.0154 2.60058 10.0154 4.17342M6.49669 1C7.43289 1 8.28684 1.42118 8.90405 1.96796C9.50746 2.50252 10.0154 3.29036 10.0154 4.17342M10.0154 4.17342L10.0154 9.61446C10.0154 10.4166 9.23033 11.2316 8 11.2316C6.91283 11.2316 6.01026 10.5735 6.01026 9.87981L5.98457 5.04102M3 10.6206C3 13.1126 5.38055 15 8 15M3 10.6206C3 12.9301 5.13252 15 8 15M8 15C10.6194 15 13 13.1988 13 10.7068M8 15C10.8675 15 13 13.0162 13 10.7068M13 10.7068V5.04102" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>\n<path d="M13 4V10C13 12.7614 10.7614 15 8 15C5.23858 15 3 12.7614 3 10V4.5" stroke="currentColor"/>\n<path d="M10 9V4.5C10 2.567 8.433 1 6.5 1C4.567 1 3 2.567 3 4.5" stroke="currentColor"/>\n<path d="M10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9V4" stroke="currentColor"/>\n</svg>\n';
41133
- const Mention2Icon = '<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M11.237 13.6469C10.2882 14.1888 9.18962 14.4985 8.01868 14.4985C4.42977 14.4985 1.52039 11.5892 1.52039 8.00024C1.52039 4.41134 4.42977 1.50195 8.01868 1.50195C11.6076 1.50195 14.517 4.41134 14.517 8.00024C14.517 8.70345 14.4221 9.21723 14.2284 9.56578C13.9961 10.0692 13.4926 10.7276 12.66 10.8438C12.3454 10.9008 12.0336 10.7797 11.7805 10.6233C11.3724 10.3711 11.2127 9.88274 11.2127 9.40298V4.48055" stroke="currentColor"/>\n<path d="M7.67957 4.73828C9.37526 4.73835 10.6913 6.20213 10.6913 7.93262C10.6913 9.6631 9.37526 11.1269 7.67957 11.127C5.98381 11.127 4.66785 9.66315 4.66785 7.93262C4.66785 6.20209 5.98381 4.73828 7.67957 4.73828Z" stroke="currentColor"/>\n</svg>\n';
41134
41041
  const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41135
41042
  __proto__: null,
41136
41043
  TableEditIcon,
@@ -41261,9 +41168,7 @@ ${codeText}
41261
41168
  LoadingCircleIcon,
41262
41169
  TextGroupIcon,
41263
41170
  AdjustWidthIcon,
41264
- TocIcon,
41265
- AttachmentIcon,
41266
- Mention2Icon
41171
+ TocIcon
41267
41172
  }, Symbol.toStringTag, { value: "Module" }));
41268
41173
  function createLoading() {
41269
41174
  const loading2 = createElement("span", ["editor-loading-icon"], null);
@@ -41884,9 +41789,6 @@ ${codeText}
41884
41789
  }
41885
41790
  const content = createElement("div", ["editor-command-bar-root"], null);
41886
41791
  content.setAttribute("data-keep-editor-focus", "");
41887
- if (this.options.rootId) {
41888
- content.setAttribute("data-command-bar-root-id", this.options.rootId);
41889
- }
41890
41792
  if (this.options.header) {
41891
41793
  const headerElem = createElement("div", ["editor-command-bar-header"], null);
41892
41794
  if (this.options.header instanceof Function) {
@@ -41992,7 +41894,7 @@ ${codeText}
41992
41894
  placement: (_a = options == null ? void 0 : options.placement) != null ? _a : "bottom-start",
41993
41895
  maxWidth: (_b = this.options.maxWidth) != null ? _b : 650,
41994
41896
  arrow: (_c = options == null ? void 0 : options.arrow) != null ? _c : this.options.tippyArrow,
41995
- appendTo: target.closest(".command-bar-container") || document.body,
41897
+ appendTo: document.body,
41996
41898
  onShow: this.handleShow,
41997
41899
  onHidden: this.handleHidden,
41998
41900
  onShown: this.handleShown,
@@ -42558,7 +42460,7 @@ ${codeText}
42558
42460
  placement: (_a = options == null ? void 0 : options.placement) != null ? _a : "bottom-start",
42559
42461
  maxWidth: 500,
42560
42462
  arrow: this.options.tippyArrow,
42561
- appendTo: target.closest(".command-bar-container") || document.body,
42463
+ appendTo: document.body,
42562
42464
  onShow: this.handleShow,
42563
42465
  onHidden: this.handleHidden,
42564
42466
  delay: options == null ? void 0 : options.delay,
@@ -42696,7 +42598,7 @@ ${codeText}
42696
42598
  });
42697
42599
  }
42698
42600
  initCommandBarElement(elem) {
42699
- addClass(elem, "command-dialog", "manual");
42601
+ addClass(elem, "dialog", "manual");
42700
42602
  }
42701
42603
  initItemElement(item, elem) {
42702
42604
  }
@@ -43168,7 +43070,7 @@ ${codeText}
43168
43070
  placement: "bottom",
43169
43071
  maxWidth: 1e3,
43170
43072
  arrow: (_b = options == null ? void 0 : options.arrow) != null ? _b : this.options.tippyArrow,
43171
- appendTo: target.closest(".command-bar-container") || document.body,
43073
+ appendTo: document.body,
43172
43074
  onShow: this.handleShow,
43173
43075
  onShown: this.handleShown,
43174
43076
  onHidden: this.handleHidden,
@@ -54973,7 +54875,7 @@ ${codeText}
54973
54875
  const svg = await mathjax2Svg(editor, tex);
54974
54876
  const data2 = svg;
54975
54877
  const file2 = new File([data2], "math.svg");
54976
- const path = await editor.doc.uploadResource(file2, { resourceType: "graph" });
54878
+ const path = await editor.doc.uploadResource(file2);
54977
54879
  return path.resourceId;
54978
54880
  }
54979
54881
  async function convertAndUploadMathjaxForEmbed(editor, tex) {
@@ -54981,7 +54883,7 @@ ${codeText}
54981
54883
  const perfectState = analyzeMathjaxSvgWidth(svg);
54982
54884
  const data2 = svg;
54983
54885
  const file2 = new File([data2], "math.svg");
54984
- const path = await editor.doc.uploadResource(file2, { resourceType: "graph" });
54886
+ const path = await editor.doc.uploadResource(file2);
54985
54887
  return {
54986
54888
  resourceId: path.resourceId,
54987
54889
  ...perfectState
@@ -55254,7 +55156,7 @@ ${codeText}
55254
55156
  return ` $${math.tex}$ `;
55255
55157
  }
55256
55158
  if (math.src) {
55257
- return `<img data-embed-type="mathjax" data-uuid="mathjax:${math.src}" src="${editor.doc.buildResourceUrl(math.src, { withToken: true })}" />`;
55159
+ return `<img src="${editor.doc.buildResourceUrl(math.src, { withToken: true })}" />`;
55258
55160
  }
55259
55161
  return `<code>$${math.tex}$</code>`;
55260
55162
  }
@@ -55435,7 +55337,7 @@ ${codeText}
55435
55337
  function convertTo$g(editor, blockData, doc2, type) {
55436
55338
  const mathData = blockData.embedData;
55437
55339
  if (type === "html") {
55438
- return `<img data-embed-type="mathjax" data-uuid="mathjax:${mathData.src}" src="${editor.doc.buildResourceUrl(mathData.src, { withToken: true })}" />`;
55340
+ return `<img src="${editor.doc.buildResourceUrl(mathData.src, { withToken: true })}" />`;
55439
55341
  }
55440
55342
  if (type === "markdown") {
55441
55343
  return `
@@ -64208,17 +64110,6 @@ $$${mathData.mathjaxText}$$
64208
64110
  const failedLoad = !!block.querySelector(".images > .image-container.error, .images > .image-container.empty ");
64209
64111
  const width = calImageBlockStyleWidth(editor, blockData, parentContainer, failedLoad);
64210
64112
  const height = calBlockHeight(editor, blockData, parentContainer, failedLoad);
64211
- if (width.startsWith("0") && height.startsWith("0")) {
64212
- const image = block.querySelector("img");
64213
- if (image) {
64214
- image.onload = () => {
64215
- setTimeout(() => {
64216
- updateImageBlockSize(editor, blockData, blockElement, parentContainerElement);
64217
- }, 300);
64218
- };
64219
- }
64220
- return;
64221
- }
64222
64113
  const content = getBlockContent(block);
64223
64114
  if (width === "auto") {
64224
64115
  content.style.width = width;
@@ -64996,8 +64887,7 @@ $$${mathData.mathjaxText}$$
64996
64887
  const res = await this.editor.doc.uploadResource(file2, {
64997
64888
  onProgress: (progress) => {
64998
64889
  setImageUploading(imageContainer, progress);
64999
- },
65000
- resourceType: "image"
64890
+ }
65001
64891
  });
65002
64892
  removeClass(imageContainer, "uploading");
65003
64893
  this.images[index2].src = res.resourceId;
@@ -68974,7 +68864,7 @@ ${codeText}
68974
68864
  }
68975
68865
  const fileName = `image.${ext}`;
68976
68866
  const file2 = new File([blob], fileName, { type: mimeString });
68977
- const ret = await editor.doc.uploadResource(file2, { resourceType: "paste" });
68867
+ const ret = await editor.doc.uploadResource(file2);
68978
68868
  return ret.resourceId;
68979
68869
  }
68980
68870
  return src;
@@ -69186,7 +69076,7 @@ ${codeText}
69186
69076
  const data2 = blockData.embedData;
69187
69077
  const images = getImages$1(data2);
69188
69078
  if (type === "html") {
69189
- return images.map((image) => `<img data-embed-type="image" data-uuid="image:${data2.src}" src="${editor.doc.buildResourceUrl(image.src, { withToken: true })}">`).join("");
69079
+ return images.map((image) => `<img src="${editor.doc.buildResourceUrl(image.src, { withToken: true })}">`).join("");
69190
69080
  }
69191
69081
  if (type === "markdown") {
69192
69082
  const markdown = images.map((image) => `![img](${editor.doc.buildResourceUrl(image.src, { withToken: true })})`).join("\n");
@@ -74549,6 +74439,20 @@ ${codeText}
74549
74439
  const maxCellTextLength = maxCellTextLengths.get(cell.col) || 0;
74550
74440
  return padText(text2, maxCellTextLength);
74551
74441
  };
74442
+ if (type === "text") {
74443
+ const text2 = [];
74444
+ for (let col = 0; col < grid.colCount; col++) {
74445
+ const cellText = getCellText({ row: 0, col });
74446
+ text2.push(cellText);
74447
+ }
74448
+ for (let row = 1; row < grid.rowCount; row++) {
74449
+ for (let col = 0; col < grid.colCount; col++) {
74450
+ const cellText = getCellText({ row, col });
74451
+ text2.push(cellText);
74452
+ }
74453
+ }
74454
+ return text2.join("\n");
74455
+ }
74552
74456
  const lines = [];
74553
74457
  let headerText = "|";
74554
74458
  let headerSeparator = "|";
@@ -80432,7 +80336,7 @@ ${docStr}
80432
80336
  const data2 = boxData;
80433
80337
  if (type === "html") {
80434
80338
  if (data2.src) {
80435
- return `<a data-embed-type="file" data-uuid="file:${data2.src}" href="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" >${data2.fileName}</a>`;
80339
+ return `<a href="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" >${data2.fileName}</a>`;
80436
80340
  }
80437
80341
  return `[${data2.fileName}]`;
80438
80342
  }
@@ -80547,10 +80451,14 @@ ${docStr}
80547
80451
  }
80548
80452
  nameElement.title = fileName;
80549
80453
  const infos = createElement("div", ["file-info"], detail);
80550
- const timeText = i18n$1.t("file.uploadedTime", { time: formatDate(new Date(created), "YYYY-MM-DD hh:mm") });
80551
- const sizeText = formatBytes(fileSize);
80552
- const infoText = `${creator} ${timeText} ${sizeText}`;
80553
- createElement("div", ["info"], infos, infoText);
80454
+ if (creator) {
80455
+ createElement("div", ["file-creator"], infos, creator);
80456
+ }
80457
+ if (created) {
80458
+ const timeText = i18n$1.t("file.uploadedTime", { time: formatDate(new Date(created), "YYYY-MM-DD hh:mm") });
80459
+ createElement("div", ["uploaded-time"], infos, timeText);
80460
+ }
80461
+ createElement("div", ["file-size"], infos, formatBytes(fileSize));
80554
80462
  const actions2 = createElement("div", ["file-actions"], card);
80555
80463
  const options = editor.getComponentOptions("file");
80556
80464
  let copilotButton;
@@ -80730,7 +80638,7 @@ ${docStr}
80730
80638
  const data2 = embedData;
80731
80639
  if (type === "html") {
80732
80640
  if (data2.src) {
80733
- return `<p><a data-embed-type="file" data-uuid="file:${data2.src}" href="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" >${data2.fileName}</a></p>`;
80641
+ return `<p><a href="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" >${data2.fileName}</a></p>`;
80734
80642
  }
80735
80643
  return `<p>[${data2.fileName}]</p>`;
80736
80644
  }
@@ -86085,7 +85993,7 @@ ${docStr}
86085
85993
  const file2 = new File([buffer], `${genId()}.svg`, {
86086
85994
  type: "image/svg+xml"
86087
85995
  });
86088
- const ret = await editor.doc.uploadResource(file2, { resourceType: "graph" });
85996
+ const ret = await editor.doc.uploadResource(file2);
86089
85997
  return ret.resourceId;
86090
85998
  }
86091
85999
  const _MermaidInstance = class extends GraphBase {
@@ -86254,7 +86162,7 @@ ${docStr}
86254
86162
  const data2 = embedData;
86255
86163
  if (type === "html") {
86256
86164
  if (data2.src) {
86257
- return `<img data-embed-type="mermaid" data-uuid="mermaid:${data2.src}" src="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" />`;
86165
+ return `<img src="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" />`;
86258
86166
  }
86259
86167
  if (data2.mermaidText) {
86260
86168
  return `<div class="mermaid">${data2.mermaidText}</div>`;
@@ -86323,7 +86231,7 @@ ${data2.mermaidText}
86323
86231
  const file2 = new File([buffer], `${genId()}.svg`, {
86324
86232
  type: "image/svg+xml"
86325
86233
  });
86326
- const resource = await editor.doc.uploadResource(file2, { resourceType: "graph" });
86234
+ const resource = await editor.doc.uploadResource(file2);
86327
86235
  return resource.resourceId;
86328
86236
  }
86329
86237
  const _FlowChartInstance = class extends GraphBase {
@@ -86420,7 +86328,7 @@ ${data2.mermaidText}
86420
86328
  const data2 = embedData;
86421
86329
  if (type === "html") {
86422
86330
  if (data2.src) {
86423
- return `<img data-embed-type="flowchart" data-uuid="flowchart:${data2.src}" src="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" />`;
86331
+ return `<img src="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" />`;
86424
86332
  }
86425
86333
  if (data2.flowchartText) {
86426
86334
  return `<div>${data2.flowchartText}</div>`;
@@ -86778,7 +86686,7 @@ ${data2.flowchartText}
86778
86686
  });
86779
86687
  const targetBlock = editor.findBlockById(getBlockId(block));
86780
86688
  if (targetBlock) {
86781
- const res = await editor.doc.uploadResource(file2, { resourceType: "graph" });
86689
+ const res = await editor.doc.uploadResource(file2);
86782
86690
  const { resourceId } = res;
86783
86691
  const oldData = editor.getBlockData(targetBlock);
86784
86692
  const oldEmbedData = oldData.embedData;
@@ -86830,40 +86738,31 @@ ${data2.flowchartText}
86830
86738
  const xml = drawIoData.xmlSvg || drawIoData.xml || "";
86831
86739
  switch (msg.event) {
86832
86740
  case "configure":
86833
- iframe.contentWindow.postMessage(
86834
- JSON.stringify({
86835
- action: "configure",
86836
- config: {
86837
- defaultFonts: ["Humor Sans", "Helvetica", "Times New Roman"]
86838
- }
86839
- }),
86840
- "*"
86841
- );
86741
+ iframe.contentWindow.postMessage(JSON.stringify({
86742
+ action: "configure",
86743
+ config: {
86744
+ defaultFonts: ["Humor Sans", "Helvetica", "Times New Roman"]
86745
+ }
86746
+ }), "*");
86842
86747
  break;
86843
86748
  case "init":
86844
- iframe.contentWindow.postMessage(
86845
- JSON.stringify({
86846
- action: "load",
86847
- saveAndExit: 1,
86848
- noSaveBtn: 1,
86849
- noExitBtn: 0,
86850
- xml
86851
- }),
86852
- "*"
86853
- );
86749
+ iframe.contentWindow.postMessage(JSON.stringify({
86750
+ action: "load",
86751
+ saveAndExit: 1,
86752
+ noSaveBtn: 1,
86753
+ noExitBtn: 0,
86754
+ xml
86755
+ }), "*");
86854
86756
  loaded();
86855
86757
  loadingHandler.removeLoading();
86856
86758
  break;
86857
86759
  case "save":
86858
86760
  exportFlag = "save";
86859
- iframe.contentWindow.postMessage(
86860
- JSON.stringify({
86861
- action: "export",
86862
- format: "xmlsvg",
86863
- spin: "Saving graph"
86864
- }),
86865
- "*"
86866
- );
86761
+ iframe.contentWindow.postMessage(JSON.stringify({
86762
+ action: "export",
86763
+ format: "xmlsvg",
86764
+ spin: "Saving graph"
86765
+ }), "*");
86867
86766
  break;
86868
86767
  case "export":
86869
86768
  if (exportFlag !== "auto") {
@@ -86889,15 +86788,12 @@ ${data2.flowchartText}
86889
86788
  allowRetry: true,
86890
86789
  onOk: () => {
86891
86790
  setTimeout(() => {
86892
- drawioIframeWindow.postMessage(
86893
- JSON.stringify({
86894
- action: "export",
86895
- format: "xmlsvg",
86896
- spin: i18n$1.t("drawio.save"),
86897
- autoSave: exportFlag
86898
- }),
86899
- "*"
86900
- );
86791
+ drawioIframeWindow.postMessage(JSON.stringify({
86792
+ action: "export",
86793
+ format: "xmlsvg",
86794
+ spin: i18n$1.t("drawio.save"),
86795
+ autoSave: exportFlag
86796
+ }), "*");
86901
86797
  }, 1e3);
86902
86798
  },
86903
86799
  onClose: () => {
@@ -86963,15 +86859,12 @@ ${data2.flowchartText}
86963
86859
  if (!drawioIframe || !drawioIframe.contentWindow) {
86964
86860
  return;
86965
86861
  }
86966
- drawioIframe.contentWindow.postMessage(
86967
- JSON.stringify({
86968
- action: "export",
86969
- format: "xmlsvg",
86970
- spin: "Saving graph",
86971
- autoSave: true
86972
- }),
86973
- "*"
86974
- );
86862
+ drawioIframe.contentWindow.postMessage(JSON.stringify({
86863
+ action: "export",
86864
+ format: "xmlsvg",
86865
+ spin: "Saving graph",
86866
+ autoSave: true
86867
+ }), "*");
86975
86868
  }, SAVE_DELAY_TIME);
86976
86869
  };
86977
86870
  const exit = () => {
@@ -87111,12 +87004,10 @@ ${data2.flowchartText}
87111
87004
  }
87112
87005
  function updateGraphByXml(mxFile, embed, editor) {
87113
87006
  assert(logger$i, editor, "parameter missing");
87114
- initDrawIo(editor).then(
87115
- () => loopCheckResourceWasLoaded({
87116
- checker: () => !!(window.mxUtils && window.mxGraph && window.mxCodec),
87117
- maxRetryTime: 5e3
87118
- })
87119
- ).then(() => {
87007
+ initDrawIo(editor).then(() => loopCheckResourceWasLoaded({
87008
+ checker: () => !!(window.mxUtils && window.mxGraph && window.mxCodec),
87009
+ maxRetryTime: 5e3
87010
+ })).then(() => {
87120
87011
  const { mxUtils, mxGraph: MxGraph, mxCodec: MxCodec, Graph } = window;
87121
87012
  assert(logger$i, mxUtils, "External resource loading exception: mxUtils");
87122
87013
  assert(logger$i, MxGraph, "External resource loading exception: MxGraph");
@@ -87136,10 +87027,7 @@ ${data2.flowchartText}
87136
87027
  const raw = atob(diagramBase64);
87137
87028
  const pako = window.pako;
87138
87029
  assert(logger$i, pako, "External resource loading exception: pako");
87139
- const encodedXml = pako.inflateRaw(
87140
- Uint8Array.from(raw, (c) => c.charCodeAt(0)),
87141
- { to: "string" }
87142
- );
87030
+ const encodedXml = pako.inflateRaw(Uint8Array.from(raw, (c) => c.charCodeAt(0)), { to: "string" });
87143
87031
  const xml = decodeURIComponent(encodedXml);
87144
87032
  xmlDoc = mxUtils.parseXml(xml);
87145
87033
  } else {
@@ -87383,7 +87271,7 @@ ${data2.flowchartText}
87383
87271
  const data2 = embedData;
87384
87272
  if (type === "html") {
87385
87273
  if (data2.src) {
87386
- return `<img data-embed-type="drawio" data-uuid="drawio:${data2.src}" src="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" />`;
87274
+ return `<img src="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" />`;
87387
87275
  }
87388
87276
  if (data2.xmlSvg) {
87389
87277
  return data2.xmlSvg;
@@ -87473,7 +87361,7 @@ ${data2.flowchartText}
87473
87361
  if (!plantumlImgFile) {
87474
87362
  return await Promise.resolve(url);
87475
87363
  }
87476
- const uploadResourceResult = await editor.doc.uploadResource(plantumlImgFile, { resourceType: "graph" });
87364
+ const uploadResourceResult = await editor.doc.uploadResource(plantumlImgFile);
87477
87365
  return uploadResourceResult.resourceId;
87478
87366
  } catch (error2) {
87479
87367
  return Promise.resolve(url);
@@ -87577,7 +87465,7 @@ ${data2.flowchartText}
87577
87465
  const data2 = embedData;
87578
87466
  if (type === "html") {
87579
87467
  if (data2.src) {
87580
- return `<img data-embed-type="plantuml" data-uuid="plantuml:${data2.src}" src="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" />`;
87468
+ return `<img src="${editor.doc.buildResourceUrl(data2.src, { withToken: true })}" />`;
87581
87469
  }
87582
87470
  if (data2.plantumlText) {
87583
87471
  return `<div>${data2.plantumlText}</div>`;
@@ -91008,8 +90896,7 @@ ${data2.plantumlText}
91008
90896
  const { resourceId } = await editor.doc.uploadResource(file2, {
91009
90897
  onProgress: (progress) => {
91010
90898
  this.renderProgress(progress, file2);
91011
- },
91012
- resourceType: "media"
90899
+ }
91013
90900
  });
91014
90901
  const { name, type, size } = file2;
91015
90902
  const newBlockData = {
@@ -91147,11 +91034,7 @@ ${data2.plantumlText}
91147
91034
  renderEmpty(blockData) {
91148
91035
  assert(logger$9, this.abstract, "no abstract");
91149
91036
  assert(logger$9, this.mediaContainer, "The media element not exist");
91150
- const empty = createElement(
91151
- "div",
91152
- ["media-empty", "embed-selected-content", "embed-hover-content"],
91153
- this.mediaContainer
91154
- );
91037
+ const empty = createElement("div", ["media-empty", "embed-selected-content", "embed-hover-content"], this.mediaContainer);
91155
91038
  empty.innerHTML = this.abstract.mediaIcon;
91156
91039
  this.updateMediaContent(empty);
91157
91040
  const { editor } = this.options;
@@ -91172,7 +91055,7 @@ ${data2.plantumlText}
91172
91055
  }
91173
91056
  await editor.doc.addResources([resourceId]);
91174
91057
  const serviceAppId = (_b = (_a = editor.doc).getServerMeta) == null ? void 0 : _b.call(_a).appId;
91175
- if (resourceUrl !== blockData.embedData.src && serviceAppId && blockData.embedData.src.includes(serviceAppId)) {
91058
+ if (resourceUrl !== blockData.embedData.src && (serviceAppId && blockData.embedData.src.includes(serviceAppId))) {
91176
91059
  const block = getParentBlock(content);
91177
91060
  if (block && !editor.readonly && editor.isBlockWritable(block)) {
91178
91061
  const newBlockData = cloneDeep__default.default(blockData);
@@ -91313,7 +91196,7 @@ ${data2.plantumlText}
91313
91196
  const mediaData = blockData.embedData;
91314
91197
  const url = editor.doc.buildResourceUrl(mediaData.src, { withToken: true });
91315
91198
  if (type === "html") {
91316
- return `<${this.embedType} data-embed-type="${this.embedType}" data-uuid="${this.embedType}:${mediaData.src}" src="${url}" />`;
91199
+ return `<${mediaData.type} src="${url}" />`;
91317
91200
  }
91318
91201
  if (type === "markdown") {
91319
91202
  return `![${mediaData.src}](${url})`;
@@ -94354,11 +94237,11 @@ ${JSON.stringify(error2, null, 2)}`);
94354
94237
  this.fixedToolbar = (_a = editor.findCustom("main-toolbar-fixed-toolbar")) == null ? void 0 : _a.toolbar;
94355
94238
  if (this.fixedToolbar) {
94356
94239
  const content = this.fixedToolbar.content;
94357
- const resizer = content.closest(".editor-main-toolbar-resizer");
94240
+ const toolbar2 = content.closest(".editor-command-bar-root");
94358
94241
  this.observer = new ResizeObserver(() => {
94359
94242
  this.updateItems();
94360
94243
  });
94361
- this.observer.observe(resizer);
94244
+ this.observer.observe(toolbar2);
94362
94245
  editor.addCustom("main-toolbar-more-item", () => this);
94363
94246
  }
94364
94247
  });
@@ -94385,7 +94268,7 @@ ${JSON.stringify(error2, null, 2)}`);
94385
94268
  return;
94386
94269
  }
94387
94270
  const content = toolbar2.content;
94388
- const toolbarRoot = content.closest(".editor-main-toolbar-resizer");
94271
+ const toolbarRoot = content.closest(".editor-command-bar-root");
94389
94272
  const toolbarRect = toolbarRoot.getBoundingClientRect();
94390
94273
  const toolbarRight = toolbarRect.right;
94391
94274
  items.forEach((item) => {
@@ -94455,67 +94338,8 @@ ${JSON.stringify(error2, null, 2)}`);
94455
94338
  toolbar2.updateItems(items);
94456
94339
  }
94457
94340
  }
94458
- class InsertFileItem {
94459
- constructor() {
94460
- __publicField(this, "id", "insert-file");
94461
- __publicField(this, "name", i18n$1.t("toolbar.file"));
94462
- __publicField(this, "icon", AttachmentIcon);
94463
- }
94464
- async onClick(editor, item) {
94465
- const block = editor.getBlockById(editor.selection.range.start.blockId);
94466
- const container = editor.getParentContainer(block);
94467
- const index2 = editor.getBlockIndex(block);
94468
- const file2 = await selectFile("*");
94469
- if (!file2) {
94470
- return;
94471
- }
94472
- const res = await editor.doc.uploadResource(file2);
94473
- if (!res.resourceId) {
94474
- return;
94475
- }
94476
- const data2 = {
94477
- src: res.resourceId,
94478
- fileName: file2.name,
94479
- fileSize: file2.size,
94480
- fileType: file2.type,
94481
- created: Date.now(),
94482
- creator: editor.doc.getUser().displayName,
94483
- previewType: FilePreviewType.Card
94484
- };
94485
- editor.insertEmbed(getContainerId(container), index2 + 1, "office", data2);
94486
- }
94487
- }
94488
- class InsertMentionItem {
94489
- constructor() {
94490
- __publicField(this, "id", "insert-mention");
94491
- __publicField(this, "name", i18n$1.t("toolbar.mention"));
94492
- __publicField(this, "icon", Mention2Icon);
94493
- }
94494
- onClick(editor, item) {
94495
- editor.clearSelectedContents();
94496
- const focus = editor.selection.range.focus;
94497
- if (!focus.isSimple()) {
94498
- return;
94499
- }
94500
- const block = editor.getBlockById(focus.blockId);
94501
- if (!isTextKindBlock(editor, block)) {
94502
- return;
94503
- }
94504
- editor.focus();
94505
- editor.insertTextToBlock(block, focus.offset, "@");
94506
- const mention = editor.findCustom("mention");
94507
- if (mention) {
94508
- const suggest = mention.suggest;
94509
- if (suggest) {
94510
- const container = getParentContainer(block);
94511
- suggest.handleAfterInsertText(editor, getContainerId(container), getBlockIndex(block), focus.offset, "@");
94512
- }
94513
- }
94514
- }
94515
- }
94516
94341
  function getToolbarDefaultItems(editor) {
94517
- const commentsEnabled = !!editor.options.enableComments;
94518
- const items = [
94342
+ return [
94519
94343
  new UndoItem(),
94520
94344
  new RedoItem(),
94521
94345
  new SeparatorItem(),
@@ -94540,15 +94364,14 @@ ${JSON.stringify(error2, null, 2)}`);
94540
94364
  new AlignCenterItem(),
94541
94365
  new AlignRightItem(),
94542
94366
  new SeparatorItem(),
94367
+ new InsertImageItem(),
94368
+ new SeparatorItem(),
94543
94369
  new InsertItem(editor),
94544
94370
  new SeparatorItem(),
94545
- new FindReplaceItem()
94371
+ new FindReplaceItem(),
94372
+ new CommentItem(),
94373
+ new MoreItem(editor)
94546
94374
  ];
94547
- if (commentsEnabled) {
94548
- items.push(new CommentItem());
94549
- }
94550
- items.push(new MoreItem(editor));
94551
- return items;
94552
94375
  }
94553
94376
  const zhCN = {
94554
94377
  toolbar: {
@@ -94561,10 +94384,7 @@ ${JSON.stringify(error2, null, 2)}`);
94561
94384
  quote: "\u5F15\u7528",
94562
94385
  checkList: "\u4EFB\u52A1\u5217\u8868",
94563
94386
  orderedList: "\u6709\u5E8F\u5217\u8868",
94564
- unorderedList: "\u65E0\u5E8F\u5217\u8868",
94565
- fullscreen: "\u5168\u5C4F",
94566
- file: "\u63D2\u5165\u6587\u4EF6",
94567
- mention: "\u63D0\u53CA\u7528\u6237"
94387
+ unorderedList: "\u65E0\u5E8F\u5217\u8868"
94568
94388
  }
94569
94389
  };
94570
94390
  const zhHK = {
@@ -94578,10 +94398,7 @@ ${JSON.stringify(error2, null, 2)}`);
94578
94398
  quote: "\u5F15\u7528",
94579
94399
  checkList: "\u4EFB\u52D9\u5217\u8868",
94580
94400
  orderedList: "\u6709\u5E8F\u5217\u8868",
94581
- unorderedList: "\u7121\u5E8F\u5217\u8868",
94582
- fullscreen: "\u5168\u5C4F",
94583
- file: "\u63D2\u5165\u6587\u4EF6",
94584
- mention: "\u63D0\u53CA\u7528\u6236"
94401
+ unorderedList: "\u7121\u5E8F\u5217\u8868"
94585
94402
  }
94586
94403
  };
94587
94404
  const enUS = {
@@ -94595,10 +94412,7 @@ ${JSON.stringify(error2, null, 2)}`);
94595
94412
  quote: "Quote",
94596
94413
  checkList: "Check List",
94597
94414
  orderedList: "Ordered List",
94598
- unorderedList: "Unordered List",
94599
- fullscreen: "Full Screen",
94600
- file: "File",
94601
- mention: "Mention user"
94415
+ unorderedList: "Unordered List"
94602
94416
  }
94603
94417
  };
94604
94418
  const jaJP = {
@@ -94612,10 +94426,7 @@ ${JSON.stringify(error2, null, 2)}`);
94612
94426
  quote: "\u5F15\u7528",
94613
94427
  checkList: "\u30C1\u30A7\u30C3\u30AF\u30EA\u30B9\u30C8",
94614
94428
  orderedList: "\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",
94615
- unorderedList: "\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",
94616
- fullscreen: "\u5168\u753B\u9762\u8868\u793A",
94617
- file: "\u30D5\u30A1\u30A4\u30EB\u3092\u633F\u5165",
94618
- mention: "\u30E6\u30FC\u30B6\u30FC\u3092\u30E1\u30F3\u30B7\u30E7\u30F3"
94429
+ unorderedList: "\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8"
94619
94430
  }
94620
94431
  };
94621
94432
  i18n$1.mergeLang({
@@ -94626,10 +94437,8 @@ ${JSON.stringify(error2, null, 2)}`);
94626
94437
  });
94627
94438
  const style = "";
94628
94439
  class MainToolbar {
94629
- constructor(editor, parent, options = {}) {
94440
+ constructor(editor, parent) {
94630
94441
  __publicField(this, "toolbar");
94631
- __publicField(this, "toolbarFullScreen");
94632
- __publicField(this, "root");
94633
94442
  __publicField(this, "handleClick", (bar2, item) => {
94634
94443
  const command = item;
94635
94444
  if (command.onClick) {
@@ -94666,13 +94475,7 @@ ${JSON.stringify(error2, null, 2)}`);
94666
94475
  this.updateState();
94667
94476
  });
94668
94477
  this.editor = editor;
94669
- this.options = options;
94670
- const root2 = createElement("div", ["editor-main-toolbar-root"], parent);
94671
- const container = createElement("div", ["editor-main-toolbar-resizer"], root2);
94672
- const resizer = createElement("div", ["editor-main-toolbar-container"], container);
94673
- const items = getToolbarDefaultItems(editor);
94674
- this.root = root2;
94675
- this.toolbar = new FixedToolbar(resizer, items, {
94478
+ this.toolbar = new FixedToolbar(parent, this.getItems(), {
94676
94479
  tooltipId: editor.clientId,
94677
94480
  id: "main-toolbar"
94678
94481
  });
@@ -94684,39 +94487,16 @@ ${JSON.stringify(error2, null, 2)}`);
94684
94487
  destroy: () => {
94685
94488
  }
94686
94489
  }));
94687
- if (options.enableFullScreen) {
94688
- const fullScreenItem = {
94689
- id: "main-toolbar-fullscreen",
94690
- icon: FullScreenIcon,
94691
- name: i18n$1.t("toolbar.fullscreen")
94692
- };
94693
- this.toolbarFullScreen = new FixedToolbar(root2, [fullScreenItem], {
94694
- tooltipId: editor.clientId,
94695
- id: "main-toolbar-fullscreen",
94696
- rootId: "main-toolbar-fullscreen"
94697
- });
94698
- this.toolbarFullScreen.addListener("click", (bar2, item) => {
94699
- var _a;
94700
- if (item.id === "main-toolbar-fullscreen") {
94701
- (_a = options.onFullScreenClick) == null ? void 0 : _a.call(options, this.editor, item);
94702
- this.handleSelectionChanged();
94703
- }
94704
- });
94705
- }
94706
94490
  }
94707
94491
  destroy() {
94708
- var _a;
94709
94492
  this.toolbar.destroy();
94710
- this.editor.removeListener("selectionChanged", this.handleSelectionChanged);
94711
- (_a = this.toolbarFullScreen) == null ? void 0 : _a.destroy();
94712
- this.root.remove();
94713
94493
  }
94714
94494
  setItems(items) {
94715
94495
  this.toolbar.updateItems(items);
94716
94496
  this.updateState();
94717
94497
  }
94718
94498
  getItems() {
94719
- return this.toolbar.items;
94499
+ return getToolbarDefaultItems(this.editor);
94720
94500
  }
94721
94501
  updateState() {
94722
94502
  const items = this.toolbar.items;
@@ -94754,311 +94534,9 @@ ${JSON.stringify(error2, null, 2)}`);
94754
94534
  }
94755
94535
  });
94756
94536
  }
94757
- const CkeImageConverter = {
94758
- filter: (node) => {
94759
- if (node.nodeName !== "IMG") {
94760
- return false;
94761
- }
94762
- const elem = node;
94763
- const refId = elem.getAttribute("data-ref-id");
94764
- const refType = elem.getAttribute("data-ref-type");
94765
- const uuid = elem.getAttribute("data-uuid");
94766
- return Boolean(refType === "task" && refId && uuid);
94767
- },
94768
- replacement: (content, node) => {
94769
- const refType = node.getAttribute("data-ref-type");
94770
- const refId = node.getAttribute("data-ref-id");
94771
- const uuid = node.getAttribute("data-uuid");
94772
- const src = `ones-file:${refType}/${refId}/${uuid}`;
94773
- return `![${refType}](${src})`;
94774
- }
94775
- };
94776
- const ckeHtmlConverters = /* @__PURE__ */ new Map();
94777
- function registerCKEHtmlConvert(name, converter) {
94778
- if (ckeHtmlConverters.has(name)) {
94779
- return;
94780
- }
94781
- ckeHtmlConverters.set(name, converter);
94782
- turndownService.use((ts) => {
94783
- ts.addRule(name, converter);
94784
- });
94785
- }
94786
- function getTurndownRootElement(node) {
94787
- let parent = node;
94788
- while (parent) {
94789
- if (parent instanceof HTMLElement && parent.tagName === "BODY") {
94790
- return parent;
94791
- }
94792
- if (!parent.parentNode) {
94793
- return parent;
94794
- }
94795
- parent = parent.parentNode;
94796
- }
94797
- return node;
94798
- }
94799
- function patchForEmptyBlock(key, node, className) {
94800
- const root2 = getTurndownRootElement(node);
94801
- if (root2 && root2 instanceof HTMLElement) {
94802
- const attributeKey = `data-${key}-processed`;
94803
- if (!root2.getAttribute(attributeKey)) {
94804
- root2.setAttribute(attributeKey, "true");
94805
- const elements = root2.querySelectorAll(className);
94806
- elements.forEach((elem) => {
94807
- var _a;
94808
- const text2 = (_a = elem.textContent) == null ? void 0 : _a.trim();
94809
- if (!text2) {
94810
- elem.innerText = "--temp-data--";
94811
- }
94812
- });
94813
- }
94814
- }
94815
- }
94816
- const CkeCommentConverter = {
94817
- filter: (node) => {
94818
- if (node.nodeName === "SPAN") {
94819
- const span = node;
94820
- const ref = span.getAttribute("data-annotate-ref");
94821
- return Boolean(ref);
94822
- }
94823
- return false;
94824
- },
94825
- replacement: (content, node) => {
94826
- var _a;
94827
- const span = node;
94828
- const ref = span.getAttribute("data-annotate-ref");
94829
- const text2 = (_a = span.textContent) != null ? _a : "";
94830
- return `[${text2}](comment://${ref})`;
94831
- }
94832
- };
94833
- function processCkeCommentsLink(doc2) {
94834
- const containers = doc2.blocks;
94835
- Object.values(containers).forEach((blocks) => {
94836
- blocks.forEach((block) => {
94837
- const text2 = block.text;
94838
- if (text2) {
94839
- text2.forEach((op) => {
94840
- if (op.attributes) {
94841
- const attributes = op.attributes;
94842
- const link2 = attributes.link;
94843
- if (link2 == null ? void 0 : link2.startsWith("comment://")) {
94844
- delete attributes.link;
94845
- const commentId = link2.replace("comment://", "");
94846
- const key = `comment-${commentId.toLocaleLowerCase()}`;
94847
- attributes[key] = commentId;
94848
- }
94849
- }
94850
- });
94851
- }
94852
- });
94853
- });
94854
- }
94855
- const CkeMentionConverter = {
94856
- filter: (node) => {
94857
- patchForEmptyBlock("mention", node, ".ones-at-user-block");
94858
- if (node.nodeName === "SPAN") {
94859
- const span = node;
94860
- if (hasClass(span, "ones-at-user-block")) {
94861
- const name = span.getAttribute("data-default-name");
94862
- const refId = span.getAttribute("data-ref-id");
94863
- return Boolean(name) && Boolean(refId);
94864
- }
94865
- }
94866
- return false;
94867
- },
94868
- replacement: (content, node) => {
94869
- const span = node;
94870
- const name = span.getAttribute("data-default-name") || "";
94871
- const refId = span.getAttribute("data-ref-id") || "";
94872
- if (name && refId) {
94873
- const box = {
94874
- id: genId(),
94875
- type: "mention",
94876
- box: true,
94877
- created: Date.now(),
94878
- iconUrl: "",
94879
- text: name,
94880
- mentionId: refId
94881
- };
94882
- const text2 = [
94883
- {
94884
- insert: " ",
94885
- attributes: box
94886
- }
94887
- ];
94888
- const obj = {
94889
- text: text2
94890
- };
94891
- const base64 = toBase64URL(JSON.stringify(obj));
94892
- return `[[${base64}]]`;
94893
- }
94894
- return name;
94895
- }
94896
- };
94897
- function convertMentionToCkeMention(editor, boxData, doc2, type) {
94898
- const data2 = boxData;
94899
- if (type === "html") {
94900
- return `<ones-at-user data-ref-name="${data2.text}" data-ref-id="${data2.mentionId}" data-default-name="${data2.text}" class="ones-at-user-block" data-viewer="1"><span>@${data2.text}</span></ones-at-user>`;
94901
- }
94902
- return `@${data2.text}`;
94903
- }
94904
- function patchMentionConverter(editor) {
94905
- const mentionBox = editor.editorBoxes.getBoxClass("mention");
94906
- if (mentionBox) {
94907
- const oldConvertTo = mentionBox.convertTo;
94908
- if (oldConvertTo !== convertMentionToCkeMention) {
94909
- mentionBox.convertTo = convertMentionToCkeMention;
94910
- }
94911
- }
94912
- }
94913
- function processLinks(doc2) {
94914
- const containers = doc2.blocks;
94915
- Object.values(containers).forEach((blocks) => {
94916
- blocks.forEach((block) => {
94917
- if (block.text) {
94918
- const text2 = block.text;
94919
- text2.forEach((op) => {
94920
- const attributes = op.attributes;
94921
- if (attributes) {
94922
- attributes.link;
94923
- }
94924
- });
94925
- }
94926
- });
94927
- });
94928
- }
94929
- const CkeMarkdownConverter = {
94930
- filter: (node) => {
94931
- if (node.nodeName !== "DIV") {
94932
- return false;
94933
- }
94934
- const div = node;
94935
- return hasClass(div, "ones-marked-card");
94936
- },
94937
- replacement: (content, node) => {
94938
- const textToCodeBlock2 = (text2, language) => {
94939
- const codeBlocks = text2.split("\n").map((line) => {
94940
- const block = {
94941
- type: "text",
94942
- id: genId(),
94943
- text: createRichText(line)
94944
- };
94945
- return block;
94946
- });
94947
- const containerId = genId();
94948
- const doc22 = {
94949
- blocks: {
94950
- root: [
94951
- {
94952
- id: genId(),
94953
- type: "code",
94954
- language,
94955
- children: [containerId]
94956
- }
94957
- ],
94958
- [containerId]: codeBlocks
94959
- },
94960
- meta: {},
94961
- comments: {}
94962
- };
94963
- return toBase64URL(JSON.stringify(doc22));
94964
- };
94965
- const nodeToCodeBlock2 = (node2, lang) => {
94966
- const text2 = node2.textContent || "";
94967
- return textToCodeBlock2(text2, lang);
94968
- };
94969
- const doc2 = nodeToCodeBlock2(node, "markdown");
94970
- const fence = "```";
94971
- return "\n\n" + fence + "\n" + doc2 + "\n" + fence + "\n\n";
94972
- }
94973
- };
94974
- registerCKEHtmlConvert("image", CkeImageConverter);
94975
- registerCKEHtmlConvert("comment", CkeCommentConverter);
94976
- registerCKEHtmlConvert("mention", CkeMentionConverter);
94977
- registerCKEHtmlConvert("markdown", CkeMarkdownConverter);
94978
- function ckeHtml2Doc(html) {
94979
- const doc2 = htmlToDoc(html) || createEmptyDoc$1();
94980
- processCkeCommentsLink(doc2);
94981
- processLinks(doc2);
94982
- return doc2;
94983
- }
94984
- function injectDocToCkeHtmlFragment(htmlFragment, doc2, text2) {
94985
- const meta = `<meta charset="utf-8"><ones-editor-doc data-source="ones-editor-doc::${toBase64URL(
94986
- JSON.stringify(doc2)
94987
- )}::ones-editor-doc" />`;
94988
- let textMeta = "";
94989
- if (text2) {
94990
- textMeta = `<meta name="ones-editor-text" content="${toBase64URL(text2)}" />`;
94991
- }
94992
- const html = `<!doctype html><html><head>${meta}${textMeta}</head><body>${htmlFragment}</body></html>`;
94993
- return html;
94994
- }
94995
- function editorToCKEHtml(editor) {
94996
- patchMentionConverter(editor);
94997
- const docObject = editor.doc.toJSON();
94998
- if (isEmptyDoc(docObject)) {
94999
- return "";
95000
- }
95001
- let html = docToHtmlFragment(editor, docObject);
95002
- const text2 = docToText(editor, docObject);
95003
- html = injectDocToCkeHtmlFragment(html, docObject, text2);
95004
- return html;
95005
- }
95006
- function combineDoc(doc1, doc2) {
95007
- if (isEmptyDoc(doc1)) {
95008
- return doc2;
95009
- }
95010
- if (isEmptyDoc(doc2)) {
95011
- return doc1;
95012
- }
95013
- const splitterDoc = createEmptyDoc$1("", {
95014
- firstLineAsTitle: false
95015
- });
95016
- return mergeDocs([doc1, splitterDoc, doc2]);
95017
- }
95018
- function mergeHTMLBodiesOnly(htmlA, htmlB) {
95019
- const parser = new DOMParser();
95020
- const docA = parser.parseFromString(htmlA, "text/html");
95021
- const docB = parser.parseFromString(htmlB, "text/html");
95022
- const mergedDoc = document.implementation.createHTMLDocument("Merged");
95023
- const bodyA = docA.body;
95024
- const bodyB = docB.body;
95025
- const mergedBody = mergedDoc.body;
95026
- Array.from(bodyA.childNodes).forEach((node) => {
95027
- mergedBody.appendChild(mergedDoc.importNode(node, true));
95028
- });
95029
- Array.from(bodyB.childNodes).forEach((node) => {
95030
- mergedBody.appendChild(mergedDoc.importNode(node, true));
95031
- });
95032
- return mergedBody.innerHTML;
95033
- }
95034
- function combineCkeHtml(html1, html2) {
95035
- const doc1 = ckeHtml2Doc(html1);
95036
- const doc2 = ckeHtml2Doc(html2);
95037
- const newDoc = combineDoc(doc1, doc2);
95038
- const newHtml = mergeHTMLBodiesOnly(html1, html2);
95039
- const ret = injectDocToCkeHtmlFragment(newHtml, newDoc);
95040
- return ret;
95041
- }
95042
- function combineRichTextValue(value1, value2) {
95043
- return combineCkeHtml(value1, value2);
95044
- }
95045
94537
  const logger = getLogger("create-editor");
95046
- function getHooks(options, local) {
95047
- var _a;
95048
- const hooks = [];
95049
- if (!options.disableLock) {
95050
- hooks.push(new BlockLockerHook());
95051
- }
95052
- if (!local) {
95053
- hooks.push(new BlockExclusiveHook());
95054
- }
95055
- if ((_a = options.components) == null ? void 0 : _a.blockHooks) {
95056
- hooks.push(...options.components.blockHooks);
95057
- }
95058
- return hooks;
95059
- }
95060
94538
  function getDefaultOnesEditorOptions(options) {
95061
- var _a, _b, _c, _d, _e, _f, _g, _h;
94539
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
95062
94540
  const enableComments = options == null ? void 0 : options.enableComments;
95063
94541
  const quickMenu = (_b = (_a = options.componentsOptions) == null ? void 0 : _a.quickMenu) != null ? _b : { id: "quick-menu", trigger: ["/"], commandProviders: [] };
95064
94542
  (_c = quickMenu.commandProviders) == null ? void 0 : _c.push(new GraphCommandProvider());
@@ -95075,11 +94553,11 @@ ${JSON.stringify(error2, null, 2)}`);
95075
94553
  commandProviders: [new TableBlockCommandProvider(), ...((_g = options.components) == null ? void 0 : _g.commandProviders) || []],
95076
94554
  decorators: [new CodeTextDecorator(), new RemoteCaretsDecorator()],
95077
94555
  insertions: [RemoteCaretsInsertion],
95078
- blockHooks: getHooks(options, false),
94556
+ blockHooks: [new BlockLockerHook(), new BlockExclusiveHook(), ...((_h = options.components) == null ? void 0 : _h.blockHooks) || []],
95079
94557
  textRenders: [
95080
94558
  enableComments && new OnesEditorCommentsRender(),
95081
94559
  new BlockPaddingRender(),
95082
- ...((_h = options.components) == null ? void 0 : _h.textRenders) || []
94560
+ ...((_i = options.components) == null ? void 0 : _i.textRenders) || []
95083
94561
  ].filter(Boolean),
95084
94562
  options: { ...options.componentsOptions, quickMenu }
95085
94563
  },
@@ -95098,7 +94576,15 @@ ${JSON.stringify(error2, null, 2)}`);
95098
94576
  TextColorShortcuts,
95099
94577
  ...options.shortcuts || []
95100
94578
  ],
95101
- colors: ["#B21B57", "#008796", "#7241CC", "#CC4C08", "#5D8F00", "#BD2C1C", "#D17D00"]
94579
+ colors: [
94580
+ "#B21B57",
94581
+ "#008796",
94582
+ "#7241CC",
94583
+ "#CC4C08",
94584
+ "#5D8F00",
94585
+ "#BD2C1C",
94586
+ "#D17D00"
94587
+ ]
95102
94588
  };
95103
94589
  return ret;
95104
94590
  }
@@ -95196,14 +94682,11 @@ ${JSON.stringify(error2, null, 2)}`);
95196
94682
  editor.input.addHandler(new ListPasteHandler());
95197
94683
  editor.doc.registerCallback(new HeadingBlockDocEvents(editor));
95198
94684
  editor.addCustom("remote-cursor", () => new RemoteCarets(editor));
95199
- editor.addCustom(
95200
- "editor-image-preview",
95201
- () => new ImagePreviewHandler(editor, (editor2, img) => {
95202
- var _a2, _b2;
95203
- (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
95204
- })
95205
- );
95206
- if (options.blockMenuButton !== false && !clientType.isMobile) {
94685
+ editor.addCustom("editor-image-preview", () => new ImagePreviewHandler(editor, (editor2, img) => {
94686
+ var _a2, _b2;
94687
+ (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
94688
+ }));
94689
+ if (options.blockMenuButton !== false) {
95207
94690
  editor.addCustom("block-menu", (editor2) => new OnesEditorBlockMenuButtons(editor2));
95208
94691
  }
95209
94692
  if (!clientType.isMobile) {
@@ -95211,6 +94694,7 @@ ${JSON.stringify(error2, null, 2)}`);
95211
94694
  var _a2;
95212
94695
  return new OnesEditorQuickMenu(editor, (_a2 = options.componentsOptions) == null ? void 0 : _a2.quickMenu);
95213
94696
  });
94697
+ editor.addCustom("block-menu", (editor2) => new OnesEditorBlockMenuButtons(editor2));
95214
94698
  editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
95215
94699
  (_c = editor.findCustom("editor-quick-menu")) == null ? void 0 : _c.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
95216
94700
  (_d = editor.findCustom("editor-block-menu")) == null ? void 0 : _d.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
@@ -95251,9 +94735,7 @@ ${JSON.stringify(error2, null, 2)}`);
95251
94735
  OnesEditorTocProvider.register(editor);
95252
94736
  OnesEditorExclusiveBlock.register(editor);
95253
94737
  if (!clientType.isMobile) {
95254
- editor.editorCommandProviders.registerCommandProvider(
95255
- new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true })
95256
- );
94738
+ editor.editorCommandProviders.registerCommandProvider(new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true }));
95257
94739
  editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
95258
94740
  } else {
95259
94741
  editor.addCustom("mobile-helper", () => new OnesEditorMobileHelper(editor));
@@ -95300,14 +94782,14 @@ ${JSON.stringify(error2, null, 2)}`);
95300
94782
  }
95301
94783
  }
95302
94784
  });
95303
- editor.version = "2.9.8-beta.8";
94785
+ editor.version = "2.9.8";
95304
94786
  return editor;
95305
94787
  }
95306
94788
  function isDoc(doc2) {
95307
94789
  return doc2.toJSON !== void 0;
95308
94790
  }
95309
94791
  async function createLocalEditor(root2, docData, options) {
95310
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
94792
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
95311
94793
  assert(logger, root2, "app does not exists");
95312
94794
  const doc2 = isDoc(docData) ? docData : new LocalDoc(docData, {
95313
94795
  serverUrl: options.serverUrl || ""
@@ -95323,7 +94805,6 @@ ${JSON.stringify(error2, null, 2)}`);
95323
94805
  id: options.id,
95324
94806
  scrollContainer: options == null ? void 0 : options.scrollContainer,
95325
94807
  enableResolveComments: options == null ? void 0 : options.enableResolveComments,
95326
- enableComments,
95327
94808
  components: {
95328
94809
  blocks: [...StandardBlocks, ...(_f = (_e = options.components) == null ? void 0 : _e.blocks) != null ? _f : []],
95329
94810
  commandProviders: [new TableBlockCommandProvider()],
@@ -95331,7 +94812,7 @@ ${JSON.stringify(error2, null, 2)}`);
95331
94812
  embeds: [...StandardEmbeds, ...((_g = options.components) == null ? void 0 : _g.embeds) || []],
95332
94813
  boxes: [MathjaxBox, MentionBox, FileBox, StatusBox, ...((_h = options.components) == null ? void 0 : _h.boxes) || []],
95333
94814
  insertions: [RemoteCaretsInsertion],
95334
- blockHooks: [...((_i = options.components) == null ? void 0 : _i.blockHooks) || []],
94815
+ blockHooks: [new BlockLockerHook(), ...((_i = options.components) == null ? void 0 : _i.blockHooks) || []],
95335
94816
  textRenders: [
95336
94817
  enableComments && new OnesEditorCommentsRender(),
95337
94818
  new BlockPaddingRender(),
@@ -95364,14 +94845,11 @@ ${JSON.stringify(error2, null, 2)}`);
95364
94845
  editor.input.addHandler(new OnesEditorPasteHandler(editor));
95365
94846
  editor.input.addHandler(new BlockLockerPasteHandler());
95366
94847
  editor.input.addHandler(new ListPasteHandler());
95367
- editor.addCustom(
95368
- "editor-image-preview",
95369
- () => new ImagePreviewHandler(editor, (editor2, img) => {
95370
- var _a2, _b2;
95371
- (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
95372
- })
95373
- );
95374
- if (options.blockMenuButton !== false && !clientType.isMobile) {
94848
+ editor.addCustom("editor-image-preview", () => new ImagePreviewHandler(editor, (editor2, img) => {
94849
+ var _a2, _b2;
94850
+ (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
94851
+ }));
94852
+ if (options.blockMenuButton !== false) {
95375
94853
  editor.addCustom("block-menu", (editor2) => new OnesEditorBlockMenuButtons(editor2));
95376
94854
  }
95377
94855
  if (!clientType.isMobile) {
@@ -95379,9 +94857,8 @@ ${JSON.stringify(error2, null, 2)}`);
95379
94857
  var _a2;
95380
94858
  return new OnesEditorQuickMenu(editor, (_a2 = options.componentsOptions) == null ? void 0 : _a2.quickMenu);
95381
94859
  });
95382
- editor.editorCommandProviders.registerCommandProvider(
95383
- new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true })
95384
- );
94860
+ editor.addCustom("block-menu", (editor2) => new OnesEditorBlockMenuButtons(editor2));
94861
+ editor.editorCommandProviders.registerCommandProvider(new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true }));
95385
94862
  editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
95386
94863
  (_k = editor.findCustom("editor-quick-menu")) == null ? void 0 : _k.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
95387
94864
  (_l = editor.findCustom("editor-block-menu")) == null ? void 0 : _l.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
@@ -95399,16 +94876,6 @@ ${JSON.stringify(error2, null, 2)}`);
95399
94876
  if (options.enableContextMenu !== false) {
95400
94877
  editor.addCustom("editor-context-menu", (editor2) => new OnesEditorContextMenu(editor2));
95401
94878
  }
95402
- editor.addCustom("create-options", () => new OnesEditorCustomDataWrapper(editor, options));
95403
- editor.addCustom("drop-target", () => new OnesEditorDropTarget(editor));
95404
- editor.addCustom("list-to-mindmap", () => new OnesEditorListMindmap(editor));
95405
- editor.addCustom("list-to-mention", () => new OnesEditorBlockMention(editor));
95406
- editor.addCustom("code-caret", () => new OnesEditorCodeCaret(editor));
95407
- editor.addCustom("layout-paste-handler", () => new LayoutBlockCaptionInputHandler(editor, true));
95408
- if ((_m = options.componentsOptions) == null ? void 0 : _m.mention) {
95409
- const mentionOptions = options.componentsOptions.mention;
95410
- editor.addCustom("mention", () => new OnesEditorMention(editor, mentionOptions));
95411
- }
95412
94879
  if (options.headingButton !== false) {
95413
94880
  editor.addCustom("heading-collapse", () => new HeadingBlockCollapseButton(editor));
95414
94881
  }
@@ -95429,10 +94896,7 @@ ${JSON.stringify(error2, null, 2)}`);
95429
94896
  }
95430
94897
  });
95431
94898
  OnesEditorToolbar.register(editor);
95432
- OnesEditorDropTarget.register(editor);
95433
- OnesEditorTocProvider.register(editor);
95434
- OnesEditorExclusiveBlock.register(editor);
95435
- editor.version = "2.9.8-beta.8";
94899
+ editor.version = "2.9.8";
95436
94900
  return editor;
95437
94901
  }
95438
94902
  async function showDocVersions(editor, options, serverUrl) {
@@ -141225,7 +140689,6 @@ ${JSON.stringify(error2, null, 2)}`);
141225
140689
  exports2.ArrowLeftIcon = arrowLeft;
141226
140690
  exports2.ArrowRightIcon = ArrowRightIcon;
141227
140691
  exports2.ArrowUpIcon = arrowUp;
141228
- exports2.AttachmentIcon = AttachmentIcon;
141229
140692
  exports2.AudioIcon = AudioIcon;
141230
140693
  exports2.AuthError = AuthError;
141231
140694
  exports2.AuthHeader = AuthHeader;
@@ -141359,11 +140822,9 @@ ${JSON.stringify(error2, null, 2)}`);
141359
140822
  exports2.InputtingInsertion = InputtingInsertion;
141360
140823
  exports2.InsertAfterIcon = InsertAfterIcon;
141361
140824
  exports2.InsertBeforeIcon = InsertBeforeIcon;
141362
- exports2.InsertFileItem = InsertFileItem;
141363
140825
  exports2.InsertImageItem = InsertImageItem;
141364
140826
  exports2.InsertItem = InsertItem;
141365
140827
  exports2.InsertLinkItem = InsertLinkItem;
141366
- exports2.InsertMentionItem = InsertMentionItem;
141367
140828
  exports2.InsertMenuProvider = InsertMenuProvider;
141368
140829
  exports2.ItalicIcon = ItalicIcon;
141369
140830
  exports2.LaunchIcon = LaunchIcon;
@@ -141394,7 +140855,6 @@ ${JSON.stringify(error2, null, 2)}`);
141394
140855
  exports2.MathIcon = mathIcon;
141395
140856
  exports2.MathMenuIcon = MathMenuIcon;
141396
140857
  exports2.MaxUserError = MaxUserError;
141397
- exports2.Mention2Icon = Mention2Icon;
141398
140858
  exports2.MentionIcon = MentionIcon;
141399
140859
  exports2.MergeCellIcon = MergeCellIcon;
141400
140860
  exports2.Mindmap = Mindmap;
@@ -141534,15 +140994,12 @@ ${JSON.stringify(error2, null, 2)}`);
141534
140994
  exports2.blockToText = blockToText;
141535
140995
  exports2.blocksToDoc = blocksToDoc;
141536
140996
  exports2.changeButtonName = changeButtonName;
141537
- exports2.ckeHtml2Doc = ckeHtml2Doc;
141538
140997
  exports2.clearAllSelection = clearAllSelection;
141539
140998
  exports2.clientType = clientType;
141540
140999
  exports2.cloneBlock = cloneBlock;
141541
141000
  exports2.cloneChildContainer = cloneChildContainer;
141542
141001
  exports2.cloneDoc = cloneDoc;
141543
141002
  exports2.cloneText = cloneText;
141544
- exports2.combineCkeHtml = combineCkeHtml;
141545
- exports2.combineRichTextValue = combineRichTextValue;
141546
141003
  exports2.commentToShareDbComment = commentToShareDbComment;
141547
141004
  exports2.compareElement = compareElement;
141548
141005
  exports2.comparePosition = comparePosition;
@@ -141698,7 +141155,6 @@ ${JSON.stringify(error2, null, 2)}`);
141698
141155
  exports2.editorSelectWordLeft = editorSelectWordLeft;
141699
141156
  exports2.editorSetTextColor = editorSetTextColor;
141700
141157
  exports2.editorShowFindDialog = editorShowFindDialog;
141701
- exports2.editorToCKEHtml = editorToCKEHtml;
141702
141158
  exports2.editorToDocx = editorToDocx;
141703
141159
  exports2.editorUpdateBlockData = editorUpdateBlockData;
141704
141160
  exports2.editorUpdateCompositionText = editorUpdateCompositionText;
@@ -141865,7 +141321,6 @@ ${JSON.stringify(error2, null, 2)}`);
141865
141321
  exports2.i18n = i18n$1;
141866
141322
  exports2.includeBigTable = includeBigTable;
141867
141323
  exports2.injectBlockOptions = injectBlockOptions;
141868
- exports2.injectDocToCkeHtmlFragment = injectDocToCkeHtmlFragment;
141869
141324
  exports2.injectDocToHtmlFragment = injectDocToHtmlFragment;
141870
141325
  exports2.injectSource = injectSource;
141871
141326
  exports2.injectStyle = injectStyle;