@cuemath/leap 3.5.18-as2 → 3.5.18-j1
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/homework/hw-card-list/hooks/use-scroll-buttons.js +74 -0
- package/dist/features/homework/hw-card-list/hooks/use-scroll-buttons.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-constants.js +7 -0
- package/dist/features/homework/hw-card-list/hw-card-list-constants.js.map +1 -0
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +21 -17
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +138 -153
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/ui/modals/modal-provider.js +37 -37
- package/dist/features/ui/modals/modal-provider.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +15 -24
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +13 -14
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/index.d.ts +15 -20
- package/dist/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/ui/nudge/nudge-types.js +0 -5
- package/dist/features/ui/nudge/nudge-types.js.map +0 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
- /package/dist/node_modules/{query-string/node_modules/decode-uri-component → decode-uri-component}/index.js +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useState as d, useRef as T, useCallback as s, useMemo as H, useEffect as i } from "react";
|
|
2
|
+
import W from "../../../../node_modules/lodash.throttle/index.js";
|
|
3
|
+
import { useTheme as _ } from "styled-components";
|
|
4
|
+
import { THROTTLE_WAIT as D, SCROLL_STEP as p, SCROLL_THRESHOLD as v } from "../hw-card-list-constants.js";
|
|
5
|
+
import { EDeviceType as k } from "../../../ui/theme/constants.js";
|
|
6
|
+
const z = ({
|
|
7
|
+
totalCount: c
|
|
8
|
+
}) => {
|
|
9
|
+
const [g, f] = d(!1), [A, a] = d(!1), [h, E] = d(!1), n = T(null), t = T(null), r = _().device <= k.TABLET, o = s(() => {
|
|
10
|
+
const e = n.current;
|
|
11
|
+
if (!e) return;
|
|
12
|
+
if (!r && !h) {
|
|
13
|
+
f(!1), a(!1);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const { scrollLeft: u, scrollWidth: L, clientWidth: R } = e;
|
|
17
|
+
if (!(L > R)) {
|
|
18
|
+
f(!1), a(!1);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const b = u <= v, y = u >= L - R - v, w = !b, B = !y;
|
|
22
|
+
f((l) => l !== w ? w : l), a((l) => l !== B ? B : l);
|
|
23
|
+
}, [r, h]), S = H(() => {
|
|
24
|
+
t.current && t.current.cancel();
|
|
25
|
+
const e = W(o, D, {
|
|
26
|
+
leading: !1,
|
|
27
|
+
trailing: !0
|
|
28
|
+
});
|
|
29
|
+
return t.current = e, e;
|
|
30
|
+
}, [o]), m = s(() => {
|
|
31
|
+
S();
|
|
32
|
+
}, [S]), O = s(() => {
|
|
33
|
+
r || E(!0);
|
|
34
|
+
}, [r]), I = s(() => {
|
|
35
|
+
r || (E(!1), t.current && t.current.cancel());
|
|
36
|
+
}, [r]);
|
|
37
|
+
i(() => {
|
|
38
|
+
o();
|
|
39
|
+
}, [o, h]);
|
|
40
|
+
const M = s(() => {
|
|
41
|
+
const e = n.current;
|
|
42
|
+
e && e.scrollBy({ left: -p, behavior: "smooth" });
|
|
43
|
+
}, []), F = s(() => {
|
|
44
|
+
const e = n.current;
|
|
45
|
+
e && e.scrollBy({ left: p, behavior: "smooth" });
|
|
46
|
+
}, []);
|
|
47
|
+
return i(() => {
|
|
48
|
+
if (c === 0 || !n.current) return;
|
|
49
|
+
const u = requestAnimationFrame(() => {
|
|
50
|
+
r && o();
|
|
51
|
+
});
|
|
52
|
+
return () => cancelAnimationFrame(u);
|
|
53
|
+
}, [c, r, o]), i(() => {
|
|
54
|
+
const e = n.current;
|
|
55
|
+
if (!(!e || c === 0))
|
|
56
|
+
return e.addEventListener("scroll", m, { passive: !0 }), () => {
|
|
57
|
+
e.removeEventListener("scroll", m), t.current && t.current.cancel();
|
|
58
|
+
};
|
|
59
|
+
}, [m, c]), i(() => () => {
|
|
60
|
+
t.current && (t.current.cancel(), t.current = null);
|
|
61
|
+
}, []), {
|
|
62
|
+
scrollRef: n,
|
|
63
|
+
showLeftButton: g,
|
|
64
|
+
showRightButton: A,
|
|
65
|
+
handleMouseEnter: O,
|
|
66
|
+
handleMouseLeave: I,
|
|
67
|
+
handleScrollLeft: M,
|
|
68
|
+
handleScrollRight: F
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
z as useScrollButtons
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=use-scroll-buttons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scroll-buttons.js","sources":["../../../../../src/features/homework/hw-card-list/hooks/use-scroll-buttons.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport throttle from 'lodash.throttle';\nimport { useTheme } from 'styled-components';\n\nimport { SCROLL_STEP, SCROLL_THRESHOLD, THROTTLE_WAIT } from '../hw-card-list-constants';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport type { IUseScrollButtonsProps, IUseScrollButtonsReturn } from '../hw-card-list-types';\n\nexport const useScrollButtons = ({\n totalCount,\n}: IUseScrollButtonsProps): IUseScrollButtonsReturn => {\n const [showLeftButton, setShowLeftButton] = useState(false);\n const [showRightButton, setShowRightButton] = useState(false);\n const [isMouseInside, setIsMouseInside] = useState(false);\n\n const scrollRef = useRef<HTMLDivElement>(null);\n const throttledFunctionRef = useRef<ReturnType<typeof throttle> | null>(null);\n\n const isCompact = useTheme().device <= EDeviceType.TABLET;\n\n const updateScrollButtons = useCallback(() => {\n const scrollElement = scrollRef.current;\n\n if (!scrollElement) return;\n\n if (!isCompact && !isMouseInside) {\n setShowLeftButton(false);\n setShowRightButton(false);\n\n return;\n }\n\n const { scrollLeft, scrollWidth, clientWidth } = scrollElement;\n const hasOverflow = scrollWidth > clientWidth;\n\n if (!hasOverflow) {\n setShowLeftButton(false);\n setShowRightButton(false);\n\n return;\n }\n\n const isAtStart = scrollLeft <= SCROLL_THRESHOLD;\n const isAtEnd = scrollLeft >= scrollWidth - clientWidth - SCROLL_THRESHOLD;\n\n const newShowLeft = !isAtStart;\n const newShowRight = !isAtEnd;\n\n setShowLeftButton(prev => (prev !== newShowLeft ? newShowLeft : prev));\n setShowRightButton(prev => (prev !== newShowRight ? newShowRight : prev));\n }, [isCompact, isMouseInside]);\n\n const throttledUpdateScrollButtons = useMemo(() => {\n if (throttledFunctionRef.current) {\n throttledFunctionRef.current.cancel();\n }\n\n const throttledFn = throttle(updateScrollButtons, THROTTLE_WAIT, {\n leading: false,\n trailing: true,\n });\n\n throttledFunctionRef.current = throttledFn;\n\n return throttledFn;\n }, [updateScrollButtons]);\n\n const handleScroll = useCallback(() => {\n throttledUpdateScrollButtons();\n }, [throttledUpdateScrollButtons]);\n\n const handleMouseEnter = useCallback(() => {\n if (isCompact) return;\n setIsMouseInside(true);\n }, [isCompact]);\n\n const handleMouseLeave = useCallback(() => {\n if (isCompact) return;\n setIsMouseInside(false);\n if (throttledFunctionRef.current) {\n throttledFunctionRef.current.cancel();\n }\n }, [isCompact]);\n\n useEffect(() => {\n updateScrollButtons();\n }, [updateScrollButtons, isMouseInside]);\n\n const handleScrollLeft = useCallback(() => {\n const scrollElement = scrollRef.current;\n\n if (!scrollElement) return;\n scrollElement.scrollBy({ left: -SCROLL_STEP, behavior: 'smooth' });\n }, []);\n\n const handleScrollRight = useCallback(() => {\n const scrollElement = scrollRef.current;\n\n if (!scrollElement) return;\n scrollElement.scrollBy({ left: SCROLL_STEP, behavior: 'smooth' });\n }, []);\n\n useEffect(() => {\n if (totalCount === 0) return;\n\n const scrollElement = scrollRef.current;\n\n if (!scrollElement) return;\n\n const rafId = requestAnimationFrame(() => {\n if (isCompact) {\n updateScrollButtons();\n }\n });\n\n return () => cancelAnimationFrame(rafId);\n }, [totalCount, isCompact, updateScrollButtons]);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (!scrollElement || totalCount === 0) return;\n\n scrollElement.addEventListener('scroll', handleScroll, { passive: true });\n\n return () => {\n scrollElement.removeEventListener('scroll', handleScroll);\n if (throttledFunctionRef.current) {\n throttledFunctionRef.current.cancel();\n }\n };\n }, [handleScroll, totalCount]);\n\n useEffect(() => {\n return () => {\n if (throttledFunctionRef.current) {\n throttledFunctionRef.current.cancel();\n throttledFunctionRef.current = null;\n }\n };\n }, []);\n\n return {\n scrollRef,\n showLeftButton,\n showRightButton,\n handleMouseEnter,\n handleMouseLeave,\n handleScrollLeft,\n handleScrollRight,\n };\n};\n"],"names":["useScrollButtons","totalCount","showLeftButton","setShowLeftButton","useState","showRightButton","setShowRightButton","isMouseInside","setIsMouseInside","scrollRef","useRef","throttledFunctionRef","isCompact","useTheme","EDeviceType","updateScrollButtons","useCallback","scrollElement","scrollLeft","scrollWidth","clientWidth","isAtStart","SCROLL_THRESHOLD","isAtEnd","newShowLeft","newShowRight","prev","throttledUpdateScrollButtons","useMemo","throttledFn","throttle","THROTTLE_WAIT","handleScroll","handleMouseEnter","handleMouseLeave","useEffect","handleScrollLeft","SCROLL_STEP","handleScrollRight","rafId"],"mappings":";;;;;AAQO,MAAMA,IAAmB,CAAC;AAAA,EAC/B,YAAAC;AACF,MAAuD;AACrD,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpD,CAACC,GAAiBC,CAAkB,IAAIF,EAAS,EAAK,GACtD,CAACG,GAAeC,CAAgB,IAAIJ,EAAS,EAAK,GAElDK,IAAYC,EAAuB,IAAI,GACvCC,IAAuBD,EAA2C,IAAI,GAEtEE,IAAYC,EAAA,EAAW,UAAUC,EAAY,QAE7CC,IAAsBC,EAAY,MAAM;AAC5C,UAAMC,IAAgBR,EAAU;AAEhC,QAAI,CAACQ,EAAe;AAEhB,QAAA,CAACL,KAAa,CAACL,GAAe;AAChC,MAAAJ,EAAkB,EAAK,GACvBG,EAAmB,EAAK;AAExB;AAAA,IACF;AAEA,UAAM,EAAE,YAAAY,GAAY,aAAAC,GAAa,aAAAC,EAAA,IAAgBH;AAGjD,QAAI,EAFgBE,IAAcC,IAEhB;AAChB,MAAAjB,EAAkB,EAAK,GACvBG,EAAmB,EAAK;AAExB;AAAA,IACF;AAEA,UAAMe,IAAYH,KAAcI,GAC1BC,IAAUL,KAAcC,IAAcC,IAAcE,GAEpDE,IAAc,CAACH,GACfI,IAAe,CAACF;AAEtB,IAAApB,EAAkB,CAASuB,MAAAA,MAASF,IAAcA,IAAcE,CAAK,GACrEpB,EAAmB,CAASoB,MAAAA,MAASD,IAAeA,IAAeC,CAAK;AAAA,EAAA,GACvE,CAACd,GAAWL,CAAa,CAAC,GAEvBoB,IAA+BC,EAAQ,MAAM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C,aAAAgB,EAAc,iBAAiB,UAAUe,GAAc,EAAE,SAAS,IAAM,GAEjE,MAAM;AACG,QAAAf,EAAA,oBAAoB,UAAUe,CAAY,GACpDrB,EAAqB,WACvBA,EAAqB,QAAQ;MAC/B;AAAA,EACF,GACC,CAACqB,GAAc/B,CAAU,CAAC,GAE7BkC,EAAU,MACD,MAAM;AACX,IAAIxB,EAAqB,YACvBA,EAAqB,QAAQ,UAC7BA,EAAqB,UAAU;AAAA,EACjC,GAED,CAAE,CAAA,GAEE;AAAA,IACL,WAAAF;AAAA,IACA,gBAAAP;AAAA,IACA,iBAAAG;AAAA,IACA,kBAAA4B;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAE;AAAA,IACA,mBAAAE;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hw-card-list-constants.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-constants.ts"],"sourcesContent":["export const SCROLL_STEP = 200;\nexport const SCROLL_THRESHOLD = 1;\nexport const THROTTLE_WAIT = 300;\n"],"names":["SCROLL_STEP","SCROLL_THRESHOLD","THROTTLE_WAIT"],"mappings":"AAAO,MAAMA,IAAc,KACdC,IAAmB,GACnBC,IAAgB;"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import t, { css as
|
|
1
|
+
import t, { css as i } from "styled-components";
|
|
2
2
|
import e from "../../ui/layout/flex-view.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import n from "../../ui/text/text.js";
|
|
4
|
+
import { EDeviceType as p } from "../../ui/theme/constants.js";
|
|
5
|
+
const d = t(e)(
|
|
6
|
+
({ theme: o }) => `
|
|
7
|
+
overflow-x: ${o.device <= p.TABLET ? "scroll" : "hidden"};
|
|
8
|
+
padding-top: 16px;
|
|
9
9
|
margin-top: -16px;
|
|
10
|
-
|
|
10
|
+
&::-webkit-scrollbar {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
`
|
|
14
|
+
), u = t(e)`
|
|
11
15
|
right: ${({ right: o }) => o};
|
|
12
16
|
left: ${({ left: o }) => o};
|
|
13
17
|
width: 32px;
|
|
@@ -19,11 +23,11 @@ const l = t(e)`
|
|
|
19
23
|
path {
|
|
20
24
|
fill: ${({ theme: o }) => o.colors.WHITE};
|
|
21
25
|
}
|
|
22
|
-
`,
|
|
26
|
+
`, m = t(e)(
|
|
23
27
|
({ $disablePointerEvents: o, theme: r }) => `
|
|
24
28
|
position: relative;
|
|
25
29
|
pointer-events: auto;
|
|
26
|
-
${o &&
|
|
30
|
+
${o && i`
|
|
27
31
|
pointer-events: none;
|
|
28
32
|
:after {
|
|
29
33
|
content: '';
|
|
@@ -36,9 +40,9 @@ const l = t(e)`
|
|
|
36
40
|
}
|
|
37
41
|
`}
|
|
38
42
|
`
|
|
39
|
-
),
|
|
43
|
+
), x = t(n)`
|
|
40
44
|
writing-mode: sideways-lr;
|
|
41
|
-
`,
|
|
45
|
+
`, f = t(e)`
|
|
42
46
|
position: relative;
|
|
43
47
|
|
|
44
48
|
&::after {
|
|
@@ -54,10 +58,10 @@ const l = t(e)`
|
|
|
54
58
|
}
|
|
55
59
|
`;
|
|
56
60
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
m as ContentWrapper,
|
|
62
|
+
x as QueueText,
|
|
63
|
+
f as QueueWrapper,
|
|
64
|
+
u as ScrollButton,
|
|
65
|
+
d as ScrollContainer
|
|
62
66
|
};
|
|
63
67
|
//# sourceMappingURL=hw-card-list-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hw-card-list-styled.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\n\nexport const ScrollContainer = styled(FlexView)`\n overflow-x:
|
|
1
|
+
{"version":3,"file":"hw-card-list-styled.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport { EDeviceType } from '../../ui/theme/constants';\n\nexport const ScrollContainer = styled(FlexView)(\n ({ theme }) => `\n overflow-x: ${theme.device <= EDeviceType.TABLET ? 'scroll' : 'hidden'};\n padding-top: 16px;\n margin-top: -16px;\n &::-webkit-scrollbar {\n display: none;\n }\n`,\n);\n\nexport const ScrollButton = styled(FlexView)<{ $visible: boolean; right: string; left: string }>`\n right: ${({ right }) => right};\n left: ${({ left }) => left};\n width: 32px;\n cursor: pointer;\n transition: opacity 0.3s ease-in-out;\n opacity: ${({ $visible }) => ($visible ? 1 : 0)};\n pointer-events: ${({ $visible }) => ($visible ? 'auto' : 'none')};\n z-index: 10;\n path {\n fill: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const ContentWrapper = styled(FlexView)<{ $disablePointerEvents: boolean }>(\n ({ $disablePointerEvents, theme }) => `\n position: relative;\n pointer-events: auto;\n ${\n $disablePointerEvents &&\n css`\n pointer-events: none;\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: ${theme.colors.GREY_3};\n }\n `\n }\n `,\n);\n\nexport const QueueText = styled(Text)`\n writing-mode: sideways-lr;\n`;\n\nexport const QueueWrapper = styled(FlexView)`\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n height: 8px;\n width: 8px;\n clip-path: polygon(0% 0%, 100% 100%, 0% 100%);\n background-color: ${({ theme }) => theme.colors.BLACK_4};\n top: 50%;\n right: 0;\n transform: translate(50%, calc(-50% + 0px)) rotate(225deg);\n }\n`;\n"],"names":["ScrollContainer","styled","FlexView","theme","EDeviceType","ScrollButton","right","left","$visible","ContentWrapper","$disablePointerEvents","css","QueueText","Text","QueueWrapper"],"mappings":";;;;AAMa,MAAAA,IAAkBC,EAAOC,CAAQ;AAAA,EAC5C,CAAC,EAAE,OAAAC,EAAA,MAAY;AAAA,gBACDA,EAAM,UAAUC,EAAY,SAAS,WAAW,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOxE,GAEaC,IAAeJ,EAAOC,CAAQ;AAAA,WAChC,CAAC,EAAE,OAAAI,EAAM,MAAMA,CAAK;AAAA,UACrB,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;AAAA,aAIf,CAAC,EAAE,UAAAC,EAAA,MAAgBA,IAAW,IAAI,CAAE;AAAA,oBAC7B,CAAC,EAAE,UAAAA,EAAA,MAAgBA,IAAW,SAAS,MAAO;AAAA;AAAA;AAAA,YAGtD,CAAC,EAAE,OAAAL,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIhCM,IAAiBR,EAAOC,CAAQ;AAAA,EAC3C,CAAC,EAAE,uBAAAQ,GAAuB,OAAAP,EAAA,MAAY;AAAA;AAAA;AAAA,MAIlCO,KACAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASkBR,EAAM,OAAO,MAAM;AAAA;AAAA,OAGvC;AAAA;AAEJ,GAEaS,IAAYX,EAAOY,CAAI;AAAA;AAAA,GAIvBC,IAAeb,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASnB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,171 +1,156 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as T, useMemo as x, useCallback as j } from "react";
|
|
3
3
|
import F from "../../../assets/line-icons/icons/chevron-left.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { getWaitForReviewSheetsCount as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
import G from "../../../assets/line-icons/icons/chevron-right.js";
|
|
5
|
+
import c from "../../ui/layout/flex-view.js";
|
|
6
|
+
import u from "../../ui/text/text.js";
|
|
7
|
+
import W from "../homework-card.js";
|
|
8
|
+
import { QueueWrapper as X, QueueText as O, ContentWrapper as V, ScrollButton as H, ScrollContainer as N } from "./hw-card-list-styled.js";
|
|
9
|
+
import { getWaitForReviewSheetsCount as Y } from "./hw-card-list-utils.js";
|
|
10
|
+
import { NODE_TYPE as P } from "../../sheets/constants/sheet.js";
|
|
11
|
+
import { useScrollButtons as Q } from "./hooks/use-scroll-buttons.js";
|
|
12
|
+
const z = ({
|
|
13
|
+
userType: m,
|
|
14
|
+
studentId: h,
|
|
15
|
+
isHwProcessing: b,
|
|
16
|
+
hwDetails: t,
|
|
17
|
+
onTestStart: $,
|
|
18
|
+
onNodeAttempt: C,
|
|
19
|
+
onTestPreview: f,
|
|
20
|
+
onNodeView: p,
|
|
21
|
+
onTestReview: g,
|
|
22
|
+
onNodeReview: k,
|
|
23
|
+
onNodeUnassign: w,
|
|
24
|
+
puzzleHWCardRef: _
|
|
23
25
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
()
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
}, []),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
26
|
+
const o = x(() => {
|
|
27
|
+
const n = (t == null ? void 0 : t.assigned_homeworks) || [], i = (t == null ? void 0 : t.queued_homeworks) || [], r = n.length + i.length, s = Y(t);
|
|
28
|
+
return {
|
|
29
|
+
assignedHomeworks: n,
|
|
30
|
+
queuedHomeworks: i,
|
|
31
|
+
totalCount: r,
|
|
32
|
+
waitForReviewCount: s
|
|
33
|
+
};
|
|
34
|
+
}, [t]), {
|
|
35
|
+
scrollRef: L,
|
|
36
|
+
showLeftButton: A,
|
|
37
|
+
showRightButton: v,
|
|
38
|
+
handleMouseEnter: B,
|
|
39
|
+
handleMouseLeave: I,
|
|
40
|
+
handleScrollLeft: R,
|
|
41
|
+
handleScrollRight: q
|
|
42
|
+
} = Q({
|
|
43
|
+
totalCount: o.totalCount
|
|
44
|
+
}), a = j(
|
|
45
|
+
(n, i, r = !1) => {
|
|
46
|
+
const {
|
|
47
|
+
node_id: s,
|
|
48
|
+
worksheet_id: E,
|
|
49
|
+
node_type: K,
|
|
50
|
+
title: M,
|
|
51
|
+
subtext: S
|
|
52
|
+
} = n, d = K === P.DYNAMIC;
|
|
53
|
+
return /* @__PURE__ */ l(
|
|
54
|
+
c,
|
|
55
|
+
{
|
|
56
|
+
$flexDirection: "row",
|
|
57
|
+
$flexGapX: 1,
|
|
58
|
+
children: [
|
|
59
|
+
r && i === 0 && /* @__PURE__ */ e(
|
|
60
|
+
X,
|
|
61
|
+
{
|
|
62
|
+
$background: "BLACK_4",
|
|
63
|
+
$justifyContent: "center",
|
|
64
|
+
$gutter: 4,
|
|
65
|
+
$gap: 8,
|
|
66
|
+
children: /* @__PURE__ */ e(O, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ e(
|
|
70
|
+
W,
|
|
71
|
+
{
|
|
72
|
+
isInQueue: r,
|
|
73
|
+
userType: m,
|
|
74
|
+
header: M,
|
|
75
|
+
subHeader: S || "",
|
|
76
|
+
nodeData: n,
|
|
77
|
+
renderAs: "homework",
|
|
78
|
+
studentId: h,
|
|
79
|
+
onNodeAttempt: d ? $ : C,
|
|
80
|
+
shouldOpenOnRight: !0,
|
|
81
|
+
onNodeView: d ? f : p,
|
|
82
|
+
onNodeReview: d ? g : k,
|
|
83
|
+
onNodeUnassign: w,
|
|
84
|
+
puzzleHWCardRef: r ? void 0 : _
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
`${E}_${s}_${i}_${r ? "queued" : "assigned"}`
|
|
90
|
+
);
|
|
91
|
+
},
|
|
92
|
+
[
|
|
93
|
+
m,
|
|
94
|
+
h,
|
|
95
|
+
$,
|
|
96
|
+
C,
|
|
97
|
+
f,
|
|
98
|
+
p,
|
|
99
|
+
g,
|
|
100
|
+
k,
|
|
101
|
+
w,
|
|
102
|
+
_
|
|
103
|
+
]
|
|
104
|
+
), y = x(() => {
|
|
105
|
+
if (o.totalCount === 0) return [];
|
|
106
|
+
const n = o.assignedHomeworks.map(
|
|
107
|
+
(r, s) => a(r, s, !1)
|
|
108
|
+
), i = o.queuedHomeworks.map(
|
|
109
|
+
(r, s) => a(r, s, !0)
|
|
110
|
+
);
|
|
111
|
+
return [...n, ...i];
|
|
112
|
+
}, [
|
|
113
|
+
o.assignedHomeworks,
|
|
114
|
+
o.queuedHomeworks,
|
|
115
|
+
a,
|
|
116
|
+
o.totalCount
|
|
117
|
+
]);
|
|
118
|
+
return o.totalCount === 0 ? /* @__PURE__ */ l(c, { $flexRowGapX: 1, children: [
|
|
119
|
+
/* @__PURE__ */ e(u, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: "Homework (0)" }),
|
|
120
|
+
/* @__PURE__ */ e(u, { $renderAs: "ab2", $color: "BLACK_T_60", children: "No Homework assigned yet" })
|
|
121
|
+
] }) : /* @__PURE__ */ l(V, { $flexRowGapX: 1, $disablePointerEvents: b, children: [
|
|
122
|
+
/* @__PURE__ */ l(u, { $renderAs: "ac4-black", $color: "BLACK_T_60", children: [
|
|
57
123
|
"Homework (",
|
|
58
|
-
|
|
124
|
+
o.waitForReviewCount,
|
|
59
125
|
"/",
|
|
60
|
-
|
|
126
|
+
o.totalCount,
|
|
61
127
|
")"
|
|
62
128
|
] }),
|
|
63
129
|
/* @__PURE__ */ l(
|
|
64
|
-
|
|
130
|
+
c,
|
|
65
131
|
{
|
|
66
132
|
$position: "relative",
|
|
67
|
-
onMouseEnter:
|
|
68
|
-
onMouseLeave:
|
|
133
|
+
onMouseEnter: B,
|
|
134
|
+
onMouseLeave: I,
|
|
69
135
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
136
|
+
/* @__PURE__ */ e(
|
|
137
|
+
H,
|
|
72
138
|
{
|
|
73
139
|
$position: "absolute",
|
|
74
140
|
$background: "BLACK_T_60",
|
|
75
141
|
$justifyContent: "center",
|
|
76
142
|
$alignItems: "center",
|
|
77
143
|
$height: "100%",
|
|
78
|
-
onClick:
|
|
79
|
-
$visible:
|
|
144
|
+
onClick: R,
|
|
145
|
+
$visible: A,
|
|
80
146
|
left: "0px",
|
|
81
147
|
right: "auto",
|
|
82
|
-
children: /* @__PURE__ */
|
|
148
|
+
children: /* @__PURE__ */ e(F, { width: 24, height: 24 })
|
|
83
149
|
}
|
|
84
150
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
node_id: c,
|
|
89
|
-
worksheet_id: m,
|
|
90
|
-
node_type: $,
|
|
91
|
-
title: p,
|
|
92
|
-
subtext: w
|
|
93
|
-
} = e, n = $ === "DYNAMIC";
|
|
94
|
-
return /* @__PURE__ */ r(
|
|
95
|
-
u,
|
|
96
|
-
{
|
|
97
|
-
$flexDirection: "row",
|
|
98
|
-
$flexGapX: 1,
|
|
99
|
-
children: /* @__PURE__ */ r(
|
|
100
|
-
E,
|
|
101
|
-
{
|
|
102
|
-
userType: C,
|
|
103
|
-
header: p,
|
|
104
|
-
subHeader: w || "",
|
|
105
|
-
nodeData: e,
|
|
106
|
-
renderAs: "homework",
|
|
107
|
-
studentId: _,
|
|
108
|
-
onNodeAttempt: n ? k : v,
|
|
109
|
-
shouldOpenOnRight: !0,
|
|
110
|
-
onNodeView: n ? b : x,
|
|
111
|
-
onNodeReview: n ? H : L,
|
|
112
|
-
onNodeUnassign: A,
|
|
113
|
-
puzzleHWCardRef: T
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
},
|
|
117
|
-
`${m}_${c}_${i}`
|
|
118
|
-
);
|
|
119
|
-
}),
|
|
120
|
-
f.map((e, i) => {
|
|
121
|
-
const {
|
|
122
|
-
node_id: c,
|
|
123
|
-
worksheet_id: m,
|
|
124
|
-
node_type: $,
|
|
125
|
-
title: p,
|
|
126
|
-
subtext: w
|
|
127
|
-
} = e, n = $ === "DYNAMIC";
|
|
128
|
-
return /* @__PURE__ */ l(
|
|
129
|
-
u,
|
|
130
|
-
{
|
|
131
|
-
$flexDirection: "row",
|
|
132
|
-
$flexGapX: 1,
|
|
133
|
-
children: [
|
|
134
|
-
i === 0 && /* @__PURE__ */ r(
|
|
135
|
-
J,
|
|
136
|
-
{
|
|
137
|
-
$background: "BLACK_4",
|
|
138
|
-
$justifyContent: "center",
|
|
139
|
-
$gutter: 4,
|
|
140
|
-
$gap: 8,
|
|
141
|
-
children: /* @__PURE__ */ r(P, { $renderAs: "ac3", $color: "WHITE", children: "In Queue" })
|
|
142
|
-
}
|
|
143
|
-
),
|
|
144
|
-
/* @__PURE__ */ r(
|
|
145
|
-
E,
|
|
146
|
-
{
|
|
147
|
-
isInQueue: !0,
|
|
148
|
-
userType: C,
|
|
149
|
-
header: p,
|
|
150
|
-
subHeader: w || "",
|
|
151
|
-
nodeData: e,
|
|
152
|
-
renderAs: "homework",
|
|
153
|
-
studentId: _,
|
|
154
|
-
onNodeAttempt: n ? k : v,
|
|
155
|
-
shouldOpenOnRight: !0,
|
|
156
|
-
onNodeView: n ? b : x,
|
|
157
|
-
onNodeReview: n ? H : L,
|
|
158
|
-
onNodeUnassign: A
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
]
|
|
162
|
-
},
|
|
163
|
-
`${m}_${c}_${i}`
|
|
164
|
-
);
|
|
165
|
-
})
|
|
166
|
-
] }) }),
|
|
167
|
-
/* @__PURE__ */ r(
|
|
168
|
-
W,
|
|
151
|
+
/* @__PURE__ */ e(N, { ref: L, children: /* @__PURE__ */ e(c, { $flexDirection: "row", $flexGapX: 1, children: y }) }),
|
|
152
|
+
/* @__PURE__ */ e(
|
|
153
|
+
H,
|
|
169
154
|
{
|
|
170
155
|
$position: "absolute",
|
|
171
156
|
$width: "60px",
|
|
@@ -173,19 +158,19 @@ const U = ({
|
|
|
173
158
|
$background: "BLACK_T_60",
|
|
174
159
|
$justifyContent: "center",
|
|
175
160
|
$alignItems: "center",
|
|
176
|
-
onClick:
|
|
177
|
-
$visible:
|
|
161
|
+
onClick: q,
|
|
162
|
+
$visible: v,
|
|
178
163
|
left: "auto",
|
|
179
164
|
right: "0px",
|
|
180
|
-
children: /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ e(G, { width: 24, height: 24 })
|
|
181
166
|
}
|
|
182
167
|
)
|
|
183
168
|
]
|
|
184
169
|
}
|
|
185
170
|
)
|
|
186
171
|
] });
|
|
187
|
-
},
|
|
172
|
+
}, le = T(z);
|
|
188
173
|
export {
|
|
189
|
-
|
|
174
|
+
le as default
|
|
190
175
|
};
|
|
191
176
|
//# sourceMappingURL=hw-card-list-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hw-card-list-view.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-view.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, useRef, useState, type FC } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport type {\n INodeCardCallbacks,\n INodeDataProps,\n} from '../../chapters-v2/comps/node-card/node-card-types';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport type { TUserTypes } from '../../ui/types';\nimport HomeworkCard from '../homework-card';\nimport type { IHomeworkDetails } from './api/get-homeworks';\nimport * as Styled from './hw-card-list-styled';\nimport { getWaitForReviewSheetsCount } from './hw-card-list-utils';\n\ninterface IHwCardListView extends INodeCardCallbacks {\n userType: TUserTypes;\n studentId: string;\n isHwProcessing: boolean;\n hwDetails?: IHomeworkDetails;\n onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;\n onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;\n puzzleHWCardRef?: React.RefObject<HTMLDivElement>;\n}\n\nconst HwCardListView: FC<IHwCardListView> = ({\n userType,\n studentId,\n isHwProcessing,\n hwDetails,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n puzzleHWCardRef,\n}) => {\n const [isLeftHovered, setIsLeftHovered] = useState(false);\n const [isRightHovered, setIsRightHovered] = useState(false);\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const { assigned_homeworks: assignedHomeworks = [], queued_homeworks: queuedHomeworks = [] } =\n hwDetails || {};\n\n const totalHWSheetsCount = useMemo(\n () => assignedHomeworks.length + queuedHomeworks.length,\n [assignedHomeworks, queuedHomeworks],\n );\n const waitForReviewSheets = useMemo(() => getWaitForReviewSheetsCount(hwDetails), [hwDetails]);\n\n const updatedCanScroll = useCallback(() => {\n if (scrollRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n\n if (scrollLeft < scrollWidth - clientWidth - 1) {\n setIsRightHovered(true);\n }\n }\n }, []);\n const handleHoverEnter = useCallback(() => {\n if (!scrollRef.current) return;\n\n updatedCanScroll();\n }, [updatedCanScroll]);\n\n const handleHoverLeave = useCallback(() => {\n setIsLeftHovered(false);\n setIsRightHovered(false);\n }, []);\n\n const handleScrollLeft = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n const handleScrollRight = useCallback(() => {\n if (scrollRef.current) {\n scrollRef.current.scrollBy({ left: 200, behavior: 'smooth' });\n updatedCanScroll();\n }\n }, [updatedCanScroll]);\n\n useEffect(() => {\n if (hwDetails && scrollRef.current) {\n const { scrollLeft } = scrollRef.current;\n\n if (scrollLeft > 1) {\n setIsLeftHovered(true);\n }\n }\n }, [hwDetails]);\n\n useEffect(() => {\n const scrollElement = scrollRef.current;\n\n if (scrollElement) {\n scrollElement.addEventListener('scroll', updatedCanScroll);\n\n return () => {\n scrollElement.removeEventListener('scroll', updatedCanScroll);\n };\n }\n }, [updatedCanScroll]);\n\n if (totalHWSheetsCount === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework (0)\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n return (\n <Styled.ContentWrapper $flexRowGapX={1} $disablePointerEvents={isHwProcessing}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({waitForReviewSheets}/{totalHWSheetsCount})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleHoverEnter}\n onMouseLeave={handleHoverLeave}\n >\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={isLeftHovered}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {assignedHomeworks.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n <HomeworkCard\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </FlexView>\n );\n })}\n\n {queuedHomeworks.map((sheet, idx) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === 'DYNAMIC';\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {idx === 0 && (\n <Styled.QueueWrapper\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n />\n </FlexView>\n );\n })}\n </FlexView>\n </Styled.ScrollContainer>\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={isRightHovered}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default memo(HwCardListView);\n"],"names":["HwCardListView","userType","studentId","isHwProcessing","hwDetails","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","puzzleHWCardRef","isLeftHovered","setIsLeftHovered","useState","isRightHovered","setIsRightHovered","scrollRef","useRef","assignedHomeworks","queuedHomeworks","totalHWSheetsCount","useMemo","waitForReviewSheets","getWaitForReviewSheetsCount","updatedCanScroll","useCallback","scrollLeft","scrollWidth","clientWidth","handleHoverEnter","handleHoverLeave","handleScrollLeft","handleScrollRight","useEffect","scrollElement","jsxs","FlexView","jsx","Text","Styled.ContentWrapper","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","sheet","idx","nodeId","worksheetId","nodeType","title","subtext","isDynamicSheet","HomeworkCard","Styled.QueueWrapper","Styled.QueueText","ChevronRightIcon","HwCardListView$1","memo"],"mappings":";;;;;;;;;AA2BA,MAAMA,IAAsC,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACJ,QAAM,CAACC,GAAeC,CAAgB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N,UAAA,gBAAAf,EAACgB,GAAA,EAAiB,WAAU,OAAM,QAAO,SAAQ,UAEjD,YAAA;AAAA,sBAAA;AAAA,oBACF;AAAA,oBAEF,gBAAAhB;AAAA,sBAACc;AAAA,sBAAA;AAAA,wBACC,WAAS;AAAA,wBACT,UAAApD;AAAA,wBACA,QAAQiD;AAAA,wBACR,WAAWC,KAAW;AAAA,wBACtB,UAAUN;AAAA,wBACV,UAAS;AAAA,wBACT,WAAA3C;AAAA,wBACA,eAAekD,IAAiB/C,IAAcC;AAAA,wBAC9C,mBAAmB;AAAA,wBACnB,YAAY8C,IAAiB7C,IAAgBC;AAAA,wBAC7C,cAAc4C,IAAiB3C,IAAeC;AAAA,wBAC9C,gBAAAC;AAAA,sBAAA;AAAA,oBACF;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBA7BK,GAAGqC,CAAW,IAAID,CAAM,IAAID,CAAG;AAAA,cAAA;AAAA,YA8BtC,CAEH;AAAA,UAAA,EAAA,CACH,EACF,CAAA;AAAA,UACA,gBAAAP;AAAA,YAACG;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,QAAO;AAAA,cACP,SAAQ;AAAA,cACR,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,aAAY;AAAA,cACZ,SAASR;AAAA,cACT,UAAUlB;AAAA,cACV,MAAK;AAAA,cACL,OAAM;AAAA,cAEN,UAAC,gBAAAuB,EAAAiB,GAAA,EAAiB,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAK1D,CAAc;"}
|
|
1
|
+
{"version":3,"file":"hw-card-list-view.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list-view.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, type FC } from 'react';\n\nimport ChevronLeftIcon from '../../../assets/line-icons/icons/chevron-left';\nimport ChevronRightIcon from '../../../assets/line-icons/icons/chevron-right';\nimport type { INodeDataProps } from '../../chapters-v2/comps/node-card/node-card-types';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport HomeworkCard from '../homework-card';\nimport * as Styled from './hw-card-list-styled';\nimport { getWaitForReviewSheetsCount } from './hw-card-list-utils';\nimport { NODE_TYPE } from '../../sheets/constants/sheet';\nimport type { IHwCardListView } from './hw-card-list-types';\nimport { useScrollButtons } from './hooks/use-scroll-buttons';\n\nconst HwCardListView: FC<IHwCardListView> = ({\n userType,\n studentId,\n isHwProcessing,\n hwDetails,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n puzzleHWCardRef,\n}) => {\n const homeworkData = useMemo(() => {\n const assignedHomeworks = hwDetails?.assigned_homeworks || [];\n const queuedHomeworks = hwDetails?.queued_homeworks || [];\n const totalCount = assignedHomeworks.length + queuedHomeworks.length;\n const waitForReviewCount = getWaitForReviewSheetsCount(hwDetails);\n\n return {\n assignedHomeworks,\n queuedHomeworks,\n totalCount,\n waitForReviewCount,\n };\n }, [hwDetails]);\n\n const {\n scrollRef,\n showLeftButton,\n showRightButton,\n handleMouseEnter,\n handleMouseLeave,\n handleScrollLeft,\n handleScrollRight,\n } = useScrollButtons({\n totalCount: homeworkData.totalCount,\n });\n\n const renderHomeworkCard = useCallback(\n (sheet: INodeDataProps, idx: number, isQueued = false) => {\n const {\n node_id: nodeId,\n worksheet_id: worksheetId,\n node_type: nodeType,\n title,\n subtext,\n } = sheet;\n const isDynamicSheet = nodeType === NODE_TYPE.DYNAMIC;\n\n return (\n <FlexView\n key={`${worksheetId}_${nodeId}_${idx}_${isQueued ? 'queued' : 'assigned'}`}\n $flexDirection=\"row\"\n $flexGapX={1}\n >\n {isQueued && idx === 0 && (\n <Styled.QueueWrapper\n $background=\"BLACK_4\"\n $justifyContent=\"center\"\n $gutter={4}\n $gap={8}\n >\n <Styled.QueueText $renderAs=\"ac3\" $color=\"WHITE\">\n In Queue\n </Styled.QueueText>\n </Styled.QueueWrapper>\n )}\n <HomeworkCard\n isInQueue={isQueued}\n userType={userType}\n header={title}\n subHeader={subtext || ''}\n nodeData={sheet}\n renderAs=\"homework\"\n studentId={studentId}\n onNodeAttempt={isDynamicSheet ? onTestStart : onNodeAttempt}\n shouldOpenOnRight={true}\n onNodeView={isDynamicSheet ? onTestPreview : onNodeView}\n onNodeReview={isDynamicSheet ? onTestReview : onNodeReview}\n onNodeUnassign={onNodeUnassign}\n puzzleHWCardRef={isQueued ? undefined : puzzleHWCardRef}\n />\n </FlexView>\n );\n },\n [\n userType,\n studentId,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n puzzleHWCardRef,\n ],\n );\n\n const homeworkCards = useMemo(() => {\n if (homeworkData.totalCount === 0) return [];\n\n const assignedCards = homeworkData.assignedHomeworks.map((sheet, idx) =>\n renderHomeworkCard(sheet, idx, false),\n );\n\n const queuedCards = homeworkData.queuedHomeworks.map((sheet, idx) =>\n renderHomeworkCard(sheet, idx, true),\n );\n\n return [...assignedCards, ...queuedCards];\n }, [\n homeworkData.assignedHomeworks,\n homeworkData.queuedHomeworks,\n renderHomeworkCard,\n homeworkData.totalCount,\n ]);\n\n if (homeworkData.totalCount === 0) {\n return (\n <FlexView $flexRowGapX={1}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework (0)\n </Text>\n <Text $renderAs=\"ab2\" $color=\"BLACK_T_60\">\n No Homework assigned yet\n </Text>\n </FlexView>\n );\n }\n\n return (\n <Styled.ContentWrapper $flexRowGapX={1} $disablePointerEvents={isHwProcessing}>\n <Text $renderAs=\"ac4-black\" $color=\"BLACK_T_60\">\n Homework ({homeworkData.waitForReviewCount}/{homeworkData.totalCount})\n </Text>\n <FlexView\n $position=\"relative\"\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <Styled.ScrollButton\n $position=\"absolute\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"100%\"\n onClick={handleScrollLeft}\n $visible={showLeftButton}\n left=\"0px\"\n right=\"auto\"\n >\n <ChevronLeftIcon width={24} height={24} />\n </Styled.ScrollButton>\n\n <Styled.ScrollContainer ref={scrollRef}>\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n {homeworkCards}\n </FlexView>\n </Styled.ScrollContainer>\n\n <Styled.ScrollButton\n $position=\"absolute\"\n $width=\"60px\"\n $height=\"100%\"\n $background=\"BLACK_T_60\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n onClick={handleScrollRight}\n $visible={showRightButton}\n left=\"auto\"\n right=\"0px\"\n >\n <ChevronRightIcon width={24} height={24} />\n </Styled.ScrollButton>\n </FlexView>\n </Styled.ContentWrapper>\n );\n};\n\nexport default memo(HwCardListView);\n"],"names":["HwCardListView","userType","studentId","isHwProcessing","hwDetails","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","puzzleHWCardRef","homeworkData","useMemo","assignedHomeworks","queuedHomeworks","totalCount","waitForReviewCount","getWaitForReviewSheetsCount","scrollRef","showLeftButton","showRightButton","handleMouseEnter","handleMouseLeave","handleScrollLeft","handleScrollRight","useScrollButtons","renderHomeworkCard","useCallback","sheet","idx","isQueued","nodeId","worksheetId","nodeType","title","subtext","isDynamicSheet","NODE_TYPE","jsxs","FlexView","jsx","Styled.QueueWrapper","Styled.QueueText","HomeworkCard","homeworkCards","assignedCards","queuedCards","Text","Styled.ContentWrapper","Styled.ScrollButton","ChevronLeftIcon","Styled.ScrollContainer","ChevronRightIcon","HwCardListView$1","memo"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAAsC,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,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C3C;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKxD,CAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, type FC } from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"hw-card-list.js","sources":["../../../../src/features/homework/hw-card-list/hw-card-list.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, type FC } from 'react';\n\nimport { usePuzzleAssignedJourney } from '../../journey/hooks/use-puzzles-journey/use-puzzle-assigned';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport { getPuzzleCardData } from '../utils';\nimport { useGetHomeworks } from './api/get-homeworks';\nimport HwCardListView from './hw-card-list-view';\nimport type { IHWCardListProps } from './hw-card-list-types';\n\nconst HWCardList: FC<IHWCardListProps> = ({\n userType,\n studentId,\n stream,\n onTestStart,\n onNodeAttempt,\n onTestPreview,\n onNodeView,\n onTestReview,\n onNodeReview,\n onNodeUnassign,\n homeworkRef,\n startHomePageJourney,\n canStartJourney,\n canStartPuzzleAssignedJourney,\n}) => {\n const {\n get: getHomeworks,\n data: hwDetails,\n isProcessingFailed,\n isProcessing,\n isProcessed,\n isStale,\n } = useGetHomeworks(studentId);\n const { isJourneyActive } = useJourney();\n\n const { puzzleHWCardRef, startJourney: startPuzzleAssignedJourney } = usePuzzleAssignedJourney();\n\n const puzzleCardData = useMemo(() => getPuzzleCardData(hwDetails), [hwDetails]);\n\n useEffect(() => {\n if (isProcessed && startHomePageJourney && !isJourneyActive && canStartJourney) {\n startHomePageJourney({ studentId, stream, userType });\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isProcessed,\n startHomePageJourney,\n stream,\n studentId,\n userType,\n ]);\n\n const fetchHomeworks = useCallback(() => {\n getHomeworks(studentId, undefined, { stream });\n }, [getHomeworks, stream, studentId]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchHomeworks();\n }\n }, [fetchHomeworks, isProcessing, isStale]);\n\n useEffect(() => {\n fetchHomeworks();\n }, [fetchHomeworks]);\n\n useEffect(() => {\n if (\n canStartPuzzleAssignedJourney &&\n !isJourneyActive &&\n startPuzzleAssignedJourney &&\n puzzleCardData\n ) {\n startPuzzleAssignedJourney(puzzleCardData);\n }\n }, [canStartPuzzleAssignedJourney, puzzleCardData, isJourneyActive, startPuzzleAssignedJourney]);\n\n if (isProcessingFailed) {\n return null;\n }\n\n return (\n <div ref={homeworkRef}>\n <HwCardListView\n isHwProcessing={isProcessing}\n hwDetails={hwDetails}\n onTestStart={onTestStart}\n onNodeAttempt={onNodeAttempt}\n onTestPreview={onTestPreview}\n onNodeView={onNodeView}\n onTestReview={onTestReview}\n onNodeReview={onNodeReview}\n onNodeUnassign={onNodeUnassign}\n userType={userType}\n studentId={studentId}\n puzzleHWCardRef={puzzleHWCardRef}\n />\n </div>\n );\n};\n\nexport default memo(HWCardList);\n"],"names":["HWCardList","userType","studentId","stream","onTestStart","onNodeAttempt","onTestPreview","onNodeView","onTestReview","onNodeReview","onNodeUnassign","homeworkRef","startHomePageJourney","canStartJourney","canStartPuzzleAssignedJourney","getHomeworks","hwDetails","isProcessingFailed","isProcessing","isProcessed","isStale","useGetHomeworks","isJourneyActive","useJourney","puzzleHWCardRef","startPuzzleAssignedJourney","usePuzzleAssignedJourney","puzzleCardData","useMemo","getPuzzleCardData","useEffect","fetchHomeworks","useCallback","jsx","HwCardListView","hwCardList","memo"],"mappings":";;;;;;;AASA,MAAMA,IAAmC,CAAC;AAAA,EACxC,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA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;AAAA,MACA,eAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,UAAAT;AAAA,MACA,WAAAC;AAAA,MACA,iBAAAsB;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,GAEeW,IAAAC,EAAKpC,CAAU;"}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as E, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { memo as h, useState as c, useRef as x, useCallback as f, useMemo as D, useEffect as w } from "react";
|
|
3
|
+
import I from "./modal.js";
|
|
4
4
|
import S from "./modal-context.js";
|
|
5
|
-
import { lockScroll as
|
|
6
|
-
const
|
|
7
|
-
children:
|
|
8
|
-
modals:
|
|
9
|
-
isUserAuthenticated:
|
|
5
|
+
import { lockScroll as R, unlockScroll as T } from "./modal-helpers.js";
|
|
6
|
+
const $ = 500, g = h(function({
|
|
7
|
+
children: p,
|
|
8
|
+
modals: u,
|
|
9
|
+
isUserAuthenticated: t
|
|
10
10
|
}) {
|
|
11
|
-
const [o, M] =
|
|
12
|
-
(e,
|
|
13
|
-
const d =
|
|
11
|
+
const [o, M] = c(null), [m, C] = c(void 0), [r, i] = c(!1), l = x(void 0), v = f(
|
|
12
|
+
(e, s, k) => {
|
|
13
|
+
const d = u.find((y) => y.name === e);
|
|
14
14
|
if (!d)
|
|
15
15
|
throw new Error(`Modal with name "${e}" not found`);
|
|
16
|
-
if (d.isPrivate && !
|
|
16
|
+
if (d.isPrivate && !t)
|
|
17
17
|
throw new Error(
|
|
18
18
|
`Access violation: Modal "${e}" is private and user is not authenticated`
|
|
19
19
|
);
|
|
20
|
-
|
|
20
|
+
l.current = k, i(!1), M(d), C(s), document.body.style.overflow !== "hidden" && R();
|
|
21
21
|
},
|
|
22
|
-
[
|
|
23
|
-
), n =
|
|
24
|
-
|
|
25
|
-
M(null),
|
|
26
|
-
},
|
|
27
|
-
}, []),
|
|
22
|
+
[t, u]
|
|
23
|
+
), n = f(() => {
|
|
24
|
+
i(!0), T(), setTimeout(() => {
|
|
25
|
+
M(null), i(!1);
|
|
26
|
+
}, $);
|
|
27
|
+
}, []), P = D(
|
|
28
28
|
() => ({
|
|
29
29
|
modal: o,
|
|
30
|
-
modalParams:
|
|
31
|
-
openModal:
|
|
30
|
+
modalParams: m,
|
|
31
|
+
openModal: v,
|
|
32
32
|
closeModal: n,
|
|
33
|
-
isClosing:
|
|
33
|
+
isClosing: r
|
|
34
34
|
}),
|
|
35
|
-
[o,
|
|
36
|
-
), a =
|
|
37
|
-
var e,
|
|
38
|
-
(o == null ? void 0 : o.isDismissable) !== !1 && !
|
|
39
|
-
}, [o, n,
|
|
40
|
-
return
|
|
41
|
-
!
|
|
42
|
-
}, [
|
|
43
|
-
const e = (
|
|
44
|
-
|
|
35
|
+
[o, m, v, n, r]
|
|
36
|
+
), a = f(() => {
|
|
37
|
+
var e, s;
|
|
38
|
+
(o == null ? void 0 : o.isDismissable) !== !1 && !r && (n(), l.current && ((s = (e = l.current).onCloseModal) == null || s.call(e), l.current.onCloseModal = void 0));
|
|
39
|
+
}, [o, n, r]);
|
|
40
|
+
return w(() => {
|
|
41
|
+
!t && (o != null && o.isPrivate) && n();
|
|
42
|
+
}, [t, o, n]), w(() => {
|
|
43
|
+
const e = (s) => {
|
|
44
|
+
s.key === "Escape" && a();
|
|
45
45
|
};
|
|
46
46
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
47
|
-
}, [a]), /* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
o && /* @__PURE__ */
|
|
47
|
+
}, [a]), /* @__PURE__ */ E(S.Provider, { value: P, children: [
|
|
48
|
+
p,
|
|
49
|
+
o && /* @__PURE__ */ b(I, { modal: o, isClosing: r, onClose: a })
|
|
50
50
|
] });
|
|
51
|
-
}),
|
|
51
|
+
}), N = g;
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
N as default
|
|
54
54
|
};
|
|
55
55
|
//# sourceMappingURL=modal-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-provider.js","sources":["../../../../src/features/ui/modals/modal-provider.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, useRef, useState, type FC } from 'react';\n\nimport Modal from './modal';\nimport ModalContext from './modal-context';\nimport { lockScroll, unlockScroll } from './modal-helpers';\nimport type { IModal, IModalCallbacks, IModalContext, IModalProviderProps } from './modal-types';\n\nconst ANIMATION_DURATION_MS = 500; // Match the animation duration in modal.tsx\n\n/**\n * Provider component that manages modal state and provides modal context to child components\n */\nconst ModalProvider: FC<IModalProviderProps> = memo(function ModalProvider({\n children,\n modals,\n isUserAuthenticated,\n}) {\n const [modal, setModal] = useState<IModal | null>(null);\n const [modalParams, setModalParams] = useState<Record<string, unknown> | undefined>(undefined);\n const [isClosing, setIsClosing] = useState(false);\n const callbacksRef = useRef<IModalCallbacks | undefined>(undefined);\n
|
|
1
|
+
{"version":3,"file":"modal-provider.js","sources":["../../../../src/features/ui/modals/modal-provider.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo, useRef, useState, type FC } from 'react';\n\nimport Modal from './modal';\nimport ModalContext from './modal-context';\nimport { lockScroll, unlockScroll } from './modal-helpers';\nimport type { IModal, IModalCallbacks, IModalContext, IModalProviderProps } from './modal-types';\n\nconst ANIMATION_DURATION_MS = 500; // Match the animation duration in modal.tsx\n\n/**\n * Provider component that manages modal state and provides modal context to child components\n */\nconst ModalProvider: FC<IModalProviderProps> = memo(function ModalProvider({\n children,\n modals,\n isUserAuthenticated,\n}) {\n const [modal, setModal] = useState<IModal | null>(null);\n const [modalParams, setModalParams] = useState<Record<string, unknown> | undefined>(undefined);\n const [isClosing, setIsClosing] = useState(false);\n const callbacksRef = useRef<IModalCallbacks | undefined>(undefined);\n /**\n * Opens a modal by name with optional parameters\n * Handles authentication check for private modals\n */\n const openModal = useCallback<IModalContext['openModal']>(\n (modalName, newModalParams, callbacks) => {\n const newModal = modals.find(m => m.name === modalName);\n\n if (!newModal) {\n throw new Error(`Modal with name \"${modalName}\" not found`);\n }\n\n if (newModal.isPrivate && !isUserAuthenticated) {\n throw new Error(\n `Access violation: Modal \"${modalName}\" is private and user is not authenticated`,\n );\n }\n\n callbacksRef.current = callbacks;\n setIsClosing(false);\n setModal(newModal);\n setModalParams(newModalParams as unknown as Record<string, unknown> | undefined);\n if (document.body.style.overflow !== 'hidden') {\n lockScroll();\n }\n },\n [isUserAuthenticated, modals],\n );\n\n const closeModal = useCallback(() => {\n setIsClosing(true);\n // Wait for the animation to complete before removing the modal\n unlockScroll();\n setTimeout(() => {\n setModal(null);\n setIsClosing(false);\n }, ANIMATION_DURATION_MS);\n }, []);\n\n const modalContent = useMemo<IModalContext>(\n () => ({\n modal,\n modalParams,\n openModal,\n closeModal,\n isClosing,\n }),\n [modal, modalParams, openModal, closeModal, isClosing],\n );\n\n const onModalDismiss = useCallback(() => {\n if (modal?.isDismissable !== false && !isClosing) {\n closeModal();\n if (callbacksRef.current) {\n callbacksRef.current.onCloseModal?.();\n callbacksRef.current.onCloseModal = undefined; // Clear callback reference\n }\n }\n }, [modal, closeModal, isClosing]);\n\n useEffect(() => {\n if (!isUserAuthenticated && modal?.isPrivate) {\n // If the modal is private and user is not authenticated, close it\n closeModal();\n }\n }, [isUserAuthenticated, modal, closeModal]);\n\n // Handle ESC key\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onModalDismiss();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [onModalDismiss]);\n\n return (\n <ModalContext.Provider value={modalContent}>\n {children}\n {modal && <Modal modal={modal} isClosing={isClosing} onClose={onModalDismiss} />}\n </ModalContext.Provider>\n );\n});\n\nexport default ModalProvider;\n"],"names":["ANIMATION_DURATION_MS","ModalProvider","memo","children","modals","isUserAuthenticated","modal","setModal","useState","modalParams","setModalParams","isClosing","setIsClosing","callbacksRef","useRef","openModal","useCallback","modalName","newModalParams","callbacks","newModal","m","lockScroll","closeModal","unlockScroll","modalContent","useMemo","onModalDismiss","_b","_a","useEffect","handleKeyDown","e","jsxs","ModalContext","jsx","Modal","ModalProvider$1"],"mappings":";;;;;AAOA,MAAMA,IAAwB,KAKxBC,IAAyCC,EAAK,SAAuB;AAAA,EACzE,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,qBAAAC;AACF,GAAG;AACD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAwB,IAAI,GAChD,CAACC,GAAaC,CAAc,IAAIF,EAA8C,MAAS,GACvF,CAACG,GAAWC,CAAY,IAAIJ,EAAS,EAAK,GAC1CK,IAAeC,EAAoC,MAAS,GAK5DC,IAAYC;AAAA,IAChB,CAACC,GAAWC,GAAgBC,MAAc;AACxC,YAAMC,IAAWhB,EAAO,KAAK,CAAKiB,MAAAA,EAAE,SAASJ,CAAS;AAEtD,UAAI,CAACG;AACH,cAAM,IAAI,MAAM,oBAAoBH,CAAS,aAAa;AAGxD,UAAAG,EAAS,aAAa,CAACf;AACzB,cAAM,IAAI;AAAA,UACR,4BAA4BY,CAAS;AAAA,QAAA;AAIzC,MAAAJ,EAAa,UAAUM,GACvBP,EAAa,EAAK,GAClBL,EAASa,CAAQ,GACjBV,EAAeQ,CAAgE,GAC3E,SAAS,KAAK,MAAM,aAAa,YACxBI;IAEf;AAAA,IACA,CAACjB,GAAqBD,CAAM;AAAA,EAAA,GAGxBmB,IAAaP,EAAY,MAAM;AACnC,IAAAJ,EAAa,EAAI,GAEJY,KACb,WAAW,MAAM;AACf,MAAAjB,EAAS,IAAI,GACbK,EAAa,EAAK;AAAA,OACjBZ,CAAqB;AAAA,EAC1B,GAAG,CAAE,CAAA,GAECyB,IAAeC;AAAA,IACnB,OAAO;AAAA,MACL,OAAApB;AAAA,MACA,aAAAG;AAAA,MACA,WAAAM;AAAA,MACA,YAAAQ;AAAA,MACA,WAAAZ;AAAA,IAAA;AAAA,IAEF,CAACL,GAAOG,GAAaM,GAAWQ,GAAYZ,CAAS;AAAA,EAAA,GAGjDgB,IAAiBX,EAAY,MAAM;;AACvC,KAAIV,KAAA,gBAAAA,EAAO,mBAAkB,MAAS,CAACK,MAC1BY,KACPV,EAAa,aACfe,KAAAC,IAAAhB,EAAa,SAAQ,iBAArB,QAAAe,EAAA,KAAAC,IACAhB,EAAa,QAAQ,eAAe;AAAA,EAGvC,GAAA,CAACP,GAAOiB,GAAYZ,CAAS,CAAC;AAEjC,SAAAmB,EAAU,MAAM;AACV,IAAA,CAACzB,MAAuBC,KAAA,QAAAA,EAAO,cAEtBiB;EAEZ,GAAA,CAAClB,GAAqBC,GAAOiB,CAAU,CAAC,GAG3CO,EAAU,MAAM;AACR,UAAAC,IAAgB,CAACC,MAAqB;AACtC,MAAAA,EAAE,QAAQ,YACGL;IACjB;AAGK,kBAAA,iBAAiB,WAAWI,CAAa,GAEzC,MAAM,OAAO,oBAAoB,WAAWA,CAAa;AAAA,EAAA,GAC/D,CAACJ,CAAc,CAAC,GAGhB,gBAAAM,EAAAC,EAAa,UAAb,EAAsB,OAAOT,GAC3B,UAAA;AAAA,IAAAtB;AAAA,IACAG,KAAU,gBAAA6B,EAAAC,GAAA,EAAM,OAAA9B,GAAc,WAAAK,GAAsB,SAASgB,GAAgB;AAAA,EAChF,EAAA,CAAA;AAEJ,CAAC,GAEDU,IAAepC;"}
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const d = e.div`
|
|
1
|
+
import t from "styled-components";
|
|
2
|
+
import o from "../layout/flex-view.js";
|
|
3
|
+
const r = t.div`
|
|
5
4
|
position: absolute;
|
|
6
|
-
top: ${({ $top:
|
|
7
|
-
left: ${({ $left:
|
|
5
|
+
top: ${({ $top: e }) => e}px;
|
|
6
|
+
left: ${({ $left: e }) => e}px;
|
|
8
7
|
height: max-content;
|
|
9
8
|
width: max-content;
|
|
10
9
|
display: flex;
|
|
11
10
|
justify-content: center;
|
|
12
11
|
align-items: end;
|
|
13
|
-
z-index: ${({ $zIndex:
|
|
12
|
+
z-index: ${({ $zIndex: e }) => e};
|
|
14
13
|
pointer-events: none;
|
|
15
|
-
`,
|
|
14
|
+
`, p = t.div`
|
|
16
15
|
box-sizing: border-box;
|
|
17
16
|
display: flex;
|
|
18
17
|
flex-direction: row;
|
|
19
18
|
align-items: center;
|
|
20
19
|
padding: 4px 8px;
|
|
21
20
|
gap: 8px;
|
|
22
|
-
background-color: ${({ theme:
|
|
23
|
-
border: 1px solid ${({ theme:
|
|
21
|
+
background-color: ${({ theme: e }) => e.colors.YELLOW_4};
|
|
22
|
+
border: 1px solid ${({ theme: e }) => e.colors.BLACK_5};
|
|
24
23
|
border-radius: 0px 16px 16px 16px;
|
|
25
|
-
`,
|
|
24
|
+
`, d = t(o)`
|
|
26
25
|
div {
|
|
27
26
|
// Inner container of Lottie Component
|
|
28
27
|
display: flex;
|
|
@@ -31,22 +30,14 @@ const d = e.div`
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
svg {
|
|
33
|
+
width: 33.84px !important;
|
|
34
|
+
height: 47.27px !important;
|
|
34
35
|
display: block;
|
|
35
|
-
|
|
36
|
-
${({ nudge: t }) => t === o.CLICK && `
|
|
37
|
-
width: 33.84px !important;
|
|
38
|
-
height: 47.27px !important;
|
|
39
|
-
`}
|
|
40
|
-
|
|
41
|
-
${({ nudge: t }) => t === o.SWIPE && `
|
|
42
|
-
width: 40.84px !important;
|
|
43
|
-
height: 47.27px !important;
|
|
44
|
-
`}
|
|
45
36
|
}
|
|
46
37
|
`;
|
|
47
38
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
p as NudgeContentWrapper,
|
|
40
|
+
d as NudgeLottieContainer,
|
|
41
|
+
r as NudgeWrapper
|
|
51
42
|
};
|
|
52
43
|
//# sourceMappingURL=nudge-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nudge-styled.js","sources":["../../../../src/features/ui/nudge/nudge-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../layout/flex-view';\nimport {
|
|
1
|
+
{"version":3,"file":"nudge-styled.js","sources":["../../../../src/features/ui/nudge/nudge-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../layout/flex-view';\nimport { type INudgeWrapperProps } from './nudge-types';\n\nexport const NudgeWrapper = styled.div<INudgeWrapperProps>`\n position: absolute;\n top: ${({ $top }) => $top}px;\n left: ${({ $left }) => $left}px;\n height: max-content;\n width: max-content;\n display: flex;\n justify-content: center;\n align-items: end;\n z-index: ${({ $zIndex }) => $zIndex};\n pointer-events: none;\n`;\n\nexport const NudgeContentWrapper = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 4px 8px;\n gap: 8px;\n background-color: ${({ theme }) => theme.colors.YELLOW_4};\n border: 1px solid ${({ theme }) => theme.colors.BLACK_5};\n border-radius: 0px 16px 16px 16px;\n`;\n\nexport const NudgeLottieContainer = styled(FlexView)`\n div {\n // Inner container of Lottie Component\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n svg {\n width: 33.84px !important;\n height: 47.27px !important;\n display: block;\n }\n`;\n"],"names":["NudgeWrapper","styled","$top","$left","$zIndex","NudgeContentWrapper","theme","NudgeLottieContainer","FlexView"],"mappings":";;AAKO,MAAMA,IAAeC,EAAO;AAAA;AAAA,SAE1B,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA,UACjB,CAAC,EAAE,OAAAC,EAAM,MAAMA,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMjB,CAAC,EAAE,SAAAC,EAAQ,MAAMA,CAAO;AAAA;AAAA,GAIxBC,IAAsBJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAOpB,CAAC,EAAE,OAAAK,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA,sBACpC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA,GAI5CC,IAAuBN,EAAOO,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
2
|
+
import { memo as p } from "react";
|
|
3
3
|
import { LOTTIE as t } from "../../../assets/lottie/lottie.js";
|
|
4
|
-
import
|
|
5
|
-
import { NudgeWrapper as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
nudgePointerY: p = 0,
|
|
4
|
+
import c from "../lottie-animation/lottie-animation.js";
|
|
5
|
+
import { NudgeWrapper as f, NudgeLottieContainer as l, NudgeContentWrapper as s } from "./nudge-styled.js";
|
|
6
|
+
const u = ({
|
|
7
|
+
nudge: o = "click",
|
|
8
|
+
content: e,
|
|
9
|
+
nudgePointerX: i = 0,
|
|
10
|
+
nudgePointerY: m = 0,
|
|
12
11
|
zIndex: d = 100
|
|
13
|
-
}) => /* @__PURE__ */ n(
|
|
14
|
-
/* @__PURE__ */ r(
|
|
15
|
-
|
|
16
|
-
] }),
|
|
12
|
+
}) => /* @__PURE__ */ n(f, { $top: m, $left: i, $zIndex: d, children: [
|
|
13
|
+
/* @__PURE__ */ r(l, { $height: 60, $width: 60, children: /* @__PURE__ */ r(c, { src: o === "click" ? t.NUDGE_TAP : t.NUDGE_SWIPE }) }),
|
|
14
|
+
e && /* @__PURE__ */ r(s, { children: e })
|
|
15
|
+
] }), x = p(u);
|
|
17
16
|
export {
|
|
18
|
-
|
|
17
|
+
x as default
|
|
19
18
|
};
|
|
20
19
|
//# sourceMappingURL=nudge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nudge.js","sources":["../../../../src/features/ui/nudge/nudge.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport LottieAnimation from '../lottie-animation/lottie-animation';\nimport * as S from './nudge-styled';\nimport {
|
|
1
|
+
{"version":3,"file":"nudge.js","sources":["../../../../src/features/ui/nudge/nudge.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport LottieAnimation from '../lottie-animation/lottie-animation';\nimport * as S from './nudge-styled';\nimport type { INudgeProps } from './nudge-types';\n\nconst Nudge: FC<INudgeProps> = ({\n nudge = 'click',\n content,\n nudgePointerX = 0,\n nudgePointerY = 0,\n zIndex = 100,\n}) => {\n return (\n <S.NudgeWrapper $top={nudgePointerY} $left={nudgePointerX} $zIndex={zIndex}>\n <S.NudgeLottieContainer $height={60} $width={60}>\n <LottieAnimation src={nudge === 'click' ? LOTTIE.NUDGE_TAP : LOTTIE.NUDGE_SWIPE} />\n </S.NudgeLottieContainer>\n {content && <S.NudgeContentWrapper>{content}</S.NudgeContentWrapper>}\n </S.NudgeWrapper>\n );\n};\n\nexport default memo(Nudge);\n"],"names":["Nudge","nudge","content","nudgePointerX","nudgePointerY","zIndex","jsxs","S.NudgeWrapper","jsx","S.NudgeLottieContainer","LottieAnimation","LOTTIE","S.NudgeContentWrapper","Nudge$1","memo"],"mappings":";;;;;AAOA,MAAMA,IAAyB,CAAC;AAAA,EAC9B,OAAAC,IAAQ;AAAA,EACR,SAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,eAAAC,IAAgB;AAAA,EAChB,QAAAC,IAAS;AACX,MAEI,gBAAAC,EAACC,GAAA,EAAe,MAAMH,GAAe,OAAOD,GAAe,SAASE,GAClE,UAAA;AAAA,EAAA,gBAAAG,EAACC,GAAA,EAAuB,SAAS,IAAI,QAAQ,IAC3C,UAAA,gBAAAD,EAACE,GAAgB,EAAA,KAAKT,MAAU,UAAUU,EAAO,YAAYA,EAAO,YAAa,CAAA,GACnF;AAAA,EACCT,KAAW,gBAAAM,EAACI,GAAA,EAAuB,UAAQV,EAAA,CAAA;AAC9C,EAAA,CAAA,GAIWW,IAAAC,EAAKd,CAAK;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -536,11 +536,6 @@ declare const ENROLLMENT_TYPES: {
|
|
|
536
536
|
readonly CUECENTER: "CUECENTER";
|
|
537
537
|
};
|
|
538
538
|
|
|
539
|
-
declare enum ENudgeType {
|
|
540
|
-
CLICK = "click",
|
|
541
|
-
SWIPE = "swipe"
|
|
542
|
-
}
|
|
543
|
-
|
|
544
539
|
export declare enum EPLAState {
|
|
545
540
|
NO_CARD_ON_FILE = "no_card_on_file",
|
|
546
541
|
CARD_ADDED_SEARCHING_TUTOR = "card_added_searching_tutor",
|
|
@@ -799,23 +794,10 @@ export declare const HintFillIcon: FC<SVGProps<SVGSVGElement>>;
|
|
|
799
794
|
|
|
800
795
|
export declare const HomeIcon: FC<SVGProps<SVGSVGElement>>;
|
|
801
796
|
|
|
802
|
-
export declare const HomeworkCardList: NamedExoticComponent<
|
|
797
|
+
export declare const HomeworkCardList: NamedExoticComponent<IHWCardListProps>;
|
|
803
798
|
|
|
804
799
|
declare const hues: readonly ["YELLOW", "ORANGE", "PURPLE", "GREEN", "BLUE"];
|
|
805
800
|
|
|
806
|
-
declare interface HWCardListProps extends INodeCardCallbacks {
|
|
807
|
-
userType: TUserTypes;
|
|
808
|
-
studentId: string;
|
|
809
|
-
stream: string;
|
|
810
|
-
onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;
|
|
811
|
-
onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;
|
|
812
|
-
onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;
|
|
813
|
-
homeworkRef?: React.RefObject<HTMLDivElement>;
|
|
814
|
-
startHomePageJourney?: ({ studentId, stream, userType }: IHomepageStartJourneyProps) => void;
|
|
815
|
-
canStartJourney?: boolean;
|
|
816
|
-
canStartPuzzleAssignedJourney?: boolean;
|
|
817
|
-
}
|
|
818
|
-
|
|
819
801
|
export declare interface IAboutGameActivitiesProps {
|
|
820
802
|
show?: boolean;
|
|
821
803
|
isGradeKTo1?: boolean;
|
|
@@ -1892,6 +1874,19 @@ declare interface IHomeWorkHelpRequestModelWithStudentName extends IHomeWorkHelp
|
|
|
1892
1874
|
student_name: string;
|
|
1893
1875
|
}
|
|
1894
1876
|
|
|
1877
|
+
declare interface IHWCardListProps extends INodeCardCallbacks {
|
|
1878
|
+
userType: TUserTypes;
|
|
1879
|
+
studentId: string;
|
|
1880
|
+
stream: string;
|
|
1881
|
+
onTestPreview?: (sheetData: INodeDataProps, milestoneId?: string) => void;
|
|
1882
|
+
onTestStart?: (sheetData: INodeDataProps, homeworkId?: string) => void;
|
|
1883
|
+
onTestReview?: (sheetData: INodeDataProps, milestoneId?: string) => void;
|
|
1884
|
+
homeworkRef?: React.RefObject<HTMLDivElement>;
|
|
1885
|
+
startHomePageJourney?: ({ studentId, stream, userType }: IHomepageStartJourneyProps) => void;
|
|
1886
|
+
canStartJourney?: boolean;
|
|
1887
|
+
canStartPuzzleAssignedJourney?: boolean;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1895
1890
|
declare interface IIconButtonProps extends Omit<IButtonProps, 'label' | 'shape' | 'widthX' | 'width' | 'iconPosition' | 'alignSelf' | 'analyticsLabel' | 'renderAs'>, Required<Pick<IClickableAnalyticsProps, 'analyticsLabel'>> {
|
|
1896
1891
|
Icon: FC<SVGProps<SVGSVGElement>>;
|
|
1897
1892
|
customBgColor?: TColorNames;
|
|
@@ -3011,7 +3006,7 @@ declare interface INodePermissions {
|
|
|
3011
3006
|
export declare const InputStatusIcon: NamedExoticComponent<IInputStatusIconProps>;
|
|
3012
3007
|
|
|
3013
3008
|
export declare interface INudgeProps {
|
|
3014
|
-
nudge:
|
|
3009
|
+
nudge: 'click' | 'swipe';
|
|
3015
3010
|
content: ReactNode;
|
|
3016
3011
|
nudgePointerX: number;
|
|
3017
3012
|
nudgePointerY: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/decode-uri-component/index.js"],"sourcesContent":["const token = '%[a-f0-9]{2}';\nconst singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');\nconst multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\nfunction decodeComponents(components, split) {\n\ttry {\n\t\t// Try to decode the entire string first\n\t\treturn [decodeURIComponent(components.join(''))];\n\t} catch {\n\t\t// Do nothing\n\t}\n\n\tif (components.length === 1) {\n\t\treturn components;\n\t}\n\n\tsplit = split || 1;\n\n\t// Split the array in 2 parts\n\tconst left = components.slice(0, split);\n\tconst right = components.slice(split);\n\n\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n}\n\nfunction decode(input) {\n\ttry {\n\t\treturn decodeURIComponent(input);\n\t} catch {\n\t\tlet tokens = input.match(singleMatcher) || [];\n\n\t\tfor (let i = 1; i < tokens.length; i++) {\n\t\t\tinput = decodeComponents(tokens, i).join('');\n\n\t\t\ttokens = input.match(singleMatcher) || [];\n\t\t}\n\n\t\treturn input;\n\t}\n}\n\nfunction customDecodeURIComponent(input) {\n\t// Keep track of all the replacements and prefill the map with the `BOM`\n\tconst replaceMap = {\n\t\t'%FE%FF': '\\uFFFD\\uFFFD',\n\t\t'%FF%FE': '\\uFFFD\\uFFFD',\n\t};\n\n\tlet match = multiMatcher.exec(input);\n\twhile (match) {\n\t\ttry {\n\t\t\t// Decode as big chunks as possible\n\t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n\t\t} catch {\n\t\t\tconst result = decode(match[0]);\n\n\t\t\tif (result !== match[0]) {\n\t\t\t\treplaceMap[match[0]] = result;\n\t\t\t}\n\t\t}\n\n\t\tmatch = multiMatcher.exec(input);\n\t}\n\n\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\treplaceMap['%C2'] = '\\uFFFD';\n\n\tconst entries = Object.keys(replaceMap);\n\n\tfor (const key of entries) {\n\t\t// Replace all decoded components\n\t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n\t}\n\n\treturn input;\n}\n\nexport default function decodeUriComponent(encodedURI) {\n\tif (typeof encodedURI !== 'string') {\n\t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n\t}\n\n\ttry {\n\t\t// Try the built in decoder first\n\t\treturn decodeURIComponent(encodedURI);\n\t} catch {\n\t\t// Fallback to a more advanced decoder\n\t\treturn customDecodeURIComponent(encodedURI);\n\t}\n}\n"],"names":["token","singleMatcher","multiMatcher","decodeComponents","components","split","left","right","decode","input","tokens","i","customDecodeURIComponent","replaceMap","match","result","entries","key","decodeUriComponent","encodedURI"],"mappings":"AAAA,MAAMA,IAAQ,gBACRC,IAAgB,IAAI,OAAO,MAAMD,IAAQ,cAAc,IAAI,GAC3DE,IAAe,IAAI,OAAO,MAAMF,IAAQ,MAAM,IAAI;AAExD,SAASG,EAAiBC,GAAYC,GAAO;AAC5C,MAAI;AAEH,WAAO,CAAC,mBAAmBD,EAAW,KAAK,EAAE,CAAC,CAAC;AAAA,EACjD,QAAS;AAAA,EAEP;AAED,MAAIA,EAAW,WAAW;AACzB,WAAOA;AAGR,EAAAC,IAAQA,KAAS;AAGjB,QAAMC,IAAOF,EAAW,MAAM,GAAGC,CAAK,GAChCE,IAAQH,EAAW,MAAMC,CAAK;AAEpC,SAAO,MAAM,UAAU,OAAO,KAAK,CAAA,GAAIF,EAAiBG,CAAI,GAAGH,EAAiBI,CAAK,CAAC;AACvF;AAEA,SAASC,EAAOC,GAAO;AACtB,MAAI;AACH,WAAO,mBAAmBA,CAAK;AAAA,EACjC,QAAS;AACP,QAAIC,IAASD,EAAM,MAAMR,CAAa,KAAK,CAAA;AAE3C,aAASU,IAAI,GAAGA,IAAID,EAAO,QAAQC;AAClC,MAAAF,IAAQN,EAAiBO,GAAQC,CAAC,EAAE,KAAK,EAAE,GAE3CD,IAASD,EAAM,MAAMR,CAAa,KAAK,CAAA;AAGxC,WAAOQ;AAAA,EACP;AACF;AAEA,SAASG,EAAyBH,GAAO;AAExC,QAAMI,IAAa;AAAA,IAClB,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAEC,MAAIC,IAAQZ,EAAa,KAAKO,CAAK;AACnC,SAAOK,KAAO;AACb,QAAI;AAEH,MAAAD,EAAWC,EAAM,CAAC,CAAC,IAAI,mBAAmBA,EAAM,CAAC,CAAC;AAAA,IACrD,QAAU;AACP,YAAMC,IAASP,EAAOM,EAAM,CAAC,CAAC;AAE9B,MAAIC,MAAWD,EAAM,CAAC,MACrBD,EAAWC,EAAM,CAAC,CAAC,IAAIC;AAAA,IAExB;AAED,IAAAD,IAAQZ,EAAa,KAAKO,CAAK;AAAA,EAC/B;AAGD,EAAAI,EAAW,KAAK,IAAI;AAEpB,QAAMG,IAAU,OAAO,KAAKH,CAAU;AAEtC,aAAWI,KAAOD;AAEjB,IAAAP,IAAQA,EAAM,QAAQ,IAAI,OAAOQ,GAAK,GAAG,GAAGJ,EAAWI,CAAG,CAAC;AAG5D,SAAOR;AACR;AAEe,SAASS,EAAmBC,GAAY;AACtD,MAAI,OAAOA,KAAe;AACzB,UAAM,IAAI,UAAU,wDAAwD,OAAOA,IAAa,GAAG;AAGpG,MAAI;AAEH,WAAO,mBAAmBA,CAAU;AAAA,EACtC,QAAS;AAEP,WAAOP,EAAyBO,CAAU;AAAA,EAC1C;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import b from "
|
|
1
|
+
import b from "../decode-uri-component/index.js";
|
|
2
2
|
import l from "../split-on-first/index.js";
|
|
3
3
|
import { includeKeys as N } from "../filter-obj/index.js";
|
|
4
4
|
const j = (r) => r == null, A = (r) => encodeURIComponent(r).replace(/[!'()*]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`), u = Symbol("encodeFragmentIdentifier");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/native.js"],"sourcesContent":["const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};"],"names":["randomUUID","native"],"mappings":"AAAA,MAAMA,IAAa,OAAO,SAAW,OAAe,OAAO,cAAc,OAAO,WAAW,KAAK,MAAM,GACvFC,IAAA;AAAA,EACb,YAAAD;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
let t;
|
|
2
|
+
const e = new Uint8Array(16);
|
|
2
3
|
function o() {
|
|
3
|
-
if (!t && (t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)
|
|
4
|
+
if (!t && (t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !t))
|
|
4
5
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
5
6
|
return t(e);
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rng.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/rng.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\
|
|
1
|
+
{"version":3,"file":"rng.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/rng.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}"],"names":["getRandomValues","rnds8","rng"],"mappings":"AAGA,IAAIA;AACJ,MAAMC,IAAQ,IAAI,WAAW,EAAE;AAChB,SAASC,IAAM;AAE5B,MAAI,CAACF,MAEHA,IAAkB,OAAO,SAAW,OAAe,OAAO,mBAAmB,OAAO,gBAAgB,KAAK,MAAM,GAE3G,CAACA;AACH,UAAM,IAAI,MAAM,0GAA0G;AAI9H,SAAOA,EAAgBC,CAAK;AAC9B;","x_google_ignoreList":[0]}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, o = (t[e[i + 0]] + t[e[i + 1]] + t[e[i + 2]] + t[e[i + 3]] + "-" + t[e[i + 4]] + t[e[i + 5]] + "-" + t[e[i + 6]] + t[e[i + 7]] + "-" + t[e[i + 8]] + t[e[i + 9]] + "-" + t[e[i + 10]] + t[e[i + 11]] + t[e[i + 12]] + t[e[i + 13]] + t[e[i + 14]] + t[e[i + 15]]).toLowerCase();
|
|
7
|
-
if (!s(o))
|
|
8
|
-
throw TypeError("Stringified UUID is invalid");
|
|
9
|
-
return o;
|
|
1
|
+
const i = [];
|
|
2
|
+
for (let n = 0; n < 256; ++n)
|
|
3
|
+
i.push((n + 256).toString(16).slice(1));
|
|
4
|
+
function c(n, u = 0) {
|
|
5
|
+
return (i[n[u + 0]] + i[n[u + 1]] + i[n[u + 2]] + i[n[u + 3]] + "-" + i[n[u + 4]] + i[n[u + 5]] + "-" + i[n[u + 6]] + i[n[u + 7]] + "-" + i[n[u + 8]] + i[n[u + 9]] + "-" + i[n[u + 10]] + i[n[u + 11]] + i[n[u + 12]] + i[n[u + 13]] + i[n[u + 14]] + i[n[u + 15]]).toLowerCase();
|
|
10
6
|
}
|
|
11
7
|
export {
|
|
12
|
-
|
|
8
|
+
c as unsafeStringify
|
|
13
9
|
};
|
|
14
10
|
//# sourceMappingURL=stringify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringify.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/stringify.js"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\
|
|
1
|
+
{"version":3,"file":"stringify.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/stringify.js"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;"],"names":["byteToHex","i","unsafeStringify","arr","offset"],"mappings":"AAMA,MAAMA,IAAY,CAAA;AAElB,SAASC,IAAI,GAAGA,IAAI,KAAK,EAAEA;AACzB,EAAAD,EAAU,MAAMC,IAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;AAG3C,SAASC,EAAgBC,GAAKC,IAAS,GAAG;AAG/C,UAAQJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,CAAC,CAAC,IAAI,MAAMJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,IAAIJ,EAAUG,EAAIC,IAAS,EAAE,CAAC,GAAG;AACvf;","x_google_ignoreList":[0]}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import e from "./native.js";
|
|
2
|
+
import i from "./rng.js";
|
|
3
|
+
import { unsafeStringify as d } from "./stringify.js";
|
|
4
|
+
function g(n, m, t) {
|
|
5
|
+
if (e.randomUUID && !m && !n)
|
|
6
|
+
return e.randomUUID();
|
|
4
7
|
n = n || {};
|
|
5
|
-
|
|
8
|
+
const r = n.random || (n.rng || i)();
|
|
6
9
|
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, m) {
|
|
7
|
-
|
|
8
|
-
for (
|
|
9
|
-
m[
|
|
10
|
+
t = t || 0;
|
|
11
|
+
for (let a = 0; a < 16; ++a)
|
|
12
|
+
m[t + a] = r[a];
|
|
10
13
|
return m;
|
|
11
14
|
}
|
|
12
|
-
return
|
|
15
|
+
return d(r);
|
|
13
16
|
}
|
|
14
17
|
export {
|
|
15
|
-
|
|
18
|
+
g as default
|
|
16
19
|
};
|
|
17
20
|
//# sourceMappingURL=v4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v4.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import rng from './rng.js';\nimport
|
|
1
|
+
{"version":3,"file":"v4.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;"],"names":["v4","options","buf","offset","native","rnds","rng","i","unsafeStringify"],"mappings":";;;AAIA,SAASA,EAAGC,GAASC,GAAKC,GAAQ;AAChC,MAAIC,EAAO,cAAc,CAACF,KAAO,CAACD;AAChC,WAAOG,EAAO;AAGhB,EAAAH,IAAUA,KAAW;AACrB,QAAMI,IAAOJ,EAAQ,WAAWA,EAAQ,OAAOK;AAK/C,MAHAD,EAAK,CAAC,IAAIA,EAAK,CAAC,IAAI,KAAO,IAC3BA,EAAK,CAAC,IAAIA,EAAK,CAAC,IAAI,KAAO,KAEvBH,GAAK;AACP,IAAAC,IAASA,KAAU;AAEnB,aAASI,IAAI,GAAGA,IAAI,IAAI,EAAEA;AACxB,MAAAL,EAAIC,IAASI,CAAC,IAAIF,EAAKE,CAAC;AAG1B,WAAOL;AAAA,EACR;AAED,SAAOM,EAAgBH,CAAI;AAC7B;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nudge-types.js","sources":["../../../../src/features/ui/nudge/nudge-types.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport enum ENudgeType {\n CLICK = 'click',\n SWIPE = 'swipe',\n}\n\nexport interface INudgeProps {\n nudge: ENudgeType;\n content: ReactNode;\n nudgePointerX: number;\n nudgePointerY: number;\n zIndex?: number;\n}\n\nexport interface INudgeWrapperProps {\n $top: number;\n $left: number;\n $zIndex: number;\n}\n"],"names":["ENudgeType"],"mappings":"AAEY,IAAAA,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/query-string/node_modules/decode-uri-component/index.js"],"sourcesContent":["const token = '%[a-f0-9]{2}';\nconst singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');\nconst multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\nfunction decodeComponents(components, split) {\n\ttry {\n\t\t// Try to decode the entire string first\n\t\treturn [decodeURIComponent(components.join(''))];\n\t} catch {\n\t\t// Do nothing\n\t}\n\n\tif (components.length === 1) {\n\t\treturn components;\n\t}\n\n\tsplit = split || 1;\n\n\t// Split the array in 2 parts\n\tconst left = components.slice(0, split);\n\tconst right = components.slice(split);\n\n\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n}\n\nfunction decode(input) {\n\ttry {\n\t\treturn decodeURIComponent(input);\n\t} catch {\n\t\tlet tokens = input.match(singleMatcher) || [];\n\n\t\tfor (let i = 1; i < tokens.length; i++) {\n\t\t\tinput = decodeComponents(tokens, i).join('');\n\n\t\t\ttokens = input.match(singleMatcher) || [];\n\t\t}\n\n\t\treturn input;\n\t}\n}\n\nfunction customDecodeURIComponent(input) {\n\t// Keep track of all the replacements and prefill the map with the `BOM`\n\tconst replaceMap = {\n\t\t'%FE%FF': '\\uFFFD\\uFFFD',\n\t\t'%FF%FE': '\\uFFFD\\uFFFD',\n\t};\n\n\tlet match = multiMatcher.exec(input);\n\twhile (match) {\n\t\ttry {\n\t\t\t// Decode as big chunks as possible\n\t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n\t\t} catch {\n\t\t\tconst result = decode(match[0]);\n\n\t\t\tif (result !== match[0]) {\n\t\t\t\treplaceMap[match[0]] = result;\n\t\t\t}\n\t\t}\n\n\t\tmatch = multiMatcher.exec(input);\n\t}\n\n\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\treplaceMap['%C2'] = '\\uFFFD';\n\n\tconst entries = Object.keys(replaceMap);\n\n\tfor (const key of entries) {\n\t\t// Replace all decoded components\n\t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n\t}\n\n\treturn input;\n}\n\nexport default function decodeUriComponent(encodedURI) {\n\tif (typeof encodedURI !== 'string') {\n\t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n\t}\n\n\ttry {\n\t\t// Try the built in decoder first\n\t\treturn decodeURIComponent(encodedURI);\n\t} catch {\n\t\t// Fallback to a more advanced decoder\n\t\treturn customDecodeURIComponent(encodedURI);\n\t}\n}\n"],"names":["token","singleMatcher","multiMatcher","decodeComponents","components","split","left","right","decode","input","tokens","i","customDecodeURIComponent","replaceMap","match","result","entries","key","decodeUriComponent","encodedURI"],"mappings":"AAAA,MAAMA,IAAQ,gBACRC,IAAgB,IAAI,OAAO,MAAMD,IAAQ,cAAc,IAAI,GAC3DE,IAAe,IAAI,OAAO,MAAMF,IAAQ,MAAM,IAAI;AAExD,SAASG,EAAiBC,GAAYC,GAAO;AAC5C,MAAI;AAEH,WAAO,CAAC,mBAAmBD,EAAW,KAAK,EAAE,CAAC,CAAC;AAAA,EACjD,QAAS;AAAA,EAEP;AAED,MAAIA,EAAW,WAAW;AACzB,WAAOA;AAGR,EAAAC,IAAQA,KAAS;AAGjB,QAAMC,IAAOF,EAAW,MAAM,GAAGC,CAAK,GAChCE,IAAQH,EAAW,MAAMC,CAAK;AAEpC,SAAO,MAAM,UAAU,OAAO,KAAK,CAAA,GAAIF,EAAiBG,CAAI,GAAGH,EAAiBI,CAAK,CAAC;AACvF;AAEA,SAASC,EAAOC,GAAO;AACtB,MAAI;AACH,WAAO,mBAAmBA,CAAK;AAAA,EACjC,QAAS;AACP,QAAIC,IAASD,EAAM,MAAMR,CAAa,KAAK,CAAA;AAE3C,aAASU,IAAI,GAAGA,IAAID,EAAO,QAAQC;AAClC,MAAAF,IAAQN,EAAiBO,GAAQC,CAAC,EAAE,KAAK,EAAE,GAE3CD,IAASD,EAAM,MAAMR,CAAa,KAAK,CAAA;AAGxC,WAAOQ;AAAA,EACP;AACF;AAEA,SAASG,EAAyBH,GAAO;AAExC,QAAMI,IAAa;AAAA,IAClB,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAEC,MAAIC,IAAQZ,EAAa,KAAKO,CAAK;AACnC,SAAOK,KAAO;AACb,QAAI;AAEH,MAAAD,EAAWC,EAAM,CAAC,CAAC,IAAI,mBAAmBA,EAAM,CAAC,CAAC;AAAA,IACrD,QAAU;AACP,YAAMC,IAASP,EAAOM,EAAM,CAAC,CAAC;AAE9B,MAAIC,MAAWD,EAAM,CAAC,MACrBD,EAAWC,EAAM,CAAC,CAAC,IAAIC;AAAA,IAExB;AAED,IAAAD,IAAQZ,EAAa,KAAKO,CAAK;AAAA,EAC/B;AAGD,EAAAI,EAAW,KAAK,IAAI;AAEpB,QAAMG,IAAU,OAAO,KAAKH,CAAU;AAEtC,aAAWI,KAAOD;AAEjB,IAAAP,IAAQA,EAAM,QAAQ,IAAI,OAAOQ,GAAK,GAAG,GAAGJ,EAAWI,CAAG,CAAC;AAG5D,SAAOR;AACR;AAEe,SAASS,EAAmBC,GAAY;AACtD,MAAI,OAAOA,KAAe;AACzB,UAAM,IAAI,UAAU,wDAAwD,OAAOA,IAAa,GAAG;AAGpG,MAAI;AAEH,WAAO,mBAAmBA,CAAU;AAAA,EACtC,QAAS;AAEP,WAAOP,EAAyBO,CAAU;AAAA,EAC1C;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"regex.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/regex.js"],"sourcesContent":["export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;"],"names":["REGEX"],"mappings":"AAAA,MAAAA,IAAe;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sources":["../../../../../node_modules/uuid/dist/esm-browser/validate.js"],"sourcesContent":["import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;"],"names":["validate","uuid","REGEX"],"mappings":";AAEA,SAASA,EAASC,GAAM;AACtB,SAAO,OAAOA,KAAS,YAAYC,EAAM,KAAKD,CAAI;AACpD;","x_google_ignoreList":[0]}
|
|
File without changes
|