@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.
- package/dist/browser.d.mts +28 -0
- package/dist/browser.mjs +81 -0
- package/dist/docs-client-hooks.mjs +1 -1
- package/dist/docs-command-search.mjs +13 -2
- package/dist/docs-layout.mjs +7 -3
- package/dist/docs-page-client.d.mts +6 -0
- package/dist/docs-page-client.mjs +33 -6
- package/dist/mdx.mjs +1 -1
- package/dist/open-docs-provider-icons.mjs +14 -0
- package/dist/open-docs-providers.mjs +17 -2
- package/dist/page-actions.mjs +3 -8
- package/dist/pixel-border/index.d.mts +1 -0
- package/dist/pixel-border/index.mjs +2 -1
- package/dist/reading-time-options.mjs +27 -0
- package/dist/reading-time.mjs +2 -24
- package/dist/tablet-sidebar-bridge.mjs +64 -0
- package/dist/tanstack-layout.d.mts +5 -0
- package/dist/tanstack-layout.mjs +10 -4
- package/dist/tanstack.d.mts +1 -1
- package/dist/tanstack.mjs +1 -1
- package/package.json +9 -2
- package/styles/bundles/browser-framework.css +10585 -0
- package/styles/bundles/shared-framework.css +3 -3
- package/styles/pixel-border.css +33 -13
package/dist/tanstack-layout.mjs
CHANGED
|
@@ -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 {
|
|
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,
|
package/dist/tanstack.d.mts
CHANGED
|
@@ -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.
|
|
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.
|
|
164
|
+
"@farming-labs/docs": "0.2.101"
|
|
158
165
|
},
|
|
159
166
|
"peerDependencies": {
|
|
160
167
|
"@farming-labs/docs": ">=0.0.1",
|