@magmamath/students-features 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/chatbot/constants.js +21 -12
- package/dist/commonjs/features/chatbot/constants.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/api.js +21 -1
- package/dist/commonjs/features/chatbot/model/api.js.map +1 -1
- package/dist/commonjs/features/feedback/components/EmptyComment/EmptyComment.js +1 -1
- package/dist/commonjs/features/feedback/components/EmptyComment/EmptyComment.js.map +1 -1
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js +1 -2
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js.map +1 -1
- package/dist/commonjs/features/feedback/constants.js +6 -9
- package/dist/commonjs/features/feedback/constants.js.map +1 -1
- package/dist/commonjs/features/feedback/model/teacherFeedback.model.js +6 -5
- package/dist/commonjs/features/feedback/model/teacherFeedback.model.js.map +1 -1
- package/dist/commonjs/features/feedback/types/teacherFeedback.types.js.map +1 -1
- package/dist/module/features/chatbot/constants.js +20 -11
- package/dist/module/features/chatbot/constants.js.map +1 -1
- package/dist/module/features/chatbot/model/api.js +21 -1
- package/dist/module/features/chatbot/model/api.js.map +1 -1
- package/dist/module/features/feedback/components/EmptyComment/EmptyComment.js +2 -2
- package/dist/module/features/feedback/components/EmptyComment/EmptyComment.js.map +1 -1
- package/dist/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js +1 -2
- package/dist/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.js.map +1 -1
- package/dist/module/features/feedback/constants.js +5 -8
- package/dist/module/features/feedback/constants.js.map +1 -1
- package/dist/module/features/feedback/model/teacherFeedback.model.js +6 -5
- package/dist/module/features/feedback/model/teacherFeedback.model.js.map +1 -1
- package/dist/module/features/feedback/types/teacherFeedback.types.js.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts +6 -0
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/api.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts +1 -1
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/constants.d.ts +4 -3
- package/dist/typescript/commonjs/features/feedback/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/teacherFeedback.model.d.ts +9 -3
- package/dist/typescript/commonjs/features/feedback/model/teacherFeedback.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/types/teacherFeedback.types.d.ts +0 -6
- package/dist/typescript/commonjs/features/feedback/types/teacherFeedback.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/constants.d.ts +6 -0
- package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/api.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/model/api.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts +1 -1
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/constants.d.ts +4 -3
- package/dist/typescript/module/features/feedback/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/teacherFeedback.model.d.ts +9 -3
- package/dist/typescript/module/features/feedback/model/teacherFeedback.model.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/types/teacherFeedback.types.d.ts +0 -6
- package/dist/typescript/module/features/feedback/types/teacherFeedback.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/chatbot/constants.ts +30 -22
- package/src/features/chatbot/model/api.ts +47 -17
- package/src/features/feedback/components/EmptyComment/EmptyComment.tsx +2 -2
- package/src/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.tsx +26 -12
- package/src/features/feedback/constants.ts +7 -10
- package/src/features/feedback/model/teacherFeedback.model.ts +18 -10
- package/src/features/feedback/types/teacherFeedback.types.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Locale","TeacherFeedbackSocketEvent"],"sourceRoot":"../../../../../src","sources":["features/feedback/types/teacherFeedback.types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["Locale","TeacherFeedbackSocketEvent"],"sourceRoot":"../../../../../src","sources":["features/feedback/types/teacherFeedback.types.ts"],"mappings":";;AAsBA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAMlB,WAAYC,0BAA0B,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA","ignoreList":[]}
|
|
@@ -18,4 +18,10 @@ export declare const TEXT_TO_SPEECH_CONFIG: {
|
|
|
18
18
|
name: string;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
+
export declare const KATEX_REPLACEMENTS: {
|
|
22
|
+
readonly '\\$': "__KATEX_DOLLAR_SYMBOL__";
|
|
23
|
+
};
|
|
24
|
+
export declare const KATEX_REPLACEMENTS_REVERSE: {
|
|
25
|
+
readonly __KATEX_DOLLAR_SYMBOL__: "$";
|
|
26
|
+
};
|
|
21
27
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/chatbot/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;CAIxB,CAAA;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/chatbot/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;CAIxB,CAAA;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;CAgBhC,CAAA;AAEF,eAAO,MAAM,kBAAkB;;CAErB,CAAA;AAEV,eAAO,MAAM,0BAA0B;;CAE7B,CAAA"}
|
|
@@ -7,6 +7,7 @@ export declare class ChatbotAPI {
|
|
|
7
7
|
getAlternativesFx: Effect<void, GetAlternativesResponse>;
|
|
8
8
|
translateTextFx: Effect<GoogleTranslatePayload, GoogleTranslateResponse>;
|
|
9
9
|
textToSpeechTextFx: Effect<GoogleText2SpeechPayload, GoogleText2SpeechResponse>;
|
|
10
|
+
private replaceKatexSyntax;
|
|
10
11
|
constructor(api: ChatbotModelProps['api']);
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAA;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAA;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAA;AAG3B,qBAAa,UAAU;IACrB,aAAa,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAA;IACxE,iBAAiB,EAAE,MAAM,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAA;IACxD,eAAe,EAAE,MAAM,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,CAAA;IACxE,kBAAkB,EAAE,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,CAAA;IAE/E,OAAO,CAAC,kBAAkB;gBAad,GAAG,EAAE,iBAAiB,CAAC,KAAK,CAAC;CAsB1C"}
|
|
@@ -8,6 +8,6 @@ type TeacherFeedbackButtonProps = {
|
|
|
8
8
|
size?: FeedbackButtonSize;
|
|
9
9
|
color?: FeedbackButtonColors;
|
|
10
10
|
};
|
|
11
|
-
export declare const TeacherFeedbackButton: ({ isOpen, onPress, isLoading, size, color, }: TeacherFeedbackButtonProps) => React.JSX.Element;
|
|
11
|
+
export declare const TeacherFeedbackButton: ({ isOpen, onPress, unreadCommentsCount, isLoading, size, color, }: TeacherFeedbackButtonProps) => React.JSX.Element;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=TeacherFeedbackButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeacherFeedbackButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,
|
|
1
|
+
{"version":3,"file":"TeacherFeedbackButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAEnB,MAAM,iBAAiB,CAAA;AAOxB,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,IAAI,CAAC,EAAE,kBAAkB,CAAA;IACzB,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,qBAAqB,sEAO/B,0BAA0B,sBAuE5B,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Locale } from './types/teacherFeedback.types';
|
|
2
|
-
export declare const TEACHER_FEEDBACK_BUTTON_ID = "teacherFeedbackButton";
|
|
3
|
-
export declare const EMPTY_COMMENT_ID = "empty-comment";
|
|
4
2
|
export declare const BUENOS_AIRES_FONT: string;
|
|
5
|
-
export declare const
|
|
3
|
+
export declare const NO_COMMENTS_ENG = "No comments yet";
|
|
4
|
+
export declare const NO_COMMENTS_SWE = "Inga kommentarer \u00E4n";
|
|
5
|
+
export declare const EMPTY_COMMENT_ID = "empty-comment";
|
|
6
6
|
export declare const getEmptyComment: (problemId: string, locale: Locale | null) => {
|
|
7
7
|
__v: number;
|
|
8
8
|
_id: string;
|
|
@@ -16,6 +16,7 @@ export declare const getEmptyComment: (problemId: string, locale: Locale | null)
|
|
|
16
16
|
teacherName: string;
|
|
17
17
|
updatedAt: Date;
|
|
18
18
|
};
|
|
19
|
+
export declare const TEACHER_FEEDBACK_BUTTON_ID = "teacherFeedbackButton";
|
|
19
20
|
export declare enum FeedbackButtonColors {
|
|
20
21
|
BLUE = "BLUE",
|
|
21
22
|
PURPLE = "PURPLE"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/feedback/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAEtD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/feedback/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAEtD,eAAO,MAAM,iBAAiB,QAA6E,CAAA;AAE3G,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,eAAe,6BAAwB,CAAA;AACpD,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,eAAO,MAAM,eAAe,cAAe,MAAM,UAAU,MAAM,GAAG,IAAI;;;;;;;;;;;;CAcvE,CAAA;AAED,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, StoreWritable } from 'effector';
|
|
2
|
-
import { CommentsEntity, GetCommentsByIdProps,
|
|
2
|
+
import { CommentsEntity, GetCommentsByIdProps, Locale, TeacherComment, UpdateCommentSeenStatusProps } from '../types/teacherFeedback.types';
|
|
3
3
|
type TeacherFeedbackModelProps = {
|
|
4
4
|
credits: {
|
|
5
5
|
assignmentId: StoreWritable<string>;
|
|
@@ -13,6 +13,7 @@ type TeacherFeedbackModelProps = {
|
|
|
13
13
|
updateCommentSeenStatus: (props: UpdateCommentSeenStatusProps) => Promise<void>;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
+
type CommentsMap = Map<string, Record<string, CommentsEntity>>;
|
|
16
17
|
export declare class TeacherFeedbackModel {
|
|
17
18
|
$assignmentId: StoreWritable<string>;
|
|
18
19
|
$currentProblemId: StoreWritable<string>;
|
|
@@ -22,12 +23,17 @@ export declare class TeacherFeedbackModel {
|
|
|
22
23
|
currentProblemId: string;
|
|
23
24
|
assignmentId: string;
|
|
24
25
|
}>;
|
|
25
|
-
$comments: StoreWritable<
|
|
26
|
+
$comments: StoreWritable<CommentsMap>;
|
|
26
27
|
setIsOpened: import("effector").EventCallable<boolean>;
|
|
27
28
|
$isOpened: StoreWritable<boolean>;
|
|
28
29
|
setIsVisible: import("effector").EventCallable<boolean>;
|
|
29
30
|
$isVisible: StoreWritable<boolean>;
|
|
30
|
-
getCommentsByAssignmentIdFx: Effect<GetCommentsByIdProps,
|
|
31
|
+
getCommentsByAssignmentIdFx: Effect<GetCommentsByIdProps, {
|
|
32
|
+
data: Record<string, {
|
|
33
|
+
comments: TeacherComment[];
|
|
34
|
+
}>;
|
|
35
|
+
assignmentId: string;
|
|
36
|
+
}>;
|
|
31
37
|
updateCommentSeenFx: Effect<UpdateCommentSeenStatusProps, void>;
|
|
32
38
|
sockets: {
|
|
33
39
|
onCreate: import("effector").EventCallable<TeacherComment>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teacherFeedback.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/teacherFeedback.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EAGN,aAAa,EACd,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"teacherFeedback.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/teacherFeedback.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EAGN,aAAa,EACd,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,MAAM,EACN,cAAc,EACd,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAGvC,KAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE;QACP,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;QACnC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;QAChC,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;KACrC,CAAA;IACD,GAAG,EAAE;QACH,yBAAyB,EAAE,CACzB,KAAK,EAAE,oBAAoB,KACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;YAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;SAAE,CAAC,CAAC,CAAA;QAC5D,uBAAuB,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAChF,CAAA;CACF,CAAA;AAED,KAAK,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAA;AAE9D,qBAAa,oBAAoB;IAC/B,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACpC,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACxC,OAAO,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAErC,eAAe;aAAsB,MAAM,EAAE;0BAAoB,MAAM;sBAAgB,MAAM;OAAK;IAClG,SAAS,6BAAsC;IAE/C,WAAW,4CAAyB;IACpC,SAAS,yBAAmC;IAC5C,YAAY,4CAAyB;IACrC,UAAU,yBAAoC;IAE9C,2BAA2B,EAAE,MAAM,CACjC,oBAAoB,EACpB;QACE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;SAAE,CAAC,CAAA;QACpD,YAAY,EAAE,MAAM,CAAA;KACrB,CACF,CAAA;IACD,mBAAmB,EAAE,MAAM,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAA;IAE/D,OAAO;;;MAGN;gBAEW,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,yBAAyB;CA8MxD"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
export type GetCommentsByIdProps = {
|
|
2
2
|
id: string;
|
|
3
3
|
};
|
|
4
|
-
export type GetCommentsByIdResponse = {
|
|
5
|
-
data: Record<string, {
|
|
6
|
-
comments: TeacherComment[];
|
|
7
|
-
}>;
|
|
8
|
-
assignmentId: string;
|
|
9
|
-
};
|
|
10
4
|
export type UpdateCommentSeenStatusProps = {
|
|
11
5
|
ids: string[];
|
|
12
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teacherFeedback.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/types/teacherFeedback.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AACjD,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"teacherFeedback.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/types/teacherFeedback.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AACjD,MAAM,MAAM,4BAA4B,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAE5D,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,oBAAY,MAAM;IAChB,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;CACb;AAED,oBAAY,0BAA0B;IACpC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;CAC3C"}
|
|
@@ -18,4 +18,10 @@ export declare const TEXT_TO_SPEECH_CONFIG: {
|
|
|
18
18
|
name: string;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
+
export declare const KATEX_REPLACEMENTS: {
|
|
22
|
+
readonly '\\$': "__KATEX_DOLLAR_SYMBOL__";
|
|
23
|
+
};
|
|
24
|
+
export declare const KATEX_REPLACEMENTS_REVERSE: {
|
|
25
|
+
readonly __KATEX_DOLLAR_SYMBOL__: "$";
|
|
26
|
+
};
|
|
21
27
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/chatbot/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;CAIxB,CAAA;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/chatbot/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;CAIxB,CAAA;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;CAgBhC,CAAA;AAEF,eAAO,MAAM,kBAAkB;;CAErB,CAAA;AAEV,eAAO,MAAM,0BAA0B;;CAE7B,CAAA"}
|
|
@@ -7,6 +7,7 @@ export declare class ChatbotAPI {
|
|
|
7
7
|
getAlternativesFx: Effect<void, GetAlternativesResponse>;
|
|
8
8
|
translateTextFx: Effect<GoogleTranslatePayload, GoogleTranslateResponse>;
|
|
9
9
|
textToSpeechTextFx: Effect<GoogleText2SpeechPayload, GoogleText2SpeechResponse>;
|
|
10
|
+
private replaceKatexSyntax;
|
|
10
11
|
constructor(api: ChatbotModelProps['api']);
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAA;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAA;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAA;AAG3B,qBAAa,UAAU;IACrB,aAAa,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAA;IACxE,iBAAiB,EAAE,MAAM,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAA;IACxD,eAAe,EAAE,MAAM,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,CAAA;IACxE,kBAAkB,EAAE,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,CAAA;IAE/E,OAAO,CAAC,kBAAkB;gBAad,GAAG,EAAE,iBAAiB,CAAC,KAAK,CAAC;CAsB1C"}
|
|
@@ -8,6 +8,6 @@ type TeacherFeedbackButtonProps = {
|
|
|
8
8
|
size?: FeedbackButtonSize;
|
|
9
9
|
color?: FeedbackButtonColors;
|
|
10
10
|
};
|
|
11
|
-
export declare const TeacherFeedbackButton: ({ isOpen, onPress, isLoading, size, color, }: TeacherFeedbackButtonProps) => React.JSX.Element;
|
|
11
|
+
export declare const TeacherFeedbackButton: ({ isOpen, onPress, unreadCommentsCount, isLoading, size, color, }: TeacherFeedbackButtonProps) => React.JSX.Element;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=TeacherFeedbackButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeacherFeedbackButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,
|
|
1
|
+
{"version":3,"file":"TeacherFeedbackButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/feedback/components/TeacherFeedbackButton/TeacherFeedbackButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAEnB,MAAM,iBAAiB,CAAA;AAOxB,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,IAAI,CAAC,EAAE,kBAAkB,CAAA;IACzB,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,qBAAqB,sEAO/B,0BAA0B,sBAuE5B,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Locale } from './types/teacherFeedback.types';
|
|
2
|
-
export declare const TEACHER_FEEDBACK_BUTTON_ID = "teacherFeedbackButton";
|
|
3
|
-
export declare const EMPTY_COMMENT_ID = "empty-comment";
|
|
4
2
|
export declare const BUENOS_AIRES_FONT: string;
|
|
5
|
-
export declare const
|
|
3
|
+
export declare const NO_COMMENTS_ENG = "No comments yet";
|
|
4
|
+
export declare const NO_COMMENTS_SWE = "Inga kommentarer \u00E4n";
|
|
5
|
+
export declare const EMPTY_COMMENT_ID = "empty-comment";
|
|
6
6
|
export declare const getEmptyComment: (problemId: string, locale: Locale | null) => {
|
|
7
7
|
__v: number;
|
|
8
8
|
_id: string;
|
|
@@ -16,6 +16,7 @@ export declare const getEmptyComment: (problemId: string, locale: Locale | null)
|
|
|
16
16
|
teacherName: string;
|
|
17
17
|
updatedAt: Date;
|
|
18
18
|
};
|
|
19
|
+
export declare const TEACHER_FEEDBACK_BUTTON_ID = "teacherFeedbackButton";
|
|
19
20
|
export declare enum FeedbackButtonColors {
|
|
20
21
|
BLUE = "BLUE",
|
|
21
22
|
PURPLE = "PURPLE"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/feedback/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAEtD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/feedback/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAEtD,eAAO,MAAM,iBAAiB,QAA6E,CAAA;AAE3G,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,eAAe,6BAAwB,CAAA;AACpD,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,eAAO,MAAM,eAAe,cAAe,MAAM,UAAU,MAAM,GAAG,IAAI;;;;;;;;;;;;CAcvE,CAAA;AAED,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, StoreWritable } from 'effector';
|
|
2
|
-
import { CommentsEntity, GetCommentsByIdProps,
|
|
2
|
+
import { CommentsEntity, GetCommentsByIdProps, Locale, TeacherComment, UpdateCommentSeenStatusProps } from '../types/teacherFeedback.types';
|
|
3
3
|
type TeacherFeedbackModelProps = {
|
|
4
4
|
credits: {
|
|
5
5
|
assignmentId: StoreWritable<string>;
|
|
@@ -13,6 +13,7 @@ type TeacherFeedbackModelProps = {
|
|
|
13
13
|
updateCommentSeenStatus: (props: UpdateCommentSeenStatusProps) => Promise<void>;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
+
type CommentsMap = Map<string, Record<string, CommentsEntity>>;
|
|
16
17
|
export declare class TeacherFeedbackModel {
|
|
17
18
|
$assignmentId: StoreWritable<string>;
|
|
18
19
|
$currentProblemId: StoreWritable<string>;
|
|
@@ -22,12 +23,17 @@ export declare class TeacherFeedbackModel {
|
|
|
22
23
|
currentProblemId: string;
|
|
23
24
|
assignmentId: string;
|
|
24
25
|
}>;
|
|
25
|
-
$comments: StoreWritable<
|
|
26
|
+
$comments: StoreWritable<CommentsMap>;
|
|
26
27
|
setIsOpened: import("effector").EventCallable<boolean>;
|
|
27
28
|
$isOpened: StoreWritable<boolean>;
|
|
28
29
|
setIsVisible: import("effector").EventCallable<boolean>;
|
|
29
30
|
$isVisible: StoreWritable<boolean>;
|
|
30
|
-
getCommentsByAssignmentIdFx: Effect<GetCommentsByIdProps,
|
|
31
|
+
getCommentsByAssignmentIdFx: Effect<GetCommentsByIdProps, {
|
|
32
|
+
data: Record<string, {
|
|
33
|
+
comments: TeacherComment[];
|
|
34
|
+
}>;
|
|
35
|
+
assignmentId: string;
|
|
36
|
+
}>;
|
|
31
37
|
updateCommentSeenFx: Effect<UpdateCommentSeenStatusProps, void>;
|
|
32
38
|
sockets: {
|
|
33
39
|
onCreate: import("effector").EventCallable<TeacherComment>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teacherFeedback.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/teacherFeedback.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EAGN,aAAa,EACd,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"teacherFeedback.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/model/teacherFeedback.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EAGN,aAAa,EACd,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,MAAM,EACN,cAAc,EACd,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAGvC,KAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE;QACP,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;QACnC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;QAChC,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;KACrC,CAAA;IACD,GAAG,EAAE;QACH,yBAAyB,EAAE,CACzB,KAAK,EAAE,oBAAoB,KACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;YAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;SAAE,CAAC,CAAC,CAAA;QAC5D,uBAAuB,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAChF,CAAA;CACF,CAAA;AAED,KAAK,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAA;AAE9D,qBAAa,oBAAoB;IAC/B,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACpC,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACxC,OAAO,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAErC,eAAe;aAAsB,MAAM,EAAE;0BAAoB,MAAM;sBAAgB,MAAM;OAAK;IAClG,SAAS,6BAAsC;IAE/C,WAAW,4CAAyB;IACpC,SAAS,yBAAmC;IAC5C,YAAY,4CAAyB;IACrC,UAAU,yBAAoC;IAE9C,2BAA2B,EAAE,MAAM,CACjC,oBAAoB,EACpB;QACE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;SAAE,CAAC,CAAA;QACpD,YAAY,EAAE,MAAM,CAAA;KACrB,CACF,CAAA;IACD,mBAAmB,EAAE,MAAM,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAA;IAE/D,OAAO;;;MAGN;gBAEW,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,yBAAyB;CA8MxD"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
export type GetCommentsByIdProps = {
|
|
2
2
|
id: string;
|
|
3
3
|
};
|
|
4
|
-
export type GetCommentsByIdResponse = {
|
|
5
|
-
data: Record<string, {
|
|
6
|
-
comments: TeacherComment[];
|
|
7
|
-
}>;
|
|
8
|
-
assignmentId: string;
|
|
9
|
-
};
|
|
10
4
|
export type UpdateCommentSeenStatusProps = {
|
|
11
5
|
ids: string[];
|
|
12
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teacherFeedback.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/types/teacherFeedback.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AACjD,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"teacherFeedback.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/feedback/types/teacherFeedback.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AACjD,MAAM,MAAM,4BAA4B,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAE5D,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,SAAS,EAAE,IAAI,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,oBAAY,MAAM;IAChB,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;CACb;AAED,oBAAY,0BAA0B;IACpC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;CAC3C"}
|
package/package.json
CHANGED
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
import { Platform } from 'react-native'
|
|
2
2
|
|
|
3
3
|
export const AUDIO_CONFIG = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
audioEncoding: 'LINEAR16',
|
|
5
|
+
pitch: 0,
|
|
6
|
+
speakingRate: 0.8,
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const DEFAULT_VOICE = {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
languageCode: 'en-US',
|
|
11
|
+
name: 'en-US-Wavenet-C',
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const TEXT_TO_SPEECH_CONFIG =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
export const TEXT_TO_SPEECH_CONFIG = Platform.select({
|
|
15
|
+
ios: {
|
|
16
|
+
audioConfig: {
|
|
17
|
+
audioEncoding: 'MP3',
|
|
18
|
+
pitch: 0.8,
|
|
19
|
+
speakingRate: 0.8,
|
|
20
|
+
},
|
|
21
|
+
voice: {
|
|
22
|
+
languageCode: 'en-US',
|
|
23
|
+
name: 'en-US-Wavenet-C',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
default: {
|
|
27
|
+
audioConfig: AUDIO_CONFIG,
|
|
28
|
+
voice: DEFAULT_VOICE,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export const KATEX_REPLACEMENTS = {
|
|
33
|
+
'\\$': '__KATEX_DOLLAR_SYMBOL__',
|
|
34
|
+
} as const
|
|
35
|
+
|
|
36
|
+
export const KATEX_REPLACEMENTS_REVERSE = {
|
|
37
|
+
__KATEX_DOLLAR_SYMBOL__: '$',
|
|
38
|
+
} as const
|
|
@@ -4,25 +4,55 @@ import { createControllerEffect } from '../../../lib/effector'
|
|
|
4
4
|
import { ControlledEffect } from '../../../lib/effector/createControllerEffect'
|
|
5
5
|
import { ChatbotModelProps } from '../types/model.types'
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
GetAlternativesResponse,
|
|
8
|
+
PostMessagePayload,
|
|
9
|
+
PostMessageResponse,
|
|
10
|
+
GoogleTranslatePayload,
|
|
11
|
+
GoogleTranslateResponse,
|
|
12
|
+
GoogleText2SpeechPayload,
|
|
13
|
+
GoogleText2SpeechResponse,
|
|
14
14
|
} from '../types/api.types'
|
|
15
|
+
import { KATEX_REPLACEMENTS, KATEX_REPLACEMENTS_REVERSE } from '../constants'
|
|
15
16
|
|
|
16
17
|
export class ChatbotAPI {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
postMessageFx: ControlledEffect<PostMessagePayload, PostMessageResponse>
|
|
19
|
+
getAlternativesFx: Effect<void, GetAlternativesResponse>
|
|
20
|
+
translateTextFx: Effect<GoogleTranslatePayload, GoogleTranslateResponse>
|
|
21
|
+
textToSpeechTextFx: Effect<GoogleText2SpeechPayload, GoogleText2SpeechResponse>
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
private replaceKatexSyntax(texts: string[], reverse = false) {
|
|
24
|
+
const replacements = reverse
|
|
25
|
+
? Object.entries(KATEX_REPLACEMENTS_REVERSE)
|
|
26
|
+
: Object.entries(KATEX_REPLACEMENTS)
|
|
27
|
+
|
|
28
|
+
return texts.map(text =>
|
|
29
|
+
replacements.reduce(
|
|
30
|
+
(newText, [pattern, placeholder]) => newText.replace(new RegExp(pattern, 'g'), placeholder),
|
|
31
|
+
text,
|
|
32
|
+
),
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
constructor(api: ChatbotModelProps['api']) {
|
|
37
|
+
this.postMessageFx = createControllerEffect(api.postMessage)
|
|
38
|
+
this.getAlternativesFx = createEffect(api.getAlternatives)
|
|
39
|
+
this.translateTextFx = createEffect(async (payload: GoogleTranslatePayload) => {
|
|
40
|
+
const response = await api.postTranslateText({
|
|
41
|
+
...payload,
|
|
42
|
+
text: this.replaceKatexSyntax(payload.text),
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
...response,
|
|
47
|
+
data: {
|
|
48
|
+
...response.data,
|
|
49
|
+
translations: response.data.translations.map(translation => ({
|
|
50
|
+
...translation,
|
|
51
|
+
translatedText: this.replaceKatexSyntax([translation.translatedText], true)[0],
|
|
52
|
+
})),
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
this.textToSpeechTextFx = createEffect(api.postTextToSpeech)
|
|
57
|
+
}
|
|
28
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { StyleSheet, Text, View } from 'react-native'
|
|
3
3
|
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
-
import { BUENOS_AIRES_FONT,
|
|
4
|
+
import { BUENOS_AIRES_FONT, NO_COMMENTS_SWE, NO_COMMENTS_ENG } from '../../constants'
|
|
5
5
|
import { Locale } from '../../types/teacherFeedback.types'
|
|
6
6
|
|
|
7
7
|
type EmptyCommentProps = {
|
|
@@ -11,7 +11,7 @@ type EmptyCommentProps = {
|
|
|
11
11
|
export const EmptyComment = ({ locale }: EmptyCommentProps) => {
|
|
12
12
|
return (
|
|
13
13
|
<View style={styles.container}>
|
|
14
|
-
<Text style={styles.text}>{
|
|
14
|
+
<Text style={styles.text}>{locale === Locale.SV ? NO_COMMENTS_SWE : NO_COMMENTS_ENG}</Text>
|
|
15
15
|
</View>
|
|
16
16
|
)
|
|
17
17
|
}
|
|
@@ -5,11 +5,15 @@ import { UnreadMessagesBadge } from '../UnreadMessagesBadge'
|
|
|
5
5
|
import { MessageBubbleIcon } from '../icons/MessageBubbleIcon'
|
|
6
6
|
import { XCloseIcon } from '../icons/XCloseIcon'
|
|
7
7
|
import { COLOR_SCHEMES } from './colorSchemes'
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
FeedbackButtonColors,
|
|
10
|
+
FeedbackButtonSize,
|
|
11
|
+
TEACHER_FEEDBACK_BUTTON_ID,
|
|
12
|
+
} from '../../constants'
|
|
9
13
|
|
|
10
14
|
const ICON_SIZES = {
|
|
11
15
|
[FeedbackButtonSize.LARGE]: 37,
|
|
12
|
-
[FeedbackButtonSize.SMALL]: 26
|
|
16
|
+
[FeedbackButtonSize.SMALL]: 26,
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
type TeacherFeedbackButtonProps = {
|
|
@@ -24,13 +28,11 @@ type TeacherFeedbackButtonProps = {
|
|
|
24
28
|
export const TeacherFeedbackButton = ({
|
|
25
29
|
isOpen,
|
|
26
30
|
onPress,
|
|
27
|
-
|
|
31
|
+
unreadCommentsCount,
|
|
28
32
|
isLoading,
|
|
29
33
|
size = FeedbackButtonSize.LARGE,
|
|
30
34
|
color = FeedbackButtonColors.BLUE,
|
|
31
35
|
}: TeacherFeedbackButtonProps) => {
|
|
32
|
-
|
|
33
|
-
const unreadCommentsCount = 5
|
|
34
36
|
const isLarge = size === FeedbackButtonSize.LARGE
|
|
35
37
|
const isPurpleColor = color === FeedbackButtonColors.PURPLE
|
|
36
38
|
|
|
@@ -39,8 +41,8 @@ export const TeacherFeedbackButton = ({
|
|
|
39
41
|
<Button
|
|
40
42
|
id={TEACHER_FEEDBACK_BUTTON_ID}
|
|
41
43
|
onPress={onPress}
|
|
42
|
-
size=
|
|
43
|
-
variant=
|
|
44
|
+
size="large"
|
|
45
|
+
variant="primary"
|
|
44
46
|
disabled={isLoading}
|
|
45
47
|
isLoading={isLoading}
|
|
46
48
|
style={{
|
|
@@ -57,19 +59,31 @@ export const TeacherFeedbackButton = ({
|
|
|
57
59
|
<Button
|
|
58
60
|
id={TEACHER_FEEDBACK_BUTTON_ID}
|
|
59
61
|
onPress={onPress}
|
|
60
|
-
size=
|
|
61
|
-
variant=
|
|
62
|
+
size="large"
|
|
63
|
+
variant="primary"
|
|
62
64
|
disabled={isLoading}
|
|
63
65
|
isLoading={isLoading}
|
|
64
66
|
style={{
|
|
65
67
|
container: isLarge ? styles.containerLarge : styles.container,
|
|
66
68
|
button: [
|
|
67
69
|
styles.button,
|
|
68
|
-
{
|
|
70
|
+
{
|
|
71
|
+
borderColor: !!unreadCommentsCount
|
|
72
|
+
? isPurpleColor
|
|
73
|
+
? COLORS.PURPLE_6
|
|
74
|
+
: COLORS.BLUE_6
|
|
75
|
+
: COLORS.NEUTRAL_5,
|
|
76
|
+
},
|
|
69
77
|
styles[size],
|
|
70
78
|
],
|
|
71
79
|
}}
|
|
72
|
-
customColorScheme={
|
|
80
|
+
customColorScheme={
|
|
81
|
+
!!unreadCommentsCount
|
|
82
|
+
? isPurpleColor
|
|
83
|
+
? COLOR_SCHEMES.PURPLE
|
|
84
|
+
: COLOR_SCHEMES.BLUE
|
|
85
|
+
: COLOR_SCHEMES.GREY
|
|
86
|
+
}
|
|
73
87
|
icon={
|
|
74
88
|
<View style={styles.iconContainer}>
|
|
75
89
|
<MessageBubbleIcon
|
|
@@ -140,5 +154,5 @@ const styles = StyleSheet.create({
|
|
|
140
154
|
width: 32,
|
|
141
155
|
height: 32,
|
|
142
156
|
borderRadius: 16,
|
|
143
|
-
}
|
|
157
|
+
},
|
|
144
158
|
})
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import { Platform } from 'react-native'
|
|
2
2
|
import { Locale } from './types/teacherFeedback.types'
|
|
3
3
|
|
|
4
|
-
export const
|
|
5
|
-
export const EMPTY_COMMENT_ID = 'empty-comment'
|
|
6
|
-
export const BUENOS_AIRES_FONT =
|
|
7
|
-
Platform.OS === 'web' ? 'Buenos Aires, sans-serif' : 'BuenosAires-Regular'
|
|
4
|
+
export const BUENOS_AIRES_FONT = Platform.OS === 'web' ? 'Buenos Aires, sans-serif' : 'BuenosAires-Regular'
|
|
8
5
|
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
[Locale.US]: 'No comments yet',
|
|
13
|
-
}
|
|
6
|
+
export const NO_COMMENTS_ENG = 'No comments yet'
|
|
7
|
+
export const NO_COMMENTS_SWE = 'Inga kommentarer än'
|
|
8
|
+
export const EMPTY_COMMENT_ID = 'empty-comment'
|
|
14
9
|
|
|
15
10
|
export const getEmptyComment = (problemId: string, locale: Locale | null) => {
|
|
16
11
|
return {
|
|
17
12
|
__v: 0,
|
|
18
13
|
_id: EMPTY_COMMENT_ID,
|
|
19
|
-
content:
|
|
14
|
+
content: locale === Locale.SV ? NO_COMMENTS_SWE : NO_COMMENTS_ENG,
|
|
20
15
|
createdAt: new Date(),
|
|
21
16
|
exerciseId: '',
|
|
22
17
|
isRead: true,
|
|
@@ -28,6 +23,8 @@ export const getEmptyComment = (problemId: string, locale: Locale | null) => {
|
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
25
|
|
|
26
|
+
export const TEACHER_FEEDBACK_BUTTON_ID = 'teacherFeedbackButton'
|
|
27
|
+
|
|
31
28
|
export enum FeedbackButtonColors {
|
|
32
29
|
BLUE = 'BLUE',
|
|
33
30
|
PURPLE = 'PURPLE',
|