@cuemath/leap 3.1.44-beta-0.2 → 3.1.44-hg2

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 (51) hide show
  1. package/dist/features/auth/forgot-password/forgot-password-styled.js +14 -14
  2. package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
  3. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +7 -7
  4. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
  5. package/dist/features/auth/login/login-styled.js +9 -9
  6. package/dist/features/auth/login/login-styled.js.map +1 -1
  7. package/dist/features/hooks/use-viewport/use-viewport.js +8 -16
  8. package/dist/features/hooks/use-viewport/use-viewport.js.map +1 -1
  9. package/dist/features/ui/theme/constants.js +11 -0
  10. package/dist/features/ui/theme/constants.js.map +1 -0
  11. package/dist/features/ui/theme/get-device.js +6 -0
  12. package/dist/features/ui/theme/get-device.js.map +1 -0
  13. package/dist/features/ui/theme/get-theme.js +23 -21
  14. package/dist/features/ui/theme/get-theme.js.map +1 -1
  15. package/dist/features/ui/theme/layout.js +5 -3
  16. package/dist/features/ui/theme/layout.js.map +1 -1
  17. package/dist/features/ui/theme/media-queries.js +11 -0
  18. package/dist/features/ui/theme/media-queries.js.map +1 -0
  19. package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js +43 -45
  20. package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js.map +1 -1
  21. package/dist/features/worksheet/worksheet/worksheet-helpers.js +84 -98
  22. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  23. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +66 -66
  24. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  25. package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js +75 -78
  26. package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js.map +1 -1
  27. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +202 -268
  28. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
  29. package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js +20 -21
  30. package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js.map +1 -1
  31. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  32. package/dist/features/worksheet/worksheet/worksheet.js +354 -378
  33. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  34. package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js +18 -20
  35. package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js.map +1 -1
  36. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +25 -33
  37. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
  38. package/dist/features/worksheet/worksheet-preview/worksheet-preview-styled.js +15 -22
  39. package/dist/features/worksheet/worksheet-preview/worksheet-preview-styled.js.map +1 -1
  40. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +66 -85
  41. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
  42. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +32 -51
  43. package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
  44. package/dist/index.d.ts +7 -26
  45. package/dist/index.js +32 -34
  46. package/dist/index.js.map +1 -1
  47. package/package.json +1 -1
  48. package/dist/features/ui/theme/device.js +0 -5
  49. package/dist/features/ui/theme/device.js.map +0 -1
  50. package/dist/features/utils/media.js +0 -16
  51. package/dist/features/utils/media.js.map +0 -1
