@farming-labs/theme 0.2.118 → 0.2.120

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,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { DocsConfig, PageFrontmatter } from "@farming-labs/docs";
2
+ import { DocsConfig, DocsTelemetryFramework, PageFrontmatter } from "@farming-labs/docs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/docs-layout.d.ts
@@ -33,6 +33,7 @@ declare function createPageMetadata(config: DocsConfig, page: Pick<PageFrontmatt
33
33
  }): Record<string, unknown>;
34
34
  declare function createDocsLayout(config: DocsConfig, options?: {
35
35
  locale?: string;
36
+ telemetryFramework?: DocsTelemetryFramework;
36
37
  }): ({
37
38
  children
38
39
  }: {
@@ -1151,6 +1151,8 @@ function createDocsLayout(config, options) {
1151
1151
  feedbackSuccessMessage: feedbackConfig.successMessage,
1152
1152
  feedbackErrorMessage: feedbackConfig.errorMessage,
1153
1153
  analytics: analyticsEnabled,
1154
+ telemetry: config.telemetry,
1155
+ telemetryFramework: options?.telemetryFramework,
1154
1156
  children
1155
1157
  })
1156
1158
  })
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { CopyMarkdownFormat, DocsFeedbackData, PageActionConnectMcpConfig, PageActionInstallSkillsConfig, ReadingTimeFormat } from "@farming-labs/docs";
2
+ import { CopyMarkdownFormat, DocsFeedbackData, DocsTelemetryConfig, DocsTelemetryFramework, PageActionConnectMcpConfig, PageActionInstallSkillsConfig, ReadingTimeFormat } from "@farming-labs/docs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/docs-page-client.d.ts
@@ -102,6 +102,8 @@ interface DocsPageClientProps {
102
102
  feedbackErrorMessage?: string;
103
103
  feedbackOnFeedback?: (data: DocsFeedbackData) => void | Promise<void>;
104
104
  analytics?: boolean;
105
+ telemetry?: boolean | DocsTelemetryConfig;
106
+ telemetryFramework?: DocsTelemetryFramework;
105
107
  children: ReactNode;
106
108
  }
