@ones-editor/editor 2.1.1-beta.53 → 2.1.1-beta.54

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="lodash" />
1
2
  import { TypedEmitter } from 'tiny-typed-emitter';
2
3
  import { CloseReason, CommandItem, Closeable } from '../../../../@ones-editor/core';
3
4
  import { AbstractManualCommandBar, AbstractCommandBar, CommandBarEvents, CommandBarOptions, CommandItemElement, CreateManualCommandBarFunction, ManualShowCommandBarOptions, SelectItemFrom } from './types';
@@ -29,7 +30,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
29
30
  private getSelectedItemIndex;
30
31
  private getPrevItemIndex;
31
32
  private getNextItemIndex;
32
- protected clearSelectedItem(): void;
33
+ protected clearSelectedItem: import("lodash").DebouncedFunc<() => void>;
33
34
  selectItem(id: string, from?: SelectItemFrom): void;
34
35
  private lastEnterPauseTime;
35
36
  private startPauseMouseEnter;
package/dist/index.js CHANGED
@@ -5829,7 +5829,6 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
5829
5829
  line-height: 2.4;
5830
5830
  }
5831
5831
  div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .command-item .mobile-item-wrap .mobile-item-content {
5832
- max-height: calc(100vh - 180px);
5833
5832
  height: 400px;
5834
5833
  overflow-x: auto;
5835
5834
  overscroll-behavior: contain;
@@ -39073,6 +39072,16 @@ ${codeText}
39073
39072
  disablePageScroll(this.id);
39074
39073
  }
39075
39074
  });
39075
+ __publicField(this, "clearSelectedItem", debounce__default.default(() => {
39076
+ const item = this.getSelectedItem();
39077
+ if (!item) {
39078
+ return;
39079
+ }
39080
+ const elem = this.getItemElementById(item.id);
39081
+ if (elem) {
39082
+ removeClass(elem, "selected");
39083
+ }
39084
+ }, 200));
39076
39085
  __publicField(this, "lastEnterPauseTime", 0);
39077
39086
  __publicField(this, "startPauseMouseEnter", () => {
39078
39087
  this.lastEnterPauseTime = Date.now();
@@ -39133,9 +39142,7 @@ ${codeText}
39133
39142
  }
39134
39143
  if (clientType.isMobile) {
39135
39144
  this.selectItem(id);
39136
- setTimeout(() => {
39137
- this.clearSelectedItem();
39138
- }, 1e3);
39145
+ this.clearSelectedItem();
39139
39146
  }
39140
39147
  if (item.children && item.children.length > 0 && item.manualShowChildren) {
39141
39148
  this.showSubCommandBar(item.childrenMenuId);
@@ -39306,16 +39313,6 @@ ${codeText}
39306
39313
  }
39307
39314
  }
39308
39315
  }
39309
- clearSelectedItem() {
39310
- const item = this.getSelectedItem();
39311
- if (!item) {
39312
- return;
39313
- }
39314
- const elem = this.getItemElementById(item.id);
39315
- if (elem) {
39316
- removeClass(elem, "selected");
39317
- }
39318
- }
39319
39316
  selectItem(id, from = "event") {
39320
39317
  const exists = this.getSelectedItem();
39321
39318
  if (exists) {
@@ -78318,6 +78315,8 @@ ${content}
78318
78315
  __publicField(this, "createMobileCommandItem", (items) => {
78319
78316
  this.mobileWrap = createElement("div", ["mobile-item-wrap"], null);
78320
78317
  const content = createElement("div", ["mobile-item-content"], null);
78318
+ const clientHeight = this.editor.rootContainer.clientHeight;
78319
+ content.style.maxHeight = `${clientHeight - 180}px`;
78321
78320
  const icon = createElement("div", ["editor-input-icon"], null);
78322
78321
  icon.innerHTML = SearchIcon;
78323
78322
  const input2 = createInput(this.mobileWrap, {
@@ -86541,7 +86540,7 @@ ${data2.flowchartText}
86541
86540
  }
86542
86541
  }
86543
86542
  });
86544
- editor.version = "2.1.1-beta.53";
86543
+ editor.version = "2.1.1-beta.54";
86545
86544
  if (Logger$2.level === LogLevel.DEBUG) {
86546
86545
  window.setReauthFail = (fail) => {
86547
86546
  window.isReauthError = fail;
@@ -86639,7 +86638,7 @@ ${data2.flowchartText}
86639
86638
  });
86640
86639
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
86641
86640
  OnesEditorToolbar.register(editor);
86642
- editor.version = "2.1.1-beta.53";
86641
+ editor.version = "2.1.1-beta.54";
86643
86642
  return editor;
86644
86643
  }
86645
86644
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.1.1-beta.53",
3
+ "version": "2.1.1-beta.54",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",