@appshell/webpack-plugin 1.0.0-alpha.25 → 1.0.0-alpha.27

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,4 +1,4 @@
1
1
  export * from './contract';
2
2
  export { contrastRatio, describeFinding, parseColor, toHex, validateTheme, type ContrastFinding, } from './contrast';
3
3
  export { ACCENTS, BASES, FOCUS_RINGS } from './presets';
4
- export { composeTheme, DEFAULT_TYPE_AND_DIMENSIONS, pinnedMode, toCss, type ColorScheme, type ThemeSelection, } from './theme';
4
+ export { DEFAULT_TYPE_AND_DIMENSIONS, composeTheme, cssFrom, pinnedMode, resolveTheme, toCss, type ColorScheme, type CssOptions, type ResolvedTheme, type ThemeSelection, } from './theme';
@@ -22,9 +22,33 @@ export declare const pinnedMode: (selection: ThemeSelection) => Mode | undefined
22
22
  export declare const DEFAULT_TYPE_AND_DIMENSIONS: Record<string, string>;
23
23
  /** The full token map for one mode. */
24
24
  export declare const composeTheme: (selection: ThemeSelection, mode: Mode) => Theme;
25
+ /**
26
+ * A theme with both modes already worked out.
27
+ *
28
+ * This is the shape a *published* theme stores. Resolving a selection and emitting CSS
29
+ * used to be one step, which meant the only way to render a theme was to re-resolve its
30
+ * preset names — so the values behind a name lived in whatever build was deployed, and an
31
+ * Application's recorded appearance moved when that build did. Materialising both modes
32
+ * lets the values be stored, versioned and rendered from, rather than looked up.
33
+ */
34
+ export type ResolvedTheme = Record<Mode, Theme>;
35
+ /** Works out both modes of a selection, including any overrides it carries. */
36
+ export declare const resolveTheme: (selection: ThemeSelection) => ResolvedTheme;
37
+ export type CssOptions = {
38
+ /** Defaults to `system`. Belongs to whoever is rendering, not to the theme. */
39
+ colorScheme?: ColorScheme;
40
+ /** Applied over the resolved values, so a consumer can adjust without forking. */
41
+ overrides?: Partial<Theme>;
42
+ };
25
43
  /**
26
44
  * Three states, not two: an explicit choice in either direction, and the system default
27
45
  * when nothing is stamped on the root. A theme that only handled `prefers-color-scheme`
28
46
  * would give a viewer no way to override it.
29
47
  */
48
+ export declare const cssFrom: (resolved: ResolvedTheme, options?: CssOptions) => string;
49
+ /**
50
+ * Resolve and emit in one step. The authoring path — a preset name in hand, CSS wanted.
51
+ * The registry uses `cssFrom` against a stored theme instead, so what it renders cannot
52
+ * drift from what was published.
53
+ */
30
54
  export declare const toCss: (selection: ThemeSelection) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appshell/webpack-plugin",
3
- "version": "1.0.0-alpha.25",
3
+ "version": "1.0.0-alpha.27",
4
4
  "description": "Webpack plugin used to generate a global Appshell configuration for micro-frontends built with Module Federation",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/types/webpack-plugin/src/index.d.ts",
@@ -32,8 +32,8 @@
32
32
  "plugin"
33
33
  ],
34
34
  "license": "MIT",
35
- "gitHead": "7d90eb91be3cb50aae5aaa680063878dfcaafea2",
35
+ "gitHead": "425a1894db52f7b8da1a3c10ea9fca7f6e48a13c",
36
36
  "dependencies": {
37
- "@appshell/tokens": "^1.0.0-alpha.25"
37
+ "@appshell/tokens": "^1.0.0-alpha.27"
38
38
  }
39
39
  }