touchstudy-core 0.1.196 → 0.1.197

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 (49) hide show
  1. package/dist/components/Chats/ChatContainer.d.ts +1 -5
  2. package/dist/components/Chats/components/InputChat.d.ts +2 -8
  3. package/dist/components/Chats/configs/constants.d.ts +1 -8
  4. package/dist/components/Chats/configs/types.d.ts +0 -2
  5. package/dist/components/Chats/hooks/useChatContainer.d.ts +2 -6
  6. package/dist/components/Selects/CustomSelectOption.d.ts +1 -1
  7. package/dist/index.css +16 -4
  8. package/dist/index.js +239 -1083
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.modern.js +244 -1088
  11. package/dist/index.modern.js.map +1 -1
  12. package/dist/layouts/TimerDialog.d.ts +3 -1
  13. package/dist/layouts/configs/constants.d.ts +2 -0
  14. package/dist/layouts/configs/enums.d.ts +6 -0
  15. package/dist/layouts/configs/fn.d.ts +3 -0
  16. package/dist/layouts/configs/types.d.ts +8 -0
  17. package/dist/layouts/hooks/useAlarm.d.ts +19 -0
  18. package/dist/layouts/hooks/useCountDownTimer.d.ts +6 -2
  19. package/dist/layouts/hooks/useTimers.d.ts +14 -0
  20. package/dist/layouts/partials/Alarm/AlarmClock.d.ts +12 -0
  21. package/dist/layouts/partials/Alarm/AlarmClockNote.d.ts +3 -0
  22. package/dist/layouts/partials/Alarm/AlarmClockPanel.d.ts +12 -0
  23. package/dist/layouts/partials/Alarm/AlarmClockPanelNote.d.ts +3 -0
  24. package/dist/layouts/partials/Alarm/AlarmClockTab.d.ts +14 -0
  25. package/dist/layouts/partials/Alarm/AlarmSpeakerCheckbox.d.ts +8 -0
  26. package/dist/layouts/partials/Alarm/AudioToastContent.d.ts +8 -0
  27. package/dist/layouts/partials/AlarmClock.d.ts +3 -1
  28. package/dist/layouts/partials/AlarmClockNote.d.ts +3 -0
  29. package/dist/layouts/partials/AlarmClockPanel.d.ts +3 -1
  30. package/dist/layouts/partials/AlarmClockPanelNote.d.ts +3 -0
  31. package/dist/layouts/partials/AlarmClockTab.d.ts +4 -3
  32. package/dist/layouts/partials/AudioToastContent.d.ts +8 -0
  33. package/dist/layouts/partials/StudyTimerTab.d.ts +2 -1
  34. package/dist/layouts/partials/TimeUpdateDialog.d.ts +7 -0
  35. package/dist/layouts/partials/Timer/StudyTimerTab.d.ts +13 -0
  36. package/dist/layouts/partials/Timer/TimeLineTabPanel.d.ts +8 -0
  37. package/dist/layouts/partials/Timer/TimeLineTabs.d.ts +11 -0
  38. package/dist/layouts/partials/Timer/TimeUpdateDialog.d.ts +7 -0
  39. package/dist/layouts/partials/Timer/TimerCountItem.d.ts +10 -0
  40. package/dist/layouts/partials/Timer/TimerDivider.d.ts +9 -0
  41. package/dist/layouts/partials/Timer/TimerItem.d.ts +12 -0
  42. package/dist/layouts/partials/Timer/TimerLineItem.d.ts +13 -0
  43. package/dist/layouts/partials/Timer/TimerTabPanel.d.ts +8 -0
  44. package/dist/layouts/partials/Timer/TimerTabs.d.ts +7 -0
  45. package/dist/layouts/partials/TimerItem.d.ts +2 -1
  46. package/dist/services/alarmService.d.ts +9 -0
  47. package/dist/utils/types/examResults.d.ts +1 -0
  48. package/dist/utils/types/subjects.d.ts +4 -2
  49. package/package.json +1 -2
@@ -1,7 +1,9 @@
1
1
  import { FC } from "react";
