@cuemath/leap 2.8.61-as1 → 2.8.61-as11
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/line-icons/icons/chevron-left.js.map +1 -1
- package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js +23 -22
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item-styled.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js +88 -74
- package/dist/features/chapters/chapters-list/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/chapters/chapters-list/chapters-list.js +17 -18
- package/dist/features/chapters/chapters-list/chapters-list.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js +39 -39
- package/dist/features/chapters-v2/chapter-details/block-sections/block-section-view.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +32 -28
- package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js +22 -22
- package/dist/features/chapters-v2/chapter-details/chapter-banner/chapter-banner.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js +6 -6
- package/dist/features/chapters-v2/comps/node-card/node-card-tags.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +70 -71
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js +0 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/chapters-v2/utils/index.js +4 -4
- package/dist/features/chapters-v2/utils/index.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +59 -42
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +5 -2
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/card-menu-options.js +35 -20
- package/dist/features/homework/card-menu-options.js.map +1 -1
- package/dist/features/homework/homework-card.js +241 -161
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/api/get-homeworks.js +10 -0
- package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +53 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js +164 -0
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -0
- package/dist/features/homework/node-progress.js +29 -0
- package/dist/features/homework/node-progress.js.map +1 -0
- package/dist/features/homework/styles.js +41 -38
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js +42 -49
- package/dist/features/milestone/create/comps/chapter-item/chapter-item.js.map +1 -1
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +14 -20
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js.map +1 -1
- package/dist/features/milestone/create/comps/sheets-list/sheets-list.js +26 -50
- package/dist/features/milestone/create/comps/sheets-list/sheets-list.js.map +1 -1
- package/dist/features/milestone/create/utils/index.js +33 -38
- package/dist/features/milestone/create/utils/index.js.map +1 -1
- package/dist/features/milestone/edit/goal-edit-helpers.js +50 -53
- package/dist/features/milestone/edit/goal-edit-helpers.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +10 -10
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +17 -15
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js +10 -0
- package/dist/features/milestone/milestone-tests/tests-list/test-sheets-list/test-sheet-item/test-sheet-item-utils.js.map +1 -0
- package/dist/features/recent-chapters/recent-chapters.js +17 -23
- package/dist/features/recent-chapters/recent-chapters.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +12 -10
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +54 -24
- package/dist/index.js +41 -37
- package/dist/index.js.map +1 -1
- package/dist/node_modules/date-fns/differenceInDays.js +17 -0
- package/dist/node_modules/date-fns/differenceInDays.js.map +1 -0
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chevron-left.js","sources":["../../../../src/assets/line-icons/icons/chevron-left.tsx"],"sourcesContent":["import React from 'react';\n\ninterface IconProps extends React.SVGProps<SVGSVGElement> {}\n\nconst ChevronLeft: React.FC<IconProps> = props => (\n <svg\n fill=\"none\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M7.3335 11.4C10.684 11.4 13.4002 8.68386 13.4002 5.33333H14.6002C14.6002 8.31725 12.8016 10.8811 10.2295 12C12.8016 13.1189 14.6002 15.6827 14.6002 18.6667H13.4002C13.4002 15.3161 10.684 12.6 7.3335 12.6V11.4Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default ChevronLeft;\n"],"names":["ChevronLeft","props","jsx","
|
1
|
+
{"version":3,"file":"chevron-left.js","sources":["../../../../src/assets/line-icons/icons/chevron-left.tsx"],"sourcesContent":["import React from 'react';\n\ninterface IconProps extends React.SVGProps<SVGSVGElement> {}\n\nconst ChevronLeft: React.FC<IconProps> = props => (\n <svg\n fill=\"none\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M7.3335 11.4C10.684 11.4 13.4002 8.68386 13.4002 5.33333H14.6002C14.6002 8.31725 12.8016 10.8811 10.2295 12C12.8016 13.1189 14.6002 15.6827 14.6002 18.6667H13.4002C13.4002 15.3161 10.684 12.6 7.3335 12.6V11.4Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default ChevronLeft;\n"],"names":["ChevronLeft","props","jsx","ChevronLeftIcon"],"mappings":";AAIA,MAAMA,IAAmC,CACvCC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,MAAA;AAAA,IACP;AAAA,EAAA;AACF,GAGFC,IAAeH;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chevron-right.js","sources":["../../../../src/assets/line-icons/icons/chevron-right.tsx"],"sourcesContent":["import React from 'react';\n\ninterface IconProps extends React.SVGProps<SVGSVGElement> {}\n\nconst ChevronRight: React.FC<IconProps> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.666 12.6C13.3155 12.6 10.5993 15.3161 10.5993 18.6666H9.39935C9.39935 15.6827 11.1979 13.1188 13.77 12C11.1979 10.8811 9.39935 8.31722 9.39935 5.33329H10.5993C10.5993 8.68382 13.3155 11.4 16.666 11.4V12.6Z\"\n fill=\"currentColor\"\n fillOpacity=\"1\"\n />\n </svg>\n);\n\nexport default ChevronRight;\n"],"names":["ChevronRight","props","jsx","
|
1
|
+
{"version":3,"file":"chevron-right.js","sources":["../../../../src/assets/line-icons/icons/chevron-right.tsx"],"sourcesContent":["import React from 'react';\n\ninterface IconProps extends React.SVGProps<SVGSVGElement> {}\n\nconst ChevronRight: React.FC<IconProps> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.666 12.6C13.3155 12.6 10.5993 15.3161 10.5993 18.6666H9.39935C9.39935 15.6827 11.1979 13.1188 13.77 12C11.1979 10.8811 9.39935 8.31722 9.39935 5.33329H10.5993C10.5993 8.68382 13.3155 11.4 16.666 11.4V12.6Z\"\n fill=\"currentColor\"\n fillOpacity=\"1\"\n />\n </svg>\n);\n\nexport default ChevronRight;\n"],"names":["ChevronRight","props","jsx","ChevronRightIcon"],"mappings":";AAIA,MAAMA,IAAoC,CACxCC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF,GAGFC,IAAeH;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import r, { keyframes as l, css as d } from "styled-components";
|
2
2
|
import o from "../../../ui/layout/flex-view.js";
|
3
3
|
import h from "../../../ui/text/text.js";
|
4
4
|
const g = l`
|
@@ -11,9 +11,9 @@ const g = l`
|
|
11
11
|
transform: translate(-150%, 100%) skewX(45deg);
|
12
12
|
opacity: 1;
|
13
13
|
}
|
14
|
-
`, u =
|
14
|
+
`, u = r(o)`
|
15
15
|
transition: scale 0.3s ease-in-out;
|
16
|
-
`, x =
|
16
|
+
`, x = r(o)`
|
17
17
|
position: absolute;
|
18
18
|
width: 100%;
|
19
19
|
height: 100%;
|
@@ -40,59 +40,60 @@ const g = l`
|
|
40
40
|
transform: translate(100%, -100%) skew(45deg);
|
41
41
|
pointer-events: none;
|
42
42
|
}
|
43
|
-
`,
|
43
|
+
`, w = r.svg(({ theme: t }) => `
|
44
44
|
position: absolute;
|
45
45
|
z-index: ${t.zIndex.CHAPTER_PROGRESS_SVG};
|
46
46
|
inset: 50%;
|
47
47
|
transform: translate(-50%, -50%) rotate(-90deg);
|
48
|
-
`),
|
49
|
-
({ theme: t, $progressCircle:
|
50
|
-
const { GREY_2: n, BLACK: p } = t.colors, { gutter: a } = t.layout, i = a * 18.625, c =
|
48
|
+
`), m = r.circle(
|
49
|
+
({ theme: t, $progressCircle: e, $progress: s }) => {
|
50
|
+
const { GREY_2: n, BLACK: p } = t.colors, { gutter: a } = t.layout, i = a * 18.625, c = e ? i - s : s;
|
51
51
|
return `
|
52
52
|
stroke-dasharray: ${i};
|
53
53
|
stroke-dashoffset: ${c};
|
54
|
-
stroke: ${
|
54
|
+
stroke: ${e ? p : n};
|
55
55
|
|
56
56
|
stroke-width: ${a * 0.125}px;
|
57
57
|
fill: none;
|
58
58
|
`;
|
59
59
|
}
|
60
|
-
), $ =
|
61
|
-
const { gutter:
|
60
|
+
), $ = r.img(({ theme: t }) => {
|
61
|
+
const { gutter: e } = t.layout;
|
62
62
|
return `
|
63
63
|
display: block;
|
64
|
-
width: ${
|
65
|
-
height: ${
|
64
|
+
width: ${e * 6}px;
|
65
|
+
height: ${e * 6}px;
|
66
66
|
border-radius: 50%;
|
67
67
|
`;
|
68
|
-
}), y =
|
69
|
-
const { layout:
|
68
|
+
}), y = r.div(({ theme: t }) => {
|
69
|
+
const { layout: e } = t;
|
70
70
|
return `
|
71
71
|
position: absolute;
|
72
72
|
top: 5px;
|
73
73
|
right: 5px;
|
74
74
|
z-index: 2;
|
75
75
|
|
76
|
-
width: ${
|
77
|
-
height: ${
|
76
|
+
width: ${e.gutter * 1.25}px;
|
77
|
+
height: ${e.gutter * 1.25}px;
|
78
78
|
border-radius: 50%;
|
79
79
|
background: ${t.colors.WHITE_1};
|
80
80
|
outline: 1px solid ${t.colors.BLACK_1};
|
81
81
|
`;
|
82
|
-
}), C =
|
82
|
+
}), C = r(h)`
|
83
83
|
display: -webkit-box;
|
84
84
|
-webkit-box-orient: vertical;
|
85
85
|
-webkit-line-clamp: 2;
|
86
86
|
text-overflow: ellipsis;
|
87
87
|
overflow: hidden;
|
88
|
-
|
89
|
-
|
88
|
+
height: 44px;
|
89
|
+
`, v = r(o)`
|
90
|
+
cursor: ${({ shouldHideClick: t }) => t ? "not-allowed" : "pointer"};
|
90
91
|
position: relative;
|
91
92
|
box-shadow: inset 0px 0px 0px 0.5px ${({ theme: t }) => t.colors.BLACK_T_15};
|
92
93
|
aspect-ratio: 1;
|
93
94
|
|
94
95
|
&:hover {
|
95
|
-
background: ${({ theme: t, $bgColor:
|
96
|
+
background: ${({ theme: t, $bgColor: e }) => e ? t.colors[e] : "none"};
|
96
97
|
|
97
98
|
${u} {
|
98
99
|
scale: 1.05;
|
@@ -110,8 +111,8 @@ export {
|
|
110
111
|
u as ChapterImageWrapper,
|
111
112
|
v as ChapterItemWrapper,
|
112
113
|
C as ChapterName,
|
113
|
-
|
114
|
-
|
114
|
+
w as ChapterProgressSVG,
|
115
|
+
m as ChapterProgressSVGCircle,
|
115
116
|
x as ChapterProgressWrapper,
|
116
117
|
y as StyledCheckIconWrapper
|
117
118
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-item-styled.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item-styled.tsx"],"sourcesContent":["import type { TColorNames } from '../../../ui/types';\n\nimport styled, { css, keyframes } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\nconst shimmerEffect = keyframes`\n 0% {\n transform: translate(100%, -100%) skewX(45deg);\n opacity: 0;\n }\n\n 100% {\n transform: translate(-150%, 100%) skewX(45deg);\n opacity: 1;\n }\n`;\n\nconst ChapterImageWrapper = styled(FlexView)`\n transition: scale 0.3s ease-in-out;\n`;\n\nconst ChapterProgressWrapper = styled(FlexView)`\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n overflow: hidden;\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n width: 40%;\n height: 150%;\n background: linear-gradient(\n to right,\n rgba(255, 255, 255, 0.7) 0%,\n rgba(255, 255, 255, 0.1) 35%,\n rgba(255, 255, 255, 0.7) 40%,\n rgba(255, 255, 255, 0.7) 80%,\n rgba(255, 255, 255, 0) 100%\n );\n opacity: 0;\n transform: translate(100%, -100%) skew(45deg);\n pointer-events: none;\n }\n`;\n\nconst ChapterProgressSVG = styled.svg(({ theme }) => {\n return `\n position: absolute;\n z-index: ${theme.zIndex.CHAPTER_PROGRESS_SVG};\n inset: 50%;\n transform: translate(-50%, -50%) rotate(-90deg);\n `;\n});\n\ninterface IChapterProgressSVGCircleProps {\n $progressCircle?: boolean;\n $progress: number;\n}\n\nconst ChapterProgressSVGCircle = styled.circle<IChapterProgressSVGCircleProps>(\n ({ theme, $progressCircle, $progress }) => {\n const { GREY_2, BLACK } = theme.colors;\n const { gutter } = theme.layout;\n\n const strokeDashArray = gutter * 18.625;\n const strokeDashOffset = $progressCircle ? strokeDashArray - $progress : $progress;\n\n return `\n stroke-dasharray: ${strokeDashArray};\n stroke-dashoffset: ${strokeDashOffset};\n stroke: ${$progressCircle ? BLACK : GREY_2};\n\n stroke-width: ${gutter * 0.125}px;\n fill: none;\n `;\n },\n);\n\nconst ChapterImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n display: block;\n width: ${gutter * 6}px;\n height: ${gutter * 6}px;\n border-radius: 50%;\n `;\n});\n\nconst StyledCheckIconWrapper = styled.div(({ theme }) => {\n const { layout } = theme;\n\n return `\n position: absolute;\n top: 5px;\n right: 5px;\n z-index: 2;\n\n width: ${layout.gutter * 1.25}px;\n height: ${layout.gutter * 1.25}px;\n border-radius: 50%;\n background: ${theme.colors.WHITE_1};\n outline: 1px solid ${theme.colors.BLACK_1};\n `;\n});\n\nconst ChapterName = styled(Text)`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n`;\n\ninterface IChapterItemWrapperProps {\n $bgColor?: TColorNames;\n}\n\nconst ChapterItemWrapper = styled(FlexView)<IChapterItemWrapperProps>`\n cursor: pointer;\n position: relative;\n box-shadow: inset 0px 0px 0px 0.5px ${({ theme }) => theme.colors.BLACK_T_15};\n aspect-ratio: 1;\n\n &:hover {\n background: ${({ theme, $bgColor }) => ($bgColor ? theme.colors[$bgColor] : 'none')};\n\n ${ChapterImageWrapper} {\n scale: 1.05;\n }\n\n ${ChapterProgressWrapper}::after {\n ${css`\n animation: ${shimmerEffect} 1.2s ease-out forwards;\n `}\n }\n }\n`;\n\nexport {\n ChapterImageWrapper,\n ChapterProgressWrapper,\n ChapterImage,\n ChapterItemWrapper,\n ChapterName,\n ChapterProgressSVG,\n ChapterProgressSVGCircle,\n StyledCheckIconWrapper,\n};\n"],"names":["shimmerEffect","keyframes","ChapterImageWrapper","styled","FlexView","ChapterProgressWrapper","ChapterProgressSVG","theme","ChapterProgressSVGCircle","$progressCircle","$progress","GREY_2","BLACK","gutter","strokeDashArray","strokeDashOffset","ChapterImage","StyledCheckIconWrapper","layout","ChapterName","Text","ChapterItemWrapper","$bgColor","css"],"mappings":";;;AAOA,MAAMA,IAAgBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAYhBC,IAAsBC,EAAOC,CAAQ;AAAA;AAAA,GAIrCC,IAAyBF,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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ourcesContent":["import type { TColorNames } from '../../../ui/types';\n\nimport styled, { css, keyframes } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\nconst shimmerEffect = keyframes`\n 0% {\n transform: translate(100%, -100%) skewX(45deg);\n opacity: 0;\n }\n\n 100% {\n transform: translate(-150%, 100%) skewX(45deg);\n opacity: 1;\n }\n`;\n\nconst ChapterImageWrapper = styled(FlexView)`\n transition: scale 0.3s ease-in-out;\n`;\n\nconst ChapterProgressWrapper = styled(FlexView)`\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n overflow: hidden;\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1;\n width: 40%;\n height: 150%;\n background: linear-gradient(\n to right,\n rgba(255, 255, 255, 0.7) 0%,\n rgba(255, 255, 255, 0.1) 35%,\n rgba(255, 255, 255, 0.7) 40%,\n rgba(255, 255, 255, 0.7) 80%,\n rgba(255, 255, 255, 0) 100%\n );\n opacity: 0;\n transform: translate(100%, -100%) skew(45deg);\n pointer-events: none;\n }\n`;\n\nconst ChapterProgressSVG = styled.svg(({ theme }) => {\n return `\n position: absolute;\n z-index: ${theme.zIndex.CHAPTER_PROGRESS_SVG};\n inset: 50%;\n transform: translate(-50%, -50%) rotate(-90deg);\n `;\n});\n\ninterface IChapterProgressSVGCircleProps {\n $progressCircle?: boolean;\n $progress: number;\n}\n\nconst ChapterProgressSVGCircle = styled.circle<IChapterProgressSVGCircleProps>(\n ({ theme, $progressCircle, $progress }) => {\n const { GREY_2, BLACK } = theme.colors;\n const { gutter } = theme.layout;\n\n const strokeDashArray = gutter * 18.625;\n const strokeDashOffset = $progressCircle ? strokeDashArray - $progress : $progress;\n\n return `\n stroke-dasharray: ${strokeDashArray};\n stroke-dashoffset: ${strokeDashOffset};\n stroke: ${$progressCircle ? BLACK : GREY_2};\n\n stroke-width: ${gutter * 0.125}px;\n fill: none;\n `;\n },\n);\n\nconst ChapterImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n display: block;\n width: ${gutter * 6}px;\n height: ${gutter * 6}px;\n border-radius: 50%;\n `;\n});\n\nconst StyledCheckIconWrapper = styled.div(({ theme }) => {\n const { layout } = theme;\n\n return `\n position: absolute;\n top: 5px;\n right: 5px;\n z-index: 2;\n\n width: ${layout.gutter * 1.25}px;\n height: ${layout.gutter * 1.25}px;\n border-radius: 50%;\n background: ${theme.colors.WHITE_1};\n outline: 1px solid ${theme.colors.BLACK_1};\n `;\n});\n\nconst ChapterName = styled(Text)`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n height: 44px;\n`;\n\ninterface IChapterItemWrapperProps {\n $bgColor?: TColorNames;\n shouldHideClick?: boolean;\n}\n\nconst ChapterItemWrapper = styled(FlexView)<IChapterItemWrapperProps>`\n cursor: ${({ shouldHideClick }) => (shouldHideClick ? 'not-allowed' : 'pointer')};\n position: relative;\n box-shadow: inset 0px 0px 0px 0.5px ${({ theme }) => theme.colors.BLACK_T_15};\n aspect-ratio: 1;\n\n &:hover {\n background: ${({ theme, $bgColor }) => ($bgColor ? theme.colors[$bgColor] : 'none')};\n\n ${ChapterImageWrapper} {\n scale: 1.05;\n }\n\n ${ChapterProgressWrapper}::after {\n ${css`\n animation: ${shimmerEffect} 1.2s ease-out forwards;\n `}\n }\n }\n`;\n\nexport {\n ChapterImageWrapper,\n ChapterProgressWrapper,\n ChapterImage,\n ChapterItemWrapper,\n ChapterName,\n ChapterProgressSVG,\n ChapterProgressSVGCircle,\n StyledCheckIconWrapper,\n};\n"],"names":["shimmerEffect","keyframes","ChapterImageWrapper","styled","FlexView","ChapterProgressWrapper","ChapterProgressSVG","theme","ChapterProgressSVGCircle","$progressCircle","$progress","GREY_2","BLACK","gutter","strokeDashArray","strokeDashOffset","ChapterImage","StyledCheckIconWrapper","layout","ChapterName","Text","ChapterItemWrapper","shouldHideClick","$bgColor","css"],"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;AAAA;AAAA,kBAEhBX,EAAM,OAAO,OAAO;AAAA,yBACbA,EAAM,OAAO,OAAO;AAAA;AAE7C,CAAC,GAEKY,IAAchB,EAAOiB,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAczBC,IAAqBlB,EAAOC,CAAQ;AAAA,YAC9B,CAAC,EAAE,iBAAAkB,EAAA,MAAuBA,IAAkB,gBAAgB,SAAU;AAAA;AAAA,wCAE1C,CAAC,EAAE,OAAAf,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA,kBAI5D,CAAC,EAAE,OAAAA,GAAO,UAAAgB,QAAgBA,IAAWhB,EAAM,OAAOgB,CAAQ,IAAI,MAAO;AAAA;AAAA,MAEjFrB,CAAmB;AAAA;AAAA;AAAA;AAAA,MAInBG,CAAsB;AAAA,QACpBmB;AAAA,qBACaxB,CAAa;AAAA,OAC3B;AAAA;AAAA;AAAA;"}
|
@@ -1,87 +1,101 @@
|
|
1
|
-
import {
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import { ChapterItemWrapper as
|
7
|
-
const
|
8
|
-
({ milestoneId:
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
2
|
+
import { memo as T, useState as b, useRef as S, useCallback as W, useLayoutEffect as _ } from "react";
|
3
|
+
import k from "../../../../assets/line-icons/icons/check2.js";
|
4
|
+
import h from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
|
+
import A from "../../../ui/layout/flex-view.js";
|
6
|
+
import { ChapterItemWrapper as H, ChapterImageWrapper as P, ChapterProgressWrapper as j, ChapterProgressSVG as G, ChapterProgressSVGCircle as m, ChapterImage as V, StyledCheckIconWrapper as X, ChapterName as z } from "./chapter-item-styled.js";
|
7
|
+
const F = T(
|
8
|
+
({ milestoneId: o, chapter: i, onChapterClick: a, itemIndex: d }) => {
|
9
9
|
const {
|
10
|
-
name:
|
11
|
-
image_url:
|
12
|
-
progress_stat:
|
13
|
-
image_hue:
|
14
|
-
} =
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
10
|
+
name: l,
|
11
|
+
image_url: g,
|
12
|
+
progress_stat: u,
|
13
|
+
image_hue: C
|
14
|
+
} = i, { mandatory: $, optional: f } = u || {}, { completed: s = 0, total: c = 0 } = $ || {}, { total: I = 0 } = f || {}, [x, w] = b(!1), t = S(null), p = s > 0 ? Math.floor((s / c || 1) * 100) : 0, r = c + I, y = W(() => {
|
15
|
+
if (r === 0)
|
16
|
+
return null;
|
17
|
+
a(i, o);
|
18
|
+
}, [i, o, a, r]);
|
19
|
+
return _(() => {
|
20
|
+
t.current && t.current.scrollHeight > t.current.clientHeight && w(!0);
|
21
|
+
}, [t]), /* @__PURE__ */ e(
|
22
|
+
h,
|
21
23
|
{
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
24
|
+
renderAs: "primary",
|
25
|
+
position: "bottom",
|
26
|
+
tooltipItem: "Coming soon! We’re building this chapter",
|
27
|
+
hidden: r > 0,
|
28
|
+
parentWidth: "100%",
|
29
|
+
zIndex: 5,
|
30
|
+
children: /* @__PURE__ */ n(
|
31
|
+
H,
|
32
|
+
{
|
33
|
+
id: `milestone-chapter-${o || ""}-${d}`,
|
34
|
+
$alignItems: "center",
|
35
|
+
$gapX: 1,
|
36
|
+
$gutterX: 1,
|
37
|
+
$flexGap: 8,
|
38
|
+
$background: "WHITE_1",
|
39
|
+
onClick: y,
|
40
|
+
className: "goal-widget-chapter-item",
|
41
|
+
$bgColor: `${C}_1`,
|
42
|
+
shouldHideClick: r === 0,
|
43
|
+
children: [
|
44
|
+
/* @__PURE__ */ n(
|
45
|
+
P,
|
46
|
+
{
|
47
|
+
$width: "fit-content",
|
48
|
+
$position: "relative",
|
49
|
+
$justifyContent: "center",
|
50
|
+
$alignItems: "center",
|
51
|
+
children: [
|
52
|
+
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ n(G, { width: "96px", height: "96px", children: [
|
53
|
+
/* @__PURE__ */ e(m, { $progress: 0, r: "47", cx: "48", cy: "48" }),
|
54
|
+
/* @__PURE__ */ e(
|
55
|
+
m,
|
56
|
+
{
|
57
|
+
$progressCircle: !0,
|
58
|
+
$progress: p * 2.98,
|
59
|
+
r: "47",
|
60
|
+
cx: "48",
|
61
|
+
cy: "48"
|
62
|
+
}
|
63
|
+
)
|
64
|
+
] }) }),
|
65
|
+
/* @__PURE__ */ e(V, { src: g, alt: "Chapter Image" }),
|
66
|
+
p === 100 && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(k, { width: 20, height: 20 }) })
|
67
|
+
]
|
68
|
+
}
|
69
|
+
),
|
70
|
+
/* @__PURE__ */ e(A, { $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ e(
|
71
|
+
h,
|
72
|
+
{
|
73
|
+
renderAs: "primary",
|
74
|
+
position: "bottom",
|
75
|
+
tooltipItem: l,
|
76
|
+
hidden: !x,
|
77
|
+
widthX: 21.75,
|
78
|
+
zIndex: 5,
|
79
|
+
children: /* @__PURE__ */ e(
|
80
|
+
z,
|
44
81
|
{
|
45
|
-
|
46
|
-
$
|
47
|
-
|
48
|
-
|
49
|
-
|
82
|
+
ref: t,
|
83
|
+
$renderAs: "ab2",
|
84
|
+
$color: "BLACK_T_87",
|
85
|
+
$align: "center",
|
86
|
+
children: l
|
50
87
|
}
|
51
88
|
)
|
52
|
-
] }) }),
|
53
|
-
/* @__PURE__ */ e(j, { src: h, alt: "Chapter Image" }),
|
54
|
-
s === 100 && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(y, { width: 20, height: 20 }) })
|
55
|
-
]
|
56
|
-
}
|
57
|
-
),
|
58
|
-
/* @__PURE__ */ e(S, { $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ e(
|
59
|
-
_,
|
60
|
-
{
|
61
|
-
renderAs: "primary",
|
62
|
-
position: "bottom",
|
63
|
-
tooltipItem: n,
|
64
|
-
hidden: !$,
|
65
|
-
widthX: 21.75,
|
66
|
-
zIndex: 5,
|
67
|
-
children: /* @__PURE__ */ e(
|
68
|
-
H,
|
69
|
-
{
|
70
|
-
ref: t,
|
71
|
-
$renderAs: "ab2",
|
72
|
-
$color: "BLACK_T_87",
|
73
|
-
$align: "center",
|
74
|
-
children: n
|
75
89
|
}
|
76
|
-
)
|
77
|
-
|
78
|
-
|
79
|
-
|
90
|
+
) })
|
91
|
+
]
|
92
|
+
}
|
93
|
+
)
|
80
94
|
}
|
81
95
|
);
|
82
96
|
}
|
83
97
|
);
|
84
98
|
export {
|
85
|
-
|
99
|
+
F as default
|
86
100
|
};
|
87
101
|
//# sourceMappingURL=chapter-item.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapter-item.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItemProps } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, useState, memo } from 'react';\n\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItemProps> = memo(\n ({ milestoneId, chapter, onChapterClick, itemIndex }) => {\n const {\n name,\n image_url: imageUrl,\n progress_stat: chapterProgressStat,\n image_hue: imageHue,\n } = chapter;\n const { completed = 0, total = 0 } =
|
1
|
+
{"version":3,"file":"chapter-item.js","sources":["../../../../../src/features/chapters/chapters-list/chapter-item/chapter-item.tsx"],"sourcesContent":["import type { IChapterItemProps } from './chapter-item-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, useState, memo } from 'react';\n\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport FlexView from '../../../ui/layout/flex-view';\nimport * as Styled from './chapter-item-styled';\n\nconst ChapterItem: FC<IChapterItemProps> = memo(\n ({ milestoneId, chapter, onChapterClick, itemIndex }) => {\n const {\n name,\n image_url: imageUrl,\n progress_stat: chapterProgressStat,\n image_hue: imageHue,\n } = chapter;\n const { mandatory, optional } = chapterProgressStat || {};\n const { completed = 0, total = 0 } = mandatory || {};\n const { total: optionalTotal = 0 } = optional || {};\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n const titleTextRef = useRef<HTMLDivElement>(null);\n const completionPercentage = completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n const totalSheets = total + optionalTotal;\n const handleOnChapterClick = useCallback(() => {\n if (totalSheets === 0) {\n return null;\n }\n\n onChapterClick(chapter, milestoneId);\n }, [chapter, milestoneId, onChapterClick, totalSheets]);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n return (\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem=\"Coming soon! We’re building this chapter\"\n hidden={totalSheets > 0}\n parentWidth=\"100%\"\n zIndex={5}\n >\n <Styled.ChapterItemWrapper\n id={`milestone-chapter-${milestoneId || ''}-${itemIndex}`}\n $alignItems=\"center\"\n $gapX={1}\n $gutterX={1}\n $flexGap={8}\n $background=\"WHITE_1\"\n onClick={handleOnChapterClick}\n className=\"goal-widget-chapter-item\"\n $bgColor={`${imageHue}_1`}\n shouldHideClick={totalSheets === 0}\n >\n <Styled.ChapterImageWrapper\n $width=\"fit-content\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n <Styled.ChapterProgressWrapper>\n <Styled.ChapterProgressSVG width=\"96px\" height=\"96px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"47\" cx=\"48\" cy=\"48\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progress={completionPercentage * 2.98}\n r=\"47\"\n cx=\"48\"\n cy=\"48\"\n />\n </Styled.ChapterProgressSVG>\n </Styled.ChapterProgressWrapper>\n\n <Styled.ChapterImage src={imageUrl} alt=\"Chapter Image\" />\n\n {completionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </Styled.ChapterImageWrapper>\n\n <FlexView $justifyContent=\"center\" $alignItems=\"center\">\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={name}\n hidden={!showTitleTooltip}\n widthX={21.75}\n zIndex={5}\n >\n <Styled.ChapterName\n ref={titleTextRef}\n $renderAs=\"ab2\"\n $color=\"BLACK_T_87\"\n $align=\"center\"\n >\n {name}\n </Styled.ChapterName>\n </ArrowTooltip>\n </FlexView>\n </Styled.ChapterItemWrapper>\n </ArrowTooltip>\n );\n },\n);\n\nexport default ChapterItem;\n"],"names":["ChapterItem","memo","milestoneId","chapter","onChapterClick","itemIndex","name","imageUrl","chapterProgressStat","imageHue","mandatory","optional","completed","total","optionalTotal","showTitleTooltip","setShowTitleTooltip","useState","titleTextRef","useRef","completionPercentage","totalSheets","handleOnChapterClick","useCallback","useLayoutEffect","jsx","ArrowTooltip","jsxs","Styled.ChapterItemWrapper","Styled.ChapterImageWrapper","Styled.ChapterProgressWrapper","Styled.ChapterProgressSVG","Styled.ChapterProgressSVGCircle","Styled.ChapterImage","Styled.StyledCheckIconWrapper","Check2Icon","FlexView","Styled.ChapterName"],"mappings":";;;;;;AAUA,MAAMA,IAAqCC;AAAA,EACzC,CAAC,EAAE,aAAAC,GAAa,SAAAC,GAAS,gBAAAC,GAAgB,WAAAC,QAAgB;AACjD,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IAAA;AAAA,EAGN;AACF;"}
|
@@ -1,38 +1,37 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as p, jsx as r, Fragment as A } from "react/jsx-runtime";
|
2
2
|
import { memo as T, useCallback as b } from "react";
|
3
3
|
import { IMAGES as g } from "../../../assets/images/images.js";
|
4
4
|
import k from "../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
5
|
import x from "../../ui/buttons/button/button.js";
|
6
6
|
import { useUIContext as $ } from "../../ui/context/context.js";
|
7
|
-
import
|
7
|
+
import m from "../../ui/separator/separator.js";
|
8
8
|
import y from "../../ui/text/text.js";
|
9
9
|
import E from "./chapter-item/chapter-item.js";
|
10
|
-
import { ChaptersListContainer as
|
10
|
+
import { ChaptersListContainer as l, ChaptersWrapper as X } from "./chapters-list-styled.js";
|
11
11
|
const I = T(
|
12
|
-
({ milestoneId: t, canUpdatePlan:
|
13
|
-
const { isGoalCreation: i, userType:
|
14
|
-
|
12
|
+
({ milestoneId: t, canUpdatePlan: c, chapters: o, ...d }) => {
|
13
|
+
const { isGoalCreation: i, userType: h, onChapterClick: C, onAddChapter: e, isMilestoneActive: a } = d, { onClick: n } = $(), f = b(() => {
|
14
|
+
n({
|
15
15
|
label: "add_chapter_icon",
|
16
16
|
props: {
|
17
17
|
milestone_id: t
|
18
18
|
}
|
19
19
|
}), e == null || e({ milestoneId: t, isGoalCreation: i });
|
20
|
-
}, [t, i, e,
|
21
|
-
return o.length ? /* @__PURE__ */ r(
|
22
|
-
const { id: _ } =
|
20
|
+
}, [t, i, e, n]);
|
21
|
+
return o.length ? /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(X, { children: o.map((s, u) => {
|
22
|
+
const { id: _ } = s;
|
23
23
|
return /* @__PURE__ */ r(
|
24
24
|
E,
|
25
25
|
{
|
26
26
|
milestoneId: t,
|
27
|
-
|
28
|
-
chapter: p,
|
27
|
+
chapter: s,
|
29
28
|
onChapterClick: C,
|
30
29
|
itemIndex: u
|
31
30
|
},
|
32
31
|
_
|
33
32
|
);
|
34
|
-
}) }) }) : /* @__PURE__ */
|
35
|
-
|
33
|
+
}) }) }) : /* @__PURE__ */ p(
|
34
|
+
l,
|
36
35
|
{
|
37
36
|
$gapX: 6.75,
|
38
37
|
$alignItems: "center",
|
@@ -40,14 +39,14 @@ const I = T(
|
|
40
39
|
$background: "WHITE",
|
41
40
|
children: [
|
42
41
|
/* @__PURE__ */ r("img", { src: g.EMPTY_MIX_TESTS, alt: "empty_mix_tests" }),
|
43
|
-
/* @__PURE__ */ r(
|
44
|
-
|
42
|
+
/* @__PURE__ */ r(m, { heightX: 2 }),
|
43
|
+
h === "TEACHER" ? /* @__PURE__ */ p(A, { children: [
|
45
44
|
/* @__PURE__ */ r(
|
46
45
|
k,
|
47
46
|
{
|
48
47
|
renderAs: "primary",
|
49
48
|
position: "bottom",
|
50
|
-
hidden:
|
49
|
+
hidden: a,
|
51
50
|
tooltipItem: "Plan is completed",
|
52
51
|
children: /* @__PURE__ */ r(
|
53
52
|
x,
|
@@ -58,7 +57,7 @@ const I = T(
|
|
58
57
|
size: "small",
|
59
58
|
label: "Add chapter",
|
60
59
|
onClick: f,
|
61
|
-
disabled: !
|
60
|
+
disabled: !a || !c,
|
62
61
|
analyticsProps: {
|
63
62
|
milestone_id: t
|
64
63
|
}
|
@@ -66,7 +65,7 @@ const I = T(
|
|
66
65
|
)
|
67
66
|
}
|
68
67
|
),
|
69
|
-
/* @__PURE__ */ r(
|
68
|
+
/* @__PURE__ */ r(m, { heightX: 2 })
|
70
69
|
] }) : /* @__PURE__ */ r(y, { $renderAs: "ab2-bold", $color: "BLACK_T_87", children: "Wait for the teacher to add a chapter" })
|
71
70
|
]
|
72
71
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chapters-list.js","sources":["../../../../src/features/chapters/chapters-list/chapters-list.tsx"],"sourcesContent":["import type { IChaptersListProps } from './chapters-list-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback } from 'react';\n\nimport { IMAGES } from '../../../assets/images/images';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../ui/buttons/button/button';\nimport { useUIContext } from '../../ui/context/context';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport ChapterItem from './chapter-item/chapter-item';\nimport * as Styled from './chapters-list-styled';\n\nconst ChaptersList: FC<IChaptersListProps> = memo(\n ({ milestoneId, canUpdatePlan, chapters, ...restChaptersList }) => {\n const { isGoalCreation, userType, onChapterClick, onAddChapter, isMilestoneActive } =\n restChaptersList;\n\n const { onClick: trackOnClick } = useUIContext();\n\n const handleOnAddChapter = useCallback(() => {\n trackOnClick({\n label: 'add_chapter_icon',\n props: {\n milestone_id: milestoneId,\n },\n });\n onAddChapter?.({ milestoneId, isGoalCreation });\n }, [milestoneId, isGoalCreation, onAddChapter, trackOnClick]);\n\n if (!chapters.length) {\n return (\n <Styled.ChaptersListContainer\n $gapX={6.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"WHITE\"\n >\n <img src={IMAGES.EMPTY_MIX_TESTS} alt=\"empty_mix_tests\" />\n <Separator heightX={2} />\n {userType === 'TEACHER' ? (\n <>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n hidden={isMilestoneActive}\n tooltipItem=\"Plan is completed\"\n >\n <Button\n widthX={10}\n renderAs=\"primary\"\n shape=\"square\"\n size=\"small\"\n label=\"Add chapter\"\n onClick={handleOnAddChapter}\n disabled={!isMilestoneActive || !canUpdatePlan}\n analyticsProps={{\n milestone_id: milestoneId,\n }}\n />\n </ArrowTooltip>\n <Separator heightX={2} />\n </>\n ) : (\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_T_87\">\n Wait for the teacher to add a chapter\n </Text>\n )}\n </Styled.ChaptersListContainer>\n );\n }\n\n return (\n <Styled.ChaptersListContainer>\n <Styled.ChaptersWrapper>\n {chapters.map((chapter, idx) => {\n const { id } = chapter;\n\n return (\n <ChapterItem\n key={id}\n milestoneId={milestoneId}\n
|
1
|
+
{"version":3,"file":"chapters-list.js","sources":["../../../../src/features/chapters/chapters-list/chapters-list.tsx"],"sourcesContent":["import type { IChaptersListProps } from './chapters-list-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback } from 'react';\n\nimport { IMAGES } from '../../../assets/images/images';\nimport ArrowTooltip from '../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../ui/buttons/button/button';\nimport { useUIContext } from '../../ui/context/context';\nimport Separator from '../../ui/separator/separator';\nimport Text from '../../ui/text/text';\nimport ChapterItem from './chapter-item/chapter-item';\nimport * as Styled from './chapters-list-styled';\n\nconst ChaptersList: FC<IChaptersListProps> = memo(\n ({ milestoneId, canUpdatePlan, chapters, ...restChaptersList }) => {\n const { isGoalCreation, userType, onChapterClick, onAddChapter, isMilestoneActive } =\n restChaptersList;\n\n const { onClick: trackOnClick } = useUIContext();\n\n const handleOnAddChapter = useCallback(() => {\n trackOnClick({\n label: 'add_chapter_icon',\n props: {\n milestone_id: milestoneId,\n },\n });\n onAddChapter?.({ milestoneId, isGoalCreation });\n }, [milestoneId, isGoalCreation, onAddChapter, trackOnClick]);\n\n if (!chapters.length) {\n return (\n <Styled.ChaptersListContainer\n $gapX={6.75}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"WHITE\"\n >\n <img src={IMAGES.EMPTY_MIX_TESTS} alt=\"empty_mix_tests\" />\n <Separator heightX={2} />\n {userType === 'TEACHER' ? (\n <>\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n hidden={isMilestoneActive}\n tooltipItem=\"Plan is completed\"\n >\n <Button\n widthX={10}\n renderAs=\"primary\"\n shape=\"square\"\n size=\"small\"\n label=\"Add chapter\"\n onClick={handleOnAddChapter}\n disabled={!isMilestoneActive || !canUpdatePlan}\n analyticsProps={{\n milestone_id: milestoneId,\n }}\n />\n </ArrowTooltip>\n <Separator heightX={2} />\n </>\n ) : (\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_T_87\">\n Wait for the teacher to add a chapter\n </Text>\n )}\n </Styled.ChaptersListContainer>\n );\n }\n\n return (\n <Styled.ChaptersListContainer>\n <Styled.ChaptersWrapper>\n {chapters.map((chapter, idx) => {\n const { id } = chapter;\n\n return (\n <ChapterItem\n key={id}\n milestoneId={milestoneId}\n chapter={chapter}\n onChapterClick={onChapterClick}\n itemIndex={idx}\n />\n );\n })}\n </Styled.ChaptersWrapper>\n </Styled.ChaptersListContainer>\n );\n },\n);\n\nexport default ChaptersList;\n"],"names":["ChaptersList","memo","milestoneId","canUpdatePlan","chapters","restChaptersList","isGoalCreation","userType","onChapterClick","onAddChapter","isMilestoneActive","trackOnClick","useUIContext","handleOnAddChapter","useCallback","jsx","Styled.ChaptersListContainer","Styled.ChaptersWrapper","chapter","idx","id","ChapterItem","jsxs","IMAGES","Separator","Fragment","ArrowTooltip","Button","Text","ChaptersList$1"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAAuCC;AAAA,EAC3C,CAAC,EAAE,aAAAC,GAAa,eAAAC,GAAe,UAAAC,GAAU,GAAGC,QAAuB;AACjE,UAAM,EAAE,gBAAAC,GAAgB,UAAAC,GAAU,gBAAAC,GAAgB,cAAAC,GAAc,mBAAAC,EAC9D,IAAAL,GAEI,EAAE,SAASM,EAAa,IAAIC,EAAa,GAEzCC,IAAqBC,EAAY,MAAM;AAC9B,MAAAH,EAAA;AAAA,QACX,OAAO;AAAA,QACP,OAAO;AAAA,UACL,cAAcT;AAAA,QAChB;AAAA,MAAA,CACD,GACcO,KAAA,QAAAA,EAAA,EAAE,aAAAP,GAAa,gBAAAI,EAAA;AAAA,OAC7B,CAACJ,GAAaI,GAAgBG,GAAcE,CAAY,CAAC;AAExD,WAACP,EAAS,SA2CX,gBAAAW,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAE,GAAA,EACE,UAASb,EAAA,IAAI,CAACc,GAASC,MAAQ;AACxB,YAAA,EAAE,IAAAC,EAAO,IAAAF;AAGb,a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