@cuemath/leap 3.1.7-aa7 → 3.1.7-gg1

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 (34) hide show
  1. package/dist/features/cue-canvas/constants/constants.js.map +1 -1
  2. package/dist/features/cue-canvas/cue-canvas-core.js +52 -57
  3. package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
  4. package/dist/features/cue-canvas/cue-canvas-helpers.js.map +1 -1
  5. package/dist/features/cue-canvas/cue-canvas.js +47 -48
  6. package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
  7. package/dist/features/cue-canvas/hooks/use-config-updater.js +8 -9
  8. package/dist/features/cue-canvas/hooks/use-config-updater.js.map +1 -1
  9. package/dist/features/cue-canvas/hooks/use-height-extender.js +10 -12
  10. package/dist/features/cue-canvas/hooks/use-height-extender.js.map +1 -1
  11. package/dist/features/cue-canvas/toolbar/color-palette.js +15 -16
  12. package/dist/features/cue-canvas/toolbar/color-palette.js.map +1 -1
  13. package/dist/features/cue-canvas/toolbar/tool.js +4 -4
  14. package/dist/features/cue-canvas/toolbar/tool.js.map +1 -1
  15. package/dist/features/cue-canvas/toolbar/toolbar.js +12 -12
  16. package/dist/features/cue-canvas/toolbar/toolbar.js.map +1 -1
  17. package/dist/features/ui/modals/modal-context.js +13 -0
  18. package/dist/features/ui/modals/modal-context.js.map +1 -0
  19. package/dist/features/ui/modals/modal-helpers.js +17 -0
  20. package/dist/features/ui/modals/modal-helpers.js.map +1 -0
  21. package/dist/features/ui/modals/modal-provider.js +48 -0
  22. package/dist/features/ui/modals/modal-provider.js.map +1 -0
  23. package/dist/features/ui/modals/modal-styled.js +154 -0
  24. package/dist/features/ui/modals/modal-styled.js.map +1 -0
  25. package/dist/features/ui/modals/modal.js +19 -0
  26. package/dist/features/ui/modals/modal.js.map +1 -0
  27. package/dist/features/ui/modals/use-modal-actions.js +10 -0
  28. package/dist/features/ui/modals/use-modal-actions.js.map +1 -0
  29. package/dist/features/ui/modals/use-modal-params.js +10 -0
  30. package/dist/features/ui/modals/use-modal-params.js.map +1 -0
  31. package/dist/index.d.ts +56 -11
  32. package/dist/index.js +339 -333
  33. package/dist/index.js.map +1 -1
  34. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-modal-actions.js","sources":["../../../../src/features/ui/modals/use-modal-actions.ts"],"sourcesContent":["import type { IUseModalActions } from './modal-types';\n\nimport { useContext } from 'react';\n\nimport ModalContext from './modal-context';\n\nconst useModalActions: IUseModalActions = () => {\n const { openModal, closeModal, isClosing } = useContext(ModalContext);\n\n return { openModal, closeModal, isClosing };\n};\n\nexport default useModalActions;\n"],"names":["useModalActions","openModal","closeModal","isClosing","useContext","ModalContext","useModalActions$1"],"mappings":";;AAMA,MAAMA,IAAoC,MAAM;AAC9C,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,WAAAC,EAAU,IAAIC,EAAWC,CAAY;AAE7D,SAAA,EAAE,WAAAJ,GAAW,YAAAC,GAAY,WAAAC;AAClC,GAEAG,IAAeN;"}
