@daeryun/dr_components 1.2.17 → 1.2.19
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.
- package/dist/components/Daeryuntalk/ChatButton.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatButton.tsx +1 -1
- package/dist/components/Daeryuntalk/ChatWidget.d.ts +1 -0
- package/dist/components/Daeryuntalk/ChatWidget.jsx +114 -31
- package/dist/components/Daeryuntalk/ChatWidget.tsx +120 -37
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +0 -9
- package/dist/components/Daeryuntalk/index.jsx +17 -1
- package/dist/components/Daeryuntalk/index.tsx +26 -2
- package/dist/components/DaeryuntalkBackup/ChatButton.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.jsx +123 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.tsx +157 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.d.ts +21 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.jsx +259 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.tsx +390 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.d.ts +16 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.jsx +50 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.tsx +108 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.d.ts +14 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.jsx +147 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.tsx +262 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.jsx +19 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.tsx +27 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.jsx +165 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.tsx +244 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.tsx +25 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.jsx +100 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.tsx +135 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.tsx +26 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.jsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.tsx +45 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.tsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.d.ts +3 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.tsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.tsx +233 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.jsx +198 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.tsx +295 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.jsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.tsx +75 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.jsx +138 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.tsx +177 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.jsx +154 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.tsx +221 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.d.ts +103 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.jsx +207 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.tsx +350 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.tsx +24 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.tsx +73 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.jsx +157 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.tsx +206 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.d.ts +19 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.jsx +94 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/HomeView.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/HomeView.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/HomeView.tsx +261 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.jsx +44 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.tsx +60 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.jsx +17 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.tsx +28 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.jsx +130 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.tsx +181 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.d.ts +23 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.tsx +70 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.jsx +22 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.tsx +30 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.jsx +98 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.tsx +138 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.jsx +104 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.jsx +141 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.tsx +278 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.jsx +25 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.d.ts +177 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.js +801 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.ts +1097 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.d.ts +131 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.js +1 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.ts +159 -0
- package/dist/components/DaeryuntalkBackup/_api/index.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.js +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.d.ts +5 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.js +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.js +25 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.ts +26 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.d.ts +109 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.js +254 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.ts +289 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.js +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.js +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.ts +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.d.ts +34 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.js +46 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.ts +56 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.d.ts +32 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.js +76 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.ts +81 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.d.ts +33 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.js +66 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.ts +71 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.d.ts +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.js +465 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.ts +595 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.tsx +17 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.js +112 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.ts +144 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.d.ts +44 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.js +534 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.ts +706 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.js +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.ts +23 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.js +109 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.ts +121 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.js +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.ts +73 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.js +42 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.ts +52 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.js +20 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.ts +30 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.d.ts +2 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.js +26 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.ts +43 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.d.ts +27 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.js +80 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.ts +101 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.js +66 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.ts +75 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.js +103 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.ts +136 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.js +94 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.ts +119 -0
- package/dist/components/DaeryuntalkBackup/_types/message.d.ts +92 -0
- package/dist/components/DaeryuntalkBackup/_types/message.js +25 -0
- package/dist/components/DaeryuntalkBackup/_types/message.ts +156 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.d.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.jsx +5 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.tsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.tsx +38 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.tsx +50 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.jsx +9 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/index.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/index.jsx +190 -0
- package/dist/components/DaeryuntalkBackup/index.tsx +261 -0
- package/dist/components/banner/TopBanner.jsx +2 -2
- package/dist/components/banner/TopBanner.tsx +4 -2
- package/dist/styles/globals.css +5 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import React, { createContext, useContext, useRef, useState } from 'react';
|
|
11
|
+
import { useSocketEventHandler } from './_hooks/talkprovider/useSocketEventHandler';
|
|
12
|
+
import { useChatHandler } from './_hooks/talkprovider/useChatHandler';
|
|
13
|
+
import { useViewerHook } from './_hooks/talkprovider/useViewerHook';
|
|
14
|
+
import { useHistoryHandler } from './_hooks/talkprovider/useHistoryHandler';
|
|
15
|
+
// 기본값으로 컨텍스트 생성
|
|
16
|
+
const DaeryuntalkContext = createContext({
|
|
17
|
+
messages: [],
|
|
18
|
+
inquiryStatus: '',
|
|
19
|
+
messageObject: null,
|
|
20
|
+
isNextPage: null,
|
|
21
|
+
//
|
|
22
|
+
isConnected: null,
|
|
23
|
+
isLoading: false,
|
|
24
|
+
sendMessage: () => { },
|
|
25
|
+
initializeDaeryuntalk: () => { },
|
|
26
|
+
startChat: () => __awaiter(void 0, void 0, void 0, function* () { }),
|
|
27
|
+
createNewChat: () => __awaiter(void 0, void 0, void 0, function* () { }),
|
|
28
|
+
startWorkFlow: () => __awaiter(void 0, void 0, void 0, function* () { }),
|
|
29
|
+
workFlowBack: () => __awaiter(void 0, void 0, void 0, function* () { }),
|
|
30
|
+
chatInquiryNumber: '',
|
|
31
|
+
workFlowStack: [],
|
|
32
|
+
sendHeartbeat: () => { },
|
|
33
|
+
sendInquiryWatching: () => { },
|
|
34
|
+
sendInquiryLeft: () => { },
|
|
35
|
+
chatUserUpdate: () => { },
|
|
36
|
+
getNextMessageList: () => { },
|
|
37
|
+
//
|
|
38
|
+
isOpen: false,
|
|
39
|
+
chatData: null,
|
|
40
|
+
inquiryMainData: null,
|
|
41
|
+
isAuthenticated: false,
|
|
42
|
+
isSocketInitialized: false,
|
|
43
|
+
isSocketConnected: false,
|
|
44
|
+
error: null,
|
|
45
|
+
closeDaeryuntalk: () => { },
|
|
46
|
+
tel: '',
|
|
47
|
+
goRequestPhone: () => { },
|
|
48
|
+
goHistoryPhoneAuth: () => { },
|
|
49
|
+
goGetHistoryList: () => { },
|
|
50
|
+
historyList: [],
|
|
51
|
+
sendHistoryEntered: () => { },
|
|
52
|
+
sendHistoryLeft: () => { },
|
|
53
|
+
startSelectedChat: () => { },
|
|
54
|
+
sendInquiryJoined: () => { },
|
|
55
|
+
attendRoomByHistory: () => { },
|
|
56
|
+
retryInquiryMain: () => { },
|
|
57
|
+
setMessageObject: () => { },
|
|
58
|
+
setWorkFlowStack: () => { },
|
|
59
|
+
retryInitData: () => { },
|
|
60
|
+
isTyping: false,
|
|
61
|
+
centerCode: '',
|
|
62
|
+
setIsTyping: () => { },
|
|
63
|
+
setPreviewState: () => { },
|
|
64
|
+
preViewState: 'conversation',
|
|
65
|
+
isUserExpired: false,
|
|
66
|
+
setIsUserExpried: () => { },
|
|
67
|
+
initialLoading: null,
|
|
68
|
+
setInitialLoading: () => { },
|
|
69
|
+
ageCheckStatus: null,
|
|
70
|
+
setAgeCheckStatus: () => { },
|
|
71
|
+
ageConfirm: () => { }
|
|
72
|
+
});
|
|
73
|
+
export const DaeryuntalkProvider = ({ children, propsTel, isMobile, onClose, centerCode, isOpen }) => {
|
|
74
|
+
// 인증 여부
|
|
75
|
+
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
|
76
|
+
const [initialLoading, setInitialLoading] = useState(null);
|
|
77
|
+
// 채팅 진행중에 필요한 state들
|
|
78
|
+
const [ageCheckStatus, setAgeCheckStatus] = useState(null);
|
|
79
|
+
const [inquiryStatus, setInquiryStatus] = useState('');
|
|
80
|
+
const [messages, setMessages] = useState([]);
|
|
81
|
+
const [messageObject, setMessageObject] = useState(null);
|
|
82
|
+
const [workFlowStack, setWorkFlowStack] = useState([]);
|
|
83
|
+
const [isNextPage, setIsNextPage] = useState(null);
|
|
84
|
+
const [chatInquiryNumber, setChatInquiryNumber] = useState(null);
|
|
85
|
+
// 전역 소켓 연결 상태
|
|
86
|
+
const [isConnected, setIsConnected] = useState(null);
|
|
87
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
88
|
+
const [inquiryMainData, setInquiryMainData] = useState(null);
|
|
89
|
+
const socketRef = useRef(null);
|
|
90
|
+
// 히스토리 리스트
|
|
91
|
+
const [historyList, setHistoryList] = useState([]);
|
|
92
|
+
// 채팅 입력중 UI여부
|
|
93
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
94
|
+
// 이전 뷰 state 관리
|
|
95
|
+
const [preViewState, setPreviewState] = useState('conversation');
|
|
96
|
+
// 중복 인증 유저
|
|
97
|
+
const [isUserExpired, setIsUserExpried] = useState(false);
|
|
98
|
+
// 소켓 관련 API + 채팅 시작
|
|
99
|
+
const { initializeDaeryuntalk, sendHeartbeat, sendInquiryJoined, sendInquiryLeft, sendHistoryEntered, sendHistoryLeft, sendInquiryWatching, retryInquiryMain, retryInitData } = useSocketEventHandler({
|
|
100
|
+
setIsConnected,
|
|
101
|
+
setIsLoading,
|
|
102
|
+
setMessages,
|
|
103
|
+
setInquiryMainData,
|
|
104
|
+
setWorkFlowStack,
|
|
105
|
+
setMessageObject,
|
|
106
|
+
socketRef: socketRef,
|
|
107
|
+
setInquiryStatus,
|
|
108
|
+
setHistoryList,
|
|
109
|
+
historyList,
|
|
110
|
+
inquiryMainData,
|
|
111
|
+
isMobile,
|
|
112
|
+
setIsAuthenticated,
|
|
113
|
+
setIsTyping,
|
|
114
|
+
onClose,
|
|
115
|
+
centerCode,
|
|
116
|
+
setPreviewState,
|
|
117
|
+
setIsUserExpried,
|
|
118
|
+
chatInquiryNumber,
|
|
119
|
+
setIsNextPage,
|
|
120
|
+
setInitialLoading,
|
|
121
|
+
setChatInquiryNumber,
|
|
122
|
+
setAgeCheckStatus,
|
|
123
|
+
isOpen
|
|
124
|
+
});
|
|
125
|
+
// MSG15591497825895676
|
|
126
|
+
// 채팅 관련
|
|
127
|
+
const { startChat, sendMessage, createNewChat, startWorkFlow, workFlowBack, chatUserUpdate, getNextMessageList, startSelectedChat, attendRoomByHistory, ageConfirm } = useChatHandler({
|
|
128
|
+
setIsLoading,
|
|
129
|
+
inquiryMainData,
|
|
130
|
+
setChatInquiryNumber,
|
|
131
|
+
setMessages,
|
|
132
|
+
setInquiryStatus,
|
|
133
|
+
setMessageObject,
|
|
134
|
+
chatInquiryNumber,
|
|
135
|
+
setIsNextPage,
|
|
136
|
+
setWorkFlowStack,
|
|
137
|
+
setInquiryMainData,
|
|
138
|
+
centerCode,
|
|
139
|
+
setAgeCheckStatus
|
|
140
|
+
});
|
|
141
|
+
// 이미지 뷰어용
|
|
142
|
+
const { isImageViewerOpen, selectedImageFile, imageViewerMessage, openImageViewer, closeImageViewer } = useViewerHook();
|
|
143
|
+
// 폰 요청
|
|
144
|
+
const { goRequestPhone, goHistoryPhoneAuth, goGetHistoryList } = useHistoryHandler({
|
|
145
|
+
setIsAuthenticated,
|
|
146
|
+
setHistoryList
|
|
147
|
+
});
|
|
148
|
+
return (<DaeryuntalkContext.Provider value={{
|
|
149
|
+
messages,
|
|
150
|
+
isConnected,
|
|
151
|
+
isLoading,
|
|
152
|
+
sendMessage,
|
|
153
|
+
initializeDaeryuntalk,
|
|
154
|
+
startChat,
|
|
155
|
+
inquiryMainData,
|
|
156
|
+
inquiryStatus,
|
|
157
|
+
messageObject,
|
|
158
|
+
isNextPage,
|
|
159
|
+
createNewChat,
|
|
160
|
+
startWorkFlow,
|
|
161
|
+
chatInquiryNumber,
|
|
162
|
+
workFlowBack,
|
|
163
|
+
workFlowStack,
|
|
164
|
+
sendHeartbeat,
|
|
165
|
+
sendInquiryWatching,
|
|
166
|
+
sendInquiryLeft,
|
|
167
|
+
chatUserUpdate,
|
|
168
|
+
getNextMessageList,
|
|
169
|
+
isImageViewerOpen,
|
|
170
|
+
selectedImageFile,
|
|
171
|
+
imageViewerMessage,
|
|
172
|
+
openImageViewer,
|
|
173
|
+
closeImageViewer,
|
|
174
|
+
tel: propsTel,
|
|
175
|
+
goRequestPhone,
|
|
176
|
+
goHistoryPhoneAuth,
|
|
177
|
+
goGetHistoryList,
|
|
178
|
+
isAuthenticated,
|
|
179
|
+
historyList,
|
|
180
|
+
sendHistoryEntered,
|
|
181
|
+
sendHistoryLeft,
|
|
182
|
+
startSelectedChat,
|
|
183
|
+
sendInquiryJoined,
|
|
184
|
+
attendRoomByHistory,
|
|
185
|
+
retryInquiryMain,
|
|
186
|
+
setMessageObject,
|
|
187
|
+
setWorkFlowStack,
|
|
188
|
+
retryInitData,
|
|
189
|
+
isTyping,
|
|
190
|
+
centerCode,
|
|
191
|
+
setIsTyping,
|
|
192
|
+
setPreviewState,
|
|
193
|
+
preViewState,
|
|
194
|
+
isUserExpired,
|
|
195
|
+
setIsUserExpried,
|
|
196
|
+
initialLoading,
|
|
197
|
+
setInitialLoading,
|
|
198
|
+
ageCheckStatus,
|
|
199
|
+
setAgeCheckStatus,
|
|
200
|
+
ageConfirm
|
|
201
|
+
}}>
|
|
202
|
+
{children}
|
|
203
|
+
</DaeryuntalkContext.Provider>);
|
|
204
|
+
};
|
|
205
|
+
// 컨텍스트 사용을 위한 커스텀 훅
|
|
206
|
+
export const useDaeryuntalk = () => useContext(DaeryuntalkContext);
|
|
207
|
+
export default DaeryuntalkContext;
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import React, { createContext, ReactNode, useCallback, useContext, useRef, useState } from 'react';
|
|
2
|
+
import { FileInfo, Message } from './_types/message';
|
|
3
|
+
import { ChatInquiryDetailDataResponse, History, IChatInquiryMainDataResponse } from './_api/daeryuntalk/type/response';
|
|
4
|
+
import { MessageObject } from './_types/message_object';
|
|
5
|
+
import { useSocketEventHandler } from './_hooks/talkprovider/useSocketEventHandler';
|
|
6
|
+
import { useChatHandler } from './_hooks/talkprovider/useChatHandler';
|
|
7
|
+
import { useViewerHook } from './_hooks/talkprovider/useViewerHook';
|
|
8
|
+
import { useHistoryHandler } from './_hooks/talkprovider/useHistoryHandler';
|
|
9
|
+
import { ViewState } from './ChatHomeView';
|
|
10
|
+
import { AgeCheckStatusEnums } from './_enums/ags_check_status';
|
|
11
|
+
|
|
12
|
+
type DaeryuntalkContextType = {
|
|
13
|
+
messages: Message[];
|
|
14
|
+
inquiryStatus: string;
|
|
15
|
+
messageObject: MessageObject | null;
|
|
16
|
+
isNextPage: boolean | null;
|
|
17
|
+
|
|
18
|
+
isConnected: boolean | null;
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
sendMessage: (htmlContent: string, jsonData: any) => void;
|
|
21
|
+
initializeDaeryuntalk: (hashValue: string, isOpen: boolean, centerCode: string, version?: string) => void;
|
|
22
|
+
startChat: (inquiryNumber?: string) => Promise<any>;
|
|
23
|
+
createNewChat: () => void;
|
|
24
|
+
startWorkFlow: (data: {
|
|
25
|
+
chatInquiryNumber: string;
|
|
26
|
+
messageNumber: string;
|
|
27
|
+
workFlowNumber: string;
|
|
28
|
+
objectNumber: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
workFlowBack: (data: { chatInquiryNumber: string; messageNumber: string; workFlowNavigationCode: string }) => void;
|
|
31
|
+
chatInquiryNumber: string | null;
|
|
32
|
+
workFlowStack: string[];
|
|
33
|
+
sendHeartbeat: () => void;
|
|
34
|
+
sendInquiryWatching: (chatInquiryNumber: string) => void;
|
|
35
|
+
sendInquiryLeft: (chatInquiryNumber: string) => void;
|
|
36
|
+
chatUserUpdate: (data: {
|
|
37
|
+
chatInquiryNumber: string;
|
|
38
|
+
messageNumber: string;
|
|
39
|
+
name: string;
|
|
40
|
+
cellPhoneNumber: string;
|
|
41
|
+
}) => void;
|
|
42
|
+
getNextMessageList: (chatInquiryNumber: string, standardDateTime: any) => void;
|
|
43
|
+
//
|
|
44
|
+
isOpen?: boolean;
|
|
45
|
+
chatData?: ChatInquiryDetailDataResponse | null;
|
|
46
|
+
inquiryMainData?: IChatInquiryMainDataResponse | null;
|
|
47
|
+
isAuthenticated: boolean;
|
|
48
|
+
isSocketInitialized?: boolean;
|
|
49
|
+
isSocketConnected?: boolean;
|
|
50
|
+
error?: Error | null;
|
|
51
|
+
closeDaeryuntalk?: () => void;
|
|
52
|
+
|
|
53
|
+
// 이미지 뷰어용
|
|
54
|
+
isImageViewerOpen?: boolean;
|
|
55
|
+
selectedImageFile?: FileInfo | null;
|
|
56
|
+
imageViewerMessage?: Message | null;
|
|
57
|
+
openImageViewer?: (file: FileInfo, message: Message) => void;
|
|
58
|
+
closeImageViewer?: () => void;
|
|
59
|
+
tel: string;
|
|
60
|
+
|
|
61
|
+
// 히스토리
|
|
62
|
+
goRequestPhone: (data: {
|
|
63
|
+
name: string; // required
|
|
64
|
+
cellPhoneNumber: string;
|
|
65
|
+
version?: string;
|
|
66
|
+
}) => void;
|
|
67
|
+
goHistoryPhoneAuth: (data: {
|
|
68
|
+
name: string; // required
|
|
69
|
+
cellPhoneNumber: string;
|
|
70
|
+
certificationNumber: string;
|
|
71
|
+
version?: string;
|
|
72
|
+
}) => void;
|
|
73
|
+
goGetHistoryList: (data: { version?: string }) => void;
|
|
74
|
+
historyList: History[];
|
|
75
|
+
sendHistoryEntered: (chatInquiryNumbers: string[]) => void;
|
|
76
|
+
sendHistoryLeft: (chatInquiryNumbers: string[]) => void;
|
|
77
|
+
startSelectedChat: (chatInquiryNumbers: string) => void;
|
|
78
|
+
sendInquiryJoined: (chatInquiryNumber: string) => void;
|
|
79
|
+
attendRoomByHistory: (chatInquiryNumber: string) => any;
|
|
80
|
+
retryInquiryMain: (channelNumber: string) => any;
|
|
81
|
+
setMessageObject: (obj: MessageObject | null) => void;
|
|
82
|
+
setWorkFlowStack: (arr: string[]) => void;
|
|
83
|
+
retryInitData: () => void;
|
|
84
|
+
isTyping: boolean;
|
|
85
|
+
centerCode: string;
|
|
86
|
+
setIsTyping: (isTyping: boolean) => void;
|
|
87
|
+
setPreviewState: (view: ViewState) => void;
|
|
88
|
+
preViewState: ViewState;
|
|
89
|
+
isUserExpired: boolean;
|
|
90
|
+
setIsUserExpried: (isUserExpired: boolean) => void;
|
|
91
|
+
initialLoading: boolean | null;
|
|
92
|
+
setInitialLoading: (initialLoading: boolean | null) => void;
|
|
93
|
+
ageCheckStatus: AgeCheckStatusEnums | null;
|
|
94
|
+
setAgeCheckStatus: (ageCheckStatus: AgeCheckStatusEnums | null) => void;
|
|
95
|
+
ageConfirm: (chatInquiryNumber: string, ageConsentStateCode: AgeCheckStatusEnums) => void;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// 기본값으로 컨텍스트 생성
|
|
99
|
+
const DaeryuntalkContext = createContext<DaeryuntalkContextType>({
|
|
100
|
+
messages: [],
|
|
101
|
+
inquiryStatus: '',
|
|
102
|
+
messageObject: null,
|
|
103
|
+
isNextPage: null,
|
|
104
|
+
//
|
|
105
|
+
isConnected: null,
|
|
106
|
+
isLoading: false,
|
|
107
|
+
sendMessage: () => {},
|
|
108
|
+
initializeDaeryuntalk: () => {},
|
|
109
|
+
startChat: async () => {},
|
|
110
|
+
createNewChat: async () => {},
|
|
111
|
+
startWorkFlow: async () => {},
|
|
112
|
+
workFlowBack: async () => {},
|
|
113
|
+
chatInquiryNumber: '',
|
|
114
|
+
workFlowStack: [],
|
|
115
|
+
sendHeartbeat: () => {},
|
|
116
|
+
sendInquiryWatching: () => {},
|
|
117
|
+
sendInquiryLeft: () => {},
|
|
118
|
+
chatUserUpdate: () => {},
|
|
119
|
+
getNextMessageList: () => {},
|
|
120
|
+
//
|
|
121
|
+
isOpen: false,
|
|
122
|
+
chatData: null,
|
|
123
|
+
inquiryMainData: null,
|
|
124
|
+
isAuthenticated: false,
|
|
125
|
+
isSocketInitialized: false,
|
|
126
|
+
isSocketConnected: false,
|
|
127
|
+
error: null,
|
|
128
|
+
closeDaeryuntalk: () => {},
|
|
129
|
+
tel: '',
|
|
130
|
+
goRequestPhone: () => {},
|
|
131
|
+
goHistoryPhoneAuth: () => {},
|
|
132
|
+
goGetHistoryList: () => {},
|
|
133
|
+
historyList: [],
|
|
134
|
+
sendHistoryEntered: () => {},
|
|
135
|
+
sendHistoryLeft: () => {},
|
|
136
|
+
startSelectedChat: () => {},
|
|
137
|
+
sendInquiryJoined: () => {},
|
|
138
|
+
attendRoomByHistory: () => {},
|
|
139
|
+
retryInquiryMain: () => {},
|
|
140
|
+
setMessageObject: () => {},
|
|
141
|
+
setWorkFlowStack: () => {},
|
|
142
|
+
retryInitData: () => {},
|
|
143
|
+
isTyping: false,
|
|
144
|
+
centerCode: '',
|
|
145
|
+
setIsTyping: () => {},
|
|
146
|
+
setPreviewState: () => {},
|
|
147
|
+
preViewState: 'conversation',
|
|
148
|
+
isUserExpired: false,
|
|
149
|
+
setIsUserExpried: () => {},
|
|
150
|
+
initialLoading: null,
|
|
151
|
+
setInitialLoading: () => {},
|
|
152
|
+
ageCheckStatus: null,
|
|
153
|
+
setAgeCheckStatus: () => {},
|
|
154
|
+
ageConfirm: () => {}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// 프로바이더 컴포넌트 생성
|
|
158
|
+
type DaeryuntalkProviderProps = {
|
|
159
|
+
children: ReactNode;
|
|
160
|
+
isMobile: boolean;
|
|
161
|
+
onClose: () => void;
|
|
162
|
+
propsTel: string;
|
|
163
|
+
centerCode: string;
|
|
164
|
+
isOpen: boolean;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({
|
|
168
|
+
children,
|
|
169
|
+
propsTel,
|
|
170
|
+
isMobile,
|
|
171
|
+
onClose,
|
|
172
|
+
centerCode,
|
|
173
|
+
isOpen
|
|
174
|
+
}) => {
|
|
175
|
+
// 인증 여부
|
|
176
|
+
const [isAuthenticated, setIsAuthenticated] = useState<boolean>(false);
|
|
177
|
+
|
|
178
|
+
const [initialLoading, setInitialLoading] = useState<boolean | null>(null);
|
|
179
|
+
|
|
180
|
+
// 채팅 진행중에 필요한 state들
|
|
181
|
+
const [ageCheckStatus, setAgeCheckStatus] = useState<AgeCheckStatusEnums | null>(null);
|
|
182
|
+
const [inquiryStatus, setInquiryStatus] = useState<string>('');
|
|
183
|
+
const [messages, setMessages] = useState<Message[]>([]);
|
|
184
|
+
const [messageObject, setMessageObject] = useState<MessageObject | null>(null);
|
|
185
|
+
const [workFlowStack, setWorkFlowStack] = useState<string[]>([]);
|
|
186
|
+
const [isNextPage, setIsNextPage] = useState<boolean | null>(null);
|
|
187
|
+
const [chatInquiryNumber, setChatInquiryNumber] = useState<string | null>(null);
|
|
188
|
+
|
|
189
|
+
// 전역 소켓 연결 상태
|
|
190
|
+
const [isConnected, setIsConnected] = useState<boolean | null>(null);
|
|
191
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
192
|
+
const [inquiryMainData, setInquiryMainData] = useState<IChatInquiryMainDataResponse | null>(null);
|
|
193
|
+
|
|
194
|
+
const socketRef = useRef<WebSocket | null>(null);
|
|
195
|
+
|
|
196
|
+
// 히스토리 리스트
|
|
197
|
+
const [historyList, setHistoryList] = useState<History[]>([]);
|
|
198
|
+
|
|
199
|
+
// 채팅 입력중 UI여부
|
|
200
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
201
|
+
|
|
202
|
+
// 이전 뷰 state 관리
|
|
203
|
+
const [preViewState, setPreviewState] = useState<ViewState>('conversation');
|
|
204
|
+
|
|
205
|
+
// 중복 인증 유저
|
|
206
|
+
const [isUserExpired, setIsUserExpried] = useState(false);
|
|
207
|
+
|
|
208
|
+
// 소켓 관련 API + 채팅 시작
|
|
209
|
+
const {
|
|
210
|
+
initializeDaeryuntalk,
|
|
211
|
+
sendHeartbeat,
|
|
212
|
+
sendInquiryJoined,
|
|
213
|
+
sendInquiryLeft,
|
|
214
|
+
sendHistoryEntered,
|
|
215
|
+
sendHistoryLeft,
|
|
216
|
+
sendInquiryWatching,
|
|
217
|
+
retryInquiryMain,
|
|
218
|
+
retryInitData
|
|
219
|
+
} = useSocketEventHandler({
|
|
220
|
+
setIsConnected,
|
|
221
|
+
setIsLoading,
|
|
222
|
+
setMessages,
|
|
223
|
+
setInquiryMainData,
|
|
224
|
+
setWorkFlowStack,
|
|
225
|
+
setMessageObject,
|
|
226
|
+
socketRef: socketRef,
|
|
227
|
+
setInquiryStatus,
|
|
228
|
+
setHistoryList,
|
|
229
|
+
historyList,
|
|
230
|
+
inquiryMainData,
|
|
231
|
+
isMobile,
|
|
232
|
+
setIsAuthenticated,
|
|
233
|
+
setIsTyping,
|
|
234
|
+
onClose,
|
|
235
|
+
centerCode,
|
|
236
|
+
setPreviewState,
|
|
237
|
+
setIsUserExpried,
|
|
238
|
+
chatInquiryNumber,
|
|
239
|
+
setIsNextPage,
|
|
240
|
+
setInitialLoading,
|
|
241
|
+
setChatInquiryNumber,
|
|
242
|
+
setAgeCheckStatus,
|
|
243
|
+
isOpen
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// MSG15591497825895676
|
|
247
|
+
|
|
248
|
+
// 채팅 관련
|
|
249
|
+
const {
|
|
250
|
+
startChat,
|
|
251
|
+
sendMessage,
|
|
252
|
+
createNewChat,
|
|
253
|
+
startWorkFlow,
|
|
254
|
+
workFlowBack,
|
|
255
|
+
chatUserUpdate,
|
|
256
|
+
getNextMessageList,
|
|
257
|
+
startSelectedChat,
|
|
258
|
+
attendRoomByHistory,
|
|
259
|
+
ageConfirm
|
|
260
|
+
} = useChatHandler({
|
|
261
|
+
setIsLoading,
|
|
262
|
+
inquiryMainData,
|
|
263
|
+
setChatInquiryNumber,
|
|
264
|
+
setMessages,
|
|
265
|
+
setInquiryStatus,
|
|
266
|
+
setMessageObject,
|
|
267
|
+
chatInquiryNumber,
|
|
268
|
+
setIsNextPage,
|
|
269
|
+
setWorkFlowStack,
|
|
270
|
+
setInquiryMainData,
|
|
271
|
+
centerCode,
|
|
272
|
+
setAgeCheckStatus
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// 이미지 뷰어용
|
|
276
|
+
const { isImageViewerOpen, selectedImageFile, imageViewerMessage, openImageViewer, closeImageViewer } =
|
|
277
|
+
useViewerHook();
|
|
278
|
+
|
|
279
|
+
// 폰 요청
|
|
280
|
+
const { goRequestPhone, goHistoryPhoneAuth, goGetHistoryList } = useHistoryHandler({
|
|
281
|
+
setIsAuthenticated,
|
|
282
|
+
setHistoryList
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
return (
|
|
286
|
+
<DaeryuntalkContext.Provider
|
|
287
|
+
value={{
|
|
288
|
+
messages,
|
|
289
|
+
isConnected,
|
|
290
|
+
isLoading,
|
|
291
|
+
sendMessage,
|
|
292
|
+
initializeDaeryuntalk,
|
|
293
|
+
startChat,
|
|
294
|
+
inquiryMainData,
|
|
295
|
+
inquiryStatus,
|
|
296
|
+
messageObject,
|
|
297
|
+
isNextPage,
|
|
298
|
+
createNewChat,
|
|
299
|
+
startWorkFlow,
|
|
300
|
+
chatInquiryNumber,
|
|
301
|
+
workFlowBack,
|
|
302
|
+
workFlowStack,
|
|
303
|
+
sendHeartbeat,
|
|
304
|
+
sendInquiryWatching,
|
|
305
|
+
sendInquiryLeft,
|
|
306
|
+
chatUserUpdate,
|
|
307
|
+
getNextMessageList,
|
|
308
|
+
isImageViewerOpen,
|
|
309
|
+
selectedImageFile,
|
|
310
|
+
imageViewerMessage,
|
|
311
|
+
openImageViewer,
|
|
312
|
+
closeImageViewer,
|
|
313
|
+
tel: propsTel,
|
|
314
|
+
goRequestPhone,
|
|
315
|
+
goHistoryPhoneAuth,
|
|
316
|
+
goGetHistoryList,
|
|
317
|
+
isAuthenticated,
|
|
318
|
+
historyList,
|
|
319
|
+
sendHistoryEntered,
|
|
320
|
+
sendHistoryLeft,
|
|
321
|
+
startSelectedChat,
|
|
322
|
+
sendInquiryJoined,
|
|
323
|
+
attendRoomByHistory,
|
|
324
|
+
retryInquiryMain,
|
|
325
|
+
setMessageObject,
|
|
326
|
+
setWorkFlowStack,
|
|
327
|
+
retryInitData,
|
|
328
|
+
isTyping,
|
|
329
|
+
centerCode,
|
|
330
|
+
setIsTyping,
|
|
331
|
+
setPreviewState,
|
|
332
|
+
preViewState,
|
|
333
|
+
isUserExpired,
|
|
334
|
+
setIsUserExpried,
|
|
335
|
+
initialLoading,
|
|
336
|
+
setInitialLoading,
|
|
337
|
+
ageCheckStatus,
|
|
338
|
+
setAgeCheckStatus,
|
|
339
|
+
ageConfirm
|
|
340
|
+
}}
|
|
341
|
+
>
|
|
342
|
+
{children}
|
|
343
|
+
</DaeryuntalkContext.Provider>
|
|
344
|
+
);
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
// 컨텍스트 사용을 위한 커스텀 훅
|
|
348
|
+
export const useDaeryuntalk = () => useContext(DaeryuntalkContext);
|
|
349
|
+
|
|
350
|
+
export default DaeryuntalkContext;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const DateSeparator = ({ date }) => {
|
|
4
|
+
const formatDate = (date) => {
|
|
5
|
+
const year = date.getFullYear();
|
|
6
|
+
const month = date.getMonth() + 1;
|
|
7
|
+
const day = date.getDate();
|
|
8
|
+
return `${year}년 ${month}월 ${day}일`;
|
|
9
|
+
};
|
|
10
|
+
return (<div className="mb-[20px] flex items-center justify-center">
|
|
11
|
+
<div className="dr_talk_body_small1 text-drTalkGrayscale3">{formatDate(date)}</div>
|
|
12
|
+
</div>);
|
|
13
|
+
};
|
|
14
|
+
export default DateSeparator;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
type DateSeparatorProps = {
|
|
5
|
+
date: Date;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const DateSeparator: React.FC<DateSeparatorProps> = ({ date }) => {
|
|
9
|
+
const formatDate = (date: Date): string => {
|
|
10
|
+
const year = date.getFullYear();
|
|
11
|
+
const month = date.getMonth() + 1;
|
|
12
|
+
const day = date.getDate();
|
|
13
|
+
|
|
14
|
+
return `${year}년 ${month}월 ${day}일`;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className="mb-[20px] flex items-center justify-center">
|
|
19
|
+
<div className="dr_talk_body_small1 text-drTalkGrayscale3">{formatDate(date)}</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default DateSeparator;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const FixedErrorBox = ({ isError = false, message = '네트워크 연결이 원활하지 않습니다.' }) => {
|
|
3
|
+
const WarningIcon = ({ className = '' }) => {
|
|
4
|
+
return (<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
|
|
5
|
+
<g clipPath="url(#clip0_1775_25245)">
|
|
6
|
+
<path d="M3 12C3 13.1819 3.23279 14.3522 3.68508 15.4442C4.13738 16.5361 4.80031 17.5282 5.63604 18.364C6.47177 19.1997 7.46392 19.8626 8.55585 20.3149C9.64778 20.7672 10.8181 21 12 21C13.1819 21 14.3522 20.7672 15.4442 20.3149C16.5361 19.8626 17.5282 19.1997 18.364 18.364C19.1997 17.5282 19.8626 16.5361 20.3149 15.4442C20.7672 14.3522 21 13.1819 21 12C21 9.61305 20.0518 7.32387 18.364 5.63604C16.6761 3.94821 14.3869 3 12 3C9.61305 3 7.32387 3.94821 5.63604 5.63604C3.94821 7.32387 3 9.61305 3 12Z" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
7
|
+
<path d="M12 16V16.01" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
8
|
+
<path d="M12 8.5L12 13" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
9
|
+
</g>
|
|
10
|
+
<defs>
|
|
11
|
+
<clipPath id="clip0_1775_25245">
|
|
12
|
+
<rect width="24" height="24" fill="white"/>
|
|
13
|
+
</clipPath>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>);
|
|
16
|
+
};
|
|
17
|
+
if (!isError) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
return (<div className={`
|
|
21
|
+
absolute left-1/2 z-[60] w-[90%] -translate-x-1/2 transition-all duration-300
|
|
22
|
+
${isError ? 'bottom-[96px]' : 'pointer-events-none bottom-0'}
|
|
23
|
+
`}>
|
|
24
|
+
<div className="flex h-[48px] w-full items-center justify-center space-x-[6px] rounded-[25px] bg-[#505050] text-white">
|
|
25
|
+
<div className="mt-0.5 flex-shrink-0">
|
|
26
|
+
<WarningIcon className="h-6 w-6 text-white"/>
|
|
27
|
+
</div>
|
|
28
|
+
<div className="flex">
|
|
29
|
+
<p className="dr_talk_body_medium2 whitespace-pre-line">{message}</p>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>);
|
|
33
|
+
};
|
|
34
|
+
export default FixedErrorBox;
|