@farming-labs/theme 0.2.98 → 0.2.101

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.
@@ -1,17 +1,18 @@
1
+ import { resolveOpenDocsProviders } from "./open-docs-providers.mjs";
1
2
  import { withLangInUrl } from "./i18n.mjs";
2
3
  import { escapeJsonLdForScript } from "./json-ld.mjs";
3
4
  import { DocsPageClient } from "./docs-page-client.mjs";
4
5
  import { DocsAIFeatures } from "./docs-ai-features.mjs";
5
6
  import { resolveDocsCloudAIClientRequest } from "./docs-cloud-ai-client.mjs";
6
7
  import { DocsCommandSearch } from "./docs-command-search.mjs";
7
- import { resolveOpenDocsProviders } from "./open-docs-providers.mjs";
8
- import { resolveReadingTimeOptions } from "./reading-time.mjs";
8
+ import { resolveReadingTimeOptions } from "./reading-time-options.mjs";
9
9
  import { SidebarSearchWithAI } from "./sidebar-search-ai.mjs";
10
10
  import { LocaleThemeControl } from "./locale-theme-control.mjs";
11
+ import { TabletSidebarBridge } from "./tablet-sidebar-bridge.mjs";
11
12
  import { DocsLayout } from "fumadocs-ui/layouts/docs";
12
13
  import { Suspense } from "react";
13
- import { applySidebarFolderIndexBehavior, resolveDocsAnalyticsConfig } from "@farming-labs/docs";
14
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
15
+ import { applySidebarFolderIndexBehavior, resolveDocsAnalyticsConfig } from "@farming-labs/docs/browser";
15
16
 
16
17
  //#region src/tanstack-layout.tsx
17
18
  function resolveTreeIcon(icon, registry) {
@@ -223,7 +224,7 @@ function resolveFeedbackConfig(feedback) {
223
224
  function ForcedThemeScript({ theme }) {
224
225
  return /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: `document.documentElement.classList.remove('light','dark');document.documentElement.classList.add('${theme === "light" || theme === "dark" ? theme : "light"}');` } });
225
226
  }
