@ones-editor/editor 2.1.1-beta.49 → 2.1.1-beta.50

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.
@@ -29,7 +29,7 @@ declare class EditorInput {
29
29
  showSuffix: () => void;
30
30
  hideSuffix: () => void;
31
31
  handleInput: (e: Event) => void;
32
- handleClose: (e: Event) => void;
32
+ handleClose: (e: Event | TouchEvent) => void;
33
33
  init(): HTMLDivElement;
34
34
  destroy(): void;
35
35
  }
package/dist/index.js CHANGED
@@ -1200,6 +1200,7 @@ div.tippy-box button {
1200
1200
  max-width: 100%;
1201
1201
  border-radius: 8px 8px 0px 0px;
1202
1202
  box-shadow: 0px 0px 8px 0px rgba(45, 45, 46, 0.1019607843);
1203
+ overscroll-behavior: contain;
1203
1204
  }
1204
1205
  div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar {
1205
1206
  display: flex;
@@ -1213,9 +1214,38 @@ div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar {
1213
1214
  div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar .command-item {
1214
1215
  width: 100%;
1215
1216
  padding: 10px 16px;
1216
- color: #2D2D2E;
1217
+ color: #2d2d2e;
1217
1218
  font-size: 14px;
1218
1219
  }
1220
+ div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar .command-item.section {
1221
+ height: 16px;
1222
+ padding: 0px;
1223
+ background: #f7f8fa;
1224
+ }
1225
+ div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar .command-item .menu-item-checked-icon {
1226
+ width: 28px;
1227
+ height: 16px;
1228
+ border-radius: 8px;
1229
+ background-color: rgb(135, 136, 138);
1230
+ }
1231
+ div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar .command-item .menu-item-checked-icon::after {
1232
+ content: " ";
1233
+ position: relative;
1234
+ left: 2px;
1235
+ top: 2px;
1236
+ height: 12px;
1237
+ width: 12px;
1238
+ display: block;
1239
+ border-radius: 6px;
1240
+ background-color: white;
1241
+ }
1242
+ div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar .command-item .menu-item-checked-icon.checked {
1243
+ background-color: rgb(0, 168, 101);
1244
+ }
1245
+ div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar .command-item .menu-item-checked-icon.checked::after {
1246
+ position: relative;
1247
+ left: 12px;
1248
+ }
1219
1249
  div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar .command-item.selected {
1220
1250
  background: rgba(0, 36, 90, 0.0588235294);
1221
1251
  }
@@ -1296,10 +1326,10 @@ div[data-command-bar-id=mobile-bottom-menu] .tippy-content .mobile-menu-wrap .mo
1296
1326
  height: 44px;
1297
1327
  line-height: 44px;
1298
1328
  text-align: center;
1299
- color: #2D2D2E;
1329
+ color: #2d2d2e;
1300
1330
  font-size: 16px;
1301
1331
  font-weight: 500;
1302
- border-bottom: 1px solid #DFE1E5;
1332
+ border-bottom: 1px solid #dfe1e5;
1303
1333
  }
1304
1334
  div[data-command-bar-id=mobile-bottom-menu] .tippy-content .mobile-menu-wrap .mobile-menu-header [data-button-id=mobile-bottom-menu-close] {
1305
1335
  float: right;
@@ -1311,7 +1341,7 @@ div[data-command-bar-id=mobile-bottom-menu] .tippy-content .mobile-menu-wrap .mo
1311
1341
  align-items: center;
1312
1342
  margin-top: 12px;
1313
1343
  margin-right: 12px;
1314
- color: #2D2D2E;
1344
+ color: #2d2d2e;
1315
1345
  }
1316
1346
  div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar-root {
1317
1347
  box-shadow: none !important;
@@ -1585,6 +1615,13 @@ div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar.menu .menu-ite
1585
1615
  color: #87888a;
1586
1616
  font-size: 12px;
1587
1617
  }
1618
+ .editor-input-wrap .editor-input-container .editor-input-icon {
1619
+ display: flex;
1620
+ align-items: center;
1621
+ justify-content: center;
1622
+ width: 20px;
1623
+ height: 20px;
1624
+ }
1588
1625
  .editor-input-wrap .editor-input-container .editor-input-suffix {
1589
1626
  right: 10px;
1590
1627
  }
@@ -2451,6 +2488,7 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
2451
2488
  [data-command-bar-id=link-popup-mobile] {
2452
2489
  width: calc(100vw - 50px);
2453
2490
  max-width: 350px;
2491
+ overscroll-behavior: contain;
2454
2492
  }
2455
2493
  [data-command-bar-id=link-popup-mobile] .tippy-content {
2456
2494
  padding: 0px;
@@ -5752,7 +5790,8 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
5752
5790
  div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content {
5753
5791
  max-height: 400px;
5754
5792
  height: 400px;
5755
- overflow: scroll;
5793
+ overflow-x: auto;
5794
+ overscroll-behavior: contain;
5756
5795
  }
5757
5796
  div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content .mobile-item {
5758
5797
  display: flex;
@@ -12002,7 +12041,11 @@ var __publicField = (obj, key, value) => {
12002
12041
  function getCaretRect$4(block, pos) {
12003
12042
  const content = getBlockContent(block);
12004
12043
  const rect = content.getBoundingClientRect();
12005
- return new DOMRect(rect.left + rect.width / 2, rect.top, 1, rect.height);
12044
+ assert(logger$4a, pos.offset === 0 || pos.offset === 1, `invalid offset: ${pos.offset}`);
12045
+ if (pos.offset === 1) {
12046
+ return new DOMRect(rect.right, rect.top, 0, rect.height);
12047
+ }
12048
+ return new DOMRect(rect.left, rect.top, rect.width, rect.height);
12006
12049
  }
12007
12050
  function updateSelection$5(editor, block, from, to) {
12008
12051
  addClass(block, "selected");
@@ -38981,6 +39024,9 @@ ${codeText}
38981
39024
  if (!item) {
38982
39025
  return;
38983
39026
  }
39027
+ if (item.switchable && !(target == null ? void 0 : target.closest(".menu-item-checked-icon"))) {
39028
+ return;
39029
+ }
38984
39030
  const customItem = (item == null ? void 0 : item.element) && !item.children;
38985
39031
  if (clientType.isMobile && !customItem) {
38986
39032
  event.preventDefault();
@@ -40121,9 +40167,12 @@ ${codeText}
40121
40167
  subIndicator.innerHTML = ArrowRightIcon;
40122
40168
  elem.appendChild(subIndicator);
40123
40169
  }
40124
- if ((_b = item.states) == null ? void 0 : _b.includes("checked")) {
40170
+ if (item.switchable) {
40125
40171
  const checkedIcon = createElement("div", ["menu-item-checked-icon"], null);
40126
- checkedIcon.innerHTML = CheckMarkIcon;
40172
+ if ((_b = item.states) == null ? void 0 : _b.includes("checked")) {
40173
+ addClass(checkedIcon, "checked");
40174
+ }
40175
+ elem.appendChild(checkedIcon);
40127
40176
  }
40128
40177
  }
40129
40178
  }
@@ -40271,7 +40320,8 @@ ${codeText}
40271
40320
  var _a;
40272
40321
  return new MobileBottomMenu((_a = parentItem.children) != null ? _a : [], closeable, {
40273
40322
  ...options,
40274
- parentItem
40323
+ parentItem,
40324
+ autoClose: true
40275
40325
  });
40276
40326
  }
40277
40327
  function createMobileBottomMenu() {
@@ -40902,6 +40952,7 @@ ${codeText}
40902
40952
  this.suffix.style.display = "none";
40903
40953
  removeClass(this.input, "has-suffix");
40904
40954
  }
40955
+ e2.preventDefault();
40905
40956
  });
40906
40957
  this.parent = parent;
40907
40958
  this.options = options;
@@ -40958,10 +41009,14 @@ ${codeText}
40958
41009
  }
