@ones-editor/editor 2.9.8-beta.9 → 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 -13
  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 +164 -711
  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: this.options.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: this.options.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: this.options.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,
@@ -54594,7 +54496,6 @@ ${codeText}
54594
54496
  }, 50));
54595
54497
  this.editor = editor;
54596
54498
  const popover = editor.options.componentsOptions.popover;
54597
- const objectToolbar = editor.options.componentsOptions.objectToolbar;
54598
54499
  this.toolbar = new ManualToolbar([], void 0, {
54599
54500
  tooltipId: editor.clientId,
54600
54501
  id: "editor-toolbar",
@@ -54602,8 +54503,7 @@ ${codeText}
54602
54503
  refuseOverflow: true,
54603
54504
  padding: 20,
54604
54505
  showName: clientType.isMobile,
54605
- autoClose: clientType.isMobile ? true : void 0,
54606
- appendTo: (objectToolbar == null ? void 0 : objectToolbar.appendTo) || (popover == null ? void 0 : popover.appendTo)
54506
+ autoClose: clientType.isMobile ? true : void 0
54607
54507
  });
54608
54508
  this.toolbar.on("click", this.handleButtonClick);
54609
54509
  this.toolbar.on("close", this.handleClose);
@@ -54975,7 +54875,7 @@ ${codeText}
54975
54875
  const svg = await mathjax2Svg(editor, tex);
54976
54876
  const data2 = svg;
54977
54877
  const file2 = new File([data2], "math.svg");
54978
- const path = await editor.doc.uploadResource(file2, { resourceType: "graph" });
54878
+ const path = await editor.doc.uploadResource(file2);
54979
54879
  return path.resourceId;
54980
54880
  }
54981
54881
  async function convertAndUploadMathjaxForEmbed(editor, tex) {
@@ -54983,7 +54883,7 @@ ${codeText}
54983
54883
  const perfectState = analyzeMathjaxSvgWidth(svg);
54984
54884
  const data2 = svg;
54985
54885
  const file2 = new File([data2], "math.svg");
54986
- const path = await editor.doc.uploadResource(file2, { resourceType: "graph" });
54886
+ const path = await editor.doc.uploadResource(file2);
54987
54887
  return {
54988
54888
  resourceId: path.resourceId,
54989
54889
  ...perfectState
@@ -55256,7 +55156,7 @@ ${codeText}
55256
55156
  return ` $${math.tex}$ `;
55257
55157
  }
55258
55158
  if (math.src) {
55259
- 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 })}" />`;
55260
55160
  }
55261
55161
  return `<code>$${math.tex}$</code>`;
55262
55162
  }
@@ -55437,7 +55337,7 @@ ${codeText}
55437
55337
  function convertTo$g(editor, blockData, doc2, type) {
55438
55338
  const mathData = blockData.embedData;
55439
55339
  if (type === "html") {
55440
- 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 })}" />`;
55441
55341
  }
55442
55342
  if (type === "markdown") {
55443
55343
  return `
@@ -64210,17 +64110,6 @@ $$${mathData.mathjaxText}$$
64210
64110
  const failedLoad = !!block.querySelector(".images > .image-container.error, .images > .image-container.empty ");
64211
64111
  const width = calImageBlockStyleWidth(editor, blockData, parentContainer, failedLoad);
64212
64112
  const height = calBlockHeight(editor, blockData, parentContainer, failedLoad);
64213
- if (width.startsWith("0") && height.startsWith("0")) {
64214
- const image = block.querySelector("img");
64215
- if (image) {
64216
- image.onload = () => {
64217
- setTimeout(() => {
64218
- updateImageBlockSize(editor, blockData, blockElement, parentContainerElement);
64219
- }, 300);
64220
- };
64221
- }
64222
- return;
64223
- }
64224
64113
  const content = getBlockContent(block);
64225
64114
  if (width === "auto") {
64226
64115
  content.style.width = width;
@@ -64998,8 +64887,7 @@ $$${mathData.mathjaxText}$$
64998
64887
  const res = await this.editor.doc.uploadResource(file2, {
64999
64888
  onProgress: (progress) => {
65000
64889
  setImageUploading(imageContainer, progress);
65001
- },
65002
- resourceType: "image"
64890
+ }
65003
64891
  });
65004
64892
  removeClass(imageContainer, "uploading");
65005
64893
  this.images[index2].src = res.resourceId;
@@ -68976,7 +68864,7 @@ ${codeText}
68976
68864
  }
68977
68865
  const fileName = `image.${ext}`;
68978
68866
  const file2 = new File([blob], fileName, { type: mimeString });
68979
- const ret = await editor.doc.uploadResource(file2, { resourceType: "paste" });
68867
+ const ret = await editor.doc.uploadResource(file2);
68980
68868
  return ret.resourceId;
68981
68869
  }
68982
68870
  return src;
@@ -69188,7 +69076,7 @@ ${codeText}
69188
69076
  const data2 = blockData.embedData;
69189
69077
  const images = getImages$1(data2);
69190
69078
  if (type === "html") {
69191
- 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("");
69192
69080
  }
69193
69081
  if (type === "markdown") {
69194
69082
  const markdown = images.map((image) => `![img](${editor.doc.buildResourceUrl(image.src, { withToken: true })})`).join("\n");
@@ -74551,6 +74439,20 @@ ${codeText}
74551
74439
  const maxCellTextLength = maxCellTextLengths.get(cell.col) || 0;
74552
74440
  return padText(text2, maxCellTextLength);
74553
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
+ }
74554
74456
  const lines = [];
74555
74457
  let headerText = "|";
74556
74458
  let headerSeparator = "|";
@@ -80434,7 +80336,7 @@ ${docStr}
80434
80336
  const data2 = boxData;
80435
80337
  if (type === "html") {
80436
80338
  if (data2.src) {
80437
- 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>`;
80438
80340
  }
80439
80341
  return `[${data2.fileName}]`;
80440
80342
  }
@@ -80549,10 +80451,14 @@ ${docStr}
80549
80451
  }
80550
80452
  nameElement.title = fileName;
80551
80453
  const infos = createElement("div", ["file-info"], detail);
80552
- const timeText = i18n$1.t("file.uploadedTime", { time: formatDate(new Date(created), "YYYY-MM-DD hh:mm") });
80553
- const sizeText = formatBytes(fileSize);
80554
- const infoText = `${creator} ${timeText} ${sizeText}`;
80555
- 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));
80556
80462
  const actions2 = createElement("div", ["file-actions"], card);
80557
80463
  const options = editor.getComponentOptions("file");
80558
80464
  let copilotButton;
@@ -80732,7 +80638,7 @@ ${docStr}
80732
80638
  const data2 = embedData;
