@cuemath/leap 3.2.16-pzd-beta-0.1 → 3.2.16-pzd-beta-0.3

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.
@@ -21,7 +21,7 @@ const I = () => {
21
21
  type: T.TOOLTIP,
22
22
  indicator: {
23
23
  renderAs: "primary",
24
- tooltipXCoOrdinates: 14,
24
+ tooltipXCoOrdinates: 42,
25
25
  tooltipYCoOrdinates: 36,
26
26
  arrowSize: 12,
27
27
  arrowYCoOrdinates: -36,
@@ -1 +1 @@
1
- {"version":3,"file":"use-puzzle-dashboard-journey.js","sources":["../../../../../src/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport Avatar from '../../../ui/avatar/avatar';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport { useJourney } from '../../use-journey/use-journey';\nimport TooltipItem from '../use-home-page-journey/tooltip-item';\n\nconst usePuzzleDashboardJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.PUZZLE_DASHBOARD_JOURNEY;\n\n const puzzleProfileRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, endJourney, nextCoachmark } = useJourney();\n\n const handleNextCoachMark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, false);\n }, [journeyId, nextCoachmark]);\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n endJourney(journeyId);\n }, [endJourney, journeyId]);\n\n const startJourney = useCallback(\n (avatar: IAvatarLayer[]) => {\n if (!puzzleProfileRef?.current) {\n return;\n }\n\n const puzzleAttemptSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleProfileRef,\n elementToHighlight: (\n <div>\n <Avatar size={55} avatar={avatar} />\n </div>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n renderAs: 'primary',\n tooltipXCoOrdinates: 14,\n tooltipYCoOrdinates: 36,\n arrowSize: 12,\n arrowYCoOrdinates: -36,\n position: 'right',\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n text=\"Click here to see all previously solved puzzles.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, puzzleAttemptSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n handleNextCoachMark();\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [handleEndJourney, handleNextCoachMark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n puzzleProfileRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { usePuzzleDashboardJourney };\n"],"names":["usePuzzleDashboardJourney","journeyId","JOURNEY_ID_STUDENT","puzzleProfileRef","useRef","timerRefs","setJourney","endJourney","nextCoachmark","useJourney","handleNextCoachMark","useCallback","handleEndJourney","startJourney","avatar","puzzleAttemptSteps","jsx","Avatar","IndicatorType","TooltipItem","delayBeforeStart","useMemo"],"mappings":";;;;;;;AAYA,MAAMA,IAA4B,MAAM;AACtC,QAAMC,IAAYC,EAAmB,0BAE/BC,IAAmBC,EAAuB,IAAI,GAC9CC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAE,GAAY,YAAAC,GAAY,eAAAC,MAAkBC,EAAW,GAEvDC,IAAsBC,EAAY,MAAM;AAC9B,IAAAH,EAAAP,GAAW,IAAO,GAAG,EAAK;AAAA,EAAA,GACvC,CAACA,GAAWO,CAAa,CAAC,GAEvBI,IAAmBD,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAC/BJ,EAAWN,CAAS;AAAA,EAAA,GACnB,CAACM,GAAYN,CAAS,CAAC,GAEpBY,IAAeF;AAAA,IACnB,CAACG,MAA2B;AACtB,UAAA,EAACX,KAAA,QAAAA,EAAkB;AACrB;AAGF,YAAMY,IAAwC;AAAA,QAC5C;AAAA,UACE,+BAA+BZ;AAAA,UAC/B,sCACG,OACC,EAAA,UAAA,gBAAAa,EAACC,KAAO,MAAM,IAAI,QAAAH,GAAgB,EACpC,CAAA;AAAA,UAEF,MAAMI,EAAc;AAAA,UACpB,WAAW;AAAA,YACT,UAAU;AAAA,YACV,qBAAqB;AAAA,YACrB,qBAAqB;AAAA,YACrB,WAAW;AAAA,YACX,mBAAmB;AAAA,YACnB,UAAU;AAAA,YACV,iBAAiB;AAAA,YACjB,aAAa;AAAA,YACb,YAAY;AAAA,YACZ,aACE,gBAAAF;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,eAAeP;AAAA,cAAA;AAAA,YACjB;AAAA,UAEJ;AAAA,UACA,UAAU;AAAA,QACZ;AAAA,MAAA;AAGF,MAAAN,EAAWL,GAAWc,CAAkB;AAElC,YAAAK,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UACXV;SACnB,GAAG;AAEI,MAAAL,EAAA,QAAQ,KAAKe,CAAgB;AAAA,IACzC;AAAA,IACA,CAACR,GAAkBF,GAAqBT,GAAWK,CAAU;AAAA,EAAA;AAWxD,SARMe;AAAA,IACX,OAAO;AAAA,MACL,kBAAAlB;AAAA,MACA,cAAAU;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
1
+ {"version":3,"file":"use-puzzle-dashboard-journey.js","sources":["../../../../../src/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport { useCallback, useMemo, useRef } from 'react';\n\nimport Avatar from '../../../ui/avatar/avatar';\nimport { JOURNEY_ID_STUDENT } from '../../journey-id/journey-id-student';\nimport { IndicatorType } from '../../use-journey/constants';\nimport { useJourney } from '../../use-journey/use-journey';\nimport TooltipItem from '../use-home-page-journey/tooltip-item';\n\nconst usePuzzleDashboardJourney = () => {\n const journeyId = JOURNEY_ID_STUDENT.PUZZLE_DASHBOARD_JOURNEY;\n\n const puzzleProfileRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const timerRefs = useRef<ReturnType<typeof setTimeout>[]>([]);\n\n const { setJourney, endJourney, nextCoachmark } = useJourney();\n\n const handleNextCoachMark = useCallback(() => {\n nextCoachmark(journeyId, false, 0, false);\n }, [journeyId, nextCoachmark]);\n\n const handleEndJourney = useCallback(() => {\n document.body.style.overflow = 'unset';\n endJourney(journeyId);\n }, [endJourney, journeyId]);\n\n const startJourney = useCallback(\n (avatar: IAvatarLayer[]) => {\n if (!puzzleProfileRef?.current) {\n return;\n }\n\n const puzzleAttemptSteps: ICoachmarkProps[] = [\n {\n originalElementToHighlightRef: puzzleProfileRef,\n elementToHighlight: (\n <div>\n <Avatar size={55} avatar={avatar} />\n </div>\n ),\n type: IndicatorType.TOOLTIP,\n indicator: {\n renderAs: 'primary',\n tooltipXCoOrdinates: 42,\n tooltipYCoOrdinates: 36,\n arrowSize: 12,\n arrowYCoOrdinates: -36,\n position: 'right',\n backgroundColor: 'BLUE_4',\n borderColor: 'BLACK',\n arrowColor: 'BLACK',\n tooltipItem: (\n <TooltipItem\n text=\"Click here to see all previously solved puzzles.\"\n buttonLabel=\"Got it\"\n onButtonClick={handleEndJourney}\n />\n ),\n } as IArrowTooltipProps,\n isActive: false,\n },\n ];\n\n setJourney(journeyId, puzzleAttemptSteps);\n\n const delayBeforeStart = setTimeout(() => {\n clearTimeout(delayBeforeStart);\n document.body.style.overflow = 'hidden';\n handleNextCoachMark();\n }, 500);\n\n timerRefs.current.push(delayBeforeStart);\n },\n [handleEndJourney, handleNextCoachMark, journeyId, setJourney],\n );\n\n const data = useMemo(\n () => ({\n puzzleProfileRef,\n startJourney,\n }),\n [startJourney],\n );\n\n return data;\n};\n\nexport { usePuzzleDashboardJourney };\n"],"names":["usePuzzleDashboardJourney","journeyId","JOURNEY_ID_STUDENT","puzzleProfileRef","useRef","timerRefs","setJourney","endJourney","nextCoachmark","useJourney","handleNextCoachMark","useCallback","handleEndJourney","startJourney","avatar","puzzleAttemptSteps","jsx","Avatar","IndicatorType","TooltipItem","delayBeforeStart","useMemo"],"mappings":";;;;;;;AAYA,MAAMA,IAA4B,MAAM;AACtC,QAAMC,IAAYC,EAAmB,0BAE/BC,IAAmBC,EAAuB,IAAI,GAC9CC,IAAYD,EAAwC,CAAA,CAAE,GAEtD,EAAE,YAAAE,GAAY,YAAAC,GAAY,eAAAC,MAAkBC,EAAW,GAEvDC,IAAsBC,EAAY,MAAM;AAC9B,IAAAH,EAAAP,GAAW,IAAO,GAAG,EAAK;AAAA,EAAA,GACvC,CAACA,GAAWO,CAAa,CAAC,GAEvBI,IAAmBD,EAAY,MAAM;AAChC,aAAA,KAAK,MAAM,WAAW,SAC/BJ,EAAWN,CAAS;AAAA,EAAA,GACnB,CAACM,GAAYN,CAAS,CAAC,GAEpBY,IAAeF;AAAA,IACnB,CAACG,MAA2B;AACtB,UAAA,EAACX,KAAA,QAAAA,EAAkB;AACrB;AAGF,YAAMY,IAAwC;AAAA,QAC5C;AAAA,UACE,+BAA+BZ;AAAA,UAC/B,sCACG,OACC,EAAA,UAAA,gBAAAa,EAACC,KAAO,MAAM,IAAI,QAAAH,GAAgB,EACpC,CAAA;AAAA,UAEF,MAAMI,EAAc;AAAA,UACpB,WAAW;AAAA,YACT,UAAU;AAAA,YACV,qBAAqB;AAAA,YACrB,qBAAqB;AAAA,YACrB,WAAW;AAAA,YACX,mBAAmB;AAAA,YACnB,UAAU;AAAA,YACV,iBAAiB;AAAA,YACjB,aAAa;AAAA,YACb,YAAY;AAAA,YACZ,aACE,gBAAAF;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,aAAY;AAAA,gBACZ,eAAeP;AAAA,cAAA;AAAA,YACjB;AAAA,UAEJ;AAAA,UACA,UAAU;AAAA,QACZ;AAAA,MAAA;AAGF,MAAAN,EAAWL,GAAWc,CAAkB;AAElC,YAAAK,IAAmB,WAAW,MAAM;AACxC,qBAAaA,CAAgB,GACpB,SAAA,KAAK,MAAM,WAAW,UACXV;SACnB,GAAG;AAEI,MAAAL,EAAA,QAAQ,KAAKe,CAAgB;AAAA,IACzC;AAAA,IACA,CAACR,GAAkBF,GAAqBT,GAAWK,CAAU;AAAA,EAAA;AAWxD,SARMe;AAAA,IACX,OAAO;AAAA,MACL,kBAAAlB;AAAA,MACA,cAAAU;AAAA,IAAA;AAAA,IAEF,CAACA,CAAY;AAAA,EAAA;AAIjB;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.2.16-pzd-beta-0.1",
3
+ "version": "3.2.16-pzd-beta-0.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"