@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
@@ -1,59 +1,2 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ThemeTokens } from '@intellectif/lk-core';
3
- import { ReactNode } from 'react';
4
-
5
- /**
6
- * Dark-mode colour overrides, merged over {@link defaultTheme} by
7
- * `ThemeProvider`. Colours only — spacing/typography/shape/motion are
8
- * theme-invariant. All pairs verified WCAG 2.2 AA against the dark surface.
9
- */
10
- declare const darkTheme: Partial<ThemeTokens>;
11
-
12
- /**
13
- * Shape consumed by a Tailwind config's `theme.extend`. Every entry is a
14
- * `var(--lk-token, <fallback>)` reference: the var keeps utilities live
15
- * (ThemeProvider / dark-mode override at runtime); the fallback makes them
16
- * work with zero setup (no provider, no `defaults.css` import).
17
- */
18
- interface TailwindThemeExtension {
19
- colors: Record<string, string>;
20
- spacing: Record<string, string>;
21
- borderRadius: Record<string, string>;
22
- fontFamily: Record<string, string>;
23
- fontSize: Record<string, string>;
24
- }
25
- /**
26
- * Converts SDK theme tokens into a Tailwind `theme.extend` object so Tailwind
27
- * projects consume the same `--lk-*` tokens as the components — one shared
28
- * source of truth rather than a parallel, conflicting palette.
29
- */
30
- declare function createTailwindTheme(theme: Partial<ThemeTokens>): TailwindThemeExtension;
31
-
32
- /**
33
- * Canonical default theme token values. `defaults.css` mirrors these exactly.
34
- * Palette is a neutral monochrome, deliberately unbranded, so the SDK carries
35
- * nobody's look out of the box; consumers rebrand via `ThemeProvider`. All
36
- * colour pairs are verified to meet WCAG 2.2 AA: 4.5:1 for normal text, 3:1 for
37
- * UI / focus ring (see theme/__tests__/contrast.test.ts).
38
- */
39
- declare const defaultTheme: ThemeTokens;
40
-
41
- interface ThemeProviderProps {
42
- /** Partial token overrides. When provided, dark auto-detection is disabled. */
43
- theme?: Partial<ThemeTokens>;
44
- children: ReactNode;
45
- }
46
- /**
47
- * Provides theme tokens to descendant activity components as scoped inline CSS
48
- * custom properties on a wrapper `<div>`, and via {@link useTheme}.
49
- *
50
- * Resolution: an explicit `theme` prop merges over {@link defaultTheme} (and
51
- * suppresses dark auto-detect, per Req 13.5). With no `theme` prop, the OS
52
- * `prefers-color-scheme: dark` preference auto-applies {@link darkTheme}.
53
- * SSR-safe: the server snapshot is always light, so hydration never mismatches.
54
- */
55
- declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
56
- /** Returns the currently active theme tokens (defaults when no provider). */
57
- declare function useTheme(): ThemeTokens;
58
-
59
- export { type TailwindThemeExtension, ThemeProvider, type ThemeProviderProps, createTailwindTheme, darkTheme, defaultTheme, useTheme };
1
+ import { a as TailwindThemeExtension, i as defaultTheme, n as ThemeProviderProps, o as createTailwindTheme, r as useTheme, s as darkTheme, t as ThemeProvider } from "../ThemeProvider-BCrxBaY-.js";
2
+ export { type TailwindThemeExtension, ThemeProvider, ThemeProviderProps, createTailwindTheme, darkTheme, defaultTheme, useTheme };
@@ -1,4 +1,4 @@
1
1
  'use client';
