@motion-proto/live-tokens 0.67.0 → 0.68.1

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 (66) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +67 -9
  3. package/bin/generate-theme.mjs +5 -4
  4. package/dist-plugin/adjust/index.d.cts +1 -1
  5. package/dist-plugin/adjust/index.d.ts +1 -1
  6. package/dist-plugin/{chunk-T4PMCFJN.js → chunk-2UX6EVVA.js} +30 -30
  7. package/dist-plugin/{dataPaths-DZUzVv8H.d.cts → dataPaths-bJTCEO4H.d.cts} +1 -1
  8. package/dist-plugin/{dataPaths-DZUzVv8H.d.ts → dataPaths-bJTCEO4H.d.ts} +1 -1
  9. package/dist-plugin/fontPairing/index.d.cts +1 -1
  10. package/dist-plugin/fontPairing/index.d.ts +1 -1
  11. package/dist-plugin/generateColorsAndType/index.d.cts +1 -1
  12. package/dist-plugin/generateColorsAndType/index.d.ts +1 -1
  13. package/dist-plugin/index.cjs +32 -32
  14. package/dist-plugin/index.d.cts +1 -1
  15. package/dist-plugin/index.d.ts +1 -1
  16. package/dist-plugin/index.js +5 -5
  17. package/dist-plugin/migrateData/index.cjs +30 -30
  18. package/dist-plugin/migrateData/index.d.cts +1 -1
  19. package/dist-plugin/migrateData/index.d.ts +1 -1
  20. package/dist-plugin/migrateData/index.js +1 -1
  21. package/dist-plugin/tokensCssMigrations/index.d.cts +1 -1
  22. package/dist-plugin/tokensCssMigrations/index.d.ts +1 -1
  23. package/package.json +4 -4
  24. package/src/editor/bootstrap.ts +6 -6
  25. package/src/editor/component-editor/ImageLightboxEditor.svelte +1 -1
  26. package/src/editor/component-editor/scaffolding/ComponentFileManager.svelte +4 -4
  27. package/src/editor/core/fonts/fontLoader.ts +2 -2
  28. package/src/editor/core/preview/{lookPreview.ts → themePreview.ts} +27 -27
  29. package/src/editor/core/productionPulse.ts +3 -3
  30. package/src/editor/core/sketch/index.ts +52 -44
  31. package/src/editor/core/sketch/maskField.ts +9 -9
  32. package/src/editor/core/sketch/sketchLayer.ts +9 -9
  33. package/src/editor/core/sketch/sketchRegistry.ts +34 -34
  34. package/src/editor/core/sketch/sketchStore.ts +98 -83
  35. package/src/editor/core/sketch/sketchStyleService.ts +4 -4
  36. package/src/editor/core/sketch/sketchStyles.ts +28 -28
  37. package/src/editor/core/themes/colorsAndTypeService.ts +1 -1
  38. package/src/editor/core/themes/loadRows.ts +8 -8
  39. package/src/editor/core/themes/themeDocumentSync.ts +2 -2
  40. package/src/editor/core/themes/themeInit.ts +2 -2
  41. package/src/editor/core/themes/themeService.ts +17 -17
  42. package/src/editor/core/themes/{lookSummary.ts → themeSummary.ts} +9 -9
  43. package/src/editor/core/themes/themeTypes.ts +10 -6
  44. package/src/editor/docs/content/getting-started.md +1 -1
  45. package/src/editor/docs/content/sketch-mode.md +22 -17
  46. package/src/editor/docs/content/themes-workflow.md +11 -11
  47. package/src/editor/docs/content/where-themes-live.md +6 -6
  48. package/src/editor/docs/content.generated.ts +4 -4
  49. package/src/editor/index.ts +2 -2
  50. package/src/editor/ui/ThemePanel.svelte +52 -52
  51. package/src/editor/ui/sketch/SketchPreview.svelte +2 -2
  52. package/src/editor/ui/sketch/SketchTab.svelte +64 -38
  53. package/src/live-tokens/data/sketch-styles/dry.json +5 -5
  54. package/src/live-tokens/data/sketch-styles/hatched.json +9 -9
  55. package/src/live-tokens/data/sketch-styles/napkin.json +4 -4
  56. package/src/live-tokens/data/sketch-styles/pencil.json +2 -2
  57. package/src/live-tokens/data/themes/autumn.json +1 -1
  58. package/src/live-tokens/data/themes/halloween.json +1 -1
  59. package/src/live-tokens/data/themes/midnight-study.json +1 -1
  60. package/src/live-tokens/data/themes/ocean.json +1 -1
  61. package/src/live-tokens/data/themes/royal-velvet.json +1 -1
  62. package/src/live-tokens/data/themes/sketchy.json +1 -1
  63. package/src/live-tokens/data/themes/spring-meadow.json +1 -1
  64. package/src/live-tokens/data/themes/sunset.json +1 -1
  65. package/src/system/backdrop/backdrop.ts +1 -1
  66. package/src/system/components/SectionDivider.svelte +1 -1
