@cuemath/leap 3.0.2 → 3.0.4-rj-0

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 (30) hide show
  1. package/dist/features/circle-games/{leaderboard/comps → comps}/info-bar/info-bar-styled.js +1 -1
  2. package/dist/features/circle-games/comps/info-bar/info-bar-styled.js.map +1 -0
  3. package/dist/features/circle-games/comps/info-bar/info-bar.js.map +1 -0
  4. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +107 -100
  5. package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +1 -1
  6. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +96 -93
  7. package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +1 -1
  8. package/dist/features/circle-games/games/tutorial/tutorial-styled.js +0 -1
  9. package/dist/features/circle-games/games/tutorial/tutorial-styled.js.map +1 -1
  10. package/dist/features/circle-games/games/tutorial/tutorial.js +38 -33
  11. package/dist/features/circle-games/games/tutorial/tutorial.js.map +1 -1
  12. package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js +1 -1
  13. package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js.map +1 -1
  14. package/dist/features/journey/comps/coachmark/coachmark.js +20 -19
  15. package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
  16. package/dist/features/journey/use-journey/constants.js +2 -4
  17. package/dist/features/journey/use-journey/constants.js.map +1 -1
  18. package/dist/features/journey/use-journey/journey-styled.js +5 -6
  19. package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
  20. package/dist/features/ui/constants/z-index.js +2 -1
  21. package/dist/features/ui/constants/z-index.js.map +1 -1
  22. package/dist/features/ui/theme/device.js +5 -0
  23. package/dist/features/ui/theme/device.js.map +1 -0
  24. package/dist/features/ui/theme/get-theme.js +21 -19
  25. package/dist/features/ui/theme/get-theme.js.map +1 -1
  26. package/dist/index.d.ts +8 -1
  27. package/package.json +1 -1
  28. package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js.map +0 -1
  29. package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js.map +0 -1
  30. /package/dist/features/circle-games/{leaderboard/comps → comps}/info-bar/info-bar.js +0 -0
@@ -1,21 +1,22 @@
1
- import { jsx as e, jsxs as g, Fragment as f } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as f, Fragment as T } from "react/jsx-runtime";
2
2
  import { useMemo as d } from "react";