2
- import { StudyTimerTabProps } from "./partials/StudyTimerTab";
2
+ import { StudyTimerTabProps } from "./partials/Timer/StudyTimerTab";
3
+ import { AlarmClockTabProps } from "./partials/Alarm/AlarmClockTab";
3
4
  interface Props {
4
5
  studyTimerProps: StudyTimerTabProps;
6
+ alarmClockProps: AlarmClockTabProps;
5
7
  open: boolean;
6
8
  onTogge: () => void;
7
9
  }
@@ -1,7 +1,9 @@
1
+ import { AlarmType } from "./enums";
1
2
  export declare const QUICK_START_OPTIONS: number[];
2
3
  export declare const SUBJECT_OPTIONS: {
3
4
  label: string;
4
5
  value: number;
6
+ type: AlarmType;
5
7
  }[];
6
8
  export declare const INNER_OFFSET = 24;
7
9
  export declare const TICK_WIDTH = 1;
@@ -0,0 +1,6 @@
1
+ export declare enum AlarmType {
2
+ Default = 0,
3
+ Korean = 1,
4
+ Math = 2,
5
+ English = 3
6
+ }
@@ -0,0 +1,3 @@
1
+ import { SubjectTimerResponse } from "../../utils/types";
2
+ export declare const formatTime: (totalSeconds: number, t: any) => string;
3
+ export declare const getDisplayTime: (t: any, data?: SubjectTimerResponse | undefined, activeTimerId?: number | undefined, seconds?: number | undefined) => any;
@@ -0,0 +1,8 @@
1
+ import { SubjectTimerResponse } from "../../utils/types";
2
+ export declare type TimerTimeline = SubjectTimerResponse & {
3
+ timeLines: TimerLine[];
4
+ };
5
+ export declare type TimerLine = {
6
+ startTime: string;
7
+ endTime: string;
8
+ };
@@ -0,0 +1,19 @@
1
+ import { AlarmResponse } from "../../utils/types";
2
+ import { AlarmType } from "../configs/enums";
3
+ declare const useAlarm: (open: boolean) => {
4
+ isUpdatingSpeakerMode: boolean;
5
+ speaker: boolean;
6
+ remainTime: number | undefined;
7
+ alarmDuration: number;
8
+ isRunning: boolean;
9
+ loadingItem: boolean;
10
+ isFetching: boolean;
11
+ alarm: AlarmResponse | undefined;
12
+ handleToggleSpeaker: (val: boolean) => void;
13
+ handleStopAlarm: (isToasting?: boolean) => Promise<void>;
14
+ handleResumeOrPauseAlarm: () => Promise<void>;
15
+ handleStartAlarm: (type: AlarmType, duration: number) => Promise<void>;
16
+ handleChangeAlarmDuration: (val: number) => void;
17
+ hanldeIncreaseAlarmDuration: (val: number) => void;
18
+ };
19
+ export default useAlarm;
@@ -1,9 +1,13 @@
1
1
  import { TimerStatus } from "../../utils";
2
2
  interface Props {
3
+ isLoading: boolean;
3
4
  startTime?: string;
5
+ lastResumeTime?: string;
4
6
  status?: TimerStatus;
5
- duration: number;
6
- onFinish?: () => void;
7
+ duration?: number;
8
+ runningTime: number;
9
+ onFinish: () => void;
10
+ playAudio: (time: number) => void;
7
11
  }
8
12
  declare const useCountDownTimer: (props: Props) => number | undefined;
9
13
  export default useCountDownTimer;
