@cuemath/leap 3.5.11-as2 → 3.5.11-as3

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.
@@ -1,31 +1,29 @@
1
- import e from "styled-components";
2
- import n from "../../../ui/layout/flex-view.js";
3
- const i = e(n)`
4
- border-bottom: ${({ $shouldAddBorder: o, theme: t }) => o ? `1px solid ${t.colors.BLACK}` : "none"};
5
- `, p = e(n)`
1
+ import t from "styled-components";
2
+ import e from "../../../ui/layout/flex-view.js";
3
+ const i = t(e)`
4
+ border-bottom: ${({ $shouldAddBorder: o, theme: n }) => o ? `1px solid ${n.colors.BLACK}` : "none"};
5
+ will-change: border-bottom;
6
+ `, p = t(e)`
6
7
  border-top: none;
7
8
  border-bottom: ${({ $isExpanded: o }) => o && "none"};
8
9
  padding-bottom: 24px;
9
- `, s = e(n)`
10
+ will-change: border-bottom;
11
+ `, b = t(e)`
10
12
  position: absolute;
11
13
  top: 0px;
12
14
  left: 0px;
13
15
  z-index: 2;
14
- `;
15
- e(n)`
16
- border-bottom: ${({ $isLastItem: o, theme: t }) => o ? `1px solid ${t.colors.BLACK}` : "none"};
17
- `;
18
- const b = e(n)`
19
- border-left: ${({ $isLastCard: o, theme: t }) => o ? "none" : `1px dashed ${t.colors.GREY_3}`};
16
+ `, l = t(e)`
17
+ border-left: ${({ $isLastCard: o, theme: n }) => o ? "none" : `1px dashed ${n.colors.GREY_3}`};
20
18
  padding-bottom: ${({ $isLastCard: o }) => o ? "0" : "20px"};
21
19
  > div {
22
20
  margin-left: -8px;
23
21
  }
