@ones-editor/editor 2.0.7-beta.21 → 2.0.7-beta.22

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.
@@ -31,7 +31,6 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
31
31
  private handleHoveringBlockChildChange;
32
32
  handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
33
33
  updateItems(updater: (items: CommandItem[]) => CommandItem[]): void;
34
- updateItemStates(id: CommandItem['id'], states: Required<CommandItem>['states']): void;
35
34
  update(reason: ShowToolbarReason): void;
36
35
  private showTextToolbar;
37
36
  private showObjectToolbar;
package/dist/index.js CHANGED
@@ -11938,8 +11938,8 @@ var __publicField = (obj, key, value) => {
11938
11938
  continue;
11939
11939
  }
11940
11940
  const rect = elem.getBoundingClientRect();
11941
- if (elem.clientWidth && elem.clientHeight && i === 0) {
11942
- if (rect.left + elem.clientWidth < x || rect.top + elem.clientHeight < y) {
11941
+ if (rect.width && rect.top && i === 0) {
11942
+ if (rect.left + rect.width < x || rect.top + rect.height < y) {
11943
11943
  logger$42.debug("click on scrollbar, out of element rect");
11944
11944
  return null;
11945
11945
  }
@@ -23903,12 +23903,14 @@ var __publicField = (obj, key, value) => {
23903
23903
  setTimeout(() => {
23904
23904
  var _a;
23905
23905
  const focusNode = (_a = document.getSelection()) == null ? void 0 : _a.focusNode;
23906
- if (focusNode && (this.editor.contains(focusNode) || this.isInDisableScrollMask(focusNode) || this.isInCommandBar(focusNode)))
23907
- ;
23908
- else {
23909
- this.editor.emit("blur", this.editor);
23910
- this.callbacks.onBlur();
23906
+ if (focusNode && (this.editor.contains(focusNode) || this.isInDisableScrollMask(focusNode) || this.isInCommandBar(focusNode))) {
23907
+ return;
23911
23908
  }
23909
+ if (clientType.isSafari && !focusNode) {
23910
+ return;
23911
+ }
23912
+ this.editor.emit("blur", this.editor);
23913
+ this.callbacks.onBlur();
23912
23914
  }, 100);
23913
23915
  });
23914
23916
  __publicField(this, "handleEditorSelectionChanged", () => {
@@ -48124,27 +48126,6 @@ ${codeText}
48124
48126
  const updatedItems = updater(this.toolbar.items);
48125
48127
  this.toolbar.updateItems(updatedItems);
48126
48128
  }
48127
- updateItemStates(id, states) {
48128
- var _a;
48129
- const commandItem = this.toolbar.getItemById(id);
48130
- commandItem.states = states;
48131
- if (commandItem.element)
48132
- return;
48133
- const button2 = (_a = this.toolbar.popper) == null ? void 0 : _a.querySelector(`[data-button-id=${id}]`);
48134
- if (!button2)
48135
- return;
48136
- if (states.indexOf("checked") !== -1) {
48137
- addClass(button2, "checked");
48138
- } else {
48139
- removeClass(button2, "checked");
48140
- }
48141
- if (states.indexOf("disabled") !== -1) {
48142
- button2.setAttribute("disabled", "");
48143
- } else {
48144
- button2.removeAttribute("disabled");
48145
- removeClass(button2, "disabled");
48146
- }
48147
- }
48148
48129
  update(reason) {
48149
48130
  if (!this.editor.isWritable()) {
48150
48131
  return;
@@ -80087,13 +80068,6 @@ ${data2.flowchartText}
80087
80068
  states
80088
80069
  };
80089
80070
  }
80090
- function updateDeleteIconStatus(editor, block) {
80091
- const states = [];
80092
- if (isEmptyIcon(editor, block)) {
80093
- states.push("disabled");
80094
- }
80095
- OnesEditorToolbar.get(editor).updateItemStates("delete-icon", states);
80096
- }
80097
80071
  getLogger("callout-block-commands");
80098
80072
  class CalloutBlockCommands {
80099
80073
  constructor(editor, block) {
@@ -80120,7 +80094,6 @@ ${data2.flowchartText}
80120
80094
  this.updateCalloutBlockData({
80121
80095
  icon: emoji
80122
80096
  });
80123
- updateDeleteIconStatus(this.editor, this.activeBlock);
80124
80097
  });
80125
80098
  __publicField(this, "handleEmojiDelete", () => {
80126
80099
  this.updateCalloutBlockData({
@@ -82344,7 +82317,7 @@ ${data2.flowchartText}
82344
82317
  }
82345
82318
  }
82346
82319
  });
82347
- editor.version = "2.0.7-beta.21";
82320
+ editor.version = "2.0.7-beta.22";
82348
82321
  if (Logger$2.level === LogLevel.DEBUG) {
82349
82322
  window.setReauthFail = (fail) => {
82350
82323
  window.isReauthError = fail;
@@ -82438,7 +82411,7 @@ ${data2.flowchartText}
82438
82411
  if (!clientType.isMobile) {
82439
82412
  OnesEditorToolbar.register(editor);
82440
82413
  }
82441
- editor.version = "2.0.7-beta.21";
82414
+ editor.version = "2.0.7-beta.22";
82442
82415
  return editor;
82443
82416
  }
82444
82417
  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.0.7-beta.21",
3
+ "version": "2.0.7-beta.22",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",