@intellectif/lk-react 23.0.1 → 23.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +13 -9
  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/ReadAloud-C8RhaUqV.js.map +1 -0
  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-BRN1tj4n.cjs +187 -0
  64. package/dist/ThemeProvider-BRN1tj4n.cjs.map +1 -0
  65. package/dist/ThemeProvider-C7K9iMLX.js +158 -0
  66. package/dist/ThemeProvider-C7K9iMLX.js.map +1 -0
  67. package/dist/ThemeProvider-CocC8ODJ.d.ts +62 -0
  68. package/dist/ThemeProvider-CocC8ODJ.d.ts.map +1 -0
  69. package/dist/ThemeProvider-DS4KOL86.d.cts +62 -0
  70. package/dist/ThemeProvider-DS4KOL86.d.cts.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 -73
  78. package/dist/ai/LkAiProvider.d.ts +2 -73
  79. package/dist/ai/LkAiProvider.js +33 -2
  80. package/dist/ai/LkAiProvider.js.map +1 -1
  81. package/dist/ai/useAiHelp.cjs +7 -23
  82. package/dist/ai/useAiHelp.d.cts +198 -121
  83. package/dist/ai/useAiHelp.d.cts.map +1 -0
  84. package/dist/ai/useAiHelp.d.ts +198 -121
  85. package/dist/ai/useAiHelp.d.ts.map +1 -0
  86. package/dist/ai/useAiHelp.js +3 -6
  87. package/dist/components/ActivityPreview.cjs +3 -31
  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 -22
  91. package/dist/components/ActivitySequence.cjs +3 -32
  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 -23
  95. package/dist/components/Dictation.cjs +4 -23
  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 -14
  99. package/dist/components/FillInTheBlanks.cjs +4 -22
  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 -13
  103. package/dist/components/GapSelect.cjs +4 -22
  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 -13
  107. package/dist/components/InteractiveVideo.cjs +5 -34
  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 -21
  111. package/dist/components/MultipleChoice.cjs +4 -22
  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 -13
  115. package/dist/components/PronunciationFeedback.cjs +4 -16
  116. package/dist/components/PronunciationFeedback.d.cts +2 -69
  117. package/dist/components/PronunciationFeedback.d.ts +2 -69
  118. package/dist/components/PronunciationFeedback.js +3 -7
  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 -21
  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 -12
  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-2iDJohip.d.cts +90 -0
  164. package/dist/index-2iDJohip.d.cts.map +1 -0
  165. package/dist/index-BAqT5tXN.d.ts +90 -0
  166. package/dist/index-BAqT5tXN.d.ts.map +1 -0
  167. package/dist/index-BRbEfXgE.d.ts +78 -0
  168. package/dist/index-BRbEfXgE.d.ts.map +1 -0
  169. package/dist/index-BW7aA5eN.d.cts +25 -0
  170. package/dist/index-BW7aA5eN.d.cts.map +1 -0
  171. package/dist/index-BeiVd-qe.d.ts +124 -0
  172. package/dist/index-BeiVd-qe.d.ts.map +1 -0
  173. package/dist/index-C1KGpD1k.d.ts +49 -0
  174. package/dist/index-C1KGpD1k.d.ts.map +1 -0
  175. package/dist/index-C7cCHEze.d.cts +24 -0
  176. package/dist/index-C7cCHEze.d.cts.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-CN3_TwDL.d.ts +28 -0
  180. package/dist/index-CN3_TwDL.d.ts.map +1 -0
  181. package/dist/index-CNoAqj5I.d.ts +16 -0
  182. package/dist/index-CNoAqj5I.d.ts.map +1 -0
  183. package/dist/index-CTlht6OV.d.cts +432 -0
  184. package/dist/index-CTlht6OV.d.cts.map +1 -0
  185. package/dist/index-CmgSzapt.d.cts +124 -0
  186. package/dist/index-CmgSzapt.d.cts.map +1 -0
  187. package/dist/index-D4WYDN_p.d.cts +28 -0
  188. package/dist/index-D4WYDN_p.d.cts.map +1 -0
  189. package/dist/index-DAJ6KK49.d.ts +25 -0
  190. package/dist/index-DAJ6KK49.d.ts.map +1 -0
  191. package/dist/index-DIiacP_z.d.cts +78 -0
  192. package/dist/index-DIiacP_z.d.cts.map +1 -0
  193. package/dist/index-DR0SOJig.d.ts +291 -0
  194. package/dist/index-DR0SOJig.d.ts.map +1 -0
  195. package/dist/index-DRMauOVH.d.ts +432 -0
  196. package/dist/index-DRMauOVH.d.ts.map +1 -0
  197. package/dist/index-bmmRfGad.d.cts +16 -0
  198. package/dist/index-bmmRfGad.d.cts.map +1 -0
  199. package/dist/index-n9PKZm7W.d.cts +291 -0
  200. package/dist/index-n9PKZm7W.d.cts.map +1 -0
  201. package/dist/index-zu9H7owf.d.ts +24 -0
  202. package/dist/index-zu9H7owf.d.ts.map +1 -0
  203. package/dist/index.cjs +118 -161
  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 -31
  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/theme/skin.css +46 -1
  214. package/dist/tries-CbbtZkdG.cjs +363 -0
  215. package/dist/{chunk-W6UMY7PF.cjs.map → tries-CbbtZkdG.cjs.map} +1 -1
  216. package/dist/tries-DTHSrLCm.js +310 -0
  217. package/dist/tries-DTHSrLCm.js.map +1 -0
  218. package/dist/types-BOQd93x3.d.cts +994 -0
  219. package/dist/types-BOQd93x3.d.cts.map +1 -0
  220. package/dist/types-HIrgF_mS.d.ts +994 -0
  221. package/dist/types-HIrgF_mS.d.ts.map +1 -0
  222. package/dist/useAiHelp-B-ccDL5Q.js +906 -0
  223. package/dist/useAiHelp-B-ccDL5Q.js.map +1 -0
  224. package/dist/useAiHelp-h9yOLFqt.cjs +995 -0
  225. package/dist/useAiHelp-h9yOLFqt.cjs.map +1 -0
  226. package/dist/useSpeechRecorder--O_f-xvt.cjs +720 -0
  227. package/dist/useSpeechRecorder--O_f-xvt.cjs.map +1 -0
  228. package/dist/useSpeechRecorder-DtAYvl02.d.cts +154 -0
  229. package/dist/useSpeechRecorder-DtAYvl02.d.cts.map +1 -0
  230. package/dist/useSpeechRecorder-DtAYvl02.d.ts +154 -0
  231. package/dist/useSpeechRecorder-DtAYvl02.d.ts.map +1 -0
  232. package/dist/useSpeechRecorder-zIi9Dlw8.js +709 -0
  233. package/dist/useSpeechRecorder-zIi9Dlw8.js.map +1 -0
  234. package/package.json +10 -11
  235. package/dist/WrittenResponse-CgRrjM4S.d.ts +0 -115
  236. package/dist/WrittenResponse-D2K1VW_V.d.cts +0 -115
  237. package/dist/ai/useAiHelp.cjs.map +0 -1
  238. package/dist/ai/useAiHelp.js.map +0 -1
  239. package/dist/chunk-2OP5YHRR.js +0 -543
  240. package/dist/chunk-2OP5YHRR.js.map +0 -1
  241. package/dist/chunk-2TW6WLBC.js +0 -80
  242. package/dist/chunk-2TW6WLBC.js.map +0 -1
  243. package/dist/chunk-4MXECBZT.js +0 -888
  244. package/dist/chunk-4MXECBZT.js.map +0 -1
  245. package/dist/chunk-54DX6SLS.cjs +0 -42
  246. package/dist/chunk-54DX6SLS.cjs.map +0 -1
  247. package/dist/chunk-6GQLCCGN.js +0 -858
  248. package/dist/chunk-6GQLCCGN.js.map +0 -1
  249. package/dist/chunk-6N43WDVG.js +0 -29
  250. package/dist/chunk-6N43WDVG.js.map +0 -1
  251. package/dist/chunk-6RIM5EQP.cjs +0 -393
  252. package/dist/chunk-6RIM5EQP.cjs.map +0 -1
  253. package/dist/chunk-7F2YQWMW.cjs +0 -553
  254. package/dist/chunk-7F2YQWMW.cjs.map +0 -1
  255. package/dist/chunk-B4JRBV56.cjs +0 -63
  256. package/dist/chunk-B4JRBV56.cjs.map +0 -1
  257. package/dist/chunk-B7JU52YQ.cjs +0 -437
  258. package/dist/chunk-B7JU52YQ.cjs.map +0 -1
  259. package/dist/chunk-C4PSJ3ZC.js +0 -329
  260. package/dist/chunk-C4PSJ3ZC.js.map +0 -1
  261. package/dist/chunk-CXIP7ERK.js +0 -389
  262. package/dist/chunk-CXIP7ERK.js.map +0 -1
  263. package/dist/chunk-DPNCCWOV.js +0 -395
  264. package/dist/chunk-DPNCCWOV.js.map +0 -1
  265. package/dist/chunk-DXFCYNST.js +0 -35
  266. package/dist/chunk-DXFCYNST.js.map +0 -1
  267. package/dist/chunk-DZ7VLLDQ.cjs +0 -891
  268. package/dist/chunk-DZ7VLLDQ.cjs.map +0 -1
  269. package/dist/chunk-E4UF4XZM.js +0 -29
  270. package/dist/chunk-E4UF4XZM.js.map +0 -1
  271. package/dist/chunk-ERV666AR.js +0 -435
  272. package/dist/chunk-ERV666AR.js.map +0 -1
  273. package/dist/chunk-FISEZBLF.cjs +0 -31
  274. package/dist/chunk-FISEZBLF.cjs.map +0 -1
  275. package/dist/chunk-HYOUMTPW.js +0 -597
  276. package/dist/chunk-HYOUMTPW.js.map +0 -1
  277. package/dist/chunk-HZIT24BK.js +0 -61
  278. package/dist/chunk-HZIT24BK.js.map +0 -1
  279. package/dist/chunk-IYGF7PZY.cjs +0 -2938
  280. package/dist/chunk-IYGF7PZY.cjs.map +0 -1
  281. package/dist/chunk-J2QIHZ3H.cjs +0 -27
  282. package/dist/chunk-J2QIHZ3H.cjs.map +0 -1
  283. package/dist/chunk-JMEZYYCE.js +0 -2935
  284. package/dist/chunk-JMEZYYCE.js.map +0 -1
  285. package/dist/chunk-K63VPFOV.cjs +0 -134
  286. package/dist/chunk-K63VPFOV.cjs.map +0 -1
  287. package/dist/chunk-KI6DJ5ZF.js +0 -495
  288. package/dist/chunk-KI6DJ5ZF.js.map +0 -1
  289. package/dist/chunk-MCO52PV5.js +0 -520
  290. package/dist/chunk-MCO52PV5.js.map +0 -1
  291. package/dist/chunk-MXZHL4U5.cjs +0 -860
  292. package/dist/chunk-MXZHL4U5.cjs.map +0 -1
  293. package/dist/chunk-NFGUJ52G.cjs +0 -336
  294. package/dist/chunk-NFGUJ52G.cjs.map +0 -1
  295. package/dist/chunk-O7MINPKZ.js +0 -431
  296. package/dist/chunk-O7MINPKZ.js.map +0 -1
  297. package/dist/chunk-OD65OZIW.cjs +0 -159
  298. package/dist/chunk-OD65OZIW.cjs.map +0 -1
  299. package/dist/chunk-OJGTJOWI.cjs +0 -20
  300. package/dist/chunk-OJGTJOWI.cjs.map +0 -1
  301. package/dist/chunk-PGAPZ6UE.cjs +0 -497
  302. package/dist/chunk-PGAPZ6UE.cjs.map +0 -1
  303. package/dist/chunk-PNNUPUH4.cjs +0 -82
  304. package/dist/chunk-PNNUPUH4.cjs.map +0 -1
  305. package/dist/chunk-QAZO3ANW.cjs +0 -433
  306. package/dist/chunk-QAZO3ANW.cjs.map +0 -1
  307. package/dist/chunk-RX3A6KIY.js +0 -17
  308. package/dist/chunk-RX3A6KIY.js.map +0 -1
  309. package/dist/chunk-SHDSOOBF.cjs +0 -826
  310. package/dist/chunk-SHDSOOBF.cjs.map +0 -1
  311. package/dist/chunk-SPSKDNEE.js +0 -824
  312. package/dist/chunk-SPSKDNEE.js.map +0 -1
  313. package/dist/chunk-TGTP5DKF.js +0 -234
  314. package/dist/chunk-TGTP5DKF.js.map +0 -1
  315. package/dist/chunk-U4KTOH7C.js +0 -22
  316. package/dist/chunk-U4KTOH7C.js.map +0 -1
  317. package/dist/chunk-U5VFJVQ2.js +0 -241
  318. package/dist/chunk-U5VFJVQ2.js.map +0 -1
  319. package/dist/chunk-UDCQTOVU.cjs +0 -523
  320. package/dist/chunk-UDCQTOVU.cjs.map +0 -1
  321. package/dist/chunk-UHKZXOXD.js +0 -128
  322. package/dist/chunk-UHKZXOXD.js.map +0 -1
  323. package/dist/chunk-UKUHVCZX.cjs +0 -599
  324. package/dist/chunk-UKUHVCZX.cjs.map +0 -1
  325. package/dist/chunk-VPU6UY4O.cjs +0 -55
  326. package/dist/chunk-VPU6UY4O.cjs.map +0 -1
  327. package/dist/chunk-W6UMY7PF.cjs +0 -251
  328. package/dist/chunk-WZ2TBXVB.cjs +0 -236
  329. package/dist/chunk-WZ2TBXVB.cjs.map +0 -1
  330. package/dist/chunk-XOR4MPEN.cjs +0 -31
  331. package/dist/chunk-XOR4MPEN.cjs.map +0 -1
  332. package/dist/chunk-XS6OYYVR.cjs +0 -397
  333. package/dist/chunk-XS6OYYVR.cjs.map +0 -1
  334. package/dist/chunk-XYJBRKBZ.js +0 -51
  335. package/dist/chunk-XYJBRKBZ.js.map +0 -1
  336. package/dist/chunk-YORQQXGO.js +0 -155
  337. package/dist/chunk-YORQQXGO.js.map +0 -1
  338. package/dist/components/ActivityPreview.cjs.map +0 -1
  339. package/dist/components/ActivityPreview.js.map +0 -1
  340. package/dist/components/ActivitySequence.cjs.map +0 -1
  341. package/dist/components/ActivitySequence.js.map +0 -1
  342. package/dist/components/Dictation.cjs.map +0 -1
  343. package/dist/components/Dictation.js.map +0 -1
  344. package/dist/components/FillInTheBlanks.cjs.map +0 -1
  345. package/dist/components/FillInTheBlanks.js.map +0 -1
  346. package/dist/components/GapSelect.cjs.map +0 -1
  347. package/dist/components/GapSelect.js.map +0 -1
  348. package/dist/components/InteractiveVideo.cjs.map +0 -1
  349. package/dist/components/InteractiveVideo.js.map +0 -1
  350. package/dist/components/MultipleChoice.cjs.map +0 -1
  351. package/dist/components/MultipleChoice.js.map +0 -1
  352. package/dist/components/PronunciationFeedback.cjs.map +0 -1
  353. package/dist/components/PronunciationFeedback.js.map +0 -1
  354. package/dist/components/ReadAloud.cjs.map +0 -1
  355. package/dist/components/ReadAloud.js.map +0 -1
  356. package/dist/components/StimulusPanel.cjs.map +0 -1
  357. package/dist/components/StimulusPanel.js.map +0 -1
  358. package/dist/components/WrittenResponse.cjs.map +0 -1
  359. package/dist/components/WrittenResponse.js.map +0 -1
  360. package/dist/hooks/useSpeechRecorder.cjs.map +0 -1
  361. package/dist/hooks/useSpeechRecorder.js.map +0 -1
  362. package/dist/i18n/LkIntlProvider.cjs.map +0 -1
  363. package/dist/i18n/LkIntlProvider.js.map +0 -1
  364. package/dist/machine-CuwKqWXC.d.cts +0 -26
  365. package/dist/machine-CuwKqWXC.d.ts +0 -26
  366. package/dist/theme/ThemeProvider.cjs.map +0 -1
  367. package/dist/theme/ThemeProvider.js.map +0 -1
  368. package/dist/types-CO0XLEN6.d.cts +0 -973
  369. package/dist/types-CrtIcRcK.d.ts +0 -973
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @intellectif/lk-react
2
2
 