24
22
  `;
25
23
  export {
26
- b as Card,
24
+ l as Card,
27
25
  i as SectionContainer,
28
26
  p as SectionFooter,
29
- s as TagContainer
27
+ b as TagContainer
30
28
  };
31
29
  //# sourceMappingURL=daily-timeline-items-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-items-styled.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const SectionContainer = styled(FlexView)<{ $shouldAddBorder?: boolean }>`\n border-bottom: ${({ $shouldAddBorder, theme }) =>\n $shouldAddBorder ? `1px solid ${theme.colors.BLACK}` : 'none'};\n`;\n\nexport const SectionFooter = styled(FlexView)<{ $isExpanded?: boolean }>`\n border-top: none;\n border-bottom: ${({ $isExpanded }) => $isExpanded && 'none'};\n padding-bottom: 24px;\n`;\n\nexport const TagContainer = styled(FlexView)`\n position: absolute;\n top: 0px;\n left: 0px;\n z-index: 2;\n`;\n\nexport const SectionChild = styled(FlexView)<{ $isLastItem?: boolean }>`\n border-bottom: ${({ $isLastItem, theme }) =>\n $isLastItem ? `1px solid ${theme.colors.BLACK}` : 'none'};\n`;\n\nexport const Card = styled(FlexView)<{ $isLastCard: boolean }>`\n border-left: ${({ $isLastCard, theme }) =>\n $isLastCard ? 'none' : `1px dashed ${theme.colors.GREY_3}`};\n padding-bottom: ${({ $isLastCard }) => ($isLastCard ? '0' : '20px')};\n > div {\n margin-left: -8px;\n }\n`;\n"],"names":["SectionContainer","styled","FlexView","$shouldAddBorder","theme","SectionFooter","$isExpanded","TagContainer","$isLastItem","Card","$isLastCard"],"mappings":";;AAIa,MAAAA,IAAmBC,EAAOC,CAAQ;AAAA,mBAC5B,CAAC,EAAE,kBAAAC,GAAkB,OAAAC,EAAM,MAC1CD,IAAmB,aAAaC,EAAM,OAAO,KAAK,KAAK,MAAM;AAAA,GAGpDC,IAAgBJ,EAAOC,CAAQ;AAAA;AAAA,mBAEzB,CAAC,EAAE,aAAAI,QAAkBA,KAAe,MAAM;AAAA;AAAA,GAIhDC,IAAeN,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAOfD,EAAOC,CAAQ;AAAA,mBACxB,CAAC,EAAE,aAAAM,GAAa,OAAAJ,EAAM,MACrCI,IAAc,aAAaJ,EAAM,OAAO,KAAK,KAAK,MAAM;AAAA;AAG/C,MAAAK,IAAOR,EAAOC,CAAQ;AAAA,iBAClB,CAAC,EAAE,aAAAQ,GAAa,OAAAN,EAAM,MACnCM,IAAc,SAAS,cAAcN,EAAM,OAAO,MAAM,EAAE;AAAA,oBAC1C,CAAC,EAAE,aAAAM,EAAA,MAAmBA,IAAc,MAAM,MAAO;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"daily-timeline-items-styled.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const SectionContainer = styled(FlexView)<{ $shouldAddBorder?: boolean }>`\n border-bottom: ${({ $shouldAddBorder, theme }) =>\n $shouldAddBorder ? `1px solid ${theme.colors.BLACK}` : 'none'};\n will-change: border-bottom;\n`;\n\nexport const SectionFooter = styled(FlexView)<{ $isExpanded?: boolean }>`\n border-top: none;\n border-bottom: ${({ $isExpanded }) => $isExpanded && 'none'};\n padding-bottom: 24px;\n will-change: border-bottom;\n`;\n\nexport const TagContainer = styled(FlexView)`\n position: absolute;\n top: 0px;\n left: 0px;\n z-index: 2;\n`;\n\nexport const Card = styled(FlexView)<{ $isLastCard: boolean }>`\n border-left: ${({ $isLastCard, theme }) =>\n $isLastCard ? 'none' : `1px dashed ${theme.colors.GREY_3}`};\n padding-bottom: ${({ $isLastCard }) => ($isLastCard ? '0' : '20px')};\n > div {\n margin-left: -8px;\n }\n`;\n"],"names":["SectionContainer","styled","FlexView","$shouldAddBorder","theme","SectionFooter","$isExpanded","TagContainer","Card","$isLastCard"],"mappings":";;AAIa,MAAAA,IAAmBC,EAAOC,CAAQ;AAAA,mBAC5B,CAAC,EAAE,kBAAAC,GAAkB,OAAAC,EAAM,MAC1CD,IAAmB,aAAaC,EAAM,OAAO,KAAK,KAAK,MAAM;AAAA;AAAA,GAIpDC,IAAgBJ,EAAOC,CAAQ;AAAA;AAAA,mBAEzB,CAAC,EAAE,aAAAI,QAAkBA,KAAe,MAAM;AAAA;AAAA;AAAA,GAKhDC,IAAeN,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAO9BM,IAAOP,EAAOC,CAAQ;AAAA,iBAClB,CAAC,EAAE,aAAAO,GAAa,OAAAL,EAAM,MACnCK,IAAc,SAAS,cAAcL,EAAM,OAAO,MAAM,EAAE;AAAA,oBAC1C,CAAC,EAAE,aAAAK,EAAA,MAAmBA,IAAc,MAAM,MAAO;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,117 +1,112 @@
1
- import { jsx as e, jsxs as m, Fragment as y } from "react/jsx-runtime";
2
- import { memo as T, useState as A, useMemo as L, useCallback as w } from "react";
1
+ import { jsx as e, jsxs as l, Fragment as A } from "react/jsx-runtime";
2
+ import { memo as L, useState as $, useMemo as S, useCallback as B } from "react";
3
3
  import D from "../../../../assets/line-icons/icons/plus.js";
4
- import S from "../../../ui/accordion-section/accordion-section.js";
5
- import s from "../../../ui/layout/flex-view.js";
6
- import k from "../../../../assets/line-icons/icons/minus.js";
7
- import B from "../../../ui/image/image.js";
8
- import $ from "../../../ui/text/text.js";
9
- import N from "../accordion-item/accordion-item.js";
10
- import { SectionContainer as V, TagContainer as X, SectionFooter as j, Card as M } from "./daily-timeline-items-styled.js";
11
- import { getTimelineCardIcon as K } from "../utils.js";
12
- import { useUIContext as P } from "../../../ui/context/context.js";
13
- import { TIMELINE_EVENTS as f } from "../constants.js";
14
- const F = T((I) => {
4
+ import k from "../../../ui/accordion-section/accordion-section.js";
5
+ import m from "../../../ui/layout/flex-view.js";
6
+ import N from "../../../../assets/line-icons/icons/minus.js";
7
+ import V from "../../../ui/image/image.js";
8
+ import I from "../../../ui/text/text.js";
9
+ import X from "../accordion-item/accordion-item.js";
10
+ import { SectionContainer as j, TagContainer as M, SectionFooter as K, Card as P } from "./daily-timeline-items-styled.js";
11
+ import { getTimelineCardIcon as F } from "../utils.js";
12
+ import { useUIContext as W } from "../../../ui/context/context.js";
13
+ import { TIMELINE_EVENTS as E } from "../constants.js";
14
+ const z = L((C) => {
15
15
  const {
16
- type: t,
16
+ type: o,
17
17
  summary: i,
18
- cards: r,
19
- onPuzzleClick: E,
20
- onReviewClick: C,
21
- courseStream: l,
22
- shouldShowTag: g,
23
- userType: _,
24
- isLastItem: d,
18
+ cards: n,
19
+ onPuzzleClick: g,
20
+ onReviewClick: _,
21
+ courseStream: d,
22
+ shouldShowTag: b,
23
+ userType: x,
24
+ isLastItem: r,
25
25
  fromDate: c,
26
26
  studentId: a
27
- } = I, [n, b] = A(!1), p = L(() => K(t), [t]), { onEvent: h } = P(), x = w(
28
- (o) => {
29
- b(o), h(
30
- o ? f.TIMELINE_VIEW_EXPANDED : f.TIMELINE_VIEW_COLLAPSED,
27
+ } = C, [h, T] = $(!1), [y, s] = $(r), u = S(() => F(o), [o]), { onEvent: p } = W(), w = B(
28
+ (t) => {
29
+ T(t), t ? s(!1) : r ? setTimeout(() => {
30
+ s(!0);
31
+ }, 220) : s(!1), p(
32
+ t ? E.TIMELINE_VIEW_EXPANDED : E.TIMELINE_VIEW_COLLAPSED,
31
33
  {
32
34
  timeline_date: c,
33
35
  student_id: a,
34
- timeline_section_type: t,
36
+ timeline_section_type: o,
35
37
  timeline_section_subject: i
36
38
  },
37
39
  { mixpanel: !0 }
38
40
  );
39
41
  },
40
- [c, h, a, t, i]
42
+ [c, p, a, o, i, r]
41
43
  );
42
44
  return /* @__PURE__ */ e(
43
- S,
45
+ k,
44
46
  {
45
- headerElement: /* @__PURE__ */ m(
46
- V,
47
- {
48
- $borderColor: "BLACK_1",
49
- $shouldAddBorder: d && !n,
50
- children: [
51
- g && l && /* @__PURE__ */ e(X, { $position: "absolute", $background: "BLACK_5", $gutter: 4, children: /* @__PURE__ */ e($, { $renderAs: "ab4-black", $color: "WHITE", children: l }) }),
52
- /* @__PURE__ */ m(
53
- s,
54
- {
55
- $flexDirection: "row",
56
- $alignItems: "center",
57
- $justifyContent: "space-between",
58
- $heightX: 4,
59
- $widthX: 30,
60
- $gutterX: 1,
61
- $gapX: 1.32,
62
- children: [
63
- /* @__PURE__ */ m(
64
- s,
65
- {
66
- $flexDirection: "row",
67
- $alignItems: "center",
68
- $justifyContent: "center",
69
- $flexGapX: 1.125,
70
- children: [
71
- /* @__PURE__ */ e(s, { children: p && /* @__PURE__ */ e(B, { src: p }) }),
72
- /* @__PURE__ */ e($, { $renderAs: "ab2", $color: "BLACK_1", children: i ?? "" })
73
- ]
74
- }
75
- ),
76
- n ? /* @__PURE__ */ e(k, { width: 20, height: 20 }) : /* @__PURE__ */ e(D, { width: 20, height: 20 })
77
- ]
78
- }
79
- )
80
- ]
81
- }
82
- ),
83
- bodyElement: r.length > 0 ? /* @__PURE__ */ e(
84
- j,
47
+ headerElement: /* @__PURE__ */ l(j, { $borderColor: "BLACK_1", $shouldAddBorder: y, children: [
48
+ b && d && /* @__PURE__ */ e(M, { $position: "absolute", $background: "BLACK_5", $gutter: 4, children: /* @__PURE__ */ e(I, { $renderAs: "ab4-black", $color: "WHITE", children: d }) }),
49
+ /* @__PURE__ */ l(
50
+ m,
51
+ {
52
+ $flexDirection: "row",
53
+ $alignItems: "center",
54
+ $justifyContent: "space-between",
55
+ $heightX: 4,
56
+ $widthX: 30,
57
+ $gutterX: 1,
58
+ $gapX: 1.32,
59
+ children: [
60
+ /* @__PURE__ */ l(
61
+ m,
62
+ {
63
+ $flexDirection: "row",
64
+ $alignItems: "center",
65
+ $justifyContent: "center",
66
+ $flexGapX: 1.125,
67
+ children: [
68
+ /* @__PURE__ */ e(m, { children: u && /* @__PURE__ */ e(V, { src: u }) }),
69
+ /* @__PURE__ */ e(I, { $renderAs: "ab2", $color: "BLACK_1", children: i ?? "" })
70
+ ]
71
+ }
72
+ ),
73
+ h ? /* @__PURE__ */ e(N, { width: 20, height: 20 }) : /* @__PURE__ */ e(D, { width: 20, height: 20 })
74
+ ]
75
+ }
76
+ )
77
+ ] }),
78
+ bodyElement: n.length > 0 ? /* @__PURE__ */ e(
79
+ K,
85
80
  {
86
81
  $gutter: 32,
87
82
  $borderColor: "BLACK_1",
88
- $isExpanded: n && !d,
89
- children: r.map((o, u) => /* @__PURE__ */ e(
90
- M,
83
+ $isExpanded: h && !r,
84
+ children: n.map((t, f) => /* @__PURE__ */ e(
85
+ P,
91
86
  {
92
- $isLastCard: u === r.length - 1,
87
+ $isLastCard: f === n.length - 1,
93
88
  children: /* @__PURE__ */ e(
94
- N,
89
+ X,
95
90
  {
96
- card: o,
97
- onPuzzleClick: E,
98
- onReviewClick: C,
99
- type: t,
100
- userType: _
91
+ card: t,
92
+ onPuzzleClick: g,
93
+ onReviewClick: _,
94
+ type: o,
95
+ userType: x
101
96
  }
102
97
  )
103
98
  },
104
- `${o.node_id}-${u}`
99
+ t.node_id ?? `card-${f}`
105
100
  ))
106
101
  }
107
- ) : /* @__PURE__ */ e(y, {}),
102
+ ) : /* @__PURE__ */ e(A, {}),
108
103
  defaultVisible: !1,
109
- onBodyVisibilityChange: x
104
+ onBodyVisibilityChange: w
110
105
  }
111
106
  );
112
107
  });
113
- F.displayName = "DailyTimelineItems";
108
+ z.displayName = "DailyTimelineItems";
114
109
  export {
115
- F as default
110
+ z as default
116
111
  };
117
112
  //# sourceMappingURL=daily-timeline-items.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-items.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, useState, type FC } from 'react';\n\nimport PlusIcon from '../../../../assets/line-icons/icons/plus';\nimport AccordionSection from '../../../ui/accordion-section/accordion-section';\nimport FlexView from '../../../ui/layout/flex-view';\nimport MinusIcon from '../../../../assets/line-icons/icons/minus';\nimport Image from '../../../ui/image/image';\nimport Text from '../../../ui/text/text';\nimport AccordionItem from '../accordion-item/accordion-item';\nimport * as Styled from './daily-timeline-items-styled';\nimport { getTimelineCardIcon } from '../utils';\nimport { type IDailyTimelineItemsProps } from './daily-timeline-items.types';\nimport { useUIContext } from '../../../ui/context/context';\nimport { TIMELINE_EVENTS } from '../constants';\n\nconst DailyTimelineItems: FC<IDailyTimelineItemsProps> = memo(props => {\n const {\n type,\n summary,\n cards,\n onPuzzleClick,\n onReviewClick,\n courseStream,\n shouldShowTag,\n userType,\n isLastItem,\n fromDate,\n studentId,\n } = props;\n const [isExpended, setIsExpended] = useState(false);\n\n const timelineIcon = useMemo(() => getTimelineCardIcon(type), [type]);\n const { onEvent: trackEvent } = useUIContext();\n\n const handleExpand = useCallback(\n (val: boolean) => {\n setIsExpended(val);\n\n trackEvent(\n val ? TIMELINE_EVENTS.TIMELINE_VIEW_EXPANDED : TIMELINE_EVENTS.TIMELINE_VIEW_COLLAPSED,\n {\n timeline_date: fromDate,\n student_id: studentId,\n timeline_section_type: type,\n timeline_section_subject: summary,\n },\n { mixpanel: true },\n );\n },\n [fromDate, trackEvent, studentId, type, summary],\n );\n\n return (\n <AccordionSection\n headerElement={\n <Styled.SectionContainer\n $borderColor=\"BLACK_1\"\n $shouldAddBorder={isLastItem && !isExpended}\n >\n {shouldShowTag && courseStream && (\n <Styled.TagContainer $position=\"absolute\" $background=\"BLACK_5\" $gutter={4}>\n <Text $renderAs=\"ab4-black\" $color=\"WHITE\">\n {courseStream}\n </Text>\n </Styled.TagContainer>\n )}\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $heightX={4}\n $widthX={30}\n $gutterX={1}\n $gapX={1.32}\n >\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $flexGapX={1.125}\n >\n <FlexView>{timelineIcon && <Image src={timelineIcon} />}</FlexView>\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\">\n {summary ?? ''}\n </Text>\n </FlexView>\n {isExpended ? (\n <MinusIcon width={20} height={20} />\n ) : (\n <PlusIcon width={20} height={20} />\n )}\n </FlexView>\n </Styled.SectionContainer>\n }\n bodyElement={\n cards.length > 0 ? (\n <Styled.SectionFooter\n $gutter={32}\n $borderColor={'BLACK_1'}\n $isExpanded={isExpended && !isLastItem}\n >\n {cards.map((card, index) => (\n <Styled.Card\n key={`${card.node_id}-${index}`}\n $isLastCard={index === cards.length - 1}\n >\n <AccordionItem\n card={card}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n type={type}\n userType={userType}\n />\n </Styled.Card>\n ))}\n </Styled.SectionFooter>\n ) : (\n <></>\n )\n }\n defaultVisible={false}\n onBodyVisibilityChange={handleExpand}\n />\n );\n});\n\nDailyTimelineItems.displayName = 'DailyTimelineItems';\n\nexport default DailyTimelineItems;\n"],"names":["DailyTimelineItems","memo","props","type","summary","cards","onPuzzleClick","onReviewClick","courseStream","shouldShowTag","userType","isLastItem","fromDate","studentId","isExpended","setIsExpended","useState","timelineIcon","useMemo","getTimelineCardIcon","trackEvent","useUIContext","handleExpand","useCallback","val","TIMELINE_EVENTS","jsx","AccordionSection","jsxs","Styled.SectionContainer","Styled.TagContainer","Text","FlexView","Image","MinusIcon","PlusIcon","Styled.SectionFooter","card","index","Styled.Card","AccordionItem","Fragment"],"mappings":";;;;;;;;;;;;;AAeM,MAAAA,IAAmDC,EAAK,CAASC,MAAA;AAC/D,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAX,GACE,CAACY,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAE5CC,IAAeC,EAAQ,MAAMC,EAAoBhB,CAAI,GAAG,CAACA,CAAI,CAAC,GAC9D,EAAE,SAASiB,EAAW,IAAIC,EAAa,GAEvCC,IAAeC;AAAA,IACnB,CAACC,MAAiB;AAChB,MAAAT,EAAcS,CAAG,GAEjBJ;AAAA,QACEI,IAAM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,IAAI,QAAQ,IAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YAErC;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,MAEF,aACE9B,EAAM,SAAS,IACb,gBAAAqB;AAAA,QAACU;AAAAA,QAAA;AAAA,UACC,SAAS;AAAA,UACT,cAAc;AAAA,UACd,aAAatB,KAAc,CAACH;AAAA,UAE3B,UAAMN,EAAA,IAAI,CAACgC,GAAMC,MAChB,gBAAAZ;AAAA,YAACa;AAAAA,YAAA;AAAA,cAEC,aAAaD,MAAUjC,EAAM,SAAS;AAAA,cAEtC,UAAA,gBAAAqB;AAAA,gBAACc;AAAA,gBAAA;AAAA,kBACC,MAAAH;AAAA,kBACA,eAAA/B;AAAA,kBACA,eAAAC;AAAA,kBACA,MAAAJ;AAAA,kBACA,UAAAO;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,YATK,GAAG2B,EAAK,OAAO,IAAIC,CAAK;AAAA,UAAA,CAWhC;AAAA,QAAA;AAAA,MAAA,IAGD,gBAAAZ,EAAAe,GAAA,EAAA;AAAA,MAGN,gBAAgB;AAAA,MAChB,wBAAwBnB;AAAA,IAAA;AAAA,EAAA;AAG9B,CAAC;AAEDtB,EAAmB,cAAc;"}
1
+ {"version":3,"file":"daily-timeline-items.js","sources":["../../../../../src/features/timeline/comps/daily-timeline-items/daily-timeline-items.tsx"],"sourcesContent":["import { memo, useCallback, useMemo, useState, type FC } from 'react';\n\nimport PlusIcon from '../../../../assets/line-icons/icons/plus';\nimport AccordionSection from '../../../ui/accordion-section/accordion-section';\nimport FlexView from '../../../ui/layout/flex-view';\nimport MinusIcon from '../../../../assets/line-icons/icons/minus';\nimport Image from '../../../ui/image/image';\nimport Text from '../../../ui/text/text';\nimport AccordionItem from '../accordion-item/accordion-item';\nimport * as Styled from './daily-timeline-items-styled';\nimport { getTimelineCardIcon } from '../utils';\nimport { type IDailyTimelineItemsProps } from './daily-timeline-items.types';\nimport { useUIContext } from '../../../ui/context/context';\nimport { TIMELINE_EVENTS } from '../constants';\n\nconst DailyTimelineItems: FC<IDailyTimelineItemsProps> = memo(props => {\n const {\n type,\n summary,\n cards,\n onPuzzleClick,\n onReviewClick,\n courseStream,\n shouldShowTag,\n userType,\n isLastItem,\n fromDate,\n studentId,\n } = props;\n const [isExpended, setIsExpended] = useState(false);\n const [shouldShowBorder, setShouldShowBorder] = useState(isLastItem);\n\n const timelineIcon = useMemo(() => getTimelineCardIcon(type), [type]);\n const { onEvent: trackEvent } = useUIContext();\n\n const handleExpand = useCallback(\n (val: boolean) => {\n setIsExpended(val);\n\n if (val) {\n setShouldShowBorder(false);\n } else {\n if (isLastItem) {\n setTimeout(() => {\n setShouldShowBorder(true);\n }, 220);\n } else {\n setShouldShowBorder(false);\n }\n }\n\n trackEvent(\n val ? TIMELINE_EVENTS.TIMELINE_VIEW_EXPANDED : TIMELINE_EVENTS.TIMELINE_VIEW_COLLAPSED,\n {\n timeline_date: fromDate,\n student_id: studentId,\n timeline_section_type: type,\n timeline_section_subject: summary,\n },\n { mixpanel: true },\n );\n },\n [fromDate, trackEvent, studentId, type, summary, isLastItem],\n );\n\n return (\n <AccordionSection\n headerElement={\n <Styled.SectionContainer $borderColor=\"BLACK_1\" $shouldAddBorder={shouldShowBorder}>\n {shouldShowTag && courseStream && (\n <Styled.TagContainer $position=\"absolute\" $background=\"BLACK_5\" $gutter={4}>\n <Text $renderAs=\"ab4-black\" $color=\"WHITE\">\n {courseStream}\n </Text>\n </Styled.TagContainer>\n )}\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $heightX={4}\n $widthX={30}\n $gutterX={1}\n $gapX={1.32}\n >\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $flexGapX={1.125}\n >\n <FlexView>{timelineIcon && <Image src={timelineIcon} />}</FlexView>\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\">\n {summary ?? ''}\n </Text>\n </FlexView>\n {isExpended ? (\n <MinusIcon width={20} height={20} />\n ) : (\n <PlusIcon width={20} height={20} />\n )}\n </FlexView>\n </Styled.SectionContainer>\n }\n bodyElement={\n cards.length > 0 ? (\n <Styled.SectionFooter\n $gutter={32}\n $borderColor={'BLACK_1'}\n $isExpanded={isExpended && !isLastItem}\n >\n {cards.map((card, index) => (\n <Styled.Card\n key={card.node_id ?? `card-${index}`}\n $isLastCard={index === cards.length - 1}\n >\n <AccordionItem\n card={card}\n onPuzzleClick={onPuzzleClick}\n onReviewClick={onReviewClick}\n type={type}\n userType={userType}\n />\n </Styled.Card>\n ))}\n </Styled.SectionFooter>\n ) : (\n <></>\n )\n }\n defaultVisible={false}\n onBodyVisibilityChange={handleExpand}\n />\n );\n});\n\nDailyTimelineItems.displayName = 'DailyTimelineItems';\n\nexport default DailyTimelineItems;\n"],"names":["DailyTimelineItems","memo","props","type","summary","cards","onPuzzleClick","onReviewClick","courseStream","shouldShowTag","userType","isLastItem","fromDate","studentId","isExpended","setIsExpended","useState","shouldShowBorder","setShouldShowBorder","timelineIcon","useMemo","getTimelineCardIcon","trackEvent","useUIContext","handleExpand","useCallback","val","TIMELINE_EVENTS","jsx","AccordionSection","Styled.SectionContainer","Styled.TagContainer","Text","jsxs","FlexView","Image","MinusIcon","PlusIcon","Styled.SectionFooter","card","index","Styled.Card","AccordionItem","Fragment"],"mappings":";;;;;;;;;;;;;AAeM,MAAAA,IAAmDC,EAAK,CAASC,MAAA;AAC/D,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAX,GACE,CAACY,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5C,CAACC,GAAkBC,CAAmB,IAAIF,EAASL,CAAU,GAE7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AAA,KAAKhB,EAAc,CAAA,GAAG;AAAA,sCACvDa,GAAK,EAAA,WAAU,OAAM,QAAO,WAC1B,eAAW,IACd;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,cACClB,IACC,gBAAAc,EAACQ,GAAU,EAAA,OAAO,IAAI,QAAQ,GAAI,CAAA,IAEjC,gBAAAR,EAAAS,GAAA,EAAS,OAAO,IAAI,QAAQ,IAAI;AAAA,YAAA;AAAA,UAAA;AAAA,QAErC;AAAA,MAAA,GACF;AAAA,MAEF,aACEhC,EAAM,SAAS,IACb,gBAAAuB;AAAA,QAACU;AAAAA,QAAA;AAAA,UACC,SAAS;AAAA,UACT,cAAc;AAAA,UACd,aAAaxB,KAAc,CAACH;AAAA,UAE3B,UAAMN,EAAA,IAAI,CAACkC,GAAMC,MAChB,gBAAAZ;AAAA,YAACa;AAAAA,YAAA;AAAA,cAEC,aAAaD,MAAUnC,EAAM,SAAS;AAAA,cAEtC,UAAA,gBAAAuB;AAAA,gBAACc;AAAA,gBAAA;AAAA,kBACC,MAAAH;AAAA,kBACA,eAAAjC;AAAA,kBACA,eAAAC;AAAA,kBACA,MAAAJ;AAAA,kBACA,UAAAO;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,YATK6B,EAAK,WAAW,QAAQC,CAAK;AAAA,UAAA,CAWrC;AAAA,QAAA;AAAA,MAAA,IAGD,gBAAAZ,EAAAe,GAAA,EAAA;AAAA,MAGN,gBAAgB;AAAA,MAChB,wBAAwBnB;AAAA,IAAA;AAAA,EAAA;AAG9B,CAAC;AAEDxB,EAAmB,cAAc;"}
@@ -1,18 +1,21 @@
1
- import o from "styled-components";
2
- import t from "../ui/layout/flex-view.js";
3
- const l = o(t)`
1
+ import i from "styled-components";
2
+ import o from "../ui/layout/flex-view.js";
3
+ const r = i(o)`
4
4
  overflow-y: auto;
5
5
  width: 100%;
6
- `, m = o(t)`
6
+ scroll-behavior: smooth;
7
+ will-change: height;
8
+ `, h = i(o)`
7
9
  max-width: 512px;
8
10
  width: 100%;
9
- `, n = o(t)`
10
- margin-top: ${({ $addedMonthBreak: i }) => i ? "-108px" : "0"};
11
+ will-change: height;
12
+ `, a = i(o)`
13
+ margin-top: ${({ $addedMonthBreak: t }) => t ? "-108px" : "0"};
11
14
  z-index: 1;
12
15
  `;
