@magmamath/students-features 0.6.7-rc.2 → 0.6.7-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js +0 -1
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js.map +1 -1
- package/dist/commonjs/features/gifCelebrations/GifCelebrations.js +62 -0
- package/dist/commonjs/features/gifCelebrations/GifCelebrations.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/assets/confetti.webp +0 -0
- package/dist/commonjs/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/dist/commonjs/features/gifCelebrations/components/Backdrop.js +44 -0
- package/dist/commonjs/features/gifCelebrations/components/Backdrop.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/ContentContainer.js +46 -0
- package/dist/commonjs/features/gifCelebrations/components/ContentContainer.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/Gif.js +90 -0
- package/dist/commonjs/features/gifCelebrations/components/Gif.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/Progress.js +96 -0
- package/dist/commonjs/features/gifCelebrations/components/Progress.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/constants.js +34 -0
- package/dist/commonjs/features/gifCelebrations/constants.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/helpers.js +114 -0
- package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/index.js +20 -0
- package/dist/commonjs/features/gifCelebrations/index.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.cache.js +30 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.cache.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.model.js +138 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.model.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsApi.js +27 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsApi.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/types/model.types.js +6 -0
- package/dist/commonjs/features/gifCelebrations/types/model.types.js.map +1 -0
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/effector/createControllerEffect.js.map +1 -1
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
- package/dist/commonjs/react-app-env.d.js +2 -0
- package/dist/commonjs/react-app-env.d.js.map +1 -0
- package/dist/commonjs/shared/translation/localization/en.json +5 -0
- package/dist/commonjs/shared/translation/localization/gb.json +5 -0
- package/dist/commonjs/shared/translation/localization/sw.json +5 -0
- package/dist/commonjs/types/common.types.js +2 -0
- package/dist/commonjs/types/common.types.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js +1 -2
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js.map +1 -1
- package/dist/module/features/gifCelebrations/GifCelebrations.js +55 -0
- package/dist/module/features/gifCelebrations/GifCelebrations.js.map +1 -0
- package/dist/module/features/gifCelebrations/assets/confetti.webp +0 -0
- package/dist/module/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/dist/module/features/gifCelebrations/components/Backdrop.js +36 -0
- package/dist/module/features/gifCelebrations/components/Backdrop.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/ContentContainer.js +38 -0
- package/dist/module/features/gifCelebrations/components/ContentContainer.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/Gif.js +82 -0
- package/dist/module/features/gifCelebrations/components/Gif.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/Progress.js +88 -0
- package/dist/module/features/gifCelebrations/components/Progress.js.map +1 -0
- package/dist/module/features/gifCelebrations/constants.js +30 -0
- package/dist/module/features/gifCelebrations/constants.js.map +1 -0
- package/dist/module/features/gifCelebrations/helpers.js +103 -0
- package/dist/module/features/gifCelebrations/helpers.js.map +1 -0
- package/dist/module/features/gifCelebrations/index.js +5 -0
- package/dist/module/features/gifCelebrations/index.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrations.cache.js +25 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrations.cache.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrations.model.js +133 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrations.model.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsApi.js +22 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsApi.js.map +1 -0
- package/dist/module/features/gifCelebrations/types/model.types.js +4 -0
- package/dist/module/features/gifCelebrations/types/model.types.js.map +1 -0
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/effector/createControllerEffect.js.map +1 -1
- package/dist/module/react-app-env.d.js +2 -0
- package/dist/module/react-app-env.d.js.map +1 -0
- package/dist/module/shared/translation/localization/en.json +5 -0
- package/dist/module/shared/translation/localization/gb.json +5 -0
- package/dist/module/shared/translation/localization/sw.json +5 -0
- package/dist/module/types/common.types.js +2 -0
- package/dist/module/types/common.types.js.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/gifCelebrations/GifCelebrations.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/GifCelebrations.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Backdrop.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Backdrop.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/ContentContainer.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/ContentContainer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Gif.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Gif.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Progress.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Progress.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/constants.d.ts +26 -0
- package/dist/typescript/commonjs/features/gifCelebrations/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts +29 -0
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/index.d.ts +3 -0
- package/dist/typescript/commonjs/features/gifCelebrations/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.cache.d.ts +18 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.cache.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.model.d.ts +25 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsApi.d.ts +7 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/types/model.types.d.ts +45 -0
- package/dist/typescript/commonjs/features/gifCelebrations/types/model.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts +1 -1
- package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +15 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +10 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/types/common.types.d.ts +5 -0
- package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -1
- package/dist/typescript/module/features/gifCelebrations/GifCelebrations.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/GifCelebrations.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Backdrop.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Backdrop.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/ContentContainer.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/ContentContainer.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Gif.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Gif.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Progress.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Progress.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/constants.d.ts +26 -0
- package/dist/typescript/module/features/gifCelebrations/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts +29 -0
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/index.d.ts +3 -0
- package/dist/typescript/module/features/gifCelebrations/index.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.cache.d.ts +18 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.cache.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.model.d.ts +25 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.model.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsApi.d.ts +7 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsApi.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/types/model.types.d.ts +45 -0
- package/dist/typescript/module/features/gifCelebrations/types/model.types.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/lib/effector/createControllerEffect.d.ts +1 -1
- package/dist/typescript/module/lib/effector/createControllerEffect.d.ts.map +1 -1
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/constants.d.ts +15 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +10 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/types/common.types.d.ts +5 -0
- package/dist/typescript/module/types/common.types.d.ts.map +1 -0
- package/package.json +3 -5
- package/src/features/endOfAssignment/components/Modal/Modal.tsx +1 -2
- package/src/features/gifCelebrations/GifCelebrations.tsx +75 -0
- package/src/features/gifCelebrations/assets/confetti.webp +0 -0
- package/src/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/src/features/gifCelebrations/components/Backdrop.tsx +41 -0
- package/src/features/gifCelebrations/components/ContentContainer.tsx +44 -0
- package/src/features/gifCelebrations/components/Gif.tsx +88 -0
- package/src/features/gifCelebrations/components/Progress.tsx +106 -0
- package/src/features/gifCelebrations/constants.ts +32 -0
- package/src/features/gifCelebrations/helpers.ts +144 -0
- package/src/features/gifCelebrations/index.ts +2 -0
- package/src/features/gifCelebrations/model/GifCelebrations.cache.ts +41 -0
- package/src/features/gifCelebrations/model/GifCelebrations.model.ts +177 -0
- package/src/features/gifCelebrations/model/GifCelebrationsApi.ts +26 -0
- package/src/features/gifCelebrations/types/model.types.ts +53 -0
- package/src/index.ts +1 -0
- package/src/lib/effector/createControllerEffect.ts +41 -41
- package/src/lib/helpers/helpers.ts +1 -1
- package/src/react-app-env.d.ts +6 -0
- package/src/shared/translation/localization/en.json +5 -0
- package/src/shared/translation/localization/gb.json +5 -0
- package/src/shared/translation/localization/sw.json +5 -0
- package/src/types/common.types.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA"}
|
|
@@ -11,6 +11,6 @@ type RequestOptionalConfig = {
|
|
|
11
11
|
signal?: AbortSignal;
|
|
12
12
|
};
|
|
13
13
|
export declare function controlledRequest<R = void, P = void>(request: (props: P, config?: RequestOptionalConfig) => Promise<R>): ({ data, controller, abortAfter, }: ControlledRequestProps<P>) => Promise<R>;
|
|
14
|
-
export declare const createControllerEffect: <T, P>(fn: (props: P, config?: RequestOptionalConfig) => Promise<T>) => ControlledEffect<P, T>;
|
|
14
|
+
export declare const createControllerEffect: <T, P = void>(fn: (props: P, config?: RequestOptionalConfig) => Promise<T>) => ControlledEffect<P, T>;
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=createControllerEffect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createControllerEffect.d.ts","sourceRoot":"","sources":["../../../../../src/lib/effector/createControllerEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAMpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"createControllerEffect.d.ts","sourceRoot":"","sources":["../../../../../src/lib/effector/createControllerEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAMpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAClD,UAAU,EAAE,eAAe,CAAA;CAC5B,CAAA;AAED,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC/B,IAAI,EAAE,CAAC,CAAA;IACP,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,qBAAqB,GAAG;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA;AAErD,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAClD,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,uCAM9D,sBAAsB,CAAC,CAAC,CAAC,gBAwB7B;AAED,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAE,CAAC,aACrC,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,2BAa7D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,YAAW,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/lib/helpers/helpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,YAAW,CAAA;AAE5B,eAAO,MAAM,gBAAgB,cACsC,CAAA;AASnE,eAAO,MAAM,mBAAmB,SAAU,IAAI,WAuB7C,CAAA"}
|
|
@@ -20,6 +20,11 @@ export declare const LOCALIZATION_CONFIGS: {
|
|
|
20
20
|
howCanIHelp: string;
|
|
21
21
|
showError: string;
|
|
22
22
|
};
|
|
23
|
+
gifCelebrations: {
|
|
24
|
+
greatStart: string;
|
|
25
|
+
onTheWay: string;
|
|
26
|
+
almostThere: string;
|
|
27
|
+
};
|
|
23
28
|
};
|
|
24
29
|
"en-GB": {
|
|
25
30
|
"teacherFeedback.noComments": string;
|
|
@@ -42,6 +47,11 @@ export declare const LOCALIZATION_CONFIGS: {
|
|
|
42
47
|
howCanIHelp: string;
|
|
43
48
|
showError: string;
|
|
44
49
|
};
|
|
50
|
+
gifCelebrations: {
|
|
51
|
+
greatStart: string;
|
|
52
|
+
onTheWay: string;
|
|
53
|
+
almostThere: string;
|
|
54
|
+
};
|
|
45
55
|
};
|
|
46
56
|
"sv-SE": {
|
|
47
57
|
"teacherFeedback.noComments": string;
|
|
@@ -64,6 +74,11 @@ export declare const LOCALIZATION_CONFIGS: {
|
|
|
64
74
|
howCanIHelp: string;
|
|
65
75
|
showError: string;
|
|
66
76
|
};
|
|
77
|
+
gifCelebrations: {
|
|
78
|
+
greatStart: string;
|
|
79
|
+
onTheWay: string;
|
|
80
|
+
almostThere: string;
|
|
81
|
+
};
|
|
67
82
|
};
|
|
68
83
|
};
|
|
69
84
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhC,CAAA"}
|
|
@@ -21,6 +21,11 @@ export declare const setLocalization: import("effector").EventCallable<{
|
|
|
21
21
|
howCanIHelp: string;
|
|
22
22
|
showError: string;
|
|
23
23
|
};
|
|
24
|
+
gifCelebrations: {
|
|
25
|
+
greatStart: string;
|
|
26
|
+
onTheWay: string;
|
|
27
|
+
almostThere: string;
|
|
28
|
+
};
|
|
24
29
|
} | ((config: typeof LOCALIZATION_CONFIGS) => Translations)>;
|
|
25
30
|
export declare const $localization: import("effector").StoreWritable<{
|
|
26
31
|
"teacherFeedback.noComments": string;
|
|
@@ -43,5 +48,10 @@ export declare const $localization: import("effector").StoreWritable<{
|
|
|
43
48
|
howCanIHelp: string;
|
|
44
49
|
showError: string;
|
|
45
50
|
};
|
|
51
|
+
gifCelebrations: {
|
|
52
|
+
greatStart: string;
|
|
53
|
+
onTheWay: string;
|
|
54
|
+
almostThere: string;
|
|
55
|
+
};
|
|
46
56
|
}>;
|
|
47
57
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;cACD,OAAO,oBAAoB,KAAK,YAAY,EACpE,CAAA;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;EAMzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../../../src/types/common.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "0.6.7-rc.
|
|
3
|
+
"version": "0.6.7-rc.4",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -17,11 +17,9 @@
|
|
|
17
17
|
"prepare": "bob build",
|
|
18
18
|
"release": "release-it"
|
|
19
19
|
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"effector": "^23.2.3",
|
|
22
|
-
"effector-react": "^23.2.1"
|
|
23
|
-
},
|
|
24
20
|
"peerDependencies": {
|
|
21
|
+
"effector": "^23.2.3",
|
|
22
|
+
"effector-react": "^23.2.1",
|
|
25
23
|
"@magmamath/react-native-ui": "*",
|
|
26
24
|
"react": "*",
|
|
27
25
|
"react-native": "*",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode, useEffect, useState } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
Animated,
|
|
4
|
-
GestureResponderEvent,
|
|
4
|
+
GestureResponderEvent,
|
|
5
5
|
StyleProp,
|
|
6
6
|
StyleSheet,
|
|
7
7
|
TextStyle,
|
|
@@ -62,7 +62,6 @@ export const Modal = ({
|
|
|
62
62
|
useEffect(() => {
|
|
63
63
|
if (isVisible) {
|
|
64
64
|
modalModel.animation.show()
|
|
65
|
-
Keyboard.dismiss()
|
|
66
65
|
}
|
|
67
66
|
}, [isVisible])
|
|
68
67
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import { Gif } from './components/Gif'
|
|
3
|
+
import { Progress } from './components/Progress'
|
|
4
|
+
import { ContentContainer } from './components/ContentContainer'
|
|
5
|
+
import { Backdrop } from './components/Backdrop'
|
|
6
|
+
import { Easing, runOnJS, useSharedValue, withSequence, withTiming } from 'react-native-reanimated'
|
|
7
|
+
import { useUnit } from 'effector-react'
|
|
8
|
+
import { ANIMATION_DURATION } from './constants'
|
|
9
|
+
import { GifCelebrationsModel } from './model/GifCelebrations.model'
|
|
10
|
+
import { ProgressValue, TextComponentType } from './types/model.types'
|
|
11
|
+
|
|
12
|
+
type GifCelebrationsProps = {
|
|
13
|
+
model: GifCelebrationsModel
|
|
14
|
+
TextComponent: TextComponentType
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const GifCelebrations = ({ model, TextComponent }: GifCelebrationsProps) => {
|
|
18
|
+
const [problemsAmount, resolvedProblemsAmount, activeGif] = useUnit([
|
|
19
|
+
model.$problemsAmount,
|
|
20
|
+
model.$resolvedProblemsAmount,
|
|
21
|
+
model.$activeGif,
|
|
22
|
+
])
|
|
23
|
+
|
|
24
|
+
const completedPercent =
|
|
25
|
+
resolvedProblemsAmount &&
|
|
26
|
+
problemsAmount &&
|
|
27
|
+
Math.round((resolvedProblemsAmount / problemsAmount) * 100)
|
|
28
|
+
|
|
29
|
+
const progress = useSharedValue<ProgressValue>(0)
|
|
30
|
+
|
|
31
|
+
const stopAnimation = () => {
|
|
32
|
+
model.stop()
|
|
33
|
+
progress.value = 0
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const playAnimation = () => {
|
|
37
|
+
progress.value = withSequence(
|
|
38
|
+
withTiming(1, {
|
|
39
|
+
duration: ANIMATION_DURATION,
|
|
40
|
+
easing: Easing.bezier(0.52, 0.16, 0.26, 0.77),
|
|
41
|
+
}),
|
|
42
|
+
withTiming(
|
|
43
|
+
2,
|
|
44
|
+
{
|
|
45
|
+
duration: ANIMATION_DURATION,
|
|
46
|
+
easing: Easing.bezier(0.71, 0.09, 0.49, 0.89),
|
|
47
|
+
},
|
|
48
|
+
() => runOnJS(stopAnimation)(),
|
|
49
|
+
),
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (activeGif) {
|
|
55
|
+
playAnimation()
|
|
56
|
+
}
|
|
57
|
+
}, [activeGif])
|
|
58
|
+
|
|
59
|
+
if (!activeGif) {
|
|
60
|
+
return null
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<Backdrop progress={progress}>
|
|
65
|
+
<ContentContainer progress={progress}>
|
|
66
|
+
<Gif
|
|
67
|
+
gifObject={activeGif}
|
|
68
|
+
getCachePathMethod={model.cache.getCachePathMethod}
|
|
69
|
+
TextComponent={TextComponent}
|
|
70
|
+
/>
|
|
71
|
+
<Progress progress={progress} completedPercent={completedPercent} />
|
|
72
|
+
</ContentContainer>
|
|
73
|
+
</Backdrop>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { StyleSheet, useWindowDimensions } from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import Animated, { useAnimatedStyle, interpolateColor, SharedValue } from 'react-native-reanimated'
|
|
4
|
+
import { BACKDROP_COLOR } from '../constants'
|
|
5
|
+
import { ProgressValue } from '../types/model.types'
|
|
6
|
+
|
|
7
|
+
type BackdropProps = {
|
|
8
|
+
children: React.ReactNode
|
|
9
|
+
progress: SharedValue<ProgressValue>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Backdrop = ({ children, progress }: BackdropProps) => {
|
|
13
|
+
const { width, height } = useWindowDimensions()
|
|
14
|
+
|
|
15
|
+
const backdropAnimatedStyle = useAnimatedStyle(
|
|
16
|
+
() => ({
|
|
17
|
+
backgroundColor: interpolateColor(
|
|
18
|
+
progress.value,
|
|
19
|
+
[0, 1, 2],
|
|
20
|
+
[BACKDROP_COLOR.INITIAL, BACKDROP_COLOR.FINAL, BACKDROP_COLOR.INITIAL],
|
|
21
|
+
),
|
|
22
|
+
}),
|
|
23
|
+
[progress],
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Animated.View style={[styles.backdrop, { width, height }, backdropAnimatedStyle]}>
|
|
28
|
+
{children}
|
|
29
|
+
</Animated.View>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const styles = StyleSheet.create({
|
|
34
|
+
backdrop: {
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
zIndex: 10100,
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
backgroundColor: 'rgba(51, 51, 51, 0.33);',
|
|
40
|
+
},
|
|
41
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { StyleSheet, useWindowDimensions } from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { SPACING } from '@magmamath/react-native-ui'
|
|
4
|
+
import Animated, { useAnimatedStyle, interpolate, SharedValue } from 'react-native-reanimated'
|
|
5
|
+
import { CONTENT_CONTAINER } from '../constants'
|
|
6
|
+
import { ProgressValue } from '../types/model.types'
|
|
7
|
+
|
|
8
|
+
type ContentContainerProps = {
|
|
9
|
+
children: React.ReactNode
|
|
10
|
+
progress: SharedValue<ProgressValue>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ContentContainer = ({ children, progress }: ContentContainerProps) => {
|
|
14
|
+
const { width } = useWindowDimensions()
|
|
15
|
+
|
|
16
|
+
const RIGHT_POSITION =
|
|
17
|
+
width / 2 + CONTENT_CONTAINER.CONTAINER_WIDTH / 2 + CONTENT_CONTAINER.ROTATION_PADDING
|
|
18
|
+
const LEFT_POSITION = -RIGHT_POSITION - CONTENT_CONTAINER.ROTATION_PADDING
|
|
19
|
+
|
|
20
|
+
const animatedStyles = useAnimatedStyle(
|
|
21
|
+
() => ({
|
|
22
|
+
transform: [
|
|
23
|
+
{
|
|
24
|
+
translateX: interpolate(progress.value, [0, 1, 2], [LEFT_POSITION, 0, RIGHT_POSITION]),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
rotate: `${interpolate(progress.value, [0, 1, 2], [-CONTENT_CONTAINER.ANGLE, 0, CONTENT_CONTAINER.ANGLE])}deg`,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
}),
|
|
31
|
+
[progress, RIGHT_POSITION, LEFT_POSITION],
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
return <Animated.View style={[styles.container, animatedStyles]}>{children}</Animated.View>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
container: {
|
|
39
|
+
width: CONTENT_CONTAINER.CONTAINER_WIDTH,
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
gap: SPACING[800],
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
},
|
|
44
|
+
})
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { StyleSheet, View, Image } from 'react-native'
|
|
2
|
+
import React, { useLayoutEffect, useState } from 'react'
|
|
3
|
+
import { BORDER_RADIUS, COLORS, IS_WEB, SPACING } from '@magmamath/react-native-ui'
|
|
4
|
+
import { CustomGetCachePathMethod, GifObject, TextComponentType } from '../types/model.types'
|
|
5
|
+
import { MAX_GIF_SIZE, MIN_GIF_SIZE } from '../constants'
|
|
6
|
+
import { useText } from '../../../shared/translation'
|
|
7
|
+
import { constrainDimension, getGifLabel, getImagePath } from '../helpers'
|
|
8
|
+
import gifFallback from '../assets/gifFallback.gif'
|
|
9
|
+
import { Size } from '../../../types/common.types'
|
|
10
|
+
|
|
11
|
+
type GifProps = {
|
|
12
|
+
gifObject: GifObject
|
|
13
|
+
getCachePathMethod?: CustomGetCachePathMethod
|
|
14
|
+
TextComponent: TextComponentType
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Gif = ({ gifObject, getCachePathMethod, TextComponent }: GifProps) => {
|
|
18
|
+
const [size, setSize] = useState<Size | null>(null)
|
|
19
|
+
const [pathOrUri, setPathOrUri] = useState('')
|
|
20
|
+
|
|
21
|
+
const t = useText()
|
|
22
|
+
|
|
23
|
+
const gifGroupNumber = Number(gifObject.group.replace('group', ''))
|
|
24
|
+
const gifLabel = getGifLabel(gifGroupNumber)
|
|
25
|
+
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
const loadImageSize = async () => {
|
|
28
|
+
let localPath
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
localPath = await getImagePath(gifObject.url, getCachePathMethod)
|
|
32
|
+
} catch (error) {
|
|
33
|
+
localPath = IS_WEB ? gifFallback : Image.resolveAssetSource(gifFallback).uri
|
|
34
|
+
console.error('Error fetching image from cache:', error)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Image.getSize(localPath, (width, height) => {
|
|
38
|
+
setSize({
|
|
39
|
+
width: constrainDimension(width, MIN_GIF_SIZE, MAX_GIF_SIZE.WIDTH),
|
|
40
|
+
height: constrainDimension(height, MIN_GIF_SIZE, MAX_GIF_SIZE.HEIGHT),
|
|
41
|
+
})
|
|
42
|
+
setPathOrUri(localPath)
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
loadImageSize()
|
|
47
|
+
}, [gifObject.url])
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<View style={styles.backgroundContainer}>
|
|
51
|
+
<View style={styles.container}>
|
|
52
|
+
{size && pathOrUri && (
|
|
53
|
+
<Image
|
|
54
|
+
alt="Funny celebration animated image"
|
|
55
|
+
source={{
|
|
56
|
+
uri: pathOrUri,
|
|
57
|
+
}}
|
|
58
|
+
width={size.width}
|
|
59
|
+
height={size.height}
|
|
60
|
+
style={[styles.image, { width: size.width, height: size.height }]} //this sizes duplication is needed for compatibility with web and rn
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
63
|
+
<View style={styles.textContainer}>{TextComponent(t(gifLabel))}</View>
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const styles = StyleSheet.create({
|
|
70
|
+
backgroundContainer: {
|
|
71
|
+
backgroundColor: 'rgba(255, 255, 255, 0.6)',
|
|
72
|
+
borderRadius: 23,
|
|
73
|
+
padding: SPACING[200],
|
|
74
|
+
},
|
|
75
|
+
container: {
|
|
76
|
+
padding: SPACING[1600],
|
|
77
|
+
borderRadius: BORDER_RADIUS[400],
|
|
78
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
79
|
+
},
|
|
80
|
+
image: {
|
|
81
|
+
borderRadius: BORDER_RADIUS[100],
|
|
82
|
+
},
|
|
83
|
+
textContainer: {
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
bottom: 74,
|
|
86
|
+
alignSelf: 'center',
|
|
87
|
+
},
|
|
88
|
+
})
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { StyleSheet, View, Image } from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import {
|
|
4
|
+
BORDER_RADIUS,
|
|
5
|
+
COLORS,
|
|
6
|
+
HeadingVariants,
|
|
7
|
+
IS_WEB,
|
|
8
|
+
SPACING,
|
|
9
|
+
Typography,
|
|
10
|
+
} from '@magmamath/react-native-ui'
|
|
11
|
+
import Animated, { useAnimatedStyle, SharedValue, interpolate } from 'react-native-reanimated'
|
|
12
|
+
import confettiImage from '../assets/confetti.webp'
|
|
13
|
+
import { ProgressValue } from '../types/model.types'
|
|
14
|
+
import { getProgressLineWidth } from '../helpers'
|
|
15
|
+
|
|
16
|
+
type ProgressProps = {
|
|
17
|
+
progress: SharedValue<ProgressValue>
|
|
18
|
+
completedPercent: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Progress = ({ progress, completedPercent }: ProgressProps) => {
|
|
22
|
+
const progressLineWidth = getProgressLineWidth(completedPercent)
|
|
23
|
+
|
|
24
|
+
const animatedStyles = useAnimatedStyle(
|
|
25
|
+
() => ({
|
|
26
|
+
width: `${interpolate(
|
|
27
|
+
progress.value,
|
|
28
|
+
[0, 1, 2],
|
|
29
|
+
[0, progressLineWidth, progressLineWidth],
|
|
30
|
+
)}%`,
|
|
31
|
+
}),
|
|
32
|
+
[progress, progressLineWidth],
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<View style={styles.backgroundContainer}>
|
|
37
|
+
<View style={styles.container}>
|
|
38
|
+
<View style={styles.progressContainer}>
|
|
39
|
+
<Animated.View style={[styles.progress, animatedStyles]}>
|
|
40
|
+
<Typography variant={HeadingVariants.H1} style={styles.percent}>
|
|
41
|
+
{`${completedPercent}%`}
|
|
42
|
+
</Typography>
|
|
43
|
+
</Animated.View>
|
|
44
|
+
</View>
|
|
45
|
+
<Image
|
|
46
|
+
source={
|
|
47
|
+
IS_WEB
|
|
48
|
+
? {
|
|
49
|
+
uri: confettiImage,
|
|
50
|
+
}
|
|
51
|
+
: require('../assets/confetti.webp')
|
|
52
|
+
}
|
|
53
|
+
style={styles.confetti}
|
|
54
|
+
/>
|
|
55
|
+
</View>
|
|
56
|
+
</View>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const styles = StyleSheet.create({
|
|
61
|
+
backgroundContainer: {
|
|
62
|
+
backgroundColor: 'rgba(255, 255, 255, 0.6)',
|
|
63
|
+
borderRadius: 23,
|
|
64
|
+
padding: SPACING[200],
|
|
65
|
+
width: '100%',
|
|
66
|
+
},
|
|
67
|
+
container: {
|
|
68
|
+
width: '100%',
|
|
69
|
+
height: 116,
|
|
70
|
+
flexDirection: 'row',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
borderRadius: BORDER_RADIUS[400],
|
|
73
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
74
|
+
paddingLeft: SPACING[400],
|
|
75
|
+
paddingRight: SPACING[200],
|
|
76
|
+
gap: SPACING[100],
|
|
77
|
+
},
|
|
78
|
+
progressContainer: {
|
|
79
|
+
height: 50,
|
|
80
|
+
flexGrow: 1,
|
|
81
|
+
backgroundColor: COLORS.NEUTRAL_5,
|
|
82
|
+
borderRadius: 90,
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
},
|
|
85
|
+
progress: {
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
height: '100%',
|
|
88
|
+
backgroundColor: COLORS.PRIMARY_BLUE,
|
|
89
|
+
borderRadius: BORDER_RADIUS[200],
|
|
90
|
+
justifyContent: 'center',
|
|
91
|
+
alignItems: 'flex-end',
|
|
92
|
+
paddingRight: 10.6,
|
|
93
|
+
overflow: 'hidden',
|
|
94
|
+
},
|
|
95
|
+
confetti: {
|
|
96
|
+
width: 75,
|
|
97
|
+
height: 70,
|
|
98
|
+
marginHorizontal: SPACING[200],
|
|
99
|
+
},
|
|
100
|
+
percent: {
|
|
101
|
+
position: 'absolute',
|
|
102
|
+
paddingRight: 10,
|
|
103
|
+
color: COLORS.NEUTRAL_1,
|
|
104
|
+
fontWeight: '700',
|
|
105
|
+
},
|
|
106
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const BACKDROP_COLOR = {
|
|
2
|
+
INITIAL: 'rgba(51, 51, 51, 0)',
|
|
3
|
+
FINAL: 'rgba(51, 51, 51, 0.66)',
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const CONTENT_CONTAINER = {
|
|
7
|
+
ANGLE: 5,
|
|
8
|
+
CONTAINER_WIDTH: 769,
|
|
9
|
+
ROTATION_PADDING: 44, // to be sure that the content is not cut off on the edges because of rotate transform
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ANIMATION_DURATION = 1750
|
|
13
|
+
export const MIN_PROBLEMS_TO_SHOW_GIF = 7
|
|
14
|
+
|
|
15
|
+
export const MAX_GIF_SIZE = {
|
|
16
|
+
WIDTH: 480,
|
|
17
|
+
HEIGHT: 300,
|
|
18
|
+
}
|
|
19
|
+
export const MIN_GIF_SIZE = 300
|
|
20
|
+
|
|
21
|
+
export const GROUPS_PERCENTAGES = {
|
|
22
|
+
group1: [15, 20, 25, 30], // Early celebrations
|
|
23
|
+
group2: [33, 40, 45, 50], // Mid celebrations
|
|
24
|
+
group3: [60, 66, 75, 80], // Party
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const MIN_WIDTH_FOR_ONE_DIGIT = 12
|
|
28
|
+
export const MIN_WIDTH_FOR_TWO_DIGITS = 15
|
|
29
|
+
|
|
30
|
+
export const GET_GIFS_TIMEOUT = 5000
|
|
31
|
+
|
|
32
|
+
export const GIFS_FETCHED_KEY = 'gifsFetchedTimestamp'
|