@intellectif/lk-react 23.0.1 → 23.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +13 -9
  3. package/dist/ActivityErrorBoundary-B379hvtL.cjs +39 -0
  4. package/dist/ActivityErrorBoundary-B379hvtL.cjs.map +1 -0
  5. package/dist/ActivityErrorBoundary-Dw6SbWv3.js +34 -0
  6. package/dist/ActivityErrorBoundary-Dw6SbWv3.js.map +1 -0
  7. package/dist/ActivityMedia-CQQTRNl7.cjs +641 -0
  8. package/dist/ActivityMedia-CQQTRNl7.cjs.map +1 -0
  9. package/dist/ActivityMedia-vDiP-Psa.js +636 -0
  10. package/dist/ActivityMedia-vDiP-Psa.js.map +1 -0
  11. package/dist/ActivityPreview-1hhTkYuj.js +240 -0
  12. package/dist/ActivityPreview-1hhTkYuj.js.map +1 -0
  13. package/dist/ActivityPreview-BKr34exz.cjs +245 -0
  14. package/dist/ActivityPreview-BKr34exz.cjs.map +1 -0
  15. package/dist/ActivitySequence-CkX87pfB.js +839 -0
  16. package/dist/ActivitySequence-CkX87pfB.js.map +1 -0
  17. package/dist/ActivitySequence-CmoSyDnp.cjs +844 -0
  18. package/dist/ActivitySequence-CmoSyDnp.cjs.map +1 -0
  19. package/dist/Dictation-BlxRp-3k.js +926 -0
  20. package/dist/Dictation-BlxRp-3k.js.map +1 -0
  21. package/dist/Dictation-jECzL88E.cjs +931 -0
  22. package/dist/Dictation-jECzL88E.cjs.map +1 -0
  23. package/dist/FeedbackRegion-BNNMtTY-.cjs +108 -0
  24. package/dist/FeedbackRegion-BNNMtTY-.cjs.map +1 -0
  25. package/dist/FeedbackRegion-CyPSp8bA.js +85 -0
  26. package/dist/FeedbackRegion-CyPSp8bA.js.map +1 -0
  27. package/dist/FillInTheBlanks-B6xzqYXx.js +474 -0
  28. package/dist/FillInTheBlanks-B6xzqYXx.js.map +1 -0
  29. package/dist/FillInTheBlanks-BpKhdHg2.cjs +479 -0
  30. package/dist/FillInTheBlanks-BpKhdHg2.cjs.map +1 -0
  31. package/dist/GapSelect-DUSiaEQH.js +441 -0
  32. package/dist/GapSelect-DUSiaEQH.js.map +1 -0
  33. package/dist/GapSelect-payTq_Zn.cjs +446 -0
  34. package/dist/GapSelect-payTq_Zn.cjs.map +1 -0
  35. package/dist/InteractiveVideo-BguGv-HA.cjs +2955 -0
  36. package/dist/InteractiveVideo-BguGv-HA.cjs.map +1 -0
  37. package/dist/InteractiveVideo-Cg2jbU3j.js +2944 -0
  38. package/dist/InteractiveVideo-Cg2jbU3j.js.map +1 -0
  39. package/dist/LkAiProvider-DAPpA3PQ.d.cts +84 -0
  40. package/dist/LkAiProvider-DAPpA3PQ.d.cts.map +1 -0
  41. package/dist/LkAiProvider-QdEcIhoo.d.ts +84 -0
  42. package/dist/LkAiProvider-QdEcIhoo.d.ts.map +1 -0
  43. package/dist/LkIntlProvider-D_FdYXjQ.js +375 -0
  44. package/dist/LkIntlProvider-D_FdYXjQ.js.map +1 -0
  45. package/dist/LkIntlProvider-oi57lYB0.cjs +410 -0
  46. package/dist/LkIntlProvider-oi57lYB0.cjs.map +1 -0
  47. package/dist/MultipleChoice-COn5MtKY.cjs +433 -0
  48. package/dist/MultipleChoice-COn5MtKY.cjs.map +1 -0
  49. package/dist/MultipleChoice-Dra0_KYD.js +428 -0
  50. package/dist/MultipleChoice-Dra0_KYD.js.map +1 -0
  51. package/dist/PronunciationFeedback-DlMPGjkR.cjs +831 -0
  52. package/dist/PronunciationFeedback-DlMPGjkR.cjs.map +1 -0
  53. package/dist/PronunciationFeedback-Dxd6XPkO.js +772 -0
  54. package/dist/PronunciationFeedback-Dxd6XPkO.js.map +1 -0
  55. package/dist/ReadAloud-C8RhaUqV.js +1092 -0
  56. package/dist/ReadAloud-C8RhaUqV.js.map +1 -0
  57. package/dist/ReadAloud-akDehitT.cjs +1103 -0
  58. package/dist/ReadAloud-akDehitT.cjs.map +1 -0
  59. package/dist/StimulusPanel-BgzByfkb.js +74 -0
  60. package/dist/StimulusPanel-BgzByfkb.js.map +1 -0
  61. package/dist/StimulusPanel-b66gaN3i.cjs +79 -0
  62. package/dist/StimulusPanel-b66gaN3i.cjs.map +1 -0
  63. package/dist/ThemeProvider-BRN1tj4n.cjs +187 -0
  64. package/dist/ThemeProvider-BRN1tj4n.cjs.map +1 -0
  65. package/dist/ThemeProvider-C7K9iMLX.js +158 -0
  66. package/dist/ThemeProvider-C7K9iMLX.js.map +1 -0
  67. package/dist/ThemeProvider-CocC8ODJ.d.ts +62 -0
  68. package/dist/ThemeProvider-CocC8ODJ.d.ts.map +1 -0
  69. package/dist/ThemeProvider-DS4KOL86.d.cts +62 -0
  70. package/dist/ThemeProvider-DS4KOL86.d.cts.map +1 -0
  71. package/dist/WrittenResponse-Bj3eFmGl.cjs +491 -0
  72. package/dist/WrittenResponse-Bj3eFmGl.cjs.map +1 -0
  73. package/dist/WrittenResponse-Cl8G6nO_.js +486 -0
  74. package/dist/WrittenResponse-Cl8G6nO_.js.map +1 -0
  75. package/dist/ai/LkAiProvider.cjs +34 -14
  76. package/dist/ai/LkAiProvider.cjs.map +1 -1
  77. package/dist/ai/LkAiProvider.d.cts +2 -73
  78. package/dist/ai/LkAiProvider.d.ts +2 -73
  79. package/dist/ai/LkAiProvider.js +33 -2
  80. package/dist/ai/LkAiProvider.js.map +1 -1
  81. package/dist/ai/useAiHelp.cjs +7 -23
  82. package/dist/ai/useAiHelp.d.cts +198 -121
  83. package/dist/ai/useAiHelp.d.cts.map +1 -0
  84. package/dist/ai/useAiHelp.d.ts +198 -121
  85. package/dist/ai/useAiHelp.d.ts.map +1 -0
  86. package/dist/ai/useAiHelp.js +3 -6
  87. package/dist/components/ActivityPreview.cjs +3 -31
  88. package/dist/components/ActivityPreview.d.cts +2 -81
  89. package/dist/components/ActivityPreview.d.ts +2 -81
  90. package/dist/components/ActivityPreview.js +2 -22
  91. package/dist/components/ActivitySequence.cjs +3 -32
  92. package/dist/components/ActivitySequence.d.cts +2 -432
  93. package/dist/components/ActivitySequence.d.ts +2 -432
  94. package/dist/components/ActivitySequence.js +2 -23
  95. package/dist/components/Dictation.cjs +4 -23
  96. package/dist/components/Dictation.d.cts +2 -19
  97. package/dist/components/Dictation.d.ts +2 -19
  98. package/dist/components/Dictation.js +3 -14
  99. package/dist/components/FillInTheBlanks.cjs +4 -22
  100. package/dist/components/FillInTheBlanks.d.cts +2 -30
  101. package/dist/components/FillInTheBlanks.d.ts +2 -30
  102. package/dist/components/FillInTheBlanks.js +3 -13
  103. package/dist/components/GapSelect.cjs +4 -22
  104. package/dist/components/GapSelect.d.cts +2 -27
  105. package/dist/components/GapSelect.d.ts +2 -27
  106. package/dist/components/GapSelect.js +3 -13
  107. package/dist/components/InteractiveVideo.cjs +5 -34
  108. package/dist/components/InteractiveVideo.d.cts +3 -291
  109. package/dist/components/InteractiveVideo.d.ts +3 -291
  110. package/dist/components/InteractiveVideo.js +3 -21
  111. package/dist/components/MultipleChoice.cjs +4 -22
  112. package/dist/components/MultipleChoice.d.cts +2 -26
  113. package/dist/components/MultipleChoice.d.ts +2 -26
  114. package/dist/components/MultipleChoice.js +3 -13
  115. package/dist/components/PronunciationFeedback.cjs +4 -16
  116. package/dist/components/PronunciationFeedback.d.cts +2 -69
  117. package/dist/components/PronunciationFeedback.d.ts +2 -69
  118. package/dist/components/PronunciationFeedback.js +3 -7
  119. package/dist/components/ReadAloud.cjs +4 -22
  120. package/dist/components/ReadAloud.d.cts +7 -11
  121. package/dist/components/ReadAloud.d.cts.map +1 -0
  122. package/dist/components/ReadAloud.d.ts +7 -11
  123. package/dist/components/ReadAloud.d.ts.map +1 -0
  124. package/dist/components/ReadAloud.js +3 -13
  125. package/dist/components/StimulusPanel.cjs +3 -14
  126. package/dist/components/StimulusPanel.d.cts +2 -51
  127. package/dist/components/StimulusPanel.d.ts +2 -51
  128. package/dist/components/StimulusPanel.js +2 -5
  129. package/dist/components/WrittenResponse.cjs +4 -21
  130. package/dist/components/WrittenResponse.d.cts +3 -18
  131. package/dist/components/WrittenResponse.d.ts +3 -18
  132. package/dist/components/WrittenResponse.js +3 -12
  133. package/dist/direction-Dq0_HtA5.js +183 -0
  134. package/dist/direction-Dq0_HtA5.js.map +1 -0
  135. package/dist/direction-K1pj0HCA.cjs +200 -0
  136. package/dist/direction-K1pj0HCA.cjs.map +1 -0
  137. package/dist/hooks/useActivityState.cjs +28 -10
  138. package/dist/hooks/useActivityState.cjs.map +1 -1
  139. package/dist/hooks/useActivityState.d.cts +25 -24
  140. package/dist/hooks/useActivityState.d.cts.map +1 -0
  141. package/dist/hooks/useActivityState.d.ts +25 -24
  142. package/dist/hooks/useActivityState.d.ts.map +1 -0
  143. package/dist/hooks/useActivityState.js +28 -2
  144. package/dist/hooks/useActivityState.js.map +1 -1
  145. package/dist/hooks/useSpeechRecorder.cjs +5 -16
  146. package/dist/hooks/useSpeechRecorder.d.cts +2 -127
  147. package/dist/hooks/useSpeechRecorder.d.ts +2 -127
  148. package/dist/hooks/useSpeechRecorder.js +3 -3
  149. package/dist/hooks/useXAPI.cjs +126 -10
  150. package/dist/hooks/useXAPI.cjs.map +1 -1
  151. package/dist/hooks/useXAPI.d.cts +14 -14
  152. package/dist/hooks/useXAPI.d.cts.map +1 -0
  153. package/dist/hooks/useXAPI.d.ts +14 -14
  154. package/dist/hooks/useXAPI.d.ts.map +1 -0
  155. package/dist/hooks/useXAPI.js +126 -2
  156. package/dist/hooks/useXAPI.js.map +1 -1
  157. package/dist/i18n/LkIntlProvider.cjs +9 -32
  158. package/dist/i18n/LkIntlProvider.d.cts +34 -38
  159. package/dist/i18n/LkIntlProvider.d.cts.map +1 -0
  160. package/dist/i18n/LkIntlProvider.d.ts +34 -38
  161. package/dist/i18n/LkIntlProvider.d.ts.map +1 -0
  162. package/dist/i18n/LkIntlProvider.js +3 -3
  163. package/dist/index-2iDJohip.d.cts +90 -0
  164. package/dist/index-2iDJohip.d.cts.map +1 -0
  165. package/dist/index-BAqT5tXN.d.ts +90 -0
  166. package/dist/index-BAqT5tXN.d.ts.map +1 -0
  167. package/dist/index-BRbEfXgE.d.ts +78 -0
  168. package/dist/index-BRbEfXgE.d.ts.map +1 -0
  169. package/dist/index-BW7aA5eN.d.cts +25 -0
  170. package/dist/index-BW7aA5eN.d.cts.map +1 -0
  171. package/dist/index-BeiVd-qe.d.ts +124 -0
  172. package/dist/index-BeiVd-qe.d.ts.map +1 -0
  173. package/dist/index-C1KGpD1k.d.ts +49 -0
  174. package/dist/index-C1KGpD1k.d.ts.map +1 -0
  175. package/dist/index-C7cCHEze.d.cts +24 -0
  176. package/dist/index-C7cCHEze.d.cts.map +1 -0
  177. package/dist/index-CKTpYTCC.d.cts +49 -0
  178. package/dist/index-CKTpYTCC.d.cts.map +1 -0
  179. package/dist/index-CN3_TwDL.d.ts +28 -0
  180. package/dist/index-CN3_TwDL.d.ts.map +1 -0
  181. package/dist/index-CNoAqj5I.d.ts +16 -0
  182. package/dist/index-CNoAqj5I.d.ts.map +1 -0
  183. package/dist/index-CTlht6OV.d.cts +432 -0
  184. package/dist/index-CTlht6OV.d.cts.map +1 -0
  185. package/dist/index-CmgSzapt.d.cts +124 -0
  186. package/dist/index-CmgSzapt.d.cts.map +1 -0
  187. package/dist/index-D4WYDN_p.d.cts +28 -0
  188. package/dist/index-D4WYDN_p.d.cts.map +1 -0
  189. package/dist/index-DAJ6KK49.d.ts +25 -0
  190. package/dist/index-DAJ6KK49.d.ts.map +1 -0
  191. package/dist/index-DIiacP_z.d.cts +78 -0
  192. package/dist/index-DIiacP_z.d.cts.map +1 -0
  193. package/dist/index-DR0SOJig.d.ts +291 -0
  194. package/dist/index-DR0SOJig.d.ts.map +1 -0
  195. package/dist/index-DRMauOVH.d.ts +432 -0
  196. package/dist/index-DRMauOVH.d.ts.map +1 -0
  197. package/dist/index-bmmRfGad.d.cts +16 -0
  198. package/dist/index-bmmRfGad.d.cts.map +1 -0
  199. package/dist/index-n9PKZm7W.d.cts +291 -0
  200. package/dist/index-n9PKZm7W.d.cts.map +1 -0
  201. package/dist/index-zu9H7owf.d.ts +24 -0
  202. package/dist/index-zu9H7owf.d.ts.map +1 -0
  203. package/dist/index.cjs +118 -161
  204. package/dist/index.cjs.map +1 -1
  205. package/dist/index.d.cts +20 -24
  206. package/dist/index.d.ts +20 -24
  207. package/dist/index.js +84 -31
  208. package/dist/index.js.map +1 -1
  209. package/dist/theme/ThemeProvider.cjs +8 -28
  210. package/dist/theme/ThemeProvider.d.cts +2 -59
  211. package/dist/theme/ThemeProvider.d.ts +2 -59
  212. package/dist/theme/ThemeProvider.js +3 -3
  213. package/dist/theme/skin.css +46 -1
  214. package/dist/tries-CbbtZkdG.cjs +363 -0
  215. package/dist/{chunk-W6UMY7PF.cjs.map → tries-CbbtZkdG.cjs.map} +1 -1
  216. package/dist/tries-DTHSrLCm.js +310 -0
  217. package/dist/tries-DTHSrLCm.js.map +1 -0
  218. package/dist/types-BOQd93x3.d.cts +994 -0
  219. package/dist/types-BOQd93x3.d.cts.map +1 -0
  220. package/dist/types-HIrgF_mS.d.ts +994 -0
  221. package/dist/types-HIrgF_mS.d.ts.map +1 -0
  222. package/dist/useAiHelp-B-ccDL5Q.js +906 -0
  223. package/dist/useAiHelp-B-ccDL5Q.js.map +1 -0
  224. package/dist/useAiHelp-h9yOLFqt.cjs +995 -0
  225. package/dist/useAiHelp-h9yOLFqt.cjs.map +1 -0
  226. package/dist/useSpeechRecorder--O_f-xvt.cjs +720 -0
  227. package/dist/useSpeechRecorder--O_f-xvt.cjs.map +1 -0
  228. package/dist/useSpeechRecorder-DtAYvl02.d.cts +154 -0
  229. package/dist/useSpeechRecorder-DtAYvl02.d.cts.map +1 -0
  230. package/dist/useSpeechRecorder-DtAYvl02.d.ts +154 -0
  231. package/dist/useSpeechRecorder-DtAYvl02.d.ts.map +1 -0
  232. package/dist/useSpeechRecorder-zIi9Dlw8.js +709 -0
  233. package/dist/useSpeechRecorder-zIi9Dlw8.js.map +1 -0
  234. package/package.json +10 -11
  235. package/dist/WrittenResponse-CgRrjM4S.d.ts +0 -115
  236. package/dist/WrittenResponse-D2K1VW_V.d.cts +0 -115
  237. package/dist/ai/useAiHelp.cjs.map +0 -1
  238. package/dist/ai/useAiHelp.js.map +0 -1
  239. package/dist/chunk-2OP5YHRR.js +0 -543
  240. package/dist/chunk-2OP5YHRR.js.map +0 -1
  241. package/dist/chunk-2TW6WLBC.js +0 -80
  242. package/dist/chunk-2TW6WLBC.js.map +0 -1
  243. package/dist/chunk-4MXECBZT.js +0 -888
  244. package/dist/chunk-4MXECBZT.js.map +0 -1
  245. package/dist/chunk-54DX6SLS.cjs +0 -42
  246. package/dist/chunk-54DX6SLS.cjs.map +0 -1
  247. package/dist/chunk-6GQLCCGN.js +0 -858
  248. package/dist/chunk-6GQLCCGN.js.map +0 -1
  249. package/dist/chunk-6N43WDVG.js +0 -29
  250. package/dist/chunk-6N43WDVG.js.map +0 -1
  251. package/dist/chunk-6RIM5EQP.cjs +0 -393
  252. package/dist/chunk-6RIM5EQP.cjs.map +0 -1
  253. package/dist/chunk-7F2YQWMW.cjs +0 -553
  254. package/dist/chunk-7F2YQWMW.cjs.map +0 -1
  255. package/dist/chunk-B4JRBV56.cjs +0 -63
  256. package/dist/chunk-B4JRBV56.cjs.map +0 -1
  257. package/dist/chunk-B7JU52YQ.cjs +0 -437
  258. package/dist/chunk-B7JU52YQ.cjs.map +0 -1
  259. package/dist/chunk-C4PSJ3ZC.js +0 -329
  260. package/dist/chunk-C4PSJ3ZC.js.map +0 -1
  261. package/dist/chunk-CXIP7ERK.js +0 -389
  262. package/dist/chunk-CXIP7ERK.js.map +0 -1
  263. package/dist/chunk-DPNCCWOV.js +0 -395
  264. package/dist/chunk-DPNCCWOV.js.map +0 -1
  265. package/dist/chunk-DXFCYNST.js +0 -35
  266. package/dist/chunk-DXFCYNST.js.map +0 -1
  267. package/dist/chunk-DZ7VLLDQ.cjs +0 -891
  268. package/dist/chunk-DZ7VLLDQ.cjs.map +0 -1
  269. package/dist/chunk-E4UF4XZM.js +0 -29
  270. package/dist/chunk-E4UF4XZM.js.map +0 -1
  271. package/dist/chunk-ERV666AR.js +0 -435
  272. package/dist/chunk-ERV666AR.js.map +0 -1
  273. package/dist/chunk-FISEZBLF.cjs +0 -31
  274. package/dist/chunk-FISEZBLF.cjs.map +0 -1
  275. package/dist/chunk-HYOUMTPW.js +0 -597
  276. package/dist/chunk-HYOUMTPW.js.map +0 -1
  277. package/dist/chunk-HZIT24BK.js +0 -61
  278. package/dist/chunk-HZIT24BK.js.map +0 -1
  279. package/dist/chunk-IYGF7PZY.cjs +0 -2938
  280. package/dist/chunk-IYGF7PZY.cjs.map +0 -1
  281. package/dist/chunk-J2QIHZ3H.cjs +0 -27
  282. package/dist/chunk-J2QIHZ3H.cjs.map +0 -1
  283. package/dist/chunk-JMEZYYCE.js +0 -2935
  284. package/dist/chunk-JMEZYYCE.js.map +0 -1
  285. package/dist/chunk-K63VPFOV.cjs +0 -134
  286. package/dist/chunk-K63VPFOV.cjs.map +0 -1
  287. package/dist/chunk-KI6DJ5ZF.js +0 -495
  288. package/dist/chunk-KI6DJ5ZF.js.map +0 -1
  289. package/dist/chunk-MCO52PV5.js +0 -520
  290. package/dist/chunk-MCO52PV5.js.map +0 -1
  291. package/dist/chunk-MXZHL4U5.cjs +0 -860
  292. package/dist/chunk-MXZHL4U5.cjs.map +0 -1
  293. package/dist/chunk-NFGUJ52G.cjs +0 -336
  294. package/dist/chunk-NFGUJ52G.cjs.map +0 -1
  295. package/dist/chunk-O7MINPKZ.js +0 -431
  296. package/dist/chunk-O7MINPKZ.js.map +0 -1
  297. package/dist/chunk-OD65OZIW.cjs +0 -159
  298. package/dist/chunk-OD65OZIW.cjs.map +0 -1
  299. package/dist/chunk-OJGTJOWI.cjs +0 -20
  300. package/dist/chunk-OJGTJOWI.cjs.map +0 -1
  301. package/dist/chunk-PGAPZ6UE.cjs +0 -497
  302. package/dist/chunk-PGAPZ6UE.cjs.map +0 -1
  303. package/dist/chunk-PNNUPUH4.cjs +0 -82
  304. package/dist/chunk-PNNUPUH4.cjs.map +0 -1
  305. package/dist/chunk-QAZO3ANW.cjs +0 -433
  306. package/dist/chunk-QAZO3ANW.cjs.map +0 -1
  307. package/dist/chunk-RX3A6KIY.js +0 -17
  308. package/dist/chunk-RX3A6KIY.js.map +0 -1
  309. package/dist/chunk-SHDSOOBF.cjs +0 -826
  310. package/dist/chunk-SHDSOOBF.cjs.map +0 -1
  311. package/dist/chunk-SPSKDNEE.js +0 -824
  312. package/dist/chunk-SPSKDNEE.js.map +0 -1
  313. package/dist/chunk-TGTP5DKF.js +0 -234
  314. package/dist/chunk-TGTP5DKF.js.map +0 -1
  315. package/dist/chunk-U4KTOH7C.js +0 -22
  316. package/dist/chunk-U4KTOH7C.js.map +0 -1
  317. package/dist/chunk-U5VFJVQ2.js +0 -241
  318. package/dist/chunk-U5VFJVQ2.js.map +0 -1
  319. package/dist/chunk-UDCQTOVU.cjs +0 -523
  320. package/dist/chunk-UDCQTOVU.cjs.map +0 -1
  321. package/dist/chunk-UHKZXOXD.js +0 -128
  322. package/dist/chunk-UHKZXOXD.js.map +0 -1
  323. package/dist/chunk-UKUHVCZX.cjs +0 -599
  324. package/dist/chunk-UKUHVCZX.cjs.map +0 -1
  325. package/dist/chunk-VPU6UY4O.cjs +0 -55
  326. package/dist/chunk-VPU6UY4O.cjs.map +0 -1
  327. package/dist/chunk-W6UMY7PF.cjs +0 -251
  328. package/dist/chunk-WZ2TBXVB.cjs +0 -236
  329. package/dist/chunk-WZ2TBXVB.cjs.map +0 -1
  330. package/dist/chunk-XOR4MPEN.cjs +0 -31
  331. package/dist/chunk-XOR4MPEN.cjs.map +0 -1
  332. package/dist/chunk-XS6OYYVR.cjs +0 -397
  333. package/dist/chunk-XS6OYYVR.cjs.map +0 -1
  334. package/dist/chunk-XYJBRKBZ.js +0 -51
  335. package/dist/chunk-XYJBRKBZ.js.map +0 -1
  336. package/dist/chunk-YORQQXGO.js +0 -155
  337. package/dist/chunk-YORQQXGO.js.map +0 -1
  338. package/dist/components/ActivityPreview.cjs.map +0 -1
  339. package/dist/components/ActivityPreview.js.map +0 -1
  340. package/dist/components/ActivitySequence.cjs.map +0 -1
  341. package/dist/components/ActivitySequence.js.map +0 -1
  342. package/dist/components/Dictation.cjs.map +0 -1
  343. package/dist/components/Dictation.js.map +0 -1
  344. package/dist/components/FillInTheBlanks.cjs.map +0 -1
  345. package/dist/components/FillInTheBlanks.js.map +0 -1
  346. package/dist/components/GapSelect.cjs.map +0 -1
  347. package/dist/components/GapSelect.js.map +0 -1
  348. package/dist/components/InteractiveVideo.cjs.map +0 -1
  349. package/dist/components/InteractiveVideo.js.map +0 -1
  350. package/dist/components/MultipleChoice.cjs.map +0 -1
  351. package/dist/components/MultipleChoice.js.map +0 -1
  352. package/dist/components/PronunciationFeedback.cjs.map +0 -1
  353. package/dist/components/PronunciationFeedback.js.map +0 -1
  354. package/dist/components/ReadAloud.cjs.map +0 -1
  355. package/dist/components/ReadAloud.js.map +0 -1
  356. package/dist/components/StimulusPanel.cjs.map +0 -1
  357. package/dist/components/StimulusPanel.js.map +0 -1
  358. package/dist/components/WrittenResponse.cjs.map +0 -1
  359. package/dist/components/WrittenResponse.js.map +0 -1
  360. package/dist/hooks/useSpeechRecorder.cjs.map +0 -1
  361. package/dist/hooks/useSpeechRecorder.js.map +0 -1
  362. package/dist/i18n/LkIntlProvider.cjs.map +0 -1
  363. package/dist/i18n/LkIntlProvider.js.map +0 -1
  364. package/dist/machine-CuwKqWXC.d.cts +0 -26
  365. package/dist/machine-CuwKqWXC.d.ts +0 -26
  366. package/dist/theme/ThemeProvider.cjs.map +0 -1
  367. package/dist/theme/ThemeProvider.js.map +0 -1
  368. package/dist/types-CO0XLEN6.d.cts +0 -973
  369. package/dist/types-CrtIcRcK.d.ts +0 -973
