@intellectif/lk-react 23.1.0 → 23.1.2

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 (360) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +9 -5
  3. package/dist/ActivityErrorBoundary-B379hvtL.cjs +39 -0
  4. package/dist/ActivityErrorBoundary-B379hvtL.cjs.map +1 -0
  5. package/dist/ActivityErrorBoundary-Dw6SbWv3.js +34 -0
  6. package/dist/ActivityErrorBoundary-Dw6SbWv3.js.map +1 -0
  7. package/dist/ActivityMedia-CQQTRNl7.cjs +641 -0
  8. package/dist/ActivityMedia-CQQTRNl7.cjs.map +1 -0
  9. package/dist/ActivityMedia-vDiP-Psa.js +636 -0
  10. package/dist/ActivityMedia-vDiP-Psa.js.map +1 -0
  11. package/dist/ActivityPreview-1hhTkYuj.js +240 -0
  12. package/dist/ActivityPreview-1hhTkYuj.js.map +1 -0
  13. package/dist/ActivityPreview-BKr34exz.cjs +245 -0
  14. package/dist/ActivityPreview-BKr34exz.cjs.map +1 -0
  15. package/dist/ActivitySequence-CkX87pfB.js +839 -0
  16. package/dist/ActivitySequence-CkX87pfB.js.map +1 -0
  17. package/dist/ActivitySequence-CmoSyDnp.cjs +844 -0
  18. package/dist/ActivitySequence-CmoSyDnp.cjs.map +1 -0
  19. package/dist/Dictation-BlxRp-3k.js +926 -0
  20. package/dist/Dictation-BlxRp-3k.js.map +1 -0
  21. package/dist/Dictation-jECzL88E.cjs +931 -0
  22. package/dist/Dictation-jECzL88E.cjs.map +1 -0
  23. package/dist/FeedbackRegion-BNNMtTY-.cjs +108 -0
  24. package/dist/FeedbackRegion-BNNMtTY-.cjs.map +1 -0
  25. package/dist/FeedbackRegion-CyPSp8bA.js +85 -0
  26. package/dist/FeedbackRegion-CyPSp8bA.js.map +1 -0
  27. package/dist/FillInTheBlanks-B6xzqYXx.js +474 -0
  28. package/dist/FillInTheBlanks-B6xzqYXx.js.map +1 -0
  29. package/dist/FillInTheBlanks-BpKhdHg2.cjs +479 -0
  30. package/dist/FillInTheBlanks-BpKhdHg2.cjs.map +1 -0
  31. package/dist/GapSelect-DUSiaEQH.js +441 -0
  32. package/dist/GapSelect-DUSiaEQH.js.map +1 -0
  33. package/dist/GapSelect-payTq_Zn.cjs +446 -0
  34. package/dist/GapSelect-payTq_Zn.cjs.map +1 -0
  35. package/dist/InteractiveVideo-BguGv-HA.cjs +2955 -0
  36. package/dist/InteractiveVideo-BguGv-HA.cjs.map +1 -0
  37. package/dist/InteractiveVideo-Cg2jbU3j.js +2944 -0
  38. package/dist/InteractiveVideo-Cg2jbU3j.js.map +1 -0
  39. package/dist/LkAiProvider-DAPpA3PQ.d.cts +84 -0
  40. package/dist/LkAiProvider-DAPpA3PQ.d.cts.map +1 -0
  41. package/dist/LkAiProvider-QdEcIhoo.d.ts +84 -0
  42. package/dist/LkAiProvider-QdEcIhoo.d.ts.map +1 -0
  43. package/dist/LkIntlProvider-D_FdYXjQ.js +375 -0
  44. package/dist/LkIntlProvider-D_FdYXjQ.js.map +1 -0
  45. package/dist/LkIntlProvider-oi57lYB0.cjs +410 -0
  46. package/dist/LkIntlProvider-oi57lYB0.cjs.map +1 -0
  47. package/dist/MultipleChoice-COn5MtKY.cjs +433 -0
  48. package/dist/MultipleChoice-COn5MtKY.cjs.map +1 -0
  49. package/dist/MultipleChoice-Dra0_KYD.js +428 -0
  50. package/dist/MultipleChoice-Dra0_KYD.js.map +1 -0
  51. package/dist/PronunciationFeedback-DlMPGjkR.cjs +831 -0
  52. package/dist/PronunciationFeedback-DlMPGjkR.cjs.map +1 -0
  53. package/dist/PronunciationFeedback-Dxd6XPkO.js +772 -0
  54. package/dist/PronunciationFeedback-Dxd6XPkO.js.map +1 -0
  55. package/dist/ReadAloud-C8RhaUqV.js +1092 -0
  56. package/dist/{chunk-DC4CQCK5.js.map → ReadAloud-C8RhaUqV.js.map} +1 -1
  57. package/dist/ReadAloud-akDehitT.cjs +1103 -0
  58. package/dist/ReadAloud-akDehitT.cjs.map +1 -0
  59. package/dist/StimulusPanel-BgzByfkb.js +74 -0
  60. package/dist/StimulusPanel-BgzByfkb.js.map +1 -0
  61. package/dist/StimulusPanel-b66gaN3i.cjs +79 -0
  62. package/dist/StimulusPanel-b66gaN3i.cjs.map +1 -0
  63. package/dist/ThemeProvider-B6DyGqzh.d.cts +62 -0
  64. package/dist/ThemeProvider-B6DyGqzh.d.cts.map +1 -0
  65. package/dist/ThemeProvider-BCrxBaY-.d.ts +62 -0
  66. package/dist/ThemeProvider-BCrxBaY-.d.ts.map +1 -0
  67. package/dist/ThemeProvider-BRN1tj4n.cjs +187 -0
  68. package/dist/ThemeProvider-BRN1tj4n.cjs.map +1 -0
  69. package/dist/ThemeProvider-C7K9iMLX.js +158 -0
  70. package/dist/ThemeProvider-C7K9iMLX.js.map +1 -0
  71. package/dist/WrittenResponse-Bj3eFmGl.cjs +491 -0
  72. package/dist/WrittenResponse-Bj3eFmGl.cjs.map +1 -0
  73. package/dist/WrittenResponse-Cl8G6nO_.js +486 -0
  74. package/dist/WrittenResponse-Cl8G6nO_.js.map +1 -0
  75. package/dist/ai/LkAiProvider.cjs +34 -14
  76. package/dist/ai/LkAiProvider.cjs.map +1 -1
  77. package/dist/ai/LkAiProvider.d.cts +2 -83
  78. package/dist/ai/LkAiProvider.d.ts +2 -83
  79. package/dist/ai/LkAiProvider.js +33 -2
  80. package/dist/ai/LkAiProvider.js.map +1 -1
  81. package/dist/ai/useAiHelp.cjs +7 -25
  82. package/dist/ai/useAiHelp.d.cts +175 -177
  83. package/dist/ai/useAiHelp.d.cts.map +1 -0
  84. package/dist/ai/useAiHelp.d.ts +175 -177
  85. package/dist/ai/useAiHelp.d.ts.map +1 -0
  86. package/dist/ai/useAiHelp.js +3 -4
  87. package/dist/components/ActivityPreview.cjs +3 -29
  88. package/dist/components/ActivityPreview.d.cts +2 -81
  89. package/dist/components/ActivityPreview.d.ts +2 -81
  90. package/dist/components/ActivityPreview.js +2 -20
  91. package/dist/components/ActivitySequence.cjs +3 -30
  92. package/dist/components/ActivitySequence.d.cts +2 -432
  93. package/dist/components/ActivitySequence.d.ts +2 -432
  94. package/dist/components/ActivitySequence.js +2 -21
  95. package/dist/components/Dictation.cjs +4 -21
  96. package/dist/components/Dictation.d.cts +2 -19
  97. package/dist/components/Dictation.d.ts +2 -19
  98. package/dist/components/Dictation.js +3 -12
  99. package/dist/components/FillInTheBlanks.cjs +4 -20
  100. package/dist/components/FillInTheBlanks.d.cts +2 -30
  101. package/dist/components/FillInTheBlanks.d.ts +2 -30
  102. package/dist/components/FillInTheBlanks.js +3 -11
  103. package/dist/components/GapSelect.cjs +4 -20
  104. package/dist/components/GapSelect.d.cts +2 -27
  105. package/dist/components/GapSelect.d.ts +2 -27
  106. package/dist/components/GapSelect.js +3 -11
  107. package/dist/components/InteractiveVideo.cjs +5 -32
  108. package/dist/components/InteractiveVideo.d.cts +3 -291
  109. package/dist/components/InteractiveVideo.d.ts +3 -291
  110. package/dist/components/InteractiveVideo.js +3 -19
  111. package/dist/components/MultipleChoice.cjs +4 -20
  112. package/dist/components/MultipleChoice.d.cts +2 -26
  113. package/dist/components/MultipleChoice.d.ts +2 -26
  114. package/dist/components/MultipleChoice.js +3 -11
  115. package/dist/components/PronunciationFeedback.cjs +4 -17
  116. package/dist/components/PronunciationFeedback.d.cts +2 -90
  117. package/dist/components/PronunciationFeedback.d.ts +2 -90
  118. package/dist/components/PronunciationFeedback.js +3 -8
  119. package/dist/components/ReadAloud.cjs +4 -22
  120. package/dist/components/ReadAloud.d.cts +7 -11
  121. package/dist/components/ReadAloud.d.cts.map +1 -0
  122. package/dist/components/ReadAloud.d.ts +7 -11
  123. package/dist/components/ReadAloud.d.ts.map +1 -0
  124. package/dist/components/ReadAloud.js +3 -13
  125. package/dist/components/StimulusPanel.cjs +3 -14
  126. package/dist/components/StimulusPanel.d.cts +2 -51
  127. package/dist/components/StimulusPanel.d.ts +2 -51
  128. package/dist/components/StimulusPanel.js +2 -5
  129. package/dist/components/WrittenResponse.cjs +4 -19
  130. package/dist/components/WrittenResponse.d.cts +3 -18
  131. package/dist/components/WrittenResponse.d.ts +3 -18
  132. package/dist/components/WrittenResponse.js +3 -10
  133. package/dist/direction-Dq0_HtA5.js +183 -0
  134. package/dist/direction-Dq0_HtA5.js.map +1 -0
  135. package/dist/direction-K1pj0HCA.cjs +200 -0
  136. package/dist/direction-K1pj0HCA.cjs.map +1 -0
  137. package/dist/hooks/useActivityState.cjs +28 -10
  138. package/dist/hooks/useActivityState.cjs.map +1 -1
  139. package/dist/hooks/useActivityState.d.cts +25 -24
  140. package/dist/hooks/useActivityState.d.cts.map +1 -0
  141. package/dist/hooks/useActivityState.d.ts +25 -24
  142. package/dist/hooks/useActivityState.d.ts.map +1 -0
  143. package/dist/hooks/useActivityState.js +28 -2
  144. package/dist/hooks/useActivityState.js.map +1 -1
  145. package/dist/hooks/useSpeechRecorder.cjs +5 -16
  146. package/dist/hooks/useSpeechRecorder.d.cts +2 -127
  147. package/dist/hooks/useSpeechRecorder.d.ts +2 -127
  148. package/dist/hooks/useSpeechRecorder.js +3 -3
  149. package/dist/hooks/useXAPI.cjs +126 -10
  150. package/dist/hooks/useXAPI.cjs.map +1 -1
  151. package/dist/hooks/useXAPI.d.cts +14 -14
  152. package/dist/hooks/useXAPI.d.cts.map +1 -0
  153. package/dist/hooks/useXAPI.d.ts +14 -14
  154. package/dist/hooks/useXAPI.d.ts.map +1 -0
  155. package/dist/hooks/useXAPI.js +126 -2
  156. package/dist/hooks/useXAPI.js.map +1 -1
  157. package/dist/i18n/LkIntlProvider.cjs +9 -32
  158. package/dist/i18n/LkIntlProvider.d.cts +34 -38
  159. package/dist/i18n/LkIntlProvider.d.cts.map +1 -0
  160. package/dist/i18n/LkIntlProvider.d.ts +34 -38
  161. package/dist/i18n/LkIntlProvider.d.ts.map +1 -0
  162. package/dist/i18n/LkIntlProvider.js +3 -3
  163. package/dist/index-6P4rJHrJ.d.cts +432 -0
  164. package/dist/index-6P4rJHrJ.d.cts.map +1 -0
  165. package/dist/index-90CX504k.d.ts +90 -0
  166. package/dist/index-90CX504k.d.ts.map +1 -0
  167. package/dist/index-B_SgnjsC.d.cts +291 -0
  168. package/dist/index-B_SgnjsC.d.cts.map +1 -0
  169. package/dist/index-BavVW5z5.d.cts +25 -0
  170. package/dist/index-BavVW5z5.d.cts.map +1 -0
  171. package/dist/index-BhHv6Fiu.d.cts +28 -0
  172. package/dist/index-BhHv6Fiu.d.cts.map +1 -0
  173. package/dist/index-Bsu8VciA.d.ts +432 -0
  174. package/dist/index-Bsu8VciA.d.ts.map +1 -0
  175. package/dist/index-C1KGpD1k.d.ts +49 -0
  176. package/dist/index-C1KGpD1k.d.ts.map +1 -0
  177. package/dist/index-CKTpYTCC.d.cts +49 -0
  178. package/dist/index-CKTpYTCC.d.cts.map +1 -0
  179. package/dist/index-CO_SRFJj.d.ts +16 -0
  180. package/dist/index-CO_SRFJj.d.ts.map +1 -0
  181. package/dist/index-CSsuUsP7.d.cts +124 -0
  182. package/dist/index-CSsuUsP7.d.cts.map +1 -0
  183. package/dist/index-CunUyeuN.d.cts +78 -0
  184. package/dist/index-CunUyeuN.d.cts.map +1 -0
  185. package/dist/index-CzfRzks6.d.cts +90 -0
  186. package/dist/index-CzfRzks6.d.cts.map +1 -0
  187. package/dist/index-D14xtpBS.d.cts +24 -0
  188. package/dist/index-D14xtpBS.d.cts.map +1 -0
  189. package/dist/index-DHRPAPZf.d.ts +291 -0
  190. package/dist/index-DHRPAPZf.d.ts.map +1 -0
  191. package/dist/index-DLV6cK26.d.cts +16 -0
  192. package/dist/index-DLV6cK26.d.cts.map +1 -0
  193. package/dist/index-DbCCQ9cP.d.ts +124 -0
  194. package/dist/index-DbCCQ9cP.d.ts.map +1 -0
  195. package/dist/index-DeV5B2m5.d.ts +24 -0
  196. package/dist/index-DeV5B2m5.d.ts.map +1 -0
  197. package/dist/index-TZCJVSge.d.ts +28 -0
  198. package/dist/index-TZCJVSge.d.ts.map +1 -0
  199. package/dist/index-ZVvLHsd3.d.ts +25 -0
  200. package/dist/index-ZVvLHsd3.d.ts.map +1 -0
  201. package/dist/index-eQwBgpSw.d.ts +78 -0
  202. package/dist/index-eQwBgpSw.d.ts.map +1 -0
  203. package/dist/index.cjs +118 -163
  204. package/dist/index.cjs.map +1 -1
  205. package/dist/index.d.cts +20 -24
  206. package/dist/index.d.ts +20 -24
  207. package/dist/index.js +84 -29
  208. package/dist/index.js.map +1 -1
  209. package/dist/theme/ThemeProvider.cjs +8 -28
  210. package/dist/theme/ThemeProvider.d.cts +2 -59
  211. package/dist/theme/ThemeProvider.d.ts +2 -59
  212. package/dist/theme/ThemeProvider.js +3 -3
  213. package/dist/tries-CbbtZkdG.cjs +363 -0
  214. package/dist/tries-CbbtZkdG.cjs.map +1 -0
  215. package/dist/tries-DTHSrLCm.js +310 -0
  216. package/dist/tries-DTHSrLCm.js.map +1 -0
  217. package/dist/types-BOQd93x3.d.cts +994 -0
  218. package/dist/types-BOQd93x3.d.cts.map +1 -0
  219. package/dist/types-HIrgF_mS.d.ts +994 -0
  220. package/dist/types-HIrgF_mS.d.ts.map +1 -0
  221. package/dist/useAiHelp-B-ccDL5Q.js +906 -0
  222. package/dist/useAiHelp-B-ccDL5Q.js.map +1 -0
  223. package/dist/useAiHelp-h9yOLFqt.cjs +995 -0
  224. package/dist/useAiHelp-h9yOLFqt.cjs.map +1 -0
  225. package/dist/useSpeechRecorder--O_f-xvt.cjs +720 -0
  226. package/dist/useSpeechRecorder--O_f-xvt.cjs.map +1 -0
  227. package/dist/useSpeechRecorder-DtAYvl02.d.cts +154 -0
  228. package/dist/useSpeechRecorder-DtAYvl02.d.cts.map +1 -0
  229. package/dist/useSpeechRecorder-DtAYvl02.d.ts +154 -0
  230. package/dist/useSpeechRecorder-DtAYvl02.d.ts.map +1 -0
  231. package/dist/useSpeechRecorder-zIi9Dlw8.js +709 -0
  232. package/dist/useSpeechRecorder-zIi9Dlw8.js.map +1 -0
  233. package/package.json +10 -11
  234. package/dist/WrittenResponse-B7A5gHMj.d.ts +0 -115
  235. package/dist/WrittenResponse-BpL9p2Hn.d.cts +0 -115
  236. package/dist/ai/useAiHelp.cjs.map +0 -1
  237. package/dist/ai/useAiHelp.js.map +0 -1
  238. package/dist/chunk-2PNSVBLQ.cjs +0 -54
  239. package/dist/chunk-2PNSVBLQ.cjs.map +0 -1
  240. package/dist/chunk-2TW6WLBC.js +0 -80
  241. package/dist/chunk-2TW6WLBC.js.map +0 -1
  242. package/dist/chunk-4ZZWZSWI.js +0 -61
  243. package/dist/chunk-4ZZWZSWI.js.map +0 -1
  244. package/dist/chunk-6N43WDVG.js +0 -29
  245. package/dist/chunk-6N43WDVG.js.map +0 -1
  246. package/dist/chunk-7ALBSPYR.cjs +0 -436
  247. package/dist/chunk-7ALBSPYR.cjs.map +0 -1
  248. package/dist/chunk-7NFY3M3W.js +0 -234
  249. package/dist/chunk-7NFY3M3W.js.map +0 -1
  250. package/dist/chunk-7SB2MJA4.js +0 -29
  251. package/dist/chunk-7SB2MJA4.js.map +0 -1
  252. package/dist/chunk-ABJJ3LII.js +0 -434
  253. package/dist/chunk-ABJJ3LII.js.map +0 -1
  254. package/dist/chunk-BIGGXHAW.cjs +0 -342
  255. package/dist/chunk-BIGGXHAW.cjs.map +0 -1
  256. package/dist/chunk-C7QZE5BI.js +0 -430
  257. package/dist/chunk-C7QZE5BI.js.map +0 -1
  258. package/dist/chunk-CWTUWNV3.cjs +0 -2937
  259. package/dist/chunk-CWTUWNV3.cjs.map +0 -1
  260. package/dist/chunk-DC4CQCK5.js +0 -915
  261. package/dist/chunk-DS6HN3YR.cjs +0 -496
  262. package/dist/chunk-DS6HN3YR.cjs.map +0 -1
  263. package/dist/chunk-FDQR4GAZ.js +0 -240
  264. package/dist/chunk-FDQR4GAZ.js.map +0 -1
  265. package/dist/chunk-FKGMSOJF.js +0 -394
  266. package/dist/chunk-FKGMSOJF.js.map +0 -1
  267. package/dist/chunk-G6PXJ2SA.js +0 -823
  268. package/dist/chunk-G6PXJ2SA.js.map +0 -1
  269. package/dist/chunk-HNLRVRQR.js +0 -335
  270. package/dist/chunk-HNLRVRQR.js.map +0 -1
  271. package/dist/chunk-J3C72RPK.cjs +0 -31
  272. package/dist/chunk-J3C72RPK.cjs.map +0 -1
  273. package/dist/chunk-K63VPFOV.cjs +0 -134
  274. package/dist/chunk-K63VPFOV.cjs.map +0 -1
  275. package/dist/chunk-KFLIDTDU.cjs +0 -825
  276. package/dist/chunk-KFLIDTDU.cjs.map +0 -1
  277. package/dist/chunk-KHKH5LCT.cjs +0 -250
  278. package/dist/chunk-KHKH5LCT.cjs.map +0 -1
  279. package/dist/chunk-LBEKRN6Y.cjs +0 -664
  280. package/dist/chunk-LBEKRN6Y.cjs.map +0 -1
  281. package/dist/chunk-LPUWXIPR.cjs +0 -578
  282. package/dist/chunk-LPUWXIPR.cjs.map +0 -1
  283. package/dist/chunk-MCO52PV5.js +0 -520
  284. package/dist/chunk-MCO52PV5.js.map +0 -1
  285. package/dist/chunk-MKXEM2C5.cjs +0 -396
  286. package/dist/chunk-MKXEM2C5.cjs.map +0 -1
  287. package/dist/chunk-MXNC5UNO.js +0 -563
  288. package/dist/chunk-MXNC5UNO.js.map +0 -1
  289. package/dist/chunk-NAK55BYU.cjs +0 -859
  290. package/dist/chunk-NAK55BYU.cjs.map +0 -1
  291. package/dist/chunk-NDBMKGQ5.cjs +0 -599
  292. package/dist/chunk-NDBMKGQ5.cjs.map +0 -1
  293. package/dist/chunk-OD65OZIW.cjs +0 -159
  294. package/dist/chunk-OD65OZIW.cjs.map +0 -1
  295. package/dist/chunk-ORT3KLGI.js +0 -50
  296. package/dist/chunk-ORT3KLGI.js.map +0 -1
  297. package/dist/chunk-PNNUPUH4.cjs +0 -82
  298. package/dist/chunk-PNNUPUH4.cjs.map +0 -1
  299. package/dist/chunk-PWHECW6N.js +0 -2934
  300. package/dist/chunk-PWHECW6N.js.map +0 -1
  301. package/dist/chunk-RBS5A2DF.js +0 -857
  302. package/dist/chunk-RBS5A2DF.js.map +0 -1
  303. package/dist/chunk-RPWUDXG5.cjs +0 -63
  304. package/dist/chunk-RPWUDXG5.cjs.map +0 -1
  305. package/dist/chunk-TCDJY3H6.js +0 -494
  306. package/dist/chunk-TCDJY3H6.js.map +0 -1
  307. package/dist/chunk-TP5UMRAU.cjs +0 -918
  308. package/dist/chunk-TP5UMRAU.cjs.map +0 -1
  309. package/dist/chunk-TS7J6DTY.js +0 -597
  310. package/dist/chunk-TS7J6DTY.js.map +0 -1
  311. package/dist/chunk-TUVENMXB.cjs +0 -20
  312. package/dist/chunk-TUVENMXB.cjs.map +0 -1
  313. package/dist/chunk-UDCQTOVU.cjs +0 -523
  314. package/dist/chunk-UDCQTOVU.cjs.map +0 -1
  315. package/dist/chunk-UHKZXOXD.js +0 -128
  316. package/dist/chunk-UHKZXOXD.js.map +0 -1
  317. package/dist/chunk-V6BA44DS.cjs +0 -236
  318. package/dist/chunk-V6BA44DS.cjs.map +0 -1
  319. package/dist/chunk-XO5R73Y4.js +0 -653
  320. package/dist/chunk-XO5R73Y4.js.map +0 -1
  321. package/dist/chunk-XOR4MPEN.cjs +0 -31
  322. package/dist/chunk-XOR4MPEN.cjs.map +0 -1
  323. package/dist/chunk-YORQQXGO.js +0 -155
  324. package/dist/chunk-YORQQXGO.js.map +0 -1
  325. package/dist/chunk-YY4PFR3Z.cjs +0 -432
  326. package/dist/chunk-YY4PFR3Z.cjs.map +0 -1
  327. package/dist/chunk-ZPI6Q42R.js +0 -17
  328. package/dist/chunk-ZPI6Q42R.js.map +0 -1
  329. package/dist/components/ActivityPreview.cjs.map +0 -1
  330. package/dist/components/ActivityPreview.js.map +0 -1
  331. package/dist/components/ActivitySequence.cjs.map +0 -1
  332. package/dist/components/ActivitySequence.js.map +0 -1
  333. package/dist/components/Dictation.cjs.map +0 -1
  334. package/dist/components/Dictation.js.map +0 -1
  335. package/dist/components/FillInTheBlanks.cjs.map +0 -1
  336. package/dist/components/FillInTheBlanks.js.map +0 -1
  337. package/dist/components/GapSelect.cjs.map +0 -1
  338. package/dist/components/GapSelect.js.map +0 -1
  339. package/dist/components/InteractiveVideo.cjs.map +0 -1
  340. package/dist/components/InteractiveVideo.js.map +0 -1
  341. package/dist/components/MultipleChoice.cjs.map +0 -1
  342. package/dist/components/MultipleChoice.js.map +0 -1
  343. package/dist/components/PronunciationFeedback.cjs.map +0 -1
  344. package/dist/components/PronunciationFeedback.js.map +0 -1
  345. package/dist/components/ReadAloud.cjs.map +0 -1
  346. package/dist/components/ReadAloud.js.map +0 -1
  347. package/dist/components/StimulusPanel.cjs.map +0 -1
  348. package/dist/components/StimulusPanel.js.map +0 -1
  349. package/dist/components/WrittenResponse.cjs.map +0 -1
  350. package/dist/components/WrittenResponse.js.map +0 -1
  351. package/dist/hooks/useSpeechRecorder.cjs.map +0 -1
  352. package/dist/hooks/useSpeechRecorder.js.map +0 -1
  353. package/dist/i18n/LkIntlProvider.cjs.map +0 -1
  354. package/dist/i18n/LkIntlProvider.js.map +0 -1
  355. package/dist/machine-CuwKqWXC.d.cts +0 -26
  356. package/dist/machine-CuwKqWXC.d.ts +0 -26
  357. package/dist/theme/ThemeProvider.cjs.map +0 -1
  358. package/dist/theme/ThemeProvider.js.map +0 -1
  359. package/dist/types-C4IsUQsK.d.ts +0 -989
  360. package/dist/types-CJgZWtl4.d.cts +0 -989
@@ -0,0 +1,200 @@
1
+ 'use client';
2
+ //#region src/i18n/direction.ts
3
+ /**
4
+ * The writing direction of authored content. A language tag is read from the
5
+ * tag alone, so a server rendering and the browser that hydrates it agree on
6
+ * it. Text is read by the runtime's Unicode tables, which agree on every
7
+ * character both runtimes' Unicode versions know.
8
+ */
9
+ /** ISO 15924 codes of the scripts written right to left. */
10
+ const RTL_SCRIPT_CODES = /* @__PURE__ */ new Set([
11
+ "phlv",
12
+ "adlm",
13
+ "arab",
14
+ "aran",
15
+ "armi",
16
+ "avst",
17
+ "chrs",
18
+ "cprt",
19
+ "elym",
20
+ "gara",
21
+ "hatr",
22
+ "hebr",
23
+ "hung",
24
+ "khar",
25
+ "lydi",
26
+ "mand",
27
+ "mani",
28
+ "mend",
29
+ "merc",
30
+ "mero",
31
+ "narb",
32
+ "nbat",
33
+ "nkoo",
34
+ "orkh",
35
+ "ougr",
36
+ "palm",
37
+ "phli",
38
+ "phlp",
39
+ "phnx",
40
+ "prti",
41
+ "rohg",
42
+ "samr",
43
+ "sarb",
44
+ "sidt",
45
+ "sogd",
46
+ "sogo",
47
+ "syrc",
48
+ "syre",
49
+ "syrj",
50
+ "syrn",
51
+ "thaa",
52
+ "yezi"
53
+ ]);
54
+ /**
55
+ * Languages written right to left in every script they are commonly written
56
+ * in, including the deprecated tags `iw` and `ji` and the Arabic varieties
57
+ * with tags of their own. A language also written left to right — Kurdish,
58
+ * Sindhi, Uyghur — is not listed: its own text decides.
59
+ */
60
+ const RTL_LANGUAGES = /* @__PURE__ */ new Set([
61
+ "acm",
62
+ "aeb",
63
+ "aii",
64
+ "ajp",
65
+ "apc",
66
+ "ar",
67
+ "arc",
68
+ "ars",
69
+ "ary",
70
+ "arz",
71
+ "azb",
72
+ "bqi",
73
+ "ckb",
74
+ "dv",
75
+ "fa",
76
+ "glk",
77
+ "hbo",
78
+ "he",
79
+ "iw",
80
+ "ji",
81
+ "jrb",
82
+ "khw",
83
+ "lrc",
84
+ "mzn",
85
+ "nqo",
86
+ "ota",
87
+ "pnb",
88
+ "prs",
89
+ "ps",
90
+ "sdh",
91
+ "skr",
92
+ "syc",
93
+ "syr",
94
+ "ur",
95
+ "yi"
96
+ ]);
97
+ /**
98
+ * The code-point blocks Unicode reserves for right-to-left scripts (their
99
+ * default bidirectional class is R or AL): Hebrew through Arabic Extended-A,
100
+ * the Hebrew and Arabic presentation forms, the historic right-to-left scripts
101
+ * of the Supplementary Multilingual Plane, and Mende Kikakui through the Arabic
102
+ * mathematical letters. A letter in one of them is written right to left.
103
+ */
104
+ const RTL_BLOCKS = [
105
+ [1424, 2303],
106
+ [64285, 65023],
107
+ [65136, 65279],
108
+ [67584, 69631],
109
+ [124928, 126975]
110
+ ];
111
+ /** Digits whose bidirectional class is R: N'Ko, Mende Kikakui and Adlam. */
112
+ const RTL_DIGITS = [
113
+ [1984, 1993],
114
+ [125127, 125135],
115
+ [125264, 125273]
116
+ ];
117
+ const LETTER_RE = /^\p{L}$/u;
118
+ const NUMBER_RE = /^\p{N}$/u;
119
+ function within(point, ranges) {
120
+ return ranges.some(([first, last]) => point >= first && point <= last);
121
+ }
122
+ /**
123
+ * The script subtag of a BCP 47 tag's lowercased subtags, if it names a
124
+ * direction: not in a private-use or grandfathered tag (`x-arab`, `i-klingon`),
125
+ * and not one of the codes for no particular script — Common, Inherited,
126
+ * Unwritten, Unknown and the like (`Z` codes) or private use (`Qaaa`–`Qabx`).
127
+ */
128
+ function scriptSubtagOf(subtags) {
129
+ if (subtags[0].length === 1) return;
130
+ let index = 1;
131
+ while (index < subtags.length && index <= 3 && /^[a-z]{3}$/.test(subtags[index])) index += 1;
132
+ const candidate = subtags[index];
133
+ if (candidate === void 0 || !/^[a-z]{4}$/.test(candidate)) return;
134
+ return /^z/.test(candidate) || candidate >= "qaaa" && candidate <= "qabx" ? void 0 : candidate;
135
+ }
136
+ /**
137
+ * The direction a language tag names, or `undefined` when it names none: its
138
+ * script subtag when it has one (`ku-Arab` is right-to-left, `ar-Latn` is not),
139
+ * then the languages above. `-` and `_` both separate subtags. Anything that is
140
+ * not a string names none.
141
+ */
142
+ function localeDirectionOf(locale) {
143
+ if (typeof locale !== "string") return;
144
+ const subtags = locale.toLowerCase().split(/[-_]/);
145
+ const script = scriptSubtagOf(subtags);
146
+ if (script !== void 0) return RTL_SCRIPT_CODES.has(script) ? "rtl" : "ltr";
147
+ return RTL_LANGUAGES.has(subtags[0]) ? "rtl" : void 0;
148
+ }
149
+ const LEFT_TO_RIGHT_MARK = String.fromCodePoint(8206);
150
+ /** RIGHT-TO-LEFT MARK and ARABIC LETTER MARK. */
151
+ const RIGHT_TO_LEFT_MARKS = /* @__PURE__ */ new Set([String.fromCodePoint(8207), String.fromCodePoint(1564)]);
152
+ /**
153
+ * The direction of `text`'s first letter or directional mark — an author can
154
+ * start a transcript with a right-to-left mark to lay it out right to left — or
155
+ * `undefined` when it has neither. Other characters with a strong direction,
156
+ * such as a Hebrew punctuation mark or an N'Ko digit, are not read, so this is
157
+ * the first strong character the Unicode bidirectional algorithm finds only
158
+ * where the text starts with a letter or a mark. Letters are read by the
159
+ * runtime's Unicode tables: a letter added in a later Unicode version than a
160
+ * server's is not one to that server.
161
+ */
162
+ function textDirectionOf(text) {
163
+ for (const character of text) {
164
+ if (character === LEFT_TO_RIGHT_MARK) return "ltr";
165
+ if (RIGHT_TO_LEFT_MARKS.has(character)) return "rtl";
166
+ if (LETTER_RE.test(character)) return within(character.codePointAt(0), RTL_BLOCKS) ? "rtl" : "ltr";
167
+ }
168
+ }
169
+ /**
170
+ * The direction a single character is laid out in, for a mark standing in for
171
+ * it: a digit runs left to right unless it is one of the right-to-left digits,
172
+ * a letter runs in its script's direction, and anything else has none of its
173
+ * own.
174
+ */
175
+ function characterDirectionOf(character) {
176
+ const point = character.codePointAt(0);
177
+ if (NUMBER_RE.test(character)) return within(point, RTL_DIGITS) ? "rtl" : "ltr";
178
+ if (LETTER_RE.test(character)) return within(point, RTL_BLOCKS) ? "rtl" : "ltr";
179
+ }
180
+ //#endregion
181
+ Object.defineProperty(exports, "characterDirectionOf", {
182
+ enumerable: true,
183
+ get: function() {
184
+ return characterDirectionOf;
185
+ }
186
+ });
187
+ Object.defineProperty(exports, "localeDirectionOf", {
188
+ enumerable: true,
189
+ get: function() {
190
+ return localeDirectionOf;
191
+ }
192
+ });
193
+ Object.defineProperty(exports, "textDirectionOf", {
194
+ enumerable: true,
195
+ get: function() {
196
+ return textDirectionOf;
197
+ }
198
+ });
199
+
200
+ //# sourceMappingURL=direction-K1pj0HCA.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direction-K1pj0HCA.cjs","names":[],"sources":["../src/i18n/direction.ts"],"sourcesContent":["/**\n * The writing direction of authored content. A language tag is read from the\n * tag alone, so a server rendering and the browser that hydrates it agree on\n * it. Text is read by the runtime's Unicode tables, which agree on every\n * character both runtimes' Unicode versions know.\n */\n\n/** ISO 15924 codes of the scripts written right to left. */\nconst RTL_SCRIPT_CODES = new Set([\n 'phlv',\n 'adlm',\n 'arab',\n 'aran',\n 'armi',\n 'avst',\n 'chrs',\n 'cprt',\n 'elym',\n 'gara',\n 'hatr',\n 'hebr',\n 'hung',\n 'khar',\n 'lydi',\n 'mand',\n 'mani',\n 'mend',\n 'merc',\n 'mero',\n 'narb',\n 'nbat',\n 'nkoo',\n 'orkh',\n 'ougr',\n 'palm',\n 'phli',\n 'phlp',\n 'phnx',\n 'prti',\n 'rohg',\n 'samr',\n 'sarb',\n 'sidt',\n 'sogd',\n 'sogo',\n 'syrc',\n 'syre',\n 'syrj',\n 'syrn',\n 'thaa',\n 'yezi',\n]);\n\n/**\n * Languages written right to left in every script they are commonly written\n * in, including the deprecated tags `iw` and `ji` and the Arabic varieties\n * with tags of their own. A language also written left to right — Kurdish,\n * Sindhi, Uyghur — is not listed: its own text decides.\n */\nconst RTL_LANGUAGES = new Set([\n 'acm',\n 'aeb',\n 'aii',\n 'ajp',\n 'apc',\n 'ar',\n 'arc',\n 'ars',\n 'ary',\n 'arz',\n 'azb',\n 'bqi',\n 'ckb',\n 'dv',\n 'fa',\n 'glk',\n 'hbo',\n 'he',\n 'iw',\n 'ji',\n 'jrb',\n 'khw',\n 'lrc',\n 'mzn',\n 'nqo',\n 'ota',\n 'pnb',\n 'prs',\n 'ps',\n 'sdh',\n 'skr',\n 'syc',\n 'syr',\n 'ur',\n 'yi',\n]);\n\n/**\n * The code-point blocks Unicode reserves for right-to-left scripts (their\n * default bidirectional class is R or AL): Hebrew through Arabic Extended-A,\n * the Hebrew and Arabic presentation forms, the historic right-to-left scripts\n * of the Supplementary Multilingual Plane, and Mende Kikakui through the Arabic\n * mathematical letters. A letter in one of them is written right to left.\n */\nconst RTL_BLOCKS: readonly (readonly [number, number])[] = [\n [0x0590, 0x08ff],\n [0xfb1d, 0xfdff],\n [0xfe70, 0xfeff],\n [0x10800, 0x10fff],\n [0x1e800, 0x1efff],\n];\n\n/** Digits whose bidirectional class is R: N'Ko, Mende Kikakui and Adlam. */\nconst RTL_DIGITS: readonly (readonly [number, number])[] = [\n [0x07c0, 0x07c9],\n [0x1e8c7, 0x1e8cf],\n [0x1e950, 0x1e959],\n];\n\nconst LETTER_RE = /^\\p{L}$/u;\nconst NUMBER_RE = /^\\p{N}$/u;\n\nfunction within(point: number, ranges: readonly (readonly [number, number])[]): boolean {\n return ranges.some(([first, last]) => point >= first && point <= last);\n}\n\n/**\n * The script subtag of a BCP 47 tag's lowercased subtags, if it names a\n * direction: not in a private-use or grandfathered tag (`x-arab`, `i-klingon`),\n * and not one of the codes for no particular script — Common, Inherited,\n * Unwritten, Unknown and the like (`Z` codes) or private use (`Qaaa`–`Qabx`).\n */\nfunction scriptSubtagOf(subtags: readonly string[]): string | undefined {\n if ((subtags[0] as string).length === 1) {\n return undefined;\n }\n let index = 1;\n // Up to three extended language subtags may come between language and script.\n while (index < subtags.length && index <= 3 && /^[a-z]{3}$/.test(subtags[index] as string)) {\n index += 1;\n }\n const candidate = subtags[index];\n if (candidate === undefined || !/^[a-z]{4}$/.test(candidate)) {\n return undefined;\n }\n return /^z/.test(candidate) || (candidate >= 'qaaa' && candidate <= 'qabx')\n ? undefined\n : candidate;\n}\n\n/**\n * The direction a language tag names, or `undefined` when it names none: its\n * script subtag when it has one (`ku-Arab` is right-to-left, `ar-Latn` is not),\n * then the languages above. `-` and `_` both separate subtags. Anything that is\n * not a string names none.\n */\nexport function localeDirectionOf(locale: unknown): 'ltr' | 'rtl' | undefined {\n if (typeof locale !== 'string') {\n return undefined;\n }\n const subtags = locale.toLowerCase().split(/[-_]/);\n const script = scriptSubtagOf(subtags);\n if (script !== undefined) {\n return RTL_SCRIPT_CODES.has(script) ? 'rtl' : 'ltr';\n }\n return RTL_LANGUAGES.has(subtags[0] as string) ? 'rtl' : undefined;\n}\n\nconst LEFT_TO_RIGHT_MARK = String.fromCodePoint(0x200e);\n/** RIGHT-TO-LEFT MARK and ARABIC LETTER MARK. */\nconst RIGHT_TO_LEFT_MARKS = new Set([String.fromCodePoint(0x200f), String.fromCodePoint(0x61c)]);\n\n/**\n * The direction of `text`'s first letter or directional mark — an author can\n * start a transcript with a right-to-left mark to lay it out right to left — or\n * `undefined` when it has neither. Other characters with a strong direction,\n * such as a Hebrew punctuation mark or an N'Ko digit, are not read, so this is\n * the first strong character the Unicode bidirectional algorithm finds only\n * where the text starts with a letter or a mark. Letters are read by the\n * runtime's Unicode tables: a letter added in a later Unicode version than a\n * server's is not one to that server.\n */\nexport function textDirectionOf(text: string): 'ltr' | 'rtl' | undefined {\n for (const character of text) {\n if (character === LEFT_TO_RIGHT_MARK) {\n return 'ltr';\n }\n if (RIGHT_TO_LEFT_MARKS.has(character)) {\n return 'rtl';\n }\n if (LETTER_RE.test(character)) {\n return within(character.codePointAt(0) as number, RTL_BLOCKS) ? 'rtl' : 'ltr';\n }\n }\n return undefined;\n}\n\n/**\n * The direction a single character is laid out in, for a mark standing in for\n * it: a digit runs left to right unless it is one of the right-to-left digits,\n * a letter runs in its script's direction, and anything else has none of its\n * own.\n */\nexport function characterDirectionOf(character: string): 'ltr' | 'rtl' | undefined {\n const point = character.codePointAt(0) as number;\n if (NUMBER_RE.test(character)) {\n return within(point, RTL_DIGITS) ? 'rtl' : 'ltr';\n }\n if (LETTER_RE.test(character)) {\n return within(point, RTL_BLOCKS) ? 'rtl' : 'ltr';\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,mCAAmB,IAAI,IAAI;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;AAQD,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;AASD,MAAM,aAAqD;CACzD,CAAC,MAAQ,IAAM;CACf,CAAC,OAAQ,KAAM;CACf,CAAC,OAAQ,KAAM;CACf,CAAC,OAAS,KAAO;CACjB,CAAC,QAAS,MAAO;AACnB;;AAGA,MAAM,aAAqD;CACzD,CAAC,MAAQ,IAAM;CACf,CAAC,QAAS,MAAO;CACjB,CAAC,QAAS,MAAO;AACnB;AAEA,MAAM,YAAY;AAClB,MAAM,YAAY;AAElB,SAAS,OAAO,OAAe,QAAyD;CACtF,OAAO,OAAO,MAAM,CAAC,OAAO,UAAU,SAAS,SAAS,SAAS,IAAI;AACvE;;;;;;;AAQA,SAAS,eAAe,SAAgD;CACtE,IAAK,QAAQ,EAAE,CAAY,WAAW,GACpC;CAEF,IAAI,QAAQ;CAEZ,OAAO,QAAQ,QAAQ,UAAU,SAAS,KAAK,aAAa,KAAK,QAAQ,MAAgB,GACvF,SAAS;CAEX,MAAM,YAAY,QAAQ;CAC1B,IAAI,cAAc,KAAA,KAAa,CAAC,aAAa,KAAK,SAAS,GACzD;CAEF,OAAO,KAAK,KAAK,SAAS,KAAM,aAAa,UAAU,aAAa,SAChE,KAAA,IACA;AACN;;;;;;;AAQA,SAAgB,kBAAkB,QAA4C;CAC5E,IAAI,OAAO,WAAW,UACpB;CAEF,MAAM,UAAU,OAAO,YAAY,CAAC,CAAC,MAAM,MAAM;CACjD,MAAM,SAAS,eAAe,OAAO;CACrC,IAAI,WAAW,KAAA,GACb,OAAO,iBAAiB,IAAI,MAAM,IAAI,QAAQ;CAEhD,OAAO,cAAc,IAAI,QAAQ,EAAY,IAAI,QAAQ,KAAA;AAC3D;AAEA,MAAM,qBAAqB,OAAO,cAAc,IAAM;;AAEtD,MAAM,sCAAsB,IAAI,IAAI,CAAC,OAAO,cAAc,IAAM,GAAG,OAAO,cAAc,IAAK,CAAC,CAAC;;;;;;;;;;;AAY/F,SAAgB,gBAAgB,MAAyC;CACvE,KAAK,MAAM,aAAa,MAAM;EAC5B,IAAI,cAAc,oBAChB,OAAO;EAET,IAAI,oBAAoB,IAAI,SAAS,GACnC,OAAO;EAET,IAAI,UAAU,KAAK,SAAS,GAC1B,OAAO,OAAO,UAAU,YAAY,CAAC,GAAa,UAAU,IAAI,QAAQ;CAE5E;AAEF;;;;;;;AAQA,SAAgB,qBAAqB,WAA8C;CACjF,MAAM,QAAQ,UAAU,YAAY,CAAC;CACrC,IAAI,UAAU,KAAK,SAAS,GAC1B,OAAO,OAAO,OAAO,UAAU,IAAI,QAAQ;CAE7C,IAAI,UAAU,KAAK,SAAS,GAC1B,OAAO,OAAO,OAAO,UAAU,IAAI,QAAQ;AAG/C"}
@@ -1,13 +1,31 @@
1
1
  'use client';
