@daeryun/dr_components 0.9.5 → 0.9.7

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 (40) hide show
  1. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  2. package/dist/components/Daeryuntalk/ChatHomeView.jsx +12 -6
  3. package/dist/components/Daeryuntalk/ChatHomeView.tsx +21 -6
  4. package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +5 -0
  5. package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +17 -3
  6. package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +24 -3
  7. package/dist/components/Daeryuntalk/FixedErrorBox.jsx +10 -9
  8. package/dist/components/Daeryuntalk/FixedErrorBox.tsx +12 -13
  9. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.d.ts +2 -2
  10. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +18 -5
  11. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +20 -3
  12. package/dist/components/Daeryuntalk/_enums/error.d.ts +1 -1
  13. package/dist/components/Daeryuntalk/_enums/error.js +3 -6
  14. package/dist/components/Daeryuntalk/_enums/error.ts +2 -5
  15. package/dist/components/Daeryuntalk/_enums/socket_type.d.ts +3 -1
  16. package/dist/components/Daeryuntalk/_enums/socket_type.js +2 -0
  17. package/dist/components/Daeryuntalk/_enums/socket_type.ts +4 -1
  18. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.js +3 -3
  19. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.ts +3 -3
  20. package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.js +5 -4
  21. package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.ts +5 -4
  22. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +4 -1
  23. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +15 -4
  24. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +21 -4
  25. package/dist/components/Daeryuntalk/_hooks/view/useChatSocketState.js +5 -5
  26. package/dist/components/Daeryuntalk/_hooks/view/useChatSocketState.ts +5 -5
  27. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.d.ts +3 -1
  28. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.js +8 -4
  29. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.ts +11 -5
  30. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.d.ts +4 -1
  31. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.js +4 -2
  32. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.ts +10 -2
  33. package/dist/components/common/initialData/index.js +4 -1
  34. package/dist/components/common/initialData/index.ts +4 -2
  35. package/dist/components/common/integrate/index.d.ts +1 -1
  36. package/dist/components/common/types/index.d.ts +3 -0
  37. package/dist/components/common/types/index.ts +3 -0
  38. package/dist/styles/globals.css +333 -330
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +1 -1
@@ -15,12 +15,14 @@ interface IHistoryProps {
15
15
  cellPhoneNumber: string;
16
16
  certificationNumber: string;
17
17
  }) => any;
18
+ setPreviewState: (state: ViewState) => void;
18
19
  }
19
- export declare const useHistoryView: ({ attendRoomByHistory, startSelectedChat, setViewState, setIsLoading, createNewChat, goRequestPhone, goHistoryPhoneAuth }: IHistoryProps) => {
20
+ export declare const useHistoryView: ({ attendRoomByHistory, startSelectedChat, setViewState, setIsLoading, createNewChat, goRequestPhone, goHistoryPhoneAuth, setPreviewState }: IHistoryProps) => {
20
21
  handleChatHistoryClick: (chatNumber: string) => Promise<void>;
21
22
  handleNewStartChat: () => Promise<void>;
22
23
  handleHistoryClick: () => Promise<void>;
23
24
  handleGoRequestPhone: (name: string, cellPhoneNumber: string) => Promise<any>;
24
25
  handleGoHistoryPhoneAuth: (name: string, cellPhoneNumber: string, certificationNumber: string) => Promise<any>;
26
+ handleHomeClick: () => void;
25
27
  };
26
28
  export {};
@@ -7,9 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
11
- export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setViewState, setIsLoading, createNewChat, goRequestPhone, goHistoryPhoneAuth }) => {
12
- const toast = useDaeryunTalkToast();
10
+ export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setViewState, setIsLoading, createNewChat, goRequestPhone, goHistoryPhoneAuth, setPreviewState }) => {
13
11
  const handleChatHistoryClick = (chatNumber) => __awaiter(void 0, void 0, void 0, function* () {
14
12
  var _a, _b;
15
13
  try {
@@ -60,13 +58,19 @@ export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setView
60
58
  return res;
61
59
  });
62
60
  const handleHistoryClick = () => __awaiter(void 0, void 0, void 0, function* () {
61
+ setPreviewState('history');
63
62
  setViewState('history');
64
63
  });
64
+ const handleHomeClick = () => {
65
+ setPreviewState('home');
66
+ setViewState('home');
67
+ };
65
68
  return {
66
69
  handleChatHistoryClick,
67
70
  handleNewStartChat,
68
71
  handleHistoryClick,
69
72
  handleGoRequestPhone,
70
- handleGoHistoryPhoneAuth
73
+ handleGoHistoryPhoneAuth,
74
+ handleHomeClick
71
75
  };
72
76
  };
@@ -1,7 +1,5 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
- import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
3
2
  import { ViewState } from '../../ChatHomeView';
4
- import { DEFAULT_API_VERSION } from '../../_api';
5
3
 
6
4
  interface IHistoryProps {
7
5
  setIsLoading: Dispatch<SetStateAction<boolean>>;
@@ -19,6 +17,7 @@ interface IHistoryProps {
19
17
  cellPhoneNumber: string;
20
18
  certificationNumber: string;
21
19
  }) => any;
20
+ setPreviewState: (state: ViewState) => void;
22
21
  }