@@ -1,17 +1,13 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { c as ReadAloudProps } from '../types-CO0XLEN6.cjs';
3
- export { R as ReadAloudAssessResult, d as RecordingBinding } from '../types-CO0XLEN6.cjs';
4
- export { R as RecordedTake } from '../machine-CuwKqWXC.cjs';
5
- import '@intellectif/lk-core';
6
- import '../ai/LkAiProvider.cjs';
7
- import 'react';
8
-
1
+ import { a as RecordedTake } from "../useSpeechRecorder-DtAYvl02.cjs";
2
+ import { h as RecordingBinding, m as ReadAloudProps, p as ReadAloudAssessResult } from "../types-BOQd93x3.cjs";
3
+ //#region src/components/ReadAloud/index.d.ts
9
4
  /**
10
5
  * Public Read Aloud activity: the core wrapped in `ActivityErrorBoundary` so a
11
6
  * render failure (including the dev schema-validation throw and the
12
7
  * missing-`upload` guard) degrades to an accessible fallback instead of
13
8
  * crashing the host.
14
9
  */
15
- declare function ReadAloud(props: ReadAloudProps): react_jsx_runtime.JSX.Element;
16
-
17
- export { ReadAloud, ReadAloudProps };
10
+ export declare function ReadAloud(props: ReadAloudProps): import("react/jsx-runtime").JSX.Element;
11
+ //#endregion
12
+ export type { ReadAloudAssessResult, ReadAloudProps, RecordedTake, RecordingBinding };
13
+ //# sourceMappingURL=ReadAloud.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadAloud.d.cts","names":[],"sources":["../../src/components/ReadAloud/index.tsx"],"mappings":";;;;;;;;;wBAkBgB,UAAU,OAAO,6CAAc,IAAA"}
@@ -1,17 +1,13 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { c as ReadAloudProps } from '../types-CrtIcRcK.js';
3
- export { R as ReadAloudAssessResult, d as RecordingBinding } from '../types-CrtIcRcK.js';
4
- export { R as RecordedTake } from '../machine-CuwKqWXC.js';
5
- import '@intellectif/lk-core';
6
- import '../ai/LkAiProvider.js';
7
- import 'react';
8
-
1
+ import { a as RecordedTake } from "../useSpeechRecorder-DtAYvl02.js";
2
+ import { h as RecordingBinding, m as ReadAloudProps, p as ReadAloudAssessResult } from "../types-HIrgF_mS.js";
3
+ //#region src/components/ReadAloud/index.d.ts
9
4
  /**
10
5
  * Public Read Aloud activity: the core wrapped in `ActivityErrorBoundary` so a
11
6
  * render failure (including the dev schema-validation throw and the
12
7
  * missing-`upload` guard) degrades to an accessible fallback instead of
13
8
  * crashing the host.
14
9
  */