80733
80639
  if (type === "html") {
80734
80640
  if (data2.src) {
80735
- 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>`;
80736
80642
  }
80737
80643
  return `<p>[${data2.fileName}]</p>`;
80738
80644
  }
@@ -86087,7 +85993,7 @@ ${docStr}
86087
85993
  const file2 = new File([buffer], `${genId()}.svg`, {
86088
85994
  type: "image/svg+xml"
86089
85995
  });
86090
- const ret = await editor.doc.uploadResource(file2, { resourceType: "graph" });
85996
+ const ret = await editor.doc.uploadResource(file2);
86091
85997
  return ret.resourceId;
86092
85998
  }
86093
85999
  const _MermaidInstance = class extends GraphBase {
@@ -86256,7 +86162,7 @@ ${docStr}
86256
86162
  const data2 = embedData;
86257
86163
  if (type === "html") {
86258
86164
  if (data2.src) {
86259
- 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 })}" />`;
86260
86166
  }
86261
86167
  if (data2.mermaidText) {
86262
86168
  return `<div class="mermaid">${data2.mermaidText}</div>`;
@@ -86325,7 +86231,7 @@ ${data2.mermaidText}
86325
86231
  const file2 = new File([buffer], `${genId()}.svg`, {
86326
86232
  type: "image/svg+xml"
86327
86233
  });
86328
- const resource = await editor.doc.uploadResource(file2, { resourceType: "graph" });
86234
+ const resource = await editor.doc.uploadResource(file2);
86329
86235
  return resource.resourceId;
86330
86236
  }
86331
86237
  const _FlowChartInstance = class extends GraphBase {
@@ -86422,7 +86328,7 @@ ${data2.mermaidText}
86422
86328
  const data2 = embedData;
86423
86329
  if (type === "html") {
86424
86330
  if (data2.src) {
86425
- 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 })}" />`;
86426
86332
  }
86427
86333
  if (data2.flowchartText) {
86428
86334
  return `<div>${data2.flowchartText}</div>`;
@@ -86780,7 +86686,7 @@ ${data2.flowchartText}
86780
86686
  });
86781
86687
  const targetBlock = editor.findBlockById(getBlockId(block));