13
16
  export {
14
- n as DailyItems,
15
- m as DailyTimelineContainer,
16
- l as ScrollWrapper
17
+ a as DailyItems,
18
+ h as DailyTimelineContainer,
19
+ r as ScrollWrapper
17
20
  };
18
21
  //# sourceMappingURL=daily-timeline-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daily-timeline-styled.js","sources":["../../../src/features/timeline/daily-timeline-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../ui/layout/flex-view';\n\nconst ScrollWrapper = styled(FlexView)`\n overflow-y: auto;\n width: 100%;\n`;\n\nconst DailyTimelineContainer = styled(FlexView)`\n max-width: 512px;\n width: 100%;\n`;\n\nconst DailyItems = styled(FlexView)<{ $addedMonthBreak?: boolean }>`\n margin-top: ${({ $addedMonthBreak }) =>\n $addedMonthBreak\n ? '-108px' // 64px card height + 16px(separator) + 16(date text) + 12(separator)\n : '0'};\n z-index: 1;\n`;\n\nexport { DailyTimelineContainer, DailyItems, ScrollWrapper };\n"],"names":["ScrollWrapper","styled","FlexView","DailyTimelineContainer","DailyItems","$addedMonthBreak"],"mappings":";;AAIM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAK/BC,IAAyBF,EAAOC,CAAQ;AAAA;AAAA;AAAA,GAKxCE,IAAaH,EAAOC,CAAQ;AAAA,gBAClB,CAAC,EAAE,kBAAAG,EAAA,MACfA,IACI,WACA,GAAG;AAAA;AAAA;"}
