@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/CHANGELOG.md +180 -1
- package/README.md +115 -38
- package/dist/frontmatter.d.ts +8 -0
- package/dist/frontmatter.js +7 -1
- package/dist/next.d.ts +34 -27
- package/dist/next.js +20 -11
- package/dist/react/hero.d.ts +19 -0
- package/dist/react/hero.js +44 -0
- package/dist/react/layout.d.ts +1 -3
- package/dist/react/layout.js +17 -54
- package/dist/react/nav.d.ts +11 -11
- package/dist/react/nav.js +106 -58
- package/dist/react/next-nav.d.ts +5 -1
- package/dist/react/next-nav.js +4 -2
- package/dist/react/shell-labels.d.ts +8 -2
- package/dist/react/toc.d.ts +13 -3
- package/dist/react/toc.js +17 -10
- package/dist/render.js +2 -1
- package/dist/source.js +1 -1
- package/dist/styles.css +1163 -238
- package/dist/types.d.ts +31 -1
- package/package.json +5 -1
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 = "
|
|
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: [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
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,
|
|
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
|