@farming-labs/theme 0.2.111 → 0.2.112
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/docs-layout.mjs +9 -4
- package/package.json +2 -2
package/dist/docs-layout.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import fs from "node:fs";
|
|
|
13
13
|
import path from "node:path";
|
|
14
14
|
import matter from "gray-matter";
|
|
15
15
|
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
16
|
-
import { Suspense } from "react";
|
|
16
|
+
import { Suspense, cloneElement, isValidElement } from "react";
|
|
17
17
|
import { applySidebarFolderIndexBehavior, buildPageOpenGraph, buildPageTwitter, normalizePageAgentFrontmatter, renderDocsPageStructuredDataJson, resolveChangelogConfig, resolveDocsAnalyticsConfig, resolveDocsAudienceMdxContent, resolveDocsMetadataBaseUrl, resolvePageSidebarFolderIndexBehavior, toDocsMarkdownUrl } from "@farming-labs/docs";
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
|
|
@@ -22,10 +22,13 @@ function getNextAppDir(root) {
|
|
|
22
22
|
if (fs.existsSync(path.join(root, "src", "app"))) return "src/app";
|
|
23
23
|
return "app";
|
|
24
24
|
}
|
|
25
|
+
function withStableReactKey(node, key) {
|
|
26
|
+
return isValidElement(node) && node.key === null ? cloneElement(node, { key }) : node;
|
|
27
|
+
}
|
|
25
28
|
/** Resolve a frontmatter `icon` string to a ReactNode via the icon registry. */
|
|
26
29
|
function resolveIcon(iconKey, registry) {
|
|
27
30
|
if (!iconKey || !registry) return void 0;
|
|
28
|
-
return registry[iconKey] ?? void 0;
|
|
31
|
+
return withStableReactKey(registry[iconKey] ?? void 0, iconKey);
|
|
29
32
|
}
|
|
30
33
|
/** Read frontmatter from a page.mdx file. */
|
|
31
34
|
function readFrontmatter(filePath) {
|
|
@@ -770,7 +773,9 @@ function createDocsLayout(config, options) {
|
|
|
770
773
|
});
|
|
771
774
|
const localizedTree = i18n ? localizeTreeUrls(tree, activeLocale) : tree;
|
|
772
775
|
const finalSidebarProps = { ...sidebarProps };
|
|
773
|
-
const sidebarFooter = sidebarProps.footer;
|
|
776
|
+
const sidebarFooter = withStableReactKey(sidebarProps.footer, "docs-sidebar-footer");
|
|
777
|
+
finalSidebarProps.banner = withStableReactKey(sidebarProps.banner, "docs-sidebar-banner");
|
|
778
|
+
finalSidebarProps.footer = sidebarFooter;
|
|
774
779
|
if (i18n) finalSidebarProps.footer = /* @__PURE__ */ jsxs("div", {
|
|
775
780
|
style: {
|
|
776
781
|
display: "flex",
|
|
@@ -787,7 +792,7 @@ function createDocsLayout(config, options) {
|
|
|
787
792
|
themeMode: themeSwitch.mode
|
|
788
793
|
})
|
|
789
794
|
})]
|
|
790
|
-
});
|
|
795
|
+
}, "docs-sidebar-footer");
|
|
791
796
|
if (sidebarComponentFn) finalSidebarProps.component = sidebarComponentFn({
|
|
792
797
|
tree: localizedTree,
|
|
793
798
|
collapsible: sidebarProps.collapsible !== false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/theme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.112",
|
|
4
4
|
"description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"tsdown": "^0.20.3",
|
|
162
162
|
"typescript": "^5.9.3",
|
|
163
163
|
"vitest": "^4.1.8",
|
|
164
|
-
"@farming-labs/docs": "0.2.
|
|
164
|
+
"@farming-labs/docs": "0.2.112"
|
|
165
165
|
},
|
|
166
166
|
"peerDependencies": {
|
|
167
167
|
"@farming-labs/docs": ">=0.0.1",
|