@motion-proto/live-tokens 0.52.1 → 0.53.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.
Files changed (60) hide show
  1. package/.claude/skills/live-tokens-adjust-shape-space/SKILL.md +7 -1
  2. package/CHANGELOG.md +63 -0
  3. package/bin/adjust.mjs +16 -39
  4. package/bin/generate-theme.mjs +20 -6
  5. package/dist-plugin/adjust/index.cjs +781 -21
  6. package/dist-plugin/adjust/index.d.cts +2 -1
  7. package/dist-plugin/adjust/index.d.ts +2 -1
  8. package/dist-plugin/adjust/index.js +43 -21
  9. package/dist-plugin/{chunk-6OZFXIQI.js → chunk-232GZGQU.js} +207 -12
  10. package/dist-plugin/chunk-NE6N66EE.js +753 -0
  11. package/dist-plugin/{chunk-JIGIIE5P.js → chunk-PB2JTK2H.js} +123 -0
  12. package/dist-plugin/generateColorsAndType/index.cjs +48 -32
  13. package/dist-plugin/generateColorsAndType/index.d.cts +2 -1
  14. package/dist-plugin/generateColorsAndType/index.d.ts +2 -1
  15. package/dist-plugin/generateColorsAndType/index.js +7 -773
  16. package/dist-plugin/{themeTypes-Dky03HL9.d.cts → index-DpTIRZ2H.d.cts} +49 -21
  17. package/dist-plugin/{themeTypes-Dky03HL9.d.ts → index-DpTIRZ2H.d.ts} +49 -21
  18. package/dist-plugin/index.cjs +1159 -85
  19. package/dist-plugin/index.js +102 -80
  20. package/dist-plugin/migrateData/index.cjs +956 -14
  21. package/dist-plugin/migrateData/index.js +10 -3
  22. package/package.json +6 -4
  23. package/src/editor/component-editor/scaffolding/ComponentFileManager.svelte +9 -23
  24. package/src/editor/component-editor/scaffolding/LinkedBlock.svelte +8 -8
  25. package/src/editor/core/components/adjustAliases.ts +49 -22
  26. package/src/editor/core/components/aliasKinds.ts +7 -2
  27. package/src/editor/core/components/componentConfigService.ts +1 -1
  28. package/src/editor/core/store/editorStore.ts +7 -197
  29. package/src/editor/core/store/editorTypes.ts +9 -30
  30. package/src/editor/core/themes/lookSummary.ts +3 -25
  31. package/src/editor/core/themes/migrateComponentConfig.ts +205 -0
  32. package/src/editor/core/themes/migrations/2026-05-19-sectiondivider-rich-gradient.ts +1 -1
  33. package/src/editor/core/themes/migrations/2026-05-20-sectiondivider-slim-variants.ts +1 -1
  34. package/src/editor/core/themes/migrations/2026-05-22-sectiondivider-intrinsics-to-css.ts +1 -1
  35. package/src/editor/core/themes/parsers/gradient.ts +211 -0
  36. package/src/editor/core/themes/slices/gradients.ts +5 -58
  37. package/src/editor/core/themes/themeService.ts +22 -9
  38. package/src/editor/core/themes/themeTypes.ts +71 -21
  39. package/src/editor/docs/content/themes-workflow.md +9 -11
  40. package/src/editor/docs/content/where-themes-live.md +2 -2
  41. package/src/editor/docs/content.generated.ts +2 -2
  42. package/src/editor/index.ts +1 -0
  43. package/src/editor/styles/ui-editor.css +5 -2
  44. package/src/editor/ui/PaletteEditor.svelte +30 -15
  45. package/src/editor/ui/ThemePanel.svelte +24 -15
  46. package/src/editor/ui/Toggle.svelte +22 -22
  47. package/src/editor/ui/UIPillButton.svelte +1 -1
  48. package/src/editor/ui/UIReveal.svelte +47 -0
  49. package/src/editor/ui/UISquareButton.svelte +1 -1
  50. package/src/editor/ui/colors/ColorsTab.svelte +4 -5
  51. package/src/editor/ui/palette/OverridesPanel.svelte +4 -3
  52. package/src/editor/ui/palette/PaletteJumpButton.svelte +3 -3
  53. package/src/editor/ui/palette/ScaleCurveEditor.svelte +3 -2
  54. package/src/live-tokens/data/themes/autumn.json +77 -41
  55. package/src/live-tokens/data/themes/halloween.json +53 -52
  56. package/src/live-tokens/data/themes/midnight-study.json +136 -68
  57. package/src/live-tokens/data/themes/ocean.json +77 -41
  58. package/src/live-tokens/data/themes/royal-velvet.json +43 -42
  59. package/src/live-tokens/data/themes/spring-meadow.json +86 -52
  60. package/src/live-tokens/data/themes/sunset.json +101 -40
