touchstudy-core 0.1.168 → 0.1.170

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 (45) hide show
  1. package/dist/components/Selectors/StudentSelector.d.ts +3 -1
  2. package/dist/components/Selectors/TeacherSelector.d.ts +15 -0
  3. package/dist/containers/Announcements/apiClients/announcementService.d.ts +5 -0
  4. package/dist/containers/Announcements/components/AnnouncementItem.d.ts +11 -0
  5. package/dist/containers/Announcements/configs/constants.d.ts +3 -0
  6. package/dist/containers/Announcements/configs/enums.d.ts +8 -0
  7. package/dist/containers/Announcements/configs/fns.d.ts +10 -0
  8. package/dist/containers/Announcements/configs/types.d.ts +24 -0
  9. package/dist/containers/Announcements/configs/utils.d.ts +3 -0
  10. package/dist/containers/Announcements/index.d.ts +5 -0
  11. package/dist/containers/Announcements/views/AnnouncementContainer.d.ts +10 -0
  12. package/dist/containers/Announcements/views/AnnouncementList.d.ts +12 -0
  13. package/dist/containers/Notes/components/GeneralNoteDialog.d.ts +4 -0
  14. package/dist/containers/Notes/components/NoteItemList.d.ts +14 -0
  15. package/dist/containers/Notes/components/NotetabPanel.d.ts +8 -0
  16. package/dist/containers/Notes/components/TeacherAdminNoteDialog.d.ts +4 -0
  17. package/dist/containers/Notes/configs/constants.d.ts +27 -0
  18. package/dist/containers/Notes/configs/enums.d.ts +6 -2
  19. package/dist/containers/Notes/configs/fns.d.ts +2 -0
  20. package/dist/containers/Notes/configs/interfaces.d.ts +10 -1
  21. package/dist/containers/Notes/configs/types.d.ts +1 -1
  22. package/dist/containers/Notes/index.d.ts +4 -2
  23. package/dist/containers/Notes/views/NoteList.d.ts +11 -0
  24. package/dist/containers/Notes/views/NoteTabs.d.ts +7 -0
  25. package/dist/containers/StudentInfoDrawer/components/Exam/ExamResultList.d.ts +4 -0
  26. package/dist/containers/StudentInfoDrawer/components/Note/NoteDrawer.d.ts +3 -2
  27. package/dist/containers/StudentInfoDrawer/configs/types.d.ts +2 -2
  28. package/dist/containers/StudentInfoDrawer/index.d.ts +2 -1
  29. package/dist/containers/Textbooks/configs/types.d.ts +3 -3
  30. package/dist/containers/index.d.ts +1 -0
  31. package/dist/index.js +1733 -226
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.modern.js +1742 -237
  34. package/dist/index.modern.js.map +1 -1
  35. package/dist/layouts/Header.d.ts +3 -0
  36. package/dist/layouts/LayoutContext.d.ts +0 -1
  37. package/dist/redux/commons/action.d.ts +1 -1
  38. package/dist/services/noteService.d.ts +2 -0
  39. package/dist/services/teacherService.d.ts +5 -0
  40. package/dist/utils/functions/timeAgo.d.ts +1 -1
  41. package/dist/utils/hooks/useLayoutContext.d.ts +1 -1
  42. package/dist/utils/hooks/useList.d.ts +2 -1
  43. package/dist/utils/hooks/useVirtualList.d.ts +4 -2
  44. package/dist/utils/types/note.d.ts +17 -0
  45. package/package.json +1 -1
@@ -4,7 +4,9 @@ interface Props {
4
4
  onChange: any;
5
5
  externalStudentIds?: number[];
6
6
  title?: string;
7
- disabled: boolean;
7
+ disabled?: boolean;
8
+ isMulti?: boolean;
9
+ minSearchLength?: number;
8
10
  }
9
11
  declare const StudentSelector: FC<Props>;
10
12
  export default StudentSelector;
