@cuemath/leap 3.0.8 → 3.0.9

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.
Files changed (26) hide show
  1. package/dist/features/analytics-events/platform-events-student.js +2 -2
  2. package/dist/features/analytics-events/platform-events-student.js.map +1 -1
  3. package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +4 -3
  4. package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js.map +1 -1
  5. package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js +42 -26
  6. package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js.map +1 -1
  7. package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +39 -39
  8. package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +1 -1
  9. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js +12 -10
  10. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode/table-mode.js.map +1 -1
  11. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js +29 -28
  12. package/dist/features/circle-games/game-launcher/comps/tables-card/table-mode-star/table-mode-star.js.map +1 -1
  13. package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js +36 -33
  14. package/dist/features/circle-games/game-launcher/comps/tables-card/table-segment-star/table-segment-star.js.map +1 -1
  15. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js +29 -25
  16. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card-styled.js.map +1 -1
  17. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js +121 -122
  18. package/dist/features/circle-games/game-launcher/comps/tables-card/tables-card.js.map +1 -1
  19. package/dist/features/circle-games/leaderboard/comps/banner/banner.js +6 -8
  20. package/dist/features/circle-games/leaderboard/comps/banner/banner.js.map +1 -1
  21. package/dist/features/ui/error/error.js +1 -1
  22. package/dist/features/ui/error/error.js.map +1 -1
  23. package/dist/features/ui/lottie-animation/lottie-animation.js +53 -54
  24. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  25. package/dist/index.d.ts +1 -0
  26. package/package.json +1 -1
@@ -1,74 +1,73 @@
1
1
  import { jsx as E } from "react/jsx-runtime";
2
2
  import g from "lottie-web";
