touchstudy-core 0.1.141 → 0.1.142

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 (30) hide show
  1. package/dist/components/Selects/CustomSelect.d.ts +1 -1
  2. package/dist/containers/PreparedTextbook/components/AcademySelector.d.ts +0 -1
  3. package/dist/containers/PreparedTextbook/components/ArticleBlock.d.ts +1 -0
  4. package/dist/containers/PreparedTextbook/components/ChapterBlock.d.ts +1 -0
  5. package/dist/containers/PreparedTextbook/components/ChapterBlockBody.d.ts +1 -0
  6. package/dist/containers/PreparedTextbook/components/CourseSelector.d.ts +1 -1
  7. package/dist/containers/PreparedTextbook/components/OwnerSelector.d.ts +2 -1
  8. package/dist/containers/PreparedTextbook/components/PreparedTextbookForm.d.ts +4 -0
  9. package/dist/containers/PreparedTextbook/components/QuestionBlock.d.ts +1 -1
  10. package/dist/containers/PreparedTextbook/components/QuestionGroupBlock.d.ts +1 -1
  11. package/dist/containers/PreparedTextbook/components/QuestionGroupBlockBody.d.ts +1 -0
  12. package/dist/containers/PreparedTextbook/components/TextbookContentsTab.d.ts +1 -0
  13. package/dist/containers/PreparedTextbook/components/TextbookInfoTab.d.ts +3 -1
  14. package/dist/containers/PreparedTextbook/components/TextbookOwnersTab.d.ts +2 -1
  15. package/dist/containers/PreparedTextbook/configs/constants.d.ts +2 -0
  16. package/dist/containers/PreparedTextbook/configs/enums.d.ts +5 -0
  17. package/dist/containers/PreparedTextbook/configs/functions.d.ts +17 -3
  18. package/dist/containers/PreparedTextbook/configs/interfaces.d.ts +2 -0
  19. package/dist/containers/PreparedTextbook/configs/types.d.ts +4 -0
  20. package/dist/containers/PreparedTextbook/hooks/useTextbookManagement.d.ts +8 -1
  21. package/dist/containers/Textbooks/components/TextbookRow.d.ts +17 -0
  22. package/dist/containers/Textbooks/configs/types.d.ts +2 -0
  23. package/dist/containers/Textbooks/hooks/useTextbookList.d.ts +5 -2
  24. package/dist/containers/Textbooks/hooks/useTextbookShare.d.ts +0 -2
  25. package/dist/index.css +3 -3
  26. package/dist/index.js +599 -317
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.modern.js +600 -318
  29. package/dist/index.modern.js.map +1 -1
  30. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- declare const CustomSelect: ({ isDefault, defaultValue, options, isDisabled, scrollBottom, value, isMulti, optionValue, ...rest }: any) => React.JSX.Element;
2
+ declare const CustomSelect: ({ isDefault, defaultValue, options, isDisabled, scrollBottom, value, isMulti, optionValue, styles, ...rest }: any) => React.JSX.Element;
3
3
  export default CustomSelect;
