@cuemath/leap 3.1.1-beta-0.2 → 3.1.1

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.
@@ -4,14 +4,14 @@ import H from "../../../chapters/chapters-list/chapter-item/chapter-item.js";
4
4
  import U from "../../../homework/homework-card.js";
5
5
  import I from "../../../homework/hw-card-list/hw-card-list-view.js";
6
6
  import J from "../../../milestone/milestone-list-container/milestone-list-container.js";
7
- import f from "../../../ui/layout/flex-view.js";
7
+ import T from "../../../ui/layout/flex-view.js";
8
8
  import P from "../../../ui/text/text.js";
9
9
  import { JOURNEY_ID_STUDENT as M } from "../../journey-id/journey-id-student.js";
10
10
  import { IndicatorType as p } from "../../use-journey/constants.js";
11
11
  import { useJourney as W } from "../../use-journey/use-journey.js";
12
12
  import { HOMEWORK_DETAILS as C } from "./home-page-homeworks-mock.js";
13
13
  import { RECENT_CHAPTERS as h } from "./recent-chapters-mock.js";
14
- import { ChaptersWrapper as v, ELementWrapper as T } from "./styles.js";
14
+ import { ChaptersWrapper as v, ELementWrapper as g } from "./styles.js";
15
15
  import u from "./tooltip-item.js";