40959
41010
  if (options.suffixClose) {
40960
41011
  const suffix = createElement("div", ["editor-input-suffix"], inputContainer);
40961
- const closeIcon = createElement("div", ["editor-input-suffix-close"], suffix);
41012
+ const closeIcon = createElement("div", ["editor-input-icon"], suffix);
40962
41013
  closeIcon.innerHTML = ClearIcon;
40963
41014
  suffix.appendChild(closeIcon);
40964
- closeIcon.addEventListener("click", this.handleClose);
41015
+ if (clientType.isMobile) {
41016
+ closeIcon.addEventListener("touchend", this.handleClose);
41017
+ } else {
41018
+ closeIcon.addEventListener("click", this.handleClose);
41019
+ }
40965
41020
  suffix.style.display = "none";
40966
41021
  }
40967
41022
  inputContainer.appendChild(input2);
@@ -43855,7 +43910,7 @@ ${codeText}
43855
43910
  __publicField(this, "groupIndex", TABLE_COMMAND_GROUP_INDEX);
43856
43911
  }
43857
43912
  getAvailableCommands(editor, block, range) {
43858
- if (getBlockType(block) !== "table") {
43913
+ if (getBlockType(block) !== "table" || clientType.isMobile) {
43859
43914
  return [];
43860
43915
  }
43861
43916
  const ext = {
@@ -50040,9 +50095,7 @@ ${codeText}
50040
50095
  return;
50041
50096
  }
50042
50097
  }
50043
- if (clientType.isMobile) {
50044
- this.showObjectToolbar(null);
50045
- } else {
50098
+ if (!clientType.isMobile) {
50046
50099
  this.toolbar.close("selectionChange");
50047
50100
  }
50048
50101
  this.oldRange = null;
@@ -50166,7 +50219,7 @@ ${codeText}
50166
50219
  this.showTextToolbar(reason);
50167
50220
  }
50168
50221
  showTextToolbar(reason) {
50169
- var _a, _b;
50222
+ var _a;
50170
50223
  if (this._disableTextToolbar) {
50171
50224
  return;
50172
50225
  }
@@ -50209,12 +50262,17 @@ ${codeText}
50209
50262
  const reverseToolbar = !this.editor.selection.range.isReverse() && lastBlock2 !== firstBlock;
50210
50263
  const selectedBlock = reverseToolbar ? lastBlock2 : firstBlock;
50211
50264
  const rect = getReferenceClientRect(this.editor, selectedBlock);
50212
- const anchor2 = createBlockAnchor(this.editor, selectedBlock.block, "editor-quick-menu", rect);
50213
- this.toolbar.manualShow(anchor2, {
50214
- placement: reverseToolbar ? "bottom" : "top",
50215
- offset: [0, reverseToolbar ? 5 : 10]
50216
- });
50217
- (_b = (_a = this.toolbar.tippyInstance) == null ? void 0 : _a.popperInstance) == null ? void 0 : _b.update();
50265
+ if (!this.toolbar.isVisible) {
50266
+ const anchor2 = createBlockAnchor(this.editor, selectedBlock.block, "editor-quick-menu", rect);
50267
+ this.toolbar.manualShow(anchor2, {
50268
+ placement: reverseToolbar ? "bottom" : "top",
50269
+ offset: clientType.isMobile ? [0, 14] : [0, 0]
50270
+ });
50271
+ } else {
50272
+ (_a = this.toolbar.tippyInstance) == null ? void 0 : _a.setProps({
50273
+ getReferenceClientRect: () => rect || new DOMRect()
50274
+ });
50275
+ }
50218
50276
  }
50219
50277
  showObjectToolbar(event) {
50220
50278
  var _a, _b, _c;
@@ -62342,19 +62400,22 @@ ${codeText}
62342
62400
  }
62343
62401
  return true;
62344
62402
  }
