@ones-editor/editor 2.9.5 → 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
@@ -75767,7 +75767,14 @@ ${codeText}
75767
75767
  ...options,
75768
75768
  listLevel: options.listLevel + 1
75769
75769
  };
75770
- const { text: text2, children } = options.tokensToTextWithChildren(item.tokens, newOptions);
75770
+ let heading;
75771
+ let tokens = item.tokens;
75772
+ if (item.tokens.length === 1 && item.tokens[0].type === "heading") {
75773
+ const token2 = item.tokens[0];
75774
+ heading = token2.depth;
75775
+ tokens = token2.tokens;
75776
+ }
75777
+ const { text: text2, children } = options.tokensToTextWithChildren(tokens, newOptions);
75771
75778
  let checkbox2;
75772
75779
  if (typeof item.checked === "boolean") {
75773
75780
  checkbox2 = item.checked ? "checked" : "unchecked";
@@ -75782,6 +75789,9 @@ ${codeText}
75782
75789
  text: text2,
75783
75790
  level: options.listLevel
75784
75791
  };
75792
+ if (heading) {
75793
+ block.heading = heading;
75794
+ }
75785
75795
  blocks.push(block);
75786
75796
  blocks.push(...children);
75787
75797
  });
@@ -94117,10 +94127,15 @@ ${JSON.stringify(error2, null, 2)}`);
94117
94127
  }
94118
94128
  this.children = commands;
94119
94129
  }
94120
- onClick(editor, item) {
94130
+ onClick(editor, item, commandBar2) {
94121
94131
  const provider = new InsertMenuProvider(editor);
94122
94132
  const startBlock = editor.getBlockById(editor.selection.range.start.blockId);
94123
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
+ }
94124
94139
  }
94125
94140
  }
94126
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>';
@@ -94313,6 +94328,11 @@ ${JSON.stringify(error2, null, 2)}`);
94313
94328
  moreItems.push(item);
94314
94329
  }
94315
94330
  });
94331
+ if (moreItems.length > 0) {
94332
+ if (moreItems[moreItems.length - 1].type === "separator") {
94333
+ moreItems.pop();
94334
+ }
94335
+ }
94316
94336
  this.hidden = moreItems.length === 0;
94317
94337
  this.children = moreItems;
94318
94338
  toolbar2.updateItems(items);
@@ -94422,7 +94442,7 @@ ${JSON.stringify(error2, null, 2)}`);
94422
94442
  __publicField(this, "handleClick", (bar2, item) => {
94423
94443
  const command = item;
94424
94444
  if (command.onClick) {
94425
- command.onClick(this.editor, command);
94445
+ command.onClick(this.editor, command, bar2);
94426
94446
  this.handleSelectionChanged();
94427
94447
  return;
94428
94448
  }
@@ -94444,7 +94464,7 @@ ${JSON.stringify(error2, null, 2)}`);
94444
94464
  const parent = findParent(i, item.id);
94445
94465
  if (parent) {
94446
94466
  if (parent.onClick) {
94447
- parent.onClick(this.editor, item);
94467
+ parent.onClick(this.editor, item, bar2);
94448
94468
  this.handleSelectionChanged();
94449
94469
  return;
94450
94470
  }
@@ -94762,7 +94782,7 @@ ${JSON.stringify(error2, null, 2)}`);
94762
94782
  }
94763
94783
  }
94764
94784
  });
94765
- editor.version = "2.9.5";
94785
+ editor.version = "2.9.7";
94766
94786
  return editor;
94767
94787
  }
94768
94788
  function isDoc(doc2) {
@@ -94876,7 +94896,7 @@ ${JSON.stringify(error2, null, 2)}`);
94876
94896
  }
94877
94897
  });
94878
94898
  OnesEditorToolbar.register(editor);
94879
- editor.version = "2.9.5";
94899
+ editor.version = "2.9.7";
94880
94900
  return editor;
94881
94901
  }
94882
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.5",
3
+ "version": "2.9.7",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {