touchstudy-core 0.1.9 → 0.1.11
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/components/Chats/ChatContainer.d.ts +6 -0
- package/dist/components/Chats/ChatHeader.d.ts +1 -0
- package/dist/components/Chats/ChatItem.d.ts +2 -1
- package/dist/components/Chats/ChatList.d.ts +1 -1
- package/dist/components/Chats/configs/types.d.ts +2 -0
- package/dist/components/Chats/hooks/useChatContainer.d.ts +6 -1
- package/dist/components/Chats/hooks/useMessageList.d.ts +2 -1
- package/dist/components/Dialogs/ConfirmDialog.d.ts +1 -0
- package/dist/components/Selects/CustomAsyncSelect.d.ts +3 -0
- package/dist/components/Selects/CustomCreatable.d.ts +3 -0
- package/dist/components/Selects/CustomSelect.d.ts +1 -1
- package/dist/containers/Exams/components/ArticleGroupView.d.ts +19 -0
- package/dist/containers/Exams/components/QuestionView.d.ts +11 -0
- package/dist/containers/Exams/configs/constants.d.ts +8 -0
- package/dist/containers/Exams/configs/interfaces.d.ts +9 -0
- package/dist/containers/Exams/configs/types.d.ts +21 -0
- package/dist/containers/Exams/hooks/useExamDetailView.d.ts +23 -0
- package/dist/containers/Exams/views/ExamDetailView.d.ts +4 -0
- package/dist/containers/Login/configs/constants.d.ts +5 -0
- package/dist/containers/Login/views/Login.d.ts +2 -1
- package/dist/containers/Login/views/block/BlockLogin.d.ts +2 -1
- package/dist/index.css +40 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +993 -112
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +978 -113
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/useLanguage.d.ts +10 -0
- package/package.json +3 -1
- package/dist/services/api.d.ts +0 -3
@@ -7,7 +7,13 @@ export interface IChatContainerProps {
|
|
7
7
|
chatListProps: IChatListProps;
|
8
8
|
inputProps: IInputChatProps;
|
9
9
|
height?: string;
|
10
|
+
scrollOffset?: number;
|
11
|
+
isLoading?: boolean;
|
12
|
+
isScrollToEnd?: boolean;
|
10
13
|
onRead?: () => void;
|
14
|
+
onReachTop?: () => void;
|
15
|
+
onReachBottom?: () => void;
|
16
|
+
onEndScrollToEnd?: () => void;
|
11
17
|
}
|
12
18
|
declare const ChatContainer: FC<IChatContainerProps>;
|
13
19
|
export default ChatContainer;
|
@@ -26,9 +26,10 @@ export interface IChatItemProps {
|
|
26
26
|
onToggleReply?: (id: number) => void;
|
27
27
|
}
|
28
28
|
export interface IChatItemWithActionProps extends IChatItemProps {
|
29
|
-
onAddExamMessage?: (examId: number, title: string) => void;
|
29
|
+
onAddExamMessage?: (examId: number, title: string, examCode: string) => void;
|
30
30
|
onReply?: (id: number, content: string, examId?: number) => void;
|
31
31
|
onReTrySendMessage?: () => void;
|
32
|
+
onGotoParentMessage?: (id: number) => void;
|
32
33
|
}
|
33
34
|
export declare enum ChatItemType {
|
34
35
|
Default = 0,
|
@@ -2,7 +2,7 @@ import React, { FC } from "react";
|
|
2
2
|
import { IChatItemProps } from "./ChatItem";
|
3
3
|
export interface IChatListProps {
|
4
4
|
messages?: IChatItemProps[];
|
5
|
-
onAddExamMessage: (examId: number, examTitle: string) => void;
|
5
|
+
onAddExamMessage: (examId: number, examTitle: string, examCode: string) => void;
|
6
6
|
onReTrySendMessage?: () => void;
|
7
7
|
onReply?: (id: number, content: string, examId?: number) => void;
|
8
8
|
}
|
@@ -23,6 +23,7 @@ export declare type MessageFilter = {
|
|
23
23
|
sortColumnDirection?: OrderBy;
|
24
24
|
sortColumnName?: MessageSortBy;
|
25
25
|
examId?: number;
|
26
|
+
beforeDate?: string;
|
26
27
|
};
|
27
28
|
export declare enum MessageSortBy {
|
28
29
|
CreatedAt = "CreatedAt"
|
@@ -68,6 +69,7 @@ export declare type MessageRequest = {
|
|
68
69
|
parentId?: number;
|
69
70
|
parentContent?: string;
|
70
71
|
examTitle?: string;
|
72
|
+
examCode?: string;
|
71
73
|
};
|
72
74
|
export declare enum MessageAction {
|
73
75
|
Default = 0,
|
@@ -15,11 +15,12 @@ declare const useChatContainer: (props: Props) => {
|
|
15
15
|
name: string;
|
16
16
|
avatar: string;
|
17
17
|
options: import("../configs/types").ExamResponse[] | undefined;
|
18
|
+
selectedOption: number | undefined;
|
18
19
|
onChangeOption: (val: any) => void;
|
19
20
|
};
|
20
21
|
chatListProps: {
|
21
22
|
messages: IChatItemProps[];
|
22
|
-
onAddExamMessage: (examId: number, title: string) => void;
|
23
|
+
onAddExamMessage: (examId: number, title: string, examCode: string) => void;
|
23
24
|
onReply: (parentId: number, content: string, examId?: number | undefined) => void;
|
24
25
|
onReTrySendMessage: () => Promise<void>;
|
25
26
|
};
|
@@ -31,11 +32,15 @@ declare const useChatContainer: (props: Props) => {
|
|
31
32
|
onSubmit: () => Promise<void>;
|
32
33
|
onClearReply: (() => void) | undefined;
|
33
34
|
};
|
35
|
+
isScrollToEnd: boolean;
|
36
|
+
isLoadingMessages: boolean;
|
34
37
|
exams: import("../configs/types").ExamResponse[] | undefined;
|
35
38
|
messageList: IChatItemProps[];
|
36
39
|
selectedConversation: ConversationResponse | undefined;
|
37
40
|
messageStatus: MessageStatus;
|
38
41
|
messageFilter: import("../configs/types").MessageFilter;
|
42
|
+
handleToggleScrollToEnd: () => void;
|
43
|
+
handleLoadMoreMessages: () => void;
|
39
44
|
getMessageList: (conversationId: number, examId?: number | undefined) => Promise<void>;
|
40
45
|
handleFilterExam: (val: any) => void;
|
41
46
|
setMessage: import("react").Dispatch<import("react").SetStateAction<MessageRequest | undefined>>;
|
@@ -1,13 +1,14 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { MessageResponse, MessageFilter } from "../configs/types";
|
3
3
|
declare const useMessageList: (userId?: number | undefined, getListExamOptions?: Function | undefined) => {
|
4
|
+
isLoading: boolean;
|
4
5
|
messageFilter: MessageFilter;
|
5
6
|
messages: MessageResponse[];
|
6
7
|
getMessageList: (conversationId: number, examId?: number | undefined) => Promise<void>;
|
7
8
|
setMessages: import("react").Dispatch<import("react").SetStateAction<MessageResponse[]>>;
|
8
9
|
resetMessages: () => void;
|
9
|
-
handleChangeMessageFilter: (filter: MessageFilter) => void;
|
10
10
|
handleChangeExamId: (value: any) => void;
|
11
11
|
handleMarkReadMessage: (conversationId: number, messageId: number) => Promise<void>;
|
12
|
+
handleLoadMore: () => boolean | undefined;
|
12
13
|
};
|
13
14
|
export default useMessageList;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import React from "react";
|
2
|
-
declare const CustomSelect: ({ defaultValue, options, isDisabled, scrollBottom, value, isMulti, ...rest }: any) => React.JSX.Element;
|
2
|
+
declare const CustomSelect: ({ isDefault, defaultValue, options, isDisabled, scrollBottom, value, isMulti, ...rest }: any) => React.JSX.Element;
|
3
3
|
export default CustomSelect;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { FC } from "react";
|
2
|
+
export interface ArticleGroupViewProps {
|
3
|
+
categoryOptions: any[];
|
4
|
+
article: number;
|
5
|
+
questionCount: number;
|
6
|
+
categoryId?: number;
|
7
|
+
answerCount: number;
|
8
|
+
questions: any;
|
9
|
+
isMultiple?: boolean;
|
10
|
+
isActive?: boolean;
|
11
|
+
isDisabled?: boolean;
|
12
|
+
onChangeQuestionCount: (article: number, questionCount: number, answerCount: number) => void;
|
13
|
+
onChangeCategory: (article: number, categoryId: number) => void;
|
14
|
+
onChangeAnswerCount: (article: number, newAnswerCount: number, answerCount: number) => void;
|
15
|
+
onChangeCorrectAnswers: (article: number, index: number, answer: number) => void;
|
16
|
+
onChangeScoreAnswer: (article: number, index: number, score: number) => void;
|
17
|
+
}
|
18
|
+
declare const ArticleGroupView: FC<ArticleGroupViewProps>;
|
19
|
+
export default ArticleGroupView;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
export interface QuestionViewProps {
|
3
|
+
index: number;
|
4
|
+
question: any;
|
5
|
+
answerCount: number;
|
6
|
+
isDisabled?: boolean;
|
7
|
+
onChangeCorrectAnswers: (value: any, index: number) => void;
|
8
|
+
onChangeScoreAnswer: (value: number, index: number) => void;
|
9
|
+
}
|
10
|
+
declare const QuestionView: FC<QuestionViewProps>;
|
11
|
+
export default QuestionView;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Exam } from "./types";
|
2
|
+
export declare const DURATION_OPTIONS: number[];
|
3
|
+
export declare const SCORE_OPTIONS: number[];
|
4
|
+
export declare const QUESTION_OPTIONS: number[];
|
5
|
+
export declare const ANSWER_OPTIONS: number[];
|
6
|
+
export declare const DEFAULT_SCORE = 2;
|
7
|
+
export declare const DEFAULT_ANSWER_COUNT = 5;
|
8
|
+
export declare const DEFAULT_EXAM: Exam;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export declare type Question = {
|
2
|
+
id?: number;
|
3
|
+
numberOfAnswers: number;
|
4
|
+
correctAnswers: number[];
|
5
|
+
score: number;
|
6
|
+
categoryId?: number;
|
7
|
+
article: number;
|
8
|
+
questionOrder: number;
|
9
|
+
};
|
10
|
+
export declare type Exam = {
|
11
|
+
title: string;
|
12
|
+
duration: number;
|
13
|
+
questions: Question[];
|
14
|
+
};
|
15
|
+
export declare type ArticleGroup = {
|
16
|
+
article: number;
|
17
|
+
categoryId?: number;
|
18
|
+
answerCount: number;
|
19
|
+
questionCount: number;
|
20
|
+
questions: Question[];
|
21
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { ArticleGroup, Exam } from "../configs/types";
|
2
|
+
import { ChangeEvent } from "react";
|
3
|
+
interface Props {
|
4
|
+
exam: Exam;
|
5
|
+
onChangeExam: (value: Exam) => void;
|
6
|
+
}
|
7
|
+
declare const useExamDetailView: (props: Props) => {
|
8
|
+
t: any;
|
9
|
+
durationOptions: {
|
10
|
+
label: string;
|
11
|
+
value: number;
|
12
|
+
}[];
|
13
|
+
examGroupByArticle: ArticleGroup[];
|
14
|
+
handleAddArticle: () => void;
|
15
|
+
handleChangeScoreAnswer: (article: number, index: number, score: number) => void;
|
16
|
+
handleChangeTitle: (e: ChangeEvent<HTMLInputElement>) => void;
|
17
|
+
handleChangeDuration: (value: any) => void;
|
18
|
+
handleChangeCorrectAnswers: (article: number, index: number, answer: number) => void;
|
19
|
+
handleChangeAnswerCount: (article: number, newAnswerCount: number, answerCount: number) => void;
|
20
|
+
handleChangeQuestionCount: (article: number, questionCount: number, answerCount: number) => void;
|
21
|
+
handleChangeCategory: (article: number, categoryId: number) => void;
|
22
|
+
};
|
23
|
+
export default useExamDetailView;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { FC } from "react";
|
2
2
|
import { INavigateProps } from "../../../utils/types";
|
3
|
+
import { Role } from "../configs/constants";
|
3
4
|
interface Props {
|
4
|
-
|
5
|
+
role?: Role;
|
5
6
|
}
|
6
7
|
declare const Login: FC<INavigateProps & Props>;
|
7
8
|
export default Login;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { FC } from "react";
|
2
2
|
import { INavigateProps } from "../../../../utils/types";
|
3
|
+
import { Role } from "../../configs/constants";
|
3
4
|
interface Props {
|
4
5
|
defaultInfo?: any;
|
5
|
-
|
6
|
+
role?: Role;
|
6
7
|
}
|
7
8
|
declare const BlockLogin: FC<Props & INavigateProps>;
|
8
9
|
export default BlockLogin;
|
package/dist/index.css
CHANGED
@@ -169,4 +169,43 @@
|
|
169
169
|
overflow: hidden;
|
170
170
|
display: -webkit-box;
|
171
171
|
-webkit-line-clamp: 1;
|
172
|
-
-webkit-box-orient: vertical;
|
172
|
+
-webkit-box-orient: vertical;
|
173
|
+
line-height: 42px; }
|
174
|
+
|
175
|
+
._2uc_W {
|
176
|
+
padding: 0.5rem 1.5rem;
|
177
|
+
border-radius: 6px;
|
178
|
+
border: 1px solid #EBEBFF; }
|
179
|
+
._2p7kY {
|
180
|
+
font-weight: 700;
|
181
|
+
font-size: 14px;
|
182
|
+
color: #5458D5; }
|
183
|
+
._2tHmc {
|
184
|
+
font-weight: 700;
|
185
|
+
font-size: 14px;
|
186
|
+
color: #414E62; }
|
187
|
+
._3IHYm {
|
188
|
+
border: 1px solid #5458D5; }
|
189
|
+
|
190
|
+
._26ATj {
|
191
|
+
font-weight: 600;
|
192
|
+
font-size: 13px;
|
193
|
+
color: #202B37; }
|
194
|
+
|
195
|
+
._3R8PR {
|
196
|
+
font-weight: 600;
|
197
|
+
font-size: 13px;
|
198
|
+
color: #5458D5;
|
199
|
+
border: 1px solid #97A1AF;
|
200
|
+
padding: 12px; }
|
201
|
+
._3R8PR:focus {
|
202
|
+
box-shadow: none;
|
203
|
+
color: #5458D5;
|
204
|
+
border: 1px solid #5458D5; }
|
205
|
+
|
206
|
+
._1VZac {
|
207
|
+
border-color: #5458D5;
|
208
|
+
color: #5458D5; }
|
209
|
+
._1VZac:hover {
|
210
|
+
color: #FFF;
|
211
|
+
background: #5458D5; }
|
package/dist/index.d.ts
CHANGED
@@ -32,4 +32,14 @@ import useChatContainer from "./components/Chats/hooks/useChatContainer";
|
|
32
32
|
import useConversationList from "./components/Chats/hooks/useConversationList";
|
33
33
|
import { ConversationResponse, ExamResponse } from "./components/Chats/configs/types";
|
34
34
|
import usePusherConversation from "./components/Chats/hooks/usePusherConversation";
|
35
|
-
|
35
|
+
import { ToastContainer, toast } from "react-toastify";
|
36
|
+
import { Role } from "./containers/Login/configs/constants";
|
37
|
+
import useLanguage from "./utils/useLanguage";
|
38
|
+
import { LANGUAGES } from "./configs/constants";
|
39
|
+
import CustomCreatable from "./components/Selects/CustomCreatable";
|
40
|
+
import moment from "moment";
|
41
|
+
import CustomAsyncSelect from "./components/Selects/CustomAsyncSelect";
|
42
|
+
import ExamDetailView from "./containers/Exams/views/ExamDetailView";
|
43
|
+
import { ExamDetailViewProps } from "./containers/Exams/configs/interfaces";
|
44
|
+
import { Exam, Question, ArticleGroup } from "./containers/Exams/configs/types";
|
45
|
+
export { diffFromNow, formatTime, utcToLocalTime, setLoading, BASE_URL, ACCESS_TOKEN, Login, store, historyCore, setAlert, setUser, Loading, NotFound, LayoutContext, api, ConfirmDialog, CommonDialog, CommonAlert, CustomPagination, useGoogleSignOut, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, CustomAsyncSelect, getAccessToken, ChatContainer, IChatContainerProps, IChatItemProps, IChatHeaderProps, IInputChatProps, ChatItemType, useChatContainer, useConversationList, ConversationResponse, ExamResponse, usePusherConversation, ToastContainer, toast, Role, useLanguage, LANGUAGES, CustomCreatable, moment, ExamDetailView, ExamDetailViewProps, Exam, Question, ArticleGroup };
|