touchstudy-core 0.1.144 → 0.1.145

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 (39) hide show
  1. package/dist/components/List/configs/interfaces.d.ts +1 -1
  2. package/dist/components/List/partials/VirtualListItem.d.ts +1 -1
  3. package/dist/components/Selects/CustomSelect.d.ts +1 -1
  4. package/dist/components/Tables/VirtualTableRowItem.d.ts +5 -6
  5. package/dist/components/Tables/VirtualTableView.d.ts +1 -1
  6. package/dist/components/Tables/configs/interfaces.d.ts +4 -11
  7. package/dist/containers/Notes/components/NoteItem.d.ts +0 -1
  8. package/dist/containers/PreparedTextbook/apiClients/textbookService.d.ts +1 -1
  9. package/dist/containers/PreparedTextbook/components/AcademySelector.d.ts +1 -1
  10. package/dist/containers/PreparedTextbook/components/ArticleBlock.d.ts +0 -1
  11. package/dist/containers/PreparedTextbook/components/ChapterBlock.d.ts +0 -1
  12. package/dist/containers/PreparedTextbook/components/ChapterBlockBody.d.ts +0 -1
  13. package/dist/containers/PreparedTextbook/components/CourseSelector.d.ts +1 -1
  14. package/dist/containers/PreparedTextbook/components/OwnerSelector.d.ts +2 -3
  15. package/dist/containers/PreparedTextbook/components/PreparedTextbookForm.d.ts +0 -5
  16. package/dist/containers/PreparedTextbook/components/QuestionBlock.d.ts +1 -1
  17. package/dist/containers/PreparedTextbook/components/QuestionGroupBlock.d.ts +1 -1
  18. package/dist/containers/PreparedTextbook/components/QuestionGroupBlockBody.d.ts +0 -1
  19. package/dist/containers/PreparedTextbook/components/TextbookContentsTab.d.ts +0 -1
  20. package/dist/containers/PreparedTextbook/components/TextbookInfoTab.d.ts +1 -3
  21. package/dist/containers/PreparedTextbook/components/TextbookOwnersTab.d.ts +1 -2
  22. package/dist/containers/PreparedTextbook/configs/constants.d.ts +0 -2
  23. package/dist/containers/PreparedTextbook/configs/enums.d.ts +0 -5
  24. package/dist/containers/PreparedTextbook/configs/functions.d.ts +3 -17
  25. package/dist/containers/PreparedTextbook/configs/interfaces.d.ts +0 -2
  26. package/dist/containers/PreparedTextbook/configs/types.d.ts +3 -5
  27. package/dist/containers/PreparedTextbook/hooks/useSelect.d.ts +10 -8
  28. package/dist/containers/PreparedTextbook/hooks/useTextbookManagement.d.ts +1 -8
  29. package/dist/containers/Textbooks/configs/types.d.ts +0 -2
  30. package/dist/containers/Textbooks/hooks/useTextbookList.d.ts +2 -5
  31. package/dist/containers/Textbooks/hooks/useTextbookShare.d.ts +2 -0
  32. package/dist/index.css +3 -3
  33. package/dist/index.js +749 -1342
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.modern.js +761 -1345
  36. package/dist/index.modern.js.map +1 -1
  37. package/dist/utils/constants.d.ts +10 -2
  38. package/dist/utils/index.d.ts +0 -1
  39. package/package.json +2 -2
