@cuemath/leap 3.1.20 → 3.1.22-akm-1

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 (20) hide show
  1. package/dist/features/circle-games/leaderboard/dal/use-get-leaderboard-dal/use-get-leaderboard-dal.js +5 -5
  2. package/dist/features/circle-games/leaderboard/dal/use-get-leaderboard-dal/use-get-leaderboard-dal.js.map +1 -1
  3. package/dist/features/circle-games/leaderboard/enums/leaderboard-type-enum.js +1 -1
  4. package/dist/features/circle-games/leaderboard/enums/leaderboard-type-enum.js.map +1 -1
  5. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +90 -80
  6. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  7. package/dist/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.js +44 -34
  8. package/dist/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.js.map +1 -1
  9. package/dist/features/ui/modals/modal-provider.js +40 -37
  10. package/dist/features/ui/modals/modal-provider.js.map +1 -1
  11. package/dist/features/ui/modals/modal-styled.js +4 -3
  12. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  13. package/dist/features/ui/modals/use-modal-actions.js +6 -6
  14. package/dist/features/ui/modals/use-modal-actions.js.map +1 -1
  15. package/dist/features/worksheet/worksheet/hooks/use-learnosity-append.js +26 -22
  16. package/dist/features/worksheet/worksheet/hooks/use-learnosity-append.js.map +1 -1
  17. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +42 -42
  18. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  19. package/dist/index.d.ts +10 -5
  20. package/package.json +3 -2