1
+ {"version":3,"file":"daily-timeline-styled.js","sources":["../../../src/features/timeline/daily-timeline-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../ui/layout/flex-view';\n\nconst ScrollWrapper = styled(FlexView)`\n overflow-y: auto;\n width: 100%;\n scroll-behavior: smooth;\n will-change: height;\n`;\n\nconst DailyTimelineContainer = styled(FlexView)`\n max-width: 512px;\n width: 100%;\n will-change: height;\n`;\n\nconst DailyItems = styled(FlexView)<{ $addedMonthBreak?: boolean }>`\n margin-top: ${({ $addedMonthBreak }) =>\n $addedMonthBreak\n ? '-108px' // 64px card height + 16px(separator) + 16(date text) + 12(separator)\n : '0'};\n z-index: 1;\n`;\n\nexport { DailyTimelineContainer, DailyItems, ScrollWrapper };\n"],"names":["ScrollWrapper","styled","FlexView","DailyTimelineContainer","DailyItems","$addedMonthBreak"],"mappings":";;AAIM,MAAAA,IAAgBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAO/BC,IAAyBF,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAMxCE,IAAaH,EAAOC,CAAQ;AAAA,gBAClB,CAAC,EAAE,kBAAAG,EAAA,MACfA,IACI,WACA,GAAG;AAAA;AAAA;"}
@@ -1,23 +1,26 @@
1
- import o from "styled-components";
2
- const r = o.div(({ $width: e }) => `
1
+ import e from "styled-components";
2
+ const r = e.div(({ $width: o }) => `
3
3
  position: relative;
4
4
  display: flex;
5
5
  flex-direction: Column;
6
- width: ${e ?? "auto"}${typeof e == "number" ? "px" : ""};
7
- `), i = o.div(() => `
6
+ width: ${o ?? "auto"}${typeof o == "number" ? "px" : ""};
7
+ contain: layout style;
8
+ `), i = e.div(() => `
8
9
  cursor: pointer;
9
10
  -webkit-user-select: none;
10
11
  -ms-user-select: none;
11
12
  user-select: none;
12
13
  overflow: hidden;
13
- `), c = o.div(({ $visible: e, $overflow: n }) => `
14
+ contain: layout style;
15
+ `), c = e.div(({ $visible: o, $overflow: t }) => `
14
16
  position: relative;
15
- max-height: ${e ? "1000vh" : 0};
16
- overflow: ${n ?? "hidden"};
17
+ max-height: ${o ? "1000vh" : 0};
18
+ overflow: ${t ?? "hidden"};
17
19
  transform-origin: top;
18
- transform: ${e ? "scaleY(1)" : "scaleY(0)"};
19
- opacity: ${e ? 1 : 0};
20
+ transform: ${o ? "scaleY(1)" : "scaleY(0)"};
21
+ opacity: ${o ? 1 : 0};
20
22
  transition: all 0.2s ease-in-out;
23
+ will-change: transform, opacity, max-height;
21
24
  `);
22
25
  export {
23
26
  c as AccordionSectionBody,
@@ -1 +1 @@
1
- {"version":3,"file":"accordion-section-styled.js","sources":["../../../../src/features/ui/accordion-section/accordion-section-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport type { TStyleAttrubutes } from './accordion-section-types';\n\ninterface IAccordionSectionContainerProps {\n $width?: string | number;\n}\n\nconst AccordionSectionContainer = styled.div<IAccordionSectionContainerProps>(({ $width }) => {\n return `\n position: relative;\n display: flex;\n flex-direction: Column;\n width: ${$width ?? 'auto'}${typeof $width === 'number' ? 'px' : ''};\n `;\n});\n\nconst AccordionSectionHeader = styled.div(() => {\n return `\n cursor: pointer;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n `;\n});\n\ninterface IAccordionSectionBodyProps {\n $visible?: boolean;\n $overflow?: TStyleAttrubutes['overflow'];\n}\n\nconst AccordionSectionBody = styled.div<IAccordionSectionBodyProps>(({ $visible, $overflow }) => {\n return `\n position: relative;\n max-height: ${$visible ? '1000vh' : 0};\n overflow: ${$overflow ?? 'hidden'};\n transform-origin: top;\n transform: ${$visible ? 'scaleY(1)' : 'scaleY(0)'};\n opacity: ${$visible ? 1 : 0};\n transition: all 0.2s ease-in-out;\n `;\n});\n\nexport { AccordionSectionContainer, AccordionSectionBody, AccordionSectionHeader };\n"],"names":["AccordionSectionContainer","styled","$width","AccordionSectionHeader","AccordionSectionBody","$visible","$overflow"],"mappings":";AAQA,MAAMA,IAA4BC,EAAO,IAAqC,CAAC,EAAE,QAAAC,QACxE;AAAA;AAAA;AAAA;AAAA,aAIIA,KAAU,MAAM,GAAG,OAAOA,KAAW,WAAW,OAAO,EAAE;AAAA,KAErE,GAEKC,IAAyBF,EAAO,IAAI,MACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOR,GAOKG,IAAuBH,EAAO,IAAgC,CAAC,EAAE,UAAAI,GAAU,WAAAC,QACxE;AAAA;AAAA,kBAESD,IAAW,WAAW,CAAC;AAAA,gBACzBC,KAAa,QAAQ;AAAA;AAAA,iBAEpBD,IAAW,cAAc,WAAW;AAAA,eACtCA,IAAW,IAAI,CAAC;AAAA;AAAA,GAG9B;"}
1
+ {"version":3,"file":"accordion-section-styled.js","sources":["../../../../src/features/ui/accordion-section/accordion-section-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport type { TStyleAttrubutes } from './accordion-section-types';\n\ninterface IAccordionSectionContainerProps {\n $width?: string | number;\n}\n\nconst AccordionSectionContainer = styled.div<IAccordionSectionContainerProps>(({ $width }) => {\n return `\n position: relative;\n display: flex;\n flex-direction: Column;\n width: ${$width ?? 'auto'}${typeof $width === 'number' ? 'px' : ''};\n contain: layout style;\n `;\n});\n\nconst AccordionSectionHeader = styled.div(() => {\n return `\n cursor: pointer;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n contain: layout style;\n `;\n});\n\ninterface IAccordionSectionBodyProps {\n $visible?: boolean;\n $overflow?: TStyleAttrubutes['overflow'];\n}\n\nconst AccordionSectionBody = styled.div<IAccordionSectionBodyProps>(({ $visible, $overflow }) => {\n return `\n position: relative;\n max-height: ${$visible ? '1000vh' : 0};\n overflow: ${$overflow ?? 'hidden'};\n transform-origin: top;\n transform: ${$visible ? 'scaleY(1)' : 'scaleY(0)'};\n opacity: ${$visible ? 1 : 0};\n transition: all 0.2s ease-in-out;\n will-change: transform, opacity, max-height;\n `;\n});\n\nexport { AccordionSectionContainer, AccordionSectionBody, AccordionSectionHeader };\n"],"names":["AccordionSectionContainer","styled","$width","AccordionSectionHeader","AccordionSectionBody","$visible","$overflow"],"mappings":";AAQA,MAAMA,IAA4BC,EAAO,IAAqC,CAAC,EAAE,QAAAC,QACxE;AAAA;AAAA;AAAA;AAAA,aAIIA,KAAU,MAAM,GAAG,OAAOA,KAAW,WAAW,OAAO,EAAE;AAAA;AAAA,KAGrE,GAEKC,IAAyBF,EAAO,IAAI,MACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQR,GAOKG,IAAuBH,EAAO,IAAgC,CAAC,EAAE,UAAAI,GAAU,WAAAC,QACxE;AAAA;AAAA,kBAESD,IAAW,WAAW,CAAC;AAAA,gBACzBC,KAAa,QAAQ;AAAA;AAAA,iBAEpBD,IAAW,cAAc,WAAW;AAAA,eACtCA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA,GAI9B;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.5.11-as2",
3
+ "version": "3.5.11-as3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"