@farming-labs/docs 0.0.51 → 0.0.52

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/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as ThemeToggleConfig, C as PageTwitter, D as SidebarNode, E as SidebarFolderNode, M as UIConfig, O as SidebarPageNode, S as PageOpenGraph, T as SidebarConfig, _ as OpenDocsProvider, a as CopyMarkdownConfig, b as PageActionsConfig, c as DocsMetadata, d as FontStyle, f as GithubConfig, g as OpenDocsConfig, h as OGConfig, i as CodeBlockCopyData, j as TypographyConfig, k as SidebarTree, l as DocsNav, m as LlmsTxtConfig, n as ApiReferenceConfig, o as DocsConfig, p as LastUpdatedConfig, r as BreadcrumbConfig, s as DocsI18nConfig, t as AIConfig, u as DocsTheme, v as OpenGraphImage, w as SidebarComponentProps, x as PageFrontmatter, y as OrderingItem } from "./types-BUk4OKUT.mjs";
1
+ import { A as SidebarNode, C as PageActionsConfig, D as SidebarComponentProps, E as PageTwitter, F as UIConfig, M as SidebarTree, N as ThemeToggleConfig, O as SidebarConfig, P as TypographyConfig, S as OrderingItem, T as PageOpenGraph, _ as LlmsTxtConfig, a as CopyMarkdownConfig, b as OpenDocsProvider, c as DocsFeedbackValue, d as DocsNav, f as DocsTheme, g as LastUpdatedConfig, h as GithubConfig, i as CodeBlockCopyData, j as SidebarPageNode, k as SidebarFolderNode, l as DocsI18nConfig, m as FontStyle, n as ApiReferenceConfig, o as DocsConfig, p as FeedbackConfig, r as BreadcrumbConfig, s as DocsFeedbackData, t as AIConfig, u as DocsMetadata, v as OGConfig, w as PageFrontmatter, x as OpenGraphImage, y as OpenDocsConfig } from "./types-CjzUmIVM.mjs";
2
2
 
3
3
  //#region src/define-docs.d.ts
4
4
  /**
@@ -97,4 +97,4 @@ declare function buildPageOpenGraph(page: Pick<PageFrontmatter, "title" | "descr
97
97
  */
98
98
  declare function buildPageTwitter(page: Pick<PageFrontmatter, "title" | "description" | "ogImage" | "openGraph" | "twitter">, ogConfig?: OGConfig, baseUrl?: string): PageTwitter | undefined;
99
99
  //#endregion
100
- export { type AIConfig, type ApiReferenceConfig, type BreadcrumbConfig, type CodeBlockCopyData, type CopyMarkdownConfig, type DocsConfig, type DocsI18nConfig, type DocsMetadata, type DocsNav, type DocsPathMatch, type DocsTheme, type FontStyle, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OpenGraphImage, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type PageOpenGraph, type PageTwitter, type ResolvedDocsI18n, type SidebarComponentProps, type SidebarConfig, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type ThemeToggleConfig, type TypographyConfig, type UIConfig, buildPageOpenGraph, buildPageTwitter, createTheme, deepMerge, defineDocs, extendTheme, resolveDocsI18n, resolveDocsLocale, resolveDocsPath, resolveOGImage, resolveTitle };
100
+ export { type AIConfig, type ApiReferenceConfig, type BreadcrumbConfig, type CodeBlockCopyData, type CopyMarkdownConfig, type DocsConfig, type DocsFeedbackData, type DocsFeedbackValue, type DocsI18nConfig, type DocsMetadata, type DocsNav, type DocsPathMatch, type DocsTheme, type FeedbackConfig, type FontStyle, type GithubConfig, type LastUpdatedConfig, type LlmsTxtConfig, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, type OpenGraphImage, type OrderingItem, type PageActionsConfig, type PageFrontmatter, type PageOpenGraph, type PageTwitter, type ResolvedDocsI18n, type SidebarComponentProps, type SidebarConfig, type SidebarFolderNode, type SidebarNode, type SidebarPageNode, type SidebarTree, type ThemeToggleConfig, type TypographyConfig, type UIConfig, buildPageOpenGraph, buildPageTwitter, createTheme, deepMerge, defineDocs, extendTheme, resolveDocsI18n, resolveDocsLocale, resolveDocsPath, resolveOGImage, resolveTitle };
package/dist/index.mjs CHANGED
@@ -14,6 +14,8 @@ function defineDocs(config) {
14
14
  breadcrumb: config.breadcrumb,
15
15
  sidebar: config.sidebar,
16
16
  components: config.components,
17
+ onCopyClick: config.onCopyClick,
18
+ feedback: config.feedback,
17
19
  icons: config.icons,
18
20
  pageActions: config.pageActions,
19
21
  lastUpdated: config.lastUpdated,
package/dist/server.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ApiReferenceConfig, o as DocsConfig } from "./types-BUk4OKUT.mjs";
1
+ import { n as ApiReferenceConfig, o as DocsConfig } from "./types-CjzUmIVM.mjs";
2
2
 