15
- declare function ReadAloud(props: ReadAloudProps): react_jsx_runtime.JSX.Element;
16
-
17
- export { ReadAloud, ReadAloudProps };
10
+ export declare function ReadAloud(props: ReadAloudProps): import("react/jsx-runtime").JSX.Element;
11
+ //#endregion
12
+ export type { ReadAloudAssessResult, ReadAloudProps, RecordedTake, RecordingBinding };
13
+ //# sourceMappingURL=ReadAloud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadAloud.d.ts","names":[],"sources":["../../src/components/ReadAloud/index.tsx"],"mappings":";;;;;;;;;wBAkBgB,UAAU,OAAO,6CAAc,IAAA"}
@@ -1,14 +1,4 @@
1
1
  'use client';
2
- export { ReadAloud } from '../chunk-4MXECBZT.js';
3
- import '../chunk-2OP5YHRR.js';
4
- import '../chunk-MCO52PV5.js';
5
- import '../chunk-YORQQXGO.js';
6
- import '../chunk-XYJBRKBZ.js';
7
- import '../chunk-U4KTOH7C.js';
8
- import '../chunk-E4UF4XZM.js';
9
- import '../chunk-DXFCYNST.js';
10
- import '../chunk-HYOUMTPW.js';
11
- import '../chunk-6N43WDVG.js';
12
- import '../chunk-C4PSJ3ZC.js';
13
- //# sourceMappingURL=ReadAloud.js.map
14
- //# sourceMappingURL=ReadAloud.js.map
2
+ "use client";
3
+ import { t as ReadAloud } from "../ReadAloud-C8RhaUqV.js";
4
+ export { ReadAloud };
@@ -1,15 +1,4 @@
1
1
  'use client';
