@theokit/ui 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (715) hide show
  1. package/CHANGELOG.md +1325 -0
  2. package/DESIGN.md +456 -0
  3. package/LICENSE +201 -0
  4. package/NOTICE +38 -0
  5. package/README.md +467 -0
  6. package/dist/chunk-27ENTTY7.js +146 -0
  7. package/dist/chunk-27ENTTY7.js.map +1 -0
  8. package/dist/chunk-2H6TQELG.js +33 -0
  9. package/dist/chunk-2H6TQELG.js.map +1 -0
  10. package/dist/chunk-2L6MRJD4.js +120 -0
  11. package/dist/chunk-2L6MRJD4.js.map +1 -0
  12. package/dist/chunk-2Y5V2PAL.js +80 -0
  13. package/dist/chunk-2Y5V2PAL.js.map +1 -0
  14. package/dist/chunk-34NAFDVL.js +46 -0
  15. package/dist/chunk-34NAFDVL.js.map +1 -0
  16. package/dist/chunk-36KJGXEK.js +112 -0
  17. package/dist/chunk-36KJGXEK.js.map +1 -0
  18. package/dist/chunk-3BMYYNN6.js +124 -0
  19. package/dist/chunk-3BMYYNN6.js.map +1 -0
  20. package/dist/chunk-3OHV7EEI.js +34 -0
  21. package/dist/chunk-3OHV7EEI.js.map +1 -0
  22. package/dist/chunk-3QKTS6F5.js +88 -0
  23. package/dist/chunk-3QKTS6F5.js.map +1 -0
  24. package/dist/chunk-3TBXLYNM.js +42 -0
  25. package/dist/chunk-3TBXLYNM.js.map +1 -0
  26. package/dist/chunk-4AM2HSXU.js +67 -0
  27. package/dist/chunk-4AM2HSXU.js.map +1 -0
  28. package/dist/chunk-4BCGKM65.js +44 -0
  29. package/dist/chunk-4BCGKM65.js.map +1 -0
  30. package/dist/chunk-4D3JILQX.js +145 -0
  31. package/dist/chunk-4D3JILQX.js.map +1 -0
  32. package/dist/chunk-4EJU2GBG.js +48 -0
  33. package/dist/chunk-4EJU2GBG.js.map +1 -0
  34. package/dist/chunk-4WKO3G5C.js +110 -0
  35. package/dist/chunk-4WKO3G5C.js.map +1 -0
  36. package/dist/chunk-53XPKI7Q.js +97 -0
  37. package/dist/chunk-53XPKI7Q.js.map +1 -0
  38. package/dist/chunk-55TDVDPG.js +58 -0
  39. package/dist/chunk-55TDVDPG.js.map +1 -0
  40. package/dist/chunk-56BJLFW7.js +26 -0
  41. package/dist/chunk-56BJLFW7.js.map +1 -0
  42. package/dist/chunk-5HOQLE6Y.js +35 -0
  43. package/dist/chunk-5HOQLE6Y.js.map +1 -0
  44. package/dist/chunk-5TY3NYF5.js +144 -0
  45. package/dist/chunk-5TY3NYF5.js.map +1 -0
  46. package/dist/chunk-5VOSCJKQ.js +92 -0
  47. package/dist/chunk-5VOSCJKQ.js.map +1 -0
  48. package/dist/chunk-65NVO6TK.js +171 -0
  49. package/dist/chunk-65NVO6TK.js.map +1 -0
  50. package/dist/chunk-6A5TPCKP.js +64 -0
  51. package/dist/chunk-6A5TPCKP.js.map +1 -0
  52. package/dist/chunk-6CO4LEXZ.js +41 -0
  53. package/dist/chunk-6CO4LEXZ.js.map +1 -0
  54. package/dist/chunk-6FVUPNPG.js +56 -0
  55. package/dist/chunk-6FVUPNPG.js.map +1 -0
  56. package/dist/chunk-76YWTIWK.js +106 -0
  57. package/dist/chunk-76YWTIWK.js.map +1 -0
  58. package/dist/chunk-7EI7424P.js +78 -0
  59. package/dist/chunk-7EI7424P.js.map +1 -0
  60. package/dist/chunk-AHTVYOPQ.js +26 -0
  61. package/dist/chunk-AHTVYOPQ.js.map +1 -0
  62. package/dist/chunk-AJTJNHKK.js +85 -0
  63. package/dist/chunk-AJTJNHKK.js.map +1 -0
  64. package/dist/chunk-AMT3CPMC.js +155 -0
  65. package/dist/chunk-AMT3CPMC.js.map +1 -0
  66. package/dist/chunk-AX5EH73R.js +59 -0
  67. package/dist/chunk-AX5EH73R.js.map +1 -0
  68. package/dist/chunk-B3VAJSZ2.js +35 -0
  69. package/dist/chunk-B3VAJSZ2.js.map +1 -0
  70. package/dist/chunk-B4CQMQ64.js +25 -0
  71. package/dist/chunk-B4CQMQ64.js.map +1 -0
  72. package/dist/chunk-BMRZXT5T.js +115 -0
  73. package/dist/chunk-BMRZXT5T.js.map +1 -0
  74. package/dist/chunk-BYZ6OFH4.js +73 -0
  75. package/dist/chunk-BYZ6OFH4.js.map +1 -0
  76. package/dist/chunk-C55VUQ7N.js +156 -0
  77. package/dist/chunk-C55VUQ7N.js.map +1 -0
  78. package/dist/chunk-D4GEAV4C.js +91 -0
  79. package/dist/chunk-D4GEAV4C.js.map +1 -0
  80. package/dist/chunk-DC43CHAM.js +152 -0
  81. package/dist/chunk-DC43CHAM.js.map +1 -0
  82. package/dist/chunk-DKCRLN35.js +92 -0
  83. package/dist/chunk-DKCRLN35.js.map +1 -0
  84. package/dist/chunk-DN5BUDBI.js +86 -0
  85. package/dist/chunk-DN5BUDBI.js.map +1 -0
  86. package/dist/chunk-DOLKDYMS.js +88 -0
  87. package/dist/chunk-DOLKDYMS.js.map +1 -0
  88. package/dist/chunk-DW34WXCG.js +28 -0
  89. package/dist/chunk-DW34WXCG.js.map +1 -0
  90. package/dist/chunk-DZAAKHGZ.js +135 -0
  91. package/dist/chunk-DZAAKHGZ.js.map +1 -0
  92. package/dist/chunk-E4IRSSHO.js +116 -0
  93. package/dist/chunk-E4IRSSHO.js.map +1 -0
  94. package/dist/chunk-E67WQXBV.js +104 -0
  95. package/dist/chunk-E67WQXBV.js.map +1 -0
  96. package/dist/chunk-EG6IHP3H.js +128 -0
  97. package/dist/chunk-EG6IHP3H.js.map +1 -0
  98. package/dist/chunk-EO7LOXG2.js +82 -0
  99. package/dist/chunk-EO7LOXG2.js.map +1 -0
  100. package/dist/chunk-EWDN56AS.js +24 -0
  101. package/dist/chunk-EWDN56AS.js.map +1 -0
  102. package/dist/chunk-F5P5P2SC.js +141 -0
  103. package/dist/chunk-F5P5P2SC.js.map +1 -0
  104. package/dist/chunk-FAWPRZTM.js +79 -0
  105. package/dist/chunk-FAWPRZTM.js.map +1 -0
  106. package/dist/chunk-FGYJ2WPX.js +36 -0
  107. package/dist/chunk-FGYJ2WPX.js.map +1 -0
  108. package/dist/chunk-GBG3I5I5.js +46 -0
  109. package/dist/chunk-GBG3I5I5.js.map +1 -0
  110. package/dist/chunk-GDMCDW66.js +19 -0
  111. package/dist/chunk-GDMCDW66.js.map +1 -0
  112. package/dist/chunk-H6HSQCOW.js +80 -0
  113. package/dist/chunk-H6HSQCOW.js.map +1 -0
  114. package/dist/chunk-HDM4RCIF.js +111 -0
  115. package/dist/chunk-HDM4RCIF.js.map +1 -0
  116. package/dist/chunk-HNTOGGVD.js +77 -0
  117. package/dist/chunk-HNTOGGVD.js.map +1 -0
  118. package/dist/chunk-HQW2ABO4.js +28 -0
  119. package/dist/chunk-HQW2ABO4.js.map +1 -0
  120. package/dist/chunk-HRDRGZ2Y.js +76 -0
  121. package/dist/chunk-HRDRGZ2Y.js.map +1 -0
  122. package/dist/chunk-HUOVA7SF.js +83 -0
  123. package/dist/chunk-HUOVA7SF.js.map +1 -0
  124. package/dist/chunk-ITA3SNOR.js +133 -0
  125. package/dist/chunk-ITA3SNOR.js.map +1 -0
  126. package/dist/chunk-IYNUPG2G.js +61 -0
  127. package/dist/chunk-IYNUPG2G.js.map +1 -0
  128. package/dist/chunk-JJ65ZI4P.js +199 -0
  129. package/dist/chunk-JJ65ZI4P.js.map +1 -0
  130. package/dist/chunk-JRBGZ6NI.js +106 -0
  131. package/dist/chunk-JRBGZ6NI.js.map +1 -0
  132. package/dist/chunk-K45OO62F.js +108 -0
  133. package/dist/chunk-K45OO62F.js.map +1 -0
  134. package/dist/chunk-KDTKA667.js +67 -0
  135. package/dist/chunk-KDTKA667.js.map +1 -0
  136. package/dist/chunk-KI7KZBSN.js +142 -0
  137. package/dist/chunk-KI7KZBSN.js.map +1 -0
  138. package/dist/chunk-KOJ7XOPZ.js +87 -0
  139. package/dist/chunk-KOJ7XOPZ.js.map +1 -0
  140. package/dist/chunk-KQTHJ22B.js +82 -0
  141. package/dist/chunk-KQTHJ22B.js.map +1 -0
  142. package/dist/chunk-KRC43RZR.js +77 -0
  143. package/dist/chunk-KRC43RZR.js.map +1 -0
  144. package/dist/chunk-LJQOEGQ2.js +116 -0
  145. package/dist/chunk-LJQOEGQ2.js.map +1 -0
  146. package/dist/chunk-LKRNUSKZ.js +149 -0
  147. package/dist/chunk-LKRNUSKZ.js.map +1 -0
  148. package/dist/chunk-LLL7QQ52.js +76 -0
  149. package/dist/chunk-LLL7QQ52.js.map +1 -0
  150. package/dist/chunk-LQ4B5X4Y.js +56 -0
  151. package/dist/chunk-LQ4B5X4Y.js.map +1 -0
  152. package/dist/chunk-M3FSLEHQ.js +76 -0
  153. package/dist/chunk-M3FSLEHQ.js.map +1 -0
  154. package/dist/chunk-M5G3O6H6.js +57 -0
  155. package/dist/chunk-M5G3O6H6.js.map +1 -0
  156. package/dist/chunk-M6JIC5PU.js +81 -0
  157. package/dist/chunk-M6JIC5PU.js.map +1 -0
  158. package/dist/chunk-N2HJ3SLS.js +186 -0
  159. package/dist/chunk-N2HJ3SLS.js.map +1 -0
  160. package/dist/chunk-NGZWBFTP.js +45 -0
  161. package/dist/chunk-NGZWBFTP.js.map +1 -0
  162. package/dist/chunk-OAKCXT35.js +34 -0
  163. package/dist/chunk-OAKCXT35.js.map +1 -0
  164. package/dist/chunk-OSD3U3HT.js +54 -0
  165. package/dist/chunk-OSD3U3HT.js.map +1 -0
  166. package/dist/chunk-OUXESQ2R.js +42 -0
  167. package/dist/chunk-OUXESQ2R.js.map +1 -0
  168. package/dist/chunk-OY2LJHMJ.js +43 -0
  169. package/dist/chunk-OY2LJHMJ.js.map +1 -0
  170. package/dist/chunk-OYEZR4CN.js +221 -0
  171. package/dist/chunk-OYEZR4CN.js.map +1 -0
  172. package/dist/chunk-P57HUMAE.js +66 -0
  173. package/dist/chunk-P57HUMAE.js.map +1 -0
  174. package/dist/chunk-P6Y2PI6L.js +82 -0
  175. package/dist/chunk-P6Y2PI6L.js.map +1 -0
  176. package/dist/chunk-PA7TDXUQ.js +51 -0
  177. package/dist/chunk-PA7TDXUQ.js.map +1 -0
  178. package/dist/chunk-PPBGGNPV.js +112 -0
  179. package/dist/chunk-PPBGGNPV.js.map +1 -0
  180. package/dist/chunk-PRH4HKND.js +48 -0
  181. package/dist/chunk-PRH4HKND.js.map +1 -0
  182. package/dist/chunk-PSPAZJUQ.js +32 -0
  183. package/dist/chunk-PSPAZJUQ.js.map +1 -0
  184. package/dist/chunk-Q5G5CGZ2.js +170 -0
  185. package/dist/chunk-Q5G5CGZ2.js.map +1 -0
  186. package/dist/chunk-QDAF3LP7.js +89 -0
  187. package/dist/chunk-QDAF3LP7.js.map +1 -0
  188. package/dist/chunk-QGVIGNJ3.js +37 -0
  189. package/dist/chunk-QGVIGNJ3.js.map +1 -0
  190. package/dist/chunk-QNUITYSY.js +68 -0
  191. package/dist/chunk-QNUITYSY.js.map +1 -0
  192. package/dist/chunk-QSWVN3RT.js +116 -0
  193. package/dist/chunk-QSWVN3RT.js.map +1 -0
  194. package/dist/chunk-QTLQZ7OJ.js +110 -0
  195. package/dist/chunk-QTLQZ7OJ.js.map +1 -0
  196. package/dist/chunk-QYAMLIG2.js +84 -0
  197. package/dist/chunk-QYAMLIG2.js.map +1 -0
  198. package/dist/chunk-REILH4XF.js +128 -0
  199. package/dist/chunk-REILH4XF.js.map +1 -0
  200. package/dist/chunk-S6SSK6QX.js +80 -0
  201. package/dist/chunk-S6SSK6QX.js.map +1 -0
  202. package/dist/chunk-SA7ED3PN.js +68 -0
  203. package/dist/chunk-SA7ED3PN.js.map +1 -0
  204. package/dist/chunk-SIJOEM4N.js +55 -0
  205. package/dist/chunk-SIJOEM4N.js.map +1 -0
  206. package/dist/chunk-SLOKAAH2.js +70 -0
  207. package/dist/chunk-SLOKAAH2.js.map +1 -0
  208. package/dist/chunk-TR6NPSMX.js +85 -0
  209. package/dist/chunk-TR6NPSMX.js.map +1 -0
  210. package/dist/chunk-TSZ5DEAT.js +106 -0
  211. package/dist/chunk-TSZ5DEAT.js.map +1 -0
  212. package/dist/chunk-TUNVF45W.js +127 -0
  213. package/dist/chunk-TUNVF45W.js.map +1 -0
  214. package/dist/chunk-TXOBNSQ5.js +63 -0
  215. package/dist/chunk-TXOBNSQ5.js.map +1 -0
  216. package/dist/chunk-U44DRLMM.js +88 -0
  217. package/dist/chunk-U44DRLMM.js.map +1 -0
  218. package/dist/chunk-U4THNRV5.js +114 -0
  219. package/dist/chunk-U4THNRV5.js.map +1 -0
  220. package/dist/chunk-UAZOFC4W.js +72 -0
  221. package/dist/chunk-UAZOFC4W.js.map +1 -0
  222. package/dist/chunk-UGKI466V.js +12 -0
  223. package/dist/chunk-UGKI466V.js.map +1 -0
  224. package/dist/chunk-VM4RMQQN.js +11 -0
  225. package/dist/chunk-VM4RMQQN.js.map +1 -0
  226. package/dist/chunk-VQ37VLAS.js +54 -0
  227. package/dist/chunk-VQ37VLAS.js.map +1 -0
  228. package/dist/chunk-VT7VSYH5.js +73 -0
  229. package/dist/chunk-VT7VSYH5.js.map +1 -0
  230. package/dist/chunk-VTIRUCLZ.js +57 -0
  231. package/dist/chunk-VTIRUCLZ.js.map +1 -0
  232. package/dist/chunk-VVBAEYKI.js +202 -0
  233. package/dist/chunk-VVBAEYKI.js.map +1 -0
  234. package/dist/chunk-WHFIQUCC.js +120 -0
  235. package/dist/chunk-WHFIQUCC.js.map +1 -0
  236. package/dist/chunk-WPSESV5Z.js +74 -0
  237. package/dist/chunk-WPSESV5Z.js.map +1 -0
  238. package/dist/chunk-WXEXCHEN.js +51 -0
  239. package/dist/chunk-WXEXCHEN.js.map +1 -0
  240. package/dist/chunk-X2DDPD3D.js +113 -0
  241. package/dist/chunk-X2DDPD3D.js.map +1 -0
  242. package/dist/chunk-X7VIMKLD.js +127 -0
  243. package/dist/chunk-X7VIMKLD.js.map +1 -0
  244. package/dist/chunk-XJ3EG6XY.js +30 -0
  245. package/dist/chunk-XJ3EG6XY.js.map +1 -0
  246. package/dist/chunk-XOT5HWSF.js +23 -0
  247. package/dist/chunk-XOT5HWSF.js.map +1 -0
  248. package/dist/chunk-Y72IP43U.js +117 -0
  249. package/dist/chunk-Y72IP43U.js.map +1 -0
  250. package/dist/chunk-YD6FLXBV.js +61 -0
  251. package/dist/chunk-YD6FLXBV.js.map +1 -0
  252. package/dist/chunk-YEQQGYYO.js +1022 -0
  253. package/dist/chunk-YEQQGYYO.js.map +1 -0
  254. package/dist/chunk-YYW6AEIT.js +46 -0
  255. package/dist/chunk-YYW6AEIT.js.map +1 -0
  256. package/dist/chunk-ZEVGXKRU.js +104 -0
  257. package/dist/chunk-ZEVGXKRU.js.map +1 -0
  258. package/dist/chunk-ZKSMMLDP.js +74 -0
  259. package/dist/chunk-ZKSMMLDP.js.map +1 -0
  260. package/dist/chunk-ZU6IM6PK.js +101 -0
  261. package/dist/chunk-ZU6IM6PK.js.map +1 -0
  262. package/dist/chunk-ZUS5KZGO.js +714 -0
  263. package/dist/chunk-ZUS5KZGO.js.map +1 -0
  264. package/dist/chunk-ZVS2GOT2.js +58 -0
  265. package/dist/chunk-ZVS2GOT2.js.map +1 -0
  266. package/dist/chunk-ZXPDS6DH.js +3 -0
  267. package/dist/chunk-ZXPDS6DH.js.map +1 -0
  268. package/dist/chunk-ZZQQJX5Z.js +173 -0
  269. package/dist/chunk-ZZQQJX5Z.js.map +1 -0
  270. package/dist/components.css +2 -0
  271. package/dist/composites/account-menu/index.js +6 -0
  272. package/dist/composites/account-menu/index.js.map +1 -0
  273. package/dist/composites/agent-composer/index.js +7 -0
  274. package/dist/composites/agent-composer/index.js.map +1 -0
  275. package/dist/composites/agent-editor/index.js +10 -0
  276. package/dist/composites/agent-editor/index.js.map +1 -0
  277. package/dist/composites/agent-stream/index.js +12 -0
  278. package/dist/composites/agent-stream/index.js.map +1 -0
  279. package/dist/composites/agent-timeline/index.js +5 -0
  280. package/dist/composites/agent-timeline/index.js.map +1 -0
  281. package/dist/composites/approval-card/index.js +5 -0
  282. package/dist/composites/approval-card/index.js.map +1 -0
  283. package/dist/composites/chat-composer/index.js +6 -0
  284. package/dist/composites/chat-composer/index.js.map +1 -0
  285. package/dist/composites/chat-message/index.js +6 -0
  286. package/dist/composites/chat-message/index.js.map +1 -0
  287. package/dist/composites/code-block/index.js +5 -0
  288. package/dist/composites/code-block/index.js.map +1 -0
  289. package/dist/composites/command-palette/index.js +5 -0
  290. package/dist/composites/command-palette/index.js.map +1 -0
  291. package/dist/composites/confirm-dialog/index.js +7 -0
  292. package/dist/composites/confirm-dialog/index.js.map +1 -0
  293. package/dist/composites/cron-jobs-list/index.js +5 -0
  294. package/dist/composites/cron-jobs-list/index.js.map +1 -0
  295. package/dist/composites/data-table/index.js +10 -0
  296. package/dist/composites/data-table/index.js.map +1 -0
  297. package/dist/composites/deployment-row/index.js +5 -0
  298. package/dist/composites/deployment-row/index.js.map +1 -0
  299. package/dist/composites/domain-config/index.js +7 -0
  300. package/dist/composites/domain-config/index.js.map +1 -0
  301. package/dist/composites/env-var-editor/index.js +7 -0
  302. package/dist/composites/env-var-editor/index.js.map +1 -0
  303. package/dist/composites/mcp-server-list/index.js +5 -0
  304. package/dist/composites/mcp-server-list/index.js.map +1 -0
  305. package/dist/composites/page-shell/index.js +7 -0
  306. package/dist/composites/page-shell/index.js.map +1 -0
  307. package/dist/composites/permission-modal/index.js +6 -0
  308. package/dist/composites/permission-modal/index.js.map +1 -0
  309. package/dist/composites/preview-env-card/index.js +6 -0
  310. package/dist/composites/preview-env-card/index.js.map +1 -0
  311. package/dist/composites/preview-panel/index.js +5 -0
  312. package/dist/composites/preview-panel/index.js.map +1 -0
  313. package/dist/composites/project-card/index.js +6 -0
  314. package/dist/composites/project-card/index.js.map +1 -0
  315. package/dist/composites/rollback-ui/index.js +6 -0
  316. package/dist/composites/rollback-ui/index.js.map +1 -0
  317. package/dist/composites/rule-editor/index.js +11 -0
  318. package/dist/composites/rule-editor/index.js.map +1 -0
  319. package/dist/composites/skill-editor/index.js +11 -0
  320. package/dist/composites/skill-editor/index.js.map +1 -0
  321. package/dist/composites/skills-list/index.js +5 -0
  322. package/dist/composites/skills-list/index.js.map +1 -0
  323. package/dist/composites/stability-bundle-viewer/index.js +4 -0
  324. package/dist/composites/stability-bundle-viewer/index.js.map +1 -0
  325. package/dist/composites/task-header/index.js +5 -0
  326. package/dist/composites/task-header/index.js.map +1 -0
  327. package/dist/composites/usage-meter/index.js +5 -0
  328. package/dist/composites/usage-meter/index.js.map +1 -0
  329. package/dist/fonts/LICENSE-GEIST.txt +92 -0
  330. package/dist/fonts/geist-400.woff2 +0 -0
  331. package/dist/fonts/geist-500.woff2 +0 -0
  332. package/dist/fonts/geist-600.woff2 +0 -0
  333. package/dist/fonts/geist-mono-400.woff2 +0 -0
  334. package/dist/fonts/geist-mono-500.woff2 +0 -0
  335. package/dist/fonts/geist-mono-600.woff2 +0 -0
  336. package/dist/fonts-cdn.css +28 -0
  337. package/dist/fonts.css +75 -0
  338. package/dist/index.d.ts +4621 -0
  339. package/dist/index.js +1338 -0
  340. package/dist/index.js.map +1 -0
  341. package/dist/plugin-D5xmXqYb.d.ts +172 -0
  342. package/dist/preset-v3-legacy.d.ts +35 -0
  343. package/dist/preset-v3-legacy.js +159 -0
  344. package/dist/preset-v3-legacy.js.map +1 -0
  345. package/dist/preset.css +27 -0
  346. package/dist/primitives/action-bar/index.js +4 -0
  347. package/dist/primitives/action-bar/index.js.map +1 -0
  348. package/dist/primitives/agent-error-card/index.js +5 -0
  349. package/dist/primitives/agent-error-card/index.js.map +1 -0
  350. package/dist/primitives/agent-event/index.js +4 -0
  351. package/dist/primitives/agent-event/index.js.map +1 -0
  352. package/dist/primitives/agent-handoff/index.js +4 -0
  353. package/dist/primitives/agent-handoff/index.js.map +1 -0
  354. package/dist/primitives/agent-profile/index.js +4 -0
  355. package/dist/primitives/agent-profile/index.js.map +1 -0
  356. package/dist/primitives/agent-starting-state/index.js +5 -0
  357. package/dist/primitives/agent-starting-state/index.js.map +1 -0
  358. package/dist/primitives/agent-streaming/index.js +5 -0
  359. package/dist/primitives/agent-streaming/index.js.map +1 -0
  360. package/dist/primitives/alert/index.js +4 -0
  361. package/dist/primitives/alert/index.js.map +1 -0
  362. package/dist/primitives/artifact-preview/index.js +4 -0
  363. package/dist/primitives/artifact-preview/index.js.map +1 -0
  364. package/dist/primitives/attachment-chip/index.js +4 -0
  365. package/dist/primitives/attachment-chip/index.js.map +1 -0
  366. package/dist/primitives/audit-log-entry/index.js +4 -0
  367. package/dist/primitives/audit-log-entry/index.js.map +1 -0
  368. package/dist/primitives/auto-compact-notice/index.js +5 -0
  369. package/dist/primitives/auto-compact-notice/index.js.map +1 -0
  370. package/dist/primitives/avatar/index.js +4 -0
  371. package/dist/primitives/avatar/index.js.map +1 -0
  372. package/dist/primitives/badge/index.js +4 -0
  373. package/dist/primitives/badge/index.js.map +1 -0
  374. package/dist/primitives/branch-indicator/index.js +4 -0
  375. package/dist/primitives/branch-indicator/index.js.map +1 -0
  376. package/dist/primitives/browser-controls/index.js +4 -0
  377. package/dist/primitives/browser-controls/index.js.map +1 -0
  378. package/dist/primitives/build-log-stream/index.js +5 -0
  379. package/dist/primitives/build-log-stream/index.js.map +1 -0
  380. package/dist/primitives/button/index.js +4 -0
  381. package/dist/primitives/button/index.js.map +1 -0
  382. package/dist/primitives/capability-indicator/index.js +4 -0
  383. package/dist/primitives/capability-indicator/index.js.map +1 -0
  384. package/dist/primitives/card/index.js +4 -0
  385. package/dist/primitives/card/index.js.map +1 -0
  386. package/dist/primitives/channel-card/index.js +4 -0
  387. package/dist/primitives/channel-card/index.js.map +1 -0
  388. package/dist/primitives/chat-thread/index.js +5 -0
  389. package/dist/primitives/chat-thread/index.js.map +1 -0
  390. package/dist/primitives/checkbox/index.js +4 -0
  391. package/dist/primitives/checkbox/index.js.map +1 -0
  392. package/dist/primitives/context-card/index.js +4 -0
  393. package/dist/primitives/context-card/index.js.map +1 -0
  394. package/dist/primitives/context-window-bar/index.js +4 -0
  395. package/dist/primitives/context-window-bar/index.js.map +1 -0
  396. package/dist/primitives/copy-button/index.js +4 -0
  397. package/dist/primitives/copy-button/index.js.map +1 -0
  398. package/dist/primitives/cost-meter/index.js +4 -0
  399. package/dist/primitives/cost-meter/index.js.map +1 -0
  400. package/dist/primitives/created-files-card/index.js +4 -0
  401. package/dist/primitives/created-files-card/index.js.map +1 -0
  402. package/dist/primitives/cron-job-card/index.js +4 -0
  403. package/dist/primitives/cron-job-card/index.js.map +1 -0
  404. package/dist/primitives/danger-zone/index.js +4 -0
  405. package/dist/primitives/danger-zone/index.js.map +1 -0
  406. package/dist/primitives/dialog/index.js +4 -0
  407. package/dist/primitives/dialog/index.js.map +1 -0
  408. package/dist/primitives/diff-viewer/index.js +4 -0
  409. package/dist/primitives/diff-viewer/index.js.map +1 -0
  410. package/dist/primitives/dropdown-menu/index.js +4 -0
  411. package/dist/primitives/dropdown-menu/index.js.map +1 -0
  412. package/dist/primitives/empty-state/index.js +4 -0
  413. package/dist/primitives/empty-state/index.js.map +1 -0
  414. package/dist/primitives/export-chat-dialog/index.js +4 -0
  415. package/dist/primitives/export-chat-dialog/index.js.map +1 -0
  416. package/dist/primitives/folder-context-card/index.js +4 -0
  417. package/dist/primitives/folder-context-card/index.js.map +1 -0
  418. package/dist/primitives/folder-selector/index.js +4 -0
  419. package/dist/primitives/folder-selector/index.js.map +1 -0
  420. package/dist/primitives/form-field/index.js +4 -0
  421. package/dist/primitives/form-field/index.js.map +1 -0
  422. package/dist/primitives/gateway-status-indicator/index.js +4 -0
  423. package/dist/primitives/gateway-status-indicator/index.js.map +1 -0
  424. package/dist/primitives/hook-config/index.js +4 -0
  425. package/dist/primitives/hook-config/index.js.map +1 -0
  426. package/dist/primitives/hook-event-log/index.js +4 -0
  427. package/dist/primitives/hook-event-log/index.js.map +1 -0
  428. package/dist/primitives/input/index.js +4 -0
  429. package/dist/primitives/input/index.js.map +1 -0
  430. package/dist/primitives/intent-selector/index.js +4 -0
  431. package/dist/primitives/intent-selector/index.js.map +1 -0
  432. package/dist/primitives/label/index.js +4 -0
  433. package/dist/primitives/label/index.js.map +1 -0
  434. package/dist/primitives/lane-board/index.js +4 -0
  435. package/dist/primitives/lane-board/index.js.map +1 -0
  436. package/dist/primitives/login-split/index.js +4 -0
  437. package/dist/primitives/login-split/index.js.map +1 -0
  438. package/dist/primitives/mcp-server-card/index.js +4 -0
  439. package/dist/primitives/mcp-server-card/index.js.map +1 -0
  440. package/dist/primitives/memory-editor/index.js +4 -0
  441. package/dist/primitives/memory-editor/index.js.map +1 -0
  442. package/dist/primitives/mention-menu/index.js +4 -0
  443. package/dist/primitives/mention-menu/index.js.map +1 -0
  444. package/dist/primitives/metrics-panel/index.js +4 -0
  445. package/dist/primitives/metrics-panel/index.js.map +1 -0
  446. package/dist/primitives/model-card/index.js +4 -0
  447. package/dist/primitives/model-card/index.js.map +1 -0
  448. package/dist/primitives/model-selector/index.js +4 -0
  449. package/dist/primitives/model-selector/index.js.map +1 -0
  450. package/dist/primitives/pagination/index.js +4 -0
  451. package/dist/primitives/pagination/index.js.map +1 -0
  452. package/dist/primitives/permission-matrix/index.js +4 -0
  453. package/dist/primitives/permission-matrix/index.js.map +1 -0
  454. package/dist/primitives/pin-input/index.js +4 -0
  455. package/dist/primitives/pin-input/index.js.map +1 -0
  456. package/dist/primitives/plan-badge/index.js +4 -0
  457. package/dist/primitives/plan-badge/index.js.map +1 -0
  458. package/dist/primitives/progress/index.js +4 -0
  459. package/dist/primitives/progress/index.js.map +1 -0
  460. package/dist/primitives/progress-checklist/index.js +4 -0
  461. package/dist/primitives/progress-checklist/index.js.map +1 -0
  462. package/dist/primitives/project-switcher/index.js +4 -0
  463. package/dist/primitives/project-switcher/index.js.map +1 -0
  464. package/dist/primitives/quick-action-chips/index.js +4 -0
  465. package/dist/primitives/quick-action-chips/index.js.map +1 -0
  466. package/dist/primitives/radio-group/index.js +4 -0
  467. package/dist/primitives/radio-group/index.js.map +1 -0
  468. package/dist/primitives/recent-folders-list/index.js +4 -0
  469. package/dist/primitives/recent-folders-list/index.js.map +1 -0
  470. package/dist/primitives/rule-card/index.js +4 -0
  471. package/dist/primitives/rule-card/index.js.map +1 -0
  472. package/dist/primitives/run-stats/index.js +4 -0
  473. package/dist/primitives/run-stats/index.js.map +1 -0
  474. package/dist/primitives/run-status-pill/index.js +4 -0
  475. package/dist/primitives/run-status-pill/index.js.map +1 -0
  476. package/dist/primitives/running-tasks-panel/index.js +4 -0
  477. package/dist/primitives/running-tasks-panel/index.js.map +1 -0
  478. package/dist/primitives/scroll-area/index.js +4 -0
  479. package/dist/primitives/scroll-area/index.js.map +1 -0
  480. package/dist/primitives/select/index.js +4 -0
  481. package/dist/primitives/select/index.js.map +1 -0
  482. package/dist/primitives/session-list-item/index.js +4 -0
  483. package/dist/primitives/session-list-item/index.js.map +1 -0
  484. package/dist/primitives/session-timeline/index.js +4 -0
  485. package/dist/primitives/session-timeline/index.js.map +1 -0
  486. package/dist/primitives/sheet/index.js +4 -0
  487. package/dist/primitives/sheet/index.js.map +1 -0
  488. package/dist/primitives/sidebar/index.js +4 -0
  489. package/dist/primitives/sidebar/index.js.map +1 -0
  490. package/dist/primitives/skeleton/index.js +5 -0
  491. package/dist/primitives/skeleton/index.js.map +1 -0
  492. package/dist/primitives/skill-card/index.js +4 -0
  493. package/dist/primitives/skill-card/index.js.map +1 -0
  494. package/dist/primitives/social-auth-row/index.js +4 -0
  495. package/dist/primitives/social-auth-row/index.js.map +1 -0
  496. package/dist/primitives/stat-tile/index.js +4 -0
  497. package/dist/primitives/stat-tile/index.js.map +1 -0
  498. package/dist/primitives/status-dot/index.js +4 -0
  499. package/dist/primitives/status-dot/index.js.map +1 -0
  500. package/dist/primitives/steps-rail/index.js +4 -0
  501. package/dist/primitives/steps-rail/index.js.map +1 -0
  502. package/dist/primitives/sub-agent-dispatch/index.js +4 -0
  503. package/dist/primitives/sub-agent-dispatch/index.js.map +1 -0
  504. package/dist/primitives/switch/index.js +4 -0
  505. package/dist/primitives/switch/index.js.map +1 -0
  506. package/dist/primitives/system-prompt-editor/index.js +4 -0
  507. package/dist/primitives/system-prompt-editor/index.js.map +1 -0
  508. package/dist/primitives/table/index.js +4 -0
  509. package/dist/primitives/table/index.js.map +1 -0
  510. package/dist/primitives/tabs/index.js +4 -0
  511. package/dist/primitives/tabs/index.js.map +1 -0
  512. package/dist/primitives/task-plan/index.js +4 -0
  513. package/dist/primitives/task-plan/index.js.map +1 -0
  514. package/dist/primitives/terminal-panel/index.js +5 -0
  515. package/dist/primitives/terminal-panel/index.js.map +1 -0
  516. package/dist/primitives/textarea/index.js +4 -0
  517. package/dist/primitives/textarea/index.js.map +1 -0
  518. package/dist/primitives/thinking-level-selector/index.js +4 -0
  519. package/dist/primitives/thinking-level-selector/index.js.map +1 -0
  520. package/dist/primitives/timestamp/index.js +4 -0
  521. package/dist/primitives/timestamp/index.js.map +1 -0
  522. package/dist/primitives/toast/index.js +4 -0
  523. package/dist/primitives/toast/index.js.map +1 -0
  524. package/dist/primitives/token-usage-chart/index.js +4 -0
  525. package/dist/primitives/token-usage-chart/index.js.map +1 -0
  526. package/dist/primitives/tool-call/index.js +4 -0
  527. package/dist/primitives/tool-call/index.js.map +1 -0
  528. package/dist/primitives/tool-call-card/index.js +4 -0
  529. package/dist/primitives/tool-call-card/index.js.map +1 -0
  530. package/dist/primitives/tool-result/index.js +4 -0
  531. package/dist/primitives/tool-result/index.js.map +1 -0
  532. package/dist/primitives/tools-list/index.js +4 -0
  533. package/dist/primitives/tools-list/index.js.map +1 -0
  534. package/dist/primitives/tooltip/index.js +4 -0
  535. package/dist/primitives/tooltip/index.js.map +1 -0
  536. package/dist/primitives/topnav/index.js +4 -0
  537. package/dist/primitives/topnav/index.js.map +1 -0
  538. package/dist/primitives/update-banner/index.js +4 -0
  539. package/dist/primitives/update-banner/index.js.map +1 -0
  540. package/dist/slide/index.d.ts +212 -0
  541. package/dist/slide/index.js +3 -0
  542. package/dist/slide/index.js.map +1 -0
  543. package/dist/slide/plugins/emoji/index.d.ts +29 -0
  544. package/dist/slide/plugins/emoji/index.js +157 -0
  545. package/dist/slide/plugins/emoji/index.js.map +1 -0
  546. package/dist/slide/plugins/math/index.d.ts +13 -0
  547. package/dist/slide/plugins/math/index.js +145 -0
  548. package/dist/slide/plugins/math/index.js.map +1 -0
  549. package/dist/slide/plugins/mermaid/index.d.ts +55 -0
  550. package/dist/slide/plugins/mermaid/index.js +218 -0
  551. package/dist/slide/plugins/mermaid/index.js.map +1 -0
  552. package/dist/slide/plugins/shiki/index.d.ts +18 -0
  553. package/dist/slide/plugins/shiki/index.js +87 -0
  554. package/dist/slide/plugins/shiki/index.js.map +1 -0
  555. package/dist/slide/themes/default.css +256 -0
  556. package/dist/slide/themes/layouts.css +143 -0
  557. package/dist/slide/themes/violet-forge.css +256 -0
  558. package/dist/slide-deck/index.css +52 -0
  559. package/dist/slide-deck/index.css.map +1 -0
  560. package/dist/slide-deck/index.d.ts +377 -0
  561. package/dist/slide-deck/index.js +1111 -0
  562. package/dist/slide-deck/index.js.map +1 -0
  563. package/dist/styles-v3-legacy.css +88 -0
  564. package/dist/styles.css +137 -0
  565. package/dist/tokens-v4.css +187 -0
  566. package/dist/tokens.css +230 -0
  567. package/dist/vite-plugin.d.ts +29 -0
  568. package/dist/vite-plugin.js +76 -0
  569. package/dist/vite-plugin.js.map +1 -0
  570. package/dist/whiteboard/index.d.ts +258 -0
  571. package/dist/whiteboard/index.js +738 -0
  572. package/dist/whiteboard/index.js.map +1 -0
  573. package/llms.txt +273 -0
  574. package/package.json +800 -0
  575. package/registry/index.json +856 -0
  576. package/registry/r/account-menu.json +24 -0
  577. package/registry/r/action-bar.json +22 -0
  578. package/registry/r/agent-composer.json +22 -0
  579. package/registry/r/agent-editor.json +27 -0
  580. package/registry/r/agent-error-card.json +22 -0
  581. package/registry/r/agent-event.json +24 -0
  582. package/registry/r/agent-handoff.json +22 -0
  583. package/registry/r/agent-profile.json +23 -0
  584. package/registry/r/agent-starting-state.json +22 -0
  585. package/registry/r/agent-stream.json +27 -0
  586. package/registry/r/agent-streaming.json +22 -0
  587. package/registry/r/agent-timeline.json +22 -0
  588. package/registry/r/agent-types.json +15 -0
  589. package/registry/r/alert.json +22 -0
  590. package/registry/r/approval-card.json +25 -0
  591. package/registry/r/artifact-preview.json +22 -0
  592. package/registry/r/attachment-chip.json +24 -0
  593. package/registry/r/audit-log-entry.json +23 -0
  594. package/registry/r/auto-compact-notice.json +22 -0
  595. package/registry/r/avatar.json +23 -0
  596. package/registry/r/badge.json +22 -0
  597. package/registry/r/browser-controls.json +22 -0
  598. package/registry/r/build-log-stream.json +19 -0
  599. package/registry/r/button.json +23 -0
  600. package/registry/r/capability-indicator.json +23 -0
  601. package/registry/r/card.json +22 -0
  602. package/registry/r/chat-composer.json +23 -0
  603. package/registry/r/chat-message.json +129 -0
  604. package/registry/r/chat-thread.json +20 -0
  605. package/registry/r/chat-types.json +15 -0
  606. package/registry/r/checkbox.json +24 -0
  607. package/registry/r/cn.json +19 -0
  608. package/registry/r/code-block.json +21 -0
  609. package/registry/r/command-palette.json +25 -0
  610. package/registry/r/confirm-dialog.json +25 -0
  611. package/registry/r/context-card.json +23 -0
  612. package/registry/r/context-window-bar.json +20 -0
  613. package/registry/r/copy-button.json +22 -0
  614. package/registry/r/cost-meter.json +22 -0
  615. package/registry/r/created-files-card.json +23 -0
  616. package/registry/r/cron-job-card.json +22 -0
  617. package/registry/r/cron-jobs-list.json +23 -0
  618. package/registry/r/danger-zone.json +20 -0
  619. package/registry/r/data-table.json +27 -0
  620. package/registry/r/deployment-row.json +23 -0
  621. package/registry/r/dialog.json +23 -0
  622. package/registry/r/diff-viewer.json +20 -0
  623. package/registry/r/domain-config.json +25 -0
  624. package/registry/r/dropdown-menu.json +23 -0
  625. package/registry/r/empty-state.json +20 -0
  626. package/registry/r/env-var-editor.json +25 -0
  627. package/registry/r/folder-context-card.json +23 -0
  628. package/registry/r/folder-selector.json +22 -0
  629. package/registry/r/form-field.json +23 -0
  630. package/registry/r/hook-config.json +22 -0
  631. package/registry/r/hook-event-log.json +22 -0
  632. package/registry/r/input.json +22 -0
  633. package/registry/r/intent-selector.json +24 -0
  634. package/registry/r/label.json +22 -0
  635. package/registry/r/lane-board.json +20 -0
  636. package/registry/r/live-region-context.json +16 -0
  637. package/registry/r/login-split.json +20 -0
  638. package/registry/r/mcp-server-card.json +22 -0
  639. package/registry/r/mcp-server-list.json +23 -0
  640. package/registry/r/memory-editor.json +23 -0
  641. package/registry/r/mention-menu.json +23 -0
  642. package/registry/r/metrics-panel.json +22 -0
  643. package/registry/r/mode-types.json +15 -0
  644. package/registry/r/model-card.json +23 -0
  645. package/registry/r/model-selector.json +23 -0
  646. package/registry/r/page-shell.json +25 -0
  647. package/registry/r/pagination.json +22 -0
  648. package/registry/r/permission-matrix.json +22 -0
  649. package/registry/r/permission-modal.json +24 -0
  650. package/registry/r/permission-types.json +15 -0
  651. package/registry/r/pin-input.json +20 -0
  652. package/registry/r/plan-badge.json +20 -0
  653. package/registry/r/preview-env-card.json +25 -0
  654. package/registry/r/preview-panel.json +21 -0
  655. package/registry/r/progress-checklist.json +23 -0
  656. package/registry/r/progress.json +20 -0
  657. package/registry/r/project-card.json +25 -0
  658. package/registry/r/project-switcher.json +22 -0
  659. package/registry/r/quick-action-chips.json +21 -0
  660. package/registry/r/radio-group.json +23 -0
  661. package/registry/r/recent-folders-list.json +22 -0
  662. package/registry/r/rollback-ui.json +24 -0
  663. package/registry/r/rule-card.json +23 -0
  664. package/registry/r/rule-editor.json +28 -0
  665. package/registry/r/rule-types.json +18 -0
  666. package/registry/r/run-stats.json +22 -0
  667. package/registry/r/running-tasks-panel.json +22 -0
  668. package/registry/r/safe-href.json +16 -0
  669. package/registry/r/scroll-area.json +22 -0
  670. package/registry/r/select.json +24 -0
  671. package/registry/r/session-list-item.json +20 -0
  672. package/registry/r/session-timeline.json +22 -0
  673. package/registry/r/sheet.json +24 -0
  674. package/registry/r/sidebar.json +19 -0
  675. package/registry/r/skeleton.json +19 -0
  676. package/registry/r/skill-card.json +24 -0
  677. package/registry/r/skill-editor.json +28 -0
  678. package/registry/r/skills-list.json +23 -0
  679. package/registry/r/slide-deck.json +130 -0
  680. package/registry/r/slide-plugin-emoji.json +28 -0
  681. package/registry/r/slide-plugin-math.json +24 -0
  682. package/registry/r/slide-plugin-mermaid.json +23 -0
  683. package/registry/r/slide-plugin-shiki.json +23 -0
  684. package/registry/r/slide.json +123 -0
  685. package/registry/r/social-auth-row.json +21 -0
  686. package/registry/r/stat-tile.json +22 -0
  687. package/registry/r/status-dot.json +20 -0
  688. package/registry/r/steps-rail.json +20 -0
  689. package/registry/r/sub-agent-dispatch.json +22 -0
  690. package/registry/r/switch.json +23 -0
  691. package/registry/r/system-prompt-editor.json +22 -0
  692. package/registry/r/table.json +22 -0
  693. package/registry/r/tabs.json +22 -0
  694. package/registry/r/tailwind-preset.json +19 -0
  695. package/registry/r/task-header.json +24 -0
  696. package/registry/r/task-plan.json +22 -0
  697. package/registry/r/task-types.json +15 -0
  698. package/registry/r/terminal-panel.json +22 -0
  699. package/registry/r/textarea.json +22 -0
  700. package/registry/r/theme-provider.json +59 -0
  701. package/registry/r/theme-script.json +18 -0
  702. package/registry/r/theo-ui-provider.json +20 -0
  703. package/registry/r/timestamp.json +20 -0
  704. package/registry/r/toast.json +30 -0
  705. package/registry/r/token-usage-chart.json +20 -0
  706. package/registry/r/tokens.json +21 -0
  707. package/registry/r/tool-call-card.json +23 -0
  708. package/registry/r/tool-call.json +22 -0
  709. package/registry/r/tool-result.json +20 -0
  710. package/registry/r/tools-list.json +23 -0
  711. package/registry/r/tooltip.json +22 -0
  712. package/registry/r/topnav.json +22 -0
  713. package/registry/r/types.json +15 -0
  714. package/registry/r/usage-meter.json +21 -0
  715. package/registry/r/whiteboard.json +101 -0
