@cuemath/leap 3.2.1 → 3.2.2-aa11

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,51 +1,51 @@
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
- import S from "./modal-context.js";
1
+ import { jsxs as E, jsx as c } from "react/jsx-runtime";
2
+ import { memo as b, useState as f, useRef as g, useCallback as u, useMemo as S, useEffect as p, Suspense as x } from "react";
3
+ import D from "./modal.js";
4
+ import I from "./modal-context.js";
5
5
  import { lockScroll as R, unlockScroll as T } from "./modal-helpers.js";
6
- const $ = 500, g = h(({ children: p, modals: u, isUserAuthenticated: t }) => {
7
- const [o, M] = c(null), [m, C] = c(void 0), [r, i] = c(!1), l = x(void 0), v = f(
8
- (e, s, P) => {
9
- const d = u.find((y) => y.name === e);
6
+ const $ = 500, j = b(({ children: P, modals: M, isUserAuthenticated: l }) => {
7
+ const [o, v] = f(null), [m, k] = f(void 0), [r, i] = f(!1), t = g(void 0), w = u(
8
+ (e, s, h) => {
9
+ const d = M.find((y) => y.name === e);
10
10
  if (!d)
11
11
  throw new Error(`Modal with name "${e}" not found`);
12
- if (d.isPrivate && !t)
12
+ if (d.isPrivate && !l)
13
13
  throw new Error(
14
14
  `Access violation: Modal "${e}" is private and user is not authenticated`
15
15
  );
16
- l.current = P, i(!1), M(d), C(s), document.body.style.overflow !== "hidden" && R();
16
+ t.current = h, i(!1), v(d), k(s), document.body.style.overflow !== "hidden" && R();
17
17
  },
18
- [t, u]
19
- ), n = f(() => {
18
+ [l, M]
19
+ ), n = u(() => {
20
20
  i(!0), T(), setTimeout(() => {
21
- M(null), i(!1);
21
+ v(null), i(!1);
22
22
  }, $);
23
- }, []), k = D(
23
+ }, []), C = S(
24
24
  () => ({
25
25
  modal: o,
26
26
  modalParams: m,
27
- openModal: v,
27
+ openModal: w,
28
28
  closeModal: n,
29
29
  isClosing: r
30
30
  }),
31
- [o, m, v, n, r]
32
- ), a = f(() => {
31
+ [o, m, w, n, r]
32
+ ), a = u(() => {
33
33
  var e, s;
34
- (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));
34
+ (o == null ? void 0 : o.isDismissable) !== !1 && !r && (n(), t.current && ((s = (e = t.current).onCloseModal) == null || s.call(e), t.current.onCloseModal = void 0));
35
35
  }, [o, n, r]);
36
- return w(() => {
37
- !t && (o != null && o.isPrivate) && n();
38
- }, [t, o, n]), w(() => {
36
+ return p(() => {
37
+ !l && (o != null && o.isPrivate) && n();
38
+ }, [l, o, n]), p(() => {
39
39
  const e = (s) => {
40
40
  s.key === "Escape" && a();
41
41
  };
42
42
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
43
- }, [a]), /* @__PURE__ */ E(S.Provider, { value: k, children: [
44
- p,
45
- o && /* @__PURE__ */ b(I, { modal: o, isClosing: r, onClose: a })
43
+ }, [a]), console.log("===her ein ModalProvider===", o), /* @__PURE__ */ E(I.Provider, { value: C, children: [
44
+ P,
45
+ /* @__PURE__ */ c(x, { fallback: /* @__PURE__ */ c("div", { children: console.log("===ModalProvider is loading...") }), children: o && /* @__PURE__ */ c(D, { modal: o, isClosing: r, onClose: a }) })
46
46
  ] });
47
- }), K = g;
47
+ }), N = j;
48
48
  export {
49
- K as default
49
+ N as default
50
50
  };
51
51
  //# sourceMappingURL=modal-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal-provider.js","sources":["../../../../src/features/ui/modals/modal-provider.tsx"],"sourcesContent":["import type { IModal, IModalCallbacks, IModalContext, IModalProviderProps } from './modal-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport Modal from './modal';\nimport ModalContext from './modal-context';\nimport { lockScroll, unlockScroll } from './modal-helpers';\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(({ children, modals, isUserAuthenticated }) => {\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":";;;;;AASA,MAAMA,IAAwB,KAKxBC,IAAyCC,EAAK,CAAC,EAAE,UAAAC,GAAU,QAAAC,GAAQ,qBAAAC,QAA0B;AACjG,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;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}
1
+ {"version":3,"file":"modal-provider.js","sources":["../../../../src/features/ui/modals/modal-provider.tsx"],"sourcesContent":["import type { IModal, IModalCallbacks, IModalContext, IModalProviderProps } from './modal-types';\nimport type { FC } from 'react';\n\nimport { memo, Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport Modal from './modal';\nimport ModalContext from './modal-context';\nimport { lockScroll, unlockScroll } from './modal-helpers';\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(({ children, modals, isUserAuthenticated }) => {\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 console.log('===her ein ModalProvider===', modal);\n\n return (\n <ModalContext.Provider value={modalContent}>\n {children}\n <Suspense fallback={<div>{console.log('===ModalProvider is loading...')}</div>}>\n {modal && <Modal modal={modal} isClosing={isClosing} onClose={onModalDismiss} />}\n </Suspense>\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","Suspense","jsx","Modal","ModalProvider$1"],"mappings":";;;;;AASA,MAAMA,IAAwB,KAKxBC,IAAyCC,EAAK,CAAC,EAAE,UAAAC,GAAU,QAAAC,GAAQ,qBAAAC,QAA0B;AACjG,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,YAAM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YACGL;IACjB;AAGK,kBAAA,iBAAiB,WAAWI,CAAa,GAEzC,MAAM,OAAO,oBAAoB,WAAWA,CAAa;AAAA,EAAA,GAC/D,CAACJ,CAAc,CAAC,GAEX,QAAA,IAAI,+BAA+BrB,CAAK,GAG7C,gBAAA2B,EAAAC,EAAa,UAAb,EAAsB,OAAOT,GAC3B,UAAA;AAAA,IAAAtB;AAAA,sBACAgC,GAAS,EAAA,UAAW,gBAAAC,EAAA,OAAA,EAAK,kBAAQ,IAAI,gCAAgC,EAAE,CAAA,GACrE,eAAU,gBAAAA,EAAAC,GAAA,EAAM,OAAA/B,GAAc,WAAAK,GAAsB,SAASgB,EAAgB,CAAA,GAChF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC,GAEDW,IAAerC;"}
@@ -1,16 +1,16 @@
1
- import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
- import { memo as m } from "react";
3
- import h from "../../../assets/line-icons/icons/cross.js";
4
- import c from "../buttons/clickable/clickable.js";
5
- import { ModalContainer as r, SpotlightModal as f, BaseModal as C, CloseButtonContainer as p, BaseModalContent as $ } from "./modal-styled.js";
6
- const B = m(({ modal: n, isClosing: e = !1, onClose: s }) => {
7
- const { renderAs: d, element: l, modalWidth: i, isDismissable: a } = n;
8
- return d === "spotlight" ? /* @__PURE__ */ t(r, { $isClosing: e, children: [
9
- /* @__PURE__ */ o(f, { $isClosing: e }),
10
- l
11
- ] }) : /* @__PURE__ */ o(r, { $isClosing: e, children: /* @__PURE__ */ t(C, { $isClosing: e, $width: i, children: [
12
- a !== !1 && /* @__PURE__ */ o(p, { $modalWidth: i, children: /* @__PURE__ */ o(c, { label: "Close", onClick: s, children: /* @__PURE__ */ o(h, { width: 40, height: 40 }) }) }),
13
- /* @__PURE__ */ o($, { $modalWidth: i, children: l })
1
+ import { jsxs as d, jsx as l } from "react/jsx-runtime";
2
+ import { memo as h, Suspense as n } from "react";
3
+ import m from "../../../assets/line-icons/icons/cross.js";
4
+ import f from "../buttons/clickable/clickable.js";
5
+ import { ModalContainer as r, SpotlightModal as p, BaseModal as C, CloseButtonContainer as g, BaseModalContent as M } from "./modal-styled.js";
6
+ const B = h(({ modal: s, isClosing: o = !1, onClose: t }) => {
7
+ const { renderAs: a, element: e, modalWidth: i, isDismissable: c } = s;
8
+ return a === "spotlight" ? /* @__PURE__ */ d(r, { $isClosing: o, children: [
9
+ /* @__PURE__ */ l(p, { $isClosing: o }),
10
+ /* @__PURE__ */ l(n, { fallback: /* @__PURE__ */ l("div", { children: console.log("===Modal is loading...") }), children: e })
11
+ ] }) : /* @__PURE__ */ l(r, { $isClosing: o, children: /* @__PURE__ */ d(C, { $isClosing: o, $width: i, children: [
12
+ c !== !1 && /* @__PURE__ */ l(g, { $modalWidth: i, children: /* @__PURE__ */ l(f, { label: "Close", onClick: t, children: /* @__PURE__ */ l(m, { width: 40, height: 40 }) }) }),
13
+ /* @__PURE__ */ l(M, { $modalWidth: i, children: /* @__PURE__ */ l(n, { fallback: /* @__PURE__ */ l("div", { children: console.log("===Modal is loading...") }), children: e }) })
14
14
  ] }) });
15
15
  });
16
16
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"modal.js","sources":["../../../../src/features/ui/modals/modal.tsx"],"sourcesContent":["import type { IModalProps } from './modal-types';\nimport type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport Clickable from '../buttons/clickable/clickable';\nimport * as Styled from './modal-styled';\n\n/**\n * Modal component that renders modal content with close button\n * Handles animation state for entry and exit transitions\n */\nconst Modal: FC<IModalProps> = memo(({ modal, isClosing = false, onClose }) => {\n const { renderAs, element, modalWidth, isDismissable } = modal;\n\n if (renderAs === 'spotlight') {\n return (\n <Styled.ModalContainer $isClosing={isClosing}>\n <Styled.SpotlightModal $isClosing={isClosing} />\n {element}\n </Styled.ModalContainer>\n );\n }\n\n return (\n <Styled.ModalContainer $isClosing={isClosing}>\n <Styled.BaseModal $isClosing={isClosing} $width={modalWidth}>\n {isDismissable !== false && (\n <Styled.CloseButtonContainer $modalWidth={modalWidth}>\n <Clickable label=\"Close\" onClick={onClose}>\n <CrossIcon width={40} height={40} />\n </Clickable>\n </Styled.CloseButtonContainer>\n )}\n <Styled.BaseModalContent $modalWidth={modalWidth}>{element}</Styled.BaseModalContent>\n </Styled.BaseModal>\n </Styled.ModalContainer>\n );\n});\n\nexport default Modal;\n"],"names":["Modal","memo","modal","isClosing","onClose","renderAs","element","modalWidth","isDismissable","jsxs","Styled.ModalContainer","jsx","Styled.SpotlightModal","Styled.BaseModal","Styled.CloseButtonContainer","Clickable","CrossIcon","Styled.BaseModalContent"],"mappings":";;;;;AAaM,MAAAA,IAAyBC,EAAK,CAAC,EAAE,OAAAC,GAAO,WAAAC,IAAY,IAAO,SAAAC,QAAc;AAC7E,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,YAAAC,GAAY,eAAAC,MAAkBN;AAEzD,SAAIG,MAAa,cAEZ,gBAAAI,EAAAC,GAAA,EAAsB,YAAYP,GACjC,UAAA;AAAA,IAAA,gBAAAQ,EAACC,GAAA,EAAsB,YAAYT,EAAW,CAAA;AAAA,IAC7CG;AAAA,EACH,EAAA,CAAA,IAKD,gBAAAK,EAAAD,GAAA,EAAsB,YAAYP,GACjC,UAAC,gBAAAM,EAAAI,GAAA,EAAiB,YAAYV,GAAW,QAAQI,GAC9C,UAAA;AAAA,IAAkBC,MAAA,wBAChBM,GAAA,EAA4B,aAAaP,GACxC,4BAACQ,GAAU,EAAA,OAAM,SAAQ,SAASX,GAChC,4BAACY,GAAU,EAAA,OAAO,IAAI,QAAQ,IAAI,GACpC,EACF,CAAA;AAAA,sBAEDC,GAAA,EAAwB,aAAaV,GAAa,UAAQD,GAAA;AAAA,EAAA,EAC7D,CAAA,EACF,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"modal.js","sources":["../../../../src/features/ui/modals/modal.tsx"],"sourcesContent":["import type { IModalProps } from './modal-types';\nimport type { FC } from 'react';\n\nimport { memo, Suspense } from 'react';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport Clickable from '../buttons/clickable/clickable';\nimport * as Styled from './modal-styled';\n\n/**\n * Modal component that renders modal content with close button\n * Handles animation state for entry and exit transitions\n */\nconst Modal: FC<IModalProps> = memo(({ modal, isClosing = false, onClose }) => {\n const { renderAs, element, modalWidth, isDismissable } = modal;\n\n if (renderAs === 'spotlight') {\n return (\n <Styled.ModalContainer $isClosing={isClosing}>\n <Styled.SpotlightModal $isClosing={isClosing} />\n <Suspense fallback={<div>{console.log('===Modal is loading...')}</div>}>{element}</Suspense>\n </Styled.ModalContainer>\n );\n }\n\n return (\n <Styled.ModalContainer $isClosing={isClosing}>\n <Styled.BaseModal $isClosing={isClosing} $width={modalWidth}>\n {isDismissable !== false && (\n <Styled.CloseButtonContainer $modalWidth={modalWidth}>\n <Clickable label=\"Close\" onClick={onClose}>\n <CrossIcon width={40} height={40} />\n </Clickable>\n </Styled.CloseButtonContainer>\n )}\n <Styled.BaseModalContent $modalWidth={modalWidth}>\n <Suspense fallback={<div>{console.log('===Modal is loading...')}</div>}>\n {element}\n </Suspense>\n </Styled.BaseModalContent>\n </Styled.BaseModal>\n </Styled.ModalContainer>\n );\n});\n\nexport default Modal;\n"],"names":["Modal","memo","modal","isClosing","onClose","renderAs","element","modalWidth","isDismissable","jsxs","Styled.ModalContainer","jsx","Styled.SpotlightModal","Suspense","Styled.BaseModal","Styled.CloseButtonContainer","Clickable","CrossIcon","Styled.BaseModalContent"],"mappings":";;;;;AAaM,MAAAA,IAAyBC,EAAK,CAAC,EAAE,OAAAC,GAAO,WAAAC,IAAY,IAAO,SAAAC,QAAc;AAC7E,QAAM,EAAE,UAAAC,GAAU,SAAAC,GAAS,YAAAC,GAAY,eAAAC,MAAkBN;AAEzD,SAAIG,MAAa,cAEZ,gBAAAI,EAAAC,GAAA,EAAsB,YAAYP,GACjC,UAAA;AAAA,IAAA,gBAAAQ,EAACC,GAAA,EAAsB,YAAYT,EAAW,CAAA;AAAA,IAC9C,gBAAAQ,EAACE,GAAS,EAAA,UAAW,gBAAAF,EAAA,OAAA,EAAK,kBAAQ,IAAI,wBAAwB,EAAE,CAAA,GAAS,UAAQL,EAAA,CAAA;AAAA,EACnF,EAAA,CAAA,IAKD,gBAAAK,EAAAD,GAAA,EAAsB,YAAYP,GACjC,UAAC,gBAAAM,EAAAK,GAAA,EAAiB,YAAYX,GAAW,QAAQI,GAC9C,UAAA;AAAA,IAAkBC,MAAA,wBAChBO,GAAA,EAA4B,aAAaR,GACxC,4BAACS,GAAU,EAAA,OAAM,SAAQ,SAASZ,GAChC,4BAACa,GAAU,EAAA,OAAO,IAAI,QAAQ,IAAI,GACpC,EACF,CAAA;AAAA,sBAEDC,GAAA,EAAwB,aAAaX,GACpC,UAAC,gBAAAI,EAAAE,GAAA,EAAS,UAAU,gBAAAF,EAAC,SAAK,UAAQ,QAAA,IAAI,wBAAwB,EAAE,CAAA,GAC7D,YACH,CAAA,GACF;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.2.1",
3
+ "version": "3.2.2-aa11",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"