2
- 'use strict';
2
+ "use client";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ let react = require("react");
5
+ //#region src/hooks/useActivityState.ts
6
+ /**
7
+ * Tracks an activity's lifecycle state and elapsed time. Timing is held in a
8
+ * ref (no re-render) and `getTimeSpent()` is read imperatively at submission.
9
+ */
10
+ function useActivityState(initialState = "idle") {
11
+ const [state, setState] = (0, react.useState)(initialState);
12
+ const startTimeRef = (0, react.useRef)(null);
13
+ return {
14
+ state,
15
+ start: (0, react.useCallback)(() => {
16
+ if (startTimeRef.current === null) startTimeRef.current = Date.now();
17
+ setState((prev) => prev === "idle" ? "in-progress" : prev);
18
+ }, []),
19
+ complete: (0, react.useCallback)(() => setState("completed"), []),
20
+ review: (0, react.useCallback)(() => setState("reviewing"), []),
21
+ reset: (0, react.useCallback)((to = "idle") => {
22
+ startTimeRef.current = null;
23
+ setState(to);
24
+ }, []),
25
+ getTimeSpent: (0, react.useCallback)(() => startTimeRef.current === null ? 0 : Date.now() - startTimeRef.current, [])
26
+ };
27
+ }
28
+ //#endregion
29
+ exports.useActivityState = useActivityState;
3
30
 
