@magmamath/students-features 0.6.5-rc-21 → 0.6.5-rc.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 (201) hide show
  1. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +3 -3
  2. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +1 -3
  4. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +2 -4
  6. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  7. package/dist/commonjs/features/chatbot/model/constants.js.map +1 -1
  8. package/dist/commonjs/features/chatbot/model/translation.js +0 -7
  9. package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
  10. package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js +3 -17
  11. package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -1
  12. package/dist/commonjs/features/feedback/model/comments.js +3 -5
  13. package/dist/commonjs/features/feedback/model/comments.js.map +1 -1
  14. package/dist/commonjs/features/feedback/model/model.js +9 -7
  15. package/dist/commonjs/features/feedback/model/model.js.map +1 -1
  16. package/dist/commonjs/features/gifCelebrations/GifCelebrations.js +65 -0
  17. package/dist/commonjs/features/gifCelebrations/GifCelebrations.js.map +1 -0
  18. package/dist/commonjs/features/gifCelebrations/assets/confetti.webp +0 -0
  19. package/dist/commonjs/features/gifCelebrations/components/Backdrop.js +44 -0
  20. package/dist/commonjs/features/gifCelebrations/components/Backdrop.js.map +1 -0
  21. package/dist/commonjs/features/gifCelebrations/components/ContentContainer.js +46 -0
  22. package/dist/commonjs/features/gifCelebrations/components/ContentContainer.js.map +1 -0
  23. package/dist/commonjs/features/gifCelebrations/components/Gif.js +63 -0
  24. package/dist/commonjs/features/gifCelebrations/components/Gif.js.map +1 -0
  25. package/dist/commonjs/features/gifCelebrations/components/Progress.js +102 -0
  26. package/dist/commonjs/features/gifCelebrations/components/Progress.js.map +1 -0
  27. package/dist/commonjs/features/gifCelebrations/constants.js +18 -0
  28. package/dist/commonjs/features/gifCelebrations/constants.js.map +1 -0
  29. package/dist/commonjs/features/gifCelebrations/helpers.js +67 -0
  30. package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -0
  31. package/dist/commonjs/features/gifCelebrations/index.js +20 -0
  32. package/dist/commonjs/features/gifCelebrations/index.js.map +1 -0
  33. package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.cache.js +19 -0
  34. package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.cache.js.map +1 -0
  35. package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.model.js +151 -0
  36. package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.model.js.map +1 -0
  37. package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsApi.js +14 -0
  38. package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsApi.js.map +1 -0
  39. package/dist/commonjs/features/gifCelebrations/types/model.types.js +6 -0
  40. package/dist/commonjs/features/gifCelebrations/types/model.types.js.map +1 -0
  41. package/dist/commonjs/index.js +12 -0
  42. package/dist/commonjs/index.js.map +1 -1
  43. package/dist/commonjs/shared/hooks/useImagePreloader.js +20 -0
  44. package/dist/commonjs/shared/hooks/useImagePreloader.js.map +1 -0
  45. package/dist/commonjs/shared/translation/localization/en.json +1 -2
  46. package/dist/commonjs/shared/translation/localization/gb.json +1 -2
  47. package/dist/commonjs/shared/translation/localization/sw.json +1 -2
  48. package/dist/module/features/chatbot/model/ChatBotModel.js +3 -3
  49. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  50. package/dist/module/features/chatbot/model/ChatBoxTextManager.js +1 -3
  51. package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  52. package/dist/module/features/chatbot/model/DefaultMessageCreator.js +2 -4
  53. package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  54. package/dist/module/features/chatbot/model/constants.js.map +1 -1
  55. package/dist/module/features/chatbot/model/translation.js +0 -7
  56. package/dist/module/features/chatbot/model/translation.js.map +1 -1
  57. package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js +4 -19
  58. package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -1
  59. package/dist/module/features/feedback/model/comments.js +3 -5
  60. package/dist/module/features/feedback/model/comments.js.map +1 -1
  61. package/dist/module/features/feedback/model/model.js +9 -7
  62. package/dist/module/features/feedback/model/model.js.map +1 -1
  63. package/dist/module/features/gifCelebrations/GifCelebrations.js +58 -0
  64. package/dist/module/features/gifCelebrations/GifCelebrations.js.map +1 -0
  65. package/dist/module/features/gifCelebrations/assets/confetti.webp +0 -0
  66. package/dist/module/features/gifCelebrations/components/Backdrop.js +36 -0
  67. package/dist/module/features/gifCelebrations/components/Backdrop.js.map +1 -0
  68. package/dist/module/features/gifCelebrations/components/ContentContainer.js +38 -0
  69. package/dist/module/features/gifCelebrations/components/ContentContainer.js.map +1 -0
  70. package/dist/module/features/gifCelebrations/components/Gif.js +56 -0
  71. package/dist/module/features/gifCelebrations/components/Gif.js.map +1 -0
  72. package/dist/module/features/gifCelebrations/components/Progress.js +94 -0
  73. package/dist/module/features/gifCelebrations/components/Progress.js.map +1 -0
  74. package/dist/module/features/gifCelebrations/constants.js +14 -0
  75. package/dist/module/features/gifCelebrations/constants.js.map +1 -0
  76. package/dist/module/features/gifCelebrations/helpers.js +61 -0
  77. package/dist/module/features/gifCelebrations/helpers.js.map +1 -0
  78. package/dist/module/features/gifCelebrations/index.js +5 -0
  79. package/dist/module/features/gifCelebrations/index.js.map +1 -0
  80. package/dist/module/features/gifCelebrations/model/GifCelebrations.cache.js +14 -0
  81. package/dist/module/features/gifCelebrations/model/GifCelebrations.cache.js.map +1 -0
  82. package/dist/module/features/gifCelebrations/model/GifCelebrations.model.js +146 -0
  83. package/dist/module/features/gifCelebrations/model/GifCelebrations.model.js.map +1 -0
  84. package/dist/module/features/gifCelebrations/model/GifCelebrationsApi.js +9 -0
  85. package/dist/module/features/gifCelebrations/model/GifCelebrationsApi.js.map +1 -0
  86. package/dist/module/features/gifCelebrations/types/model.types.js +4 -0
  87. package/dist/module/features/gifCelebrations/types/model.types.js.map +1 -0
  88. package/dist/module/index.js +1 -0
  89. package/dist/module/index.js.map +1 -1
  90. package/dist/module/shared/hooks/useImagePreloader.js +15 -0
  91. package/dist/module/shared/hooks/useImagePreloader.js.map +1 -0
  92. package/dist/module/shared/translation/localization/en.json +1 -2
  93. package/dist/module/shared/translation/localization/gb.json +1 -2
  94. package/dist/module/shared/translation/localization/sw.json +1 -2
  95. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  96. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +1 -2
  97. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  98. package/dist/typescript/commonjs/features/chatbot/model/constants.d.ts.map +1 -1
  99. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
  100. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -1
  101. package/dist/typescript/commonjs/features/gifCelebrations/GifCelebrations.d.ts +8 -0
  102. package/dist/typescript/commonjs/features/gifCelebrations/GifCelebrations.d.ts.map +1 -0
  103. package/dist/typescript/commonjs/features/gifCelebrations/components/Backdrop.d.ts +9 -0
  104. package/dist/typescript/commonjs/features/gifCelebrations/components/Backdrop.d.ts.map +1 -0
  105. package/dist/typescript/commonjs/features/gifCelebrations/components/ContentContainer.d.ts +9 -0
  106. package/dist/typescript/commonjs/features/gifCelebrations/components/ContentContainer.d.ts.map +1 -0
  107. package/dist/typescript/commonjs/features/gifCelebrations/components/Gif.d.ts +7 -0
  108. package/dist/typescript/commonjs/features/gifCelebrations/components/Gif.d.ts.map +1 -0
  109. package/dist/typescript/commonjs/features/gifCelebrations/components/Progress.d.ts +9 -0
  110. package/dist/typescript/commonjs/features/gifCelebrations/components/Progress.d.ts.map +1 -0
  111. package/dist/typescript/commonjs/features/gifCelebrations/constants.d.ts +12 -0
  112. package/dist/typescript/commonjs/features/gifCelebrations/constants.d.ts.map +1 -0
  113. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts +75 -0
  114. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -0
  115. package/dist/typescript/commonjs/features/gifCelebrations/index.d.ts +3 -0
  116. package/dist/typescript/commonjs/features/gifCelebrations/index.d.ts.map +1 -0
  117. package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.cache.d.ts +8 -0
  118. package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.cache.d.ts.map +1 -0
  119. package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.model.d.ts +23 -0
  120. package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.model.d.ts.map +1 -0
  121. package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsApi.d.ts +6 -0
  122. package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsApi.d.ts.map +1 -0
  123. package/dist/typescript/commonjs/features/gifCelebrations/types/model.types.d.ts +32 -0
  124. package/dist/typescript/commonjs/features/gifCelebrations/types/model.types.d.ts.map +1 -0
  125. package/dist/typescript/commonjs/index.d.ts +1 -0
  126. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  127. package/dist/typescript/commonjs/shared/hooks/useImagePreloader.d.ts +4 -0
  128. package/dist/typescript/commonjs/shared/hooks/useImagePreloader.d.ts.map +1 -0
  129. package/dist/typescript/commonjs/shared/translation/constants.d.ts +0 -3
  130. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  131. package/dist/typescript/commonjs/shared/translation/model.d.ts +0 -2
  132. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  133. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  134. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +1 -2
  135. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  136. package/dist/typescript/module/features/chatbot/model/constants.d.ts.map +1 -1
  137. package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
  138. package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -1
  139. package/dist/typescript/module/features/gifCelebrations/GifCelebrations.d.ts +8 -0
  140. package/dist/typescript/module/features/gifCelebrations/GifCelebrations.d.ts.map +1 -0
  141. package/dist/typescript/module/features/gifCelebrations/components/Backdrop.d.ts +9 -0
  142. package/dist/typescript/module/features/gifCelebrations/components/Backdrop.d.ts.map +1 -0
  143. package/dist/typescript/module/features/gifCelebrations/components/ContentContainer.d.ts +9 -0
  144. package/dist/typescript/module/features/gifCelebrations/components/ContentContainer.d.ts.map +1 -0
  145. package/dist/typescript/module/features/gifCelebrations/components/Gif.d.ts +7 -0
  146. package/dist/typescript/module/features/gifCelebrations/components/Gif.d.ts.map +1 -0
  147. package/dist/typescript/module/features/gifCelebrations/components/Progress.d.ts +9 -0
  148. package/dist/typescript/module/features/gifCelebrations/components/Progress.d.ts.map +1 -0
  149. package/dist/typescript/module/features/gifCelebrations/constants.d.ts +12 -0
  150. package/dist/typescript/module/features/gifCelebrations/constants.d.ts.map +1 -0
  151. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts +75 -0
  152. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -0
  153. package/dist/typescript/module/features/gifCelebrations/index.d.ts +3 -0
  154. package/dist/typescript/module/features/gifCelebrations/index.d.ts.map +1 -0
  155. package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.cache.d.ts +8 -0
  156. package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.cache.d.ts.map +1 -0
  157. package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.model.d.ts +23 -0
  158. package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.model.d.ts.map +1 -0
  159. package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsApi.d.ts +6 -0
  160. package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsApi.d.ts.map +1 -0
  161. package/dist/typescript/module/features/gifCelebrations/types/model.types.d.ts +32 -0
  162. package/dist/typescript/module/features/gifCelebrations/types/model.types.d.ts.map +1 -0
  163. package/dist/typescript/module/index.d.ts +1 -0
  164. package/dist/typescript/module/index.d.ts.map +1 -1
  165. package/dist/typescript/module/shared/hooks/useImagePreloader.d.ts +4 -0
  166. package/dist/typescript/module/shared/hooks/useImagePreloader.d.ts.map +1 -0
  167. package/dist/typescript/module/shared/translation/constants.d.ts +0 -3
  168. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  169. package/dist/typescript/module/shared/translation/model.d.ts +0 -2
  170. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  171. package/package.json +1 -1
  172. package/src/features/chatbot/model/ChatBotModel.ts +1 -1
  173. package/src/features/chatbot/model/ChatBoxTextManager.ts +1 -3
  174. package/src/features/chatbot/model/DefaultMessageCreator.ts +2 -4
  175. package/src/features/chatbot/model/constants.ts +2 -0
  176. package/src/features/chatbot/model/translation.ts +0 -9
  177. package/src/features/endOfAssignment/components/Modal/ModalBackground.tsx +3 -14
  178. package/src/features/feedback/model/comments.ts +7 -7
  179. package/src/features/feedback/model/model.ts +6 -6
  180. package/src/features/gifCelebrations/GifCelebrations.tsx +75 -0
  181. package/src/features/gifCelebrations/assets/confetti.webp +0 -0
  182. package/src/features/gifCelebrations/components/Backdrop.tsx +40 -0
  183. package/src/features/gifCelebrations/components/ContentContainer.tsx +43 -0
  184. package/src/features/gifCelebrations/components/Gif.tsx +61 -0
  185. package/src/features/gifCelebrations/components/Progress.tsx +108 -0
  186. package/src/features/gifCelebrations/constants.ts +13 -0
  187. package/src/features/gifCelebrations/helpers.ts +68 -0
  188. package/src/features/gifCelebrations/index.ts +2 -0
  189. package/src/features/gifCelebrations/model/GifCelebrations.cache.ts +24 -0
  190. package/src/features/gifCelebrations/model/GifCelebrations.model.ts +177 -0
  191. package/src/features/gifCelebrations/model/GifCelebrationsApi.ts +10 -0
  192. package/src/features/gifCelebrations/types/model.types.ts +36 -0
  193. package/src/index.ts +1 -0
  194. package/src/shared/hooks/useImagePreloader.ts +15 -0
  195. package/src/shared/translation/localization/en.json +1 -2
  196. package/src/shared/translation/localization/gb.json +1 -2
  197. package/src/shared/translation/localization/sw.json +1 -2
  198. package/src/types/types.d.ts +0 -5
  199. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/goblet-bg.webp +0 -0
  200. package/dist/module/features/endOfAssignment/components/Modal/assets/goblet-bg.webp +0 -0
  201. package/src/features/endOfAssignment/components/Modal/assets/goblet-bg.webp +0 -0
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Gif = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactNativeUi = require("@magmamath/react-native-ui");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
+ const mock = 'https://media3.giphy.com/media/v1.Y2lkPWZhYjgxNWZhN3lucHRuYjZtMzRiNTZkeXo3NTBrNzIwejcwdXp0Y3g1c2k2ODA2eiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/lCSABZRhMw6pW/giphy.gif';
14
+ const Gif = ({
15
+ uri
16
+ }) => {
17
+ const [size, setSize] = (0, _react.useState)(null);
18
+ console.log('size: ', size);
19
+ (0, _react.useLayoutEffect)(() => {
20
+ _reactNative.Image.getSize(uri, (width, height) => {
21
+ setSize({
22
+ width: width > 480 ? 480 : width,
23
+ height: height > 300 ? 300 : height
24
+ });
25
+ });
26
+ }, [uri]);
27
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
28
+ style: styles.backgroundContainer,
29
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
30
+ style: styles.container,
31
+ children: size && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
32
+ alt: "Celebration GIF",
33
+ source: {
34
+ uri
35
+ },
36
+ width: size.width,
37
+ height: size.height,
38
+ style: [styles.image, {
39
+ width: size.width,
40
+ height: size.height
41
+ }] //this sizes duplication is needed for compatibility with web and rn
42
+ })
43
+ })
44
+ });
45
+ };
46
+ exports.Gif = Gif;
47
+ const styles = _reactNative.StyleSheet.create({
48
+ backgroundContainer: {
49
+ backgroundColor: 'rgba(255, 255, 255, 0.6)',
50
+ borderRadius: 23,
51
+ padding: _reactNativeUi.SPACING[200]
52
+ },
53
+ container: {
54
+ padding: _reactNativeUi.SPACING[1600],
55
+ borderRadius: _reactNativeUi.BORDER_RADIUS[400],
56
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1
57
+ },
58
+ image: {
59
+ borderRadius: _reactNativeUi.BORDER_RADIUS[100],
60
+ backgroundColor: 'orange'
61
+ }
62
+ });
63
+ //# sourceMappingURL=Gif.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireWildcard","_reactNativeUi","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","mock","Gif","uri","size","setSize","useState","console","log","useLayoutEffect","Image","getSize","width","height","jsx","View","style","styles","backgroundContainer","children","container","alt","source","image","exports","StyleSheet","create","backgroundColor","borderRadius","padding","SPACING","BORDER_RADIUS","COLORS","NEUTRAL_1"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/components/Gif.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAA2E,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAA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S,KAAK,EAAER,IAAI,CAACQ,KAAM;QAClBC,MAAM,EAAET,IAAI,CAACS,MAAO;QACpBG,KAAK,EAAE,CAACC,MAAM,CAACM,KAAK,EAAE;UAAEX,KAAK,EAAER,IAAI,CAACQ,KAAK;UAAEC,MAAM,EAAET,IAAI,CAACS;QAAO,CAAC,CAAE,CAAC;MAAA,CACpE;IACF,CACG;EAAC,CACH,CAAC;AAEX,CAAC;AAAAW,OAAA,CAAAtB,GAAA,GAAAA,GAAA;AAED,MAAMe,MAAM,GAAGQ,uBAAU,CAACC,MAAM,CAAC;EAC/BR,mBAAmB,EAAE;IACnBS,eAAe,EAAE,0BAA0B;IAC3CC,YAAY,EAAE,EAAE;IAChBC,OAAO,EAAEC,sBAAO,CAAC,GAAG;EACtB,CAAC;EACDV,SAAS,EAAE;IACTS,OAAO,EAAEC,sBAAO,CAAC,IAAI,CAAC;IACtBF,YAAY,EAAEG,4BAAa,CAAC,GAAG,CAAC;IAChCJ,eAAe,EAAEK,qBAAM,CAACC;EAC1B,CAAC;EACDV,KAAK,EAAE;IACLK,YAAY,EAAEG,4BAAa,CAAC,GAAG,CAAC;IAChCJ,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Progress = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactNativeUi = require("@magmamath/react-native-ui");
10
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ const MIN_WIDTH_FOR_ONE_DIGIT = 12;
16
+ const MIN_WIDTH_FOR_TWO_DIGITS = 15;
17
+ const ADJUSTMENT_FOR_HUNDRED_PERCENT = 1.8;
18
+ const Progress = ({
19
+ progress,
20
+ completedPercent
21
+ }) => {
22
+ const progressLineWidth = (() => {
23
+ if (completedPercent === 100) {
24
+ return completedPercent + ADJUSTMENT_FOR_HUNDRED_PERCENT;
25
+ }
26
+ if (completedPercent <= 9) {
27
+ return MIN_WIDTH_FOR_ONE_DIGIT;
28
+ }
29
+ if (completedPercent <= 15) {
30
+ return MIN_WIDTH_FOR_TWO_DIGITS;
31
+ }
32
+ return completedPercent;
33
+ })();
34
+ const animatedStyles = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
35
+ width: `${(0, _reactNativeReanimated.interpolate)(progress.value, [0, 1, 2], [0, progressLineWidth, progressLineWidth])}%`
36
+ }), [progress, progressLineWidth]);
37
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
38
+ style: styles.backgroundContainer,
39
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
40
+ style: styles.container,
41
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
42
+ style: styles.progressContainer,
43
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
44
+ style: [styles.progress, animatedStyles],
45
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
46
+ variant: _reactNativeUi.HeadingVariants.H1,
47
+ style: styles.percent,
48
+ children: `${completedPercent}%`
49
+ })
50
+ })
51
+ })
52
+ })
53
+ });
54
+ };
55
+ exports.Progress = Progress;
56
+ const styles = _reactNative.StyleSheet.create({
57
+ backgroundContainer: {
58
+ backgroundColor: 'rgba(255, 255, 255, 0.6)',
59
+ borderRadius: 23,
60
+ padding: _reactNativeUi.SPACING[200],
61
+ width: '100%'
62
+ },
63
+ container: {
64
+ width: '100%',
65
+ height: 116,
66
+ flexDirection: 'row',
67
+ alignItems: 'center',
68
+ borderRadius: _reactNativeUi.BORDER_RADIUS[400],
69
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
70
+ paddingLeft: _reactNativeUi.SPACING[400],
71
+ paddingRight: _reactNativeUi.SPACING[200],
72
+ gap: _reactNativeUi.SPACING[100]
73
+ },
74
+ progressContainer: {
75
+ height: 50,
76
+ flexGrow: 1,
77
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_5,
78
+ borderRadius: 90,
79
+ overflow: 'hidden'
80
+ },
81
+ progress: {
82
+ position: 'absolute',
83
+ left: -12,
84
+ height: '100%',
85
+ backgroundColor: _reactNativeUi.COLORS.PRIMARY_BLUE,
86
+ borderRadius: _reactNativeUi.BORDER_RADIUS[200],
87
+ justifyContent: 'center',
88
+ alignItems: 'flex-end',
89
+ paddingRight: 10.6,
90
+ overflow: 'hidden'
91
+ },
92
+ confetti: {
93
+ width: 75,
94
+ height: 70,
95
+ marginHorizontal: _reactNativeUi.SPACING[200]
96
+ },
97
+ percent: {
98
+ color: _reactNativeUi.COLORS.NEUTRAL_1,
99
+ fontWeight: '700'
100
+ }
101
+ });
102
+ //# sourceMappingURL=Progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MIN_WIDTH_FOR_ONE_DIGIT","MIN_WIDTH_FOR_TWO_DIGITS","ADJUSTMENT_FOR_HUNDRED_PERCENT","Progress","progress","completedPercent","progressLineWidth","animatedStyles","useAnimatedStyle","width","interpolate","value","jsx","View","style","styles","backgroundContainer","children","container","progressContainer","Typography","variant","HeadingVariants","H1","percent","exports","StyleSheet","create","backgroundColor","borderRadius","padding","SPACING","height","flexDirection","alignItems","BORDER_RADIUS","COLORS","NEUTRAL_1","paddingLeft","paddingRight","gap","flexGrow","NEUTRAL_5","overflow","position","left","PRIMARY_BLUE","justifyContent","confetti","marginHorizontal","color","fontWeight"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/components/Progress.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAOA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AAA8F,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAA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,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBL,YAAY,EAAEM,4BAAa,CAAC,GAAG,CAAC;IAChCP,eAAe,EAAEQ,qBAAM,CAACC,SAAS;IACjCC,WAAW,EAAEP,sBAAO,CAAC,GAAG,CAAC;IACzBQ,YAAY,EAAER,sBAAO,CAAC,GAAG,CAAC;IAC1BS,GAAG,EAAET,sBAAO,CAAC,GAAG;EAClB,CAAC;EACDZ,iBAAiB,EAAE;IACjBa,MAAM,EAAE,EAAE;IACVS,QAAQ,EAAE,CAAC;IACXb,eAAe,EAAEQ,qBAAM,CAACM,SAAS;IACjCb,YAAY,EAAE,EAAE;IAChBc,QAAQ,EAAE;EACZ,CAAC;EACDvC,QAAQ,EAAE;IACRwC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC,EAAE;IACTb,MAAM,EAAE,MAAM;IACdJ,eAAe,EAAEQ,qBAAM,CAACU,YAAY;IACpCjB,YAAY,EAAEM,4BAAa,CAAC,GAAG,CAAC;IAChCY,cAAc,EAAE,QAAQ;IACxBb,UAAU,EAAE,UAAU;IACtBK,YAAY,EAAE,IAAI;IAClBI,QAAQ,EAAE;EACZ,CAAC;EACDK,QAAQ,EAAE;IACRvC,KAAK,EAAE,EAAE;IACTuB,MAAM,EAAE,EAAE;IACViB,gBAAgB,EAAElB,sBAAO,CAAC,GAAG;EAC/B,CAAC;EACDP,OAAO,EAAE;IACP0B,KAAK,EAAEd,qBAAM,CAACC,SAAS;IACvBc,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MIN_PROBLEMS_TO_SHOW_GIF = exports.CONTENT_CONTAINER = exports.BACKDROP_COLOR = exports.ANIMATION_DURATION = void 0;
7
+ const BACKDROP_COLOR = exports.BACKDROP_COLOR = {
8
+ INITIAL: 'rgba(51, 51, 51, 0)',
9
+ FINAL: 'rgba(51, 51, 51, 0.66)'
10
+ };
11
+ const CONTENT_CONTAINER = exports.CONTENT_CONTAINER = {
12
+ ANGLE: 5,
13
+ CONTAINER_WIDTH: 769,
14
+ SAFE_AREA: 44 // to be sure that the content is not cut off on the edges because of rotate transform
15
+ };
16
+ const ANIMATION_DURATION = exports.ANIMATION_DURATION = 1750;
17
+ const MIN_PROBLEMS_TO_SHOW_GIF = exports.MIN_PROBLEMS_TO_SHOW_GIF = 6;
18
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BACKDROP_COLOR","exports","INITIAL","FINAL","CONTENT_CONTAINER","ANGLE","CONTAINER_WIDTH","SAFE_AREA","ANIMATION_DURATION","MIN_PROBLEMS_TO_SHOW_GIF"],"sourceRoot":"../../../../src","sources":["features/gifCelebrations/constants.ts"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC5BE,OAAO,EAAE,qBAAqB;EAC9BC,KAAK,EAAE;AACT,CAAC;AAEM,MAAMC,iBAAiB,GAAAH,OAAA,CAAAG,iBAAA,GAAG;EAC/BC,KAAK,EAAE,CAAC;EACRC,eAAe,EAAE,GAAG;EACpBC,SAAS,EAAE,EAAE,CAAE;AACjB,CAAC;AAEM,MAAMC,kBAAkB,GAAAP,OAAA,CAAAO,kBAAA,GAAG,IAAI;AAC/B,MAAMC,wBAAwB,GAAAR,OAAA,CAAAQ,wBAAA,GAAG,CAAC","ignoreList":[]}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gifSelect = exports.calculatePercentageTable = void 0;
7
+ // Number of problems When we show gif
8
+ // <6 Never
9
+ // 7-12 50% completion
10
+ // 13-18 33%, 66% completion
11
+ // 19-24 25%, 50%, 75 completion
12
+ // 25-30 20%, 40%, 60%, 80% completion
13
+ // .>30 15%, 30%, 45%, 60%, 75% completion
14
+
15
+ // We are also going to have different buckets with different gifs. The logic is as follows:
16
+ // Group 1: 15%, 20%, 25%, 30% - Early celebrations
17
+ // Group 2: 33%, 40%, 45%, 50% - Mid celebrations
18
+ // Group 3: 60%, 66%, 75%, 80% - Party
19
+
20
+ const gifSelect = ({
21
+ gifsGroups,
22
+ resolvedProblem,
23
+ totalProblems
24
+ }) => {
25
+ if (totalProblems < 7) return null;
26
+ const group = Math.ceil(resolvedProblem / totalProblems * 100);
27
+ if (group <= 20) return gifsGroups.group1[Math.floor(Math.random() * gifsGroups.group1.length)];
28
+ if (group <= 40) return gifsGroups.group2[Math.floor(Math.random() * gifsGroups.group2.length)];
29
+ if (group <= 60) return gifsGroups.group3[Math.floor(Math.random() * gifsGroups.group3.length)];
30
+ return null;
31
+ };
32
+ exports.gifSelect = gifSelect;
33
+ const calculatePercentageTable = totalProblems => {
34
+ if (totalProblems <= 12) return {
35
+ 50: Math.ceil(totalProblems * 0.5)
36
+ };
37
+ if (totalProblems <= 18) {
38
+ return {
39
+ 33: Math.ceil(totalProblems * 0.33),
40
+ 66: Math.ceil(totalProblems * 0.66)
41
+ };
42
+ }
43
+ if (totalProblems <= 24) {
44
+ return {
45
+ 25: Math.ceil(totalProblems * 0.25),
46
+ 50: Math.ceil(totalProblems * 0.5),
47
+ 75: Math.ceil(totalProblems * 0.75)
48
+ };
49
+ }
50
+ if (totalProblems <= 30) {
51
+ return {
52
+ 20: Math.ceil(totalProblems * 0.2),
53
+ 40: Math.ceil(totalProblems * 0.4),
54
+ 60: Math.ceil(totalProblems * 0.6),
55
+ 80: Math.ceil(totalProblems * 0.8)
56
+ };
57
+ }
58
+ return {
59
+ 15: Math.ceil(totalProblems * 0.15),
60
+ 30: Math.ceil(totalProblems * 0.3),
61
+ 45: Math.ceil(totalProblems * 0.45),
62
+ 60: Math.ceil(totalProblems * 0.6),
63
+ 75: Math.ceil(totalProblems * 0.75)
64
+ };
65
+ };
66
+ exports.calculatePercentageTable = calculatePercentageTable;
67
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["gifSelect","gifsGroups","resolvedProblem","totalProblems","group","Math","ceil","group1","floor","random","length","group2","group3","exports","calculatePercentageTable"],"sourceRoot":"../../../../src","sources":["features/gifCelebrations/helpers.ts"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO,MAAMA,SAAS,GAAGA,CAAC;EAAEC,UAAU;EAAEC,eAAe;EAAEC;AAA8B,CAAC,KAAK;EAC3F,IAAIA,aAAa,GAAG,CAAC,EAAE,OAAO,IAAI;EAElC,MAAMC,KAAK,GAAGC,IAAI,CAACC,IAAI,CAAEJ,eAAe,GAAGC,aAAa,GAAI,GAAG,CAAC;EAEhE,IAAIC,KAAK,IAAI,EAAE,EAAE,OAAOH,UAAU,CAACM,MAAM,CAACF,IAAI,CAACG,KAAK,CAACH,IAAI,CAACI,MAAM,CAAC,CAAC,GAAGR,UAAU,CAACM,MAAM,CAACG,MAAM,CAAC,CAAC;EAC/F,IAAIN,KAAK,IAAI,EAAE,EAAE,OAAOH,UAAU,CAACU,MAAM,CAACN,IAAI,CAACG,KAAK,CAACH,IAAI,CAACI,MAAM,CAAC,CAAC,GAAGR,UAAU,CAACU,MAAM,CAACD,MAAM,CAAC,CAAC;EAC/F,IAAIN,KAAK,IAAI,EAAE,EAAE,OAAOH,UAAU,CAACW,MAAM,CAACP,IAAI,CAACG,KAAK,CAACH,IAAI,CAACI,MAAM,CAAC,CAAC,GAAGR,UAAU,CAACW,MAAM,CAACF,MAAM,CAAC,CAAC;EAE/F,OAAO,IAAI;AACb,CAAC;AAAAG,OAAA,CAAAb,SAAA,GAAAA,SAAA;AAEM,MAAMc,wBAAwB,GAAIX,aAAqB,IAAK;EACjE,IAAIA,aAAa,IAAI,EAAE,EAAE,OAAO;IAAE,EAAE,EAAEE,IAAI,CAACC,IAAI,CAACH,aAAa,GAAG,GAAG;EAAE,CAAC;EAE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
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "GifCelebrations", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _GifCelebrations.GifCelebrations;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "GifCelebrationsModel", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _GifCelebrationsModel.GifCelebrationsModel;
16
+ }
17
+ });
18
+ var _GifCelebrations = require("./GifCelebrations.js");
19
+ var _GifCelebrationsModel = require("./model/GifCelebrations.model.js");
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_GifCelebrations","require","_GifCelebrationsModel"],"sourceRoot":"../../../../src","sources":["features/gifCelebrations/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GifCelebrationsCache = void 0;
7
+ var _effector = require("effector");
8
+ class GifCelebrationsCache {
9
+ initialSet = (0, _effector.createEvent)();
10
+ set = (0, _effector.createEvent)();
11
+ reset = (0, _effector.createEvent)();
12
+ $gifs = (0, _effector.createStore)(null).reset(this.reset).on(this.initialSet, (_, gifs) => Object.fromEntries(Object.entries(gifs).map(([key, value]) => [key, value.map(url => ({
13
+ url,
14
+ isShown: false,
15
+ group: key
16
+ }))]))).on(this.set, (_, gifs) => gifs);
17
+ }
18
+ exports.GifCelebrationsCache = GifCelebrationsCache;
19
+ //# sourceMappingURL=GifCelebrations.cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_effector","require","GifCelebrationsCache","initialSet","createEvent","set","reset","$gifs","createStore","on","_","gifs","Object","fromEntries","entries","map","key","value","url","isShown","group","exports"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/model/GifCelebrations.cache.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAGO,MAAMC,oBAAoB,CAAC;EAChBC,UAAU,GAAG,IAAAC,qBAAW,EAAa,CAAC;EACtCC,GAAG,GAAG,IAAAD,qBAAW,EAAgB,CAAC;EAClCE,KAAK,GAAG,IAAAF,qBAAW,EAAC,CAAC;EAErBG,KAAK,GAAG,IAAAC,qBAAW,EAAuB,IAAI,CAAC,CAC5DF,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC,CACjBG,EAAE,CAAC,IAAI,CAACN,UAAU,EAAE,CAACO,CAAC,EAAEC,IAAI,KAC3BC,MAAM,CAACC,WAAW,CAChBD,MAAM,CAACE,OAAO,CAACH,IAAI,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,CACzCD,GAAG,EACHC,KAAK,CAACF,GAAG,CAAEG,GAAG,KAAM;IAClBA,GAAG;IACHC,OAAO,EAAE,KAAK;IACdC,KAAK,EAAEJ;EACT,CAAC,CAAC,CAAC,CACJ,CACH,CACF,CAAC,CACAP,EAAE,CAAC,IAAI,CAACJ,GAAG,EAAE,CAACK,CAAC,EAAEC,IAAI,KAAKA,IAAI,CAAC;AACpC;AAACU,OAAA,CAAAnB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GifCelebrationsModel = void 0;
7
+ var _effector = require("effector");
8
+ var _GifCelebrationsApi = require("./GifCelebrationsApi.js");
9
+ var _GifCelebrationsCache = require("./GifCelebrations.cache.js");
10
+ var _helpers = require("../helpers.js");
11
+ var _reactNative = require("react-native");
12
+ var _constants = require("../constants.js");
13
+ const GROUPS_PERCENTAGES = {
14
+ group1: [15, 20, 25, 30],
15
+ // Early celebrations
16
+ group2: [33, 40, 45, 50],
17
+ // Mid celebrations
18
+ group3: [60, 66, 75, 80] // Party
19
+ };
20
+ class GifCelebrationsModel {
21
+ triggerPlay = (0, _effector.createEvent)();
22
+ stop = (0, _effector.createEvent)();
23
+ resetPercentageTable = (0, _effector.createEvent)();
24
+ $problemsPercentageTable = (0, _effector.createStore)(null).reset(this.resetPercentageTable);
25
+ setActiveGif = (0, _effector.createEvent)();
26
+ $activeGif = (0, _effector.createStore)(null).reset(this.stop).on(this.setActiveGif, (_, gif) => gif);
27
+ initialize = (0, _effector.createEvent)();
28
+ resetGroupGifs = (0, _effector.createEvent)();
29
+ constructor({
30
+ api,
31
+ totalProblems,
32
+ resolvedProblems
33
+ }) {
34
+ this.api = new _GifCelebrationsApi.GifCelebrationsApi(api);
35
+ this.cache = new _GifCelebrationsCache.GifCelebrationsCache();
36
+ this.$totalProblems = totalProblems;
37
+ this.$resolvedProblems = resolvedProblems;
38
+ this.setupEventHandlers();
39
+ }
40
+ setupEventHandlers() {
41
+ (0, _effector.sample)({
42
+ source: this.api.getGifsFx.doneData,
43
+ fn: response => response.ok ? response.data : (() => {
44
+ throw new Error('Failed to fetch GIFs');
45
+ })(),
46
+ target: (0, _effector.createEffect)(data => {
47
+ Object.values(data).forEach(group => {
48
+ group.forEach(gifUrl => {
49
+ _reactNative.Image.prefetch(gifUrl);
50
+ });
51
+ });
52
+ console.log('data: ', data);
53
+ this.cache.initialSet(data);
54
+ })
55
+ });
56
+ (0, _effector.sample)({
57
+ clock: this.initialize,
58
+ source: this.cache.$gifs,
59
+ filter: gifs => !gifs,
60
+ target: this.api.getGifsFx
61
+ });
62
+ (0, _effector.sample)({
63
+ //todo: fix types
64
+ //@ts-ignore
65
+ clock: this.initialize,
66
+ source: this.$totalProblems,
67
+ filter: totalProblems => totalProblems && totalProblems >= _constants.MIN_PROBLEMS_TO_SHOW_GIF,
68
+ fn: totalProblems => (0, _helpers.calculatePercentageTable)(totalProblems),
69
+ target: this.$problemsPercentageTable
70
+ });
71
+ (0, _effector.sample)({
72
+ clock: this.triggerPlay,
73
+ source: {
74
+ gifsGroups: this.cache.$gifs,
75
+ resolvedProblem: this.$resolvedProblems,
76
+ problemsPercentageTable: this.$problemsPercentageTable
77
+ },
78
+ filter: ({
79
+ gifsGroups,
80
+ resolvedProblem,
81
+ problemsPercentageTable
82
+ }) => !!(gifsGroups && resolvedProblem !== undefined && problemsPercentageTable),
83
+ fn: sources => sources,
84
+ target: this.handleGifSelection
85
+ });
86
+ }
87
+ handleGifSelection = (0, _effector.createEffect)(({
88
+ gifsGroups,
89
+ resolvedProblem,
90
+ problemsPercentageTable
91
+ }) => {
92
+ // Find which percentage milestone this resolved problem represents
93
+ const percentageMilestone = Object.keys(problemsPercentageTable).find(key => problemsPercentageTable[Number(key)] === resolvedProblem);
94
+ if (!percentageMilestone) return null;
95
+
96
+ // Find which group this percentage belongs to
97
+ const groupName = this.findGroupForPercentage(Number(percentageMilestone));
98
+ if (!groupName) return null;
99
+
100
+ // Get available gifs for this group
101
+ const gifsForGroup = gifsGroups[groupName];
102
+ console.log('gifsForGroup: ', gifsForGroup);
103
+ if (!gifsForGroup || gifsForGroup.length === 0) return null;
104
+
105
+ // Find the first gif that hasn't been shown yet
106
+ const unusedGifIndex = gifsForGroup.findIndex(gif => !gif.isShown);
107
+
108
+ // If all gifs have been shown, reset the group and start from the beginning
109
+ if (unusedGifIndex === -1) {
110
+ // Reset the group by setting all gifs to isShown: false
111
+ const updatedGifsGroups = {
112
+ ...gifsGroups
113
+ };
114
+ updatedGifsGroups[groupName] = gifsGroups[groupName].map(gif => ({
115
+ ...gif,
116
+ isShown: false
117
+ }));
118
+ // Select the first gif from the group
119
+ const gifObject = {
120
+ ...updatedGifsGroups[groupName][0],
121
+ isShown: true
122
+ };
123
+ updatedGifsGroups[groupName][0].isShown = true;
124
+ this.setActiveGif(gifObject);
125
+ // Update the cache with the shown gif
126
+ this.cache.set(updatedGifsGroups);
127
+ }
128
+
129
+ // Otherwise, use the first unused gif
130
+ const selectedGif = gifsForGroup[unusedGifIndex];
131
+
132
+ // Create a new gif object with isShown set to true
133
+ const gifObject = {
134
+ ...selectedGif,
135
+ isShown: true
136
+ };
137
+
138
+ // Update the cache with the shown gif
139
+ const updatedGifsGroups = {
140
+ ...gifsGroups
141
+ };
142
+ updatedGifsGroups[groupName][unusedGifIndex].isShown = true;
143
+ this.cache.set(updatedGifsGroups);
144
+ this.setActiveGif(gifObject);
145
+ });
146
+ findGroupForPercentage(percentage) {
147
+ return Object.keys(GROUPS_PERCENTAGES).find(key => GROUPS_PERCENTAGES[key].includes(percentage));
148
+ }
149
+ }
150
+ exports.GifCelebrationsModel = GifCelebrationsModel;
151
+ //# sourceMappingURL=GifCelebrations.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_effector","require","_GifCelebrationsApi","_GifCelebrationsCache","_helpers","_reactNative","_constants","GROUPS_PERCENTAGES","group1","group2","group3","GifCelebrationsModel","triggerPlay","createEvent","stop","resetPercentageTable","$problemsPercentageTable","createStore","reset","setActiveGif","$activeGif","on","_","gif","initialize","resetGroupGifs","constructor","api","totalProblems","resolvedProblems","GifCelebrationsApi","cache","GifCelebrationsCache","$totalProblems","$resolvedProblems","setupEventHandlers","sample","source","getGifsFx","doneData","fn","response","ok","data","Error","target","createEffect","Object","values","forEach","group","gifUrl","Image","prefetch","console","log","initialSet","clock","$gifs","filter","gifs","MIN_PROBLEMS_TO_SHOW_GIF","calculatePercentageTable","gifsGroups","resolvedProblem","problemsPercentageTable","undefined","sources","handleGifSelection","percentageMilestone","keys","find","key","Number","groupName","findGroupForPercentage","gifsForGroup","length","unusedGifIndex","findIndex","isShown","updatedGifsGroups","map","gifObject","set","selectedGif","percentage","includes","exports"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/model/GifCelebrations.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAQA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;A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@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GifCelebrationsApi = void 0;
7
+ var _createControllerEffect = require("./../../../lib/effector/createControllerEffect.js");
8
+ class GifCelebrationsApi {
9
+ constructor(api) {
10
+ this.getGifsFx = (0, _createControllerEffect.createControllerEffect)(api.getGifs);
11
+ }
12
+ }
13
+ exports.GifCelebrationsApi = GifCelebrationsApi;
14
+ //# sourceMappingURL=GifCelebrationsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_createControllerEffect","require","GifCelebrationsApi","constructor","api","getGifsFx","createControllerEffect","getGifs","exports"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/model/GifCelebrationsApi.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAGO,MAAMC,kBAAkB,CAAC;EAG9BC,WAAWA,CAACC,GAA8B,EAAE;IAC1C,IAAI,CAACC,SAAS,GAAG,IAAAC,8CAAsB,EAACF,GAAG,CAACG,OAAO,CAAC;EACtD;AACF;AAACC,OAAA,CAAAN,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=model.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/types/model.types.ts"],"mappings":"","ignoreList":[]}
@@ -107,4 +107,16 @@ Object.keys(_index7).forEach(function (key) {
107
107
  }
108
108
  });
