@motion-proto/live-tokens 0.47.1 → 0.48.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/.claude/skills/live-tokens-adjust-shape-space/SKILL.md +68 -0
- package/.claude/skills/live-tokens-create-component/SKILL.md +2 -2
- package/.claude/skills/live-tokens-generate-theme/SKILL.md +152 -0
- package/CHANGELOG.md +270 -0
- package/README.md +37 -26
- package/bin/adjust.mjs +254 -0
- package/bin/cli.mjs +94 -7
- package/bin/generate-theme.mjs +251 -0
- package/bin/migrate.mjs +95 -6
- package/dist-plugin/adjust/index.cjs +259 -0
- package/dist-plugin/adjust/index.d.cts +45 -0
- package/dist-plugin/adjust/index.d.ts +45 -0
- package/dist-plugin/adjust/index.js +176 -0
- package/dist-plugin/{chunk-H4TRUINI.js → chunk-44RSTAII.js} +0 -48
- package/dist-plugin/chunk-6OZFXIQI.js +316 -0
- package/dist-plugin/chunk-76TFDTJO.js +556 -0
- package/dist-plugin/chunk-D3ZVKOR4.js +52 -0
- package/dist-plugin/dataPaths-DBN0RPuT.d.cts +54 -0
- package/dist-plugin/dataPaths-DBN0RPuT.d.ts +54 -0
- package/dist-plugin/generateColorsAndType/index.cjs +1781 -0
- package/dist-plugin/generateColorsAndType/index.d.cts +81 -0
- package/dist-plugin/generateColorsAndType/index.d.ts +81 -0
- package/dist-plugin/generateColorsAndType/index.js +1210 -0
- package/dist-plugin/index.cjs +849 -531
- package/dist-plugin/index.d.cts +3 -2
- package/dist-plugin/index.d.ts +3 -2
- package/dist-plugin/index.js +658 -1132
- package/dist-plugin/migrateData/index.cjs +728 -0
- package/dist-plugin/migrateData/index.d.cts +60 -0
- package/dist-plugin/migrateData/index.d.ts +60 -0
- package/dist-plugin/migrateData/index.js +348 -0
- package/dist-plugin/themeTypes-DMHZOnUn.d.cts +211 -0
- package/dist-plugin/themeTypes-DMHZOnUn.d.ts +211 -0
- package/dist-plugin/tokensCssMigrations/index.cjs +2 -1
- package/dist-plugin/tokensCssMigrations/index.d.cts +3 -15
- package/dist-plugin/tokensCssMigrations/index.d.ts +3 -15
- package/dist-plugin/tokensCssMigrations/index.js +4 -2
- package/package.json +18 -4
- package/src/editor/component-editor/scaffolding/ComponentFileManager.svelte +183 -158
- package/src/editor/component-editor/scaffolding/ComponentFileMenu.svelte +0 -4
- package/src/editor/component-editor/scaffolding/SaveAsDialog.svelte +4 -4
- package/src/editor/component-editor/scaffolding/TokenLayout.svelte +2 -59
- package/src/editor/component-editor/scaffolding/VariantGroup.svelte +1 -1
- package/src/editor/core/components/adjustAliases.ts +180 -0
- package/src/editor/core/components/aliasKinds.ts +73 -0
- package/src/editor/core/components/componentConfigService.ts +26 -38
- package/src/editor/core/flashStatus.ts +1 -1
- package/src/editor/core/fonts/fontMigration.ts +13 -13
- package/src/editor/core/fonts/fontPairing.ts +35 -0
- package/src/editor/core/palettes/paletteDerivation.ts +83 -13
- package/src/editor/core/preview/lookPreview.ts +141 -0
- package/src/editor/core/productionPulse.ts +34 -21
- package/src/editor/core/storage/files/versionedFileResourceClient.ts +18 -45
- package/src/editor/core/store/editorConfigStore.ts +2 -2
- package/src/editor/core/store/editorPersistence.ts +0 -1
- package/src/editor/core/store/editorStore.ts +114 -51
- package/src/editor/core/store/editorTypes.ts +0 -1
- package/src/editor/core/store/gradientSource.ts +2 -2
- package/src/editor/core/themes/colorsAndTypeService.ts +95 -0
- package/src/editor/core/themes/generateColorsAndType.ts +433 -0
- package/src/editor/core/themes/loadRows.ts +64 -0
- package/src/editor/core/themes/lookSummary.ts +75 -0
- package/src/editor/core/themes/migrations/2026-04-24-legacy-keys-and-bg-to-canvas.ts +3 -3
- package/src/editor/core/themes/migrations/2026-05-13-primary-to-brand.ts +2 -2
- package/src/editor/core/themes/migrations/2026-05-26-drop-overlay-extra-stops.ts +3 -3
- package/src/editor/core/themes/migrations/2026-08-13-drop-legacy-shape-space-keys.ts +38 -0
- package/src/editor/core/themes/migrations/2026-08-15-line-height-scale-rename.ts +57 -0
- package/src/editor/core/themes/migrations/index.ts +19 -11
- package/src/editor/core/themes/slices/components.ts +4 -4
- package/src/editor/core/themes/slices/fonts.ts +1 -1
- package/src/editor/core/themes/slices/gradients.ts +22 -0
- package/src/editor/core/themes/slices/palettes.ts +2 -2
- package/src/editor/core/themes/themeInit.ts +21 -29
- package/src/editor/core/themes/themeService.ts +218 -78
- package/src/editor/core/themes/themeTypes.ts +94 -51
- package/src/editor/docs/Docs.svelte +1 -0
- package/src/editor/docs/chapters.ts +1 -0
- package/src/editor/docs/content/01-overview.md +1 -1
- package/src/editor/docs/content/editing-tokens.md +6 -6
- package/src/editor/docs/content/getting-started.md +9 -7
- package/src/editor/docs/content/themes-workflow.md +74 -34
- package/src/editor/docs/content/where-themes-live.md +61 -0
- package/src/editor/docs/content.generated.ts +5 -4
- package/src/editor/index.ts +27 -27
- package/src/editor/pages/ComponentEditorPage.svelte +2 -2
- package/src/editor/pages/EditorShell.svelte +4 -30
- package/src/editor/ui/FileLoadList.svelte +67 -7
- package/src/editor/ui/GradientEditor.svelte +3 -3
- package/src/editor/ui/ThemePanel.svelte +1067 -0
- package/src/editor/ui/UIDialog.svelte +11 -9
- package/src/editor/ui/index.ts +4 -2
- package/src/live-tokens/data/colors-and-type/autumn.json +2490 -0
- package/src/live-tokens/data/{themes → colors-and-type}/default.json +962 -549
- package/src/live-tokens/data/colors-and-type/halloween.json +2529 -0
- package/src/live-tokens/data/colors-and-type/midnight-study.json +2536 -0
- package/src/live-tokens/data/colors-and-type/ocean.json +2489 -0
- package/src/live-tokens/data/colors-and-type/royal-velvet.json +2520 -0
- package/src/live-tokens/data/colors-and-type/spring-meadow.json +2476 -0
- package/src/live-tokens/data/colors-and-type/sunset.json +2528 -0
- package/src/live-tokens/data/themes/autumn.json +3918 -0
- package/src/live-tokens/data/themes/halloween.json +3992 -0
- package/src/live-tokens/data/themes/midnight-study.json +3932 -0
- package/src/live-tokens/data/themes/ocean.json +3917 -0
- package/src/live-tokens/data/themes/royal-velvet.json +3983 -0
- package/src/live-tokens/data/themes/spring-meadow.json +3904 -0
- package/src/live-tokens/data/themes/sunset.json +3931 -0
- package/src/live-tokens/data/tokens.generated.css +129 -140
- package/src/system/styles/CONVENTIONS.md +1 -1
- package/src/system/styles/fonts.css +1 -1
- package/template/README.md +7 -5
- package/template/_gitignore +0 -6
- package/src/editor/core/components/componentPersist.ts +0 -62
- package/src/editor/core/manifests/manifestService.ts +0 -172
- package/src/editor/ui/ManifestFileManager.svelte +0 -446
- package/src/editor/ui/ThemeFileManager.svelte +0 -785
- package/src/live-tokens/data/manifests/default.json +0 -35
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { F as FontSource, b as FontStack, G as GradientDiskToken, O as Oklch, H as HarmonyMode, C as ColorsAndType } from '../themeTypes-DMHZOnUn.cjs';
|
|
2
|
+
export { r as readLiveTokensConfig, a as resolveDataDirs } from '../dataPaths-DBN0RPuT.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Pure palette → CSS-variable derivation.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the logic that previously lived only inside `PaletteEditor.svelte`'s
|
|
8
|
+
* reactive emission, but as standalone functions so the editor store can emit
|
|
9
|
+
* palette-derived vars at boot without requiring any editor component to be
|
|
10
|
+
* mounted. Without this module the disabled-state preview (and any other
|
|
11
|
+
* `var(--surface-neutral)` consumer) reads a stale value on reload until the
|
|
12
|
+
* user opens the LiveEditorOverlay and mounts the PaletteEditors.
|
|
13
|
+
*
|
|
14
|
+
* The PaletteEditor still owns *editing* preview (draft hex picked but not
|
|
15
|
+
* yet committed to overrides). Once committed via the store, this module
|
|
16
|
+
* derives the same CSS vars from the persisted config.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
type SchemeDirection = 'light' | 'dark';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Brief → generator: a full ColorsAndType from 10 OKLCH seeds + a scheme, with
|
|
23
|
+
* AA floors enforced on derived text tokens. Seed *selection* lives in the
|
|
24
|
+
* live-tokens-generate-theme skill; the CLI reaches this via
|
|
25
|
+
* `dist-plugin/generateColorsAndType`, so keep this module Node-safe (no DOM).
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
interface ColorsAndTypeBrief {
|
|
29
|
+
name: string;
|
|
30
|
+
scheme: SchemeDirection;
|
|
31
|
+
/** One seed per palette label (all 10 required); hex string or numeric OKLCH. */
|
|
32
|
+
seeds: Record<string, Oklch | string>;
|
|
33
|
+
/** Advisory record of the harmony reasoning; seeds stay ground truth. */
|
|
34
|
+
harmony?: {
|
|
35
|
+
mode: HarmonyMode;
|
|
36
|
+
};
|
|
37
|
+
/** Page-background sky. Off by default; the skill turns it on only when the
|
|
38
|
+
* mood brief evokes atmosphere. The engine derives the stops itself, on the
|
|
39
|
+
* scheme's safe side of the Canvas anchor. */
|
|
40
|
+
canvasGradient?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Non-color content carried forward from the currently active colors and type
|
|
43
|
+
* so gradients, shadows, component aliases, and fonts survive regeneration. */
|
|
44
|
+
interface CarryForward {
|
|
45
|
+
cssVariables?: Record<string, string>;
|
|
46
|
+
fontSources?: FontSource[];
|
|
47
|
+
fontStacks?: FontStack[];
|
|
48
|
+
gradients?: GradientDiskToken[];
|
|
49
|
+
}
|
|
50
|
+
interface ContrastCheck {
|
|
51
|
+
textVar: string;
|
|
52
|
+
floor: number;
|
|
53
|
+
/** Worst (lowest-ratio) surface this text was checked against. */
|
|
54
|
+
against: string;
|
|
55
|
+
ratio: number;
|
|
56
|
+
pass: boolean;
|
|
57
|
+
corrected: boolean;
|
|
58
|
+
}
|
|
59
|
+
interface GenerateColorsAndTypeReport {
|
|
60
|
+
scheme: SchemeDirection;
|
|
61
|
+
checks: ContrastCheck[];
|
|
62
|
+
failures: string[];
|
|
63
|
+
/** 'recipes' when the engine replaced absent/stock swatch gradients with the
|
|
64
|
+
* family-relative recipes; 'carried' when user-tuned ones rode through. */
|
|
65
|
+
gradients: 'recipes' | 'carried';
|
|
66
|
+
/** Present when the brief opted into the page-background sky: either
|
|
67
|
+
* 'on, <sky> → <anchor>' or a 'skipped — …' explanation when the Canvas
|
|
68
|
+
* anchors at the ramp edge and leaves no room. */
|
|
69
|
+
canvasGradient?: string;
|
|
70
|
+
}
|
|
71
|
+
interface GenerateColorsAndTypeResult {
|
|
72
|
+
colorsAndType: ColorsAndType;
|
|
73
|
+
slug: string;
|
|
74
|
+
report: GenerateColorsAndTypeReport;
|
|
75
|
+
}
|
|
76
|
+
declare function buildColorsAndTypeFromSeeds(brief: ColorsAndTypeBrief, carry?: CarryForward, now?: string): GenerateColorsAndTypeResult;
|
|
77
|
+
|
|
78
|
+
/** Sanitize a display name to a safe file name. Pure — no DOM, no fs. */
|
|
79
|
+
declare function sanitizeFileName(name: string): string;
|
|
80
|
+
|
|
81
|
+
export { type CarryForward, type ColorsAndTypeBrief, type ContrastCheck, type GenerateColorsAndTypeReport, type GenerateColorsAndTypeResult, buildColorsAndTypeFromSeeds, sanitizeFileName };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { F as FontSource, b as FontStack, G as GradientDiskToken, O as Oklch, H as HarmonyMode, C as ColorsAndType } from '../themeTypes-DMHZOnUn.js';
|
|
2
|
+
export { r as readLiveTokensConfig, a as resolveDataDirs } from '../dataPaths-DBN0RPuT.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Pure palette → CSS-variable derivation.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the logic that previously lived only inside `PaletteEditor.svelte`'s
|
|
8
|
+
* reactive emission, but as standalone functions so the editor store can emit
|
|
9
|
+
* palette-derived vars at boot without requiring any editor component to be
|
|
10
|
+
* mounted. Without this module the disabled-state preview (and any other
|
|
11
|
+
* `var(--surface-neutral)` consumer) reads a stale value on reload until the
|
|
12
|
+
* user opens the LiveEditorOverlay and mounts the PaletteEditors.
|
|
13
|
+
*
|
|
14
|
+
* The PaletteEditor still owns *editing* preview (draft hex picked but not
|
|
15
|
+
* yet committed to overrides). Once committed via the store, this module
|
|
16
|
+
* derives the same CSS vars from the persisted config.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
type SchemeDirection = 'light' | 'dark';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Brief → generator: a full ColorsAndType from 10 OKLCH seeds + a scheme, with
|
|
23
|
+
* AA floors enforced on derived text tokens. Seed *selection* lives in the
|
|
24
|
+
* live-tokens-generate-theme skill; the CLI reaches this via
|
|
25
|
+
* `dist-plugin/generateColorsAndType`, so keep this module Node-safe (no DOM).
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
interface ColorsAndTypeBrief {
|
|
29
|
+
name: string;
|
|
30
|
+
scheme: SchemeDirection;
|
|
31
|
+
/** One seed per palette label (all 10 required); hex string or numeric OKLCH. */
|
|
32
|
+
seeds: Record<string, Oklch | string>;
|
|
33
|
+
/** Advisory record of the harmony reasoning; seeds stay ground truth. */
|
|
34
|
+
harmony?: {
|
|
35
|
+
mode: HarmonyMode;
|
|
36
|
+
};
|
|
37
|
+
/** Page-background sky. Off by default; the skill turns it on only when the
|
|
38
|
+
* mood brief evokes atmosphere. The engine derives the stops itself, on the
|
|
39
|
+
* scheme's safe side of the Canvas anchor. */
|
|
40
|
+
canvasGradient?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Non-color content carried forward from the currently active colors and type
|
|
43
|
+
* so gradients, shadows, component aliases, and fonts survive regeneration. */
|
|
44
|
+
interface CarryForward {
|
|
45
|
+
cssVariables?: Record<string, string>;
|
|
46
|
+
fontSources?: FontSource[];
|
|
47
|
+
fontStacks?: FontStack[];
|
|
48
|
+
gradients?: GradientDiskToken[];
|
|
49
|
+
}
|
|
50
|
+
interface ContrastCheck {
|
|
51
|
+
textVar: string;
|
|
52
|
+
floor: number;
|
|
53
|
+
/** Worst (lowest-ratio) surface this text was checked against. */
|
|
54
|
+
against: string;
|
|
55
|
+
ratio: number;
|
|
56
|
+
pass: boolean;
|
|
57
|
+
corrected: boolean;
|
|
58
|
+
}
|
|
59
|
+
interface GenerateColorsAndTypeReport {
|
|
60
|
+
scheme: SchemeDirection;
|
|
61
|
+
checks: ContrastCheck[];
|
|
62
|
+
failures: string[];
|
|
63
|
+
/** 'recipes' when the engine replaced absent/stock swatch gradients with the
|
|
64
|
+
* family-relative recipes; 'carried' when user-tuned ones rode through. */
|
|
65
|
+
gradients: 'recipes' | 'carried';
|
|
66
|
+
/** Present when the brief opted into the page-background sky: either
|
|
67
|
+
* 'on, <sky> → <anchor>' or a 'skipped — …' explanation when the Canvas
|
|
68
|
+
* anchors at the ramp edge and leaves no room. */
|
|
69
|
+
canvasGradient?: string;
|
|
70
|
+
}
|
|
71
|
+
interface GenerateColorsAndTypeResult {
|
|
72
|
+
colorsAndType: ColorsAndType;
|
|
73
|
+
slug: string;
|
|
74
|
+
report: GenerateColorsAndTypeReport;
|
|
75
|
+
}
|
|
76
|
+
declare function buildColorsAndTypeFromSeeds(brief: ColorsAndTypeBrief, carry?: CarryForward, now?: string): GenerateColorsAndTypeResult;
|
|
77
|
+
|
|
78
|
+
/** Sanitize a display name to a safe file name. Pure — no DOM, no fs. */
|
|
79
|
+
declare function sanitizeFileName(name: string): string;
|
|
80
|
+
|
|
81
|
+
export { type CarryForward, type ColorsAndTypeBrief, type ContrastCheck, type GenerateColorsAndTypeReport, type GenerateColorsAndTypeResult, buildColorsAndTypeFromSeeds, sanitizeFileName };
|