62345
- function applyContentPlaceholder(editor, options) {
62346
- var _a, _b, _c, _d;
62403
+ function getBlockPlaceholder(editor, options) {
62404
+ var _a, _b, _c;
62347
62405
  const block = editor.selection.focusedBlock;
62348
62406
  const blockType = getBlockType(block);
62349
62407
  const defaultPlaceholder = options.contentPlaceholder || i18n$1.t("placeholder.default");
62350
62408
  let placeholder2 = defaultPlaceholder;
62409
+ if (clientType.isMobile) {
62410
+ return i18n$1.t("placeholder.common.contentInCallout");
62411
+ }
62351
62412
  if (blockType && isTextKindBlockType(editor, blockType)) {
62352
62413
  if (block) {
62353
62414
  if (!editor.isBlockWritable(block)) {
62354
- return;
62415
+ return "";
62355
62416
  }
62356
62417
  if (isCodeLineBlock(block)) {
62357
- return;
62418
+ return "";
62358
62419
  }
62359
62420
  if (isChildBlock(block)) {
62360
62421
  const parentContainerBlock = getParentBlock(getParentContainer(block));
@@ -62368,6 +62429,11 @@ ${codeText}
62368
62429
  placeholder2 = (_c = getTextKindBlockPlaceholder(block)) != null ? _c : placeholder2;
62369
62430
  }
62370
62431
  }
62432
+ return placeholder2;
62433
+ }
62434
+ function applyContentPlaceholder(editor, options) {
62435
+ var _a;
62436
+ const blockPlaceholder = getBlockPlaceholder(editor, options);
62371
62437
  const titleBlock = editor.getFirstBlock();
62372
62438
  const firstContentBlock = options.hideTitle ? titleBlock : getNextBlock(titleBlock);
62373
62439
  if (!firstContentBlock) {
@@ -62384,7 +62450,7 @@ ${codeText}
62384
62450
  applyPlaceholderToBlock(
62385
62451
  editor,
62386
62452
  firstContentBlock,
62387
- (_d = getTextKindBlockPlaceholder(firstContentBlock)) != null ? _d : defaultPlaceholder
62453
+ (_a = getTextKindBlockPlaceholder(firstContentBlock)) != null ? _a : blockPlaceholder
62388
62454
  );
62389
62455
  return;
62390
62456
  }
@@ -62396,7 +62462,7 @@ ${codeText}
62396
62462
  if (focusedBlock === titleBlock && !options.hideTitle) {
62397
62463
  return;
62398
62464
  }
62399
- applyPlaceholderToBlock(editor, focusedBlock, placeholder2);
62465
+ applyPlaceholderToBlock(editor, focusedBlock, blockPlaceholder);
62400
62466
  }
62401
62467
  function applyTitlePlaceholder(editor, options) {
62402
62468
  var _a, _b;
@@ -64694,6 +64760,9 @@ ${codeText}
64694
64760
  this.block = block;
64695
64761
  }
64696
64762
  get commands() {
64763
+ if (clientType.isMobile) {
64764
+ return [];
64765
+ }
64697
64766
  if (this.isHoveringImageEmpty()) {
64698
64767
  return [];
64699
64768
  }
@@ -64760,6 +64829,9 @@ ${codeText}
64760
64829
  editor.addCustom("image-select-handler", () => new ImageSelectHandler(editor));
64761
64830
  editor.addCustom("image-copy-handler", () => new ImageCopyHandler(editor));
64762
64831
  setTimeout(() => {
64832
+ if (clientType.isMobile) {
64833
+ return;
64834
+ }
64763
64835
  editor.addCustom("drag-handler", () => new OnesEditorImageDragHandler(editor));
64764
64836
  const imageResizer = editor.addCustom("image-resizer", () => new ImageResizer(editor));
64765
64837
  const data2 = blockData.embedData;
@@ -68769,9 +68841,11 @@ ${codeText}
68769
68841
  table.classList.add("drag-preview-element");
68770
68842
  tableContent.appendChild(table);
68771
68843
  const options = editor.getComponentOptions("table");
68772
- handleTableResizeMouseEvent(editor);
68844
+ if (!clientType.isMobile) {
68845
+ handleTableResizeMouseEvent(editor);
68846
+ handleTableBorderBar(editor, "create");
68847
+ }
68773
68848
  handlePasteInTableEvent$1(editor);
68774
- handleTableBorderBar(editor, "create");
68775
68849
  handleTableDocChanged(editor);
68776
68850
  if (!(options == null ? void 0 : options.hideCellMenu) && !clientType.isMobile) {
68777
68851
  handleTableCellMenu(editor);
@@ -68821,9 +68895,11 @@ ${codeText}
68821
68895
  oldTable.insertAdjacentElement("afterend", newTable);
68822
68896
  oldTable.remove();
68823
68897
  const options = editor.getComponentOptions("table");
68824
- handleTableResizeMouseEvent(editor);
68898
+ if (!clientType.isMobile) {
68899
+ handleTableResizeMouseEvent(editor);
68900
+ handleTableBorderBar(editor, "update");
68901
+ }
68825
68902
  handlePasteInTableEvent$1(editor);
68826
- handleTableBorderBar(editor, "update");
68827
68903
  handleTableDocChanged(editor);
68828
68904
  if (!(options == null ? void 0 : options.hideCellMenu) && !clientType.isMobile) {
68829
68905
  handleTableCellMenu(editor);
@@ -69842,6 +69918,130 @@ ${codeText}
69842
69918
  "Tab": handleTab,
69843
69919
  "Shift+Tab": handleShiftTab
69844
69920
  };
69921
+ class MobileTableCommandProvider {
69922
+ constructor(editor) {
69923
+ __publicField(this, "id", "MobileTableCommandProvider");
69924
+ __publicField(this, "getAvailableCommands", (editor, block, range) => {
69925
+ const tableBlock = getParentTableBlock(block);
69926
+ if (!tableBlock) {
69927
+ return [];
69928
+ }
69929
+ const tableData = editor.getBlockData(tableBlock);
69930
+ const children = [{
69931
+ id: "insert-right-col",
69932
+ name: "Insert Right column"
69933
+ }, {
69934
+ id: "insert-bottom-row",
69935
+ name: "Insert Bottom Row"
69936
+ }, {
69937
+ id: "delete-cell",
69938
+ name: "Delete Cell"
69939
+ }, {
69940
+ id: "delete-row",
69941
+ name: "Delete Row"
69942
+ }, {
69943
+ type: "section",
69944
+ id: "section-1",
69945
+ name: ""
69946
+ }, {
69947
+ id: "row-title",
69948
+ name: "Row Title",
69949
+ states: tableData.hasRowTitle ? ["checked"] : [],
69950
+ switchable: true
69951
+ }, {
69952
+ id: "col-title",
69953
+ name: "Col Title",
69954
+ states: tableData.hasColTitle ? ["checked"] : [],
69955
+ switchable: true
69956
+ }, {
69957
+ id: "stripe-style",
69958
+ name: "Stripe Style",
69959
+ states: tableData.isStripeStyle ? ["checked"] : [],
69960
+ switchable: true
69961
+ }, {
69962
+ type: "section",
69963
+ id: "section-2",
69964
+ name: ""
69965
+ }, {
69966
+ id: "delete-table",
69967
+ name: "Delete Table"
69968
+ }];
69969
+ return [
69970
+ {
69971
+ id: "table-commands",
69972
+ name: "\u8868\u683C\u64CD\u4F5C",
69973
+ icon: CircleAddIcon,
69974
+ childrenType: "mobile-bottom-menu",
69975
+ manualShowChildren: true,
69976
+ children
69977
+ }
69978
+ ];
69979
+ });
69980
+ __publicField(this, "deleteRow", (tableBlock) => {
69981
+ deleteRows(createEntireRowAndColumnRange(this.editor, tableBlock, false));
69982
+ });
69983
+ __publicField(this, "deleteCol", (tableBlock) => {
69984
+ deleteColumns(createEntireRowAndColumnRange(this.editor, tableBlock, true));
69985
+ });
69986
+ __publicField(this, "insertRowToBottom", (tableBlock) => {
69987
+ const { toRow } = getAbstractTableSelectionRange(this.editor, tableBlock);
69988
+ insertRow(this.editor, tableBlock, toRow + 1);
69989
+ });
69990
+ __publicField(this, "insertColToRight", (tableBlock) => {
69991
+ const { toCol } = getAbstractTableSelectionRange(this.editor, tableBlock);
69992
+ insertColumn(this.editor, tableBlock, toCol + 1);
69993
+ });
69994
+ __publicField(this, "executeCommand", (editor, block, range, item, params, result) => {
69995
+ var _a;
69996
+ const tableBlock = getParentTableBlock(block);
69997
+ if (!tableBlock) {
69998
+ return false;
69999
+ }
70000
+ const checked = (_a = item.states) == null ? void 0 : _a.includes("checked");
70001
+ switch (item.id) {
70002
+ case "insert-right-col":
70003
+ this.insertColToRight(tableBlock);
70004
+ return true;
70005
+ case "insert-bottom-row":
70006
+ this.insertRowToBottom(tableBlock);
70007
+ return true;
70008
+ case "delete-cell":
70009
+ this.deleteCol(tableBlock);
70010
+ return true;
70011
+ case "delete-row":
70012
+ this.deleteRow(tableBlock);
70013
+ return true;
70014
+ case "row-title":
70015
+ if (checked) {
70016
+ removeRowTitle(editor, tableBlock);
70017
+ } else {
70018
+ setRowTitle(editor, tableBlock);
70019
+ }
70020
+ return true;
70021
+ case "col-title":
70022
+ if (checked) {
70023
+ removeColTitle(editor, tableBlock);
70024
+ } else {
70025
+ setColTitle(editor, tableBlock);
70026
+ }
70027
+ return true;
70028
+ case "stripe-style":
70029
+ if (checked) {
70030
+ removeStripeStyle(editor, tableBlock);
70031
+ } else {
70032
+ setStripeStyle(editor, tableBlock);
70033
+ }
70034
+ return true;
70035
+ case "delete-table":
70036
+ editor.deleteBlock(tableBlock);
70037
+ return true;
70038
+ default:
70039
+ return false;
70040
+ }
70041
+ });
70042
+ this.editor = editor;
70043
+ }
70044
+ }
69845
70045
  class PasteSpecialButton {
69846
70046
  constructor(editor, onPasteSpecial) {
69847
70047
  __publicField(this, "toolbar");
@@ -74893,6 +75093,9 @@ ${content}
74893
75093
  this.editor = editor;
74894
75094
  }
74895
75095
  get commands() {
75096
+ if (clientType.isMobile) {
75097
+ return [];
75098
+ }
74896
75099
  if (this.editor.readonly) {
74897
75100
  return [];
74898
75101
  }
@@ -77822,7 +78025,7 @@ ${content}
77822
78025
  __publicField(this, "createMobileCommandItem", (items) => {
77823
78026
  this.mobileWrap = createElement("div", ["mobile-item-wrap"], null);
77824
78027
  const content = createElement("div", ["mobile-item-content"], null);
77825
- const icon = createElement("div", ["mobile-input-icon"], null);
78028
+ const icon = createElement("div", ["editor-input-icon"], null);
77826
78029
  icon.innerHTML = SearchIcon;
77827
78030
  createInput(this.mobileWrap, {
77828
78031
  onChange: (e2) => this.onInputChanged(content, e2),
@@ -79229,6 +79432,7 @@ ${content}
79229
79432
  __publicField(this, "id", "GroupProvider");
79230
79433
  this.editor = editor;
79231
79434
  this.providers = [
79435
+ new MobileTableCommandProvider(this.editor),
79232
79436
  new TurnIntoCommandProvider(this.editor),
79233
79437
  new TextDropdownProvider(this.editor),
79234
79438
  new AlignDropdownProvider(this.editor)
@@ -79296,26 +79500,21 @@ ${content}
79296
79500
  }
79297
79501
  class ActiveElementObserver {
79298
79502
  constructor(options) {
79299
- __publicField(this, "handleFocusIn", (event) => {
79300
- if (this.isFormElement(event.target)) {
79301
- this.options.onFocused();
79302
- }
79503
+ __publicField(this, "handleFocusIn", () => {
79504
+ this.options.onFocused();
79303
79505
  });
79304
- __publicField(this, "handleFocusOut", (event) => {
79305
- if (this.isFormElement(event.target)) {
79306
- this.options.onBlurred();
79307
- }
79506
+ __publicField(this, "handleFocusOut", () => {
79507
+ this.options.onBlurred();
79308
79508
  });
79309
79509
  this.options = options;
79310
79510
  document.addEventListener("focusin", this.handleFocusIn);
79311
79511
  document.addEventListener("focusout", this.handleFocusOut);
79312
- }
79313
- isFormElement(element) {
79314
- return element.tagName === "INPUT" || element.tagName === "TEXTAREA";
79512
+ window.addEventListener("blur", this.handleFocusOut);
79315
79513
  }
79316
79514
  destroy() {
79317
79515
  document.removeEventListener("focusin", this.handleFocusIn);
79318
79516
  document.removeEventListener("focusout", this.handleFocusOut);
79517
+ window.removeEventListener("blur", this.handleFocusOut);
79319
79518
  }
79320
79519
  }
79321
79520
  const mobile = "";
@@ -79333,14 +79532,12 @@ ${content}
79333
79532
  if (!this.showKeyboard) {
79334
79533
  this.showKeyboard = true;
79335
79534
  }
79336
- this.setDebugInfo();
79337
79535
  this.toggle();
79338
79536
  });
79339
79537
  __publicField(this, "handleFocusOut", () => {
79340
79538
  if (this.showKeyboard) {
79341
79539
  this.showKeyboard = false;
79342
79540
  }
79343
- this.setDebugInfo();
79344
79541
  this.toggle();
79345
79542
  });
79346
79543
  this.editor = editor;
@@ -79387,6 +79584,7 @@ ${content}
79387
79584
  }
79388
79585
  setDebugInfo() {
79389
79586
  setInterval(() => {
79587
+ var _a;
79390
79588
  const visualViewport = document.querySelector("#visualViewport");
79391
79589
  const scrollTop = document.querySelector("#scrollTop");
79392
79590
  const clientHeight = document.querySelector("#clientHeight");
@@ -79396,7 +79594,8 @@ ${content}
79396
79594
  offsetTop: this.window.visualViewport.offsetTop,
79397
79595
  scale: this.window.visualViewport.scale,
79398
79596
  pageTop: this.window.visualViewport.pageTop,
79399
- onscroll: this.window.visualViewport.onscroll
79597
+ onscroll: this.window.visualViewport.onscroll,
79598
+ activeElement: (_a = document.activeElement) == null ? void 0 : _a.tagName
79400
79599
  });
79401
79600
  scrollTop.innerText = JSON.stringify(document.documentElement.scrollTop);
79402
79601
  clientHeight.innerText = `${JSON.stringify(this.clientHeight)} , offset: ${Math.max(this.clientHeight - this.virtualViewportHeight, 0)}`;
@@ -81351,7 +81550,7 @@ ${content}
81351
81550
  assert(logger$f, src, "The src from blockData is invalid ");
81352
81551
  webpage.create(editor, embedData, content, block);
81353
81552
  setTimeout(() => {
81354
- if (editor.isBlockWritable(block)) {
81553
+ if (editor.isBlockWritable(block) && !clientType.isMobile) {
81355
81554
  editor.addCustom("webpage-resizer", () => new WebpageResizer(editor));
81356
81555
  }
81357
81556
  });
@@ -82231,7 +82430,9 @@ ${content}
82231
82430
  function createEmbedContent$4(editor, content, blockData, path, container, block) {
82232
82431
  const drawioData = blockData.embedData;
82233
82432
  mount(editor, content, drawioData);
82234
- EmbedBlockResizer.register(editor, block);
82433
+ if (!clientType.isMobile) {
82434
+ EmbedBlockResizer.register(editor, block);
82435
+ }
82235
82436
  }
82236
82437
  function handleUpdateBlock$3(editor, block, blockData) {
82237
82438
  const data2 = blockData.embedData;
@@ -83946,8 +84147,10 @@ ${data2.flowchartText}
83946
84147
  }
83947
84148
  const block = editor.getBlockById(blockData.id);
83948
84149
  setTimeout(() => {
83949
- const videoResizer = editor.addCustom("video-resizer", () => new VideoResizer(editor));
83950
- videoResizer.updateResizer(block);
84150
+ if (!clientType.isMobile) {
84151
+ const videoResizer = editor.addCustom("video-resizer", () => new VideoResizer(editor));
84152
+ videoResizer.updateResizer(block);
84153
+ }
83951
84154
  });
83952
84155
  return video;
83953
84156
  }
@@ -85752,7 +85955,7 @@ ${data2.flowchartText}
85752
85955
  hideTitle: options.hideTitle,
85753
85956
  headingLevel: 1,
85754
85957
  titlePlaceholder: i18n$1.t("placeholder.common.title"),
85755
- contentPlaceholder: i18n$1.t("placeholder.common.content"),
85958
+ contentPlaceholder: clientType.isMobile ? "" : i18n$1.t("placeholder.common.content"),
85756
85959
  readonlyTitlePlaceholder: i18n$1.t("placeholder.common.readonlyTitle"),
85757
85960
  addPlaceholderToAllCurrentEmptyBlock: true,
85758
85961
  applyContentPlaceholder: (_h = options.placeholder) == null ? void 0 : _h.applyContentPlaceholder
@@ -85846,7 +86049,7 @@ ${data2.flowchartText}
85846
86049
  }
85847
86050
  }
85848
86051
  });
85849
- editor.version = "2.1.1-beta.49";
86052
+ editor.version = "2.1.1-beta.50";
85850
86053
  if (Logger$2.level === LogLevel.DEBUG) {
85851
86054
  window.setReauthFail = (fail) => {
85852
86055
  window.isReauthError = fail;
@@ -85895,7 +86098,7 @@ ${data2.flowchartText}
85895
86098
  hideTitle: options.hideTitle,
85896
86099
  headingLevel: 1,
85897
86100
  titlePlaceholder: i18n$1.t("placeholder.common.title"),
85898
- contentPlaceholder: i18n$1.t("placeholder.common.content"),
86101
+ contentPlaceholder: clientType.isMobile ? "" : i18n$1.t("placeholder.common.content"),
85899
86102
  readonlyTitlePlaceholder: i18n$1.t("placeholder.local.readonlyTitle"),
85900
86103
  addPlaceholderToAllCurrentEmptyBlock: true
85901
86104
  })
@@ -85944,7 +86147,7 @@ ${data2.flowchartText}
85944
86147
  });
85945
86148
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
85946
86149
  OnesEditorToolbar.register(editor);
85947
- editor.version = "2.1.1-beta.49";
86150
+ editor.version = "2.1.1-beta.50";
85948
86151
  return editor;
85949
86152
  }
85950
86153
  async function showDocVersions(editor, options, serverUrl) {
@@ -131751,6 +131954,7 @@ ${data2.flowchartText}
131751
131954
  exports2.Mindmap = Mindmap;
131752
131955
  exports2.MobileCommandHandler = MobileCommandHandler;
131753
131956
  exports2.MobileLinkProvider = MobileLinkProvider;
131957
+ exports2.MobileTableCommandProvider = MobileTableCommandProvider;
131754
131958
  exports2.OnesEditorAutoSuggest = OnesEditorAutoSuggest;
131755
131959
  exports2.OnesEditorCustomDataWrapper = OnesEditorCustomDataWrapper;
131756
131960
  exports2.OnesEditorExclusiveBlock = OnesEditorExclusiveBlock;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.1.1-beta.49",
3
+ "version": "2.1.1-beta.50",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",