@cuemath/leap 3.1.5-beta-0.1 → 3.1.6-j1

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 (177) hide show
  1. package/dist/assets/illustrations/illustrations.js +1 -2
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/line-icons/icons/check.js +3 -3
  4. package/dist/assets/line-icons/icons/check.js.map +1 -1
  5. package/dist/features/analytics-events/platform-events-student.js +2 -4
  6. package/dist/features/analytics-events/platform-events-student.js.map +1 -1
  7. package/dist/features/auth/account-selector/account-selector-styled.js +9 -0
  8. package/dist/features/auth/account-selector/account-selector-styled.js.map +1 -0
  9. package/dist/features/auth/account-selector/account-selector.js +57 -33
  10. package/dist/features/auth/account-selector/account-selector.js.map +1 -1
  11. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styled.js +21 -0
  12. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styled.js.map +1 -0
  13. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +8 -9
  14. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
  15. package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js +1 -1
  16. package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js.map +1 -1
  17. package/dist/features/auth/forgot-password/forgot-password-styled.js +15 -3
  18. package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -1
  19. package/dist/features/auth/forgot-password/otp-form/otp-form.js +29 -29
  20. package/dist/features/auth/forgot-password/otp-form/otp-form.js.map +1 -1
  21. package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js +14 -18
  22. package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js.map +1 -1
  23. package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js +23 -24
  24. package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js.map +1 -1
  25. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js +4 -2
  26. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form-styled.js.map +1 -1
  27. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js +85 -75
  28. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js.map +1 -1
  29. package/dist/features/auth/login/login-styled.js +13 -0
  30. package/dist/features/auth/login/login-styled.js.map +1 -0
  31. package/dist/features/auth/login/social-account-not-found/social-account-not-found.js +27 -21
  32. package/dist/features/auth/login/social-account-not-found/social-account-not-found.js.map +1 -1
  33. package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js +9 -0
  34. package/dist/features/auth/login/social-login-methods/social-login-methods-styled.js.map +1 -0
  35. package/dist/features/auth/login/social-login-methods/social-login-methods.js +43 -34
  36. package/dist/features/auth/login/social-login-methods/social-login-methods.js.map +1 -1
  37. package/dist/features/auth/login/username-password-form/username-password-form.js +22 -21
  38. package/dist/features/auth/login/username-password-form/username-password-form.js.map +1 -1
  39. package/dist/features/auth/user-list/user-item/user-item.js +33 -32
  40. package/dist/features/auth/user-list/user-item/user-item.js.map +1 -1
  41. package/dist/features/auth/user-list/user-list.js +60 -51
  42. package/dist/features/auth/user-list/user-list.js.map +1 -1
  43. package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +74 -74
  44. package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
  45. package/dist/features/cue-canvas/cue-canvas-context.js +5 -8
  46. package/dist/features/cue-canvas/cue-canvas-context.js.map +1 -1
  47. package/dist/features/cue-canvas/cue-canvas-core.js +74 -84
  48. package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
  49. package/dist/features/cue-canvas/cue-canvas-helpers.js +25 -31
  50. package/dist/features/cue-canvas/cue-canvas-helpers.js.map +1 -1
  51. package/dist/features/cue-canvas/cue-canvas-provider.js +12 -14
  52. package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
  53. package/dist/features/cue-canvas/cue-canvas.js +59 -66
  54. package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
  55. package/dist/features/cue-canvas/cue-cavas-styled.js +42 -45
  56. package/dist/features/cue-canvas/cue-cavas-styled.js.map +1 -1
  57. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js +54 -61
  58. package/dist/features/cue-canvas/hooks/use-canvas-sync-broker.js.map +1 -1
  59. package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js +14 -18
  60. package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js.map +1 -1
  61. package/dist/features/cue-canvas/toolbar/grid-menu.js +13 -13
  62. package/dist/features/cue-canvas/toolbar/grid-menu.js.map +1 -1
  63. package/dist/features/cue-canvas/toolbar/tool.js +20 -22
  64. package/dist/features/cue-canvas/toolbar/tool.js.map +1 -1
  65. package/dist/features/homework/hw-card-list/api/get-homeworks.js +1 -1
  66. package/dist/features/homework/hw-card-list/api/get-homeworks.js.map +1 -1
  67. package/dist/features/homework/hw-card-list/hw-card-list-view.js +112 -144
  68. package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
  69. package/dist/features/homework/styles.js +4 -5
  70. package/dist/features/homework/styles.js.map +1 -1
  71. package/dist/features/hooks/use-viewport.js +21 -0
  72. package/dist/features/hooks/use-viewport.js.map +1 -0
  73. package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +262 -199
  74. package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
  75. package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js +15 -15
  76. package/dist/features/journey/hooks/use-home-page-journey/use-home-page-journey.js.map +1 -1
  77. package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +36 -38
  78. package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
  79. package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js +22 -24
  80. package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js.map +1 -1
  81. package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js +22 -23
  82. package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js.map +1 -1
  83. package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +47 -49
  84. package/dist/features/milestone/create/comps/chapters-selection-step/utils.js.map +1 -1
  85. package/dist/features/milestone/create/comps/class-details-step/class-details-step.js +87 -94
  86. package/dist/features/milestone/create/comps/class-details-step/class-details-step.js.map +1 -1
  87. package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js +12 -13
  88. package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
  89. package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +21 -23
  90. package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
  91. package/dist/features/milestone/create/milestone-create-helpers.js +162 -165
  92. package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
  93. package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js +47 -48
  94. package/dist/features/milestone/edit/comps/edit-milestone-modal/index.js.map +1 -1
  95. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +121 -100
  96. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  97. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js +14 -15
  98. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget-styled.js.map +1 -1
  99. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +51 -52
  100. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  101. package/dist/features/trial-session/comps/pricing/pricing.js +35 -36
  102. package/dist/features/trial-session/comps/pricing/pricing.js.map +1 -1
  103. package/dist/features/ui/buttons/button/button-styled.js +29 -29
  104. package/dist/features/ui/buttons/button/button-styled.js.map +1 -1
  105. package/dist/features/ui/stepper/stepper.js +7 -7
  106. package/dist/features/utils/media.js +16 -0
  107. package/dist/features/utils/media.js.map +1 -0
  108. package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js +19 -22
  109. package/dist/features/worksheet/worksheet/hooks/use-s3-helper.js.map +1 -1
  110. package/dist/index.d.ts +35 -92
  111. package/dist/index.js +321 -323
  112. package/dist/index.js.map +1 -1
  113. package/dist/static/cuemath-app-qr-code.7205ee79.svg +1 -0
  114. package/package.json +1 -1
  115. package/dist/assets/line-icons/icons/puzzle-icon.js +0 -51
  116. package/dist/assets/line-icons/icons/puzzle-icon.js.map +0 -1
  117. package/dist/assets/line-icons/icons/share.js +0 -48
  118. package/dist/assets/line-icons/icons/share.js.map +0 -1
  119. package/dist/assets/line-icons/icons/tile.js +0 -54
  120. package/dist/assets/line-icons/icons/tile.js.map +0 -1
  121. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js +0 -12
  122. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js.map +0 -1
  123. package/dist/features/cue-canvas/bottombar/homework-controls.js +0 -73
  124. package/dist/features/cue-canvas/bottombar/homework-controls.js.map +0 -1
  125. package/dist/features/cue-canvas/hooks/use-config-updater.js +0 -12
  126. package/dist/features/cue-canvas/hooks/use-config-updater.js.map +0 -1
  127. package/dist/features/cue-canvas/hooks/use-upload-helper.js +0 -23
  128. package/dist/features/cue-canvas/hooks/use-upload-helper.js.map +0 -1
  129. package/dist/features/cue-canvas/sidebar/homework/helper.js +0 -20
  130. package/dist/features/cue-canvas/sidebar/homework/helper.js.map +0 -1
  131. package/dist/features/cue-canvas/sidebar/homework/homework-menu.js +0 -33
  132. package/dist/features/cue-canvas/sidebar/homework/homework-menu.js.map +0 -1
  133. package/dist/features/cue-canvas/sidebar/homework/homework-request.js +0 -68
  134. package/dist/features/cue-canvas/sidebar/homework/homework-request.js.map +0 -1
  135. package/dist/features/cue-canvas/sidebar/homework/homework-styled.js +0 -25
  136. package/dist/features/cue-canvas/sidebar/homework/homework-styled.js.map +0 -1
  137. package/dist/features/cue-canvas/sidebar/homework/homework.js +0 -39
  138. package/dist/features/cue-canvas/sidebar/homework/homework.js.map +0 -1
  139. package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js +0 -13
  140. package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js.map +0 -1
  141. package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js +0 -60
  142. package/dist/features/cue-canvas/sidebar/puzzles/filter-selection-menu.js.map +0 -1
  143. package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js +0 -44
  144. package/dist/features/cue-canvas/sidebar/puzzles/filters-section.js.map +0 -1
  145. package/dist/features/cue-canvas/sidebar/puzzles/filters.js +0 -107
  146. package/dist/features/cue-canvas/sidebar/puzzles/filters.js.map +0 -1
  147. package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js +0 -42
  148. package/dist/features/cue-canvas/sidebar/puzzles/hooks/use-fetch-cue-canvas-activity.js.map +0 -1
  149. package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js +0 -84
  150. package/dist/features/cue-canvas/sidebar/puzzles/launch-puzzle.js.map +0 -1
  151. package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js +0 -36
  152. package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu-header.js.map +0 -1
  153. package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js +0 -133
  154. package/dist/features/cue-canvas/sidebar/puzzles/puzzle-menu.js.map +0 -1
  155. package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js +0 -96
  156. package/dist/features/cue-canvas/sidebar/puzzles/puzzles-styled.js.map +0 -1
  157. package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js +0 -29
  158. package/dist/features/cue-canvas/sidebar/puzzles/puzzles.js.map +0 -1
  159. package/dist/features/cue-canvas/sidebar/puzzles/utils.js +0 -120
  160. package/dist/features/cue-canvas/sidebar/puzzles/utils.js.map +0 -1
  161. package/dist/features/cue-canvas/sidebar/sidebar-styled.js +0 -32
  162. package/dist/features/cue-canvas/sidebar/sidebar-styled.js.map +0 -1
  163. package/dist/features/cue-canvas/sidebar/sidebar.js +0 -29
  164. package/dist/features/cue-canvas/sidebar/sidebar.js.map +0 -1
  165. package/dist/features/cue-canvas/sidebar/tiles/tile.js +0 -16
  166. package/dist/features/cue-canvas/sidebar/tiles/tile.js.map +0 -1
  167. package/dist/features/homework/hw-card-list/hw-card-list-utils.js +0 -8
  168. package/dist/features/homework/hw-card-list/hw-card-list-utils.js.map +0 -1
  169. package/dist/features/hooks/use-debounce.js +0 -16
  170. package/dist/features/hooks/use-debounce.js.map +0 -1
  171. package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js +0 -18
  172. package/dist/features/milestone/milestone-list-container/api/get-past-milestone-count.js.map +0 -1
  173. package/dist/features/trial-session/comps/pricing/india-pricing/index.js +0 -96
  174. package/dist/features/trial-session/comps/pricing/india-pricing/index.js.map +0 -1
  175. package/dist/features/trial-session/comps/pricing/india-pricing/india-pricing-styled.js +0 -59
  176. package/dist/features/trial-session/comps/pricing/india-pricing/india-pricing-styled.js.map +0 -1
  177. package/dist/static/ellipse-clip.dfb25608.svg +0 -1