@@ -1,112 +1,93 @@
1
- import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
- import { memo as v, useMemo as d, useRef as N, useCallback as A } from "react";
3
- import P from "../../ui/layout/flex-view.js";
4
- import B from "../../ui/text/text.js";
5
- import M from "../worksheet/worksheet-container.js";
6
- import { getWorksheetHeaderLayout as z } from "../worksheet/worksheet-helpers.js";
7
- import j from "./hooks/use-worksheet-layout.js";
8
- import { WorksheetPageWrapper as D, HeaderWrapper as K, Header as O, StyledBackIcon as U, HeaderTitleWrapper as V } from "./worksheet-preview-styled.js";
9
- const F = [
1
+ import { jsxs as h, jsx as t } from "react/jsx-runtime";
2
+ import { memo as x, useMemo as p, useRef as y, useCallback as S } from "react";
3
+ import T from "../../ui/layout/flex-view.js";
4
+ import H from "../../ui/text/text.js";
5
+ import R from "../worksheet/worksheet-container.js";
6
+ import q from "./hooks/use-worksheet-layout.js";
7
+ import { WorksheetPageWrapper as v, HeaderWrapper as L, StyledBackIcon as N, HeaderTitleWrapper as B } from "./worksheet-preview-styled.js";
8
+ const M = [
10
9
  "SAT_ENGLISH_ASSESSMENT",
11
10
  "SAT_MATH_ASSESSMENT"
12
- ], te = v((E) => {
11
+ ], V = x((k) => {
13
12
  const {
14
- studentId: l,
15
- userType: u,
16
- activityReference: i,
13
+ studentId: a,
14
+ userType: c,
15
+ activityReference: o,
17
16
  worksheet: f,
18
- action: m,
19
- nodeType: s,
20
- worksheetName: h,
21
- scribblingEnabled: a,
22
- showNudgeBanner: p,
23
- markedAsCompleted: W,
24
- imageHue: k,
25
- onWorksheetLoaded: b,
17
+ action: d,
18
+ nodeType: n,
19
+ worksheetName: l,
20
+ scribblingEnabled: E,
21
+ showNudgeBanner: u,
22
+ markedAsCompleted: g,
23
+ onWorksheetLoaded: A,
26
24
  onWorksheetErrored: _,
27
- openQuestionFeedbackModal: $,
28
- onBackIconClick: n,
29
- onUnassign: w
30
- } = E, {
31
- signed_request: C,
32
- questions_signed_request: H,
33
- player_config: e
34
- } = f, o = d(() => s === "PUZZLE_CARD", [s]), t = d(() => i === "test", [i]), c = d(() => F.includes(s), [s]), R = N(() => null), S = o ? a : !t, x = j({
35
- userType: u,
36
- nodeType: s,
37
- isSATAssessment: c,
38
- showNudgeBanner: p,
39
- topOffset: 56,
40
- imageHue: k
41
- }), I = d(
42
- () => o && a || !c && (e == null ? void 0 : e.canAttempt) && a,
43
- [o, c, e == null ? void 0 : e.canAttempt, a]
44
- ), T = A(() => !0, []), y = A(() => {
45
- n == null || n();
46
- }, [n]), { bgColor: L, borderColor: q } = z({
47
- isPuzzleWorksheet: o && S,
48
- isTestWorksheet: t,
49
- imageHue: k
50
- });
51
- return /* @__PURE__ */ g(D, { children: [
52
- /* @__PURE__ */ r(K, { children: /* @__PURE__ */ g(
53
- O,
25
+ openQuestionFeedbackModal: W,
26
+ onBackIconClick: r
27
+ } = k, {
28
+ signed_request: w,
29
+ questions_signed_request: $,
30
+ player_config: s
31
+ } = f, e = p(() => o === "test", [o]), i = p(() => M.includes(n), [n]), b = y(() => null), C = q({
32
+ userType: c,
33
+ nodeType: n,
34
+ isSATAssessment: i,
35
+ showNudgeBanner: u,
36
+ topOffset: 56
37
+ }), m = S(() => !0, []), I = S(() => {
38
+ r == null || r();
39
+ }, [r]);
40
+ return /* @__PURE__ */ h(v, { children: [
41
+ /* @__PURE__ */ t(L, { children: /* @__PURE__ */ h(
42
+ T,
54
43
  {
55
44
  $flexDirection: "row",
56
45
  $alignItems: "center",
57
- $justifyContent: t ? "flex-start" : "center",
58
- $background: L,
46
+ $justifyContent: e ? "flex-start" : "center",
47
+ $background: e ? "WHITE_3" : "BLACK",
59
48
  $height: 56,
60
49
  $gutterX: 1,
61
50
  $flexGapX: 1,
62
- $borderColor: q,
63
51
  children: [
64
- n && /* @__PURE__ */ r(
65
- U,
52
+ r && /* @__PURE__ */ t(
53
+ N,
66
54
  {
67
- $color: t ? "BLACK_T_87" : "WHITE",
68
- onClick: y
55
+ $color: e ? "BLACK_T_87" : "WHITE",
56
+ onClick: I
69
57
  }
70
58
  ),
71
- /* @__PURE__ */ r(
72
- V,
73
- {
74
- $alignItems: t && !o ? "flex-start" : "center",
75
- children: /* @__PURE__ */ r(B, { $renderAs: "body1", $color: t ? "BLACK_T_87" : "WHITE", children: h || i })
76
- }
77
- )
59
+ /* @__PURE__ */ t(B, { $alignItems: e ? "flex-start" : "center", children: /* @__PURE__ */ t(H, { $renderAs: "body1", $color: e ? "BLACK_T_87" : "WHITE", children: l || o }) })
78
60
  ]
79
61
  }
80
62
  ) }),
81
- /* @__PURE__ */ r(P, { $alignItems: "center", children: /* @__PURE__ */ r(
82
- M,
63
+ /* @__PURE__ */ t(T, { $alignItems: "center", children: /* @__PURE__ */ t(
64
+ R,
83
65
  {
84
- userType: u ?? (m === "review" ? "TEACHER" : "STUDENT"),
85
- worksheetCompleted: m === "review",
86
- worksheetName: h || i,
87
- itemsSignedRequest: C,
88
- questionsSignedRequest: H,
89
- behavior: e,
90
- studentId: l,
91
- background: c || o ? "none" : "paper",
92
- layout: x,
93
- canShowActionBar: S,
94
- loggerRef: R,
95
- showNudgeBanner: p,
96
- markedAsCompleted: W,
97
- onLoaded: b,
66
+ userType: c ?? (d === "review" ? "TEACHER" : "STUDENT"),
67
+ worksheetCompleted: d === "review",
68
+ worksheetName: l || o,
69
+ itemsSignedRequest: w,
70
+ questionsSignedRequest: $,
71
+ behavior: s,
72
+ studentId: a,
73
+ background: i ? "none" : "paper",
74
+ layout: C,
75
+ canShowActionBar: !e,
76
+ loggerRef: b,
77
+ showNudgeBanner: u,
78
+ markedAsCompleted: g,
79
+ onLoaded: A,
98
80
  onErrored: _,
99
- userId: l,
100
- onPublishStrokes: T,
101
- onReceiveStrokes: T,
102
- isCanvasEnabled: I,
103
- openQuestionFeedbackModal: $,
104
- onUnassign: w
81
+ userId: a,
82
+ onPublishStrokes: m,
83
+ onReceiveStrokes: m,
84
+ isCanvasEnabled: !i && (s == null ? void 0 : s.canAttempt) && E,
85
+ openQuestionFeedbackModal: W
105
86
  }
106
87
  ) })
107
88
  ] });
108
89
  });
109
90
  export {
110
- te as default
91
+ V as default
111
92
  };
112
93
  //# sourceMappingURL=worksheet-preview-view.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-preview-view.js","sources":["../../../../src/features/worksheet/worksheet-preview/worksheet-preview-view.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../types/models/worksheet';\nimport type { IPreviewWorksheetViewProps } from './worksheet-preview-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport WorksheetContainer from '../worksheet/worksheet-container';\nimport { getWorksheetHeaderLayout } from '../worksheet/worksheet-helpers';\nimport useWorksheetLayout from './hooks/use-worksheet-layout';\nimport * as Styled from './worksheet-preview-styled';\n\nconst SAT_WORKSHEET_TYPES: IResumeWorksheetModel['node_type'][] = [\n 'SAT_ENGLISH_ASSESSMENT',\n 'SAT_MATH_ASSESSMENT',\n];\n\nconst PreviewWorksheetView: FC<IPreviewWorksheetViewProps> = memo(props => {\n const {\n studentId,\n userType,\n activityReference,\n worksheet,\n action,\n nodeType,\n worksheetName,\n scribblingEnabled,\n showNudgeBanner,\n markedAsCompleted,\n imageHue,\n onWorksheetLoaded,\n onWorksheetErrored,\n openQuestionFeedbackModal,\n onBackIconClick,\n onUnassign,\n } = props;\n const {\n signed_request: signedRequest,\n questions_signed_request: questionsSignedRequest,\n player_config: playerConfig,\n } = worksheet;\n\n const isPuzzleWorksheet = useMemo(() => nodeType === 'PUZZLE_CARD', [nodeType]);\n const isTestWorksheet = useMemo(() => activityReference === 'test', [activityReference]);\n const isSATAssessment = useMemo(() => SAT_WORKSHEET_TYPES.includes(nodeType), [nodeType]);\n const loggerRef = useRef(() => null);\n const isActionBarVisible = isPuzzleWorksheet ? scribblingEnabled : !isTestWorksheet;\n\n const layout = useWorksheetLayout({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset: 56,\n imageHue,\n });\n\n const isCanvasEnabled = useMemo(\n () =>\n (isPuzzleWorksheet && scribblingEnabled) ||\n (!isSATAssessment && playerConfig?.canAttempt && scribblingEnabled),\n [isPuzzleWorksheet, isSATAssessment, playerConfig?.canAttempt, scribblingEnabled],\n );\n\n const handleStrokes = useCallback(() => true, []);\n const handleOnBackIconClick = useCallback(() => {\n onBackIconClick?.();\n }, [onBackIconClick]);\n\n const { bgColor, borderColor } = getWorksheetHeaderLayout({\n isPuzzleWorksheet: isPuzzleWorksheet && isActionBarVisible,\n isTestWorksheet,\n imageHue,\n });\n\n return (\n <Styled.WorksheetPageWrapper>\n <Styled.HeaderWrapper>\n <Styled.Header\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent={isTestWorksheet ? 'flex-start' : 'center'}\n $background={bgColor}\n $height={56}\n $gutterX={1}\n $flexGapX={1}\n $borderColor={borderColor}\n >\n {onBackIconClick && (\n <Styled.StyledBackIcon\n $color={isTestWorksheet ? 'BLACK_T_87' : 'WHITE'}\n onClick={handleOnBackIconClick}\n />\n )}\n\n <Styled.HeaderTitleWrapper\n $alignItems={isTestWorksheet && !isPuzzleWorksheet ? 'flex-start' : 'center'}\n >\n <Text $renderAs=\"body1\" $color={isTestWorksheet ? 'BLACK_T_87' : 'WHITE'}>\n {worksheetName || activityReference}\n </Text>\n </Styled.HeaderTitleWrapper>\n </Styled.Header>\n </Styled.HeaderWrapper>\n\n <FlexView $alignItems=\"center\">\n <WorksheetContainer\n userType={userType ?? (action === 'review' ? 'TEACHER' : 'STUDENT')}\n worksheetCompleted={action === 'review'}\n worksheetName={worksheetName || activityReference}\n itemsSignedRequest={signedRequest}\n questionsSignedRequest={questionsSignedRequest}\n behavior={playerConfig}\n studentId={studentId}\n background={isSATAssessment || isPuzzleWorksheet ? 'none' : 'paper'}\n layout={layout}\n canShowActionBar={isActionBarVisible}\n loggerRef={loggerRef}\n showNudgeBanner={showNudgeBanner}\n markedAsCompleted={markedAsCompleted}\n onLoaded={onWorksheetLoaded}\n onErrored={onWorksheetErrored}\n userId={studentId}\n onPublishStrokes={handleStrokes}\n onReceiveStrokes={handleStrokes}\n isCanvasEnabled={isCanvasEnabled}\n openQuestionFeedbackModal={openQuestionFeedbackModal}\n onUnassign={onUnassign}\n />\n </FlexView>\n </Styled.WorksheetPageWrapper>\n );\n});\n\nexport default PreviewWorksheetView;\n"],"names":["SAT_WORKSHEET_TYPES","PreviewWorksheetView","memo","props","studentId","userType","activityReference","worksheet","action","nodeType","worksheetName","scribblingEnabled","showNudgeBanner","markedAsCompleted","imageHue","onWorksheetLoaded","onWorksheetErrored","openQuestionFeedbackModal","onBackIconClick","onUnassign","signedRequest","questionsSignedRequest","playerConfig","isPuzzleWorksheet","useMemo","isTestWorksheet","isSATAssessment","loggerRef","useRef","isActionBarVisible","layout","useWorksheetLayout","isCanvasEnabled","handleStrokes","useCallback","handleOnBackIconClick","bgColor","borderColor","getWorksheetHeaderLayout","jsxs","Styled.WorksheetPageWrapper","jsx","Styled.HeaderWrapper","Styled.Header","Styled.StyledBackIcon","Styled.HeaderTitleWrapper","Text","FlexView","WorksheetContainer"],"mappings":"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"}
1
+ {"version":3,"file":"worksheet-preview-view.js","sources":["../../../../src/features/worksheet/worksheet-preview/worksheet-preview-view.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../types/models/worksheet';\nimport type { IPreviewWorksheetViewProps } from './worksheet-preview-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useMemo, useRef } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport WorksheetContainer from '../worksheet/worksheet-container';\nimport useWorksheetLayout from './hooks/use-worksheet-layout';\nimport * as Styled from './worksheet-preview-styled';\n\nconst SAT_WORKSHEET_TYPES: IResumeWorksheetModel['node_type'][] = [\n 'SAT_ENGLISH_ASSESSMENT',\n 'SAT_MATH_ASSESSMENT',\n];\n\nconst PreviewWorksheetView: FC<IPreviewWorksheetViewProps> = memo(props => {\n const {\n studentId,\n userType,\n activityReference,\n worksheet,\n action,\n nodeType,\n worksheetName,\n scribblingEnabled,\n showNudgeBanner,\n markedAsCompleted,\n onWorksheetLoaded,\n onWorksheetErrored,\n openQuestionFeedbackModal,\n onBackIconClick,\n } = props;\n const {\n signed_request: signedRequest,\n questions_signed_request: questionsSignedRequest,\n player_config: playerConfig,\n } = worksheet;\n\n const isTestWorksheet = useMemo(() => activityReference === 'test', [activityReference]);\n const isSATAssessment = useMemo(() => SAT_WORKSHEET_TYPES.includes(nodeType), [nodeType]);\n const loggerRef = useRef(() => null);\n const layout = useWorksheetLayout({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset: 56,\n });\n\n const handleStrokes = useCallback(() => true, []);\n const handleOnBackIconClick = useCallback(() => {\n onBackIconClick?.();\n }, [onBackIconClick]);\n\n return (\n <Styled.WorksheetPageWrapper>\n <Styled.HeaderWrapper>\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent={isTestWorksheet ? 'flex-start' : 'center'}\n $background={isTestWorksheet ? 'WHITE_3' : 'BLACK'}\n $height={56}\n $gutterX={1}\n $flexGapX={1}\n >\n {onBackIconClick && (\n <Styled.StyledBackIcon\n $color={isTestWorksheet ? 'BLACK_T_87' : 'WHITE'}\n onClick={handleOnBackIconClick}\n />\n )}\n\n <Styled.HeaderTitleWrapper $alignItems={isTestWorksheet ? 'flex-start' : 'center'}>\n <Text $renderAs=\"body1\" $color={isTestWorksheet ? 'BLACK_T_87' : 'WHITE'}>\n {worksheetName || activityReference}\n </Text>\n </Styled.HeaderTitleWrapper>\n </FlexView>\n </Styled.HeaderWrapper>\n\n <FlexView $alignItems=\"center\">\n <WorksheetContainer\n userType={userType ?? (action === 'review' ? 'TEACHER' : 'STUDENT')}\n worksheetCompleted={action === 'review'}\n worksheetName={worksheetName || activityReference}\n itemsSignedRequest={signedRequest}\n questionsSignedRequest={questionsSignedRequest}\n behavior={playerConfig}\n studentId={studentId}\n background={isSATAssessment ? 'none' : 'paper'}\n layout={layout}\n canShowActionBar={!isTestWorksheet}\n loggerRef={loggerRef}\n showNudgeBanner={showNudgeBanner}\n markedAsCompleted={markedAsCompleted}\n onLoaded={onWorksheetLoaded}\n onErrored={onWorksheetErrored}\n userId={studentId}\n onPublishStrokes={handleStrokes}\n onReceiveStrokes={handleStrokes}\n isCanvasEnabled={!isSATAssessment && playerConfig?.canAttempt && scribblingEnabled}\n openQuestionFeedbackModal={openQuestionFeedbackModal}\n />\n </FlexView>\n </Styled.WorksheetPageWrapper>\n );\n});\n\nexport default PreviewWorksheetView;\n"],"names":["SAT_WORKSHEET_TYPES","PreviewWorksheetView","memo","props","studentId","userType","activityReference","worksheet","action","nodeType","worksheetName","scribblingEnabled","showNudgeBanner","markedAsCompleted","onWorksheetLoaded","onWorksheetErrored","openQuestionFeedbackModal","onBackIconClick","signedRequest","questionsSignedRequest","playerConfig","isTestWorksheet","useMemo","isSATAssessment","loggerRef","useRef","layout","useWorksheetLayout","handleStrokes","useCallback","handleOnBackIconClick","jsxs","Styled.WorksheetPageWrapper","jsx","Styled.HeaderWrapper","FlexView","Styled.StyledBackIcon","Styled.HeaderTitleWrapper","Text","WorksheetContainer"],"mappings":";;;;;;;AAYA,MAAMA,IAA4D;AAAA,EAChE;AAAA,EACA;AACF,GAEMC,IAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,iBAAAC;AAAA,EACE,IAAAd,GACE;AAAA,IACJ,gBAAgBe;AAAA,IAChB,0BAA0BC;AAAA,IAC1B,eAAeC;AAAA,EACb,IAAAb,GAEEc,IAAkBC,EAAQ,MAAMhB,MAAsB,QAAQ,CAACA,CAAiB,CAAC,GACjFiB,IAAkBD,EAAQ,MAAMtB,EAAoB,SAASS,CAAQ,GAAG,CAACA,CAAQ,CAAC,GAClFe,IAAYC,EAAO,MAAM,IAAI,GAC7BC,IAASC,EAAmB;AAAA,IAChC,UAAAtB;AAAA,IACA,UAAAI;AAAA,IACA,iBAAAc;AAAA,IACA,iBAAAX;AAAA,IACA,WAAW;AAAA,EAAA,CACZ,GAEKgB,IAAgBC,EAAY,MAAM,IAAM,CAAE,CAAA,GAC1CC,IAAwBD,EAAY,MAAM;AAC5B,IAAAZ,KAAA,QAAAA;AAAA,EAAA,GACjB,CAACA,CAAe,CAAC;AAGlB,SAAA,gBAAAc,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EACC,UAAA,gBAAAH;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,aAAY;AAAA,QACZ,iBAAiBd,IAAkB,eAAe;AAAA,QAClD,aAAaA,IAAkB,YAAY;AAAA,QAC3C,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,QAEV,UAAA;AAAA,UACCJ,KAAA,gBAAAgB;AAAA,YAACG;AAAAA,YAAA;AAAA,cACC,QAAQf,IAAkB,eAAe;AAAA,cACzC,SAASS;AAAA,YAAA;AAAA,UACX;AAAA,4BAGDO,GAAA,EAA0B,aAAahB,IAAkB,eAAe,UACvE,UAAA,gBAAAY,EAACK,GAAK,EAAA,WAAU,SAAQ,QAAQjB,IAAkB,eAAe,SAC9D,UAAAX,KAAiBJ,EACpB,CAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,IAEA,gBAAA2B,EAACE,GAAS,EAAA,aAAY,UACpB,UAAA,gBAAAF;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,UAAUlC,MAAaG,MAAW,WAAW,YAAY;AAAA,QACzD,oBAAoBA,MAAW;AAAA,QAC/B,eAAeE,KAAiBJ;AAAA,QAChC,oBAAoBY;AAAA,QACpB,wBAAAC;AAAA,QACA,UAAUC;AAAA,QACV,WAAAhB;AAAA,QACA,YAAYmB,IAAkB,SAAS;AAAA,QACvC,QAAAG;AAAA,QACA,kBAAkB,CAACL;AAAA,QACnB,WAAAG;AAAA,QACA,iBAAAZ;AAAA,QACA,mBAAAC;AAAA,QACA,UAAUC;AAAA,QACV,WAAWC;AAAA,QACX,QAAQX;AAAA,QACR,kBAAkBwB;AAAA,QAClB,kBAAkBA;AAAA,QAClB,iBAAiB,CAACL,MAAmBH,KAAA,gBAAAA,EAAc,eAAcT;AAAA,QACjE,2BAAAK;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -1,76 +1,57 @@
1
- import { jsx as n, jsxs as I, Fragment as P } from "react/jsx-runtime";
2
- import { memo as _, useMemo as c, useState as R, useCallback as h, useEffect as C } from "react";
3
- import D from "../../ui/error/error.js";
4
- import A from "../../ui/loader/app-loader/app-loader.js";
5
- import { usePreviewWorksheetGet as N } from "./api/get-preview-worksheet.js";
6
- import V from "./worksheet-preview-view.js";
7
- const x = _((d) => {
8
- const {
9
- activityReference: u,
10
- nodeType: e,
11
- action: t,
12
- isLessonV3Enabled: o,
13
- items: l,
14
- scribblingEnabled: f,
15
- onWorksheetLoaded: s
16
- } = d, m = c(() => {
17
- switch (e) {
1
+ import { jsx as n, jsxs as y, Fragment as I } from "react/jsx-runtime";
2
+ import { memo as P, useMemo as l, useState as E, useCallback as a, useEffect as _ } from "react";
3
+ import b from "../../ui/error/error.js";
4
+ import g from "../../ui/loader/app-loader/app-loader.js";
5
+ import { usePreviewWorksheetGet as C } from "./api/get-preview-worksheet.js";
6
+ import D from "./worksheet-preview-view.js";
7
+ const N = P((c) => {
8
+ const { activityReference: h, nodeType: r, action: t, isLessonV3Enabled: o, items: d, onWorksheetLoaded: s } = c, f = l(() => {
9
+ switch (r) {
18
10
  case "TRIAL_BASIC":
19
11
  case "TRIAL_INTERMEDIATE":
20
12
  case "TRIAL_ADVANCED":
21
13
  return !0;
22
14
  }
23
- }, [e]), i = c(() => e === "PUZZLE_CARD", [e]), [p, E] = R(), [v, W] = R(!1), { isProcessing: w, get: k, data: r, error: L } = N(), g = c(() => r && {
24
- ...r,
15
+ }, [r]), [R, m] = E(), [p, v] = E(!1), { isProcessing: w, get: u, data: e, error: A } = C(), k = l(() => e && {
16
+ ...e,
25
17
  player_config: {
26
- ...r.player_config,
18
+ ...e.player_config,
27
19
  retryButtonLabel: "Retry",
28
20
  checkButtonLabel: "Check",
29
21
  ...t === "review" && {
30
- navigationMode: m || i ? "CURRENT" : o ? "LINEAR" : "OPEN",
22
+ navigationMode: f ? "CURRENT" : o ? "LINEAR" : "OPEN",
31
23
  initialQuestion: "FIRST"
32
24
  },
33
25
  ...o && {
34
26
  teacherValidationEnabled: o
35
- },
36
- ...i && f && {
37
- teacherValidationEnabled: !0,
38
- canUnAssign: !0
39
27
  }
40
28
  }
41
- }, [
42
- t,
43
- m,
44
- o,
45
- i,
46
- f,
47
- r
48
- ]), a = h(() => {
49
- E(void 0), k(u, {
29
+ }, [t, f, o, e]), i = a(() => {
30
+ m(void 0), u(h, {
50
31
  action: t,
51
- node_type: e,
52
- items: l
32
+ node_type: r,
33
+ items: d
53
34
  });
54
- }, [t, u, k, e, l]), b = h(() => {
55
- W(!0), s == null || s(!0);
56
- }, [s]), T = h((y) => {
57
- E(y.message);
35
+ }, [t, h, u, r, d]), W = a(() => {
36
+ v(!0), s == null || s(!0);
37
+ }, [s]), L = a((T) => {
38
+ m(T.message);
58
39
  }, []);
59
- return C(() => {
60
- a();
61
- }, [a]), p || L ? /* @__PURE__ */ n(D, { height: "100vh", onTryAgain: a }) : w ? /* @__PURE__ */ n(A, { height: "100vh" }) : /* @__PURE__ */ I(P, { children: [
62
- !v && /* @__PURE__ */ n(A, { height: "100vh" }),
63
- g && /* @__PURE__ */ n(
64
- V,
40
+ return _(() => {
41
+ i();
42
+ }, [i]), R || A ? /* @__PURE__ */ n(b, { height: "100vh", onTryAgain: i }) : w ? /* @__PURE__ */ n(g, { height: "100vh" }) : /* @__PURE__ */ y(I, { children: [
43
+ !p && /* @__PURE__ */ n(g, { height: "100vh" }),
44
+ k && /* @__PURE__ */ n(
45
+ D,
65
46
  {
66
- ...d,
67
- worksheet: g,
68
- onWorksheetLoaded: b,
69
- onWorksheetErrored: T
47
+ ...c,
48
+ worksheet: k,
49
+ onWorksheetLoaded: W,
50
+ onWorksheetErrored: L
70
51
  }
71
52
  )
72
53
  ] });
73
- }), F = x;
54
+ }), F = N;
74
55
  export {
75
56
  F as default
76
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-preview.js","sources":["../../../../src/features/worksheet/worksheet-preview/worksheet-preview.tsx"],"sourcesContent":["import type { IPreviewWorksheetProps } from './worksheet-preview-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useState } from 'react';\n\nimport Error from '../../ui/error/error';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport { usePreviewWorksheetGet } from './api/get-preview-worksheet';\nimport PreviewWorksheetView from './worksheet-preview-view';\n\nconst PreviewWorksheet: FC<IPreviewWorksheetProps> = memo(props => {\n const {\n activityReference,\n nodeType,\n action,\n isLessonV3Enabled,\n items,\n scribblingEnabled,\n onWorksheetLoaded,\n } = props;\n const isDiagnosticWorksheet = useMemo(() => {\n switch (nodeType) {\n case 'TRIAL_BASIC':\n case 'TRIAL_INTERMEDIATE':\n case 'TRIAL_ADVANCED':\n return true;\n }\n }, [nodeType]);\n const isPuzzleWorksheet = useMemo(() => nodeType === 'PUZZLE_CARD', [nodeType]);\n\n const [error, setError] = useState<string>();\n const [worksheetRendered, setWorksheetRendered] = useState<boolean>(false);\n const { isProcessing, get, data: worksheetData, error: fetchError } = usePreviewWorksheetGet();\n\n const worksheet = useMemo<typeof worksheetData>(() => {\n if (worksheetData) {\n return {\n ...worksheetData,\n player_config: {\n ...worksheetData.player_config,\n retryButtonLabel: 'Retry',\n checkButtonLabel: 'Check',\n ...(action === 'review' && {\n navigationMode:\n isDiagnosticWorksheet || isPuzzleWorksheet\n ? 'CURRENT'\n : isLessonV3Enabled\n ? 'LINEAR'\n : 'OPEN',\n initialQuestion: 'FIRST',\n }),\n ...(isLessonV3Enabled && {\n teacherValidationEnabled: isLessonV3Enabled,\n }),\n ...(isPuzzleWorksheet &&\n scribblingEnabled && {\n teacherValidationEnabled: true,\n canUnAssign: true,\n }),\n },\n };\n }\n\n return worksheetData;\n }, [\n action,\n isDiagnosticWorksheet,\n isLessonV3Enabled,\n isPuzzleWorksheet,\n scribblingEnabled,\n worksheetData,\n ]);\n\n const fetchWorksheet = useCallback(() => {\n setError(undefined);\n get(activityReference, {\n action,\n node_type: nodeType,\n items,\n });\n }, [action, activityReference, get, nodeType, items]);\n\n const handleWorksheetLoaded = useCallback(() => {\n setWorksheetRendered(true);\n\n onWorksheetLoaded?.(true);\n }, [onWorksheetLoaded]);\n\n const handleWorksheetErrored = useCallback((err: { code?: number; message: string }) => {\n setError(err.message);\n }, []);\n\n useEffect(() => {\n fetchWorksheet();\n }, [fetchWorksheet]);\n\n if (error || fetchError) {\n return <Error height=\"100vh\" onTryAgain={fetchWorksheet} />;\n }\n\n if (isProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <>\n {!worksheetRendered && <AppLoader height=\"100vh\" />}\n {worksheet && (\n <PreviewWorksheetView\n {...props}\n worksheet={worksheet}\n onWorksheetLoaded={handleWorksheetLoaded}\n onWorksheetErrored={handleWorksheetErrored}\n />\n )}\n </>\n );\n});\n\nexport default PreviewWorksheet;\n"],"names":["PreviewWorksheet","memo","props","activityReference","nodeType","action","isLessonV3Enabled","items","scribblingEnabled","onWorksheetLoaded","isDiagnosticWorksheet","useMemo","isPuzzleWorksheet","error","setError","useState","worksheetRendered","setWorksheetRendered","isProcessing","get","worksheetData","fetchError","usePreviewWorksheetGet","worksheet","fetchWorksheet","useCallback","handleWorksheetLoaded","handleWorksheetErrored","err","useEffect","jsx","Error","AppLoader","jsxs","Fragment","PreviewWorksheetView","PreviewWorksheet$1"],"mappings":";;;;;;AAUA,MAAMA,IAA+CC,EAAK,CAASC,MAAA;AAC3D,QAAA;AAAA,IACJ,mBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,EACE,IAAAP,GACEQ,IAAwBC,EAAQ,MAAM;AAC1C,YAAQP,GAAU;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACI,eAAA;AAAA,IACX;AAAA,EAAA,GACC,CAACA,CAAQ,CAAC,GACPQ,IAAoBD,EAAQ,MAAMP,MAAa,eAAe,CAACA,CAAQ,CAAC,GAExE,CAACS,GAAOC,CAAQ,IAAIC,EAAiB,GACrC,CAACC,GAAmBC,CAAoB,IAAIF,EAAkB,EAAK,GACnE,EAAE,cAAAG,GAAc,KAAAC,GAAK,MAAMC,GAAe,OAAOC,MAAeC,KAEhEC,IAAYZ,EAA8B,MAC1CS,KACK;AAAA,IACL,GAAGA;AAAA,IACH,eAAe;AAAA,MACb,GAAGA,EAAc;AAAA,MACjB,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB,GAAIf,MAAW,YAAY;AAAA,QACzB,gBACEK,KAAyBE,IACrB,YACAN,IACE,WACA;AAAA,QACR,iBAAiB;AAAA,MACnB;AAAA,MACA,GAAIA,KAAqB;AAAA,QACvB,0BAA0BA;AAAA,MAC5B;AAAA,MACA,GAAIM,KACFJ,KAAqB;AAAA,QACnB,0BAA0B;AAAA,QAC1B,aAAa;AAAA,MACf;AAAA,IACJ;AAAA,EAAA,GAKH;AAAA,IACDH;AAAA,IACAK;AAAA,IACAJ;AAAA,IACAM;AAAA,IACAJ;AAAA,IACAY;AAAA,EAAA,CACD,GAEKI,IAAiBC,EAAY,MAAM;AACvC,IAAAX,EAAS,MAAS,GAClBK,EAAIhB,GAAmB;AAAA,MACrB,QAAAE;AAAA,MACA,WAAWD;AAAA,MACX,OAAAG;AAAA,IAAA,CACD;AAAA,EAAA,GACA,CAACF,GAAQF,GAAmBgB,GAAKf,GAAUG,CAAK,CAAC,GAE9CmB,IAAwBD,EAAY,MAAM;AAC9C,IAAAR,EAAqB,EAAI,GAEzBR,KAAA,QAAAA,EAAoB;AAAA,EAAI,GACvB,CAACA,CAAiB,CAAC,GAEhBkB,IAAyBF,EAAY,CAACG,MAA4C;AACtF,IAAAd,EAASc,EAAI,OAAO;AAAA,EACtB,GAAG,CAAE,CAAA;AAML,SAJAC,EAAU,MAAM;AACC,IAAAL;EAAA,GACd,CAACA,CAAc,CAAC,GAEfX,KAASQ,IACH,gBAAAS,EAAAC,GAAA,EAAM,QAAO,SAAQ,YAAYP,EAAgB,CAAA,IAGvDN,IACK,gBAAAY,EAACE,GAAU,EAAA,QAAO,QAAQ,CAAA,IAK9B,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,CAAClB,KAAqB,gBAAAc,EAACE,GAAU,EAAA,QAAO,QAAQ,CAAA;AAAA,IAChDT,KACC,gBAAAO;AAAA,MAACK;AAAA,MAAA;AAAA,QACE,GAAGjC;AAAA,QACJ,WAAAqB;AAAA,QACA,mBAAmBG;AAAA,QACnB,oBAAoBC;AAAA,MAAA;AAAA,IACtB;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC,GAEDS,IAAepC;"}
1
+ {"version":3,"file":"worksheet-preview.js","sources":["../../../../src/features/worksheet/worksheet-preview/worksheet-preview.tsx"],"sourcesContent":["import type { IPreviewWorksheetProps } from './worksheet-preview-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useState } from 'react';\n\nimport Error from '../../ui/error/error';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport { usePreviewWorksheetGet } from './api/get-preview-worksheet';\nimport PreviewWorksheetView from './worksheet-preview-view';\n\nconst PreviewWorksheet: FC<IPreviewWorksheetProps> = memo(props => {\n const { activityReference, nodeType, action, isLessonV3Enabled, items, onWorksheetLoaded } =\n props;\n const isDiagnosticWorksheet = useMemo(() => {\n switch (nodeType) {\n case 'TRIAL_BASIC':\n case 'TRIAL_INTERMEDIATE':\n case 'TRIAL_ADVANCED':\n return true;\n }\n }, [nodeType]);\n const [error, setError] = useState<string>();\n const [worksheetRendered, setWorksheetRendered] = useState<boolean>(false);\n const { isProcessing, get, data: worksheetData, error: fetchError } = usePreviewWorksheetGet();\n\n const worksheet = useMemo<typeof worksheetData>(() => {\n if (worksheetData) {\n return {\n ...worksheetData,\n player_config: {\n ...worksheetData.player_config,\n retryButtonLabel: 'Retry',\n checkButtonLabel: 'Check',\n ...(action === 'review' && {\n navigationMode: isDiagnosticWorksheet\n ? 'CURRENT'\n : isLessonV3Enabled\n ? 'LINEAR'\n : 'OPEN',\n initialQuestion: 'FIRST',\n }),\n ...(isLessonV3Enabled && {\n teacherValidationEnabled: isLessonV3Enabled,\n }),\n },\n };\n }\n\n return worksheetData;\n }, [action, isDiagnosticWorksheet, isLessonV3Enabled, worksheetData]);\n\n const fetchWorksheet = useCallback(() => {\n setError(undefined);\n get(activityReference, {\n action,\n node_type: nodeType,\n items,\n });\n }, [action, activityReference, get, nodeType, items]);\n\n const handleWorksheetLoaded = useCallback(() => {\n setWorksheetRendered(true);\n\n onWorksheetLoaded?.(true);\n }, [onWorksheetLoaded]);\n\n const handleWorksheetErrored = useCallback((err: { code?: number; message: string }) => {\n setError(err.message);\n }, []);\n\n useEffect(() => {\n fetchWorksheet();\n }, [fetchWorksheet]);\n\n if (error || fetchError) {\n return <Error height=\"100vh\" onTryAgain={fetchWorksheet} />;\n }\n\n if (isProcessing) {\n return <AppLoader height=\"100vh\" />;\n }\n\n return (\n <>\n {!worksheetRendered && <AppLoader height=\"100vh\" />}\n {worksheet && (\n <PreviewWorksheetView\n {...props}\n worksheet={worksheet}\n onWorksheetLoaded={handleWorksheetLoaded}\n onWorksheetErrored={handleWorksheetErrored}\n />\n )}\n </>\n );\n});\n\nexport default PreviewWorksheet;\n"],"names":["PreviewWorksheet","memo","props","activityReference","nodeType","action","isLessonV3Enabled","items","onWorksheetLoaded","isDiagnosticWorksheet","useMemo","error","setError","useState","worksheetRendered","setWorksheetRendered","isProcessing","get","worksheetData","fetchError","usePreviewWorksheetGet","worksheet","fetchWorksheet","useCallback","handleWorksheetLoaded","handleWorksheetErrored","err","useEffect","jsx","Error","AppLoader","jsxs","Fragment","PreviewWorksheetView","PreviewWorksheet$1"],"mappings":";;;;;;AAUA,MAAMA,IAA+CC,EAAK,CAASC,MAAA;AACjE,QAAM,EAAE,mBAAAC,GAAmB,UAAAC,GAAU,QAAAC,GAAQ,mBAAAC,GAAmB,OAAAC,GAAO,mBAAAC,EACrE,IAAAN,GACIO,IAAwBC,EAAQ,MAAM;AAC1C,YAAQN,GAAU;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACI,eAAA;AAAA,IACX;AAAA,EAAA,GACC,CAACA,CAAQ,CAAC,GACP,CAACO,GAAOC,CAAQ,IAAIC,EAAiB,GACrC,CAACC,GAAmBC,CAAoB,IAAIF,EAAkB,EAAK,GACnE,EAAE,cAAAG,GAAc,KAAAC,GAAK,MAAMC,GAAe,OAAOC,MAAeC,KAEhEC,IAAYX,EAA8B,MAC1CQ,KACK;AAAA,IACL,GAAGA;AAAA,IACH,eAAe;AAAA,MACb,GAAGA,EAAc;AAAA,MACjB,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB,GAAIb,MAAW,YAAY;AAAA,QACzB,gBAAgBI,IACZ,YACAH,IACE,WACA;AAAA,QACN,iBAAiB;AAAA,MACnB;AAAA,MACA,GAAIA,KAAqB;AAAA,QACvB,0BAA0BA;AAAA,MAC5B;AAAA,IACF;AAAA,EAAA,GAKH,CAACD,GAAQI,GAAuBH,GAAmBY,CAAa,CAAC,GAE9DI,IAAiBC,EAAY,MAAM;AACvC,IAAAX,EAAS,MAAS,GAClBK,EAAId,GAAmB;AAAA,MACrB,QAAAE;AAAA,MACA,WAAWD;AAAA,MACX,OAAAG;AAAA,IAAA,CACD;AAAA,EAAA,GACA,CAACF,GAAQF,GAAmBc,GAAKb,GAAUG,CAAK,CAAC,GAE9CiB,IAAwBD,EAAY,MAAM;AAC9C,IAAAR,EAAqB,EAAI,GAEzBP,KAAA,QAAAA,EAAoB;AAAA,EAAI,GACvB,CAACA,CAAiB,CAAC,GAEhBiB,IAAyBF,EAAY,CAACG,MAA4C;AACtF,IAAAd,EAASc,EAAI,OAAO;AAAA,EACtB,GAAG,CAAE,CAAA;AAML,SAJAC,EAAU,MAAM;AACC,IAAAL;EAAA,GACd,CAACA,CAAc,CAAC,GAEfX,KAASQ,IACH,gBAAAS,EAAAC,GAAA,EAAM,QAAO,SAAQ,YAAYP,EAAgB,CAAA,IAGvDN,IACK,gBAAAY,EAACE,GAAU,EAAA,QAAO,QAAQ,CAAA,IAK9B,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,CAAClB,KAAqB,gBAAAc,EAACE,GAAU,EAAA,QAAO,QAAQ,CAAA;AAAA,IAChDT,KACC,gBAAAO;AAAA,MAACK;AAAA,MAAA;AAAA,QACE,GAAG/B;AAAA,QACJ,WAAAmB;AAAA,QACA,mBAAmBG;AAAA,QACnB,oBAAoBC;AAAA,MAAA;AAAA,IACtB;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC,GAEDS,IAAelC;"}
package/dist/index.d.ts CHANGED
@@ -510,11 +510,11 @@ declare const getCheckboxConfig: IGetCheckboxConfig;
510
510
 
511
511
  declare function getColors(): TColorsMap;
512
512
 
513
- declare const getDeviceConfig: () => TSupportedDevices;
513
+ declare const getDevice: (width: number) => TDeviceType;
514
514
 
515
515
  declare const getInputConfig: IGetInputConfig;
516
516
 
517
- declare function getLayout(multiplier?: number): ILayout;
517
+ declare function getLayout(): ILayout;
518
518
 
519
519
  declare const getTabConfig: IGetTabConfig;
520
520
 
@@ -1686,6 +1686,8 @@ declare interface IJourneyProviderProps {
1686
1686
 
1687
1687
  export declare interface ILayout {
1688
1688
  gutter: number;
1689
+ deviceWidth: number;
1690
+ deviceHeight: number;
1689
1691
  }
1690
1692
 
1691
1693
  export declare interface ILeaderboardDetails {
@@ -2729,12 +2731,10 @@ declare interface IPreviewWorksheetProps {
2729
2731
  userType: TUserTypes;
2730
2732
  showNudgeBanner?: boolean;
2731
2733
  markedAsCompleted?: boolean;
2732
- imageHue?: THueNames;
2733
2734
  openQuestionFeedbackModal?: (itemRef: string) => void;
2734
2735
  onBackIconClick?: () => void;
2735
2736
  items?: string[];
2736
2737
  onWorksheetLoaded?: (loaded: boolean) => void;
2737
- onUnassign?: () => void;
2738
2738
  }
2739
2739
 
2740
2740
  export declare interface IProject<T> {
@@ -3473,7 +3473,7 @@ export declare interface ITheme {
3473
3473
  textButton: ReturnType<typeof getTextButtonConfig>;
3474
3474
  zIndex: ReturnType<typeof getZIndexConfig>;
3475
3475
  checkbox: ReturnType<typeof getCheckboxConfig>;
3476
- device: ReturnType<typeof getDeviceConfig>;
3476
+ device: ReturnType<typeof getDevice>;
3477
3477
  }
3478
3478
 
3479
3479
  declare interface ITile {
@@ -3759,7 +3759,6 @@ declare interface IUseWorksheetLayout {
3759
3759
  isSATAssessment: boolean;
3760
3760
  showNudgeBanner?: boolean;
3761
3761
  topOffset: number;
3762
- imageHue?: THueNames;
3763
3762
  }): IWorksheetProps['layout'];
3764
3763
  }
3765
3764
 
@@ -3935,14 +3934,6 @@ export declare interface IWorksheetBehavior {
3935
3934
  * If true show demos calculator https://www.desmos.com/calculator
3936
3935
  */
3937
3936
  canShowDesmosCalc: boolean;
3938
- /**
3939
- * If true, the user can unassign the sheet.
3940
- */
3941
- canUnAssign?: boolean;
3942
- /**
3943
- * If true, cta specific to puzzles will be shown
3944
- */
3945
- showPuzzleCta?: boolean;
3946
3937
  }
3947
3938
 
3948
3939
  declare interface IWorksheetCallbackProps {
@@ -3966,7 +3957,6 @@ declare interface IWorksheetCallbackProps {
3966
3957
  onExitTicketStart?: () => void;
3967
3958
  onExitTicketSubmit?: () => void;
3968
3959
  onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;
3969
- onUnassign?: () => void;
3970
3960
  loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;
3971
3961
  }
3972
3962
 
@@ -3998,10 +3988,6 @@ declare interface IWorksheetLayout {
3998
3988
  minSummaryHeight: string | number;
3999
3989
  renderSideBar: boolean;
4000
3990
  showUserPointer?: boolean;
4001
- renderQuestionHeader?: boolean;
4002
- renderSheetHeader?: boolean;
4003
- imageHue?: THueNames;
4004
- renderQuestionFeedback?: boolean;
4005
3991
  }
4006
3992
 
4007
3993
  export declare interface IWorksheetModel {
@@ -4237,11 +4223,6 @@ export declare const Maintenance: React_2.FC<IMaintenanceProps>;
4237
4223
 
4238
4224
  declare const MASTERY: "mastery";
4239
4225
 
4240
- export declare const media: {
4241
- minDesktop: string;
4242
- minLarge: string;
4243
- };
4244
-
4245
4226
  export declare const MilestoneActionWidget: React_2.FC<IMilestoneActionWidgetProps>;
4246
4227
 
4247
4228
  export declare const MilestoneCreate: React.FC<IMileStoneCreateContainerProps>;
@@ -4953,6 +4934,8 @@ declare type TCueProgramData = {
4953
4934
 
4954
4935
  declare type TDefaultSection = Record<string, unknown>;
4955
4936
 
4937
+ export declare type TDeviceType = 'mobile' | 'tablet' | 'small-desktop' | 'desktop' | 'large-device' | 'xlarge-device';
4938
+
4956
4939
  declare type TDrawingData = ITile | IStroke | undefined;
4957
4940
 
4958
4941
  declare type TEnglishSectionSummary = {
@@ -5766,8 +5749,6 @@ declare type TSubscribe = (id: string, cb: (data: IActionData | IActionData[]) =
5766
5749
 
5767
5750
  declare type TSubscribeMouseMove = (id: string, callback: (data: IPointerData) => void) => void;
5768
5751
 
5769
- export declare type TSupportedDevices = 'mobile' | 'desktop';
5770
-
5771
5752
  export declare type TTableMode = 'random' | 'sequence' | 'advance' | 'infinite';
5772
5753
 
5773
5754
  export declare type TTabSizes = 'xsmall' | 'small' | 'regular' | 'medium';
package/dist/index.js CHANGED
@@ -265,21 +265,20 @@ import { WORKSHEET_V3_NODE_TYPES as eu } from "./features/sheets/utils/is-v3-wor
265
265
  import { COMPLETED_SHEET_STATE as ru, NODE_LABELS as tu, NODE_SUB_GROUP as au, NODE_TYPE as fu, PYTHON_NODE_TYPES as su, REWARDS_LIST as lu, SHEET_ACTIONS as pu, SHEET_ATTEMPT_LOCATION as uu, SHEET_ATTEMPT_LOCATION_MAP as mu, SHEET_ATTEMPT_STATE as du, SHEET_DATA_TYPE as xu, SHEET_STATE as nu } from "./features/sheets/constants/sheet.js";
266
266
  import { default as iu } from "./features/student-details/student-details.js";
267
267
  import { default as Tu } from "./features/utils/load-script.js";
268
- import { media as Eu } from "./features/utils/media.js";
269
- import { ACTION_BAR_HEIGHT as Au, QUESTIONS_GAP as Pu, QUESTION_WIDTH as _u, TOP_NAVIGATION_HEIGHT as hu } from "./features/worksheet/worksheet/constants.js";
270
- import { isOkayTypeQuestion as Lu } from "./features/worksheet/worksheet/worksheet-helpers.js";
271
- import { default as ku } from "./features/worksheet/worksheet/worksheet-container.js";
272
- import { default as Ou } from "./features/worksheet/worksheet-preview/worksheet-preview.js";
273
- import { default as Du } from "./features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js";
274
- import { default as gu } from "./features/worksheet/worksheet/worksheet-permissions/sheet-locked.js";
275
- import { default as Uu } from "./features/worksheet/worksheet/worksheet-permissions/error.js";
276
- import { default as Bu } from "./features/worksheet/learnosity-preloader/learnosity-preloader.js";
277
- import { default as wu } from "./features/worksheet/learnosity-preloader/use-is-learnosity-loaded.js";
278
- import { default as Vu } from "./features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js";
279
- import { default as Yu } from "./features/hooks/use-viewport/use-viewport.js";
280
- import { default as Ju } from "./features/puzzles/puzzle-container/puzzle-container.js";
281
- import { invalidatePuzzleToAssign as Ku, useGetPuzzleToAssign as ju } from "./features/puzzles/api/puzzle-assign.js";
282
- import { COUNTRY_CODE_MAP as qu } from "./constants/country.js";
268
+ import { ACTION_BAR_HEIGHT as Eu, QUESTIONS_GAP as Cu, QUESTION_WIDTH as Au, TOP_NAVIGATION_HEIGHT as Pu } from "./features/worksheet/worksheet/constants.js";
269
+ import { isOkayTypeQuestion as hu } from "./features/worksheet/worksheet/worksheet-helpers.js";
270
+ import { default as Lu } from "./features/worksheet/worksheet/worksheet-container.js";
271
+ import { default as ku } from "./features/worksheet/worksheet-preview/worksheet-preview.js";
272
+ import { default as Ou } from "./features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js";
273
+ import { default as Du } from "./features/worksheet/worksheet/worksheet-permissions/sheet-locked.js";
274
+ import { default as gu } from "./features/worksheet/worksheet/worksheet-permissions/error.js";
275
+ import { default as Uu } from "./features/worksheet/learnosity-preloader/learnosity-preloader.js";
276
+ import { default as Bu } from "./features/worksheet/learnosity-preloader/use-is-learnosity-loaded.js";
277
+ import { default as wu } from "./features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js";
278
+ import { default as Vu } from "./features/hooks/use-viewport/use-viewport.js";
279
+ import { default as Yu } from "./features/puzzles/puzzle-container/puzzle-container.js";
280
+ import { invalidatePuzzleToAssign as Ju, useGetPuzzleToAssign as Qu } from "./features/puzzles/api/puzzle-assign.js";
281
+ import { COUNTRY_CODE_MAP as ju } from "./constants/country.js";
283
282
  export {
284
283
  Ip as ACHIEVEMENT_ACTIONS,
285
284
  nf as AUTH_TABS,
@@ -312,7 +311,7 @@ export {
312
311
  Cs as CIRCLE_ACTION_IDS,
313
312
  Ss as CIRCLE_ONBOARDING_ANALYTICS_STEPS,
314
313
  ru as COMPLETED_SHEET_STATE,
315
- qu as COUNTRY_CODE_MAP,
314
+ ju as COUNTRY_CODE_MAP,
316
315
  D as CalendarIcon,
317
316
  Zt as Callout,
318
317
  Pt as CascadingSelectInput,
@@ -358,7 +357,7 @@ export {
358
357
  ee as DownIcon,
359
358
  re as DraftIcon,
360
359
  ae as DragIcon,
361
- Du as DynamicPreviewWorksheet,
360
+ Ou as DynamicPreviewWorksheet,
362
361
  al as EClassTimeAlertLevel,
363
362
  es as ELeaderboardType,
364
363
  cp as EPResourceAssign,
@@ -409,7 +408,7 @@ export {
409
408
  Df as LPARChapter,
410
409
  gf as LPARMilestoneChapter,
411
410
  Ls as Leaderboard,
412
- Bu as LearnosityPreloader,
411
+ Uu as LearnosityPreloader,
413
412
  ge as LeftIcon,
414
413
  Be as Lock2Icon,
415
414
  we as Lock3Icon,
@@ -451,12 +450,12 @@ export {
451
450
  ro as PointerIcon,
452
451
  bp as PostGameStats,
453
452
  no as PracticeIcon,
454
- Ou as PreviewWorksheet,
453
+ ku as PreviewWorksheet,
455
454
  io as ProgressIcon,
456
455
  ps as ProjectOutcome,
457
456
  xs as ProjectType,
458
457
  Eo as Puzzle2Icon,
459
- Ju as PuzzleCard,
458
+ Yu as PuzzleCard,
460
459
  To as PuzzleIcon,
461
460
  Ao as QuestionIcon,
462
461
  _o as QuestionLetterIcon,
@@ -488,10 +487,10 @@ export {
488
487
  ct as SelectInput,
489
488
  kt as SelectionCards,
490
489
  ia as Separator,
491
- Uu as SheetError,
490
+ gu as SheetError,
492
491
  Go as SheetIcon,
493
492
  Zp as SheetList,
494
- gu as SheetLocked,
493
+ Du as SheetLocked,
495
494
  Gs as SignUp,
496
495
  ja as SignupMethods,
497
496
  cr as SketchIcon,
@@ -537,14 +536,14 @@ export {
537
536
  tf as UsernamePasswordForm,
538
537
  Ta as Video,
539
538
  Pf as WHITELIST_EVENTS,
540
- Au as WORKSHEET_ACTION_BAR_HEIGHT,
541
- Pu as WORKSHEET_QUESTIONS_GAP,
542
- _u as WORKSHEET_QUESTION_WIDTH,
543
- hu as WORKSHEET_TOP_NAVIGATION_HEIGHT,
539
+ Eu as WORKSHEET_ACTION_BAR_HEIGHT,
540
+ Cu as WORKSHEET_QUESTIONS_GAP,
541
+ Au as WORKSHEET_QUESTION_WIDTH,
542
+ Pu as WORKSHEET_TOP_NAVIGATION_HEIGHT,
544
543
  eu as WORKSHEET_V3_NODE_TYPES,
545
544
  ss as WebView,
546
545
  ms as WebViewEvent,
547
- ku as Worksheet,
546
+ Lu as Worksheet,
548
547
  Bf as checkIfPPTNodeType,
549
548
  fa as getTheme,
550
549
  Vf as invalidateGetChapterDetails,
@@ -552,11 +551,10 @@ export {
552
551
  kp as invalidateMilestoneResources,
553
552
  Ep as invalidateMilestonesData,
554
553
  Pp as invalidatePastMilestoneCount,
555
- Ku as invalidatePuzzleToAssign,
554
+ Ju as invalidatePuzzleToAssign,
556
555
  Rp as invalidateTestHelpData,
557
- Lu as isOkayTypeQuestion,
556
+ hu as isOkayTypeQuestion,
558
557
  Tu as loadScript,
559
- Eu as media,
560
558
  Il as useAutoPlayPermission,
561
559
  Ws as useCanvasSyncBroker,
562
560
  gl as useChapterPageJourney,
@@ -570,13 +568,13 @@ export {
570
568
  Xf as useGetLeaderboardDal,
571
569
  Np as useGetMilestoneResources,
572
570
  _p as useGetPastMilestoneCount,
573
- ju as useGetPuzzleToAssign,
571
+ Qu as useGetPuzzleToAssign,
574
572
  Lp as useGetTestHelpData,
575
573
  Dl as useHomePageJourney,
576
574
  $s as useInClassActionDispatcher,
577
575
  el as useInClassActionListener,
578
576
  Qs as useInClassMessageBroker,
579
- wu as useIsLearnosityLoaded,
577
+ Bu as useIsLearnosityLoaded,
580
578
  hf as useIsTabBlocked,
581
579
  Pl as useJourney,
582
580
  Bt as useModalActions,
@@ -585,8 +583,8 @@ export {
585
583
  oa as useTrackingContext,
586
584
  js as useTrialSessionMessageBroker,
587
585
  $t as useUIContext,
588
- Yu as useViewport,
589
- Vu as useWorksheetLayout,
586
+ Vu as useViewport,
587
+ wu as useWorksheetLayout,
590
588
  Ur as useZoomDisable
591
589
  };
592
590
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.1.44-beta-0.2",
3
+ "version": "3.1.44-hg2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"