@intellectif/lk-react 23.1.0 → 23.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +9 -5
  3. package/dist/ActivityErrorBoundary-B379hvtL.cjs +39 -0
  4. package/dist/ActivityErrorBoundary-B379hvtL.cjs.map +1 -0
  5. package/dist/ActivityErrorBoundary-Dw6SbWv3.js +34 -0
  6. package/dist/ActivityErrorBoundary-Dw6SbWv3.js.map +1 -0
  7. package/dist/ActivityMedia-CQQTRNl7.cjs +641 -0
  8. package/dist/ActivityMedia-CQQTRNl7.cjs.map +1 -0
  9. package/dist/ActivityMedia-vDiP-Psa.js +636 -0
  10. package/dist/ActivityMedia-vDiP-Psa.js.map +1 -0
  11. package/dist/ActivityPreview-1hhTkYuj.js +240 -0
  12. package/dist/ActivityPreview-1hhTkYuj.js.map +1 -0
  13. package/dist/ActivityPreview-BKr34exz.cjs +245 -0
  14. package/dist/ActivityPreview-BKr34exz.cjs.map +1 -0
  15. package/dist/ActivitySequence-CkX87pfB.js +839 -0
  16. package/dist/ActivitySequence-CkX87pfB.js.map +1 -0
  17. package/dist/ActivitySequence-CmoSyDnp.cjs +844 -0
  18. package/dist/ActivitySequence-CmoSyDnp.cjs.map +1 -0
  19. package/dist/Dictation-BlxRp-3k.js +926 -0
  20. package/dist/Dictation-BlxRp-3k.js.map +1 -0
  21. package/dist/Dictation-jECzL88E.cjs +931 -0
  22. package/dist/Dictation-jECzL88E.cjs.map +1 -0
  23. package/dist/FeedbackRegion-BNNMtTY-.cjs +108 -0
  24. package/dist/FeedbackRegion-BNNMtTY-.cjs.map +1 -0
  25. package/dist/FeedbackRegion-CyPSp8bA.js +85 -0
  26. package/dist/FeedbackRegion-CyPSp8bA.js.map +1 -0
  27. package/dist/FillInTheBlanks-B6xzqYXx.js +474 -0
  28. package/dist/FillInTheBlanks-B6xzqYXx.js.map +1 -0
  29. package/dist/FillInTheBlanks-BpKhdHg2.cjs +479 -0
  30. package/dist/FillInTheBlanks-BpKhdHg2.cjs.map +1 -0
  31. package/dist/GapSelect-DUSiaEQH.js +441 -0
  32. package/dist/GapSelect-DUSiaEQH.js.map +1 -0
  33. package/dist/GapSelect-payTq_Zn.cjs +446 -0
  34. package/dist/GapSelect-payTq_Zn.cjs.map +1 -0
  35. package/dist/InteractiveVideo-BguGv-HA.cjs +2955 -0
  36. package/dist/InteractiveVideo-BguGv-HA.cjs.map +1 -0
  37. package/dist/InteractiveVideo-Cg2jbU3j.js +2944 -0
  38. package/dist/InteractiveVideo-Cg2jbU3j.js.map +1 -0
  39. package/dist/LkAiProvider-DAPpA3PQ.d.cts +84 -0
  40. package/dist/LkAiProvider-DAPpA3PQ.d.cts.map +1 -0
  41. package/dist/LkAiProvider-QdEcIhoo.d.ts +84 -0
  42. package/dist/LkAiProvider-QdEcIhoo.d.ts.map +1 -0
  43. package/dist/LkIntlProvider-D_FdYXjQ.js +375 -0
  44. package/dist/LkIntlProvider-D_FdYXjQ.js.map +1 -0
  45. package/dist/LkIntlProvider-oi57lYB0.cjs +410 -0
  46. package/dist/LkIntlProvider-oi57lYB0.cjs.map +1 -0
  47. package/dist/MultipleChoice-COn5MtKY.cjs +433 -0
  48. package/dist/MultipleChoice-COn5MtKY.cjs.map +1 -0
  49. package/dist/MultipleChoice-Dra0_KYD.js +428 -0
  50. package/dist/MultipleChoice-Dra0_KYD.js.map +1 -0
  51. package/dist/PronunciationFeedback-DlMPGjkR.cjs +831 -0
  52. package/dist/PronunciationFeedback-DlMPGjkR.cjs.map +1 -0
  53. package/dist/PronunciationFeedback-Dxd6XPkO.js +772 -0
  54. package/dist/PronunciationFeedback-Dxd6XPkO.js.map +1 -0
  55. package/dist/ReadAloud-C8RhaUqV.js +1092 -0
  56. package/dist/{chunk-DC4CQCK5.js.map → ReadAloud-C8RhaUqV.js.map} +1 -1
  57. package/dist/ReadAloud-akDehitT.cjs +1103 -0
  58. package/dist/ReadAloud-akDehitT.cjs.map +1 -0
  59. package/dist/StimulusPanel-BgzByfkb.js +74 -0
  60. package/dist/StimulusPanel-BgzByfkb.js.map +1 -0
  61. package/dist/StimulusPanel-b66gaN3i.cjs +79 -0
  62. package/dist/StimulusPanel-b66gaN3i.cjs.map +1 -0
  63. package/dist/ThemeProvider-B6DyGqzh.d.cts +62 -0
  64. package/dist/ThemeProvider-B6DyGqzh.d.cts.map +1 -0
  65. package/dist/ThemeProvider-BCrxBaY-.d.ts +62 -0
  66. package/dist/ThemeProvider-BCrxBaY-.d.ts.map +1 -0
  67. package/dist/ThemeProvider-BRN1tj4n.cjs +187 -0
  68. package/dist/ThemeProvider-BRN1tj4n.cjs.map +1 -0
  69. package/dist/ThemeProvider-C7K9iMLX.js +158 -0
  70. package/dist/ThemeProvider-C7K9iMLX.js.map +1 -0
  71. package/dist/WrittenResponse-Bj3eFmGl.cjs +491 -0
  72. package/dist/WrittenResponse-Bj3eFmGl.cjs.map +1 -0
  73. package/dist/WrittenResponse-Cl8G6nO_.js +486 -0
  74. package/dist/WrittenResponse-Cl8G6nO_.js.map +1 -0
  75. package/dist/ai/LkAiProvider.cjs +34 -14
  76. package/dist/ai/LkAiProvider.cjs.map +1 -1
  77. package/dist/ai/LkAiProvider.d.cts +2 -83
  78. package/dist/ai/LkAiProvider.d.ts +2 -83
  79. package/dist/ai/LkAiProvider.js +33 -2
  80. package/dist/ai/LkAiProvider.js.map +1 -1
  81. package/dist/ai/useAiHelp.cjs +7 -25
  82. package/dist/ai/useAiHelp.d.cts +175 -177
  83. package/dist/ai/useAiHelp.d.cts.map +1 -0
  84. package/dist/ai/useAiHelp.d.ts +175 -177
  85. package/dist/ai/useAiHelp.d.ts.map +1 -0
  86. package/dist/ai/useAiHelp.js +3 -4
  87. package/dist/components/ActivityPreview.cjs +3 -29
  88. package/dist/components/ActivityPreview.d.cts +2 -81
  89. package/dist/components/ActivityPreview.d.ts +2 -81
  90. package/dist/components/ActivityPreview.js +2 -20
  91. package/dist/components/ActivitySequence.cjs +3 -30
  92. package/dist/components/ActivitySequence.d.cts +2 -432
  93. package/dist/components/ActivitySequence.d.ts +2 -432
  94. package/dist/components/ActivitySequence.js +2 -21
  95. package/dist/components/Dictation.cjs +4 -21
  96. package/dist/components/Dictation.d.cts +2 -19
  97. package/dist/components/Dictation.d.ts +2 -19
  98. package/dist/components/Dictation.js +3 -12
  99. package/dist/components/FillInTheBlanks.cjs +4 -20
  100. package/dist/components/FillInTheBlanks.d.cts +2 -30
  101. package/dist/components/FillInTheBlanks.d.ts +2 -30
  102. package/dist/components/FillInTheBlanks.js +3 -11
  103. package/dist/components/GapSelect.cjs +4 -20
  104. package/dist/components/GapSelect.d.cts +2 -27
  105. package/dist/components/GapSelect.d.ts +2 -27
  106. package/dist/components/GapSelect.js +3 -11
  107. package/dist/components/InteractiveVideo.cjs +5 -32
  108. package/dist/components/InteractiveVideo.d.cts +3 -291
  109. package/dist/components/InteractiveVideo.d.ts +3 -291
  110. package/dist/components/InteractiveVideo.js +3 -19
  111. package/dist/components/MultipleChoice.cjs +4 -20
  112. package/dist/components/MultipleChoice.d.cts +2 -26
  113. package/dist/components/MultipleChoice.d.ts +2 -26
  114. package/dist/components/MultipleChoice.js +3 -11
  115. package/dist/components/PronunciationFeedback.cjs +4 -17
  116. package/dist/components/PronunciationFeedback.d.cts +2 -90
  117. package/dist/components/PronunciationFeedback.d.ts +2 -90
  118. package/dist/components/PronunciationFeedback.js +3 -8
  119. package/dist/components/ReadAloud.cjs +4 -22
  120. package/dist/components/ReadAloud.d.cts +7 -11
  121. package/dist/components/ReadAloud.d.cts.map +1 -0
  122. package/dist/components/ReadAloud.d.ts +7 -11
  123. package/dist/components/ReadAloud.d.ts.map +1 -0
  124. package/dist/components/ReadAloud.js +3 -13
  125. package/dist/components/StimulusPanel.cjs +3 -14
  126. package/dist/components/StimulusPanel.d.cts +2 -51
  127. package/dist/components/StimulusPanel.d.ts +2 -51
  128. package/dist/components/StimulusPanel.js +2 -5
  129. package/dist/components/WrittenResponse.cjs +4 -19
  130. package/dist/components/WrittenResponse.d.cts +3 -18
  131. package/dist/components/WrittenResponse.d.ts +3 -18
  132. package/dist/components/WrittenResponse.js +3 -10
  133. package/dist/direction-Dq0_HtA5.js +183 -0
  134. package/dist/direction-Dq0_HtA5.js.map +1 -0
  135. package/dist/direction-K1pj0HCA.cjs +200 -0
  136. package/dist/direction-K1pj0HCA.cjs.map +1 -0
  137. package/dist/hooks/useActivityState.cjs +28 -10
  138. package/dist/hooks/useActivityState.cjs.map +1 -1
  139. package/dist/hooks/useActivityState.d.cts +25 -24
  140. package/dist/hooks/useActivityState.d.cts.map +1 -0
  141. package/dist/hooks/useActivityState.d.ts +25 -24
  142. package/dist/hooks/useActivityState.d.ts.map +1 -0
  143. package/dist/hooks/useActivityState.js +28 -2
  144. package/dist/hooks/useActivityState.js.map +1 -1
  145. package/dist/hooks/useSpeechRecorder.cjs +5 -16
  146. package/dist/hooks/useSpeechRecorder.d.cts +2 -127
  147. package/dist/hooks/useSpeechRecorder.d.ts +2 -127
  148. package/dist/hooks/useSpeechRecorder.js +3 -3
  149. package/dist/hooks/useXAPI.cjs +126 -10
  150. package/dist/hooks/useXAPI.cjs.map +1 -1
  151. package/dist/hooks/useXAPI.d.cts +14 -14
  152. package/dist/hooks/useXAPI.d.cts.map +1 -0
  153. package/dist/hooks/useXAPI.d.ts +14 -14
  154. package/dist/hooks/useXAPI.d.ts.map +1 -0
  155. package/dist/hooks/useXAPI.js +126 -2
  156. package/dist/hooks/useXAPI.js.map +1 -1
  157. package/dist/i18n/LkIntlProvider.cjs +9 -32
  158. package/dist/i18n/LkIntlProvider.d.cts +34 -38
  159. package/dist/i18n/LkIntlProvider.d.cts.map +1 -0
  160. package/dist/i18n/LkIntlProvider.d.ts +34 -38
  161. package/dist/i18n/LkIntlProvider.d.ts.map +1 -0
  162. package/dist/i18n/LkIntlProvider.js +3 -3
  163. package/dist/index-6P4rJHrJ.d.cts +432 -0
  164. package/dist/index-6P4rJHrJ.d.cts.map +1 -0
  165. package/dist/index-90CX504k.d.ts +90 -0
  166. package/dist/index-90CX504k.d.ts.map +1 -0
  167. package/dist/index-B_SgnjsC.d.cts +291 -0
  168. package/dist/index-B_SgnjsC.d.cts.map +1 -0
  169. package/dist/index-BavVW5z5.d.cts +25 -0
  170. package/dist/index-BavVW5z5.d.cts.map +1 -0
  171. package/dist/index-BhHv6Fiu.d.cts +28 -0
  172. package/dist/index-BhHv6Fiu.d.cts.map +1 -0
  173. package/dist/index-Bsu8VciA.d.ts +432 -0
  174. package/dist/index-Bsu8VciA.d.ts.map +1 -0
  175. package/dist/index-C1KGpD1k.d.ts +49 -0
  176. package/dist/index-C1KGpD1k.d.ts.map +1 -0
  177. package/dist/index-CKTpYTCC.d.cts +49 -0
  178. package/dist/index-CKTpYTCC.d.cts.map +1 -0
  179. package/dist/index-CO_SRFJj.d.ts +16 -0
  180. package/dist/index-CO_SRFJj.d.ts.map +1 -0
  181. package/dist/index-CSsuUsP7.d.cts +124 -0
  182. package/dist/index-CSsuUsP7.d.cts.map +1 -0
  183. package/dist/index-CunUyeuN.d.cts +78 -0
  184. package/dist/index-CunUyeuN.d.cts.map +1 -0
  185. package/dist/index-CzfRzks6.d.cts +90 -0
  186. package/dist/index-CzfRzks6.d.cts.map +1 -0
  187. package/dist/index-D14xtpBS.d.cts +24 -0
  188. package/dist/index-D14xtpBS.d.cts.map +1 -0
  189. package/dist/index-DHRPAPZf.d.ts +291 -0
  190. package/dist/index-DHRPAPZf.d.ts.map +1 -0
  191. package/dist/index-DLV6cK26.d.cts +16 -0
  192. package/dist/index-DLV6cK26.d.cts.map +1 -0
  193. package/dist/index-DbCCQ9cP.d.ts +124 -0
  194. package/dist/index-DbCCQ9cP.d.ts.map +1 -0
  195. package/dist/index-DeV5B2m5.d.ts +24 -0
  196. package/dist/index-DeV5B2m5.d.ts.map +1 -0
  197. package/dist/index-TZCJVSge.d.ts +28 -0
  198. package/dist/index-TZCJVSge.d.ts.map +1 -0
  199. package/dist/index-ZVvLHsd3.d.ts +25 -0
  200. package/dist/index-ZVvLHsd3.d.ts.map +1 -0
  201. package/dist/index-eQwBgpSw.d.ts +78 -0
  202. package/dist/index-eQwBgpSw.d.ts.map +1 -0
  203. package/dist/index.cjs +118 -163
  204. package/dist/index.cjs.map +1 -1
  205. package/dist/index.d.cts +20 -24
  206. package/dist/index.d.ts +20 -24
  207. package/dist/index.js +84 -29
  208. package/dist/index.js.map +1 -1
  209. package/dist/theme/ThemeProvider.cjs +8 -28
  210. package/dist/theme/ThemeProvider.d.cts +2 -59
  211. package/dist/theme/ThemeProvider.d.ts +2 -59
  212. package/dist/theme/ThemeProvider.js +3 -3
  213. package/dist/tries-CbbtZkdG.cjs +363 -0
  214. package/dist/tries-CbbtZkdG.cjs.map +1 -0
  215. package/dist/tries-DTHSrLCm.js +310 -0
  216. package/dist/tries-DTHSrLCm.js.map +1 -0
  217. package/dist/types-BOQd93x3.d.cts +994 -0
  218. package/dist/types-BOQd93x3.d.cts.map +1 -0
  219. package/dist/types-HIrgF_mS.d.ts +994 -0
  220. package/dist/types-HIrgF_mS.d.ts.map +1 -0
  221. package/dist/useAiHelp-B-ccDL5Q.js +906 -0
  222. package/dist/useAiHelp-B-ccDL5Q.js.map +1 -0
  223. package/dist/useAiHelp-h9yOLFqt.cjs +995 -0
  224. package/dist/useAiHelp-h9yOLFqt.cjs.map +1 -0
  225. package/dist/useSpeechRecorder--O_f-xvt.cjs +720 -0
  226. package/dist/useSpeechRecorder--O_f-xvt.cjs.map +1 -0
  227. package/dist/useSpeechRecorder-DtAYvl02.d.cts +154 -0
  228. package/dist/useSpeechRecorder-DtAYvl02.d.cts.map +1 -0
  229. package/dist/useSpeechRecorder-DtAYvl02.d.ts +154 -0
  230. package/dist/useSpeechRecorder-DtAYvl02.d.ts.map +1 -0
  231. package/dist/useSpeechRecorder-zIi9Dlw8.js +709 -0
  232. package/dist/useSpeechRecorder-zIi9Dlw8.js.map +1 -0
  233. package/package.json +10 -11
  234. package/dist/WrittenResponse-B7A5gHMj.d.ts +0 -115
  235. package/dist/WrittenResponse-BpL9p2Hn.d.cts +0 -115
  236. package/dist/ai/useAiHelp.cjs.map +0 -1
  237. package/dist/ai/useAiHelp.js.map +0 -1
  238. package/dist/chunk-2PNSVBLQ.cjs +0 -54
  239. package/dist/chunk-2PNSVBLQ.cjs.map +0 -1
  240. package/dist/chunk-2TW6WLBC.js +0 -80
  241. package/dist/chunk-2TW6WLBC.js.map +0 -1
  242. package/dist/chunk-4ZZWZSWI.js +0 -61
  243. package/dist/chunk-4ZZWZSWI.js.map +0 -1
  244. package/dist/chunk-6N43WDVG.js +0 -29
  245. package/dist/chunk-6N43WDVG.js.map +0 -1
  246. package/dist/chunk-7ALBSPYR.cjs +0 -436
  247. package/dist/chunk-7ALBSPYR.cjs.map +0 -1
  248. package/dist/chunk-7NFY3M3W.js +0 -234
  249. package/dist/chunk-7NFY3M3W.js.map +0 -1
  250. package/dist/chunk-7SB2MJA4.js +0 -29
  251. package/dist/chunk-7SB2MJA4.js.map +0 -1
  252. package/dist/chunk-ABJJ3LII.js +0 -434
  253. package/dist/chunk-ABJJ3LII.js.map +0 -1
  254. package/dist/chunk-BIGGXHAW.cjs +0 -342
  255. package/dist/chunk-BIGGXHAW.cjs.map +0 -1
  256. package/dist/chunk-C7QZE5BI.js +0 -430
  257. package/dist/chunk-C7QZE5BI.js.map +0 -1
  258. package/dist/chunk-CWTUWNV3.cjs +0 -2937
  259. package/dist/chunk-CWTUWNV3.cjs.map +0 -1
  260. package/dist/chunk-DC4CQCK5.js +0 -915
  261. package/dist/chunk-DS6HN3YR.cjs +0 -496
  262. package/dist/chunk-DS6HN3YR.cjs.map +0 -1
  263. package/dist/chunk-FDQR4GAZ.js +0 -240
  264. package/dist/chunk-FDQR4GAZ.js.map +0 -1
  265. package/dist/chunk-FKGMSOJF.js +0 -394
  266. package/dist/chunk-FKGMSOJF.js.map +0 -1
  267. package/dist/chunk-G6PXJ2SA.js +0 -823
  268. package/dist/chunk-G6PXJ2SA.js.map +0 -1
  269. package/dist/chunk-HNLRVRQR.js +0 -335
  270. package/dist/chunk-HNLRVRQR.js.map +0 -1
  271. package/dist/chunk-J3C72RPK.cjs +0 -31
  272. package/dist/chunk-J3C72RPK.cjs.map +0 -1
  273. package/dist/chunk-K63VPFOV.cjs +0 -134
  274. package/dist/chunk-K63VPFOV.cjs.map +0 -1
  275. package/dist/chunk-KFLIDTDU.cjs +0 -825
  276. package/dist/chunk-KFLIDTDU.cjs.map +0 -1
  277. package/dist/chunk-KHKH5LCT.cjs +0 -250
  278. package/dist/chunk-KHKH5LCT.cjs.map +0 -1
  279. package/dist/chunk-LBEKRN6Y.cjs +0 -664
  280. package/dist/chunk-LBEKRN6Y.cjs.map +0 -1
  281. package/dist/chunk-LPUWXIPR.cjs +0 -578
  282. package/dist/chunk-LPUWXIPR.cjs.map +0 -1
  283. package/dist/chunk-MCO52PV5.js +0 -520
  284. package/dist/chunk-MCO52PV5.js.map +0 -1
  285. package/dist/chunk-MKXEM2C5.cjs +0 -396
  286. package/dist/chunk-MKXEM2C5.cjs.map +0 -1
  287. package/dist/chunk-MXNC5UNO.js +0 -563
  288. package/dist/chunk-MXNC5UNO.js.map +0 -1
  289. package/dist/chunk-NAK55BYU.cjs +0 -859
  290. package/dist/chunk-NAK55BYU.cjs.map +0 -1
  291. package/dist/chunk-NDBMKGQ5.cjs +0 -599
  292. package/dist/chunk-NDBMKGQ5.cjs.map +0 -1
  293. package/dist/chunk-OD65OZIW.cjs +0 -159
  294. package/dist/chunk-OD65OZIW.cjs.map +0 -1
  295. package/dist/chunk-ORT3KLGI.js +0 -50
  296. package/dist/chunk-ORT3KLGI.js.map +0 -1
  297. package/dist/chunk-PNNUPUH4.cjs +0 -82
  298. package/dist/chunk-PNNUPUH4.cjs.map +0 -1
  299. package/dist/chunk-PWHECW6N.js +0 -2934
  300. package/dist/chunk-PWHECW6N.js.map +0 -1
  301. package/dist/chunk-RBS5A2DF.js +0 -857
  302. package/dist/chunk-RBS5A2DF.js.map +0 -1
  303. package/dist/chunk-RPWUDXG5.cjs +0 -63
  304. package/dist/chunk-RPWUDXG5.cjs.map +0 -1
  305. package/dist/chunk-TCDJY3H6.js +0 -494
  306. package/dist/chunk-TCDJY3H6.js.map +0 -1
  307. package/dist/chunk-TP5UMRAU.cjs +0 -918
  308. package/dist/chunk-TP5UMRAU.cjs.map +0 -1
  309. package/dist/chunk-TS7J6DTY.js +0 -597
  310. package/dist/chunk-TS7J6DTY.js.map +0 -1
  311. package/dist/chunk-TUVENMXB.cjs +0 -20
  312. package/dist/chunk-TUVENMXB.cjs.map +0 -1
  313. package/dist/chunk-UDCQTOVU.cjs +0 -523
  314. package/dist/chunk-UDCQTOVU.cjs.map +0 -1
  315. package/dist/chunk-UHKZXOXD.js +0 -128
  316. package/dist/chunk-UHKZXOXD.js.map +0 -1
  317. package/dist/chunk-V6BA44DS.cjs +0 -236
  318. package/dist/chunk-V6BA44DS.cjs.map +0 -1
  319. package/dist/chunk-XO5R73Y4.js +0 -653
  320. package/dist/chunk-XO5R73Y4.js.map +0 -1
  321. package/dist/chunk-XOR4MPEN.cjs +0 -31
  322. package/dist/chunk-XOR4MPEN.cjs.map +0 -1
  323. package/dist/chunk-YORQQXGO.js +0 -155
  324. package/dist/chunk-YORQQXGO.js.map +0 -1
  325. package/dist/chunk-YY4PFR3Z.cjs +0 -432
  326. package/dist/chunk-YY4PFR3Z.cjs.map +0 -1
  327. package/dist/chunk-ZPI6Q42R.js +0 -17
  328. package/dist/chunk-ZPI6Q42R.js.map +0 -1
  329. package/dist/components/ActivityPreview.cjs.map +0 -1
  330. package/dist/components/ActivityPreview.js.map +0 -1
  331. package/dist/components/ActivitySequence.cjs.map +0 -1
  332. package/dist/components/ActivitySequence.js.map +0 -1
  333. package/dist/components/Dictation.cjs.map +0 -1
  334. package/dist/components/Dictation.js.map +0 -1
  335. package/dist/components/FillInTheBlanks.cjs.map +0 -1
  336. package/dist/components/FillInTheBlanks.js.map +0 -1
  337. package/dist/components/GapSelect.cjs.map +0 -1
  338. package/dist/components/GapSelect.js.map +0 -1
  339. package/dist/components/InteractiveVideo.cjs.map +0 -1
  340. package/dist/components/InteractiveVideo.js.map +0 -1
  341. package/dist/components/MultipleChoice.cjs.map +0 -1
  342. package/dist/components/MultipleChoice.js.map +0 -1
  343. package/dist/components/PronunciationFeedback.cjs.map +0 -1
  344. package/dist/components/PronunciationFeedback.js.map +0 -1
  345. package/dist/components/ReadAloud.cjs.map +0 -1
  346. package/dist/components/ReadAloud.js.map +0 -1
  347. package/dist/components/StimulusPanel.cjs.map +0 -1
  348. package/dist/components/StimulusPanel.js.map +0 -1
  349. package/dist/components/WrittenResponse.cjs.map +0 -1
  350. package/dist/components/WrittenResponse.js.map +0 -1
  351. package/dist/hooks/useSpeechRecorder.cjs.map +0 -1
  352. package/dist/hooks/useSpeechRecorder.js.map +0 -1
  353. package/dist/i18n/LkIntlProvider.cjs.map +0 -1
  354. package/dist/i18n/LkIntlProvider.js.map +0 -1
  355. package/dist/machine-CuwKqWXC.d.cts +0 -26
  356. package/dist/machine-CuwKqWXC.d.ts +0 -26
  357. package/dist/theme/ThemeProvider.cjs.map +0 -1
  358. package/dist/theme/ThemeProvider.js.map +0 -1
  359. package/dist/types-C4IsUQsK.d.ts +0 -989
  360. package/dist/types-CJgZWtl4.d.cts +0 -989
