@intellectif/lk-react 14.1.0 → 15.0.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 (131) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -2
  3. package/dist/{WrittenResponse-rRpOr9W1.d.cts → WrittenResponse-BPbhERgk.d.cts} +1 -1
  4. package/dist/{WrittenResponse-DrzI89Wg.d.ts → WrittenResponse-ZAxLR_AU.d.ts} +1 -1
  5. package/dist/{chunk-4Y5TELVU.cjs → chunk-26GQO5I2.cjs} +12 -12
  6. package/dist/{chunk-4Y5TELVU.cjs.map → chunk-26GQO5I2.cjs.map} +1 -1
  7. package/dist/chunk-2HAEQDHQ.js +2330 -0
  8. package/dist/chunk-2HAEQDHQ.js.map +1 -0
  9. package/dist/{chunk-NJAF34GN.js → chunk-33BQNWAQ.js} +5 -5
  10. package/dist/{chunk-NJAF34GN.js.map → chunk-33BQNWAQ.js.map} +1 -1
  11. package/dist/{chunk-N536RUCZ.cjs → chunk-4H3JTX74.cjs} +13 -13
  12. package/dist/{chunk-N536RUCZ.cjs.map → chunk-4H3JTX74.cjs.map} +1 -1
  13. package/dist/{chunk-AWQ53DON.js → chunk-52GXJNQ3.js} +83 -2
  14. package/dist/chunk-52GXJNQ3.js.map +1 -0
  15. package/dist/{chunk-DPEY7DSE.cjs → chunk-53YOZOGN.cjs} +5 -5
  16. package/dist/{chunk-DPEY7DSE.cjs.map → chunk-53YOZOGN.cjs.map} +1 -1
  17. package/dist/{chunk-U432HTUW.js → chunk-AF72QUBI.js} +5 -5
  18. package/dist/{chunk-U432HTUW.js.map → chunk-AF72QUBI.js.map} +1 -1
  19. package/dist/{chunk-IDYZ2FA2.js → chunk-CE6OGJE6.js} +5 -5
  20. package/dist/{chunk-IDYZ2FA2.js.map → chunk-CE6OGJE6.js.map} +1 -1
  21. package/dist/{chunk-CTW3G3EH.cjs → chunk-DP3DM7FR.cjs} +6 -6
  22. package/dist/{chunk-CTW3G3EH.cjs.map → chunk-DP3DM7FR.cjs.map} +1 -1
  23. package/dist/{chunk-MZITNWZ2.cjs → chunk-DQ3VVU5T.cjs} +24 -24
  24. package/dist/{chunk-MZITNWZ2.cjs.map → chunk-DQ3VVU5T.cjs.map} +1 -1
  25. package/dist/{chunk-PSUKWVKU.cjs → chunk-EKBEKDWO.cjs} +13 -13
  26. package/dist/{chunk-PSUKWVKU.cjs.map → chunk-EKBEKDWO.cjs.map} +1 -1
  27. package/dist/{chunk-RXS455MR.js → chunk-EVBYEWHO.js} +3 -2
  28. package/dist/chunk-EVBYEWHO.js.map +1 -0
  29. package/dist/{chunk-UMDWVMB5.cjs → chunk-FKGUKFC7.cjs} +5 -5
  30. package/dist/{chunk-UMDWVMB5.cjs.map → chunk-FKGUKFC7.cjs.map} +1 -1
  31. package/dist/{chunk-RCPW6HVY.js → chunk-H6I2JDNW.js} +10 -10
  32. package/dist/{chunk-RCPW6HVY.js.map → chunk-H6I2JDNW.js.map} +1 -1
  33. package/dist/{chunk-DB4DLHN6.js → chunk-HA3VRF6E.js} +3 -3
  34. package/dist/{chunk-DB4DLHN6.js.map → chunk-HA3VRF6E.js.map} +1 -1
  35. package/dist/{chunk-UDZWYHDV.js → chunk-I2QGW4GD.js} +11 -11
  36. package/dist/{chunk-UDZWYHDV.js.map → chunk-I2QGW4GD.js.map} +1 -1
  37. package/dist/{chunk-5CP2Z6IS.js → chunk-IE5ZNCWN.js} +5 -5
  38. package/dist/{chunk-5CP2Z6IS.js.map → chunk-IE5ZNCWN.js.map} +1 -1
  39. package/dist/{chunk-JG4DWAUJ.cjs → chunk-L7NE7PR4.cjs} +13 -13
  40. package/dist/{chunk-JG4DWAUJ.cjs.map → chunk-L7NE7PR4.cjs.map} +1 -1
  41. package/dist/{chunk-5JFMXBH7.js → chunk-QEB6O6GU.js} +6 -6
  42. package/dist/{chunk-5JFMXBH7.js.map → chunk-QEB6O6GU.js.map} +1 -1
  43. package/dist/{chunk-TUVEJLOT.js → chunk-QM4AV6EG.js} +4 -4
  44. package/dist/{chunk-TUVEJLOT.js.map → chunk-QM4AV6EG.js.map} +1 -1
  45. package/dist/{chunk-UDQS5INQ.js → chunk-RT5FTHUU.js} +5 -5
  46. package/dist/{chunk-UDQS5INQ.js.map → chunk-RT5FTHUU.js.map} +1 -1
  47. package/dist/chunk-SRD4KVAP.cjs +2332 -0
  48. package/dist/chunk-SRD4KVAP.cjs.map +1 -0
  49. package/dist/{chunk-5JCTJFQU.cjs → chunk-UAYWLYFW.cjs} +18 -18
  50. package/dist/{chunk-5JCTJFQU.cjs.map → chunk-UAYWLYFW.cjs.map} +1 -1
  51. package/dist/{chunk-D4DQFTA7.cjs → chunk-UCKA22ZJ.cjs} +3 -2
  52. package/dist/chunk-UCKA22ZJ.cjs.map +1 -0
  53. package/dist/{chunk-YM64MS4G.cjs → chunk-WKOV25NP.cjs} +8 -8
  54. package/dist/{chunk-YM64MS4G.cjs.map → chunk-WKOV25NP.cjs.map} +1 -1
  55. package/dist/{chunk-WC4OD3EE.cjs → chunk-XMJE34FY.cjs} +13 -13
  56. package/dist/{chunk-WC4OD3EE.cjs.map → chunk-XMJE34FY.cjs.map} +1 -1
  57. package/dist/{chunk-AS2QGND5.js → chunk-YWQH35VO.js} +4 -4
  58. package/dist/{chunk-AS2QGND5.js.map → chunk-YWQH35VO.js.map} +1 -1
  59. package/dist/{chunk-VSFHJ7FB.cjs → chunk-Z6TVOAO5.cjs} +83 -2
  60. package/dist/chunk-Z6TVOAO5.cjs.map +1 -0
  61. package/dist/{chunk-KIO6QXGT.cjs → chunk-ZH5WT2IE.cjs} +25 -25
  62. package/dist/{chunk-KIO6QXGT.cjs.map → chunk-ZH5WT2IE.cjs.map} +1 -1
  63. package/dist/{chunk-B4BCEQNO.js → chunk-ZJMTHPHY.js} +3 -3
  64. package/dist/{chunk-B4BCEQNO.js.map → chunk-ZJMTHPHY.js.map} +1 -1
  65. package/dist/components/ActivityPreview.cjs +12 -12
  66. package/dist/components/ActivityPreview.d.cts +2 -2
  67. package/dist/components/ActivityPreview.d.ts +2 -2
  68. package/dist/components/ActivityPreview.js +11 -11
  69. package/dist/components/ActivitySequence.cjs +13 -13
  70. package/dist/components/ActivitySequence.d.cts +2 -2
  71. package/dist/components/ActivitySequence.d.ts +2 -2
  72. package/dist/components/ActivitySequence.js +12 -12
  73. package/dist/components/Dictation.cjs +5 -5
  74. package/dist/components/Dictation.d.cts +1 -1
  75. package/dist/components/Dictation.d.ts +1 -1
  76. package/dist/components/Dictation.js +4 -4
  77. package/dist/components/FillInTheBlanks.cjs +5 -5
  78. package/dist/components/FillInTheBlanks.d.cts +1 -1
  79. package/dist/components/FillInTheBlanks.d.ts +1 -1
  80. package/dist/components/FillInTheBlanks.js +4 -4
  81. package/dist/components/GapSelect.cjs +5 -5
  82. package/dist/components/GapSelect.d.cts +1 -1
  83. package/dist/components/GapSelect.d.ts +1 -1
  84. package/dist/components/GapSelect.js +4 -4
  85. package/dist/components/InteractiveVideo.cjs +26 -0
  86. package/dist/components/InteractiveVideo.cjs.map +1 -0
  87. package/dist/components/InteractiveVideo.d.cts +77 -0
  88. package/dist/components/InteractiveVideo.d.ts +77 -0
  89. package/dist/components/InteractiveVideo.js +17 -0
  90. package/dist/components/InteractiveVideo.js.map +1 -0
  91. package/dist/components/MultipleChoice.cjs +5 -5
  92. package/dist/components/MultipleChoice.d.cts +1 -1
  93. package/dist/components/MultipleChoice.d.ts +1 -1
  94. package/dist/components/MultipleChoice.js +4 -4
  95. package/dist/components/PronunciationFeedback.cjs +4 -4
  96. package/dist/components/PronunciationFeedback.d.cts +1 -1
  97. package/dist/components/PronunciationFeedback.d.ts +1 -1
  98. package/dist/components/PronunciationFeedback.js +3 -3
  99. package/dist/components/ReadAloud.cjs +6 -6
  100. package/dist/components/ReadAloud.d.cts +2 -2
  101. package/dist/components/ReadAloud.d.ts +2 -2
  102. package/dist/components/ReadAloud.js +5 -5
  103. package/dist/components/StimulusPanel.cjs +4 -4
  104. package/dist/components/StimulusPanel.d.cts +1 -1
  105. package/dist/components/StimulusPanel.d.ts +1 -1
  106. package/dist/components/StimulusPanel.js +3 -3
  107. package/dist/components/WrittenResponse.cjs +5 -5
  108. package/dist/components/WrittenResponse.d.cts +3 -3
  109. package/dist/components/WrittenResponse.d.ts +3 -3
  110. package/dist/components/WrittenResponse.js +4 -4
  111. package/dist/i18n/LkIntlProvider.cjs +7 -7
  112. package/dist/i18n/LkIntlProvider.d.cts +2 -2
  113. package/dist/i18n/LkIntlProvider.d.ts +2 -2
  114. package/dist/i18n/LkIntlProvider.js +1 -1
  115. package/dist/index.cjs +44 -39
  116. package/dist/index.cjs.map +1 -1
  117. package/dist/index.d.cts +3 -2
  118. package/dist/index.d.ts +3 -2
  119. package/dist/index.js +15 -14
  120. package/dist/index.js.map +1 -1
  121. package/dist/{strings-wjAF2ONm.d.cts → strings-5588Q4Te.d.cts} +102 -1
  122. package/dist/{strings-l8Wv1Xax.d.ts → strings-D0IWcsUm.d.ts} +102 -1
  123. package/dist/theme/ThemeProvider.cjs +6 -6
  124. package/dist/theme/ThemeProvider.js +1 -1
  125. package/dist/theme/defaults.css +2 -0
  126. package/dist/theme/skin.css +1348 -0
  127. package/package.json +13 -3
  128. package/dist/chunk-AWQ53DON.js.map +0 -1
  129. package/dist/chunk-D4DQFTA7.cjs.map +0 -1
  130. package/dist/chunk-RXS455MR.js.map +0 -1
  131. package/dist/chunk-VSFHJ7FB.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- export { MultipleChoice } from '../chunk-UDQS5INQ.js';