@@ -0,0 +1,14 @@
1
+ import { SubjectTimerResponse } from "../../utils/types";
2
+ declare const useTimers: (open: boolean) => {
3
+ isRunning: boolean;
4
+ selectedTimer: SubjectTimerResponse | undefined;
5
+ loadingItem: boolean;
6
+ activeTimerId: number | undefined;
7
+ handleChangeTime: (data: SubjectTimerResponse, time: number) => void;
8
+ isFetching: boolean;
9
+ timers: SubjectTimerResponse[];
10
+ seconds: number | undefined;
11
+ handleStartOrPauseTimer: (data: SubjectTimerResponse, isRestart?: boolean | undefined) => Promise<void>;
12
+ handleOpenDialogEditTimer: (data: SubjectTimerResponse) => void;
13
+ };
14
+ export default useTimers;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ import { TimerStatus } from "../../../utils";
3
+ export interface AlarmClockProps {
4
+ totalMinutes: number;
5
+ remainTime?: number;
6
+ alarmStatus?: TimerStatus;
7
+ onTerminate: () => void;
8
+ onPause: () => void;
9
+ onResume: () => void;
10
+ }
11
+ declare const AlarmClock: FC<AlarmClockProps>;
12
+ export default AlarmClock;
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ declare const AlarmClockNote: FC;
3
+ export default AlarmClockNote;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ import { AlarmType } from "../../configs/enums";
3
+ export interface AlarmClockPanelProps {
4
+ isLoading: boolean;
5
+ value: number;
6
+ max?: number;
7
+ onStart: (type: AlarmType, duration: number) => void;
8
+ onChange: (val: number) => void;
9
+ onIncrease: (val: number) => void;
10
+ }
11
+ declare const AlarmClockPanel: FC<AlarmClockPanelProps>;
12
+ export default AlarmClockPanel;
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ declare const AlarmClockPanelNote: FC;
3
+ export default AlarmClockPanelNote;
@@ -0,0 +1,14 @@
1
+ import { FC } from "react";
2
+ import { AlarmClockPanelProps } from "./AlarmClockPanel";
3
+ import { AlarmClockProps } from "./AlarmClock";
4
+ export interface AlarmClockTabProps {
5
+ isLoading: boolean;
6
+ isPlaying: boolean;
7
+ speaker: boolean;
8
+ disabledSpeaker: boolean;
9
+ onToggleSpeaker: (val: boolean) => void;
10
+ panelProps: AlarmClockPanelProps;
11
+ alarmProps: AlarmClockProps;
12
+ }
13
+ declare const AlarmClockTab: FC<AlarmClockTabProps>;
14
+ export default AlarmClockTab;
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ value: boolean;
4
+ disabled: boolean;
5
+ onChange: (checked: boolean) => void;
6
+ }
7
+ declare const AlarmSpeakerCheckbox: FC<Props>;
8
+ export default AlarmSpeakerCheckbox;
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ audioSrc?: string;
4
+ message: string;
5
+ toastId: string;
6
+ }
7
+ declare const AudioToastContent: FC<Props>;
8
+ export default AudioToastContent;
@@ -1,7 +1,9 @@
1
1
  import { FC } from "react";