86782
86688
  if (targetBlock) {
86783
- const res = await editor.doc.uploadResource(file2, { resourceType: "graph" });
86689
+ const res = await editor.doc.uploadResource(file2);
86784
86690
  const { resourceId } = res;
86785
86691
  const oldData = editor.getBlockData(targetBlock);
86786
86692
  const oldEmbedData = oldData.embedData;
@@ -86832,40 +86738,31 @@ ${data2.flowchartText}
86832
86738
  const xml = drawIoData.xmlSvg || drawIoData.xml || "";
86833
86739
  switch (msg.event) {
86834
86740
  case "configure":
86835
- iframe.contentWindow.postMessage(
86836
- JSON.stringify({
86837
- action: "configure",
86838
- config: {
86839
- defaultFonts: ["Humor Sans", "Helvetica", "Times New Roman"]
86840
- }
86841
- }),
86842
- "*"
86843
- );
86741
+ iframe.contentWindow.postMessage(JSON.stringify({
86742
+ action: "configure",
86743
+ config: {
86744
+ defaultFonts: ["Humor Sans", "Helvetica", "Times New Roman"]
86745
+ }
86746
+ }), "*");
86844
86747
  break;
86845
86748
  case "init":
86846
- iframe.contentWindow.postMessage(
86847
- JSON.stringify({
86848
- action: "load",
86849
- saveAndExit: 1,
86850
- noSaveBtn: 1,
86851
- noExitBtn: 0,
86852
- xml
86853
- }),
86854
- "*"
86855
- );
86749
+ iframe.contentWindow.postMessage(JSON.stringify({
86750
+ action: "load",
86751
+ saveAndExit: 1,
86752
+ noSaveBtn: 1,
86753
+ noExitBtn: 0,
86754
+ xml
86755
+ }), "*");
86856
86756
  loaded();
86857
86757
  loadingHandler.removeLoading();
86858
86758
  break;
86859
86759
  case "save":
86860
86760
  exportFlag = "save";
86861
- iframe.contentWindow.postMessage(
86862
- JSON.stringify({
86863
- action: "export",
86864
- format: "xmlsvg",
86865
- spin: "Saving graph"
86866
- }),
86867
- "*"
86868
- );
86761
+ iframe.contentWindow.postMessage(JSON.stringify({
86762
+ action: "export",
86763
+ format: "xmlsvg",
86764
+ spin: "Saving graph"
86765
+ }), "*");
86869
86766
  break;
86870
86767
  case "export":
86871
86768
  if (exportFlag !== "auto") {
@@ -86891,15 +86788,12 @@ ${data2.flowchartText}
86891
86788
  allowRetry: true,
86892
86789
  onOk: () => {
86893
86790
  setTimeout(() => {
86894
- drawioIframeWindow.postMessage(
86895
- JSON.stringify({
86896
- action: "export",
86897
- format: "xmlsvg",
86898
- spin: i18n$1.t("drawio.save"),
86899
- autoSave: exportFlag
86900
- }),
86901
- "*"
86902
- );
86791
+ drawioIframeWindow.postMessage(JSON.stringify({
86792
+ action: "export",
86793
+ format: "xmlsvg",
86794
+ spin: i18n$1.t("drawio.save"),
86795
+ autoSave: exportFlag
86796
+ }), "*");
86903
86797
  }, 1e3);
86904
86798
  },
86905
86799
  onClose: () => {
@@ -86965,15 +86859,12 @@ ${data2.flowchartText}
86965
86859
  if (!drawioIframe || !drawioIframe.contentWindow) {
86966
86860
  return;
86967
86861
  }
86968
- drawioIframe.contentWindow.postMessage(
86969
- JSON.stringify({
86970
- action: "export",
86971
- format: "xmlsvg",
86972
- spin: "Saving graph",
86973
- autoSave: true
86974
- }),
86975
- "*"
86976
- );
86862
+ drawioIframe.contentWindow.postMessage(JSON.stringify({
86863
+ action: "export",
86864
+ format: "xmlsvg",
86865
+ spin: "Saving graph",
86866
+ autoSave: true
86867
+ }), "*");
86977
86868
  }, SAVE_DELAY_TIME);
86978
86869
  };
86979
86870
  const exit = () => {
@@ -87113,12 +87004,10 @@ ${data2.flowchartText}
87113
87004
  }
87114
87005
  function updateGraphByXml(mxFile, embed, editor) {
87115
87006
  assert(logger$i, editor, "parameter missing");
87116
- initDrawIo(editor).then(
87117
- () => loopCheckResourceWasLoaded({
87118
- checker: () => !!(window.mxUtils && window.mxGraph && window.mxCodec),
87119
- maxRetryTime: 5e3
87120
- })
87121
- ).then(() => {
87007
+ initDrawIo(editor).then(() => loopCheckResourceWasLoaded({
87008
+ checker: () => !!(window.mxUtils && window.mxGraph && window.mxCodec),
87009
+ maxRetryTime: 5e3
87010
+ })).then(() => {
87122
87011
  const { mxUtils, mxGraph: MxGraph, mxCodec: MxCodec, Graph } = window;
87123
87012
  assert(logger$i, mxUtils, "External resource loading exception: mxUtils");
87124
87013
  assert(logger$i, MxGraph, "External resource loading exception: MxGraph");
@@ -87138,10 +87027,7 @@ ${data2.flowchartText}
87138
87027
  const raw = atob(diagramBase64);
87139
87028
  const pako = window.pako;
87140
87029
  assert(logger$i, pako, "External resource loading exception: pako");
87141
- const encodedXml = pako.inflateRaw(
87142
- Uint8Array.from(raw, (c) => c.charCodeAt(0)),
87143
- { to: "string" }
87144
- );
87030
+ const encodedXml = pako.inflateRaw(Uint8Array.from(raw, (c) => c.charCodeAt(0)), { to: "string" });
87145
87031
  const xml = decodeURIComponent(encodedXml);
87146
87032
  xmlDoc = mxUtils.parseXml(xml);
87147
87033
  } else {
@@ -87385,7 +87271,7 @@ ${data2.flowchartText}
87385
87271
  const data2 = embedData;
87386
87272
  if (type === "html") {
87387
87273
  if (data2.src) {
87388
- 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 })}" />`;
87389
87275
  }
87390
87276
  if (data2.xmlSvg) {
87391
87277
  return data2.xmlSvg;
@@ -87475,7 +87361,7 @@ ${data2.flowchartText}
87475
87361
  if (!plantumlImgFile) {
87476
87362
  return await Promise.resolve(url);
87477
87363
  }
87478
- const uploadResourceResult = await editor.doc.uploadResource(plantumlImgFile, { resourceType: "graph" });
87364
+ const uploadResourceResult = await editor.doc.uploadResource(plantumlImgFile);
87479
87365
  return uploadResourceResult.resourceId;
87480
87366
  } catch (error2) {
87481
87367
  return Promise.resolve(url);
@@ -87579,7 +87465,7 @@ ${data2.flowchartText}
87579
87465
  const data2 = embedData;
87580
87466
  if (type === "html") {
87581
87467
  if (data2.src) {
87582
- 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 })}" />`;
87583
87469
  }
87584
87470
  if (data2.plantumlText) {
87585
87471
  return `<div>${data2.plantumlText}</div>`;
@@ -91010,8 +90896,7 @@ ${data2.plantumlText}
91010
90896
  const { resourceId } = await editor.doc.uploadResource(file2, {
91011
90897
  onProgress: (progress) => {
91012
90898
  this.renderProgress(progress, file2);
91013
- },
91014
- resourceType: "media"
90899
+ }
91015
90900
  });
91016
90901
  const { name, type, size } = file2;
91017
90902
  const newBlockData = {
@@ -91149,11 +91034,7 @@ ${data2.plantumlText}
91149
91034
  renderEmpty(blockData) {
91150
91035
  assert(logger$9, this.abstract, "no abstract");
91151
91036
  assert(logger$9, this.mediaContainer, "The media element not exist");
91152
- const empty = createElement(
91153
- "div",
91154
- ["media-empty", "embed-selected-content", "embed-hover-content"],
91155
- this.mediaContainer
91156
- );
91037
+ const empty = createElement("div", ["media-empty", "embed-selected-content", "embed-hover-content"], this.mediaContainer);
91157
91038
  empty.innerHTML = this.abstract.mediaIcon;
91158
91039
  this.updateMediaContent(empty);
91159
91040
  const { editor } = this.options;
@@ -91174,7 +91055,7 @@ ${data2.plantumlText}
91174
91055
  }
91175
91056
  await editor.doc.addResources([resourceId]);
91176
91057
  const serviceAppId = (_b = (_a = editor.doc).getServerMeta) == null ? void 0 : _b.call(_a).appId;
91177
- if (resourceUrl !== blockData.embedData.src && serviceAppId && blockData.embedData.src.includes(serviceAppId)) {
91058
+ if (resourceUrl !== blockData.embedData.src && (serviceAppId && blockData.embedData.src.includes(serviceAppId))) {
91178
91059
  const block = getParentBlock(content);
91179
91060
  if (block && !editor.readonly && editor.isBlockWritable(block)) {
91180
91061
  const newBlockData = cloneDeep__default.default(blockData);
@@ -91315,7 +91196,7 @@ ${data2.plantumlText}
91315
91196
  const mediaData = blockData.embedData;
91316
91197
  const url = editor.doc.buildResourceUrl(mediaData.src, { withToken: true });
91317
91198
  if (type === "html") {
91318
- return `<${this.embedType} data-embed-type="${this.embedType}" data-uuid="${this.embedType}:${mediaData.src}" src="${url}" />`;
91199
+ return `<${mediaData.type} src="${url}" />`;
91319
91200
  }
91320
91201
  if (type === "markdown") {
91321
91202
  return `![${mediaData.src}](${url})`;
@@ -94356,11 +94237,11 @@ ${JSON.stringify(error2, null, 2)}`);
94356
94237
  this.fixedToolbar = (_a = editor.findCustom("main-toolbar-fixed-toolbar")) == null ? void 0 : _a.toolbar;
94357
94238
  if (this.fixedToolbar) {
94358
94239
  const content = this.fixedToolbar.content;
94359
- const resizer = content.closest(".editor-main-toolbar-resizer");
94240
+ const toolbar2 = content.closest(".editor-command-bar-root");
94360
94241
  this.observer = new ResizeObserver(() => {
94361
94242
  this.updateItems();
94362
94243
  });
94363
- this.observer.observe(resizer);
94244
+ this.observer.observe(toolbar2);
94364
94245
  editor.addCustom("main-toolbar-more-item", () => this);
94365
94246
  }
94366
94247
  });
@@ -94387,7 +94268,7 @@ ${JSON.stringify(error2, null, 2)}`);
94387
94268
  return;
94388
94269
  }
94389
94270
  const content = toolbar2.content;
94390
- const toolbarRoot = content.closest(".editor-main-toolbar-resizer");
94271
+ const toolbarRoot = content.closest(".editor-command-bar-root");
94391
94272
  const toolbarRect = toolbarRoot.getBoundingClientRect();
94392
94273
  const toolbarRight = toolbarRect.right;
94393
94274
  items.forEach((item) => {
@@ -94457,67 +94338,8 @@ ${JSON.stringify(error2, null, 2)}`);
94457
94338
  toolbar2.updateItems(items);
94458
94339
  }
94459
94340
  }
94460
- class InsertFileItem {
94461
- constructor() {
94462
- __publicField(this, "id", "insert-file");
94463
- __publicField(this, "name", i18n$1.t("toolbar.file"));
94464
- __publicField(this, "icon", AttachmentIcon);
94465
- }
94466
- async onClick(editor, item) {
94467
- const block = editor.getBlockById(editor.selection.range.start.blockId);
94468
- const container = editor.getParentContainer(block);
94469
- const index2 = editor.getBlockIndex(block);
94470
- const file2 = await selectFile("*");
94471
- if (!file2) {
94472
- return;
94473
- }
94474
- const res = await editor.doc.uploadResource(file2);
94475
- if (!res.resourceId) {
94476
- return;
94477
- }
94478
- const data2 = {
94479
- src: res.resourceId,
94480
- fileName: file2.name,
94481
- fileSize: file2.size,
94482
- fileType: file2.type,
94483
- created: Date.now(),
94484
- creator: editor.doc.getUser().displayName,
94485
- previewType: FilePreviewType.Card
94486
- };
94487
- editor.insertEmbed(getContainerId(container), index2 + 1, "office", data2);
94488
- }
94489
- }
94490
- class InsertMentionItem {
94491
- constructor() {
94492
- __publicField(this, "id", "insert-mention");
94493
- __publicField(this, "name", i18n$1.t("toolbar.mention"));
94494
- __publicField(this, "icon", Mention2Icon);
94495
- }
94496
- onClick(editor, item) {
94497
- editor.clearSelectedContents();
94498
- const focus = editor.selection.range.focus;
94499
- if (!focus.isSimple()) {
94500
- return;
94501
- }
94502
- const block = editor.getBlockById(focus.blockId);
94503
- if (!isTextKindBlock(editor, block)) {
94504
- return;
94505
- }
94506
- editor.focus();
94507
- editor.insertTextToBlock(block, focus.offset, "@");
94508
- const mention = editor.findCustom("mention");
94509
- if (mention) {
94510
- const suggest = mention.suggest;
94511
- if (suggest) {
94512
- const container = getParentContainer(block);
94513
- suggest.handleAfterInsertText(editor, getContainerId(container), getBlockIndex(block), focus.offset, "@");
94514
- }
94515
- }
94516
- }
94517
- }
94518
94341
  function getToolbarDefaultItems(editor) {
94519
- const commentsEnabled = !!editor.options.enableComments;
94520
- const items = [
94342
+ return [
94521
94343
  new UndoItem(),
94522
94344
  new RedoItem(),
94523
94345
  new SeparatorItem(),
@@ -94542,15 +94364,14 @@ ${JSON.stringify(error2, null, 2)}`);
94542
94364
  new AlignCenterItem(),
94543
94365
  new AlignRightItem(),
94544
94366
  new SeparatorItem(),
94367
+ new InsertImageItem(),
94368
+ new SeparatorItem(),
94545
94369
  new InsertItem(editor),
94546
94370
  new SeparatorItem(),
94547
- new FindReplaceItem()
94371
+ new FindReplaceItem(),
94372
+ new CommentItem(),
94373
+ new MoreItem(editor)
94548
94374
  ];
94549
- if (commentsEnabled) {
94550
- items.push(new CommentItem());
94551
- }
94552
- items.push(new MoreItem(editor));
94553
- return items;
94554
94375
  }
94555
94376
  const zhCN = {
94556
94377
  toolbar: {
@@ -94563,10 +94384,7 @@ ${JSON.stringify(error2, null, 2)}`);
94563
94384
  quote: "\u5F15\u7528",
94564
94385
  checkList: "\u4EFB\u52A1\u5217\u8868",
94565
94386
  orderedList: "\u6709\u5E8F\u5217\u8868",
94566
- unorderedList: "\u65E0\u5E8F\u5217\u8868",
94567
- fullscreen: "\u5168\u5C4F",
94568
- file: "\u63D2\u5165\u6587\u4EF6",
94569
- mention: "\u63D0\u53CA\u7528\u6237"
94387
+ unorderedList: "\u65E0\u5E8F\u5217\u8868"
94570
94388
  }
94571
94389
  };
94572
94390
  const zhHK = {
@@ -94580,10 +94398,7 @@ ${JSON.stringify(error2, null, 2)}`);
94580
94398
  quote: "\u5F15\u7528",
94581
94399
  checkList: "\u4EFB\u52D9\u5217\u8868",
94582
94400
  orderedList: "\u6709\u5E8F\u5217\u8868",
94583
- unorderedList: "\u7121\u5E8F\u5217\u8868",
94584
- fullscreen: "\u5168\u5C4F",
94585
- file: "\u63D2\u5165\u6587\u4EF6",
94586
- mention: "\u63D0\u53CA\u7528\u6236"
94401
+ unorderedList: "\u7121\u5E8F\u5217\u8868"
94587
94402
  }
94588
94403
  };
94589
94404
  const enUS = {
@@ -94597,10 +94412,7 @@ ${JSON.stringify(error2, null, 2)}`);
94597
94412
  quote: "Quote",
94598
94413
  checkList: "Check List",
94599
94414
  orderedList: "Ordered List",
94600
- unorderedList: "Unordered List",
94601
- fullscreen: "Full Screen",
94602
- file: "File",
94603
- mention: "Mention user"
94415
+ unorderedList: "Unordered List"
94604
94416
  }
94605
94417
  };
94606
94418
  const jaJP = {
@@ -94614,10 +94426,7 @@ ${JSON.stringify(error2, null, 2)}`);
94614
94426
  quote: "\u5F15\u7528",
94615
94427
  checkList: "\u30C1\u30A7\u30C3\u30AF\u30EA\u30B9\u30C8",
94616
94428
  orderedList: "\u756A\u53F7\u4ED8\u304D\u30EA\u30B9\u30C8",
94617
- unorderedList: "\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8",
94618
- fullscreen: "\u5168\u753B\u9762\u8868\u793A",
94619
- file: "\u30D5\u30A1\u30A4\u30EB\u3092\u633F\u5165",
94620
- mention: "\u30E6\u30FC\u30B6\u30FC\u3092\u30E1\u30F3\u30B7\u30E7\u30F3"
94429
+ unorderedList: "\u7B87\u6761\u66F8\u304D\u30EA\u30B9\u30C8"
94621
94430
  }
94622
94431
  };
94623
94432
  i18n$1.mergeLang({
@@ -94628,10 +94437,8 @@ ${JSON.stringify(error2, null, 2)}`);
94628
94437
  });
94629
94438
  const style = "";
94630
94439
  class MainToolbar {
94631
- constructor(editor, parent, options = {}) {
94440
+ constructor(editor, parent) {
94632
94441
  __publicField(this, "toolbar");
94633
- __publicField(this, "toolbarFullScreen");
94634
- __publicField(this, "root");
94635
94442
  __publicField(this, "handleClick", (bar2, item) => {
94636
94443
  const command = item;
94637
94444
  if (command.onClick) {
@@ -94668,13 +94475,7 @@ ${JSON.stringify(error2, null, 2)}`);
94668
94475
  this.updateState();
94669
94476
  });
94670
94477
  this.editor = editor;
94671
- this.options = options;
94672
- const root2 = createElement("div", ["editor-main-toolbar-root"], parent);
94673
- const container = createElement("div", ["editor-main-toolbar-resizer"], root2);
94674
- const resizer = createElement("div", ["editor-main-toolbar-container"], container);
94675
- const items = getToolbarDefaultItems(editor);
94676
- this.root = root2;
94677
- this.toolbar = new FixedToolbar(resizer, items, {
94478
+ this.toolbar = new FixedToolbar(parent, this.getItems(), {
94678
94479
  tooltipId: editor.clientId,
94679
94480
  id: "main-toolbar"
94680
94481
  });
@@ -94686,39 +94487,16 @@ ${JSON.stringify(error2, null, 2)}`);
94686
94487
  destroy: () => {
94687
94488
  }
94688
94489
  }));
94689
- if (options.enableFullScreen) {
94690
- const fullScreenItem = {
94691
- id: "main-toolbar-fullscreen",
94692
- icon: FullScreenIcon,
94693
- name: i18n$1.t("toolbar.fullscreen")
94694
- };
94695
- this.toolbarFullScreen = new FixedToolbar(root2, [fullScreenItem], {
94696
- tooltipId: editor.clientId,
94697
- id: "main-toolbar-fullscreen",
94698
- rootId: "main-toolbar-fullscreen"
94699
- });
94700
- this.toolbarFullScreen.addListener("click", (bar2, item) => {
94701
- var _a;
94702
- if (item.id === "main-toolbar-fullscreen") {
94703
- (_a = options.onFullScreenClick) == null ? void 0 : _a.call(options, this.editor, item);
94704
- this.handleSelectionChanged();
94705
- }
94706
- });
94707
- }
94708
94490
  }
94709
94491
  destroy() {
94710
- var _a;
94711
94492
  this.toolbar.destroy();
94712
- this.editor.removeListener("selectionChanged", this.handleSelectionChanged);
94713
- (_a = this.toolbarFullScreen) == null ? void 0 : _a.destroy();
94714
- this.root.remove();
94715
94493
  }
94716
94494
  setItems(items) {
94717
94495
  this.toolbar.updateItems(items);
94718
94496
  this.updateState();
94719
94497
  }
94720
94498
  getItems() {
94721
- return this.toolbar.items;
94499
+ return getToolbarDefaultItems(this.editor);
94722
94500
  }
94723
94501
  updateState() {
94724
94502
  const items = this.toolbar.items;
@@ -94756,311 +94534,9 @@ ${JSON.stringify(error2, null, 2)}`);
94756
94534
  }
94757
94535
  });
