@velarscript/web 0.31.0 → 0.32.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.
Files changed (385) hide show
  1. package/README.md +1 -1
  2. package/dist/analysis/calls/intrinsics/config.d.ts +10 -0
  3. package/dist/analysis/calls/intrinsics/config.d.ts.map +1 -0
  4. package/dist/analysis/calls/intrinsics/config.js +19 -0
  5. package/dist/analysis/calls/intrinsics/config.js.map +1 -0
  6. package/dist/analysis/calls/intrinsics/forms.d.ts +10 -0
  7. package/dist/analysis/calls/intrinsics/forms.d.ts.map +1 -0
  8. package/dist/analysis/calls/intrinsics/forms.js +38 -0
  9. package/dist/analysis/calls/intrinsics/forms.js.map +1 -0
  10. package/dist/analysis/calls/intrinsics/http.d.ts +10 -0
  11. package/dist/analysis/calls/intrinsics/http.d.ts.map +1 -0
  12. package/dist/analysis/calls/intrinsics/http.js +37 -0
  13. package/dist/analysis/calls/intrinsics/http.js.map +1 -0
  14. package/dist/analysis/calls/intrinsics/reactive.d.ts +10 -0
  15. package/dist/analysis/calls/intrinsics/reactive.d.ts.map +1 -0
  16. package/dist/analysis/calls/intrinsics/reactive.js +30 -0
  17. package/dist/analysis/calls/intrinsics/reactive.js.map +1 -0
  18. package/dist/analysis/calls/intrinsics/storage.d.ts +12 -0
  19. package/dist/analysis/calls/intrinsics/storage.d.ts.map +1 -0
  20. package/dist/analysis/calls/intrinsics/storage.js +86 -0
  21. package/dist/analysis/calls/intrinsics/storage.js.map +1 -0
  22. package/dist/analysis/calls/intrinsics/web.d.ts +10 -0
  23. package/dist/analysis/calls/intrinsics/web.d.ts.map +1 -0
  24. package/dist/analysis/calls/intrinsics/web.js +100 -0
  25. package/dist/analysis/calls/intrinsics/web.js.map +1 -0
  26. package/dist/analysis/calls/intrinsics.d.ts +13 -0
  27. package/dist/analysis/calls/intrinsics.d.ts.map +1 -0
  28. package/dist/analysis/calls/intrinsics.js +31 -0
  29. package/dist/analysis/calls/intrinsics.js.map +1 -0
  30. package/dist/analysis/components/contracts.d.ts +19 -0
  31. package/dist/analysis/components/contracts.d.ts.map +1 -0
  32. package/dist/analysis/components/contracts.js +83 -0
  33. package/dist/analysis/components/contracts.js.map +1 -0
  34. package/dist/analysis/components/declaration.d.ts +4 -0
  35. package/dist/analysis/components/declaration.d.ts.map +1 -0
  36. package/dist/analysis/components/declaration.js +163 -0
  37. package/dist/analysis/components/declaration.js.map +1 -0
  38. package/dist/analysis/components/host.d.ts +61 -0
  39. package/dist/analysis/components/host.d.ts.map +1 -0
  40. package/dist/analysis/components/host.js +22 -0
  41. package/dist/analysis/components/host.js.map +1 -0
  42. package/dist/analysis/components/lifecycle.d.ts +22 -0
  43. package/dist/analysis/components/lifecycle.d.ts.map +1 -0
  44. package/dist/analysis/components/lifecycle.js +33 -0
  45. package/dist/analysis/components/lifecycle.js.map +1 -0
  46. package/dist/analysis/components/ownership.d.ts +74 -0
  47. package/dist/analysis/components/ownership.d.ts.map +1 -0
  48. package/dist/analysis/components/ownership.js +106 -0
  49. package/dist/analysis/components/ownership.js.map +1 -0
  50. package/dist/analysis/declarations.d.ts +99 -0
  51. package/dist/analysis/declarations.d.ts.map +1 -0
  52. package/dist/analysis/declarations.js +176 -0
  53. package/dist/analysis/declarations.js.map +1 -0
  54. package/dist/analysis/inference.d.ts +67 -0
  55. package/dist/analysis/inference.d.ts.map +1 -0
  56. package/dist/analysis/inference.js +236 -0
  57. package/dist/analysis/inference.js.map +1 -0
  58. package/dist/analysis/jsx/attributes.d.ts +103 -0
  59. package/dist/analysis/jsx/attributes.d.ts.map +1 -0
  60. package/dist/analysis/jsx/attributes.js +601 -0
  61. package/dist/analysis/jsx/attributes.js.map +1 -0
  62. package/dist/analysis/jsx/elements.d.ts +17 -0
  63. package/dist/analysis/jsx/elements.d.ts.map +1 -0
  64. package/dist/analysis/jsx/elements.js +213 -0
  65. package/dist/analysis/jsx/elements.js.map +1 -0
  66. package/dist/analysis/jsx/host.d.ts +61 -0
  67. package/dist/analysis/jsx/host.d.ts.map +1 -0
  68. package/dist/analysis/jsx/host.js +15 -0
  69. package/dist/analysis/jsx/host.js.map +1 -0
  70. package/dist/analysis/jsx/keys.d.ts +15 -0
  71. package/dist/analysis/jsx/keys.d.ts.map +1 -0
  72. package/dist/analysis/jsx/keys.js +67 -0
  73. package/dist/analysis/jsx/keys.js.map +1 -0
  74. package/dist/analysis/jsx/security.d.ts +29 -0
  75. package/dist/analysis/jsx/security.d.ts.map +1 -0
  76. package/dist/analysis/jsx/security.js +61 -0
  77. package/dist/analysis/jsx/security.js.map +1 -0
  78. package/dist/analysis/jsx-detection.d.ts +49 -0
  79. package/dist/analysis/jsx-detection.d.ts.map +1 -0
  80. package/dist/analysis/jsx-detection.js +196 -0
  81. package/dist/analysis/jsx-detection.js.map +1 -0
  82. package/dist/analysis/keyed-rebuild.d.ts +148 -0
  83. package/dist/analysis/keyed-rebuild.d.ts.map +1 -0
  84. package/dist/analysis/keyed-rebuild.js +299 -0
  85. package/dist/analysis/keyed-rebuild.js.map +1 -0
  86. package/dist/analysis/keyframes-analysis.d.ts +6 -0
  87. package/dist/analysis/keyframes-analysis.d.ts.map +1 -0
  88. package/dist/analysis/keyframes-analysis.js +79 -0
  89. package/dist/analysis/keyframes-analysis.js.map +1 -0
  90. package/dist/analysis/look/builders.d.ts +29 -0
  91. package/dist/analysis/look/builders.d.ts.map +1 -0
  92. package/dist/analysis/look/builders.js +168 -0
  93. package/dist/analysis/look/builders.js.map +1 -0
  94. package/dist/analysis/look/conditions.d.ts +13 -0
  95. package/dist/analysis/look/conditions.d.ts.map +1 -0
  96. package/dist/analysis/look/conditions.js +84 -0
  97. package/dist/analysis/look/conditions.js.map +1 -0
  98. package/dist/analysis/look/edits.d.ts +25 -0
  99. package/dist/analysis/look/edits.d.ts.map +1 -0
  100. package/dist/analysis/look/edits.js +57 -0
  101. package/dist/analysis/look/edits.js.map +1 -0
  102. package/dist/analysis/look/entries.d.ts +56 -0
  103. package/dist/analysis/look/entries.d.ts.map +1 -0
  104. package/dist/analysis/look/entries.js +223 -0
  105. package/dist/analysis/look/entries.js.map +1 -0
  106. package/dist/analysis/look/host.d.ts +47 -0
  107. package/dist/analysis/look/host.d.ts.map +1 -0
  108. package/dist/analysis/look/host.js +16 -0
  109. package/dist/analysis/look/host.js.map +1 -0
  110. package/dist/analysis/look/tokens.d.ts +75 -0
  111. package/dist/analysis/look/tokens.d.ts.map +1 -0
  112. package/dist/analysis/look/tokens.js +151 -0
  113. package/dist/analysis/look/tokens.js.map +1 -0
  114. package/dist/analysis/look/values.d.ts +45 -0
  115. package/dist/analysis/look/values.d.ts.map +1 -0
  116. package/dist/analysis/look/values.js +148 -0
  117. package/dist/analysis/look/values.js.map +1 -0
  118. package/dist/analysis/look-conditions.d.ts +47 -0
  119. package/dist/analysis/look-conditions.d.ts.map +1 -0
  120. package/dist/analysis/look-conditions.js +157 -0
  121. package/dist/analysis/look-conditions.js.map +1 -0
  122. package/dist/analysis/look-sites.d.ts +54 -0
  123. package/dist/analysis/look-sites.d.ts.map +1 -0
  124. package/dist/analysis/look-sites.js +104 -0
  125. package/dist/analysis/look-sites.js.map +1 -0
  126. package/dist/analysis/look-vocabulary-guidance.d.ts +76 -0
  127. package/dist/analysis/look-vocabulary-guidance.d.ts.map +1 -0
  128. package/dist/analysis/look-vocabulary-guidance.js +338 -0
  129. package/dist/analysis/look-vocabulary-guidance.js.map +1 -0
  130. package/dist/analysis/media-conditions.d.ts +33 -0
  131. package/dist/analysis/media-conditions.d.ts.map +1 -0
  132. package/dist/analysis/media-conditions.js +92 -0
  133. package/dist/analysis/media-conditions.js.map +1 -0
  134. package/dist/analysis/program-passes.d.ts +106 -0
  135. package/dist/analysis/program-passes.d.ts.map +1 -0
  136. package/dist/analysis/program-passes.js +149 -0
  137. package/dist/analysis/program-passes.js.map +1 -0
  138. package/dist/analysis/reactivity/bindings.d.ts +37 -0
  139. package/dist/analysis/reactivity/bindings.d.ts.map +1 -0
  140. package/dist/analysis/reactivity/bindings.js +88 -0
  141. package/dist/analysis/reactivity/bindings.js.map +1 -0
  142. package/dist/analysis/reactivity/derived.d.ts +39 -0
  143. package/dist/analysis/reactivity/derived.d.ts.map +1 -0
  144. package/dist/analysis/reactivity/derived.js +80 -0
  145. package/dist/analysis/reactivity/derived.js.map +1 -0
  146. package/dist/analysis/reactivity/host.d.ts +38 -0
  147. package/dist/analysis/reactivity/host.d.ts.map +1 -0
  148. package/dist/analysis/reactivity/host.js +14 -0
  149. package/dist/analysis/reactivity/host.js.map +1 -0
  150. package/dist/analysis/reactivity/retired-accessors.d.ts +82 -0
  151. package/dist/analysis/reactivity/retired-accessors.d.ts.map +1 -0
  152. package/dist/analysis/reactivity/retired-accessors.js +118 -0
  153. package/dist/analysis/reactivity/retired-accessors.js.map +1 -0
  154. package/dist/analysis/renderable.d.ts +47 -0
  155. package/dist/analysis/renderable.d.ts.map +1 -0
  156. package/dist/analysis/renderable.js +105 -0
  157. package/dist/analysis/renderable.js.map +1 -0
  158. package/dist/analysis/routes.d.ts +64 -0
  159. package/dist/analysis/routes.d.ts.map +1 -0
  160. package/dist/analysis/routes.js +182 -0
  161. package/dist/analysis/routes.js.map +1 -0
  162. package/dist/analysis/url-attributes.d.ts +12 -0
  163. package/dist/analysis/url-attributes.d.ts.map +1 -0
  164. package/dist/analysis/url-attributes.js +48 -0
  165. package/dist/analysis/url-attributes.js.map +1 -0
  166. package/dist/analysis/watch-cycles.d.ts +102 -0
  167. package/dist/analysis/watch-cycles.d.ts.map +1 -1
  168. package/dist/analysis/watch-cycles.js +240 -1
  169. package/dist/analysis/watch-cycles.js.map +1 -1
  170. package/dist/analysis/watch-subject.d.ts +45 -0
  171. package/dist/analysis/watch-subject.d.ts.map +1 -0
  172. package/dist/analysis/watch-subject.js +272 -0
  173. package/dist/analysis/watch-subject.js.map +1 -0
  174. package/dist/analysis/web-types.d.ts +27 -0
  175. package/dist/analysis/web-types.d.ts.map +1 -0
  176. package/dist/analysis/web-types.js +170 -0
  177. package/dist/analysis/web-types.js.map +1 -0
  178. package/dist/analyzer.d.ts +18 -617
  179. package/dist/analyzer.d.ts.map +1 -1
  180. package/dist/analyzer.js +208 -4853
  181. package/dist/analyzer.js.map +1 -1
  182. package/dist/compiler.d.ts +20 -0
  183. package/dist/compiler.d.ts.map +1 -1
  184. package/dist/compiler.js +29 -864
  185. package/dist/compiler.js.map +1 -1
  186. package/dist/documentation.d.ts +28 -0
  187. package/dist/documentation.d.ts.map +1 -0
  188. package/dist/documentation.js +67 -0
  189. package/dist/documentation.js.map +1 -0
  190. package/dist/editor/completions.d.ts +12 -0
  191. package/dist/editor/completions.d.ts.map +1 -0
  192. package/dist/editor/completions.js +6 -0
  193. package/dist/editor/completions.js.map +1 -0
  194. package/dist/editor/jsx-completion.d.ts +12 -0
  195. package/dist/editor/jsx-completion.d.ts.map +1 -0
  196. package/dist/editor/jsx-completion.js +137 -0
  197. package/dist/editor/jsx-completion.js.map +1 -0
  198. package/dist/editor/look-completion.d.ts +29 -0
  199. package/dist/editor/look-completion.d.ts.map +1 -0
  200. package/dist/editor/look-completion.js +159 -0
  201. package/dist/editor/look-completion.js.map +1 -0
  202. package/dist/editor.d.ts.map +1 -1
  203. package/dist/editor.js +12 -288
  204. package/dist/editor.js.map +1 -1
  205. package/dist/emit/components.d.ts +33 -0
  206. package/dist/emit/components.d.ts.map +1 -0
  207. package/dist/emit/components.js +135 -0
  208. package/dist/emit/components.js.map +1 -0
  209. package/dist/emit/jsx.d.ts +57 -0
  210. package/dist/emit/jsx.d.ts.map +1 -0
  211. package/dist/emit/jsx.js +384 -0
  212. package/dist/emit/jsx.js.map +1 -0
  213. package/dist/emit/look-css.d.ts +44 -0
  214. package/dist/emit/look-css.d.ts.map +1 -0
  215. package/dist/emit/look-css.js +177 -0
  216. package/dist/emit/look-css.js.map +1 -0
  217. package/dist/emit/look.d.ts +39 -0
  218. package/dist/emit/look.d.ts.map +1 -0
  219. package/dist/emit/look.js +218 -0
  220. package/dist/emit/look.js.map +1 -0
  221. package/dist/emit/runtime-imports.d.ts +40 -0
  222. package/dist/emit/runtime-imports.d.ts.map +1 -0
  223. package/dist/emit/runtime-imports.js +184 -0
  224. package/dist/emit/runtime-imports.js.map +1 -0
  225. package/dist/emitter.d.ts +15 -68
  226. package/dist/emitter.d.ts.map +1 -1
  227. package/dist/emitter.js +79 -1008
  228. package/dist/emitter.js.map +1 -1
  229. package/dist/look/animation.d.ts +7 -0
  230. package/dist/look/animation.d.ts.map +1 -0
  231. package/dist/look/animation.js +13 -0
  232. package/dist/look/animation.js.map +1 -0
  233. package/dist/look/builders.d.ts +35 -0
  234. package/dist/look/builders.d.ts.map +1 -0
  235. package/dist/look/builders.js +74 -0
  236. package/dist/look/builders.js.map +1 -0
  237. package/dist/look/css-functions.d.ts +28 -0
  238. package/dist/look/css-functions.d.ts.map +1 -0
  239. package/dist/look/css-functions.js +54 -0
  240. package/dist/look/css-functions.js.map +1 -0
  241. package/dist/look/keyword-sets.d.ts +41 -0
  242. package/dist/look/keyword-sets.d.ts.map +1 -0
  243. package/dist/look/keyword-sets.js +117 -0
  244. package/dist/look/keyword-sets.js.map +1 -0
  245. package/dist/look/keywords.d.ts +55 -0
  246. package/dist/look/keywords.d.ts.map +1 -0
  247. package/dist/look/keywords.js +387 -0
  248. package/dist/look/keywords.js.map +1 -0
  249. package/dist/look/media.d.ts +19 -0
  250. package/dist/look/media.d.ts.map +1 -0
  251. package/dist/look/media.js +27 -0
  252. package/dist/look/media.js.map +1 -0
  253. package/dist/look/naming.d.ts +9 -0
  254. package/dist/look/naming.d.ts.map +1 -0
  255. package/dist/look/naming.js +45 -0
  256. package/dist/look/naming.js.map +1 -0
  257. package/dist/look/properties.d.ts +16 -0
  258. package/dist/look/properties.d.ts.map +1 -0
  259. package/dist/look/properties.js +52 -0
  260. package/dist/look/properties.js.map +1 -0
  261. package/dist/look/shorthands.d.ts +25 -0
  262. package/dist/look/shorthands.d.ts.map +1 -0
  263. package/dist/look/shorthands.js +130 -0
  264. package/dist/look/shorthands.js.map +1 -0
  265. package/dist/look/tokens.d.ts +38 -0
  266. package/dist/look/tokens.d.ts.map +1 -0
  267. package/dist/look/tokens.js +59 -0
  268. package/dist/look/tokens.js.map +1 -0
  269. package/dist/look/units.d.ts +24 -0
  270. package/dist/look/units.d.ts.map +1 -0
  271. package/dist/look/units.js +33 -0
  272. package/dist/look/units.js.map +1 -0
  273. package/dist/look.d.ts +32 -227
  274. package/dist/look.d.ts.map +1 -1
  275. package/dist/look.js +28 -933
  276. package/dist/look.js.map +1 -1
  277. package/dist/module-roster.d.ts +16 -0
  278. package/dist/module-roster.d.ts.map +1 -0
  279. package/dist/module-roster.js +28 -0
  280. package/dist/module-roster.js.map +1 -0
  281. package/dist/modules/app.d.ts +9 -0
  282. package/dist/modules/app.d.ts.map +1 -0
  283. package/dist/modules/app.js +20 -0
  284. package/dist/modules/app.js.map +1 -0
  285. package/dist/modules/browser-test.d.ts +9 -0
  286. package/dist/modules/browser-test.d.ts.map +1 -0
  287. package/dist/modules/browser-test.js +67 -0
  288. package/dist/modules/browser-test.js.map +1 -0
  289. package/dist/modules/browser.d.ts +10 -0
  290. package/dist/modules/browser.d.ts.map +1 -0
  291. package/dist/modules/browser.js +89 -0
  292. package/dist/modules/browser.js.map +1 -0
  293. package/dist/modules/config.d.ts +9 -0
  294. package/dist/modules/config.d.ts.map +1 -0
  295. package/dist/modules/config.js +14 -0
  296. package/dist/modules/config.js.map +1 -0
  297. package/dist/modules/files.d.ts +9 -0
  298. package/dist/modules/files.d.ts.map +1 -0
  299. package/dist/modules/files.js +16 -0
  300. package/dist/modules/files.js.map +1 -0
  301. package/dist/modules/forms.d.ts +9 -0
  302. package/dist/modules/forms.d.ts.map +1 -0
  303. package/dist/modules/forms.js +26 -0
  304. package/dist/modules/forms.js.map +1 -0
  305. package/dist/modules/http.d.ts +9 -0
  306. package/dist/modules/http.d.ts.map +1 -0
  307. package/dist/modules/http.js +127 -0
  308. package/dist/modules/http.js.map +1 -0
  309. package/dist/modules/look.d.ts +9 -0
  310. package/dist/modules/look.d.ts.map +1 -0
  311. package/dist/modules/look.js +58 -0
  312. package/dist/modules/look.js.map +1 -0
  313. package/dist/modules/realtime.d.ts +9 -0
  314. package/dist/modules/realtime.d.ts.map +1 -0
  315. package/dist/modules/realtime.js +163 -0
  316. package/dist/modules/realtime.js.map +1 -0
  317. package/dist/modules/storage.d.ts +9 -0
  318. package/dist/modules/storage.d.ts.map +1 -0
  319. package/dist/modules/storage.js +59 -0
  320. package/dist/modules/storage.js.map +1 -0
  321. package/dist/modules/types.d.ts +78 -0
  322. package/dist/modules/types.d.ts.map +1 -0
  323. package/dist/modules/types.js +154 -0
  324. package/dist/modules/types.js.map +1 -0
  325. package/dist/modules/web.d.ts +9 -0
  326. package/dist/modules/web.d.ts.map +1 -0
  327. package/dist/modules/web.js +63 -0
  328. package/dist/modules/web.js.map +1 -0
  329. package/dist/modules/websocket.d.ts +11 -0
  330. package/dist/modules/websocket.d.ts.map +1 -0
  331. package/dist/modules/websocket.js +75 -0
  332. package/dist/modules/websocket.js.map +1 -0
  333. package/dist/parser/expressions/jsx.d.ts +17 -0
  334. package/dist/parser/expressions/jsx.d.ts.map +1 -0
  335. package/dist/parser/expressions/jsx.js +43 -0
  336. package/dist/parser/expressions/jsx.js.map +1 -0
  337. package/dist/parser/expressions/keyframes.d.ts +15 -0
  338. package/dist/parser/expressions/keyframes.d.ts.map +1 -0
  339. package/dist/parser/expressions/keyframes.js +33 -0
  340. package/dist/parser/expressions/keyframes.js.map +1 -0
  341. package/dist/parser/expressions/look.d.ts +16 -0
  342. package/dist/parser/expressions/look.d.ts.map +1 -0
  343. package/dist/parser/expressions/look.js +37 -0
  344. package/dist/parser/expressions/look.js.map +1 -0
  345. package/dist/parser/expressions/visual-block.d.ts +17 -0
  346. package/dist/parser/expressions/visual-block.d.ts.map +1 -0
  347. package/dist/parser/expressions/visual-block.js +21 -0
  348. package/dist/parser/expressions/visual-block.js.map +1 -0
  349. package/dist/parser/keyframes-source.d.ts +24 -0
  350. package/dist/parser/keyframes-source.d.ts.map +1 -0
  351. package/dist/parser/keyframes-source.js +133 -0
  352. package/dist/parser/keyframes-source.js.map +1 -0
  353. package/dist/parser/look-source.d.ts +25 -0
  354. package/dist/parser/look-source.d.ts.map +1 -0
  355. package/dist/parser/look-source.js +189 -0
  356. package/dist/parser/look-source.js.map +1 -0
  357. package/dist/parser/spans.d.ts +24 -0
  358. package/dist/parser/spans.d.ts.map +1 -0
  359. package/dist/parser/spans.js +113 -0
  360. package/dist/parser/spans.js.map +1 -0
  361. package/dist/parser/statements/components.d.ts +37 -0
  362. package/dist/parser/statements/components.d.ts.map +1 -0
  363. package/dist/parser/statements/components.js +185 -0
  364. package/dist/parser/statements/components.js.map +1 -0
  365. package/dist/parser/statements/heads.d.ts +38 -0
  366. package/dist/parser/statements/heads.d.ts.map +1 -0
  367. package/dist/parser/statements/heads.js +55 -0
  368. package/dist/parser/statements/heads.js.map +1 -0
  369. package/dist/parser/statements/imports.d.ts +9 -0
  370. package/dist/parser/statements/imports.d.ts.map +1 -0
  371. package/dist/parser/statements/imports.js +31 -0
  372. package/dist/parser/statements/imports.js.map +1 -0
  373. package/dist/parser/statements/reactive.d.ts +31 -0
  374. package/dist/parser/statements/reactive.d.ts.map +1 -0
  375. package/dist/parser/statements/reactive.js +68 -0
  376. package/dist/parser/statements/reactive.js.map +1 -0
  377. package/dist/parser/statements/unsafe-css.d.ts +21 -0
  378. package/dist/parser/statements/unsafe-css.d.ts.map +1 -0
  379. package/dist/parser/statements/unsafe-css.js +42 -0
  380. package/dist/parser/statements/unsafe-css.js.map +1 -0
  381. package/dist/parser.d.ts +37 -50
  382. package/dist/parser.d.ts.map +1 -1
  383. package/dist/parser.js +98 -882
  384. package/dist/parser.js.map +1 -1
  385. package/package.json +2 -2
