@intellectif/lk-react 23.1.0 → 23.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +9 -5
  3. package/dist/ActivityErrorBoundary-B379hvtL.cjs +39 -0
  4. package/dist/ActivityErrorBoundary-B379hvtL.cjs.map +1 -0
  5. package/dist/ActivityErrorBoundary-Dw6SbWv3.js +34 -0
  6. package/dist/ActivityErrorBoundary-Dw6SbWv3.js.map +1 -0
  7. package/dist/ActivityMedia-CQQTRNl7.cjs +641 -0
  8. package/dist/ActivityMedia-CQQTRNl7.cjs.map +1 -0
  9. package/dist/ActivityMedia-vDiP-Psa.js +636 -0
  10. package/dist/ActivityMedia-vDiP-Psa.js.map +1 -0
  11. package/dist/ActivityPreview-1hhTkYuj.js +240 -0
  12. package/dist/ActivityPreview-1hhTkYuj.js.map +1 -0
  13. package/dist/ActivityPreview-BKr34exz.cjs +245 -0
  14. package/dist/ActivityPreview-BKr34exz.cjs.map +1 -0
  15. package/dist/ActivitySequence-CkX87pfB.js +839 -0
  16. package/dist/ActivitySequence-CkX87pfB.js.map +1 -0
  17. package/dist/ActivitySequence-CmoSyDnp.cjs +844 -0
  18. package/dist/ActivitySequence-CmoSyDnp.cjs.map +1 -0
  19. package/dist/Dictation-BlxRp-3k.js +926 -0
  20. package/dist/Dictation-BlxRp-3k.js.map +1 -0
  21. package/dist/Dictation-jECzL88E.cjs +931 -0
  22. package/dist/Dictation-jECzL88E.cjs.map +1 -0
  23. package/dist/FeedbackRegion-BNNMtTY-.cjs +108 -0
  24. package/dist/FeedbackRegion-BNNMtTY-.cjs.map +1 -0
  25. package/dist/FeedbackRegion-CyPSp8bA.js +85 -0
  26. package/dist/FeedbackRegion-CyPSp8bA.js.map +1 -0
  27. package/dist/FillInTheBlanks-B6xzqYXx.js +474 -0
  28. package/dist/FillInTheBlanks-B6xzqYXx.js.map +1 -0
  29. package/dist/FillInTheBlanks-BpKhdHg2.cjs +479 -0
  30. package/dist/FillInTheBlanks-BpKhdHg2.cjs.map +1 -0
  31. package/dist/GapSelect-DUSiaEQH.js +441 -0
  32. package/dist/GapSelect-DUSiaEQH.js.map +1 -0
  33. package/dist/GapSelect-payTq_Zn.cjs +446 -0
  34. package/dist/GapSelect-payTq_Zn.cjs.map +1 -0
  35. package/dist/InteractiveVideo-BguGv-HA.cjs +2955 -0
  36. package/dist/InteractiveVideo-BguGv-HA.cjs.map +1 -0
  37. package/dist/InteractiveVideo-Cg2jbU3j.js +2944 -0
  38. package/dist/InteractiveVideo-Cg2jbU3j.js.map +1 -0
  39. package/dist/LkAiProvider-DAPpA3PQ.d.cts +84 -0
  40. package/dist/LkAiProvider-DAPpA3PQ.d.cts.map +1 -0
  41. package/dist/LkAiProvider-QdEcIhoo.d.ts +84 -0
  42. package/dist/LkAiProvider-QdEcIhoo.d.ts.map +1 -0
  43. package/dist/LkIntlProvider-D_FdYXjQ.js +375 -0
  44. package/dist/LkIntlProvider-D_FdYXjQ.js.map +1 -0
  45. package/dist/LkIntlProvider-oi57lYB0.cjs +410 -0
  46. package/dist/LkIntlProvider-oi57lYB0.cjs.map +1 -0
  47. package/dist/MultipleChoice-COn5MtKY.cjs +433 -0
  48. package/dist/MultipleChoice-COn5MtKY.cjs.map +1 -0
  49. package/dist/MultipleChoice-Dra0_KYD.js +428 -0
  50. package/dist/MultipleChoice-Dra0_KYD.js.map +1 -0
  51. package/dist/PronunciationFeedback-DlMPGjkR.cjs +831 -0
  52. package/dist/PronunciationFeedback-DlMPGjkR.cjs.map +1 -0
  53. package/dist/PronunciationFeedback-Dxd6XPkO.js +772 -0
  54. package/dist/PronunciationFeedback-Dxd6XPkO.js.map +1 -0
  55. package/dist/ReadAloud-C8RhaUqV.js +1092 -0
  56. package/dist/{chunk-DC4CQCK5.js.map → ReadAloud-C8RhaUqV.js.map} +1 -1
  57. package/dist/ReadAloud-akDehitT.cjs +1103 -0
  58. package/dist/ReadAloud-akDehitT.cjs.map +1 -0
  59. package/dist/StimulusPanel-BgzByfkb.js +74 -0
  60. package/dist/StimulusPanel-BgzByfkb.js.map +1 -0
  61. package/dist/StimulusPanel-b66gaN3i.cjs +79 -0
  62. package/dist/StimulusPanel-b66gaN3i.cjs.map +1 -0
  63. package/dist/ThemeProvider-B6DyGqzh.d.cts +62 -0
  64. package/dist/ThemeProvider-B6DyGqzh.d.cts.map +1 -0
  65. package/dist/ThemeProvider-BCrxBaY-.d.ts +62 -0
  66. package/dist/ThemeProvider-BCrxBaY-.d.ts.map +1 -0
  67. package/dist/ThemeProvider-BRN1tj4n.cjs +187 -0
  68. package/dist/ThemeProvider-BRN1tj4n.cjs.map +1 -0
  69. package/dist/ThemeProvider-C7K9iMLX.js +158 -0
  70. package/dist/ThemeProvider-C7K9iMLX.js.map +1 -0
  71. package/dist/WrittenResponse-Bj3eFmGl.cjs +491 -0
  72. package/dist/WrittenResponse-Bj3eFmGl.cjs.map +1 -0
  73. package/dist/WrittenResponse-Cl8G6nO_.js +486 -0
  74. package/dist/WrittenResponse-Cl8G6nO_.js.map +1 -0
  75. package/dist/ai/LkAiProvider.cjs +34 -14
  76. package/dist/ai/LkAiProvider.cjs.map +1 -1
  77. package/dist/ai/LkAiProvider.d.cts +2 -83
  78. package/dist/ai/LkAiProvider.d.ts +2 -83
  79. package/dist/ai/LkAiProvider.js +33 -2
  80. package/dist/ai/LkAiProvider.js.map +1 -1
  81. package/dist/ai/useAiHelp.cjs +7 -25
  82. package/dist/ai/useAiHelp.d.cts +175 -177
  83. package/dist/ai/useAiHelp.d.cts.map +1 -0
  84. package/dist/ai/useAiHelp.d.ts +175 -177
  85. package/dist/ai/useAiHelp.d.ts.map +1 -0
  86. package/dist/ai/useAiHelp.js +3 -4
  87. package/dist/components/ActivityPreview.cjs +3 -29
  88. package/dist/components/ActivityPreview.d.cts +2 -81
  89. package/dist/components/ActivityPreview.d.ts +2 -81
  90. package/dist/components/ActivityPreview.js +2 -20
  91. package/dist/components/ActivitySequence.cjs +3 -30
  92. package/dist/components/ActivitySequence.d.cts +2 -432
  93. package/dist/components/ActivitySequence.d.ts +2 -432
  94. package/dist/components/ActivitySequence.js +2 -21
  95. package/dist/components/Dictation.cjs +4 -21
  96. package/dist/components/Dictation.d.cts +2 -19
  97. package/dist/components/Dictation.d.ts +2 -19
  98. package/dist/components/Dictation.js +3 -12
  99. package/dist/components/FillInTheBlanks.cjs +4 -20
  100. package/dist/components/FillInTheBlanks.d.cts +2 -30
  101. package/dist/components/FillInTheBlanks.d.ts +2 -30
  102. package/dist/components/FillInTheBlanks.js +3 -11
  103. package/dist/components/GapSelect.cjs +4 -20
  104. package/dist/components/GapSelect.d.cts +2 -27
  105. package/dist/components/GapSelect.d.ts +2 -27
  106. package/dist/components/GapSelect.js +3 -11
  107. package/dist/components/InteractiveVideo.cjs +5 -32
  108. package/dist/components/InteractiveVideo.d.cts +3 -291
  109. package/dist/components/InteractiveVideo.d.ts +3 -291
  110. package/dist/components/InteractiveVideo.js +3 -19
  111. package/dist/components/MultipleChoice.cjs +4 -20
  112. package/dist/components/MultipleChoice.d.cts +2 -26
  113. package/dist/components/MultipleChoice.d.ts +2 -26
  114. package/dist/components/MultipleChoice.js +3 -11
  115. package/dist/components/PronunciationFeedback.cjs +4 -17
  116. package/dist/components/PronunciationFeedback.d.cts +2 -90
  117. package/dist/components/PronunciationFeedback.d.ts +2 -90
  118. package/dist/components/PronunciationFeedback.js +3 -8
  119. package/dist/components/ReadAloud.cjs +4 -22
  120. package/dist/components/ReadAloud.d.cts +7 -11
  121. package/dist/components/ReadAloud.d.cts.map +1 -0
  122. package/dist/components/ReadAloud.d.ts +7 -11
  123. package/dist/components/ReadAloud.d.ts.map +1 -0
  124. package/dist/components/ReadAloud.js +3 -13
  125. package/dist/components/StimulusPanel.cjs +3 -14
  126. package/dist/components/StimulusPanel.d.cts +2 -51
  127. package/dist/components/StimulusPanel.d.ts +2 -51
  128. package/dist/components/StimulusPanel.js +2 -5
  129. package/dist/components/WrittenResponse.cjs +4 -19
  130. package/dist/components/WrittenResponse.d.cts +3 -18
  131. package/dist/components/WrittenResponse.d.ts +3 -18
  132. package/dist/components/WrittenResponse.js +3 -10
  133. package/dist/direction-Dq0_HtA5.js +183 -0
  134. package/dist/direction-Dq0_HtA5.js.map +1 -0
  135. package/dist/direction-K1pj0HCA.cjs +200 -0
  136. package/dist/direction-K1pj0HCA.cjs.map +1 -0
  137. package/dist/hooks/useActivityState.cjs +28 -10
  138. package/dist/hooks/useActivityState.cjs.map +1 -1
  139. package/dist/hooks/useActivityState.d.cts +25 -24
  140. package/dist/hooks/useActivityState.d.cts.map +1 -0
  141. package/dist/hooks/useActivityState.d.ts +25 -24
  142. package/dist/hooks/useActivityState.d.ts.map +1 -0
  143. package/dist/hooks/useActivityState.js +28 -2
  144. package/dist/hooks/useActivityState.js.map +1 -1
  145. package/dist/hooks/useSpeechRecorder.cjs +5 -16
  146. package/dist/hooks/useSpeechRecorder.d.cts +2 -127
  147. package/dist/hooks/useSpeechRecorder.d.ts +2 -127
  148. package/dist/hooks/useSpeechRecorder.js +3 -3
  149. package/dist/hooks/useXAPI.cjs +126 -10
  150. package/dist/hooks/useXAPI.cjs.map +1 -1
  151. package/dist/hooks/useXAPI.d.cts +14 -14
  152. package/dist/hooks/useXAPI.d.cts.map +1 -0
  153. package/dist/hooks/useXAPI.d.ts +14 -14
  154. package/dist/hooks/useXAPI.d.ts.map +1 -0
  155. package/dist/hooks/useXAPI.js +126 -2
  156. package/dist/hooks/useXAPI.js.map +1 -1
  157. package/dist/i18n/LkIntlProvider.cjs +9 -32
  158. package/dist/i18n/LkIntlProvider.d.cts +34 -38
  159. package/dist/i18n/LkIntlProvider.d.cts.map +1 -0
  160. package/dist/i18n/LkIntlProvider.d.ts +34 -38
  161. package/dist/i18n/LkIntlProvider.d.ts.map +1 -0
  162. package/dist/i18n/LkIntlProvider.js +3 -3
  163. package/dist/index-6P4rJHrJ.d.cts +432 -0
  164. package/dist/index-6P4rJHrJ.d.cts.map +1 -0
  165. package/dist/index-90CX504k.d.ts +90 -0
  166. package/dist/index-90CX504k.d.ts.map +1 -0
  167. package/dist/index-B_SgnjsC.d.cts +291 -0
  168. package/dist/index-B_SgnjsC.d.cts.map +1 -0
  169. package/dist/index-BavVW5z5.d.cts +25 -0
  170. package/dist/index-BavVW5z5.d.cts.map +1 -0
  171. package/dist/index-BhHv6Fiu.d.cts +28 -0
  172. package/dist/index-BhHv6Fiu.d.cts.map +1 -0
  173. package/dist/index-Bsu8VciA.d.ts +432 -0
  174. package/dist/index-Bsu8VciA.d.ts.map +1 -0
  175. package/dist/index-C1KGpD1k.d.ts +49 -0
  176. package/dist/index-C1KGpD1k.d.ts.map +1 -0
  177. package/dist/index-CKTpYTCC.d.cts +49 -0
  178. package/dist/index-CKTpYTCC.d.cts.map +1 -0
  179. package/dist/index-CO_SRFJj.d.ts +16 -0
  180. package/dist/index-CO_SRFJj.d.ts.map +1 -0
  181. package/dist/index-CSsuUsP7.d.cts +124 -0
  182. package/dist/index-CSsuUsP7.d.cts.map +1 -0
  183. package/dist/index-CunUyeuN.d.cts +78 -0
  184. package/dist/index-CunUyeuN.d.cts.map +1 -0
  185. package/dist/index-CzfRzks6.d.cts +90 -0
  186. package/dist/index-CzfRzks6.d.cts.map +1 -0
  187. package/dist/index-D14xtpBS.d.cts +24 -0
  188. package/dist/index-D14xtpBS.d.cts.map +1 -0
  189. package/dist/index-DHRPAPZf.d.ts +291 -0
  190. package/dist/index-DHRPAPZf.d.ts.map +1 -0
  191. package/dist/index-DLV6cK26.d.cts +16 -0
  192. package/dist/index-DLV6cK26.d.cts.map +1 -0
  193. package/dist/index-DbCCQ9cP.d.ts +124 -0
  194. package/dist/index-DbCCQ9cP.d.ts.map +1 -0
  195. package/dist/index-DeV5B2m5.d.ts +24 -0
  196. package/dist/index-DeV5B2m5.d.ts.map +1 -0
  197. package/dist/index-TZCJVSge.d.ts +28 -0
  198. package/dist/index-TZCJVSge.d.ts.map +1 -0
  199. package/dist/index-ZVvLHsd3.d.ts +25 -0
  200. package/dist/index-ZVvLHsd3.d.ts.map +1 -0
  201. package/dist/index-eQwBgpSw.d.ts +78 -0
  202. package/dist/index-eQwBgpSw.d.ts.map +1 -0
  203. package/dist/index.cjs +118 -163
  204. package/dist/index.cjs.map +1 -1
  205. package/dist/index.d.cts +20 -24
  206. package/dist/index.d.ts +20 -24
  207. package/dist/index.js +84 -29
  208. package/dist/index.js.map +1 -1
  209. package/dist/theme/ThemeProvider.cjs +8 -28
  210. package/dist/theme/ThemeProvider.d.cts +2 -59
  211. package/dist/theme/ThemeProvider.d.ts +2 -59
  212. package/dist/theme/ThemeProvider.js +3 -3
  213. package/dist/tries-CbbtZkdG.cjs +363 -0
  214. package/dist/tries-CbbtZkdG.cjs.map +1 -0
  215. package/dist/tries-DTHSrLCm.js +310 -0
  216. package/dist/tries-DTHSrLCm.js.map +1 -0
  217. package/dist/types-BOQd93x3.d.cts +994 -0
  218. package/dist/types-BOQd93x3.d.cts.map +1 -0
  219. package/dist/types-HIrgF_mS.d.ts +994 -0
  220. package/dist/types-HIrgF_mS.d.ts.map +1 -0
  221. package/dist/useAiHelp-B-ccDL5Q.js +906 -0
  222. package/dist/useAiHelp-B-ccDL5Q.js.map +1 -0
  223. package/dist/useAiHelp-h9yOLFqt.cjs +995 -0
  224. package/dist/useAiHelp-h9yOLFqt.cjs.map +1 -0
  225. package/dist/useSpeechRecorder--O_f-xvt.cjs +720 -0
  226. package/dist/useSpeechRecorder--O_f-xvt.cjs.map +1 -0
  227. package/dist/useSpeechRecorder-DtAYvl02.d.cts +154 -0
  228. package/dist/useSpeechRecorder-DtAYvl02.d.cts.map +1 -0
  229. package/dist/useSpeechRecorder-DtAYvl02.d.ts +154 -0
  230. package/dist/useSpeechRecorder-DtAYvl02.d.ts.map +1 -0
  231. package/dist/useSpeechRecorder-zIi9Dlw8.js +709 -0
  232. package/dist/useSpeechRecorder-zIi9Dlw8.js.map +1 -0
  233. package/package.json +10 -11
  234. package/dist/WrittenResponse-B7A5gHMj.d.ts +0 -115
  235. package/dist/WrittenResponse-BpL9p2Hn.d.cts +0 -115
  236. package/dist/ai/useAiHelp.cjs.map +0 -1
  237. package/dist/ai/useAiHelp.js.map +0 -1
  238. package/dist/chunk-2PNSVBLQ.cjs +0 -54
  239. package/dist/chunk-2PNSVBLQ.cjs.map +0 -1
  240. package/dist/chunk-2TW6WLBC.js +0 -80
  241. package/dist/chunk-2TW6WLBC.js.map +0 -1
  242. package/dist/chunk-4ZZWZSWI.js +0 -61
  243. package/dist/chunk-4ZZWZSWI.js.map +0 -1
  244. package/dist/chunk-6N43WDVG.js +0 -29
  245. package/dist/chunk-6N43WDVG.js.map +0 -1
  246. package/dist/chunk-7ALBSPYR.cjs +0 -436
  247. package/dist/chunk-7ALBSPYR.cjs.map +0 -1
  248. package/dist/chunk-7NFY3M3W.js +0 -234
  249. package/dist/chunk-7NFY3M3W.js.map +0 -1
  250. package/dist/chunk-7SB2MJA4.js +0 -29
  251. package/dist/chunk-7SB2MJA4.js.map +0 -1
  252. package/dist/chunk-ABJJ3LII.js +0 -434
  253. package/dist/chunk-ABJJ3LII.js.map +0 -1
  254. package/dist/chunk-BIGGXHAW.cjs +0 -342
  255. package/dist/chunk-BIGGXHAW.cjs.map +0 -1
  256. package/dist/chunk-C7QZE5BI.js +0 -430
  257. package/dist/chunk-C7QZE5BI.js.map +0 -1
  258. package/dist/chunk-CWTUWNV3.cjs +0 -2937
  259. package/dist/chunk-CWTUWNV3.cjs.map +0 -1
  260. package/dist/chunk-DC4CQCK5.js +0 -915
  261. package/dist/chunk-DS6HN3YR.cjs +0 -496
  262. package/dist/chunk-DS6HN3YR.cjs.map +0 -1
  263. package/dist/chunk-FDQR4GAZ.js +0 -240
  264. package/dist/chunk-FDQR4GAZ.js.map +0 -1
  265. package/dist/chunk-FKGMSOJF.js +0 -394
  266. package/dist/chunk-FKGMSOJF.js.map +0 -1
  267. package/dist/chunk-G6PXJ2SA.js +0 -823
  268. package/dist/chunk-G6PXJ2SA.js.map +0 -1
  269. package/dist/chunk-HNLRVRQR.js +0 -335
  270. package/dist/chunk-HNLRVRQR.js.map +0 -1
  271. package/dist/chunk-J3C72RPK.cjs +0 -31
  272. package/dist/chunk-J3C72RPK.cjs.map +0 -1
  273. package/dist/chunk-K63VPFOV.cjs +0 -134
  274. package/dist/chunk-K63VPFOV.cjs.map +0 -1
  275. package/dist/chunk-KFLIDTDU.cjs +0 -825
  276. package/dist/chunk-KFLIDTDU.cjs.map +0 -1
  277. package/dist/chunk-KHKH5LCT.cjs +0 -250
  278. package/dist/chunk-KHKH5LCT.cjs.map +0 -1
  279. package/dist/chunk-LBEKRN6Y.cjs +0 -664
  280. package/dist/chunk-LBEKRN6Y.cjs.map +0 -1
  281. package/dist/chunk-LPUWXIPR.cjs +0 -578
  282. package/dist/chunk-LPUWXIPR.cjs.map +0 -1
  283. package/dist/chunk-MCO52PV5.js +0 -520
  284. package/dist/chunk-MCO52PV5.js.map +0 -1
  285. package/dist/chunk-MKXEM2C5.cjs +0 -396
  286. package/dist/chunk-MKXEM2C5.cjs.map +0 -1
  287. package/dist/chunk-MXNC5UNO.js +0 -563
  288. package/dist/chunk-MXNC5UNO.js.map +0 -1
  289. package/dist/chunk-NAK55BYU.cjs +0 -859
  290. package/dist/chunk-NAK55BYU.cjs.map +0 -1
  291. package/dist/chunk-NDBMKGQ5.cjs +0 -599
  292. package/dist/chunk-NDBMKGQ5.cjs.map +0 -1
  293. package/dist/chunk-OD65OZIW.cjs +0 -159
  294. package/dist/chunk-OD65OZIW.cjs.map +0 -1
  295. package/dist/chunk-ORT3KLGI.js +0 -50
  296. package/dist/chunk-ORT3KLGI.js.map +0 -1
  297. package/dist/chunk-PNNUPUH4.cjs +0 -82
  298. package/dist/chunk-PNNUPUH4.cjs.map +0 -1
  299. package/dist/chunk-PWHECW6N.js +0 -2934
  300. package/dist/chunk-PWHECW6N.js.map +0 -1
  301. package/dist/chunk-RBS5A2DF.js +0 -857
  302. package/dist/chunk-RBS5A2DF.js.map +0 -1
  303. package/dist/chunk-RPWUDXG5.cjs +0 -63
  304. package/dist/chunk-RPWUDXG5.cjs.map +0 -1
  305. package/dist/chunk-TCDJY3H6.js +0 -494
  306. package/dist/chunk-TCDJY3H6.js.map +0 -1
  307. package/dist/chunk-TP5UMRAU.cjs +0 -918
  308. package/dist/chunk-TP5UMRAU.cjs.map +0 -1
  309. package/dist/chunk-TS7J6DTY.js +0 -597
  310. package/dist/chunk-TS7J6DTY.js.map +0 -1
  311. package/dist/chunk-TUVENMXB.cjs +0 -20
  312. package/dist/chunk-TUVENMXB.cjs.map +0 -1
  313. package/dist/chunk-UDCQTOVU.cjs +0 -523
  314. package/dist/chunk-UDCQTOVU.cjs.map +0 -1
  315. package/dist/chunk-UHKZXOXD.js +0 -128
  316. package/dist/chunk-UHKZXOXD.js.map +0 -1
  317. package/dist/chunk-V6BA44DS.cjs +0 -236
  318. package/dist/chunk-V6BA44DS.cjs.map +0 -1
  319. package/dist/chunk-XO5R73Y4.js +0 -653
  320. package/dist/chunk-XO5R73Y4.js.map +0 -1
  321. package/dist/chunk-XOR4MPEN.cjs +0 -31
  322. package/dist/chunk-XOR4MPEN.cjs.map +0 -1
  323. package/dist/chunk-YORQQXGO.js +0 -155
  324. package/dist/chunk-YORQQXGO.js.map +0 -1
  325. package/dist/chunk-YY4PFR3Z.cjs +0 -432
  326. package/dist/chunk-YY4PFR3Z.cjs.map +0 -1
  327. package/dist/chunk-ZPI6Q42R.js +0 -17
  328. package/dist/chunk-ZPI6Q42R.js.map +0 -1
  329. package/dist/components/ActivityPreview.cjs.map +0 -1
  330. package/dist/components/ActivityPreview.js.map +0 -1
  331. package/dist/components/ActivitySequence.cjs.map +0 -1
  332. package/dist/components/ActivitySequence.js.map +0 -1
  333. package/dist/components/Dictation.cjs.map +0 -1
  334. package/dist/components/Dictation.js.map +0 -1
  335. package/dist/components/FillInTheBlanks.cjs.map +0 -1
  336. package/dist/components/FillInTheBlanks.js.map +0 -1
  337. package/dist/components/GapSelect.cjs.map +0 -1
  338. package/dist/components/GapSelect.js.map +0 -1
  339. package/dist/components/InteractiveVideo.cjs.map +0 -1
  340. package/dist/components/InteractiveVideo.js.map +0 -1
  341. package/dist/components/MultipleChoice.cjs.map +0 -1
  342. package/dist/components/MultipleChoice.js.map +0 -1
  343. package/dist/components/PronunciationFeedback.cjs.map +0 -1
  344. package/dist/components/PronunciationFeedback.js.map +0 -1
  345. package/dist/components/ReadAloud.cjs.map +0 -1
  346. package/dist/components/ReadAloud.js.map +0 -1
  347. package/dist/components/StimulusPanel.cjs.map +0 -1
  348. package/dist/components/StimulusPanel.js.map +0 -1
  349. package/dist/components/WrittenResponse.cjs.map +0 -1
  350. package/dist/components/WrittenResponse.js.map +0 -1
  351. package/dist/hooks/useSpeechRecorder.cjs.map +0 -1
  352. package/dist/hooks/useSpeechRecorder.js.map +0 -1
  353. package/dist/i18n/LkIntlProvider.cjs.map +0 -1
  354. package/dist/i18n/LkIntlProvider.js.map +0 -1
  355. package/dist/machine-CuwKqWXC.d.cts +0 -26
  356. package/dist/machine-CuwKqWXC.d.ts +0 -26
  357. package/dist/theme/ThemeProvider.cjs.map +0 -1
  358. package/dist/theme/ThemeProvider.js.map +0 -1
  359. package/dist/types-C4IsUQsK.d.ts +0 -989
  360. package/dist/types-CJgZWtl4.d.cts +0 -989