107
109
  declare function DocsPageClient({
@@ -160,6 +162,8 @@ declare function DocsPageClient({
160
162
  feedbackErrorMessage,
161
163
  feedbackOnFeedback,
162
164
  analytics,
165
+ telemetry,
166
+ telemetryFramework,
163
167
  children
164
168
  }: DocsPageClientProps): react_jsx_runtime0.JSX.Element;
165
169
  //#endregion
@@ -10,6 +10,7 @@ import { Children, Fragment, useEffect, useLayoutEffect, useState } from "react"
10
10
  import { DocsBody, DocsPage, EditOnGitHub } from "fumadocs-ui/layouts/docs/page";
11
11
  import { createPortal } from "react-dom";
12
12
  import { usePathname, useRouter } from "fumadocs-core/framework";
13
+ import { emitDocsTelemetryPageViewEvent } from "@farming-labs/docs/browser";
13
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
15
 
15
16
  //#region src/docs-page-client.tsx
@@ -255,7 +256,7 @@ function findThreadlineTocActionsContainer() {
255
256
  }
256
257
  return toc.parentElement ?? toc;
257
258
  }
258
- function DocsPageClient({ tocEnabled, showLlmsInHeader = false, tocStyle = "default", breadcrumbEnabled = true, changelogBasePath, entry = "docs", publicPath, locale, copyMarkdown = false, copyMarkdownFormat, copyMarkdownIncludeTitle, copyMarkdownLabel, copyMarkdownCopiedLabel, openDocs = false, openDocsProviders, openDocsTarget, openDocsPrompt, connectMcp, installSkills, pageActionsPosition = "below-title", pageActionsAlignment = "left", githubUrl, contentDir, githubBranch = "main", githubDirectory, editOnGithubUrl, lastModifiedMap, lastModified: lastModifiedProp, readingTimeMap, readingTime: readingTimeProp, readingTimeFormat = "long", previousPage, nextPage, structuredDataMap, structuredData: structuredDataProp, readingTimeEnabled = false, lastUpdatedEnabled = true, lastUpdatedLabel = "Last updated", lastUpdatedPosition = "footer", llmsTxtEnabled = false, generatedTitleMap, descriptionMap, description, descriptionInBody = false, feedbackEnabled = false, feedbackQuestion, feedbackPlaceholder, feedbackRequireComment, feedbackPositiveLabel, feedbackNegativeLabel, feedbackSubmitLabel, feedbackSuccessMessage, feedbackErrorMessage, feedbackOnFeedback, analytics = false, children }) {
259
+ function DocsPageClient({ tocEnabled, showLlmsInHeader = false, tocStyle = "default", breadcrumbEnabled = true, changelogBasePath, entry = "docs", publicPath, locale, copyMarkdown = false, copyMarkdownFormat, copyMarkdownIncludeTitle, copyMarkdownLabel, copyMarkdownCopiedLabel, openDocs = false, openDocsProviders, openDocsTarget, openDocsPrompt, connectMcp, installSkills, pageActionsPosition = "below-title", pageActionsAlignment = "left", githubUrl, contentDir, githubBranch = "main", githubDirectory, editOnGithubUrl, lastModifiedMap, lastModified: lastModifiedProp, readingTimeMap, readingTime: readingTimeProp, readingTimeFormat = "long", previousPage, nextPage, structuredDataMap, structuredData: structuredDataProp, readingTimeEnabled = false, lastUpdatedEnabled = true, lastUpdatedLabel = "Last updated", lastUpdatedPosition = "footer", llmsTxtEnabled = false, generatedTitleMap, descriptionMap, description, descriptionInBody = false, feedbackEnabled = false, feedbackQuestion, feedbackPlaceholder, feedbackRequireComment, feedbackPositiveLabel, feedbackNegativeLabel, feedbackSubmitLabel, feedbackSuccessMessage, feedbackErrorMessage, feedbackOnFeedback, analytics = false, telemetry, telemetryFramework, children }) {
259
260
  const router = useRouter();
260
261
  const fdTocStyle = tocStyle === "directional" ? "clerk" : void 0;
261
262
  const [toc, setToc] = useState([]);
@@ -297,6 +298,18 @@ function DocsPageClient({ tocEnabled, showLlmsInHeader = false, tocStyle = "defa
297
298
  isChangelogRoute,
298
299
  normalizedPath
299
300
  ]);
301
+ useEffect(() => {
302
+ emitDocsTelemetryPageViewEvent(telemetry, {
303
+ framework: telemetryFramework,
304
+ path: normalizedPath,
305
+ locale: activeLocale
306
+ });
307
+ }, [
308
+ activeLocale,
309
+ normalizedPath,
310
+ telemetry,
311
+ telemetryFramework
312
+ ]);
300
313
  useEffect(() => {
301
314
  return installDocsPathNavigationGuard(entry, resolvedPublicPath, (url) => router.push(url));
302
315
  }, [
package/dist/mdx.d.mts CHANGED
@@ -3,7 +3,6 @@ import { HoverLink } from "./hover-link.mjs";
3
3
  import { Prompt, PromptIconValue, PromptOpenDocsProvider } from "./prompt.mjs";
4
4
  import React from "react";
5
5
  import { CodeBlockCopyData, DocsContentAudience, DocsTheme } from "@farming-labs/docs";
6
- import * as react_jsx_runtime0 from "react/jsx-runtime";
7
6
  import { Tab, Tabs } from "fumadocs-ui/components/tabs";
8
7
  import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from "fumadocs-ui/components/codeblock";
9
8
  import defaultMdxComponents from "fumadocs-ui/mdx";
@@ -68,16 +67,16 @@ declare const extendedMdxComponents: {
68
67
  CodeBlockTabs: typeof CodeBlockTabs;
69
68
  CodeBlockTabsList: typeof CodeBlockTabsList;
70
69
  CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
71
- pre: (props: React.HTMLAttributes<HTMLPreElement>) => react_jsx_runtime0.JSX.Element;
70
+ pre: (props: React.HTMLAttributes<HTMLPreElement>) => React.JSX.Element;
72
71
  Card: typeof fumadocs_ui_components_card0.Card;
73
72
  Cards: typeof fumadocs_ui_components_card0.Cards;
74
73
  a: React.FC<React.AnchorHTMLAttributes<HTMLAnchorElement>>;
75
- h1: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime0.JSX.Element;
76
- h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime0.JSX.Element;
77
- h3: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime0.JSX.Element;
78
- h4: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime0.JSX.Element;
79
- h5: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime0.JSX.Element;
80
- h6: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime0.JSX.Element;
74
+ h1: (props: React.HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
75
+ h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
76
+ h3: (props: React.HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
77
+ h4: (props: React.HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
78
+ h5: (props: React.HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
79
+ h6: (props: React.HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
81
80
  Callout: typeof fumadocs_ui_components_callout0.Callout;
82
81
  CalloutContainer: typeof fumadocs_ui_components_callout0.CalloutContainer;
83
82
  CalloutTitle: typeof fumadocs_ui_components_callout0.CalloutTitle;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { DocsConfig } from "@farming-labs/docs";
2
+ import { DocsConfig, DocsTelemetryFramework } from "@farming-labs/docs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/tanstack-layout.d.ts
@@ -29,6 +29,8 @@ interface TanstackDocsLayoutProps {
29
29
  tree: TreeRoot;
30
30
  /** Enables browser-adapter shell affordances that are not part of a theme preset. */
31
31
  browserRuntime?: boolean;
32
+ /** Framework label included with privacy-preserving maintainer page-view telemetry. */
33
+ telemetryFramework?: DocsTelemetryFramework;
32
34
  locale?: string;
33
35
  description?: string;
34
36
  descriptionInBody?: boolean;
@@ -50,6 +52,7 @@ declare function TanstackDocsLayout({
50
52
  config,
51
53
  tree,
52
54
  browserRuntime,
55
+ telemetryFramework,
53
56
  locale,
54
57
  description,
55
58
  descriptionInBody,
@@ -11,8 +11,8 @@ import { LocaleThemeControl } from "./locale-theme-control.mjs";
11
11
  import { TabletSidebarBridge } from "./tablet-sidebar-bridge.mjs";
12
12
  import { DocsLayout } from "fumadocs-ui/layouts/docs";
13
13
  import { Suspense } from "react";
14
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
15
14
  import { applySidebarFolderIndexBehavior, resolveDocsAnalyticsConfig } from "@farming-labs/docs/browser";
15
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
16
16
 
17
17
  //#region src/tanstack-layout.tsx
18
18
  function resolveTreeIcon(icon, registry) {
@@ -240,7 +240,7 @@ function resolveFeedbackConfig(feedback) {
240
240
  function ForcedThemeScript({ theme }) {
241
241
  return /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: `document.documentElement.classList.remove('light','dark');document.documentElement.classList.add('${theme === "light" || theme === "dark" ? theme : "light"}');` } });
242
242
  }
243
- function TanstackDocsLayout({ config, tree, browserRuntime = false, locale, description, descriptionInBody, readingTime, lastModified, previousPage, nextPage, structuredData, editOnGithubUrl, children }) {
243
+ function TanstackDocsLayout({ config, tree, browserRuntime = false, telemetryFramework, locale, description, descriptionInBody, readingTime, lastModified, previousPage, nextPage, structuredData, editOnGithubUrl, children }) {
244
244
  const tocConfig = config.theme?.ui?.layout?.toc;
245
245
  const tocEnabled = tocConfig?.enabled !== false;
246
246
  const tocStyle = tocConfig?.style;
@@ -422,6 +422,8 @@ function TanstackDocsLayout({ config, tree, browserRuntime = false, locale, desc
422
422
  feedbackSuccessMessage: feedbackConfig.successMessage,
423
423
  feedbackErrorMessage: feedbackConfig.errorMessage,
424
424
  analytics: analyticsEnabled,
425
+ telemetry: config.telemetry,
426
+ telemetryFramework,
425
427
  children
426
428
  })
427
429
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/theme",
3
- "version": "0.2.118",
3
+ "version": "0.2.120",
4
4
  "description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
5
5
  "keywords": [
6
6
  "docs",
@@ -144,8 +144,8 @@
144
144
  "./presets/base": "./styles/presets/base.css"
145
145
  },
146
146
  "dependencies": {
147
- "fumadocs-core": "16.7.16",
148
- "fumadocs-ui": "16.7.16",
147
+ "fumadocs-core": "16.17.1",
148
+ "fumadocs-ui": "16.17.1",
149
149
  "gray-matter": "^4.0.3",
150
150
  "sugar-high": "^0.9.5",
151
151
  "zod": "^4.3.6"
@@ -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.118"
164
+ "@farming-labs/docs": "0.2.120"
165
165
  },
166
166
  "peerDependencies": {
167
167
  "@farming-labs/docs": ">=0.0.1",