3
+ ## 23.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#90](https://github.com/intellectif/learning-kit/pull/90) [`9b5f5ef`](https://github.com/intellectif/learning-kit/commit/9b5f5ef6243f825c1336628d38816789993455b3) Thanks [@diego28e](https://github.com/diego28e)! - **Multiple choice under `feedback: false`**: no longer says "Answer submitted." before the learner has answered.
8
+
9
+ **Action required:** none.
10
+
11
+ - With `delivery={{ feedback: false }}`, a `<MultipleChoice>` announced "Answer submitted." in its live region as soon as it rendered. It now says nothing until the learner submits, as every other activity component does; after a submit it still says only that the answer was received.
12
+ - **Built with tsdown**, as tsup is no longer maintained. Every entry point exports the same names in ESM and CommonJS, each module still starts with `'use client'`, and the declarations describe the same API; only the names of the internal chunk files differ.
13
+ - A new test walks all six activity components through the same moment, in practice and exam mode, under every delivery policy, so a component that drifts from the others fails by name.
14
+
15
+ ## 23.1.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#86](https://github.com/intellectif/learning-kit/pull/86) [`2215060`](https://github.com/intellectif/learning-kit/commit/22150600b0d8f5f058214a0551566b58e154276d) Thanks [@diego28e](https://github.com/diego28e)! - **Coaching on a reading aloud**: "Coach me on this reading" under a read-aloud's marks, where a model may coach only the words the speech engine marked.
20
+
21
+ **Action required:** none unless your code switches over `AiFeature`, `AiRefusal` or `InteractionKind` without a `default` branch (new members `'pronunciation-coaching'`, `'contradicts-marks'` and `'ai-coaching-shown'`), reads `AiCheckCase.request` without narrowing on `feature`, or implements a complete `LkStrings` (six new keys). Nothing changes until you pass a `pronunciationCoaching` port. Install lk-core 1.1.0 with lk-react 23.1.0: lk-react calls the new lk-core functions, and its peer range moves to `^1.1.0`. See https://github.com/intellectif/learning-kit/blob/main/docs/upgrading.md
22
+
23
+ - **lk-core:** `aiCoachingRequest` builds what a model is given: the text, the engine's marks word by word — with each word's sounds and what each was heard as, when the marks come from the assessment — its dimension scores, and the grade. `checkAiCoaching` checks the reply before a learner sees it. Every word it coaches must be one the engine marked mispronounced or omitted, and every sound one the engine reported for that word; anything else refuses the whole reply as `contradicts-marks`. The words come back in reading order, each as the marks show it, and no number in the reply is read. An assessment the grader would not read (no speech, unscripted, another text or locale) gives no coaching.
24
+ - **lk-react:** a `pronunciationCoaching` port on `LearnerAi`. `<ReadAloud>` offers coaching under its marks in `practice` once a take is graded and in `review` wherever marks are shown, from a kept assessment or a stored grade; never in `exam`. `<PronunciationFeedback>` offers it too, given the item's `id` and `title` in `data`, and takes `ai`, `renderMode`, `delivery` and `onInteraction` for it. It follows the author's and the paper's `ai.explanations` and needs `feedback`, not `solutions`. One coaching per take. `useAiCoaching` gives marks you draw yourself the same rules.
25
+ - **Records:** `ai-coaching-shown` (how many words were coached, provenance and usage; never the text), and `ai-help-refused` with `feature: 'pronunciation-coaching'`.
26
+ - **ai-check:** a `pronunciationCoaching` port runs four reading cases: a mispronounced "th" and a word left out, a clean reading, the same slips from a stored grade without sounds, and coaching asked for in Spanish.
27
+ - Six new strings: `aiCoaching`, `aiCoachingLoading`, `aiCoachingHeading`, `aiCoachingUnavailable`, `aiCoachingWords`, `aiCoachingSound`.
28
+ - **Stability:** the promise now says what a minor may add to a type the SDK hands you — a union member, a `LkStrings` key, an optional property — and that a `default` branch keeps a switch correct across minors.
29
+
3
30
  ## 23.0.1
