@intellectif/lk-react 1.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 (76) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chunk-5HVUKXF3.js +28 -0
  3. package/dist/chunk-5HVUKXF3.js.map +1 -0
  4. package/dist/chunk-5KW7TFX3.js +240 -0
  5. package/dist/chunk-5KW7TFX3.js.map +1 -0
  6. package/dist/chunk-6OBRYL4C.cjs +84 -0
  7. package/dist/chunk-6OBRYL4C.cjs.map +1 -0
  8. package/dist/chunk-B3FUUKZ2.js +91 -0
  9. package/dist/chunk-B3FUUKZ2.js.map +1 -0
  10. package/dist/chunk-CPF2JJG6.cjs +96 -0
  11. package/dist/chunk-CPF2JJG6.cjs.map +1 -0
  12. package/dist/chunk-HD2AIQRD.cjs +30 -0
  13. package/dist/chunk-HD2AIQRD.cjs.map +1 -0
  14. package/dist/chunk-IZNMQSQP.js +65 -0
  15. package/dist/chunk-IZNMQSQP.js.map +1 -0
  16. package/dist/chunk-L3EV5LIX.js +77 -0
  17. package/dist/chunk-L3EV5LIX.js.map +1 -0
  18. package/dist/chunk-O3GWWJFS.cjs +242 -0
  19. package/dist/chunk-O3GWWJFS.cjs.map +1 -0
  20. package/dist/chunk-QBA6UXMS.cjs +160 -0
  21. package/dist/chunk-QBA6UXMS.cjs.map +1 -0
  22. package/dist/chunk-RI53A36N.cjs +98 -0
  23. package/dist/chunk-RI53A36N.cjs.map +1 -0
  24. package/dist/chunk-TVK3SVV6.cjs +67 -0
  25. package/dist/chunk-TVK3SVV6.cjs.map +1 -0
  26. package/dist/chunk-W2L66WHW.js +158 -0
  27. package/dist/chunk-W2L66WHW.js.map +1 -0
  28. package/dist/chunk-ZPD7BGCF.js +96 -0
  29. package/dist/chunk-ZPD7BGCF.js.map +1 -0
  30. package/dist/components/ActivitySequence.cjs +16 -0
  31. package/dist/components/ActivitySequence.cjs.map +1 -0
  32. package/dist/components/ActivitySequence.d.cts +25 -0
  33. package/dist/components/ActivitySequence.d.ts +25 -0
  34. package/dist/components/ActivitySequence.js +7 -0
  35. package/dist/components/ActivitySequence.js.map +1 -0
  36. package/dist/components/FillInTheBlanks.cjs +14 -0
  37. package/dist/components/FillInTheBlanks.cjs.map +1 -0
  38. package/dist/components/FillInTheBlanks.d.cts +21 -0
  39. package/dist/components/FillInTheBlanks.d.ts +21 -0
  40. package/dist/components/FillInTheBlanks.js +5 -0
  41. package/dist/components/FillInTheBlanks.js.map +1 -0
  42. package/dist/components/MultipleChoice.cjs +14 -0
  43. package/dist/components/MultipleChoice.cjs.map +1 -0
  44. package/dist/components/MultipleChoice.d.cts +12 -0
  45. package/dist/components/MultipleChoice.d.ts +12 -0
  46. package/dist/components/MultipleChoice.js +5 -0
  47. package/dist/components/MultipleChoice.js.map +1 -0
  48. package/dist/hooks/useActivityState.cjs +12 -0
  49. package/dist/hooks/useActivityState.cjs.map +1 -0
  50. package/dist/hooks/useActivityState.d.cts +22 -0
  51. package/dist/hooks/useActivityState.d.ts +22 -0
  52. package/dist/hooks/useActivityState.js +3 -0
  53. package/dist/hooks/useActivityState.js.map +1 -0
  54. package/dist/hooks/useXAPI.cjs +12 -0
  55. package/dist/hooks/useXAPI.cjs.map +1 -0
  56. package/dist/hooks/useXAPI.d.cts +15 -0
  57. package/dist/hooks/useXAPI.d.ts +15 -0
  58. package/dist/hooks/useXAPI.js +3 -0
  59. package/dist/hooks/useXAPI.js.map +1 -0
  60. package/dist/index.cjs +50 -0
  61. package/dist/index.cjs.map +1 -0
  62. package/dist/index.d.cts +10 -0
  63. package/dist/index.d.ts +10 -0
  64. package/dist/index.js +9 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/theme/ThemeProvider.cjs +24 -0
  67. package/dist/theme/ThemeProvider.cjs.map +1 -0
  68. package/dist/theme/ThemeProvider.d.cts +39 -0
  69. package/dist/theme/ThemeProvider.d.ts +39 -0
  70. package/dist/theme/ThemeProvider.js +3 -0
  71. package/dist/theme/ThemeProvider.js.map +1 -0
  72. package/dist/theme/defaults.css +50 -0
  73. package/dist/theme/skin.css +352 -0
  74. package/dist/types-iknDq5tf.d.cts +17 -0
  75. package/dist/types-iknDq5tf.d.ts +17 -0
  76. package/package.json +86 -0
