@krizaka/ui 4.6.0 → 4.7.1

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 (959) hide show
  1. package/README.md +1 -0
  2. package/dist/{RotatingWord-D3tpDLE4.d.ts → RotatingWord-CkDcPH9x.d.ts} +2 -2
  3. package/dist/account-menu.js +2 -2
  4. package/dist/account-menu.js.map +1 -1
  5. package/dist/account-settings.d.ts +9 -9
  6. package/dist/account-settings.js +4 -4
  7. package/dist/account-settings.js.map +1 -1
  8. package/dist/achievement.d.ts +3 -3
  9. package/dist/achievement.js +1 -1
  10. package/dist/achievement.js.map +1 -1
  11. package/dist/action-bar.d.ts +1 -1
  12. package/dist/action-bar.js +5 -5
  13. package/dist/action-bar.js.map +1 -1
  14. package/dist/activity-feed.d.ts +2 -2
  15. package/dist/activity-feed.js +1 -1
  16. package/dist/activity-feed.js.map +1 -1
  17. package/dist/alert.d.ts +1 -1
  18. package/dist/alert.js.map +1 -1
  19. package/dist/analysis-report.d.ts +1 -1
  20. package/dist/analysis-report.js +4 -4
  21. package/dist/analysis-report.js.map +1 -1
  22. package/dist/anatomy-plate.d.ts +1 -1
  23. package/dist/anatomy-plate.js +1 -1
  24. package/dist/anatomy-plate.js.map +1 -1
  25. package/dist/app-header/search.d.ts +1 -1
  26. package/dist/app-header/search.js +2 -2
  27. package/dist/app-header/search.js.map +1 -1
  28. package/dist/app-header.d.ts +2 -2
  29. package/dist/app-header.js.map +1 -1
  30. package/dist/app-shell.d.ts +8 -8
  31. package/dist/app-shell.js +4 -4
  32. package/dist/app-shell.js.map +1 -1
  33. package/dist/architecture-diagram.d.ts +46 -0
  34. package/dist/architecture-diagram.js +324 -0
  35. package/dist/architecture-diagram.js.map +1 -0
  36. package/dist/argument-card.d.ts +2 -2
  37. package/dist/argument-card.js +8 -8
  38. package/dist/argument-card.js.map +1 -1
  39. package/dist/auth-layout.d.ts +1 -1
  40. package/dist/auth-layout.js.map +1 -1
  41. package/dist/avatar.d.ts +2 -2
  42. package/dist/avatar.js.map +1 -1
  43. package/dist/badge.d.ts +1 -1
  44. package/dist/badge.js +1 -1
  45. package/dist/bird-plate.d.ts +1 -1
  46. package/dist/bird-plate.js +2 -2
  47. package/dist/bird-plate.js.map +1 -1
  48. package/dist/blocks.css +33 -0
  49. package/dist/button.d.ts +2 -2
  50. package/dist/button.js +3 -3
  51. package/dist/captcha.d.ts +2 -2
  52. package/dist/captcha.js +3 -3
  53. package/dist/captcha.js.map +1 -1
  54. package/dist/card-grid.d.ts +1 -1
  55. package/dist/card-grid.js +1 -1
  56. package/dist/card-grid.js.map +1 -1
  57. package/dist/card.d.ts +9 -9
  58. package/dist/card.js +1 -1
  59. package/dist/card.js.map +1 -1
  60. package/dist/catalogue-page.d.ts +2 -2
  61. package/dist/catalogue-page.js.map +1 -1
  62. package/dist/changelog-page.d.ts +1 -1
  63. package/dist/changelog-page.js +2 -2
  64. package/dist/changelog-page.js.map +1 -1
  65. package/dist/chapter.d.ts +3 -3
  66. package/dist/chapter.js +2 -2
  67. package/dist/chapter.js.map +1 -1
  68. package/dist/chat.d.ts +3 -3
  69. package/dist/chat.js +1 -1
  70. package/dist/chat.js.map +1 -1
  71. package/dist/checkbox.d.ts +1 -1
  72. package/dist/checkbox.js.map +1 -1
  73. package/dist/chip-link.d.ts +1 -1
  74. package/dist/chip-link.js +1 -1
  75. package/dist/chip-row.d.ts +2 -2
  76. package/dist/chip-row.js +1 -1
  77. package/dist/chip-row.js.map +1 -1
  78. package/dist/chip.d.ts +4 -5
  79. package/dist/chip.js +2 -2
  80. package/dist/choice-grid.d.ts +1 -1
  81. package/dist/choice-grid.js +2 -2
  82. package/dist/choice-grid.js.map +1 -1
  83. package/dist/{chunk-S6NYGOJT.js → chunk-22IORLB5.js} +1 -1
  84. package/dist/chunk-22IORLB5.js.map +1 -0
  85. package/dist/{chunk-QA3WETWT.js → chunk-2P7Y3LNN.js} +1 -1
  86. package/dist/chunk-2P7Y3LNN.js.map +1 -0
  87. package/dist/{chunk-OGWB76BR.js → chunk-3CEMOJBL.js} +2 -2
  88. package/dist/chunk-3CEMOJBL.js.map +1 -0
  89. package/dist/{chunk-WC3SO4CE.js → chunk-3SWWUJJL.js} +2 -2
  90. package/dist/chunk-3SWWUJJL.js.map +1 -0
  91. package/dist/{chunk-S2O4NSN5.js → chunk-3TCHVNNB.js} +1 -1
  92. package/dist/chunk-3TCHVNNB.js.map +1 -0
  93. package/dist/{chunk-7P7I5OQV.js → chunk-5KBYZLU4.js} +2 -2
  94. package/dist/chunk-5KBYZLU4.js.map +1 -0
  95. package/dist/{chunk-WKQ5CB3I.js → chunk-6ARAO3TR.js} +1 -1
  96. package/dist/{chunk-WKQ5CB3I.js.map → chunk-6ARAO3TR.js.map} +1 -1
  97. package/dist/{chunk-QHVV2JGF.js → chunk-6LF6IZZM.js} +2 -2
  98. package/dist/chunk-6LF6IZZM.js.map +1 -0
  99. package/dist/{chunk-HP7BDMVK.js → chunk-7B5Q76JR.js} +2 -2
  100. package/dist/chunk-7B5Q76JR.js.map +1 -0
  101. package/dist/{chunk-F2UZ2WWL.js → chunk-7KIIAOQH.js} +1 -1
  102. package/dist/{chunk-F2UZ2WWL.js.map → chunk-7KIIAOQH.js.map} +1 -1
  103. package/dist/{chunk-ADRUEPYC.js → chunk-7MA3UODW.js} +2 -2
  104. package/dist/{chunk-ADRUEPYC.js.map → chunk-7MA3UODW.js.map} +1 -1
  105. package/dist/{chunk-KH3JOEPY.js → chunk-7PVLEALV.js} +1 -1
  106. package/dist/chunk-7PVLEALV.js.map +1 -0
  107. package/dist/{chunk-QVHSV6RA.js → chunk-7UBLUGNW.js} +1 -1
  108. package/dist/chunk-7UBLUGNW.js.map +1 -0
  109. package/dist/{chunk-YTYNKMNS.js → chunk-BKMHN4UA.js} +5 -5
  110. package/dist/chunk-BKMHN4UA.js.map +1 -0
  111. package/dist/{chunk-4QH6CP2Y.js → chunk-BRYRZWLV.js} +1 -1
  112. package/dist/{chunk-4QH6CP2Y.js.map → chunk-BRYRZWLV.js.map} +1 -1
  113. package/dist/{chunk-43PTCDTL.js → chunk-BVN7JFOP.js} +1 -1
  114. package/dist/chunk-BVN7JFOP.js.map +1 -0
  115. package/dist/{chunk-5RWHDX5J.js → chunk-BYKA3FHX.js} +2 -2
  116. package/dist/chunk-BYKA3FHX.js.map +1 -0
  117. package/dist/{chunk-5PFCELGW.js → chunk-DIOAQOR5.js} +1 -1
  118. package/dist/chunk-DIOAQOR5.js.map +1 -0
  119. package/dist/{chunk-HJFRHYCI.js → chunk-DTGRZXYO.js} +2 -2
  120. package/dist/{chunk-P7AFIKWG.js → chunk-DVC4YQI2.js} +2 -2
  121. package/dist/chunk-DVC4YQI2.js.map +1 -0
  122. package/dist/{chunk-V5RO6JYI.js → chunk-E3LFHTUV.js} +2 -2
  123. package/dist/chunk-E3LFHTUV.js.map +1 -0
  124. package/dist/{chunk-WEVYKZIF.js → chunk-EAXIDRMB.js} +1 -1
  125. package/dist/chunk-EAXIDRMB.js.map +1 -0
  126. package/dist/{chunk-WU4VLSEA.js → chunk-EYMS6VRF.js} +1 -1
  127. package/dist/chunk-EYMS6VRF.js.map +1 -0
  128. package/dist/{chunk-LH5J3VLZ.js → chunk-F7EJZV53.js} +1 -1
  129. package/dist/chunk-F7EJZV53.js.map +1 -0
  130. package/dist/{chunk-VPO27AFS.js → chunk-G3L7AKZJ.js} +1 -1
  131. package/dist/chunk-G3L7AKZJ.js.map +1 -0
  132. package/dist/{chunk-EB45EVPJ.js → chunk-G5NROYGK.js} +3 -3
  133. package/dist/chunk-G5NROYGK.js.map +1 -0
  134. package/dist/{chunk-HKEAYSFS.js → chunk-GQMINKT3.js} +1 -1
  135. package/dist/{chunk-ENOS6ETI.js.map → chunk-GQMINKT3.js.map} +1 -1
  136. package/dist/{chunk-3X3OF4TI.js → chunk-H4NXYAL7.js} +1 -1
  137. package/dist/{chunk-3X3OF4TI.js.map → chunk-H4NXYAL7.js.map} +1 -1
  138. package/dist/{chunk-KR2W4ONJ.js → chunk-H7I6YLI6.js} +1 -1
  139. package/dist/chunk-H7I6YLI6.js.map +1 -0
  140. package/dist/{chunk-PJNR4NTS.js → chunk-HC2TY45B.js} +4 -4
  141. package/dist/{chunk-NSLXEDIS.js → chunk-HHBTM4AU.js} +1 -1
  142. package/dist/chunk-HHBTM4AU.js.map +1 -0
  143. package/dist/{chunk-XVRKKYWU.js → chunk-HVUR3UNK.js} +2 -2
  144. package/dist/{chunk-XVRKKYWU.js.map → chunk-HVUR3UNK.js.map} +1 -1
  145. package/dist/{chunk-V7W4RLRW.js → chunk-HWIDTLLO.js} +3 -3
  146. package/dist/chunk-HWIDTLLO.js.map +1 -0
  147. package/dist/{chunk-W675RFOA.js → chunk-ISC2QBXJ.js} +1 -1
  148. package/dist/chunk-ISC2QBXJ.js.map +1 -0
  149. package/dist/{chunk-7DYZTEE3.js → chunk-IWPB6SSW.js} +1 -1
  150. package/dist/chunk-IWPB6SSW.js.map +1 -0
  151. package/dist/{chunk-TVLRE7S3.js → chunk-JDVWUF5W.js} +2 -2
  152. package/dist/{chunk-TVLRE7S3.js.map → chunk-JDVWUF5W.js.map} +1 -1
  153. package/dist/{chunk-757ZTGU5.js → chunk-JE2NY4XE.js} +4 -4
  154. package/dist/chunk-JE2NY4XE.js.map +1 -0
  155. package/dist/{chunk-HLEBSAGC.js → chunk-KBSZ6JRF.js} +2 -2
  156. package/dist/chunk-KBSZ6JRF.js.map +1 -0
  157. package/dist/{chunk-Y3P5B4XS.js → chunk-KCU45KQ3.js} +3 -3
  158. package/dist/chunk-KCU45KQ3.js.map +1 -0
  159. package/dist/{chunk-ST5P5HNI.js → chunk-L4YBG5US.js} +4 -4
  160. package/dist/{chunk-ST5P5HNI.js.map → chunk-L4YBG5US.js.map} +1 -1
  161. package/dist/{chunk-NG6G6V5E.js → chunk-LFH3LEWR.js} +1 -1
  162. package/dist/chunk-LFH3LEWR.js.map +1 -0
  163. package/dist/{chunk-YATTFMDV.js → chunk-LSQQSJ6J.js} +2 -2
  164. package/dist/{chunk-YATTFMDV.js.map → chunk-LSQQSJ6J.js.map} +1 -1
  165. package/dist/{chunk-LNAAWT4Y.js → chunk-MJWOZ3JI.js} +1 -1
  166. package/dist/chunk-MJWOZ3JI.js.map +1 -0
  167. package/dist/{chunk-KID32IRJ.js → chunk-MXHJMTZ5.js} +1 -1
  168. package/dist/{chunk-KID32IRJ.js.map → chunk-MXHJMTZ5.js.map} +1 -1
  169. package/dist/{chunk-GHAN7OOE.js → chunk-N6LAWI4F.js} +2 -2
  170. package/dist/chunk-N6LAWI4F.js.map +1 -0
  171. package/dist/{chunk-5VZ37TY3.js → chunk-NFJWD5BT.js} +2 -2
  172. package/dist/chunk-NFJWD5BT.js.map +1 -0
  173. package/dist/{chunk-ZPOVOEO3.js → chunk-NJLIHGU4.js} +2 -2
  174. package/dist/chunk-NJLIHGU4.js.map +1 -0
  175. package/dist/{chunk-PRD7JRQX.js → chunk-ONCQWOTH.js} +4 -4
  176. package/dist/{chunk-PRD7JRQX.js.map → chunk-ONCQWOTH.js.map} +1 -1
  177. package/dist/{chunk-ENOS6ETI.js → chunk-OZC6CDZF.js} +1 -1
  178. package/dist/{chunk-HKEAYSFS.js.map → chunk-OZC6CDZF.js.map} +1 -1
  179. package/dist/{chunk-TXFX4PMN.js → chunk-OZY4C4W5.js} +1 -1
  180. package/dist/{chunk-TXFX4PMN.js.map → chunk-OZY4C4W5.js.map} +1 -1
  181. package/dist/{chunk-NPMGYLJV.js → chunk-PIRYDEX2.js} +3 -3
  182. package/dist/chunk-PIRYDEX2.js.map +1 -0
  183. package/dist/{chunk-C57KK5VB.js → chunk-PM23USOC.js} +1 -1
  184. package/dist/chunk-PM23USOC.js.map +1 -0
  185. package/dist/{chunk-PGBF3UBX.js → chunk-QKL5TECH.js} +1 -1
  186. package/dist/chunk-QKL5TECH.js.map +1 -0
  187. package/dist/{chunk-Z47KIPCT.js → chunk-QY5JEUJT.js} +1 -1
  188. package/dist/chunk-QY5JEUJT.js.map +1 -0
  189. package/dist/{chunk-FVGFPB73.js → chunk-RPVKF4RR.js} +1 -1
  190. package/dist/{chunk-FVGFPB73.js.map → chunk-RPVKF4RR.js.map} +1 -1
  191. package/dist/{chunk-NM2DEHFZ.js → chunk-RXYKJIC4.js} +1 -1
  192. package/dist/chunk-RXYKJIC4.js.map +1 -0
  193. package/dist/{chunk-W64RAX4N.js → chunk-TKYNYIJS.js} +5 -5
  194. package/dist/chunk-TKYNYIJS.js.map +1 -0
  195. package/dist/{chunk-S4TLZRGZ.js → chunk-UMXWOA3I.js} +1 -1
  196. package/dist/chunk-UMXWOA3I.js.map +1 -0
  197. package/dist/{chunk-VA4NPCUQ.js → chunk-VD7QFUAP.js} +3 -3
  198. package/dist/chunk-VD7QFUAP.js.map +1 -0
  199. package/dist/{chunk-MDSP7DJR.js → chunk-VQELCPQJ.js} +5 -5
  200. package/dist/chunk-VQELCPQJ.js.map +1 -0
  201. package/dist/{chunk-2FCQCWIK.js → chunk-VXNBXW3P.js} +5 -5
  202. package/dist/chunk-VXNBXW3P.js.map +1 -0
  203. package/dist/{chunk-B47WSPMP.js → chunk-WPUDPH2Q.js} +1 -1
  204. package/dist/chunk-WPUDPH2Q.js.map +1 -0
  205. package/dist/{chunk-SG2RKUVJ.js → chunk-WTZUMVJI.js} +5 -5
  206. package/dist/chunk-WTZUMVJI.js.map +1 -0
  207. package/dist/{chunk-EDQLPCM4.js → chunk-WVZF6WK3.js} +2 -2
  208. package/dist/chunk-WVZF6WK3.js.map +1 -0
  209. package/dist/{chunk-5D7NMUF6.js → chunk-XDAETKWM.js} +2 -2
  210. package/dist/chunk-XDAETKWM.js.map +1 -0
  211. package/dist/{chunk-QD6SNXF5.js → chunk-XDWSGNL4.js} +3 -3
  212. package/dist/chunk-XDWSGNL4.js.map +1 -0
  213. package/dist/{chunk-SB5WSVPI.js → chunk-ZFH2BYXW.js} +2 -2
  214. package/dist/chunk-ZFH2BYXW.js.map +1 -0
  215. package/dist/{chunk-XVLWVTQA.js → chunk-ZI7K742O.js} +1 -1
  216. package/dist/{chunk-XVLWVTQA.js.map → chunk-ZI7K742O.js.map} +1 -1
  217. package/dist/{chunk-NQENOT6L.js → chunk-ZRRWSKV3.js} +8 -8
  218. package/dist/chunk-ZRRWSKV3.js.map +1 -0
  219. package/dist/cn.js +1 -1
  220. package/dist/code-block.d.ts +2 -2
  221. package/dist/code-block.js +2 -2
  222. package/dist/code-block.js.map +1 -1
  223. package/dist/collection-switcher.d.ts +1 -1
  224. package/dist/collection-switcher.js +1 -1
  225. package/dist/collection-switcher.js.map +1 -1
  226. package/dist/columns.d.ts +2 -2
  227. package/dist/columns.js.map +1 -1
  228. package/dist/combobox.js +4 -4
  229. package/dist/command.d.ts +10 -10
  230. package/dist/command.js +4 -4
  231. package/dist/command.js.map +1 -1
  232. package/dist/comparison-table.d.ts +1 -1
  233. package/dist/comparison-table.js +1 -1
  234. package/dist/comparison-table.js.map +1 -1
  235. package/dist/component-page.d.ts +1 -1
  236. package/dist/component-page.js.map +1 -1
  237. package/dist/confirm-button.d.ts +1 -1
  238. package/dist/confirm-button.js +4 -4
  239. package/dist/contact-page.d.ts +1 -1
  240. package/dist/contact-page.js.map +1 -1
  241. package/dist/continue-prompt.d.ts +1 -1
  242. package/dist/continue-prompt.js +1 -1
  243. package/dist/continue-prompt.js.map +1 -1
  244. package/dist/copy-button.d.ts +1 -1
  245. package/dist/copy-button.js +4 -4
  246. package/dist/copy-button.js.map +1 -1
  247. package/dist/countdown.d.ts +1 -1
  248. package/dist/countdown.js.map +1 -1
  249. package/dist/cover-hero.d.ts +1 -1
  250. package/dist/cover-hero.js +5 -5
  251. package/dist/cover-hero.js.map +1 -1
  252. package/dist/cta-panel.d.ts +1 -1
  253. package/dist/cta-panel.js +1 -1
  254. package/dist/cta-panel.js.map +1 -1
  255. package/dist/dashboard-layout.d.ts +2 -2
  256. package/dist/dashboard-layout.js.map +1 -1
  257. package/dist/data-table.d.ts +5 -5
  258. package/dist/data-table.js +9 -9
  259. package/dist/date-picker.d.ts +11 -11
  260. package/dist/date-picker.js +5 -5
  261. package/dist/date-picker.js.map +1 -1
  262. package/dist/decision-list.d.ts +1 -1
  263. package/dist/decision-list.js +2 -2
  264. package/dist/decision-list.js.map +1 -1
  265. package/dist/description-list.d.ts +2 -2
  266. package/dist/description-list.js.map +1 -1
  267. package/dist/detail-layout.d.ts +5 -5
  268. package/dist/detail-layout.js +1 -1
  269. package/dist/detail-layout.js.map +1 -1
  270. package/dist/{dialog-DpUwec2g.d.ts → dialog-CFnxFGyn.d.ts} +7 -7
  271. package/dist/dialog.d.ts +2 -2
  272. package/dist/dialog.js +4 -4
  273. package/dist/dialog.js.map +1 -1
  274. package/dist/docs-article-page.d.ts +1 -1
  275. package/dist/docs-article-page.js.map +1 -1
  276. package/dist/docs-hub-page.d.ts +1 -1
  277. package/dist/docs-hub-page.js.map +1 -1
  278. package/dist/docs-layout.d.ts +1 -1
  279. package/dist/docs-layout.js +1 -1
  280. package/dist/docs-layout.js.map +1 -1
  281. package/dist/docs-nav.d.ts +1 -1
  282. package/dist/docs-nav.js +1 -1
  283. package/dist/docs-nav.js.map +1 -1
  284. package/dist/document-viewer.d.ts +2 -2
  285. package/dist/document-viewer.js +3 -3
  286. package/dist/document-viewer.js.map +1 -1
  287. package/dist/doodle.d.ts +1 -1
  288. package/dist/doodle.js +1 -1
  289. package/dist/doodle.js.map +1 -1
  290. package/dist/drop-overlay.d.ts +1 -1
  291. package/dist/drop-overlay.js +1 -1
  292. package/dist/drop-overlay.js.map +1 -1
  293. package/dist/dropdown-menu.d.ts +8 -8
  294. package/dist/dropdown-menu.js +2 -2
  295. package/dist/embed-facade.js +1 -1
  296. package/dist/empty-state.d.ts +1 -1
  297. package/dist/empty-state.js.map +1 -1
  298. package/dist/engine-flow.d.ts +1 -1
  299. package/dist/engine-flow.js +1 -1
  300. package/dist/engine-flow.js.map +1 -1
  301. package/dist/entity-header.d.ts +1 -1
  302. package/dist/entity-header.js +1 -1
  303. package/dist/entity-header.js.map +1 -1
  304. package/dist/environment-notice.d.ts +1 -1
  305. package/dist/environment-notice.js.map +1 -1
  306. package/dist/error-page.d.ts +1 -1
  307. package/dist/error-page.js +1 -1
  308. package/dist/error-page.js.map +1 -1
  309. package/dist/field.d.ts +3 -3
  310. package/dist/field.js +1 -1
  311. package/dist/field.js.map +1 -1
  312. package/dist/file-upload.d.ts +1 -1
  313. package/dist/file-upload.js +1 -1
  314. package/dist/file-upload.js.map +1 -1
  315. package/dist/filter-bar.d.ts +2 -2
  316. package/dist/filter-bar.js +4 -4
  317. package/dist/flock.d.ts +1 -1
  318. package/dist/flock.js +2 -2
  319. package/dist/flock.js.map +1 -1
  320. package/dist/footnote.d.ts +3 -3
  321. package/dist/footnote.js +1 -1
  322. package/dist/footnote.js.map +1 -1
  323. package/dist/force-update-screen.d.ts +1 -1
  324. package/dist/force-update-screen.js +3 -3
  325. package/dist/force-update-screen.js.map +1 -1
  326. package/dist/form/server.js.map +1 -1
  327. package/dist/form.d.ts +12 -12
  328. package/dist/form.js +4 -4
  329. package/dist/form.js.map +1 -1
  330. package/dist/{frame-CmDztC_y.d.ts → frame-D5HU_cG8.d.ts} +2 -2
  331. package/dist/gallery-page.d.ts +1 -1
  332. package/dist/gallery-page.js +1 -1
  333. package/dist/gallery-page.js.map +1 -1
  334. package/dist/genui.d.ts +2 -2
  335. package/dist/genui.js +9 -9
  336. package/dist/genui.js.map +1 -1
  337. package/dist/glossary-term.js +2 -2
  338. package/dist/glow-card.d.ts +1 -1
  339. package/dist/glow-card.js +1 -1
  340. package/dist/glow-card.js.map +1 -1
  341. package/dist/goal-gauge.d.ts +1 -1
  342. package/dist/goal-gauge.js +1 -1
  343. package/dist/goal-gauge.js.map +1 -1
  344. package/dist/grade-stamp.d.ts +1 -1
  345. package/dist/grade-stamp.js +2 -2
  346. package/dist/grade-stamp.js.map +1 -1
  347. package/dist/identity-card.d.ts +1 -1
  348. package/dist/identity-card.js +5 -5
  349. package/dist/identity-card.js.map +1 -1
  350. package/dist/image-cropper.d.ts +1 -1
  351. package/dist/image-cropper.js +3 -3
  352. package/dist/image-cropper.js.map +1 -1
  353. package/dist/index.d.ts +5 -5
  354. package/dist/index.js +2 -2
  355. package/dist/index.js.map +1 -1
  356. package/dist/kanban.d.ts +1 -1
  357. package/dist/kanban.js.map +1 -1
  358. package/dist/kbd.d.ts +1 -1
  359. package/dist/kbd.js.map +1 -1
  360. package/dist/kind-config-editor.js +8 -8
  361. package/dist/kind-config-editor.js.map +1 -1
  362. package/dist/kpi-explained.js +1 -1
  363. package/dist/kpi-explained.js.map +1 -1
  364. package/dist/landing-page.d.ts +1 -1
  365. package/dist/landing-page.js.map +1 -1
  366. package/dist/landscape.d.ts +1 -1
  367. package/dist/landscape.js +2 -2
  368. package/dist/landscape.js.map +1 -1
  369. package/dist/language-switch.d.ts +1 -1
  370. package/dist/language-switch.js +1 -1
  371. package/dist/legal-page.d.ts +1 -1
  372. package/dist/legal-page.js.map +1 -1
  373. package/dist/{lightbox-MRB2YZEP.js → lightbox-JLWASIJC.js} +4 -4
  374. package/dist/link-card.d.ts +1 -1
  375. package/dist/link-card.js +4 -4
  376. package/dist/list.d.ts +1 -1
  377. package/dist/list.js +2 -2
  378. package/dist/list.js.map +1 -1
  379. package/dist/loader.d.ts +2 -2
  380. package/dist/loader.js +1 -1
  381. package/dist/loader.js.map +1 -1
  382. package/dist/longform-page.d.ts +1 -1
  383. package/dist/longform-page.js +1 -1
  384. package/dist/longform-page.js.map +1 -1
  385. package/dist/maintenance-screen.d.ts +1 -1
  386. package/dist/maintenance-screen.js +3 -3
  387. package/dist/maintenance-screen.js.map +1 -1
  388. package/dist/map/cards.d.ts +2 -2
  389. package/dist/map/cards.js +1 -1
  390. package/dist/map/cards.js.map +1 -1
  391. package/dist/map/pin.js +1 -1
  392. package/dist/map/sheet.d.ts +1 -1
  393. package/dist/map/sheet.js +1 -1
  394. package/dist/map/sheet.js.map +1 -1
  395. package/dist/map.d.ts +5 -5
  396. package/dist/map.js +4 -4
  397. package/dist/map.js.map +1 -1
  398. package/dist/margin-layout.d.ts +2 -2
  399. package/dist/margin-layout.js.map +1 -1
  400. package/dist/markdown.d.ts +1 -1
  401. package/dist/markdown.js.map +1 -1
  402. package/dist/marketing-layout.d.ts +1 -1
  403. package/dist/marketing-layout.js.map +1 -1
  404. package/dist/mascot-quote.d.ts +1 -1
  405. package/dist/mascot-quote.js +2 -2
  406. package/dist/mascot-quote.js.map +1 -1
  407. package/dist/mascot-state.d.ts +5 -5
  408. package/dist/mascot-state.js +1 -1
  409. package/dist/mascot-state.js.map +1 -1
  410. package/dist/mascots.d.ts +2 -2
  411. package/dist/mascots.js +2 -2
  412. package/dist/mascots.js.map +1 -1
  413. package/dist/match-dialog.d.ts +1 -1
  414. package/dist/match-dialog.js +4 -4
  415. package/dist/match-dialog.js.map +1 -1
  416. package/dist/media-capture.d.ts +1 -1
  417. package/dist/media-capture.js +1 -1
  418. package/dist/media-capture.js.map +1 -1
  419. package/dist/media-carousel.js +5 -5
  420. package/dist/media-carousel.js.map +1 -1
  421. package/dist/media-gallery.d.ts +1 -1
  422. package/dist/media-gallery.js +1 -1
  423. package/dist/media-gallery.js.map +1 -1
  424. package/dist/media-player.d.ts +1 -1
  425. package/dist/media-player.js +4 -4
  426. package/dist/meter.d.ts +2 -2
  427. package/dist/meter.js +1 -1
  428. package/dist/money-input.d.ts +1 -1
  429. package/dist/money-input.js +3 -3
  430. package/dist/motion.d.ts +1 -1
  431. package/dist/motion.js +1 -1
  432. package/dist/native/form.d.ts +12 -12
  433. package/dist/native/form.js +4 -4
  434. package/dist/native/form.js.map +1 -1
  435. package/dist/native/list.d.ts +1 -1
  436. package/dist/native/list.js.map +1 -1
  437. package/dist/native/map.d.ts +4 -4
  438. package/dist/native/map.js +2 -2
  439. package/dist/native/map.js.map +1 -1
  440. package/dist/native/markdown.js.map +1 -1
  441. package/dist/native/media-capture.d.ts +1 -1
  442. package/dist/native/media-capture.js.map +1 -1
  443. package/dist/native/media-picker.d.ts +1 -1
  444. package/dist/native/media-picker.js.map +1 -1
  445. package/dist/native/vertical-video.d.ts +2 -2
  446. package/dist/native/vertical-video.js.map +1 -1
  447. package/dist/native/video-player.d.ts +1 -1
  448. package/dist/native/video-player.js.map +1 -1
  449. package/dist/native.d.ts +95 -95
  450. package/dist/native.js +13 -13
  451. package/dist/native.js.map +1 -1
  452. package/dist/nav-bar.d.ts +13 -13
  453. package/dist/nav-bar.js +5 -5
  454. package/dist/nav-bar.js.map +1 -1
  455. package/dist/notification-preferences.js +3 -3
  456. package/dist/number-ticker.d.ts +1 -1
  457. package/dist/number-ticker.js +1 -1
  458. package/dist/number-ticker.js.map +1 -1
  459. package/dist/opening-hours.d.ts +1 -1
  460. package/dist/opening-hours.js +1 -1
  461. package/dist/opening-hours.js.map +1 -1
  462. package/dist/{page-DPHDmDAQ.d.ts → page-Ufnb5TrQ.d.ts} +5 -5
  463. package/dist/page-header.d.ts +1 -1
  464. package/dist/page-header.js.map +1 -1
  465. package/dist/page-hero.d.ts +1 -1
  466. package/dist/page-hero.js +5 -5
  467. package/dist/page-hero.js.map +1 -1
  468. package/dist/page-index.d.ts +1 -1
  469. package/dist/page-index.js +2 -2
  470. package/dist/page-index.js.map +1 -1
  471. package/dist/page.d.ts +1 -1
  472. package/dist/page.js +3 -3
  473. package/dist/pagination.d.ts +1 -1
  474. package/dist/pagination.js +1 -1
  475. package/dist/pagination.js.map +1 -1
  476. package/dist/pausable-loop.js +2 -2
  477. package/dist/{player-lightbox-BYQ57OXT.js → player-lightbox-SJR3GB7U.js} +5 -5
  478. package/dist/player-lightbox-SJR3GB7U.js.map +1 -0
  479. package/dist/pointer-light.d.ts +1 -1
  480. package/dist/pointer-light.js.map +1 -1
  481. package/dist/popover.d.ts +1 -1
  482. package/dist/popover.js +1 -1
  483. package/dist/popover.js.map +1 -1
  484. package/dist/price-catalogue-editor.js +8 -8
  485. package/dist/price-catalogue-editor.js.map +1 -1
  486. package/dist/pricing-page.d.ts +1 -1
  487. package/dist/pricing-page.js +1 -1
  488. package/dist/pricing-page.js.map +1 -1
  489. package/dist/product-page.d.ts +1 -1
  490. package/dist/product-page.js +1 -1
  491. package/dist/product-page.js.map +1 -1
  492. package/dist/profile-card.d.ts +3 -3
  493. package/dist/profile-card.js +1 -1
  494. package/dist/profile-card.js.map +1 -1
  495. package/dist/progress.d.ts +1 -1
  496. package/dist/progress.js.map +1 -1
  497. package/dist/promise-card.d.ts +1 -1
  498. package/dist/promise-card.js +1 -1
  499. package/dist/promise-card.js.map +1 -1
  500. package/dist/promo-code-field.js +4 -4
  501. package/dist/proposal.js +5 -5
  502. package/dist/qr-code.js +6 -6
  503. package/dist/qr-code.js.map +1 -1
  504. package/dist/quota-meter.d.ts +1 -1
  505. package/dist/quota-meter.js +1 -1
  506. package/dist/quota-meter.js.map +1 -1
  507. package/dist/radio-group.d.ts +5 -5
  508. package/dist/radio-group.js +3 -3
  509. package/dist/radio-group.js.map +1 -1
  510. package/dist/rail-nav.d.ts +4 -4
  511. package/dist/rail-nav.js +3 -3
  512. package/dist/rail-nav.js.map +1 -1
  513. package/dist/recipes.js +1 -1
  514. package/dist/recipes.js.map +1 -1
  515. package/dist/retro-tv-playlist.d.ts +1 -1
  516. package/dist/retro-tv-playlist.js.map +1 -1
  517. package/dist/retro-tv.js +6 -6
  518. package/dist/retro-tv.js.map +1 -1
  519. package/dist/reviews.js +3 -3
  520. package/dist/schema-form.js +7 -7
  521. package/dist/schema-form.js.map +1 -1
  522. package/dist/scroll-stage.d.ts +2 -2
  523. package/dist/scroll-stage.js +2 -2
  524. package/dist/scroll-stage.js.map +1 -1
  525. package/dist/search-field.d.ts +1 -1
  526. package/dist/search-field.js +2 -2
  527. package/dist/section-backdrop.d.ts +1 -1
  528. package/dist/section-backdrop.js +1 -1
  529. package/dist/separator.d.ts +1 -1
  530. package/dist/separator.js.map +1 -1
  531. package/dist/service-card.d.ts +1 -1
  532. package/dist/service-card.js +6 -6
  533. package/dist/service-card.js.map +1 -1
  534. package/dist/settings-layout.d.ts +3 -3
  535. package/dist/settings-layout.js +2 -2
  536. package/dist/shop/booking.d.ts +1 -1
  537. package/dist/shop/booking.js +4 -4
  538. package/dist/shop/booking.js.map +1 -1
  539. package/dist/shop/bulletin.d.ts +1 -1
  540. package/dist/shop/bulletin.js +2 -2
  541. package/dist/shop/bulletin.js.map +1 -1
  542. package/dist/shop/faq.d.ts +1 -1
  543. package/dist/shop/faq.js +3 -3
  544. package/dist/shop/faq.js.map +1 -1
  545. package/dist/shop/gallery.d.ts +1 -1
  546. package/dist/shop/gallery.js +3 -3
  547. package/dist/shop/gallery.js.map +1 -1
  548. package/dist/shop/hero.d.ts +1 -1
  549. package/dist/shop/hero.js +2 -2
  550. package/dist/shop/hero.js.map +1 -1
  551. package/dist/shop/policies.d.ts +1 -1
  552. package/dist/shop/policies.js +2 -2
  553. package/dist/shop/policies.js.map +1 -1
  554. package/dist/shop/reviews.d.ts +1 -1
  555. package/dist/shop/reviews.js +2 -2
  556. package/dist/shop/reviews.js.map +1 -1
  557. package/dist/shop/services.d.ts +1 -1
  558. package/dist/shop/services.js +4 -4
  559. package/dist/shop/services.js.map +1 -1
  560. package/dist/shop/social.d.ts +1 -1
  561. package/dist/shop/social.js +2 -2
  562. package/dist/shop/social.js.map +1 -1
  563. package/dist/shop/story.d.ts +1 -1
  564. package/dist/shop/story.js +2 -2
  565. package/dist/shop/story.js.map +1 -1
  566. package/dist/shop/team.d.ts +1 -1
  567. package/dist/shop/team.js +2 -2
  568. package/dist/shop/team.js.map +1 -1
  569. package/dist/shop/video.d.ts +1 -1
  570. package/dist/shop/video.js +2 -2
  571. package/dist/shop/video.js.map +1 -1
  572. package/dist/shop/visit.d.ts +1 -1
  573. package/dist/shop/visit.js +2 -2
  574. package/dist/shop/visit.js.map +1 -1
  575. package/dist/shop-composer.js +2 -2
  576. package/dist/shop-composer.js.map +1 -1
  577. package/dist/shop-gallery.d.ts +1 -1
  578. package/dist/shop-gallery.js +2 -2
  579. package/dist/shop-gallery.js.map +1 -1
  580. package/dist/shop.d.ts +1 -1
  581. package/dist/shop.js +2 -2
  582. package/dist/showcase.d.ts +1 -1
  583. package/dist/showcase.js +6 -6
  584. package/dist/showcase.js.map +1 -1
  585. package/dist/signature.d.ts +1 -1
  586. package/dist/signature.js +2 -2
  587. package/dist/signature.js.map +1 -1
  588. package/dist/site-cahier.d.ts +3 -3
  589. package/dist/site-cahier.js +10 -10
  590. package/dist/site-cahier.js.map +1 -1
  591. package/dist/site-footer.d.ts +4 -4
  592. package/dist/site-footer.js +1 -1
  593. package/dist/site-footer.js.map +1 -1
  594. package/dist/skeleton.d.ts +3 -3
  595. package/dist/skeleton.js.map +1 -1
  596. package/dist/skip-link.d.ts +1 -1
  597. package/dist/skip-link.js +1 -1
  598. package/dist/slider.d.ts +1 -1
  599. package/dist/slider.js +2 -2
  600. package/dist/slider.js.map +1 -1
  601. package/dist/slot-picker.d.ts +1 -1
  602. package/dist/slot-picker.js +1 -1
  603. package/dist/slot-picker.js.map +1 -1
  604. package/dist/specimen-tag.d.ts +2 -2
  605. package/dist/specimen-tag.js +2 -2
  606. package/dist/speed-lines.d.ts +1 -1
  607. package/dist/speed-lines.js +1 -1
  608. package/dist/speed-lines.js.map +1 -1
  609. package/dist/spinner.d.ts +2 -2
  610. package/dist/spinner.js +1 -1
  611. package/dist/spinner.js.map +1 -1
  612. package/dist/split-view.d.ts +1 -1
  613. package/dist/split-view.js.map +1 -1
  614. package/dist/stage-banner.d.ts +1 -1
  615. package/dist/stage-banner.js +1 -1
  616. package/dist/stage-banner.js.map +1 -1
  617. package/dist/stat.d.ts +2 -2
  618. package/dist/stat.js +1 -1
  619. package/dist/status-chip.js +4 -4
  620. package/dist/status-chip.js.map +1 -1
  621. package/dist/status-page.d.ts +1 -1
  622. package/dist/status-page.js.map +1 -1
  623. package/dist/step-progress.d.ts +1 -1
  624. package/dist/step-progress.js.map +1 -1
  625. package/dist/step-showcase.d.ts +2 -2
  626. package/dist/step-showcase.js +3 -3
  627. package/dist/step-showcase.js.map +1 -1
  628. package/dist/stepper.d.ts +1 -1
  629. package/dist/stepper.js +1 -1
  630. package/dist/stepper.js.map +1 -1
  631. package/dist/sticky-action.d.ts +1 -1
  632. package/dist/sticky-action.js.map +1 -1
  633. package/dist/stuck.d.ts +1 -1
  634. package/dist/stuck.js +1 -1
  635. package/dist/stuck.js.map +1 -1
  636. package/dist/swipe-deck.d.ts +2 -2
  637. package/dist/swipe-deck.js.map +1 -1
  638. package/dist/switch.d.ts +1 -1
  639. package/dist/switch.js +1 -1
  640. package/dist/tabs.d.ts +6 -6
  641. package/dist/tabs.js +1 -1
  642. package/dist/tabs.js.map +1 -1
  643. package/dist/tag-input.d.ts +1 -1
  644. package/dist/tag-input.js +4 -4
  645. package/dist/tag-input.js.map +1 -1
  646. package/dist/tag-selector.d.ts +1 -1
  647. package/dist/tag-selector.js +3 -3
  648. package/dist/tag-selector.js.map +1 -1
  649. package/dist/taped-photo.d.ts +1 -1
  650. package/dist/taped-photo.js +2 -2
  651. package/dist/terminal-replay.d.ts +1 -1
  652. package/dist/terminal-replay.js +3 -3
  653. package/dist/terminal-replay.js.map +1 -1
  654. package/dist/text-style/server.d.ts +1 -1
  655. package/dist/text-style/server.js.map +1 -1
  656. package/dist/text-style.d.ts +2 -2
  657. package/dist/text-style.js.map +1 -1
  658. package/dist/theme.d.ts +3 -3
  659. package/dist/theme.js +3 -3
  660. package/dist/theme.js.map +1 -1
  661. package/dist/toast.d.ts +1 -1
  662. package/dist/toast.js +2 -2
  663. package/dist/toast.js.map +1 -1
  664. package/dist/toc.d.ts +2 -2
  665. package/dist/toc.js +1 -1
  666. package/dist/toc.js.map +1 -1
  667. package/dist/tooltip.d.ts +1 -1
  668. package/dist/tooltip.js +2 -2
  669. package/dist/tree-view.d.ts +1 -1
  670. package/dist/tree-view.js +2 -2
  671. package/dist/tree-view.js.map +1 -1
  672. package/dist/update-prompt.d.ts +1 -1
  673. package/dist/update-prompt.js +3 -3
  674. package/dist/update-prompt.js.map +1 -1
  675. package/dist/upload-queue.d.ts +2 -2
  676. package/dist/upload-queue.js +1 -1
  677. package/dist/upload-queue.js.map +1 -1
  678. package/dist/usage.d.ts +4 -4
  679. package/dist/usage.js +3 -3
  680. package/dist/usage.js.map +1 -1
  681. package/dist/verified-badge.d.ts +1 -1
  682. package/dist/verified-badge.js.map +1 -1
  683. package/dist/versus-card.d.ts +1 -1
  684. package/dist/versus-card.js +2 -2
  685. package/dist/versus-card.js.map +1 -1
  686. package/dist/vertical-video.d.ts +2 -2
  687. package/dist/vertical-video.js +6 -6
  688. package/dist/vertical-video.js.map +1 -1
  689. package/dist/video-player.d.ts +1 -1
  690. package/dist/video-player.js +5 -5
  691. package/dist/video-trimmer.d.ts +1 -1
  692. package/dist/video-trimmer.js.map +1 -1
  693. package/dist/virtual.d.ts +2 -2
  694. package/dist/virtual.js +1 -1
  695. package/dist/wall.js +2 -2
  696. package/dist/wall.js.map +1 -1
  697. package/dist/waveform.d.ts +1 -1
  698. package/dist/waveform.js.map +1 -1
  699. package/package.json +26 -7
  700. package/registry/account-menu.json +1 -1
  701. package/registry/account-settings.json +18 -18
  702. package/registry/achievement.json +2 -2
  703. package/registry/action-bar.json +4 -4
  704. package/registry/activity-feed.json +3 -3
  705. package/registry/agenda.json +1 -1
  706. package/registry/alert.json +2 -2
  707. package/registry/analysis-report.json +2 -2
  708. package/registry/anatomy-plate.json +2 -2
  709. package/registry/app-frame.json +7 -7
  710. package/registry/app-header.json +5 -5
  711. package/registry/app-shell.json +3 -3
  712. package/registry/architecture-diagram.json +239 -0
  713. package/registry/argument-card.json +4 -4
  714. package/registry/auth-layout.json +2 -2
  715. package/registry/avatar.json +4 -4
  716. package/registry/badge.json +2 -2
  717. package/registry/bird-plate.json +2 -2
  718. package/registry/button.json +2 -2
  719. package/registry/captcha.json +2 -2
  720. package/registry/card-grid.json +2 -2
  721. package/registry/card.json +2 -2
  722. package/registry/catalogue-page.json +2 -2
  723. package/registry/changelog-page.json +3 -3
  724. package/registry/chapter.json +3 -3
  725. package/registry/chat.json +2 -2
  726. package/registry/checkbox.json +2 -2
  727. package/registry/chip-link.json +2 -2
  728. package/registry/chip-row.json +2 -2
  729. package/registry/chip.json +3 -3
  730. package/registry/choice-grid.json +3 -3
  731. package/registry/cn.json +1 -1
  732. package/registry/code-block.json +3 -3
  733. package/registry/collection-switcher.json +3 -3
  734. package/registry/columns.json +2 -2
  735. package/registry/combobox.json +3 -3
  736. package/registry/command.json +2 -2
  737. package/registry/comparison-table.json +2 -2
  738. package/registry/component-page.json +2 -2
  739. package/registry/confirm-button.json +2 -2
  740. package/registry/contact-page.json +2 -2
  741. package/registry/continue-prompt.json +2 -2
  742. package/registry/copy-button.json +3 -3
  743. package/registry/countdown.json +2 -2
  744. package/registry/cover-hero.json +4 -4
  745. package/registry/cta-panel.json +2 -2
  746. package/registry/dashboard-layout.json +3 -3
  747. package/registry/data-table.json +5 -5
  748. package/registry/date-picker.json +9 -9
  749. package/registry/decision-list.json +3 -3
  750. package/registry/description-list.json +2 -2
  751. package/registry/desktop-window.json +1 -1
  752. package/registry/detail-layout.json +2 -2
  753. package/registry/dialog.json +3 -3
  754. package/registry/docs-article-page.json +2 -2
  755. package/registry/docs-hub-page.json +2 -2
  756. package/registry/docs-layout.json +3 -3
  757. package/registry/docs-nav.json +2 -2
  758. package/registry/document-viewer.json +3 -3
  759. package/registry/doodle.json +2 -2
  760. package/registry/drop-overlay.json +2 -2
  761. package/registry/dropdown-menu.json +2 -2
  762. package/registry/elephant.json +1 -1
  763. package/registry/embed-facade.json +1 -1
  764. package/registry/empty-state.json +2 -2
  765. package/registry/engine-flow.json +2 -2
  766. package/registry/entity-header.json +3 -3
  767. package/registry/environment-notice.json +2 -2
  768. package/registry/error-page.json +2 -2
  769. package/registry/examples/architecture-diagram/containers.d.ts +4 -0
  770. package/registry/examples/architecture-diagram/containers.js +28 -0
  771. package/registry/examples/architecture-diagram/containers.tsx +24 -0
  772. package/registry/examples/architecture-diagram/context.d.ts +4 -0
  773. package/registry/examples/architecture-diagram/context.js +26 -0
  774. package/registry/examples/architecture-diagram/context.tsx +22 -0
  775. package/registry/examples/architecture-diagram/dynamic.d.ts +4 -0
  776. package/registry/examples/architecture-diagram/dynamic.js +27 -0
  777. package/registry/examples/architecture-diagram/dynamic.tsx +23 -0
  778. package/registry/field.json +2 -2
  779. package/registry/file-upload.json +3 -3
  780. package/registry/filter-bar.json +5 -5
  781. package/registry/flock.json +2 -2
  782. package/registry/footnote.json +2 -2
  783. package/registry/force-update-screen.json +2 -2
  784. package/registry/form.json +65 -65
  785. package/registry/gallery-page.json +2 -2
  786. package/registry/genui.json +3 -3
  787. package/registry/glossary-term.json +1 -1
  788. package/registry/glossary.json +1 -1
  789. package/registry/glow-card.json +2 -2
  790. package/registry/goal-gauge.json +2 -2
  791. package/registry/grade-stamp.json +2 -2
  792. package/registry/identity-card.json +2 -2
  793. package/registry/image-cropper.json +2 -2
  794. package/registry/index.json +37 -8
  795. package/registry/kanban.json +2 -2
  796. package/registry/kbd.json +2 -2
  797. package/registry/kind-config-editor.json +3 -3
  798. package/registry/kpi-explained.json +2 -2
  799. package/registry/landing-page.json +2 -2
  800. package/registry/landscape.json +2 -2
  801. package/registry/language-switch.json +2 -2
  802. package/registry/legal-page.json +2 -2
  803. package/registry/link-card.json +4 -4
  804. package/registry/list.json +3 -3
  805. package/registry/loader.json +2 -2
  806. package/registry/longform-page.json +2 -2
  807. package/registry/maintenance-screen.json +2 -2
  808. package/registry/map.json +8 -8
  809. package/registry/margin-layout.json +2 -2
  810. package/registry/markdown.json +2 -2
  811. package/registry/marketing-layout.json +2 -2
  812. package/registry/mascot-quote.json +2 -2
  813. package/registry/mascot-state.json +3 -3
  814. package/registry/mascots.json +4 -4
  815. package/registry/match-dialog.json +2 -2
  816. package/registry/media-capture.json +3 -3
  817. package/registry/media-gallery.json +5 -5
  818. package/registry/meter.json +2 -2
  819. package/registry/money-input.json +2 -2
  820. package/registry/nav-bar.json +9 -9
  821. package/registry/next-actions.json +1 -1
  822. package/registry/notification-preferences.json +1 -1
  823. package/registry/number-ticker.json +2 -2
  824. package/registry/opening-hours.json +3 -3
  825. package/registry/page-header.json +2 -2
  826. package/registry/page-hero.json +4 -4
  827. package/registry/page-index.json +3 -3
  828. package/registry/page.json +2 -2
  829. package/registry/pagination.json +3 -3
  830. package/registry/pointer-light.json +2 -2
  831. package/registry/popover.json +2 -2
  832. package/registry/price-catalogue-editor.json +2 -2
  833. package/registry/pricing-page.json +3 -3
  834. package/registry/product-page.json +2 -2
  835. package/registry/profile-card.json +4 -4
  836. package/registry/progress.json +2 -2
  837. package/registry/promise-card.json +2 -2
  838. package/registry/promo-code-field.json +1 -1
  839. package/registry/proposal.json +1 -1
  840. package/registry/qr-code.json +3 -3
  841. package/registry/quota-meter.json +2 -2
  842. package/registry/radio-group.json +15 -15
  843. package/registry/rail-nav.json +9 -9
  844. package/registry/recipes.json +2 -2
  845. package/registry/retro-tv.json +4 -4
  846. package/registry/reviews.json +1 -1
  847. package/registry/router.json +1 -1
  848. package/registry/schema-form.json +2 -2
  849. package/registry/scroll-stage.json +2 -2
  850. package/registry/search-field.json +3 -3
  851. package/registry/section-backdrop.json +2 -2
  852. package/registry/separator.json +2 -2
  853. package/registry/service-card.json +4 -4
  854. package/registry/settings-layout.json +2 -2
  855. package/registry/shop-composer.json +4 -4
  856. package/registry/shop-gallery.json +2 -2
  857. package/registry/shop.json +18 -18
  858. package/registry/showcase.json +2 -2
  859. package/registry/signature.json +2 -2
  860. package/registry/site-cahier.json +3 -3
  861. package/registry/site-footer.json +11 -11
  862. package/registry/sites.json +1 -1
  863. package/registry/skeleton.json +2 -2
  864. package/registry/skip-link.json +2 -2
  865. package/registry/slider.json +2 -2
  866. package/registry/slot-picker.json +3 -3
  867. package/registry/slot.json +1 -1
  868. package/registry/specimen-tag.json +2 -2
  869. package/registry/speed-lines.json +2 -2
  870. package/registry/spinner.json +3 -3
  871. package/registry/split-view.json +2 -2
  872. package/registry/stage-banner.json +2 -2
  873. package/registry/stat.json +2 -2
  874. package/registry/status-chip.json +3 -3
  875. package/registry/status-page.json +2 -2
  876. package/registry/step-progress.json +2 -2
  877. package/registry/step-showcase.json +3 -3
  878. package/registry/stepper.json +2 -2
  879. package/registry/sticky-action.json +2 -2
  880. package/registry/stuck.json +2 -2
  881. package/registry/swipe-deck.json +2 -2
  882. package/registry/switch.json +2 -2
  883. package/registry/tabs.json +2 -2
  884. package/registry/tag-input.json +2 -2
  885. package/registry/tag-selector.json +2 -2
  886. package/registry/taped-photo.json +2 -2
  887. package/registry/terminal-replay.json +3 -3
  888. package/registry/text-style.json +9 -9
  889. package/registry/theme.json +2 -2
  890. package/registry/toast.json +2 -2
  891. package/registry/toc.json +2 -2
  892. package/registry/tooltip.json +2 -2
  893. package/registry/tree-view.json +3 -3
  894. package/registry/update-prompt.json +2 -2
  895. package/registry/upload-queue.json +2 -2
  896. package/registry/usage.json +3 -3
  897. package/registry/verified-badge.json +2 -2
  898. package/registry/versus-card.json +2 -2
  899. package/registry/vertical-video.json +3 -3
  900. package/registry/video-player.json +3 -3
  901. package/registry/video-trimmer.json +2 -2
  902. package/registry/virtual.json +4 -4
  903. package/registry/wall.json +2 -2
  904. package/registry/waveform.json +2 -2
  905. package/dist/chunk-2FCQCWIK.js.map +0 -1
  906. package/dist/chunk-43PTCDTL.js.map +0 -1
  907. package/dist/chunk-5D7NMUF6.js.map +0 -1
  908. package/dist/chunk-5PFCELGW.js.map +0 -1
  909. package/dist/chunk-5RWHDX5J.js.map +0 -1
  910. package/dist/chunk-5VZ37TY3.js.map +0 -1
  911. package/dist/chunk-757ZTGU5.js.map +0 -1
  912. package/dist/chunk-7DYZTEE3.js.map +0 -1
  913. package/dist/chunk-7P7I5OQV.js.map +0 -1
  914. package/dist/chunk-B47WSPMP.js.map +0 -1
  915. package/dist/chunk-C57KK5VB.js.map +0 -1
  916. package/dist/chunk-EB45EVPJ.js.map +0 -1
  917. package/dist/chunk-EDQLPCM4.js.map +0 -1
  918. package/dist/chunk-GHAN7OOE.js.map +0 -1
  919. package/dist/chunk-HLEBSAGC.js.map +0 -1
  920. package/dist/chunk-HP7BDMVK.js.map +0 -1
  921. package/dist/chunk-KH3JOEPY.js.map +0 -1
  922. package/dist/chunk-KR2W4ONJ.js.map +0 -1
  923. package/dist/chunk-LH5J3VLZ.js.map +0 -1
  924. package/dist/chunk-LNAAWT4Y.js.map +0 -1
  925. package/dist/chunk-MDSP7DJR.js.map +0 -1
  926. package/dist/chunk-NG6G6V5E.js.map +0 -1
  927. package/dist/chunk-NM2DEHFZ.js.map +0 -1
  928. package/dist/chunk-NPMGYLJV.js.map +0 -1
  929. package/dist/chunk-NQENOT6L.js.map +0 -1
  930. package/dist/chunk-NSLXEDIS.js.map +0 -1
  931. package/dist/chunk-OGWB76BR.js.map +0 -1
  932. package/dist/chunk-P7AFIKWG.js.map +0 -1
  933. package/dist/chunk-PGBF3UBX.js.map +0 -1
  934. package/dist/chunk-QA3WETWT.js.map +0 -1
  935. package/dist/chunk-QD6SNXF5.js.map +0 -1
  936. package/dist/chunk-QHVV2JGF.js.map +0 -1
  937. package/dist/chunk-QVHSV6RA.js.map +0 -1
  938. package/dist/chunk-S2O4NSN5.js.map +0 -1
  939. package/dist/chunk-S4TLZRGZ.js.map +0 -1
  940. package/dist/chunk-S6NYGOJT.js.map +0 -1
  941. package/dist/chunk-SB5WSVPI.js.map +0 -1
  942. package/dist/chunk-SG2RKUVJ.js.map +0 -1
  943. package/dist/chunk-V5RO6JYI.js.map +0 -1
  944. package/dist/chunk-V7W4RLRW.js.map +0 -1
  945. package/dist/chunk-VA4NPCUQ.js.map +0 -1
  946. package/dist/chunk-VPO27AFS.js.map +0 -1
  947. package/dist/chunk-W64RAX4N.js.map +0 -1
  948. package/dist/chunk-W675RFOA.js.map +0 -1
  949. package/dist/chunk-WC3SO4CE.js.map +0 -1
  950. package/dist/chunk-WEVYKZIF.js.map +0 -1
  951. package/dist/chunk-WU4VLSEA.js.map +0 -1
  952. package/dist/chunk-Y3P5B4XS.js.map +0 -1
  953. package/dist/chunk-YTYNKMNS.js.map +0 -1
  954. package/dist/chunk-Z47KIPCT.js.map +0 -1
  955. package/dist/chunk-ZPOVOEO3.js.map +0 -1
  956. package/dist/player-lightbox-BYQ57OXT.js.map +0 -1
  957. /package/dist/{chunk-HJFRHYCI.js.map → chunk-DTGRZXYO.js.map} +0 -0
  958. /package/dist/{chunk-PJNR4NTS.js.map → chunk-HC2TY45B.js.map} +0 -0
  959. /package/dist/{lightbox-MRB2YZEP.js.map → lightbox-JLWASIJC.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/document-viewer/document-viewer.tsx","../src/document-viewer/locate.ts"],"sourcesContent":["// Client. A PDF drawn page by page (pdf.js), and passages of it lit where they sit. The app hands over the engine\n// (`loadPdfjs={() => import(\"pdfjs-dist\")}` — an optional peer, loaded only on a page that shows a document) and the\n// worker's address; it hands over the passages as quotes (`highlights`), and the viewer finds their place from the\n// PDF's own text positions (`locateQuote`): one box per line, in fractions of the page, so they follow any zoom.\n// `activeId` (controlled) scrolls to a passage and strengthens it; a click on a box calls `onActiveChange`. A passage\n// the text layer cannot place is never drawn at a guessed place: the viewer goes to its page when it is known and shows\n// the quote in a bar — and tells the app (`onLocate`) so its list can say \"page 3\" or \"not found\".\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { useLatest, usePrefersReducedMotion } from \"../media\";\nimport { type Located, type PageText, type Region, resolveHighlight } from \"./locate\";\n\nexport const documentViewer = tv({\n slots: {\n root: \"relative flex min-w-0 flex-col gap-3\",\n pages: \"flex max-h-(--kz-document-viewer-height,70vh) flex-col gap-3 overflow-auto rounded-lg border border-border-default bg-surface-2 p-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent\",\n page: \"relative mx-auto w-full max-w-(--kz-document-viewer-page,56rem) shrink-0 overflow-hidden rounded-sm bg-white shadow-sm\",\n canvas: \"block h-auto w-full\",\n caption: \"absolute top-1 left-1 rounded-sm bg-surface-1/90 px-1.5 py-0.5 text-xs text-fg-secondary\",\n box: \"absolute cursor-pointer rounded-xs border border-warning/70 bg-warning/25 mix-blend-multiply transition-colors data-[active=true]:border-2 data-[active=true]:border-danger data-[active=true]:bg-danger/25 motion-reduce:transition-none\",\n bar: \"rounded-lg border border-border-default bg-surface-1 px-3 py-2 text-sm text-fg-secondary\",\n status: \"p-6 text-center text-sm text-fg-secondary\",\n },\n});\n\n/** The words of the viewer, passed translated. `{page}` and `{total}` are replaced. */\nexport type DocumentViewerLabels = {\n /** The accessible name of the pages' region. */\n region: string;\n loading: string;\n failed: string;\n /** A page's caption and accessible name: \"Page {page} of {total}\". */\n page: string;\n /** The bar above the pages when the active passage could only be placed on a page: \"Passage on page {page}:\". */\n onPage: string;\n /** The bar when the active passage is not in the text layer. */\n notFound: string;\n};\n\nexport const documentViewerLabels: DocumentViewerLabels = {\n region: \"Document pages\",\n loading: \"Loading the document…\",\n failed: \"The document could not be displayed.\",\n page: \"Page {page} of {total}\",\n onPage: \"Passage on page {page}:\",\n notFound: \"This passage is not in the document's text layer:\",\n};\n\n/** A passage to light: its quote (as the text layer reads it) and/or a `region` of a page the app already knows (a stamp, a\n mismatch — fractions of the page, origin top-left); the page if known, a name for screen readers. A valid region wins. */\nexport type DocumentHighlight = { id: string; quote?: string; region?: Region; page?: number; label?: string };\n\n/** What the viewer found for a passage. */\nexport type { Located };\n\n/** The members of pdf.js the viewer uses (`pdfjs-dist` ≥ 5), typed here so the package does not depend on it. */\nexport type PdfjsModule = {\n GlobalWorkerOptions: { workerSrc: string };\n getDocument(source: { url?: string; data?: Uint8Array }): { promise: Promise<PdfDocument>; destroy?: () => Promise<void> | void };\n};\nexport type PdfDocument = { numPages: number; getPage(n: number): Promise<PdfPage>; destroy?: () => Promise<void> | void };\nexport type PdfPage = {\n rotate: number;\n view: number[];\n getViewport(options: { scale: number }): { width: number; height: number };\n getTextContent(): Promise<{ items: readonly unknown[] }>;\n render(options: { canvas: HTMLCanvasElement; canvasContext: CanvasRenderingContext2D; viewport: { width: number; height: number } }): { promise: Promise<void>; cancel?: () => void };\n cleanup?: () => void;\n};\n\nexport type DocumentViewerProps = Omit<React.ComponentProps<\"div\">, \"children\" | \"onChange\"> & {\n /** The PDF: an address (same origin or CORS) or its bytes. */\n src: string | Uint8Array;\n /** Loads pdf.js: `() => import(\"pdfjs-dist\")`. An optional peer, never in a bundle without a document. */\n loadPdfjs: () => Promise<PdfjsModule>;\n /** The address of pdf.js's worker (`new URL(\"pdfjs-dist/build/pdf.worker.min.mjs\", import.meta.url).toString()`). */\n workerSrc: string;\n /** The passages to light. */\n highlights?: readonly DocumentHighlight[];\n /** The passage in focus: the viewer scrolls to it. */\n activeId?: string | null;\n /** A box was clicked (the id) or the focus was released (`null`). */\n onActiveChange?: (id: string | null) => void;\n /** Where each passage was found (`null`: nowhere) — once the text layer is read, and again if `highlights` change. */\n onLocate?: (found: Record<string, Located | null>) => void;\n /** Called when the document is open, with its page count. */\n onLoad?: (info: { pages: number }) => void;\n /** The words of the viewer, translated (English by default). */\n labels?: Partial<DocumentViewerLabels>;\n};\n\nconst regionKey = (r: Region | undefined) => (r ? [r.page, r.x, r.y, r.width, r.height].join(\",\") : \"\");\nconst fill = (template: string, vars: Record<string, string | number>) => template.replace(/\\{(\\w+)\\}/g, (m, k: string) => (k in vars ? String(vars[k]) : m));\n\ntype Loaded = { doc: PdfDocument; texts: PageText[]; sizes: { width: number; height: number }[] };\ntype Phase = { state: \"loading\" } | { state: \"error\"; key: string } | ({ state: \"ready\"; key: string } & Loaded);\n\nconst isItem = (x: unknown): x is PageText[\"items\"][number] => typeof x === \"object\" && x !== null && typeof (x as { str?: unknown }).str === \"string\" && Array.isArray((x as { transform?: unknown }).transform);\n\nfunction PageCanvas({ page, doc, caption, onReady, className }: { page: number; doc: PdfDocument; caption: string; onReady?: () => void; className: string }) {\n const ref = React.useRef<HTMLCanvasElement>(null);\n const wrapper = React.useRef<HTMLDivElement>(null);\n const [visible, setVisible] = React.useState(() => typeof IntersectionObserver === \"undefined\");\n const ready = useLatest(onReady);\n React.useEffect(() => {\n const node = wrapper.current?.parentElement;\n if (!node) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver((entries) => entries.some((e) => e.isIntersecting) && setVisible(true), { rootMargin: \"600px 0px\" });\n observer.observe(node);\n return () => observer.disconnect();\n }, []);\n React.useEffect(() => {\n if (!visible) return;\n let task: { promise: Promise<void>; cancel?: () => void } | undefined;\n let cancelled = false;\n void (async () => {\n const p = await doc.getPage(page);\n const canvas = ref.current;\n const ctx = canvas?.getContext(\"2d\");\n if (cancelled || !canvas || !ctx) return;\n const base = p.getViewport({ scale: 1 });\n const dpr = typeof window === \"undefined\" ? 1 : Math.min(2, window.devicePixelRatio || 1);\n const scale = Math.min(2.5, Math.max(1, (canvas.parentElement?.clientWidth || base.width) / base.width)) * dpr;\n const viewport = p.getViewport({ scale });\n canvas.width = Math.floor(viewport.width);\n canvas.height = Math.floor(viewport.height);\n task = p.render({ canvas, canvasContext: ctx, viewport });\n await task.promise.catch(() => undefined);\n if (!cancelled) ready.current?.();\n })().catch(() => undefined);\n return () => {\n cancelled = true;\n task?.cancel?.();\n };\n }, [visible, doc, page, ready]);\n return (\n <div ref={wrapper} className=\"contents\">\n <canvas ref={ref} aria-hidden=\"true\" className={className} />\n <span className=\"sr-only\">{caption}</span>\n </div>\n );\n}\n\n/** A PDF with its passages lit — see the file's header. Client. */\nexport function DocumentViewer({ src, loadPdfjs, workerSrc, highlights = [], activeId = null, onActiveChange, onLocate, onLoad, labels, className, ...props }: DocumentViewerProps) {\n const words = { ...documentViewerLabels, ...labels };\n const s = documentViewer();\n const reduce = usePrefersReducedMotion();\n const [loaded, setPhase] = React.useState<Phase>({ state: \"loading\" });\n const callbacks = useLatest({ onLoad, onLocate });\n const containerRef = React.useRef<HTMLDivElement>(null);\n const bytes = typeof src === \"string\" ? src : src.byteLength + \":\" + src[0] + \":\" + src[src.length - 1];\n // A result belongs to the document it was read from: another `src` is loading again, with no reset inside the effect.\n const phase: Phase = loaded.state !== \"loading\" && loaded.key !== bytes ? { state: \"loading\" } : loaded;\n\n // Open the document and read every page's text layer (positions only; nothing is sent anywhere).\n React.useEffect(() => {\n let cancelled = false;\n let opened: { destroy?: () => Promise<void> | void } | undefined;\n void (async () => {\n const pdfjs = await loadPdfjs();\n pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;\n const loading = pdfjs.getDocument(typeof src === \"string\" ? { url: src } : { data: src.slice() });\n opened = loading;\n const doc = await loading.promise;\n const texts: PageText[] = [];\n const sizes: Loaded[\"sizes\"] = [];\n for (let n = 1; n <= doc.numPages; n++) {\n const page = await doc.getPage(n);\n const vp = page.getViewport({ scale: 1 });\n sizes.push({ width: vp.width, height: vp.height });\n const content = await page.getTextContent();\n // A rotated page has no reliable boxes: it keeps its size and an empty text layer (the app's page hint still works).\n texts.push({ page: n, width: vp.width, height: vp.height, items: page.rotate % 360 === 0 ? content.items.filter(isItem) : [] });\n page.cleanup?.();\n }\n if (cancelled) return;\n setPhase({ state: \"ready\", key: bytes, doc, texts, sizes });\n callbacks.current.onLoad?.({ pages: doc.numPages });\n })().catch(() => !cancelled && setPhase({ state: \"error\", key: bytes }));\n return () => {\n cancelled = true;\n void opened?.destroy?.();\n };\n // `src` is compared by content (`bytes`) so a re-render with the same bytes does not reopen the file.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [bytes, loadPdfjs, workerSrc, callbacks]);\n\n const key = highlights.map((h) => `${h.id}\\u0000${h.page ?? \"\"}\\u0000${h.quote ?? \"\"}\\u0000${regionKey(h.region)}`).join(\"\\u0001\");\n const found = React.useMemo(() => {\n const out: Record<string, Located | null> = {};\n if (phase.state === \"ready\") for (const h of highlights) out[h.id] = resolveHighlight(phase.texts, h);\n return out;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [phase, key]);\n React.useEffect(() => {\n if (phase.state === \"ready\") callbacks.current.onLocate?.(found);\n }, [found, phase.state, callbacks]);\n\n // Go to the active passage.\n const active = activeId ? highlights.find((h) => h.id === activeId) : undefined;\n const where = activeId ? found[activeId] : undefined;\n React.useEffect(() => {\n if (phase.state !== \"ready\" || !where) return;\n const root = containerRef.current;\n const target = root?.querySelector<HTMLElement>(where.boxes.length > 0 ? `[data-highlight=\"${CSS.escape(activeId!)}\"]` : `[data-page=\"${where.page}\"]`) ?? null;\n target?.scrollIntoView?.({ block: where.boxes.length > 0 ? \"center\" : \"start\", behavior: reduce ? \"auto\" : \"smooth\" });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeId, where, phase.state]);\n\n return (\n <div className={s.root({ className })} {...props}>\n {active && where !== undefined && where?.match !== \"exact\" && where?.match !== \"start\" && where?.match !== \"region\" ? (\n <p className={s.bar()} data-testid=\"document-viewer-bar\">\n {where?.match === \"page\" ? fill(words.onPage, { page: where.page }) : words.notFound} {active.quote ? <q>{active.quote}</q> : null}\n </p>\n ) : null}\n <div ref={containerRef} className={s.pages()} role=\"region\" aria-label={words.region} tabIndex={0}>\n {phase.state === \"loading\" ? <p className={s.status()}>{words.loading}</p> : null}\n {phase.state === \"error\" ? <p role=\"alert\" className={s.status()}>{words.failed}</p> : null}\n {phase.state === \"ready\"\n ? phase.texts.map((t, i) => {\n const size = phase.sizes[i]!;\n const caption = fill(words.page, { page: t.page, total: phase.doc.numPages });\n return (\n <div key={t.page} className={s.page()} data-page={t.page} style={{ aspectRatio: `${size.width} / ${size.height}` }}>\n <PageCanvas page={t.page} doc={phase.doc} caption={caption} className={s.canvas()} />\n <span className={s.caption()} aria-hidden=\"true\">{caption}</span>\n {highlights.flatMap((h) => {\n const f = found[h.id];\n if (!f || f.page !== t.page) return [];\n return f.boxes.map((b, k) => (\n <div\n key={`${h.id}:${k}`}\n aria-hidden=\"true\"\n data-highlight={h.id}\n data-active={h.id === activeId}\n className={s.box()}\n style={{ left: `${b.x * 100}%`, top: `${b.y * 100}%`, width: `${b.width * 100}%`, height: `${b.height * 100}%` }}\n onClick={() => onActiveChange?.(h.id === activeId ? null : h.id)}\n />\n ));\n })}\n </div>\n );\n })\n : null}\n </div>\n </div>\n );\n}\n","// Pure: where a quoted passage sits on the pages of a PDF, from pdf.js's text positions. No DOM, no pdf.js import —\n// the viewer feeds it what `page.getTextContent()` returned, a test feeds it a fixture.\n\n/** A text item as pdf.js returns it (`TextItem`): the string, its matrix (`[a, b, c, d, x, baseline]`) and its size. */\nexport type TextItem = { str: string; transform: number[]; width: number; height: number };\n\n/** A rectangle in fractions of the page (0–1), origin top-left — independent of the zoom the page is drawn at. */\nexport type Box = { x: number; y: number; width: number; height: number };\n\n/** The text layer of one page: its size in PDF units (rotation 0) and its items in reading order. */\nexport type PageText = { page: number; width: number; height: number; items: readonly TextItem[] };\n\nexport type Located = {\n /** 1-based page where the passage starts. */\n page: number;\n /** One box per line of the passage (merged along a line); empty when only the page is known. */\n boxes: Box[];\n /** `region`: the box the app gave, as it is; `exact`: the whole quote was found; `start`: only its opening words were (a quote cut by a different layout). */\n match: \"exact\" | \"start\" | \"page\" | \"region\";\n};\n\n/** A region of a page the app already knows (a stamp, a font mismatch, a metadata area): its page and a box in fractions. */\nexport type Region = Box & { page: number };\n\nconst FOLD: Record<string, string> = { \"’\": \"'\", \"‘\": \"'\", \"“\": '\"', \"”\": '\"', \"«\": '\"', \"»\": '\"', \"–\": \"-\", \"—\": \"-\", \" \": \" \", \" \": \" \", \"fi\": \"fi\", \"fl\": \"fl\" };\n\n/** The comparable form of a text: no whitespace, no soft hyphen, straight quotes, case and accents folded. */\nexport function fold(text: string): string {\n let out = \"\";\n for (const ch of text.normalize(\"NFKD\")) {\n if (/\\p{M}/u.test(ch) || /\\s/u.test(ch) || ch === \"­\" || ch === \"​\") continue;\n out += (FOLD[ch] ?? ch).toLowerCase();\n }\n return out;\n}\n\ntype Index = { text: string; at: { item: number; char: number }[] };\n\nfunction indexPage(items: readonly TextItem[]): Index {\n let text = \"\";\n const at: Index[\"at\"] = [];\n items.forEach((item, i) => {\n for (let c = 0; c < item.str.length; c++) {\n const piece = fold(item.str[c]!);\n for (let k = 0; k < piece.length; k++) {\n text += piece[k];\n at.push({ item: i, char: c });\n }\n }\n });\n return { text, at };\n}\n\n// Proportional faces: \"locataire\" is not as wide as nine capitals. pdf.js gives one width per item, so a position inside an\n// item is shared out by the Helvetica advance widths (per 1000 em) — close for any sans text, far better than a flat share.\nconst ADVANCE =\n \"278 278 355 556 556 889 667 191 333 333 389 584 278 333 278 278 556 556 556 556 556 556 556 556 556 556 278 278 584 584 584 556 1015 \" +\n \"667 667 722 722 667 611 778 722 278 500 667 556 833 722 778 667 778 722 667 611 722 667 944 667 667 611 278 278 278 469 556 333 \" +\n \"556 556 500 556 556 278 556 556 222 222 500 222 833 556 556 556 556 333 500 278 556 500 722 500 500 500\";\nconst ADVANCES = ADVANCE.split(\" \").map(Number);\nfunction advance(ch: string): number {\n const base = ch.normalize(\"NFD\")[0] ?? ch;\n const code = base.charCodeAt(0);\n return code >= 32 && code <= 126 ? (ADVANCES[code - 32] ?? 556) : 556;\n}\n/** The share (0–1) of an item's width that lies before character `n` of `text`. */\nfunction shareBefore(text: string, n: number): number {\n let before = 0;\n let total = 0;\n for (let i = 0; i < text.length; i++) {\n const a = advance(text[i]!);\n if (i < n) before += a;\n total += a;\n }\n return total > 0 ? before / total : n / Math.max(1, text.length);\n}\n\nfunction boxesOf(page: PageText, index: Index, from: number, to: number): Box[] {\n const spans = new Map<number, [number, number]>();\n for (let k = from; k < to; k++) {\n const { item, char } = index.at[k]!;\n const s = spans.get(item);\n spans.set(item, s ? [Math.min(s[0], char), Math.max(s[1], char + 1)] : [char, char + 1]);\n }\n const raw: Box[] = [];\n for (const [i, [c0, c1]] of [...spans].sort((a, b) => a[0] - b[0])) {\n const item = page.items[i]!;\n const size = item.height || Math.abs(item.transform[3] ?? 0) || 10;\n const x = (item.transform[4] ?? 0) + item.width * shareBefore(item.str, c0);\n const w = item.width * (shareBefore(item.str, c1) - shareBefore(item.str, c0));\n const top = page.height - ((item.transform[5] ?? 0) + size * 0.9);\n raw.push({ x: x / page.width, y: top / page.height, width: w / page.width, height: (size * 1.15) / page.height });\n }\n // Merge the pieces that sit on one line and touch (several items of one sentence) into one rectangle.\n const merged: Box[] = [];\n for (const b of raw) {\n const last = merged[merged.length - 1];\n const sameLine = last && Math.abs(last.y - b.y) < last.height * 0.5 && b.x - (last.x + last.width) < last.height * 1.5 && b.x >= last.x - 1e-9;\n if (last && sameLine) {\n const right = Math.max(last.x + last.width, b.x + b.width);\n last.y = Math.min(last.y, b.y);\n last.height = Math.max(last.height, b.height);\n last.width = right - last.x;\n } else merged.push({ ...b });\n }\n return merged.map((b) => ({ x: clamp01(b.x), y: clamp01(b.y), width: Math.min(b.width, 1 - clamp01(b.x)), height: Math.min(b.height, 1 - clamp01(b.y)) }));\n}\n\nconst clamp01 = (n: number) => Math.min(1, Math.max(0, n));\n\n/** The shortest opening worth highlighting alone: a few words, not a stray letter. */\nconst MIN_START = 24;\n\n/**\n * Where `quote` sits in the pages: the first page (starting with `hintPage`, if any) whose text contains it, and the\n * boxes of its lines. A quote that a different layout cut (a column break, a hyphen) is looked for by its opening\n * words (`match: \"start\"`); one that is nowhere gives `null`, or the hinted page alone (`match: \"page\"`). Never a guess:\n * a rotated page has no boxes, only its page.\n */\nexport function locateQuote(pages: readonly PageText[], quote: string, hintPage?: number): Located | null {\n const needle = fold(quote);\n const ordered = hintPage ? [...pages].sort((a, b) => Number(b.page === hintPage) - Number(a.page === hintPage)) : pages;\n if (needle.length > 0) {\n for (const mode of [\"exact\", \"start\"] as const) {\n const wanted = mode === \"exact\" ? needle : needle.slice(0, Math.max(MIN_START, Math.min(40, Math.floor(needle.length * 0.6))));\n if (mode === \"start\" && (needle.length <= wanted.length || wanted.length < MIN_START)) break;\n for (const page of ordered) {\n const index = indexPage(page.items);\n const found = index.text.indexOf(wanted);\n if (found < 0) continue;\n return { page: page.page, boxes: boxesOf(page, index, found, found + wanted.length), match: mode };\n }\n }\n }\n return hintPage && pages.some((p) => p.page === hintPage) ? { page: hintPage, boxes: [], match: \"page\" } : null;\n}\n\nconst inUnit = (n: number) => Number.isFinite(n) && n >= 0 && n <= 1;\n\n/**\n * A region of a page, as it is: one box, no text needed. Never drawn when it is not on the pages — an unknown page, a box\n * outside 0–1 or empty, a value that is not a number — so a wrong box is `null`, not a guess.\n */\nexport function locateRegion(pages: readonly PageText[], region: Region): Located | null {\n const { page, x, y, width, height } = region;\n const valid = pages.some((p) => p.page === page) && inUnit(x) && inUnit(y) && width > 0 && height > 0 && inUnit(x + width) && inUnit(y + height);\n return valid ? { page, boxes: [{ x, y, width, height }], match: \"region\" } : null;\n}\n\n/** What to light for a highlight: its region when it has a valid one, otherwise its quote (if any). */\nexport function resolveHighlight(pages: readonly PageText[], h: { quote?: string; page?: number; region?: Region }): Located | null {\n const byRegion = h.region ? locateRegion(pages, h.region) : null;\n if (byRegion) return byRegion;\n if (h.quote) return locateQuote(pages, h.quote, h.page ?? h.region?.page);\n const hinted = h.page !== undefined && pages.some((p) => p.page === h.page);\n return hinted ? { page: h.page!, boxes: [], match: \"page\" } : null;\n}\n"],"mappings":";;;;;;;AAOA,YAAY,WAAW;AACvB,SAAS,UAAU;;;ACgBnB,IAAM,OAA+B,EAAE,UAAK,KAAK,UAAK,KAAK,UAAK,KAAK,UAAK,KAAK,QAAK,KAAK,QAAK,KAAK,UAAK,KAAK,UAAK,KAAK,QAAK,KAAK,UAAK,KAAK,UAAK,MAAM,UAAK,KAAK;AAGzJ,SAAS,KAAK,MAAsB;AACzC,MAAI,MAAM;AACV,aAAW,MAAM,KAAK,UAAU,MAAM,GAAG;AACvC,QAAI,SAAS,KAAK,EAAE,KAAK,MAAM,KAAK,EAAE,KAAK,OAAO,UAAO,OAAO,SAAK;AACrE,YAAQ,KAAK,EAAE,KAAK,IAAI,YAAY;AAAA,EACtC;AACA,SAAO;AACT;AAIA,SAAS,UAAU,OAAmC;AACpD,MAAI,OAAO;AACX,QAAM,KAAkB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AAA,gBAClB,eAAa,EAAE,OAAO;AAAA,gBACtB,WAAW,EAAE,IAAI;AAAA,gBACjB,OAAO,EAAE,MAAM,GAAG,EAAE,IAAI,GAAG,KAAK,KAAK,GAAG,EAAE,IAAI,GAAG,KAAK,OAAO,GAAG,EAAE,QAAQ,GAAG,KAAK,QAAQ,GAAG,EAAE,SAAS,GAAG,IAAI;AAAA,gBAC/G,SAAS,MAAM,iBAAiB,EAAE,OAAO,WAAW,OAAO,EAAE,EAAE;AAAA;AAAA,cAN1D,GAAG,EAAE,EAAE,IAAI,CAAC;AAAA,YAOnB,CACD;AAAA,UACH,CAAC;AAAA,aAjBO,EAAE,IAkBZ;AAAA,MAEJ,CAAC,IACD;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/document-viewer/document-viewer.tsx","../src/document-viewer/locate.ts"],"sourcesContent":["// Client. A PDF drawn page by page (pdf.js), and passages of it lit where they sit. The app hands over the engine\n// (`loadPdfjs={() => import(\"pdfjs-dist\")}` — an optional peer, loaded only on a page that shows a document) and the\n// worker's address; it hands over the passages as quotes (`highlights`), and the viewer finds their place from the\n// PDF's own text positions (`locateQuote`): one box per line, in fractions of the page, so they follow any zoom.\n// `activeId` (controlled) scrolls to a passage and strengthens it; a click on a box calls `onActiveChange`. A passage\n// the text layer cannot place is never drawn at a guessed place: the viewer goes to its page when it is known and shows\n// the quote in a bar — and tells the app (`onLocate`) so its list can say \"page 3\" or \"not found\".\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { useLatest, usePrefersReducedMotion } from \"../media\";\nimport { type Located, type PageText, type Region, resolveHighlight } from \"./locate\";\n\nexport const documentViewer = tv({\n slots: {\n root: \"relative flex min-w-0 flex-col gap-3\",\n pages: \"flex max-h-(--kz-document-viewer-height,70vh) flex-col gap-3 overflow-auto rounded-lg border border-border-default bg-surface-2 p-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent\",\n page: \"relative mx-auto w-full max-w-(--kz-document-viewer-page,56rem) shrink-0 overflow-hidden rounded-sm bg-white shadow-sm\",\n canvas: \"block h-auto w-full\",\n caption: \"absolute top-1 left-1 rounded-sm bg-surface-1/90 px-1.5 py-0.5 text-xs text-fg-secondary\",\n box: \"absolute cursor-pointer rounded-xs border border-warning/70 bg-warning/25 mix-blend-multiply transition-colors data-[active=true]:border-2 data-[active=true]:border-danger data-[active=true]:bg-danger/25 motion-reduce:transition-none\",\n bar: \"rounded-lg border border-border-default bg-surface-1 px-3 py-2 text-sm text-fg-secondary\",\n status: \"p-6 text-center text-sm text-fg-secondary\",\n },\n});\n\n/** The words of the viewer, passed translated. `{page}` and `{total}` are replaced. */\nexport type DocumentViewerLabels = {\n /** The accessible name of the pages' region. */\n region: string;\n loading: string;\n failed: string;\n /** A page's caption and accessible name: \"Page {page} of {total}\". */\n page: string;\n /** The bar above the pages when the active passage could only be placed on a page: \"Passage on page {page}:\". */\n onPage: string;\n /** The bar when the active passage is not in the text layer. */\n notFound: string;\n};\n\nexport const documentViewerLabels: DocumentViewerLabels = {\n region: \"Document pages\",\n loading: \"Loading the document…\",\n failed: \"The document could not be displayed.\",\n page: \"Page {page} of {total}\",\n onPage: \"Passage on page {page}:\",\n notFound: \"This passage is not in the document's text layer:\",\n};\n\n/** A passage to light: its quote (as the text layer reads it) and/or a `region` of a page the app already knows (a stamp, a\n mismatch — fractions of the page, origin top-left); the page if known, a name for screen readers. A valid region wins. */\nexport type DocumentHighlight = { id: string; quote?: string; region?: Region; page?: number; label?: string };\n\n/** What the viewer found for a passage. */\n\n/** The members of pdf.js the viewer uses (`pdfjs-dist` ≥ 5), typed here so the package does not depend on it. */\nexport type PdfjsModule = {\n GlobalWorkerOptions: { workerSrc: string };\n getDocument(source: { url?: string; data?: Uint8Array }): { promise: Promise<PdfDocument>; destroy?: () => Promise<void> | void };\n};\nexport type PdfDocument = { numPages: number; getPage(n: number): Promise<PdfPage>; destroy?: () => Promise<void> | void };\nexport type PdfPage = {\n rotate: number;\n view: number[];\n getViewport(options: { scale: number }): { width: number; height: number };\n getTextContent(): Promise<{ items: readonly unknown[] }>;\n render(options: { canvas: HTMLCanvasElement; canvasContext: CanvasRenderingContext2D; viewport: { width: number; height: number } }): { promise: Promise<void>; cancel?: () => void };\n cleanup?: () => void;\n};\n\nexport type DocumentViewerProps = Omit<React.ComponentProps<\"div\">, \"children\" | \"onChange\"> & {\n /** The PDF: an address (same origin or CORS) or its bytes. */\n src: string | Uint8Array;\n /** Loads pdf.js: `() => import(\"pdfjs-dist\")`. An optional peer, never in a bundle without a document. */\n loadPdfjs: () => Promise<PdfjsModule>;\n /** The address of pdf.js's worker (`new URL(\"pdfjs-dist/build/pdf.worker.min.mjs\", import.meta.url).toString()`). */\n workerSrc: string;\n /** The passages to light. */\n highlights?: readonly DocumentHighlight[];\n /** The passage in focus: the viewer scrolls to it. */\n activeId?: string | null;\n /** A box was clicked (the id) or the focus was released (`null`). */\n onActiveChange?: (id: string | null) => void;\n /** Where each passage was found (`null`: nowhere) — once the text layer is read, and again if `highlights` change. */\n onLocate?: (found: Record<string, Located | null>) => void;\n /** Called when the document is open, with its page count. */\n onLoad?: (info: { pages: number }) => void;\n /** The words of the viewer, translated (English by default). */\n labels?: Partial<DocumentViewerLabels>;\n};\n\nconst regionKey = (r: Region | undefined) => (r ? [r.page, r.x, r.y, r.width, r.height].join(\",\") : \"\");\nconst fill = (template: string, vars: Record<string, string | number>) => template.replaceAll(/\\{(\\w+)\\}/g, (m, k: string) => (k in vars ? String(vars[k]) : m));\n\ntype Loaded = { doc: PdfDocument; texts: PageText[]; sizes: { width: number; height: number }[] };\ntype Phase = { state: \"loading\" } | { state: \"error\"; key: string } | ({ state: \"ready\"; key: string } & Loaded);\n\nconst isItem = (x: unknown): x is PageText[\"items\"][number] => typeof x === \"object\" && x !== null && typeof (x as { str?: unknown }).str === \"string\" && Array.isArray((x as { transform?: unknown }).transform);\n\nfunction PageCanvas({ page, doc, caption, onReady, className }: Readonly<{ page: number; doc: PdfDocument; caption: string; onReady?: () => void; className: string }>) {\n const ref = React.useRef<HTMLCanvasElement>(null);\n const wrapper = React.useRef<HTMLDivElement>(null);\n const [visible, setVisible] = React.useState(() => typeof IntersectionObserver === \"undefined\");\n const ready = useLatest(onReady);\n React.useEffect(() => {\n const node = wrapper.current?.parentElement;\n if (!node) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver((entries) => entries.some((e) => e.isIntersecting) && setVisible(true), { rootMargin: \"600px 0px\" });\n observer.observe(node);\n return () => observer.disconnect();\n }, []);\n React.useEffect(() => {\n if (!visible) return;\n let task: { promise: Promise<void>; cancel?: () => void } | undefined;\n let cancelled = false;\n void (async () => {\n const p = await doc.getPage(page);\n const canvas = ref.current;\n const ctx = canvas?.getContext(\"2d\");\n if (cancelled || !canvas || !ctx) return;\n const base = p.getViewport({ scale: 1 });\n const dpr = typeof window === \"undefined\" ? 1 : Math.min(2, window.devicePixelRatio || 1);\n const scale = Math.min(2.5, Math.max(1, (canvas.parentElement?.clientWidth || base.width) / base.width)) * dpr;\n const viewport = p.getViewport({ scale });\n canvas.width = Math.floor(viewport.width);\n canvas.height = Math.floor(viewport.height);\n task = p.render({ canvas, canvasContext: ctx, viewport });\n await task.promise.catch(() => undefined);\n if (!cancelled) ready.current?.();\n })().catch(() => undefined);\n return () => {\n cancelled = true;\n task?.cancel?.();\n };\n }, [visible, doc, page, ready]);\n return (\n <div ref={wrapper} className=\"contents\">\n <canvas ref={ref} aria-hidden=\"true\" className={className} />\n <span className=\"sr-only\">{caption}</span>\n </div>\n );\n}\n\n/** A PDF with its passages lit — see the file's header. Client. */\nexport function DocumentViewer({ src, loadPdfjs, workerSrc, highlights = [], activeId = null, onActiveChange, onLocate, onLoad, labels, className, ...props }: Readonly<DocumentViewerProps>) {\n const words = { ...documentViewerLabels, ...labels };\n const s = documentViewer();\n const reduce = usePrefersReducedMotion();\n const [loaded, setPhase] = React.useState<Phase>({ state: \"loading\" });\n const callbacks = useLatest({ onLoad, onLocate });\n const containerRef = React.useRef<HTMLDivElement>(null);\n const bytes = typeof src === \"string\" ? src : src.byteLength + \":\" + src[0] + \":\" + src.at(-1);\n // A result belongs to the document it was read from: another `src` is loading again, with no reset inside the effect.\n const phase: Phase = loaded.state !== \"loading\" && loaded.key !== bytes ? { state: \"loading\" } : loaded;\n\n // Open the document and read every page's text layer (positions only; nothing is sent anywhere).\n React.useEffect(() => {\n let cancelled = false;\n let opened: { destroy?: () => Promise<void> | void } | undefined;\n void (async () => {\n const pdfjs = await loadPdfjs();\n pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;\n const loading = pdfjs.getDocument(typeof src === \"string\" ? { url: src } : { data: src.slice() });\n opened = loading;\n const doc = await loading.promise;\n const texts: PageText[] = [];\n const sizes: Loaded[\"sizes\"] = [];\n for (let n = 1; n <= doc.numPages; n++) {\n const page = await doc.getPage(n);\n const vp = page.getViewport({ scale: 1 });\n sizes.push({ width: vp.width, height: vp.height });\n const content = await page.getTextContent();\n // A rotated page has no reliable boxes: it keeps its size and an empty text layer (the app's page hint still works).\n texts.push({ page: n, width: vp.width, height: vp.height, items: page.rotate % 360 === 0 ? content.items.filter(isItem) : [] });\n page.cleanup?.();\n }\n if (cancelled) return;\n setPhase({ state: \"ready\", key: bytes, doc, texts, sizes });\n callbacks.current.onLoad?.({ pages: doc.numPages });\n })().catch(() => !cancelled && setPhase({ state: \"error\", key: bytes }));\n return () => {\n cancelled = true;\n void opened?.destroy?.();\n };\n // `src` is compared by content (`bytes`) so a re-render with the same bytes does not reopen the file.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [bytes, loadPdfjs, workerSrc, callbacks]);\n\n const key = highlights.map((h) => `${h.id}\\u0000${h.page ?? \"\"}\\u0000${h.quote ?? \"\"}\\u0000${regionKey(h.region)}`).join(\"\\u0001\");\n const found = React.useMemo(() => {\n const out: Record<string, Located | null> = {};\n if (phase.state === \"ready\") for (const h of highlights) out[h.id] = resolveHighlight(phase.texts, h);\n return out;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [phase, key]);\n React.useEffect(() => {\n if (phase.state === \"ready\") callbacks.current.onLocate?.(found);\n }, [found, phase.state, callbacks]);\n\n // Go to the active passage.\n const active = activeId ? highlights.find((h) => h.id === activeId) : undefined;\n const where = activeId ? found[activeId] : undefined;\n React.useEffect(() => {\n if (phase.state !== \"ready\" || !where) return;\n const root = containerRef.current;\n const target = root?.querySelector<HTMLElement>(where.boxes.length > 0 ? `[data-highlight=\"${CSS.escape(activeId!)}\"]` : `[data-page=\"${where.page}\"]`) ?? null;\n target?.scrollIntoView?.({ block: where.boxes.length > 0 ? \"center\" : \"start\", behavior: reduce ? \"auto\" : \"smooth\" });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeId, where, phase.state]);\n\n return (\n <div className={s.root({ className })} {...props}>\n {active && where !== undefined && where?.match !== \"exact\" && where?.match !== \"start\" && where?.match !== \"region\" ? (\n <p className={s.bar()} data-testid=\"document-viewer-bar\">\n {where?.match === \"page\" ? fill(words.onPage, { page: where.page }) : words.notFound} {active.quote ? <q>{active.quote}</q> : null}\n </p>\n ) : null}\n <div ref={containerRef} className={s.pages()} role=\"region\" aria-label={words.region} tabIndex={0}>\n {phase.state === \"loading\" ? <p className={s.status()}>{words.loading}</p> : null}\n {phase.state === \"error\" ? <p role=\"alert\" className={s.status()}>{words.failed}</p> : null}\n {phase.state === \"ready\"\n ? phase.texts.map((t, i) => {\n const size = phase.sizes[i]!;\n const caption = fill(words.page, { page: t.page, total: phase.doc.numPages });\n return (\n <div key={t.page} className={s.page()} data-page={t.page} style={{ aspectRatio: `${size.width} / ${size.height}` }}>\n <PageCanvas page={t.page} doc={phase.doc} caption={caption} className={s.canvas()} />\n <span className={s.caption()} aria-hidden=\"true\">{caption}</span>\n {highlights.flatMap((h) => {\n const f = found[h.id];\n if (!f || f.page !== t.page) return [];\n return f.boxes.map((b, k) => (\n <div\n key={`${h.id}:${k}`}\n aria-hidden=\"true\"\n data-highlight={h.id}\n data-active={h.id === activeId}\n className={s.box()}\n style={{ left: `${b.x * 100}%`, top: `${b.y * 100}%`, width: `${b.width * 100}%`, height: `${b.height * 100}%` }}\n onClick={() => onActiveChange?.(h.id === activeId ? null : h.id)}\n />\n ));\n })}\n </div>\n );\n })\n : null}\n </div>\n </div>\n );\n}\n\nexport { type Located } from \"./locate\";","// Pure: where a quoted passage sits on the pages of a PDF, from pdf.js's text positions. No DOM, no pdf.js import —\n// the viewer feeds it what `page.getTextContent()` returned, a test feeds it a fixture.\n\n/** A text item as pdf.js returns it (`TextItem`): the string, its matrix (`[a, b, c, d, x, baseline]`) and its size. */\nexport type TextItem = { str: string; transform: number[]; width: number; height: number };\n\n/** A rectangle in fractions of the page (0–1), origin top-left — independent of the zoom the page is drawn at. */\nexport type Box = { x: number; y: number; width: number; height: number };\n\n/** The text layer of one page: its size in PDF units (rotation 0) and its items in reading order. */\nexport type PageText = { page: number; width: number; height: number; items: readonly TextItem[] };\n\nexport type Located = {\n /** 1-based page where the passage starts. */\n page: number;\n /** One box per line of the passage (merged along a line); empty when only the page is known. */\n boxes: Box[];\n /** `region`: the box the app gave, as it is; `exact`: the whole quote was found; `start`: only its opening words were (a quote cut by a different layout). */\n match: \"exact\" | \"start\" | \"page\" | \"region\";\n};\n\n/** A region of a page the app already knows (a stamp, a font mismatch, a metadata area): its page and a box in fractions. */\nexport type Region = Box & { page: number };\n\nconst FOLD: Record<string, string> = { \"’\": \"'\", \"‘\": \"'\", \"“\": '\"', \"”\": '\"', \"«\": '\"', \"»\": '\"', \"–\": \"-\", \"—\": \"-\", \" \": \" \", \" \": \" \", \"fi\": \"fi\", \"fl\": \"fl\" };\n\n/** The comparable form of a text: no whitespace, no soft hyphen, straight quotes, case and accents folded. */\nexport function fold(text: string): string {\n let out = \"\";\n for (const ch of text.normalize(\"NFKD\")) {\n if (/\\p{M}/u.test(ch) || /\\s/u.test(ch) || ch === \"­\" || ch === \"​\") continue;\n out += (FOLD[ch] ?? ch).toLowerCase();\n }\n return out;\n}\n\ntype Index = { text: string; at: { item: number; char: number }[] };\n\nfunction indexPage(items: readonly TextItem[]): Index {\n let text = \"\";\n const at: Index[\"at\"] = [];\n items.forEach((item, i) => {\n for (let c = 0; c < item.str.length; c++) {\n const piece = fold(item.str[c]!);\n for (let k = 0; k < piece.length; k++) {\n text += piece[k];\n at.push({ item: i, char: c });\n }\n }\n });\n return { text, at };\n}\n\n// Proportional faces: \"locataire\" is not as wide as nine capitals. pdf.js gives one width per item, so a position inside an\n// item is shared out by the Helvetica advance widths (per 1000 em) — close for any sans text, far better than a flat share.\nconst ADVANCE =\n \"278 278 355 556 556 889 667 191 333 333 389 584 278 333 278 278 556 556 556 556 556 556 556 556 556 556 278 278 584 584 584 556 1015 \" +\n \"667 667 722 722 667 611 778 722 278 500 667 556 833 722 778 667 778 722 667 611 722 667 944 667 667 611 278 278 278 469 556 333 \" +\n \"556 556 500 556 556 278 556 556 222 222 500 222 833 556 556 556 556 333 500 278 556 500 722 500 500 500\";\nconst ADVANCES = ADVANCE.split(\" \").map(Number);\nfunction advance(ch: string): number {\n const base = ch.normalize(\"NFD\")[0] ?? ch;\n const code = base.charCodeAt(0);\n return code >= 32 && code <= 126 ? (ADVANCES[code - 32] ?? 556) : 556;\n}\n/** The share (0–1) of an item's width that lies before character `n` of `text`. */\nfunction shareBefore(text: string, n: number): number {\n let before = 0;\n let total = 0;\n for (let i = 0; i < text.length; i++) {\n const a = advance(text[i]!);\n if (i < n) before += a;\n total += a;\n }\n return total > 0 ? before / total : n / Math.max(1, text.length);\n}\n\nfunction boxesOf(page: PageText, index: Index, from: number, to: number): Box[] {\n const spans = new Map<number, [number, number]>();\n for (let k = from; k < to; k++) {\n const { item, char } = index.at[k]!;\n const s = spans.get(item);\n spans.set(item, s ? [Math.min(s[0], char), Math.max(s[1], char + 1)] : [char, char + 1]);\n }\n const raw: Box[] = [];\n for (const [i, [c0, c1]] of [...spans].sort((a, b) => a[0] - b[0])) {\n const item = page.items[i]!;\n const size = item.height || Math.abs(item.transform[3] ?? 0) || 10;\n const x = (item.transform[4] ?? 0) + item.width * shareBefore(item.str, c0);\n const w = item.width * (shareBefore(item.str, c1) - shareBefore(item.str, c0));\n const top = page.height - ((item.transform[5] ?? 0) + size * 0.9);\n raw.push({ x: x / page.width, y: top / page.height, width: w / page.width, height: (size * 1.15) / page.height });\n }\n // Merge the pieces that sit on one line and touch (several items of one sentence) into one rectangle.\n const merged: Box[] = [];\n for (const b of raw) {\n const last = merged.at(-1);\n const sameLine = last && Math.abs(last.y - b.y) < last.height * 0.5 && b.x - (last.x + last.width) < last.height * 1.5 && b.x >= last.x - 1e-9;\n if (last && sameLine) {\n const right = Math.max(last.x + last.width, b.x + b.width);\n last.y = Math.min(last.y, b.y);\n last.height = Math.max(last.height, b.height);\n last.width = right - last.x;\n } else merged.push({ ...b });\n }\n return merged.map((b) => ({ x: clamp01(b.x), y: clamp01(b.y), width: Math.min(b.width, 1 - clamp01(b.x)), height: Math.min(b.height, 1 - clamp01(b.y)) }));\n}\n\nconst clamp01 = (n: number) => Math.min(1, Math.max(0, n));\n\n/** The shortest opening worth highlighting alone: a few words, not a stray letter. */\nconst MIN_START = 24;\n\n/**\n * Where `quote` sits in the pages: the first page (starting with `hintPage`, if any) whose text contains it, and the\n * boxes of its lines. A quote that a different layout cut (a column break, a hyphen) is looked for by its opening\n * words (`match: \"start\"`); one that is nowhere gives `null`, or the hinted page alone (`match: \"page\"`). Never a guess:\n * a rotated page has no boxes, only its page.\n */\nexport function locateQuote(pages: readonly PageText[], quote: string, hintPage?: number): Located | null {\n const needle = fold(quote);\n const ordered = hintPage ? [...pages].sort((a, b) => Number(b.page === hintPage) - Number(a.page === hintPage)) : pages;\n if (needle.length > 0) {\n for (const mode of [\"exact\", \"start\"] as const) {\n const wanted = mode === \"exact\" ? needle : needle.slice(0, Math.max(MIN_START, Math.min(40, Math.floor(needle.length * 0.6))));\n if (mode === \"start\" && (needle.length <= wanted.length || wanted.length < MIN_START)) break;\n for (const page of ordered) {\n const index = indexPage(page.items);\n const found = index.text.indexOf(wanted);\n if (found < 0) continue;\n return { page: page.page, boxes: boxesOf(page, index, found, found + wanted.length), match: mode };\n }\n }\n }\n return hintPage && pages.some((p) => p.page === hintPage) ? { page: hintPage, boxes: [], match: \"page\" } : null;\n}\n\nconst inUnit = (n: number) => Number.isFinite(n) && n >= 0 && n <= 1;\n\n/**\n * A region of a page, as it is: one box, no text needed. Never drawn when it is not on the pages — an unknown page, a box\n * outside 0–1 or empty, a value that is not a number — so a wrong box is `null`, not a guess.\n */\nexport function locateRegion(pages: readonly PageText[], region: Region): Located | null {\n const { page, x, y, width, height } = region;\n const valid = pages.some((p) => p.page === page) && inUnit(x) && inUnit(y) && width > 0 && height > 0 && inUnit(x + width) && inUnit(y + height);\n return valid ? { page, boxes: [{ x, y, width, height }], match: \"region\" } : null;\n}\n\n/** What to light for a highlight: its region when it has a valid one, otherwise its quote (if any). */\nexport function resolveHighlight(pages: readonly PageText[], h: { quote?: string; page?: number; region?: Region }): Located | null {\n const byRegion = h.region ? locateRegion(pages, h.region) : null;\n if (byRegion) return byRegion;\n if (h.quote) return locateQuote(pages, h.quote, h.page ?? h.region?.page);\n const hinted = h.page !== undefined && pages.some((p) => p.page === h.page);\n return hinted ? { page: h.page!, boxes: [], match: \"page\" } : null;\n}\n"],"mappings":";;;;;;;AAOA,YAAY,WAAW;AACvB,SAAS,UAAU;;;ACgBnB,IAAM,OAA+B,EAAE,UAAK,KAAK,UAAK,KAAK,UAAK,KAAK,UAAK,KAAK,QAAK,KAAK,QAAK,KAAK,UAAK,KAAK,UAAK,KAAK,QAAK,KAAK,UAAK,KAAK,UAAK,MAAM,UAAK,KAAK;AAGzJ,SAAS,KAAK,MAAsB;AACzC,MAAI,MAAM;AACV,aAAW,MAAM,KAAK,UAAU,MAAM,GAAG;AACvC,QAAI,SAAS,KAAK,EAAE,KAAK,MAAM,KAAK,EAAE,KAAK,OAAO,UAAO,OAAO,SAAK;AACrE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rC,mBAAO,EAAE,MAAM,IAAI,CAAC,GAAG,MACrB;AAAA,cAAC;AAAA;AAAA,gBAEC,eAAY;AAAA,gBACZ,kBAAgB,EAAE;AAAA,gBAClB,eAAa,EAAE,OAAO;AAAA,gBACtB,WAAW,EAAE,IAAI;AAAA,gBACjB,OAAO,EAAE,MAAM,GAAG,EAAE,IAAI,GAAG,KAAK,KAAK,GAAG,EAAE,IAAI,GAAG,KAAK,OAAO,GAAG,EAAE,QAAQ,GAAG,KAAK,QAAQ,GAAG,EAAE,SAAS,GAAG,IAAI;AAAA,gBAC/G,SAAS,MAAM,iBAAiB,EAAE,OAAO,WAAW,OAAO,EAAE,EAAE;AAAA;AAAA,cAN1D,GAAG,EAAE,EAAE,IAAI,CAAC;AAAA,YAOnB,CACD;AAAA,UACH,CAAC;AAAA,aAjBO,EAAE,IAkBZ;AAAA,MAEJ,CAAC,IACD;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
package/dist/doodle.d.ts CHANGED
@@ -26,7 +26,7 @@ type DoodleProps = Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> & {
26
26
  label?: string;
27
27
  };
28
28
  /** A doodle: an arrow, a circled word, a star, a wavy underline or a bird's sketch, in the margin ink. Decoration unless it has a `label`. */
29
- declare function Doodle({ kind, children, word, side, place, top, seed, bird, flip, label, className, style, ...props }: DoodleProps): React.JSX.Element;
29
+ declare function Doodle({ kind, children, word, side, place, top, seed, bird, flip, label, className, style, ...props }: Readonly<DoodleProps>): React.JSX.Element;
30
30
 
31
31
  export { Doodle };
32
32
  export type { DoodleBird, DoodleKind, DoodleProps };
package/dist/doodle.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5VEVYDVC.js";
4
4
  import {
5
5
  cn
6
- } from "./chunk-W675RFOA.js";
6
+ } from "./chunk-ISC2QBXJ.js";
7
7
 
8
8
  // src/doodle/doodle.tsx
9
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/doodle/doodle.tsx"],"sourcesContent":["// Server-safe. A doodle of the Cahier (ADR-004, blocks.css): an arrow, a circled word, a star, a wavy underline or a small\n// sketch of one of the birds, drawn in the margin ink. It lives in two places: beside a block (`place=\"margin\"`, hung by\n// `Stuck`, on a wide screen only — gone below 1360 px, where the page's margin disappears) or in the flow\n// (`place=\"inline\"`), where a `circle` or a `wave` can wrap real text (`children`): the word stays text, in the reading\n// order, and the ink is drawn around it. Pure functions of their props (the tilt comes from `seed`, never random): the\n// same marks on the server and on the client. Decoration, hidden from assistive technology, unless it carries a `label`.\nimport type * as React from \"react\";\n\nimport { seedUnit } from \"../cahier-seed\";\nimport { cn } from \"../cn\";\n\nexport type DoodleKind = \"arrow\" | \"circle\" | \"star\" | \"wave\" | \"bird\";\n/** The birds with a sketch of their own (the ear tufts, the beak, the legs tell them apart); the rest of the flock is not drawn here. */\nexport type DoodleBird = \"falcon\" | \"owl\" | \"duck\" | \"flamingo\" | \"pigeon\";\n\nexport type DoodleProps = Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> & {\n /** What is drawn: `arrow` (points at the block), `circle` (rings a word), `star`, `wave` (an underline) or `bird` (a small sketch). */\n kind: DoodleKind;\n /** Real text a `circle` rings or a `wave` underlines, in the flow (« nothing to copy »): it stays text, the ink is hidden. */\n children?: React.ReactNode;\n /** The word a margin `circle` rings (« ça ! »). It is decoration too: nothing that matters is said only here. */\n word?: string;\n /** Which margin it sits in: `left` (where the notebook's margin is) or `right`. It points at the block from either. @default \"left\" */\n side?: \"left\" | \"right\";\n /** `margin` hangs it beside the nearest positioned ancestor, on a wide screen only; `inline` keeps it in the flow (always, around `children`). @default \"margin\" */\n place?: \"margin\" | \"inline\";\n /** How far from the top of the block it sits, as a CSS length. @default \"0px\" */\n top?: string;\n /** Where its slight tilt comes from: the same string always leans the same way (±8°). @default \"\" */\n seed?: string;\n /** Which bird `kind=\"bird\"` sketches. @default \"duck\" */\n bird?: DoodleBird;\n /** Turns the mark to face the other way (an inline arrow that points left). A margin doodle on the `right` already does. @default false */\n flip?: boolean;\n /** A text equivalent, when the mark says something (« Start with the installation »): it is then an image carrying it. Without it, decoration. */\n label?: string;\n};\n\nconst PATHS: Record<Exclude<DoodleKind, \"bird\">, { box: string; d: string[] }> = {\n arrow: { box: \"0 0 56 36\", d: [\"M4 30 C 14 8, 32 6, 50 20\", \"M41 17 L50 20 L46 28\"] },\n circle: { box: \"0 0 64 40\", d: [\"M9 22 C 6 8, 42 2, 54 14 C 62 26, 24 38, 11 29 C 4 23, 14 10, 34 8\"] },\n star: { box: \"0 0 56 52\", d: [\"M28 4 L34 20 L52 21 L38 32 L43 48 L28 39 L13 48 L18 32 L4 21 L22 20 Z\"] },\n wave: { box: \"0 0 56 16\", d: [\"M2 9 Q 8 1 14 9 T 26 9 T 38 9 T 50 9\"] },\n};\n\n/** Around real text, the ring and the underline stretch to the word (`preserveAspectRatio=\"none\"`, the stroke kept even). */\nconst WRAPS: Record<\"circle\" | \"wave\", { box: string; d: string }> = {\n circle: { box: \"0 0 100 40\", d: \"M52 4 C18 2 3 14 6 24 C9 36 40 38 70 34 C94 30 99 16 84 8 C76 4 62 3 46 4 C40 4 36 5 33 6\" },\n wave: { box: \"0 0 100 12\", d: \"M2 7 Q8 1 14 7 T26 7 T38 7 T50 7 T62 7 T74 7 T86 7 T98 7\" },\n};\n\n/** The ear tufts, the beak and the legs that tell the birds apart, over a body and a head every bird shares. */\nconst BIRD_FEATURES: Record<DoodleBird, string> = {\n falcon: \"M52 17 Q62 17 60 27 Q57 22 52 23\",\n owl: \"M39 12 L37 4 L44 10 M51 12 L55 4 L48 10 M52 21 L55 25 L51 25\",\n duck: \"M52 19 Q62 18 63 23 Q58 25 52 24\",\n flamingo: \"M51 17 Q58 17 56 24 M44 14 C32 22 50 30 36 40\",\n pigeon: \"M52 20 L59 22 L52 24\",\n};\n\nfunction BirdSketch({ bird }: { bird: DoodleBird }) {\n const owl = bird === \"owl\";\n const tall = bird === \"flamingo\";\n return (\n <svg viewBox=\"0 0 64 64\" focusable=\"false\" data-bird={bird}>\n <ellipse cx=\"30\" cy=\"40\" rx=\"18\" ry=\"12\" transform=\"rotate(-8 30 40)\" />\n {tall ? <circle cx=\"45\" cy=\"12\" r=\"5.5\" /> : <circle cx=\"44\" cy=\"21\" r=\"9\" />}\n <path d=\"M20 40 Q29 31 40 39\" />\n <path d=\"M26 52 L25 61 M34 52 L35 61\" />\n <path d={BIRD_FEATURES[bird]} />\n {owl ? <circle cx=\"47\" cy=\"19\" r=\"4\" /> : null}\n <circle cx={tall ? 46.5 : 47} cy={tall ? 11 : 19} r=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** A doodle: an arrow, a circled word, a star, a wavy underline or a bird's sketch, in the margin ink. Decoration unless it has a `label`. */\nexport function Doodle({ kind, children, word, side = \"left\", place = \"margin\", top, seed = \"\", bird = \"duck\", flip = false, label, className, style, ...props }: DoodleProps) {\n const wraps = children != null && (kind === \"circle\" || kind === \"wave\");\n const said = !wraps && Boolean(label);\n return (\n <span\n className={cn(\"kz-doodle\", className)}\n data-kind={kind}\n data-side={side}\n data-place={wraps ? \"inline\" : place}\n data-wrap={wraps ? \"\" : undefined}\n data-flip={flip ? \"\" : undefined}\n role={said ? \"img\" : undefined}\n aria-label={said ? label : undefined}\n aria-hidden={wraps || said ? undefined : true}\n style={{ ...style, [\"--kz-doodle-tilt\" as string]: `${Math.round(seedUnit(`${kind}${seed}`) * 80) / 10}deg`, ...(top ? { [\"--kz-doodle-top\" as string]: top } : {}) }}\n {...props}\n >\n {wraps ? (\n <>\n <span className=\"kz-doodle-word\">{children}</span>\n <span className=\"kz-doodle-ink\" aria-hidden>\n <svg viewBox={WRAPS[kind as \"circle\" | \"wave\"].box} preserveAspectRatio=\"none\" focusable=\"false\">\n <path d={WRAPS[kind as \"circle\" | \"wave\"].d} vectorEffect=\"non-scaling-stroke\" />\n </svg>\n </span>\n </>\n ) : kind === \"bird\" ? (\n <BirdSketch bird={bird} />\n ) : (\n <svg viewBox={PATHS[kind].box} focusable=\"false\">\n {PATHS[kind].d.map((path) => (\n <path key={path} d={path} />\n ))}\n </svg>\n )}\n {!wraps && kind === \"circle\" && word ? <span className=\"kz-doodle-word\">{word}</span> : null}\n </span>\n );\n}\n"],"mappings":";;;;;;;;AAgEI,SA+BI,UA9BF,KADF;AA1BJ,IAAM,QAA2E;AAAA,EAC/E,OAAO,EAAE,KAAK,aAAa,GAAG,CAAC,6BAA6B,sBAAsB,EAAE;AAAA,EACpF,QAAQ,EAAE,KAAK,aAAa,GAAG,CAAC,oEAAoE,EAAE;AAAA,EACtG,MAAM,EAAE,KAAK,aAAa,GAAG,CAAC,uEAAuE,EAAE;AAAA,EACvG,MAAM,EAAE,KAAK,aAAa,GAAG,CAAC,sCAAsC,EAAE;AACxE;AAGA,IAAM,QAA+D;AAAA,EACnE,QAAQ,EAAE,KAAK,cAAc,GAAG,4FAA4F;AAAA,EAC5H,MAAM,EAAE,KAAK,cAAc,GAAG,2DAA2D;AAC3F;AAGA,IAAM,gBAA4C;AAAA,EAChD,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AACV;AAEA,SAAS,WAAW,EAAE,KAAK,GAAyB;AAClD,QAAM,MAAM,SAAS;AACrB,QAAM,OAAO,SAAS;AACtB,SACE,qBAAC,SAAI,SAAQ,aAAY,WAAU,SAAQ,aAAW,MACpD;AAAA,wBAAC,aAAQ,IAAG,MAAK,IAAG,MAAK,IAAG,MAAK,IAAG,MAAK,WAAU,oBAAmB;AAAA,IACrE,OAAO,oBAAC,YAAO,IAAG,MAAK,IAAG,MAAK,GAAE,OAAM,IAAK,oBAAC,YAAO,IAAG,MAAK,IAAG,MAAK,GAAE,KAAI;AAAA,IAC3E,oBAAC,UAAK,GAAE,uBAAsB;AAAA,IAC9B,oBAAC,UAAK,GAAE,+BAA8B;AAAA,IACtC,oBAAC,UAAK,GAAG,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,GACjF,GACF;AAAA,WACF,IACE,SAAS,SACX,oBAAC,cAAW,MAAY,IAExB,oBAAC,SAAI,SAAS,MAAM,IAAI,EAAE,KAAK,WAAU,SACtC,gBAAM,IAAI,EAAE,EAAE,IAAI,CAAC,SAClB,oBAAC,UAAgB,GAAG,QAAT,IAAe,CAC3B,GACH;AAAA,QAED,CAAC,SAAS,SAAS,YAAY,OAAO,oBAAC,UAAK,WAAU,kBAAkB,gBAAK,IAAU;AAAA;AAAA;AAAA,EAC1F;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/doodle/doodle.tsx"],"sourcesContent":["// Server-safe. A doodle of the Cahier (ADR-004, blocks.css): an arrow, a circled word, a star, a wavy underline or a small\n// sketch of one of the birds, drawn in the margin ink. It lives in two places: beside a block (`place=\"margin\"`, hung by\n// `Stuck`, on a wide screen only — gone below 1360 px, where the page's margin disappears) or in the flow\n// (`place=\"inline\"`), where a `circle` or a `wave` can wrap real text (`children`): the word stays text, in the reading\n// order, and the ink is drawn around it. Pure functions of their props (the tilt comes from `seed`, never random): the\n// same marks on the server and on the client. Decoration, hidden from assistive technology, unless it carries a `label`.\nimport type * as React from \"react\";\n\nimport { seedUnit } from \"../cahier-seed\";\nimport { cn } from \"../cn\";\n\nexport type DoodleKind = \"arrow\" | \"circle\" | \"star\" | \"wave\" | \"bird\";\n/** The birds with a sketch of their own (the ear tufts, the beak, the legs tell them apart); the rest of the flock is not drawn here. */\nexport type DoodleBird = \"falcon\" | \"owl\" | \"duck\" | \"flamingo\" | \"pigeon\";\n\nexport type DoodleProps = Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> & {\n /** What is drawn: `arrow` (points at the block), `circle` (rings a word), `star`, `wave` (an underline) or `bird` (a small sketch). */\n kind: DoodleKind;\n /** Real text a `circle` rings or a `wave` underlines, in the flow (« nothing to copy »): it stays text, the ink is hidden. */\n children?: React.ReactNode;\n /** The word a margin `circle` rings (« ça ! »). It is decoration too: nothing that matters is said only here. */\n word?: string;\n /** Which margin it sits in: `left` (where the notebook's margin is) or `right`. It points at the block from either. @default \"left\" */\n side?: \"left\" | \"right\";\n /** `margin` hangs it beside the nearest positioned ancestor, on a wide screen only; `inline` keeps it in the flow (always, around `children`). @default \"margin\" */\n place?: \"margin\" | \"inline\";\n /** How far from the top of the block it sits, as a CSS length. @default \"0px\" */\n top?: string;\n /** Where its slight tilt comes from: the same string always leans the same way (±8°). @default \"\" */\n seed?: string;\n /** Which bird `kind=\"bird\"` sketches. @default \"duck\" */\n bird?: DoodleBird;\n /** Turns the mark to face the other way (an inline arrow that points left). A margin doodle on the `right` already does. @default false */\n flip?: boolean;\n /** A text equivalent, when the mark says something (« Start with the installation »): it is then an image carrying it. Without it, decoration. */\n label?: string;\n};\n\nconst PATHS: Record<Exclude<DoodleKind, \"bird\">, { box: string; d: string[] }> = {\n arrow: { box: \"0 0 56 36\", d: [\"M4 30 C 14 8, 32 6, 50 20\", \"M41 17 L50 20 L46 28\"] },\n circle: { box: \"0 0 64 40\", d: [\"M9 22 C 6 8, 42 2, 54 14 C 62 26, 24 38, 11 29 C 4 23, 14 10, 34 8\"] },\n star: { box: \"0 0 56 52\", d: [\"M28 4 L34 20 L52 21 L38 32 L43 48 L28 39 L13 48 L18 32 L4 21 L22 20 Z\"] },\n wave: { box: \"0 0 56 16\", d: [\"M2 9 Q 8 1 14 9 T 26 9 T 38 9 T 50 9\"] },\n};\n\n/** Around real text, the ring and the underline stretch to the word (`preserveAspectRatio=\"none\"`, the stroke kept even). */\nconst WRAPS: Record<\"circle\" | \"wave\", { box: string; d: string }> = {\n circle: { box: \"0 0 100 40\", d: \"M52 4 C18 2 3 14 6 24 C9 36 40 38 70 34 C94 30 99 16 84 8 C76 4 62 3 46 4 C40 4 36 5 33 6\" },\n wave: { box: \"0 0 100 12\", d: \"M2 7 Q8 1 14 7 T26 7 T38 7 T50 7 T62 7 T74 7 T86 7 T98 7\" },\n};\n\n/** The ear tufts, the beak and the legs that tell the birds apart, over a body and a head every bird shares. */\nconst BIRD_FEATURES: Record<DoodleBird, string> = {\n falcon: \"M52 17 Q62 17 60 27 Q57 22 52 23\",\n owl: \"M39 12 L37 4 L44 10 M51 12 L55 4 L48 10 M52 21 L55 25 L51 25\",\n duck: \"M52 19 Q62 18 63 23 Q58 25 52 24\",\n flamingo: \"M51 17 Q58 17 56 24 M44 14 C32 22 50 30 36 40\",\n pigeon: \"M52 20 L59 22 L52 24\",\n};\n\nfunction BirdSketch({ bird }: Readonly<{ bird: DoodleBird }>) {\n const owl = bird === \"owl\";\n const tall = bird === \"flamingo\";\n return (\n <svg viewBox=\"0 0 64 64\" focusable=\"false\" data-bird={bird}>\n <ellipse cx=\"30\" cy=\"40\" rx=\"18\" ry=\"12\" transform=\"rotate(-8 30 40)\" />\n {tall ? <circle cx=\"45\" cy=\"12\" r=\"5.5\" /> : <circle cx=\"44\" cy=\"21\" r=\"9\" />}\n <path d=\"M20 40 Q29 31 40 39\" />\n <path d=\"M26 52 L25 61 M34 52 L35 61\" />\n <path d={BIRD_FEATURES[bird]} />\n {owl ? <circle cx=\"47\" cy=\"19\" r=\"4\" /> : null}\n <circle cx={tall ? 46.5 : 47} cy={tall ? 11 : 19} r=\"1.6\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** A doodle: an arrow, a circled word, a star, a wavy underline or a bird's sketch, in the margin ink. Decoration unless it has a `label`. */\nexport function Doodle({ kind, children, word, side = \"left\", place = \"margin\", top, seed = \"\", bird = \"duck\", flip = false, label, className, style, ...props }: Readonly<DoodleProps>) {\n const wraps = children != null && (kind === \"circle\" || kind === \"wave\");\n const said = !wraps && Boolean(label);\n return (\n <span\n className={cn(\"kz-doodle\", className)}\n data-kind={kind}\n data-side={side}\n data-place={wraps ? \"inline\" : place}\n data-wrap={wraps ? \"\" : undefined}\n data-flip={flip ? \"\" : undefined}\n role={said ? \"img\" : undefined}\n aria-label={said ? label : undefined}\n aria-hidden={wraps || said ? undefined : true}\n style={{ ...style, [\"--kz-doodle-tilt\" as string]: `${Math.round(seedUnit(`${kind}${seed}`) * 80) / 10}deg`, ...(top ? { [\"--kz-doodle-top\" as string]: top } : {}) }}\n {...props}\n >\n {wraps ? (\n <>\n <span className=\"kz-doodle-word\">{children}</span>\n <span className=\"kz-doodle-ink\" aria-hidden>\n <svg viewBox={WRAPS[kind as \"circle\" | \"wave\"].box} preserveAspectRatio=\"none\" focusable=\"false\">\n <path d={WRAPS[kind as \"circle\" | \"wave\"].d} vectorEffect=\"non-scaling-stroke\" />\n </svg>\n </span>\n </>\n ) : kind === \"bird\" ? (\n <BirdSketch bird={bird} />\n ) : (\n <svg viewBox={PATHS[kind].box} focusable=\"false\">\n {PATHS[kind].d.map((path) => (\n <path key={path} d={path} />\n ))}\n </svg>\n )}\n {!wraps && kind === \"circle\" && word ? <span className=\"kz-doodle-word\">{word}</span> : null}\n </span>\n );\n}\n"],"mappings":";;;;;;;;AAgEI,SA+BI,UA9BF,KADF;AA1BJ,IAAM,QAA2E;AAAA,EAC/E,OAAO,EAAE,KAAK,aAAa,GAAG,CAAC,6BAA6B,sBAAsB,EAAE;AAAA,EACpF,QAAQ,EAAE,KAAK,aAAa,GAAG,CAAC,oEAAoE,EAAE;AAAA,EACtG,MAAM,EAAE,KAAK,aAAa,GAAG,CAAC,uEAAuE,EAAE;AAAA,EACvG,MAAM,EAAE,KAAK,aAAa,GAAG,CAAC,sCAAsC,EAAE;AACxE;AAGA,IAAM,QAA+D;AAAA,EACnE,QAAQ,EAAE,KAAK,cAAc,GAAG,4FAA4F;AAAA,EAC5H,MAAM,EAAE,KAAK,cAAc,GAAG,2DAA2D;AAC3F;AAGA,IAAM,gBAA4C;AAAA,EAChD,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AACV;AAEA,SAAS,WAAW,EAAE,KAAK,GAAmC;AAC5D,QAAM,MAAM,SAAS;AACrB,QAAM,OAAO,SAAS;AACtB,SACE,qBAAC,SAAI,SAAQ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IAAI,EAAE,OAAO,GAAI,MAAM,EAAE,CAAC,iBAA2B,GAAG,IAAI,IAAI,CAAC,EAAG;AAAA,MACnK,GAAG;AAAA,MAEH;AAAA,gBACC,iCACE;AAAA,8BAAC,UAAK,WAAU,kBAAkB,UAAS;AAAA,UAC3C,oBAAC,UAAK,WAAU,iBAAgB,eAAW,MACzC,8BAAC,SAAI,SAAS,MAAM,IAAyB,EAAE,KAAK,qBAAoB,QAAO,WAAU,SACvF,8BAAC,UAAK,GAAG,MAAM,IAAyB,EAAE,GAAG,cAAa,sBAAqB,GACjF,GACF;AAAA,WACF,IACE,SAAS,SACX,oBAAC,cAAW,MAAY,IAExB,oBAAC,SAAI,SAAS,MAAM,IAAI,EAAE,KAAK,WAAU,SACtC,gBAAM,IAAI,EAAE,EAAE,IAAI,CAAC,SAClB,oBAAC,UAAgB,GAAG,QAAT,IAAe,CAC3B,GACH;AAAA,QAED,CAAC,SAAS,SAAS,YAAY,OAAO,oBAAC,UAAK,WAAU,kBAAkB,gBAAK,IAAU;AAAA;AAAA;AAAA,EAC1F;AAEJ;","names":[]}
@@ -34,7 +34,7 @@ type DropOverlayProps = Omit<React.ComponentProps<"div">, "children" | "onDrop">
34
34
  onFiles: (accepted: File[], rejected: File[]) => void;
35
35
  });
36
36
  /** Drag a file anywhere on the page: a full-window overlay accepts it. */
37
- declare function DropOverlay({ label, hint, onFiles, accept, disabled, active: controlled, className, ...props }: DropOverlayProps): React.JSX.Element | null;
37
+ declare function DropOverlay({ label, hint, onFiles, accept, disabled, active: controlled, className, ...props }: Readonly<DropOverlayProps>): React.JSX.Element | null;
38
38
 
39
39
  export { DropOverlay, dragHasFiles, splitDropped };
40
40
  export type { AcceptRule, DropOverlayProps, DropSplit };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cn
3
- } from "./chunk-S6NYGOJT.js";
3
+ } from "./chunk-22IORLB5.js";
4
4
 
5
5
  // src/drop-overlay/drop-overlay.tsx
6
6
  import * as React from "react";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/drop-overlay/drop-overlay.tsx","../src/drop-overlay/files.ts"],"sourcesContent":["// Client (window listeners). The whole window is the drop target: while files are dragged over the page a full-window overlay\n// says so, and the dropped files go to `onFiles` (accepted, rejected). No dashed box in the page; the product keeps a real\n// file input behind its primary action for the keyboard and for phones. Motion: motion.css (« DROP OVERLAY »).\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type AcceptRule, dragHasFiles, splitDropped } from \"./files\";\n\nexport type DropOverlayProps = Omit<React.ComponentProps<\"div\">, \"children\" | \"onDrop\"> & {\n /** What the overlay says (“Drop to check”) — passed translated. */\n label: string;\n /** One line under it (“PDF or text”). */\n hint?: string;\n /** What is accepted: MIME types, families (`image/*`) or extensions (`.pdf`). */\n accept?: readonly AcceptRule[];\n /** Turns the window back into a plain page (while a modal is open, signed out). */\n disabled?: boolean;\n} & (\n | {\n /** Controlled form (a desktop app's native drops, which arrive as paths): shown while true, the DOM listeners are off. */\n active: boolean;\n /** Not called in the controlled form. */\n onFiles?: (accepted: File[], rejected: File[]) => void;\n }\n | {\n /** Leave undefined to handle DOM drops. */\n active?: undefined;\n /** The files dropped: the accepted ones, then the ones `accept` refused. */\n onFiles: (accepted: File[], rejected: File[]) => void;\n }\n);\n\n/** Drag a file anywhere on the page: a full-window overlay accepts it. */\nexport function DropOverlay({\n label,\n hint,\n onFiles,\n accept,\n disabled,\n active: controlled,\n className,\n ...props\n}: DropOverlayProps) {\n const isControlled = controlled !== undefined;\n const [dragging, setActive] = React.useState(false);\n const depth = React.useRef(0);\n const latest = React.useRef({ onFiles, accept });\n React.useEffect(() => {\n latest.current = { onFiles, accept };\n });\n\n React.useEffect(() => {\n if (disabled || isControlled) return;\n const reset = () => {\n depth.current = 0;\n setActive(false);\n };\n const carrying = (event: Event) => dragHasFiles((event as DragEvent).dataTransfer);\n const enter = (event: Event) => {\n if (!carrying(event)) return;\n depth.current += 1;\n setActive(true);\n };\n const over = (event: Event) => {\n if (carrying(event)) event.preventDefault();\n };\n const leave = (event: Event) => {\n if (!carrying(event)) return;\n depth.current = Math.max(0, depth.current - 1);\n if (depth.current === 0) setActive(false);\n };\n const drop = (event: Event) => {\n if (!carrying(event)) return;\n event.preventDefault();\n const files = Array.from((event as DragEvent).dataTransfer?.files ?? []);\n reset();\n const { accepted, rejected } = splitDropped(files, latest.current.accept);\n latest.current.onFiles?.(accepted, rejected);\n };\n globalThis.addEventListener(\"dragenter\", enter);\n globalThis.addEventListener(\"dragover\", over);\n globalThis.addEventListener(\"dragleave\", leave);\n globalThis.addEventListener(\"drop\", drop);\n return () => {\n globalThis.removeEventListener(\"dragenter\", enter);\n globalThis.removeEventListener(\"dragover\", over);\n globalThis.removeEventListener(\"dragleave\", leave);\n globalThis.removeEventListener(\"drop\", drop);\n reset();\n };\n }, [disabled, isControlled]);\n\n if (!(isControlled ? controlled && !disabled : dragging)) return null;\n return (\n <div role=\"status\" data-state=\"open\" className={cn(\"kz-drop-overlay\", className)} {...props}>\n <div className=\"kz-drop-overlay-card\">\n <span className=\"text-lg font-semibold text-fg\">{label}</span>\n {hint ? <span className=\"text-sm text-fg-secondary\">{hint}</span> : null}\n </div>\n </div>\n );\n}\n","// Headless: what a drag carries and which of the dropped files a product accepts.\n\n/** True while the drag carries files (not text or a link): the only drag that should raise the overlay. */\nexport function dragHasFiles(transfer: { types?: readonly string[] | DOMStringList } | null | undefined): boolean {\n return Array.from(transfer?.types ?? []).includes(\"Files\");\n}\n\n/** One accepted kind: a MIME type (`application/pdf`), a family (`image/*`) or an extension (`.pdf`). */\nexport type AcceptRule = string;\n\nfunction matches(file: Pick<File, \"name\" | \"type\">, rule: AcceptRule): boolean {\n const wanted = rule.trim().toLowerCase();\n if (wanted.startsWith(\".\")) return file.name.toLowerCase().endsWith(wanted);\n if (wanted.endsWith(\"/*\")) return file.type.toLowerCase().startsWith(wanted.slice(0, -1));\n return file.type.toLowerCase() === wanted;\n}\n\nexport interface DropSplit<F> {\n accepted: F[];\n rejected: F[];\n}\n\n/** Splits dropped files by `accept` (no rule: everything is accepted). */\nexport function splitDropped<F extends Pick<File, \"name\" | \"type\">>(files: readonly F[], accept?: readonly AcceptRule[]): DropSplit<F> {\n if (!accept || accept.length === 0) return { accepted: [...files], rejected: [] };\n const accepted: F[] = [];\n const rejected: F[] = [];\n for (const file of files) (accept.some((rule) => matches(file, rule)) ? accepted : rejected).push(file);\n return { accepted, rejected };\n}\n"],"mappings":";;;;;AAGA,YAAY,WAAW;;;ACAhB,SAAS,aAAa,UAAqF;AAChH,SAAO,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC,EAAE,SAAS,OAAO;AAC3D;AAKA,SAAS,QAAQ,MAAmC,MAA2B;AAC7E,QAAM,SAAS,KAAK,KAAK,EAAE,YAAY;AACvC,MAAI,OAAO,WAAW,GAAG,EAAG,QAAO,KAAK,KAAK,YAAY,EAAE,SAAS,MAAM;AAC1E,MAAI,OAAO,SAAS,IAAI,EAAG,QAAO,KAAK,KAAK,YAAY,EAAE,WAAW,OAAO,MAAM,GAAG,EAAE,CAAC;AACxF,SAAO,KAAK,KAAK,YAAY,MAAM;AACrC;AAQO,SAAS,aAAoD,OAAqB,QAA8C;AACrI,MAAI,CAAC,UAAU,OAAO,WAAW,EAAG,QAAO,EAAE,UAAU,CAAC,GAAG,KAAK,GAAG,UAAU,CAAC,EAAE;AAChF,QAAM,WAAgB,CAAC;AACvB,QAAM,WAAgB,CAAC;AACvB,aAAW,QAAQ,MAAO,EAAC,OAAO,KAAK,CAAC,SAAS,QAAQ,MAAM,IAAI,CAAC,IAAI,WAAW,UAAU,KAAK,IAAI;AACtG,SAAO,EAAE,UAAU,SAAS;AAC9B;;;ADkEM,SACE,KADF;AA9DC,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAAqB;AACnB,QAAM,eAAe,eAAe;AACpC,QAAM,CAAC,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YAAY,IAAI;AAC/C,iBAAW,oBAAoB,aAAa,KAAK;AACjD,iBAAW,oBAAoB,QAAQ,IAAI;AAC3C,YAAM;AAAA,IACR;AAAA,EACF,GAAG,CAAC,UAAU,YAAY,CAAC;AAE3B,MAAI,EAAE,eAAe,cAAc,CAAC,WAAW,UAAW,QAAO;AACjE,SACE,oBAAC,SAAI,MAAK,UAAS,cAAW,QAAO,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OACpF,+BAAC,SAAI,WAAU,wBACb;AAAA,wBAAC,UAAK,WAAU,iCAAiC,iBAAM;AAAA,IACtD,OAAO,oBAAC,UAAK,WAAU,6BAA6B,gBAAK,IAAU;AAAA,KACtE,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/drop-overlay/drop-overlay.tsx","../src/drop-overlay/files.ts"],"sourcesContent":["// Client (window listeners). The whole window is the drop target: while files are dragged over the page a full-window overlay\n// says so, and the dropped files go to `onFiles` (accepted, rejected). No dashed box in the page; the product keeps a real\n// file input behind its primary action for the keyboard and for phones. Motion: motion.css (« DROP OVERLAY »).\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type AcceptRule, dragHasFiles, splitDropped } from \"./files\";\n\nexport type DropOverlayProps = Omit<React.ComponentProps<\"div\">, \"children\" | \"onDrop\"> & {\n /** What the overlay says (“Drop to check”) — passed translated. */\n label: string;\n /** One line under it (“PDF or text”). */\n hint?: string;\n /** What is accepted: MIME types, families (`image/*`) or extensions (`.pdf`). */\n accept?: readonly AcceptRule[];\n /** Turns the window back into a plain page (while a modal is open, signed out). */\n disabled?: boolean;\n} & (\n | {\n /** Controlled form (a desktop app's native drops, which arrive as paths): shown while true, the DOM listeners are off. */\n active: boolean;\n /** Not called in the controlled form. */\n onFiles?: (accepted: File[], rejected: File[]) => void;\n }\n | {\n /** Leave undefined to handle DOM drops. */\n active?: undefined;\n /** The files dropped: the accepted ones, then the ones `accept` refused. */\n onFiles: (accepted: File[], rejected: File[]) => void;\n }\n);\n\n/** Drag a file anywhere on the page: a full-window overlay accepts it. */\nexport function DropOverlay({\n label,\n hint,\n onFiles,\n accept,\n disabled,\n active: controlled,\n className,\n ...props\n}: Readonly<DropOverlayProps>) {\n const isControlled = controlled !== undefined;\n const [dragging, setActive] = React.useState(false);\n const depth = React.useRef(0);\n const latest = React.useRef({ onFiles, accept });\n React.useEffect(() => {\n latest.current = { onFiles, accept };\n });\n\n React.useEffect(() => {\n if (disabled || isControlled) return;\n const reset = () => {\n depth.current = 0;\n setActive(false);\n };\n const carrying = (event: Event) => dragHasFiles((event as DragEvent).dataTransfer);\n const enter = (event: Event) => {\n if (!carrying(event)) return;\n depth.current += 1;\n setActive(true);\n };\n const over = (event: Event) => {\n if (carrying(event)) event.preventDefault();\n };\n const leave = (event: Event) => {\n if (!carrying(event)) return;\n depth.current = Math.max(0, depth.current - 1);\n if (depth.current === 0) setActive(false);\n };\n const drop = (event: Event) => {\n if (!carrying(event)) return;\n event.preventDefault();\n const files = Array.from((event as DragEvent).dataTransfer?.files ?? []);\n reset();\n const { accepted, rejected } = splitDropped(files, latest.current.accept);\n latest.current.onFiles?.(accepted, rejected);\n };\n globalThis.addEventListener(\"dragenter\", enter);\n globalThis.addEventListener(\"dragover\", over);\n globalThis.addEventListener(\"dragleave\", leave);\n globalThis.addEventListener(\"drop\", drop);\n return () => {\n globalThis.removeEventListener(\"dragenter\", enter);\n globalThis.removeEventListener(\"dragover\", over);\n globalThis.removeEventListener(\"dragleave\", leave);\n globalThis.removeEventListener(\"drop\", drop);\n reset();\n };\n }, [disabled, isControlled]);\n\n if (!(isControlled ? controlled && !disabled : dragging)) return null;\n return (\n <div role=\"status\" data-state=\"open\" className={cn(\"kz-drop-overlay\", className)} {...props}>\n <div className=\"kz-drop-overlay-card\">\n <span className=\"text-lg font-semibold text-fg\">{label}</span>\n {hint ? <span className=\"text-sm text-fg-secondary\">{hint}</span> : null}\n </div>\n </div>\n );\n}\n","// Headless: what a drag carries and which of the dropped files a product accepts.\n\n/** True while the drag carries files (not text or a link): the only drag that should raise the overlay. */\nexport function dragHasFiles(transfer: { types?: readonly string[] | DOMStringList } | null | undefined): boolean {\n return Array.from(transfer?.types ?? []).includes(\"Files\");\n}\n\n/** One accepted kind: a MIME type (`application/pdf`), a family (`image/*`) or an extension (`.pdf`). */\nexport type AcceptRule = string;\n\nfunction matches(file: Pick<File, \"name\" | \"type\">, rule: AcceptRule): boolean {\n const wanted = rule.trim().toLowerCase();\n if (wanted.startsWith(\".\")) return file.name.toLowerCase().endsWith(wanted);\n if (wanted.endsWith(\"/*\")) return file.type.toLowerCase().startsWith(wanted.slice(0, -1));\n return file.type.toLowerCase() === wanted;\n}\n\nexport interface DropSplit<F> {\n accepted: F[];\n rejected: F[];\n}\n\n/** Splits dropped files by `accept` (no rule: everything is accepted). */\nexport function splitDropped<F extends Pick<File, \"name\" | \"type\">>(files: readonly F[], accept?: readonly AcceptRule[]): DropSplit<F> {\n if (!accept || accept.length === 0) return { accepted: [...files], rejected: [] };\n const accepted: F[] = [];\n const rejected: F[] = [];\n for (const file of files) (accept.some((rule) => matches(file, rule)) ? accepted : rejected).push(file);\n return { accepted, rejected };\n}\n"],"mappings":";;;;;AAGA,YAAY,WAAW;;;ACAhB,SAAS,aAAa,UAAqF;AAChH,SAAO,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC,EAAE,SAAS,OAAO;AAC3D;AAKA,SAAS,QAAQ,MAAmC,MAA2B;AAC7E,QAAM,SAAS,KAAK,KAAK,EAAE,YAAY;AACvC,MAAI,OAAO,WAAW,GAAG,EAAG,QAAO,KAAK,KAAK,YAAY,EAAE,SAAS,MAAM;AAC1E,MAAI,OAAO,SAAS,IAAI,EAAG,QAAO,KAAK,KAAK,YAAY,EAAE,WAAW,OAAO,MAAM,GAAG,EAAE,CAAC;AACxF,SAAO,KAAK,KAAK,YAAY,MAAM;AACrC;AAQO,SAAS,aAAoD,OAAqB,QAA8C;AACrI,MAAI,CAAC,UAAU,OAAO,WAAW,EAA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iB;AAC7B,UAAI,CAAC,SAAS,KAAK,EAAG;AACtB,YAAM,eAAe;AACrB,YAAM,QAAQ,MAAM,KAAM,MAAoB,cAAc,SAAS,CAAC,CAAC;AACvE,YAAM;AACN,YAAM,EAAE,UAAU,SAAS,IAAI,aAAa,OAAO,OAAO,QAAQ,MAAM;AACxE,aAAO,QAAQ,UAAU,UAAU,QAAQ;AAAA,IAC7C;AACA,eAAW,iBAAiB,aAAa,KAAK;AAC9C,eAAW,iBAAiB,YAAY,IAAI;AAC5C,eAAW,iBAAiB,aAAa,KAAK;AAC9C,eAAW,iBAAiB,QAAQ,IAAI;AACxC,WAAO,MAAM;AACX,iBAAW,oBAAoB,aAAa,KAAK;AACjD,iBAAW,oBAAoB,YAAY,IAAI;AAC/C,iBAAW,oBAAoB,aAAa,KAAK;AACjD,iBAAW,oBAAoB,QAAQ,IAAI;AAC3C,YAAM;AAAA,IACR;AAAA,EACF,GAAG,CAAC,UAAU,YAAY,CAAC;AAE3B,MAAI,EAAE,eAAe,cAAc,CAAC,WAAW,UAAW,QAAO;AACjE,SACE,oBAAC,SAAI,MAAK,UAAS,cAAW,QAAO,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OACpF,+BAAC,SAAI,WAAU,wBACb;AAAA,wBAAC,UAAK,WAAU,iCAAiC,iBAAM;AAAA,IACtD,OAAO,oBAAC,UAAK,WAAU,6BAA6B,gBAAK,IAAU;AAAA,KACtE,GACF;AAEJ;","names":[]}
