@magmamath/students-features 0.6.12-rc.0 → 0.6.13

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 (185) hide show
  1. package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +31 -0
  2. package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
  3. package/dist/commonjs/features/exampleSolution/assets/grid.png +0 -0
  4. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +97 -0
  5. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
  6. package/dist/commonjs/features/exampleSolution/components/LavaIcon.js +44 -0
  7. package/dist/commonjs/features/exampleSolution/components/LavaIcon.js.map +1 -0
  8. package/dist/commonjs/features/exampleSolution/components/MessageBlock.js +61 -0
  9. package/dist/commonjs/features/exampleSolution/components/MessageBlock.js.map +1 -0
  10. package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +68 -0
  11. package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -0
  12. package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +75 -0
  13. package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +1 -0
  14. package/dist/commonjs/features/exampleSolution/constants.js +13 -0
  15. package/dist/commonjs/features/exampleSolution/constants.js.map +1 -0
  16. package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js +61 -0
  17. package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
  18. package/dist/commonjs/features/exampleSolution/index.js +39 -0
  19. package/dist/commonjs/features/exampleSolution/index.js.map +1 -0
  20. package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +22 -0
  21. package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
  22. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +32 -0
  23. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
  24. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js +18 -0
  25. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
  26. package/dist/commonjs/features/exampleSolution/types.js +6 -0
  27. package/dist/commonjs/features/exampleSolution/types.js.map +1 -0
  28. package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js +1 -1
  29. package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
  30. package/dist/commonjs/index.js +24 -0
  31. package/dist/commonjs/index.js.map +1 -1
  32. package/dist/commonjs/shared/icons/ExcitedLavaIcon.js +681 -0
  33. package/dist/commonjs/shared/icons/ExcitedLavaIcon.js.map +1 -0
  34. package/dist/commonjs/shared/icons/LavaIconInGlasses.js +616 -0
  35. package/dist/commonjs/shared/icons/LavaIconInGlasses.js.map +1 -0
  36. package/dist/commonjs/shared/icons/index.js +204 -0
  37. package/dist/commonjs/shared/icons/index.js.map +1 -0
  38. package/dist/commonjs/shared/translation/localization/ca.json +6 -0
  39. package/dist/commonjs/shared/translation/localization/en.json +6 -0
  40. package/dist/commonjs/shared/translation/localization/gb.json +6 -0
  41. package/dist/commonjs/shared/translation/localization/sct.json +6 -0
  42. package/dist/commonjs/shared/translation/localization/sw.json +6 -0
  43. package/dist/module/features/exampleSolution/ExampleSolutionModal.js +25 -0
  44. package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
  45. package/dist/module/features/exampleSolution/assets/grid.png +0 -0
  46. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +91 -0
  47. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
  48. package/dist/module/features/exampleSolution/components/LavaIcon.js +36 -0
  49. package/dist/module/features/exampleSolution/components/LavaIcon.js.map +1 -0
  50. package/dist/module/features/exampleSolution/components/MessageBlock.js +53 -0
  51. package/dist/module/features/exampleSolution/components/MessageBlock.js.map +1 -0
  52. package/dist/module/features/exampleSolution/components/QuestionSection.js +60 -0
  53. package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -0
  54. package/dist/module/features/exampleSolution/components/SolutionSection.js +67 -0
  55. package/dist/module/features/exampleSolution/components/SolutionSection.js.map +1 -0
  56. package/dist/module/features/exampleSolution/constants.js +9 -0
  57. package/dist/module/features/exampleSolution/constants.js.map +1 -0
  58. package/dist/module/features/exampleSolution/hooks/useExampleSolution.js +56 -0
  59. package/dist/module/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
  60. package/dist/module/features/exampleSolution/index.js +6 -0
  61. package/dist/module/features/exampleSolution/index.js.map +1 -0
  62. package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +17 -0
  63. package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
  64. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +27 -0
  65. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
  66. package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js +13 -0
  67. package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
  68. package/dist/module/features/exampleSolution/types.js +4 -0
  69. package/dist/module/features/exampleSolution/types.js.map +1 -0
  70. package/dist/module/features/problemSelector/components/ProblemSelectorButton.js +1 -1
  71. package/dist/module/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
  72. package/dist/module/index.js +2 -0
  73. package/dist/module/index.js.map +1 -1
  74. package/dist/module/shared/icons/ExcitedLavaIcon.js +673 -0
  75. package/dist/module/shared/icons/ExcitedLavaIcon.js.map +1 -0
  76. package/dist/module/shared/icons/LavaIconInGlasses.js +608 -0
  77. package/dist/module/shared/icons/LavaIconInGlasses.js.map +1 -0
  78. package/dist/module/shared/icons/index.js +21 -0
  79. package/dist/module/shared/icons/index.js.map +1 -0
  80. package/dist/module/shared/translation/localization/ca.json +6 -0
  81. package/dist/module/shared/translation/localization/en.json +6 -0
  82. package/dist/module/shared/translation/localization/gb.json +6 -0
  83. package/dist/module/shared/translation/localization/sct.json +6 -0
  84. package/dist/module/shared/translation/localization/sw.json +6 -0
  85. package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
  86. package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
  87. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +4 -0
  88. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
  89. package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts +10 -0
  90. package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
  91. package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts +10 -0
  92. package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
  93. package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +9 -0
  94. package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
  95. package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts +9 -0
  96. package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
  97. package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts +6 -0
  98. package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts.map +1 -0
  99. package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts +9 -0
  100. package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
  101. package/dist/typescript/commonjs/features/exampleSolution/index.d.ts +4 -0
  102. package/dist/typescript/commonjs/features/exampleSolution/index.d.ts.map +1 -0
  103. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
  104. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
  105. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts +13 -0
  106. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
  107. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts +11 -0
  108. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
  109. package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +26 -0
  110. package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -0
  111. package/dist/typescript/commonjs/index.d.ts +2 -0
  112. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  113. package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts +4 -0
  114. package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
  115. package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts +4 -0
  116. package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
  117. package/dist/typescript/commonjs/shared/icons/index.d.ts +19 -0
  118. package/dist/typescript/commonjs/shared/icons/index.d.ts.map +1 -0
  119. package/dist/typescript/commonjs/shared/translation/constants.d.ts +30 -0
  120. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  121. package/dist/typescript/commonjs/shared/translation/model.d.ts +12 -0
  122. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  123. package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
  124. package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
  125. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +4 -0
  126. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
  127. package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts +10 -0
  128. package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
  129. package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts +10 -0
  130. package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
  131. package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +9 -0
  132. package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
  133. package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts +9 -0
  134. package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
  135. package/dist/typescript/module/features/exampleSolution/constants.d.ts +6 -0
  136. package/dist/typescript/module/features/exampleSolution/constants.d.ts.map +1 -0
  137. package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts +9 -0
  138. package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
  139. package/dist/typescript/module/features/exampleSolution/index.d.ts +4 -0
  140. package/dist/typescript/module/features/exampleSolution/index.d.ts.map +1 -0
  141. package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
  142. package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
  143. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts +13 -0
  144. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
  145. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts +11 -0
  146. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
  147. package/dist/typescript/module/features/exampleSolution/types.d.ts +26 -0
  148. package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -0
  149. package/dist/typescript/module/index.d.ts +2 -0
  150. package/dist/typescript/module/index.d.ts.map +1 -1
  151. package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts +4 -0
  152. package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
  153. package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts +4 -0
  154. package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
  155. package/dist/typescript/module/shared/icons/index.d.ts +19 -0
  156. package/dist/typescript/module/shared/icons/index.d.ts.map +1 -0
  157. package/dist/typescript/module/shared/translation/constants.d.ts +30 -0
  158. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  159. package/dist/typescript/module/shared/translation/model.d.ts +12 -0
  160. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  161. package/package.json +7 -3
  162. package/src/features/exampleSolution/ExampleSolutionModal.tsx +29 -0
  163. package/src/features/exampleSolution/assets/grid.png +0 -0
  164. package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +71 -0
  165. package/src/features/exampleSolution/components/LavaIcon.tsx +35 -0
  166. package/src/features/exampleSolution/components/MessageBlock.tsx +67 -0
  167. package/src/features/exampleSolution/components/QuestionSection.tsx +56 -0
  168. package/src/features/exampleSolution/components/SolutionSection.tsx +69 -0
  169. package/src/features/exampleSolution/constants.ts +5 -0
  170. package/src/features/exampleSolution/hooks/useExampleSolution.ts +66 -0
  171. package/src/features/exampleSolution/index.ts +3 -0
  172. package/src/features/exampleSolution/model/ExampleSolution.model.ts +12 -0
  173. package/src/features/exampleSolution/model/ExampleSolutionApi.ts +33 -0
  174. package/src/features/exampleSolution/model/ExampleSolutionCache.ts +20 -0
  175. package/src/features/exampleSolution/types.ts +26 -0
  176. package/src/features/problemSelector/components/ProblemSelectorButton.tsx +1 -1
  177. package/src/index.ts +2 -0
  178. package/src/shared/icons/ExcitedLavaIcon.tsx +541 -0
  179. package/src/shared/icons/LavaIconInGlasses.tsx +489 -0
  180. package/src/shared/icons/index.ts +18 -0
  181. package/src/shared/translation/localization/ca.json +6 -0
  182. package/src/shared/translation/localization/en.json +6 -0
  183. package/src/shared/translation/localization/gb.json +6 -0
  184. package/src/shared/translation/localization/sct.json +6 -0
  185. package/src/shared/translation/localization/sw.json +6 -0
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExampleSolutionModal = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNativeUi = require("@magmamath/react-native-ui");
9
+ var _ExampleSolutionModalContent = require("./components/ExampleSolutionModalContent.js");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const ExampleSolutionModal = ({
13
+ modal: {
14
+ closeModal,
15
+ params
16
+ }
17
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.BaseModal, {
18
+ style: {
19
+ container: {
20
+ paddingHorizontal: _reactNativeUi.SPACING[800]
21
+ }
22
+ },
23
+ onClose: closeModal,
24
+ content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExampleSolutionModalContent.ExampleSolutionModalContent, {
25
+ model: params.model,
26
+ payload: params.payload,
27
+ cacheKey: params.cacheKey
28
+ })
29
+ });
30
+ exports.ExampleSolutionModal = ExampleSolutionModal;
31
+ //# sourceMappingURL=ExampleSolutionModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNativeUi","_ExampleSolutionModalContent","_jsxRuntime","e","__esModule","default","ExampleSolutionModal","modal","closeModal","params","jsx","BaseModal","style","container","paddingHorizontal","SPACING","onClose","content","ExampleSolutionModalContent","model","payload","cacheKey","exports"],"sourceRoot":"../../../../src","sources":["features/exampleSolution/ExampleSolutionModal.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AAAsF,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAU/E,MAAMG,oBAAoB,GAAGA,CAAC;EACnCC,KAAK,EAAE;IAAEC,UAAU;IAAEC;EAAO;AACM,CAAC,kBACnC,IAAAP,WAAA,CAAAQ,GAAA,EAACV,cAAA,CAAAW,SAAS;EACRC,KAAK,EAAE;IACLC,SAAS,EAAE;MAAEC,iBAAiB,EAAEC,sBAAO,CAAC,GAAG;IAAE;EAC/C,CAAE;EACFC,OAAO,EAAER,UAAW;EACpBS,OAAO,eACL,IAAAf,WAAA,CAAAQ,GAAA,EAACT,4BAAA,CAAAiB,2BAA2B;IAC1BC,KAAK,EAAEV,MAAM,CAACU,KAAM;IACpBC,OAAO,EAAEX,MAAM,CAACW,OAAQ;IACxBC,QAAQ,EAAEZ,MAAM,CAACY;EAAS,CAC3B;AACF,CACF,CACF;AAAAC,OAAA,CAAAhB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExampleSolutionModalContent = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactNativeUi = require("@magmamath/react-native-ui");
10
+ var _effectorReact = require("effector-react");
11
+ var _index = require("../../../shared/translation/index.js");
12
+ var _MessageBlock = require("./MessageBlock.js");
13
+ var _LavaIcon = require("./LavaIcon.js");
14
+ var _QuestionSection = require("./QuestionSection.js");
15
+ var _SolutionSection = require("./SolutionSection.js");
16
+ var _useExampleSolution = require("../hooks/useExampleSolution.js");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ const ExampleSolutionModalContent = ({
20
+ model,
21
+ payload,
22
+ cacheKey
23
+ }) => {
24
+ const {
25
+ result,
26
+ status
27
+ } = (0, _useExampleSolution.useExampleSolution)({
28
+ model,
29
+ payload,
30
+ cacheKey
31
+ });
32
+ const localization = (0, _effectorReact.useUnit)(_index.$localization);
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
34
+ style: styles.container,
35
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
36
+ align: "center",
37
+ variant: _reactNativeUi.HeadingVariants.H2,
38
+ style: {
39
+ color: _reactNativeUi.COLORS.NEUTRAL_9
40
+ },
41
+ children: localization.exampleSolution.exampleSolution
42
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
43
+ style: styles.content,
44
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_QuestionSection.QuestionSection, {
45
+ status: status,
46
+ question: result?.question
47
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SolutionSection.SolutionSection, {
48
+ status: status,
49
+ answer: result?.answer
50
+ })]
51
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageBlock.MessageBlock, {
52
+ status: status,
53
+ style: styles.messageBlock
54
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LavaIcon.LavaIcon, {
55
+ status: status,
56
+ style: styles.lavaIconContainer
57
+ })]
58
+ });
59
+ };
60
+ exports.ExampleSolutionModalContent = ExampleSolutionModalContent;
61
+ const styles = _reactNative.StyleSheet.create({
62
+ container: {
63
+ width: 880,
64
+ height: 593
65
+ },
66
+ content: {
67
+ flex: 1,
68
+ flexDirection: 'row',
69
+ marginTop: _reactNativeUi.SPACING[400],
70
+ gap: _reactNativeUi.SPACING[400]
71
+ },
72
+ solutionContainer: {
73
+ width: 351,
74
+ overflow: 'hidden',
75
+ borderRadius: 8,
76
+ borderWidth: 1,
77
+ borderColor: _reactNativeUi.COLORS.NEUTRAL_5
78
+ },
79
+ lavaIconContainer: {
80
+ position: 'absolute',
81
+ bottom: -54,
82
+ right: -50
83
+ },
84
+ loaderContainer: {
85
+ paddingTop: 34,
86
+ position: 'absolute',
87
+ width: '100%',
88
+ height: '100%',
89
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1
90
+ },
91
+ messageBlock: {
92
+ position: 'absolute',
93
+ right: 38,
94
+ bottom: -22
95
+ }
96
+ });
97
+ //# sourceMappingURL=ExampleSolutionModalContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_effectorReact","_index","_MessageBlock","_LavaIcon","_QuestionSection","_SolutionSection","_useExampleSolution","_jsxRuntime","e","__esModule","default","ExampleSolutionModalContent","model","payload","cacheKey","result","status","useExampleSolution","localization","useUnit","$localization","jsxs","View","style","styles","container","children","jsx","Typography","align","variant","HeadingVariants","H2","color","COLORS","NEUTRAL_9","exampleSolution","content","QuestionSection","question","SolutionSection","answer","MessageBlock","messageBlock","LavaIcon","lavaIconContainer","exports","StyleSheet","create","width","height","flex","flexDirection","marginTop","SPACING","gap","solutionContainer","overflow","borderRadius","borderWidth","borderColor","NEUTRAL_5","position","bottom","right","loaderContainer","paddingTop","backgroundColor","NEUTRAL_1"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/ExampleSolutionModalContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,gBAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AAAgE,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAE,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEzD,MAAMG,2BAA2B,GAAGA,CAAC;EAC1CC,KAAK;EACLC,OAAO;EACPC;AAC0B,CAAC,KAAK;EAChC,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,sCAAkB,EAAC;IAAEL,KAAK;IAAEC,OAAO;IAAEC;EAAS,CAAC,C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,MAAM,GAAGuB,uBAAU,CAACC,MAAM,CAAC;EAC/BvB,SAAS,EAAE;IACTwB,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDb,OAAO,EAAE;IACPc,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,KAAK;IACpBC,SAAS,EAAEC,sBAAO,CAAC,GAAG,CAAC;IACvBC,GAAG,EAAED,sBAAO,CAAC,GAAG;EAClB,CAAC;EACDE,iBAAiB,EAAE;IACjBP,KAAK,EAAE,GAAG;IACVQ,QAAQ,EAAE,QAAQ;IAClBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE1B,qBAAM,CAAC2B;EACtB,CAAC;EACDhB,iBAAiB,EAAE;IACjBiB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC,EAAE;IACXC,KAAK,EAAE,CAAC;EACV,CAAC;EACDC,eAAe,EAAE;IACfC,UAAU,EAAE,EAAE;IACdJ,QAAQ,EAAE,UAAU;IACpBb,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdiB,eAAe,EAAEjC,qBAAM,CAACkC;EAC1B,CAAC;EACDzB,YAAY,EAAE;IACZmB,QAAQ,EAAE,UAAU;IACpBE,KAAK,EAAE,EAAE;IACTD,MAAM,EAAE,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LavaIcon = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _ExcitedLavaIcon = require("../../../shared/icons/ExcitedLavaIcon.js");
9
+ var _index = require("../../../shared/icons/index.js");
10
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
+ var _constants = require("../constants.js");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ 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); }
14
+ 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; }
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ const LAVA_ICON_HEIGHT = 112;
17
+ const LavaIcon = ({
18
+ status,
19
+ style
20
+ }) => {
21
+ const opacityAnimation = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
22
+ return {
23
+ opacity: (0, _reactNativeReanimated.withTiming)(status === _constants.ExampleSolutionStatuses.LOADING ? 1 : 0, {
24
+ duration: 500
25
+ })
26
+ };
27
+ }, [status]);
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
29
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
30
+ style: [style, opacityAnimation],
31
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LavaIconInGlasses, {
32
+ height: 112
33
+ })
34
+ }), status !== _constants.ExampleSolutionStatuses.LOADING && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
35
+ style: style,
36
+ entering: _reactNativeReanimated.FadeIn,
37
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExcitedLavaIcon.ExcitedLavaIcon, {
38
+ height: LAVA_ICON_HEIGHT
39
+ })
40
+ })]
41
+ });
42
+ };
43
+ exports.LavaIcon = LavaIcon;
44
+ //# sourceMappingURL=LavaIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_ExcitedLavaIcon","_index","_reactNativeReanimated","_interopRequireWildcard","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","LAVA_ICON_HEIGHT","LavaIcon","status","style","opacityAnimation","useAnimatedStyle","opacity","withTiming","ExampleSolutionStatuses","LOADING","duration","jsxs","Fragment","children","jsx","View","LavaIconInGlasses","height","entering","FadeIn","ExcitedLavaIcon","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/LavaIcon.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AAAsD,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,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,wB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EAACvC,MAAA,CAAAyC,iBAAiB;QAACC,MAAM,EAAE;MAAI,CAAE;IAAC,CACrB,CAAC,EAEff,MAAM,KAAKM,kCAAuB,CAACC,OAAO,iBACzC,IAAA9B,WAAA,CAAAmC,GAAA,EAACtC,sBAAA,CAAAU,OAAQ,CAAC6B,IAAI;MAACZ,KAAK,EAAEA,KAAM;MAACe,QAAQ,EAAEC,6BAAO;MAAAN,QAAA,eAC5C,IAAAlC,WAAA,CAAAmC,GAAA,EAACxC,gBAAA,CAAA8C,eAAe;QAACH,MAAM,EAAEjB;MAAiB,CAAE;IAAC,CAChC,CAChB;EAAA,CACD,CAAC;AAEP,CAAC;AAAAqB,OAAA,CAAApB,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MessageBlock = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactNativeUi = require("@magmamath/react-native-ui");
10
+ var _effectorReact = require("effector-react");
11
+ var _index = require("../../../shared/translation/index.js");
12
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
13
+ var _constants = require("../constants.js");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ 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); }
16
+ 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; }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
+ const MessageBlock = ({
19
+ status,
20
+ style
21
+ }) => {
22
+ const localization = (0, _effectorReact.useUnit)(_index.$localization);
23
+ const opacityAnimation = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
24
+ return {
25
+ opacity: (0, _reactNativeReanimated.withDelay)(2000, (0, _reactNativeReanimated.withTiming)(status === _constants.ExampleSolutionStatuses.LOADING ? 1 : 0, {
26
+ duration: 350
27
+ }))
28
+ };
29
+ }, [status]);
30
+ if (status === _constants.ExampleSolutionStatuses.CACHE) return null;
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
32
+ layout: _reactNativeReanimated.LinearTransition.duration(250),
33
+ style: [styles.container, opacityAnimation, style],
34
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
35
+ variant: 'small',
36
+ numberOfLines: 1,
37
+ children: status === _constants.ExampleSolutionStatuses.LOADING ? localization.exampleSolution.letMeThink : localization.exampleSolution.aha
38
+ })
39
+ });
40
+ };
41
+ exports.MessageBlock = MessageBlock;
42
+ const styles = _reactNative.StyleSheet.create({
43
+ container: {
44
+ padding: _reactNativeUi.SPACING[200],
45
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_3,
46
+ height: 44,
47
+ borderRadius: 12,
48
+ borderBottomRightRadius: 2,
49
+ borderWidth: _reactNative.StyleSheet.hairlineWidth,
50
+ borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
51
+ shadowColor: _reactNativeUi.COLORS.NEUTRAL_10,
52
+ shadowOffset: {
53
+ width: 0,
54
+ height: 1
55
+ },
56
+ shadowOpacity: 0.2,
57
+ shadowRadius: 1,
58
+ elevation: 3
59
+ }
60
+ });
61
+ //# sourceMappingURL=MessageBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_effectorReact","_index","_reactNativeReanimated","_interopRequireWildcard","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MessageBlock","status","style","localization","useUnit","$localization","opacityAnimation","useAnimatedStyle","opacity","withDelay","withTiming","ExampleSolutionStatuses","LOADING","duration","CACHE","jsx","View","layout","LinearTransition","styles","container","children","Typography","variant","numberOfLines","exampleSolution","letMeThink","aha","exports","StyleSheet","create","padding","SPACING","backgroundColor","COLORS","NEUTRAL_3","height","borderRadius","borderBottomRightRadius","borderWidth","hairlineWidth","borderColor","NEUTRAL_5","shadowColor","NEUTRAL_10","shadowOffset","width","shadowOpacity","shadowRadius","elevation"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/MessageBlock.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAC,uBAAA,CAAAP,OAAA;AAMA,IAAAQ,UAAA,GAAAR,OAAA;AAAsD,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAU,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,C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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 _constants = require("../constants.js");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ 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); }
14
+ 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; }
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ const QuestionSection = ({
17
+ question,
18
+ status
19
+ }) => {
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
21
+ style: styles.container,
22
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
23
+ style: styles.scrollView,
24
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
25
+ children: question
26
+ })
27
+ }), status === _constants.ExampleSolutionStatuses.LOADING && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
28
+ exiting: _reactNativeReanimated.FadeOut,
29
+ style: styles.loaderContainer,
30
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Loader, {
31
+ size: "large",
32
+ color: _reactNativeUi.LoaderColor.BLUE
33
+ })
34
+ })]
35
+ });
36
+ };
37
+ exports.QuestionSection = QuestionSection;
38
+ const styles = _reactNative.StyleSheet.create({
39
+ container: {
40
+ flex: 1
41
+ },
42
+ scrollView: {
43
+ flex: 1
44
+ },
45
+ loaderContainer: {
46
+ paddingTop: 34,
47
+ position: 'absolute',
48
+ width: '100%',
49
+ height: '100%',
50
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
51
+ justifyContent: 'flex-start',
52
+ alignItems: 'center'
53
+ },
54
+ errorContainer: {
55
+ position: 'absolute',
56
+ width: '100%',
57
+ height: '100%',
58
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
59
+ justifyContent: 'center',
60
+ alignItems: 'center',
61
+ padding: _reactNativeUi.SPACING[400]
62
+ },
63
+ errorText: {
64
+ color: _reactNativeUi.COLORS.PRIMARY_RED,
65
+ textAlign: 'center'
66
+ }
67
+ });
68
+ //# sourceMappingURL=QuestionSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","QuestionSection","question","status","jsxs","View","style","styles","container","children","jsx","ScrollView","scrollView","Typography","ExampleSolutionStatuses","LOADING","exiting","FadeOut","loaderContainer","Loader","size","color","LoaderColor","BLUE","exports","StyleSheet","create","flex","paddingTop","position","width","height","backgroundColor","COLORS","NEUTRAL_1","justifyContent","alignItems","errorContainer","padding","SPACING","errorText","PRIMARY_RED","textAlign"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/QuestionSection.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,G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AQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,eAAe,EAAEC,qBAAM,CAACC,SAAS;IACjCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBE,OAAO,EAAEC,sBAAO,CAAC,GAAG;EACtB,CAAC;EACDC,SAAS,EAAE;IACTnB,KAAK,EAAEY,qBAAM,CAACQ,WAAW;IACzBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SolutionSection = 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 _constants = require("../constants.js");
12
+ var _grid = _interopRequireDefault(require("../assets/grid.png"));
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ 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); }
15
+ 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; }
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ const gridImagePath = !_reactNativeUi.IS_WEB ? _reactNative.Image.resolveAssetSource(_grid.default).uri : _grid.default;
18
+ const SolutionSection = ({
19
+ answer,
20
+ status
21
+ }) => {
22
+ const shouldShowAnswer = answer && (status === _constants.ExampleSolutionStatuses.DONE_DATA || status === _constants.ExampleSolutionStatuses.CACHE);
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
24
+ style: styles.container,
25
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
26
+ source: {
27
+ uri: gridImagePath
28
+ },
29
+ style: [styles.gridImage, _reactNativeUi.IS_WEB && styles.gridImageWeb]
30
+ }), shouldShowAnswer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.ScrollView, {
31
+ style: styles.solutionScroll,
32
+ contentContainerStyle: styles.solutionScrollContent,
33
+ entering: status === 'cache' ? undefined : _reactNativeReanimated.FadeIn.delay(1000).duration(500),
34
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
35
+ style: styles.solutionText,
36
+ children: answer
37
+ })
38
+ })]
39
+ });
40
+ };
41
+ exports.SolutionSection = SolutionSection;
42
+ const styles = _reactNative.StyleSheet.create({
43
+ container: {
44
+ width: 500,
45
+ overflow: 'hidden',
46
+ borderRadius: 8,
47
+ borderWidth: 1,
48
+ borderColor: _reactNativeUi.COLORS.NEUTRAL_5
49
+ },
50
+ gridImage: {
51
+ width: '100%',
52
+ height: '100%',
53
+ resizeMode: 'cover',
54
+ aspectRatio: 28 / 8
55
+ },
56
+ gridImageWeb: {
57
+ transform: [{
58
+ scale: 3.5
59
+ }]
60
+ },
61
+ solutionScroll: {
62
+ position: 'absolute',
63
+ width: '100%',
64
+ height: '100%'
65
+ },
66
+ solutionScrollContent: {
67
+ paddingHorizontal: _reactNativeUi.SPACING[800],
68
+ paddingVertical: _reactNativeUi.SPACING[400]
69
+ },
70
+ solutionText: {
71
+ fontFamily: 'PlaypenSans-Light',
72
+ fontSize: 22
73
+ }
74
+ });
75
+ //# sourceMappingURL=SolutionSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_constants","_grid","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","gridImagePath","IS_WEB","Image","resolveAssetSource","gridImage","uri","SolutionSection","answer","status","shouldShowAnswer","ExampleSolutionStatuses","DONE_DATA","CACHE","jsxs","View","style","styles","container","children","jsx","source","gridImageWeb","ScrollView","solutionScroll","contentContainerStyle","solutionScrollContent","entering","undefined","FadeIn","delay","duration","Text","solutionText","exports","StyleSheet","create","width","overflow","borderRadius","borderWidth","borderColor","COLORS","NEUTRAL_5","height","resizeMode","aspectRatio","transform","scale","position","paddingHorizontal","SPACING","paddingVertical","fontFamily","fontSize"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/SolutionSection.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AAA0C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAS,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,SAAAL,wBAAAK,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,GAA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AE;IACdyB,QAAQ,EAAE,UAAU;IACpBZ,KAAK,EAAE,MAAM;IACbO,MAAM,EAAE;EACV,CAAC;EACDlB,qBAAqB,EAAE;IACrBwB,iBAAiB,EAAEC,sBAAO,CAAC,GAAG,CAAC;IAC/BC,eAAe,EAAED,sBAAO,CAAC,GAAG;EAC9B,CAAC;EACDlB,YAAY,EAAE;IACZoB,UAAU,EAAE,mBAAmB;IAC/BC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExampleSolutionStatuses = void 0;
7
+ let ExampleSolutionStatuses = exports.ExampleSolutionStatuses = /*#__PURE__*/function (ExampleSolutionStatuses) {
8
+ ExampleSolutionStatuses["LOADING"] = "loading";
9
+ ExampleSolutionStatuses["DONE_DATA"] = "doneData";
10
+ ExampleSolutionStatuses["CACHE"] = "cache";
11
+ return ExampleSolutionStatuses;
12
+ }({});
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ExampleSolutionStatuses","exports"],"sourceRoot":"../../../../src","sources":["features/exampleSolution/constants.ts"],"mappings":";;;;;;IAAkBA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useExampleSolution = void 0;
7
+ var _react = require("react");
8
+ var _effectorReact = require("effector-react");
9
+ var _constants = require("../constants.js");
10
+ const ANIMATION_DELAY = 600;
11
+ const useExampleSolution = ({
12
+ model,
13
+ payload,
14
+ cacheKey
15
+ }) => {
16
+ const exampleSolutionsCache = (0, _effectorReact.useUnit)(model.cache.$state);
17
+ const [result, setResult] = (0, _react.useState)(null);
18
+ const [status, setStatus] = (0, _react.useState)(_constants.ExampleSolutionStatuses.LOADING);
19
+ (0, _react.useEffect)(() => {
20
+ let timer = null;
21
+ const fetchExampleSolution = async () => {
22
+ try {
23
+ if (exampleSolutionsCache[cacheKey]) {
24
+ setResult(exampleSolutionsCache[cacheKey]);
25
+ setStatus(_constants.ExampleSolutionStatuses.CACHE);
26
+ return;
27
+ }
28
+ const startTime = Date.now();
29
+ const response = await model.api.generateExampleSolutionFx(payload);
30
+ setResult(response);
31
+ model.cache.addExampleSolution({
32
+ cacheKey,
33
+ response
34
+ });
35
+ const elapsedTime = Date.now() - startTime;
36
+ if (elapsedTime >= ANIMATION_DELAY) {
37
+ setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
38
+ } else {
39
+ timer = setTimeout(() => {
40
+ setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
41
+ }, ANIMATION_DELAY - elapsedTime);
42
+ }
43
+ } catch (error) {
44
+ console.error('Failed to fetch example solution:', error);
45
+ setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
46
+ }
47
+ };
48
+ fetchExampleSolution();
49
+ return () => {
50
+ if (timer) {
51
+ clearTimeout(timer);
52
+ }
53
+ };
54
+ }, []);
55
+ return {
56
+ result,
57
+ status
58
+ };
59
+ };
60
+ exports.useExampleSolution = useExampleSolution;
61
+ //# sourceMappingURL=useExampleSolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_effectorReact","_constants","ANIMATION_DELAY","useExampleSolution","model","payload","cacheKey","exampleSolutionsCache","useUnit","cache","$state","result","setResult","useState","status","setStatus","ExampleSolutionStatuses","LOADING","useEffect","timer","fetchExampleSolution","CACHE","startTime","Date","now","response","api","generateExampleSolutionFx","addExampleSolution","elapsedTime","DONE_DATA","setTimeout","error","console","clearTimeout","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/hooks/useExampleSolution.ts"],"mappings":";;;;;;AAAA,IA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AC,MAAM;YACvBhB,SAAS,CAACC,kCAAuB,CAACc,SAAS,CAAC;UAC9C,CAAC,EAAE5B,eAAe,GAAG2B,WAAW,CAAC;QACnC;MACF,CAAC,CAAC,OAAOG,KAAK,EAAE;QACdC,OAAO,CAACD,KAAK,CAAC,mCAAmC,EAAEA,KAAK,CAAC;QACzDjB,SAAS,CAACC,kCAAuB,CAACc,SAAS,CAAC;MAC9C;IACF,CAAC;IAEDV,oBAAoB,CAAC,CAAC;IAEtB,OAAO,MAAM;MACX,IAAID,KAAK,EAAE;QACTe,YAAY,CAACf,KAAK,CAAC;MACrB;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLR,MAAM;IACNG;EACF,CAAC;AACH,CAAC;AAAAqB,OAAA,CAAAhC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _ExampleSolutionModal = require("./ExampleSolutionModal.js");
7
+ Object.keys(_ExampleSolutionModal).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ExampleSolutionModal[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ExampleSolutionModal[key];
14
+ }
15
+ });
16
+ });
17
+ var _ExampleSolutionModel = require("./model/ExampleSolution.model.js");
18
+ Object.keys(_ExampleSolutionModel).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _ExampleSolutionModel[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _ExampleSolutionModel[key];
25
+ }
26
+ });
27
+ });
28
+ var _types = require("./types.js");
29
+ Object.keys(_types).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _types[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _types[key];
36
+ }
37
+ });
38
+ });
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ExampleSolutionModal","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_ExampleSolutionModel","_types"],"sourceRoot":"../../../../src","sources":["features/exampleSolution/index.ts"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,qBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,qBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,qBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,qBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExampleSolutionModel = void 0;
7
+ var _ExampleSolutionApi = require("./ExampleSolutionApi.js");
8
+ var _ExampleSolutionCache = require("./ExampleSolutionCache.js");
9
+ class ExampleSolutionModel {
10
+ cache = new _ExampleSolutionCache.ExampleSolutionCache();
11
+ constructor({
12
+ api,
13
+ errorHandler
14
+ }) {
15
+ this.api = new _ExampleSolutionApi.ExampleSolutionsApi({
16
+ api,
17
+ errorHandler
18
+ });
19
+ }
20
+ }
21
+ exports.ExampleSolutionModel = ExampleSolutionModel;
22
+ //# sourceMappingURL=ExampleSolution.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ExampleSolutionApi","require","_ExampleSolutionCache","ExampleSolutionModel","cache","ExampleSolutionCache","constructor","api","errorHandler","ExampleSolutionsApi","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolution.model.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,CAAC;EAEhBC,KAAK,GAAG,IAAIC,0CAAoB,CAAC,CAAC;EAElDC,WAAWA,CAAC;IAAEC,GAAG;IAAEC;EAAwC,CAAC,EAAE;IAC5D,IAAI,CAACD,GAAG,GAAG,IAAIE,uCAAmB,CAAC;MAAEF,GAAG;MAAEC;IAAa,CAAC,CAAC;EAC3D;AACF;AAACE,OAAA,CAAAP,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ExampleSolutionsApi = void 0;
7
+ var _createControllerEffect = require("./../../../lib/effector/createControllerEffect.js");
8
+ var _index = require("../../../shared/translation/index.js");
9
+ var _effector = require("effector");
10
+ class ExampleSolutionsApi {
11
+ errorHandlingFx = (0, _effector.attach)({
12
+ source: _index.$localization,
13
+ effect: (0, _effector.createEffect)(localization => {
14
+ if (!this.errorHandlerFx) return;
15
+ const errorMessage = localization.exampleSolution.errorMessage;
16
+ this.errorHandlerFx(errorMessage);
17
+ })
18
+ });
19
+ constructor({
20
+ api,
21
+ errorHandler
22
+ }) {
23
+ this.generateExampleSolutionFx = (0, _createControllerEffect.createControllerEffect)(api.generateExampleSolution);
24
+ this.errorHandlerFx = errorHandler;
25
+ (0, _effector.sample)({
26
+ clock: this.generateExampleSolutionFx.fail,
27
+ target: this.errorHandlingFx
28
+ });
29
+ }
30
+ }
31
+ exports.ExampleSolutionsApi = ExampleSolutionsApi;
32
+ //# sourceMappingURL=ExampleSolutionApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_createControllerEffect","require","_index","_effector","ExampleSolutionsApi","errorHandlingFx","attach","source","$localization","effect","createEffect","localization","errorHandlerFx","errorMessage","exampleSolution","constructor","api","errorHandler","generateExampleSolutionFx","createControllerEffect","generateExampleSolution","sample","clock","fail","target","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolutionApi.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAOO,MAAMG,mBAAmB,CAAC;EAIfC,eAAe,GAAG,IAAAC,gBAAM,EAAC;IACvCC,MAAM,EAAEC,oBAAa;IACrBC,MAAM,EAAE,IAAAC,sBAAY,EAAEC,YAA8C,IAAK;MACvE,IAAI,CAAC,IAAI,CAACC,cAAc,EAAE;MAC1B,MAAMC,YAAY,GAAGF,YAAY,CAACG,eAAe,CAACD,YAAY;MAC9D,IAAI,CAACD,cAAc,CAACC,YAAY,CAAC;IACnC,CAAC;EACH,CAAC,CAAC;EAEFE,WAAWA,CAAC;IAAEC,GAAG;IAAEC;EAAsC,CAAC,EAAE;IAC1D,IAAI,CAACC,yBAAyB,GAAG,IAAAC,8CAAsB,EAACH,GAAG,CAACI,uBAAuB,CAAC;IACpF,IAAI,CAACR,cAAc,GAAGK,YAAY;IAElC,IAAAI,gBAAM,EAAC;MACLC,KAAK,EAAE,IAAI,CAACJ,yBAAyB,CAACK,IAAI;MAC1CC,MAAM,EAAE,IAAI,CAACnB;IACf,CAAC,CAAC;EACJ;AACF;AAACoB,OAAA,CAAArB,mBAAA,GAAAA,mBAAA","ignoreList":[]}