2
- 'use strict';
3
-
4
- var chunkB4JRBV56_cjs = require('../chunk-B4JRBV56.cjs');
5
- require('../chunk-UKUHVCZX.cjs');
6
- require('../chunk-NFGUJ52G.cjs');
7
-
8
-
9
-
10
- Object.defineProperty(exports, "StimulusPanel", {
11
- enumerable: true,
12
- get: function () { return chunkB4JRBV56_cjs.StimulusPanel; }
13
- });
14
- //# sourceMappingURL=StimulusPanel.cjs.map
15
- //# sourceMappingURL=StimulusPanel.cjs.map
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_StimulusPanel = require("../StimulusPanel-b66gaN3i.cjs");
4
+ exports.StimulusPanel = require_StimulusPanel.StimulusPanel;
@@ -1,51 +1,2 @@
1
- import { Stimulus, InteractionEvent } from '@intellectif/lk-core';
2
- import { H as HtmlSanitizer, e as RenderMode, M as MediaBudgetBinding, b as MediaTransportStrings, a as LkStringsOverride } from '../types-CO0XLEN6.cjs';
3
- import '../ai/LkAiProvider.cjs';
4
- import 'react';
5
- import '../machine-CuwKqWXC.cjs';
6
-
7
- interface StimulusPanelProps {
8
- stimulus: Stimulus;
9
- /**
10
- * 1-based presented positions of the first and last question this material
11
- * serves, rendered as "Questions 3–8" so a learner knows how far the
12
- * passage carries.
13
- */
14
- range?: {
15
- first: number;
16
- last: number;
17
- };
18
- /** Renders `stimulus.bodyHtml` when provided. See `HtmlSanitizer`. */
19
- sanitizeHtml?: HtmlSanitizer;
20
- locale?: string;
21
- /**
22
- * Forwarded to the stimulus's own media. `review` keeps the browser's control
23
- * bar even under an enforcing policy — a graded paper cannot be changed by
24
- * listening again.
25
- */
26
- renderMode?: RenderMode;
27
- /**
28
- * Binds this group's recording to a play budget the consumer persists. One
29
- * recording serves every question in the group, so the key is derived from
30
- * the ENTRY rather than the slot — see `stimulusMediaKey()` in lk-core.
31
- */
32
- mediaBudget?: MediaBudgetBinding;
33
- /** Translations for the audio transport chrome. */
34
- mediaStrings?: Partial<MediaTransportStrings>;
35
- onInteraction?: (event: InteractionEvent) => void;
36
- disabled?: boolean;
37
- /** Overrides the SDK's chrome text for this panel. See {@link LkIntlProvider}. */
38
- strings?: LkStringsOverride;
39
- }
40
- /**
41
- * Presents a shared stimulus — the passage, recording or image an item group's
42
- * questions refer to. A landmark region named by its title (or by its kind),
43
- * so a screen-reader user can jump back to the material from any question.
44
- *
45
- * Rich text follows the SDK-wide rule: `bodyHtml` is rendered only through a
46
- * caller-supplied sanitiser, and the plain `body` is the fallback — which the
47
- * schema guarantees exists whenever `bodyHtml` does.
48
- */
49
- declare function StimulusPanel({ stimulus, range, sanitizeHtml, locale, renderMode, mediaBudget, mediaStrings, onInteraction, disabled, strings, }: StimulusPanelProps): React.JSX.Element;
50
-
51
- export { StimulusPanel, type StimulusPanelProps };
1
+ import { n as StimulusPanelProps, t as StimulusPanel } from "../index-CKTpYTCC.cjs";
2
+ export { StimulusPanel, type StimulusPanelProps };
@@ -1,51 +1,2 @@
1
- import { Stimulus, InteractionEvent } from '@intellectif/lk-core';
2
- import { H as HtmlSanitizer, e as RenderMode, M as MediaBudgetBinding, b as MediaTransportStrings, a as LkStringsOverride } from '../types-CrtIcRcK.js';
3
- import '../ai/LkAiProvider.js';
4
- import 'react';
5
- import '../machine-CuwKqWXC.js';
6
-
7
- interface StimulusPanelProps {
8
- stimulus: Stimulus;
9
- /**
10
- * 1-based presented positions of the first and last question this material
11
- * serves, rendered as "Questions 3–8" so a learner knows how far the
12
- * passage carries.
13
- */
14
- range?: {
15
- first: number;
16
- last: number;
17
- };
18
- /** Renders `stimulus.bodyHtml` when provided. See `HtmlSanitizer`. */
19
- sanitizeHtml?: HtmlSanitizer;
20
- locale?: string;
21
- /**
22
- * Forwarded to the stimulus's own media. `review` keeps the browser's control
23
- * bar even under an enforcing policy — a graded paper cannot be changed by
24
- * listening again.
25
- */
26
- renderMode?: RenderMode;
27
- /**
28
- * Binds this group's recording to a play budget the consumer persists. One
29
- * recording serves every question in the group, so the key is derived from
30
- * the ENTRY rather than the slot — see `stimulusMediaKey()` in lk-core.
31
- */
32
- mediaBudget?: MediaBudgetBinding;
33
- /** Translations for the audio transport chrome. */
34
- mediaStrings?: Partial<MediaTransportStrings>;
35
- onInteraction?: (event: InteractionEvent) => void;
36
- disabled?: boolean;
37
- /** Overrides the SDK's chrome text for this panel. See {@link LkIntlProvider}. */
38
- strings?: LkStringsOverride;
39
- }
40
- /**
41
- * Presents a shared stimulus — the passage, recording or image an item group's
42
- * questions refer to. A landmark region named by its title (or by its kind),
43
- * so a screen-reader user can jump back to the material from any question.
44
- *
45
- * Rich text follows the SDK-wide rule: `bodyHtml` is rendered only through a
46
- * caller-supplied sanitiser, and the plain `body` is the fallback — which the
47
- * schema guarantees exists whenever `bodyHtml` does.
48
- */
49
- declare function StimulusPanel({ stimulus, range, sanitizeHtml, locale, renderMode, mediaBudget, mediaStrings, onInteraction, disabled, strings, }: StimulusPanelProps): React.JSX.Element;
50
-
51
- export { StimulusPanel, type StimulusPanelProps };
1
+ import { n as StimulusPanelProps, t as StimulusPanel } from "../index-C1KGpD1k.js";
2
+ export { StimulusPanel, type StimulusPanelProps };
@@ -1,6 +1,3 @@
1
1
  'use client';