@@ -7,6 +7,31 @@ interface CurveAnchor {
7
7
  outDy: number;
8
8
  }
9
9
 
10
+ interface GradientStop$1 {
11
+ /** 0–100 percentage along the gradient axis. */
12
+ position: number;
13
+ /** A design-token name (`--surface-neutral-low`) or a raw CSS colour. */
14
+ color: string;
15
+ /** 0–100 alpha. Absent means 100. */
16
+ opacity?: number;
17
+ /** `false` marks the stop an explicit off-palette override: the stop picker
18
+ * opens to any colour rather than the current family, and a family-swap
19
+ * rewrite skips the stop so its colour survives. Absent means `true`.
20
+ * It has no CSS form, so `parseGradientValue` never produces it and
21
+ * `formatGradientValue` ignores it. It lives on the shared stop because
22
+ * the persisted stop carries it. */
23
+ monochrome?: boolean;
24
+ }
25
+ interface GradientValue {
26
+ type: 'linear' | 'radial' | 'solid' | 'none';
27
+ angle: number;
28
+ radius?: number;
29
+ centerX?: number;
30
+ aspectX?: number;
31
+ aspectY?: number;
32
+ stops: GradientStop$1[];
33
+ }
34
+
10
35
  interface Oklch {
11
36
  l: number;
12
37
  c: number;
@@ -146,11 +171,21 @@ interface GradientDiskToken {
146
171
  }[];
147
172
  }
148
173
  /**
149
- * Where a live read resolved from: the unsaved `_working` buffer, the open
150
- * theme's embedded copy, or the shipped default. A `working` source is an
151
- * unsaved delta from the active theme.
174
+ * Where a live component config resolved from: the unsaved `_working`
175
+ * buffer, or the open theme's embedded copy. Every theme carries every
176
+ * component complete, so `working` is the only genuine divergence —
177
+ * anything else is what the open document itself resolves to.
178
+ */
179
+ type LiveSource = 'working' | 'theme';
180
+ /**
181
+ * Where a live colors-and-type read resolved from. Unlike `LiveSource`, this
182
+ * keeps a third value: colors-and-type resolution is unchanged by the theme
183
+ * completeness work (docs/plans/theme-completeness.md Wave 4), so `default`
184
+ * still answers the one case completeness can't reach — the open theme's
185
+ * file itself is unreadable (a stale pointer, or deleted mid-session), so
186
+ * there is no document to resolve `working` or `theme` against.
152
187
  */