@@ -46,23 +46,23 @@ type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenu$1.Conte
46
46
  /** The element the portal renders into (default: document.body). */
47
47
  container?: HTMLElement | null;
48
48
  };
49
- declare function DropdownMenuContent({ sideOffset, align, collisionPadding, container, className, ...props }: DropdownMenuContentProps): React.JSX.Element;
49
+ declare function DropdownMenuContent({ sideOffset, align, collisionPadding, container, className, ...props }: Readonly<DropdownMenuContentProps>): React.JSX.Element;
50
50
  type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenu$1.Item> & {
51
51
  /** `danger` for a destructive action: the icon and the highlight carry the danger, the label stays legible. */
52
52
  tone?: "default" | "danger";
53
53
  };
54
54
  /** An action. `tone="danger"` for a destructive one; `onSelect` runs it (the menu closes). */
55
- declare function DropdownMenuItem({ tone, className, ...props }: DropdownMenuItemProps): React.JSX.Element;
55
+ declare function DropdownMenuItem({ tone, className, ...props }: Readonly<DropdownMenuItemProps>): React.JSX.Element;
56
56
  /** A toggled option: `checked` + `onCheckedChange`. */
57
- declare function DropdownMenuCheckboxItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>): React.JSX.Element;
57
+ declare function DropdownMenuCheckboxItem({ className, children, ...props }: Readonly<React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>>): React.JSX.Element;
58
58
  /** A submenu's trigger: an item that opens `DropdownMenu.SubContent`, with a chevron. */
