ngx-theme-stack 2.0.0 → 2.1.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/README.md +79 -12
- package/fesm2022/ngx-theme-stack.mjs +50 -32
- package/fesm2022/ngx-theme-stack.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/anti-flash.d.ts +2 -0
- package/schematics/ng-add/anti-flash.js +56 -19
- package/schematics/ng-add/anti-flash.js.map +1 -1
- package/schematics/ng-add/app-config.js +5 -3
- package/schematics/ng-add/app-config.js.map +1 -1
- package/schematics/ng-add/constants.d.ts +1 -0
- package/schematics/ng-add/constants.js +1 -0
- package/schematics/ng-add/constants.js.map +1 -1
- package/schematics/ng-add/index.js +88 -11
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +2 -0
- package/schematics/ng-add/schema.json +7 -2
- package/schematics/ng-add/utils.d.ts +0 -5
- package/schematics/ng-add/utils.js +9 -26
- package/schematics/ng-add/utils.js.map +1 -1
- package/schematics/sync/index.d.ts +0 -9
- package/schematics/sync/index.js +198 -37
- package/schematics/sync/index.js.map +1 -1
- package/schematics/sync/schema.d.ts +2 -0
- package/schematics/sync/schema.json +5 -0
- package/types/ngx-theme-stack.d.ts +70 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngx-theme-stack/schematics/sync/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngx-theme-stack/schematics/sync/index.ts"],"names":[],"mappings":";;AA6WA,oBAiCC;AA7YD,mDAA+C;AAG/C,iFAAiF;AAEjF;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAAG,oCAAoC,CAAC;AAE7D,8DAA8D;AAC9D,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAErD,oEAAoE;AACpE,MAAM,aAAa,GAAG,mCAAmC,CAAC;AA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,IAAI,mCAAI,EAAE,MAAM,CAAC;QAC7E,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,CAA4B,CAAC;QAEtH,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,WAAW,eAAe,QAAQ,GAAG,CAAC,CAAC;QACjG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAExB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC3D,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;QAEtD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QAC/F,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;YAC5B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;QACnG,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"$default": {
|
|
11
11
|
"$source": "projectName"
|
|
12
12
|
}
|
|
13
|
+
},
|
|
14
|
+
"strategy": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "The strategy to use (critters or blocking). Auto-detected if not provided.",
|
|
17
|
+
"enum": ["blocking", "critters"]
|
|
13
18
|
}
|
|
14
19
|
},
|
|
15
20
|
"required": ["project"]
|
|
@@ -36,7 +36,19 @@ type NgTheme<T extends string = string & {}> = DefaultNgTheme | T;
|
|
|
36
36
|
* Represents the value that comes from `matchMedia`, not user selection.
|
|
37
37
|
*/
|
|
38
38
|
type NgSystemTheme = Exclude<DefaultNgTheme, 'system'>;
|
|
39
|
+
/**
|
|
40
|
+
* Theme application mode.
|
|
41
|
+
* - `'attribute'`: sets `data-theme` attribute on `<html>`
|
|
42
|
+
* - `'class'`: adds theme class to `<html>`
|
|
43
|
+
* - `'both'`: uses both attribute and class
|
|
44
|
+
*/
|
|
39
45
|
type NgMode = 'attribute' | 'class' | 'both';
|
|
46
|
+
/**
|
|
47
|
+
* Theme application strategy.
|
|
48
|
+
* - `'blocking'`: theme CSS is loaded synchronously before rendering
|
|
49
|
+
* - `'critters'`: theme CSS is inlined using Critters for SSR/SSG
|
|
50
|
+
*/
|
|
51
|
+
type NgStrategy = 'blocking' | 'critters';
|
|
40
52
|
/**
|
|
41
53
|
* Library configuration.
|
|
42
54
|
*
|
|
@@ -45,9 +57,22 @@ type NgMode = 'attribute' | 'class' | 'both';
|
|
|
45
57
|
* via {@link provideThemeStack} to get a closed, type-safe theme union.
|
|
46
58
|
*/
|
|
47
59
|
interface NgConfig<T extends string = string & {}> {
|
|
60
|
+
/** The theme to use on first visit or when no preference is saved. Default: 'system'. */
|
|
48
61
|
defaultTheme: NgTheme<T>;
|
|
62
|
+
/** Key used to persist theme preference in localStorage. Default: 'ngx-theme-stack-theme'. */
|
|
49
63
|
storageKey: string;
|
|
64
|
+
/**
|
|
65
|
+
* How the theme should be applied to the document (via class, attribute or both).
|
|
66
|
+
* Default: 'class'.
|
|
67
|
+
*/
|
|
50
68
|
mode: NgMode;
|
|
69
|
+
/**
|
|
70
|
+
* Performance strategy for anti-flash.
|
|
71
|
+
* Use 'critters' for SSG/SSR builds with inlined CSS, 'blocking' for standard CSS files.
|
|
72
|
+
* Default: 'critters'.
|
|
73
|
+
*/
|
|
74
|
+
strategy: NgStrategy;
|
|
75
|
+
/** List of supported theme identifiers. Default: ['light', 'dark', 'system']. */
|
|
51
76
|
themes: NgTheme<T>[];
|
|
52
77
|
}
|
|
53
78
|
|
|
@@ -74,18 +99,17 @@ declare class CoreThemeService {
|
|
|
74
99
|
/**
|
|
75
100
|
* Whether the service has completed client-side initialization.
|
|
76
101
|
*
|
|
77
|
-
* `false` during SSR and on the very first render pass
|
|
78
|
-
*
|
|
79
|
-
*
|
|
102
|
+
* `false` during SSR and on the very first render pass before the initial theme
|
|
103
|
+
* is resolved from `localStorage`. Becomes `true` immediately after the
|
|
104
|
+
* first browser render pass.
|
|
80
105
|
*
|
|
81
|
-
*
|
|
82
|
-
* `resolvedTheme`
|
|
83
|
-
* renders the default
|
|
84
|
-
* value stored.
|
|
106
|
+
* **Important:** Guard template elements that display `selectedTheme()` or
|
|
107
|
+
* `resolvedTheme()` behind this signal to prevent hydration-mismatch flashes
|
|
108
|
+
* (e.g. if the server renders the default 'system' but the user has 'dark' stored).
|
|
85
109
|
*
|
|
86
110
|
* @example
|
|
87
111
|
* ```html
|
|
88
|
-
* {{
|
|
112
|
+
* {{ theme.isHydrated() ? theme.selectedTheme() : '...' }}
|
|
89
113
|
* ```
|
|
90
114
|
*/
|
|
91
115
|
readonly isHydrated: _angular_core.WritableSignal<boolean>;
|
|
@@ -132,6 +156,7 @@ declare const DEFAULT_NG_CONFIG: {
|
|
|
132
156
|
defaultTheme: "system";
|
|
133
157
|
storageKey: string;
|
|
134
158
|
mode: "class";
|
|
159
|
+
strategy: "critters";
|
|
135
160
|
themes: ("system" | "light" | "dark")[];
|
|
136
161
|
};
|
|
137
162
|
declare const NGX_THEME_STACK_CONFIG: InjectionToken<NgConfig<string>>;
|
|
@@ -140,6 +165,14 @@ declare const NGX_THEME_STACK_CONFIG: InjectionToken<NgConfig<string>>;
|
|
|
140
165
|
*
|
|
141
166
|
* Custom `themes` are **merged** with the built-in defaults
|
|
142
167
|
* (`'light'`, `'dark'`, `'system'`), so you never lose the base themes.
|
|
168
|
+
*
|
|
169
|
+
* **Defaults:**
|
|
170
|
+
* - `themes`: `['light', 'dark', 'system']`
|
|
171
|
+
* - `defaultTheme`: `'system'`
|
|
172
|
+
* - `storageKey`: `'ngx-theme-stack-theme'`
|
|
173
|
+
* - `mode`: `'class'`
|
|
174
|
+
* - `strategy`: `'critters'`
|
|
175
|
+
|
|
143
176
|
*
|
|
144
177
|
* The type parameter `T` is **inferred automatically** from the `themes` array
|
|
145
178
|
* when passed as a `const` — no need to specify it manually.
|
|
@@ -159,6 +192,13 @@ declare const NGX_THEME_STACK_CONFIG: InjectionToken<NgConfig<string>>;
|
|
|
159
192
|
* provideThemeStack()
|
|
160
193
|
*
|
|
161
194
|
* @example
|
|
195
|
+
* // SSR/SSG Optimization — uses Critters inlining strategy
|
|
196
|
+
* provideThemeStack({
|
|
197
|
+
* strategy: 'critters',
|
|
198
|
+
* mode: 'class',
|
|
199
|
+
* })
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
162
202
|
* // Closed union: TypeScript infers 'sepia' | 'ocean' from the array
|
|
163
203
|
* provideThemeStack({
|
|
164
204
|
* themes: ['sepia', 'ocean'] as const,
|
|
@@ -170,7 +210,7 @@ declare const NGX_THEME_STACK_CONFIG: InjectionToken<NgConfig<string>>;
|
|
|
170
210
|
* // Custom storage key and mode
|
|
171
211
|
* provideThemeStack({
|
|
172
212
|
* storageKey: 'my-app-theme',
|
|
173
|
-
* mode: '
|
|
213
|
+
* mode: 'attribute',
|
|
174
214
|
* })
|
|
175
215
|
*/
|
|
176
216
|
declare function provideThemeStack<const T extends string = DefaultNgTheme>(config?: Partial<NgConfig<T>>): {
|
|
@@ -190,17 +230,17 @@ declare class ThemeCycleService {
|
|
|
190
230
|
#private;
|
|
191
231
|
/** The theme explicitly selected by the user. May be `'system'`. */
|
|
192
232
|
readonly selectedTheme: _angular_core.Signal<ngx_theme_stack.NgTheme>;
|
|
193
|
-
/** Resolved theme applied to the DOM. Always concrete — never `'system'`. */
|
|
233
|
+
/** Resolved theme currently applied to the DOM. Always concrete — never `'system'`. */
|
|
194
234
|
readonly resolvedTheme: _angular_core.Signal<(string & {}) | ngx_theme_stack.NgSystemTheme>;
|
|
195
|
-
/** Whether the currently applied theme is dark
|
|
235
|
+
/** Whether the currently applied theme is `'dark'`. */
|
|
196
236
|
readonly isDark: _angular_core.Signal<boolean>;
|
|
197
|
-
/** Whether the currently applied theme is light
|
|
237
|
+
/** Whether the currently applied theme is `'light'`. */
|
|
198
238
|
readonly isLight: _angular_core.Signal<boolean>;
|
|
199
|
-
/** Whether the
|
|
239
|
+
/** Whether the user has explicitly selected `'system'` preference. */
|
|
200
240
|
readonly isSystem: _angular_core.Signal<boolean>;
|
|
201
241
|
/**
|
|
202
|
-
* Whether the service has completed client-side initialization
|
|
203
|
-
*
|
|
242
|
+
* Whether the service has completed client-side initialization and
|
|
243
|
+
* resolved the real persisted theme. Use to prevent hydration flashes.
|
|
204
244
|
*/
|
|
205
245
|
readonly isHydrated: _angular_core.Signal<boolean>;
|
|
206
246
|
/**
|
|
@@ -224,21 +264,21 @@ declare class ThemeCycleService {
|
|
|
224
264
|
*/
|
|
225
265
|
declare class ThemeSelectService {
|
|
226
266
|
#private;
|
|
227
|
-
/** List of all configured themes. Defaults to ['light', 'dark', 'system']
|
|
267
|
+
/** List of all configured themes. Defaults to `['light', 'dark', 'system']`. */
|
|
228
268
|
readonly availableThemes: string[];
|
|
229
269
|
/** The theme explicitly selected by the user. May be `'system'`. */
|
|
230
270
|
readonly selectedTheme: _angular_core.Signal<NgTheme>;
|
|
231
|
-
/** Resolved theme applied to the DOM. Always concrete — never `'system'`. */
|
|
271
|
+
/** Resolved theme currently applied to the DOM. Always concrete — never `'system'`. */
|
|
232
272
|
readonly resolvedTheme: _angular_core.Signal<(string & {}) | ngx_theme_stack.NgSystemTheme>;
|
|
233
|
-
/** Whether the currently applied theme is dark
|
|
273
|
+
/** Whether the currently applied theme is `'dark'`. */
|
|
234
274
|
readonly isDark: _angular_core.Signal<boolean>;
|
|
235
|
-
/** Whether the currently applied theme is light
|
|
275
|
+
/** Whether the currently applied theme is `'light'`. */
|
|
236
276
|
readonly isLight: _angular_core.Signal<boolean>;
|
|
237
|
-
/** Whether the
|
|
277
|
+
/** Whether the user has explicitly selected `'system'` preference. */
|
|
238
278
|
readonly isSystem: _angular_core.Signal<boolean>;
|
|
239
279
|
/**
|
|
240
|
-
* Whether the service has completed client-side initialization
|
|
241
|
-
*
|
|
280
|
+
* Whether the service has completed client-side initialization and
|
|
281
|
+
* resolved the real persisted theme. Use to prevent hydration flashes.
|
|
242
282
|
*/
|
|
243
283
|
readonly isHydrated: _angular_core.Signal<boolean>;
|
|
244
284
|
/**
|
|
@@ -260,20 +300,19 @@ declare class ThemeSelectService {
|
|
|
260
300
|
*/
|
|
261
301
|
declare class ThemeToggleService {
|
|
262
302
|
#private;
|
|
263
|
-
/** Resolved theme applied to the DOM. Always concrete — never `'system'`. */
|
|
303
|
+
/** Resolved theme currently applied to the DOM. Always concrete — never `'system'`. */
|
|
264
304
|
readonly resolvedTheme: _angular_core.Signal<(string & {}) | ngx_theme_stack.NgSystemTheme>;
|
|
305
|
+
/** The theme explicitly selected by the user. May be `'system'`. */
|
|
265
306
|
readonly selectedTheme: _angular_core.Signal<ngx_theme_stack.NgTheme>;
|
|
266
|
-
/** Whether the currently applied theme is dark
|
|
307
|
+
/** Whether the currently applied theme is `'dark'`. */
|
|
267
308
|
readonly isDark: _angular_core.Signal<boolean>;
|
|
268
|
-
/** Whether the currently applied theme is light
|
|
309
|
+
/** Whether the currently applied theme is `'light'`. */
|
|
269
310
|
readonly isLight: _angular_core.Signal<boolean>;
|
|
270
|
-
/** Whether the
|
|
311
|
+
/** Whether the user has explicitly selected `'system'` preference. */
|
|
271
312
|
readonly isSystem: _angular_core.Signal<boolean>;
|
|
272
313
|
/**
|
|
273
|
-
* Whether the service has completed client-side initialization
|
|
274
|
-
*
|
|
275
|
-
* Guard any template logic that shows `selectedTheme` or `resolvedTheme`
|
|
276
|
-
* behind this signal to avoid a hydration-mismatch flash.
|
|
314
|
+
* Whether the service has completed client-side initialization and
|
|
315
|
+
* resolved the real persisted theme. Use to prevent hydration flashes.
|
|
277
316
|
*/
|
|
278
317
|
readonly isHydrated: _angular_core.Signal<boolean>;
|
|
279
318
|
/**
|
|
@@ -309,4 +348,4 @@ declare class NgxThemeStackError extends Error {
|
|
|
309
348
|
}
|
|
310
349
|
|
|
311
350
|
export { CoreThemeService, DEFAULT_NG_CONFIG, DEFAULT_THEMES, NGX_THEME_STACK_CONFIG, NgxThemeStackError, ThemeCycleService, ThemeSelectService, ThemeToggleService, provideThemeStack };
|
|
312
|
-
export type { DefaultNgTheme, NgConfig, NgMode, NgSystemTheme, NgTheme };
|
|
351
|
+
export type { DefaultNgTheme, NgConfig, NgMode, NgStrategy, NgSystemTheme, NgTheme };
|