@ones-editor/editor 2.8.37-beta.21 → 2.8.37-beta.23

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
@@ -42632,7 +42632,7 @@ ${codeText}
42632
42632
  });
42633
42633
  }
42634
42634
  initCommandBarElement(elem) {
42635
- addClass(elem, "dialog", "manual");
42635
+ addClass(elem, "command-dialog", "manual");
42636
42636
  }
42637
42637
  initItemElement(item, elem) {
42638
42638
  }
@@ -75813,7 +75813,14 @@ ${codeText}
75813
75813
  ...options,
75814
75814
  listLevel: options.listLevel + 1
75815
75815
  };
75816
- const { text: text2, children } = options.tokensToTextWithChildren(item.tokens, newOptions);
75816
+ let heading;
75817
+ let tokens = item.tokens;
75818
+ if (item.tokens.length === 1 && item.tokens[0].type === "heading") {
75819
+ const token2 = item.tokens[0];
75820
+ heading = token2.depth;
75821
+ tokens = token2.tokens;
75822
+ }
75823
+ const { text: text2, children } = options.tokensToTextWithChildren(tokens, newOptions);
75817
75824
  let checkbox2;
75818
75825
  if (typeof item.checked === "boolean") {
75819
75826
  checkbox2 = item.checked ? "checked" : "unchecked";
@@ -75828,6 +75835,9 @@ ${codeText}
75828
75835
  text: text2,
75829
75836
  level: options.listLevel
75830
75837
  };
75838
+ if (heading) {
75839
+ block.heading = heading;
75840
+ }
75831
75841
  blocks.push(block);
75832
75842
  blocks.push(...children);
75833
75843
  });
@@ -77740,6 +77750,9 @@ ${docStr}
77740
77750
  function replaceCrLf(text2) {
77741
77751
  return text2.replace(/\r\n\s*/g, "").replace(/\n\s*/g, "").replace(/\r\s*/g, "");
77742
77752
  }
77753
+ function replaceCrLfWithSpace(text2) {
77754
+ return text2.replace(/\r\n\s*/g, " ").replace(/\n\s*/g, " ").replace(/\r\s*/g, " ");
77755
+ }
77743
77756
  function isImageElement(elem) {
77744
77757
  if (!elem.tagName) {
77745
77758
  return false;
@@ -78110,7 +78123,7 @@ ${docStr}
78110
78123
  }
78111
78124
  const currentAttributes = addNodeAttributes(node, attributes);
78112
78125
  if (node instanceof Text && node.nodeValue || node.nodeName === "BR") {
78113
- const insert = replaceCrLf((_a = node.nodeValue) != null ? _a : " ");
78126
+ const insert = replaceCrLfWithSpace((_a = node.nodeValue) != null ? _a : " ");
78114
78127
  if (insert) {
78115
78128
  ops.push(textNodeToOp(insert, currentAttributes));
78116
78129
  }
@@ -94185,10 +94198,15 @@ ${JSON.stringify(error2, null, 2)}`);
94185
94198
  }
94186
94199
  this.children = commands;
94187
94200
  }
94188
- onClick(editor, item) {
94201
+ onClick(editor, item, commandBar2) {
94189
94202
  const provider = new InsertMenuProvider(editor);
94190
94203
  const startBlock = editor.getBlockById(editor.selection.range.start.blockId);
94191
94204
  provider.executeCommand(editor, startBlock, editor.selection.range, item, {});
94205
+ commandBar2.close("clickItem");
94206
+ const bar2 = commandBar2;
94207
+ if (bar2.closeable) {
94208
+ bar2.closeable.close("clickItem");
94209
+ }
94192
94210
  }
94193
94211
  }
94194
94212
  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>';
@@ -94381,6 +94399,11 @@ ${JSON.stringify(error2, null, 2)}`);
94381
94399
  moreItems.push(item);
94382
94400
  }
94383
94401
  });
94402
+ if (moreItems.length > 0) {
94403
+ if (moreItems[moreItems.length - 1].type === "separator") {
94404
+ moreItems.pop();
94405
+ }
94406
+ }
94384
94407
  this.hidden = moreItems.length === 0;
94385
94408
  this.children = moreItems;
94386
94409
  toolbar2.updateItems(items);
@@ -94532,7 +94555,7 @@ ${JSON.stringify(error2, null, 2)}`);
94532
94555
  __publicField(this, "handleClick", (bar2, item) => {
94533
94556
  const command = item;
94534
94557
  if (command.onClick) {
94535
- command.onClick(this.editor, command);
94558
+ command.onClick(this.editor, command, bar2);
94536
94559
  this.handleSelectionChanged();
94537
94560
  return;
94538
94561
  }
@@ -94554,7 +94577,7 @@ ${JSON.stringify(error2, null, 2)}`);
94554
94577
  const parent = findParent(i, item.id);
94555
94578
  if (parent) {
94556
94579
  if (parent.onClick) {
94557
- parent.onClick(this.editor, item);
94580
+ parent.onClick(this.editor, item, bar2);
94558
94581
  this.handleSelectionChanged();
94559
94582
  return;
94560
94583
  }
@@ -94898,7 +94921,7 @@ ${JSON.stringify(error2, null, 2)}`);
94898
94921
  }
94899
94922
  }
94900
94923
  });
94901
- editor.version = "2.8.37-beta.21";
94924
+ editor.version = "2.8.37-beta.23";
94902
94925
  return editor;
94903
94926
  }
94904
94927
  function isDoc(doc2) {
@@ -95031,7 +95054,7 @@ ${JSON.stringify(error2, null, 2)}`);
95031
95054
  OnesEditorDropTarget.register(editor);
95032
95055
  OnesEditorTocProvider.register(editor);
95033
95056
  OnesEditorExclusiveBlock.register(editor);
95034
- editor.version = "2.8.37-beta.21";
95057
+ editor.version = "2.8.37-beta.23";
95035
95058
  return editor;
95036
95059
  }
95037
95060
  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.8.37-beta.21",
3
+ "version": "2.8.37-beta.23",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {