@farming-labs/theme 0.1.53 → 0.1.56

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.
@@ -11,7 +11,7 @@ import path from "node:path";
11
11
  import matter from "gray-matter";
12
12
  import { DocsLayout } from "fumadocs-ui/layouts/docs";
13
13
  import { Suspense } from "react";
14
- import { buildPageOpenGraph, buildPageTwitter, resolveChangelogConfig, resolveDocsAgentMdxContent } from "@farming-labs/docs";
14
+ import { applySidebarFolderIndexBehavior, buildPageOpenGraph, buildPageTwitter, resolveChangelogConfig, resolveDocsAgentMdxContent } from "@farming-labs/docs";
15
15
  import { jsx, jsxs } from "react/jsx-runtime";
16
16
 
17
17
  //#region src/docs-layout.tsx
@@ -622,7 +622,10 @@ function createDocsLayout(config, options) {
622
622
  });
623
623
  const readingTimeEnabled = readingTimeEnabledByDefault || Object.keys(readingTimeMap).length > 0;
624
624
  return function DocsLayoutWrapper({ children }) {
625
- const tree = buildTree(config, localeContext, !!sidebarFlat);
625
+ const tree = applySidebarFolderIndexBehavior(buildTree(config, localeContext, !!sidebarFlat), {
626
+ sidebar: config.sidebar,
627
+ defaultBehavior: "link"
628
+ });
626
629
  const localizedTree = i18n ? localizeTreeUrls(tree, activeLocale) : tree;
627
630
  const finalSidebarProps = { ...sidebarProps };
628
631
  const sidebarFooter = sidebarProps.footer;
@@ -7,6 +7,7 @@ import { SidebarSearchWithAI } from "./sidebar-search-ai.mjs";
7
7
  import { LocaleThemeControl } from "./locale-theme-control.mjs";
8
8
  import { DocsLayout } from "fumadocs-ui/layouts/docs";
9
9
  import { Suspense } from "react";
10
+ import { applySidebarFolderIndexBehavior } from "@farming-labs/docs";
10
11
  import { jsx, jsxs } from "react/jsx-runtime";
11
12
 
12
13
  //#region src/tanstack-layout.tsx
@@ -257,7 +258,13 @@ function TanstackDocsLayout({ config, tree, locale, description, readingTime, la
257
258
  aiDefaultModelId = rawModelConfig.defaultModel ?? rawModelConfig.models?.[0]?.id ?? aiDefaultModelId;
258
259
  }
259
260
  const i18n = config.i18n;
260
- const resolvedTree = resolveTreeIcons(locale ? localizeTreeUrls(tree, locale) : tree, config.icons);
261
+ const resolvedTree = resolveTreeIcons(locale ? localizeTreeUrls(applySidebarFolderIndexBehavior(tree, {
262
+ sidebar: config.sidebar,
263
+ defaultBehavior: "link"
264
+ }), locale) : applySidebarFolderIndexBehavior(tree, {
265
+ sidebar: config.sidebar,
266
+ defaultBehavior: "link"
267
+ }), config.icons);
261
268
  const finalSidebarProps = { ...sidebarProps };
262
269
  const sidebarFooter = sidebarProps.footer;
263
270
  if (locale && i18n?.locales && i18n.defaultLocale) finalSidebarProps.footer = /* @__PURE__ */ jsxs("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/theme",
3
- "version": "0.1.53",
3
+ "version": "0.1.56",
4
4
  "description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
5
5
  "keywords": [
6
6
  "docs",
@@ -133,7 +133,7 @@
133
133
  "tsdown": "^0.20.3",
134
134
  "typescript": "^5.9.3",
135
135
  "vitest": "^3.2.4",
136
- "@farming-labs/docs": "0.1.53"
136
+ "@farming-labs/docs": "0.1.56"
137
137
  },
138
138
  "peerDependencies": {
139
139
  "@farming-labs/docs": ">=0.0.1",