zyzz 0.0.28 → 0.0.29

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 (302) hide show
  1. package/binding/wasi/wasi-worker.mjs +186 -0
  2. package/binding/wasi/zyzz.wasi.cjs +2302 -0
  3. package/binding/wasi/zyzz.wasm32-wasi.wasm +0 -0
  4. package/binding/zyzz.linux-x64-gnu.node +0 -0
  5. package/dist/babel/index.d.ts.map +1 -1
  6. package/dist/babel/index.js +2 -4
  7. package/dist/babel/index.js.map +1 -1
  8. package/dist/babel/internal/Compilation.d.ts +0 -1
  9. package/dist/babel/internal/Compilation.d.ts.map +1 -1
  10. package/dist/compiler/Graph.d.ts +14 -11
  11. package/dist/compiler/Graph.d.ts.map +1 -1
  12. package/dist/compiler/Graph.js +57 -1442
  13. package/dist/compiler/Graph.js.map +1 -1
  14. package/dist/compiler/Native.d.ts +7 -9
  15. package/dist/compiler/Native.d.ts.map +1 -1
  16. package/dist/compiler/Native.js +12 -716
  17. package/dist/compiler/Native.js.map +1 -1
  18. package/dist/compiler/Source.d.ts +122 -24
  19. package/dist/compiler/Source.d.ts.map +1 -1
  20. package/dist/compiler/Source.js +10 -1267
  21. package/dist/compiler/Source.js.map +1 -1
  22. package/dist/compiler/Transform.d.ts +4 -3
  23. package/dist/compiler/Transform.d.ts.map +1 -1
  24. package/dist/compiler/Transform.js +13 -961
  25. package/dist/compiler/Transform.js.map +1 -1
  26. package/dist/compiler/internal/AtRules.d.ts +5 -1
  27. package/dist/compiler/internal/AtRules.d.ts.map +1 -1
  28. package/dist/compiler/internal/AtRules.js +12 -106
  29. package/dist/compiler/internal/AtRules.js.map +1 -1
  30. package/dist/compiler/internal/Context.d.ts +11 -0
  31. package/dist/compiler/internal/Context.d.ts.map +1 -0
  32. package/dist/compiler/internal/Context.js +11 -0
  33. package/dist/compiler/internal/Context.js.map +1 -0
  34. package/dist/compiler/internal/Results.d.ts +148 -0
  35. package/dist/compiler/internal/Results.d.ts.map +1 -0
  36. package/dist/compiler/internal/Results.js +259 -0
  37. package/dist/compiler/internal/Results.js.map +1 -0
  38. package/dist/compiler/internal/Syntax.d.ts +0 -2
  39. package/dist/compiler/internal/Syntax.d.ts.map +1 -1
  40. package/dist/compiler/internal/Syntax.js +0 -2
  41. package/dist/compiler/internal/Syntax.js.map +1 -1
  42. package/dist/compiler/internal/Wire.d.ts +17 -0
  43. package/dist/compiler/internal/Wire.d.ts.map +1 -0
  44. package/dist/compiler/internal/Wire.js +795 -0
  45. package/dist/compiler/internal/Wire.js.map +1 -0
  46. package/dist/internal/Addon.d.ts +28 -0
  47. package/dist/internal/Addon.d.ts.map +1 -0
  48. package/dist/internal/Addon.js +87 -0
  49. package/dist/internal/Addon.js.map +1 -0
  50. package/dist/internal/Literal.d.ts +4 -1
  51. package/dist/internal/Literal.d.ts.map +1 -1
  52. package/dist/internal/Literal.js +4 -2
  53. package/dist/internal/Literal.js.map +1 -1
  54. package/dist/internal/Token.d.ts +2 -1
  55. package/dist/internal/Token.d.ts.map +1 -1
  56. package/dist/internal/Token.js +2 -2
  57. package/dist/internal/Token.js.map +1 -1
  58. package/dist/internal/Vlq.d.ts +14 -0
  59. package/dist/internal/Vlq.d.ts.map +1 -0
  60. package/dist/internal/Vlq.js +47 -0
  61. package/dist/internal/Vlq.js.map +1 -0
  62. package/dist/internal/Wasm.d.ts +22 -0
  63. package/dist/internal/Wasm.d.ts.map +1 -0
  64. package/dist/internal/Wasm.js +83 -0
  65. package/dist/internal/Wasm.js.map +1 -0
  66. package/dist/metro/Graph.d.ts +0 -1
  67. package/dist/metro/Graph.d.ts.map +1 -1
  68. package/dist/metro/transformer.d.ts.map +1 -1
  69. package/dist/metro/transformer.js +0 -1
  70. package/dist/metro/transformer.js.map +1 -1
  71. package/dist/next/internal/Project.d.ts.map +1 -1
  72. package/dist/next/internal/Project.js +2 -5
  73. package/dist/next/internal/Project.js.map +1 -1
  74. package/dist/node/Host.d.ts.map +1 -1
  75. package/dist/node/Host.js +0 -2
  76. package/dist/node/Host.js.map +1 -1
  77. package/dist/node/internal/Contracts.d.ts.map +1 -1
  78. package/dist/node/internal/Contracts.js +3 -7
  79. package/dist/node/internal/Contracts.js.map +1 -1
  80. package/dist/node/internal/Snapshot.d.ts +0 -1
  81. package/dist/node/internal/Snapshot.d.ts.map +1 -1
  82. package/dist/node/internal/Snapshot.js +0 -6
  83. package/dist/node/internal/Snapshot.js.map +1 -1
  84. package/dist/runtime/Composition.d.ts +2 -3
  85. package/dist/runtime/Composition.d.ts.map +1 -1
  86. package/dist/runtime/Composition.js +51 -30
  87. package/dist/runtime/Composition.js.map +1 -1
  88. package/dist/runtime/Recipe.d.ts.map +1 -1
  89. package/dist/runtime/Recipe.js +16 -12
  90. package/dist/runtime/Recipe.js.map +1 -1
  91. package/dist/unplugin/index.d.ts.map +1 -1
  92. package/dist/unplugin/index.js +3 -6
  93. package/dist/unplugin/index.js.map +1 -1
  94. package/dist/vite/index.d.ts.map +1 -1
  95. package/dist/vite/index.js +696 -201
  96. package/dist/vite/index.js.map +1 -1
  97. package/dist/web/Css.d.ts +8 -3
  98. package/dist/web/Css.d.ts.map +1 -1
  99. package/dist/web/Css.js +5 -721
  100. package/dist/web/Css.js.map +1 -1
  101. package/dist/web/internal/Block.d.ts +0 -2
  102. package/dist/web/internal/Block.d.ts.map +1 -1
  103. package/dist/web/internal/Block.js +1 -12
  104. package/dist/web/internal/Block.js.map +1 -1
  105. package/dist/web/internal/ClassName.d.ts +23 -18
  106. package/dist/web/internal/ClassName.d.ts.map +1 -1
  107. package/dist/web/internal/ClassName.js +26 -55
  108. package/dist/web/internal/ClassName.js.map +1 -1
  109. package/dist/web/internal/Contributions.d.ts +3 -5
  110. package/dist/web/internal/Contributions.d.ts.map +1 -1
  111. package/dist/web/internal/Contributions.js +0 -45
  112. package/dist/web/internal/Contributions.js.map +1 -1
  113. package/dist/web/internal/Engine.browser.d.ts +8 -0
  114. package/dist/web/internal/Engine.browser.d.ts.map +1 -0
  115. package/dist/web/internal/Engine.browser.js +42 -0
  116. package/dist/web/internal/Engine.browser.js.map +1 -0
  117. package/dist/web/internal/Engine.d.ts +9 -0
  118. package/dist/web/internal/Engine.d.ts.map +1 -0
  119. package/dist/web/internal/Engine.js +14 -0
  120. package/dist/web/internal/Engine.js.map +1 -0
  121. package/dist/web/internal/Themes.d.ts +1 -9
  122. package/dist/web/internal/Themes.d.ts.map +1 -1
  123. package/dist/web/internal/Themes.js +3 -221
  124. package/dist/web/internal/Themes.js.map +1 -1
  125. package/dist/web/internal/Wasm.generated.d.ts +4 -0
  126. package/dist/web/internal/Wasm.generated.d.ts.map +1 -0
  127. package/dist/web/internal/Wasm.generated.js +4 -0
  128. package/dist/web/internal/Wasm.generated.js.map +1 -0
  129. package/dist/web/internal/Wire.d.ts +19 -0
  130. package/dist/web/internal/Wire.d.ts.map +1 -0
  131. package/dist/web/internal/Wire.js +387 -0
  132. package/dist/web/internal/Wire.js.map +1 -0
  133. package/package.json +20 -1
  134. package/src/babel/index.ts +2 -5
  135. package/src/babel/internal/Compilation.ts +0 -1
  136. package/src/compiler/Graph.ts +89 -1930
  137. package/src/compiler/Native.ts +18 -871
  138. package/src/compiler/Source.ts +144 -1803
  139. package/src/compiler/Transform.ts +16 -1315
  140. package/src/compiler/internal/AtRules.ts +27 -115
  141. package/src/compiler/internal/Context.ts +11 -0
  142. package/src/compiler/internal/Results.ts +406 -0
  143. package/src/compiler/internal/Syntax.ts +0 -3
  144. package/src/compiler/internal/Wire.ts +1045 -0
  145. package/src/internal/Addon.ts +118 -0
  146. package/src/internal/Literal.ts +4 -2
  147. package/src/internal/Token.ts +2 -2
  148. package/src/internal/Vlq.ts +59 -0
  149. package/src/internal/Wasm.ts +111 -0
  150. package/src/metro/transformer.ts +0 -1
  151. package/src/next/internal/Project.ts +2 -9
  152. package/src/node/Host.ts +0 -2
  153. package/src/node/internal/Contracts.ts +3 -7
  154. package/src/node/internal/Snapshot.ts +0 -8
  155. package/src/runtime/Composition.ts +48 -25
  156. package/src/runtime/Recipe.ts +21 -14
  157. package/src/unplugin/index.ts +6 -6
  158. package/src/vite/index.ts +922 -221
  159. package/src/web/Css.ts +12 -908
  160. package/src/web/internal/Block.ts +0 -14
  161. package/src/web/internal/ClassName.ts +52 -85
  162. package/src/web/internal/Contributions.ts +3 -59
  163. package/src/web/internal/Engine.browser.ts +51 -0
  164. package/src/web/internal/Engine.ts +17 -0
  165. package/src/web/internal/Themes.ts +3 -279
  166. package/src/web/internal/Wasm.generated.ts +3 -0
  167. package/src/web/internal/Wire.ts +466 -0
  168. package/src/web/internal/wasm.d.ts +9 -0
  169. package/dist/compiler/internal/Applications.d.ts +0 -55
  170. package/dist/compiler/internal/Applications.d.ts.map +0 -1
  171. package/dist/compiler/internal/Applications.js +0 -393
  172. package/dist/compiler/internal/Applications.js.map +0 -1
  173. package/dist/compiler/internal/ColorProfiles.d.ts +0 -3
  174. package/dist/compiler/internal/ColorProfiles.d.ts.map +0 -1
  175. package/dist/compiler/internal/ColorProfiles.js +0 -84
  176. package/dist/compiler/internal/ColorProfiles.js.map +0 -1
  177. package/dist/compiler/internal/CompositionBindings.d.ts +0 -16
  178. package/dist/compiler/internal/CompositionBindings.d.ts.map +0 -1
  179. package/dist/compiler/internal/CompositionBindings.js +0 -89
  180. package/dist/compiler/internal/CompositionBindings.js.map +0 -1
  181. package/dist/compiler/internal/Compositions.d.ts +0 -37
  182. package/dist/compiler/internal/Compositions.d.ts.map +0 -1
  183. package/dist/compiler/internal/Compositions.js +0 -494
  184. package/dist/compiler/internal/Compositions.js.map +0 -1
  185. package/dist/compiler/internal/Configurations.d.ts +0 -26
  186. package/dist/compiler/internal/Configurations.d.ts.map +0 -1
  187. package/dist/compiler/internal/Configurations.js +0 -259
  188. package/dist/compiler/internal/Configurations.js.map +0 -1
  189. package/dist/compiler/internal/Contract.d.ts +0 -30
  190. package/dist/compiler/internal/Contract.d.ts.map +0 -1
  191. package/dist/compiler/internal/Contract.js +0 -753
  192. package/dist/compiler/internal/Contract.js.map +0 -1
  193. package/dist/compiler/internal/Contributions.d.ts +0 -54
  194. package/dist/compiler/internal/Contributions.d.ts.map +0 -1
  195. package/dist/compiler/internal/Contributions.js +0 -1151
  196. package/dist/compiler/internal/Contributions.js.map +0 -1
  197. package/dist/compiler/internal/Descriptors.d.ts +0 -15
  198. package/dist/compiler/internal/Descriptors.d.ts.map +0 -1
  199. package/dist/compiler/internal/Descriptors.js +0 -192
  200. package/dist/compiler/internal/Descriptors.js.map +0 -1
  201. package/dist/compiler/internal/Dynamic.d.ts +0 -14
  202. package/dist/compiler/internal/Dynamic.d.ts.map +0 -1
  203. package/dist/compiler/internal/Dynamic.js +0 -175
  204. package/dist/compiler/internal/Dynamic.js.map +0 -1
  205. package/dist/compiler/internal/Expression.d.ts +0 -19
  206. package/dist/compiler/internal/Expression.d.ts.map +0 -1
  207. package/dist/compiler/internal/Expression.js +0 -164
  208. package/dist/compiler/internal/Expression.js.map +0 -1
  209. package/dist/compiler/internal/Functions.d.ts +0 -5
  210. package/dist/compiler/internal/Functions.d.ts.map +0 -1
  211. package/dist/compiler/internal/Functions.js +0 -191
  212. package/dist/compiler/internal/Functions.js.map +0 -1
  213. package/dist/compiler/internal/Keyframes.d.ts +0 -5
  214. package/dist/compiler/internal/Keyframes.d.ts.map +0 -1
  215. package/dist/compiler/internal/Keyframes.js +0 -51
  216. package/dist/compiler/internal/Keyframes.js.map +0 -1
  217. package/dist/compiler/internal/Names.d.ts +0 -5
  218. package/dist/compiler/internal/Names.d.ts.map +0 -1
  219. package/dist/compiler/internal/Names.js +0 -37
  220. package/dist/compiler/internal/Names.js.map +0 -1
  221. package/dist/compiler/internal/NativeBindings.d.ts +0 -72
  222. package/dist/compiler/internal/NativeBindings.d.ts.map +0 -1
  223. package/dist/compiler/internal/NativeBindings.js +0 -171
  224. package/dist/compiler/internal/NativeBindings.js.map +0 -1
  225. package/dist/compiler/internal/NativeMedia.d.ts +0 -14
  226. package/dist/compiler/internal/NativeMedia.d.ts.map +0 -1
  227. package/dist/compiler/internal/NativeMedia.js +0 -287
  228. package/dist/compiler/internal/NativeMedia.js.map +0 -1
  229. package/dist/compiler/internal/NativeVars.d.ts +0 -28
  230. package/dist/compiler/internal/NativeVars.d.ts.map +0 -1
  231. package/dist/compiler/internal/NativeVars.js +0 -160
  232. package/dist/compiler/internal/NativeVars.js.map +0 -1
  233. package/dist/compiler/internal/PackedStyles.d.ts +0 -37
  234. package/dist/compiler/internal/PackedStyles.d.ts.map +0 -1
  235. package/dist/compiler/internal/PackedStyles.js +0 -344
  236. package/dist/compiler/internal/PackedStyles.js.map +0 -1
  237. package/dist/compiler/internal/Properties.d.ts +0 -5
  238. package/dist/compiler/internal/Properties.d.ts.map +0 -1
  239. package/dist/compiler/internal/Properties.js +0 -82
  240. package/dist/compiler/internal/Properties.js.map +0 -1
  241. package/dist/compiler/internal/RecipeConditions.d.ts +0 -41
  242. package/dist/compiler/internal/RecipeConditions.d.ts.map +0 -1
  243. package/dist/compiler/internal/RecipeConditions.js +0 -82
  244. package/dist/compiler/internal/RecipeConditions.js.map +0 -1
  245. package/dist/compiler/internal/RecipePayloads.d.ts +0 -31
  246. package/dist/compiler/internal/RecipePayloads.d.ts.map +0 -1
  247. package/dist/compiler/internal/RecipePayloads.js +0 -99
  248. package/dist/compiler/internal/RecipePayloads.js.map +0 -1
  249. package/dist/compiler/internal/Recipes.d.ts +0 -32
  250. package/dist/compiler/internal/Recipes.d.ts.map +0 -1
  251. package/dist/compiler/internal/Recipes.js +0 -339
  252. package/dist/compiler/internal/Recipes.js.map +0 -1
  253. package/dist/compiler/internal/Selectors.d.ts +0 -13
  254. package/dist/compiler/internal/Selectors.d.ts.map +0 -1
  255. package/dist/compiler/internal/Selectors.js +0 -280
  256. package/dist/compiler/internal/Selectors.js.map +0 -1
  257. package/dist/compiler/internal/Static.d.ts +0 -39
  258. package/dist/compiler/internal/Static.d.ts.map +0 -1
  259. package/dist/compiler/internal/Static.js +0 -534
  260. package/dist/compiler/internal/Static.js.map +0 -1
  261. package/dist/compiler/internal/Themes.d.ts +0 -190
  262. package/dist/compiler/internal/Themes.d.ts.map +0 -1
  263. package/dist/compiler/internal/Themes.js +0 -1577
  264. package/dist/compiler/internal/Themes.js.map +0 -1
  265. package/dist/compiler/internal/Vars.d.ts +0 -33
  266. package/dist/compiler/internal/Vars.d.ts.map +0 -1
  267. package/dist/compiler/internal/Vars.js +0 -387
  268. package/dist/compiler/internal/Vars.js.map +0 -1
  269. package/dist/compiler/internal/ViewTransitions.d.ts +0 -3
  270. package/dist/compiler/internal/ViewTransitions.d.ts.map +0 -1
  271. package/dist/compiler/internal/ViewTransitions.js +0 -68
  272. package/dist/compiler/internal/ViewTransitions.js.map +0 -1
  273. package/dist/internal/Cascade.d.ts +0 -74
  274. package/dist/internal/Cascade.d.ts.map +0 -1
  275. package/dist/internal/Cascade.js +0 -210
  276. package/dist/internal/Cascade.js.map +0 -1
  277. package/src/compiler/internal/Applications.ts +0 -610
  278. package/src/compiler/internal/ColorProfiles.ts +0 -93
  279. package/src/compiler/internal/CompositionBindings.ts +0 -120
  280. package/src/compiler/internal/Compositions.ts +0 -678
  281. package/src/compiler/internal/Configurations.ts +0 -349
  282. package/src/compiler/internal/Contract.ts +0 -1028
  283. package/src/compiler/internal/Contributions.ts +0 -1561
  284. package/src/compiler/internal/Descriptors.ts +0 -242
  285. package/src/compiler/internal/Dynamic.ts +0 -275
  286. package/src/compiler/internal/Expression.ts +0 -218
  287. package/src/compiler/internal/Functions.ts +0 -206
  288. package/src/compiler/internal/Keyframes.ts +0 -62
  289. package/src/compiler/internal/Names.ts +0 -48
  290. package/src/compiler/internal/NativeBindings.ts +0 -235
  291. package/src/compiler/internal/NativeMedia.ts +0 -342
  292. package/src/compiler/internal/NativeVars.ts +0 -231
  293. package/src/compiler/internal/PackedStyles.ts +0 -473
  294. package/src/compiler/internal/Properties.ts +0 -121
  295. package/src/compiler/internal/RecipeConditions.ts +0 -139
  296. package/src/compiler/internal/RecipePayloads.ts +0 -132
  297. package/src/compiler/internal/Recipes.ts +0 -531
  298. package/src/compiler/internal/Selectors.ts +0 -353
  299. package/src/compiler/internal/Static.ts +0 -784
  300. package/src/compiler/internal/Themes.ts +0 -2398
  301. package/src/compiler/internal/Vars.ts +0 -516
  302. package/src/compiler/internal/ViewTransitions.ts +0 -82