2
- export { StimulusPanel } from '../chunk-HZIT24BK.js';
3
- import '../chunk-HYOUMTPW.js';
4
- import '../chunk-C4PSJ3ZC.js';
5
- //# sourceMappingURL=StimulusPanel.js.map
6
- //# sourceMappingURL=StimulusPanel.js.map
2
+ import { t as StimulusPanel } from "../StimulusPanel-BgzByfkb.js";
3
+ export { StimulusPanel };
@@ -1,22 +1,5 @@
1
1
  'use client';
2
- 'use strict';
3
-
4
- var chunkXS6OYYVR_cjs = require('../chunk-XS6OYYVR.cjs');
5
- require('../chunk-6RIM5EQP.cjs');
6
- require('../chunk-OJGTJOWI.cjs');
7
- require('../chunk-VPU6UY4O.cjs');
8
- require('../chunk-J2QIHZ3H.cjs');
9
- require('../chunk-FISEZBLF.cjs');
10
- require('../chunk-54DX6SLS.cjs');
11
- require('../chunk-UKUHVCZX.cjs');
12
- require('../chunk-XOR4MPEN.cjs');
13
- require('../chunk-NFGUJ52G.cjs');
14
-
15
-
16
-
17
- Object.defineProperty(exports, "WrittenResponse", {
18
- enumerable: true,
19
- get: function () { return chunkXS6OYYVR_cjs.WrittenResponse; }
20
- });
21
- //# sourceMappingURL=WrittenResponse.cjs.map
22
- //# sourceMappingURL=WrittenResponse.cjs.map
2
+ "use client";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const require_WrittenResponse = require("../WrittenResponse-Bj3eFmGl.cjs");
5
+ exports.WrittenResponse = require_WrittenResponse.WrittenResponse;
@@ -1,18 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { W as WrittenResponseProps } from '../WrittenResponse-D2K1VW_V.cjs';
3
- export { a as WrittenResponseSubmission } from '../WrittenResponse-D2K1VW_V.cjs';
4
- export { H as HtmlSanitizer, e as RenderMode, f as Renderable } from '../types-CO0XLEN6.cjs';
5
- import '@intellectif/lk-core';
6
- import '../ai/LkAiProvider.cjs';
7
- import 'react';
8
- import '../machine-CuwKqWXC.cjs';
9
-
10
- /**
11
- * Public Written Response activity: a labelled textarea with a live word
12
- * counter for free-text writing graded asynchronously (AI or human). The core
13
- * is wrapped in `ActivityErrorBoundary` so a render failure (incl. the dev
14
- * schema-validation throw) degrades to an accessible fallback.
15
- */
16
- declare function WrittenResponse(props: WrittenResponseProps): react_jsx_runtime.JSX.Element;
17
-
18
- export { WrittenResponse, WrittenResponseProps };
1
+ import { a as RenderMode, n as HtmlSanitizer, o as Renderable } from "../types-BOQd93x3.cjs";
2
+ import { n as WrittenResponseProps, r as WrittenResponseSubmission, t as WrittenResponse } from "../index-CmgSzapt.cjs";
3
+ export { type HtmlSanitizer, type RenderMode, type Renderable, WrittenResponse, type WrittenResponseProps, type WrittenResponseSubmission };
@@ -1,18 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { W as WrittenResponseProps } from '../WrittenResponse-CgRrjM4S.js';
3
- export { a as WrittenResponseSubmission } from '../WrittenResponse-CgRrjM4S.js';
4
- export { H as HtmlSanitizer, e as RenderMode, f as Renderable } from '../types-CrtIcRcK.js';
5
- import '@intellectif/lk-core';
6
- import '../ai/LkAiProvider.js';
7
- import 'react';
8
- import '../machine-CuwKqWXC.js';
9
-
10
- /**
11
- * Public Written Response activity: a labelled textarea with a live word
12
- * counter for free-text writing graded asynchronously (AI or human). The core
13
- * is wrapped in `ActivityErrorBoundary` so a render failure (incl. the dev
14
- * schema-validation throw) degrades to an accessible fallback.
15
- */
16
- declare function WrittenResponse(props: WrittenResponseProps): react_jsx_runtime.JSX.Element;
17
-
18
- export { WrittenResponse, WrittenResponseProps };
1
+ import { a as RenderMode, n as HtmlSanitizer, o as Renderable } from "../types-HIrgF_mS.js";
2
+ import { n as WrittenResponseProps, r as WrittenResponseSubmission, t as WrittenResponse } from "../index-BeiVd-qe.js";
3
+ export { type HtmlSanitizer, type RenderMode, type Renderable, WrittenResponse, type WrittenResponseProps, type WrittenResponseSubmission };
@@ -1,13 +1,4 @@
1
1
  'use client';
