@ethlete/core 5.0.0-next.71 → 5.0.0-next.73

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @ethlete/core
2
2
 
3
+ ## 5.0.0-next.73
4
+
5
+ ### Minor Changes
6
+
7
+ - The theme generators write a color theme's `type` as `--et-color-theme-type` and a surface's `colorThemeVariants` as `--et-surface-color-theme-variants`, so design frames can resolve semantic colors and surface swaps.
8
+
9
+ ### Patch Changes
10
+
11
+ - The `color-theme-variants` migration declares `ts-morph`, so `et update` adds it before the codemod runs.
12
+ - `AnimatedLifecycleDirective` no longer throws `Cannot read properties of undefined (reading 'directive')` when a bundle evaluates `AnimatableDirective` first, for example in a lazy chunk that uses `NotificationComponent`.
13
+ - Removes every circular import inside the package, so no module can be read before it has finished loading, and adds a test that fails on a new one.
14
+ - `et migrations` now lists `migrate-create-destroy`, `migrate-color-theme-variants` and `migrate-from-ngrx-toolkit`, all at level `optional`.
15
+
16
+ ## 5.0.0-next.72
17
+
18
+ ### Patch Changes
19
+
20
+ - Add `resizeHandlesStyles` under `@ethlete/core/design/resize-handles`: the `et-resize-handles` stylesheet for a design drawing.
21
+
3
22
  ## 5.0.0-next.71
4
23
 
5
24
  ### Patch Changes
@@ -0,0 +1,4 @@
1
+ import resizeHandles from '../src/lib/resize-handles/resize-handles.component.css?inline';
2
+
3
+ /** The stylesheet of `ResizeHandlesComponent`, for a design drawing. */
4
+ export const resizeHandlesStyles = resizeHandles;
@@ -169,6 +169,8 @@ export const colorThemeCss = (themes, options = {}) => {
169
169
  else {
170
170
  themeVars.push(`.${runtimePrefix}-color--${name} {`);
171
171
  }
172
+ if (theme.type)
173
+ themeVars.push(` --${runtimePrefix}-color-theme-type: ${theme.type};`);
172
174
  addThemeColorVariants(themeVars, runtimePrefix, theme);
173
175
  themeVars.push('}\n');
174
176
  }
@@ -311,6 +313,10 @@ const pushSurfaceVars = (vars, runtimePrefix, theme, indent) => {
311
313
  vars.push(`${indent}--${runtimePrefix}-surface-border: ${theme.border};`);
312
314
  vars.push(`${indent}--${runtimePrefix}-surface-type: ${theme.type};`);
313
315
  vars.push(`${indent}--${runtimePrefix}-surface-elevation: ${theme.elevation};`);
316
+ const variants = Object.entries(theme.colorThemeVariants ?? {}).filter((entry) => typeof entry[1] === 'string');
317
+ if (variants.length > 0) {
318
+ vars.push(`${indent}--${runtimePrefix}-surface-color-theme-variants: ${variants.map(([chosen, variant]) => `${cssThemeName(chosen)} ${cssThemeName(variant)}`).join(', ')};`);
319
+ }
314
320
  if (theme.interactionColor) {
315
321
  const { color, onColor, inkColor } = theme.interactionColor;
316
322
  pushRuntimeInteractionVars(vars, `--${runtimePrefix}-surface-interaction`, color, indent);
@@ -8,6 +8,7 @@ export type ThemeCssSurfaceTheme = {
8
8
  type: 'light' | 'dark';
9
9
  elevation: number;
10
10
  isDefault?: boolean;
11
+ colorThemeVariants?: Partial<Record<string, string>>;
11
12
  interactionColor?: {
12
13
  color: Required<StateMap<Rgb>>;
13
14
  onColor?: StateMap<Rgb>;
@@ -28,6 +29,7 @@ type ThemeCssSwatch = {
28
29
 
29
30
  export type ThemeCssColorTheme = {
30
31
  name: string;
32
+ type?: 'success' | 'warning' | 'error';
31
33
  isDefault?: boolean;
32
34
  primary: ThemeCssSwatch;
33
35
  secondary?: ThemeCssSwatch;
@@ -252,6 +254,8 @@ export const colorThemeCss = (themes: ThemeCssColorTheme[], options: ThemeCssOpt
252
254
  themeVars.push(`.${runtimePrefix}-color--${name} {`);
253
255
  }
254
256
 
257
+ if (theme.type) themeVars.push(` --${runtimePrefix}-color-theme-type: ${theme.type};`);
258
+
255
259
  addThemeColorVariants(themeVars, runtimePrefix, theme);
256
260
  themeVars.push('}\n');
257
261
  }
@@ -430,6 +434,16 @@ const pushSurfaceVars = (vars: string[], runtimePrefix: string, theme: ThemeCssS
430
434
  vars.push(`${indent}--${runtimePrefix}-surface-type: ${theme.type};`);
431
435
  vars.push(`${indent}--${runtimePrefix}-surface-elevation: ${theme.elevation};`);
432
436
 
437
+ const variants = Object.entries(theme.colorThemeVariants ?? {}).filter(
438
+ (entry): entry is [string, string] => typeof entry[1] === 'string',
439
+ );
440
+
441
+ if (variants.length > 0) {
442
+ vars.push(
443
+ `${indent}--${runtimePrefix}-surface-color-theme-variants: ${variants.map(([chosen, variant]) => `${cssThemeName(chosen)} ${cssThemeName(variant)}`).join(', ')};`,
444
+ );
445
+ }
446
+
433
447
  if (theme.interactionColor) {
434
448
  const { color, onColor, inkColor } = theme.interactionColor;
435
449