@magmamath/students-features 1.8.0 → 1.8.1-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.
Files changed (113) hide show
  1. package/dist/commonjs/index.js +10 -22
  2. package/dist/commonjs/index.js.map +1 -1
  3. package/dist/module/index.js +0 -1
  4. package/dist/module/index.js.map +1 -1
  5. package/dist/typescript/commonjs/index.d.ts +0 -1
  6. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  7. package/dist/typescript/module/index.d.ts +0 -1
  8. package/dist/typescript/module/index.d.ts.map +1 -1
  9. package/package.json +1 -1
  10. package/src/i18n/.generated/schema.json +11 -13
  11. package/src/index.ts +0 -1
  12. package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +0 -29
  13. package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +0 -1
  14. package/dist/commonjs/features/exampleSolution/assets/grid.webp +0 -0
  15. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +0 -97
  16. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +0 -1
  17. package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +0 -70
  18. package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +0 -1
  19. package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +0 -104
  20. package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +0 -1
  21. package/dist/commonjs/features/exampleSolution/constants.js +0 -13
  22. package/dist/commonjs/features/exampleSolution/constants.js.map +0 -1
  23. package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js +0 -61
  24. package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js.map +0 -1
  25. package/dist/commonjs/features/exampleSolution/index.js +0 -39
  26. package/dist/commonjs/features/exampleSolution/index.js.map +0 -1
  27. package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +0 -24
  28. package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +0 -1
  29. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +0 -28
  30. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +0 -1
  31. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js +0 -18
  32. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js.map +0 -1
  33. package/dist/commonjs/features/exampleSolution/types.js +0 -6
  34. package/dist/commonjs/features/exampleSolution/types.js.map +0 -1
  35. package/dist/module/features/exampleSolution/ExampleSolutionModal.js +0 -23
  36. package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +0 -1
  37. package/dist/module/features/exampleSolution/assets/grid.webp +0 -0
  38. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +0 -91
  39. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +0 -1
  40. package/dist/module/features/exampleSolution/components/QuestionSection.js +0 -62
  41. package/dist/module/features/exampleSolution/components/QuestionSection.js.map +0 -1
  42. package/dist/module/features/exampleSolution/components/SolutionSection.js +0 -96
  43. package/dist/module/features/exampleSolution/components/SolutionSection.js.map +0 -1
  44. package/dist/module/features/exampleSolution/constants.js +0 -9
  45. package/dist/module/features/exampleSolution/constants.js.map +0 -1
  46. package/dist/module/features/exampleSolution/hooks/useExampleSolution.js +0 -56
  47. package/dist/module/features/exampleSolution/hooks/useExampleSolution.js.map +0 -1
  48. package/dist/module/features/exampleSolution/index.js +0 -6
  49. package/dist/module/features/exampleSolution/index.js.map +0 -1
  50. package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +0 -19
  51. package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +0 -1
  52. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +0 -23
  53. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +0 -1
  54. package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js +0 -13
  55. package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js.map +0 -1
  56. package/dist/module/features/exampleSolution/types.js +0 -4
  57. package/dist/module/features/exampleSolution/types.js.map +0 -1
  58. package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts +0 -11
  59. package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +0 -1
  60. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +0 -8
  61. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +0 -1
  62. package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +0 -10
  63. package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +0 -1
  64. package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts +0 -9
  65. package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +0 -1
  66. package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts +0 -6
  67. package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts.map +0 -1
  68. package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts +0 -9
  69. package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts.map +0 -1
  70. package/dist/typescript/commonjs/features/exampleSolution/index.d.ts +0 -4
  71. package/dist/typescript/commonjs/features/exampleSolution/index.d.ts.map +0 -1
  72. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +0 -10
  73. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +0 -1
  74. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts +0 -13
  75. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +0 -1
  76. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts +0 -11
  77. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +0 -1
  78. package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +0 -27
  79. package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +0 -1
  80. package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts +0 -11
  81. package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +0 -1
  82. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +0 -8
  83. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +0 -1
  84. package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +0 -10
  85. package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +0 -1
  86. package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts +0 -9
  87. package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +0 -1
  88. package/dist/typescript/module/features/exampleSolution/constants.d.ts +0 -6
  89. package/dist/typescript/module/features/exampleSolution/constants.d.ts.map +0 -1
  90. package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts +0 -9
  91. package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts.map +0 -1
  92. package/dist/typescript/module/features/exampleSolution/index.d.ts +0 -4
  93. package/dist/typescript/module/features/exampleSolution/index.d.ts.map +0 -1
  94. package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +0 -10
  95. package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +0 -1
  96. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts +0 -13
  97. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +0 -1
  98. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts +0 -11
  99. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +0 -1
  100. package/dist/typescript/module/features/exampleSolution/types.d.ts +0 -27
  101. package/dist/typescript/module/features/exampleSolution/types.d.ts.map +0 -1
  102. package/src/features/exampleSolution/ExampleSolutionModal.tsx +0 -23
  103. package/src/features/exampleSolution/assets/grid.webp +0 -0
  104. package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +0 -80
  105. package/src/features/exampleSolution/components/QuestionSection.tsx +0 -61
  106. package/src/features/exampleSolution/components/SolutionSection.tsx +0 -117
  107. package/src/features/exampleSolution/constants.ts +0 -5
  108. package/src/features/exampleSolution/hooks/useExampleSolution.ts +0 -66
  109. package/src/features/exampleSolution/index.ts +0 -3
  110. package/src/features/exampleSolution/model/ExampleSolution.model.ts +0 -15
  111. package/src/features/exampleSolution/model/ExampleSolutionApi.ts +0 -29
  112. package/src/features/exampleSolution/model/ExampleSolutionCache.ts +0 -20
  113. package/src/features/exampleSolution/types.ts +0 -27
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- import { createControllerEffect } from "./../../../lib/effector/createControllerEffect.js";
4
- import { createEffect, sample } from 'effector';
5
- import { getText } from "../../../i18n/i18n.js";
6
- export class ExampleSolutionsApi {
7
- errorHandlingFx = createEffect(() => {
8
- if (!this.errorHandlerFx) return;
9
- this.errorHandlerFx(getText('exampleSolution.errorMessage'));
10
- });
11
- constructor({
12
- api,
13
- errorHandler
14
- }) {
15
- this.generateExampleSolutionFx = createControllerEffect(api.generateExampleSolution);
16
- this.errorHandlerFx = errorHandler;
17
- sample({
18
- clock: this.generateExampleSolutionFx.fail,
19
- target: this.errorHandlingFx
20
- });
21
- }
22
- }
23
- //# sourceMappingURL=ExampleSolutionApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createControllerEffect","createEffect","sample","getText","ExampleSolutionsApi","errorHandlingFx","errorHandlerFx","constructor","api","errorHandler","generateExampleSolutionFx","generateExampleSolution","clock","fail","target"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolutionApi.ts"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,mDAAgD;AAEvF,SAASC,YAAY,EAAEC,MAAM,QAAQ,UAAU;AAC/C,SAASC,OAAO,QAAQ,uBAAoB;AAO5C,OAAO,MAAMC,mBAAmB,CAAC;EAIfC,eAAe,GAAGJ,YAAY,CAAC,MAAM;IACnD,IAAI,CAAC,IAAI,CAACK,cAAc,EAAE;IAC1B,IAAI,CAACA,cAAc,CAACH,OAAO,CAAC,8BAA8B,CAAC,CAAC;EAC9D,CAAC,CAAC;EAEFI,WAAWA,CAAC;IAAEC,GAAG;IAAEC;EAAsC,CAAC,EAAE;IAC1D,IAAI,CAACC,yBAAyB,GAAGV,sBAAsB,CAACQ,GAAG,CAACG,uBAAuB,CAAC;IACpF,IAAI,CAACL,cAAc,GAAGG,YAAY;IAElCP,MAAM,CAAC;MACLU,KAAK,EAAE,IAAI,CAACF,yBAAyB,CAACG,IAAI;MAC1CC,MAAM,EAAE,IAAI,CAACT;IACf,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- import { createEvent, createStore } from 'effector';
4
- export class ExampleSolutionCache {
5
- addExampleSolution = createEvent();
6
- $state = createStore({}).on(this.addExampleSolution, (state, exampleSolution) => {
7
- return {
8
- ...state,
9
- [exampleSolution.cacheKey]: exampleSolution.response
10
- };
11
- });
12
- }
13
- //# sourceMappingURL=ExampleSolutionCache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createEvent","createStore","ExampleSolutionCache","addExampleSolution","$state","on","state","exampleSolution","cacheKey","response"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolutionCache.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,WAAW,QAAQ,UAAU;AAQnD,OAAO,MAAMC,oBAAoB,CAAC;EAChBC,kBAAkB,GAAGH,WAAW,CAAqB,CAAC;EACtDI,MAAM,GAAGH,WAAW,CAA0C,CAAC,CAAC,CAAC,CAACI,EAAE,CAClF,IAAI,CAACF,kBAAkB,EACvB,CAACG,KAAK,EAAEC,eAAe,KAAK;IAC1B,OAAO;MACL,GAAGD,KAAK;MACR,CAACC,eAAe,CAACC,QAAQ,GAAGD,eAAe,CAACE;IAC9C,CAAC;EACH,CACF,CAAC;AACH","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export {};
4
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["features/exampleSolution/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { ExampleSolutionModalParams } from './types';
3
- type ExampleSolutionModalComponentProps = {
4
- modal: {
5
- closeModal: () => void;
6
- params: ExampleSolutionModalParams;
7
- };
8
- };
9
- export declare const ExampleSolutionModal: ({ modal: { closeModal, params }, }: ExampleSolutionModalComponentProps) => React.JSX.Element;
10
- export {};
11
- //# sourceMappingURL=ExampleSolutionModal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolutionModal.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/ExampleSolutionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEpD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,MAAM,EAAE,0BAA0B,CAAA;KACnC,CAAA;CACF,CAAA;AAED,eAAO,MAAM,oBAAoB,uCAE9B,kCAAkC,sBAQpC,CAAA"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { ExampleSolutionModalParams } from '../types';
3
- type ExampleSolutionModalContentProps = {
4
- params: ExampleSolutionModalParams;
5
- };
6
- export declare const ExampleSolutionModalContent: ({ params: { model, payload, cacheKey }, }: ExampleSolutionModalContentProps) => React.JSX.Element;
7
- export {};
8
- //# sourceMappingURL=ExampleSolutionModalContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolutionModalContent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/ExampleSolutionModalContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAOrD,KAAK,gCAAgC,GAAG;IACtC,MAAM,EAAE,0BAA0B,CAAA;CACnC,CAAA;AAID,eAAO,MAAM,2BAA2B,8CAErC,gCAAgC,sBAyBlC,CAAA"}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { ExampleSolutionStatuses } from '../constants';
3
- type QuestionSectionProps = {
4
- question?: string;
5
- status: ExampleSolutionStatuses;
6
- renderKatexComponent: (katexString: string) => React.ReactNode;
7
- };
8
- export declare const QuestionSection: ({ question, status, renderKatexComponent, }: QuestionSectionProps) => React.JSX.Element;
9
- export {};
10
- //# sourceMappingURL=QuestionSection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuestionSection.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/QuestionSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAGtD,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;CAC/D,CAAA;AAED,eAAO,MAAM,eAAe,gDAIzB,oBAAoB,sBAWtB,CAAA"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { ExampleSolutionStatuses } from '../constants';
3
- type SolutionSectionProps = {
4
- answer?: string;
5
- status: ExampleSolutionStatuses;
6
- };
7
- export declare const SolutionSection: ({ answer, status }: SolutionSectionProps) => React.JSX.Element;
8
- export {};
9
- //# sourceMappingURL=SolutionSection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SolutionSection.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/SolutionSection.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAItD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAWD,eAAO,MAAM,eAAe,uBAAwB,oBAAoB,sBAoDvE,CAAA"}
@@ -1,6 +0,0 @@
1
- export declare const enum ExampleSolutionStatuses {
2
- LOADING = "loading",
3
- DONE_DATA = "doneData",
4
- CACHE = "cache"
5
- }
6
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/constants.ts"],"names":[],"mappings":"AAAA,0BAAkB,uBAAuB;IACvC,OAAO,YAAY;IACnB,SAAS,aAAa;IACtB,KAAK,UAAU;CAChB"}
@@ -1,9 +0,0 @@
1
- import { ExampleSolutionModalParams, ExampleSolutionResponse } from '../types';
2
- import { ExampleSolutionStatuses } from '../constants';
3
- type UseExampleSolutionReturn = {
4
- result: ExampleSolutionResponse | null;
5
- status: ExampleSolutionStatuses;
6
- };
7
- export declare const useExampleSolution: ({ model, payload, cacheKey, }: ExampleSolutionModalParams) => UseExampleSolutionReturn;
8
- export {};
9
- //# sourceMappingURL=useExampleSolution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useExampleSolution.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/hooks/useExampleSolution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAItD,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAA;IACtC,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAI5B,0BAA0B,KAAG,wBAiD/B,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './ExampleSolutionModal';
2
- export * from './model/ExampleSolution.model';
3
- export * from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,SAAS,CAAA"}
@@ -1,10 +0,0 @@
1
- import { ExampleSolutionModelProps } from '../types';
2
- import { ExampleSolutionsApi } from './ExampleSolutionApi';
3
- import { ExampleSolutionCache } from './ExampleSolutionCache';
4
- export declare class ExampleSolutionModel {
5
- readonly api: ExampleSolutionsApi;
6
- readonly cache: ExampleSolutionCache;
7
- readonly renderKatexComponent: (katexString: string) => React.ReactNode;
8
- constructor({ api, errorHandler, renderKatexComponent }: ExampleSolutionModelProps);
9
- }
10
- //# sourceMappingURL=ExampleSolution.model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolution.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolution.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,qBAAa,oBAAoB;IAC/B,SAAgB,GAAG,sBAAA;IACnB,SAAgB,KAAK,uBAA6B;IAElD,SAAgB,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;gBAElE,EAAE,GAAG,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,yBAAyB;CAInF"}
@@ -1,13 +0,0 @@
1
- import { ExampleSolutionApiRequests, ExampleSolutionErrorHandler } from '../types';
2
- type ExampleSolutionApiProps = {
3
- api: ExampleSolutionApiRequests;
4
- errorHandler?: ExampleSolutionErrorHandler;
5
- };
6
- export declare class ExampleSolutionsApi {
7
- readonly generateExampleSolutionFx: import("./../../../lib/effector/createControllerEffect").ControlledEffect<import("../types").ExampleSolutionPayload, import("../types").ExampleSolutionResponse>;
8
- readonly errorHandlerFx?: ExampleSolutionErrorHandler;
9
- readonly errorHandlingFx: import("effector").Effect<void, void, Error>;
10
- constructor({ api, errorHandler }: ExampleSolutionApiProps);
11
- }
12
- export {};
13
- //# sourceMappingURL=ExampleSolutionApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolutionApi.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolutionApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAIlF,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,0BAA0B,CAAA;IAC/B,YAAY,CAAC,EAAE,2BAA2B,CAAA;CAC3C,CAAA;AAED,qBAAa,mBAAmB;IAC9B,SAAgB,yBAAyB,mKAAA;IACzC,SAAgB,cAAc,CAAC,EAAE,2BAA2B,CAAA;IAE5D,SAAgB,eAAe,+CAG7B;gBAEU,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,uBAAuB;CAS3D"}
@@ -1,11 +0,0 @@
1
- import { ExampleSolutionResponse } from '../types';
2
- type AddExampleSolution = {
3
- cacheKey: string;
4
- response: ExampleSolutionResponse;
5
- };
6
- export declare class ExampleSolutionCache {
7
- readonly addExampleSolution: import("effector").EventCallable<AddExampleSolution>;
8
- readonly $state: import("effector").StoreWritable<Record<string, ExampleSolutionResponse>>;
9
- }
10
- export {};
11
- //# sourceMappingURL=ExampleSolutionCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolutionCache.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolutionCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAElD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,uBAAuB,CAAA;CAClC,CAAA;AAED,qBAAa,oBAAoB;IAC/B,SAAgB,kBAAkB,uDAAoC;IACtE,SAAgB,MAAM,4EAQrB;CACF"}
@@ -1,27 +0,0 @@
1
- import { ExampleSolutionModel } from './model/ExampleSolution.model';
2
- export type ExampleSolutionPayload = {
3
- question: string;
4
- answer: string;
5
- language: string;
6
- altText?: string;
7
- imageCdnId?: string;
8
- };
9
- export type ExampleSolutionResponse = {
10
- question: string;
11
- answer: string;
12
- };
13
- export type ExampleSolutionApiRequests = {
14
- generateExampleSolution: (body: ExampleSolutionPayload) => Promise<ExampleSolutionResponse>;
15
- };
16
- export type ExampleSolutionErrorHandler = (errorMessage: string) => void;
17
- export type ExampleSolutionModelProps = {
18
- api: ExampleSolutionApiRequests;
19
- errorHandler?: ExampleSolutionErrorHandler;
20
- renderKatexComponent: (katexString: string) => React.ReactNode;
21
- };
22
- export type ExampleSolutionModalParams = {
23
- cacheKey: string;
24
- payload: ExampleSolutionPayload;
25
- model: ExampleSolutionModel;
26
- };
27
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAEpE,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG;IACvC,uBAAuB,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;CAC5F,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;AACxE,MAAM,MAAM,yBAAyB,GAAG;IACtC,GAAG,EAAE,0BAA0B,CAAA;IAC/B,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;CAC/D,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,sBAAsB,CAAA;IAC/B,KAAK,EAAE,oBAAoB,CAAA;CAC5B,CAAA"}
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { ExampleSolutionModalParams } from './types';
3
- type ExampleSolutionModalComponentProps = {
4
- modal: {
5
- closeModal: () => void;
6
- params: ExampleSolutionModalParams;
7
- };
8
- };
9
- export declare const ExampleSolutionModal: ({ modal: { closeModal, params }, }: ExampleSolutionModalComponentProps) => React.JSX.Element;
10
- export {};
11
- //# sourceMappingURL=ExampleSolutionModal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolutionModal.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/ExampleSolutionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEpD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,MAAM,EAAE,0BAA0B,CAAA;KACnC,CAAA;CACF,CAAA;AAED,eAAO,MAAM,oBAAoB,uCAE9B,kCAAkC,sBAQpC,CAAA"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { ExampleSolutionModalParams } from '../types';
3
- type ExampleSolutionModalContentProps = {
4
- params: ExampleSolutionModalParams;
5
- };
6
- export declare const ExampleSolutionModalContent: ({ params: { model, payload, cacheKey }, }: ExampleSolutionModalContentProps) => React.JSX.Element;
7
- export {};
8
- //# sourceMappingURL=ExampleSolutionModalContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolutionModalContent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/ExampleSolutionModalContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAOrD,KAAK,gCAAgC,GAAG;IACtC,MAAM,EAAE,0BAA0B,CAAA;CACnC,CAAA;AAID,eAAO,MAAM,2BAA2B,8CAErC,gCAAgC,sBAyBlC,CAAA"}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { ExampleSolutionStatuses } from '../constants';
3
- type QuestionSectionProps = {
4
- question?: string;
5
- status: ExampleSolutionStatuses;
6
- renderKatexComponent: (katexString: string) => React.ReactNode;
7
- };
8
- export declare const QuestionSection: ({ question, status, renderKatexComponent, }: QuestionSectionProps) => React.JSX.Element;
9
- export {};
10
- //# sourceMappingURL=QuestionSection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuestionSection.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/QuestionSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAGtD,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;CAC/D,CAAA;AAED,eAAO,MAAM,eAAe,gDAIzB,oBAAoB,sBAWtB,CAAA"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { ExampleSolutionStatuses } from '../constants';
3
- type SolutionSectionProps = {
4
- answer?: string;
5
- status: ExampleSolutionStatuses;
6
- };
7
- export declare const SolutionSection: ({ answer, status }: SolutionSectionProps) => React.JSX.Element;
8
- export {};
9
- //# sourceMappingURL=SolutionSection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SolutionSection.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/SolutionSection.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAItD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAWD,eAAO,MAAM,eAAe,uBAAwB,oBAAoB,sBAoDvE,CAAA"}
@@ -1,6 +0,0 @@
1
- export declare const enum ExampleSolutionStatuses {
2
- LOADING = "loading",
3
- DONE_DATA = "doneData",
4
- CACHE = "cache"
5
- }
6
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/constants.ts"],"names":[],"mappings":"AAAA,0BAAkB,uBAAuB;IACvC,OAAO,YAAY;IACnB,SAAS,aAAa;IACtB,KAAK,UAAU;CAChB"}
@@ -1,9 +0,0 @@
1
- import { ExampleSolutionModalParams, ExampleSolutionResponse } from '../types';
2
- import { ExampleSolutionStatuses } from '../constants';
3
- type UseExampleSolutionReturn = {
4
- result: ExampleSolutionResponse | null;
5
- status: ExampleSolutionStatuses;
6
- };
7
- export declare const useExampleSolution: ({ model, payload, cacheKey, }: ExampleSolutionModalParams) => UseExampleSolutionReturn;
8
- export {};
9
- //# sourceMappingURL=useExampleSolution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useExampleSolution.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/hooks/useExampleSolution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAItD,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAA;IACtC,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAI5B,0BAA0B,KAAG,wBAiD/B,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './ExampleSolutionModal';
2
- export * from './model/ExampleSolution.model';
3
- export * from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,SAAS,CAAA"}
@@ -1,10 +0,0 @@
1
- import { ExampleSolutionModelProps } from '../types';
2
- import { ExampleSolutionsApi } from './ExampleSolutionApi';
3
- import { ExampleSolutionCache } from './ExampleSolutionCache';
4
- export declare class ExampleSolutionModel {
5
- readonly api: ExampleSolutionsApi;
6
- readonly cache: ExampleSolutionCache;
7
- readonly renderKatexComponent: (katexString: string) => React.ReactNode;
8
- constructor({ api, errorHandler, renderKatexComponent }: ExampleSolutionModelProps);
9
- }
10
- //# sourceMappingURL=ExampleSolution.model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolution.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolution.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,qBAAa,oBAAoB;IAC/B,SAAgB,GAAG,sBAAA;IACnB,SAAgB,KAAK,uBAA6B;IAElD,SAAgB,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;gBAElE,EAAE,GAAG,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,yBAAyB;CAInF"}
@@ -1,13 +0,0 @@
1
- import { ExampleSolutionApiRequests, ExampleSolutionErrorHandler } from '../types';
2
- type ExampleSolutionApiProps = {
3
- api: ExampleSolutionApiRequests;
4
- errorHandler?: ExampleSolutionErrorHandler;
5
- };
6
- export declare class ExampleSolutionsApi {
7
- readonly generateExampleSolutionFx: import("./../../../lib/effector/createControllerEffect").ControlledEffect<import("../types").ExampleSolutionPayload, import("../types").ExampleSolutionResponse>;
8
- readonly errorHandlerFx?: ExampleSolutionErrorHandler;
9
- readonly errorHandlingFx: import("effector").Effect<void, void, Error>;
10
- constructor({ api, errorHandler }: ExampleSolutionApiProps);
11
- }
12
- export {};
13
- //# sourceMappingURL=ExampleSolutionApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolutionApi.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolutionApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAIlF,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,0BAA0B,CAAA;IAC/B,YAAY,CAAC,EAAE,2BAA2B,CAAA;CAC3C,CAAA;AAED,qBAAa,mBAAmB;IAC9B,SAAgB,yBAAyB,mKAAA;IACzC,SAAgB,cAAc,CAAC,EAAE,2BAA2B,CAAA;IAE5D,SAAgB,eAAe,+CAG7B;gBAEU,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,uBAAuB;CAS3D"}
@@ -1,11 +0,0 @@
1
- import { ExampleSolutionResponse } from '../types';
2
- type AddExampleSolution = {
3
- cacheKey: string;
4
- response: ExampleSolutionResponse;
5
- };
6
- export declare class ExampleSolutionCache {
7
- readonly addExampleSolution: import("effector").EventCallable<AddExampleSolution>;
8
- readonly $state: import("effector").StoreWritable<Record<string, ExampleSolutionResponse>>;
9
- }
10
- export {};
11
- //# sourceMappingURL=ExampleSolutionCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExampleSolutionCache.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolutionCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAElD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,uBAAuB,CAAA;CAClC,CAAA;AAED,qBAAa,oBAAoB;IAC/B,SAAgB,kBAAkB,uDAAoC;IACtE,SAAgB,MAAM,4EAQrB;CACF"}
@@ -1,27 +0,0 @@
1
- import { ExampleSolutionModel } from './model/ExampleSolution.model';
2
- export type ExampleSolutionPayload = {
3
- question: string;
4
- answer: string;
5
- language: string;
6
- altText?: string;
7
- imageCdnId?: string;
8
- };
9
- export type ExampleSolutionResponse = {
10
- question: string;
11
- answer: string;
12
- };
13
- export type ExampleSolutionApiRequests = {
14
- generateExampleSolution: (body: ExampleSolutionPayload) => Promise<ExampleSolutionResponse>;
15
- };
16
- export type ExampleSolutionErrorHandler = (errorMessage: string) => void;
17
- export type ExampleSolutionModelProps = {
18
- api: ExampleSolutionApiRequests;
19
- errorHandler?: ExampleSolutionErrorHandler;
20
- renderKatexComponent: (katexString: string) => React.ReactNode;
21
- };
22
- export type ExampleSolutionModalParams = {
23
- cacheKey: string;
24
- payload: ExampleSolutionPayload;
25
- model: ExampleSolutionModel;
26
- };
27
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAEpE,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG;IACvC,uBAAuB,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;CAC5F,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;AACxE,MAAM,MAAM,yBAAyB,GAAG;IACtC,GAAG,EAAE,0BAA0B,CAAA;IAC/B,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;CAC/D,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,sBAAsB,CAAA;IAC/B,KAAK,EAAE,oBAAoB,CAAA;CAC5B,CAAA"}
@@ -1,23 +0,0 @@
1
- import React from 'react'
2
- import { BaseModal, SPACING } from '@magmamath/react-native-ui'
3
- import { ExampleSolutionModalContent } from './components/ExampleSolutionModalContent'
4
- import { ExampleSolutionModalParams } from './types'
5
-
6
- type ExampleSolutionModalComponentProps = {
7
- modal: {
8
- closeModal: () => void
9
- params: ExampleSolutionModalParams
10
- }
11
- }
12
-
13
- export const ExampleSolutionModal = ({
14
- modal: { closeModal, params },
15
- }: ExampleSolutionModalComponentProps) => (
16
- <BaseModal
17
- style={{
18
- container: { paddingHorizontal: SPACING[800] },
19
- }}
20
- onClose={closeModal}
21
- content={<ExampleSolutionModalContent params={params} />}
22
- />
23
- )
@@ -1,80 +0,0 @@
1
- import { StyleSheet, View } from 'react-native'
2
- import React from 'react'
3
- import { COLORS, HeadingVariants, IS_WEB, SPACING, Typography } from '@magmamath/react-native-ui'
4
- import { ExampleSolutionModalParams } from '../types'
5
- import { QuestionSection } from './QuestionSection'
6
- import { SolutionSection } from './SolutionSection'
7
- import { useExampleSolution } from '../hooks/useExampleSolution'
8
- import { TEST_IDS } from '@magmamath/students-qa'
9
- import { useText } from '../../../i18n/i18n'
10
-
11
- type ExampleSolutionModalContentProps = {
12
- params: ExampleSolutionModalParams
13
- }
14
-
15
- const CONTAINER_HEIGHT = 593
16
-
17
- export const ExampleSolutionModalContent = ({
18
- params: { model, payload, cacheKey },
19
- }: ExampleSolutionModalContentProps) => {
20
- const { result, status } = useExampleSolution({ model, payload, cacheKey })
21
- const t = useText()
22
-
23
- return (
24
- <View
25
- testID={TEST_IDS.EXAMPLE_SOLUTION_MODAL}
26
- style={[
27
- styles.container,
28
- IS_WEB ? { maxHeight: CONTAINER_HEIGHT } : { height: CONTAINER_HEIGHT },
29
- ]}
30
- >
31
- <Typography align="center" variant={HeadingVariants.H2} style={{ color: COLORS.NEUTRAL_9 }}>
32
- {t('exampleSolution.exampleSolution')}
33
- </Typography>
34
- <View style={styles.content}>
35
- <QuestionSection
36
- status={status}
37
- question={result?.question}
38
- renderKatexComponent={model.renderKatexComponent}
39
- />
40
- <SolutionSection status={status} answer={result?.answer} />
41
- </View>
42
- </View>
43
- )
44
- }
45
-
46
- const styles = StyleSheet.create({
47
- container: {
48
- width: 880,
49
- },
50
- content: {
51
- flex: 1,
52
- flexDirection: 'row',
53
- marginTop: SPACING[400],
54
- gap: SPACING[400],
55
- },
56
- solutionContainer: {
57
- width: 351,
58
- overflow: 'hidden',
59
- borderRadius: 8,
60
- borderWidth: 1,
61
- borderColor: COLORS.NEUTRAL_5,
62
- },
63
- lavaIconContainer: {
64
- position: 'absolute',
65
- bottom: -24,
66
- right: -26,
67
- },
68
- loaderContainer: {
69
- paddingTop: 34,
70
- position: 'absolute',
71
- width: '100%',
72
- height: '100%',
73
- backgroundColor: COLORS.NEUTRAL_1,
74
- },
75
- messageBlock: {
76
- position: 'absolute',
77
- right: 58,
78
- bottom: -12,
79
- },
80
- })
@@ -1,61 +0,0 @@
1
- import { StyleSheet, View } from 'react-native'
2
- import React from 'react'
3
- import { COLORS, Loader, LoaderColor, SPACING } from '@magmamath/react-native-ui'
4
- import Animated, { FadeOut } from 'react-native-reanimated'
5
- import { ExampleSolutionStatuses } from '../constants'
6
- import { TEST_IDS } from '@magmamath/students-qa'
7
-
8
- type QuestionSectionProps = {
9
- question?: string
10
- status: ExampleSolutionStatuses
11
- renderKatexComponent: (katexString: string) => React.ReactNode
12
- }
13
-
14
- export const QuestionSection = ({
15
- question,
16
- status,
17
- renderKatexComponent,
18
- }: QuestionSectionProps) => {
19
- return (
20
- <View style={styles.container} testID={TEST_IDS.EXAMPLE_SOLUTION_QUESTION_SECTION}>
21
- {question && <View style={styles.katexContainer}>{renderKatexComponent(question)}</View>}
22
- {status === ExampleSolutionStatuses.LOADING && (
23
- <Animated.View exiting={FadeOut} style={styles.loaderContainer}>
24
- <Loader size="large" color={LoaderColor.BLUE} />
25
- </Animated.View>
26
- )}
27
- </View>
28
- )
29
- }
30
-
31
- const styles = StyleSheet.create({
32
- container: {
33
- flex: 1,
34
- },
35
- katexContainer: {
36
- flex: 1,
37
- },
38
- loaderContainer: {
39
- paddingTop: 34,
40
- position: 'absolute',
41
- zIndex: 100,
42
- width: '100%',
43
- height: '100%',
44
- backgroundColor: COLORS.NEUTRAL_1,
45
- justifyContent: 'flex-start',
46
- alignItems: 'center',
47
- },
48
- errorContainer: {
49
- position: 'absolute',
50
- width: '100%',
51
- height: '100%',
52
- backgroundColor: COLORS.NEUTRAL_1,
53
- justifyContent: 'center',
54
- alignItems: 'center',
55
- padding: SPACING[400],
56
- },
57
- errorText: {
58
- color: COLORS.PRIMARY_RED,
59
- textAlign: 'center',
60
- },
61
- })