@magmamath/students-features 0.4.1 → 0.4.2
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/endOfAssignment/components/CheatDetected/CheatDetected.js +2 -2
- package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +3 -2
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js +2 -2
- package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +2 -2
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +2 -2
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +5 -4
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/constants.js +1 -5
- package/dist/commonjs/features/endOfAssignment/constants.js.map +1 -1
- package/dist/commonjs/lib/constants.js +11 -0
- package/dist/commonjs/lib/constants.js.map +1 -0
- package/dist/commonjs/lib/helpers/helpers.js +3 -1
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
- package/dist/commonjs/{features/endOfAssignment → shared}/hooks/useKeyDownListener.js +1 -1
- package/dist/commonjs/shared/hooks/useKeyDownListener.js.map +1 -0
- package/dist/commonjs/{features/endOfAssignment → shared}/hooks/useKeyboard.js +2 -3
- package/dist/commonjs/shared/hooks/useKeyboard.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js +2 -2
- package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +3 -2
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js +2 -2
- package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +2 -2
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +2 -2
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +5 -4
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/constants.js +0 -4
- package/dist/module/features/endOfAssignment/constants.js.map +1 -1
- package/dist/module/lib/constants.js +7 -0
- package/dist/module/lib/constants.js.map +1 -0
- package/dist/module/lib/helpers/helpers.js +1 -0
- package/dist/module/lib/helpers/helpers.js.map +1 -1
- package/dist/module/{features/endOfAssignment → shared}/hooks/useKeyDownListener.js +1 -1
- package/dist/module/shared/hooks/useKeyDownListener.js.map +1 -0
- package/dist/module/{features/endOfAssignment → shared}/hooks/useKeyboard.js +1 -1
- package/dist/module/shared/hooks/useKeyboard.js.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts +0 -3
- package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/constants.d.ts +4 -0
- package/dist/typescript/commonjs/lib/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts +1 -0
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/{features/endOfAssignment → shared}/hooks/useKeyDownListener.d.ts +1 -1
- package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts.map +1 -0
- package/dist/typescript/commonjs/{features/endOfAssignment → shared}/hooks/useKeyboard.d.ts +1 -1
- package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/constants.d.ts +0 -3
- package/dist/typescript/module/features/endOfAssignment/constants.d.ts.map +1 -1
- package/dist/typescript/module/lib/constants.d.ts +4 -0
- package/dist/typescript/module/lib/constants.d.ts.map +1 -0
- package/dist/typescript/module/lib/helpers/helpers.d.ts +1 -0
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/module/{features/endOfAssignment → shared}/hooks/useKeyDownListener.d.ts +1 -1
- package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts.map +1 -0
- package/dist/typescript/module/{features/endOfAssignment → shared}/hooks/useKeyboard.d.ts +1 -1
- package/dist/typescript/module/shared/hooks/useKeyboard.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/features/endOfAssignment/components/CheatDetected/CheatDetected.tsx +2 -2
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +3 -2
- package/src/features/endOfAssignment/components/ExamLeave/ExamLeave.tsx +2 -2
- package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +2 -2
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +2 -2
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +5 -5
- package/src/features/endOfAssignment/constants.ts +0 -4
- package/src/lib/constants.ts +3 -0
- package/src/lib/helpers/helpers.ts +2 -0
- package/src/{features/endOfAssignment → shared}/hooks/useKeyDownListener.ts +2 -1
- package/src/{features/endOfAssignment → shared}/hooks/useKeyboard.ts +2 -3
- package/dist/commonjs/features/endOfAssignment/hooks/useKeyDownListener.js.map +0 -1
- package/dist/commonjs/features/endOfAssignment/hooks/useKeyboard.js.map +0 -1
- package/dist/module/features/endOfAssignment/hooks/useKeyDownListener.js.map +0 -1
- package/dist/module/features/endOfAssignment/hooks/useKeyboard.js.map +0 -1
- package/dist/typescript/commonjs/features/endOfAssignment/hooks/useKeyDownListener.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/endOfAssignment/hooks/useKeyboard.d.ts.map +0 -1
- package/dist/typescript/module/features/endOfAssignment/hooks/useKeyDownListener.d.ts.map +0 -1
- package/dist/typescript/module/features/endOfAssignment/hooks/useKeyboard.d.ts.map +0 -1
|
@@ -6,8 +6,8 @@ import { useUnit } from 'effector-react';
|
|
|
6
6
|
import { Button, ButtonColor, ButtonVariant, COLORS, SPACING, Typography } from '@magmamath/react-native-ui';
|
|
7
7
|
import { NoAnswerContent } from "./NoAnswerContent.js";
|
|
8
8
|
import { PracticeButton } from "../../ui/PracticeButton.js";
|
|
9
|
-
import { useKeyBoard } from "
|
|
10
|
-
import { KeyboardKeys } from "
|
|
9
|
+
import { useKeyBoard } from "../../../../shared/hooks/useKeyboard.js";
|
|
10
|
+
import { KeyboardKeys } from "../../../../lib/constants.js";
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
export const NoAnswer = ({
|
|
13
13
|
model,
|
|
@@ -23,7 +23,7 @@ export const NoAnswer = ({
|
|
|
23
23
|
const solved = stats?.solvedAmount ?? 0;
|
|
24
24
|
const total = stats?.problemsAmount ?? 0;
|
|
25
25
|
const buttonColorScheme = isExam ? ButtonColor.YELLOW : ButtonColor.BLUE;
|
|
26
|
-
const practiceButtonVisible = !
|
|
26
|
+
const practiceButtonVisible = !isExam || !!user?.practiceMode;
|
|
27
27
|
const handlePrimaryButtonPress = () => {
|
|
28
28
|
isExam ? onPracticePress?.() : model.goToFirstProblemPressed();
|
|
29
29
|
model.hidePopUp();
|
|
@@ -43,7 +43,7 @@ export const NoAnswer = ({
|
|
|
43
43
|
color: COLORS.NEUTRAL_9
|
|
44
44
|
},
|
|
45
45
|
children: textContent.title
|
|
46
|
-
}), !!textContent.subtitle && /*#__PURE__*/_jsx(Typography, {
|
|
46
|
+
}), !!textContent.subtitle && practiceButtonVisible && /*#__PURE__*/_jsx(Typography, {
|
|
47
47
|
variant: "h4",
|
|
48
48
|
style: {
|
|
49
49
|
color: COLORS.NEUTRAL_7
|
|
@@ -76,6 +76,7 @@ export const NoAnswer = ({
|
|
|
76
76
|
};
|
|
77
77
|
const styles = StyleSheet.create({
|
|
78
78
|
container: {
|
|
79
|
+
flex: 1,
|
|
79
80
|
gap: SPACING[400],
|
|
80
81
|
alignItems: 'center'
|
|
81
82
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","StyleSheet","useUnit","Button","ButtonColor","ButtonVariant","COLORS","SPACING","Typography","NoAnswerContent","PracticeButton","useKeyBoard","KeyboardKeys","jsx","_jsx","jsxs","_jsxs","NoAnswer","model","textContent","onPracticePress","popUpData","$popUpData","stats","isExam","user","solved","solvedAmount","total","problemsAmount","buttonColorScheme","YELLOW","BLUE","practiceButtonVisible","
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","useUnit","Button","ButtonColor","ButtonVariant","COLORS","SPACING","Typography","NoAnswerContent","PracticeButton","useKeyBoard","KeyboardKeys","jsx","_jsx","jsxs","_jsxs","NoAnswer","model","textContent","onPracticePress","popUpData","$popUpData","stats","isExam","user","solved","solvedAmount","total","problemsAmount","buttonColorScheme","YELLOW","BLUE","practiceButtonVisible","practiceMode","handlePrimaryButtonPress","goToFirstProblemPressed","hidePopUp","event","key","ENTER","hidePopUpAndLeave","style","styles","container","children","title","variant","color","NEUTRAL_9","subtitle","NEUTRAL_7","buttonsContainer","TERTIARY","PRIMARY","size","colorScheme","PURPLE","text","textTransform","onPress","leftButtonText","rightButtonText","create","flex","gap","alignItems","flexDirection","paddingVertical","buttonText"],"sourceRoot":"../../../../../../src","sources":["features/endOfAssignment/components/NoAnswer/NoAnswer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SACEC,MAAM,EACNC,WAAW,EACXC,aAAa,EACbC,MAAM,EACNC,OAAO,EACPC,UAAU,QACL,4BAA4B;AAGnC,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,cAAc,QAAQ,4BAAyB;AACxD,SAASC,WAAW,QAAQ,yCAAsC;AAClE,SAASC,YAAY,QAAQ,8BAA2B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAExD,OAAO,MAAMC,QAAQ,GAAGA,CAAC;EAAEC,KAAK;EAAEC,WAAW;EAAEC;AAAsC,CAAC,KAAK;EACzF,MAAMC,SAAS,GAAGnB,OAAO,CAACgB,KAAK,CAACI,UAAU,CAAC;EAE3C,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAK,CAAC,GAAGJ,SAAS,IAAI,CAAC,CAAC;EAC/C,MAAMK,MAAM,GAAGH,KAAK,EAAEI,YAAY,IAAI,CAAC;EACvC,MAAMC,KAAK,GAAGL,KAAK,EAAEM,cAAc,IAAI,CAAC;EACxC,MAAMC,iBAAiB,GAAGN,MAAM,GAAGpB,WAAW,CAAC2B,MAAM,GAAG3B,WAAW,CAAC4B,IAAI;EAExE,MAAMC,qBAAqB,GAAG,CAACT,MAAM,IAAI,CAAC,CAACC,IAAI,EAAES,YAAY;EAE7D,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;IACrCX,MAAM,GAAGJ,eAAe,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ChFC,IAAI,EAAC,OAAO;QACZC,WAAW,EAAEnC,SAAS,EAAEG,MAAM,GAAGpB,WAAW,CAACqD,MAAM,GAAGrD,WAAW,CAAC4B,IAAK;QACvEU,KAAK,EAAE;UAAEgB,IAAI,EAAE;YAAEC,aAAa,EAAE;UAAY;QAAE,CAAE;QAChDC,OAAO,EAAE1C,KAAK,CAACuB,iBAAkB;QAAAI,QAAA,EAEhC1B,WAAW,CAAC0C,cAAc,IAAI;MAAE,CAC3B,CAAC,EAER5B,qBAAqB,iBACpBnB,IAAA,CAACJ,cAAc;QACbkD,OAAO,EAAEzB,wBAAyB;QAClCuB,IAAI,EAAEvC,WAAW,CAAC2C,eAAgB;QAClCN,WAAW,EAAE1B;MAAkB,CAChC,CACF;IAAA,CACG,CAAC;EAAA,CACH,CAAC;AAEX,CAAC;AAED,MAAMa,MAAM,GAAG1C,UAAU,CAAC8D,MAAM,CAAC;EAC/BnB,SAAS,EAAE;IACToB,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE1D,OAAO,CAAC,GAAG,CAAC;IACjB2D,UAAU,EAAE;EACd,CAAC;EACDd,gBAAgB,EAAE;IAChBe,aAAa,EAAE,KAAK;IACpBD,UAAU,EAAE,QAAQ;IACpBD,GAAG,EAAE1D,OAAO,CAAC,GAAG,CAAC;IACjB6D,eAAe,EAAE7D,OAAO,CAAC,GAAG;EAC9B,CAAC;EACD8D,UAAU,EAAE;IACVV,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,10 +4,6 @@ import { COLORS } from '@magmamath/react-native-ui';
|
|
|
4
4
|
import { AnimatedCardVariant, EOAModalVariant } from "./types.js";
|
|
5
5
|
export const SPARKS_ANIMATION_DELAY = 2000;
|
|
6
6
|
export const GOOD_DRAWING_CARD_APPEARENCE_DELAY = 1800;
|
|
7
|
-
export let KeyboardKeys = /*#__PURE__*/function (KeyboardKeys) {
|
|
8
|
-
KeyboardKeys["ENTER"] = "Enter";
|
|
9
|
-
return KeyboardKeys;
|
|
10
|
-
}({});
|
|
11
7
|
export const MODALS_WITH_BACKGROUND = [EOAModalVariant.HAS_CORRECT_ANSWERS, EOAModalVariant.HAS_GOOD_DRAWING, EOAModalVariant.EXAM_FINISHED_HAS_CORRECT_ANSWERS];
|
|
12
8
|
export const VARIANT_COLORS = {
|
|
13
9
|
[AnimatedCardVariant.CORRECT_ANSWER]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["COLORS","AnimatedCardVariant","EOAModalVariant","SPARKS_ANIMATION_DELAY","GOOD_DRAWING_CARD_APPEARENCE_DELAY","
|
|
1
|
+
{"version":3,"names":["COLORS","AnimatedCardVariant","EOAModalVariant","SPARKS_ANIMATION_DELAY","GOOD_DRAWING_CARD_APPEARENCE_DELAY","MODALS_WITH_BACKGROUND","HAS_CORRECT_ANSWERS","HAS_GOOD_DRAWING","EXAM_FINISHED_HAS_CORRECT_ANSWERS","VARIANT_COLORS","CORRECT_ANSWER","initial","GREEN_2","final","GREEN_4","primary","PRIMARY_GREEN","GOOD_DRAWING","ORANGE_2","ORANGE_4","PRIMARY_ORANGE","ANIMATION_DELAYS","step3","celebrations","CARD_DIMENSIONS","initialWidth","finalWidth","initialHeight","finalHeight","OPACITY","BADGE_PARAMS","initialTranslateX","intermediateTranslateX","finalTranslateX","initialRotation","initialScale","SPRING_CONFIG","stiffness","damping","mass","SPRING_CONFIG_STEP_3"],"sourceRoot":"../../../../src","sources":["features/endOfAssignment/constants.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,4BAA4B;AAEnD,SAASC,mBAAmB,EAAEC,eAAe,QAAQ,YAAS;AAE9D,OAAO,MAAMC,sBAAsB,GAAG,IAAI;AAC1C,OAAO,MAAMC,kCAAkC,GAAG,IAAI;AAEtD,OAAO,MAAMC,sBAAsB,GAAG,CACpCH,eAAe,CAACI,mBAAmB,EACnCJ,eAAe,CAACK,gBAAgB,EAChCL,eAAe,CAACM,iCAAiC,CAClD;AAED,OAAO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YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { getText } from "../../shared/translation/helpers.js";
|
|
4
|
+
export const noop = () => {};
|
|
4
5
|
export const generateRandomId = () => Date.now().toString(36) + Math.random().toString(36).substring(2);
|
|
5
6
|
const getYears = days => Math.floor(days / 365);
|
|
6
7
|
const getMonths = days => Math.floor(days / 30);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getText","generateRandomId","Date","now","toString","Math","random","substring","getYears","days","floor","getMonths","getDays","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getRelativeTimeText","date","timeBufferMs","getTime","targetDate","diffTime","months","years"],"sourceRoot":"../../../../src","sources":["lib/helpers/helpers.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,qCAAkC;AAE1D,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAC9BC,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,GAAGC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACF,QAAQ,CAAC,EAAE,CAAC,CAACG,SAAS,CAAC,CAAC,CAAC;AAEnE,MAAMC,QAAQ,GAAIC,IAAY,IAAKJ,IAAI,CAACK,KAAK,CAACD,IAAI,GAAG,GAAG,CAAC;AACzD,MAAME,SAAS,GAAIF,IAAY,IAAKJ,IAAI,CAACK,KAAK,CAACD,IAAI,GAAG,EAAE,CAAC;AACzD,MAAMG,OAAO,GAAIC,KAAa,IAAKR,IAAI,CAACK,KAAK,CAACG,KAAK,GAAG,EAAE,CAAC;AACzD,MAAMC,QAAQ,GAAIC,OAAe,IAAKV,IAAI,CAACK,KAAK,CAACK,OAAO,GAAG,EAAE,CAAC;AAC9D,MAAMC,UAAU,GAAIC,OAAe,IAAKZ,IAAI,CAACK,KAAK,CAACO,OAAO,GAAG,EAAE,CAAC;AAChE,MAAMC,UAAU,GAAIC,YAAoB,IAAKd,IAAI,CAACK,KAAK,CAACS,YAAY,GAAG,IAAI,CAAC;AAE5E,OAAO,MAAMC,mBAAmB,GAAIC,IAAU,IAAK;EACjD,MAAMC,YAAY,GAAG,IAAI,EAAC;;EAE1B,MAAMnB,GAAG,GAAG,IAAID,IAAI,CAAC,CAAC,CAACqB,OAAO,CAAC,CAAC;EAChC,MAAMC,UAAU,GAAG,IAAItB,IAAI,CAACmB,IAAI,CAAC,CAACE,OAAO,CAAC,CAAC,GAAGD,YAAY;EAC1D,MAAMG,QAAQ,GAAGtB,GAAG,GAAGqB,UAAU;EAEjC,MAAMP,OAAO,GAAGC,UAAU,CAACO,QAAQ,CAAC;EACpC,MAAMV,OAAO,GAAGC,UAAU,CAACC,OAAO,CAAC;EACnC,MAAMJ,KAAK,GAAGC,QAAQ,CAACC,OAAO,CAAC;EAC/B,MAAMN,IAAI,GAAGG,OAAO,CAACC,KAAK,CAAC;EAC3B,MAAMa,MAAM,GAAGf,SAAS,CAACF,IAAI,CAAC;EAC9B,MAAMkB,KAAK,GAAGnB,QAAQ,CAACC,IAAI,CAAC;EAE5B,IAAIQ,OAAO,GAAG,EAAE,EAAE,
|
|
1
|
+
{"version":3,"names":["getText","noop","generateRandomId","Date","now","toString","Math","random","substring","getYears","days","floor","getMonths","getDays","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getRelativeTimeText","date","timeBufferMs","getTime","targetDate","diffTime","months","years"],"sourceRoot":"../../../../src","sources":["lib/helpers/helpers.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,qCAAkC;AAE1D,OAAO,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAE5B,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAC9BC,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,GAAGC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACF,QAAQ,CAAC,EAAE,CAAC,CAAC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B,OAAO,CAAC,cAAc,CAAC;EAChD,IAAIgB,OAAO,GAAG,EAAE,EACd,OAAO,GAAGA,OAAO,IAAIA,OAAO,KAAK,CAAC,GAAGhB,OAAO,CAAC,gBAAgB,CAAC,GAAGA,OAAO,CAAC,iBAAiB,CAAC,EAAE;EAC/F,IAAIc,KAAK,GAAG,EAAE,EACZ,OAAO,GAAGA,KAAK,IAAIA,KAAK,KAAK,CAAC,GAAGd,OAAO,CAAC,cAAc,CAAC,GAAGA,OAAO,CAAC,eAAe,CAAC,EAAE;EACvF,IAAIU,IAAI,GAAG,EAAE,EAAE,OAAO,GAAGA,IAAI,IAAIA,IAAI,KAAK,CAAC,GAAGV,OAAO,CAAC,aAAa,CAAC,GAAGA,OAAO,CAAC,cAAc,CAAC,EAAE;EAChG,IAAI2B,MAAM,GAAG,EAAE,EACb,OAAO,GAAGA,MAAM,IAAIA,MAAM,KAAK,CAAC,GAAG3B,OAAO,CAAC,eAAe,CAAC,GAAGA,OAAO,CAAC,gBAAgB,CAAC,EAAE;EAC3F,OAAO,GAAG4B,KAAK,IAAIA,KAAK,KAAK,CAAC,GAAG5B,OAAO,CAAC,cAAc,CAAC,GAAGA,OAAO,CAAC,eAAe,CAAC,EAAE;AACvF,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useRef } from 'react';
|
|
4
|
-
import { KeyboardKeys } from "
|
|
4
|
+
import { KeyboardKeys } from "../../lib/constants.js";
|
|
5
5
|
export const useKeyDownListener = (callback, overrideKeys = [KeyboardKeys.ENTER]) => {
|
|
6
6
|
const callbackRef = useRef(callback);
|
|
7
7
|
callbackRef.current = callback;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","KeyboardKeys","useKeyDownListener","callback","overrideKeys","ENTER","callbackRef","current","eventHandler","event","includes","key","preventDefault","stopPropagation","document","addEventListener","removeEventListener"],"sourceRoot":"../../../../src","sources":["shared/hooks/useKeyDownListener.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,SAASC,YAAY,QAAQ,wBAAqB;AAElD,OAAO,MAAMC,kBAAkB,GAAGA,CAChCC,QAAwC,EACxCC,YAAY,GAAG,CAACH,YAAY,CAACI,KAAK,CAAC,KAChC;EACH,MAAMC,WAAW,GAAGN,MAAM,CAACG,QAAQ,CAAC;EACpCG,WAAW,CAACC,OAAO,GAAGJ,QAAQ;EAE9BJ,SAAS,CAAC,MAAM;IACd,MAAMS,YAAY,GAAIC,KAAoB,IAAK;MAC7C,IAAIL,YAAY,CAACM,QAAQ,CAACD,KAAK,CAACE,GAAmB,CAAC,EAAE;QACpDF,KAAK,CAACG,cAAc,CAAC,CAAC;QACtBH,KAAK,CAACI,eAAe,CAAC,CAAC;MACzB;MAEAP,WAAW,CAACC,OAAO,CAACE,KAAK,CAAC;IAC5B,CAAC;IAEDK,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEP,YAAY,EAAE,IAAI,CAAC;IACxD,OAAO,MAAM;MACXM,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAER,YAAY,EAAE,IAAI,CAAC;IAC7D,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","useKeyDownListener","noop","useKeyBoard","select","native","default"],"sourceRoot":"../../../../src","sources":["shared/hooks/useKeyboard.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,kBAAkB,QAAQ,yBAAsB;AACzD,SAASC,IAAI,QAAQ,8BAA2B;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGH,QAAQ,CAACI,MAAM,CAAC;EACzCC,MAAM,EAAEH,IAAI;EACZI,OAAO,EAAEL;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CorrectAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAUpD,OAAO,EAAuB,oBAAoB,EAAmB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"CorrectAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAUpD,OAAO,EAAuB,oBAAoB,EAAmB,MAAM,aAAa,CAAA;AAIxF,eAAO,MAAM,aAAa,4CAA6C,oBAAoB,sBAuF1F,CAAA"}
|
package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMlD,eAAO,MAAM,QAAQ,4CAA6C,oBAAoB,
|
|
1
|
+
{"version":3,"file":"NoAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMlD,eAAO,MAAM,QAAQ,4CAA6C,oBAAoB,sBAyDrF,CAAA"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { AnimatedCardVariant, EOAModalVariant } from './types';
|
|
2
2
|
export declare const SPARKS_ANIMATION_DELAY = 2000;
|
|
3
3
|
export declare const GOOD_DRAWING_CARD_APPEARENCE_DELAY = 1800;
|
|
4
|
-
export declare enum KeyboardKeys {
|
|
5
|
-
ENTER = "Enter"
|
|
6
|
-
}
|
|
7
4
|
export declare const MODALS_WITH_BACKGROUND: EOAModalVariant[];
|
|
8
5
|
export declare const VARIANT_COLORS: Record<AnimatedCardVariant, {
|
|
9
6
|
initial: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/endOfAssignment/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9D,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAC1C,eAAO,MAAM,kCAAkC,OAAO,CAAA;AAEtD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/endOfAssignment/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9D,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAC1C,eAAO,MAAM,kCAAkC,OAAO,CAAA;AAEtD,eAAO,MAAM,sBAAsB,mBAIlC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,mBAAmB,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAW3G,CAAA;AAED,eAAO,MAAM,gBAAgB;;;CAG5B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;CAK3B,CAAA;AAED,eAAO,MAAM,OAAO;;;CAGnB,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;CAMxB,CAAA;AAED,eAAO,MAAM,aAAa;;;;CAA8C,CAAA;AACxE,eAAO,MAAM,oBAAoB;;;;CAAgD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACpB,KAAK,UAAU;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,cACsC,CAAA;AASnE,eAAO,MAAM,mBAAmB,SAAU,IAAI,WAuB7C,CAAA"}
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,YAAW,CAAC;AAE7B,eAAO,MAAM,gBAAgB,cACsC,CAAA;AASnE,eAAO,MAAM,mBAAmB,SAAU,IAAI,WAuB7C,CAAA"}
|
package/dist/typescript/commonjs/{features/endOfAssignment → shared}/hooks/useKeyDownListener.d.ts
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { KeyboardKeys } from '
|
|
1
|
+
import { KeyboardKeys } from '../../lib/constants';
|
|
2
2
|
export declare const useKeyDownListener: (callback: (event: KeyboardEvent) => void, overrideKeys?: KeyboardKeys[]) => void;
|
|
3
3
|
//# sourceMappingURL=useKeyDownListener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyDownListener.d.ts","sourceRoot":"","sources":["../../../../../src/shared/hooks/useKeyDownListener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,kBAAkB,aACnB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,wCAqBzC,CAAA"}
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* - On web (default), it returns the `useKeyDownListener` hook, which allows you
|
|
8
8
|
* to register a callback that is triggered on keydown events.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useKeyBoard: (callback: (event: KeyboardEvent) => void, overrideKeys?: import("
|
|
10
|
+
export declare const useKeyBoard: (callback: (event: KeyboardEvent) => void, overrideKeys?: import("../../lib/constants").KeyboardKeys[]) => void;
|
|
11
11
|
//# sourceMappingURL=useKeyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../../../../src/shared/hooks/useKeyboard.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,iHAGtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CorrectAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAUpD,OAAO,EAAuB,oBAAoB,EAAmB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"CorrectAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAUpD,OAAO,EAAuB,oBAAoB,EAAmB,MAAM,aAAa,CAAA;AAIxF,eAAO,MAAM,aAAa,4CAA6C,oBAAoB,sBAuF1F,CAAA"}
|
package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMlD,eAAO,MAAM,QAAQ,4CAA6C,oBAAoB,
|
|
1
|
+
{"version":3,"file":"NoAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMlD,eAAO,MAAM,QAAQ,4CAA6C,oBAAoB,sBAyDrF,CAAA"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { AnimatedCardVariant, EOAModalVariant } from './types';
|
|
2
2
|
export declare const SPARKS_ANIMATION_DELAY = 2000;
|
|
3
3
|
export declare const GOOD_DRAWING_CARD_APPEARENCE_DELAY = 1800;
|
|
4
|
-
export declare enum KeyboardKeys {
|
|
5
|
-
ENTER = "Enter"
|
|
6
|
-
}
|
|
7
4
|
export declare const MODALS_WITH_BACKGROUND: EOAModalVariant[];
|
|
8
5
|
export declare const VARIANT_COLORS: Record<AnimatedCardVariant, {
|
|
9
6
|
initial: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/endOfAssignment/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9D,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAC1C,eAAO,MAAM,kCAAkC,OAAO,CAAA;AAEtD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/endOfAssignment/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9D,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAC1C,eAAO,MAAM,kCAAkC,OAAO,CAAA;AAEtD,eAAO,MAAM,sBAAsB,mBAIlC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,mBAAmB,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAW3G,CAAA;AAED,eAAO,MAAM,gBAAgB;;;CAG5B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;CAK3B,CAAA;AAED,eAAO,MAAM,OAAO;;;CAGnB,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;CAMxB,CAAA;AAED,eAAO,MAAM,aAAa;;;;CAA8C,CAAA;AACxE,eAAO,MAAM,oBAAoB;;;;CAAgD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACpB,KAAK,UAAU;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,cACsC,CAAA;AASnE,eAAO,MAAM,mBAAmB,SAAU,IAAI,WAuB7C,CAAA"}
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,YAAW,CAAC;AAE7B,eAAO,MAAM,gBAAgB,cACsC,CAAA;AASnE,eAAO,MAAM,mBAAmB,SAAU,IAAI,WAuB7C,CAAA"}
|
package/dist/typescript/module/{features/endOfAssignment → shared}/hooks/useKeyDownListener.d.ts
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { KeyboardKeys } from '
|
|
1
|
+
import { KeyboardKeys } from '../../lib/constants';
|
|
2
2
|
export declare const useKeyDownListener: (callback: (event: KeyboardEvent) => void, overrideKeys?: KeyboardKeys[]) => void;
|
|
3
3
|
//# sourceMappingURL=useKeyDownListener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyDownListener.d.ts","sourceRoot":"","sources":["../../../../../src/shared/hooks/useKeyDownListener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,kBAAkB,aACnB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,wCAqBzC,CAAA"}
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* - On web (default), it returns the `useKeyDownListener` hook, which allows you
|
|
8
8
|
* to register a callback that is triggered on keydown events.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useKeyBoard: (callback: (event: KeyboardEvent) => void, overrideKeys?: import("
|
|
10
|
+
export declare const useKeyBoard: (callback: (event: KeyboardEvent) => void, overrideKeys?: import("../../lib/constants").KeyboardKeys[]) => void;
|
|
11
11
|
//# sourceMappingURL=useKeyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../../../../src/shared/hooks/useKeyboard.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,iHAGtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
} from '@magmamath/react-native-ui'
|
|
12
12
|
|
|
13
13
|
import { EOAModalContentProps } from '../../types'
|
|
14
|
-
import { useKeyBoard } from '
|
|
15
|
-
import { KeyboardKeys } from '
|
|
14
|
+
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
15
|
+
import { KeyboardKeys } from '../../../../lib/constants'
|
|
16
16
|
|
|
17
17
|
export const CheatDetected = ({ textContent, model }: EOAModalContentProps) => {
|
|
18
18
|
useKeyBoard((event) => {
|
|
@@ -7,9 +7,10 @@ import { SPACING, Typography, COLORS, FONT_FAMILY } from '@magmamath/react-nativ
|
|
|
7
7
|
import { AnimatedCard } from './AnimatedCard'
|
|
8
8
|
|
|
9
9
|
import { PracticeButtonGroup } from '../../ui/PracticeButtonGroup'
|
|
10
|
-
import { GOOD_DRAWING_CARD_APPEARENCE_DELAY
|
|
10
|
+
import { GOOD_DRAWING_CARD_APPEARENCE_DELAY } from '../../constants'
|
|
11
11
|
import { AnimatedCardVariant, EOAModalContentProps, EOAModalVariant } from '../../types'
|
|
12
|
-
import { useKeyBoard } from '
|
|
12
|
+
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
13
|
+
import { KeyboardKeys } from '../../../../lib/constants'
|
|
13
14
|
|
|
14
15
|
export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
|
|
15
16
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
} from '@magmamath/react-native-ui'
|
|
12
12
|
|
|
13
13
|
import { EOAModalContentProps } from '../../types'
|
|
14
|
-
import { useKeyBoard } from '
|
|
15
|
-
import { KeyboardKeys } from '
|
|
14
|
+
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
15
|
+
import { KeyboardKeys } from '../../../../lib/constants'
|
|
16
16
|
|
|
17
17
|
export const ExamLeave = ({ textContent, model }: EOAModalContentProps) => {
|
|
18
18
|
const handleDismiss = () => model.hidePopUp()
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
} from '@magmamath/react-native-ui'
|
|
12
12
|
|
|
13
13
|
import { EOAModalContentProps } from '../../types'
|
|
14
|
-
import { useKeyBoard } from '
|
|
15
|
-
import { KeyboardKeys } from '
|
|
14
|
+
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
15
|
+
import { KeyboardKeys } from '../../../../lib/constants'
|
|
16
16
|
|
|
17
17
|
export const ExamPaused = ({ textContent, model }: EOAModalContentProps) => {
|
|
18
18
|
useKeyBoard((event) => {
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
import { ExamSubmitContent } from './ExamSubmitContent'
|
|
17
17
|
import { EOAModalContentProps } from '../../types'
|
|
18
18
|
import { PracticeButton } from '../../ui/PracticeButton'
|
|
19
|
-
import { useKeyBoard } from '
|
|
20
|
-
import { KeyboardKeys } from '
|
|
19
|
+
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
20
|
+
import { KeyboardKeys } from '../../../../lib/constants'
|
|
21
21
|
|
|
22
22
|
export const ExamSubmit = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
|
|
23
23
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
import { EOAModalContentProps } from '../../types'
|
|
14
14
|
import { NoAnswerContent } from './NoAnswerContent'
|
|
15
15
|
import { PracticeButton } from '../../ui/PracticeButton'
|
|
16
|
-
import { useKeyBoard } from '
|
|
17
|
-
import { KeyboardKeys } from '
|
|
16
|
+
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
17
|
+
import { KeyboardKeys } from '../../../../lib/constants'
|
|
18
18
|
|
|
19
19
|
export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalContentProps) => {
|
|
20
20
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -24,8 +24,7 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
24
24
|
const total = stats?.problemsAmount ?? 0
|
|
25
25
|
const buttonColorScheme = isExam ? ButtonColor.YELLOW : ButtonColor.BLUE
|
|
26
26
|
|
|
27
|
-
const practiceButtonVisible =
|
|
28
|
-
!popUpData?.newerAssignmentAvailable && (!isExam || (isExam && !!user?.practiceMode))
|
|
27
|
+
const practiceButtonVisible = !isExam || !!user?.practiceMode
|
|
29
28
|
|
|
30
29
|
const handlePrimaryButtonPress = () => {
|
|
31
30
|
isExam ? onPracticePress?.() : model.goToFirstProblemPressed()
|
|
@@ -46,7 +45,7 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
46
45
|
{textContent.title}
|
|
47
46
|
</Typography>
|
|
48
47
|
)}
|
|
49
|
-
{!!textContent.subtitle && (
|
|
48
|
+
{!!textContent.subtitle && practiceButtonVisible && (
|
|
50
49
|
<Typography variant="h4" style={{ color: COLORS.NEUTRAL_7 }}>
|
|
51
50
|
{textContent.subtitle}
|
|
52
51
|
</Typography>
|
|
@@ -78,6 +77,7 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
78
77
|
|
|
79
78
|
const styles = StyleSheet.create({
|
|
80
79
|
container: {
|
|
80
|
+
flex: 1,
|
|
81
81
|
gap: SPACING[400],
|
|
82
82
|
alignItems: 'center',
|
|
83
83
|
},
|
|
@@ -5,10 +5,6 @@ import { AnimatedCardVariant, EOAModalVariant } from './types'
|
|
|
5
5
|
export const SPARKS_ANIMATION_DELAY = 2000
|
|
6
6
|
export const GOOD_DRAWING_CARD_APPEARENCE_DELAY = 1800
|
|
7
7
|
|
|
8
|
-
export enum KeyboardKeys {
|
|
9
|
-
ENTER = 'Enter',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
8
|
export const MODALS_WITH_BACKGROUND = [
|
|
13
9
|
EOAModalVariant.HAS_CORRECT_ANSWERS,
|
|
14
10
|
EOAModalVariant.HAS_GOOD_DRAWING,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
|
-
import { useKeyDownListener } from './useKeyDownListener';
|
|
3
|
-
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
import { useKeyDownListener } from './useKeyDownListener';
|
|
4
|
+
import { noop } from '../../lib/helpers/helpers';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* A cross-platform hook for handling keyboard events.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_constants","useKeyDownListener","callback","overrideKeys","KeyboardKeys","ENTER","callbackRef","useRef","current","useEffect","eventHandler","event","includes","key","preventDefault","stopPropagation","document","addEventListener","removeEventListener","exports"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/hooks/useKeyDownListener.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,kBAAkB,GAAGA,CAChCC,QAAwC,EACxCC,YAAY,GAAG,CAACC,uBAAY,CAACC,KAAK,CAAC,KAChC;EACH,MAAMC,WAAW,GAAG,IAAAC,aAAM,EAACL,QAAQ,CAAC;EACpCI,WAAW,CAACE,OAAO,GAAGN,QAAQ;EAE9B,IAAAO,gBAAS,EAAC,MAAM;IACd,MAAMC,YAAY,GAAIC,KAAoB,IAAK;MAC7C,IAAIR,YAAY,CAACS,QAAQ,CAACD,KAAK,CAACE,GAAmB,CAAC,EAAE;QACpDF,KAAK,CAACG,cAAc,CAAC,CAAC;QACtBH,KAAK,CAACI,eAAe,CAAC,CAAC;MACzB;MAEAT,WAAW,CAACE,OAAO,CAACG,KAAK,CAAC;IAC5B,CAAC;IAEDK,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEP,YAAY,EAAE,IAAI,CAAC;IACxD,OAAO,MAAM;MACXM,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAER,YAAY,EAAE,IAAI,CAAC;IAC7D,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAAAS,OAAA,CAAAlB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_useKeyDownListener","noop","useKeyBoard","exports","Platform","select","native","default","useKeyDownListener"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/hooks/useKeyboard.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAGA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,qBAAQ,CAACC,MAAM,CAAC;EACzCC,MAAM,EAAEL,IAAI;EACZM,OAAO,EAAEC;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","KeyboardKeys","useKeyDownListener","callback","overrideKeys","ENTER","callbackRef","current","eventHandler","event","includes","key","preventDefault","stopPropagation","document","addEventListener","removeEventListener"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/hooks/useKeyDownListener.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,YAAY,QAAQ,iBAAc;AAE3C,OAAO,MAAMC,kBAAkB,GAAGA,CAChCC,QAAwC,EACxCC,YAAY,GAAG,CAACH,YAAY,CAACI,KAAK,CAAC,KAChC;EACH,MAAMC,WAAW,GAAGN,MAAM,CAACG,QAAQ,CAAC;EACpCG,WAAW,CAACC,OAAO,GAAGJ,QAAQ;EAE9BJ,SAAS,CAAC,MAAM;IACd,MAAMS,YAAY,GAAIC,KAAoB,IAAK;MAC7C,IAAIL,YAAY,CAACM,QAAQ,CAACD,KAAK,CAACE,GAAmB,CAAC,EAAE;QACpDF,KAAK,CAACG,cAAc,CAAC,CAAC;QACtBH,KAAK,CAACI,eAAe,CAAC,CAAC;MACzB;MAEAP,WAAW,CAACC,OAAO,CAACE,KAAK,CAAC;IAC5B,CAAC;IAEDK,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEP,YAAY,EAAE,IAAI,CAAC;IACxD,OAAO,MAAM;MACXM,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAER,YAAY,EAAE,IAAI,CAAC;IAC7D,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","useKeyDownListener","noop","useKeyBoard","select","native","default"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/hooks/useKeyboard.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,kBAAkB,QAAQ,yBAAsB;AAGzD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGH,QAAQ,CAACI,MAAM,CAAC;EACzCC,MAAM,EAAEH,IAAI;EACZI,OAAO,EAAEL;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyDownListener.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/hooks/useKeyDownListener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,eAAO,MAAM,kBAAkB,aACnB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,wCAqBzC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/hooks/useKeyboard.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,0GAGtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyDownListener.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/hooks/useKeyDownListener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,eAAO,MAAM,kBAAkB,aACnB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,wCAqBzC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/hooks/useKeyboard.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,0GAGtB,CAAC"}
|