@intellectif/lk-react 23.1.0 → 23.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +9 -5
  3. package/dist/ActivityErrorBoundary-B379hvtL.cjs +39 -0
  4. package/dist/ActivityErrorBoundary-B379hvtL.cjs.map +1 -0
  5. package/dist/ActivityErrorBoundary-Dw6SbWv3.js +34 -0
  6. package/dist/ActivityErrorBoundary-Dw6SbWv3.js.map +1 -0
  7. package/dist/ActivityMedia-CQQTRNl7.cjs +641 -0
  8. package/dist/ActivityMedia-CQQTRNl7.cjs.map +1 -0
  9. package/dist/ActivityMedia-vDiP-Psa.js +636 -0
  10. package/dist/ActivityMedia-vDiP-Psa.js.map +1 -0
  11. package/dist/ActivityPreview-1hhTkYuj.js +240 -0
  12. package/dist/ActivityPreview-1hhTkYuj.js.map +1 -0
  13. package/dist/ActivityPreview-BKr34exz.cjs +245 -0
  14. package/dist/ActivityPreview-BKr34exz.cjs.map +1 -0
  15. package/dist/ActivitySequence-CkX87pfB.js +839 -0
  16. package/dist/ActivitySequence-CkX87pfB.js.map +1 -0
  17. package/dist/ActivitySequence-CmoSyDnp.cjs +844 -0
  18. package/dist/ActivitySequence-CmoSyDnp.cjs.map +1 -0
  19. package/dist/Dictation-BlxRp-3k.js +926 -0
  20. package/dist/Dictation-BlxRp-3k.js.map +1 -0
  21. package/dist/Dictation-jECzL88E.cjs +931 -0
  22. package/dist/Dictation-jECzL88E.cjs.map +1 -0
  23. package/dist/FeedbackRegion-BNNMtTY-.cjs +108 -0
  24. package/dist/FeedbackRegion-BNNMtTY-.cjs.map +1 -0
  25. package/dist/FeedbackRegion-CyPSp8bA.js +85 -0
  26. package/dist/FeedbackRegion-CyPSp8bA.js.map +1 -0
  27. package/dist/FillInTheBlanks-B6xzqYXx.js +474 -0
  28. package/dist/FillInTheBlanks-B6xzqYXx.js.map +1 -0
  29. package/dist/FillInTheBlanks-BpKhdHg2.cjs +479 -0
  30. package/dist/FillInTheBlanks-BpKhdHg2.cjs.map +1 -0
  31. package/dist/GapSelect-DUSiaEQH.js +441 -0
  32. package/dist/GapSelect-DUSiaEQH.js.map +1 -0
  33. package/dist/GapSelect-payTq_Zn.cjs +446 -0
  34. package/dist/GapSelect-payTq_Zn.cjs.map +1 -0
  35. package/dist/InteractiveVideo-BguGv-HA.cjs +2955 -0
  36. package/dist/InteractiveVideo-BguGv-HA.cjs.map +1 -0
  37. package/dist/InteractiveVideo-Cg2jbU3j.js +2944 -0
  38. package/dist/InteractiveVideo-Cg2jbU3j.js.map +1 -0
  39. package/dist/LkAiProvider-DAPpA3PQ.d.cts +84 -0
  40. package/dist/LkAiProvider-DAPpA3PQ.d.cts.map +1 -0
  41. package/dist/LkAiProvider-QdEcIhoo.d.ts +84 -0
  42. package/dist/LkAiProvider-QdEcIhoo.d.ts.map +1 -0
  43. package/dist/LkIntlProvider-D_FdYXjQ.js +375 -0
  44. package/dist/LkIntlProvider-D_FdYXjQ.js.map +1 -0
  45. package/dist/LkIntlProvider-oi57lYB0.cjs +410 -0
  46. package/dist/LkIntlProvider-oi57lYB0.cjs.map +1 -0
  47. package/dist/MultipleChoice-COn5MtKY.cjs +433 -0
  48. package/dist/MultipleChoice-COn5MtKY.cjs.map +1 -0
  49. package/dist/MultipleChoice-Dra0_KYD.js +428 -0
  50. package/dist/MultipleChoice-Dra0_KYD.js.map +1 -0
  51. package/dist/PronunciationFeedback-DlMPGjkR.cjs +831 -0
  52. package/dist/PronunciationFeedback-DlMPGjkR.cjs.map +1 -0
  53. package/dist/PronunciationFeedback-Dxd6XPkO.js +772 -0
  54. package/dist/PronunciationFeedback-Dxd6XPkO.js.map +1 -0
  55. package/dist/ReadAloud-C8RhaUqV.js +1092 -0
  56. package/dist/{chunk-DC4CQCK5.js.map → ReadAloud-C8RhaUqV.js.map} +1 -1
  57. package/dist/ReadAloud-akDehitT.cjs +1103 -0
  58. package/dist/ReadAloud-akDehitT.cjs.map +1 -0
  59. package/dist/StimulusPanel-BgzByfkb.js +74 -0
  60. package/dist/StimulusPanel-BgzByfkb.js.map +1 -0
  61. package/dist/StimulusPanel-b66gaN3i.cjs +79 -0
  62. package/dist/StimulusPanel-b66gaN3i.cjs.map +1 -0
  63. package/dist/ThemeProvider-B6DyGqzh.d.cts +62 -0
  64. package/dist/ThemeProvider-B6DyGqzh.d.cts.map +1 -0
  65. package/dist/ThemeProvider-BCrxBaY-.d.ts +62 -0
  66. package/dist/ThemeProvider-BCrxBaY-.d.ts.map +1 -0
  67. package/dist/ThemeProvider-BRN1tj4n.cjs +187 -0
  68. package/dist/ThemeProvider-BRN1tj4n.cjs.map +1 -0
  69. package/dist/ThemeProvider-C7K9iMLX.js +158 -0
  70. package/dist/ThemeProvider-C7K9iMLX.js.map +1 -0
  71. package/dist/WrittenResponse-Bj3eFmGl.cjs +491 -0
  72. package/dist/WrittenResponse-Bj3eFmGl.cjs.map +1 -0
  73. package/dist/WrittenResponse-Cl8G6nO_.js +486 -0
  74. package/dist/WrittenResponse-Cl8G6nO_.js.map +1 -0
  75. package/dist/ai/LkAiProvider.cjs +34 -14
  76. package/dist/ai/LkAiProvider.cjs.map +1 -1
  77. package/dist/ai/LkAiProvider.d.cts +2 -83
  78. package/dist/ai/LkAiProvider.d.ts +2 -83
  79. package/dist/ai/LkAiProvider.js +33 -2
  80. package/dist/ai/LkAiProvider.js.map +1 -1
  81. package/dist/ai/useAiHelp.cjs +7 -25
  82. package/dist/ai/useAiHelp.d.cts +175 -177
  83. package/dist/ai/useAiHelp.d.cts.map +1 -0
  84. package/dist/ai/useAiHelp.d.ts +175 -177
  85. package/dist/ai/useAiHelp.d.ts.map +1 -0
  86. package/dist/ai/useAiHelp.js +3 -4
  87. package/dist/components/ActivityPreview.cjs +3 -29
  88. package/dist/components/ActivityPreview.d.cts +2 -81
  89. package/dist/components/ActivityPreview.d.ts +2 -81
  90. package/dist/components/ActivityPreview.js +2 -20
  91. package/dist/components/ActivitySequence.cjs +3 -30
  92. package/dist/components/ActivitySequence.d.cts +2 -432
  93. package/dist/components/ActivitySequence.d.ts +2 -432
  94. package/dist/components/ActivitySequence.js +2 -21
  95. package/dist/components/Dictation.cjs +4 -21
  96. package/dist/components/Dictation.d.cts +2 -19
  97. package/dist/components/Dictation.d.ts +2 -19
  98. package/dist/components/Dictation.js +3 -12
  99. package/dist/components/FillInTheBlanks.cjs +4 -20
  100. package/dist/components/FillInTheBlanks.d.cts +2 -30
  101. package/dist/components/FillInTheBlanks.d.ts +2 -30
  102. package/dist/components/FillInTheBlanks.js +3 -11
  103. package/dist/components/GapSelect.cjs +4 -20
  104. package/dist/components/GapSelect.d.cts +2 -27
  105. package/dist/components/GapSelect.d.ts +2 -27
  106. package/dist/components/GapSelect.js +3 -11
  107. package/dist/components/InteractiveVideo.cjs +5 -32
  108. package/dist/components/InteractiveVideo.d.cts +3 -291
  109. package/dist/components/InteractiveVideo.d.ts +3 -291
  110. package/dist/components/InteractiveVideo.js +3 -19
  111. package/dist/components/MultipleChoice.cjs +4 -20
  112. package/dist/components/MultipleChoice.d.cts +2 -26
  113. package/dist/components/MultipleChoice.d.ts +2 -26
  114. package/dist/components/MultipleChoice.js +3 -11
  115. package/dist/components/PronunciationFeedback.cjs +4 -17
  116. package/dist/components/PronunciationFeedback.d.cts +2 -90
  117. package/dist/components/PronunciationFeedback.d.ts +2 -90
  118. package/dist/components/PronunciationFeedback.js +3 -8
  119. package/dist/components/ReadAloud.cjs +4 -22
  120. package/dist/components/ReadAloud.d.cts +7 -11
  121. package/dist/components/ReadAloud.d.cts.map +1 -0
  122. package/dist/components/ReadAloud.d.ts +7 -11
  123. package/dist/components/ReadAloud.d.ts.map +1 -0
  124. package/dist/components/ReadAloud.js +3 -13
  125. package/dist/components/StimulusPanel.cjs +3 -14
  126. package/dist/components/StimulusPanel.d.cts +2 -51
  127. package/dist/components/StimulusPanel.d.ts +2 -51
  128. package/dist/components/StimulusPanel.js +2 -5
  129. package/dist/components/WrittenResponse.cjs +4 -19
  130. package/dist/components/WrittenResponse.d.cts +3 -18
  131. package/dist/components/WrittenResponse.d.ts +3 -18
  132. package/dist/components/WrittenResponse.js +3 -10
  133. package/dist/direction-Dq0_HtA5.js +183 -0
  134. package/dist/direction-Dq0_HtA5.js.map +1 -0
  135. package/dist/direction-K1pj0HCA.cjs +200 -0
  136. package/dist/direction-K1pj0HCA.cjs.map +1 -0
  137. package/dist/hooks/useActivityState.cjs +28 -10
  138. package/dist/hooks/useActivityState.cjs.map +1 -1
  139. package/dist/hooks/useActivityState.d.cts +25 -24
  140. package/dist/hooks/useActivityState.d.cts.map +1 -0
  141. package/dist/hooks/useActivityState.d.ts +25 -24
  142. package/dist/hooks/useActivityState.d.ts.map +1 -0
  143. package/dist/hooks/useActivityState.js +28 -2
  144. package/dist/hooks/useActivityState.js.map +1 -1
  145. package/dist/hooks/useSpeechRecorder.cjs +5 -16
  146. package/dist/hooks/useSpeechRecorder.d.cts +2 -127
  147. package/dist/hooks/useSpeechRecorder.d.ts +2 -127
  148. package/dist/hooks/useSpeechRecorder.js +3 -3
  149. package/dist/hooks/useXAPI.cjs +126 -10
  150. package/dist/hooks/useXAPI.cjs.map +1 -1
  151. package/dist/hooks/useXAPI.d.cts +14 -14
  152. package/dist/hooks/useXAPI.d.cts.map +1 -0
  153. package/dist/hooks/useXAPI.d.ts +14 -14
  154. package/dist/hooks/useXAPI.d.ts.map +1 -0
  155. package/dist/hooks/useXAPI.js +126 -2
  156. package/dist/hooks/useXAPI.js.map +1 -1
  157. package/dist/i18n/LkIntlProvider.cjs +9 -32
  158. package/dist/i18n/LkIntlProvider.d.cts +34 -38
  159. package/dist/i18n/LkIntlProvider.d.cts.map +1 -0
  160. package/dist/i18n/LkIntlProvider.d.ts +34 -38
  161. package/dist/i18n/LkIntlProvider.d.ts.map +1 -0
  162. package/dist/i18n/LkIntlProvider.js +3 -3
  163. package/dist/index-6P4rJHrJ.d.cts +432 -0
  164. package/dist/index-6P4rJHrJ.d.cts.map +1 -0
  165. package/dist/index-90CX504k.d.ts +90 -0
  166. package/dist/index-90CX504k.d.ts.map +1 -0
  167. package/dist/index-B_SgnjsC.d.cts +291 -0
  168. package/dist/index-B_SgnjsC.d.cts.map +1 -0
  169. package/dist/index-BavVW5z5.d.cts +25 -0
  170. package/dist/index-BavVW5z5.d.cts.map +1 -0
  171. package/dist/index-BhHv6Fiu.d.cts +28 -0
  172. package/dist/index-BhHv6Fiu.d.cts.map +1 -0
  173. package/dist/index-Bsu8VciA.d.ts +432 -0
  174. package/dist/index-Bsu8VciA.d.ts.map +1 -0
  175. package/dist/index-C1KGpD1k.d.ts +49 -0
  176. package/dist/index-C1KGpD1k.d.ts.map +1 -0
  177. package/dist/index-CKTpYTCC.d.cts +49 -0
  178. package/dist/index-CKTpYTCC.d.cts.map +1 -0
  179. package/dist/index-CO_SRFJj.d.ts +16 -0
  180. package/dist/index-CO_SRFJj.d.ts.map +1 -0
  181. package/dist/index-CSsuUsP7.d.cts +124 -0
  182. package/dist/index-CSsuUsP7.d.cts.map +1 -0
  183. package/dist/index-CunUyeuN.d.cts +78 -0
  184. package/dist/index-CunUyeuN.d.cts.map +1 -0
  185. package/dist/index-CzfRzks6.d.cts +90 -0
  186. package/dist/index-CzfRzks6.d.cts.map +1 -0
  187. package/dist/index-D14xtpBS.d.cts +24 -0
  188. package/dist/index-D14xtpBS.d.cts.map +1 -0
  189. package/dist/index-DHRPAPZf.d.ts +291 -0
  190. package/dist/index-DHRPAPZf.d.ts.map +1 -0
  191. package/dist/index-DLV6cK26.d.cts +16 -0
  192. package/dist/index-DLV6cK26.d.cts.map +1 -0
  193. package/dist/index-DbCCQ9cP.d.ts +124 -0
  194. package/dist/index-DbCCQ9cP.d.ts.map +1 -0
  195. package/dist/index-DeV5B2m5.d.ts +24 -0
  196. package/dist/index-DeV5B2m5.d.ts.map +1 -0
  197. package/dist/index-TZCJVSge.d.ts +28 -0
  198. package/dist/index-TZCJVSge.d.ts.map +1 -0
  199. package/dist/index-ZVvLHsd3.d.ts +25 -0
  200. package/dist/index-ZVvLHsd3.d.ts.map +1 -0
  201. package/dist/index-eQwBgpSw.d.ts +78 -0
  202. package/dist/index-eQwBgpSw.d.ts.map +1 -0
  203. package/dist/index.cjs +118 -163
  204. package/dist/index.cjs.map +1 -1
  205. package/dist/index.d.cts +20 -24
  206. package/dist/index.d.ts +20 -24
  207. package/dist/index.js +84 -29
  208. package/dist/index.js.map +1 -1
  209. package/dist/theme/ThemeProvider.cjs +8 -28
  210. package/dist/theme/ThemeProvider.d.cts +2 -59
  211. package/dist/theme/ThemeProvider.d.ts +2 -59
  212. package/dist/theme/ThemeProvider.js +3 -3
  213. package/dist/tries-CbbtZkdG.cjs +363 -0
  214. package/dist/tries-CbbtZkdG.cjs.map +1 -0
  215. package/dist/tries-DTHSrLCm.js +310 -0
  216. package/dist/tries-DTHSrLCm.js.map +1 -0
  217. package/dist/types-BOQd93x3.d.cts +994 -0
  218. package/dist/types-BOQd93x3.d.cts.map +1 -0
  219. package/dist/types-HIrgF_mS.d.ts +994 -0
  220. package/dist/types-HIrgF_mS.d.ts.map +1 -0
  221. package/dist/useAiHelp-B-ccDL5Q.js +906 -0
  222. package/dist/useAiHelp-B-ccDL5Q.js.map +1 -0
  223. package/dist/useAiHelp-h9yOLFqt.cjs +995 -0
  224. package/dist/useAiHelp-h9yOLFqt.cjs.map +1 -0
  225. package/dist/useSpeechRecorder--O_f-xvt.cjs +720 -0
  226. package/dist/useSpeechRecorder--O_f-xvt.cjs.map +1 -0
  227. package/dist/useSpeechRecorder-DtAYvl02.d.cts +154 -0
  228. package/dist/useSpeechRecorder-DtAYvl02.d.cts.map +1 -0
  229. package/dist/useSpeechRecorder-DtAYvl02.d.ts +154 -0
  230. package/dist/useSpeechRecorder-DtAYvl02.d.ts.map +1 -0
  231. package/dist/useSpeechRecorder-zIi9Dlw8.js +709 -0
  232. package/dist/useSpeechRecorder-zIi9Dlw8.js.map +1 -0
  233. package/package.json +10 -11
  234. package/dist/WrittenResponse-B7A5gHMj.d.ts +0 -115
  235. package/dist/WrittenResponse-BpL9p2Hn.d.cts +0 -115
  236. package/dist/ai/useAiHelp.cjs.map +0 -1
  237. package/dist/ai/useAiHelp.js.map +0 -1
  238. package/dist/chunk-2PNSVBLQ.cjs +0 -54
  239. package/dist/chunk-2PNSVBLQ.cjs.map +0 -1
  240. package/dist/chunk-2TW6WLBC.js +0 -80
  241. package/dist/chunk-2TW6WLBC.js.map +0 -1
  242. package/dist/chunk-4ZZWZSWI.js +0 -61
  243. package/dist/chunk-4ZZWZSWI.js.map +0 -1
  244. package/dist/chunk-6N43WDVG.js +0 -29
  245. package/dist/chunk-6N43WDVG.js.map +0 -1
  246. package/dist/chunk-7ALBSPYR.cjs +0 -436
  247. package/dist/chunk-7ALBSPYR.cjs.map +0 -1
  248. package/dist/chunk-7NFY3M3W.js +0 -234
  249. package/dist/chunk-7NFY3M3W.js.map +0 -1
  250. package/dist/chunk-7SB2MJA4.js +0 -29
  251. package/dist/chunk-7SB2MJA4.js.map +0 -1
  252. package/dist/chunk-ABJJ3LII.js +0 -434
  253. package/dist/chunk-ABJJ3LII.js.map +0 -1
  254. package/dist/chunk-BIGGXHAW.cjs +0 -342
  255. package/dist/chunk-BIGGXHAW.cjs.map +0 -1
  256. package/dist/chunk-C7QZE5BI.js +0 -430
  257. package/dist/chunk-C7QZE5BI.js.map +0 -1
  258. package/dist/chunk-CWTUWNV3.cjs +0 -2937
  259. package/dist/chunk-CWTUWNV3.cjs.map +0 -1
  260. package/dist/chunk-DC4CQCK5.js +0 -915
  261. package/dist/chunk-DS6HN3YR.cjs +0 -496
  262. package/dist/chunk-DS6HN3YR.cjs.map +0 -1
  263. package/dist/chunk-FDQR4GAZ.js +0 -240
  264. package/dist/chunk-FDQR4GAZ.js.map +0 -1
  265. package/dist/chunk-FKGMSOJF.js +0 -394
  266. package/dist/chunk-FKGMSOJF.js.map +0 -1
  267. package/dist/chunk-G6PXJ2SA.js +0 -823
  268. package/dist/chunk-G6PXJ2SA.js.map +0 -1
  269. package/dist/chunk-HNLRVRQR.js +0 -335
  270. package/dist/chunk-HNLRVRQR.js.map +0 -1
  271. package/dist/chunk-J3C72RPK.cjs +0 -31
  272. package/dist/chunk-J3C72RPK.cjs.map +0 -1
  273. package/dist/chunk-K63VPFOV.cjs +0 -134
  274. package/dist/chunk-K63VPFOV.cjs.map +0 -1
  275. package/dist/chunk-KFLIDTDU.cjs +0 -825
  276. package/dist/chunk-KFLIDTDU.cjs.map +0 -1
  277. package/dist/chunk-KHKH5LCT.cjs +0 -250
  278. package/dist/chunk-KHKH5LCT.cjs.map +0 -1
  279. package/dist/chunk-LBEKRN6Y.cjs +0 -664
  280. package/dist/chunk-LBEKRN6Y.cjs.map +0 -1
  281. package/dist/chunk-LPUWXIPR.cjs +0 -578
  282. package/dist/chunk-LPUWXIPR.cjs.map +0 -1
  283. package/dist/chunk-MCO52PV5.js +0 -520
  284. package/dist/chunk-MCO52PV5.js.map +0 -1
  285. package/dist/chunk-MKXEM2C5.cjs +0 -396
  286. package/dist/chunk-MKXEM2C5.cjs.map +0 -1
  287. package/dist/chunk-MXNC5UNO.js +0 -563
  288. package/dist/chunk-MXNC5UNO.js.map +0 -1
  289. package/dist/chunk-NAK55BYU.cjs +0 -859
  290. package/dist/chunk-NAK55BYU.cjs.map +0 -1
  291. package/dist/chunk-NDBMKGQ5.cjs +0 -599
  292. package/dist/chunk-NDBMKGQ5.cjs.map +0 -1
  293. package/dist/chunk-OD65OZIW.cjs +0 -159
  294. package/dist/chunk-OD65OZIW.cjs.map +0 -1
  295. package/dist/chunk-ORT3KLGI.js +0 -50
  296. package/dist/chunk-ORT3KLGI.js.map +0 -1
  297. package/dist/chunk-PNNUPUH4.cjs +0 -82
  298. package/dist/chunk-PNNUPUH4.cjs.map +0 -1
  299. package/dist/chunk-PWHECW6N.js +0 -2934
  300. package/dist/chunk-PWHECW6N.js.map +0 -1
  301. package/dist/chunk-RBS5A2DF.js +0 -857
  302. package/dist/chunk-RBS5A2DF.js.map +0 -1
  303. package/dist/chunk-RPWUDXG5.cjs +0 -63
  304. package/dist/chunk-RPWUDXG5.cjs.map +0 -1
  305. package/dist/chunk-TCDJY3H6.js +0 -494
  306. package/dist/chunk-TCDJY3H6.js.map +0 -1
  307. package/dist/chunk-TP5UMRAU.cjs +0 -918
  308. package/dist/chunk-TP5UMRAU.cjs.map +0 -1
  309. package/dist/chunk-TS7J6DTY.js +0 -597
  310. package/dist/chunk-TS7J6DTY.js.map +0 -1
  311. package/dist/chunk-TUVENMXB.cjs +0 -20
  312. package/dist/chunk-TUVENMXB.cjs.map +0 -1
  313. package/dist/chunk-UDCQTOVU.cjs +0 -523
  314. package/dist/chunk-UDCQTOVU.cjs.map +0 -1
  315. package/dist/chunk-UHKZXOXD.js +0 -128
  316. package/dist/chunk-UHKZXOXD.js.map +0 -1
  317. package/dist/chunk-V6BA44DS.cjs +0 -236
  318. package/dist/chunk-V6BA44DS.cjs.map +0 -1
  319. package/dist/chunk-XO5R73Y4.js +0 -653
  320. package/dist/chunk-XO5R73Y4.js.map +0 -1
  321. package/dist/chunk-XOR4MPEN.cjs +0 -31
  322. package/dist/chunk-XOR4MPEN.cjs.map +0 -1
  323. package/dist/chunk-YORQQXGO.js +0 -155
  324. package/dist/chunk-YORQQXGO.js.map +0 -1
  325. package/dist/chunk-YY4PFR3Z.cjs +0 -432
  326. package/dist/chunk-YY4PFR3Z.cjs.map +0 -1
  327. package/dist/chunk-ZPI6Q42R.js +0 -17
  328. package/dist/chunk-ZPI6Q42R.js.map +0 -1
  329. package/dist/components/ActivityPreview.cjs.map +0 -1
  330. package/dist/components/ActivityPreview.js.map +0 -1
  331. package/dist/components/ActivitySequence.cjs.map +0 -1
  332. package/dist/components/ActivitySequence.js.map +0 -1
  333. package/dist/components/Dictation.cjs.map +0 -1
  334. package/dist/components/Dictation.js.map +0 -1
  335. package/dist/components/FillInTheBlanks.cjs.map +0 -1
  336. package/dist/components/FillInTheBlanks.js.map +0 -1
  337. package/dist/components/GapSelect.cjs.map +0 -1
  338. package/dist/components/GapSelect.js.map +0 -1
  339. package/dist/components/InteractiveVideo.cjs.map +0 -1
  340. package/dist/components/InteractiveVideo.js.map +0 -1
  341. package/dist/components/MultipleChoice.cjs.map +0 -1
  342. package/dist/components/MultipleChoice.js.map +0 -1
  343. package/dist/components/PronunciationFeedback.cjs.map +0 -1
  344. package/dist/components/PronunciationFeedback.js.map +0 -1
  345. package/dist/components/ReadAloud.cjs.map +0 -1
  346. package/dist/components/ReadAloud.js.map +0 -1
  347. package/dist/components/StimulusPanel.cjs.map +0 -1
  348. package/dist/components/StimulusPanel.js.map +0 -1
  349. package/dist/components/WrittenResponse.cjs.map +0 -1
  350. package/dist/components/WrittenResponse.js.map +0 -1
  351. package/dist/hooks/useSpeechRecorder.cjs.map +0 -1
  352. package/dist/hooks/useSpeechRecorder.js.map +0 -1
  353. package/dist/i18n/LkIntlProvider.cjs.map +0 -1
  354. package/dist/i18n/LkIntlProvider.js.map +0 -1
  355. package/dist/machine-CuwKqWXC.d.cts +0 -26
  356. package/dist/machine-CuwKqWXC.d.ts +0 -26
  357. package/dist/theme/ThemeProvider.cjs.map +0 -1
  358. package/dist/theme/ThemeProvider.js.map +0 -1
  359. package/dist/types-C4IsUQsK.d.ts +0 -989
  360. package/dist/types-CJgZWtl4.d.cts +0 -989