@@ -0,0 +1,15 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ value?: any;
4
+ onChange: any;
5
+ externalTeacherIds?: number[];
6
+ placeholder?: string;
7
+ title?: string;
8
+ isMultiple?: boolean;
9
+ isClearable?: boolean;
10
+ useUserId?: boolean;
11
+ exceptMe?: boolean;
12
+ isDisabled?: boolean;
13
+ }
14
+ declare const TeacherSelector: FC<Props>;
15
+ export default TeacherSelector;
@@ -0,0 +1,5 @@
1
+ import { BaseSearchQuery } from "../../../utils";
2
+ export declare const getAnnouncementListApi: (query: BaseSearchQuery<string>) => Promise<import("axios").AxiosResponse<any, any>>;
3
+ export declare const getTotalNumberUnreadAnnouncementsApi: () => Promise<import("axios").AxiosResponse<any, any>>;
4
+ export declare const markAsReadAnnouncementsApi: () => Promise<import("axios").AxiosResponse<any, any>>;
5
+ export declare const markAsReadAnnouncementByIdApi: (id: number) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ import { AnnouncementResponse } from "../configs/types";
3
+ import { Role } from "../../../utils";
4
+ interface Props {
5
+ role: Role;
6
+ data: AnnouncementResponse;
7
+ renderLink: (children: JSX.Element, data: AnnouncementResponse) => JSX.Element;
8
+ onLoad: () => void;
9
+ }
10
+ declare const AnnouncementItem: FC<Props>;
11
+ export default AnnouncementItem;
@@ -0,0 +1,3 @@
1
+ import { BaseSearchQuery } from "../../../utils";
2
+ export declare const DEFAULT_ANNOUNCEMENT_FILTER: BaseSearchQuery<string>;
3
+ export declare const ANNOUNCEMENT_CHANNEL = "ANNOUNCEMENT_A{academy}_U{userId}_CHANNEL";
@@ -0,0 +1,8 @@
1
+ export declare enum AnnouncementEvent {
2
+ ReceivedNewNote = "ReceivedNewNote",
3
+ UpdatedNote = "UpdatedNote",
4
+ DeletedNote = "DeletedNote"
5
+ }
6
+ export declare enum AnnouncementType {
7
+ ReceivedNewNote = "ReceivedNewNote"
8
+ }
@@ -0,0 +1,10 @@
1
+ import { Role } from "../../../utils";
2
+ import { AnnouncementDataShow, AnnouncementResponse } from "./types";
3
+ export declare const stringToColor: (string: string) => string;
4
+ export declare const stringAvatar: (name: string) => {
5
+ sx: {
6
+ bgcolor: string;
7
+ };
8
+ children: string;
9
+ };
10
+ export declare const convertAnnouncementData: (t: any, role: Role, announcement: AnnouncementResponse) => AnnouncementDataShow;
@@ -0,0 +1,24 @@
1
+ import { AnnouncementType } from "./enums";
2
+ export declare type AnnouncementResponse = {
3
+ id: number;
4
+ isRead: boolean;
5
+ type: AnnouncementType;
6
+ extraData: string;
7
+ createdAt: string;
8
+ resourceId: string;
9
+ resource: string;
10
+ data: AnnouncementData;
11
+ };
12
+ export declare type AnnouncementData = {
13
+ senderId: number;
14
+ senderFullName: string;
15
+ senderEmail: string;
16
+ senderAvatar: string;
17
+ data: string;
18
+ };
19
+ export declare type AnnouncementDataShow = {
20
+ image?: string;
21
+ name: string;
22
+ content: string;
23
+ action: string;
24
+ };
@@ -0,0 +1,3 @@
1
+ import { AnnouncementResponse } from './types';
2
+ export declare const getAnnouncementSubject: (announcement: AnnouncementResponse) => number;
3
+ export declare const getAnnouncementLink: (announcement: AnnouncementResponse) => number;
@@ -0,0 +1,5 @@
1
+ import { AnnouncementType } from "./configs/enums";
2
+ import { AnnouncementResponse } from "./configs/types";
3
+ import AnnouncementContainer from "./views/AnnouncementContainer";
4
+ export type { AnnouncementResponse };
5
+ export { AnnouncementContainer, AnnouncementType };
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ import { Role } from "../../../utils";
3
+ import { AnnouncementResponse } from "../configs/types";
4
+ interface Props {
5
+ role: Role;
6
+ renderLink: (children: JSX.Element, data: AnnouncementResponse, onClose: () => void) => JSX.Element;
7
+ renderViewNoteLink?: (children: JSX.Element, onClose: () => void) => JSX.Element;
8
+ }
9
+ declare const AnnouncementContainer: FC<Props>;
10
+ export default AnnouncementContainer;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ import { AnnouncementResponse } from "../configs/types";
3
+ import { Role } from "../../../utils";
4
+ interface Props {
5
+ role: Role;
6
+ items: AnnouncementResponse[];
7
+ isLoading: boolean;
8
+ onLoadMore: () => void;
9
+ renderLink: (children: JSX.Element, data: AnnouncementResponse) => JSX.Element;
10
+ }
11
+ declare const AnnouncementList: FC<Props>;
12
+ export default AnnouncementList;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { GeneralNoteDialogProps } from "../configs/interfaces";
3
+ declare const GeneralNoteDialog: FC<GeneralNoteDialogProps>;
4
+ export default GeneralNoteDialog;
@@ -0,0 +1,14 @@
1
+ import { FC } from "react";
2
+ import { Role } from "../../../utils/constants";
3
+ import { NoteResponse } from "../../../utils";
4
+ interface Props {
5
+ data: NoteResponse;
6
+ index: number;
7
+ role: Role;
8
+ calcOrderNumber: (index: number) => number;
9
+ onDelete: (data: NoteResponse) => void;
10
+ onUpdate: (data: NoteResponse) => void;
11
+ onView: (data: NoteResponse) => void;
12
+ }
13
+ declare const NoteItemList: FC<Props>;
14
+ export default NoteItemList;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface TabPanelProps {
3
+ children?: React.ReactNode;
4
+ index: number;
5
+ value: number;
6
+ }
7
+ declare const NotetabPanel: React.FC<TabPanelProps>;
8
+ export default NotetabPanel;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { ClassNoteDialogProps } from "../configs/interfaces";
3
+ declare const TeacherAdminNoteDialog: FC<ClassNoteDialogProps>;
4
+ export default TeacherAdminNoteDialog;
@@ -0,0 +1,27 @@
1
+ import { NoteSearchQuery } from "./types";
2
+ export declare const NOTE_STUDENT_HEADERS: ({
3
+ title: string;
4
+ sortKey?: undefined;
5
+ } | {
6
+ title: string;
7
+ sortKey: string;
8
+ })[];
9
+ export declare const NOTE_TEACHER_HEADERS: ({
10
+ title: string;
11
+ sortKey?: undefined;
12
+ } | {
13
+ title: string;
14
+ sortKey: string;
15
+ })[];
16
+ export declare const NOTE_ADMIN_HEADERS: ({
17
+ title: string;
18
+ sortKey?: undefined;
19
+ } | {
20
+ title: string;
21
+ sortKey: string;
22
+ })[];
23
+ export declare const ACADEMY_NOTE_FILTER: NoteSearchQuery;
24
+ export declare const STUDENT_PARENTS_NOTE_FILTER: NoteSearchQuery;
25
+ export declare const ADMIN_TEACHER_NOTE_FILTER: NoteSearchQuery;
26
+ export declare const ADMIN_NOTE_FILTER: NoteSearchQuery;
27
+ export declare const TEACHER_NOTE_FILTER: NoteSearchQuery;
@@ -4,6 +4,10 @@ export declare enum NoteSortColumn {
4
4
  Question = "Question"
5
5
  }