@@ -1,118 +1,118 @@
1
- import { useCallback as a, useRef as C, useEffect as T } from "react";
1
+ import { useCallback as c, useRef as C, useEffect as T } from "react";
2
2
  import { CircleSoundKeyMapper as A, SWIPE_SOUND_ORDER as E } from "./constants.js";
3
- import { CircleSoundKey as e } from "./use-circle-sounds-enums.js";
4
- let I = 0;
5
- const r = {
6
- [e.BACKGROUND]: null,
7
- [e.BACKGROUND_RUSHHOUR]: null,
8
- [e.TUTORIAL]: null,
9
- [e.SWIPE_01]: null,
10
- [e.SWIPE_02]: null,
11
- [e.SWIPE_03]: null,
12
- [e.SWIPE_04]: null,
13
- [e.SWIPE_DOWN]: null,
14
- [e.TOGGLE]: null,
15
- [e.POINTS_AWARDED]: null,
16
- [e.POINTS_ADDED]: null,
17
- [e.GAME_CARD_CLICK]: null,
18
- [e.CLOCK_IN]: null,
19
- [e.CLOCK_OUT]: null,
20
- [e.ACCURACY_IN]: null,
21
- [e.ACCURACY_OUT]: null,
22
- [e.STREAK_IN]: null,
23
- [e.STREAK_OUT]: null,
24
- [e.ACCURACY_INTRO]: null,
25
- [e.ACCURACY_TARGET]: null,
26
- [e.TIME_INTRO]: null,
27
- [e.TIME_TARGET]: null,
28
- [e.METER_FILL]: null
29
- }, f = {}, D = () => {
30
- const c = a((n) => {
31
- if (!r[n]) {
32
- const l = new Audio(A[n]);
33
- r[n] = l;
3
+ import { CircleSoundKey as n } from "./use-circle-sounds-enums.js";
4
+ let d = 0;
5
+ const o = {
6
+ [n.BACKGROUND]: null,
7
+ [n.BACKGROUND_RUSHHOUR]: null,
8
+ [n.TUTORIAL]: null,
9
+ [n.SWIPE_01]: null,
10
+ [n.SWIPE_02]: null,
11
+ [n.SWIPE_03]: null,
12
+ [n.SWIPE_04]: null,
13
+ [n.SWIPE_DOWN]: null,
14
+ [n.TOGGLE]: null,
15
+ [n.POINTS_AWARDED]: null,
16
+ [n.POINTS_ADDED]: null,
17
+ [n.GAME_CARD_CLICK]: null,
18
+ [n.CLOCK_IN]: null,
19
+ [n.CLOCK_OUT]: null,
20
+ [n.ACCURACY_IN]: null,
21
+ [n.ACCURACY_OUT]: null,
22
+ [n.STREAK_IN]: null,
23
+ [n.STREAK_OUT]: null,
24
+ [n.ACCURACY_INTRO]: null,
25
+ [n.ACCURACY_TARGET]: null,
26
+ [n.TIME_INTRO]: null,
27
+ [n.TIME_TARGET]: null,
28
+ [n.METER_FILL]: null
29
+ }, I = {}, D = () => {
30
+ const s = c((e) => {
31
+ if (!o[e]) {
32
+ const l = new Audio(A[e]);
33
+ o[e] = l;
34
34
  }
35
- }, []), v = C(/* @__PURE__ */ new Set()), o = C({}), p = a(() => {
36
- document.visibilityState === "hidden" ? Object.keys(r).forEach((n) => {
37
- const l = r[n];
38
- l && !l.paused && (l.pause(), v.current.add(n));
39
- }) : document.visibilityState === "visible" && (v.current.forEach((n) => {
40
- const l = r[n];
35
+ }, []), f = C(/* @__PURE__ */ new Set()), p = C({}), v = c(() => {
36
+ document.visibilityState === "hidden" ? Object.keys(o).forEach((e) => {
37
+ const l = o[e];
38
+ l && !l.paused && (l.pause(), f.current.add(e));
39
+ }) : document.visibilityState === "visible" && (f.current.forEach((e) => {
40
+ const l = o[e];
41
41
  l == null || l.play();
42
- }), v.current.clear());
42
+ }), f.current.clear());
43
43
  }, []);
44
44
  T(() => {
45
- document.addEventListener("visibilitychange", p);
46
- const n = o.current;
45
+ document.addEventListener("visibilitychange", v);
46
+ const e = p.current;
47
47
  return () => {
48
- document.removeEventListener("visibilitychange", p);
49
- for (const l of Object.values(n))
48
+ document.removeEventListener("visibilitychange", v);
49
+ for (const l of Object.values(e))
50
50
  l != null && clearInterval(l);
51
51
  };
52
- }, [p]);
53
- const S = a(() => {
52
+ }, [v]);
53
+ const S = c(() => {
54
54
  var l;
55
55
  E.forEach((u) => {
56
- c(u);
56
+ s(u);
57
57
  });
58
- const n = E[I] || e.SWIPE_01;
59
- I < E.length - 1 ? I++ : I = 0, (l = r[n]) == null || l.play();
60
- }, [c]), m = a(() => {
58
+ const e = E[d] || n.SWIPE_01;
59
+ d < E.length - 1 ? d++ : d = 0, (l = o[e]) == null || l.play();
60
+ }, [s]), m = c(() => {
61
61
  var l;
62
- return c(e.TOGGLE), (l = r[e.TOGGLE]) == null ? void 0 : l.play();
63
- }, [c]), _ = a(
64
- (n, l = !0, u = !1) => {
65
- c(n);
66
- const t = r[n];
62
+ return s(n.TOGGLE), (l = o[n.TOGGLE]) == null ? void 0 : l.play();
63
+ }, [s]), _ = c(
64
+ (e, l = !0, u = !1) => {
65
+ s(e);
66
+ const t = o[e];
67
67
  if (!t) return;
68
- if (o.current[n] && clearInterval(o.current[n]), !t.paused && t.currentTime > 0 && !t.ended)
68
+ if (!t.paused && t.currentTime > 0 && !t.ended)
69
69
  return t;
70
70
  if (t.loop = u, l) {
71
71
  t.volume = 1;
72
- const d = t.play();
73
- f[n] = d;
72
+ const a = t.play();
73
+ I[e] = a;
74
74
  return;
75
75
  }
76
76
  t.volume = 0;
77
- const s = t.play();
78
- f[n] = s;
77
+ const r = t.play();
78
+ I[e] = r;
79
79
  const i = setInterval(() => {
80
80
  if (!t) {
81
81
  clearInterval(i);
82
82
  return;
83
83
  }
84
- const d = t.volume || 0;
85
- d < 1 ? t.volume = Math.min(d + 0.1, 1) : clearInterval(i);
84
+ const a = t.volume || 0;
85
+ a < 1 ? t.volume = Math.min(a + 0.1, 1) : clearInterval(i);
86
86
  }, 100);
87
- return o.current[n] = i, t;
87
+ return p.current[e] = i, t;
88
88
  },
89
- [c]
90
- ), R = a((n, l = !0) => {
89
+ [s]
90
+ ), R = c((e, l = !0) => {
91
91
  var t;
92
- const u = r[n];
93
- f[n] !== void 0 && ((t = f[n]) == null || t.then(() => {
92
+ const u = o[e];
93
+ I[e] !== void 0 && ((t = I[e]) == null || t.then(() => {
94
94
  if (!u) return;
95
- if (o.current[n] && clearInterval(o.current[n]), l) {
95
+ if (l) {
96
96
  u.pause();
97
97
  return;
98
98
  }
99
- const s = setInterval(() => {
99
+ const r = setInterval(() => {
100
100
  if (!u) {
101
- clearInterval(s);
101
+ clearInterval(r);
102
102
  return;
103
103
  }
104
104
  const i = u.volume || 0;
105
- i - 0.1 <= 0 ? (u.volume = 0, u.pause(), clearInterval(s)) : u.volume = i - 0.1;
105
+ i - 0.1 <= 0 ? (u.volume = 0, u.pause(), clearInterval(r)) : u.volume = i - 0.1;
106
106
  }, 100);
107
- o.current[n] = s;
108
- }).catch((s) => {
109
- console.log("sound not playing", s);
107
+ p.current[e] = r;
108
+ }).catch((r) => {
109
+ console.log("sound not playing", r);
110
110
  }));
111
111
  }, []);
112
112
  return { playSwipSound: S, play: _, stop: R, playButtonSound: m };
113
113
  };
114
114
  export {
115
- r as soundMapper,
115
+ o as soundMapper,
116
116
  D as useCircleSounds
117
117
  };
118
118
  //# sourceMappingURL=use-circle-sounds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-circle-sounds.js","sources":["../../../../../src/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.ts"],"sourcesContent":["import type { TimeoutMap } from './use-circle-sound-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport { CircleSoundKeyMapper, SWIPE_SOUND_ORDER } from './constants';\nimport { CircleSoundKey } from './use-circle-sounds-enums';\n\nlet swipeSoundIndex = 0;\n\nexport const soundMapper: Record<keyof typeof CircleSoundKeyMapper, null | HTMLAudioElement> = {\n [CircleSoundKey.BACKGROUND]: null,\n [CircleSoundKey.BACKGROUND_RUSHHOUR]: null,\n [CircleSoundKey.TUTORIAL]: null,\n [CircleSoundKey.SWIPE_01]: null,\n [CircleSoundKey.SWIPE_02]: null,\n [CircleSoundKey.SWIPE_03]: null,\n [CircleSoundKey.SWIPE_04]: null,\n [CircleSoundKey.SWIPE_DOWN]: null,\n [CircleSoundKey.TOGGLE]: null,\n [CircleSoundKey.POINTS_AWARDED]: null,\n [CircleSoundKey.POINTS_ADDED]: null,\n [CircleSoundKey.GAME_CARD_CLICK]: null,\n [CircleSoundKey.CLOCK_IN]: null,\n [CircleSoundKey.CLOCK_OUT]: null,\n [CircleSoundKey.ACCURACY_IN]: null,\n [CircleSoundKey.ACCURACY_OUT]: null,\n [CircleSoundKey.STREAK_IN]: null,\n [CircleSoundKey.STREAK_OUT]: null,\n [CircleSoundKey.ACCURACY_INTRO]: null,\n [CircleSoundKey.ACCURACY_TARGET]: null,\n [CircleSoundKey.TIME_INTRO]: null,\n [CircleSoundKey.TIME_TARGET]: null,\n [CircleSoundKey.METER_FILL]: null,\n};\n\nconst soundInstancePromise: Partial<Record<keyof typeof CircleSoundKeyMapper, Promise<void>>> = {};\n\nexport const useCircleSounds = () => {\n const loadSound = useCallback((key: CircleSoundKey) => {\n if (!soundMapper[key]) {\n const loadedSound = new Audio(CircleSoundKeyMapper[key]);\n\n soundMapper[key] = loadedSound;\n }\n }, []);\n\n const pausedSoundsRef = useRef<Set<CircleSoundKey>>(new Set());\n const timeoutRefs = useRef<TimeoutMap>({});\n\n const handleVisibilityChange = useCallback(() => {\n if (document.visibilityState === 'hidden') {\n (Object.keys(soundMapper) as CircleSoundKey[]).forEach(key => {\n const sound = soundMapper[key];\n\n if (sound && !sound.paused) {\n sound.pause();\n pausedSoundsRef.current.add(key);\n }\n });\n } else if (document.visibilityState === 'visible') {\n pausedSoundsRef.current.forEach(key => {\n const sound = soundMapper[key];\n\n sound?.play();\n });\n pausedSoundsRef.current.clear();\n }\n }, []);\n\n useEffect(() => {\n document.addEventListener('visibilitychange', handleVisibilityChange);\n const timeouts = timeoutRefs.current;\n\n return () => {\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n for (const id of Object.values(timeouts)) {\n if (id != null) clearInterval(id);\n }\n };\n }, [handleVisibilityChange]);\n\n const playSwipSound = useCallback(() => {\n SWIPE_SOUND_ORDER.forEach(key => {\n loadSound(key);\n });\n\n const key = SWIPE_SOUND_ORDER[swipeSoundIndex] || CircleSoundKey.SWIPE_01;\n\n if (swipeSoundIndex < SWIPE_SOUND_ORDER.length - 1) {\n swipeSoundIndex++;\n } else {\n swipeSoundIndex = 0;\n }\n soundMapper[key]?.play();\n }, [loadSound]);\n\n const playButtonSound = useCallback(() => {\n loadSound(CircleSoundKey.TOGGLE);\n const sound = soundMapper[CircleSoundKey.TOGGLE]?.play();\n\n return sound;\n }, [loadSound]);\n\n const play = useCallback(\n (key: CircleSoundKey, immediately: boolean = true, loop = false) => {\n loadSound(key);\n const soundInstance = soundMapper[key];\n\n if (!soundInstance) return;\n\n if (timeoutRefs.current[key]) {\n clearInterval(timeoutRefs.current[key]);\n }\n\n if (!soundInstance.paused && soundInstance.currentTime > 0 && !soundInstance.ended) {\n return soundInstance;\n }\n\n soundInstance.loop = loop;\n if (immediately) {\n soundInstance.volume = 1;\n const promise = soundInstance.play();\n\n soundInstancePromise[key] = promise;\n\n return;\n }\n\n soundInstance.volume = 0;\n const promise = soundInstance.play();\n\n soundInstancePromise[key] = promise;\n\n const intervalId = setInterval(() => {\n if (!soundInstance) {\n clearInterval(intervalId);\n\n return;\n }\n\n const vol = soundInstance.volume || 0;\n\n if (vol < 1) {\n soundInstance.volume = Math.min(vol + 0.1, 1);\n } else {\n clearInterval(intervalId);\n }\n }, 100);\n\n timeoutRefs.current[key] = intervalId;\n\n return soundInstance;\n },\n [loadSound],\n );\n\n const stop = useCallback((key: CircleSoundKey, immediately: boolean = true) => {\n const soundInstance = soundMapper[key];\n\n if (soundInstancePromise[key] !== undefined) {\n soundInstancePromise[key]\n ?.then(() => {\n if (!soundInstance) return;\n\n if (timeoutRefs.current[key]) {\n clearInterval(timeoutRefs.current[key]);\n }\n\n if (immediately) {\n soundInstance.pause();\n\n return;\n }\n\n const intervalId = setInterval(() => {\n if (!soundInstance) {\n clearInterval(intervalId);\n\n return;\n }\n\n const vol = soundInstance.volume || 0;\n\n if (vol - 0.1 <= 0) {\n soundInstance.volume = 0;\n soundInstance.pause();\n clearInterval(intervalId);\n } else {\n soundInstance.volume = vol - 0.1;\n }\n }, 100);\n\n timeoutRefs.current[key] = intervalId;\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.log('sound not playing', err);\n });\n }\n }, []);\n\n return { playSwipSound, play, stop, playButtonSound };\n};\n"],"names":["swipeSoundIndex","soundMapper","CircleSoundKey","soundInstancePromise","useCircleSounds","loadSound","useCallback","key","loadedSound","CircleSoundKeyMapper","pausedSoundsRef","useRef","timeoutRefs","handleVisibilityChange","sound","useEffect","timeouts","id","playSwipSound","SWIPE_SOUND_ORDER","_a","playButtonSound","play","immediately","loop","soundInstance","promise","intervalId","vol","stop","err"],"mappings":";;;AAOA,IAAIA,IAAkB;AAEf,MAAMC,IAAkF;AAAA,EAC7F,CAACC,EAAe,UAAU,GAAG;AAAA,EAC7B,CAACA,EAAe,mBAAmB,GAAG;AAAA,EACtC,CAACA,EAAe,QAAQ,GAAG;AAAA,EAC3B,CAACA,EAAe,QAAQ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AhB,EAAA,QAAQL,CAAG,IAAIoB;AAAA,IAAA,GAE5B,MAAM,CAAOG,MAAA;AAEJ,cAAA,IAAI,qBAAqBA,CAAG;AAAA,IAAA;AAAA,EAG5C,GAAG,CAAE,CAAA;AAEL,SAAO,EAAE,eAAAZ,GAAe,MAAAI,GAAM,MAAAO,GAAM,iBAAAR,EAAgB;AACtD;"}
1
+ {"version":3,"file":"use-circle-sounds.js","sources":["../../../../../src/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.ts"],"sourcesContent":["import type { TimeoutMap } from './use-circle-sound-types';\n\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport { CircleSoundKeyMapper, SWIPE_SOUND_ORDER } from './constants';\nimport { CircleSoundKey } from './use-circle-sounds-enums';\n\nlet swipeSoundIndex = 0;\n\nexport const soundMapper: Record<keyof typeof CircleSoundKeyMapper, null | HTMLAudioElement> = {\n [CircleSoundKey.BACKGROUND]: null,\n [CircleSoundKey.BACKGROUND_RUSHHOUR]: null,\n [CircleSoundKey.TUTORIAL]: null,\n [CircleSoundKey.SWIPE_01]: null,\n [CircleSoundKey.SWIPE_02]: null,\n [CircleSoundKey.SWIPE_03]: null,\n [CircleSoundKey.SWIPE_04]: null,\n [CircleSoundKey.SWIPE_DOWN]: null,\n [CircleSoundKey.TOGGLE]: null,\n [CircleSoundKey.POINTS_AWARDED]: null,\n [CircleSoundKey.POINTS_ADDED]: null,\n [CircleSoundKey.GAME_CARD_CLICK]: null,\n [CircleSoundKey.CLOCK_IN]: null,\n [CircleSoundKey.CLOCK_OUT]: null,\n [CircleSoundKey.ACCURACY_IN]: null,\n [CircleSoundKey.ACCURACY_OUT]: null,\n [CircleSoundKey.STREAK_IN]: null,\n [CircleSoundKey.STREAK_OUT]: null,\n [CircleSoundKey.ACCURACY_INTRO]: null,\n [CircleSoundKey.ACCURACY_TARGET]: null,\n [CircleSoundKey.TIME_INTRO]: null,\n [CircleSoundKey.TIME_TARGET]: null,\n [CircleSoundKey.METER_FILL]: null,\n};\n\nconst soundInstancePromise: Partial<Record<keyof typeof CircleSoundKeyMapper, Promise<void>>> = {};\n\nexport const useCircleSounds = () => {\n const loadSound = useCallback((key: CircleSoundKey) => {\n if (!soundMapper[key]) {\n const loadedSound = new Audio(CircleSoundKeyMapper[key]);\n\n soundMapper[key] = loadedSound;\n }\n }, []);\n\n const pausedSoundsRef = useRef<Set<CircleSoundKey>>(new Set());\n const timeoutRefs = useRef<TimeoutMap>({});\n\n const handleVisibilityChange = useCallback(() => {\n if (document.visibilityState === 'hidden') {\n (Object.keys(soundMapper) as CircleSoundKey[]).forEach(key => {\n const sound = soundMapper[key];\n\n if (sound && !sound.paused) {\n sound.pause();\n pausedSoundsRef.current.add(key);\n }\n });\n } else if (document.visibilityState === 'visible') {\n pausedSoundsRef.current.forEach(key => {\n const sound = soundMapper[key];\n\n sound?.play();\n });\n pausedSoundsRef.current.clear();\n }\n }, []);\n\n useEffect(() => {\n document.addEventListener('visibilitychange', handleVisibilityChange);\n const timeouts = timeoutRefs.current;\n\n return () => {\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n for (const id of Object.values(timeouts)) {\n if (id != null) clearInterval(id);\n }\n };\n }, [handleVisibilityChange]);\n\n const playSwipSound = useCallback(() => {\n SWIPE_SOUND_ORDER.forEach(key => {\n loadSound(key);\n });\n\n const key = SWIPE_SOUND_ORDER[swipeSoundIndex] || CircleSoundKey.SWIPE_01;\n\n if (swipeSoundIndex < SWIPE_SOUND_ORDER.length - 1) {\n swipeSoundIndex++;\n } else {\n swipeSoundIndex = 0;\n }\n soundMapper[key]?.play();\n }, [loadSound]);\n\n const playButtonSound = useCallback(() => {\n loadSound(CircleSoundKey.TOGGLE);\n const sound = soundMapper[CircleSoundKey.TOGGLE]?.play();\n\n return sound;\n }, [loadSound]);\n\n const play = useCallback(\n (key: CircleSoundKey, immediately: boolean = true, loop = false) => {\n loadSound(key);\n const soundInstance = soundMapper[key];\n\n if (!soundInstance) return;\n\n if (!soundInstance.paused && soundInstance.currentTime > 0 && !soundInstance.ended) {\n return soundInstance;\n }\n\n soundInstance.loop = loop;\n if (immediately) {\n soundInstance.volume = 1;\n const promise = soundInstance.play();\n\n soundInstancePromise[key] = promise;\n\n return;\n }\n\n soundInstance.volume = 0;\n const promise = soundInstance.play();\n\n soundInstancePromise[key] = promise;\n\n const intervalId = setInterval(() => {\n if (!soundInstance) {\n clearInterval(intervalId);\n\n return;\n }\n\n const vol = soundInstance.volume || 0;\n\n if (vol < 1) {\n soundInstance.volume = Math.min(vol + 0.1, 1);\n } else {\n clearInterval(intervalId);\n }\n }, 100);\n\n timeoutRefs.current[key] = intervalId;\n\n return soundInstance;\n },\n [loadSound],\n );\n\n const stop = useCallback((key: CircleSoundKey, immediately: boolean = true) => {\n const soundInstance = soundMapper[key];\n\n if (soundInstancePromise[key] !== undefined) {\n soundInstancePromise[key]\n ?.then(() => {\n if (!soundInstance) return;\n\n if (immediately) {\n soundInstance.pause();\n\n return;\n }\n\n const intervalId = setInterval(() => {\n if (!soundInstance) {\n clearInterval(intervalId);\n\n return;\n }\n\n const vol = soundInstance.volume || 0;\n\n if (vol - 0.1 <= 0) {\n soundInstance.volume = 0;\n soundInstance.pause();\n clearInterval(intervalId);\n } else {\n soundInstance.volume = vol - 0.1;\n }\n }, 100);\n\n timeoutRefs.current[key] = intervalId;\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.log('sound not playing', err);\n });\n }\n }, []);\n\n return { playSwipSound, play, stop, playButtonSound };\n};\n"],"names":["swipeSoundIndex","soundMapper","CircleSoundKey","soundInstancePromise","useCircleSounds","loadSound","useCallback","key","loadedSound","CircleSoundKeyMapper","pausedSoundsRef","useRef","timeoutRefs","handleVisibilityChange","sound","useEffect","timeouts","id","playSwipSound","SWIPE_SOUND_ORDER","_a","playButtonSound","play","immediately","loop","soundInstance","promise","intervalId","vol","stop","err"],"mappings":";;;AAOA,IAAIA,IAAkB;AAEf,MAAMC,IAAkF;AAAA,EAC7F,CAACC,EAAe,UAAU,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AAG,IAAIoB;AAAA,IAAA,GAE5B,MAAM,CAAOG,MAAA;AAEJ,cAAA,IAAI,qBAAqBA,CAAG;AAAA,IAAA;AAAA,EAG5C,GAAG,CAAE,CAAA;AAEL,SAAO,EAAE,eAAAZ,GAAe,MAAAI,GAAM,MAAAO,GAAM,iBAAAR,EAAgB;AACtD;"}
@@ -1,20 +1,17 @@
1
- import { createContext as o } from "react";
2
- import { CANVAS_COLORS as e } from "./constants/constants.js";
3
- const v = o({
1
+ import { createContext as t } from "react";
2
+ import { CANVAS_COLORS as o } from "./constants/constants.js";
3
+ const c = t({
4
4
  activeInstance: void 0,
5
5
  setActiveInstance: () => {
6
6
  },
7
7
  activeTool: "pen",
8
8
  setActiveTool: () => {
9
9
  },
10
- activeColor: Object.keys(e)[0],
10
+ activeColor: Object.keys(o)[0],
11
11
  setActiveColor: () => {
12
- },
13
- homeworkId: void 0,
14
- setHomeworkId: () => {
15
12
  }
16
13
  });
17
14
  export {
18
- v as default
15
+ c as default
19
16
  };
20
17
  //# sourceMappingURL=cue-canvas-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cue-canvas-context.js","sources":["../../../src/features/cue-canvas/cue-canvas-context.tsx"],"sourcesContent":["import type { TPolyContextValue } from './types/context';\nimport type { TCueCanvasColors } from './types/cue-canvas';\n\nimport { createContext } from 'react';\n\nimport { CANVAS_COLORS } from './constants/constants';\n\nconst PolyContext = createContext<TPolyContextValue>({\n activeInstance: undefined,\n setActiveInstance: () => undefined,\n activeTool: 'pen',\n setActiveTool: () => undefined,\n activeColor: Object.keys(CANVAS_COLORS)[0] as TCueCanvasColors,\n setActiveColor: () => undefined,\n homeworkId: undefined,\n setHomeworkId: () => undefined,\n});\n\nexport default PolyContext;\n"],"names":["PolyContext","createContext","CANVAS_COLORS"],"mappings":";;AAOA,MAAMA,IAAcC,EAAiC;AAAA,EACnD,gBAAgB;AAAA,EAChB,mBAAmB,MAAM;AAAA;AAAA,EACzB,YAAY;AAAA,EACZ,eAAe,MAAM;AAAA;AAAA,EACrB,aAAa,OAAO,KAAKC,CAAa,EAAE,CAAC;AAAA,EACzC,gBAAgB,MAAM;AAAA;AAAA,EACtB,YAAY;AAAA,EACZ,eAAe,MAAM;AAAA;AACvB,CAAC;"}
1
+ {"version":3,"file":"cue-canvas-context.js","sources":["../../../src/features/cue-canvas/cue-canvas-context.tsx"],"sourcesContent":["import type { TPolyContextValue } from './types/context';\nimport type { TCueCanvasColors } from './types/cue-canvas';\n\nimport { createContext } from 'react';\n\nimport { CANVAS_COLORS } from './constants/constants';\n\nconst PolyContext = createContext<TPolyContextValue>({\n activeInstance: undefined,\n setActiveInstance: () => undefined,\n activeTool: 'pen',\n setActiveTool: () => undefined,\n activeColor: Object.keys(CANVAS_COLORS)[0] as TCueCanvasColors,\n setActiveColor: () => undefined,\n});\n\nexport default PolyContext;\n"],"names":["PolyContext","createContext","CANVAS_COLORS"],"mappings":";;AAOA,MAAMA,IAAcC,EAAiC;AAAA,EACnD,gBAAgB;AAAA,EAChB,mBAAmB,MAAM;AAAA;AAAA,EACzB,YAAY;AAAA,EACZ,eAAe,MAAM;AAAA;AAAA,EACrB,aAAa,OAAO,KAAKC,CAAa,EAAE,CAAC;AAAA,EACzC,gBAAgB,MAAM;AAAA;AACxB,CAAC;"}
@@ -1,22 +1,20 @@
1
- var u = Object.defineProperty;
2
- var g = (c, t, e) => t in c ? u(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
3
- var s = (c, t, e) => g(c, typeof t != "symbol" ? t + "" : t, e);
4
- import { captureMessage as v } from "@sentry/browser";
5
- import f from "../../node_modules/lodash.debounce/index.js";
6
- import { removeTileButton as y, removeMask as C, checkTextOrEquationTool as m, getReverseMap as T, getToolAndSubtool as w } from "./cue-canvas-helpers.js";
7
- class E {
1
+ var d = Object.defineProperty;
2
+ var u = (r, t, e) => t in r ? d(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var s = (r, t, e) => u(r, typeof t != "symbol" ? t + "" : t, e);
4
+ import v from "../../node_modules/lodash.debounce/index.js";
5
+ import { removeTileButton as f, removeMask as g, checkTextOrEquationTool as y, getReverseMap as C, getToolAndSubtool as m } from "./cue-canvas-helpers.js";
6
+ class b {
8
7
  constructor({
9
8
  onPublish: t,
10
9
  onSubscribe: e,
11
10
  onUpdateActiveTool: a,
12
- onUpdateHeight: i,
11
+ onUpdateHeight: n,
13
12
  uploadImageToS3: o,
14
- height: n,
15
- userId: h,
16
- canvasId: r,
17
- userType: l,
18
- renderAs: p,
19
- updateCanvasConfig: d
13
+ height: i,
14
+ userId: l,
15
+ canvasId: h,
16
+ userType: c,
17
+ renderAs: p
20
18
  }) {
21
19
  s(this, "polycanvas");
22
20
  s(this, "publish");
@@ -30,22 +28,22 @@ class E {
30
28
  s(this, "fileInput", null);
31
29
  s(this, "debouncedViewportChange");
32
30
  s(this, "uploadImageToS3");
33
- s(this, "updateCanvasConfigChange");
34
- s(this, "gridName");
35
- s(this, "publishToChannel", (t) => {
31
+ s(this, "publishToChannel", (t, e, a) => {
36
32
  this.publish && this.publish({
37
33
  eventName: "cue_canvas_changed",
38
34
  eventPayload: {
39
35
  data: t,
40
36
  height: this.height,
41
37
  userId: this.userId,
42
- responseId: this.canvasId
38
+ responseId: this.canvasId,
39
+ gridName: e,
40
+ dimension: a
43
41
  }
44
42
  });
45
43
  });
46
44
  s(this, "onChange", (t) => {
47
45
  const a = Object.fromEntries(t.entries());
48
- m(a) && this.onUpdateActiveTool("move"), this.publishToChannel(a);
46
+ y(a) && this.onUpdateActiveTool("move"), this.publishToChannel(a);
49
47
  });
50
48
  s(this, "undo", () => {
51
49
  if (!this.polycanvas)
@@ -53,7 +51,7 @@ class E {
53
51
  const t = this.polycanvas.undo();
54
52
  if (!t)
55
53
  return;
56
- const e = T(t);
54
+ const e = C(t);
57
55
  this.onChange(e);
58
56
  });
59
57
  s(this, "redo", () => {
@@ -75,7 +73,6 @@ class E {
75
73
  const t = this.polycanvas.getViewport();
76
74
  this.polycanvas.setViewport(t.x, t.y, t.zoom * 0.9);
77
75
  });
78
- s(this, "getCanvasAsImage", async () => this.polycanvas ? await this.polycanvas.image(3e3, 3e3, "png") : void 0);
79
76
  s(this, "downloadCanvasAsImage", async () => {
80
77
  if (!this.polycanvas) return;
81
78
  const t = await this.polycanvas.image(3e3, 3e3, "png");
@@ -83,103 +80,96 @@ class E {
83
80
  const e = document.createElement("a");
84
81
  e.href = t, e.download = `canvas-drawing-${Date.now()}.png`, e.click();
85
82
  });
83
+ s(this, "uploadFileToCanvas", async (t) => new Promise((e, a) => {
84
+ this.uploadImageToS3 ? e(this.uploadImageToS3(t)) : a(new Error("Upload function not provided"));
85
+ }));
86
86
  s(this, "onViewPortChange", (t) => {
87
- this.updateCanvasConfigChange && this.updateCanvasConfigChange({ dimesion: t });
87
+ if (!this.publish) return;
88
+ const e = t;
89
+ this.publishToChannel({}, void 0, e);
88
90
  });
89
91
  s(this, "openFileUpload", () => {
90
- this.fileInput || (this.fileInput = document.createElement("input"), this.fileInput.type = "file", this.fileInput.accept = "image/*", this.fileInput.style.display = "none", this.fileInput.onchange = this.onSelectImage, document.body.appendChild(this.fileInput)), this.fileInput.click();
92
+ this.fileInput || (this.fileInput = document.createElement("input"), this.fileInput.type = "file", this.fileInput.accept = "image/*", this.fileInput.style.display = "none", this.fileInput.onchange = this.addImageToCanvas, document.body.appendChild(this.fileInput)), this.fileInput.click();
91
93
  });
92
- s(this, "addImageToCanvas", (t) => {
93
- if (!this.polycanvas) return;
94
- const e = this.polycanvas.getViewport(), a = {
94
+ s(this, "addImageToCanvas", async (t) => {
95
+ var h;
96
+ const e = t.target, a = (h = e.files) == null ? void 0 : h[0];
97
+ if (!a || !this.polycanvas || !this.uploadImageToS3) return;
98
+ const n = await this.uploadImageToS3(a), o = this.polycanvas.getViewport(), i = {
95
99
  name: "image",
96
- href: t,
97
- x: e.x + 24,
98
- y: e.y + 24,
99
- width: 500
100
- }, i = this.polycanvas.add({
101
- ...a
100
+ href: n,
101
+ x: o.x + 88,
102
+ y: o.y + 88
103
+ }, l = this.polycanvas.add({
104
+ ...i
102
105
  });
103
106
  this.publishToChannel({
104
- [i]: [void 0, { ...a, status: "locked" }]
105
- });
107
+ [l]: [void 0, { ...i, status: "locked" }]
108
+ }), e.value = "";
106
109
  });
107
- s(this, "onSelectImage", async (t) => {
108
- var o;
109
- const e = t.target, a = (o = e.files) == null ? void 0 : o[0];
110
- if (!a || !this.polycanvas || !this.uploadImageToS3) return;
111
- const i = await this.uploadImageToS3(a);
112
- i !== "error" && (this.addImageToCanvas(i), e.value = "");
110
+ s(this, "updateCanvasConfig", (t, e, a) => {
111
+ this.polycanvas && (t > this.height && this.updateHeight(t), e && this.polycanvas.setViewport(e.x, e.y, e.zoom), a && this.polycanvas.setOptions({
112
+ grid: a
113
+ }));
113
114
  });
114
115
  s(this, "updateCanvas", ({ data: t, userId: e }) => {
115
116
  const a = this.userType === "TEACHER" || e === this.userId;
116
- try {
117
- Object.entries(t).forEach(([i, o]) => {
118
- var n, h, r;
119
- !o[0] && o[1] ? ("name" in o[1] && o[1].name === "image" && (o[1].status = this.userType === "STUDENT" ? "locked" : void 0), (n = this.polycanvas) == null || n.add({ ...o[1], cannotEdit: !a }, i)) : o[0] && !o[1] ? (h = this.polycanvas) == null || h.delete(i) : o[0] && o[1] && ((r = this.polycanvas) == null || r.update(i, { ...o[1] }));
120
- });
121
- } catch {
122
- v("Error Updating Canvas", t);
123
- }
117
+ Object.entries(t).forEach(([n, o]) => {
118
+ var i, l, h;
119
+ !o[0] && o[1] ? (i = this.polycanvas) == null || i.add({ ...o[1], cannotEdit: !a }, n) : o[0] && !o[1] ? (l = this.polycanvas) == null || l.delete(n) : o[0] && o[1] && ((h = this.polycanvas) == null || h.update(n, { ...o[1] }));
120
+ });
124
121
  });
125
122
  s(this, "toggleTiles", (t) => {
126
123
  var e;
127
124
  (e = this.polycanvas) == null || e.toggleSidebar(t);
128
125
  });
129
- s(this, "setViewPort", ({ x: t, y: e, zoom: a }) => {
130
- var i;
131
- if (this.polycanvas) {
132
- const o = (i = this.polycanvas) == null ? void 0 : i.getViewport();
133
- if (o.x === t && o.y === e && o.zoom === a)
134
- return;
135
- this.polycanvas.setViewport(t, e, a);
136
- }
137
- });
138
126
  s(this, "resetViewPort", () => {
139
127
  this.polycanvas && this.polycanvas.resetViewport();
140
128
  });
141
129
  s(this, "changeGrid", (t) => {
142
- !this.polycanvas || this.gridName === t || (this.polycanvas.setOptions({
130
+ this.polycanvas && (this.polycanvas.setOptions({
143
131
  grid: t
144
- }), this.gridName = t, this.updateCanvasConfigChange && this.updateCanvasConfigChange({ gridName: t }));
132
+ }), this.publishToChannel({}, t));
145
133
  });
146
134
  s(this, "lockSelectedTiles", () => {
147
- var a, i;
148
- const { tiles: t } = ((a = this.polycanvas) == null ? void 0 : a.serialize()) || {}, e = ((i = this.polycanvas) == null ? void 0 : i.getSelection()) || [];
135
+ var a, n;
136
+ const { tiles: t } = ((a = this.polycanvas) == null ? void 0 : a.serialize()) || {}, e = ((n = this.polycanvas) == null ? void 0 : n.getSelection()) || [];
149
137
  if (e.length > 0 && t) {
150
138
  const o = {};
151
- e.forEach((n) => {
152
- var r, l, p;
153
- if (!((r = t[n]) != null && r.name)) return;
154
- const h = { ...t[n], status: "locked" };
155
- (l = this.polycanvas) == null || l.update(n, h), (p = t[n]) != null && p.name && (o[n] = [t[n], h]);
139
+ e.forEach((i) => {
140
+ var h, c, p;
141
+ if (!((h = t[i]) != null && h.name)) return;
142
+ const l = { ...t[i], status: "locked" };
143
+ (c = this.polycanvas) == null || c.update(i, l), (p = t[i]) != null && p.name && (o[i] = [t[i], l]);
156
144
  }), this.publishToChannel(o);
157
145
  }
158
146
  });
159
147
  s(this, "unlockAllTiles", () => {
160
148
  if (!this.polycanvas) return;
161
149
  const { tiles: t } = this.polycanvas.serialize(), e = {};
162
- t && Object.entries(t).length > 0 && (Object.entries(t).forEach(([a, i]) => {
163
- var n;
164
- if (i.status !== "locked") return;
165
- const o = { ...i, status: void 0 };
166
- (n = this.polycanvas) == null || n.update(a, o), e[a] = [i, o];
150
+ t && Object.entries(t).length > 0 && (Object.entries(t).forEach(([a, n]) => {
151
+ var i;
152
+ if (n.status !== "locked") return;
153
+ const o = { ...n, status: void 0 };
154
+ (i = this.polycanvas) == null || i.update(a, o), e[a] = [n, o];
167
155
  }), this.publishToChannel(e));
168
156
  });
169
157
  s(this, "replaceCanvas", (t) => {
170
158
  if (!this.polycanvas) return;
171
159
  const { data: e, gridName: a } = t;
172
- this.polycanvas.clear(), a && this.changeGrid(a), Object.entries(e).forEach(([i, o]) => {
173
- var n;
160
+ this.polycanvas.clear(), a && this.polycanvas.setOptions({
161
+ grid: a
162
+ }), Object.entries(e).forEach(([n, o]) => {
163
+ var i;
174
164
  if (!o[0] && o[1]) {
175
- (n = this.polycanvas) == null || n.add({ ...o[1] }, i);
165
+ (i = this.polycanvas) == null || i.add({ ...o[1] }, n);
176
166
  return;
177
167
  }
178
- }), this.publishToChannel(e);
168
+ }), this.publishToChannel(e, a);
179
169
  });
180
170
  s(this, "setTool", (t) => {
181
171
  if (this.polycanvas) {
182
- const [e, a] = w(t);
172
+ const [e, a] = m(t);
183
173
  switch (e) {
184
174
  case "clearAll":
185
175
  this.clearCanvas();
@@ -232,10 +222,10 @@ class E {
232
222
  */
233
223
  s(this, "update", (t) => {
234
224
  if (Array.isArray(t)) {
235
- const e = t.map((i) => i.height).filter(Boolean), a = Math.max(...e);
236
- a > this.height && this.updateHeight(a), t.forEach((i) => this.updateCanvas(i));
225
+ const e = t.map((i) => i.height).filter(Boolean), a = Math.max(...e), n = t.map((i) => i.dimension).filter(Boolean)[t.length - 1], o = t.map((i) => i.gridName).filter(Boolean)[t.length - 1];
226
+ this.updateCanvasConfig(a, n, o), t.forEach((i) => this.updateCanvas(i));
237
227
  } else
238
- t.height > this.height && this.updateHeight(t.height), this.updateCanvas(t);
228
+ this.updateCanvasConfig(t.height, t.dimension, t == null ? void 0 : t.gridName), this.updateCanvas(t);
239
229
  });
240
230
  s(this, "setColor", (t) => {
241
231
  this.polycanvas && this.polycanvas.setColor(t);
@@ -247,9 +237,9 @@ class E {
247
237
  s(this, "destroy", () => {
248
238
  this.polycanvas && (this.polycanvas.off("change", this.onChange), this.polycanvas.destroy(), this.debouncedViewportChange.cancel(), this.renderAs === "whiteboard" && this.userType === "TEACHER" && this.polycanvas.off("viewport", this.debouncedViewportChange), this.polycanvas = void 0, this.fileInput && this.fileInput.parentNode && (this.fileInput.parentNode.removeChild(this.fileInput), this.fileInput = null));
249
239
  });
250
- this.onUpdateHeight = i, this.onUpdateActiveTool = a, this.height = n, this.uploadImageToS3 = o, this.userId = h, this.canvasId = r, this.publish = t, this.userType = l, this.renderAs = p, this.debouncedViewportChange = f(this.onViewPortChange, 300), this.updateCanvasConfigChange = d, e == null || e(this.canvasId, this.update);
240
+ this.onUpdateHeight = n, this.onUpdateActiveTool = a, this.height = i, this.uploadImageToS3 = o, this.userId = l, this.canvasId = h, this.publish = t, this.userType = c, this.renderAs = p, this.debouncedViewportChange = v(this.onViewPortChange, 300), e == null || e(this.canvasId, this.update);
251
241
  }
252
- async create({ canvasElementRef: t, canvasConfig: e, canvasSetting: a, initialData: i }) {
242
+ async create({ canvasElementRef: t, canvasConfig: e, canvasSetting: a, initialData: n }) {
253
243
  if (!t.current)
254
244
  throw new Error("PolyCanvas: Div Element Not found for canvas");
255
245
  this.polycanvas = await window.Polypad.create(t.current, {
@@ -257,11 +247,11 @@ class E {
257
247
  options: e
258
248
  },
259
249
  ...a,
260
- imageUpload: this.renderAs === "whiteboard" && this.userType === "TEACHER" && this.uploadImageToS3 ? this.uploadImageToS3 : void 0
261
- }), this.renderAs === "whiteboard" && this.userType === "TEACHER" && (this.polycanvas.toggleSidebar(!1), this.polycanvas.bindKeyboardEvents({}), y(t), this.polycanvas.on("viewport", this.debouncedViewportChange)), C(t), this.polycanvas.on("change", this.onChange), i && this.update(i);
250
+ imageUpload: this.renderAs === "whiteboard" && this.userType === "TEACHER" ? this.uploadFileToCanvas : void 0
251
+ }), this.renderAs === "whiteboard" && this.userType === "TEACHER" && (this.polycanvas.toggleSidebar(!1), f(t), this.polycanvas.on("viewport", this.debouncedViewportChange)), g(t), this.polycanvas.on("change", this.onChange), n && this.update(n);
262
252
  }
263
253
  }
264
254
  export {
265
- E as CueCanvasCore
255
+ b as CueCanvasCore
266
256
  };
267
257
  //# sourceMappingURL=cue-canvas-core.js.map