@ones-editor/editor 2.1.1-beta.3 → 2.1.1-beta.4

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.
@@ -24,6 +24,7 @@ export declare class ReadonlyToolbar implements OnesEditorCustom {
24
24
  handleDocumentMouseUp: () => void;
25
25
  handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
26
26
  private handleHoveringBlockChildChange;
27
+ groupCommands: (allCommands: CommandItem[]) => CommandItem[];
27
28
  showTextToolbar(reason: string): void;
28
29
  showObjectToolbar(event: MouseEvent | null): void;
29
30
  }
package/dist/index.js CHANGED
@@ -48224,7 +48224,7 @@ ${codeText}
48224
48224
  }
48225
48225
  }
48226
48226
  const logger$1S = getLogger("toolbar-handler");
48227
- const SEP = {
48227
+ const SEP$1 = {
48228
48228
  id: "",
48229
48229
  name: "",
48230
48230
  type: "separator"
@@ -48499,7 +48499,7 @@ ${codeText}
48499
48499
  });
48500
48500
  toolbarCommands.push(...sortCommands);
48501
48501
  if (index2 !== toolbarCommandsChunk.length - 1) {
48502
- toolbarCommands.push(SEP);
48502
+ toolbarCommands.push(SEP$1);
48503
48503
  }
48504
48504
  });
48505
48505
  if (toolbarCommands.length === 0) {
@@ -56151,6 +56151,11 @@ $$${mathData.mathjaxText}$$
56151
56151
  "ja-JP": jaJP$s
56152
56152
  });
56153
56153
  const logger$1K = getLogger("readonly-toolbar");
56154
+ const SEP = {
56155
+ id: "",
56156
+ name: "",
56157
+ type: "separator"
56158
+ };
56154
56159
  class ReadonlyToolbar {
56155
56160
  constructor(editor) {
56156
56161
  __publicField(this, "toolbar");
@@ -56248,6 +56253,31 @@ $$${mathData.mathjaxText}$$
56248
56253
  }
56249
56254
  this.showObjectToolbar(event);
56250
56255
  });
56256
+ __publicField(this, "groupCommands", (allCommands) => {
56257
+ var _a, _b;
56258
+ const allCommandsMap = /* @__PURE__ */ new Map();
56259
+ for (let i = 0; i < allCommands.length; i++) {
56260
+ const groupOrder = (_a = allCommands[i].groupOrder) != null ? _a : 0;
56261
+ if (allCommandsMap.has(groupOrder)) {
56262
+ (_b = allCommandsMap.get(groupOrder)) == null ? void 0 : _b.push(allCommands[i]);
56263
+ } else {
56264
+ allCommandsMap.set(groupOrder, [allCommands[i]]);
56265
+ }
56266
+ }
56267
+ const commandsChunk = [];
56268
+ allCommandsMap.forEach((value) => {
56269
+ commandsChunk.push(value.sort((item1, item2) => {
56270
+ var _a2, _b2;
56271
+ return ((_a2 = item1.order) != null ? _a2 : 0) - ((_b2 = item2.order) != null ? _b2 : 0);
56272
+ }));
56273
+ });
56274
+ if (commandsChunk.length === 0) {
56275
+ return [];
56276
+ }
56277
+ const commands = commandsChunk.reduce((prev, curr) => prev.concat([SEP, ...curr]), []);
56278
+ commands.shift();
56279
+ return commands;
56280
+ });
56251
56281
  this.editor = editor;
56252
56282
  const popover = editor.options.componentsOptions.popover;
56253
56283
  this.toolbar = new ManualToolbar([], void 0, {
@@ -65788,7 +65818,10 @@ ${codeText}
65788
65818
  return [{
65789
65819
  id: "add-comment-to-old-doc/text",
65790
65820
  name: i18n$1.t("comment.quickMenuCommand"),
65791
- icon: CommentIcon$1
65821
+ icon: CommentIcon$1,
65822
+ group: "common",
65823
+ groupOrder: 200,
65824
+ order: 110
65792
65825
  }];
65793
65826
  }
65794
65827
  const selectedBlock = range.getSelectedBlocks()[0];
@@ -65796,7 +65829,10 @@ ${codeText}
65796
65829
  return [{
65797
65830
  id: "add-comment-to-old-doc/text",
65798
65831
  name: i18n$1.t("comment.quickMenuCommand"),
65799
- icon: CommentIcon$1
65832
+ icon: CommentIcon$1,
65833
+ group: "common",
65834
+ groupOrder: 200,
65835
+ order: 110
65800
65836
  }];
65801
65837
  }
65802
65838
  return [];
@@ -83130,7 +83166,7 @@ ${data2.flowchartText}
83130
83166
  }
83131
83167
  }
83132
83168
  });
83133
- editor.version = "2.1.1-beta.3";
83169
+ editor.version = "2.1.1-beta.4";
83134
83170
  if (Logger$2.level === LogLevel.DEBUG) {
83135
83171
  window.setReauthFail = (fail) => {
83136
83172
  window.isReauthError = fail;
@@ -83225,7 +83261,7 @@ ${data2.flowchartText}
83225
83261
  if (!clientType.isMobile) {
83226
83262
  OnesEditorToolbar.register(editor);
83227
83263
  }
83228
- editor.version = "2.1.1-beta.3";
83264
+ editor.version = "2.1.1-beta.4";
83229
83265
  return editor;
83230
83266
  }
83231
83267
  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.3",
3
+ "version": "2.1.1-beta.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",