@daeryun/dr_components 1.2.18 → 1.2.20
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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- 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/common/integrate/index.d.ts +1 -1
- package/dist/styles/globals.css +415 -414
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { ObjectNumber, WorkFlowButtonActionType, WorkFlowButtonUiCode } from '../_enums/work_flow_object_expose';
|
|
5
|
+
import { MessageObjectExpose } from '../_types/message_object';
|
|
6
|
+
import { useDaeryuntalk } from '../DaeryuntalkContext';
|
|
7
|
+
import { useRouter } from 'next/navigation';
|
|
8
|
+
import { useWorkFlow } from '../_hooks/talkprovider/useWorkFlow';
|
|
9
|
+
|
|
10
|
+
// 길이 fit 형
|
|
11
|
+
// 길이 full 형
|
|
12
|
+
// 업무 그룹형
|
|
13
|
+
|
|
14
|
+
// link_url
|
|
15
|
+
const ObjectButton = ({
|
|
16
|
+
object,
|
|
17
|
+
messageNumber,
|
|
18
|
+
workFlowNumber,
|
|
19
|
+
isFirstObject = false,
|
|
20
|
+
objectGroupUiCode
|
|
21
|
+
}: {
|
|
22
|
+
object: MessageObjectExpose;
|
|
23
|
+
messageNumber: string;
|
|
24
|
+
workFlowNumber: string;
|
|
25
|
+
isFirstObject: boolean;
|
|
26
|
+
objectGroupUiCode: string;
|
|
27
|
+
}) => {
|
|
28
|
+
const { startWorkFlow, chatInquiryNumber, workFlowStack, workFlowBack, tel, setMessageObject, setWorkFlowStack } =
|
|
29
|
+
useDaeryuntalk();
|
|
30
|
+
const { onClickKakao, onClickTel } = useWorkFlow({ tel: tel });
|
|
31
|
+
const router = useRouter();
|
|
32
|
+
|
|
33
|
+
const openExternalLink = (url: string) => {
|
|
34
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
35
|
+
};
|
|
36
|
+
const fitClassName = `
|
|
37
|
+
flex w-fit flex-row items-center gap-[6px] rounded-[4px] border-[1px]
|
|
38
|
+
border-solid border-drTalkGrayscale4 bg-drTalkGrayscale5 bg-opacity-50 h-[40px] px-[10px]
|
|
39
|
+
dr_talk_body_medium2
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
const fullClassName = `
|
|
43
|
+
flex w-full flex-row items-center justify-center gap-[6px] rounded-[4px] border-[1px]
|
|
44
|
+
border-solid border-drTalkGrayscale4 bg-drTalkGrayscale5 bg-opacity-50 h-[40px]
|
|
45
|
+
dr_talk_body_medium2
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const workTypeClassName = `
|
|
49
|
+
flex w-fit flex-row items-center justify-center gap-[4px] rounded-[20px] border-[1px]
|
|
50
|
+
border-solid border-drTalkGrayscale4 bg-white h-[32px] px-[10px]
|
|
51
|
+
dr_talk_body_medium2
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
const handleButton = async (object: MessageObjectExpose) => {
|
|
55
|
+
const actionType = object?.actionCode || '';
|
|
56
|
+
|
|
57
|
+
// 내부링크
|
|
58
|
+
if (actionType === WorkFlowButtonActionType.INTERNAL_LINK) {
|
|
59
|
+
}
|
|
60
|
+
// 외부링크
|
|
61
|
+
else if (actionType === WorkFlowButtonActionType.EXTERNAL_LINK) {
|
|
62
|
+
openExternalLink(object.linkUrl);
|
|
63
|
+
}
|
|
64
|
+
// 입력
|
|
65
|
+
else if (actionType === WorkFlowButtonActionType.INPUT) {
|
|
66
|
+
}
|
|
67
|
+
// 워크플로우호출
|
|
68
|
+
else if (actionType === WorkFlowButtonActionType.WORKFLOW_CALL) {
|
|
69
|
+
await startWorkFlow({
|
|
70
|
+
chatInquiryNumber: chatInquiryNumber || '',
|
|
71
|
+
messageNumber: messageNumber,
|
|
72
|
+
workFlowNumber: workFlowNumber,
|
|
73
|
+
objectNumber: object?.objectNumber || ''
|
|
74
|
+
});
|
|
75
|
+
if (object.objectNumber === ObjectNumber.START_CHAT) {
|
|
76
|
+
setMessageObject(null);
|
|
77
|
+
setWorkFlowStack([]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// 전화연결
|
|
82
|
+
else if (actionType === WorkFlowButtonActionType.PHONE_CALL) {
|
|
83
|
+
onClickTel();
|
|
84
|
+
router.push(`tel:${tel}`);
|
|
85
|
+
}
|
|
86
|
+
// 카카오연동
|
|
87
|
+
else if (actionType === WorkFlowButtonActionType.KAKAO_CONNECT) {
|
|
88
|
+
onClickKakao();
|
|
89
|
+
openExternalLink('https://pf.kakao.com/_xgxoTlK/chat');
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const renderButton = (className: string) => {
|
|
94
|
+
return (
|
|
95
|
+
<button
|
|
96
|
+
type="button"
|
|
97
|
+
onClick={async () => {
|
|
98
|
+
await handleButton(object);
|
|
99
|
+
}}
|
|
100
|
+
className={`${className}`}
|
|
101
|
+
>
|
|
102
|
+
<div className="h-[18px] w-[18px]">
|
|
103
|
+
<Image
|
|
104
|
+
src={object.iconImageUrl}
|
|
105
|
+
width={18}
|
|
106
|
+
height={18}
|
|
107
|
+
alt={object.objectName}
|
|
108
|
+
className="h-[18px] w-[18px] object-cover"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div className="flex items-center">
|
|
113
|
+
{isFirstObject ? objectListRender(object.objectNumber) : object.objectName}
|
|
114
|
+
</div>
|
|
115
|
+
</button>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const filterClassName = () => {
|
|
120
|
+
switch (objectGroupUiCode) {
|
|
121
|
+
case WorkFlowButtonUiCode.LEFT_FIT_BUTTON:
|
|
122
|
+
return fitClassName;
|
|
123
|
+
case WorkFlowButtonUiCode.FULL_BUTTON:
|
|
124
|
+
return fullClassName;
|
|
125
|
+
case WorkFlowButtonUiCode.TILE_BUTTON:
|
|
126
|
+
return workTypeClassName;
|
|
127
|
+
default:
|
|
128
|
+
return fitClassName; // 기본값
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
if (isFirstObject) {
|
|
133
|
+
return <>{renderButton(fitClassName)}</>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return <>{renderButton(filterClassName())}</>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export default ObjectButton;
|
|
140
|
+
|
|
141
|
+
// 예외케이스
|
|
142
|
+
const objectListRender = (objectNumber: string) => {
|
|
143
|
+
switch (objectNumber) {
|
|
144
|
+
case ObjectNumber.FIRST_VISIT:
|
|
145
|
+
return (
|
|
146
|
+
<>
|
|
147
|
+
대륜에 <span className="font-[700]">처음 방문</span> 하셨나요?
|
|
148
|
+
</>
|
|
149
|
+
);
|
|
150
|
+
case ObjectNumber.START_CHAT:
|
|
151
|
+
return (
|
|
152
|
+
<>
|
|
153
|
+
<span className="font-[700]">채팅 문의</span> 시작하기
|
|
154
|
+
</>
|
|
155
|
+
);
|
|
156
|
+
// case ObjectNumber.ASK_AI:
|
|
157
|
+
// return (
|
|
158
|
+
// <>
|
|
159
|
+
// <span className="font-[700]">AI 대륜</span>에게 질문하기
|
|
160
|
+
// </>
|
|
161
|
+
// );
|
|
162
|
+
case ObjectNumber.OTHER_RESERVATION:
|
|
163
|
+
return (
|
|
164
|
+
<>
|
|
165
|
+
다른 <span className="font-[700]">예약 방법</span> 보기
|
|
166
|
+
</>
|
|
167
|
+
);
|
|
168
|
+
case ObjectNumber.FAQ:
|
|
169
|
+
return (
|
|
170
|
+
<>
|
|
171
|
+
자주 묻는 <span className="font-[700]">질문</span>
|
|
172
|
+
</>
|
|
173
|
+
);
|
|
174
|
+
default:
|
|
175
|
+
return <>{objectNumber}</>;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
interface ChatWidgetProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
isMobile: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
hashValue: string | null;
|
|
7
|
+
setHashValue: Dispatch<SetStateAction<string | null>>;
|
|
8
|
+
animationState: string;
|
|
9
|
+
isMobileSafari?: boolean;
|
|
10
|
+
androidViewportHeight?: number;
|
|
11
|
+
}
|
|
12
|
+
declare const ChatWidget: React.FC<ChatWidgetProps>;
|
|
13
|
+
export default ChatWidget;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import ChatHomeView from './ChatHomeView';
|
|
4
|
+
import ImageViewer from './Viewer/ImageViewer';
|
|
5
|
+
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
6
|
+
const ChatWidget = ({ isOpen, isMobile, onClose, hashValue, setHashValue, animationState, isMobileSafari = false, androidViewportHeight = 0 }) => {
|
|
7
|
+
const { containerRef, isScroll, isBottom } = useScrollShadow();
|
|
8
|
+
const isHash = !!hashValue; // 해쉬 있을 경우
|
|
9
|
+
const chatWidgetRef = useRef(null);
|
|
10
|
+
// iOS Safari viewport 계산
|
|
11
|
+
const [viewportOffset, setViewportOffset] = useState(0);
|
|
12
|
+
const [viewportHeight, setViewportHeight] = useState(0);
|
|
13
|
+
const [viewState, setViewState] = useState('conversation');
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
if (!isMobileSafari)
|
|
17
|
+
return;
|
|
18
|
+
const updateViewport = () => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (!window.visualViewport)
|
|
21
|
+
return;
|
|
22
|
+
const offset = (_a = window.visualViewport.offsetTop) !== null && _a !== void 0 ? _a : 0;
|
|
23
|
+
const height = (_b = window.visualViewport.height) !== null && _b !== void 0 ? _b : window.innerHeight;
|
|
24
|
+
setViewportOffset(offset);
|
|
25
|
+
setViewportHeight(height);
|
|
26
|
+
};
|
|
27
|
+
updateViewport();
|
|
28
|
+
const onResize = () => updateViewport();
|
|
29
|
+
const onScroll = () => updateViewport();
|
|
30
|
+
(_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.addEventListener('resize', onResize);
|
|
31
|
+
(_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.addEventListener('scroll', onScroll);
|
|
32
|
+
return () => {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
(_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.removeEventListener('resize', onResize);
|
|
35
|
+
(_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.removeEventListener('scroll', onScroll);
|
|
36
|
+
};
|
|
37
|
+
}, [isMobileSafari]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const isScrollableElement = (element) => {
|
|
40
|
+
const style = window.getComputedStyle(element);
|
|
41
|
+
const hasScrollableY = style.overflowY === 'auto' || style.overflowY === 'scroll';
|
|
42
|
+
const hasScrollable = style.overflow === 'auto' || style.overflow === 'scroll';
|
|
43
|
+
// 실제로 스크롤이 가능한지 확인 (내용이 컨테이너보다 큰지)
|
|
44
|
+
if (hasScrollableY || hasScrollable) {
|
|
45
|
+
return element.scrollHeight > element.clientHeight;
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
};
|
|
49
|
+
const handleWheel = (e) => {
|
|
50
|
+
let target = e.target;
|
|
51
|
+
// 타겟부터 시작하여 부모 요소들을 확인
|
|
52
|
+
while (target && target !== chatWidgetRef.current) {
|
|
53
|
+
if (isScrollableElement(target)) {
|
|
54
|
+
// 스크롤 가능한 요소라면 이벤트를 허용
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
target = target.parentElement;
|
|
58
|
+
}
|
|
59
|
+
// 스크롤 가능한 요소가 아니라면 이벤트 차단
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
};
|
|
63
|
+
const element = chatWidgetRef.current;
|
|
64
|
+
if (element && isOpen) {
|
|
65
|
+
// passive: false로 설정하여 preventDefault()가 작동하도록 함
|
|
66
|
+
element.addEventListener('wheel', handleWheel, { passive: false });
|
|
67
|
+
}
|
|
68
|
+
return () => {
|
|
69
|
+
if (element) {
|
|
70
|
+
element.removeEventListener('wheel', handleWheel);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}, [isOpen]);
|
|
74
|
+
// 모바일 웹
|
|
75
|
+
const mobileWrapperCss = `
|
|
76
|
+
fixed inset-0 h-full w-full bg-white z-[999998] rounded-none flex flex-col
|
|
77
|
+
duration-500 ease-in-out
|
|
78
|
+
${isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
79
|
+
`;
|
|
80
|
+
// 웹 모바일 ~480px
|
|
81
|
+
const webSmallWrapperCss = `
|
|
82
|
+
${isHash ? `duration-300 ease-in-out` : `duration-300 ease-in-out`}
|
|
83
|
+
${isHash ? `${isOpen ? ' translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'} ` : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
84
|
+
fixed w-full max-w-[100vw] z-[999998] rounded-none flex flex-col
|
|
85
|
+
bottom-0 right-0 h-[100dvh]
|
|
86
|
+
`;
|
|
87
|
+
// 해쉬 있을 경우는 여기서 중앙배치 css로
|
|
88
|
+
const webTbPCWrapperCss = `
|
|
89
|
+
${isHash ? `` : 'xs:duration-300 ease-in-out'}
|
|
90
|
+
${isHash
|
|
91
|
+
? ``
|
|
92
|
+
: isOpen
|
|
93
|
+
? 'opacity-100 pointer-events-auto xs:translate-y-0 xs:duration-500'
|
|
94
|
+
: 'opacity-0 pointer-events-none xs:translate-y-4 xs:duration-500 xs:rounded-[30px] '}
|
|
95
|
+
${isHash
|
|
96
|
+
? `
|
|
97
|
+
xs:fixed xs:flex xs:justify-center xs:items-center xs:inset-0 xs:bg-white
|
|
98
|
+
xs:w-screen xs:h-[100dvh] xs:inset-0 xs:pt-[70px]
|
|
99
|
+
`
|
|
100
|
+
: `
|
|
101
|
+
h-[100dvh] ease-in-out
|
|
102
|
+
xs:bottom-[165px] right-0 xs:right-[30px] lg:right-[90px] xs:max-w-[390px]
|
|
103
|
+
xs:max-h-[690px] xs:rounded-[30px]
|
|
104
|
+
lg:bottom-[120px] xs:rounded-[30px]
|
|
105
|
+
`}
|
|
106
|
+
`;
|
|
107
|
+
//
|
|
108
|
+
const innerMobileWrapperCss = `
|
|
109
|
+
rounded-none sm:max-w-[640px] sm:m-auto
|
|
110
|
+
`;
|
|
111
|
+
const innerWebSmallWrapperCss = `
|
|
112
|
+
rounded-none
|
|
113
|
+
`;
|
|
114
|
+
// 웹 480~1023px , pc 1024px~
|
|
115
|
+
const innerWebTbPCWrapperCss = `
|
|
116
|
+
xs:rounded-[30px]
|
|
117
|
+
`;
|
|
118
|
+
// 웹 모바일
|
|
119
|
+
// 태블릿 크기 이상 2
|
|
120
|
+
return (<>
|
|
121
|
+
<ImageViewer />
|
|
122
|
+
|
|
123
|
+
<div className="relative">
|
|
124
|
+
<div ref={chatWidgetRef} className={`
|
|
125
|
+
|
|
126
|
+
${isMobile ? `${mobileWrapperCss}` : `${webSmallWrapperCss} ${webTbPCWrapperCss} `}
|
|
127
|
+
`}>
|
|
128
|
+
<div ref={containerRef} className={`
|
|
129
|
+
relative z-[999998]
|
|
130
|
+
flex h-full flex-col items-center ${isHash ? 'justify-center' : 'justify-end'}
|
|
131
|
+
${isMobile ? `${innerMobileWrapperCss}` : `${innerWebSmallWrapperCss} ${innerWebTbPCWrapperCss}`}
|
|
132
|
+
`} style={viewState !== 'conversation' || !isMobile
|
|
133
|
+
? undefined
|
|
134
|
+
: isMobileSafari
|
|
135
|
+
? {
|
|
136
|
+
position: 'fixed',
|
|
137
|
+
top: `${viewportOffset}px`,
|
|
138
|
+
left: 0,
|
|
139
|
+
right: 0,
|
|
140
|
+
height: viewportHeight ? `${viewportHeight}px` : '100%',
|
|
141
|
+
maxHeight: viewportHeight ? `${viewportHeight}px` : '100%',
|
|
142
|
+
minHeight: viewportHeight ? `${viewportHeight}px` : '100%'
|
|
143
|
+
}
|
|
144
|
+
: {
|
|
145
|
+
height: `${androidViewportHeight}px`,
|
|
146
|
+
maxHeight: `${androidViewportHeight}px`
|
|
147
|
+
}}>
|
|
148
|
+
<ChatHomeView hashValue={hashValue} isMobile={isMobile} isHash={isHash} onClose={onClose} androidViewportHeight={androidViewportHeight} isMobileSafari={isMobileSafari} viewState={viewState} setViewState={setViewState}/>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</>);
|
|
153
|
+
};
|
|
154
|
+
export default ChatWidget;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import ChatHomeView, { ViewState } from './ChatHomeView';
|
|
4
|
+
import ImageViewer from './Viewer/ImageViewer';
|
|
5
|
+
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
6
|
+
|
|
7
|
+
interface ChatWidgetProps {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
hashValue: string | null;
|
|
12
|
+
setHashValue: Dispatch<SetStateAction<string | null>>;
|
|
13
|
+
animationState: string;
|
|
14
|
+
isMobileSafari?: boolean;
|
|
15
|
+
androidViewportHeight?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const ChatWidget: React.FC<ChatWidgetProps> = ({
|
|
19
|
+
isOpen,
|
|
20
|
+
isMobile,
|
|
21
|
+
onClose,
|
|
22
|
+
hashValue,
|
|
23
|
+
setHashValue,
|
|
24
|
+
animationState,
|
|
25
|
+
isMobileSafari = false,
|
|
26
|
+
androidViewportHeight = 0
|
|
27
|
+
}) => {
|
|
28
|
+
const { containerRef, isScroll, isBottom } = useScrollShadow<HTMLDivElement>();
|
|
29
|
+
const isHash = !!hashValue; // 해쉬 있을 경우
|
|
30
|
+
const chatWidgetRef = useRef<HTMLDivElement>(null);
|
|
31
|
+
|
|
32
|
+
// iOS Safari viewport 계산
|
|
33
|
+
const [viewportOffset, setViewportOffset] = useState(0);
|
|
34
|
+
const [viewportHeight, setViewportHeight] = useState(0);
|
|
35
|
+
|
|
36
|
+
const [viewState, setViewState] = useState<ViewState>('conversation');
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!isMobileSafari) return;
|
|
40
|
+
|
|
41
|
+
const updateViewport = () => {
|
|
42
|
+
if (!window.visualViewport) return;
|
|
43
|
+
|
|
44
|
+
const offset = window.visualViewport.offsetTop ?? 0;
|
|
45
|
+
const height = window.visualViewport.height ?? window.innerHeight;
|
|
46
|
+
|
|
47
|
+
setViewportOffset(offset);
|
|
48
|
+
setViewportHeight(height);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
updateViewport();
|
|
52
|
+
|
|
53
|
+
const onResize = () => updateViewport();
|
|
54
|
+
const onScroll = () => updateViewport();
|
|
55
|
+
|
|
56
|
+
window.visualViewport?.addEventListener('resize', onResize);
|
|
57
|
+
window.visualViewport?.addEventListener('scroll', onScroll);
|
|
58
|
+
|
|
59
|
+
return () => {
|
|
60
|
+
window.visualViewport?.removeEventListener('resize', onResize);
|
|
61
|
+
window.visualViewport?.removeEventListener('scroll', onScroll);
|
|
62
|
+
};
|
|
63
|
+
}, [isMobileSafari]);
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const isScrollableElement = (element: Element): boolean => {
|
|
67
|
+
const style = window.getComputedStyle(element);
|
|
68
|
+
const hasScrollableY = style.overflowY === 'auto' || style.overflowY === 'scroll';
|
|
69
|
+
const hasScrollable = style.overflow === 'auto' || style.overflow === 'scroll';
|
|
70
|
+
|
|
71
|
+
// 실제로 스크롤이 가능한지 확인 (내용이 컨테이너보다 큰지)
|
|
72
|
+
if (hasScrollableY || hasScrollable) {
|
|
73
|
+
return element.scrollHeight > element.clientHeight;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const handleWheel = (e: WheelEvent) => {
|
|
79
|
+
let target = e.target as Element;
|
|
80
|
+
|
|
81
|
+
// 타겟부터 시작하여 부모 요소들을 확인
|
|
82
|
+
while (target && target !== chatWidgetRef.current) {
|
|
83
|
+
if (isScrollableElement(target)) {
|
|
84
|
+
// 스크롤 가능한 요소라면 이벤트를 허용
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
target = target.parentElement as Element;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 스크롤 가능한 요소가 아니라면 이벤트 차단
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
e.stopPropagation();
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const element = chatWidgetRef.current;
|
|
96
|
+
if (element && isOpen) {
|
|
97
|
+
// passive: false로 설정하여 preventDefault()가 작동하도록 함
|
|
98
|
+
element.addEventListener('wheel', handleWheel, { passive: false });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return () => {
|
|
102
|
+
if (element) {
|
|
103
|
+
element.removeEventListener('wheel', handleWheel);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}, [isOpen]);
|
|
107
|
+
|
|
108
|
+
// 모바일 웹
|
|
109
|
+
const mobileWrapperCss = `
|
|
110
|
+
fixed inset-0 h-full w-full bg-white z-[999998] rounded-none flex flex-col
|
|
111
|
+
duration-500 ease-in-out
|
|
112
|
+
${isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
// 웹 모바일 ~480px
|
|
116
|
+
const webSmallWrapperCss = `
|
|
117
|
+
${isHash ? `duration-300 ease-in-out` : `duration-300 ease-in-out`}
|
|
118
|
+
${isHash ? `${isOpen ? ' translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'} ` : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
119
|
+
fixed w-full max-w-[100vw] z-[999998] rounded-none flex flex-col
|
|
120
|
+
bottom-0 right-0 h-[100dvh]
|
|
121
|
+
`;
|
|
122
|
+
|
|
123
|
+
// 해쉬 있을 경우는 여기서 중앙배치 css로
|
|
124
|
+
const webTbPCWrapperCss = `
|
|
125
|
+
${isHash ? `` : 'xs:duration-300 ease-in-out'}
|
|
126
|
+
${
|
|
127
|
+
isHash
|
|
128
|
+
? ``
|
|
129
|
+
: isOpen
|
|
130
|
+
? 'opacity-100 pointer-events-auto xs:translate-y-0 xs:duration-500'
|
|
131
|
+
: 'opacity-0 pointer-events-none xs:translate-y-4 xs:duration-500 xs:rounded-[30px] '
|
|
132
|
+
}
|
|
133
|
+
${
|
|
134
|
+
isHash
|
|
135
|
+
? `
|
|
136
|
+
xs:fixed xs:flex xs:justify-center xs:items-center xs:inset-0 xs:bg-white
|
|
137
|
+
xs:w-screen xs:h-[100dvh] xs:inset-0 xs:pt-[70px]
|
|
138
|
+
`
|
|
139
|
+
: `
|
|
140
|
+
h-[100dvh] ease-in-out
|
|
141
|
+
xs:bottom-[165px] right-0 xs:right-[30px] lg:right-[90px] xs:max-w-[390px]
|
|
142
|
+
xs:max-h-[690px] xs:rounded-[30px]
|
|
143
|
+
lg:bottom-[120px] xs:rounded-[30px]
|
|
144
|
+
`
|
|
145
|
+
}
|
|
146
|
+
`;
|
|
147
|
+
|
|
148
|
+
//
|
|
149
|
+
const innerMobileWrapperCss = `
|
|
150
|
+
rounded-none sm:max-w-[640px] sm:m-auto
|
|
151
|
+
`;
|
|
152
|
+
|
|
153
|
+
const innerWebSmallWrapperCss = `
|
|
154
|
+
rounded-none
|
|
155
|
+
`;
|
|
156
|
+
|
|
157
|
+
// 웹 480~1023px , pc 1024px~
|
|
158
|
+
const innerWebTbPCWrapperCss = `
|
|
159
|
+
xs:rounded-[30px]
|
|
160
|
+
`;
|
|
161
|
+
|
|
162
|
+
// 웹 모바일
|
|
163
|
+
|
|
164
|
+
// 태블릿 크기 이상 2
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
<>
|
|
168
|
+
<ImageViewer />
|
|
169
|
+
|
|
170
|
+
<div className="relative">
|
|
171
|
+
<div
|
|
172
|
+
ref={chatWidgetRef}
|
|
173
|
+
className={`
|
|
174
|
+
|
|
175
|
+
${isMobile ? `${mobileWrapperCss}` : `${webSmallWrapperCss} ${webTbPCWrapperCss} `}
|
|
176
|
+
`}
|
|
177
|
+
>
|
|
178
|
+
<div
|
|
179
|
+
ref={containerRef}
|
|
180
|
+
className={`
|
|
181
|
+
relative z-[999998]
|
|
182
|
+
flex h-full flex-col items-center ${isHash ? 'justify-center' : 'justify-end'}
|
|
183
|
+
${isMobile ? `${innerMobileWrapperCss}` : `${innerWebSmallWrapperCss} ${innerWebTbPCWrapperCss}`}
|
|
184
|
+
`}
|
|
185
|
+
style={
|
|
186
|
+
viewState !== 'conversation' || !isMobile
|
|
187
|
+
? undefined
|
|
188
|
+
: isMobileSafari
|
|
189
|
+
? {
|
|
190
|
+
position: 'fixed',
|
|
191
|
+
top: `${viewportOffset}px`,
|
|
192
|
+
left: 0,
|
|
193
|
+
right: 0,
|
|
194
|
+
height: viewportHeight ? `${viewportHeight}px` : '100%',
|
|
195
|
+
maxHeight: viewportHeight ? `${viewportHeight}px` : '100%',
|
|
196
|
+
minHeight: viewportHeight ? `${viewportHeight}px` : '100%'
|
|
197
|
+
}
|
|
198
|
+
: {
|
|
199
|
+
height: `${androidViewportHeight}px`,
|
|
200
|
+
maxHeight: `${androidViewportHeight}px`
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
>
|
|
204
|
+
<ChatHomeView
|
|
205
|
+
hashValue={hashValue}
|
|
206
|
+
isMobile={isMobile}
|
|
207
|
+
isHash={isHash}
|
|
208
|
+
onClose={onClose}
|
|
209
|
+
androidViewportHeight={androidViewportHeight}
|
|
210
|
+
isMobileSafari={isMobileSafari}
|
|
211
|
+
viewState={viewState}
|
|
212
|
+
setViewState={setViewState}
|
|
213
|
+
/>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
</>
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export default ChatWidget;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React, { ReactNode } 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 { ViewState } from './ChatHomeView';
|
|
6
|
+
import { AgeCheckStatusEnums } from './_enums/ags_check_status';
|
|
7
|
+
type DaeryuntalkContextType = {
|
|
8
|
+
messages: Message[];
|
|
9
|
+
inquiryStatus: string;
|
|
10
|
+
messageObject: MessageObject | null;
|
|
11
|
+
isNextPage: boolean | null;
|
|
12
|
+
isConnected: boolean | null;
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
sendMessage: (htmlContent: string, jsonData: any) => void;
|
|
15
|
+
initializeDaeryuntalk: (hashValue: string, isOpen: boolean, centerCode: string, version?: string) => void;
|
|
16
|
+
startChat: (inquiryNumber?: string) => Promise<any>;
|
|
17
|
+
createNewChat: () => void;
|
|
18
|
+
startWorkFlow: (data: {
|
|
19
|
+
chatInquiryNumber: string;
|
|
20
|
+
messageNumber: string;
|
|
21
|
+
workFlowNumber: string;
|
|
22
|
+
objectNumber: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
workFlowBack: (data: {
|
|
25
|
+
chatInquiryNumber: string;
|
|
26
|
+
messageNumber: string;
|
|
27
|
+
workFlowNavigationCode: string;
|
|
28
|
+
}) => void;
|
|
29
|
+
chatInquiryNumber: string | null;
|
|
30
|
+
workFlowStack: string[];
|
|
31
|
+
sendHeartbeat: () => void;
|
|
32
|
+
sendInquiryWatching: (chatInquiryNumber: string) => void;
|
|
33
|
+
sendInquiryLeft: (chatInquiryNumber: string) => void;
|
|
34
|
+
chatUserUpdate: (data: {
|
|
35
|
+
chatInquiryNumber: string;
|
|
36
|
+
messageNumber: string;
|
|
37
|
+
name: string;
|
|
38
|
+
cellPhoneNumber: string;
|
|
39
|
+
}) => void;
|
|
40
|
+
getNextMessageList: (chatInquiryNumber: string, standardDateTime: any) => void;
|
|
41
|
+
isOpen?: boolean;
|
|
42
|
+
chatData?: ChatInquiryDetailDataResponse | null;
|
|
43
|
+
inquiryMainData?: IChatInquiryMainDataResponse | null;
|
|
44
|
+
isAuthenticated: boolean;
|
|
45
|
+
isSocketInitialized?: boolean;
|
|
46
|
+
isSocketConnected?: boolean;
|
|
47
|
+
error?: Error | null;
|
|
48
|
+
closeDaeryuntalk?: () => void;
|
|
49
|
+
isImageViewerOpen?: boolean;
|
|
50
|
+
selectedImageFile?: FileInfo | null;
|
|
51
|
+
imageViewerMessage?: Message | null;
|
|
52
|
+
openImageViewer?: (file: FileInfo, message: Message) => void;
|
|
53
|
+
closeImageViewer?: () => void;
|
|
54
|
+
tel: string;
|
|
55
|
+
goRequestPhone: (data: {
|
|
56
|
+
name: string;
|
|
57
|
+
cellPhoneNumber: string;
|
|
58
|
+
version?: string;
|
|
59
|
+
}) => void;
|
|
60
|
+
goHistoryPhoneAuth: (data: {
|
|
61
|
+
name: string;
|
|
62
|
+
cellPhoneNumber: string;
|
|
63
|
+
certificationNumber: string;
|
|
64
|
+
version?: string;
|
|
65
|
+
}) => void;
|
|
66
|
+
goGetHistoryList: (data: {
|
|
67
|
+
version?: string;
|
|
68
|
+
}) => void;
|
|
69
|
+
historyList: History[];
|
|
70
|
+
sendHistoryEntered: (chatInquiryNumbers: string[]) => void;
|
|
71
|
+
sendHistoryLeft: (chatInquiryNumbers: string[]) => void;
|
|
72
|
+
startSelectedChat: (chatInquiryNumbers: string) => void;
|
|
73
|
+
sendInquiryJoined: (chatInquiryNumber: string) => void;
|
|
74
|
+
attendRoomByHistory: (chatInquiryNumber: string) => any;
|
|
75
|
+
retryInquiryMain: (channelNumber: string) => any;
|
|
76
|
+
setMessageObject: (obj: MessageObject | null) => void;
|
|
77
|
+
setWorkFlowStack: (arr: string[]) => void;
|
|
78
|
+
retryInitData: () => void;
|
|
79
|
+
isTyping: boolean;
|
|
80
|
+
centerCode: string;
|
|
81
|
+
setIsTyping: (isTyping: boolean) => void;
|
|
82
|
+
setPreviewState: (view: ViewState) => void;
|
|
83
|
+
preViewState: ViewState;
|
|
84
|
+
isUserExpired: boolean;
|
|
85
|
+
setIsUserExpried: (isUserExpired: boolean) => void;
|
|
86
|
+
initialLoading: boolean | null;
|
|
87
|
+
setInitialLoading: (initialLoading: boolean | null) => void;
|
|
88
|
+
ageCheckStatus: AgeCheckStatusEnums | null;
|
|
89
|
+
setAgeCheckStatus: (ageCheckStatus: AgeCheckStatusEnums | null) => void;
|
|
90
|
+
ageConfirm: (chatInquiryNumber: string, ageConsentStateCode: AgeCheckStatusEnums) => void;
|
|
91
|
+
};
|
|
92
|
+
declare const DaeryuntalkContext: React.Context<DaeryuntalkContextType>;
|
|
93
|
+
type DaeryuntalkProviderProps = {
|
|
94
|
+
children: ReactNode;
|
|
95
|
+
isMobile: boolean;
|
|
96
|
+
onClose: () => void;
|
|
97
|
+
propsTel: string;
|
|
98
|
+
centerCode: string;
|
|
99
|
+
isOpen: boolean;
|
|
100
|
+
};
|
|
101
|
+
export declare const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps>;
|
|
102
|
+
export declare const useDaeryuntalk: () => DaeryuntalkContextType;
|
|
103
|
+
export default DaeryuntalkContext;
|