@@ -0,0 +1,84 @@
1
+ import { AiCoachingRequest, AiCoachingResult, AiExplanationRequest, AiHintRequest, AiTextResult, AiWritingFeedbackRequest, AiWritingFeedbackResult } from "@intellectif/lk-core";
2
+ import { ReactNode } from "react";
3
+ //#region src/ai/LkAiProvider.d.ts
4
+ /**
5
+ * The model a host runs for learners, as the components call it. The SDK never
6
+ * calls a model, holds a key or writes a prompt: each port is the host's
7
+ * function — usually a request to its own server, which holds the key and the
8
+ * prompt and chooses the model.
9
+ *
10
+ * A port is called only when the learner asks — a button, never on render —
11
+ * and gets an `AbortSignal` that fires when the answer it was asked about goes
12
+ * away. Whatever it resolves to is checked before a learner sees it: see
13
+ * `checkAiExplanation` and `checkAiHint` in lk-core. A port that rejects, or
14
+ * resolves to something refused, costs the learner the help, never the
15
+ * question.
16
+ *
17
+ * Leave a port out to switch that feature off. Nothing AI renders in `exam`,
18
+ * whatever is passed.
19
+ */
20
+ interface LearnerAi {
21
+ /** Explains a graded answer. */
22
+ explain?: (request: AiExplanationRequest, options: {
23
+ signal: AbortSignal;
24
+ }) => Promise<AiTextResult>;
25
+ /** Writes the next hint for an answer not yet submitted. */
26
+ hint?: (request: AiHintRequest, options: {
27
+ signal: AbortSignal;
28
+ }) => Promise<AiTextResult>;
29
+ /** The most hints a learner can ask for on one question. Default 3, at most 10. */
30
+ maxHints?: number;
31
+ /**
32
+ * Gives feedback on a draft of a written response, before the learner
33
+ * submits it: the overall feedback as text, corrections that quote the
34
+ * draft, and a judgement per rubric criterion. See `checkAiWritingFeedback`
35
+ * in lk-core for what is refused.
36
+ */
37
+ writingFeedback?: (request: AiWritingFeedbackRequest, options: {
38
+ signal: AbortSignal;
39
+ }) => Promise<AiWritingFeedbackResult>;
40
+ /** How many times a learner can ask for feedback on one written response. Default 3, at most 10. */
41
+ maxWritingFeedback?: number;
42
+ /**
43
+ * Coaches a learner on a graded reading aloud: what the speech engine's
44
+ * marks mean and how to practise, word by word. The marks are the engine's
45
+ * and are never re-scored; coaching on a word the engine did not mark, or a
46
+ * sound it did not report, is refused whole. See `checkAiCoaching` in
47
+ * lk-core. One coaching per reading.
48
+ */
49
+ pronunciationCoaching?: (request: AiCoachingRequest, options: {
50
+ signal: AbortSignal;
51
+ }) => Promise<AiCoachingResult>;
52
+ /**
53
+ * The language to write explanations, hints, feedback and coaching in, as a tag (`es`,
54
+ * `pt-BR`). Defaults to the component's `locale`: the interface language,
55
+ * which the buttons around the help are in, and usually the right one. In a
56
+ * language course it need not be the item's — English items, explained in
57
+ * Spanish — and the item's own language reaches your port as `facts.locale`.
58
+ */
59
+ learnerLocale?: string;
60
+ }
61
+ interface LkAiProviderProps {
62
+ ai: LearnerAi;
63
+ children: ReactNode;
64
+ }
65
+ /**
66
+ * Supplies the host's AI ports to every activity beneath, as `LkIntlProvider`
67
+ * supplies strings. A component's own `ai` prop wins over it, whole.
68
+ *
69
+ * ```tsx
70
+ * <LkAiProvider ai={{
71
+ * explain: (request, { signal }) => api.explain(request, signal),
72
+ * hint: (request, { signal }) => api.hint(request, signal),
73
+ * learnerLocale: learner.language,
74
+ * }}>
75
+ * <ActivitySequence … />
76
+ * </LkAiProvider>
77
+ * ```
78
+ */
79
+ declare function LkAiProvider({ ai, children }: LkAiProviderProps): React.JSX.Element;
80
+ /** The ports in force: a component's own, else the provider's, else none. */
81
+ declare function useLearnerAi(override?: LearnerAi): LearnerAi | undefined;
82
+ //#endregion
83
+ export { useLearnerAi as i, LkAiProvider as n, LkAiProviderProps as r, LearnerAi as t };
84
+ //# sourceMappingURL=LkAiProvider-DAPpA3PQ.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LkAiProvider-DAPpA3PQ.d.cts","names":[],"sources":["../src/ai/LkAiProvider.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;UA6BiB;;EAEf,WACE,SAAS,sBACT;IAAW,QAAQ;QAChB,QAAQ;;EAEb,QAAQ,SAAS,eAAe;IAAW,QAAQ;QAAkB,QAAQ;;EAE7E;;;;;;;EAOA,mBACE,SAAS,0BACT;IAAW,QAAQ;QAChB,QAAQ;;EAEb;;;;;;;;EAQA,yBACE,SAAS,mBACT;IAAW,QAAQ;QAChB,QAAQ;;;;;;;;EAQb;;UAKe;EACf,IAAI;EACJ,UAAU;;;;;;;;;;;;;;;;iBAiBI,eAAe,IAAI,YAAY,oBAAoB,MAAM,IAAI;;iBAK7D,aAAa,WAAW,YAAY"}
@@ -0,0 +1,84 @@
1
+ import { ReactNode } from "react";
2
+ import { AiCoachingRequest, AiCoachingResult, AiExplanationRequest, AiHintRequest, AiTextResult, AiWritingFeedbackRequest, AiWritingFeedbackResult } from "@intellectif/lk-core";
3
+ //#region src/ai/LkAiProvider.d.ts
4
+ /**
5
+ * The model a host runs for learners, as the components call it. The SDK never
6
+ * calls a model, holds a key or writes a prompt: each port is the host's
7
+ * function — usually a request to its own server, which holds the key and the
8
+ * prompt and chooses the model.
9
+ *
10
+ * A port is called only when the learner asks — a button, never on render —
11
+ * and gets an `AbortSignal` that fires when the answer it was asked about goes
12
+ * away. Whatever it resolves to is checked before a learner sees it: see
13
+ * `checkAiExplanation` and `checkAiHint` in lk-core. A port that rejects, or
14
+ * resolves to something refused, costs the learner the help, never the
15
+ * question.
16
+ *
17
+ * Leave a port out to switch that feature off. Nothing AI renders in `exam`,
18
+ * whatever is passed.
19
+ */
20
+ interface LearnerAi {
21
+ /** Explains a graded answer. */
22
+ explain?: (request: AiExplanationRequest, options: {
23
+ signal: AbortSignal;
24
+ }) => Promise<AiTextResult>;
25
+ /** Writes the next hint for an answer not yet submitted. */
26
+ hint?: (request: AiHintRequest, options: {
27
+ signal: AbortSignal;
28
+ }) => Promise<AiTextResult>;
29
+ /** The most hints a learner can ask for on one question. Default 3, at most 10. */
30
+ maxHints?: number;
31
+ /**
32
+ * Gives feedback on a draft of a written response, before the learner
33
+ * submits it: the overall feedback as text, corrections that quote the
34
+ * draft, and a judgement per rubric criterion. See `checkAiWritingFeedback`
35
+ * in lk-core for what is refused.
36
+ */
37
+ writingFeedback?: (request: AiWritingFeedbackRequest, options: {
38
+ signal: AbortSignal;
39
+ }) => Promise<AiWritingFeedbackResult>;
40
+ /** How many times a learner can ask for feedback on one written response. Default 3, at most 10. */
41
+ maxWritingFeedback?: number;
42
+ /**
43
+ * Coaches a learner on a graded reading aloud: what the speech engine's
44
+ * marks mean and how to practise, word by word. The marks are the engine's
45
+ * and are never re-scored; coaching on a word the engine did not mark, or a
46
+ * sound it did not report, is refused whole. See `checkAiCoaching` in
47
+ * lk-core. One coaching per reading.
48
+ */
49
+ pronunciationCoaching?: (request: AiCoachingRequest, options: {
50
+ signal: AbortSignal;
51
+ }) => Promise<AiCoachingResult>;
52
+ /**
53
+ * The language to write explanations, hints, feedback and coaching in, as a tag (`es`,
54
+ * `pt-BR`). Defaults to the component's `locale`: the interface language,
55
+ * which the buttons around the help are in, and usually the right one. In a
56
+ * language course it need not be the item's — English items, explained in
57
+ * Spanish — and the item's own language reaches your port as `facts.locale`.
58
+ */
59
+ learnerLocale?: string;
60
+ }
61
+ interface LkAiProviderProps {
62
+ ai: LearnerAi;
63
+ children: ReactNode;
64
+ }
65
+ /**
66
+ * Supplies the host's AI ports to every activity beneath, as `LkIntlProvider`
67
+ * supplies strings. A component's own `ai` prop wins over it, whole.
68
+ *
69
+ * ```tsx
70
+ * <LkAiProvider ai={{
71
+ * explain: (request, { signal }) => api.explain(request, signal),
72
+ * hint: (request, { signal }) => api.hint(request, signal),
73
+ * learnerLocale: learner.language,
74
+ * }}>
75
+ * <ActivitySequence … />
76
+ * </LkAiProvider>
77
+ * ```
78
+ */
79
+ declare function LkAiProvider({ ai, children }: LkAiProviderProps): React.JSX.Element;
80
+ /** The ports in force: a component's own, else the provider's, else none. */
81
+ declare function useLearnerAi(override?: LearnerAi): LearnerAi | undefined;
82
+ //#endregion
83
+ export { useLearnerAi as i, LkAiProvider as n, LkAiProviderProps as r, LearnerAi as t };
84
+ //# sourceMappingURL=LkAiProvider-QdEcIhoo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LkAiProvider-QdEcIhoo.d.ts","names":[],"sources":["../src/ai/LkAiProvider.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;UA6BiB;;EAEf,WACE,SAAS,sBACT;IAAW,QAAQ;QAChB,QAAQ;;EAEb,QAAQ,SAAS,eAAe;IAAW,QAAQ;QAAkB,QAAQ;;EAE7E;;;;;;;EAOA,mBACE,SAAS,0BACT;IAAW,QAAQ;QAChB,QAAQ;;EAEb;;;;;;;;EAQA,yBACE,SAAS,mBACT;IAAW,QAAQ;QAChB,QAAQ;;;;;;;;EAQb;;UAKe;EACf,IAAI;EACJ,UAAU;;;;;;;;;;;;;;;;iBAiBI,eAAe,IAAI,YAAY,oBAAoB,MAAM,IAAI;;iBAK7D,aAAa,WAAW,YAAY"}
@@ -0,0 +1,375 @@
1
+ 'use client';
2
+ import { createContext, useContext, useMemo } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/i18n/strings.ts
5
+ /**
6
+ * English defaults, byte-identical to what every component rendered before the
7
+ * strings surface existed. Supplying no override changes nothing on screen.
8
+ */
9
+ const DEFAULT_STRINGS = {
10
+ submit: "Submit",
11
+ checkAnswers: "Check answers",
12
+ submitAnswers: "Submit answers",
13
+ scoreAnnouncement: (percent, passed) => `Score ${percent}%. ${passed ? "Passed." : "Not passed."}`,
14
+ answerSubmitted: "Answer submitted.",
15
+ notGradedYet: "Not graded yet.",
16
+ noGradeAvailable: "No grade available.",
17
+ tryAgain: "Try again",
18
+ showAnswer: "Show answer",
19
+ keepAnswer: "Keep this answer",
20
+ triesLeft: (tries, costPercent) => `${tries} ${tries === 1 ? "try" : "tries"} left.${costPercent > 0 ? ` Each costs ${costPercent}% of the marks.` : ""}`,
21
+ countedTry: (counts, percent) => `Your ${counts === "first" ? "first" : "best"} try counts. This one scored ${percent}%.`,
22
+ scoreBeforeCosts: (percent) => `Before hints and tries, this answer scored ${percent}%.`,
23
+ hintCost: (percent) => `Each hint costs ${percent}% of this question's marks.`,
24
+ showFeedback: "Show feedback",
25
+ hideFeedback: "Hide feedback",
26
+ blankLabel: (ordinal) => `Fill in blank ${ordinal}`,
27
+ gapLabel: (ordinal) => `Choose the answer for gap ${ordinal}`,
28
+ gapPlaceholder: "Choose…",
29
+ showHint: "Show hint",
30
+ hideHint: "Hide hint",
31
+ responseSubmitted: "Response submitted. It will be graded and your result will appear here later.",
32
+ wordCount: (count) => `${count} ${count === 1 ? "word" : "words"}`,
33
+ wordBounds: (min, max) => min > 0 ? `${min}–${max} words` : `up to ${max} words`,
34
+ notApplicable: "Not applicable",
35
+ awaitingHumanReview: "This grade is awaiting review by a teacher.",
36
+ awaitingGrade: "Not graded yet. This response is waiting for its grade.",
37
+ couldNotBeGraded: "This response could not be graded.",
38
+ previous: "Previous",
39
+ next: "Next",
40
+ questionProgress: (index, total) => `Question ${index} of ${total}`,
41
+ unsupportedActivity: "This activity type has no renderer. Supply one through the renderers prop.",
42
+ dictationInputLabel: "Type what you hear",
43
+ dictationRecording: "Recording",
44
+ dictationSlowRecording: "Slow recording",
45
+ dictationRevealNextWord: (revealed, total) => `Reveal the next word (${revealed} of ${total} shown)`,
46
+ dictationResetHints: "Reset hints",
47
+ showSolution: "Show solution",
48
+ hideSolution: "Hide solution",
49
+ dictationSolutionLabel: "Solution",
50
+ dictationMarksLabel: "Your answer, word by word",
51
+ dictationDiffNote: "Compared after ignoring case, punctuation and extra spaces.",
52
+ dictationWordCorrect: (word) => `“${word}” is correct`,
53
+ dictationWordWrong: (word, expected) => `“${word}” should be “${expected}”`,
54
+ dictationWordMissing: (expected) => `“${expected}” is missing`,
55
+ dictationWordWrongUnnamed: (word) => `“${word}” is wrong`,
56
+ dictationWordMissingUnnamed: "A word is missing",
57
+ dictationWordExtra: (word) => `“${word}” is extra`,
58
+ dictationLegendCorrect: "Correct",
59
+ dictationLegendWrong: "Wrong",
60
+ dictationLegendMissing: "Missing",
61
+ dictationLegendExtra: "Extra",
62
+ dictationNothingTyped: "Nothing to compare: no words were entered.",
63
+ dictationWordsSummary: (correct, total) => `${correct} of ${total} ${total === 1 ? "word" : "words"} correct.`,
64
+ readAloudModelRecording: "Model recording",
65
+ readAloudSlowRecording: "Slow model recording",
66
+ readAloudRecord: "Record",
67
+ readAloudStop: "Stop recording",
68
+ readAloudRerecord: "Record again",
69
+ readAloudYourRecording: "Your recording",
70
+ readAloudPlaybackUnavailable: "Your recording cannot be played back on this page.",
71
+ readAloudRecordingProgress: (seconds, maxSeconds) => `Recording: ${seconds} of ${maxSeconds} seconds`,
72
+ readAloudRecordingStarted: "Recording started.",
73
+ readAloudRecordingStopped: (seconds, maxSeconds) => `Recording stopped. ${seconds} of ${maxSeconds} seconds recorded.`,
74
+ readAloudTakesRemaining: (remaining, max) => `${remaining} of ${max} recording${max === 1 ? "" : "s"} left`,
75
+ readAloudSubmitWithoutRecording: "Submit without recording",
76
+ readAloudUploading: "Sending your recording…",
77
+ readAloudUploadFailed: "Your recording could not be sent.",
78
+ readAloudTryAgain: "Try again",
79
+ readAloudAssessing: "Checking your pronunciation…",
80
+ readAloudAssessmentUnavailable: "Pronunciation feedback is not available for this activity.",
81
+ readAloudNotHeard: "We could not hear you. Record again somewhere quieter.",
82
+ readAloudNotAssessed: "This recording could not be assessed. Try recording it again.",
83
+ readAloudAssessmentFailed: "Your pronunciation could not be checked.",
84
+ readAloudRecorderError: (reason) => {
85
+ switch (reason) {
86
+ case "permission-denied": return "This page is not allowed to use the microphone.";
87
+ case "no-device": return "No microphone was found.";
88
+ case "unsupported": return "This browser cannot record audio.";
89
+ case "too-short": return "That recording was too short.";
90
+ default: return "The recording could not be made.";
91
+ }
92
+ },
93
+ pronunciationFeedbackLabel: "Pronunciation feedback",
94
+ pronunciationDimension: (dimension) => {
95
+ switch (dimension) {
96
+ case "accuracy": return "Accuracy";
97
+ case "fluency": return "Fluency";
98
+ case "completeness": return "Completeness";
99
+ default: return "Intonation";
100
+ }
101
+ },
102
+ pronunciationNotAssessed: "Not assessed",
103
+ pronunciationWordsLabel: "Your reading, word by word",
104
+ pronunciationLegend: (state) => {
105
+ switch (state) {
106
+ case "correct": return "Read correctly";
107
+ case "mispronounced": return "Mispronounced";
108
+ case "omitted": return "Not read";
109
+ default: return "Added";
110
+ }
111
+ },
112
+ pronunciationWordCorrect: (word) => `“${word}” was read correctly`,
113
+ pronunciationWordMispronounced: (word) => `“${word}” was mispronounced`,
114
+ pronunciationWordOmitted: (word) => `“${word}” was not read`,
115
+ pronunciationWordInserted: (word) => `“${word}” was added`,
116
+ pronunciationWordDetails: (word) => `Details for “${word}”`,
117
+ pronunciationSyllables: "Syllables",
118
+ pronunciationPhonemes: "Sounds",
119
+ pronunciationSyllableSpelling: (syllable, grapheme) => `${syllable} (spelled “${grapheme}”)`,
120
+ pronunciationPhonemePosition: (ordinal) => `Sound ${ordinal}`,
121
+ pronunciationHeardAs: "Heard as",
122
+ pronunciationPlayWord: (word) => `Play “${word}”`,
123
+ pronunciationBreakUnexpected: "There was an unexpected pause here.",
124
+ pronunciationBreakMissing: "A pause was expected here.",
125
+ pronunciationMonotone: "Your reading stayed on one note. Try varying your pitch.",
126
+ pronunciationIpaNote: "Sounds are written in the International Phonetic Alphabet.",
127
+ videoBack: (seconds) => `Back ${seconds} seconds`,
128
+ videoForward: (seconds) => `Forward ${seconds} seconds`,
129
+ videoReplay: "Replay",
130
+ videoShowRemaining: "Show time remaining",
131
+ videoShowElapsed: "Show time elapsed",
132
+ videoCaptionsShow: "Show captions",
133
+ videoCaptionsHide: "Hide captions",
134
+ videoCaptionsFailed: "Captions could not be loaded.",
135
+ videoSecondaryCaptionsFailed: "The second language could not be loaded.",
136
+ videoSpeedValue: (rate) => rate === 1 ? "Normal" : `${rate}×`,
137
+ videoSettings: "Settings",
138
+ videoCaptionLanguage: "Captions",
139
+ videoSecondCaptionLanguage: "Second language",
140
+ videoCaptionPair: (primary, secondary) => `${primary} + ${secondary}`,
141
+ videoNoSecondLanguage: "No second language for this video.",
142
+ videoCaptionSize: "Caption size",
143
+ videoCaptionSizeValue: (size) => size === "small" ? "Small" : size === "large" ? "Large" : "Medium",
144
+ videoCaptionBackground: "Caption background",
145
+ videoKeyboardShortcuts: "Keyboard shortcuts",
146
+ videoShortcutList: "Shortcut list",
147
+ videoClose: "Close",
148
+ videoOn: "On",
149
+ videoOff: "Off",
150
+ videoShortcut: (action) => {
151
+ switch (action) {
152
+ case "play-pause": return "Play or pause";
153
+ case "jump-10": return "Back or forward 10 seconds";
154
+ case "jump-5": return "Back or forward 5 seconds";
155
+ case "jump-1": return "Back or forward 1 second";
156
+ case "frame": return "Previous or next frame, while paused";
157
+ case "speed": return "Slower or faster";
158
+ case "percent": return "Jump to 0% – 90%";
159
+ case "start-end": return "Start or end";
160
+ case "chapter": return "Previous or next chapter or quiz";
161
+ case "mute": return "Mute";
162
+ case "captions": return "Captions";
163
+ case "secondary-captions": return "Second caption language on/off";
164
+ case "transcript": return "Transcript";
165
+ case "picture-in-picture": return "Picture in picture";
166
+ case "fullscreen": return "Fullscreen";
167
+ default: return "This list";
168
+ }
169
+ },
170
+ videoPanel: "Contents and transcript",
171
+ videoContents: "Contents",
172
+ videoTranscript: "Transcript",
173
+ videoTranscriptSearch: "Search the transcript",
174
+ videoTranscriptNoMatch: "No lines match.",
175
+ videoPictureInPicture: "Picture in picture",
176
+ videoFullscreen: "Fullscreen",
177
+ videoExitFullscreen: "Exit fullscreen",
178
+ videoError: (code) => code === 2 ? "The connection dropped while the video was loading." : code === 3 ? "This video file could not be played." : code === 4 ? "The video could not be loaded." : "The video stopped before it could play.",
179
+ videoTryAgain: "Try again",
180
+ videoQuiz: "Quiz",
181
+ videoQuestionProgress: (index, total) => `Question ${index} of ${total}`,
182
+ videoQuestionStep: (index, answered) => `Question ${index}${answered ? ", answered" : ""}`,
183
+ videoNextQuestion: "Next question",
184
+ videoContinue: "Continue video",
185
+ videoSkipQuiz: "Skip quiz",
186
+ videoRewatch: "Rewatch",
187
+ videoAnswerSaved: "Answer saved",
188
+ videoAnswerPending: "Saving your answer…",
189
+ videoRequired: "Required",
190
+ videoQuizProgress: (answered, total) => answered === total ? "Answered" : answered === 0 ? "Not started" : `${answered} of ${total} answered`,
191
+ videoQuizOpened: (time, questions) => `Video paused. Quiz at ${time}, ${questions} question${questions === 1 ? "" : "s"}.`,
192
+ videoHeldAtQuiz: (time) => `Finish the quiz at ${time} to continue.`,
193
+ videoHeldAhead: "You can rewind, but not skip ahead.",
194
+ videoEnded: "You reached the end",
195
+ videoEndScore: (answered, total, percent) => `You answered ${answered} of ${total} · ${percent}%`,
196
+ videoEndAnswered: (answered, total) => `You answered ${answered} of ${total} questions`,
197
+ videoWatchAgain: "Watch again",
198
+ videoFinish: "Finish",
199
+ previewIncomplete: "This activity is not finished yet, so it cannot be previewed.",
200
+ previewInvalid: "This activity has a problem to fix before it can be previewed.",
201
+ embeddedMedia: "Embedded media",
202
+ stimulusKind: {
203
+ text: "Passage",
204
+ audio: "Recording",
205
+ video: "Video",
206
+ image: "Image",
207
+ mixed: "Material"
208
+ },
209
+ stimulusRange: (first, last) => first === last ? `Question ${first}` : `Questions ${first}–${last}`,
210
+ activityFailed: "Activity failed to render",
211
+ activityFailedNamed: (title) => `"${title}" could not be displayed.`,
212
+ activityFailedUnnamed: "This activity could not be displayed.",
213
+ aiExplain: "Explain my answer",
214
+ aiExplaining: "Explaining…",
215
+ aiExplanation: "Explanation",
216
+ aiExplanationUnavailable: "No explanation is available right now.",
217
+ aiHint: "Get a hint",
218
+ aiHintLoading: "Finding a hint…",
219
+ aiHintNumber: (hintNumber) => `Hint ${hintNumber}`,
220
+ aiHints: "Hints",
221
+ aiHintUnavailable: "No hint is available right now.",
222
+ aiNoMoreHints: "No more hints for this question.",
223
+ aiNotice: "Written by AI. It can make mistakes.",
224
+ aiWritingFeedback: "Get feedback on my draft",
225
+ aiWritingFeedbackLoading: "Reading your draft…",
226
+ aiWritingFeedbackHeading: "Feedback on your draft",
227
+ aiWritingFeedbackUnavailable: "No feedback is available right now.",
228
+ aiNoMoreWritingFeedback: "No more feedback for this answer.",
229
+ aiWritingFeedbackOutdated: "You have changed your text since this feedback.",
230
+ aiCorrections: "Suggested corrections",
231
+ aiIndicativeScore: (percent) => `Indicative score: ${percent}%. Not a grade.`,
232
+ aiCoaching: "Coach me on this reading",
233
+ aiCoachingLoading: "Writing your coaching…",
234
+ aiCoachingHeading: "Coaching on your reading",
235
+ aiCoachingUnavailable: "No coaching is available right now.",
236
+ aiCoachingWords: "Words to practise",
237
+ aiCoachingSound: (expected, heard) => heard === void 0 ? `Sound: ${expected}` : `Sound: ${expected}, heard as ${heard}`,
238
+ media: {
239
+ play: "Play",
240
+ pause: "Pause",
241
+ preparing: "Preparing…",
242
+ mute: "Mute",
243
+ unmute: "Unmute",
244
+ volume: "Volume",
245
+ speed: "Playback speed",
246
+ seek: "Seek",
247
+ timeValue: (elapsed, duration) => `${elapsed} of ${duration}`,
248
+ playsRemaining: (remaining, max) => `${remaining} of ${max} play${max === 1 ? "" : "s"} remaining`,
249
+ noPlaysRemaining: "No plays remaining",
250
+ lastPlayConfirm: "This is your last play. Start it now?",
251
+ lastPlayStart: "Start last play",
252
+ lastPlayCancel: "Not yet",
253
+ seekBlocked: "Rewinding is not available for this recording.",
254
+ rateBlocked: "Playback speed is fixed for this recording.",
255
+ playFailed: "The recording could not be started. Try again."
256
+ }
257
+ };
258
+ /**
259
+ * Layers an override onto a base dictionary.
260
+ *
261
+ * Two levels deep and no further, because the shape is two levels deep. A
262
+ * generic deep merge would silently accept a nested object where a function
263
+ * belongs and fail at render instead of at the call site.
264
+ */
265
+ function mergeStrings(base, override) {
266
+ if (override === void 0) return base;
267
+ const { media, stimulusKind, ...flat } = override;
268
+ return {
269
+ ...base,
270
+ ...flat,
271
+ stimulusKind: {
272
+ ...base.stimulusKind,
273
+ ...stimulusKind
274
+ },
275
+ media: {
276
+ ...base.media,
277
+ ...media
278
+ }
279
+ };
280
+ }
281
+ //#endregion
282
+ //#region src/i18n/LkIntlProvider.tsx
283
+ const LkIntlContext = createContext(null);
284
+ /**
285
+ * Locales written right-to-left, by language subtag.
286
+ *
287
+ * A short list rather than a dependency: these are the RTL scripts in living
288
+ * use, and the set has not changed in decades. `Intl.Locale.textInfo` would be
289
+ * better but is not available everywhere this package runs, and an explicit
290
+ * `direction` prop overrides this in either direction anyway.
291
+ */
292
+ const RTL_LANGUAGES = /* @__PURE__ */ new Set([
293
+ "ar",
294
+ "arc",
295
+ "dv",
296
+ "fa",
297
+ "he",
298
+ "ku",
299
+ "ps",
300
+ "sd",
301
+ "ug",
302
+ "ur",
303
+ "yi"
304
+ ]);
305
+ /** Resolves a BCP 47 tag to a writing direction. */
306
+ function directionForLocale(locale) {
307
+ if (locale === void 0) return "ltr";
308
+ const language = locale.split("-")[0]?.toLowerCase() ?? "";
309
+ return RTL_LANGUAGES.has(language) ? "rtl" : "ltr";
310
+ }
311
+ /**
312
+ * Supplies the SDK's chrome text and writing direction to everything beneath.
313
+ *
314
+ * Mirrors `ThemeProvider`: a provider for the whole tree, and a per-component
315
+ * prop for the exceptions. The component prop wins, so a single activity can
316
+ * be relabelled without a second provider.
317
+ *
318
+ * ```tsx
319
+ * <LkIntlProvider locale="es" strings={{
320
+ * submit: 'Enviar',
321
+ * checkAnswers: 'Comprobar respuestas',
322
+ * questionProgress: (i, total) => `Pregunta ${i} de ${total}`,
323
+ * wordCount: (n) => `${n} ${n === 1 ? 'palabra' : 'palabras'}`,
324
+ * media: { noPlaysRemaining: 'No quedan reproducciones' },
325
+ * }}>
326
+ * <ActivitySequence … />
327
+ * </LkIntlProvider>
328
+ * ```
329
+ *
330
+ * The SDK ships **English only**. Bundling Spanish, Portuguese or Arabic would
331
+ * mean shipping translations nobody in this repo can review, and a wrong
332
+ * "No plays remaining" on a listening exam is worse than an English one that a
333
+ * teacher can see is untranslated. The mechanism is the deliverable; the words
334
+ * belong to whoever speaks the language.
335
+ */
336
+ function LkIntlProvider({ strings, locale, direction = "auto", children }) {
337
+ const value = useMemo(() => ({
338
+ strings: mergeStrings(DEFAULT_STRINGS, strings),
339
+ locale,
340
+ direction: direction === "auto" ? directionForLocale(locale) : direction
341
+ }), [
342
+ strings,
343
+ locale,
344
+ direction
345
+ ]);
346
+ const declared = direction === "auto" && locale === void 0 ? void 0 : value.direction;
347
+ return /* @__PURE__ */ jsx(LkIntlContext.Provider, {
348
+ value,
349
+ children: /* @__PURE__ */ jsx("div", {
350
+ className: "lk-intl",
351
+ lang: locale,
352
+ dir: declared,
353
+ children
354
+ })
355
+ });
356
+ }
357
+ /**
358
+ * The strings in force, with an optional per-component override layered on top.
359
+ *
360
+ * Usable without a provider: every component calls this, and one rendered
361
+ * standalone still needs its labels. Falling back to the English defaults is
362
+ * what keeps `<MultipleChoice>` working with no setup at all.
363
+ */
364
+ function useLkStrings(override) {
365
+ const base = useContext(LkIntlContext)?.strings ?? DEFAULT_STRINGS;
366
+ return useMemo(() => mergeStrings(base, override), [base, override]);
367
+ }
368
+ /** The direction in force. `ltr` with no provider. */
369
+ function useLkDirection() {
370
+ return useContext(LkIntlContext)?.direction ?? "ltr";
371
+ }
372
+ //#endregion
373
+ export { DEFAULT_STRINGS as a, useLkStrings as i, directionForLocale as n, mergeStrings as o, useLkDirection as r, LkIntlProvider as t };
374
+
375
+ //# sourceMappingURL=LkIntlProvider-D_FdYXjQ.js.map