@magmamath/students-features 1.8.1 → 1.8.2-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +29 -0
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/assets/grid.webp +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/QuestionSection.js +70 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +104 -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 +24 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +28 -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/features/uiMode/index.js +7 -0
- package/dist/commonjs/features/uiMode/index.js.map +1 -1
- package/dist/commonjs/features/uiMode/uiMode.helpers.js +7 -2
- package/dist/commonjs/features/uiMode/uiMode.helpers.js.map +1 -1
- package/dist/commonjs/i18n/i18n.js +3 -1
- package/dist/commonjs/i18n/i18n.js.map +1 -1
- package/dist/commonjs/index.js +22 -10
- package/dist/commonjs/index.js.map +1 -1
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js +23 -0
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/module/features/exampleSolution/assets/grid.webp +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/QuestionSection.js +62 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js +96 -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 +19 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +23 -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/features/uiMode/index.js +1 -0
- package/dist/module/features/uiMode/index.js.map +1 -1
- package/dist/module/features/uiMode/uiMode.helpers.js +6 -1
- package/dist/module/features/uiMode/uiMode.helpers.js.map +1 -1
- package/dist/module/i18n/i18n.js +3 -1
- package/dist/module/i18n/i18n.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.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 +8 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +10 -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 +10 -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 +27 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/fluency/hooks/useFluencyNumpad.d.ts +1 -2
- package/dist/typescript/commonjs/features/fluency/hooks/useFluencyNumpad.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/uiMode/index.d.ts +1 -0
- package/dist/typescript/commonjs/features/uiMode/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/uiMode/uiMode.helpers.d.ts +2 -0
- package/dist/typescript/commonjs/features/uiMode/uiMode.helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +1 -1
- package/dist/typescript/commonjs/i18n/i18n.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts +1 -1
- package/dist/typescript/commonjs/lib/helpers/helpers.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 +8 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +10 -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 +10 -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 +27 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/module/features/fluency/hooks/useFluencyNumpad.d.ts +1 -2
- package/dist/typescript/module/features/fluency/hooks/useFluencyNumpad.d.ts.map +1 -1
- package/dist/typescript/module/features/uiMode/index.d.ts +1 -0
- package/dist/typescript/module/features/uiMode/index.d.ts.map +1 -1
- package/dist/typescript/module/features/uiMode/uiMode.helpers.d.ts +2 -0
- package/dist/typescript/module/features/uiMode/uiMode.helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +1 -1
- package/dist/typescript/module/i18n/i18n.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/lib/helpers/helpers.d.ts +1 -1
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/exampleSolution/ExampleSolutionModal.tsx +23 -0
- package/src/features/exampleSolution/assets/grid.webp +0 -0
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +80 -0
- package/src/features/exampleSolution/components/QuestionSection.tsx +61 -0
- package/src/features/exampleSolution/components/SolutionSection.tsx +117 -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 +15 -0
- package/src/features/exampleSolution/model/ExampleSolutionApi.ts +29 -0
- package/src/features/exampleSolution/model/ExampleSolutionCache.ts +20 -0
- package/src/features/exampleSolution/types.ts +27 -0
- package/src/features/uiMode/__tests__/getUIMode.test.ts +64 -0
- package/src/features/uiMode/index.ts +1 -0
- package/src/features/uiMode/uiMode.helpers.ts +16 -1
- package/src/i18n/i18n.ts +2 -1
- package/src/index.ts +1 -0
- package/src/i18n/.generated/schema.json +0 -154
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExampleSolutionModal = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
9
|
+
var _ExampleSolutionModalContent = require("./components/ExampleSolutionModalContent.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const ExampleSolutionModal = ({
|
|
13
|
+
modal: {
|
|
14
|
+
closeModal,
|
|
15
|
+
params
|
|
16
|
+
}
|
|
17
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.BaseModal, {
|
|
18
|
+
style: {
|
|
19
|
+
container: {
|
|
20
|
+
paddingHorizontal: _reactNativeUi.SPACING[800]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
onClose: closeModal,
|
|
24
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExampleSolutionModalContent.ExampleSolutionModalContent, {
|
|
25
|
+
params: params
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
exports.ExampleSolutionModal = ExampleSolutionModal;
|
|
29
|
+
//# sourceMappingURL=ExampleSolutionModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNativeUi","_ExampleSolutionModalContent","_jsxRuntime","e","__esModule","default","ExampleSolutionModal","modal","closeModal","params","jsx","BaseModal","style","container","paddingHorizontal","SPACING","onClose","content","ExampleSolutionModalContent","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,eAAE,IAAAf,WAAA,CAAAQ,GAAA,EAACT,4BAAA,CAAAiB,2BAA2B;IAACT,MAAM,EAAEA;EAAO,CAAE;AAAE,CAC1D,CACF;AAAAU,OAAA,CAAAb,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
Binary file
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExampleSolutionModalContent = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _QuestionSection = require("./QuestionSection.js");
|
|
11
|
+
var _SolutionSection = require("./SolutionSection.js");
|
|
12
|
+
var _useExampleSolution = require("../hooks/useExampleSolution.js");
|
|
13
|
+
var _studentsQa = require("@magmamath/students-qa");
|
|
14
|
+
var _i18n = require("../../../i18n/i18n.js");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const CONTAINER_HEIGHT = 593;
|
|
18
|
+
const ExampleSolutionModalContent = ({
|
|
19
|
+
params: {
|
|
20
|
+
model,
|
|
21
|
+
payload,
|
|
22
|
+
cacheKey
|
|
23
|
+
}
|
|
24
|
+
}) => {
|
|
25
|
+
const {
|
|
26
|
+
result,
|
|
27
|
+
status
|
|
28
|
+
} = (0, _useExampleSolution.useExampleSolution)({
|
|
29
|
+
model,
|
|
30
|
+
payload,
|
|
31
|
+
cacheKey
|
|
32
|
+
});
|
|
33
|
+
const t = (0, _i18n.useText)();
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
35
|
+
testID: _studentsQa.TEST_IDS.EXAMPLE_SOLUTION_MODAL,
|
|
36
|
+
style: [styles.container, _reactNativeUi.IS_WEB ? {
|
|
37
|
+
maxHeight: CONTAINER_HEIGHT
|
|
38
|
+
} : {
|
|
39
|
+
height: CONTAINER_HEIGHT
|
|
40
|
+
}],
|
|
41
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
42
|
+
align: "center",
|
|
43
|
+
variant: _reactNativeUi.HeadingVariants.H2,
|
|
44
|
+
style: {
|
|
45
|
+
color: _reactNativeUi.COLORS.NEUTRAL_9
|
|
46
|
+
},
|
|
47
|
+
children: t('exampleSolution.exampleSolution')
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
49
|
+
style: styles.content,
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_QuestionSection.QuestionSection, {
|
|
51
|
+
status: status,
|
|
52
|
+
question: result?.question,
|
|
53
|
+
renderKatexComponent: model.renderKatexComponent
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SolutionSection.SolutionSection, {
|
|
55
|
+
status: status,
|
|
56
|
+
answer: result?.answer
|
|
57
|
+
})]
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
exports.ExampleSolutionModalContent = ExampleSolutionModalContent;
|
|
62
|
+
const styles = _reactNative.StyleSheet.create({
|
|
63
|
+
container: {
|
|
64
|
+
width: 880
|
|
65
|
+
},
|
|
66
|
+
content: {
|
|
67
|
+
flex: 1,
|
|
68
|
+
flexDirection: 'row',
|
|
69
|
+
marginTop: _reactNativeUi.SPACING[400],
|
|
70
|
+
gap: _reactNativeUi.SPACING[400]
|
|
71
|
+
},
|
|
72
|
+
solutionContainer: {
|
|
73
|
+
width: 351,
|
|
74
|
+
overflow: 'hidden',
|
|
75
|
+
borderRadius: 8,
|
|
76
|
+
borderWidth: 1,
|
|
77
|
+
borderColor: _reactNativeUi.COLORS.NEUTRAL_5
|
|
78
|
+
},
|
|
79
|
+
lavaIconContainer: {
|
|
80
|
+
position: 'absolute',
|
|
81
|
+
bottom: -24,
|
|
82
|
+
right: -26
|
|
83
|
+
},
|
|
84
|
+
loaderContainer: {
|
|
85
|
+
paddingTop: 34,
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
width: '100%',
|
|
88
|
+
height: '100%',
|
|
89
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1
|
|
90
|
+
},
|
|
91
|
+
messageBlock: {
|
|
92
|
+
position: 'absolute',
|
|
93
|
+
right: 58,
|
|
94
|
+
bottom: -12
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=ExampleSolutionModalContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_QuestionSection","_SolutionSection","_useExampleSolution","_studentsQa","_i18n","_jsxRuntime","e","__esModule","default","CONTAINER_HEIGHT","ExampleSolutionModalContent","params","model","payload","cacheKey","result","status","useExampleSolution","t","useText","jsxs","View","testID","TEST_IDS","EXAMPLE_SOLUTION_MODAL","style","styles","container","IS_WEB","maxHeight","height","children","jsx","Typography","align","variant","HeadingVariants","H2","color","COLORS","NEUTRAL_9","content","QuestionSection","question","renderKatexComponent","SolutionSection","answer","exports","StyleSheet","create","width","flex","flexDirection","marginTop","SPACING","gap","solutionContainer","overflow","borderRadius","borderWidth","borderColor","NEUTRAL_5","lavaIconContainer","position","bottom","right","loaderContainer","paddingTop","backgroundColor","NEUTRAL_1","messageBlock"],"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;AAEA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAA4C,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAE,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAM5C,MAAMG,gBAAgB,GAAG,GAAG;AAErB,MAAMC,2BAA2B,GAAGA,CAAC;EAC1CC,MAAM,EAAE;IAAEC,KAAK;IAAEC,OAAO;IAAEC;EAAS;AACH,CAAC,KAAK;EACtC,MAAM;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AAMgB,MAAM,GAAGsB,uBAAU,CAACC,MAAM,CAAC;EAC/BtB,SAAS,EAAE;IACTuB,KAAK,EAAE;EACT,CAAC;EACDT,OAAO,EAAE;IACPU,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,KAAK;IACpBC,SAAS,EAAEC,sBAAO,CAAC,GAAG,CAAC;IACvBC,GAAG,EAAED,sBAAO,CAAC,GAAG;EAClB,CAAC;EACDE,iBAAiB,EAAE;IACjBN,KAAK,EAAE,GAAG;IACVO,QAAQ,EAAE,QAAQ;IAClBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAErB,qBAAM,CAACsB;EACtB,CAAC;EACDC,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;IACpBb,KAAK,EAAE,MAAM;IACbpB,MAAM,EAAE,MAAM;IACdsC,eAAe,EAAE7B,qBAAM,CAAC8B;EAC1B,CAAC;EACDC,YAAY,EAAE;IACZP,QAAQ,EAAE,UAAU;IACpBE,KAAK,EAAE,EAAE;IACTD,MAAM,EAAE,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.QuestionSection = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
11
|
+
var _constants = require("../constants.js");
|
|
12
|
+
var _studentsQa = require("@magmamath/students-qa");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const QuestionSection = ({
|
|
18
|
+
question,
|
|
19
|
+
status,
|
|
20
|
+
renderKatexComponent
|
|
21
|
+
}) => {
|
|
22
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
23
|
+
style: styles.container,
|
|
24
|
+
testID: _studentsQa.TEST_IDS.EXAMPLE_SOLUTION_QUESTION_SECTION,
|
|
25
|
+
children: [question && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
26
|
+
style: styles.katexContainer,
|
|
27
|
+
children: renderKatexComponent(question)
|
|
28
|
+
}), status === _constants.ExampleSolutionStatuses.LOADING && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
29
|
+
exiting: _reactNativeReanimated.FadeOut,
|
|
30
|
+
style: styles.loaderContainer,
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Loader, {
|
|
32
|
+
size: "large",
|
|
33
|
+
color: _reactNativeUi.LoaderColor.BLUE
|
|
34
|
+
})
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.QuestionSection = QuestionSection;
|
|
39
|
+
const styles = _reactNative.StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
flex: 1
|
|
42
|
+
},
|
|
43
|
+
katexContainer: {
|
|
44
|
+
flex: 1
|
|
45
|
+
},
|
|
46
|
+
loaderContainer: {
|
|
47
|
+
paddingTop: 34,
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
zIndex: 100,
|
|
50
|
+
width: '100%',
|
|
51
|
+
height: '100%',
|
|
52
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
|
|
53
|
+
justifyContent: 'flex-start',
|
|
54
|
+
alignItems: 'center'
|
|
55
|
+
},
|
|
56
|
+
errorContainer: {
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
width: '100%',
|
|
59
|
+
height: '100%',
|
|
60
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
padding: _reactNativeUi.SPACING[400]
|
|
64
|
+
},
|
|
65
|
+
errorText: {
|
|
66
|
+
color: _reactNativeUi.COLORS.PRIMARY_RED,
|
|
67
|
+
textAlign: 'center'
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=QuestionSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_constants","_studentsQa","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","QuestionSection","question","status","renderKatexComponent","jsxs","View","style","styles","container","testID","TEST_IDS","EXAMPLE_SOLUTION_QUESTION_SECTION","children","jsx","katexContainer","ExampleSolutionStatuses","LOADING","exiting","FadeOut","loaderContainer","Loader","size","color","LoaderColor","BLUE","exports","StyleSheet","create","flex","paddingTop","position","zIndex","width","height","backgroundColor","COLORS","NEUTRAL_1","justifyContent","alignItems","errorContainer","padding","SPACING","errorText","PRIMARY_RED","textAlign"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/QuestionSection.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAiD,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,C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AAA;AAED,MAAMO,MAAM,GAAGmB,uBAAU,CAACC,MAAM,CAAC;EAC/BnB,SAAS,EAAE;IACToB,IAAI,EAAE;EACR,CAAC;EACDd,cAAc,EAAE;IACdc,IAAI,EAAE;EACR,CAAC;EACDT,eAAe,EAAE;IACfU,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,GAAG;IACXC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,eAAe,EAAEC,qBAAM,CAACC,SAAS;IACjCC,cAAc,EAAE,YAAY;IAC5BC,UAAU,EAAE;EACd,CAAC;EACDC,cAAc,EAAE;IACdT,QAAQ,EAAE,UAAU;IACpBE,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,eAAe,EAAEC,qBAAM,CAACC,SAAS;IACjCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBE,OAAO,EAAEC,sBAAO,CAAC,GAAG;EACtB,CAAC;EACDC,SAAS,EAAE;IACTpB,KAAK,EAAEa,qBAAM,CAACQ,WAAW;IACzBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SolutionSection = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
11
|
+
var _constants = require("../constants.js");
|
|
12
|
+
var _grid = _interopRequireDefault(require("../assets/grid.webp"));
|
|
13
|
+
var _studentsQa = require("@magmamath/students-qa");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
const CONTAINER_SIZES = {
|
|
19
|
+
width: 489,
|
|
20
|
+
height: 543
|
|
21
|
+
};
|
|
22
|
+
const BORDER_WIDTH = 1;
|
|
23
|
+
const CONTAINER_HEIGHT_OFFSET = 160;
|
|
24
|
+
const gridImagePath = !_reactNativeUi.IS_WEB ? _reactNative.Image.resolveAssetSource(_grid.default).uri : _grid.default;
|
|
25
|
+
const SolutionSection = ({
|
|
26
|
+
answer,
|
|
27
|
+
status
|
|
28
|
+
}) => {
|
|
29
|
+
const {
|
|
30
|
+
height
|
|
31
|
+
} = (0, _reactNative.useWindowDimensions)();
|
|
32
|
+
const shouldShowAnswer = answer && (status === _constants.ExampleSolutionStatuses.DONE_DATA || status === _constants.ExampleSolutionStatuses.CACHE);
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
34
|
+
style: [styles.container, _reactNativeUi.IS_WEB && {
|
|
35
|
+
maxHeight: height - CONTAINER_HEIGHT_OFFSET
|
|
36
|
+
}],
|
|
37
|
+
testID: _studentsQa.TEST_IDS.EXAMPLE_SOLUTION_SOLUTION_SECTION,
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
39
|
+
style: styles.solutionScroll,
|
|
40
|
+
contentContainerStyle: styles.solutionScrollContent,
|
|
41
|
+
bounces: true,
|
|
42
|
+
children: _reactNativeUi.IS_WEB ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ImageBackground, {
|
|
43
|
+
resizeMode: "repeat",
|
|
44
|
+
style: [styles.gridImageWeb],
|
|
45
|
+
source: {
|
|
46
|
+
uri: gridImagePath
|
|
47
|
+
},
|
|
48
|
+
children: shouldShowAnswer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.Text, {
|
|
49
|
+
entering: status === 'cache' ? undefined : _reactNativeReanimated.FadeIn.delay(1000).duration(500),
|
|
50
|
+
style: styles.solutionText,
|
|
51
|
+
children: answer
|
|
52
|
+
})
|
|
53
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
54
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ImageBackground, {
|
|
55
|
+
resizeMode: "repeat",
|
|
56
|
+
style: styles.gridImageRn,
|
|
57
|
+
source: {
|
|
58
|
+
uri: gridImagePath
|
|
59
|
+
}
|
|
60
|
+
}), shouldShowAnswer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.Text, {
|
|
61
|
+
entering: status === 'cache' ? undefined : _reactNativeReanimated.FadeIn.delay(1000).duration(500),
|
|
62
|
+
style: styles.solutionText,
|
|
63
|
+
children: answer
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
exports.SolutionSection = SolutionSection;
|
|
70
|
+
const styles = _reactNative.StyleSheet.create({
|
|
71
|
+
container: {
|
|
72
|
+
width: CONTAINER_SIZES.width,
|
|
73
|
+
height: CONTAINER_SIZES.height,
|
|
74
|
+
overflow: 'hidden',
|
|
75
|
+
borderRadius: 8,
|
|
76
|
+
borderWidth: BORDER_WIDTH,
|
|
77
|
+
borderColor: _reactNativeUi.COLORS.NEUTRAL_5
|
|
78
|
+
},
|
|
79
|
+
gridImageRn: {
|
|
80
|
+
top: -327,
|
|
81
|
+
width: '100%',
|
|
82
|
+
height: '150%',
|
|
83
|
+
position: 'absolute'
|
|
84
|
+
},
|
|
85
|
+
gridImageWeb: {
|
|
86
|
+
width: '100%',
|
|
87
|
+
height: '100%'
|
|
88
|
+
},
|
|
89
|
+
solutionScroll: {
|
|
90
|
+
flex: 1
|
|
91
|
+
},
|
|
92
|
+
solutionScrollContent: {
|
|
93
|
+
minHeight: CONTAINER_SIZES.height - BORDER_WIDTH * 2,
|
|
94
|
+
width: '100%'
|
|
95
|
+
},
|
|
96
|
+
solutionText: {
|
|
97
|
+
fontFamily: 'PlaypenSans-Light',
|
|
98
|
+
fontSize: 28,
|
|
99
|
+
marginHorizontal: _reactNativeUi.SPACING[800],
|
|
100
|
+
marginVertical: _reactNativeUi.SPACING[400],
|
|
101
|
+
lineHeight: 36
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=SolutionSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_constants","_grid","_studentsQa","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CONTAINER_SIZES","width","height","BORDER_WIDTH","CONTAINER_HEIGHT_OFFSET","gridImagePath","IS_WEB","Image","resolveAssetSource","gridImage","uri","SolutionSection","answer","status","useWindowDimensions","shouldShowAnswer","ExampleSolutionStatuses","DONE_DATA","CACHE","jsx","View","style","styles","container","maxHeight","testID","TEST_IDS","EXAMPLE_SOLUTION_SOLUTION_SECTION","children","ScrollView","solutionScroll","contentContainerStyle","solutionScrollContent","bounces","ImageBackground","resizeMode","gridImageWeb","source","Text","entering","undefined","FadeIn","delay","duration","solutionText","jsxs","Fragment","gridImageRn","exports","StyleSheet","create","overflow","borderRadius","borderWidth","borderColor","COLORS","NEUTRAL_5","top","position","flex","minHeight","fontFamily","fontSize","marginHorizontal","SPACING","marginVertical","lineHeight"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/SolutionSection.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAAiD,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,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AAG,CAAE;UAC5EtB,KAAK,EAAEC,MAAM,CAACsB,YAAa;UAAAhB,QAAA,EAE1BhB;QAAM,CACM,CAChB;MAAA,CACD;IACH,CACS;EAAC,CACT,CAAC;AAEX,CAAC;AAAAoC,OAAA,CAAArC,eAAA,GAAAA,eAAA;AAED,MAAMW,MAAM,GAAG2B,uBAAU,CAACC,MAAM,CAAC;EAC/B3B,SAAS,EAAE;IACTtB,KAAK,EAAED,eAAe,CAACC,KAAK;IAC5BC,MAAM,EAAEF,eAAe,CAACE,MAAM;IAC9BiD,QAAQ,EAAE,QAAQ;IAClBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAElD,YAAY;IACzBmD,WAAW,EAAEC,qBAAM,CAACC;EACtB,CAAC;EACDT,WAAW,EAAE;IACXU,GAAG,EAAE,CAAC,GAAG;IACTxD,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdwD,QAAQ,EAAE;EACZ,CAAC;EACDtB,YAAY,EAAE;IACZnC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACD4B,cAAc,EAAE;IACd6B,IAAI,EAAE;EACR,CAAC;EACD3B,qBAAqB,EAAE;IACrB4B,SAAS,EAAE5D,eAAe,CAACE,MAAM,GAAGC,YAAY,GAAG,CAAC;IACpDF,KAAK,EAAE;EACT,CAAC;EACD2C,YAAY,EAAE;IACZiB,UAAU,EAAE,mBAAmB;IAC/BC,QAAQ,EAAE,EAAE;IACZC,gBAAgB,EAAEC,sBAAO,CAAC,GAAG,CAAC;IAC9BC,cAAc,EAAED,sBAAO,CAAC,GAAG,CAAC;IAC5BE,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExampleSolutionStatuses = void 0;
|
|
7
|
+
let ExampleSolutionStatuses = exports.ExampleSolutionStatuses = /*#__PURE__*/function (ExampleSolutionStatuses) {
|
|
8
|
+
ExampleSolutionStatuses["LOADING"] = "loading";
|
|
9
|
+
ExampleSolutionStatuses["DONE_DATA"] = "doneData";
|
|
10
|
+
ExampleSolutionStatuses["CACHE"] = "cache";
|
|
11
|
+
return ExampleSolutionStatuses;
|
|
12
|
+
}({});
|
|
13
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ExampleSolutionStatuses","exports"],"sourceRoot":"../../../../src","sources":["features/exampleSolution/constants.ts"],"mappings":";;;;;;IAAkBA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useExampleSolution = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _effectorReact = require("effector-react");
|
|
9
|
+
var _constants = require("../constants.js");
|
|
10
|
+
const ANIMATION_DELAY = 600;
|
|
11
|
+
const useExampleSolution = ({
|
|
12
|
+
model,
|
|
13
|
+
payload,
|
|
14
|
+
cacheKey
|
|
15
|
+
}) => {
|
|
16
|
+
const exampleSolutionsCache = (0, _effectorReact.useUnit)(model.cache.$state);
|
|
17
|
+
const [result, setResult] = (0, _react.useState)(null);
|
|
18
|
+
const [status, setStatus] = (0, _react.useState)(_constants.ExampleSolutionStatuses.LOADING);
|
|
19
|
+
(0, _react.useEffect)(() => {
|
|
20
|
+
let timer = null;
|
|
21
|
+
const fetchExampleSolution = async () => {
|
|
22
|
+
try {
|
|
23
|
+
if (exampleSolutionsCache[cacheKey]) {
|
|
24
|
+
setResult(exampleSolutionsCache[cacheKey]);
|
|
25
|
+
setStatus(_constants.ExampleSolutionStatuses.CACHE);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const startTime = Date.now();
|
|
29
|
+
const response = await model.api.generateExampleSolutionFx(payload);
|
|
30
|
+
setResult(response);
|
|
31
|
+
model.cache.addExampleSolution({
|
|
32
|
+
cacheKey,
|
|
33
|
+
response
|
|
34
|
+
});
|
|
35
|
+
const elapsedTime = Date.now() - startTime;
|
|
36
|
+
if (elapsedTime >= ANIMATION_DELAY) {
|
|
37
|
+
setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
|
|
38
|
+
} else {
|
|
39
|
+
timer = setTimeout(() => {
|
|
40
|
+
setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
|
|
41
|
+
}, ANIMATION_DELAY - elapsedTime);
|
|
42
|
+
}
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error('Failed to fetch example solution:', error);
|
|
45
|
+
setStatus(_constants.ExampleSolutionStatuses.DONE_DATA);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
fetchExampleSolution();
|
|
49
|
+
return () => {
|
|
50
|
+
if (timer) {
|
|
51
|
+
clearTimeout(timer);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}, []);
|
|
55
|
+
return {
|
|
56
|
+
result,
|
|
57
|
+
status
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
exports.useExampleSolution = useExampleSolution;
|
|
61
|
+
//# sourceMappingURL=useExampleSolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_effectorReact","_constants","ANIMATION_DELAY","useExampleSolution","model","payload","cacheKey","exampleSolutionsCache","useUnit","cache","$state","result","setResult","useState","status","setStatus","ExampleSolutionStatuses","LOADING","useEffect","timer","fetchExampleSolution","CACHE","startTime","Date","now","response","api","generateExampleSolutionFx","addExampleSolution","elapsedTime","DONE_DATA","setTimeout","error","console","clear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,SAAS,CAACC,kCAAuB,CAACc,SAAS,CAAC;QAC9C,CAAC,MAAM;UACLX,KAAK,GAAGY,UAAU,CAAC,MAAM;YACvBhB,SAAS,CAACC,kCAAuB,CAACc,SAAS,CAAC;UAC9C,CAAC,EAAE5B,eAAe,GAAG2B,WAAW,CAAC;QACnC;MACF,CAAC,CAAC,OAAOG,KAAK,EAAE;QACdC,OAAO,CAACD,KAAK,CAAC,mCAAmC,EAAEA,KAAK,CAAC;QACzDjB,SAAS,CAACC,kCAAuB,CAACc,SAAS,CAAC;MAC9C;IACF,CAAC;IAEDV,oBAAoB,CAAC,CAAC;IAEtB,OAAO,MAAM;MACX,IAAID,KAAK,EAAE;QACTe,YAAY,CAACf,KAAK,CAAC;MACrB;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLR,MAAM;IACNG;EACF,CAAC;AACH,CAAC;AAAAqB,OAAA,CAAAhC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _ExampleSolutionModal = require("./ExampleSolutionModal.js");
|
|
7
|
+
Object.keys(_ExampleSolutionModal).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _ExampleSolutionModal[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ExampleSolutionModal[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _ExampleSolutionModel = require("./model/ExampleSolution.model.js");
|
|
18
|
+
Object.keys(_ExampleSolutionModel).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _ExampleSolutionModel[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _ExampleSolutionModel[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _types = require("./types.js");
|
|
29
|
+
Object.keys(_types).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _types[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ExampleSolutionModal","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_ExampleSolutionModel","_types"],"sourceRoot":"../../../../src","sources":["features/exampleSolution/index.ts"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,qBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,qBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,qBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,qBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExampleSolutionModel = void 0;
|
|
7
|
+
var _ExampleSolutionApi = require("./ExampleSolutionApi.js");
|
|
8
|
+
var _ExampleSolutionCache = require("./ExampleSolutionCache.js");
|
|
9
|
+
class ExampleSolutionModel {
|
|
10
|
+
cache = new _ExampleSolutionCache.ExampleSolutionCache();
|
|
11
|
+
constructor({
|
|
12
|
+
api,
|
|
13
|
+
errorHandler,
|
|
14
|
+
renderKatexComponent
|
|
15
|
+
}) {
|
|
16
|
+
this.api = new _ExampleSolutionApi.ExampleSolutionsApi({
|
|
17
|
+
api,
|
|
18
|
+
errorHandler
|
|
19
|
+
});
|
|
20
|
+
this.renderKatexComponent = renderKatexComponent;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ExampleSolutionModel = ExampleSolutionModel;
|
|
24
|
+
//# sourceMappingURL=ExampleSolution.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ExampleSolutionApi","require","_ExampleSolutionCache","ExampleSolutionModel","cache","ExampleSolutionCache","constructor","api","errorHandler","renderKatexComponent","ExampleSolutionsApi","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolution.model.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,CAAC;EAEhBC,KAAK,GAAG,IAAIC,0CAAoB,CAAC,CAAC;EAIlDC,WAAWA,CAAC;IAAEC,GAAG;IAAEC,YAAY;IAAEC;EAAgD,CAAC,EAAE;IAClF,IAAI,CAACF,GAAG,GAAG,IAAIG,uCAAmB,CAAC;MAAEH,GAAG;MAAEC;IAAa,CAAC,CAAC;IACzD,IAAI,CAACC,oBAAoB,GAAGA,oBAAoB;EAClD;AACF;AAACE,OAAA,CAAAR,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExampleSolutionsApi = void 0;
|
|
7
|
+
var _createControllerEffect = require("./../../../lib/effector/createControllerEffect.js");
|
|
8
|
+
var _effector = require("effector");
|
|
9
|
+
var _i18n = require("../../../i18n/i18n.js");
|
|
10
|
+
class ExampleSolutionsApi {
|
|
11
|
+
errorHandlingFx = (0, _effector.createEffect)(() => {
|
|
12
|
+
if (!this.errorHandlerFx) return;
|
|
13
|
+
this.errorHandlerFx((0, _i18n.getText)('exampleSolution.errorMessage'));
|
|
14
|
+
});
|
|
15
|
+
constructor({
|
|
16
|
+
api,
|
|
17
|
+
errorHandler
|
|
18
|
+
}) {
|
|
19
|
+
this.generateExampleSolutionFx = (0, _createControllerEffect.createControllerEffect)(api.generateExampleSolution);
|
|
20
|
+
this.errorHandlerFx = errorHandler;
|
|
21
|
+
(0, _effector.sample)({
|
|
22
|
+
clock: this.generateExampleSolutionFx.fail,
|
|
23
|
+
target: this.errorHandlingFx
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ExampleSolutionsApi = ExampleSolutionsApi;
|
|
28
|
+
//# sourceMappingURL=ExampleSolutionApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_createControllerEffect","require","_effector","_i18n","ExampleSolutionsApi","errorHandlingFx","createEffect","errorHandlerFx","getText","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,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAOO,MAAMG,mBAAmB,CAAC;EAIfC,eAAe,GAAG,IAAAC,sBAAY,EAAC,MAAM;IACnD,IAAI,CAAC,IAAI,CAACC,cAAc,EAAE;IAC1B,IAAI,CAACA,cAAc,CAAC,IAAAC,aAAO,EAAC,8BAA8B,CAAC,CAAC;EAC9D,CAAC,CAAC;EAEFC,WAAWA,CAAC;IAAEC,GAAG;IAAEC;EAAsC,CAAC,EAAE;IAC1D,IAAI,CAACC,yBAAyB,GAAG,IAAAC,8CAAsB,EAACH,GAAG,CAACI,uBAAuB,CAAC;IACpF,IAAI,CAACP,cAAc,GAAGI,YAAY;IAElC,IAAAI,gBAAM,EAAC;MACLC,KAAK,EAAE,IAAI,CAACJ,yBAAyB,CAACK,IAAI;MAC1CC,MAAM,EAAE,IAAI,CAACb;IACf,CAAC,CAAC;EACJ;AACF;AAACc,OAAA,CAAAf,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExampleSolutionCache = void 0;
|
|
7
|
+
var _effector = require("effector");
|
|
8
|
+
class ExampleSolutionCache {
|
|
9
|
+
addExampleSolution = (0, _effector.createEvent)();
|
|
10
|
+
$state = (0, _effector.createStore)({}).on(this.addExampleSolution, (state, exampleSolution) => {
|
|
11
|
+
return {
|
|
12
|
+
...state,
|
|
13
|
+
[exampleSolution.cacheKey]: exampleSolution.response
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.ExampleSolutionCache = ExampleSolutionCache;
|
|
18
|
+
//# sourceMappingURL=ExampleSolutionCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_effector","require","ExampleSolutionCache","addExampleSolution","createEvent","$state","createStore","on","state","exampleSolution","cacheKey","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,QAAQ,GAAGD,eAAe,CAACE;IAC9C,CAAC;EACH,CACF,CAAC;AACH;AAACC,OAAA,CAAAV,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["features/exampleSolution/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "SPECIAL_CHAR_TYPES", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _uiModeHelpers.SPECIAL_CHAR_TYPES;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "UIMode", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -17,4 +23,5 @@ Object.defineProperty(exports, "getUIMode", {
|
|
|
17
23
|
});
|
|
18
24
|
var _uiModeConstants = require("./uiMode.constants.js");
|
|
19
25
|
var _getUIMode = require("./getUIMode.js");
|
|
26
|
+
var _uiModeHelpers = require("./uiMode.helpers.js");
|
|
20
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_uiModeConstants","require","_getUIMode"],"sourceRoot":"../../../../src","sources":["features/uiMode/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_uiModeConstants","require","_getUIMode","_uiModeHelpers"],"sourceRoot":"../../../../src","sources":["features/uiMode/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isSimpleMode = exports.isBelowGradeK2 = exports.getToolbarMode = exports.getAnswerAreaMode = void 0;
|
|
6
|
+
exports.isSimpleMode = exports.isBelowGradeK2 = exports.getToolbarMode = exports.getAnswerAreaMode = exports.SPECIAL_CHAR_TYPES = void 0;
|
|
7
7
|
var _uiModeConstants = require("./uiMode.constants.js");
|
|
8
8
|
var _answerTypes = require("../../types/answerTypes.js");
|
|
9
9
|
var _characterTypes = require("../../types/characterTypes.js");
|
|
@@ -26,12 +26,17 @@ const isSimpleMode = ({
|
|
|
26
26
|
return isBelowGradeK2(user.grade);
|
|
27
27
|
};
|
|
28
28
|
exports.isSimpleMode = isSimpleMode;
|
|
29
|
+
const SPECIAL_CHAR_TYPES = exports.SPECIAL_CHAR_TYPES = [_characterTypes.MyScriptMathCharacterTypes.CURRENCY, _characterTypes.MyScriptMathCharacterTypes.UNITS, _characterTypes.MyScriptMathCharacterTypes.NUMBERS_AND_UNITS, _characterTypes.MyScriptMathCharacterTypes.TIME];
|
|
29
30
|
const getAnswerAreaMode = ({
|
|
30
31
|
practice,
|
|
31
32
|
problem
|
|
32
33
|
}) => {
|
|
33
34
|
const isHandwritingNumbersWhole = problem.answerType === _answerTypes.AnswerType.HANDWRITING && problem.characterType === _characterTypes.MyScriptMathCharacterTypes.NUMBERS_WHOLE;
|
|
34
|
-
if (
|
|
35
|
+
if (problem.hasAnswerVariants || isHandwritingNumbersWhole) {
|
|
36
|
+
return _uiModeConstants.UIMode.SIMPLE;
|
|
37
|
+
}
|
|
38
|
+
const needsSpecialKeyboard = problem.answerType === _answerTypes.AnswerType.HANDWRITING && SPECIAL_CHAR_TYPES.includes(problem.characterType);
|
|
39
|
+
if (practice.isEnabled && !needsSpecialKeyboard) {
|
|
35
40
|
return _uiModeConstants.UIMode.SIMPLE;
|
|
36
41
|
}
|
|
37
42
|
return _uiModeConstants.UIMode.REGULAR;
|