@@ -1,23 +1,5 @@
1
1
  'use client';
2
- 'use strict';
3
-
4
- var chunkTP5UMRAU_cjs = require('../chunk-TP5UMRAU.cjs');
5
- require('../chunk-LBEKRN6Y.cjs');
6
- require('../chunk-UDCQTOVU.cjs');
7
- require('../chunk-OD65OZIW.cjs');
8
- require('../chunk-2PNSVBLQ.cjs');
9
- require('../chunk-J3C72RPK.cjs');
10
- require('../chunk-LPUWXIPR.cjs');
11
- require('../chunk-NDBMKGQ5.cjs');
12
- require('../chunk-XOR4MPEN.cjs');
13
- require('../chunk-BIGGXHAW.cjs');
14
- require('../chunk-TUVENMXB.cjs');
15
-
16
-
17
-
18
- Object.defineProperty(exports, "ReadAloud", {
19
- enumerable: true,
20
- get: function () { return chunkTP5UMRAU_cjs.ReadAloud; }
21
- });
22
- //# sourceMappingURL=ReadAloud.cjs.map
23
- //# sourceMappingURL=ReadAloud.cjs.map
2
+ "use client";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const require_ReadAloud = require("../ReadAloud-akDehitT.cjs");
5
+ exports.ReadAloud = require_ReadAloud.ReadAloud;
@@ -1,17 +1,13 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { c as ReadAloudProps } from '../types-CJgZWtl4.cjs';
3
- export { R as ReadAloudAssessResult, d as RecordingBinding } from '../types-CJgZWtl4.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): React.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,iBAAiB,MAAM,IAAI"}
@@ -1,17 +1,13 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { c as ReadAloudProps } from '../types-C4IsUQsK.js';
3
- export { R as ReadAloudAssessResult, d as RecordingBinding } from '../types-C4IsUQsK.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): React.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,iBAAiB,MAAM,IAAI"}
@@ -1,14 +1,4 @@
1
1
  'use client';
