@variance-authority/core 0.1.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 (260) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/LICENSE +21 -0
  3. package/README.md +169 -0
  4. package/dist/artifact.d.ts +47 -0
  5. package/dist/artifact.js +2 -0
  6. package/dist/artifact.js.map +1 -0
  7. package/dist/attribute/because.d.ts +43 -0
  8. package/dist/attribute/because.js +64 -0
  9. package/dist/attribute/because.js.map +1 -0
  10. package/dist/attribute/boundary.d.ts +191 -0
  11. package/dist/attribute/boundary.js +328 -0
  12. package/dist/attribute/boundary.js.map +1 -0
  13. package/dist/attribute/call-site.d.ts +96 -0
  14. package/dist/attribute/call-site.js +183 -0
  15. package/dist/attribute/call-site.js.map +1 -0
  16. package/dist/attribute/component-hash.d.ts +188 -0
  17. package/dist/attribute/component-hash.js +312 -0
  18. package/dist/attribute/component-hash.js.map +1 -0
  19. package/dist/attribute/composition-fixture.d.ts +18 -0
  20. package/dist/attribute/composition-fixture.js +53 -0
  21. package/dist/attribute/composition-fixture.js.map +1 -0
  22. package/dist/attribute/composition.d.ts +182 -0
  23. package/dist/attribute/composition.js +169 -0
  24. package/dist/attribute/composition.js.map +1 -0
  25. package/dist/attribute/control.d.ts +43 -0
  26. package/dist/attribute/control.js +54 -0
  27. package/dist/attribute/control.js.map +1 -0
  28. package/dist/attribute/coverage.d.ts +99 -0
  29. package/dist/attribute/coverage.js +86 -0
  30. package/dist/attribute/coverage.js.map +1 -0
  31. package/dist/attribute/divergence.d.ts +102 -0
  32. package/dist/attribute/divergence.js +152 -0
  33. package/dist/attribute/divergence.js.map +1 -0
  34. package/dist/attribute/index.d.ts +43 -0
  35. package/dist/attribute/index.js +29 -0
  36. package/dist/attribute/index.js.map +1 -0
  37. package/dist/attribute/instability.d.ts +89 -0
  38. package/dist/attribute/instability.js +183 -0
  39. package/dist/attribute/instability.js.map +1 -0
  40. package/dist/attribute/instances.d.ts +145 -0
  41. package/dist/attribute/instances.js +140 -0
  42. package/dist/attribute/instances.js.map +1 -0
  43. package/dist/attribute/locate.d.ts +22 -0
  44. package/dist/attribute/locate.js +100 -0
  45. package/dist/attribute/locate.js.map +1 -0
  46. package/dist/attribute/mask.d.ts +156 -0
  47. package/dist/attribute/mask.js +201 -0
  48. package/dist/attribute/mask.js.map +1 -0
  49. package/dist/attribute/movement.d.ts +211 -0
  50. package/dist/attribute/movement.js +181 -0
  51. package/dist/attribute/movement.js.map +1 -0
  52. package/dist/attribute/region.d.ts +188 -0
  53. package/dist/attribute/region.js +144 -0
  54. package/dist/attribute/region.js.map +1 -0
  55. package/dist/attribute/source-map.d.ts +98 -0
  56. package/dist/attribute/source-map.js +264 -0
  57. package/dist/attribute/source-map.js.map +1 -0
  58. package/dist/attribute/source.d.ts +77 -0
  59. package/dist/attribute/source.js +95 -0
  60. package/dist/attribute/source.js.map +1 -0
  61. package/dist/attribute/stack.d.ts +80 -0
  62. package/dist/attribute/stack.js +108 -0
  63. package/dist/attribute/stack.js.map +1 -0
  64. package/dist/compare/band.d.ts +85 -0
  65. package/dist/compare/band.js +70 -0
  66. package/dist/compare/band.js.map +1 -0
  67. package/dist/compare/cascade.d.ts +45 -0
  68. package/dist/compare/cascade.js +71 -0
  69. package/dist/compare/cascade.js.map +1 -0
  70. package/dist/compare/derive.d.ts +78 -0
  71. package/dist/compare/derive.js +39 -0
  72. package/dist/compare/derive.js.map +1 -0
  73. package/dist/compare/diff/attribution.d.ts +23 -0
  74. package/dist/compare/diff/attribution.js +244 -0
  75. package/dist/compare/diff/attribution.js.map +1 -0
  76. package/dist/compare/diff/compare-nodes.d.ts +15 -0
  77. package/dist/compare/diff/compare-nodes.js +227 -0
  78. package/dist/compare/diff/compare-nodes.js.map +1 -0
  79. package/dist/compare/diff/components.d.ts +20 -0
  80. package/dist/compare/diff/components.js +76 -0
  81. package/dist/compare/diff/components.js.map +1 -0
  82. package/dist/compare/diff/delta.d.ts +165 -0
  83. package/dist/compare/diff/delta.js +12 -0
  84. package/dist/compare/diff/delta.js.map +1 -0
  85. package/dist/compare/diff/index.d.ts +69 -0
  86. package/dist/compare/diff/index.js +101 -0
  87. package/dist/compare/diff/index.js.map +1 -0
  88. package/dist/compare/diff/match.d.ts +37 -0
  89. package/dist/compare/diff/match.js +167 -0
  90. package/dist/compare/diff/match.js.map +1 -0
  91. package/dist/compare/explain.d.ts +23 -0
  92. package/dist/compare/explain.js +190 -0
  93. package/dist/compare/explain.js.map +1 -0
  94. package/dist/compare/holding-diff.d.ts +25 -0
  95. package/dist/compare/holding-diff.js +74 -0
  96. package/dist/compare/holding-diff.js.map +1 -0
  97. package/dist/compare/impact.d.ts +56 -0
  98. package/dist/compare/impact.js +124 -0
  99. package/dist/compare/impact.js.map +1 -0
  100. package/dist/compare/index.d.ts +30 -0
  101. package/dist/compare/index.js +22 -0
  102. package/dist/compare/index.js.map +1 -0
  103. package/dist/compare/instance.d.ts +30 -0
  104. package/dist/compare/instance.js +145 -0
  105. package/dist/compare/instance.js.map +1 -0
  106. package/dist/compare/observability.d.ts +49 -0
  107. package/dist/compare/observability.js +57 -0
  108. package/dist/compare/observability.js.map +1 -0
  109. package/dist/compare/parting.d.ts +179 -0
  110. package/dist/compare/parting.js +244 -0
  111. package/dist/compare/parting.js.map +1 -0
  112. package/dist/compare/slice.d.ts +74 -0
  113. package/dist/compare/slice.js +79 -0
  114. package/dist/compare/slice.js.map +1 -0
  115. package/dist/compare/value.d.ts +60 -0
  116. package/dist/compare/value.js +111 -0
  117. package/dist/compare/value.js.map +1 -0
  118. package/dist/format/accessibility.d.ts +27 -0
  119. package/dist/format/accessibility.js +17 -0
  120. package/dist/format/accessibility.js.map +1 -0
  121. package/dist/format/canonical.d.ts +38 -0
  122. package/dist/format/canonical.js +65 -0
  123. package/dist/format/canonical.js.map +1 -0
  124. package/dist/format/capture.d.ts +212 -0
  125. package/dist/format/capture.js +2 -0
  126. package/dist/format/capture.js.map +1 -0
  127. package/dist/format/document.d.ts +279 -0
  128. package/dist/format/document.js +65 -0
  129. package/dist/format/document.js.map +1 -0
  130. package/dist/format/environment.d.ts +120 -0
  131. package/dist/format/environment.js +53 -0
  132. package/dist/format/environment.js.map +1 -0
  133. package/dist/format/hash.d.ts +45 -0
  134. package/dist/format/hash.js +41 -0
  135. package/dist/format/hash.js.map +1 -0
  136. package/dist/format/holding.d.ts +134 -0
  137. package/dist/format/holding.js +2 -0
  138. package/dist/format/holding.js.map +1 -0
  139. package/dist/format/index.d.ts +39 -0
  140. package/dist/format/index.js +25 -0
  141. package/dist/format/index.js.map +1 -0
  142. package/dist/format/intervention.d.ts +87 -0
  143. package/dist/format/intervention.js +11 -0
  144. package/dist/format/intervention.js.map +1 -0
  145. package/dist/format/profile.d.ts +59 -0
  146. package/dist/format/profile.js +66 -0
  147. package/dist/format/profile.js.map +1 -0
  148. package/dist/format/provenance.d.ts +179 -0
  149. package/dist/format/provenance.js +222 -0
  150. package/dist/format/provenance.js.map +1 -0
  151. package/dist/format/sha256.d.ts +34 -0
  152. package/dist/format/sha256.js +152 -0
  153. package/dist/format/sha256.js.map +1 -0
  154. package/dist/format/snapshot.d.ts +263 -0
  155. package/dist/format/snapshot.js +2 -0
  156. package/dist/format/snapshot.js.map +1 -0
  157. package/dist/format/stabilize.d.ts +190 -0
  158. package/dist/format/stabilize.js +333 -0
  159. package/dist/format/stabilize.js.map +1 -0
  160. package/dist/format/tier.d.ts +19 -0
  161. package/dist/format/tier.js +11 -0
  162. package/dist/format/tier.js.map +1 -0
  163. package/dist/format/value.d.ts +115 -0
  164. package/dist/format/value.js +182 -0
  165. package/dist/format/value.js.map +1 -0
  166. package/dist/format/wiring.d.ts +115 -0
  167. package/dist/format/wiring.js +60 -0
  168. package/dist/format/wiring.js.map +1 -0
  169. package/dist/index.d.ts +35 -0
  170. package/dist/index.js +35 -0
  171. package/dist/index.js.map +1 -0
  172. package/dist/judge/docket.d.ts +85 -0
  173. package/dist/judge/docket.js +162 -0
  174. package/dist/judge/docket.js.map +1 -0
  175. package/dist/judge/fingerprint.d.ts +53 -0
  176. package/dist/judge/fingerprint.js +144 -0
  177. package/dist/judge/fingerprint.js.map +1 -0
  178. package/dist/judge/ignore.d.ts +206 -0
  179. package/dist/judge/ignore.js +237 -0
  180. package/dist/judge/ignore.js.map +1 -0
  181. package/dist/judge/index.d.ts +44 -0
  182. package/dist/judge/index.js +34 -0
  183. package/dist/judge/index.js.map +1 -0
  184. package/dist/judge/inspect.d.ts +148 -0
  185. package/dist/judge/inspect.js +208 -0
  186. package/dist/judge/inspect.js.map +1 -0
  187. package/dist/judge/intent.d.ts +146 -0
  188. package/dist/judge/intent.js +150 -0
  189. package/dist/judge/intent.js.map +1 -0
  190. package/dist/judge/locale.d.ts +111 -0
  191. package/dist/judge/locale.js +247 -0
  192. package/dist/judge/locale.js.map +1 -0
  193. package/dist/judge/scope.d.ts +41 -0
  194. package/dist/judge/scope.js +47 -0
  195. package/dist/judge/scope.js.map +1 -0
  196. package/dist/judge/sensitivity.d.ts +202 -0
  197. package/dist/judge/sensitivity.js +152 -0
  198. package/dist/judge/sensitivity.js.map +1 -0
  199. package/dist/judge/trail.d.ts +122 -0
  200. package/dist/judge/trail.js +96 -0
  201. package/dist/judge/trail.js.map +1 -0
  202. package/dist/judge/verdict.d.ts +39 -0
  203. package/dist/judge/verdict.js +32 -0
  204. package/dist/judge/verdict.js.map +1 -0
  205. package/dist/plan/index.d.ts +12 -0
  206. package/dist/plan/index.js +11 -0
  207. package/dist/plan/index.js.map +1 -0
  208. package/dist/plan/tool.d.ts +85 -0
  209. package/dist/plan/tool.js +87 -0
  210. package/dist/plan/tool.js.map +1 -0
  211. package/dist/relate/graph.d.ts +190 -0
  212. package/dist/relate/graph.js +234 -0
  213. package/dist/relate/graph.js.map +1 -0
  214. package/dist/relate/index.d.ts +16 -0
  215. package/dist/relate/index.js +16 -0
  216. package/dist/relate/index.js.map +1 -0
  217. package/dist/relate/merkle.d.ts +110 -0
  218. package/dist/relate/merkle.js +246 -0
  219. package/dist/relate/merkle.js.map +1 -0
  220. package/dist/relate/reach.d.ts +65 -0
  221. package/dist/relate/reach.js +111 -0
  222. package/dist/relate/reach.js.map +1 -0
  223. package/dist/relate/records.d.ts +129 -0
  224. package/dist/relate/records.js +112 -0
  225. package/dist/relate/records.js.map +1 -0
  226. package/dist/rules/index.d.ts +19 -0
  227. package/dist/rules/index.js +17 -0
  228. package/dist/rules/index.js.map +1 -0
  229. package/dist/rules/normalize/alias.d.ts +50 -0
  230. package/dist/rules/normalize/alias.js +111 -0
  231. package/dist/rules/normalize/alias.js.map +1 -0
  232. package/dist/rules/normalize/cascade.d.ts +85 -0
  233. package/dist/rules/normalize/cascade.js +324 -0
  234. package/dist/rules/normalize/cascade.js.map +1 -0
  235. package/dist/rules/normalize/color.d.ts +30 -0
  236. package/dist/rules/normalize/color.js +185 -0
  237. package/dist/rules/normalize/color.js.map +1 -0
  238. package/dist/rules/normalize/fixture.d.ts +83 -0
  239. package/dist/rules/normalize/fixture.js +74 -0
  240. package/dist/rules/normalize/fixture.js.map +1 -0
  241. package/dist/rules/normalize/index.d.ts +39 -0
  242. package/dist/rules/normalize/index.js +268 -0
  243. package/dist/rules/normalize/index.js.map +1 -0
  244. package/dist/rules/normalize/project.d.ts +42 -0
  245. package/dist/rules/normalize/project.js +83 -0
  246. package/dist/rules/normalize/project.js.map +1 -0
  247. package/dist/rules/normalize/shorthand.d.ts +38 -0
  248. package/dist/rules/normalize/shorthand.js +388 -0
  249. package/dist/rules/normalize/shorthand.js.map +1 -0
  250. package/dist/rules/normalize/value.d.ts +23 -0
  251. package/dist/rules/normalize/value.js +162 -0
  252. package/dist/rules/normalize/value.js.map +1 -0
  253. package/dist/rules/normalize/wrapper.d.ts +16 -0
  254. package/dist/rules/normalize/wrapper.js +137 -0
  255. package/dist/rules/normalize/wrapper.js.map +1 -0
  256. package/dist/rules/ruleset.d.ts +93 -0
  257. package/dist/rules/ruleset.js +175 -0
  258. package/dist/rules/ruleset.js.map +1 -0
  259. package/mark.svg +30 -0
  260. package/package.json +69 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.js","sourceRoot":"","sources":["../../../src/rules/normalize/color.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,kFAAkF;AAClF,MAAM,KAAK,GAAwE;IACjF,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACzB,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACvF,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACpF,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACnF,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE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;SACtB,KAAK,CAAC,SAAS,CAAC;SAChB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IACpD,OAAO,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AACvD,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/**\n * Colour canonicalization.\n *\n * `red`, `#f00`, `#ff0000`, `rgb(255,0,0)`, `rgb(255 0 0)`, and\n * `hsl(0, 100%, 50%)` all paint identical pixels. Left alone they produce six\n * different hashes, so a stylesheet refactor that swaps hex for a named colour\n * would invalidate every baseline it touches while changing nothing a user sees.\n *\n * Everything sRGB-expressible collapses to `rgb(R G B / A)`. Wide-gamut and\n * relative forms (`oklch`, `color-mix`, `light-dark`) are *not* converted:\n * doing so requires colour-space maths whose rounding would itself become a\n * source of hash instability, and — worse — would silently claim two colours are\n * equal when the engine may render them differently. They are whitespace- and\n * case-normalized only, and left symbolic.\n */\n\n/** Named CSS colours. `transparent` included; `currentcolor` deliberately not. */\nconst NAMED: Readonly<Record<string, readonly [number, number, number, number]>> = {\n transparent: [0, 0, 0, 0],\n aliceblue: [240, 248, 255, 1], antiquewhite: [250, 235, 215, 1], aqua: [0, 255, 255, 1],\n aquamarine: [127, 255, 212, 1], azure: [240, 255, 255, 1], beige: [245, 245, 220, 1],\n bisque: [255, 228, 196, 1], black: [0, 0, 0, 1], blanchedalmond: [255, 235, 205, 1],\n blue: [0, 0, 255, 1], blueviolet: [138, 43, 226, 1], brown: [165, 42, 42, 1],\n burlywood: [222, 184, 135, 1], cadetblue: [95, 158, 160, 1], chartreuse: [127, 255, 0, 1],\n chocolate: [210, 105, 30, 1], coral: [255, 127, 80, 1], cornflowerblue: [100, 149, 237, 1],\n cornsilk: [255, 248, 220, 1], crimson: [220, 20, 60, 1], cyan: [0, 255, 255, 1],\n darkblue: [0, 0, 139, 1], darkcyan: [0, 139, 139, 1], darkgoldenrod: [184, 134, 11, 1],\n darkgray: [169, 169, 169, 1], darkgreen: [0, 100, 0, 1], darkgrey: [169, 169, 169, 1],\n darkkhaki: [189, 183, 107, 1], darkmagenta: [139, 0, 139, 1], darkolivegreen: [85, 107, 47, 1],\n darkorange: [255, 140, 0, 1], darkorchid: [153, 50, 204, 1], darkred: [139, 0, 0, 1],\n darksalmon: [233, 150, 122, 1], darkseagreen: [143, 188, 143, 1], darkslateblue: [72, 61, 139, 1],\n darkslategray: [47, 79, 79, 1], darkslategrey: [47, 79, 79, 1], darkturquoise: [0, 206, 209, 1],\n darkviolet: [148, 0, 211, 1], deeppink: [255, 20, 147, 1], deepskyblue: [0, 191, 255, 1],\n dimgray: [105, 105, 105, 1], dimgrey: [105, 105, 105, 1], dodgerblue: [30, 144, 255, 1],\n firebrick: [178, 34, 34, 1], floralwhite: [255, 250, 240, 1], forestgreen: [34, 139, 34, 1],\n fuchsia: [255, 0, 255, 1], gainsboro: [220, 220, 220, 1], ghostwhite: [248, 248, 255, 1],\n gold: [255, 215, 0, 1], goldenrod: [218, 165, 32, 1], gray: [128, 128, 128, 1],\n green: [0, 128, 0, 1], greenyellow: [173, 255, 47, 1], grey: [128, 128, 128, 1],\n honeydew: [240, 255, 240, 1], hotpink: [255, 105, 180, 1], indianred: [205, 92, 92, 1],\n indigo: [75, 0, 130, 1], ivory: [255, 255, 240, 1], khaki: [240, 230, 140, 1],\n lavender: [230, 230, 250, 1], lavenderblush: [255, 240, 245, 1], lawngreen: [124, 252, 0, 1],\n lemonchiffon: [255, 250, 205, 1], lightblue: [173, 216, 230, 1], lightcoral: [240, 128, 128, 1],\n lightcyan: [224, 255, 255, 1], lightgoldenrodyellow: [250, 250, 210, 1],\n lightgray: [211, 211, 211, 1], lightgreen: [144, 238, 144, 1], lightgrey: [211, 211, 211, 1],\n lightpink: [255, 182, 193, 1], lightsalmon: [255, 160, 122, 1], lightseagreen: [32, 178, 170, 1],\n lightskyblue: [135, 206, 250, 1], lightslategray: [119, 136, 153, 1],\n lightslategrey: [119, 136, 153, 1], lightsteelblue: [176, 196, 222, 1],\n lightyellow: [255, 255, 224, 1], lime: [0, 255, 0, 1], limegreen: [50, 205, 50, 1],\n linen: [250, 240, 230, 1], magenta: [255, 0, 255, 1], maroon: [128, 0, 0, 1],\n mediumaquamarine: [102, 205, 170, 1], mediumblue: [0, 0, 205, 1],\n mediumorchid: [186, 85, 211, 1], mediumpurple: [147, 112, 219, 1],\n mediumseagreen: [60, 179, 113, 1], mediumslateblue: [123, 104, 238, 1],\n mediumspringgreen: [0, 250, 154, 1], mediumturquoise: [72, 209, 204, 1],\n mediumvioletred: [199, 21, 133, 1], midnightblue: [25, 25, 112, 1], mintcream: [245, 255, 250, 1],\n mistyrose: [255, 228, 225, 1], moccasin: [255, 228, 181, 1], navajowhite: [255, 222, 173, 1],\n navy: [0, 0, 128, 1], oldlace: [253, 245, 230, 1], olive: [128, 128, 0, 1],\n olivedrab: [107, 142, 35, 1], orange: [255, 165, 0, 1], orangered: [255, 69, 0, 1],\n orchid: [218, 112, 214, 1], palegoldenrod: [238, 232, 170, 1], palegreen: [152, 251, 152, 1],\n paleturquoise: [175, 238, 238, 1], palevioletred: [219, 112, 147, 1],\n papayawhip: [255, 239, 213, 1], peachpuff: [255, 218, 185, 1], peru: [205, 133, 63, 1],\n pink: [255, 192, 203, 1], plum: [221, 160, 221, 1], powderblue: [176, 224, 230, 1],\n purple: [128, 0, 128, 1], rebeccapurple: [102, 51, 153, 1], red: [255, 0, 0, 1],\n rosybrown: [188, 143, 143, 1], royalblue: [65, 105, 225, 1], saddlebrown: [139, 69, 19, 1],\n salmon: [250, 128, 114, 1], sandybrown: [244, 164, 96, 1], seagreen: [46, 139, 87, 1],\n seashell: [255, 245, 238, 1], sienna: [160, 82, 45, 1], silver: [192, 192, 192, 1],\n skyblue: [135, 206, 235, 1], slateblue: [106, 90, 205, 1], slategray: [112, 128, 144, 1],\n slategrey: [112, 128, 144, 1], snow: [255, 250, 250, 1], springgreen: [0, 255, 127, 1],\n steelblue: [70, 130, 180, 1], tan: [210, 180, 140, 1], teal: [0, 128, 128, 1],\n thistle: [216, 191, 216, 1], tomato: [255, 99, 71, 1], turquoise: [64, 224, 208, 1],\n violet: [238, 130, 238, 1], wheat: [245, 222, 179, 1], white: [255, 255, 255, 1],\n whitesmoke: [245, 245, 245, 1], yellow: [255, 255, 0, 1], yellowgreen: [154, 205, 50, 1],\n};\n\nexport type Rgba = readonly [number, number, number, number];\n\n/** Parse any sRGB-expressible colour. Returns `null` for anything else. */\nexport function parseColor(input: string): Rgba | null {\n const value = input.trim().toLowerCase();\n\n const named = NAMED[value];\n if (named) return named;\n\n if (value.startsWith('#')) return parseHex(value);\n if (value.startsWith('rgb')) return parseRgbFunction(value);\n if (value.startsWith('hsl')) return parseHslFunction(value);\n\n return null;\n}\n\n/**\n * Serialize to the single canonical form: `rgb(R G B / A)`.\n *\n * Channels are integers; alpha keeps three decimals, enough to distinguish every\n * 8-bit alpha step while discarding float noise from `hsl` conversion.\n */\nexport function formatColor([r, g, b, a]: Rgba): string {\n const channels = `${clampChannel(r)} ${clampChannel(g)} ${clampChannel(b)}`;\n const alpha = Math.round(clamp(a, 0, 1) * 1000) / 1000;\n return `rgb(${channels} / ${alpha})`;\n}\n\n/** Canonicalize if recognizable; otherwise normalize whitespace and case only. */\nexport function canonicalizeColor(input: string): string {\n const parsed = parseColor(input);\n return parsed ? formatColor(parsed) : collapseWhitespace(input);\n}\n\n/** Whether a property's value should be read as a colour. */\nexport function isColorProperty(property: string): boolean {\n return (\n property === 'color' ||\n property.endsWith('-color') ||\n property === 'background-color' ||\n property === 'caret-color'\n );\n}\n\nfunction parseHex(value: string): Rgba | null {\n const hex = value.slice(1);\n const expand = (c: string): number => Number.parseInt(c + c, 16);\n const pair = (i: number): number => Number.parseInt(hex.slice(i, i + 2), 16);\n\n switch (hex.length) {\n case 3:\n return [expand(hex[0]!), expand(hex[1]!), expand(hex[2]!), 1];\n case 4:\n return [expand(hex[0]!), expand(hex[1]!), expand(hex[2]!), expand(hex[3]!) / 255];\n case 6:\n return [pair(0), pair(2), pair(4), 1];\n case 8:\n return [pair(0), pair(2), pair(4), pair(6) / 255];\n default:\n return null;\n }\n}\n\n/**\n * Accepts both the legacy comma syntax and the modern space syntax, which are\n * the same colour written two ways — a distinction no renderer preserves and no\n * baseline should record.\n */\nfunction parseRgbFunction(value: string): Rgba | null {\n const args = functionArguments(value);\n if (!args || args.length < 3) return null;\n\n const channel = (raw: string): number =>\n raw.endsWith('%') ? (Number.parseFloat(raw) / 100) * 255 : Number.parseFloat(raw);\n\n const r = channel(args[0]!);\n const g = channel(args[1]!);\n const b = channel(args[2]!);\n const a = args.length > 3 ? parseAlpha(args[3]!) : 1;\n\n return [r, g, b, a].some(Number.isNaN) ? null : [Math.round(r), Math.round(g), Math.round(b), a];\n}\n\nfunction parseHslFunction(value: string): Rgba | null {\n const args = functionArguments(value);\n if (!args || args.length < 3) return null;\n\n const h = ((Number.parseFloat(args[0]!) % 360) + 360) % 360;\n const s = Number.parseFloat(args[1]!) / 100;\n const l = Number.parseFloat(args[2]!) / 100;\n const a = args.length > 3 ? parseAlpha(args[3]!) : 1;\n if ([h, s, l, a].some(Number.isNaN)) return null;\n\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = l - c / 2;\n const sextant = Math.floor(h / 60) % 6;\n const rgb: readonly (readonly [number, number, number])[] = [\n [c, x, 0], [x, c, 0], [0, c, x], [0, x, c], [x, 0, c], [c, 0, x],\n ];\n const [r, g, b] = rgb[sextant]!;\n\n return [Math.round((r + m) * 255), Math.round((g + m) * 255), Math.round((b + m) * 255), a];\n}\n\nfunction parseAlpha(raw: string): number {\n return raw.endsWith('%') ? Number.parseFloat(raw) / 100 : Number.parseFloat(raw);\n}\n\n/** Split `fn(a, b c / d)` into `['a','b','c','d']`, tolerating both separators. */\nfunction functionArguments(value: string): string[] | null {\n const open = value.indexOf('(');\n const close = value.lastIndexOf(')');\n if (open < 0 || close < open) return null;\n\n return value\n .slice(open + 1, close)\n .split(/[\\s,/]+/)\n .filter((part) => part.length > 0);\n}\n\nfunction clampChannel(value: number): number {\n return Math.round(clamp(value, 0, 255));\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return value < min ? min : value > max ? max : value;\n}\n\nfunction collapseWhitespace(value: string): string {\n return value.trim().replace(/\\s+/g, ' ');\n}\n"]}
