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