6
6
  export declare enum NoteType {
7
- Default = 0,
8
- StudentReadable = 1
7
+ ToAcademy = 0,
8
+ ToStudent = 1,
9
+ AdminToAllAdmin = 2,
10
+ AdminToAllTeacher = 3,
11
+ TeacherToAllAdmin = 4,
12
+ TeacherToTeachers = 5
9
13
  }
@@ -0,0 +1,2 @@
1
+ import { NoteType } from "./enums";
2
+ export declare const getNoteType: (t: any, type: NoteType) => any;
@@ -1,7 +1,8 @@
1
- import { NoteResponse } from "../../../utils/types/note";
1
+ import { NoteRequest, NoteResponse } from "../../../utils/types/note";
2
2
  import { Action } from "../../../components/Tooltips/configs/types";
3
3
  import { QuestionData } from "../../../utils/types";
4
4
  import { BoxProps } from "@mui/material";
5
+ import { NoteType } from "./enums";
5
6
  export interface NotesContainerProps {
6
7
  isLoading?: boolean;
7
8
  noteIdContextMenu?: number;
@@ -31,3 +32,11 @@ export interface ClassNoteDialogProps {
31
32
  onClose: () => void;
32
33
  onSaveNote: (content: string) => void;
33
34
  }
35
+ export interface GeneralNoteDialogProps {
36
+ open: boolean;
37
+ type?: NoteType;
38
+ selectedNote?: NoteResponse;
39
+ value?: NoteRequest;
40
+ onClose: () => void;
41
+ onSaveNote: (data: NoteRequest) => void;
42
+ }
@@ -5,5 +5,5 @@ export declare type NoteSearchQuery = BaseSearchQuery<NoteSortColumn> & {
5
5
  studentId?: number;
6
6
  examSessionId?: number;
7
7
  IsOwned?: boolean;
8
- type?: NoteType;
8
+ types?: NoteType[];
9
9
  };
@@ -7,5 +7,7 @@ import { NoteSearchQuery } from "./configs/types";
7
7
  import { ClassNoteDialogProps, ExamNoteDialogProps } from "./configs/interfaces";
8
8
  import useNotes from "./hooks/useNotes";
9
9
  import NotesContainer from "./views/NotesContainer";
10
- export { DEFAULT_NOTE_FILTER, NotesContainer, NewNoteButton, ExamNoteDialog, ClassNoteDialog, useNotes };
11
- export type { NotesContainerProps, NoteSearchQuery, ClassNoteDialogProps, ExamNoteDialogProps };
10
+ import NoteList from "./views/NoteList";
11
+ import NoteTabs from "./views/NoteTabs";
12
+ export { DEFAULT_NOTE_FILTER, NotesContainer, NewNoteButton, ExamNoteDialog, ClassNoteDialog, NoteTabs, useNotes };
13
+ export type { NotesContainerProps, NoteSearchQuery, ClassNoteDialogProps, ExamNoteDialogProps, NoteList };
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ import { Role } from "../../../utils";
3
+ import { NoteSearchQuery } from "../configs/types";
4
+ interface Props {
5
+ defaultFilter: NoteSearchQuery;
6
+ role: Role;
7
+ headers: any[];
8
+ isAdmin: boolean;
9
+ }
10
+ declare const NoteList: FC<Props>;
11
+ export default NoteList;
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { Role } from "../../../utils";
3
+ interface Props {
4
+ role: Role;
5
+ }
6
+ declare const NoteTabs: FC<Props>;
7
+ export default NoteTabs;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { ExamResultListProps } from "../../configs/interfaces";
3
+ declare const ExamResultList: FC<ExamResultListProps>;
4
+ export default ExamResultList;
@@ -1,14 +1,15 @@
1
1
  import { FC } from "react";
2
2
  import { NoteResponse } from "../../../../utils";
3
- import { StudentInfo } from "../../configs/types";
3
+ import { NoteUserInfo } from "../../../../utils/types";
4
4
  interface Props {
5
5
  open: boolean;
6
6
  onClose: () => void;
7
- student?: StudentInfo;
7
+ student?: NoteUserInfo;
8
8
  data?: NoteResponse;
9
9
  anchor?: "left" | "top" | "right" | "bottom";
10
10
  width?: number | string;
11
11
  showStudentInfo?: boolean;
12
+ id?: string;
12
13
  }
13
14
  declare const NoteDrawer: FC<Props>;
14
15
  export default NoteDrawer;
@@ -4,10 +4,10 @@ export declare type StudentInfo = {
4
4
  id: number;
5
5
  email: string;
6
6
  fullName: string;
7
- grade: number;
7
+ grade?: number;
8
8
  phoneNumber?: string;
9
9
  parentPhoneNumber?: string;
10
- schoolName: string;
10
+ schoolName?: string;
11
11
  };
12
12
  export declare type CourseAttendanceResponse = {
13
13
  id: number;
@@ -2,5 +2,6 @@ import AttendanceFormDialog from "./components/Attendance/AttendanceFormDialog";
2
2
  import StudentInfoDrawer from "./views/StudentInfoDrawer";
3
3
  import { AttendanceRequest, AttendanceDialogData } from "./configs/types";
4
4
  import LessonTooltip from "./components/Attendance/LessonTooltip";
5
- export { StudentInfoDrawer, AttendanceFormDialog, LessonTooltip };
5
+ import NoteDrawer from "./components/Note/NoteDrawer";
6
+ export { StudentInfoDrawer, AttendanceFormDialog, LessonTooltip, NoteDrawer };
6
7
  export type { AttendanceRequest, AttendanceDialogData };
@@ -8,9 +8,9 @@ export declare enum TextbookSortBy {
8
8
  }
9
9
  export declare enum TeacherSortBy {
10
10
  CreatedAt = "CreatedAt",
11
- Name = "UserProfile.FullName",
12
- Email = "Email",
13
- PhoneNumber = "UserProfile.PhoneNumber"
11
+ Name = "User.UserProfile.FullName",
12
+ Email = "User.Email",
13
+ PhoneNumber = "User.UserProfile.PhoneNumber"
14
14
  }
15
15
  export declare type TextbookHeaderTable = TableHeaderType;
16
16
  export declare type TextbookSearchQuery = SearchQuery & {};
@@ -11,3 +11,4 @@ export * from "./Notes";
11
11
  export * from "./PreparedTextbook";
12
12
  export * from "./PreparedExam";
13
13
  export * from "./StudentInfoDrawer";
14
+ export * from "./Announcements";