2
- export { ReadAloud } from '../chunk-DC4CQCK5.js';
3
- import '../chunk-XO5R73Y4.js';
4
- import '../chunk-MCO52PV5.js';
5
- import '../chunk-YORQQXGO.js';
6
- import '../chunk-ORT3KLGI.js';
7
- import '../chunk-7SB2MJA4.js';
8
- import '../chunk-MXNC5UNO.js';
9
- import '../chunk-TS7J6DTY.js';
10
- import '../chunk-6N43WDVG.js';
11
- import '../chunk-HNLRVRQR.js';
12
- import '../chunk-ZPI6Q42R.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 chunkRPWUDXG5_cjs = require('../chunk-RPWUDXG5.cjs');
5
- require('../chunk-NDBMKGQ5.cjs');
6
- require('../chunk-BIGGXHAW.cjs');
7
-
8
-
9
-
10
- Object.defineProperty(exports, "StimulusPanel", {
11
- enumerable: true,
12
- get: function () { return chunkRPWUDXG5_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-CJgZWtl4.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-C4IsUQsK.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-4ZZWZSWI.js';
3
- import '../chunk-TS7J6DTY.js';
4
- import '../chunk-HNLRVRQR.js';
5
- //# sourceMappingURL=StimulusPanel.js.map
6
- //# sourceMappingURL=StimulusPanel.js.map
2
+ import { t as StimulusPanel } from "../StimulusPanel-BgzByfkb.js";
3
+ export { StimulusPanel };
@@ -1,20 +1,5 @@
1
1
  'use client';
2
- 'use strict';
3
-
4
- var chunkMKXEM2C5_cjs = require('../chunk-MKXEM2C5.cjs');
5
- require('../chunk-2PNSVBLQ.cjs');
6
- require('../chunk-J3C72RPK.cjs');
7
- require('../chunk-LPUWXIPR.cjs');
8
- require('../chunk-NDBMKGQ5.cjs');
9
- require('../chunk-XOR4MPEN.cjs');
10
- require('../chunk-BIGGXHAW.cjs');
11
- require('../chunk-TUVENMXB.cjs');
12
-
13
-
14
-
15
- Object.defineProperty(exports, "WrittenResponse", {
16
- enumerable: true,
17
- get: function () { return chunkMKXEM2C5_cjs.WrittenResponse; }
18
- });
19
- //# sourceMappingURL=WrittenResponse.cjs.map
20
- //# 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-BpL9p2Hn.cjs';
3
- export { a as WrittenResponseSubmission } from '../WrittenResponse-BpL9p2Hn.cjs';
4
- export { H as HtmlSanitizer, e as RenderMode, f as Renderable } from '../types-CJgZWtl4.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-CSsuUsP7.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-B7A5gHMj.js';
3
- export { a as WrittenResponseSubmission } from '../WrittenResponse-B7A5gHMj.js';
4
- export { H as HtmlSanitizer, e as RenderMode, f as Renderable } from '../types-C4IsUQsK.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-DbCCQ9cP.js";
3
+ export { type HtmlSanitizer, type RenderMode, type Renderable, WrittenResponse, type WrittenResponseProps, type WrittenResponseSubmission };
@@ -1,11 +1,4 @@
1
1
  'use client';
2
- export { WrittenResponse } from '../chunk-FKGMSOJF.js';
3
- import '../chunk-ORT3KLGI.js';
4
- import '../chunk-7SB2MJA4.js';
5
- import '../chunk-MXNC5UNO.js';
6
- import '../chunk-TS7J6DTY.js';
7
- import '../chunk-6N43WDVG.js';
8
- import '../chunk-HNLRVRQR.js';
9
- import '../chunk-ZPI6Q42R.js';
10
- //# sourceMappingURL=WrittenResponse.js.map
11
- //# 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"}