2
- export { ThemeProvider, createTailwindTheme, darkTheme, defaultTheme, useTheme } from '../chunk-UHKZXOXD.js';
3
- //# sourceMappingURL=ThemeProvider.js.map
4
- //# sourceMappingURL=ThemeProvider.js.map
2
+ "use client";
3
+ import { a as darkTheme, i as defaultTheme, n as useTheme, r as createTailwindTheme, t as ThemeProvider } from "../ThemeProvider-C7K9iMLX.js";
4
+ export { ThemeProvider, createTailwindTheme, darkTheme, defaultTheme, useTheme };
@@ -0,0 +1,363 @@
1
+ 'use client';
2
+ const require_useAiHelp = require("./useAiHelp-h9yOLFqt.cjs");
3
+ let react = require("react");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ let _intellectif_lk_core = require("@intellectif/lk-core");
6
+ //#region src/components/shared/AiHelp.tsx
7
+ /** What the hooks take, from what a component holds: the optional half, without `undefined` values. */
8
+ function situation(input) {
9
+ const { data, response, submitted, renderMode, ai, locale, onInteraction, delivery } = input;
10
+ return {
11
+ data,
12
+ response,
13
+ submitted,
14
+ renderMode,
15
+ delivery,
16
+ ...ai !== void 0 ? { ai } : {},
17
+ ...locale !== void 0 ? { locale } : {},
18
+ ...onInteraction !== void 0 ? { onInteraction } : {}
19
+ };
20
+ }
21
+ /**
22
+ * "Explain my answer": the SDK's own surface over {@link useAiExplanation} — a
23
+ * button, the explanation with who wrote it, and "not available" when a call
24
+ * fails or its answer is refused.
25
+ *
26
+ * Nothing renders without a port, or where the rules say no explanation.
27
+ */
28
+ function AiExplanation({ outcome, ...rest }) {
29
+ const s = rest.strings;
30
+ const help = require_useAiHelp.useAiExplanation({
31
+ ...situation(rest),
32
+ ...outcome !== void 0 ? { outcome } : {}
33
+ });
34
+ const buttonRef = (0, react.useRef)(null);
35
+ const panelRef = (0, react.useRef)(null);
36
+ const refocus = (0, react.useRef)(false);
37
+ (0, react.useEffect)(() => {
38
+ if (help.status === "shown" && refocus.current) {
39
+ refocus.current = false;
40
+ panelRef.current?.focus();
41
+ }
42
+ if (help.status === "unavailable") refocus.current = false;
43
+ }, [help.status]);
44
+ if (!help.offered) return null;
45
+ const ask = () => {
46
+ refocus.current = typeof document !== "undefined" && document.activeElement === buttonRef.current;
47
+ help.ask();
48
+ };
49
+ const loading = help.status === "loading";
50
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
51
+ className: "lk-ai",
52
+ "data-state": help.status,
53
+ children: [help.explanation === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
54
+ ref: buttonRef,
55
+ type: "button",
56
+ className: "lk-ai-button",
57
+ "aria-busy": loading || void 0,
58
+ "aria-disabled": loading || void 0,
59
+ onClick: ask,
60
+ children: loading ? s.aiExplaining : s.aiExplain
61
+ }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
62
+ "aria-live": "polite",
63
+ children: help.explanation !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
64
+ ref: panelRef,
65
+ className: "lk-ai-panel",
66
+ tabIndex: -1,
67
+ "aria-label": s.aiExplanation,
68
+ children: [
69
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
70
+ className: "lk-ai-heading",
71
+ children: s.aiExplanation
72
+ }),
73
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
74
+ className: "lk-ai-text",
75
+ children: help.explanation.text
76
+ }),
77
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
78
+ className: "lk-ai-notice",
79
+ children: s.aiNotice
80
+ })
81
+ ]
82
+ }) : help.status === "unavailable" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
83
+ className: "lk-ai-unavailable",
84
+ children: s.aiExplanationUnavailable
85
+ }) : null
86
+ })]
87
+ });
88
+ }
89
+ /**
90
+ * The AI hints of one of the SDK's own questions: {@link useAiHints}, called
91
+ * by the component itself so it can count the hints its learner was shown.
92
+ */
93
+ function useComponentAiHints({ disabled, ...rest }) {
94
+ return require_useAiHelp.useAiHints({
95
+ ...situation(rest),
96
+ disabled
97
+ });
98
+ }
99
+ /**
100
+ * "Get a hint": the SDK's own surface over {@link useAiHints} — a button, the
101
+ * hints given so far as a numbered list, and who wrote them.
102
+ *
103
+ * The hints stay listed after submit, so the learner can see what they were
104
+ * given, but no more can be asked for — until a "Try again" reopens the
105
+ * answer, when the same list carries on. Another question starts with none.
106
+ */
107
+ function AiHints({ help, ai, strings: s }) {
108
+ const used = help.used;
109
+ if (ai?.hint === void 0 || !help.offered && used === 0) return null;
110
+ const loading = help.status === "loading";
111
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
112
+ className: "lk-ai lk-ai-hint-area",
113
+ "data-state": help.status,
114
+ children: [
115
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
116
+ "aria-live": "polite",
117
+ children: [used > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
118
+ className: "lk-ai-hints",
119
+ "aria-label": s.aiHints,
120
+ children: help.hints.map((hint, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
121
+ className: "lk-ai-hint",
122
+ children: [
123
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
124
+ className: "lk-ai-hint-label",
125
+ children: s.aiHintNumber(index + 1)
126
+ }),
127
+ " ",
128
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
129
+ className: "lk-ai-text",
130
+ children: hint.text
131
+ })
132
+ ]
133
+ }, index))
134
+ }) : null, help.status === "unavailable" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
135
+ className: "lk-ai-unavailable",
136
+ children: s.aiHintUnavailable
137
+ }) : null]
138
+ }),
139
+ help.offered ? used < help.limit ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
140
+ type: "button",
141
+ className: "lk-ai-button",
142
+ "aria-busy": loading || void 0,
143
+ "aria-disabled": loading || void 0,
144
+ onClick: help.ask,
145
+ children: loading ? s.aiHintLoading : s.aiHint
146
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
147
+ className: "lk-ai-note",
148
+ children: s.aiNoMoreHints
149
+ }) : null,
150
+ used > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
151
+ className: "lk-ai-notice",
152
+ children: s.aiNotice
153
+ }) : null
154
+ ]
155
+ });
156
+ }
157
+ //#endregion
158
+ //#region src/components/shared/tries.tsx
159
+ /**
160
+ * The scoring policy a question is under: the paper's, when the paper around
161
+ * it was given one, else its own.
162
+ *
163
+ * Not combined, as delivery policies are: a cost and a count of tries have no
164
+ * "stricter" to pick. The paper decides, as it decides the mode — so a
165
+ * question drawn inside a set is scored by the set's rules whatever it was
166
+ * handed.
167
+ *
168
+ * A policy `validateItemScoringPolicy` refuses throws here, at render. Every
169
+ * setting in it moves a grade, and there is no safe way to read one wrongly:
170
+ * the question fails loudly rather than grade by a guess.
171
+ */
172
+ function useItemScoringPolicy(given) {
173
+ const around = (0, react.useContext)(require_useAiHelp.SequenceSlotContext)?.scoring;
174
+ const key = policyKey(given);
175
+ const own = (0, react.useMemo)(() => around === void 0 ? (0, _intellectif_lk_core.resolveItemScoringPolicy)(given) : null, [around, key]);
176
+ return around ?? own;
177
+ }
178
+ function policyKey(given) {
179
+ try {
180
+ return JSON.stringify(given) ?? "";
181
+ } catch {
182
+ return String(given);
183
+ }
184
+ }
185
+ /** A hint count as a response carries it: anything but a whole number above 0 is none. */
186
+ function hintsOf(response) {
187
+ const count = response?.hintsRevealed;
188
+ return typeof count === "number" && Number.isSafeInteger(count) && count > 0 ? count : 0;
189
+ }
190
+ /** Whether a try earned every mark there was: float noise above the maximum included. */
191
+ const fullMarks = (one) => one.score / one.maxScore >= 1 - 1e-9;
192
+ /** Whether, after the tries `made`, a question offers another: the rule `open` reads. */
193
+ function offersAfter(now, made, shut) {
194
+ const last = made[made.length - 1];
195
+ return now.graded && !now.disabled && !shut && now.channel?.triesClosed !== true && last !== void 0 && made.length < 1 + now.policy.retries && !fullMarks(last);
196
+ }
197
+ /**
198
+ * The tries a question has had and whether it offers another: the SDK's own
199
+ * components' rules for "Try again", in one place.
200
+ *
201
+ * Reports whether a try is on offer to the paper around the question, which
202
+ * waits for it before reporting the set while the question is on screen — and
203
+ * closes every question's tries once it has reported.
204
+ */
205
+ function useTries({ policy, graded, submitted, disabled }) {
206
+ const channel = (0, react.useContext)(require_useAiHelp.SequenceSlotContext);
207
+ const [tries, setTries] = (0, react.useState)([]);
208
+ const [closed, setClosed] = (0, react.useState)(false);
209
+ const triesRef = (0, react.useRef)([]);
210
+ const closedRef = (0, react.useRef)(false);
211
+ const latest = (0, react.useRef)({
212
+ policy,
213
+ graded,
214
+ disabled,
215
+ channel
216
+ });
217
+ latest.current = {
218
+ policy,
219
+ graded,
220
+ disabled,
221
+ channel
222
+ };
223
+ const record = (0, react.useCallback)((one) => {
224
+ const next = [...triesRef.current, one];
225
+ triesRef.current = next;
226
+ setTries(next);
227
+ if (offersAfter(latest.current, next, closedRef.current)) latest.current.channel?.triesState("offered");
228
+ return (0, _intellectif_lk_core.scoreTries)(next, latest.current.policy);
229
+ }, []);
230
+ const close = (0, react.useCallback)(() => {
231
+ closedRef.current = true;
232
+ setClosed(true);
233
+ }, []);
234
+ const reset = (0, react.useCallback)(() => {
235
+ triesRef.current = [];
236
+ closedRef.current = false;
237
+ setTries([]);
238
+ setClosed(false);
239
+ }, []);
240
+ const allowed = 1 + policy.retries;
241
+ const left = Math.max(0, allowed - tries.length);
242
+ const open = submitted && offersAfter(latest.current, tries, closed);
243
+ const retrying = !submitted && tries.length > 0 && !closed && graded && !disabled && channel?.triesClosed !== true;
244
+ const state = open ? "offered" : retrying ? "retrying" : "none";
245
+ const report = channel?.triesState;
246
+ (0, react.useEffect)(() => {
247
+ report?.(state);
248
+ }, [report, state]);
249
+ (0, react.useEffect)(() => () => report?.("none"), [report]);
250
+ return {
251
+ tries,
252
+ counted: (0, react.useMemo)(() => tries.length === 0 ? null : (0, _intellectif_lk_core.scoreTries)(tries, policy), [tries, policy]),
253
+ open,
254
+ left,
255
+ record,
256
+ close,
257
+ reset
258
+ };
259
+ }
260
+ /** A fraction of the marks as the whole percentage a learner reads. */
261
+ const percentOf = (fraction) => Math.round(fraction * 100);
262
+ /**
263
+ * The sentences after the score, on a question whose policy changed it: which
264
+ * try counts when it is not the one just made, what this answer scored before
265
+ * its costs, and how many tries are left.
266
+ */
267
+ function triesSummary(s, policy, counted, offered) {
268
+ const parts = [];
269
+ const latest = counted.tries.length - 1;
270
+ const mine = counted.tries[latest];
271
+ if (mine !== void 0) {
272
+ if (counted.counted !== latest) parts.push(s.countedTry(policy.counts === "best" ? "best" : "first", percentOf(mine.scored / mine.maxScore)));
273
+ else if (mine.scored !== mine.score) parts.push(s.scoreBeforeCosts(percentOf(mine.score / mine.maxScore)));
274
+ }
275
+ if (offered) parts.push(s.triesLeft(policy.retries + 1 - counted.tries.length, percentOf(policy.retryPenalty)));
276
+ return parts.join(" ");
277
+ }
278
+ /**
279
+ * "Try again" and "Show answer" — or "Keep this answer", on a paper that shows
280
+ * no right answers — after a graded try that did not earn full marks.
281
+ */
282
+ function TryActions({ tries, solutions, strings: s, onRetry, onClose }) {
283
+ if (!tries.open) return null;
284
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
285
+ className: "lk-tries",
286
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
287
+ type: "button",
288
+ className: "lk-tries-again",
289
+ onClick: onRetry,
290
+ children: s.tryAgain
291
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
292
+ type: "button",
293
+ className: "lk-tries-close",
294
+ onClick: onClose,
295
+ children: solutions ? s.showAnswer : s.keepAnswer
296
+ })]
297
+ });
298
+ }
299
+ /** What a hint costs, said before the learner asks for one. */
300
+ function HintCost({ policy, strings: s }) {
301
+ if (policy.hintPenalty <= 0) return null;
302
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
303
+ className: "lk-hint-cost",
304
+ children: s.hintCost(percentOf(policy.hintPenalty))
305
+ });
306
+ }
307
+ //#endregion
308
+ Object.defineProperty(exports, "AiExplanation", {
309
+ enumerable: true,
310
+ get: function() {
311
+ return AiExplanation;
312
+ }
313
+ });
314
+ Object.defineProperty(exports, "AiHints", {
315
+ enumerable: true,
316
+ get: function() {
317
+ return AiHints;
318
+ }
319
+ });
320
+ Object.defineProperty(exports, "HintCost", {
321
+ enumerable: true,
322
+ get: function() {
323
+ return HintCost;
324
+ }
325
+ });
326
+ Object.defineProperty(exports, "TryActions", {
327
+ enumerable: true,
328
+ get: function() {
329
+ return TryActions;
330
+ }
331
+ });
332
+ Object.defineProperty(exports, "hintsOf", {
333
+ enumerable: true,
334
+ get: function() {
335
+ return hintsOf;
336
+ }
337
+ });
338
+ Object.defineProperty(exports, "triesSummary", {
339
+ enumerable: true,
340
+ get: function() {
341
+ return triesSummary;
342
+ }
343
+ });
344
+ Object.defineProperty(exports, "useComponentAiHints", {
345
+ enumerable: true,
346
+ get: function() {
347
+ return useComponentAiHints;
348
+ }
349
+ });
350
+ Object.defineProperty(exports, "useItemScoringPolicy", {
351
+ enumerable: true,
352
+ get: function() {
353
+ return useItemScoringPolicy;
354
+ }
355
+ });
356
+ Object.defineProperty(exports, "useTries", {
357
+ enumerable: true,
358
+ get: function() {
359
+ return useTries;
360
+ }
361
+ });
362
+
363
+ //# sourceMappingURL=tries-CbbtZkdG.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tries-CbbtZkdG.cjs","names":["useAiExplanation","useRef","useAiHints","useContext","SequenceSlotContext","useMemo","resolveItemScoringPolicy","useState","useRef","useCallback","scoreTries"],"sources":["../src/components/shared/AiHelp.tsx","../src/components/shared/tries.tsx"],"sourcesContent":["'use client';\n\nimport type {\n InteractionEvent,\n ItemOutcome,\n LearnerResponse,\n ResolvedDeliveryPolicy,\n} from '@intellectif/lk-core';\nimport { useEffect, useRef } from 'react';\nimport type { LearnerAi } from '../../ai/LkAiProvider.js';\nimport { type AiHintsHelp, useAiExplanation, useAiHints } from '../../ai/useAiHelp.js';\nimport type { LkStrings } from '../../i18n/strings.js';\nimport type { RenderableActivity, RenderMode } from '../types.js';\n\ninterface Situation {\n ai: LearnerAi | undefined;\n data: RenderableActivity;\n renderMode: RenderMode;\n submitted: boolean;\n /** The learner's answer as it stands: submitted, restored, or being written. */\n response: LearnerResponse;\n /** The component's `locale`, the default language for what is written. */\n locale: string | undefined;\n onInteraction: ((event: InteractionEvent) => void) | undefined;\n strings: LkStrings;\n /** The policy the component resolved, the paper's included. */\n delivery: ResolvedDeliveryPolicy;\n}\n\n/** What the hooks take, from what a component holds: the optional half, without `undefined` values. */\nfunction situation(input: Situation): {\n data: RenderableActivity;\n response: LearnerResponse;\n submitted: boolean;\n renderMode: RenderMode;\n ai?: LearnerAi;\n locale?: string;\n onInteraction?: (event: InteractionEvent) => void;\n delivery: ResolvedDeliveryPolicy;\n} {\n const { data, response, submitted, renderMode, ai, locale, onInteraction, delivery } = input;\n return {\n data,\n response,\n submitted,\n renderMode,\n delivery,\n ...(ai !== undefined ? { ai } : {}),\n ...(locale !== undefined ? { locale } : {}),\n ...(onInteraction !== undefined ? { onInteraction } : {}),\n };\n}\n\n/**\n * \"Explain my answer\": the SDK's own surface over {@link useAiExplanation} — a\n * button, the explanation with who wrote it, and \"not available\" when a call\n * fails or its answer is refused.\n *\n * Nothing renders without a port, or where the rules say no explanation.\n */\nexport function AiExplanation({\n outcome,\n ...rest\n}: Situation & { outcome: ItemOutcome | undefined }) {\n const s = rest.strings;\n const help = useAiExplanation({\n ...situation(rest),\n ...(outcome !== undefined ? { outcome } : {}),\n });\n const buttonRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const refocus = useRef(false);\n\n // The button that asked goes away when the explanation arrives; focus moves\n // to what it asked for rather than falling to the page.\n useEffect(() => {\n if (help.status === 'shown' && refocus.current) {\n refocus.current = false;\n panelRef.current?.focus();\n }\n if (help.status === 'unavailable') {\n refocus.current = false;\n }\n }, [help.status]);\n\n if (!help.offered) {\n return null;\n }\n\n const ask = (): void => {\n refocus.current =\n typeof document !== 'undefined' && document.activeElement === buttonRef.current;\n help.ask();\n };\n\n const loading = help.status === 'loading';\n return (\n <div className=\"lk-ai\" data-state={help.status}>\n {help.explanation === null ? (\n <button\n ref={buttonRef}\n type=\"button\"\n className=\"lk-ai-button\"\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n onClick={ask}\n >\n {loading ? s.aiExplaining : s.aiExplain}\n </button>\n ) : null}\n <div aria-live=\"polite\">\n {help.explanation !== null ? (\n <section\n ref={panelRef}\n className=\"lk-ai-panel\"\n tabIndex={-1}\n aria-label={s.aiExplanation}\n >\n <p className=\"lk-ai-heading\">{s.aiExplanation}</p>\n <p className=\"lk-ai-text\">{help.explanation.text}</p>\n <p className=\"lk-ai-notice\">{s.aiNotice}</p>\n </section>\n ) : help.status === 'unavailable' ? (\n <p className=\"lk-ai-unavailable\">{s.aiExplanationUnavailable}</p>\n ) : null}\n </div>\n </div>\n );\n}\n\n/**\n * The AI hints of one of the SDK's own questions: {@link useAiHints}, called\n * by the component itself so it can count the hints its learner was shown.\n */\nexport function useComponentAiHints({\n disabled,\n ...rest\n}: Situation & { disabled: boolean }): AiHintsHelp {\n return useAiHints({ ...situation(rest), disabled });\n}\n\n/**\n * \"Get a hint\": the SDK's own surface over {@link useAiHints} — a button, the\n * hints given so far as a numbered list, and who wrote them.\n *\n * The hints stay listed after submit, so the learner can see what they were\n * given, but no more can be asked for — until a \"Try again\" reopens the\n * answer, when the same list carries on. Another question starts with none.\n */\nexport function AiHints({\n help,\n ai,\n strings: s,\n}: {\n help: AiHintsHelp;\n ai: LearnerAi | undefined;\n strings: LkStrings;\n}) {\n const used = help.used;\n\n if (ai?.hint === undefined || (!help.offered && used === 0)) {\n return null;\n }\n\n const loading = help.status === 'loading';\n return (\n <div className=\"lk-ai lk-ai-hint-area\" data-state={help.status}>\n <div aria-live=\"polite\">\n {used > 0 ? (\n <ol className=\"lk-ai-hints\" aria-label={s.aiHints}>\n {help.hints.map((hint, index) => (\n // Hints are only ever appended, so a position is a stable key.\n // biome-ignore lint/suspicious/noArrayIndexKey: an append-only list\n <li key={index} className=\"lk-ai-hint\">\n <span className=\"lk-ai-hint-label\">{s.aiHintNumber(index + 1)}</span>{' '}\n <span className=\"lk-ai-text\">{hint.text}</span>\n </li>\n ))}\n </ol>\n ) : null}\n {help.status === 'unavailable' ? (\n <p className=\"lk-ai-unavailable\">{s.aiHintUnavailable}</p>\n ) : null}\n </div>\n {help.offered ? (\n used < help.limit ? (\n <button\n type=\"button\"\n className=\"lk-ai-button\"\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n onClick={help.ask}\n >\n {loading ? s.aiHintLoading : s.aiHint}\n </button>\n ) : (\n <p className=\"lk-ai-note\">{s.aiNoMoreHints}</p>\n )\n ) : null}\n {used > 0 ? <p className=\"lk-ai-notice\">{s.aiNotice}</p> : null}\n </div>\n );\n}\n","'use client';\n\nimport {\n type ItemScoringPolicy,\n type ItemTriesScore,\n type ItemTry,\n type ResolvedItemScoringPolicy,\n resolveItemScoringPolicy,\n scoreTries,\n} from '@intellectif/lk-core';\nimport { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport type { LkStrings } from '../../i18n/strings.js';\nimport { SequenceSlotContext, type TriesState } from './sequence-slot.js';\n\n/**\n * The scoring policy a question is under: the paper's, when the paper around\n * it was given one, else its own.\n *\n * Not combined, as delivery policies are: a cost and a count of tries have no\n * \"stricter\" to pick. The paper decides, as it decides the mode — so a\n * question drawn inside a set is scored by the set's rules whatever it was\n * handed.\n *\n * A policy `validateItemScoringPolicy` refuses throws here, at render. Every\n * setting in it moves a grade, and there is no safe way to read one wrongly:\n * the question fails loudly rather than grade by a guess.\n */\nexport function useItemScoringPolicy(\n given: ItemScoringPolicy | null | undefined,\n): ResolvedItemScoringPolicy {\n const around = useContext(SequenceSlotContext)?.scoring;\n const key = policyKey(given);\n // biome-ignore lint/correctness/useExhaustiveDependencies: the policy's content is the trigger, not its identity\n const own = useMemo(\n () => (around === undefined ? resolveItemScoringPolicy(given) : null),\n [around, key],\n );\n return around ?? (own as ResolvedItemScoringPolicy);\n}\n\nfunction policyKey(given: unknown): string {\n try {\n return JSON.stringify(given) ?? '';\n } catch {\n return String(given);\n }\n}\n\n/** A hint count as a response carries it: anything but a whole number above 0 is none. */\nexport function hintsOf(response: unknown): number {\n const count = (response as { hintsRevealed?: unknown } | null | undefined)?.hintsRevealed;\n return typeof count === 'number' && Number.isSafeInteger(count) && count > 0 ? count : 0;\n}\n\n/** Whether a try earned every mark there was: float noise above the maximum included. */\nconst fullMarks = (one: ItemTry): boolean => one.score / one.maxScore >= 1 - 1e-9;\n\n/** Whether, after the tries `made`, a question offers another: the rule `open` reads. */\nfunction offersAfter(\n now: {\n policy: ResolvedItemScoringPolicy;\n graded: boolean;\n disabled: boolean;\n channel: { triesClosed: boolean } | null;\n },\n made: readonly ItemTry[],\n shut: boolean,\n): boolean {\n const last = made[made.length - 1];\n return (\n now.graded &&\n !now.disabled &&\n !shut &&\n now.channel?.triesClosed !== true &&\n last !== undefined &&\n made.length < 1 + now.policy.retries &&\n !fullMarks(last)\n );\n}\n\nexport interface TriesInput {\n policy: ResolvedItemScoringPolicy;\n /**\n * Whether the component grades this answer itself and the learner may see\n * how it went: `practice`, with `feedback` on. \"Try again\" anywhere else\n * would be meaningless, or would say an answer was wrong on a paper that\n * does not say so.\n */\n graded: boolean;\n submitted: boolean;\n disabled: boolean;\n}\n\nexport interface Tries {\n /** Every graded try so far, in order. */\n tries: readonly ItemTry[];\n /** The question's score under the policy, once a try has been graded. */\n counted: ItemTriesScore | null;\n /**\n * Whether the learner is being offered another try at a graded answer: the\n * last try earned less than full marks, the policy has tries left, and\n * nothing has closed the question. While it is, the question shows no right\n * answer and no explanation — either would hand over the answer the next try\n * is for.\n */\n open: boolean;\n /** Tries still to come after the last graded one. */\n left: number;\n /** Records a graded try and returns the question's score under the policy. */\n record: (graded: ItemTry) => ItemTriesScore;\n /** Ends the question's tries: \"Show answer\". */\n close: () => void;\n /** Forgets every try: a different question. */\n reset: () => void;\n}\n\n/**\n * The tries a question has had and whether it offers another: the SDK's own\n * components' rules for \"Try again\", in one place.\n *\n * Reports whether a try is on offer to the paper around the question, which\n * waits for it before reporting the set while the question is on screen — and\n * closes every question's tries once it has reported.\n */\nexport function useTries({ policy, graded, submitted, disabled }: TriesInput): Tries {\n const channel = useContext(SequenceSlotContext);\n const [tries, setTries] = useState<readonly ItemTry[]>([]);\n const [closed, setClosed] = useState(false);\n // Written synchronously, so a submit that records a try and reports it reads\n // every try before it, whatever React has rendered.\n const triesRef = useRef<readonly ItemTry[]>([]);\n const closedRef = useRef(false);\n const latest = useRef({ policy, graded, disabled, channel });\n latest.current = { policy, graded, disabled, channel };\n\n const record = useCallback((one: ItemTry): ItemTriesScore => {\n const next = [...triesRef.current, one];\n triesRef.current = next;\n setTries(next);\n // An offer of another try is reported before the grade is handed on, not\n // after the next render: the paper reports its set when a grade fills its\n // last slot, and must already know to wait. The end of the tries is not:\n // said now, it would let the paper report the grade this try is replacing.\n // The effect below says it once this grade has landed.\n if (offersAfter(latest.current, next, closedRef.current)) {\n latest.current.channel?.triesState('offered');\n }\n return scoreTries(next, latest.current.policy);\n }, []);\n const close = useCallback(() => {\n closedRef.current = true;\n setClosed(true);\n }, []);\n const reset = useCallback(() => {\n triesRef.current = [];\n closedRef.current = false;\n setTries([]);\n setClosed(false);\n }, []);\n\n const allowed = 1 + policy.retries;\n const left = Math.max(0, allowed - tries.length);\n const open = submitted && offersAfter(latest.current, tries, closed);\n // A try the learner is making now — after \"Try again\", before the answer is\n // in again. Reporting the set then would hand on the grade the learner is in\n // the middle of replacing.\n const retrying =\n !submitted &&\n tries.length > 0 &&\n !closed &&\n graded &&\n !disabled &&\n channel?.triesClosed !== true;\n const state: TriesState = open ? 'offered' : retrying ? 'retrying' : 'none';\n\n const report = channel?.triesState;\n useEffect(() => {\n report?.(state);\n }, [report, state]);\n // A question that goes away offers nothing: the paper must not wait for it.\n useEffect(() => () => report?.('none'), [report]);\n\n const counted = useMemo(\n () => (tries.length === 0 ? null : scoreTries(tries, policy)),\n [tries, policy],\n );\n return { tries, counted, open, left, record, close, reset };\n}\n\n/** A fraction of the marks as the whole percentage a learner reads. */\nexport const percentOf = (fraction: number): number => Math.round(fraction * 100);\n\n/**\n * The sentences after the score, on a question whose policy changed it: which\n * try counts when it is not the one just made, what this answer scored before\n * its costs, and how many tries are left.\n */\nexport function triesSummary(\n s: LkStrings,\n policy: ResolvedItemScoringPolicy,\n counted: ItemTriesScore,\n offered: boolean,\n): string {\n const parts: string[] = [];\n const latest = counted.tries.length - 1;\n const mine = counted.tries[latest];\n if (mine !== undefined) {\n if (counted.counted !== latest) {\n parts.push(\n s.countedTry(\n policy.counts === 'best' ? 'best' : 'first',\n percentOf(mine.scored / mine.maxScore),\n ),\n );\n } else if (mine.scored !== mine.score) {\n parts.push(s.scoreBeforeCosts(percentOf(mine.score / mine.maxScore)));\n }\n }\n if (offered) {\n parts.push(\n s.triesLeft(policy.retries + 1 - counted.tries.length, percentOf(policy.retryPenalty)),\n );\n }\n return parts.join(' ');\n}\n\n/**\n * \"Try again\" and \"Show answer\" — or \"Keep this answer\", on a paper that shows\n * no right answers — after a graded try that did not earn full marks.\n */\nexport function TryActions({\n tries,\n solutions,\n strings: s,\n onRetry,\n onClose,\n}: {\n tries: Tries;\n /** Whether closing the question will show the right answer. */\n solutions: boolean;\n strings: LkStrings;\n onRetry: () => void;\n onClose: () => void;\n}): React.JSX.Element | null {\n if (!tries.open) {\n return null;\n }\n return (\n <div className=\"lk-tries\">\n <button type=\"button\" className=\"lk-tries-again\" onClick={onRetry}>\n {s.tryAgain}\n </button>\n <button type=\"button\" className=\"lk-tries-close\" onClick={onClose}>\n {solutions ? s.showAnswer : s.keepAnswer}\n </button>\n </div>\n );\n}\n\n/** What a hint costs, said before the learner asks for one. */\nexport function HintCost({\n policy,\n strings: s,\n}: {\n policy: ResolvedItemScoringPolicy;\n strings: LkStrings;\n}): React.JSX.Element | null {\n if (policy.hintPenalty <= 0) {\n return null;\n }\n return <p className=\"lk-hint-cost\">{s.hintCost(percentOf(policy.hintPenalty))}</p>;\n}\n"],"mappings":";;;;;;AA8BA,SAAS,UAAU,OASjB;CACA,MAAM,EAAE,MAAM,UAAU,WAAW,YAAY,IAAI,QAAQ,eAAe,aAAa;CACvF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA,GAAI,OAAO,KAAA,IAAY,EAAE,GAAG,IAAI,CAAC;EACjC,GAAI,WAAW,KAAA,IAAY,EAAE,OAAO,IAAI,CAAC;EACzC,GAAI,kBAAkB,KAAA,IAAY,EAAE,cAAc,IAAI,CAAC;CACzD;AACF;;;;;;;;AASA,SAAgB,cAAc,EAC5B,SACA,GAAG,QACgD;CACnD,MAAM,IAAI,KAAK;CACf,MAAM,OAAOA,kBAAAA,iBAAiB;EAC5B,GAAG,UAAU,IAAI;EACjB,GAAI,YAAY,KAAA,IAAY,EAAE,QAAQ,IAAI,CAAC;CAC7C,CAAC;CACD,MAAM,aAAA,GAAYC,MAAAA,OAAAA,CAA0B,IAAI;CAChD,MAAM,YAAA,GAAWA,MAAAA,OAAAA,CAAoB,IAAI;CACzC,MAAM,WAAA,GAAUA,MAAAA,OAAAA,CAAO,KAAK;CAI5B,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,IAAI,KAAK,WAAW,WAAW,QAAQ,SAAS;GAC9C,QAAQ,UAAU;GAClB,SAAS,SAAS,MAAM;EAC1B;EACA,IAAI,KAAK,WAAW,eAClB,QAAQ,UAAU;CAEtB,GAAG,CAAC,KAAK,MAAM,CAAC;CAEhB,IAAI,CAAC,KAAK,SACR,O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