@@ -0,0 +1,1111 @@
1
+ import { Slide, extractFrontmatter } from '../chunk-ZUS5KZGO.js';
2
+ import { createContext, useContext, useRef, useState, useEffect, useCallback, useMemo, useReducer, useId } from 'react';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { z } from 'zod';
5
+
6
+ var DeckContext = createContext(null);
7
+ function useDeckContext() {
8
+ const ctx = useContext(DeckContext);
9
+ if (!ctx) {
10
+ throw new Error(
11
+ "SlideDeck sub-components must be used inside <SlideDeck>. Wrap them in <SlideDeck slides={...}>."
12
+ );
13
+ }
14
+ return ctx;
15
+ }
16
+ var Controls = ({ className }) => {
17
+ const { state, dispatch } = useDeckContext();
18
+ const atStart = state.currentIndex <= 0;
19
+ const atEnd = state.currentIndex >= state.totalSlides - 1;
20
+ return /* @__PURE__ */ jsxs(
21
+ "div",
22
+ {
23
+ className: ["theo-slide-deck-controls", className].filter(Boolean).join(" "),
24
+ "data-theo-slide-deck-controls": true,
25
+ style: {
26
+ display: "flex",
27
+ alignItems: "center",
28
+ gap: 8
29
+ },
30
+ children: [
31
+ /* @__PURE__ */ jsx(
32
+ "button",
33
+ {
34
+ type: "button",
35
+ "aria-label": "Previous slide",
36
+ disabled: atStart,
37
+ onClick: () => dispatch({ type: "PREV_SLIDE" }),
38
+ className: "theo-slide-deck-controls-prev",
39
+ children: "\u2190"
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsx(
43
+ "span",
44
+ {
45
+ "aria-live": "polite",
46
+ className: "theo-slide-deck-controls-indicator",
47
+ style: { fontVariantNumeric: "tabular-nums", minWidth: 64, textAlign: "center" },
48
+ children: state.totalSlides === 0 ? "0 / 0" : `${state.currentIndex + 1} / ${state.totalSlides}`
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsx(
52
+ "button",
53
+ {
54
+ type: "button",
55
+ "aria-label": "Next slide",
56
+ disabled: atEnd,
57
+ onClick: () => dispatch({ type: "NEXT_SLIDE" }),
58
+ className: "theo-slide-deck-controls-next",
59
+ children: "\u2192"
60
+ }
61
+ )
62
+ ]
63
+ }
64
+ );
65
+ };
66
+
67
+ // src/components/composites/slide-deck/fragments.ts
68
+ var FRAGMENT_MARKER_RE = /^\s*\*\s+\S/gm;
69
+ function countFragmentsInMarkdown(markdown) {
70
+ if (!markdown) return 0;
71
+ const stripped = markdown.replace(/```[\s\S]*?```/g, "");
72
+ const matches = stripped.match(FRAGMENT_MARKER_RE);
73
+ return matches ? matches.length : 0;
74
+ }
75
+ function formatElapsed(ms) {
76
+ const s = Math.floor(ms / 1e3);
77
+ const mm = Math.floor(s / 60).toString().padStart(2, "0");
78
+ const ss = (s % 60).toString().padStart(2, "0");
79
+ return `${mm}:${ss}`;
80
+ }
81
+ var PresenterView = ({ className }) => {
82
+ const { state, slides } = useDeckContext();
83
+ const startedAt = useRef(null);
84
+ const [elapsed, setElapsed] = useState(0);
85
+ useEffect(() => {
86
+ if (state.presenterMode) {
87
+ if (startedAt.current === null) {
88
+ startedAt.current = Date.now();
89
+ }
90
+ const interval = window.setInterval(() => {
91
+ if (startedAt.current !== null) {
92
+ setElapsed(Date.now() - startedAt.current);
93
+ }
94
+ }, 1e3);
95
+ return () => window.clearInterval(interval);
96
+ }
97
+ startedAt.current = null;
98
+ setElapsed(0);
99
+ return void 0;
100
+ }, [state.presenterMode]);
101
+ if (!state.presenterMode) return null;
102
+ const current = slides[state.currentIndex];
103
+ const next = slides[state.currentIndex + 1];
104
+ const notes = current?.notes;
105
+ return /* @__PURE__ */ jsxs(
106
+ "aside",
107
+ {
108
+ className: ["theo-slide-deck-presenter", className].filter(Boolean).join(" "),
109
+ "data-theo-slide-deck-presenter": true,
110
+ "aria-label": "Presenter view",
111
+ style: {
112
+ display: "grid",
113
+ gridTemplateColumns: "1fr 1fr",
114
+ gridTemplateRows: "auto 1fr",
115
+ gap: 16,
116
+ padding: 16,
117
+ background: "color-mix(in srgb, currentColor 6%, transparent)",
118
+ borderRadius: 8
119
+ },
120
+ children: [
121
+ /* @__PURE__ */ jsxs(
122
+ "header",
123
+ {
124
+ style: {
125
+ gridColumn: "1 / -1",
126
+ display: "flex",
127
+ justifyContent: "space-between",
128
+ alignItems: "center"
129
+ },
130
+ children: [
131
+ /* @__PURE__ */ jsx("h3", { style: { margin: 0, fontSize: 14, fontWeight: 600 }, children: "Presenter view" }),
132
+ /* @__PURE__ */ jsx(
133
+ "span",
134
+ {
135
+ "aria-label": "Elapsed time",
136
+ style: { fontVariantNumeric: "tabular-nums", fontSize: 14 },
137
+ children: formatElapsed(elapsed)
138
+ }
139
+ )
140
+ ]
141
+ }
142
+ ),
143
+ /* @__PURE__ */ jsxs("section", { "aria-label": "Current slide preview", children: [
144
+ /* @__PURE__ */ jsx("h4", { style: { margin: "0 0 8px", fontSize: 12, opacity: 0.7 }, children: "Current" }),
145
+ /* @__PURE__ */ jsx(
146
+ "div",
147
+ {
148
+ style: {
149
+ aspectRatio: "16 / 9",
150
+ overflow: "hidden",
151
+ border: "1px solid rgba(127,127,127,0.3)",
152
+ borderRadius: 6
153
+ },
154
+ children: current ? /* @__PURE__ */ jsx(Slide, { markdown: current.markdown, "aria-label": "Current slide" }) : null
155
+ }
156
+ )
157
+ ] }),
158
+ /* @__PURE__ */ jsxs("section", { "aria-label": "Next slide preview", children: [
159
+ /* @__PURE__ */ jsx("h4", { style: { margin: "0 0 8px", fontSize: 12, opacity: 0.7 }, children: "Next" }),
160
+ /* @__PURE__ */ jsx(
161
+ "div",
162
+ {
163
+ style: {
164
+ aspectRatio: "16 / 9",
165
+ overflow: "hidden",
166
+ border: "1px solid rgba(127,127,127,0.3)",
167
+ borderRadius: 6,
168
+ opacity: next ? 1 : 0.4
169
+ },
170
+ children: next ? /* @__PURE__ */ jsx(Slide, { markdown: next.markdown, "aria-label": "Next slide" }) : /* @__PURE__ */ jsx("div", { style: { padding: 16, fontSize: 14, opacity: 0.6 }, children: "End of deck" })
171
+ }
172
+ )
173
+ ] }),
174
+ notes ? /* @__PURE__ */ jsxs(
175
+ "section",
176
+ {
177
+ "aria-label": "Speaker notes",
178
+ style: {
179
+ gridColumn: "1 / -1",
180
+ background: "color-mix(in srgb, currentColor 8%, transparent)",
181
+ padding: 12,
182
+ borderRadius: 6,
183
+ fontSize: 14,
184
+ whiteSpace: "pre-wrap"
185
+ },
186
+ children: [
187
+ /* @__PURE__ */ jsx("strong", { children: "Notes: " }),
188
+ notes
189
+ ]
190
+ }
191
+ ) : null
192
+ ]
193
+ }
194
+ );
195
+ };
196
+
197
+ // src/components/composites/slide-deck/print-styles.ts
198
+ var STYLE_ID = "theo-slide-deck-print-styles";
199
+ var PRINT_CSS = `
200
+ @media print {
201
+ @page {
202
+ size: 1280px 720px;
203
+ margin: 0;
204
+ }
205
+ body > * {
206
+ visibility: hidden;
207
+ }
208
+ .theo-slide-deck-print-container,
209
+ .theo-slide-deck-print-container * {
210
+ visibility: visible;
211
+ }
212
+ .theo-slide-deck-print-container {
213
+ position: absolute;
214
+ inset: 0;
215
+ }
216
+ .theo-slide-deck-print-slide {
217
+ page-break-after: always;
218
+ break-after: page;
219
+ width: 1280px;
220
+ height: 720px;
221
+ overflow: hidden;
222
+ }
223
+ .theo-slide-deck-print-slide:last-child {
224
+ page-break-after: auto;
225
+ break-after: auto;
226
+ }
227
+ }
228
+ `;
229
+ function injectPrintStyles() {
230
+ if (typeof document === "undefined") {
231
+ throw new Error("injectPrintStyles requires a document (browser env)");
232
+ }
233
+ let style = document.getElementById(STYLE_ID);
234
+ if (!style) {
235
+ style = document.createElement("style");
236
+ style.id = STYLE_ID;
237
+ style.textContent = PRINT_CSS;
238
+ document.head.appendChild(style);
239
+ }
240
+ return style;
241
+ }
242
+ function removePrintStyles() {
243
+ if (typeof document === "undefined") return;
244
+ const style = document.getElementById(STYLE_ID);
245
+ if (style) style.remove();
246
+ }
247
+ function printDeck(opts = {}) {
248
+ if (typeof window === "undefined" || typeof document === "undefined") return;
249
+ injectPrintStyles();
250
+ const cleanup = () => {
251
+ removePrintStyles();
252
+ window.removeEventListener("afterprint", cleanup);
253
+ opts.onAfterPrint?.();
254
+ };
255
+ window.addEventListener("afterprint", cleanup);
256
+ window.print();
257
+ }
258
+ var ProgressBar = ({ className }) => {
259
+ const { state } = useDeckContext();
260
+ const value = state.totalSlides === 0 ? 0 : state.currentIndex + 1;
261
+ const max = Math.max(1, state.totalSlides);
262
+ return /* @__PURE__ */ jsx(
263
+ "progress",
264
+ {
265
+ className: ["theo-slide-deck-progress", className].filter(Boolean).join(" "),
266
+ "data-theo-slide-deck-progress": true,
267
+ value,
268
+ max,
269
+ "aria-label": "Slide progress"
270
+ }
271
+ );
272
+ };
273
+ var SlideNumber = ({ className }) => {
274
+ const { state } = useDeckContext();
275
+ if (state.totalSlides === 0) return null;
276
+ return /* @__PURE__ */ jsxs(
277
+ "div",
278
+ {
279
+ className: ["theo-slide-deck-slide-number", className].filter(Boolean).join(" "),
280
+ "data-theo-slide-deck-slide-number": true,
281
+ "aria-hidden": "true",
282
+ style: {
283
+ position: "absolute",
284
+ bottom: 12,
285
+ right: 16,
286
+ fontVariantNumeric: "tabular-nums",
287
+ fontSize: 14,
288
+ opacity: 0.6
289
+ },
290
+ children: [
291
+ state.currentIndex + 1,
292
+ " / ",
293
+ state.totalSlides
294
+ ]
295
+ }
296
+ );
297
+ };
298
+
299
+ // src/components/composites/slide-deck/notes.ts
300
+ var NOTES_RE = /<!--\s*notes?:\s*([\s\S]*?)\s*-->/gi;
301
+ function extractNotes(md) {
302
+ const matches = [...md.matchAll(NOTES_RE)];
303
+ if (matches.length === 0) {
304
+ return { body: md, notes: void 0 };
305
+ }
306
+ const notes = matches.map((m) => (m[1] ?? "").trim()).filter((s) => s.length > 0).join("\n\n");
307
+ const body = md.replace(NOTES_RE, "").trim();
308
+ return { body, notes: notes.length > 0 ? notes : void 0 };
309
+ }
310
+
311
+ // src/components/composites/slide-deck/split-deck.ts
312
+ async function splitDeck(markdown) {
313
+ const { body: bodyAfterFM } = extractFrontmatter(markdown);
314
+ if (bodyAfterFM.trim().length === 0) {
315
+ return [];
316
+ }
317
+ const { fromMarkdown } = await import('mdast-util-from-markdown');
318
+ const tree = fromMarkdown(bodyAfterFM);
319
+ const breakOffsets = [];
320
+ for (const node of tree.children) {
321
+ if (node.type === "thematicBreak") {
322
+ const start = node.position?.start.offset;
323
+ const end = node.position?.end.offset;
324
+ if (typeof start === "number" && typeof end === "number") {
325
+ breakOffsets.push(start);
326
+ breakOffsets.push(end);
327
+ }
328
+ }
329
+ }
330
+ if (breakOffsets.length === 0) {
331
+ const { body, notes } = extractNotes(bodyAfterFM);
332
+ if (body.trim().length === 0 && !notes) return [];
333
+ return [{ markdown: body, notes }];
334
+ }
335
+ const slides = [];
336
+ const positions = [0];
337
+ for (let i = 0; i < breakOffsets.length; i += 2) {
338
+ const start = breakOffsets[i];
339
+ const end = breakOffsets[i + 1];
340
+ if (typeof start === "number") positions.push(start);
341
+ if (typeof end === "number") positions.push(end);
342
+ }
343
+ positions.push(bodyAfterFM.length);
344
+ for (let i = 0; i < positions.length - 1; i += 2) {
345
+ const start = positions[i];
346
+ const end = positions[i + 1];
347
+ if (typeof start !== "number" || typeof end !== "number") continue;
348
+ const chunk = bodyAfterFM.slice(start, end).trim();
349
+ if (chunk.length === 0) continue;
350
+ const { body, notes } = extractNotes(chunk);
351
+ if (body.trim().length === 0 && !notes) continue;
352
+ slides.push({ markdown: body, notes });
353
+ }
354
+ return slides;
355
+ }
356
+ var CANVAS_W = 1280;
357
+ var CANVAS_H = 720;
358
+ var ThumbnailItem = ({
359
+ markdown,
360
+ index,
361
+ isCurrent,
362
+ scale,
363
+ eager,
364
+ onSelect,
365
+ registerRef
366
+ }) => {
367
+ const [revealed, setRevealed] = useState(eager);
368
+ const setRef = useCallback(
369
+ (el) => {
370
+ registerRef(index, el);
371
+ if (eager) return;
372
+ if (!el) return;
373
+ if (typeof IntersectionObserver === "undefined") {
374
+ setRevealed(true);
375
+ return;
376
+ }
377
+ const io = new IntersectionObserver(
378
+ (entries) => {
379
+ for (const entry of entries) {
380
+ if (entry.isIntersecting) {
381
+ setRevealed(true);
382
+ io.disconnect();
383
+ break;
384
+ }
385
+ }
386
+ },
387
+ { rootMargin: "200px" }
388
+ );
389
+ io.observe(el);
390
+ },
391
+ [index, eager, registerRef]
392
+ );
393
+ const w = Math.round(CANVAS_W * scale);
394
+ const h = Math.round(CANVAS_H * scale);
395
+ return /* @__PURE__ */ jsx(
396
+ "button",
397
+ {
398
+ ref: setRef,
399
+ type: "button",
400
+ onClick: () => onSelect(index),
401
+ "data-theo-slide-deck-thumbnail": true,
402
+ "data-current": isCurrent || void 0,
403
+ "aria-label": `Slide ${index + 1}`,
404
+ "aria-current": isCurrent ? "page" : void 0,
405
+ className: "theo-slide-deck-thumbnail",
406
+ style: {
407
+ width: w,
408
+ height: h,
409
+ padding: 0,
410
+ border: isCurrent ? "2px solid currentColor" : "1px solid rgba(127,127,127,0.3)",
411
+ borderRadius: 6,
412
+ overflow: "hidden",
413
+ position: "relative",
414
+ cursor: "pointer",
415
+ flexShrink: 0,
416
+ background: "transparent"
417
+ },
418
+ children: /* @__PURE__ */ jsx(
419
+ "div",
420
+ {
421
+ style: {
422
+ width: CANVAS_W,
423
+ height: CANVAS_H,
424
+ transform: `scale(${scale})`,
425
+ transformOrigin: "top left",
426
+ pointerEvents: "none"
427
+ },
428
+ children: revealed ? /* @__PURE__ */ jsx(Slide, { markdown, "aria-label": `Thumbnail ${index + 1}` }) : /* @__PURE__ */ jsx(
429
+ "div",
430
+ {
431
+ "data-theo-slide-deck-thumbnail-placeholder": true,
432
+ style: {
433
+ width: "100%",
434
+ height: "100%",
435
+ background: "rgba(127,127,127,0.08)"
436
+ }
437
+ }
438
+ )
439
+ }
440
+ )
441
+ }
442
+ );
443
+ };
444
+ var Thumbnails = ({ className, scale = 0.18 }) => {
445
+ const { state, dispatch, slides } = useDeckContext();
446
+ const refs = useRef(/* @__PURE__ */ new Map());
447
+ const registerRef = useCallback((index, el) => {
448
+ if (el) {
449
+ refs.current.set(index, el);
450
+ } else {
451
+ refs.current.delete(index);
452
+ }
453
+ }, []);
454
+ const onSelect = useCallback(
455
+ (index) => {
456
+ dispatch({ type: "JUMP_TO", index });
457
+ },
458
+ [dispatch]
459
+ );
460
+ useEffect(() => {
461
+ const el = refs.current.get(state.currentIndex);
462
+ if (el && "scrollIntoView" in el) {
463
+ el.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
464
+ }
465
+ }, [state.currentIndex]);
466
+ const eagerAll = useMemo(() => typeof IntersectionObserver === "undefined", []);
467
+ return /* @__PURE__ */ jsx(
468
+ "ul",
469
+ {
470
+ className: ["theo-slide-deck-thumbnails", className].filter(Boolean).join(" "),
471
+ "data-theo-slide-deck-thumbnails": true,
472
+ "aria-label": "Slide thumbnails",
473
+ style: {
474
+ display: "flex",
475
+ flexDirection: "column",
476
+ gap: 8,
477
+ overflowY: "auto",
478
+ padding: 8,
479
+ listStyle: "none",
480
+ margin: 0
481
+ },
482
+ children: slides.map((slide, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
483
+ ThumbnailItem,
484
+ {
485
+ markdown: slide.markdown,
486
+ index,
487
+ isCurrent: index === state.currentIndex,
488
+ scale,
489
+ eager: eagerAll || index < 3,
490
+ onSelect,
491
+ registerRef
492
+ }
493
+ ) }, `${slide.id ?? index}-${index}`))
494
+ }
495
+ );
496
+ };
497
+ function readHashIndex(hash) {
498
+ if (!hash || hash === "#" || hash === "#/") return void 0;
499
+ const match = hash.match(/^#\/(\d+)/);
500
+ if (!match) return void 0;
501
+ const oneBased = Number.parseInt(match[1] ?? "", 10);
502
+ if (!Number.isFinite(oneBased) || oneBased < 1) return void 0;
503
+ return oneBased - 1;
504
+ }
505
+ function readInitialHash() {
506
+ if (typeof window === "undefined") return void 0;
507
+ return readHashIndex(window.location.hash);
508
+ }
509
+ function formatHash(zeroBasedIndex) {
510
+ return `#/${zeroBasedIndex + 1}`;
511
+ }
512
+ function useDeckHashRouting(dispatch, opts) {
513
+ const { enabled = true, totalSlides, currentIndex } = opts;
514
+ useEffect(() => {
515
+ if (!enabled) return;
516
+ if (typeof window === "undefined") return;
517
+ const handler = () => {
518
+ const idx = readHashIndex(window.location.hash);
519
+ if (typeof idx !== "number") return;
520
+ const clamped = Math.max(0, Math.min(idx, Math.max(0, totalSlides - 1)));
521
+ dispatch({ type: "JUMP_TO", index: clamped });
522
+ };
523
+ window.addEventListener("hashchange", handler);
524
+ return () => window.removeEventListener("hashchange", handler);
525
+ }, [enabled, totalSlides, dispatch]);
526
+ useEffect(() => {
527
+ if (!enabled) return;
528
+ if (typeof window === "undefined") return;
529
+ const targetHash = formatHash(currentIndex);
530
+ if (window.location.hash === targetHash) return;
531
+ window.history.replaceState(null, "", targetHash);
532
+ }, [enabled, currentIndex]);
533
+ }
534
+ function isEditableTarget(target) {
535
+ if (!(target instanceof HTMLElement)) return false;
536
+ const tag = target.tagName;
537
+ if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return true;
538
+ if (target.isContentEditable) return true;
539
+ return false;
540
+ }
541
+ function useDeckKeyboard(dispatch, opts) {
542
+ const { enabled = true, totalSlides, onToggleFullscreen, onPrint } = opts;
543
+ useEffect(() => {
544
+ if (!enabled) return;
545
+ const handler = (event) => {
546
+ if (isEditableTarget(event.target)) return;
547
+ const key = event.key;
548
+ const isPrintCombo = (event.ctrlKey || event.metaKey) && (key === "p" || key === "P");
549
+ if (isPrintCombo) {
550
+ event.preventDefault();
551
+ onPrint?.();
552
+ return;
553
+ }
554
+ switch (key) {
555
+ case "ArrowRight":
556
+ case " ":
557
+ case "Spacebar":
558
+ case "PageDown":
559
+ dispatch({ type: "NEXT_SLIDE" });
560
+ break;
561
+ case "ArrowLeft":
562
+ case "PageUp":
563
+ dispatch({ type: "PREV_SLIDE" });
564
+ break;
565
+ case "Home":
566
+ dispatch({ type: "JUMP_TO", index: 0 });
567
+ break;
568
+ case "End":
569
+ dispatch({ type: "JUMP_TO", index: Math.max(0, totalSlides - 1) });
570
+ break;
571
+ case "Escape":
572
+ dispatch({ type: "SET_FULLSCREEN", value: false });
573
+ break;
574
+ case "f":
575
+ case "F":
576
+ onToggleFullscreen?.();
577
+ break;
578
+ case "n":
579
+ case "N":
580
+ case "p":
581
+ case "P":
582
+ dispatch({ type: "TOGGLE_PRESENTER" });
583
+ break;
584
+ default:
585
+ return;
586
+ }
587
+ };
588
+ document.addEventListener("keydown", handler);
589
+ return () => document.removeEventListener("keydown", handler);
590
+ }, [enabled, totalSlides, dispatch, onToggleFullscreen, onPrint]);
591
+ }
592
+ function deckReducer(state, action) {
593
+ switch (action.type) {
594
+ case "NEXT_SLIDE": {
595
+ if (state.currentFragment < state.totalFragmentsInCurrent) {
596
+ return { ...state, currentFragment: state.currentFragment + 1 };
597
+ }
598
+ const next = Math.min(state.currentIndex + 1, Math.max(0, state.totalSlides - 1));
599
+ if (next === state.currentIndex) return state;
600
+ return {
601
+ ...state,
602
+ currentIndex: next,
603
+ currentFragment: 0,
604
+ transitionDirection: "next"
605
+ };
606
+ }
607
+ case "PREV_SLIDE": {
608
+ if (state.currentFragment > 0) {
609
+ return { ...state, currentFragment: state.currentFragment - 1 };
610
+ }
611
+ const prev = Math.max(state.currentIndex - 1, 0);
612
+ if (prev === state.currentIndex) return state;
613
+ return {
614
+ ...state,
615
+ currentIndex: prev,
616
+ currentFragment: 0,
617
+ transitionDirection: "prev"
618
+ };
619
+ }
620
+ case "JUMP_TO": {
621
+ const clamped = Math.max(0, Math.min(action.index, Math.max(0, state.totalSlides - 1)));
622
+ if (clamped === state.currentIndex) return state;
623
+ return {
624
+ ...state,
625
+ currentIndex: clamped,
626
+ currentFragment: 0,
627
+ transitionDirection: "none"
628
+ };
629
+ }
630
+ case "NEXT_FRAGMENT": {
631
+ if (state.currentFragment >= state.totalFragmentsInCurrent) return state;
632
+ return { ...state, currentFragment: state.currentFragment + 1 };
633
+ }
634
+ case "PREV_FRAGMENT": {
635
+ if (state.currentFragment <= 0) return state;
636
+ return { ...state, currentFragment: state.currentFragment - 1 };
637
+ }
638
+ case "RESET_FRAGMENTS":
639
+ return { ...state, currentFragment: 0 };
640
+ case "TOGGLE_PRESENTER":
641
+ return { ...state, presenterMode: !state.presenterMode };
642
+ case "SET_FULLSCREEN":
643
+ return state.fullscreen === action.value ? state : { ...state, fullscreen: action.value };
644
+ case "UPDATE_TOTAL_SLIDES": {
645
+ const next = Math.max(0, action.total);
646
+ const clampedIdx = Math.max(0, Math.min(state.currentIndex, Math.max(0, next - 1)));
647
+ return { ...state, totalSlides: next, currentIndex: clampedIdx };
648
+ }
649
+ case "UPDATE_TOTAL_FRAGMENTS":
650
+ return { ...state, totalFragmentsInCurrent: Math.max(0, action.total) };
651
+ case "TRANSITION_END":
652
+ return state.transitionDirection === "none" ? state : { ...state, transitionDirection: "none" };
653
+ }
654
+ }
655
+ function initDeckState(init) {
656
+ const total = Math.max(0, init.totalSlides);
657
+ let idx = init.initialIndex ?? 0;
658
+ if (init.initFromHash) {
659
+ const fromHash = init.initFromHash();
660
+ if (typeof fromHash === "number" && Number.isFinite(fromHash)) {
661
+ idx = fromHash;
662
+ }
663
+ }
664
+ const clamped = Math.max(0, Math.min(idx, Math.max(0, total - 1)));
665
+ return {
666
+ currentIndex: clamped,
667
+ currentFragment: 0,
668
+ presenterMode: false,
669
+ fullscreen: false,
670
+ transitionDirection: "none",
671
+ totalSlides: total,
672
+ totalFragmentsInCurrent: 0
673
+ };
674
+ }
675
+ function useDeckState(opts) {
676
+ const [state, dispatch] = useReducer(deckReducer, opts, initDeckState);
677
+ return [state, dispatch];
678
+ }
679
+ var SWIPE_THRESHOLD_PX = 50;
680
+ var SWIPE_VELOCITY_PX_PER_MS = 0.3;
681
+ function useDeckSwipe(ref, dispatch, opts = {}) {
682
+ const { enabled = true } = opts;
683
+ useEffect(() => {
684
+ if (!enabled) return;
685
+ const el = ref.current;
686
+ if (!el) return;
687
+ let tracked = null;
688
+ const onPointerDown = (e) => {
689
+ if (tracked !== null) return;
690
+ tracked = {
691
+ pointerId: e.pointerId,
692
+ startX: e.clientX,
693
+ startY: e.clientY,
694
+ startedAt: e.timeStamp
695
+ };
696
+ };
697
+ const onPointerUp = (e) => {
698
+ if (!tracked || e.pointerId !== tracked.pointerId) return;
699
+ const dx = e.clientX - tracked.startX;
700
+ const dy = e.clientY - tracked.startY;
701
+ const dt = Math.max(1, e.timeStamp - tracked.startedAt);
702
+ tracked = null;
703
+ const absDx = Math.abs(dx);
704
+ const absDy = Math.abs(dy);
705
+ const velocity = absDx / dt;
706
+ if (absDx < absDy * 2) return;
707
+ if (absDx < SWIPE_THRESHOLD_PX) return;
708
+ if (velocity < SWIPE_VELOCITY_PX_PER_MS) return;
709
+ if (dx < 0) {
710
+ dispatch({ type: "NEXT_SLIDE" });
711
+ } else if (dx > 0) {
712
+ dispatch({ type: "PREV_SLIDE" });
713
+ }
714
+ };
715
+ const onPointerCancel = (e) => {
716
+ if (tracked && e.pointerId === tracked.pointerId) {
717
+ tracked = null;
718
+ }
719
+ };
720
+ el.addEventListener("pointerdown", onPointerDown);
721
+ el.addEventListener("pointerup", onPointerUp);
722
+ el.addEventListener("pointercancel", onPointerCancel);
723
+ return () => {
724
+ el.removeEventListener("pointerdown", onPointerDown);
725
+ el.removeEventListener("pointerup", onPointerUp);
726
+ el.removeEventListener("pointercancel", onPointerCancel);
727
+ };
728
+ }, [enabled, ref, dispatch]);
729
+ }
730
+ function isFullscreenSupported() {
731
+ if (typeof document === "undefined") return false;
732
+ const doc = document;
733
+ const el = document.documentElement;
734
+ return Boolean(el.requestFullscreen ?? el.webkitRequestFullscreen) && Boolean(doc.exitFullscreen ?? doc.webkitExitFullscreen);
735
+ }
736
+ function currentFullscreenElement() {
737
+ if (typeof document === "undefined") return null;
738
+ const doc = document;
739
+ return document.fullscreenElement ?? doc.webkitFullscreenElement ?? null;
740
+ }
741
+ function useFullscreen(ref) {
742
+ const supported = isFullscreenSupported();
743
+ const [isFullscreen, setFullscreen] = useState(false);
744
+ useEffect(() => {
745
+ if (!supported) return;
746
+ const handler = () => {
747
+ setFullscreen(currentFullscreenElement() !== null);
748
+ };
749
+ document.addEventListener("fullscreenchange", handler);
750
+ document.addEventListener("webkitfullscreenchange", handler);
751
+ return () => {
752
+ document.removeEventListener("fullscreenchange", handler);
753
+ document.removeEventListener("webkitfullscreenchange", handler);
754
+ };
755
+ }, [supported]);
756
+ const toggle = useCallback(async () => {
757
+ if (!supported) return;
758
+ const el = ref.current;
759
+ if (!el) return;
760
+ const doc = document;
761
+ try {
762
+ if (currentFullscreenElement()) {
763
+ await (doc.exitFullscreen?.() ?? doc.webkitExitFullscreen?.());
764
+ } else {
765
+ await (el.requestFullscreen?.() ?? el.webkitRequestFullscreen?.());
766
+ }
767
+ } catch {
768
+ }
769
+ }, [ref, supported]);
770
+ return { isFullscreen, toggle, isSupported: supported };
771
+ }
772
+ function generateDeckId() {
773
+ if (typeof crypto !== "undefined" && "randomUUID" in crypto) {
774
+ return crypto.randomUUID();
775
+ }
776
+ return `deck-${Math.random().toString(36).slice(2, 10)}`;
777
+ }
778
+ var SlideDeckBase = ({
779
+ slides: slidesInput,
780
+ initialIndex = 0,
781
+ transition = "fade",
782
+ enableKeyboard = true,
783
+ enableTouch = true,
784
+ enableHashRouting = true,
785
+ deckId: deckIdProp,
786
+ onIndexChange,
787
+ children,
788
+ className,
789
+ "aria-label": ariaLabel = "Slide deck",
790
+ plugins
791
+ }) => {
792
+ const generatedId = useId();
793
+ const deckId = deckIdProp ?? generatedId ?? generateDeckId();
794
+ const rootRef = useRef(null);
795
+ const [parsedSlides, setParsedSlides] = useState(() => {
796
+ return Array.isArray(slidesInput) ? slidesInput : [];
797
+ });
798
+ useEffect(() => {
799
+ if (Array.isArray(slidesInput)) {
800
+ setParsedSlides(slidesInput);
801
+ return;
802
+ }
803
+ let cancelled = false;
804
+ splitDeck(slidesInput).then(
805
+ (result) => {
806
+ if (!cancelled) setParsedSlides(result);
807
+ },
808
+ () => {
809
+ if (!cancelled) setParsedSlides([]);
810
+ }
811
+ );
812
+ return () => {
813
+ cancelled = true;
814
+ };
815
+ }, [slidesInput]);
816
+ const [state, dispatch] = useDeckState({
817
+ initialIndex,
818
+ totalSlides: parsedSlides.length,
819
+ initFromHash: enableHashRouting ? readInitialHash : void 0
820
+ });
821
+ const previousLengthRef = useRef(0);
822
+ useEffect(() => {
823
+ const length = parsedSlides.length;
824
+ dispatch({ type: "UPDATE_TOTAL_SLIDES", total: length });
825
+ if (previousLengthRef.current === 0 && length > 0) {
826
+ let target = initialIndex;
827
+ if (enableHashRouting) {
828
+ const hashIdx = readInitialHash();
829
+ if (typeof hashIdx === "number") target = hashIdx;
830
+ }
831
+ if (target > 0) {
832
+ dispatch({ type: "JUMP_TO", index: target });
833
+ }
834
+ }
835
+ previousLengthRef.current = length;
836
+ }, [parsedSlides.length, dispatch, initialIndex, enableHashRouting]);
837
+ useEffect(() => {
838
+ const current = parsedSlides[state.currentIndex];
839
+ const count = current ? countFragmentsInMarkdown(current.markdown) : 0;
840
+ dispatch({ type: "UPDATE_TOTAL_FRAGMENTS", total: count });
841
+ }, [parsedSlides, state.currentIndex, dispatch]);
842
+ const fullscreen = useFullscreen(rootRef);
843
+ useEffect(() => {
844
+ dispatch({ type: "SET_FULLSCREEN", value: fullscreen.isFullscreen });
845
+ }, [fullscreen.isFullscreen, dispatch]);
846
+ useEffect(() => {
847
+ if (state.transitionDirection === "none") return;
848
+ const t = setTimeout(() => dispatch({ type: "TRANSITION_END" }), 300);
849
+ return () => clearTimeout(t);
850
+ }, [state.transitionDirection, dispatch]);
851
+ const onPrint = useCallback(() => {
852
+ printDeck();
853
+ }, []);
854
+ useDeckKeyboard(dispatch, {
855
+ enabled: enableKeyboard,
856
+ totalSlides: parsedSlides.length,
857
+ onToggleFullscreen: fullscreen.toggle,
858
+ onPrint
859
+ });
860
+ useDeckSwipe(rootRef, dispatch, { enabled: enableTouch });
861
+ useDeckHashRouting(dispatch, {
862
+ enabled: enableHashRouting,
863
+ totalSlides: parsedSlides.length,
864
+ currentIndex: state.currentIndex
865
+ });
866
+ const lastIndexRef = useRef(state.currentIndex);
867
+ useEffect(() => {
868
+ if (lastIndexRef.current !== state.currentIndex) {
869
+ lastIndexRef.current = state.currentIndex;
870
+ onIndexChange?.(state.currentIndex, parsedSlides[state.currentIndex]);
871
+ }
872
+ }, [state.currentIndex, parsedSlides, onIndexChange]);
873
+ const contextValue = useMemo(
874
+ () => ({
875
+ state,
876
+ dispatch,
877
+ slides: parsedSlides,
878
+ transition,
879
+ deckId,
880
+ plugins,
881
+ toggleFullscreen: fullscreen.toggle,
882
+ print: onPrint
883
+ }),
884
+ [state, dispatch, parsedSlides, transition, deckId, plugins, fullscreen.toggle, onPrint]
885
+ );
886
+ return /* @__PURE__ */ jsx(DeckContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
887
+ "div",
888
+ {
889
+ ref: rootRef,
890
+ "aria-roledescription": "slide deck",
891
+ "aria-label": ariaLabel,
892
+ "data-theo-slide-deck": true,
893
+ "data-theo-slide-deck-fullscreen": state.fullscreen ? "true" : void 0,
894
+ className: ["theo-slide-deck", className].filter(Boolean).join(" "),
895
+ style: { position: "relative", width: "100%", height: "100%" },
896
+ children: [
897
+ /* @__PURE__ */ jsx(
898
+ "div",
899
+ {
900
+ role: "status",
901
+ "aria-live": "polite",
902
+ "aria-atomic": "true",
903
+ style: {
904
+ position: "absolute",
905
+ width: 1,
906
+ height: 1,
907
+ padding: 0,
908
+ margin: -1,
909
+ overflow: "hidden",
910
+ clip: "rect(0,0,0,0)",
911
+ whiteSpace: "nowrap",
912
+ border: 0
913
+ },
914
+ children: parsedSlides.length > 0 ? `Slide ${state.currentIndex + 1} of ${parsedSlides.length}` : "Empty deck"
915
+ }
916
+ ),
917
+ children ?? /* @__PURE__ */ jsx(DefaultDeckLayout, {}),
918
+ /* @__PURE__ */ jsx(PrintContainer, { slides: parsedSlides, plugins })
919
+ ]
920
+ }
921
+ ) });
922
+ };
923
+ var SlidesView = ({ className }) => {
924
+ const { state, slides, transition, plugins } = useDeckContext();
925
+ const current = slides[state.currentIndex];
926
+ return /* @__PURE__ */ jsx(
927
+ "div",
928
+ {
929
+ className: ["theo-slide-deck-slide-frame", className].filter(Boolean).join(" "),
930
+ "data-theo-slide-deck-transition": transition,
931
+ "data-theo-slide-deck-direction": state.transitionDirection,
932
+ style: {
933
+ position: "relative",
934
+ width: "100%",
935
+ height: "100%",
936
+ minHeight: 0,
937
+ overflow: "hidden"
938
+ },
939
+ children: current ? /* @__PURE__ */ jsx(
940
+ "div",
941
+ {
942
+ "data-theo-slide-deck-slide-state": "incoming",
943
+ style: { position: "absolute", inset: 0 },
944
+ children: /* @__PURE__ */ jsx(
945
+ Slide,
946
+ {
947
+ markdown: current.markdown,
948
+ plugins,
949
+ "aria-label": `Slide ${state.currentIndex + 1}`
950
+ }
951
+ )
952
+ },
953
+ state.currentIndex
954
+ ) : /* @__PURE__ */ jsx(
955
+ "div",
956
+ {
957
+ "data-theo-slide-deck-empty": true,
958
+ style: {
959
+ display: "grid",
960
+ placeItems: "center",
961
+ height: "100%",
962
+ opacity: 0.6,
963
+ fontSize: 14
964
+ },
965
+ children: "Empty deck"
966
+ }
967
+ )
968
+ }
969
+ );
970
+ };
971
+ var PresenterButton = ({ className }) => {
972
+ const { state, dispatch } = useDeckContext();
973
+ return /* @__PURE__ */ jsx(
974
+ "button",
975
+ {
976
+ type: "button",
977
+ onClick: () => dispatch({ type: "TOGGLE_PRESENTER" }),
978
+ "aria-pressed": state.presenterMode,
979
+ "aria-label": state.presenterMode ? "Close presenter view" : "Open presenter view",
980
+ className: ["theo-slide-deck-presenter-button", className].filter(Boolean).join(" "),
981
+ children: state.presenterMode ? "Close presenter" : "Presenter"
982
+ }
983
+ );
984
+ };
985
+ var FullscreenButton = ({ className }) => {
986
+ const { state, toggleFullscreen } = useDeckContext();
987
+ return /* @__PURE__ */ jsx(
988
+ "button",
989
+ {
990
+ type: "button",
991
+ onClick: () => void toggleFullscreen(),
992
+ "aria-pressed": state.fullscreen,
993
+ "aria-label": state.fullscreen ? "Exit fullscreen" : "Enter fullscreen",
994
+ className: ["theo-slide-deck-fullscreen-button", className].filter(Boolean).join(" "),
995
+ children: state.fullscreen ? "Exit fullscreen" : "Fullscreen"
996
+ }
997
+ );
998
+ };
999
+ var PrintButton = ({ className }) => {
1000
+ const { print } = useDeckContext();
1001
+ return /* @__PURE__ */ jsx(
1002
+ "button",
1003
+ {
1004
+ type: "button",
1005
+ onClick: () => print(),
1006
+ "aria-label": "Print or save deck as PDF",
1007
+ className: ["theo-slide-deck-print-button", className].filter(Boolean).join(" "),
1008
+ children: "Print"
1009
+ }
1010
+ );
1011
+ };
1012
+ var PrintContainer = ({
1013
+ slides,
1014
+ plugins
1015
+ }) => {
1016
+ return /* @__PURE__ */ jsx(
1017
+ "div",
1018
+ {
1019
+ className: "theo-slide-deck-print-container",
1020
+ "aria-hidden": "true",
1021
+ style: {
1022
+ position: "absolute",
1023
+ inset: 0,
1024
+ pointerEvents: "none",
1025
+ visibility: "hidden"
1026
+ },
1027
+ children: slides.map((slide, index) => /* @__PURE__ */ jsx(
1028
+ "div",
1029
+ {
1030
+ className: "theo-slide-deck-print-slide",
1031
+ style: { width: 1280, height: 720 },
1032
+ children: /* @__PURE__ */ jsx(
1033
+ Slide,
1034
+ {
1035
+ markdown: slide.markdown,
1036
+ plugins,
1037
+ "aria-label": `Print slide ${index + 1}`
1038
+ }
1039
+ )
1040
+ },
1041
+ `print-${slide.id ?? index}`
1042
+ ))
1043
+ }
1044
+ );
1045
+ };
1046
+ var DefaultDeckLayout = () => {
1047
+ return /* @__PURE__ */ jsxs(
1048
+ "div",
1049
+ {
1050
+ className: "theo-slide-deck-default-layout",
1051
+ style: {
1052
+ display: "grid",
1053
+ gridTemplateColumns: "1fr",
1054
+ gridTemplateRows: "1fr auto",
1055
+ gap: 8,
1056
+ height: "100%"
1057
+ },
1058
+ children: [
1059
+ /* @__PURE__ */ jsx(SlidesView, {}),
1060
+ /* @__PURE__ */ jsxs(
1061
+ "div",
1062
+ {
1063
+ style: {
1064
+ display: "flex",
1065
+ alignItems: "center",
1066
+ justifyContent: "space-between",
1067
+ gap: 8,
1068
+ padding: "4px 8px",
1069
+ flexWrap: "wrap"
1070
+ },
1071
+ children: [
1072
+ /* @__PURE__ */ jsx(Controls, {}),
1073
+ /* @__PURE__ */ jsx(ProgressBar, {}),
1074
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 4 }, children: [
1075
+ /* @__PURE__ */ jsx(PresenterButton, {}),
1076
+ /* @__PURE__ */ jsx(FullscreenButton, {}),
1077
+ /* @__PURE__ */ jsx(PrintButton, {})
1078
+ ] })
1079
+ ]
1080
+ }
1081
+ ),
1082
+ /* @__PURE__ */ jsx(SlideNumber, {}),
1083
+ /* @__PURE__ */ jsx(PresenterView, {})
1084
+ ]
1085
+ }
1086
+ );
1087
+ };
1088
+ var SlideDeck = SlideDeckBase;
1089
+ SlideDeck.Slides = SlidesView;
1090
+ SlideDeck.Controls = Controls;
1091
+ SlideDeck.ProgressBar = ProgressBar;
1092
+ SlideDeck.SlideNumber = SlideNumber;
1093
+ SlideDeck.Thumbnails = Thumbnails;
1094
+ SlideDeck.PresenterView = PresenterView;
1095
+ SlideDeck.PresenterButton = PresenterButton;
1096
+ SlideDeck.FullscreenButton = FullscreenButton;
1097
+ SlideDeck.PrintButton = PrintButton;
1098
+ var slideDeckSlide = z.object({
1099
+ /** Markdown content of this slide. Capped at 50 KB (same as Slide body). */
1100
+ markdown: z.string().max(5e4),
1101
+ /** Optional id for hash routing (defaults to numeric index, 1-based). */
1102
+ id: z.string().regex(/^[a-z0-9-]+$/, "id must be lowercase kebab-case").max(64).optional(),
1103
+ /** Speaker notes (plain text extracted from <!-- notes: ... --> comments). */
1104
+ notes: z.string().max(5e3).optional()
1105
+ });
1106
+ var slideDeckInput = z.union([z.string().max(5e5), z.array(slideDeckSlide).max(500)]);
1107
+ var slideDeckTransition = z.enum(["none", "fade", "slide"]);
1108
+
1109
+ export { Controls, DeckContext, PresenterView, ProgressBar, SlideDeck, SlideNumber, Thumbnails, countFragmentsInMarkdown, deckReducer, extractNotes, formatHash, injectPrintStyles, printDeck, readHashIndex, readInitialHash, removePrintStyles, slideDeckInput, slideDeckSlide, slideDeckTransition, splitDeck, useDeckContext, useDeckHashRouting, useDeckKeyboard, useDeckState, useDeckSwipe, useFullscreen };
1110
+ //# sourceMappingURL=index.js.map
1111
+ //# sourceMappingURL=index.js.map