@@ -0,0 +1,83 @@
1
+ import type { MatchedRule, RawCapture, RawNode, Rect } from '../../format/capture.js';
2
+ import { CHROMIUM_PROFILE, JSDOM_PROFILE, type ObservationProfile } from '../../format/profile.js';
3
+ import type { Holding } from '../../format/holding.js';
4
+ import { type SourceLocation, type StackFrame } from '../../format/provenance.js';
5
+ /**
6
+ * Fixture builders for `RawCapture`.
7
+ *
8
+ * These exist because the collector/core split makes them possible: `core` never
9
+ * touches a DOM, so its entire behavior is testable from hand-written data with
10
+ * no browser, no JSDOM, and no React. That is not a testing convenience — it is
11
+ * the property that lets the same normalizer serve a remote sub-renderer
12
+ * (ADR-0002), and these fixtures are how we keep it honest.
13
+ *
14
+ * Exported rather than test-local so collectors can assert that what they emit
15
+ * round-trips through the same shapes.
16
+ */
17
+ export interface NodeSpec {
18
+ readonly tag?: string;
19
+ readonly attributes?: Record<string, string>;
20
+ readonly role?: string;
21
+ readonly name?: string;
22
+ readonly description?: string;
23
+ readonly state?: Record<string, string | boolean | number>;
24
+ readonly rules?: readonly RuleSpec[];
25
+ readonly inlineStyle?: Record<string, string>;
26
+ readonly computedStyle?: Record<string, string>;
27
+ readonly rect?: Rect;
28
+ readonly text?: string;
29
+ /**
30
+ * Already-built nodes, not specs.
31
+ *
32
+ * Callers write `node({children: [node({...})]})`, so the children arrive
33
+ * built. Re-running the builder over them would read `spec.rules` off a
34
+ * `RawNode` — which has `matchedRules` — and silently produce a child with no
35
+ * style at all. Every style assertion below such a node would then pass by
36
+ * comparing nothing to nothing.
37
+ */
38
+ readonly children?: readonly RawNode[];
39
+ /**
40
+ * Owner chain, innermost first, with the props each boundary received.
41
+ * Digests are computed with the real `propsDigest`, so attribution tests
42
+ * exercise the shipped rule rather than a stand-in.
43
+ */
44
+ readonly owners?: readonly OwnerSpec[];
45
+ /** Where the JSX that created this node is written, as a runtime records it. */
46
+ readonly source?: SourceLocation;
47
+ /** Frames React captured, which a location has not yet been bought with. */
48
+ readonly stack?: readonly StackFrame[];
49
+ /**
50
+ * What the boundary rooted here was holding, as a framework adapter read it.
51
+ *
52
+ * Written out rather than derived from a props spec, because the cases worth
53
+ * writing are the ones a real render makes awkward to reach: a hook chain that
54
+ * ran out mid-read, a production build with no hook names at all, and a
55
+ * boundary whose every input agreed. See `compare/parting.ts`.
56
+ */
57
+ readonly holding?: Holding;
58
+ }
59
+ export interface OwnerSpec {
60
+ readonly name: string;
61
+ readonly props?: Record<string, unknown>;
62
+ }
63
+ export interface RuleSpec {
64
+ readonly selector: string;
65
+ readonly declare: Record<string, string>;
66
+ readonly specificity?: readonly [number, number, number];
67
+ readonly order?: number;
68
+ readonly sheet?: string;
69
+ readonly important?: boolean;
70
+ }
71
+ export declare function node(spec?: NodeSpec): RawNode;
72
+ export declare function rule(spec: RuleSpec): MatchedRule;
73
+ export interface CaptureSpec {
74
+ readonly root: RawNode;
75
+ readonly profile?: ObservationProfile;
76
+ readonly inheritedSeed?: Record<string, string>;
77
+ readonly subjectId?: string;
78
+ readonly engine?: string;
79
+ readonly fonts?: readonly string[];
80
+ }
81
+ export declare function capture(spec: CaptureSpec): RawCapture;
82
+ export { JSDOM_PROFILE, CHROMIUM_PROFILE };
83
+ //# sourceMappingURL=fixture.d.ts.map
@@ -0,0 +1,74 @@
1
+ import { CHROMIUM_PROFILE, JSDOM_PROFILE } from '../../format/profile.js';
2
+ import { propsDigest } from '../../format/provenance.js';
3
+ export function node(spec = {}) {
4
+ const aria = spec.role !== undefined ||
5
+ spec.name !== undefined ||
6
+ spec.description !== undefined ||
7
+ spec.state !== undefined
8
+ ? {
9
+ role: spec.role ?? null,
10
+ name: spec.name ?? null,
11
+ ...(spec.description !== undefined ? { description: spec.description } : {}),
12
+ state: spec.state ?? {},
13
+ }
14
+ : undefined;
15
+ return {
16
+ tag: spec.tag ?? 'div',
17
+ attributes: spec.attributes ?? {},
18
+ ...(aria ? { aria } : {}),
19
+ matchedRules: (spec.rules ?? []).map(rule),
20
+ ...(spec.inlineStyle ? { inlineStyle: spec.inlineStyle } : {}),
21
+ ...(spec.computedStyle ? { computedStyle: spec.computedStyle } : {}),
22
+ ...(spec.rect ? { rect: spec.rect } : {}),
23
+ ...(spec.text !== undefined ? { text: spec.text } : {}),
24
+ ...(spec.holding ? { holding: spec.holding } : {}),
25
+ ...(spec.owners || spec.source || spec.stack
26
+ ? {
27
+ provenance: {
28
+ owners: (spec.owners ?? []).map((owner) => ({
29
+ name: owner.name,
30
+ propsDigest: propsDigest(owner.props ?? {}),
31
+ })),
32
+ ...(spec.source ? { source: spec.source } : {}),
33
+ ...(spec.stack ? { stack: spec.stack } : {}),
34
+ },
35
+ }
36
+ : {}),
37
+ children: spec.children ?? [],
38
+ };
39
+ }
40
+ export function rule(spec) {
41
+ const declarations = Object.entries(spec.declare).map(([property, value]) => ({
42
+ property,
43
+ value,
44
+ important: spec.important ?? false,
45
+ }));
46
+ return {
47
+ sheet: spec.sheet ?? 'sheet.css',
48
+ selector: spec.selector,
49
+ specificity: spec.specificity ?? [0, 1, 0],
50
+ order: spec.order ?? 0,
51
+ declarations,
52
+ };
53
+ }
54
+ export function capture(spec) {
55
+ const profile = spec.profile ?? JSDOM_PROFILE;
56
+ return {
57
+ captureVersion: 1,
58
+ subject: { id: spec.subjectId ?? 'fixture:subject', kind: 'fixture' },
59
+ profile,
60
+ environment: {
61
+ profile: profile.id,
62
+ engine: spec.engine ?? `${profile.id}@test`,
63
+ viewport: { width: 1280, height: 720, deviceScaleFactor: 1, colorScheme: 'light' },
64
+ fonts: spec.fonts ?? ['Inter/400/normal/deadbeef'],
65
+ conditions: {},
66
+ assets: {},
67
+ },
68
+ root: spec.root,
69
+ inheritedSeed: spec.inheritedSeed ?? {},
70
+ diagnostics: [],
71
+ };
72
+ }
73
+ export { JSDOM_PROFILE, CHROMIUM_PROFILE };
74
+ //# sourceMappingURL=fixture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixture.js","sourceRoot":"","sources":["../../../src/rules/normalize/fixture.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAA2B,MAAM,yBAAyB,CAAC;AAEnG,OAAO,EAAE,WAAW,EAAwC,MAAM,4BAA4B,CAAC;AA4E/F,MAAM,UAAU,IAAI,CAAC,IAAI,GAAa,EAAE;IACtC,MAAM,IAAI,GACR,IAAI,CAAC,IAAI,KAAK,SAAS;QACvB,IAAI,CAAC,IAAI,KAAK,SAAS;QACvB,IAAI,CAAC,WAAW,KAAK,SAAS;QAC9B,IAAI,CAAC,KAAK,KAAK,SAAS;QACtB,CAAC,CAAC;YACE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;YACvB,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,KAAK,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I,CAAC,SAAS,IAAI,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE;QACrE,OAAO;QACP,WAAW,EAAE;YACX,OAAO,EAAE,OAAO,CAAC,EAAE;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,OAAO;YAC3C,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE;YAClF,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,2BAA2B,CAAC;YAClD,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,EAAE;SACX;QACD,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,EAAE;QACvC,WAAW,EAAE,EAAE;KAChB,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import type {\n Declaration,\n MatchedRule,\n RawCapture,\n RawNode,\n Rect,\n} from '../../format/capture.js';\nimport { CHROMIUM_PROFILE, JSDOM_PROFILE, type ObservationProfile } from '../../format/profile.js';\nimport type { Holding } from '../../format/holding.js';\nimport { propsDigest, type SourceLocation, type StackFrame } from '../../format/provenance.js';\n\n/**\n * Fixture builders for `RawCapture`.\n *\n * These exist because the collector/core split makes them possible: `core` never\n * touches a DOM, so its entire behavior is testable from hand-written data with\n * no browser, no JSDOM, and no React. That is not a testing convenience — it is\n * the property that lets the same normalizer serve a remote sub-renderer\n * (ADR-0002), and these fixtures are how we keep it honest.\n *\n * Exported rather than test-local so collectors can assert that what they emit\n * round-trips through the same shapes.\n */\n\nexport interface NodeSpec {\n readonly tag?: string;\n readonly attributes?: Record<string, string>;\n readonly role?: string;\n readonly name?: string;\n readonly description?: string;\n readonly state?: Record<string, string | boolean | number>;\n readonly rules?: readonly RuleSpec[];\n readonly inlineStyle?: Record<string, string>;\n readonly computedStyle?: Record<string, string>;\n readonly rect?: Rect;\n readonly text?: string;\n /**\n * Already-built nodes, not specs.\n *\n * Callers write `node({children: [node({...})]})`, so the children arrive\n * built. Re-running the builder over them would read `spec.rules` off a\n * `RawNode` — which has `matchedRules` — and silently produce a child with no\n * style at all. Every style assertion below such a node would then pass by\n * comparing nothing to nothing.\n */\n readonly children?: readonly RawNode[];\n\n /**\n * Owner chain, innermost first, with the props each boundary received.\n * Digests are computed with the real `propsDigest`, so attribution tests\n * exercise the shipped rule rather than a stand-in.\n */\n readonly owners?: readonly OwnerSpec[];\n\n /** Where the JSX that created this node is written, as a runtime records it. */\n readonly source?: SourceLocation;\n\n /** Frames React captured, which a location has not yet been bought with. */\n readonly stack?: readonly StackFrame[];\n\n /**\n * What the boundary rooted here was holding, as a framework adapter read it.\n *\n * Written out rather than derived from a props spec, because the cases worth\n * writing are the ones a real render makes awkward to reach: a hook chain that\n * ran out mid-read, a production build with no hook names at all, and a\n * boundary whose every input agreed. See `compare/parting.ts`.\n */\n readonly holding?: Holding;\n}\n\nexport interface OwnerSpec {\n readonly name: string;\n readonly props?: Record<string, unknown>;\n}\n\nexport interface RuleSpec {\n readonly selector: string;\n readonly declare: Record<string, string>;\n readonly specificity?: readonly [number, number, number];\n readonly order?: number;\n readonly sheet?: string;\n readonly important?: boolean;\n}\n\nexport function node(spec: NodeSpec = {}): RawNode {\n const aria =\n spec.role !== undefined ||\n spec.name !== undefined ||\n spec.description !== undefined ||\n spec.state !== undefined\n ? {\n role: spec.role ?? null,\n name: spec.name ?? null,\n ...(spec.description !== undefined ? { description: spec.description } : {}),\n state: spec.state ?? {},\n }\n : undefined;\n\n return {\n tag: spec.tag ?? 'div',\n attributes: spec.attributes ?? {},\n ...(aria ? { aria } : {}),\n matchedRules: (spec.rules ?? []).map(rule),\n ...(spec.inlineStyle ? { inlineStyle: spec.inlineStyle } : {}),\n ...(spec.computedStyle ? { computedStyle: spec.computedStyle } : {}),\n ...(spec.rect ? { rect: spec.rect } : {}),\n ...(spec.text !== undefined ? { text: spec.text } : {}),\n ...(spec.holding ? { holding: spec.holding } : {}),\n ...(spec.owners || spec.source || spec.stack\n ? {\n provenance: {\n owners: (spec.owners ?? []).map((owner) => ({\n name: owner.name,\n propsDigest: propsDigest(owner.props ?? {}),\n })),\n ...(spec.source ? { source: spec.source } : {}),\n ...(spec.stack ? { stack: spec.stack } : {}),\n },\n }\n : {}),\n children: spec.children ?? [],\n };\n}\n\nexport function rule(spec: RuleSpec): MatchedRule {\n const declarations: Declaration[] = Object.entries(spec.declare).map(([property, value]) => ({\n property,\n value,\n important: spec.important ?? false,\n }));\n\n return {\n sheet: spec.sheet ?? 'sheet.css',\n selector: spec.selector,\n specificity: spec.specificity ?? [0, 1, 0],\n order: spec.order ?? 0,\n declarations,\n };\n}\n\nexport interface CaptureSpec {\n readonly root: RawNode;\n readonly profile?: ObservationProfile;\n readonly inheritedSeed?: Record<string, string>;\n readonly subjectId?: string;\n readonly engine?: string;\n readonly fonts?: readonly string[];\n}\n\nexport function capture(spec: CaptureSpec): RawCapture {\n const profile = spec.profile ?? JSDOM_PROFILE;\n\n return {\n captureVersion: 1,\n subject: { id: spec.subjectId ?? 'fixture:subject', kind: 'fixture' },\n profile,\n environment: {\n profile: profile.id,\n engine: spec.engine ?? `${profile.id}@test`,\n viewport: { width: 1280, height: 720, deviceScaleFactor: 1, colorScheme: 'light' },\n fonts: spec.fonts ?? ['Inter/400/normal/deadbeef'],\n conditions: {},\n assets: {},\n },\n root: spec.root,\n inheritedSeed: spec.inheritedSeed ?? {},\n diagnostics: [],\n };\n}\n\nexport { JSDOM_PROFILE, CHROMIUM_PROFILE };\n"]}
@@ -0,0 +1,39 @@
1
+ import type { RawCapture } from '../../format/capture.js';
2
+ import { type Digest } from '../../format/hash.js';
3
+ import type { SemanticSnapshot } from '../../format/snapshot.js';
4
+ export { buildAliasMap, aliasAttributeValue, aliasStyleValue } from './alias.js';
5
+ export type { AliasMap, AliasResult } from './alias.js';
6
+ export { resolveStyle, resolveVariables, INHERITED_PROPERTIES, EMPTY_CONTEXT, } from './cascade.js';
7
+ export type { InheritContext, ResolvedStyle, DeclarationOrigin } from './cascade.js';
8
+ export { canonicalizeValue, canonicalizeTokens, canonicalizeDimension } from './value.js';
9
+ export { canonicalizeColor, parseColor, formatColor } from './color.js';
10
+ export { expandDeclaration, SHORTHAND_PROPERTIES } from './shorthand.js';
11
+ /**
12
+ * The normalization pipeline: `RawCapture` in, `SemanticSnapshot` out.
13
+ *
14
+ * There is exactly one of these, and both observation profiles enter it (ADR-0001).
15
+ * That is what makes "the same rules ran for JSDOM and Chromium" a fact of the
16
+ * call graph rather than a claim maintained by discipline.
17
+ */
18
+ export interface NormalizeOptions {
19
+ /**
20
+ * Collapse `div`/`span` wrappers that carry no role, no attributes, and no
21
+ * non-inherited styling. Defaults to on — CSS-in-JS and layout libraries emit
22
+ * these by the dozen, and their arrival and departure during a refactor is the
23
+ * single largest source of structural churn.
24
+ */
25
+ readonly collapseWrappers?: boolean;
26
+ /** Replace text with its digest. For subjects whose copy is volatile by policy. */
27
+ readonly digestText?: boolean;
28
+ /**
29
+ * Absolute directory the recorded JSX source locations are made relative to.
30
+ *
31
+ * The transform writes absolute paths, and a snapshot is a stored artifact
32
+ * compared across machines. Normalizing here rather than at the reader is the
33
+ * same reason everything else is normalized here: one pipeline, both profiles.
34
+ */
35
+ readonly sourceRoot?: string;
36
+ }
37
+ export declare function normalize(capture: RawCapture, options?: NormalizeOptions): SemanticSnapshot;
38
+ export type { Digest };
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,268 @@
1
+ import { environmentKey } from '../../format/environment.js';
2
+ import { digestCombine, digestValue } from '../../format/hash.js';
3
+ import { relativizeSource } from '../../format/provenance.js';
4
+ import { ALLOWLIST_VERSION, RULESET_VERSION, admitsAttribute } from '../ruleset.js';
5
+ import { aliasAttributeValue, aliasStyleValue, buildAliasMap } from './alias.js';
6
+ import { sitesIn, structureOf, styleOf } from './project.js';
7
+ import { isInertWrapper } from './wrapper.js';
8
+ import { resolveStyle, } from './cascade.js';
9
+ export { buildAliasMap, aliasAttributeValue, aliasStyleValue } from './alias.js';
10
+ export { resolveStyle, resolveVariables, INHERITED_PROPERTIES, EMPTY_CONTEXT, } from './cascade.js';
11
+ export { canonicalizeValue, canonicalizeTokens, canonicalizeDimension } from './value.js';
12
+ export { canonicalizeColor, parseColor, formatColor } from './color.js';
13
+ export { expandDeclaration, SHORTHAND_PROPERTIES } from './shorthand.js';
14
+ export function normalize(capture, options = {}) {
15
+ const { collapseWrappers = true, digestText = false, sourceRoot } = options;
16
+ const portals = capture.portals ?? [];
17
+ const aliases = buildAliasMap(capture.root, portals);
18
+ const diagnostics = [...capture.diagnostics];
19
+ for (const id of aliases.dangling) {
20
+ diagnostics.push({
21
+ severity: 'warn',
22
+ code: 'dangling-id-reference',
23
+ // Reported rather than normalized away: an accessible-name reference
24
+ // pointing outside the subject is either a genuine break or a subject
25
+ // boundary drawn too tightly. Both need a human.
26
+ message: `reference to id "${id}" resolves outside the subject subtree`,
27
+ });
28
+ }
29
+ // Custom properties go into the resolution scope, never into `inherited`.
30
+ //
31
+ // The seed arrives with both mixed together, and injecting the whole thing as
32
+ // inherited style put every ancestor-declared token into the subject root's
33
+ // `style` map as if it were a rendered value. Two consequences, both bad: a
34
+ // token nothing in the subject consumes still changed that subject's hash — so
35
+ // editing any token invalidated every baseline in the repository — and the
36
+ // resulting delta had no owner chain, producing an `unattributed` root on a
37
+ // change that was perfectly well understood.
38
+ const seed = {
39
+ inherited: renderableOnly(capture.inheritedSeed),
40
+ customProperties: customPropertiesOf(capture.inheritedSeed),
41
+ };
42
+ const styleProvenance = [];
43
+ const state = {
44
+ collapseWrappers,
45
+ digestText,
46
+ ...(sourceRoot !== undefined ? { sourceRoot } : {}),
47
+ styleProvenance,
48
+ declaredBy: new WeakMap(),
49
+ };
50
+ const container = normalizeNode(capture, capture.root, aliases, seed, '0', state);
51
+ // Portalled subtrees are appended as children of the subject root, each
52
+ // flagged `portalled`. Appending rather than splicing in place keeps their
53
+ // paths stable when DOM children are added or removed, and keeps them out of
54
+ // the wrapper-collapse pass, which reasons about siblings.
55
+ const root = portals.length === 0
56
+ ? container
57
+ : {
58
+ ...container,
59
+ children: [
60
+ ...container.children,
61
+ ...portals.map((portal, index) => ({
62
+ ...normalizeNode(capture, portal, aliases, { inherited: {}, customProperties: seed.customProperties }, `0/portal:${index}`, state),
63
+ portalled: true,
64
+ })),
65
+ ],
66
+ };
67
+ const structureHash = digestValue(structureOf(root));
68
+ const styleHash = digestValue(styleOf(root, capture.profile.layout));
69
+ // Resolved from the *finished* tree rather than during the walk. Wrapper
70
+ // collapse re-paths whole subtrees, so a path recorded on the way down names a
71
+ // node that may not be there on the way out — and an ignore that quietly moved
72
+ // one level up absorbs a sibling nobody excluded.
73
+ const ignoreSites = sitesIn(root);
74
+ const environment = environmentKey({
75
+ ...capture.environment,
76
+ ruleset: RULESET_VERSION,
77
+ allowlist: ALLOWLIST_VERSION,
78
+ });
79
+ return {
80
+ formatVersion: 1,
81
+ subject: capture.subject,
82
+ profile: capture.profile,
83
+ environment,
84
+ // Keyed on the *semantic* digest, not the full one. A snapshot is a semantic
85
+ // artifact, so binding it to inputs that only rasterization can observe would
86
+ // split one baseline across machines that render it identically.
87
+ renderHash: digestCombine('render', [environment.semanticDigest, structureHash, styleHash]),
88
+ structureHash,
89
+ styleHash,
90
+ root,
91
+ styleProvenance,
92
+ ...(ignoreSites.length > 0 ? { ignoreSites } : {}),
93
+ diagnostics,
94
+ };
95
+ }
96
+ /**
97
+ * Provenance carrying a path this machine can quote back to a repository, and
98
+ * carrying nothing that belongs to the machine it was captured on.
99
+ *
100
+ * The location arrives from the page, where nothing knows what the repository
101
+ * root is; the collector does, and this is the one point every node passes
102
+ * through afterwards.
103
+ *
104
+ * **`stack` rides through, unspent and unrooted.** Frames hold absolute URLs
105
+ * with a dev server's port in them, which would make them machine-specific if
106
+ * anything compared or stored them — and nothing does. `structureOf` and
107
+ * `styleOf` in `packages/core/src/rules/normalize/project.ts` are whitelists
108
+ * and neither admits provenance at all, so a frame changes no digest and
109
+ * disagrees with no baseline; and a snapshot itself never reaches disk, because
110
+ * the history record writes the hashes it folds out of one. What a frame is, is
111
+ * a fetch nobody has asked for yet, kept against the moment a region or a
112
+ * finding names this node — which is where `locateSites` spends it.
113
+ *
114
+ * Rooting a frame here would be the wrong move even so. A frame's URL is what
115
+ * the *fetch* needs, and a repository-relative path is not fetchable.
116
+ */
117
+ function rooted(provenance, root) {
118
+ if (root === undefined || provenance.source === undefined)
119
+ return provenance;
120
+ const source = relativizeSource(provenance.source, root);
121
+ return source === provenance.source ? provenance : { ...provenance, source };
122
+ }
123
+ function normalizeNode(capture, subtreeRoot, aliases, context, path, state) {
124
+ return build(subtreeRoot, context, path);
125
+ function build(node, inherited, nodePath) {
126
+ const resolved = resolveStyle({
127
+ matchedRules: node.matchedRules,
128
+ ...(node.inlineStyle ? { inlineStyle: node.inlineStyle } : {}),
129
+ ...(node.computedStyle ? { computedStyle: node.computedStyle } : {}),
130
+ context: inherited,
131
+ });
132
+ const style = {};
133
+ for (const [property, value] of Object.entries(resolved.style)) {
134
+ style[property] = aliasStyleValue(aliases, value);
135
+ }
136
+ for (const [property, origin] of Object.entries(resolved.origins)) {
137
+ state.styleProvenance.push({
138
+ path: nodePath,
139
+ property,
140
+ sheet: origin.sheet,
141
+ selector: normalizeSelector(origin.selector),
142
+ ...(origin.tokenName ? { tokenName: origin.tokenName } : {}),
143
+ ...(origin.source ? { source: origin.source } : {}),
144
+ });
145
+ }
146
+ const attributes = {};
147
+ for (const [name, value] of Object.entries(node.attributes)) {
148
+ if (!admitsAttribute(name))
149
+ continue;
150
+ attributes[name] = aliasAttributeValue(aliases, name, value);
151
+ }
152
+ const rawId = node.attributes['id'];
153
+ const alias = rawId !== undefined ? aliases.local.get(rawId) : undefined;
154
+ const children = collectChildren(node, resolved.childContext, nodePath);
155
+ const declaredHere = new Set(Object.keys(resolved.origins));
156
+ const text = node.text === undefined
157
+ ? undefined
158
+ : state.digestText
159
+ ? digestValue(node.text)
160
+ : normalizeText(node.text);
161
+ const built = {
162
+ path: nodePath,
163
+ tag: node.tag.toLowerCase(),
164
+ ...(alias !== undefined ? { alias } : {}),
165
+ ...(node.aria?.role ? { role: node.aria.role } : {}),
166
+ ...(node.aria?.name ? { name: node.aria.name } : {}),
167
+ ...(node.aria?.description ? { description: node.aria.description } : {}),
168
+ ...(node.aria && Object.keys(node.aria.state).length > 0 ? { state: node.aria.state } : {}),
169
+ attributes,
170
+ style,
171
+ ...(Object.keys(resolved.tokens).length > 0 ? { tokens: resolved.tokens } : {}),
172
+ ...(Object.keys(resolved.propertyTokens).length > 0
173
+ ? { styleTokens: resolved.propertyTokens }
174
+ : {}),
175
+ ...(capture.profile.layout && node.rect ? { rect: node.rect } : {}),
176
+ ...(text !== undefined ? { text } : {}),
177
+ ...(node.provenance ? { provenance: rooted(node.provenance, state.sourceRoot) } : {}),
178
+ ...(node.wiring ? { wiring: node.wiring } : {}),
179
+ // Carried and never projected, like `ignoredBy` below it. This is the
180
+ // only field on a node that holds values rather than shapes, and the
181
+ // reason it may is that nothing downstream hashes it.
182
+ ...(node.holding ? { holding: node.holding } : {}),
183
+ // Carried, never acted on. `structureOf` and `styleOf` project the fields
184
+ // they hash by name, so this reaches the snapshot without reaching the
185
+ // identity — which is the whole contract an ignore is under.
186
+ ...(node.ignoredBy && node.ignoredBy.length > 0 ? { ignoredBy: node.ignoredBy } : {}),
187
+ children,
188
+ };
189
+ state.declaredBy.set(built, declaredHere);
190
+ return built;
191
+ }
192
+ function collectChildren(node, childContext, nodePath) {
193
+ const source = [...node.children, ...(node.shadowChildren ?? [])];
194
+ const built = [];
195
+ for (const child of source) {
196
+ const candidate = build(child, childContext, `${nodePath}/${built.length}`);
197
+ // A collapsed wrapper is replaced by its children in place. Re-pathing them
198
+ // is why collapse must happen during the walk rather than as a later pass:
199
+ // paths must reflect the final tree, or every downstream reference is stale.
200
+ if (state.collapseWrappers && isInertWrapper(child, candidate, state.declaredBy)) {
201
+ for (const grandchild of candidate.children) {
202
+ built.push(repath(grandchild, `${nodePath}/${built.length}`));
203
+ }
204
+ continue;
205
+ }
206
+ built.push(candidate);
207
+ }
208
+ return built;
209
+ }
210
+ }
211
+ function repath(node, path) {
212
+ return {
213
+ ...node,
214
+ path,
215
+ children: node.children.map((child, index) => repath(child, `${path}/${index}`)),
216
+ };
217
+ }
218
+ /**
219
+ * Collapse runs of whitespace to a single space, without trimming.
220
+ *
221
+ * Collapsing matches what `white-space: normal` does, so indentation depth is
222
+ * not a hash input. Trimming does not: a *boundary* space between inline
223
+ * elements is rendered, and removing it changes "a b" to "ab". Since the
224
+ * formatting context is unknowable without layout, the space is kept —
225
+ * over-reporting in a block context, rather than reporting a visible text change
226
+ * as `unchanged`.
227
+ *
228
+ * This costs little in practice because subjects are React-rendered, and JSX
229
+ * already strips whitespace-only lines and newline-adjacent indentation at
230
+ * compile time. Hand-written HTML pays more.
231
+ */
232
+ function normalizeText(text) {
233
+ return text.replace(/\s+/g, ' ');
234
+ }
235
+ /**
236
+ * Replace generated segments in selector text with a placeholder.
237
+ *
238
+ * Selectors reach the snapshot only through the attribution side-channel, which
239
+ * is outside the hash — but a selector naming `css-1a2b3c` is still useless in a
240
+ * docket, because the name changes whenever any declaration in its file changes.
241
+ * The placeholder keeps the shape, which is what identifies the rule to a reader.
242
+ */
243
+ function normalizeSelector(selector) {
244
+ return selector
245
+ .replace(/\.(?:css|sc|emotion)-[a-z0-9]{4,}/gi, '.«generated»')
246
+ .replace(/\.[\w-]*__[a-z0-9]{5,}\b/gi, '.«generated»')
247
+ .replace(/\[data-(?:styled|emotion|v)-[^\]]*\]/gi, '[«generated»]')
248
+ .replace(/\s+/g, ' ')
249
+ .trim();
250
+ }
251
+ /** The seed minus its custom properties: values that actually render. */
252
+ function renderableOnly(seed) {
253
+ const renderable = {};
254
+ for (const [property, value] of Object.entries(seed)) {
255
+ if (!property.startsWith('--'))
256
+ renderable[property] = value;
257
+ }
258
+ return renderable;
259
+ }
260
+ function customPropertiesOf(seed) {
261
+ const custom = {};
262
+ for (const [property, value] of Object.entries(seed)) {
263
+ if (property.startsWith('--'))
264
+ custom[property] = value;
265
+ }
266
+ return custom;
267
+ }
268
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/normalize/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAe,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAoB,MAAM,YAAY,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAEL,YAAY,GAEb,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjF,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAgCzE,MAAM,UAAU,SAAS,CAAC,OAAmB,EAAE,OAAO,GAAqB,EAAE;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Q,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;IAC1D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { Diagnostic, RawCapture, RawNode } from '../../format/capture.js';\nimport { environmentKey } from '../../format/environment.js';\nimport { digestCombine, digestValue, type Digest } from '../../format/hash.js';\nimport { relativizeSource, type Provenance } from '../../format/provenance.js';\nimport { ALLOWLIST_VERSION, RULESET_VERSION, admitsAttribute } from '../ruleset.js';\nimport type { SemanticNode, SemanticSnapshot, StyleProvenanceEntry } from '../../format/snapshot.js';\nimport { aliasAttributeValue, aliasStyleValue, buildAliasMap, type AliasResult } from './alias.js';\nimport { sitesIn, structureOf, styleOf } from './project.js';\nimport { isInertWrapper } from './wrapper.js';\nimport {\n \n resolveStyle,\n type InheritContext,\n} from './cascade.js';\n\nexport { buildAliasMap, aliasAttributeValue, aliasStyleValue } from './alias.js';\nexport type { AliasMap, AliasResult } from './alias.js';\nexport {\n resolveStyle,\n resolveVariables,\n INHERITED_PROPERTIES,\n EMPTY_CONTEXT,\n} from './cascade.js';\nexport type { InheritContext, ResolvedStyle, DeclarationOrigin } from './cascade.js';\nexport { canonicalizeValue, canonicalizeTokens, canonicalizeDimension } from './value.js';\nexport { canonicalizeColor, parseColor, formatColor } from './color.js';\nexport { expandDeclaration, SHORTHAND_PROPERTIES } from './shorthand.js';\n\n/**\n * The normalization pipeline: `RawCapture` in, `SemanticSnapshot` out.\n *\n * There is exactly one of these, and both observation profiles enter it (ADR-0001).\n * That is what makes \"the same rules ran for JSDOM and Chromium\" a fact of the\n * call graph rather than a claim maintained by discipline.\n */\n\nexport interface NormalizeOptions {\n /**\n * Collapse `div`/`span` wrappers that carry no role, no attributes, and no\n * non-inherited styling. Defaults to on — CSS-in-JS and layout libraries emit\n * these by the dozen, and their arrival and departure during a refactor is the\n * single largest source of structural churn.\n */\n readonly collapseWrappers?: boolean;\n\n /** Replace text with its digest. For subjects whose copy is volatile by policy. */\n readonly digestText?: boolean;\n\n /**\n * Absolute directory the recorded JSX source locations are made relative to.\n *\n * The transform writes absolute paths, and a snapshot is a stored artifact\n * compared across machines. Normalizing here rather than at the reader is the\n * same reason everything else is normalized here: one pipeline, both profiles.\n */\n readonly sourceRoot?: string;\n}\n\nexport function normalize(capture: RawCapture, options: NormalizeOptions = {}): SemanticSnapshot {\n const { collapseWrappers = true, digestText = false, sourceRoot } = options;\n\n const portals = capture.portals ?? [];\n const aliases = buildAliasMap(capture.root, portals);\n const diagnostics: Diagnostic[] = [...capture.diagnostics];\n\n for (const id of aliases.dangling) {\n diagnostics.push({\n severity: 'warn',\n code: 'dangling-id-reference',\n // Reported rather than normalized away: an accessible-name reference\n // pointing outside the subject is either a genuine break or a subject\n // boundary drawn too tightly. Both need a human.\n message: `reference to id \"${id}\" resolves outside the subject subtree`,\n });\n }\n\n // Custom properties go into the resolution scope, never into `inherited`.\n //\n // The seed arrives with both mixed together, and injecting the whole thing as\n // inherited style put every ancestor-declared token into the subject root's\n // `style` map as if it were a rendered value. Two consequences, both bad: a\n // token nothing in the subject consumes still changed that subject's hash — so\n // editing any token invalidated every baseline in the repository — and the\n // resulting delta had no owner chain, producing an `unattributed` root on a\n // change that was perfectly well understood.\n const seed: InheritContext = {\n inherited: renderableOnly(capture.inheritedSeed),\n customProperties: customPropertiesOf(capture.inheritedSeed),\n };\n\n const styleProvenance: StyleProvenanceEntry[] = [];\n const state: WalkState = {\n collapseWrappers,\n digestText,\n ...(sourceRoot !== undefined ? { sourceRoot } : {}),\n styleProvenance,\n declaredBy: new WeakMap(),\n };\n const container = normalizeNode(capture, capture.root, aliases, seed, '0', state);\n\n // Portalled subtrees are appended as children of the subject root, each\n // flagged `portalled`. Appending rather than splicing in place keeps their\n // paths stable when DOM children are added or removed, and keeps them out of\n // the wrapper-collapse pass, which reasons about siblings.\n const root: SemanticNode =\n portals.length === 0\n ? container\n : {\n ...container,\n children: [\n ...container.children,\n ...portals.map((portal, index) => ({\n ...normalizeNode(\n capture,\n portal,\n aliases,\n { inherited: {}, customProperties: seed.customProperties },\n `0/portal:${index}`,\n state,\n ),\n portalled: true as const,\n })),\n ],\n };\n\n const structureHash = digestValue(structureOf(root));\n const styleHash = digestValue(styleOf(root, capture.profile.layout));\n\n // Resolved from the *finished* tree rather than during the walk. Wrapper\n // collapse re-paths whole subtrees, so a path recorded on the way down names a\n // node that may not be there on the way out — and an ignore that quietly moved\n // one level up absorbs a sibling nobody excluded.\n const ignoreSites = sitesIn(root);\n\n const environment = environmentKey({\n ...capture.environment,\n ruleset: RULESET_VERSION,\n allowlist: ALLOWLIST_VERSION,\n });\n\n return {\n formatVersion: 1,\n subject: capture.subject,\n profile: capture.profile,\n environment,\n // Keyed on the *semantic* digest, not the full one. A snapshot is a semantic\n // artifact, so binding it to inputs that only rasterization can observe would\n // split one baseline across machines that render it identically.\n renderHash: digestCombine('render', [environment.semanticDigest, structureHash, styleHash]),\n structureHash,\n styleHash,\n root,\n styleProvenance,\n ...(ignoreSites.length > 0 ? { ignoreSites } : {}),\n diagnostics,\n };\n}\n\ninterface WalkState {\n readonly collapseWrappers: boolean;\n readonly digestText: boolean;\n readonly sourceRoot?: string;\n readonly styleProvenance: StyleProvenanceEntry[];\n /**\n * Properties each node declared *itself*, as opposed to inheriting.\n *\n * The wrapper-inertness test needs this distinction and cannot recover it from\n * the finished node: by then an inherited `color` and a declared `color` are\n * the same entry in `style`. Keyed by node identity rather than threaded\n * through the return type, so the recursive shape stays a plain tree walk.\n */\n readonly declaredBy: WeakMap<SemanticNode, ReadonlySet<string>>;\n}\n\n/**\n * Provenance carrying a path this machine can quote back to a repository, and\n * carrying nothing that belongs to the machine it was captured on.\n *\n * The location arrives from the page, where nothing knows what the repository\n * root is; the collector does, and this is the one point every node passes\n * through afterwards.\n *\n * **`stack` rides through, unspent and unrooted.** Frames hold absolute URLs\n * with a dev server's port in them, which would make them machine-specific if\n * anything compared or stored them — and nothing does. `structureOf` and\n * `styleOf` in `packages/core/src/rules/normalize/project.ts` are whitelists\n * and neither admits provenance at all, so a frame changes no digest and\n * disagrees with no baseline; and a snapshot itself never reaches disk, because\n * the history record writes the hashes it folds out of one. What a frame is, is\n * a fetch nobody has asked for yet, kept against the moment a region or a\n * finding names this node — which is where `locateSites` spends it.\n *\n * Rooting a frame here would be the wrong move even so. A frame's URL is what\n * the *fetch* needs, and a repository-relative path is not fetchable.\n */\nfunction rooted(provenance: Provenance, root: string | undefined): Provenance {\n if (root === undefined || provenance.source === undefined) return provenance;\n\n const source = relativizeSource(provenance.source, root);\n return source === provenance.source ? provenance : { ...provenance, source };\n}\n\nfunction normalizeNode(\n capture: RawCapture,\n subtreeRoot: RawNode,\n aliases: AliasResult,\n context: InheritContext,\n path: string,\n state: WalkState,\n): SemanticNode {\n return build(subtreeRoot, context, path);\n\n function build(node: RawNode, inherited: InheritContext, nodePath: string): SemanticNode {\n const resolved = resolveStyle({\n matchedRules: node.matchedRules,\n ...(node.inlineStyle ? { inlineStyle: node.inlineStyle } : {}),\n ...(node.computedStyle ? { computedStyle: node.computedStyle } : {}),\n context: inherited,\n });\n\n const style: Record<string, string> = {};\n for (const [property, value] of Object.entries(resolved.style)) {\n style[property] = aliasStyleValue(aliases, value);\n }\n\n for (const [property, origin] of Object.entries(resolved.origins)) {\n state.styleProvenance.push({\n path: nodePath,\n property,\n sheet: origin.sheet,\n selector: normalizeSelector(origin.selector),\n ...(origin.tokenName ? { tokenName: origin.tokenName } : {}),\n ...(origin.source ? { source: origin.source } : {}),\n });\n }\n\n const attributes: Record<string, string> = {};\n for (const [name, value] of Object.entries(node.attributes)) {\n if (!admitsAttribute(name)) continue;\n attributes[name] = aliasAttributeValue(aliases, name, value);\n }\n\n const rawId = node.attributes['id'];\n const alias = rawId !== undefined ? aliases.local.get(rawId) : undefined;\n\n const children = collectChildren(node, resolved.childContext, nodePath);\n const declaredHere = new Set(Object.keys(resolved.origins));\n\n const text =\n node.text === undefined\n ? undefined\n : state.digestText\n ? digestValue(node.text)\n : normalizeText(node.text);\n\n const built: SemanticNode = {\n path: nodePath,\n tag: node.tag.toLowerCase(),\n ...(alias !== undefined ? { alias } : {}),\n ...(node.aria?.role ? { role: node.aria.role } : {}),\n ...(node.aria?.name ? { name: node.aria.name } : {}),\n ...(node.aria?.description ? { description: node.aria.description } : {}),\n ...(node.aria && Object.keys(node.aria.state).length > 0 ? { state: node.aria.state } : {}),\n attributes,\n style,\n ...(Object.keys(resolved.tokens).length > 0 ? { tokens: resolved.tokens } : {}),\n ...(Object.keys(resolved.propertyTokens).length > 0\n ? { styleTokens: resolved.propertyTokens }\n : {}),\n ...(capture.profile.layout && node.rect ? { rect: node.rect } : {}),\n ...(text !== undefined ? { text } : {}),\n ...(node.provenance ? { provenance: rooted(node.provenance, state.sourceRoot) } : {}),\n ...(node.wiring ? { wiring: node.wiring } : {}),\n // Carried and never projected, like `ignoredBy` below it. This is the\n // only field on a node that holds values rather than shapes, and the\n // reason it may is that nothing downstream hashes it.\n ...(node.holding ? { holding: node.holding } : {}),\n // Carried, never acted on. `structureOf` and `styleOf` project the fields\n // they hash by name, so this reaches the snapshot without reaching the\n // identity — which is the whole contract an ignore is under.\n ...(node.ignoredBy && node.ignoredBy.length > 0 ? { ignoredBy: node.ignoredBy } : {}),\n children,\n };\n\n state.declaredBy.set(built, declaredHere);\n return built;\n }\n\n function collectChildren(\n node: RawNode,\n childContext: InheritContext,\n nodePath: string,\n ): readonly SemanticNode[] {\n const source = [...node.children, ...(node.shadowChildren ?? [])];\n const built: SemanticNode[] = [];\n\n for (const child of source) {\n const candidate = build(child, childContext, `${nodePath}/${built.length}`);\n\n // A collapsed wrapper is replaced by its children in place. Re-pathing them\n // is why collapse must happen during the walk rather than as a later pass:\n // paths must reflect the final tree, or every downstream reference is stale.\n if (state.collapseWrappers && isInertWrapper(child, candidate, state.declaredBy)) {\n for (const grandchild of candidate.children) {\n built.push(repath(grandchild, `${nodePath}/${built.length}`));\n }\n continue;\n }\n\n built.push(candidate);\n }\n\n return built;\n }\n}\n\nfunction repath(node: SemanticNode, path: string): SemanticNode {\n return {\n ...node,\n path,\n children: node.children.map((child, index) => repath(child, `${path}/${index}`)),\n };\n}\n\n\n\n/**\n * Collapse runs of whitespace to a single space, without trimming.\n *\n * Collapsing matches what `white-space: normal` does, so indentation depth is\n * not a hash input. Trimming does not: a *boundary* space between inline\n * elements is rendered, and removing it changes \"a b\" to \"ab\". Since the\n * formatting context is unknowable without layout, the space is kept —\n * over-reporting in a block context, rather than reporting a visible text change\n * as `unchanged`.\n *\n * This costs little in practice because subjects are React-rendered, and JSX\n * already strips whitespace-only lines and newline-adjacent indentation at\n * compile time. Hand-written HTML pays more.\n */\nfunction normalizeText(text: string): string {\n return text.replace(/\\s+/g, ' ');\n}\n\n/**\n * Replace generated segments in selector text with a placeholder.\n *\n * Selectors reach the snapshot only through the attribution side-channel, which\n * is outside the hash — but a selector naming `css-1a2b3c` is still useless in a\n * docket, because the name changes whenever any declaration in its file changes.\n * The placeholder keeps the shape, which is what identifies the rule to a reader.\n */\nfunction normalizeSelector(selector: string): string {\n return selector\n .replace(/\\.(?:css|sc|emotion)-[a-z0-9]{4,}/gi, '.«generated»')\n .replace(/\\.[\\w-]*__[a-z0-9]{5,}\\b/gi, '.«generated»')\n .replace(/\\[data-(?:styled|emotion|v)-[^\\]]*\\]/gi, '[«generated»]')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/** The seed minus its custom properties: values that actually render. */\nfunction renderableOnly(seed: Readonly<Record<string, string>>): Record<string, string> {\n const renderable: Record<string, string> = {};\n for (const [property, value] of Object.entries(seed)) {\n if (!property.startsWith('--')) renderable[property] = value;\n }\n return renderable;\n}\n\nfunction customPropertiesOf(seed: Readonly<Record<string, string>>): Record<string, string> {\n const custom: Record<string, string> = {};\n for (const [property, value] of Object.entries(seed)) {\n if (property.startsWith('--')) custom[property] = value;\n }\n return custom;\n}\n\nexport type { Digest };\n"]}