3
- import { memo as y, forwardRef as b, useRef as m, useMemo as A, useImperativeHandle as I, useEffect as $ } from "react";
4
- import x from "../layout/flex-view.js";
5
- import { fetchLottie as O } from "./helper.js";
6
- const S = b((v, L) => {
3
+ import { memo as w, forwardRef as A, useRef as u, useImperativeHandle as b, useEffect as I } from "react";
4
+ import $ from "../layout/flex-view.js";
5
+ import { fetchLottie as x } from "./helper.js";
6
+ const O = A((v, L) => {
7
7
  const {
8
- src: l,
8
+ src: m,
9
9
  width: h = "100%",
10
- height: w = "100%",
11
- settings: o,
12
- eventListener: i,
13
- onRender: c,
14
- animateOnIntersect: s
15
- } = v, a = m(null), e = m(null), u = m(null), f = A(
16
- () => ({
17
- ...o,
18
- renderer: window.ReactNativeWebView ? "svg" : (o == null ? void 0 : o.renderer) ?? "svg"
19
- }),
20
- [o]
21
- );
22
- return I(
10
+ height: y = "100%",
11
+ settings: l,
12
+ eventListener: n,
13
+ onRender: o,
14
+ animateOnIntersect: c
15
+ } = v, a = u(null), r = u(null), s = u(null);
16
+ return b(
23
17
  L,
24
18
  () => ({
25
- playSegments: (t, r) => {
26
- var n;
27
- return (n = e.current) == null ? void 0 : n.playSegments(t, r);
19
+ playSegments: (t, i) => {
20
+ var e;
21
+ return (e = r.current) == null ? void 0 : e.playSegments(t, i);
28
22
  },
29
- addEventListener: (t, r) => {
30
- var n;
31
- return (n = e.current) == null ? void 0 : n.addEventListener(t, r);
23
+ addEventListener: (t, i) => {
24
+ var e;
25
+ return (e = r.current) == null ? void 0 : e.addEventListener(t, i);
32
26
  },
33
- removeEventListener: (t, r) => {
34
- var n;
35
- return (n = e.current) == null ? void 0 : n.removeEventListener(t, r);
27
+ removeEventListener: (t, i) => {
28
+ var e;
29
+ return (e = r.current) == null ? void 0 : e.removeEventListener(t, i);
36
30
  },
37
31
  play: () => {
38
32
  var t;
39
- return (t = e.current) == null ? void 0 : t.play();
33
+ return (t = r.current) == null ? void 0 : t.play();
40
34
  },
41
35
  stop: () => {
42
36
  var t;
43
- return (t = e.current) == null ? void 0 : t.stop();
37
+ return (t = r.current) == null ? void 0 : t.stop();
44
38
  }
45
39
  }),
46
40
  []
47
- ), $(() => ((async () => {
48
- try {
49
- const r = await O(l);
50
- a.current && (e.current = g.loadAnimation({
51
- container: a.current,
52
- animationData: r,
53
- loop: !0,
54
- autoplay: !0,
55
- ...f
56
- }), s && (u.current = new IntersectionObserver(
57
- ([n]) => {
58
- var d, p;
59
- n && n.isIntersecting ? (d = e.current) == null || d.play() : (p = e.current) == null || p.pause();
60
- },
61
- { threshold: 0 }
62
- ), a.current && u.current.observe(a.current)), c == null || c(), i && e.current.addEventListener(i.name, i.callback));
63
- } catch (r) {
64
- throw Error(`Error loading Lottie animation: ${r}`);
65
- }
66
- })(), () => {
67
- var r;
68
- e.current && (i && e.current.removeEventListener(i.name, i.callback), s && ((r = u.current) == null || r.disconnect()), e.current.destroy());
69
- }), [l, i, c, s, f]), /* @__PURE__ */ E(x, { ref: a, $width: h, $height: w });
70
- }), F = y(S);
41
+ ), I(() => {
42
+ let t = !1;
43
+ return (async () => {
44
+ try {
45
+ const e = await x(m);
46
+ requestAnimationFrame(() => {
47
+ !a.current || t || (r.current = g.loadAnimation({
48
+ container: a.current,
49
+ animationData: e,
50
+ loop: !0,
51
+ autoplay: !0,
52
+ ...l
53
+ }), c && (s.current = new IntersectionObserver(
54
+ ([f]) => {
55
+ var d, p;
56
+ f && f.isIntersecting ? (d = r.current) == null || d.play() : (p = r.current) == null || p.pause();
57
+ },
58
+ { threshold: 0 }
59
+ ), s.current.observe(a.current)), o == null || o(), n && r.current.addEventListener(n.name, n.callback));
60
+ });
61
+ } catch (e) {
62
+ throw Error(`Error loading Lottie animation: ${e}`);
63
+ }
64
+ })(), () => {
65
+ var e;
66
+ t = !0, r.current && (n && r.current.removeEventListener(n.name, n.callback), c && ((e = s.current) == null || e.disconnect()), r.current.destroy());
67
+ };
68
+ }, [m, n, o, c, l]), /* @__PURE__ */ E($, { ref: a, $width: h, $height: y });
69
+ }), D = w(O);
71
70
  export {
72
- F as default
71
+ D as default
73
72
  };
74
73
  //# sourceMappingURL=lottie-animation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationEventName, AnimationItem, AnimationSegment, RendererType } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n animateOnIntersect,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n const newSettings = useMemo(\n () => ({\n ...settings,\n renderer: (window.ReactNativeWebView ? 'svg' : settings?.renderer ?? 'svg') as RendererType,\n }),\n [settings],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment, forceFlag?: boolean) =>\n animationInstance.current?.playSegments(segments, forceFlag),\n addEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.addEventListener(eventName as AnimationEventName, callback),\n removeEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.removeEventListener(eventName as AnimationEventName, callback),\n play: () => animationInstance.current?.play(),\n stop: () => animationInstance.current?.stop(),\n }),\n [],\n );\n\n useEffect(() => {\n const loadAnimation = async () => {\n try {\n const animationData = await fetchLottie(src);\n\n if (container.current) {\n animationInstance.current = lottie.loadAnimation({\n container: container.current,\n animationData,\n loop: true,\n autoplay: true,\n ...newSettings,\n });\n\n if (animateOnIntersect) {\n intersectionObserver.current = new IntersectionObserver(\n ([entry]) => {\n if (entry && entry.isIntersecting) {\n animationInstance.current?.play();\n } else {\n animationInstance.current?.pause();\n }\n },\n { threshold: 0 },\n );\n\n if (container.current) {\n intersectionObserver.current.observe(container.current);\n }\n }\n\n onRender?.();\n if (eventListener) {\n animationInstance.current.addEventListener(eventListener.name, eventListener.callback);\n }\n }\n } catch (error) {\n throw Error(`Error loading Lottie animation: ${error}`);\n }\n };\n\n loadAnimation();\n\n return () => {\n if (animationInstance.current) {\n if (eventListener) {\n animationInstance.current.removeEventListener(eventListener.name, eventListener.callback);\n }\n\n if (animateOnIntersect) {\n intersectionObserver.current?.disconnect();\n }\n animationInstance.current.destroy();\n }\n };\n }, [src, eventListener, onRender, animateOnIntersect, newSettings]);\n\n return <FlexView ref={container} $width={width} $height={height} />;\n});\n\nexport default memo(LottieAnimation);\n"],"names":["LottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListener","onRender","animateOnIntersect","container","useRef","animationInstance","intersectionObserver","newSettings","useMemo","useImperativeHandle","segments","forceFlag","_a","eventName","callback","useEffect","animationData","fetchLottie","lottie","entry","_b","error","FlexView","LottieAnimation$1","memo"],"mappings":";;;;;AASA,MAAMA,IAAkBC,EAAuD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,EACE,IAAAR,GAEES,IAAYC,EAAuB,IAAI,GACvCC,IAAoBD,EAA6B,IAAI,GACrDE,IAAuBF,EAAoC,IAAI,GAC/DG,IAAcC;AAAA,IAClB,OAAO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ACSG,EAAA,QAAQ,QAAQH,EAAU,OAAO,IAI/CF,KAAA,QAAAA,KACPD,KACFK,EAAkB,QAAQ,iBAAiBL,EAAc,MAAMA,EAAc,QAAQ;AAAA,aAGlFqB,GAAO;AACR,YAAA,MAAM,mCAAmCA,CAAK,EAAE;AAAA,IACxD;AAAA,EAAA,MAKK,MAAM;;AACX,IAAIhB,EAAkB,YAChBL,KACFK,EAAkB,QAAQ,oBAAoBL,EAAc,MAAMA,EAAc,QAAQ,GAGtFE,OACFU,IAAAN,EAAqB,YAArB,QAAAM,EAA8B,eAEhCP,EAAkB,QAAQ;EAC5B,IAED,CAACT,GAAKI,GAAeC,GAAUC,GAAoBK,CAAW,CAAC,qBAE1De,GAAS,EAAA,KAAKnB,GAAW,QAAQN,GAAO,SAASC,EAAQ,CAAA;AACnE,CAAC,GAEcyB,IAAAC,EAAKhC,CAAe;"}
1
+ {"version":3,"file":"lottie-animation.js","sources":["../../../../src/features/ui/lottie-animation/lottie-animation.tsx"],"sourcesContent":["import type { ILottieAnimationProps, ILottieAnimationRef } from './types';\nimport type { AnimationEventName, AnimationItem, AnimationSegment } from 'lottie-web';\n\nimport lottie from 'lottie-web';\nimport { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport FlexView from '../layout/flex-view';\nimport { fetchLottie } from './helper';\n\nconst LottieAnimation = forwardRef<ILottieAnimationRef, ILottieAnimationProps>((props, ref) => {\n const {\n src,\n width = '100%',\n height = '100%',\n settings,\n eventListener,\n onRender,\n animateOnIntersect,\n } = props;\n\n const container = useRef<HTMLDivElement>(null);\n const animationInstance = useRef<AnimationItem | null>(null);\n const intersectionObserver = useRef<IntersectionObserver | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n playSegments: (segments: AnimationSegment, forceFlag?: boolean) =>\n animationInstance.current?.playSegments(segments, forceFlag),\n addEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.addEventListener(eventName as AnimationEventName, callback),\n removeEventListener: (eventName: string, callback: () => void) =>\n animationInstance.current?.removeEventListener(eventName as AnimationEventName, callback),\n play: () => animationInstance.current?.play(),\n stop: () => animationInstance.current?.stop(),\n }),\n [],\n );\n\n useEffect(() => {\n let destroyed = false;\n\n const loadAnimation = async () => {\n try {\n const animationData = await fetchLottie(src);\n\n // Wait for layout\n // NOTE: Do not remove this as this is needed to fix canvas rendering on first layout.\n requestAnimationFrame(() => {\n if (!container.current || destroyed) return;\n\n animationInstance.current = lottie.loadAnimation({\n container: container.current,\n animationData,\n loop: true,\n autoplay: true,\n ...settings,\n });\n\n if (animateOnIntersect) {\n intersectionObserver.current = new IntersectionObserver(\n ([entry]) => {\n if (entry && entry.isIntersecting) {\n animationInstance.current?.play();\n } else {\n animationInstance.current?.pause();\n }\n },\n { threshold: 0 },\n );\n\n intersectionObserver.current.observe(container.current);\n }\n\n onRender?.();\n if (eventListener) {\n animationInstance.current.addEventListener(eventListener.name, eventListener.callback);\n }\n });\n } catch (error) {\n throw Error(`Error loading Lottie animation: ${error}`);\n }\n };\n\n loadAnimation();\n\n return () => {\n destroyed = true;\n if (animationInstance.current) {\n if (eventListener) {\n animationInstance.current.removeEventListener(eventListener.name, eventListener.callback);\n }\n\n if (animateOnIntersect) {\n intersectionObserver.current?.disconnect();\n }\n animationInstance.current.destroy();\n }\n };\n }, [src, eventListener, onRender, animateOnIntersect, settings]);\n\n return <FlexView ref={container} $width={width} $height={height} />;\n});\n\nexport default memo(LottieAnimation);\n"],"names":["LottieAnimation","forwardRef","props","ref","src","width","height","settings","eventListener","onRender","animateOnIntersect","container","useRef","animationInstance","intersectionObserver","useImperativeHandle","segments","forceFlag","_a","eventName","callback","useEffect","destroyed","animationData","fetchLottie","lottie","entry","_b","error","FlexView","LottieAnimation$1","memo"],"mappings":";;;;;AASA,MAAMA,IAAkBC,EAAuD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,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,EAAkB,YAAlB,QAAAc,EAA2B;AAAA,YAE/B;AAAA,YACA,EAAE,WAAW,EAAE;AAAA,UAAA,GAGIb,EAAA,QAAQ,QAAQH,EAAU,OAAO,IAG7CF,KAAA,QAAAA,KACPD,KACFK,EAAkB,QAAQ,iBAAiBL,EAAc,MAAMA,EAAc,QAAQ;AAAA,QACvF,CACD;AAAA,eACMoB,GAAO;AACR,cAAA,MAAM,mCAAmCA,CAAK,EAAE;AAAA,MACxD;AAAA,IAAA,MAKK,MAAM;;AACC,MAAAN,IAAA,IACRT,EAAkB,YAChBL,KACFK,EAAkB,QAAQ,oBAAoBL,EAAc,MAAMA,EAAc,QAAQ,GAGtFE,OACFQ,IAAAJ,EAAqB,YAArB,QAAAI,EAA8B,eAEhCL,EAAkB,QAAQ;IAC5B;AAAA,EACF,GACC,CAACT,GAAKI,GAAeC,GAAUC,GAAoBH,CAAQ,CAAC,qBAEvDsB,GAAS,EAAA,KAAKlB,GAAW,QAAQN,GAAO,SAASC,EAAQ,CAAA;AACnE,CAAC,GAEcwB,IAAAC,EAAK/B,CAAe;"}
package/dist/index.d.ts CHANGED
@@ -3979,6 +3979,7 @@ export declare enum PLATFORM_EVENTS_STUDENT {
3979
3979
  PAGE_VIEWED = "page_viewed",
3980
3980
  CUSTOM_TEST_SUBMITTED = "custom_test_submitted",
3981
3981
  HOMEWORK_COMPLETED = "homework_completed",
3982
+ ERROR_VIA_AUTO_LOGIN_FROM_CUEMATH_APP = "error_via_auto_login_from_cuemath_app",
3982
3983
  ACTIVITY_STARTED = "activity_started",
3983
3984
  ACTIVITY_TUTORIAL_SEEN = "activity_tutorial_seen",
3984
3985
  STREAK_ICON_CLICKED = "streak_icon_clicked",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.0.8",
3
+ "version": "3.0.9",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"