@@ -14,18 +14,19 @@
14
14
  import {
15
15
  sketchEnabled,
16
16
  setSketchEnabled,
17
- sketchOffLook,
18
- sketchStyleName,
17
+ sketchOffTheme,
18
+ selectedSketchStyleId,
19
19
  sketchDirty,
20
20
  sketchSettings,
21
- selectSketchStyle,
22
21
  updateSketchSettings,
23
22
  refreshSavedSketchStyles,
24
23
  saveCurrentSketchStyle,
25
24
  saveSelectedSketchStyle,
26
25
  deleteSavedSketchStyle,
27
26
  } from '../../core/sketch/sketchStore';
28
- import { sketchLooks } from '../../core/sketch/sketchRegistry';
27
+ import { sketchStyles } from '../../core/sketch/sketchRegistry';
28
+ import { setSketch, unsavedSketchStyle } from '../../core/sketch';
29
+ import { THEME_SKETCH_ID } from '../../core/sketch/sketchStyles';
29
30
 
30
31
  interface Props {
31
32
  /** The rail's last jump. A fresh object per click, not a bare id, so
@@ -38,8 +39,13 @@
38
39
 
39
40
  let s = $derived($sketchSettings);
40
41
 
42
+ /** The theme's own style sits in the grid like any other row, but it is the
43
+ one row with no file behind it, so Save has nothing to write over. Save As
44
+ is what gives it one, after which it is an ordinary sketchstyle. */
45
+ let onUnsavedSketchStyle = $derived($selectedSketchStyleId === THEME_SKETCH_ID);
46
+
41
47
  // Save is disabled for the protected Default theme (ThemePanel.svelte);
42
- // Save As is the gesture actually on offer there, so the off-look copy has
48
+ // Save As is the gesture actually on offer there, so the off-style copy has
43
49
  // to name it instead.
44
50
  let activeIsProtected = $derived($openThemeSlug === 'default');
45
51
 
@@ -50,7 +56,7 @@
50
56
 
51
57
  /** All closed to start: twenty-odd dials in one scroll is a wall, and the
52
58
  summary on each trigger row answers most questions without opening
53
- anything. Each section then stands alone, because shaping a look means
59
+ anything. Each section then stands alone, because shaping a style means
54
60
  reaching between them — the border's detail against the noise it
55
61
  multiplies, the fill's travel against the border's.
56
62
 
@@ -124,43 +130,49 @@
124
130
  });
125
131
 
126
132
  /** Shipped and saved sketchstyles are one choice, so they share one radio
127
- group: picking a saved one clears the shipped selection natively. */
133
+ group: picking a saved one clears the shipped selection natively.
134
+
135
+ Picks go through `setSketch`, the same door a page picker uses, so one is
136
+ the whole gesture: the style is applied, the effect comes on, and the
137
+ page's own picker follows. Selecting without applying would leave the two
138
+ pickers disagreeing about what the page is drawn with. */
128
139
  const STYLE_RADIO_GROUP = 'sketchstyle';
129
140
 
130
141
  /** What the readout under the grid says. The selection survives a dial move,
131
142
  so the base keeps its name here and the blurb reports the drift instead. */
132
143
  let active = $derived(
133
144
  $sketchDirty
134
- ? { name: s.label, blurb: `Modified from ${s.label}. Save it to keep it.` }
145
+ ? {
146
+ name: s.label,
147
+ blurb: onUnsavedSketchStyle
148
+ ? 'Modified from settings this theme carries. Save As keeps them as a sketchstyle.'
149
+ : `Modified from ${s.label}. Save it to keep it.`,
150
+ }
135
151
  : { name: s.label, blurb: s.blurb || 'Your saved sketchstyle.' },
136
152
  );
137
153
 
138
- let selectedLook = $derived($sketchLooks.find((l) => l.id === $sketchStyleName));
154
+ let selectedSketchStyle = $derived($sketchStyles.find((l) => l.id === $selectedSketchStyleId));
139
155
  /** Offered whenever the dials have moved off the sketchstyle they name. A
140
- look backed by a project file is written over. A shipped one's file lives
156
+ style backed by a project file is written over. A shipped one's file lives
141
157
  in the package, so saving it writes this project's own under the same
142
158
  name, which is how a project comes to own its Pencil: the id is the same,
143
159
  so the new file takes the shipped one's place in the grid rather than
144
160
  sitting beside it. Nothing is lost either way, since deleting that file
145
161
  uncovers the packaged one again. */
146
- let canSave = $derived(!!selectedLook && $sketchDirty);
162
+ let canSave = $derived(!!selectedSketchStyle && $sketchDirty);
147
163
  let saveTitle = $derived(
148
- !selectedLook
149
- ? 'Pick a sketchstyle to save over'
150
- : !$sketchDirty
151
- ? 'No changes to save'
152
- : selectedLook.source === 'file'
153
- ? `Save over ${selectedLook.label}`
154
- : `Keep these dials as this project's ${selectedLook.label}`,
164
+ onUnsavedSketchStyle
165
+ ? 'These settings belong to no sketchstyle file. Save As keeps them as one.'
166
+ : !selectedSketchStyle
167
+ ? 'Pick a sketchstyle to save over'
168
+ : !$sketchDirty
169
+ ? 'No changes to save'
170
+ : `Save over ${selectedSketchStyle.label}`,
155
171
  );
156
172
 
157
173
  function saveInPlace() {
158
- if (!selectedLook) return;
159
- runStyleAction(
160
- selectedLook.source === 'file'
161
- ? saveSelectedSketchStyle()
162
- : saveCurrentSketchStyle(selectedLook.label),
163
- );
174
+ if (!selectedSketchStyle) return;
175
+ runStyleAction(saveSelectedSketchStyle());
164
176
  }
165
177
 
166
178
  let naming = $state(false);
@@ -324,9 +336,9 @@
324
336
  <div class="readout" aria-live="polite">
325
337
  <span class="readout-name">{active.name}</span>
326
338
  <p class="readout-blurb">{active.blurb}</p>
327
- {#if $sketchOffLook}
339
+ {#if $sketchOffTheme}
328
340
  {#if $sketchEnabled}
329
- <p class="readout-off-look">
341
+ <p class="readout-off-style">
330
342
  {#if activeIsProtected}
331
343
  Motion Proto is read-only, and these dials are ahead of it. Use Save As in the
332
344
  Theme panel to keep them in a new theme.
@@ -336,7 +348,7 @@
336
348
  {/if}
337
349
  </p>
338
350
  {:else}
339
- <p class="readout-off-look">
351
+ <p class="readout-off-style">
340
352
  The theme carries a sketchstyle this page is not painting. Saving now would drop
341
353
  it.
342
354
  </p>
@@ -345,25 +357,39 @@
345
357
  </div>
346
358
 
347
359
  <div class="presets">
348
- {#each $sketchLooks as look (look.id)}
360
+ {#if $unsavedSketchStyle}
361
+ <div class="saved-item">
362
+ <label class="preset">
363
+ <input
364
+ type="radio"
365
+ name={STYLE_RADIO_GROUP}
366
+ value={$unsavedSketchStyle.id}
367
+ checked={onUnsavedSketchStyle}
368
+ onchange={() => setSketch(THEME_SKETCH_ID)}
369
+ />
370
+ <span class="preset-name">{$unsavedSketchStyle.label}</span>
371
+ </label>
372
+ </div>
373
+ {/if}
374
+ {#each $sketchStyles as style (style.id)}
349
375
  <div class="saved-item">
350
376
  <label class="preset">
351
377
  <input
352
378
  type="radio"
353
379
  name={STYLE_RADIO_GROUP}
354
- value={look.id}
355
- checked={$sketchStyleName === look.id}
356
- onchange={() => selectSketchStyle(look.id)}
380
+ value={style.id}
381
+ checked={$selectedSketchStyleId === style.id}
382
+ onchange={() => setSketch(style.id)}
357
383
  />
358
- <span class="preset-name">{look.label}</span>
384
+ <span class="preset-name">{style.label}</span>
359
385
  </label>
360
- {#if look.source === 'file'}
386
+ {#if style.source === 'file'}
361
387
  <button
362
388
  type="button"
363
389
  class="saved-delete"
364
- title="Delete {look.label}"
365
- aria-label="Delete {look.label}"
366
- onclick={() => runStyleAction(deleteSavedSketchStyle(look.id))}
390
+ title="Delete {style.label}"
391
+ aria-label="Delete {style.label}"
392
+ onclick={() => runStyleAction(deleteSavedSketchStyle(style.id))}
367
393
  ><i class="fas fa-xmark"></i></button>
368
394
  {/if}
369
395
  </div>
@@ -665,7 +691,7 @@
665
691
  />
666
692
  </div>
667
693
  </div>
668
- {#if !s.maskBlobLinked}
694
+ {#if s.maskBlobX !== s.maskBlobY}
669
695
  <SketchDial
670
696
  label="Rotation" value={s.maskAngle} min={0} max={180} step={1}
671
697
  readout={`${blobAngle}°`}
@@ -1097,7 +1123,7 @@
1097
1123
  color: var(--ui-text-secondary);
1098
1124
  }
1099
1125
 
1100
- .readout-off-look {
1126
+ .readout-off-style {
1101
1127
  margin: var(--ui-space-2) 0 0;
1102
1128
  font-size: var(--ui-font-size-sm);
1103
1129
  font-weight: var(--ui-font-weight-medium);
@@ -21,11 +21,11 @@
21
21
  "pooling": 1.5,
22
22
  "strokeInk": 0.4,
23
23
  "maskOn": true,
24
- "maskBlobX": 150,
25
- "maskBlobY": 150,
24
+ "maskBlobX": 170,
25
+ "maskBlobY": 170,
26
26
  "maskBlobLinked": true,
27
27
  "maskAngle": 0,
28
- "maskOutputMin": 0.24,
28
+ "maskOutputMin": 0.57,
29
29
  "maskOutputMax": 0.91,
30
30
  "maskOctaves": 2,
31
31
  "maskGrain": "fractal",
@@ -42,6 +42,6 @@
42
42
  "iconMaskOn": true,
43
43
  "iconMaskScale": 3.8
44
44
  },
45
- "updatedAt": "2026-08-28T15:47:36.934Z",
45
+ "updatedAt": "2026-08-28T21:19:51.383Z",
46
46
  "createdAt": "2026-08-28T15:47:36.934Z"
47
- }
47
+ }
@@ -20,15 +20,15 @@
20
20
  "pressureMod": 0.45,
21
21
  "pooling": 0.8,
22
22
  "strokeInk": 1,
23
- "maskOn": false,
24
- "maskBlobX": 100,
25
- "maskBlobY": 100,
26
- "maskBlobLinked": true,
27
- "maskAngle": 0,
28
- "maskOutputMin": 0.45,
23
+ "maskOn": true,
24
+ "maskBlobX": 10,
25
+ "maskBlobY": 600,
26
+ "maskBlobLinked": false,
27
+ "maskAngle": 150,
28
+ "maskOutputMin": 0.35,
29
29
  "maskOutputMax": 1,
30
30
  "maskOctaves": 2,
31
- "maskGrain": "fractal",
31
+ "maskGrain": "turbulence",
32
32
  "maskPosterize": 1,
33
33
  "maskSoftness": 1.5,
34
34
  "jitterX": 1.5,
@@ -42,6 +42,6 @@
42
42
  "iconMaskOn": false,
43
43
  "iconMaskScale": 1
44
44
  },
45
- "updatedAt": "2026-08-28T15:47:36.934Z",
45
+ "updatedAt": "2026-08-28T21:17:18.232Z",
46
46
  "createdAt": "2026-08-28T15:47:36.934Z"
47
- }
47
+ }
@@ -25,16 +25,16 @@
25
25
  "maskBlobY": 150,
26
26
  "maskBlobLinked": true,
27
27
  "maskAngle": 0,
28
- "maskOutputMin": 0.43,
29
- "maskOutputMax": 0.95,
28
+ "maskOutputMin": 0.62,
29
+ "maskOutputMax": 1,
30
30
  "maskOctaves": 2,
31
31
  "maskGrain": "fractal",
32
32
  "maskPosterize": 2,
33
- "maskSoftness": 10,
33
+ "maskSoftness": 5,
34
34
  "jitterX": 6,
35
35
  "jitterY": 6,
36
36
  "jitterRot": 1.8,
37
- "jitterScale": 0.1,
37
+ "jitterScale": 0.075,
38
38
  "cornerSpread": 20,
39
39
  "cornerTravel": 17,
40
40
  "iconTravel": 2.25,
@@ -2,7 +2,7 @@
2
2
  "name": "Pencil",
3
3
  "settings": {
4
4
  "label": "Pencil",
5
- "blurb": "Two graphite passes on their own seeds, so the outline disagrees with itself the way a hand coming back round does. Tight grain, little else.",
5
+ "blurb": "Two graphite passes on their own seeds, so the outline disagrees with itself the way a hand coming back round does. The grain is drawn long and on the diagonal, the way a pencil shades.",
6
6
  "fillTravel": 0.75,
7
7
  "strokeTravel": 1.25,
8
8
  "wobble": 30,
@@ -44,4 +44,4 @@
44
44
  },
45
45
  "updatedAt": "2026-08-28T14:35:06.291Z",
46
46
  "createdAt": "2026-08-28T14:35:06.291Z"
47
- }
47
+ }
@@ -2,7 +2,7 @@
2
2
  "name": "Autumn",
3
3
  "createdAt": "2026-08-13T10:21:46.867Z",
4
4
  "updatedAt": "2026-08-19T22:39:32.785Z",
5
- "schemaVersion": 4,
5
+ "schemaVersion": 5,
6
6
  "colorsAndType": {
7
7
  "name": "Autumn",
8
8
  "createdAt": "2026-08-12T20:21:21.128Z",
@@ -2,7 +2,7 @@
2
2
  "name": "Halloween",
3
3
  "createdAt": "2026-08-13T10:21:46.867Z",
4
4
  "updatedAt": "2026-08-19T22:39:32.785Z",
5
- "schemaVersion": 4,
5
+ "schemaVersion": 5,
6
6
  "colorsAndType": {
7
7
  "name": "Halloween",
8
8
  "createdAt": "2026-08-12T20:13:46.209Z",
@@ -2,7 +2,7 @@
2
2
  "name": "Midnight Study",
3
3
  "createdAt": "2026-08-13T10:21:46.867Z",
4
4
  "updatedAt": "2026-08-27T17:03:51.623Z",
5
- "schemaVersion": 4,
5
+ "schemaVersion": 5,
6
6
  "colorsAndType": {
7
7
  "name": "Midnight Study",
8
8
  "createdAt": "2026-08-27T17:01:37.984Z",
@@ -2,7 +2,7 @@
2
2
  "name": "Ocean",
3
3
  "createdAt": "2026-08-13T10:21:46.867Z",
4
4
  "updatedAt": "2026-08-19T22:39:32.785Z",
5
- "schemaVersion": 4,
5
+ "schemaVersion": 5,
6
6
  "colorsAndType": {
7
7
  "name": "Ocean",
8
8
  "createdAt": "2026-08-12T20:13:46.322Z",
@@ -2,7 +2,7 @@
2
2
  "name": "Royal Velvet",
3
3
  "createdAt": "2026-08-13T10:21:46.867Z",
4
4
  "updatedAt": "2026-08-19T22:39:32.785Z",
5
- "schemaVersion": 4,
5
+ "schemaVersion": 5,
6
6
  "colorsAndType": {
7
7
  "name": "Royal Velvet",
8
8
  "createdAt": "2026-08-12T20:26:16.137Z",
@@ -2,7 +2,7 @@
2
2
  "name": "Sketchy",
3
3
  "createdAt": "2026-08-25T01:11:16.870Z",
4
4
  "updatedAt": "2026-08-26T10:04:53.000Z",
5
- "schemaVersion": 4,
5
+ "schemaVersion": 5,
6
6
  "colorsAndType": {
7
7
  "name": "Sketchy",
8
8
  "createdAt": "2026-08-25T01:21:09.181Z",
@@ -2,7 +2,7 @@
2
2
  "name": "Spring Meadow",
3
3
  "createdAt": "2026-08-13T10:21:46.867Z",
4
4
  "updatedAt": "2026-08-19T22:39:32.785Z",
5
- "schemaVersion": 4,
5
+ "schemaVersion": 5,
6
6
  "colorsAndType": {
7
7
  "name": "Spring Meadow",
8
8
  "createdAt": "2026-08-12T20:13:46.433Z",
@@ -2,7 +2,7 @@
2
2
  "name": "Sunset",
3
3
  "createdAt": "2026-08-13T10:21:46.867Z",
4
4
  "updatedAt": "2026-08-19T22:39:32.785Z",
5
- "schemaVersion": 4,
5
+ "schemaVersion": 5,
6
6
  "colorsAndType": {
7
7
  "name": "Sunset",
8
8
  "createdAt": "2026-08-12T20:13:46.488Z",
@@ -16,7 +16,7 @@ export const BACKDROP_ATTRIBUTE = 'data-backdrop';
16
16
 
17
17
  /** Relative luminance at or above which a backdrop counts as light. Sits
18
18
  between the palest shipped dark theme (~0.03) and the darkest light one
19
- (~0.6), so no shipped look lands near the line. */
19
+ (~0.6), so no shipped sketchstyle lands near the line. */
20
20
  export const LIGHT_BACKDROP = 0.2;
21
21
 
22
22
  /** A fill this see-through says nothing about what shows through it, so the
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { onMount, tick } from 'svelte';
5
5
 
6
- /** Size variant. Each variant owns everything that defines its look:
6
+ /** Size variant. Each variant owns everything that defines its style:
7
7
  * typography, geometry, colors AND the intrinsic display properties
8
8
  * (alignment, eyebrow visibility, description visibility, hairline
9
9
  * position). Every intrinsic flows through `:root` CSS vars so a designer