@cuemath/leap 3.2.19-beta-0.1 → 3.2.19-link.0
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.
- package/dist/assets/illustrations/illustrations.js +6 -6
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/star3.js +32 -0
- package/dist/assets/line-icons/icons/star3.js.map +1 -0
- package/dist/assets/lottie/lottie.js +0 -5
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +1 -2
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +4 -6
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +8 -10
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +2 -2
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +4 -7
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +97 -85
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +42 -44
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +29 -31
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +48 -54
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +27 -33
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +11 -17
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/puzzles/app/puzzle-app-styled.js +6 -10
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card-styled.js +69 -24
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +30 -79
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +25 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +107 -100
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js +1 -1
- package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map +1 -1
- package/dist/features/puzzles/utils/puzzle-pattern.js +13 -28
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +7 -50
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +15 -69
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +49 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +1 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +64 -0
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +28 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +1 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +83 -0
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +1 -0
- package/dist/features/ui/accordion/accordion.js +62 -0
- package/dist/features/ui/accordion/accordion.js.map +1 -0
- package/dist/features/ui/inputs/base-input/base-input.js +11 -11
- package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
- package/dist/features/ui/inputs/text-input/text-input.js +19 -18
- package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +42 -8
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +37 -27
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/text/text.js +31 -29
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/clrs.js +2 -0
- package/dist/features/ui/theme/clrs.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +19 -20
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +12 -16
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +47 -101
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +146 -149
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +207 -242
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +313 -307
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +35 -44
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +71 -89
- package/dist/index.js +626 -626
- package/dist/static/puzzle-pattern-blue.f4bea1ee.svg +1 -0
- package/dist/static/puzzle-pattern-green.c9f84bbc.svg +1 -0
- package/dist/static/puzzle-pattern-orange.3da09665.svg +1 -0
- package/dist/static/puzzle-pattern-purple.5fb5a319.svg +1 -0
- package/dist/static/puzzle-pattern-yellow.aadbf457.svg +1 -0
- package/dist/static/stripe-blurple.6abf422f.svg +1 -0
- package/package.json +2 -3
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +0 -72
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +0 -63
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +0 -67
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +0 -59
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +0 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +0 -70
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +0 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +0 -10
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +0 -1
- package/dist/features/puzzles/constants/puzzle-container.js +0 -8
- package/dist/features/puzzles/constants/puzzle-container.js.map +0 -1
- package/dist/features/puzzles/puzzle-analytics-events.js +0 -11
- package/dist/features/puzzles/puzzle-analytics-events.js.map +0 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +0 -55
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +0 -37
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +0 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +0 -110
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +0 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +0 -28
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +0 -1
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +0 -1
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +0 -12760
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +0 -1
- package/dist/static/puzzle-green-lottie.1da90698.json +0 -1
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +0 -1
- package/dist/static/puzzle-pattern-blue.abff0164.svg +0 -1
- package/dist/static/puzzle-pattern-green.b8ba1840.svg +0 -1
- package/dist/static/puzzle-pattern-orange.3f5a17ff.svg +0 -1
- package/dist/static/puzzle-pattern-purple.14b09759.svg +0 -1
- package/dist/static/puzzle-pattern-yellow.50917fab.svg +0 -1
- package/dist/static/puzzle-purple-lottie.e70de110.json +0 -9860
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-container.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../ui/lottie-animation/types';\nimport type { IPuzzleCardContainerProps } from './puzzle-container-types';\nimport type { AnimationEventName, BMEnterFrameEvent } from 'lottie-web';\nimport type { FC } from 'react';\n\nimport { useState, useCallback, useEffect, useRef, memo, useMemo } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport { usePostPuzzleToAssign } from '../api/puzzle-assign';\nimport { PUZZLE_ASSIGN_ANIMATION } from '../constants/puzzle-container';\nimport { getPuzzleCardLottie } from '../utils/puzzle-pattern';\nimport * as Styled from './puzzle-container-styled';\nimport PuzzleAssigned from './puzzle-container-view';\n\nconst modeRevealAnimationSettings = {\n loop: false,\n renderer: 'svg',\n autoPlay: false,\n};\n\nconst PuzzleCardContainer: FC<IPuzzleCardContainerProps> = memo(\n ({\n triggerReveal = false,\n onFullyHidden,\n onPuzzleClick,\n puzzleData,\n courseStream,\n studentId,\n }) => {\n const {\n image_hue: imageHue,\n image_url: imageUrl,\n assigned: externalAssigned,\n title,\n id: puzzleId,\n node_id: nodeId,\n student_elo_rating,\n current_elo_rating,\n } = puzzleData;\n\n const [showPuzzleInfo, setShowPuzzleInfo] = useState(externalAssigned);\n\n const assignLottieRef = useRef<ILottieAnimationRef | null>(null);\n const puzzleLottieSrc = useMemo(() => getPuzzleCardLottie(imageHue), [imageHue]);\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n node_type: 'PUZZLE_CARD',\n student_elo_rating,\n current_elo_rating,\n }),\n [nodeId, student_elo_rating, current_elo_rating],\n );\n\n const { post: postPuzzleToAssign, isProcessing } = usePostPuzzleToAssign({\n onComplete: (error: string | null) => {\n if (error) {\n // Handle error (e.g., show a notification)\n setShowPuzzleInfo(true);\n } else {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL_ASSIGNED, false);\n\n setShowPuzzleInfo(false);\n }\n },\n });\n\n useEffect(() => {\n if (!externalAssigned) {\n if (triggerReveal) {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL, true);\n } else {\n assignLottieRef.current?.stop();\n setShowPuzzleInfo(false);\n }\n }\n }, [externalAssigned, triggerReveal]);\n\n const handleAssign = useCallback(() => {\n if (externalAssigned) return;\n\n postPuzzleToAssign(\n {\n puzzle_id: puzzleId,\n },\n {\n studentId,\n courseStream,\n },\n );\n }, [courseStream, externalAssigned, postPuzzleToAssign, puzzleId, studentId]);\n\n const handleOnPuzzleClick = useCallback(() => {\n onPuzzleClick();\n }, [onPuzzleClick]);\n\n const showPuzzleLottie = useCallback(() => {\n assignLottieRef.current?.playSegments(PUZZLE_ASSIGN_ANIMATION.REVEAL, true);\n }, []);\n\n const onAnimationFinish = useMemo(\n () => ({\n name: 'enterFrame' as AnimationEventName,\n callback: (event: BMEnterFrameEvent) => {\n const { currentTime } = event;\n\n if (currentTime === 49) {\n setShowPuzzleInfo(true);\n }\n\n if (currentTime === 101) {\n onFullyHidden?.();\n }\n },\n }),\n [onFullyHidden],\n );\n\n if (!triggerReveal) {\n return null;\n }\n\n if (externalAssigned) {\n return (\n <Styled.PuzzleContainer $justifyContent=\"center\">\n <Styled.PuzzleAssignedWrapper\n $imageHue={imageHue}\n $background={`${imageHue}_2`}\n $widthX={15.9375}\n >\n <PuzzleAssigned\n imageUrl={imageUrl}\n handleOnPuzzleClick={handleOnPuzzleClick}\n title={title}\n assigned\n />\n </Styled.PuzzleAssignedWrapper>\n </Styled.PuzzleContainer>\n );\n }\n\n return (\n <Styled.PuzzleContainer>\n <FlexView $heightX={26}>\n <LottieAnimation\n src={puzzleLottieSrc}\n ref={assignLottieRef}\n settings={modeRevealAnimationSettings}\n onRender={showPuzzleLottie}\n eventListener={onAnimationFinish}\n animateOnIntersect\n />\n\n <Styled.PuzzleContentWrapper $visible={showPuzzleInfo} $position=\"absolute\">\n <PuzzleAssigned\n imageUrl={imageUrl}\n title={title}\n handleOnPuzzleClick={handleOnPuzzleClick}\n handleAssign={handleAssign}\n assigning={isProcessing}\n analyticsProps={analyticsProps}\n />\n </Styled.PuzzleContentWrapper>\n </FlexView>\n </Styled.PuzzleContainer>\n );\n },\n);\n\nexport default PuzzleCardContainer;\n"],"names":["modeRevealAnimationSettings","PuzzleCardContainer","memo","triggerReveal","onFullyHidden","onPuzzleClick","puzzleData","courseStream","studentId","imageHue","imageUrl","externalAssigned","title","puzzleId","nodeId","student_elo_rating","current_elo_rating","showPuzzleInfo","setShowPuzzleInfo","useState","assignLottieRef","useRef","puzzleLottieSrc","useMemo","getPuzzleCardLottie","analyticsProps","postPuzzleToAssign","isProcessing","usePostPuzzleToAssign","error","_a","PUZZLE_ASSIGN_ANIMATION","useEffect","_b","handleAssign","useCallback","handleOnPuzzleClick","showPuzzleLottie","onAnimationFinish","event","currentTime","jsx","Styled.PuzzleContainer","Styled.PuzzleAssignedWrapper","PuzzleAssigned","jsxs","FlexView","LottieAnimation","Styled.PuzzleContentWrapper","PuzzleCardContainer$1"],"mappings":";;;;;;;;;AAeA,MAAMA,IAA8B;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ,GAEMC,IAAqDC;AAAA,EACzD,CAAC;AAAA,IACC,eAAAC,IAAgB;AAAA,IAChB,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,MACI;AACE,UAAA;AAAA,MACJ,WAAWC;AAAA,MACX,WAAWC;AAAA,MACX,UAAUC;AAAA,MACV,OAAAC;AAAA,MACA,IAAIC;AAAA,MACJ,SAASC;AAAA,MACT,oBAAAC;AAAA,MACA,oBAAAC;AAAA,IACE,IAAAV,GAEE,CAACW,GAAgBC,CAAiB,IAAIC,EAASR,CAAgB,GAE/DS,IAAkBC,EAAmC,IAAI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BAAA,EAAE,aAAAC,EAAgB,IAAAD;AAExB,UAAIC,MAAgB,MAClBtB,EAAkB,EAAI,GAGpBsB,MAAgB,QACFpC,KAAA,QAAAA;AAAA,QAEpB;AAAA,MAAA;AAAA,MAEF,CAACA,CAAa;AAAA,IAAA;AAGhB,WAAKD,IAIDQ,IAEC,gBAAA8B,EAAAC,GAAA,EAAuB,iBAAgB,UACtC,UAAA,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACC,WAAWlC;AAAA,QACX,aAAa,GAAGA,CAAQ;AAAA,QACxB,SAAS;AAAA,QAET,UAAA,gBAAAgC;AAAA,UAACG;AAAAA,UAAA;AAAA,YACC,UAAAlC;AAAA,YACA,qBAAA0B;AAAA,YACA,OAAAxB;AAAA,YACA,UAAQ;AAAA,UAAA;AAAA,QACV;AAAA,MAAA;AAAA,IAEJ,EAAA,CAAA,sBAKD8B,GAAA,EACC,UAAC,gBAAAG,EAAAC,GAAA,EAAS,UAAU,IAClB,UAAA;AAAA,MAAA,gBAAAL;AAAA,QAACM;AAAA,QAAA;AAAA,UACC,KAAKzB;AAAA,UACL,KAAKF;AAAA,UACL,UAAUpB;AAAA,UACV,UAAUqC;AAAA,UACV,eAAeC;AAAA,UACf,oBAAkB;AAAA,QAAA;AAAA,MACpB;AAAA,wBAECU,GAAA,EAA4B,UAAU/B,GAAgB,WAAU,YAC/D,UAAA,gBAAAwB;AAAA,QAACG;AAAAA,QAAA;AAAA,UACC,UAAAlC;AAAA,UACA,OAAAE;AAAA,UACA,qBAAAwB;AAAA,UACA,cAAAF;AAAA,UACA,WAAWP;AAAA,UACX,gBAAAF;AAAA,QAAA;AAAA,MAAA,GAEJ;AAAA,IAAA,EACF,CAAA,EACF,CAAA,IA7CO;AAAA,EA+CX;AACF,GAEAwB,KAAehD;"}
|
1
|
+
{"version":3,"file":"puzzle-container.js","sources":["../../../../src/features/puzzles/puzzle-container/puzzle-container.tsx"],"sourcesContent":["import type { TPuzzleCardAnimationPhases } from '../comps/puzzle-card-types';\nimport type { IPuzzleCardContainerProps } from './puzzle-container-types';\nimport type { FC } from 'react';\n\nimport { useState, useCallback, useEffect, useRef, memo } from 'react';\n\nimport Check2Icon from '../../../assets/line-icons/icons/check2';\nimport Image from '../../ui/image/image';\nimport Text from '../../ui/text/text';\nimport { usePostPuzzleToAssign } from '../api/puzzle-assign';\nimport PuzzleCard from '../comps/puzzle-card';\nimport * as Styled from './puzzle-container-styled';\n\nconst ASSIGNED_DISPLAY_DURATION = 1500; // ms\n\nconst PuzzleCardContainer: FC<IPuzzleCardContainerProps> = memo(\n ({\n userType,\n triggerReveal = false,\n onFullyHidden,\n onPuzzleClick,\n puzzleData,\n courseStream,\n studentId,\n }) => {\n const {\n image_hue: imageHue,\n image_url: imageUrl,\n assigned: externalAssigned,\n title,\n id: puzzleId,\n } = puzzleData;\n\n const [animationPhase, setAnimationPhase] = useState<TPuzzleCardAnimationPhases>('hidden');\n const [isAssigned, setIsAssigned] = useState(false);\n\n const assignedTimer = useRef<NodeJS.Timeout | null>(null);\n\n const { post: postPuzzleToAssign, isProcessing } = usePostPuzzleToAssign({\n onComplete: (error: string | null) => {\n if (error) {\n // Handle error (e.g., show a notification)\n setAnimationPhase('visible'); // Reset to visible if assignment fails\n } else {\n if (animationPhase === 'visible') {\n setAnimationPhase('assigning');\n }\n }\n },\n });\n\n // Main trigger to start or hide the card\n useEffect(() => {\n if (!externalAssigned) {\n if (triggerReveal) {\n if (isAssigned) {\n setAnimationPhase('assigned'); // Already assigned, show statically\n } else if (animationPhase === 'hidden') {\n setAnimationPhase('movingIn'); // Start the animation sequence\n }\n } else {\n // If trigger is removed, start hiding (unless already hidden/hiding)\n if (animationPhase !== 'hidden' && animationPhase !== 'movingOut') {\n setAnimationPhase('movingOut');\n }\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [triggerReveal, isAssigned, externalAssigned]);\n\n // Timer to auto-hide after the 'assigned' phase\n useEffect(() => {\n if (animationPhase === 'assigned' && !externalAssigned) {\n assignedTimer.current = setTimeout(() => {\n setAnimationPhase('movingOut');\n }, ASSIGNED_DISPLAY_DURATION);\n }\n\n return () => {\n if (assignedTimer.current) clearTimeout(assignedTimer.current);\n };\n }, [animationPhase, externalAssigned]);\n\n // State machine for animations\n const handleAnimationEnd = useCallback(() => {\n switch (animationPhase) {\n case 'movingIn':\n setAnimationPhase('revealing');\n break;\n case 'revealing':\n setAnimationPhase('visible');\n break;\n case 'assigning':\n setAnimationPhase('assigned');\n setIsAssigned(true);\n break;\n case 'movingOut':\n setAnimationPhase('hidden');\n onFullyHidden?.();\n break;\n default:\n break;\n }\n }, [animationPhase, onFullyHidden]);\n\n const handleAssign = useCallback(() => {\n if (externalAssigned) return; // Do nothing if already assigned\n\n postPuzzleToAssign(\n {\n puzzle_id: puzzleId,\n },\n {\n studentId,\n courseStream,\n },\n );\n }, [courseStream, externalAssigned, postPuzzleToAssign, puzzleId, studentId]);\n\n const handleOnPuzzleClick = useCallback(() => {\n onPuzzleClick();\n }, [onPuzzleClick]);\n\n // Render content only during specific phases\n const renderContent = () => {\n if (animationPhase === 'visible' || externalAssigned) {\n return (\n <>\n <Styled.PuzzleContent\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n onClick={handleOnPuzzleClick}\n title=\"Click to preview\"\n $flexGapX={1.5}\n >\n <Image width={136} height={136} src={imageUrl} withLoader={false} alt=\"Puzzle\" />\n <Text $renderAs=\"h4\">{title}</Text>\n\n {externalAssigned && (\n <Styled.AssignedTag $gap={4} $gutter={8} $background=\"BLACK_1\">\n <Text $renderAs=\"ac4\" $color=\"WHITE_1\">\n Assigned\n </Text>\n </Styled.AssignedTag>\n )}\n </Styled.PuzzleContent>\n\n {userType === 'TEACHER' && (\n <Styled.PuzzleButton\n $background=\"BLACK_1\"\n $widthX={15.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gapX={0.75}\n $gutterX={1}\n onClick={handleAssign}\n $disabled={externalAssigned || isProcessing}\n >\n <Text $renderAs=\"ub1-bold\" $color={externalAssigned ? 'BLACK_T_38' : 'WHITE_1'}>\n {externalAssigned ? 'Discuss in next class' : 'Assign'}\n </Text>\n </Styled.PuzzleButton>\n )}\n </>\n );\n }\n\n if (animationPhase === 'assigned') {\n return (\n <Styled.PuzzleText $alignItems=\"center\" $justifyContent=\"center\" $flexGap={8}>\n <Styled.CheckMarkIcon\n $widthX={2.5}\n $heightX={2.5}\n $background=\"WHITE\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <Check2Icon />\n </Styled.CheckMarkIcon>\n\n <Text $renderAs=\"ab1-bold\" $align=\"center\" $color=\"WHITE\">\n Puzzle assigned\n </Text>\n </Styled.PuzzleText>\n );\n }\n\n // No content during animations\n return null;\n };\n\n if (animationPhase === 'hidden' && !triggerReveal) {\n return null;\n }\n\n return (\n <Styled.PuzzleContainer>\n <PuzzleCard\n animationPhase={!externalAssigned ? animationPhase : undefined}\n onAnimationEnd={handleAnimationEnd}\n imageHue={imageHue ?? 'BLUE'}\n heightX={19}\n widthX={15.75}\n backgroundColor={externalAssigned ? `${imageHue}_2` : undefined}\n >\n {renderContent()}\n </PuzzleCard>\n </Styled.PuzzleContainer>\n );\n },\n);\n\nexport default PuzzleCardContainer;\n"],"names":["ASSIGNED_DISPLAY_DURATION","PuzzleCardContainer","memo","userType","triggerReveal","onFullyHidden","onPuzzleClick","puzzleData","courseStream","studentId","imageHue","imageUrl","externalAssigned","title","puzzleId","animationPhase","setAnimationPhase","useState","isAssigned","setIsAssigned","assignedTimer","useRef","postPuzzleToAssign","isProcessing","usePostPuzzleToAssign","error","useEffect","handleAnimationEnd","useCallback","handleAssign","handleOnPuzzleClick","renderContent","jsxs","Fragment","Styled.PuzzleContent","jsx","Image","Text","Styled.AssignedTag","Styled.PuzzleButton","Styled.PuzzleText","Styled.CheckMarkIcon","Check2Icon","Styled.PuzzleContainer","PuzzleCard","PuzzleCardContainer$1"],"mappings":";;;;;;;;AAaA,MAA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A,UACZ,iBAAgB;AAAA,UAChB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,SAASV;AAAA,UACT,WAAWjB,KAAoBW;AAAA,UAE/B,UAAA,gBAAAY,EAACE,GAAK,EAAA,WAAU,YAAW,QAAQzB,IAAmB,eAAe,WAClE,UAAmBA,IAAA,0BAA0B,SAChD,CAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ,EAAA,CAAA,IAIAG,MAAmB,aAEnB,gBAAAiB,EAACQ,GAAA,EAAkB,aAAY,UAAS,iBAAgB,UAAS,UAAU,GACzE,UAAA;AAAA,MAAA,gBAAAL;AAAA,QAACM;AAAAA,QAAA;AAAA,UACC,SAAS;AAAA,UACT,UAAU;AAAA,UACV,aAAY;AAAA,UACZ,aAAY;AAAA,UACZ,iBAAgB;AAAA,UAEhB,4BAACC,GAAW,EAAA;AAAA,QAAA;AAAA,MACd;AAAA,MAEA,gBAAAP,EAACE,KAAK,WAAU,YAAW,QAAO,UAAS,QAAO,SAAQ,UAE1D,kBAAA,CAAA;AAAA,IACF,EAAA,CAAA,IAKG;AAGL,WAAAtB,MAAmB,YAAY,CAACX,IAC3B,OAIP,gBAAA+B,EAACQ,GAAA,EACC,UAAA,gBAAAR;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,gBAAiBhC,IAAoC,SAAjBG;AAAA,QACpC,gBAAgBY;AAAA,QAChB,UAAUjB,KAAY;AAAA,QACtB,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,iBAAiBE,IAAmB,GAAGF,CAAQ,OAAO;AAAA,QAErD,UAAcqB,EAAA;AAAA,MAAA;AAAA,IAEnB,EAAA,CAAA;AAAA,EAEJ;AACF,GAEAc,IAAe5C;"}
|
package/dist/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-feedback-celebration.js","sources":["../../../../src/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.tsx"],"sourcesContent":["import type { IPuzzleFeedbackCelebration } from './puzzle-feedback-celebration-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport useModalActions from '../../ui/modals/use-modal-actions';\nimport useModalParams from '../../ui/modals/use-modal-params';\nimport { getPuzzleStickerLottie } from '../utils/puzzle-feedback-celebration';\nimport * as Styled from './puzzle-feedback-celebration-styled';\n\nconst puzzleStickerLottieSettings = {\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PuzzleFeedbackCelebration: FC = () => {\n const { closeModal } = useModalActions();\n const { feedbackComments, rewards, onCloseModal } = useModalParams<IPuzzleFeedbackCelebration>();\n\n const [showHeader, setShowHeader] = useState(false);\n const [showLottie, setShowLottie] = useState(false);\n const [showText, setShowText] = useState(false);\n const [showButton, setShowButton] = useState(false);\n\n const { sticker } = rewards[0] || {};\n\n const stickerLottie = sticker ? getPuzzleStickerLottie(sticker) : undefined;\n\n const handleCloseModal = useCallback(() => {\n onCloseModal?.();\n closeModal();\n }, [closeModal, onCloseModal]);\n\n useEffect(() => {\n // Sequence: Header -> Lottie -> Text -> Button\n const headerTimer = setTimeout(() => {\n setShowHeader(true);\n }, 100);\n\n const lottieTimer = setTimeout(() => {\n setShowLottie(true);\n }, 400);\n\n const textTimer = setTimeout(() => {\n setShowText(true);\n }, 1000);\n\n const buttonTimer = setTimeout(() => {\n setShowButton(true);\n }, 1500);\n\n // Close modal after 4000ms\n const closeModalTimer = setTimeout(() => {\n handleCloseModal();\n }, 5500);\n\n return () => {\n clearTimeout(headerTimer);\n clearTimeout(lottieTimer);\n clearTimeout(textTimer);\n clearTimeout(buttonTimer);\n clearTimeout(closeModalTimer);\n };\n }, [handleCloseModal]);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $width=\"100%\">\n <Styled.PuzzleFeedbackModalWrapper $flexGapX={2.5} $widthX={33.5} $alignItems=\"center\">\n <Styled.ShimmerText $renderAs=\"ac2-black\" $show={showHeader}>\n Puzzle Reviewed\n </Styled.ShimmerText>\n\n <Styled.LottieContainer $widthX={12.5} $heightX={12.5} $show={showLottie}>\n {stickerLottie && (\n <LottieAnimation\n width={200}\n height={200}\n src={stickerLottie}\n settings={puzzleStickerLottieSettings}\n />\n )}\n </Styled.LottieContainer>\n\n <Styled.FeedbackText\n $width=\"80%\"\n $renderAs=\"
|
1
|
+
{"version":3,"file":"puzzle-feedback-celebration.js","sources":["../../../../src/features/puzzles/puzzle-feedback-celebration/puzzle-feedback-celebration.tsx"],"sourcesContent":["import type { IPuzzleFeedbackCelebration } from './puzzle-feedback-celebration-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport useModalActions from '../../ui/modals/use-modal-actions';\nimport useModalParams from '../../ui/modals/use-modal-params';\nimport { getPuzzleStickerLottie } from '../utils/puzzle-feedback-celebration';\nimport * as Styled from './puzzle-feedback-celebration-styled';\n\nconst puzzleStickerLottieSettings = {\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PuzzleFeedbackCelebration: FC = () => {\n const { closeModal } = useModalActions();\n const { feedbackComments, rewards, onCloseModal } = useModalParams<IPuzzleFeedbackCelebration>();\n\n const [showHeader, setShowHeader] = useState(false);\n const [showLottie, setShowLottie] = useState(false);\n const [showText, setShowText] = useState(false);\n const [showButton, setShowButton] = useState(false);\n\n const { sticker } = rewards[0] || {};\n\n const stickerLottie = sticker ? getPuzzleStickerLottie(sticker) : undefined;\n\n const handleCloseModal = useCallback(() => {\n onCloseModal?.();\n closeModal();\n }, [closeModal, onCloseModal]);\n\n useEffect(() => {\n // Sequence: Header -> Lottie -> Text -> Button\n const headerTimer = setTimeout(() => {\n setShowHeader(true);\n }, 100);\n\n const lottieTimer = setTimeout(() => {\n setShowLottie(true);\n }, 400);\n\n const textTimer = setTimeout(() => {\n setShowText(true);\n }, 1000);\n\n const buttonTimer = setTimeout(() => {\n setShowButton(true);\n }, 1500);\n\n // Close modal after 4000ms\n const closeModalTimer = setTimeout(() => {\n handleCloseModal();\n }, 5500);\n\n return () => {\n clearTimeout(headerTimer);\n clearTimeout(lottieTimer);\n clearTimeout(textTimer);\n clearTimeout(buttonTimer);\n clearTimeout(closeModalTimer);\n };\n }, [handleCloseModal]);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $width=\"100%\">\n <Styled.PuzzleFeedbackModalWrapper $flexGapX={2.5} $widthX={33.5} $alignItems=\"center\">\n <Styled.ShimmerText $renderAs=\"ac2-black\" $show={showHeader}>\n Puzzle Reviewed\n </Styled.ShimmerText>\n\n <Styled.LottieContainer $widthX={12.5} $heightX={12.5} $show={showLottie}>\n {stickerLottie && (\n <LottieAnimation\n width={200}\n height={200}\n src={stickerLottie}\n settings={puzzleStickerLottieSettings}\n />\n )}\n </Styled.LottieContainer>\n\n <Styled.FeedbackText\n $width=\"80%\"\n $renderAs=\"ah3\"\n $color=\"WHITE_1\"\n $align=\"center\"\n $show={showText}\n >\n {feedbackComments}\n </Styled.FeedbackText>\n\n <Styled.CloseButtonWrapper $show={showButton}>\n <IconButton\n renderAs=\"secondary\"\n Icon={CrossIcon}\n size=\"small\"\n analyticsLabel=\"close_puzzle_feedback_modal\"\n onClick={handleCloseModal}\n />\n </Styled.CloseButtonWrapper>\n </Styled.PuzzleFeedbackModalWrapper>\n </FlexView>\n );\n};\n\nexport default PuzzleFeedbackCelebration;\n"],"names":["puzzleStickerLottieSettings","PuzzleFeedbackCelebration","closeModal","useModalActions","feedbackComments","rewards","onCloseModal","useModalParams","showHeader","setShowHeader","useState","showLottie","setShowLottie","showText","setShowText","showButton","setShowButton","sticker","stickerLottie","getPuzzleStickerLottie","handleCloseModal","useCallback","useEffect","headerTimer","lottieTimer","textTimer","buttonTimer","closeModalTimer","FlexView","jsxs","Styled.PuzzleFeedbackModalWrapper","jsx","Styled.ShimmerText","Styled.LottieContainer","LottieAnimation","Styled.FeedbackText","Styled.CloseButtonWrapper","IconButton","CrossIcon","PuzzleFeedbackCelebration$1"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAA8B;AAAA,EAClC,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEMC,IAAgC,MAAM;AACpC,QAAA,EAAE,YAAAC,MAAeC,KACjB,EAAE,kBAAAC,GAAkB,SAAAC,GAAS,cAAAC,MAAiBC,EAA2C,GAEzF,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5C,CAACC,GAAYC,CAAa,IAAIF,EAAS,EAAK,GAC5C,CAACG,GAAUC,CAAW,IAAIJ,EAAS,EAAK,GACxC,CAACK,GAAYC,CAAa,IAAIN,EAAS,EAAK,GAE5C,EAAE,SAAAO,EAAQ,IAAIZ,EAAQ,CAAC,KAAK,CAAA,GAE5Ba,IAAgBD,IAAUE,EAAuBF,CAAO,IAAI,QAE5DG,IAAmBC,EAAY,MAAM;AAC1B,IAAAf,KAAA,QAAAA,KACJJ;EAAA,GACV,CAACA,GAAYI,CAAY,CAAC;AAE7B,SAAAgB,EAAU,MAAM;AAER,UAAAC,IAAc,WAAW,MAAM;AACnC,MAAAd,EAAc,EAAI;AAAA,OACjB,GAAG,GAEAe,IAAc,WAAW,MAAM;AACnC,MAAAZ,EAAc,EAAI;AAAA,OACjB,GAAG,GAEAa,IAAY,WAAW,MAAM;AACjC,MAAAX,EAAY,EAAI;AAAA,OACf,GAAI,GAEDY,IAAc,WAAW,MAAM;AACnC,MAAAV,EAAc,EAAI;AAAA,OACjB,IAAI,GAGDW,IAAkB,WAAW,MAAM;AACtB,MAAAP;OAChB,IAAI;AAEP,WAAO,MAAM;AACX,mBAAaG,CAAW,GACxB,aAAaC,CAAW,GACxB,aAAaC,CAAS,GACtB,aAAaC,CAAW,GACxB,aAAaC,CAAe;AAAA,IAAA;AAAA,EAC9B,GACC,CAACP,CAAgB,CAAC,qBAGlBQ,GAAS,EAAA,iBAAgB,UAAS,aAAY,UAAS,QAAO,QAC7D,UAAC,gBAAAC,EAAAC,GAAA,EAAkC,WAAW,KAAK,SAAS,MAAM,aAAY,UAC5E,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAmB,WAAU,aAAY,OAAOxB,GAAY,UAE7D,mBAAA;AAAA,IAEA,gBAAAuB,EAACE,GAAA,EAAuB,SAAS,MAAM,UAAU,MAAM,OAAOtB,GAC3D,UACCO,KAAA,gBAAAa;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,KAAKhB;AAAA,QACL,UAAUlB;AAAA,MAAA;AAAA,IAAA,GAGhB;AAAA,IAEA,gBAAA+B;AAAA,MAACI;AAAAA,MAAA;AAAA,QACC,QAAO;AAAA,QACP,WAAU;AAAA,QACV,QAAO;AAAA,QACP,QAAO;AAAA,QACP,OAAOtB;AAAA,QAEN,UAAAT;AAAA,MAAA;AAAA,IACH;AAAA,IAEC,gBAAA2B,EAAAK,GAAA,EAA0B,OAAOrB,GAChC,UAAA,gBAAAgB;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAMC;AAAA,QACN,MAAK;AAAA,QACL,gBAAe;AAAA,QACf,SAASlB;AAAA,MAAA;AAAA,IAAA,GAEb;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,GAEAmB,IAAetC;"}
|
@@ -1,40 +1,25 @@
|
|
1
|
-
import { ILLUSTRATIONS as
|
2
|
-
import { LOTTIE as E } from "../../../assets/lottie/lottie.js";
|
1
|
+
import { ILLUSTRATIONS as P } from "../../../assets/illustrations/illustrations.js";
|
3
2
|
const {
|
4
|
-
PUZZLE_PATTERN_BLUE:
|
5
|
-
PUZZLE_PATTERN_GREEN:
|
6
|
-
PUZZLE_PATTERN_ORANGE:
|
7
|
-
PUZZLE_PATTERN_PURPLE:
|
8
|
-
PUZZLE_PATTERN_YELLOW:
|
9
|
-
} =
|
10
|
-
switch (
|
3
|
+
PUZZLE_PATTERN_BLUE: r,
|
4
|
+
PUZZLE_PATTERN_GREEN: e,
|
5
|
+
PUZZLE_PATTERN_ORANGE: t,
|
6
|
+
PUZZLE_PATTERN_PURPLE: L,
|
7
|
+
PUZZLE_PATTERN_YELLOW: R
|
8
|
+
} = P, N = (E) => {
|
9
|
+
switch (E) {
|
11
10
|
case "YELLOW":
|
12
|
-
return
|
11
|
+
return R;
|
13
12
|
case "GREEN":
|
14
|
-
return t;
|
15
|
-
case "ORANGE":
|
16
|
-
return P;
|
17
|
-
case "PURPLE":
|
18
|
-
return T;
|
19
|
-
default:
|
20
13
|
return e;
|
21
|
-
}
|
22
|
-
}, O = (L) => {
|
23
|
-
switch (L) {
|
24
|
-
case "YELLOW":
|
25
|
-
return E.PUZZLE_YELLOW_LOTTIE;
|
26
|
-
case "GREEN":
|
27
|
-
return E.PUZZLE_GREEN_LOTTIE;
|
28
14
|
case "ORANGE":
|
29
|
-
return
|
15
|
+
return t;
|
30
16
|
case "PURPLE":
|
31
|
-
return
|
17
|
+
return L;
|
32
18
|
default:
|
33
|
-
return
|
19
|
+
return r;
|
34
20
|
}
|
35
21
|
};
|
36
22
|
export {
|
37
|
-
|
38
|
-
U as getPuzzleCardPattern
|
23
|
+
N as getPuzzleCardPattern
|
39
24
|
};
|
40
25
|
//# sourceMappingURL=puzzle-pattern.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"puzzle-pattern.js","sources":["../../../../src/features/puzzles/utils/puzzle-pattern.ts"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\
|
1
|
+
{"version":3,"file":"puzzle-pattern.js","sources":["../../../../src/features/puzzles/utils/puzzle-pattern.ts"],"sourcesContent":["import type { THueNames } from '../../ui/types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst {\n PUZZLE_PATTERN_BLUE,\n PUZZLE_PATTERN_GREEN,\n PUZZLE_PATTERN_ORANGE,\n PUZZLE_PATTERN_PURPLE,\n PUZZLE_PATTERN_YELLOW,\n} = ILLUSTRATIONS;\n\nconst getPuzzleCardPattern = (imageHue: THueNames) => {\n switch (imageHue) {\n case 'YELLOW':\n return PUZZLE_PATTERN_YELLOW;\n case 'GREEN':\n return PUZZLE_PATTERN_GREEN;\n case 'ORANGE':\n return PUZZLE_PATTERN_ORANGE;\n case 'PURPLE':\n return PUZZLE_PATTERN_PURPLE;\n\n default:\n return PUZZLE_PATTERN_BLUE;\n }\n};\n\nexport { getPuzzleCardPattern };\n"],"names":["PUZZLE_PATTERN_BLUE","PUZZLE_PATTERN_GREEN","PUZZLE_PATTERN_ORANGE","PUZZLE_PATTERN_PURPLE","PUZZLE_PATTERN_YELLOW","ILLUSTRATIONS","getPuzzleCardPattern","imageHue"],"mappings":";AAIA,MAAM;AAAA,EACJ,qBAAAA;AAAA,EACA,sBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AACF,IAAIC,GAEEC,IAAuB,CAACC,MAAwB;AACpD,UAAQA,GAAU;AAAA,IAChB,KAAK;AACI,aAAAH;AAAA,IACT,KAAK;AACI,aAAAH;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IAET;AACS,aAAAH;AAAA,EACX;AACF;"}
|
@@ -11,7 +11,7 @@ import { useGetStudentProfileSummary as X } from "../../api/student-profile-summ
|
|
11
11
|
import { useTrialSessionContext as M } from "../../context/use-trial-session-context.js";
|
12
12
|
import O from "../slide-header/index.js";
|
13
13
|
import { Container as k, ContentWrapper as B, AbsoluteImage as H, ImageWrapper as R } from "./student-profile-styled.js";
|
14
|
-
import {
|
14
|
+
import { getDummyProfileImage as W, getMilestoneGoalName as P } from "./student-profile-utils.js";
|
15
15
|
const re = b(() => {
|
16
16
|
const { isTeacher: t, studentId: l, formData: $, updateSlideConfig: d, updateButtonState: f } = M(), { name: y, goals: r, studentProfile: o } = $ || {}, { dummyProfileImageIndex: I, profileSummary: x } = o || {}, C = W(I), m = A(() => r && r.length > 0 ? {
|
17
17
|
school_success_goal: P(r, g.SCHOOL_SUCCESS),
|
@@ -1,56 +1,13 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
|
4
|
-
const l = o.div`
|
1
|
+
import t from "styled-components";
|
2
|
+
import o from "../../../ui/layout/flex-view.js";
|
3
|
+
const i = t.div`
|
5
4
|
width: 100%;
|
6
5
|
height: 100%;
|
7
|
-
`,
|
6
|
+
`, n = t(o)`
|
8
7
|
margin: auto;
|
9
|
-
|
10
|
-
object-fit: cover;
|
11
|
-
`, s = o.div(
|
12
|
-
({ theme: r }) => `
|
13
|
-
flex: 1;
|
14
|
-
display: grid;
|
15
|
-
border-left: 1px solid ${r.colors.BLACK_T_87};
|
16
|
-
grid-template-columns: repeat(2, 1fr);
|
17
|
-
grid-template-rows: auto auto auto;
|
18
|
-
`
|
19
|
-
), p = o(t)(
|
20
|
-
({ theme: r }) => `
|
21
|
-
border: 0.5px solid ${r.colors.WHITE_5};
|
22
|
-
&:first-child,
|
23
|
-
&:nth-child(2) {
|
24
|
-
grid-column: span 1;
|
25
|
-
}
|
26
|
-
&:nth-child(3),
|
27
|
-
&:nth-child(4) {
|
28
|
-
grid-column: span 2;
|
29
|
-
}
|
30
|
-
&:first-child {
|
31
|
-
border-left: none;
|
32
|
-
border-top: none;
|
33
|
-
}
|
34
|
-
&:nth-child(2) {
|
35
|
-
border-right: none;
|
36
|
-
border-top: none;
|
37
|
-
}
|
38
|
-
&:nth-child(3) {
|
39
|
-
border-left: none;
|
40
|
-
border-right: none;
|
41
|
-
}
|
42
|
-
&:nth-child(4) {
|
43
|
-
border-left: none;
|
44
|
-
border-right: none;
|
45
|
-
border-bottom: none;
|
46
|
-
}
|
47
|
-
`
|
48
|
-
);
|
8
|
+
`;
|
49
9
|
export {
|
50
|
-
|
51
|
-
|
52
|
-
s as GridContainer,
|
53
|
-
p as GridItem,
|
54
|
-
h as ProfilePicture
|
10
|
+
i as Container,
|
11
|
+
n as ContentWrapper
|
55
12
|
};
|
56
13
|
//# sourceMappingURL=teacher-intro-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"teacher-intro-styled.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport
|
1
|
+
{"version":3,"file":"teacher-intro-styled.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n`;\n\nconst ContentWrapper = styled(FlexView)`\n margin: auto;\n`;\n\nexport { Container, ContentWrapper };\n"],"names":["Container","styled","ContentWrapper","FlexView"],"mappings":";;AAIA,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA,GAKnBC,IAAiBD,EAAOE,CAAQ;AAAA;AAAA;"}
|
@@ -1,74 +1,20 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import {
|
8
|
-
import
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
countries: o,
|
16
|
-
lower_grade: a,
|
17
|
-
higher_grade: n,
|
18
|
-
header_image: $,
|
19
|
-
years_of_experience: p,
|
20
|
-
number_of_students_taught: b
|
21
|
-
} = u || {}, { degree_name: c, field_of_study: d } = g || {}, _ = Object.values(H), l = n && parseInt(n, 10) > 8, x = I(() => l ? "High School" : ` ${a === "K" ? "" : "G"}${a} - G${n}`, [l, n, a]);
|
22
|
-
return m === "right" ? /* @__PURE__ */ e(O, {}) : /* @__PURE__ */ r(L, { children: [
|
23
|
-
/* @__PURE__ */ e(s, { height: 60 }),
|
24
|
-
/* @__PURE__ */ e(F, {}),
|
25
|
-
/* @__PURE__ */ r(
|
26
|
-
D,
|
27
|
-
{
|
28
|
-
$flexDirection: "row",
|
29
|
-
$width: 750,
|
30
|
-
$borderColor: "BLACK_T_87",
|
31
|
-
$background: "WHITE_3",
|
32
|
-
children: [
|
33
|
-
/* @__PURE__ */ e(E, { withLoader: !0, src: $, width: 350, height: 350 }),
|
34
|
-
/* @__PURE__ */ r(P, { children: [
|
35
|
-
/* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
|
36
|
-
/* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: p }),
|
37
|
-
/* @__PURE__ */ e(t, { $renderAs: "ub3", children: "Yrs of Teaching Experience" })
|
38
|
-
] }),
|
39
|
-
/* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
|
40
|
-
/* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: b }),
|
41
|
-
/* @__PURE__ */ e(t, { $renderAs: "ub3", children: "Students Taught" })
|
42
|
-
] }),
|
43
|
-
c && d && /* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
|
44
|
-
/* @__PURE__ */ e(t, { $renderAs: "ab1-black", children: c }),
|
45
|
-
/* @__PURE__ */ r(t, { $renderAs: "ub3", children: [
|
46
|
-
"In ",
|
47
|
-
d
|
48
|
-
] })
|
49
|
-
] }),
|
50
|
-
/* @__PURE__ */ r(i, { $justifyContent: "center", $gutter: 24, children: [
|
51
|
-
/* @__PURE__ */ r(t, { $renderAs: "ab1-black", children: [
|
52
|
-
"Teaching ",
|
53
|
-
x,
|
54
|
-
" kids in"
|
55
|
-
] }),
|
56
|
-
/* @__PURE__ */ e(s, { height: 12 }),
|
57
|
-
/* @__PURE__ */ e(h, { $flexDirection: "row", $flexGap: 16, $flexWrap: !0, children: o && o.length > 0 && o.map((C) => {
|
58
|
-
const y = _.find((S) => S.name === C), { flag_icon: A = "", label: w, name: G } = y || {};
|
59
|
-
return /* @__PURE__ */ r(h, { $flexDirection: "row", $flexGap: 4, children: [
|
60
|
-
/* @__PURE__ */ e(j, { src: A, width: 30, height: 20, withLoader: !1 }),
|
61
|
-
/* @__PURE__ */ e(t, { $renderAs: "ab3-black", children: w })
|
62
|
-
] }, G);
|
63
|
-
}) })
|
64
|
-
] })
|
65
|
-
] })
|
66
|
-
]
|
67
|
-
}
|
68
|
-
)
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
2
|
+
import { memo as m } from "react";
|
3
|
+
import n from "../../../ui/separator/separator.js";
|
4
|
+
import { useTrialSessionContext as f } from "../../context/use-trial-session-context.js";
|
5
|
+
import a from "../communication-slide/index.js";
|
6
|
+
import p from "../slide-header/index.js";
|
7
|
+
import { Container as s, ContentWrapper as c } from "./teacher-intro-styled.js";
|
8
|
+
import h from "./teacher-profile/teacher-profile.js";
|
9
|
+
const j = m(() => {
|
10
|
+
const { slideConfig: e } = f(), { renderAVIn: o, teacher_profile: t } = e || {};
|
11
|
+
return o === "right" ? /* @__PURE__ */ r(a, {}) : /* @__PURE__ */ i(s, { children: [
|
12
|
+
/* @__PURE__ */ r(n, { height: 60 }),
|
13
|
+
/* @__PURE__ */ r(p, {}),
|
14
|
+
/* @__PURE__ */ r(c, { $width: 750, children: /* @__PURE__ */ r(h, { teacherProfile: t }) })
|
69
15
|
] });
|
70
16
|
});
|
71
17
|
export {
|
72
|
-
|
18
|
+
j as default
|
73
19
|
};
|
74
20
|
//# sourceMappingURL=teacher-intro.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"teacher-intro.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro.tsx"],"sourcesContent":["import { memo
|
1
|
+
{"version":3,"file":"teacher-intro.js","sources":["../../../../../src/features/trial-session/comps/teacher-intro/teacher-intro.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport CommunicationSlide from '../communication-slide';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './teacher-intro-styled';\nimport TeacherProfile from './teacher-profile/teacher-profile';\n\nconst TeacherIntro = memo(() => {\n const { slideConfig } = useTrialSessionContext();\n const { renderAVIn, teacher_profile: teacherProfile } = slideConfig || {};\n\n if (renderAVIn === 'right') return <CommunicationSlide />;\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $width={750}>\n <TeacherProfile teacherProfile={teacherProfile} />\n </Styled.ContentWrapper>\n </Styled.Container>\n );\n});\n\nexport default TeacherIntro;\n"],"names":["TeacherIntro","memo","slideConfig","useTrialSessionContext","renderAVIn","teacherProfile","jsx","CommunicationSlide","jsxs","Styled.Container","Separator","SlideHeader","Styled.ContentWrapper","TeacherProfile"],"mappings":";;;;;;;;AASM,MAAAA,IAAeC,EAAK,MAAM;AACxB,QAAA,EAAE,aAAAC,MAAgBC,KAClB,EAAE,YAAAC,GAAY,iBAAiBC,EAAe,IAAIH,KAAe,CAAA;AAEvE,SAAIE,MAAe,UAAgB,gBAAAE,EAACC,GAAmB,CAAA,CAAA,IAGrD,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAH,EAAAI,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,sBACtBC,GAAY,EAAA;AAAA,IACb,gBAAAL,EAACM,GAAA,EAAsB,QAAQ,KAC7B,UAAA,gBAAAN,EAACO,GAAe,EAAA,gBAAAR,EAAgC,CAAA,GAClD;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
import r from "styled-components";
|
2
|
+
import e from "../../../../ui/image/image.js";
|
3
|
+
import t from "../../../../ui/layout/flex-view.js";
|
4
|
+
const l = r(e)`
|
5
|
+
object-fit: cover;
|
6
|
+
`, c = r.div(
|
7
|
+
({ theme: o }) => `
|
8
|
+
flex: 1;
|
9
|
+
display: grid;
|
10
|
+
border-left: 1px solid ${o.colors.BLACK_T_87};
|
11
|
+
grid-template-columns: repeat(2, 1fr);
|
12
|
+
grid-template-rows: auto auto auto;
|
13
|
+
`
|
14
|
+
), h = r(t)(
|
15
|
+
({ theme: o }) => `
|
16
|
+
border: 0.5px solid ${o.colors.WHITE_5};
|
17
|
+
&:first-child,
|
18
|
+
&:nth-child(2) {
|
19
|
+
grid-column: span 1;
|
20
|
+
}
|
21
|
+
&:nth-child(3),
|
22
|
+
&:nth-child(4) {
|
23
|
+
grid-column: span 2;
|
24
|
+
}
|
25
|
+
&:first-child {
|
26
|
+
border-left: none;
|
27
|
+
border-top: none;
|
28
|
+
}
|
29
|
+
&:nth-child(2) {
|
30
|
+
border-right: none;
|
31
|
+
border-top: none;
|
32
|
+
}
|
33
|
+
&:nth-child(3) {
|
34
|
+
border-left: none;
|
35
|
+
border-right: none;
|
36
|
+
}
|
37
|
+
&:nth-child(4) {
|
38
|
+
border-left: none;
|
39
|
+
border-right: none;
|
40
|
+
border-bottom: none;
|
41
|
+
}
|
42
|
+
`
|
43
|
+
);
|
44
|
+
export {
|
45
|
+
c as GridContainer,
|
46
|
+
h as GridItem,
|
47
|
+
l as ProfilePicture
|
48
|
+
};
|
49
|
+
//# sourceMappingURL=teacher-profile-styled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"teacher-profile-styled.js","sources":["../../../../../../src/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\n\nconst ProfilePicture = styled(Image)`\n object-fit: cover;\n`;\n\nconst GridContainer = styled.div(\n ({ theme }) => `\n flex: 1;\n display: grid;\n border-left: 1px solid ${theme.colors.BLACK_T_87};\n grid-template-columns: repeat(2, 1fr);\n grid-template-rows: auto auto auto;\n`,\n);\n\nconst GridItem = styled(FlexView)(\n ({ theme }) => `\n border: 0.5px solid ${theme.colors.WHITE_5};\n &:first-child,\n &:nth-child(2) {\n grid-column: span 1;\n }\n &:nth-child(3),\n &:nth-child(4) {\n grid-column: span 2;\n }\n &:first-child {\n border-left: none;\n border-top: none;\n }\n &:nth-child(2) {\n border-right: none;\n border-top: none;\n }\n &:nth-child(3) {\n border-left: none;\n border-right: none;\n }\n &:nth-child(4) {\n border-left: none;\n border-right: none;\n border-bottom: none;\n }\n`,\n);\n\nexport { ProfilePicture, GridContainer, GridItem };\n"],"names":["ProfilePicture","styled","Image","GridContainer","theme","GridItem","FlexView"],"mappings":";;;AAKM,MAAAA,IAAiBC,EAAOC,CAAK;AAAA;AAAA,GAI7BC,IAAgBF,EAAO;AAAA,EAC3B,CAAC,EAAE,OAAAG,EAAA,MAAY;AAAA;AAAA;AAAA,2BAGUA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAIlD,GAEMC,IAAWJ,EAAOK,CAAQ;AAAA,EAC9B,CAAC,EAAE,OAAAF,EAAA,MAAY;AAAA,wBACOA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2B5C;"}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { memo as G, useMemo as T } from "react";
|
3
|
+
import C from "../../../../ui/image/image.js";
|
4
|
+
import a from "../../../../ui/layout/flex-view.js";
|
5
|
+
import j from "../../../../ui/separator/separator.js";
|
6
|
+
import t from "../../../../ui/text/text.js";
|
7
|
+
import { COUNTRY_FLAGS as k } from "../teacher-intro-constants.js";
|
8
|
+
import { ProfilePicture as I, GridContainer as S, GridItem as i } from "./teacher-profile-styled.js";
|
9
|
+
const O = G(({ teacherProfile: s }) => {
|
10
|
+
const {
|
11
|
+
degree: f,
|
12
|
+
countries: o,
|
13
|
+
lower_grade: c,
|
14
|
+
higher_grade: n,
|
15
|
+
header_image: u,
|
16
|
+
years_of_experience: g,
|
17
|
+
number_of_students_taught: m
|
18
|
+
} = s || {}, { degree_name: d, field_of_study: l } = f || {}, $ = Object.values(k), h = n && parseInt(n, 10) > 8, p = T(() => h ? "High School" : ` ${c === "K" ? "" : "G"}${c} - G${n}`, [h, n, c]);
|
19
|
+
return /* @__PURE__ */ e(a, { $flexDirection: "row", $borderColor: "BLACK_T_87", $background: "WHITE_3", children: [
|
20
|
+
/* @__PURE__ */ r(I, { withLoader: !0, src: u, width: 350, height: 350 }),
|
21
|
+
/* @__PURE__ */ e(S, { children: [
|
22
|
+
/* @__PURE__ */ e(i, { $justifyContent: "center", $gutter: 24, children: [
|
23
|
+
/* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: [
|
24
|
+
g,
|
25
|
+
"+"
|
26
|
+
] }),
|
27
|
+
/* @__PURE__ */ r(t, { $renderAs: "ub3", children: "Yrs of Teaching Experience" })
|
28
|
+
] }),
|
29
|
+
/* @__PURE__ */ e(i, { $justifyContent: "center", $gutter: 24, children: [
|
30
|
+
/* @__PURE__ */ e(t, { $renderAs: "ah3-black", children: [
|
31
|
+
m,
|
32
|
+
"+"
|
33
|
+
] }),
|
34
|
+
/* @__PURE__ */ r(t, { $renderAs: "ub3", children: "Students Taught" })
|
35
|
+
] }),
|
36
|
+
d && l && /* @__PURE__ */ e(i, { $justifyContent: "center", $gutter: 24, children: [
|
37
|
+
/* @__PURE__ */ r(t, { $renderAs: "ab1-black", children: d }),
|
38
|
+
/* @__PURE__ */ e(t, { $renderAs: "ub3", children: [
|
39
|
+
"In ",
|
40
|
+
l
|
41
|
+
] })
|
42
|
+
] }),
|
43
|
+
/* @__PURE__ */ e(i, { $justifyContent: "center", $gutter: 24, children: [
|
44
|
+
/* @__PURE__ */ e(t, { $renderAs: "ab1-black", children: [
|
45
|
+
"Teaching ",
|
46
|
+
p,
|
47
|
+
" kids in"
|
48
|
+
] }),
|
49
|
+
/* @__PURE__ */ r(j, { height: 12 }),
|
50
|
+
/* @__PURE__ */ r(a, { $flexDirection: "row", $flexGap: 16, $flexWrap: !0, children: o && o.length > 0 && o.map((b) => {
|
51
|
+
const _ = $.find((w) => w.name === b), { flag_icon: x = "", label: y, name: A } = _ || {};
|
52
|
+
return /* @__PURE__ */ e(a, { $flexDirection: "row", $flexGap: 4, children: [
|
53
|
+
/* @__PURE__ */ r(C, { src: x, width: 30, height: 20, withLoader: !1 }),
|
54
|
+
/* @__PURE__ */ r(t, { $renderAs: "ab3-black", children: y })
|
55
|
+
] }, A);
|
56
|
+
}) })
|
57
|
+
] })
|
58
|
+
] })
|
59
|
+
] });
|
60
|
+
}), W = O;
|
61
|
+
export {
|
62
|
+
W as default
|
63
|
+
};
|
64
|
+
//# sourceMappingURL=teacher-profile.js.map
|
package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"teacher-profile.js","sources":["../../../../../../src/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.tsx"],"sourcesContent":["import type { ITeacherProfileDetails } from '../../../trial-session-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { COUNTRY_FLAGS } from '../teacher-intro-constants';\nimport * as Styled from './teacher-profile-styled';\n\ninterface ITeacherProfileProps {\n teacherProfile?: ITeacherProfileDetails;\n}\n\nconst TeacherProfile: FC<ITeacherProfileProps> = memo(({ teacherProfile }) => {\n const {\n degree,\n countries,\n lower_grade: lowerGrade,\n higher_grade: higherGrade,\n header_image: headerImage,\n years_of_experience: yearsOfExperience,\n number_of_students_taught: numberOfStudentsTaught,\n } = teacherProfile || {};\n const { degree_name: degreeName, field_of_study: fieldOfStudy } = degree || {};\n\n const countryFlagArray = Object.values(COUNTRY_FLAGS);\n const isHighSchool = higherGrade && parseInt(higherGrade, 10) > 8;\n\n const displayGrade = useMemo(() => {\n return isHighSchool\n ? 'High School'\n : ` ${lowerGrade === 'K' ? '' : 'G'}${lowerGrade} - G${higherGrade}`;\n }, [isHighSchool, higherGrade, lowerGrade]);\n\n return (\n <FlexView $flexDirection=\"row\" $borderColor=\"BLACK_T_87\" $background=\"WHITE_3\">\n <Styled.ProfilePicture withLoader src={headerImage} width={350} height={350} />\n <Styled.GridContainer>\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ah3-black\">{yearsOfExperience}+</Text>\n <Text $renderAs=\"ub3\">Yrs of Teaching Experience</Text>\n </Styled.GridItem>\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ah3-black\">{numberOfStudentsTaught}+</Text>\n <Text $renderAs=\"ub3\">Students Taught</Text>\n </Styled.GridItem>\n {degreeName && fieldOfStudy && (\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ab1-black\">{degreeName}</Text>\n <Text $renderAs=\"ub3\">In {fieldOfStudy}</Text>\n </Styled.GridItem>\n )}\n <Styled.GridItem $justifyContent=\"center\" $gutter={24}>\n <Text $renderAs=\"ab1-black\">Teaching {displayGrade} kids in</Text>\n <Separator height={12} />\n <FlexView $flexDirection=\"row\" $flexGap={16} $flexWrap>\n {countries &&\n countries.length > 0 &&\n countries.map(country => {\n const countryFlag = countryFlagArray.find(item => item.name === country);\n const { flag_icon: flagIcon = '', label, name } = countryFlag || {};\n\n return (\n <FlexView key={name} $flexDirection=\"row\" $flexGap={4}>\n <Image src={flagIcon} width={30} height={20} withLoader={false} />\n <Text $renderAs=\"ab3-black\">{label}</Text>\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.GridItem>\n </Styled.GridContainer>\n </FlexView>\n );\n});\n\nexport default TeacherProfile;\n"],"names":["TeacherProfile","memo","teacherProfile","degree","countries","lowerGrade","higherGrade","headerImage","yearsOfExperience","numberOfStudentsTaught","degreeName","fieldOfStudy","countryFlagArray","COUNTRY_FLAGS","isHighSchool","displayGrade","useMemo","FlexView","jsx","Styled.ProfilePicture","jsxs","Styled.GridContainer","Styled.GridItem","Text","Separator","country","countryFlag","item","flagIcon","label","name","Image","TeacherProfile$1"],"mappings":";;;;;;;;AAgBA,MAAMA,IAA2CC,EAAK,CAAC,EAAE,gBAAAC,QAAqB;AACtE,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAaC;AAAA,IACb,cAAcC;AAAA,IACd,cAAcC;AAAA,IACd,qBAAqBC;AAAA,IACrB,2BAA2BC;AAAA,EAAA,IACzBP,KAAkB,CAAA,GAChB,EAAE,aAAaQ,GAAY,gBAAgBC,EAAa,IAAIR,KAAU,IAEtES,IAAmB,OAAO,OAAOC,CAAa,GAC9CC,IAAeR,KAAe,SAASA,GAAa,EAAE,IAAI,GAE1DS,IAAeC,EAAQ,MACpBF,IACH,gBACA,IAAIT,MAAe,MAAM,KAAK,GAAG,GAAGA,CAAU,OAAOC,CAAW,IACnE,CAACQ,GAAcR,GAAaD,CAAU,CAAC;AAE1C,2BACGY,GAAS,EAAA,gBAAe,OAAM,cAAa,cAAa,aAAY,WACnE,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAsB,YAAU,IAAC,KAAKZ,GAAa,OAAO,KAAK,QAAQ,IAAK,CAAA;AAAA,IAC7E,gBAAAa,EAACC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAD,EAACE,GAAA,EAAgB,iBAAgB,UAAS,SAAS,IACjD,UAAA;AAAA,QAAC,gBAAAF,EAAAG,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e,OAAM,UAAU,GAClD,UAAA;AAAA,YAAC,gBAAAC,EAAAa,GAAA,EAAM,KAAKH,GAAU,OAAO,IAAI,QAAQ,IAAI,YAAY,GAAO,CAAA;AAAA,YAC/D,gBAAAV,EAAAK,GAAA,EAAK,WAAU,aAAa,UAAMM,GAAA;AAAA,UAAA,EAAA,GAFtBC,CAGf;AAAA,QAEH,CAAA,GACL;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDE,IAAehC;"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import o from "styled-components";
|
2
|
+
import r from "../../../../assets/line-icons/icons/plus.js";
|
3
|
+
import t from "../../layout/flex-view.js";
|
4
|
+
const a = o(t)(
|
5
|
+
({ $index: e, $visible: i, $accordionBorderColor: n }) => `
|
6
|
+
border-bottom: 1px solid ${n};
|
7
|
+
${e === 0 ? `border-top: 1px solid ${n};` : ""}
|
8
|
+
display: ${i ? "flex" : "none"};
|
9
|
+
`
|
10
|
+
), c = o(t)`
|
11
|
+
cursor: pointer;
|
12
|
+
`, m = o.div`
|
13
|
+
max-height: 0;
|
14
|
+
overflow: hidden;
|
15
|
+
transition: all 0.3s ease-in-out;
|
16
|
+
`, p = o(t)`
|
17
|
+
width: 100%;
|
18
|
+
`, x = o(r)`
|
19
|
+
transition: all 0.3s ease-in-out;
|
20
|
+
`;
|
21
|
+
export {
|
22
|
+
m as AccordionAnswer,
|
23
|
+
c as AccordionItemContainer,
|
24
|
+
a as Container,
|
25
|
+
p as ContentContainer,
|
26
|
+
x as StyledPlusIcon
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=accordion-items-styled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"accordion-items-styled.js","sources":["../../../../../src/features/ui/accordion/accordion-items/accordion-items-styled.ts"],"sourcesContent":["import type { ContainerProps } from '../accordion-types';\n\nimport styled from 'styled-components';\n\nimport PlusIcon from '../../../../assets/line-icons/icons/plus';\nimport FlexView from '../../layout/flex-view';\n\nconst Container = styled(FlexView)<ContainerProps>(\n ({ $index, $visible, $accordionBorderColor }) => `\n border-bottom: 1px solid ${$accordionBorderColor};\n ${$index === 0 ? `border-top: 1px solid ${$accordionBorderColor};` : ''}\n display: ${$visible ? 'flex' : 'none'};\n`,\n);\n\nconst AccordionItemContainer = styled(FlexView)`\n cursor: pointer;\n`;\n\nconst AccordionAnswer = styled.div`\n max-height: 0;\n overflow: hidden;\n transition: all 0.3s ease-in-out;\n`;\n\nconst ContentContainer = styled(FlexView)`\n width: 100%;\n`;\n\nconst StyledPlusIcon = styled(PlusIcon)`\n transition: all 0.3s ease-in-out;\n`;\n\nexport { Container, AccordionItemContainer, AccordionAnswer, ContentContainer, StyledPlusIcon };\n"],"names":["Container","styled","FlexView","$index","$visible","$accordionBorderColor","AccordionItemContainer","AccordionAnswer","ContentContainer","StyledPlusIcon","PlusIcon"],"mappings":";;;AAOM,MAAAA,IAAYC,EAAOC,CAAQ;AAAA,EAC/B,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,uBAAAC,EAA4B,MAAA;AAAA,6BACtBA,CAAqB;AAAA,IAC9CF,MAAW,IAAI,yBAAyBE,CAAqB,MAAM,EAAE;AAAA,aAC5DD,IAAW,SAAS,MAAM;AAAA;AAEvC,GAEME,IAAyBL,EAAOC,CAAQ;AAAA;AAAA,GAIxCK,IAAkBN,EAAO;AAAA;AAAA;AAAA;AAAA,GAMzBO,IAAmBP,EAAOC,CAAQ;AAAA;AAAA,GAIlCO,IAAiBR,EAAOS,CAAQ;AAAA;AAAA;"}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
2
|
+
import { memo as C, useCallback as p } from "react";
|
3
|
+
import { useTheme as u } from "styled-components";
|
4
|
+
import b from "../../layout/flex-view.js";
|
5
|
+
import x from "../../separator/separator.js";
|
6
|
+
import s from "../../text/text.js";
|
7
|
+
import { EDeviceType as I } from "../../theme/constants.js";
|
8
|
+
import { Container as g, ContentContainer as w, AccordionItemContainer as T, StyledPlusIcon as y, AccordionAnswer as B } from "./accordion-items-styled.js";
|
9
|
+
const M = C((d) => {
|
10
|
+
const { item: o, index: r, theme: m, refList: a, iconRef: f, visible: $, handleToggle: c } = d, { device: h } = u(), l = h === I.MOBILE, n = m === "dark", A = p(() => {
|
11
|
+
c(r);
|
12
|
+
}, [c, r]);
|
13
|
+
return /* @__PURE__ */ e(
|
14
|
+
g,
|
15
|
+
{
|
16
|
+
$flexDirection: "column",
|
17
|
+
$justifyContent: "center",
|
18
|
+
$alignItems: "flex-start",
|
19
|
+
$index: r,
|
20
|
+
$visible: $,
|
21
|
+
onClick: A,
|
22
|
+
$accordionBorderColor: n ? "WHITE" : "BLACK",
|
23
|
+
children: /* @__PURE__ */ t(
|
24
|
+
w,
|
25
|
+
{
|
26
|
+
$flexDirection: "column",
|
27
|
+
$justifyContent: "center",
|
28
|
+
$alignItems: "flex-start",
|
29
|
+
$gap: 24,
|
30
|
+
children: [
|
31
|
+
/* @__PURE__ */ t(
|
32
|
+
T,
|
33
|
+
{
|
34
|
+
$width: "100%",
|
35
|
+
$flexDirection: "row",
|
36
|
+
$justifyContent: "space-between",
|
37
|
+
$alignItems: "center",
|
38
|
+
children: [
|
39
|
+
/* @__PURE__ */ e(s, { $renderAs: "ab1", $renderOnMobileAs: "ab2", $color: n ? "WHITE" : "BLACK", children: o.accordionQuestion + o.accordionQuestion }),
|
40
|
+
/* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(
|
41
|
+
y,
|
42
|
+
{
|
43
|
+
color: n ? "WHITE" : "BLACK",
|
44
|
+
width: l ? 24 : 40,
|
45
|
+
height: l ? 24 : 40,
|
46
|
+
ref: (i) => {
|
47
|
+
f[r] = i;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
) })
|
51
|
+
]
|
52
|
+
}
|
53
|
+
),
|
54
|
+
/* @__PURE__ */ t(
|
55
|
+
B,
|
56
|
+
{
|
57
|
+
ref: (i) => {
|
58
|
+
a[r] = i;
|
59
|
+
},
|
60
|
+
children: [
|
61
|
+
/* @__PURE__ */ e(x, { height: 12 }),
|
62
|
+
typeof o.accordionAnswer == "string" ? /* @__PURE__ */ e(
|
63
|
+
s,
|
64
|
+
{
|
65
|
+
$renderAs: "ub2-bold",
|
66
|
+
$renderOnMobileAs: "ub3-bold",
|
67
|
+
$color: n ? "WHITE" : "BLACK",
|
68
|
+
children: o.accordionAnswer
|
69
|
+
}
|
70
|
+
) : o.accordionAnswer
|
71
|
+
]
|
72
|
+
}
|
73
|
+
)
|
74
|
+
]
|
75
|
+
}
|
76
|
+
)
|
77
|
+
}
|
78
|
+
);
|
79
|
+
});
|
80
|
+
export {
|
81
|
+
M as default
|
82
|
+
};
|
83
|
+
//# sourceMappingURL=accordion-items.js.map
|