@ones-editor/editor 2.1.2-beta.27 → 2.1.2-beta.29

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) => {
@@ -68429,9 +68434,20 @@ ${codeText}
68429
68434
  }
68430
68435
  getAvailableCommands(editor, block, range, params) {
68431
68436
  var _a;
68437
+ const blockTypes = ["table", "layout"];
68438
+ if (blockTypes.includes(getBlockType(block)) && !range.isSimple()) {
68439
+ if (isFullSelectedOneComplexBlock(editor, range)) {
68440
+ return [{
68441
+ id: "add-comment",
68442
+ name: i18n$1.t("comment.command"),
68443
+ icon: CommentIcon$1,
68444
+ states: []
68445
+ }];
68446
+ }
68447
+ }
68448
+ const isFilter = (_a = params == null ? void 0 : params.isFilter) != null ? _a : true;
68432
68449
  const originRange = editor.selection.range;
68433
68450
  const enabled = isTextKindBlock(editor, block) && !range.isCollapsed() && originRange.isSimple();
68434
- const isFilter = (_a = params == null ? void 0 : params.isFilter) != null ? _a : true;
68435
68451
  if (!enabled && isFilter) {
68436
68452
  return [];
68437
68453
  }
@@ -82330,7 +82346,6 @@ ${content}
82330
82346
  findPreviewElement,
82331
82347
  innerToc: true,
82332
82348
  blockMenu: {
82333
- showComment: false,
82334
82349
  showLocker: false
82335
82350
  },
82336
82351
  overrideInertEmptyBlockInsideOptions: {
@@ -88142,7 +88157,7 @@ ${data2.flowchartText}
88142
88157
  }
88143
88158
  }
88144
88159
  });
88145
- editor.version = "2.1.2-beta.27";
88160
+ editor.version = "2.1.2-beta.29";
88146
88161
  if (Logger$2.level === LogLevel.DEBUG) {
88147
88162
  window.setReauthFail = (fail) => {
88148
88163
  window.isReauthError = fail;
@@ -88243,7 +88258,7 @@ ${data2.flowchartText}
88243
88258
  });
88244
88259
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
88245
88260
  OnesEditorToolbar.register(editor);
88246
- editor.version = "2.1.2-beta.27";
88261
+ editor.version = "2.1.2-beta.29";
88247
88262
  return editor;
88248
88263
  }
88249
88264
  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.27",
3
+ "version": "2.1.2-beta.29",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",