@@ -6,7 +6,7 @@ export interface VirtualListViewProps<T> {
6
6
  containerProps?: BoxProps;
7
7
  listHeight?: number;
8
8
  overscanRowCount?: number;
9
- renderItem: (item: T, index: number, measure: () => void) => ReactElement;
9
+ renderItem: (item: T, index: number) => ReactElement;
10
10
  onLoadMore?: () => void;
11
11
  emptyElement?: ReactElement;
12
12
  loadingElement?: ReactElement;
@@ -3,7 +3,7 @@ import { ListRowProps } from "react-virtualized";
3
3
  interface VirtualListItemProps<T> extends ListRowProps {
4
4
  isLoading?: boolean;
5
5
  rowData?: T;
6
- renderItem: (item: T, index: number, measure: () => void) => ReactElement;
6
+ renderItem: (item: T, index: number) => ReactElement;
7
7
  loadingElement?: ReactElement;
8
8
  }
9
9
  declare const VirtualListItem: FC<VirtualListItemProps<any>>;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- declare const CustomSelect: ({ isDefault, defaultValue, options, isDisabled, scrollBottom, value, isMulti, optionValue, styles, ...rest }: any) => React.JSX.Element;
2
+ declare const CustomSelect: ({ isDefault, defaultValue, options, isDisabled, scrollBottom, value, isMulti, optionValue, ...rest }: any) => React.JSX.Element;
3
3
  export default CustomSelect;
@@ -1,10 +1,9 @@
1
- import React, { ReactElement } from "react";
2
- import { CellMeasurerCache, GridCellProps } from "react-virtualized";
1
+ import { FC, ReactElement } from "react";
2
+ import { GridCellProps } from "react-virtualized";
3
3
  interface VirtualTableRowItemProps extends GridCellProps {
4
4
  isLoading?: boolean;
5
- renderItem: (rowIndex: number, columnIndex: number, measure: () => void) => ReactElement;
5
+ renderItem: (rowIndex: number, columnIndex: number) => ReactElement;
6
6
  loadingElement?: ReactElement;
7
- cellMeasurerCache: CellMeasurerCache;
8
7
  }
9
- declare const _default: React.NamedExoticComponent<VirtualTableRowItemProps>;
10
- export default _default;
8
+ declare const VirtualTableRowItem: FC<VirtualTableRowItemProps>;
9
+ export default VirtualTableRowItem;
@@ -1,4 +1,4 @@
1
1
  import { FC } from "react";
2
2
  import { VirtualTableViewProps } from "./configs/interfaces";
3
- declare const VirtualTableView: FC<VirtualTableViewProps>;
3
+ declare const VirtualTableView: FC<VirtualTableViewProps<any>>;
4
4
  export default VirtualTableView;
@@ -1,21 +1,14 @@
1
1
  import { BoxProps } from "@mui/material";
2
- import { CSSProperties, ReactElement, RefObject } from "react";
3
- import { CellMeasurerCache, Index, MultiGrid } from "react-virtualized";
4
- export interface VirtualTableViewProps {
2
+ import { CSSProperties, ReactElement } from "react";
3
+ export interface VirtualTableViewProps<T> {
4
+ data: T[];
5
5
  loading: boolean;
6
- hasHeader?: boolean;
7
6
  containerProps?: BoxProps;
8
7
  columnCount: number;
9
8
  listHeight?: number;
10
9
  listWidth?: number;
11
- containerRef?: RefObject<HTMLDivElement>;
12
- multiGridRef?: RefObject<MultiGrid>;
13
10
  overscanRowCount?: number;
14
- overscanColumnCount?: number;
15
- itemsCount: number;
16
- cellCache?: CellMeasurerCache;
17
- columnWidth?: number | ((params: Index, cache: CellMeasurerCache) => number);
18
- renderItem: (rowIndex: number, columnIndex: number, measure: () => void) => ReactElement;
11
+ renderItem: (item: T, index: number) => ReactElement;
19
12
  onLoadMore?: () => void;
20
13
  emptyElement?: ReactElement;
21
14
  loadingElement?: ReactElement;
@@ -7,7 +7,6 @@ interface NoteItemProps extends TooltipProps<NoteResponse> {
7
7
  openTooltip: boolean;
8
8
  placement?: string;
9
9
  actions: Action<NoteResponse>[];
10
- onLoad?: () => void;
11
10
  }
12
11
  declare const NoteItem: FC<NoteItemProps>;
13
12
  export default NoteItem;
@@ -4,5 +4,5 @@ export declare const getTextbookDetailApi: (id: string, isAdmin?: boolean | unde
4
4
  export declare const getTextbookListApi: (query: TextbookQuery, isAdmin?: boolean | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
5
5
  export declare const createTextbookApi: (values: any, isAdmin?: boolean | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
6
6
  export declare const updateTextbookApi: (values: any, id: number, isAdmin?: boolean | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
7
- export declare const getCourseByTeacherAcademy: (email: string, academyId: number) => Promise<import("axios").AxiosResponse<any, any>>;
7
+ export declare const getAcademyByTeacher: (email: string, isAdmin?: boolean | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
8
8
  export declare const deleteTextbookApi: (textbookId: number, isAdmin?: boolean | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -8,10 +8,10 @@ interface Props {
8
8
  isClearable?: boolean;
9
9
  disabled?: boolean;
10
10
  isLoading?: boolean;
11
+ valueById?: number;
11
12
  email: string;
12
13
  minimumTextSearchLength?: number;
13
14
  options: any;
14
- defaultValue: any;
15
15
  }
16
16
  declare const AcademySelector: FC<Props>;
17
17
  export default AcademySelector;
@@ -8,7 +8,6 @@ interface Props extends PropsWithChildren, FormikProps<TextbookRequest> {
8
8
  categories: any[];
9
9
  isLoadingCategories: boolean;
10
10
  optionKey: string;
11
- disabled?: boolean;
12
11
  onDuplicate: (data: ArticleRequest) => void;
13
12
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
14
13
  onOpenSubCategoryMenu: (path: string, id?: number) => void;
@@ -13,7 +13,6 @@ interface Props extends FormikProps<TextbookRequest> {
13
13
  categories: any[];
14
14
  isLoadingQuestionTypes: boolean;
15
15
  questionTypes: any[];
16
- disabled?: boolean;
17
16
  onToggle: (index: number) => void;
18
17
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
19
18
  onCopiedPrevQuestionGroup: (path: string, paths: number[]) => QuestionGroupRequest | undefined;
@@ -12,7 +12,6 @@ interface Props extends FormikProps<TextbookRequest> {
12
12
  categories: any[];
13
13
  isLoadingQuestionTypes: boolean;
14
14
  questionTypes: any[];
15
- disabled?: boolean;
16
15
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
17
16
  onCopiedPrevQuestionGroup: (path: string, paths: number[]) => QuestionGroupRequest | undefined;
18
17
  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
- isDisabled?: boolean;
15
+ valueById?: number;
16
16
  }
17
17
  declare const CourseSelector: FC<Props>;
18
18
  export default CourseSelector;
@@ -3,9 +3,8 @@ declare type Props = {
3
3
  values: any;
4
4
  errors: any;
5
5
  index: number;
6
- email: string;
6
+ academyId?: number;
7
7
  onChangeFieldValue: any;
8
- disabled?: boolean;
9
8
  };
10
- declare const OwnerSelector: ({ values, errors, index, email, onChangeFieldValue, disabled }: Props) => React.JSX.Element;
9
+ declare const OwnerSelector: ({ values, errors, index, academyId, onChangeFieldValue }: Props) => React.JSX.Element;
11
10
  export default OwnerSelector;
@@ -2,15 +2,10 @@ 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;
7
- isSuperAdmin?: boolean;
8
5
  isAdmin?: boolean;
9
6
  textbookId?: string;
10
7
  selected: number;
11
8
  coverImage?: string;
12
- disabled?: boolean;
13
- ownersDisabled?: boolean;
14
9
  onUploadImage: (event: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
15
10
  onChangeTab: (_: React.SyntheticEvent, newValue: number) => void;
16
11
  }
@@ -7,7 +7,7 @@ interface Props extends PropsWithChildren, FormikProps<TextbookRequest> {
7
7
  answerCount: number;
8
8
  path: string;
9
9
  isMath: boolean;
10
- disabled?: boolean;
10
+ isDisabled?: 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
- disabled?: boolean;
16
+ isDisabled?: 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,7 +11,6 @@ interface Props extends FormikProps<TextbookRequest> {
11
11
  categories: any[];
12
12
  isLoadingQuestionTypes: boolean;
13
13
  questionTypes: any[];
14
- disabled?: boolean;
15
14
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
16
15
  onOpenSubCategoryMenu: (path: string, id?: number) => void;
17
16
  onOpenCategoryMenu: (path: string) => void;
@@ -2,7 +2,6 @@ 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;
6
5
  }
7
6
  declare const TextbookContentsTab: FC<Props>;
8
7
  export default TextbookContentsTab;
@@ -2,11 +2,9 @@ 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;
6
5
  coverImage?: string;
7
- isSuperAdminUser?: boolean;
6
+ isAdmin?: boolean;
8
7
  textbookId?: string;
9
- disabled?: boolean;
10
8
  handleUploadImage: (event: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
11
9
  }
12
10
  declare const TextbookInfoTab: FC<Props>;
@@ -2,7 +2,6 @@ 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;
6
5
  }
7
- declare const TextbookOwnersTab: ({ errors, values, disabled, setFieldValue }: Props) => React.JSX.Element;
6
+ declare const TextbookOwnersTab: ({ errors, values, setFieldValue }: Props) => React.JSX.Element;
8
7
  export default TextbookOwnersTab;
@@ -68,7 +68,6 @@ export declare const preparedTextbookSchema: (t: any) => yup.ObjectSchema<{
68
68
  isbn: string;
69
69
  grade: number;
70
70
  type: number | undefined;
71
- textbookOwners: {}[] | undefined;
72
71
  chapters: {
73
72
  questionGroups: any;
74
73
  subChapters: any;
@@ -82,7 +81,6 @@ export declare const preparedTextbookSchema: (t: any) => yup.ObjectSchema<{
82
81
  isbn: undefined;
83
82
  grade: undefined;
84
83
  type: undefined;
85
- textbookOwners: "";
86
84
  chapters: "";
87
85
  }, "">;
88
86
  export declare const DEFAULT_TEXTBOOK_REQUEST: TextbookRequest;
@@ -14,8 +14,3 @@ 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,5 +1,4 @@
1
1
  import { TextbookDetailResponse } from "./types";
2
- import { QuestionAnswerType } from "../../../utils";
3
2
  export declare const reduceToMathArticles: (textbook: any, isMath?: number | undefined) => any;
4
3
  export declare const resetAllCategoriesAndQuestionTypesBySubject: (textbook: any, subject?: any) => any;
5
4
  export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetailResponse | undefined) => import("./types").TextbookRequest | {
@@ -15,19 +14,7 @@ export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetai
15
14
  publisher: string;
16
15
  isbn: string;
17
16
  coverImage: string;
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
- }[];
17
+ textbookOwners: import("./types").TextbookOwner[];
31
18
  isPublic: boolean;
32
19
  isShared: boolean;
33
20
  isPrepared: boolean;
@@ -52,7 +39,7 @@ export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetai
52
39
  score: number;
53
40
  questionOrder: number;
54
41
  textualAnswer: string;
55
- questionAnswerType: QuestionAnswerType;
42
+ questionAnswerType: import("../../..").QuestionAnswerType;
56
43
  questionTypeName?: string | undefined;
57
44
  }[];
58
45
  articles: {
@@ -90,7 +77,7 @@ export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetai
90
77
  score: number;
91
78
  questionOrder: number;
92
79
  textualAnswer: string;
93
- questionAnswerType: QuestionAnswerType;
80
+ questionAnswerType: import("../../..").QuestionAnswerType;
94
81
  questionTypeName?: string | undefined;
95
82
  }[];
96
83
  articles: {
@@ -112,4 +99,3 @@ export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetai
112
99
  }[];
113
100
  }[];
114
101
  };
115
- export declare const handleKeyDown: (e: any) => void;
@@ -1,8 +1,6 @@
1
1
  import { ReactElement } from "react";
2
- import { Role } from "../../../utils";
3
2
  export interface PreparedTextbookDetailProps {
4
3
  textbookId?: string;
5
4
  onBackToList: () => void;
6
5
  notFoundView: ReactElement;
7
- role: Role;
8
6
  }
@@ -102,23 +102,21 @@ export declare type TextbookDetailResponse = {
102
102
  textbookOwners: TextbookOwner[];
103
103
  isPrepared?: boolean;
104
104
  type: number;
105
- createdBy?: any;
106
- isCreatedByAdmin?: boolean;
107
105
  };
108
106
  export declare type Academy = {
109
107
  id: number;
110
108
  name: string;
109
+ courses: Course[];
111
110
  };
112
111
  export declare type Course = {
113
- id: number;
112
+ id: 1;
114
113
  name: string;
114
+ teacherEmails: string[];
115
115
  };
116
116
  export declare type TextbookOwner = {
117
117
  email: string;
118
118
  academyId: number;
119
119
  courseId: number;
120
- academy: any;
121
- course: any;
122
120
  };
123
121
  export declare type TextbookResponse = {
124
122
  id: number;
@@ -1,16 +1,18 @@
1
1
  declare type Props = {
2
- email: string;
2
+ academyId?: number;
3
+ handleChangeEmail: any;
3
4
  };
4
- declare const useSelect: ({ email }: Props) => {
5
+ declare const useSelect: ({ academyId, handleChangeEmail }: Props) => {
5
6
  t: any;
7
+ loadData: any;
6
8
  isLoading: boolean;
7
- academies: {
8
- label: any;
9
- value: any;
10
- }[];
11
- courses: {
9
+ academyOptions: {
12
10
  label: string;
13
- value: any;
11
+ value: number;
14
12
  }[];
13
+ courseOptions: {
14
+ label: string;
15
+ value: 1;
16
+ }[] | undefined;
15
17
  };
16
18
  export default useSelect;
@@ -1,23 +1,16 @@
1
1
  import { ChapterResponse, TextbookRequest, TextbookDetailResponse } from "../configs/types";
2
- import { Role } from "../../../utils";
3
2
  import { FormikHelpers } from "formik";
4
3
  declare type Props = {
5
- role: Role;
6
4
  textbookId?: string;
7
5
  onNavigateList: () => void;
8
6
  };
9
- declare const useTextbookManagement: ({ textbookId, role, onNavigateList }: Props) => {
7
+ declare const useTextbookManagement: ({ textbookId, onNavigateList }: Props) => {
10
8
  t: any;
11
- isAdminSite: boolean;
12
- disabledTextbookOwners: any;
13
- isReadonly: boolean;
14
- isEditable: any;
15
9
  isAdmin: any;
16
10
  theme: import("@mui/material").Theme;
17
11
  history: History;
18
12
  coverImage: string | undefined;
19
13
  isSuperAdmin: boolean;
20
- isSuperAdminUser: any;
21
14
  openDialog: boolean;
22
15
  handleSubmit: (values: TextbookRequest, _formikHelpers: FormikHelpers<TextbookRequest>) => Promise<void>;
23
16
  selectedTextbook: TextbookDetailResponse | undefined;
@@ -28,8 +28,6 @@ export declare type TextbookResponse = {
28
28
  sharedUsers: string[];
29
29
  createdBy: CreatedBy;
30
30
  isShared: boolean;
31
- isPublic: boolean;
32
- textbookOwners?: any;
33
31
  };
34
32
  export declare type TeacherSimpleResponse = {
35
33
  id: number;
@@ -2,13 +2,10 @@
2
2
  import { TextbookResponse } from "../configs/types";
3
3
  import { TextbookListProps } from "../views/TextbookList";
4
4
  declare const useTextbookList: (props: TextbookListProps) => {
5
- user: any;
6
- isTeacherSite: boolean;
7
- isTeacher: boolean;
8
- filter: import("../../../utils").SearchQuery;
5
+ filter: import("../../..").SearchQuery;
9
6
  textSearchRef: import("react").RefObject<HTMLInputElement>;
10
7
  getData: (isLoading?: boolean) => Promise<void>;
11
- paging: import("../../../utils").PagingResponse;
8
+ paging: import("../../..").PagingResponse;
12
9
  textbooks: TextbookResponse[];
13
10
  selectedTextbook: TextbookResponse | undefined;
14
11
  handleSort: (sortColumnName: string) => void;
@@ -30,6 +30,8 @@ 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;
33
35
  isAdmin: any;
34
36
  isAdminSite: boolean;
35
37
  };
package/dist/index.css CHANGED
@@ -1409,7 +1409,7 @@
1409
1409
 
1410
1410
  ._11aYm {
1411
1411
  width: 70vw;
1412
- height: calc(100dvh - 78px);
1412
+ height: calc(100vh - 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(100dvh - 78px);
1585
+ height: calc(100vh - 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: 100dvh;
1596
+ height: 100vh;
1597
1597
  background-color: rgba(0, 0, 0, 0);
1598
1598
  position: fixed;
1599
1599
  right: 0;