153
- type LiveSource = 'working' | 'theme' | 'default';
188
+ type ColorsAndTypeSource = 'working' | 'theme' | 'default';
154
189
  interface ColorsAndType {
155
190
  name: string;
156
191
  createdAt: string;
@@ -170,8 +205,8 @@ interface ColorsAndType {
170
205
  * handlers; read by `themeInit` to seed `openThemeSlug`. Not persisted.
171
206
  */
172
207
  _fileName?: string;
173
- /** Server-attached marker: which of the three live layers answered. */
174
- _source?: LiveSource;
208
+ /** Server-attached marker: which live layer answered. See `ColorsAndTypeSource`. */
209
+ _source?: ColorsAndTypeSource;
175
210
  /**
176
211
  * Migration stamp. Absent on legacy files, treated as 0; the loader runs
177
212
  * any registered theme migrations whose `fromVersion >= file.schemaVersion`.
@@ -186,19 +221,7 @@ interface ColorsAndType {
186
221
  * gradients that can't compress to a single string. */
187
222
  type AliasDiskValue = string | {
188
223
  kind: 'gradient';
189
- value: {
190
- type: 'linear' | 'radial' | 'solid' | 'none';
191
- angle: number;
192
- radius?: number;
193
- centerX?: number;
194
- aspectX?: number;
195
- aspectY?: number;
196
- stops: {
197
- position: number;
198
- color: string;
199
- opacity?: number;
200
- }[];
201
- };
224
+ value: GradientValue;
202
225
  };
203
226
  interface ComponentConfig {
204
227
  name: string;
@@ -212,7 +235,10 @@ interface ComponentConfig {
212
235
  * theme, not a config file. Set by the component-configs GET handlers.
213
236
  */
214
237
  _fileName?: string;
215
- /** Server-attached marker: which of the three live layers answered. */
238
+ /** Server-attached marker: which live layer answered — `working` the
239
+ * buffer, `theme` the open document's embedded copy. No third value:
240
+ * every theme carries every component, so there is no shipped-default
241
+ * layer left to report (unlike `ColorsAndTypeSource`). */
216
242
  _source?: LiveSource;
217
243
  /**
218
244
  * Migration stamp. Absent on legacy files, treated as 0. See `ColorsAndType.schemaVersion`.
@@ -220,4 +246,6 @@ interface ComponentConfig {
220
246
  schemaVersion?: number;
221
247
  }
222
248
 
223
- export type { AliasDiskValue as A, ColorsAndType as C, FontSource as F, GradientDiskToken as G, HarmonyMode as H, Oklch as O, ComponentConfig as a, FontStack as b };
249
+ declare const CURRENT_COMPONENT_SCHEMA_VERSION: number;
250
+
251
+ export { type AliasDiskValue as A, CURRENT_COMPONENT_SCHEMA_VERSION as C, type FontSource as F, type GradientDiskToken as G, type HarmonyMode as H, type Oklch as O, type ColorsAndType as a, type ComponentConfig as b, type FontStack as c };
@@ -7,6 +7,31 @@ interface CurveAnchor {
7
7
  outDy: number;
8
8
  }
9
9
 
10
+ interface GradientStop$1 {
11
+ /** 0–100 percentage along the gradient axis. */
12
+ position: number;
13
+ /** A design-token name (`--surface-neutral-low`) or a raw CSS colour. */
14
+ color: string;
15
+ /** 0–100 alpha. Absent means 100. */
16
+ opacity?: number;
17
+ /** `false` marks the stop an explicit off-palette override: the stop picker
18
+ * opens to any colour rather than the current family, and a family-swap
19
+ * rewrite skips the stop so its colour survives. Absent means `true`.
20
+ * It has no CSS form, so `parseGradientValue` never produces it and
21
+ * `formatGradientValue` ignores it. It lives on the shared stop because
22
+ * the persisted stop carries it. */
23
+ monochrome?: boolean;
24
+ }
25
+ interface GradientValue {
26
+ type: 'linear' | 'radial' | 'solid' | 'none';
27
+ angle: number;
28
+ radius?: number;
29
+ centerX?: number;
30
+ aspectX?: number;
31
+ aspectY?: number;
32
+ stops: GradientStop$1[];
33
+ }
34
+
10
35
  interface Oklch {
11
36
  l: number;
12
37
  c: number;
@@ -146,11 +171,21 @@ interface GradientDiskToken {
146
171
  }[];
147
172
  }
148
173
  /**
149
- * Where a live read resolved from: the unsaved `_working` buffer, the open
150
- * theme's embedded copy, or the shipped default. A `working` source is an
151
- * unsaved delta from the active theme.
174
+ * Where a live component config resolved from: the unsaved `_working`
175
+ * buffer, or the open theme's embedded copy. Every theme carries every
176
+ * component complete, so `working` is the only genuine divergence —
177
+ * anything else is what the open document itself resolves to.
178
+ */
179
+ type LiveSource = 'working' | 'theme';
180
+ /**
181
+ * Where a live colors-and-type read resolved from. Unlike `LiveSource`, this
182
+ * keeps a third value: colors-and-type resolution is unchanged by the theme
183
+ * completeness work (docs/plans/theme-completeness.md Wave 4), so `default`
184
+ * still answers the one case completeness can't reach — the open theme's
185
+ * file itself is unreadable (a stale pointer, or deleted mid-session), so
186
+ * there is no document to resolve `working` or `theme` against.
152
187
  */
153
- type LiveSource = 'working' | 'theme' | 'default';
188
+ type ColorsAndTypeSource = 'working' | 'theme' | 'default';
154
189
  interface ColorsAndType {
155
190
  name: string;
156
191
  createdAt: string;
@@ -170,8 +205,8 @@ interface ColorsAndType {
170
205
  * handlers; read by `themeInit` to seed `openThemeSlug`. Not persisted.
171
206
  */
172
207
  _fileName?: string;
173
- /** Server-attached marker: which of the three live layers answered. */
174
- _source?: LiveSource;
208
+ /** Server-attached marker: which live layer answered. See `ColorsAndTypeSource`. */
209
+ _source?: ColorsAndTypeSource;
175
210
  /**
176
211
  * Migration stamp. Absent on legacy files, treated as 0; the loader runs
177
212
  * any registered theme migrations whose `fromVersion >= file.schemaVersion`.
@@ -186,19 +221,7 @@ interface ColorsAndType {
186
221
  * gradients that can't compress to a single string. */
187
222
  type AliasDiskValue = string | {
188
223
  kind: 'gradient';
189
- value: {
190
- type: 'linear' | 'radial' | 'solid' | 'none';
191
- angle: number;
192
- radius?: number;
193
- centerX?: number;
194
- aspectX?: number;
195
- aspectY?: number;
196
- stops: {
197
- position: number;
198
- color: string;
199
- opacity?: number;
200
- }[];
201
- };
224
+ value: GradientValue;
202
225
  };
203
226
  interface ComponentConfig {
204
227
  name: string;
@@ -212,7 +235,10 @@ interface ComponentConfig {
212
235
  * theme, not a config file. Set by the component-configs GET handlers.
213
236
  */
214
237
  _fileName?: string;
215
- /** Server-attached marker: which of the three live layers answered. */
238
+ /** Server-attached marker: which live layer answered — `working` the
239
+ * buffer, `theme` the open document's embedded copy. No third value:
240
+ * every theme carries every component, so there is no shipped-default
241
+ * layer left to report (unlike `ColorsAndTypeSource`). */
216
242
  _source?: LiveSource;
217
243
  /**
218
244
  * Migration stamp. Absent on legacy files, treated as 0. See `ColorsAndType.schemaVersion`.
@@ -220,4 +246,6 @@ interface ComponentConfig {
220
246
  schemaVersion?: number;
221
247
  }
222
248
 
223
- export type { AliasDiskValue as A, ColorsAndType as C, FontSource as F, GradientDiskToken as G, HarmonyMode as H, Oklch as O, ComponentConfig as a, FontStack as b };
249
+ declare const CURRENT_COMPONENT_SCHEMA_VERSION: number;
250
+
251
+ export { type AliasDiskValue as A, CURRENT_COMPONENT_SCHEMA_VERSION as C, type FontSource as F, type GradientDiskToken as G, type HarmonyMode as H, type Oklch as O, type ColorsAndType as a, type ComponentConfig as b, type FontStack as c };