109
109
  });
110
+ var _index8 = require("./features/gifCelebrations/index.js");
111
+ Object.keys(_index8).forEach(function (key) {
112
+ if (key === "default" || key === "__esModule") return;
113
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
114
+ if (key in exports && exports[key] === _index8[key]) return;
115
+ Object.defineProperty(exports, key, {
116
+ enumerable: true,
117
+ get: function () {
118
+ return _index8[key];
119
+ }
120
+ });
121
+ });
110
122
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_index","require","_helpers","_index2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_index3","_index4","_index5","_index6","_index7"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,OAAA,GAAAf,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAW,OAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,OAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,OAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAA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EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,OAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA;AACA,IAAAa,OAAA,GAAAnB,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAe,OAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAa,OAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,OAAA,CAAAb,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_index","require","_helpers","_index2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_index3","_index4","_index5","_index6","_index7","_index8"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OA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AAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAc,OAAA,CAAAd,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,OAAA,CAAAd,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useImagePreloader = void 0;
7
+ var _react = require("react");
8
+ const useImagePreloader = imageUrls => {
9
+ (0, _react.useEffect)(() => {
10
+ imageUrls.forEach(url => {
11
+ const img = new Image();
12
+ img.src = url;
13
+ img.onload = () => {
14
+ console.log(`Image loaded: ${url}`);
15
+ };
16
+ });
17
+ }, [imageUrls]);
18
+ };
19
+ exports.useImagePreloader = useImagePreloader;
20
+ //# sourceMappingURL=useImagePreloader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","useImagePreloader","imageUrls","useEffect","forEach","url","img","Image","src","onload","console","log","exports"],"sourceRoot":"../../../../src","sources":["shared/hooks/useImagePreloader.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIO,MAAMC,iBAAiB,GAAIC,SAAqB,IAAK;EAC1D,IAAAC,gBAAS,EAAC,MAAM;IACdD,SAAS,CAACE,OAAO,CAAEC,GAAG,IAAK;MACzB,MAAMC,GAAG,GAAG,IAAIC,KAAK,CAAC,CAAC;MACvBD,GAAG,CAACE,GAAG,GAAGH,GAAG;MACbC,GAAG,CAACG,MAAM,GAAG,MAAM;QACjBC,OAAO,CAACC,GAAG,CAAC,iBAAiBN,GAAG,EAAE,CAAC;MACrC,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,EAAE,CAACH,SAAS,CAAC,CAAC;AACjB,CAAC;AAAAU,OAAA,CAAAX,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -13,9 +13,8 @@
13
13
  "time.yearsAgo": "years ago",
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
- "giveHint": "Give me a hint",
17
16
  "answerAgain": "Answer again to get another hint!",