59
- declare function DropdownMenuSubTrigger({ className, children, ...props }: React.ComponentProps<typeof DropdownMenu$1.SubTrigger>): React.JSX.Element;
59
+ declare function DropdownMenuSubTrigger({ className, children, ...props }: Readonly<React.ComponentProps<typeof DropdownMenu$1.SubTrigger>>): React.JSX.Element;
60
60
  /** The submenu's panel (same material as the menu). */
61
- declare function DropdownMenuSubContent({ sideOffset, collisionPadding, className, ...props }: React.ComponentProps<typeof DropdownMenu$1.SubContent>): React.JSX.Element;
61
+ declare function DropdownMenuSubContent({ sideOffset, collisionPadding, className, ...props }: Readonly<React.ComponentProps<typeof DropdownMenu$1.SubContent>>): React.JSX.Element;
62
62
  /** One choice among several (`DropdownMenu.RadioGroup` holds the value): a language, a sort order. */
63
- declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenu$1.RadioItem>): React.JSX.Element;
64
- declare function DropdownMenuLabel({ className, ...props }: React.ComponentProps<typeof DropdownMenu$1.Label>): React.JSX.Element;
65
- declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenu$1.Separator>): React.JSX.Element;
63
+ declare function DropdownMenuRadioItem({ className, children, ...props }: Readonly<React.ComponentProps<typeof DropdownMenu$1.RadioItem>>): React.JSX.Element;
64
+ declare function DropdownMenuLabel({ className, ...props }: Readonly<React.ComponentProps<typeof DropdownMenu$1.Label>>): React.JSX.Element;
65
+ declare function DropdownMenuSeparator({ className, ...props }: Readonly<React.ComponentProps<typeof DropdownMenu$1.Separator>>): React.JSX.Element;
66
66
  /** `DropdownMenu.Root/Trigger/Content/Item/CheckboxItem/Label/Separator/Group`. `open`/`defaultOpen` + `onOpenChange`. */
