@stacksjs/stx 0.2.29 → 0.2.31

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.
@@ -5,9 +5,11 @@ export type {
5
5
  SiteRouterOptions,
6
6
  SiteSeo,
7
7
  SiteSocial,
8
+ SiteThemeOptions,
8
9
  } from './types';
9
10
  export { buildStaticSite, defineSiteConfig, type BuildResult } from './build';
10
11
  export { injectSeo } from './seo';
11
12
  export { generateSitemap, type SitemapEntry } from './sitemap';
12
13
  export { generateRobots } from './robots';
13
14
  export { injectRouterScript, type RouterOptions } from './router';
15
+ export { injectThemeBootstrap, type ThemeOptions } from './theme';
@@ -6,5 +6,5 @@ import type { SiteRouterOptions } from './types';
6
6
  * `window.__stxRouterConfig` ahead of the runtime so the runtime picks
7
7
  * it up on init.
8
8
  */
9
- export declare function injectRouterScript(html: string, options?: RouterOptions): string;
9
+ export declare function injectRouterScript(html: string, options?: RouterOptions): Promise<string>;
10
10
  export type RouterOptions = SiteRouterOptions;
@@ -0,0 +1,11 @@
1
+ import type { SiteConfig } from './types';
2
+ /**
3
+ * Inject the theme bootstrap (FOUC guard + class) and the toggle
4
+ * handler. Skips no-op if the markers are already present so rebuilds
5
+ * stay idempotent.
6
+ */
7
+ export declare function injectThemeBootstrap(html: string, site: SiteConfig): string;
8
+ export declare interface ThemeOptions {
9
+ default?: 'dark' | 'light' | 'auto'
10
+ storageKey?: string
11
+ }
@@ -30,6 +30,11 @@ export declare interface SiteConfig {
30
30
  pages?: Record<string, PageMeta>
31
31
  spa?: boolean
32
32
  router?: SiteRouterOptions
33
+ theme?: false | SiteThemeOptions
34
+ }
35
+ export declare interface SiteThemeOptions {
36
+ default?: 'dark' | 'light' | 'auto'
37
+ storageKey?: string
33
38
  }
34
39
  export declare interface PageMeta {
35
40
  title?: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.29",
4
+ "version": "0.2.31",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",