94758
94536
  }
94759
- const CkeImageConverter = {
94760
- filter: (node) => {
94761
- if (node.nodeName !== "IMG") {
94762
- return false;
94763
- }
94764
- const elem = node;
94765
- const refId = elem.getAttribute("data-ref-id");
94766
- const refType = elem.getAttribute("data-ref-type");
94767
- const uuid = elem.getAttribute("data-uuid");
94768
- return Boolean(refType === "task" && refId && uuid);
94769
- },
94770
- replacement: (content, node) => {
94771
- const refType = node.getAttribute("data-ref-type");
94772
- const refId = node.getAttribute("data-ref-id");
94773
- const uuid = node.getAttribute("data-uuid");
94774
- const src = `ones-file:${refType}/${refId}/${uuid}`;
94775
- return `![${refType}](${src})`;
94776
- }
94777
- };
94778
- const ckeHtmlConverters = /* @__PURE__ */ new Map();
94779
- function registerCKEHtmlConvert(name, converter) {
94780
- if (ckeHtmlConverters.has(name)) {
94781
- return;
94782
- }
94783
- ckeHtmlConverters.set(name, converter);
94784
- turndownService.use((ts) => {
94785
- ts.addRule(name, converter);
94786
- });
94787
- }
94788
- function getTurndownRootElement(node) {
94789
- let parent = node;
94790
- while (parent) {
94791
- if (parent instanceof HTMLElement && parent.tagName === "BODY") {
94792
- return parent;
94793
- }
94794
- if (!parent.parentNode) {
94795
- return parent;
94796
- }
94797
- parent = parent.parentNode;
94798
- }
94799
- return node;
94800
- }
94801
- function patchForEmptyBlock(key, node, className) {
94802
- const root2 = getTurndownRootElement(node);
94803
- if (root2 && root2 instanceof HTMLElement) {
94804
- const attributeKey = `data-${key}-processed`;
94805
- if (!root2.getAttribute(attributeKey)) {
94806
- root2.setAttribute(attributeKey, "true");
94807
- const elements = root2.querySelectorAll(className);
94808
- elements.forEach((elem) => {
94809
- var _a;
94810
- const text2 = (_a = elem.textContent) == null ? void 0 : _a.trim();
94811
- if (!text2) {
94812
- elem.innerText = "--temp-data--";
94813
- }
94814
- });
94815
- }
94816
- }
94817
- }
94818
- const CkeCommentConverter = {
94819
- filter: (node) => {
94820
- if (node.nodeName === "SPAN") {
94821
- const span = node;
94822
- const ref = span.getAttribute("data-annotate-ref");
94823
- return Boolean(ref);
94824
- }
94825
- return false;
94826
- },
94827
- replacement: (content, node) => {
94828
- var _a;
94829
- const span = node;
94830
- const ref = span.getAttribute("data-annotate-ref");
94831
- const text2 = (_a = span.textContent) != null ? _a : "";
94832
- return `[${text2}](comment://${ref})`;
94833
- }
94834
- };
94835
- function processCkeCommentsLink(doc2) {
94836
- const containers = doc2.blocks;
94837
- Object.values(containers).forEach((blocks) => {
94838
- blocks.forEach((block) => {
94839
- const text2 = block.text;
94840
- if (text2) {
94841
- text2.forEach((op) => {
94842
- if (op.attributes) {
94843
- const attributes = op.attributes;
94844
- const link2 = attributes.link;
94845
- if (link2 == null ? void 0 : link2.startsWith("comment://")) {
94846
- delete attributes.link;
94847
- const commentId = link2.replace("comment://", "");
94848
- const key = `comment-${commentId.toLocaleLowerCase()}`;
94849
- attributes[key] = commentId;
94850
- }
94851
- }
94852
- });
94853
- }
94854
- });
94855
- });
94856
- }
94857
- const CkeMentionConverter = {
94858
- filter: (node) => {
94859
- patchForEmptyBlock("mention", node, ".ones-at-user-block");
94860
- if (node.nodeName === "SPAN") {
94861
- const span = node;
94862
- if (hasClass(span, "ones-at-user-block")) {
94863
- const name = span.getAttribute("data-default-name");
94864
- const refId = span.getAttribute("data-ref-id");
94865
- return Boolean(name) && Boolean(refId);
94866
- }
94867
- }
94868
- return false;
94869
- },
94870
- replacement: (content, node) => {
94871
- const span = node;
94872
- const name = span.getAttribute("data-default-name") || "";
94873
- const refId = span.getAttribute("data-ref-id") || "";
94874
- if (name && refId) {
94875
- const box = {
94876
- id: genId(),
94877
- type: "mention",
94878
- box: true,
94879
- created: Date.now(),
94880
- iconUrl: "",
94881
- text: name,
94882
- mentionId: refId
94883
- };
94884
- const text2 = [
94885
- {
94886
- insert: " ",
94887
- attributes: box
94888
- }
94889
- ];
94890
- const obj = {
94891
- text: text2
94892
- };
94893
- const base64 = toBase64URL(JSON.stringify(obj));
94894
- return `[[${base64}]]`;
94895
- }
94896
- return name;
94897
- }
94898
- };
94899
- function convertMentionToCkeMention(editor, boxData, doc2, type) {
94900
- const data2 = boxData;
94901
- if (type === "html") {
94902
- 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>`;
94903
- }
94904
- return `@${data2.text}`;
94905
- }
94906
- function patchMentionConverter(editor) {
94907
- const mentionBox = editor.editorBoxes.getBoxClass("mention");
94908
- if (mentionBox) {
94909
- const oldConvertTo = mentionBox.convertTo;
94910
- if (oldConvertTo !== convertMentionToCkeMention) {
94911
- mentionBox.convertTo = convertMentionToCkeMention;
94912
- }
94913
- }
94914
- }
94915
- function processLinks(doc2) {
94916
- const containers = doc2.blocks;
94917
- Object.values(containers).forEach((blocks) => {
94918
- blocks.forEach((block) => {
94919
- if (block.text) {
94920
- const text2 = block.text;
94921
- text2.forEach((op) => {
94922
- const attributes = op.attributes;
94923
- if (attributes) {
94924
- attributes.link;
94925
- }
94926
- });
94927
- }
94928
- });
94929
- });
94930
- }
94931
- const CkeMarkdownConverter = {
94932
- filter: (node) => {
94933
- if (node.nodeName !== "DIV") {
94934
- return false;
94935
- }
94936
- const div = node;
94937
- return hasClass(div, "ones-marked-card");
94938
- },
94939
- replacement: (content, node) => {
94940
- const textToCodeBlock2 = (text2, language) => {
94941
- const codeBlocks = text2.split("\n").map((line) => {
94942
- const block = {
94943
- type: "text",
94944
- id: genId(),
94945
- text: createRichText(line)
94946
- };
94947
- return block;
94948
- });
94949
- const containerId = genId();
94950
- const doc22 = {
94951
- blocks: {
94952
- root: [
94953
- {
94954
- id: genId(),
94955
- type: "code",
94956
- language,
94957
- children: [containerId]
94958
- }
94959
- ],
94960
- [containerId]: codeBlocks
94961
- },
94962
- meta: {},
94963
- comments: {}
94964
- };
94965
- return toBase64URL(JSON.stringify(doc22));
94966
- };
94967
- const nodeToCodeBlock2 = (node2, lang) => {
94968
- const text2 = node2.textContent || "";
94969
- return textToCodeBlock2(text2, lang);
94970
- };
94971
- const doc2 = nodeToCodeBlock2(node, "markdown");
94972
- const fence = "```";
94973
- return "\n\n" + fence + "\n" + doc2 + "\n" + fence + "\n\n";
94974
- }
94975
- };
94976
- registerCKEHtmlConvert("image", CkeImageConverter);
94977
- registerCKEHtmlConvert("comment", CkeCommentConverter);
94978
- registerCKEHtmlConvert("mention", CkeMentionConverter);
94979
- registerCKEHtmlConvert("markdown", CkeMarkdownConverter);
94980
- function ckeHtml2Doc(html) {
94981
- const doc2 = htmlToDoc(html) || createEmptyDoc$1();
94982
- processCkeCommentsLink(doc2);
94983
- processLinks(doc2);
94984
- return doc2;
94985
- }
94986
- function injectDocToCkeHtmlFragment(htmlFragment, doc2, text2) {
94987
- const meta = `<meta charset="utf-8"><ones-editor-doc data-source="ones-editor-doc::${toBase64URL(
94988
- JSON.stringify(doc2)
94989
- )}::ones-editor-doc" />`;
94990
- let textMeta = "";
94991
- if (text2) {
94992
- textMeta = `<meta name="ones-editor-text" content="${toBase64URL(text2)}" />`;
94993
- }
94994
- const html = `<!doctype html><html><head>${meta}${textMeta}</head><body>${htmlFragment}</body></html>`;
94995
- return html;
94996
- }
94997
- function editorToCKEHtml(editor) {
94998
- patchMentionConverter(editor);
94999
- const docObject = editor.doc.toJSON();
95000
- if (isEmptyDoc(docObject)) {
95001
- return "";
95002
- }
95003
- let html = docToHtmlFragment(editor, docObject);
95004
- const text2 = docToText(editor, docObject);
95005
- html = injectDocToCkeHtmlFragment(html, docObject, text2);
95006
- return html;
95007
- }
95008
- function combineDoc(doc1, doc2) {
95009
- if (isEmptyDoc(doc1)) {
95010
- return doc2;
95011
- }
95012
- if (isEmptyDoc(doc2)) {
95013
- return doc1;
95014
- }
95015
- const splitterDoc = createEmptyDoc$1("", {
95016
- firstLineAsTitle: false
95017
- });
95018
- return mergeDocs([doc1, splitterDoc, doc2]);
95019
- }
95020
- function mergeHTMLBodiesOnly(htmlA, htmlB) {
95021
- const parser = new DOMParser();
95022
- const docA = parser.parseFromString(htmlA, "text/html");
95023
- const docB = parser.parseFromString(htmlB, "text/html");
95024
- const mergedDoc = document.implementation.createHTMLDocument("Merged");
95025
- const bodyA = docA.body;
95026
- const bodyB = docB.body;
95027
- const mergedBody = mergedDoc.body;
95028
- Array.from(bodyA.childNodes).forEach((node) => {
95029
- mergedBody.appendChild(mergedDoc.importNode(node, true));
95030
- });
95031
- Array.from(bodyB.childNodes).forEach((node) => {
95032
- mergedBody.appendChild(mergedDoc.importNode(node, true));
95033
- });
95034
- return mergedBody.innerHTML;
95035
- }
95036
- function combineCkeHtml(html1, html2) {
95037
- const doc1 = ckeHtml2Doc(html1);
95038
- const doc2 = ckeHtml2Doc(html2);
95039
- const newDoc = combineDoc(doc1, doc2);
95040
- const newHtml = mergeHTMLBodiesOnly(html1, html2);
95041
- const ret = injectDocToCkeHtmlFragment(newHtml, newDoc);
95042
- return ret;
95043
- }
95044
- function combineRichTextValue(value1, value2) {
95045
- return combineCkeHtml(value1, value2);
95046
- }
95047
94537
  const logger = getLogger("create-editor");