@@ -0,0 +1,96 @@
1
+ import { MultipleChoice } from './chunk-W2L66WHW.js';
2
+ import { FillInTheBlanks } from './chunk-5KW7TFX3.js';
3
+ import { useState, useRef, useEffect } from 'react';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ function ActivitySequence({
7
+ activities,
8
+ onActivityComplete,
9
+ onComplete,
10
+ onInteraction,
11
+ theme,
12
+ locale,
13
+ disabled
14
+ }) {
15
+ const [index, setIndex] = useState(0);
16
+ const [results, setResults] = useState(
17
+ () => activities.map(() => null)
18
+ );
19
+ const regionRef = useRef(null);
20
+ const mountedRef = useRef(false);
21
+ useEffect(() => {
22
+ if (mountedRef.current) {
23
+ regionRef.current?.focus();
24
+ } else {
25
+ mountedRef.current = true;
26
+ }
27
+ }, [index]);
28
+ const total = activities.length;
29
+ const current = activities[index];
30
+ const go = (next) => {
31
+ setIndex(next);
32
+ };
33
+ const handleComplete = (result) => {
34
+ const nextResults = results.slice();
35
+ nextResults[index] = result;
36
+ setResults(nextResults);
37
+ onActivityComplete?.(result, index);
38
+ if (nextResults.every((r) => r !== null)) {
39
+ onComplete?.(nextResults);
40
+ }
41
+ };
42
+ if (!current) {
43
+ return /* @__PURE__ */ jsx("div", { className: "lk-seq" });
44
+ }
45
+ const childProps = {
46
+ onComplete: handleComplete,
47
+ ...onInteraction ? { onInteraction } : {},
48
+ ...theme ? { theme } : {},
49
+ ...locale ? { locale } : {},
50
+ ...disabled ? { disabled } : {}
51
+ };
52
+ return /* @__PURE__ */ jsxs("div", { className: "lk-seq", lang: locale, children: [
53
+ /* @__PURE__ */ jsxs("div", { className: "lk-seq-progress", "aria-live": "polite", role: "status", children: [
54
+ "Question ",
55
+ index + 1,
56
+ " of ",
57
+ total
58
+ ] }),
59
+ /* @__PURE__ */ jsx(
60
+ "section",
61
+ {
62
+ className: "lk-seq-question",
63
+ ref: regionRef,
64
+ tabIndex: -1,
65
+ "aria-label": `Question ${index + 1} of ${total}`,
66
+ children: current.type === "multiple-choice" ? /* @__PURE__ */ jsx(MultipleChoice, { data: current, ...childProps }) : /* @__PURE__ */ jsx(FillInTheBlanks, { data: current, ...childProps })
67
+ }
68
+ ),
69
+ /* @__PURE__ */ jsxs("div", { className: "lk-seq-nav", children: [
70
+ /* @__PURE__ */ jsx(
71
+ "button",
72
+ {
73
+ type: "button",
74
+ className: "lk-seq-prev",
75
+ onClick: () => go(index - 1),
76
+ disabled: index === 0,
77
+ children: "Previous"
78
+ }
79
+ ),
80
+ /* @__PURE__ */ jsx(
81
+ "button",
82
+ {
83
+ type: "button",
84
+ className: "lk-seq-next",
85
+ onClick: () => go(index + 1),
86
+ disabled: index === total - 1,
87
+ children: "Next"
88
+ }
89
+ )
90
+ ] })
91
+ ] });
92
+ }
93
+
94
+ export { ActivitySequence };
95
+ //# sourceMappingURL=chunk-ZPD7BGCF.js.map
96
+ //# sourceMappingURL=chunk-ZPD7BGCF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ActivitySequence/ActivitySequence.tsx"],"names":[],"mappings":";;;;;AAiCO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,UAAA;AAAA,EACA,kBAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAA6C;AAC3C,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAS,CAAC,CAAA;AACpC,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,QAAA;AAAA,IAAoC,MAChE,UAAA,CAAW,GAAA,CAAI,MAAM,IAAI;AAAA,GAC3B;AACA,EAAA,MAAM,SAAA,GAAY,OAAuB,IAAI,CAAA;AAC7C,EA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aAAA;AAAA,UACV,OAAA,EAAS,MAAM,EAAA,CAAG,KAAA,GAAQ,CAAC,CAAA;AAAA,UAC3B,QAAA,EAAU,UAAU,KAAA,GAAQ,CAAA;AAAA,UAC7B,QAAA,EAAA;AAAA;AAAA;AAED,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-ZPD7BGCF.js","sourcesContent":["'use client';\n\nimport type {\n ActivityData,\n ActivityResult,\n InteractionEvent,\n ThemeTokens,\n} from '@intellectif/lk-core';\nimport { useEffect, useRef, useState } from 'react';\nimport { FillInTheBlanks } from '../FillInTheBlanks/index.js';\nimport { MultipleChoice } from '../MultipleChoice/index.js';\n\nexport interface ActivitySequenceProps {\n /** The ordered set of activities to present, one at a time. */\n activities: ActivityData[];\n /** Called whenever an individual activity is completed. */\n onActivityComplete?: (result: ActivityResult, index: number) => void;\n /** Called once every activity in the set has been completed. */\n onComplete?: (results: ActivityResult[]) => void;\n /** Forwarded to each activity. */\n onInteraction?: (event: InteractionEvent) => void;\n theme?: Partial<ThemeTokens>;\n locale?: string;\n disabled?: boolean;\n}\n\n/**\n * Presents a set of activities as an in-place pager: one question visible at a\n * time, navigated with Prev/Next (no page scrolling). Linear free navigation —\n * the learner may move back and forth; activities keep their own submit and\n * scoring. On navigation, focus moves to the question region and the position\n * is announced via an aria-live region.\n */\nexport function ActivitySequence({\n activities,\n onActivityComplete,\n onComplete,\n onInteraction,\n theme,\n locale,\n disabled,\n}: ActivitySequenceProps): React.JSX.Element {\n const [index, setIndex] = useState(0);\n const [results, setResults] = useState<(ActivityResult | null)[]>(() =>\n activities.map(() => null),\n );\n const regionRef = useRef<HTMLDivElement>(null);\n const mountedRef = useRef(false);\n\n // After a navigation (not the initial mount) move focus to the question\n // region so screen-reader / keyboard users land on the new question.\n // biome-ignore lint/correctness/useExhaustiveDependencies: index is the intended trigger\n useEffect(() => {\n if (mountedRef.current) {\n regionRef.current?.focus();\n } else {\n mountedRef.current = true;\n }\n }, [index]);\n\n const total = activities.length;\n const current = activities[index];\n\n const go = (next: number): void => {\n setIndex(next);\n };\n\n const handleComplete = (result: ActivityResult): void => {\n const nextResults = results.slice();\n nextResults[index] = result;\n setResults(nextResults);\n onActivityComplete?.(result, index);\n if (nextResults.every((r): r is ActivityResult => r !== null)) {\n onComplete?.(nextResults);\n }\n };\n\n if (!current) {\n return <div className=\"lk-seq\" />;\n }\n\n const childProps = {\n onComplete: handleComplete,\n ...(onInteraction ? { onInteraction } : {}),\n ...(theme ? { theme } : {}),\n ...(locale ? { locale } : {}),\n ...(disabled ? { disabled } : {}),\n };\n\n return (\n <div className=\"lk-seq\" lang={locale}>\n <div className=\"lk-seq-progress\" aria-live=\"polite\" role=\"status\">\n Question {index + 1} of {total}\n </div>\n\n <section\n className=\"lk-seq-question\"\n ref={regionRef}\n tabIndex={-1}\n aria-label={`Question ${index + 1} of ${total}`}\n >\n {current.type === 'multiple-choice' ? (\n <MultipleChoice data={current} {...childProps} />\n ) : (\n <FillInTheBlanks data={current} {...childProps} />\n )}\n </section>\n\n <div className=\"lk-seq-nav\">\n <button\n type=\"button\"\n className=\"lk-seq-prev\"\n onClick={() => go(index - 1)}\n disabled={index === 0}\n >\n Previous\n </button>\n <button\n type=\"button\"\n className=\"lk-seq-next\"\n onClick={() => go(index + 1)}\n disabled={index === total - 1}\n >\n Next\n </button>\n </div>\n </div>\n );\n}\n"]}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var chunkRI53A36N_cjs = require('../chunk-RI53A36N.cjs');
4
+ require('../chunk-QBA6UXMS.cjs');
5
+ require('../chunk-O3GWWJFS.cjs');
6
+ require('../chunk-6OBRYL4C.cjs');
7
+ require('../chunk-HD2AIQRD.cjs');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "ActivitySequence", {
12
+ enumerable: true,
13
+ get: function () { return chunkRI53A36N_cjs.ActivitySequence; }
14
+ });
15
+ //# sourceMappingURL=ActivitySequence.cjs.map
16
+ //# sourceMappingURL=ActivitySequence.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"ActivitySequence.cjs"}
@@ -0,0 +1,25 @@
1
+ import { ActivityData, ActivityResult, InteractionEvent, ThemeTokens } from '@intellectif/lk-core';
2
+
3
+ interface ActivitySequenceProps {
4
+ /** The ordered set of activities to present, one at a time. */
5
+ activities: ActivityData[];
6
+ /** Called whenever an individual activity is completed. */
7
+ onActivityComplete?: (result: ActivityResult, index: number) => void;
8
+ /** Called once every activity in the set has been completed. */
9
+ onComplete?: (results: ActivityResult[]) => void;
10
+ /** Forwarded to each activity. */
11
+ onInteraction?: (event: InteractionEvent) => void;
12
+ theme?: Partial<ThemeTokens>;
13
+ locale?: string;
14
+ disabled?: boolean;
15
+ }
16
+ /**
17
+ * Presents a set of activities as an in-place pager: one question visible at a
18
+ * time, navigated with Prev/Next (no page scrolling). Linear free navigation —
19
+ * the learner may move back and forth; activities keep their own submit and
20
+ * scoring. On navigation, focus moves to the question region and the position
21
+ * is announced via an aria-live region.
22
+ */
23
+ declare function ActivitySequence({ activities, onActivityComplete, onComplete, onInteraction, theme, locale, disabled, }: ActivitySequenceProps): React.JSX.Element;
24
+
25
+ export { ActivitySequence, type ActivitySequenceProps };
@@ -0,0 +1,25 @@
1
+ import { ActivityData, ActivityResult, InteractionEvent, ThemeTokens } from '@intellectif/lk-core';
2
+
3
+ interface ActivitySequenceProps {
4
+ /** The ordered set of activities to present, one at a time. */
5
+ activities: ActivityData[];
6
+ /** Called whenever an individual activity is completed. */
7
+ onActivityComplete?: (result: ActivityResult, index: number) => void;
8
+ /** Called once every activity in the set has been completed. */
9
+ onComplete?: (results: ActivityResult[]) => void;
10
+ /** Forwarded to each activity. */
11
+ onInteraction?: (event: InteractionEvent) => void;
12
+ theme?: Partial<ThemeTokens>;
13
+ locale?: string;
14
+ disabled?: boolean;
15
+ }
16
+ /**
17
+ * Presents a set of activities as an in-place pager: one question visible at a
18
+ * time, navigated with Prev/Next (no page scrolling). Linear free navigation —
19
+ * the learner may move back and forth; activities keep their own submit and
20
+ * scoring. On navigation, focus moves to the question region and the position
21
+ * is announced via an aria-live region.
22
+ */
23
+ declare function ActivitySequence({ activities, onActivityComplete, onComplete, onInteraction, theme, locale, disabled, }: ActivitySequenceProps): React.JSX.Element;
24
+
25
+ export { ActivitySequence, type ActivitySequenceProps };
@@ -0,0 +1,7 @@
1
+ export { ActivitySequence } from '../chunk-ZPD7BGCF.js';
2
+ import '../chunk-W2L66WHW.js';
3
+ import '../chunk-5KW7TFX3.js';
4
+ import '../chunk-L3EV5LIX.js';
5
+ import '../chunk-5HVUKXF3.js';
6
+ //# sourceMappingURL=ActivitySequence.js.map
7
+ //# sourceMappingURL=ActivitySequence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"ActivitySequence.js"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkO3GWWJFS_cjs = require('../chunk-O3GWWJFS.cjs');
4
+ require('../chunk-6OBRYL4C.cjs');
5
+ require('../chunk-HD2AIQRD.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "FillInTheBlanks", {
10
+ enumerable: true,
11
+ get: function () { return chunkO3GWWJFS_cjs.FillInTheBlanks; }
12
+ });
13
+ //# sourceMappingURL=FillInTheBlanks.cjs.map
14
+ //# sourceMappingURL=FillInTheBlanks.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"FillInTheBlanks.cjs"}
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FillInTheBlanksData } from '@intellectif/lk-core';
3
+ import { A as ActivityProps } from '../types-iknDq5tf.cjs';
4
+
5
+ interface FillInTheBlanksProps extends ActivityProps<FillInTheBlanksData> {
6
+ /**
7
+ * After submission, replace each incorrectly-answered blank with its first
8
+ * accepted answer, styled distinctly (Req 5.7). Component-specific prop: it
9
+ * is presentation, not activity data, and is outside the fixed Req-3.1 set.
10
+ */
11
+ showCorrectAnswers?: boolean;
12
+ }
13
+
14
+ /**
15
+ * Public Fill-in-the-Blanks activity: the core wrapped in
16
+ * `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation
17
+ * throw) degrades to an accessible fallback instead of crashing the host.
18
+ */
19
+ declare function FillInTheBlanks(props: FillInTheBlanksProps): react_jsx_runtime.JSX.Element;
20
+
21
+ export { FillInTheBlanks, type FillInTheBlanksProps };
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { FillInTheBlanksData } from '@intellectif/lk-core';
3
+ import { A as ActivityProps } from '../types-iknDq5tf.js';
4
+
5
+ interface FillInTheBlanksProps extends ActivityProps<FillInTheBlanksData> {
6
+ /**
7
+ * After submission, replace each incorrectly-answered blank with its first
8
+ * accepted answer, styled distinctly (Req 5.7). Component-specific prop: it
9
+ * is presentation, not activity data, and is outside the fixed Req-3.1 set.
10
+ */
11
+ showCorrectAnswers?: boolean;
12
+ }
13
+
14
+ /**
15
+ * Public Fill-in-the-Blanks activity: the core wrapped in
16
+ * `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation
17
+ * throw) degrades to an accessible fallback instead of crashing the host.
18
+ */
19
+ declare function FillInTheBlanks(props: FillInTheBlanksProps): react_jsx_runtime.JSX.Element;
20
+
21
+ export { FillInTheBlanks, type FillInTheBlanksProps };
@@ -0,0 +1,5 @@
1
+ export { FillInTheBlanks } from '../chunk-5KW7TFX3.js';
2
+ import '../chunk-L3EV5LIX.js';
3
+ import '../chunk-5HVUKXF3.js';
4
+ //# sourceMappingURL=FillInTheBlanks.js.map
5
+ //# sourceMappingURL=FillInTheBlanks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"FillInTheBlanks.js"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkQBA6UXMS_cjs = require('../chunk-QBA6UXMS.cjs');
4
+ require('../chunk-6OBRYL4C.cjs');
5
+ require('../chunk-HD2AIQRD.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "MultipleChoice", {
10
+ enumerable: true,
11
+ get: function () { return chunkQBA6UXMS_cjs.MultipleChoice; }
12
+ });
13
+ //# sourceMappingURL=MultipleChoice.cjs.map
14
+ //# sourceMappingURL=MultipleChoice.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"MultipleChoice.cjs"}
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MultipleChoiceData } from '@intellectif/lk-core';
3
+ import { A as ActivityProps } from '../types-iknDq5tf.cjs';
4
+
5
+ /**
6
+ * Public Multiple Choice activity: the core component wrapped in
7
+ * `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation
8
+ * throw) degrades to an accessible fallback instead of crashing the host.
9
+ */
10
+ declare function MultipleChoice(props: ActivityProps<MultipleChoiceData>): react_jsx_runtime.JSX.Element;
11
+
12
+ export { ActivityProps, MultipleChoice };
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { MultipleChoiceData } from '@intellectif/lk-core';
3
+ import { A as ActivityProps } from '../types-iknDq5tf.js';
4
+
5
+ /**
6
+ * Public Multiple Choice activity: the core component wrapped in
7
+ * `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation
8
+ * throw) degrades to an accessible fallback instead of crashing the host.
9
+ */
10
+ declare function MultipleChoice(props: ActivityProps<MultipleChoiceData>): react_jsx_runtime.JSX.Element;
11
+
12
+ export { ActivityProps, MultipleChoice };
@@ -0,0 +1,5 @@
1
+ export { MultipleChoice } from '../chunk-W2L66WHW.js';
2
+ import '../chunk-L3EV5LIX.js';
3
+ import '../chunk-5HVUKXF3.js';
4
+ //# sourceMappingURL=MultipleChoice.js.map
5
+ //# sourceMappingURL=MultipleChoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"MultipleChoice.js"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkHD2AIQRD_cjs = require('../chunk-HD2AIQRD.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "useActivityState", {
8
+ enumerable: true,
9
+ get: function () { return chunkHD2AIQRD_cjs.useActivityState; }
10
+ });
11
+ //# sourceMappingURL=useActivityState.cjs.map
12
+ //# sourceMappingURL=useActivityState.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"useActivityState.cjs"}
@@ -0,0 +1,22 @@
1
+ type ActivityState = 'idle' | 'in-progress' | 'completed' | 'reviewing';
2
+ interface UseActivityStateResult {
3
+ state: ActivityState;
4
+ /** idle → in-progress; records start time once. Idempotent: repeated calls
5
+ * (e.g. every learner interaction) neither restart timing nor regress state. */
6
+ start: () => void;
7
+ /** → completed. */
8
+ complete: () => void;
9
+ /** → reviewing (e.g. when showing correct answers). */
10
+ review: () => void;
11
+ /** → idle and clears timing. Call when the activity `data` prop changes. */
12
+ reset: () => void;
13
+ /** Elapsed ms since `start()`; 0 when not started (or after `reset()`). */
14
+ getTimeSpent: () => number;
15
+ }
16
+ /**
17
+ * Tracks an activity's lifecycle state and elapsed time. Timing is held in a
18
+ * ref (no re-render) and `getTimeSpent()` is read imperatively at submission.
19
+ */
20
+ declare function useActivityState(): UseActivityStateResult;
21
+
22
+ export { type ActivityState, type UseActivityStateResult, useActivityState };
@@ -0,0 +1,22 @@
1
+ type ActivityState = 'idle' | 'in-progress' | 'completed' | 'reviewing';
2
+ interface UseActivityStateResult {
3
+ state: ActivityState;
4
+ /** idle → in-progress; records start time once. Idempotent: repeated calls
5
+ * (e.g. every learner interaction) neither restart timing nor regress state. */
6
+ start: () => void;
7
+ /** → completed. */
8
+ complete: () => void;
9
+ /** → reviewing (e.g. when showing correct answers). */
10
+ review: () => void;
11
+ /** → idle and clears timing. Call when the activity `data` prop changes. */
12
+ reset: () => void;
13
+ /** Elapsed ms since `start()`; 0 when not started (or after `reset()`). */
14
+ getTimeSpent: () => number;
15
+ }
16
+ /**
17
+ * Tracks an activity's lifecycle state and elapsed time. Timing is held in a
18
+ * ref (no re-render) and `getTimeSpent()` is read imperatively at submission.
19
+ */
20
+ declare function useActivityState(): UseActivityStateResult;
21
+
22
+ export { type ActivityState, type UseActivityStateResult, useActivityState };
@@ -0,0 +1,3 @@
1
+ export { useActivityState } from '../chunk-5HVUKXF3.js';
2
+ //# sourceMappingURL=useActivityState.js.map
3
+ //# sourceMappingURL=useActivityState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"useActivityState.js"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkTVK3SVV6_cjs = require('../chunk-TVK3SVV6.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "useXAPI", {
8
+ enumerable: true,
9
+ get: function () { return chunkTVK3SVV6_cjs.useXAPI; }
10
+ });
11
+ //# sourceMappingURL=useXAPI.cjs.map
12
+ //# sourceMappingURL=useXAPI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"useXAPI.cjs"}
@@ -0,0 +1,15 @@
1
+ import { XAPIStatement, XAPIConfig } from '@intellectif/lk-core';
2
+
3
+ interface UseXAPIResult {
4
+ /**
5
+ * Sends a statement to the configured LRS. **Never rejects** — xAPI is
6
+ * fire-and-forget telemetry that must not break the learner's activity
7
+ * flow. Network errors and 5xx responses are retried (backoff 1s/2s/4s,
8
+ * up to 3 retries); a 4xx fails immediately. Any final failure is delivered
9
+ * to `config.onError`.
10
+ */
11
+ sendStatement: (statement: XAPIStatement) => Promise<void>;
12
+ }
13
+ declare function useXAPI(config: XAPIConfig): UseXAPIResult;
14
+
15
+ export { type UseXAPIResult, useXAPI };
@@ -0,0 +1,15 @@
1
+ import { XAPIStatement, XAPIConfig } from '@intellectif/lk-core';
2
+
3
+ interface UseXAPIResult {
4
+ /**
5
+ * Sends a statement to the configured LRS. **Never rejects** — xAPI is
6
+ * fire-and-forget telemetry that must not break the learner's activity
7
+ * flow. Network errors and 5xx responses are retried (backoff 1s/2s/4s,
8
+ * up to 3 retries); a 4xx fails immediately. Any final failure is delivered
9
+ * to `config.onError`.
10
+ */
11
+ sendStatement: (statement: XAPIStatement) => Promise<void>;
12
+ }
13
+ declare function useXAPI(config: XAPIConfig): UseXAPIResult;
14
+
15
+ export { type UseXAPIResult, useXAPI };
@@ -0,0 +1,3 @@
1
+ export { useXAPI } from '../chunk-IZNMQSQP.js';
2
+ //# sourceMappingURL=useXAPI.js.map
3
+ //# sourceMappingURL=useXAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"useXAPI.js"}
package/dist/index.cjs ADDED
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ var chunkRI53A36N_cjs = require('./chunk-RI53A36N.cjs');
4
+ var chunkQBA6UXMS_cjs = require('./chunk-QBA6UXMS.cjs');
5
+ var chunkO3GWWJFS_cjs = require('./chunk-O3GWWJFS.cjs');
6
+ require('./chunk-6OBRYL4C.cjs');
7
+ var chunkHD2AIQRD_cjs = require('./chunk-HD2AIQRD.cjs');
8
+ var chunkTVK3SVV6_cjs = require('./chunk-TVK3SVV6.cjs');
9
+ var chunkCPF2JJG6_cjs = require('./chunk-CPF2JJG6.cjs');
10
+
11
+
12
+
13
+ Object.defineProperty(exports, "ActivitySequence", {
14
+ enumerable: true,
15
+ get: function () { return chunkRI53A36N_cjs.ActivitySequence; }
16
+ });
17
+ Object.defineProperty(exports, "MultipleChoice", {
18
+ enumerable: true,
19
+ get: function () { return chunkQBA6UXMS_cjs.MultipleChoice; }
20
+ });
21
+ Object.defineProperty(exports, "FillInTheBlanks", {
22
+ enumerable: true,
23
+ get: function () { return chunkO3GWWJFS_cjs.FillInTheBlanks; }
24
+ });
25
+ Object.defineProperty(exports, "useActivityState", {
26
+ enumerable: true,
27
+ get: function () { return chunkHD2AIQRD_cjs.useActivityState; }
28
+ });
29
+ Object.defineProperty(exports, "useXAPI", {
30
+ enumerable: true,
31
+ get: function () { return chunkTVK3SVV6_cjs.useXAPI; }
32
+ });
33
+ Object.defineProperty(exports, "ThemeProvider", {
34
+ enumerable: true,
35
+ get: function () { return chunkCPF2JJG6_cjs.ThemeProvider; }
36
+ });
37
+ Object.defineProperty(exports, "darkTheme", {
38
+ enumerable: true,
39
+ get: function () { return chunkCPF2JJG6_cjs.darkTheme; }
40
+ });
41
+ Object.defineProperty(exports, "defaultTheme", {
42
+ enumerable: true,
43
+ get: function () { return chunkCPF2JJG6_cjs.defaultTheme; }
44
+ });
45
+ Object.defineProperty(exports, "useTheme", {
46
+ enumerable: true,
47
+ get: function () { return chunkCPF2JJG6_cjs.useTheme; }
48
+ });
49
+ //# sourceMappingURL=index.cjs.map
50
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,10 @@
1
+ export { ActivitySequence, ActivitySequenceProps } from './components/ActivitySequence.cjs';
2
+ export { FillInTheBlanks, FillInTheBlanksProps } from './components/FillInTheBlanks.cjs';
3
+ export { MultipleChoice } from './components/MultipleChoice.cjs';
4
+ export { ActivityState, UseActivityStateResult, useActivityState } from './hooks/useActivityState.cjs';
5
+ export { UseXAPIResult, useXAPI } from './hooks/useXAPI.cjs';
6
+ export { ThemeProvider, ThemeProviderProps, darkTheme, defaultTheme, useTheme } from './theme/ThemeProvider.cjs';
7
+ export { A as ActivityProps } from './types-iknDq5tf.cjs';
8
+ import '@intellectif/lk-core';
9
+ import 'react/jsx-runtime';
10
+ import 'react';
@@ -0,0 +1,10 @@
1
+ export { ActivitySequence, ActivitySequenceProps } from './components/ActivitySequence.js';
2
+ export { FillInTheBlanks, FillInTheBlanksProps } from './components/FillInTheBlanks.js';
3
+ export { MultipleChoice } from './components/MultipleChoice.js';
4
+ export { ActivityState, UseActivityStateResult, useActivityState } from './hooks/useActivityState.js';
5
+ export { UseXAPIResult, useXAPI } from './hooks/useXAPI.js';
6
+ export { ThemeProvider, ThemeProviderProps, darkTheme, defaultTheme, useTheme } from './theme/ThemeProvider.js';
7
+ export { A as ActivityProps } from './types-iknDq5tf.js';
8
+ import '@intellectif/lk-core';
9
+ import 'react/jsx-runtime';
10
+ import 'react';
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export { ActivitySequence } from './chunk-ZPD7BGCF.js';
2
+ export { MultipleChoice } from './chunk-W2L66WHW.js';
3
+ export { FillInTheBlanks } from './chunk-5KW7TFX3.js';
4
+ import './chunk-L3EV5LIX.js';
5
+ export { useActivityState } from './chunk-5HVUKXF3.js';
6
+ export { useXAPI } from './chunk-IZNMQSQP.js';
7
+ export { ThemeProvider, darkTheme, defaultTheme, useTheme } from './chunk-B3FUUKZ2.js';
8
+ //# sourceMappingURL=index.js.map
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var chunkCPF2JJG6_cjs = require('../chunk-CPF2JJG6.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "ThemeProvider", {
8
+ enumerable: true,
9
+ get: function () { return chunkCPF2JJG6_cjs.ThemeProvider; }
10
+ });
11
+ Object.defineProperty(exports, "darkTheme", {
12
+ enumerable: true,
13
+ get: function () { return chunkCPF2JJG6_cjs.darkTheme; }
14
+ });
15
+ Object.defineProperty(exports, "defaultTheme", {
16
+ enumerable: true,
17
+ get: function () { return chunkCPF2JJG6_cjs.defaultTheme; }
18
+ });
19
+ Object.defineProperty(exports, "useTheme", {
20
+ enumerable: true,
21
+ get: function () { return chunkCPF2JJG6_cjs.useTheme; }
22
+ });
23
+ //# sourceMappingURL=ThemeProvider.cjs.map
24
+ //# sourceMappingURL=ThemeProvider.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"ThemeProvider.cjs"}
@@ -0,0 +1,39 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ThemeTokens } from '@intellectif/lk-core';
3
+ import { ReactNode } from 'react';
4
+
5
+ /**
6
+ * Dark-mode colour overrides, merged over {@link defaultTheme} by
7
+ * `ThemeProvider`. Colours only — spacing/typography/shape/motion are
8
+ * theme-invariant. All pairs verified WCAG 2.2 AA against the dark surface.
9
+ */
10
+ declare const darkTheme: Partial<ThemeTokens>;
11
+
12
+ /**
13
+ * Canonical default theme token values. `defaults.css` mirrors these exactly.
14
+ * Palette is a neutral monochrome (ElevenLabs-like) so the SDK is brand-neutral
15
+ * out of the box; consumers rebrand via `ThemeProvider`. All colour pairs are
16
+ * verified to meet WCAG 2.2 AA: 4.5:1 for normal text, 3:1 for UI / focus ring
17
+ * (see theme/__tests__/contrast.test.ts).
18
+ */
19
+ declare const defaultTheme: ThemeTokens;
20
+
21
+ interface ThemeProviderProps {
22
+ /** Partial token overrides. When provided, dark auto-detection is disabled. */
23
+ theme?: Partial<ThemeTokens>;
24
+ children: ReactNode;
25
+ }
26
+ /**
27
+ * Provides theme tokens to descendant activity components as scoped inline CSS
28
+ * custom properties on a wrapper `<div>`, and via {@link useTheme}.
29
+ *
30
+ * Resolution: an explicit `theme` prop merges over {@link defaultTheme} (and
31
+ * suppresses dark auto-detect, per Req 13.5). With no `theme` prop, the OS
32
+ * `prefers-color-scheme: dark` preference auto-applies {@link darkTheme}.
33
+ * SSR-safe: the server snapshot is always light, so hydration never mismatches.
34
+ */
35
+ declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
36
+ /** Returns the currently active theme tokens (defaults when no provider). */
37
+ declare function useTheme(): ThemeTokens;
38
+
39
+ export { ThemeProvider, type ThemeProviderProps, darkTheme, defaultTheme, useTheme };