2
+ export { MultipleChoice } from '../chunk-RT5FTHUU.js';
3
3
  import '../chunk-RCMYEWBE.js';
4
- import '../chunk-B4BCEQNO.js';
5
- import '../chunk-DB4DLHN6.js';
4
+ import '../chunk-ZJMTHPHY.js';
5
+ import '../chunk-HA3VRF6E.js';
6
6
  import '../chunk-6N43WDVG.js';
7
- import '../chunk-AWQ53DON.js';
7
+ import '../chunk-52GXJNQ3.js';
8
8
  //# sourceMappingURL=MultipleChoice.js.map
9
9
  //# sourceMappingURL=MultipleChoice.js.map
@@ -1,16 +1,16 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkYM64MS4G_cjs = require('../chunk-YM64MS4G.cjs');
4
+ var chunkWKOV25NP_cjs = require('../chunk-WKOV25NP.cjs');
5
5
  require('../chunk-OD65OZIW.cjs');
6
- require('../chunk-DPEY7DSE.cjs');
7
- require('../chunk-VSFHJ7FB.cjs');
6
+ require('../chunk-53YOZOGN.cjs');
7
+ require('../chunk-Z6TVOAO5.cjs');
8
8
 
9
9
 
10
10
 
11
11
  Object.defineProperty(exports, "PronunciationFeedback", {
12
12
  enumerable: true,
13
- get: function () { return chunkYM64MS4G_cjs.PronunciationFeedback; }
13
+ get: function () { return chunkWKOV25NP_cjs.PronunciationFeedback; }
14
14
  });
15
15
  //# sourceMappingURL=PronunciationFeedback.cjs.map
16
16
  //# sourceMappingURL=PronunciationFeedback.cjs.map
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReadAloudData, SpeechAssessment, GradeRecord, ThemeTokens } from '@intellectif/lk-core';
3
- import { a as LkStringsOverride } from '../strings-wjAF2ONm.cjs';
3
+ import { a as LkStringsOverride } from '../strings-5588Q4Te.cjs';
4
4
  import '../machine-CuwKqWXC.cjs';
5
5
 
6
6
  interface PronunciationFeedbackProps {
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReadAloudData, SpeechAssessment, GradeRecord, ThemeTokens } from '@intellectif/lk-core';
3
- import { a as LkStringsOverride } from '../strings-l8Wv1Xax.js';
3
+ import { a as LkStringsOverride } from '../strings-D0IWcsUm.js';
4
4
  import '../machine-CuwKqWXC.js';
5
5
 
6
6
  interface PronunciationFeedbackProps {
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- export { PronunciationFeedback } from '../chunk-TUVEJLOT.js';
2
+ export { PronunciationFeedback } from '../chunk-QM4AV6EG.js';
3
3
  import '../chunk-YORQQXGO.js';
4
- import '../chunk-B4BCEQNO.js';
5
- import '../chunk-AWQ53DON.js';
4
+ import '../chunk-ZJMTHPHY.js';
5
+ import '../chunk-52GXJNQ3.js';
6
6
  //# sourceMappingURL=PronunciationFeedback.js.map
7
7
  //# sourceMappingURL=PronunciationFeedback.js.map
@@ -1,21 +1,21 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkKIO6QXGT_cjs = require('../chunk-KIO6QXGT.cjs');
5
- require('../chunk-YM64MS4G.cjs');
4
+ var chunkZH5WT2IE_cjs = require('../chunk-ZH5WT2IE.cjs');
5
+ require('../chunk-WKOV25NP.cjs');
6
6
  require('../chunk-UDCQTOVU.cjs');
7
7
  require('../chunk-OD65OZIW.cjs');
8
8
  require('../chunk-BRPEB43C.cjs');
9
- require('../chunk-DPEY7DSE.cjs');
10
- require('../chunk-UMDWVMB5.cjs');
9
+ require('../chunk-53YOZOGN.cjs');
10
+ require('../chunk-FKGUKFC7.cjs');
11
11
  require('../chunk-XOR4MPEN.cjs');
12
- require('../chunk-VSFHJ7FB.cjs');
12
+ require('../chunk-Z6TVOAO5.cjs');
13
13
 
14
14
 
15
15
 
16
16
  Object.defineProperty(exports, "ReadAloud", {
17
17
  enumerable: true,
18
- get: function () { return chunkKIO6QXGT_cjs.ReadAloud; }
18
+ get: function () { return chunkZH5WT2IE_cjs.ReadAloud; }
19
19
  });
20
20
  //# sourceMappingURL=ReadAloud.cjs.map
21
21
  //# sourceMappingURL=ReadAloud.cjs.map
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { c as ReadAloudProps } from '../strings-wjAF2ONm.cjs';
3
- export { R as ReadAloudAssessResult, d as RecordingBinding } from '../strings-wjAF2ONm.cjs';
2
+ import { c as ReadAloudProps } from '../strings-5588Q4Te.cjs';
3
+ export { R as ReadAloudAssessResult, d as RecordingBinding } from '../strings-5588Q4Te.cjs';
4
4
  export { R as RecordedTake } from '../machine-CuwKqWXC.cjs';
5
5
  import '@intellectif/lk-core';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { c as ReadAloudProps } from '../strings-l8Wv1Xax.js';
3
- export { R as ReadAloudAssessResult, d as RecordingBinding } from '../strings-l8Wv1Xax.js';
2
+ import { c as ReadAloudProps } from '../strings-D0IWcsUm.js';
3
+ export { R as ReadAloudAssessResult, d as RecordingBinding } from '../strings-D0IWcsUm.js';
4
4
  export { R as RecordedTake } from '../machine-CuwKqWXC.js';
5
5
  import '@intellectif/lk-core';
6
6
 
@@ -1,12 +1,12 @@
1
1
  'use client';
2
- export { ReadAloud } from '../chunk-5JFMXBH7.js';
3
- import '../chunk-TUVEJLOT.js';
2
+ export { ReadAloud } from '../chunk-QEB6O6GU.js';
3
+ import '../chunk-QM4AV6EG.js';
4
4
  import '../chunk-MCO52PV5.js';
5
5
  import '../chunk-YORQQXGO.js';
6
6
  import '../chunk-RCMYEWBE.js';
7
- import '../chunk-B4BCEQNO.js';
8
- import '../chunk-DB4DLHN6.js';
7
+ import '../chunk-ZJMTHPHY.js';
8
+ import '../chunk-HA3VRF6E.js';
9
9
  import '../chunk-6N43WDVG.js';
10
- import '../chunk-AWQ53DON.js';
10
+ import '../chunk-52GXJNQ3.js';
11
11
  //# sourceMappingURL=ReadAloud.js.map
12
12
  //# sourceMappingURL=ReadAloud.js.map
@@ -1,15 +1,15 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkCTW3G3EH_cjs = require('../chunk-CTW3G3EH.cjs');
5
- require('../chunk-UMDWVMB5.cjs');
6
- require('../chunk-VSFHJ7FB.cjs');
4
+ var chunkDP3DM7FR_cjs = require('../chunk-DP3DM7FR.cjs');
5
+ require('../chunk-FKGUKFC7.cjs');
6
+ require('../chunk-Z6TVOAO5.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "StimulusPanel", {
11
11
  enumerable: true,
12
- get: function () { return chunkCTW3G3EH_cjs.StimulusPanel; }
12
+ get: function () { return chunkDP3DM7FR_cjs.StimulusPanel; }
13
13
  });
14
14
  //# sourceMappingURL=StimulusPanel.cjs.map
15
15
  //# sourceMappingURL=StimulusPanel.cjs.map
@@ -1,5 +1,5 @@
1
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 '../strings-wjAF2ONm.cjs';
2
+ import { H as HtmlSanitizer, e as RenderMode, M as MediaBudgetBinding, b as MediaTransportStrings, a as LkStringsOverride } from '../strings-5588Q4Te.cjs';
3
3
  import '../machine-CuwKqWXC.cjs';
4
4
 
