@intellectif/lk-react 13.0.0 → 14.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 (162) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +11 -3
  3. package/dist/{WrittenResponse-B5p_-RnJ.d.ts → WrittenResponse-C0P34En1.d.ts} +1 -1
  4. package/dist/{WrittenResponse-DWtS4tOL.d.cts → WrittenResponse-pB1ik8hg.d.cts} +1 -1
  5. package/dist/chunk-36FTYJWJ.cjs +869 -0
  6. package/dist/chunk-36FTYJWJ.cjs.map +1 -0
  7. package/dist/{chunk-PSHNTDKG.js → chunk-47HHC4GD.js} +13 -161
  8. package/dist/chunk-47HHC4GD.js.map +1 -0
  9. package/dist/chunk-62AKSD5Y.js +509 -0
  10. package/dist/chunk-62AKSD5Y.js.map +1 -0
  11. package/dist/{chunk-XAGWBVK3.js → chunk-72UGRIMM.js} +6 -5
  12. package/dist/chunk-72UGRIMM.js.map +1 -0
  13. package/dist/{chunk-SBIJJ374.cjs → chunk-B2XQLU2E.cjs} +5 -5
  14. package/dist/{chunk-SBIJJ374.cjs.map → chunk-B2XQLU2E.cjs.map} +1 -1
  15. package/dist/{chunk-DQERNAWI.js → chunk-BO6P723E.js} +26 -31
  16. package/dist/chunk-BO6P723E.js.map +1 -0
  17. package/dist/chunk-BRPEB43C.cjs +13 -0
  18. package/dist/chunk-BRPEB43C.cjs.map +1 -0
  19. package/dist/{chunk-NVUFEMPZ.cjs → chunk-BVRUUYYR.cjs} +30 -16
  20. package/dist/chunk-BVRUUYYR.cjs.map +1 -0
  21. package/dist/{chunk-AMGK7DDM.cjs → chunk-D4DQFTA7.cjs} +2 -2
  22. package/dist/chunk-D4DQFTA7.cjs.map +1 -0
  23. package/dist/chunk-D57QZILZ.js +863 -0
  24. package/dist/chunk-D57QZILZ.js.map +1 -0
  25. package/dist/chunk-F4TBCRGI.cjs +518 -0
  26. package/dist/chunk-F4TBCRGI.cjs.map +1 -0
  27. package/dist/{chunk-YILH4ETT.js → chunk-I33FOKZ7.js} +224 -31
  28. package/dist/chunk-I33FOKZ7.js.map +1 -0
  29. package/dist/{chunk-HT4FFZZQ.cjs → chunk-J2CDPIRC.cjs} +231 -38
  30. package/dist/chunk-J2CDPIRC.cjs.map +1 -0
  31. package/dist/{chunk-MA7GXUWC.cjs → chunk-LB3FEV7Z.cjs} +77 -2
  32. package/dist/chunk-LB3FEV7Z.cjs.map +1 -0
  33. package/dist/{chunk-5N7OLFHB.js → chunk-LGCUOLP6.js} +6 -5
  34. package/dist/chunk-LGCUOLP6.js.map +1 -0
  35. package/dist/{chunk-YZWXVZB3.js → chunk-LLXCX5KK.js} +6 -5
  36. package/dist/chunk-LLXCX5KK.js.map +1 -0
  37. package/dist/chunk-MCO52PV5.js +520 -0
  38. package/dist/chunk-MCO52PV5.js.map +1 -0
  39. package/dist/{chunk-K7NMNOPI.cjs → chunk-NDQD3ZRY.cjs} +15 -14
  40. package/dist/chunk-NDQD3ZRY.cjs.map +1 -0
  41. package/dist/chunk-OD65OZIW.cjs +159 -0
  42. package/dist/chunk-OD65OZIW.cjs.map +1 -0
  43. package/dist/chunk-RCMYEWBE.js +11 -0
  44. package/dist/chunk-RCMYEWBE.js.map +1 -0
  45. package/dist/{chunk-74QXBWCI.cjs → chunk-RRH7ZPXC.cjs} +6 -6
  46. package/dist/{chunk-74QXBWCI.cjs.map → chunk-RRH7ZPXC.cjs.map} +1 -1
  47. package/dist/{chunk-DQNVAXG6.js → chunk-RXS455MR.js} +2 -2
  48. package/dist/chunk-RXS455MR.js.map +1 -0
  49. package/dist/{chunk-Z63JRG4M.cjs → chunk-SE6WWDVW.cjs} +15 -14
  50. package/dist/chunk-SE6WWDVW.cjs.map +1 -0
  51. package/dist/{chunk-NVP6UEQQ.js → chunk-SWY6PWXK.js} +4 -4
  52. package/dist/{chunk-NVP6UEQQ.js.map → chunk-SWY6PWXK.js.map} +1 -1
  53. package/dist/{chunk-3Q4I4KT6.js → chunk-TDJEKXEP.js} +77 -2
  54. package/dist/chunk-TDJEKXEP.js.map +1 -0
  55. package/dist/{chunk-2GXSA322.cjs → chunk-U3APKQ7P.cjs} +15 -14
  56. package/dist/chunk-U3APKQ7P.cjs.map +1 -0
  57. package/dist/chunk-UDCQTOVU.cjs +523 -0
  58. package/dist/chunk-UDCQTOVU.cjs.map +1 -0
  59. package/dist/{chunk-K3EA547J.cjs → chunk-USBANZ7K.cjs} +27 -33
  60. package/dist/chunk-USBANZ7K.cjs.map +1 -0
  61. package/dist/{chunk-J73TDY7J.cjs → chunk-WTS34S5E.cjs} +25 -173
  62. package/dist/chunk-WTS34S5E.cjs.map +1 -0
  63. package/dist/{chunk-R7DI5UMU.js → chunk-XIBOFTOL.js} +3 -3
  64. package/dist/{chunk-R7DI5UMU.js.map → chunk-XIBOFTOL.js.map} +1 -1
  65. package/dist/{chunk-W4MXRZAB.js → chunk-XUEIUEPI.js} +6 -5
  66. package/dist/chunk-XUEIUEPI.js.map +1 -0
  67. package/dist/{chunk-UU2NV6SU.cjs → chunk-YEYKJFEC.cjs} +14 -13
  68. package/dist/chunk-YEYKJFEC.cjs.map +1 -0
  69. package/dist/{chunk-PY53ABWC.js → chunk-YMBBM5K7.js} +23 -9
  70. package/dist/chunk-YMBBM5K7.js.map +1 -0
  71. package/dist/chunk-YORQQXGO.js +155 -0
  72. package/dist/chunk-YORQQXGO.js.map +1 -0
  73. package/dist/components/ActivityPreview.cjs +15 -10
  74. package/dist/components/ActivityPreview.d.cts +9 -3
  75. package/dist/components/ActivityPreview.d.ts +9 -3
  76. package/dist/components/ActivityPreview.js +14 -9
  77. package/dist/components/ActivitySequence.cjs +16 -11
  78. package/dist/components/ActivitySequence.d.cts +108 -4
  79. package/dist/components/ActivitySequence.d.ts +108 -4
  80. package/dist/components/ActivitySequence.js +15 -10
  81. package/dist/components/Dictation.cjs +7 -5
  82. package/dist/components/Dictation.d.cts +2 -1
  83. package/dist/components/Dictation.d.ts +2 -1
  84. package/dist/components/Dictation.js +6 -4
  85. package/dist/components/FillInTheBlanks.cjs +6 -5
  86. package/dist/components/FillInTheBlanks.d.cts +2 -1
  87. package/dist/components/FillInTheBlanks.d.ts +2 -1
  88. package/dist/components/FillInTheBlanks.js +5 -4
  89. package/dist/components/GapSelect.cjs +6 -5
  90. package/dist/components/GapSelect.d.cts +2 -1
  91. package/dist/components/GapSelect.d.ts +2 -1
  92. package/dist/components/GapSelect.js +5 -4
  93. package/dist/components/MultipleChoice.cjs +6 -5
  94. package/dist/components/MultipleChoice.d.cts +2 -1
  95. package/dist/components/MultipleChoice.d.ts +2 -1
  96. package/dist/components/MultipleChoice.js +5 -4
  97. package/dist/components/PronunciationFeedback.cjs +16 -0
  98. package/dist/components/PronunciationFeedback.cjs.map +1 -0
  99. package/dist/components/PronunciationFeedback.d.cts +64 -0
  100. package/dist/components/PronunciationFeedback.d.ts +64 -0
  101. package/dist/components/PronunciationFeedback.js +7 -0
  102. package/dist/components/PronunciationFeedback.js.map +1 -0
  103. package/dist/components/ReadAloud.cjs +21 -0
  104. package/dist/components/ReadAloud.cjs.map +1 -0
  105. package/dist/components/ReadAloud.d.cts +15 -0
  106. package/dist/components/ReadAloud.d.ts +15 -0
  107. package/dist/components/ReadAloud.js +12 -0
  108. package/dist/components/ReadAloud.js.map +1 -0
  109. package/dist/components/StimulusPanel.cjs +4 -4
  110. package/dist/components/StimulusPanel.d.cts +2 -1
  111. package/dist/components/StimulusPanel.d.ts +2 -1
  112. package/dist/components/StimulusPanel.js +3 -3
  113. package/dist/components/WrittenResponse.cjs +6 -5
  114. package/dist/components/WrittenResponse.d.cts +4 -3
  115. package/dist/components/WrittenResponse.d.ts +4 -3
  116. package/dist/components/WrittenResponse.js +5 -4
  117. package/dist/hooks/useSpeechRecorder.cjs +17 -0
  118. package/dist/hooks/useSpeechRecorder.cjs.map +1 -0
  119. package/dist/hooks/useSpeechRecorder.d.cts +127 -0
  120. package/dist/hooks/useSpeechRecorder.d.ts +127 -0
  121. package/dist/hooks/useSpeechRecorder.js +4 -0
  122. package/dist/hooks/useSpeechRecorder.js.map +1 -0
  123. package/dist/i18n/LkIntlProvider.cjs +7 -7
  124. package/dist/i18n/LkIntlProvider.d.cts +3 -2
  125. package/dist/i18n/LkIntlProvider.d.ts +3 -2
  126. package/dist/i18n/LkIntlProvider.js +1 -1
  127. package/dist/index.cjs +53 -32
  128. package/dist/index.cjs.map +1 -1
  129. package/dist/index.d.cts +6 -2
  130. package/dist/index.d.ts +6 -2
  131. package/dist/index.js +17 -12
  132. package/dist/index.js.map +1 -1
  133. package/dist/machine-CuwKqWXC.d.cts +26 -0
  134. package/dist/machine-CuwKqWXC.d.ts +26 -0
  135. package/dist/{strings-DPTyLpHt.d.ts → strings--ADnHcaA.d.cts} +214 -4
  136. package/dist/{strings-DPTyLpHt.d.cts → strings-CtdSf2St.d.ts} +214 -4
  137. package/dist/theme/ThemeProvider.cjs +6 -6
  138. package/dist/theme/ThemeProvider.d.cts +4 -4
  139. package/dist/theme/ThemeProvider.d.ts +4 -4
  140. package/dist/theme/ThemeProvider.js +1 -1
  141. package/dist/theme/skin.css +596 -3
  142. package/package.json +33 -3
  143. package/dist/chunk-2GXSA322.cjs.map +0 -1
  144. package/dist/chunk-3Q4I4KT6.js.map +0 -1
  145. package/dist/chunk-5N7OLFHB.js.map +0 -1
  146. package/dist/chunk-AMGK7DDM.cjs.map +0 -1
  147. package/dist/chunk-DQERNAWI.js.map +0 -1
  148. package/dist/chunk-DQNVAXG6.js.map +0 -1
  149. package/dist/chunk-HT4FFZZQ.cjs.map +0 -1
  150. package/dist/chunk-J73TDY7J.cjs.map +0 -1
  151. package/dist/chunk-K3EA547J.cjs.map +0 -1
  152. package/dist/chunk-K7NMNOPI.cjs.map +0 -1
  153. package/dist/chunk-MA7GXUWC.cjs.map +0 -1
  154. package/dist/chunk-NVUFEMPZ.cjs.map +0 -1
  155. package/dist/chunk-PSHNTDKG.js.map +0 -1
  156. package/dist/chunk-PY53ABWC.js.map +0 -1
  157. package/dist/chunk-UU2NV6SU.cjs.map +0 -1
  158. package/dist/chunk-W4MXRZAB.js.map +0 -1
  159. package/dist/chunk-XAGWBVK3.js.map +0 -1
  160. package/dist/chunk-YILH4ETT.js.map +0 -1
  161. package/dist/chunk-YZWXVZB3.js.map +0 -1
  162. package/dist/chunk-Z63JRG4M.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ActivityPreview/ActivityPreview.tsx"],"names":[],"mappings":";;;;;;;;;;;;AA+BA,IAAM,oBAAA,GAAuB,qBAAA;AAO7B,IAAM,eAAA,GAAkB,SAAA;AAGxB,IAAI,gBAAA,GAAmB,CAAA;AAavB,IAAM,iBAAA,GAAsC;AAAA,EAC1C,MAAA,EAAQ,OAAO,IAAA,KAAS;AACtB,IAAA,gBAAA,IAAoB,CAAA;AACpB,IAAA,OAAO;AAAA,MACL,GAAA,EAAK,CAAA,EAAG,eAAe,CAAA,MAAA,EAAS,gBAAgB,CAAA,CAAA;AAAA,MAChD,UAAU,IAAA,CAAK,QAAA;AAAA,MACf,YAAY,IAAA,CAAK;AAAA,KACnB;AAAA,EACF;AACF,CAAA;AAsEO,SAAS,eAAA,CAAgB;AAAA,EAC9B,KAAA;AAAA,EACA,UAAA,GAAa,UAAA;AAAA,EACb,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAAyB;AACvB,EAAA,MAAM,CAAA,GAAI,aAAa,OAAO,CAAA;AAC9B,EAAA,MAAM,IAAA,GAAO,SAAS,KAAK,CAAA,IAAK,OAAO,KAAA,CAAM,IAAA,KAAS,QAAA,GAAW,KAAA,CAAM,IAAA,GAAO,MAAA;AAO9E,EAAA,MAAM,UAAA,GAAa,aAAa,KAAK,CAAA;AAErC,EAAA,MAAM,MAAA,GAAS,OAAA;AAAA,IACb,M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A,CAAE,CAAA;AACtF,IAAA,OAAO,CAAA,CAAA,EAAI,MAAA,CAAO,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA,CAAA;AAAA,EAC7B,CAAA,SAAE;AACA,IAAA,SAAA,CAAU,OAAO,KAAK,CAAA;AAAA,EACxB;AACF","file":"chunk-YMBBM5K7.js","sourcesContent":["'use client';\n\nimport {\n type ActivityType,\n type DraftNotComplete,\n evaluate,\n type ItemOutcome,\n type LearnerResponse,\n slotMediaKey,\n type ThemeTokens,\n validateDraft,\n} from '@intellectif/lk-core';\nimport { type ReactNode, useMemo } from 'react';\nimport { useLkStrings } from '../../i18n/LkIntlProvider.js';\nimport type { LkStringsOverride } from '../../i18n/strings.js';\nimport { ActivityErrorBoundary } from '../ActivityErrorBoundary.js';\nimport type { ActivityRenderer } from '../ActivitySequence/index.js';\nimport { Dictation } from '../Dictation/index.js';\nimport { FillInTheBlanks } from '../FillInTheBlanks/index.js';\nimport { GapSelect } from '../GapSelect/index.js';\nimport { MultipleChoice } from '../MultipleChoice/index.js';\nimport { ReadAloud } from '../ReadAloud/index.js';\nimport type { RecordingBinding } from '../ReadAloud/ReadAloud.js';\nimport type { HtmlSanitizer, MediaBudgetBinding, RenderMode } from '../types.js';\nimport { WrittenResponse } from '../WrittenResponse/index.js';\n\n/**\n * The option-shuffle seed a preview uses when none is given. Fixed, so a\n * shuffled question holds still while its author edits it instead of\n * re-ordering on every remount.\n */\nconst PREVIEW_SHUFFLE_SEED = 'lk-activity-preview';\n\n/**\n * The slot a previewed activity stands in for. A recording's play budget is\n * keyed to it and lives only in this mount: the preview counts plays so an\n * author hears the limit a learner gets, and records none of them.\n */\nconst PREVIEW_SLOT_ID = 'preview';\n\n/** Numbers the takes a preview mints keys for, so two are never the same take. */\nlet previewTakeCount = 0;\n\n/**\n * The store a previewed read-aloud records into: it keys the take so the whole\n * flow — record, play it back, submit — runs for the author, and keeps it\n * nowhere, like every other thing a preview does not record.\n *\n * It judges nothing, deliberately. `assess` is optional precisely so this can\n * exist: an author trying a reading out has no assessor to point at, and a\n * preview that demanded one would refuse to render the most common case. The\n * default `practice` mode then shows the \"assessment is not available\" notice,\n * which is the truth about this binding rather than a failure.\n */\nconst PREVIEW_RECORDING: RecordingBinding = {\n upload: async (take) => {\n previewTakeCount += 1;\n return {\n key: `${PREVIEW_SLOT_ID}-take-${previewTakeCount}`,\n mimeType: take.mimeType,\n durationMs: take.durationMs,\n };\n },\n};\n\nexport interface ActivityPreviewProps {\n /**\n * The activity as an editor holds it right now, finished or not. It is checked\n * with `validateDraft` before anything renders — by content, on every render —\n * so a half-written question never reaches a component that assumes a valid\n * one.\n */\n draft: unknown;\n /** The mode to preview in. Defaults to `practice`. */\n renderMode?: RenderMode;\n /**\n * A learner response to show as if a learner had given it. In `practice` and\n * `exam` it seeds the answer, which stays editable; in `review` it is the\n * submitted answer, marked by `evaluate()` unless `outcome` is given.\n */\n response?: LearnerResponse;\n /**\n * The outcome `review` marks the response with, instead of the one\n * `evaluate()` computes — which is how to preview a returned grade on a written\n * response, since the SDK cannot score one. Ignored in other modes.\n */\n outcome?: ItemOutcome;\n /**\n * Rendered in place of the activity while the draft is not complete, with the\n * issues `validateDraft` found — so an editor can list them in its own words.\n * The issue messages are English, and a preview that rendered them would put\n * untranslatable text on screen. Without it, the preview shows the\n * `previewIncomplete` or `previewInvalid` string.\n */\n fallback?: (result: DraftNotComplete) => ReactNode;\n /**\n * Renderers for activity types beyond the built-ins, keyed by `type`, as on\n * `<ActivitySequence>`. An entry receives the shared prop contract and\n * nothing else, so — like the shuffle seed below — the in-memory recording\n * binding a previewed read-aloud is given does not reach one.\n */\n renderers?: Readonly<Record<string, ActivityRenderer>>;\n /**\n * Seeds `<MultipleChoice>`'s option shuffle. Defaults to a fixed seed, so the\n * order holds while options are edited; adding or removing one deals them\n * again, because the shuffle orders by position. A `renderers` entry is given\n * no seed, as on `<ActivitySequence>`.\n */\n shuffleSeed?: string;\n /** Renders author-supplied rich text. See `HtmlSanitizer`. */\n sanitizeHtml?: HtmlSanitizer;\n /** Overrides the SDK's chrome text, for the preview's notice and the activity alike. */\n strings?: LkStringsOverride;\n /** Per-instance token overrides, passed to the activity. */\n theme?: Partial<ThemeTokens>;\n /** BCP 47 tag of the interface language, passed to the activity. */\n locale?: string;\n}\n\ntype Marking = { kind: 'marked'; outcome: ItemOutcome } | { kind: 'failed'; error: Error };\n\n/**\n * Renders an activity from an editor's draft, in any render mode, with a\n * simulated learner response — and renders a notice instead while the draft is\n * not an activity yet.\n *\n * Nothing it renders is recorded: no callback is wired, so a practice attempt in\n * a preview scores locally and goes nowhere, and a recording's play limit is\n * counted in memory only.\n *\n * A draft with no string `type`, a type nobody registered, and a `response` of a\n * different type from the draft are wiring errors, and throw.\n */\nexport function ActivityPreview({\n draft,\n renderMode = 'practice',\n response,\n outcome,\n fallback,\n renderers,\n shuffleSeed,\n sanitizeHtml,\n strings,\n theme,\n locale,\n}: ActivityPreviewProps) {\n const s = useLkStrings(strings);\n const type = isRecord(draft) && typeof draft.type === 'string' ? draft.type : undefined;\n\n // Validated on the draft's CONTENT, not its identity. The activity components\n // restart whenever `data` changes identity, and an editor that rebuilds its\n // payload on every change would otherwise restart the question an author is\n // trying out each time anything else on the page was edited. The key is read\n // on every render, so a draft changed in place is checked again too.\n const contentKey = contentKeyOf(draft);\n // biome-ignore lint/correctness/useExhaustiveDependencies: the draft's content (contentKey) is the trigger, not its identity\n const result = useMemo(\n () => (type === undefined ? undefined : validateDraft(type as ActivityType, draft)),\n [type, contentKey],\n );\n const activity = result?.status === 'complete' ? result.data : undefined;\n const responseFits = response === undefined || response.type === type;\n const responseKey = response === undefined ? 'none' : contentKeyOf(response);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: the response's content (responseKey) is the trigger, not its identity\n const marking = useMemo((): Marking | undefined => {\n if (renderMode !== 'review' || activity === undefined) {\n return undefined;\n }\n if (outcome !== undefined) {\n return { kind: 'marked', outcome };\n }\n if (response === undefined || !responseFits) {\n return undefined;\n }\n try {\n return { kind: 'marked', outcome: evaluate(activity, response) };\n } catch (thrown) {\n // Scored here, during this component's own render, where no error boundary\n // inside the activity can catch it — so it is handed to one below.\n return {\n kind: 'failed',\n error: thrown instanceof Error ? thrown : new Error(String(thrown)),\n };\n }\n }, [renderMode, activity, outcome, responseKey, responseFits]);\n\n const activityId = activity?.id;\n const mediaBudget = useMemo<MediaBudgetBinding>(\n () => ({\n key: slotMediaKey(PREVIEW_SLOT_ID),\n slotId: PREVIEW_SLOT_ID,\n index: 0,\n ...(activityId !== undefined ? { activityId } : {}),\n }),\n [activityId],\n );\n\n // All hooks are called before these throws, so hook order stays stable.\n if (type === undefined || result === undefined) {\n throw new Error(\n '<ActivityPreview> needs a draft object with a string `type`, to know which activity to check and render.',\n );\n }\n // Checked against the draft's own type, whatever state the draft is in. A\n // mis-wired response is a wiring error however unfinished the draft is, and\n // waiting for the draft to be complete would throw on the very edit that\n // completes it.\n if (response !== undefined && !responseFits) {\n throw new Error(\n `<ActivityPreview> was given a \"${response.type}\" response for a \"${type}\" activity.`,\n );\n }\n if (result.status !== 'complete') {\n if (fallback !== undefined) {\n return <>{fallback(result)}</>;\n }\n return (\n <div\n className=\"lk-preview-unavailable\"\n role=\"note\"\n data-status={result.status}\n {...(locale !== undefined ? { lang: locale } : {})}\n >\n {result.status === 'invalid' ? s.previewInvalid : s.previewIncomplete}\n </div>\n );\n }\n const data = result.data;\n\n // A different simulated response, or a different mode, mounts the activity\n // afresh, play count included: a seeded answer is read at mount, and a practice\n // attempt the author submitted must not carry over into an exam preview. So\n // does a different recording or playback policy, which is a different listening\n // budget — the transport reads its count once, when it mounts.\n const key = `${renderMode}:${responseKey}:${recordingKeyOf(data)}`;\n\n if (marking?.kind === 'failed') {\n // The response is one the scorer cannot read, or a registered scorer threw.\n // Shown as the activity's error fallback, as a render failure would be.\n return (\n <ActivityErrorBoundary key={key} activityTitle={data.title} strings={s}>\n <Rethrow error={marking.error} />\n </ActivityErrorBoundary>\n );\n }\n\n const shared = {\n renderMode,\n // Without a binding a budgeted recording counts nothing in `practice`, and in\n // `exam` the media component refuses to render at all — rightly, on a real\n // paper, where nothing would persist the count. A preview persists nothing by\n // design, so it keeps the count in memory and says so.\n mediaBudget,\n ...(sanitizeHtml !== undefined ? { sanitizeHtml } : {}),\n ...(strings !== undefined ? { strings } : {}),\n ...(theme !== undefined ? { theme } : {}),\n ...(locale !== undefined ? { locale } : {}),\n // Seeded rather than controlled, in every mode, exactly as `<ActivitySequence>`\n // hands a restored answer to its slots — so a renderer written for the\n // sequence reads it here too. `review` is read-only either way, and `key`\n // above re-seeds whenever the response changes.\n ...(response !== undefined ? { defaultValue: response } : {}),\n ...(marking !== undefined ? { outcome: marking.outcome } : {}),\n };\n\n const Custom = renderers?.[data.type];\n if (Custom !== undefined) {\n return <Custom key={key} data={data} {...shared} />;\n }\n switch (data.type) {\n case 'multiple-choice':\n return (\n <MultipleChoice\n key={key}\n data={data}\n shuffleSeed={shuffleSeed ?? PREVIEW_SHUFFLE_SEED}\n {...shared}\n />\n );\n case 'fill-in-the-blanks':\n return <FillInTheBlanks key={key} data={data} {...shared} />;\n case 'gap-select':\n return (\n <GapSelect\n key={key}\n data={data}\n shuffleSeed={shuffleSeed ?? PREVIEW_SHUFFLE_SEED}\n {...shared}\n />\n );\n case 'written-response':\n return <WrittenResponse key={key} data={data} {...shared} />;\n case 'dictation':\n return <Dictation key={key} data={data} {...shared} />;\n case 'read-aloud':\n return <ReadAloud key={key} data={data} recordingBinding={PREVIEW_RECORDING} {...shared} />;\n default:\n return (\n <div className=\"lk-preview-unsupported\" role=\"note\">\n {s.unsupportedActivity}\n </div>\n );\n }\n}\n\n/** Throws `error` while rendering, so the error boundary around it shows its fallback. */\nfunction Rethrow({ error }: { error: Error }): never {\n throw error;\n}\n\nfunction isRecord(value: unknown): value is Readonly<Record<string, unknown>> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * The recording and its playback policy — not its description, which changes\n * no budget — plus the slower file a dictation or a read-aloud carries, which\n * follows the same policy and must remount when it is swapped for another.\n */\nfunction recordingKeyOf(data: unknown): string {\n const media = isRecord(data) ? data.media : undefined;\n const slowMedia = isRecord(data) ? data.slowMedia : undefined;\n const slowUrl = isRecord(slowMedia) ? slowMedia.url : undefined;\n if (!isRecord(media) && slowUrl === undefined) {\n return '';\n }\n return contentKeyOf([\n isRecord(media) ? media.type : undefined,\n isRecord(media) ? media.url : undefined,\n isRecord(media) ? media.playback : undefined,\n slowUrl,\n ]);\n}\n\nconst identities = new WeakMap<object, number>();\nlet lastIdentity = 0;\n\n/** A key for a value compared by identity: the same object always gets the same one. */\nfunction identityKeyOf(value: object): string {\n let identity = identities.get(value);\n if (identity === undefined) {\n lastIdentity += 1;\n identity = lastIdentity;\n identities.set(value, identity);\n }\n return `#${identity}`;\n}\n\n/**\n * A string that changes exactly when a value's content does.\n *\n * Object keys are sorted, because key order is not content: a draft saved to a\n * JSON column comes back with its keys reordered. Every value is written in a\n * form no other value shares — JSON would write a non-finite number as `null`\n * and drop `undefined`, and those decide different issues. What JSON does not\n * describe — an instance of a class, a function, a reference back to an\n * enclosing object — is compared by identity, and a symbol by its description.\n */\nfunction contentKeyOf(value: unknown, enclosing: Set<object> = new Set()): string {\n switch (typeof value) {\n case 'string':\n return JSON.stringify(value);\n case 'number':\n // `String` keeps NaN, the infinities and every other number apart; only -0\n // needs saying.\n return Object.is(value, -0) ? '-0' : String(value);\n case 'bigint':\n return `${value}n`;\n case 'boolean':\n case 'undefined':\n return String(value);\n case 'symbol':\n return `Symbol(${JSON.stringify(value.description ?? null)})`;\n case 'function':\n return identityKeyOf(value);\n }\n // Every other `typeof` has returned above: this is `null`, or an object.\n if (value === null || typeof value !== 'object') {\n return 'null';\n }\n const prototype = Object.getPrototypeOf(value);\n const plain = Array.isArray(value) || prototype === Object.prototype || prototype === null;\n if (!plain || enclosing.has(value)) {\n return identityKeyOf(value);\n }\n enclosing.add(value);\n try {\n if (Array.isArray(value)) {\n return `[${Array.from(value, (item) => contentKeyOf(item, enclosing)).join(',')}]`;\n }\n const record = value as Record<string, unknown>;\n const fields = Object.keys(record)\n .sort()\n .map((field) => `${JSON.stringify(field)}:${contentKeyOf(record[field], enclosing)}`);\n return `{${fields.join(',')}}`;\n } finally {\n enclosing.delete(value);\n }\n}\n"]}
@@ -0,0 +1,155 @@
1
+ 'use client';
2
+ // src/i18n/direction.ts
3
+ var RTL_SCRIPT_CODES = /* @__PURE__ */ new Set([
4
+ "phlv",
5
+ "adlm",
6
+ "arab",
7
+ "aran",
8
+ "armi",
9
+ "avst",
10
+ "chrs",
11
+ "cprt",
12
+ "elym",
13
+ "gara",
14
+ "hatr",
15
+ "hebr",
16
+ "hung",
17
+ "khar",
18
+ "lydi",
19
+ "mand",
20
+ "mani",
21
+ "mend",
22
+ "merc",
23
+ "mero",
24
+ "narb",
25
+ "nbat",
26
+ "nkoo",
27
+ "orkh",
28
+ "ougr",
29
+ "palm",
30
+ "phli",
31
+ "phlp",
32
+ "phnx",
33
+ "prti",
34
+ "rohg",
35
+ "samr",
36
+ "sarb",
37
+ "sidt",
38
+ "sogd",
39
+ "sogo",
40
+ "syrc",
41
+ "syre",
42
+ "syrj",
43
+ "syrn",
44
+ "thaa",
45
+ "yezi"
46
+ ]);
47
+ var RTL_LANGUAGES = /* @__PURE__ */ new Set([
48
+ "acm",
49
+ "aeb",
50
+ "aii",
51
+ "ajp",
52
+ "apc",
53
+ "ar",
54
+ "arc",
55
+ "ars",
56
+ "ary",
57
+ "arz",
58
+ "azb",
59
+ "bqi",
60
+ "ckb",
61
+ "dv",
62
+ "fa",
63
+ "glk",
64
+ "hbo",
65
+ "he",
66
+ "iw",
67
+ "ji",
68
+ "jrb",
69
+ "khw",
70
+ "lrc",
71
+ "mzn",
72
+ "nqo",
73
+ "ota",
74
+ "pnb",
75
+ "prs",
76
+ "ps",
77
+ "sdh",
78
+ "skr",
79
+ "syc",
80
+ "syr",
81
+ "ur",
82
+ "yi"
83
+ ]);
84
+ var RTL_BLOCKS = [
85
+ [1424, 2303],
86
+ [64285, 65023],
87
+ [65136, 65279],
88
+ [67584, 69631],
89
+ [124928, 126975]
90
+ ];
91
+ var RTL_DIGITS = [
92
+ [1984, 1993],
93
+ [125127, 125135],
94
+ [125264, 125273]
95
+ ];
96
+ var LETTER_RE = /^\p{L}$/u;
97
+ var NUMBER_RE = /^\p{N}$/u;
98
+ function within(point, ranges) {
99
+ return ranges.some(([first, last]) => point >= first && point <= last);
100
+ }
101
+ function scriptSubtagOf(subtags) {
102
+ if (subtags[0].length === 1) {
103
+ return void 0;
104
+ }
105
+ let index = 1;
106
+ while (index < subtags.length && index <= 3 && /^[a-z]{3}$/.test(subtags[index])) {
107
+ index += 1;
108
+ }
109
+ const candidate = subtags[index];
110
+ if (candidate === void 0 || !/^[a-z]{4}$/.test(candidate)) {
111
+ return void 0;
112
+ }
113
+ return /^z/.test(candidate) || candidate >= "qaaa" && candidate <= "qabx" ? void 0 : candidate;
114
+ }
115
+ function localeDirectionOf(locale) {
116
+ if (typeof locale !== "string") {
117
+ return void 0;
118
+ }
119
+ const subtags = locale.toLowerCase().split(/[-_]/);
120
+ const script = scriptSubtagOf(subtags);
121
+ if (script !== void 0) {
122
+ return RTL_SCRIPT_CODES.has(script) ? "rtl" : "ltr";
123
+ }
124
+ return RTL_LANGUAGES.has(subtags[0]) ? "rtl" : void 0;
125
+ }
126
+ var LEFT_TO_RIGHT_MARK = String.fromCodePoint(8206);
127
+ var RIGHT_TO_LEFT_MARKS = /* @__PURE__ */ new Set([String.fromCodePoint(8207), String.fromCodePoint(1564)]);
128
+ function textDirectionOf(text) {
129
+ for (const character of text) {
130
+ if (character === LEFT_TO_RIGHT_MARK) {
131
+ return "ltr";
132
+ }
133
+ if (RIGHT_TO_LEFT_MARKS.has(character)) {
134
+ return "rtl";
135
+ }
136
+ if (LETTER_RE.test(character)) {
137
+ return within(character.codePointAt(0), RTL_BLOCKS) ? "rtl" : "ltr";
138
+ }
139
+ }
140
+ return void 0;
141
+ }
142
+ function characterDirectionOf(character) {
143
+ const point = character.codePointAt(0);
144
+ if (NUMBER_RE.test(character)) {
145
+ return within(point, RTL_DIGITS) ? "rtl" : "ltr";
146
+ }
147
+ if (LETTER_RE.test(character)) {
148
+ return within(point, RTL_BLOCKS) ? "rtl" : "ltr";
149
+ }
150
+ return void 0;
151
+ }
152
+
153
+ export { characterDirectionOf, localeDirectionOf, textDirectionOf };
154
+ //# sourceMappingURL=chunk-YORQQXGO.js.map
155
+ //# sourceMappingURL=chunk-YORQQXGO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/i18n/direction.ts"],"names":[],"mappings":";AAQA,IAAM,gBAAA,uBAAuB,GAAA,CAAI;AAAA,EAC/B,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAC,CAAA;AAQD,IAAM,aAAA,uBAAoB,GAAA,CAAI;AAAA,EAC5B,KAAA;AAAA,EACA,KAAA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YxF,SAAS,gBAAgB,IAAA,EAAyC;AACvE,EAAA,KAAA,MAAW,aAAa,IAAA,EAAM;AAC5B,IAAA,IAAI,cAAc,kBAAA,EAAoB;AACpC,MAAA,OAAO,KAAA;AAAA,IACT;AACA,IAAA,IAAI,mBAAA,CAAoB,GAAA,CAAI,SAAS,CAAA,EAAG;AACtC,MAAA,OAAO,KAAA;AAAA,IACT;AACA,IAAA,IAAI,SAAA,CAAU,IAAA,CAAK,SAAS,CAAA,EAAG;AAC7B,MAAA,OAAO,OAAO,SAAA,CAAU,WAAA,CAAY,CAAC,CAAA,EAAa,UAAU,IAAI,KAAA,GAAQ,KAAA;AAAA,IAC1E;AAAA,EACF;AACA,EAAA,OAAO,MAAA;AACT;AAQO,SAAS,qBAAqB,SAAA,EAA8C;AACjF,EAAA,MAAM,KAAA,GAAQ,SAAA,CAAU,WAAA,CAAY,CAAC,CAAA;AACrC,EAAA,IAAI,SAAA,CAAU,IAAA,CAAK,SAAS,CAAA,EAAG;AAC7B,IAAA,OAAO,MAAA,CAAO,KAAA,EAAO,UAAU,CAAA,GAAI,KAAA,GAAQ,KAAA;AAAA,EAC7C;AACA,EAAA,IAAI,SAAA,CAAU,IAAA,CAAK,SAAS,CAAA,EAAG;AAC7B,IAAA,OAAO,MAAA,CAAO,KAAA,EAAO,UAAU,CAAA,GAAI,KAAA,GAAQ,KAAA;AAAA,EAC7C;AACA,EAAA,OAAO,MAAA;AACT","file":"chunk-YORQQXGO.js","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"]}
@@ -1,22 +1,27 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkNVUFEMPZ_cjs = require('../chunk-NVUFEMPZ.cjs');
5
- require('../chunk-K7NMNOPI.cjs');
6
- require('../chunk-Z63JRG4M.cjs');
7
- require('../chunk-2GXSA322.cjs');
8
- require('../chunk-J73TDY7J.cjs');
9
- require('../chunk-UU2NV6SU.cjs');
10
- require('../chunk-K3EA547J.cjs');
11
- require('../chunk-SBIJJ374.cjs');
4
+ var chunkBVRUUYYR_cjs = require('../chunk-BVRUUYYR.cjs');
5
+ require('../chunk-YEYKJFEC.cjs');
6
+ require('../chunk-NDQD3ZRY.cjs');
7
+ require('../chunk-SE6WWDVW.cjs');
8
+ require('../chunk-U3APKQ7P.cjs');
9
+ require('../chunk-WTS34S5E.cjs');
10
+ require('../chunk-36FTYJWJ.cjs');
11
+ require('../chunk-F4TBCRGI.cjs');
12
+ require('../chunk-UDCQTOVU.cjs');
13
+ require('../chunk-OD65OZIW.cjs');
14
+ require('../chunk-BRPEB43C.cjs');
15
+ require('../chunk-USBANZ7K.cjs');
16
+ require('../chunk-B2XQLU2E.cjs');
12
17
  require('../chunk-XOR4MPEN.cjs');
13
- require('../chunk-MA7GXUWC.cjs');
18
+ require('../chunk-LB3FEV7Z.cjs');
14
19
 
15
20
 
16
21
 
17
22
  Object.defineProperty(exports, "ActivityPreview", {
18
23
  enumerable: true,
19
- get: function () { return chunkNVUFEMPZ_cjs.ActivityPreview; }
24
+ get: function () { return chunkBVRUUYYR_cjs.ActivityPreview; }
20
25
  });
21
26
  //# sourceMappingURL=ActivityPreview.cjs.map
22
27
  //# sourceMappingURL=ActivityPreview.cjs.map
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { LearnerResponse, ItemOutcome, DraftNotComplete, ThemeTokens } from '@intellectif/lk-core';
3
3
  import { ReactNode } from 'react';
4
- import { R as RenderMode, H as HtmlSanitizer, a as LkStringsOverride } from '../strings-DPTyLpHt.cjs';
4
+ import { e as RenderMode, H as HtmlSanitizer, a as LkStringsOverride } from '../strings--ADnHcaA.cjs';
5
5
  import { ActivityRenderer } from './ActivitySequence.cjs';
6
- import '../WrittenResponse-DWtS4tOL.cjs';
6
+ import '../machine-CuwKqWXC.cjs';
7
+ import '../WrittenResponse-pB1ik8hg.cjs';
7
8
 
8
9
  interface ActivityPreviewProps {
9
10
  /**
@@ -35,7 +36,12 @@ interface ActivityPreviewProps {
35
36
  * `previewIncomplete` or `previewInvalid` string.
36
37
  */
37
38
  fallback?: (result: DraftNotComplete) => ReactNode;
38
- /** Renderers for activity types beyond the built-ins, keyed by `type`, as on `<ActivitySequence>`. */
39
+ /**
40
+ * Renderers for activity types beyond the built-ins, keyed by `type`, as on
41
+ * `<ActivitySequence>`. An entry receives the shared prop contract and
42
+ * nothing else, so — like the shuffle seed below — the in-memory recording
43
+ * binding a previewed read-aloud is given does not reach one.
44
+ */
39
45
  renderers?: Readonly<Record<string, ActivityRenderer>>;
40
46
  /**
41
47
  * Seeds `<MultipleChoice>`'s option shuffle. Defaults to a fixed seed, so the
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { LearnerResponse, ItemOutcome, DraftNotComplete, ThemeTokens } from '@intellectif/lk-core';
3
3
  import { ReactNode } from 'react';
4
- import { R as RenderMode, H as HtmlSanitizer, a as LkStringsOverride } from '../strings-DPTyLpHt.js';
4
+ import { e as RenderMode, H as HtmlSanitizer, a as LkStringsOverride } from '../strings-CtdSf2St.js';
5
5
  import { ActivityRenderer } from './ActivitySequence.js';
6
- import '../WrittenResponse-B5p_-RnJ.js';
6
+ import '../machine-CuwKqWXC.js';
7
+ import '../WrittenResponse-C0P34En1.js';
7
8
 
8
9
  interface ActivityPreviewProps {
9
10
  /**
@@ -35,7 +36,12 @@ interface ActivityPreviewProps {
35
36
  * `previewIncomplete` or `previewInvalid` string.
36
37
  */
37
38
  fallback?: (result: DraftNotComplete) => ReactNode;
38
- /** Renderers for activity types beyond the built-ins, keyed by `type`, as on `<ActivitySequence>`. */
39
+ /**
40
+ * Renderers for activity types beyond the built-ins, keyed by `type`, as on
41
+ * `<ActivitySequence>`. An entry receives the shared prop contract and
42
+ * nothing else, so — like the shuffle seed below — the in-memory recording
43
+ * binding a previewed read-aloud is given does not reach one.
44
+ */
39
45
  renderers?: Readonly<Record<string, ActivityRenderer>>;
40
46
  /**
41
47
  * Seeds `<MultipleChoice>`'s option shuffle. Defaults to a fixed seed, so the
@@ -1,13 +1,18 @@
1
1
  'use client';
2
- export { ActivityPreview } from '../chunk-PY53ABWC.js';
3
- import '../chunk-5N7OLFHB.js';
4
- import '../chunk-XAGWBVK3.js';
5
- import '../chunk-W4MXRZAB.js';
6
- import '../chunk-PSHNTDKG.js';
7
- import '../chunk-YZWXVZB3.js';
8
- import '../chunk-DQERNAWI.js';
9
- import '../chunk-R7DI5UMU.js';
2
+ export { ActivityPreview } from '../chunk-YMBBM5K7.js';
3
+ import '../chunk-LLXCX5KK.js';
4
+ import '../chunk-LGCUOLP6.js';
5
+ import '../chunk-72UGRIMM.js';
6
+ import '../chunk-XUEIUEPI.js';
7
+ import '../chunk-47HHC4GD.js';
8
+ import '../chunk-D57QZILZ.js';
9
+ import '../chunk-62AKSD5Y.js';
10
+ import '../chunk-MCO52PV5.js';
11
+ import '../chunk-YORQQXGO.js';
12
+ import '../chunk-RCMYEWBE.js';
13
+ import '../chunk-BO6P723E.js';
14
+ import '../chunk-XIBOFTOL.js';
10
15
  import '../chunk-6N43WDVG.js';
11
- import '../chunk-3Q4I4KT6.js';
16
+ import '../chunk-TDJEKXEP.js';
12
17
  //# sourceMappingURL=ActivityPreview.js.map
13
18
  //# sourceMappingURL=ActivityPreview.js.map
@@ -1,23 +1,28 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkHT4FFZZQ_cjs = require('../chunk-HT4FFZZQ.cjs');
5
- require('../chunk-74QXBWCI.cjs');
6
- require('../chunk-K7NMNOPI.cjs');
7
- require('../chunk-Z63JRG4M.cjs');
8
- require('../chunk-2GXSA322.cjs');
9
- require('../chunk-J73TDY7J.cjs');
10
- require('../chunk-UU2NV6SU.cjs');
11
- require('../chunk-K3EA547J.cjs');
12
- require('../chunk-SBIJJ374.cjs');
4
+ var chunkJ2CDPIRC_cjs = require('../chunk-J2CDPIRC.cjs');
5
+ require('../chunk-RRH7ZPXC.cjs');
6
+ require('../chunk-YEYKJFEC.cjs');
7
+ require('../chunk-NDQD3ZRY.cjs');
8
+ require('../chunk-SE6WWDVW.cjs');
9
+ require('../chunk-U3APKQ7P.cjs');
10
+ require('../chunk-WTS34S5E.cjs');
11
+ require('../chunk-36FTYJWJ.cjs');
12
+ require('../chunk-F4TBCRGI.cjs');
13
+ require('../chunk-UDCQTOVU.cjs');
14
+ require('../chunk-OD65OZIW.cjs');
15
+ require('../chunk-BRPEB43C.cjs');
16
+ require('../chunk-USBANZ7K.cjs');
17
+ require('../chunk-B2XQLU2E.cjs');
13
18
  require('../chunk-XOR4MPEN.cjs');
14
- require('../chunk-MA7GXUWC.cjs');
19
+ require('../chunk-LB3FEV7Z.cjs');
15
20
 
16
21
 
17
22
 
18
23
  Object.defineProperty(exports, "ActivitySequence", {
19
24
  enumerable: true,
20
- get: function () { return chunkHT4FFZZQ_cjs.ActivitySequence; }
25
+ get: function () { return chunkJ2CDPIRC_cjs.ActivitySequence; }
21
26
  });
22
27
  //# sourceMappingURL=ActivitySequence.cjs.map
23
28
  //# sourceMappingURL=ActivitySequence.cjs.map
@@ -1,13 +1,29 @@
1
- import { SequenceEntry, ActivityResult, LearnerResponse, InteractionEvent, ItemOutcome, ThemeTokens } from '@intellectif/lk-core';
1
+ import { SequenceEntry, ActivityResult, LearnerResponse, InteractionEvent, SpeechAssessment, ItemOutcome, ThemeTokens } from '@intellectif/lk-core';
2
2
  import { ComponentType } from 'react';
3
- import { A as ActivityProps, d as RenderableActivity, R as RenderMode, S as SequenceMediaBudget, a as LkStringsOverride, H as HtmlSanitizer } from '../strings-DPTyLpHt.cjs';
4
- import { a as WrittenResponseSubmission } from '../WrittenResponse-DWtS4tOL.cjs';
3
+ import { A as ActivityProps, g as RenderableActivity, e as RenderMode, S as SequenceMediaBudget, h as SequenceRecordingBinding, a as LkStringsOverride, H as HtmlSanitizer } from '../strings--ADnHcaA.cjs';
4
+ import { a as WrittenResponseSubmission } from '../WrittenResponse-pB1ik8hg.cjs';
5
+ import '../machine-CuwKqWXC.cjs';
5
6
 
6
7
  /**
7
8
  * What one finished slot in a sequence produced. Two kinds, because two kinds
8
9
  * of activity exist: those the SDK scores at submit time, and those a grader
9
10
  * scores later. Collapsing them would mean inventing a score for ungraded
10
11
  * work — the exact defect the deferred outcome exists to prevent.
12
+ *
13
+ * **A read-aloud hand-in adds no arm here, deliberately.** The obvious home for
14
+ * a handed-in take is `submitted`, and it is the wrong one: that arm's payload
15
+ * is typed `WrittenResponseSubmission`, this union is published from both the
16
+ * barrel and the `components/ActivitySequence` subpath, and a consumer narrows
17
+ * on `kind === 'submitted'` and reads `.text`. Widening the payload to a union
18
+ * would break every one of those reads — a breaking change to a published
19
+ * discriminated union, bought for a type that `responded` already describes: a
20
+ * read-aloud hand-in IS a raw `LearnerResponse` with no grade, which is exactly
21
+ * what `responded` carries.
22
+ *
23
+ * What a read-aloud does add is `unsubmitted`, for the one thing no existing
24
+ * arm can say honestly: a take that never reached storage. Any response would
25
+ * be a lie about it — a `recording` of `null` is the blank a learner chooses,
26
+ * and grades as 0.
11
27
  */
12
28
  type SequenceItemOutcome = {
13
29
  kind: 'scored';
@@ -17,6 +33,14 @@ type SequenceItemOutcome = {
17
33
  slotId: string;
18
34
  activityId: string;
19
35
  result: ActivityResult;
36
+ /**
37
+ * The answer this score grades, for a slot whose grade arrives after its
38
+ * answer was handed in and whose learner may hand in another: a
39
+ * `practice` read-aloud, whose `response.recording` names the take the
40
+ * score belongs to. Absent for every other slot, whose score and answer
41
+ * arrive together.
42
+ */
43
+ response?: LearnerResponse;
20
44
  } | {
21
45
  kind: 'submitted';
22
46
  index: number;
@@ -44,8 +68,28 @@ type SequenceItemOutcome = {
44
68
  * The raw answer, with no grade of any kind. This is what an `exam` slot
45
69
  * produces: the client is forbidden to score, so a response is all there
46
70
  * is until the server grades it.
71
+ *
72
+ * A read-aloud `recording` of `null` here is always a blank the learner
73
+ * chose to hand in, never a take that failed to upload — that is
74
+ * `unsubmitted`.
47
75
  */
48
76
  response: LearnerResponse;
77
+ } | {
78
+ /**
79
+ * A question the learner tried to answer and could not hand in, and then
80
+ * left: a `practice` read-aloud whose take never reached your storage. It
81
+ * carries no response, because there is none.
82
+ *
83
+ * Deliberately not `responded` with a `recording` of `null`: that is the
84
+ * blank a learner chooses, and a grader marks it 0 with every word
85
+ * omitted — which would turn a storage outage into a zero. Grade nothing
86
+ * for this slot; the learner can still return to it, and a take stored
87
+ * then reaches you through `onSubmit`.
88
+ */
89
+ kind: 'unsubmitted';
90
+ index: number;
91
+ slotId: string;
92
+ activityId: string;
49
93
  };
50
94
  /**
51
95
  * A component that can render one activity inside a sequence. Register one per
@@ -69,6 +113,13 @@ interface ActivitySequenceProps {
69
113
  * Renderers for activity types beyond the built-ins, keyed by `data.type`.
70
114
  * A key matching a built-in overrides it, so a consumer can replace the
71
115
  * bundled renderer without forking the sequencer.
116
+ *
117
+ * A registered renderer is an `ActivityRenderer`, which is
118
+ * `ComponentType<ActivityProps>` — so it receives the shared prop contract
119
+ * and nothing beyond it. `shuffleSeed`, `recordingBinding` and `assessment`
120
+ * are all outside that contract and none of them reaches an override: a
121
+ * replacement for `read-aloud` has to be given its own binding by whoever
122
+ * wrote it.
72
123
  */
73
124
  renderers?: Readonly<Record<string, ActivityRenderer>>;
74
125
  /**
@@ -105,12 +156,44 @@ interface ActivitySequenceProps {
105
156
  * use `onFinished` for mixed sets — it is the general completion signal and
106
157
  * reports both kinds of outcome. It also carries `slotId` per item, which
107
158
  * this callback's bare array cannot.
159
+ *
160
+ * It fires straight after `onFinished`, with the same results, or never: a
161
+ * set `onFinished` reported with an ungraded slot is not reported here later,
162
+ * when a re-recorded take is graded.
108
163
  */
109
164
  onComplete?: (results: ActivityResult[]) => void;
110
165
  /**
111
166
  * Called once every activity has been completed, whether it was scored at
112
167
  * submit time or submitted for later grading. Use this for any set that
113
168
  * mixes graded and deferred-graded activities.
169
+ *
170
+ * **Once per set**, and that matters for a `practice` read-aloud, whose grade
171
+ * arrives after the submit that completed the slot. When the last slot is
172
+ * filled while a read-aloud's take is still being stored or assessed, this
173
+ * waits for it and reports the set then — with the grade in place, or with
174
+ * the slot's raw `responded` outcome when the take came back with no grade.
175
+ * A take that never settles is a question still being answered, so the set
176
+ * is not reported while it runs.
177
+ *
178
+ * **A failure the learner can still retry is in flight too.** While a take
179
+ * that failed to upload, or whose assessment failed, is offered "Try again"
180
+ * on the question the learner is looking at, the set is not reported: the
181
+ * retry may yet store and grade it. It completes once the learner moves to
182
+ * another question — as the last take the slot stored, or as `unsubmitted`
183
+ * when it never stored one, which is never a blank.
184
+ *
185
+ * **A score and a response always describe the same take.** A read-aloud
186
+ * recorded again replaces the earlier take's grade with the new take's
187
+ * `responded`, and a result that arrives for a take the learner has since
188
+ * replaced, or for a paper no longer on screen, is not recorded at all.
189
+ *
190
+ * `onComplete` fires in the same report or not at all, so the two never
191
+ * describe one set differently. What arrives after the set was reported is
192
+ * not reported here again, because a consumer who persists on this callback
193
+ * must not write one attempt twice: a later take reaches you through
194
+ * `onSubmit`, and its grade through `onActivityComplete`, the per-item persist
195
+ * hook keyed by `slotId` — which only ever grades the answer `onSubmit` last
196
+ * reported for that slot.
114
197
  */
115
198
  onFinished?: (items: SequenceItemOutcome[]) => void;
116
199
  /** Forwarded to each activity. */
@@ -127,6 +210,27 @@ interface ActivitySequenceProps {
127
210
  * {@link SequenceMediaBudget}.
128
211
  */
129
212
  mediaBudget?: SequenceMediaBudget;
213
+ /**
214
+ * Where every read-aloud take in this sequence is stored, and how a
215
+ * judgement comes back. Required by any `read-aloud` slot outside `review`:
216
+ * the component refuses to render a recorder whose take is stored nowhere.
217
+ *
218
+ * Named `recordingBinding` rather than `recording` because both
219
+ * `ReadAloudData.recording` (the bounds an item declares) and
220
+ * `ReadAloudLearnerResponse.recording` (the take a learner handed in) already
221
+ * exist — the plain name would read as one of those. Same name at both
222
+ * levels, different types, as `mediaBudget` has.
223
+ */
224
+ recordingBinding?: SequenceRecordingBinding;
225
+ /**
226
+ * Speech assessments keyed by `slotId`, forwarded to the matching read-aloud
227
+ * slot so `review` can show the per-word marks behind a stored grade.
228
+ *
229
+ * Read LIVE, like `outcomes` and unlike `responses`: an assessment is fetched
230
+ * beside the attempt it explains and lands after the first paint, and a
231
+ * mount-only read would show the grade with no marks under it for ever.
232
+ */
233
+ assessments?: Readonly<Record<string, SpeechAssessment>>;
130
234
  /** Overrides the SDK's chrome text for this sequence. See {@link LkIntlProvider}. */
131
235
  strings?: LkStringsOverride;
132
236
  /**
@@ -213,6 +317,6 @@ interface ActivitySequenceProps {
213
317
  locale?: string;
214
318
  disabled?: boolean;
215
319
  }
216
- declare function ActivitySequence({ activities, renderers, onActivityComplete, onComplete, onFinished, onSubmit, onInteraction, renderMode, shuffle, shuffleSeed, defaultIndex, onIndexChange, responses, submittedSlotIds, outcomes, sanitizeHtml, theme, locale, disabled, mediaBudget, strings, }: ActivitySequenceProps): React.JSX.Element;
320
+ declare function ActivitySequence({ activities, renderers, onActivityComplete, onComplete, onFinished, onSubmit, onInteraction, renderMode, shuffle, shuffleSeed, defaultIndex, onIndexChange, responses, submittedSlotIds, outcomes, sanitizeHtml, theme, locale, disabled, mediaBudget, recordingBinding, assessments, strings, }: ActivitySequenceProps): React.JSX.Element;
217
321
 
218
322
  export { type ActivityRenderer, ActivitySequence, type ActivitySequenceProps, type SequenceItemOutcome };