@@ -0,0 +1,10 @@
1
+ import { useContext as a } from "react";
2
+ import t from "./modal-context.js";
3
+ const r = () => {
4
+ const { modalParams: o } = a(t);
5
+ return o;
6
+ }, m = r;
7
+ export {
8
+ m as default
9
+ };
10
+ //# sourceMappingURL=use-modal-params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-modal-params.js","sources":["../../../../src/features/ui/modals/use-modal-params.ts"],"sourcesContent":["import type { IUseModalParams } from './modal-types';\n\nimport { useContext } from 'react';\n\nimport ModalContext from './modal-context';\n\nconst useModalParams: IUseModalParams = <T = undefined>(): T => {\n const { modalParams } = useContext(ModalContext);\n\n return modalParams as T;\n};\n\nexport default useModalParams;\n"],"names":["useModalParams","modalParams","useContext","ModalContext","useModalParams$1"],"mappings":";;AAMA,MAAMA,IAAkC,MAAwB;AAC9D,QAAM,EAAE,aAAAC,EAAA,IAAgBC,EAAWC,CAAY;AAExC,SAAAF;AACT,GAEAG,IAAeJ;"}
package/dist/index.d.ts CHANGED
@@ -807,8 +807,6 @@ declare interface ICalloutProps {
807
807
  declare interface ICanvasUpdateConfig {
808
808
  dimesion?: IViewport;
809
809
  gridName?: TCueCanvasGridName;
810
- height?: number;
811
- users?: Record<string, IUserCanvasConfig>;
812
810
  }
813
811
 
814
812
  declare interface ICascadeSelectValue {
@@ -2362,6 +2360,45 @@ declare interface IMilestoneWidgetResourcesProps extends INodeCardCallbacks {
2362
2360
  canUpdatePlan?: boolean;
2363
2361
  }
2364
2362
 
2363
+ /**
2364
+ * Configuration for a modal component
2365
+ */
2366
+ export declare interface IModal {
2367
+ /** Unique identifier for the modal */
2368
+ name: string;
2369
+ /** Content to display inside the modal */
2370
+ element: JSX.Element;
2371
+ /** Rendering style of the modal */
2372
+ renderAs?: 'modal' | 'fullscreen' | 'spotlight';
2373
+ /** Whether the modal can be dismissed by clicking outside or ESC key (default: true) */
2374
+ isDismissable?: boolean;
2375
+ /** Whether the modal requires authentication to view (default: true) */
2376
+ isPrivate?: boolean;
2377
+ /** Width of the modal in CSS units (e.g., '500px', '80vw') */
2378
+ modalWidth: string;
2379
+ }
2380
+
2381
+ /**
2382
+ * Context for managing modals throughout the application
2383
+ */
2384
+ declare interface IModalContext {
2385
+ /** Currently active modal or null if no modal is open */
2386
+ modal: IModal | null;
2387
+ /** Parameters passed to the modal when opened */
2388
+ modalParams?: Record<string, unknown>;
2389
+ /** Opens a modal by name with optional parameters */
2390
+ openModal: <T = undefined>(name: string, params?: T) => void;
2391
+ /** Closes the currently open modal */
2392
+ closeModal: () => void;
2393
+ /** Whether the modal is in the process of closing (for animation) */
2394
+ isClosing?: boolean;
2395
+ }
2396
+
2397
+ declare interface IModalProviderProps extends PropsWithChildren {
2398
+ modals: IModal[];
2399
+ isUserAuthenticated?: boolean;
2400
+ }
2401
+
2365
2402
  export declare interface IMultiplayerWebGameProps extends IBaseWebGameProps, ISyncableWebGameProps {
2366
2403
  enablePlayerTurnIndicators?: boolean;
2367
2404
  }
@@ -3566,6 +3603,14 @@ declare interface IUseIsTabBlocked {
3566
3603
  (): IMultiTabBlockerContextValue;
3567
3604
  }
3568
3605
 
3606
+ declare interface IUseModalActions {
3607
+ (): Pick<IModalContext, 'openModal' | 'closeModal' | 'isClosing'>;
3608
+ }
3609
+
3610
+ declare interface IUseModalParams {
3611
+ <T = undefined>(): T;
3612
+ }
3613
+
3569
3614
  declare interface IusePointerSyncMethods {
3570
3615
  publishMouseMove?: (data: IPointerData) => void;
3571
3616
  susbcribeMouseMove?: (qrId: string, cb: (data: IPointerData) => void) => void;
@@ -3576,11 +3621,6 @@ declare interface IusePointerSyncProps {
3576
3621
  targetUserId?: string;
3577
3622
  }
3578
3623
 
3579
- declare interface IUserCanvasConfig {
3580
- tool?: TCueCanvasTool;
3581
- color?: TCueCanvasColors;
3582
- }
3583
-
3584
3624
  export declare interface IUserChapterData {
3585
3625
  chapter_code: string;
3586
3626
  chapter_id: string;
@@ -4123,6 +4163,11 @@ export declare const MistakeIcon: React.FC<React.SVGProps<SVGSVGElement>>;
4123
4163
 
4124
4164
  export declare const Mobile: React.FC<React.SVGProps<SVGSVGElement>>;
4125
4165
 
4166
+ /**
4167
+ * Provider component that manages modal state and provides modal context to child components
4168
+ */
4169
+ export declare const ModalProvider: FC<IModalProviderProps>;
4170
+
4126
4171
  export declare const MoreVerticalIcon: React.FC<React.SVGProps<SVGSVGElement>>;
4127
4172
 
4128
4173
  export declare const MultiTabBlocker: FC<PropsWithChildren<IMultiTabBlockerProps>>;
@@ -4786,12 +4831,8 @@ declare type TCreateOnPresubmit = (options: TOnPreSubmitOptions) => void;
4786
4831
 
4787
4832
  declare type TCueCanvasChangeDataObject = Record<string, TDrawingData[]>;
4788
4833
 
4789
- declare type TCueCanvasColors = 'CANVAS_RED' | 'CANVAS_YELLOW' | 'CANVAS_GREEN' | 'CANVAS_BLUE' | 'CANVAS_PURPLE' | 'CANVAS_PINK' | 'LIGHT_ORANGE' | 'LIGHT_RED' | 'LIGHT_PINK' | 'LIGHT_PURPLE' | 'LIGHT_BLUE' | 'LIGHT_TEAL' | 'LIGHT_GREEN' | 'LIGHT_YELLOW' | 'WHITE' | 'ORANGE' | 'RED' | 'PINK' | 'PURPLE' | 'BLUE' | 'TEAL' | 'GREEN' | 'YELLOW' | 'GREY' | 'DARK_ORANGE' | 'DARK_RED' | 'DARK_PINK' | 'DARK_PURPLE' | 'DARK_BLUE' | 'DARK_TEAL' | 'DARK_GREEN' | 'DARK_YELLOW' | 'BLACK';
4790
-
4791
4834
  declare type TCueCanvasGridName = 'none' | 'square2-grid' | 'square-checked' | 'square-dots' | 'square-grid' | 'tri-dots' | 'tri-grid' | 'tri2-dots' | 'tri2-grid';
4792
4835
 
4793
- declare type TCueCanvasTool = 'pen' | 'eraser' | 'move' | 'undo' | 'redo' | 'marker' | 'highlighter' | 'ruler' | 'pan' | 'clearAll' | 'text' | 'equation' | 'grid' | 'home' | 'lock' | 'unlock' | 'zoomIn' | 'zoomOut' | 'upload' | 'download';
4794
-
4795
4836
  declare type TCueProgramData = {
4796
4837
  description: string;
4797
4838
  id: string;
@@ -5841,6 +5882,10 @@ export declare const useIsTabBlocked: IUseIsTabBlocked;
5841
5882
 
5842
5883
  export declare const useJourney: () => IJourneyContext;
5843
5884
 
5885
+ export declare const useModalActions: IUseModalActions;
5886
+
5887
+ export declare const useModalParams: IUseModalParams;
5888
+
5844
5889
  export declare const usePointerSync: ({ userType, targetUserId, }: IusePointerSyncProps) => IusePointerSyncMethods;
5845
5890
 
5846
5891
  export declare const User2Icon: React.FC<React.SVGProps<SVGSVGElement>>;