@ethlete/cli 3.0.0-next.25 → 3.0.0-next.27

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 (592) hide show
  1. package/CHANGELOG.md +417 -0
  2. package/build-info.json +1 -0
  3. package/design/define-call.ts +99 -31
  4. package/design/define-part.ts +50 -3
  5. package/design/icon-sheet.ts +1 -1
  6. package/design/interaction-rows.ts +13 -6
  7. package/design/logo-sheet.ts +52 -0
  8. package/design/mark-part.ts +51 -1
  9. package/design/motion-drive.ts +215 -0
  10. package/design/motion-runtime.ts +14 -2
  11. package/design/motion-tokens.ts +177 -0
  12. package/design/token-sheet.ts +1 -1
  13. package/design/web/frame-fill.ts +4 -0
  14. package/design/web/frame-fit.ts +7 -0
  15. package/design/web/frame-scheme.ts +44 -0
  16. package/design/web/frame-surfaces.ts +294 -0
  17. package/design/web/frame.ts +162 -43
  18. package/design/web/surface-interactive.css +42 -0
  19. package/design/with-action.ts +29 -0
  20. package/package.json +3 -1
  21. package/src/index.js +9 -1
  22. package/src/index.js.map +1 -1
  23. package/src/lib/design/asset-shot.js +2 -2
  24. package/src/lib/design/asset-shot.js.map +1 -1
  25. package/src/lib/design/build-watch.d.ts +26 -0
  26. package/src/lib/design/build-watch.js +138 -0
  27. package/src/lib/design/build-watch.js.map +1 -0
  28. package/src/lib/design/calls-tsconfig.d.ts +2 -0
  29. package/src/lib/design/calls-tsconfig.js +10 -3
  30. package/src/lib/design/calls-tsconfig.js.map +1 -1
  31. package/src/lib/design/check.d.ts +1 -0
  32. package/src/lib/design/check.js +195 -13
  33. package/src/lib/design/check.js.map +1 -1
  34. package/src/lib/design/commit-hunks.d.ts +22 -0
  35. package/src/lib/design/commit-hunks.js +173 -0
  36. package/src/lib/design/commit-hunks.js.map +1 -0
  37. package/src/lib/design/contact-sheet.d.ts +9 -0
  38. package/src/lib/design/contact-sheet.js +38 -4
  39. package/src/lib/design/contact-sheet.js.map +1 -1
  40. package/src/lib/design/design-command.d.ts +2 -0
  41. package/src/lib/design/design-command.js +183 -15
  42. package/src/lib/design/design-command.js.map +1 -1
  43. package/src/lib/design/draw-ledger.d.ts +36 -0
  44. package/src/lib/design/draw-ledger.js +52 -0
  45. package/src/lib/design/draw-ledger.js.map +1 -0
  46. package/src/lib/design/force-interactions.d.ts +1 -1
  47. package/src/lib/design/force-interactions.js +4 -2
  48. package/src/lib/design/force-interactions.js.map +1 -1
  49. package/src/lib/design/inbox-command.js +9 -5
  50. package/src/lib/design/inbox-command.js.map +1 -1
  51. package/src/lib/design/mcp-command.d.ts +28 -3
  52. package/src/lib/design/mcp-command.js +134 -21
  53. package/src/lib/design/mcp-command.js.map +1 -1
  54. package/src/lib/design/merge-compare.d.ts +10 -2
  55. package/src/lib/design/merge-compare.js +63 -11
  56. package/src/lib/design/merge-compare.js.map +1 -1
  57. package/src/lib/design/motion-command.js +10 -16
  58. package/src/lib/design/motion-command.js.map +1 -1
  59. package/src/lib/design/motion-shot.js +3 -2
  60. package/src/lib/design/motion-shot.js.map +1 -1
  61. package/src/lib/design/new-call.js +19 -10
  62. package/src/lib/design/new-call.js.map +1 -1
  63. package/src/lib/design/part-marks.d.ts +3 -2
  64. package/src/lib/design/part-marks.js +13 -5
  65. package/src/lib/design/part-marks.js.map +1 -1
  66. package/src/lib/design/paths.d.ts +42 -0
  67. package/src/lib/design/paths.js +50 -1
  68. package/src/lib/design/paths.js.map +1 -1
  69. package/src/lib/design/product-command.d.ts +1 -1
  70. package/src/lib/design/product-command.js +12 -14
  71. package/src/lib/design/product-command.js.map +1 -1
  72. package/src/lib/design/ready-shots.d.ts +29 -3
  73. package/src/lib/design/ready-shots.js +105 -5
  74. package/src/lib/design/ready-shots.js.map +1 -1
  75. package/src/lib/design/render-packages.d.ts +9 -17
  76. package/src/lib/design/render-packages.js +25 -63
  77. package/src/lib/design/render-packages.js.map +1 -1
  78. package/src/lib/design/render-worker.js +2 -3
  79. package/src/lib/design/render-worker.js.map +1 -1
  80. package/src/lib/design/render.d.ts +2 -0
  81. package/src/lib/design/render.js +32 -7
  82. package/src/lib/design/render.js.map +1 -1
  83. package/src/lib/design/serve.d.ts +23 -3
  84. package/src/lib/design/serve.js +288 -35
  85. package/src/lib/design/serve.js.map +1 -1
  86. package/src/lib/design/server-identity.d.ts +36 -0
  87. package/src/lib/design/server-identity.js +68 -0
  88. package/src/lib/design/server-identity.js.map +1 -0
  89. package/src/lib/design/settle-frames.d.ts +4 -0
  90. package/src/lib/design/settle-frames.js +22 -0
  91. package/src/lib/design/settle-frames.js.map +1 -0
  92. package/src/lib/design/shot-command.d.ts +30 -6
  93. package/src/lib/design/shot-command.js +144 -56
  94. package/src/lib/design/shot-command.js.map +1 -1
  95. package/src/lib/design/shot-store.d.ts +24 -0
  96. package/src/lib/design/shot-store.js +120 -0
  97. package/src/lib/design/shot-store.js.map +1 -0
  98. package/src/lib/design/shot.d.ts +71 -1
  99. package/src/lib/design/shot.js +253 -40
  100. package/src/lib/design/shot.js.map +1 -1
  101. package/src/lib/design/sketch-command.d.ts +6 -1
  102. package/src/lib/design/sketch-command.js +452 -136
  103. package/src/lib/design/sketch-command.js.map +1 -1
  104. package/src/lib/design/ssr-shims.d.ts +2 -0
  105. package/src/lib/design/ssr-shims.js +12 -1
  106. package/src/lib/design/ssr-shims.js.map +1 -1
  107. package/src/lib/design/stale-cli-dist.d.ts +11 -0
  108. package/src/lib/design/stale-cli-dist.js +56 -0
  109. package/src/lib/design/stale-cli-dist.js.map +1 -0
  110. package/src/lib/design/stamp.d.ts +18 -1
  111. package/src/lib/design/stamp.js +53 -7
  112. package/src/lib/design/stamp.js.map +1 -1
  113. package/src/lib/design/started-by-studio.d.ts +1 -0
  114. package/src/lib/design/started-by-studio.js +6 -0
  115. package/src/lib/design/started-by-studio.js.map +1 -0
  116. package/src/lib/design/studio-api.d.ts +35 -4
  117. package/src/lib/design/studio-api.js +312 -41
  118. package/src/lib/design/studio-api.js.map +1 -1
  119. package/src/lib/design/system/accept-command.d.ts +39 -5
  120. package/src/lib/design/system/accept-command.js +109 -25
  121. package/src/lib/design/system/accept-command.js.map +1 -1
  122. package/src/lib/design/system/accepted-pictures.d.ts +83 -0
  123. package/src/lib/design/system/accepted-pictures.js +324 -0
  124. package/src/lib/design/system/accepted-pictures.js.map +1 -0
  125. package/src/lib/design/system/action-lost.d.ts +59 -0
  126. package/src/lib/design/system/action-lost.js +120 -0
  127. package/src/lib/design/system/action-lost.js.map +1 -0
  128. package/src/lib/design/system/action-press.d.ts +23 -0
  129. package/src/lib/design/system/action-press.js +76 -0
  130. package/src/lib/design/system/action-press.js.map +1 -0
  131. package/src/lib/design/system/action-undeclared.d.ts +34 -0
  132. package/src/lib/design/system/action-undeclared.js +81 -0
  133. package/src/lib/design/system/action-undeclared.js.map +1 -0
  134. package/src/lib/design/system/actions-command.d.ts +101 -0
  135. package/src/lib/design/system/actions-command.js +695 -0
  136. package/src/lib/design/system/actions-command.js.map +1 -0
  137. package/src/lib/design/system/actions.d.ts +158 -0
  138. package/src/lib/design/system/actions.js +295 -0
  139. package/src/lib/design/system/actions.js.map +1 -0
  140. package/src/lib/design/system/app-files.d.ts +10 -0
  141. package/src/lib/design/system/app-files.js +159 -0
  142. package/src/lib/design/system/app-files.js.map +1 -0
  143. package/src/lib/design/system/bespoke-controls.d.ts +30 -0
  144. package/src/lib/design/system/bespoke-controls.js +147 -0
  145. package/src/lib/design/system/bespoke-controls.js.map +1 -0
  146. package/src/lib/design/system/build-ready-contract.d.ts +27 -0
  147. package/src/lib/design/system/build-ready-contract.js +12 -0
  148. package/src/lib/design/system/build-ready-contract.js.map +1 -0
  149. package/src/lib/design/system/check-rules.d.ts +1 -0
  150. package/src/lib/design/system/check-rules.js +82 -0
  151. package/src/lib/design/system/check-rules.js.map +1 -0
  152. package/src/lib/design/system/check-system.d.ts +62 -3
  153. package/src/lib/design/system/check-system.js +527 -34
  154. package/src/lib/design/system/check-system.js.map +1 -1
  155. package/src/lib/design/system/colour.d.ts +4 -1
  156. package/src/lib/design/system/colour.js +54 -2
  157. package/src/lib/design/system/colour.js.map +1 -1
  158. package/src/lib/design/system/comments/comment.d.ts +4 -1
  159. package/src/lib/design/system/comments/comment.js +13 -4
  160. package/src/lib/design/system/comments/comment.js.map +1 -1
  161. package/src/lib/design/system/comments/inbox.js +2 -2
  162. package/src/lib/design/system/comments/inbox.js.map +1 -1
  163. package/src/lib/design/system/compare-command.d.ts +119 -0
  164. package/src/lib/design/system/compare-command.js +558 -0
  165. package/src/lib/design/system/compare-command.js.map +1 -0
  166. package/src/lib/design/system/complete-command.js +7 -3
  167. package/src/lib/design/system/complete-command.js.map +1 -1
  168. package/src/lib/design/system/complete.d.ts +99 -3
  169. package/src/lib/design/system/complete.js +358 -88
  170. package/src/lib/design/system/complete.js.map +1 -1
  171. package/src/lib/design/system/component-outputs.d.ts +20 -0
  172. package/src/lib/design/system/component-outputs.js +86 -0
  173. package/src/lib/design/system/component-outputs.js.map +1 -0
  174. package/src/lib/design/system/contrast-check.d.ts +6 -1
  175. package/src/lib/design/system/contrast-check.js +179 -13
  176. package/src/lib/design/system/contrast-check.js.map +1 -1
  177. package/src/lib/design/system/demo-backdrop.d.ts +11 -0
  178. package/src/lib/design/system/demo-backdrop.js +41 -0
  179. package/src/lib/design/system/demo-backdrop.js.map +1 -0
  180. package/src/lib/design/system/design-hash.d.ts +31 -0
  181. package/src/lib/design/system/design-hash.js +73 -0
  182. package/src/lib/design/system/design-hash.js.map +1 -0
  183. package/src/lib/design/system/disabled-interaction.d.ts +8 -0
  184. package/src/lib/design/system/disabled-interaction.js +37 -0
  185. package/src/lib/design/system/disabled-interaction.js.map +1 -0
  186. package/src/lib/design/system/dom-command.d.ts +36 -0
  187. package/src/lib/design/system/dom-command.js +175 -0
  188. package/src/lib/design/system/dom-command.js.map +1 -0
  189. package/src/lib/design/system/drawn-open-points.d.ts +38 -0
  190. package/src/lib/design/system/drawn-open-points.js +94 -0
  191. package/src/lib/design/system/drawn-open-points.js.map +1 -0
  192. package/src/lib/design/system/dropped-props.d.ts +25 -0
  193. package/src/lib/design/system/dropped-props.js +159 -0
  194. package/src/lib/design/system/dropped-props.js.map +1 -0
  195. package/src/lib/design/system/embedded-actions.d.ts +21 -0
  196. package/src/lib/design/system/embedded-actions.js +37 -0
  197. package/src/lib/design/system/embedded-actions.js.map +1 -0
  198. package/src/lib/design/system/exceptions.js +2 -1
  199. package/src/lib/design/system/exceptions.js.map +1 -1
  200. package/src/lib/design/system/flows/flow.js +2 -1
  201. package/src/lib/design/system/flows/flow.js.map +1 -1
  202. package/src/lib/design/system/frozen-animations.d.ts +13 -0
  203. package/src/lib/design/system/frozen-animations.js +51 -0
  204. package/src/lib/design/system/frozen-animations.js.map +1 -0
  205. package/src/lib/design/system/go-batch.d.ts +24 -0
  206. package/src/lib/design/system/go-batch.js +110 -0
  207. package/src/lib/design/system/go-batch.js.map +1 -0
  208. package/src/lib/design/system/go-command.d.ts +4 -0
  209. package/src/lib/design/system/go-command.js +64 -0
  210. package/src/lib/design/system/go-command.js.map +1 -0
  211. package/src/lib/design/system/go-guard.d.ts +26 -0
  212. package/src/lib/design/system/go-guard.js +70 -0
  213. package/src/lib/design/system/go-guard.js.map +1 -0
  214. package/src/lib/design/system/go-step.d.ts +13 -0
  215. package/src/lib/design/system/go-step.js +84 -0
  216. package/src/lib/design/system/go-step.js.map +1 -0
  217. package/src/lib/design/system/handoff.js +2 -1
  218. package/src/lib/design/system/handoff.js.map +1 -1
  219. package/src/lib/design/system/harness-build-cache.d.ts +35 -0
  220. package/src/lib/design/system/harness-build-cache.js +175 -0
  221. package/src/lib/design/system/harness-build-cache.js.map +1 -0
  222. package/src/lib/design/system/harness-command.d.ts +7 -0
  223. package/src/lib/design/system/harness-command.js +51 -0
  224. package/src/lib/design/system/harness-command.js.map +1 -0
  225. package/src/lib/design/system/harness-config.d.ts +9 -0
  226. package/src/lib/design/system/harness-config.js +65 -0
  227. package/src/lib/design/system/harness-config.js.map +1 -0
  228. package/src/lib/design/system/harness-map.d.ts +44 -0
  229. package/src/lib/design/system/harness-map.js +126 -0
  230. package/src/lib/design/system/harness-map.js.map +1 -0
  231. package/src/lib/design/system/harness-samples.d.ts +20 -0
  232. package/src/lib/design/system/harness-samples.js +92 -0
  233. package/src/lib/design/system/harness-samples.js.map +1 -0
  234. package/src/lib/design/system/harness-server.d.ts +40 -0
  235. package/src/lib/design/system/harness-server.js +296 -0
  236. package/src/lib/design/system/harness-server.js.map +1 -0
  237. package/src/lib/design/system/imports.js +14 -1
  238. package/src/lib/design/system/imports.js.map +1 -1
  239. package/src/lib/design/system/in-order-at-once.d.ts +6 -0
  240. package/src/lib/design/system/in-order-at-once.js +28 -0
  241. package/src/lib/design/system/in-order-at-once.js.map +1 -0
  242. package/src/lib/design/system/inventory-approval.js +2 -1
  243. package/src/lib/design/system/inventory-approval.js.map +1 -1
  244. package/src/lib/design/system/inventory.d.ts +13 -4
  245. package/src/lib/design/system/inventory.js +36 -7
  246. package/src/lib/design/system/inventory.js.map +1 -1
  247. package/src/lib/design/system/list-system.d.ts +8 -1
  248. package/src/lib/design/system/list-system.js +13 -3
  249. package/src/lib/design/system/list-system.js.map +1 -1
  250. package/src/lib/design/system/live-actions.d.ts +121 -0
  251. package/src/lib/design/system/live-actions.js +665 -0
  252. package/src/lib/design/system/live-actions.js.map +1 -0
  253. package/src/lib/design/system/live-compare.d.ts +136 -0
  254. package/src/lib/design/system/live-compare.js +441 -0
  255. package/src/lib/design/system/live-compare.js.map +1 -0
  256. package/src/lib/design/system/live-uncovered.d.ts +40 -0
  257. package/src/lib/design/system/live-uncovered.js +123 -0
  258. package/src/lib/design/system/live-uncovered.js.map +1 -0
  259. package/src/lib/design/system/nested-scroll.d.ts +7 -0
  260. package/src/lib/design/system/nested-scroll.js +25 -0
  261. package/src/lib/design/system/nested-scroll.js.map +1 -0
  262. package/src/lib/design/system/notes/note.js +2 -1
  263. package/src/lib/design/system/notes/note.js.map +1 -1
  264. package/src/lib/design/system/occluded.d.ts +13 -0
  265. package/src/lib/design/system/occluded.js +111 -0
  266. package/src/lib/design/system/occluded.js.map +1 -0
  267. package/src/lib/design/system/open-points.d.ts +119 -0
  268. package/src/lib/design/system/open-points.js +185 -0
  269. package/src/lib/design/system/open-points.js.map +1 -0
  270. package/src/lib/design/system/part-build-ready.d.ts +39 -0
  271. package/src/lib/design/system/part-build-ready.js +107 -0
  272. package/src/lib/design/system/part-build-ready.js.map +1 -0
  273. package/src/lib/design/system/part-command.js +2 -9
  274. package/src/lib/design/system/part-command.js.map +1 -1
  275. package/src/lib/design/system/part-compare.d.ts +123 -0
  276. package/src/lib/design/system/part-compare.js +396 -0
  277. package/src/lib/design/system/part-compare.js.map +1 -0
  278. package/src/lib/design/system/part-go.d.ts +70 -0
  279. package/src/lib/design/system/part-go.js +94 -0
  280. package/src/lib/design/system/part-go.js.map +1 -0
  281. package/src/lib/design/system/part-ready.d.ts +90 -0
  282. package/src/lib/design/system/part-ready.js +172 -0
  283. package/src/lib/design/system/part-ready.js.map +1 -0
  284. package/src/lib/design/system/part-task.d.ts +147 -0
  285. package/src/lib/design/system/part-task.js +285 -0
  286. package/src/lib/design/system/part-task.js.map +1 -0
  287. package/src/lib/design/system/pointer-focus.d.ts +81 -0
  288. package/src/lib/design/system/pointer-focus.js +152 -0
  289. package/src/lib/design/system/pointer-focus.js.map +1 -0
  290. package/src/lib/design/system/prettier.d.ts +10 -0
  291. package/src/lib/design/system/prettier.js +36 -0
  292. package/src/lib/design/system/prettier.js.map +1 -0
  293. package/src/lib/design/system/reach.d.ts +12 -0
  294. package/src/lib/design/system/reach.js +186 -0
  295. package/src/lib/design/system/reach.js.map +1 -0
  296. package/src/lib/design/system/reachable-controls.d.ts +6 -0
  297. package/src/lib/design/system/reachable-controls.js +19 -0
  298. package/src/lib/design/system/reachable-controls.js.map +1 -0
  299. package/src/lib/design/system/reachable-files.d.ts +14 -0
  300. package/src/lib/design/system/reachable-files.js +101 -0
  301. package/src/lib/design/system/reachable-files.js.map +1 -0
  302. package/src/lib/design/system/reached-state.d.ts +23 -0
  303. package/src/lib/design/system/reached-state.js +53 -0
  304. package/src/lib/design/system/reached-state.js.map +1 -0
  305. package/src/lib/design/system/read-open-points.d.ts +33 -0
  306. package/src/lib/design/system/read-open-points.js +110 -0
  307. package/src/lib/design/system/read-open-points.js.map +1 -0
  308. package/src/lib/design/system/ready-command.d.ts +11 -0
  309. package/src/lib/design/system/ready-command.js +82 -0
  310. package/src/lib/design/system/ready-command.js.map +1 -0
  311. package/src/lib/design/system/render-check.d.ts +52 -0
  312. package/src/lib/design/system/render-check.js +479 -60
  313. package/src/lib/design/system/render-check.js.map +1 -1
  314. package/src/lib/design/system/resolve-product.d.ts +2 -1
  315. package/src/lib/design/system/resolve-product.js +25 -3
  316. package/src/lib/design/system/resolve-product.js.map +1 -1
  317. package/src/lib/design/system/rules/app-spec.d.ts +30 -0
  318. package/src/lib/design/system/rules/app-spec.js +87 -0
  319. package/src/lib/design/system/rules/app-spec.js.map +1 -0
  320. package/src/lib/design/system/rules/canonical-class.d.ts +2 -0
  321. package/src/lib/design/system/rules/canonical-class.js +36 -110
  322. package/src/lib/design/system/rules/canonical-class.js.map +1 -1
  323. package/src/lib/design/system/rules/capability-place.d.ts +44 -0
  324. package/src/lib/design/system/rules/capability-place.js +116 -0
  325. package/src/lib/design/system/rules/capability-place.js.map +1 -0
  326. package/src/lib/design/system/rules/denied-class.d.ts +9 -0
  327. package/src/lib/design/system/rules/denied-class.js +121 -0
  328. package/src/lib/design/system/rules/denied-class.js.map +1 -0
  329. package/src/lib/design/system/rules/exemptions.d.ts +18 -0
  330. package/src/lib/design/system/rules/exemptions.js +18 -0
  331. package/src/lib/design/system/rules/exemptions.js.map +1 -0
  332. package/src/lib/design/system/rules/flow.js +1 -1
  333. package/src/lib/design/system/rules/flow.js.map +1 -1
  334. package/src/lib/design/system/rules/glued-interpolation.d.ts +8 -0
  335. package/src/lib/design/system/rules/glued-interpolation.js +61 -0
  336. package/src/lib/design/system/rules/glued-interpolation.js.map +1 -0
  337. package/src/lib/design/system/rules/hard-coded-colour.js +2 -1
  338. package/src/lib/design/system/rules/hard-coded-colour.js.map +1 -1
  339. package/src/lib/design/system/rules/implemented-components.d.ts +22 -0
  340. package/src/lib/design/system/rules/implemented-components.js +45 -0
  341. package/src/lib/design/system/rules/implemented-components.js.map +1 -0
  342. package/src/lib/design/system/rules/implements.d.ts +8 -0
  343. package/src/lib/design/system/rules/implements.js +48 -0
  344. package/src/lib/design/system/rules/implements.js.map +1 -0
  345. package/src/lib/design/system/rules/inline-svg.js +4 -1
  346. package/src/lib/design/system/rules/inline-svg.js.map +1 -1
  347. package/src/lib/design/system/rules/inline-ui-in-page-open.d.ts +13 -0
  348. package/src/lib/design/system/rules/inline-ui-in-page-open.js +5 -0
  349. package/src/lib/design/system/rules/inline-ui-in-page-open.js.map +1 -0
  350. package/src/lib/design/system/rules/inline-ui-in-page.d.ts +18 -0
  351. package/src/lib/design/system/rules/inline-ui-in-page.js +123 -0
  352. package/src/lib/design/system/rules/inline-ui-in-page.js.map +1 -0
  353. package/src/lib/design/system/rules/inline-ui.d.ts +16 -0
  354. package/src/lib/design/system/rules/inline-ui.js +100 -0
  355. package/src/lib/design/system/rules/inline-ui.js.map +1 -0
  356. package/src/lib/design/system/rules/motion.d.ts +2 -0
  357. package/src/lib/design/system/rules/motion.js +35 -2
  358. package/src/lib/design/system/rules/motion.js.map +1 -1
  359. package/src/lib/design/system/rules/native-title.d.ts +7 -0
  360. package/src/lib/design/system/rules/native-title.js +64 -0
  361. package/src/lib/design/system/rules/native-title.js.map +1 -0
  362. package/src/lib/design/system/rules/option-values.d.ts +15 -0
  363. package/src/lib/design/system/rules/option-values.js +145 -0
  364. package/src/lib/design/system/rules/option-values.js.map +1 -0
  365. package/src/lib/design/system/rules/orphan-endpoint-known.d.ts +12 -0
  366. package/src/lib/design/system/rules/orphan-endpoint-known.js +20 -0
  367. package/src/lib/design/system/rules/orphan-endpoint-known.js.map +1 -0
  368. package/src/lib/design/system/rules/orphan-endpoint.d.ts +23 -0
  369. package/src/lib/design/system/rules/orphan-endpoint.js +166 -0
  370. package/src/lib/design/system/rules/orphan-endpoint.js.map +1 -0
  371. package/src/lib/design/system/rules/part-rewrite.d.ts +13 -0
  372. package/src/lib/design/system/rules/part-rewrite.js +125 -0
  373. package/src/lib/design/system/rules/part-rewrite.js.map +1 -0
  374. package/src/lib/design/system/rules/sample-default-known.d.ts +5 -0
  375. package/src/lib/design/system/rules/sample-default-known.js +17 -0
  376. package/src/lib/design/system/rules/sample-default-known.js.map +1 -0
  377. package/src/lib/design/system/rules/sample-default.d.ts +22 -0
  378. package/src/lib/design/system/rules/sample-default.js +92 -0
  379. package/src/lib/design/system/rules/sample-default.js.map +1 -0
  380. package/src/lib/design/system/rules/stale-replace.js +45 -3
  381. package/src/lib/design/system/rules/stale-replace.js.map +1 -1
  382. package/src/lib/design/system/rules/state-in-component.d.ts +16 -0
  383. package/src/lib/design/system/rules/state-in-component.js +101 -0
  384. package/src/lib/design/system/rules/state-in-component.js.map +1 -0
  385. package/src/lib/design/system/rules/tailwind-classes.d.ts +51 -0
  386. package/src/lib/design/system/rules/tailwind-classes.js +232 -0
  387. package/src/lib/design/system/rules/tailwind-classes.js.map +1 -0
  388. package/src/lib/design/system/rules/top-level-await.d.ts +9 -0
  389. package/src/lib/design/system/rules/top-level-await.js +62 -0
  390. package/src/lib/design/system/rules/top-level-await.js.map +1 -0
  391. package/src/lib/design/system/rules/unbound-input-known.d.ts +5 -0
  392. package/src/lib/design/system/rules/unbound-input-known.js +47 -0
  393. package/src/lib/design/system/rules/unbound-input-known.js.map +1 -0
  394. package/src/lib/design/system/rules/unbound-input.d.ts +22 -0
  395. package/src/lib/design/system/rules/unbound-input.js +61 -0
  396. package/src/lib/design/system/rules/unbound-input.js.map +1 -0
  397. package/src/lib/design/system/rules/uncovered-region.d.ts +13 -0
  398. package/src/lib/design/system/rules/uncovered-region.js +36 -0
  399. package/src/lib/design/system/rules/uncovered-region.js.map +1 -0
  400. package/src/lib/design/system/rules/undefined-class.d.ts +9 -0
  401. package/src/lib/design/system/rules/undefined-class.js +32 -0
  402. package/src/lib/design/system/rules/undefined-class.js.map +1 -0
  403. package/src/lib/design/system/rules/undefined-token.d.ts +1 -1
  404. package/src/lib/design/system/rules/undefined-token.js +7 -61
  405. package/src/lib/design/system/rules/undefined-token.js.map +1 -1
  406. package/src/lib/design/system/rules/utility-css.d.ts +2 -1
  407. package/src/lib/design/system/rules/utility-css.js +29 -14
  408. package/src/lib/design/system/rules/utility-css.js.map +1 -1
  409. package/src/lib/design/system/rules/view-coverage.d.ts +8 -0
  410. package/src/lib/design/system/rules/view-coverage.js +51 -0
  411. package/src/lib/design/system/rules/view-coverage.js.map +1 -0
  412. package/src/lib/design/system/rules/visible-change.d.ts +20 -0
  413. package/src/lib/design/system/rules/visible-change.js +48 -0
  414. package/src/lib/design/system/rules/visible-change.js.map +1 -0
  415. package/src/lib/design/system/sdk-errors.d.ts +14 -0
  416. package/src/lib/design/system/sdk-errors.js +38 -0
  417. package/src/lib/design/system/sdk-errors.js.map +1 -0
  418. package/src/lib/design/system/see-through.d.ts +12 -0
  419. package/src/lib/design/system/see-through.js +112 -0
  420. package/src/lib/design/system/see-through.js.map +1 -0
  421. package/src/lib/design/system/settled-panes.d.ts +18 -0
  422. package/src/lib/design/system/settled-panes.js +70 -0
  423. package/src/lib/design/system/settled-panes.js.map +1 -0
  424. package/src/lib/design/system/sketch/after-merge.d.ts +11 -0
  425. package/src/lib/design/system/sketch/after-merge.js +51 -0
  426. package/src/lib/design/system/sketch/after-merge.js.map +1 -0
  427. package/src/lib/design/system/sketch/aktuell-placeholders.d.ts +30 -0
  428. package/src/lib/design/system/sketch/aktuell-placeholders.js +87 -0
  429. package/src/lib/design/system/sketch/aktuell-placeholders.js.map +1 -0
  430. package/src/lib/design/system/sketch/baseline.d.ts +29 -2
  431. package/src/lib/design/system/sketch/baseline.js +33 -9
  432. package/src/lib/design/system/sketch/baseline.js.map +1 -1
  433. package/src/lib/design/system/sketch/check-sketches.d.ts +11 -0
  434. package/src/lib/design/system/sketch/check-sketches.js +54 -6
  435. package/src/lib/design/system/sketch/check-sketches.js.map +1 -1
  436. package/src/lib/design/system/sketch/cli-args.d.ts +12 -2
  437. package/src/lib/design/system/sketch/cli-args.js +18 -3
  438. package/src/lib/design/system/sketch/cli-args.js.map +1 -1
  439. package/src/lib/design/system/sketch/edit-sketch.d.ts +21 -0
  440. package/src/lib/design/system/sketch/edit-sketch.js +117 -0
  441. package/src/lib/design/system/sketch/edit-sketch.js.map +1 -0
  442. package/src/lib/design/system/sketch/frame-budget.d.ts +24 -0
  443. package/src/lib/design/system/sketch/frame-budget.js +23 -0
  444. package/src/lib/design/system/sketch/frame-budget.js.map +1 -0
  445. package/src/lib/design/system/sketch/identical-renders.d.ts +31 -0
  446. package/src/lib/design/system/sketch/identical-renders.js +137 -0
  447. package/src/lib/design/system/sketch/identical-renders.js.map +1 -0
  448. package/src/lib/design/system/sketch/merge-shared.d.ts +2 -0
  449. package/src/lib/design/system/sketch/merge-shared.js +7 -10
  450. package/src/lib/design/system/sketch/merge-shared.js.map +1 -1
  451. package/src/lib/design/system/sketch/merge-step.d.ts +35 -0
  452. package/src/lib/design/system/sketch/merge-step.js +98 -0
  453. package/src/lib/design/system/sketch/merge-step.js.map +1 -0
  454. package/src/lib/design/system/sketch/merge.d.ts +10 -3
  455. package/src/lib/design/system/sketch/merge.js +122 -17
  456. package/src/lib/design/system/sketch/merge.js.map +1 -1
  457. package/src/lib/design/system/sketch/merged-layout.d.ts +17 -0
  458. package/src/lib/design/system/sketch/merged-layout.js +57 -0
  459. package/src/lib/design/system/sketch/merged-layout.js.map +1 -0
  460. package/src/lib/design/system/sketch/merged-parts.d.ts +41 -11
  461. package/src/lib/design/system/sketch/merged-parts.js +113 -50
  462. package/src/lib/design/system/sketch/merged-parts.js.map +1 -1
  463. package/src/lib/design/system/sketch/no-visible-change.d.ts +10 -0
  464. package/src/lib/design/system/sketch/no-visible-change.js +16 -6
  465. package/src/lib/design/system/sketch/no-visible-change.js.map +1 -1
  466. package/src/lib/design/system/sketch/part-definition.d.ts +56 -0
  467. package/src/lib/design/system/sketch/part-definition.js +129 -13
  468. package/src/lib/design/system/sketch/part-definition.js.map +1 -1
  469. package/src/lib/design/system/sketch/rebase-port.d.ts +24 -0
  470. package/src/lib/design/system/sketch/rebase-port.js +170 -0
  471. package/src/lib/design/system/sketch/rebase-port.js.map +1 -0
  472. package/src/lib/design/system/sketch/sample-mark-drift.d.ts +33 -0
  473. package/src/lib/design/system/sketch/sample-mark-drift.js +88 -0
  474. package/src/lib/design/system/sketch/sample-mark-drift.js.map +1 -0
  475. package/src/lib/design/system/sketch/sketch-check-worker.d.ts +1 -0
  476. package/src/lib/design/system/sketch/sketch-check-worker.js +27 -0
  477. package/src/lib/design/system/sketch/sketch-check-worker.js.map +1 -0
  478. package/src/lib/design/system/sketch/sketch-checker.d.ts +27 -0
  479. package/src/lib/design/system/sketch/sketch-checker.js +99 -0
  480. package/src/lib/design/system/sketch/sketch-checker.js.map +1 -0
  481. package/src/lib/design/system/sketch/sketch.d.ts +78 -2
  482. package/src/lib/design/system/sketch/sketch.js +247 -54
  483. package/src/lib/design/system/sketch/sketch.js.map +1 -1
  484. package/src/lib/design/system/sketch/stale-base.d.ts +22 -0
  485. package/src/lib/design/system/sketch/stale-base.js +56 -0
  486. package/src/lib/design/system/sketch/stale-base.js.map +1 -0
  487. package/src/lib/design/system/sketch/unchanged-states.d.ts +36 -1
  488. package/src/lib/design/system/sketch/unchanged-states.js +60 -17
  489. package/src/lib/design/system/sketch/unchanged-states.js.map +1 -1
  490. package/src/lib/design/system/sketch/unused-closure.js +26 -4
  491. package/src/lib/design/system/sketch/unused-closure.js.map +1 -1
  492. package/src/lib/design/system/sketch/unused-files.d.ts +1 -1
  493. package/src/lib/design/system/sketch/unused-files.js +6 -3
  494. package/src/lib/design/system/sketch/unused-files.js.map +1 -1
  495. package/src/lib/design/system/sketch/viewed-shots.d.ts +24 -0
  496. package/src/lib/design/system/sketch/viewed-shots.js +61 -0
  497. package/src/lib/design/system/sketch/viewed-shots.js.map +1 -0
  498. package/src/lib/design/system/slow-checks.d.ts +40 -0
  499. package/src/lib/design/system/slow-checks.js +197 -0
  500. package/src/lib/design/system/slow-checks.js.map +1 -0
  501. package/src/lib/design/system/slow-run.d.ts +57 -0
  502. package/src/lib/design/system/slow-run.js +253 -0
  503. package/src/lib/design/system/slow-run.js.map +1 -0
  504. package/src/lib/design/system/stale-design-mocks.d.ts +20 -0
  505. package/src/lib/design/system/stale-design-mocks.js +59 -0
  506. package/src/lib/design/system/stale-design-mocks.js.map +1 -0
  507. package/src/lib/design/system/stale-dist.d.ts +25 -0
  508. package/src/lib/design/system/stale-dist.js +91 -0
  509. package/src/lib/design/system/stale-dist.js.map +1 -0
  510. package/src/lib/design/system/stale-parts.d.ts +30 -0
  511. package/src/lib/design/system/stale-parts.js +106 -0
  512. package/src/lib/design/system/stale-parts.js.map +1 -0
  513. package/src/lib/design/system/surface-nesting.d.ts +11 -0
  514. package/src/lib/design/system/surface-nesting.js +86 -0
  515. package/src/lib/design/system/surface-nesting.js.map +1 -0
  516. package/src/lib/design/system/system-command.js +8 -6
  517. package/src/lib/design/system/system-command.js.map +1 -1
  518. package/src/lib/design/system/system-modules.d.ts +16 -1
  519. package/src/lib/design/system/system-modules.js +18 -2
  520. package/src/lib/design/system/system-modules.js.map +1 -1
  521. package/src/lib/design/system/system-tsconfig.js +2 -2
  522. package/src/lib/design/system/system-tsconfig.js.map +1 -1
  523. package/src/lib/design/system/task-command.d.ts +51 -0
  524. package/src/lib/design/system/task-command.js +233 -0
  525. package/src/lib/design/system/task-command.js.map +1 -0
  526. package/src/lib/design/system/theming-text.d.ts +2 -0
  527. package/src/lib/design/system/theming-text.js +6 -0
  528. package/src/lib/design/system/theming-text.js.map +1 -0
  529. package/src/lib/design/system/tom-confirm.d.ts +40 -0
  530. package/src/lib/design/system/tom-confirm.js +55 -0
  531. package/src/lib/design/system/tom-confirm.js.map +1 -0
  532. package/src/lib/design/system/touched-parts.d.ts +16 -0
  533. package/src/lib/design/system/touched-parts.js +122 -0
  534. package/src/lib/design/system/touched-parts.js.map +1 -0
  535. package/src/lib/design/system/ts-source.d.ts +5 -0
  536. package/src/lib/design/system/ts-source.js +35 -4
  537. package/src/lib/design/system/ts-source.js.map +1 -1
  538. package/src/lib/design/system/unchanged-rows.d.ts +15 -0
  539. package/src/lib/design/system/unchanged-rows.js +134 -0
  540. package/src/lib/design/system/unchanged-rows.js.map +1 -0
  541. package/src/lib/design/system/uncommitted-decisions.d.ts +6 -0
  542. package/src/lib/design/system/uncommitted-decisions.js +38 -0
  543. package/src/lib/design/system/uncommitted-decisions.js.map +1 -0
  544. package/src/lib/design/system/uncovered-regions.d.ts +61 -0
  545. package/src/lib/design/system/uncovered-regions.js +171 -0
  546. package/src/lib/design/system/uncovered-regions.js.map +1 -0
  547. package/src/lib/design/system/unused-base-parts.d.ts +7 -0
  548. package/src/lib/design/system/unused-base-parts.js +76 -0
  549. package/src/lib/design/system/unused-base-parts.js.map +1 -0
  550. package/src/lib/design/system/visible-change-command.d.ts +48 -0
  551. package/src/lib/design/system/visible-change-command.js +308 -0
  552. package/src/lib/design/system/visible-change-command.js.map +1 -0
  553. package/src/lib/design/system/visible-change-parts.d.ts +28 -0
  554. package/src/lib/design/system/visible-change-parts.js +96 -0
  555. package/src/lib/design/system/visible-change-parts.js.map +1 -0
  556. package/src/lib/design/system/visible-change.d.ts +82 -0
  557. package/src/lib/design/system/visible-change.js +149 -0
  558. package/src/lib/design/system/visible-change.js.map +1 -0
  559. package/src/lib/design/thumb.d.ts +50 -6
  560. package/src/lib/design/thumb.js +154 -54
  561. package/src/lib/design/thumb.js.map +1 -1
  562. package/src/lib/design/typecheck.d.ts +1 -1
  563. package/src/lib/design/typecheck.js +3 -3
  564. package/src/lib/design/typecheck.js.map +1 -1
  565. package/src/lib/design/unstable-cells.d.ts +23 -0
  566. package/src/lib/design/unstable-cells.js +40 -0
  567. package/src/lib/design/unstable-cells.js.map +1 -0
  568. package/src/lib/design/variant-diff.js +1 -1
  569. package/src/lib/design/variant-diff.js.map +1 -1
  570. package/src/lib/design/wait.d.ts +15 -0
  571. package/src/lib/design/wait.js +30 -0
  572. package/src/lib/design/wait.js.map +1 -0
  573. package/src/lib/json-file.d.ts +11 -0
  574. package/src/lib/json-file.js +21 -0
  575. package/src/lib/json-file.js.map +1 -0
  576. package/src/lib/source-hash.d.ts +7 -0
  577. package/src/lib/source-hash.js +62 -0
  578. package/src/lib/source-hash.js.map +1 -0
  579. package/src/lib/update/agent-setup.js +2 -1
  580. package/src/lib/update/agent-setup.js.map +1 -1
  581. package/src/lib/update/migration-manifest.d.ts +12 -0
  582. package/src/lib/update/migration-manifest.js +13 -0
  583. package/src/lib/update/migration-manifest.js.map +1 -1
  584. package/src/lib/update/migration-record.js +2 -1
  585. package/src/lib/update/migration-record.js.map +1 -1
  586. package/src/lib/update/pending.js +2 -1
  587. package/src/lib/update/pending.js.map +1 -1
  588. package/src/lib/update/run-migrations.d.ts +3 -2
  589. package/src/lib/update/run-migrations.js +38 -5
  590. package/src/lib/update/run-migrations.js.map +1 -1
  591. package/src/lib/update/tasks.js +2 -1
  592. package/src/lib/update/tasks.js.map +1 -1
@@ -9,30 +9,98 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.renderIssuesOf = exports.renderIssueLineOf = void 0;
12
+ exports.renderIssuesOf = exports.inspectRetryingTimeouts = exports.RENDER_TIMEOUT = exports.uniqueIssuesOf = exports.groupedIssueLinesOf = exports.ownerPartOf = exports.renderIssueLineOf = exports.busyStatesOf = void 0;
13
+ const rxjs_1 = require("rxjs");
13
14
  const browser_1 = require("../browser");
14
15
  const contrast_check_1 = require("./contrast-check");
16
+ const complete_1 = require("./complete");
17
+ const action_undeclared_1 = require("./action-undeclared");
18
+ const disabled_interaction_1 = require("./disabled-interaction");
15
19
  const css_source_1 = require("./css-source");
16
20
  const serve_1 = require("../serve");
17
21
  const shot_1 = require("../shot");
18
22
  const thumb_1 = require("../thumb");
19
23
  const list_system_1 = require("./list-system");
24
+ const sdk_errors_1 = require("./sdk-errors");
20
25
  const resolve_product_1 = require("./resolve-product");
21
26
  const system_modules_1 = require("./system-modules");
27
+ const option_values_1 = require("./rules/option-values");
28
+ const see_through_1 = require("./see-through");
29
+ const surface_nesting_1 = require("./surface-nesting");
30
+ const nested_scroll_1 = require("./nested-scroll");
31
+ const actions_1 = require("./actions");
32
+ const reach_1 = require("./reach");
33
+ const reachable_controls_1 = require("./reachable-controls");
34
+ const BUSY_MARK = 'BUSY';
35
+ /** @internal The states the busy marks of `issues` name, once each. */
36
+ const busyStatesOf = (issues) => {
37
+ const seen = new Set();
38
+ return issues.flatMap(({ rule, product, part, state, sketch }) => {
39
+ const key = JSON.stringify([product, part, state, sketch]);
40
+ if (rule !== BUSY_MARK || seen.has(key))
41
+ return [];
42
+ seen.add(key);
43
+ return [{ product, part, state, sketch }];
44
+ });
45
+ };
46
+ exports.busyStatesOf = busyStatesOf;
22
47
  const renderIssueLineOf = (issue) => `${issue.rule} ${issue.product} ${issue.part} ${issue.state} at ${issue.size}: ${issue.path} - ${issue.detail}`;
23
48
  exports.renderIssueLineOf = renderIssueLineOf;
49
+ /** The part whose code draws the element of an issue: the innermost embedded part on its path, else the drawn part. */
50
+ const ownerPartOf = (issue) => { var _a, _b; return (_b = (_a = [...issue.path.matchAll(/\[data-et-part=([^\]]+)\]/gu)].pop()) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : issue.part; };
51
+ exports.ownerPartOf = ownerPartOf;
52
+ const SCHEME_IN_DETAIL = / in the (light|dark) scheme/u;
53
+ /** The render issues as lines, one per finding that repeats across states, sizes, schemes and variants, with where it was found. */
54
+ const groupedIssueLinesOf = (issues) => {
55
+ var _a, _b, _c;
56
+ const groups = new Map();
57
+ for (const issue of issues) {
58
+ const key = JSON.stringify([
59
+ (_b = (_a = issue.sketch) === null || _a === void 0 ? void 0 : _a.target) !== null && _b !== void 0 ? _b : '',
60
+ issue.rule,
61
+ issue.product,
62
+ issue.part,
63
+ issue.path,
64
+ issue.detail.replace(SCHEME_IN_DETAIL, ''),
65
+ ]);
66
+ const group = (_c = groups.get(key)) !== null && _c !== void 0 ? _c : { first: issue, issues: [] };
67
+ group.issues.push(issue);
68
+ groups.set(key, group);
69
+ }
70
+ const listOf = (values) => [...new Set(values)].join(', ');
71
+ return [...groups.values()].map(({ first, issues: found }) => {
72
+ var _a, _b;
73
+ const schemes = [...new Set(found.flatMap((issue) => { var _a, _b; return (_b = (_a = SCHEME_IN_DETAIL.exec(issue.detail)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : []; }))];
74
+ const detail = first.detail.replace(SCHEME_IN_DETAIL, ` in the ${schemes.join(' and ')} scheme`);
75
+ const variants = listOf(found.map((issue) => { var _a, _b; return (_b = (_a = issue.sketch) === null || _a === void 0 ? void 0 : _a.variant) !== null && _b !== void 0 ? _b : ''; }));
76
+ const where = `${listOf(found.map((issue) => issue.state))} at ${listOf(found.map((issue) => issue.size))}`;
77
+ const times = found.length > 1 ? ` (${found.length} times)` : '';
78
+ return `${(_b = (_a = first.sketch) === null || _a === void 0 ? void 0 : _a.target) !== null && _b !== void 0 ? _b : ''} ${variants}: ${first.rule} ${first.product} ${first.part} ${where}: ${first.path} - ${detail}${times}`;
79
+ });
80
+ };
81
+ exports.groupedIssueLinesOf = groupedIssueLinesOf;
24
82
  const SINGLE_LINE = 'button, [role="button"], [role="tab"], [role="switch"], [role="menuitem"], [data-wireframe="button"], ' +
25
83
  '[data-wireframe="badge"], [data-wireframe="tabs"], [data-wireframe="segmented"], [data-wireframe="select"]';
26
84
  /**
27
85
  * Reads the rule breaks in a drawn frame. A string, not a function: the build would add helpers to a
28
86
  * function that the page does not have.
29
87
  */
30
- const ESCAPABLE = ['CLIPPED', 'WRAP'];
88
+ const ESCAPABLE = ['CLIPPED', 'WRAP', nested_scroll_1.NESTED_SCROLL_RULE, surface_nesting_1.NESTED_SURFACE_RULE, surface_nesting_1.LOST_SURFACE_RULE];
31
89
  const WARNING_RULES = new Set(['UNDEFINED-CLASS', 'EMBED-SCALE']);
90
+ const BUSY_SELECTOR = '[aria-busy="true"], [data-loading="true"]';
91
+ const PATH_DEPTH = 4;
92
+ const tagOf = (name) => { var _a, _b; return (_b = (_a = /^[a-z0-9-]+/u.exec(name)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : name; };
93
+ const frameNeutralPathOf = ({ path, part, framed }) => {
94
+ const names = path.split(' > ');
95
+ const marked = names.findIndex((name) => name.endsWith(`[data-et-part=${part}]`));
96
+ const cut = marked < 0 ? (names.length === PATH_DEPTH ? [0] : []) : framed ? [marked - 1, marked] : [marked, marked + 1];
97
+ return names.map((name, index) => (cut.includes(index) ? tagOf(name) : name)).join(' > ');
98
+ };
99
+ // complete.ts and this module sit in an import cycle: read PLAIN_CONTROL_SELECTOR here, a top-level copy can be undefined.
32
100
  const inspectFrame = (options) => `((options) => {
33
101
  const root = document.getElementById('root');
34
102
  const refused = root.innerText.trim();
35
- if (refused.startsWith('design-explore:')) return [{ rule: 'RENDER', path: '#root', detail: refused.split('\\n')[0] }];
103
+ if (refused.startsWith('design-explore:')) return options.sdkStylesOnly ? [] : [{ rule: 'RENDER', path: '#root', detail: refused.split('\\n').map((line) => line.trim()).filter(Boolean).join(' - ') }];
36
104
 
37
105
  const found = [];
38
106
  const seen = new Set();
@@ -58,7 +126,7 @@ const inspectFrame = (options) => `((options) => {
58
126
  };
59
127
  const pathOf = (element) => {
60
128
  const names = [];
61
- for (let at = element; at && at !== root && names.length < 4; at = at.parentElement) names.unshift(nameOf(at));
129
+ for (let at = element; at && at !== root && names.length < ${PATH_DEPTH}; at = at.parentElement) names.unshift(nameOf(at));
62
130
  return names.join(' > ');
63
131
  };
64
132
  const report = (rule, element, detail) => {
@@ -71,9 +139,22 @@ const inspectFrame = (options) => `((options) => {
71
139
  const sizeOf = (element) =>
72
140
  element.scrollWidth + 'x' + element.scrollHeight + ' in ' + element.clientWidth + 'x' + element.clientHeight;
73
141
 
142
+ if (options.sdkStylesOnly) {
143
+ for (const element of root.querySelectorAll('.et-visually-hidden')) {
144
+ if (element.getClientRects().length === 0) continue;
145
+ const style = getComputedStyle(element);
146
+ if (style.position !== 'absolute' || style.clipPath === 'none')
147
+ report('UNSTYLED-SDK', element, 'the visually hidden "' + element.textContent.trim().slice(0, 32) + '" draws in the picture, so an SDK component here renders without its styles');
148
+ }
149
+ return found;
150
+ }
151
+
74
152
  const partRoot = root.querySelector('[data-et-part]') ?? root.querySelector(':scope > :not(style)');
75
153
  if (!partRoot) return found;
76
154
 
155
+ const busy = root.querySelector('${BUSY_SELECTOR}');
156
+ if (busy) found.push({ rule: '${BUSY_MARK}', path: pathOf(busy), detail: 'draws ongoing work' });
157
+
77
158
  const sheets = [...document.styleSheets].map((sheet) => {
78
159
  try {
79
160
  return [...sheet.cssRules].map((rule) => rule.cssText).join('\\n');
@@ -136,19 +217,30 @@ const inspectFrame = (options) => `((options) => {
136
217
  }
137
218
 
138
219
  const clips = (value) => value === 'hidden' || value === 'clip';
220
+ const isMoved = (style) => style.transform !== 'none' || (style.translate && style.translate !== 'none');
221
+ const isPanned = (style) => (style.translate && style.translate !== 'none') || style.transform.startsWith('matrix(1, 0, 0, 1,');
222
+ const scaledChildOf = (element) =>
223
+ [...element.children].find((child) => {
224
+ const style = getComputedStyle(child);
225
+ return isMoved(style) && !isPanned(style);
226
+ });
139
227
  const drawnSizeOf = (element) => {
140
- if (!element.hasAttribute('data-et-embed-box')) return { width: element.scrollWidth, height: element.scrollHeight };
141
- const rect = element.firstElementChild.getBoundingClientRect();
228
+ const scaled = element.hasAttribute('data-et-embed-box') ? element.firstElementChild : scaledChildOf(element);
229
+ if (!scaled) return { width: element.scrollWidth, height: element.scrollHeight };
230
+ const rect = scaled.getBoundingClientRect();
142
231
  return { width: Math.floor(rect.width), height: Math.floor(rect.height) };
143
232
  };
233
+ const clipMarginOf = (style, axis) => (style[axis] === 'clip' ? parseFloat((style.overflowClipMargin ?? '').split(' ').pop()) || 0 : 0);
234
+ const pans = (element, style) => /^grab/.test(style.cursor) || [...element.children].some((child) => isPanned(getComputedStyle(child)));
144
235
  for (const element of root.querySelectorAll('*')) {
145
236
  const style = getComputedStyle(element);
146
237
  const drawn = drawnSizeOf(element);
147
- const cutX = clips(style.overflowX) && drawn.width > element.clientWidth;
148
- const cutY = clips(style.overflowY) && drawn.height > element.clientHeight;
149
- const cutsOnPurpose = style.textOverflow === 'ellipsis' || style.webkitLineClamp !== 'none';
238
+ const cutX = clips(style.overflowX) && drawn.width > element.clientWidth + clipMarginOf(style, 'overflowX');
239
+ const cutY = clips(style.overflowY) && drawn.height > element.clientHeight + clipMarginOf(style, 'overflowY');
240
+ const cutsOnPurpose = style.textOverflow === 'ellipsis' || style.webkitLineClamp !== 'none' || pans(element, style);
150
241
  if ((cutX || cutY) && !cutsOnPurpose) report('CLIPPED', element, 'content ' + drawn.width + 'x' + drawn.height + ' in ' + element.clientWidth + 'x' + element.clientHeight);
151
242
  }
243
+ ${nested_scroll_1.NESTED_SCROLL_STATEMENTS}
152
244
 
153
245
  const px = (value) => parseFloat(value) || 0;
154
246
  const invisible = (colour) => colour === 'transparent' || /^rgba\\(.*,\\s*0\\)$/.test(colour);
@@ -164,16 +256,39 @@ const inspectFrame = (options) => `((options) => {
164
256
  const rect = at.getBoundingClientRect();
165
257
  const left = rect.left + at.clientLeft;
166
258
  const top = rect.top + at.clientTop;
259
+ const marginX = clipMarginOf(style, 'overflowX');
260
+ const marginY = clipMarginOf(style, 'overflowY');
167
261
  const box = {
168
- left: style.overflowX === 'visible' ? -Infinity : left,
169
- right: style.overflowX === 'visible' ? Infinity : left + at.clientWidth,
170
- top: style.overflowY === 'visible' ? -Infinity : top,
171
- bottom: style.overflowY === 'visible' ? Infinity : top + at.clientHeight,
262
+ left: style.overflowX === 'visible' ? -Infinity : left - marginX,
263
+ right: style.overflowX === 'visible' ? Infinity : left + at.clientWidth + marginX,
264
+ top: style.overflowY === 'visible' ? -Infinity : top - marginY,
265
+ bottom: style.overflowY === 'visible' ? Infinity : top + at.clientHeight + marginY,
172
266
  };
173
- return { name: pathOf(at), box };
267
+ return { name: pathOf(at), box, style, element: at };
174
268
  }
175
269
  return frameBox();
176
270
  };
271
+ const movedBetween = (from, clipper) => {
272
+ for (let at = from; at && at !== clipper; at = at.parentElement) {
273
+ const style = getComputedStyle(at);
274
+ if (isMoved(style)) return true;
275
+ }
276
+ return false;
277
+ };
278
+ const ringClipOf = (element) => {
279
+ const clip = clipOf(element.parentElement);
280
+ if (!clip.element) return clip;
281
+ const moved = movedBetween(element, clip.element);
282
+ const panX = moved || clip.element.scrollWidth > clip.element.clientWidth;
283
+ const panY = moved || clip.element.scrollHeight > clip.element.clientHeight;
284
+ const box = {
285
+ left: panX ? -Infinity : clip.box.left,
286
+ right: panX ? Infinity : clip.box.right,
287
+ top: panY ? -Infinity : clip.box.top,
288
+ bottom: panY ? Infinity : clip.box.bottom,
289
+ };
290
+ return { ...clip, box };
291
+ };
177
292
  const pastOf = (rect, reach, box) =>
178
293
  Math.max(
179
294
  rect.left >= box.left ? box.left - (rect.left - reach.left) : 0,
@@ -203,13 +318,44 @@ const inspectFrame = (options) => `((options) => {
203
318
  if (rect.width === 0 && rect.height === 0) continue;
204
319
  const outline = style.outlineStyle !== 'none' && !invisible(style.outlineColor) ? Math.max(0, px(style.outlineWidth) + px(style.outlineOffset)) : 0;
205
320
  const shadow = shadowReachOf(style.boxShadow);
206
- const clip = clipOf(element.parentElement);
321
+ const clip = ringClipOf(element);
207
322
  const outlinePast = outline > 0 ? pastOf(rect, { left: outline, right: outline, top: outline, bottom: outline }, clip.box) : 0;
208
323
  const shadowPast = pastOf(rect, shadow, clip.box);
209
324
  if (outlinePast > 1) report('CLIPPED', element, 'outline ' + Math.round(outlinePast) + 'px past ' + clip.name);
210
325
  else if (shadowPast > 1) report('CLIPPED', element, 'box-shadow ' + Math.round(shadowPast) + 'px past ' + clip.name);
211
326
  }
212
327
 
328
+ const unseen = (element) => {
329
+ if (getComputedStyle(element).visibility === 'hidden' || element.closest('[inert], [aria-hidden="true"]')) return true;
330
+ for (let at = element; at && at !== root; at = at.parentElement) if (getComputedStyle(at).opacity === '0') return true;
331
+ return false;
332
+ };
333
+ ${reachable_controls_1.REACHABLE_CONTROLS_STATEMENTS}
334
+ const interactive = ${JSON.stringify(actions_1.INTERACTIVE_SELECTOR)};
335
+ for (const element of reachableControlsOf(root, interactive)) {
336
+ const rect = element.getBoundingClientRect();
337
+ if (rect.width === 0 || rect.height === 0) continue;
338
+ const clip = clipOf(element.parentElement);
339
+ if (!clip.style || unseen(element)) continue;
340
+ const shown = {
341
+ width: Math.min(rect.right, clip.box.right) - Math.max(rect.left, clip.box.left),
342
+ height: Math.min(rect.bottom, clip.box.bottom) - Math.max(rect.top, clip.box.top),
343
+ };
344
+ if (shown.width <= 0 || shown.height <= 0) continue;
345
+ const cuts = [];
346
+ if (clips(clip.style.overflowX) && rect.width - shown.width > 1) cuts.push(Math.round(rect.width - shown.width) + 'px of its width');
347
+ if (clips(clip.style.overflowY) && rect.height - shown.height > 1) cuts.push(Math.round(rect.height - shown.height) + 'px of its height');
348
+ if (cuts.length) report('CUT-CONTROL', element, cuts.join(' and ') + ' is cut by ' + clip.name + ', so the control is only partly reachable');
349
+ }
350
+ for (const element of root.querySelectorAll('[data-et-skip~="CLIPPED"]')) {
351
+ if (reachableControlsOf(element, interactive).length === 0) continue;
352
+ const path = pathOf(element);
353
+ if (seen.has('SKIP-SCOPE' + path)) continue;
354
+ seen.add('SKIP-SCOPE' + path);
355
+ found.push({ rule: 'SKIP-SCOPE', path, detail: 'data-et-skip=CLIPPED on ' + path + ' covers interactive controls - put the skip on the clipped element itself' });
356
+ }
357
+ ${reach_1.REACH_STATEMENTS}
358
+
213
359
  const metrics = document.createElement('canvas').getContext('2d');
214
360
  for (const element of root.querySelectorAll('*')) {
215
361
  const style = getComputedStyle(element);
@@ -253,6 +399,7 @@ const inspectFrame = (options) => `((options) => {
253
399
  for (const [block, nodes] of groups) {
254
400
  const style = getComputedStyle(block);
255
401
  if (!singleLine(block) && style.whiteSpace !== 'nowrap' && style.textWrapMode !== 'nowrap') continue;
402
+ if (style.webkitLineClamp !== 'none') continue;
256
403
  const lines = [];
257
404
  for (const node of nodes) {
258
405
  const range = document.createRange();
@@ -269,8 +416,37 @@ const inspectFrame = (options) => `((options) => {
269
416
  }
270
417
  }
271
418
  ${contrast_check_1.CONTRAST_STATEMENTS}
419
+ ${see_through_1.SEE_THROUGH_STATEMENTS}
420
+ ${surface_nesting_1.SURFACE_STATEMENTS}
421
+ const ownedOf = (element) => {
422
+ const slotted = (element.getAttribute('data-et-slot') ?? '').split(' ').filter(Boolean);
423
+ for (let at = element; at && at !== root; at = at.parentElement)
424
+ for (const key of (at.getAttribute('data-et-part') ?? '').split(' ').filter(Boolean)) {
425
+ const index = slotted.indexOf(key);
426
+ if (index >= 0) slotted.splice(index, 1);
427
+ else return key === options.part;
428
+ }
429
+ return true;
430
+ };
431
+ const textOf = (node) =>
432
+ [...node.childNodes]
433
+ .map((child) => (child.nodeType === Node.TEXT_NODE ? child.data : child.nodeType === Node.ELEMENT_NODE && !child.matches('style, script, template') ? textOf(child) : ''))
434
+ .join('');
435
+ if (options.part !== null)
436
+ for (const element of root.querySelectorAll(options.controlInputs)) {
437
+ if (element.getClientRects().length === 0 || element.closest('[data-et-control]') || !ownedOf(element)) continue;
438
+ if (element.matches('[role="option"], [role^="menuitem"]') && element.closest('[data-et-surface]')) continue;
439
+ const sdk = element.parentElement?.closest(options.sdkControls);
440
+ if (sdk && root.contains(sdk)) continue;
441
+ const text = (element.getAttribute('aria-label') || textOf(element).trim() || element.getAttribute('placeholder') || '').replace(/\\s+/g, ' ');
442
+ const cls = [...element.classList].find((name) => !/^et-(surface|color)--/.test(name));
443
+ const named = element.tagName.toLowerCase() + (cls ? '.' + cls : '') + (text ? ' "' + (text.length > 32 ? text.slice(0, 31) + '…' : text) + '"' : '');
444
+ report('CONTROL-PART-INPUT', element, named + ' is a control without data-et-control, so no control check sees it - mark it with control(markup, name) from @ethlete/components/design/control and declare the name in controls');
445
+ }
446
+ ${action_undeclared_1.ACTION_UNDECLARED_STATEMENTS}
447
+ ${disabled_interaction_1.DISABLED_INTERACTION_STATEMENTS}
272
448
  return found;
273
- })(${JSON.stringify(Object.assign(Object.assign({}, options), { escapable: ESCAPABLE }))})`;
449
+ })(${JSON.stringify(Object.assign(Object.assign({}, options), { escapable: ESCAPABLE, controlInputs: complete_1.PLAIN_CONTROL_SELECTOR, sdkControls: complete_1.SDK_CONTROLS.join(', ') }))})`;
274
450
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === 'string') : [];
275
451
  const SDK_PREFIX = 'et-';
276
452
  const namespacesOf = (cssSources) => [
@@ -291,28 +467,132 @@ const firstOfEach = (issues) => {
291
467
  return true;
292
468
  });
293
469
  };
470
+ const uniqueIssuesOf = (issues) => {
471
+ const seen = new Set();
472
+ return issues.filter((issue) => {
473
+ const perState = issue.rule !== 'SKIP-SCOPE';
474
+ const key = JSON.stringify([
475
+ issue.product,
476
+ issue.part,
477
+ issue.sketch,
478
+ perState ? issue.state : null,
479
+ perState ? issue.size : null,
480
+ issue.rule,
481
+ issue.path,
482
+ issue.detail,
483
+ ]);
484
+ if (seen.has(key))
485
+ return false;
486
+ seen.add(key);
487
+ return true;
488
+ });
489
+ };
490
+ exports.uniqueIssuesOf = uniqueIssuesOf;
294
491
  const widthsOf = (value) => Array.isArray(value)
295
492
  ? value.filter((width) => typeof width === 'number' && Number.isInteger(width) && width > 0)
296
493
  : [];
494
+ const PART_TIMEOUT_MS = 120000;
495
+ const embedControlsOf = (controls) => typeof controls === 'object' && controls !== null
496
+ ? Object.entries(controls)
497
+ .filter(([, declared]) => typeof (declared === null || declared === void 0 ? void 0 : declared.part) === 'string')
498
+ .map(([name]) => name)
499
+ : [];
500
+ /** The render rule of a part whose drawing did not finish in time, apart from a part that failed to draw. */
501
+ exports.RENDER_TIMEOUT = 'RENDER-TIMEOUT';
502
+ const timedOutKeyOf = (address) => JSON.stringify([address.product, address.part, address.sketch]);
503
+ /** @internal Inspects `frames`, then the parts that timed out once more alone, and keeps that second answer. */
504
+ const inspectRetryingTimeouts = (options) => __awaiter(void 0, void 0, void 0, function* () {
505
+ var _a;
506
+ const inspectOf = (_a = options.inspectOf) !== null && _a !== void 0 ? _a : inspect;
507
+ const first = yield inspectOf(options);
508
+ const timedOut = new Set(first.filter((issue) => issue.rule === exports.RENDER_TIMEOUT).map(timedOutKeyOf));
509
+ if (timedOut.size === 0)
510
+ return first;
511
+ const again = yield inspectOf(Object.assign(Object.assign({}, options), { frames: options.frames.filter((frame) => timedOut.has(timedOutKeyOf(frame.address))), onPart: undefined }));
512
+ return [...first.filter((issue) => !timedOut.has(timedOutKeyOf(issue))), ...again];
513
+ });
514
+ exports.inspectRetryingTimeouts = inspectRetryingTimeouts;
297
515
  const inspect = (options) => __awaiter(void 0, void 0, void 0, function* () {
516
+ var _a, _b, _c, _d;
298
517
  const { browser, base, frames } = options;
518
+ const timeoutMs = (_a = options.timeoutMs) !== null && _a !== void 0 ? _a : PART_TIMEOUT_MS;
299
519
  const context = yield browser.newContext();
520
+ yield context.addInitScript(action_undeclared_1.CLICK_LISTENER_INIT_SCRIPT);
300
521
  const issues = [];
522
+ const groups = new Map();
523
+ for (const frame of frames) {
524
+ const { product, part, sketch } = frame.address;
525
+ const key = JSON.stringify([product, part, sketch]);
526
+ groups.set(key, [...((_b = groups.get(key)) !== null && _b !== void 0 ? _b : []), frame]);
527
+ }
301
528
  try {
302
- const page = yield context.newPage();
303
- for (const frame of frames) {
304
- yield page.setViewportSize(frame.viewport);
305
- yield (0, thumb_1.openFrame)(page, `${base}/frame.html?${frame.search}`);
306
- yield page.evaluate(thumb_1.settled);
307
- const found = (yield page.evaluate(inspectFrame({
308
- fixed: frame.fixed,
309
- fit: frame.fit,
310
- skips: frame.skips,
311
- namespaces: frame.namespaces,
312
- contrast: frame.contrast,
313
- })));
314
- const { product, part, state, sketch } = frame.address;
315
- issues.push(...found.map((issue) => (Object.assign(Object.assign({}, issue), { product, part, state, sketch, size: frame.size }))));
529
+ let page = yield context.newPage();
530
+ let sdkErrors = (0, sdk_errors_1.watchSdkErrorLines)(page);
531
+ let done = 0;
532
+ for (const group of groups.values()) {
533
+ const started = Date.now();
534
+ const found = [];
535
+ const current = page;
536
+ const sdkErrorsOf = sdkErrors.drain;
537
+ const drawn = (() => __awaiter(void 0, void 0, void 0, function* () {
538
+ for (const frame of group) {
539
+ yield current.emulateMedia({ colorScheme: frame.contrast.scheme });
540
+ yield current.setViewportSize(frame.viewport);
541
+ yield (0, thumb_1.openFrame)(current, `${base}/frame.html?${frame.search}`);
542
+ yield (0, thumb_1.awaitSettled)(current);
543
+ const inspected = {
544
+ fixed: frame.fixed,
545
+ fit: frame.fit,
546
+ skips: frame.skips,
547
+ namespaces: frame.namespaces,
548
+ contrast: frame.contrast,
549
+ part: frame.controlInputs ? frame.address.part : null,
550
+ embedControls: frame.embedControls,
551
+ };
552
+ const inFrame = (yield current.evaluate(inspectFrame(inspected)));
553
+ yield current.evaluate((0, shot_1.emptySlotsScriptOf)(frame.address.part));
554
+ const unstyled = (yield current.evaluate(inspectFrame(Object.assign(Object.assign({}, inspected), { sdkStylesOnly: true }))));
555
+ const { product, part, state, sketch } = frame.address;
556
+ found.push(...[...inFrame, ...unstyled].map((issue) => (Object.assign(Object.assign({}, issue), { product, part, state, sketch, size: frame.size }))));
557
+ }
558
+ }))();
559
+ drawn.catch(() => undefined);
560
+ const result = yield (0, rxjs_1.firstValueFrom)((0, rxjs_1.race)((0, rxjs_1.from)(drawn).pipe((0, rxjs_1.map)(() => 'drawn')), (0, rxjs_1.timer)(timeoutMs).pipe((0, rxjs_1.map)(() => 'timeout'))));
561
+ const first = (_c = group[0]) === null || _c === void 0 ? void 0 : _c.address;
562
+ if (result === 'timeout') {
563
+ yield current.close().catch(() => undefined);
564
+ page = yield context.newPage();
565
+ sdkErrors = (0, sdk_errors_1.watchSdkErrorLines)(page);
566
+ if (first)
567
+ issues.push({
568
+ rule: exports.RENDER_TIMEOUT,
569
+ product: first.product,
570
+ part: first.part,
571
+ state: '-',
572
+ size: '-',
573
+ path: '-',
574
+ detail: `drawing the part did not finish within ${Math.round(timeoutMs / 1000)}s`,
575
+ sketch: first.sketch,
576
+ });
577
+ }
578
+ else {
579
+ issues.push(...found);
580
+ if (first)
581
+ for (const line of sdkErrorsOf())
582
+ issues.push({
583
+ rule: 'RENDER',
584
+ product: first.product,
585
+ part: first.part,
586
+ state: '-',
587
+ size: '-',
588
+ path: '-',
589
+ detail: `logged SDK error ${line.split('\n')[0]}`,
590
+ sketch: first.sketch,
591
+ });
592
+ }
593
+ done++;
594
+ if (first)
595
+ (_d = options.onPart) === null || _d === void 0 ? void 0 : _d.call(options, { done, total: groups.size, part: first.part, ms: Date.now() - started });
316
596
  }
317
597
  }
318
598
  finally {
@@ -326,13 +606,15 @@ const inspect = (options) => __awaiter(void 0, void 0, void 0, function* () {
326
606
  * its content. Answers the rule breaks it finds, or why it could not draw.
327
607
  */
328
608
  const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function* () {
329
- var _a, _b, _c, _d, _e, _f, _g;
609
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
330
610
  const { target, config, jobs } = options;
331
611
  const resolveChromium = (_a = options.chromiumOf) !== null && _a !== void 0 ? _a : browser_1.chromiumOf;
332
612
  if (jobs.length === 0)
333
613
  return { issues: [], warnings: [], grids: [], drawn: [] };
334
614
  if (!(yield resolveChromium(target)))
335
- return { unavailable: 'neither the checkout nor this package resolves playwright or playwright-core' };
615
+ return {
616
+ unavailable: `neither ${target} nor this package (${__dirname}) resolves playwright or playwright-core, so there is no Chromium to launch`,
617
+ };
336
618
  const queue = (0, thumb_1.createDrawQueue)({ target, chromiumOf: resolveChromium });
337
619
  const server = yield (0, serve_1.createDesignServer)({ target, config, listen: true, port: 0 });
338
620
  try {
@@ -344,12 +626,19 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
344
626
  const issues = [];
345
627
  const grids = [];
346
628
  const gridWarnings = [];
629
+ const baselines = new Map();
630
+ const mergedSkips = new Map();
631
+ const framed = new Map();
347
632
  for (const { product, sketch, parts } of jobs) {
348
633
  const skips = {};
349
634
  const drawn = system.drawnOf(product, sketch);
350
635
  if (!drawn)
351
636
  continue;
637
+ const optionValuesOf = (0, option_values_1.optionValuesChecker)({ target, config, parts: drawn.parts });
638
+ const merged = sketch ? system.productOf(product) : null;
639
+ const mergedOptionValuesOf = (0, option_values_1.optionValuesChecker)({ target, config, parts: (_c = merged === null || merged === void 0 ? void 0 : merged.parts) !== null && _c !== void 0 ? _c : [] });
352
640
  const namespaces = namespacesOf(drawn.parts.map((part) => part.cssSource));
641
+ const schemes = (0, contrast_check_1.schemesOf)(drawn.parts.map((part) => part.cssSource));
353
642
  for (const part of drawn.parts) {
354
643
  const key = (0, resolve_product_1.partKeyOf)(part);
355
644
  const loaded = yield server
@@ -365,17 +654,58 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
365
654
  state: '-',
366
655
  size: '-',
367
656
  path: '-',
368
- detail: (_c = loaded.error.split('\n')[0]) !== null && _c !== void 0 ? _c : '',
657
+ detail: (_d = loaded.error.split('\n')[0]) !== null && _d !== void 0 ? _d : '',
369
658
  sketch,
370
659
  });
371
660
  continue;
372
661
  }
373
662
  const definition = loaded.module.default;
374
- skips[key] = stringsOf((_d = definition === null || definition === void 0 ? void 0 : definition.checks) === null || _d === void 0 ? void 0 : _d.skip);
663
+ skips[key] = stringsOf((_e = definition === null || definition === void 0 ? void 0 : definition.checks) === null || _e === void 0 ? void 0 : _e.skip);
375
664
  if (parts && !parts.includes(key))
376
665
  continue;
377
666
  const states = (definition === null || definition === void 0 ? void 0 : definition.states) && typeof definition.states === 'object' ? Object.keys(definition.states) : [];
378
667
  const grid = (0, list_system_1.gridReportOf)(definition === null || definition === void 0 ? void 0 : definition.grid, states);
668
+ const mergedPart = merged === null || merged === void 0 ? void 0 : merged.parts.find((candidate) => (0, resolve_product_1.partKeyOf)(candidate) === key);
669
+ const mergedDefinition = mergedPart
670
+ ? (yield server.ssrLoadModule((0, system_modules_1.productModuleIdOf)({ file: mergedPart.file, product })))['default']
671
+ : null;
672
+ const existing = new Set(mergedPart
673
+ ? mergedOptionValuesOf(mergedPart, mergedDefinition !== null && mergedDefinition !== void 0 ? mergedDefinition : {}).flatMap((gap) => { var _a; return (_a = gap.missing) !== null && _a !== void 0 ? _a : []; })
674
+ : []);
675
+ for (const problem of optionValuesOf(part, Object.assign(Object.assign({}, definition), { existing: sketch ? existing : undefined }))) {
676
+ const destination = problem.code === 'OPTION-VALUE-MISSING' && !sketch ? gridWarnings : issues;
677
+ destination.push({
678
+ rule: problem.code,
679
+ product,
680
+ part: key,
681
+ state: '-',
682
+ size: '-',
683
+ path: '-',
684
+ detail: problem.detail,
685
+ sketch,
686
+ });
687
+ }
688
+ const mergedStates = (mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.states) && typeof mergedDefinition.states === 'object'
689
+ ? Object.keys(mergedDefinition.states)
690
+ : [];
691
+ const base = mergedPart ? { controls: mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.controls, states: mergedStates } : null;
692
+ for (const gap of (0, complete_1.introducedControlStateGapsOf)({
693
+ part: key,
694
+ controls: definition === null || definition === void 0 ? void 0 : definition.controls,
695
+ states,
696
+ sketch: !!sketch,
697
+ base,
698
+ }))
699
+ issues.push({
700
+ rule: gap.code,
701
+ product,
702
+ part: key,
703
+ state: '-',
704
+ size: '-',
705
+ path: '-',
706
+ detail: gap.detail,
707
+ sketch,
708
+ });
379
709
  if (grid) {
380
710
  grids.push({ product, part: key, sketch, line: grid.line });
381
711
  grid.problems.forEach((detail) => issues.push({ rule: 'GRID', product, part: key, state: '-', size: '-', path: '-', detail, sketch }));
@@ -390,45 +720,134 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
390
720
  sketch,
391
721
  }));
392
722
  }
393
- const exceptions = (0, contrast_check_1.contrastExceptionsOf)((_e = definition === null || definition === void 0 ? void 0 : definition.contrast) === null || _e === void 0 ? void 0 : _e.exceptions);
394
- const pairs = (0, contrast_check_1.contrastPairsOf)((_f = definition === null || definition === void 0 ? void 0 : definition.contrast) === null || _f === void 0 ? void 0 : _f.pairs);
723
+ const exceptions = (0, contrast_check_1.contrastExceptionsOf)((_f = definition === null || definition === void 0 ? void 0 : definition.contrast) === null || _f === void 0 ? void 0 : _f.exceptions);
724
+ const pairs = (0, contrast_check_1.contrastPairsOf)((_g = definition === null || definition === void 0 ? void 0 : definition.contrast) === null || _g === void 0 ? void 0 : _g.pairs);
395
725
  exceptions.problems.forEach((detail) => issues.push({ rule: 'CONTRAST', product, part: key, state: '-', size: '-', path: '-', detail, sketch }));
396
- const widths = widthsOf(definition === null || definition === void 0 ? void 0 : definition.widths);
397
- const sizes = part.layer === 'pages'
398
- ? Object.keys(drawn.presets).map((preset) => ({ preset, width: null }))
726
+ const sizesOf = (widths, presets) => part.layer === 'pages'
727
+ ? Object.keys(presets).map((preset) => ({ preset, width: null }))
399
728
  : widths.length > 0
400
729
  ? widths.map((width) => ({ preset: null, width }))
401
730
  : [{ preset: null, width: null }];
402
- let measuresPairs = true;
403
- for (const state of states) {
404
- for (const { preset, width } of sizes) {
405
- const address = { product, part: key, state, preset, width, sketch, interaction: null };
731
+ const sizes = sizesOf(widthsOf(definition === null || definition === void 0 ? void 0 : definition.widths), drawn.presets);
732
+ const controlInputs = part.layer !== 'foundations';
733
+ const embedControls = embedControlsOf(definition === null || definition === void 0 ? void 0 : definition.controls);
734
+ const baselineKey = JSON.stringify([product, key]);
735
+ framed.set(JSON.stringify([product, key, sketch]), typeof (definition === null || definition === void 0 ? void 0 : definition.frame) === 'function');
736
+ if (merged && mergedPart && !baselines.has(baselineKey)) {
737
+ const mergedContrast = {
738
+ exceptions: (0, contrast_check_1.contrastExceptionsOf)((_h = mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.contrast) === null || _h === void 0 ? void 0 : _h.exceptions).selectors,
739
+ pairs: (0, contrast_check_1.contrastPairsOf)((_j = mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.contrast) === null || _j === void 0 ? void 0 : _j.pairs),
740
+ };
741
+ const measured = new Set();
742
+ mergedSkips.set(baselineKey, stringsOf((_k = mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.checks) === null || _k === void 0 ? void 0 : _k.skip));
743
+ framed.set(JSON.stringify([product, key, null]), typeof (mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.frame) === 'function');
744
+ baselines.set(baselineKey, mergedStates.flatMap((state) => sizesOf(widthsOf(mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.widths), merged.presets).flatMap(({ preset, width }) => schemes.flatMap((scheme) => {
745
+ var _a;
746
+ const address = { product, part: key, state, preset, width, sketch: null, interaction: null };
406
747
  const frame = (0, shot_1.partFrameOf)(Object.assign({ system }, address));
407
748
  if (frame instanceof Error)
408
- continue;
409
- frames.push({
410
- address,
411
- size: preset !== null && preset !== void 0 ? preset : (width ? `${width}px` : 'fitted'),
412
- search: frame.search.toString(),
413
- viewport: (0, shot_1.viewportOf)(frame.size),
414
- fixed: ((_g = frame.size) === null || _g === void 0 ? void 0 : _g.height) !== undefined,
415
- fit: frame.size === null,
416
- skips,
417
- namespaces,
418
- contrast: { exceptions: exceptions.selectors, pairs: measuresPairs ? pairs : [] },
419
- });
420
- measuresPairs = false;
749
+ return [];
750
+ const pairs = measured.has(scheme) ? [] : mergedContrast.pairs;
751
+ measured.add(scheme);
752
+ return [
753
+ {
754
+ address,
755
+ size: preset !== null && preset !== void 0 ? preset : (width ? `${width}px` : 'fitted'),
756
+ search: frame.search.toString(),
757
+ viewport: (0, shot_1.viewportOf)(frame.size),
758
+ fixed: ((_a = frame.size) === null || _a === void 0 ? void 0 : _a.height) !== undefined,
759
+ fit: frame.size === null,
760
+ skips,
761
+ namespaces,
762
+ contrast: { exceptions: mergedContrast.exceptions, pairs, scheme },
763
+ controlInputs,
764
+ embedControls,
765
+ },
766
+ ];
767
+ }))));
768
+ }
769
+ const measuresPairs = new Set();
770
+ for (const state of states) {
771
+ for (const { preset, width } of sizes) {
772
+ for (const scheme of schemes) {
773
+ const address = { product, part: key, state, preset, width, sketch, interaction: null };
774
+ const frame = (0, shot_1.partFrameOf)(Object.assign({ system }, address));
775
+ if (frame instanceof Error)
776
+ continue;
777
+ frames.push({
778
+ address,
779
+ size: preset !== null && preset !== void 0 ? preset : (width ? `${width}px` : 'fitted'),
780
+ search: frame.search.toString(),
781
+ viewport: (0, shot_1.viewportOf)(frame.size),
782
+ fixed: ((_l = frame.size) === null || _l === void 0 ? void 0 : _l.height) !== undefined,
783
+ fit: frame.size === null,
784
+ skips,
785
+ namespaces,
786
+ controlInputs,
787
+ embedControls,
788
+ contrast: {
789
+ exceptions: exceptions.selectors,
790
+ pairs: measuresPairs.has(scheme) ? [] : pairs,
791
+ scheme,
792
+ },
793
+ });
794
+ measuresPairs.add(scheme);
795
+ }
421
796
  }
422
797
  }
423
798
  }
424
799
  }
425
- const inspected = yield queue.run((browser) => inspect({ browser, base, frames }));
426
- issues.push(...inspected.filter((issue) => !WARNING_RULES.has(issue.rule)));
800
+ const all = yield queue.run((browser) => (0, exports.inspectRetryingTimeouts)({
801
+ browser,
802
+ base,
803
+ frames,
804
+ timeoutMs: options.partTimeoutMs,
805
+ onPart: ({ done, total, part, ms }) => { var _a; return (_a = options.onProgress) === null || _a === void 0 ? void 0 : _a.call(options, `[${done}/${total}] ${part} ${Math.round(ms / 1000)}s`); },
806
+ }));
807
+ const inspected = (0, exports.uniqueIssuesOf)(all.filter((issue) => issue.rule !== BUSY_MARK));
808
+ const isInput = (issue) => issue.rule === 'CONTROL-PART-INPUT';
809
+ const sketched = inspected.filter((issue) => issue.sketch && !WARNING_RULES.has(issue.rule));
810
+ const asked = new Set(((_m = options.before) !== null && _m !== void 0 ? _m : []).map(({ product, part }) => JSON.stringify([product, part])));
811
+ const compared = [...new Set([...sketched.map((issue) => JSON.stringify([issue.product, issue.part])), ...asked])];
812
+ const baseline = compared.flatMap((key) => {
813
+ var _a;
814
+ return ((_a = baselines.get(key)) !== null && _a !== void 0 ? _a : []).map((frame) => {
815
+ var _a;
816
+ return (Object.assign(Object.assign({}, frame), { skips: Object.assign(Object.assign({}, frame.skips), { [frame.address.part]: (_a = mergedSkips.get(key)) !== null && _a !== void 0 ? _a : [] }) }));
817
+ });
818
+ });
819
+ const elementOf = (issue) => JSON.stringify([issue.product, issue.part, issue.path]);
820
+ const sameIssueOf = (issue, inFrame) => JSON.stringify([
821
+ issue.product,
822
+ issue.part,
823
+ issue.rule,
824
+ isInput(issue) ? null : issue.detail,
825
+ inFrame === null ? issue.path : frameNeutralPathOf({ path: issue.path, part: issue.part, framed: inFrame }),
826
+ ]);
827
+ const framedOf = (issue, sketch) => { var _a; return (_a = framed.get(JSON.stringify([issue.product, issue.part, sketch]))) !== null && _a !== void 0 ? _a : false; };
828
+ const inProduct = baseline.length > 0 ? yield queue.run((browser) => inspect({ browser, base, frames: baseline })) : [];
829
+ const existing = new Set(inProduct.flatMap((issue) => [sameIssueOf(issue, null), sameIssueOf(issue, framedOf(issue, null))]));
830
+ const isOld = (issue) => existing.has(sameIssueOf(issue, null)) ||
831
+ (framedOf(issue, issue.sketch) !== framedOf(issue, null) &&
832
+ existing.has(sameIssueOf(issue, framedOf(issue, issue.sketch))));
833
+ const mergedInputs = inspected.filter((issue) => isInput(issue) && !issue.sketch);
834
+ issues.push(...inspected.filter((issue) => !issue.sketch && !WARNING_RULES.has(issue.rule) && !isInput(issue)), ...sketched.filter((issue) => !isOld(issue)));
427
835
  return {
428
836
  issues,
429
- warnings: [...gridWarnings, ...firstOfEach(inspected.filter((issue) => WARNING_RULES.has(issue.rule)))],
837
+ warnings: [
838
+ ...gridWarnings,
839
+ ...mergedInputs.filter((issue, index) => mergedInputs.findIndex((other) => elementOf(other) === elementOf(issue)) === index),
840
+ ...firstOfEach(inspected.filter((issue) => WARNING_RULES.has(issue.rule))),
841
+ ],
430
842
  grids,
431
- drawn: frames.map(({ address }) => {
843
+ busy: (0, exports.busyStatesOf)(all),
844
+ before: (0, exports.uniqueIssuesOf)(inProduct.filter((issue) => asked.has(JSON.stringify([issue.product, issue.part])) &&
845
+ issue.rule !== BUSY_MARK &&
846
+ !WARNING_RULES.has(issue.rule) &&
847
+ !isInput(issue))),
848
+ drawn: frames
849
+ .filter(({ contrast }) => contrast.scheme !== 'dark')
850
+ .map(({ address }) => {
432
851
  var _a;
433
852
  return ({
434
853
  product: address.product,