@ones-editor/editor 2.1.7-beta.15 → 2.1.7-beta.17

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 (44) hide show
  1. package/@ones-editor/core/src/core/command-providers/block-attributes.d.ts +2 -0
  2. package/@ones-editor/core/src/core/containers/root-container.d.ts +0 -3
  3. package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +1 -0
  4. package/@ones-editor/core/src/core/editor/index.d.ts +1 -1
  5. package/@ones-editor/core/src/core/types.d.ts +6 -0
  6. package/@ones-editor/core/src/utils/animate-scroll.d.ts +2 -0
  7. package/@ones-editor/core/src/utils/dom.d.ts +2 -2
  8. package/@ones-editor/mention/src/mention.d.ts +9 -3
  9. package/@ones-editor/mobile-helper/src/cursor-toolbar.d.ts +1 -1
  10. package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +4 -5
  11. package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +2 -4
  12. package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +3 -1
  13. package/@ones-editor/mobile-helper/src/index.d.ts +2 -1
  14. package/@ones-editor/sharedb-doc/src/types.d.ts +3 -3
  15. package/@ones-editor/table-block/src/index.d.ts +2 -5
  16. package/@ones-editor/text-commands/src/index.d.ts +0 -1
  17. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  18. package/@ones-editor/ui/src/locale/en-us.d.ts +9 -0
  19. package/@ones-editor/ui/src/locale/ja-jp.d.ts +9 -0
  20. package/@ones-editor/ui/src/locale/zh-cn.d.ts +9 -0
  21. package/@ones-editor/ui/src/providers/mobile-link-provider.d.ts +4 -1
  22. package/@ones-editor/ui/src/providers/selection-provider.d.ts +9 -0
  23. package/@ones-editor/ui/src/providers/utils/text-styles.d.ts +1 -1
  24. package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +1 -1
  25. package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +1 -1
  26. package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +1 -1
  27. package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +3 -3
  28. package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +1 -0
  29. package/@ones-editor/ui-base/src/command-bar/types.d.ts +2 -1
  30. package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
  31. package/@ones-editor/ui-base/src/index.d.ts +1 -1
  32. package/@ones-editor/ui-base/src/input/create-input.d.ts +2 -2
  33. package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +0 -1
  34. package/@ones-editor/ui-base/src/mobile-command-bar/scroll-into-view.d.ts +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +537 -607
  37. package/dist/types.d.ts +5 -4
  38. package/package.json +1 -1
  39. package/@ones-editor/text-commands/src/locale/en-us.d.ts +0 -13
  40. package/@ones-editor/text-commands/src/locale/index.d.ts +0 -1
  41. package/@ones-editor/text-commands/src/locale/ja-jp.d.ts +0 -13
  42. package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +0 -13
  43. package/@ones-editor/ui/src/providers/utils/text-commands.d.ts +0 -3
  44. /package/@ones-editor/table-block/src/commands/{table-command-provider.d.ts → mobile-command-provider.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -148,6 +148,7 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
148
148
  div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.text.link:hover, div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.inputting-insertion.link:hover {
149
149
  cursor: pointer;
150
150
  color: #0053cf;
151
+ text-decoration: underline;
151
152
  }
152
153
  div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.text.link.style-strikethrough:hover, div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.inputting-insertion.link.style-strikethrough:hover {
153
154
  text-decoration: underline line-through;
@@ -425,7 +426,6 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
425
426
  height: 100vh;
426
427
  z-index: 9900;
427
428
  overflow: hidden;
428
- overscroll-behavior: contain;
429
429
  }
430
430
  div.editor-root > div.editor-content > div[data-type=editor-container] > div.container-blocks > div[data-type=editor-block][data-document-title] {
431
431
  font-size: 36px;
@@ -1217,7 +1217,6 @@ div.tippy-box button {
1217
1217
  max-width: 100%;
1218
1218
  border-radius: 8px 8px 0px 0px;
1219
1219
  box-shadow: 0px 0px 8px 0px rgba(45, 45, 46, 0.1019607843);
1220
- overscroll-behavior: contain;
1221
1220
  }
1222
1221
  div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar {
1223
1222
  display: flex;
@@ -2042,12 +2041,6 @@ div.tippy-box[data-theme=editor-tooltip] > .tippy-content {
2042
2041
  :root div.tippy-box[data-theme=editor-tooltip] > .tippy-content > div > span:nth-of-type(2) {
2043
2042
  font-weight: 400;
2044
2043
  }
2045
- [data-command-bar-id] .command-item.disabled > .color-button svg {
2046
- color: #b2bccd;
2047
- }
2048
- [data-command-bar-id] .command-item .command-item-paste.disabled {
2049
- color: #c7c7c7;
2050
- }
2051
2044
  [data-command-bar-id=cursor-toolbar].mobile .tippy-box,
2052
2045
  [data-command-bar-id=paste-special-button].mobile .tippy-box,
2053
2046
  [data-command-bar-id=editor-toolbar].mobile .tippy-box {
@@ -2664,6 +2657,12 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
2664
2657
  div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.math-box .mathjax-tex-text.mathjax-error {
2665
2658
  color: var(--color-0);
2666
2659
  }
2660
+ div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] img.mathjax {
2661
+ -webkit-touch-callout: none;
2662
+ }
2663
+ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] img.mathjax {
2664
+ -webkit-touch-callout: default;
2665
+ }
2667
2666
  div.editor-root div.editor-content div[data-type=editor-container] .embed-block.selected[data-embed-type=math] > div[data-type=block-content].mathjax-overflow::before {
2668
2667
  width: var(--mathjax-width, "100%");
2669
2668
  }
@@ -4689,10 +4688,6 @@ div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content butt
4689
4688
  div[data-command-bar-id=table-cell-menu] .tippy-box .tippy-content .editor-command-bar.menu .command-item.selected[data-id=delete-select-row], div[data-command-bar-id=table-cell-menu] .tippy-box .tippy-content .editor-command-bar.menu .command-item.selected[data-id=delete-select-col] {
4690
4689
  color: #eb3723;
4691
4690
  background-color: #fff6f5;
4692
- }
4693
- .editor-root.mobile [data-type=editor-container].root div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root,
4694
- .editor-root.mobile [data-type=editor-container].root div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root {
4695
- display: none;
4696
4691
  }.editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-anchor[data-id=paste-special-button-anchor] {
4697
4692
  z-index: unset;
4698
4693
  }
@@ -5858,7 +5853,7 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
5858
5853
  div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content {
5859
5854
  height: 400px;
5860
5855
  overflow-y: auto;
5861
- overscroll-behavior: contain;
5856
+ overscroll-behavior: none;
5862
5857
  }
5863
5858
  div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content .mobile-item {
5864
5859
  display: flex;
@@ -6446,11 +6441,16 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
6446
6441
  width: 100%;
6447
6442
  display: flex;
6448
6443
  align-items: center;
6449
- border-top: 1px solid #DFE1E5;
6444
+ border-top: 1px solid #dfe1e5;
6450
6445
  }
6451
6446
  .command-m-bar > .editor-command-bar-root {
6447
+ scrollbar-width: none;
6452
6448
  padding: 0px;
6453
6449
  overflow-x: auto;
6450
+ overscroll-behavior: none;
6451
+ }
6452
+ .command-m-bar > .editor-command-bar-root::-webkit-scrollbar {
6453
+ display: none;
6454
6454
  }
6455
6455
  .command-m-bar > .editor-command-bar-root.overflowing::after {
6456
6456
  content: "";
@@ -6458,7 +6458,7 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
6458
6458
  top: 0;
6459
6459
  right: 0;
6460
6460
  bottom: 0;
6461
- width: 10px;
6461
+ width: 18px;
6462
6462
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgb(255, 255, 255));
6463
6463
  z-index: 1;
6464
6464
  pointer-events: none;
@@ -6469,7 +6469,7 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
6469
6469
  top: 0;
6470
6470
  left: 0;
6471
6471
  bottom: 0;
6472
- width: 10px;
6472
+ width: 18px;
6473
6473
  background: linear-gradient(90deg, rgb(255, 255, 255) 0, rgba(255, 255, 255, 0));
6474
6474
  z-index: 1;
6475
6475
  pointer-events: none;
@@ -6477,69 +6477,6 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
6477
6477
  .command-m-bar > .editor-command-bar-root > .editor-command-bar {
6478
6478
  width: max-content;
6479
6479
  max-width: max-content;
6480
- }
6481
- .command-m-bar .command-m-container {
6482
- display: flex;
6483
- }
6484
- .command-m-bar .child-layout {
6485
- height: 280px;
6486
- width: 100%;
6487
- display: flex;
6488
- display: none;
6489
- padding-top: 20px;
6490
- position: relative;
6491
- }
6492
- .command-m-bar .child-layout.card {
6493
- flex-wrap: wrap;
6494
- gap: 15px;
6495
- justify-content: flex-start;
6496
- }
6497
- .command-m-bar .child-layout.card .child-item {
6498
- width: 80px;
6499
- height: 80px;
6500
- display: flex;
6501
- align-items: center;
6502
- justify-content: center;
6503
- border: 1px solid #ccc;
6504
- }
6505
- .command-m-bar .child-layout.menu {
6506
- flex-direction: column;
6507
- }
6508
- .command-m-bar .child-layout.menu .child-item {
6509
- width: 100%;
6510
- height: 32px;
6511
- line-height: 32px;
6512
- }
6513
- .command-m-bar .child-layout.menu .child-layout-close {
6514
- position: absolute;
6515
- right: 20px;
6516
- top: 20px;
6517
- }
6518
- .top-command-m-bar {
6519
- position: fixed;
6520
- z-index: 111;
6521
- top: 0px;
6522
- display: flex;
6523
- flex-direction: column;
6524
- align-items: center;
6525
- background-color: antiquewhite;
6526
- padding: 0 20px;
6527
- width: 100%;
6528
- }
6529
- .top-command-m-bar .command-m-container {
6530
- display: flex;
6531
- width: 100%;
6532
- }
6533
- .top-command-m-bar .command-m-container .command-item {
6534
- width: 80px;
6535
- height: 40px;
6536
- display: flex;
6537
- align-items: center;
6538
- justify-content: center;
6539
- }
6540
- html, body {
6541
- height: 100%;
6542
- overscroll-behavior: contain;
6543
6480
  }[data-command-bar-id=editor-toolbar] .editor-content div[data-type=editor-block] div[data-type=block-tools] div.select-handle,
6544
6481
  .editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] div.select-handle {
6545
6482
  position: absolute;
@@ -7877,7 +7814,7 @@ var __publicField = (obj, key, value) => {
7877
7814
  loggerClass.set(category, instance);
7878
7815
  return instance;
7879
7816
  }
7880
- const enUS$z = {
7817
+ const enUS$y = {
7881
7818
  name: "ONES Editor",
7882
7819
  date: {
7883
7820
  dateFromFuture: "From the future",
@@ -7897,7 +7834,7 @@ var __publicField = (obj, key, value) => {
7897
7834
  imageExportFailed: "Failed to load image"
7898
7835
  }
7899
7836
  };
7900
- const zhCN$z = {
7837
+ const zhCN$y = {
7901
7838
  name: "Ones Editor",
7902
7839
  date: {
7903
7840
  dateFromFuture: "\u6765\u81EA\u672A\u6765",
@@ -7917,7 +7854,7 @@ var __publicField = (obj, key, value) => {
7917
7854
  imageExportFailed: "\u56FE\u7247\u52A0\u8F7D\u5931\u8D25"
7918
7855
  }
7919
7856
  };
7920
- const jaJP$z = {
7857
+ const jaJP$y = {
7921
7858
  name: "ONES \u30A8\u30C7\u30A3\u30BF\u30FC",
7922
7859
  date: {
7923
7860
  dateFromFuture: "\u672A\u6765\u304B\u3089",
@@ -7939,9 +7876,9 @@ var __publicField = (obj, key, value) => {
7939
7876
  };
7940
7877
  const logger$4D = getLogger("i18n");
7941
7878
  const langs$3 = {
7942
- "en-US": enUS$z,
7943
- "zh-CN": zhCN$z,
7944
- "ja-JP": jaJP$z
7879
+ "en-US": enUS$y,
7880
+ "zh-CN": zhCN$y,
7881
+ "ja-JP": jaJP$y
7945
7882
  };
7946
7883
  const i18n = KiwiIntl__default.default.init("en-US", langs$3);
7947
7884
  let currentLang = "en-US";
@@ -9032,23 +8969,25 @@ var __publicField = (obj, key, value) => {
9032
8969
  return mouseEvent;
9033
8970
  }
9034
8971
  function ensureIsMobileEvent(events2) {
9035
- return events2 instanceof TouchEvent;
8972
+ return events2.type.startsWith("touch");
9036
8973
  }
9037
- function bindDbClick(elem, handler) {
9038
- let touchTime = 0;
9039
- const callback = (event) => {
9040
- if (touchTime === 0) {
9041
- touchTime = new Date().getTime();
9042
- } else {
9043
- if (new Date().getTime() - touchTime < 800) {
9044
- handler(event);
9045
- }
9046
- touchTime = 0;
8974
+ function bindDbClick(editor, elem, handler) {
8975
+ let clickCount = 0;
8976
+ function simulateDoubleClick(event) {
8977
+ editor.focus();
8978
+ clickCount++;
8979
+ if (clickCount === 1) {
8980
+ setTimeout(() => {
8981
+ if (clickCount === 2) {
8982
+ handler(event);
8983
+ }
8984
+ clickCount = 0;
8985
+ }, 300);
9047
8986
  }
9048
- };
9049
- elem.addEventListener("click", callback);
8987
+ }
8988
+ elem.addEventListener("click", simulateDoubleClick);
9050
8989
  return () => {
9051
- elem.removeEventListener("click", callback);
8990
+ elem.removeEventListener("click", simulateDoubleClick);
9052
8991
  };
9053
8992
  }
9054
8993
  class ScrollDomElement {
@@ -9157,7 +9096,7 @@ var __publicField = (obj, key, value) => {
9157
9096
  verticalOffset: 0
9158
9097
  };
9159
9098
  async function animateScrollTo(numberOrCoordsOrElement, userOptions = {}) {
9160
- var _a, _b;
9099
+ var _a, _b, _c, _d;
9161
9100
  if (!WINDOW_EXISTS) {
9162
9101
  return new Promise((resolve) => {
9163
9102
  resolve(false);
@@ -9224,10 +9163,11 @@ var __publicField = (obj, key, value) => {
9224
9163
  const maxVerticalScroll = elementToScroll.getMaxVerticalScroll();
9225
9164
  const initialVerticalScroll = elementToScroll.getVerticalScroll();
9226
9165
  if (!options.verticalOffset) {
9166
+ const clientHeight = (_d = (_c = options.getClientHeight) == null ? void 0 : _c.call(options)) != null ? _d : elementToScroll.getClientHeight();
9227
9167
  if (initialVerticalScroll < y) {
9228
- y -= elementToScroll.getClientHeight() * 3 / 4;
9168
+ y -= clientHeight * 3 / 4;
9229
9169
  } else {
9230
- y -= elementToScroll.getClientHeight() * 1 / 4;
9170
+ y -= clientHeight * 1 / 4;
9231
9171
  }
9232
9172
  }
9233
9173
  if (y > maxVerticalScroll) {
@@ -9966,6 +9906,11 @@ var __publicField = (obj, key, value) => {
9966
9906
  });
9967
9907
  }
9968
9908
  function select(element) {
9909
+ const preventDefault = (event) => {
9910
+ event.preventDefault();
9911
+ event.stopPropagation();
9912
+ };
9913
+ document.addEventListener("selectionchange", preventDefault, { capture: true, passive: false });
9969
9914
  if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
9970
9915
  element.select();
9971
9916
  } else {
@@ -9975,6 +9920,9 @@ var __publicField = (obj, key, value) => {
9975
9920
  selection == null ? void 0 : selection.removeAllRanges();
9976
9921
  selection == null ? void 0 : selection.addRange(range);
9977
9922
  }
9923
+ setTimeout(() => {
9924
+ document.removeEventListener("selectionchange", preventDefault, { capture: true });
9925
+ });
9978
9926
  }
9979
9927
  async function copyTextToClipboard(text2) {
9980
9928
  const textarea2 = document.createElement("textarea");
@@ -11268,17 +11216,14 @@ var __publicField = (obj, key, value) => {
11268
11216
  __publicField(this, "isMoved", false);
11269
11217
  __publicField(this, "mouseDownEvent", null);
11270
11218
  __publicField(this, "dbClickRef", null);
11271
- __publicField(this, "isMove", false);
11272
- __publicField(this, "handleTouchMove", (e2) => {
11273
- this.isMove = true;
11274
- });
11275
- __publicField(this, "handleTouchEnd", (e2) => {
11276
- if (this.isMove) {
11277
- e2.stopPropagation();
11278
- }
11279
- this.isMove = false;
11280
- });
11281
11219
  __publicField(this, "handleContextMenu", (event) => {
11220
+ if (clientType.isMobile) {
11221
+ event.preventDefault();
11222
+ if (clientType.isAndroid) {
11223
+ this.editor.focus();
11224
+ }
11225
+ return;
11226
+ }
11282
11227
  if (clientType.isSafari) {
11283
11228
  const sel = document.getSelection();
11284
11229
  if (sel && !sel.isCollapsed) {
@@ -11303,7 +11248,7 @@ var __publicField = (obj, key, value) => {
11303
11248
  if (event.detail === 1) {
11304
11249
  this.editor.input.focus();
11305
11250
  }
11306
- if (event.detail === 3) {
11251
+ if (event.detail === 3 && !clientType.isMobile) {
11307
11252
  this.editor.selectionHandler.handleTripleClick(event);
11308
11253
  }
11309
11254
  if (event.detail === 1 && event.button === 0) {
@@ -11420,17 +11365,15 @@ var __publicField = (obj, key, value) => {
11420
11365
  const container = this.editor.rootElement;
11421
11366
  if (clientType.isMobile) {
11422
11367
  container.ontouchend = this.handleMouseDown;
11423
- window.addEventListener("touchmove", this.handleTouchMove);
11424
- window.addEventListener("touchend", this.handleTouchEnd, true);
11425
11368
  } else {
11426
11369
  container.onmousedown = this.handleMouseDown;
11427
- container.oncontextmenu = this.handleContextMenu;
11428
11370
  }
11429
11371
  if (clientType.isIOS) {
11430
- this.dbClickRef = bindDbClick(container, this.handleDblClick);
11372
+ this.dbClickRef = bindDbClick(this.editor, container, this.handleDblClick);
11431
11373
  } else {
11432
11374
  container.ondblclick = this.handleDblClick;
11433
11375
  }
11376
+ container.oncontextmenu = this.handleContextMenu;
11434
11377
  container.onclick = this.handleClick;
11435
11378
  }
11436
11379
  unbindEvents() {
@@ -11441,8 +11384,6 @@ var __publicField = (obj, key, value) => {
11441
11384
  container.onclick = null;
11442
11385
  container.oncontextmenu = null;
11443
11386
  container.ontouchend = null;
11444
- window.removeEventListener("touchmove", this.handleTouchMove);
11445
- window.removeEventListener("touchend", this.handleTouchEnd, true);
11446
11387
  if (this.dbClickRef) {
11447
11388
  this.dbClickRef();
11448
11389
  this.dbClickRef = null;
@@ -14133,7 +14074,6 @@ var __publicField = (obj, key, value) => {
14133
14074
  const blockRect = block.getBoundingClientRect();
14134
14075
  const scale = getElementScale(block);
14135
14076
  const lineHeight = getLineHeight(block);
14136
- console.log(lineHeight);
14137
14077
  const background = getBlockBackground(block);
14138
14078
  Array.from(background.children).forEach((child, index2) => {
14139
14079
  if (index2 < rects.length) {
@@ -25157,7 +25097,9 @@ var __publicField = (obj, key, value) => {
25157
25097
  const x1 = rect.x < 0 ? 0 : rect.x;
25158
25098
  const y1 = rect.y < 0 ? 0 : rect.y;
25159
25099
  const x2 = rect.right > window.innerWidth ? window.innerWidth : rect.right;
25160
- const y2 = rect.bottom > window.innerHeight ? window.innerHeight : rect.bottom;
25100
+ const mobileClient = editor.options.componentsOptions.mobile;
25101
+ const innerHeight = clientType.isMobile ? mobileClient.getViewPortHeight() : window.innerHeight;
25102
+ const y2 = rect.bottom > innerHeight ? innerHeight : rect.bottom;
25161
25103
  return new DOMRect(x1, y1, x2 - x1, y2 - y1);
25162
25104
  }
25163
25105
  function isBlockPositionVisible(editor, pos) {
@@ -25200,7 +25142,8 @@ var __publicField = (obj, key, value) => {
25200
25142
  const rect = target.getBoundingClientRect();
25201
25143
  return rect.right > visibleRect.right || rect.left < visibleRect.left;
25202
25144
  }
25203
- function scrollIntoView$1(editor, target, options) {
25145
+ function scrollIntoView(editor, target, options) {
25146
+ var _a;
25204
25147
  if (!target) {
25205
25148
  return;
25206
25149
  }
@@ -25212,10 +25155,12 @@ var __publicField = (obj, key, value) => {
25212
25155
  disableHorizontal: false
25213
25156
  });
25214
25157
  }
25158
+ const mobileClient = editor.options.componentsOptions.mobile;
25215
25159
  animateScrollTo(target, {
25216
- elementToScroll: getScrollContainer$1(target),
25160
+ elementToScroll: (_a = options.elementToScroll) != null ? _a : getScrollContainer$1(target),
25217
25161
  disableHorizontal: true,
25218
- verticalOffset: options == null ? void 0 : options.verticalOffset
25162
+ verticalOffset: options == null ? void 0 : options.verticalOffset,
25163
+ getClientHeight: mobileClient && clientType.isMobile ? mobileClient.getViewPortHeight : void 0
25219
25164
  });
25220
25165
  } else if (target.scrollIntoView) {
25221
25166
  target.scrollIntoView({
@@ -25264,10 +25209,10 @@ var __publicField = (obj, key, value) => {
25264
25209
  const delayEmbedBlockTypes = ["image"];
25265
25210
  if (delayEmbedBlockTypes.includes(getEmbedType(block))) {
25266
25211
  setTimeout(() => {
25267
- scrollIntoView$1(editor, next2, { animation: true });
25212
+ scrollIntoView(editor, next2, { animation: true });
25268
25213
  }, 500);
25269
25214
  } else {
25270
- scrollIntoView$1(editor, next2, { animation: true });
25215
+ scrollIntoView(editor, next2, { animation: true });
25271
25216
  }
25272
25217
  return;
25273
25218
  }
@@ -25278,7 +25223,7 @@ var __publicField = (obj, key, value) => {
25278
25223
  const anchorElem = createElement("div", ["editor-block-anchor"], tools);
25279
25224
  const scale = getElementScale(block);
25280
25225
  anchorElem.style.top = `${(rect.top - blockRect.top) / scale}px`;
25281
- scrollIntoView$1(editor, anchorElem, { animation: true });
25226
+ scrollIntoView(editor, anchorElem, { animation: true });
25282
25227
  setTimeout(() => {
25283
25228
  anchorElem.remove();
25284
25229
  }, 200);
@@ -30623,14 +30568,23 @@ ${codeText}
30623
30568
  constructor(editor) {
30624
30569
  __publicField(this, "textBlockAttributes", /* @__PURE__ */ new Map());
30625
30570
  __publicField(this, "activeBlockAttributes", /* @__PURE__ */ new Map());
30571
+ __publicField(this, "lastRange");
30626
30572
  __publicField(this, "clear", () => {
30627
30573
  this.activeBlockAttributes.clear();
30628
30574
  });
30575
+ __publicField(this, "handleSelectionChanged", () => {
30576
+ var _a, _b, _c, _d;
30577
+ const range = this.editor.selection.range;
30578
+ if (range.isSimple() && ((_a = this.lastRange) == null ? void 0 : _a.start.blockId) === range.start.blockId && ((_b = this.lastRange) == null ? void 0 : _b.end.blockId) === range.end.blockId && ((_c = this.lastRange) == null ? void 0 : _c.start.offset) === range.start.offset && ((_d = this.lastRange) == null ? void 0 : _d.end.offset) === range.end.offset) {
30579
+ return;
30580
+ }
30581
+ this.clear();
30582
+ });
30629
30583
  __publicField(this, "setActiveBlockAttributes", (attributes) => {
30630
30584
  Array.from(this.activeBlockAttributes).forEach(([key, value]) => {
30631
30585
  const op = { attributes, insert: "" };
30632
30586
  if (key === "color" || key === "backgroundColor") {
30633
- if (!value) {
30587
+ if (value === null || value === void 0) {
30634
30588
  deleteColor(op, key);
30635
30589
  } else {
30636
30590
  addColor(op, key, value);
@@ -30652,11 +30606,11 @@ ${codeText}
30652
30606
  });
30653
30607
  this.editor = editor;
30654
30608
  this.editor.addListener("docChanged", this.clear);
30655
- this.editor.addListener("selectionChanged", this.clear);
30609
+ this.editor.addListener("selectionChanged", this.handleSelectionChanged);
30656
30610
  }
30657
30611
  destroy() {
30658
30612
  this.editor.removeListener("docChanged", this.clear);
30659
- this.editor.removeListener("selectionChanged", this.clear);
30613
+ this.editor.removeListener("selectionChanged", this.handleSelectionChanged);
30660
30614
  }
30661
30615
  getEmptyBlockTextAttributes(blockId) {
30662
30616
  var _a;
@@ -38207,7 +38161,7 @@ ${codeText}
38207
38161
  var _a, _b;
38208
38162
  if ((_a = this.options) == null ? void 0 : _a.uploadResource) {
38209
38163
  try {
38210
- const ret2 = await this.options.uploadResource(file2, options);
38164
+ const ret2 = await this.options.uploadResource(this, file2, options);
38211
38165
  return ret2;
38212
38166
  } catch (err) {
38213
38167
  }
@@ -38221,7 +38175,7 @@ ${codeText}
38221
38175
  buildResourceUrl(resourceId, options) {
38222
38176
  var _a;
38223
38177
  if ((_a = this.options) == null ? void 0 : _a.buildResourceUrl) {
38224
- const ret = this.options.buildResourceUrl(resourceId, options);
38178
+ const ret = this.options.buildResourceUrl(this, resourceId, options);
38225
38179
  if (ret) {
38226
38180
  return ret;
38227
38181
  }
@@ -38918,7 +38872,7 @@ ${codeText}
38918
38872
  handler.removeListener("insert", callback);
38919
38873
  }
38920
38874
  const style$e = "";
38921
- const zhCN$y = {
38875
+ const zhCN$x = {
38922
38876
  colorPalette: {
38923
38877
  colorDesc: "\u5B57\u4F53\u989C\u8272",
38924
38878
  name: "\u6587\u672C\u989C\u8272",
@@ -38950,7 +38904,7 @@ ${codeText}
38950
38904
  emptyTips: "\u6682\u65E0\u641C\u7D22\u7ED3\u679C"
38951
38905
  }
38952
38906
  };
38953
- const enUS$y = {
38907
+ const enUS$x = {
38954
38908
  colorPalette: {
38955
38909
  colorDesc: "Text color",
38956
38910
  name: "Text color",
@@ -38982,7 +38936,7 @@ ${codeText}
38982
38936
  emptyTips: "No results found"
38983
38937
  }
38984
38938
  };
38985
- const jaJP$y = {
38939
+ const jaJP$x = {
38986
38940
  colorPalette: {
38987
38941
  colorDesc: "\u30D5\u30A9\u30F3\u30C8\u306E\u8272",
38988
38942
  name: "\u30C6\u30AD\u30B9\u30C8\u306E\u8272",
@@ -39015,9 +38969,9 @@ ${codeText}
39015
38969
  }
39016
38970
  };
39017
38971
  i18n$1.mergeLang({
39018
- "zh-CN": zhCN$y,
39019
- "en-US": enUS$y,
39020
- "ja-JP": jaJP$y
38972
+ "zh-CN": zhCN$x,
38973
+ "en-US": enUS$x,
38974
+ "ja-JP": jaJP$x
39021
38975
  });
39022
38976
  const button = "";
39023
38977
  getLogger("button");
@@ -39449,16 +39403,7 @@ ${codeText}
39449
39403
  disablePageScroll(this.id);
39450
39404
  }
39451
39405
  });
39452
- __publicField(this, "clearSelectedItem", debounce__default.default(() => {
39453
- const item = this.getSelectedItem();
39454
- if (!item) {
39455
- return;
39456
- }
39457
- const elem = this.getItemElementById(item.id);
39458
- if (elem) {
39459
- removeClass(elem, "selected");
39460
- }
39461
- }, 200));
39406
+ __publicField(this, "debounceClearSelectedItem", debounce__default.default(this.clearSelectedItem, 200));
39462
39407
  __publicField(this, "lastEnterPauseTime", 0);
39463
39408
  __publicField(this, "startPauseMouseEnter", () => {
39464
39409
  this.lastEnterPauseTime = Date.now();
@@ -39507,9 +39452,6 @@ ${codeText}
39507
39452
  if (!item) {
39508
39453
  return;
39509
39454
  }
39510
- if (item.switchable && !(target == null ? void 0 : target.closest(".menu-item-checked-icon"))) {
39511
- return;
39512
- }
39513
39455
  const customItem = (item == null ? void 0 : item.element) && !item.children;
39514
39456
  if (clientType.isMobile && !customItem) {
39515
39457
  event.preventDefault();
@@ -39519,7 +39461,7 @@ ${codeText}
39519
39461
  }
39520
39462
  if (clientType.isMobile) {
39521
39463
  this.selectItem(id);
39522
- this.clearSelectedItem();
39464
+ this.debounceClearSelectedItem();
39523
39465
  }
39524
39466
  if (item.children && item.children.length > 0 && item.manualShowChildren) {
39525
39467
  let showSubBar = false;
@@ -39701,6 +39643,16 @@ ${codeText}
39701
39643
  }
39702
39644
  }
39703
39645
  }
39646
+ clearSelectedItem() {
39647
+ const item = this.getSelectedItem();
39648
+ if (!item) {
39649
+ return;
39650
+ }
39651
+ const elem = this.getItemElementById(item.id);
39652
+ if (elem) {
39653
+ removeClass(elem, "selected");
39654
+ }
39655
+ }
39704
39656
  selectItem(id, from = "event") {
39705
39657
  const exists = this.getSelectedItem();
39706
39658
  if (exists) {
@@ -39962,6 +39914,10 @@ ${codeText}
39962
39914
  constructor() {
39963
39915
  super(...arguments);
39964
39916
  __publicField(this, "tippyInstance", null);
39917
+ __publicField(this, "setProps", (props) => {
39918
+ var _a;
39919
+ (_a = this.tippyInstance) == null ? void 0 : _a.setProps(props);
39920
+ });
39965
39921
  }
39966
39922
  manualShow(target, options) {
39967
39923
  var _a, _b, _c;
@@ -40530,7 +40486,11 @@ ${codeText}
40530
40486
  });
40531
40487
  parent.appendChild(this.content);
40532
40488
  document.addEventListener("keydown", this.handleDocumentKeydown);
40533
- document.addEventListener("mousedown", this.handleDocumentMouseDown);
40489
+ if (clientType.isMobile) {
40490
+ document.addEventListener("touchend", this.handleDocumentMouseDown);
40491
+ } else {
40492
+ document.addEventListener("mousedown", this.handleDocumentMouseDown);
40493
+ }
40534
40494
  }
40535
40495
  initCommandBarElement(elem) {
40536
40496
  addClass(elem, "toolbar", "fixed");
@@ -40556,6 +40516,7 @@ ${codeText}
40556
40516
  super.destroy();
40557
40517
  document.removeEventListener("keydown", this.handleDocumentKeydown);
40558
40518
  document.removeEventListener("mousedown", this.handleDocumentMouseDown);
40519
+ document.removeEventListener("touchend", this.handleDocumentMouseDown);
40559
40520
  }
40560
40521
  getCommandBarRoot() {
40561
40522
  return this.content.parentElement;
@@ -40575,7 +40536,7 @@ ${codeText}
40575
40536
  disablePageScroll: true,
40576
40537
  ...options
40577
40538
  });
40578
- __publicField(this, "handleDocumentMouseDown", (event) => {
40539
+ __publicField(this, "handleDocumentMouseDown", () => {
40579
40540
  });
40580
40541
  }
40581
40542
  initCommandBarElement(elem) {
@@ -40728,7 +40689,7 @@ ${codeText}
40728
40689
  });
40729
40690
  this.clearSelectedItem();
40730
40691
  document.addEventListener("keydown", this.handleDocumentKeydown);
40731
- document.addEventListener("mousedown", this.handleDocumentMouseDown);
40692
+ document.addEventListener("touchend", this.handleDocumentMouseDown);
40732
40693
  setTimeout(() => {
40733
40694
  var _a2, _b2;
40734
40695
  const rect = document.body.clientHeight;
@@ -40741,22 +40702,6 @@ ${codeText}
40741
40702
  }
40742
40703
  }, 200);
40743
40704
  });
40744
- __publicField(this, "getSubBarOptions", (item) => {
40745
- var _a, _b;
40746
- const getReferenceClientRect2 = () => {
40747
- const elem = this.getItemElementById(item.id);
40748
- const content = this.content;
40749
- const contentRect = content.getBoundingClientRect();
40750
- const elemRect = elem.getBoundingClientRect();
40751
- return new DOMRect(elemRect.left, contentRect.top, elemRect.width, contentRect.height);
40752
- };
40753
- const options = {
40754
- placement: (_a = item.childrenPlacement) != null ? _a : "top",
40755
- getReferenceClientRect: getReferenceClientRect2,
40756
- offset: (_b = item.childrenOffset) != null ? _b : [0, 4]
40757
- };
40758
- return options;
40759
- });
40760
40705
  }
40761
40706
  close(reason) {
40762
40707
  var _a;
@@ -40770,6 +40715,8 @@ ${codeText}
40770
40715
  (_a = this.tippyInstance) == null ? void 0 : _a.destroy();
40771
40716
  this.tippyInstance = null;
40772
40717
  super.destroy();
40718
+ document.removeEventListener("keydown", this.handleDocumentKeydown);
40719
+ document.removeEventListener("touchend", this.handleDocumentMouseDown);
40773
40720
  }
40774
40721
  get isVisible() {
40775
40722
  var _a, _b;
@@ -41450,9 +41397,7 @@ ${codeText}
41450
41397
  this.errorContent.innerText = error2;
41451
41398
  });
41452
41399
  __publicField(this, "focus", () => {
41453
- setTimeout(() => {
41454
- this.input.focus();
41455
- }, 200);
41400
+ this.input.focus();
41456
41401
  });
41457
41402
  __publicField(this, "handleKeyDown", (e2, composing) => {
41458
41403
  var _a, _b;
@@ -41470,6 +41415,11 @@ ${codeText}
41470
41415
  removeClass(this.input, "has-suffix");
41471
41416
  }
41472
41417
  });
41418
+ __publicField(this, "reset", () => {
41419
+ this.input.value = "";
41420
+ removeClass(this.container, "error");
41421
+ this.hideSuffix();
41422
+ });
41473
41423
  __publicField(this, "handleInput", (e2) => {
41474
41424
  var _a, _b;
41475
41425
  (_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, e2);
@@ -42401,15 +42351,22 @@ ${codeText}
42401
42351
  return new EmojiItem();
42402
42352
  }
42403
42353
  }
42404
- const scrollIntoView = (bar2, editor) => {
42354
+ const scrollBarIntoView = (editor, bar2) => {
42405
42355
  var _a;
42406
42356
  const activeRect = getBlockClientRects(editor, editor.selection.endBlock, editor.selection.range);
42407
42357
  const popperRect = (_a = bar2.popper) == null ? void 0 : _a.getBoundingClientRect();
42408
42358
  if (popperRect) {
42409
42359
  const bottom = activeRect.reduce((acc, cur) => acc > cur.bottom ? acc : cur.bottom, 0);
42410
42360
  if (bottom > popperRect.top) {
42411
- const scrollContainer = editor.scrollContainer;
42412
- scrollContainer.scrollTop += bottom - popperRect.top + 20;
42361
+ const scrollContainer2 = editor.scrollContainer;
42362
+ scrollContainer2.scrollTop += bottom - popperRect.top + 20;
42363
+ return;
42364
+ }
42365
+ const top = activeRect.reduce((acc, cur) => acc < cur.top ? acc : cur.top, Infinity);
42366
+ const scrollContainer = editor.scrollContainer;
42367
+ const containerRect = scrollContainer.getBoundingClientRect();
42368
+ if (top < containerRect.top) {
42369
+ scrollContainer.scrollTop -= containerRect.top - top + 20;
42413
42370
  }
42414
42371
  }
42415
42372
  };
@@ -44474,44 +44431,19 @@ ${codeText}
44474
44431
  if (getBlockType(block) !== "table" || clientType.isMobile) {
44475
44432
  return [];
44476
44433
  }
44477
- const ext = {
44478
- blockId: getBlockId(block),
44479
- blockKind: getBlockKind(editor, block),
44480
- blockType: getBlockType(block)
44481
- };
44482
44434
  const commands = [];
44483
- const { selectedColumns, selectedRows } = getTableSelectedRowsAndColumns(editor, block);
44484
- if (clientType.isMobile) {
44485
- if (selectedColumns.size > 0) {
44486
- commands.push({
44487
- id: "table/delete-columns",
44488
- name: i18n$1.t("table.deleteSelectCol"),
44489
- icon: DeleteColIcon,
44490
- ...ext
44491
- });
44492
- } else if (selectedRows.size > 0) {
44493
- commands.push({
44494
- id: "table/delete-rows",
44495
- name: i18n$1.t("table.deleteSelectRow"),
44496
- icon: DeleteRowIcon,
44497
- ...ext
44498
- });
44499
- }
44500
- }
44501
44435
  if (canMergeCells(editor, block, range)) {
44502
44436
  commands.push({
44503
44437
  id: "table/merge-cells",
44504
44438
  name: i18n$1.t("table.mergeCell"),
44505
- icon: MergeCellIcon,
44506
- ...ext
44439
+ icon: MergeCellIcon
44507
44440
  });
44508
44441
  }
44509
44442
  if (canSplitCell(editor, block, range)) {
44510
44443
  commands.push({
44511
44444
  id: "table/split-cell",
44512
44445
  name: i18n$1.t("table.splitCell"),
44513
- icon: SplitCellIcon,
44514
- ...ext
44446
+ icon: SplitCellIcon
44515
44447
  });
44516
44448
  }
44517
44449
  const deleteColumns2 = canDeleteColumns(editor, block, range);
@@ -44520,8 +44452,7 @@ ${codeText}
44520
44452
  commands.push({
44521
44453
  id: "table/delete",
44522
44454
  name: i18n$1.t("table.deleteTable"),
44523
- icon: DeleteTableIcon,
44524
- ...ext
44455
+ icon: DeleteTableIcon
44525
44456
  });
44526
44457
  }
44527
44458
  return commands;
@@ -46583,28 +46514,28 @@ ${codeText}
46583
46514
  }
46584
46515
  }
46585
46516
  const exclusiveBlockStyles = "";
46586
- const zhCN$x = {
46517
+ const zhCN$w = {
46587
46518
  exclusive: {
46588
46519
  tips: "\u300C{editor}\u300D\u6B63\u5728\u7F16\u8F91\uFF0C\u300C{embedType}\u300D\u4E0D\u652F\u6301\u591A\u4EBA\u7F16\u8F91",
46589
46520
  fallbackAbstract: "\u8BE5 Block"
46590
46521
  }
46591
46522
  };
46592
- const enUS$x = {
46523
+ const enUS$w = {
46593
46524
  exclusive: {
46594
46525
  tips: "\u300C{editor}\u300Dis editing\uFF0C\u300C{embedType}\u300Ddoes not support multi-person editing",
46595
46526
  fallbackAbstract: "This Block"
46596
46527
  }
46597
46528
  };
46598
- const jaJP$x = {
46529
+ const jaJP$w = {
46599
46530
  exclusive: {
46600
46531
  tips: "\u300C{editor}\u300D\u306F\u7DE8\u96C6\u4E2D\u3067\u3059\u3002\u300C{embedType}\u300D\u306F\u8907\u6570\u4EBA\u3067\u540C\u6642\u7DE8\u96C6\u3067\u304D\u307E\u305B\u3093",
46601
46532
  fallbackAbstract: "\u3053\u306E\u8981\u7D20"
46602
46533
  }
46603
46534
  };
46604
46535
  i18n$1.mergeLang({
46605
- "zh-CN": zhCN$x,
46606
- "en-US": enUS$x,
46607
- "ja-JP": jaJP$x
46536
+ "zh-CN": zhCN$w,
46537
+ "en-US": enUS$w,
46538
+ "ja-JP": jaJP$w
46608
46539
  });
46609
46540
  function getBlockInfo(editor, block) {
46610
46541
  const data2 = editor.getBlockData(block);
@@ -46781,21 +46712,21 @@ ${codeText}
46781
46712
  }
46782
46713
  }
46783
46714
  const style$c = "";
46784
- const zhCN$w = {
46715
+ const zhCN$v = {
46785
46716
  locker: {
46786
46717
  lock: "\u9501\u5B9A",
46787
46718
  unlock: "\u89E3\u9664\u9501\u5B9A",
46788
46719
  lockedBy: "\u88AB {name} \u9501\u5B9A"
46789
46720
  }
46790
46721
  };
46791
- const enUS$w = {
46722
+ const enUS$v = {
46792
46723
  locker: {
46793
46724
  lock: "Lock",
46794
46725
  unlock: "Unlock",
46795
46726
  lockedBy: "Locked by {name}"
46796
46727
  }
46797
46728
  };
46798
- const jaJP$w = {
46729
+ const jaJP$v = {
46799
46730
  locker: {
46800
46731
  lock: "\u30ED\u30C3\u30AF",
46801
46732
  unlock: "\u30ED\u30C3\u30AF\u89E3\u9664",
@@ -46803,9 +46734,9 @@ ${codeText}
46803
46734
  }
46804
46735
  };
46805
46736
  i18n$1.mergeLang({
46806
- "zh-CN": zhCN$w,
46807
- "en-US": enUS$w,
46808
- "ja-JP": jaJP$w
46737
+ "zh-CN": zhCN$v,
46738
+ "en-US": enUS$v,
46739
+ "ja-JP": jaJP$v
46809
46740
  });
46810
46741
  class BlockLockerPasteHandler {
46811
46742
  async handleBeforePasteDoc(editor, doc2) {
@@ -46918,10 +46849,11 @@ ${codeText}
46918
46849
  element: this.createPasteElement(editor),
46919
46850
  states: []
46920
46851
  };
46921
- const items = [cutItem, copyItem];
46852
+ const items = [copyItem];
46922
46853
  if (this.options.withPaste) {
46923
46854
  items.push(pasteItem);
46924
46855
  }
46856
+ items.push(cutItem);
46925
46857
  return items;
46926
46858
  });
46927
46859
  __publicField(this, "getInsertCommands", () => []);
@@ -49659,7 +49591,7 @@ ${codeText}
49659
49591
  }
49660
49592
  return blockContent;
49661
49593
  }
49662
- const zhCN$v = {
49594
+ const zhCN$u = {
49663
49595
  list: {
49664
49596
  confirm: "\u786E\u5B9A",
49665
49597
  setStart: "\u8BBE\u7F6E\u7F16\u53F7",
@@ -49679,7 +49611,7 @@ ${codeText}
49679
49611
  exitFullscreen: "\u9000\u51FA\u5168\u5C4F"
49680
49612
  }
49681
49613
  };
49682
- const enUS$v = {
49614
+ const enUS$u = {
49683
49615
  list: {
49684
49616
  confirm: "Confirm",
49685
49617
  setStart: "Set number",
@@ -49699,7 +49631,7 @@ ${codeText}
49699
49631
  exitFullscreen: "Exit full screen"
49700
49632
  }
49701
49633
  };
49702
- const jaJP$v = {
49634
+ const jaJP$u = {
49703
49635
  list: {
49704
49636
  confirm: "OK",
49705
49637
  setStart: "\u756A\u53F7\u3092\u8A2D\u5B9A",
@@ -49720,9 +49652,9 @@ ${codeText}
49720
49652
  }
49721
49653
  };
49722
49654
  i18n$1.mergeLang({
49723
- "zh-CN": zhCN$v,
49724
- "en-US": enUS$v,
49725
- "ja-JP": jaJP$v
49655
+ "zh-CN": zhCN$u,
49656
+ "en-US": enUS$u,
49657
+ "ja-JP": jaJP$u
49726
49658
  });
49727
49659
  const style$b = "";
49728
49660
  const logger$1W = getLogger("list-block:paste-handler");
@@ -50133,7 +50065,7 @@ ${codeText}
50133
50065
  this.close();
50134
50066
  });
50135
50067
  __publicField(this, "handleShown", () => {
50136
- scrollIntoView(this.linkPopup, this.editor);
50068
+ scrollBarIntoView(this.editor, this.linkPopup);
50137
50069
  });
50138
50070
  __publicField(this, "disabledSubmit", () => {
50139
50071
  var _a;
@@ -50150,6 +50082,7 @@ ${codeText}
50150
50082
  this.linkPopup.addListener("show", this.onShow);
50151
50083
  this.linkPopup.addListener("shown", this.handleShown);
50152
50084
  this.linkPopup.manualShow(target);
50085
+ tippy$1.hideAll();
50153
50086
  });
50154
50087
  this.editor = editor;
50155
50088
  this.content = content;
@@ -50260,7 +50193,7 @@ ${codeText}
50260
50193
  __publicField(this, "onShow", () => {
50261
50194
  setTimeout(() => {
50262
50195
  var _a;
50263
- (_a = this.form.linkText) == null ? void 0 : _a.getField().focus();
50196
+ (_a = this.form.linkUrl) == null ? void 0 : _a.getField().focus();
50264
50197
  }, 400);
50265
50198
  });
50266
50199
  __publicField(this, "showPopup", (options) => {
@@ -50523,7 +50456,7 @@ ${codeText}
50523
50456
  return [
50524
50457
  {
50525
50458
  id: "insert-link",
50526
- name: clientType.isMobile ? i18n$1.t("link.title") : i18n$1.t("quickMenu.inlineBox.link"),
50459
+ name: i18n$1.t("quickMenu.inlineBox.link"),
50527
50460
  icon: LinkIcon,
50528
50461
  states: [],
50529
50462
  subText: getShortcutById("insert-link")
@@ -50800,7 +50733,7 @@ ${codeText}
50800
50733
  this.clipboardProvider.executeRangeCommand(editor, range, item);
50801
50734
  });
50802
50735
  this.editor = editor;
50803
- this.clipboardProvider = new ClipboardProvider(this.editor, { withPaste: true });
50736
+ this.clipboardProvider = new ClipboardProvider(this.editor, { withPaste: false });
50804
50737
  }
50805
50738
  commands(editor, block, child) {
50806
50739
  if (!editor.isWritable()) {
@@ -50810,11 +50743,10 @@ ${codeText}
50810
50743
  return void 0;
50811
50744
  }
50812
50745
  const commands = [];
50746
+ commands.push(...this.provider.getAvailableCommands(editor, block, this.editor.selection.range, { child }));
50813
50747
  if (clientType.isMobile) {
50814
50748
  this.clipboardProvider.getAvailableCommands(editor, block).forEach((c) => commands.push(c));
50815
- commands.push({ id: "separator", name: "", type: "separator" });
50816
50749
  }
50817
- commands.push(...this.provider.getAvailableCommands(editor, block, this.editor.selection.range, { child }));
50818
50750
  return {
50819
50751
  element: child,
50820
50752
  group: "hovering-toolbar",
@@ -50868,6 +50800,33 @@ ${codeText}
50868
50800
  return false;
50869
50801
  }
50870
50802
  }
50803
+ class SelectionProvider {
50804
+ constructor(editor) {
50805
+ __publicField(this, "id", "SelectionProvider");
50806
+ __publicField(this, "getInsertCommands", () => []);
50807
+ this.editor = editor;
50808
+ }
50809
+ getAvailableCommands(editor, block, range, params) {
50810
+ const disabled = !isTextKindBlock(editor, block) || isSelectBoxOnly(editor);
50811
+ if (disabled && (params == null ? void 0 : params.isFilter)) {
50812
+ return [];
50813
+ }
50814
+ return [
50815
+ {
50816
+ name: i18n$1.t("commands.selectBlock"),
50817
+ id: "select-block",
50818
+ states: disabled ? ["disabled"] : []
50819
+ }
50820
+ ];
50821
+ }
50822
+ executeCommand(editor, block, range, command) {
50823
+ if (command.id === "select-block") {
50824
+ editor.selection.selectBlock(block, 0, getBlockTextLength$6(editor, block));
50825
+ return true;
50826
+ }
50827
+ return false;
50828
+ }
50829
+ }
50871
50830
  const logger$1S = getLogger("toolbar-handler");
50872
50831
  class OnesEditorToolbar {
50873
50832
  constructor(editor) {
@@ -51011,9 +50970,11 @@ ${codeText}
51011
50970
  OnesEditorHoveringBlock.get(editor).addFilter(this);
51012
50971
  editor.blockHooks.push(new LinkCommands(editor));
51013
50972
  if (clientType.isMobile) {
51014
- editor.editorCommandProviders.registerCommandProvider(new MobileLinkProvider(editor));
50973
+ editor.editorCommandProviders.registerCommandProvider(new MobileLinkProvider(editor, { linkMode: "edit" }));
51015
50974
  editor.editorCommandProviders.registerCommandProvider(new StandardBoxProvider(editor));
51016
50975
  editor.editorCommandProviders.registerCommandProvider(new ClipboardProvider(editor, { withPaste: true }));
50976
+ editor.editorCommandProviders.registerCommandProvider(new SelectionProvider(editor));
50977
+ editor.editorCommandProviders.registerCommandProvider(new MobileLinkProvider(editor, { linkMode: "insert" }));
51017
50978
  } else {
51018
50979
  editor.editorCommandProviders.registerCommandProvider(new BlockTurnIntoCommandProvider(editor));
51019
50980
  editor.editorCommandProviders.registerCommandProvider(new ParagraphProvider$1(editor));
@@ -51829,28 +51790,28 @@ $$${mathData.mathjaxText}$$
51829
51790
  getBlockProperties: getBlockProperties$b
51830
51791
  };
51831
51792
  const mathjaxStyle = "";
51832
- const zhCN$u = {
51793
+ const zhCN$t = {
51833
51794
  mathjax: {
51834
51795
  emptyText: "\u7A7A\u7684\u516C\u5F0F",
51835
51796
  abstract: "\u516C\u5F0F"
51836
51797
  }
51837
51798
  };
51838
- const enUS$u = {
51799
+ const enUS$t = {
51839
51800
  mathjax: {
51840
51801
  emptyText: "Empty formula",
51841
51802
  abstract: "Formula"
51842
51803
  }
51843
51804
  };
51844
- const jaJP$u = {
51805
+ const jaJP$t = {
51845
51806
  mathjax: {
51846
51807
  emptyText: "\u6570\u5F0F\u306A\u3057",
51847
51808
  abstract: "\u6570\u5F0F"
51848
51809
  }
51849
51810
  };
51850
51811
  i18n$1.mergeLang({
51851
- "zh-CN": zhCN$u,
51852
- "en-US": enUS$u,
51853
- "ja-JP": jaJP$u
51812
+ "zh-CN": zhCN$t,
51813
+ "en-US": enUS$t,
51814
+ "ja-JP": jaJP$t
51854
51815
  });
51855
51816
  function convertToMath(editor, containerId, blockIndex, offset) {
51856
51817
  const block = editor.getBlockByIndex(containerId, blockIndex);
@@ -57616,7 +57577,7 @@ $$${mathData.mathjaxText}$$
57616
57577
  }
57617
57578
  }
57618
57579
  __publicField(StatusBoxCommand, "id", "insert-status");
57619
- const enUS$t = {
57580
+ const enUS$s = {
57620
57581
  status: {
57621
57582
  empty: "Set status",
57622
57583
  command: {
@@ -57640,7 +57601,7 @@ $$${mathData.mathjaxText}$$
57640
57601
  }
57641
57602
  }
57642
57603
  };
57643
- const zhCN$t = {
57604
+ const zhCN$s = {
57644
57605
  status: {
57645
57606
  empty: "\u8BBE\u7F6E\u72B6\u6001",
57646
57607
  command: {
@@ -57664,7 +57625,7 @@ $$${mathData.mathjaxText}$$
57664
57625
  }
57665
57626
  }
57666
57627
  };
57667
- const jaJP$t = {
57628
+ const jaJP$s = {
57668
57629
  status: {
57669
57630
  empty: "\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u8A2D\u5B9A",
57670
57631
  command: {
@@ -57689,9 +57650,9 @@ $$${mathData.mathjaxText}$$
57689
57650
  }
57690
57651
  };
57691
57652
  const langs$2 = {
57692
- "en-US": enUS$t,
57693
- "zh-CN": zhCN$t,
57694
- "ja-JP": jaJP$t
57653
+ "en-US": enUS$s,
57654
+ "zh-CN": zhCN$s,
57655
+ "ja-JP": jaJP$s
57695
57656
  };
57696
57657
  i18n$1.mergeLang(langs$2);
57697
57658
  const logger$1M = getLogger("inline-box-items");
@@ -57898,7 +57859,7 @@ $$${mathData.mathjaxText}$$
57898
57859
  }
57899
57860
  });
57900
57861
  };
57901
- class InsertMenuProvider$1 extends ProxyProvider {
57862
+ class InsertMenuProvider extends ProxyProvider {
57902
57863
  constructor(editor, options) {
57903
57864
  var _a, _b, _c, _d, _e, _f, _g;
57904
57865
  super();
@@ -58080,7 +58041,7 @@ $$${mathData.mathjaxText}$$
58080
58041
  return {};
58081
58042
  });
58082
58043
  this.editor = editor;
58083
- this.registerCommandProvider(new InsertMenuProvider$1(editor, { withPlainText: false }));
58044
+ this.registerCommandProvider(new InsertMenuProvider(editor, { withPlainText: false }));
58084
58045
  }
58085
58046
  getCommands(range) {
58086
58047
  var _a, _b;
@@ -58422,8 +58383,7 @@ $$${mathData.mathjaxText}$$
58422
58383
  function getTextCommands(editor, blockCommands) {
58423
58384
  const styleCommandsSet = new Set(Object.keys(TextCommands));
58424
58385
  const styleCommands = blockCommands.filter((command) => styleCommandsSet.has(command.id));
58425
- const commands = mergeCommands(styleCommands);
58426
- return commands;
58386
+ return styleCommands;
58427
58387
  }
58428
58388
  function executeShortcut(editor, style2) {
58429
58389
  if (!editor.isWritable()) {
@@ -58477,7 +58437,7 @@ $$${mathData.mathjaxText}$$
58477
58437
  "CtrlOrCmd+K": (editor) => executeShortcut(editor, "link"),
58478
58438
  ...headingShortcut()
58479
58439
  };
58480
- const zhCN$s = {
58440
+ const zhCN$r = {
58481
58441
  quickMenu: {
58482
58442
  basic: {
58483
58443
  heading: {
@@ -58521,10 +58481,19 @@ $$${mathData.mathjaxText}$$
58521
58481
  text: "\u6B63\u6587",
58522
58482
  paste: "\u7C98\u8D34",
58523
58483
  tab: "Tab",
58524
- shiftTab: "Shift+Tab"
58484
+ shiftTab: "Shift+Tab",
58485
+ bold: "\u7C97\u4F53",
58486
+ italic: "\u659C\u4F53",
58487
+ underline: "\u4E0B\u5212\u7EBF",
58488
+ strikethrough: "\u5220\u9664\u7EBF",
58489
+ code: "\u884C\u5185\u4EE3\u7801",
58490
+ subscript: "\u4E0B\u6807",
58491
+ superscript: "\u4E0A\u6807",
58492
+ more: "\u66F4\u591A",
58493
+ selectBlock: "\u9009\u62E9\u533A\u5757"
58525
58494
  }
58526
58495
  };
58527
- const enUS$s = {
58496
+ const enUS$r = {
58528
58497
  quickMenu: {
58529
58498
  basic: {
58530
58499
  heading: {
@@ -58568,10 +58537,19 @@ $$${mathData.mathjaxText}$$
58568
58537
  text: "Text",
58569
58538
  paste: "Paste",
58570
58539
  tab: "Tab",
58571
- shiftTab: "Shift+Tab"
58540
+ shiftTab: "Shift+Tab",
58541
+ bold: "Bold",
58542
+ italic: "Italic",
58543
+ underline: "Underline",
58544
+ strikethrough: "Strikethrough",
58545
+ code: "Inline code",
58546
+ subscript: "Subscript",
58547
+ superscript: "Superscript",
58548
+ more: "More",
58549
+ selectBlock: "Select Block"
58572
58550
  }
58573
58551
  };
58574
- const jaJP$s = {
58552
+ const jaJP$r = {
58575
58553
  quickMenu: {
58576
58554
  basic: {
58577
58555
  heading: {
@@ -58615,13 +58593,22 @@ $$${mathData.mathjaxText}$$
58615
58593
  text: "\u672C\u6587",
58616
58594
  paste: "\u8CBC\u308A\u4ED8\u3051",
58617
58595
  tab: "\u30BF\u30D6",
58618
- shiftTab: "Shift+Tab"
58596
+ shiftTab: "Shift+Tab",
58597
+ bold: "\u592A\u5B57",
58598
+ italic: "\u659C\u4F53",
58599
+ underline: "\u4E0B\u7DDA",
58600
+ strikethrough: "\u53D6\u308A\u6D88\u3057\u7DDA",
58601
+ code: "\u30A4\u30F3\u30E9\u30A4\u30F3\u30B3\u30FC\u30C9",
58602
+ subscript: "\u4E0B\u4ED8\u304D\u6587\u5B57",
58603
+ superscript: "\u4E0A\u4ED8\u304D\u6587\u5B57",
58604
+ more: "\u305D\u306E\u4ED6",
58605
+ selectBlock: "\u30D6\u30ED\u30C3\u30AF\u3092\u9078\u629E"
58619
58606
  }
58620
58607
  };
58621
58608
  i18n$1.mergeLang({
58622
- "zh-CN": zhCN$s,
58623
- "en-US": enUS$s,
58624
- "ja-JP": jaJP$s
58609
+ "zh-CN": zhCN$r,
58610
+ "en-US": enUS$r,
58611
+ "ja-JP": jaJP$r
58625
58612
  });
58626
58613
  class TextStylesFixedProvider extends ProxyProvider {
58627
58614
  constructor(editor, afterCommandCallback) {
@@ -58731,7 +58718,7 @@ $$${mathData.mathjaxText}$$
58731
58718
  return false;
58732
58719
  });
58733
58720
  this.editor = editor;
58734
- this.providers = [new InsertMenuProvider$1(this.editor)];
58721
+ this.providers = [new InsertMenuProvider(this.editor)];
58735
58722
  }
58736
58723
  }
58737
58724
  class InsertAfterProvider extends ProxyProvider {
@@ -58778,7 +58765,7 @@ $$${mathData.mathjaxText}$$
58778
58765
  return false;
58779
58766
  });
58780
58767
  this.editor = editor;
58781
- this.providers = [new InsertMenuProvider$1(this.editor)];
58768
+ this.providers = [new InsertMenuProvider(this.editor)];
58782
58769
  }
58783
58770
  }
58784
58771
  class InsertGroupProvider extends ProxyProvider {
@@ -58969,7 +58956,6 @@ $$${mathData.mathjaxText}$$
58969
58956
  __publicField(this, "handleItemClick", (bar2, item) => {
58970
58957
  assert(logger$1H, this.commandBlock, "no command block before show block menu");
58971
58958
  this.blockCommandProviders.executeCommand(this.editor.selection.range, item);
58972
- this.close();
58973
58959
  });
58974
58960
  __publicField(this, "close", () => {
58975
58961
  this.menu.close("clickItem");
@@ -58977,7 +58963,8 @@ $$${mathData.mathjaxText}$$
58977
58963
  this.editor = editor;
58978
58964
  this.blockCommandProviders = new BlockCommandProviders(editor, this.close);
58979
58965
  this.menu = new ManualMenu([], void 0, {
58980
- id: "block-menu"
58966
+ id: "block-menu",
58967
+ autoClose: true
58981
58968
  });
58982
58969
  this.menu.on("show", this.handleShow);
58983
58970
  this.menu.on("close", this.handleClose);
@@ -59034,6 +59021,12 @@ $$${mathData.mathjaxText}$$
59034
59021
  }
59035
59022
  return styles1;
59036
59023
  }
59024
+ function mergeActiveStyle(editor, style2) {
59025
+ var _a;
59026
+ const attributes = Object.fromEntries(style2.entries());
59027
+ (_a = editor.findCustom("block-attributes-handler")) == null ? void 0 : _a.setActiveBlockAttributes(attributes);
59028
+ return new Map(Object.entries(attributes));
59029
+ }
59037
59030
  function applyTextStyle(editor, block, range, style2, value) {
59038
59031
  assert(logger$1G, range.isSimple(), "invalid range");
59039
59032
  const { start, end } = range;
@@ -59054,11 +59047,12 @@ $$${mathData.mathjaxText}$$
59054
59047
  editor.setBlockText(block, newText);
59055
59048
  return newText;
59056
59049
  }
59057
- function getStandardTextStyles(textStyles, text2) {
59050
+ function getStandardTextStyles(editor, textStyles, text2) {
59058
59051
  if (getTextLength(text2) === 0) {
59059
59052
  return textStyles;
59060
59053
  }
59061
- const styles = getIntersectionStyles(text2);
59054
+ let styles = getIntersectionStyles(text2);
59055
+ styles = mergeActiveStyle(editor, styles);
59062
59056
  function getTextStyle(item) {
59063
59057
  const { id, icon, desc, name } = item;
59064
59058
  const value = styles.get(id);
@@ -59102,7 +59096,7 @@ $$${mathData.mathjaxText}$$
59102
59096
  return subText2;
59103
59097
  }
59104
59098
  const logger$1F = getLogger("text-commands");
59105
- function getCommands$1(text2) {
59099
+ function getCommands$1(editor, text2) {
59106
59100
  const StandardTextStyles = {
59107
59101
  "style-bold": [i18n$1.t("commands.bold"), shortcutToDisplayText("CtrlOrCmd+B"), BoldIcon],
59108
59102
  "style-italic": [i18n$1.t("commands.italic"), shortcutToDisplayText("CtrlOrCmd+I"), ItalicIcon],
@@ -59115,7 +59109,7 @@ $$${mathData.mathjaxText}$$
59115
59109
  icon,
59116
59110
  desc
59117
59111
  }));
59118
- return getStandardTextStyles(standardItems, text2);
59112
+ return getStandardTextStyles(editor, standardItems, text2);
59119
59113
  }
59120
59114
  function executeStyleCommand(editor, block, range, command, params, result) {
59121
59115
  if (!command.startsWith("style-")) {
@@ -59145,10 +59139,10 @@ $$${mathData.mathjaxText}$$
59145
59139
  }
59146
59140
  let commands;
59147
59141
  if (getBlockTextLength$6(editor, block) === 0 || !isTextKindBlock(editor, block)) {
59148
- commands = getCommands$1([]);
59142
+ commands = getCommands$1(editor, []);
59149
59143
  } else {
59150
59144
  const subText2 = getSubText(editor, block, range);
59151
- commands = getCommands$1(subText2);
59145
+ commands = getCommands$1(editor, subText2);
59152
59146
  }
59153
59147
  if (!(params == null ? void 0 : params.isFilter)) {
59154
59148
  commands.forEach((item) => {
@@ -59263,7 +59257,7 @@ $$${mathData.mathjaxText}$$
59263
59257
  return false;
59264
59258
  }
59265
59259
  }
59266
- function getCommands(text2) {
59260
+ function getCommands(editor, text2) {
59267
59261
  const StandardTextStyles = {
59268
59262
  "style-super": [i18n$1.t("commands.superscript"), void 0, SuperscriptIcon],
59269
59263
  "style-sub": [i18n$1.t("commands.subscript"), void 0, SubscriptIcon]
@@ -59274,7 +59268,7 @@ $$${mathData.mathjaxText}$$
59274
59268
  icon,
59275
59269
  desc
59276
59270
  }));
59277
- return getStandardTextStyles(standardItems, text2);
59271
+ return getStandardTextStyles(editor, standardItems, text2);
59278
59272
  }
59279
59273
  class TextScriptProvider {
59280
59274
  constructor(editor) {
@@ -59289,10 +59283,10 @@ $$${mathData.mathjaxText}$$
59289
59283
  }
59290
59284
  let commands;
59291
59285
  if (getBlockTextLength$6(editor, block) === 0 || !isTextKindBlock(editor, block)) {
59292
- commands = getCommands([]);
59286
+ commands = getCommands(editor, []);
59293
59287
  } else {
59294
59288
  const subText2 = getSubText(editor, block, range);
59295
- commands = getCommands(subText2);
59289
+ commands = getCommands(editor, subText2);
59296
59290
  }
59297
59291
  if (!(params == null ? void 0 : params.isFilter)) {
59298
59292
  commands.forEach((item) => {
@@ -59489,10 +59483,10 @@ $$${mathData.mathjaxText}$$
59489
59483
  icon: InlineCodeIcon
59490
59484
  }];
59491
59485
  if (getBlockTextLength$6(editor, block) === 0 || !isTextKindBlock(editor, block)) {
59492
- commands = getStandardTextStyles(commands, []);
59486
+ commands = getStandardTextStyles(editor, commands, []);
59493
59487
  } else {
59494
59488
  const subText2 = getSubText(editor, block, range);
59495
- commands = getStandardTextStyles(commands, subText2);
59489
+ commands = getStandardTextStyles(editor, commands, subText2);
59496
59490
  }
59497
59491
  if (!(params == null ? void 0 : params.isFilter)) {
59498
59492
  commands.forEach((item) => {
@@ -59521,7 +59515,7 @@ $$${mathData.mathjaxText}$$
59521
59515
  }
59522
59516
  }
59523
59517
  class MobileLinkProvider {
59524
- constructor(editor) {
59518
+ constructor(editor, options) {
59525
59519
  __publicField(this, "id", "MobileLinkProvider");
59526
59520
  __publicField(this, "insertProvider");
59527
59521
  __publicField(this, "editProvider");
@@ -59545,12 +59539,22 @@ $$${mathData.mathjaxText}$$
59545
59539
  return null;
59546
59540
  });
59547
59541
  __publicField(this, "getAvailableCommands", (editor, block, range, params) => {
59542
+ var _a, _b;
59548
59543
  const editorRange = editor.selection.range;
59549
59544
  const child = this.getSelectedLinkChild(editor, editorRange);
59550
- if (child) {
59545
+ if (child && ((_a = this.options) == null ? void 0 : _a.linkMode) === "edit") {
59551
59546
  return this.editProvider.getAvailableCommands(editor, block, range, { child });
59552
59547
  }
59553
- return this.insertProvider.getAvailableCommands(editor, block, range, { ...params, isFilter: true });
59548
+ if (((_b = this.options) == null ? void 0 : _b.linkMode) === "insert" && !child) {
59549
+ const commands = this.insertProvider.getAvailableCommands(editor, block, range, { ...params, isFilter: true });
59550
+ commands.forEach((command) => {
59551
+ if (command.id === "insert-link") {
59552
+ command.name = i18n$1.t("link.title");
59553
+ }
59554
+ });
59555
+ return commands;
59556
+ }
59557
+ return [];
59554
59558
  });
59555
59559
  __publicField(this, "executeCommand", (editor, block, range, item, params, result) => {
59556
59560
  var _a, _b, _c, _d, _e, _f;
@@ -59561,6 +59565,7 @@ $$${mathData.mathjaxText}$$
59561
59565
  }
59562
59566
  return (_f = (_e = (_d = this.insertProvider) == null ? void 0 : _d.executeCommand) == null ? void 0 : _e.call(_d, editor, block, range, item, params, result)) != null ? _f : false;
59563
59567
  });
59568
+ this.options = options;
59564
59569
  this.insertProvider = new LinkProvider(editor);
59565
59570
  this.editProvider = new EditLinkProvider();
59566
59571
  }
@@ -59571,6 +59576,17 @@ $$${mathData.mathjaxText}$$
59571
59576
  name: "",
59572
59577
  type: "separator"
59573
59578
  };
59579
+ function isCodeTextBlock$1(editor, block) {
59580
+ if (!isTextKindBlock(editor, block)) {
59581
+ return false;
59582
+ }
59583
+ const container = getParentContainer(block);
59584
+ const parentBlock = getParentBlock(container);
59585
+ if (!parentBlock) {
59586
+ return false;
59587
+ }
59588
+ return getBlockType(parentBlock) === "code";
59589
+ }
59574
59590
  class ReadonlyToolbar {
59575
59591
  constructor(editor) {
59576
59592
  __publicField(this, "toolbar");
@@ -59766,6 +59782,9 @@ $$${mathData.mathjaxText}$$
59766
59782
  if (!firstBlock) {
59767
59783
  return;
59768
59784
  }
59785
+ if (isCodeTextBlock$1(this.editor, firstBlock.block)) {
59786
+ return;
59787
+ }
59769
59788
  if (selectedBlocks.length === 1) {
59770
59789
  if (isEmbedBlock(firstBlock.block)) {
59771
59790
  return;
@@ -61965,6 +61984,10 @@ $$${mathData.mathjaxText}$$
61965
61984
  return false;
61966
61985
  }
61967
61986
  filterCommands(editor, block, range, commands) {
61987
+ const { start, end } = editor.selection.range;
61988
+ if (start.blockId === end.blockId && isCodeBlock(block)) {
61989
+ return [];
61990
+ }
61968
61991
  if (isCodeTextBlock(editor, block)) {
61969
61992
  return [];
61970
61993
  }
@@ -62723,7 +62746,7 @@ ${codeText}
62723
62746
  };
62724
62747
  }
62725
62748
  }
62726
- const zhCN$r = {
62749
+ const zhCN$q = {
62727
62750
  code: {
62728
62751
  title: "\u4EE3\u7801",
62729
62752
  abstract: "\u4EE3\u7801",
@@ -62735,7 +62758,7 @@ ${codeText}
62735
62758
  plainText: "Plain Text"
62736
62759
  }
62737
62760
  };
62738
- const enUS$r = {
62761
+ const enUS$q = {
62739
62762
  code: {
62740
62763
  title: "Code",
62741
62764
  abstract: "Code",
@@ -62747,7 +62770,7 @@ ${codeText}
62747
62770
  plainText: "Plain Text"
62748
62771
  }
62749
62772
  };
62750
- const jaJP$r = {
62773
+ const jaJP$q = {
62751
62774
  code: {
62752
62775
  title: "\u30B3\u30FC\u30C9",
62753
62776
  abstract: "\u30B3\u30FC\u30C9",
@@ -62760,9 +62783,9 @@ ${codeText}
62760
62783
  }
62761
62784
  };
62762
62785
  i18n$1.mergeLang({
62763
- "zh-CN": zhCN$r,
62764
- "en-US": enUS$r,
62765
- "ja-JP": jaJP$r
62786
+ "zh-CN": zhCN$q,
62787
+ "en-US": enUS$q,
62788
+ "ja-JP": jaJP$q
62766
62789
  });
62767
62790
  function convertToTable(editor, containerId, blockIndex, offset) {
62768
62791
  const block = editor.getBlockByIndex(containerId, blockIndex);
@@ -62820,6 +62843,7 @@ ${codeText}
62820
62843
  return editor.addCustom("markdown-converter-interceptors", () => new MarkdownConverterInterceptors());
62821
62844
  }
62822
62845
  }
62846
+ const DISABLE_MOBILE_CONVERTERS = ["mermaid", "flowchart", "plantuml"];
62823
62847
  const ENTER_CONVERTER = {
62824
62848
  mermaid: {
62825
62849
  blockType: "embed",
@@ -62946,6 +62970,11 @@ ${codeText}
62946
62970
  const block = editor.getBlockByIndex(containerId, blockIndex);
62947
62971
  const text2 = toPlainText(splitText(editor.getBlockText(block), offset).left);
62948
62972
  const converters = type === "enter" ? ENTER_CONVERTER : SPACE_CONVERTER;
62973
+ if (clientType.isMobile) {
62974
+ DISABLE_MOBILE_CONVERTERS.forEach((key) => {
62975
+ delete converters[key];
62976
+ });
62977
+ }
62949
62978
  for (const [, converter] of Object.entries(converters)) {
62950
62979
  if (!text2.match(converter.reg))
62951
62980
  continue;
@@ -63150,7 +63179,7 @@ ${codeText}
63150
63179
  return false;
63151
63180
  }
63152
63181
  }
63153
- const enUS$q = {
63182
+ const enUS$p = {
63154
63183
  placeholder: {
63155
63184
  default: "Type / for commands",
63156
63185
  heading: "Heading {heading}",
@@ -63161,7 +63190,7 @@ ${codeText}
63161
63190
  mobileDefault: "Type to add content"
63162
63191
  }
63163
63192
  };
63164
- const zhCN$q = {
63193
+ const zhCN$p = {
63165
63194
  placeholder: {
63166
63195
  default: "\u8F93\u5165\u300C/\u300D\u5FEB\u901F\u63D2\u5165",
63167
63196
  heading: "\u6807\u9898{heading}",
@@ -63172,7 +63201,7 @@ ${codeText}
63172
63201
  mobileDefault: "\u8F93\u5165\u4EE5\u6DFB\u52A0\u5185\u5BB9"
63173
63202
  }
63174
63203
  };
63175
- const jaJP$q = {
63204
+ const jaJP$p = {
63176
63205
  placeholder: {
63177
63206
  default: "\u300C/\u300D\u3092\u5165\u529B\u3057\u3066\u7D20\u65E9\u304F\u633F\u5165\u3059\u308B",
63178
63207
  heading: "\u898B\u51FA\u3057{heading}",
@@ -63184,9 +63213,9 @@ ${codeText}
63184
63213
  }
63185
63214
  };
63186
63215
  const langs$1 = {
63187
- "en-US": enUS$q,
63188
- "zh-CN": zhCN$q,
63189
- "ja-JP": jaJP$q
63216
+ "en-US": enUS$p,
63217
+ "zh-CN": zhCN$p,
63218
+ "ja-JP": jaJP$p
63190
63219
  };
63191
63220
  i18n$1.mergeLang(langs$1);
63192
63221
  function isEmptyTextBlockWithoutCompositionText(editor, block) {
@@ -63913,7 +63942,7 @@ ${codeText}
63913
63942
  this.rootButton.destroy();
63914
63943
  }
63915
63944
  }
63916
- const zhCN$p = {
63945
+ const zhCN$o = {
63917
63946
  blockMenu: {
63918
63947
  section: {
63919
63948
  basics: "\u57FA\u7840",
@@ -63937,7 +63966,7 @@ ${codeText}
63937
63966
  }
63938
63967
  }
63939
63968
  };
63940
- const enUS$p = {
63969
+ const enUS$o = {
63941
63970
  blockMenu: {
63942
63971
  section: {
63943
63972
  basics: "Basic",
@@ -63961,7 +63990,7 @@ ${codeText}
63961
63990
  }
63962
63991
  }
63963
63992
  };
63964
- const jaJP$p = {
63993
+ const jaJP$o = {
63965
63994
  blockMenu: {
63966
63995
  section: {
63967
63996
  basics: "\u4E00\u822C",
@@ -63986,9 +64015,9 @@ ${codeText}
63986
64015
  }
63987
64016
  };
63988
64017
  i18n$1.mergeLang({
63989
- "zh-CN": zhCN$p,
63990
- "en-US": enUS$p,
63991
- "ja-JP": jaJP$p
64018
+ "zh-CN": zhCN$o,
64019
+ "en-US": enUS$o,
64020
+ "ja-JP": jaJP$o
63992
64021
  });
63993
64022
  const style$8 = "";
63994
64023
  class DragData {
@@ -64944,7 +64973,7 @@ ${codeText}
64944
64973
  }
64945
64974
  }
64946
64975
  }
64947
- const zhCN$o = {
64976
+ const zhCN$n = {
64948
64977
  image: {
64949
64978
  title: "\u56FE\u7247",
64950
64979
  upload: {
@@ -64960,7 +64989,7 @@ ${codeText}
64960
64989
  abstract: "\u56FE\u7247"
64961
64990
  }
64962
64991
  };
64963
- const enUS$o = {
64992
+ const enUS$n = {
64964
64993
  image: {
64965
64994
  title: "Image",
64966
64995
  upload: {
@@ -64976,7 +65005,7 @@ ${codeText}
64976
65005
  abstract: "Image"
64977
65006
  }
64978
65007
  };
64979
- const jaJP$o = {
65008
+ const jaJP$n = {
64980
65009
  image: {
64981
65010
  title: "\u753B\u50CF",
64982
65011
  upload: {
@@ -64993,9 +65022,9 @@ ${codeText}
64993
65022
  }
64994
65023
  };
64995
65024
  i18n$1.mergeLang({
64996
- "zh-CN": zhCN$o,
64997
- "en-US": enUS$o,
64998
- "ja-JP": jaJP$o
65025
+ "zh-CN": zhCN$n,
65026
+ "en-US": enUS$n,
65027
+ "ja-JP": jaJP$n
64999
65028
  });
65000
65029
  function convertToImage(editor, containerId, blockIndex, offset) {
65001
65030
  const block = editor.getBlockByIndex(containerId, blockIndex);
@@ -65363,28 +65392,28 @@ ${codeText}
65363
65392
  }
65364
65393
  return getDragInsertPos(editor, block, images, x);
65365
65394
  }
65366
- const zhCN$n = {
65395
+ const zhCN$m = {
65367
65396
  embedProperties: {
65368
65397
  edit: "\u7F16\u8F91",
65369
65398
  addComment: "\u6DFB\u52A0\u6279\u6CE8"
65370
65399
  }
65371
65400
  };
65372
- const enUS$n = {
65401
+ const enUS$m = {
65373
65402
  embedProperties: {
65374
65403
  edit: "Edit",
65375
65404
  addComment: "Add annotation"
65376
65405
  }
65377
65406
  };
65378
- const jaJP$n = {
65407
+ const jaJP$m = {
65379
65408
  embedProperties: {
65380
65409
  edit: "\u7DE8\u96C6",
65381
65410
  addComment: "\u6CE8\u91C8\u3092\u8FFD\u52A0"
65382
65411
  }
65383
65412
  };
65384
65413
  i18n$1.mergeLang({
65385
- "zh-CN": zhCN$n,
65386
- "en-US": enUS$n,
65387
- "ja-JP": jaJP$n
65414
+ "zh-CN": zhCN$m,
65415
+ "en-US": enUS$m,
65416
+ "ja-JP": jaJP$m
65388
65417
  });
65389
65418
  const logger$1c = getLogger("embed-block-properties");
65390
65419
  function addCommentToBlock(editor, block) {
@@ -65425,7 +65454,7 @@ ${codeText}
65425
65454
  }
65426
65455
  get commands() {
65427
65456
  var _a, _b, _c, _d;
65428
- if (this.editor.readonly || clientType.isMobile) {
65457
+ if (clientType.isMobile) {
65429
65458
  return [];
65430
65459
  }
65431
65460
  let standardCommands = [];
@@ -65452,9 +65481,12 @@ ${codeText}
65452
65481
  });
65453
65482
  }
65454
65483
  const { enableComments = true } = this.editor.options;
65455
- if (!enableComments) {
65484
+ if (!enableComments || this.editor.readonly) {
65456
65485
  standardCommands = standardCommands.filter((command) => command.id !== "add-comment");
65457
65486
  }
65487
+ if (this.editor.readonly) {
65488
+ standardCommands = standardCommands.filter((command) => command.id !== "edit");
65489
+ }
65458
65490
  standardCommands.forEach((item) => {
65459
65491
  if (item.id === "add-comment" || item.id === "edit") {
65460
65492
  item.states = this.editor.isBlockWritable(this.block) ? [] : ["disabled"];
@@ -67961,7 +67993,7 @@ ${codeText}
67961
67993
  }
67962
67994
  }
67963
67995
  const style$7 = "";
67964
- const zhCN$m = {
67996
+ const zhCN$l = {
67965
67997
  comment: {
67966
67998
  count: "\u6279\u6CE8 ({num})",
67967
67999
  hide: "\u9690\u85CF\u6279\u6CE8",
@@ -67984,7 +68016,7 @@ ${codeText}
67984
68016
  quickMenuCommand: "\u6DFB\u52A0\u6279\u6CE8"
67985
68017
  }
67986
68018
  };
67987
- const enUS$m = {
68019
+ const enUS$l = {
67988
68020
  comment: {
67989
68021
  count: "Annotations ({num})",
67990
68022
  hide: "Hide Annotations",
@@ -68007,7 +68039,7 @@ ${codeText}
68007
68039
  quickMenuCommand: "Add annotation"
68008
68040
  }
68009
68041
  };
68010
- const jaJP$m = {
68042
+ const jaJP$l = {
68011
68043
  comment: {
68012
68044
  count: "\u6CE8\u91C8 ({num})",
68013
68045
  hide: "\u6CE8\u91C8\u3092\u975E\u8868\u793A",
@@ -68031,9 +68063,9 @@ ${codeText}
68031
68063
  }
68032
68064
  };
68033
68065
  i18n$1.mergeLang({
68034
- "zh-CN": zhCN$m,
68035
- "en-US": enUS$m,
68036
- "ja-JP": jaJP$m
68066
+ "zh-CN": zhCN$l,
68067
+ "en-US": enUS$l,
68068
+ "ja-JP": jaJP$l
68037
68069
  });
68038
68070
  class OnesEditorCommentsRender {
68039
68071
  renderText(editor, path, attributes) {
@@ -70173,7 +70205,8 @@ ${codeText}
70173
70205
  return editor.undoManager.runInGroup(() => {
70174
70206
  var _a, _b;
70175
70207
  const item = options.item;
70176
- const cols = (_a = item.colCount) != null ? _a : 5;
70208
+ const defaultColCount = clientType.isMobile ? 3 : 5;
70209
+ const cols = (_a = item.colCount) != null ? _a : defaultColCount;
70177
70210
  const rows = (_b = item.rowCount) != null ? _b : 3;
70178
70211
  const ret = createEmptyTableData(editor, { cols, rows });
70179
70212
  if (!ret) {
@@ -70621,7 +70654,7 @@ ${codeText}
70621
70654
  return void 0;
70622
70655
  }
70623
70656
  };
70624
- const zhCN$l = {
70657
+ const zhCN$k = {
70625
70658
  table: {
70626
70659
  cellBackground: "\u5355\u5143\u683C\u80CC\u666F\u8272",
70627
70660
  deleteSelectRow: "\u5220\u9664\u6240\u9009\u884C",
@@ -70652,7 +70685,7 @@ ${codeText}
70652
70685
  }
70653
70686
  }
70654
70687
  };
70655
- const enUS$l = {
70688
+ const enUS$k = {
70656
70689
  table: {
70657
70690
  cellBackground: "Cell background color",
70658
70691
  deleteSelectRow: "Delete selected rows",
@@ -70683,7 +70716,7 @@ ${codeText}
70683
70716
  }
70684
70717
  }
70685
70718
  };
70686
- const jaJP$l = {
70719
+ const jaJP$k = {
70687
70720
  table: {
70688
70721
  cellBackground: "\u30BB\u30EB\u306E\u80CC\u666F\u8272",
70689
70722
  deleteSelectRow: "\u9078\u629E\u3057\u305F\u884C\u3092\u524A\u9664",
@@ -70715,9 +70748,9 @@ ${codeText}
70715
70748
  }
70716
70749
  };
70717
70750
  i18n$1.mergeLang({
70718
- "zh-CN": zhCN$l,
70719
- "en-US": enUS$l,
70720
- "ja-JP": jaJP$l
70751
+ "zh-CN": zhCN$k,
70752
+ "en-US": enUS$k,
70753
+ "ja-JP": jaJP$k
70721
70754
  });
70722
70755
  const tableStyle = "";
70723
70756
  const logger$N = getLogger("table");
@@ -70981,13 +71014,7 @@ ${codeText}
70981
71014
  if (!clientType.isMobile) {
70982
71015
  this.item.children = items;
70983
71016
  } else {
70984
- const SEP2 = {
70985
- id: "",
70986
- name: "",
70987
- type: "separator"
70988
- };
70989
- const commands = items.reduce((prev, curr) => prev.concat([SEP2, curr]), []);
70990
- commands.shift();
71017
+ const commands = groupEachCommand(items);
70991
71018
  this.toolbar.updateItems(commands);
70992
71019
  }
70993
71020
  this.toolbar.manualShow(this.anchor, {
@@ -71125,21 +71152,21 @@ ${codeText}
71125
71152
  return false;
71126
71153
  }
71127
71154
  }
71128
- const zhCN$k = {
71155
+ const zhCN$j = {
71129
71156
  pasteSpecial: {
71130
71157
  originFormats: "\u4FDD\u6301\u539F\u6837\u5F0F",
71131
71158
  plainText: "\u7C98\u8D34\u7EAF\u6587\u672C",
71132
71159
  markdown: "\u7C98\u8D34\u4E3A Markdown"
71133
71160
  }
71134
71161
  };
71135
- const enUS$k = {
71162
+ const enUS$j = {
71136
71163
  pasteSpecial: {
71137
71164
  originFormats: "Keep origin formats",
71138
71165
  plainText: "Paste as plain text",
71139
71166
  markdown: "Paste as markdown"
71140
71167
  }
71141
71168
  };
71142
- const jaJP$k = {
71169
+ const jaJP$j = {
71143
71170
  pasteSpecial: {
71144
71171
  originFormats: "\u5143\u306E\u30B9\u30BF\u30A4\u30EB\u3092\u7DAD\u6301\u3059\u308B",
71145
71172
  plainText: "\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8CBC\u308A\u4ED8\u3051\u308B",
@@ -71147,9 +71174,9 @@ ${codeText}
71147
71174
  }
71148
71175
  };
71149
71176
  i18n$1.mergeLang({
71150
- "zh-CN": zhCN$k,
71151
- "en-US": enUS$k,
71152
- "ja-JP": jaJP$k
71177
+ "zh-CN": zhCN$j,
71178
+ "en-US": enUS$j,
71179
+ "ja-JP": jaJP$j
71153
71180
  });
71154
71181
  const style$6 = "";
71155
71182
  const logger$L = getLogger("html-to-doc");
@@ -73912,7 +73939,7 @@ ${content}
73912
73939
  const eleRect = firstChild.getBoundingClientRect();
73913
73940
  offsetTop = eleRect.y;
73914
73941
  }
73915
- scrollIntoView$1(editor, firstChild, { animation: true });
73942
+ scrollIntoView(editor, firstChild, { animation: true });
73916
73943
  }
73917
73944
  function getCurrentHighligh(editor) {
73918
73945
  const elem = editor.rootContainer.querySelector(".editor-highlight.active");
@@ -74562,7 +74589,7 @@ ${content}
74562
74589
  (_a = this.dialog) == null ? void 0 : _a.destroy();
74563
74590
  }
74564
74591
  }
74565
- const zhCN$j = {
74592
+ const zhCN$i = {
74566
74593
  find: {
74567
74594
  findLabel: "\u67E5\u627E:",
74568
74595
  replaceLabel: "\u66FF\u6362:",
@@ -74574,7 +74601,7 @@ ${content}
74574
74601
  replacePlaceholder: "\u66FF\u6362\u4E3A"
74575
74602
  }
74576
74603
  };
74577
- const enUS$j = {
74604
+ const enUS$i = {
74578
74605
  find: {
74579
74606
  findLabel: "Search:",
74580
74607
  replaceLabel: "Replace:",
@@ -74586,7 +74613,7 @@ ${content}
74586
74613
  replacePlaceholder: "Replace with"
74587
74614
  }
74588
74615
  };
74589
- const jaJP$j = {
74616
+ const jaJP$i = {
74590
74617
  find: {
74591
74618
  findLabel: "\u691C\u7D22\uFF1A",
74592
74619
  replaceLabel: "\u7F6E\u63DB\uFF1A",
@@ -74599,9 +74626,9 @@ ${content}
74599
74626
  }
74600
74627
  };
74601
74628
  i18n$1.mergeLang({
74602
- "zh-CN": zhCN$j,
74603
- "en-US": enUS$j,
74604
- "ja-JP": jaJP$j
74629
+ "zh-CN": zhCN$i,
74630
+ "en-US": enUS$i,
74631
+ "ja-JP": jaJP$i
74605
74632
  });
74606
74633
  function handleFindReplace(editor) {
74607
74634
  const dialog = editor.addCustom("find-dialog", () => new FindDialog(editor));
@@ -74871,28 +74898,28 @@ ${content}
74871
74898
  this.isShown = false;
74872
74899
  }
74873
74900
  }
74874
- const zhCN$i = {
74901
+ const zhCN$h = {
74875
74902
  authError: {
74876
74903
  tips: '<div>\u670D\u52A1\u5DF2\u65AD\u5F00\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5\uFF0C\u4E3A\u907F\u514D\u5185\u5BB9\u4E22\u5931\uFF0C\u6211\u4EEC\u6682\u65F6\u7981\u7528\u7F16\u8F91\u80FD\u529B\uFF0C\u4F60\u53EF\u4EE5<span id="exit">\u9000\u51FA\u7F16\u8F91</span></div>',
74877
74904
  successTips: "<div>\u7F16\u8F91\u72B6\u6001\u5DF2\u6062\u590D\uFF0C\u4F60\u53EF\u4EE5\u7EE7\u7EED\u7F16\u8F91</div>"
74878
74905
  }
74879
74906
  };
74880
- const enUS$i = {
74907
+ const enUS$h = {
74881
74908
  authError: {
74882
74909
  tips: '<div>Network disconnected. To avoid any potential loss of content, editing is temporarily disabled. <span id="exit">Exit editor<span id="exit">',
74883
74910
  successTips: "<div>The editing mode has been restored and you can now continue editing.</div>"
74884
74911
  }
74885
74912
  };
74886
- const jaJP$i = {
74913
+ const jaJP$h = {
74887
74914
  authError: {
74888
74915
  tips: '<div>\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002\u30C7\u30FC\u30BF\u640D\u5931\u306E\u56DE\u907F\u306E\u305F\u3081\u306B\u3001\u63A5\u7D9A\u304C\u56DE\u5FA9\u3059\u308B\u307E\u3067\u7DE8\u96C6\u6A5F\u80FD\u306F\u4F7F\u3048\u307E\u305B\u3093\u3002<span id="exit">\u7DE8\u96C6\u3092\u7D42\u4E86</span></div>',
74889
74916
  successTips: "<div>\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u304C\u56DE\u5FA9\u3057\u307E\u3057\u305F\u3002\u5F15\u304D\u7D9A\u3051\u3054\u7DE8\u96C6\u3044\u305F\u3060\u3051\u307E\u3059\u3002</div>"
74890
74917
  }
74891
74918
  };
74892
74919
  i18n$1.mergeLang({
74893
- "zh-CN": zhCN$i,
74894
- "en-US": enUS$i,
74895
- "ja-JP": jaJP$i
74920
+ "zh-CN": zhCN$h,
74921
+ "en-US": enUS$h,
74922
+ "ja-JP": jaJP$h
74896
74923
  });
74897
74924
  const logger$B = getLogger("re-auth");
74898
74925
  const DOC_RE_AUTH_KEYS = "doc-re-auth-event";
@@ -75467,7 +75494,7 @@ ${content}
75467
75494
  return false;
75468
75495
  }
75469
75496
  }
75470
- const zhCN$h = {
75497
+ const zhCN$g = {
75471
75498
  contextMenu: {
75472
75499
  copyMarkdown: "\u590D\u5236\u4E3A Markdown",
75473
75500
  paste: "\u7C98\u8D34",
@@ -75480,7 +75507,7 @@ ${content}
75480
75507
  uneditableBlockSelected: "\u9009\u4E2D\u533A\u57DF\u5305\u542B\u9501\u5B9A\u533A\u5757\uFF0C\u6682\u4E0D\u652F\u6301\u526A\u5207"
75481
75508
  }
75482
75509
  };
75483
- const enUS$h = {
75510
+ const enUS$g = {
75484
75511
  contextMenu: {
75485
75512
  copyMarkdown: "Copy as Markdown",
75486
75513
  paste: "Paste",
@@ -75493,7 +75520,7 @@ ${content}
75493
75520
  uneditableBlockSelected: "The selected area contains locked blocks, and cutting is not currently supported"
75494
75521
  }
75495
75522
  };
75496
- const jaJP$h = {
75523
+ const jaJP$g = {
75497
75524
  contextMenu: {
75498
75525
  copyMarkdown: "Markdown \u3068\u3057\u3066\u30B3\u30D4\u30FC",
75499
75526
  paste: "\u8CBC\u308A\u4ED8\u3051",
@@ -75507,9 +75534,9 @@ ${content}
75507
75534
  }
75508
75535
  };
75509
75536
  i18n$1.mergeLang({
75510
- "zh-CN": zhCN$h,
75511
- "en-US": enUS$h,
75512
- "ja-JP": jaJP$h
75537
+ "zh-CN": zhCN$g,
75538
+ "en-US": enUS$g,
75539
+ "ja-JP": jaJP$g
75513
75540
  });
75514
75541
  function hideToolbar(editor) {
75515
75542
  const toolbar2 = editor.findCustom("toolbar-handler");
@@ -75535,47 +75562,6 @@ ${content}
75535
75562
  "CtrlOrCmd+Z": undoHandler,
75536
75563
  "CtrlOrCmd+Shift+Z": redoHandler
75537
75564
  };
75538
- const zhCN$g = {
75539
- commands: {
75540
- bold: "\u7C97\u4F53",
75541
- italic: "\u659C\u4F53",
75542
- underline: "\u4E0B\u5212\u7EBF",
75543
- strikethrough: "\u5220\u9664\u7EBF",
75544
- code: "\u884C\u5185\u4EE3\u7801",
75545
- subscript: "\u4E0B\u6807",
75546
- superscript: "\u4E0A\u6807",
75547
- more: "\u66F4\u591A"
75548
- }
75549
- };
75550
- const enUS$g = {
75551
- commands: {
75552
- bold: "Bold",
75553
- italic: "Italic",
75554
- underline: "Underline",
75555
- strikethrough: "Strikethrough",
75556
- code: "Inline code",
75557
- subscript: "Subscript",
75558
- superscript: "Superscript",
75559
- more: "More"
75560
- }
75561
- };
75562
- const jaJP$g = {
75563
- commands: {
75564
- bold: "\u592A\u5B57",
75565
- italic: "\u659C\u4F53",
75566
- underline: "\u4E0B\u7DDA",
75567
- strikethrough: "\u53D6\u308A\u6D88\u3057\u7DDA",
75568
- code: "\u30A4\u30F3\u30E9\u30A4\u30F3\u30B3\u30FC\u30C9",
75569
- subscript: "\u4E0B\u4ED8\u304D\u6587\u5B57",
75570
- superscript: "\u4E0A\u4ED8\u304D\u6587\u5B57",
75571
- more: "\u305D\u306E\u4ED6"
75572
- }
75573
- };
75574
- i18n$1.mergeLang({
75575
- "zh-CN": zhCN$g,
75576
- "en-US": enUS$g,
75577
- "ja-JP": jaJP$g
75578
- });
75579
75565
  var FilePreviewType = /* @__PURE__ */ ((FilePreviewType2) => {
75580
75566
  FilePreviewType2["Card"] = "card";
75581
75567
  FilePreviewType2["Preview"] = "preview";
@@ -78809,7 +78795,7 @@ ${content}
78809
78795
  class OnesEditorMention {
78810
78796
  constructor(editor, options) {
78811
78797
  __publicField(this, "suggest");
78812
- __publicField(this, "mobileWrap", null);
78798
+ __publicField(this, "mobileWrap");
78813
78799
  __publicField(this, "items", []);
78814
78800
  __publicField(this, "createMobileHeader", () => {
78815
78801
  if (!clientType.isMobile) {
@@ -78834,10 +78820,9 @@ ${content}
78834
78820
  });
78835
78821
  __publicField(this, "onShown", (bar2) => {
78836
78822
  if (clientType.isMobile) {
78837
- const mobileWrap = this.getMobileCommandElement();
78838
- const input2 = mobileWrap.querySelector("input");
78823
+ const { input: input2 } = this.createMobileWrap();
78839
78824
  input2.focus();
78840
- scrollIntoView(bar2.menu.menu, this.editor);
78825
+ scrollBarIntoView(this.editor, bar2.menu.menu);
78841
78826
  }
78842
78827
  });
78843
78828
  __publicField(this, "handleClickItem", (item) => {
@@ -78910,31 +78895,36 @@ ${content}
78910
78895
  this.createMobileItems(content, items, find);
78911
78896
  });
78912
78897
  }, 100));
78913
- __publicField(this, "getMobileCommandElement", () => {
78898
+ __publicField(this, "createMobileWrap", () => {
78914
78899
  if (this.mobileWrap) {
78915
78900
  return this.mobileWrap;
78916
78901
  }
78917
- this.mobileWrap = createElement("div", ["mobile-item-wrap"], null);
78902
+ const wrapper = createElement("div", ["mobile-item-wrap"], null);
78918
78903
  const content = createElement("div", ["mobile-item-content"], null);
78919
78904
  const icon = createElement("div", ["editor-input-icon"], null);
78920
78905
  icon.innerHTML = SearchIcon;
78921
- createInput(this.mobileWrap, {
78906
+ const input2 = createInput(wrapper, {
78922
78907
  onChange: (e2) => this.onInputChanged(content, e2),
78923
78908
  placeholder: i18n$1.t("mention.placeholder"),
78924
78909
  prefix: icon,
78925
78910
  suffixClose: true
78926
78911
  });
78927
- this.mobileWrap.appendChild(content);
78928
- this.mobileWrap.addEventListener("click", this.handleMobileWrapClick);
78912
+ wrapper.appendChild(content);
78913
+ wrapper.addEventListener("click", this.handleMobileWrapClick);
78929
78914
  content.addEventListener("scroll", () => {
78930
78915
  var _a;
78931
78916
  return (_a = document.activeElement) == null ? void 0 : _a.blur();
78932
78917
  });
78918
+ this.mobileWrap = {
78919
+ wrapper,
78920
+ input: input2,
78921
+ content
78922
+ };
78933
78923
  return this.mobileWrap;
78934
78924
  });
78935
78925
  __publicField(this, "createMobileCommandItem", (items) => {
78936
- const mobileWrap = this.getMobileCommandElement();
78937
- const content = mobileWrap.querySelector(".mobile-item-content");
78926
+ const { wrapper, input: input2, content } = this.createMobileWrap();
78927
+ input2.reset();
78938
78928
  this.createMobileItems(content, items, "");
78939
78929
  setTimeout(() => {
78940
78930
  const clientHeight = this.editor.scrollContainer.clientHeight;
@@ -78943,7 +78933,7 @@ ${content}
78943
78933
  return [{
78944
78934
  id: "create-mobile-item",
78945
78935
  name: "Create Mobile Item",
78946
- element: mobileWrap
78936
+ element: wrapper
78947
78937
  }];
78948
78938
  });
78949
78939
  __publicField(this, "_queryItems", async (text2) => {
@@ -78990,7 +78980,8 @@ ${content}
78990
78980
  }
78991
78981
  destroy() {
78992
78982
  if (this.mobileWrap) {
78993
- this.mobileWrap.removeEventListener("click", this.handleMobileWrapClick);
78983
+ this.mobileWrap.wrapper.removeEventListener("click", this.handleMobileWrapClick);
78984
+ this.mobileWrap.input.destroy();
78994
78985
  }
78995
78986
  }
78996
78987
  }
@@ -79863,7 +79854,7 @@ ${content}
79863
79854
  function convertTo$6(editor, blockData, doc2, type, path) {
79864
79855
  const calloutBlockData = blockData;
79865
79856
  const { children: [containerId] } = calloutBlockData;
79866
- const childBlocks = editor.getChildContainerData(containerId);
79857
+ const childBlocks = doc2.blocks[containerId] || [];
79867
79858
  return childBlocks.reduce((acc, docBlock) => {
79868
79859
  const str = `${acc + blockToText(editor, docBlock, doc2, path)}
79869
79860
  `;
@@ -80114,86 +80105,31 @@ ${content}
80114
80105
  removeClass(this.endGripper, "active");
80115
80106
  }
80116
80107
  }
80117
- class InsertMenuProvider extends ProxyProvider {
80108
+ class MobileInsertMenuProvider extends ProxyProvider {
80118
80109
  constructor(editor) {
80119
80110
  super();
80120
80111
  __publicField(this, "id", "InsertMenuProvider");
80121
80112
  __publicField(this, "providers", []);
80122
80113
  __publicField(this, "getInsertCommands", () => []);
80123
80114
  __publicField(this, "getAvailableCommands", (editor, block, range, params) => {
80124
- var _a, _b;
80125
80115
  const commands = [];
80126
- editor.editorBlocks.forEach((blockClass) => {
80127
- if (!blockClass.getOptions) {
80128
- return;
80129
- }
80130
- const options = blockClass.getOptions(editor);
80131
- if (!options.insertBlockCommandItems) {
80132
- return;
80133
- }
80134
- injectBlockOptions(options.insertBlockCommandItems, options);
80135
- commands.push(...options.insertBlockCommandItems);
80136
- });
80137
- if (!isTextKindBlock(editor, block)) {
80138
- const container = getParentContainer(block);
80139
- const containerId = getContainerId(container);
80140
- for (const provider of this.providers) {
80141
- commands.push(...(_b = (_a = provider.getInsertCommands) == null ? void 0 : _a.call(provider, editor, containerId)) != null ? _b : []);
80142
- }
80143
- } else {
80144
- for (const provider of this.providers) {
80145
- commands.push(...provider.getAvailableCommands(editor, block, range, params));
80146
- }
80116
+ for (const provider of this.providers) {
80117
+ commands.push(...provider.getAvailableCommands(editor, block, range, params));
80147
80118
  }
80148
80119
  return commands.filter((command) => this.whiteList.includes(command.id)).sort((a, b) => this.whiteList.indexOf(a.id) - this.whiteList.indexOf(b.id));
80149
80120
  });
80150
80121
  __publicField(this, "executeInsertCommand", () => false);
80151
- __publicField(this, "getNextBlockIndex", (container, block) => {
80152
- let nextBlock = getNextVisibleBlock(block);
80153
- if (!nextBlock) {
80154
- nextBlock = getLastChildBlock(container);
80155
- return getBlockIndex(nextBlock) + 1;
80156
- }
80157
- return getBlockIndex(nextBlock);
80158
- });
80159
80122
  __publicField(this, "executeCommand", (editor, block, range, item, params) => {
80160
- var _a, _b, _c, _d;
80161
- const quickItem = item;
80162
- const container = getParentContainer(block);
80163
- const containerId = getContainerId(container);
80164
- const blockIndex = editor.getBlockIndex(block);
80165
- if ((_a = quickItem.blockOptions) == null ? void 0 : _a.handleInsertEmptyBlock) {
80166
- let insertIndex = blockIndex;
80167
- const isEmptyBlock = isEmptyTextBlock(editor, block);
80168
- if (!isEmptyBlock) {
80169
- insertIndex = this.getNextBlock(container, block);
80170
- }
80171
- (_b = quickItem.blockOptions) == null ? void 0 : _b.handleInsertEmptyBlock(editor, {
80172
- containerId,
80173
- blockIndex: insertIndex,
80174
- item,
80175
- from: isEmptyBlock ? "add-block-menu" : "quick-menu"
80176
- });
80177
- return true;
80178
- }
80179
- if (!isTextKindBlock(editor, block)) {
80180
- const insertIndex = this.getNextBlock(container, block);
80181
- for (const provider of this.providers) {
80182
- if ((_c = provider.executeInsertCommand) == null ? void 0 : _c.call(provider, editor, containerId, insertIndex, item, params)) {
80183
- return true;
80184
- }
80185
- }
80186
- } else {
80187
- for (const provider of this.providers) {
80188
- if ((_d = provider.executeCommand) == null ? void 0 : _d.call(provider, editor, block, range, item, params)) {
80189
- return true;
80190
- }
80123
+ var _a;
80124
+ for (const provider of this.providers) {
80125
+ if ((_a = provider.executeCommand) == null ? void 0 : _a.call(provider, editor, block, range, item, params)) {
80126
+ return true;
80191
80127
  }
80192
80128
  }
80193
80129
  return false;
80194
80130
  });
80195
80131
  this.editor = editor;
80196
- this.providers.push(new LinkProvider(editor));
80132
+ this.providers.push(new InsertMenuProvider(editor));
80197
80133
  }
80198
80134
  get whiteList() {
80199
80135
  const list2 = ["insert-image", "insert-table", "insert-link", "insert-hr"];
@@ -80203,14 +80139,6 @@ ${content}
80203
80139
  }
80204
80140
  return list2;
80205
80141
  }
80206
- getNextBlock(container, block) {
80207
- let nextBlock = getNextVisibleBlock(block);
80208
- if (!nextBlock) {
80209
- nextBlock = getLastChildBlock(container);
80210
- return getBlockIndex(nextBlock) + 1;
80211
- }
80212
- return getBlockIndex(nextBlock);
80213
- }
80214
80142
  }
80215
80143
  class CursorToolbarHandler {
80216
80144
  constructor(editor) {
@@ -80236,19 +80164,19 @@ ${content}
80236
80164
  return groupEachCommand(commands);
80237
80165
  });
80238
80166
  __publicField(this, "showToolbar", () => {
80239
- hideToolbar$1(this.editor);
80167
+ tippy$1.hideAll();
80240
80168
  const commands = this.getCommands();
80241
80169
  this.toolbar.updateItems(commands);
80242
80170
  const focusBlock = this.editor.selection.focusedBlock;
80243
- const rect = getBlockCaretRect(this.editor, focusBlock, this.editor.selection.range.start);
80244
- const anchor2 = createBlockAnchor(this.editor, focusBlock, "editor-quick-menu", rect);
80171
+ const rect = getBlockCaretRect(this.editor, focusBlock, this.editor.selection.range.focus);
80172
+ const anchor2 = createBlockAnchor(this.editor, focusBlock, "editor-cursor-toolbar", rect);
80245
80173
  this.toolbar.manualShow(anchor2, {
80246
80174
  placement: "top",
80247
80175
  offset: [0, 14]
80248
80176
  });
80249
80177
  });
80250
80178
  __publicField(this, "close", () => {
80251
- this.toolbar.close("clickItem");
80179
+ this.toolbar.close("cancelBar");
80252
80180
  });
80253
80181
  this.editor = editor;
80254
80182
  this.toolbar = new ManualToolbar([], void 0, {
@@ -80298,7 +80226,7 @@ ${content}
80298
80226
  ];
80299
80227
  });
80300
80228
  this.editor = editor;
80301
- this.providers = [new InsertMenuProvider(editor)];
80229
+ this.providers = [new MobileInsertMenuProvider(editor)];
80302
80230
  }
80303
80231
  }
80304
80232
  class TurnIntoCommandProvider extends ProxyProvider {
@@ -80531,15 +80459,15 @@ ${content}
80531
80459
  __publicField(this, "mobileToolbar");
80532
80460
  __publicField(this, "fixedProviders");
80533
80461
  __publicField(this, "bar");
80534
- __publicField(this, "handleSubBarShow", (_2, subBar) => {
80535
- scrollIntoView(subBar, this.editor);
80536
- });
80537
- __publicField(this, "handleSelectionChange", () => {
80538
- setTimeout(() => {
80539
- const commands = this.fixedProviders.getCommands(this.editor.selection.range);
80540
- this.mobileToolbar.updateItems(commands);
80541
- });
80462
+ __publicField(this, "subBar", null);
80463
+ __publicField(this, "handleSubBarShown", (_2, subBar) => {
80464
+ scrollBarIntoView(this.editor, subBar);
80465
+ this.subBar = subBar;
80542
80466
  });
80467
+ __publicField(this, "handleSelectionChange", debounce__default.default(() => {
80468
+ const commands = this.fixedProviders.getCommands(this.editor.selection.range);
80469
+ this.mobileToolbar.updateItems(commands);
80470
+ }, 60));
80543
80471
  __publicField(this, "handleClick", (_2, item) => {
80544
80472
  this.fixedProviders.executeCommand(this.editor.selection.range, item, {});
80545
80473
  setTimeout(() => {
@@ -80553,12 +80481,24 @@ ${content}
80553
80481
  this.fixedProviders = new FixedProviders(editor);
80554
80482
  this.bar = createElement("div", ["command-m-bar"], parent);
80555
80483
  const commands = this.fixedProviders.getCommands(this.editor.selection.range);
80556
- this.mobileToolbar = new FixedToolbar(this.bar, commands, {
80557
- tooltipId: "mobile-viewer"
80558
- });
80559
- this.mobileToolbar.addListener("subBarShown", this.handleSubBarShow);
80484
+ this.mobileToolbar = new FixedToolbar(this.bar, commands);
80485
+ this.mobileToolbar.addListener("subBarShown", this.handleSubBarShown);
80560
80486
  this.mobileToolbar.addListener("click", this.handleClick);
80561
80487
  this.editor.addListener("selectionChanged", this.handleSelectionChange);
80488
+ setTimeout(() => {
80489
+ const container = this.bar.firstChild;
80490
+ if (container.scrollWidth > container.clientWidth) {
80491
+ container.classList.add("overflowing");
80492
+ } else {
80493
+ container.classList.remove("overflowing");
80494
+ }
80495
+ }, 500);
80496
+ }
80497
+ layoutSubBar() {
80498
+ var _a, _b, _c;
80499
+ if (((_a = this.subBar) == null ? void 0 : _a.isVisible) && this.subBar.parentItem) {
80500
+ (_c = (_b = this.subBar).setProps) == null ? void 0 : _c.call(_b, this.mobileToolbar.getSubBarOptions(this.subBar.parentItem));
80501
+ }
80562
80502
  }
80563
80503
  destroy() {
80564
80504
  this.editor.removeListener("selectionChanged", this.handleSelectionChange);
@@ -80590,102 +80530,66 @@ ${content}
80590
80530
  constructor(editor) {
80591
80531
  __publicField(this, "commandBar");
80592
80532
  __publicField(this, "observer");
80593
- __publicField(this, "showKeyboard", false);
80533
+ __publicField(this, "timer");
80534
+ __publicField(this, "mobileClient");
80594
80535
  __publicField(this, "toggleDelay", clientType.isSafari ? 800 : 100);
80595
- __publicField(this, "toggle", debounce__default.default(() => {
80596
- const offsetHeight = Math.max(this.clientHeight - this.virtualViewportHeight, 0);
80536
+ __publicField(this, "preHeight", 0);
80537
+ __publicField(this, "layoutBar", debounce__default.default(() => {
80538
+ var _a, _b, _c, _d, _e;
80539
+ const offsetHeight = (_b = (_a = this.mobileClient) == null ? void 0 : _a.getOffsetHeight()) != null ? _b : 0;
80540
+ if (clientType.isIOS && this.mobileClient) {
80541
+ if (this.preHeight > this.mobileClient.virtualViewportHeight) {
80542
+ editorScrollIntoView(this.editor);
80543
+ }
80544
+ }
80597
80545
  this.commandBar.bar.style.bottom = `${offsetHeight}px`;
80546
+ if (this.preHeight !== ((_c = this.mobileClient) == null ? void 0 : _c.virtualViewportHeight)) {
80547
+ this.commandBar.layoutSubBar();
80548
+ }
80549
+ this.preHeight = (_e = (_d = this.mobileClient) == null ? void 0 : _d.virtualViewportHeight) != null ? _e : 0;
80598
80550
  }, this.toggleDelay));
80599
80551
  __publicField(this, "handScroll", debounce__default.default(() => {
80600
80552
  const input2 = this.editor.input.getInput();
80601
- if (input2) {
80553
+ if (input2 && this.mobileClient) {
80602
80554
  const inputRect = input2.getBoundingClientRect();
80603
- if (inputRect.bottom > this.virtualViewportHeight || inputRect.top < 0) {
80555
+ if (inputRect.bottom > this.mobileClient.virtualViewportHeight || inputRect.top < 0) {
80604
80556
  input2.style.top = `${this.editor.scrollContainer.scrollTop}px`;
80605
80557
  }
80606
80558
  }
80607
80559
  }, 100));
80608
80560
  __publicField(this, "handleFocusIn", () => {
80609
- if (!this.showKeyboard) {
80610
- this.showKeyboard = true;
80611
- }
80612
- this.toggle();
80561
+ this.layoutBar();
80613
80562
  });
80614
80563
  __publicField(this, "handleFocusOut", () => {
80615
- if (this.showKeyboard) {
80616
- this.showKeyboard = false;
80617
- }
80618
- this.toggle();
80564
+ this.layoutBar();
80619
80565
  });
80566
+ var _a, _b;
80620
80567
  this.editor = editor;
80621
- createMobileBottomMenu();
80622
80568
  this.commandBar = new MobileToolbarHandler(editor, document.body);
80623
80569
  this.observer = new ActiveElementObserver({
80624
80570
  onFocused: this.handleFocusIn,
80625
80571
  onBlurred: this.handleFocusOut
80626
80572
  });
80627
- this.toggle();
80628
- setTimeout(() => {
80629
- const container = this.commandBar.bar.firstChild;
80630
- if (container.scrollWidth > container.clientWidth) {
80631
- container.classList.add("overflowing");
80632
- } else {
80633
- container.classList.remove("overflowing");
80634
- }
80635
- }, 500);
80573
+ this.layoutBar();
80636
80574
  this.editor.scrollContainer.addEventListener("scroll", this.handScroll);
80637
- }
80638
- get window() {
80639
- if (window.top) {
80640
- return window.top;
80575
+ this.mobileClient = this.editor.options.componentsOptions.mobile;
80576
+ this.preHeight = (_b = (_a = this.mobileClient) == null ? void 0 : _a.virtualViewportHeight) != null ? _b : 0;
80577
+ if (clientType.isAndroid) {
80578
+ this.timer = setInterval(() => {
80579
+ var _a2, _b2;
80580
+ if (((_a2 = this.mobileClient) == null ? void 0 : _a2.virtualViewportHeight) !== this.preHeight || ((_b2 = this.mobileClient) == null ? void 0 : _b2.virtualViewportOffsetTop) !== 0) {
80581
+ this.layoutBar();
80582
+ }
80583
+ }, 1e3);
80641
80584
  }
80642
- return window;
80643
- }
80644
- get virtualViewportHeight() {
80645
- var _a, _b;
80646
- const virtualViewportHeight = (_b = (_a = this.window.visualViewport) == null ? void 0 : _a.height) != null ? _b : this.clientHeight;
80647
- return virtualViewportHeight;
80648
- }
80649
- get clientHeight() {
80650
- const clientHeight = this.window.document.body.clientHeight;
80651
- return clientHeight;
80652
80585
  }
80653
80586
  destroy() {
80587
+ clearInterval(this.timer);
80654
80588
  this.observer.destroy();
80655
80589
  this.commandBar.destroy();
80656
80590
  this.editor.scrollContainer.removeEventListener("scroll", this.handScroll);
80657
80591
  }
80658
80592
  }
80659
- const mobileHelperStyles = "";
80660
- const zhCN$8 = {
80661
- mobile: {
80662
- insert: "\u63D2\u5165",
80663
- commands: {
80664
- select: "\u9009\u62E9"
80665
- }
80666
- }
80667
- };
80668
- const enUS$8 = {
80669
- mobile: {
80670
- insert: "Insert",
80671
- commands: {
80672
- select: "Select"
80673
- }
80674
- }
80675
- };
80676
- const jaJP$8 = {
80677
- mobile: {
80678
- insert: "\u633F\u5165",
80679
- commands: {
80680
- select: "\u9078\u629E"
80681
- }
80682
- }
80683
- };
80684
- i18n$1.mergeLang({
80685
- "zh-CN": zhCN$8,
80686
- "en-US": enUS$8,
80687
- "ja-JP": jaJP$8
80688
- });
80689
80593
  class MobileEmbedMask {
80690
80594
  constructor(editor) {
80691
80595
  __publicField(this, "addMask", (block) => {
@@ -80719,6 +80623,36 @@ ${content}
80719
80623
  this.editor.removeListener("selectionChanged", this.handleSelectionChanged);
80720
80624
  }
80721
80625
  }
80626
+ const zhCN$8 = {
80627
+ mobile: {
80628
+ insert: "\u63D2\u5165",
80629
+ commands: {
80630
+ select: "\u9009\u62E9"
80631
+ }
80632
+ }
80633
+ };
80634
+ const enUS$8 = {
80635
+ mobile: {
80636
+ insert: "Insert",
80637
+ commands: {
80638
+ select: "Select"
80639
+ }
80640
+ }
80641
+ };
80642
+ const jaJP$8 = {
80643
+ mobile: {
80644
+ insert: "\u633F\u5165",
80645
+ commands: {
80646
+ select: "\u9078\u629E"
80647
+ }
80648
+ }
80649
+ };
80650
+ i18n$1.mergeLang({
80651
+ "zh-CN": zhCN$8,
80652
+ "en-US": enUS$8,
80653
+ "ja-JP": jaJP$8
80654
+ });
80655
+ const mobileHelperStyles = "";
80722
80656
  const LONG_PRESS_DELAY = 800;
80723
80657
  class OnesEditorMobileHelper {
80724
80658
  constructor(editor) {
@@ -80738,7 +80672,6 @@ ${content}
80738
80672
  return false;
80739
80673
  }
80740
80674
  if (!range.isSimple()) {
80741
- this.editor.selection.setRange(range);
80742
80675
  return true;
80743
80676
  }
80744
80677
  const block = this.editor.getBlockById(range.start.blockId);
@@ -80753,17 +80686,6 @@ ${content}
80753
80686
  this.editor.selection.selectBlock(block, offset, offset + 1);
80754
80687
  return true;
80755
80688
  }
80756
- if (this.editor.selection.range.isCollapsed()) {
80757
- const rangeRect = getBlockClientRects(this.editor, block, this.editor.selection.range);
80758
- const clientX = event.touches[0].clientX;
80759
- const clientY = event.touches[0].clientY;
80760
- const step = 10;
80761
- const inRect = rangeRect.some((rect) => clientX > rect.left - step && clientX < rect.right + step && clientY > rect.top - step && clientY < rect.bottom + step);
80762
- if (inRect) {
80763
- this.cursorToolbar.showToolbar();
80764
- return true;
80765
- }
80766
- }
80767
80689
  }
80768
80690
  return false;
80769
80691
  });
@@ -80781,16 +80703,32 @@ ${content}
80781
80703
  }, LONG_PRESS_DELAY);
80782
80704
  }
80783
80705
  });
80706
+ __publicField(this, "debounceShowCursorToolbar", debounce__default.default(() => {
80707
+ if (this.editor.selection.range.isCollapsed()) {
80708
+ this.cursorToolbar.showToolbar();
80709
+ }
80710
+ }, 400));
80784
80711
  __publicField(this, "handleTouchEnd", (event) => {
80785
80712
  if (this.longPressTimeout) {
80786
80713
  window.clearTimeout(this.longPressTimeout);
80787
80714
  this.longPressTimeout = 0;
80788
80715
  }
80789
- this.isMoving = false;
80790
- if (this.longPressTriggered) {
80716
+ if (this.longPressTriggered || this.isMoving) {
80791
80717
  event.preventDefault();
80792
80718
  event.stopPropagation();
80793
- this.longPressTriggered = false;
80719
+ }
80720
+ this.longPressTriggered = false;
80721
+ this.isMoving = false;
80722
+ if (this.editor.selection.range.isCollapsed()) {
80723
+ const block = this.editor.selection.focusedBlock;
80724
+ const rangeRect = getBlockClientRects(this.editor, block, this.editor.selection.range);
80725
+ const clientX = event.changedTouches[0].clientX;
80726
+ const clientY = event.changedTouches[0].clientY;
80727
+ const step = 18;
80728
+ const inRect = rangeRect.some((rect) => clientX > rect.left - step && clientX < rect.right + step && clientY > rect.top - step && clientY < rect.bottom + step);
80729
+ if (inRect) {
80730
+ this.debounceShowCursorToolbar();
80731
+ }
80794
80732
  }
80795
80733
  });
80796
80734
  this.editor = editor;
@@ -80802,6 +80740,7 @@ ${content}
80802
80740
  this.gripper = new SelectionGripper(this.editor);
80803
80741
  this.cursorToolbar = createCursorToolbar(this.editor);
80804
80742
  this.mobileEmbedMask = new MobileEmbedMask(this.editor);
80743
+ createMobileBottomMenu();
80805
80744
  }
80806
80745
  destroy() {
80807
80746
  this.editor.removeListener("selectionChanged", this.handleSelectionChange);
@@ -82613,7 +82552,7 @@ ${content}
82613
82552
  reject();
82614
82553
  }
82615
82554
  });
82616
- dialog.addListener("show", focus);
82555
+ dialog.addListener("shown", focus);
82617
82556
  dialog.show();
82618
82557
  const input2 = getField();
82619
82558
  bindKeyDownEvent(input2, async (event, composing) => {
@@ -82665,7 +82604,7 @@ ${content}
82665
82604
  function getBlockProperties$5(editor, block) {
82666
82605
  const properties = getStandardEmbedBlockProperties(editor, block, {
82667
82606
  presetIds: ["add-comment"],
82668
- extCommands: [{
82607
+ extCommands: editor.readonly ? [] : [{
82669
82608
  id: "refresh",
82670
82609
  name: i18n$1.t("webpage.command.refresh"),
82671
82610
  icon: RefreshIcon
@@ -83470,9 +83409,6 @@ ${content}
83470
83409
  return false;
83471
83410
  },
83472
83411
  extCommands: (editor2, block2) => {
83473
- if (editor2.readonly) {
83474
- return [];
83475
- }
83476
83412
  const blockContent = getBlockContent(block2);
83477
83413
  const drawioImg = blockContent.querySelector(".editor-drawio-content img");
83478
83414
  return [{
@@ -83724,16 +83660,13 @@ ${content}
83724
83660
  this.properties = properties;
83725
83661
  }
83726
83662
  extCommands(editor, block) {
83727
- const commands = [
83663
+ let commands = [
83728
83664
  {
83729
83665
  id: "help",
83730
83666
  name: i18n$1.t("graph.help"),
83731
83667
  icon: HelpIcon
83732
83668
  }
83733
83669
  ];
83734
- if (editor.readonly) {
83735
- return commands;
83736
- }
83737
83670
  const blockContent = getBlockContent(block);
83738
83671
  const graphImg = blockContent.querySelector("img.graph-embed-image");
83739
83672
  const graphImgSrc = graphImg == null ? void 0 : graphImg.src;
@@ -83743,6 +83676,9 @@ ${content}
83743
83676
  icon: DownloadIcon$1,
83744
83677
  states: !graphImgSrc ? ["disabled"] : []
83745
83678
  });
83679
+ if (editor.readonly) {
83680
+ commands = commands.filter((c) => c.id !== "help");
83681
+ }
83746
83682
  return commands;
83747
83683
  }
83748
83684
  handleExecuteCommand(editor, block, item) {
@@ -84864,13 +84800,15 @@ ${data2.flowchartText}
84864
84800
  }
84865
84801
  setFullScreen() {
84866
84802
  var _a;
84867
- assert(logger$8, (_a = this.mediaContainer) == null ? void 0 : _a.parentElement, "The media element not exist");
84868
- addClass(this.mediaContainer.parentElement, "full-screen");
84803
+ if ((_a = this.mediaContainer) == null ? void 0 : _a.parentElement) {
84804
+ addClass(this.mediaContainer.parentElement, "full-screen");
84805
+ }
84869
84806
  }
84870
84807
  removeFullScreen() {
84871
84808
  var _a;
84872
- assert(logger$8, (_a = this.mediaContainer) == null ? void 0 : _a.parentElement, "The media element not exist");
84873
- removeClass(this.mediaContainer.parentElement, "full-screen");
84809
+ if ((_a = this.mediaContainer) == null ? void 0 : _a.parentElement) {
84810
+ removeClass(this.mediaContainer.parentElement, "full-screen");
84811
+ }
84874
84812
  }
84875
84813
  updateBlockAlign(blockData, content) {
84876
84814
  const block = getParentBlock(content);
@@ -87118,7 +87056,7 @@ ${data2.flowchartText}
87118
87056
  }
87119
87057
  onClick(editor, item) {
87120
87058
  const block = editor.getBlockById(editor.selection.range.start.blockId);
87121
- const insertMenuProvider = new InsertMenuProvider$1(editor);
87059
+ const insertMenuProvider = new InsertMenuProvider(editor);
87122
87060
  const commands = insertMenuProvider.getAvailableCommands(editor, block, editor.selection.range);
87123
87061
  const command = commands.find((c) => c.id === "insert-image");
87124
87062
  if (command) {
@@ -87438,7 +87376,7 @@ ${data2.flowchartText}
87438
87376
  __publicField(this, "manualShowChildren", true);
87439
87377
  __publicField(this, "childrenPlacement", "bottom-start");
87440
87378
  __publicField(this, "children", []);
87441
- const provider = new InsertMenuProvider$1(editor);
87379
+ const provider = new InsertMenuProvider(editor);
87442
87380
  const startBlock = editor.getBlockById(editor.selection.range.start.blockId);
87443
87381
  const container = getParentContainer(startBlock);
87444
87382
  let commands = provider.getInsertCommands(editor, getContainerId(container));
@@ -87449,7 +87387,7 @@ ${data2.flowchartText}
87449
87387
  this.children = commands;
87450
87388
  }
87451
87389
  onClick(editor, item) {
87452
- const provider = new InsertMenuProvider$1(editor);
87390
+ const provider = new InsertMenuProvider(editor);
87453
87391
  const startBlock = editor.getBlockById(editor.selection.range.start.blockId);
87454
87392
  provider.executeCommand(editor, startBlock, editor.selection.range, item, {});
87455
87393
  }
@@ -87872,7 +87810,7 @@ ${data2.flowchartText}
87872
87810
  }
87873
87811
  }
87874
87812
  });
87875
- editor.version = "2.1.7-beta.15";
87813
+ editor.version = "2.1.7-beta.17";
87876
87814
  if (Logger$2.level === LogLevel.DEBUG) {
87877
87815
  window.setReauthFail = (fail) => {
87878
87816
  window.isReauthError = fail;
@@ -87991,7 +87929,7 @@ ${data2.flowchartText}
87991
87929
  }
87992
87930
  }
87993
87931
  OnesEditorToolbar.register(editor);
87994
- editor.version = "2.1.7-beta.15";
87932
+ editor.version = "2.1.7-beta.17";
87995
87933
  return editor;
87996
87934
  }
87997
87935
  async function showDocVersions(editor, options, serverUrl) {
@@ -133833,7 +133771,7 @@ ${data2.flowchartText}
133833
133771
  exports2.InsertImageItem = InsertImageItem;
133834
133772
  exports2.InsertItem = InsertItem;
133835
133773
  exports2.InsertLinkItem = InsertLinkItem;
133836
- exports2.InsertMenuProvider = InsertMenuProvider$1;
133774
+ exports2.InsertMenuProvider = InsertMenuProvider;
133837
133775
  exports2.LayoutBlock = LayoutBlock;
133838
133776
  exports2.LayoutBlockCaptionInputHandler = LayoutBlockCaptionInputHandler;
133839
133777
  exports2.LayoutQuickMenuItemFilter = LayoutQuickMenuItemFilter;
@@ -133980,7 +133918,6 @@ ${data2.flowchartText}
133980
133918
  exports2.createEmptyContainer = createEmptyContainer;
133981
133919
  exports2.createEmptyDoc = createEmptyDoc$1;
133982
133920
  exports2.createEmptyTextBlockData = createEmptyTextBlockData;
133983
- exports2.createEntireRowAndColumnRange = createEntireRowAndColumnRange;
133984
133921
  exports2.createExpandedRange = createExpandedRange;
133985
133922
  exports2.createIconButton = createIconButton;
133986
133923
  exports2.createImage = createImage;
@@ -134001,8 +133938,6 @@ ${data2.flowchartText}
134001
133938
  exports2.createTextWithReplaceSoftReturn = createTextWithReplaceSoftReturn;
134002
133939
  exports2.daysAfter = daysAfter;
134003
133940
  exports2.deleteColor = deleteColor;
134004
- exports2.deleteColumns = deleteColumns;
134005
- exports2.deleteRows = deleteRows;
134006
133941
  exports2.deleteText = deleteText;
134007
133942
  exports2.diffDays = diffDays;
134008
133943
  exports2.disablePageScroll = disablePageScroll;
@@ -134066,6 +134001,7 @@ ${data2.flowchartText}
134066
134001
  exports2.editorReplaceBlockText = editorReplaceBlockText;
134067
134002
  exports2.editorReplaceContainer = editorReplaceContainer;
134068
134003
  exports2.editorRunOnce = editorRunOnce;
134004
+ exports2.editorScrollIntoView = editorScrollIntoView;
134069
134005
  exports2.editorSelectAll = editorSelectAll;
134070
134006
  exports2.editorSelectContainer = editorSelectContainer;
134071
134007
  exports2.editorSelectDown = editorSelectDown;
@@ -134122,7 +134058,6 @@ ${data2.flowchartText}
134122
134058
  exports2.fromNowString = fromNowString;
134123
134059
  exports2.genId = genId;
134124
134060
  exports2.generateEditorContainerId = generateEditorContainerId;
134125
- exports2.getAbstractTableSelectionRange = getAbstractTableSelectionRange;
134126
134061
  exports2.getAllChildBlocks = getAllChildBlocks;
134127
134062
  exports2.getAllSelectedBlocks = getAllSelectedBlocks;
134128
134063
  exports2.getAttributesAt = getAttributesAt;
@@ -134246,10 +134181,8 @@ ${data2.flowchartText}
134246
134181
  exports2.injectSource = injectSource;
134247
134182
  exports2.injectStyle = injectStyle;
134248
134183
  exports2.inputActions = actions;
134249
- exports2.insertColumn = insertColumn;
134250
134184
  exports2.insertEmptyBlock = insertEmptyBlock;
134251
134185
  exports2.insertEmptyEmbedBlock = insertEmptyEmbedBlock;
134252
- exports2.insertRow = insertRow;
134253
134186
  exports2.insertText = insertText;
134254
134187
  exports2.intersectionCommands = intersectionCommands;
134255
134188
  exports2.isBackspace = isBackspace;
@@ -134361,7 +134294,7 @@ ${data2.flowchartText}
134361
134294
  exports2.requestDownload = requestDownload;
134362
134295
  exports2.resetListStart = resetListStart;
134363
134296
  exports2.saveAs = saveAs$1;
134364
- exports2.scrollIntoView = scrollIntoView$1;
134297
+ exports2.scrollIntoView = scrollIntoView;
134365
134298
  exports2.scrollable = scrollable;
134366
134299
  exports2.selectFile = selectFile;
134367
134300
  exports2.selectedBlockToDoc = selectedBlockToDoc;
@@ -134369,12 +134302,9 @@ ${data2.flowchartText}
134369
134302
  exports2.setAttributes = setAttributes;
134370
134303
  exports2.setClipboardData = setClipboardData;
134371
134304
  exports2.setClipboardDataByEvent = setClipboardDataByEvent;
134372
- exports2.setColTitle = setColTitle;
134373
134305
  exports2.setColorToAttributes = setColorToAttributes;
134374
134306
  exports2.setDataset = setDataset;
134375
134307
  exports2.setDefaultCursor = setDefaultCursor;
134376
- exports2.setRowTitle = setRowTitle;
134377
- exports2.setStripeStyle = setStripeStyle;
134378
134308
  exports2.setStyles = setStyles;
134379
134309
  exports2.shareDBCommentToDocObject = shareDBCommentToDocObject;
134380
134310
  exports2.shareDBDocCommentToComment = shareDBDocCommentToComment;