95048
- function getHooks(options, local) {
95049
- var _a;
95050
- const hooks = [];
95051
- if (!options.disableLock) {
95052
- hooks.push(new BlockLockerHook());
95053
- }
95054
- if (!local) {
95055
- hooks.push(new BlockExclusiveHook());
95056
- }
95057
- if ((_a = options.components) == null ? void 0 : _a.blockHooks) {
95058
- hooks.push(...options.components.blockHooks);
95059
- }
95060
- return hooks;
95061
- }
95062
94538
  function getDefaultOnesEditorOptions(options) {
95063
- var _a, _b, _c, _d, _e, _f, _g, _h;
94539
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
95064
94540
  const enableComments = options == null ? void 0 : options.enableComments;
95065
94541
  const quickMenu = (_b = (_a = options.componentsOptions) == null ? void 0 : _a.quickMenu) != null ? _b : { id: "quick-menu", trigger: ["/"], commandProviders: [] };
95066
94542
  (_c = quickMenu.commandProviders) == null ? void 0 : _c.push(new GraphCommandProvider());
@@ -95077,11 +94553,11 @@ ${JSON.stringify(error2, null, 2)}`);
95077
94553
  commandProviders: [new TableBlockCommandProvider(), ...((_g = options.components) == null ? void 0 : _g.commandProviders) || []],
95078
94554
  decorators: [new CodeTextDecorator(), new RemoteCaretsDecorator()],
95079
94555
  insertions: [RemoteCaretsInsertion],
95080
- blockHooks: getHooks(options, false),
94556
+ blockHooks: [new BlockLockerHook(), new BlockExclusiveHook(), ...((_h = options.components) == null ? void 0 : _h.blockHooks) || []],
95081
94557
  textRenders: [
95082
94558
  enableComments && new OnesEditorCommentsRender(),
95083
94559
  new BlockPaddingRender(),
95084
- ...((_h = options.components) == null ? void 0 : _h.textRenders) || []
94560
+ ...((_i = options.components) == null ? void 0 : _i.textRenders) || []
95085
94561
  ].filter(Boolean),
95086
94562
  options: { ...options.componentsOptions, quickMenu }
95087
94563
  },
@@ -95100,7 +94576,15 @@ ${JSON.stringify(error2, null, 2)}`);
95100
94576
  TextColorShortcuts,
