@cuemath/leap 3.2.34-mbz → 3.2.34-mbz1

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.
@@ -1,87 +1,75 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { memo as v, useCallback as D, useMemo as G } from "react";
3
- import M from "../../communication/hooks/use-inclass-message-broker/use-inclass-message-broker.js";
4
- import T from "../../ui/arrow-tooltip/arrow-tooltip.js";
5
- import { stickerData as V } from "../sticker-data.js";
6
- import Y from "./sticker-selector-grid.js";
7
- const j = ({
8
- triggerNode: n,
9
- studentClassroomId: d,
10
- gridConfig: l,
11
- tooltipConfig: m,
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { memo as I, useMemo as V } from "react";
3
+ import Y from "../../ui/arrow-tooltip/arrow-tooltip.js";
4
+ import { stickerData as j } from "../sticker-data.js";
5
+ import B from "./sticker-selector-grid.js";
6
+ const D = ({
7
+ triggerNode: s,
8
+ onStickerSend: o,
9
+ gridConfig: a,
10
+ tooltipConfig: n,
12
11
  visible: c
13
12
  }) => {
14
- const { columns: t = 4, gap: r = 8, stickerSize: i = 48 } = l, {
15
- isAnimated: p,
16
- arrowColor: C,
17
- arrowSize: f,
18
- arrowXCoOrdinates: k,
19
- arrowYCoOrdinates: S,
20
- backgroundColor: w,
21
- borderColor: u,
22
- position: g = "bottom",
23
- renderAs: b = "primary",
24
- textVariant: h,
25
- tooltipOffset: A,
13
+ const { columns: r = 4, gap: t = 8, stickerSize: i = 48 } = a, {
14
+ isAnimated: l,
15
+ arrowColor: m,
16
+ arrowSize: d,
17
+ arrowXCoOrdinates: p,
18
+ arrowYCoOrdinates: f,
19
+ backgroundColor: k,
20
+ borderColor: w,
21
+ position: C = "bottom",
22
+ renderAs: S = "primary",
23
+ textVariant: u,
24
+ tooltipOffset: h,
26
25
  tooltipXCoOrdinates: O,
27
- tooltipYCoOrdinates: x,
28
- width: B,
29
- widthX: I,
30
- zIndex: y,
31
- parentWidth: z,
32
- isBlocking: E = !1
33
- } = m, { publish: o } = M({ studentClassroomId: d }), a = D(
34
- (e) => o == null ? void 0 : o({
35
- eventName: "TEACHER_BADGE",
36
- eventPayload: {
37
- data: {
38
- selectedBadge: { id: e.id, name: e.name },
39
- badgeId: e.id
40
- }
41
- }
42
- }),
43
- [o]
44
- ), X = G(
45
- () => /* @__PURE__ */ s(
46
- Y,
26
+ tooltipYCoOrdinates: b,
27
+ width: x,
28
+ widthX: g,
29
+ zIndex: z,
30
+ parentWidth: A,
31
+ isBlocking: X = !1
32
+ } = n, y = V(
33
+ () => /* @__PURE__ */ e(
34
+ B,
47
35
  {
48
- stickers: V,
49
- columns: t,
50
- gap: r,
36
+ stickers: j,
37
+ columns: r,
38
+ gap: t,
51
39
  stickerSize: i,
52
- onStickerClick: a
40
+ onStickerClick: o
53
41
  }
54
42
  ),
55
- [t, r, a, i]
43
+ [r, t, o, i]
56
44
  );
57
- return /* @__PURE__ */ s(
58
- T,
45
+ return /* @__PURE__ */ e(
46
+ Y,
59
47
  {
60
- children: n,
48
+ children: s,
61
49
  alwaysVisible: !0,
62
50
  hidden: !c,
63
- tooltipItem: X,
64
- renderAs: b,
65
- position: g,
66
- isBlocking: E,
67
- isAnimated: p,
68
- zIndex: y,
69
- width: B,
70
- widthX: I,
71
- parentWidth: z,
72
- backgroundColor: w,
73
- borderColor: u,
74
- textVariant: h,
75
- tooltipOffset: A,
76
- arrowColor: C,
77
- arrowSize: f,
78
- arrowXCoOrdinates: k,
79
- arrowYCoOrdinates: S,
51
+ tooltipItem: y,
52
+ renderAs: S,
53
+ position: C,
54
+ isBlocking: X,
55
+ isAnimated: l,
56
+ zIndex: z,
57
+ width: x,
58
+ widthX: g,
59
+ parentWidth: A,
60
+ backgroundColor: k,
61
+ borderColor: w,
62
+ textVariant: u,
63
+ tooltipOffset: h,
64
+ arrowColor: m,
65
+ arrowSize: d,
66
+ arrowXCoOrdinates: p,
67
+ arrowYCoOrdinates: f,
80
68
  tooltipXCoOrdinates: O,
81
- tooltipYCoOrdinates: x
69
+ tooltipYCoOrdinates: b
82
70
  }
83
71
  );
84
- }, q = v(j);
72
+ }, q = I(D);
85
73
  export {
86
74
  q as default
87
75
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { IStickerSelectorProps, IStickerData } from './sticker-selector-types';\n\nimport React, { memo, useCallback, useMemo } from 'react';\n\nimport useInClassMessageBroker from '../../communication/hooks/use-inclass-message-broker/use-inclass-message-broker';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport { stickerData } from '../sticker-data';\nimport StickerSelectorGrid from './sticker-selector-grid';\n\nconst StickersSelector: React.FC<IStickerSelectorProps> = ({\n triggerNode,\n studentClassroomId,\n gridConfig,\n tooltipConfig,\n visible,\n}) => {\n const { columns = 4, gap = 8, stickerSize = 48 } = gridConfig;\n const {\n isAnimated,\n arrowColor,\n arrowSize,\n arrowXCoOrdinates,\n arrowYCoOrdinates,\n backgroundColor,\n borderColor,\n position = 'bottom',\n renderAs = 'primary',\n textVariant,\n tooltipOffset,\n tooltipXCoOrdinates,\n tooltipYCoOrdinates,\n width,\n widthX,\n zIndex,\n parentWidth,\n isBlocking = false,\n } = tooltipConfig;\n const { publish } = useInClassMessageBroker({ studentClassroomId });\n\n const handleSend = useCallback(\n (sticker: IStickerData) =>\n publish?.({\n eventName: 'TEACHER_BADGE',\n eventPayload: {\n data: {\n selectedBadge: { id: sticker.id, name: sticker.name },\n badgeId: sticker.id,\n },\n },\n }),\n [publish],\n );\n\n const tooltipItem = useMemo(\n () => (\n <StickerSelectorGrid\n stickers={stickerData}\n columns={columns}\n gap={gap}\n stickerSize={stickerSize}\n onStickerClick={handleSend}\n />\n ),\n [columns, gap, handleSend, stickerSize],\n );\n\n return (\n <ArrowTooltip\n children={triggerNode}\n alwaysVisible\n hidden={!visible}\n tooltipItem={tooltipItem}\n renderAs={renderAs}\n position={position}\n isBlocking={isBlocking}\n isAnimated={isAnimated}\n zIndex={zIndex}\n width={width}\n widthX={widthX}\n parentWidth={parentWidth}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n textVariant={textVariant}\n tooltipOffset={tooltipOffset}\n arrowColor={arrowColor}\n arrowSize={arrowSize}\n arrowXCoOrdinates={arrowXCoOrdinates}\n arrowYCoOrdinates={arrowYCoOrdinates}\n tooltipXCoOrdinates={tooltipXCoOrdinates}\n tooltipYCoOrdinates={tooltipYCoOrdinates}\n />\n );\n};\n\nexport default memo(StickersSelector);\n"],"names":["StickersSelector","triggerNode","studentClassroomId","gridConfig","tooltipConfig","visible","columns","gap","stickerSize","isAnimated","arrowColor","arrowSize","arrowXCoOrdinates","arrowYCoOrdinates","backgroundColor","borderColor","position","renderAs","textVariant","tooltipOffset","tooltipXCoOrdinates","tooltipYCoOrdinates","width","widthX","zIndex","parentWidth","isBlocking","publish","useInClassMessageBroker","handleSend","useCallback","sticker","tooltipItem","useMemo","jsx","StickerSelectorGrid","stickerData","ArrowTooltip","StickerSelector","memo"],"mappings":";;;;;;AASA,MAAMA,IAAoD,CAAC;AAAA,EACzD,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,SAAAC;AACF,MAAM;AACJ,QAAM,EAAE,SAAAC,IAAU,GAAG,KAAAC,IAAM,GAAG,aAAAC,IAAc,GAAO,IAAAL,GAC7C;AAAA,IACJ,YAAAM;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,EACX,IAAAtB,GACE,EAAE,SAAAuB,EAAQ,IAAIC,EAAwB,EAAE,oBAAA1B,EAAoB,CAAA,GAE5D2B,IAAaC;AAAA,IACjB,CAACC,MACCJ,KAAA,gBAAAA,EAAU;AAAA,MACR,WAAW;AAAA,MACX,cAAc;AAAA,QACZ,MAAM;AAAA,UACJ,eAAe,EAAE,IAAII,EAAQ,IAAI,MAAMA,EAAQ,KAAK;AAAA,UACpD,SAASA,EAAQ;AAAA,QACnB;AAAA,MACF;AAAA,IAAA;AAAA,IAEJ,CAACJ,CAAO;AAAA,EAAA,GAGJK,IAAcC;AAAA,IAClB,MACE,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,UAAUC;AAAA,QACV,SAAA9B;AAAA,QACA,KAAAC;AAAA,QACA,aAAAC;AAAA,QACA,gBAAgBqB;AAAA,MAAA;AAAA,IAClB;AAAA,IAEF,CAACvB,GAASC,GAAKsB,GAAYrB,CAAW;AAAA,EAAA;AAItC,SAAA,gBAAA0B;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,UAAUpC;AAAA,MACV,eAAa;AAAA,MACb,QAAQ,CAACI;AAAA,MACT,aAAA2B;AAAA,MACA,UAAAf;AAAA,MACA,UAAAD;AAAA,MACA,YAAAU;AAAA,MACA,YAAAjB;AAAA,MACA,QAAAe;AAAA,MACA,OAAAF;AAAA,MACA,QAAAC;AAAA,MACA,aAAAE;AAAA,MACA,iBAAAX;AAAA,MACA,aAAAC;AAAA,MACA,aAAAG;AAAA,MACA,eAAAC;AAAA,MACA,YAAAT;AAAA,MACA,WAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,qBAAAO;AAAA,MACA,qBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeiB,IAAAC,EAAKvC,CAAgB;"}
1
+ {"version":3,"file":"sticker-selector.js","sources":["../../../../src/features/stickers/sticker-selector/sticker-selector.tsx"],"sourcesContent":["import type { IStickerSelectorProps } from './sticker-selector-types';\n\nimport React, { memo, useMemo } from 'react';\n\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport { stickerData } from '../sticker-data';\nimport StickerSelectorGrid from './sticker-selector-grid';\n\nconst StickerSelector: React.FC<IStickerSelectorProps> = ({\n triggerNode,\n onStickerSend,\n gridConfig,\n tooltipConfig,\n visible,\n}) => {\n const { columns = 4, gap = 8, stickerSize = 48 } = gridConfig;\n const {\n isAnimated,\n arrowColor,\n arrowSize,\n arrowXCoOrdinates,\n arrowYCoOrdinates,\n backgroundColor,\n borderColor,\n position = 'bottom',\n renderAs = 'primary',\n textVariant,\n tooltipOffset,\n tooltipXCoOrdinates,\n tooltipYCoOrdinates,\n width,\n widthX,\n zIndex,\n parentWidth,\n isBlocking = false,\n } = tooltipConfig;\n\n const tooltipItem = useMemo(\n () => (\n <StickerSelectorGrid\n stickers={stickerData}\n columns={columns}\n gap={gap}\n stickerSize={stickerSize}\n onStickerClick={onStickerSend}\n />\n ),\n [columns, gap, onStickerSend, stickerSize],\n );\n\n return (\n <ArrowTooltip\n children={triggerNode}\n alwaysVisible\n hidden={!visible}\n tooltipItem={tooltipItem}\n renderAs={renderAs}\n position={position}\n isBlocking={isBlocking}\n isAnimated={isAnimated}\n zIndex={zIndex}\n width={width}\n widthX={widthX}\n parentWidth={parentWidth}\n backgroundColor={backgroundColor}\n borderColor={borderColor}\n textVariant={textVariant}\n tooltipOffset={tooltipOffset}\n arrowColor={arrowColor}\n arrowSize={arrowSize}\n arrowXCoOrdinates={arrowXCoOrdinates}\n arrowYCoOrdinates={arrowYCoOrdinates}\n tooltipXCoOrdinates={tooltipXCoOrdinates}\n tooltipYCoOrdinates={tooltipYCoOrdinates}\n />\n );\n};\n\nexport default memo(StickerSelector);\n"],"names":["StickerSelector","triggerNode","onStickerSend","gridConfig","tooltipConfig","visible","columns","gap","stickerSize","isAnimated","arrowColor","arrowSize","arrowXCoOrdinates","arrowYCoOrdinates","backgroundColor","borderColor","position","renderAs","textVariant","tooltipOffset","tooltipXCoOrdinates","tooltipYCoOrdinates","width","widthX","zIndex","parentWidth","isBlocking","tooltipItem","useMemo","jsx","StickerSelectorGrid","stickerData","ArrowTooltip","StickerSelector$1","memo"],"mappings":";;;;;AAQA,MAAMA,IAAmD,CAAC;AAAA,EACxD,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,SAAAC;AACF,MAAM;AACJ,QAAM,EAAE,SAAAC,IAAU,GAAG,KAAAC,IAAM,GAAG,aAAAC,IAAc,GAAO,IAAAL,GAC7C;AAAA,IACJ,YAAAM;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,EACX,IAAAtB,GAEEuB,IAAcC;AAAA,IAClB,MACE,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,UAAUC;AAAA,QACV,SAAAzB;AAAA,QACA,KAAAC;AAAA,QACA,aAAAC;AAAA,QACA,gBAAgBN;AAAA,MAAA;AAAA,IAClB;AAAA,IAEF,CAACI,GAASC,GAAKL,GAAeM,CAAW;AAAA,EAAA;AAIzC,SAAA,gBAAAqB;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,UAAU/B;AAAA,MACV,eAAa;AAAA,MACb,QAAQ,CAACI;AAAA,MACT,aAAAsB;AAAA,MACA,UAAAV;AAAA,MACA,UAAAD;AAAA,MACA,YAAAU;AAAA,MACA,YAAAjB;AAAA,MACA,QAAAe;AAAA,MACA,OAAAF;AAAA,MACA,QAAAC;AAAA,MACA,aAAAE;AAAA,MACA,iBAAAX;AAAA,MACA,aAAAC;AAAA,MACA,aAAAG;AAAA,MACA,eAAAC;AAAA,MACA,YAAAT;AAAA,MACA,WAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,qBAAAO;AAAA,MACA,qBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeY,IAAAC,EAAKlC,CAAe;"}
@@ -1,54 +1,60 @@
1
1
  import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import { memo as V, useState as p, useCallback as s, useMemo as m, useRef as w, useEffect as W } from "react";
3
- import Y from "../../../stickers/sticker-selector/sticker-selector.js";
4
- import { useTrialSessionContext as M } from "../../../trial-session/context/use-trial-session-context.js";
5
- import $ from "../../../ui/buttons/clickable/clickable.js";
2
+ import { memo as W, useState as p, useCallback as s, useMemo as $, useRef as w, useEffect as Y } from "react";
3
+ import M from "../../../stickers/sticker-selector/sticker-selector.js";
4
+ import m from "../../../ui/buttons/clickable/clickable.js";
6
5
  import i from "../../../ui/layout/flex-view.js";
7
6
  import O from "../../../ui/separator/separator.js";
8
7
  import d from "../../../ui/text/text.js";
9
8
  import R from "../../constants/events.js";
10
9
  import { StickersIcon as q, GuideContainer as z, HintIcon as U, SolIcon as D, Pointer as F, SectionContainer as Q, Section as J, CloseIcon as Z, Guide as ee } from "./worksheet-sidebar-styled.js";
11
- const he = V(
12
- ({ questionWidth: C, questions: A, activeQuestionIndex: G, learnosity: I, actionbarHeight: b, loggerRef: a }) => {
10
+ const ae = W(
11
+ ({
12
+ questionWidth: C,
13
+ questions: A,
14
+ activeQuestionIndex: G,
15
+ learnosity: b,
16
+ actionbarHeight: I,
17
+ loggerRef: a,
18
+ enableStickers: L,
19
+ handleStickerSend: E
20
+ }) => {
13
21
  var _;
14
- const [t, h] = p(), [L, X] = p({
22
+ const [t, h] = p(), [X, v] = p({
15
23
  top: 0,
16
24
  left: 0
17
- }), [g, v] = p(!1), { studentId: T } = M(), { top: E, left: k } = L;
18
- console.log("student-id", T);
19
- const y = s(() => {
25
+ }), [g, y] = p(!1), { top: T, left: k } = X, B = s(() => {
20
26
  h("HINT"), a.current(R.WORKSHEET_V3_HINT_SEEN);
21
- }, [a]), x = s(() => {
27
+ }, [a]), j = s(() => {
22
28
  h("SOL"), a.current(R.WORKSHEET_V3_SOLUTION_SEEN);
23
- }, [a]), B = s(() => {
29
+ }, [a]), x = s(() => {
24
30
  h(() => {
25
31
  });
26
32
  }, []), f = s(() => {
27
- v((c) => !c);
28
- }, []), { hints: n, solution: u } = ((_ = A[G]) == null ? void 0 : _.metadata) || {}, r = m(() => t === void 0 ? void 0 : t === "HINT" ? n : u, [t, n, u]), H = w(null), N = w(null), S = s((c) => {
33
+ y((c) => !c);
34
+ }, []), { hints: n, solution: u } = ((_ = A[G]) == null ? void 0 : _.metadata) || {}, r = $(() => t === void 0 ? void 0 : t === "HINT" ? n : u, [t, n, u]), H = w(null), N = w(null), S = s((c) => {
29
35
  if (c.current) {
30
36
  const l = c.current.getBoundingClientRect();
31
- X({
37
+ v({
32
38
  top: l.top + l.height / 2 - 8,
33
39
  left: l.right - 78
34
40
  // 52px (sidebar width) + 16px (gutter) + 10px
35
41
  });
36
42
  }
37
- }, []), j = m(
38
- () => /* @__PURE__ */ e($, { label: "teacher-badges", onClick: f, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", children: [
43
+ }, []), K = $(
44
+ () => /* @__PURE__ */ e(m, { label: "teacher-badges", onClick: f, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", children: [
39
45
  /* @__PURE__ */ e(q, { width: 32, height: 32, $disabled: !g }),
40
46
  /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: g ? "BLACK" : "GREY_4", children: "STICKERS" }),
41
47
  /* @__PURE__ */ e(i, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(O, { width: 24, height: 1, background: "GREY_2" }) })
42
48
  ] }) }),
43
49
  [g, f]
44
- ), K = m(
50
+ ), P = $(
45
51
  () => ({
46
52
  stickerSize: 48,
47
53
  columns: 4,
48
54
  gap: 8
49
55
  }),
50
56
  []
51
- ), P = m(
57
+ ), V = $(
52
58
  () => ({
53
59
  position: "left",
54
60
  zIndex: 1e3,
@@ -57,36 +63,36 @@ const he = V(
57
63
  }),
58
64
  []
59
65
  );
60
- return t && r && I && I.renderMath("mathjax"), W(() => {
66
+ return t && r && b && b.renderMath("mathjax"), Y(() => {
61
67
  t === "HINT" ? S(N) : t === "SOL" ? S(H) : r || h(void 0);
62
68
  }, [t, S, r]), /* @__PURE__ */ o(z, { $background: "WHITE", children: [
63
- /* @__PURE__ */ e(
64
- Y,
69
+ L && E && /* @__PURE__ */ e(
70
+ M,
65
71
  {
66
- triggerNode: j,
67
- studentClassroomId: T,
68
- gridConfig: K,
69
- tooltipConfig: P,
72
+ triggerNode: K,
73
+ onStickerSend: E,
74
+ gridConfig: P,
75
+ tooltipConfig: V,
70
76
  visible: g,
71
77
  onToggle: f
72
78
  }
73
79
  ),
74
- /* @__PURE__ */ e($, { label: "hints", onClick: y, disabled: !n, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: N, children: [
80
+ /* @__PURE__ */ e(m, { label: "hints", onClick: B, disabled: !n, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: N, children: [
75
81
  /* @__PURE__ */ e(U, { width: 32, height: 32, $disabled: !n }),
76
82
  /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "HINT" }),
77
83
  /* @__PURE__ */ e(i, { $gap: 8, $alignItems: "center", children: /* @__PURE__ */ e(O, { width: 24, height: 1, background: "GREY_2" }) })
78
84
  ] }) }),
79
- /* @__PURE__ */ e($, { label: "solution", onClick: x, disabled: !u, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: H, children: [
85
+ /* @__PURE__ */ e(m, { label: "solution", onClick: j, disabled: !u, children: /* @__PURE__ */ o(i, { $alignItems: "center", $justifyContent: "center", ref: H, children: [
80
86
  /* @__PURE__ */ e(D, { width: 32, height: 32, $disabled: !u }),
81
87
  /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: n ? "BLACK" : "GREY_4", children: "SOL" })
82
88
  ] }) }),
83
- t && E && k && /* @__PURE__ */ e(F, { topValue: E, leftValue: k }),
89
+ t && T && k && /* @__PURE__ */ e(F, { topValue: T, leftValue: k }),
84
90
  t && /* @__PURE__ */ e(
85
91
  Q,
86
92
  {
87
93
  $background: "WHITE",
88
94
  $questionWidth: C,
89
- $actionbarHeight: b,
95
+ $actionbarHeight: I,
90
96
  $borderRadius: 10,
91
97
  children: /* @__PURE__ */ o(
92
98
  J,
@@ -94,9 +100,9 @@ const he = V(
94
100
  $gutterX: 1,
95
101
  $gapX: 1,
96
102
  $questionWidth: C,
97
- $actionbarHeight: b,
103
+ $actionbarHeight: I,
98
104
  children: [
99
- /* @__PURE__ */ e($, { label: "close", onClick: B, children: /* @__PURE__ */ e(Z, {}) }),
105
+ /* @__PURE__ */ e(m, { label: "close", onClick: x, children: /* @__PURE__ */ e(Z, {}) }),
100
106
  /* @__PURE__ */ e(i, { $gutterX: 0.5, children: /* @__PURE__ */ e(d, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: t === "HINT" ? "HINTS:" : "SOLUTION:" }) }),
101
107
  r && r.map((c, l) => /* @__PURE__ */ o(i, { $gutterX: 0.5, $gapX: 0.5, children: [
102
108
  r.length > 1 && /* @__PURE__ */ o(d, { $renderAs: "eyebrow2", $color: "ORANGE_5", $marginBottomX: 0.25, children: [
@@ -123,6 +129,6 @@ const he = V(
123
129
  }
124
130
  );
125
131
  export {
126
- he as default
132
+ ae as default
127
133
  };
128
134
  //# sourceMappingURL=question-guide.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"question-guide.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/question-guide.tsx"],"sourcesContent":["import type { TPositionProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\n\nimport React, { memo, useCallback, useEffect, useMemo, useState, useRef } from 'react';\n\nimport StickerSelector from '../../../stickers/sticker-selector/sticker-selector';\nimport { useTrialSessionContext } from '../../../trial-session/context/use-trial-session-context';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport EVENTS from '../../constants/events';\nimport {\n Section,\n GuideContainer,\n CloseIcon,\n SolIcon,\n HintIcon,\n StickersIcon,\n SectionContainer,\n Guide,\n Pointer,\n} from './worksheet-sidebar-styled';\n\ntype TSections = 'HINT' | 'SOL';\n\ninterface IQuestionGuideProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n actionbarHeight: number;\n}\n\nconst QuestionGuide: React.FC<IQuestionGuideProps> = memo(\n ({ questionWidth, questions, activeQuestionIndex, learnosity, actionbarHeight, loggerRef }) => {\n const [activeSection, setActiveSection] = useState<TSections | undefined>();\n const [pointerPosition, setPointerPosition] = useState({\n top: 0,\n left: 0,\n });\n const [showStickers, setShowStickers] = useState(false);\n const { studentId } = useTrialSessionContext();\n const { top, left } = pointerPosition;\n\n console.log('student-id', studentId);\n\n const handleHintClick = useCallback(() => {\n setActiveSection('HINT');\n loggerRef.current(EVENTS.WORKSHEET_V3_HINT_SEEN);\n }, [loggerRef]);\n const handleSolClick = useCallback(() => {\n setActiveSection('SOL');\n loggerRef.current(EVENTS.WORKSHEET_V3_SOLUTION_SEEN);\n }, [loggerRef]);\n const handleClose = useCallback(() => {\n setActiveSection(() => undefined);\n }, []);\n const handleBadgeToggle = useCallback(() => {\n setShowStickers(prev => !prev);\n }, []);\n\n const { hints, solution } = questions[activeQuestionIndex]?.metadata || {};\n\n const activeSectionData = useMemo(() => {\n return activeSection === undefined ? undefined : activeSection === 'HINT' ? hints : solution;\n }, [activeSection, hints, solution]);\n\n const sqlRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const hintRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n\n const updatePointerPosition = useCallback((ref: React.RefObject<HTMLDivElement>) => {\n if (ref.current) {\n const rect = ref.current.getBoundingClientRect();\n\n setPointerPosition({\n top: rect.top + rect.height / 2 - 8,\n left: rect.right - 78, // 52px (sidebar width) + 16px (gutter) + 10px\n });\n }\n }, []);\n\n const stickerTrigger = useMemo(\n () => (\n <Clickable label=\"teacher-badges\" onClick={handleBadgeToggle}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <StickersIcon width={32} height={32} $disabled={!showStickers} />\n <Text $renderAs=\"eyebrow2\" $color={!showStickers ? 'GREY_4' : 'BLACK'}>\n STICKERS\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n ),\n [showStickers, handleBadgeToggle],\n );\n\n const stickerGridConfig = useMemo(\n () => ({\n stickerSize: 48,\n columns: 4,\n gap: 8,\n }),\n [],\n );\n\n const stickerTooltipConfig = useMemo(\n () => ({\n position: 'left' as TPositionProps,\n zIndex: 1000,\n arrowXCoOrdinates: 87.5,\n tooltipXCoOrdinates: '-32.5%',\n }),\n [],\n );\n\n if (activeSection && activeSectionData && learnosity) {\n learnosity.renderMath('mathjax');\n }\n\n useEffect(() => {\n if (activeSection === 'HINT') {\n updatePointerPosition(hintRef);\n } else if (activeSection === 'SOL') {\n updatePointerPosition(sqlRef);\n } else if (!activeSectionData) {\n setActiveSection(undefined);\n }\n }, [activeSection, updatePointerPosition, activeSectionData]);\n\n return (\n <GuideContainer $background=\"WHITE\">\n <StickerSelector\n triggerNode={stickerTrigger}\n studentClassroomId={studentId}\n gridConfig={stickerGridConfig}\n tooltipConfig={stickerTooltipConfig}\n visible={showStickers}\n onToggle={handleBadgeToggle}\n />\n <Clickable label=\"hints\" onClick={handleHintClick} disabled={!hints}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={hintRef}>\n <HintIcon width={32} height={32} $disabled={!hints} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n HINT\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n <Clickable label=\"solution\" onClick={handleSolClick} disabled={!solution}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={sqlRef}>\n <SolIcon width={32} height={32} $disabled={!solution} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n SOL\n </Text>\n </FlexView>\n </Clickable>\n {activeSection && top && left && <Pointer topValue={top} leftValue={left} />}\n {activeSection && (\n <SectionContainer\n $background=\"WHITE\"\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n $borderRadius={10}\n >\n <Section\n $gutterX={1}\n $gapX={1}\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n >\n <Clickable label=\"close\" onClick={handleClose}>\n <CloseIcon />\n </Clickable>\n <FlexView $gutterX={0.5}>\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection === 'HINT' ? 'HINTS:' : 'SOLUTION:'}\n </Text>\n </FlexView>\n {activeSectionData &&\n activeSectionData.map((item, index) => (\n <FlexView $gutterX={0.5} $gapX={0.5} key={index.toString()}>\n {activeSectionData.length > 1 && (\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection} {index + 1}:\n </Text>\n )}\n <Guide\n dangerouslySetInnerHTML={{\n __html: item,\n }}\n />\n </FlexView>\n ))}\n </Section>\n </SectionContainer>\n )}\n </GuideContainer>\n );\n },\n);\n\nexport default QuestionGuide;\n"],"names":["QuestionGuide","memo","questionWidth","questions","activeQuestionIndex","learnosity","actionbarHeight","loggerRef","activeSection","setActiveSection","useState","pointerPosition","setPointerPosition","showStickers","setShowStickers","studentId","useTrialSessionContext","top","left","handleHintClick","useCallback","EVENTS","handleSolClick","handleClose","handleBadgeToggle","prev","hints","solution","_a","activeSectionData","useMemo","sqlRef","useRef","hintRef","updatePointerPosition","ref","rect","stickerTrigger","jsx","Clickable","jsxs","FlexView","StickersIcon","Text","Separator","stickerGridConfig","stickerTooltipConfig","useEffect","GuideContainer","StickerSelector","HintIcon","SolIcon","Pointer","SectionContainer","Section","CloseIcon","item","index","Guide"],"mappings":";;;;;;;;;;AAkCA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,eAAAC,GAAe,WAAAC,GAAW,qBAAAC,GAAqB,YAAAC,GAAY,iBAAAC,GAAiB,WAAAC,QAAgB;;AAC7F,UAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAgC,GACpE,CAACC,GAAiBC,CAAkB,IAAIF,EAAS;AAAA,MACrD,KAAK;AAAA,MACL,MAAM;AAAA,IAAA,CACP,GACK,CAACG,GAAcC,CAAe,IAAIJ,EAAS,EAAK,GAChD,EAAE,WAAAK,MAAcC,KAChB,EAAE,KAAAC,GAAK,MAAAC,EAAS,IAAAP;AAEd,YAAA,IAAI,cAAcI,CAAS;AAE7B,UAAAI,IAAkBC,EAAY,MAAM;AACxC,MAAAX,EAAiB,MAAM,GACbF,EAAA,QAAQc,EAAO,sBAAsB;AAAA,IAAA,GAC9C,CAACd,CAAS,CAAC,GACRe,IAAiBF,EAAY,MAAM;AACvC,MAAAX,EAAiB,KAAK,GACZF,EAAA,QAAQc,EAAO,0BAA0B;AAAA,IAAA,GAClD,CAACd,CAAS,CAAC,GACRgB,IAAcH,EAAY,MAAM;AACpC,MAAAX,EAAiB,MAAA;AAAA,OAAe;AAAA,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;AAAA,oBAAEiD,IAAQ;AAAA,oBAAE;AAAA,kBAAA,GAC7B;AAAA,kBAEF,gBAAAnB;AAAA,oBAACoB;AAAA,oBAAA;AAAA,sBACC,yBAAyB;AAAA,wBACvB,QAAQF;AAAA,sBACV;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA,KAVwCC,EAAM,SAAS,CAWzD,CACD;AAAA,cAAA;AAAA,YAAA;AAAA,UACL;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
1
+ {"version":3,"file":"question-guide.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/question-guide.tsx"],"sourcesContent":["import type { IStickerData } from '../../../stickers/sticker-selector/sticker-selector-types';\nimport type { TPositionProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\n\nimport React, { memo, useCallback, useEffect, useMemo, useState, useRef } from 'react';\n\nimport StickerSelector from '../../../stickers/sticker-selector/sticker-selector';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport EVENTS from '../../constants/events';\nimport {\n Section,\n GuideContainer,\n CloseIcon,\n SolIcon,\n HintIcon,\n StickersIcon,\n SectionContainer,\n Guide,\n Pointer,\n} from './worksheet-sidebar-styled';\n\ntype TSections = 'HINT' | 'SOL';\n\ninterface IQuestionGuideProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n actionbarHeight: number;\n enableStickers?: boolean;\n handleStickerSend?: (sticker: IStickerData) => void;\n}\n\nconst QuestionGuide: React.FC<IQuestionGuideProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n actionbarHeight,\n loggerRef,\n enableStickers,\n handleStickerSend,\n }) => {\n const [activeSection, setActiveSection] = useState<TSections | undefined>();\n const [pointerPosition, setPointerPosition] = useState({\n top: 0,\n left: 0,\n });\n const [showStickers, setShowStickers] = useState(false);\n const { top, left } = pointerPosition;\n\n const handleHintClick = useCallback(() => {\n setActiveSection('HINT');\n loggerRef.current(EVENTS.WORKSHEET_V3_HINT_SEEN);\n }, [loggerRef]);\n const handleSolClick = useCallback(() => {\n setActiveSection('SOL');\n loggerRef.current(EVENTS.WORKSHEET_V3_SOLUTION_SEEN);\n }, [loggerRef]);\n const handleClose = useCallback(() => {\n setActiveSection(() => undefined);\n }, []);\n const handleBadgeToggle = useCallback(() => {\n setShowStickers(prev => !prev);\n }, []);\n\n const { hints, solution } = questions[activeQuestionIndex]?.metadata || {};\n\n const activeSectionData = useMemo(() => {\n return activeSection === undefined ? undefined : activeSection === 'HINT' ? hints : solution;\n }, [activeSection, hints, solution]);\n\n const sqlRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const hintRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n\n const updatePointerPosition = useCallback((ref: React.RefObject<HTMLDivElement>) => {\n if (ref.current) {\n const rect = ref.current.getBoundingClientRect();\n\n setPointerPosition({\n top: rect.top + rect.height / 2 - 8,\n left: rect.right - 78, // 52px (sidebar width) + 16px (gutter) + 10px\n });\n }\n }, []);\n\n const stickerTrigger = useMemo(\n () => (\n <Clickable label=\"teacher-badges\" onClick={handleBadgeToggle}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <StickersIcon width={32} height={32} $disabled={!showStickers} />\n <Text $renderAs=\"eyebrow2\" $color={!showStickers ? 'GREY_4' : 'BLACK'}>\n STICKERS\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n ),\n [showStickers, handleBadgeToggle],\n );\n\n const stickerGridConfig = useMemo(\n () => ({\n stickerSize: 48,\n columns: 4,\n gap: 8,\n }),\n [],\n );\n\n const stickerTooltipConfig = useMemo(\n () => ({\n position: 'left' as TPositionProps,\n zIndex: 1000,\n arrowXCoOrdinates: 87.5,\n tooltipXCoOrdinates: '-32.5%',\n }),\n [],\n );\n\n if (activeSection && activeSectionData && learnosity) {\n learnosity.renderMath('mathjax');\n }\n\n useEffect(() => {\n if (activeSection === 'HINT') {\n updatePointerPosition(hintRef);\n } else if (activeSection === 'SOL') {\n updatePointerPosition(sqlRef);\n } else if (!activeSectionData) {\n setActiveSection(undefined);\n }\n }, [activeSection, updatePointerPosition, activeSectionData]);\n\n return (\n <GuideContainer $background=\"WHITE\">\n {enableStickers && handleStickerSend && (\n <StickerSelector\n triggerNode={stickerTrigger}\n onStickerSend={handleStickerSend}\n gridConfig={stickerGridConfig}\n tooltipConfig={stickerTooltipConfig}\n visible={showStickers}\n onToggle={handleBadgeToggle}\n />\n )}\n <Clickable label=\"hints\" onClick={handleHintClick} disabled={!hints}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={hintRef}>\n <HintIcon width={32} height={32} $disabled={!hints} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n HINT\n </Text>\n <FlexView $gap={8} $alignItems=\"center\">\n <Separator width={24} height={1} background=\"GREY_2\" />\n </FlexView>\n </FlexView>\n </Clickable>\n <Clickable label=\"solution\" onClick={handleSolClick} disabled={!solution}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\" ref={sqlRef}>\n <SolIcon width={32} height={32} $disabled={!solution} />\n <Text $renderAs=\"eyebrow2\" $color={!hints ? 'GREY_4' : 'BLACK'}>\n SOL\n </Text>\n </FlexView>\n </Clickable>\n {activeSection && top && left && <Pointer topValue={top} leftValue={left} />}\n {activeSection && (\n <SectionContainer\n $background=\"WHITE\"\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n $borderRadius={10}\n >\n <Section\n $gutterX={1}\n $gapX={1}\n $questionWidth={questionWidth}\n $actionbarHeight={actionbarHeight}\n >\n <Clickable label=\"close\" onClick={handleClose}>\n <CloseIcon />\n </Clickable>\n <FlexView $gutterX={0.5}>\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection === 'HINT' ? 'HINTS:' : 'SOLUTION:'}\n </Text>\n </FlexView>\n {activeSectionData &&\n activeSectionData.map((item, index) => (\n <FlexView $gutterX={0.5} $gapX={0.5} key={index.toString()}>\n {activeSectionData.length > 1 && (\n <Text $renderAs=\"eyebrow2\" $color=\"ORANGE_5\" $marginBottomX={0.25}>\n {activeSection} {index + 1}:\n </Text>\n )}\n <Guide\n dangerouslySetInnerHTML={{\n __html: item,\n }}\n />\n </FlexView>\n ))}\n </Section>\n </SectionContainer>\n )}\n </GuideContainer>\n );\n },\n);\n\nexport default QuestionGuide;\n"],"names":["QuestionGuide","memo","questionWidth","questions","activeQuestionIndex","learnosity","actionbarHeight","loggerRef","enableStickers","handleStickerSend","activeSection","setActiveSection","useState","pointerPosition","setPointerPosition","showStickers","setShowStickers","top","left","handleHintClick","useCallback","EVENTS","handleSolClick","handleClose","handleBadgeToggle","prev","hints","solution","_a","activeSectionData","useMemo","sqlRef","useRef","hintRef","updatePointerPosition","ref","rect","stickerTrigger","jsx","Clickable","jsxs","FlexView","StickersIcon","Text","Separator","stickerGridConfig","stickerTooltipConfig","useEffect","GuideContainer","StickerSelector","HintIcon","SolIcon","Pointer","SectionContainer","Section","CloseIcon","item","index","Guide"],"mappings":";;;;;;;;;AAoCA,MAAMA,KAA+CC;AAAA,EACnD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,mBAAAC;AAAA,EAAA,MACI;;AACJ,UAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAgC,GACpE,CAACC,GAAiBC,CAAkB,IAAIF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AAAgC,EAACC,KAAU,OAAM,SAAQ,SAAShB,GAChC,UAAA,gBAAAe,EAACiB,KAAU,EACb,CAAA;AAAA,kCACCd,GAAS,EAAA,UAAU,KAClB,UAAA,gBAAAH,EAACK,KAAK,WAAU,YAAW,QAAO,YAAW,gBAAgB,MAC1D,UAAAjC,MAAkB,SAAS,WAAW,YACzC,CAAA,GACF;AAAA,gBACCmB,KACCA,EAAkB,IAAI,CAAC2B,GAAMC,MAC3B,gBAAAjB,EAACC,GAAS,EAAA,UAAU,KAAK,OAAO,KAC7B,UAAA;AAAA,kBAAkBZ,EAAA,SAAS,KACzB,gBAAAW,EAAAG,GAAA,EAAK,WAAU,YAAW,QAAO,YAAW,gBAAgB,MAC1D,UAAA;AAAA,oBAAAjC;AAAA,oBAAc;AAAA,oBAAE+C,IAAQ;AAAA,oBAAE;AAAA,kBAAA,GAC7B;AAAA,kBAEF,gBAAAnB;AAAA,oBAACoB;AAAA,oBAAA;AAAA,sBACC,yBAAyB;AAAA,wBACvB,QAAQF;AAAA,sBACV;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA,KAVwCC,EAAM,SAAS,CAWzD,CACD;AAAA,cAAA;AAAA,YAAA;AAAA,UACL;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
@@ -1,12 +1,12 @@
1
1
  import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import { memo as $, useCallback as x } from "react";
3
- import C from "../../../ui/layout/flex-view.js";
4
- import g from "../../../ui/separator/separator.js";
2
+ import { memo as C, useCallback as g } from "react";
3
+ import u from "../../../ui/layout/flex-view.js";
4
+ import w from "../../../ui/separator/separator.js";
5
5
  import { SIDEBAR_WIDTH as f } from "../constants.js";
6
- import u from "./navigator.js";
7
- import w from "./question-guide.js";
8
- import { SideBarContainer as S, UnderlinedTextWrapper as T, UnderlinedText as j } from "./worksheet-sidebar-styled.js";
9
- const I = $(
6
+ import S from "./navigator.js";
7
+ import T from "./question-guide.js";
8
+ import { SideBarContainer as j, UnderlinedTextWrapper as k, UnderlinedText as A } from "./worksheet-sidebar-styled.js";
9
+ const X = C(
10
10
  ({
11
11
  questionWidth: t,
12
12
  questions: i,
@@ -16,34 +16,38 @@ const I = $(
16
16
  height: l,
17
17
  actionbarHeight: s,
18
18
  openQuestionFeedbackModal: e,
19
- loggerRef: h
19
+ loggerRef: h,
20
+ enableStickers: p,
21
+ handleStickerSend: d
20
22
  }) => {
21
- const p = i[m], { item_reference: o } = p ?? {}, d = x(() => {
23
+ const $ = i[m], { item_reference: o } = $ ?? {}, x = g(() => {
22
24
  e && e(o || "");
23
25
  }, [o, e]);
24
26
  return c !== "TEACHER" || !e ? null : /* @__PURE__ */ n(
25
- S,
27
+ j,
26
28
  {
27
29
  $width: f,
28
30
  $questionWidth: t,
29
31
  $height: l,
30
32
  $justifyContent: "space-between",
31
33
  children: [
32
- /* @__PURE__ */ r(T, { $width: f, $alignItems: "flex-start", $gapX: 0.5, children: /* @__PURE__ */ r(j, { $renderAs: "cta1", onClick: d, children: "Question Feedback" }) }),
33
- /* @__PURE__ */ n(C, { children: [
34
+ /* @__PURE__ */ r(k, { $width: f, $alignItems: "flex-start", $gapX: 0.5, children: /* @__PURE__ */ r(A, { $renderAs: "cta1", onClick: x, children: "Question Feedback" }) }),
35
+ /* @__PURE__ */ n(u, { children: [
34
36
  /* @__PURE__ */ r(
35
- w,
37
+ T,
36
38
  {
37
39
  questionWidth: t,
38
40
  questions: i,
39
41
  activeQuestionIndex: m,
40
42
  learnosity: a,
41
43
  actionbarHeight: s,
42
- loggerRef: h
44
+ loggerRef: h,
45
+ enableStickers: p,
46
+ handleStickerSend: d
43
47
  }
44
48
  ),
45
- /* @__PURE__ */ r(g, { heightX: 0.5 }),
46
- /* @__PURE__ */ r(u, {})
49
+ /* @__PURE__ */ r(w, { heightX: 0.5 }),
50
+ /* @__PURE__ */ r(S, {})
47
51
  ] })
48
52
  ]
49
53
  }
@@ -51,6 +55,6 @@ const I = $(
51
55
  }
52
56
  );
53
57
  export {
54
- I as default
58
+ X as default
55
59
  };
56
60
  //# sourceMappingURL=sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/sidebar.tsx"],"sourcesContent":["import type { TUserTypes } from '../../../ui/types';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\n\nimport { memo, useCallback } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport { SIDEBAR_WIDTH } from '../constants';\nimport Navigator from './navigator';\nimport QuestionGuide from './question-guide';\nimport {\n SideBarContainer,\n UnderlinedText,\n UnderlinedTextWrapper,\n} from './worksheet-sidebar-styled';\n\ninterface IWorksheetSideBarProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n userType: TUserTypes;\n height: number | string;\n actionbarHeight: number;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\nconst WorksheetSideBar: React.FC<IWorksheetSideBarProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n userType,\n height,\n actionbarHeight,\n openQuestionFeedbackModal,\n loggerRef,\n }) => {\n const activeQuestion = questions[activeQuestionIndex];\n const { item_reference: itemRef } = activeQuestion ?? {};\n\n const onFeedbackClick = useCallback(() => {\n if (openQuestionFeedbackModal) {\n openQuestionFeedbackModal(itemRef || '');\n }\n }, [itemRef, openQuestionFeedbackModal]);\n\n if (userType !== 'TEACHER' || !openQuestionFeedbackModal) return null;\n\n return (\n <SideBarContainer\n $width={SIDEBAR_WIDTH}\n $questionWidth={questionWidth}\n $height={height}\n $justifyContent=\"space-between\"\n >\n <UnderlinedTextWrapper $width={SIDEBAR_WIDTH} $alignItems=\"flex-start\" $gapX={0.5}>\n <UnderlinedText $renderAs=\"cta1\" onClick={onFeedbackClick}>\n Question Feedback\n </UnderlinedText>\n </UnderlinedTextWrapper>\n\n <FlexView>\n <QuestionGuide\n questionWidth={questionWidth}\n questions={questions}\n activeQuestionIndex={activeQuestionIndex}\n learnosity={learnosity}\n actionbarHeight={actionbarHeight}\n loggerRef={loggerRef}\n />\n <Separator heightX={0.5} />\n <Navigator />\n </FlexView>\n </SideBarContainer>\n );\n },\n);\n\nexport default WorksheetSideBar;\n"],"names":["WorksheetSideBar","memo","questionWidth","questions","activeQuestionIndex","learnosity","userType","height","actionbarHeight","openQuestionFeedbackModal","loggerRef","activeQuestion","itemRef","onFeedbackClick","useCallback","jsxs","SideBarContainer","SIDEBAR_WIDTH","jsx","UnderlinedTextWrapper","UnderlinedText","FlexView","QuestionGuide","Separator","Navigator"],"mappings":";;;;;;;;AA2BA,MAAMA,IAAqDC;AAAA,EACzD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAiBR,EAAUC,CAAmB,GAC9C,EAAE,gBAAgBQ,MAAYD,KAAkB,CAAA,GAEhDE,IAAkBC,EAAY,MAAM;AACxC,MAAIL,KACFA,EAA0BG,KAAW,EAAE;AAAA,IACzC,GACC,CAACA,GAASH,CAAyB,CAAC;AAEvC,WAAIH,MAAa,aAAa,CAACG,IAAkC,OAG/D,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQC;AAAA,QACR,gBAAgBf;AAAA,QAChB,SAASK;AAAA,QACT,iBAAgB;AAAA,QAEhB,UAAA;AAAA,UAAA,gBAAAW,EAACC,GAAsB,EAAA,QAAQF,GAAe,aAAY,cAAa,OAAO,KAC5E,UAAC,gBAAAC,EAAAE,GAAA,EAAe,WAAU,QAAO,SAASP,GAAiB,8BAE3D,CAAA,GACF;AAAA,4BAECQ,GACC,EAAA,UAAA;AAAA,YAAA,gBAAAH;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,eAAApB;AAAA,gBACA,WAAAC;AAAA,gBACA,qBAAAC;AAAA,gBACA,YAAAC;AAAA,gBACA,iBAAAG;AAAA,gBACA,WAAAE;AAAA,cAAA;AAAA,YACF;AAAA,YACA,gBAAAQ,EAACK,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,8BACxBC,GAAU,EAAA;AAAA,UAAA,GACb;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"sidebar.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-sidebar/sidebar.tsx"],"sourcesContent":["import type { IStickerData } from '../../../stickers/sticker-selector/sticker-selector-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type { ILearnosity, IWorksheetProps, IWorksheetQuestion } from '../worksheet-types';\n\nimport { memo, useCallback } from 'react';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport { SIDEBAR_WIDTH } from '../constants';\nimport Navigator from './navigator';\nimport QuestionGuide from './question-guide';\nimport {\n SideBarContainer,\n UnderlinedText,\n UnderlinedTextWrapper,\n} from './worksheet-sidebar-styled';\n\ninterface IWorksheetSideBarProps extends Pick<IWorksheetProps, 'loggerRef'> {\n questionWidth: number;\n questions: IWorksheetQuestion[];\n activeQuestionIndex: number;\n learnosity: ILearnosity;\n userType: TUserTypes;\n height: number | string;\n actionbarHeight: number;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n enableStickers?: boolean;\n handleStickerSend?: (sticker: IStickerData) => void;\n}\n\nconst WorksheetSideBar: React.FC<IWorksheetSideBarProps> = memo(\n ({\n questionWidth,\n questions,\n activeQuestionIndex,\n learnosity,\n userType,\n height,\n actionbarHeight,\n openQuestionFeedbackModal,\n loggerRef,\n enableStickers,\n handleStickerSend,\n }) => {\n const activeQuestion = questions[activeQuestionIndex];\n const { item_reference: itemRef } = activeQuestion ?? {};\n\n const onFeedbackClick = useCallback(() => {\n if (openQuestionFeedbackModal) {\n openQuestionFeedbackModal(itemRef || '');\n }\n }, [itemRef, openQuestionFeedbackModal]);\n\n if (userType !== 'TEACHER' || !openQuestionFeedbackModal) return null;\n\n return (\n <SideBarContainer\n $width={SIDEBAR_WIDTH}\n $questionWidth={questionWidth}\n $height={height}\n $justifyContent=\"space-between\"\n >\n <UnderlinedTextWrapper $width={SIDEBAR_WIDTH} $alignItems=\"flex-start\" $gapX={0.5}>\n <UnderlinedText $renderAs=\"cta1\" onClick={onFeedbackClick}>\n Question Feedback\n </UnderlinedText>\n </UnderlinedTextWrapper>\n\n <FlexView>\n <QuestionGuide\n questionWidth={questionWidth}\n questions={questions}\n activeQuestionIndex={activeQuestionIndex}\n learnosity={learnosity}\n actionbarHeight={actionbarHeight}\n loggerRef={loggerRef}\n enableStickers={enableStickers}\n handleStickerSend={handleStickerSend}\n />\n <Separator heightX={0.5} />\n <Navigator />\n </FlexView>\n </SideBarContainer>\n );\n },\n);\n\nexport default WorksheetSideBar;\n"],"names":["WorksheetSideBar","memo","questionWidth","questions","activeQuestionIndex","learnosity","userType","height","actionbarHeight","openQuestionFeedbackModal","loggerRef","enableStickers","handleStickerSend","activeQuestion","itemRef","onFeedbackClick","useCallback","jsxs","SideBarContainer","SIDEBAR_WIDTH","jsx","UnderlinedTextWrapper","UnderlinedText","FlexView","QuestionGuide","Separator","Navigator"],"mappings":";;;;;;;;AA8BA,MAAMA,IAAqDC;AAAA,EACzD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,mBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAiBV,EAAUC,CAAmB,GAC9C,EAAE,gBAAgBU,MAAYD,KAAkB,CAAA,GAEhDE,IAAkBC,EAAY,MAAM;AACxC,MAAIP,KACFA,EAA0BK,KAAW,EAAE;AAAA,IACzC,GACC,CAACA,GAASL,CAAyB,CAAC;AAEvC,WAAIH,MAAa,aAAa,CAACG,IAAkC,OAG/D,gBAAAQ;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQC;AAAA,QACR,gBAAgBjB;AAAA,QAChB,SAASK;AAAA,QACT,iBAAgB;AAAA,QAEhB,UAAA;AAAA,UAAA,gBAAAa,EAACC,GAAsB,EAAA,QAAQF,GAAe,aAAY,cAAa,OAAO,KAC5E,UAAC,gBAAAC,EAAAE,GAAA,EAAe,WAAU,QAAO,SAASP,GAAiB,8BAE3D,CAAA,GACF;AAAA,4BAECQ,GACC,EAAA,UAAA;AAAA,YAAA,gBAAAH;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,eAAAtB;AAAA,gBACA,WAAAC;AAAA,gBACA,qBAAAC;AAAA,gBACA,YAAAC;AAAA,gBACA,iBAAAG;AAAA,gBACA,WAAAE;AAAA,gBACA,gBAAAC;AAAA,gBACA,mBAAAC;AAAA,cAAA;AAAA,YACF;AAAA,YACA,gBAAAQ,EAACK,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,8BACxBC,GAAU,EAAA;AAAA,UAAA,GACb;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\nimport type { MutableRefObject, ReactElement } from 'react';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\nexport type TItemType =\n | 'overview'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\nexport interface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\nexport interface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * * In case of puzzle worksheet.\n * * If true,\n * For student we show tooltip with 'Discuss with tutor in class'.\n * For teacher we show review cta.\n * * If false,\n * For student we show tooltip with 'Already solved'.\n * For teacher we don't show review cta.\n */\n canTeacherValidate: boolean;\n /**\n * * In case of puzzle worksheet for teacher\n * * If true,\n * Teacher validation button will be disabled.\n * * If false,\n * Teacher validation button will be active.\n */\n canTeacherValidateDisabled?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n solutionHidden?: boolean;\n /**\n * If true, solution will be hidden.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n /**\n * If true, the user can unassign the sheet.\n */\n canUnAssign?: boolean;\n /**\n * If true, journey will be started.\n */\n canStartJourney?: boolean;\n}\n\nexport type TWORKSHHET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;\n onUnassign?: () => void;\n onReview?: () => void;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\nexport interface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\nexport interface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n isCanvasEnabled: boolean;\n canToggleScribbling?: boolean;\n}\n\nexport interface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n renderSideBar: boolean;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n background?: 'none' | 'paper';\n layout: IWorksheetLayout;\n behavior: IWorksheetBehavior;\n initialResponseId?: string;\n initialItemIndex?: number;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n onResolveDoubt?: (responseId: string) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n canResolveDoubt?: boolean;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n canShowActionBar?: boolean;\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n learnosityActivityRef?: string;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n questionsSignedRequest: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n studentId: string;\n attemptId?: string;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\nexport interface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetContainerProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n studentId: string;\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING"],"mappings":"AAMY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { IStickerData } from '../../stickers/sticker-selector/sticker-selector-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\nimport type { MutableRefObject, ReactElement } from 'react';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\nexport type TItemType =\n | 'overview'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\nexport interface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\nexport interface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * * In case of puzzle worksheet.\n * * If true,\n * For student we show tooltip with 'Discuss with tutor in class'.\n * For teacher we show review cta.\n * * If false,\n * For student we show tooltip with 'Already solved'.\n * For teacher we don't show review cta.\n */\n canTeacherValidate: boolean;\n /**\n * * In case of puzzle worksheet for teacher\n * * If true,\n * Teacher validation button will be disabled.\n * * If false,\n * Teacher validation button will be active.\n */\n canTeacherValidateDisabled?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n solutionHidden?: boolean;\n /**\n * If true, solution will be hidden.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n /**\n * If true, the user can unassign the sheet.\n */\n canUnAssign?: boolean;\n /**\n * If true, journey will be started.\n */\n canStartJourney?: boolean;\n /**\n * If true displays option to send stickers in worksheet sidebar.\n */\n enableStickers?: boolean;\n}\n\nexport type TWORKSHHET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;\n onUnassign?: () => void;\n onReview?: () => void;\n onStickerSend?: (sticker: IStickerData) => void;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\nexport interface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\nexport interface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n isCanvasEnabled: boolean;\n canToggleScribbling?: boolean;\n}\n\nexport interface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n renderSideBar: boolean;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n background?: 'none' | 'paper';\n layout: IWorksheetLayout;\n behavior: IWorksheetBehavior;\n initialResponseId?: string;\n initialItemIndex?: number;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n onResolveDoubt?: (responseId: string) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n canResolveDoubt?: boolean;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n canShowActionBar?: boolean;\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n learnosityActivityRef?: string;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n questionsSignedRequest: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n studentId: string;\n attemptId?: string;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\nexport interface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetContainerProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n studentId: string;\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING"],"mappings":"AAOY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA;"}