18
- "errorMessage": "Something went wrong! Try again",
17
+ "errorMessage": "Sorry, I can't help with this issue at the moment 😔.",
19
18
  "howCanIHelp": "Hi! Do you want help?",
20
19
  "showError": "Show error"
21
20
  }
@@ -13,9 +13,8 @@
13
13
  "time.yearsAgo": "years ago",
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
- "giveHint": "Give me a hint",
17
16
  "answerAgain": "Answer again to get another hint!",
18
- "errorMessage": "Something went wrong! Try again",
17
+ "errorMessage": "Sorry, I can't help with this issue at the moment 😔.",
19
18
  "howCanIHelp": "Hi! Do you want help?",
20
19
  "showError": "Show error"
21
20
  }
@@ -13,9 +13,8 @@
13
13
  "time.yearsAgo": "år sedan",
14
14
  "chat": {
15
15
  "anotherHint": "Ge mig en ledtråd",
16
- "giveHint": "Ge mig en ledtråd",
17
16
  "answerAgain": "Svara igen för att få en till ledtråd!",
18
- "errorMessage": "Något gick snett! Försök igen",
17
+ "errorMessage": "Tyvärr kan jag inte hjälpa dig just nu 😔.",
19
18
  "howCanIHelp": "Hej! Hur kan jag hjälpa dig?",
20
19
  "showError": "Visa fel"
21
20
  }