@waveso/docs 0.6.0 → 0.7.1

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/react/toc.js CHANGED
@@ -3,7 +3,7 @@ import { DOCS_CONTENT_ID } from "../docs-content-id.js";
3
3
  import { useEffect, useMemo, useRef, useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/react/toc.tsx
6
- const DEFAULT_ROOT_MARGIN = "-80px 0px -60% 0px";
6
+ const DEFAULT_ROOT_MARGIN = "0px 0px -60% 0px";
7
7
  /**
8
8
  * How many frames to keep looking for headings that are not in the document
9
9
  * yet. ~1s at 60Hz, which covers a `<Suspense>` boundary resolving or a
@@ -86,15 +86,22 @@ function DocsToc({ entries, label = "On this page", rootMargin = DEFAULT_ROOT_MA
86
86
  return /* @__PURE__ */ jsxs("nav", {
87
87
  "aria-label": label,
88
88
  className: ["wave-docs-toc", className].filter(Boolean).join(" "),
89
- children: [/* @__PURE__ */ jsx(TocList, {
90
- entries,
91
- activeId,
92
- onSelect: setActiveId
93
- }), /* @__PURE__ */ jsx("a", {
94
- className: "wave-docs-toc__top",
95
- href: `#${DOCS_CONTENT_ID}`,
96
- children: topLabel
97
- })]
89
+ children: [
90
+ /* @__PURE__ */ jsx("p", {
91
+ className: "wave-docs-toc__title",
92
+ children: label
93
+ }),
94
+ /* @__PURE__ */ jsx(TocList, {
95
+ entries,
96
+ activeId,
97
+ onSelect: setActiveId
98
+ }),
99
+ /* @__PURE__ */ jsx("a", {
100
+ className: "wave-docs-toc__top",
101
+ href: `#${DOCS_CONTENT_ID}`,
102
+ children: topLabel
103
+ })
104
+ ]
98
105
  });
99
106
  }
100
107
  function TocList({ entries, activeId, onSelect }) {
package/dist/render.js CHANGED
@@ -431,7 +431,8 @@ function createDocsRenderer(options) {
431
431
  relativePath: file.relativePath
432
432
  };
433
433
  const hast = await processor.run(processor.parse(vfile), vfile);
434
- if (titleHeading && !hasHeadingOne(hast)) hast.children.unshift(titleHeadingNode(file.frontmatter.title));
434
+ const hasHero = (file.frontmatter.actions?.length ?? 0) > 0;
435
+ if (titleHeading && !hasHero && !hasHeadingOne(hast)) hast.children.unshift(titleHeadingNode(file.frontmatter.title));
435
436
  await resolveImages(hast, file, imageResolver);
436
437
  assertLinks(file, vfile.data.docLinks ?? []);
437
438
  assertOwnAnchors(file, hast, vfile.data.docLinks ?? []);
package/dist/source.js CHANGED
@@ -18,7 +18,7 @@ const INDEX_NAME = "index";
18
18
  * ⚠️ THE SCAN USED TO OPEN EVERY MARKDOWN FILE AT ONCE. `scanDir` recursed into
19
19
  * its subdirectories in parallel and read that directory's pages with a bare
20
20
  * `Promise.all`, so the number of `readFile` calls in flight equalled the number
21
- * of markdown files in the entire tree. On a 1,200-page corpus and the common
21
+ * of markdown files in the entire tree. On a 1,201-page corpus and the common
22
22
  * 1,024-descriptor soft limit, `next build` died with a bare `EMFILE: too many
23
23
  * open files` — no error code, no mention that this was the docs scan, and
24
24
  * nothing pointing at the fix. Exactly the large content set this package is