67
67
  declare const DropdownMenu: {
68
68
  Root: React.FC<DropdownMenu$1.DropdownMenuProps>;
@@ -10,9 +10,9 @@ import {
10
10
  DropdownMenuSubContent,
11
11
  DropdownMenuSubTrigger,
12
12
  menu
13
- } from "./chunk-OGWB76BR.js";
13
+ } from "./chunk-3CEMOJBL.js";
14
14
  import "./chunk-J3NC6ER4.js";
15
- import "./chunk-NSLXEDIS.js";
15
+ import "./chunk-HHBTM4AU.js";
16
16
  export {
17
17
  DropdownMenu,
18
18
  DropdownMenuCheckboxItem,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  cn
4
- } from "./chunk-NSLXEDIS.js";
4
+ } from "./chunk-HHBTM4AU.js";
5
5
 
6
6
  // src/embed-facade/embed-facade.tsx
7
7
  import * as React from "react";
@@ -60,7 +60,7 @@ type EmptyStateProps = Omit<React.ComponentProps<"div">, "title"> & {
60
60
  /** What to do next: a Button, a link. */
61
61
  action?: React.ReactNode;
62
62
  };
63
- declare function EmptyState({ icon, title, description, action, className, ...props }: EmptyStateProps): React.JSX.Element;
63
+ declare function EmptyState({ icon, title, description, action, className, ...props }: Readonly<EmptyStateProps>): React.JSX.Element;
64
64
 