@@ -9,11 +9,11 @@ const k = (t) => {
9
9
  }, [s, t]), d(() => {
10
10
  let m = null;
11
11
  r && a && (m = {
12
- biWeekly: {
13
- currentTimestamp: a.biWeekly.currentTimestamp,
14
- startTimestamp: a.biWeekly.startTimestamp,
15
- endTimestamp: a.biWeekly.endTimestamp,
16
- leaderboardPlayers: a.biWeekly.leaderboardUsers.map((e) => ({
12
+ bi_weekly: {
13
+ currentTimestamp: a.bi_weekly.currentTimestamp,
14
+ startTimestamp: a.bi_weekly.startTimestamp,
15
+ endTimestamp: a.bi_weekly.endTimestamp,
16
+ leaderboardPlayers: a.bi_weekly.leaderboardUsers.map((e) => ({
17
17
  userId: e.user_id,
18
18
  userAvatar: e.userAvatar,
19
19
  username: e.username,
@@ -1 +1 @@
1
- {"version":3,"file":"use-get-leaderboard-dal.js","sources":["../../../../../../src/features/circle-games/leaderboard/dal/use-get-leaderboard-dal/use-get-leaderboard-dal.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../../ui/avatar/avatar-types';\nimport type {\n ILeaderboardDetails,\n ILeaderboardPlayerWithPoints,\n ILeaderboardPlayerWithStreak,\n} from './use-get-leaderboard-dal-types';\n\nimport { useEffect, useState } from 'react';\n\nimport { useGetLeaderboard } from '../../api/get-leaderboard/get-leaderboard';\n\nexport const useGetLeaderboardDal = (\n userId: string,\n): Omit<ReturnType<typeof useGetLeaderboard>, 'data' | 'get'> & {\n data: ILeaderboardDetails | null;\n} => {\n const [leaderboardDetails, setLeaderboardDetails] = useState<ILeaderboardDetails | null>(null);\n const { data, get: getLeaderboards, isProcessed, ...rest } = useGetLeaderboard();\n\n useEffect(() => {\n getLeaderboards('', {\n user_id: userId,\n });\n }, [getLeaderboards, userId]);\n\n useEffect(() => {\n let leaderboard: ILeaderboardDetails | null = null;\n\n if (isProcessed && data) {\n leaderboard = {\n biWeekly: {\n currentTimestamp: data.biWeekly.currentTimestamp,\n startTimestamp: data.biWeekly.startTimestamp,\n endTimestamp: data.biWeekly.endTimestamp,\n leaderboardPlayers: data.biWeekly.leaderboardUsers.map(player => {\n return {\n userId: player.user_id,\n userAvatar: player.userAvatar as IAvatarLayer[],\n username: player.username,\n grade: player.grade,\n rank: player.rank,\n points: player.points!,\n };\n }) as ILeaderboardPlayerWithPoints[],\n },\n global: {\n currentTimestamp: data.global.currentTimestamp,\n startTimestamp: data.global.startTimestamp,\n endTimestamp: data.global.endTimestamp,\n leaderboardPlayers: data.global.leaderboardUsers.map(player => {\n return {\n userId: player.user_id,\n userAvatar: player.userAvatar as IAvatarLayer[],\n username: player.username,\n grade: player.grade,\n rank: player.rank,\n points: player.points!,\n };\n }) as ILeaderboardPlayerWithPoints[],\n },\n globalStreak: {\n currentTimestamp: data.globalStreak.currentTimestamp,\n startTimestamp: data.globalStreak.startTimestamp,\n endTimestamp: data.globalStreak.endTimestamp,\n leaderboardPlayers: data.globalStreak.leaderboardUsers.map(player => {\n return {\n userId: player.user_id,\n userAvatar: player.userAvatar as IAvatarLayer[],\n username: player.username,\n grade: player.grade,\n rank: player.rank,\n streakDays: player.streak_days!,\n };\n }) as ILeaderboardPlayerWithStreak[],\n },\n };\n }\n setLeaderboardDetails(leaderboard);\n }, [data, isProcessed]);\n\n return { data: leaderboardDetails, isProcessed, ...rest };\n};\n"],"names":["useGetLeaderboardDal","userId","leaderboardDetails","setLeaderboardDetails","useState","data","getLeaderboards","isProcessed","rest","useGetLeaderboard","useEffect","leaderboard","player"],"mappings":";;AAWa,MAAAA,IAAuB,CAClCC,MAGG;AACH,QAAM,CAACC,GAAoBC,CAAqB,IAAIC,EAAqC,IAAI,GACvF,EAAE,MAAAC,GAAM,KAAKC,GAAiB,aAAAC,GAAa,GAAGC,EAAA,IAASC;AAE7D,SAAAC,EAAU,MAAM;AACd,IAAAJ,EAAgB,IAAI;AAAA,MAClB,SAASL;AAAA,IAAA,CACV;AAAA,EAAA,GACA,CAACK,GAAiBL,CAAM,CAAC,GAE5BS,EAAU,MAAM;AACd,QAAIC,IAA0C;AAE9C,IAAIJ,KAAeF,MACHM,IAAA;AAAA,MACZ,UAAU;AAAA,QACR,kBAAkBN,EAAK,SAAS;AAAA,QAChC,gBAAgBA,EAAK,SAAS;AAAA,QAC9B,cAAcA,EAAK,SAAS;AAAA,QAC5B,oBAAoBA,EAAK,SAAS,iBAAiB,IAAI,CAAUO,OACxD;AAAA,UACL,QAAQA,EAAO;AAAA,UACf,YAAYA,EAAO;AAAA,UACnB,UAAUA,EAAO;AAAA,UACjB,OAAOA,EAAO;AAAA,UACd,MAAMA,EAAO;AAAA,UACb,QAAQA,EAAO;AAAA,QAAA,EAElB;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,QACN,kBAAkBP,EAAK,OAAO;AAAA,QAC9B,gBAAgBA,EAAK,OAAO;AAAA,QAC5B,cAAcA,EAAK,OAAO;AAAA,QAC1B,oBAAoBA,EAAK,OAAO,iBAAiB,IAAI,CAAUO,OACtD;AAAA,UACL,QAAQA,EAAO;AAAA,UACf,YAAYA,EAAO;AAAA,UACnB,UAAUA,EAAO;AAAA,UACjB,OAAOA,EAAO;AAAA,UACd,MAAMA,EAAO;AAAA,UACb,QAAQA,EAAO;AAAA,QAAA,EAElB;AAAA,MACH;AAAA,MACA,cAAc;AAAA,QACZ,kBAAkBP,EAAK,aAAa;AAAA,QACpC,gBAAgBA,EAAK,aAAa;AAAA,QAClC,cAAcA,EAAK,aAAa;AAAA,QAChC,oBAAoBA,EAAK,aAAa,iBAAiB,IAAI,CAAUO,OAC5D;AAAA,UACL,QAAQA,EAAO;AAAA,UACf,YAAYA,EAAO;AAAA,UACnB,UAAUA,EAAO;AAAA,UACjB,OAAOA,EAAO;AAAA,UACd,MAAMA,EAAO;AAAA,UACb,YAAYA,EAAO;AAAA,QAAA,EAEtB;AAAA,MACH;AAAA,IAAA,IAGJT,EAAsBQ,CAAW;AAAA,EAAA,GAChC,CAACN,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAoB,aAAAK,GAAa,GAAGC,EAAK;AAC1D;"}
1
+ {"version":3,"file":"use-get-leaderboard-dal.js","sources":["../../../../../../src/features/circle-games/leaderboard/dal/use-get-leaderboard-dal/use-get-leaderboard-dal.ts"],"sourcesContent":["import type { IAvatarLayer } from '../../../../ui/avatar/avatar-types';\nimport type {\n ILeaderboardDetails,\n ILeaderboardPlayerWithPoints,\n ILeaderboardPlayerWithStreak,\n} from './use-get-leaderboard-dal-types';\n\nimport { useEffect, useState } from 'react';\n\nimport { useGetLeaderboard } from '../../api/get-leaderboard/get-leaderboard';\n\nexport const useGetLeaderboardDal = (\n userId: string,\n): Omit<ReturnType<typeof useGetLeaderboard>, 'data' | 'get'> & {\n data: ILeaderboardDetails | null;\n} => {\n const [leaderboardDetails, setLeaderboardDetails] = useState<ILeaderboardDetails | null>(null);\n const { data, get: getLeaderboards, isProcessed, ...rest } = useGetLeaderboard();\n\n useEffect(() => {\n getLeaderboards('', {\n user_id: userId,\n });\n }, [getLeaderboards, userId]);\n\n useEffect(() => {\n let leaderboard: ILeaderboardDetails | null = null;\n\n if (isProcessed && data) {\n leaderboard = {\n bi_weekly: {\n currentTimestamp: data.bi_weekly.currentTimestamp,\n startTimestamp: data.bi_weekly.startTimestamp,\n endTimestamp: data.bi_weekly.endTimestamp,\n leaderboardPlayers: data.bi_weekly.leaderboardUsers.map(player => {\n return {\n userId: player.user_id,\n userAvatar: player.userAvatar as IAvatarLayer[],\n username: player.username,\n grade: player.grade,\n rank: player.rank,\n points: player.points!,\n };\n }) as ILeaderboardPlayerWithPoints[],\n },\n global: {\n currentTimestamp: data.global.currentTimestamp,\n startTimestamp: data.global.startTimestamp,\n endTimestamp: data.global.endTimestamp,\n leaderboardPlayers: data.global.leaderboardUsers.map(player => {\n return {\n userId: player.user_id,\n userAvatar: player.userAvatar as IAvatarLayer[],\n username: player.username,\n grade: player.grade,\n rank: player.rank,\n points: player.points!,\n };\n }) as ILeaderboardPlayerWithPoints[],\n },\n globalStreak: {\n currentTimestamp: data.globalStreak.currentTimestamp,\n startTimestamp: data.globalStreak.startTimestamp,\n endTimestamp: data.globalStreak.endTimestamp,\n leaderboardPlayers: data.globalStreak.leaderboardUsers.map(player => {\n return {\n userId: player.user_id,\n userAvatar: player.userAvatar as IAvatarLayer[],\n username: player.username,\n grade: player.grade,\n rank: player.rank,\n streakDays: player.streak_days!,\n };\n }) as ILeaderboardPlayerWithStreak[],\n },\n };\n }\n setLeaderboardDetails(leaderboard);\n }, [data, isProcessed]);\n\n return { data: leaderboardDetails, isProcessed, ...rest };\n};\n"],"names":["useGetLeaderboardDal","userId","leaderboardDetails","setLeaderboardDetails","useState","data","getLeaderboards","isProcessed","rest","useGetLeaderboard","useEffect","leaderboard","player"],"mappings":";;AAWa,MAAAA,IAAuB,CAClCC,MAGG;AACH,QAAM,CAACC,GAAoBC,CAAqB,IAAIC,EAAqC,IAAI,GACvF,EAAE,MAAAC,GAAM,KAAKC,GAAiB,aAAAC,GAAa,GAAGC,EAAA,IAASC;AAE7D,SAAAC,EAAU,MAAM;AACd,IAAAJ,EAAgB,IAAI;AAAA,MAClB,SAASL;AAAA,IAAA,CACV;AAAA,EAAA,GACA,CAACK,GAAiBL,CAAM,CAAC,GAE5BS,EAAU,MAAM;AACd,QAAIC,IAA0C;AAE9C,IAAIJ,KAAeF,MACHM,IAAA;AAAA,MACZ,WAAW;AAAA,QACT,kBAAkBN,EAAK,UAAU;AAAA,QACjC,gBAAgBA,EAAK,UAAU;AAAA,QAC/B,cAAcA,EAAK,UAAU;AAAA,QAC7B,oBAAoBA,EAAK,UAAU,iBAAiB,IAAI,CAAUO,OACzD;AAAA,UACL,QAAQA,EAAO;AAAA,UACf,YAAYA,EAAO;AAAA,UACnB,UAAUA,EAAO;AAAA,UACjB,OAAOA,EAAO;AAAA,UACd,MAAMA,EAAO;AAAA,UACb,QAAQA,EAAO;AAAA,QAAA,EAElB;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,QACN,kBAAkBP,EAAK,OAAO;AAAA,QAC9B,gBAAgBA,EAAK,OAAO;AAAA,QAC5B,cAAcA,EAAK,OAAO;AAAA,QAC1B,oBAAoBA,EAAK,OAAO,iBAAiB,IAAI,CAAUO,OACtD;AAAA,UACL,QAAQA,EAAO;AAAA,UACf,YAAYA,EAAO;AAAA,UACnB,UAAUA,EAAO;AAAA,UACjB,OAAOA,EAAO;AAAA,UACd,MAAMA,EAAO;AAAA,UACb,QAAQA,EAAO;AAAA,QAAA,EAElB;AAAA,MACH;AAAA,MACA,cAAc;AAAA,QACZ,kBAAkBP,EAAK,aAAa;AAAA,QACpC,gBAAgBA,EAAK,aAAa;AAAA,QAClC,cAAcA,EAAK,aAAa;AAAA,QAChC,oBAAoBA,EAAK,aAAa,iBAAiB,IAAI,CAAUO,OAC5D;AAAA,UACL,QAAQA,EAAO;AAAA,UACf,YAAYA,EAAO;AAAA,UACnB,UAAUA,EAAO;AAAA,UACjB,OAAOA,EAAO;AAAA,UACd,MAAMA,EAAO;AAAA,UACb,YAAYA,EAAO;AAAA,QAAA,EAEtB;AAAA,MACH;AAAA,IAAA,IAGJT,EAAsBQ,CAAW;AAAA,EAAA,GAChC,CAACN,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAoB,aAAAK,GAAa,GAAGC,EAAK;AAC1D;"}
@@ -1,4 +1,4 @@
1
- var _ = /* @__PURE__ */ ((l) => (l.BI_WEEKLY = "biWeekly", l.ALL_TIME = "global", l.ALL_TIME_STREAK = "globalStreak", l))(_ || {});
1
+ var _ = /* @__PURE__ */ ((l) => (l.BI_WEEKLY = "bi_weekly", l.ALL_TIME = "global", l.ALL_TIME_STREAK = "globalStreak", l))(_ || {});
2
2
  export {
3
3
  _ as ELeaderboardType
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"leaderboard-type-enum.js","sources":["../../../../../src/features/circle-games/leaderboard/enums/leaderboard-type-enum.ts"],"sourcesContent":["export enum ELeaderboardType {\n BI_WEEKLY = 'biWeekly',\n ALL_TIME = 'global',\n ALL_TIME_STREAK = 'globalStreak',\n}\n"],"names":["ELeaderboardType"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,YACZA,EAAA,WAAW,UACXA,EAAA,kBAAkB,gBAHRA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"leaderboard-type-enum.js","sources":["../../../../../src/features/circle-games/leaderboard/enums/leaderboard-type-enum.ts"],"sourcesContent":["export enum ELeaderboardType {\n BI_WEEKLY = 'bi_weekly',\n ALL_TIME = 'global',\n ALL_TIME_STREAK = 'globalStreak',\n}\n"],"names":["ELeaderboardType"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,WAAW,UACXA,EAAA,kBAAkB,gBAHRA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,136 +1,146 @@
1
- import { jsxs as r, Fragment as K, jsx as o } from "react/jsx-runtime";
2
- import Q, { memo as Y, useCallback as p } from "react";
1
+ import { jsxs as i, Fragment as K, jsx as e } from "react/jsx-runtime";
2
+ import Q, { memo as Y, useCallback as f } from "react";
3
3
  import Z from "../../../hooks/use-lazy-ref.js";
4
+ import ee from "../../../ui/arrow-tooltip/arrow-tooltip.js";
4
5
  import h from "../../../ui/buttons/text-button/text-button.js";
5
- import d from "../../../ui/layout/flex-view.js";
6
- import ee from "../../../ui/separator/separator.js";
7
- import te from "../../../ui/text/text.js";
8
- import oe from "./milestone-widget/milestone-widget.js";
9
- import ne from "./no-active-milestone/no-active-milestone.js";
6
+ import m from "../../../ui/layout/flex-view.js";
7
+ import te from "../../../ui/separator/separator.js";
8
+ import oe from "../../../ui/text/text.js";
9
+ import ne from "./milestone-widget/milestone-widget.js";
10
+ import re from "./no-active-milestone/no-active-milestone.js";
10
11
  import ie from "../../../../node_modules/uuid/dist/esm-browser/v4.js";
11
- const ue = Y(
12
- ({ milestones: e, studentId: u, milestoneType: s, ...A }) => {
12
+ const ge = Y(
13
+ ({ milestones: t, studentId: A, milestoneType: s, ...u }) => {
13
14
  const {
14
- canCreatePlan: m,
15
+ canCreatePlan: a,
15
16
  isClassOngoing: g,
16
17
  isFiltersAdded: C,
17
18
  isStudentPresent: M,
18
19
  onAddChapter: T,
19
20
  onAddOutcome: n,
20
- onChapterClick: N,
21
- onCreatePlan: i,
22
- onDelete: v,
23
- onDraftPublish: R,
24
- onEdit: w,
25
- onCreateMilestoneTest: x,
26
- onNodeAttempt: b,
21
+ onChapterClick: v,
22
+ onCreatePlan: r,
23
+ onDelete: w,
24
+ onDraftPublish: N,
25
+ onEdit: b,
26
+ onCreateMilestoneTest: R,
27
+ onNodeAttempt: x,
27
28
  onNodeView: D,
28
29
  onNodeReview: $,
29
- onNodeReattempt: P,
30
- onNodeReset: F,
31
- onNodeUnassign: I,
30
+ onNodeReattempt: I,
31
+ onNodeReset: P,
32
+ onNodeUnassign: F,
32
33
  onAssignResources: k,
33
34
  onTestPreview: E,
34
35
  onTestReview: S,
35
- onTestStart: V,
36
- activeMilestoneId: _,
37
- activeTabId: j,
38
- onWidgetTabSelection: z,
36
+ onTestStart: j,
37
+ activeMilestoneId: y,
38
+ activeTabId: G,
39
+ onWidgetTabSelection: V,
39
40
  studentName: c,
40
- teacherName: B,
41
- parentName: G,
42
- userType: a,
43
- courseStream: y,
41
+ teacherName: _,
42
+ parentName: z,
43
+ userType: l,
44
+ courseStream: B,
44
45
  onNodeAssignAsHomework: H
45
- } = A, l = s === "ACTIVE", L = s === "DRAFT", f = Z(ie), O = p(() => {
46
- i == null || i(f);
47
- }, [i, f]), W = p(() => {
46
+ } = u, d = s === "ACTIVE", L = s === "DRAFT", p = Z(ie), O = f(() => {
47
+ r == null || r(p);
48
+ }, [r, p]), W = f(() => {
48
49
  n == null || n();
49
50
  }, [n]);
50
- if (!e) return null;
51
- const X = e.some(
52
- (t) => t.milestone_state === "ACTIVE"
53
- ), U = e.some(
54
- (t) => t.milestone_state === "DRAFT"
51
+ if (!t) return null;
52
+ const X = t.some(
53
+ (o) => o.milestone_state === "ACTIVE"
54
+ ), U = t.some(
55
+ (o) => o.milestone_state === "DRAFT"
55
56
  );
56
- return /* @__PURE__ */ r(K, { children: [
57
- l && !X && /* @__PURE__ */ o(d, { $marginBottom: 40, children: /* @__PURE__ */ o(
58
- ne,
57
+ return /* @__PURE__ */ i(K, { children: [
58
+ d && !X && /* @__PURE__ */ e(m, { $marginBottom: 40, children: /* @__PURE__ */ e(
59
+ re,
59
60
  {
60
- canCreatePlan: m,
61
+ canCreatePlan: a,
61
62
  isDraftMilestonePresent: U,
62
63
  isFiltersAdded: C,
63
- onCreatePlan: i,
64
+ onCreatePlan: r,
64
65
  studentName: c,
65
- userType: a
66
+ userType: l
66
67
  }
67
68
  ) }),
68
- l && /* @__PURE__ */ r(d, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 16, children: [
69
- /* @__PURE__ */ r(te, { $renderAs: "ac4", children: [
69
+ d && /* @__PURE__ */ i(m, { $flexDirection: "row", $justifyContent: "space-between", $marginBottom: 16, children: [
70
+ /* @__PURE__ */ i(oe, { $renderAs: "ac4", children: [
70
71
  "Goals (",
71
- e.length,
72
+ t.length,
72
73
  ")"
73
74
  ] }),
74
- a === "TEACHER" && /* @__PURE__ */ r(d, { $flexDirection: "row", $flexGapX: 1, children: [
75
- /* @__PURE__ */ o(
76
- h,
75
+ l === "TEACHER" && /* @__PURE__ */ i(m, { $flexDirection: "row", $flexGapX: 1, children: [
76
+ /* @__PURE__ */ e(
77
+ ee,
77
78
  {
78
- label: "Create Goal",
79
- size: "small",
80
- onClick: O,
81
- disabled: !m
79
+ renderAs: "primary",
80
+ tooltipItem: "Goals can only be added for students who have joined the class",
81
+ hidden: a,
82
+ position: "bottom",
83
+ children: /* @__PURE__ */ e(
84
+ h,
85
+ {
86
+ label: "Create Goal",
87
+ size: "small",
88
+ onClick: O,
89
+ disabled: !a
90
+ }
91
+ )
82
92
  }
83
93
  ),
84
- /* @__PURE__ */ o(h, { label: "Add Milestone", size: "small", onClick: W })
94
+ /* @__PURE__ */ e(h, { label: "Add Milestone", size: "small", onClick: W })
85
95
  ] })
86
96
  ] }),
87
- e.map((t, q) => {
88
- const { id: J } = t;
89
- return /* @__PURE__ */ r(Q.Fragment, { children: [
90
- /* @__PURE__ */ o(
91
- oe,
97
+ t.map((o, q) => {
98
+ const { id: J } = o;
99
+ return /* @__PURE__ */ i(Q.Fragment, { children: [
100
+ /* @__PURE__ */ e(
101
+ ne,
92
102
  {
93
- milestone: t,
94
- studentId: u,
103
+ milestone: o,
104
+ studentId: A,
95
105
  studentName: c,
96
- parentName: G,
97
- teacherName: B,
98
- userType: a,
106
+ parentName: z,
107
+ teacherName: _,
108
+ userType: l,
99
109
  onAddOutcome: n,
100
- onChapterClick: N,
101
- isMilestoneActive: l || L,
110
+ onChapterClick: v,
111
+ isMilestoneActive: d || L,
102
112
  milestoneType: s,
103
- onEdit: w,
104
- onCreateMilestoneTest: x,
113
+ onEdit: b,
114
+ onCreateMilestoneTest: R,
105
115
  onAddChapter: T,
106
- onDelete: v,
107
- onDraftPublish: R,
116
+ onDelete: w,
117
+ onDraftPublish: N,
108
118
  isClassOngoing: g,
109
119
  isStudentPresent: M,
110
120
  onAssignResources: k,
111
- onNodeAttempt: b,
121
+ onNodeAttempt: x,
112
122
  onNodeView: D,
113
123
  onNodeReview: $,
114
- onNodeReattempt: P,
115
- onNodeReset: F,
116
- onNodeUnassign: I,
124
+ onNodeReattempt: I,
125
+ onNodeReset: P,
126
+ onNodeUnassign: F,
117
127
  onNodeAssignAsHomework: H,
118
128
  onTestPreview: E,
119
129
  onTestReview: S,
120
- onTestStart: V,
121
- courseStream: y,
122
- activeMilestoneId: _,
123
- activeTabId: j,
124
- onWidgetTabSelection: z
130
+ onTestStart: j,
131
+ courseStream: B,
132
+ activeMilestoneId: y,
133
+ activeTabId: G,
134
+ onWidgetTabSelection: V
125
135
  }
126
136
  ),
127
- q !== e.length - 1 && /* @__PURE__ */ o(ee, { heightX: 2 })
137
+ q !== t.length - 1 && /* @__PURE__ */ e(te, { heightX: 2 })
128
138
  ] }, `milestone=${J}`);
129
139
  })
130
140
  ] });
131
141
  }
132
142
  );
133
143
  export {
134
- ue as default
144
+ ge as default
135
145
  };
136
146
  //# sourceMappingURL=milestone-list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;AAaA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACjE,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAA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AAAA,YAAA;AAAA,UACb;AAAA,4BACCgD,GAAW,EAAA,OAAM,iBAAgB,MAAK,SAAQ,SAASV,GAAoB;AAAA,QAAA,GAC9E;AAAA,MAAA,GAEJ;AAAA,MAGD1C,EAAW,IAAI,CAAC4C,GAAWS,MAAQ;AAC5B,cAAA,EAAE,IAAIC,EAAgB,IAAAV;AAG1B,eAAA,gBAAAE,EAACS,EAAM,UAAN,EACC,UAAA;AAAA,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,WAAAZ;AAAA,cACA,WAAA3C;AAAA,cACA,aAAA4B;AAAA,cACA,YAAAE;AAAA,cACA,aAAAD;AAAA,cACA,UAAAE;AAAA,cACA,cAAAvB;AAAA,cACA,gBAAAC;AAAA,cACA,mBAAmByB,KAAqBC;AAAA,cACxC,eAAAlC;AAAA,cACA,QAAAY;AAAA,cACA,uBAAAC;AAAA,cACA,cAAAP;AAAA,cACA,UAAAI;AAAA,cACA,gBAAAC;AAAA,cACA,gBAAAR;AAAA,cACA,kBAAAE;AAAA,cACA,mBAAAe;AAAA,cACA,eAAAN;AAAA,cACA,YAAAC;AAAA,cACA,cAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,aAAAC;AAAA,cACA,gBAAAC;AAAA,cACA,wBAAAa;AAAA,cACA,eAAAX;AAAA,cACA,cAAAC;AAAA,cACA,aAAAC;AAAA,cACA,cAAAQ;AAAA,cACA,mBAAAP;AAAA,cACA,aAAAC;AAAA,cACA,sBAAAC;AAAA,YAAA;AAAA,UACF;AAAA,UACCyB,MAAQrD,EAAW,SAAS,KAAM,gBAAAgD,EAAAS,IAAA,EAAU,SAAS,GAAG;AAAA,QAnCtC,EAAA,GAAA,aAAaH,CAAW,EAoC7C;AAAA,MAAA,CAEH;AAAA,IACH,EAAA,CAAA;AAAA,EAEJ;AACF;"}
1
+ {"version":3,"file":"milestone-list.js","sources":["../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-list.tsx"],"sourcesContent":["import type { IMilestoneListProps } from './milestone-list-types';\n\nimport React, { memo, useCallback } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport useLazyRef from '../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport MilestoneWidget from './milestone-widget/milestone-widget';\nimport NoActiveMilestone from './no-active-milestone/no-active-milestone';\n\nconst MilestoneList: React.FC<IMilestoneListProps> = memo(\n ({ milestones, studentId, milestoneType, ...restMilestoneListProps }) => {\n const {\n canCreatePlan,\n isClassOngoing,\n isFiltersAdded,\n isStudentPresent,\n onAddChapter,\n onAddOutcome,\n onChapterClick,\n onCreatePlan,\n onDelete,\n onDraftPublish,\n onEdit,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onAssignResources,\n onTestPreview,\n onTestReview,\n onTestStart,\n activeMilestoneId,\n activeTabId,\n onWidgetTabSelection,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n onNodeAssignAsHomework,\n } = restMilestoneListProps;\n\n const isMilestoneActive = milestoneType === 'ACTIVE';\n const isDraftMilestone = milestoneType === 'DRAFT';\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const handleOnAddOutcome = useCallback(() => {\n onAddOutcome?.();\n }, [onAddOutcome]);\n\n if (!milestones) return null;\n\n const activeMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'ACTIVE',\n );\n const draftMilestonePresent = milestones.some(\n milestone => milestone.milestone_state === 'DRAFT',\n );\n\n return (\n <>\n {isMilestoneActive && !activeMilestonePresent && (\n <FlexView $marginBottom={40}>\n <NoActiveMilestone\n canCreatePlan={canCreatePlan}\n isDraftMilestonePresent={draftMilestonePresent}\n isFiltersAdded={isFiltersAdded}\n onCreatePlan={onCreatePlan}\n studentName={studentName}\n userType={userType}\n />\n </FlexView>\n )}\n\n {isMilestoneActive && (\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $marginBottom={16}>\n <Text $renderAs=\"ac4\">Goals ({milestones.length})</Text>\n\n {userType === 'TEACHER' && (\n <FlexView $flexDirection=\"row\" $flexGapX={1}>\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <TextButton\n label=\"Create Goal\"\n size=\"small\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n <TextButton label=\"Add Milestone\" size=\"small\" onClick={handleOnAddOutcome} />\n </FlexView>\n )}\n </FlexView>\n )}\n\n {milestones.map((milestone, idx) => {\n const { id: milestoneId } = milestone;\n\n return (\n <React.Fragment key={`milestone=${milestoneId}`}>\n <MilestoneWidget\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n parentName={parentName}\n teacherName={teacherName}\n userType={userType}\n onAddOutcome={onAddOutcome}\n onChapterClick={onChapterClick}\n isMilestoneActive={isMilestoneActive || isDraftMilestone}\n milestoneType={milestoneType}\n onEdit={onEdit}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onAddChapter={onAddChapter}\n onDelete={onDelete}\n onDraftPublish={onDraftPublish}\n isClassOngoing={isClassOngoing}\n isStudentPresent={isStudentPresent}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onTestPreview={onTestPreview}\n onTestReview={onTestReview}\n onTestStart={onTestStart}\n courseStream={courseStream}\n activeMilestoneId={activeMilestoneId}\n activeTabId={activeTabId}\n onWidgetTabSelection={onWidgetTabSelection}\n />\n {idx !== milestones.length - 1 && <Separator heightX={2} />}\n </React.Fragment>\n );\n })}\n </>\n );\n },\n);\n\nexport default MilestoneList;\n"],"names":["MilestoneList","memo","milestones","studentId","milestoneType","restMilestoneListProps","canCreatePlan","isClassOngoing","isFiltersAdded","isStudentPresent","onAddChapter","onAddOutcome","onChapterClick","onCreatePlan","onDelete","onDraftPublish","onEdit","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onAssignResources","onTestPreview","onTestReview","onTestStart","activeMilestoneId","activeTabId","onWidgetTabSelection","studentName","teacherName","parentName","userType","courseStream","onNodeAssignAsHomework","isMilestoneActive","isDraftMilestone","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","handleOnAddOutcome","activeMilestonePresent","milestone","draftMilestonePresent","jsxs","Fragment","jsx","FlexView","NoActiveMilestone","Text","ArrowTooltip","TextButton","idx","milestoneId","React","MilestoneWidget","Separator"],"mappings":";;;;;;;;;;;AAcA,MAAMA,KAA+CC;AAAA,EACnD,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,eAAAC,GAAe,GAAGC,QAA6B;AACjE,UAAA;AAAA,MACJ,eAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,mBAAAC;A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,MAAQtD,EAAW,SAAS,KAAM,gBAAAgD,EAAAU,IAAA,EAAU,SAAS,GAAG;AAAA,QAnCtC,EAAA,GAAA,aAAaH,CAAW,EAoC7C;AAAA,MAAA,CAEH;AAAA,IACH,EAAA,CAAA;AAAA,EAEJ;AACF;"}
@@ -1,28 +1,29 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import { memo as f, useCallback as h } from "react";
3
3
  import $ from "styled-components";
4
- import { ILLUSTRATIONS as u } from "../../../../../assets/illustrations/illustrations.js";
5
- import b from "../../../../hooks/use-lazy-ref.js";
6
- import g from "../../../../ui/buttons/button/button.js";
7
- import x from "../../../../ui/image/image.js";
8
- import a from "../../../../ui/layout/flex-view.js";
9
- import { getNoMilestoneTitle as w } from "../../../create/utils/index.js";
10
- import { StyledText as A } from "./no-active-milestone-styled.js";
11
- import L from "../../../../../node_modules/uuid/dist/esm-browser/v4.js";
12
- const T = $.span`
13
- display: ${({ shouldShow: e }) => e ? "block" : "none"};
14
- `, U = f(
15
- ({ userType: e, studentName: m, isDraftMilestonePresent: t, ...s }) => {
16
- const { canCreatePlan: d, onCreatePlan: o, isFiltersAdded: l } = s, i = b(L), c = h(() => {
17
- o == null || o(i);
18
- }, [o, i]), p = w(
4
+ import { ILLUSTRATIONS as b } from "../../../../../assets/illustrations/illustrations.js";
5
+ import u from "../../../../hooks/use-lazy-ref.js";
6
+ import w from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
7
+ import A from "../../../../ui/buttons/button/button.js";
8
+ import g from "../../../../ui/image/image.js";
9
+ import d from "../../../../ui/layout/flex-view.js";
10
+ import { getNoMilestoneTitle as x } from "../../../create/utils/index.js";
11
+ import { StyledText as y } from "./no-active-milestone-styled.js";
12
+ import T from "../../../../../node_modules/uuid/dist/esm-browser/v4.js";
13
+ const I = $.span`
14
+ display: ${({ shouldShow: o }) => o ? "block" : "none"};
15
+ `, W = f(
16
+ ({ userType: o, studentName: s, isDraftMilestonePresent: r, ...m }) => {
17
+ const { canCreatePlan: i, onCreatePlan: t, isFiltersAdded: l } = m, n = u(T), p = h(() => {
18
+ t == null || t(n);
19
+ }, [t, n]), c = x(
19
20
  l,
20
- t,
21
- m,
22
- e
21
+ r,
22
+ s,
23
+ o
23
24
  );
24
- return /* @__PURE__ */ n(
25
- a,
25
+ return /* @__PURE__ */ a(
26
+ d,
26
27
  {
27
28
  $flexDirection: "row",
28
29
  $gapX: 1.5,
@@ -33,26 +34,35 @@ const T = $.span`
33
34
  $justifyContent: "space-between",
34
35
  $alignItems: "center",
35
36
  children: [
36
- /* @__PURE__ */ n(a, { $flexGapX: 1, children: [
37
- /* @__PURE__ */ r(A, { $renderAs: "ab2", $widthX: 19.5, children: p }),
38
- e === "TEACHER" && /* @__PURE__ */ r(T, { shouldShow: !l, children: !t && /* @__PURE__ */ r(
39
- g,
37
+ /* @__PURE__ */ a(d, { $flexGapX: 1, children: [
38
+ /* @__PURE__ */ e(y, { $renderAs: "ab2", $widthX: 19.5, children: c }),
39
+ o === "TEACHER" && /* @__PURE__ */ e(I, { shouldShow: !l, children: !r && /* @__PURE__ */ e(
40
+ w,
40
41
  {
41
- renderAs: "secondary",
42
- size: "small",
43
- label: "Add a Goal",
44
- onClick: c,
45
- disabled: !d
42
+ renderAs: "primary",
43
+ tooltipItem: "Goals can only be added for students who have joined the class",
44
+ hidden: i,
45
+ position: "bottom",
46
+ children: /* @__PURE__ */ e(
47
+ A,
48
+ {
49
+ renderAs: "secondary",
50
+ size: "small",
51
+ label: "Add a Goal",
52
+ onClick: p,
53
+ disabled: !i
54
+ }
55
+ )
46
56
  }
47
57
  ) })
48
58
  ] }),
49
- /* @__PURE__ */ r(
50
- x,
59
+ /* @__PURE__ */ e(
60
+ g,
51
61
  {
52
62
  withLoader: !1,
53
63
  width: 240,
54
64
  height: 100,
55
- src: u.PUZZLE_STUDENT,
65
+ src: b.PUZZLE_STUDENT,
56
66
  alt: "learning-planner"
57
67
  }
58
68
  )
@@ -62,6 +72,6 @@ const T = $.span`
62
72
  }
63
73
  );
64
74
  export {
65
- U as default
75
+ W as default
66
76
  };
67
77
  //# sourceMappingURL=no-active-milestone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-active-milestone.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.tsx"],"sourcesContent":["import type { INoActiveMilestoneProps } from './no-active-milestone-types';\n\nimport { useCallback, type FC, memo } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport useLazyRef from '../../../../hooks/use-lazy-ref';\nimport Button from '../../../../ui/buttons/button/button';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { getNoMilestoneTitle } from '../../../create/utils';\nimport * as Styled from './no-active-milestone-styled';\n\nconst ButtonWrapper = styled.span<{ shouldShow: boolean }>`\n display: ${({ shouldShow }) => (shouldShow ? 'block' : 'none')};\n`;\n\nconst NoActiveMilestone: FC<INoActiveMilestoneProps> = memo(\n ({ userType, studentName, isDraftMilestonePresent, ...restNoActiveMilestoneProps }) => {\n const { canCreatePlan, onCreatePlan, isFiltersAdded } = restNoActiveMilestoneProps;\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const title = getNoMilestoneTitle(\n isFiltersAdded,\n isDraftMilestonePresent,\n studentName,\n userType,\n );\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $gapX={1.5}\n $gutterX={1.5}\n $borderColor=\"WHITE_4\"\n $background=\"YELLOW_1\"\n $flexGapX={1}\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <FlexView $flexGapX={1}>\n <Styled.StyledText $renderAs=\"ab2\" $widthX={19.5}>\n {title}\n </Styled.StyledText>\n\n {userType === 'TEACHER' && (\n <ButtonWrapper shouldShow={!isFiltersAdded}>\n {!isDraftMilestonePresent && (\n <Button\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Add a Goal\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n )}\n </ButtonWrapper>\n )}\n </FlexView>\n\n <Image\n withLoader={false}\n width={240}\n height={100}\n src={ILLUSTRATIONS.PUZZLE_STUDENT}\n alt=\"learning-planner\"\n />\n </FlexView>\n );\n },\n);\n\nexport default NoActiveMilestone;\n"],"names":["ButtonWrapper","styled","shouldShow","NoActiveMilestone","memo","userType","studentName","isDraftMilestonePresent","restNoActiveMilestoneProps","canCreatePlan","onCreatePlan","isFiltersAdded","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","title","getNoMilestoneTitle","jsxs","FlexView","jsx","Styled.StyledText","Button","Image","ILLUSTRATIONS"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAAgBC,EAAO;AAAA,aAChB,CAAC,EAAE,YAAAC,EAAA,MAAkBA,IAAa,UAAU,MAAO;AAAA,GAG1DC,IAAiDC;AAAA,EACrD,CAAC,EAAE,UAAAC,GAAU,aAAAC,GAAa,yBAAAC,GAAyB,GAAGC,QAAiC;AACrF,UAAM,EAAE,eAAAC,GAAe,cAAAC,GAAc,gBAAAC,EAAA,IAAmBH,GAClDI,IAAuBC,EAAWC,CAAM,GAExCC,IAAmBC,EAAY,MAAM;AACzC,MAAAN,KAAA,QAAAA,EAAeE;AAAA,IAAoB,GAClC,CAACF,GAAcE,CAAoB,CAAC,GAEjCK,IAAQC;AAAA,MACZP;AAAA,MACAJ;AAAA,MACAD;AAAA,MACAD;AAAA,IAAA;AAIA,WAAA,gBAAAc;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,gBAAe;AAAA,QACf,OAAO;AAAA,QACP,UAAU;AAAA,QACV,cAAa;AAAA,QACb,aAAY;AAAA,QACZ,WAAW;AAAA,QACX,iBAAgB;AAAA,QAChB,aAAY;AAAA,QAEZ,UAAA;AAAA,UAAC,gBAAAD,EAAAC,GAAA,EAAS,WAAW,GACnB,UAAA;AAAA,YAAA,gBAAAC,EAACC,GAAA,EAAkB,WAAU,OAAM,SAAS,MACzC,UACHL,GAAA;AAAA,YAECZ,MAAa,aACX,gBAAAgB,EAAArB,GAAA,EAAc,YAAY,CAACW,GACzB,WAACJ,KACA,gBAAAc;AAAA,cAACE;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,SAASR;AAAA,gBACT,UAAU,CAACN;AAAA,cAAA;AAAA,YAAA,GAGjB;AAAA,UAAA,GAEJ;AAAA,UAEA,gBAAAY;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,YAAY;AAAA,cACZ,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,KAAKC,EAAc;AAAA,cACnB,KAAI;AAAA,YAAA;AAAA,UACN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"no-active-milestone.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/no-active-milestone/no-active-milestone.tsx"],"sourcesContent":["import type { INoActiveMilestoneProps } from './no-active-milestone-types';\n\nimport { useCallback, type FC, memo } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport useLazyRef from '../../../../hooks/use-lazy-ref';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Button from '../../../../ui/buttons/button/button';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { getNoMilestoneTitle } from '../../../create/utils';\nimport * as Styled from './no-active-milestone-styled';\n\nconst ButtonWrapper = styled.span<{ shouldShow: boolean }>`\n display: ${({ shouldShow }) => (shouldShow ? 'block' : 'none')};\n`;\n\nconst NoActiveMilestone: FC<INoActiveMilestoneProps> = memo(\n ({ userType, studentName, isDraftMilestonePresent, ...restNoActiveMilestoneProps }) => {\n const { canCreatePlan, onCreatePlan, isFiltersAdded } = restNoActiveMilestoneProps;\n const temporaryMilestoneId = useLazyRef(uuidv4);\n\n const handleCreatePlan = useCallback(() => {\n onCreatePlan?.(temporaryMilestoneId);\n }, [onCreatePlan, temporaryMilestoneId]);\n\n const title = getNoMilestoneTitle(\n isFiltersAdded,\n isDraftMilestonePresent,\n studentName,\n userType,\n );\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $gapX={1.5}\n $gutterX={1.5}\n $borderColor=\"WHITE_4\"\n $background=\"YELLOW_1\"\n $flexGapX={1}\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n >\n <FlexView $flexGapX={1}>\n <Styled.StyledText $renderAs=\"ab2\" $widthX={19.5}>\n {title}\n </Styled.StyledText>\n\n {userType === 'TEACHER' && (\n <ButtonWrapper shouldShow={!isFiltersAdded}>\n {!isDraftMilestonePresent && (\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem=\"Goals can only be added for students who have joined the class\"\n hidden={canCreatePlan}\n position=\"bottom\"\n >\n <Button\n renderAs=\"secondary\"\n size=\"small\"\n label=\"Add a Goal\"\n onClick={handleCreatePlan}\n disabled={!canCreatePlan}\n />\n </ArrowTooltip>\n )}\n </ButtonWrapper>\n )}\n </FlexView>\n\n <Image\n withLoader={false}\n width={240}\n height={100}\n src={ILLUSTRATIONS.PUZZLE_STUDENT}\n alt=\"learning-planner\"\n />\n </FlexView>\n );\n },\n);\n\nexport default NoActiveMilestone;\n"],"names":["ButtonWrapper","styled","shouldShow","NoActiveMilestone","memo","userType","studentName","isDraftMilestonePresent","restNoActiveMilestoneProps","canCreatePlan","onCreatePlan","isFiltersAdded","temporaryMilestoneId","useLazyRef","uuidv4","handleCreatePlan","useCallback","title","getNoMilestoneTitle","jsxs","FlexView","jsx","Styled.StyledText","ArrowTooltip","Button","Image","ILLUSTRATIONS"],"mappings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AA,GAEJ;AAAA,UAEA,gBAAAY;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,YAAY;AAAA,cACZ,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,KAAKC,EAAc;AAAA,cACnB,KAAI;AAAA,YAAA;AAAA,UACN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -1,48 +1,51 @@
1
- import { jsxs as k, jsx as C } from "react/jsx-runtime";
2
- import { memo as E, useState as a, useCallback as M, useMemo as x, useEffect as u } from "react";
3
- import y from "./modal.js";
4
- import I from "./modal-context.js";
5
- import { lockScroll as S, unlockScroll as h } from "./modal-helpers.js";
6
- const D = 500, T = E(({ children: w, modals: d, isUserAuthenticated: t }) => {
7
- const [o, c] = a(null), [f, v] = a(void 0), [s, r] = a(!1), m = M(
8
- (n, l) => {
9
- const i = d.find((P) => P.name === n);
10
- if (!i)
11
- throw new Error(`Modal with name "${n}" not found`);
12
- if (i.isPrivate && !t)
1
+ import { jsxs as x, jsx as y } from "react/jsx-runtime";
2
+ import { memo as D, useState as d, useRef as I, useCallback as f, useMemo as S, useEffect as w } from "react";
3
+ import b from "./modal.js";
4
+ import h from "./modal-context.js";
5
+ import { lockScroll as R, unlockScroll as T } from "./modal-helpers.js";
6
+ const $ = 500, g = D(({ children: p, modals: u, isUserAuthenticated: t }) => {
7
+ const [o, M] = d(null), [m, C] = d(void 0), [r, i] = d(!1), l = I(void 0), v = f(
8
+ (e, s, P) => {
9
+ const c = u.find((E) => E.name === e);
10
+ if (!c)
11
+ throw new Error(`Modal with name "${e}" not found`);
12
+ if (c.isPrivate && !t)
13
13
  throw new Error(
14
- `Access violation: Modal "${n}" is private and user is not authenticated`
14
+ `Access violation: Modal "${e}" is private and user is not authenticated`
15
15
  );
16
- r(!1), c(i), v(l), S();
16
+ l.current = P, i(!1), M(c), C(s), R();
17
17
  },
18
- [t, d]
19
- ), e = M(() => {
20
- r(!0), h(), setTimeout(() => {
21
- c(null), r(!1);
22
- }, D);
23
- }, []), p = x(
18
+ [t, u]
19
+ ), n = f(() => {
20
+ i(!0), T(), setTimeout(() => {
21
+ M(null), i(!1);
22
+ }, $);
23
+ }, []), k = S(
24
24
  () => ({
25
25
  modal: o,
26
- modalParams: f,
27
- openModal: m,
28
- closeModal: e,
29
- isClosing: s
26
+ modalParams: m,
27
+ openModal: v,
28
+ closeModal: n,
29
+ isClosing: r
30
30
  }),
31
- [o, f, m, e, s]
32
- );
33
- return u(() => {
34
- !t && (o != null && o.isPrivate) && e();
35
- }, [t, o, e]), u(() => {
36
- const n = (l) => {
37
- l.key === "Escape" && (o == null ? void 0 : o.isDismissable) !== !1 && !s && e();
31
+ [o, m, v, n, r]
32
+ ), a = f(() => {
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));
35
+ }, [o, n, r]);
36
+ return w(() => {
37
+ !t && (o != null && o.isPrivate) && n();
38
+ }, [t, o, n]), w(() => {
39
+ const e = (s) => {
40
+ s.key === "Escape" && a();
38
41
  };
39
- return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
40
- }, [o, e, s]), /* @__PURE__ */ k(I.Provider, { value: p, children: [
41
- w,
42
- o && /* @__PURE__ */ C(y, { modal: o, isClosing: s, onClose: e })
42
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
43
+ }, [a]), /* @__PURE__ */ x(h.Provider, { value: k, children: [
44
+ p,
45
+ o && /* @__PURE__ */ y(b, { modal: o, isClosing: r, onClose: a })
43
46
  ] });
44
- }), O = T;
47
+ }), K = g;
45
48
  export {
46
- O as default
49
+ K as default
47
50
  };
48
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, IModalContext, IModalProviderProps } from './modal-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, 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\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) => {\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 setIsClosing(false);\n setModal(newModal);\n setModalParams(newModalParams as unknown as Record<string, unknown> | undefined);\n lockScroll(); // Lock scroll while preserving scrollbar width\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 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' && modal?.isDismissable !== false && !isClosing) {\n closeModal();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [modal, closeModal, isClosing]);\n\n return (\n <ModalContext.Provider value={modalContent}>\n {children}\n {modal && <Modal modal={modal} isClosing={isClosing} onClose={closeModal} />}\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","openModal","useCallback","modalName","newModalParams","newModal","m","lockScroll","closeModal","unlockScroll","modalContent","useMemo","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,GAM1CK,IAAYC;AAAA,IAChB,CAACC,GAAWC,MAAmB;AAC7B,YAAMC,IAAWb,EAAO,KAAK,CAAKc,MAAAA,EAAE,SAASH,CAAS;AAEtD,UAAI,CAACE;AACH,cAAM,IAAI,MAAM,oBAAoBF,CAAS,aAAa;AAGxD,UAAAE,EAAS,aAAa,CAACZ;AACzB,cAAM,IAAI;AAAA,UACR,4BAA4BU,CAAS;AAAA,QAAA;AAIzC,MAAAH,EAAa,EAAK,GAClBL,EAASU,CAAQ,GACjBP,EAAeM,CAAgE,GACpEG;IACb;AAAA,IACA,CAACd,GAAqBD,CAAM;AAAA,EAAA,GAGxBgB,IAAaN,EAAY,MAAM;AACnC,IAAAF,EAAa,EAAI,GAEJS,KACb,WAAW,MAAM;AACf,MAAAd,EAAS,IAAI,GACbK,EAAa,EAAK;AAAA,OACjBZ,CAAqB;AAAA,EAC1B,GAAG,CAAE,CAAA,GAECsB,IAAeC;AAAA,IACnB,OAAO;AAAA,MACL,OAAAjB;AAAA,MACA,aAAAG;AAAA,MACA,WAAAI;AAAA,MACA,YAAAO;AAAA,MACA,WAAAT;AAAA,IAAA;AAAA,IAEF,CAACL,GAAOG,GAAaI,GAAWO,GAAYT,CAAS;AAAA,EAAA;AAGvD,SAAAa,EAAU,MAAM;AACV,IAAA,CAACnB,MAAuBC,KAAA,QAAAA,EAAO,cAEtBc;EAEZ,GAAA,CAACf,GAAqBC,GAAOc,CAAU,CAAC,GAG3CI,EAAU,MAAM;AACR,UAAAC,IAAgB,CAACC,MAAqB;AAC1C,MAAIA,EAAE,QAAQ,aAAYpB,KAAA,gBAAAA,EAAO,mBAAkB,MAAS,CAACK,KAChDS;IACb;AAGK,kBAAA,iBAAiB,WAAWK,CAAa,GAEzC,MAAM,OAAO,oBAAoB,WAAWA,CAAa;AAAA,EAC/D,GAAA,CAACnB,GAAOc,GAAYT,CAAS,CAAC,GAG9B,gBAAAgB,EAAAC,EAAa,UAAb,EAAsB,OAAON,GAC3B,UAAA;AAAA,IAAAnB;AAAA,IACAG,KAAU,gBAAAuB,EAAAC,GAAA,EAAM,OAAAxB,GAAc,WAAAK,GAAsB,SAASS,GAAY;AAAA,EAC5E,EAAA,CAAA;AAEJ,CAAC,GAEDW,IAAe9B;"}
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 lockScroll(); // Lock scroll while preserving scrollbar width\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,GACpEI;IACb;AAAA,IACA,CAACjB,GAAqBD,CAAM;AAAA,EAAA,GAGxBmB,IAAaP,EAAY,MAAM;AACnC,IAAAJ,EAAa,EAAI,GAEJY,KACb,WAAW,MAAM;AACf,MAAAjB,EAAS,IAAI,GACbK,EAAa,EAAK;AAAA,OACjBZ,CAAqB;AAAA,EAC1B,GAAG,CAAE,CAAA,GAECyB,IAAeC;AAAA,IACnB,OAAO;AAAA,MACL,OAAApB;AAAA,MACA,aAAAG;AAAA,MACA,WAAAM;AAAA,MACA,YAAAQ;AAAA,MACA,WAAAZ;AAAA,IAAA;AAAA,IAEF,CAACL,GAAOG,GAAaM,GAAWQ,GAAYZ,CAAS;AAAA,EAAA,GAGjDgB,IAAiBX,EAAY,MAAM;;AACvC,KAAIV,KAAA,gBAAAA,EAAO,mBAAkB,MAAS,CAACK,MAC1BY,KACPV,EAAa,aACfe,KAAAC,IAAAhB,EAAa,SAAQ,iBAArB,QAAAe,EAAA,KAAAC,IACAhB,EAAa,QAAQ,eAAe;AAAA,EAGvC,GAAA,CAACP,GAAOiB,GAAYZ,CAAS,CAAC;AAEjC,SAAAmB,EAAU,MAAM;AACV,IAAA,CAACzB,MAAuBC,KAAA,QAAAA,EAAO,cAEtBiB;EAEZ,GAAA,CAAClB,GAAqBC,GAAOiB,CAAU,CAAC,GAG3CO,EAAU,MAAM;AACR,UAAAC,IAAgB,CAACC,MAAqB;AACtC,MAAAA,EAAE,QAAQ,YACGL;IACjB;AAGK,kBAAA,iBAAiB,WAAWI,CAAa,GAEzC,MAAM,OAAO,oBAAoB,WAAWA,CAAa;AAAA,EAAA,GAC/D,CAACJ,CAAc,CAAC,GAGhB,gBAAAM,EAAAC,EAAa,UAAb,EAAsB,OAAOT,GAC3B,UAAA;AAAA,IAAAtB;AAAA,IACAG,KAAU,gBAAA6B,EAAAC,GAAA,EAAM,OAAA9B,GAAc,WAAAK,GAAsB,SAASgB,GAAgB;AAAA,EAChF,EAAA,CAAA;AAEJ,CAAC,GAEDU,IAAepC;"}
@@ -1,6 +1,6 @@
1
1
  import o from "styled-components";
2
2
  const s = o.div(
3
- ({ theme: { colors: a }, $isClosing: t }) => `
3
+ ({ theme: { colors: a, zIndex: t }, $isClosing: i }) => `
4
4
  position: fixed;
5
5
  top: 0;
6
6
  left: 0;
@@ -9,8 +9,9 @@ const s = o.div(
9
9
  background-color: ${a.BLACK_T_60};
10
10
  backdrop-filter: blur(40px);
11
11
  display: flex;
12
- animation: ${t ? "backdropFadeOut" : "backdropFadeIn"} 0.2s ease-out forwards;
13
-
12
+ animation: ${i ? "backdropFadeOut" : "backdropFadeIn"} 0.2s ease-out forwards;
13
+ z-index: ${t.MODAL};
14
+
14
15
  @keyframes backdropFadeIn {
15
16
  from {
16
17
  opacity: 0;
@@ -1 +1 @@
1
- {"version":3,"file":"modal-styled.js","sources":["../../../../src/features/ui/modals/modal-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nconst ModalContainer = styled.div<{ $isClosing?: boolean }>(\n ({ theme: { colors }, $isClosing }) => `\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ${colors.BLACK_T_60};\n backdrop-filter: blur(40px);\n display: flex;\n animation: ${$isClosing ? 'backdropFadeOut' : 'backdropFadeIn'} 0.2s ease-out forwards;\n \n @keyframes backdropFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n \n @keyframes backdropFadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n`,\n);\n\n/**\n * Base modal container with customizable width and animation state\n */\nconst BaseModal = styled.div<{\n $isClosing?: boolean;\n $width: string;\n}>(\n ({ theme: { colors }, $isClosing, $width }) => `\n position: relative;\n align-self: center;\n margin: 0 auto;\n width: ${$width};\n background-color: ${colors.WHITE_1};\n border: 1px solid ${colors.BLACK_1};\n transform-origin: center center;\n animation: ${\n $isClosing ? 'modalDisappear' : 'modalAppear'\n } 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.20);\n \n /* Responsive behavior for smaller screens */\n @media (max-width: calc(${$width} + 80px)) {\n width: 100%;\n max-width: 100%;\n height: 100%;\n max-height: 100%;\n border: none;\n }\n \n @keyframes modalAppear {\n 0% {\n opacity: 0;\n transform: perspective(1200px) translateZ(-50px) translateY(10px) scale(0.98);\n }\n 100% {\n opacity: 1;\n transform: perspective(1200px) translateZ(0) translateY(0) scale(1);\n }\n }\n \n @keyframes modalDisappear {\n 0% {\n opacity: 1;\n transform: perspective(1200px) translateZ(0) translateY(0) scale(1);\n }\n 100% {\n opacity: 0;\n transform: perspective(1200px) translateZ(-50px) translateY(10px) scale(0.98);\n }\n }\n`,\n);\n\n/**\n * Scrollable content container inside the modal\n */\nconst BaseModalContent = styled.div<{ $modalWidth: string }>(\n ({ $modalWidth }) => `\n max-height: calc(100vh - 142px);\n overflow-y: auto;\n\n @media (max-width: calc(${$modalWidth} + 80px)) {\n max-height: 100vh;\n }\n}`,\n);\n\n/**\n * Container for the close button with responsive positioning\n */\nconst CloseButtonContainer = styled.div<{ $modalWidth: string }>(\n ({ theme: { colors }, $modalWidth }) => `\n position: absolute;\n top: -56px;\n right: -40px;\n color: ${colors.WHITE_1};\n transition: all 0.2s ease;\n \n &:hover {\n transform: scale(1.05);\n }\n\n @media (max-width: calc(${$modalWidth} + 80px)) {\n top: 16px;\n right: 16px;\n color: ${colors.BLACK_1};\n }\n`,\n);\n\nconst spotlightWidth = 720;\nconst spotlightAnimationStartDuration = 800;\nconst spotlightAnimationEndDuration = 500;\n\nconst SpotlightModal = styled.div<{\n $isClosing?: boolean;\n}>(\n ({ $isClosing }) => `\n position: absolute;\n width: ${spotlightWidth}px;\n height: 100%;\n left: 50%;\n margin-left: ${-(spotlightWidth / 2)}px;\n clip-path: polygon(calc(50% - 100px) 0, calc(50% + 100px) 0, 100% 100%, 0 100%);\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 1) 0%,\n rgba(0, 0, 0, 0) 100%\n );\n animation: openSpotlight;\n animation-duration: ${spotlightAnimationStartDuration}ms;\n animation-timing-function: linear;\n animation-fill-mode: forwards;\n opacity: 0;\n ${\n $isClosing\n ? `\n animation: closeSpotlight;\n animation-duration: ${spotlightAnimationEndDuration}ms;\n animation-timing-function: linear;\n animation-fill-mode: forwards;\n opacity: 1;\n `\n : ''\n }\n\n @keyframes openSpotlight {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes closeSpotlight {\n from {\n transform: rotateY(0);\n }\n to {\n transform: rotateY(90deg);\n }\n }\n`,\n);\n\nexport { ModalContainer, BaseModal, BaseModalContent, CloseButtonContainer, SpotlightModal };\n"],"names":["ModalContainer","styled","colors","$isClosing","BaseModal","$width","BaseModalContent","$modalWidth","CloseButtonContainer","spotlightWidth","spotlightAnimationStartDuration","spotlightAnimationEndDuration","SpotlightModal"],"mappings":";AAEA,MAAMA,IAAiBC,EAAO;AAAA,EAC5B,CAAC,EAAE,OAAO,EAAE,QAAAC,EAAO,GAAG,YAAAC,EAAiB,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMnBD,EAAO,UAAU;AAAA;AAAA;AAAA,eAGxBC,IAAa,oBAAoB,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBhE,GAKMC,IAAYH,EAAO;AAAA,EAIvB,CAAC,EAAE,OAAO,EAAE,QAAAC,EAAU,GAAA,YAAAC,GAAY,QAAAE,QAAa;AAAA;AAAA;AAAA;AAAA,WAItCA,CAAM;AAAA,sBACKH,EAAO,OAAO;AAAA,sBACdA,EAAO,OAAO;AAAA;AAAA,eAGhCC,IAAa,mBAAmB,aAClC;AAAA;AAAA;AAAA;AAAA,4BAI0BE,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BlC,GAKMC,IAAmBL,EAAO;AAAA,EAC9B,CAAC,EAAE,aAAAM,EAAA,MAAkB;AAAA;AAAA;AAAA;AAAA,4BAIKA,CAAW;AAAA;AAAA;AAAA;AAIvC,GAKMC,IAAuBP,EAAO;AAAA,EAClC,CAAC,EAAE,OAAO,EAAE,QAAAC,EAAO,GAAG,aAAAK,EAAkB,MAAA;AAAA;AAAA;AAAA;AAAA,WAI/BL,EAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAOGK,CAAW;AAAA;AAAA;AAAA,aAG1BL,EAAO,OAAO;AAAA;AAAA;AAG3B,GAEMO,IAAiB,KACjBC,IAAkC,KAClCC,IAAgC,KAEhCC,IAAiBX,EAAO;AAAA,EAG5B,CAAC,EAAE,YAAAE,EAAA,MAAiB;AAAA;AAAA,WAEXM,CAAc;AAAA;AAAA;AAAA,iBAGR,EAAEA,IAAiB,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQdC,CAA+B;AAAA;AAAA;AAAA;AAAA,IAKnDP,IACI;AAAA;AAAA,4BAEoBQ,CAA6B;AAAA;AAAA;AAAA;AAAA,QAKjD,EACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBF;"}
1
+ {"version":3,"file":"modal-styled.js","sources":["../../../../src/features/ui/modals/modal-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nconst ModalContainer = styled.div<{ $isClosing?: boolean }>(\n ({ theme: { colors, zIndex }, $isClosing }) => `\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ${colors.BLACK_T_60};\n backdrop-filter: blur(40px);\n display: flex;\n animation: ${$isClosing ? 'backdropFadeOut' : 'backdropFadeIn'} 0.2s ease-out forwards;\n z-index: ${zIndex.MODAL};\n\n @keyframes backdropFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n \n @keyframes backdropFadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n`,\n);\n\n/**\n * Base modal container with customizable width and animation state\n */\nconst BaseModal = styled.div<{\n $isClosing?: boolean;\n $width: string;\n}>(\n ({ theme: { colors }, $isClosing, $width }) => `\n position: relative;\n align-self: center;\n margin: 0 auto;\n width: ${$width};\n background-color: ${colors.WHITE_1};\n border: 1px solid ${colors.BLACK_1};\n transform-origin: center center;\n animation: ${\n $isClosing ? 'modalDisappear' : 'modalAppear'\n } 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.20);\n \n /* Responsive behavior for smaller screens */\n @media (max-width: calc(${$width} + 80px)) {\n width: 100%;\n max-width: 100%;\n height: 100%;\n max-height: 100%;\n border: none;\n }\n \n @keyframes modalAppear {\n 0% {\n opacity: 0;\n transform: perspective(1200px) translateZ(-50px) translateY(10px) scale(0.98);\n }\n 100% {\n opacity: 1;\n transform: perspective(1200px) translateZ(0) translateY(0) scale(1);\n }\n }\n \n @keyframes modalDisappear {\n 0% {\n opacity: 1;\n transform: perspective(1200px) translateZ(0) translateY(0) scale(1);\n }\n 100% {\n opacity: 0;\n transform: perspective(1200px) translateZ(-50px) translateY(10px) scale(0.98);\n }\n }\n`,\n);\n\n/**\n * Scrollable content container inside the modal\n */\nconst BaseModalContent = styled.div<{ $modalWidth: string }>(\n ({ $modalWidth }) => `\n max-height: calc(100vh - 142px);\n overflow-y: auto;\n\n @media (max-width: calc(${$modalWidth} + 80px)) {\n max-height: 100vh;\n }\n}`,\n);\n\n/**\n * Container for the close button with responsive positioning\n */\nconst CloseButtonContainer = styled.div<{ $modalWidth: string }>(\n ({ theme: { colors }, $modalWidth }) => `\n position: absolute;\n top: -56px;\n right: -40px;\n color: ${colors.WHITE_1};\n transition: all 0.2s ease;\n \n &:hover {\n transform: scale(1.05);\n }\n\n @media (max-width: calc(${$modalWidth} + 80px)) {\n top: 16px;\n right: 16px;\n color: ${colors.BLACK_1};\n }\n`,\n);\n\nconst spotlightWidth = 720;\nconst spotlightAnimationStartDuration = 800;\nconst spotlightAnimationEndDuration = 500;\n\nconst SpotlightModal = styled.div<{\n $isClosing?: boolean;\n}>(\n ({ $isClosing }) => `\n position: absolute;\n width: ${spotlightWidth}px;\n height: 100%;\n left: 50%;\n margin-left: ${-(spotlightWidth / 2)}px;\n clip-path: polygon(calc(50% - 100px) 0, calc(50% + 100px) 0, 100% 100%, 0 100%);\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 1) 0%,\n rgba(0, 0, 0, 0) 100%\n );\n animation: openSpotlight;\n animation-duration: ${spotlightAnimationStartDuration}ms;\n animation-timing-function: linear;\n animation-fill-mode: forwards;\n opacity: 0;\n ${\n $isClosing\n ? `\n animation: closeSpotlight;\n animation-duration: ${spotlightAnimationEndDuration}ms;\n animation-timing-function: linear;\n animation-fill-mode: forwards;\n opacity: 1;\n `\n : ''\n }\n\n @keyframes openSpotlight {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes closeSpotlight {\n from {\n transform: rotateY(0);\n }\n to {\n transform: rotateY(90deg);\n }\n }\n`,\n);\n\nexport { ModalContainer, BaseModal, BaseModalContent, CloseButtonContainer, SpotlightModal };\n"],"names":["ModalContainer","styled","colors","zIndex","$isClosing","BaseModal","$width","BaseModalContent","$modalWidth","CloseButtonContainer","spotlightWidth","spotlightAnimationStartDuration","spotlightAnimationEndDuration","SpotlightModal"],"mappings":";AAEA,MAAMA,IAAiBC,EAAO;AAAA,EAC5B,CAAC,EAAE,OAAO,EAAE,QAAAC,GAAQ,QAAAC,EAAO,GAAG,YAAAC,QAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAM3BF,EAAO,UAAU;AAAA;AAAA;AAAA,eAGxBE,IAAa,oBAAoB,gBAAgB;AAAA,aACnDD,EAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBzB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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBF;"}
@@ -1,9 +1,9 @@
1
- import { useContext as e } from "react";
2
- import n from "./modal-context.js";
3
- const l = () => {
4
- const { openModal: o, closeModal: t, isClosing: s } = e(n);
5
- return { openModal: o, closeModal: t, isClosing: s };
6
- }, c = l;
1
+ import { useContext as n } from "react";
2
+ import l from "./modal-context.js";
3
+ const a = () => {
4
+ const { openModal: o, closeModal: t, isClosing: s, modal: e } = n(l);
5
+ return { openModal: o, closeModal: t, isClosing: s, modal: e };
6
+ }, c = a;
7
7
  export {
8
8
  c as default
9
9
  };
@@ -1 +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;"}
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, modal } = useContext(ModalContext);\n\n return { openModal, closeModal, isClosing, modal };\n};\n\nexport default useModalActions;\n"],"names":["useModalActions","openModal","closeModal","isClosing","modal","useContext","ModalContext","useModalActions$1"],"mappings":";;AAMA,MAAMA,IAAoC,MAAM;AAC9C,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,WAAAC,GAAW,OAAAC,MAAUC,EAAWC,CAAY;AAE3E,SAAO,EAAE,WAAAL,GAAW,YAAAC,GAAY,WAAAC,GAAW,OAAAC,EAAM;AACnD,GAEAG,IAAeP;"}
@@ -1,42 +1,46 @@
1
- import { useCallback as d } from "react";
2
- import c from "../../../hooks/use-is-unmounted.js";
3
- const m = (s) => {
4
- const r = c();
5
- return { forceAppend: d(
6
- ({ question: t, response: a, callback: o }) => {
7
- const i = JSON.parse(s);
8
- let p = !1;
9
- i.type = "local_practice";
10
- const n = window.LearnosityApp.init(i, {
1
+ import { useCallback as l } from "react";
2
+ import m from "../../../hooks/use-is-unmounted.js";
3
+ const L = (i) => {
4
+ const t = m();
5
+ return { forceAppend: l(
6
+ ({ question: o, response: u, removeOldElements: a, callback: p }) => {
7
+ const c = JSON.parse(i), r = document.querySelector(`.learnosity-response.question-${o.response_id}`), s = r == null ? void 0 : r.parentNode;
8
+ let d = !1;
9
+ c.type = "local_practice";
10
+ const n = window.LearnosityApp.init(c, {
11
11
  readyListener: () => {
12
- if (!r.current) {
13
- if (!p)
14
- n.append({
15
- questions: [t],
12
+ if (!t.current) {
13
+ if (!d)
14
+ a === "before" && s && s.childNodes.forEach((e) => {
15
+ e !== r && e.remove();
16
+ }), n.append({
17
+ questions: [o],
16
18
  responses: {
17
- [t.response_id]: {
18
- ...a
19
+ [o.response_id]: {
20
+ ...u
19
21
  }
20
22
  }
21
23
  });
22
24
  else {
23
- const e = n.question(t.response_id);
25
+ const e = n.question(o.response_id);
24
26
  e && (e.disable(), e.validate({
25
27
  showCorrectAnswers: !0
26
- })), n.renderMath("mathjax"), o();
28
+ })), n.renderMath("mathjax"), a === "after" && s && s.childNodes.forEach((f) => {
29
+ f !== r && f.remove();
30
+ }), p();
27
31
  }
28
- p = !0;
32
+ d = !0;
29
33
  }
30
34
  },
31
35
  errorListener: (e) => {
32
- r.current || o(e);
36
+ t.current || p(e);
33
37
  }
34
38
  });
35
39
  },
36
- [s, r]
40
+ [i, t]
37
41
  ) };
38
42
  };
39
43
  export {
40
- m as default
44
+ L as default
41
45
  };
42
46
  //# sourceMappingURL=use-learnosity-append.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-learnosity-append.js","sources":["../../../../../src/features/worksheet/worksheet/hooks/use-learnosity-append.ts"],"sourcesContent":["import type {\n ILearnosityError,\n ILearnosityQuestionResponse,\n IWorksheetQuestion,\n} from '../worksheet-types';\nimport type { MutableRefObject } from 'react';\n\nimport { useCallback } from 'react';\n\nimport useIsUnmounted from '../../../hooks/use-is-unmounted';\n\ninterface IForceAppend {\n (options: {\n question: IWorksheetQuestion;\n response: ILearnosityQuestionResponse;\n callback: (error?: ILearnosityError) => void;\n }): void;\n}\n\ninterface IUseLearnosityAppend {\n (\n signedRequest: string,\n loggerRef?: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>,\n ): { forceAppend: IForceAppend };\n}\n\nconst useLearnosityAppend: IUseLearnosityAppend = signedRequest => {\n const unmountedRef = useIsUnmounted();\n const forceAppend = useCallback<IForceAppend>(\n ({ question, response, callback }) => {\n const parsedRequest = JSON.parse(signedRequest);\n let readyListenerFiredOnce = false;\n\n parsedRequest.type = 'local_practice';\n\n const learnosity = window.LearnosityApp.init(parsedRequest, {\n readyListener: () => {\n if (unmountedRef.current) return;\n\n if (!readyListenerFiredOnce) {\n learnosity.append({\n questions: [question],\n responses: {\n [question.response_id]: {\n ...response,\n },\n },\n });\n } else {\n const q = learnosity.question(question.response_id);\n\n if (q) {\n q.disable();\n q.validate({\n showCorrectAnswers: true,\n });\n }\n\n learnosity.renderMath('mathjax');\n\n callback();\n }\n\n readyListenerFiredOnce = true;\n },\n errorListener: (error: ILearnosityError) => {\n if (unmountedRef.current) return;\n\n callback(error as ILearnosityError);\n },\n });\n },\n [signedRequest, unmountedRef],\n );\n\n return { forceAppend };\n};\n\nexport default useLearnosityAppend;\n"],"names":["useLearnosityAppend","signedRequest","unmountedRef","useIsUnmounted","useCallback","question","response","callback","parsedRequest","readyListenerFiredOnce","learnosity","q","error"],"mappings":";;AA0BA,MAAMA,IAA4C,CAAiBC,MAAA;AACjE,QAAMC,IAAeC;AAgDrB,SAAO,EAAE,aA/CWC;AAAA,IAClB,CAAC,EAAE,UAAAC,GAAU,UAAAC,GAAU,UAAAC,QAAe;AAC9B,YAAAC,IAAgB,KAAK,MAAMP,CAAa;AAC9C,UAAIQ,IAAyB;AAE7B,MAAAD,EAAc,OAAO;AAErB,YAAME,IAAa,OAAO,cAAc,KAAKF,GAAe;AAAA,QAC1D,eAAe,MAAM;AACnB,cAAI,CAAAN,EAAa,SAEjB;AAAA,gBAAI,CAACO;AACH,cAAAC,EAAW,OAAO;AAAA,gBAChB,WAAW,CAACL,CAAQ;AAAA,gBACpB,WAAW;AAAA,kBACT,CAACA,EAAS,WAAW,GAAG;AAAA,oBACtB,GAAGC;AAAA,kBACL;AAAA,gBACF;AAAA,cAAA,CACD;AAAA,iBACI;AACL,oBAAMK,IAAID,EAAW,SAASL,EAAS,WAAW;AAElD,cAAIM,MACFA,EAAE,QAAQ,GACVA,EAAE,SAAS;AAAA,gBACT,oBAAoB;AAAA,cAAA,CACrB,IAGHD,EAAW,WAAW,SAAS,GAEtBH;YACX;AAEyB,YAAAE,IAAA;AAAA;AAAA,QAC3B;AAAA,QACA,eAAe,CAACG,MAA4B;AAC1C,UAAIV,EAAa,WAEjBK,EAASK,CAAyB;AAAA,QACpC;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACX,GAAeC,CAAY;AAAA,EAAA,EAGT;AACvB;"}
1
+ {"version":3,"file":"use-learnosity-append.js","sources":["../../../../../src/features/worksheet/worksheet/hooks/use-learnosity-append.ts"],"sourcesContent":["import type {\n ILearnosityError,\n ILearnosityQuestionResponse,\n IWorksheetQuestion,\n} from '../worksheet-types';\nimport type { MutableRefObject } from 'react';\n\nimport { useCallback } from 'react';\n\nimport useIsUnmounted from '../../../hooks/use-is-unmounted';\n\ninterface IForceAppend {\n (options: {\n question: IWorksheetQuestion;\n response: ILearnosityQuestionResponse;\n callback: (error?: ILearnosityError) => void;\n removeOldElements: 'before' | 'after';\n }): void;\n}\n\ninterface IUseLearnosityAppend {\n (\n signedRequest: string,\n loggerRef?: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>,\n ): { forceAppend: IForceAppend };\n}\n\nconst useLearnosityAppend: IUseLearnosityAppend = signedRequest => {\n const unmountedRef = useIsUnmounted();\n const forceAppend = useCallback<IForceAppend>(\n ({ question, response, removeOldElements, callback }) => {\n const parsedRequest = JSON.parse(signedRequest);\n const $el = document.querySelector(`.learnosity-response.question-${question.response_id}`);\n const $parentEl = $el?.parentNode;\n let readyListenerFiredOnce = false;\n\n parsedRequest.type = 'local_practice';\n\n const learnosity = window.LearnosityApp.init(parsedRequest, {\n readyListener: () => {\n if (unmountedRef.current) return;\n\n if (!readyListenerFiredOnce) {\n if (removeOldElements === 'before' && $parentEl) {\n $parentEl.childNodes.forEach(child => {\n if (child !== $el) {\n child.remove();\n }\n });\n }\n\n learnosity.append({\n questions: [question],\n responses: {\n [question.response_id]: {\n ...response,\n },\n },\n });\n } else {\n const q = learnosity.question(question.response_id);\n\n if (q) {\n q.disable();\n q.validate({\n showCorrectAnswers: true,\n });\n }\n\n learnosity.renderMath('mathjax');\n\n if (removeOldElements === 'after' && $parentEl) {\n $parentEl.childNodes.forEach(child => {\n if (child !== $el) {\n child.remove();\n }\n });\n }\n\n callback();\n }\n\n readyListenerFiredOnce = true;\n },\n errorListener: (error: ILearnosityError) => {\n if (unmountedRef.current) return;\n\n callback(error as ILearnosityError);\n },\n });\n },\n [signedRequest, unmountedRef],\n );\n\n return { forceAppend };\n};\n\nexport default useLearnosityAppend;\n"],"names":["useLearnosityAppend","signedRequest","unmountedRef","useIsUnmounted","useCallback","question","response","removeOldElements","callback","parsedRequest","$el","$parentEl","readyListenerFi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;AAAA,IACA,CAACf,GAAeC,CAAY;AAAA,EAAA,EAGT;AACvB;"}
@@ -1,63 +1,63 @@
1
- import { jsx as S } from "react/jsx-runtime";
2
- import { memo as g, useRef as I, useCallback as M, useEffect as m } from "react";
3
- import Q from "../hooks/use-learnosity-append.js";
4
- import { LearnosityQuestionContainer as $ } from "./worksheet-question-styled.js";
5
- const D = g(
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { memo as R, useRef as E, useCallback as A, useEffect as m } from "react";
3
+ import g from "../hooks/use-learnosity-append.js";
4
+ import { LearnosityQuestionContainer as b } from "./worksheet-question-styled.js";
5
+ const N = R(
6
6
  ({
7
- signedRequest: R,
7
+ signedRequest: S,
8
8
  appended: o,
9
- canRender: E,
9
+ canRender: I,
10
10
  canForceAppend: a,
11
- question: n,
11
+ question: t,
12
12
  response: s,
13
13
  learnosity: w,
14
- isConceptIntro: h,
15
- simState: u,
14
+ isConceptIntro: M,
15
+ simState: c,
16
16
  onMediaStateChange: _
17
17
  }) => {
18
- const c = I(null), t = I(s), { forceAppend: p } = Q(R), d = M(
18
+ const l = E(null), n = E(s), { forceAppend: p } = g(S), d = A(
19
19
  (e) => {
20
- const { source: r, data: i } = e, { type: l } = i ?? {};
21
- l === "SIM_IS_READY" ? r.postMessage(
20
+ const { source: r, data: i } = e, { type: u } = i ?? {};
21
+ u === "SIM_IS_READY" ? r.postMessage(
22
22
  {
23
23
  type: "SIMULATION_CONFIG",
24
24
  payload: {
25
25
  userRole: a ? "teacher" : "student",
26
- simulationState: u
26
+ simulationState: c
27
27
  }
28
28
  },
29
29
  "*"
30
- ) : l === "SIM_STATE_UPDATE" && _(n, "SIMULATION", e.data.payload);
30
+ ) : u === "SIM_STATE_UPDATE" && _(t, "SIMULATION", e.data.payload);
31
31
  },
32
- [a, u, _, n]
33
- ), y = M(
32
+ [a, c, _, t]
33
+ ), y = A(
34
34
  (e) => {
35
35
  window.requestAnimationFrame(() => {
36
- var i, l, T;
36
+ var i, u, T;
37
37
  const r = document.createElement("div");
38
- r.classList.add("learnosity-response"), r.classList.add(`question-${n.response_id}`), (l = (i = c.current) == null ? void 0 : i.children[0]) == null || l.querySelectorAll("svg path").forEach((f) => {
38
+ r.classList.add("learnosity-response"), r.classList.add(`question-${t.response_id}`), (u = (i = l.current) == null ? void 0 : i.children[0]) == null || u.querySelectorAll(".lrn_drawing svg path").forEach((f) => {
39
39
  f.id = `${f.id} + temp`;
40
- }), (T = c.current) == null || T.append(r), p({
41
- question: n,
40
+ }), (T = l.current) == null || T.append(r), p({
41
+ question: t,
42
42
  response: e,
43
+ removeOldElements: t.type === "numberline" ? "before" : "after",
43
44
  callback: (f) => {
44
- var v, A;
45
- f || ((A = (v = c.current) == null ? void 0 : v.children[0]) == null || A.remove(), t.current && t.current !== e ? y(t.current) : t.current = void 0);
45
+ f || (n.current && n.current !== e ? y(n.current) : n.current = void 0);
46
46
  }
47
47
  });
48
48
  });
49
49
  },
50
- [p, n]
51
- ), L = I(!1);
50
+ [p, t]
51
+ ), L = E(!1);
52
52
  return m(() => {
53
53
  let e;
54
- return E && (L.current || (e = window.requestAnimationFrame(() => {
55
- const r = t.current ?? s;
54
+ return I && (L.current || (e = window.requestAnimationFrame(() => {
55
+ const r = n.current ?? s;
56
56
  L.current = !0, w.appendQuestion({
57
- questions: [n],
57
+ questions: [t],
58
58
  ...r ? {
59
59
  responses: {
60
- [n.response_id]: {
60
+ [t.response_id]: {
61
61
  // Learnosity is mutating the response object, so we need to clone it
62
62
  ...r
63
63
  }
@@ -67,37 +67,37 @@ const D = g(
67
67
  }))), () => {
68
68
  e && window.cancelAnimationFrame(e);
69
69
  };
70
- }, [E, w, n, s]), m(() => {
70
+ }, [I, w, t, s]), m(() => {
71
71
  var e;
72
- return o && (t.current = void 0, (e = c.current) != null && e.querySelector("iframe") && window.addEventListener("message", d)), () => {
72
+ return o && (n.current = void 0, (e = l.current) != null && e.querySelector("iframe") && window.addEventListener("message", d)), () => {
73
73
  window.removeEventListener("message", d);
74
74
  };
75
75
  }, [o, d]), m(() => {
76
76
  var e, r;
77
- if (u && o) {
78
- const i = (e = c.current) == null ? void 0 : e.querySelector("iframe");
77
+ if (c && o) {
78
+ const i = (e = l.current) == null ? void 0 : e.querySelector("iframe");
79
79
  i && ((r = i.contentWindow) == null || r.postMessage(
80
80
  {
81
81
  type: "SIM_STATE_UPDATE",
82
- payload: u
82
+ payload: c
83
83
  },
84
84
  "*"
85
85
  ));
86
86
  }
87
- }, [o, a, u]), m(() => {
88
- o && s && a && s !== t.current && (t.current ? t.current = s : (t.current = s, y(s)));
89
- }, [o, a, s, y]), /* @__PURE__ */ S(
90
- $,
87
+ }, [o, a, c]), m(() => {
88
+ o && s && a && s !== n.current && (n.current ? n.current = s : (n.current = s, y(s)));
89
+ }, [o, a, s, y]), /* @__PURE__ */ v(
90
+ b,
91
91
  {
92
- ref: c,
93
- $isConceptIntro: h,
92
+ ref: l,
93
+ $isConceptIntro: M,
94
94
  $isTeacher: a,
95
- children: /* @__PURE__ */ S("div", { className: `learnosity-response question-${n.response_id}` })
95
+ children: /* @__PURE__ */ v("div", { className: `learnosity-response question-${t.response_id}` })
96
96
  }
97
97
  );
98
98
  }
99
99
  );
100
100
  export {
101
- D as default
101
+ N as default
102
102
  };
103
103
  //# sourceMappingURL=learnosity-question.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"learnosity-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/learnosity-question.tsx"],"sourcesContent":["import type { ILearnosityQuestionResponse } from '../worksheet-types';\nimport type { ILearnosityQuestionProps } from './worksheet-question-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef } from 'react';\n\nimport useLearnosityAppend from '../hooks/use-learnosity-append';\nimport * as Styled from './worksheet-question-styled';\n\nconst LearnosityQuestion: FC<ILearnosityQuestionProps> = memo(\n ({\n signedRequest,\n appended,\n canRender,\n canForceAppend,\n question,\n response,\n learnosity,\n isConceptIntro,\n simState,\n onMediaStateChange,\n }) => {\n const containerElementRef = useRef<HTMLDivElement>(null);\n const latestQuestionResponseRef = useRef<ILearnosityQuestionResponse | undefined>(response);\n const { forceAppend } = useLearnosityAppend(signedRequest);\n\n const handleSimIframeMessage = useCallback(\n (event: MessageEvent) => {\n const { source, data } = event;\n const { type } = data ?? ({} as { type: string });\n\n if (type === 'SIM_IS_READY') {\n (source as Window).postMessage(\n {\n type: 'SIMULATION_CONFIG',\n payload: {\n userRole: canForceAppend ? 'teacher' : 'student',\n simulationState: simState,\n },\n },\n '*',\n );\n } else if (type === 'SIM_STATE_UPDATE') {\n onMediaStateChange(question, 'SIMULATION', event.data.payload);\n }\n },\n [canForceAppend, simState, onMediaStateChange, question],\n );\n\n const updateResponse = useCallback(\n (newResponse: ILearnosityQuestionResponse) => {\n window.requestAnimationFrame(() => {\n const questionElement = document.createElement('div');\n\n questionElement.classList.add('learnosity-response');\n questionElement.classList.add(`question-${question.response_id}`);\n // Drawing questions looks for already appended path elements with id, if present it will not append the path, to overcome this issue we are adding temp to the id\n containerElementRef.current?.children[0]?.querySelectorAll('svg path').forEach(path => {\n path.id = `${path.id} + temp`;\n });\n\n containerElementRef.current?.append(questionElement);\n forceAppend({\n question,\n response: newResponse,\n callback: error => {\n if (error) return;\n\n containerElementRef.current?.children[0]?.remove();\n\n if (\n latestQuestionResponseRef.current &&\n latestQuestionResponseRef.current !== newResponse\n )\n updateResponse(latestQuestionResponseRef.current);\n else latestQuestionResponseRef.current = undefined;\n },\n });\n });\n },\n [forceAppend, question],\n );\n\n const appendQuestionCalledRef = useRef(false);\n\n useEffect(() => {\n let requestId: number;\n\n if (canRender) {\n if (!appendQuestionCalledRef.current) {\n requestId = window.requestAnimationFrame(() => {\n const appenndableResponse = latestQuestionResponseRef.current ?? response;\n\n appendQuestionCalledRef.current = true;\n learnosity.appendQuestion({\n questions: [question],\n ...(appenndableResponse\n ? {\n responses: {\n [question.response_id]: {\n // Learnosity is mutating the response object, so we need to clone it\n ...appenndableResponse,\n },\n },\n }\n : {}),\n });\n });\n }\n }\n\n return () => {\n if (requestId) window.cancelAnimationFrame(requestId);\n };\n }, [canRender, learnosity, question, response]);\n\n useEffect(() => {\n if (appended) {\n latestQuestionResponseRef.current = undefined;\n\n if (containerElementRef.current?.querySelector('iframe')) {\n window.addEventListener('message', handleSimIframeMessage);\n }\n }\n\n return () => {\n window.removeEventListener('message', handleSimIframeMessage);\n };\n }, [appended, handleSimIframeMessage]);\n\n useEffect(() => {\n if (simState && appended) {\n const simIframe = containerElementRef.current?.querySelector('iframe');\n\n if (simIframe) {\n simIframe.contentWindow?.postMessage(\n {\n type: 'SIM_STATE_UPDATE',\n payload: simState,\n },\n '*',\n );\n }\n }\n }, [appended, canForceAppend, simState]);\n\n useEffect(() => {\n if (appended && response && canForceAppend) {\n if (response !== latestQuestionResponseRef.current) {\n if (!latestQuestionResponseRef.current) {\n latestQuestionResponseRef.current = response;\n updateResponse(response);\n } else {\n latestQuestionResponseRef.current = response;\n }\n }\n }\n }, [appended, canForceAppend, response, updateResponse]);\n\n return (\n <Styled.LearnosityQuestionContainer\n ref={containerElementRef}\n $isConceptIntro={isConceptIntro}\n $isTeacher={canForceAppend}\n >\n <div className={`learnosity-response question-${question.response_id}`} />\n </Styled.LearnosityQuestionContainer>\n );\n },\n);\n\nexport default LearnosityQuestion;\n"],"names":["LearnosityQuestion","memo","signedRequest","appended","canRender","canForceAppend","question","response","learnosity","isConceptIntro","simState","onMediaStateChange","containerElementRef","useRef","latestQuestionResponseRef","forceAppend","useLearnosityAppend","handleSimIframeMessage","useCallback","event","source","data","type","updateResponse","newResponse","questionElement","_b","_a","path","_c","error","appendQuestionCalledRef","useEffect","requestId","appenndableResponse","simIframe","jsx","Styled.LearnosityQuestionContainer"],"mappings":";;;;AASA,MAAMA,IAAmDC;AAAA,EACvD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IAC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AA;AAAA,MAGN;AAAA,IACC,GAAA,CAACP,GAAUE,GAAgBK,CAAQ,CAAC,GAEvCsB,EAAU,MAAM;AACV,MAAA7B,KAAYI,KAAYF,KACtBE,MAAaO,EAA0B,YACpCA,EAA0B,UAI7BA,EAA0B,UAAUP,KAHpCO,EAA0B,UAAUP,GACpCgB,EAAehB,CAAQ;AAAA,OAM5B,CAACJ,GAAUE,GAAgBE,GAAUgB,CAAc,CAAC,GAGrD,gBAAAa;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,KAAKzB;AAAA,QACL,iBAAiBH;AAAA,QACjB,YAAYJ;AAAA,QAEZ,4BAAC,OAAI,EAAA,WAAW,gCAAgCC,EAAS,WAAW,IAAI;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9E;AACF;"}
1
+ {"version":3,"file":"learnosity-question.js","sources":["../../../../../src/features/worksheet/worksheet/worksheet-question/learnosity-question.tsx"],"sourcesContent":["import type { ILearnosityQuestionResponse } from '../worksheet-types';\nimport type { ILearnosityQuestionProps } from './worksheet-question-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useRef } from 'react';\n\nimport useLearnosityAppend from '../hooks/use-learnosity-append';\nimport * as Styled from './worksheet-question-styled';\n\nconst LearnosityQuestion: FC<ILearnosityQuestionProps> = memo(\n ({\n signedRequest,\n appended,\n canRender,\n canForceAppend,\n question,\n response,\n learnosity,\n isConceptIntro,\n simState,\n onMediaStateChange,\n }) => {\n const containerElementRef = useRef<HTMLDivElement>(null);\n const latestQuestionResponseRef = useRef<ILearnosityQuestionResponse | undefined>(response);\n const { forceAppend } = useLearnosityAppend(signedRequest);\n\n const handleSimIframeMessage = useCallback(\n (event: MessageEvent) => {\n const { source, data } = event;\n const { type } = data ?? ({} as { type: string });\n\n if (type === 'SIM_IS_READY') {\n (source as Window).postMessage(\n {\n type: 'SIMULATION_CONFIG',\n payload: {\n userRole: canForceAppend ? 'teacher' : 'student',\n simulationState: simState,\n },\n },\n '*',\n );\n } else if (type === 'SIM_STATE_UPDATE') {\n onMediaStateChange(question, 'SIMULATION', event.data.payload);\n }\n },\n [canForceAppend, simState, onMediaStateChange, question],\n );\n\n const updateResponse = useCallback(\n (newResponse: ILearnosityQuestionResponse) => {\n window.requestAnimationFrame(() => {\n const questionElement = document.createElement('div');\n\n questionElement.classList.add('learnosity-response');\n questionElement.classList.add(`question-${question.response_id}`);\n // Drawing questions looks for already appended path elements with id, if present it will not append the path, to overcome this issue we are adding temp to the id\n containerElementRef.current?.children[0]\n ?.querySelectorAll('.lrn_drawing svg path')\n .forEach(path => {\n path.id = `${path.id} + temp`;\n });\n\n containerElementRef.current?.append(questionElement);\n forceAppend({\n question,\n response: newResponse,\n removeOldElements: question.type === 'numberline' ? 'before' : 'after',\n callback: error => {\n if (error) return;\n\n if (\n latestQuestionResponseRef.current &&\n latestQuestionResponseRef.current !== newResponse\n )\n updateResponse(latestQuestionResponseRef.current);\n else latestQuestionResponseRef.current = undefined;\n },\n });\n });\n },\n [forceAppend, question],\n );\n\n const appendQuestionCalledRef = useRef(false);\n\n useEffect(() => {\n let requestId: number;\n\n if (canRender) {\n if (!appendQuestionCalledRef.current) {\n requestId = window.requestAnimationFrame(() => {\n const appenndableResponse = latestQuestionResponseRef.current ?? response;\n\n appendQuestionCalledRef.current = true;\n learnosity.appendQuestion({\n questions: [question],\n ...(appenndableResponse\n ? {\n responses: {\n [question.response_id]: {\n // Learnosity is mutating the response object, so we need to clone it\n ...appenndableResponse,\n },\n },\n }\n : {}),\n });\n });\n }\n }\n\n return () => {\n if (requestId) window.cancelAnimationFrame(requestId);\n };\n }, [canRender, learnosity, question, response]);\n\n useEffect(() => {\n if (appended) {\n latestQuestionResponseRef.current = undefined;\n\n if (containerElementRef.current?.querySelector('iframe')) {\n window.addEventListener('message', handleSimIframeMessage);\n }\n }\n\n return () => {\n window.removeEventListener('message', handleSimIframeMessage);\n };\n }, [appended, handleSimIframeMessage]);\n\n useEffect(() => {\n if (simState && appended) {\n const simIframe = containerElementRef.current?.querySelector('iframe');\n\n if (simIframe) {\n simIframe.contentWindow?.postMessage(\n {\n type: 'SIM_STATE_UPDATE',\n payload: simState,\n },\n '*',\n );\n }\n }\n }, [appended, canForceAppend, simState]);\n\n useEffect(() => {\n if (appended && response && canForceAppend) {\n if (response !== latestQuestionResponseRef.current) {\n if (!latestQuestionResponseRef.current) {\n latestQuestionResponseRef.current = response;\n updateResponse(response);\n } else {\n latestQuestionResponseRef.current = response;\n }\n }\n }\n }, [appended, canForceAppend, response, updateResponse]);\n\n return (\n <Styled.LearnosityQuestionContainer\n ref={containerElementRef}\n $isConceptIntro={isConceptIntro}\n $isTeacher={canForceAppend}\n >\n <div className={`learnosity-response question-${question.response_id}`} />\n </Styled.LearnosityQuestionContainer>\n );\n },\n);\n\nexport default LearnosityQuestion;\n"],"names":["LearnosityQuestion","memo","signedRequest","appended","canRender","canForceAppend","question","response","learnosity","isConceptIntro","simState","onMediaStateChange","containerElementRef","useRef","latestQuestionResponseRef","forceAppend","useLearnosityAppend","handleSimIframeMessage","useCallback","event","source","data","type","updateResponse","newResponse","questionElement","_b","_a","path","_c","error","appendQuestionCalledRef","useEffect","requestId","appenndableResponse","simIframe","jsx","Styled.LearnosityQuestionContainer"],"mappings":";;;;AASA,MAAMA,IAAmDC;AAAA,EACvD,CAAC;AAAA,IACC,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,MACI;AACE,UAAAC,IAAsBC,EAAuB,IAAI,GACjDC,IAA4BD,EAAgDN,CAAQ,GACpF,EAAE,aAAAQ,EAAA,IAAgBC,EAAoBd,CAAa,GAEnDe,IAAyBC;AAAA,MAC7B,CAACC,MAAwB;AACjB,cAAA,EAAE,QAAAC,GAAQ,MAAAC,EAAS,IAAAF,GACnB,EAA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;AAAA,QACL,iBAAiBH;AAAA,QACjB,YAAYJ;AAAA,QAEZ,4BAAC,OAAI,EAAA,WAAW,gCAAgCC,EAAS,WAAW,IAAI;AAAA,MAAA;AAAA,IAAA;AAAA,EAG9E;AACF;"}
package/dist/index.d.ts CHANGED
@@ -350,7 +350,7 @@ export declare const EditMilestoneModal: React_2.FC<IEditMilestoneModalProps>;
350
350
  export declare const EditStarIcon: React.FC<React.SVGProps<SVGSVGElement>>;
351
351
 
352
352
  export declare enum ELeaderboardType {
353
- BI_WEEKLY = "biWeekly",
353
+ BI_WEEKLY = "bi_weekly",
354
354
  ALL_TIME = "global",
355
355
  ALL_TIME_STREAK = "globalStreak"
356
356
  }
@@ -1436,7 +1436,7 @@ declare interface IGetLeaderboardPayloadModel {
1436
1436
 
1437
1437
  declare interface IGetLeaderboardResponseModel {
1438
1438
  global: ILeaderboardDetailsResponse;
1439
- biWeekly: ILeaderboardDetailsResponse;
1439
+ bi_weekly: ILeaderboardDetailsResponse;
1440
1440
  globalStreak: ILeaderboardDetailsResponse;
1441
1441
  }
1442
1442
 
@@ -1680,7 +1680,7 @@ export declare interface ILayout {
1680
1680
 
1681
1681
  export declare interface ILeaderboardDetails {
1682
1682
  global: IPointsLeaderboardDetails;
1683
- biWeekly: IPointsLeaderboardDetails;
1683
+ bi_weekly: IPointsLeaderboardDetails;
1684
1684
  globalStreak: IStreakLeaderboardDetails;
1685
1685
  }
1686
1686
 
@@ -2389,6 +2389,11 @@ export declare interface IModal {
2389
2389
  modalWidth: string;
2390
2390
  }
2391
2391
 
2392
+ declare interface IModalCallbacks {
2393
+ /** Callback when the modal is closed */
2394
+ onCloseModal?: () => void;
2395
+ }
2396
+
2392
2397
  /**
2393
2398
  * Context for managing modals throughout the application
2394
2399
  */
@@ -2398,7 +2403,7 @@ declare interface IModalContext {
2398
2403
  /** Parameters passed to the modal when opened */
2399
2404
  modalParams?: Record<string, unknown>;
2400
2405
  /** Opens a modal by name with optional parameters */
2401
- openModal: <T = undefined>(name: string, params?: T) => void;
2406
+ openModal: <T = undefined>(name: string, params?: T, callbacks?: IModalCallbacks) => void;
2402
2407
  /** Closes the currently open modal */
2403
2408
  closeModal: () => void;
2404
2409
  /** Whether the modal is in the process of closing (for animation) */
@@ -3616,7 +3621,7 @@ declare interface IUseIsTabBlocked {
3616
3621
  }
3617
3622
 
3618
3623
  declare interface IUseModalActions {
3619
- (): Pick<IModalContext, 'openModal' | 'closeModal' | 'isClosing'>;
3624
+ (): Pick<IModalContext, 'openModal' | 'closeModal' | 'isClosing' | 'modal'>;
3620
3625
  }
3621
3626
 
3622
3627
  declare interface IUseModalParams {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.1.20",
3
+ "version": "3.1.22-akm-1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -95,5 +95,6 @@
95
95
  "vite-plugin-dts": "3.6.4",
96
96
  "vite-plugin-svgr": "3.2.0",
97
97
  "vite-tsconfig-paths": "^4.2.2"
98
- }
98
+ },
99
+ "packageManager": "yarn@4.4.1"
99
100
  }