2
+ import { TimerStatus } from "../../utils";
2
3
  export interface AlarmClockProps {
3
4
  totalMinutes: number;
4
- isPlaying: boolean;
5
+ remainTime?: number;
6
+ alarmStatus?: TimerStatus;
5
7
  onTerminate: () => void;
6
8
  onPause: () => void;
7
9
  onResume: () => void;
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ declare const AlarmClockNote: FC;
3
+ export default AlarmClockNote;
@@ -1,8 +1,10 @@
1
1
  import { FC } from "react";
2
+ import { AlarmType } from "../configs/enums";
2
3
  export interface AlarmClockPanelProps {
4
+ isLoading: boolean;
3
5
  value: number;
4
6
  max?: number;
5
- onStart: () => void;
7
+ onStart: (type: AlarmType, duration: number) => void;
6
8
  onChange: (val: number) => void;
7
9
  onIncrease: (val: number) => void;
8
10
  }
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ declare const AlarmClockPanelNote: FC;
3
+ export default AlarmClockPanelNote;
@@ -1,10 +1,11 @@
1
1
  import { FC } from "react";
2
2
  import { AlarmClockPanelProps } from "./AlarmClockPanel";
3
3
  import { AlarmClockProps } from "./AlarmClock";
4
- interface Props {
5
- isStarted: boolean;
4
+ export interface AlarmClockTabProps {
5
+ isLoading: boolean;
6
+ isPlaying: boolean;
6
7
  panelProps: AlarmClockPanelProps;
7
8
  alarmProps: AlarmClockProps;
8
9
  }
9
- declare const AlarmClockTab: FC<Props>;
10
+ declare const AlarmClockTab: FC<AlarmClockTabProps>;
10
11
  export default AlarmClockTab;
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ audioSrc?: string;
4
+ message: string;
5
+ toastId: string;
6
+ }
7
+ declare const AudioToastContent: FC<Props>;
8
+ export default AudioToastContent;
@@ -6,7 +6,8 @@ export interface StudyTimerTabProps {
6
6
  loadingItem: boolean;
7
7
  activeTimerId?: number;
8
8
  time?: number;
9
- onStartOrPause: (data: SubjectTimerResponse) => void;
9
+ onStartOrPause: (data: SubjectTimerResponse, isRestart: boolean) => void;
10
+ onEditTimer: (data: SubjectTimerResponse) => void;
10
11
  }
11
12
  declare const StudyTimerTab: FC<StudyTimerTabProps>;
12
13
  export default StudyTimerTab;
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ }
6
+ declare const TimeUpdateDialog: FC<Props>;
7
+ export default TimeUpdateDialog;
@@ -0,0 +1,13 @@
1
+ import { FC } from "react";
2
+ import { SubjectTimerResponse } from "../../../utils/types";
3
+ export interface StudyTimerTabProps {
4
+ subjects: SubjectTimerResponse[];
5
+ isFetching: boolean;
6
+ loadingItem: boolean;
7
+ activeTimerId?: number;
8
+ time?: number;
9
+ onStartOrPause: (data: SubjectTimerResponse, isRestart: boolean) => void;
10
+ onEditTimer: (data: SubjectTimerResponse) => void;
11
+ }
12
+ declare const StudyTimerTab: FC<StudyTimerTabProps>;
13
+ export default StudyTimerTab;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface Props {
3
+ children?: React.ReactNode;
4
+ index: number;
5
+ value: number;
6
+ }
7
+ declare const TimeLineTabPanel: React.FC<Props>;
8
+ export default TimeLineTabPanel;
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ import { SubjectTimerResponse } from "../../../utils/types";
3
+ interface Props {
4
+ value: number;
5
+ data?: SubjectTimerResponse;
6
+ seconds?: number;
7
+ activeTimerId?: number;
8
+ onChange: (e: any, newValue: number) => void;
9
+ }
10
+ declare const TimeLineTabs: FC<Props>;
11
+ export default TimeLineTabs;
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ }
6
+ declare const TimeUpdateDialog: FC<Props>;
7
+ export default TimeUpdateDialog;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ import { SubjectTimerResponse } from "../../../utils/types/subjects";
3
+ interface Props {
4
+ data: SubjectTimerResponse;
5
+ loading: boolean;
6
+ activeTimerId?: number;
7
+ onChangeTime: (data: SubjectTimerResponse, time?: number) => void;
8
+ }
9
+ declare const TimerCountItem: FC<Props>;
10
+ export default TimerCountItem;
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { SubjectTimerResponse } from "../../../utils/types";
3
+ interface Props {
4
+ data: SubjectTimerResponse;
5
+ starting?: boolean;
6
+ noActions?: boolean;
7
+ }
8
+ declare const TimerDivider: FC<Props>;
9
+ export default TimerDivider;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ import { SubjectTimerResponse } from "../../../utils/types/subjects";
3
+ interface Props {
4
+ data: SubjectTimerResponse;
5
+ seconds?: number;
6
+ loading: boolean;
7
+ activeTimerId?: number;
8
+ onStartOrPauseTimer: (data: SubjectTimerResponse, isRestart?: boolean) => void;
9
+ onEditTimer: (data: SubjectTimerResponse) => void;
10
+ }
11
+ declare const TimerItem: FC<Props>;
12
+ export default TimerItem;
@@ -0,0 +1,13 @@
1
+ import { FC } from "react";
2
+ import { SubjectTimerResponse } from "../../../utils/types";
3
+ import { TimerStatus } from "../../../utils";
4
+ interface Props {
5
+ data: SubjectTimerResponse;
6
+ time: string;
7
+ status: TimerStatus;
8
+ isStart?: boolean;
9
+ single?: boolean;
10
+ onLoaded?: () => void;
11
+ }
12
+ declare const TimerLineItem: FC<Props>;
13
+ export default TimerLineItem;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface Props {
3
+ children?: React.ReactNode;
4
+ index: number;
5
+ value: number;
6
+ }
7
+ declare const TimerTabPanel: React.FC<Props>;
8
+ export default TimerTabPanel;
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ value: number;
4
+ onChange: (e: any, newValue: number) => void;
5
+ }
6
+ declare const TimerTabs: FC<Props>;
7
+ export default TimerTabs;
@@ -5,7 +5,8 @@ interface Props {
5
5
  seconds?: number;
6
6
  loading: boolean;
7
7
  activeTimerId?: number;
8
- onStartOrPauseTimer: (data: SubjectTimerResponse) => void;
8
+ onStartOrPauseTimer: (data: SubjectTimerResponse, isRestart?: boolean) => void;
9
+ onEditTimer: (data: SubjectTimerResponse) => void;
9
10
  }
