@intellectif/lk-react 23.0.0 → 23.1.0

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 (178) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +4 -4
  3. package/dist/{WrittenResponse-CgRrjM4S.d.ts → WrittenResponse-B7A5gHMj.d.ts} +1 -1
  4. package/dist/{WrittenResponse-D2K1VW_V.d.cts → WrittenResponse-BpL9p2Hn.d.cts} +1 -1
  5. package/dist/ai/LkAiProvider.cjs +3 -3
  6. package/dist/ai/LkAiProvider.d.cts +12 -2
  7. package/dist/ai/LkAiProvider.d.ts +12 -2
  8. package/dist/ai/LkAiProvider.js +1 -1
  9. package/dist/ai/useAiHelp.cjs +9 -7
  10. package/dist/ai/useAiHelp.d.cts +82 -3
  11. package/dist/ai/useAiHelp.d.ts +82 -3
  12. package/dist/ai/useAiHelp.js +2 -4
  13. package/dist/{chunk-VPU6UY4O.cjs → chunk-2PNSVBLQ.cjs} +5 -6
  14. package/dist/chunk-2PNSVBLQ.cjs.map +1 -0
  15. package/dist/{chunk-HZIT24BK.js → chunk-4ZZWZSWI.js} +4 -4
  16. package/dist/{chunk-HZIT24BK.js.map → chunk-4ZZWZSWI.js.map} +1 -1
  17. package/dist/{chunk-B7JU52YQ.cjs → chunk-7ALBSPYR.cjs} +34 -35
  18. package/dist/chunk-7ALBSPYR.cjs.map +1 -0
  19. package/dist/{chunk-TGTP5DKF.js → chunk-7NFY3M3W.js} +10 -10
  20. package/dist/{chunk-TGTP5DKF.js.map → chunk-7NFY3M3W.js.map} +1 -1
  21. package/dist/{chunk-E4UF4XZM.js → chunk-7SB2MJA4.js} +4 -4
  22. package/dist/{chunk-E4UF4XZM.js.map → chunk-7SB2MJA4.js.map} +1 -1
  23. package/dist/{chunk-ERV666AR.js → chunk-ABJJ3LII.js} +9 -10
  24. package/dist/chunk-ABJJ3LII.js.map +1 -0
  25. package/dist/{chunk-NFGUJ52G.cjs → chunk-BIGGXHAW.cjs} +8 -2
  26. package/dist/chunk-BIGGXHAW.cjs.map +1 -0
  27. package/dist/{chunk-O7MINPKZ.js → chunk-C7QZE5BI.js} +9 -10
  28. package/dist/chunk-C7QZE5BI.js.map +1 -0
  29. package/dist/{chunk-IYGF7PZY.cjs → chunk-CWTUWNV3.cjs} +25 -26
  30. package/dist/chunk-CWTUWNV3.cjs.map +1 -0
  31. package/dist/{chunk-4MXECBZT.js → chunk-DC4CQCK5.js} +40 -13
  32. package/dist/chunk-DC4CQCK5.js.map +1 -0
  33. package/dist/{chunk-PGAPZ6UE.cjs → chunk-DS6HN3YR.cjs} +34 -35
  34. package/dist/chunk-DS6HN3YR.cjs.map +1 -0
  35. package/dist/{chunk-U5VFJVQ2.js → chunk-FDQR4GAZ.js} +3 -4
  36. package/dist/chunk-FDQR4GAZ.js.map +1 -0
  37. package/dist/{chunk-DPNCCWOV.js → chunk-FKGMSOJF.js} +8 -9
  38. package/dist/chunk-FKGMSOJF.js.map +1 -0
  39. package/dist/{chunk-SPSKDNEE.js → chunk-G6PXJ2SA.js} +11 -12
  40. package/dist/chunk-G6PXJ2SA.js.map +1 -0
  41. package/dist/{chunk-C4PSJ3ZC.js → chunk-HNLRVRQR.js} +8 -2
  42. package/dist/chunk-HNLRVRQR.js.map +1 -0
  43. package/dist/{chunk-FISEZBLF.cjs → chunk-J3C72RPK.cjs} +7 -7
  44. package/dist/{chunk-FISEZBLF.cjs.map → chunk-J3C72RPK.cjs.map} +1 -1
  45. package/dist/{chunk-SHDSOOBF.cjs → chunk-KFLIDTDU.cjs} +25 -26
  46. package/dist/chunk-KFLIDTDU.cjs.map +1 -0
  47. package/dist/{chunk-W6UMY7PF.cjs → chunk-KHKH5LCT.cjs} +7 -8
  48. package/dist/chunk-KHKH5LCT.cjs.map +1 -0
  49. package/dist/{chunk-7F2YQWMW.cjs → chunk-LBEKRN6Y.cjs} +122 -11
  50. package/dist/chunk-LBEKRN6Y.cjs.map +1 -0
  51. package/dist/{chunk-6RIM5EQP.cjs → chunk-LPUWXIPR.cjs} +197 -12
  52. package/dist/chunk-LPUWXIPR.cjs.map +1 -0
  53. package/dist/{chunk-XS6OYYVR.cjs → chunk-MKXEM2C5.cjs} +19 -20
  54. package/dist/chunk-MKXEM2C5.cjs.map +1 -0
  55. package/dist/{chunk-CXIP7ERK.js → chunk-MXNC5UNO.js} +182 -8
  56. package/dist/chunk-MXNC5UNO.js.map +1 -0
  57. package/dist/{chunk-MXZHL4U5.cjs → chunk-NAK55BYU.cjs} +31 -32
  58. package/dist/chunk-NAK55BYU.cjs.map +1 -0
  59. package/dist/{chunk-UKUHVCZX.cjs → chunk-NDBMKGQ5.cjs} +5 -5
  60. package/dist/{chunk-UKUHVCZX.cjs.map → chunk-NDBMKGQ5.cjs.map} +1 -1
  61. package/dist/{chunk-XYJBRKBZ.js → chunk-ORT3KLGI.js} +3 -4
  62. package/dist/chunk-ORT3KLGI.js.map +1 -0
  63. package/dist/{chunk-JMEZYYCE.js → chunk-PWHECW6N.js} +11 -12
  64. package/dist/chunk-PWHECW6N.js.map +1 -0
  65. package/dist/{chunk-6GQLCCGN.js → chunk-RBS5A2DF.js} +9 -10
  66. package/dist/chunk-RBS5A2DF.js.map +1 -0
  67. package/dist/{chunk-B4JRBV56.cjs → chunk-RPWUDXG5.cjs} +6 -6
  68. package/dist/{chunk-B4JRBV56.cjs.map → chunk-RPWUDXG5.cjs.map} +1 -1
  69. package/dist/{chunk-KI6DJ5ZF.js → chunk-TCDJY3H6.js} +9 -10
  70. package/dist/chunk-TCDJY3H6.js.map +1 -0
  71. package/dist/{chunk-DZ7VLLDQ.cjs → chunk-TP5UMRAU.cjs} +66 -39
  72. package/dist/chunk-TP5UMRAU.cjs.map +1 -0
  73. package/dist/{chunk-HYOUMTPW.js → chunk-TS7J6DTY.js} +3 -3
  74. package/dist/{chunk-HYOUMTPW.js.map → chunk-TS7J6DTY.js.map} +1 -1
  75. package/dist/{chunk-OJGTJOWI.cjs → chunk-TUVENMXB.cjs} +2 -2
  76. package/dist/chunk-TUVENMXB.cjs.map +1 -0
  77. package/dist/{chunk-WZ2TBXVB.cjs → chunk-V6BA44DS.cjs} +18 -18
  78. package/dist/{chunk-WZ2TBXVB.cjs.map → chunk-V6BA44DS.cjs.map} +1 -1
  79. package/dist/{chunk-2OP5YHRR.js → chunk-XO5R73Y4.js} +120 -10
  80. package/dist/chunk-XO5R73Y4.js.map +1 -0
  81. package/dist/{chunk-QAZO3ANW.cjs → chunk-YY4PFR3Z.cjs} +34 -35
  82. package/dist/chunk-YY4PFR3Z.cjs.map +1 -0
  83. package/dist/{chunk-RX3A6KIY.js → chunk-ZPI6Q42R.js} +2 -2
  84. package/dist/chunk-ZPI6Q42R.js.map +1 -0
  85. package/dist/components/ActivityPreview.cjs +16 -18
  86. package/dist/components/ActivityPreview.d.cts +2 -2
  87. package/dist/components/ActivityPreview.d.ts +2 -2
  88. package/dist/components/ActivityPreview.js +15 -17
  89. package/dist/components/ActivitySequence.cjs +17 -19
  90. package/dist/components/ActivitySequence.d.cts +2 -2
  91. package/dist/components/ActivitySequence.d.ts +2 -2
  92. package/dist/components/ActivitySequence.js +16 -18
  93. package/dist/components/Dictation.cjs +9 -11
  94. package/dist/components/Dictation.d.cts +1 -1
  95. package/dist/components/Dictation.d.ts +1 -1
  96. package/dist/components/Dictation.js +8 -10
  97. package/dist/components/FillInTheBlanks.cjs +9 -11
  98. package/dist/components/FillInTheBlanks.d.cts +1 -1
  99. package/dist/components/FillInTheBlanks.d.ts +1 -1
  100. package/dist/components/FillInTheBlanks.js +8 -10
  101. package/dist/components/GapSelect.cjs +9 -11
  102. package/dist/components/GapSelect.d.cts +1 -1
  103. package/dist/components/GapSelect.d.ts +1 -1
  104. package/dist/components/GapSelect.js +8 -10
  105. package/dist/components/InteractiveVideo.cjs +16 -18
  106. package/dist/components/InteractiveVideo.d.cts +2 -2
  107. package/dist/components/InteractiveVideo.d.ts +2 -2
  108. package/dist/components/InteractiveVideo.js +14 -16
  109. package/dist/components/MultipleChoice.cjs +9 -11
  110. package/dist/components/MultipleChoice.d.cts +1 -1
  111. package/dist/components/MultipleChoice.d.ts +1 -1
  112. package/dist/components/MultipleChoice.js +8 -10
  113. package/dist/components/PronunciationFeedback.cjs +6 -5
  114. package/dist/components/PronunciationFeedback.d.cts +28 -7
  115. package/dist/components/PronunciationFeedback.d.ts +28 -7
  116. package/dist/components/PronunciationFeedback.js +5 -4
  117. package/dist/components/ReadAloud.cjs +9 -9
  118. package/dist/components/ReadAloud.d.cts +2 -2
  119. package/dist/components/ReadAloud.d.ts +2 -2
  120. package/dist/components/ReadAloud.js +8 -8
  121. package/dist/components/StimulusPanel.cjs +4 -4
  122. package/dist/components/StimulusPanel.d.cts +1 -1
  123. package/dist/components/StimulusPanel.d.ts +1 -1
  124. package/dist/components/StimulusPanel.js +3 -3
  125. package/dist/components/WrittenResponse.cjs +8 -10
  126. package/dist/components/WrittenResponse.d.cts +3 -3
  127. package/dist/components/WrittenResponse.d.ts +3 -3
  128. package/dist/components/WrittenResponse.js +7 -9
  129. package/dist/i18n/LkIntlProvider.cjs +7 -7
  130. package/dist/i18n/LkIntlProvider.d.cts +2 -2
  131. package/dist/i18n/LkIntlProvider.d.ts +2 -2
  132. package/dist/i18n/LkIntlProvider.js +1 -1
  133. package/dist/index.cjs +58 -56
  134. package/dist/index.cjs.map +1 -1
  135. package/dist/index.d.cts +3 -3
  136. package/dist/index.d.ts +3 -3
  137. package/dist/index.js +18 -20
  138. package/dist/index.js.map +1 -1
  139. package/dist/theme/skin.css +55 -9
  140. package/dist/{types-CrtIcRcK.d.ts → types-C4IsUQsK.d.ts} +16 -0
  141. package/dist/{types-CO0XLEN6.d.cts → types-CJgZWtl4.d.cts} +16 -0
  142. package/package.json +3 -3
  143. package/dist/chunk-2OP5YHRR.js.map +0 -1
  144. package/dist/chunk-4MXECBZT.js.map +0 -1
  145. package/dist/chunk-54DX6SLS.cjs +0 -42
  146. package/dist/chunk-54DX6SLS.cjs.map +0 -1
  147. package/dist/chunk-6GQLCCGN.js.map +0 -1
  148. package/dist/chunk-6RIM5EQP.cjs.map +0 -1
  149. package/dist/chunk-7F2YQWMW.cjs.map +0 -1
  150. package/dist/chunk-B7JU52YQ.cjs.map +0 -1
  151. package/dist/chunk-C4PSJ3ZC.js.map +0 -1
  152. package/dist/chunk-CXIP7ERK.js.map +0 -1
  153. package/dist/chunk-DPNCCWOV.js.map +0 -1
  154. package/dist/chunk-DXFCYNST.js +0 -35
  155. package/dist/chunk-DXFCYNST.js.map +0 -1
  156. package/dist/chunk-DZ7VLLDQ.cjs.map +0 -1
  157. package/dist/chunk-ERV666AR.js.map +0 -1
  158. package/dist/chunk-IYGF7PZY.cjs.map +0 -1
  159. package/dist/chunk-J2QIHZ3H.cjs +0 -27
  160. package/dist/chunk-J2QIHZ3H.cjs.map +0 -1
  161. package/dist/chunk-JMEZYYCE.js.map +0 -1
  162. package/dist/chunk-KI6DJ5ZF.js.map +0 -1
  163. package/dist/chunk-MXZHL4U5.cjs.map +0 -1
  164. package/dist/chunk-NFGUJ52G.cjs.map +0 -1
  165. package/dist/chunk-O7MINPKZ.js.map +0 -1
  166. package/dist/chunk-OJGTJOWI.cjs.map +0 -1
  167. package/dist/chunk-PGAPZ6UE.cjs.map +0 -1
  168. package/dist/chunk-QAZO3ANW.cjs.map +0 -1
  169. package/dist/chunk-RX3A6KIY.js.map +0 -1
  170. package/dist/chunk-SHDSOOBF.cjs.map +0 -1
  171. package/dist/chunk-SPSKDNEE.js.map +0 -1
  172. package/dist/chunk-U4KTOH7C.js +0 -22
  173. package/dist/chunk-U4KTOH7C.js.map +0 -1
  174. package/dist/chunk-U5VFJVQ2.js.map +0 -1
  175. package/dist/chunk-VPU6UY4O.cjs.map +0 -1
  176. package/dist/chunk-W6UMY7PF.cjs.map +0 -1
  177. package/dist/chunk-XS6OYYVR.cjs.map +0 -1
  178. package/dist/chunk-XYJBRKBZ.js.map +0 -1
