@ones-editor/editor 2.1.2-beta.28 → 2.1.2-beta.30

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.
@@ -25,6 +25,7 @@ export declare class ReadonlyToolbar implements OnesEditorCustom {
25
25
  handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
26
26
  private handleHoveringBlockChildChange;
27
27
  groupCommands: (allCommands: CommandItem[]) => CommandItem[];
28
+ hideToolbar(editor: OnesEditor): void;
28
29
  showTextToolbar(reason: string): void;
29
30
  static isVisible(): boolean;
30
31
  }
package/dist/index.js CHANGED
@@ -51594,8 +51594,13 @@ ${codeText}
51594
51594
  unbindEvents() {
51595
51595
  document.removeEventListener("mousedown", this.handleDocumentMouseDown);
51596
51596
  }
51597
+ hideToolbar(editor) {
51598
+ const toolbar2 = editor.findCustom("toolbar-handler");
51599
+ toolbar2 == null ? void 0 : toolbar2.hide();
51600
+ }
51597
51601
  showTextToolbar(reason) {
51598
51602
  var _a, _b;
51603
+ this.hideToolbar(this.editor);
51599
51604
  let commands = [];
51600
51605
  const range = this.editor.selection.range;
51601
51606
  this.providers.forEach((provider) => {
@@ -68464,7 +68469,15 @@ ${codeText}
68464
68469
  executeRangeCommand(editor, range, command, params, result) {
68465
68470
  if (command.id === "add-comment") {
68466
68471
  this.editorComments.showCommentList();
68467
- const comment = addCommentToTextBlocks(editor, range, this.provider);
68472
+ let comment;
68473
+ if (!range.isSimple() && isFullSelectedOneComplexBlock(editor, range)) {
68474
+ const block = editor.getBlockById(range.anchor.blockId);
68475
+ const types2 = ["table", "layout"];
68476
+ if (types2.includes(getBlockType(block))) {
68477
+ comment = addCommentToBlock$1(editor, block, this.provider);
68478
+ }
68479
+ }
68480
+ comment = comment != null ? comment : addCommentToTextBlocks(editor, range, this.provider);
68468
68481
  if (result) {
68469
68482
  result["add-comment"] = comment;
68470
68483
  }
@@ -88152,7 +88165,7 @@ ${data2.flowchartText}
88152
88165
  }
88153
88166
  }
88154
88167
  });
88155
- editor.version = "2.1.2-beta.28";
88168
+ editor.version = "2.1.2-beta.30";
88156
88169
  if (Logger$2.level === LogLevel.DEBUG) {
88157
88170
  window.setReauthFail = (fail) => {
88158
88171
  window.isReauthError = fail;
@@ -88253,7 +88266,7 @@ ${data2.flowchartText}
88253
88266
  });
88254
88267
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
88255
88268
  OnesEditorToolbar.register(editor);
88256
- editor.version = "2.1.2-beta.28";
88269
+ editor.version = "2.1.2-beta.30";
88257
88270
  return editor;
88258
88271
  }
88259
88272
  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.2-beta.28",
3
+ "version": "2.1.2-beta.30",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",