10
11
  declare const TimerItem: FC<Props>;
11
12
  export default TimerItem;
@@ -0,0 +1,9 @@
1
+ import { AlarmResumeOrPauseRequest, StartAlarmRequest, ToggleAlarmSpeakerRequest } from "../utils/types";
2
+ export declare const getSuperAdminAlarmApi: () => Promise<import("axios").AxiosResponse<any, any>>;
3
+ export declare const getAlarmApi: () => Promise<import("axios").AxiosResponse<any, any>>;
4
+ export declare const startStudentAlarmApi: (data: StartAlarmRequest) => Promise<import("axios").AxiosResponse<any, any>>;
5
+ export declare const pauseStudentAlarmApi: (data: AlarmResumeOrPauseRequest) => Promise<import("axios").AxiosResponse<any, any>>;
6
+ export declare const startSuperStudentAlarmApi: (data: StartAlarmRequest) => Promise<import("axios").AxiosResponse<any, any>>;
7
+ export declare const pauseSuperStudentAlarmApi: (data: AlarmResumeOrPauseRequest) => Promise<import("axios").AxiosResponse<any, any>>;
8
+ export declare const toggleAlarmSpeakerApi: (data: ToggleAlarmSpeakerRequest) => Promise<import("axios").AxiosResponse<any, any>>;
9
+ export declare const toggleSuperAlarmSpeakerApi: (data: ToggleAlarmSpeakerRequest) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -30,6 +30,7 @@ export declare type Question = {
30
30
  isStar: boolean;
31
31
  score: number;
32
32
  overallCorrectRate: number;
33
+ skipRate: number;
33
34
  selectedAnswers?: number[] | string;
34
35
  correctAnswers?: number[] | string;
35
36
  correctTextualAnswers?: string[];
@@ -1,7 +1,7 @@
1
1
  import { TimerStatus } from "../enums/subject";
2
2
  export declare type SubjectTimerResponse = {
3
3
  id: number;
4
- recordId: number;
4
+ timerId: number;
5
5
  name: string;
6
6
  startTime: string;
7
7
  lastResumeTime: string;
@@ -9,11 +9,13 @@ export declare type SubjectTimerResponse = {
9
9
  duration: number;
10
10
  status: TimerStatus;
11
11
  rowVersion: string;
12
+ limitedTime: number;
13
+ limitedTimeReached: boolean;
12
14
  };
13
15
  export declare type ResumeOrPauseRequest = {
14
16
  status: TimerStatus;
15
17
  pauseTime?: number;
16
18
  startTime?: number;
17
- duration?: number;
18
19
  rowVersion: string;
20
+ timerId: number;
19
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "touchstudy-core",
3
- "version": "0.1.196",
3
+ "version": "0.1.197",
4
4
  "description": "Contains core components && functions for TouchStudy project",
5
5
  "author": "brss",
6
6
  "license": "MIT",
@@ -35,7 +35,6 @@
35
35
  "react-i18next": "^14.0.0",
36
36
  "react-icons": "^4.12.0",
37
37
  "react-select": "^5.8.0",
38
- "react-sketch-canvas": "^6.2.0",
39
38
  "react-slick": "^0.29.0",
40
39
  "react-toastify": "^9.1.3",
41
40
  "react-virtualized": "^9.22.6",