@lexibase/rdx-types 2.4.0 → 2.6.0

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/config.d.ts CHANGED
@@ -115,6 +115,20 @@ export type RDXConfig = {
115
115
  }
116
116
  }
117
117
 
118
+ /** Values available to a project-owned homepage. */
119
+ export type RdxHomepageProps = {
120
+ /** Active language tag, such as 'en' or 'pt-BR'. */
121
+ lang: string
122
+ /** Documentation entry point for the active language. */
123
+ docsHref: string
124
+ }
125
+
126
+ /** Props for the server homepage enabled by homepage.translations. */
127
+ export type RdxTranslatedHomepageProps = RdxHomepageProps & {
128
+ /** Translate a source phrase, falling back to the phrase itself. */
129
+ t: (text: string) => string
130
+ }
131
+
118
132
  /** Options for the built-in landing page or a project-owned home.tsx component. */
119
133
  export type RdxHomepage = {
120
134
  /**
@@ -124,17 +138,19 @@ export type RdxHomepage = {
124
138
  enabled?: boolean
125
139
  /**
126
140
  * Imported React component that owns the homepage body.
127
- * The shared navbar remains; built-in title, description and buttons are not
128
- * injected into this component. Used only when enabled is true.
141
+ * The shared navbar remains. Use the lang and docsHref props to localize the
142
+ * homepage content and navigation. Used only when enabled is true.
129
143
  * @example
130
144
  * component: Home // import Home from './home'
131
145
  */
132
- component?: ComponentType
146
+ component?: ComponentType<RdxHomepageProps>
147
+ /** Load components/home.tsx on the server and translate its text from locale folders. */
148
+ translations?: boolean
133
149
  /** Built-in homepage heading. Defaults to metadata.applicationName. */
134
150
  title?: string
135
- /** Optional text below the built-in heading; omitted means no description. */
151
+ /** Text below the built-in heading. Defaults to the site description. */
136
152
  description?: string
137
- /** Buttons below the built-in description. The first button is primary. */
153
+ /** Hero buttons. The first is primary. Defaults to a Docs link; use [] to hide it. */
138
154
  buttons?: {
139
155
  /** Visible button text and accessible name; must not be empty. */
140
156
  label: string
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export { RdxSearchEntry, RdxSearchIndex } from './search'
3
3
  export {
4
4
  RDXConfig,
5
5
  RdxHomepage,
6
+ RdxHomepageProps,
7
+ RdxTranslatedHomepageProps,
6
8
  RdxMetadata,
7
9
  RdxRuntimeConfig,
8
10
  ResolvedRdxConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexibase/rdx-types",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "license": "MIT",
5
5
  "description": "Shared TypeScript types for RDX documentation projects.",
6
6
  "types": "./dist/index.d.ts",