@magmamath/students-features 0.6.1-2.rc-2 → 0.6.1-2.rc-4
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.
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +2 -3
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +6 -6
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js +2 -1
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js +2 -2
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +1 -1
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js +14 -7
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +13 -5
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js +2 -3
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -1
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js +2 -3
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -1
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +6 -6
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
- package/dist/module/features/exampleSolution/components/LavaIcon.js +2 -1
- package/dist/module/features/exampleSolution/components/LavaIcon.js.map +1 -1
- package/dist/module/features/exampleSolution/components/MessageBlock.js +2 -2
- package/dist/module/features/exampleSolution/components/MessageBlock.js.map +1 -1
- package/dist/module/features/exampleSolution/components/SolutionSection.js +1 -1
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js +14 -7
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js.map +1 -1
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +13 -5
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js +2 -3
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +2 -9
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts +2 -8
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts +4 -2
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts +1 -2
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +3 -2
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +2 -9
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts +2 -8
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts +4 -2
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts +1 -2
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/types.d.ts +3 -2
- package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/exampleSolution/ExampleSolutionModal.tsx +1 -5
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +8 -15
- package/src/features/exampleSolution/components/LavaIcon.tsx +3 -1
- package/src/features/exampleSolution/components/MessageBlock.tsx +3 -3
- package/src/features/exampleSolution/components/SolutionSection.tsx +1 -1
- package/src/features/exampleSolution/hooks/useExampleSolution.ts +18 -16
- package/src/features/exampleSolution/model/ExampleSolutionApi.ts +17 -7
- package/src/features/exampleSolution/model/ExampleSolutionCache.ts +7 -7
- package/src/features/exampleSolution/types.ts +3 -2
- package/dist/commonjs/features/exampleSolution/components/index.js +0 -2
- package/dist/commonjs/features/exampleSolution/components/index.js.map +0 -1
- package/dist/module/features/exampleSolution/components/index.js +0 -2
- package/dist/module/features/exampleSolution/components/index.js.map +0 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/index.d.ts +0 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/index.d.ts.map +0 -1
- package/dist/typescript/module/features/exampleSolution/components/index.d.ts +0 -1
- package/dist/typescript/module/features/exampleSolution/components/index.d.ts.map +0 -1
- package/src/features/exampleSolution/components/index.ts +0 -0
|
@@ -23,9 +23,8 @@ const ExampleSolutionModal = ({
|
|
|
23
23
|
onClose: closeModal,
|
|
24
24
|
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExampleSolutionModalContent.ExampleSolutionModalContent, {
|
|
25
25
|
model: params.model,
|
|
26
|
-
payload: params.payload
|
|
27
|
-
|
|
28
|
-
})
|
|
26
|
+
payload: params.payload
|
|
27
|
+
}, params.key)
|
|
29
28
|
});
|
|
30
29
|
exports.ExampleSolutionModal = ExampleSolutionModal;
|
|
31
30
|
//# sourceMappingURL=ExampleSolutionModal.js.map
|
|
@@ -1 +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","
|
|
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","key","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;IAACC,KAAK,EAAEV,MAAM,CAACU,KAAM;IAACC,OAAO,EAAEX,MAAM,CAACW;EAAQ,GAAMX,MAAM,CAACY,GAAM;AAC9F,CACF,CACF;AAAAC,OAAA,CAAAhB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -19,7 +19,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
19
19
|
const ExampleSolutionModalContent = ({
|
|
20
20
|
model,
|
|
21
21
|
payload,
|
|
22
|
-
|
|
22
|
+
key
|
|
23
23
|
}) => {
|
|
24
24
|
const {
|
|
25
25
|
result,
|
|
@@ -27,9 +27,9 @@ const ExampleSolutionModalContent = ({
|
|
|
27
27
|
} = (0, _useExampleSolution.useExampleSolution)({
|
|
28
28
|
model,
|
|
29
29
|
payload,
|
|
30
|
-
|
|
30
|
+
key
|
|
31
31
|
});
|
|
32
|
-
const
|
|
32
|
+
const localization = (0, _effectorReact.useUnit)(_index.$localization);
|
|
33
33
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
34
34
|
style: styles.container,
|
|
35
35
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
@@ -38,7 +38,7 @@ const ExampleSolutionModalContent = ({
|
|
|
38
38
|
style: {
|
|
39
39
|
color: _reactNativeUi.COLORS.NEUTRAL_9
|
|
40
40
|
},
|
|
41
|
-
children:
|
|
41
|
+
children: localization.exampleSolution.exampleSolution
|
|
42
42
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
43
43
|
style: styles.content,
|
|
44
44
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_QuestionSection.QuestionSection, {
|
|
@@ -60,8 +60,8 @@ const ExampleSolutionModalContent = ({
|
|
|
60
60
|
exports.ExampleSolutionModalContent = ExampleSolutionModalContent;
|
|
61
61
|
const styles = _reactNative.StyleSheet.create({
|
|
62
62
|
container: {
|
|
63
|
-
width:
|
|
64
|
-
height:
|
|
63
|
+
width: 880,
|
|
64
|
+
height: 593
|
|
65
65
|
},
|
|
66
66
|
content: {
|
|
67
67
|
flex: 1,
|
package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_effectorReact","_index","_MessageBlock","_LavaIcon","_QuestionSection","_SolutionSection","_useExampleSolution","_jsxRuntime","e","__esModule","default","ExampleSolutionModalContent","model","payload","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_effectorReact","_index","_MessageBlock","_LavaIcon","_QuestionSection","_SolutionSection","_useExampleSolution","_jsxRuntime","e","__esModule","default","ExampleSolutionModalContent","model","payload","key","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;AAAg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xRuntime = require("react/jsx-runtime");
|
|
|
13
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
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
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const LAVA_ICON_HEIGHT = 112;
|
|
16
17
|
const LavaIcon = ({
|
|
17
18
|
status,
|
|
18
19
|
style
|
|
@@ -34,7 +35,7 @@ const LavaIcon = ({
|
|
|
34
35
|
style: style,
|
|
35
36
|
entering: _reactNativeReanimated.FadeIn,
|
|
36
37
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExcitedLavaIcon.ExcitedLavaIcon, {
|
|
37
|
-
height:
|
|
38
|
+
height: LAVA_ICON_HEIGHT
|
|
38
39
|
})
|
|
39
40
|
})]
|
|
40
41
|
});
|
|
@@ -1 +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","LavaIcon","status","style","opacityAnimation","useAnimatedStyle","opacity","withTiming","ExampleSolutionStatuses","LOADING","duration","jsxs","Fragment","children","jsx","View","LavaIconInGlasses","height","entering","Fad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AM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAAA,SAAAjB,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAI,UAAA,GAAAJ,CAAA,KAAAK,OAAA,EAAAL,CAAA;
|
|
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,uBAA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AAC,CAAC;EAEZ,oBACE,IAAAvB,WAAA,CAAAgC,IAAA,EAAAhC,WAAA,CAAAiC,QAAA;IAAAC,QAAA,gBACE,IAAAlC,WAAA,CAAAmC,GAAA,EAACtC,sBAAA,CAAAU,OAAQ,CAAC6B,IAAI;MAACZ,KAAK,EAAE,CAACA,KAAK,EAAEC,gBAAgB,CAAE;MAAAS,QAAA,eAC9C,IAAAlC,WAAA,CAAAmC,GAAA,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":[]}
|
|
@@ -19,7 +19,7 @@ const MessageBlock = ({
|
|
|
19
19
|
status,
|
|
20
20
|
style
|
|
21
21
|
}) => {
|
|
22
|
-
const
|
|
22
|
+
const localization = (0, _effectorReact.useUnit)(_index.$localization);
|
|
23
23
|
const opacityAnimation = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
|
|
24
24
|
return {
|
|
25
25
|
opacity: (0, _reactNativeReanimated.withDelay)(2000, (0, _reactNativeReanimated.withTiming)(status === _constants.ExampleSolutionStatuses.LOADING ? 1 : 0, {
|
|
@@ -34,7 +34,7 @@ const MessageBlock = ({
|
|
|
34
34
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
35
35
|
variant: 'small',
|
|
36
36
|
numberOfLines: 1,
|
|
37
|
-
children: status === _constants.ExampleSolutionStatuses.LOADING ?
|
|
37
|
+
children: status === _constants.ExampleSolutionStatuses.LOADING ? localization.exampleSolution.letMeThink : localization.exampleSolution.aha
|
|
38
38
|
})
|
|
39
39
|
});
|
|
40
40
|
};
|
|
@@ -1 +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","
|
|
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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C,SAAS;IACjCC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBC,uBAAuB,EAAE,CAAC;IAC1BC,WAAW,EAAEV,uBAAU,CAACW,aAAa;IACrCC,WAAW,EAAEP,qBAAM,CAACQ,SAAS;IAE7BC,WAAW,EAAET,qBAAM,CAACU,UAAU;IAC9BC,YAAY,EAAE;MACZC,KAAK,EAAE,CAAC;MACRV,MAAM,EAAE;IACV,CAAC;IACDW,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IAEfC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -11,16 +11,17 @@ const ANIMATION_DELAY = 600;
|
|
|
11
11
|
const useExampleSolution = ({
|
|
12
12
|
model,
|
|
13
13
|
payload,
|
|
14
|
-
|
|
14
|
+
key
|
|
15
15
|
}) => {
|
|
16
16
|
const exampleSolutionsCache = (0, _effectorReact.useUnit)(model.cache.$state);
|
|
17
17
|
const [result, setResult] = (0, _react.useState)(null);
|
|
18
18
|
const [status, setStatus] = (0, _react.useState)(_constants.ExampleSolutionStatuses.LOADING);
|
|
19
19
|
(0, _react.useEffect)(() => {
|
|
20
|
+
let timer = null;
|
|
20
21
|
const fetchExampleSolution = async () => {
|
|
21
22
|
try {
|
|
22
|
-
if (exampleSolutionsCache[
|
|
23
|
-
setResult(exampleSolutionsCache[
|
|
23
|
+
if (exampleSolutionsCache[key]) {
|
|
24
|
+
setResult(exampleSolutionsCache[key]);
|
|
24
25
|
setStatus(_constants.ExampleSolutionStatuses.CACHE);
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
@@ -28,23 +29,29 @@ const useExampleSolution = ({
|
|
|
28
29
|
const response = await model.api.generateExampleSolutionFx(payload);
|
|
29
30
|
setResult(response);
|
|
30
31
|
model.cache.addExampleSolution({
|
|
31
|
-
|
|
32
|
+
key,
|
|
32
33
|
response
|
|
33
34
|
});
|
|
34
35
|
const elapsedTime = Date.now() - startTime;
|
|
35
36
|
if (elapsedTime >= ANIMATION_DELAY) {
|
|
36
37
|
setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
|
|
37
38
|
} else {
|
|
38
|
-
setTimeout(() => {
|
|
39
|
+
timer = setTimeout(() => {
|
|
39
40
|
setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
|
|
40
|
-
}, ANIMATION_DELAY);
|
|
41
|
+
}, ANIMATION_DELAY - elapsedTime);
|
|
41
42
|
}
|
|
42
43
|
} catch (error) {
|
|
43
44
|
console.error('Failed to fetch example solution:', error);
|
|
45
|
+
setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
|
|
44
46
|
}
|
|
45
47
|
};
|
|
46
48
|
fetchExampleSolution();
|
|
47
|
-
|
|
49
|
+
return () => {
|
|
50
|
+
if (timer) {
|
|
51
|
+
clearTimeout(timer);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}, [model, payload, key, exampleSolutionsCache]);
|
|
48
55
|
return {
|
|
49
56
|
result,
|
|
50
57
|
status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_effectorReact","_constants","ANIMATION_DELAY","useExampleSolution","model","payload","
|
|
1
|
+
{"version":3,"names":["_react","require","_effectorReact","_constants","ANIMATION_DELAY","useExampleSolution","model","payload","key","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,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAEA,MAAMG,eAAe,GAAG,GAAG;AAOpB,MAAMC,kBAAkB,GAAGA,CAAC;EACjCC,KAAK;EACLC,OAAO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C,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,CAACf,KAAK,EAAEC,OAAO,EAAEC,GAAG,EAAEC,qBAAqB,CAAC,CAAC;EAEhD,OAAO;IACLI,MAAM;IACNG;EACF,CAAC;AACH,CAAC;AAAAqB,OAAA,CAAAhC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -6,17 +6,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ExampleSolutionsApi = void 0;
|
|
7
7
|
var _createControllerEffect = require("./../../../lib/effector/createControllerEffect.js");
|
|
8
8
|
var _index = require("../../../shared/translation/index.js");
|
|
9
|
+
var _effector = require("effector");
|
|
9
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
|
+
});
|
|
10
19
|
constructor({
|
|
11
20
|
api,
|
|
12
21
|
errorHandler
|
|
13
22
|
}) {
|
|
14
23
|
this.generateExampleSolutionFx = (0, _createControllerEffect.createControllerEffect)(api.generateExampleSolution);
|
|
15
|
-
this.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
24
|
+
this.errorHandlerFx = errorHandler;
|
|
25
|
+
(0, _effector.sample)({
|
|
26
|
+
clock: this.generateExampleSolutionFx.fail,
|
|
27
|
+
target: this.errorHandlingFx
|
|
20
28
|
});
|
|
21
29
|
}
|
|
22
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_createControllerEffect","require","_index","ExampleSolutionsApi","
|
|
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":[]}
|
|
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ExampleSolutionCache = void 0;
|
|
7
7
|
var _effector = require("effector");
|
|
8
8
|
class ExampleSolutionCache {
|
|
9
|
-
resetState = (0, _effector.createEvent)();
|
|
10
9
|
addExampleSolution = (0, _effector.createEvent)();
|
|
11
|
-
$state = (0, _effector.createStore)({}).
|
|
10
|
+
$state = (0, _effector.createStore)({}).on(this.addExampleSolution, (state, exampleSolution) => {
|
|
12
11
|
return {
|
|
13
12
|
...state,
|
|
14
|
-
[exampleSolution.
|
|
13
|
+
[exampleSolution.key]: exampleSolution.response
|
|
15
14
|
};
|
|
16
15
|
});
|
|
17
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_effector","require","ExampleSolutionCache","
|
|
1
|
+
{"version":3,"names":["_effector","require","ExampleSolutionCache","addExampleSolution","createEvent","$state","createStore","on","state","exampleSolution","key","response","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolutionCache.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAQO,MAAMC,oBAAoB,CAAC;EAChBC,kBAAkB,GAAG,IAAAC,qBAAW,EAAqB,CAAC;EACtDC,MAAM,GAAG,IAAAC,qBAAW,EAA0C,CAAC,CAAC,CAAC,CAACC,EAAE,CAClF,IAAI,CAACJ,kBAAkB,EACvB,CAACK,KAAK,EAAEC,eAAe,KAAK;IAC1B,OAAO;MACL,GAAGD,KAAK;MACR,CAACC,eAAe,CAACC,GAAG,GAAGD,eAAe,CAACE;IACzC,CAAC;EACH,CACF,CAAC;AACH;AAACC,OAAA,CAAAV,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -18,8 +18,7 @@ export const ExampleSolutionModal = ({
|
|
|
18
18
|
onClose: closeModal,
|
|
19
19
|
content: /*#__PURE__*/_jsx(ExampleSolutionModalContent, {
|
|
20
20
|
model: params.model,
|
|
21
|
-
payload: params.payload
|
|
22
|
-
|
|
23
|
-
})
|
|
21
|
+
payload: params.payload
|
|
22
|
+
}, params.key)
|
|
24
23
|
});
|
|
25
24
|
//# sourceMappingURL=ExampleSolutionModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","BaseModal","SPACING","ExampleSolutionModalContent","jsx","_jsx","ExampleSolutionModal","modal","closeModal","params","style","container","paddingHorizontal","onClose","content","model","payload","
|
|
1
|
+
{"version":3,"names":["React","BaseModal","SPACING","ExampleSolutionModalContent","jsx","_jsx","ExampleSolutionModal","modal","closeModal","params","style","container","paddingHorizontal","onClose","content","model","payload","key"],"sourceRoot":"../../../../src","sources":["features/exampleSolution/ExampleSolutionModal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,OAAO,QAAQ,4BAA4B;AAC/D,SAASC,2BAA2B,QAAQ,6CAA0C;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUtF,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;EACnCC,KAAK,EAAE;IAAEC,UAAU;IAAEC;EAAO;AACM,CAAC,kBACnCJ,IAAA,CAACJ,SAAS;EACRS,KAAK,EAAE;IACLC,SAAS,EAAE;MAAEC,iBAAiB,EAAEV,OAAO,CAAC,GAAG;IAAE;EAC/C,CAAE;EACFW,OAAO,EAAEL,UAAW;EACpBM,OAAO,eACLT,IAAA,CAACF,2BAA2B;IAACY,KAAK,EAAEN,MAAM,CAACM,KAAM;IAACC,OAAO,EAAEP,MAAM,CAACO;EAAQ,GAAMP,MAAM,CAACQ,GAAM;AAC9F,CACF,CACF","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
export const ExampleSolutionModalContent = ({
|
|
15
15
|
model,
|
|
16
16
|
payload,
|
|
17
|
-
|
|
17
|
+
key
|
|
18
18
|
}) => {
|
|
19
19
|
const {
|
|
20
20
|
result,
|
|
@@ -22,9 +22,9 @@ export const ExampleSolutionModalContent = ({
|
|
|
22
22
|
} = useExampleSolution({
|
|
23
23
|
model,
|
|
24
24
|
payload,
|
|
25
|
-
|
|
25
|
+
key
|
|
26
26
|
});
|
|
27
|
-
const
|
|
27
|
+
const localization = useUnit($localization);
|
|
28
28
|
return /*#__PURE__*/_jsxs(View, {
|
|
29
29
|
style: styles.container,
|
|
30
30
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
@@ -33,7 +33,7 @@ export const ExampleSolutionModalContent = ({
|
|
|
33
33
|
style: {
|
|
34
34
|
color: COLORS.NEUTRAL_9
|
|
35
35
|
},
|
|
36
|
-
children:
|
|
36
|
+
children: localization.exampleSolution.exampleSolution
|
|
37
37
|
}), /*#__PURE__*/_jsxs(View, {
|
|
38
38
|
style: styles.content,
|
|
39
39
|
children: [/*#__PURE__*/_jsx(QuestionSection, {
|
|
@@ -54,8 +54,8 @@ export const ExampleSolutionModalContent = ({
|
|
|
54
54
|
};
|
|
55
55
|
const styles = StyleSheet.create({
|
|
56
56
|
container: {
|
|
57
|
-
width:
|
|
58
|
-
height:
|
|
57
|
+
width: 880,
|
|
58
|
+
height: 593
|
|
59
59
|
},
|
|
60
60
|
content: {
|
|
61
61
|
flex: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","View","React","COLORS","HeadingVariants","SPACING","Typography","useUnit","$localization","MessageBlock","LavaIcon","QuestionSection","SolutionSection","useExampleSolution","jsx","_jsx","jsxs","_jsxs","ExampleSolutionModalContent","model","payload","
|
|
1
|
+
{"version":3,"names":["StyleSheet","View","React","COLORS","HeadingVariants","SPACING","Typography","useUnit","$localization","MessageBlock","LavaIcon","QuestionSection","SolutionSection","useExampleSolution","jsx","_jsx","jsxs","_jsxs","ExampleSolutionModalContent","model","payload","key","result","status","localization","style","styles","container","children","align","variant","H2","color","NEUTRAL_9","exampleSolution","content","question","answer","messageBlock","lavaIconContainer","create","width","height","flex","flexDirection","marginTop","gap","solutionContainer","overflow","borderRadius","borderWidth","borderColor","NEUTRAL_5","position","bottom","right","loaderContainer","paddingTop","backgroundColor","NEU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AAE,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ import { LavaIconInGlasses } from "../../../shared/icons/index.js";
|
|
|
6
6
|
import Animated, { FadeIn, useAnimatedStyle, withTiming } from 'react-native-reanimated';
|
|
7
7
|
import { ExampleSolutionStatuses } from "../constants.js";
|
|
8
8
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const LAVA_ICON_HEIGHT = 112;
|
|
9
10
|
export const LavaIcon = ({
|
|
10
11
|
status,
|
|
11
12
|
style
|
|
@@ -27,7 +28,7 @@ export const LavaIcon = ({
|
|
|
27
28
|
style: style,
|
|
28
29
|
entering: FadeIn,
|
|
29
30
|
children: /*#__PURE__*/_jsx(ExcitedLavaIcon, {
|
|
30
|
-
height:
|
|
31
|
+
height: LAVA_ICON_HEIGHT
|
|
31
32
|
})
|
|
32
33
|
})]
|
|
33
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ExcitedLavaIcon","LavaIconInGlasses","Animated","FadeIn","useAnimatedStyle","withTiming","ExampleSolutionStatuses","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","LavaIcon","status","style","opacityAnimation","opacity","LOADING","duration","children","View","height","entering"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/LavaIcon.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,0CAAuC;AACvE,SAASC,iBAAiB,QAAQ,gCAAuB;AACzD,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,yBAAyB;AAExF,SAASC,uBAAuB,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["React","ExcitedLavaIcon","LavaIconInGlasses","Animated","FadeIn","useAnimatedStyle","withTiming","ExampleSolutionStatuses","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","LAVA_ICON_HEIGHT","LavaIcon","status","style","opacityAnimation","opacity","LOADING","duration","children","View","height","entering"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/LavaIcon.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,0CAAuC;AACvE,SAASC,iBAAiB,QAAQ,gCAAuB;AACzD,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,yBAAyB;AAExF,SAASC,uBAAuB,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtD,MAAMC,gBAAgB,GAAG,GAAG;AAO5B,OAAO,MAAMC,QAAQ,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAqB,CAAC,KAAK;EAC5D,MAAMC,gBAAgB,GAAGb,gBAAgB,CAAC,MAAM;IAC9C,OAAO;MACLc,OAAO,EAAEb,UAAU,CAACU,MAAM,KAAKT,uBAAuB,CAACa,OAAO,GAAG,CAAC,GAAG,CAAC,EAAE;QAAEC,QAAQ,EAAE;MAAI,CAAC;IAC3F,CAAC;EACH,CAAC,EAAE,CAACL,MAAM,CAAC,CAAC;EAEZ,oBACEH,KAAA,CAAAF,SAAA;IAAAW,QAAA,gBACEb,IAAA,CAACN,QAAQ,CAACoB,IAAI;MAACN,KAAK,EAAE,CAACA,KAAK,EAAEC,gBAAgB,CAAE;MAAAI,QAAA,eAC9Cb,IAAA,CAACP,iBAAiB;QAACsB,MAAM,EAAE;MAAI,CAAE;IAAC,CACrB,CAAC,EAEfR,MAAM,KAAKT,uBAAuB,CAACa,OAAO,iBACzCX,IAAA,CAACN,QAAQ,CAACoB,IAAI;MAACN,KAAK,EAAEA,KAAM;MAACQ,QAAQ,EAAErB,MAAO;MAAAkB,QAAA,eAC5Cb,IAAA,CAACR,eAAe;QAACuB,MAAM,EAAEV;MAAiB,CAAE;IAAC,CAChC,CAChB;EAAA,CACD,CAAC;AAEP,CAAC","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ export const MessageBlock = ({
|
|
|
12
12
|
status,
|
|
13
13
|
style
|
|
14
14
|
}) => {
|
|
15
|
-
const
|
|
15
|
+
const localization = useUnit($localization);
|
|
16
16
|
const opacityAnimation = useAnimatedStyle(() => {
|
|
17
17
|
return {
|
|
18
18
|
opacity: withDelay(2000, withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, {
|
|
@@ -27,7 +27,7 @@ export const MessageBlock = ({
|
|
|
27
27
|
children: /*#__PURE__*/_jsx(Typography, {
|
|
28
28
|
variant: 'small',
|
|
29
29
|
numberOfLines: 1,
|
|
30
|
-
children: status === ExampleSolutionStatuses.LOADING ?
|
|
30
|
+
children: status === ExampleSolutionStatuses.LOADING ? localization.exampleSolution.letMeThink : localization.exampleSolution.aha
|
|
31
31
|
})
|
|
32
32
|
});
|
|
33
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","React","COLORS","SPACING","Typography","useUnit","$localization","Animated","LinearTransition","useAnimatedStyle","withDelay","withTiming","ExampleSolutionStatuses","jsx","_jsx","MessageBlock","status","style","
|
|
1
|
+
{"version":3,"names":["StyleSheet","React","COLORS","SPACING","Typography","useUnit","$localization","Animated","LinearTransition","useAnimatedStyle","withDelay","withTiming","ExampleSolutionStatuses","jsx","_jsx","MessageBlock","status","style","localization","opacityAnimation","opacity","LOADING","duration","CACHE","View","layout","styles","container","children","variant","numberOfLines","exampleSolution","letMeThink","aha","create","padding","backgroundColor","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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CAACE;IAAG,CAC1B;EAAC,CACA,CAAC;AAEpB,CAAC;AAED,MAAMP,MAAM,GAAG1B,UAAU,CAACkC,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,OAAO,EAAEhC,OAAO,CAAC,GAAG,CAAC;IACrBiC,eAAe,EAAElC,MAAM,CAACmC,SAAS;IACjCC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBC,uBAAuB,EAAE,CAAC;IAC1BC,WAAW,EAAEzC,UAAU,CAAC0C,aAAa;IACrCC,WAAW,EAAEzC,MAAM,CAAC0C,SAAS;IAE7BC,WAAW,EAAE3C,MAAM,CAAC4C,UAAU;IAC9BC,YAAY,EAAE;MACZC,KAAK,EAAE,CAAC;MACRV,MAAM,EAAE;IACV,CAAC;IACDW,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IAEfC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -7,16 +7,17 @@ const ANIMATION_DELAY = 600;
|
|
|
7
7
|
export const useExampleSolution = ({
|
|
8
8
|
model,
|
|
9
9
|
payload,
|
|
10
|
-
|
|
10
|
+
key
|
|
11
11
|
}) => {
|
|
12
12
|
const exampleSolutionsCache = useUnit(model.cache.$state);
|
|
13
13
|
const [result, setResult] = useState(null);
|
|
14
14
|
const [status, setStatus] = useState(ExampleSolutionStatuses.LOADING);
|
|
15
15
|
useEffect(() => {
|
|
16
|
+
let timer = null;
|
|
16
17
|
const fetchExampleSolution = async () => {
|
|
17
18
|
try {
|
|
18
|
-
if (exampleSolutionsCache[
|
|
19
|
-
setResult(exampleSolutionsCache[
|
|
19
|
+
if (exampleSolutionsCache[key]) {
|
|
20
|
+
setResult(exampleSolutionsCache[key]);
|
|
20
21
|
setStatus(ExampleSolutionStatuses.CACHE);
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
@@ -24,23 +25,29 @@ export const useExampleSolution = ({
|
|
|
24
25
|
const response = await model.api.generateExampleSolutionFx(payload);
|
|
25
26
|
setResult(response);
|
|
26
27
|
model.cache.addExampleSolution({
|
|
27
|
-
|
|
28
|
+
key,
|
|
28
29
|
response
|
|
29
30
|
});
|
|
30
31
|
const elapsedTime = Date.now() - startTime;
|
|
31
32
|
if (elapsedTime >= ANIMATION_DELAY) {
|
|
32
33
|
setStatus(ExampleSolutionStatuses.DONE_DATA);
|
|
33
34
|
} else {
|
|
34
|
-
setTimeout(() => {
|
|
35
|
+
timer = setTimeout(() => {
|
|
35
36
|
setStatus(ExampleSolutionStatuses.DONE_DATA);
|
|
36
|
-
}, ANIMATION_DELAY);
|
|
37
|
+
}, ANIMATION_DELAY - elapsedTime);
|
|
37
38
|
}
|
|
38
39
|
} catch (error) {
|
|
39
40
|
console.error('Failed to fetch example solution:', error);
|
|
41
|
+
setStatus(ExampleSolutionStatuses.DONE_DATA);
|
|
40
42
|
}
|
|
41
43
|
};
|
|
42
44
|
fetchExampleSolution();
|
|
43
|
-
|
|
45
|
+
return () => {
|
|
46
|
+
if (timer) {
|
|
47
|
+
clearTimeout(timer);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, [model, payload, key, exampleSolutionsCache]);
|
|
44
51
|
return {
|
|
45
52
|
result,
|
|
46
53
|
status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","useUnit","ExampleSolutionStatuses","ANIMATION_DELAY","useExampleSolution","model","payload","
|
|
1
|
+
{"version":3,"names":["useEffect","useState","useUnit","ExampleSolutionStatuses","ANIMATION_DELAY","useExampleSolution","model","payload","key","exampleSolutionsCache","cache","$state","result","setResult","status","setStatus","LOADING","timer","fetchExampleSolution","CACHE","startTime","Date","now","response","api","generateExampleSolutionFx","addExampleSolution","elapsedTime","DONE_DATA","setTimeout","error","console","clearTimeout"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/hooks/useExampleSolution.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAAS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SAAS,CAAC;UAC9C,CAAC,EAAExB,eAAe,GAAGuB,WAAW,CAAC;QACnC;MACF,CAAC,CAAC,OAAOG,KAAK,EAAE;QACdC,OAAO,CAACD,KAAK,CAAC,mCAAmC,EAAEA,KAAK,CAAC;QACzDf,SAAS,CAACZ,uBAAuB,CAACyB,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,CAACX,KAAK,EAAEC,OAAO,EAAEC,GAAG,EAAEC,qBAAqB,CAAC,CAAC;EAEhD,OAAO;IACLG,MAAM;IACNE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
import { createControllerEffect } from "./../../../lib/effector/createControllerEffect.js";
|
|
4
4
|
import { $localization } from "../../../shared/translation/index.js";
|
|
5
|
+
import { createEffect, sample, attach } from 'effector';
|
|
5
6
|
export class ExampleSolutionsApi {
|
|
7
|
+
errorHandlingFx = attach({
|
|
8
|
+
source: $localization,
|
|
9
|
+
effect: createEffect(localization => {
|
|
10
|
+
if (!this.errorHandlerFx) return;
|
|
11
|
+
const errorMessage = localization.exampleSolution.errorMessage;
|
|
12
|
+
this.errorHandlerFx(errorMessage);
|
|
13
|
+
})
|
|
14
|
+
});
|
|
6
15
|
constructor({
|
|
7
16
|
api,
|
|
8
17
|
errorHandler
|
|
9
18
|
}) {
|
|
10
19
|
this.generateExampleSolutionFx = createControllerEffect(api.generateExampleSolution);
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
20
|
+
this.errorHandlerFx = errorHandler;
|
|
21
|
+
sample({
|
|
22
|
+
clock: this.generateExampleSolutionFx.fail,
|
|
23
|
+
target: this.errorHandlingFx
|
|
16
24
|
});
|
|
17
25
|
}
|
|
18
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createControllerEffect","$localization","
|
|
1
|
+
{"version":3,"names":["createControllerEffect","$localization","createEffect","sample","attach","ExampleSolutionsApi","errorHandlingFx","source","effect","localization","errorHandlerFx","errorMessage","exampleSolution","constructor","api","errorHandler","generateExampleSolutionFx","generateExampleSolution","clock","fail","target"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolutionApi.ts"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,mDAAgD;AAEvF,SAASC,aAAa,QAAQ,sCAA6B;AAC3D,SAASC,YAAY,EAAEC,MAAM,EAAEC,MAAM,QAAoB,UAAU;AAOnE,OAAO,MAAMC,mBAAmB,CAAC;EAIfC,eAAe,GAAGF,MAAM,CAAC;IACvCG,MAAM,EAAEN,aAAa;IACrBO,MAAM,EAAEN,YAAY,CAAEO,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,GAAGhB,sBAAsB,CAACc,GAAG,CAACG,uBAAuB,CAAC;IACpF,IAAI,CAACP,cAAc,GAAGK,YAAY;IAElCZ,MAAM,CAAC;MACLe,KAAK,EAAE,IAAI,CAACF,yBAAyB,CAACG,IAAI;MAC1CC,MAAM,EAAE,IAAI,CAACd;IACf,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { createEvent, createStore } from 'effector';
|
|
4
4
|
export class ExampleSolutionCache {
|
|
5
|
-
resetState = createEvent();
|
|
6
5
|
addExampleSolution = createEvent();
|
|
7
|
-
$state = createStore({}).
|
|
6
|
+
$state = createStore({}).on(this.addExampleSolution, (state, exampleSolution) => {
|
|
8
7
|
return {
|
|
9
8
|
...state,
|
|
10
|
-
[exampleSolution.
|
|
9
|
+
[exampleSolution.key]: exampleSolution.response
|
|
11
10
|
};
|
|
12
11
|
});
|
|
13
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createEvent","createStore","ExampleSolutionCache","
|
|
1
|
+
{"version":3,"names":["createEvent","createStore","ExampleSolutionCache","addExampleSolution","$state","on","state","exampleSolution","key","response"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolutionCache.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,WAAW,QAAQ,UAAU;AAQnD,OAAO,MAAMC,oBAAoB,CAAC;EAChBC,kBAAkB,GAAGH,WAAW,CAAqB,CAAC;EACtDI,MAAM,GAAGH,WAAW,CAA0C,CAAC,CAAC,CAAC,CAACI,EAAE,CAClF,IAAI,CAACF,kBAAkB,EACvB,CAACG,KAAK,EAAEC,eAAe,KAAK;IAC1B,OAAO;MACL,GAAGD,KAAK;MACR,CAACC,eAAe,CAACC,GAAG,GAAGD,eAAe,CAACE;IACzC,CAAC;EACH,CACF,CAAC;AACH","ignoreList":[]}
|