@motion-proto/live-tokens 0.6.2 → 0.7.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 (212) hide show
  1. package/README.md +14 -13
  2. package/dist-plugin/index.cjs +147 -136
  3. package/dist-plugin/index.d.cts +1 -1
  4. package/dist-plugin/index.d.ts +1 -1
  5. package/dist-plugin/index.js +145 -135
  6. package/package.json +25 -40
  7. package/src/{component-editor → editor/component-editor}/BadgeEditor.svelte +8 -82
  8. package/src/{component-editor → editor/component-editor}/CalloutEditor.svelte +4 -4
  9. package/src/{component-editor → editor/component-editor}/CardEditor.svelte +28 -76
  10. package/src/{component-editor → editor/component-editor}/CollapsibleSectionEditor.svelte +3 -3
  11. package/src/{component-editor → editor/component-editor}/CornerBadgeEditor.svelte +31 -93
  12. package/src/{component-editor → editor/component-editor}/DialogEditor.svelte +60 -57
  13. package/src/editor/component-editor/ImageEditor.svelte +30 -0
  14. package/src/{component-editor → editor/component-editor}/InlineEditActionsEditor.svelte +6 -4
  15. package/src/editor/component-editor/MenuSelectEditor.svelte +160 -0
  16. package/src/{component-editor → editor/component-editor}/NotificationEditor.svelte +64 -37
  17. package/src/{component-editor → editor/component-editor}/ProgressBarEditor.svelte +5 -4
  18. package/src/{component-editor → editor/component-editor}/RadioButtonEditor.svelte +3 -3
  19. package/src/{component-editor → editor/component-editor}/SectionDividerEditor.svelte +57 -84
  20. package/src/{component-editor → editor/component-editor}/SegmentedControlEditor.svelte +2 -2
  21. package/src/{component-editor → editor/component-editor}/StandardButtonsEditor.svelte +16 -20
  22. package/src/{component-editor → editor/component-editor}/TabBarEditor.svelte +9 -14
  23. package/src/{component-editor → editor/component-editor}/TableEditor.svelte +9 -18
  24. package/src/{component-editor → editor/component-editor}/TooltipEditor.svelte +11 -47
  25. package/src/{component-editor → editor/component-editor}/registry.ts +28 -18
  26. package/src/{component-editor → editor/component-editor}/scaffolding/AngleDial.svelte +2 -2
  27. package/src/{component-editor → editor/component-editor}/scaffolding/ComponentEditorBase.svelte +3 -51
  28. package/src/{component-editor → editor/component-editor}/scaffolding/ComponentFileManager.svelte +144 -416
  29. package/src/{component-editor → editor/component-editor}/scaffolding/ComponentFileMenu.svelte +18 -170
  30. package/src/{component-editor → editor/component-editor}/scaffolding/ComponentsTab.svelte +2 -2
  31. package/src/{component-editor → editor/component-editor}/scaffolding/CopyFromMenu.svelte +44 -4
  32. package/src/{component-editor → editor/component-editor}/scaffolding/DividerEditor.svelte +1 -1
  33. package/src/{component-editor → editor/component-editor}/scaffolding/FieldsetWrapper.svelte +1 -1
  34. package/src/{component-editor → editor/component-editor}/scaffolding/GradientCard.svelte +6 -6
  35. package/src/{component-editor → editor/component-editor}/scaffolding/LinkageChart.svelte +6 -6
  36. package/src/{component-editor → editor/component-editor}/scaffolding/LinkedBlock.svelte +6 -11
  37. package/src/editor/component-editor/scaffolding/NonStylableConfig.svelte +38 -0
  38. package/src/{component-editor → editor/component-editor}/scaffolding/SaveAsDialog.svelte +66 -12
  39. package/src/editor/component-editor/scaffolding/ShadowBackdrop.svelte +72 -0
  40. package/src/editor/component-editor/scaffolding/ShadowBackdropControls.svelte +132 -0
  41. package/src/editor/component-editor/scaffolding/StateBlock.svelte +257 -0
  42. package/src/{component-editor → editor/component-editor}/scaffolding/TokenLayout.svelte +9 -7
  43. package/src/editor/component-editor/scaffolding/VariantGroup.svelte +644 -0
  44. package/src/{component-editor → editor/component-editor}/scaffolding/editorContext.ts +19 -9
  45. package/src/{component-editor → editor/component-editor}/scaffolding/linkedBlock.ts +2 -2
  46. package/src/{component-editor → editor/component-editor}/scaffolding/types.ts +14 -0
  47. package/src/{lib → editor/core/components}/componentConfigService.ts +2 -2
  48. package/src/{lib → editor/core/components}/componentPersist.ts +5 -5
  49. package/src/editor/core/flashStatus.ts +30 -0
  50. package/src/{lib → editor/core/fonts}/fontLoader.ts +2 -2
  51. package/src/{lib → editor/core/fonts}/fontMigration.ts +4 -4
  52. package/src/{lib → editor/core/fonts}/fontParse.ts +1 -1
  53. package/src/editor/core/manifests/manifestService.ts +116 -0
  54. package/src/{lib → editor/core/palettes}/paletteDerivation.ts +2 -2
  55. package/src/{lib → editor/core/palettes}/tokenRegistry.ts +5 -5
  56. package/src/editor/core/productionPulse.ts +37 -0
  57. package/src/{lib → editor/core/routing}/router.ts +1 -1
  58. package/src/{lib/files/versionedFileResource.ts → editor/core/storage/files/versionedFileResourceClient.ts} +8 -1
  59. package/src/{lib → editor/core/store}/editorCore.ts +24 -8
  60. package/src/{lib → editor/core/store}/editorPersistence.ts +3 -3
  61. package/src/{lib → editor/core/store}/editorRenderer.ts +2 -2
  62. package/src/{lib → editor/core/store}/editorStore.ts +17 -17
  63. package/src/{lib → editor/core/store}/editorTypes.ts +1 -1
  64. package/src/{lib → editor/core/themes}/slices/columns.ts +2 -2
  65. package/src/{lib → editor/core/themes}/slices/components.ts +2 -2
  66. package/src/{lib → editor/core/themes}/slices/fonts.ts +1 -1
  67. package/src/{lib → editor/core/themes}/slices/gradients.ts +2 -2
  68. package/src/{lib → editor/core/themes}/slices/overlays.ts +1 -1
  69. package/src/{lib → editor/core/themes}/slices/palettes.ts +1 -1
  70. package/src/{lib → editor/core/themes}/slices/shadows.ts +3 -3
  71. package/src/{lib → editor/core/themes}/themeInit.ts +6 -6
  72. package/src/{lib → editor/core/themes}/themeService.ts +6 -6
  73. package/src/{lib → editor/core/themes}/themeTypes.ts +11 -7
  74. package/src/editor/index.ts +69 -0
  75. package/src/{lib → editor/overlay}/LiveEditorOverlay.svelte +79 -125
  76. package/src/{lib → editor/overlay}/columnsOverlay.ts +2 -2
  77. package/src/{pages → editor/pages}/ComponentEditorPage.svelte +12 -12
  78. package/src/{pages → editor/pages}/Editor.svelte +4 -4
  79. package/src/{pages → editor/pages}/EditorShell.svelte +18 -36
  80. package/src/{styles → editor/styles}/ui-editor.css +41 -21
  81. package/src/{styles → editor/styles}/ui-form-controls.css +8 -8
  82. package/src/{ui → editor/ui}/BezierCurveEditor.svelte +8 -8
  83. package/src/{ui → editor/ui}/ColorEditPanel.svelte +13 -13
  84. package/src/{ui → editor/ui}/EditorViewSwitcher.svelte +8 -6
  85. package/src/editor/ui/FileLoadList.svelte +350 -0
  86. package/src/editor/ui/FilePill.svelte +80 -0
  87. package/src/{ui → editor/ui}/FontStackEditor.svelte +7 -7
  88. package/src/{ui → editor/ui}/GradientEditor.svelte +11 -11
  89. package/src/{ui → editor/ui}/GradientStopPicker.svelte +1 -1
  90. package/src/editor/ui/ManifestFileManager.svelte +371 -0
  91. package/src/{ui → editor/ui}/PaletteEditor.svelte +132 -598
  92. package/src/{ui → editor/ui}/ProjectFontsSection.svelte +102 -144
  93. package/src/{ui → editor/ui}/SurfacesTab.svelte +3 -3
  94. package/src/{ui → editor/ui}/TextTab.svelte +3 -3
  95. package/src/{ui → editor/ui}/ThemeFileManager.svelte +286 -519
  96. package/src/{ui → editor/ui}/UICopyPopover.svelte +4 -4
  97. package/src/{ui → editor/ui}/UIFontFamilySelector.svelte +6 -6
  98. package/src/{ui → editor/ui}/UIFontSizeSelector.svelte +1 -1
  99. package/src/editor/ui/UIInfoPopover.svelte +244 -0
  100. package/src/{ui → editor/ui}/UILineHeightSelector.svelte +5 -5
  101. package/src/{ui → editor/ui}/UILinkToggle.svelte +2 -2
  102. package/src/{ui → editor/ui}/UIPaddingSelector.svelte +6 -6
  103. package/src/{ui → editor/ui}/UIPaletteSelector.svelte +26 -26
  104. package/src/editor/ui/UIPillButton.svelte +138 -0
  105. package/src/{ui → editor/ui}/UIRadio.svelte +2 -2
  106. package/src/{ui → editor/ui}/UIRelinkConfirmPopover.svelte +4 -4
  107. package/src/editor/ui/UISquareButton.svelte +172 -0
  108. package/src/{ui → editor/ui}/UITokenSelector.svelte +10 -10
  109. package/src/{ui → editor/ui}/UIVariantSelector.svelte +1 -1
  110. package/src/{ui → editor/ui}/VariablesTab.svelte +31 -8
  111. package/src/{ui → editor/ui}/palette/GradientStopEditor.svelte +13 -13
  112. package/src/{ui → editor/ui}/palette/OverridesPanel.svelte +13 -13
  113. package/src/{ui → editor/ui}/palette/PaletteBase.svelte +8 -5
  114. package/src/{ui → editor/ui}/palette/paletteEditorState.ts +1 -1
  115. package/src/editor/ui/palette/paletteMath.ts +275 -0
  116. package/src/{ui → editor/ui}/sections/ColumnsSection.svelte +137 -17
  117. package/src/{ui → editor/ui}/sections/GradientsSection.svelte +7 -7
  118. package/src/{ui → editor/ui}/sections/OverlaysSection.svelte +17 -17
  119. package/src/{ui → editor/ui}/sections/ShadowsSection.svelte +22 -22
  120. package/src/{ui → editor/ui}/sections/TokenScaleTable.svelte +3 -3
  121. package/src/{components → system/components}/Badge.svelte +0 -36
  122. package/src/{components → system/components}/Card.svelte +8 -62
  123. package/src/{components → system/components}/CornerBadge.svelte +8 -24
  124. package/src/{components → system/components}/Dialog.svelte +1 -1
  125. package/src/system/components/FloatingTokenTags.css +256 -0
  126. package/src/system/components/FloatingTokenTags.svelte +592 -0
  127. package/src/{components → system/components}/InlineEditActions.svelte +6 -4
  128. package/src/system/components/MenuSelect.svelte +229 -0
  129. package/src/{components → system/components}/ProgressBar.svelte +29 -11
  130. package/src/{components → system/components}/SegmentedControl.svelte +49 -43
  131. package/src/{components → system/components}/TabBar.svelte +81 -65
  132. package/src/{components → system/components}/Table.svelte +17 -3
  133. package/src/{components → system/components}/Tooltip.svelte +6 -4
  134. package/src/system/styles/CONVENTIONS.md +178 -0
  135. package/src/{styles → system/styles}/fonts.css +6 -3
  136. package/src/{styles → system/styles}/tokens.css +149 -29
  137. package/src/component-editor/ImageEditor.svelte +0 -74
  138. package/src/component-editor/scaffolding/NonStylableConfig.svelte +0 -62
  139. package/src/component-editor/scaffolding/ShadowBackdrop.svelte +0 -37
  140. package/src/component-editor/scaffolding/ShadowBackdropControls.svelte +0 -61
  141. package/src/component-editor/scaffolding/StateBlock.svelte +0 -132
  142. package/src/component-editor/scaffolding/VariantGroup.svelte +0 -310
  143. package/src/data/google-fonts.json +0 -75
  144. package/src/lib/index.ts +0 -68
  145. package/src/lib/presetService.ts +0 -214
  146. package/src/lib/productionPulse.ts +0 -32
  147. package/src/ui/PresetFileManager.svelte +0 -1116
  148. package/src/ui/UnsavedComponentsDialog.svelte +0 -315
  149. /package/src/{styles → app}/site.css +0 -0
  150. /package/src/{component-editor → editor/component-editor}/index.ts +0 -0
  151. /package/src/{component-editor → editor/component-editor}/scaffolding/DemoHeader.svelte +0 -0
  152. /package/src/{component-editor → editor/component-editor}/scaffolding/TypeEditor.svelte +0 -0
  153. /package/src/{component-editor → editor/component-editor}/scaffolding/buildTypeGroupTokens.ts +0 -0
  154. /package/src/{component-editor → editor/component-editor}/scaffolding/componentSectionType.ts +0 -0
  155. /package/src/{component-editor → editor/component-editor}/scaffolding/componentSources.ts +0 -0
  156. /package/src/{component-editor → editor/component-editor}/scaffolding/defaultSections.ts +0 -0
  157. /package/src/{component-editor → editor/component-editor}/scaffolding/siblings.ts +0 -0
  158. /package/src/{lib → editor/core/components}/componentConfigKeys.ts +0 -0
  159. /package/src/{lib → editor/core}/cssVarSync.ts +0 -0
  160. /package/src/{lib → editor/core/palettes}/oklch.ts +0 -0
  161. /package/src/{lib → editor/core/routing}/navLinkTypes.ts +0 -0
  162. /package/src/{lib → editor/core/routing}/parentRouteStore.ts +0 -0
  163. /package/src/{lib → editor/core/storage}/storage.ts +0 -0
  164. /package/src/{lib → editor/core/store}/editorConfig.ts +0 -0
  165. /package/src/{lib → editor/core/store}/editorConfigStore.ts +0 -0
  166. /package/src/{lib → editor/core/store}/editorKeybindings.ts +0 -0
  167. /package/src/{lib → editor/core/store}/editorViewStore.ts +0 -0
  168. /package/src/{lib → editor/core/themes}/migrations/2026-04-24-component-prefix-and-suffix-renames.ts +0 -0
  169. /package/src/{lib → editor/core/themes}/migrations/2026-04-24-legacy-keys-and-bg-to-canvas.ts +0 -0
  170. /package/src/{lib → editor/core/themes}/migrations/2026-04-27-segmentedcontrol-disabled-flatten.ts +0 -0
  171. /package/src/{lib → editor/core/themes}/migrations/2026-05-08-collapsiblesection-frame-and-cleanup.ts +0 -0
  172. /package/src/{lib → editor/core/themes}/migrations/2026-05-08-collapsiblesection-variant-namespace.ts +0 -0
  173. /package/src/{lib → editor/core/themes}/migrations/2026-05-10-sectiondivider-gradient-stops.ts +0 -0
  174. /package/src/{lib → editor/core/themes}/migrations/2026-05-13-primary-to-brand.ts +0 -0
  175. /package/src/{lib → editor/core/themes}/migrations/index.ts +0 -0
  176. /package/src/{lib → editor/core/themes}/parsers/globalRootBlock.ts +0 -0
  177. /package/src/{lib → editor/core/themes}/slices/domainVars.ts +0 -0
  178. /package/src/{lib → editor/overlay}/ColumnsOverlay.svelte +0 -0
  179. /package/src/{lib → editor/overlay}/overlayState.ts +0 -0
  180. /package/src/{pages → editor/pages}/ComponentEditorPage.svelte.d.ts +0 -0
  181. /package/src/{pages → editor/pages}/Editor.svelte.d.ts +0 -0
  182. /package/src/{ui → editor/ui}/Toggle.svelte +0 -0
  183. /package/src/{ui → editor/ui}/UIDialog.svelte +0 -0
  184. /package/src/{ui → editor/ui}/UIFontWeightSelector.svelte +0 -0
  185. /package/src/{ui → editor/ui}/UIOptionItem.svelte +0 -0
  186. /package/src/{ui → editor/ui}/UIOptionList.svelte +0 -0
  187. /package/src/{ui → editor/ui}/UIRadioGroup.svelte +0 -0
  188. /package/src/{lib → editor/ui}/copyPopover.ts +0 -0
  189. /package/src/{ui → editor/ui}/curveEngine.ts +0 -0
  190. /package/src/{ui → editor/ui}/index.ts +0 -0
  191. /package/src/{ui → editor/ui}/keepInViewport.ts +0 -0
  192. /package/src/{ui → editor/ui}/palette/ScaleCurveEditor.svelte +0 -0
  193. /package/src/{lib → editor/ui}/scrollSection.ts +0 -0
  194. /package/src/{ui → editor/ui}/sections/tokenScales.ts +0 -0
  195. /package/src/{ui → editor/ui}/variantScales.ts +0 -0
  196. /package/src/{assets → system/assets}/newspaper.webp +0 -0
  197. /package/src/{assets → system/assets}/offering.webp +0 -0
  198. /package/src/{components → system/components}/Button.svelte +0 -0
  199. /package/src/{components → system/components}/Callout.svelte +0 -0
  200. /package/src/{components → system/components}/CollapsibleSection.svelte +0 -0
  201. /package/src/{components → system/components}/Image.svelte +0 -0
  202. /package/src/{components → system/components}/Notification.svelte +0 -0
  203. /package/src/{components → system/components}/RadioButton.svelte +0 -0
  204. /package/src/{components → system/components}/SectionDivider.svelte +0 -0
  205. /package/src/{components → system/components}/types.ts +0 -0
  206. /package/src/{styles → system/styles}/_padding.scss +0 -0
  207. /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-italic-latin-ext.woff2 +0 -0
  208. /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-italic-latin.woff2 +0 -0
  209. /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-roman-latin-ext.woff2 +0 -0
  210. /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-roman-latin.woff2 +0 -0
  211. /package/src/{styles → system/styles}/fonts/Manrope/Manrope-latin-ext.woff2 +0 -0
  212. /package/src/{styles → system/styles}/fonts/Manrope/Manrope-latin.woff2 +0 -0