95101
94577
  ...options.shortcuts || []
95102
94578
  ],
95103
- 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
+ ]
95104
94588
  };
95105
94589
  return ret;
95106
94590
  }
@@ -95198,14 +94682,11 @@ ${JSON.stringify(error2, null, 2)}`);
95198
94682
  editor.input.addHandler(new ListPasteHandler());
95199
94683
  editor.doc.registerCallback(new HeadingBlockDocEvents(editor));
95200
94684
  editor.addCustom("remote-cursor", () => new RemoteCarets(editor));
95201
- editor.addCustom(
95202
- "editor-image-preview",
95203
- () => new ImagePreviewHandler(editor, (editor2, img) => {
95204
- var _a2, _b2;
95205
- (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
95206
- })
95207
- );
95208
- 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) {
95209
94690
  editor.addCustom("block-menu", (editor2) => new OnesEditorBlockMenuButtons(editor2));
95210
94691
  }
95211
94692
  if (!clientType.isMobile) {
@@ -95213,6 +94694,7 @@ ${JSON.stringify(error2, null, 2)}`);
95213
94694
  var _a2;
95214
94695
  return new OnesEditorQuickMenu(editor, (_a2 = options.componentsOptions) == null ? void 0 : _a2.quickMenu);
95215
94696
  });
