@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,261 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import ChatButton from './ChatButton';
|
|
5
|
+
import ChatWidget from './ChatWidget';
|
|
6
|
+
import { DaeryuntalkProvider } from './DaeryuntalkContext';
|
|
7
|
+
import { DaeryuntalkToastProvider } from './Toast/DaeryuntalkToastProvider';
|
|
8
|
+
import mobile from 'is-mobile';
|
|
9
|
+
import Head from 'next/head';
|
|
10
|
+
import { usePathname } from 'next/navigation';
|
|
11
|
+
import ViewportHandler from './ViewportHandler';
|
|
12
|
+
import { useWindowSize } from './_hooks/useWindowSize';
|
|
13
|
+
|
|
14
|
+
type DaeryuntalkProps = {
|
|
15
|
+
tel?: string;
|
|
16
|
+
centerCode?: string;
|
|
17
|
+
bannerHeight?: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const DaeryuntalkBackup: React.FC<DaeryuntalkProps> = ({
|
|
21
|
+
tel = '1800-7905',
|
|
22
|
+
centerCode = 'CT0000',
|
|
23
|
+
bannerHeight = 0
|
|
24
|
+
}) => {
|
|
25
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
26
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
27
|
+
const [isMobileSafari, setIsMobileSafari] = useState(false); // ios + 모바일
|
|
28
|
+
const [androidViewportHeight, setAndroidViewportHeight] = useState(0); //
|
|
29
|
+
|
|
30
|
+
const pathName = usePathname();
|
|
31
|
+
const windowSize = useWindowSize();
|
|
32
|
+
const isMobileSize = windowSize.width <= 480;
|
|
33
|
+
|
|
34
|
+
// const isMobile = mobile();
|
|
35
|
+
const [hashValue, setHashValue] = useState<string | null>(null);
|
|
36
|
+
|
|
37
|
+
const [showCustomTitle, setShowCustomTitle] = useState(false); // ← 추가
|
|
38
|
+
|
|
39
|
+
// 상태 관리 (컴포넌트 내부에 추가)
|
|
40
|
+
const [animationState, setAnimationState] = useState('hidden'); // 'hidden', 'entering', 'visible', 'exiting'
|
|
41
|
+
const [currentCenterCode, setCurrentCenterCode] = useState<string | null>(null);
|
|
42
|
+
|
|
43
|
+
const detectIsMobileSafari = () => {
|
|
44
|
+
if (typeof window === 'undefined') return false;
|
|
45
|
+
const ua = window.navigator.userAgent;
|
|
46
|
+
const isIOS = /iPhone|iPad|iPod/i.test(ua);
|
|
47
|
+
const isSafari = /Safari/i.test(ua) && !/Chrome/i.test(ua);
|
|
48
|
+
return isIOS && isSafari;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// 모달 열기 함수
|
|
52
|
+
const openModal = () => {
|
|
53
|
+
setAnimationState('entering');
|
|
54
|
+
setIsOpen(true);
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
setAnimationState('visible');
|
|
57
|
+
}, 50);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// 모달 닫기 함수
|
|
61
|
+
const closeModal = () => {
|
|
62
|
+
setAnimationState('exiting');
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
setAnimationState('hidden');
|
|
65
|
+
setIsOpen(false);
|
|
66
|
+
}, 300);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const toggleChat = () => {
|
|
70
|
+
if (isOpen) {
|
|
71
|
+
closeModal();
|
|
72
|
+
} else {
|
|
73
|
+
openModal();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (!isMobile) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (isMobileSafari) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const compute = () => {
|
|
85
|
+
const vh = window.visualViewport?.height || window.innerHeight;
|
|
86
|
+
setAndroidViewportHeight(vh);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
compute();
|
|
90
|
+
|
|
91
|
+
window.addEventListener('resize', compute);
|
|
92
|
+
window.visualViewport?.addEventListener('resize', compute);
|
|
93
|
+
|
|
94
|
+
return () => {
|
|
95
|
+
window.removeEventListener('resize', compute);
|
|
96
|
+
window.visualViewport?.removeEventListener('resize', compute);
|
|
97
|
+
};
|
|
98
|
+
}, [isMobile, isMobileSafari]);
|
|
99
|
+
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
setIsMobileSafari(detectIsMobileSafari());
|
|
102
|
+
}, []);
|
|
103
|
+
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (!((isMobileSize || isMobile) && isOpen)) return;
|
|
106
|
+
|
|
107
|
+
const { body, documentElement } = document;
|
|
108
|
+
|
|
109
|
+
// 현재 스크롤 위치 저장
|
|
110
|
+
const scrollY = window.scrollY || documentElement.scrollTop || body.scrollTop || 0;
|
|
111
|
+
|
|
112
|
+
// 스크롤 완전 고정
|
|
113
|
+
body.style.position = 'fixed';
|
|
114
|
+
body.style.top = `-${scrollY}px`;
|
|
115
|
+
body.style.width = '100%';
|
|
116
|
+
body.style.left = '0';
|
|
117
|
+
body.style.right = '0';
|
|
118
|
+
body.style.overflow = 'hidden';
|
|
119
|
+
|
|
120
|
+
return () => {
|
|
121
|
+
body.style.position = '';
|
|
122
|
+
body.style.top = '';
|
|
123
|
+
body.style.width = '';
|
|
124
|
+
body.style.left = '';
|
|
125
|
+
body.style.right = '';
|
|
126
|
+
body.style.overflow = '';
|
|
127
|
+
|
|
128
|
+
window.scrollTo(0, scrollY);
|
|
129
|
+
};
|
|
130
|
+
}, [isMobile, isMobileSize, isOpen]);
|
|
131
|
+
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (typeof window !== 'undefined') {
|
|
134
|
+
setIsMobile(mobile());
|
|
135
|
+
|
|
136
|
+
const path = window.location.pathname;
|
|
137
|
+
|
|
138
|
+
// const isDaeryuntalkPath =
|
|
139
|
+
// path === '/daeryuntalk' || path === '/daeryuntalk-test' || (isLocal && path === '/chat-test');
|
|
140
|
+
const isDaeryuntalkPath = path === '/daeryuntalk' || path === '/daeryuntalk-test';
|
|
141
|
+
|
|
142
|
+
if (isDaeryuntalkPath) {
|
|
143
|
+
setShowCustomTitle(true);
|
|
144
|
+
|
|
145
|
+
const hash = window.location.hash;
|
|
146
|
+
const raw = hash ? hash.substring(1) : null;
|
|
147
|
+
|
|
148
|
+
if (raw) {
|
|
149
|
+
if (raw.includes('centerCode=')) {
|
|
150
|
+
// 쿼리 스트링 형식 (#token=abc¢erCode=xyz) 파싱
|
|
151
|
+
const params = new URLSearchParams(raw);
|
|
152
|
+
const token = params.get('token');
|
|
153
|
+
const code = params.get('centerCode') || '';
|
|
154
|
+
|
|
155
|
+
if (centerCode) {
|
|
156
|
+
setHashValue(token);
|
|
157
|
+
}
|
|
158
|
+
setCurrentCenterCode(code);
|
|
159
|
+
} else {
|
|
160
|
+
setHashValue(raw);
|
|
161
|
+
setCurrentCenterCode(centerCode);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// 해시 제거 (선택 사항)
|
|
165
|
+
// window.history.replaceState(null, '', window.location.pathname + window.location.search);
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
setCurrentCenterCode(centerCode);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}, [pathName]);
|
|
172
|
+
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
if (isOpen && (isMobile || isMobileSize)) {
|
|
175
|
+
document.body.style.overflow = 'hidden';
|
|
176
|
+
} else {
|
|
177
|
+
document.body.style.overflow = '';
|
|
178
|
+
}
|
|
179
|
+
// 컴포넌트가 unmount 될 때도 원복
|
|
180
|
+
return () => {
|
|
181
|
+
document.body.style.overflow = '';
|
|
182
|
+
};
|
|
183
|
+
}, [isOpen, isMobile, isMobileSize]);
|
|
184
|
+
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
if (!(isMobile && isOpen)) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
document.documentElement.classList.add('drtop-inflow-active');
|
|
190
|
+
return () => document.documentElement.classList.remove('drtop-inflow-active');
|
|
191
|
+
}, [isMobile, isOpen]);
|
|
192
|
+
|
|
193
|
+
// ios일 경우 확대영 class 추가
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
const ua = navigator.userAgent;
|
|
196
|
+
const isiOS = /iP(hone|od|ad)/.test(ua);
|
|
197
|
+
const isWebKit = /WebKit/.test(ua) && !/CriOS|FxiOS|OPiOS/.test(ua);
|
|
198
|
+
if (isiOS && isWebKit) {
|
|
199
|
+
document.documentElement.classList.add('ios');
|
|
200
|
+
return () => document.documentElement.classList.remove('ios');
|
|
201
|
+
}
|
|
202
|
+
}, []);
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
<div className="daeryuntalk-wrapper my-scroll-container">
|
|
206
|
+
{showCustomTitle && (
|
|
207
|
+
<Head>
|
|
208
|
+
<title>법무법인 (유한)대륜 채팅상담</title>
|
|
209
|
+
</Head>
|
|
210
|
+
)}
|
|
211
|
+
<style>
|
|
212
|
+
{`
|
|
213
|
+
@media (max-width: 360px) {
|
|
214
|
+
html.drtop-inflow-active #wrap { min-width: 0 !important; }
|
|
215
|
+
}
|
|
216
|
+
`}
|
|
217
|
+
</style>
|
|
218
|
+
<DaeryuntalkToastProvider>
|
|
219
|
+
<ViewportHandler isMobile={isMobile} isDisable={!isOpen || !isMobile} />
|
|
220
|
+
<DaeryuntalkProvider
|
|
221
|
+
propsTel={tel}
|
|
222
|
+
isMobile={isMobile}
|
|
223
|
+
onClose={closeModal}
|
|
224
|
+
centerCode={currentCenterCode || ''}
|
|
225
|
+
isOpen={isOpen}
|
|
226
|
+
>
|
|
227
|
+
{isMobile ? (
|
|
228
|
+
isOpen || !currentCenterCode ? null : (
|
|
229
|
+
<ChatButton
|
|
230
|
+
isOpen={isOpen}
|
|
231
|
+
isMobile={isMobile}
|
|
232
|
+
hashValue={hashValue}
|
|
233
|
+
onClick={toggleChat}
|
|
234
|
+
/>
|
|
235
|
+
)
|
|
236
|
+
) : !currentCenterCode ? null : (
|
|
237
|
+
<ChatButton
|
|
238
|
+
isOpen={isOpen}
|
|
239
|
+
isMobile={isMobile}
|
|
240
|
+
hashValue={hashValue}
|
|
241
|
+
onClick={toggleChat}
|
|
242
|
+
bannerHeight={bannerHeight}
|
|
243
|
+
/>
|
|
244
|
+
)}
|
|
245
|
+
<ChatWidget
|
|
246
|
+
isOpen={hashValue ? true : isOpen}
|
|
247
|
+
isMobile={isMobile}
|
|
248
|
+
onClose={closeModal}
|
|
249
|
+
hashValue={hashValue}
|
|
250
|
+
setHashValue={setHashValue}
|
|
251
|
+
animationState={animationState}
|
|
252
|
+
isMobileSafari={isMobileSafari}
|
|
253
|
+
androidViewportHeight={androidViewportHeight}
|
|
254
|
+
/>
|
|
255
|
+
</DaeryuntalkProvider>
|
|
256
|
+
</DaeryuntalkToastProvider>
|
|
257
|
+
</div>
|
|
258
|
+
);
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export default DaeryuntalkBackup;
|