@@ -1,10 +1,10 @@
1
1
  import type { Theme } from './themeTypes';
2
- import { activeFileName } from './editorConfigStore';
3
- import { migrateThemeFonts } from './fontMigration';
4
- import { applyFontSources, applyFontStacks } from './fontLoader';
5
- import { loadFromFile, seedComponentsFromApi } from './editorStore';
6
- import { getActiveComponentConfig } from './componentConfigService';
7
- import { safeFetch } from './storage';
2
+ import { activeFileName } from '../store/editorConfigStore';
3
+ import { migrateThemeFonts } from '../fonts/fontMigration';
4
+ import { applyFontSources, applyFontStacks } from '../fonts/fontLoader';
5
+ import { loadFromFile, seedComponentsFromApi } from '../store/editorStore';
6
+ import { getActiveComponentConfig } from '../components/componentConfigService';
7
+ import { safeFetch } from '../storage/storage';
8
8
 
9
9
  interface ComponentSummaryDto {
10
10
  name: string;
@@ -1,14 +1,14 @@
1
1
  import { tick } from 'svelte';
2
2
  import type { Theme, ThemeMeta } from './themeTypes';
3
- import type { EditorState } from './editorTypes';
3
+ import type { EditorState } from '../store/editorTypes';
4
4
  import {
5
5
  versionedFileResource,
6
6
  sanitizeFileName as sanitizeFileNameImpl,
7
- } from './files/versionedFileResource';
8
- import { loadFromFile as loadEditorState, toTheme, markSaved } from './editorStore';
9
- import { activeFileName } from './editorConfigStore';
10
- import { applyFontSources, applyFontStacks } from './fontLoader';
11
- import { migrateThemeFonts } from './fontMigration';
7
+ } from '../storage/files/versionedFileResourceClient';
8
+ import { loadFromFile as loadEditorState, toTheme, markSaved } from '../store/editorStore';
9
+ import { activeFileName } from '../store/editorConfigStore';
10
+ import { applyFontSources, applyFontStacks } from '../fonts/fontLoader';
11
+ import { migrateThemeFonts } from '../fonts/fontMigration';
12
12
 