16
16
  const ae = () => {
17
17
  const r = M.HOMEPAGE_JOURNEY, n = d(null), i = d(null), y = d(null), w = d([]), { nextCoachmark: E, setJourney: O, endJourney: b } = W(), e = m(() => null, []), A = m(() => {
@@ -21,7 +21,7 @@ const ae = () => {
21
21
  }, [E, r]), L = m(
22
22
  ({ studentId: a, stream: S, userType: l }) => {
23
23
  var k, x;
24
- const { title: _ = "", subtext: X = "" } = C.assigned_homeworks[0] || {}, N = l === "STUDENT";
24
+ const { title: X, subtext: _ } = C[0], N = l === "STUDENT";
25
25
  if (!(n != null && n.current) || !(i != null && i.current))
26
26
  return;
27
27
  const $ = [
@@ -30,7 +30,7 @@ const ae = () => {
30
30
  isActive: !1,
31
31
  type: p.TOOLTIP,
32
32
  elementToHighlight: /* @__PURE__ */ c(
33
- f,
33
+ T,
34
34
  {
35
35
  $flexGapX: 2.5,
36
36
  $marginBottomX: 8,
@@ -54,18 +54,18 @@ const ae = () => {
54
54
  onNodeUnassign: e
55
55
  }
56
56
  ),
57
- /* @__PURE__ */ c(f, { $flexRowGapX: 1, ref: y, children: [
57
+ /* @__PURE__ */ c(T, { $flexRowGapX: 1, ref: y, children: [
58
58
  /* @__PURE__ */ c(P, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
59
59
  "Recent Chapters (",
60
60
  (k = h) == null ? void 0 : k.length,
61
61
  ")"
62
62
  ] }),
63
- /* @__PURE__ */ o(v, { children: h.map((t, g) => /* @__PURE__ */ o(
63
+ /* @__PURE__ */ o(v, { children: h.map((t, f) => /* @__PURE__ */ o(
64
64
  H,
65
65
  {
66
66
  chapter: t,
67
67
  onChapterClick: e,
68
- itemIndex: g
68
+ itemIndex: f
69
69
  },
70
70
  t.id
71
71
  )) })
@@ -128,7 +128,7 @@ const ae = () => {
128
128
  },
129
129
  {
130
130
  originalElementToHighlightRef: i,
131
- elementToHighlight: /* @__PURE__ */ o(T, { children: /* @__PURE__ */ o(
131
+ elementToHighlight: /* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(
132
132
  I,
133
133
  {
134
134
  userType: l,
@@ -168,14 +168,14 @@ const ae = () => {
168
168
  },
169
169
  {
170
170
  originalElementToHighlightRef: i,
171
- elementToHighlight: /* @__PURE__ */ o(T, { children: /* @__PURE__ */ o(
171
+ elementToHighlight: /* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(
172
172
  U,
173
173
  {
174
174
  isInQueue: !1,
175
175
  userType: l,
176
- header: _,
177
- subHeader: X || "",
178
- nodeData: C.assigned_homeworks[0],
176
+ header: X,
177
+ subHeader: _ || "",
178
+ nodeData: C[0],
179
179
  renderAs: "homework",
180
180
  studentId: a,
181
181
  shouldOpenOnRight: !1
@@ -205,18 +205,18 @@ const ae = () => {
205
205
  },
206
206
  {
207
207
  originalElementToHighlightRef: n,
208
- elementToHighlight: /* @__PURE__ */ o(T, { children: /* @__PURE__ */ c(f, { $flexRowGapX: 1, children: [
208
+ elementToHighlight: /* @__PURE__ */ o(g, { children: /* @__PURE__ */ c(T, { $flexRowGapX: 1, children: [
209
209
  /* @__PURE__ */ c(P, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
210
210
  "Recent Chapters (",
211
211
  (x = h) == null ? void 0 : x.length,
212
212
  ")"
213
213
  ] }),
214
- /* @__PURE__ */ o(v, { children: h.map((t, g) => /* @__PURE__ */ o(
214
+ /* @__PURE__ */ o(v, { children: h.map((t, f) => /* @__PURE__ */ o(
215
215
  H,
216
216
  {
217
217
  chapter: t,
218
218
  onChapterClick: e,
219
- itemIndex: g
219
+ itemIndex: f
220
220
  },
221
221
  t.id
222
222
  )) })
@@ -1 +1 @@
1
- {"version":3,"file":"use-home-page-journey.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/use-home-page-journey.tsx"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\nimport type { TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\nimport type { IHomepageStartJourneyProps } from './homepage-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport ChapterItem from '../../../chapters/chapters-list/chapter-item/chapter-item';\nimport HomeworkCard from '../../../homework/homework-card';\nimport HwCardListView from '../../../homework/hw-card-list/hw-card-list-view';\nimport MilestoneListContainer from '../../../milestone/milestone-list-container/milestone-list-container';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport { useJourney } from '../../use-journey/use-journey';\nimport { HOMEWORK_DETAILS } from './home-page-homeworks-mock';\nimport { RECENT_CHAPTERS } from './recent-chapters-mock';\nimport { ChaptersWrapper, ELementWrapper } from './styles';\nimport TooltipItem from './tooltip-item';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null);\n const homeworkRef = useRef<HTMLDivElement>(null);\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const emptyFunction = useCallback(() => null, []);\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n document.body.style.overflow = 'unset';\n }, [endJourney, journeyId]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, true);\n }, [nextCoachmark, journeyId]);\n\n const startJourney = useCallback(\n ({ studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { title = '', subtext = '' } = HOMEWORK_DETAILS.assigned_homeworks[0] || {};\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current) {\n return;\n }\n\n const homepageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <FlexView\n $flexGapX={2.5}\n $marginBottomX={8}\n $background=\"WHITE\"\n $widthX={47}\n $gutterX={1}\n >\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n <FlexView $flexRowGapX={1} ref={recentChaptersRef}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n <MilestoneListContainer\n milestoneType=\"ACTIVE\"\n activeMilestoneId={''}\n activeTabId={''}\n canCreatePlan={false}\n courseStream={stream as TCourseStream}\n isClassOngoing={false}\n isStudentPresent={false}\n parentName={''}\n studentId={studentId}\n studentName={''}\n teacherName={''}\n userType={userType}\n //* Callbacks\n onAddChapter={emptyFunction}\n onAddOutcome={emptyFunction}\n onChapterClick={emptyFunction}\n onCreatePlan={emptyFunction}\n onDelete={emptyFunction}\n onDraftPublish={emptyFunction}\n onEdit={emptyFunction}\n onExpandPastMilestones={emptyFunction}\n onNodeView={emptyFunction}\n onNodeReview={emptyFunction}\n onWidgetTabSelection={emptyFunction}\n //* Resource callbacks\n onAssignResources={emptyFunction}\n onNodeReset={emptyFunction}\n onNodeUnassign={emptyFunction}\n //* Tests callbacks\n onCreateMilestoneTest={emptyFunction}\n onTestPreview={emptyFunction}\n onTestReview={emptyFunction}\n />\n </FlexView>\n ),\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text={`Welcome to the all new ${isStudent ? 'learning' : 'tutoring'} homepage.`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -197,\n tooltipYCoOrdinates: -12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <TooltipItem\n text={`Homework is now easy to access and easy to ${\n isStudent ? 'complete' : 'review'\n }!`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={HOMEWORK_DETAILS.assigned_homeworks[0] as INodeDataProps}\n renderAs=\"homework\"\n studentId={studentId}\n shouldOpenOnRight={false}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -35,\n tooltipYCoOrdinates: -7,\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Track homework status and their due dates.\"\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: homepageRef,\n elementToHighlight: (\n <ELementWrapper>\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -200,\n tooltipYCoOrdinates: -10,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Access all your recent chapters in one place.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n if (userType === 'STUDENT') {\n window.scrollTo(0, 0);\n } else {\n document.getElementById('tab-content-container')?.scrollTo(0, 0);\n }\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [handleEndJourney, emptyFunction, handleNextCoachmark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, []);\n\n return data;\n};\n"],"names":["useHomePageJourney","journeyId","JOURNEY_ID_STUDENT","homepageRef","useRef","homeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","emptyFunction","useCallback","handleEndJourney","handleNextCoachmark","startJourney","studentId","stream","userType","title","subtext","HOMEWORK_DETAILS","isStudent","homepageSteps","IndicatorType","jsxs","FlexView","jsx","HwCardListView","Text","_a","RECENT_CHAPTERS","ChaptersWrapper","chapter","idx","ChapterItem","MilestoneListContainer","TooltipItem","ELementWrapper","HomeworkCard","_b","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAuBO,MAAMA,KAAqB,MAAM;AACtC,QAA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B;AAAA,YACjB,aAAa;AAAA,YACb,YAAY;AAAA,YACZ,mBAAmB;AAAA,YACnB,WAAW;AAAA,YACX,OAAO;AAAA,YACP,aACE,gBAAAG;AAAA,cAACU;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,eAAexB;AAAA,cAAA;AAAA,YACjB;AAAA,UAEJ;AAAA,UACA,UAAU;AAAA,QACZ;AAAA,MAAA;AAGF,MAAAL,EAAWR,GAAWuB,CAAa;AAE7B,YAAAkB,IAAmB,WAAW,MAAM;;AACxC,qBAAaA,CAAgB,GACzBvB,MAAa,YACR,OAAA,SAAS,GAAG,CAAC,KAEpBY,IAAA,SAAS,eAAe,uBAAuB,MAA/C,QAAAA,EAAkD,SAAS,GAAG,IAEvD,SAAA,KAAK,MAAM,WAAW,UACXhB;SACnB,GAAG;AAEI,MAAAR,EAAA,QAAQ,KAAKmC,CAAgB;AAAA,IACzC;AAAA,IACA,CAAC5B,GAAkBF,GAAeG,GAAqBd,GAAWQ,CAAU;AAAA,EAAA,GAGxEkC,IAAOC;AAAA,IACX,OAAO;AAAA,MACL,aAAAzC;AAAA,MACA,aAAAE;AAAA,MACA,cAAAW;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIf,SAAA6B,EAAU,MACD,MAAM;AACX,IAAAtC,EAAU,QAAQ,QAAQ,CAASuC,MAAA,aAAaA,CAAK,CAAC,GACtDvC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEoC;AACT;"}
1
+ {"version":3,"file":"use-home-page-journey.js","sources":["../../../../../src/features/journey/hooks/use-home-page-journey/use-home-page-journey.tsx"],"sourcesContent":["import type { INodeDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\nimport type { TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\nimport type { IHomepageStartJourneyProps } from './homepage-journey-types';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport ChapterItem from '../../../chapters/chapters-list/chapter-item/chapter-item';\nimport HomeworkCard from '../../../homework/homework-card';\nimport HwCardListView from '../../../homework/hw-card-list/hw-card-list-view';\nimport MilestoneListContainer from '../../../milestone/milestone-list-container/milestone-list-container';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport { useJourney } from '../../use-journey/use-journey';\nimport { HOMEWORK_DETAILS } from './home-page-homeworks-mock';\nimport { RECENT_CHAPTERS } from './recent-chapters-mock';\nimport { ChaptersWrapper, ELementWrapper } from './styles';\nimport TooltipItem from './tooltip-item';\n\nexport const useHomePageJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.HOMEPAGE_JOURNEY;\n\n const homepageRef = useRef<HTMLDivElement>(null);\n const homeworkRef = useRef<HTMLDivElement>(null);\n const recentChaptersRef = useRef<HTMLDivElement>(null);\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n const { nextCoachmark, setJourney, endJourney } = useJourney();\n\n const emptyFunction = useCallback(() => null, []);\n\n const handleEndJourney = useCallback(() => {\n endJourney(journeyId);\n document.body.style.overflow = 'unset';\n }, [endJourney, journeyId]);\n\n const handleNextCoachmark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, true);\n }, [nextCoachmark, journeyId]);\n\n const startJourney = useCallback(\n ({ studentId, stream, userType }: IHomepageStartJourneyProps) => {\n const { title, subtext } = HOMEWORK_DETAILS[0] as INodeDataProps;\n const isStudent = userType === 'STUDENT';\n\n if (!homepageRef?.current || !homeworkRef?.current) {\n return;\n }\n\n const homepageSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: homepageRef,\n isActive: false,\n type: IndicatorType.TOOLTIP,\n elementToHighlight: (\n <FlexView\n $flexGapX={2.5}\n $marginBottomX={8}\n $background=\"WHITE\"\n $widthX={47}\n $gutterX={1}\n >\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS as INodeDataProps[]}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n <FlexView $flexRowGapX={1} ref={recentChaptersRef}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n <MilestoneListContainer\n milestoneType=\"ACTIVE\"\n activeMilestoneId={''}\n activeTabId={''}\n canCreatePlan={false}\n courseStream={stream as TCourseStream}\n isClassOngoing={false}\n isStudentPresent={false}\n parentName={''}\n studentId={studentId}\n studentName={''}\n teacherName={''}\n userType={userType}\n //* Callbacks\n onAddChapter={emptyFunction}\n onAddOutcome={emptyFunction}\n onChapterClick={emptyFunction}\n onCreatePlan={emptyFunction}\n onDelete={emptyFunction}\n onDraftPublish={emptyFunction}\n onEdit={emptyFunction}\n onExpandPastMilestones={emptyFunction}\n onNodeView={emptyFunction}\n onNodeReview={emptyFunction}\n onWidgetTabSelection={emptyFunction}\n //* Resource callbacks\n onAssignResources={emptyFunction}\n onNodeReset={emptyFunction}\n onNodeUnassign={emptyFunction}\n //* Tests callbacks\n onCreateMilestoneTest={emptyFunction}\n onTestPreview={emptyFunction}\n onTestReview={emptyFunction}\n />\n </FlexView>\n ),\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: 0,\n tooltipYCoOrdinates: 0,\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text={`Welcome to the all new ${isStudent ? 'learning' : 'tutoring'} homepage.`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HwCardListView\n userType={userType}\n studentId={studentId}\n isHwProcessing={false}\n hwDetails={HOMEWORK_DETAILS as INodeDataProps[]}\n onTestStart={emptyFunction}\n onNodeAttempt={emptyFunction}\n onTestPreview={emptyFunction}\n onNodeView={emptyFunction}\n onTestReview={emptyFunction}\n onNodeReview={emptyFunction}\n onNodeUnassign={emptyFunction}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -197,\n tooltipYCoOrdinates: -12,\n arrowXCoOrdinates: -110,\n backgroundColor: 'GREEN_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n width: 264,\n arrowSize: 12,\n tooltipItem: (\n <TooltipItem\n text={`Homework is now easy to access and easy to ${\n isStudent ? 'complete' : 'review'\n }!`}\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: homeworkRef,\n elementToHighlight: (\n <ELementWrapper>\n <HomeworkCard\n isInQueue={false}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={HOMEWORK_DETAILS[0] as INodeDataProps}\n renderAs=\"homework\"\n studentId={studentId}\n shouldOpenOnRight={false}\n />\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -35,\n tooltipYCoOrdinates: -7,\n backgroundColor: 'PURPLE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Track homework status and their due dates.\"\n buttonLabel=\"Next\"\n onButtonClick={handleNextCoachmark}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n {\n originalElementToHighlightRef: homepageRef,\n elementToHighlight: (\n <ELementWrapper>\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Recent Chapters ({RECENT_CHAPTERS?.length})\n </Text>\n <ChaptersWrapper>\n {RECENT_CHAPTERS.map((chapter, idx) => (\n <ChapterItem\n key={chapter.id}\n chapter={chapter as unknown as IChapterDataProps}\n onChapterClick={emptyFunction}\n itemIndex={idx}\n />\n ))}\n </ChaptersWrapper>\n </FlexView>\n </ELementWrapper>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n position: 'top',\n tooltipXCoOrdinates: -200,\n tooltipYCoOrdinates: -10,\n backgroundColor: 'YELLOW_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n arrowXCoOrdinates: -97,\n arrowSize: 12,\n width: 264,\n tooltipItem: (\n <TooltipItem\n text=\"Access all your recent chapters in one place.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, homepageSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n if (userType === 'STUDENT') {\n window.scrollTo(0, 0);\n } else {\n document.getElementById('tab-content-container')?.scrollTo(0, 0);\n }\n document.body.style.overflow = 'hidden';\n handleNextCoachmark();\n }, 200);\n\n timerRefs.current.push(delayBeforeStart); // Store to cleanup later\n },\n [handleEndJourney, emptyFunction, handleNextCoachmark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n homepageRef,\n homeworkRef,\n startJourney,\n }),\n [startJourney],\n );\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n timerRefs.current.forEach(timer => clearTimeout(timer));\n timerRefs.current = [];\n };\n }, []);\n\n return data;\n};\n"],"names":["useHomePageJourney","journeyId","JOURNEY_ID_STUDENT","homepageRef","useRef","homeworkRef","recentChaptersRef","timerRefs","nextCoachmark","setJourney","endJourney","useJourney","emptyFunction","useCallback","handleEndJourney","handleNextCoachmark","startJourney","studentId","stream","userType","title","subtext","HOMEWORK_DETAILS","isStudent","homepageSteps","IndicatorType","jsxs","FlexView","jsx","HwCardListView","Text","_a","RECENT_CHAPTERS","ChaptersWrapper","chapter","idx","ChapterItem","MilestoneListContainer","TooltipItem","ELementWrapper","HomeworkCard","_b","delayBeforeStart","data","useMemo","useEffect","timer"],"mappings":";;;;;;;;;;;;;;;AAuBO,MAAMA,KAAqB,MAAM;AACtC,QAAMC,IAAYC,EAAmB,kBAE/BC,IAAcC,EAAuB,IAAI,GACzCC,IAAcD,EAAuB,IAAI,GACzCE,IAAoBF,EAAuB,IAAI,GAC/CG,IAAYH,EAAwC,CAAA,CAAE,GACtD,EAAE,eAAAI,GAAe,YAAAC,GAAY,YAAAC,MAAeC,EAAW,GAEvDC,IAAgBC,EAAY,MAAM,MAAM,CAAE,CAAA,GAE1CC,IAAmBD,EAAY,MAAM;AACzC,IAAAH,EAAWT,CAAS,GACX,SAAA,KAAK,MAAM,WAAW;AAAA,EAAA,GAC9B,CAACS,GAAYT,CAAS,CAAC,GAEpBc,IAAsBF,EAAY,MAAM;AAC9B,IAAAL,EAAAP,GAAW,IAAO,GAAG,EAAI;AAAA,EAAA,GACtC,CAACO,GAAeP,CAAS,CAAC,GAEvBe,IAAeH;AAAA,IACnB,CAAC,EAAE,WAAAI,GAAW,QAAAC,GAAQ,UAAAC,QAA2C;;AAC/D,YAAM,EAAE,OAAAC,GAAO,SAAAC,EAAQ,IAAIC,EAAiB,CAAC,GACvCC,IAAYJ,MAAa;AAE/B,UAAI,EAAChB,KAAA,QAAAA,EAAa,YAAW,EAACE,KAAA,QAAAA,EAAa;AACzC;AAGF,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AAY;AAAA,EAAA;AAIf,SAAA6B,EAAU,MACD,MAAM;AACX,IAAAtC,EAAU,QAAQ,QAAQ,CAASuC,MAAA,aAAaA,CAAK,CAAC,GACtDvC,EAAU,UAAU;EAAC,GAEtB,CAAE,CAAA,GAEEoC;AACT;"}
package/dist/index.d.ts CHANGED
@@ -2409,38 +2409,38 @@ export declare interface INodeDataProps {
2409
2409
  attempt_location: TSheetAttemptLocation_2;
2410
2410
  block_id: string;
2411
2411
  card_header: string;
2412
- chapter_id: string | null;
2413
- chapter_name?: string;
2412
+ chapter_id: string;
2414
2413
  complete_status: boolean;
2415
2414
  course_type: TCourseType;
2416
2415
  desmos_calculator_enabled: boolean;
2417
2416
  due_date_ts: number | null;
2418
- homework_id?: string;
2419
- id: string;
2420
- image_hue: THueNames;
2421
- image_url: string | null;
2422
2417
  is_lesson_v3_enabled: boolean;
2423
2418
  is_optional: boolean;
2424
2419
  is_timed: boolean;
2425
2420
  is_worksheet_v3: boolean | null;
2426
- items?: TNodeDataTestItemsDataProps[];
2427
2421
  learnosity_activity_ref: string;
2428
2422
  marked_as_completed: boolean;
2429
2423
  node_id: string;
2424
+ id: string;
2430
2425
  node_type: TNodeTypes_2;
2431
- permissions: INodePermissions;
2432
2426
  sheet_statement: string;
2427
+ permissions: INodePermissions;
2433
2428
  sheet_time: number | null;
2434
2429
  state: TSheetStates;
2435
- subtext: string | null;
2436
2430
  title: string;
2437
- total_questions: number | null;
2438
- unlocked_on_ts: number | null;
2439
- user_attempt_id: string | null;
2440
2431
  user_chapter_id: string | null;
2441
- user_milestone_id?: string;
2442
2432
  user_node_id: string | null;
2443
2433
  worksheet_id: string;
2434
+ image_url: string;
2435
+ image_hue: THueNames;
2436
+ total_questions: number | null;
2437
+ unlocked_on_ts: number | null;
2438
+ items?: TNodeDataTestItemsDataProps[];
2439
+ user_milestone_id?: string;
2440
+ user_attempt_id: string | null;
2441
+ subtext: string | null;
2442
+ homework_id?: string;
2443
+ chapter_name?: string;
2444
2444
  }
2445
2445
 
2446
2446
  declare interface INodePermissions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.1.1-beta-0.2",
3
+ "version": "3.1.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,8 +0,0 @@
1
- const r = (t) => {
2
- const { assigned_homeworks: o = [], queued_homeworks: s = [] } = t || {};
3
- return o.filter((e) => e.state === "WAIT_FOR_REVIEW").length + s.filter((e) => e.state === "WAIT_FOR_REVIEW").length;
4
- };
5
- export {
6
- r as getWaitForReviewSheetsCount
7
- };
8
- //# sourceMappingURL=hw-card-list-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hw-card-list-utils.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-utils.ts"],"sourcesContent":["import type { IHomeworkDetails } from './api/get-homeworks';\n\nconst getWaitForReviewSheetsCount = (hwDetails: IHomeworkDetails | undefined): number => {\n const { assigned_homeworks: assignedHomeworks = [], queued_homeworks: queuedHomeworks = [] } =\n hwDetails || {};\n\n return (\n assignedHomeworks.filter(hw => hw.state === 'WAIT_FOR_REVIEW').length +\n queuedHomeworks.filter(hw => hw.state === 'WAIT_FOR_REVIEW').length\n );\n};\n\nexport { getWaitForReviewSheetsCount };\n"],"names":["getWaitForReviewSheetsCount","hwDetails","assignedHomeworks","queuedHomeworks","hw"],"mappings":"AAEM,MAAAA,IAA8B,CAACC,MAAoD;AACjF,QAAA,EAAE,oBAAoBC,IAAoB,IAAI,kBAAkBC,IAAkB,CAAC,EAAA,IACvFF,KAAa;AAEf,SACEC,EAAkB,OAAO,CAAME,MAAAA,EAAG,UAAU,iBAAiB,EAAE,SAC/DD,EAAgB,OAAO,CAAAC,MAAMA,EAAG,UAAU,iBAAiB,EAAE;AAEjE;"}