5
5
  interface StimulusPanelProps {
@@ -1,5 +1,5 @@
1
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 '../strings-l8Wv1Xax.js';
2
+ import { H as HtmlSanitizer, e as RenderMode, M as MediaBudgetBinding, b as MediaTransportStrings, a as LkStringsOverride } from '../strings-D0IWcsUm.js';
3
3
  import '../machine-CuwKqWXC.js';
4
4
 
5
5
  interface StimulusPanelProps {
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- export { StimulusPanel } from '../chunk-AS2QGND5.js';
3
- import '../chunk-DB4DLHN6.js';
4
- import '../chunk-AWQ53DON.js';
2
+ export { StimulusPanel } from '../chunk-YWQH35VO.js';
3
+ import '../chunk-HA3VRF6E.js';
4
+ import '../chunk-52GXJNQ3.js';
5
5
  //# sourceMappingURL=StimulusPanel.js.map
6
6
  //# sourceMappingURL=StimulusPanel.js.map
@@ -1,18 +1,18 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunk4Y5TELVU_cjs = require('../chunk-4Y5TELVU.cjs');
4
+ var chunk26GQO5I2_cjs = require('../chunk-26GQO5I2.cjs');
5
5
  require('../chunk-BRPEB43C.cjs');
6
- require('../chunk-DPEY7DSE.cjs');
7
- require('../chunk-UMDWVMB5.cjs');
6
+ require('../chunk-53YOZOGN.cjs');
7
+ require('../chunk-FKGUKFC7.cjs');
8
8
  require('../chunk-XOR4MPEN.cjs');
9
- require('../chunk-VSFHJ7FB.cjs');
9
+ require('../chunk-Z6TVOAO5.cjs');
10
10
 
11
11
 
12
12
 
13
13
  Object.defineProperty(exports, "WrittenResponse", {
14
14
  enumerable: true,
15
- get: function () { return chunk4Y5TELVU_cjs.WrittenResponse; }
15
+ get: function () { return chunk26GQO5I2_cjs.WrittenResponse; }
16
16
  });
17
17
  //# sourceMappingURL=WrittenResponse.cjs.map
18
18
  //# sourceMappingURL=WrittenResponse.cjs.map
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { W as WrittenResponseProps } from '../WrittenResponse-rRpOr9W1.cjs';
3
- export { a as WrittenResponseSubmission } from '../WrittenResponse-rRpOr9W1.cjs';
4
- export { H as HtmlSanitizer, e as RenderMode, f as Renderable } from '../strings-wjAF2ONm.cjs';
2
+ import { W as WrittenResponseProps } from '../WrittenResponse-BPbhERgk.cjs';
3
+ export { a as WrittenResponseSubmission } from '../WrittenResponse-BPbhERgk.cjs';
4
+ export { H as HtmlSanitizer, e as RenderMode, f as Renderable } from '../strings-5588Q4Te.cjs';
5
5
  import '@intellectif/lk-core';
6
6
  import '../machine-CuwKqWXC.cjs';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { W as WrittenResponseProps } from '../WrittenResponse-DrzI89Wg.js';
3
- export { a as WrittenResponseSubmission } from '../WrittenResponse-DrzI89Wg.js';
4
- export { H as HtmlSanitizer, e as RenderMode, f as Renderable } from '../strings-l8Wv1Xax.js';
2
+ import { W as WrittenResponseProps } from '../WrittenResponse-ZAxLR_AU.js';
3
+ export { a as WrittenResponseSubmission } from '../WrittenResponse-ZAxLR_AU.js';
4
+ export { H as HtmlSanitizer, e as RenderMode, f as Renderable } from '../strings-D0IWcsUm.js';
5
5
  import '@intellectif/lk-core';
6
6
  import '../machine-CuwKqWXC.js';
7
7
 
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- export { WrittenResponse } from '../chunk-U432HTUW.js';
2
+ export { WrittenResponse } from '../chunk-AF72QUBI.js';
3
3
  import '../chunk-RCMYEWBE.js';
4
- import '../chunk-B4BCEQNO.js';
5
- import '../chunk-DB4DLHN6.js';
4
+ import '../chunk-ZJMTHPHY.js';
5
+ import '../chunk-HA3VRF6E.js';
6
6
  import '../chunk-6N43WDVG.js';
7
- import '../chunk-AWQ53DON.js';
7
+ import '../chunk-52GXJNQ3.js';
8
8
  //# sourceMappingURL=WrittenResponse.js.map
9
9
  //# sourceMappingURL=WrittenResponse.js.map
@@ -1,33 +1,33 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkVSFHJ7FB_cjs = require('../chunk-VSFHJ7FB.cjs');
4
+ var chunkZ6TVOAO5_cjs = require('../chunk-Z6TVOAO5.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "DEFAULT_STRINGS", {
9
9
  enumerable: true,
10
- get: function () { return chunkVSFHJ7FB_cjs.DEFAULT_STRINGS; }
10
+ get: function () { return chunkZ6TVOAO5_cjs.DEFAULT_STRINGS; }
11
11
  });
12
12
  Object.defineProperty(exports, "LkIntlProvider", {
13
13
  enumerable: true,
14
- get: function () { return chunkVSFHJ7FB_cjs.LkIntlProvider; }
14
+ get: function () { return chunkZ6TVOAO5_cjs.LkIntlProvider; }
15
15
  });
16
16
  Object.defineProperty(exports, "directionForLocale", {
17
17
  enumerable: true,
18
- get: function () { return chunkVSFHJ7FB_cjs.directionForLocale; }
18
+ get: function () { return chunkZ6TVOAO5_cjs.directionForLocale; }
19
19
  });
20
20
  Object.defineProperty(exports, "mergeStrings", {
21
21
  enumerable: true,
22
- get: function () { return chunkVSFHJ7FB_cjs.mergeStrings; }
22
+ get: function () { return chunkZ6TVOAO5_cjs.mergeStrings; }
23
23
  });
24
24
  Object.defineProperty(exports, "useLkDirection", {
25
25
  enumerable: true,
26
- get: function () { return chunkVSFHJ7FB_cjs.useLkDirection; }
26
+ get: function () { return chunkZ6TVOAO5_cjs.useLkDirection; }
27
27
  });
28
28
  Object.defineProperty(exports, "useLkStrings", {
29
29
  enumerable: true,
30
- get: function () { return chunkVSFHJ7FB_cjs.useLkStrings; }
30
+ get: function () { return chunkZ6TVOAO5_cjs.useLkStrings; }
31
31
  });
32
32
  //# sourceMappingURL=LkIntlProvider.cjs.map
33
33
  //# sourceMappingURL=LkIntlProvider.cjs.map
@@ -1,5 +1,5 @@
1
- import { a as LkStringsOverride, L as LkStrings } from '../strings-wjAF2ONm.cjs';
2
- export { D as DEFAULT_STRINGS, m as mergeStrings } from '../strings-wjAF2ONm.cjs';
1
+ import { a as LkStringsOverride, L as LkStrings } from '../strings-5588Q4Te.cjs';
2
+ export { D as DEFAULT_STRINGS, m as mergeStrings } from '../strings-5588Q4Te.cjs';
3
3
  import '@intellectif/lk-core';
4
4
  import '../machine-CuwKqWXC.cjs';
5
5
 
@@ -1,5 +1,5 @@
1
- import { a as LkStringsOverride, L as LkStrings } from '../strings-l8Wv1Xax.js';
2
- export { D as DEFAULT_STRINGS, m as mergeStrings } from '../strings-l8Wv1Xax.js';
1
+ import { a as LkStringsOverride, L as LkStrings } from '../strings-D0IWcsUm.js';
2
+ export { D as DEFAULT_STRINGS, m as mergeStrings } from '../strings-D0IWcsUm.js';
3
3
  import '@intellectif/lk-core';
4
4
  import '../machine-CuwKqWXC.js';
5
5
 
@@ -1,4 +1,4 @@
1
1
  'use client';
2
- export { DEFAULT_STRINGS, LkIntlProvider, directionForLocale, mergeStrings, useLkDirection, useLkStrings } from '../chunk-AWQ53DON.js';
2
+ export { DEFAULT_STRINGS, LkIntlProvider, directionForLocale, mergeStrings, useLkDirection, useLkStrings } from '../chunk-52GXJNQ3.js';
3
3
  //# sourceMappingURL=LkIntlProvider.js.map
4
4
  //# sourceMappingURL=LkIntlProvider.js.map
package/dist/index.cjs CHANGED
@@ -1,25 +1,26 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
+ var chunkUCKA22ZJ_cjs = require('./chunk-UCKA22ZJ.cjs');
5
+ var chunkSRD4KVAP_cjs = require('./chunk-SRD4KVAP.cjs');
4
6
  var chunkPNNUPUH4_cjs = require('./chunk-PNNUPUH4.cjs');
5
- var chunkD4DQFTA7_cjs = require('./chunk-D4DQFTA7.cjs');
6
- var chunk5JCTJFQU_cjs = require('./chunk-5JCTJFQU.cjs');
7
- var chunkMZITNWZ2_cjs = require('./chunk-MZITNWZ2.cjs');
8
- var chunkCTW3G3EH_cjs = require('./chunk-CTW3G3EH.cjs');
9
- var chunk4Y5TELVU_cjs = require('./chunk-4Y5TELVU.cjs');
10
- var chunkJG4DWAUJ_cjs = require('./chunk-JG4DWAUJ.cjs');
11
- var chunkN536RUCZ_cjs = require('./chunk-N536RUCZ.cjs');
12
- var chunkPSUKWVKU_cjs = require('./chunk-PSUKWVKU.cjs');
13
- var chunkWC4OD3EE_cjs = require('./chunk-WC4OD3EE.cjs');
14
- var chunkKIO6QXGT_cjs = require('./chunk-KIO6QXGT.cjs');
15
- var chunkYM64MS4G_cjs = require('./chunk-YM64MS4G.cjs');
7
+ var chunkUAYWLYFW_cjs = require('./chunk-UAYWLYFW.cjs');
8
+ var chunkDQ3VVU5T_cjs = require('./chunk-DQ3VVU5T.cjs');
9
+ var chunkDP3DM7FR_cjs = require('./chunk-DP3DM7FR.cjs');
10
+ var chunk26GQO5I2_cjs = require('./chunk-26GQO5I2.cjs');
11
+ var chunkL7NE7PR4_cjs = require('./chunk-L7NE7PR4.cjs');
12
+ var chunk4H3JTX74_cjs = require('./chunk-4H3JTX74.cjs');
13
+ var chunkEKBEKDWO_cjs = require('./chunk-EKBEKDWO.cjs');
14
+ var chunkXMJE34FY_cjs = require('./chunk-XMJE34FY.cjs');
15
+ var chunkZH5WT2IE_cjs = require('./chunk-ZH5WT2IE.cjs');
16
+ var chunkWKOV25NP_cjs = require('./chunk-WKOV25NP.cjs');
16
17
  var chunkUDCQTOVU_cjs = require('./chunk-UDCQTOVU.cjs');
17
18
  require('./chunk-OD65OZIW.cjs');
18
19
  require('./chunk-BRPEB43C.cjs');
19
- require('./chunk-DPEY7DSE.cjs');
20
- require('./chunk-UMDWVMB5.cjs');
20
+ require('./chunk-53YOZOGN.cjs');
21
+ require('./chunk-FKGUKFC7.cjs');
21
22
  var chunkXOR4MPEN_cjs = require('./chunk-XOR4MPEN.cjs');
22
- var chunkVSFHJ7FB_cjs = require('./chunk-VSFHJ7FB.cjs');
23
+ var chunkZ6TVOAO5_cjs = require('./chunk-Z6TVOAO5.cjs');
23
24
 
24
25
  // src/components/types.ts
25
26
  function asRenderable(redacted) {
@@ -29,69 +30,73 @@ function asRenderableSequence(entries) {
29
30
  return entries;
30
31
  }
31
32
 
32
- Object.defineProperty(exports, "useXAPI", {
33
- enumerable: true,
34
- get: function () { return chunkPNNUPUH4_cjs.useXAPI; }
35
- });
36
33
  Object.defineProperty(exports, "ThemeProvider", {
37
34
  enumerable: true,
38
- get: function () { return chunkD4DQFTA7_cjs.ThemeProvider; }
35
+ get: function () { return chunkUCKA22ZJ_cjs.ThemeProvider; }
39
36
  });
40
37
  Object.defineProperty(exports, "createTailwindTheme", {
41
38
  enumerable: true,
42
- get: function () { return chunkD4DQFTA7_cjs.createTailwindTheme; }
39
+ get: function () { return chunkUCKA22ZJ_cjs.createTailwindTheme; }
43
40
  });
44
41
  Object.defineProperty(exports, "darkTheme", {
45
42
  enumerable: true,
46
- get: function () { return chunkD4DQFTA7_cjs.darkTheme; }
43
+ get: function () { return chunkUCKA22ZJ_cjs.darkTheme; }
47
44
  });
48
45
  Object.defineProperty(exports, "defaultTheme", {
49
46
  enumerable: true,
50
- get: function () { return chunkD4DQFTA7_cjs.defaultTheme; }
47
+ get: function () { return chunkUCKA22ZJ_cjs.defaultTheme; }
51
48
  });
52
49
  Object.defineProperty(exports, "useTheme", {
53
50
  enumerable: true,
54
- get: function () { return chunkD4DQFTA7_cjs.useTheme; }
51
+ get: function () { return chunkUCKA22ZJ_cjs.useTheme; }
52
+ });
53
+ Object.defineProperty(exports, "InteractiveVideo", {
54
+ enumerable: true,
55
+ get: function () { return chunkSRD4KVAP_cjs.InteractiveVideo; }
56
+ });
57
+ Object.defineProperty(exports, "useXAPI", {
58
+ enumerable: true,
59
+ get: function () { return chunkPNNUPUH4_cjs.useXAPI; }
55
60
  });
56
61
  Object.defineProperty(exports, "ActivityPreview", {
57
62
  enumerable: true,
58
- get: function () { return chunk5JCTJFQU_cjs.ActivityPreview; }
63
+ get: function () { return chunkUAYWLYFW_cjs.ActivityPreview; }
59
64
  });
60
65
  Object.defineProperty(exports, "ActivitySequence", {
61
66
  enumerable: true,
62
- get: function () { return chunkMZITNWZ2_cjs.ActivitySequence; }
67
+ get: function () { return chunkDQ3VVU5T_cjs.ActivitySequence; }
63
68
  });
64
69
  Object.defineProperty(exports, "StimulusPanel", {
65
70
  enumerable: true,
66
- get: function () { return chunkCTW3G3EH_cjs.StimulusPanel; }
71
+ get: function () { return chunkDP3DM7FR_cjs.StimulusPanel; }
67
72
  });
68
73
  Object.defineProperty(exports, "WrittenResponse", {
69
74
  enumerable: true,
70
- get: function () { return chunk4Y5TELVU_cjs.WrittenResponse; }
75
+ get: function () { return chunk26GQO5I2_cjs.WrittenResponse; }
71
76
  });
72
77
  Object.defineProperty(exports, "MultipleChoice", {
73
78
  enumerable: true,
74
- get: function () { return chunkJG4DWAUJ_cjs.MultipleChoice; }
79
+ get: function () { return chunkL7NE7PR4_cjs.MultipleChoice; }
75
80
  });
76
81
  Object.defineProperty(exports, "FillInTheBlanks", {
77
82
  enumerable: true,
78
- get: function () { return chunkN536RUCZ_cjs.FillInTheBlanks; }
83
+ get: function () { return chunk4H3JTX74_cjs.FillInTheBlanks; }
79
84
  });
80
85
  Object.defineProperty(exports, "GapSelect", {
81
86
  enumerable: true,
82
- get: function () { return chunkPSUKWVKU_cjs.GapSelect; }
87
+ get: function () { return chunkEKBEKDWO_cjs.GapSelect; }
83
88
  });
84
89
  Object.defineProperty(exports, "Dictation", {
85
90
  enumerable: true,
86
- get: function () { return chunkWC4OD3EE_cjs.Dictation; }
91
+ get: function () { return chunkXMJE34FY_cjs.Dictation; }
87
92
  });
88
93
  Object.defineProperty(exports, "ReadAloud", {
89
94
  enumerable: true,
90
- get: function () { return chunkKIO6QXGT_cjs.ReadAloud; }
95
+ get: function () { return chunkZH5WT2IE_cjs.ReadAloud; }
91
96
  });
92
97
  Object.defineProperty(exports, "PronunciationFeedback", {
93
98
  enumerable: true,
94
- get: function () { return chunkYM64MS4G_cjs.PronunciationFeedback; }
99
+ get: function () { return chunkWKOV25NP_cjs.PronunciationFeedback; }
95
100
  });
96
101
  Object.defineProperty(exports, "CAPTURE_PROCESSOR_SOURCE", {
97
102
  enumerable: true,
@@ -107,27 +112,27 @@ Object.defineProperty(exports, "useActivityState", {
107
112
  });
108
113
  Object.defineProperty(exports, "DEFAULT_STRINGS", {
109
114
  enumerable: true,
110
- get: function () { return chunkVSFHJ7FB_cjs.DEFAULT_STRINGS; }
115
+ get: function () { return chunkZ6TVOAO5_cjs.DEFAULT_STRINGS; }
111
116
  });
112
117
  Object.defineProperty(exports, "LkIntlProvider", {
113
118
  enumerable: true,
114
- get: function () { return chunkVSFHJ7FB_cjs.LkIntlProvider; }
119
+ get: function () { return chunkZ6TVOAO5_cjs.LkIntlProvider; }
115
120
  });
116
121
  Object.defineProperty(exports, "directionForLocale", {
117
122
  enumerable: true,
118
- get: function () { return chunkVSFHJ7FB_cjs.directionForLocale; }
123
+ get: function () { return chunkZ6TVOAO5_cjs.directionForLocale; }
119
124
  });
120
125
  Object.defineProperty(exports, "mergeStrings", {
121
126
  enumerable: true,
122
- get: function () { return chunkVSFHJ7FB_cjs.mergeStrings; }
127
+ get: function () { return chunkZ6TVOAO5_cjs.mergeStrings; }
123
128
  });
124
129
  Object.defineProperty(exports, "useLkDirection", {
125
130
  enumerable: true,
126
- get: function () { return chunkVSFHJ7FB_cjs.useLkDirection; }
131
+ get: function () { return chunkZ6TVOAO5_cjs.useLkDirection; }
127
132
  });
128
133
  Object.defineProperty(exports, "useLkStrings", {
129
134
  enumerable: true,
130
- get: function () { return chunkVSFHJ7FB_cjs.useLkStrings; }
135
+ get: function () { return chunkZ6TVOAO5_cjs.useLkStrings; }
131
136
  });
132
137
  exports.asRenderable = asRenderable;
133
138
  exports.asRenderableSequence = asRenderableSequence;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkMO,SAAS,aACd,QAAA,EACmB;AACnB,EAAA,OAAO,QAAA;AACT;AAoCO,SAAS,qBACd,OAAA,EAC8C;AAC9C,EAAA,OAAO,OAAA;AACT","file":"index.cjs","sourcesContent":["import type {\n ActivityData,\n ActivityResult,\n InteractionEvent,\n ItemGroup,\n ItemOutcome,\n LearnerResponse,\n MediaPlayClaim,\n MediaPlayGrant,\n MediaPlayLedgerEntry,\n RecordingRef,\n RedactedActivityData,\n SequenceEntry,\n ThemeTokens,\n} from '@intellectif/lk-core';\nimport type { RecordedTake } from '../hooks/useSpeechRecorder.js';\nimport type { LkStringsOverride } from '../i18n/strings.js';\nimport type { ReadAloudAssessResult } from './ReadAloud/ReadAloud.js';\n\n/**\n * How an activity is being presented. This is the single switch that decides\n * whether the component may grade, reveal, or submit — the three things a\n * summative exam must take away from the client.\n *\n * - `practice` (default, and the only behaviour before `renderMode` existed):\n * the component owns the attempt. It\n * scores locally on submit, reveals correctness and feedback, and calls\n * `onComplete` with a full {@link ActivityResult}.\n * - `exam`: the component NEVER scores and NEVER reveals correctness. Submit\n * emits the raw learner response through `onSubmit`; the server grades it.\n * Safe to render redacted data, because nothing here needs the answer key.\n * - `review`: read-only. Renders the learner's submitted answer, and marks\n * correctness only from an `outcome` the caller supplies (which the server\n * computed). Nothing is submittable.\n */\nexport type RenderMode = 'practice' | 'exam' | 'review';\n\n/**\n * Makes the answer-key-bearing parts of an activity optional, so a component\n * can render either full activity data OR a `redact()` projection with the\n * same props. Fields the SDK classifies `answer-key` become optional here;\n * a component in `exam` mode must not read them at all.\n */\nexport type Renderable<TData> = Omit<TData, 'scoringStrategy'> & {\n scoringStrategy?: unknown;\n /** Present on a `redact()` projection. */\n redacted?: true;\n};\n\n/**\n * {@link Renderable} DISTRIBUTED over a union of activity types.\n *\n * This distinction is load-bearing, not cosmetic. `Renderable<T>` is built on\n * `Omit`, and `Omit` does not distribute: `Omit<A | B, K>` collapses to the\n * keys A and B have IN COMMON, so `Renderable<ActivityData>` is a single\n * object type carrying only the fields every activity shares. Narrowing it\n * dies with it — after `if (data.type === 'multiple-choice')` the compiler\n * still refuses `data.options`, because the union it would narrow to no\n * longer exists.\n *\n * The conditional below re-distributes, so `RenderableActivity` is a real\n * union of per-type renderables and `.type` narrows again. Anything that\n * accepts \"some renderable activity, I don't know which\" — a custom renderer,\n * a sequence entry — must use THIS, not `Renderable<ActivityData>`.\n */\nexport type RenderableActivity<TData extends ActivityData = ActivityData> = TData extends unknown\n ? Renderable<TData>\n : never;\n\n/**\n * Sanitiser for author-supplied rich text (`questionHtml`, `promptHtml`, and a\n * stimulus's `bodyHtml`). The SDK deliberately ships NO sanitiser — that would\n * add a dependency and, worse, a false promise. Rich text is rendered only when\n * you supply this function; without it the component falls back to the\n * plain-text field, which is always escaped. Fail-safe by construction: the SDK\n * never injects HTML it was not explicitly given a sanitiser for.\n *\n * `FillInTheBlanks.passageHtml` is the one exception, and is **never**\n * rendered: the passage hosts the answer inputs, so it cannot be split at the\n * `{{blank}}` placeholders without voiding the sanitiser. The plain `passage`\n * is always used, and passing `passageHtml` warns in development.\n */\nexport type HtmlSanitizer = (html: string) => string;\n\n/**\n * The prop contract shared by every activity component (Req 3.1). Defined\n * here (React-specific) rather than in lk-core, which is React-free.\n *\n * Controlled / uncontrolled follows the React convention: pass `value` +\n * `onChange` to own the learner's answer (restore an in-progress attempt,\n * autosave a delta, drive a review); pass `defaultValue` to seed an\n * uncontrolled component; pass neither to keep the pre-2.1.0 behaviour, where\n * the component owns the answer outright.\n */\nexport interface ActivityProps<TData extends ActivityData = ActivityData> {\n /** Activity content. Accepts a `redact()` projection in `exam` mode. */\n data: RenderableActivity<TData>;\n /**\n * Called when the component scored the attempt itself. Only ever fires in\n * `practice` mode — in `exam` mode the client does not grade, so there is\n * no `ActivityResult` to give you; use `onSubmit`.\n */\n onComplete?: (result: ActivityResult) => void;\n /**\n * Called on submit with the raw learner response and no grade. Fires in\n * every mode, before `onComplete`, so an exam runner can persist the\n * response and let the server score it.\n */\n onSubmit?: (response: LearnerResponse) => void;\n /** Controlled value: the learner's current response. */\n value?: LearnerResponse;\n /** Initial response for an uncontrolled component (ignored when `value` is set). */\n defaultValue?: LearnerResponse;\n /**\n * Mount the component as already submitted — read at mount only, like any\n * `default*` prop.\n *\n * Restoring an attempt without it reopens a question the learner had already\n * submitted as answerable, so on a summative paper they can change and\n * re-submit it. `AttemptState.submittedSlotIds` is what this consumes.\n */\n defaultSubmitted?: boolean;\n /** Fires on every change to the learner's response. Required for a controlled component. */\n onChange?: (response: LearnerResponse) => void;\n /** Presentation mode. Defaults to `practice`. */\n renderMode?: RenderMode;\n /**\n * Server-computed outcome, used by `review` mode to mark correctness\n * without the client ever scoring. Ignored in other modes.\n */\n outcome?: ItemOutcome;\n /** Renders author-supplied rich text when provided. See {@link HtmlSanitizer}. */\n sanitizeHtml?: HtmlSanitizer;\n /**\n * Binds this activity's own `data.media` to a play budget the consumer\n * persists. Usually supplied by `<ActivitySequence mediaBudget={…}>`; pass it\n * yourself when rendering an activity standalone.\n */\n mediaBudget?: MediaBudgetBinding;\n /** Translations for the audio transport chrome. See {@link MediaTransportStrings}. */\n mediaStrings?: Partial<MediaTransportStrings>;\n /**\n * Overrides the SDK's chrome text for this activity, layered on whatever\n * `LkIntlProvider` supplies. `mediaStrings` still works and is merged after\n * this, so an existing 0.8.x call site keeps behaving as it did.\n */\n strings?: LkStringsOverride;\n onInteraction?: (event: InteractionEvent) => void;\n /** Per-instance token overrides, applied as inline CSS vars on the root. */\n theme?: Partial<ThemeTokens>;\n /**\n * BCP 47 tag stamped as `lang` on this component's root. This is the\n * INTERFACE language — the SDK's own chrome renders inside that element — so\n * it should carry the same value you give `<LkIntlProvider locale>`. Passing\n * a different one re-declares the language of every SDK string in this\n * subtree without changing the words.\n *\n * It is NOT `data.locale`, which labels xAPI statements — and, on a\n * dictation, places the dictation's own words: `<Dictation>` puts it, and\n * the direction it names, on its title, hints, marks and solution. Other\n * authored content in another language belongs on `stimulus.locale`, which\n * `<StimulusPanel>` puts on the passage alone.\n */\n locale?: string;\n disabled?: boolean;\n}\n\n/**\n * Bridges a server-produced `redact()` projection into the `data` prop.\n *\n * `RedactedActivityData` is deliberately index-signature typed in lk-core — it\n * proves a payload is learner-safe, not what shape it has — so TypeScript\n * cannot know it still carries the public fields a renderer needs. This is the\n * SDK's single, documented crossing of that gap, so an exam runner does not\n * have to write `as unknown as` at every call site:\n *\n * ```tsx\n * <MultipleChoice\n * data={asRenderable<MultipleChoiceData>(redactedFromServer)}\n * renderMode=\"exam\"\n * onSubmit={persist}\n * />\n * ```\n *\n * Safe because `exam` mode reads only public fields; the answer-key fields the\n * type claims are exactly the ones the component is forbidden to touch there.\n *\n * Per-type redacted interfaces (`RedactedMultipleChoiceData`, …) ship from\n * lk-core since 0.6.0, but they are not yet *assignable* to `data`:\n * {@link Renderable} widens `scoringStrategy` and leaves nested answer-key\n * fields (`options[].isCorrect`, `blanks[].acceptedAnswers`) required, so a\n * real redacted payload still needs this bridge. Closing that gap is tracked\n * in the roadmap.\n */\nexport function asRenderable<TData extends ActivityData>(\n redacted: RedactedActivityData,\n): Renderable<TData> {\n return redacted as unknown as Renderable<TData>;\n}\n\n/**\n * The same bridge as {@link asRenderable}, for a whole sequence: activities\n * and item groups as a server hands them over, ready for `<ActivitySequence>`.\n *\n * Needed for the same reason and no other. `redactItemGroup` returns\n * `ItemGroup<RedactedActivityData>`, and `RedactedActivityData` is an\n * index-signature type whose fields are all `unknown` — so its `question` is\n * not a `string` and it satisfies no per-type renderable, however the prop is\n * widened. Widening alone cannot fix this; a crossing point is required, and\n * having exactly one keeps `as unknown as` out of consumer code.\n *\n * ```tsx\n * const entries = await fetchExam(); // redacted, server-side\n * <ActivitySequence\n * activities={asRenderableSequence(entries)}\n * renderMode=\"exam\" // REQUIRED: see below\n * shuffleSeed={attemptId}\n * onSubmit={persist}\n * />\n * ```\n *\n * Pass `renderMode=\"exam\"` (or `\"review\"`). Redacted data has no answer key, and\n * almost every built-in activity throws at render in the default `practice`\n * mode rather than fail later: `<MultipleChoice>`, `<FillInTheBlanks>`,\n * `<GapSelect>` and `<Dictation>` because they grade locally, and\n * `<WrittenResponse>` because `practice` still runs its local submit path and\n * emits a practice-mode xAPI statement.\n *\n * `<ReadAloud>` is the exception and renders a projection in every mode: a\n * read-aloud item has no answer key to withhold, so `redact()` removes only the\n * authored feedback and leaves the reading, its language and its bounds — which\n * is everything the component puts on screen. It grades nothing locally either;\n * the grade comes back from whatever the application asked to judge the take.\n */\nexport function asRenderableSequence(\n entries: readonly (RedactedActivityData | RedactedItemGroupData)[],\n): readonly SequenceEntry<RenderableActivity>[] {\n return entries as unknown as readonly SequenceEntry<RenderableActivity>[];\n}\n\n/** Structural shape of a `redactItemGroup()` projection, as it arrives from a server. */\ntype RedactedItemGroupData = ItemGroup<RedactedActivityData> & { redacted: true };\n\n/**\n * Every word the SDK's audio transport renders.\n *\n * Words, not characters: the `m:ss / m:ss` clock is digits and punctuation and\n * is formatted by the component, because it reads identically in every locale\n * this SDK targets. The scrubber's SPOKEN value does have a word in it and does\n * have a key ({@link MediaTransportStrings.timeValue}).\n *\n * Supply them to translate it. These are the highest-stakes strings on a\n * listening paper — \"No plays remaining\" decides whether a learner believes\n * they may try again — so shipping them as untranslatable English inside a\n * Spanish panel was not acceptable. Supplying any of them also sets `lang` on\n * the transport chrome, so a screen reader does not read the SDK's own words\n * with the passage's phonetics.\n */\nexport interface MediaTransportStrings {\n play: string;\n pause: string;\n preparing: string;\n mute: string;\n unmute: string;\n volume: string;\n speed: string;\n seek: string;\n /**\n * Spoken value of the scrubber, e.g. `('1:05', '4:30') => '1:05 of 4:30'`.\n * Takes ALREADY-FORMATTED `m:ss` strings: a translation should not have to\n * reimplement the clock to change the word between them.\n */\n timeValue: (elapsed: string, duration: string) => string;\n /** e.g. `(1, 2) => '1 of 2 plays remaining'`. */\n playsRemaining: (remaining: number, max: number) => string;\n noPlaysRemaining: string;\n /** Shown before the LAST play is spent, so a stray press cannot cost it. */\n lastPlayConfirm: string;\n lastPlayStart: string;\n lastPlayCancel: string;\n seekBlocked: string;\n rateBlocked: string;\n playFailed: string;\n}\n\n/**\n * Binds ONE media block to a play budget the consumer persists.\n *\n * The SDK refuses a play; it does not remember one. Everything durable here is\n * the consuming application's — see {@link SequenceMediaBudget.onPlayConsumed}.\n */\nexport interface MediaBudgetBinding {\n /** From `slotMediaKey(slotId)` / `stimulusMediaKey(slotId)` in lk-core. */\n key: string;\n /** Plays already spent, and where playback stood. Read at mount only. */\n entry?: MediaPlayLedgerEntry;\n /** Defaults to `renderMode !== 'review'`. An explicit boolean wins either way. */\n enforced?: boolean;\n /** Slot context stamped onto the claim and the interaction event. */\n slotId: string;\n index: number;\n activityId?: string;\n onPlayConsumed?: (claim: MediaPlayClaim) => undefined | Promise<MediaPlayGrant | undefined>;\n onPlayRefunded?: (claim: MediaPlayClaim) => void;\n onPosition?: (key: string, seconds: number) => void;\n /** Translations for the transport chrome. */\n strings?: Partial<MediaTransportStrings>;\n}\n\n/**\n * The pager-level half of a play budget. One prop, because it is one concept.\n */\nexport interface SequenceMediaBudget {\n /**\n * `MediaPlayLedger.entries` goes straight in. An absent key means nothing\n * spent. Read at mount, like `responses`.\n */\n plays?: Readonly<Record<string, MediaPlayLedgerEntry>>;\n /**\n * Re-seed token. Change this string and the budgets re-seed from `plays`\n * WITHOUT remounting the pager — the invigilator path (\"the audio never\n * started, give her the play back\") that would otherwise cost the learner\n * their focus, their scroll position and an unsaved answer.\n */\n resumeKey?: string;\n /** Explicit override of the default (`renderMode !== 'review'`). */\n enforced?: boolean;\n /**\n * Called the instant a play is claimed, BEFORE any audio is audible.\n *\n * Two tiers, chosen by what you return:\n *\n * - **Return nothing (optimistic).** Playback starts immediately and the\n * count is only as durable as your write. **Do not debounce this, and do\n * not batch it with the answer autosave** — an eight-second debounce is\n * exactly long enough to start a third play and hard-reload. A `pagehide`\n * beacon is a backstop, not the mechanism. A crash between this call and\n * your write landing RETURNS the play to the learner; that is the honest\n * description of what you are buying.\n * - **Return a promise (confirmed).** Playback is held — the button reads\n * \"Preparing…\" and is `aria-busy` — until it settles. Resolve with\n * `{ playsUsed }` from an ATOMIC server write (`UPDATE … SET plays = plays\n * + 1 … RETURNING plays`, or a compare-and-set on\n * `claim.previousPlaysUsed`). A resolved count above `maxPlays` refuses the\n * play, which is how a second tab is caught: two mounts both seeded at 0\n * both claim 1, and only an atomic increment can tell them apart. A\n * rejection charges nothing and lets the learner retry. This is the only\n * tier in which \"consumed before audible\" is true of storage rather than\n * only of memory; use it for summative papers.\n *\n * Never settle the promise and the learner cannot play at all: settle it.\n */\n onPlayConsumed?: (claim: MediaPlayClaim) => undefined | Promise<MediaPlayGrant | undefined>;\n /**\n * Called when a charged play produced no audio — the element errored before\n * playback advanced past 0.25 s, an expired signed URL being the realistic\n * cause. Supply it to give the play back, decrementing with a compare-and-set\n * on `claim.playsUsed`. Omit it and the play stays spent: the SDK will not\n * decrement a ledger it has no channel to correct.\n */\n onPlayRefunded?: (claim: MediaPlayClaim) => void;\n /**\n * Position reports, so a refresh resumes the play the learner already paid\n * for instead of charging them again. Fires on pause, on end (with 0), and at\n * most once per whole second of playback.\n *\n * **This one you MAY throttle** — the granularity you persist is the\n * granularity of the replay a crash grants. Three seconds is sane; three\n * minutes is not.\n */\n onPosition?: (key: string, seconds: number) => void;\n /** Translations for the transport chrome. Defaults are English. */\n strings?: Partial<MediaTransportStrings>;\n}\n\n/**\n * Which slot a recording belongs to, stamped on every call the pager makes.\n *\n * Exactly the shape {@link ActivitySequenceProps.onSubmit} already passes, so\n * one identity travels with the answer and with the take that answer points at\n * — and a consumer writes `slotId` in both places rather than reconciling two\n * spellings of \"which question was this\".\n */\nexport interface SequenceRecordingSlot {\n /** Identity from `flattenSequence` — stable under shuffling. Store against THIS. */\n slotId: string;\n /** Presented position, which moves under shuffling. */\n index: number;\n activityId: string;\n}\n\n/**\n * The pager-level half of a read-aloud recording binding: where every take in\n * this sequence is stored, and how a judgement comes back.\n *\n * One prop at both levels, because it is one concept — the media-budget\n * precedent ({@link SequenceMediaBudget} beside {@link MediaBudgetBinding}).\n * The difference is the second argument: a per-slot binding knows which slot it\n * belongs to, so a sequence-level one is told.\n *\n * The SDK records and hands over; it never judges. `assess` is `practice` only\n * and optional — a sequence that only stores takes gets the \"assessment is not\n * available\" notice rather than a throw — and `playbackUrl` is `review` only.\n * A slot whose activity is not a read-aloud never calls any of them.\n */\nexport interface SequenceRecordingBinding {\n /**\n * Puts the take in your storage and returns its key. **Required** outside\n * `review`: without it a learner can speak into a control that submits\n * nothing, which the component refuses to render. Settle it.\n */\n upload(take: RecordedTake, slot: SequenceRecordingSlot): Promise<RecordingRef>;\n /** Judges the stored take. `practice` only; an exam never assesses on the client. */\n assess?(ref: RecordingRef, slot: SequenceRecordingSlot): Promise<ReadAloudAssessResult>;\n /** A playable link to a stored take. `review` only. */\n playbackUrl?(ref: RecordingRef, slot: SequenceRecordingSlot): Promise<string>;\n}\n"]}
1
+ {"version":3,"sources":["../src/components/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkMO,SAAS,aACd,QAAA,EACmB;AACnB,EAAA,OAAO,QAAA;AACT;AAoCO,SAAS,qBACd,OAAA,EAC8C;AAC9C,EAAA,OAAO,OAAA;AACT","file":"index.cjs","sourcesContent":["import type {\n ActivityData,\n ActivityResult,\n InteractionEvent,\n ItemGroup,\n ItemOutcome,\n LearnerResponse,\n MediaPlayClaim,\n MediaPlayGrant,\n MediaPlayLedgerEntry,\n RecordingRef,\n RedactedActivityData,\n SequenceEntry,\n ThemeTokens,\n} from '@intellectif/lk-core';\nimport type { RecordedTake } from '../hooks/useSpeechRecorder.js';\nimport type { LkStringsOverride } from '../i18n/strings.js';\nimport type { ReadAloudAssessResult } from './ReadAloud/ReadAloud.js';\n\n/**\n * How an activity is being presented. This is the single switch that decides\n * whether the component may grade, reveal, or submit — the three things a\n * summative exam must take away from the client.\n *\n * - `practice` (default, and the only behaviour before `renderMode` existed):\n * the component owns the attempt. It\n * scores locally on submit, reveals correctness and feedback, and calls\n * `onComplete` with a full {@link ActivityResult}.\n * - `exam`: the component NEVER scores and NEVER reveals correctness. Submit\n * emits the raw learner response through `onSubmit`; the server grades it.\n * Safe to render redacted data, because nothing here needs the answer key.\n * - `review`: read-only. Renders the learner's submitted answer, and marks\n * correctness only from an `outcome` the caller supplies (which the server\n * computed). Nothing is submittable.\n */\nexport type RenderMode = 'practice' | 'exam' | 'review';\n\n/**\n * Makes the answer-key-bearing parts of an activity optional, so a component\n * can render either full activity data OR a `redact()` projection with the\n * same props. Fields the SDK classifies `answer-key` become optional here;\n * a component in `exam` mode must not read them at all.\n */\nexport type Renderable<TData> = Omit<TData, 'scoringStrategy'> & {\n scoringStrategy?: unknown;\n /** Present on a `redact()` projection. */\n redacted?: true;\n};\n\n/**\n * {@link Renderable} DISTRIBUTED over a union of activity types.\n *\n * This distinction is load-bearing, not cosmetic. `Renderable<T>` is built on\n * `Omit`, and `Omit` does not distribute: `Omit<A | B, K>` collapses to the\n * keys A and B have IN COMMON, so `Renderable<ActivityData>` is a single\n * object type carrying only the fields every activity shares. Narrowing it\n * dies with it — after `if (data.type === 'multiple-choice')` the compiler\n * still refuses `data.options`, because the union it would narrow to no\n * longer exists.\n *\n * The conditional below re-distributes, so `RenderableActivity` is a real\n * union of per-type renderables and `.type` narrows again. Anything that\n * accepts \"some renderable activity, I don't know which\" — a custom renderer,\n * a sequence entry — must use THIS, not `Renderable<ActivityData>`.\n */\nexport type RenderableActivity<TData extends ActivityData = ActivityData> = TData extends unknown\n ? Renderable<TData>\n : never;\n\n/**\n * Sanitiser for author-supplied rich text (`questionHtml`, `promptHtml`, and a\n * stimulus's `bodyHtml`). The SDK deliberately ships NO sanitiser — that would\n * add a dependency and, worse, a false promise. Rich text is rendered only when\n * you supply this function; without it the component falls back to the\n * plain-text field, which is always escaped. Fail-safe by construction: the SDK\n * never injects HTML it was not explicitly given a sanitiser for.\n *\n * `FillInTheBlanks.passageHtml` is the one exception, and is **never**\n * rendered: the passage hosts the answer inputs, so it cannot be split at the\n * `{{blank}}` placeholders without voiding the sanitiser. The plain `passage`\n * is always used, and passing `passageHtml` warns in development.\n */\nexport type HtmlSanitizer = (html: string) => string;\n\n/**\n * The prop contract shared by every activity component (Req 3.1). Defined\n * here (React-specific) rather than in lk-core, which is React-free.\n *\n * Controlled / uncontrolled follows the React convention: pass `value` +\n * `onChange` to own the learner's answer (restore an in-progress attempt,\n * autosave a delta, drive a review); pass `defaultValue` to seed an\n * uncontrolled component; pass neither to keep the pre-2.1.0 behaviour, where\n * the component owns the answer outright.\n */\nexport interface ActivityProps<TData extends ActivityData = ActivityData> {\n /** Activity content. Accepts a `redact()` projection in `exam` mode. */\n data: RenderableActivity<TData>;\n /**\n * Called when the component scored the attempt itself. Only ever fires in\n * `practice` mode — in `exam` mode the client does not grade, so there is\n * no `ActivityResult` to give you; use `onSubmit`.\n */\n onComplete?: (result: ActivityResult) => void;\n /**\n * Called on submit with the raw learner response and no grade. Fires in\n * every mode, before `onComplete`, so an exam runner can persist the\n * response and let the server score it.\n */\n onSubmit?: (response: LearnerResponse) => void;\n /** Controlled value: the learner's current response. */\n value?: LearnerResponse;\n /** Initial response for an uncontrolled component (ignored when `value` is set). */\n defaultValue?: LearnerResponse;\n /**\n * Mount the component as already submitted — read at mount only, like any\n * `default*` prop.\n *\n * Restoring an attempt without it reopens a question the learner had already\n * submitted as answerable, so on a summative paper they can change and\n * re-submit it. `AttemptState.submittedSlotIds` is what this consumes.\n */\n defaultSubmitted?: boolean;\n /** Fires on every change to the learner's response. Required for a controlled component. */\n onChange?: (response: LearnerResponse) => void;\n /** Presentation mode. Defaults to `practice`. */\n renderMode?: RenderMode;\n /**\n * Server-computed outcome, used by `review` mode to mark correctness\n * without the client ever scoring. Ignored in other modes.\n */\n outcome?: ItemOutcome;\n /** Renders author-supplied rich text when provided. See {@link HtmlSanitizer}. */\n sanitizeHtml?: HtmlSanitizer;\n /**\n * Binds this activity's own `data.media` to a play budget the consumer\n * persists. Usually supplied by `<ActivitySequence mediaBudget={…}>`; pass it\n * yourself when rendering an activity standalone.\n */\n mediaBudget?: MediaBudgetBinding;\n /** Translations for the audio transport chrome. See {@link MediaTransportStrings}. */\n mediaStrings?: Partial<MediaTransportStrings>;\n /**\n * Overrides the SDK's chrome text for this activity, layered on whatever\n * `LkIntlProvider` supplies. `mediaStrings` still works and is merged after\n * this, so an existing 0.8.x call site keeps behaving as it did.\n */\n strings?: LkStringsOverride;\n onInteraction?: (event: InteractionEvent) => void;\n /** Per-instance token overrides, applied as inline CSS vars on the root. */\n theme?: Partial<ThemeTokens>;\n /**\n * BCP 47 tag stamped as `lang` on this component's root. This is the\n * INTERFACE language — the SDK's own chrome renders inside that element — so\n * it should carry the same value you give `<LkIntlProvider locale>`. Passing\n * a different one re-declares the language of every SDK string in this\n * subtree without changing the words.\n *\n * It is NOT `data.locale`, which labels xAPI statements — and, on a\n * dictation, places the dictation's own words: `<Dictation>` puts it, and\n * the direction it names, on its title, hints, marks and solution. Other\n * authored content in another language belongs on `stimulus.locale`, which\n * `<StimulusPanel>` puts on the passage alone.\n */\n locale?: string;\n disabled?: boolean;\n}\n\n/**\n * Bridges a server-produced `redact()` projection into the `data` prop.\n *\n * `RedactedActivityData` is deliberately index-signature typed in lk-core — it\n * proves a payload is learner-safe, not what shape it has — so TypeScript\n * cannot know it still carries the public fields a renderer needs. This is the\n * SDK's single, documented crossing of that gap, so an exam runner does not\n * have to write `as unknown as` at every call site:\n *\n * ```tsx\n * <MultipleChoice\n * data={asRenderable<MultipleChoiceData>(redactedFromServer)}\n * renderMode=\"exam\"\n * onSubmit={persist}\n * />\n * ```\n *\n * Safe because `exam` mode reads only public fields; the answer-key fields the\n * type claims are exactly the ones the component is forbidden to touch there.\n *\n * Per-type redacted interfaces (`RedactedMultipleChoiceData`, …) ship from\n * lk-core since 0.6.0, but they are not yet *assignable* to `data`:\n * {@link Renderable} widens `scoringStrategy` and leaves nested answer-key\n * fields (`options[].isCorrect`, `blanks[].acceptedAnswers`) required, so a\n * real redacted payload still needs this bridge. Closing that gap is tracked\n * in the roadmap.\n */\nexport function asRenderable<TData extends ActivityData>(\n redacted: RedactedActivityData,\n): Renderable<TData> {\n return redacted as unknown as Renderable<TData>;\n}\n\n/**\n * The same bridge as {@link asRenderable}, for a whole sequence: activities\n * and item groups as a server hands them over, ready for `<ActivitySequence>`.\n *\n * Needed for the same reason and no other. `redactItemGroup` returns\n * `ItemGroup<RedactedActivityData>`, and `RedactedActivityData` is an\n * index-signature type whose fields are all `unknown` — so its `question` is\n * not a `string` and it satisfies no per-type renderable, however the prop is\n * widened. Widening alone cannot fix this; a crossing point is required, and\n * having exactly one keeps `as unknown as` out of consumer code.\n *\n * ```tsx\n * const entries = await fetchExam(); // redacted, server-side\n * <ActivitySequence\n * activities={asRenderableSequence(entries)}\n * renderMode=\"exam\" // REQUIRED: see below\n * shuffleSeed={attemptId}\n * onSubmit={persist}\n * />\n * ```\n *\n * Pass `renderMode=\"exam\"` (or `\"review\"`). Redacted data has no answer key, and\n * almost every built-in activity throws at render in the default `practice`\n * mode rather than fail later: `<MultipleChoice>`, `<FillInTheBlanks>`,\n * `<GapSelect>` and `<Dictation>` because they grade locally, and\n * `<WrittenResponse>` because `practice` still runs its local submit path and\n * emits a practice-mode xAPI statement.\n *\n * `<ReadAloud>` is the exception and renders a projection in every mode: a\n * read-aloud item has no answer key to withhold, so `redact()` removes only the\n * authored feedback and leaves the reading, its language and its bounds — which\n * is everything the component puts on screen. It grades nothing locally either;\n * the grade comes back from whatever the application asked to judge the take.\n */\nexport function asRenderableSequence(\n entries: readonly (RedactedActivityData | RedactedItemGroupData)[],\n): readonly SequenceEntry<RenderableActivity>[] {\n return entries as unknown as readonly SequenceEntry<RenderableActivity>[];\n}\n\n/** Structural shape of a `redactItemGroup()` projection, as it arrives from a server. */\ntype RedactedItemGroupData = ItemGroup<RedactedActivityData> & { redacted: true };\n\n/**\n * Every word the SDK's audio transport renders.\n *\n * Words, not characters: the `m:ss / m:ss` clock is digits and punctuation and\n * is formatted by the component, because it reads identically in every locale\n * this SDK targets. The scrubber's SPOKEN value does have a word in it and does\n * have a key ({@link MediaTransportStrings.timeValue}).\n *\n * Supply them to translate it. These are the highest-stakes strings on a\n * listening paper — \"No plays remaining\" decides whether a learner believes\n * they may try again — so shipping them as untranslatable English inside a\n * Spanish panel was not acceptable. Supplying any of them also sets `lang` on\n * the transport chrome, so a screen reader does not read the SDK's own words\n * with the passage's phonetics.\n */\nexport interface MediaTransportStrings {\n play: string;\n pause: string;\n preparing: string;\n mute: string;\n unmute: string;\n volume: string;\n speed: string;\n seek: string;\n /**\n * Spoken value of the scrubber, e.g. `('1:05', '4:30') => '1:05 of 4:30'`.\n * Takes ALREADY-FORMATTED `m:ss` strings: a translation should not have to\n * reimplement the clock to change the word between them.\n */\n timeValue: (elapsed: string, duration: string) => string;\n /** e.g. `(1, 2) => '1 of 2 plays remaining'`. */\n playsRemaining: (remaining: number, max: number) => string;\n noPlaysRemaining: string;\n /** Shown before the LAST play is spent, so a stray press cannot cost it. */\n lastPlayConfirm: string;\n lastPlayStart: string;\n lastPlayCancel: string;\n seekBlocked: string;\n rateBlocked: string;\n playFailed: string;\n}\n\n/**\n * Binds ONE media block to a play budget the consumer persists.\n *\n * The SDK refuses a play; it does not remember one. Everything durable here is\n * the consuming application's — see {@link SequenceMediaBudget.onPlayConsumed}.\n */\nexport interface MediaBudgetBinding {\n /** From `slotMediaKey(slotId)` / `stimulusMediaKey(slotId)` in lk-core. */\n key: string;\n /** Plays already spent, and where playback stood. Read at mount only. */\n entry?: MediaPlayLedgerEntry;\n /** Defaults to `renderMode !== 'review'`. An explicit boolean wins either way. */\n enforced?: boolean;\n /** Slot context stamped onto the claim and the interaction event. */\n slotId: string;\n index: number;\n activityId?: string;\n onPlayConsumed?: (claim: MediaPlayClaim) => undefined | Promise<MediaPlayGrant | undefined>;\n onPlayRefunded?: (claim: MediaPlayClaim) => void;\n onPosition?: (key: string, seconds: number) => void;\n /** Translations for the transport chrome. */\n strings?: Partial<MediaTransportStrings>;\n}\n\n/**\n * The pager-level half of a play budget. One prop, because it is one concept.\n */\nexport interface SequenceMediaBudget {\n /**\n * `MediaPlayLedger.entries` goes straight in. An absent key means nothing\n * spent. Read at mount, like `responses`.\n */\n plays?: Readonly<Record<string, MediaPlayLedgerEntry>>;\n /**\n * Re-seed token. Change this string and the budgets re-seed from `plays`\n * WITHOUT remounting the pager — the invigilator path (\"the audio never\n * started, give her the play back\") that would otherwise cost the learner\n * their focus, their scroll position and an unsaved answer.\n */\n resumeKey?: string;\n /** Explicit override of the default (`renderMode !== 'review'`). */\n enforced?: boolean;\n /**\n * Called the instant a play is claimed, BEFORE any audio is audible.\n *\n * Two tiers, chosen by what you return:\n *\n * - **Return nothing (optimistic).** Playback starts immediately and the\n * count is only as durable as your write. **Do not debounce this, and do\n * not batch it with the answer autosave** — an eight-second debounce is\n * exactly long enough to start a third play and hard-reload. A `pagehide`\n * beacon is a backstop, not the mechanism. A crash between this call and\n * your write landing RETURNS the play to the learner; that is the honest\n * description of what you are buying.\n * - **Return a promise (confirmed).** Playback is held — the button reads\n * \"Preparing…\" and is `aria-busy` — until it settles. Resolve with\n * `{ playsUsed }` from an ATOMIC server write (`UPDATE … SET plays = plays\n * + 1 … RETURNING plays`, or a compare-and-set on\n * `claim.previousPlaysUsed`). A resolved count above `maxPlays` refuses the\n * play, which is how a second tab is caught: two mounts both seeded at 0\n * both claim 1, and only an atomic increment can tell them apart. A\n * rejection charges nothing and lets the learner retry. This is the only\n * tier in which \"consumed before audible\" is true of storage rather than\n * only of memory; use it for summative papers.\n *\n * Never settle the promise and the learner cannot play at all: settle it.\n */\n onPlayConsumed?: (claim: MediaPlayClaim) => undefined | Promise<MediaPlayGrant | undefined>;\n /**\n * Called when a charged play produced no audio — the element errored before\n * playback advanced past 0.25 s, an expired signed URL being the realistic\n * cause. Supply it to give the play back, decrementing with a compare-and-set\n * on `claim.playsUsed`. Omit it and the play stays spent: the SDK will not\n * decrement a ledger it has no channel to correct.\n */\n onPlayRefunded?: (claim: MediaPlayClaim) => void;\n /**\n * Position reports, so a refresh resumes the play the learner already paid\n * for instead of charging them again. Fires on pause, on end (with 0), and at\n * most once per whole second of playback.\n *\n * **This one you MAY throttle** — the granularity you persist is the\n * granularity of the replay a crash grants. Three seconds is sane; three\n * minutes is not.\n */\n onPosition?: (key: string, seconds: number) => void;\n /** Translations for the transport chrome. Defaults are English. */\n strings?: Partial<MediaTransportStrings>;\n}\n\n/**\n * Which slot a recording belongs to, stamped on every call the pager makes.\n *\n * Exactly the shape {@link ActivitySequenceProps.onSubmit} already passes, so\n * one identity travels with the answer and with the take that answer points at\n * — and a consumer writes `slotId` in both places rather than reconciling two\n * spellings of \"which question was this\".\n */\nexport interface SequenceRecordingSlot {\n /** Identity from `flattenSequence` — stable under shuffling. Store against THIS. */\n slotId: string;\n /** Presented position, which moves under shuffling. */\n index: number;\n activityId: string;\n}\n\n/**\n * The pager-level half of a read-aloud recording binding: where every take in\n * this sequence is stored, and how a judgement comes back.\n *\n * One prop at both levels, because it is one concept — the media-budget\n * precedent ({@link SequenceMediaBudget} beside {@link MediaBudgetBinding}).\n * The difference is the second argument: a per-slot binding knows which slot it\n * belongs to, so a sequence-level one is told.\n *\n * The SDK records and hands over; it never judges. `assess` is `practice` only\n * and optional — a sequence that only stores takes gets the \"assessment is not\n * available\" notice rather than a throw — and `playbackUrl` is `review` only.\n * A slot whose activity is not a read-aloud never calls any of them.\n */\nexport interface SequenceRecordingBinding {\n /**\n * Puts the take in your storage and returns its key. **Required** outside\n * `review`: without it a learner can speak into a control that submits\n * nothing, which the component refuses to render. Settle it.\n */\n upload(take: RecordedTake, slot: SequenceRecordingSlot): Promise<RecordingRef>;\n /** Judges the stored take. `practice` only; an exam never assesses on the client. */\n assess?(ref: RecordingRef, slot: SequenceRecordingSlot): Promise<ReadAloudAssessResult>;\n /** A playable link to a stored take. `review` only. */\n playbackUrl?(ref: RecordingRef, slot: SequenceRecordingSlot): Promise<string>;\n}\n"]}
package/dist/index.d.cts CHANGED
@@ -3,11 +3,12 @@ export { ActivityRenderer, ActivitySequence, ActivitySequenceProps, SequenceItem
3
3
  export { Dictation, DictationProps } from './components/Dictation.cjs';
4
4
  export { FillInTheBlanks, FillInTheBlanksProps } from './components/FillInTheBlanks.cjs';
5
5
  export { GapSelect, GapSelectProps } from './components/GapSelect.cjs';
6
+ export { InteractiveVideo, InteractiveVideoProps, InteractiveVideoSlot, InteractiveVideoSummary, RenderableItemGroup } from './components/InteractiveVideo.cjs';
6
7
  export { MultipleChoice, MultipleChoiceProps } from './components/MultipleChoice.cjs';
7
8
  export { PronunciationFeedback, PronunciationFeedbackProps } from './components/PronunciationFeedback.cjs';
8
9
  export { ReadAloud } from './components/ReadAloud.cjs';
9
10
  export { StimulusPanel, StimulusPanelProps } from './components/StimulusPanel.cjs';
10
- export { A as ActivityProps, D as DEFAULT_STRINGS, H as HtmlSanitizer, L as LkStrings, a as LkStringsOverride, M as MediaBudgetBinding, b as MediaTransportStrings, R as ReadAloudAssessResult, c as ReadAloudProps, d as RecordingBinding, e as RenderMode, f as Renderable, g as RenderableActivity, S as SequenceMediaBudget, h as SequenceRecordingBinding, i as SequenceRecordingSlot, j as asRenderable, k as asRenderableSequence, m as mergeStrings } from './strings-wjAF2ONm.cjs';
11
+ export { A as ActivityProps, C as CaptionSize, D as DEFAULT_STRINGS, H as HtmlSanitizer, L as LkStrings, a as LkStringsOverride, M as MediaBudgetBinding, b as MediaTransportStrings, R as ReadAloudAssessResult, c as ReadAloudProps, d as RecordingBinding, e as RenderMode, f as Renderable, g as RenderableActivity, S as SequenceMediaBudget, h as SequenceRecordingBinding, i as SequenceRecordingSlot, V as VideoPreferences, j as asRenderable, k as asRenderableSequence, m as mergeStrings } from './strings-5588Q4Te.cjs';
11
12
  export { WrittenResponse } from './components/WrittenResponse.cjs';
12
13
  export { ActivityState, UseActivityStateResult, useActivityState } from './hooks/useActivityState.cjs';
13
14
  export { CAPTURE_PROCESSOR_SOURCE, SpeechRecorder, SpeechRecorderOptions, useSpeechRecorder } from './hooks/useSpeechRecorder.cjs';
@@ -15,7 +16,7 @@ export { UseXAPIResult, useXAPI } from './hooks/useXAPI.cjs';
15
16
  export { LkDirection, LkIntlProvider, LkIntlProviderProps, directionForLocale, useLkDirection, useLkStrings } from './i18n/LkIntlProvider.cjs';
16
17
  export { TailwindThemeExtension, ThemeProvider, ThemeProviderProps, createTailwindTheme, darkTheme, defaultTheme, useTheme } from './theme/ThemeProvider.cjs';
17
18
  export { R as RecordedTake, S as SpeechRecorderError, a as SpeechRecorderStatus } from './machine-CuwKqWXC.cjs';
18
- export { W as WrittenResponseProps, a as WrittenResponseSubmission } from './WrittenResponse-rRpOr9W1.cjs';
19
+ export { W as WrittenResponseProps, a as WrittenResponseSubmission } from './WrittenResponse-BPbhERgk.cjs';
19
20
  import 'react/jsx-runtime';
20
21
  import '@intellectif/lk-core';
21
22
  import 'react';