@@ -1,27 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- var react = require('react');
5
-
6
- // src/components/shared/sequence-slot.ts
7
- var SequenceSlotContext = react.createContext(null);
8
- var lastTake = 0;
9
- function mintTake() {
10
- lastTake += 1;
11
- return lastTake;
12
- }
13
- var takes = /* @__PURE__ */ new WeakMap();
14
- function stampTake(value, take) {
15
- takes.set(value, take);
16
- return value;
17
- }
18
- function takeOf(value) {
19
- return typeof value === "object" && value !== null ? takes.get(value) : void 0;
20
- }
21
-
22
- exports.SequenceSlotContext = SequenceSlotContext;
23
- exports.mintTake = mintTake;
24
- exports.stampTake = stampTake;
25
- exports.takeOf = takeOf;
26
- //# sourceMappingURL=chunk-J2QIHZ3H.cjs.map
27
- //# sourceMappingURL=chunk-J2QIHZ3H.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/shared/sequence-slot.ts"],"names":["createContext"],"mappings":";;;;;AAoFO,IAAM,mBAAA,GAAsBA,oBAA0C,IAAI;AASjF,IAAI,QAAA,GAAW,CAAA;AAGR,SAAS,QAAA,GAAmB;AACjC,EAAA,QAAA,IAAY,CAAA;AACZ,EAAA,OAAO,QAAA;AACT;AAOA,IAAM,KAAA,uBAAY,OAAA,EAAwB;AAGnC,SAAS,SAAA,CAA4B,OAAU,IAAA,EAAiB;AACrE,EAAA,KAAA,CAAM,GAAA,CAAI,OAAO,IAAI,CAAA;AACrB,EAAA,OAAO,KAAA;AACT;AAGO,SAAS,OAAO,KAAA,EAAoC;AACzD,EAAA,OAAO,OAAO,UAAU,QAAA,IAAY,KAAA,KAAU,OAAO,KAAA,CAAM,GAAA,CAAI,KAAK,CAAA,GAAI,MAAA;AAC1E","file":"chunk-J2QIHZ3H.cjs","sourcesContent":["'use client';\n\nimport type { ResolvedDeliveryPolicy, ResolvedItemScoringPolicy } from '@intellectif/lk-core';\nimport { createContext } from 'react';\nimport type { RenderMode } from '../types.js';\n\n/**\n * How far a take that was handed in has got, as a pager deciding whether its\n * set is finished needs to know it.\n *\n * - `in-flight` — being stored or being judged. The set waits for it.\n * - `retryable` — it failed, and the learner is being offered another try at\n * the SAME take. The set waits for it while the learner is on that question.\n * - `settled` — nothing more will come of it: a grade, a take with no grade, a\n * failure nobody can retry, or a take the learner walked away from.\n */\nexport type TakeState = 'in-flight' | 'retryable' | 'settled';\n\n/**\n * Where a question is with its tries, as a pager deciding whether its set is\n * finished needs to know it.\n *\n * - `offered` — a graded answer short of full marks, with another try on offer.\n * The set waits for it while the learner is on that question: leaving it is\n * declining the try.\n * - `retrying` — the learner pressed \"Try again\" and has not answered again.\n * The set waits for it wherever the learner is, as it waits for any question\n * not yet answered: the grade it holds is the one being replaced.\n * - `none` — neither.\n */\nexport type TriesState = 'none' | 'offered' | 'retrying';\n\n/**\n * What a pager hands the one slot it renders, and only through\n * {@link SequenceSlotContext} — never as a prop, so none of it can appear on a\n * public component's signature. A consumer string in any of it could stop\n * another component's microphone or finish another paper's set.\n */\nexport interface SequenceSlotChannel {\n /**\n * The capture-registry group whose captures stop when the slot's pane is\n * hidden. Minted per pager and per slot, so no two pagers share one.\n */\n readonly captureGroup: string;\n /**\n * The mode the PAPER around this question is being delivered in, read live.\n *\n * It is how the AI hooks know an exam they were not told about. A host that\n * draws its own question passes `renderMode` on to them, but nothing makes\n * it: the hooks would then default to `practice` and, under an\n * `LkAiProvider` somewhere above, offer hints on a paper of record. The set\n * around the question decides, and an `exam` here wins over anything the\n * caller passes or forgets to pass.\n */\n readonly renderMode: RenderMode;\n /**\n * The delivery policy of the PAPER around this question, read live, for the\n * same reason as the mode: whatever a host's own question was handed, the\n * paper's restrictions hold in it. See `useDeliveryPolicy`.\n */\n readonly delivery: ResolvedDeliveryPolicy;\n /**\n * The scoring policy of the PAPER around this question, read live, when the\n * paper was given one: it holds for every question in it, however drawn.\n * `undefined` when the paper has none, so a question's own applies.\n */\n readonly scoring: ResolvedItemScoringPolicy | undefined;\n /**\n * Whether the paper has closed every question's tries: it reported its set,\n * or its learner finished. A \"Try again\" after that would change a grade the\n * paper has already handed on.\n */\n readonly triesClosed: boolean;\n /** Tells the paper where this question is with its tries: see {@link TriesState}. */\n triesState(state: TriesState): void;\n /**\n * Reports the state of the take numbered `take`, a number from\n * {@link mintTake}. A take numbered below the slot's latest is a take the\n * learner has since replaced, and the pager ignores it.\n */\n takeState(take: number, state: TakeState): void;\n}\n\n/** `null` outside a pager: a standalone component belongs to no slot. */\nexport const SequenceSlotContext = createContext<SequenceSlotChannel | null>(null);\n\n/**\n * The last take number handed out. Module-level and never reset, so a number\n * is unique for the life of the page: across mounts, across papers, and across\n * two pagers side by side. A result can therefore only ever match the take that\n * produced it, whatever slot and activity ids a later paper reuses — ids a host\n * chooses, and can repeat, never decide it.\n */\nlet lastTake = 0;\n\n/** A take number no other take on this page has had, or will have. */\nexport function mintTake(): number {\n lastTake += 1;\n return lastTake;\n}\n\n/**\n * The take each reported value belongs to. A `WeakMap` rather than a field, so\n * a response or a result a host receives carries no extra key it would persist\n * or compare, and the number never outlives the object.\n */\nconst takes = new WeakMap<object, number>();\n\n/** Marks `value` as produced by take `take`, and returns it. */\nexport function stampTake<T extends object>(value: T, take: number): T {\n takes.set(value, take);\n return value;\n}\n\n/** The take `value` was produced by, or `undefined` when nothing stamped it. */\nexport function takeOf(value: unknown): number | undefined {\n return typeof value === 'object' && value !== null ? takes.get(value) : undefined;\n}\n"]}