3
- import m from "../../../ui/arrow-tooltip/arrow-tooltip.js";
4
- import b from "../../../ui/nudge/nudge.js";
5
- import { BLUR_OVERLAY_Z_INDEX as T, IndicatorType as p } from "../../use-journey/constants.js";
6
- import { CoachmarkBody as w, ClonedElementWrapper as s } from "./coachmark-styled.js";
7
- import { toolTipGetXCoordinates as y } from "./coachmark-utils.js";
8
- const H = ({ coachmark: t }) => {
9
- const i = t.originalElementToHighlightRef.current, { top: r = 0, left: n = 0, height: h = 0, width: C = 0 } = (i == null ? void 0 : i.getBoundingClientRect()) || {}, l = d(() => () => i ? window.getComputedStyle(i).position === "absolute" : !1, [i]), u = d(() => {
3
+ import h from "../../../ui/arrow-tooltip/arrow-tooltip.js";
4
+ import y from "../../../ui/nudge/nudge.js";
5
+ import { getTheme as O } from "../../../ui/theme/get-theme.js";
6
+ import { IndicatorType as p } from "../../use-journey/constants.js";
7
+ import { CoachmarkBody as P, ClonedElementWrapper as u } from "./coachmark-styled.js";
8
+ import { toolTipGetXCoordinates as $ } from "./coachmark-utils.js";
9
+ const Y = ({ coachmark: t }) => {
10
+ const i = t.originalElementToHighlightRef.current, { top: r = 0, left: n = 0, height: C = 0, width: b = 0 } = (i == null ? void 0 : i.getBoundingClientRect()) || {}, { zIndex: I, device: c } = O(), m = c === "mobile", s = I.JOURNEY_OVERLAY, l = d(() => () => i ? window.getComputedStyle(i).position === "absolute" : !1, [i]), g = d(() => {
10
11
  const o = t.indicator;
11
12
  return {
12
- width: 264,
13
+ width: m ? 246 : 264,
13
14
  // Can be over ridden
14
- tooltipXCoOrdinates: y(o.position) + (o.tooltipXCoOrdinates ?? 0),
15
+ tooltipXCoOrdinates: $(o.position) + (o.tooltipXCoOrdinates ?? 0),
15
16
  // For absolutely positioned elements
16
- zIndex: T + 1,
17
+ zIndex: s + 1,
17
18
  ...o,
18
- tooltipItem: /* @__PURE__ */ e(w, { children: o.tooltipItem }),
19
+ tooltipItem: /* @__PURE__ */ e(P, { children: o.tooltipItem }),
19
20
  alwaysVisible: !0,
20
21
  renderAs: "primary",
21
22
  // Deprecate this
@@ -25,7 +26,7 @@ const H = ({ coachmark: t }) => {
25
26
  type: p.TOOLTIP,
26
27
  isAnimated: !0
27
28
  };
28
- }, [t.indicator]), I = d(() => {
29
+ }, [s, t.indicator, m]), w = d(() => {
29
30
  const o = t.indicator;
30
31
  return {
31
32
  ...o,
@@ -33,12 +34,12 @@ const H = ({ coachmark: t }) => {
33
34
  nudgePointerY: r + (o.nudgePointerY ?? 0)
34
35
  };
35
36
  }, [t.indicator, n, r]);
36
- return !i || !t.isActive ? null : t.type === p.TOOLTIP ? l() ? /* @__PURE__ */ g(f, { children: [
37
+ return !i || !t.isActive ? null : t.type === p.TOOLTIP ? l() ? /* @__PURE__ */ f(T, { children: [
37
38
  t.elementToHighlight,
38
- /* @__PURE__ */ e(s, { $position: "absolute", $top: r, $left: n, children: /* @__PURE__ */ e(m, { ...u, children: /* @__PURE__ */ e("div", { style: { height: h, width: C } }) }) })
39
- ] }) : /* @__PURE__ */ e(s, { $position: "absolute", $top: r, $left: n, children: /* @__PURE__ */ e(m, { ...u, children: t.elementToHighlight }) }) : t.type === p.NUDGE ? /* @__PURE__ */ g(f, { children: [
39
+ /* @__PURE__ */ e(u, { $position: "absolute", $top: r, $left: n, children: /* @__PURE__ */ e(h, { ...g, children: /* @__PURE__ */ e("div", { style: { height: C, width: b } }) }) })
40
+ ] }) : /* @__PURE__ */ e(u, { $position: "absolute", $top: r, $left: n, children: /* @__PURE__ */ e(h, { ...g, children: t.elementToHighlight }) }) : t.type === p.NUDGE ? /* @__PURE__ */ f(T, { children: [
40
41
  /* @__PURE__ */ e(
41
- s,
42
+ u,
42
43
  {
43
44
  $top: l() ? 0 : r,
44
45
  $left: l() ? 0 : n,
@@ -46,10 +47,10 @@ const H = ({ coachmark: t }) => {
46
47
  children: t.elementToHighlight
47
48
  }
48
49
  ),
49
- /* @__PURE__ */ e(b, { zIndex: T + 1, ...I })
50
+ /* @__PURE__ */ e(y, { zIndex: s + 1, ...w })
50
51
  ] }) : null;
51
52
  };
52
53
  export {
53
- H as Coachmark
54
+ Y as Coachmark
54
55
  };
55
56
  //# sourceMappingURL=coachmark.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"coachmark.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport React, { useMemo } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Nudge from '../../../ui/nudge/nudge';\nimport { BLUR_OVERLAY_Z_INDEX, IndicatorType } from '../../use-journey/constants';\nimport * as S from './coachmark-styled';\nimport { toolTipGetXCoordinates } from './coachmark-utils';\n\nexport const Coachmark: React.FC<{ coachmark: ICoachmarkProps }> = ({ coachmark }) => {\n const targetElement = coachmark.originalElementToHighlightRef.current;\n const { top = 0, left = 0, height = 0, width = 0 } = targetElement?.getBoundingClientRect() || {};\n\n const isAbsolute = useMemo(() => {\n return () => {\n if (!targetElement) return false;\n\n return window.getComputedStyle(targetElement).position === 'absolute';\n };\n }, [targetElement]);\n\n const tooltipProps = useMemo(() => {\n const arrowToolTipProps = coachmark.indicator as IArrowTooltipProps;\n\n return {\n width: 264, // Can be over ridden\n tooltipXCoOrdinates:\n toolTipGetXCoordinates(arrowToolTipProps.position) +\n (arrowToolTipProps.tooltipXCoOrdinates ?? 0), // For absolutely positioned elements\n zIndex: BLUR_OVERLAY_Z_INDEX + 1,\n ...arrowToolTipProps,\n tooltipItem: <S.CoachmarkBody>{arrowToolTipProps.tooltipItem}</S.CoachmarkBody>,\n alwaysVisible: true,\n renderAs: 'primary', // Deprecate this\n borderWidth: 1,\n arrowColor: arrowToolTipProps.arrowColor || 'WHITE',\n borderColor: arrowToolTipProps.borderColor || 'WHITE',\n type: IndicatorType.TOOLTIP,\n isAnimated: true,\n } as IArrowTooltipProps;\n }, [coachmark.indicator]);\n\n const nudgeProps = useMemo(() => {\n const props: INudgeProps = coachmark.indicator as INudgeProps;\n\n return {\n ...props,\n nudgePointerX: left + (props.nudgePointerX ?? 0),\n nudgePointerY: top + (props.nudgePointerY ?? 0),\n };\n }, [coachmark.indicator, left, top]);\n\n if (!targetElement || !coachmark.isActive) {\n return null;\n }\n\n if (coachmark.type === IndicatorType.TOOLTIP) {\n if (isAbsolute()) {\n return (\n <>\n {coachmark.elementToHighlight}\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>\n <div style={{ height, width }} />\n </ArrowTooltip>\n </S.ClonedElementWrapper>\n </>\n );\n }\n\n return (\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>{coachmark.elementToHighlight}</ArrowTooltip>\n </S.ClonedElementWrapper>\n );\n }\n\n if (coachmark.type === IndicatorType.NUDGE) {\n return (\n <>\n <S.ClonedElementWrapper\n $top={isAbsolute() ? 0 : top}\n $left={isAbsolute() ? 0 : left}\n $position={isAbsolute() ? 'relative' : 'absolute'}\n >\n {coachmark.elementToHighlight}\n </S.ClonedElementWrapper>\n <Nudge zIndex={BLUR_OVERLAY_Z_INDEX + 1} {...nudgeProps} />\n </>\n );\n }\n\n return null;\n};\n"],"names":["Coachmark","coachmark","targetElement","top","left","height","width","isAbsolute","useMemo","tooltipProps","arrowToolTipProps","toolTipGetXCoordinates","BLUR_OVERLAY_Z_INDEX","jsx","S.CoachmarkBody","IndicatorType","nudgeProps","props","jsxs","Fragment","S.ClonedElementWrapper","ArrowTooltip","Nudge"],"mappings":";;;;;;;AAYO,MAAMA,IAAsD,CAAC,EAAE,WAAAC,QAAgB;AAC9E,QAAAC,IAAgBD,EAAU,8BAA8B,SACxD,EAAE,KAAAE,IAAM,GAAG,MAAAC,IAAO,GAAG,QAAAC,IAAS,GAAG,OAAAC,IAAQ,EAAE,KAAIJ,KAAA,gBAAAA,EAAe,4BAA2B,CAAA,GAEzFK,IAAaC,EAAQ,MAClB,MACAN,IAEE,OAAO,iBAAiBA,CAAa,EAAE,aAAa,aAFhC,IAI5B,CAACA,CAAa,CAAC,GAEZO,IAAeD,EAAQ,MAAM;AACjC,UAAME,IAAoBT,EAAU;AAE7B,WAAA;AAAA,MACL,OAAO;AAAA;AAAA,MACP,qBACEU,EAAuBD,EAAkB,QAAQ,KAChDA,EAAkB,uBAAuB;AAAA;AAAA,MAC5C,QAAQE,IAAuB;AAAA,MAC/B,GAAGF;AAAA,MACH,aAAc,gBAAAG,EAAAC,GAAA,EAAiB,YAAkB,aAAY;AAAA,MAC7D,eAAe;AAAA,MACf,UAAU;AAAA;AAAA,MACV,aAAa;AAAA,MACb,YAAYJ,EAAkB,cAAc;AAAA,MAC5C,aAAaA,EAAkB,eAAe;AAAA,MAC9C,MAAMK,EAAc;AAAA,MACpB,YAAY;AAAA,IAAA;AAAA,EACd,GACC,CAACd,EAAU,SAAS,CAAC,GAElBe,IAAaR,EAAQ,MAAM;AAC/B,UAAMS,IAAqBhB,EAAU;AAE9B,WAAA;AAAA,MACL,GAAGgB;AAAA,MACH,eAAeb,KAAQa,EAAM,iBAAiB;AAAA,MAC9C,eAAed,KAAOc,EAAM,iBAAiB;AAAA,IAAA;AAAA,KAE9C,CAAChB,EAAU,WAAWG,GAAMD,CAAG,CAAC;AAEnC,SAAI,CAACD,KAAiB,CAACD,EAAU,WACxB,OAGLA,EAAU,SAASc,EAAc,UAC/BR,MAGG,gBAAAW,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAUlB,EAAA;AAAA,IACX,gBAAAY,EAACO,GAAA,EAAuB,WAAU,YAAW,MAAMjB,GAAK,OAAOC,GAC7D,UAAA,gBAAAS,EAACQ,KAAc,GAAGZ,GAChB,4BAAC,OAAI,EAAA,OAAO,EAAE,QAAAJ,GAAQ,OAAAC,EAAA,GAAS,EAAA,CACjC,EACF,CAAA;AAAA,EACF,EAAA,CAAA,sBAKDc,GAAA,EAAuB,WAAU,YAAW,MAAMjB,GAAK,OAAOC,GAC7D,4BAACiB,GAAc,EAAA,GAAGZ,GAAe,UAAAR,EAAU,oBAAmB,EAChE,CAAA,IAIAA,EAAU,SAASc,EAAc,QAG/B,gBAAAG,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAN;AAAA,MAACO;AAAAA,MAAA;AAAA,QACC,MAAMb,MAAe,IAAIJ;AAAA,QACzB,OAAOI,MAAe,IAAIH;AAAA,QAC1B,WAAWG,MAAe,aAAa;AAAA,QAEtC,UAAUN,EAAA;AAAA,MAAA;AAAA,IACb;AAAA,sBACCqB,GAAM,EAAA,QAAQV,IAAuB,GAAI,GAAGI,GAAY;AAAA,EAC3D,EAAA,CAAA,IAIG;AACT;"}
1
+ {"version":3,"file":"coachmark.js","sources":["../../../../../src/features/journey/comps/coachmark/coachmark.tsx"],"sourcesContent":["import type { IArrowTooltipProps } from '../../../ui/arrow-tooltip/arrow-tooltip-types';\nimport type { INudgeProps } from '../../../ui/nudge/nudge-types';\nimport type { ICoachmarkProps } from '../../use-journey/journey-context-types';\n\nimport React, { useMemo } from 'react';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport Nudge from '../../../ui/nudge/nudge';\nimport { getTheme } from '../../../ui/theme/get-theme';\nimport { IndicatorType } from '../../use-journey/constants';\nimport * as S from './coachmark-styled';\nimport { toolTipGetXCoordinates } from './coachmark-utils';\n\nexport const Coachmark: React.FC<{ coachmark: ICoachmarkProps }> = ({ coachmark }) => {\n const targetElement = coachmark.originalElementToHighlightRef.current;\n const { top = 0, left = 0, height = 0, width = 0 } = targetElement?.getBoundingClientRect() || {};\n\n const { zIndex, device } = getTheme();\n const isMobile = device === 'mobile';\n\n const BLUR_OVERLAY_Z_INDEX = zIndex.JOURNEY_OVERLAY;\n\n const isAbsolute = useMemo(() => {\n return () => {\n if (!targetElement) return false;\n\n return window.getComputedStyle(targetElement).position === 'absolute';\n };\n }, [targetElement]);\n\n const tooltipProps = useMemo(() => {\n const arrowToolTipProps = coachmark.indicator as IArrowTooltipProps;\n\n return {\n width: isMobile ? 246 : 264, // Can be over ridden\n tooltipXCoOrdinates:\n toolTipGetXCoordinates(arrowToolTipProps.position) +\n (arrowToolTipProps.tooltipXCoOrdinates ?? 0), // For absolutely positioned elements\n zIndex: BLUR_OVERLAY_Z_INDEX + 1,\n ...arrowToolTipProps,\n tooltipItem: <S.CoachmarkBody>{arrowToolTipProps.tooltipItem}</S.CoachmarkBody>,\n alwaysVisible: true,\n renderAs: 'primary', // Deprecate this\n borderWidth: 1,\n arrowColor: arrowToolTipProps.arrowColor || 'WHITE',\n borderColor: arrowToolTipProps.borderColor || 'WHITE',\n type: IndicatorType.TOOLTIP,\n isAnimated: true,\n } as IArrowTooltipProps;\n }, [BLUR_OVERLAY_Z_INDEX, coachmark.indicator, isMobile]);\n\n const nudgeProps = useMemo(() => {\n const props: INudgeProps = coachmark.indicator as INudgeProps;\n\n return {\n ...props,\n nudgePointerX: left + (props.nudgePointerX ?? 0),\n nudgePointerY: top + (props.nudgePointerY ?? 0),\n };\n }, [coachmark.indicator, left, top]);\n\n if (!targetElement || !coachmark.isActive) {\n return null;\n }\n\n if (coachmark.type === IndicatorType.TOOLTIP) {\n if (isAbsolute()) {\n return (\n <>\n {coachmark.elementToHighlight}\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>\n <div style={{ height, width }} />\n </ArrowTooltip>\n </S.ClonedElementWrapper>\n </>\n );\n }\n\n return (\n <S.ClonedElementWrapper $position=\"absolute\" $top={top} $left={left}>\n <ArrowTooltip {...tooltipProps}>{coachmark.elementToHighlight}</ArrowTooltip>\n </S.ClonedElementWrapper>\n );\n }\n\n if (coachmark.type === IndicatorType.NUDGE) {\n return (\n <>\n <S.ClonedElementWrapper\n $top={isAbsolute() ? 0 : top}\n $left={isAbsolute() ? 0 : left}\n $position={isAbsolute() ? 'relative' : 'absolute'}\n >\n {coachmark.elementToHighlight}\n </S.ClonedElementWrapper>\n <Nudge zIndex={BLUR_OVERLAY_Z_INDEX + 1} {...nudgeProps} />\n </>\n );\n }\n\n return null;\n};\n"],"names":["Coachmark","coachmark","targetElement","top","left","height","width","zIndex","device","getTheme","isMobile","BLUR_OVERLAY_Z_INDEX","isAbsolute","useMemo","tooltipProps","arrowToolTipProps","toolTipGetXCoordinates","jsx","S.CoachmarkBody","IndicatorType","nudgeProps","props","jsxs","Fragment","S.ClonedElementWrapper","ArrowTooltip","Nudge"],"mappings":";;;;;;;;AAaO,MAAMA,IAAsD,CAAC,EAAE,WAAAC,QAAgB;AAC9E,QAAAC,IAAgBD,EAAU,8BAA8B,SACxD,EAAE,KAAAE,IAAM,GAAG,MAAAC,IAAO,GAAG,QAAAC,IAAS,GAAG,OAAAC,IAAQ,EAAE,KAAIJ,KAAA,gBAAAA,EAAe,4BAA2B,CAAA,GAEzF,EAAE,QAAAK,GAAQ,QAAAC,EAAO,IAAIC,EAAS,GAC9BC,IAAWF,MAAW,UAEtBG,IAAuBJ,EAAO,iBAE9BK,IAAaC,EAAQ,MAClB,MACAX,IAEE,OAAO,iBAAiBA,CAAa,EAAE,aAAa,aAFhC,IAI5B,CAACA,CAAa,CAAC,GAEZY,IAAeD,EAAQ,MAAM;AACjC,UAAME,IAAoBd,EAAU;AAE7B,WAAA;AAAA,MACL,OAAOS,IAAW,MAAM;AAAA;AAAA,MACxB,qBACEM,EAAuBD,EAAkB,QAAQ,KAChDA,EAAkB,uBAAuB;AAAA;AAAA,MAC5C,QAAQJ,IAAuB;AAAA,MAC/B,GAAGI;AAAA,MACH,aAAc,gBAAAE,EAAAC,GAAA,EAAiB,YAAkB,aAAY;AAAA,MAC7D,eAAe;AAAA,MACf,UAAU;AAAA;AAAA,MACV,aAAa;AAAA,MACb,YAAYH,EAAkB,cAAc;AAAA,MAC5C,aAAaA,EAAkB,eAAe;AAAA,MAC9C,MAAMI,EAAc;AAAA,MACpB,YAAY;AAAA,IAAA;AAAA,KAEb,CAACR,GAAsBV,EAAU,WAAWS,CAAQ,CAAC,GAElDU,IAAaP,EAAQ,MAAM;AAC/B,UAAMQ,IAAqBpB,EAAU;AAE9B,WAAA;AAAA,MACL,GAAGoB;AAAA,MACH,eAAejB,KAAQiB,EAAM,iBAAiB;AAAA,MAC9C,eAAelB,KAAOkB,EAAM,iBAAiB;AAAA,IAAA;AAAA,KAE9C,CAACpB,EAAU,WAAWG,GAAMD,CAAG,CAAC;AAEnC,SAAI,CAACD,KAAiB,CAACD,EAAU,WACxB,OAGLA,EAAU,SAASkB,EAAc,UAC/BP,MAGG,gBAAAU,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAUtB,EAAA;AAAA,IACX,gBAAAgB,EAACO,GAAA,EAAuB,WAAU,YAAW,MAAMrB,GAAK,OAAOC,GAC7D,UAAA,gBAAAa,EAACQ,KAAc,GAAGX,GAChB,4BAAC,OAAI,EAAA,OAAO,EAAE,QAAAT,GAAQ,OAAAC,EAAA,GAAS,EAAA,CACjC,EACF,CAAA;AAAA,EACF,EAAA,CAAA,sBAKDkB,GAAA,EAAuB,WAAU,YAAW,MAAMrB,GAAK,OAAOC,GAC7D,4BAACqB,GAAc,EAAA,GAAGX,GAAe,UAAAb,EAAU,oBAAmB,EAChE,CAAA,IAIAA,EAAU,SAASkB,EAAc,QAG/B,gBAAAG,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAN;AAAA,MAACO;AAAAA,MAAA;AAAA,QACC,MAAMZ,MAAe,IAAIT;AAAA,QACzB,OAAOS,MAAe,IAAIR;AAAA,QAC1B,WAAWQ,MAAe,aAAa;AAAA,QAEtC,UAAUX,EAAA;AAAA,MAAA;AAAA,IACb;AAAA,sBACCyB,GAAM,EAAA,QAAQf,IAAuB,GAAI,GAAGS,GAAY;AAAA,EAC3D,EAAA,CAAA,IAIG;AACT;"}
@@ -1,7 +1,5 @@
1
- var e = /* @__PURE__ */ ((t) => (t.TOOLTIP = "tooltip", t.NUDGE = "nudge", t))(e || {});
2
- const o = 1e3;
1
+ var t = /* @__PURE__ */ ((r) => (r.TOOLTIP = "tooltip", r.NUDGE = "nudge", r))(t || {});
3
2
  export {
4
- o as BLUR_OVERLAY_Z_INDEX,
5
- e as IndicatorType
3
+ t as IndicatorType
6
4
  };
7
5
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/features/journey/use-journey/constants.ts"],"sourcesContent":["export enum IndicatorType {\n TOOLTIP = 'tooltip',\n NUDGE = 'nudge',\n}\nexport const BLUR_OVERLAY_Z_INDEX = 1000;\n"],"names":["IndicatorType","BLUR_OVERLAY_Z_INDEX"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA;AAIL,MAAMC,IAAuB;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/features/journey/use-journey/constants.ts"],"sourcesContent":["export enum IndicatorType {\n TOOLTIP = 'tooltip',\n NUDGE = 'nudge',\n}\n"],"names":["IndicatorType"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,19 +1,18 @@
1
- import t, { css as i } from "styled-components";
2
- import { BLUR_OVERLAY_Z_INDEX as e } from "./constants.js";
3
- const b = t.div`
1
+ import t, { css as e } from "styled-components";
2
+ const d = t.div`
4
3
  position: fixed;
5
4
  top: 0;
6
5
  right: 0;
7
6
  bottom: 0;
8
7
  left: 0;
9
- z-index: ${e};
10
- ${({ isJourneyBlurred: o, theme: r }) => o && i`
8
+ z-index: ${({ theme: o }) => o.zIndex.JOURNEY_OVERLAY};
9
+ ${({ isJourneyBlurred: o, theme: r }) => o && e`
11
10
  background: ${r.colors.BLACK_T_38};
12
11
  backdrop-filter: blur(80px);
13
12
  -webkit-backdrop-filter: blur(80px);
14
13
  `}
15
14
  `;
16
15
  export {
17
- b as Overlay
16
+ d as Overlay
18
17
  };
19
18
  //# sourceMappingURL=journey-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"journey-styled.js","sources":["../../../../src/features/journey/use-journey/journey-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { css } from 'styled-components';\n\nimport { BLUR_OVERLAY_Z_INDEX } from './constants';\n\nexport const Overlay = styled.div<{ isJourneyBlurred: boolean }>`\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: ${BLUR_OVERLAY_Z_INDEX};\n ${({ isJourneyBlurred, theme }) =>\n isJourneyBlurred &&\n css`\n background: ${theme.colors.BLACK_T_38};\n backdrop-filter: blur(80px);\n -webkit-backdrop-filter: blur(80px);\n `}\n`;\n``;\n"],"names":["Overlay","styled","BLUR_OVERLAY_Z_INDEX","isJourneyBlurred","theme","css"],"mappings":";;AAKO,MAAMA,IAAUC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMjBC,CAAoB;AAAA,IAC7B,CAAC,EAAE,kBAAAC,GAAkB,OAAAC,EAAA,MACrBD,KACAE;AAAA,oBACgBD,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,KAGtC;AAAA;"}
1
+ {"version":3,"file":"journey-styled.js","sources":["../../../../src/features/journey/use-journey/journey-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { css } from 'styled-components';\n\nexport const Overlay = styled.div<{ isJourneyBlurred: boolean }>`\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: ${({ theme }) => theme.zIndex.JOURNEY_OVERLAY};\n ${({ isJourneyBlurred, theme }) =>\n isJourneyBlurred &&\n css`\n background: ${theme.colors.BLACK_T_38};\n backdrop-filter: blur(80px);\n -webkit-backdrop-filter: blur(80px);\n `}\n`;\n``;\n"],"names":["Overlay","styled","theme","isJourneyBlurred","css"],"mappings":";AAGO,MAAMA,IAAUC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMjB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,eAAe;AAAA,IACpD,CAAC,EAAE,kBAAAC,GAAkB,OAAAD,EAAA,MACrBC,KACAC;AAAA,oBACgBF,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,KAGtC;AAAA;"}
@@ -13,7 +13,8 @@ const _ = {
13
13
  //whiteboard
14
14
  QUESTION_TIPS: -1,
15
15
  DESMOS_CALCULATOR: 2,
16
- GOAL_CHAPTER_SHEETS_MENU: 4
16
+ GOAL_CHAPTER_SHEETS_MENU: 4,
17
+ JOURNEY_OVERLAY: 1e3
17
18
  };
18
19
  export {
19
20
  _ as ZINDEX
@@ -1 +1 @@
1
- {"version":3,"file":"z-index.js","sources":["../../../../src/features/ui/constants/z-index.ts"],"sourcesContent":["const ZINDEX = {\n CHAPTER_CROWN_ICON: 4,\n CHAPTER_PLUS_ICON: 2,\n CHAPTER_PROGRESS_SVG: 2,\n LPAR_SHEET_ITEM_BOTTOM_DASH_BOX: 1,\n LPAR_SHEET_ITEM_TOP_VERTICAL_ICON: 2,\n MODAL: 20,\n SAT_SUMMARY_SCORE: 25, //* SAT_SUMMARY_SCORE > MODAL\n CANVAS_SCRIBBLING: 26, //* CANVAS_SCRIBBLING > Learnosity\n TILE_CONTAINER: 30, //whiteboard\n QUESTION_TIPS: -1,\n DESMOS_CALCULATOR: 2,\n GOAL_CHAPTER_SHEETS_MENU: 4,\n} as const;\n\nexport { ZINDEX };\n"],"names":["ZINDEX"],"mappings":"AAAA,MAAMA,IAAS;AAAA,EACb,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,iCAAiC;AAAA,EACjC,mCAAmC;AAAA,EACnC,OAAO;AAAA,EACP,mBAAmB;AAAA;AAAA,EACnB,mBAAmB;AAAA;AAAA,EACnB,gBAAgB;AAAA;AAAA,EAChB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,0BAA0B;AAC5B;"}
1
+ {"version":3,"file":"z-index.js","sources":["../../../../src/features/ui/constants/z-index.ts"],"sourcesContent":["const ZINDEX = {\n CHAPTER_CROWN_ICON: 4,\n CHAPTER_PLUS_ICON: 2,\n CHAPTER_PROGRESS_SVG: 2,\n LPAR_SHEET_ITEM_BOTTOM_DASH_BOX: 1,\n LPAR_SHEET_ITEM_TOP_VERTICAL_ICON: 2,\n MODAL: 20,\n SAT_SUMMARY_SCORE: 25, //* SAT_SUMMARY_SCORE > MODAL\n CANVAS_SCRIBBLING: 26, //* CANVAS_SCRIBBLING > Learnosity\n TILE_CONTAINER: 30, //whiteboard\n QUESTION_TIPS: -1,\n DESMOS_CALCULATOR: 2,\n GOAL_CHAPTER_SHEETS_MENU: 4,\n JOURNEY_OVERLAY: 1000,\n} as const;\n\nexport { ZINDEX };\n"],"names":["ZINDEX"],"mappings":"AAAA,MAAMA,IAAS;AAAA,EACb,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,iCAAiC;AAAA,EACjC,mCAAmC;AAAA,EACnC,OAAO;AAAA,EACP,mBAAmB;AAAA;AAAA,EACnB,mBAAmB;AAAA;AAAA,EACnB,gBAAgB;AAAA;AAAA,EAChB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,0BAA0B;AAAA,EAC1B,iBAAiB;AACnB;"}
@@ -0,0 +1,5 @@
1
+ const n = () => window.innerWidth <= 600 ? "mobile" : "desktop";
2
+ export {
3
+ n as getDeviceConfig
4
+ };
5
+ //# sourceMappingURL=device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.js","sources":["../../../../src/features/ui/theme/device.ts"],"sourcesContent":["import type { TSupportedDevices } from '../types';\n\nexport const getDeviceConfig = (): TSupportedDevices => {\n const MOBILE_WIDTH = 600;\n\n return window.innerWidth <= MOBILE_WIDTH ? 'mobile' : 'desktop';\n};\n"],"names":["getDeviceConfig"],"mappings":"AAEO,MAAMA,IAAkB,MAGtB,OAAO,cAAc,MAAe,WAAW;"}
@@ -1,30 +1,32 @@
1
1
  import r from "./arrow-tooltip.js";
2
2
  import e from "./button.js";
3
- import m from "./checkbox.js";
4
- import g, { hues as i } from "./clrs.js";
5
- import n from "./input.js";
6
- import f from "./layout.js";
7
- import p from "./tab.js";
8
- import u from "./text.js";
9
- import x from "./text-button.js";
10
- import { getZIndexConfig as C } from "./z-index.js";
11
- const d = () => {
12
- const t = f(), { gutter: o } = t;
3
+ import i from "./checkbox.js";
4
+ import m, { hues as g } from "./clrs.js";
5
+ import { getDeviceConfig as n } from "./device.js";
6
+ import f from "./input.js";
7
+ import p from "./layout.js";
8
+ import u from "./tab.js";
9
+ import C from "./text.js";
10
+ import c from "./text-button.js";
11
+ import { getZIndexConfig as x } from "./z-index.js";
12
+ const v = () => {
13
+ const t = p(), { gutter: o } = t;
13
14
  return {
14
15
  arrowTooltip: r(),
15
16
  button: e(o),
16
- colors: g(),
17
- hues: i,
18
- input: n(o),
19
- checkbox: m(o),
17
+ colors: m(),
18
+ hues: g,
19
+ input: f(o),
20
+ checkbox: i(o),
20
21
  layout: t,
21
- tab: p(t.gutter),
22
- text: u(),
23
- textButton: x(),
24
- zIndex: C()
22
+ tab: u(t.gutter),
23
+ text: C(),
24
+ textButton: c(),
25
+ zIndex: x(),
26
+ device: n()
25
27
  };
26
28
  };
27
29
  export {
28
- d as getTheme
30
+ v as getTheme
29
31
  };
30
32
  //# sourceMappingURL=get-theme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-theme.js","sources":["../../../../src/features/ui/theme/get-theme.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components';\n\nimport getArrowTooltipConfig from './arrow-tooltip';\nimport getButtonConfig from './button';\nimport getCheckboxConfig from './checkbox';\nimport getColors, { hues } from './clrs';\nimport getInputConfig from './input';\nimport getLayout from './layout';\nimport getTabConfig from './tab';\nimport getTextTypes from './text';\nimport getTextButtonConfig from './text-button';\nimport { getZIndexConfig } from './z-index';\n\nconst getTheme: () => DefaultTheme = () => {\n const layout = getLayout();\n const { gutter } = layout;\n\n return {\n arrowTooltip: getArrowTooltipConfig(),\n button: getButtonConfig(gutter),\n colors: getColors(),\n hues: hues,\n input: getInputConfig(gutter),\n checkbox: getCheckboxConfig(gutter),\n layout,\n tab: getTabConfig(layout.gutter),\n text: getTextTypes(),\n textButton: getTextButtonConfig(),\n zIndex: getZIndexConfig(),\n };\n};\n\nexport { getTheme };\n"],"names":["getTheme","layout","getLayout","gutter","getArrowTooltipConfig","getButtonConfig","getColors","hues","getInputConfig","getCheckboxConfig","getTabConfig","getTextTypes","getTextButtonConfig","getZIndexConfig"],"mappings":";;;;;;;;;;AAaA,MAAMA,IAA+B,MAAM;AACzC,QAAMC,IAASC,KACT,EAAE,QAAAC,EAAW,IAAAF;AAEZ,SAAA;AAAA,IACL,cAAcG,EAAsB;AAAA,IACpC,QAAQC,EAAgBF,CAAM;AAAA,IAC9B,QAAQG,EAAU;AAAA,IAClB,MAAAC;AAAA,IACA,OAAOC,EAAeL,CAAM;AAAA,IAC5B,UAAUM,EAAkBN,CAAM;AAAA,IAClC,QAAAF;AAAA,IACA,KAAKS,EAAaT,EAAO,MAAM;AAAA,IAC/B,MAAMU,EAAa;AAAA,IACnB,YAAYC,EAAoB;AAAA,IAChC,QAAQC,EAAgB;AAAA,EAAA;AAE5B;"}
1
+ {"version":3,"file":"get-theme.js","sources":["../../../../src/features/ui/theme/get-theme.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components';\n\nimport getArrowTooltipConfig from './arrow-tooltip';\nimport getButtonConfig from './button';\nimport getCheckboxConfig from './checkbox';\nimport getColors, { hues } from './clrs';\nimport { getDeviceConfig } from './device';\nimport getInputConfig from './input';\nimport getLayout from './layout';\nimport getTabConfig from './tab';\nimport getTextTypes from './text';\nimport getTextButtonConfig from './text-button';\nimport { getZIndexConfig } from './z-index';\n\nconst getTheme: () => DefaultTheme = () => {\n const layout = getLayout();\n const { gutter } = layout;\n\n return {\n arrowTooltip: getArrowTooltipConfig(),\n button: getButtonConfig(gutter),\n colors: getColors(),\n hues: hues,\n input: getInputConfig(gutter),\n checkbox: getCheckboxConfig(gutter),\n layout,\n tab: getTabConfig(layout.gutter),\n text: getTextTypes(),\n textButton: getTextButtonConfig(),\n zIndex: getZIndexConfig(),\n device: getDeviceConfig(),\n };\n};\n\nexport { getTheme };\n"],"names":["getTheme","layout","getLayout","gutter","getArrowTooltipConfig","getButtonConfig","getColors","hues","getInputConfig","getCheckboxConfig","getTabConfig","getTextTypes","getTextButtonConfig","getZIndexConfig","getDeviceConfig"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAA+B,MAAM;AACzC,QAAMC,IAASC,KACT,EAAE,QAAAC,EAAW,IAAAF;AAEZ,SAAA;AAAA,IACL,cAAcG,EAAsB;AAAA,IACpC,QAAQC,EAAgBF,CAAM;AAAA,IAC9B,QAAQG,EAAU;AAAA,IAClB,MAAAC;AAAA,IACA,OAAOC,EAAeL,CAAM;AAAA,IAC5B,UAAUM,EAAkBN,CAAM;AAAA,IAClC,QAAAF;AAAA,IACA,KAAKS,EAAaT,EAAO,MAAM;AAAA,IAC/B,MAAMU,EAAa;AAAA,IACnB,YAAYC,EAAoB;AAAA,IAChC,QAAQC,EAAgB;AAAA,IACxB,QAAQC,EAAgB;AAAA,EAAA;AAE5B;"}
package/dist/index.d.ts CHANGED
@@ -457,6 +457,8 @@ declare const getCheckboxConfig: IGetCheckboxConfig;
457
457
 
458
458
  declare function getColors(): TColorsMap;
459
459
 
460
+ declare const getDeviceConfig: () => TSupportedDevices;
461
+
460
462
  declare const getInputConfig: IGetInputConfig;
461
463
 
462
464
  declare function getLayout(multiplier?: number): ILayout;
@@ -3090,6 +3092,7 @@ export declare interface ITheme {
3090
3092
  textButton: ReturnType<typeof getTextButtonConfig>;
3091
3093
  zIndex: ReturnType<typeof getZIndexConfig>;
3092
3094
  checkbox: ReturnType<typeof getCheckboxConfig>;
3095
+ device: ReturnType<typeof getDeviceConfig>;
3093
3096
  }
3094
3097
 
3095
3098
  declare interface ITile {
@@ -3211,6 +3214,7 @@ export declare interface ITutorialProps {
3211
3214
  onCross?: () => void;
3212
3215
  showProgress?: boolean;
3213
3216
  onTutorialPlayedOnce?: () => void;
3217
+ isJourneyActive?: boolean;
3214
3218
  }
3215
3219
 
3216
3220
  declare interface IUpdateImages {
@@ -5216,6 +5220,8 @@ declare type TSubscribe = (id: string, cb: (data: IActionData | IActionData[]) =
5216
5220
 
5217
5221
  declare type TSubscribeMouseMove = (id: string, callback: (data: IPointerData) => void) => void;
5218
5222
 
5223
+ export declare type TSupportedDevices = 'mobile' | 'desktop';
5224
+
5219
5225
  export declare type TTableMode = 'random' | 'sequence' | 'advance' | 'infinite';
5220
5226
 
5221
5227
  export declare type TTabSizes = 'xsmall' | 'small' | 'regular' | 'medium';
@@ -5280,7 +5286,7 @@ declare type TUserProgram = {
5280
5286
 
5281
5287
  export declare type TUserTypes = 'TEACHER' | 'STUDENT';
5282
5288
 
5283
- export declare const Tutorial: ({ src, title, onCross, showProgress, onTutorialPlayedOnce, }: ITutorialProps) => JSX_2.Element;
5289
+ export declare const Tutorial: ({ src, title, onCross, showProgress, onTutorialPlayedOnce, isJourneyActive, }: ITutorialProps) => JSX_2.Element;
5284
5290
 
5285
5291
  export declare const TutoringIcon: React_2.FC<React_2.SVGProps<SVGSVGElement>>;
5286
5292
 
@@ -5522,6 +5528,7 @@ declare const ZINDEX: {
5522
5528
  readonly QUESTION_TIPS: -1;
5523
5529
  readonly DESMOS_CALCULATOR: 2;
5524
5530
  readonly GOAL_CHAPTER_SHEETS_MENU: 4;
5531
+ readonly JOURNEY_OVERLAY: 1000;
5525
5532
  };
5526
5533
 
5527
5534
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.0.2",
3
+ "version": "3.0.4-rj-0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1 +0,0 @@
1
- {"version":3,"file":"info-bar-styled.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const InfoBarWrapper = styled(FlexView)`\n padding: 16px;\n margin: 16px;\n border-width: 1px;\n border-style: solid;\n`;\n"],"names":["InfoBarWrapper","styled","FlexView"],"mappings":";;AAIa,MAAAA,IAAiBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"info-bar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar.tsx"],"sourcesContent":["import type { TColorNames, THueNames } from '../../../../ui/types';\nimport type { IInfoBarProps } from './info-bar-types';\n\nimport { useMemo } from 'react';\n\nimport * as Styled from './info-bar-styled';\n\nconst computeColorsFromHue = (\n hue: THueNames,\n): { backgroundColor: TColorNames; borderColor: TColorNames } => {\n return { backgroundColor: `${hue}_6`, borderColor: `${hue}_4` };\n};\n\nexport const InfoBar: React.FC<IInfoBarProps> = ({ children, hue }) => {\n const { backgroundColor, borderColor } = useMemo(() => computeColorsFromHue(hue), [hue]);\n\n return (\n <Styled.InfoBarWrapper $background={backgroundColor} $borderColor={borderColor}>\n {children}\n </Styled.InfoBarWrapper>\n );\n};\n"],"names":["computeColorsFromHue","hue","InfoBar","children","backgroundColor","borderColor","useMemo","jsx","Styled.InfoBarWrapper"],"mappings":";;;AAOA,MAAMA,IAAuB,CAC3BC,OAEO,EAAE,iBAAiB,GAAGA,CAAG,MAAM,aAAa,GAAGA,CAAG,SAG9CC,IAAmC,CAAC,EAAE,UAAAC,GAAU,KAAAF,QAAU;AAC/D,QAAA,EAAE,iBAAAG,GAAiB,aAAAC,EAAA,IAAgBC,EAAQ,MAAMN,EAAqBC,CAAG,GAAG,CAACA,CAAG,CAAC;AAGrF,SAAA,gBAAAM,EAACC,GAAA,EAAsB,aAAaJ,GAAiB,cAAcC,GAChE,UAAAF,EACH,CAAA;AAEJ;"}