4
- var chunkXOR4MPEN_cjs = require('../chunk-XOR4MPEN.cjs');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "useActivityState", {
9
- enumerable: true,
10
- get: function () { return chunkXOR4MPEN_cjs.useActivityState; }
11
- });
12
- //# sourceMappingURL=useActivityState.cjs.map
13
31
  //# sourceMappingURL=useActivityState.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"useActivityState.cjs"}
1
+ {"version":3,"file":"useActivityState.cjs","names":["useState","useRef","useCallback"],"sources":["../../src/hooks/useActivityState.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useRef, useState } from 'react';\n\nexport type ActivityState = 'idle' | 'in-progress' | 'completed' | 'reviewing';\n\nexport interface UseActivityStateResult {\n state: ActivityState;\n /** idle → in-progress; records start time once. Idempotent: repeated calls\n * (e.g. every learner interaction) neither restart timing nor regress state. */\n start: () => void;\n /** → completed. */\n complete: () => void;\n /** → reviewing (e.g. when showing correct answers). */\n review: () => void;\n /**\n * Clears timing and returns to `to`, defaulting to `idle`. Call when the\n * activity `data` prop changes.\n *\n * The target is a parameter because \"reset\" for a RESTORED item does not\n * mean idle: an item the learner had already submitted must come back\n * submitted, or a data-prop change quietly unlocks committed work.\n */\n reset: (to?: ActivityState) => void;\n /** Elapsed ms since `start()`; 0 when not started (or after `reset()`). */\n getTimeSpent: () => number;\n}\n\n/**\n * Tracks an activity's lifecycle state and elapsed time. Timing is held in a\n * ref (no re-render) and `getTimeSpent()` is read imperatively at submission.\n */\nexport function useActivityState(initialState: ActivityState = 'idle'): UseActivityStateResult {\n // `initialState` seeds the MOUNT only, like any `default*` value. It exists\n // so a resumed attempt can reopen a question the learner had already\n // submitted as submitted — without it, an exam that locks each question on\n // submit silently unlocks every one of them after a crash, and the learner\n // can answer and submit the same question twice.\n const [state, setState] = useState<ActivityState>(initialState);\n const startTimeRef = useRef<number | null>(null);\n\n const start = useCallback(() => {\n // Ref guard makes timing idempotent without a side effect in the updater\n // (StrictMode double-invokes updaters); the updater itself stays pure.\n if (startTimeRef.current === null) {\n startTimeRef.current = Date.now();\n }\n setState((prev) => (prev === 'idle' ? 'in-progress' : prev));\n }, []);\n\n const complete = useCallback(() => setState('completed'), []);\n\n const review = useCallback(() => setState('reviewing'), []);\n\n const reset = useCallback((to: ActivityState = 'idle') => {\n startTimeRef.current = null;\n setState(to);\n }, []);\n\n const getTimeSpent = useCallback(\n () => (startTimeRef.current === null ? 0 : Date.now() - startTimeRef.current),\n [],\n );\n\n return { state, start, complete, review, reset, getTimeSpent };\n}\n"],"mappings":";;;;;;;;AAgCA,SAAgB,iBAAiB,eAA8B,QAAgC;CAM7F,MAAM,CAAC,OAAO,aAAA,GAAYA,MAAAA,SAAAA,CAAwB,YAAY;CAC9D,MAAM,gBAAA,GAAeC,MAAAA,OAAAA,CAAsB,IAAI;CAyB/C,OAAO;EAAE;EAAO,QAAA,GAvBFC,MAAAA,YAAAA,OAAkB;GAG9B,IAAI,aAAa,YAAY,MAC3B,aAAa,UAAU,KAAK,IAAI;GAElC,UAAU,SAAU,SAAS,SAAS,gBAAgB,IAAK;EAC7D,GAAG,CAAC,CAgBgB;EAAG,WAAA,GAdNA,MAAAA,YAAAA,OAAkB,SAAS,WAAW,GAAG,CAAC,CAc7B;EAAG,SAAA,GAZlBA,MAAAA,YAAAA,OAAkB,SAAS,WAAW,GAAG,CAAC,CAYnB;EAAG,QAAA,GAV3BA,MAAAA,YAAAA,EAAa,KAAoB,WAAW;GACxD,aAAa,UAAU;GACvB,SAAS,EAAE;EACb,GAAG,CAAC,CAOyC;EAAG,eAAA,GAL3BA,MAAAA,YAAAA,OACZ,aAAa,YAAY,OAAO,IAAI,KAAK,IAAI,IAAI,aAAa,SACrE,CAAC,CAGwD;CAAE;AAC/D"}
@@ -1,29 +1,30 @@
1
- type ActivityState = 'idle' | 'in-progress' | 'completed' | 'reviewing';
2
- interface UseActivityStateResult {
3
- state: ActivityState;
4
- /** idle → in-progress; records start time once. Idempotent: repeated calls
5
- * (e.g. every learner interaction) neither restart timing nor regress state. */
6
- start: () => void;
7
- /** → completed. */
8
- complete: () => void;
9
- /** → reviewing (e.g. when showing correct answers). */
10
- review: () => void;
11
- /**
12
- * Clears timing and returns to `to`, defaulting to `idle`. Call when the
13
- * activity `data` prop changes.
14
- *
15
- * The target is a parameter because "reset" for a RESTORED item does not
16
- * mean idle: an item the learner had already submitted must come back
17
- * submitted, or a data-prop change quietly unlocks committed work.
18
- */
19
- reset: (to?: ActivityState) => void;
20
- /** Elapsed ms since `start()`; 0 when not started (or after `reset()`). */
21
- getTimeSpent: () => number;
1
+ //#region src/hooks/useActivityState.d.ts
2
+ export type ActivityState = 'idle' | 'in-progress' | 'completed' | 'reviewing';
3
+ export interface UseActivityStateResult {
4
+ state: ActivityState;
5
+ /** idle → in-progress; records start time once. Idempotent: repeated calls
6
+ * (e.g. every learner interaction) neither restart timing nor regress state. */
7
+ start: () => void;
8
+ /** → completed. */
9
+ complete: () => void;
10
+ /** → reviewing (e.g. when showing correct answers). */
11
+ review: () => void;
12
+ /**
13
+ * Clears timing and returns to `to`, defaulting to `idle`. Call when the
14
+ * activity `data` prop changes.
15
+ *
16
+ * The target is a parameter because "reset" for a RESTORED item does not
17
+ * mean idle: an item the learner had already submitted must come back
18
+ * submitted, or a data-prop change quietly unlocks committed work.
19
+ */
20
+ reset: (to?: ActivityState) => void;
21
+ /** Elapsed ms since `start()`; 0 when not started (or after `reset()`). */
22
+ getTimeSpent: () => number;
22
23
  }
23
24
  /**
24
25
  * Tracks an activity's lifecycle state and elapsed time. Timing is held in a
25
26
  * ref (no re-render) and `getTimeSpent()` is read imperatively at submission.
26
27
  */
27
- declare function useActivityState(initialState?: ActivityState): UseActivityStateResult;
28
-
29
- export { type ActivityState, type UseActivityStateResult, useActivityState };
28
+ export declare function useActivityState(initialState?: ActivityState): UseActivityStateResult;
29
+ //#endregion
30
+ //# sourceMappingURL=useActivityState.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActivityState.d.cts","names":[],"sources":["../../src/hooks/useActivityState.ts"],"mappings":";YAIY;iBAEK;EACf,OAAO;;;EAGP;;EAEA;;EAEA;;;;;;;;;EASA,QAAQ,KAAK;;EAEb;;;;;;wBAOc,iBAAiB,eAAc,gBAAyB"}
@@ -1,29 +1,30 @@
1
- type ActivityState = 'idle' | 'in-progress' | 'completed' | 'reviewing';
2
- interface UseActivityStateResult {
3
- state: ActivityState;
4
- /** idle → in-progress; records start time once. Idempotent: repeated calls
5
- * (e.g. every learner interaction) neither restart timing nor regress state. */
6
- start: () => void;
7
- /** → completed. */
8
- complete: () => void;
9
- /** → reviewing (e.g. when showing correct answers). */
10
- review: () => void;
11
- /**
12
- * Clears timing and returns to `to`, defaulting to `idle`. Call when the
13
- * activity `data` prop changes.
14
- *
15
- * The target is a parameter because "reset" for a RESTORED item does not
16
- * mean idle: an item the learner had already submitted must come back
17
- * submitted, or a data-prop change quietly unlocks committed work.
18
- */
19
- reset: (to?: ActivityState) => void;
20
- /** Elapsed ms since `start()`; 0 when not started (or after `reset()`). */
21
- getTimeSpent: () => number;
1
+ //#region src/hooks/useActivityState.d.ts
2
+ export type ActivityState = 'idle' | 'in-progress' | 'completed' | 'reviewing';
3
+ export interface UseActivityStateResult {
4
+ state: ActivityState;
5
+ /** idle → in-progress; records start time once. Idempotent: repeated calls
6
+ * (e.g. every learner interaction) neither restart timing nor regress state. */
7
+ start: () => void;
8
+ /** → completed. */
9
+ complete: () => void;
10
+ /** → reviewing (e.g. when showing correct answers). */
11
+ review: () => void;
12
+ /**
13
+ * Clears timing and returns to `to`, defaulting to `idle`. Call when the
14
+ * activity `data` prop changes.
15
+ *
16
+ * The target is a parameter because "reset" for a RESTORED item does not
17
+ * mean idle: an item the learner had already submitted must come back
18
+ * submitted, or a data-prop change quietly unlocks committed work.
19
+ */
20
+ reset: (to?: ActivityState) => void;
21
+ /** Elapsed ms since `start()`; 0 when not started (or after `reset()`). */
22
+ getTimeSpent: () => number;
22
23
  }
23
24
  /**
24
25
  * Tracks an activity's lifecycle state and elapsed time. Timing is held in a
25
26
  * ref (no re-render) and `getTimeSpent()` is read imperatively at submission.
26
27
  */
27
- declare function useActivityState(initialState?: ActivityState): UseActivityStateResult;
28
-
29
- export { type ActivityState, type UseActivityStateResult, useActivityState };
28
+ export declare function useActivityState(initialState?: ActivityState): UseActivityStateResult;
29
+ //#endregion
30
+ //# sourceMappingURL=useActivityState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActivityState.d.ts","names":[],"sources":["../../src/hooks/useActivityState.ts"],"mappings":";YAIY;iBAEK;EACf,OAAO;;;EAGP;;EAEA;;EAEA;;;;;;;;;EASA,QAAQ,KAAK;;EAEb;;;;;;wBAOc,iBAAiB,eAAc,gBAAyB"}
@@ -1,4 +1,30 @@
1
1
  'use client';
2
- export { useActivityState } from '../chunk-6N43WDVG.js';
3
- //# sourceMappingURL=useActivityState.js.map
2
+ "use client";
3
+ import { useCallback, useRef, useState } from "react";
4
+ //#region src/hooks/useActivityState.ts
5
+ /**
6
+ * Tracks an activity's lifecycle state and elapsed time. Timing is held in a
7
+ * ref (no re-render) and `getTimeSpent()` is read imperatively at submission.
8
+ */
9
+ function useActivityState(initialState = "idle") {
10
+ const [state, setState] = useState(initialState);
11
+ const startTimeRef = useRef(null);
12
+ return {
13
+ state,
14
+ start: useCallback(() => {
15
+ if (startTimeRef.current === null) startTimeRef.current = Date.now();
16
+ setState((prev) => prev === "idle" ? "in-progress" : prev);
17
+ }, []),
18
+ complete: useCallback(() => setState("completed"), []),
19
+ review: useCallback(() => setState("reviewing"), []),
20
+ reset: useCallback((to = "idle") => {
21
+ startTimeRef.current = null;
22
+ setState(to);
23
+ }, []),
24
+ getTimeSpent: useCallback(() => startTimeRef.current === null ? 0 : Date.now() - startTimeRef.current, [])
25
+ };
26
+ }
27
+ //#endregion
28
+ export { useActivityState };
29
+
4
30
  //# sourceMappingURL=useActivityState.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"useActivityState.js"}
1
+ {"version":3,"file":"useActivityState.js","names":[],"sources":["../../src/hooks/useActivityState.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useRef, useState } from 'react';\n\nexport type ActivityState = 'idle' | 'in-progress' | 'completed' | 'reviewing';\n\nexport interface UseActivityStateResult {\n state: ActivityState;\n /** idle → in-progress; records start time once. Idempotent: repeated calls\n * (e.g. every learner interaction) neither restart timing nor regress state. */\n start: () => void;\n /** → completed. */\n complete: () => void;\n /** → reviewing (e.g. when showing correct answers). */\n review: () => void;\n /**\n * Clears timing and returns to `to`, defaulting to `idle`. Call when the\n * activity `data` prop changes.\n *\n * The target is a parameter because \"reset\" for a RESTORED item does not\n * mean idle: an item the learner had already submitted must come back\n * submitted, or a data-prop change quietly unlocks committed work.\n */\n reset: (to?: ActivityState) => void;\n /** Elapsed ms since `start()`; 0 when not started (or after `reset()`). */\n getTimeSpent: () => number;\n}\n\n/**\n * Tracks an activity's lifecycle state and elapsed time. Timing is held in a\n * ref (no re-render) and `getTimeSpent()` is read imperatively at submission.\n */\nexport function useActivityState(initialState: ActivityState = 'idle'): UseActivityStateResult {\n // `initialState` seeds the MOUNT only, like any `default*` value. It exists\n // so a resumed attempt can reopen a question the learner had already\n // submitted as submitted — without it, an exam that locks each question on\n // submit silently unlocks every one of them after a crash, and the learner\n // can answer and submit the same question twice.\n const [state, setState] = useState<ActivityState>(initialState);\n const startTimeRef = useRef<number | null>(null);\n\n const start = useCallback(() => {\n // Ref guard makes timing idempotent without a side effect in the updater\n // (StrictMode double-invokes updaters); the updater itself stays pure.\n if (startTimeRef.current === null) {\n startTimeRef.current = Date.now();\n }\n setState((prev) => (prev === 'idle' ? 'in-progress' : prev));\n }, []);\n\n const complete = useCallback(() => setState('completed'), []);\n\n const review = useCallback(() => setState('reviewing'), []);\n\n const reset = useCallback((to: ActivityState = 'idle') => {\n startTimeRef.current = null;\n setState(to);\n }, []);\n\n const getTimeSpent = useCallback(\n () => (startTimeRef.current === null ? 0 : Date.now() - startTimeRef.current),\n [],\n );\n\n return { state, start, complete, review, reset, getTimeSpent };\n}\n"],"mappings":";;;;;;;AAgCA,SAAgB,iBAAiB,eAA8B,QAAgC;CAM7F,MAAM,CAAC,OAAO,YAAY,SAAwB,YAAY;CAC9D,MAAM,eAAe,OAAsB,IAAI;CAyB/C,OAAO;EAAE;EAAO,OAvBF,kBAAkB;GAG9B,IAAI,aAAa,YAAY,MAC3B,aAAa,UAAU,KAAK,IAAI;GAElC,UAAU,SAAU,SAAS,SAAS,gBAAgB,IAAK;EAC7D,GAAG,CAAC,CAgBgB;EAAG,UAdN,kBAAkB,SAAS,WAAW,GAAG,CAAC,CAc7B;EAAG,QAZlB,kBAAkB,SAAS,WAAW,GAAG,CAAC,CAYnB;EAAG,OAV3B,aAAa,KAAoB,WAAW;GACxD,aAAa,UAAU;GACvB,SAAS,EAAE;EACb,GAAG,CAAC,CAOyC;EAAG,cAL3B,kBACZ,aAAa,YAAY,OAAO,IAAI,KAAK,IAAI,IAAI,aAAa,SACrE,CAAC,CAGwD;CAAE;AAC/D"}
@@ -1,17 +1,6 @@
1
1
  'use client';
2
- 'use strict';
3
-
4
- var chunkUDCQTOVU_cjs = require('../chunk-UDCQTOVU.cjs');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "CAPTURE_PROCESSOR_SOURCE", {
9
- enumerable: true,
10
- get: function () { return chunkUDCQTOVU_cjs.CAPTURE_PROCESSOR_SOURCE; }
11
- });
12
- Object.defineProperty(exports, "useSpeechRecorder", {
13
- enumerable: true,
14
- get: function () { return chunkUDCQTOVU_cjs.useSpeechRecorder; }
15
- });
16
- //# sourceMappingURL=useSpeechRecorder.cjs.map
17
- //# sourceMappingURL=useSpeechRecorder.cjs.map
2
+ "use client";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const require_useSpeechRecorder = require("../useSpeechRecorder--O_f-xvt.cjs");
5
+ exports.CAPTURE_PROCESSOR_SOURCE = require_useSpeechRecorder.CAPTURE_PROCESSOR_SOURCE;
6
+ exports.useSpeechRecorder = require_useSpeechRecorder.useSpeechRecorder;
@@ -1,127 +1,2 @@
1
- import { a as SpeechRecorderStatus, S as SpeechRecorderError, R as RecordedTake } from '../machine-CuwKqWXC.cjs';
2
-
3
- /**
4
- * The audio worklet module `useSpeechRecorder` captures through, as source
5
- * text — exported so an application with a strict Content-Security-Policy can
6
- * serve it itself.
7
- *
8
- * By default the hook loads this text from a `blob:` URL. A worklet module is
9
- * loaded as a script, so it is `script-src` that must allow `blob:` —
10
- * `worker-src` does not govern it. Where that is refused, write this string to
11
- * a file your policy's `script-src` does allow, at build time and from the
12
- * installed package so it moves with the version you run, and pass that file's
13
- * URL as `workletUrl`:
14
- *
15
- * ```ts
16
- * import { writeFileSync } from 'node:fs';
17
- * import { CAPTURE_PROCESSOR_SOURCE } from '@intellectif/lk-react/hooks/useSpeechRecorder';
18
- *
19
- * writeFileSync('public/lk-speech-capture.js', CAPTURE_PROCESSOR_SOURCE);
20
- * ```
21
- *
22
- * **The contract** a module at `workletUrl` must meet, which this source does:
23
- * register an `AudioWorkletProcessor` under the name `lk-speech-capture`, and
24
- * from its `process(inputs)` post the first input's channels to its `port` as
25
- * an array with one `Float32Array` per channel, **copied** — the render
26
- * quantum's buffers belong to the audio thread and are overwritten on the next
27
- * quantum, so a block posted without copying arrives as whatever the
28
- * microphone heard some milliseconds later. Return `true`, which keeps the
29
- * processor alive while its source is silent. Anything else changes what is
30
- * recorded, so serve this text unchanged rather than a copy of your own.
31
- */
32
- declare const CAPTURE_PROCESSOR_SOURCE: string;
33
-
34
- interface SpeechRecorderOptions {
35
- /** The longest a take may be. Reached, the recording stops itself. */
36
- maxDurationMs: number;
37
- /** Shorter than this and the take is refused as `too-short`. */
38
- minDurationMs?: number;
39
- /** How many takes the learner may make. Unbounded when absent. */
40
- maxTakes?: number;
41
- /**
42
- * The URL of a self-hosted copy of {@link CAPTURE_PROCESSOR_SOURCE}, for an
43
- * application whose Content-Security-Policy does not allow `blob:` in
44
- * `script-src`. Serve that string unchanged; the contract a module here must
45
- * meet is written on it.
46
- *
47
- * **A URL that does not work is not reported.** If the module fails to load,
48
- * or loads without registering `lk-speech-capture`, the hook records through
49
- * the deprecated `ScriptProcessorNode` on the main thread instead — the
50
- * fallback it keeps for engines without audio worklets — and a recorder with
51
- * a broken `workletUrl` looks like a working one. Only an engine with neither
52
- * path reports `error: 'unsupported'`. Check that the module is actually
53
- * fetched.
54
- */
55
- workletUrl?: string;
56
- }
57
- interface SpeechRecorder {
58
- status: SpeechRecorderStatus;
59
- error: SpeechRecorderError | null;
60
- /** The loudest block since the last update, 0..1. */
61
- level: number;
62
- /** How much audio has been captured, from the sample count. */
63
- elapsedMs: number;
64
- take: RecordedTake | null;
65
- takesUsed: number;
66
- /** Whether a take remains. Not whether a `start()` would be accepted now. */
67
- canRecord: boolean;
68
- /** Opens the microphone and begins capturing. **Never rejects.** */
69
- start(): Promise<void>;
70
- /** Ends the capture and encodes the take. */
71
- stop(): void;
72
- /** Throws the take away and releases the microphone. */
73
- discard(): void;
74
- /**
75
- * Starts over: releases the microphone, throws the take away **and gives the
76
- * budget back**.
77
- *
78
- * That last part is the whole difference from {@link SpeechRecorder.discard},
79
- * which deliberately refunds nothing — a budget a re-record gave back would
80
- * bound nothing. A reset is for a recorder that has been handed a different
81
- * reading while it stayed mounted: the takes belong to the activity, so the
82
- * next activity's are its own. Calling it for the same reading hands a
83
- * learner takes they have already spent.
84
- */
85
- reset(): void;
86
- }
87
- /**
88
- * Records a take of speech as mono 16-bit PCM WAV at 16 kHz.
89
- *
90
- * That is the one format the SDK measures directly: `inspectWav` reads it
91
- * without a decoding library, and it is what every mainstream pronunciation
92
- * assessor accepts. A take is captured at whatever rate the device runs at,
93
- * downmixed to mono, low-pass filtered and resampled, then encoded — so what a
94
- * server measures is what this hook produced, not a claim about it.
95
- *
96
- * **Server rendering.** `status`, `error` and `canRecord` are derived from the
97
- * take count alone and never from a browser global, so the markup a server
98
- * produces is the markup the browser's first render produces. Support is
99
- * discovered inside {@link SpeechRecorder.start} and reported as
100
- * `error: 'unsupported'`; the obvious `!!navigator.mediaDevices` guard at
101
- * render time would make a server render and its hydration disagree.
102
- *
103
- * **Identity.** `start`, `stop`, `discard` and `reset` keep one identity for the
104
- * life of the hook, so they are safe in a dependency array. The returned object keeps
105
- * one identity for as long as none of its values changes, so a render caused
106
- * by something else does not invalidate an effect that depends on it.
107
- *
108
- * `start()` does nothing when no take remains, so `canRecord` is presentation:
109
- * mark the control `aria-disabled` rather than `disabled`, which would take it
110
- * out of the tab order and leave a learner nothing to read.
111
- *
112
- * ```tsx
113
- * const recorder = useSpeechRecorder({ maxDurationMs: 20_000, maxTakes: 3 });
114
- * <button
115
- * type="button"
116
- * aria-disabled={!recorder.canRecord}
117
- * onClick={() => {
118
- * void recorder.start();
119
- * }}
120
- * >
121
- * Record
122
- * </button>
123
- * ```
124
- */
125
- declare function useSpeechRecorder(options: SpeechRecorderOptions): SpeechRecorder;
126
-
127
- export { CAPTURE_PROCESSOR_SOURCE, RecordedTake, type SpeechRecorder, SpeechRecorderError, type SpeechRecorderOptions, SpeechRecorderStatus, useSpeechRecorder };
1
+ import { a as RecordedTake, i as CAPTURE_PROCESSOR_SOURCE, n as SpeechRecorderOptions, o as SpeechRecorderError, r as useSpeechRecorder, s as SpeechRecorderStatus, t as SpeechRecorder } from "../useSpeechRecorder-DtAYvl02.cjs";
2
+ export { CAPTURE_PROCESSOR_SOURCE, type RecordedTake, SpeechRecorder, type SpeechRecorderError, SpeechRecorderOptions, type SpeechRecorderStatus, useSpeechRecorder };