65
65
  export { EmptyState, emptyState };
66
66
  export type { EmptyStateProps };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/empty-state/empty-state.tsx"],"sourcesContent":["// Server-safe. What a list, a search or a panel says when it has nothing to show — every word is a prop.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const emptyState = tv({\n slots: {\n root: \"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border-default px-6 py-10 text-center\",\n icon: \"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-fg-secondary [&>svg]:h-6 [&>svg]:w-6\",\n title: \"text-sm font-semibold text-fg\",\n description: \"max-w-sm text-sm text-fg-secondary\",\n action: \"mt-1 flex flex-wrap items-center justify-center gap-2\",\n },\n});\nconst s = emptyState();\n\nexport type EmptyStateProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** A decorative icon (hidden from assistive technology). */\n icon?: React.ReactNode;\n /** What is empty, in a few words (\"No videos yet\"). */\n title: React.ReactNode;\n /** Why, or what will fill it. */\n description?: React.ReactNode;\n /** What to do next: a Button, a link. */\n action?: React.ReactNode;\n};\n\nexport function EmptyState({ icon, title, description, action, className, ...props }: EmptyStateProps) {\n return (\n <div role=\"status\" className={s.root({ className })} {...props}>\n {icon && (\n <div aria-hidden className={s.icon()}>\n {icon}\n </div>\n )}\n <p className={s.title()}>{title}</p>\n {description && <p className={s.description()}>{description}</p>}\n {action && <div className={s.action()}>{action}</div>}\n </div>\n );\n}\n"],"mappings":";AAEA,SAAS,UAAU;AA0Bf,SAEI,KAFJ;AAxBG,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,QAAQ;AAAA,EACV;AACF,CAAC;AACD,IAAM,IAAI,WAAW;AAad,SAAS,WAAW,EAAE,MAAM,OAAO,aAAa,QAAQ,WAAW,GAAG,MAAM,GAAoB;AACrG,SACE,qBAAC,SAAI,MAAK,UAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACtD;AAAA,YACC,oBAAC,SAAI,eAAW,MAAC,WAAW,EAAE,KAAK,GAChC,gBACH;AAAA,IAEF,oBAAC,OAAE,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,IAC/B,eAAe,oBAAC,OAAE,WAAW,EAAE,YAAY,GAAI,uBAAY;AAAA,IAC3D,UAAU,oBAAC,SAAI,WAAW,EAAE,OAAO,GAAI,kBAAO;AAAA,KACjD;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/empty-state/empty-state.tsx"],"sourcesContent":["// Server-safe. What a list, a search or a panel says when it has nothing to show — every word is a prop.\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const emptyState = tv({\n slots: {\n root: \"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border-default px-6 py-10 text-center\",\n icon: \"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-fg-secondary [&>svg]:h-6 [&>svg]:w-6\",\n title: \"text-sm font-semibold text-fg\",\n description: \"max-w-sm text-sm text-fg-secondary\",\n action: \"mt-1 flex flex-wrap items-center justify-center gap-2\",\n },\n});\nconst s = emptyState();\n\nexport type EmptyStateProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** A decorative icon (hidden from assistive technology). */\n icon?: React.ReactNode;\n /** What is empty, in a few words (\"No videos yet\"). */\n title: React.ReactNode;\n /** Why, or what will fill it. */\n description?: React.ReactNode;\n /** What to do next: a Button, a link. */\n action?: React.ReactNode;\n};\n\nexport function EmptyState({ icon, title, description, action, className, ...props }: Readonly<EmptyStateProps>) {\n return (\n <div role=\"status\" className={s.root({ className })} {...props}>\n {icon && (\n <div aria-hidden className={s.icon()}>\n {icon}\n </div>\n )}\n <p className={s.title()}>{title}</p>\n {description && <p className={s.description()}>{description}</p>}\n {action && <div className={s.action()}>{action}</div>}\n </div>\n );\n}\n"],"mappings":";AAEA,SAAS,UAAU;AA0Bf,SAEI,KAFJ;AAxBG,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,QAAQ;AAAA,EACV;AACF,CAAC;AACD,IAAM,IAAI,WAAW;AAad,SAAS,WAAW,EAAE,MAAM,OAAO,aAAa,QAAQ,WAAW,GAAG,MAAM,GAA8B;AAC/G,SACE,qBAAC,SAAI,MAAK,UAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OACtD;AAAA,YACC,oBAAC,SAAI,eAAW,MAAC,WAAW,EAAE,KAAK,GAChC,gBACH;AAAA,IAEF,oBAAC,OAAE,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,IAC/B,eAAe,oBAAC,OAAE,WAAW,EAAE,YAAY,GAAI,uBAAY;AAAA,IAC3D,UAAU,oBAAC,SAAI,WAAW,EAAE,OAAO,GAAI,kBAAO;AAAA,KACjD;AAEJ;","names":[]}
@@ -128,7 +128,7 @@ type FlowEasing = "linear" | "ease-in-out" | (string & {});
128
128
  /** How many photons a conduit of this length carries (evenly spaced, so the gap is `length / count`). */
129
129
  declare function photonCount(length: number, density?: FlowDensity): number;
130
130
  /** An engine at the hub and the apps it serves, with what travels between them. */
131
- declare function EngineFlow({ label, hub, nodes, layout, compactLayout, particles, conduit, hint, defaultActive, speed, density, trigger, easing, stagger, breathe, calm, className, ...props }: EngineFlowProps): React.JSX.Element;
131
+ declare function EngineFlow({ label, hub, nodes, layout, compactLayout, particles, conduit, hint, defaultActive, speed, density, trigger, easing, stagger, breathe, calm, className, ...props }: Readonly<EngineFlowProps>): React.JSX.Element;
132
132
 
133
133
  export { CALM_FLOW, EngineFlow, FLOW_FAN, FLOW_HEIGHT, flowGeometry, flowPositions, photonCount };
134
134
  export type { EngineFlowHub, EngineFlowNode, EngineFlowProps, FlowConduit, FlowDensity, FlowEasing, FlowGeometry, FlowLayout, FlowPoint, FlowTrigger };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  cn
4
- } from "./chunk-NSLXEDIS.js";
4
+ } from "./chunk-HHBTM4AU.js";
5
5
 
6
6
  // src/engine-flow/engine-flow.tsx
7
7
  import * as React from "react";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/engine-flow/engine-flow.tsx","../src/engine-flow/geometry.ts"],"sourcesContent":["// Client (the node a visitor points at or focuses). An engine at the hub and the apps it serves around it: one conduit\n// per app, and photons that travel it — towards the hub (`in`: requests), back (`out`: results) or both — in the app's\n// brand colour going in and the hub's coming back. A planned app is drawn dim, its conduit dashed and still.\n//\n// Motion is the Krizaka signature's (motion.css): CSS animations of `stroke-dashoffset`, no animation frame, no canvas;\n// paused off screen (`data-motion-scope` → MotionObserver's `data-offscreen`), held while the page settles (`kz-loop`),\n// a still frame under reduced motion and Save-Data (the photons rest along their conduit). The stage keeps its aspect ratio and the\n// detail line its height: no layout shift.\n//\n// Anchoring: a conduit runs between the centres of the node's circle and of the hub's ring (the label and the caption hang\n// below them, out of the box), and both circles are opaque and drawn over it — so every conduit meets the circle at the point\n// facing the other end, whatever the layout and the number of nodes.\n//\n// Accessible: the drawing is hidden from assistive technology; every node is a real button named by its label, and the\n// detail line (polite live region) says the chosen node's description with its link. Pair it with a text version (a\n// list) in the page: the figure is a picture of it.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type FlowConduit, flowGeometry, type FlowLayout } from \"./geometry\";\n\nexport interface EngineFlowNode {\n /** A stable id (`verikora`). */\n id: string;\n /** Its name, the button's accessible name (\"Verikora\"). */\n label: string;\n /** Its mark (a `ProductLogo`), decorative. */\n mark?: React.ReactNode;\n /** One line: what it uses the engine for — shown when the node is pointed at or focused. */\n description?: React.ReactNode;\n /** Where it lives (its site). */\n href?: string;\n /** The link's words (\"Visit dev.verikora.com\"); defaults to the label. */\n linkLabel?: React.ReactNode;\n /** Opens the link in a new tab. */\n external?: boolean;\n /** What travels: `in` towards the hub, `out` back from it, `both`.\n * @default \"in\" */\n flow?: \"in\" | \"out\" | \"both\";\n /** Not wired yet: drawn dim, its conduit dashed and still, no photon. */\n planned?: boolean;\n /** A word beside the name in the detail line (\"planned\"), passed translated. */\n status?: React.ReactNode;\n /** Its brand scope (`brand-verikora`): its conduit, photons and ring take its `--kz-accent`. */\n className?: string;\n}\n\nexport interface EngineFlowHub {\n /** The engine's name (\"Sovkora\"). */\n label: string;\n /** Its mark, decorative. */\n mark?: React.ReactNode;\n /** A line under the name (\"the engine\"). */\n caption?: React.ReactNode;\n /** Its brand scope; the photons coming back take its accent. */\n className?: string;\n}\n\nexport type EngineFlowProps = Omit<React.ComponentProps<\"figure\">, \"children\"> & {\n /** What the figure shows (\"Sovkora and the products it powers\"), passed translated. */\n label: string;\n /** The engine, at the hub. */\n hub: EngineFlowHub;\n /** The apps around it. */\n nodes: readonly EngineFlowNode[];\n /** How the nodes sit around the hub.\n * @default \"radial\" */\n layout?: FlowLayout;\n /** The layout under a 560 px wide container (a phone); `false` keeps `layout` everywhere.\n * @default \"top-to-bottom\" */\n compactLayout?: FlowLayout | false;\n /** `photons` travel the conduits; `none` draws them still.\n * @default \"photons\" */\n particles?: \"photons\" | \"none\";\n /** The conduits' shape.\n * @default \"bezier\" */\n conduit?: FlowConduit;\n /** The detail line before a node is chosen (\"Point at a product\"). */\n hint?: React.ReactNode;\n /** The node shown in the detail line at first. */\n defaultActive?: string;\n /** Photon speed, in units per second (the stage is 100 units wide).\n * @default 16 */\n speed?: number;\n /** How many photons share a conduit: `sparse` one or two, `normal` two to four, `dense` four to eight.\n * @default \"normal\" */\n density?: FlowDensity;\n /** When the photons travel: `always`; `hover` only while the pointer or focus is on the figure (they rest along the\n * conduits otherwise); `active` only on the conduit of the chosen node (the others show nothing). Off screen they\n * are always paused, and still under reduced motion.\n * @default \"always\" */\n trigger?: FlowTrigger;\n /** The photons' timing function: `linear` (a steady stream), `ease-in-out` (a pulse that swells and settles), or any\n * CSS `<easing-function>` (`cubic-bezier(.2,0,0,1)`, `steps(6)`).\n * @default \"linear\" */\n easing?: FlowEasing;\n /** Milliseconds between one conduit's photons and the next's: 0 sends them all together.\n * @default 300 */\n stagger?: number;\n /** The engine's mark swells slowly (a loop, still under reduced motion).\n * @default true */\n breathe?: boolean;\n /** The calm level, for a small frame (a tile of a home page): sparse photons at a low rate, a slow breath, no hint and\n * no detail line, nothing to tune. It plays only on screen and once the page has settled, and stays still under\n * reduced motion and Save-Data. Overrides `speed`, `density`, `stagger` and `trigger`.\n * @default false */\n calm?: boolean;\n};\n\n/** The calm level's pace: units per second, photons per conduit, milliseconds between conduits. */\nexport const CALM_FLOW = { speed: 4, density: \"sparse\", stagger: 1200 } as const satisfies { speed: number; density: FlowDensity; stagger: number };\n\nconst subscribeSaveData = (onChange: () => void) => {\n const c = (navigator as Navigator & { connection?: EventTarget }).connection;\n c?.addEventListener?.(\"change\", onChange);\n return () => c?.removeEventListener?.(\"change\", onChange);\n};\nconst readSaveData = () => (navigator as Navigator & { connection?: { saveData?: boolean } }).connection?.saveData === true;\n\n\nexport type FlowDensity = \"sparse\" | \"normal\" | \"dense\";\nexport type FlowTrigger = \"always\" | \"hover\" | \"active\";\nexport type FlowEasing = \"linear\" | \"ease-in-out\" | (string & {});\n\n/** How many photons a conduit of this length carries (evenly spaced, so the gap is `length / count`). */\nexport function photonCount(length: number, density: FlowDensity = \"normal\"): number {\n const base = Math.round(length / 16);\n if (density === \"sparse\") return Math.min(2, Math.max(1, Math.round(base / 2)));\n if (density === \"dense\") return Math.min(8, Math.max(4, base * 2));\n return Math.min(4, Math.max(2, base));\n}\n\nfunction Stage({\n layout,\n variant,\n nodes,\n hub,\n conduit,\n particles,\n speed,\n density,\n easing,\n stagger,\n breathe,\n active,\n onActive,\n detailId,\n}: Readonly<{\n layout: FlowLayout;\n variant: \"wide\" | \"compact\";\n nodes: readonly EngineFlowNode[];\n hub: EngineFlowHub;\n conduit: FlowConduit;\n particles: \"photons\" | \"none\";\n speed: number;\n density: FlowDensity;\n easing: FlowEasing;\n stagger: number;\n breathe: boolean;\n active: string | undefined;\n onActive: (id: string) => void;\n detailId: string | undefined;\n}>) {\n const g = flowGeometry(layout, nodes.length, conduit);\n const pct = (v: number, of: number) => `${((v / of) * 100).toFixed(3)}%`;\n return (\n <div className=\"kz-flow-stage\" data-variant={variant} data-layout={layout} style={{ aspectRatio: `${g.width} / ${g.height}` }}>\n <svg viewBox={`0 0 ${g.width} ${g.height}`} aria-hidden=\"true\" focusable=\"false\">\n {nodes.map((node, i) => {\n const flow = node.flow ?? \"in\";\n const length = g.lengths[i] ?? 0;\n // Photons per conduit (`density`), evenly spaced; the same speed on every conduit.\n const gap = length / photonCount(length, density);\n const period = gap / speed;\n const timing = (dir: \"in\" | \"out\") =>\n ({\n \"--kz-flow-gap\": gap.toFixed(3),\n animationDuration: `${period.toFixed(2)}s`,\n // Each conduit starts `stagger` ms after the previous (a negative delay: already under way); the way back is half a period behind.\n animationDelay: `${(-(((i * stagger) / 1000 + (dir === \"out\" ? period / 2 : 0)) % period)).toFixed(2)}s`,\n ...(easing !== \"linear\" ? { animationTimingFunction: easing } : {}),\n }) as React.CSSProperties;\n const lanes = node.planned || particles === \"none\" ? [] : flow === \"both\" ? ([\"in\", \"out\"] as const) : [flow];\n return (\n <g\n key={node.id}\n className={cn(\"kz-flow-link\", node.className)}\n data-flow={flow}\n data-planned={node.planned ? \"\" : undefined}\n data-active={active === node.id ? \"\" : undefined}\n >\n <path className=\"kz-flow-wire\" d={g.paths[i]} />\n {lanes.map((dir) => (\n <React.Fragment key={dir}>\n <path className=\"kz-flow-photon kz-loop\" data-dir={dir} data-halo=\"\" d={g.paths[i]} style={timing(dir)} />\n <path className=\"kz-flow-photon kz-loop\" data-dir={dir} d={g.paths[i]} style={timing(dir)} />\n </React.Fragment>\n ))}\n </g>\n );\n })}\n </svg>\n <div className={cn(\"kz-flow-hub\", hub.className)} style={{ left: pct(g.hub.x, g.width), top: pct(g.hub.y, g.height) }}>\n {hub.mark ? <span className={cn(\"kz-flow-hub-mark\", breathe && \"kz-loop\")}>{hub.mark}</span> : null}\n <span className=\"kz-flow-hub-text\">\n <span className=\"kz-flow-hub-label\">{hub.label}</span>\n {hub.caption ? <span className=\"kz-flow-hub-caption\">{hub.caption}</span> : null}\n </span>\n </div>\n <ul className=\"kz-flow-nodes\">\n {nodes.map((node, i) => {\n const p = g.nodes[i]!;\n const on = active === node.id;\n return (\n <li key={node.id} style={{ left: pct(p.x, g.width), top: pct(p.y, g.height) }}>\n <button\n type=\"button\"\n className={cn(\"kz-flow-node\", node.className)}\n data-active={on ? \"\" : undefined}\n data-planned={node.planned ? \"\" : undefined}\n aria-pressed={on}\n aria-controls={detailId}\n onPointerEnter={() => onActive(node.id)}\n onFocus={() => onActive(node.id)}\n onClick={() => onActive(node.id)}\n >\n {node.mark ? (\n <span className=\"kz-flow-node-mark\" aria-hidden=\"true\">\n {node.mark}\n </span>\n ) : null}\n <span className=\"kz-flow-node-label\">{node.label}</span>\n </button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n\ntype FlowDataInput = { chosen: boolean; calm: boolean; saveData: boolean; trigger: string; density: string; compact: boolean };\n\n/** The figure's data attributes: the CSS reads the state from them. */\nfunction flowData({ chosen, calm, saveData, trigger, density, compact }: FlowDataInput) {\n let dataDensity: string | undefined = density === \"normal\" ? undefined : density;\n if (calm) dataDensity = \"sparse\";\n return {\n \"data-active\": chosen ? \"\" : undefined,\n \"data-calm\": calm ? \"\" : undefined,\n \"data-still\": saveData ? \"\" : undefined,\n \"data-trigger\": calm || trigger === \"always\" ? undefined : trigger,\n \"data-density\": dataDensity,\n \"data-compact\": compact ? \"\" : undefined,\n };\n}\n\n/** What the chosen node says, or the hint when none is chosen. */\nfunction FlowDetail({ id, chosen, hint }: Readonly<{ id: string; chosen: EngineFlowNode | undefined; hint: React.ReactNode }>) {\n return (\n <figcaption id={id} className={cn(\"kz-flow-detail\", chosen?.className)} aria-live=\"polite\">\n {chosen ? (\n <>\n <strong>{chosen.label}</strong>\n {chosen.status ? <span className=\"kz-flow-status\">{chosen.status}</span> : null}\n {chosen.description ? <span> {chosen.description}</span> : null}\n {chosen.href ? (\n <>\n {\" \"}\n <a href={chosen.href} {...(chosen.external ? { target: \"_blank\", rel: \"noopener\" } : {})}>\n {chosen.linkLabel ?? chosen.label}\n <span aria-hidden=\"true\"> →</span>\n </a>\n </>\n ) : null}\n </>\n ) : (\n hint\n )}\n </figcaption>\n );\n}\n\n/** An engine at the hub and the apps it serves, with what travels between them. */\nexport function EngineFlow({\n label,\n hub,\n nodes,\n layout = \"radial\",\n compactLayout = \"top-to-bottom\",\n particles = \"photons\",\n conduit = \"bezier\",\n hint,\n defaultActive,\n speed = 16,\n density = \"normal\",\n trigger = \"always\",\n easing = \"linear\",\n stagger = 300,\n breathe = true,\n calm = false,\n className,\n ...props\n}: EngineFlowProps) {\n const [active, setActive] = React.useState<string | undefined>(defaultActive);\n const detailId = `${React.useId()}-detail`;\n const chosen = nodes.find((n) => n.id === active);\n const compact = compactLayout && compactLayout !== layout ? compactLayout : undefined;\n // Save-Data: the calm and the full levels both rest (a still frame, like reduced motion).\n const saveData = React.useSyncExternalStore(subscribeSaveData, readSaveData, () => false);\n const pace = calm ? CALM_FLOW : { speed: Math.max(1, speed), density, stagger: Math.max(0, stagger) };\n const stage = { nodes, hub, conduit, particles, ...pace, easing, breathe, active, onActive: setActive, detailId: calm ? undefined : detailId };\n return (\n <figure\n aria-label={label}\n className={cn(\"kz-flow\", className)}\n data-motion-scope=\"\"\n {...flowData({ chosen: Boolean(chosen), calm, saveData, trigger, density, compact: Boolean(compact) })}\n {...props}\n >\n <Stage layout={layout} variant=\"wide\" {...stage} />\n {compact ? <Stage layout={compact} variant=\"compact\" {...stage} /> : null}\n {calm ? null : <FlowDetail id={detailId} chosen={chosen} hint={hint} />}\n </figure>\n );\n}\n","// Server-safe, pure. The geometry of EngineFlow: where the hub and the nodes sit in a box 100 units wide, and the\n// conduit from each node to the hub (an SVG path drawn node → hub, and its length, so photons travel at one speed on\n// every conduit). No DOM: the same numbers on the server and in the browser.\n\n/** How the nodes are placed around the hub. */\nexport type FlowLayout = \"radial\" | \"top-to-bottom\" | \"left-to-right\";\n/** The shape of a conduit: an S-shaped cubic Bézier, or a straight line. */\nexport type FlowConduit = \"bezier\" | \"straight\";\n\nexport interface FlowPoint {\n x: number;\n y: number;\n}\n\nexport interface FlowGeometry {\n /** The box: 100 units wide, `height` units high (the stage keeps this aspect ratio, so nothing is distorted). */\n width: number;\n height: number;\n hub: FlowPoint;\n nodes: FlowPoint[];\n /** One path per node, from the node to the hub. */\n paths: string[];\n /** The length of each path, in units. */\n lengths: number[];\n}\n\n/** The box height per layout (the width is always 100). */\nexport const FLOW_HEIGHT: Record<FlowLayout, number> = { radial: 60, \"top-to-bottom\": 92, \"left-to-right\": 56 };\n\n/** How far a conduit lands from the hub's centre along the row, as a share of its node's offset: a small fan, kept inside the ring. */\nexport const FLOW_FAN = 0.1;\n\nconst r2 = (n: number) => Math.round(n * 100) / 100;\nconst pt = (p: FlowPoint) => `${r2(p.x)} ${r2(p.y)}`;\n\nfunction cubicLength(a: FlowPoint, b: FlowPoint, c: FlowPoint, d: FlowPoint): number {\n let length = 0;\n let prev = a;\n for (let i = 1; i <= 32; i++) {\n const t = i / 32;\n const u = 1 - t;\n const p = {\n x: u * u * u * a.x + 3 * u * u * t * b.x + 3 * u * t * t * c.x + t * t * t * d.x,\n y: u * u * u * a.y + 3 * u * u * t * b.y + 3 * u * t * t * c.y + t * t * t * d.y,\n };\n length += Math.hypot(p.x - prev.x, p.y - prev.y);\n prev = p;\n }\n return length;\n}\n\n/** The positions of `count` nodes around the hub. */\nexport function flowPositions(layout: FlowLayout, count: number): { hub: FlowPoint; nodes: FlowPoint[] } {\n const height = FLOW_HEIGHT[layout];\n const n = Math.max(0, count);\n if (layout === \"top-to-bottom\") {\n return { hub: { x: 50, y: 72 }, nodes: Array.from({ length: n }, (_, i) => ({ x: ((i + 0.5) * 100) / n, y: 13 })) };\n }\n if (layout === \"left-to-right\") {\n return { hub: { x: 80, y: height / 2 }, nodes: Array.from({ length: n }, (_, i) => ({ x: 12, y: ((i + 0.5) * height) / n })) };\n }\n // Radial: on an ellipse around the centre; an even count puts two nodes level with the hub (more room for labels).\n const hub = { x: 50, y: height / 2 };\n const start = n % 2 === 0 ? -90 + 180 / Math.max(n, 1) : -90;\n return {\n hub,\n nodes: Array.from({ length: n }, (_, i) => {\n const a = ((start + (360 / n) * i) * Math.PI) / 180;\n return { x: hub.x + 37 * Math.cos(a), y: hub.y + 20 * Math.sin(a) };\n }),\n };\n}\n\n/** The whole geometry of a flow: positions, conduits (node → hub) and their lengths. */\nexport function flowGeometry(layout: FlowLayout, count: number, conduit: FlowConduit = \"bezier\"): FlowGeometry {\n const { hub, nodes } = flowPositions(layout, count);\n const paths: string[] = [];\n const lengths: number[] = [];\n for (const p of nodes) {\n // Each conduit lands on its own point of the hub (a fan), so the lines stay apart where they meet.\n let end: FlowPoint;\n if (layout === \"top-to-bottom\") end = { x: hub.x + (p.x - hub.x) * FLOW_FAN, y: hub.y };\n else if (layout === \"left-to-right\") end = { x: hub.x, y: hub.y + (p.y - hub.y) * FLOW_FAN };\n else end = hub;\n if (conduit === \"straight\") {\n paths.push(`M${pt(p)} L${pt(end)}`);\n lengths.push(Math.hypot(end.x - p.x, end.y - p.y));\n continue;\n }\n let c1: FlowPoint;\n let c2: FlowPoint;\n if (layout === \"top-to-bottom\") {\n const mid = (p.y + end.y) / 2;\n c1 = { x: p.x, y: mid };\n c2 = { x: end.x, y: mid };\n } else if (layout === \"left-to-right\") {\n const mid = (p.x + end.x) / 2;\n c1 = { x: mid, y: p.y };\n c2 = { x: mid, y: end.y };\n } else {\n // An S: leave the node bending one way, reach the hub bending the other.\n const dx = end.x - p.x;\n const dy = end.y - p.y;\n const len = Math.hypot(dx, dy) || 1;\n const k = 0.14 * len;\n const nx = -dy / len;\n const ny = dx / len;\n c1 = { x: p.x + dx * 0.35 + nx * k, y: p.y + dy * 0.35 + ny * k };\n c2 = { x: p.x + dx * 0.65 - nx * k, y: p.y + dy * 0.65 - ny * k };\n }\n paths.push(`M${pt(p)} C${pt(c1)} ${pt(c2)} ${pt(end)}`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CAAC;AACjC,QAAM,SAAS,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM;AAChD,QAAM,UAAU,iBAAiB,kBAAkB,SAAS,gBAAgB;AAE5E,QAAM,WAAiB,2BAAqB,mBAAmB,cAAc,MAAM,KAAK;AACxF,QAAM,OAAO,OAAO,YAAY,EAAE,OAAO,KAAK,IAAI,GAAG,KAAK,GAAG,SAAS,SAAS,KAAK,IAAI,GAAG,OAAO,EAAE;AACpG,QAAM,QAAQ,EAAE,OAAO,KAAK,SAAS,WAAW,GAAG,MAAM,QAAQ,SAAS,QAAQ,UAAU,WAAW,UAAU,OAAO,SAAY,SAAS;AAC7I,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ,WAAW,GAAG,WAAW,SAAS;AAAA,MAClC,qBAAkB;AAAA,MACjB,GAAG,SAAS,EAAE,QAAQ,QAAQ,MAAM,GAAG,MAAM,UAAU,SAAS,SAAS,SAAS,QAAQ,OAAO,EAAE,CAAC;AAAA,MACpG,GAAG;AAAA,MAEJ;AAAA,4BAAC,SAAM,QAAgB,SAAQ,QAAQ,GAAG,OAAO;AAAA,QAChD,UAAU,oBAAC,SAAM,QAAQ,SAAS,SAAQ,WAAW,GAAG,OAAO,IAAK;AAAA,QACpE,OAAO,OAAO,oBAAC,cAAW,IAAI,UAAU,QAAgB,MAAY;AAAA;AAAA;AAAA,EACvE;AAEJ;","names":["Fragment"]}