@@ -1,259 +0,0 @@
1
- /**
2
- * Normalizes literal configuration syntax into linked theme members.
3
- * @module
4
- */
5
- import * as Identity from '../../internal/Identity.js';
6
- import * as Config from '../../internal/Configuration.js';
7
- import * as PublicConfig from '../../Config.js';
8
- import * as Shorthands from '../../internal/Shorthands.js';
9
- import * as Token from '../../internal/Token.js';
10
- import * as Theme from '../../internal/Theme.js';
11
- import * as VariableSets from '../../internal/VariableSets.js';
12
- import * as Vars from '../../Vars.js';
13
- /** Reads a direct configuration factory without executing authored expressions. */
14
- export function collect(options) {
15
- function data(node) {
16
- const linked = options.resolve(node);
17
- if (linked?.kind === 'theme' ||
18
- (linked?.call.variableConfig && linked.call.selection))
19
- return linked.definition[Token.definition].contract.variableSet
20
- ? VariableSets.from(linked.definition[Token.definition])
21
- : linked.definition;
22
- if (node.type === 'TSAsExpression' || node.type === 'TSSatisfiesExpression')
23
- return data(node.expression);
24
- if (node.type === 'Literal' && node.value === false)
25
- return false;
26
- if (node.type === 'ArrayExpression')
27
- return node.elements.map((node) => {
28
- if (!node || node.type === 'SpreadElement')
29
- throw new Config.InvalidError('Configuration arrays require literal entries.');
30
- return data(node);
31
- });
32
- if (node.type === 'ObjectExpression') {
33
- const entries = Object.create(null);
34
- for (const property of node.properties) {
35
- if (property.type !== 'Property' ||
36
- property.computed ||
37
- property.method ||
38
- property.kind !== 'init')
39
- throw new Config.InvalidError('Configuration requires static properties without spreads or methods.');
40
- const key = (() => {
41
- if (property.key.type === 'Identifier') {
42
- return property.key.name;
43
- }
44
- if (property.key.type === 'Literal' &&
45
- (typeof property.key.value === 'string' ||
46
- typeof property.key.value === 'number')) {
47
- return String(property.key.value);
48
- }
49
- return undefined;
50
- })();
51
- if (key === undefined || Object.hasOwn(entries, key))
52
- throw new Config.InvalidError('Configuration requires unique literal keys.');
53
- entries[key] = data(property.value);
54
- }
55
- return entries;
56
- }
57
- return options.data(node);
58
- }
59
- if (options.expression.arguments.length > 1)
60
- throw new Config.InvalidError('Config.create accepts one literal options object.');
61
- let input = (options.expression.arguments.length
62
- ? data(options.expression.arguments[0])
63
- : {});
64
- PublicConfig.create(input);
65
- const authored = input;
66
- const variableMode = authored.vars !== undefined;
67
- if (variableMode) {
68
- Config.create(authored);
69
- const wrap = (value) => VariableSets.theme(Token.definition in value
70
- ? value
71
- : Vars.define(value), authored.mappings);
72
- const { vars, defaultVars, mappings: _mappings, ...rest } = authored;
73
- input =
74
- defaultVars === undefined
75
- ? { ...rest, theme: wrap(vars) }
76
- : {
77
- ...rest,
78
- defaultTheme: defaultVars,
79
- themes: Object.fromEntries(Object.entries(vars).map(([key, value]) => [
80
- key,
81
- wrap(value),
82
- ])),
83
- };
84
- }
85
- const config = Config.create(input);
86
- const catalog = (() => {
87
- if ('themes' in config) {
88
- return config.themes;
89
- }
90
- if ('theme' in config) {
91
- return { theme: config.theme };
92
- }
93
- return {};
94
- })();
95
- const identity = input.id === undefined
96
- ? options.name
97
- : Identity.requireId(input.id, 'Config.create');
98
- const contract = Object.freeze({
99
- ...(variableMode
100
- ? {
101
- variableSet: true,
102
- mappings: VariableSets.mappings(authored.mappings),
103
- }
104
- : {}),
105
- [Token.identity]: identity,
106
- ...(input.id !== undefined ? { [Token.complete]: true } : {}),
107
- ...(input.composition !== undefined
108
- ? { composition: input.composition }
109
- : {}),
110
- cssOutput: input.cssOutput ?? 'atomic',
111
- ...(input.defaultLayer !== undefined
112
- ? { defaultLayer: input.defaultLayer }
113
- : {}),
114
- ...(input.shorthands
115
- ? { shorthands: Shorthands.read(input.shorthands) }
116
- : {}),
117
- });
118
- const members = Object.create(null);
119
- for (const [key, original] of Object.entries(catalog)) {
120
- const name = `${identity}-${key}`;
121
- const definition = Token.bind(original, contract, key);
122
- const tokenType = type({
123
- ...values(original.tokens),
124
- ...original[Token.definition].queries,
125
- });
126
- const call = {
127
- ...(input.output === 'html' ? { output: 'html' } : {}),
128
- end: options.expression.end,
129
- name,
130
- start: options.expression.start,
131
- tokenType,
132
- ...(input.output === 'html' || input.shorthands
133
- ? {
134
- type: `import('zyzz').Config.create.ReturnType<{theme:${tokenType};${input.output === 'html' ? "output:'html';" : ''}shorthands:${type(input.shorthands ?? {})}}>['theme']`,
135
- }
136
- : {}),
137
- };
138
- members[JSON.stringify('themes' in config ? ['themes', key] : ['theme'])] =
139
- {
140
- binding: name,
141
- call,
142
- definition,
143
- kind: 'theme',
144
- };
145
- }
146
- const selected = members[JSON.stringify('themes' in config ? ['themes', input.defaultTheme] : ['theme'])];
147
- if ('themes' in config && selected)
148
- members[JSON.stringify(['theme'])] = selected;
149
- if (variableMode && selected)
150
- members[JSON.stringify(['vars'])] = {
151
- ...selected,
152
- call: {
153
- ...selected.call,
154
- directVariables: true,
155
- type: `import('zyzz').Vars.References<${selected.call.tokenType}>`,
156
- },
157
- };
158
- const definition = selected?.definition ?? Token.bind(Theme.define({}), contract);
159
- const normalized = {
160
- ...(() => {
161
- if ('themes' in config) {
162
- return {
163
- defaultTheme: input.defaultTheme,
164
- themes: Object.fromEntries(Object.keys(catalog).map((name) => {
165
- const theme = members[JSON.stringify(['themes', name])].definition;
166
- return [
167
- name,
168
- { ...values(theme.tokens), ...theme[Token.definition].queries },
169
- ];
170
- })),
171
- };
172
- }
173
- if ('theme' in config) {
174
- return {
175
- theme: {
176
- ...values(definition.tokens),
177
- ...definition[Token.definition].queries,
178
- },
179
- };
180
- }
181
- return {};
182
- })(),
183
- ...(input.id !== undefined ? { id: input.id } : {}),
184
- ...(input.composition ? { composition: input.composition } : {}),
185
- ...(input.cssOutput ? { cssOutput: input.cssOutput } : {}),
186
- ...(input.defaultLayer !== undefined
187
- ? { defaultLayer: input.defaultLayer }
188
- : {}),
189
- ...(input.shorthands ? { shorthands: input.shorthands } : {}),
190
- ...(input.output ? { output: input.output } : {}),
191
- ...(input.layers ? { layers: input.layers } : {}),
192
- ...(input.storageKey ? { storageKey: input.storageKey } : {}),
193
- };
194
- const authoredType = type(variableMode
195
- ? {
196
- ...normalized,
197
- theme: undefined,
198
- themes: undefined,
199
- defaultTheme: undefined,
200
- vars: 'themes' in normalized ? normalized.themes : normalized.theme,
201
- ...('themes' in normalized
202
- ? { defaultVars: normalized.defaultTheme }
203
- : {}),
204
- ...(authored.mappings !== undefined
205
- ? { mappings: VariableSets.mappings(authored.mappings) }
206
- : {}),
207
- }
208
- : normalized);
209
- return {
210
- binding: options.name,
211
- call: {
212
- ...(options.nativeProvider ? { nativeProvider: true } : {}),
213
- ...(variableMode
214
- ? { variableConfig: true, variableMappings: authored.mappings }
215
- : {}),
216
- appearance: true,
217
- script: true,
218
- end: options.expression.end,
219
- members: Object.fromEntries(Object.entries(members).map(([key, link]) => [key, link.call.name])),
220
- name: selected?.call.name ?? options.name,
221
- options: normalized,
222
- start: options.expression.start,
223
- tokenType: selected?.call.tokenType ?? '{}',
224
- type: options.nativeProvider
225
- ? `import('zyzz/react-native').defineConfig.ReturnType<${authoredType}>`
226
- : variableMode
227
- ? `import('zyzz').Config.VariableConfig<${authoredType}>`
228
- : `import('zyzz').Config.create.ReturnType<${authoredType}>`,
229
- },
230
- definition,
231
- kind: 'config',
232
- members,
233
- };
234
- }
235
- /** Encodes validated literal options as a declaration type, never executable text. */
236
- export function type(value) {
237
- if (Token.isExpression(value) && 'group' in value)
238
- return `import('zyzz').Vars.Composition<'${value.group}'>`;
239
- if (Token.is(value))
240
- return `import('zyzz').Vars.Reference<'${value.group}'>`;
241
- if (Array.isArray(value))
242
- return `readonly [${value.map(type).join(',')}]`;
243
- if (!value || typeof value !== 'object')
244
- return JSON.stringify(value);
245
- return `{${Object.entries(value)
246
- .filter(([, value]) => value !== undefined)
247
- .map(([key, value]) => `readonly ${JSON.stringify(key)}:${type(value)}`)
248
- .join(';')}}`;
249
- }
250
- /** Reads the authored leaf values of a reference tree. */
251
- export function values(tree) {
252
- return Object.fromEntries(Object.entries(tree).map(([key, value]) => [
253
- key,
254
- Token.is(value)
255
- ? value.value
256
- : values(value),
257
- ]));
258
- }
259
- //# sourceMappingURL=Configurations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Configurations.js","sourceRoot":"","sources":["../../../src/compiler/internal/Configurations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAA;AAEtD,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAA;AACzD,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA;AAChD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AAGrC,mFAAmF;AACnF,MAAM,UAAU,OAAO,CAAC,OAAwB;IAC9C,SAAS,IAAI,CAAC,IAAc;QAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACpC,IACE,MAAM,EAAE,IAAI,KAAK,OAAO;YACxB,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;YAEtD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,WAAW;gBAC7D,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;gBACxD,CAAC,CAAC,MAAM,CAAC,UAAU,CAAA;QAEvB,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAAI,IAAI,CA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,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,MAAM,CACpB,IAAoC;IAEpC,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACzC,GAAG;QACH,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC;YACb,CAAC,CAAC,KAAK,CAAC,KAAK;YACb,CAAC,CAAC,MAAM,CAAC,KAAuC,CAAC;KACpD,CAAC,CACH,CAAA;AACH,CAAC"}
@@ -1,30 +0,0 @@
1
- import * as Stylesheets from './Stylesheets.js';
2
- import * as Theme from '../../internal/Theme.js';
3
- import type * as Themes from './Themes.js';
4
- import * as Token from '../../internal/Token.js';
5
- /** Reads versioned JSON as validated data; never evaluates package code. */
6
- export declare function read(source: string, identities: Map<string, Token.Contract>, moduleId?: string): {
7
- classRules: {
8
- [k: string]: string;
9
- };
10
- links: {
11
- [k: string]: Themes.Link;
12
- };
13
- themes: Record<string, Theme.Definition<Theme.Tokens, Theme.StyleFactory<Theme.Tokens>, import("../../variants.js").variants.Bound<Theme.Tokens, "react", never, {}>>>;
14
- stylesheets: readonly Stylesheets.Section[];
15
- };
16
- /** Emits compiler-only metadata without adding it to the runtime module. */
17
- export declare function write(links: Readonly<Record<string, Themes.Link>>, themes: Readonly<Record<string, Theme.Definition>>, stylesheets?: readonly Stylesheets.Section[], moduleId?: string, configurations?: readonly write.Configuration[], classRules?: Readonly<Record<string, string>>): string;
18
- /** Contract writer contracts. */
19
- export declare namespace write {
20
- /** Catalog of one configuration call, published whether or not the call is exported. */
21
- type Configuration = {
22
- /** Configuration identity that prefixes every theme scope key. */
23
- readonly identity: string;
24
- /** localStorage key the configuration's script and root controls share. */
25
- readonly storageKey?: string | undefined;
26
- /** Named theme keys of the configuration's catalog. */
27
- readonly themes: readonly string[];
28
- };
29
- }
30
- //# sourceMappingURL=Contract.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../../src/compiler/internal/Contract.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA;AAGhD,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA;AAEhD,4EAA4E;AAC5E,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,EACvC,QAAQ,SAAK;;;;;;;;;EAmpBd;AA0CD,4EAA4E;AAC5E,wBAAgB,KAAK,CACnB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAC5C,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,EAClD,WAAW,GAAE,SAAS,WAAW,CAAC,OAAO,EAAO,EAChD,QAAQ,SAAK,EACb,cAAc,GAAE,SAAS,KAAK,CAAC,aAAa,EAAO,EACnD,UAAU,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GAChD,MAAM,CA0LR;AAED,iCAAiC;AACjC,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,wFAAwF;IACxF,KAAK,aAAa,GAAG;QACnB,kEAAkE;QAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,2EAA2E;QAC3E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QACxC,uDAAuD;QACvD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;KACnC,CAAA;CACF"}