@ones-editor/editor 2.3.0-beta.1 → 2.3.0-beta.2

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
@@ -80173,8 +80173,11 @@ ${docStr}
80173
80173
  }
80174
80174
  return toc.nodes[0].children.length === 0;
80175
80175
  }
80176
- function renderNodes(parent, nodes) {
80176
+ function renderNodes(parent, nodes, hiddenHeadings = /* @__PURE__ */ new Set()) {
80177
80177
  nodes.forEach((node) => {
80178
+ if (hiddenHeadings.has(node.block.id)) {
80179
+ return;
80180
+ }
80178
80181
  const content = createElement("div", ["toc-node"], parent);
80179
80182
  const title = createElement("div", ["toc-title"], content);
80180
80183
  const text2 = createElement("span", ["toc-text"], title, node.text);
@@ -80206,7 +80209,7 @@ ${docStr}
80206
80209
  });
80207
80210
  editor.selection.selectBlock(block, 0, void 0, { noScroll: true });
80208
80211
  }
80209
- function renderToc(editor, parent, toc) {
80212
+ function renderToc(editor, parent, toc, hiddenHeadings = /* @__PURE__ */ new Set()) {
80210
80213
  removeClass(parent, "loading");
80211
80214
  parent.innerHTML = "";
80212
80215
  if (isEmptyToc(editor, toc)) {
@@ -80215,11 +80218,11 @@ ${docStr}
80215
80218
  }
80216
80219
  const firstBlock = editor.findBlockById(toc.nodes[0].block.id);
80217
80220
  if (firstBlock && !isTitleBlock$2(firstBlock)) {
80218
- renderNodes(parent, toc.nodes);
80221
+ renderNodes(parent, toc.nodes, hiddenHeadings);
80219
80222
  } else if (toc.nodes.length >= 1) {
80220
80223
  const [first, ...rest] = toc.nodes;
80221
80224
  const contentNodes = [...first.children, ...rest];
80222
- renderNodes(parent, contentNodes);
80225
+ renderNodes(parent, contentNodes, hiddenHeadings);
80223
80226
  }
80224
80227
  editorRunOnce(editor, "toc-click-handler", () => {
80225
80228
  editor.addListener("click", handleClickToc);
@@ -80232,7 +80235,10 @@ ${docStr}
80232
80235
  blocks.forEach((block) => {
80233
80236
  const parent = block.querySelector(".editor-toc-container");
80234
80237
  if (parent) {
80235
- renderToc(editor, parent, toc);
80238
+ const blockData = editor.getBlockData(block);
80239
+ const embedData = blockData.embedData;
80240
+ const hiddenHeadings = embedData.hiddenHeadings || [];
80241
+ renderToc(editor, parent, toc, new Set(hiddenHeadings));
80236
80242
  }
80237
80243
  });
80238
80244
  });
@@ -89653,7 +89659,7 @@ ${data2.flowchartText}
89653
89659
  }
89654
89660
  }
89655
89661
  });
89656
- editor.version = "2.3.0-beta.1";
89662
+ editor.version = "2.3.0-beta.2";
89657
89663
  return editor;
89658
89664
  }
89659
89665
  function isDoc(doc2) {
@@ -89767,7 +89773,7 @@ ${data2.flowchartText}
89767
89773
  }
89768
89774
  }
89769
89775
  OnesEditorToolbar.register(editor);
89770
- editor.version = "2.3.0-beta.1";
89776
+ editor.version = "2.3.0-beta.2";
89771
89777
  return editor;
89772
89778
  }
89773
89779
  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.3.0-beta.1",
3
+ "version": "2.3.0-beta.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",