1
+ {"version":3,"sources":["../src/engine-flow/engine-flow.tsx","../src/engine-flow/geometry.ts"],"sourcesContent":["// Client (the node a visitor points at or focuses). An engine at the hub and the apps it serves around it: one conduit\n// per app, and photons that travel it — towards the hub (`in`: requests), back (`out`: results) or both — in the app's\n// brand colour going in and the hub's coming back. A planned app is drawn dim, its conduit dashed and still.\n//\n// Motion is the Krizaka signature's (motion.css): CSS animations of `stroke-dashoffset`, no animation frame, no canvas;\n// paused off screen (`data-motion-scope` → MotionObserver's `data-offscreen`), held while the page settles (`kz-loop`),\n// a still frame under reduced motion and Save-Data (the photons rest along their conduit). The stage keeps its aspect ratio and the\n// detail line its height: no layout shift.\n//\n// Anchoring: a conduit runs between the centres of the node's circle and of the hub's ring (the label and the caption hang\n// below them, out of the box), and both circles are opaque and drawn over it — so every conduit meets the circle at the point\n// facing the other end, whatever the layout and the number of nodes.\n//\n// Accessible: the drawing is hidden from assistive technology; every node is a real button named by its label, and the\n// detail line (polite live region) says the chosen node's description with its link. Pair it with a text version (a\n// list) in the page: the figure is a picture of it.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type FlowConduit, flowGeometry, type FlowLayout } from \"./geometry\";\n\nexport interface EngineFlowNode {\n /** A stable id (`verikora`). */\n id: string;\n /** Its name, the button's accessible name (\"Verikora\"). */\n label: string;\n /** Its mark (a `ProductLogo`), decorative. */\n mark?: React.ReactNode;\n /** One line: what it uses the engine for — shown when the node is pointed at or focused. */\n description?: React.ReactNode;\n /** Where it lives (its site). */\n href?: string;\n /** The link's words (\"Visit dev.verikora.com\"); defaults to the label. */\n linkLabel?: React.ReactNode;\n /** Opens the link in a new tab. */\n external?: boolean;\n /** What travels: `in` towards the hub, `out` back from it, `both`.\n * @default \"in\" */\n flow?: \"in\" | \"out\" | \"both\";\n /** Not wired yet: drawn dim, its conduit dashed and still, no photon. */\n planned?: boolean;\n /** A word beside the name in the detail line (\"planned\"), passed translated. */\n status?: React.ReactNode;\n /** Its brand scope (`brand-verikora`): its conduit, photons and ring take its `--kz-accent`. */\n className?: string;\n}\n\nexport interface EngineFlowHub {\n /** The engine's name (\"Sovkora\"). */\n label: string;\n /** Its mark, decorative. */\n mark?: React.ReactNode;\n /** A line under the name (\"the engine\"). */\n caption?: React.ReactNode;\n /** Its brand scope; the photons coming back take its accent. */\n className?: string;\n}\n\nexport type EngineFlowProps = Omit<React.ComponentProps<\"figure\">, \"children\"> & {\n /** What the figure shows (\"Sovkora and the products it powers\"), passed translated. */\n label: string;\n /** The engine, at the hub. */\n hub: EngineFlowHub;\n /** The apps around it. */\n nodes: readonly EngineFlowNode[];\n /** How the nodes sit around the hub.\n * @default \"radial\" */\n layout?: FlowLayout;\n /** The layout under a 560 px wide container (a phone); `false` keeps `layout` everywhere.\n * @default \"top-to-bottom\" */\n compactLayout?: FlowLayout | false;\n /** `photons` travel the conduits; `none` draws them still.\n * @default \"photons\" */\n particles?: \"photons\" | \"none\";\n /** The conduits' shape.\n * @default \"bezier\" */\n conduit?: FlowConduit;\n /** The detail line before a node is chosen (\"Point at a product\"). */\n hint?: React.ReactNode;\n /** The node shown in the detail line at first. */\n defaultActive?: string;\n /** Photon speed, in units per second (the stage is 100 units wide).\n * @default 16 */\n speed?: number;\n /** How many photons share a conduit: `sparse` one or two, `normal` two to four, `dense` four to eight.\n * @default \"normal\" */\n density?: FlowDensity;\n /** When the photons travel: `always`; `hover` only while the pointer or focus is on the figure (they rest along the\n * conduits otherwise); `active` only on the conduit of the chosen node (the others show nothing). Off screen they\n * are always paused, and still under reduced motion.\n * @default \"always\" */\n trigger?: FlowTrigger;\n /** The photons' timing function: `linear` (a steady stream), `ease-in-out` (a pulse that swells and settles), or any\n * CSS `<easing-function>` (`cubic-bezier(.2,0,0,1)`, `steps(6)`).\n * @default \"linear\" */\n easing?: FlowEasing;\n /** Milliseconds between one conduit's photons and the next's: 0 sends them all together.\n * @default 300 */\n stagger?: number;\n /** The engine's mark swells slowly (a loop, still under reduced motion).\n * @default true */\n breathe?: boolean;\n /** The calm level, for a small frame (a tile of a home page): sparse photons at a low rate, a slow breath, no hint and\n * no detail line, nothing to tune. It plays only on screen and once the page has settled, and stays still under\n * reduced motion and Save-Data. Overrides `speed`, `density`, `stagger` and `trigger`.\n * @default false */\n calm?: boolean;\n};\n\n/** The calm level's pace: units per second, photons per conduit, milliseconds between conduits. */\nexport const CALM_FLOW = { speed: 4, density: \"sparse\", stagger: 1200 } as const satisfies { speed: number; density: FlowDensity; stagger: number };\n\nconst subscribeSaveData = (onChange: () => void) => {\n const c = (navigator as Navigator & { connection?: EventTarget }).connection;\n c?.addEventListener?.(\"change\", onChange);\n return () => c?.removeEventListener?.(\"change\", onChange);\n};\nconst readSaveData = () => (navigator as Navigator & { connection?: { saveData?: boolean } }).connection?.saveData === true;\n\n\nexport type FlowDensity = \"sparse\" | \"normal\" | \"dense\";\nexport type FlowTrigger = \"always\" | \"hover\" | \"active\";\nexport type FlowEasing = \"linear\" | \"ease-in-out\" | (string & {});\n\n/** How many photons a conduit of this length carries (evenly spaced, so the gap is `length / count`). */\nexport function photonCount(length: number, density: FlowDensity = \"normal\"): number {\n const base = Math.round(length / 16);\n if (density === \"sparse\") return Math.min(2, Math.max(1, Math.round(base / 2)));\n if (density === \"dense\") return Math.min(8, Math.max(4, base * 2));\n return Math.min(4, Math.max(2, base));\n}\n\nfunction Stage({\n layout,\n variant,\n nodes,\n hub,\n conduit,\n particles,\n speed,\n density,\n easing,\n stagger,\n breathe,\n active,\n onActive,\n detailId,\n}: Readonly<{\n layout: FlowLayout;\n variant: \"wide\" | \"compact\";\n nodes: readonly EngineFlowNode[];\n hub: EngineFlowHub;\n conduit: FlowConduit;\n particles: \"photons\" | \"none\";\n speed: number;\n density: FlowDensity;\n easing: FlowEasing;\n stagger: number;\n breathe: boolean;\n active: string | undefined;\n onActive: (id: string) => void;\n detailId: string | undefined;\n}>) {\n const g = flowGeometry(layout, nodes.length, conduit);\n const pct = (v: number, of: number) => `${((v / of) * 100).toFixed(3)}%`;\n return (\n <div className=\"kz-flow-stage\" data-variant={variant} data-layout={layout} style={{ aspectRatio: `${g.width} / ${g.height}` }}>\n <svg viewBox={`0 0 ${g.width} ${g.height}`} aria-hidden=\"true\" focusable=\"false\">\n {nodes.map((node, i) => {\n const flow = node.flow ?? \"in\";\n const length = g.lengths[i] ?? 0;\n // Photons per conduit (`density`), evenly spaced; the same speed on every conduit.\n const gap = length / photonCount(length, density);\n const period = gap / speed;\n const timing = (dir: \"in\" | \"out\") =>\n ({\n \"--kz-flow-gap\": gap.toFixed(3),\n animationDuration: `${period.toFixed(2)}s`,\n // Each conduit starts `stagger` ms after the previous (a negative delay: already under way); the way back is half a period behind.\n animationDelay: `${(-(((i * stagger) / 1000 + (dir === \"out\" ? period / 2 : 0)) % period)).toFixed(2)}s`,\n ...(easing !== \"linear\" ? { animationTimingFunction: easing } : {}),\n }) as React.CSSProperties;\n const lanes = node.planned || particles === \"none\" ? [] : flow === \"both\" ? ([\"in\", \"out\"] as const) : [flow];\n return (\n <g\n key={node.id}\n className={cn(\"kz-flow-link\", node.className)}\n data-flow={flow}\n data-planned={node.planned ? \"\" : undefined}\n data-active={active === node.id ? \"\" : undefined}\n >\n <path className=\"kz-flow-wire\" d={g.paths[i]} />\n {lanes.map((dir) => (\n <React.Fragment key={dir}>\n <path className=\"kz-flow-photon kz-loop\" data-dir={dir} data-halo=\"\" d={g.paths[i]} style={timing(dir)} />\n <path className=\"kz-flow-photon kz-loop\" data-dir={dir} d={g.paths[i]} style={timing(dir)} />\n </React.Fragment>\n ))}\n </g>\n );\n })}\n </svg>\n <div className={cn(\"kz-flow-hub\", hub.className)} style={{ left: pct(g.hub.x, g.width), top: pct(g.hub.y, g.height) }}>\n {hub.mark ? <span className={cn(\"kz-flow-hub-mark\", breathe && \"kz-loop\")}>{hub.mark}</span> : null}\n <span className=\"kz-flow-hub-text\">\n <span className=\"kz-flow-hub-label\">{hub.label}</span>\n {hub.caption ? <span className=\"kz-flow-hub-caption\">{hub.caption}</span> : null}\n </span>\n </div>\n <ul className=\"kz-flow-nodes\">\n {nodes.map((node, i) => {\n const p = g.nodes[i]!;\n const on = active === node.id;\n return (\n <li key={node.id} style={{ left: pct(p.x, g.width), top: pct(p.y, g.height) }}>\n <button\n type=\"button\"\n className={cn(\"kz-flow-node\", node.className)}\n data-active={on ? \"\" : undefined}\n data-planned={node.planned ? \"\" : undefined}\n aria-pressed={on}\n aria-controls={detailId}\n onPointerEnter={() => onActive(node.id)}\n onFocus={() => onActive(node.id)}\n onClick={() => onActive(node.id)}\n >\n {node.mark ? (\n <span className=\"kz-flow-node-mark\" aria-hidden=\"true\">\n {node.mark}\n </span>\n ) : null}\n <span className=\"kz-flow-node-label\">{node.label}</span>\n </button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n\ntype FlowDataInput = { chosen: boolean; calm: boolean; saveData: boolean; trigger: string; density: string; compact: boolean };\n\n/** The figure's data attributes: the CSS reads the state from them. */\nfunction flowData({ chosen, calm, saveData, trigger, density, compact }: FlowDataInput) {\n let dataDensity: string | undefined = density === \"normal\" ? undefined : density;\n if (calm) dataDensity = \"sparse\";\n return {\n \"data-active\": chosen ? \"\" : undefined,\n \"data-calm\": calm ? \"\" : undefined,\n \"data-still\": saveData ? \"\" : undefined,\n \"data-trigger\": calm || trigger === \"always\" ? undefined : trigger,\n \"data-density\": dataDensity,\n \"data-compact\": compact ? \"\" : undefined,\n };\n}\n\n/** What the chosen node says, or the hint when none is chosen. */\nfunction FlowDetail({ id, chosen, hint }: Readonly<{ id: string; chosen: EngineFlowNode | undefined; hint: React.ReactNode }>) {\n return (\n <figcaption id={id} className={cn(\"kz-flow-detail\", chosen?.className)} aria-live=\"polite\">\n {chosen ? (\n <>\n <strong>{chosen.label}</strong>\n {chosen.status ? <span className=\"kz-flow-status\">{chosen.status}</span> : null}\n {chosen.description ? <span> {chosen.description}</span> : null}\n {chosen.href ? (\n <>\n {\" \"}\n <a href={chosen.href} {...(chosen.external ? { target: \"_blank\", rel: \"noopener\" } : {})}>\n {chosen.linkLabel ?? chosen.label}\n <span aria-hidden=\"true\"> →</span>\n </a>\n </>\n ) : null}\n </>\n ) : (\n hint\n )}\n </figcaption>\n );\n}\n\n/** An engine at the hub and the apps it serves, with what travels between them. */\nexport function EngineFlow({\n label,\n hub,\n nodes,\n layout = \"radial\",\n compactLayout = \"top-to-bottom\",\n particles = \"photons\",\n conduit = \"bezier\",\n hint,\n defaultActive,\n speed = 16,\n density = \"normal\",\n trigger = \"always\",\n easing = \"linear\",\n stagger = 300,\n breathe = true,\n calm = false,\n className,\n ...props\n}: Readonly<EngineFlowProps>) {\n const [active, setActive] = React.useState<string | undefined>(defaultActive);\n const detailId = `${React.useId()}-detail`;\n const chosen = nodes.find((n) => n.id === active);\n const compact = compactLayout && compactLayout !== layout ? compactLayout : undefined;\n // Save-Data: the calm and the full levels both rest (a still frame, like reduced motion).\n const saveData = React.useSyncExternalStore(subscribeSaveData, readSaveData, () => false);\n const pace = calm ? CALM_FLOW : { speed: Math.max(1, speed), density, stagger: Math.max(0, stagger) };\n const stage = { nodes, hub, conduit, particles, ...pace, easing, breathe, active, onActive: setActive, detailId: calm ? undefined : detailId };\n return (\n <figure\n aria-label={label}\n className={cn(\"kz-flow\", className)}\n data-motion-scope=\"\"\n {...flowData({ chosen: Boolean(chosen), calm, saveData, trigger, density, compact: Boolean(compact) })}\n {...props}\n >\n <Stage layout={layout} variant=\"wide\" {...stage} />\n {compact ? <Stage layout={compact} variant=\"compact\" {...stage} /> : null}\n {calm ? null : <FlowDetail id={detailId} chosen={chosen} hint={hint} />}\n </figure>\n );\n}\n","// Server-safe, pure. The geometry of EngineFlow: where the hub and the nodes sit in a box 100 units wide, and the\n// conduit from each node to the hub (an SVG path drawn node → hub, and its length, so photons travel at one speed on\n// every conduit). No DOM: the same numbers on the server and in the browser.\n\n/** How the nodes are placed around the hub. */\nexport type FlowLayout = \"radial\" | \"top-to-bottom\" | \"left-to-right\";\n/** The shape of a conduit: an S-shaped cubic Bézier, or a straight line. */\nexport type FlowConduit = \"bezier\" | \"straight\";\n\nexport interface FlowPoint {\n x: number;\n y: number;\n}\n\nexport interface FlowGeometry {\n /** The box: 100 units wide, `height` units high (the stage keeps this aspect ratio, so nothing is distorted). */\n width: number;\n height: number;\n hub: FlowPoint;\n nodes: FlowPoint[];\n /** One path per node, from the node to the hub. */\n paths: string[];\n /** The length of each path, in units. */\n lengths: number[];\n}\n\n/** The box height per layout (the width is always 100). */\nexport const FLOW_HEIGHT: Record<FlowLayout, number> = { radial: 60, \"top-to-bottom\": 92, \"left-to-right\": 56 };\n\n/** How far a conduit lands from the hub's centre along the row, as a share of its node's offset: a small fan, kept inside the ring. */\nexport const FLOW_FAN = 0.1;\n\nconst r2 = (n: number) => Math.round(n * 100) / 100;\nconst pt = (p: FlowPoint) => `${r2(p.x)} ${r2(p.y)}`;\n\nfunction cubicLength(a: FlowPoint, b: FlowPoint, c: FlowPoint, d: FlowPoint): number {\n let length = 0;\n let prev = a;\n for (let i = 1; i <= 32; i++) {\n const t = i / 32;\n const u = 1 - t;\n const p = {\n x: u * u * u * a.x + 3 * u * u * t * b.x + 3 * u * t * t * c.x + t * t * t * d.x,\n y: u * u * u * a.y + 3 * u * u * t * b.y + 3 * u * t * t * c.y + t * t * t * d.y,\n };\n length += Math.hypot(p.x - prev.x, p.y - prev.y);\n prev = p;\n }\n return length;\n}\n\n/** The positions of `count` nodes around the hub. */\nexport function flowPositions(layout: FlowLayout, count: number): { hub: FlowPoint; nodes: FlowPoint[] } {\n const height = FLOW_HEIGHT[layout];\n const n = Math.max(0, count);\n if (layout === \"top-to-bottom\") {\n return { hub: { x: 50, y: 72 }, nodes: Array.from({ length: n }, (_, i) => ({ x: ((i + 0.5) * 100) / n, y: 13 })) };\n }\n if (layout === \"left-to-right\") {\n return { hub: { x: 80, y: height / 2 }, nodes: Array.from({ length: n }, (_, i) => ({ x: 12, y: ((i + 0.5) * height) / n })) };\n }\n // Radial: on an ellipse around the centre; an even count puts two nodes level with the hub (more room for labels).\n const hub = { x: 50, y: height / 2 };\n const start = n % 2 === 0 ? -90 + 180 / Math.max(n, 1) : -90;\n return {\n hub,\n nodes: Array.from({ length: n }, (_, i) => {\n const a = ((start + (360 / n) * i) * Math.PI) / 180;\n return { x: hub.x + 37 * Math.cos(a), y: hub.y + 20 * Math.sin(a) };\n }),\n };\n}\n\n/** The whole geometry of a flow: positions, conduits (node → hub) and their lengths. */\nexport function flowGeometry(layout: FlowLayout, count: number, conduit: FlowConduit = \"bezier\"): FlowGeometry {\n const { hub, nodes } = flowPositions(layout, count);\n const paths: string[] = [];\n const lengths: number[] = [];\n for (const p of nodes) {\n // Each conduit lands on its own point of the hub (a fan), so the lines stay apart where they meet.\n let end: FlowPoint;\n if (layout === \"top-to-bottom\") end = { x: hub.x + (p.x - hub.x) * FLOW_FAN, y: hub.y };\n else if (layout === \"left-to-right\") end = { x: hub.x, y: hub.y + (p.y - hub.y) * FLOW_FAN };\n else end = hub;\n if (conduit === \"straight\") {\n paths.push(`M${pt(p)} L${pt(end)}`);\n lengths.push(Math.hypot(end.x - p.x, end.y - p.y));\n continue;\n }\n let c1: FlowPoint;\n let c2: FlowPoint;\n if (layout === \"top-to-bottom\") {\n const mid = (p.y + end.y) / 2;\n c1 = { x: p.x, y: mid };\n c2 = { x: end.x, y: mid };\n } else if (layout === \"left-to-right\") {\n const mid = (p.x + end.x) / 2;\n c1 = { x: mid, y: p.y };\n c2 = { x: mid, y: end.y };\n } else {\n // An S: leave the node bending one way, reach the hub bending the other.\n const dx = end.x - p.x;\n const dy = end.y - p.y;\n const len = Math.hypot(dx, dy) || 1;\n const k = 0.14 * len;\n const nx = -dy / len;\n const ny = dx / len;\n c1 = { x: p.x + dx * 0.35 + nx * k, y: p.y + dy * 0.35 + ny * k };\n c2 = { x: p.x + dx * 0.65 - nx * k, y: p.y + dy * 0.65 - ny * k };\n }\n paths.push(`M${pt(p)} C${pt(c1)} ${pt(c2)} ${pt(end)}`);\n lengths.push(cubicLength(p, c1, c2, end));\n }\n return { width: 100, height: FLOW_HEIGHT[layout], hub, nodes, paths, lengths };\n}\n"],"mappings":";;;;;;AAgBA,YAAY,WAAW;;;ACWhB,IAAM,cAA0C,EAAE,QAAQ,IAAI,iBAAiB,IAAI,iBAAiB,GAAG;AAGvG,IAAM,WAAW;AAExB,IAAM,KAAK,CAAC,MAAc,KAAK,MAAM,IAAI,GAAG,IAAI;AAChD,IAAM,KAAK,CAAC,MAAiB,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;AAElD,SAAS,Y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W,UAAU,OAAO,SAAY,SAAS;AAC7I,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ,WAAW,GAAG,WAAW,SAAS;AAAA,MAClC,qBAAkB;AAAA,MACjB,GAAG,SAAS,EAAE,QAAQ,QAAQ,MAAM,GAAG,MAAM,UAAU,SAAS,SAAS,SAAS,QAAQ,OAAO,EAAE,CAAC;AAAA,MACpG,GAAG;AAAA,MAEJ;AAAA,4BAAC,SAAM,QAAgB,SAAQ,QAAQ,GAAG,OAAO;AAAA,QAChD,UAAU,oBAAC,SAAM,QAAQ,SAAS,SAAQ,WAAW,GAAG,OAAO,IAAK;AAAA,QACpE,OAAO,OAAO,oBAAC,cAAW,IAAI,UAAU,QAAgB,MAAY;AAAA;AAAA;AAAA,EACvE;AAEJ;","names":["Fragment"]}
@@ -86,7 +86,7 @@ type EntityHeaderProps = EntityHeaderBase & {
86
86
  className?: string;
87
87
  };
88
88
  /** The head of an entity: picture, name and description editable in place, tags, a refusal said in words, actions. */
89
- declare function EntityHeader({ name, onNameChange, nameLabel, description, onDescriptionChange, descriptionLabel, descriptionPlaceholder, avatar, avatarPicker, tags, tagsLabel, onTagRemove, tagRemoveLabel, refusal, refusals, actions, className, }: EntityHeaderProps): React.JSX.Element;
89
+ declare function EntityHeader({ name, onNameChange, nameLabel, description, onDescriptionChange, descriptionLabel, descriptionPlaceholder, avatar, avatarPicker, tags, tagsLabel, onTagRemove, tagRemoveLabel, refusal, refusals, actions, className, }: Readonly<EntityHeaderProps>): React.JSX.Element;
90
90
 
91
91
  export { EntityHeader };
92
92
  export type { EntityHeaderProps, EntityRefusals, EntityTag };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  PencilGlyph
4
- } from "./chunk-NG6G6V5E.js";
4
+ } from "./chunk-LFH3LEWR.js";
5
5
 
6
6
  // src/entity-header/entity-header.tsx
7
7
  import { AvatarPicker } from "@krizaka/ui/account-settings";