2
- export { WrittenResponse } from '../chunk-DPNCCWOV.js';
3
- import '../chunk-CXIP7ERK.js';
4
- import '../chunk-RX3A6KIY.js';
5
- import '../chunk-XYJBRKBZ.js';
6
- import '../chunk-U4KTOH7C.js';
7
- import '../chunk-E4UF4XZM.js';
8
- import '../chunk-DXFCYNST.js';
9
- import '../chunk-HYOUMTPW.js';
10
- import '../chunk-6N43WDVG.js';
11
- import '../chunk-C4PSJ3ZC.js';
12
- //# sourceMappingURL=WrittenResponse.js.map
13
- //# sourceMappingURL=WrittenResponse.js.map
2
+ "use client";
3
+ import { t as WrittenResponse } from "../WrittenResponse-Cl8G6nO_.js";
4
+ export { WrittenResponse };
@@ -0,0 +1,183 @@
1
+ 'use client';
2
+ //#region src/i18n/direction.ts
3
+ /**
4
+ * The writing direction of authored content. A language tag is read from the
5
+ * tag alone, so a server rendering and the browser that hydrates it agree on
6
+ * it. Text is read by the runtime's Unicode tables, which agree on every
7
+ * character both runtimes' Unicode versions know.
8
+ */
9
+ /** ISO 15924 codes of the scripts written right to left. */
10
+ const RTL_SCRIPT_CODES = /* @__PURE__ */ new Set([
11
+ "phlv",
12
+ "adlm",
13
+ "arab",
14
+ "aran",
15
+ "armi",
16
+ "avst",
17
+ "chrs",
18
+ "cprt",
19
+ "elym",
20
+ "gara",
21
+ "hatr",
22
+ "hebr",
23
+ "hung",
24
+ "khar",
25
+ "lydi",
26
+ "mand",
27
+ "mani",
28
+ "mend",
29
+ "merc",
30
+ "mero",
31
+ "narb",
32
+ "nbat",
33
+ "nkoo",
34
+ "orkh",
35
+ "ougr",
36
+ "palm",
37
+ "phli",
38
+ "phlp",
39
+ "phnx",
40
+ "prti",
41
+ "rohg",
42
+ "samr",
43
+ "sarb",
44
+ "sidt",
45
+ "sogd",
46
+ "sogo",
47
+ "syrc",
48
+ "syre",
49
+ "syrj",
50
+ "syrn",
51
+ "thaa",
52
+ "yezi"
53
+ ]);
54
+ /**
55
+ * Languages written right to left in every script they are commonly written
56
+ * in, including the deprecated tags `iw` and `ji` and the Arabic varieties
57
+ * with tags of their own. A language also written left to right — Kurdish,
58
+ * Sindhi, Uyghur — is not listed: its own text decides.
59
+ */
60
+ const RTL_LANGUAGES = /* @__PURE__ */ new Set([
61
+ "acm",
62
+ "aeb",
63
+ "aii",
64
+ "ajp",
65
+ "apc",
66
+ "ar",
67
+ "arc",
68
+ "ars",
69
+ "ary",
70
+ "arz",
71
+ "azb",
72
+ "bqi",
73
+ "ckb",
74
+ "dv",
75
+ "fa",
76
+ "glk",
77
+ "hbo",
78
+ "he",
79
+ "iw",
80
+ "ji",
81
+ "jrb",
82
+ "khw",
83
+ "lrc",
84
+ "mzn",
85
+ "nqo",
86
+ "ota",
87
+ "pnb",
88
+ "prs",
89
+ "ps",
90
+ "sdh",
91
+ "skr",
92
+ "syc",
93
+ "syr",
94
+ "ur",
95
+ "yi"
96
+ ]);
97
+ /**
98
+ * The code-point blocks Unicode reserves for right-to-left scripts (their
99
+ * default bidirectional class is R or AL): Hebrew through Arabic Extended-A,
100
+ * the Hebrew and Arabic presentation forms, the historic right-to-left scripts
101
+ * of the Supplementary Multilingual Plane, and Mende Kikakui through the Arabic
102
+ * mathematical letters. A letter in one of them is written right to left.
103
+ */
104
+ const RTL_BLOCKS = [
105
+ [1424, 2303],
106
+ [64285, 65023],
107
+ [65136, 65279],
108
+ [67584, 69631],
109
+ [124928, 126975]
110
+ ];
111
+ /** Digits whose bidirectional class is R: N'Ko, Mende Kikakui and Adlam. */
112
+ const RTL_DIGITS = [
113
+ [1984, 1993],
114
+ [125127, 125135],
115
+ [125264, 125273]
116
+ ];
117
+ const LETTER_RE = /^\p{L}$/u;
118
+ const NUMBER_RE = /^\p{N}$/u;
119
+ function within(point, ranges) {
120
+ return ranges.some(([first, last]) => point >= first && point <= last);
121
+ }
122
+ /**
123
+ * The script subtag of a BCP 47 tag's lowercased subtags, if it names a
124
+ * direction: not in a private-use or grandfathered tag (`x-arab`, `i-klingon`),
125
+ * and not one of the codes for no particular script — Common, Inherited,
126
+ * Unwritten, Unknown and the like (`Z` codes) or private use (`Qaaa`–`Qabx`).
127
+ */
128
+ function scriptSubtagOf(subtags) {
129
+ if (subtags[0].length === 1) return;
130
+ let index = 1;
131
+ while (index < subtags.length && index <= 3 && /^[a-z]{3}$/.test(subtags[index])) index += 1;
132
+ const candidate = subtags[index];
133
+ if (candidate === void 0 || !/^[a-z]{4}$/.test(candidate)) return;
134
+ return /^z/.test(candidate) || candidate >= "qaaa" && candidate <= "qabx" ? void 0 : candidate;
135
+ }
136
+ /**
137
+ * The direction a language tag names, or `undefined` when it names none: its
138
+ * script subtag when it has one (`ku-Arab` is right-to-left, `ar-Latn` is not),
139
+ * then the languages above. `-` and `_` both separate subtags. Anything that is
140
+ * not a string names none.
141
+ */
142
+ function localeDirectionOf(locale) {
143
+ if (typeof locale !== "string") return;
144
+ const subtags = locale.toLowerCase().split(/[-_]/);
145
+ const script = scriptSubtagOf(subtags);
146
+ if (script !== void 0) return RTL_SCRIPT_CODES.has(script) ? "rtl" : "ltr";
147
+ return RTL_LANGUAGES.has(subtags[0]) ? "rtl" : void 0;
148
+ }
149
+ const LEFT_TO_RIGHT_MARK = String.fromCodePoint(8206);
150
+ /** RIGHT-TO-LEFT MARK and ARABIC LETTER MARK. */
151
+ const RIGHT_TO_LEFT_MARKS = /* @__PURE__ */ new Set([String.fromCodePoint(8207), String.fromCodePoint(1564)]);
152
+ /**
153
+ * The direction of `text`'s first letter or directional mark — an author can
154
+ * start a transcript with a right-to-left mark to lay it out right to left — or
155
+ * `undefined` when it has neither. Other characters with a strong direction,
156
+ * such as a Hebrew punctuation mark or an N'Ko digit, are not read, so this is
157
+ * the first strong character the Unicode bidirectional algorithm finds only
158
+ * where the text starts with a letter or a mark. Letters are read by the
159
+ * runtime's Unicode tables: a letter added in a later Unicode version than a
160
+ * server's is not one to that server.
161
+ */
162
+ function textDirectionOf(text) {
163
+ for (const character of text) {
164
+ if (character === LEFT_TO_RIGHT_MARK) return "ltr";
165
+ if (RIGHT_TO_LEFT_MARKS.has(character)) return "rtl";
166
+ if (LETTER_RE.test(character)) return within(character.codePointAt(0), RTL_BLOCKS) ? "rtl" : "ltr";
167
+ }
168
+ }
169
+ /**
170
+ * The direction a single character is laid out in, for a mark standing in for
171
+ * it: a digit runs left to right unless it is one of the right-to-left digits,
172
+ * a letter runs in its script's direction, and anything else has none of its
173
+ * own.
174
+ */
175
+ function characterDirectionOf(character) {
176
+ const point = character.codePointAt(0);
177
+ if (NUMBER_RE.test(character)) return within(point, RTL_DIGITS) ? "rtl" : "ltr";
178
+ if (LETTER_RE.test(character)) return within(point, RTL_BLOCKS) ? "rtl" : "ltr";
179
+ }
180
+ //#endregion
181
+ export { localeDirectionOf as n, textDirectionOf as r, characterDirectionOf as t };
182
+
183
+ //# sourceMappingURL=direction-Dq0_HtA5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direction-Dq0_HtA5.js","names":[],"sources":["../src/i18n/direction.ts"],"sourcesContent":["/**\n * The writing direction of authored content. A language tag is read from the\n * tag alone, so a server rendering and the browser that hydrates it agree on\n * it. Text is read by the runtime's Unicode tables, which agree on every\n * character both runtimes' Unicode versions know.\n */\n\n/** ISO 15924 codes of the scripts written right to left. */\nconst RTL_SCRIPT_CODES = new Set([\n 'phlv',\n 'adlm',\n 'arab',\n 'aran',\n 'armi',\n 'avst',\n 'chrs',\n 'cprt',\n 'elym',\n 'gara',\n 'hatr',\n 'hebr',\n 'hung',\n 'khar',\n 'lydi',\n 'mand',\n 'mani',\n 'mend',\n 'merc',\n 'mero',\n 'narb',\n 'nbat',\n 'nkoo',\n 'orkh',\n 'ougr',\n 'palm',\n 'phli',\n 'phlp',\n 'phnx',\n 'prti',\n 'rohg',\n 'samr',\n 'sarb',\n 'sidt',\n 'sogd',\n 'sogo',\n 'syrc',\n 'syre',\n 'syrj',\n 'syrn',\n 'thaa',\n 'yezi',\n]);\n\n/**\n * Languages written right to left in every script they are commonly written\n * in, including the deprecated tags `iw` and `ji` and the Arabic varieties\n * with tags of their own. A language also written left to right — Kurdish,\n * Sindhi, Uyghur — is not listed: its own text decides.\n */\nconst RTL_LANGUAGES = new Set([\n 'acm',\n 'aeb',\n 'aii',\n 'ajp',\n 'apc',\n 'ar',\n 'arc',\n 'ars',\n 'ary',\n 'arz',\n 'azb',\n 'bqi',\n 'ckb',\n 'dv',\n 'fa',\n 'glk',\n 'hbo',\n 'he',\n 'iw',\n 'ji',\n 'jrb',\n 'khw',\n 'lrc',\n 'mzn',\n 'nqo',\n 'ota',\n 'pnb',\n 'prs',\n 'ps',\n 'sdh',\n 'skr',\n 'syc',\n 'syr',\n 'ur',\n 'yi',\n]);\n\n/**\n * The code-point blocks Unicode reserves for right-to-left scripts (their\n * default bidirectional class is R or AL): Hebrew through Arabic Extended-A,\n * the Hebrew and Arabic presentation forms, the historic right-to-left scripts\n * of the Supplementary Multilingual Plane, and Mende Kikakui through the Arabic\n * mathematical letters. A letter in one of them is written right to left.\n */\nconst RTL_BLOCKS: readonly (readonly [number, number])[] = [\n [0x0590, 0x08ff],\n [0xfb1d, 0xfdff],\n [0xfe70, 0xfeff],\n [0x10800, 0x10fff],\n [0x1e800, 0x1efff],\n];\n\n/** Digits whose bidirectional class is R: N'Ko, Mende Kikakui and Adlam. */\nconst RTL_DIGITS: readonly (readonly [number, number])[] = [\n [0x07c0, 0x07c9],\n [0x1e8c7, 0x1e8cf],\n [0x1e950, 0x1e959],\n];\n\nconst LETTER_RE = /^\\p{L}$/u;\nconst NUMBER_RE = /^\\p{N}$/u;\n\nfunction within(point: number, ranges: readonly (readonly [number, number])[]): boolean {\n return ranges.some(([first, last]) => point >= first && point <= last);\n}\n\n/**\n * The script subtag of a BCP 47 tag's lowercased subtags, if it names a\n * direction: not in a private-use or grandfathered tag (`x-arab`, `i-klingon`),\n * and not one of the codes for no particular script — Common, Inherited,\n * Unwritten, Unknown and the like (`Z` codes) or private use (`Qaaa`–`Qabx`).\n */\nfunction scriptSubtagOf(subtags: readonly string[]): string | undefined {\n if ((subtags[0] as string).length === 1) {\n return undefined;\n }\n let index = 1;\n // Up to three extended language subtags may come between language and script.\n while (index < subtags.length && index <= 3 && /^[a-z]{3}$/.test(subtags[index] as string)) {\n index += 1;\n }\n const candidate = subtags[index];\n if (candidate === undefined || !/^[a-z]{4}$/.test(candidate)) {\n return undefined;\n }\n return /^z/.test(candidate) || (candidate >= 'qaaa' && candidate <= 'qabx')\n ? undefined\n : candidate;\n}\n\n/**\n * The direction a language tag names, or `undefined` when it names none: its\n * script subtag when it has one (`ku-Arab` is right-to-left, `ar-Latn` is not),\n * then the languages above. `-` and `_` both separate subtags. Anything that is\n * not a string names none.\n */\nexport function localeDirectionOf(locale: unknown): 'ltr' | 'rtl' | undefined {\n if (typeof locale !== 'string') {\n return undefined;\n }\n const subtags = locale.toLowerCase().split(/[-_]/);\n const script = scriptSubtagOf(subtags);\n if (script !== undefined) {\n return RTL_SCRIPT_CODES.has(script) ? 'rtl' : 'ltr';\n }\n return RTL_LANGUAGES.has(subtags[0] as string) ? 'rtl' : undefined;\n}\n\nconst LEFT_TO_RIGHT_MARK = String.fromCodePoint(0x200e);\n/** RIGHT-TO-LEFT MARK and ARABIC LETTER MARK. */\nconst RIGHT_TO_LEFT_MARKS = new Set([String.fromCodePoint(0x200f), String.fromCodePoint(0x61c)]);\n\n/**\n * The direction of `text`'s first letter or directional mark — an author can\n * start a transcript with a right-to-left mark to lay it out right to left — or\n * `undefined` when it has neither. Other characters with a strong direction,\n * such as a Hebrew punctuation mark or an N'Ko digit, are not read, so this is\n * the first strong character the Unicode bidirectional algorithm finds only\n * where the text starts with a letter or a mark. Letters are read by the\n * runtime's Unicode tables: a letter added in a later Unicode version than a\n * server's is not one to that server.\n */\nexport function textDirectionOf(text: string): 'ltr' | 'rtl' | undefined {\n for (const character of text) {\n if (character === LEFT_TO_RIGHT_MARK) {\n return 'ltr';\n }\n if (RIGHT_TO_LEFT_MARKS.has(character)) {\n return 'rtl';\n }\n if (LETTER_RE.test(character)) {\n return within(character.codePointAt(0) as number, RTL_BLOCKS) ? 'rtl' : 'ltr';\n }\n }\n return undefined;\n}\n\n/**\n * The direction a single character is laid out in, for a mark standing in for\n * it: a digit runs left to right unless it is one of the right-to-left digits,\n * a letter runs in its script's direction, and anything else has none of its\n * own.\n */\nexport function characterDirectionOf(character: string): 'ltr' | 'rtl' | undefined {\n const point = character.codePointAt(0) as number;\n if (NUMBER_RE.test(character)) {\n return within(point, RTL_DIGITS) ? 'rtl' : 'ltr';\n }\n if (LETTER_RE.test(character)) {\n return within(point, RTL_BLOCKS) ? 'rtl' : 'ltr';\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,mCAAmB,IAAI,IAAI;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;AAQD,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;AASD,MAAM,aAAqD;CACzD,CAAC,MAAQ,IAAM;CACf,CAAC,OAAQ,KAAM;CACf,CAAC,OAAQ,KAAM;CACf,CAAC,OAAS,KAAO;CACjB,CAAC,QAAS,MAAO;AACnB;;AAGA,MAAM,aAAqD;CACzD,CAAC,MAAQ,IAAM;CACf,CAAC,QAAS,MAAO;CACjB,CAAC,QAAS,MAAO;AACnB;AAEA,MAAM,YAAY;AAClB,MAAM,YAAY;AAElB,SAAS,OAAO,OAAe,QAAyD;CACtF,OAAO,OAAO,MAAM,CAAC,OAAO,UAAU,SAAS,SAAS,SAAS,IAAI;AACvE;;;;;;;AAQA,SAAS,eAAe,SAAgD;CACtE,IAAK,QAAQ,EAAE,CAAY,WAAW,GACpC;CAEF,IAAI,QAAQ;CAEZ,OAAO,QAAQ,QAAQ,UAAU,SAAS,KAAK,aAAa,KAAK,QAAQ,MAAgB,GACvF,SAAS;CAEX,MAAM,YAAY,QAAQ;CAC1B,IAAI,cAAc,KAAA,KAAa,CAAC,aAAa,KAAK,SAAS,GACzD;CAEF,OAAO,KAAK,KAAK,SAAS,KAAM,aAAa,UAAU,aAAa,SAChE,KAAA,IACA;AACN;;;;;;;AAQA,SAAgB,kBAAkB,QAA4C;CAC5E,IAAI,OAAO,WAAW,UACpB;CAEF,MAAM,UAAU,OAAO,YAAY,CAAC,CAAC,MAAM,MAAM;CACjD,MAAM,SAAS,eAAe,OAAO;CACrC,IAAI,WAAW,KAAA,GACb,OAAO,iBAAiB,IAAI,MAAM,IAAI,QAAQ;CAEhD,OAAO,cAAc,IAAI,QAAQ,EAAY,IAAI,QAAQ,KAAA;AAC3D;AAEA,MAAM,qBAAqB,OAAO,cAAc,IAAM;;AAEtD,MAAM,sCAAsB,IAAI,IAAI,CAAC,OAAO,cAAc,IAAM,GAAG,OAAO,cAAc,IAAK,CAAC,CAAC;;;;;;;;;;;AAY/F,SAAgB,gBAAgB,MAAyC;CACvE,KAAK,MAAM,aAAa,MAAM;EAC5B,IAAI,cAAc,oBAChB,OAAO;EAET,IAAI,oBAAoB,IAAI,SAAS,GACnC,OAAO;EAET,IAAI,UAAU,KAAK,SAAS,GAC1B,OAAO,OAAO,UAAU,YAAY,CAAC,GAAa,UAAU,IAAI,QAAQ;CAE5E;AAEF;;;;;;;AAQA,SAAgB,qBAAqB,WAA8C;CACjF,MAAM,QAAQ,UAAU,YAAY,CAAC;CACrC,IAAI,UAAU,KAAK,SAAS,GAC1B,OAAO,OAAO,OAAO,UAAU,IAAI,QAAQ;CAE7C,IAAI,UAAU,KAAK,SAAS,GAC1B,OAAO,OAAO,OAAO,UAAU,IAAI,QAAQ;AAG/C"}