@@ -1,653 +0,0 @@
1
- 'use client';
2
- import { localeDirectionOf } from './chunk-YORQQXGO.js';
3
- import { ActivityErrorBoundary } from './chunk-7SB2MJA4.js';
4
- import { useAiCoaching, isDevelopment } from './chunk-MXNC5UNO.js';
5
- import { useLkStrings } from './chunk-HNLRVRQR.js';
6
- import { useLearnerAi } from './chunk-ZPI6Q42R.js';
7
- import { ActivitySchemaError, alignReadAloud, validateSpeechAssessment } from '@intellectif/lk-core';
8
- import { useRef, useEffect, useState, useCallback, useId, useMemo } from 'react';
9
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
-
11
- function ReadingCoaching({
12
- strings: s,
13
- contentLang,
14
- contentDir,
15
- ...input
16
- }) {
17
- const help = useAiCoaching(input);
18
- const buttonRef = useRef(null);
19
- const panelRef = useRef(null);
20
- const refocus = useRef(false);
21
- useEffect(() => {
22
- if (help.status === "shown" && refocus.current) {
23
- refocus.current = false;
24
- panelRef.current?.focus();
25
- }
26
- if (help.status === "unavailable") {
27
- refocus.current = false;
28
- }
29
- }, [help.status]);
30
- if (!help.offered) {
31
- return null;
32
- }
33
- const ask = () => {
34
- refocus.current = typeof document !== "undefined" && document.activeElement === buttonRef.current;
35
- help.ask();
36
- };
37
- const loading = help.status === "loading";
38
- const coaching = help.coaching;
39
- return /* @__PURE__ */ jsxs("div", { className: "lk-ai lk-ai-coaching", "data-state": help.status, children: [
40
- coaching === null ? /* @__PURE__ */ jsx(
41
- "button",
42
- {
43
- ref: buttonRef,
44
- type: "button",
45
- className: "lk-ai-button",
46
- "aria-busy": loading || void 0,
47
- "aria-disabled": loading || void 0,
48
- onClick: ask,
49
- children: loading ? s.aiCoachingLoading : s.aiCoaching
50
- }
51
- ) : null,
52
- /* @__PURE__ */ jsx("div", { "aria-live": "polite", children: coaching !== null ? /* @__PURE__ */ jsxs(
53
- "section",
54
- {
55
- ref: panelRef,
56
- className: "lk-ai-panel",
57
- tabIndex: -1,
58
- "aria-label": s.aiCoachingHeading,
59
- children: [
60
- /* @__PURE__ */ jsx("p", { className: "lk-ai-heading", children: s.aiCoachingHeading }),
61
- /* @__PURE__ */ jsx("p", { className: "lk-ai-text", children: coaching.text }),
62
- coaching.words.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "lk-ai-coaching-words", "aria-label": s.aiCoachingWords, children: coaching.words.map((entry) => (
63
- // A word of the text is coached once, so its id is its key.
64
- /* @__PURE__ */ jsxs("li", { className: "lk-ai-coaching-word", children: [
65
- /* @__PURE__ */ jsx(
66
- "span",
67
- {
68
- className: "lk-ai-coaching-target",
69
- dir: contentDir ?? "auto",
70
- lang: contentLang,
71
- children: entry.word
72
- }
73
- ),
74
- entry.sound !== void 0 ? /* @__PURE__ */ jsx("span", { className: "lk-ai-coaching-sound", children: s.aiCoachingSound(entry.sound.expected, entry.sound.heard) }) : null,
75
- /* @__PURE__ */ jsx("span", { className: "lk-ai-text", children: entry.tip })
76
- ] }, entry.itemId)
77
- )) }) : null,
78
- /* @__PURE__ */ jsx("p", { className: "lk-ai-notice", children: s.aiNotice })
79
- ]
80
- }
81
- ) : help.status === "unavailable" ? /* @__PURE__ */ jsx("p", { className: "lk-ai-unavailable", children: s.aiCoachingUnavailable }) : null })
82
- ] });
83
- }
84
- function usePlaybackRefusal(url) {
85
- const [refusedUrl, setRefusedUrl] = useState(null);
86
- const refuse = useCallback((element) => {
87
- const source = element.getAttribute("src");
88
- if (source !== null) {
89
- setRefusedUrl(source);
90
- }
91
- }, []);
92
- return { refused: url !== null && url !== void 0 && url === refusedUrl, refuse };
93
- }
94
- function isSourceRefusal(error) {
95
- return typeof error === "object" && error !== null && error.name === "NotSupportedError";
96
- }
97
-
98
- // src/components/shared/read-grade.ts
99
- var DIMENSIONS = [
100
- "accuracy",
101
- "fluency",
102
- "completeness",
103
- "prosody"
104
- ];
105
- var OUTCOMES = [
106
- "correct",
107
- "incorrect",
108
- "correct-omission",
109
- "incorrect-omission"
110
- ];
111
- var OVERSHOOT = 1e-9;
112
- function isRecord(value) {
113
- return typeof value === "object" && value !== null && !Array.isArray(value);
114
- }
115
- function isFiniteNumber(value) {
116
- return typeof value === "number" && Number.isFinite(value);
117
- }
118
- function isAbsent(value) {
119
- return value === void 0 || value === null;
120
- }
121
- function withinMax(score, max) {
122
- if (!isFiniteNumber(score) || score < 0) {
123
- return null;
124
- }
125
- if (score <= max) {
126
- return score;
127
- }
128
- return score - max <= max * OVERSHOOT ? max : null;
129
- }
130
- function isResponse(value) {
131
- return typeof value === "string" || Array.isArray(value) && value.every((entry) => typeof entry === "string");
132
- }
133
- function guarded(read, refused) {
134
- try {
135
- return read();
136
- } catch {
137
- return refused;
138
- }
139
- }
140
- function readCriterion(value) {
141
- if (!isRecord(value) || typeof value.name !== "string") {
142
- return null;
143
- }
144
- const { maxScore, notApplicable } = value;
145
- if (!isAbsent(maxScore) && !(isFiniteNumber(maxScore) && maxScore > 0)) {
146
- return null;
147
- }
148
- if (!isAbsent(notApplicable) && typeof notApplicable !== "boolean") {
149
- return null;
150
- }
151
- const score = isAbsent(value.score) ? void 0 : withinMax(value.score, maxScore ?? 1);
152
- if (score === null) {
153
- return null;
154
- }
155
- return {
156
- name: value.name,
157
- ...score !== void 0 ? { score } : {},
158
- ...!isAbsent(maxScore) ? { maxScore } : {},
159
- ...notApplicable === true ? { notApplicable } : {}
160
- };
161
- }
162
- function readDetail(value) {
163
- if (!isRecord(value)) {
164
- return null;
165
- }
166
- const { itemId, correct, outcome, learnerResponse, correctResponse, weight, score } = value;
167
- if (typeof itemId !== "string" || !isResponse(learnerResponse) || !isResponse(correctResponse)) {
168
- return null;
169
- }
170
- const checkedOutcome = OUTCOMES.find((known) => known === outcome);
171
- if (!isAbsent(outcome) && checkedOutcome === void 0) {
172
- return null;
173
- }
174
- if (!isAbsent(correct) && typeof correct !== "boolean") {
175
- return null;
176
- }
177
- if (checkedOutcome === void 0 && typeof correct !== "boolean") {
178
- return null;
179
- }
180
- if (!isAbsent(weight) && !isFiniteNumber(weight)) {
181
- return null;
182
- }
183
- const checkedScore = isAbsent(score) ? void 0 : withinMax(score, 1);
184
- if (checkedScore === null) {
185
- return null;
186
- }
187
- return {
188
- itemId,
189
- learnerResponse,
190
- correctResponse,
191
- ...checkedOutcome !== void 0 ? { outcome: checkedOutcome } : { correct },
192
- ...!isAbsent(weight) ? { weight } : {},
193
- ...checkedScore !== void 0 ? { score: checkedScore } : {}
194
- };
195
- }
196
- function readDetails(value) {
197
- if (!Array.isArray(value)) {
198
- return void 0;
199
- }
200
- const details = [];
201
- for (const entry of value) {
202
- const detail = readDetail(entry);
203
- if (detail === null) {
204
- return void 0;
205
- }
206
- details.push(detail);
207
- }
208
- return details;
209
- }
210
- function readGrade(value) {
211
- return guarded(() => {
212
- if (!isRecord(value)) {
213
- return null;
214
- }
215
- const { maxScore, passed } = value;
216
- if (!isFiniteNumber(maxScore) || maxScore <= 0 || typeof passed !== "boolean") {
217
- return null;
218
- }
219
- const score = withinMax(value.score, maxScore);
220
- if (score === null) {
221
- return null;
222
- }
223
- const criteria = Array.isArray(value.criteria) ? value.criteria.flatMap((entry) => {
224
- const criterion = readCriterion(entry);
225
- return criterion === null ? [] : [criterion];
226
- }) : void 0;
227
- const details = readDetails(value.details);
228
- const grade = {
229
- score,
230
- maxScore,
231
- passed,
232
- feedback: typeof value.feedback === "string" ? value.feedback : null,
233
- ...criteria !== void 0 ? { criteria } : {},
234
- ...details !== void 0 ? { details } : {}
235
- };
236
- return grade;
237
- }, null);
238
- }
239
- function fractionOfGrade(grade) {
240
- return grade.score / grade.maxScore;
241
- }
242
- function percentOfGrade(grade) {
243
- return Math.round(fractionOfGrade(grade) * 100);
244
- }
245
- function readOutcome(value) {
246
- if (isAbsent(value)) {
247
- return void 0;
248
- }
249
- return guarded(
250
- () => {
251
- if (!isRecord(value)) {
252
- return { kind: "unreadable", status: void 0 };
253
- }
254
- switch (value.status) {
255
- case "deferred":
256
- return { kind: "deferred" };
257
- case "unscorable":
258
- return {
259
- kind: "unscorable",
260
- code: typeof value.code === "string" ? value.code : void 0
261
- };
262
- case "scored": {
263
- const grade = readGrade(value);
264
- return grade === null ? { kind: "unreadable", status: "scored" } : { kind: "graded", status: "scored", grade };
265
- }
266
- case "graded": {
267
- const grade = readGrade(value.grade);
268
- return grade === null || readGrade(value) === null ? { kind: "unreadable", status: "graded" } : { kind: "graded", status: "graded", grade };
269
- }
270
- default:
271
- return { kind: "unreadable", status: void 0 };
272
- }
273
- },
274
- { kind: "unreadable", status: void 0 }
275
- );
276
- }
277
- function readAssessResult(value) {
278
- const nothing = {
279
- status: "graded",
280
- grade: null,
281
- assessment: null,
282
- recognizedText: void 0
283
- };
284
- return guarded(() => {
285
- if (!isRecord(value)) {
286
- return nothing;
287
- }
288
- if (value.status === "failed") {
289
- return { status: "failed", retryable: value.retryable === true };
290
- }
291
- if (value.status === "unscorable") {
292
- return {
293
- status: "unscorable",
294
- code: typeof value.code === "string" ? value.code : void 0
295
- };
296
- }
297
- if (value.status !== "graded") {
298
- return nothing;
299
- }
300
- const assessment = readEvidence(value.assessment);
301
- const recognizedText = guarded(
302
- () => typeof assessment?.recognizedText === "string" ? assessment.recognizedText : void 0,
303
- void 0
304
- );
305
- return { status: "graded", grade: readGrade(value.grade), assessment, recognizedText };
306
- }, nothing);
307
- }
308
- function readEvidence(value) {
309
- return isRecord(value) ? value : null;
310
- }
311
- function percentOfCriterion(criterion) {
312
- if (criterion.notApplicable === true || criterion.score === void 0) {
313
- return void 0;
314
- }
315
- return Math.round(criterion.score / (criterion.maxScore ?? 1) * 100);
316
- }
317
- function readDimensions(assessment, grade) {
318
- const criteria = grade?.criteria ?? [];
319
- if (criteria.length > 0) {
320
- return DIMENSIONS.map((dimension) => {
321
- const criterion = criteria.find((entry) => entry.name === dimension);
322
- return {
323
- dimension,
324
- percent: criterion === void 0 ? void 0 : percentOfCriterion(criterion)
325
- };
326
- });
327
- }
328
- const scores = guarded(() => isRecord(assessment) ? assessment.scores : void 0, void 0);
329
- return DIMENSIONS.map((dimension) => {
330
- const score = withinMax(
331
- guarded(() => isRecord(scores) ? scores[dimension] : void 0, void 0),
332
- 100
333
- );
334
- return { dimension, percent: score === null ? void 0 : Math.round(score) };
335
- });
336
- }
337
- var VISUALLY_HIDDEN = {
338
- position: "absolute",
339
- width: 1,
340
- height: 1,
341
- margin: -1,
342
- padding: 0,
343
- overflow: "hidden",
344
- clip: "rect(0 0 0 0)",
345
- clipPath: "inset(50%)",
346
- whiteSpace: "nowrap",
347
- border: 0
348
- };
349
- var LEGEND_STATES = [
350
- "correct",
351
- "mispronounced",
352
- "omitted",
353
- "inserted"
354
- ];
355
- function checkEvidence(assessment) {
356
- try {
357
- return validateSpeechAssessment(assessment);
358
- } catch {
359
- return {
360
- success: false,
361
- errors: [{ path: [], message: "The assessment could not be read.", code: "unreadable" }]
362
- };
363
- }
364
- }
365
- function hasDetail(word) {
366
- if (word === void 0) {
367
- return false;
368
- }
369
- return word.accuracy !== void 0 || word.syllables !== void 0 && word.syllables.length > 0 || word.phonemes !== void 0 && word.phonemes.length > 0 || word.breaks !== void 0 || typeof word.startMs === "number" && typeof word.durationMs === "number";
370
- }
371
- function past(confidence, threshold) {
372
- return threshold !== void 0 && typeof confidence === "number" && Number.isFinite(confidence) && confidence > threshold;
373
- }
374
- function phonemeLabel(phoneme, index, s) {
375
- return phoneme.symbol ?? s.pronunciationPhonemePosition(index + 1);
376
- }
377
- function markSentence(entry, s) {
378
- switch (entry.state) {
379
- case "correct":
380
- return s.pronunciationWordCorrect(entry.reference);
381
- case "mispronounced":
382
- return s.pronunciationWordMispronounced(entry.reference);
383
- case "omitted":
384
- return s.pronunciationWordOmitted(entry.reference);
385
- default:
386
- return s.pronunciationWordInserted(entry.heard);
387
- }
388
- }
389
- function PronunciationFeedback({
390
- data,
391
- assessment,
392
- grade,
393
- audioUrl,
394
- breakThreshold,
395
- monotoneThreshold,
396
- locale,
397
- theme,
398
- strings,
399
- ai,
400
- renderMode,
401
- delivery,
402
- onInteraction
403
- }) {
404
- const s = useLkStrings(strings);
405
- const ids = useId();
406
- const [openWord, setOpenWord] = useState(null);
407
- const checked = useMemo(() => checkEvidence(assessment), [assessment]);
408
- const devError = useMemo(
409
- () => isDevelopment() && !checked.success ? new ActivitySchemaError("read-aloud", checked.errors) : null,
410
- [checked]
411
- );
412
- const words = useMemo(
413
- () => checked.success ? alignReadAloud(data, checked.data) : null,
414
- [checked, data]
415
- );
416
- const reading = useMemo(
417
- () => grade === void 0 || grade === null ? void 0 : readGrade(grade),
418
- [grade]
419
- );
420
- const dimensions = useMemo(() => readDimensions(assessment, reading), [assessment, reading]);
421
- const audioRef = useRef(null);
422
- const stopRef = useRef(null);
423
- const playback = usePlaybackRefusal(audioUrl);
424
- const playable = audioUrl !== void 0 && !playback.refused;
425
- useEffect(
426
- () => () => {
427
- if (stopRef.current !== null) {
428
- clearTimeout(stopRef.current);
429
- }
430
- },
431
- []
432
- );
433
- const coachable = typeof data.id === "string" && typeof data.title === "string";
434
- const coachingPort = useLearnerAi(ai)?.pronunciationCoaching !== void 0;
435
- useEffect(() => {
436
- if (isDevelopment() && coachingPort && !coachable) {
437
- console.warn(
438
- "learning-kit: <PronunciationFeedback> offers no AI coaching without `data.id` and `data.title`. Pass the whole read-aloud item as `data`, or `ai={{}}` to go without."
439
- );
440
- }
441
- }, [coachingPort, coachable]);
442
- if (devError) {
443
- throw devError;
444
- }
445
- const playWord = (startMs, durationMs) => {
446
- const element = audioRef.current;
447
- if (element === null) {
448
- return;
449
- }
450
- if (stopRef.current !== null) {
451
- clearTimeout(stopRef.current);
452
- }
453
- element.currentTime = startMs / 1e3;
454
- try {
455
- void element.play().catch((error) => {
456
- if (isSourceRefusal(error)) {
457
- playback.refuse(element);
458
- }
459
- });
460
- } catch {
461
- }
462
- stopRef.current = setTimeout(() => {
463
- stopRef.current = null;
464
- element.pause();
465
- }, durationMs);
466
- };
467
- const contentLang = typeof data.locale === "string" ? data.locale : void 0;
468
- const contentDir = localeDirectionOf(data.locale);
469
- const alphabet = checked.success ? checked.data.phonemeAlphabet : void 0;
470
- const monotone = checked.success ? checked.data.prosody?.monotoneConfidence : void 0;
471
- const evidenceWords = checked.success ? checked.data.words : [];
472
- return /* @__PURE__ */ jsxs(
473
- "section",
474
- {
475
- className: "lk-pf",
476
- "aria-label": s.pronunciationFeedbackLabel,
477
- lang: locale,
478
- style: theme,
479
- children: [
480
- reading !== void 0 ? (
481
- // `.lk-pf-grade` is load-bearing beyond the skin: `<ReadAloud>` looks
482
- // for it after the commit to decide whether it must render the score
483
- // itself, so a grade is never lost between the two components. It
484
- // hands this panel only a grade it has already read, so the block it
485
- // finds always carries the score.
486
- //
487
- // `data-passed` only where there is a verdict: a grade that could not
488
- // be read has none, and styling it as a fail would invent one.
489
- /* @__PURE__ */ jsxs(
490
- "div",
491
- {
492
- className: "lk-pf-grade",
493
- ...reading !== null ? { "data-passed": String(reading.passed) } : {},
494
- children: [
495
- /* @__PURE__ */ jsx("p", { className: "lk-pf-score", children: reading === null ? s.couldNotBeGraded : s.scoreAnnouncement(percentOfGrade(reading), reading.passed) }),
496
- reading?.feedback ? /* @__PURE__ */ jsx("p", { className: "lk-pf-grade-feedback", dir: "auto", children: reading.feedback }) : null
497
- ]
498
- }
499
- )
500
- ) : null,
501
- /* @__PURE__ */ jsx("dl", { className: "lk-pf-dimensions", children: dimensions.map(({ dimension, percent }) => /* @__PURE__ */ jsxs("div", { className: "lk-pf-dimension", "data-dimension": dimension, children: [
502
- /* @__PURE__ */ jsx("dt", { className: "lk-pf-dimension-name", children: s.pronunciationDimension(dimension) }),
503
- /* @__PURE__ */ jsx("dd", { className: "lk-pf-dimension-score", children: percent === void 0 ? s.pronunciationNotAssessed : `${percent}%` })
504
- ] }, dimension)) }),
505
- words !== null ? /* @__PURE__ */ jsxs(Fragment, { children: [
506
- /* @__PURE__ */ jsx("ol", { className: "lk-pf-words", "aria-label": s.pronunciationWordsLabel, dir: contentDir, children: words.map((entry, index) => {
507
- const sentence = markSentence(entry, s);
508
- const shown = entry.state === "inserted" ? entry.heard : entry.reference;
509
- const word = entry.wordIndex === void 0 ? void 0 : evidenceWords.at(entry.wordIndex);
510
- const open = openWord === index;
511
- const panelId = `${ids}-w${index}`;
512
- return /* @__PURE__ */ jsxs(
513
- "li",
514
- {
515
- className: "lk-pf-word",
516
- "data-state": entry.state,
517
- children: [
518
- /* @__PURE__ */ jsx("span", { className: "lk-visually-hidden", style: VISUALLY_HIDDEN, children: sentence }),
519
- /* @__PURE__ */ jsx(
520
- "span",
521
- {
522
- className: "lk-pf-word-text",
523
- "aria-hidden": "true",
524
- dir: contentDir ?? "auto",
525
- lang: contentLang,
526
- children: shown
527
- }
528
- ),
529
- hasDetail(word) ? /* @__PURE__ */ jsxs(Fragment, { children: [
530
- /* @__PURE__ */ jsx(
531
- "button",
532
- {
533
- type: "button",
534
- className: "lk-pf-word-toggle",
535
- "aria-expanded": open,
536
- "aria-controls": panelId,
537
- onClick: () => setOpenWord(open ? null : index),
538
- children: s.pronunciationWordDetails(shown)
539
- }
540
- ),
541
- open ? /* @__PURE__ */ jsxs("div", { id: panelId, className: "lk-pf-word-detail", children: [
542
- /* @__PURE__ */ jsxs("dl", { className: "lk-pf-word-facts", children: [
543
- /* @__PURE__ */ jsx("dt", { children: s.pronunciationDimension("accuracy") }),
544
- /* @__PURE__ */ jsx("dd", { children: word.accuracy === void 0 ? s.pronunciationNotAssessed : `${Math.round(word.accuracy)}%` }),
545
- word.syllables !== void 0 && word.syllables.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
546
- /* @__PURE__ */ jsx("dt", { children: s.pronunciationSyllables }),
547
- /* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx("ul", { className: "lk-pf-syllables", children: word.syllables.map((syllable, position) => /* @__PURE__ */ jsx(
548
- "li",
549
- {
550
- dir: contentDir ?? "auto",
551
- lang: contentLang,
552
- children: syllable.grapheme === void 0 ? syllable.text : s.pronunciationSyllableSpelling(
553
- syllable.text,
554
- syllable.grapheme
555
- )
556
- },
557
- position
558
- )) }) })
559
- ] }) : null,
560
- word.phonemes !== void 0 && word.phonemes.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
561
- /* @__PURE__ */ jsx("dt", { children: s.pronunciationPhonemes }),
562
- /* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx("ul", { className: "lk-pf-phonemes", children: word.phonemes.map((phoneme, position) => /* @__PURE__ */ jsxs(
563
- "li",
564
- {
565
- className: "lk-pf-phoneme",
566
- children: [
567
- /* @__PURE__ */ jsx("span", { className: "lk-pf-phoneme-symbol", children: phonemeLabel(phoneme, position, s) }),
568
- phoneme.heardAs !== void 0 && phoneme.heardAs.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
569
- /* @__PURE__ */ jsx("span", { className: "lk-pf-heard-label", children: s.pronunciationHeardAs }),
570
- /* @__PURE__ */ jsx("ul", { className: "lk-pf-heard-as", children: phoneme.heardAs.map((candidate, rank) => /* @__PURE__ */ jsx(
571
- "li",
572
- {
573
- children: candidate.symbol
574
- },
575
- rank
576
- )) })
577
- ] }) : null
578
- ]
579
- },
580
- position
581
- )) }) })
582
- ] }) : null
583
- ] }),
584
- playable && typeof word.startMs === "number" && typeof word.durationMs === "number" ? /* @__PURE__ */ jsx(
585
- "button",
586
- {
587
- type: "button",
588
- className: "lk-pf-word-play",
589
- onClick: () => playWord(word.startMs, word.durationMs),
590
- children: s.pronunciationPlayWord(shown)
591
- }
592
- ) : null,
593
- past(word.breaks?.unexpected, breakThreshold) ? /* @__PURE__ */ jsx("p", { className: "lk-pf-break", "data-break": "unexpected", children: s.pronunciationBreakUnexpected }) : null,
594
- past(word.breaks?.missing, breakThreshold) ? /* @__PURE__ */ jsx("p", { className: "lk-pf-break", "data-break": "missing", children: s.pronunciationBreakMissing }) : null
595
- ] }) : null
596
- ] }) : null
597
- ]
598
- },
599
- index
600
- );
601
- }) }),
602
- /* @__PURE__ */ jsx("ul", { className: "lk-pf-legend", children: LEGEND_STATES.map((state) => /* @__PURE__ */ jsx("li", { "data-state": state, children: s.pronunciationLegend(state) }, state)) }),
603
- alphabet === "ipa" ? /* @__PURE__ */ jsx("p", { className: "lk-pf-alphabet", children: s.pronunciationIpaNote }) : null,
604
- coachable && checked.success ? /* @__PURE__ */ jsx(
605
- ReadingCoaching,
606
- {
607
- data: {
608
- id: data.id,
609
- title: data.title,
610
- referenceText: data.referenceText,
611
- locale: data.locale,
612
- ...data.instructions !== void 0 ? { instructions: data.instructions } : {},
613
- ...data.ai !== void 0 ? { ai: data.ai } : {}
614
- },
615
- assessment: checked.data,
616
- ...grade !== void 0 ? { grade } : {},
617
- ...renderMode !== void 0 ? { renderMode } : {},
618
- ...ai !== void 0 ? { ai } : {},
619
- ...locale !== void 0 ? { locale } : {},
620
- ...onInteraction !== void 0 ? { onInteraction } : {},
621
- ...delivery !== void 0 ? { delivery } : {},
622
- strings: s,
623
- contentLang,
624
- contentDir
625
- }
626
- ) : null
627
- ] }) : null,
628
- past(monotone, monotoneThreshold) ? /* @__PURE__ */ jsx("p", { className: "lk-pf-monotone", role: "note", children: s.pronunciationMonotone }) : null,
629
- audioUrl === void 0 ? null : playback.refused ? /* @__PURE__ */ jsx("p", { className: "lk-pf-audio-unavailable", role: "note", children: s.readAloudPlaybackUnavailable }) : (
630
- // biome-ignore lint/a11y/useMediaCaption: the learner's own take has no caption track to offer, and this element is never played as content — it carries no controls and exists only so one word can be replayed from a button that names it
631
- /* @__PURE__ */ jsx(
632
- "audio",
633
- {
634
- ref: audioRef,
635
- className: "lk-pf-audio",
636
- src: audioUrl,
637
- preload: "metadata",
638
- onError: (event) => playback.refuse(event.currentTarget)
639
- }
640
- )
641
- )
642
- ]
643
- }
644
- );
645
- }
646
- function PronunciationFeedback2(props) {
647
- const strings = useLkStrings(props.strings);
648
- return /* @__PURE__ */ jsx(ActivityErrorBoundary, { strings, children: /* @__PURE__ */ jsx(PronunciationFeedback, { ...props }) });
649
- }
650
-
651
- export { PronunciationFeedback2 as PronunciationFeedback, ReadingCoaching, VISUALLY_HIDDEN, fractionOfGrade, markSentence, percentOfGrade, readAssessResult, readEvidence, readOutcome, usePlaybackRefusal };
652
- //# sourceMappingURL=chunk-XO5R73Y4.js.map
653
- //# sourceMappingURL=chunk-XO5R73Y4.js.map