3
3
  //#region src/api-reference.d.ts
4
4
  type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
@@ -999,6 +999,64 @@ interface CodeBlockCopyData {
999
999
  /** Language / syntax hint (e.g. "tsx", "bash"), if present */
1000
1000
  language?: string;
1001
1001
  }
1002
+ /** Feedback value emitted by the built-in docs page feedback buttons. */
1003
+ type DocsFeedbackValue = "positive" | "negative";
1004
+ /**
1005
+ * Data passed to the `feedback.onFeedback` callback when the user submits
1006
+ * page feedback from the built-in docs feedback UI.
1007
+ */
1008
+ interface DocsFeedbackData {
1009
+ /** Whether the user gave positive or negative feedback. */
1010
+ value: DocsFeedbackValue;
1011
+ /** Optional free-form feedback left by the reader. */
1012
+ comment?: string;
1013
+ /** Current page title, when available. */
1014
+ title?: string;
1015
+ /** Current page description, when available. */
1016
+ description?: string;
1017
+ /** Full current page URL at the time of feedback. */
1018
+ url: string;
1019
+ /** Current URL pathname (without origin). */
1020
+ pathname: string;
1021
+ /** Alias of `pathname` for analytics tools that prefer `path`. */
1022
+ path: string;
1023
+ /** Docs entry root, e.g. `"docs"`. */
1024
+ entry: string;
1025
+ /** Page slug relative to the docs entry, e.g. `"installation"` or `"guides/setup"`. */
1026
+ slug: string;
1027
+ /** Active locale, when docs i18n is enabled. */
1028
+ locale?: string;
1029
+ }
1030
+ /**
1031
+ * Built-in page feedback configuration.
1032
+ *
1033
+ * When enabled, docs pages render a small feedback prompt at the end of the
1034
+ * content. Clicking a button emits a callback/event with the current page
1035
+ * metadata and the selected sentiment.
1036
+ */
1037
+ interface FeedbackConfig {
1038
+ /** Show the feedback UI. Defaults to `true` when this object is provided. */
1039
+ enabled?: boolean;
1040
+ /** Prompt shown above the feedback buttons. @default "How is this guide?" */
1041
+ question?: string;
1042
+ /** Placeholder shown in the optional free-form feedback field. @default "Leave your feedback..." */
1043
+ placeholder?: string;
1044
+ /** Label for the positive button. @default "Good" */
1045
+ positiveLabel?: string;
1046
+ /** Label for the negative button. @default "Bad" */
1047
+ negativeLabel?: string;
1048
+ /** Label for the submit button. @default "Submit" */
1049
+ submitLabel?: string;
1050
+ /**
1051
+ * Callback fired when the user submits the feedback form.
1052
+ *
1053
+ * For client-only frameworks this runs directly in the browser. In
1054
+ * environments where the config cannot be serialized to the client, the same
1055
+ * payload is also emitted through `window.__fdOnFeedback__` and the
1056
+ * `fd:feedback` custom event.
1057
+ */
1058
+ onFeedback?: (data: DocsFeedbackData) => void | Promise<void>;
1059
+ }
1002
1060
  interface DocsI18nConfig {
1003
1061
  /** Supported locale identifiers (e.g. ["en", "fr"]). */
1004
1062
  locales: string[];
@@ -1157,6 +1215,29 @@ interface DocsConfig {
1157
1215
  * ```
1158
1216
  */
1159
1217
  onCopyClick?: (data: CodeBlockCopyData) => void;
1218
+ /**
1219
+ * Built-in page feedback prompt shown at the end of a docs page.
1220
+ *
1221
+ * - `false` or `undefined` → hidden (default)
1222
+ * - `true` → shown with default labels
1223
+ * - `{ enabled: true, onFeedback(data) { ... } }` → shown with callback
1224
+ *
1225
+ * @example
1226
+ * ```ts
1227
+ * import type { DocsFeedbackData } from "@farming-labs/docs";
1228
+ *
1229
+ * export default defineDocs({
1230
+ * entry: "docs",
1231
+ * feedback: {
1232
+ * enabled: true,
1233
+ * onFeedback(data: DocsFeedbackData) {
1234
+ * console.log("Docs feedback", data.value, data.slug, data.url);
1235
+ * },
1236
+ * },
1237
+ * });
1238
+ * ```
1239
+ */
1240
+ feedback?: boolean | FeedbackConfig;
1160
1241
  /**
1161
1242
  * Icon registry for sidebar items.
1162
1243
  *
@@ -1327,4 +1408,4 @@ interface DocsConfig {
1327
1408
  og?: OGConfig;
1328
1409
  }
1329
1410
  //#endregion
1330
- export { ThemeToggleConfig as A, PageTwitter as C, SidebarNode as D, SidebarFolderNode as E, UIConfig as M, SidebarPageNode as O, PageOpenGraph as S, SidebarConfig as T, OpenDocsProvider as _, CopyMarkdownConfig as a, PageActionsConfig as b, DocsMetadata as c, FontStyle as d, GithubConfig as f, OpenDocsConfig as g, OGConfig as h, CodeBlockCopyData as i, TypographyConfig as j, SidebarTree as k, DocsNav as l, LlmsTxtConfig as m, ApiReferenceConfig as n, DocsConfig as o, LastUpdatedConfig as p, BreadcrumbConfig as r, DocsI18nConfig as s, AIConfig as t, DocsTheme as u, OpenGraphImage as v, SidebarComponentProps as w, PageFrontmatter as x, OrderingItem as y };
1411
+ export { SidebarNode as A, PageActionsConfig as C, SidebarComponentProps as D, PageTwitter as E, UIConfig as F, SidebarTree as M, ThemeToggleConfig as N, SidebarConfig as O, TypographyConfig as P, OrderingItem as S, PageOpenGraph as T, LlmsTxtConfig as _, CopyMarkdownConfig as a, OpenDocsProvider as b, DocsFeedbackValue as c, DocsNav as d, DocsTheme as f, LastUpdatedConfig as g, GithubConfig as h, CodeBlockCopyData as i, SidebarPageNode as j, SidebarFolderNode as k, DocsI18nConfig as l, FontStyle as m, ApiReferenceConfig as n, DocsConfig as o, FeedbackConfig as p, BreadcrumbConfig as r, DocsFeedbackData as s, AIConfig as t, DocsMetadata as u, OGConfig as v, PageFrontmatter as w, OpenGraphImage as x, OpenDocsConfig as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/docs",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
5
5
  "keywords": [
6
6
  "docs",