@ones-editor/editor 2.1.1-beta.18 → 2.1.1-beta.19

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.
package/dist/index.js CHANGED
@@ -66743,16 +66743,20 @@ ${codeText}
66743
66743
  this.provider = provider;
66744
66744
  this.editorComments = editorComments;
66745
66745
  }
66746
- getAvailableCommands(editor, block, range) {
66746
+ getAvailableCommands(editor, block, range, params) {
66747
+ var _a;
66747
66748
  const originRange = editor.selection.range;
66748
- if (isTextKindBlock(editor, block) && !range.isCollapsed() && originRange.isSimple()) {
66749
- return [{
66750
- id: "add-comment",
66751
- name: i18n$1.t("comment.command"),
66752
- icon: CommentIcon$1
66753
- }];
66749
+ const enabled = isTextKindBlock(editor, block) && !range.isCollapsed() && originRange.isSimple();
66750
+ const isFilter = (_a = params == null ? void 0 : params.isFilter) != null ? _a : true;
66751
+ if (!enabled && isFilter) {
66752
+ return [];
66754
66753
  }
66755
- return [];
66754
+ return [{
66755
+ id: "add-comment",
66756
+ name: i18n$1.t("comment.command"),
66757
+ icon: CommentIcon$1,
66758
+ states: enabled ? [] : ["disabled"]
66759
+ }];
66756
66760
  }
66757
66761
  hideToolbar(editor) {
66758
66762
  const toolbar2 = editor.findCustom("toolbar-handler");
@@ -84895,7 +84899,7 @@ ${data2.flowchartText}
84895
84899
  }
84896
84900
  }
84897
84901
  });
84898
- editor.version = "2.1.1-beta.18";
84902
+ editor.version = "2.1.1-beta.19";
84899
84903
  if (Logger$2.level === LogLevel.DEBUG) {
84900
84904
  window.setReauthFail = (fail) => {
84901
84905
  window.isReauthError = fail;
@@ -84992,7 +84996,7 @@ ${data2.flowchartText}
84992
84996
  });
84993
84997
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
84994
84998
  OnesEditorToolbar.register(editor);
84995
- editor.version = "2.1.1-beta.18";
84999
+ editor.version = "2.1.1-beta.19";
84996
85000
  return editor;
84997
85001
  }
84998
85002
  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.18",
3
+ "version": "2.1.1-beta.19",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",