@cuemath/leap 2.8.33-hg2 → 2.8.34-beta.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 (55) hide show
  1. package/dist/assets/line-icons/icons/sheet.js +54 -0
  2. package/dist/assets/line-icons/icons/sheet.js.map +1 -0
  3. package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
  4. package/dist/features/circle-games/games/web-view/web-view.js +24 -26
  5. package/dist/features/circle-games/games/web-view/web-view.js.map +1 -1
  6. package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js +174 -0
  7. package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js.map +1 -0
  8. package/dist/features/milestone/milestone-resources/resources-assign/api/get-resource.js +10 -0
  9. package/dist/features/milestone/milestone-resources/resources-assign/api/get-resource.js.map +1 -0
  10. package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js +9 -0
  11. package/dist/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.js.map +1 -0
  12. package/dist/features/milestone/milestone-resources/resources-assign/api/lpar-resource-assign.js +9 -0
  13. package/dist/features/milestone/milestone-resources/resources-assign/api/lpar-resource-assign.js.map +1 -0
  14. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item-styled.js +20 -0
  15. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item-styled.js.map +1 -0
  16. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js +47 -0
  17. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js.map +1 -0
  18. package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item-styled.js +22 -0
  19. package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item-styled.js.map +1 -0
  20. package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item.js +59 -0
  21. package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item.js.map +1 -0
  22. package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/utils.js +6 -0
  23. package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/utils.js.map +1 -0
  24. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/no-resource-screen.js +22 -0
  25. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/no-resource-screen.js.map +1 -0
  26. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items-styled.js +17 -0
  27. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items-styled.js.map +1 -0
  28. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.js +95 -0
  29. package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.js.map +1 -0
  30. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign-styled.js +62 -0
  31. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign-styled.js.map +1 -0
  32. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +186 -0
  33. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js.map +1 -0
  34. package/dist/features/milestone/milestone-resources/resources-assign/utils.js +8 -0
  35. package/dist/features/milestone/milestone-resources/resources-assign/utils.js.map +1 -0
  36. package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js +12 -13
  37. package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
  38. package/dist/features/ui/grade-selector/grade-tab.js +15 -15
  39. package/dist/features/ui/grade-selector/grade-tab.js.map +1 -1
  40. package/dist/features/ui/inputs/searchable-input/searchable-input-styled.js +28 -0
  41. package/dist/features/ui/inputs/searchable-input/searchable-input-styled.js.map +1 -0
  42. package/dist/features/ui/inputs/searchable-input/searchable-input.js +100 -0
  43. package/dist/features/ui/inputs/searchable-input/searchable-input.js.map +1 -0
  44. package/dist/features/ui/tab/tab-styled.js +7 -8
  45. package/dist/features/ui/tab/tab-styled.js.map +1 -1
  46. package/dist/features/ui/tab/tab.js +36 -31
  47. package/dist/features/ui/tab/tab.js.map +1 -1
  48. package/dist/features/ui/theme/tab.js +1 -1
  49. package/dist/features/ui/theme/tab.js.map +1 -1
  50. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +9 -0
  51. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
  52. package/dist/index.d.ts +36 -2
  53. package/dist/index.js +348 -344
  54. package/dist/index.js.map +1 -1
  55. package/package.json +2 -3
@@ -0,0 +1,54 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ const d = (l) => /* @__PURE__ */ o(
3
+ "svg",
4
+ {
5
+ width: "56",
6
+ height: "56",
7
+ viewBox: "0 0 56 56",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ ...l,
11
+ children: [
12
+ /* @__PURE__ */ e(
13
+ "path",
14
+ {
15
+ fillRule: "evenodd",
16
+ clipRule: "evenodd",
17
+ d: "M12.6006 9.10059H31.5099L43.4006 21.3667V46.9006H12.6006V9.10059ZM15.4006 11.9006V44.1006H40.6006V23.3339H29.5173V11.9006H15.4006ZM32.3173 13.9562L38.6936 20.5339H32.3173V13.9562Z",
18
+ fill: "currentColor"
19
+ }
20
+ ),
21
+ /* @__PURE__ */ e(
22
+ "path",
23
+ {
24
+ fillRule: "evenodd",
25
+ clipRule: "evenodd",
26
+ d: "M20.7673 28.1172H35.2339V30.9172H20.7673V28.1172Z",
27
+ fill: "currentColor"
28
+ }
29
+ ),
30
+ /* @__PURE__ */ e(
31
+ "path",
32
+ {
33
+ fillRule: "evenodd",
34
+ clipRule: "evenodd",
35
+ d: "M20.7673 34.1839H35.2339V36.9839H20.7673V34.1839Z",
36
+ fill: "currentColor"
37
+ }
38
+ ),
39
+ /* @__PURE__ */ e(
40
+ "path",
41
+ {
42
+ fillRule: "evenodd",
43
+ clipRule: "evenodd",
44
+ d: "M20.7673 22.0506H26.4839V24.8506H20.7673V22.0506Z",
45
+ fill: "currentColor"
46
+ }
47
+ )
48
+ ]
49
+ }
50
+ ), t = d;
51
+ export {
52
+ t as default
53
+ };
54
+ //# sourceMappingURL=sheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet.js","sources":["../../../../src/assets/line-icons/icons/sheet.tsx"],"sourcesContent":["const SheetIcon: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.6006 9.10059H31.5099L43.4006 21.3667V46.9006H12.6006V9.10059ZM15.4006 11.9006V44.1006H40.6006V23.3339H29.5173V11.9006H15.4006ZM32.3173 13.9562L38.6936 20.5339H32.3173V13.9562Z\"\n fill=\"currentColor\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M20.7673 28.1172H35.2339V30.9172H20.7673V28.1172Z\"\n fill=\"currentColor\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M20.7673 34.1839H35.2339V36.9839H20.7673V34.1839Z\"\n fill=\"currentColor\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M20.7673 22.0506H26.4839V24.8506H20.7673V22.0506Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default SheetIcon;\n"],"names":["SheetIcon","props","jsxs","jsx","SheetIcon$1"],"mappings":";AAAA,MAAMA,IAAqD,CACzDC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,UAAS;AAAA,UACT,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,UAAS;AAAA,UACT,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,UAAS;AAAA,UACT,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,MACA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,UAAS;AAAA,UACT,GAAE;AAAA,UACF,MAAK;AAAA,QAAA;AAAA,MACP;AAAA,IAAA;AAAA,EAAA;AACF,GAGFC,IAAeJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type {\n GameId,\n PuzzleId,\n LessonId,\n MiniGameId,\n WebViewEvent,\n ProjectOutcome,\n ProjectType,\n} from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport type TProject = GameId | PuzzleId | LessonId;\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface IBaseWebGameProps<T> {\n projectId: T;\n variant: string;\n projectType: ProjectType;\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games\n enablePlayerTurnIndicators?: boolean;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps<GameId> {}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps<PuzzleId> {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps<LessonId> {\n miniGameIdentifier: MiniGameId;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n}\n\nexport interface IInfoMessage {\n message: string;\n position: 'top' | 'bottom';\n}\n\nexport interface ITrackEvent {\n eventName: typeof WEBVIEW_ANALYTICS_EVENTS;\n properties: Record<string, unknown>;\n}\n\nexport interface IWebViewProps extends IframeHTMLAttributes<HTMLIFrameElement> {\n baseUrl: string;\n parentDomain: string;\n projectDetails: IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n playerDetails: IPlayer;\n onBack?: () => void;\n onGameLoad?: () => void;\n onGamePlayFinish?: (playerStats: IPlayerStats) => void;\n handleInfoMessage?: (infoMessage: IInfoMessage) => void;\n}\n\nexport interface IMessageProps {\n event: `${WebViewEvent}`;\n payload: IVibrationPattern | IPlayerStats | IInfoMessage | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAmDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"web-view-types.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view-types.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../../../ui/types';\nimport type {\n GameId,\n PuzzleId,\n LessonId,\n MiniGameId,\n WebViewEvent,\n ProjectOutcome,\n ProjectType,\n} from './enums';\nimport type { WEBVIEW_ANALYTICS_EVENTS } from './web-view-analytics-events';\nimport type { IframeHTMLAttributes } from 'react';\n\nexport type TProject = GameId | PuzzleId | LessonId;\n\nexport interface IPlayer {\n id: string;\n username: string;\n grade?: string;\n avatar?: IAvatarLayer[] | null;\n playerType: TUserTypes;\n}\n\ninterface IBaseWebGameProps<T> {\n projectId: T;\n variant: string;\n projectType: ProjectType;\n joinByRoomId?: string;\n enableSync?: boolean; // applicable for all except multiplayer games\n enablePlayerTurnIndicators?: boolean;\n enableCloseButton?: boolean;\n}\n\nexport interface IMultiplayerWebGameProps extends IBaseWebGameProps<GameId> {}\n\nexport interface IPuzzleWebGameProps extends IBaseWebGameProps<PuzzleId> {\n question: string;\n askHintPermission?: boolean;\n}\n\nexport interface ILessonWebGameProps extends IBaseWebGameProps<LessonId> {\n miniGameIdentifier: MiniGameId;\n sessionId: string;\n targetQuestions: number;\n}\n\nexport interface IVibrationPattern {\n pattern: number[] | number;\n}\n\nexport enum IStatsToAwardErrorCode {\n DEFAULT = 'default',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport interface IPlayerStats {\n points: number;\n accuracy: number;\n timeSpent: number;\n streakDays: number;\n streakStatusToday: 'pending' | 'completed';\n errorCode: IStatsToAwardErrorCode;\n outcome: ProjectOutcome;\n value: string;\n}\n\nexport interface IInfoMessage {\n message: string;\n position: 'top' | 'bottom';\n}\n\nexport interface ITrackEvent {\n eventName: typeof WEBVIEW_ANALYTICS_EVENTS;\n properties: Record<string, unknown>;\n}\n\nexport interface IWebViewProps extends IframeHTMLAttributes<HTMLIFrameElement> {\n baseUrl: string;\n projectDetails: IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n playerDetails: IPlayer;\n onBack?: () => void;\n onGameLoad?: () => void;\n onGamePlayFinish?: (playerStats: IPlayerStats) => void;\n handleInfoMessage?: (infoMessage: IInfoMessage) => void;\n}\n\nexport interface IMessageProps {\n event: `${WebViewEvent}`;\n payload: IVibrationPattern | IPlayerStats | IInfoMessage | null;\n}\n"],"names":["IStatsToAwardErrorCode"],"mappings":"AAmDY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,UAAU,WACVA,EAAA,OAAO,QAHGA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,10 +1,10 @@
1
- import { jsx as G } from "react/jsx-runtime";
2
- import { forwardRef as M, useRef as W, useMemo as _, useCallback as A, useImperativeHandle as H, useEffect as V } from "react";
3
- import { useUIContext as $ } from "../../../ui/context/context.js";
1
+ import { jsx as L } from "react/jsx-runtime";
2
+ import { forwardRef as G, useRef as M, useMemo as _, useCallback as A, useImperativeHandle as W, useEffect as H } from "react";
3
+ import { useUIContext as V } from "../../../ui/context/context.js";
4
4
  import { ALLOWED_ORIGIN as j } from "./constants.js";