@@ -0,0 +1,75 @@
1
+ /**
2
+ * D103 — the design-token reference: what `token()` has to be at the site that
3
+ * writes it, and the migration off the `color("var(--x)")` passthrough that
4
+ * used to be the only spelling a Look value let through unchecked.
5
+ *
6
+ * D115 P4 R3b. The compiler cannot see a design system's values, so the
7
+ * reference itself is the whole of what there is to check; every rule here is
8
+ * about the written name.
9
+ */
10
+ import { type DiagnosticEdit } from "@velarscript/compiler";
11
+ import { type Expression } from "@velarscript/compiler/extension";
12
+ import { type LookValueSite } from "../look-sites.ts";
13
+ import { type LookAnalysisHost } from "./host.ts";
14
+ /**
15
+ * D103 rules 1 and 5 — what a checked token reference has to be at the site
16
+ * that writes it.
17
+ *
18
+ * The compiler cannot see a design system's values: no token stylesheet is an
19
+ * input to this compile, and the whole point of the contract is that the
20
+ * theme swaps values under the same names. So the reference itself is the
21
+ * only thing there is to check, and it is checked completely — a literal
22
+ * name, spelled as a CSS custom property identifier, and nothing else in the
23
+ * call. A computed name would leave a Look value with no checked part at all,
24
+ * which is the surface D50 rule 92 says is worse than none.
25
+ */
26
+ export declare function checkLookTokenCall(host: LookAnalysisHost, expression: Extract<Expression, {
27
+ kind: "CallExpression";
28
+ }>): void;
29
+ /**
30
+ * D103 rule 4 — the migration off the one passthrough that used to work.
31
+ *
32
+ * The rewrite carries the `token` import when the module does not already
33
+ * have one, because a fix that leaves a module naming an unimported builder
34
+ * is not mechanical. A `var(--x, fallback)` reference has no rewrite: rule 5
35
+ * closed the contract against per-site fallbacks, so the message says that
36
+ * rather than offering a migration that would silently drop the fallback.
37
+ */
38
+ export declare function reportLookColorVarReference(host: LookAnalysisHost, expression: Extract<Expression, {
39
+ kind: "CallExpression";
40
+ }>, argument: Expression): void;
41
+ /** The one edit that gives this module a `token` import, in the shape D103's migration needs. */
42
+ export declare function lookTokenImportEdit(host: LookAnalysisHost): DiagnosticEdit;
43
+ /** Whether this value is written as a call to the module's `token` builder, alias included. */
44
+ export declare function isLookTokenCall(host: LookAnalysisHost, value: Expression): boolean;
45
+ /** How this module spells a call to the token builder, honouring an aliased import. */
46
+ export declare function lookTokenCallText(host: LookAnalysisHost, referenced: string): {
47
+ readonly call: string;
48
+ readonly imported: boolean;
49
+ };
50
+ /**
51
+ * The edits that replace one written Look value with the checked token call,
52
+ * in the spelling of the site that wrote it.
53
+ *
54
+ * A `look:property="text"` directive is analyzed through a synthetic literal
55
+ * standing for the whole attribute, so the rewrite replaces the attribute:
56
+ * splicing a call between an attribute's quotes is not JSX, and a fix that
57
+ * produces a parse error is not a mechanical fix. The `look:property={...}`
58
+ * spelling carries a real expression whose span is the value alone, and is
59
+ * rewritten in place like a block entry.
60
+ */
61
+ export declare function lookTokenRewrite(host: LookAnalysisHost, value: Expression, referenced: string, site: LookValueSite): readonly DiagnosticEdit[];
62
+ /**
63
+ * D103 rule 4, free-text half — an advisory rather than a refusal.
64
+ *
65
+ * `fontFamily`, `backdropFilter` and the other free-text kinds accept
66
+ * arbitrary CSS text by construction, and a `var()` inside a larger value is
67
+ * a legitimate spelling with no single token to rewrite it to: the tail of a
68
+ * font stack, one layer of a filter list. Refusing there would refuse real
69
+ * CSS. What is advised is the narrow case where the *whole* value is one
70
+ * reference, because there `token("--name")` is the checked spelling of the
71
+ * same thing and the rewrite is unambiguous — which is the bar the `A`
72
+ * roster is written to.
73
+ */
74
+ export declare function adviseLookTokenSpelling(host: LookAnalysisHost, name: string, value: Expression, site: LookValueSite): void;
75
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/analysis/look/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,KAAK,cAAc,EAAkC,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC,GAAG,IAAI,CA8C5H;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC,EAC3D,QAAQ,EAAE,UAAU,GACnB,IAAI,CAoBN;AAED,iGAAiG;AACjG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,cAAc,CAE1E;AAED,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAGlF;AAED,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAGnI;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,SAAS,cAAc,EAAE,CAS9I;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAa1H"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * D103 — the design-token reference: what `token()` has to be at the site that
3
+ * writes it, and the migration off the `color("var(--x)")` passthrough that
4
+ * used to be the only spelling a Look value let through unchecked.
5
+ *
6
+ * D115 P4 R3b. The compiler cannot see a design system's values, so the
7
+ * reference itself is the whole of what there is to check; every rule here is
8
+ * about the written name.
9
+ */
10
+ import { mechanicalEdits, mechanicalFix } from "@velarscript/compiler";
11
+ import { spanIdentity } from "@velarscript/compiler/extension";
12
+ import { isLookTokenName, isLookVarReference, LOOK_PROPERTY_VALUE_KINDS, LOOK_TOKEN_NAME_RULE, LOOK_TOKEN_NO_FALLBACK_GUIDANCE, lookTokenReference, lookVarReferenceName } from "../../look.js";
13
+ import {} from "../look-sites.js";
14
+ import { diagnostic } from "../web-types.js";
15
+ import { lookBuilderImportEdit } from "./edits.js";
16
+ import {} from "./host.js";
17
+ /**
18
+ * D103 rules 1 and 5 — what a checked token reference has to be at the site
19
+ * that writes it.
20
+ *
21
+ * The compiler cannot see a design system's values: no token stylesheet is an
22
+ * input to this compile, and the whole point of the contract is that the
23
+ * theme swaps values under the same names. So the reference itself is the
24
+ * only thing there is to check, and it is checked completely — a literal
25
+ * name, spelled as a CSS custom property identifier, and nothing else in the
26
+ * call. A computed name would leave a Look value with no checked part at all,
27
+ * which is the surface D50 rule 92 says is worse than none.
28
+ */
29
+ export function checkLookTokenCall(host, expression) {
30
+ const names = expression.argumentNames;
31
+ // `token(name="--x")` writes the same one argument the positional spelling
32
+ // does, so the name position is read from the signature the way every other
33
+ // builder's is rather than assumed to be index 0.
34
+ const position = names?.findIndex((entry) => entry === "name") ?? -1;
35
+ const nameIndex = position >= 0 ? position : names?.[0] === undefined || names[0] === null ? 0 : -1;
36
+ for (const [index, argument] of expression.arguments.entries()) {
37
+ if (index === nameIndex)
38
+ continue;
39
+ host.diagnostics.push(diagnostic("VEL5042", LOOK_TOKEN_NO_FALLBACK_GUIDANCE, argument.span));
40
+ }
41
+ const written = nameIndex >= 0 ? expression.arguments[nameIndex] : undefined;
42
+ if (!written)
43
+ return;
44
+ if (written.kind !== "LiteralExpression" || typeof written.value !== "string") {
45
+ host.diagnostics.push(diagnostic("VEL5042", `A design token reference names its custom property in the call: ${LOOK_TOKEN_NAME_RULE}. The compiler cannot see a design system's values, so the name is the whole of what it can check — a computed name, an interpolation, or a binding would leave the reference unchecked`, written.span));
46
+ return;
47
+ }
48
+ if (isLookTokenName(written.value)) {
49
+ // D103 rule 2: the reference is compile-time text, so it is folded here
50
+ // rather than left as a call the browser makes on every module load. The
51
+ // fold is stamped only on a call this check has just proved, which is
52
+ // what keeps the emitter structurally unable to write a name nothing
53
+ // validated. An aliased builder (`const t = token`) is not resolved here
54
+ // and keeps the runtime implementation, exactly as every other builder
55
+ // passed around as a value does.
56
+ if (expression.arguments.length === 1) {
57
+ host.extensionLiterals.set(spanIdentity(expression.span), lookTokenReference(written.value));
58
+ }
59
+ return;
60
+ }
61
+ // A name written without the `--` that makes it a custom property is the
62
+ // one near miss with a single spelling behind it, so it is migrated rather
63
+ // than only refused.
64
+ const prefixed = `--${written.value}`;
65
+ host.diagnostics.push(diagnostic("VEL5042", `Design token name '${written.value}' is not a CSS custom property identifier; ${LOOK_TOKEN_NAME_RULE}`, written.span, isLookTokenName(prefixed)
66
+ ? mechanicalFix(written.span, JSON.stringify(prefixed), `Use "${prefixed}"`)
67
+ : undefined));
68
+ }
69
+ /**
70
+ * D103 rule 4 — the migration off the one passthrough that used to work.
71
+ *
72
+ * The rewrite carries the `token` import when the module does not already
73
+ * have one, because a fix that leaves a module naming an unimported builder
74
+ * is not mechanical. A `var(--x, fallback)` reference has no rewrite: rule 5
75
+ * closed the contract against per-site fallbacks, so the message says that
76
+ * rather than offering a migration that would silently drop the fallback.
77
+ */
78
+ export function reportLookColorVarReference(host, expression, argument) {
79
+ if (argument.kind !== "LiteralExpression" || typeof argument.value !== "string")
80
+ return;
81
+ if (!isLookVarReference(argument.value))
82
+ return;
83
+ const referenced = lookVarReferenceName(argument.value);
84
+ if (referenced === null) {
85
+ host.diagnostics.push(diagnostic("VEL5042", `A design token reference is written token("--name"), and it carries no fallback: ${LOOK_TOKEN_NO_FALLBACK_GUIDANCE}`, argument.span));
86
+ return;
87
+ }
88
+ const { call, imported } = lookTokenCallText(host, referenced);
89
+ const rewrite = { span: expression.span, text: call };
90
+ host.diagnostics.push(diagnostic("VEL5042", `Write a design token reference as ${call}; color("var(...)") passed the reference through as text nothing checked, and token() is the one checked spelling — legal in every Look property, not only the colour ones`, expression.span, mechanicalEdits(imported ? [rewrite] : [lookTokenImportEdit(host), rewrite], `Use ${call}`)));
91
+ }
92
+ /** The one edit that gives this module a `token` import, in the shape D103's migration needs. */
93
+ export function lookTokenImportEdit(host) {
94
+ return lookBuilderImportEdit(host, ["token"]);
95
+ }
96
+ /** Whether this value is written as a call to the module's `token` builder, alias included. */
97
+ export function isLookTokenCall(host, value) {
98
+ return value.kind === "CallExpression" && value.callee.kind === "IdentifierExpression"
99
+ && host.lookBuilderNames.get(value.callee.name) === "token";
100
+ }
101
+ /** How this module spells a call to the token builder, honouring an aliased import. */
102
+ export function lookTokenCallText(host, referenced) {
103
+ const local = [...host.lookBuilderNames].find(([, builder]) => builder === "token")?.[0] ?? null;
104
+ return { call: `${local ?? "token"}(${JSON.stringify(referenced)})`, imported: local !== null };
105
+ }
106
+ /**
107
+ * The edits that replace one written Look value with the checked token call,
108
+ * in the spelling of the site that wrote it.
109
+ *
110
+ * A `look:property="text"` directive is analyzed through a synthetic literal
111
+ * standing for the whole attribute, so the rewrite replaces the attribute:
112
+ * splicing a call between an attribute's quotes is not JSX, and a fix that
113
+ * produces a parse error is not a mechanical fix. The `look:property={...}`
114
+ * spelling carries a real expression whose span is the value alone, and is
115
+ * rewritten in place like a block entry.
116
+ */
117
+ export function lookTokenRewrite(host, value, referenced, site) {
118
+ const { call, imported } = lookTokenCallText(host, referenced);
119
+ const wholeAttribute = site.directive !== null
120
+ && value.span.start === site.entrySpan.start && value.span.end === site.entrySpan.end;
121
+ const edit = {
122
+ span: value.span,
123
+ text: wholeAttribute ? `${site.directive}:${site.property}={${call}}` : call,
124
+ };
125
+ return imported ? [edit] : [lookTokenImportEdit(host), edit];
126
+ }
127
+ /**
128
+ * D103 rule 4, free-text half — an advisory rather than a refusal.
129
+ *
130
+ * `fontFamily`, `backdropFilter` and the other free-text kinds accept
131
+ * arbitrary CSS text by construction, and a `var()` inside a larger value is
132
+ * a legitimate spelling with no single token to rewrite it to: the tail of a
133
+ * font stack, one layer of a filter list. Refusing there would refuse real
134
+ * CSS. What is advised is the narrow case where the *whole* value is one
135
+ * reference, because there `token("--name")` is the checked spelling of the
136
+ * same thing and the rewrite is unambiguous — which is the bar the `A`
137
+ * roster is written to.
138
+ */
139
+ export function adviseLookTokenSpelling(host, name, value, site) {
140
+ const kind = LOOK_PROPERTY_VALUE_KINDS.get(name);
141
+ if (kind !== "text" && kind !== "filter" && kind !== "transform")
142
+ return;
143
+ if (value.kind !== "LiteralExpression" || typeof value.value !== "string")
144
+ return;
145
+ const referenced = lookVarReferenceName(value.value);
146
+ if (referenced === null)
147
+ return;
148
+ const { call } = lookTokenCallText(host, referenced);
149
+ host.advise("A12", `Look property '${name}' accepts free text, so this design token reference compiles — as text nothing checks. ${call} is the checked spelling of the same reference, and it is legal in every Look property. A var() inside a larger value, such as a font stack's fallback, has no single token to stand for it and is not advised`, value.span, mechanicalEdits(lookTokenRewrite(host, value, referenced, site), `Use ${call}`));
150
+ }
151
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/analysis/look/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAuB,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAChM,OAAO,EAAsB,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,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AAI,KAAK,WAAW;QAAE,OAAO;IACzE,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO;IAClF,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrD,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO;IAChC,MAAM,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACrD,IAAI,CAAC,MAAM,CACT,KAAK,EACL,kBAAkB,IAAI,0FAA0F,IAAI,gNAAgN,EACpU,KAAK,CAAC,IAAI,EACV,eAAe,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,OAAO,IAAI,EAAE,CAAC,CAChF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * What a Look property's value is allowed to be: the string vocabulary each
3
+ * property publishes, the compile-time fold that answers for a `const`
4
+ * keyword, the unit a bare number is missing, and the filter spelling that has
5
+ * a builder behind it.
6
+ *
7
+ * D115 P4 R3b. `entries.ts` asks these questions of every entry it walks and
8
+ * `builders.ts` routes the transition builder's property argument through the
9
+ * same vocabulary, so one property has one answer wherever it is written.
10
+ */
11
+ import { type Span } from "@velarscript/compiler";
12
+ import { type Expression, type ValueType } from "@velarscript/compiler/extension";
13
+ import { type LookValueSite } from "../look-sites.ts";
14
+ import { type LookAnalysisHost } from "./host.ts";
15
+ /**
16
+ * `subject` names the position in the message. It is the property itself
17
+ * everywhere except the `transition(...)` builder, whose first argument takes
18
+ * `transitionProperty`'s vocabulary but is not written as that property — a
19
+ * refusal that named the longhand there would name a spelling the author
20
+ * never wrote.
21
+ */
22
+ export declare function validateLookStringVocabulary(host: LookAnalysisHost, name: string, value: Expression, subject?: string, site?: LookValueSite): boolean;
23
+ /**
24
+ * D65 rule 168 closed the closed sets against misspelled literals, and D65
25
+ * item 3 makes a `const` string a first-class design token — so the two have
26
+ * to agree. A name or a record field that folds to a bare CSS keyword is
27
+ * checked exactly as the literal spelling of it is; anything that folds to
28
+ * composed CSS text (a builder result, a unit, a gradient) is not a keyword
29
+ * and is left to the type and to the builder's own checks.
30
+ */
31
+ export declare function foldedLookKeyword(host: LookAnalysisHost, value: Expression): readonly string[] | null;
32
+ /**
33
+ * LOK-D3: a bare number on a length property reaches CSS as a declaration the
34
+ * browser discards. The union already rejects it; this diagnostic replaces the
35
+ * union dump with the unit the author meant to write.
36
+ */
37
+ export declare function reportLookNumberWithoutUnit(host: LookAnalysisHost, name: string, actual: ValueType, expected: ValueType, valueSpan: Span): boolean;
38
+ /**
39
+ * A complete CSS filter function whose arguments fit the checked Look
40
+ * builders has one equivalent source spelling. The parser deliberately
41
+ * stops at the first function or argument grammar it cannot prove, leaving
42
+ * arbitrary CSS and externally defined filter functions as ordinary text.
43
+ */
44
+ export declare function adviseLookFilterSpelling(host: LookAnalysisHost, name: string, value: Expression, site: LookValueSite): void;
45
+ //# sourceMappingURL=values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../../src/analysis/look/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAmB,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGlF,OAAO,EAAE,KAAK,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AAI5E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGlD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,SAA4B,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,CA8ExK;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,CAKrG;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CASlJ;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAe3H"}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * What a Look property's value is allowed to be: the string vocabulary each
3
+ * property publishes, the compile-time fold that answers for a `const`
4
+ * keyword, the unit a bare number is missing, and the filter spelling that has
5
+ * a builder behind it.
6
+ *
7
+ * D115 P4 R3b. `entries.ts` asks these questions of every entry it walks and
8
+ * `builders.ts` routes the transition builder's property argument through the
9
+ * same vocabulary, so one property has one answer wherever it is written.
10
+ */
11
+ import { mechanicalEdits } from "@velarscript/compiler";
12
+ import {} from "@velarscript/compiler/extension";
13
+ import { evaluateLookStaticExpression } from "../../look-static.js";
14
+ import { LOOK_PARTIAL_KEYWORD_PROPERTIES, LOOK_PROPERTY_KEYWORDS, LOOK_PROPERTY_VALUE_KINDS, LOOK_SHARED_METRIC_KEYWORDS, LOOK_UNITLESS_PROPERTIES, lookOwnKeywords, lookVarReferenceName } from "../../look.js";
15
+ import { mentionsLookUnitType } from "../look-sites.js";
16
+ import { literalStringValues, lookColorKeywords, lookCssWideKeywords, lookFilterRewrite, lookMetricKeywords, lookVocabularyGuidance, lookVocabularyLead } from "../look-vocabulary-guidance.js";
17
+ import { diagnostic } from "../web-types.js";
18
+ import { localizeLookBuilderCall, lookBuilderRewrite } from "./edits.js";
19
+ import {} from "./host.js";
20
+ import { lookTokenCallText, lookTokenRewrite } from "./tokens.js";
21
+ /**
22
+ * `subject` names the position in the message. It is the property itself
23
+ * everywhere except the `transition(...)` builder, whose first argument takes
24
+ * `transitionProperty`'s vocabulary but is not written as that property — a
25
+ * refusal that named the longhand there would name a spelling the author
26
+ * never wrote.
27
+ */
28
+ export function validateLookStringVocabulary(host, name, value, subject = `Look property '${name}'`, site) {
29
+ const kind = LOOK_PROPERTY_VALUE_KINDS.get(name);
30
+ if (!kind || kind === "text" || kind === "filter" || kind === "transform" || kind === "animation")
31
+ return true;
32
+ const values = literalStringValues(value) ?? foldedLookKeyword(host, value);
33
+ if (values === null)
34
+ return true;
35
+ for (const text of values) {
36
+ const normalized = text.trim();
37
+ // D103 rule 4: this is the refusal the shell wave met — every metric,
38
+ // shadow and transition property turned a design token reference away and
39
+ // named `import css unsafe` as the only way out, which is how a product's
40
+ // whole visual layer ended up outside Look. The reference is still
41
+ // refused as free text, because free text is what it was; what changed is
42
+ // that the refusal now names the checked spelling of the same reference
43
+ // and rewrites to it.
44
+ const referenced = site && lookVarReferenceName(normalized);
45
+ if (referenced) {
46
+ const { call } = lookTokenCallText(host, referenced);
47
+ host.diagnostics.push(diagnostic("VEL5038", `${subject} does not accept the text '${normalized}'; write the design token reference as ${call}, which is checked and legal in every Look property`, value.span, mechanicalEdits(lookTokenRewrite(host, value, referenced, site), `Use ${call}`)));
48
+ return false;
49
+ }
50
+ if (kind === "metric" && /^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem|em|vw|vh|vmin|vmax|%|fr|ms|s|deg|turn)$/u.test(normalized)) {
51
+ host.diagnostics.push(diagnostic("VEL5038", `Use the unit literal ${normalized}; quoted unit values are not part of Look`, value.span));
52
+ return false;
53
+ }
54
+ let accepted;
55
+ // A metric property is a unit value plus a keyword half: its own CSS
56
+ // keywords when it has a table -- `backgroundSize` takes lengths *and*
57
+ // cover and contain, the `<position>` properties take the placement words
58
+ // (D60 rule 150, D67 rule 172) -- and the shared sizing words when it has
59
+ // none. The two are alternatives rather than a union, for the reason D65
60
+ // rule 168 gave for the keyword kind: a shared list added on top of a
61
+ // real table decides values for a property it has never heard of, so
62
+ // `objectPosition = "min-content"` would compile and reach the browser as
63
+ // a declaration it discards.
64
+ const metricKeywords = LOOK_PROPERTY_KEYWORDS.get(name);
65
+ if (kind === "metric")
66
+ accepted = metricKeywords === undefined ? lookMetricKeywords.has(normalized) : metricKeywords.has(normalized);
67
+ else if (kind === "color" || kind === "background")
68
+ accepted = lookColorKeywords.has(normalized) || /^#[0-9a-f]{3,8}$/iu.test(normalized);
69
+ else if (kind === "image")
70
+ accepted = lookCssWideKeywords.has(normalized) || normalized === "none";
71
+ // D73 rule 187: every kind that decides a string keyword reads the
72
+ // property's own closed set, and look.ts refuses to load if one is
73
+ // missing. The 46-word shared list this replaces both admitted values the
74
+ // property never had and made the refusal describe a table that did not
75
+ // exist.
76
+ else
77
+ accepted = LOOK_PROPERTY_KEYWORDS.get(name)?.has(normalized) === true;
78
+ if (!accepted) {
79
+ // D67 rule 174, widened by D73 rule 187: every refusal now names the
80
+ // property's own values, because every one of these kinds has them. The
81
+ // lead says what the non-keyword half of the property is, so a reader
82
+ // who wanted a length, an angle or a builder is not sent looking through
83
+ // a keyword list for it.
84
+ const expected = kind === "metric"
85
+ ? lookVocabularyGuidance(name, normalized, metricKeywords === undefined ? LOOK_SHARED_METRIC_KEYWORDS : lookOwnKeywords(name), "write a unit value such as 16px, 1rem or 50%, or one of")
86
+ : kind === "color" || kind === "background"
87
+ ? { text: "use a checked color() or color keyword", named: false }
88
+ : kind === "image"
89
+ ? { text: "use a checked image builder such as linearGradient() or asset()", named: false }
90
+ : lookVocabularyGuidance(name, normalized, lookOwnKeywords(name), lookVocabularyLead(kind));
91
+ // D65 rule 169: a property whose CSS value space no set can hold says
92
+ // what it left out, so the boundary is legible where it is met.
93
+ const partial = expected.named ? undefined : LOOK_PARTIAL_KEYWORD_PROPERTIES.get(name);
94
+ host.diagnostics.push(diagnostic("VEL5038", `${subject} does not accept '${normalized}'; ${expected.text}${partial
95
+ ? `. ${partial}; use a module-level 'import css unsafe "./styles.css" before look' when that boundary is intentional`
96
+ : ""}`, value.span));
97
+ return false;
98
+ }
99
+ }
100
+ return true;
101
+ }
102
+ /**
103
+ * D65 rule 168 closed the closed sets against misspelled literals, and D65
104
+ * item 3 makes a `const` string a first-class design token — so the two have
105
+ * to agree. A name or a record field that folds to a bare CSS keyword is
106
+ * checked exactly as the literal spelling of it is; anything that folds to
107
+ * composed CSS text (a builder result, a unit, a gradient) is not a keyword
108
+ * and is left to the type and to the builder's own checks.
109
+ */
110
+ export function foldedLookKeyword(host, value) {
111
+ if (value.kind !== "IdentifierExpression" && value.kind !== "MemberExpression")
112
+ return null;
113
+ const folded = evaluateLookStaticExpression(value, host.lookStatic.values);
114
+ if (folded?.kind !== "css" || !/^[A-Za-z][A-Za-z0-9-]*$/u.test(folded.value))
115
+ return null;
116
+ return [folded.value];
117
+ }
118
+ /**
119
+ * LOK-D3: a bare number on a length property reaches CSS as a declaration the
120
+ * browser discards. The union already rejects it; this diagnostic replaces the
121
+ * union dump with the unit the author meant to write.
122
+ */
123
+ export function reportLookNumberWithoutUnit(host, name, actual, expected, valueSpan) {
124
+ if (host.expandAliases(actual).kind !== "number" || LOOK_UNITLESS_PROPERTIES.has(name))
125
+ return false;
126
+ if (!mentionsLookUnitType(expected))
127
+ return false;
128
+ host.diagnostics.push(diagnostic("VEL5038", `Look property '${name}' is a CSS length and requires a unit; write a unit value such as 16px, 1rem, or 50%`, valueSpan));
129
+ return true;
130
+ }
131
+ /**
132
+ * A complete CSS filter function whose arguments fit the checked Look
133
+ * builders has one equivalent source spelling. The parser deliberately
134
+ * stops at the first function or argument grammar it cannot prove, leaving
135
+ * arbitrary CSS and externally defined filter functions as ordinary text.
136
+ */
137
+ export function adviseLookFilterSpelling(host, name, value, site) {
138
+ if (LOOK_PROPERTY_VALUE_KINDS.get(name) !== "filter")
139
+ return;
140
+ if (value.kind !== "LiteralExpression" || typeof value.value !== "string")
141
+ return;
142
+ const rewrite = lookFilterRewrite(value.value);
143
+ if (!rewrite)
144
+ return;
145
+ const localized = localizeLookBuilderCall(host, rewrite);
146
+ host.advise("A16", `Look property '${name}' accepts CSS filter text, but this complete filter list has the checked equivalent ${localized.call}`, value.span, mechanicalEdits(lookBuilderRewrite(host, value, localized.call, site, localized.missingImports), `Use ${localized.call}`));
147
+ }
148
+ //# sourceMappingURL=values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.js","sourceRoot":"","sources":["../../../src/analysis/look/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,eAAe,EAAa,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAmC,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjN,OAAO,EAAsB,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAA0B,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACxN,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAyB,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAAsB,EAAE,IAAY,EAAE,KAAiB,EAAE,OAAO,GAAG,kBAAkB,IAAI,GAAG,EAAE,IAAoB;IAC7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AAI,EAAE,SAAS,CAAC,cAAc,CAAC,EAC/E,OAAO,SAAS,CAAC,IAAI,EAAE,CACxB,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * A Look condition as the emitter will key it: the lowered atom each term
3
+ * becomes, the scope key a whole condition folds to, and what a module's Look
4
+ * declarations contribute to a property once every branch is read.
5
+ *
6
+ * D115 P4 R3a: the duplicate-property scope and the cascade both ask this, and
7
+ * neither asks it of the analyzer's state, so it is written once here.
8
+ */
9
+ import { type Expression, type Program } from "@velarscript/compiler/extension";
10
+ import { type WebLookExpression } from "../ast.ts";
11
+ import { type LookStaticValue } from "../look-static.ts";
12
+ /**
13
+ * VEL5045: the selector/runtime terms one Look condition may expand to. A
14
+ * conjunction multiplies its two sides, so nesting is what the cap is against.
15
+ * Both readings of a condition stop there — the terms folded below, and the
16
+ * count `look-sites.ts` takes — so neither can run away on a written nesting.
17
+ */
18
+ export declare const LOOK_CONDITION_TERM_LIMIT = 32;
19
+ /**
20
+ * One Look condition as the set of alternatives it lowers to, each alternative
21
+ * being the sorted atoms that must hold together. Two conditions share a
22
+ * duplicate-detection scope exactly when this rendering matches, so a condition
23
+ * written the other way round, negated into its complement, or spelled with its
24
+ * operands swapped lands in the scope its rule will actually occupy.
25
+ */
26
+ export declare function lookConditionKey(expression: Expression, negated: boolean, staticValues: ReadonlyMap<string, LookStaticValue>): string;
27
+ /**
28
+ * Every `const name = look:` in the module, wherever it is written. A name
29
+ * declared twice maps to null: two different Look literals under one name make
30
+ * the composition question unanswerable, so the check that reads this map
31
+ * declines rather than guessing which one an element received.
32
+ */
33
+ export declare function collectLookDeclarations(program: Program): ReadonlyMap<string, WebLookExpression | null>;
34
+ /**
35
+ * The properties one Look sets, each keyed by the target it sets them on so a
36
+ * `@before:` colour and an element colour stay two different decisions. The
37
+ * condition is deliberately not part of the key: two looks that set one
38
+ * property under conditions that can both hold are exactly the ambiguity this
39
+ * serves. A `...spread` of another look is followed, and the names followed are
40
+ * reported back, because composing is what makes two looks ordered rather than
41
+ * independent.
42
+ */
43
+ export declare function lookContributions(look: WebLookExpression, looks: ReadonlyMap<string, WebLookExpression | null>, visited?: ReadonlySet<string>): {
44
+ readonly properties: ReadonlySet<string>;
45
+ readonly composed: ReadonlySet<string>;
46
+ };
47
+ //# sourceMappingURL=look-conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"look-conditions.d.ts","sourceRoot":"","sources":["../../src/analysis/look-conditions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAkB,MAAM,iCAAiC,CAAC;AAChG,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAA+C,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAItG;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAwC5C;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GACjD,MAAM,CAGR;AA4BD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC,CAmBvG;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC,EACpD,OAAO,GAAE,WAAW,CAAC,MAAM,CAAa,GACvC;IAAE,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,CAsBtF"}