@ones-editor/editor 2.9.6 → 2.9.7

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
@@ -94127,10 +94127,15 @@ ${JSON.stringify(error2, null, 2)}`);
94127
94127
  }
94128
94128
  this.children = commands;
94129
94129
  }
94130
- onClick(editor, item) {
94130
+ onClick(editor, item, commandBar2) {
94131
94131
  const provider = new InsertMenuProvider(editor);
94132
94132
  const startBlock = editor.getBlockById(editor.selection.range.start.blockId);
94133
94133
  provider.executeCommand(editor, startBlock, editor.selection.range, item, {});
94134
+ commandBar2.close("clickItem");
94135
+ const bar2 = commandBar2;
94136
+ if (bar2.closeable) {
94137
+ bar2.closeable.close("clickItem");
94138
+ }
94134
94139
  }
94135
94140
  }
94136
94141
  const FindIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="11.5" cy="11.5" r="2.5" stroke="currentColor"></circle>\n<path d="M13.3542 13.3542L15 15" stroke="currentColor"></path>\n<path d="M13.5 8V5.41421C13.5 5.149 13.3946 4.89464 13.2071 4.70711L10.2929 1.79289C10.1054 1.60536 9.851 1.5 9.58579 1.5H3.5C2.94772 1.5 2.5 1.94772 2.5 2.5V13.5C2.5 14.0523 2.94772 14.5 3.5 14.5H8" stroke="currentColor" stroke-linejoin="round"></path>\n<path d="M9.5 1.5V4.5C9.5 5.05228 9.94772 5.5 10.5 5.5H13.5" stroke="currentColor" stroke-linejoin="round"></path>\n</svg>';
@@ -94323,6 +94328,11 @@ ${JSON.stringify(error2, null, 2)}`);
94323
94328
  moreItems.push(item);
94324
94329
  }
94325
94330
  });
94331
+ if (moreItems.length > 0) {
94332
+ if (moreItems[moreItems.length - 1].type === "separator") {
94333
+ moreItems.pop();
94334
+ }
94335
+ }
94326
94336
  this.hidden = moreItems.length === 0;
94327
94337
  this.children = moreItems;
94328
94338
  toolbar2.updateItems(items);
@@ -94432,7 +94442,7 @@ ${JSON.stringify(error2, null, 2)}`);
94432
94442
  __publicField(this, "handleClick", (bar2, item) => {
94433
94443
  const command = item;
94434
94444
  if (command.onClick) {
94435
- command.onClick(this.editor, command);
94445
+ command.onClick(this.editor, command, bar2);
94436
94446
  this.handleSelectionChanged();
94437
94447
  return;
94438
94448
  }
@@ -94454,7 +94464,7 @@ ${JSON.stringify(error2, null, 2)}`);
94454
94464
  const parent = findParent(i, item.id);
94455
94465
  if (parent) {
94456
94466
  if (parent.onClick) {
94457
- parent.onClick(this.editor, item);
94467
+ parent.onClick(this.editor, item, bar2);
94458
94468
  this.handleSelectionChanged();
94459
94469
  return;
94460
94470
  }
@@ -94772,7 +94782,7 @@ ${JSON.stringify(error2, null, 2)}`);
94772
94782
  }
94773
94783
  }
94774
94784
  });
94775
- editor.version = "2.9.6";
94785
+ editor.version = "2.9.7";
94776
94786
  return editor;
94777
94787
  }
94778
94788
  function isDoc(doc2) {
@@ -94886,7 +94896,7 @@ ${JSON.stringify(error2, null, 2)}`);
94886
94896
  }
94887
94897
  });
94888
94898
  OnesEditorToolbar.register(editor);
94889
- editor.version = "2.9.6";
94899
+ editor.version = "2.9.7";
94890
94900
  return editor;
94891
94901
  }
94892
94902
  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.9.6",
3
+ "version": "2.9.7",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {