@ethlete/cli 3.0.0-next.26 → 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 (557) hide show
  1. package/CHANGELOG.md +328 -0
  2. package/build-info.json +1 -0
  3. package/design/define-call.ts +72 -30
  4. package/design/define-part.ts +37 -4
  5. package/design/icon-sheet.ts +1 -1
  6. package/design/interaction-rows.ts +13 -6
  7. package/design/mark-part.ts +51 -1
  8. package/design/token-sheet.ts +1 -1
  9. package/design/web/frame-fit.ts +7 -0
  10. package/design/web/frame-surfaces.ts +294 -0
  11. package/design/web/frame.ts +41 -15
  12. package/design/web/surface-interactive.css +42 -0
  13. package/design/with-action.ts +29 -0
  14. package/package.json +3 -1
  15. package/src/index.js +9 -1
  16. package/src/index.js.map +1 -1
  17. package/src/lib/design/asset-shot.js +2 -2
  18. package/src/lib/design/asset-shot.js.map +1 -1
  19. package/src/lib/design/build-watch.d.ts +26 -0
  20. package/src/lib/design/build-watch.js +138 -0
  21. package/src/lib/design/build-watch.js.map +1 -0
  22. package/src/lib/design/check.js +142 -16
  23. package/src/lib/design/check.js.map +1 -1
  24. package/src/lib/design/commit-hunks.d.ts +22 -0
  25. package/src/lib/design/commit-hunks.js +173 -0
  26. package/src/lib/design/commit-hunks.js.map +1 -0
  27. package/src/lib/design/design-command.d.ts +2 -0
  28. package/src/lib/design/design-command.js +160 -11
  29. package/src/lib/design/design-command.js.map +1 -1
  30. package/src/lib/design/force-interactions.d.ts +1 -1
  31. package/src/lib/design/force-interactions.js +4 -2
  32. package/src/lib/design/force-interactions.js.map +1 -1
  33. package/src/lib/design/inbox-command.js +9 -5
  34. package/src/lib/design/inbox-command.js.map +1 -1
  35. package/src/lib/design/mcp-command.d.ts +5 -1
  36. package/src/lib/design/mcp-command.js +29 -11
  37. package/src/lib/design/mcp-command.js.map +1 -1
  38. package/src/lib/design/merge-compare.d.ts +10 -2
  39. package/src/lib/design/merge-compare.js +63 -11
  40. package/src/lib/design/merge-compare.js.map +1 -1
  41. package/src/lib/design/motion-command.js +1 -1
  42. package/src/lib/design/motion-command.js.map +1 -1
  43. package/src/lib/design/motion-shot.js +3 -2
  44. package/src/lib/design/motion-shot.js.map +1 -1
  45. package/src/lib/design/new-call.js +19 -10
  46. package/src/lib/design/new-call.js.map +1 -1
  47. package/src/lib/design/part-marks.d.ts +3 -2
  48. package/src/lib/design/part-marks.js +13 -5
  49. package/src/lib/design/part-marks.js.map +1 -1
  50. package/src/lib/design/paths.d.ts +28 -0
  51. package/src/lib/design/paths.js.map +1 -1
  52. package/src/lib/design/product-command.d.ts +1 -1
  53. package/src/lib/design/product-command.js +12 -14
  54. package/src/lib/design/product-command.js.map +1 -1
  55. package/src/lib/design/ready-shots.d.ts +29 -3
  56. package/src/lib/design/ready-shots.js +105 -5
  57. package/src/lib/design/ready-shots.js.map +1 -1
  58. package/src/lib/design/render-packages.d.ts +4 -17
  59. package/src/lib/design/render-packages.js +20 -63
  60. package/src/lib/design/render-packages.js.map +1 -1
  61. package/src/lib/design/render-worker.js +1 -3
  62. package/src/lib/design/render-worker.js.map +1 -1
  63. package/src/lib/design/render.d.ts +2 -0
  64. package/src/lib/design/render.js +32 -7
  65. package/src/lib/design/render.js.map +1 -1
  66. package/src/lib/design/serve.d.ts +21 -1
  67. package/src/lib/design/serve.js +133 -19
  68. package/src/lib/design/serve.js.map +1 -1
  69. package/src/lib/design/server-identity.d.ts +36 -0
  70. package/src/lib/design/server-identity.js +68 -0
  71. package/src/lib/design/server-identity.js.map +1 -0
  72. package/src/lib/design/settle-frames.d.ts +4 -0
  73. package/src/lib/design/settle-frames.js +22 -0
  74. package/src/lib/design/settle-frames.js.map +1 -0
  75. package/src/lib/design/shot-command.d.ts +25 -4
  76. package/src/lib/design/shot-command.js +132 -46
  77. package/src/lib/design/shot-command.js.map +1 -1
  78. package/src/lib/design/shot.d.ts +50 -0
  79. package/src/lib/design/shot.js +143 -17
  80. package/src/lib/design/shot.js.map +1 -1
  81. package/src/lib/design/sketch-command.d.ts +6 -1
  82. package/src/lib/design/sketch-command.js +358 -126
  83. package/src/lib/design/sketch-command.js.map +1 -1
  84. package/src/lib/design/stale-cli-dist.d.ts +11 -0
  85. package/src/lib/design/stale-cli-dist.js +56 -0
  86. package/src/lib/design/stale-cli-dist.js.map +1 -0
  87. package/src/lib/design/stamp.d.ts +18 -1
  88. package/src/lib/design/stamp.js +53 -7
  89. package/src/lib/design/stamp.js.map +1 -1
  90. package/src/lib/design/started-by-studio.d.ts +1 -0
  91. package/src/lib/design/started-by-studio.js +6 -0
  92. package/src/lib/design/started-by-studio.js.map +1 -0
  93. package/src/lib/design/studio-api.d.ts +27 -8
  94. package/src/lib/design/studio-api.js +263 -58
  95. package/src/lib/design/studio-api.js.map +1 -1
  96. package/src/lib/design/system/accept-command.d.ts +39 -5
  97. package/src/lib/design/system/accept-command.js +109 -25
  98. package/src/lib/design/system/accept-command.js.map +1 -1
  99. package/src/lib/design/system/accepted-pictures.d.ts +83 -0
  100. package/src/lib/design/system/accepted-pictures.js +324 -0
  101. package/src/lib/design/system/accepted-pictures.js.map +1 -0
  102. package/src/lib/design/system/action-lost.d.ts +59 -0
  103. package/src/lib/design/system/action-lost.js +120 -0
  104. package/src/lib/design/system/action-lost.js.map +1 -0
  105. package/src/lib/design/system/action-press.d.ts +23 -0
  106. package/src/lib/design/system/action-press.js +76 -0
  107. package/src/lib/design/system/action-press.js.map +1 -0
  108. package/src/lib/design/system/action-undeclared.d.ts +34 -0
  109. package/src/lib/design/system/action-undeclared.js +81 -0
  110. package/src/lib/design/system/action-undeclared.js.map +1 -0
  111. package/src/lib/design/system/actions-command.d.ts +101 -0
  112. package/src/lib/design/system/actions-command.js +695 -0
  113. package/src/lib/design/system/actions-command.js.map +1 -0
  114. package/src/lib/design/system/actions.d.ts +158 -0
  115. package/src/lib/design/system/actions.js +295 -0
  116. package/src/lib/design/system/actions.js.map +1 -0
  117. package/src/lib/design/system/app-files.d.ts +10 -0
  118. package/src/lib/design/system/app-files.js +159 -0
  119. package/src/lib/design/system/app-files.js.map +1 -0
  120. package/src/lib/design/system/bespoke-controls.d.ts +30 -0
  121. package/src/lib/design/system/bespoke-controls.js +147 -0
  122. package/src/lib/design/system/bespoke-controls.js.map +1 -0
  123. package/src/lib/design/system/build-ready-contract.d.ts +27 -0
  124. package/src/lib/design/system/build-ready-contract.js +12 -0
  125. package/src/lib/design/system/build-ready-contract.js.map +1 -0
  126. package/src/lib/design/system/check-rules.d.ts +1 -0
  127. package/src/lib/design/system/check-rules.js +82 -0
  128. package/src/lib/design/system/check-rules.js.map +1 -0
  129. package/src/lib/design/system/check-system.d.ts +61 -6
  130. package/src/lib/design/system/check-system.js +479 -68
  131. package/src/lib/design/system/check-system.js.map +1 -1
  132. package/src/lib/design/system/comments/comment.d.ts +4 -1
  133. package/src/lib/design/system/comments/comment.js +13 -4
  134. package/src/lib/design/system/comments/comment.js.map +1 -1
  135. package/src/lib/design/system/comments/inbox.js +2 -2
  136. package/src/lib/design/system/comments/inbox.js.map +1 -1
  137. package/src/lib/design/system/compare-command.d.ts +119 -0
  138. package/src/lib/design/system/compare-command.js +558 -0
  139. package/src/lib/design/system/compare-command.js.map +1 -0
  140. package/src/lib/design/system/complete-command.js +1 -1
  141. package/src/lib/design/system/complete-command.js.map +1 -1
  142. package/src/lib/design/system/complete.d.ts +32 -1
  143. package/src/lib/design/system/complete.js +144 -48
  144. package/src/lib/design/system/complete.js.map +1 -1
  145. package/src/lib/design/system/component-outputs.d.ts +20 -0
  146. package/src/lib/design/system/component-outputs.js +86 -0
  147. package/src/lib/design/system/component-outputs.js.map +1 -0
  148. package/src/lib/design/system/contrast-check.d.ts +1 -1
  149. package/src/lib/design/system/contrast-check.js +14 -3
  150. package/src/lib/design/system/contrast-check.js.map +1 -1
  151. package/src/lib/design/system/demo-backdrop.d.ts +11 -0
  152. package/src/lib/design/system/demo-backdrop.js +41 -0
  153. package/src/lib/design/system/demo-backdrop.js.map +1 -0
  154. package/src/lib/design/system/design-hash.d.ts +31 -0
  155. package/src/lib/design/system/design-hash.js +73 -0
  156. package/src/lib/design/system/design-hash.js.map +1 -0
  157. package/src/lib/design/system/disabled-interaction.d.ts +8 -0
  158. package/src/lib/design/system/disabled-interaction.js +37 -0
  159. package/src/lib/design/system/disabled-interaction.js.map +1 -0
  160. package/src/lib/design/system/dom-command.d.ts +36 -0
  161. package/src/lib/design/system/dom-command.js +175 -0
  162. package/src/lib/design/system/dom-command.js.map +1 -0
  163. package/src/lib/design/system/drawn-open-points.d.ts +25 -3
  164. package/src/lib/design/system/drawn-open-points.js +65 -14
  165. package/src/lib/design/system/drawn-open-points.js.map +1 -1
  166. package/src/lib/design/system/dropped-props.d.ts +25 -0
  167. package/src/lib/design/system/dropped-props.js +159 -0
  168. package/src/lib/design/system/dropped-props.js.map +1 -0
  169. package/src/lib/design/system/embedded-actions.d.ts +21 -0
  170. package/src/lib/design/system/embedded-actions.js +37 -0
  171. package/src/lib/design/system/embedded-actions.js.map +1 -0
  172. package/src/lib/design/system/exceptions.js +2 -1
  173. package/src/lib/design/system/exceptions.js.map +1 -1
  174. package/src/lib/design/system/flows/flow.js +2 -1
  175. package/src/lib/design/system/flows/flow.js.map +1 -1
  176. package/src/lib/design/system/frozen-animations.d.ts +13 -0
  177. package/src/lib/design/system/frozen-animations.js +51 -0
  178. package/src/lib/design/system/frozen-animations.js.map +1 -0
  179. package/src/lib/design/system/go-batch.d.ts +24 -0
  180. package/src/lib/design/system/go-batch.js +110 -0
  181. package/src/lib/design/system/go-batch.js.map +1 -0
  182. package/src/lib/design/system/go-command.d.ts +4 -0
  183. package/src/lib/design/system/go-command.js +64 -0
  184. package/src/lib/design/system/go-command.js.map +1 -0
  185. package/src/lib/design/system/go-guard.d.ts +26 -0
  186. package/src/lib/design/system/go-guard.js +70 -0
  187. package/src/lib/design/system/go-guard.js.map +1 -0
  188. package/src/lib/design/system/go-step.d.ts +13 -0
  189. package/src/lib/design/system/go-step.js +84 -0
  190. package/src/lib/design/system/go-step.js.map +1 -0
  191. package/src/lib/design/system/handoff.js +2 -1
  192. package/src/lib/design/system/handoff.js.map +1 -1
  193. package/src/lib/design/system/harness-build-cache.d.ts +35 -0
  194. package/src/lib/design/system/harness-build-cache.js +175 -0
  195. package/src/lib/design/system/harness-build-cache.js.map +1 -0
  196. package/src/lib/design/system/harness-command.d.ts +7 -0
  197. package/src/lib/design/system/harness-command.js +51 -0
  198. package/src/lib/design/system/harness-command.js.map +1 -0
  199. package/src/lib/design/system/harness-config.d.ts +9 -0
  200. package/src/lib/design/system/harness-config.js +65 -0
  201. package/src/lib/design/system/harness-config.js.map +1 -0
  202. package/src/lib/design/system/harness-map.d.ts +44 -0
  203. package/src/lib/design/system/harness-map.js +126 -0
  204. package/src/lib/design/system/harness-map.js.map +1 -0
  205. package/src/lib/design/system/harness-samples.d.ts +20 -0
  206. package/src/lib/design/system/harness-samples.js +92 -0
  207. package/src/lib/design/system/harness-samples.js.map +1 -0
  208. package/src/lib/design/system/harness-server.d.ts +40 -0
  209. package/src/lib/design/system/harness-server.js +296 -0
  210. package/src/lib/design/system/harness-server.js.map +1 -0
  211. package/src/lib/design/system/imports.js +14 -1
  212. package/src/lib/design/system/imports.js.map +1 -1
  213. package/src/lib/design/system/in-order-at-once.d.ts +6 -0
  214. package/src/lib/design/system/in-order-at-once.js +28 -0
  215. package/src/lib/design/system/in-order-at-once.js.map +1 -0
  216. package/src/lib/design/system/inventory-approval.js +2 -1
  217. package/src/lib/design/system/inventory-approval.js.map +1 -1
  218. package/src/lib/design/system/inventory.d.ts +13 -4
  219. package/src/lib/design/system/inventory.js +36 -7
  220. package/src/lib/design/system/inventory.js.map +1 -1
  221. package/src/lib/design/system/list-system.d.ts +4 -0
  222. package/src/lib/design/system/list-system.js +12 -3
  223. package/src/lib/design/system/list-system.js.map +1 -1
  224. package/src/lib/design/system/live-actions.d.ts +121 -0
  225. package/src/lib/design/system/live-actions.js +665 -0
  226. package/src/lib/design/system/live-actions.js.map +1 -0
  227. package/src/lib/design/system/live-compare.d.ts +136 -0
  228. package/src/lib/design/system/live-compare.js +441 -0
  229. package/src/lib/design/system/live-compare.js.map +1 -0
  230. package/src/lib/design/system/live-uncovered.d.ts +40 -0
  231. package/src/lib/design/system/live-uncovered.js +123 -0
  232. package/src/lib/design/system/live-uncovered.js.map +1 -0
  233. package/src/lib/design/system/nested-scroll.d.ts +7 -0
  234. package/src/lib/design/system/nested-scroll.js +25 -0
  235. package/src/lib/design/system/nested-scroll.js.map +1 -0
  236. package/src/lib/design/system/notes/note.js +2 -1
  237. package/src/lib/design/system/notes/note.js.map +1 -1
  238. package/src/lib/design/system/occluded.d.ts +13 -0
  239. package/src/lib/design/system/occluded.js +111 -0
  240. package/src/lib/design/system/occluded.js.map +1 -0
  241. package/src/lib/design/system/open-points.d.ts +24 -6
  242. package/src/lib/design/system/open-points.js +59 -30
  243. package/src/lib/design/system/open-points.js.map +1 -1
  244. package/src/lib/design/system/part-build-ready.d.ts +39 -0
  245. package/src/lib/design/system/part-build-ready.js +107 -0
  246. package/src/lib/design/system/part-build-ready.js.map +1 -0
  247. package/src/lib/design/system/part-command.js +2 -9
  248. package/src/lib/design/system/part-command.js.map +1 -1
  249. package/src/lib/design/system/part-compare.d.ts +123 -0
  250. package/src/lib/design/system/part-compare.js +396 -0
  251. package/src/lib/design/system/part-compare.js.map +1 -0
  252. package/src/lib/design/system/part-go.d.ts +70 -0
  253. package/src/lib/design/system/part-go.js +94 -0
  254. package/src/lib/design/system/part-go.js.map +1 -0
  255. package/src/lib/design/system/part-ready.d.ts +44 -6
  256. package/src/lib/design/system/part-ready.js +88 -17
  257. package/src/lib/design/system/part-ready.js.map +1 -1
  258. package/src/lib/design/system/part-task.d.ts +147 -0
  259. package/src/lib/design/system/part-task.js +285 -0
  260. package/src/lib/design/system/part-task.js.map +1 -0
  261. package/src/lib/design/system/pointer-focus.d.ts +81 -0
  262. package/src/lib/design/system/pointer-focus.js +152 -0
  263. package/src/lib/design/system/pointer-focus.js.map +1 -0
  264. package/src/lib/design/system/prettier.d.ts +10 -0
  265. package/src/lib/design/system/prettier.js +36 -0
  266. package/src/lib/design/system/prettier.js.map +1 -0
  267. package/src/lib/design/system/reach.d.ts +12 -0
  268. package/src/lib/design/system/reach.js +186 -0
  269. package/src/lib/design/system/reach.js.map +1 -0
  270. package/src/lib/design/system/reachable-controls.d.ts +6 -0
  271. package/src/lib/design/system/reachable-controls.js +19 -0
  272. package/src/lib/design/system/reachable-controls.js.map +1 -0
  273. package/src/lib/design/system/reachable-files.d.ts +14 -0
  274. package/src/lib/design/system/reachable-files.js +101 -0
  275. package/src/lib/design/system/reachable-files.js.map +1 -0
  276. package/src/lib/design/system/reached-state.d.ts +23 -0
  277. package/src/lib/design/system/reached-state.js +53 -0
  278. package/src/lib/design/system/reached-state.js.map +1 -0
  279. package/src/lib/design/system/read-open-points.d.ts +9 -3
  280. package/src/lib/design/system/read-open-points.js +38 -9
  281. package/src/lib/design/system/read-open-points.js.map +1 -1
  282. package/src/lib/design/system/ready-command.d.ts +6 -2
  283. package/src/lib/design/system/ready-command.js +32 -15
  284. package/src/lib/design/system/ready-command.js.map +1 -1
  285. package/src/lib/design/system/render-check.d.ts +50 -0
  286. package/src/lib/design/system/render-check.js +341 -88
  287. package/src/lib/design/system/render-check.js.map +1 -1
  288. package/src/lib/design/system/resolve-product.js +5 -0
  289. package/src/lib/design/system/resolve-product.js.map +1 -1
  290. package/src/lib/design/system/rules/app-spec.d.ts +30 -0
  291. package/src/lib/design/system/rules/app-spec.js +87 -0
  292. package/src/lib/design/system/rules/app-spec.js.map +1 -0
  293. package/src/lib/design/system/rules/canonical-class.d.ts +2 -0
  294. package/src/lib/design/system/rules/canonical-class.js +36 -110
  295. package/src/lib/design/system/rules/canonical-class.js.map +1 -1
  296. package/src/lib/design/system/rules/capability-place.d.ts +44 -0
  297. package/src/lib/design/system/rules/capability-place.js +116 -0
  298. package/src/lib/design/system/rules/capability-place.js.map +1 -0
  299. package/src/lib/design/system/rules/denied-class.d.ts +9 -0
  300. package/src/lib/design/system/rules/denied-class.js +121 -0
  301. package/src/lib/design/system/rules/denied-class.js.map +1 -0
  302. package/src/lib/design/system/rules/exemptions.d.ts +18 -0
  303. package/src/lib/design/system/rules/exemptions.js +18 -0
  304. package/src/lib/design/system/rules/exemptions.js.map +1 -0
  305. package/src/lib/design/system/rules/flow.js +1 -1
  306. package/src/lib/design/system/rules/flow.js.map +1 -1
  307. package/src/lib/design/system/rules/glued-interpolation.d.ts +8 -0
  308. package/src/lib/design/system/rules/glued-interpolation.js +61 -0
  309. package/src/lib/design/system/rules/glued-interpolation.js.map +1 -0
  310. package/src/lib/design/system/rules/hard-coded-colour.js +2 -1
  311. package/src/lib/design/system/rules/hard-coded-colour.js.map +1 -1
  312. package/src/lib/design/system/rules/implemented-components.d.ts +22 -0
  313. package/src/lib/design/system/rules/implemented-components.js +45 -0
  314. package/src/lib/design/system/rules/implemented-components.js.map +1 -0
  315. package/src/lib/design/system/rules/implements.d.ts +2 -1
  316. package/src/lib/design/system/rules/implements.js +26 -21
  317. package/src/lib/design/system/rules/implements.js.map +1 -1
  318. package/src/lib/design/system/rules/inline-svg.js +4 -1
  319. package/src/lib/design/system/rules/inline-svg.js.map +1 -1
  320. package/src/lib/design/system/rules/inline-ui-in-page-open.d.ts +13 -0
  321. package/src/lib/design/system/rules/inline-ui-in-page-open.js +5 -0
  322. package/src/lib/design/system/rules/inline-ui-in-page-open.js.map +1 -0
  323. package/src/lib/design/system/rules/inline-ui-in-page.d.ts +18 -0
  324. package/src/lib/design/system/rules/inline-ui-in-page.js +123 -0
  325. package/src/lib/design/system/rules/inline-ui-in-page.js.map +1 -0
  326. package/src/lib/design/system/rules/inline-ui.d.ts +16 -0
  327. package/src/lib/design/system/rules/inline-ui.js +100 -0
  328. package/src/lib/design/system/rules/inline-ui.js.map +1 -0
  329. package/src/lib/design/system/rules/motion.d.ts +1 -1
  330. package/src/lib/design/system/rules/motion.js +25 -17
  331. package/src/lib/design/system/rules/motion.js.map +1 -1
  332. package/src/lib/design/system/rules/native-title.d.ts +7 -0
  333. package/src/lib/design/system/rules/native-title.js +64 -0
  334. package/src/lib/design/system/rules/native-title.js.map +1 -0
  335. package/src/lib/design/system/rules/orphan-endpoint-known.d.ts +12 -0
  336. package/src/lib/design/system/rules/orphan-endpoint-known.js +20 -0
  337. package/src/lib/design/system/rules/orphan-endpoint-known.js.map +1 -0
  338. package/src/lib/design/system/rules/orphan-endpoint.d.ts +23 -0
  339. package/src/lib/design/system/rules/orphan-endpoint.js +166 -0
  340. package/src/lib/design/system/rules/orphan-endpoint.js.map +1 -0
  341. package/src/lib/design/system/rules/part-rewrite.d.ts +13 -0
  342. package/src/lib/design/system/rules/part-rewrite.js +125 -0
  343. package/src/lib/design/system/rules/part-rewrite.js.map +1 -0
  344. package/src/lib/design/system/rules/sample-default-known.d.ts +5 -0
  345. package/src/lib/design/system/rules/sample-default-known.js +17 -0
  346. package/src/lib/design/system/rules/sample-default-known.js.map +1 -0
  347. package/src/lib/design/system/rules/sample-default.d.ts +22 -0
  348. package/src/lib/design/system/rules/sample-default.js +92 -0
  349. package/src/lib/design/system/rules/sample-default.js.map +1 -0
  350. package/src/lib/design/system/rules/stale-replace.js +4 -0
  351. package/src/lib/design/system/rules/stale-replace.js.map +1 -1
  352. package/src/lib/design/system/rules/state-in-component.d.ts +16 -0
  353. package/src/lib/design/system/rules/state-in-component.js +101 -0
  354. package/src/lib/design/system/rules/state-in-component.js.map +1 -0
  355. package/src/lib/design/system/rules/tailwind-classes.d.ts +51 -0
  356. package/src/lib/design/system/rules/tailwind-classes.js +232 -0
  357. package/src/lib/design/system/rules/tailwind-classes.js.map +1 -0
  358. package/src/lib/design/system/rules/top-level-await.d.ts +9 -0
  359. package/src/lib/design/system/rules/top-level-await.js +62 -0
  360. package/src/lib/design/system/rules/top-level-await.js.map +1 -0
  361. package/src/lib/design/system/rules/unbound-input-known.d.ts +5 -0
  362. package/src/lib/design/system/rules/unbound-input-known.js +47 -0
  363. package/src/lib/design/system/rules/unbound-input-known.js.map +1 -0
  364. package/src/lib/design/system/rules/unbound-input.d.ts +22 -0
  365. package/src/lib/design/system/rules/unbound-input.js +61 -0
  366. package/src/lib/design/system/rules/unbound-input.js.map +1 -0
  367. package/src/lib/design/system/rules/uncovered-region.d.ts +13 -0
  368. package/src/lib/design/system/rules/uncovered-region.js +36 -0
  369. package/src/lib/design/system/rules/uncovered-region.js.map +1 -0
  370. package/src/lib/design/system/rules/undefined-class.d.ts +9 -0
  371. package/src/lib/design/system/rules/undefined-class.js +32 -0
  372. package/src/lib/design/system/rules/undefined-class.js.map +1 -0
  373. package/src/lib/design/system/rules/undefined-token.d.ts +1 -1
  374. package/src/lib/design/system/rules/undefined-token.js +7 -61
  375. package/src/lib/design/system/rules/undefined-token.js.map +1 -1
  376. package/src/lib/design/system/rules/utility-css.d.ts +2 -1
  377. package/src/lib/design/system/rules/utility-css.js +29 -14
  378. package/src/lib/design/system/rules/utility-css.js.map +1 -1
  379. package/src/lib/design/system/rules/view-coverage.d.ts +8 -0
  380. package/src/lib/design/system/rules/view-coverage.js +51 -0
  381. package/src/lib/design/system/rules/view-coverage.js.map +1 -0
  382. package/src/lib/design/system/rules/visible-change.d.ts +20 -0
  383. package/src/lib/design/system/rules/visible-change.js +48 -0
  384. package/src/lib/design/system/rules/visible-change.js.map +1 -0
  385. package/src/lib/design/system/sdk-errors.d.ts +14 -0
  386. package/src/lib/design/system/sdk-errors.js +38 -0
  387. package/src/lib/design/system/sdk-errors.js.map +1 -0
  388. package/src/lib/design/system/see-through.d.ts +12 -0
  389. package/src/lib/design/system/see-through.js +112 -0
  390. package/src/lib/design/system/see-through.js.map +1 -0
  391. package/src/lib/design/system/settled-panes.d.ts +18 -0
  392. package/src/lib/design/system/settled-panes.js +70 -0
  393. package/src/lib/design/system/settled-panes.js.map +1 -0
  394. package/src/lib/design/system/sketch/after-merge.d.ts +11 -0
  395. package/src/lib/design/system/sketch/after-merge.js +51 -0
  396. package/src/lib/design/system/sketch/after-merge.js.map +1 -0
  397. package/src/lib/design/system/sketch/aktuell-placeholders.d.ts +30 -0
  398. package/src/lib/design/system/sketch/aktuell-placeholders.js +87 -0
  399. package/src/lib/design/system/sketch/aktuell-placeholders.js.map +1 -0
  400. package/src/lib/design/system/sketch/baseline.d.ts +19 -1
  401. package/src/lib/design/system/sketch/baseline.js +29 -7
  402. package/src/lib/design/system/sketch/baseline.js.map +1 -1
  403. package/src/lib/design/system/sketch/check-sketches.d.ts +10 -0
  404. package/src/lib/design/system/sketch/check-sketches.js +50 -4
  405. package/src/lib/design/system/sketch/check-sketches.js.map +1 -1
  406. package/src/lib/design/system/sketch/cli-args.d.ts +12 -2
  407. package/src/lib/design/system/sketch/cli-args.js +18 -3
  408. package/src/lib/design/system/sketch/cli-args.js.map +1 -1
  409. package/src/lib/design/system/sketch/edit-sketch.d.ts +21 -0
  410. package/src/lib/design/system/sketch/edit-sketch.js +117 -0
  411. package/src/lib/design/system/sketch/edit-sketch.js.map +1 -0
  412. package/src/lib/design/system/sketch/frame-budget.d.ts +24 -0
  413. package/src/lib/design/system/sketch/frame-budget.js +23 -0
  414. package/src/lib/design/system/sketch/frame-budget.js.map +1 -0
  415. package/src/lib/design/system/sketch/identical-renders.d.ts +31 -0
  416. package/src/lib/design/system/sketch/identical-renders.js +137 -0
  417. package/src/lib/design/system/sketch/identical-renders.js.map +1 -0
  418. package/src/lib/design/system/sketch/merge-shared.d.ts +2 -0
  419. package/src/lib/design/system/sketch/merge-shared.js +7 -10
  420. package/src/lib/design/system/sketch/merge-shared.js.map +1 -1
  421. package/src/lib/design/system/sketch/merge-step.d.ts +35 -0
  422. package/src/lib/design/system/sketch/merge-step.js +98 -0
  423. package/src/lib/design/system/sketch/merge-step.js.map +1 -0
  424. package/src/lib/design/system/sketch/merge.d.ts +10 -3
  425. package/src/lib/design/system/sketch/merge.js +103 -30
  426. package/src/lib/design/system/sketch/merge.js.map +1 -1
  427. package/src/lib/design/system/sketch/merged-layout.d.ts +17 -0
  428. package/src/lib/design/system/sketch/merged-layout.js +57 -0
  429. package/src/lib/design/system/sketch/merged-layout.js.map +1 -0
  430. package/src/lib/design/system/sketch/merged-parts.d.ts +40 -10
  431. package/src/lib/design/system/sketch/merged-parts.js +112 -49
  432. package/src/lib/design/system/sketch/merged-parts.js.map +1 -1
  433. package/src/lib/design/system/sketch/no-visible-change.d.ts +10 -0
  434. package/src/lib/design/system/sketch/no-visible-change.js +16 -6
  435. package/src/lib/design/system/sketch/no-visible-change.js.map +1 -1
  436. package/src/lib/design/system/sketch/part-definition.d.ts +21 -1
  437. package/src/lib/design/system/sketch/part-definition.js +79 -17
  438. package/src/lib/design/system/sketch/part-definition.js.map +1 -1
  439. package/src/lib/design/system/sketch/rebase-port.d.ts +24 -0
  440. package/src/lib/design/system/sketch/rebase-port.js +170 -0
  441. package/src/lib/design/system/sketch/rebase-port.js.map +1 -0
  442. package/src/lib/design/system/sketch/sample-mark-drift.d.ts +33 -0
  443. package/src/lib/design/system/sketch/sample-mark-drift.js +88 -0
  444. package/src/lib/design/system/sketch/sample-mark-drift.js.map +1 -0
  445. package/src/lib/design/system/sketch/sketch-check-worker.d.ts +1 -0
  446. package/src/lib/design/system/sketch/sketch-check-worker.js +27 -0
  447. package/src/lib/design/system/sketch/sketch-check-worker.js.map +1 -0
  448. package/src/lib/design/system/sketch/sketch-checker.d.ts +27 -0
  449. package/src/lib/design/system/sketch/sketch-checker.js +99 -0
  450. package/src/lib/design/system/sketch/sketch-checker.js.map +1 -0
  451. package/src/lib/design/system/sketch/sketch.d.ts +63 -2
  452. package/src/lib/design/system/sketch/sketch.js +185 -30
  453. package/src/lib/design/system/sketch/sketch.js.map +1 -1
  454. package/src/lib/design/system/sketch/stale-base.d.ts +22 -0
  455. package/src/lib/design/system/sketch/stale-base.js +56 -0
  456. package/src/lib/design/system/sketch/stale-base.js.map +1 -0
  457. package/src/lib/design/system/sketch/unchanged-states.d.ts +32 -0
  458. package/src/lib/design/system/sketch/unchanged-states.js +52 -13
  459. package/src/lib/design/system/sketch/unchanged-states.js.map +1 -1
  460. package/src/lib/design/system/sketch/unused-closure.js +16 -4
  461. package/src/lib/design/system/sketch/unused-closure.js.map +1 -1
  462. package/src/lib/design/system/sketch/viewed-shots.d.ts +24 -0
  463. package/src/lib/design/system/sketch/viewed-shots.js +61 -0
  464. package/src/lib/design/system/sketch/viewed-shots.js.map +1 -0
  465. package/src/lib/design/system/slow-checks.d.ts +40 -0
  466. package/src/lib/design/system/slow-checks.js +197 -0
  467. package/src/lib/design/system/slow-checks.js.map +1 -0
  468. package/src/lib/design/system/slow-run.d.ts +57 -0
  469. package/src/lib/design/system/slow-run.js +253 -0
  470. package/src/lib/design/system/slow-run.js.map +1 -0
  471. package/src/lib/design/system/stale-design-mocks.d.ts +20 -0
  472. package/src/lib/design/system/stale-design-mocks.js +59 -0
  473. package/src/lib/design/system/stale-design-mocks.js.map +1 -0
  474. package/src/lib/design/system/stale-dist.d.ts +25 -0
  475. package/src/lib/design/system/stale-dist.js +91 -0
  476. package/src/lib/design/system/stale-dist.js.map +1 -0
  477. package/src/lib/design/system/stale-parts.d.ts +30 -0
  478. package/src/lib/design/system/stale-parts.js +106 -0
  479. package/src/lib/design/system/stale-parts.js.map +1 -0
  480. package/src/lib/design/system/surface-nesting.d.ts +11 -0
  481. package/src/lib/design/system/surface-nesting.js +86 -0
  482. package/src/lib/design/system/surface-nesting.js.map +1 -0
  483. package/src/lib/design/system/system-command.js +8 -6
  484. package/src/lib/design/system/system-command.js.map +1 -1
  485. package/src/lib/design/system/system-modules.d.ts +16 -1
  486. package/src/lib/design/system/system-modules.js +18 -2
  487. package/src/lib/design/system/system-modules.js.map +1 -1
  488. package/src/lib/design/system/task-command.d.ts +51 -0
  489. package/src/lib/design/system/task-command.js +233 -0
  490. package/src/lib/design/system/task-command.js.map +1 -0
  491. package/src/lib/design/system/theming-text.d.ts +2 -0
  492. package/src/lib/design/system/theming-text.js +6 -0
  493. package/src/lib/design/system/theming-text.js.map +1 -0
  494. package/src/lib/design/system/tom-confirm.d.ts +40 -0
  495. package/src/lib/design/system/tom-confirm.js +55 -0
  496. package/src/lib/design/system/tom-confirm.js.map +1 -0
  497. package/src/lib/design/system/touched-parts.d.ts +16 -0
  498. package/src/lib/design/system/touched-parts.js +122 -0
  499. package/src/lib/design/system/touched-parts.js.map +1 -0
  500. package/src/lib/design/system/ts-source.d.ts +2 -0
  501. package/src/lib/design/system/ts-source.js +15 -1
  502. package/src/lib/design/system/ts-source.js.map +1 -1
  503. package/src/lib/design/system/unchanged-rows.d.ts +15 -0
  504. package/src/lib/design/system/unchanged-rows.js +134 -0
  505. package/src/lib/design/system/unchanged-rows.js.map +1 -0
  506. package/src/lib/design/system/uncommitted-decisions.d.ts +6 -0
  507. package/src/lib/design/system/uncommitted-decisions.js +38 -0
  508. package/src/lib/design/system/uncommitted-decisions.js.map +1 -0
  509. package/src/lib/design/system/uncovered-regions.d.ts +61 -0
  510. package/src/lib/design/system/uncovered-regions.js +171 -0
  511. package/src/lib/design/system/uncovered-regions.js.map +1 -0
  512. package/src/lib/design/system/unused-base-parts.d.ts +7 -0
  513. package/src/lib/design/system/unused-base-parts.js +76 -0
  514. package/src/lib/design/system/unused-base-parts.js.map +1 -0
  515. package/src/lib/design/system/visible-change-command.d.ts +48 -0
  516. package/src/lib/design/system/visible-change-command.js +308 -0
  517. package/src/lib/design/system/visible-change-command.js.map +1 -0
  518. package/src/lib/design/system/visible-change-parts.d.ts +28 -0
  519. package/src/lib/design/system/visible-change-parts.js +96 -0
  520. package/src/lib/design/system/visible-change-parts.js.map +1 -0
  521. package/src/lib/design/system/visible-change.d.ts +82 -0
  522. package/src/lib/design/system/visible-change.js +149 -0
  523. package/src/lib/design/system/visible-change.js.map +1 -0
  524. package/src/lib/design/thumb.d.ts +19 -2
  525. package/src/lib/design/thumb.js +50 -15
  526. package/src/lib/design/thumb.js.map +1 -1
  527. package/src/lib/design/typecheck.d.ts +1 -1
  528. package/src/lib/design/typecheck.js +3 -3
  529. package/src/lib/design/typecheck.js.map +1 -1
  530. package/src/lib/design/unstable-cells.d.ts +23 -0
  531. package/src/lib/design/unstable-cells.js +40 -0
  532. package/src/lib/design/unstable-cells.js.map +1 -0
  533. package/src/lib/design/variant-diff.js +1 -1
  534. package/src/lib/design/variant-diff.js.map +1 -1
  535. package/src/lib/design/wait.d.ts +15 -0
  536. package/src/lib/design/wait.js +30 -0
  537. package/src/lib/design/wait.js.map +1 -0
  538. package/src/lib/json-file.d.ts +11 -0
  539. package/src/lib/json-file.js +21 -0
  540. package/src/lib/json-file.js.map +1 -0
  541. package/src/lib/source-hash.d.ts +7 -0
  542. package/src/lib/source-hash.js +62 -0
  543. package/src/lib/source-hash.js.map +1 -0
  544. package/src/lib/update/agent-setup.js +2 -1
  545. package/src/lib/update/agent-setup.js.map +1 -1
  546. package/src/lib/update/migration-manifest.d.ts +12 -0
  547. package/src/lib/update/migration-manifest.js +13 -0
  548. package/src/lib/update/migration-manifest.js.map +1 -1
  549. package/src/lib/update/migration-record.js +2 -1
  550. package/src/lib/update/migration-record.js.map +1 -1
  551. package/src/lib/update/pending.js +2 -1
  552. package/src/lib/update/pending.js.map +1 -1
  553. package/src/lib/update/run-migrations.d.ts +3 -2
  554. package/src/lib/update/run-migrations.js +38 -5
  555. package/src/lib/update/run-migrations.js.map +1 -1
  556. package/src/lib/update/tasks.js +2 -1
  557. package/src/lib/update/tasks.js.map +1 -1
@@ -9,21 +9,46 @@ 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.groupedIssueLinesOf = 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");
15
16
  const complete_1 = require("./complete");
17
+ const action_undeclared_1 = require("./action-undeclared");
18
+ const disabled_interaction_1 = require("./disabled-interaction");
16
19
  const css_source_1 = require("./css-source");
17
20
  const serve_1 = require("../serve");
18
21
  const shot_1 = require("../shot");
19
22
  const thumb_1 = require("../thumb");
20
23
  const list_system_1 = require("./list-system");
24
+ const sdk_errors_1 = require("./sdk-errors");
21
25
  const resolve_product_1 = require("./resolve-product");
22
26
  const system_modules_1 = require("./system-modules");
23
- const unchanged_states_1 = require("./sketch/unchanged-states");
24
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;
25
47
  const renderIssueLineOf = (issue) => `${issue.rule} ${issue.product} ${issue.part} ${issue.state} at ${issue.size}: ${issue.path} - ${issue.detail}`;
26
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;
27
52
  const SCHEME_IN_DETAIL = / in the (light|dark) scheme/u;
28
53
  /** The render issues as lines, one per finding that repeats across states, sizes, schemes and variants, with where it was found. */
29
54
  const groupedIssueLinesOf = (issues) => {
@@ -60,13 +85,22 @@ const SINGLE_LINE = 'button, [role="button"], [role="tab"], [role="switch"], [ro
60
85
  * Reads the rule breaks in a drawn frame. A string, not a function: the build would add helpers to a
61
86
  * function that the page does not have.
62
87
  */
63
- 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];
64
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
+ };
65
99
  // complete.ts and this module sit in an import cycle: read PLAIN_CONTROL_SELECTOR here, a top-level copy can be undefined.
66
100
  const inspectFrame = (options) => `((options) => {
67
101
  const root = document.getElementById('root');
68
102
  const refused = root.innerText.trim();
69
- 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(' - ') }];
70
104
 
71
105
  const found = [];
72
106
  const seen = new Set();
@@ -92,7 +126,7 @@ const inspectFrame = (options) => `((options) => {
92
126
  };
93
127
  const pathOf = (element) => {
94
128
  const names = [];
95
- 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));
96
130
  return names.join(' > ');
97
131
  };
98
132
  const report = (rule, element, detail) => {
@@ -105,9 +139,22 @@ const inspectFrame = (options) => `((options) => {
105
139
  const sizeOf = (element) =>
106
140
  element.scrollWidth + 'x' + element.scrollHeight + ' in ' + element.clientWidth + 'x' + element.clientHeight;
107
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
+
108
152
  const partRoot = root.querySelector('[data-et-part]') ?? root.querySelector(':scope > :not(style)');
109
153
  if (!partRoot) return found;
110
154
 
155
+ const busy = root.querySelector('${BUSY_SELECTOR}');
156
+ if (busy) found.push({ rule: '${BUSY_MARK}', path: pathOf(busy), detail: 'draws ongoing work' });
157
+
111
158
  const sheets = [...document.styleSheets].map((sheet) => {
112
159
  try {
113
160
  return [...sheet.cssRules].map((rule) => rule.cssText).join('\\n');
@@ -170,19 +217,30 @@ const inspectFrame = (options) => `((options) => {
170
217
  }
171
218
 
172
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
+ });
173
227
  const drawnSizeOf = (element) => {
174
- if (!element.hasAttribute('data-et-embed-box')) return { width: element.scrollWidth, height: element.scrollHeight };
175
- 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();
176
231
  return { width: Math.floor(rect.width), height: Math.floor(rect.height) };
177
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)));
178
235
  for (const element of root.querySelectorAll('*')) {
179
236
  const style = getComputedStyle(element);
180
237
  const drawn = drawnSizeOf(element);
181
- const cutX = clips(style.overflowX) && drawn.width > element.clientWidth;
182
- const cutY = clips(style.overflowY) && drawn.height > element.clientHeight;
183
- 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);
184
241
  if ((cutX || cutY) && !cutsOnPurpose) report('CLIPPED', element, 'content ' + drawn.width + 'x' + drawn.height + ' in ' + element.clientWidth + 'x' + element.clientHeight);
185
242
  }
243
+ ${nested_scroll_1.NESTED_SCROLL_STATEMENTS}
186
244
 
187
245
  const px = (value) => parseFloat(value) || 0;
188
246
  const invisible = (colour) => colour === 'transparent' || /^rgba\\(.*,\\s*0\\)$/.test(colour);
@@ -198,16 +256,39 @@ const inspectFrame = (options) => `((options) => {
198
256
  const rect = at.getBoundingClientRect();
199
257
  const left = rect.left + at.clientLeft;
200
258
  const top = rect.top + at.clientTop;
259
+ const marginX = clipMarginOf(style, 'overflowX');
260
+ const marginY = clipMarginOf(style, 'overflowY');
201
261
  const box = {
202
- left: style.overflowX === 'visible' ? -Infinity : left,
203
- right: style.overflowX === 'visible' ? Infinity : left + at.clientWidth,
204
- top: style.overflowY === 'visible' ? -Infinity : top,
205
- 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,
206
266
  };
207
- return { name: pathOf(at), box };
267
+ return { name: pathOf(at), box, style, element: at };
208
268
  }
209
269
  return frameBox();
210
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
+ };
211
292
  const pastOf = (rect, reach, box) =>
212
293
  Math.max(
213
294
  rect.left >= box.left ? box.left - (rect.left - reach.left) : 0,
@@ -237,13 +318,44 @@ const inspectFrame = (options) => `((options) => {
237
318
  if (rect.width === 0 && rect.height === 0) continue;
238
319
  const outline = style.outlineStyle !== 'none' && !invisible(style.outlineColor) ? Math.max(0, px(style.outlineWidth) + px(style.outlineOffset)) : 0;
239
320
  const shadow = shadowReachOf(style.boxShadow);
240
- const clip = clipOf(element.parentElement);
321
+ const clip = ringClipOf(element);
241
322
  const outlinePast = outline > 0 ? pastOf(rect, { left: outline, right: outline, top: outline, bottom: outline }, clip.box) : 0;
242
323
  const shadowPast = pastOf(rect, shadow, clip.box);
243
324
  if (outlinePast > 1) report('CLIPPED', element, 'outline ' + Math.round(outlinePast) + 'px past ' + clip.name);
244
325
  else if (shadowPast > 1) report('CLIPPED', element, 'box-shadow ' + Math.round(shadowPast) + 'px past ' + clip.name);
245
326
  }
246
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
+
247
359
  const metrics = document.createElement('canvas').getContext('2d');
248
360
  for (const element of root.querySelectorAll('*')) {
249
361
  const style = getComputedStyle(element);
@@ -287,6 +399,7 @@ const inspectFrame = (options) => `((options) => {
287
399
  for (const [block, nodes] of groups) {
288
400
  const style = getComputedStyle(block);
289
401
  if (!singleLine(block) && style.whiteSpace !== 'nowrap' && style.textWrapMode !== 'nowrap') continue;
402
+ if (style.webkitLineClamp !== 'none') continue;
290
403
  const lines = [];
291
404
  for (const node of nodes) {
292
405
  const range = document.createRange();
@@ -303,6 +416,8 @@ const inspectFrame = (options) => `((options) => {
303
416
  }
304
417
  }
305
418
  ${contrast_check_1.CONTRAST_STATEMENTS}
419
+ ${see_through_1.SEE_THROUGH_STATEMENTS}
420
+ ${surface_nesting_1.SURFACE_STATEMENTS}
306
421
  const ownedOf = (element) => {
307
422
  const slotted = (element.getAttribute('data-et-slot') ?? '').split(' ').filter(Boolean);
308
423
  for (let at = element; at && at !== root; at = at.parentElement)
@@ -313,17 +428,23 @@ ${contrast_check_1.CONTRAST_STATEMENTS}
313
428
  }
314
429
  return true;
315
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('');
316
435
  if (options.part !== null)
317
436
  for (const element of root.querySelectorAll(options.controlInputs)) {
318
437
  if (element.getClientRects().length === 0 || element.closest('[data-et-control]') || !ownedOf(element)) continue;
319
438
  if (element.matches('[role="option"], [role^="menuitem"]') && element.closest('[data-et-surface]')) continue;
320
439
  const sdk = element.parentElement?.closest(options.sdkControls);
321
440
  if (sdk && root.contains(sdk)) continue;
322
- const text = (element.textContent.trim() || element.getAttribute('aria-label') || element.getAttribute('placeholder') || '').replace(/\\s+/g, ' ');
441
+ const text = (element.getAttribute('aria-label') || textOf(element).trim() || element.getAttribute('placeholder') || '').replace(/\\s+/g, ' ');
323
442
  const cls = [...element.classList].find((name) => !/^et-(surface|color)--/.test(name));
324
443
  const named = element.tagName.toLowerCase() + (cls ? '.' + cls : '') + (text ? ' "' + (text.length > 32 ? text.slice(0, 31) + '…' : text) + '"' : '');
325
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');
326
445
  }
446
+ ${action_undeclared_1.ACTION_UNDECLARED_STATEMENTS}
447
+ ${disabled_interaction_1.DISABLED_INTERACTION_STATEMENTS}
327
448
  return found;
328
449
  })(${JSON.stringify(Object.assign(Object.assign({}, options), { escapable: ESCAPABLE, controlInputs: complete_1.PLAIN_CONTROL_SELECTOR, sdkControls: complete_1.SDK_CONTROLS.join(', ') }))})`;
329
450
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === 'string') : [];
@@ -346,30 +467,132 @@ const firstOfEach = (issues) => {
346
467
  return true;
347
468
  });
348
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;
349
491
  const widthsOf = (value) => Array.isArray(value)
350
492
  ? value.filter((width) => typeof width === 'number' && Number.isInteger(width) && width > 0)
351
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;
352
515
  const inspect = (options) => __awaiter(void 0, void 0, void 0, function* () {
516
+ var _a, _b, _c, _d;
353
517
  const { browser, base, frames } = options;
518
+ const timeoutMs = (_a = options.timeoutMs) !== null && _a !== void 0 ? _a : PART_TIMEOUT_MS;
354
519
  const context = yield browser.newContext();
520
+ yield context.addInitScript(action_undeclared_1.CLICK_LISTENER_INIT_SCRIPT);
355
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
+ }
356
528
  try {
357
- const page = yield context.newPage();
358
- for (const frame of frames) {
359
- yield page.emulateMedia({ colorScheme: frame.contrast.scheme });
360
- yield page.setViewportSize(frame.viewport);
361
- yield (0, thumb_1.openFrame)(page, `${base}/frame.html?${frame.search}`);
362
- yield page.evaluate(thumb_1.settled);
363
- const found = (yield page.evaluate(inspectFrame({
364
- fixed: frame.fixed,
365
- fit: frame.fit,
366
- skips: frame.skips,
367
- namespaces: frame.namespaces,
368
- contrast: frame.contrast,
369
- part: frame.controlInputs ? frame.address.part : null,
370
- })));
371
- const { product, part, state, sketch } = frame.address;
372
- 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 });
373
596
  }
374
597
  }
375
598
  finally {
@@ -383,27 +606,29 @@ const inspect = (options) => __awaiter(void 0, void 0, void 0, function* () {
383
606
  * its content. Answers the rule breaks it finds, or why it could not draw.
384
607
  */
385
608
  const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function* () {
386
- var _a, _b, _c, _d, _e, _f, _g, _h;
609
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
387
610
  const { target, config, jobs } = options;
388
611
  const resolveChromium = (_a = options.chromiumOf) !== null && _a !== void 0 ? _a : browser_1.chromiumOf;
389
612
  if (jobs.length === 0)
390
613
  return { issues: [], warnings: [], grids: [], drawn: [] };
391
614
  if (!(yield resolveChromium(target)))
392
- 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
+ };
393
618
  const queue = (0, thumb_1.createDrawQueue)({ target, chromiumOf: resolveChromium });
394
619
  const server = yield (0, serve_1.createDesignServer)({ target, config, listen: true, port: 0 });
395
- let shots;
396
620
  try {
397
621
  yield server.listen();
398
622
  const { port } = (_b = server.httpServer) === null || _b === void 0 ? void 0 : _b.address();
399
623
  const base = `http://localhost:${port}`;
400
624
  const system = (0, system_modules_1.createSystemModules)({ target, config });
401
- shots = (0, shot_1.createPartShooter)({ target, base, system, queue });
402
625
  const frames = [];
403
626
  const issues = [];
404
627
  const grids = [];
405
628
  const gridWarnings = [];
406
629
  const baselines = new Map();
630
+ const mergedSkips = new Map();
631
+ const framed = new Map();
407
632
  for (const { product, sketch, parts } of jobs) {
408
633
  const skips = {};
409
634
  const drawn = system.drawnOf(product, sketch);
@@ -460,27 +685,16 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
460
685
  sketch,
461
686
  });
462
687
  }
463
- const compare = sketch && states.some(complete_1.isInteractionState) && !(0, complete_1.isControlPart)({ part: key, controls: definition === null || definition === void 0 ? void 0 : definition.controls });
464
- const baseline = compare ? system.productOf(product) : null;
465
- const foundSketch = compare
466
- ? system.sketchesOf(product).find((candidate) => candidate.target === sketch.target)
467
- : null;
468
- const unchanged = baseline && foundSketch && sketch
469
- ? yield (0, unchanged_states_1.unchangedStatesOf)({
470
- product: baseline,
471
- sketch: foundSketch,
472
- variant: sketch.variant,
473
- part: key,
474
- compareFrames: false,
475
- states: states.filter(complete_1.isInteractionState),
476
- pictureOf: shots.pictureOf,
477
- load: ({ file, product: name, sketch: variant }) => server.ssrLoadModule((0, system_modules_1.productModuleIdOf)({ file, product: name, sketch: variant })),
478
- })
688
+ const mergedStates = (mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.states) && typeof mergedDefinition.states === 'object'
689
+ ? Object.keys(mergedDefinition.states)
479
690
  : [];
480
- for (const gap of (0, complete_1.controlStateGapsOf)({
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)({
481
693
  part: key,
482
694
  controls: definition === null || definition === void 0 ? void 0 : definition.controls,
483
- states: sketch ? states.filter((state) => !unchanged.includes(state)) : [],
695
+ states,
696
+ sketch: !!sketch,
697
+ base,
484
698
  }))
485
699
  issues.push({
486
700
  rule: gap.code,
@@ -516,32 +730,41 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
516
730
  : [{ preset: null, width: null }];
517
731
  const sizes = sizesOf(widthsOf(definition === null || definition === void 0 ? void 0 : definition.widths), drawn.presets);
518
732
  const controlInputs = part.layer !== 'foundations';
733
+ const embedControls = embedControlsOf(definition === null || definition === void 0 ? void 0 : definition.controls);
519
734
  const baselineKey = JSON.stringify([product, key]);
520
- if (merged && mergedPart && controlInputs && !baselines.has(baselineKey)) {
521
- const mergedStates = (mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.states) && typeof mergedDefinition.states === 'object'
522
- ? Object.keys(mergedDefinition.states)
523
- : [];
524
- baselines.set(baselineKey, mergedStates.flatMap((state) => sizesOf(widthsOf(mergedDefinition === null || mergedDefinition === void 0 ? void 0 : mergedDefinition.widths), merged.presets).flatMap(({ preset, width }) => {
525
- var _a, _b;
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;
526
746
  const address = { product, part: key, state, preset, width, sketch: null, interaction: null };
527
747
  const frame = (0, shot_1.partFrameOf)(Object.assign({ system }, address));
528
- return frame instanceof Error
529
- ? []
530
- : [
531
- {
532
- address,
533
- size: preset !== null && preset !== void 0 ? preset : (width ? `${width}px` : 'fitted'),
534
- search: frame.search.toString(),
535
- viewport: (0, shot_1.viewportOf)(frame.size),
536
- fixed: ((_a = frame.size) === null || _a === void 0 ? void 0 : _a.height) !== undefined,
537
- fit: frame.size === null,
538
- skips: {},
539
- namespaces,
540
- contrast: { exceptions: [], pairs: [], scheme: (_b = schemes[0]) !== null && _b !== void 0 ? _b : null },
541
- controlInputs,
542
- },
543
- ];
544
- })));
748
+ if (frame instanceof Error)
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
+ }))));
545
768
  }
546
769
  const measuresPairs = new Set();
547
770
  for (const state of states) {
@@ -556,11 +779,12 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
556
779
  size: preset !== null && preset !== void 0 ? preset : (width ? `${width}px` : 'fitted'),
557
780
  search: frame.search.toString(),
558
781
  viewport: (0, shot_1.viewportOf)(frame.size),
559
- fixed: ((_h = frame.size) === null || _h === void 0 ? void 0 : _h.height) !== undefined,
782
+ fixed: ((_l = frame.size) === null || _l === void 0 ? void 0 : _l.height) !== undefined,
560
783
  fit: frame.size === null,
561
784
  skips,
562
785
  namespaces,
563
786
  controlInputs,
787
+ embedControls,
564
788
  contrast: {
565
789
  exceptions: exceptions.selectors,
566
790
  pairs: measuresPairs.has(scheme) ? [] : pairs,
@@ -573,17 +797,41 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
573
797
  }
574
798
  }
575
799
  }
576
- const inspected = yield queue.run((browser) => inspect({ browser, base, frames }));
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));
577
808
  const isInput = (issue) => issue.rule === 'CONTROL-PART-INPUT';
578
- const sketchedInputs = inspected.filter((issue) => isInput(issue) && issue.sketch);
579
- const compared = [...new Set(sketchedInputs.map((issue) => JSON.stringify([issue.product, issue.part])))];
580
- const baseline = compared.flatMap((key) => { var _a; return (_a = baselines.get(key)) !== null && _a !== void 0 ? _a : []; });
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
+ });
581
819
  const elementOf = (issue) => JSON.stringify([issue.product, issue.part, issue.path]);
582
- const existing = new Set((baseline.length > 0 ? yield queue.run((browser) => inspect({ browser, base, frames: baseline })) : [])
583
- .filter(isInput)
584
- .map(elementOf));
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))));
585
833
  const mergedInputs = inspected.filter((issue) => isInput(issue) && !issue.sketch);
586
- issues.push(...inspected.filter((issue) => !WARNING_RULES.has(issue.rule) && !isInput(issue)), ...sketchedInputs.filter((issue) => !existing.has(elementOf(issue))));
834
+ issues.push(...inspected.filter((issue) => !issue.sketch && !WARNING_RULES.has(issue.rule) && !isInput(issue)), ...sketched.filter((issue) => !isOld(issue)));
587
835
  return {
588
836
  issues,
589
837
  warnings: [
@@ -592,6 +840,11 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
592
840
  ...firstOfEach(inspected.filter((issue) => WARNING_RULES.has(issue.rule))),
593
841
  ],
594
842
  grids,
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))),
595
848
  drawn: frames
596
849
  .filter(({ contrast }) => contrast.scheme !== 'dark')
597
850
  .map(({ address }) => {
@@ -612,7 +865,7 @@ const renderIssuesOf = (options) => __awaiter(void 0, void 0, void 0, function*
612
865
  throw error;
613
866
  }
614
867
  finally {
615
- yield Promise.all([shots ? shots.close() : queue.close(), server.close()]);
868
+ yield Promise.all([queue.close(), server.close()]);
616
869
  }
617
870
  });
618
871
  exports.renderIssuesOf = renderIssuesOf;