@cuemath/leap 2.9.8-as5 → 2.9.8-as7

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,22 +1,29 @@
1
1
  import { ILLUSTRATIONS as e } from "../../../assets/illustrations/illustrations.js";
2
- const _ = (t) => {
3
- if (!t) return 0;
4
- const { mandatory: E } = t, { completed: n, total: r } = E;
5
- return r === 0 ? 0 : Math.floor(n / r * 100);
6
- }, o = (t) => {
7
- switch (t) {
2
+ const s = (E) => {
3
+ if (!E) return 0;
4
+ const { mandatory: r } = E, { completed: c, total: t } = r;
5
+ return t === 0 ? 0 : Math.floor(c / t * 100);
6
+ }, _ = (E) => {
7
+ switch (E) {
8
8
  case "LEARNING":
9
+ case "LEVEL2":
10
+ case "LEVEL3":
9
11
  return e.NODE_LEARN_BG;
10
12
  case "RECAP":
13
+ case "REMEDIAL":
14
+ case "REVISION":
11
15
  return e.NODE_RECAP_BG;
12
- case "ASSESSMENT":
13
16
  case "DYNAMIC":
17
+ case "ASSESSMENT":
18
+ case "CHAPTER_ASSESSMENT":
19
+ case "DIAGNOSTIC":
14
20
  return e.NODE_CUSTOM_TEST_BG;
15
21
  case "PRACTICE":
16
22
  case "EXTRA_PRACTICE":
17
23
  case "TARGET_PRACTICE":
18
24
  case "MASTERY":
19
25
  return e.NODE_PRACTICE_BG;
26
+ case "PUZZLE":
20
27
  case "PUZZLE_EASY":
21
28
  case "PUZZLE_MEDIUM":
22
29
  case "PUZZLE_HARD":
@@ -26,13 +33,13 @@ const _ = (t) => {
26
33
  default:
27
34
  return e.NODE_CUSTOM_TEST_BG;
28
35
  }
29
- }, T = (t, E, n, r) => {
30
- if (!(t || !r))
31
- return n ? `${r}` : `(${E})`;
36
+ }, T = (E, r, c, t) => {
37
+ if (!(E || !t))
38
+ return c ? `${t}` : `(${r})`;
32
39
  };
33
40
  export {
34
- _ as getChapterCompletionPercentage,
35
- o as getNodeTypeBasedBgImage,
41
+ s as getChapterCompletionPercentage,
42
+ _ as getNodeTypeBasedBgImage,
36
43
  T as getSheetNLessonCount
37
44
  };
38
45
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/features/chapters-v2/utils/index.ts"],"sourcesContent":["import type { IChapterProgressStats } from '../chapter-details/chapter-details-types';\nimport type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\n// This function calculates the completion percentage of a chapter based on progress stats.\n// If no progress stats are provided, it returns 0.\n// It uses the `mandatory` field from the progress stats to determine the completed and total items.\n// It returns an integer representing the percentage of completion, rounded down to the nearest whole number.\nconst getChapterCompletionPercentage = (progressStats: IChapterProgressStats | null) => {\n if (!progressStats) return 0;\n\n const { mandatory } = progressStats;\n const { completed, total } = mandatory;\n\n if (total === 0) {\n return 0;\n }\n\n const percentage = Math.floor((completed / total) * 100);\n\n return percentage;\n};\n\nconst getNodeTypeBasedBgImage = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEARNING':\n return ILLUSTRATIONS.NODE_LEARN_BG;\n case 'RECAP':\n return ILLUSTRATIONS.NODE_RECAP_BG;\n\n case 'ASSESSMENT':\n case 'DYNAMIC':\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return ILLUSTRATIONS.NODE_PRACTICE_BG;\n\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return ILLUSTRATIONS.NODE_PUZZLE_BG;\n\n case 'VIDEO':\n return ILLUSTRATIONS.NODE_VIDEO_BG;\n\n default:\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n }\n};\n\nconst getSheetNLessonCount = (\n isSkipped: boolean,\n sheetsLength: number,\n isGoalBlock?: boolean,\n lessonIdx?: number,\n) => {\n if (isSkipped || !lessonIdx) return undefined;\n\n if (!isGoalBlock) return `(${sheetsLength})`;\n\n return `${lessonIdx}`;\n};\n\nexport { getChapterCompletionPercentage, getNodeTypeBasedBgImage, getSheetNLessonCount };\n"],"names":["getChapterCompletionPercentage","progressStats","mandatory","completed","total","getNodeTypeBasedBgImage","nodeType","ILLUSTRATIONS","getSheetNLessonCount","isSkipped","sheetsLength","isGoalBlock","lessonIdx"],"mappings":";AASM,MAAAA,IAAiC,CAACC,MAAgD;AAClF,MAAA,CAACA,EAAsB,QAAA;AAErB,QAAA,EAAE,WAAAC,EAAc,IAAAD,GAChB,EAAE,WAAAE,GAAW,OAAAC,EAAU,IAAAF;AAE7B,SAAIE,MAAU,IACL,IAGU,KAAK,MAAOD,IAAYC,IAAS,GAAG;AAGzD,GAEMC,IAA0B,CAACC,MAA0C;AACzE,UAAQA,GAAU;AAAA,IAChB,KAAK;AACH,aAAOC,EAAc;AAAA,IACvB,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB;AACE,aAAOA,EAAc;AAAA,EACzB;AACF,GAEMC,IAAuB,CAC3BC,GACAC,GACAC,GACAC,MACG;AACC,MAAA,EAAAH,KAAa,CAACG;AAElB,WAAKD,IAEE,GAAGC,CAAS,KAFM,IAAIF,CAAY;AAG3C;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/features/chapters-v2/utils/index.ts"],"sourcesContent":["import type { IChapterProgressStats } from '../chapter-details/chapter-details-types';\nimport type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\n// This function calculates the completion percentage of a chapter based on progress stats.\n// If no progress stats are provided, it returns 0.\n// It uses the `mandatory` field from the progress stats to determine the completed and total items.\n// It returns an integer representing the percentage of completion, rounded down to the nearest whole number.\nconst getChapterCompletionPercentage = (progressStats: IChapterProgressStats | null) => {\n if (!progressStats) return 0;\n\n const { mandatory } = progressStats;\n const { completed, total } = mandatory;\n\n if (total === 0) {\n return 0;\n }\n\n const percentage = Math.floor((completed / total) * 100);\n\n return percentage;\n};\n\nconst getNodeTypeBasedBgImage = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEARNING':\n case 'LEVEL2':\n case 'LEVEL3':\n return ILLUSTRATIONS.NODE_LEARN_BG;\n case 'RECAP':\n case 'REMEDIAL':\n case 'REVISION':\n return ILLUSTRATIONS.NODE_RECAP_BG;\n\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n case 'DIAGNOSTIC':\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return ILLUSTRATIONS.NODE_PRACTICE_BG;\n\n case 'PUZZLE':\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return ILLUSTRATIONS.NODE_PUZZLE_BG;\n\n case 'VIDEO':\n return ILLUSTRATIONS.NODE_VIDEO_BG;\n\n default:\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n }\n};\n\nconst getSheetNLessonCount = (\n isSkipped: boolean,\n sheetsLength: number,\n isGoalBlock?: boolean,\n lessonIdx?: number,\n) => {\n if (isSkipped || !lessonIdx) return undefined;\n\n if (!isGoalBlock) return `(${sheetsLength})`;\n\n return `${lessonIdx}`;\n};\n\nexport { getChapterCompletionPercentage, getNodeTypeBasedBgImage, getSheetNLessonCount };\n"],"names":["getChapterCompletionPercentage","progressStats","mandatory","completed","total","getNodeTypeBasedBgImage","nodeType","ILLUSTRATIONS","getSheetNLessonCount","isSkipped","sheetsLength","isGoalBlock","lessonIdx"],"mappings":";AASM,MAAAA,IAAiC,CAACC,MAAgD;AAClF,MAAA,CAACA,EAAsB,QAAA;AAErB,QAAA,EAAE,WAAAC,EAAc,IAAAD,GAChB,EAAE,WAAAE,GAAW,OAAAC,EAAU,IAAAF;AAE7B,SAAIE,MAAU,IACL,IAGU,KAAK,MAAOD,IAAYC,IAAS,GAAG;AAGzD,GAEMC,IAA0B,CAACC,MAA0C;AACzE,UAAQA,GAAU;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOC,EAAc;AAAA,IACvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB;AACE,aAAOA,EAAc;AAAA,EACzB;AACF,GAEMC,IAAuB,CAC3BC,GACAC,GACAC,GACAC,MACG;AACC,MAAA,EAAAH,KAAa,CAACG;AAElB,WAAKD,IAEE,GAAGC,CAAS,KAFM,IAAIF,CAAY;AAG3C;"}
@@ -14,7 +14,7 @@ const A = 60 * 60 * 24, h = ["NOT_STARTED", "IN_PROGRESS"], $ = (t) => {
14
14
  return { isOverdue: !1, daysText: "", differenceInDays: 0 };
15
15
  const i = Math.floor(Date.now() / 1e3), c = t - i, n = Math.ceil(c / A), s = n < 0, r = n > 0 ? `${Math.abs(n)}D` : "";
16
16
  return { isOverdue: s, daysText: r, differenceInDays: n };
17
- }, L = (t, i, c, n) => {
17
+ }, y = (t, i, c, n) => {
18
18
  const { isOverdue: s, daysText: r, differenceInDays: E } = $(n);
19
19
  if (s && h.includes(t))
20
20
  return {
@@ -120,6 +120,8 @@ const A = 60 * 60 * 24, h = ["NOT_STARTED", "IN_PROGRESS"], $ = (t) => {
120
120
  }, w = (t) => {
121
121
  switch (t) {
122
122
  case "LEARNING":
123
+ case "LEVEL2":
124
+ case "LEVEL3":
123
125
  return {
124
126
  lottie: o.LEARN
125
127
  };
@@ -143,6 +145,7 @@ const A = 60 * 60 * 24, h = ["NOT_STARTED", "IN_PROGRESS"], $ = (t) => {
143
145
  return {
144
146
  lottie: o.PRACTICE
145
147
  };
148
+ case "PUZZLE":
146
149
  case "PUZZLE_EASY":
147
150
  case "PUZZLE_MEDIUM":
148
151
  case "PUZZLE_HARD":
@@ -161,6 +164,6 @@ const A = 60 * 60 * 24, h = ["NOT_STARTED", "IN_PROGRESS"], $ = (t) => {
161
164
  };
162
165
  export {
163
166
  w as getNodeCardBasedIcon,
164
- L as getNodeStateBasedTagInfo
167
+ y as getNodeStateBasedTagInfo
165
168
  };
166
169
  //# sourceMappingURL=node-card-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-card-utils.js","sources":["../../../../src/features/chapters-v2/utils/node-card-utils.tsx"],"sourcesContent":["import type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport ExclamationIcon from '../../../assets/line-icons/icons/exclamation';\nimport Lock2Icon from '../../../assets/line-icons/icons/lock2';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport FlexView from '../..//ui/layout/flex-view';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Text from '../../ui/text/text';\nimport { InProgressIconWrapper } from '../comps/node-card/node-card-styled';\nimport Tag from '../comps/tag/tag';\n\ninterface DueDateInfo {\n isOverdue: boolean;\n daysText: string;\n differenceInDays: number;\n}\n\nconst SECONDS_PER_DAY = 60 * 60 * 24;\nconst OVERDUE_TAG_STATES: INodeDataProps['state'][] = ['NOT_STARTED', 'IN_PROGRESS'];\n\nconst calculateDueDateInfo = (dueDateTs?: number | null): DueDateInfo => {\n if (!dueDateTs) {\n return { isOverdue: false, daysText: '', differenceInDays: 0 };\n }\n\n const currentTimestamp = Math.floor(Date.now() / 1000);\n const differenceInSeconds = dueDateTs - currentTimestamp;\n const differenceInDays = Math.ceil(differenceInSeconds / SECONDS_PER_DAY);\n\n const isOverdue = differenceInDays < 0;\n\n const daysText = differenceInDays > 0 ? `${Math.abs(differenceInDays)}D` : '';\n\n return { isOverdue, daysText, differenceInDays };\n};\n\nconst getNodeStateBasedTagInfo = (\n nodeState: INodeDataProps['state'],\n isStudent: boolean,\n accuracy?: number | null,\n dueDateTs?: number | null,\n) => {\n const { isOverdue, daysText, differenceInDays } = calculateDueDateInfo(dueDateTs);\n\n if (isOverdue && OVERDUE_TAG_STATES.includes(nodeState)) {\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem=\"Complete now\"\n zIndex={10}\n hidden={!isStudent}\n parentWidth=\"fit-content\"\n >\n <FlexView $background=\"RED\" $borderRadius={16} $gapX={0.24} $gutterX={0.5}>\n <Text $renderAs=\"ac4-black\" $color=\"WHITE\">\n OVERDUE\n </Text>\n </FlexView>\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n }\n\n switch (nodeState) {\n case 'NOT_STARTED':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={\n differenceInDays > 1 ? `${differenceInDays} days left` : 'Complete it today'\n }\n zIndex={10}\n hidden={!isStudent}\n >\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadius={16}\n $paddingRight={6}\n $paddingLeft={6}\n >\n {daysText && (\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n {daysText}\n </Text>\n )}\n </InProgressIconWrapper>\n </ArrowTooltip>\n ),\n top: 0,\n right: 0,\n };\n case 'LOCKED':\n return {\n icon: <Lock2Icon width={32} height={32} />,\n top: -12,\n right: -12,\n };\n case 'IN_PROGRESS':\n return {\n icon: (\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadius={16}\n $paddingRight={0}\n $paddingLeft={daysText ? 6 : 0}\n >\n {daysText && (\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n {daysText}\n </Text>\n )}\n <StatusIcon />\n </InProgressIconWrapper>\n ),\n };\n case 'COMPLETED':\n return {\n icon: (\n <Tag\n Icon={Check2Icon}\n label={typeof accuracy === 'number' ? `${accuracy}%` : undefined}\n />\n ),\n top: -10,\n right: -10,\n };\n case 'WAIT_FOR_REVIEW':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={isStudent ? 'Waiting for teacher to review' : 'Needs your review'}\n zIndex={10}\n >\n <Tag Icon={ExclamationIcon} />\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n\n default:\n return {\n icon: undefined,\n };\n }\n};\n\nconst getNodeCardBasedIcon = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEARNING':\n return {\n lottie: LOTTIE.LEARN,\n };\n case 'RECAP':\n case 'REMEDIAL':\n case 'REVISION':\n return {\n lottie: LOTTIE.RECAP,\n };\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n case 'DIAGNOSTIC':\n return {\n lottie: LOTTIE.TEST,\n };\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return {\n lottie: LOTTIE.PRACTICE,\n };\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return {\n lottie: LOTTIE.PUZZLE,\n };\n case 'VIDEO':\n return {\n lottie: LOTTIE.VIDEO,\n };\n default:\n return {\n lottie: LOTTIE.PROJECT,\n };\n }\n};\n\nexport { getNodeStateBasedTagInfo, getNodeCardBasedIcon };\n"],"names":["SECONDS_PER_DAY","OVERDUE_TAG_STATES","calculateDueDateInfo","dueDateTs","currentTimestamp","differenceInSeconds","differenceInDays","isOverdue","daysText","getNodeStateBasedTagInfo","nodeState","isStudent","accuracy","jsx","ArrowTooltip","FlexView","Text","InProgressIconWrapper","Lock2Icon","jsxs","StatusIcon","Tag","Check2Icon","ExclamationIcon","getNodeCardBasedIcon","nodeType","LOTTIE"],"mappings":";;;;;;;;;;;AAmBA,MAAMA,IAAkB,KAAK,KAAK,IAC5BC,IAAgD,CAAC,eAAe,aAAa,GAE7EC,IAAuB,CAACC,MAA2C;AACvE,MAAI,CAACA;AACH,WAAO,EAAE,WAAW,IAAO,UAAU,IAAI,kBAAkB;AAG7D,QAAMC,IAAmB,KAAK,MAAM,KAAK,IAAA,IAAQ,GAAI,GAC/CC,IAAsBF,IAAYC,GAClCE,IAAmB,KAAK,KAAKD,IAAsBL,CAAe,GAElEO,IAAYD,IAAmB,GAE/BE,IAAWF,IAAmB,IAAI,GAAG,KAAK,IAAIA,CAAgB,CAAC,MAAM;AAEpE,SAAA,EAAE,WAAAC,GAAW,UAAAC,GAAU,kBAAAF;AAChC,GAEMG,IAA2B,CAC/BC,GACAC,GACAC,GACAT,MACG;AACH,QAAM,EAAE,WAAAI,GAAW,UAAAC,GAAU,kBAAAF,EAAiB,IAAIJ,EAAqBC,CAAS;AAEhF,MAAII,KAAaN,EAAmB,SAASS,CAAS;AAC7C,WAAA;AAAA,MACL,MACE,gBAAAG;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,UAAS;AAAA,UACT,aAAY;AAAA,UACZ,QAAQ;AAAA,UACR,QAAQ,CAACH;AAAA,UACT,aAAY;AAAA,UAEZ,4BAACI,GAAS,EAAA,aAAY,OAA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EnB;AACS,aAAA;AAAA,QACL,QAAQA,EAAO;AAAA,MAAA;AAAA,EAErB;AACF;"}
1
+ {"version":3,"file":"node-card-utils.js","sources":["../../../../src/features/chapters-v2/utils/node-card-utils.tsx"],"sourcesContent":["import type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport ExclamationIcon from '../../../assets/line-icons/icons/exclamation';\nimport Lock2Icon from '../../../assets/line-icons/icons/lock2';\nimport StatusIcon from '../../../assets/line-icons/icons/status';\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport FlexView from '../..//ui/layout/flex-view';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Text from '../../ui/text/text';\nimport { InProgressIconWrapper } from '../comps/node-card/node-card-styled';\nimport Tag from '../comps/tag/tag';\n\ninterface DueDateInfo {\n isOverdue: boolean;\n daysText: string;\n differenceInDays: number;\n}\n\nconst SECONDS_PER_DAY = 60 * 60 * 24;\nconst OVERDUE_TAG_STATES: INodeDataProps['state'][] = ['NOT_STARTED', 'IN_PROGRESS'];\n\nconst calculateDueDateInfo = (dueDateTs?: number | null): DueDateInfo => {\n if (!dueDateTs) {\n return { isOverdue: false, daysText: '', differenceInDays: 0 };\n }\n\n const currentTimestamp = Math.floor(Date.now() / 1000);\n const differenceInSeconds = dueDateTs - currentTimestamp;\n const differenceInDays = Math.ceil(differenceInSeconds / SECONDS_PER_DAY);\n\n const isOverdue = differenceInDays < 0;\n\n const daysText = differenceInDays > 0 ? `${Math.abs(differenceInDays)}D` : '';\n\n return { isOverdue, daysText, differenceInDays };\n};\n\nconst getNodeStateBasedTagInfo = (\n nodeState: INodeDataProps['state'],\n isStudent: boolean,\n accuracy?: number | null,\n dueDateTs?: number | null,\n) => {\n const { isOverdue, daysText, differenceInDays } = calculateDueDateInfo(dueDateTs);\n\n if (isOverdue && OVERDUE_TAG_STATES.includes(nodeState)) {\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem=\"Complete now\"\n zIndex={10}\n hidden={!isStudent}\n parentWidth=\"fit-content\"\n >\n <FlexView $background=\"RED\" $borderRadius={16} $gapX={0.24} $gutterX={0.5}>\n <Text $renderAs=\"ac4-black\" $color=\"WHITE\">\n OVERDUE\n </Text>\n </FlexView>\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n }\n\n switch (nodeState) {\n case 'NOT_STARTED':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={\n differenceInDays > 1 ? `${differenceInDays} days left` : 'Complete it today'\n }\n zIndex={10}\n hidden={!isStudent}\n >\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadius={16}\n $paddingRight={6}\n $paddingLeft={6}\n >\n {daysText && (\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n {daysText}\n </Text>\n )}\n </InProgressIconWrapper>\n </ArrowTooltip>\n ),\n top: 0,\n right: 0,\n };\n case 'LOCKED':\n return {\n icon: <Lock2Icon width={32} height={32} />,\n top: -12,\n right: -12,\n };\n case 'IN_PROGRESS':\n return {\n icon: (\n <InProgressIconWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadius={16}\n $paddingRight={0}\n $paddingLeft={daysText ? 6 : 0}\n >\n {daysText && (\n <Text $renderAs=\"ub3-bold\" $color=\"WHITE\">\n {daysText}\n </Text>\n )}\n <StatusIcon />\n </InProgressIconWrapper>\n ),\n };\n case 'COMPLETED':\n return {\n icon: (\n <Tag\n Icon={Check2Icon}\n label={typeof accuracy === 'number' ? `${accuracy}%` : undefined}\n />\n ),\n top: -10,\n right: -10,\n };\n case 'WAIT_FOR_REVIEW':\n return {\n icon: (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={isStudent ? 'Waiting for teacher to review' : 'Needs your review'}\n zIndex={10}\n >\n <Tag Icon={ExclamationIcon} />\n </ArrowTooltip>\n ),\n top: -10,\n right: -10,\n };\n\n default:\n return {\n icon: undefined,\n };\n }\n};\n\nconst getNodeCardBasedIcon = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEARNING':\n case 'LEVEL2':\n case 'LEVEL3':\n return {\n lottie: LOTTIE.LEARN,\n };\n case 'RECAP':\n case 'REMEDIAL':\n case 'REVISION':\n return {\n lottie: LOTTIE.RECAP,\n };\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n case 'DIAGNOSTIC':\n return {\n lottie: LOTTIE.TEST,\n };\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n return {\n lottie: LOTTIE.PRACTICE,\n };\n case 'PUZZLE':\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return {\n lottie: LOTTIE.PUZZLE,\n };\n case 'VIDEO':\n return {\n lottie: LOTTIE.VIDEO,\n };\n default:\n return {\n lottie: LOTTIE.PROJECT,\n };\n }\n};\n\nexport { getNodeStateBasedTagInfo, getNodeCardBasedIcon };\n"],"names":["SECONDS_PER_DAY","OVERDUE_TAG_STATES","calculateDueDateInfo","dueDateTs","currentTimestamp","differenceInSeconds","differenceInDays","isOverdue","daysText","getNodeStateBasedTagInfo","nodeState","isStudent","accuracy","jsx","ArrowTooltip","FlexView","Text","InProgressIconWrapper","Lock2Icon","jsxs","StatusIcon","Tag","Check2Icon","ExclamationIcon","getNodeCardBasedIcon","nodeType","LOTTIE"],"mappings":";;;;;;;;;;;AAmBA,MAAMA,IAAkB,KAAK,KAAK,IAC5BC,IAAgD,CAAC,eAAe,aAAa,GAE7EC,IAAuB,CAACC,MAA2C;AACvE,MAAI,CAACA;AACH,WAAO,EAAE,WAAW,IAAO,UAAU,IAAI,kBAAkB;AAG7D,QAAMC,IAAmB,KAAK,MAAM,KAAK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EMC,IAAuB,CAACC,MAA0C;AACtE,UAAQA,GAAU;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,QAAQC,EAAO;AAAA,MAAA;AAAA,IAEnB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,QAAQA,EAAO;AAAA,MAAA;AAAA,IAEnB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,QAAQA,EAAO;AAAA,MAAA;AAAA,IAEnB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,QAAQA,EAAO;AAAA,MAAA;AAAA,IAEnB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,QAAQA,EAAO;AAAA,MAAA;AAAA,IAEnB,KAAK;AACI,aAAA;AAAA,QACL,QAAQA,EAAO;AAAA,MAAA;AAAA,IAEnB;AACS,aAAA;AAAA,QACL,QAAQA,EAAO;AAAA,MAAA;AAAA,EAErB;AACF;"}
@@ -1,10 +1,10 @@
1
- import { jsxs as D, jsx as w } from "react/jsx-runtime";
2
- import { createContext as L, useState as J, useRef as k, useCallback as l, useMemo as N, useEffect as R } from "react";
1
+ import { jsxs as D, jsx as R } from "react/jsx-runtime";
2
+ import { createContext as L, useState as d, useRef as v, useCallback as l, useMemo as N, useEffect as x } from "react";
3
3
  import { Coachmark as B } from "../comps/coachmark/coachmark.js";
4
4
  import { usePostUserJourney as M, useGetUserJourney as z } from "../user-journey-api/user-journey-api.js";
5
5
  import { Overlay as G } from "./journey-styled.js";
6
- const S = L(null), W = ({ children: T, appId: s, userId: o }) => {
7
- const [b, O] = J(!1), [x, p] = J(null), [c, a] = J([]), [d, v] = J(!1), y = k(-1), t = k(), f = k([]), { post: _ } = M(), { data: C = null, get: g } = z(), A = l(
6
+ const S = L(null), W = ({ children: T, appId: s, userId: n }) => {
7
+ const [f, O] = d(!1), [p, _] = d(null), [c, a] = d([]), [J, g] = d(!1), y = v(-1), t = v(), h = v([]), { post: w } = M(), { data: C = null, get: A } = z(), $ = l(
8
8
  (e, r) => {
9
9
  if (c.length > 0) {
10
10
  console.error(
@@ -12,23 +12,23 @@ const S = L(null), W = ({ children: T, appId: s, userId: o }) => {
12
12
  );
13
13
  return;
14
14
  }
15
- v(!0), t.current = e, y.current = -1, a([...r]);
15
+ g(!0), t.current = e, y.current = -1, a([...r]);
16
16
  },
17
17
  [c.length]
18
18
  ), u = l(() => {
19
- f.current.forEach((e) => {
19
+ h.current.forEach((e) => {
20
20
  clearTimeout(e);
21
- }), f.current = [], t.current = void 0, y.current = -1, a([]), v(!1);
22
- }, []), $ = l(
21
+ }), h.current = [], t.current = void 0, y.current = -1, a([]), g(!1);
22
+ }, []), b = l(
23
23
  (e) => {
24
- u(), p((r) => r && !r.includes(e) ? [...r, e] : r), _({
24
+ u(), _((r) => r && !r.includes(e) ? [...r, e] : r), w({
25
25
  app_id: s,
26
- user_id: o,
26
+ user_id: n,
27
27
  journey_id: e,
28
28
  journey_status: "COMPLETED"
29
29
  });
30
30
  },
31
- [s, u, _, o]
31
+ [s, u, w, n]
32
32
  ), E = l((e, r) => {
33
33
  if (!t.current || e !== t.current) {
34
34
  console.error(
@@ -45,62 +45,64 @@ const S = L(null), W = ({ children: T, appId: s, userId: o }) => {
45
45
  );
46
46
  return;
47
47
  }
48
- O(q), m !== 0 && a((n) => n.map((i) => ({ ...i, isActive: !1 })));
48
+ O(q), m !== 0 && a((o) => o.map((i) => ({ ...i, isActive: !1 })));
49
49
  const j = setTimeout(() => {
50
50
  clearTimeout(j);
51
- const n = y.current + 1;
51
+ const o = y.current + 1;
52
52
  a((i) => {
53
- if (n >= i.length || i.length === 0)
53
+ if (o >= i.length || i.length === 0)
54
54
  return u(), [];
55
- y.current = n;
56
- const h = [...i];
57
- return h[n].isActive = !0, n > 0 && (h[n - 1].isActive = r), h;
55
+ y.current = o;
56
+ const k = [...i];
57
+ return k[o].isActive = !0, o > 0 && (k[o - 1].isActive = r), k;
58
58
  });
59
59
  }, m);
60
- f.current.push(j);
60
+ h.current.push(j);
61
61
  },
62
62
  [u]
63
63
  ), U = N(
64
64
  () => ({
65
65
  nextCoachmark: P,
66
- setJourney: A,
66
+ setJourney: $,
67
67
  addCoachmark: E,
68
68
  clearJourney: u,
69
- endJourney: $,
69
+ endJourney: b,
70
70
  coachmarks: c,
71
- userCompletedJourneyIds: x,
72
- isJourneyActive: d
71
+ userCompletedJourneyIds: p,
72
+ isJourneyActive: J
73
73
  }),
74
74
  [
75
75
  P,
76
- A,
76
+ $,
77
77
  E,
78
78
  u,
79
- $,
79
+ b,
80
80
  c,
81
- x,
82
- d
81
+ p,
82
+ J
83
83
  ]
84
84
  );
85
- return R(() => {
86
- s && o && g(o, {
85
+ return x(() => {
86
+ s && n && A(n, {
87
87
  app_id: s,
88
- user_id: o,
88
+ user_id: n,
89
89
  journey_status: "COMPLETED"
90
90
  });
91
- }, [s, g, o]), R(() => {
91
+ }, [s, A, n]), x(() => {
92
92
  if (C) {
93
93
  const e = C.map((r) => r.journey_id);
94
- p(e);
94
+ _(e);
95
95
  }
96
- }, [C]), /* @__PURE__ */ D(S.Provider, { value: U, children: [
97
- d && /* @__PURE__ */ w(
96
+ }, [C]), x(() => {
97
+ f ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
98
+ }, [f]), /* @__PURE__ */ D(S.Provider, { value: U, children: [
99
+ J && /* @__PURE__ */ R(
98
100
  G,
99
101
  {
100
102
  about: "journey-overlay",
101
- isJourneyBlurred: b,
103
+ isJourneyBlurred: f,
102
104
  "data-testid": t.current,
103
- children: c.map((e, r) => /* @__PURE__ */ w(B, { coachmark: e }, `coachmark-${r}`))
105
+ children: c.map((e, r) => /* @__PURE__ */ R(B, { coachmark: e }, `coachmark-${r}`))
104
106
  }
105
107
  ),
106
108
  T
@@ -1 +1 @@
1
- {"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n} from './journey-context-types';\nimport type { FC } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>();\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n isJourneyBlurred={isJourneyBlurred}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isJourneyBlurred","setIsJourneyBlurred","useState","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","item","currIndex","updatedCoachmarkList","memoizedContextValue","useMem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AAA,MAAA;AAAA,IACH;AAAA,IAEDhD;AAAA,EACH,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"journey-context-provider.js","sources":["../../../../src/features/journey/use-journey/journey-context-provider.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { TJourneyId } from '../journey-id/journey-id-types';\nimport type {\n ICoachmarkProps,\n IJourneyContext,\n IJourneyProviderProps,\n} from './journey-context-types';\nimport type { FC } from 'react';\n\nimport { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Coachmark } from '../comps/coachmark/coachmark';\nimport { useGetUserJourney, usePostUserJourney } from '../user-journey-api/user-journey-api';\nimport * as S from './journey-styled';\n\nexport const JourneyContext = createContext<IJourneyContext | null>(null);\n\nexport const JourneyProvider: FC<IJourneyProviderProps> = ({ children, appId, userId }) => {\n const [isJourneyBlurred, setIsJourneyBlurred] = useState<boolean>(false);\n const [userCompletedJourneyIds, setUserCompletedJourneyIds] = useState<TJourneyId[] | null>(null);\n const [coachmarkList, setCoachmarkList] = useState<ICoachmarkProps[]>([]);\n const [isJourneyActive, setIsJourneyActive] = useState(false);\n const currentIndex = useRef(-1);\n const currentJourneyId = useRef<TJourneyId | undefined>();\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { post: postJourneyCompletion } = usePostUserJourney();\n const { data: userCompletedJourneys = null, get: getJourneyProgress } = useGetUserJourney();\n\n const setJourney = useCallback(\n (id: TJourneyId, coachmarks: ICoachmarkProps[]) => {\n if (coachmarkList.length > 0) {\n console.error(\n `setJourney: Other Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n setIsJourneyActive(true);\n currentJourneyId.current = id;\n currentIndex.current = -1;\n setCoachmarkList([...coachmarks]);\n },\n [coachmarkList.length],\n );\n\n const clearJourney = useCallback(() => {\n // Clear all timers\n timerRefs.current.forEach(timer => {\n clearTimeout(timer);\n });\n timerRefs.current = [];\n currentJourneyId.current = undefined;\n currentIndex.current = -1;\n setCoachmarkList([]);\n setIsJourneyActive(false);\n }, []);\n\n const endJourney = useCallback(\n (journeyId: TJourneyId) => {\n clearJourney();\n setUserCompletedJourneyIds(prev => {\n if (prev && !prev.includes(journeyId)) {\n return [...prev, journeyId];\n }\n\n return prev;\n });\n // fire the API (doesn’t block the UI)\n postJourneyCompletion({\n app_id: appId,\n user_id: userId,\n journey_id: journeyId,\n journey_status: 'COMPLETED',\n });\n },\n [appId, clearJourney, postJourneyCompletion, userId],\n );\n\n const addCoachmark = useCallback((id: TJourneyId, coachmark: ICoachmarkProps) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`\n : `addCoachmark was called before setJourney and Journey ID is undefined`,\n );\n\n return;\n }\n\n setCoachmarkList(prev => [...prev, coachmark]);\n }, []);\n\n const nextCoachmark = useCallback(\n (\n id: TJourneyId,\n keepPrevActive: boolean = false,\n delayInMs: number = 0,\n shouldBlurNextJourney: boolean = false,\n ) => {\n if (!currentJourneyId.current || id !== currentJourneyId.current) {\n console.error(\n currentJourneyId.current\n ? `nextCoachmark was called before setJourney`\n : `A Journey is already active, Current Journey: ${currentJourneyId.current}, New Journey Request: ${id}`,\n );\n\n return;\n }\n\n setIsJourneyBlurred(shouldBlurNextJourney);\n\n if (delayInMs !== 0) {\n // If delay is not 0, we will hide all them coachmarks and reveal only after the delay\n setCoachmarkList(prevList => {\n return prevList.map((item: ICoachmarkProps) => {\n return { ...item, isActive: false };\n });\n });\n }\n\n const timer = setTimeout(() => {\n clearTimeout(timer);\n const currIndex = currentIndex.current + 1;\n\n setCoachmarkList(prevList => {\n // Finish onboarding\n if (currIndex >= prevList.length || prevList.length === 0) {\n clearJourney();\n\n return [];\n }\n\n currentIndex.current = currIndex;\n const updatedCoachmarkList = [...prevList];\n\n (updatedCoachmarkList[currIndex] as ICoachmarkProps).isActive = true;\n\n if (currIndex > 0) {\n (updatedCoachmarkList[currIndex - 1] as ICoachmarkProps).isActive = keepPrevActive;\n }\n\n return updatedCoachmarkList;\n });\n }, delayInMs);\n\n timerRefs.current.push(timer);\n },\n [clearJourney],\n );\n\n const memoizedContextValue: IJourneyContext = useMemo(\n () => ({\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarks: coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n }),\n [\n nextCoachmark,\n setJourney,\n addCoachmark,\n clearJourney,\n endJourney,\n coachmarkList,\n userCompletedJourneyIds,\n isJourneyActive,\n ],\n );\n\n // Get the initial state of incompleteJourneys\n useEffect(() => {\n if (appId && userId) {\n getJourneyProgress(userId, {\n app_id: appId,\n user_id: userId,\n journey_status: 'COMPLETED',\n });\n }\n }, [appId, getJourneyProgress, userId]);\n\n // Set the data to context state initially\n useEffect(() => {\n if (userCompletedJourneys) {\n const completedUserJourneysIds = userCompletedJourneys.map(journey => journey.journey_id);\n\n setUserCompletedJourneyIds(completedUserJourneysIds);\n }\n }, [userCompletedJourneys]);\n\n useEffect(() => {\n if (isJourneyBlurred) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = '';\n }\n }, [isJourneyBlurred]);\n\n return (\n <JourneyContext.Provider value={memoizedContextValue}>\n {isJourneyActive && (\n <S.Overlay\n about=\"journey-overlay\"\n isJourneyBlurred={isJourneyBlurred}\n data-testid={currentJourneyId.current}\n >\n {coachmarkList.map((coachmark, index) => (\n <Coachmark key={`coachmark-${index}`} coachmark={coachmark} />\n ))}\n </S.Overlay>\n )}\n {children}\n </JourneyContext.Provider>\n );\n};\n"],"names":["JourneyContext","createContext","JourneyProvider","children","appId","userId","isJourneyBlurred","setIsJourneyBlurred","useState","userCompletedJourneyIds","setUserCompletedJourneyIds","coachmarkList","setCoachmarkList","isJourneyActive","setIsJourneyActive","currentIndex","useRef","currentJourneyId","timerRefs","postJourneyCompletion","usePostUserJourney","userCompletedJourneys","getJourneyProgress","useGetUserJourney","setJourney","useCallback","id","coachmarks","clearJourney","timer","endJourney","journeyId","prev","addCoachmark","coachmark","nextCoachmark","keepPrevActive","delayInMs","shouldBlurNextJourney","prevList","item","currIndex","updatedCoachmarkList","memoizedContextValue","useMemo","useEffect","completedUserJourneysIds","journey","jsxs","jsx","S.Overlay","index","Coachmark"],"mappings":";;;;;AAea,MAAAA,IAAiBC,EAAsC,IAAI,GAE3DC,IAA6C,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,QAAAC,QAAa;AACzF,QAAM,CAACC,GAAkBC,CAAmB,IAAIC,EAAkB,EAAK,GACjE,CAACC,GAAyBC,CAA0B,IAAIF,EAA8B,IAAI,GAC1F,CAACG,GAAeC,CAAgB,IAAIJ,EAA4B,CAAE,CAAA,GAClE,CAACK,GAAiBC,CAAkB,IAAIN,EAAS,EAAK,GACtDO,IAAeC,EAAO,EAAE,GACxBC,IAAmBD,KACnBE,IAAYF,EAAwC,CAAA,CAAE,GAEtD,EAAE,MAAMG,EAAsB,IAAIC,EAAmB,GACrD,EAAE,MAAMC,IAAwB,MAAM,KAAKC,EAAA,IAAuBC,KAElEC,IAAaC;AAAA,IACjB,CAACC,GAAgBC,MAAkC;AAC7C,UAAAhB,EAAc,SAAS,GAAG;AACpB,gBAAA;AAAA,UACN,iEAAiEM,EAAiB,OAAO,0BAA0BS,CAAE;AAAA,QAAA;AAGvH;AAAA,MACF;AACA,MAAAZ,EAAmB,EAAI,GACvBG,EAAiB,UAAUS,GAC3BX,EAAa,UAAU,IACNH,EAAA,CAAC,GAAGe,CAAU,CAAC;AAAA,IAClC;AAAA,IACA,CAAChB,EAAc,MAAM;AAAA,EAAA,GAGjBiB,IAAeH,EAAY,MAAM;AAE3B,IAAAP,EAAA,QAAQ,QAAQ,CAASW,MAAA;AACjC,mBAAaA,CAAK;AAAA,IAAA,CACnB,GACDX,EAAU,UAAU,IACpBD,EAAiB,UAAU,QAC3BF,EAAa,UAAU,IACvBH,EAAiB,CAAE,CAAA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Af,EAAwB,OAAO2C,GAC7B,UAAA;AAAA,IACC9B,KAAA,gBAAAoC;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,kBAAA5C;AAAA,QACA,eAAaW,EAAiB;AAAA,QAE7B,UAAAN,EAAc,IAAI,CAACuB,GAAWiB,MAC5B,gBAAAF,EAAAG,GAAA,EAAqC,WAAAlB,EAAtB,GAAA,aAAaiB,CAAK,EAA0B,CAC7D;AAAA,MAAA;AAAA,IACH;AAAA,IAEDhD;AAAA,EACH,EAAA,CAAA;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "2.9.8-as5",
3
+ "version": "2.9.8-as7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"