@cuemath/leap 3.1.31 → 3.1.33-aa0
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/features/auth/signup/custom-input-field/country-selector/country-list-menu.js +3 -1
- package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js.map +1 -1
- package/dist/features/chapters/lpar-chapter/comps/chapter-progress.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/circle-games/enum/circle-onboarding-steps.js +2 -2
- package/dist/features/circle-games/enum/circle-onboarding-steps.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/tables-card/infinite-button/infinite-mode-launcher-button.js +43 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/infinite-button/infinite-mode-launcher-button.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +135 -159
- package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js +76 -0
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js.map +1 -0
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +28 -94
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +118 -101
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +1 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js +10 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js +13 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +140 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +1 -0
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +132 -112
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
- package/dist/features/circle-games/leaderboard/hooks/use-timer/use-timer.js +4 -4
- package/dist/features/circle-games/leaderboard/hooks/use-timer/use-timer.js.map +1 -1
- package/dist/features/circle-games/leaderboard/leaderboard.js +38 -38
- package/dist/features/circle-games/leaderboard/leaderboard.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-height-extender.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-upload-helper.js +1 -1
- package/dist/features/cue-canvas/hooks/use-upload-helper.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/homework/homework.js.map +1 -1
- package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/color-picker-menu.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/grid-menu.js.map +1 -1
- package/dist/features/cue-canvas/toolbar/pen-tool-menu.js.map +1 -1
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/hooks/use-previous.js +1 -1
- package/dist/features/hooks/use-previous.js.map +1 -1
- package/dist/features/journey/hooks/use-chapter-journey.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.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/use-journey/journey-context-provider.js +7 -7
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/milestone/create/comps/body-layout/body-layout.js.map +1 -1
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/milestone/outcome/comps/outcome-collection/outcome-form/outcome-form.js +1 -0
- package/dist/features/milestone/outcome/comps/outcome-collection/outcome-form/outcome-form.js.map +1 -1
- package/dist/features/milestone/outcome/comps/past-milestone/question.js +5 -1
- package/dist/features/milestone/outcome/comps/past-milestone/question.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy.js +9 -9
- package/dist/features/post-game-stats/accuracy/accuracy.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock.js +12 -12
- package/dist/features/post-game-stats/clock/clock.js.map +1 -1
- package/dist/features/post-game-stats/score/constants.js +3 -2
- package/dist/features/post-game-stats/score/constants.js.map +1 -1
- package/dist/features/post-game-stats/score/score.js +41 -39
- package/dist/features/post-game-stats/score/score.js.map +1 -1
- package/dist/features/post-game-stats/streak/streak.js +3 -3
- package/dist/features/post-game-stats/streak/streak.js.map +1 -1
- package/dist/features/sheet-tools/tool-header/tool-header.js.map +1 -1
- package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/ui/context-menu/context-menu.js.map +1 -1
- package/dist/features/ui/grade-selector/grade-selector.js.map +1 -1
- package/dist/features/ui/inputs/base-select-input/base-select-input.js.map +1 -1
- package/dist/features/ui/inputs/base-select-input/select-option/select-option.js.map +1 -1
- package/dist/features/ui/inputs/base-select-input/select-section/select-section.js.map +1 -1
- package/dist/features/ui/inputs/google-places-search-input/google-places-search-input.js.map +1 -1
- package/dist/features/ui/inputs/radio-input/radio-input.js.map +1 -1
- package/dist/features/ui/inputs/radio-input/radio-option/radio-option.js.map +1 -1
- package/dist/features/ui/inputs/searchable-select-input/searchable-select-input.js.map +1 -1
- package/dist/features/ui/inputs/select-input/select-input.js.map +1 -1
- package/dist/features/ui/section-list/section-list.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-get-active-question-id.js +15 -15
- package/dist/features/worksheet/worksheet/hooks/use-get-active-question-id.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-data-helper.js +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-data-helper.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +86 -86
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/index.d.ts +58 -56
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +2 -2
- package/dist/node_modules/@floating-ui/{react/node_modules/@floating-ui/react-dom → react-dom}/dist/floating-ui.react-dom.js +2 -2
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -0
- package/dist/node_modules/react-datepicker/dist/index.es.js +1 -1
- package/package.json +14 -14
- package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +0 -1
|
@@ -65,7 +65,9 @@ const R = ({ selectedCountry: g, onChange: u, menuVisible: w }) => {
|
|
|
65
65
|
return /* @__PURE__ */ h(
|
|
66
66
|
X,
|
|
67
67
|
{
|
|
68
|
-
ref: (L) =>
|
|
68
|
+
ref: (L) => {
|
|
69
|
+
E.current[t] = L;
|
|
70
|
+
},
|
|
69
71
|
"data-country-id": n,
|
|
70
72
|
onClick: () => u({ code: C, id: n }),
|
|
71
73
|
$gutterX: 0.5,
|
package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country-list-menu.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/country-selector/country-list-menu.tsx"],"sourcesContent":["import type { ICountryListMenuProps } from './country-selector-types';\nimport type { FC } from 'react';\n\nimport { useState, useEffect, useRef, useCallback, memo } from 'react';\n\nimport { COUNTRY_CODE_MAP } from '../../../../../constants/country';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './country-selector-styled';\n\nconst CountryListMenu: FC<ICountryListMenuProps> = ({ selectedCountry, onChange, menuVisible }) => {\n const [searchTerm, setSearchTerm] = useState('');\n const [highlightedIndex, setHighlightedIndex] = useState(-1);\n const searchTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const itemRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n useEffect(() => {\n if (highlightedIndex >= 0) {\n itemRefs.current[highlightedIndex]?.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n }, [highlightedIndex]);\n\n useEffect(() => {\n if (searchTerm) {\n const index = COUNTRY_CODE_MAP.findIndex(\n c =>\n c.value.toLowerCase().includes(searchTerm.toLowerCase()) || c.code.startsWith(searchTerm),\n );\n\n setHighlightedIndex(index);\n if (searchTimeoutRef.current) clearTimeout(searchTimeoutRef.current);\n searchTimeoutRef.current = setTimeout(() => {\n setSearchTerm('');\n }, 1000);\n }\n\n return () => {\n if (searchTimeoutRef.current) clearTimeout(searchTimeoutRef.current);\n };\n }, [searchTerm]);\n\n const handleKeyDown = useCallback(\n (event: globalThis.KeyboardEvent) => {\n const { key } = event;\n\n event.preventDefault();\n event.stopPropagation();\n if (key.length === 1 && /[a-zA-Z0-9\\s]/.test(key)) {\n setSearchTerm(prev => prev + key.toLowerCase());\n\n return;\n }\n\n if (key === 'ArrowDown') {\n setHighlightedIndex(prev => (prev < COUNTRY_CODE_MAP.length - 1 ? prev + 1 : 0));\n } else if (key === 'ArrowUp') {\n setHighlightedIndex(prev => (prev > 0 ? prev - 1 : COUNTRY_CODE_MAP.length - 1));\n } else if (key === 'Enter' && highlightedIndex >= 0) {\n const selectedOption = COUNTRY_CODE_MAP[highlightedIndex];\n\n selectedOption && onChange({ code: selectedOption.code, id: selectedOption.id });\n menuRef.current?.click();\n } else if (key === 'Escape') {\n setSearchTerm('');\n setHighlightedIndex(-1);\n }\n },\n [highlightedIndex, onChange],\n );\n\n useEffect(() => {\n const menuElement = menuRef.current;\n\n if (!menuElement || !menuVisible) return;\n\n menuElement.focus();\n menuElement.addEventListener('keydown', handleKeyDown);\n\n return () => {\n menuElement.removeEventListener('keydown', handleKeyDown);\n };\n }, [menuVisible, handleKeyDown, selectedCountry.id]);\n\n return (\n <Styled.MenuWrapper\n ref={menuRef}\n tabIndex={0}\n $widthX={10}\n $gapX={0.5}\n $background=\"BLACK_2\"\n $borderColor=\"BLACK_5\"\n >\n {COUNTRY_CODE_MAP.map((option, index) => {\n const { id, value, icon, code } = option;\n\n return (\n <Styled.MenuItem\n key={id}\n ref={el =>
|
|
1
|
+
{"version":3,"file":"country-list-menu.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/country-selector/country-list-menu.tsx"],"sourcesContent":["import type { ICountryListMenuProps } from './country-selector-types';\nimport type { FC } from 'react';\n\nimport { useState, useEffect, useRef, useCallback, memo } from 'react';\n\nimport { COUNTRY_CODE_MAP } from '../../../../../constants/country';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './country-selector-styled';\n\nconst CountryListMenu: FC<ICountryListMenuProps> = ({ selectedCountry, onChange, menuVisible }) => {\n const [searchTerm, setSearchTerm] = useState('');\n const [highlightedIndex, setHighlightedIndex] = useState(-1);\n const searchTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const itemRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n useEffect(() => {\n if (highlightedIndex >= 0) {\n itemRefs.current[highlightedIndex]?.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n }, [highlightedIndex]);\n\n useEffect(() => {\n if (searchTerm) {\n const index = COUNTRY_CODE_MAP.findIndex(\n c =>\n c.value.toLowerCase().includes(searchTerm.toLowerCase()) || c.code.startsWith(searchTerm),\n );\n\n setHighlightedIndex(index);\n if (searchTimeoutRef.current) clearTimeout(searchTimeoutRef.current);\n searchTimeoutRef.current = setTimeout(() => {\n setSearchTerm('');\n }, 1000);\n }\n\n return () => {\n if (searchTimeoutRef.current) clearTimeout(searchTimeoutRef.current);\n };\n }, [searchTerm]);\n\n const handleKeyDown = useCallback(\n (event: globalThis.KeyboardEvent) => {\n const { key } = event;\n\n event.preventDefault();\n event.stopPropagation();\n if (key.length === 1 && /[a-zA-Z0-9\\s]/.test(key)) {\n setSearchTerm(prev => prev + key.toLowerCase());\n\n return;\n }\n\n if (key === 'ArrowDown') {\n setHighlightedIndex(prev => (prev < COUNTRY_CODE_MAP.length - 1 ? prev + 1 : 0));\n } else if (key === 'ArrowUp') {\n setHighlightedIndex(prev => (prev > 0 ? prev - 1 : COUNTRY_CODE_MAP.length - 1));\n } else if (key === 'Enter' && highlightedIndex >= 0) {\n const selectedOption = COUNTRY_CODE_MAP[highlightedIndex];\n\n selectedOption && onChange({ code: selectedOption.code, id: selectedOption.id });\n menuRef.current?.click();\n } else if (key === 'Escape') {\n setSearchTerm('');\n setHighlightedIndex(-1);\n }\n },\n [highlightedIndex, onChange],\n );\n\n useEffect(() => {\n const menuElement = menuRef.current;\n\n if (!menuElement || !menuVisible) return;\n\n menuElement.focus();\n menuElement.addEventListener('keydown', handleKeyDown);\n\n return () => {\n menuElement.removeEventListener('keydown', handleKeyDown);\n };\n }, [menuVisible, handleKeyDown, selectedCountry.id]);\n\n return (\n <Styled.MenuWrapper\n ref={menuRef}\n tabIndex={0}\n $widthX={10}\n $gapX={0.5}\n $background=\"BLACK_2\"\n $borderColor=\"BLACK_5\"\n >\n {COUNTRY_CODE_MAP.map((option, index) => {\n const { id, value, icon, code } = option;\n\n return (\n <Styled.MenuItem\n key={id}\n ref={el => {\n itemRefs.current[index] = el;\n }}\n data-country-id={id}\n onClick={() => onChange({ code, id })}\n $gutterX={0.5}\n $gapX={0.75}\n $width=\"100%\"\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $isSelected={selectedCountry.id === id}\n $isHighlighted={highlightedIndex === index}\n >\n <Styled.FlagIcon src={icon} />\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n {value}\n </Text>\n </Styled.MenuItem>\n );\n })}\n\n <Styled.Instructions $gutterX={0.5}>\n <Separator heightX={0.5} />\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n Type to search • ↑↓ to navigate • Enter to select • Esc to clear\n </Text>\n </Styled.Instructions>\n </Styled.MenuWrapper>\n );\n};\n\nexport default memo(CountryListMenu);\n"],"names":["CountryListMenu","selectedCountry","onChange","menuVisible","searchTerm","setSearchTerm","useState","highlightedIndex","setHighlightedIndex","searchTimeoutRef","useRef","menuRef","itemRefs","useEffect","_a","index","COUNTRY_CODE_MAP","c","handleKeyDown","useCallback","event","key","prev","selectedOption","menuElement","jsxs","Styled.MenuWrapper","option","id","value","icon","code","Styled.MenuItem","el","jsx","Styled.FlagIcon","Text","Styled.Instructions","Separator","CountryListMenu$1","memo"],"mappings":";;;;;;AAUA,MAAMA,IAA6C,CAAC,EAAE,iBAAAC,GAAiB,UAAAC,GAAU,aAAAC,QAAkB;AACjG,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAE,GACzC,CAACC,GAAkBC,CAAmB,IAAIF,EAAS,EAAE,GACrDG,IAAmBC,EAA8B,IAAI,GACrDC,IAAUD,EAAuB,IAAI,GACrCE,IAAWF,EAAkC,CAAA,CAAE;AAErD,EAAAG,EAAU,MAAM;;AACd,IAAIN,KAAoB,OACbO,IAAAF,EAAA,QAAQL,CAAgB,MAAxB,QAAAO,EAA2B,eAAe;AAAA,MACjD,UAAU;AAAA,MACV,OAAO;AAAA,IAAA;AAAA,EAEX,GACC,CAACP,CAAgB,CAAC,GAErBM,EAAU,MAAM;AACd,QAAIT,GAAY;AACd,YAAMW,IAAQC,EAAi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AA,WAAU,OAAM,QAAO,SAAQ,UAErC,oEAAA;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeG,IAAAC,EAAKxC,CAAe;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chapter-progress.js","sources":["../../../../../src/features/chapters/lpar-chapter/comps/chapter-progress.tsx"],"sourcesContent":["import type { FlexViewProps } from '../../../ui/layout/flex-view';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\nimport styled, { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ntype TProgressProps = {\n $progress?: number;\n};\n\nconst Progress = styled.div<TProgressProps>(({ theme, $progress }) => {\n const { REAL_BLACK_15, GREEN_4, BLACK } = theme.colors;\n\n return `\n width: 100%;\n height: 4px;\n border-radius: 16px;\n background-color: ${REAL_BLACK_15};\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n width: ${$progress}%;\n height: 4px;\n border-radius: 16px;\n background-color: ${$progress === 100 ? GREEN_4 : BLACK}\n }\n `;\n});\n\nconst FlexText = styled(Text)`\n display: inline-flex;\n`;\n\ninterface IProgressStatsProps {\n progress: number;\n progressStats:
|
|
1
|
+
{"version":3,"file":"chapter-progress.js","sources":["../../../../../src/features/chapters/lpar-chapter/comps/chapter-progress.tsx"],"sourcesContent":["import type { FlexViewProps } from '../../../ui/layout/flex-view';\nimport type { FC, ReactElement } from 'react';\n\nimport { memo } from 'react';\nimport styled, { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ntype TProgressProps = {\n $progress?: number;\n};\n\nconst Progress = styled.div<TProgressProps>(({ theme, $progress }) => {\n const { REAL_BLACK_15, GREEN_4, BLACK } = theme.colors;\n\n return `\n width: 100%;\n height: 4px;\n border-radius: 16px;\n background-color: ${REAL_BLACK_15};\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n width: ${$progress}%;\n height: 4px;\n border-radius: 16px;\n background-color: ${$progress === 100 ? GREEN_4 : BLACK}\n }\n `;\n});\n\nconst FlexText = styled(Text)`\n display: inline-flex;\n`;\n\ninterface IProgressStatsProps {\n progress: number;\n progressStats: ReactElement;\n width?: number | string;\n flexDirection?: FlexViewProps['$flexDirection'];\n}\n\nconst ProgressStats: FC<IProgressStatsProps> = memo(\n ({ progress, progressStats, width, flexDirection }) => {\n const theme = useTheme();\n\n return (\n <FlexView\n $width={width ?? theme.layout.gutter * 7.5}\n $flexGap={4}\n $flexDirection={flexDirection}\n >\n <Progress $progress={progress} />\n <FlexText $renderAs=\"body2\">{progressStats}</FlexText>\n </FlexView>\n );\n },\n);\n\nexport default ProgressStats;\n"],"names":["Progress","styled","theme","$progress","REAL_BLACK_15","GREEN_4","BLACK","FlexText","Text","ProgressStats","memo","progress","progressStats","width","flexDirection","useTheme","jsxs","FlexView","jsx"],"mappings":";;;;;AAaA,MAAMA,IAAWC,EAAO,IAAoB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACpE,QAAM,EAAE,eAAAC,GAAe,SAAAC,GAAS,OAAAC,EAAA,IAAUJ,EAAM;AAEzC,SAAA;AAAA;AAAA;AAAA;AAAA,wBAIeE,CAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAOtBD,CAAS;AAAA;AAAA;AAAA,0BAGEA,MAAc,MAAME,IAAUC,CAAK;AAAA;AAAA;AAG7D,CAAC,GAEKC,IAAWN,EAAOO,CAAI;AAAA;AAAA,GAWtBC,IAAyCC;AAAA,EAC7C,CAAC,EAAE,UAAAC,GAAU,eAAAC,GAAe,OAAAC,GAAO,eAAAC,QAAoB;AACrD,UAAMZ,IAAQa;AAGZ,WAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAQJ,KAASX,EAAM,OAAO,SAAS;AAAA,QACvC,UAAU;AAAA,QACV,gBAAgBY;AAAA,QAEhB,UAAA;AAAA,UAAC,gBAAAI,EAAAlB,GAAA,EAAS,WAAWW,EAAU,CAAA;AAAA,UAC9B,gBAAAO,EAAAX,GAAA,EAAS,WAAU,SAAS,UAAcK,GAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGjD;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teacher-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../../../../assets/line-icons/icons/home2';\nimport Lock3Icon from '../../../../../assets/line-icons/icons/lock3';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport SkipIcon from '../../../../../assets/line-icons/icons/skip';\nimport Unlock2Icon from '../../../../../assets/line-icons/icons/unlock2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES, TEACHER_MENU_LABELS } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\nconst { ASSIGN_AS_HW, REVIEW, VIEW, MARK_AS_DONE, RESET, LOCK, UNLOCK } = TEACHER_MENU_LABELS;\n\nconst customEventName = 'cue_cp_close_other_node_card_menu_options';\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeUnlock,\n onNodeUnassign,\n onNodeSkipUnSkip,\n }) => {\n const componentUniqueIdRef = useRef(nodeData.node_id);\n const containerRef = useRef<HTMLDivElement>(null);\n const { menuVisible, onMenuClick, hideMenu } = useContextMenuClickHandler(containerRef);\n\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n user_attempt_id: userAttemptId,\n } = nodeData;\n\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n\n const {\n can_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n can_assign_as_homework: canAssignAsHw,\n can_reset: canReset,\n can_unlock: canUnlock,\n can_unassign: canUnassign,\n can_un_skip: canUnSkip,\n can_skip: canSkip,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED || canUnSkip;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const inClassSheet = attemptLocation === 'INCLASS';\n const canLockUnlockSheet = (sheetLocked || sheetNotStarted) && (canUnlock || canUnassign);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-view':\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-assign-as-hw':\n onNodeAssignAsHomework?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n\n case 'node-card-reset':\n onNodeReattempt?.(nodeData);\n\n return;\n case 'node-card-unlock':\n onNodeUnlock?.(nodeData);\n\n return;\n case 'node-card-lock':\n onNodeUnassign?.(nodeData);\n\n return;\n case 'node-card-skip':\n case 'node-card-revert-skip':\n onNodeSkipUnSkip?.(nodeData);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeSkipUnSkip,\n onNodeUnassign,\n onNodeUnlock,\n onNodeView,\n userAttemptId,\n ],\n );\n\n const handleOnMouseEnter = useCallback(() => {\n if (sheetLocked) return;\n animationRef.current?.play();\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n const handleOnNodeCardClick = useCallback(() => {\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n }, [canReview, nodeData, onNodeReview, onNodeView, userAttemptId]);\n\n const handleOnKebabMenuClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n e.stopPropagation();\n\n //* If this menu is not currently visible, it means onMenuClick will attempt to open it.\n //* In that case, dispatch an event to close other menus.\n //* This check ensures we only dispatch, When this menu is about to be opened.\n if (!menuVisible) {\n const event = new CustomEvent(customEventName, {\n detail: { sourceId: componentUniqueIdRef.current },\n });\n\n document.dispatchEvent(event);\n }\n\n //* This will toggle the current menu's visibility.\n onMenuClick();\n },\n [onMenuClick, menuVisible],\n );\n\n useEffect(() => {\n const handleCloseRequest = (event: CustomEvent) => {\n //*() Ensure event.detail and event.detail.sourceId exist before accessing\n if (event.detail && event.detail.sourceId !== componentUniqueIdRef.current && menuVisible) {\n hideMenu();\n }\n };\n\n document.addEventListener(customEventName, handleCloseRequest as EventListener);\n\n return () => {\n document.removeEventListener(customEventName, handleCloseRequest as EventListener);\n };\n }, [menuVisible, hideMenu]);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-view',\n label: canReview && userAttemptId ? REVIEW : VIEW,\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-assign-as-hw',\n label: ASSIGN_AS_HW,\n icon: Home2Icon,\n disabled: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reset',\n label: RESET,\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-mark-as-done',\n label: MARK_AS_DONE,\n icon: Check2Icon,\n disabled: !canMarkFamiliar,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: `node-card-${canUnlock ? 'unlock' : 'lock'}`,\n label: canUnlock ? UNLOCK : LOCK,\n icon: canUnlock ? Unlock2Icon : Lock3Icon,\n disabled: !canLockUnlockSheet,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: `node-card-${canSkip ? 'skip' : `revert-skip`}`,\n label: canSkip ? 'Skip' : `Revert 'Skip'`,\n icon: SkipIcon,\n disabled: !canUnSkip && !canSkip,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <FlexView $position=\"relative\">\n <Styled.NodeCardContainer\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n $opacity={isSkipped ? 0.5 : 1}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={menuVisible || !sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <LottieAnimation\n src={nodeCardLottie}\n ref={animationRef}\n settings={renderSettings}\n />\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text\n $renderAs=\"ac4-black\"\n $color=\"BLACK\"\n $opacity={sheetLocked ? 0.5 : 1}\n $textDecoration={canUnSkip ? 'line-through' : 'none'}\n >\n {cardHeader} {inClassSheet && `• CW`}\n </Text>\n\n <FlexView className=\"context-menu\">\n {isGoalBlock && (\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={handleOnKebabMenuClick}>\n <MoreVerticalIcon width={18} height={18} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n $flexGap={8}\n $heightX={4}\n $justifyContent=\"space-between\"\n >\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={handleOnKebabMenuClick}>\n <MoreVerticalIcon width={18} height={18} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </FlexView>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["renderSettings","ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","RESET","LOCK","UNLOCK","TEACHER_MENU_LABELS","customEventName","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeView","onNodeReview","onNodeReattempt","onNodeUnlock","onNodeUnassign","onNodeSkipUnSkip","componentUniqueIdRef","useRef","containerRef","menuVisible","onMenuClick","hideMenu","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","nodeCardLottie","getNodeCardBasedIcon","animationRef","canMarkFamiliar","canReview","canAssignAsHw","canReset","canUnlock","canUnassign","canUnSkip","canSkip","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","inClassSheet","canLockUnlockSheet","nodeBgImage","getNodeTypeBasedBgImage","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","_a","handleOnMouseLeave","handleOnNodeCardClick","handleOnKebabMenuClick","event","useEffect","handleCloseRequest","menuOptions","Eye2Icon","Home2Icon","RedoIcon","Check2Icon","Unlock2Icon","Lock3Icon","SkipIcon","jsxs","FlexView","jsx","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GACvD,EAAE,cAAAC,IAAc,QAAAC,IAAQ,MAAAC,IAAM,cAAAC,IAAc,OAAAC,IAAO,MAAAC,IAAM,QAAAC,GAAW,IAAAC,IAEpEC,IAAkB,6CAElBC,KAAuDC;AAAA,EAC3D,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,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js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport Home2Icon from '../../../../../assets/line-icons/icons/home2';\nimport Lock3Icon from '../../../../../assets/line-icons/icons/lock3';\nimport MoreVerticalIcon from '../../../../../assets/line-icons/icons/more-vertical';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport SkipIcon from '../../../../../assets/line-icons/icons/skip';\nimport Unlock2Icon from '../../../../../assets/line-icons/icons/unlock2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport useContextMenuClickHandler from '../../../../ui/hooks/use-context-menu-click-handler';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES, TEACHER_MENU_LABELS } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\nconst { ASSIGN_AS_HW, REVIEW, VIEW, MARK_AS_DONE, RESET, LOCK, UNLOCK } = TEACHER_MENU_LABELS;\n\nconst customEventName = 'cue_cp_close_other_node_card_menu_options';\n\nconst TeacherActions: FC<Omit<INodeCardProps, 'userType'>> = memo(\n ({\n nodeData,\n imageHue,\n blockType,\n isSkipped,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeUnlock,\n onNodeUnassign,\n onNodeSkipUnSkip,\n }) => {\n const componentUniqueIdRef = useRef(nodeData.node_id);\n const containerRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const { menuVisible, onMenuClick, hideMenu } = useContextMenuClickHandler(containerRef);\n\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n user_attempt_id: userAttemptId,\n } = nodeData;\n\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n\n const {\n can_mark_familiar: canMarkFamiliar,\n can_review: canReview,\n can_assign_as_homework: canAssignAsHw,\n can_reset: canReset,\n can_unlock: canUnlock,\n can_unassign: canUnassign,\n can_un_skip: canUnSkip,\n can_skip: canSkip,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED || canUnSkip;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const inClassSheet = attemptLocation === 'INCLASS';\n const canLockUnlockSheet = (sheetLocked || sheetNotStarted) && (canUnlock || canUnassign);\n\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-view':\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-assign-as-hw':\n onNodeAssignAsHomework?.(nodeData);\n\n return;\n\n case 'node-card-mark-as-done':\n onNodeMarkAsDone?.(nodeData);\n\n return;\n\n case 'node-card-reset':\n onNodeReattempt?.(nodeData);\n\n return;\n case 'node-card-unlock':\n onNodeUnlock?.(nodeData);\n\n return;\n case 'node-card-lock':\n onNodeUnassign?.(nodeData);\n\n return;\n case 'node-card-skip':\n case 'node-card-revert-skip':\n onNodeSkipUnSkip?.(nodeData);\n\n return;\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [\n canReview,\n nodeData,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeSkipUnSkip,\n onNodeUnassign,\n onNodeUnlock,\n onNodeView,\n userAttemptId,\n ],\n );\n\n const handleOnMouseEnter = useCallback(() => {\n if (sheetLocked) return;\n animationRef.current?.play();\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n const handleOnNodeCardClick = useCallback(() => {\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n }, [canReview, nodeData, onNodeReview, onNodeView, userAttemptId]);\n\n const handleOnKebabMenuClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n e.stopPropagation();\n\n //* If this menu is not currently visible, it means onMenuClick will attempt to open it.\n //* In that case, dispatch an event to close other menus.\n //* This check ensures we only dispatch, When this menu is about to be opened.\n if (!menuVisible) {\n const event = new CustomEvent(customEventName, {\n detail: { sourceId: componentUniqueIdRef.current },\n });\n\n document.dispatchEvent(event);\n }\n\n //* This will toggle the current menu's visibility.\n onMenuClick();\n },\n [onMenuClick, menuVisible],\n );\n\n useEffect(() => {\n const handleCloseRequest = (event: CustomEvent) => {\n //*() Ensure event.detail and event.detail.sourceId exist before accessing\n if (event.detail && event.detail.sourceId !== componentUniqueIdRef.current && menuVisible) {\n hideMenu();\n }\n };\n\n document.addEventListener(customEventName, handleCloseRequest as EventListener);\n\n return () => {\n document.removeEventListener(customEventName, handleCloseRequest as EventListener);\n };\n }, [menuVisible, hideMenu]);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-view',\n label: canReview && userAttemptId ? REVIEW : VIEW,\n icon: Eye2Icon,\n disabled: false,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-assign-as-hw',\n label: ASSIGN_AS_HW,\n icon: Home2Icon,\n disabled: !canAssignAsHw,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reset',\n label: RESET,\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-mark-as-done',\n label: MARK_AS_DONE,\n icon: Check2Icon,\n disabled: !canMarkFamiliar,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: `node-card-${canUnlock ? 'unlock' : 'lock'}`,\n label: canUnlock ? UNLOCK : LOCK,\n icon: canUnlock ? Unlock2Icon : Lock3Icon,\n disabled: !canLockUnlockSheet,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: `node-card-${canSkip ? 'skip' : `revert-skip`}`,\n label: canSkip ? 'Skip' : `Revert 'Skip'`,\n icon: SkipIcon,\n disabled: !canUnSkip && !canSkip,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <FlexView $position=\"relative\">\n <Styled.NodeCardContainer\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n $opacity={isSkipped ? 0.5 : 1}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={menuVisible || !sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $width=\"100%\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n <LottieAnimation\n src={nodeCardLottie}\n ref={animationRef}\n settings={renderSettings}\n />\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text\n $renderAs=\"ac4-black\"\n $color=\"BLACK\"\n $opacity={sheetLocked ? 0.5 : 1}\n $textDecoration={canUnSkip ? 'line-through' : 'none'}\n >\n {cardHeader} {inClassSheet && `• CW`}\n </Text>\n\n <FlexView className=\"context-menu\">\n {isGoalBlock && (\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={handleOnKebabMenuClick}>\n <MoreVerticalIcon width={18} height={18} />\n </Styled.NodeKebabMenuWrapper>\n )}\n </FlexView>\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags nodeType={nodeType} state={state} accuracy={accuracy} />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $background=\"WHITE_1\"\n $flexGap={8}\n $heightX={4}\n $justifyContent=\"space-between\"\n >\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n\n <Styled.NodeKebabMenuWrapper ref={containerRef} onClick={handleOnKebabMenuClick}>\n <MoreVerticalIcon width={18} height={18} />\n </Styled.NodeKebabMenuWrapper>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n <Styled.NodeMenuOptionsWrapper $visible={menuVisible}>\n <NodeMenuOptions options={menuOptions} />\n </Styled.NodeMenuOptionsWrapper>\n </FlexView>\n );\n },\n);\n\nexport default TeacherActions;\n"],"names":["renderSettings","ASSIGN_AS_HW","REVIEW","VIEW","MARK_AS_DONE","RESET","LOCK","UNLOCK","TEACHER_MENU_LABELS","customEventName","TeacherActions","memo","nodeData","imageHue","blockType","isSkipped","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeView","onNodeReview","onNodeReattempt","onNodeUnlock","onNodeUnassign","onNodeSkipUnSkip","componentUniqueIdRef","useRef","containerRef","menuVisible","onMenuClick","hideMenu","useContextMenuClickHandler","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","userAttemptId","nodeCardLottie","getNodeCardBasedIcon","animationRef","canMarkFamiliar","canReview","canAssignAsHw","canReset","canUnlock","canUnassign","canUnSkip","canSkip","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","inClassSheet","canLockUnlockSheet","nodeBgImage","getNodeTypeBasedBgImage","handleOnMenuOptionClick","useCallback","optionId","handleOnMouseEnter","_a","handleOnMouseLeave","handleOnNodeCardClick","handleOnKebabMenuClick","event","useEffect","handleCloseRequest","menuOptions","Eye2Icon","Home2Icon","RedoIcon","Check2Icon","Unlock2Icon","Lock3Icon","SkipIcon","jsxs","FlexView","jsx","Styled.NodeCardContainer","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","Styled.NodeKebabMenuWrapper","MoreVerticalIcon","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","Styled.NodeMenuOptionsWrapper","NodeMenuOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GACvD,EAAE,cAAAC,IAAc,QAAAC,IAAQ,MAAAC,IAAM,cAAAC,IAAc,OAAAC,IAAO,MAAAC,IAAM,QAAAC,GAAW,IAAAC,IAEpEC,IAAkB,6CAElBC,KAAuDC;AAAA,EAC3D,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAuBC,EAAOb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GACvD,4BAACuB,GAAiB,EAAA,OAAO,IAAI,QAAQ,IAAI,GAC3C,EAEJ,CAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAEC,gBAAAT,EAAAU,IAAA,EAAa,UAAA3D,GAAoB,OAAAG,GAAc,UAAAL,EAAoB,CAAA;AAAA,gBAEnE,CAACqB,KACA,gBAAA4B;AAAA,kBAACa;AAAAA,kBAAA;AAAA,oBACC,gBAAe;AAAA,oBACf,aAAY;AAAA,oBACZ,aAAY;AAAA,oBACZ,UAAU;AAAA,oBACV,UAAU;AAAA,oBACV,iBAAgB;AAAA,oBAEhB,UAAA;AAAA,sBAAA,gBAAAX;AAAA,wBAACY;AAAAA,wBAAA;AAAA,0BACC,WAAU;AAAA,0BACV,QAAO;AAAA,0BACP,UAAUxC,IAAc,MAAM;AAAA,0BAE7B,UAAAnB;AAAA,wBAAA;AAAA,sBACH;AAAA,sBAEC,gBAAA+C,EAAAQ,GAAA,EAA4B,KAAKhE,GAAc,SAAS0C,GACvD,UAAA,gBAAAc,EAACS,GAAiB,EAAA,OAAO,IAAI,QAAQ,GAAI,CAAA,GAC3C;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,MACA,gBAAAT,EAACa,IAAA,EAA8B,UAAUpE,GACvC,UAAC,gBAAAuD,EAAAc,IAAA,EAAgB,SAASxB,GAAA,CAAa,EACzC,CAAA;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var i = /* @__PURE__ */ ((t) => (t.SKILL_ACTIVITY = "skill_activity", t.GAMES_ACTIVITY = "games_activity", t.PUZZLE_ACTIVITY = "puzzle_activity", t.TUTORIAL = "tutorial", t.POINTS = "points", t.STREAK = "streak", t.LEADERBOARD = "leaderboard", t.TABLES = "tables", t.INFINITE_MODE = "infinite_mode", t))(i || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
i as CIRCLE_ONBOARDING_ANALYTICS_STEPS
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=circle-onboarding-steps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circle-onboarding-steps.js","sources":["../../../../src/features/circle-games/enum/circle-onboarding-steps.ts"],"sourcesContent":["export enum CIRCLE_ONBOARDING_ANALYTICS_STEPS {\n SKILL_ACTIVITY = 'skill_activity',\n GAMES_ACTIVITY = 'games_activity',\n PUZZLE_ACTIVITY = 'puzzle_activity',\n TUTORIAL = 'tutorial',\n POINTS = 'points',\n STREAK = 'streak',\n LEADERBOARD = 'leaderboard',\n TABLES = 'tables',\n}\n"],"names":["CIRCLE_ONBOARDING_ANALYTICS_STEPS"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,iBAAiB,kBACjBA,EAAA,kBAAkB,mBAClBA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,SAAS,
|
|
1
|
+
{"version":3,"file":"circle-onboarding-steps.js","sources":["../../../../src/features/circle-games/enum/circle-onboarding-steps.ts"],"sourcesContent":["export enum CIRCLE_ONBOARDING_ANALYTICS_STEPS {\n SKILL_ACTIVITY = 'skill_activity',\n GAMES_ACTIVITY = 'games_activity',\n PUZZLE_ACTIVITY = 'puzzle_activity',\n TUTORIAL = 'tutorial',\n POINTS = 'points',\n STREAK = 'streak',\n LEADERBOARD = 'leaderboard',\n TABLES = 'tables',\n INFINITE_MODE = 'infinite_mode',\n}\n"],"names":["CIRCLE_ONBOARDING_ANALYTICS_STEPS"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,iBAAiB,kBACjBA,EAAA,kBAAkB,mBAClBA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,SAAS,UACTA,EAAA,gBAAgB,iBATNA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import type { ICarouselProps, ICarouselRefs } from './carousel-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n createRef,\n} from 'react';\n\nimport CaratLeftIcon from '../../../../../assets/line-icons/icons/carat-left';\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport Separator from '../../../../ui/separator/separator';\nimport * as Styled from './carousel-styled';\n\nconst CarouselComponent: ForwardRefRenderFunction<ICarouselRefs, ICarouselProps> = (\n { items, defaultIndex = 0, onNext, onPrev, analyticsPrev, analyticsNext },\n ref,\n) => {\n const memoizedAnalyticsPrev = useMemo(() => analyticsPrev, [analyticsPrev]);\n const memoizedAnalyticsNext = useMemo(() => analyticsNext, [analyticsNext]);\n\n const nextBtnRef = useRef<HTMLDivElement>(null)
|
|
1
|
+
{"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import type { ICarouselProps, ICarouselRefs } from './carousel-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n createRef,\n} from 'react';\n\nimport CaratLeftIcon from '../../../../../assets/line-icons/icons/carat-left';\nimport CaratRightIcon from '../../../../../assets/line-icons/icons/carat-right';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport Separator from '../../../../ui/separator/separator';\nimport * as Styled from './carousel-styled';\n\nconst CarouselComponent: ForwardRefRenderFunction<ICarouselRefs, ICarouselProps> = (\n { items, defaultIndex = 0, onNext, onPrev, analyticsPrev, analyticsNext },\n ref,\n) => {\n const memoizedAnalyticsPrev = useMemo(() => analyticsPrev, [analyticsPrev]);\n const memoizedAnalyticsNext = useMemo(() => analyticsNext, [analyticsNext]);\n\n const nextBtnRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const isFirstMount = useRef(true);\n const [currIndex, setCurrIndex] = useState(defaultIndex);\n\n // Create a stable array of refs for indicators\n const indicatorRefs = useMemo(() => items.map(() => createRef<HTMLDivElement>()), [items]);\n\n const handleCarouselPrev = useCallback(() => {\n onPrev?.();\n setCurrIndex(prev => prev - 1);\n }, [onPrev]);\n\n const handleCarouselNext = useCallback(() => {\n onNext?.();\n setCurrIndex(prev => prev + 1);\n }, [onNext]);\n\n const handleCarouselIndicatorClick = useCallback((index: number) => {\n setCurrIndex(index);\n }, []);\n\n useImperativeHandle(ref, () => ({\n nextBtnRef,\n indicatorRefs,\n currentIndex: currIndex,\n goToIndex: (index: number) => {\n setCurrIndex(index);\n },\n }));\n\n useEffect(() => {\n if (isFirstMount.current) {\n isFirstMount.current = false;\n }\n }, []);\n\n // Change index from parent\n useEffect(() => {\n setCurrIndex(defaultIndex);\n }, [defaultIndex]);\n\n return (\n <Styled.Carousel>\n <Styled.CarouselWrapper\n $translate={currIndex * 100}\n $translateDuration={isFirstMount.current ? 0 : 300}\n >\n {items.map((item, index) => (\n <Styled.CarouselItemContainer key={index}>{item}</Styled.CarouselItemContainer>\n ))}\n </Styled.CarouselWrapper>\n\n {items.length > 1 && (\n <Styled.ExtendedFlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $position=\"absolute\"\n >\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratLeftIcon}\n onClick={handleCarouselPrev}\n analyticsLabel={memoizedAnalyticsPrev.analyticsLabel}\n analyticsProps={memoizedAnalyticsPrev.analyticsProps}\n disabled={currIndex === 0}\n />\n <Separator width={48} />\n {items.map((_, index) => (\n <Styled.Indicator\n ref={indicatorRefs[index]}\n $isActive={index === currIndex}\n key={index}\n onClick={() => handleCarouselIndicatorClick(index)}\n />\n ))}\n <Separator width={48} />\n <div ref={nextBtnRef}>\n <IconButton\n renderAs=\"secondary\"\n Icon={CaratRightIcon}\n onClick={handleCarouselNext}\n analyticsLabel={memoizedAnalyticsNext.analyticsLabel}\n analyticsProps={memoizedAnalyticsNext.analyticsProps}\n disabled={currIndex === items.length - 1}\n />\n </div>\n </Styled.ExtendedFlexView>\n )}\n </Styled.Carousel>\n );\n};\n\nexport const Carousel = memo(forwardRef(CarouselComponent));\n"],"names":["CarouselComponent","items","defaultIndex","onNext","onPrev","analyticsPrev","analyticsNext","ref","memoizedAnalyticsPrev","useMemo","memoizedAnalyticsNext","nextBtnRef","useRef","isFirstMount","currIndex","setCurrIndex","useState","indicatorRefs","createRef","handleCarouselPrev","useCallback","prev","handleCarouselNext","handleCarouselIndicatorClick","index","useImperativeHandle","useEffect","jsxs","Styled.Carousel","jsx","Styled.CarouselWrapper","item","Styled.CarouselItemContainer","Styled.ExtendedFlexView","IconButton","CaratLeftIcon","Separator","_","Styled.Indicator","CaratRightIcon","Carousel","memo","forwardRef"],"mappings":";;;;;;;AAqBA,MAAMA,IAA6E,CACjF,EAAE,OAAAC,GAAO,cAAAC,IAAe,GAAG,QAAAC,GAAQ,QAAAC,GAAQ,eAAAC,GAAe,eAAAC,EAAc,GACxEC,MACG;AACH,QAAMC,IAAwBC,EAAQ,MAAMJ,GAAe,CAACA,CAAa,CAAC,GACpEK,IAAwBD,EAAQ,MAAMH,GAAe,CAACA,CAAa,CAAC,GAEpEK,IAAaC,EAAuB,IAAI,GACxCC,IAAeD,EAAO,EAAI,GAC1B,CAACE,GAAWC,CAAY,IAAIC,EAASd,CAAY,GAGjDe,IAAgBR,EAAQ,MAAMR,EAAM,IAAI,MAAMiB,GAA2B,GAAG,CAACjB,CAAK,CAAC,GAEnFkB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ShB;AAAA,cACT,gBAAgBX,EAAsB;AAAA,cACtC,gBAAgBA,EAAsB;AAAA,cACtC,UAAUM,MAAc;AAAA,YAAA;AAAA,UAC1B;AAAA,UACA,gBAAAe,EAACO,GAAU,EAAA,OAAO,GAAI,CAAA;AAAA,UACrBnC,EAAM,IAAI,CAACoC,GAAGb,MACb,gBAAAK;AAAA,YAACS;AAAAA,YAAA;AAAA,cACC,KAAKrB,EAAcO,CAAK;AAAA,cACxB,WAAWA,MAAUV;AAAA,cAErB,SAAS,MAAMS,EAA6BC,CAAK;AAAA,YAAA;AAAA,YAD5CA;AAAA,UAAA,CAGR;AAAA,UACD,gBAAAK,EAACO,GAAU,EAAA,OAAO,GAAI,CAAA;AAAA,UACtB,gBAAAP,EAAC,OAAI,EAAA,KAAKlB,GACR,UAAA,gBAAAkB;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,MAAMK;AAAA,cACN,SAASjB;AAAA,cACT,gBAAgBZ,EAAsB;AAAA,cACtC,gBAAgBA,EAAsB;AAAA,cACtC,UAAUI,MAAcb,EAAM,SAAS;AAAA,YAAA;AAAA,UAAA,GAE3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEauC,IAAWC,EAAKC,EAAW1C,CAAiB,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-game-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\nimport type {\n IGameCardSegmentContentProps,\n ISegmentedGameCardProps,\n ISegmentedGameCardRefs,\n} from './segmented-game-card-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport {\n forwardRef,\n memo,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport CheckIcon from '../../../../../assets/line-icons/icons/check';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport { CardContainer } from '../card-container/card-container';\nimport * as Styled from './segmented-game-card-styled';\n\nconst renderSettings = { renderer: 'canvas', loop: true };\n\nexport const SegmentContent = memo(\n ({ segmentType, isCompleted, card, name, onMouseEnter }: IGameCardSegmentContentProps) => {\n const handleMouseEnter = useCallback(() => onMouseEnter(name), [onMouseEnter, name]);\n\n return (\n <Styled.SegmentContainer>\n <Styled.SegmentContentContainer $segmentType={segmentType} onMouseEnter={handleMouseEnter}>\n <Styled.SegmentAssetContainer $segmentType={segmentType}>\n <LottieAnimation src={card} settings={renderSettings} animateOnIntersect />\n </Styled.SegmentAssetContainer>\n\n {isCompleted && (\n <Styled.SegmentOverlay $segmentType={segmentType}>\n <Styled.IconWrapper>\n <CheckIcon color=\"#fff\" height={40} width={40} />\n </Styled.IconWrapper>\n </Styled.SegmentOverlay>\n )}\n </Styled.SegmentContentContainer>\n </Styled.SegmentContainer>\n );\n },\n);\n\nconst SegmentedGameCardComponent: ForwardRefRenderFunction<\n ISegmentedGameCardRefs,\n ISegmentedGameCardProps\n> = ({ data, label: gameCategoryLabel, initialValue = 0, value, maxValue = 1 }, ref) => {\n const labelRef = useRef<HTMLDivElement>(null)
|
|
1
|
+
{"version":3,"file":"segmented-game-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.tsx"],"sourcesContent":["import type { TColorNames } from '../../../../ui/types';\nimport type {\n IGameCardSegmentContentProps,\n ISegmentedGameCardProps,\n ISegmentedGameCardRefs,\n} from './segmented-game-card-types';\nimport type { ForwardRefRenderFunction } from 'react';\n\nimport React, {\n forwardRef,\n memo,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport CheckIcon from '../../../../../assets/line-icons/icons/check';\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport { CardContainer } from '../card-container/card-container';\nimport * as Styled from './segmented-game-card-styled';\n\nconst renderSettings = { renderer: 'canvas', loop: true };\n\nexport const SegmentContent = memo(\n ({ segmentType, isCompleted, card, name, onMouseEnter }: IGameCardSegmentContentProps) => {\n const handleMouseEnter = useCallback(() => onMouseEnter(name), [onMouseEnter, name]);\n\n return (\n <Styled.SegmentContainer>\n <Styled.SegmentContentContainer $segmentType={segmentType} onMouseEnter={handleMouseEnter}>\n <Styled.SegmentAssetContainer $segmentType={segmentType}>\n <LottieAnimation src={card} settings={renderSettings} animateOnIntersect />\n </Styled.SegmentAssetContainer>\n\n {isCompleted && (\n <Styled.SegmentOverlay $segmentType={segmentType}>\n <Styled.IconWrapper>\n <CheckIcon color=\"#fff\" height={40} width={40} />\n </Styled.IconWrapper>\n </Styled.SegmentOverlay>\n )}\n </Styled.SegmentContentContainer>\n </Styled.SegmentContainer>\n );\n },\n);\n\nconst SegmentedGameCardComponent: ForwardRefRenderFunction<\n ISegmentedGameCardRefs,\n ISegmentedGameCardProps\n> = ({ data, label: gameCategoryLabel, initialValue = 0, value, maxValue = 1 }, ref) => {\n const labelRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const cardWrapperRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n\n const [label, setLabel] = useState<string>(gameCategoryLabel);\n const [isAnimated, setIsAnimated] = useState(false);\n const [animatedColor, setAnimatedColor] = useState<TColorNames>('WHITE_T_87');\n\n const isLabelHighlighted = label !== gameCategoryLabel;\n\n const onMouseEnter = useCallback((gameName: string) => {\n setLabel(gameName);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setLabel(gameCategoryLabel);\n }, [gameCategoryLabel]);\n\n const onSegmentPress = useCallback(\n (index: number) => {\n data[index]?.onPress?.();\n },\n [data],\n );\n\n const startLabelAnimation = useCallback((color: TColorNames) => {\n setIsAnimated(true);\n setAnimatedColor(color);\n }, []);\n\n useImperativeHandle(ref, () => ({\n labelRef,\n segmentedCardWrapperRef: cardWrapperRef,\n startLabelAnimation,\n }));\n\n const animationSegments: [number, number] | undefined = useMemo(() => {\n if (maxValue <= 0) {\n return;\n }\n\n const totalFrames = 92;\n const framesPerValue = totalFrames / maxValue;\n\n const initialFrameToPlay = Math.min(framesPerValue * initialValue, totalFrames);\n const finalFrameToPlay = Math.min(framesPerValue * value + 1, totalFrames);\n\n return [initialFrameToPlay, finalFrameToPlay];\n }, [initialValue, maxValue, value]);\n\n const levelUpAnimationSettings = useMemo(\n () => ({\n renderer: 'canvas',\n autoplay: true,\n loop: false,\n initialSegment: animationSegments,\n }),\n [animationSegments],\n );\n\n return (\n <CardContainer\n ref={cardWrapperRef}\n labelRef={labelRef}\n label={label}\n isAnimated={isAnimated}\n onMouseLeave={onMouseLeave}\n labelColor={isAnimated ? animatedColor : isLabelHighlighted ? 'WHITE_T_87' : 'WHITE_T_60'}\n >\n <Styled.CircularProgressLottieContainer>\n <Styled.RingContainer>\n <Styled.LottieAnmationContainer>\n <LottieAnimation\n src={LOTTIE.LEVELUP_RINGS}\n settings={levelUpAnimationSettings}\n animateOnIntersect\n />\n </Styled.LottieAnmationContainer>\n </Styled.RingContainer>\n </Styled.CircularProgressLottieContainer>\n {/* left segment */}\n <Styled.SegmentLeft onClick={() => onSegmentPress(0)}>\n <SegmentContent\n segmentType={'left'}\n card={data[0]!.card}\n name={data[0]!.name}\n isCompleted={data[0]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentLeft>\n\n {/* right segment */}\n <Styled.SegmentRight onClick={() => onSegmentPress(1)}>\n <SegmentContent\n segmentType={'right'}\n card={data[1]!.card}\n name={data[1]!.name}\n isCompleted={data[1]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentRight>\n\n {/* bottom segment */}\n <Styled.SegmentBottom onClick={() => onSegmentPress(2)}>\n <SegmentContent\n segmentType={'bottom'}\n card={data[2]!.card}\n name={data[2]!.name}\n isCompleted={data[2]!.isCompleted}\n onMouseEnter={onMouseEnter}\n />\n </Styled.SegmentBottom>\n </CardContainer>\n );\n};\n\nexport const SegmentedGameCard = memo(forwardRef(SegmentedGameCardComponent));\n"],"names":["renderSettings","SegmentContent","memo","segmentType","isCompleted","card","name","onMouseEnter","handleMouseEnter","useCallback","jsx","Styled.SegmentContainer","jsxs","Styled.SegmentContentContainer","Styled.SegmentAssetContainer","LottieAnimation","Styled.SegmentOverlay","Styled.IconWrapper","CheckIcon","SegmentedGameCardComponent","data","gameCategoryLabel","initialValue","value","maxValue","ref","labelRef","useRef","cardWrapperRef","label","setLabel","useState","isAnimated","setIsAnimated","animatedColor","setAnimatedColor","isLabelHighlighted","gameName","onMouseLeave","onSegmentPress","index","_b","_a","startLabelAnimation","color","useImperativeHandle","animationSegments","useMemo","totalFrames","framesPerValue","initialFrameToPlay","finalFrameToPlay","levelUpAnimationSettings","CardContainer","Styled.CircularProgressLottieContainer","Styled.RingContainer","Styled.LottieAnmationContainer","LOTTIE","Styled.SegmentLeft","Styled.SegmentRight","Styled.SegmentBottom","SegmentedGameCard","forwardRef"],"mappings":";;;;;;;AAwBA,MAAMA,IAAiB,EAAE,UAAU,UAAU,MAAM,GAAK,GAE3CC,IAAiBC;AAAA,EAC5B,CAAC,EAAE,aAAAC,GAAa,aAAAC,GAAa,MAAAC,GAAM,MAAAC,GAAM,cAAAC,QAAiD;AAClF,UAAAC,IAAmBC,EAAY,MAAMF,EAAaD,CAAI,GAAG,CAACC,GAAcD,CAAI,CAAC;AAGjF,WAAA,gBAAAI,EAACC,GAAA,EACC,UAAA,gBAAAC,EAACC,GAAA,EAA+B,cAAcV,GAAa,cAAcK,GACvE,UAAA;AAAA,MAAA,gBAAAE,EAACI,GAAA,EAA6B,cAAcX,GAC1C,UAAA,gBAAAO,EAACK,GAAgB,EAAA,KAAKV,GAAM,UAAUL,GAAgB,oBAAkB,GAAC,CAAA,GAC3E;AAAA,MAECI,uBACEY,GAAA,EAAsB,cAAcb,GACnC,4BAACc,GAAA,EACC,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ACb,MAAMmB,EAAK,CAAC,EAAG;AAAA,YACf,MAAMA,EAAK,CAAC,EAAG;AAAA,YACf,aAAaA,EAAK,CAAC,EAAG;AAAA,YACtB,cAAAb;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,QAGA,gBAAAG,EAACkD,GAAA,EAAqB,SAAS,MAAMrB,EAAe,CAAC,GACnD,UAAA,gBAAA7B;AAAA,UAACT;AAAA,UAAA;AAAA,YACC,aAAa;AAAA,YACb,MAAMmB,EAAK,CAAC,EAAG;AAAA,YACf,MAAMA,EAAK,CAAC,EAAG;AAAA,YACf,aAAaA,EAAK,CAAC,EAAG;AAAA,YACtB,cAAAb;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEasD,KAAoB3D,EAAK4D,EAAW3C,CAA0B,CAAC;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import I from "react";
|
|
3
|
+
import { LOTTIE as e } from "../../../../../../assets/lottie/lottie.js";
|
|
4
|
+
import r from "../../../../../ui/lottie-animation/lottie-animation.js";
|
|
5
|
+
import { InfiniteButtonWrapper as d, ExtendedAbsoluteView as n } from "../tables-card-styled.js";
|
|
6
|
+
const i = {
|
|
7
|
+
renderer: "canvas"
|
|
8
|
+
}, f = ({
|
|
9
|
+
onClick: o,
|
|
10
|
+
onMouseOver: s,
|
|
11
|
+
onMouseLeave: m,
|
|
12
|
+
buttonRef: a
|
|
13
|
+
}) => /* @__PURE__ */ c(
|
|
14
|
+
d,
|
|
15
|
+
{
|
|
16
|
+
ref: a,
|
|
17
|
+
onClick: o,
|
|
18
|
+
onMouseOver: s,
|
|
19
|
+
onMouseLeave: m,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
|
|
22
|
+
r,
|
|
23
|
+
{
|
|
24
|
+
src: e.INFINITE_BUTTON_BG,
|
|
25
|
+
settings: i,
|
|
26
|
+
animateOnIntersect: !0
|
|
27
|
+
}
|
|
28
|
+
) }),
|
|
29
|
+
/* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
|
|
30
|
+
r,
|
|
31
|
+
{
|
|
32
|
+
src: e.INFINITE_BUTTON_SYMBOL,
|
|
33
|
+
settings: i,
|
|
34
|
+
animateOnIntersect: !0
|
|
35
|
+
}
|
|
36
|
+
) })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
), N = I.memo(f);
|
|
40
|
+
export {
|
|
41
|
+
N as default
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=infinite-mode-launcher-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infinite-mode-launcher-button.js","sources":["../../../../../../../src/features/circle-games/game-launcher/comps/tables-card/infinite-button/infinite-mode-launcher-button.tsx"],"sourcesContent":["import type { InfiniteButtonCardProps } from './infinite-mode-launcher-button-type';\n\nimport React from 'react';\n\nimport { LOTTIE } from '../../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../../ui/lottie-animation/lottie-animation';\nimport * as Styled from '../tables-card-styled';\n\nconst rendererSettings = {\n renderer: 'canvas',\n};\n\nconst InfiniteButtonCard: React.FC<InfiniteButtonCardProps> = ({\n onClick,\n onMouseOver,\n onMouseLeave,\n buttonRef,\n}) => {\n return (\n <Styled.InfiniteButtonWrapper\n ref={buttonRef}\n onClick={onClick}\n onMouseOver={onMouseOver}\n onMouseLeave={onMouseLeave}\n >\n <Styled.ExtendedAbsoluteView>\n <LottieAnimation\n src={LOTTIE.INFINITE_BUTTON_BG}\n settings={rendererSettings}\n animateOnIntersect\n />\n </Styled.ExtendedAbsoluteView>\n <Styled.ExtendedAbsoluteView>\n <LottieAnimation\n src={LOTTIE.INFINITE_BUTTON_SYMBOL}\n settings={rendererSettings}\n animateOnIntersect\n />\n </Styled.ExtendedAbsoluteView>\n </Styled.InfiniteButtonWrapper>\n );\n};\n\nexport default React.memo(InfiniteButtonCard);\n"],"names":["rendererSettings","InfiniteButtonCard","onClick","onMouseOver","onMouseLeave","buttonRef","jsxs","Styled.InfiniteButtonWrapper","jsx","Styled.ExtendedAbsoluteView","LottieAnimation","LOTTIE","InfiniteButtonCard$1","React"],"mappings":";;;;;AAQA,MAAMA,IAAmB;AAAA,EACvB,UAAU;AACZ,GAEMC,IAAwD,CAAC;AAAA,EAC7D,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AACF,MAEI,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,KAAKF;AAAA,IACL,SAAAH;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC;AAAA,IAEA,UAAA;AAAA,MAAC,gBAAAI,EAAAC,GAAA,EACC,UAAA,gBAAAD;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,KAAKC,EAAO;AAAA,UACZ,UAAUX;AAAA,UACV,oBAAkB;AAAA,QAAA;AAAA,MAAA,GAEtB;AAAA,MACA,gBAAAQ,EAACC,GAAA,EACC,UAAA,gBAAAD;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,KAAKC,EAAO;AAAA,UACZ,UAAUX;AAAA,UACV,oBAAkB;AAAA,QAAA;AAAA,MAAA,GAEtB;AAAA,IAAA;AAAA,EAAA;AAAA,GAKNY,IAAeC,EAAM,KAAKZ,CAAkB;"}
|