@farming-labs/theme 0.2.110 → 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/dist/tanstack-layout.mjs +2 -5
- 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/dist/tanstack-layout.mjs
CHANGED
|
@@ -278,10 +278,7 @@ function TanstackDocsLayout({ config, tree, browserRuntime = false, locale, desc
|
|
|
278
278
|
const llmsTxtEnabled = resolveEnabledByDefault(config.llmsTxt);
|
|
279
279
|
const feedbackConfig = resolveFeedbackConfig(config.feedback);
|
|
280
280
|
const staticExport = !!config.staticExport;
|
|
281
|
-
const
|
|
282
|
-
"data-fd-framework": "",
|
|
283
|
-
"data-fd-browser-adapter": ""
|
|
284
|
-
} : void 0;
|
|
281
|
+
const browserContainerProps = browserRuntime ? { "data-fd-browser-adapter": "" } : void 0;
|
|
285
282
|
const openDocsConfig = pageActions?.openDocs && typeof pageActions.openDocs === "object" ? pageActions.openDocs : void 0;
|
|
286
283
|
const openDocsProviders = resolveOpenDocsProviders(openDocsConfig?.providers, {
|
|
287
284
|
target: openDocsConfig?.target,
|
|
@@ -345,7 +342,7 @@ function TanstackDocsLayout({ config, tree, browserRuntime = false, locale, desc
|
|
|
345
342
|
enabled: false
|
|
346
343
|
} : themeSwitch,
|
|
347
344
|
sidebar: finalSidebarProps,
|
|
348
|
-
containerProps:
|
|
345
|
+
containerProps: browserContainerProps,
|
|
349
346
|
...aiMode === "sidebar-icon" && aiEnabled ? { searchToggle: { components: { lg: /* @__PURE__ */ jsx(SidebarSearchWithAI, {}) } } } : {},
|
|
350
347
|
children: [
|
|
351
348
|
/* @__PURE__ */ jsx(ColorStyle, { colors }),
|
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",
|