5
5
  import { ProjectType as I } from "./enums/project-type-enum.js";
6
6
  import { WebViewEvent as i } from "./enums/web-view-events-enum.js";
7
- const q = M((N, C) => {
7
+ const K = G((N, C) => {
8
8
  const {
9
9
  baseUrl: P,
10
10
  projectDetails: v,
@@ -12,12 +12,11 @@ const q = M((N, C) => {
12
12
  onGameLoad: a,
13
13
  onGamePlayFinish: c,
14
14
  handleInfoMessage: f,
15
- onBack: p,
16
- parentDomain: R,
17
- ...b
18
- } = N, l = W(null), g = _(() => T, [T]), o = _(() => v, [v]);
15
+ onBack: l,
16
+ ...R
17
+ } = N, p = M(null), g = _(() => T, [T]), o = _(() => v, [v]);
19
18
  let u = "";
20
- const { onEvent: w } = $();
19
+ const { onEvent: w } = V();
21
20
  o.projectType === I.LESSON && (u = o.miniGameIdentifier);
22
21
  const m = A(() => {
23
22
  const {
@@ -53,39 +52,38 @@ const q = M((N, C) => {
53
52
  }, [o]), d = A(() => {
54
53
  var s, t;
55
54
  const r = m();
56
- (t = (s = l.current) == null ? void 0 : s.contentWindow) == null || t.postMessage(
55
+ (t = (s = p.current) == null ? void 0 : s.contentWindow) == null || t.postMessage(
57
56
  JSON.stringify({
58
57
  event: i.GAME_DATA,
59
58
  payload: r
60
59
  }),
61
60
  j
62
61
  );
63
- }, [m]), D = A(() => {
62
+ }, [m]), O = A(() => {
64
63
  var s, t;
65
64
  const r = m();
66
- (t = (s = l.current) == null ? void 0 : s.contentWindow) == null || t.postMessage(
65
+ (t = (s = p.current) == null ? void 0 : s.contentWindow) == null || t.postMessage(
67
66
  JSON.stringify({
68
67
  event: i.SET_CONFIG,
69
68
  payload: {
70
69
  user: g,
71
- projectConfig: r,
72
- parentDomain: R
70
+ projectConfig: r
73
71
  }
74
72
  }),
75
73
  j
76
74
  );
77
75
  }, [g, m]);
78
- return H(C, () => l.current, []), V(() => {
76
+ return W(C, () => p.current, []), H(() => {
79
77
  const r = (s) => {
80
- var O, S;
78
+ var S, D;
81
79
  const t = s.data, E = typeof t == "string" ? JSON.parse(t) : t, { event: e, payload: n = null } = E;
82
80
  if (e === i.VIBRATE) {
83
81
  const { pattern: y } = n;
84
- (S = (O = window.navigator).vibrate) == null || S.call(O, y);
82
+ (D = (S = window.navigator).vibrate) == null || D.call(S, y);
85
83
  }
86
- if (e === i.GAME_BACK && (p == null || p()), e === i.HIDE_LOADER && (a == null || a()), e === i.LOAD_DATA_FROM_APP && (d == null || d()), e === i.GET_CONFIG && D(), e === i.UPDATE_STATS && (c == null || c(n)), e === i.SHOW_SNACKBAR && (f == null || f(n)), e === i.TRACK_EVENT) {
87
- const { eventName: y, properties: L } = n;
88
- w(y, L);
84
+ if (e === i.GAME_BACK && (l == null || l()), e === i.HIDE_LOADER && (a == null || a()), e === i.LOAD_DATA_FROM_APP && (d == null || d()), e === i.GET_CONFIG && O(), e === i.UPDATE_STATS && (c == null || c(n)), e === i.SHOW_SNACKBAR && (f == null || f(n)), e === i.TRACK_EVENT) {
85
+ const { eventName: y, properties: b } = n;
86
+ w(y, b);
89
87
  }
90
88
  };
91
89
  return window.addEventListener("message", r), () => {
@@ -93,23 +91,23 @@ const q = M((N, C) => {
93
91
  };
94
92
  }, [
95
93
  f,
96
- p,
94
+ l,
97
95
  c,
98
96
  a,
99
- D,
97
+ O,
100
98
  d,
101
99
  w
102
- ]), /* @__PURE__ */ G(
100
+ ]), /* @__PURE__ */ L(
103
101
  "iframe",
104
102
  {
105
- ...b,
106
- ref: l,
103
+ ...R,
104
+ ref: p,
107
105
  src: `${P}/play-game/${o.projectId}/${o.variant}${u ? `/${u}` : ""}?version=2`,
108
106
  allow: "autoplay"
109
107
  }
110
108
  );
111
109
  });
112
110
  export {
113
- q as WebView
111
+ K as WebView
114
112
  };
115
113
  //# sourceMappingURL=web-view.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["import type {\n IInfoMessage,\n ILessonWebGameProps,\n IMessageProps,\n IMultiplayerWebGameProps,\n IPlayerStats,\n IPuzzleWebGameProps,\n IVibrationPattern,\n IWebViewProps,\n} from './web-view-types';\nimport type { ForwardedRef } from 'react';\n\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { useUIContext } from '../../../ui/context/context';\nimport { ALLOWED_ORIGIN } from './constants';\nimport { ProjectType, WebViewEvent } from './enums';\n\nexport const WebView = forwardRef((props: IWebViewProps, ref: ForwardedRef<HTMLIFrameElement>) => {\n const {\n baseUrl,\n projectDetails,\n playerDetails,\n onGameLoad,\n onGamePlayFinish,\n handleInfoMessage,\n onBack,\n parentDomain,\n ...rest\n } = props;\n const webViewRef = useRef<HTMLIFrameElement>(null);\n const memoizedPlayerDetails = useMemo(() => playerDetails, [playerDetails]);\n const memoizedProjectDetails = useMemo(() => projectDetails, [projectDetails]);\n\n let miniGameIdentifier = '';\n const { onEvent: trackEvent } = useUIContext();\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n miniGameIdentifier = (memoizedProjectDetails as ILessonWebGameProps).miniGameIdentifier;\n }\n\n const getProjectDetails = useCallback(() => {\n const {\n enableCloseButton = true,\n enablePlayerTurnIndicators = false,\n enableSync = false,\n joinByRoomId = '',\n } = memoizedProjectDetails;\n\n let payload = {\n joinByRoomId,\n enableCloseButton,\n enablePlayerTurnIndicators,\n enableSync,\n } as IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n\n if (memoizedProjectDetails.projectType === ProjectType.PUZZLE) {\n const details = memoizedProjectDetails as IPuzzleWebGameProps;\n\n payload = {\n ...payload,\n question: details.question,\n askHintPermission: details.askHintPermission,\n } as IPuzzleWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n const details = memoizedProjectDetails as ILessonWebGameProps;\n\n payload = {\n ...payload,\n miniGameIdentifier: details.miniGameIdentifier,\n sessionId: details.sessionId,\n targetQuestions: details.targetQuestions,\n } as ILessonWebGameProps;\n }\n\n return payload;\n }, [memoizedProjectDetails]);\n\n const sendGamesData = useCallback(() => {\n const payload = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.GAME_DATA,\n payload,\n }),\n ALLOWED_ORIGIN,\n );\n }, [getProjectDetails]);\n\n const setConfig = useCallback(() => {\n const projectConfig = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.SET_CONFIG,\n payload: {\n user: memoizedPlayerDetails,\n projectConfig,\n parentDomain,\n },\n }),\n ALLOWED_ORIGIN,\n );\n }, [memoizedPlayerDetails, getProjectDetails]);\n\n useImperativeHandle(ref, () => webViewRef.current as HTMLIFrameElement, []);\n\n useEffect(() => {\n const handleMessage = (e: MessageEvent) => {\n const data: string = e.data;\n const parsedData = typeof data === 'string' ? JSON.parse(data) : (data as IMessageProps);\n\n const { event, payload = null } = parsedData;\n\n if (event === WebViewEvent.VIBRATE) {\n const { pattern } = payload as IVibrationPattern;\n\n window.navigator.vibrate?.(pattern);\n }\n\n if (event === WebViewEvent.GAME_BACK) {\n onBack?.();\n }\n\n if (event === WebViewEvent.HIDE_LOADER) {\n onGameLoad?.();\n }\n\n if (event === WebViewEvent.LOAD_DATA_FROM_APP) {\n sendGamesData?.();\n }\n\n if (event === WebViewEvent.GET_CONFIG) {\n setConfig();\n }\n\n if (event === WebViewEvent.UPDATE_STATS) {\n onGamePlayFinish?.(payload as IPlayerStats);\n }\n\n if (event === WebViewEvent.SHOW_SNACKBAR) {\n handleInfoMessage?.(payload as IInfoMessage);\n }\n\n if (event === WebViewEvent.TRACK_EVENT) {\n const { eventName, properties } = payload;\n\n trackEvent(eventName, properties);\n }\n };\n\n window.addEventListener('message', handleMessage);\n\n return () => {\n window.removeEventListener('message', handleMessage);\n };\n }, [\n handleInfoMessage,\n onBack,\n onGamePlayFinish,\n onGameLoad,\n setConfig,\n sendGamesData,\n trackEvent,\n ]);\n\n return (\n <iframe\n {...rest}\n ref={webViewRef}\n src={`${baseUrl}/play-game/${memoizedProjectDetails.projectId}/${\n memoizedProjectDetails.variant\n }${miniGameIdentifier ? `/${miniGameIdentifier}` : ''}?version=2`}\n allow=\"autoplay\"\n />\n );\n});\n"],"names":["WebView","forwardRef","props","ref","baseUrl","projectDetails","playerDetails","onGameLoad","onGamePlayFinish","handleInfoMessage","onBack","parentDomain","rest","webViewRef","useRef","memoizedPlayerDetails","useMemo","memoizedProjectDetails","miniGameIdentifier","trackEvent","useUIContext","ProjectType","getProjectDetails","useCallback","enableCloseButton","enablePlayerTurnIndicators","enableSync","joinByRoomId","payload","details","sendGamesData","_b","_a","WebViewEvent","ALLOWED_ORIGIN","setConfig","projectConfig","useImperativeHandle","useEffect","handleMessage","e","data","parsedData","event","pattern","eventName","properties","jsx"],"mappings":";;;;;;AAkBO,MAAMA,IAAUC,EAAW,CAACC,GAAsBC,MAAyC;AAC1F,QAAA;AAAA,IACJ,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAV,GACEW,IAAaC,EAA0B,IAAI,GAC3CC,IAAwBC,EAAQ,MAAMV,GAAe,CAACA,CAAa,CAAC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AAA,IACD9B;AAAA,IACAC;AAAA,IACAF;AAAA,IACAD;AAAA,IACA4B;AAAA,IACAL;AAAA,IACAX;AAAA,EAAA,CACD,GAGC,gBAAA4B;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGnC;AAAA,MACJ,KAAKC;AAAA,MACL,KAAK,GAAGT,CAAO,cAAca,EAAuB,SAAS,IAC3DA,EAAuB,OACzB,GAAGC,IAAqB,IAAIA,CAAkB,KAAK,EAAE;AAAA,MACrD,OAAM;AAAA,IAAA;AAAA,EAAA;AAGZ,CAAC;"}
1
+ {"version":3,"file":"web-view.js","sources":["../../../../../src/features/circle-games/games/web-view/web-view.tsx"],"sourcesContent":["import type {\n IInfoMessage,\n ILessonWebGameProps,\n IMessageProps,\n IMultiplayerWebGameProps,\n IPlayerStats,\n IPuzzleWebGameProps,\n IVibrationPattern,\n IWebViewProps,\n} from './web-view-types';\nimport type { ForwardedRef } from 'react';\n\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { useUIContext } from '../../../ui/context/context';\nimport { ALLOWED_ORIGIN } from './constants';\nimport { ProjectType, WebViewEvent } from './enums';\n\nexport const WebView = forwardRef((props: IWebViewProps, ref: ForwardedRef<HTMLIFrameElement>) => {\n const {\n baseUrl,\n projectDetails,\n playerDetails,\n onGameLoad,\n onGamePlayFinish,\n handleInfoMessage,\n onBack,\n ...rest\n } = props;\n const webViewRef = useRef<HTMLIFrameElement>(null);\n const memoizedPlayerDetails = useMemo(() => playerDetails, [playerDetails]);\n const memoizedProjectDetails = useMemo(() => projectDetails, [projectDetails]);\n\n let miniGameIdentifier = '';\n const { onEvent: trackEvent } = useUIContext();\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n miniGameIdentifier = (memoizedProjectDetails as ILessonWebGameProps).miniGameIdentifier;\n }\n\n const getProjectDetails = useCallback(() => {\n const {\n enableCloseButton = true,\n enablePlayerTurnIndicators = false,\n enableSync = false,\n joinByRoomId = '',\n } = memoizedProjectDetails;\n\n let payload = {\n joinByRoomId,\n enableCloseButton,\n enablePlayerTurnIndicators,\n enableSync,\n } as IMultiplayerWebGameProps | IPuzzleWebGameProps | ILessonWebGameProps;\n\n if (memoizedProjectDetails.projectType === ProjectType.PUZZLE) {\n const details = memoizedProjectDetails as IPuzzleWebGameProps;\n\n payload = {\n ...payload,\n question: details.question,\n askHintPermission: details.askHintPermission,\n } as IPuzzleWebGameProps;\n }\n\n if (memoizedProjectDetails.projectType === ProjectType.LESSON) {\n const details = memoizedProjectDetails as ILessonWebGameProps;\n\n payload = {\n ...payload,\n miniGameIdentifier: details.miniGameIdentifier,\n sessionId: details.sessionId,\n targetQuestions: details.targetQuestions,\n } as ILessonWebGameProps;\n }\n\n return payload;\n }, [memoizedProjectDetails]);\n\n const sendGamesData = useCallback(() => {\n const payload = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.GAME_DATA,\n payload,\n }),\n ALLOWED_ORIGIN,\n );\n }, [getProjectDetails]);\n\n const setConfig = useCallback(() => {\n const projectConfig = getProjectDetails();\n\n webViewRef.current?.contentWindow?.postMessage(\n JSON.stringify({\n event: WebViewEvent.SET_CONFIG,\n payload: {\n user: memoizedPlayerDetails,\n projectConfig,\n },\n }),\n ALLOWED_ORIGIN,\n );\n }, [memoizedPlayerDetails, getProjectDetails]);\n\n useImperativeHandle(ref, () => webViewRef.current as HTMLIFrameElement, []);\n\n useEffect(() => {\n const handleMessage = (e: MessageEvent) => {\n const data: string = e.data;\n const parsedData = typeof data === 'string' ? JSON.parse(data) : (data as IMessageProps);\n\n const { event, payload = null } = parsedData;\n\n if (event === WebViewEvent.VIBRATE) {\n const { pattern } = payload as IVibrationPattern;\n\n window.navigator.vibrate?.(pattern);\n }\n\n if (event === WebViewEvent.GAME_BACK) {\n onBack?.();\n }\n\n if (event === WebViewEvent.HIDE_LOADER) {\n onGameLoad?.();\n }\n\n if (event === WebViewEvent.LOAD_DATA_FROM_APP) {\n sendGamesData?.();\n }\n\n if (event === WebViewEvent.GET_CONFIG) {\n setConfig();\n }\n\n if (event === WebViewEvent.UPDATE_STATS) {\n onGamePlayFinish?.(payload as IPlayerStats);\n }\n\n if (event === WebViewEvent.SHOW_SNACKBAR) {\n handleInfoMessage?.(payload as IInfoMessage);\n }\n\n if (event === WebViewEvent.TRACK_EVENT) {\n const { eventName, properties } = payload;\n\n trackEvent(eventName, properties);\n }\n };\n\n window.addEventListener('message', handleMessage);\n\n return () => {\n window.removeEventListener('message', handleMessage);\n };\n }, [\n handleInfoMessage,\n onBack,\n onGamePlayFinish,\n onGameLoad,\n setConfig,\n sendGamesData,\n trackEvent,\n ]);\n\n return (\n <iframe\n {...rest}\n ref={webViewRef}\n src={`${baseUrl}/play-game/${memoizedProjectDetails.projectId}/${\n memoizedProjectDetails.variant\n }${miniGameIdentifier ? `/${miniGameIdentifier}` : ''}?version=2`}\n allow=\"autoplay\"\n />\n );\n});\n"],"names":["WebView","forwardRef","props","ref","baseUrl","projectDetails","playerDetails","onGameLoad","onGamePlayFinish","handleInfoMessage","onBack","rest","webViewRef","useRef","memoizedPlayerDetails","useMemo","memoizedProjectDetails","miniGameIdentifier","trackEvent","useUIContext","ProjectType","getProjectDetails","useCallback","enableCloseButton","enablePlayerTurnIndicators","enableSync","joinByRoomId","payload","details","sendGamesData","_b","_a","WebViewEvent","ALLOWED_ORIGIN","setConfig","projectConfig","useImperativeHandle","useEffect","handleMessage","e","data","parsedData","event","pattern","eventName","properties","jsx"],"mappings":";;;;;;AAkBO,MAAMA,IAAUC,EAAW,CAACC,GAAsBC,MAAyC;AAC1F,QAAA;AAAA,IACJ,SAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAT,GACEU,IAAaC,EAA0B,IAAI,GAC3CC,IAAwBC,EA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,EACrD,GACC;AAAA,IACD7B;AAAA,IACAC;AAAA,IACAF;AAAA,IACAD;AAAA,IACA2B;AAAA,IACAL;AAAA,IACAX;AAAA,EAAA,CACD,GAGC,gBAAA4B;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGnC;AAAA,MACJ,KAAKC;AAAA,MACL,KAAK,GAAGR,CAAO,cAAcY,EAAuB,SAAS,IAC3DA,EAAuB,OACzB,GAAGC,IAAqB,IAAIA,CAAkB,KAAK,EAAE;AAAA,MACrD,OAAM;AAAA,IAAA;AAAA,EAAA;AAGZ,CAAC;"}
@@ -0,0 +1,174 @@
1
+ import { jsxs as o, Fragment as m, jsx as t } from "react/jsx-runtime";
2
+ import { memo as W, useRef as $, useState as j, useEffect as w, Fragment as G } from "react";
3
+ import N from "../../../../assets/line-icons/icons/sheet.js";
4
+ import g from "../../../ui/layout/flex-view.js";
5
+ import O from "../../../ui/separator/separator.js";
6
+ import f from "../../../ui/text/text.js";
7
+ import V from "./comps/filter-item/filter-item.js";
8
+ import D from "./comps/resource-item/resource-item.js";
9
+ import { HeaderWrapper as P, FilterTabWrapper as H, ResourceCountWrapper as K, FilterListWrapper as M } from "./resources-assign-styled.js";
10
+ const U = [
11
+ {
12
+ id: "resource-filters",
13
+ label: "Filters"
14
+ },
15
+ {
16
+ id: "resource-added",
17
+ label: "Added"
18
+ }
19
+ ], J = {
20
+ LEARNING: "Learning",
21
+ PRACTICE: "Practice",
22
+ ASSESSMENT: "Assessment",
23
+ LEVEL2: "Advanced",
24
+ LEVEL3: "Advanced",
25
+ SUBJECTIVE: "Subjective"
26
+ }, oe = W((_) => {
27
+ var R, L, I;
28
+ const {
29
+ boards: i,
30
+ grades: c,
31
+ nodeTypes: l,
32
+ selectedResources: b,
33
+ onResourceDeSelection: v,
34
+ onFilterUpdate: d,
35
+ onViewResource: S
36
+ } = _, a = $(i), s = $(c), u = $(l), [C, x] = j("resource-filters"), p = b.length, A = (R = a.current.find((e) => e.applied)) == null ? void 0 : R.name, T = (L = s.current.find((e) => e.applied)) == null ? void 0 : L.name, E = (I = u.current.find((e) => e.applied)) == null ? void 0 : I.name, F = (e) => {
37
+ d({ board: A === e ? "" : e });
38
+ }, k = (e) => {
39
+ d({ grade: T === e ? "" : e });
40
+ }, y = (e) => {
41
+ d({ node_type: E === e ? "" : e });
42
+ };
43
+ w(() => {
44
+ a.current = i, s.current = c, u.current = l;
45
+ }, [i, c, l]);
46
+ const X = [
47
+ {
48
+ title: "Curriculum",
49
+ options: a.current.map(({ code: e, name: r }) => ({
50
+ id: e,
51
+ label: r,
52
+ value: r
53
+ })),
54
+ value: A,
55
+ onClick: F
56
+ },
57
+ {
58
+ title: "Grade",
59
+ options: s.current.map(({ code: e, name: r }) => ({
60
+ id: e,
61
+ label: e,
62
+ value: r
63
+ })),
64
+ value: T,
65
+ onClick: k
66
+ },
67
+ {
68
+ title: "Type",
69
+ options: u.current.map(({ code: e, name: r }) => ({
70
+ id: e,
71
+ label: J[r] || "",
72
+ value: r || ""
73
+ })),
74
+ value: E,
75
+ onClick: y
76
+ }
77
+ ];
78
+ return /* @__PURE__ */ o(m, { children: [
79
+ /* @__PURE__ */ t(
80
+ P,
81
+ {
82
+ $heightX: 4,
83
+ $background: "WHITE_3",
84
+ $flexDirection: "row",
85
+ $alignItems: "end",
86
+ $noBorder: !0,
87
+ children: U.map((e) => {
88
+ const { id: r, label: h } = e, n = r === C;
89
+ return /* @__PURE__ */ o(
90
+ H,
91
+ {
92
+ $flexDirection: "row",
93
+ $width: "100%",
94
+ $alignItems: "center",
95
+ $justifyContent: "center",
96
+ $gapX: 0.5,
97
+ $selected: n,
98
+ onClick: () => x(r),
99
+ $flexGap: 4,
100
+ $heightX: 2.5,
101
+ children: [
102
+ /* @__PURE__ */ t(
103
+ f,
104
+ {
105
+ $renderAs: n ? "ub3-bold" : "ub3",
106
+ $align: "center",
107
+ $color: n ? "BLACK_T_87" : "BLACK_T_38",
108
+ children: h
109
+ }
110
+ ),
111
+ p > 0 && r === "resource-added" && /* @__PURE__ */ t(
112
+ K,
113
+ {
114
+ $borderRadius: 50,
115
+ $background: "YELLOW_4",
116
+ $gutter: 4,
117
+ $justifyContent: "center",
118
+ $alignItems: "center",
119
+ $heightX: 1.25,
120
+ children: /* @__PURE__ */ t(f, { $renderAs: "ac4-black", children: p })
121
+ }
122
+ )
123
+ ]
124
+ },
125
+ r
126
+ );
127
+ })
128
+ }
129
+ ),
130
+ /* @__PURE__ */ t(M, { $height: "calc(100vh - 64px - 16px)", children: C === "resource-filters" ? /* @__PURE__ */ t(m, { children: X.map((e) => {
131
+ const { title: r, value: h, options: n, onClick: B } = e;
132
+ return /* @__PURE__ */ o(G, { children: [
133
+ /* @__PURE__ */ t(
134
+ V,
135
+ {
136
+ title: r,
137
+ value: h ?? "",
138
+ options: n,
139
+ onClick: B
140
+ }
141
+ ),
142
+ /* @__PURE__ */ t(O, { height: 1, background: "WHITE_5" })
143
+ ] }, r);
144
+ }) }) : /* @__PURE__ */ o(m, { children: [
145
+ b.map((e) => /* @__PURE__ */ t(g, { $gapX: 1, $gutterX: 1, children: /* @__PURE__ */ t(
146
+ D,
147
+ {
148
+ resource: e,
149
+ onViewResource: S,
150
+ onResourceAdditionOrDeletion: v,
151
+ selected: !0
152
+ }
153
+ ) }, e.id)),
154
+ p === 0 && /* @__PURE__ */ o(
155
+ g,
156
+ {
157
+ $alignItems: "center",
158
+ $justifyContent: "center",
159
+ $gapX: 2,
160
+ $height: "100%",
161
+ $flexGap: 8,
162
+ children: [
163
+ /* @__PURE__ */ t(N, { opacity: 0.38 }),
164
+ /* @__PURE__ */ t(g, { $widthX: 15, children: /* @__PURE__ */ t(f, { $renderAs: "ub1-bold", $color: "BLACK_T_38", $align: "center", children: "No sheets added" }) })
165
+ ]
166
+ }
167
+ )
168
+ ] }) })
169
+ ] });
170
+ });
171
+ export {
172
+ oe as default
173
+ };
174
+ //# sourceMappingURL=added-resource-and-filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"added-resource-and-filters.js","sources":["../../../../../src/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.tsx"],"sourcesContent":["import type { IAddedResourceAndFilters } from './resources-assign-type';\nimport type { FC } from 'react';\n\nimport { Fragment, memo, useEffect, useRef, useState } from 'react';\n\nimport SheetIcon from '../../../../assets/line-icons/icons/sheet';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport FilterItem from './comps/filter-item/filter-item';\nimport ResourceItem from './comps/resource-item/resource-item';\nimport * as Styled from './resources-assign-styled';\n\nconst TABS = [\n {\n id: 'resource-filters',\n label: 'Filters',\n },\n {\n id: 'resource-added',\n label: 'Added',\n },\n];\n\nconst EXTRA_PRACTICE_LABEL_MAP: Record<string, string> = {\n LEARNING: 'Learning',\n PRACTICE: 'Practice',\n ASSESSMENT: 'Assessment',\n LEVEL2: 'Advanced',\n LEVEL3: 'Advanced',\n SUBJECTIVE: 'Subjective',\n};\n\nconst AddedResourceAndFilters: FC<IAddedResourceAndFilters> = memo(props => {\n const {\n boards,\n grades,\n nodeTypes,\n selectedResources,\n onResourceDeSelection,\n onFilterUpdate,\n onViewResource,\n } = props;\n\n const boardsRef = useRef(boards);\n const gradesRef = useRef(grades);\n const nodeTypesRef = useRef(nodeTypes);\n\n const [selectedTab, setSelectedTab] = useState('resource-filters');\n\n const addedResourceCount = selectedResources.length;\n const appliedBoard = boardsRef.current.find(board => board.applied)?.name;\n const appliedGrade = gradesRef.current.find(grade => grade.applied)?.name;\n const appliedNodeType = nodeTypesRef.current.find(grade => grade.applied)?.name;\n\n const handleOnBoardChange = (updatedBoard: string) => {\n onFilterUpdate({ board: appliedBoard === updatedBoard ? '' : updatedBoard });\n };\n\n const handleOnGradeChange = (updatedGrade: string) => {\n onFilterUpdate({ grade: appliedGrade === updatedGrade ? '' : updatedGrade });\n };\n\n const handleOnNodeTypeChange = (updatedNodeType: string) => {\n onFilterUpdate({ node_type: appliedNodeType === updatedNodeType ? '' : updatedNodeType });\n };\n\n useEffect(() => {\n boardsRef.current = boards;\n gradesRef.current = grades;\n nodeTypesRef.current = nodeTypes;\n }, [boards, grades, nodeTypes]);\n\n const filterItemList = [\n {\n title: 'Curriculum',\n options: boardsRef.current.map(({ code, name }) => ({\n id: code,\n label: name,\n value: name,\n })),\n value: appliedBoard,\n onClick: handleOnBoardChange,\n },\n {\n title: 'Grade',\n options: gradesRef.current.map(({ code, name }) => ({\n id: code,\n label: code,\n value: name,\n })),\n value: appliedGrade,\n onClick: handleOnGradeChange,\n },\n {\n title: 'Type',\n options: nodeTypesRef.current.map(({ code, name }) => ({\n id: code,\n label: EXTRA_PRACTICE_LABEL_MAP[name] || '',\n value: name || '',\n })),\n value: appliedNodeType,\n onClick: handleOnNodeTypeChange,\n },\n ];\n\n return (\n <>\n <Styled.HeaderWrapper\n $heightX={4}\n $background=\"WHITE_3\"\n $flexDirection=\"row\"\n $alignItems=\"end\"\n $noBorder\n >\n {TABS.map(tab => {\n const { id, label } = tab;\n const selected = id === selectedTab;\n\n return (\n <Styled.FilterTabWrapper\n key={id}\n $flexDirection=\"row\"\n $width=\"100%\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gapX={0.5}\n $selected={selected}\n onClick={() => setSelectedTab(id)}\n $flexGap={4}\n $heightX={2.5}\n >\n <Text\n $renderAs={selected ? 'ub3-bold' : 'ub3'}\n $align=\"center\"\n $color={selected ? 'BLACK_T_87' : 'BLACK_T_38'}\n >\n {label}\n </Text>\n {addedResourceCount > 0 && id === 'resource-added' && (\n <Styled.ResourceCountWrapper\n $borderRadius={50}\n $background=\"YELLOW_4\"\n $gutter={4}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $heightX={1.25}\n >\n <Text $renderAs=\"ac4-black\">{addedResourceCount}</Text>\n </Styled.ResourceCountWrapper>\n )}\n </Styled.FilterTabWrapper>\n );\n })}\n </Styled.HeaderWrapper>\n\n <Styled.FilterListWrapper $height=\"calc(100vh - 64px - 16px)\">\n {selectedTab === 'resource-filters' ? (\n <>\n {filterItemList.map(item => {\n const { title, value, options, onClick } = item;\n\n return (\n <Fragment key={title}>\n <FilterItem\n title={title}\n value={value ?? ''}\n options={options}\n onClick={onClick}\n />\n\n <Separator height={1} background=\"WHITE_5\" />\n </Fragment>\n );\n })}\n </>\n ) : (\n <>\n {selectedResources.map(item => (\n <FlexView $gapX={1} $gutterX={1} key={item.id}>\n <ResourceItem\n resource={item}\n onViewResource={onViewResource}\n onResourceAdditionOrDeletion={onResourceDeSelection}\n selected={true}\n />\n </FlexView>\n ))}\n\n {addedResourceCount === 0 && (\n <FlexView\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $gapX={2}\n $height=\"100%\"\n $flexGap={8}\n >\n <SheetIcon opacity={0.38} />\n <FlexView $widthX={15}>\n <Text $renderAs=\"ub1-bold\" $color=\"BLACK_T_38\" $align=\"center\">\n No sheets added\n </Text>\n </FlexView>\n </FlexView>\n )}\n </>\n )}\n </Styled.FilterListWrapper>\n </>\n );\n});\n\nexport default AddedResourceAndFilters;\n"],"names":["TABS","EXTRA_PRACTICE_LABEL_MAP","AddedResourceAndFilters","memo","props","boards","grades","nodeTypes","selectedResources","onResourceDeSelection","onFilterUpdate","onViewResource","boardsRef","useRef","gradesRef","nodeTypesRef","selectedTab","setSelectedTab","useState","addedResourceCount","appliedBoard","_a","board","appliedGrade","_b","grade","appliedNodeType","_c","handleOnBoardChange","updatedBoard","handleOnGradeChange","updatedGrade","handleOnNodeTypeChange","updatedNodeType","useEffect","filterItemList","code","name","jsxs","Fragment","jsx","Styled.HeaderWrapper","tab","id","label","selected","Styled.FilterTabWrapper","Text","Styled.ResourceCountWrapper","Styled.FilterListWrapper","item","title","value","options","onClick","FilterItem","Separator","FlexView","ResourceItem","SheetIcon"],"mappings":";;;;;;;;;AAaA,MAAMA,IAAO;AAAA,EACX;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,IAAI;AAAA,I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AA,gBAAAV,EAACiB,KAAS,OAAO,GAAG,UAAU,GAC5B,UAAA,gBAAAjB;AAAA,QAACkB;AAAA,QAAA;AAAA,UACC,UAAUR;AAAA,UACV,gBAAAvC;AAAA,UACA,8BAA8BF;AAAA,UAC9B,UAAU;AAAA,QAAA;AAAA,MAAA,KALwByC,EAAK,EAO3C,CACD;AAAA,MAEA/B,MAAuB,KACtB,gBAAAmB;AAAA,QAACmB;AAAA,QAAA;AAAA,UACC,aAAY;AAAA,UACZ,iBAAgB;AAAA,UAChB,OAAO;AAAA,UACP,SAAQ;AAAA,UACR,UAAU;AAAA,UAEV,UAAA;AAAA,YAAC,gBAAAjB,EAAAmB,GAAA,EAAU,SAAS,KAAM,CAAA;AAAA,YACzB,gBAAAnB,EAAAiB,GAAA,EAAS,SAAS,IACjB,UAAC,gBAAAjB,EAAAO,GAAA,EAAK,WAAU,YAAW,QAAO,cAAa,QAAO,UAAS,4BAE/D,CAAA,GACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,EAAA,CAEJ,EAEJ,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
@@ -0,0 +1,10 @@
1
+ import { createGetAPI as e } from "@cuemath/rest-api";
2
+ import { BASE_URL_V3 as t } from "../../../../../constants/api.js";
3
+ import { stringify as o } from "../../../../../helpers/query-string.js";
4
+ const { useGet: i } = e({
5
+ getURL: (c, r) => `${t}/curriculum/extra-resources/?${o(r)}`
6
+ });
7
+ export {
8
+ i as useGetSearchResource
9
+ };
10
+ //# sourceMappingURL=get-resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-resource.js","sources":["../../../../../../src/features/milestone/milestone-resources/resources-assign/api/get-resource.ts"],"sourcesContent":["import type { TCourseStream } from '../../../create/milestone-create-types';\nimport type { IResourceData } from '../resources-assign-type';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../../constants/api';\nimport { stringify } from '../../../../../helpers/query-string';\n\ninterface IExtraPracticeQuery {\n board?: string;\n grade?: string;\n stream: TCourseStream;\n search_term?: string;\n node_type?: string;\n page?: number;\n per_page?: number;\n user_milestone_id?: string;\n program_id?: string;\n}\n\nconst { useGet: useGetSearchResource } = createGetAPI<IResourceData, IExtraPracticeQuery>({\n getURL: (_, query) => `${BASE_URL_V3}/curriculum/extra-resources/?${stringify(query)}`,\n});\n\nexport { useGetSearchResource, type IExtraPracticeQuery };\n"],"names":["useGetSearchResource","createGetAPI","_","query","BASE_URL_V3","stringify"],"mappings":";;;AAoBA,MAAM,EAAE,QAAQA,EAAqB,IAAIC,EAAiD;AAAA,EACxF,QAAQ,CAACC,GAAGC,MAAU,GAAGC,CAAW,gCAAgCC,EAAUF,CAAK,CAAC;AACtF,CAAC;"}
@@ -0,0 +1,9 @@
1
+ import { createPostAPI as o } from "@cuemath/rest-api";
2
+ import { BASE_URL_V3 as s } from "../../../../../constants/api.js";
3
+ const { usePost: u } = o({
4
+ getURL: (t, { userMilestoneId: e }) => `${s}/user-milestone/${e}/resources`
5
+ });
6
+ export {
7
+ u as usePostMilestoneResource
8
+ };
9
+ //# sourceMappingURL=goal-resource-assign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goal-resource-assign.js","sources":["../../../../../../src/features/milestone/milestone-resources/resources-assign/api/goal-resource-assign.ts"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../../constants/api';\n\nconst { usePost: usePostMilestoneResource } = createPostAPI<\n void,\n {\n node_ids: string[];\n },\n { userMilestoneId: string }\n>({\n getURL: (_, { userMilestoneId }) => `${BASE_URL_V3}/user-milestone/${userMilestoneId}/resources`,\n});\n\nexport { usePostMilestoneResource };\n"],"names":["usePostMilestoneResource","createPostAPI","_","userMilestoneId","BASE_URL_V3"],"mappings":";;AAIA,MAAM,EAAE,SAASA,EAAyB,IAAIC,EAM5C;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,iBAAAC,EAAsB,MAAA,GAAGC,CAAW,mBAAmBD,CAAe;AACtF,CAAC;"}
@@ -0,0 +1,9 @@
1
+ import { createPostAPI as e } from "@cuemath/rest-api";
2
+ import { BASE_URL_V2 as s } from "../../../../../constants/api.js";
3
+ const { usePost: P } = e({
4
+ getURL: (o, { studentId: t }) => `${s}/students/${t}/practice-sheets/`
5
+ });
6
+ export {
7
+ P as usePostLPARResource
8
+ };
9
+ //# sourceMappingURL=lpar-resource-assign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lpar-resource-assign.js","sources":["../../../../../../src/features/milestone/milestone-resources/resources-assign/api/lpar-resource-assign.ts"],"sourcesContent":["import { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V2 } from '../../../../../constants/api';\n\nconst { usePost: usePostLPARResource } = createPostAPI<\n void,\n {\n program_id: string;\n nodes: { id: string; attempt_location: string }[];\n },\n { studentId: string }\n>({\n getURL: (_, { studentId }) => `${BASE_URL_V2}/students/${studentId}/practice-sheets/`,\n});\n\nexport { usePostLPARResource };\n"],"names":["usePostLPARResource","createPostAPI","_","studentId","BASE_URL_V2"],"mappings":";;AAIA,MAAM,EAAE,SAASA,EAAoB,IAAIC,EAOvC;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,WAAAC,EAAgB,MAAA,GAAGC,CAAW,aAAaD,CAAS;AACpE,CAAC;"}
@@ -0,0 +1,20 @@
1
+ import r from "styled-components";
2
+ import n from "../../../../../../assets/line-icons/icons/chevron-down.js";
3
+ import i from "../../../../../ui/layout/flex-view.js";
4
+ const a = r(i)`
5
+ cursor: pointer;
6
+ `, c = r(n)(({ $active: t, theme: e }) => {
7
+ const { gutter: o } = e.layout;
8
+ return `
9
+ width: ${o}px;
10
+ height: ${o}px;
11
+ opacity: ${t ? 1 : 0.38};
12
+ transform: rotate(${t ? 180 : 0}deg);
13
+ transition: transform 0.3s ease-out;
14
+ `;
15
+ });
16
+ export {
17
+ a as FilterItemHeader,
18
+ c as StyledChevronIcon
19
+ };
20
+ //# sourceMappingURL=filter-item-styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-item-styled.js","sources":["../../../../../../../src/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport ChevronDownIcon from '../../../../../../assets/line-icons/icons/chevron-down';\nimport FlexView from '../../../../../ui/layout/flex-view';\n\nconst FilterItemHeader = styled(FlexView)`\n cursor: pointer;\n`;\n\ninterface IChevronIcon {\n $active: boolean;\n}\n\nconst StyledChevronIcon = styled(ChevronDownIcon)<IChevronIcon>(({ $active, theme }) => {\n const { gutter } = theme.layout;\n\n return `\n width: ${gutter}px;\n height: ${gutter}px;\n opacity: ${$active ? 1 : 0.38};\n transform: rotate(${$active ? 180 : 0}deg);\n transition: transform 0.3s ease-out;\n `;\n});\n\nexport { FilterItemHeader, StyledChevronIcon };\n"],"names":["FilterItemHeader","styled","FlexView","StyledChevronIcon","ChevronDownIcon","$active","theme","gutter"],"mappings":";;;AAKM,MAAAA,IAAmBC,EAAOC,CAAQ;AAAA;AAAA,GAQlCC,IAAoBF,EAAOG,CAAe,EAAgB,CAAC,EAAE,SAAAC,GAAS,OAAAC,QAAY;AAChF,QAAA,EAAE,QAAAC,EAAO,IAAID,EAAM;AAElB,SAAA;AAAA,aACIC,CAAM;AAAA,cACLA,CAAM;AAAA,eACLF,IAAU,IAAI,IAAI;AAAA,wBACTA,IAAU,MAAM,CAAC;AAAA;AAAA;AAGzC,CAAC;"}
@@ -0,0 +1,47 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { memo as f, useState as x } from "react";
3
+ import l from "../../../../../ui/layout/flex-view.js";
4
+ import u from "../../../../../ui/tab/tab.js";
5
+ import h from "../../../../../ui/text/text.js";
6
+ import { FilterItemHeader as C, StyledChevronIcon as w } from "./filter-item-styled.js";
7
+ const j = f((i) => {
8
+ const { options: a, title: c, value: s, onClick: d } = i, [t, m] = x(!0);
9
+ return /* @__PURE__ */ o(l, { $width: "100%", $gapX: 1, $gutterX: 1, $flexGapX: 1, children: [
10
+ /* @__PURE__ */ o(
11
+ C,
12
+ {
13
+ $flexDirection: "row",
14
+ $alignItems: "center",
15
+ $justifyContent: "space-between",
16
+ $flexGap: 8,
17
+ onClick: () => {
18
+ m((r) => !r);
19
+ },
20
+ children: [
21
+ /* @__PURE__ */ e(h, { $renderAs: "ac4-black", $color: t ? "BLACK_T_60" : "BLACK_T_38", children: c }),
22
+ /* @__PURE__ */ e(w, { $active: t })
23
+ ]
24
+ }
25
+ ),
26
+ t && /* @__PURE__ */ e(l, { $flexDirection: "row", $flexWrap: !0, $flexGap: 12, children: a.map((r) => {
27
+ const { id: p, label: $, value: n } = r;
28
+ return /* @__PURE__ */ e(
29
+ u,
30
+ {
31
+ $width: "fit-content",
32
+ $renderAs: "primary",
33
+ label: $,
34
+ $selected: n === s,
35
+ shape: "curved",
36
+ $size: "small",
37
+ onClick: () => d(n)
38
+ },
39
+ p
40
+ );
41
+ }) })
42
+ ] });
43
+ });
44
+ export {
45
+ j as default
46
+ };
47
+ //# sourceMappingURL=filter-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-item.js","sources":["../../../../../../../src/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.tsx"],"sourcesContent":["import type { IFilterItem } from './filter-item-types';\nimport type { FC } from 'react';\n\nimport { memo, useState } from 'react';\n\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport TabComponent from '../../../../../ui/tab/tab';\nimport Text from '../../../../../ui/text/text';\nimport * as Styled from './filter-item-styled';\n\nconst FilterItem: FC<IFilterItem> = memo(props => {\n const { options, title, value, onClick } = props;\n const [expandItem, setExpandedItem] = useState(true);\n\n const handleOnExpand = () => {\n setExpandedItem(prev => !prev);\n };\n\n return (\n <FlexView $width=\"100%\" $gapX={1} $gutterX={1} $flexGapX={1}>\n <Styled.FilterItemHeader\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $flexGap={8}\n onClick={handleOnExpand}\n >\n <Text $renderAs=\"ac4-black\" $color={expandItem ? 'BLACK_T_60' : 'BLACK_T_38'}>\n {title}\n </Text>\n\n <Styled.StyledChevronIcon $active={expandItem} />\n </Styled.FilterItemHeader>\n\n {expandItem && (\n <FlexView $flexDirection=\"row\" $flexWrap $flexGap={12}>\n {options.map(option => {\n const { id, label, value: optionValue } = option;\n const selected = optionValue === value;\n\n return (\n <TabComponent\n key={id}\n $width=\"fit-content\"\n $renderAs=\"primary\"\n label={label}\n $selected={selected}\n shape=\"curved\"\n $size=\"small\"\n onClick={() => onClick(optionValue)}\n />\n );\n })}\n </FlexView>\n )}\n </FlexView>\n );\n});\n\nexport default FilterItem;\n"],"names":["FilterItem","memo","props","options","title","value","onClick","expandItem","setExpandedItem","useState","jsxs","FlexView","Styled.FilterItemHeader","prev","jsx","Text","Styled.StyledChevronIcon","option","id","label","optionValue","TabComponent"],"mappings":";;;;;;AAUM,MAAAA,IAA8BC,EAAK,CAASC,MAAA;AAChD,QAAM,EAAE,SAAAC,GAAS,OAAAC,GAAO,OAAAC,GAAO,SAAAC,MAAYJ,GACrC,CAACK,GAAYC,CAAe,IAAIC,EAAS,EAAI;AAOjD,SAAA,gBAAAC,EAACC,KAAS,QAAO,QAAO,OAAO,GAAG,UAAU,GAAG,WAAW,GACxD,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,aAAY;AAAA,QACZ,iBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,SAXiB,MAAM;AACX,UAAAJ,EAAA,CAAAK,MAAQ,CAACA,CAAI;AAAA,QAAA;AAAA,QAYzB,UAAA;AAAA,UAAA,gBAAAC,EAACC,KAAK,WAAU,aAAY,QAAQR,IAAa,eAAe,cAC7D,UACHH,EAAA,CAAA;AAAA,UAEC,gBAAAU,EAAAE,GAAA,EAAyB,SAAST,EAAY,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACjD;AAAA,IAECA,KACE,gBAAAO,EAAAH,GAAA,EAAS,gBAAe,OAAM,WAAS,IAAC,UAAU,IAChD,UAAQR,EAAA,IAAI,CAAUc,MAAA;AACrB,YAAM,EAAE,IAAAC,GAAI,OAAAC,GAAO,OAAOC,MAAgBH;AAIxC,aAAA,gBAAAH;AAAA,QAACO;AAAA,QAAA;AAAA,UAEC,QAAO;AAAA,UACP,WAAU;AAAA,UACV,OAAAF;AAAA,UACA,WARaC,MAAgBf;AAAA,UAS7B,OAAM;AAAA,UACN,OAAM;AAAA,UACN,SAAS,MAAMC,EAAQc,CAAW;AAAA,QAAA;AAAA,QAP7BF;AAAA,MAAA;AAAA,IAUV,CAAA,GACH;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
@@ -0,0 +1,22 @@
1
+ import e from "styled-components";
2
+ import t from "../../../../../ui/text/text.js";
3
+ const i = e(t)`
4
+ cursor: pointer;
5
+ display: -webkit-box;
6
+ -webkit-box-orient: vertical;
7
+ -webkit-line-clamp: 2;
8
+ text-overflow: ellipsis;
9
+ overflow: hidden;
10
+
11
+ &:hover {
12
+ text-decoration: underline;
13
+ text-underline-offset: 3px;
14
+ }
15
+ `, l = e(t)`
16
+ word-spacing: 4px;
17
+ `;
18
+ export {
19
+ l as ResourceItemTags,
20
+ i as ResourceItemTitle
21
+ };
22
+ //# sourceMappingURL=resource-item-styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-item-styled.js","sources":["../../../../../../../src/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport Text from '../../../../../ui/text/text';\n\nconst ResourceItemTitle = styled(Text)`\n cursor: pointer;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n\n &:hover {\n text-decoration: underline;\n text-underline-offset: 3px;\n }\n`;\n\nconst ResourceItemTags = styled(Text)`\n word-spacing: 4px;\n`;\n\nexport { ResourceItemTitle, ResourceItemTags };\n"],"names":["ResourceItemTitle","styled","Text","ResourceItemTags"],"mappings":";;AAIM,MAAAA,IAAoBC,EAAOC,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAc/BC,IAAmBF,EAAOC,CAAI;AAAA;AAAA;"}