94697
+ editor.addCustom("block-menu", (editor2) => new OnesEditorBlockMenuButtons(editor2));
95216
94698
  editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
95217
94699
  (_c = editor.findCustom("editor-quick-menu")) == null ? void 0 : _c.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
95218
94700
  (_d = editor.findCustom("editor-block-menu")) == null ? void 0 : _d.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
@@ -95253,9 +94735,7 @@ ${JSON.stringify(error2, null, 2)}`);
95253
94735
  OnesEditorTocProvider.register(editor);
95254
94736
  OnesEditorExclusiveBlock.register(editor);
95255
94737
  if (!clientType.isMobile) {
95256
- editor.editorCommandProviders.registerCommandProvider(
95257
- new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true })
95258
- );
94738
+ editor.editorCommandProviders.registerCommandProvider(new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true }));
95259
94739
  editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
95260
94740
  } else {
95261
94741
  editor.addCustom("mobile-helper", () => new OnesEditorMobileHelper(editor));
@@ -95302,14 +94782,14 @@ ${JSON.stringify(error2, null, 2)}`);
95302
94782
  }
95303
94783
  }
95304
94784
  });
95305
- editor.version = "2.9.8-beta.9";
94785
+ editor.version = "2.9.8";
95306
94786
  return editor;
95307
94787
  }
95308
94788
  function isDoc(doc2) {
95309
94789
  return doc2.toJSON !== void 0;
95310
94790
  }
95311
94791
  async function createLocalEditor(root2, docData, options) {
95312
- 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;
95313
94793
  assert(logger, root2, "app does not exists");
95314
94794
  const doc2 = isDoc(docData) ? docData : new LocalDoc(docData, {
95315
94795
  serverUrl: options.serverUrl || ""
@@ -95325,7 +94805,6 @@ ${JSON.stringify(error2, null, 2)}`);
95325
94805
  id: options.id,
95326
94806
  scrollContainer: options == null ? void 0 : options.scrollContainer,
95327
94807
  enableResolveComments: options == null ? void 0 : options.enableResolveComments,
95328
- enableComments,
95329
94808
  components: {
95330
94809
  blocks: [...StandardBlocks, ...(_f = (_e = options.components) == null ? void 0 : _e.blocks) != null ? _f : []],
95331
94810
  commandProviders: [new TableBlockCommandProvider()],
@@ -95333,7 +94812,7 @@ ${JSON.stringify(error2, null, 2)}`);
95333
94812
  embeds: [...StandardEmbeds, ...((_g = options.components) == null ? void 0 : _g.embeds) || []],
95334
94813
  boxes: [MathjaxBox, MentionBox, FileBox, StatusBox, ...((_h = options.components) == null ? void 0 : _h.boxes) || []],
95335
94814
  insertions: [RemoteCaretsInsertion],
95336
- blockHooks: [...((_i = options.components) == null ? void 0 : _i.blockHooks) || []],
94815
+ blockHooks: [new BlockLockerHook(), ...((_i = options.components) == null ? void 0 : _i.blockHooks) || []],
95337
94816
  textRenders: [
95338
94817
  enableComments && new OnesEditorCommentsRender(),
95339
94818
  new BlockPaddingRender(),
@@ -95366,14 +94845,11 @@ ${JSON.stringify(error2, null, 2)}`);
95366
94845
  editor.input.addHandler(new OnesEditorPasteHandler(editor));
95367
94846
  editor.input.addHandler(new BlockLockerPasteHandler());
95368
94847
  editor.input.addHandler(new ListPasteHandler());
95369
- editor.addCustom(
95370
- "editor-image-preview",
95371
- () => new ImagePreviewHandler(editor, (editor2, img) => {
95372
- var _a2, _b2;
95373
- (_b2 = (_a2 = options.events) == null ? void 0 : _a2.onPreviewImage) == null ? void 0 : _b2.call(_a2, editor2, img);
95374
- })
95375
- );
95376
- 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) {
95377
94853
  editor.addCustom("block-menu", (editor2) => new OnesEditorBlockMenuButtons(editor2));
95378
94854
  }
95379
94855
  if (!clientType.isMobile) {
@@ -95381,9 +94857,8 @@ ${JSON.stringify(error2, null, 2)}`);
95381
94857
  var _a2;
95382
94858
  return new OnesEditorQuickMenu(editor, (_a2 = options.componentsOptions) == null ? void 0 : _a2.quickMenu);
95383
94859
  });