13
13
  // ── API helpers ──────────────────────────────────────────────
14
14
  //
@@ -1,4 +1,4 @@
1
- import type { CurveAnchor } from '../ui/curveEngine';
1
+ import type { CurveAnchor } from '../../ui/curveEngine';
2
2
 
3
3
  export type GradientStyle = 'linear' | 'radial' | 'conic';
4
4
 
@@ -120,16 +120,17 @@ export interface ComponentConfigMeta {
120
120
 
121
121
  /**
122
122
  * Manifest that captures an entire site state — the active theme plus the
123
- * active config for every component. Loading a preset flips the relevant
123
+ * active config for every component. Loading a manifest flips the relevant
124
124
  * `_active.json` pointers; the underlying theme + component-config files stay
125
- * the source of truth, so editing them flows through any preset that
126
- * references them.
125
+ * the source of truth, so editing them flows through any manifest that
126
+ * references them. The currently-active manifest is the live snapshot: theme
127
+ * and component Adopts auto-patch its refs on the server.
127
128
  */
128
- export interface Preset {
129
+ export interface Manifest {
129
130
  name: string;
130
131
  createdAt: string;
131
132
  updatedAt: string;
132
- /** File basename (no `.json`) of the theme this preset pins. */
133
+ /** File basename (no `.json`) of the theme this manifest pins. */
133
134
  theme: string;
134
135
  /** Map of componentId → config file basename. Components omitted here fall
135
136
  * back to "default" at apply time. */
@@ -138,9 +139,12 @@ export interface Preset {
138
139
  _fileName?: string;
139
140
  }
140
141
 
141
- export interface PresetMeta {
142
+ export interface ManifestMeta {
142
143
  name: string;
143
144
  fileName: string;
144
145
  updatedAt: string;
145
146
  isActive: boolean;
147
+ /** `true` only for `default` — the protected baseline. Cannot be written
148
+ * to or deleted, and theme/component Adopts cannot patch into it. */
149
+ isProtected: boolean;
146
150
  }
@@ -0,0 +1,69 @@
1
+ export { default as LiveEditorOverlay } from './overlay/LiveEditorOverlay.svelte';
2
+ export type { NavLink } from './core/routing/navLinkTypes';
3
+ export { default as ColumnsOverlay } from './overlay/ColumnsOverlay.svelte';
4
+
5
+ export { columnsVisible, toggleColumns, init as initColumnsOverlay } from './overlay/columnsOverlay';
6
+ export { configureEditor, storageKey } from './core/store/editorConfig';
7
+ export { activeFileName } from './core/store/editorConfigStore';
8
+ export { init as initRouter, route, navigate } from './core/routing/router';
9
+ export { init as initCssVarSync } from './core/cssVarSync';
10
+ export { init as initEditorStore } from './core/store/editorStore';
11
+
12
+ export { setCssVar, removeCssVar } from './core/cssVarSync';
13
+
14
+ export {
15
+ listThemes,
16
+ loadTheme,
17
+ saveTheme,
18
+ deleteTheme,
19
+ getActiveTheme,
20
+ setActiveFile,
21
+ getProductionInfo,
22
+ setProductionFile,
23
+ sanitizeFileName,
24
+ } from './core/themes/themeService';
25
+ export type { ProductionInfo } from './core/themes/themeService';
26
+
27
+ export type {
28
+ PaletteConfig,
29
+ Theme,
30
+ ThemeMeta,
31
+ GradientStyle,
32
+ GradientStop,
33
+ FontSource,
34
+ FontSourceKind,
35
+ FontFamily,
36
+ FontStack,
37
+ FontStackSlot,
38
+ FontStackVariable,
39
+ SystemCascadePreset,
40
+ GenericFamily,
41
+ Manifest,
42
+ ManifestMeta,
43
+ } from './core/themes/themeTypes';
44
+
45
+ export {
46
+ listManifests,
47
+ loadManifest,
48
+ saveManifest,
49
+ deleteManifest,
50
+ getActiveManifest,
51
+ setActiveManifest,
52
+ applyManifest,
53
+ saveAsManifest,
54
+ saveActiveManifest,
55
+ } from './core/manifests/manifestService';
56
+ export type { ApplyManifestResult } from './core/manifests/manifestService';
57
+
58
+ export {
59
+ applyFontSources,
60
+ applyFontStacks,
61
+ resolveFontStackValues,
62
+ SYSTEM_CASCADES,
63
+ } from './core/fonts/fontLoader';
64
+ export { migrateThemeFonts, defaultFontSources, defaultFontStacks } from './core/fonts/fontMigration';
65
+
66
+ export { hexToOklch, oklchToHex, gamutClamp } from './core/palettes/oklch';
67
+ export type { Oklch } from './core/palettes/oklch';
68
+
69
+ export { initializeTheme } from './core/themes/themeInit';
@@ -1,8 +1,5 @@
1
1
  <script module lang="ts">
2
- // __PROJECT_ROOT__ is injected by the themeFileApi Vite plugin as a `define`.
3
- // Consumers don't need to configure it themselves. We declare it locally so
4
- // this component's type-check passes in consumer projects that haven't added
5
- // the ambient global to their tsconfig.
2
+ // __PROJECT_ROOT__ / __APP_VERSION__ are Vite-injected defines.
6
3
  declare const __PROJECT_ROOT__: string | undefined;
7
4
  declare const __APP_VERSION__: string | undefined;
8
5
  const INJECTED_PROJECT_ROOT: string =
@@ -17,13 +14,14 @@
17
14
  import { onMount, onDestroy } from 'svelte';
18
15
  import { fade } from 'svelte/transition';
19
16
  import { cubicInOut } from 'svelte/easing';
20
- import { route, navigate } from './router';
17
+ import { route, navigate } from '../core/routing/router';
21
18
  import { columnsVisible, toggleColumns } from './columnsOverlay';
22
- import { storageKey } from './editorConfig';
19
+ import { storageKey } from '../core/store/editorConfig';
23
20
  import { overlayOpen } from './overlayState';
24
- import { quietGet, quietSet } from './storage';
25
- import { postParentRoute } from './parentRouteStore';
26
- import type { NavLink } from './navLinkTypes';
21
+ import { quietGet, quietSet } from '../core/storage/storage';
22
+ import { postParentRoute } from '../core/routing/parentRouteStore';
23
+ import UIPillButton from '../ui/UIPillButton.svelte';
24
+ import type { NavLink } from '../core/routing/navLinkTypes';
27
25
 
28
26
  interface Props {
29
27
  open?: boolean | undefined;
@@ -43,15 +41,12 @@
43
41
  projectRoot = INJECTED_PROJECT_ROOT
44
42
  }: Props = $props();
45
43
 
46
- // Self-gate: only render in dev, and never inside an iframe (the /editor
47
- // page embeds this same app in an iframe and would otherwise recursively
48
- // mount another overlay).
44
+ // Dev-only; skip inside iframe (editor route embeds this app).
49
45
  const isDev = import.meta.env.DEV;
50
46
  const isInIframe = typeof window !== 'undefined' && window.parent !== window;
51
47
  const enabled = isDev && !isInIframe;
52
48
 
53
- // Self-manage `open` when the consumer doesn't bind it. When they do, their
54
- // binding wins and we skip our own persistence.
49
+ // Persist `open` only when consumer doesn't bind it.
55
50
  const OPEN_KEY = storageKey('overlay-open');
56
51
  const consumerControlsOpen = open !== undefined;
57
52
  if (!consumerControlsOpen) {
@@ -66,15 +61,12 @@
66
61
  overlayOpen.set(!!open);
67
62
  });
68
63
 
69
- // Hide the overlay entirely when the user is already on the editor route
70
- // (the editor page has its own chrome).
64
+ // Editor route has its own chrome hide overlay there.
71
65
  let onEditorPath = $derived($route === editorPath);
72
66
  let sourceFile = $derived(pageSources[$route]);
73
67
  let showSource = $derived(!!sourceFile && !!projectRoot && !hidePageSourceOn.includes($route));
74
68
 
75
- // Mount the iframe the first time the editor is shown, then keep it mounted
76
- // across hide/show cycles so editor state (unsaved slider values, scroll
77
- // position, expanded sections) survives.
69
+ // Mount iframe on first open, then keep it to preserve editor state across hide/show.
78
70
  let hasBeenOpen: boolean = $state(!!open);
79
71
  run(() => {
80
72
  if (open) hasBeenOpen = true;
@@ -134,22 +126,17 @@
134
126
  let dockedWidth: number = $state(Math.max(MIN_WIDTH, initial.dockedWidth));
135
127
  let floating = $state({ ...initial.floating });
136
128
 
137
- // Approximate natural size of the collapsed pill (Editor title + columns toggle).
138
- // A few pixels of overshoot is fine — the panel has overflow:hidden.
139
- const COLLAPSED_WIDTH = 184;
140
- const COLLAPSED_HEIGHT = 38;
129
+ // Collapsed-pill size; slight overshoot is fine (overflow:hidden).
130
+ const COLLAPSED_WIDTH = 200;
131
+ const COLLAPSED_HEIGHT = 44;
141
132
 
142
- // Fade timing for the buttons that only render when open (float toggle, spacer,
143
- // nav links, page-source). The bar's grow/shrink + iframe fade live in CSS vars
144
- // at the top of the style block.
133
+ // Fade for open-only buttons (bar timing lives in CSS vars below).
145
134
  const BTN_FADE = { duration: 130, easing: cubicInOut };
146
135
 
147
- // Suppress CSS transitions during gestures and mode swaps so dragging doesn't
148
- // re-animate every frame, and floating↔docked swaps snap cleanly.
136
+ // Suppress CSS transitions during gestures + mode swaps.
149
137
  let suppressTransition = $state(false);
150
138
 
151
- // Gesture state a transparent scrim covers the iframe while any gesture is active
152
- // so pointer events land on the panel, not on content inside the iframe.
139
+ // Scrim catches pointer events during gestures so they hit the panel, not the iframe.
153
140
  let gesturing: 'drag' | 'resize-left' | 'resize-se' | null = $state(null);
154
141
 
155
142
  function startDrag(e: PointerEvent) {
@@ -185,7 +172,7 @@
185
172
  const startX = e.clientX;
186
173
  const origWidth = dockedWidth;
187
174
  function move(ev: PointerEvent) {
188
- // Dragging left increases width (panel is anchored to the right edge)
175
+ // Panel anchored right drag left grows width.
189
176
  dockedWidth = clamp(origWidth + (startX - ev.clientX), MIN_WIDTH, window.innerWidth - 120);
190
177
  }
191
178
  function up() {
@@ -230,7 +217,7 @@
230
217
  function toggleMode() {
231
218
  suppressTransition = true;
232
219
  mode = mode === 'docked' ? 'floating' : 'docked';
233
- // Snap the floating rect back inside the viewport if it drifted off-screen since last use
220
+ // Re-clamp floating rect into viewport in case it drifted off-screen.
234
221
  if (mode === 'floating') {
235
222
  floating = {
236
223
  x: clamp(floating.x, 0, window.innerWidth - MIN_WIDTH),
@@ -248,8 +235,7 @@
248
235
  }
249
236
 
250
237
  function handleHeaderDblClick(e: MouseEvent) {
251
- // Ignore double-clicks on buttons so toggling mode/fullscreen/show-hide
252
- // doesn't also fire the dblclick handler.
238
+ // Skip dblclick on buttons so their handlers don't double-fire.
253
239
  if ((e.target as HTMLElement).closest('button')) return;
254
240
  toggleOpen();
255
241
  }
@@ -327,15 +313,13 @@
327
313
  {/if}
328
314
 
329
315
  {#if open && showSource}
330
- <a
331
- class="hdr-btn text source"
332
- href="vscode://file/{projectRoot}/{sourceFile}"
333
- title="Open {sourceFile} in VS Code"
334
- transition:fade={BTN_FADE}
335
- >
336
- <i class="fas fa-code"></i>
337
- Show page source
338
- </a>
316
+ <span class="source-pill" transition:fade={BTN_FADE}>
317
+ <UIPillButton
318
+ icon="fa-code"
319
+ href="vscode://file/{projectRoot}/{sourceFile}"
320
+ title="Open {sourceFile} in VS Code"
321
+ >Show page source</UIPillButton>
322
+ </span>
339
323
  {/if}
340
324
 
341
325
  {#if open && navLinks.length > 0}
@@ -386,8 +370,7 @@
386
370
 
387
371
  <style>
388
372
  .lt-overlay {
389
- /* Animation knobs. bar = panel grow/shrink, pane = iframe fade.
390
- open = collapsed to expanded, close = expanded to collapsed. */
373
+ /* Animation knobs: bar = panel grow/shrink. */
391
374
  --bar-open-dur: 240ms;
392
375
  --bar-open-ease: cubic-bezier(0.65, 0, 0.35, 1);
393
376
  --bar-open-delay: 0ms;
@@ -395,22 +378,15 @@
395
378
  --bar-close-ease: cubic-bezier(0.65, 0, 0.35, 1);
396
379
  --bar-close-delay: 70ms;
397
380
 
398
- --pane-open-dur: 140ms;
399
- --pane-open-ease: cubic-bezier(0.65, 0, 0.35, 1);
400
- --pane-open-delay: 140ms;
401
- --pane-close-dur: 80ms;
402
- --pane-close-ease: cubic-bezier(0.65, 0, 0.35, 1);
403
- --pane-close-delay: 0ms;
404
-
405
381
  display: flex;
406
382
  flex-direction: column;
407
- background: #0a0a0a;
383
+ background: var(--ui-surface-lower, #0a0a0a);
408
384
  border: 1px solid rgba(255, 255, 255, 0.12);
409
385
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
410
386
  z-index: 2000;
411
387
  overflow: hidden;
412
- font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
413
- color: #fff;
388
+ font-family: var(--ui-font-sans, system-ui, -apple-system, BlinkMacSystemFont, sans-serif);
389
+ color: var(--ui-text-primary, #fff);
414
390
  transition:
415
391
  width var(--bar-open-dur) var(--bar-open-ease) var(--bar-open-delay),
416
392
  height var(--bar-open-dur) var(--bar-open-ease) var(--bar-open-delay),
@@ -425,14 +401,12 @@
425
401
  }
426
402
 
427
403
  .lt-overlay.floating {
428
- border-radius: 8px;
404
+ border-radius: var(--ui-radius-xl, 8px);
429
405
  }
430
406
 
431
- /* Hidden state: the editor panel is collapsed to just the header bar,
432
- pinned to the top-right. The iframe stays mounted; its container fades
433
- to opacity 0 and the panel shrinks around it. */
407
+ /* Collapsed state: pinned top-right; iframe stays mounted, clipped by overflow:hidden. */
434
408
  .lt-overlay.hidden {
435
- border-radius: 6px;
409
+ border-radius: var(--ui-radius-lg, 6px);
436
410
  transition:
437
411
  width var(--bar-close-dur) var(--bar-close-ease) var(--bar-close-delay),
438
412
  height var(--bar-close-dur) var(--bar-close-ease) var(--bar-close-delay),
@@ -454,9 +428,9 @@
454
428
  .header {
455
429
  display: flex;
456
430
  align-items: center;
457
- gap: 6px;
458
- padding: 6px 10px;
459
- background: #111;
431
+ gap: var(--ui-space-6, 6px);
432
+ padding: var(--ui-space-6, 6px) var(--ui-space-10, 10px);
433
+ background: var(--ui-surface-low, #111);
460
434
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
461
435
  cursor: default;
462
436
  flex-shrink: 0;
@@ -465,7 +439,7 @@
465
439
 
466
440
  .lt-overlay.hidden .header {
467
441
  border-bottom: none;
468
- padding: 5px 8px;
442
+ padding: 5px var(--ui-space-8, 8px);
469
443
  }
470
444
 
471
445
  .lt-overlay.floating .header {
@@ -474,8 +448,8 @@
474
448
 
475
449
  .hdr-btn.title {
476
450
  gap: 7px;
477
- font-size: 13px;
478
- font-weight: 600;
451
+ font-size: var(--ui-font-size-md, 16px);
452
+ font-weight: var(--ui-font-weight-semibold, 600);
479
453
  color: rgba(255, 255, 255, 0.85);
480
454
  letter-spacing: 0.02em;
481
455
  }
@@ -483,11 +457,11 @@
483
457
  .spacer { flex: 1; }
484
458
 
485
459
  .version {
486
- font-size: 10px;
487
- font-weight: 500;
460
+ font-size: var(--ui-font-size-md, 16px);
461
+ font-weight: var(--ui-font-weight-medium, 500);
488
462
  color: rgba(255, 255, 255, 0.4);
489
463
  letter-spacing: 0.02em;
490
- margin-left: 2px;
464
+ margin-left: var(--ui-space-2, 2px);
491
465
  user-select: none;
492
466
  }
493
467
 
@@ -497,86 +471,70 @@
497
471
  justify-content: center;
498
472
  background: transparent;
499
473
  border: 1px solid rgba(255, 255, 255, 0.08);
500
- border-radius: 4px;
474
+ border-radius: var(--ui-radius-md, 4px);
501
475
  color: rgba(255, 255, 255, 0.75);
502
476
  cursor: pointer;
503
- transition: background 0.1s, color 0.1s;
477
+ transition: background var(--ui-transition-fast, 120ms ease), color var(--ui-transition-fast, 120ms ease);
504
478
  font-family: inherit;
505
479
  }
506
480
 
507
481
  .hdr-btn.icon {
508
- width: 26px;
509
- height: 26px;
510
- font-size: 11px;
482
+ padding: var(--ui-space-6, 6px);
483
+ aspect-ratio: 1;
484
+ font-size: var(--ui-font-size-md, 16px);
511
485
  }
512
486
 
513
487
  .hdr-btn.text {
514
- height: 26px;
515
- padding: 0 10px;
516
- font-size: 12px;
517
- font-weight: 500;
518
- }
519
-
520
- a.hdr-btn.source {
521
- gap: 6px;
522
- text-decoration: none;
523
- background: rgba(255, 255, 255, 0.06);
524
- border-color: rgba(255, 255, 255, 0.45);
525
- border-radius: 999px;
526
- padding: 0 14px;
527
- color: rgba(255, 255, 255, 0.92);
488
+ padding: var(--ui-space-6, 6px) var(--ui-space-10, 10px);
489
+ font-size: var(--ui-font-size-md, 16px);
490
+ font-weight: var(--ui-font-weight-medium, 500);
528
491
  }
529
492
 
530
- a.hdr-btn.source:hover {
531
- background: rgba(255, 255, 255, 0.14);
532
- border-color: rgba(255, 255, 255, 0.6);
533
- }
534
-
535
- a.hdr-btn.source i {
536
- color: rgba(255, 255, 255, 0.6);
493
+ .source-pill {
494
+ display: inline-flex;
537
495
  }
538
496
 
539
497
  .hdr-btn.nav {
540
- height: 26px;
541
- padding: 0 9px;
542
- gap: 5px;
543
- font-size: 11px;
544
- font-weight: 500;
498
+ padding: var(--ui-space-6, 6px) var(--ui-space-8, 8px);
499
+ gap: var(--ui-space-4, 4px);
500
+ font-size: var(--ui-font-size-md, 16px);
501
+ font-weight: var(--ui-font-weight-medium, 500);
545
502
  }
546
503
 
547
504
  .hdr-btn:hover {
548
505
  background: rgba(255, 255, 255, 0.08);
549
- color: #fff;
506
+ color: var(--ui-text-primary, #fff);
550
507
  }
551
508
 
552
509
  .hdr-btn.active {
553
510
  background: rgba(255, 255, 255, 0.12);
554
- color: #fff;
511
+ color: var(--ui-text-primary, #fff);
555
512
  border-color: rgba(255, 255, 255, 0.18);
556
513
  }
557
514
 
558
515
  .seg-group {
559
516
  display: inline-flex;
560
517
  align-items: center;
561
- gap: 8px;
518
+ gap: var(--ui-space-8, 8px);
562
519
  margin-left: 18px;
563
- margin-right: 4px;
520
+ margin-right: var(--ui-space-4, 4px);
564
521
  }
565
522
 
566
523
  .seg-label {
567
- font-size: 11px;
568
- font-weight: 600;
524
+ font-size: var(--ui-font-size-md, 16px);
525
+ font-weight: var(--ui-font-weight-semibold, 600);
569
526
  letter-spacing: 0.02em;
570
- color: #fff;
527
+ color: var(--ui-text-primary, #fff);
571
528
  }
572
529
 
573
530
  .seg-bar {
574
531
  display: inline-flex;
575
532
  align-items: center;
533
+ gap: var(--ui-space-4, 4px);
576
534
  padding: 3px;
577
535
  background: rgba(0, 0, 0, 0.55);
578
536
  border: 1px solid rgba(255, 255, 255, 0.28);
579
- border-radius: 6px;
537
+ border-radius: var(--ui-radius-lg, 6px);
580
538
  box-shadow:
581
539
  inset 0 1px 0 rgba(0, 0, 0, 0.5),
582
540
  0 0 0 1px rgba(0, 0, 0, 0.4);
@@ -585,22 +543,24 @@
585
543
  .seg-pill {
586
544
  display: inline-flex;
587
545
  align-items: center;
588
- gap: 5px;
589
- height: 22px;
590
- padding: 0 9px;
546
+ gap: var(--ui-space-4, 4px);
547
+ padding: var(--ui-space-4, 4px) var(--ui-space-8, 8px);
591
548
  background: transparent;
592
549
  border: 1px solid transparent;
593
550
  border-radius: 3px;
594
551
  color: rgba(255, 255, 255, 0.6);
595
552
  font-family: inherit;
596
- font-size: 11px;
597
- font-weight: 500;
553
+ font-size: var(--ui-font-size-md, 16px);
554
+ font-weight: var(--ui-font-weight-medium, 500);
598
555
  cursor: pointer;
599
- transition: background 0.1s, color 0.1s, border-color 0.1s;
556
+ transition:
557
+ background var(--ui-transition-fast, 120ms ease),
558
+ color var(--ui-transition-fast, 120ms ease),
559
+ border-color var(--ui-transition-fast, 120ms ease);
600
560
  }
601
561
 
602
562
  .seg-pill i {
603
- font-size: 10px;
563
+ font-size: var(--ui-font-size-md, 16px);
604
564
  opacity: 0.85;
605
565
  }
606
566
 
@@ -617,13 +577,11 @@
617
577
  opacity: 0.5;
618
578
  }
619
579
 
620
- /* Outlined active quieter than the iframe's filled switcher, so the two
621
- segmented controls read as siblings, not twins. */
580
+ /* Outlined (not filled) so this reads as sibling to iframe's switcher, not a twin. */
622
581
  .seg-pill.active {
623
- color: #fff;
624
- border-color: rgba(255, 255, 255, 0.3);
625
- background: rgba(255, 255, 255, 0.1);
626
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
582
+ color: var(--ui-text-primary, #fff);
583
+ border-color: rgba(255, 255, 255, 0.5);
584
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.25) 100%);
627
585
  }
628
586
 
629
587
  .frame-wrap {
@@ -631,14 +589,10 @@
631
589
  flex: 1;
632
590
  min-height: 0;
633
591
  background: #000;
634
- transition: opacity var(--pane-open-dur) var(--pane-open-ease) var(--pane-open-delay);
635
- opacity: 1;
636
592
  }
637
593
 
638
594
  .lt-overlay.hidden .frame-wrap {
639
- opacity: 0;
640
595
  pointer-events: none;
641
- transition: opacity var(--pane-close-dur) var(--pane-close-ease) var(--pane-close-delay);
642
596
  }
643
597
 
644
598
  .editor-frame {
@@ -1,6 +1,6 @@
1
1
  import { writable } from 'svelte/store';
2
- import { storageKey } from './editorConfig';
3
- import { quietGet, quietSet } from './storage';
2
+ import { storageKey } from '../core/store/editorConfig';
3
+ import { quietGet, quietSet } from '../core/storage/storage';
4
4
 
5
5
  function getStorageKey(): string {
6
6
  return storageKey('columns-visible');
@@ -3,12 +3,12 @@
3
3
 
4
4
  import { onMount, onDestroy } from 'svelte';
5
5
  import ComponentsTab from '../component-editor/scaffolding/ComponentsTab.svelte';
6
- import PresetFileManager from '../ui/PresetFileManager.svelte';
7
- import { navigate } from '../lib/router';
6
+ import ManifestFileManager from '../ui/ManifestFileManager.svelte';
7
+ import { navigate } from '../core/routing/router';
8
8
  import { componentRegistryEntries, validateRegistryAgainstServerScan } from '../component-editor/registry';
9
- import { listComponents } from '../lib/componentConfigService';
10
- import { selectedComponent } from '../lib/editorViewStore';
11
- import { componentDirty } from '../lib/editorStore';
9
+ import { listComponents } from '../core/components/componentConfigService';
10
+ import { selectedComponent } from '../core/store/editorViewStore';
11
+ import { componentDirty } from '../core/store/editorStore';
12
12
  // Editor chrome + form controls + icon font must be JS imports (not @import
13
13
  // inside the style block) so Vite resolves them via the module graph
14
14
  // regardless of how the consumer compiles Svelte CSS (external ?lang.css vs
@@ -165,7 +165,7 @@
165
165
  </div>
166
166
  {#if drawerOpen}
167
167
  <div class="sidebar-footer">
168
- <PresetFileManager />
168
+ <ManifestFileManager />
169
169
  </div>
170
170
  {/if}
171
171
  </nav>
@@ -201,7 +201,7 @@
201
201
  overflow-y: auto;
202
202
  overflow-x: hidden;
203
203
  background: black;
204
- border-right: 1px solid var(--ui-border-faint);
204
+ border-right: 1px solid var(--ui-border-low);
205
205
  display: flex;
206
206
  flex-direction: column;
207
207
  min-width: 0;
@@ -213,7 +213,7 @@
213
213
  grid-template-columns: 48px 1fr;
214
214
  align-items: center;
215
215
  padding: var(--ui-space-12) 0 var(--ui-space-12) 0;
216
- border-bottom: 1px solid var(--ui-border-faint);
216
+ border-bottom: 1px solid var(--ui-border-low);
217
217
  }
218
218
 
219
219
  .rail-toggle {
@@ -286,7 +286,7 @@
286
286
  left: 48px;
287
287
  right: var(--ui-space-8);
288
288
  background: var(--ui-surface-low);
289
- border: 1px solid var(--ui-border-default);
289
+ border: 1px solid var(--ui-border);
290
290
  border-radius: var(--ui-radius-md);
291
291
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
292
292
  padding: var(--ui-space-4);
@@ -335,7 +335,7 @@
335
335
  flex-shrink: 0;
336
336
  margin-top: auto;
337
337
  padding: var(--ui-space-12) var(--ui-space-8) var(--ui-space-16);
338
- border-top: 1px solid var(--ui-border-faint);
338
+ border-top: 1px solid var(--ui-border-low);
339
339
  }
340
340
 
341
341
  .nav-item {
@@ -395,7 +395,7 @@
395
395
  }
396
396
 
397
397
  .content {
398
- padding: 0 var(--ui-space-32);
398
+ padding: 1rem var(--ui-space-32) 0;
399
399
  background: black;
400
400
  min-width: 0;
401
401
  height: 100vh;
@@ -409,7 +409,7 @@
409
409
  z-index: 50;
410
410
  padding: var(--ui-space-4) var(--ui-space-8);
411
411
  background: var(--ui-surface-low);
412
- border: 1px solid var(--ui-border-default);
412
+ border: 1px solid var(--ui-border);
413
413
  border-radius: var(--ui-radius-sm);
414
414
  color: var(--ui-text-primary);
415
415
  font-size: var(--ui-font-size-sm);