23
22
 
24
23
  export const useHistoryView = ({
@@ -28,9 +27,9 @@ export const useHistoryView = ({
28
27
  setIsLoading,
29
28
  createNewChat,
30
29
  goRequestPhone,
31
- goHistoryPhoneAuth
30
+ goHistoryPhoneAuth,
31
+ setPreviewState
32
32
  }: IHistoryProps) => {
33
- const toast = useDaeryunTalkToast();
34
33
  const handleChatHistoryClick = async (chatNumber: string) => {
35
34
  try {
36
35
  setIsLoading(true);
@@ -80,14 +79,21 @@ export const useHistoryView = ({
80
79
  };
81
80
 
82
81
  const handleHistoryClick = async () => {
82
+ setPreviewState('history');
83
83
  setViewState('history');
84
84
  };
85
85
 
86
+ const handleHomeClick = () => {
87
+ setPreviewState('home');
88
+ setViewState('home');
89
+ };
90
+
86
91
  return {
87
92
  handleChatHistoryClick,
88
93
  handleNewStartChat,
89
94
  handleHistoryClick,
90
95
  handleGoRequestPhone,
91
- handleGoHistoryPhoneAuth
96
+ handleGoHistoryPhoneAuth,
97
+ handleHomeClick
92
98
  };
93
99
  };
@@ -7,8 +7,11 @@ interface IHomeProps {
7
7
  retryInquiryMain: (channelNumber: string) => any;
8
8
  inquiryMainData: IChatInquiryMainDataResponse | null;
9
9
  startChat: (progressInquiryNumber?: string) => any;
10
+ preViewState: ViewState;
11
+ viewState: ViewState;
12
+ setPreviewState: (state: ViewState) => void;
10
13
  }
11
- export declare const useHomeView: ({ setIsLoading, setViewState, retryInquiryMain, inquiryMainData, startChat }: IHomeProps) => {
14
+ export declare const useHomeView: ({ setIsLoading, setViewState, retryInquiryMain, inquiryMainData, startChat, preViewState, viewState, setPreviewState }: IHomeProps) => {
12
15
  handleStartChat: () => Promise<void>;
13
16
  handleHashStartChat: () => Promise<void>;
14
17
  handleBackToHome: () => void;
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
11
- export const useHomeView = ({ setIsLoading, setViewState, retryInquiryMain, inquiryMainData, startChat }) => {
11
+ export const useHomeView = ({ setIsLoading, setViewState, retryInquiryMain, inquiryMainData, startChat, preViewState, viewState, setPreviewState }) => {
12
12
  const toast = useDaeryunTalkToast();
13
13
  const handleStartChat = () => __awaiter(void 0, void 0, void 0, function* () {
14
14
  var _a, _b, _c;
@@ -52,7 +52,9 @@ export const useHomeView = ({ setIsLoading, setViewState, retryInquiryMain, inqu
52
52
  }
53
53
  });
54
54
  const handleBackToHome = () => {
55
- setViewState('home');
55
+ const isDupHis = viewState === 'history' && preViewState === 'history';
56
+ isDupHis && setPreviewState('home');
57
+ setViewState(viewState === 'history' && preViewState === 'history' ? 'home' : (preViewState !== null && preViewState !== void 0 ? preViewState : 'home'));
56
58
  };
57
59
  return {
58
60
  handleStartChat,
@@ -9,13 +9,19 @@ interface IHomeProps {
9
9
  retryInquiryMain: (channelNumber: string) => any;
10
10
  inquiryMainData: IChatInquiryMainDataResponse | null;
11
11
  startChat: (progressInquiryNumber?: string) => any;
12
+ preViewState: ViewState;
13
+ viewState: ViewState;
14
+ setPreviewState: (state: ViewState) => void;
12
15
  }
13
16
  export const useHomeView = ({
14
17
  setIsLoading,
15
18
  setViewState,
16
19
  retryInquiryMain,
17
20
  inquiryMainData,
18
- startChat
21
+ startChat,
22
+ preViewState,
23
+ viewState,
24
+ setPreviewState
19
25
  }: IHomeProps) => {
20
26
  const toast = useDaeryunTalkToast();
21
27
  const handleStartChat = async () => {
@@ -54,7 +60,9 @@ export const useHomeView = ({
54
60
  }
55
61
  };
56
62
  const handleBackToHome = () => {
57
- setViewState('home');
63
+ const isDupHis = viewState === 'history' && preViewState === 'history';
64
+ isDupHis && setPreviewState('home');
65
+ setViewState(viewState === 'history' && preViewState === 'history' ? 'home' : (preViewState ?? 'home'));
58
66
  };
59
67
 
60
68
  return {
@@ -58,5 +58,8 @@ export const initInitialData = {
58
58
  based_on_sales_source: '(출처: 법률신문·한국경제)',
59
59
  experience: '2025년 6월 기준',
60
60
  experience_cnt: 47243,
61
- experience_cnt_day: 76
61
+ experience_cnt_day: 76,
62
+ experience_comp: '2025년 6월 기준',
63
+ pro_type: '변호사·전문가\n·고문·전문위원',
64
+ world_office_cnt: 40
62
65
  };
@@ -58,8 +58,10 @@ export const initInitialData: IInitialDataTypes = {
58
58
  korea_lawfirm_ranking: 9,
59
59
  based_on_2024_sales: '2024년 부가가치세\n신고액 기준 매출액',
60
60
  based_on_sales_source: '(출처: 법률신문·한국경제)',
61
-
62
61
  experience: '2025년 6월 기준',
63
62
  experience_cnt: 47243,
64
- experience_cnt_day: 76
63
+ experience_cnt_day: 76,
64
+ experience_comp: '2025년 6월 기준',
65
+ pro_type: '변호사·전문가\n·고문·전문위원',
66
+ world_office_cnt: 40
65
67
  };
@@ -2,7 +2,7 @@ export declare const getSearchKeywordJson: (searchKeywords: {
2
2
  code_name: string;
3
3
  survey_title: string;
4
4
  }[]) => {
5
- [key: string]: string[];
5
+ [x: string]: string[];
6
6
  };
7
7
  export declare const tabTypes: {
8
8
  tab: string;
@@ -33,6 +33,9 @@ export interface IInitialDataTypes {
33
33
  experience: string;
34
34
  experience_cnt: number;
35
35
  experience_cnt_day: number;
36
+ experience_comp: string;
37
+ pro_type: string;
38
+ world_office_cnt: number;
36
39
  }
37
40
  export interface ICenter {
38
41
  code: string;
@@ -33,6 +33,9 @@ export interface IInitialDataTypes {
33
33
  experience: string;
34
34
  experience_cnt: number;
35
35
  experience_cnt_day: number;
36
+ experience_comp: string;
37
+ pro_type: string;
38
+ world_office_cnt: number;
36
39
  }
37
40
  export interface ICenter {
38
41
  code: string;