@@ -8,7 +8,6 @@ interface Props {
8
8
  isClearable?: boolean;
9
9
  disabled?: boolean;
10
10
  isLoading?: boolean;
11
- valueById?: number;
12
11
  email: string;
13
12
  minimumTextSearchLength?: number;
14
13
  options: any;
@@ -8,6 +8,7 @@ interface Props extends PropsWithChildren, FormikProps<TextbookRequest> {
8
8
  categories: any[];
9
9
  isLoadingCategories: boolean;
10
10
  optionKey: string;
11
+ disabled?: boolean;
11
12
  onDuplicate: (data: ArticleRequest) => void;
12
13
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
13
14
  onOpenSubCategoryMenu: (path: string, id?: number) => void;
@@ -13,6 +13,7 @@ interface Props extends FormikProps<TextbookRequest> {
13
13
  categories: any[];
14
14
  isLoadingQuestionTypes: boolean;
15
15
  questionTypes: any[];
16
+ disabled?: boolean;
16
17
  onToggle: (index: number) => void;
17
18
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
18
19
  onCopiedPrevQuestionGroup: (path: string, paths: number[]) => QuestionGroupRequest | undefined;
@@ -12,6 +12,7 @@ interface Props extends FormikProps<TextbookRequest> {
12
12
  categories: any[];
13
13
  isLoadingQuestionTypes: boolean;
14
14
  questionTypes: any[];
15
+ disabled?: boolean;
15
16
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
16
17
  onCopiedPrevQuestionGroup: (path: string, paths: number[]) => QuestionGroupRequest | undefined;
17
18
  onOpenSubCategoryMenu: (path: string, id?: number) => void;
@@ -12,7 +12,7 @@ interface Props {
12
12
  defaultValue?: any;
13
13
  options: any;
14
14
  isLoading?: boolean;
15
- valueById?: number;
15
+ isDisabled?: boolean;
16
16
  }
17
17
  declare const CourseSelector: FC<Props>;
18
18
  export default CourseSelector;
@@ -5,6 +5,7 @@ declare type Props = {
5
5
  index: number;
6
6
  email: string;
7
7
  onChangeFieldValue: any;
8
+ disabled?: boolean;
8
9
  };
9
- declare const OwnerSelector: ({ values, errors, index, email, onChangeFieldValue, }: Props) => React.JSX.Element;
10
+ declare const OwnerSelector: ({ values, errors, index, email, onChangeFieldValue, disabled }: Props) => React.JSX.Element;
10
11
  export default OwnerSelector;
@@ -2,11 +2,15 @@ import { FormikProps } from "formik";
2
2
  import React, { FC } from "react";
3
3
  import { TextbookRequest } from "../configs/types";
4
4
  interface Props extends FormikProps<TextbookRequest> {
5
+ isCreatedByAdmin?: boolean;
6
+ isSuperAdminUser: boolean;
5
7
  isSuperAdmin?: boolean;
6
8
  isAdmin?: boolean;
7
9
  textbookId?: string;
8
10
  selected: number;
9
11
  coverImage?: string;
12
+ disabled?: boolean;
13
+ ownersDisabled?: boolean;
10
14
  onUploadImage: (event: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
11
15
  onChangeTab: (_: React.SyntheticEvent, newValue: number) => void;
12
16
  }
@@ -7,7 +7,7 @@ interface Props extends PropsWithChildren, FormikProps<TextbookRequest> {
7
7
  answerCount: number;
8
8
  path: string;
9
9
  isMath: boolean;
10
- isDisabled?: boolean;
10
+ disabled?: boolean;
11
11
  questionTitleStyle?: SxProps<Theme>;
12
12
  optionKey: string;
13
13
  isLoadingQuestionTypes: boolean;
@@ -13,7 +13,7 @@ interface Props extends FormikProps<TextbookRequest> {
13
13
  isLoadingQuestionTypes: boolean;
14
14
  questionTypes: any[];
15
15
  optionKey: string;
16
- isDisabled?: boolean;
16
+ disabled?: boolean;
17
17
  onToggle: (index: number) => void;
18
18
  onQuestionCountChange: (count: number, index: number) => void;
19
19
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
@@ -11,6 +11,7 @@ interface Props extends FormikProps<TextbookRequest> {
11
11
  categories: any[];
12
12
  isLoadingQuestionTypes: boolean;
13
13
  questionTypes: any[];
14
+ disabled?: boolean;
14
15
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
15
16
  onOpenSubCategoryMenu: (path: string, id?: number) => void;
16
17
  onOpenCategoryMenu: (path: string) => void;
@@ -2,6 +2,7 @@ import { FC } from "react";
2
2
  import { FormikProps } from "formik";
3
3
  import { TextbookRequest } from "../configs/types";
4
4
  interface Props extends FormikProps<TextbookRequest> {
5
+ disabled?: boolean;
5
6
  }
6
7
  declare const TextbookContentsTab: FC<Props>;
7
8
  export default TextbookContentsTab;
@@ -2,9 +2,11 @@ import React, { FC } from "react";
2
2
  import { FormikProps } from "formik";
3
3
  import { TextbookRequest } from "../configs/types";
4
4
  interface Props extends FormikProps<TextbookRequest> {
5
+ isCreatedByAdmin?: boolean;
5
6
  coverImage?: string;
6
- isAdmin?: boolean;
7
+ isSuperAdminUser?: boolean;
7
8
  textbookId?: string;
9
+ disabled?: boolean;
8
10
  handleUploadImage: (event: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
9
11
  }
10
12
  declare const TextbookInfoTab: FC<Props>;
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import { FormikProps } from "formik";
3
3
  import { TextbookRequest } from "../configs/types";
4
4
  interface Props extends FormikProps<TextbookRequest> {
5
+ disabled?: boolean;
5
6
  }
6
- declare const TextbookOwnersTab: ({ errors, values, setFieldValue }: Props) => React.JSX.Element;
7
+ declare const TextbookOwnersTab: ({ errors, values, disabled, setFieldValue }: Props) => React.JSX.Element;
7
8
  export default TextbookOwnersTab;
@@ -68,6 +68,7 @@ export declare const preparedTextbookSchema: (t: any) => yup.ObjectSchema<{
68
68
  isbn: string;
69
69
  grade: number;
70
70
  type: number | undefined;
71
+ textbookOwners: {}[] | undefined;
71
72
  chapters: {
72
73
  questionGroups: any;
73
74
  subChapters: any;
@@ -81,6 +82,7 @@ export declare const preparedTextbookSchema: (t: any) => yup.ObjectSchema<{
81
82
  isbn: undefined;
82
83
  grade: undefined;
83
84
  type: undefined;
85
+ textbookOwners: "";
84
86
  chapters: "";
85
87
  }, "">;
86
88
  export declare const DEFAULT_TEXTBOOK_REQUEST: TextbookRequest;
@@ -14,3 +14,8 @@ export declare enum HighSchoolGrade {
14
14
  ProbabilityAndStatistics = 6,
15
15
  Geometry = 7
16
16
  }
17
+ export declare enum TextbookEditorType {
18
+ Default = 0,
19
+ Korea = 1,
20
+ Math = 2
21
+ }
@@ -1,4 +1,5 @@
1
1
  import { TextbookDetailResponse } from "./types";
2
+ import { QuestionAnswerType } from "../../../utils";
2
3
  export declare const reduceToMathArticles: (textbook: any, isMath?: number | undefined) => any;
3
4
  export declare const resetAllCategoriesAndQuestionTypesBySubject: (textbook: any, subject?: any) => any;
4
5
  export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetailResponse | undefined) => import("./types").TextbookRequest | {
@@ -14,7 +15,19 @@ export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetai
14
15
  publisher: string;
15
16
  isbn: string;
16
17
  coverImage: string;
17
- textbookOwners: import("./types").TextbookOwner[];
18
+ textbookOwners: {
19
+ academy: {
20
+ label: any;
21
+ value: any;
22
+ } | null;
23
+ course: {
24
+ label: any;
25
+ value: any;
26
+ } | null;
27
+ email: string;
28
+ academyId: number;
29
+ courseId: number;
30
+ }[];
18
31
  isPublic: boolean;
19
32
  isShared: boolean;
20
33
  isPrepared: boolean;
@@ -39,7 +52,7 @@ export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetai
39
52
  score: number;
40
53
  questionOrder: number;
41
54
  textualAnswer: string;
42
- questionAnswerType: import("../../..").QuestionAnswerType;
55
+ questionAnswerType: QuestionAnswerType;
43
56
  questionTypeName?: string | undefined;
44
57
  }[];
45
58
  articles: {
@@ -77,7 +90,7 @@ export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetai
77
90
  score: number;
78
91
  questionOrder: number;
79
92
  textualAnswer: string;
80
- questionAnswerType: import("../../..").QuestionAnswerType;
93
+ questionAnswerType: QuestionAnswerType;
81
94
  questionTypeName?: string | undefined;
82
95
  }[];
83
96
  articles: {
@@ -99,3 +112,4 @@ export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetai
99
112
  }[];
100
113
  }[];
101
114
  };
115
+ export declare const handleKeyDown: (e: any) => void;
@@ -1,6 +1,8 @@
1
1
  import { ReactElement } from "react";
2
+ import { Role } from "../../../utils";
2
3
  export interface PreparedTextbookDetailProps {
3
4
  textbookId?: string;
4
5
  onBackToList: () => void;
5
6
  notFoundView: ReactElement;
7
+ role: Role;
6
8
  }
@@ -102,6 +102,8 @@ export declare type TextbookDetailResponse = {
102
102
  textbookOwners: TextbookOwner[];
103
103
  isPrepared?: boolean;
104
104
  type: number;
105
+ createdBy?: any;
106
+ isCreatedByAdmin?: boolean;
105
107
  };
106
108
  export declare type Academy = {
107
109
  id: number;
@@ -115,6 +117,8 @@ export declare type TextbookOwner = {
115
117
  email: string;
116
118
  academyId: number;
117
119
  courseId: number;
120
+ academy: any;
121
+ course: any;
118
122
  };
119
123
  export declare type TextbookResponse = {
120
124
  id: number;
@@ -1,16 +1,23 @@
1
1
  import { ChapterResponse, TextbookRequest, TextbookDetailResponse } from "../configs/types";
2
+ import { Role } from "../../../utils";
2
3
  import { FormikHelpers } from "formik";
3
4
  declare type Props = {
5
+ role: Role;
4
6
  textbookId?: string;
5
7
  onNavigateList: () => void;
6
8
  };
7
- declare const useTextbookManagement: ({ textbookId, onNavigateList }: Props) => {
9
+ declare const useTextbookManagement: ({ textbookId, role, onNavigateList }: Props) => {
8
10
  t: any;
11
+ isAdminSite: boolean;
12
+ disabledTextbookOwners: any;
13
+ isReadonly: boolean;
14
+ isEditable: any;
9
15
  isAdmin: any;
10
16
  theme: import("@mui/material").Theme;
11
17
  history: History;
12
18
  coverImage: string | undefined;
13
19
  isSuperAdmin: boolean;
20
+ isSuperAdminUser: any;
14
21
  openDialog: boolean;
15
22
  handleSubmit: (values: TextbookRequest, _formikHelpers: FormikHelpers<TextbookRequest>) => Promise<void>;
16
23
  selectedTextbook: TextbookDetailResponse | undefined;
@@ -0,0 +1,17 @@
1
+ import { FC } from "react";
2
+ import { TextbookResponse } from "../configs/types";
3
+ import { Role } from "../../../utils";
4
+ interface Props {
5
+ index: number;
6
+ data: TextbookResponse;
7
+ role: Role;
8
+ isSuperAdmin: boolean;
9
+ calcOrderNumber: (index: number) => number;
10
+ onUpdateTextbook: (data: TextbookResponse) => void;
11
+ onDeleteTextbook: (data: TextbookResponse) => void;
12
+ onViewTextbook: (data: TextbookResponse) => void;
13
+ onShareTextbook: (data: TextbookResponse) => void;
14
+ onUpdateShareTextbook: (data: TextbookResponse) => void;
15
+ }
16
+ declare const TextbookRow: FC<Props>;
17
+ export default TextbookRow;
@@ -28,6 +28,8 @@ export declare type TextbookResponse = {
28
28
  sharedUsers: string[];
29
29
  createdBy: CreatedBy;
30
30
  isShared: boolean;
31
+ isPublic: boolean;
32
+ textbookOwners?: any;
31
33
  };
32
34
  export declare type TeacherSimpleResponse = {
33
35
  id: number;
@@ -2,10 +2,13 @@
2
2
  import { TextbookResponse } from "../configs/types";
3
3
  import { TextbookListProps } from "../views/TextbookList";
4
4
  declare const useTextbookList: (props: TextbookListProps) => {
5
- filter: import("../../..").SearchQuery;
5
+ user: any;
6
+ isTeacherSite: boolean;
7
+ isTeacher: boolean;
8
+ filter: import("../../../utils").SearchQuery;
6
9
  textSearchRef: import("react").RefObject<HTMLInputElement>;
7
10
  getData: (isLoading?: boolean) => Promise<void>;
8
- paging: import("../../..").PagingResponse;
11
+ paging: import("../../../utils").PagingResponse;
9
12
  textbooks: TextbookResponse[];
10
13
  selectedTextbook: TextbookResponse | undefined;
11
14
  handleSort: (sortColumnName: string) => void;
@@ -30,8 +30,6 @@ declare const useTextbookShare: (props: TextbookShareProps) => {
30
30
  isUpdate: boolean;
31
31
  handleUpdateSharedTextbook: (teacherIds: number[], textbookId: number) => Promise<void>;
32
32
  currentModel: TextbookResponse | undefined;
33
- enabledSave: (textbook: TextbookResponse) => any;
34
- enabledShare: (textbook: TextbookResponse) => any;
35
33
  isAdmin: any;
36
34
  isAdminSite: boolean;
37
35
  };
package/dist/index.css CHANGED
@@ -1409,7 +1409,7 @@
1409
1409
 
1410
1410
  ._11aYm {
1411
1411
  width: 70vw;
1412
- height: calc(100vh - 78px);
1412
+ height: calc(100dvh - 78px);
1413
1413
  position: fixed;
1414
1414
  right: -100%;
1415
1415
  bottom: 0;
@@ -1582,7 +1582,7 @@
1582
1582
  @charset "UTF-8";
1583
1583
  ._1k4kj {
1584
1584
  width: 70vw;
1585
- height: calc(100vh - 78px);
1585
+ height: calc(100dvh - 78px);
1586
1586
  position: fixed;
1587
1587
  right: -100%;
1588
1588
  bottom: 0;
@@ -1593,7 +1593,7 @@
1593
1593
 
1594
1594
  ._xnHGE {
1595
1595
  width: 100vw;
1596
- height: 100vh;
1596
+ height: 100dvh;
1597
1597
  background-color: rgba(0, 0, 0, 0);
1598
1598
  position: fixed;
1599
1599
  right: 0;