@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
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from 'vite';
2
2
  export { ComponentSource, MissingToken, RunResult, TOKENS_CSS_MIGRATIONS, TokensCssMigration, ValidateInput, runTokensCssMigrations, validateTokensCss } from './tokensCssMigrations/index.cjs';
3
- import './dataPaths-DZUzVv8H.cjs';
3
+ import './dataPaths-bJTCEO4H.cjs';
4
4
 
5
5
  interface ThemeFileApiOptions {
6
6
  tokensCssPath: string;
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from 'vite';
2
2
  export { ComponentSource, MissingToken, RunResult, TOKENS_CSS_MIGRATIONS, TokensCssMigration, ValidateInput, runTokensCssMigrations, validateTokensCss } from './tokensCssMigrations/index.js';
3
- import './dataPaths-DZUzVv8H.js';
3
+ import './dataPaths-bJTCEO4H.js';
4
4
 
5
5
  interface ThemeFileApiOptions {
6
6
  tokensCssPath: string;
@@ -13,7 +13,7 @@ import {
13
13
  nextAvailableName,
14
14
  normalizeTheme,
15
15
  versionedFileResourceServer
16
- } from "./chunk-T4PMCFJN.js";
16
+ } from "./chunk-2UX6EVVA.js";
17
17
  import {
18
18
  CURRENT_COMPONENT_SCHEMA_VERSION
19
19
  } from "./chunk-NE6N66EE.js";
@@ -620,7 +620,7 @@ ${lines.join("\n")}
620
620
  }
621
621
  function warnOnLegacyLayout(evidence, warn) {
622
622
  warn(
623
- `[live-tokens] This project still uses the data layout from 0.47 and earlier: ${evidence}. Since 0.48 the whole-look theme files live in \`themes/\` and the colors and type live in \`colors-and-type/\`. Nothing in the data directory was written, the editor cannot save, and ${path.basename(GENERATED_CSS_PATH)} is left exactly as it is. Run \`npx live-tokens migrate\` to move the directories and heal the tree, then restart the dev server.`
623
+ `[live-tokens] This project still uses the data layout from 0.47 and earlier: ${evidence}. Since 0.48 the whole-theme theme files live in \`themes/\` and the colors and type live in \`colors-and-type/\`. Nothing in the data directory was written, the editor cannot save, and ${path.basename(GENERATED_CSS_PATH)} is left exactly as it is. Run \`npx live-tokens migrate\` to move the directories and heal the tree, then restart the dev server.`
624
624
  );
625
625
  }
626
626
  function warnOnUnmigratedSketchStyles(warn) {
@@ -1377,7 +1377,7 @@ ${lines.join("\n")}
1377
1377
  filled
1378
1378
  });
1379
1379
  }