95384
- editor.editorCommandProviders.registerCommandProvider(
95385
- new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true })
95386
- );
94860
+ editor.addCustom("block-menu", (editor2) => new OnesEditorBlockMenuButtons(editor2));
94861
+ editor.editorCommandProviders.registerCommandProvider(new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true }));
95387
94862
  editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
95388
94863
  (_k = editor.findCustom("editor-quick-menu")) == null ? void 0 : _k.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
95389
94864
  (_l = editor.findCustom("editor-block-menu")) == null ? void 0 : _l.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
@@ -95401,16 +94876,6 @@ ${JSON.stringify(error2, null, 2)}`);
95401
94876
  if (options.enableContextMenu !== false) {
95402
94877
  editor.addCustom("editor-context-menu", (editor2) => new OnesEditorContextMenu(editor2));
95403
94878
  }
95404
- editor.addCustom("create-options", () => new OnesEditorCustomDataWrapper(editor, options));
95405
- editor.addCustom("drop-target", () => new OnesEditorDropTarget(editor));
95406
- editor.addCustom("list-to-mindmap", () => new OnesEditorListMindmap(editor));
95407
- editor.addCustom("list-to-mention", () => new OnesEditorBlockMention(editor));
95408
- editor.addCustom("code-caret", () => new OnesEditorCodeCaret(editor));
95409
- editor.addCustom("layout-paste-handler", () => new LayoutBlockCaptionInputHandler(editor, true));
95410
- if ((_m = options.componentsOptions) == null ? void 0 : _m.mention) {
95411
- const mentionOptions = options.componentsOptions.mention;
95412
- editor.addCustom("mention", () => new OnesEditorMention(editor, mentionOptions));
95413
- }
95414
94879
  if (options.headingButton !== false) {
95415
94880
  editor.addCustom("heading-collapse", () => new HeadingBlockCollapseButton(editor));
95416
94881
  }
@@ -95431,10 +94896,7 @@ ${JSON.stringify(error2, null, 2)}`);
95431
94896
  }
95432
94897
  });
95433
94898
  OnesEditorToolbar.register(editor);
95434
- OnesEditorDropTarget.register(editor);
95435
- OnesEditorTocProvider.register(editor);
95436
- OnesEditorExclusiveBlock.register(editor);
95437
- editor.version = "2.9.8-beta.9";
94899
+ editor.version = "2.9.8";
95438
94900
  return editor;
95439
94901
  }
95440
94902
  async function showDocVersions(editor, options, serverUrl) {
@@ -141227,7 +140689,6 @@ ${JSON.stringify(error2, null, 2)}`);
141227
140689
  exports2.ArrowLeftIcon = arrowLeft;
141228
140690
  exports2.ArrowRightIcon = ArrowRightIcon;
141229
140691
  exports2.ArrowUpIcon = arrowUp;
141230
- exports2.AttachmentIcon = AttachmentIcon;
141231
140692
  exports2.AudioIcon = AudioIcon;
141232
140693
  exports2.AuthError = AuthError;
141233
140694
  exports2.AuthHeader = AuthHeader;
@@ -141361,11 +140822,9 @@ ${JSON.stringify(error2, null, 2)}`);
141361
140822
  exports2.InputtingInsertion = InputtingInsertion;
141362
140823
  exports2.InsertAfterIcon = InsertAfterIcon;
141363
140824
  exports2.InsertBeforeIcon = InsertBeforeIcon;
141364
- exports2.InsertFileItem = InsertFileItem;
141365
140825
  exports2.InsertImageItem = InsertImageItem;
141366
140826
  exports2.InsertItem = InsertItem;
141367
140827
  exports2.InsertLinkItem = InsertLinkItem;
141368
- exports2.InsertMentionItem = InsertMentionItem;
141369
140828
  exports2.InsertMenuProvider = InsertMenuProvider;
141370
140829
  exports2.ItalicIcon = ItalicIcon;
141371
140830
  exports2.LaunchIcon = LaunchIcon;
@@ -141396,7 +140855,6 @@ ${JSON.stringify(error2, null, 2)}`);
141396
140855
  exports2.MathIcon = mathIcon;
141397
140856
  exports2.MathMenuIcon = MathMenuIcon;
141398
140857
  exports2.MaxUserError = MaxUserError;
141399
- exports2.Mention2Icon = Mention2Icon;
141400
140858
  exports2.MentionIcon = MentionIcon;
141401
140859
  exports2.MergeCellIcon = MergeCellIcon;
141402
140860
  exports2.Mindmap = Mindmap;
@@ -141536,15 +140994,12 @@ ${JSON.stringify(error2, null, 2)}`);
141536
140994
  exports2.blockToText = blockToText;
141537
140995
  exports2.blocksToDoc = blocksToDoc;
141538
140996
  exports2.changeButtonName = changeButtonName;
141539
- exports2.ckeHtml2Doc = ckeHtml2Doc;
141540
140997
  exports2.clearAllSelection = clearAllSelection;
141541
140998
  exports2.clientType = clientType;
141542
140999
  exports2.cloneBlock = cloneBlock;
141543
141000
  exports2.cloneChildContainer = cloneChildContainer;
141544
141001
  exports2.cloneDoc = cloneDoc;
141545
141002
  exports2.cloneText = cloneText;
141546
- exports2.combineCkeHtml = combineCkeHtml;
141547
- exports2.combineRichTextValue = combineRichTextValue;
141548
141003
  exports2.commentToShareDbComment = commentToShareDbComment;
141549
141004
  exports2.compareElement = compareElement;
141550
141005
  exports2.comparePosition = comparePosition;
@@ -141700,7 +141155,6 @@ ${JSON.stringify(error2, null, 2)}`);
141700
141155
  exports2.editorSelectWordLeft = editorSelectWordLeft;
141701
141156
  exports2.editorSetTextColor = editorSetTextColor;
141702
141157
  exports2.editorShowFindDialog = editorShowFindDialog;
141703
- exports2.editorToCKEHtml = editorToCKEHtml;
141704
141158
  exports2.editorToDocx = editorToDocx;
141705
141159
  exports2.editorUpdateBlockData = editorUpdateBlockData;
141706
141160
  exports2.editorUpdateCompositionText = editorUpdateCompositionText;
@@ -141867,7 +141321,6 @@ ${JSON.stringify(error2, null, 2)}`);
141867
141321
  exports2.i18n = i18n$1;
141868
141322
  exports2.includeBigTable = includeBigTable;
141869
141323
  exports2.injectBlockOptions = injectBlockOptions;
141870
- exports2.injectDocToCkeHtmlFragment = injectDocToCkeHtmlFragment;
141871
141324
  exports2.injectDocToHtmlFragment = injectDocToHtmlFragment;
141872
141325
  exports2.injectSource = injectSource;
141873
141326
  exports2.injectStyle = injectStyle;