@cuemath/leap 3.1.46-beta-0.2 → 3.1.46-beta-0.4
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,59 +1,62 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useGetDynamicSheetData as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
const { studentId:
|
|
11
|
-
get:
|
|
12
|
-
data:
|
|
13
|
-
isProcessing:
|
|
14
|
-
isProcessingFailed:
|
|
15
|
-
error:
|
|
16
|
-
} =
|
|
17
|
-
items:
|
|
18
|
-
title:
|
|
19
|
-
node_type:
|
|
20
|
-
worksheet:
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { jsx as i, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { memo as A, useCallback as d, useEffect as C } from "react";
|
|
3
|
+
import b from "../../../ui/buttons/button/button.js";
|
|
4
|
+
import x from "../../../ui/layout/flex-view.js";
|
|
5
|
+
import E from "../../../ui/loader/app-loader/app-loader.js";
|
|
6
|
+
import I from "../../../ui/text/text.js";
|
|
7
|
+
import { useGetDynamicSheetData as S } from "../api/get-dynamic-sheet.js";
|
|
8
|
+
import T from "../worksheet-preview.js";
|
|
9
|
+
const $ = A((h) => {
|
|
10
|
+
const { studentId: s, userNodeId: n, onBackIconClick: f, onUnassign: r } = h, {
|
|
11
|
+
get: m,
|
|
12
|
+
data: e,
|
|
13
|
+
isProcessing: u,
|
|
14
|
+
isProcessingFailed: g,
|
|
15
|
+
error: o
|
|
16
|
+
} = S(), {
|
|
17
|
+
items: p = [],
|
|
18
|
+
title: y,
|
|
19
|
+
node_type: c = "DYNAMIC",
|
|
20
|
+
worksheet: D
|
|
21
|
+
} = e || {}, { image_hue: w } = D || {}, l = p.map(({ ref: P }) => P), t = c === "PUZZLE_CARD", a = d(() => {
|
|
22
|
+
s && n && m(n);
|
|
23
|
+
}, [m, s, n]), k = d(() => {
|
|
24
|
+
e && t && r && r(e);
|
|
25
|
+
}, [e, t, r]);
|
|
26
|
+
return C(() => {
|
|
27
|
+
a();
|
|
28
|
+
}, [a]), u ? /* @__PURE__ */ i(E, { height: "100%" }) : g ? /* @__PURE__ */ v(x, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
|
|
29
|
+
/* @__PURE__ */ i(I, { $renderAs: "h6", children: (o == null ? void 0 : o.message) || "Oops! Something went wrong. Please try again later." }),
|
|
30
|
+
/* @__PURE__ */ i(
|
|
31
|
+
b,
|
|
30
32
|
{
|
|
31
33
|
widthX: 14,
|
|
32
34
|
size: "small",
|
|
33
35
|
shape: "square",
|
|
34
36
|
renderAs: "primary",
|
|
35
37
|
label: "Try again",
|
|
36
|
-
onClick:
|
|
38
|
+
onClick: a
|
|
37
39
|
}
|
|
38
40
|
)
|
|
39
|
-
] }) :
|
|
40
|
-
|
|
41
|
+
] }) : l ? /* @__PURE__ */ i(
|
|
42
|
+
T,
|
|
41
43
|
{
|
|
42
|
-
activityReference:
|
|
44
|
+
activityReference: t ? "puzzle" : "test",
|
|
43
45
|
action: "review",
|
|
44
|
-
nodeType:
|
|
46
|
+
nodeType: c,
|
|
45
47
|
userType: "TEACHER",
|
|
46
|
-
studentId:
|
|
48
|
+
studentId: s ?? "student-id",
|
|
47
49
|
isLessonV3Enabled: !1,
|
|
48
|
-
worksheetName:
|
|
49
|
-
scribblingEnabled:
|
|
50
|
-
items:
|
|
51
|
-
onBackIconClick:
|
|
52
|
-
imageHue:
|
|
50
|
+
worksheetName: y,
|
|
51
|
+
scribblingEnabled: t,
|
|
52
|
+
items: l,
|
|
53
|
+
onBackIconClick: f,
|
|
54
|
+
imageHue: w ?? void 0,
|
|
55
|
+
onUnassign: k
|
|
53
56
|
}
|
|
54
57
|
) : null;
|
|
55
|
-
}),
|
|
58
|
+
}), W = $;
|
|
56
59
|
export {
|
|
57
|
-
|
|
60
|
+
W as default
|
|
58
61
|
};
|
|
59
62
|
//# sourceMappingURL=dynamic-worksheet-preview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-worksheet-preview.js","sources":["../../../../../src/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.tsx"],"sourcesContent":["import type { TNodeTypes } from '../../../../types/models/worksheet';\nimport type { IDynamicWorksheetPreview } from './dynamic-worksheet-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Text from '../../../ui/text/text';\nimport { useGetDynamicSheetData } from '../api/get-dynamic-sheet';\nimport PreviewWorksheet from '../worksheet-preview';\n\nconst DynamicWorksheetPreview: FC<IDynamicWorksheetPreview> = memo(props => {\n const { studentId, userNodeId, onBackIconClick } = props;\n\n const {\n get: getDynamicSheetData,\n data: dynamicSheetData,\n isProcessing,\n isProcessingFailed,\n error,\n } = useGetDynamicSheetData();\n\n const {\n items: itemsToBeAssigned = [],\n title,\n node_type: nodeType = 'DYNAMIC',\n worksheet,\n } = dynamicSheetData || {};\n const { image_hue: imageHue } = worksheet || {};\n const itemRefs = itemsToBeAssigned.map(({ ref }) => ref);\n\n const isPuzzleSheet = nodeType === 'PUZZLE_CARD';\n\n const fetchDynamicSheetData = useCallback(() => {\n if (studentId && userNodeId) {\n getDynamicSheetData(userNodeId);\n }\n }, [getDynamicSheetData, studentId, userNodeId]);\n\n useEffect(() => {\n fetchDynamicSheetData();\n }, [fetchDynamicSheetData]);\n\n if (isProcessing) {\n return <AppLoader height=\"100%\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">\n {error?.message || 'Oops! Something went wrong. Please try again later.'}\n </Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchDynamicSheetData}\n />\n </FlexView>\n );\n }\n\n if (!itemRefs) {\n return null;\n }\n\n return (\n <PreviewWorksheet\n activityReference={isPuzzleSheet ? 'puzzle' : 'test'}\n action=\"review\"\n nodeType={nodeType as TNodeTypes}\n userType=\"TEACHER\"\n studentId={studentId ?? 'student-id'}\n isLessonV3Enabled={false}\n worksheetName={title}\n scribblingEnabled={isPuzzleSheet}\n items={itemRefs}\n onBackIconClick={onBackIconClick}\n imageHue={imageHue ?? undefined}\n />\n );\n});\n\nexport default DynamicWorksheetPreview;\n"],"names":["DynamicWorksheetPreview","memo","props","studentId","userNodeId","onBackIconClick","getDynamicSheetData","dynamicSheetData","isProcessing","isProcessingFailed","error","useGetDynamicSheetData","itemsToBeAssigned","title","nodeType","worksheet","imageHue","itemRefs","ref","isPuzzleSheet","fetchDynamicSheetData","useCallback","useEffect","jsx","AppLoader","jsxs","FlexView","Text","Button","PreviewWorksheet","DynamicWorksheetPreview$1"],"mappings":";;;;;;;;AAaA,MAAMA,IAAwDC,EAAK,CAASC,MAAA;AAC1E,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,iBAAAC,
|
|
1
|
+
{"version":3,"file":"dynamic-worksheet-preview.js","sources":["../../../../../src/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.tsx"],"sourcesContent":["import type { TNodeTypes } from '../../../../types/models/worksheet';\nimport type { IDynamicWorksheetPreview } from './dynamic-worksheet-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Text from '../../../ui/text/text';\nimport { useGetDynamicSheetData } from '../api/get-dynamic-sheet';\nimport PreviewWorksheet from '../worksheet-preview';\n\nconst DynamicWorksheetPreview: FC<IDynamicWorksheetPreview> = memo(props => {\n const { studentId, userNodeId, onBackIconClick, onUnassign } = props;\n\n const {\n get: getDynamicSheetData,\n data: dynamicSheetData,\n isProcessing,\n isProcessingFailed,\n error,\n } = useGetDynamicSheetData();\n\n const {\n items: itemsToBeAssigned = [],\n title,\n node_type: nodeType = 'DYNAMIC',\n worksheet,\n } = dynamicSheetData || {};\n const { image_hue: imageHue } = worksheet || {};\n const itemRefs = itemsToBeAssigned.map(({ ref }) => ref);\n\n const isPuzzleSheet = nodeType === 'PUZZLE_CARD';\n\n const fetchDynamicSheetData = useCallback(() => {\n if (studentId && userNodeId) {\n getDynamicSheetData(userNodeId);\n }\n }, [getDynamicSheetData, studentId, userNodeId]);\n\n const handleOnUnassign = useCallback(() => {\n if (dynamicSheetData && isPuzzleSheet && onUnassign) {\n onUnassign(dynamicSheetData);\n }\n }, [dynamicSheetData, isPuzzleSheet, onUnassign]);\n\n useEffect(() => {\n fetchDynamicSheetData();\n }, [fetchDynamicSheetData]);\n\n if (isProcessing) {\n return <AppLoader height=\"100%\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">\n {error?.message || 'Oops! Something went wrong. Please try again later.'}\n </Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchDynamicSheetData}\n />\n </FlexView>\n );\n }\n\n if (!itemRefs) {\n return null;\n }\n\n return (\n <PreviewWorksheet\n activityReference={isPuzzleSheet ? 'puzzle' : 'test'}\n action=\"review\"\n nodeType={nodeType as TNodeTypes}\n userType=\"TEACHER\"\n studentId={studentId ?? 'student-id'}\n isLessonV3Enabled={false}\n worksheetName={title}\n scribblingEnabled={isPuzzleSheet}\n items={itemRefs}\n onBackIconClick={onBackIconClick}\n imageHue={imageHue ?? undefined}\n onUnassign={handleOnUnassign}\n />\n );\n});\n\nexport default DynamicWorksheetPreview;\n"],"names":["DynamicWorksheetPreview","memo","props","studentId","userNodeId","onBackIconClick","onUnassign","getDynamicSheetData","dynamicSheetData","isProcessing","isProcessingFailed","error","useGetDynamicSheetData","itemsToBeAssigned","title","nodeType","worksheet","imageHue","itemRefs","ref","isPuzzleSheet","fetchDynamicSheetData","useCallback","handleOnUnassign","useEffect","jsx","AppLoader","jsxs","FlexView","Text","Button","PreviewWorksheet","DynamicWorksheetPreview$1"],"mappings":";;;;;;;;AAaA,MAAMA,IAAwDC,EAAK,CAASC,MAAA;AAC1E,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,iBAAAC,GAAiB,YAAAC,MAAeJ,GAEzD;AAAA,IACJ,KAAKK;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,OAAAC;AAAA,MACEC,EAAuB,GAErB;AAAA,IACJ,OAAOC,IAAoB,CAAC;AAAA,IAC5B,OAAAC;AAAA,IACA,WAAWC,IAAW;AAAA,IACtB,WAAAC;AAAA,EAAA,IACER,KAAoB,CAAA,GAClB,EAAE,WAAWS,MAAaD,KAAa,CAAA,GACvCE,IAAWL,EAAkB,IAAI,CAAC,EAAE,KAAAM,EAAA,MAAUA,CAAG,GAEjDC,IAAgBL,MAAa,eAE7BM,IAAwBC,EAAY,MAAM;AAC9C,IAAInB,KAAaC,KACfG,EAAoBH,CAAU;AAAA,EAE/B,GAAA,CAACG,GAAqBJ,GAAWC,CAAU,CAAC,GAEzCmB,IAAmBD,EAAY,MAAM;AACrC,IAAAd,KAAoBY,KAAiBd,KACvCA,EAAWE,CAAgB;AAAA,EAE5B,GAAA,CAACA,GAAkBY,GAAed,CAAU,CAAC;AAMhD,SAJAkB,EAAU,MAAM;AACQ,IAAAH;EAAA,GACrB,CAACA,CAAqB,CAAC,GAEtBZ,IACK,gBAAAgB,EAACC,GAAU,EAAA,QAAO,OAAO,CAAA,IAG9BhB,IAEA,gBAAAiB,EAACC,KAAS,WAAW,KAAK,SAAQ,SAAQ,iBAAgB,UAAS,aAAY,UAC7E,UAAA;AAAA,IAAA,gBAAAH,EAACI,GAAK,EAAA,WAAU,MACb,WAAAlB,KAAA,gBAAAA,EAAO,YAAW,uDACrB;AAAA,IACA,gBAAAc;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,QAAQ;AAAA,QACR,MAAK;AAAA,QACL,OAAM;AAAA,QACN,UAAS;AAAA,QACT,OAAM;AAAA,QACN,SAAST;AAAA,MAAA;AAAA,IACX;AAAA,EACF,EAAA,CAAA,IAICH,IAKH,gBAAAO;AAAA,IAACM;AAAA,IAAA;AAAA,MACC,mBAAmBX,IAAgB,WAAW;AAAA,MAC9C,QAAO;AAAA,MACP,UAAAL;AAAA,MACA,UAAS;AAAA,MACT,WAAWZ,KAAa;AAAA,MACxB,mBAAmB;AAAA,MACnB,eAAeW;AAAA,MACf,mBAAmBM;AAAA,MACnB,OAAOF;AAAA,MACP,iBAAAb;AAAA,MACA,UAAUY,KAAY;AAAA,MACtB,YAAYM;AAAA,IAAA;AAAA,EAAA,IAhBP;AAmBX,CAAC,GAEDS,IAAehC;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1307,6 +1307,7 @@ declare interface IDynamicWorksheetPreview {
|
|
|
1307
1307
|
studentId: string;
|
|
1308
1308
|
userNodeId: string;
|
|
1309
1309
|
onBackIconClick: () => void;
|
|
1310
|
+
onUnassign?: (sheetData: INodeDataProps) => void;
|
|
1310
1311
|
}
|
|
1311
1312
|
|
|
1312
1313
|
declare interface IEditMilestoneModalProps extends IMilestoneEditProps {
|
|
@@ -2954,6 +2955,7 @@ export declare interface IReviewWorksheetModel {
|
|
|
2954
2955
|
mastery_summary: Record<string, unknown>;
|
|
2955
2956
|
title?: string;
|
|
2956
2957
|
worksheet_id?: string;
|
|
2958
|
+
node_type: TNodeTypes;
|
|
2957
2959
|
}
|
|
2958
2960
|
|
|
2959
2961
|
declare interface ISATSheetItemCallbacks {
|
|
@@ -3837,6 +3839,7 @@ export declare interface IWorksheetAttemptModel {
|
|
|
3837
3839
|
due_date: number | null;
|
|
3838
3840
|
state: TLPARSheetAttemptState;
|
|
3839
3841
|
canvas_data?: Array<IChannelMessage>;
|
|
3842
|
+
image_hue?: THueNames | null;
|
|
3840
3843
|
}
|
|
3841
3844
|
|
|
3842
3845
|
export declare interface IWorksheetBehavior {
|