4
31
 
5
32
  ### Patch Changes
package/README.md CHANGED
@@ -75,7 +75,7 @@ export function Demo() {
75
75
  - **`<InteractiveVideo>`** — a video that stops at each quiz and asks its questions over itself, then plays on. **A formative tool**, for lessons and practice — deliver official summative exams with `<ActivitySequence>`. One player: a progress bar that marks every quiz and previews the caption under the pointer, speed, volume, captions drawn from WebVTT it parses itself (through a `captionsLoader` when the file needs the learner's credentials) — in one language or two at once, a second line under the first for a learner matching what they hear to what it means — a contents and transcript panel, picture-in-picture, fullscreen and a keyboard map with a shortcut sheet. A quiz covers the video and grows the player rather than scrolling inside it, every question of an opened quiz stays mounted so a rewind loses no answer, the controls are `inert` while it is open, and a **required** quiz holds both playback and seeking until it is answered. Answers report with the slot the question sits in and the quiz it belongs to, and `onProgress` gives a resume point that is never past an unanswered required quiz. A host with renderers of its own draws any question itself through `renderQuestion` — the video still counts it, tells it when it leaves the screen so it can stop its microphone, and holds Finish while its answer is still on its way. See the [interactive video guide](https://github.com/intellectif/learning-kit/blob/main/docs/interactive-video.md).
76
76
  - **Delivery policies** — `delivery` on any activity, `<ActivitySequence>` or `<InteractiveVideo>` switches off feedback, solutions, hints or AI help for that paper, so one question serves practice and a final without being authored twice. It can only take away, an empty policy is exactly the default, and a pager's policy holds in every question it holds — a host's own renderer included. See [Delivery policies](https://github.com/intellectif/learning-kit/blob/main/docs/delivery.md).
77
77
  - **Scoring policies** — `scoring` on any activity, `<ActivitySequence>` or `<InteractiveVideo>` gives a practice question "Try again", chooses which try counts, and charges for tries and hints, saying what a hint costs before the learner asks. The right answer and "Explain my answer" wait until the tries end, a set waits for a question being tried again, and no policy changes nothing. See [Scoring policies](https://github.com/intellectif/learning-kit/blob/main/docs/scoring.md).
78
- - **AI help for learners** — "Explain my answer" after grading and "Get a hint" before submit, in `<MultipleChoice>`, `<FillInTheBlanks>`, `<GapSelect>` and `<Dictation>` (explanations only), and "Get feedback on my draft" in `<WrittenResponse>` in practice — revise and ask again, and a correction that quotes words the learner never wrote refuses the feedback — through ports **you** supply with `<LkAiProvider>` or an `ai` prop (also on `<ActivitySequence>` and `<InteractiveVideo>`). The SDK never calls a model or holds a key: it builds the facts your model is given, refuses an explanation that contradicts the grade and a hint that contains the answer, marks everything a model wrote, and drops a late answer. Never in `exam`. What was shown reaches `onInteraction` with the model that wrote it and what the call cost; what was refused reaches it with the reason, and never the text. See the [AI guide](https://github.com/intellectif/learning-kit/blob/main/docs/ai.md).
78
+ - **AI help for learners** — "Explain my answer" after grading and "Get a hint" before submit, in `<MultipleChoice>`, `<FillInTheBlanks>`, `<GapSelect>` and `<Dictation>` (explanations only), "Get feedback on my draft" in `<WrittenResponse>` in practice — revise and ask again, and a correction that quotes words the learner never wrote refuses the feedback — and "Coach me on this reading" under the marks of `<ReadAloud>` and `<PronunciationFeedback>`, where coaching on a word the speech engine did not mark is refused, through ports **you** supply with `<LkAiProvider>` or an `ai` prop (also on `<ActivitySequence>` and `<InteractiveVideo>`). The SDK never calls a model or holds a key: it builds the facts your model is given, refuses an explanation that contradicts the grade and a hint that contains the answer, marks everything a model wrote, and drops a late answer. Never in `exam`. What was shown reaches `onInteraction` with the model that wrote it and what the call cost; what was refused reaches it with the reason, and never the text. See the [AI guide](https://github.com/intellectif/learning-kit/blob/main/docs/ai.md).
79
79
  - **`<ActivitySequence>`** — in-place "question set" pager (Previous/Next, "Question X of N", no scrolling, focus-managed). Accepts item groups and keeps their stimulus beside every question; `onSubmit` reports every raw answer with its `slotId`, which is the only response channel an `exam` sequence has. `onFinished` is the completion signal for a set that mixes scored and deferred-graded items, where `onComplete` can never fire. A read-aloud slot takes its storage from `recordingBinding`, whose methods are told which slot a take belongs to, and a `review` its per-word marks from `assessments`, keyed by `slotId` — there is a [worked example](https://github.com/intellectif/learning-kit/blob/main/docs/speech-assessment.md#in-a-question-set).
80
80
  - **Resume and review a whole attempt** — `<ActivitySequence>` takes `defaultIndex`, `responses` and `submittedSlotIds` (read at mount; remount with a `key` to show a different attempt), so an interrupted paper reopens on the right question with the right answers and already-committed questions still committed. `onIndexChange` reports every position the pager lands on, including a clamp it had to apply. Pass `renderMode="review"` plus server-computed `outcomes` to render a finished attempt read-only. Pairs with `serializeAttemptState` / `restoreAttemptState` in `lk-core`.
81
81
  - **`renderMode`** — `practice` (default: the component scores locally and reveals correctness), `exam` (never scores, never reveals; submit emits the raw response for the server to grade), `review` (read-only, marks correctness only from an `outcome` you supply). This is the single switch that takes grading off the client.
@@ -85,7 +85,7 @@ export function Demo() {
85
85
  - **`<StimulusPanel>`** — a shared passage / recording / image (an item group's stimulus) as a landmark region; the sequence uses it, and a custom runner can too.
86
86
  - **`<ActivityPreview>`** — an editor's preview. Renders a draft in any `renderMode` with a simulated `response` (marked with `evaluate()` in `review`), and a translatable notice — or your `fallback`, handed the issues — while `validateDraft` says the draft is not finished. Nothing it renders is recorded, and a recording's play limit is counted in memory only.
87
87
  - **Custom activity types** — `renderers={{ 'my-type': MyRenderer }}` on the sequence; a key matching a built-in overrides it, so you can replace a bundled renderer without forking the sequencer. A renderer is given the same contract the SDK's own components have: a `question` prop that says when it is the question on screen (so it can stop its microphone), holds the set while its own work is in flight, gives it somewhere to portal a popover, and reports what the learner did through calls that keep one identity.
88
- - **AI help in a question you draw** — `useAiHints`, `useAiExplanation` and `useAiWritingFeedback` give a host's own renderer the rules, the facts and the refusals the bundled components use, without their buttons. `ask` does nothing where the rules say no, so an exam reaches no model however the page asks.
88
+ - **AI help in a question you draw** — `useAiHints`, `useAiExplanation`, `useAiWritingFeedback` and `useAiCoaching` give a host's own renderer the rules, the facts and the refusals the bundled components use, without their buttons. `ask` does nothing where the rules say no, so an exam reaches no model however the page asks.
89
89
  - **Rich text, opt-in** — `sanitizeHtml` renders author-supplied `questionHtml` / `promptHtml`. The SDK ships **no** sanitiser and injects no HTML without one; without it the escaped plain-text field is used. (`FillInTheBlanks` ignores `passageHtml` by design — its passage hosts the answer inputs.)
90
90
  - **Media per question** — optional `image` / `audio` / `video` / `embed` (YouTube/Vimeo iframe) above the question; alt-text required for `image`/`embed` (WCAG).
91
91
  - **Playback policy for listening papers** — an audio recording can declare `maxPlays`, `seek: 'none'` and `rate: 'fixed'`. The SDK then renders its own accessible transport (44px targets, a live plays-remaining status, an exhausted button that stays focusable and says why) and enforces the policy from the element's own events, so a hardware media key goes through the budget too. Wire `mediaBudget` on `<ActivitySequence>` to make a play budget survive a refresh.
@@ -95,7 +95,7 @@ export function Demo() {
95
95
  - **`useSpeechRecorder(options)`** — the capture half of a read-aloud, usable on its own: microphone permission, an RMS level for a meter, a minimum take length, and an auto-stop measured from the **sample count** rather than a timer, so a take can never outrun its own limit. It yields **16 kHz mono 16-bit PCM WAV** — the one format `inspectWav` in `lk-core` measures without a decoder. SSR-safe by construction (support is discovered inside `start()`, never probed during render, so a server render and its hydration cannot disagree), and the microphone and the audio context are released on stop, discard, error and unmount alike. Where a Content-Security-Policy's `script-src` does not allow `blob:`, serve `CAPTURE_PROCESSOR_SOURCE` — exported beside the hook, with the contract it meets written on it — and pass its URL as `workletUrl`. A `workletUrl` that fails to load is not reported: the hook falls back to the main-thread `ScriptProcessorNode`, so check that the module is fetched.
96
96
  - **`<ThemeProvider>` + `defaults.css`** — `--lk-*` design-token system; automatic dark mode via `prefers-color-scheme` (SSR-safe with `useSyncExternalStore`).
97
97
  - **`createTailwindTheme(theme)`** — optional Tailwind interop; consume the SDK palette from your own utilities.
98
- - **`<LkIntlProvider>`** — all 196 strings the SDK's own chrome renders, replaceable in one place, with a per-component `strings` prop for the exceptions. Interpolation and plurals are **functions**, not format strings, so your `Intl.PluralRules` does the work and TypeScript checks the arity. `locale` sets `lang` and derives `dir`; the skin uses logical properties, so RTL follows. The SDK ships the mechanism and **English only** — see [docs/i18n.md](https://github.com/intellectif/learning-kit/blob/main/docs/i18n.md).
98
+ - **`<LkIntlProvider>`** — all 202 strings the SDK's own chrome renders, replaceable in one place, with a per-component `strings` prop for the exceptions. Interpolation and plurals are **functions**, not format strings, so your `Intl.PluralRules` does the work and TypeScript checks the arity. `locale` sets `lang` and derives `dir`; the skin uses logical properties, so RTL follows. The SDK ships the mechanism and **English only** — see [docs/i18n.md](https://github.com/intellectif/learning-kit/blob/main/docs/i18n.md).
99
99
  - **WCAG 2.2 AA** — axe-clean unit + Playwright e2e tests; full keyboard operability; numerically-verified contrast.
100
100
  - **RSC-compatible** — every component carries `'use client'` and hydrates inside a React Server Component tree.
101
101
 
@@ -119,7 +119,7 @@ export function Demo() {
119
119
  | `@intellectif/lk-react/hooks/useSpeechRecorder` | Microphone capture to 16 kHz mono WAV, and `CAPTURE_PROCESSOR_SOURCE` for a self-hosted worklet |
120
120
  | `@intellectif/lk-react/hooks/useXAPI` | LRS delivery (retry, never-throws) |
121
121
  | `@intellectif/lk-react/ai/LkAiProvider` | `<LkAiProvider>`, `useLearnerAi`, and the `LearnerAi` type |
122
- | `@intellectif/lk-react/ai/useAiHelp` | `useAiHints`, `useAiExplanation`, `useAiWritingFeedback` — the AI rules without the SDK's own buttons |
122
+ | `@intellectif/lk-react/ai/useAiHelp` | `useAiHints`, `useAiExplanation`, `useAiWritingFeedback`, `useAiCoaching` — the AI rules without the SDK's own buttons |
123
123
  | `@intellectif/lk-react/i18n/LkIntlProvider` | `<LkIntlProvider>`, `useLkStrings`, `useLkDirection`, `DEFAULT_STRINGS`, `mergeStrings`, `directionForLocale` |
124
124
  | `@intellectif/lk-react/theme/ThemeProvider` | `<ThemeProvider>`, `darkTheme`, `useTheme`, `createTailwindTheme` |
125
125
  | `@intellectif/lk-react/theme/defaults.css` | Tokens (required) |
@@ -151,9 +151,13 @@ subpath of their own.
151
151
 
152
152
  ### Versioning note
153
153
 
154
- `@intellectif/lk-core` is a **peer** dependency, so widening its range is a breaking
155
- change for installs and forces a `lk-react` major. Some majors here — **5.0.0**
156
- is the clearest — are exactly that and change no React API. Others do: 6.0.0
154
+ `@intellectif/lk-core` is a **peer** dependency. Before 1.0 every `lk-core` minor
155
+ forced a `lk-react` major, which is why this package is at 23.x; since 1.0 a
156
+ `lk-core` minor or patch releases no `lk-react` at all, and when `lk-react` needs a
157
+ newer `lk-core` its own release says which
158
+ ([Stability](https://github.com/intellectif/learning-kit/blob/main/docs/stability.md#the-two-version-numbers)).
159
+ Some of the early majors — **5.0.0** is the clearest — are only that peer bump and
160
+ change no React API. Others do: 6.0.0
157
161
  added five `<ActivitySequence>` props, a `restored` arm to `SequenceItemOutcome`
158
162
  that an exhaustive `switch` must handle, and a changed reset target for
159
163
  `<MultipleChoice>`. Always read the
@@ -165,7 +169,7 @@ before assuming a migration is needed.
165
169
  - **What is supported, and since when** — [Features](https://github.com/intellectif/learning-kit/blob/main/docs/features.md): every activity and capability, the `lk-core` / `lk-react` versions it arrived in, and its guide.
166
170
  - **What changed** — [GitHub Releases](https://github.com/intellectif/learning-kit/releases), one per package version, and the same notes in each package's `CHANGELOG.md` (it ships in the npm package, so it is in your `node_modules` too). Notes written since release notes gained a template — every release after lk-core 0.20.0 / lk-react 20.0.0 — start with a one-line summary and **Action required**: `none`, or what to do. Earlier notes lead with the detail; the version map in the upgrading guide says what each one asks of you.
167
171
  - **How to upgrade** — [Upgrading](https://github.com/intellectif/learning-kit/blob/main/docs/upgrading.md): which `lk-core` goes with which `lk-react`, and a section per release saying what, if anything, you need to change. A `lk-react` major is often only the `lk-core` peer bump; the map says so.
168
- - **Hearing about a release** — on GitHub, **Watch → Custom → Releases**, or subscribe to [the releases feed](https://github.com/intellectif/learning-kit/releases.atom). Better still, let your dependency bot bring each release to you as a pull request, with its notes — and keep the two packages together in one, since they move together:
172
+ - **Hearing about a release** — on GitHub, **Watch → Custom → Releases**, or subscribe to [the releases feed](https://github.com/intellectif/learning-kit/releases.atom). Better still, let your dependency bot bring each release to you as a pull request, with its notes — and keep the two packages together in one, since a `lk-react` release names the `lk-core` it needs:
169
173
 
170
174
  ```yaml
171
175
  # .github/dependabot.yml — one entry per directory with a package.json
@@ -181,7 +185,7 @@ before assuming a migration is needed.
181
185
 
182
186
  With Renovate: `"packageRules": [{ "matchPackageNames": ["@intellectif/lk-core", "@intellectif/lk-react"], "groupName": "learning-kit" }]`.
183
187
 
184
- `lk-core` is still `0.x`, and a caret range on a `0.x` version matches only that minor: `^0.18.0` never installs `0.19.0`. A bot is how you find out there is one.
188
+ A caret range installs every later minor and patch of its major — `^1.2.0` takes `1.3.0` — and never a new major. A bot is how you hear about either, with its notes.
185
189
 
186
190
  ## Documentation
187
191
 
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+ const require_useAiHelp = require("./useAiHelp-h9yOLFqt.cjs");
3
+ const require_LkIntlProvider = require("./LkIntlProvider-oi57lYB0.cjs");
4
+ let react = require("react");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ //#region src/components/ActivityErrorBoundary.tsx
7
+ /**
8
+ * Catches render errors in an activity subtree. In development it renders the
9
+ * full error stack to aid debugging; in production it renders an accessible,
10
+ * generic fallback (optionally naming the activity) so a single broken
11
+ * activity never crashes the host application.
12
+ */
13
+ var ActivityErrorBoundary = class extends react.Component {
14
+ state = { error: null };
15
+ static getDerivedStateFromError(error) {
16
+ return { error };
17
+ }
18
+ render() {
19
+ const { error } = this.state;
20
+ if (!error) return this.props.children;
21
+ if (require_useAiHelp.isDevelopment()) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
22
+ role: "alert",
23
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: (this.props.strings ?? require_LkIntlProvider.DEFAULT_STRINGS).activityFailed }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: error.stack ?? error.message })]
24
+ });
25
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26
+ role: "alert",
27
+ children: this.props.activityTitle ? (this.props.strings ?? require_LkIntlProvider.DEFAULT_STRINGS).activityFailedNamed(this.props.activityTitle) : (this.props.strings ?? require_LkIntlProvider.DEFAULT_STRINGS).activityFailedUnnamed
28
+ });
29
+ }
30
+ };
31
+ //#endregion
32
+ Object.defineProperty(exports, "ActivityErrorBoundary", {
33
+ enumerable: true,
34
+ get: function() {
35
+ return ActivityErrorBoundary;
36
+ }
37
+ });
38
+
39
+ //# sourceMappingURL=ActivityErrorBoundary-B379hvtL.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActivityErrorBoundary-B379hvtL.cjs","names":["Component","isDevelopment","DEFAULT_STRINGS"],"sources":["../src/components/ActivityErrorBoundary.tsx"],"sourcesContent":["'use client';\n\nimport { Component, type ReactNode } from 'react';\nimport type { LkStrings } from '../i18n/strings.js';\nimport { DEFAULT_STRINGS } from '../i18n/strings.js';\nimport { isDevelopment } from './_internal.js';\n\nexport interface ActivityErrorBoundaryProps {\n /** Shown in the production fallback when a render error occurs. */\n activityTitle?: string;\n /**\n * Chrome text. A class component cannot call `useLkStrings`, so the public\n * wrapper reads the hook and hands the resolved dictionary down.\n */\n strings?: LkStrings;\n children: ReactNode;\n}\n\ninterface ActivityErrorBoundaryState {\n error: Error | null;\n}\n\n/**\n * Catches render errors in an activity subtree. In development it renders the\n * full error stack to aid debugging; in production it renders an accessible,\n * generic fallback (optionally naming the activity) so a single broken\n * activity never crashes the host application.\n */\nexport class ActivityErrorBoundary extends Component<\n ActivityErrorBoundaryProps,\n ActivityErrorBoundaryState\n> {\n state: ActivityErrorBoundaryState = { error: null };\n\n static getDerivedStateFromError(error: Error): ActivityErrorBoundaryState {\n return { error };\n }\n\n render(): ReactNode {\n const { error } = this.state;\n if (!error) {\n return this.props.children;\n }\n\n // The same answer every development check reads, from the one function\n // that gives it: a boundary with a reading of its own showed a learner a\n // stack trace in every browser production build.\n if (isDevelopment()) {\n return (\n <div role=\"alert\">\n <strong>{(this.props.strings ?? DEFAULT_STRINGS).activityFailed}</strong>\n <pre>{error.stack ?? error.message}</pre>\n </div>\n );\n }\n\n return (\n <div role=\"alert\">\n {this.props.activityTitle\n ? (this.props.strings ?? DEFAULT_STRINGS).activityFailedNamed(this.props.activityTitle)\n : (this.props.strings ?? DEFAULT_STRINGS).activityFailedUnnamed}\n </div>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AA4BA,IAAa,wBAAb,cAA2CA,MAAAA,UAGzC;CACA,QAAoC,EAAE,OAAO,KAAK;CAElD,OAAO,yBAAyB,OAA0C;EACxE,OAAO,EAAE,MAAM;CACjB;CAEA,SAAoB;EAClB,MAAM,EAAE,UAAU,KAAK;EACvB,IAAI,CAAC,OACH,OAAO,KAAK,MAAM;EAMpB,IAAIC,kBAAAA,cAAc,GAChB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,MAAK;GAAV,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD,EAAA,WAAU,KAAK,MAAM,WAAWC,uBAAAA,gBAAAA,CAAiB,eAAuB,CAAA,GACxE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAA,UAAM,MAAM,SAAS,MAAM,QAAa,CAAA,CACrC;;EAIT,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,MAAK;GACP,UAAA,KAAK,MAAM,iBACP,KAAK,MAAM,WAAWA,uBAAAA,gBAAAA,CAAiB,oBAAoB,KAAK,MAAM,aAAa,KACnF,KAAK,MAAM,WAAWA,uBAAAA,gBAAAA,CAAiB;EACzC,CAAA;CAET;AACF"}
@@ -0,0 +1,34 @@
1
+ 'use client';
2
+ import { c as isDevelopment } from "./useAiHelp-B-ccDL5Q.js";
3
+ import { a as DEFAULT_STRINGS } from "./LkIntlProvider-D_FdYXjQ.js";
4
+ import { Component } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/ActivityErrorBoundary.tsx
7
+ /**
8
+ * Catches render errors in an activity subtree. In development it renders the
9
+ * full error stack to aid debugging; in production it renders an accessible,
10
+ * generic fallback (optionally naming the activity) so a single broken
11
+ * activity never crashes the host application.
12
+ */
13
+ var ActivityErrorBoundary = class extends Component {
14
+ state = { error: null };
15
+ static getDerivedStateFromError(error) {
16
+ return { error };
17
+ }
18
+ render() {
19
+ const { error } = this.state;
20
+ if (!error) return this.props.children;
21
+ if (isDevelopment()) return /* @__PURE__ */ jsxs("div", {
22
+ role: "alert",
23
+ children: [/* @__PURE__ */ jsx("strong", { children: (this.props.strings ?? DEFAULT_STRINGS).activityFailed }), /* @__PURE__ */ jsx("pre", { children: error.stack ?? error.message })]
24
+ });
25
+ return /* @__PURE__ */ jsx("div", {
26
+ role: "alert",
27
+ children: this.props.activityTitle ? (this.props.strings ?? DEFAULT_STRINGS).activityFailedNamed(this.props.activityTitle) : (this.props.strings ?? DEFAULT_STRINGS).activityFailedUnnamed
28
+ });
29
+ }
30
+ };
31
+ //#endregion
32
+ export { ActivityErrorBoundary as t };
33
+
34
+ //# sourceMappingURL=ActivityErrorBoundary-Dw6SbWv3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActivityErrorBoundary-Dw6SbWv3.js","names":[],"sources":["../src/components/ActivityErrorBoundary.tsx"],"sourcesContent":["'use client';\n\nimport { Component, type ReactNode } from 'react';\nimport type { LkStrings } from '../i18n/strings.js';\nimport { DEFAULT_STRINGS } from '../i18n/strings.js';\nimport { isDevelopment } from './_internal.js';\n\nexport interface ActivityErrorBoundaryProps {\n /** Shown in the production fallback when a render error occurs. */\n activityTitle?: string;\n /**\n * Chrome text. A class component cannot call `useLkStrings`, so the public\n * wrapper reads the hook and hands the resolved dictionary down.\n */\n strings?: LkStrings;\n children: ReactNode;\n}\n\ninterface ActivityErrorBoundaryState {\n error: Error | null;\n}\n\n/**\n * Catches render errors in an activity subtree. In development it renders the\n * full error stack to aid debugging; in production it renders an accessible,\n * generic fallback (optionally naming the activity) so a single broken\n * activity never crashes the host application.\n */\nexport class ActivityErrorBoundary extends Component<\n ActivityErrorBoundaryProps,\n ActivityErrorBoundaryState\n> {\n state: ActivityErrorBoundaryState = { error: null };\n\n static getDerivedStateFromError(error: Error): ActivityErrorBoundaryState {\n return { error };\n }\n\n render(): ReactNode {\n const { error } = this.state;\n if (!error) {\n return this.props.children;\n }\n\n // The same answer every development check reads, from the one function\n // that gives it: a boundary with a reading of its own showed a learner a\n // stack trace in every browser production build.\n if (isDevelopment()) {\n return (\n <div role=\"alert\">\n <strong>{(this.props.strings ?? DEFAULT_STRINGS).activityFailed}</strong>\n <pre>{error.stack ?? error.message}</pre>\n </div>\n );\n }\n\n return (\n <div role=\"alert\">\n {this.props.activityTitle\n ? (this.props.strings ?? DEFAULT_STRINGS).activityFailedNamed(this.props.activityTitle)\n : (this.props.strings ?? DEFAULT_STRINGS).activityFailedUnnamed}\n </div>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AA4BA,IAAa,wBAAb,cAA2C,UAGzC;CACA,QAAoC,EAAE,OAAO,KAAK;CAElD,OAAO,yBAAyB,OAA0C;EACxE,OAAO,EAAE,MAAM;CACjB;CAEA,SAAoB;EAClB,MAAM,EAAE,UAAU,KAAK;EACvB,IAAI,CAAC,OACH,OAAO,KAAK,MAAM;EAMpB,IAAI,cAAc,GAChB,OACE,qBAAC,OAAD;GAAK,MAAK;GAAV,UAAA,CACE,oBAAC,UAAD,EAAA,WAAU,KAAK,MAAM,WAAW,gBAAA,CAAiB,eAAuB,CAAA,GACxE,oBAAC,OAAD,EAAA,UAAM,MAAM,SAAS,MAAM,QAAa,CAAA,CACrC;;EAIT,OACE,oBAAC,OAAD;GAAK,MAAK;GACP,UAAA,KAAK,MAAM,iBACP,KAAK,MAAM,WAAW,gBAAA,CAAiB,oBAAoB,KAAK,MAAM,aAAa,KACnF,KAAK,MAAM,WAAW,gBAAA,CAAiB;EACzC,CAAA;CAET;AACF"}