1380
- async function handleAdoptLook({ res }) {
1380
+ async function handleAdoptTheme({ res }) {
1381
1381
  const activeName = themesResource.getActiveName();
1382
1382
  if (activeName === "default") {
1383
1383
  jsonResponse(res, 409, {
@@ -1542,7 +1542,7 @@ ${lines.join("\n")}
1542
1542
  { method: "GET", pattern: THEME_BY_NAME_REGEX, handler: handleThemeByName },
1543
1543
  { method: "PUT", pattern: THEME_BY_NAME_REGEX, handler: handleThemeByName },
1544
1544
  { method: "DELETE", pattern: THEME_BY_NAME_REGEX, handler: handleThemeByName },
1545
- // Production — the whole-look adopt door
1545
+ // Production — the whole-theme adopt door
1546
1546
  { method: "GET", pattern: SKETCH_STYLES_ROUTE, handler: handleListSketchStyles },
1547
1547
  { method: "PUT", pattern: SKETCH_STYLES_ROUTE, handler: methodNotAllowed },
1548
1548
  { method: "POST", pattern: SKETCH_STYLES_ROUTE, handler: methodNotAllowed },
@@ -1551,7 +1551,7 @@ ${lines.join("\n")}
1551
1551
  { method: "PUT", pattern: SKETCH_STYLE_BY_NAME_REGEX, handler: handleSketchStyleByName },
1552
1552
  { method: "DELETE", pattern: SKETCH_STYLE_BY_NAME_REGEX, handler: handleSketchStyleByName },
1553
1553
  { method: "POST", pattern: SKETCH_STYLE_BY_NAME_REGEX, handler: methodNotAllowed },
1554
- { method: "PUT", pattern: PRODUCTION_ROUTE, handler: handleAdoptLook },
1554
+ { method: "PUT", pattern: PRODUCTION_ROUTE, handler: handleAdoptTheme },
1555
1555
  { method: "GET", pattern: PRODUCTION_ROUTE, handler: methodNotAllowed },
1556
1556
  { method: "POST", pattern: PRODUCTION_ROUTE, handler: methodNotAllowed },
1557
1557
  { method: "DELETE", pattern: PRODUCTION_ROUTE, handler: methodNotAllowed }
@@ -1037,7 +1037,7 @@ function synthesizeSectionDividerGradients(stringPart, objectPart) {
1037
1037
  }
1038
1038
 
1039
1039
  // src/editor/core/themes/themeTypes.ts
1040
- var THEME_SCHEMA_VERSION = 4;
1040
+ var THEME_SCHEMA_VERSION = 5;
1041
1041
 
1042
1042
  // src/editor/core/components/componentConfigKeys.ts
1043
1043
  var KNOWN_COMPONENT_CONFIG_KEYS = /* @__PURE__ */ new Set([
@@ -1058,7 +1058,7 @@ var pencil_default = {
1058
1058
  name: "Pencil",
1059
1059
  settings: {
1060
1060
  label: "Pencil",
1061
- 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.",
1061
+ 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.",
1062
1062
  fillTravel: 0.75,
1063
1063
  strokeTravel: 1.25,
1064
1064
  wobble: 30,
@@ -1223,15 +1223,15 @@ var hatched_default = {
1223
1223
  pressureMod: 0.45,
1224
1224
  pooling: 0.8,
1225
1225
  strokeInk: 1,
1226
- maskOn: false,
1227
- maskBlobX: 100,
1228
- maskBlobY: 100,
1229
- maskBlobLinked: true,
1230
- maskAngle: 0,
1231
- maskOutputMin: 0.45,
1226
+ maskOn: true,
1227
+ maskBlobX: 10,
1228
+ maskBlobY: 600,
1229
+ maskBlobLinked: false,
1230
+ maskAngle: 150,
1231
+ maskOutputMin: 0.35,
1232
1232
  maskOutputMax: 1,
1233
1233
  maskOctaves: 2,
1234
- maskGrain: "fractal",
1234
+ maskGrain: "turbulence",
1235
1235
  maskPosterize: 1,
1236
1236
  maskSoftness: 1.5,
1237
1237
  jitterX: 1.5,
@@ -1245,7 +1245,7 @@ var hatched_default = {
1245
1245
  iconMaskOn: false,
1246
1246
  iconMaskScale: 1
1247
1247
  },
1248
- updatedAt: "2026-08-28T15:47:36.934Z",
1248
+ updatedAt: "2026-08-28T21:17:18.232Z",
1249
1249
  createdAt: "2026-08-28T15:47:36.934Z"
1250
1250
  };
1251
1251
 
@@ -1326,16 +1326,16 @@ var napkin_default = {
1326
1326
  maskBlobY: 150,
1327
1327
  maskBlobLinked: true,
1328
1328
  maskAngle: 0,
1329
- maskOutputMin: 0.43,
1330
- maskOutputMax: 0.95,
1329
+ maskOutputMin: 0.62,
1330
+ maskOutputMax: 1,
1331
1331
  maskOctaves: 2,
1332
1332
  maskGrain: "fractal",
1333
1333
  maskPosterize: 2,
1334
- maskSoftness: 10,
1334
+ maskSoftness: 5,
1335
1335
  jitterX: 6,
1336
1336
  jitterY: 6,
1337
1337
  jitterRot: 1.8,
1338
- jitterScale: 0.1,
1338
+ jitterScale: 0.075,
1339
1339
  cornerSpread: 20,
1340
1340
  cornerTravel: 17,
1341
1341
  iconTravel: 2.25,
@@ -1371,11 +1371,11 @@ var dry_default = {
1371
1371
  pooling: 1.5,
1372
1372
  strokeInk: 0.4,
1373
1373
  maskOn: true,
1374
- maskBlobX: 150,
1375
- maskBlobY: 150,
1374
+ maskBlobX: 170,
1375
+ maskBlobY: 170,
1376
1376
  maskBlobLinked: true,
1377
1377
  maskAngle: 0,
1378
- maskOutputMin: 0.24,
1378
+ maskOutputMin: 0.57,
1379
1379
  maskOutputMax: 0.91,
1380
1380
  maskOctaves: 2,
1381
1381
  maskGrain: "fractal",
@@ -1392,18 +1392,18 @@ var dry_default = {
1392
1392
  iconMaskOn: true,
1393
1393
  iconMaskScale: 3.8
1394
1394
  },
1395
- updatedAt: "2026-08-28T15:47:36.934Z",
1395
+ updatedAt: "2026-08-28T21:19:51.383Z",
1396
1396
  createdAt: "2026-08-28T15:47:36.934Z"
1397
1397
  };
1398
1398
 
1399
1399
  // src/editor/core/sketch/sketchStyles.ts
1400
1400
  var SHIPPED_FILES = { pencil: pencil_default, marker: marker_default, whiteboard: whiteboard_default, hatched: hatched_default, dashed: dashed_default, napkin: napkin_default, dry: dry_default };
1401
- var SKETCH_STYLES = Object.fromEntries(
1401
+ var SHIPPED_SKETCH_SETTINGS = Object.fromEntries(
1402
1402
  Object.entries(SHIPPED_FILES).map(([id, file]) => [id, file.settings])
1403
1403
  );
1404
1404
  var DEFAULT_SKETCH_STYLE = "marker";
1405
- function hydrateSketchStyle(raw) {
1406
- const base = SKETCH_STYLES[DEFAULT_SKETCH_STYLE];
1405
+ function hydrateSketchSettings(raw) {
1406
+ const base = SHIPPED_SKETCH_SETTINGS[DEFAULT_SKETCH_STYLE];
1407
1407
  const stored = raw ?? {};
1408
1408
  const out = { ...base };
1409
1409
  for (const key of Object.keys(base)) {
@@ -1567,10 +1567,10 @@ function normalizeTheme(raw, resolvers) {
1567
1567
  }
1568
1568
  const componentConfigs = {};
1569
1569
  for (const [comp, value] of Object.entries(asObject(src.componentConfigs) ?? {})) {
1570
- const embedded = asObject(value);
1570
+ const embedded2 = asObject(value);
1571
1571
  let resolvedConfig;
1572
- if (embedded) {
1573
- resolvedConfig = stripFileMarker(embedded);
1572
+ if (embedded2) {
1573
+ resolvedConfig = stripFileMarker(embedded2);
1574
1574
  } else {
1575
1575
  const configName = asString(value, "default");
1576
1576
  const resolved = asObject(resolvers.readComponentConfig(comp, configName));
@@ -1605,8 +1605,8 @@ function normalizeTheme(raw, resolvers) {
1605
1605
  if (!(key in baseAliases)) filled.orphans++;
1606
1606
  }
1607
1607
  }
1608
- const embeddedSketchStyle = asObject(src.sketchStyle);
1609
- const sketchStyle = embeddedSketchStyle ? hydrateSketchStyle(embeddedSketchStyle) : void 0;
1608
+ const embedded = asObject(src.sketchSettings) ?? asObject(src.sketchStyle);
1609
+ const sketchSettings = embedded ? hydrateSketchSettings(embedded) : void 0;
1610
1610
  return {
1611
1611
  theme: {
1612
1612
  name: asString(src.name, "Untitled"),
@@ -1616,7 +1616,7 @@ function normalizeTheme(raw, resolvers) {
1616
1616
  colorsAndType,
1617
1617
  componentConfigs,
1618
1618
  componentSchemaVersion: CURRENT_COMPONENT_SCHEMA_VERSION,
1619
- ...sketchStyle ? { sketchStyle } : {}
1619
+ ...sketchSettings ? { sketchSettings } : {}
1620
1620
  },
1621
1621
  dropped,
1622
1622
  migrated,
@@ -1671,7 +1671,7 @@ function detectLegacyLayout(input) {
1671
1671
  const manifestsDir = input.configuredManifestsDir ?? import_path2.default.join(input.dataDir, "manifests");
1672
1672
  const themesHoldAThemeFile = holdsATheme(input.themesDir);
1673
1673
  if (isDirectory(manifestsDir) && !themesHoldAThemeFile) {
1674
- return { manifestsDir, evidence: `${manifestsDir} is the pre-0.48 whole-look directory` };
1674
+ return { manifestsDir, evidence: `${manifestsDir} is the pre-0.48 whole-theme directory` };
1675
1675
  }
1676
1676
  if (jsonFiles(input.colorsAndTypeDir).length > 0) return null;
1677
1677
  for (const file of jsonFiles(input.themesDir)) {
@@ -1694,12 +1694,12 @@ function planLegacyRenames(layout, input) {
1694
1694
  const defaultThemes = import_path2.default.join(input.dataDir, "themes");
1695
1695
  if (input.configuredManifestsDir && import_path2.default.resolve(input.configuredManifestsDir) !== import_path2.default.join(input.dataDir, "manifests")) {
1696
1696
  throw new Error(
1697
- `This project uses the pre-0.48 data layout (${layout.evidence}), and live-tokens.config.json sets the retired "manifestsDir" key to ${input.configuredManifestsDir}. That directory holds the whole looks, which now belong in ${input.themesDir}. Move it there by hand, drop the "manifestsDir" key, then run the migration again.`
1697
+ `This project uses the pre-0.48 data layout (${layout.evidence}), and live-tokens.config.json sets the retired "manifestsDir" key to ${input.configuredManifestsDir}. That directory holds the whole themes, which now belong in ${input.themesDir}. Move it there by hand, drop the "manifestsDir" key, then run the migration again.`
1698
1698
  );
1699
1699
  }
1700
1700
  if (import_path2.default.resolve(input.colorsAndTypeDir) !== import_path2.default.resolve(defaultColorsAndType) || import_path2.default.resolve(input.themesDir) !== import_path2.default.resolve(defaultThemes)) {
1701
1701
  throw new Error(
1702
- `This project uses the pre-0.48 data layout (${layout.evidence}), and its data directories are configured to custom paths (colorsAndTypeDir=${input.colorsAndTypeDir}, themesDir=${input.themesDir}). The migration cannot tell which directory holds what. Move the old colors-and-type directory to ${input.colorsAndTypeDir} and the old whole-look directory to ${input.themesDir} by hand, then run the migration again.`
1702
+ `This project uses the pre-0.48 data layout (${layout.evidence}), and its data directories are configured to custom paths (colorsAndTypeDir=${input.colorsAndTypeDir}, themesDir=${input.themesDir}). The migration cannot tell which directory holds what. Move the old colors-and-type directory to ${input.colorsAndTypeDir} and the old whole-theme directory to ${input.themesDir} by hand, then run the migration again.`
1703
1703
  );
1704
1704
  }
1705
1705
  const renames = [];
@@ -1,4 +1,4 @@
1
- export { r as readLiveTokensConfig, a as resolveDataDirs } from '../dataPaths-DZUzVv8H.cjs';
1
+ export { r as readLiveTokensConfig, a as resolveDataDirs } from '../dataPaths-bJTCEO4H.cjs';
2
2
 
3
3
  interface LegacyRename {
4
4
  from: string;
@@ -1,4 +1,4 @@
1
- export { r as readLiveTokensConfig, a as resolveDataDirs } from '../dataPaths-DZUzVv8H.js';
1
+ export { r as readLiveTokensConfig, a as resolveDataDirs } from '../dataPaths-bJTCEO4H.js';
2
2
 
3
3
  interface LegacyRename {
4
4
  from: string;
@@ -7,7 +7,7 @@ import {
7
7
  normalizeTheme,
8
8
  planLegacyRenames,
9
9
  versionedFileResourceServer
10
- } from "../chunk-T4PMCFJN.js";
10
+ } from "../chunk-2UX6EVVA.js";
11
11
  import {
12
12
  CURRENT_COMPONENT_SCHEMA_VERSION
13
13
  } from "../chunk-NE6N66EE.js";
@@ -1,4 +1,4 @@
1
- export { r as readLiveTokensConfig } from '../dataPaths-DZUzVv8H.cjs';
1
+ export { r as readLiveTokensConfig } from '../dataPaths-bJTCEO4H.cjs';
2
2
 
3
3
  /**
4
4
  * A `tokens-css` migration: a pure, idempotent transform on the text of a
@@ -1,4 +1,4 @@
1
- export { r as readLiveTokensConfig } from '../dataPaths-DZUzVv8H.js';
1
+ export { r as readLiveTokensConfig } from '../dataPaths-bJTCEO4H.js';
2
2
 
3
3
  /**
4
4
  * A `tokens-css` migration: a pure, idempotent transform on the text of a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motion-proto/live-tokens",
3
- "version": "0.67.0",
3
+ "version": "0.68.1",
4
4
  "type": "module",
5
5
  "description": "Design token editor with live CSS variable editing. Svelte 5 + Vite 8.",
6
6
  "keywords": [
@@ -123,9 +123,9 @@
123
123
  "./app/fonts.css": "./src/system/styles/fonts.css"
124
124
  },
125
125
  "scripts": {
126
- "dev": "vite",
127
- "build": "vite build",
128
- "preview": "vite preview",
126
+ "dev": "VITE_CONFIG_NATIVE_IGNORE_WARNING=true vite",
127
+ "build": "VITE_CONFIG_NATIVE_IGNORE_WARNING=true vite build",
128
+ "preview": "VITE_CONFIG_NATIVE_IGNORE_WARNING=true vite preview",
129
129
  "check": "svelte-check --tsconfig ./tsconfig.json",
130
130
  "test": "vitest run",
131
131
  "test:watch": "vitest",
@@ -22,16 +22,16 @@ import * as editorStore from './core/store/editorStore';
22
22
  import * as themeDocumentSync from './core/themes/themeDocumentSync';
23
23
  import { initializeTheme } from './core/themes/themeInit';
24
24
  import { registerComponent, type RegisterComponentEntry } from './component-editor/registry';
25
- import { registerSketchLook, type RegisterSketchLookInput } from './core/sketch/sketchRegistry';
25
+ import { registerSketchStyle, type RegisterSketchStyleInput } from './core/sketch/sketchRegistry';
26
26
 
27
27
  export interface BootLiveTokensOptions {
28
28
  /** Consumer-authored components to register with the editor before mount. Dev-only. */
29
29
  components?: RegisterComponentEntry[];
30
- /** Sketchstyles this project ships, joining the shipped looks in every
30
+ /** Sketchstyles this project ships, joining the shipped sketchstyles in every
31
31
  picker. Registered in a build as well as in dev: carrying a customized
32
32
  sketchstyle to a published site is the whole point, so these must not sit
33
33
  behind the DEV guard `components` sits behind. */
34
- sketchLooks?: RegisterSketchLookInput[];
34
+ sketchStyles?: RegisterSketchStyleInput[];
35
35
  }
36
36
 
37
37
  export async function bootLiveTokens(
@@ -44,10 +44,10 @@ export async function bootLiveTokens(
44
44
  columnsOverlay.init();
45
45
  editorStore.init();
46
46
 
47
- // Before the DEV block: `initializeTheme` recovers the open theme's look by
47
+ // Before the DEV block: `initializeTheme` recovers the open theme's style by
48
48
  // name against the pool, so the pool has to be whole by the time it runs.
49
- if (opts.sketchLooks) {
50
- for (const look of opts.sketchLooks) registerSketchLook(look);
49
+ if (opts.sketchStyles) {
50
+ for (const style of opts.sketchStyles) registerSketchStyle(style);
51
51
  }
52
52
 
53
53
  if (import.meta.env.DEV) {
@@ -4,7 +4,7 @@
4
4
  export const component = 'imagelightbox';
5
5
 
6
6
  // Three parts: tile (closed inline + animated modal surface), overlay (scrim),
7
- // chrome (shared toolbar + close-button look). Chrome carries a hover state
7
+ // chrome (shared toolbar + close-button styling). Chrome carries a hover state
8
8
  // for the interactive controls. No second variant.
9
9
  const states: Record<string, Token[]> = {
10
10
  tile: [
@@ -29,7 +29,7 @@
29
29
  productionTheme,
30
30
  } from '../../core/productionPulse';
31
31
  import {
32
- adoptLook,
32
+ adoptTheme,
33
33
  getActiveTheme,
34
34
  getProductionTheme,
35
35
  listThemes,
@@ -239,7 +239,7 @@
239
239
  }
240
240
 
241
241
  /**
242
- * Adopt ships the whole look, because production is one saved theme: flush
242
+ * Adopt ships the whole theme, because production is one saved theme: flush
243
243
  * this component, save the open theme, publish it. The protected Default
244
244
  * theme cannot record what shipped, so it prompts for a theme name first and
245
245
  * retries.
@@ -261,7 +261,7 @@
261
261
  try {
262
262
  if (wasDirty) await persist();
263
263
  await saveActiveTheme();
264
- await adoptLook();
264
+ await adoptTheme();
265
265
  await refreshProduction();
266
266
  bumpProductionRevision();
267
267
  adoptFeedback = wasDirty
@@ -401,7 +401,7 @@
401
401
  </UISquareButton>
402
402
  <UIInfoPopover title="Component Configuration" ariaLabel="About Save and Adopt">
403
403
  <p>
404
- <strong>Save</strong> keeps your edits in the theme you have open. The theme carries a copy of every component you changed, so the look travels as one file.
404
+ <strong>Save</strong> keeps your edits in the theme you have open. The theme carries a copy of every component you changed, so the theme travels as one file.
405
405
  </p>
406
406
  <p>
407
407
  <strong>Save As</strong> writes the component's settings to a file of their own, ready to load into any theme.
@@ -131,10 +131,10 @@ export function resolveFontStackValues(
131
131
  * in an iframe) via the same pipeline used for color variables.
132
132
  *
133
133
  * Returns the variables it set, so a caller tracking what it has applied — to
134
- * tear those vars down when switching looks — can record them without keeping
134
+ * tear those vars down when switching themes — can record them without keeping
135
135
  * its own copy of the stack list. A hand-maintained copy silently falls behind
136
136
  * whenever a stack is added here, leaving the missed variable stuck at the
137
- * outgoing look's value; `--font-editorial` did exactly that.
137
+ * outgoing theme's value; `--font-editorial` did exactly that.
138
138
  */
139
139
  export function applyFontStacks(
140
140
  stacks: FontStack[],
@@ -9,11 +9,11 @@ import { loadTheme } from '../themes/themeService';
9
9
  import { previewSketchStyle, revertSketchStylePreview } from '../sketch/sketchStore';
10
10
 
11
11
  /**
12
- * Client-side rendering of a saved file, for browsing looks without committing
13
- * one. A theme previews as a whole look; a colors-and-type file previews as
12
+ * Client-side rendering of a saved file, for browsing themes without committing
13
+ * one. A theme previews as a whole next; a colors-and-type file previews as
14
14
  * colors and type over the components the user has right now. Nothing here writes to the server,
15
15
  * mutates the editor store, or marks anything dirty: a preview is paint only.
16
- * Save-As stays honest because `captureLook` reads the server's active files,
16
+ * Save-As stays honest because `captureThemeContent` reads the server's active files,
17
17
  * which a preview never touches.
18
18
  *
19
19
  * Both painting and reverting run the same derivation the renderer runs on
@@ -27,23 +27,23 @@ import { previewSketchStyle, revertSketchStylePreview } from '../sketch/sketchSt
27
27
  * CSS vars do.
28
28
  *
29
29
  * One preview is live at a time, whichever kind it is: painting reverts first,
30
- * so every look is a diff against the user's real state.
30
+ * so every next is a diff against the user's real state.
31
31
  */
32
32
 
33
- /** Everything a look puts on the page: the full var set (colors and type,
33
+ /** Everything a next puts on the page: the full var set (colors and type,
34
34
  * components and the composed `--font-*` stacks) plus the sources its faces
35
35
  * come from. */
36
- export interface RenderedLook {
36
+ export interface RenderedTheme {
37
37
  vars: Record<string, string>;
38
38
  fontSources: FontSource[];
39
39
  }
40
40
 
41
41
  /**
42
42
  * The full var set a theme paints. Components the theme carries no config
43
- * for render `defaults`' config, matching Apply's complete-look semantics;
43
+ * for render `defaults`' config, matching Apply's complete-next semantics;
44
44
  * configs for components this install lacks are skipped, as Apply skips them.
45
45
  */
46
- export function themeLook(theme: Theme, defaults: Theme): RenderedLook {
46
+ export function renderTheme(theme: Theme, defaults: Theme): RenderedTheme {
47
47
  const colorsAndType = structuredClone(theme.colorsAndType);
48
48
  migrateColorsAndTypeFonts(colorsAndType);
49
49
  const state = colorsAndTypeToState(colorsAndType);
@@ -60,27 +60,27 @@ export function themeLook(theme: Theme, defaults: Theme): RenderedLook {
60
60
  }
61
61
 
62
62
  /**
63
- * The full var set colors and type paint on their own. They are not a whole look,
63
+ * The full var set colors and type paint on their own. They are not a whole next,
64
64
  * so the components stay as the user has them: `colorsAndTypeToState` carries the live
65
65
  * component slice forward (`loadComponentsFromVars`) and strips component-owned
66
66
  * vars out of their own bag, which is exactly the composition a preview
67
67
  * wants. No defaults fetch, no component reset.
68
68
  */
69
- export function colorsAndTypeLook(colorsAndType: ColorsAndType): RenderedLook {
69
+ export function renderColorsAndType(colorsAndType: ColorsAndType): RenderedTheme {
70
70
  const next = structuredClone(colorsAndType);
71
71
  migrateColorsAndTypeFonts(next);
72
72
  const vars = deriveCssVars(colorsAndTypeToState(next));
73
73
  return { vars, fontSources: next.fontSources ?? [] };
74
74
  }
75
75
 
76
- /** The look the editor store currently describes — the state a revert returns to. */
77
- export function liveLook(): RenderedLook {
76
+ /** The next the editor store currently describes — the state a revert returns to. */
77
+ export function liveTheme(): RenderedTheme {
78
78
  const state = get(editorState);
79
79
  const vars = deriveCssVars(state);
80
80
  return { vars, fontSources: state.fonts.sources };
81
81
  }
82
82
 
83
- let livePreview: RenderedLook | null = null;
83
+ let livePreview: RenderedTheme | null = null;
84
84
  let defaultsPromise: Promise<Theme> | null = null;
85
85
  // Whether the current preview session has a sketchstyle painted over the live
86
86
  // buffer, so a colors-only preview (which never previews sketch) and revert
@@ -101,7 +101,7 @@ function loadDefaults(): Promise<Theme> {
101
101
  return defaultsPromise;
102
102
  }
103
103
 
104
- function paint(next: RenderedLook, from: RenderedLook): void {
104
+ function paint(next: RenderedTheme, from: RenderedTheme): void {
105
105
  batchCssVarChanges(() => {
106
106
  for (const [name, value] of Object.entries(next.vars)) {
107
107
  if (from.vars[name] !== value) setCssVar(name, value);
@@ -114,33 +114,33 @@ function paint(next: RenderedLook, from: RenderedLook): void {
114
114
  }
115
115
 
116
116
  /**
117
- * Show `look` on the page. Re-entrant previews diff directly from the look
117
+ * Show `next` on the page. Re-entrant previews diff directly from the next
118
118
  * already painted; only Cancel restores the live store projection. This avoids
119
119
  * repainting the live theme as an invisible intermediate on every picker row.
120
120
  */
121
- function applyPreview(look: RenderedLook): void {
122
- paint(look, livePreview ?? liveLook());
123
- livePreview = look;
121
+ function applyPreview(next: RenderedTheme): void {
122
+ paint(next, livePreview ?? liveTheme());
123
+ livePreview = next;
124
124
  }
125
125
 
126
- /** Paint a whole look: the theme's colors and type, every component config
126
+ /** Paint a whole next: the theme's colors and type, every component config
127
127
  * it carries, and its sketchstyle — present or not, since a theme with none
128
128
  * paints crisp regardless of what is live (invariant 3). */
129
129
  export async function previewTheme(theme: Theme): Promise<void> {
130
130
  const gen = generation;
131
131
  const defaults = await loadDefaults();
132
132
  if (gen !== generation) return;
133
- applyPreview(themeLook(theme, defaults));
134
- previewSketchStyle(theme.sketchStyle);
133
+ applyPreview(renderTheme(theme, defaults));
134
+ previewSketchStyle(theme.sketchSettings);
135
135
  sketchPreviewActive = true;
136
136
  }
137
137
 
138
138
  /** Paint colors and type over the components as they stand. Not a whole
139
- * look, so the sketchstyle stays live too — reverting a sketch preview a
139
+ * next, so the sketchstyle stays live too — reverting a sketch preview a
140
140
  * prior row left painted, if one is running. */
141
141
  export function previewColorsAndType(colorsAndType: ColorsAndType): void {
142
142
  generation++;
143
- applyPreview(colorsAndTypeLook(colorsAndType));
143
+ applyPreview(renderColorsAndType(colorsAndType));
144
144
  if (sketchPreviewActive) {
145
145
  revertSketchStylePreview();
146
146
  sketchPreviewActive = false;
@@ -151,7 +151,7 @@ export function previewColorsAndType(colorsAndType: ColorsAndType): void {
151
151
  export function revertPreview(): void {
152
152
  generation++;
153
153
  if (!livePreview) return;
154
- paint(liveLook(), livePreview);
154
+ paint(liveTheme(), livePreview);
155
155
  livePreview = null;
156
156
  if (sketchPreviewActive) {
157
157
  revertSketchStylePreview();
@@ -160,11 +160,11 @@ export function revertPreview(): void {
160
160
  }
161
161
 
162
162
  /** Release the preview without repainting. The caller must immediately load
163
- * the exact look being previewed into the store. This is the Save handoff: the
164
- * selected theme is already on screen, so restoring the old live look before
163
+ * the exact next being previewed into the store. This is the Save handoff: the
164
+ * selected theme is already on screen, so restoring the old live next before
165
165
  * applying it would add work and create a visible flash across the request.
166
166
  * The sketchstyle stays painted for the same reason, though the handoff is not
167
- * quite free: when the live state was crisp, `openThemeSketchStyle` writes the
167
+ * quite free: when the live state was crisp, `openThemeSketchSettings` writes the
168
168
  * settings before the flag, so the sheet and the filter bank come down and go
169
169
  * straight back up in between. That order is still the right one, since writing
170
170
  * the flag first would paint the OLD dials for a frame. */
@@ -28,17 +28,17 @@ export function bumpComponentActiveRevision(): void {
28
28
  }
29
29
 
30
30
  /**
31
- * The live look has moved past the last bake. Only Adopt bakes the CSS, so a
31
+ * The live theme has moved past the last bake. Only Adopt bakes the CSS, so a
32
32
  * buffer write or a theme save after one leaves production a version behind,
33
33
  * and no pointer file records when the bake happened. Every surface reads the
34
34
  * one signal: a component save has to reach the theme panel's Adopt, and a
35
35
  * component editor's Adopt has to clear it for the panel.
36
36
  *
37
- * Set by the client writes that move the live look (`writeWorkingColorsAndType`,
37
+ * Set by the client writes that move the live theme (`writeWorkingColorsAndType`,
38
38
  * `writeWorkingComponentConfig`, `saveActiveTheme`, `saveAsTheme`, and every
39
39
  * sketch gesture that changes what the effect paints: `setSketchEnabled`,
40
40
  * `updateSketchSettings`, `selectSketchStyle`);
41
- * cleared by `adoptLook` and by `hydrateAppliedTheme`, on this document and on
41
+ * cleared by `adoptTheme` and by `hydrateAppliedTheme`, on this document and on
42
42
  * every peer an Apply broadcasts to. Module-level, so it survives the
43
43
  * remounts a view switch causes.
44
44
  */