@magmamath/students-features 0.6.12 → 0.6.14-rc.0
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/chatbot/components/Alternatives/Alternatives.js +17 -5
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +148 -41
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Alternatives/InputButton.js +110 -0
- package/dist/commonjs/features/chatbot/components/Alternatives/InputButton.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js +159 -0
- package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +7 -4
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +31 -0
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/assets/grid.png +0 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +97 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js +44 -0
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js +61 -0
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +68 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +75 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/constants.js +13 -0
- package/dist/commonjs/features/exampleSolution/constants.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js +61 -0
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/index.js +39 -0
- package/dist/commonjs/features/exampleSolution/index.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +22 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +32 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js +18 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/types.js +6 -0
- package/dist/commonjs/features/exampleSolution/types.js.map +1 -0
- package/dist/commonjs/index.js +24 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/icons/ExcitedLavaIcon.js +681 -0
- package/dist/commonjs/shared/icons/ExcitedLavaIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/LavaIconInGlasses.js +616 -0
- package/dist/commonjs/shared/icons/LavaIconInGlasses.js.map +1 -0
- package/dist/commonjs/shared/icons/index.js +204 -0
- package/dist/commonjs/shared/icons/index.js.map +1 -0
- package/dist/commonjs/shared/translation/localization/ca.json +7 -1
- package/dist/commonjs/shared/translation/localization/en.json +8 -2
- package/dist/commonjs/shared/translation/localization/gb.json +7 -1
- package/dist/commonjs/shared/translation/localization/sct.json +7 -1
- package/dist/commonjs/shared/translation/localization/sw.json +7 -1
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +17 -5
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +147 -41
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
- package/dist/module/features/chatbot/components/Alternatives/InputButton.js +102 -0
- package/dist/module/features/chatbot/components/Alternatives/InputButton.js.map +1 -0
- package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js +152 -0
- package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +7 -4
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +1 -1
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js +25 -0
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/module/features/exampleSolution/assets/grid.png +0 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +91 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
- package/dist/module/features/exampleSolution/components/LavaIcon.js +36 -0
- package/dist/module/features/exampleSolution/components/LavaIcon.js.map +1 -0
- package/dist/module/features/exampleSolution/components/MessageBlock.js +53 -0
- package/dist/module/features/exampleSolution/components/MessageBlock.js.map +1 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js +60 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js +67 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/constants.js +9 -0
- package/dist/module/features/exampleSolution/constants.js.map +1 -0
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js +56 -0
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
- package/dist/module/features/exampleSolution/index.js +6 -0
- package/dist/module/features/exampleSolution/index.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +17 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +27 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js +13 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
- package/dist/module/features/exampleSolution/types.js +4 -0
- package/dist/module/features/exampleSolution/types.js.map +1 -0
- package/dist/module/index.js +2 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/icons/ExcitedLavaIcon.js +673 -0
- package/dist/module/shared/icons/ExcitedLavaIcon.js.map +1 -0
- package/dist/module/shared/icons/LavaIconInGlasses.js +608 -0
- package/dist/module/shared/icons/LavaIconInGlasses.js.map +1 -0
- package/dist/module/shared/icons/index.js +21 -0
- package/dist/module/shared/icons/index.js.map +1 -0
- package/dist/module/shared/translation/localization/ca.json +7 -1
- package/dist/module/shared/translation/localization/en.json +8 -2
- package/dist/module/shared/translation/localization/gb.json +7 -1
- package/dist/module/shared/translation/localization/sct.json +7 -1
- package/dist/module/shared/translation/localization/sw.json +7 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +3 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts +9 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +10 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +4 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts +10 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts +10 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts +6 -0
- package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/index.d.ts +4 -0
- package/dist/typescript/commonjs/features/exampleSolution/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts +13 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +26 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +2 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/index.d.ts +19 -0
- package/dist/typescript/commonjs/shared/icons/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +30 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +12 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +3 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts +9 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +10 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +4 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts +10 -0
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts +10 -0
- package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/constants.d.ts +6 -0
- package/dist/typescript/module/features/exampleSolution/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/index.d.ts +4 -0
- package/dist/typescript/module/features/exampleSolution/index.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts +13 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts +26 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +2 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts +4 -0
- package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/index.d.ts +19 -0
- package/dist/typescript/module/shared/icons/index.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +30 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +12 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/package.json +6 -2
- package/src/features/chatbot/components/Alternatives/Alternatives.tsx +18 -8
- package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +146 -35
- package/src/features/chatbot/components/Alternatives/InputButton.tsx +101 -0
- package/src/features/chatbot/components/Alternatives/InputWithHintRow.tsx +157 -0
- package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +6 -2
- package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +1 -1
- package/src/features/exampleSolution/ExampleSolutionModal.tsx +29 -0
- package/src/features/exampleSolution/assets/grid.png +0 -0
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +71 -0
- package/src/features/exampleSolution/components/LavaIcon.tsx +35 -0
- package/src/features/exampleSolution/components/MessageBlock.tsx +67 -0
- package/src/features/exampleSolution/components/QuestionSection.tsx +56 -0
- package/src/features/exampleSolution/components/SolutionSection.tsx +69 -0
- package/src/features/exampleSolution/constants.ts +5 -0
- package/src/features/exampleSolution/hooks/useExampleSolution.ts +66 -0
- package/src/features/exampleSolution/index.ts +3 -0
- package/src/features/exampleSolution/model/ExampleSolution.model.ts +12 -0
- package/src/features/exampleSolution/model/ExampleSolutionApi.ts +33 -0
- package/src/features/exampleSolution/model/ExampleSolutionCache.ts +20 -0
- package/src/features/exampleSolution/types.ts +26 -0
- package/src/index.ts +2 -0
- package/src/shared/icons/ExcitedLavaIcon.tsx +541 -0
- package/src/shared/icons/LavaIconInGlasses.tsx +489 -0
- package/src/shared/icons/index.ts +18 -0
- package/src/shared/translation/localization/ca.json +7 -1
- package/src/shared/translation/localization/en.json +8 -2
- package/src/shared/translation/localization/gb.json +7 -1
- package/src/shared/translation/localization/sct.json +7 -1
- package/src/shared/translation/localization/sw.json +7 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { BaseModal, SPACING } from '@magmamath/react-native-ui';
|
|
5
|
+
import { ExampleSolutionModalContent } from "./components/ExampleSolutionModalContent.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const ExampleSolutionModal = ({
|
|
8
|
+
modal: {
|
|
9
|
+
closeModal,
|
|
10
|
+
params
|
|
11
|
+
}
|
|
12
|
+
}) => /*#__PURE__*/_jsx(BaseModal, {
|
|
13
|
+
style: {
|
|
14
|
+
container: {
|
|
15
|
+
paddingHorizontal: SPACING[800]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
onClose: closeModal,
|
|
19
|
+
content: /*#__PURE__*/_jsx(ExampleSolutionModalContent, {
|
|
20
|
+
model: params.model,
|
|
21
|
+
payload: params.payload,
|
|
22
|
+
cacheKey: params.cacheKey
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=ExampleSolutionModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","BaseModal","SPACING","ExampleSolutionModalContent","jsx","_jsx","ExampleSolutionModal","modal","closeModal","params","style","container","paddingHorizontal","onClose","content","model","payload","cacheKey"],"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;IAC1BY,KAAK,EAAEN,MAAM,CAACM,KAAM;IACpBC,OAAO,EAAEP,MAAM,CAACO,OAAQ;IACxBC,QAAQ,EAAER,MAAM,CAACQ;EAAS,CAC3B;AACF,CACF,CACF","ignoreList":[]}
|
|
Binary file
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { COLORS, HeadingVariants, SPACING, Typography } from '@magmamath/react-native-ui';
|
|
6
|
+
import { useUnit } from 'effector-react';
|
|
7
|
+
import { $localization } from "../../../shared/translation/index.js";
|
|
8
|
+
import { MessageBlock } from "./MessageBlock.js";
|
|
9
|
+
import { LavaIcon } from "./LavaIcon.js";
|
|
10
|
+
import { QuestionSection } from "./QuestionSection.js";
|
|
11
|
+
import { SolutionSection } from "./SolutionSection.js";
|
|
12
|
+
import { useExampleSolution } from "../hooks/useExampleSolution.js";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
export const ExampleSolutionModalContent = ({
|
|
15
|
+
model,
|
|
16
|
+
payload,
|
|
17
|
+
cacheKey
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
result,
|
|
21
|
+
status
|
|
22
|
+
} = useExampleSolution({
|
|
23
|
+
model,
|
|
24
|
+
payload,
|
|
25
|
+
cacheKey
|
|
26
|
+
});
|
|
27
|
+
const localization = useUnit($localization);
|
|
28
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
29
|
+
style: styles.container,
|
|
30
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
31
|
+
align: "center",
|
|
32
|
+
variant: HeadingVariants.H2,
|
|
33
|
+
style: {
|
|
34
|
+
color: COLORS.NEUTRAL_9
|
|
35
|
+
},
|
|
36
|
+
children: localization.exampleSolution.exampleSolution
|
|
37
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
38
|
+
style: styles.content,
|
|
39
|
+
children: [/*#__PURE__*/_jsx(QuestionSection, {
|
|
40
|
+
status: status,
|
|
41
|
+
question: result?.question
|
|
42
|
+
}), /*#__PURE__*/_jsx(SolutionSection, {
|
|
43
|
+
status: status,
|
|
44
|
+
answer: result?.answer
|
|
45
|
+
})]
|
|
46
|
+
}), /*#__PURE__*/_jsx(MessageBlock, {
|
|
47
|
+
status: status,
|
|
48
|
+
style: styles.messageBlock
|
|
49
|
+
}), /*#__PURE__*/_jsx(LavaIcon, {
|
|
50
|
+
status: status,
|
|
51
|
+
style: styles.lavaIconContainer
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const styles = StyleSheet.create({
|
|
56
|
+
container: {
|
|
57
|
+
width: 880,
|
|
58
|
+
height: 593
|
|
59
|
+
},
|
|
60
|
+
content: {
|
|
61
|
+
flex: 1,
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
marginTop: SPACING[400],
|
|
64
|
+
gap: SPACING[400]
|
|
65
|
+
},
|
|
66
|
+
solutionContainer: {
|
|
67
|
+
width: 351,
|
|
68
|
+
overflow: 'hidden',
|
|
69
|
+
borderRadius: 8,
|
|
70
|
+
borderWidth: 1,
|
|
71
|
+
borderColor: COLORS.NEUTRAL_5
|
|
72
|
+
},
|
|
73
|
+
lavaIconContainer: {
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
bottom: -54,
|
|
76
|
+
right: -50
|
|
77
|
+
},
|
|
78
|
+
loaderContainer: {
|
|
79
|
+
paddingTop: 34,
|
|
80
|
+
position: 'absolute',
|
|
81
|
+
width: '100%',
|
|
82
|
+
height: '100%',
|
|
83
|
+
backgroundColor: COLORS.NEUTRAL_1
|
|
84
|
+
},
|
|
85
|
+
messageBlock: {
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
right: 38,
|
|
88
|
+
bottom: -22
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=ExampleSolutionModalContent.js.map
|
|
@@ -0,0 +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","cacheKey","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","NEUTRAL_1"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/ExampleSolutionModalContent.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,eAAe,EAAEC,OAAO,EAAEC,UAAU,QAAQ,4BAA4B;AACzF,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,aAAa,QAAQ,sCAA6B;AAC3D,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,QAAQ,QAAQ,eAAY;AAErC,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,kBAAkB,QAAQ,gCAA6B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,OAAO,MAAMC,2BAA2B,GAAGA,CAAC;EAC1CC,KAAK;EACLC,OAAO;EACPC;AAC0B,CAAC,KAAK;EAChC,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGV,kBAAkB,CAAC;IAAEM,KAAK;IAAEC,OAAO;IAAEC;EAAS,CAAC,CAAC;EAC3E,MAAMG,YAAY,GAAGjB,OAAO,CAACC,aAAa,CAAC;EAE3C,oBACES,KAAA,CAAChB,IAAI;IAACwB,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,gBAC5Bb,IAAA,CAACT,UAAU;MAACuB,KAAK,EAAC,QAAQ;MAACC,OAAO,EAAE1B,eAAe,CAAC2B,EAAG;MAACN,KAAK,EAAE;QAAEO,KAAK,EAAE7B,MAAM,CAAC8B;MAAU,CAAE;MAAAL,QAAA,EACxFJ,YAAY,CAACU,eAAe,CAACA;IAAe,CACnC,CAAC,eACbjB,KAAA,CAAChB,IAAI;MAACwB,KAAK,EAAEC,MAAM,CAACS,OAAQ;MAAAP,QAAA,gBAC1Bb,IAAA,CAACJ,eAAe;QAACY,MAAM,EAAEA,MAAO;QAACa,QAAQ,EAAEd,MAAM,EAAEc;MAAS,CAAE,CAAC,eAC/DrB,IAAA,CAACH,eAAe;QAACW,MAAM,EAAEA,MAAO;QAACc,MAAM,EAAEf,MAAM,EAAEe;MAAO,CAAE,CAAC;IAAA,CACvD,CAAC,eACPtB,IAAA,CAACN,YAAY;MAACc,MAAM,EAAEA,MAAO;MAACE,KAAK,EAAEC,MAAM,CAACY;IAAa,CAAE,CAAC,eAC5DvB,IAAA,CAACL,QAAQ;MAACa,MAAM,EAAEA,MAAO;MAACE,KAAK,EAAEC,MAAM,CAACa;IAAkB,CAAE,CAAC;EAAA,CACzD,CAAC;AAEX,CAAC;AAED,MAAMb,MAAM,GAAG1B,UAAU,CAACwC,MAAM,CAAC;EAC/Bb,SAAS,EAAE;IACTc,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDP,OAAO,EAAE;IACPQ,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,KAAK;IACpBC,SAAS,EAAExC,OAAO,CAAC,GAAG,CAAC;IACvByC,GAAG,EAAEzC,OAAO,CAAC,GAAG;EAClB,CAAC;EACD0C,iBAAiB,EAAE;IACjBN,KAAK,EAAE,GAAG;IACVO,QAAQ,EAAE,QAAQ;IAClBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEhD,MAAM,CAACiD;EACtB,CAAC;EACDb,iBAAiB,EAAE;IACjBc,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;IACpBZ,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdgB,eAAe,EAAEvD,MAAM,CAACwD;EAC1B,CAAC;EACDrB,YAAY,EAAE;IACZe,QAAQ,EAAE,UAAU;IACpBE,KAAK,EAAE,EAAE;IACTD,MAAM,EAAE,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ExcitedLavaIcon } from "../../../shared/icons/ExcitedLavaIcon.js";
|
|
5
|
+
import { LavaIconInGlasses } from "../../../shared/icons/index.js";
|
|
6
|
+
import Animated, { FadeIn, useAnimatedStyle, withTiming } from 'react-native-reanimated';
|
|
7
|
+
import { ExampleSolutionStatuses } from "../constants.js";
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const LAVA_ICON_HEIGHT = 112;
|
|
10
|
+
export const LavaIcon = ({
|
|
11
|
+
status,
|
|
12
|
+
style
|
|
13
|
+
}) => {
|
|
14
|
+
const opacityAnimation = useAnimatedStyle(() => {
|
|
15
|
+
return {
|
|
16
|
+
opacity: withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, {
|
|
17
|
+
duration: 500
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
}, [status]);
|
|
21
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
22
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
23
|
+
style: [style, opacityAnimation],
|
|
24
|
+
children: /*#__PURE__*/_jsx(LavaIconInGlasses, {
|
|
25
|
+
height: 112
|
|
26
|
+
})
|
|
27
|
+
}), status !== ExampleSolutionStatuses.LOADING && /*#__PURE__*/_jsx(Animated.View, {
|
|
28
|
+
style: style,
|
|
29
|
+
entering: FadeIn,
|
|
30
|
+
children: /*#__PURE__*/_jsx(ExcitedLavaIcon, {
|
|
31
|
+
height: LAVA_ICON_HEIGHT
|
|
32
|
+
})
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=LavaIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { COLORS, SPACING, Typography } from '@magmamath/react-native-ui';
|
|
6
|
+
import { useUnit } from 'effector-react';
|
|
7
|
+
import { $localization } from "../../../shared/translation/index.js";
|
|
8
|
+
import Animated, { LinearTransition, useAnimatedStyle, withDelay, withTiming } from 'react-native-reanimated';
|
|
9
|
+
import { ExampleSolutionStatuses } from "../constants.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export const MessageBlock = ({
|
|
12
|
+
status,
|
|
13
|
+
style
|
|
14
|
+
}) => {
|
|
15
|
+
const localization = useUnit($localization);
|
|
16
|
+
const opacityAnimation = useAnimatedStyle(() => {
|
|
17
|
+
return {
|
|
18
|
+
opacity: withDelay(2000, withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, {
|
|
19
|
+
duration: 350
|
|
20
|
+
}))
|
|
21
|
+
};
|
|
22
|
+
}, [status]);
|
|
23
|
+
if (status === ExampleSolutionStatuses.CACHE) return null;
|
|
24
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
25
|
+
layout: LinearTransition.duration(250),
|
|
26
|
+
style: [styles.container, opacityAnimation, style],
|
|
27
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
28
|
+
variant: 'small',
|
|
29
|
+
numberOfLines: 1,
|
|
30
|
+
children: status === ExampleSolutionStatuses.LOADING ? localization.exampleSolution.letMeThink : localization.exampleSolution.aha
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
container: {
|
|
36
|
+
padding: SPACING[200],
|
|
37
|
+
backgroundColor: COLORS.NEUTRAL_3,
|
|
38
|
+
height: 44,
|
|
39
|
+
borderRadius: 12,
|
|
40
|
+
borderBottomRightRadius: 2,
|
|
41
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
42
|
+
borderColor: COLORS.NEUTRAL_5,
|
|
43
|
+
shadowColor: COLORS.NEUTRAL_10,
|
|
44
|
+
shadowOffset: {
|
|
45
|
+
width: 0,
|
|
46
|
+
height: 1
|
|
47
|
+
},
|
|
48
|
+
shadowOpacity: 0.2,
|
|
49
|
+
shadowRadius: 1,
|
|
50
|
+
elevation: 3
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=MessageBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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.tsx"],"mappings":";;AAAA,SAAoBA,UAAU,QAAmB,cAAc;AAC/D,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,OAAO,EAAEC,UAAU,QAAQ,4BAA4B;AACxE,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,aAAa,QAAQ,sCAA6B;AAC3D,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,QACL,yBAAyB;AAChC,SAASC,uBAAuB,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOtD,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAyB,CAAC,KAAK;EACpE,MAAMC,YAAY,GAAGb,OAAO,CAACC,aAAa,CAAC;EAE3C,MAAMa,gBAAgB,GAAGV,gBAAgB,CAAC,MAAM;IAC9C,OAAO;MACLW,OAAO,EAAEV,SAAS,CAChB,IAAI,EACJC,UAAU,CAACK,MAAM,KAAKJ,uBAAuB,CAACS,OAAO,GAAG,CAAC,GAAG,CAAC,EAAE;QAAEC,QAAQ,EAAE;MAAI,CAAC,CAClF;IACF,CAAC;EACH,CAAC,EAAE,CAACN,MAAM,CAAC,CAAC;EAEZ,IAAIA,MAAM,KAAKJ,uBAAuB,CAACW,KAAK,EAAE,OAAO,IAAI;EAEzD,oBACET,IAAA,CAACP,QAAQ,CAACiB,IAAI;IACZC,MAAM,EAAEjB,gBAAgB,CAACc,QAAQ,CAAC,GAAG,CAAE;IACvCL,KAAK,EAAE,CAACS,MAAM,CAACC,SAAS,EAAER,gBAAgB,EAAEF,KAAK,CAAE;IAAAW,QAAA,eAEnDd,IAAA,CAACV,UAAU;MAACyB,OAAO,EAAE,OAAQ;MAACC,aAAa,EAAE,CAAE;MAAAF,QAAA,EAC5CZ,MAAM,KAAKJ,uBAAuB,CAACS,OAAO,GACvCH,YAAY,CAACa,eAAe,CAACC,UAAU,GACvCd,YAAY,CAACa,eAAe,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":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, View, ScrollView } from 'react-native';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { COLORS, Loader, LoaderColor, SPACING, Typography } from '@magmamath/react-native-ui';
|
|
6
|
+
import Animated, { FadeOut } from 'react-native-reanimated';
|
|
7
|
+
import { ExampleSolutionStatuses } from "../constants.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export const QuestionSection = ({
|
|
10
|
+
question,
|
|
11
|
+
status
|
|
12
|
+
}) => {
|
|
13
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
14
|
+
style: styles.container,
|
|
15
|
+
children: [/*#__PURE__*/_jsx(ScrollView, {
|
|
16
|
+
style: styles.scrollView,
|
|
17
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
18
|
+
children: question
|
|
19
|
+
})
|
|
20
|
+
}), status === ExampleSolutionStatuses.LOADING && /*#__PURE__*/_jsx(Animated.View, {
|
|
21
|
+
exiting: FadeOut,
|
|
22
|
+
style: styles.loaderContainer,
|
|
23
|
+
children: /*#__PURE__*/_jsx(Loader, {
|
|
24
|
+
size: "large",
|
|
25
|
+
color: LoaderColor.BLUE
|
|
26
|
+
})
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
container: {
|
|
32
|
+
flex: 1
|
|
33
|
+
},
|
|
34
|
+
scrollView: {
|
|
35
|
+
flex: 1
|
|
36
|
+
},
|
|
37
|
+
loaderContainer: {
|
|
38
|
+
paddingTop: 34,
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
width: '100%',
|
|
41
|
+
height: '100%',
|
|
42
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
43
|
+
justifyContent: 'flex-start',
|
|
44
|
+
alignItems: 'center'
|
|
45
|
+
},
|
|
46
|
+
errorContainer: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
width: '100%',
|
|
49
|
+
height: '100%',
|
|
50
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
51
|
+
justifyContent: 'center',
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
padding: SPACING[400]
|
|
54
|
+
},
|
|
55
|
+
errorText: {
|
|
56
|
+
color: COLORS.PRIMARY_RED,
|
|
57
|
+
textAlign: 'center'
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=QuestionSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","View","ScrollView","React","COLORS","Loader","LoaderColor","SPACING","Typography","Animated","FadeOut","ExampleSolutionStatuses","jsx","_jsx","jsxs","_jsxs","QuestionSection","question","status","style","styles","container","children","scrollView","LOADING","exiting","loaderContainer","size","color","BLUE","create","flex","paddingTop","position","width","height","backgroundColor","NEUTRAL_1","justifyContent","alignItems","errorContainer","padding","errorText","PRIMARY_RED","textAlign"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/QuestionSection.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC3D,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAEC,OAAO,EAAEC,UAAU,QAAQ,4BAA4B;AAC7F,OAAOC,QAAQ,IAAIC,OAAO,QAAQ,yBAAyB;AAC3D,SAASC,uBAAuB,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOtD,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAA6B,CAAC,KAAK;EAC7E,oBACEH,KAAA,CAACd,IAAI;IAACkB,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,gBAC5BT,IAAA,CAACX,UAAU;MAACiB,KAAK,EAAEC,MAAM,CAACG,UAAW;MAAAD,QAAA,eACnCT,IAAA,CAACL,UAAU;QAAAc,QAAA,EAAEL;MAAQ,CAAa;IAAC,CACzB,CAAC,EACZC,MAAM,KAAKP,uBAAuB,CAACa,OAAO,iBACzCX,IAAA,CAACJ,QAAQ,CAACR,IAAI;MAACwB,OAAO,EAAEf,OAAQ;MAACS,KAAK,EAAEC,MAAM,CAACM,eAAgB;MAAAJ,QAAA,eAC7DT,IAAA,CAACR,MAAM;QAACsB,IAAI,EAAC,OAAO;QAACC,KAAK,EAAEtB,WAAW,CAACuB;MAAK,CAAE;IAAC,CACnC,CAChB;EAAA,CACG,CAAC;AAEX,CAAC;AAED,MAAMT,MAAM,GAAGpB,UAAU,CAAC8B,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,IAAI,EAAE;EACR,CAAC;EACDR,UAAU,EAAE;IACVQ,IAAI,EAAE;EACR,CAAC;EACDL,eAAe,EAAE;IACfM,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,eAAe,EAAEhC,MAAM,CAACiC,SAAS;IACjCC,cAAc,EAAE,YAAY;IAC5BC,UAAU,EAAE;EACd,CAAC;EACDC,cAAc,EAAE;IACdP,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,eAAe,EAAEhC,MAAM,CAACiC,SAAS;IACjCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBE,OAAO,EAAElC,OAAO,CAAC,GAAG;EACtB,CAAC;EACDmC,SAAS,EAAE;IACTd,KAAK,EAAExB,MAAM,CAACuC,WAAW;IACzBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, View, Image, Text } from 'react-native';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { COLORS, IS_WEB, SPACING } from '@magmamath/react-native-ui';
|
|
6
|
+
import Animated, { FadeIn } from 'react-native-reanimated';
|
|
7
|
+
import { ExampleSolutionStatuses } from "../constants.js";
|
|
8
|
+
import gridImage from '../assets/grid.png';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const gridImagePath = !IS_WEB ? Image.resolveAssetSource(gridImage).uri : gridImage;
|
|
11
|
+
export const SolutionSection = ({
|
|
12
|
+
answer,
|
|
13
|
+
status
|
|
14
|
+
}) => {
|
|
15
|
+
const shouldShowAnswer = answer && (status === ExampleSolutionStatuses.DONE_DATA || status === ExampleSolutionStatuses.CACHE);
|
|
16
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
17
|
+
style: styles.container,
|
|
18
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
19
|
+
source: {
|
|
20
|
+
uri: gridImagePath
|
|
21
|
+
},
|
|
22
|
+
style: [styles.gridImage, IS_WEB && styles.gridImageWeb]
|
|
23
|
+
}), shouldShowAnswer && /*#__PURE__*/_jsx(Animated.ScrollView, {
|
|
24
|
+
style: styles.solutionScroll,
|
|
25
|
+
contentContainerStyle: styles.solutionScrollContent,
|
|
26
|
+
entering: status === 'cache' ? undefined : FadeIn.delay(1000).duration(500),
|
|
27
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
28
|
+
style: styles.solutionText,
|
|
29
|
+
children: answer
|
|
30
|
+
})
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
container: {
|
|
36
|
+
width: 500,
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
borderRadius: 8,
|
|
39
|
+
borderWidth: 1,
|
|
40
|
+
borderColor: COLORS.NEUTRAL_5
|
|
41
|
+
},
|
|
42
|
+
gridImage: {
|
|
43
|
+
width: '100%',
|
|
44
|
+
height: '100%',
|
|
45
|
+
resizeMode: 'cover',
|
|
46
|
+
aspectRatio: 28 / 8
|
|
47
|
+
},
|
|
48
|
+
gridImageWeb: {
|
|
49
|
+
transform: [{
|
|
50
|
+
scale: 3.5
|
|
51
|
+
}]
|
|
52
|
+
},
|
|
53
|
+
solutionScroll: {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
width: '100%',
|
|
56
|
+
height: '100%'
|
|
57
|
+
},
|
|
58
|
+
solutionScrollContent: {
|
|
59
|
+
paddingHorizontal: SPACING[800],
|
|
60
|
+
paddingVertical: SPACING[400]
|
|
61
|
+
},
|
|
62
|
+
solutionText: {
|
|
63
|
+
fontFamily: 'PlaypenSans-Light',
|
|
64
|
+
fontSize: 22
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=SolutionSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","View","Image","Text","React","COLORS","IS_WEB","SPACING","Animated","FadeIn","ExampleSolutionStatuses","gridImage","jsx","_jsx","jsxs","_jsxs","gridImagePath","resolveAssetSource","uri","SolutionSection","answer","status","shouldShowAnswer","DONE_DATA","CACHE","style","styles","container","children","source","gridImageWeb","ScrollView","solutionScroll","contentContainerStyle","solutionScrollContent","entering","undefined","delay","duration","solutionText","create","width","overflow","borderRadius","borderWidth","borderColor","NEUTRAL_5","height","resizeMode","aspectRatio","transform","scale","position","paddingHorizontal","paddingVertical","fontFamily","fontSize"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/SolutionSection.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;AAC5D,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,MAAM,EAAEC,OAAO,QAAQ,4BAA4B;AACpE,OAAOC,QAAQ,IAAIC,MAAM,QAAQ,yBAAyB;AAC1D,SAASC,uBAAuB,QAAQ,iBAAc;AACtD,OAAOC,SAAS,MAAM,oBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAO1C,MAAMC,aAAa,GAAG,CAACV,MAAM,GAAGJ,KAAK,CAACe,kBAAkB,CAACN,SAAS,CAAC,CAACO,GAAG,GAAGP,SAAS;AAEnF,OAAO,MAAMQ,eAAe,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAA6B,CAAC,KAAK;EAC3E,MAAMC,gBAAgB,GACpBF,MAAM,KACLC,MAAM,KAAKX,uBAAuB,CAACa,SAAS,IAAIF,MAAM,KAAKX,uBAAuB,CAACc,KAAK,CAAC;EAE5F,oBACET,KAAA,CAACd,IAAI;IAACwB,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,gBAC5Bf,IAAA,CAACX,KAAK;MACJ2B,MAAM,EAAE;QAAEX,GAAG,EAAEF;MAAc,CAAE;MAC/BS,KAAK,EAAE,CAACC,MAAM,CAACf,SAAS,EAAEL,MAAM,IAAIoB,MAAM,CAACI,YAAY;IAAE,CAC1D,CAAC,EACDR,gBAAgB,iBACfT,IAAA,CAACL,QAAQ,CAACuB,UAAU;MAClBN,KAAK,EAAEC,MAAM,CAACM,cAAe;MAC7BC,qBAAqB,EAAEP,MAAM,CAACQ,qBAAsB;MACpDC,QAAQ,EAAEd,MAAM,KAAK,OAAO,GAAGe,SAAS,GAAG3B,MAAM,CAAC4B,KAAK,CAAC,IAAI,CAAC,CAACC,QAAQ,CAAC,GAAG,CAAE;MAAAV,QAAA,eAE5Ef,IAAA,CAACV,IAAI;QAACsB,KAAK,EAAEC,MAAM,CAACa,YAAa;QAAAX,QAAA,EAAER;MAAM,CAAO;IAAC,CAC9B,CACtB;EAAA,CACG,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAG1B,UAAU,CAACwC,MAAM,CAAC;EAC/Bb,SAAS,EAAE;IACTc,KAAK,EAAE,GAAG;IACVC,QAAQ,EAAE,QAAQ;IAClBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAExC,MAAM,CAACyC;EACtB,CAAC;EACDnC,SAAS,EAAE;IACT8B,KAAK,EAAE,MAAM;IACbM,MAAM,EAAE,MAAM;IACdC,UAAU,EAAE,OAAO;IACnBC,WAAW,EAAE,EAAE,GAAG;EACpB,CAAC;EACDnB,YAAY,EAAE;IACZoB,SAAS,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAI,CAAC;EAC5B,CAAC;EACDnB,cAAc,EAAE;IACdoB,QAAQ,EAAE,UAAU;IACpBX,KAAK,EAAE,MAAM;IACbM,MAAM,EAAE;EACV,CAAC;EACDb,qBAAqB,EAAE;IACrBmB,iBAAiB,EAAE9C,OAAO,CAAC,GAAG,CAAC;IAC/B+C,eAAe,EAAE/C,OAAO,CAAC,GAAG;EAC9B,CAAC;EACDgC,YAAY,EAAE;IACZgB,UAAU,EAAE,mBAAmB;IAC/BC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export let ExampleSolutionStatuses = /*#__PURE__*/function (ExampleSolutionStatuses) {
|
|
4
|
+
ExampleSolutionStatuses["LOADING"] = "loading";
|
|
5
|
+
ExampleSolutionStatuses["DONE_DATA"] = "doneData";
|
|
6
|
+
ExampleSolutionStatuses["CACHE"] = "cache";
|
|
7
|
+
return ExampleSolutionStatuses;
|
|
8
|
+
}({});
|
|
9
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ExampleSolutionStatuses"],"sourceRoot":"../../../../src","sources":["features/exampleSolution/constants.ts"],"mappings":";;AAAA,WAAkBA,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { useUnit } from 'effector-react';
|
|
5
|
+
import { ExampleSolutionStatuses } from "../constants.js";
|
|
6
|
+
const ANIMATION_DELAY = 600;
|
|
7
|
+
export const useExampleSolution = ({
|
|
8
|
+
model,
|
|
9
|
+
payload,
|
|
10
|
+
cacheKey
|
|
11
|
+
}) => {
|
|
12
|
+
const exampleSolutionsCache = useUnit(model.cache.$state);
|
|
13
|
+
const [result, setResult] = useState(null);
|
|
14
|
+
const [status, setStatus] = useState(ExampleSolutionStatuses.LOADING);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
let timer = null;
|
|
17
|
+
const fetchExampleSolution = async () => {
|
|
18
|
+
try {
|
|
19
|
+
if (exampleSolutionsCache[cacheKey]) {
|
|
20
|
+
setResult(exampleSolutionsCache[cacheKey]);
|
|
21
|
+
setStatus(ExampleSolutionStatuses.CACHE);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const startTime = Date.now();
|
|
25
|
+
const response = await model.api.generateExampleSolutionFx(payload);
|
|
26
|
+
setResult(response);
|
|
27
|
+
model.cache.addExampleSolution({
|
|
28
|
+
cacheKey,
|
|
29
|
+
response
|
|
30
|
+
});
|
|
31
|
+
const elapsedTime = Date.now() - startTime;
|
|
32
|
+
if (elapsedTime >= ANIMATION_DELAY) {
|
|
33
|
+
setStatus(ExampleSolutionStatuses.DONE_DATA);
|
|
34
|
+
} else {
|
|
35
|
+
timer = setTimeout(() => {
|
|
36
|
+
setStatus(ExampleSolutionStatuses.DONE_DATA);
|
|
37
|
+
}, ANIMATION_DELAY - elapsedTime);
|
|
38
|
+
}
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error('Failed to fetch example solution:', error);
|
|
41
|
+
setStatus(ExampleSolutionStatuses.DONE_DATA);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
fetchExampleSolution();
|
|
45
|
+
return () => {
|
|
46
|
+
if (timer) {
|
|
47
|
+
clearTimeout(timer);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
return {
|
|
52
|
+
result,
|
|
53
|
+
status
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=useExampleSolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useState","useUnit","ExampleSolutionStatuses","ANIMATION_DELAY","useExampleSolution","model","payload","cacheKey","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,SAASC,OAAO,QAAQ,gBAAgB;AAExC,SAASC,uBAAuB,QAAQ,iBAAc;AAEtD,MAAMC,eAAe,GAAG,GAAG;AAO3B,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EACjCC,KAAK;EACLC,OAAO;EACPC;AAC0B,CAAC,KAA+B;EAC1D,MAAMC,qBAAqB,GAAGP,OAAO,CAACI,KAAK,CAACI,KAAK,CAACC,MAAM,CAAC;EACzD,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGZ,QAAQ,CAAiC,IAAI,CAAC;EAC1E,MAAM,CAACa,MAAM,EAAEC,SAAS,CAAC,GAAGd,QAAQ,CAA0BE,uBAAuB,CAACa,OAAO,CAAC;EAE9FhB,SAAS,CAAC,MAAM;IACd,IAAIiB,KAA4B,GAAG,IAAI;IAEvC,MAAMC,oBAAoB,GAAG,MAAAA,CAAA,KAAY;MACvC,IAAI;QACF,IAAIT,qBAAqB,CAACD,QAAQ,CAAC,EAAE;UACnCK,SAAS,CAACJ,qBAAqB,CAACD,QAAQ,CAAC,CAAC;UAC1CO,SAAS,CAACZ,uBAAuB,CAACgB,KAAK,CAAC;UACxC;QACF;QAEA,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;QAC5B,MAAMC,QAAQ,GAAG,MAAMjB,KAAK,CAACkB,GAAG,CAACC,yBAAyB,CAAClB,OAAO,CAAC;QAEnEM,SAAS,CAACU,QAAQ,CAAC;QACnBjB,KAAK,CAACI,KAAK,CAACgB,kBAAkB,CAAC;UAAElB,QAAQ;UAAEe;QAAS,CAAC,CAAC;QAEtD,MAAMI,WAAW,GAAGN,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,SAAS;QAC1C,IAAIO,WAAW,IAAIvB,eAAe,EAAE;UAClCW,SAAS,CAACZ,uBAAuB,CAACyB,SAAS,CAAC;QAC9C,CAAC,MAAM;UACLX,KAAK,GAAGY,UAAU,CAAC,MAAM;YACvBd,SAAS,CAACZ,uBAAuB,CAACyB,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,EAAE,CAAC;EAEN,OAAO;IACLL,MAAM;IACNE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["features/exampleSolution/index.ts"],"mappings":";;AAAA,cAAc,2BAAwB;AACtC,cAAc,kCAA+B;AAC7C,cAAc,YAAS","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { ExampleSolutionsApi } from "./ExampleSolutionApi.js";
|
|
4
|
+
import { ExampleSolutionCache } from "./ExampleSolutionCache.js";
|
|
5
|
+
export class ExampleSolutionModel {
|
|
6
|
+
cache = new ExampleSolutionCache();
|
|
7
|
+
constructor({
|
|
8
|
+
api,
|
|
9
|
+
errorHandler
|
|
10
|
+
}) {
|
|
11
|
+
this.api = new ExampleSolutionsApi({
|
|
12
|
+
api,
|
|
13
|
+
errorHandler
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ExampleSolution.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ExampleSolutionsApi","ExampleSolutionCache","ExampleSolutionModel","cache","constructor","api","errorHandler"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolution.model.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,oBAAoB,QAAQ,2BAAwB;AAE7D,OAAO,MAAMC,oBAAoB,CAAC;EAEhBC,KAAK,GAAG,IAAIF,oBAAoB,CAAC,CAAC;EAElDG,WAAWA,CAAC;IAAEC,GAAG;IAAEC;EAAwC,CAAC,EAAE;IAC5D,IAAI,CAACD,GAAG,GAAG,IAAIL,mBAAmB,CAAC;MAAEK,GAAG;MAAEC;IAAa,CAAC,CAAC;EAC3D;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createControllerEffect } from "./../../../lib/effector/createControllerEffect.js";
|
|
4
|
+
import { $localization } from "../../../shared/translation/index.js";
|
|
5
|
+
import { createEffect, sample, attach } from 'effector';
|
|
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
|
+
});
|
|
15
|
+
constructor({
|
|
16
|
+
api,
|
|
17
|
+
errorHandler
|
|
18
|
+
}) {
|
|
19
|
+
this.generateExampleSolutionFx = createControllerEffect(api.generateExampleSolution);
|
|
20
|
+
this.errorHandlerFx = errorHandler;
|
|
21
|
+
sample({
|
|
22
|
+
clock: this.generateExampleSolutionFx.fail,
|
|
23
|
+
target: this.errorHandlingFx
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ExampleSolutionApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createEvent, createStore } from 'effector';
|
|
4
|
+
export class ExampleSolutionCache {
|
|
5
|
+
addExampleSolution = createEvent();
|
|
6
|
+
$state = createStore({}).on(this.addExampleSolution, (state, exampleSolution) => {
|
|
7
|
+
return {
|
|
8
|
+
...state,
|
|
9
|
+
[exampleSolution.cacheKey]: exampleSolution.response
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ExampleSolutionCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEvent","createStore","ExampleSolutionCache","addExampleSolution","$state","on","state","exampleSolution","cacheKey","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,QAAQ,GAAGD,eAAe,CAACE;IAC9C,CAAC;EACH,CACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["features/exampleSolution/types.ts"],"mappings":"","ignoreList":[]}
|
package/dist/module/index.js
CHANGED
|
@@ -9,4 +9,6 @@ export * from "./features/endOfAssignment/index.js";
|
|
|
9
9
|
export * from "./features/formulaSheet/index.js";
|
|
10
10
|
export * from "./features/problemSelector/index.js";
|
|
11
11
|
export * from "./features/gifCelebrations/index.js";
|
|
12
|
+
export * from "./features/exampleSolution/index.js";
|
|
13
|
+
export * from "./shared/icons/index.js";
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
package/dist/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFeaturesLocalization","setFeaturesLocalization","Locale","generateRandomId"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,uBAAuB,EAAEC,uBAAuB,EAAEC,MAAM,QAAQ,+BAAsB;AAC/F,SAASC,gBAAgB,QAAQ,0BAAuB;AACxD,cAAc,6BAAoB;AAClC,cAAc,8BAAqB;AACnC,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useFeaturesLocalization","setFeaturesLocalization","Locale","generateRandomId"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,uBAAuB,EAAEC,uBAAuB,EAAEC,MAAM,QAAQ,+BAAsB;AAC/F,SAASC,gBAAgB,QAAQ,0BAAuB;AACxD,cAAc,6BAAoB;AAClC,cAAc,8BAAqB;AACnC,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,yBAAgB","ignoreList":[]}
|