226
- function TanstackDocsLayout({ config, tree, locale, description, readingTime, lastModified, previousPage, nextPage, structuredData, editOnGithubUrl, children }) {
227
+ function TanstackDocsLayout({ config, tree, browserRuntime = false, locale, description, descriptionInBody, readingTime, lastModified, previousPage, nextPage, structuredData, editOnGithubUrl, children }) {
227
228
  const tocConfig = config.theme?.ui?.layout?.toc;
228
229
  const tocEnabled = tocConfig?.enabled !== false;
229
230
  const tocStyle = tocConfig?.style;
@@ -259,6 +260,7 @@ function TanstackDocsLayout({ config, tree, locale, description, readingTime, la
259
260
  const llmsTxtEnabled = resolveEnabledByDefault(config.llmsTxt);
260
261
  const feedbackConfig = resolveFeedbackConfig(config.feedback);
261
262
  const staticExport = !!config.staticExport;
263
+ const frameworkContainerProps = browserRuntime ? { "data-fd-framework": "" } : void 0;
262
264
  const openDocsConfig = pageActions?.openDocs && typeof pageActions.openDocs === "object" ? pageActions.openDocs : void 0;
263
265
  const openDocsProviders = resolveOpenDocsProviders(openDocsConfig?.providers, {
264
266
  target: openDocsConfig?.target,
@@ -322,12 +324,14 @@ function TanstackDocsLayout({ config, tree, locale, description, readingTime, la
322
324
  enabled: false
323
325
  } : themeSwitch,
324
326
  sidebar: finalSidebarProps,
327
+ containerProps: frameworkContainerProps,
325
328
  ...aiMode === "sidebar-icon" && aiEnabled ? { searchToggle: { components: { lg: /* @__PURE__ */ jsx(SidebarSearchWithAI, {}) } } } : {},
326
329
  children: [
327
330
  /* @__PURE__ */ jsx(ColorStyle, { colors }),
328
331
  /* @__PURE__ */ jsx(TypographyStyle, { typography }),
329
332
  /* @__PURE__ */ jsx(LayoutStyle, { layout: layoutDimensions }),
330
333
  forcedTheme && /* @__PURE__ */ jsx(ForcedThemeScript, { theme: forcedTheme }),
334
+ browserRuntime && config.theme?.name === "fumadocs-pixel-border" && /* @__PURE__ */ jsx(TabletSidebarBridge, {}),
331
335
  !staticExport && /* @__PURE__ */ jsx(Suspense, {
332
336
  fallback: null,
333
337
  children: /* @__PURE__ */ jsx(DocsCommandSearch, {
@@ -359,6 +363,7 @@ function TanstackDocsLayout({ config, tree, locale, description, readingTime, la
359
363
  fallback: children,
360
364
  children: /* @__PURE__ */ jsx(DocsPageClient, {
361
365
  tocEnabled,
366
+ showLlmsInHeader: browserRuntime && config.theme?.name === "fumadocs-pixel-border",
362
367
  tocStyle,
363
368
  breadcrumbEnabled,
364
369
  entry: config.entry ?? "docs",
@@ -386,6 +391,7 @@ function TanstackDocsLayout({ config, tree, locale, description, readingTime, la
386
391
  readingTime: typeof readingTime === "number" ? readingTime : void 0,
387
392
  llmsTxtEnabled,
388
393
  description,
394
+ descriptionInBody,
389
395
  feedbackEnabled: feedbackConfig.enabled,
390
396
  feedbackQuestion: feedbackConfig.question,
391
397
  feedbackPlaceholder: feedbackConfig.placeholder,
@@ -1,4 +1,4 @@
1
+ import { TanstackDocsLayout } from "./tanstack-layout.mjs";
1
2
  import { DocsClientHooks } from "./docs-client-hooks.mjs";
2
3
  import { RootProvider } from "./provider-tanstack.mjs";
3
- import { TanstackDocsLayout } from "./tanstack-layout.mjs";
4
4
  export { DocsClientHooks, RootProvider, TanstackDocsLayout };
package/dist/tanstack.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DocsClientHooks } from "./docs-client-hooks.mjs";
2
- import { RootProvider } from "./provider-tanstack.mjs";
3
2
  import { TanstackDocsLayout } from "./tanstack-layout.mjs";
3
+ import { RootProvider } from "./provider-tanstack.mjs";
4
4
 
5
5
  export { DocsClientHooks, RootProvider, TanstackDocsLayout };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/theme",
3
- "version": "0.2.98",
3
+ "version": "0.2.101",
4
4
  "description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
5
5
  "keywords": [
6
6
  "docs",
@@ -33,6 +33,12 @@
33
33
  "import": "./dist/docs-client-hooks.mjs",
34
34
  "default": "./dist/docs-client-hooks.mjs"
35
35
  },
36
+ "./browser": {
37
+ "types": "./dist/browser.d.mts",
38
+ "import": "./dist/browser.mjs",
39
+ "default": "./dist/browser.mjs"
40
+ },
41
+ "./browser/css": "./styles/bundles/browser-framework.css",
36
42
  "./default": {
37
43
  "types": "./dist/default/index.d.mts",
38
44
  "import": "./dist/default/index.mjs",
@@ -151,10 +157,11 @@
151
157
  "ajv": "^8.18.0",
152
158
  "ajv-formats": "^3.0.1",
153
159
  "next": ">=14.0.0",
160
+ "postcss": "^8.5.6",
154
161
  "tsdown": "^0.20.3",
155
162
  "typescript": "^5.9.3",
156
163
  "vitest": "^4.1.8",
157
- "@farming-labs/docs": "0.2.98"
164
+ "@farming-labs/docs": "0.2.101"
158
165
  },
159
166
  "peerDependencies": {
160
167
  "@farming-labs/docs": ">=0.0.1",