@daeryun/dr_components 0.8.87 → 0.8.88
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/ChatConversation.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatConversation.tsx +2 -2
- package/dist/components/Daeryuntalk/ChatHomeView.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatHomeView.tsx +2 -2
- package/dist/components/Daeryuntalk/ChatInput.d.ts +4 -1
- package/dist/components/Daeryuntalk/ChatInput.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatInput.tsx +5 -1
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.tsx +2 -2
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.jsx +4 -7
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.tsx +5 -4
- package/dist/components/Daeryuntalk/ChatMessage.jsx +34 -3
- package/dist/components/Daeryuntalk/ChatMessage.tsx +35 -3
- package/dist/components/Daeryuntalk/ChatWidget.jsx +5 -5
- package/dist/components/Daeryuntalk/ChatWidget.tsx +5 -5
- package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +1 -0
- package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +3 -2
- package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +4 -2
- package/dist/components/Daeryuntalk/HomeView.jsx +1 -1
- package/dist/components/Daeryuntalk/HomeView.tsx +5 -1
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.d.ts +1 -0
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.jsx +2 -2
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +13 -2
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +1 -1
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +1 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +2 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +2 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +4 -1
- package/dist/components/Daeryuntalk/index.jsx +1 -1
- package/dist/components/Daeryuntalk/index.tsx +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { hasBlocks, hasCustomerWorkFlowClickData, hasFileArray, hasForm, hasRichForm, hasWorkFlow } from './_types/message';
|
|
12
12
|
import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
13
|
+
import ResendIcon from '../../asset/images/daeryuntalk/re_send.svg';
|
|
13
14
|
import { ObjectNumber, WorkFlowBackOrInit, WorkFlowButtonUiCode } from './_enums/work_flow_object_expose';
|
|
14
15
|
import { MessageSenderType } from './_enums/sender_type';
|
|
15
16
|
import ObjectButton from './ChatObject/ObjectButton';
|
|
@@ -32,6 +33,29 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
|
|
|
32
33
|
return `${hours}:${minutes}`;
|
|
33
34
|
};
|
|
34
35
|
const time = formatTime(message.createdAt);
|
|
36
|
+
// {
|
|
37
|
+
// "blocks": [
|
|
38
|
+
// {
|
|
39
|
+
// "type": "text",
|
|
40
|
+
// "value": "궁금한 점이나 도움이 필요하신 부분\n말씀해 주시면 도와드리겠습니다.\n6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다."
|
|
41
|
+
// }
|
|
42
|
+
// ],
|
|
43
|
+
// "created_at": "2025-07-17T00:31:33.201143265Z",
|
|
44
|
+
// "inquiry_number": "C9846633909467187913",
|
|
45
|
+
// "language": "ko",
|
|
46
|
+
// "message_number": "MSG91145971809777216",
|
|
47
|
+
// "message_status": "CREATED",
|
|
48
|
+
// "message_type": "MSP00200003",
|
|
49
|
+
// "plain_text": "궁금한 점이나 도움이 필요하신 부분\n말씀해 주시면 도와드리겠습니다.\n6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다.",
|
|
50
|
+
// "sender_type": "MSP00100002",
|
|
51
|
+
// "template_type": "MSP00300202",
|
|
52
|
+
// "timestamp": 1752712293201143,
|
|
53
|
+
// "updated_at": "2025-07-17T00:31:33.201143265Z",
|
|
54
|
+
// "user_key": "",
|
|
55
|
+
// "work_flow": {
|
|
56
|
+
// "option_exposure_yn": true,
|
|
57
|
+
// "work_flow_number": "W210295281847689P001"
|
|
58
|
+
// }
|
|
35
59
|
// 텍스트 블록 렌더링
|
|
36
60
|
const renderText = (message, isObject) => {
|
|
37
61
|
/**
|
|
@@ -84,11 +108,18 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
|
|
|
84
108
|
</TimeWrapper>);
|
|
85
109
|
}
|
|
86
110
|
if (isRichForm) {
|
|
87
|
-
return (<TimeWrapper time={time} timePosition={isOperator ? 'right' : 'left'}>
|
|
111
|
+
return message.messageStatus === 'CREATED' ? (<TimeWrapper time={time} timePosition={isOperator ? 'right' : 'left'}>
|
|
88
112
|
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
89
113
|
<RichText message={message}/>
|
|
90
114
|
</ChatWrapper>
|
|
91
|
-
</TimeWrapper>)
|
|
115
|
+
</TimeWrapper>) : (<div className={`flex w-full flex-row items-end gap-[8px] `}>
|
|
116
|
+
<button type={'button'} onClick={() => { }} className={`cursor-pointer`}>
|
|
117
|
+
<ResendIcon width={18} height={18}/>
|
|
118
|
+
</button>
|
|
119
|
+
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
120
|
+
<RichText message={message}/>
|
|
121
|
+
</ChatWrapper>
|
|
122
|
+
</div>);
|
|
92
123
|
}
|
|
93
124
|
return (<TimeWrapper time={time}>
|
|
94
125
|
<ChatWrapper isOperator={isOperator}>
|
|
@@ -139,7 +170,7 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
|
|
|
139
170
|
</div>)}
|
|
140
171
|
</div>);
|
|
141
172
|
};
|
|
142
|
-
return (<div className={`mb-[20px] flex ${isOperator ? 'justify-start' : 'justify-end'}`}>
|
|
173
|
+
return (<div className={`mb-[20px] flex w-full ${isOperator ? 'justify-start' : 'justify-end'}`}>
|
|
143
174
|
{/* 시스템 or 오퍼레이터 */}
|
|
144
175
|
{isOperator ? (<div className="flex flex-col">
|
|
145
176
|
<div className="flex items-center gap-[10px]">
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Message
|
|
10
10
|
} from './_types/message';
|
|
11
11
|
import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
12
|
+
import ResendIcon from '../../asset/images/daeryuntalk/re_send.svg';
|
|
12
13
|
import { MessageObject } from './_types/message_object';
|
|
13
14
|
import { ObjectNumber, WorkFlowBackOrInit, WorkFlowButtonUiCode } from './_enums/work_flow_object_expose';
|
|
14
15
|
import { MessageSenderType } from './_enums/sender_type';
|
|
@@ -61,7 +62,29 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
|
|
|
61
62
|
};
|
|
62
63
|
|
|
63
64
|
const time = formatTime(message.createdAt);
|
|
64
|
-
|
|
65
|
+
// {
|
|
66
|
+
// "blocks": [
|
|
67
|
+
// {
|
|
68
|
+
// "type": "text",
|
|
69
|
+
// "value": "궁금한 점이나 도움이 필요하신 부분\n말씀해 주시면 도와드리겠습니다.\n6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다."
|
|
70
|
+
// }
|
|
71
|
+
// ],
|
|
72
|
+
// "created_at": "2025-07-17T00:31:33.201143265Z",
|
|
73
|
+
// "inquiry_number": "C9846633909467187913",
|
|
74
|
+
// "language": "ko",
|
|
75
|
+
// "message_number": "MSG91145971809777216",
|
|
76
|
+
// "message_status": "CREATED",
|
|
77
|
+
// "message_type": "MSP00200003",
|
|
78
|
+
// "plain_text": "궁금한 점이나 도움이 필요하신 부분\n말씀해 주시면 도와드리겠습니다.\n6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다.",
|
|
79
|
+
// "sender_type": "MSP00100002",
|
|
80
|
+
// "template_type": "MSP00300202",
|
|
81
|
+
// "timestamp": 1752712293201143,
|
|
82
|
+
// "updated_at": "2025-07-17T00:31:33.201143265Z",
|
|
83
|
+
// "user_key": "",
|
|
84
|
+
// "work_flow": {
|
|
85
|
+
// "option_exposure_yn": true,
|
|
86
|
+
// "work_flow_number": "W210295281847689P001"
|
|
87
|
+
// }
|
|
65
88
|
// 텍스트 블록 렌더링
|
|
66
89
|
const renderText = (message: Message, isObject: boolean) => {
|
|
67
90
|
/**
|
|
@@ -128,12 +151,21 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
|
|
|
128
151
|
);
|
|
129
152
|
}
|
|
130
153
|
if (isRichForm) {
|
|
131
|
-
return (
|
|
154
|
+
return message.messageStatus === 'CREATED' ? (
|
|
132
155
|
<TimeWrapper time={time} timePosition={isOperator ? 'right' : 'left'}>
|
|
133
156
|
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
134
157
|
<RichText message={message} />
|
|
135
158
|
</ChatWrapper>
|
|
136
159
|
</TimeWrapper>
|
|
160
|
+
) : (
|
|
161
|
+
<div className={`flex w-full flex-row items-end gap-[8px] `}>
|
|
162
|
+
<button type={'button'} onClick={() => {}} className={`cursor-pointer`}>
|
|
163
|
+
<ResendIcon width={18} height={18} />
|
|
164
|
+
</button>
|
|
165
|
+
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
166
|
+
<RichText message={message} />
|
|
167
|
+
</ChatWrapper>
|
|
168
|
+
</div>
|
|
137
169
|
);
|
|
138
170
|
}
|
|
139
171
|
|
|
@@ -227,7 +259,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
|
|
|
227
259
|
};
|
|
228
260
|
|
|
229
261
|
return (
|
|
230
|
-
<div className={`mb-[20px] flex ${isOperator ? 'justify-start' : 'justify-end'}`}>
|
|
262
|
+
<div className={`mb-[20px] flex w-full ${isOperator ? 'justify-start' : 'justify-end'}`}>
|
|
231
263
|
{/* 시스템 or 오퍼레이터 */}
|
|
232
264
|
{isOperator ? (
|
|
233
265
|
<div className="flex flex-col">
|
|
@@ -13,16 +13,16 @@ const ChatWidget = ({ isOpen, isMobile, onClose, hashValue, setHashValue, animat
|
|
|
13
13
|
`;
|
|
14
14
|
// 웹 모바일 ~480px
|
|
15
15
|
const webSmallWrapperCss = `
|
|
16
|
-
${isHash ?
|
|
17
|
-
${isHash ? '' : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
16
|
+
${isHash ? `duration-300 ease-in-out` : `duration-300 ease-in-out`}
|
|
17
|
+
${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'}
|
|
18
18
|
fixed w-screen max-w-[100vw] z-[999998] rounded-none flex flex-col
|
|
19
|
-
bottom-0 right-0 h-[100dvh]
|
|
19
|
+
bottom-0 right-0 h-[100dvh]
|
|
20
20
|
`;
|
|
21
21
|
// 해쉬 있을 경우는 여기서 중앙배치 css로
|
|
22
22
|
const webTbPCWrapperCss = `
|
|
23
|
-
${isHash ?
|
|
23
|
+
${isHash ? `` : 'xs:duration-300 ease-in-out'}
|
|
24
24
|
${isHash
|
|
25
|
-
?
|
|
25
|
+
? ``
|
|
26
26
|
: isOpen
|
|
27
27
|
? 'opacity-100 pointer-events-auto xs:translate-y-0 xs:duration-500'
|
|
28
28
|
: 'opacity-0 pointer-events-none xs:translate-y-4 xs:duration-500 '}
|
|
@@ -33,18 +33,18 @@ const ChatWidget: React.FC<ChatWidgetProps> = ({
|
|
|
33
33
|
|
|
34
34
|
// 웹 모바일 ~480px
|
|
35
35
|
const webSmallWrapperCss = `
|
|
36
|
-
${isHash ?
|
|
37
|
-
${isHash ? '' : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
36
|
+
${isHash ? `duration-300 ease-in-out` : `duration-300 ease-in-out`}
|
|
37
|
+
${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'}
|
|
38
38
|
fixed w-screen max-w-[100vw] z-[999998] rounded-none flex flex-col
|
|
39
|
-
bottom-0 right-0 h-[100dvh]
|
|
39
|
+
bottom-0 right-0 h-[100dvh]
|
|
40
40
|
`;
|
|
41
41
|
|
|
42
42
|
// 해쉬 있을 경우는 여기서 중앙배치 css로
|
|
43
43
|
const webTbPCWrapperCss = `
|
|
44
|
-
${isHash ?
|
|
44
|
+
${isHash ? `` : 'xs:duration-300 ease-in-out'}
|
|
45
45
|
${
|
|
46
46
|
isHash
|
|
47
|
-
?
|
|
47
|
+
? ``
|
|
48
48
|
: isOpen
|
|
49
49
|
? 'opacity-100 pointer-events-auto xs:translate-y-0 xs:duration-500'
|
|
50
50
|
: 'opacity-0 pointer-events-none xs:translate-y-4 xs:duration-500 '
|
|
@@ -81,6 +81,7 @@ type DaeryuntalkProviderProps = {
|
|
|
81
81
|
children: ReactNode;
|
|
82
82
|
propsTel: string;
|
|
83
83
|
isMobile: boolean;
|
|
84
|
+
onClose: () => void;
|
|
84
85
|
};
|
|
85
86
|
export declare const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps>;
|
|
86
87
|
export declare const useDaeryuntalk: () => DaeryuntalkContextType;
|
|
@@ -59,7 +59,7 @@ const DaeryuntalkContext = createContext({
|
|
|
59
59
|
retryInitData: () => { },
|
|
60
60
|
isTyping: false
|
|
61
61
|
});
|
|
62
|
-
export const DaeryuntalkProvider = ({ children, propsTel, isMobile }) => {
|
|
62
|
+
export const DaeryuntalkProvider = ({ children, propsTel, isMobile, onClose }) => {
|
|
63
63
|
const [inquiryStatus, setInquiryStatus] = useState('');
|
|
64
64
|
const [tel, setTel] = useState(propsTel);
|
|
65
65
|
// 인증 여부
|
|
@@ -94,7 +94,8 @@ export const DaeryuntalkProvider = ({ children, propsTel, isMobile }) => {
|
|
|
94
94
|
inquiryMainData,
|
|
95
95
|
isMobile,
|
|
96
96
|
setIsAuthenticated,
|
|
97
|
-
setIsTyping
|
|
97
|
+
setIsTyping,
|
|
98
|
+
onClose
|
|
98
99
|
});
|
|
99
100
|
// MSG15591497825895676
|
|
100
101
|
// 채팅 관련
|
|
@@ -135,9 +135,10 @@ type DaeryuntalkProviderProps = {
|
|
|
135
135
|
children: ReactNode;
|
|
136
136
|
propsTel: string;
|
|
137
137
|
isMobile: boolean;
|
|
138
|
+
onClose: () => void;
|
|
138
139
|
};
|
|
139
140
|
|
|
140
|
-
export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ children, propsTel, isMobile }) => {
|
|
141
|
+
export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ children, propsTel, isMobile, onClose }) => {
|
|
141
142
|
const [inquiryStatus, setInquiryStatus] = useState<string>('');
|
|
142
143
|
const [tel, setTel] = useState(propsTel);
|
|
143
144
|
// 인증 여부
|
|
@@ -188,7 +189,8 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ childr
|
|
|
188
189
|
inquiryMainData,
|
|
189
190
|
isMobile,
|
|
190
191
|
setIsAuthenticated,
|
|
191
|
-
setIsTyping
|
|
192
|
+
setIsTyping,
|
|
193
|
+
onClose
|
|
192
194
|
});
|
|
193
195
|
|
|
194
196
|
// MSG15591497825895676
|
|
@@ -129,7 +129,7 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
|
|
|
129
129
|
{isScroll && !isBottom && <ShadowBox />}
|
|
130
130
|
</div>
|
|
131
131
|
|
|
132
|
-
<Button3 onClick={handleStartChat} isDisabled={isLoading} className="mt-[40px]">
|
|
132
|
+
<Button3 onClick={handleStartChat} isDisabled={isLoading || !(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_number)} className="mt-[40px]">
|
|
133
133
|
<div className="flex items-center justify-center gap-[4px]">
|
|
134
134
|
{!(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_number) ? (<div>{'로딩 중...'}</div>) : (<div>{isLoading ? '로딩 중...' : '문의하기'}</div>)}
|
|
135
135
|
{!isLoading && <SendIcon width={24} height={24}/>}
|
|
@@ -185,7 +185,11 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
|
|
|
185
185
|
{isScroll && !isBottom && <ShadowBox />}
|
|
186
186
|
</div>
|
|
187
187
|
|
|
188
|
-
<Button3
|
|
188
|
+
<Button3
|
|
189
|
+
onClick={handleStartChat}
|
|
190
|
+
isDisabled={isLoading || !inquiryMainData?.channel_number}
|
|
191
|
+
className="mt-[40px]"
|
|
192
|
+
>
|
|
189
193
|
<div className="flex items-center justify-center gap-[4px]">
|
|
190
194
|
{!inquiryMainData?.channel_number ? (
|
|
191
195
|
<div>{'로딩 중...'}</div>
|
|
@@ -14,6 +14,7 @@ interface TiptapProps {
|
|
|
14
14
|
onEnterKeyPress?: () => void;
|
|
15
15
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
16
16
|
contentClassName?: string;
|
|
17
|
+
isMobile?: boolean;
|
|
17
18
|
}
|
|
18
19
|
declare const Tiptap: React.ForwardRefExoticComponent<TiptapProps & React.RefAttributes<TiptapEditorRef>>;
|
|
19
20
|
export default Tiptap;
|
|
@@ -5,7 +5,7 @@ import HardBreak from '@tiptap/extension-hard-break'; // 추가
|
|
|
5
5
|
import Document from '@tiptap/extension-document';
|
|
6
6
|
import Paragraph from '@tiptap/extension-paragraph';
|
|
7
7
|
import Text from '@tiptap/extension-text';
|
|
8
|
-
const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력해 주세요.', onEnterKeyPress, onKeyDown, contentClassName = '' }, ref) => {
|
|
8
|
+
const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력해 주세요.', onEnterKeyPress, onKeyDown, contentClassName = '', isMobile = false }, ref) => {
|
|
9
9
|
const containerRef = useRef(null);
|
|
10
10
|
const [isScroll, setIsScroll] = useState(false);
|
|
11
11
|
const [isBottom, setIsBottom] = useState(false);
|
|
@@ -76,7 +76,7 @@ const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력해 주
|
|
|
76
76
|
if (editor) {
|
|
77
77
|
editor === null || editor === void 0 ? void 0 : editor.commands.clearContent(true);
|
|
78
78
|
// 내용을 지운 후 포커스 유지
|
|
79
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.focus();
|
|
79
|
+
!isMobile && (editor === null || editor === void 0 ? void 0 : editor.commands.focus());
|
|
80
80
|
}
|
|
81
81
|
}, [editor]);
|
|
82
82
|
useImperativeHandle(ref, () => ({
|
|
@@ -25,10 +25,21 @@ interface TiptapProps {
|
|
|
25
25
|
onEnterKeyPress?: () => void;
|
|
26
26
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
27
27
|
contentClassName?: string;
|
|
28
|
+
isMobile?: boolean;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
const Tiptap = forwardRef<TiptapEditorRef, TiptapProps>(
|
|
31
|
-
(
|
|
32
|
+
(
|
|
33
|
+
{
|
|
34
|
+
onChange,
|
|
35
|
+
placeholder = '메시지를 입력해 주세요.',
|
|
36
|
+
onEnterKeyPress,
|
|
37
|
+
onKeyDown,
|
|
38
|
+
contentClassName = '',
|
|
39
|
+
isMobile = false
|
|
40
|
+
},
|
|
41
|
+
ref
|
|
42
|
+
) => {
|
|
32
43
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
33
44
|
|
|
34
45
|
const [isScroll, setIsScroll] = useState(false);
|
|
@@ -104,7 +115,7 @@ const Tiptap = forwardRef<TiptapEditorRef, TiptapProps>(
|
|
|
104
115
|
if (editor) {
|
|
105
116
|
editor?.commands.clearContent(true);
|
|
106
117
|
// 내용을 지운 후 포커스 유지
|
|
107
|
-
editor?.commands.focus();
|
|
118
|
+
!isMobile && editor?.commands.focus();
|
|
108
119
|
}
|
|
109
120
|
}, [editor]);
|
|
110
121
|
|
|
@@ -381,7 +381,7 @@ export function getChatInquiryMessageList(chatInquiryNumber, standardDateTime, s
|
|
|
381
381
|
const body = {
|
|
382
382
|
d: Object.assign(Object.assign({ chat_inquiry_number: chatInquiryNumber }, (standardDateTime && { standard_date_time: standardDateTime })), {
|
|
383
383
|
// standard_date_time: standard_date_time ?? new Date().toISOString(),
|
|
384
|
-
size: size !== null && size !== void 0 ? size :
|
|
384
|
+
size: size !== null && size !== void 0 ? size : 400 })
|
|
385
385
|
};
|
|
386
386
|
console.log('[채팅 메세지 리스트] 문의 번호:', chatInquiryNumber, version ? `버전: ${version}` : `기본 버전: ${DEFAULT_API_VERSION}`);
|
|
387
387
|
try {
|
|
@@ -476,7 +476,7 @@ export async function getChatInquiryMessageList(
|
|
|
476
476
|
chat_inquiry_number: chatInquiryNumber,
|
|
477
477
|
...(standardDateTime && { standard_date_time: standardDateTime }),
|
|
478
478
|
// standard_date_time: standard_date_time ?? new Date().toISOString(),
|
|
479
|
-
size: size ??
|
|
479
|
+
size: size ?? 400
|
|
480
480
|
}
|
|
481
481
|
};
|
|
482
482
|
|
|
@@ -17,8 +17,9 @@ interface props {
|
|
|
17
17
|
isMobile: boolean;
|
|
18
18
|
setIsAuthenticated: Dispatch<SetStateAction<boolean>>;
|
|
19
19
|
setIsTyping: Dispatch<SetStateAction<boolean>>;
|
|
20
|
+
onClose: () => void;
|
|
20
21
|
}
|
|
21
|
-
export declare const useSocketEventHandler: ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated, setIsTyping }: props) => {
|
|
22
|
+
export declare const useSocketEventHandler: ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated, setIsTyping, onClose }: props) => {
|
|
22
23
|
initializeDaeryuntalk: (hashValue: string | null, isOpen: boolean, version?: string) => Promise<import("../../_api/daeryuntalk/type/response").IDaeryunTalkResponseWrapper<IChatInquiryMainDataResponse> | null | undefined>;
|
|
23
24
|
sendHeartbeat: () => void;
|
|
24
25
|
sendInquiryJoined: (chatInquiryNumber: string) => void;
|
|
@@ -14,7 +14,7 @@ import { MessageSocketType } from '../../_enums/socket_type';
|
|
|
14
14
|
import { InquiryStatusEnum } from '../../_enums/ask-status';
|
|
15
15
|
import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
|
|
16
16
|
import { getErrorMessageMap } from '../../_enums/error';
|
|
17
|
-
export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated, setIsTyping }) => {
|
|
17
|
+
export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated, setIsTyping, onClose }) => {
|
|
18
18
|
const typingTimeoutRef = useRef(null);
|
|
19
19
|
const toast = useDaeryunTalkToast();
|
|
20
20
|
const handleTypingStarted = () => {
|
|
@@ -246,6 +246,7 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
246
246
|
}
|
|
247
247
|
else {
|
|
248
248
|
toast.error('인증에 실패했습니다.');
|
|
249
|
+
onClose();
|
|
249
250
|
window.location.hash = '/';
|
|
250
251
|
}
|
|
251
252
|
}
|
|
@@ -33,6 +33,7 @@ interface props {
|
|
|
33
33
|
isMobile: boolean;
|
|
34
34
|
setIsAuthenticated: Dispatch<SetStateAction<boolean>>;
|
|
35
35
|
setIsTyping: Dispatch<SetStateAction<boolean>>;
|
|
36
|
+
onClose: () => void;
|
|
36
37
|
}
|
|
37
38
|
export const useSocketEventHandler = ({
|
|
38
39
|
setIsConnected,
|
|
@@ -48,7 +49,8 @@ export const useSocketEventHandler = ({
|
|
|
48
49
|
inquiryMainData,
|
|
49
50
|
isMobile,
|
|
50
51
|
setIsAuthenticated,
|
|
51
|
-
setIsTyping
|
|
52
|
+
setIsTyping,
|
|
53
|
+
onClose
|
|
52
54
|
}: props) => {
|
|
53
55
|
const typingTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
54
56
|
const toast = useDaeryunTalkToast();
|
|
@@ -336,6 +338,7 @@ export const useSocketEventHandler = ({
|
|
|
336
338
|
console.log('해쉬 인증 완료');
|
|
337
339
|
} else {
|
|
338
340
|
toast.error('인증에 실패했습니다.');
|
|
341
|
+
onClose();
|
|
339
342
|
window.location.hash = '/';
|
|
340
343
|
}
|
|
341
344
|
}
|
|
@@ -77,7 +77,7 @@ const Daeryuntalk = ({ tel = '1800-7905' }) => {
|
|
|
77
77
|
return (<div className={``}>
|
|
78
78
|
<DaeryuntalkToastProvider>
|
|
79
79
|
<ViewportHandler />
|
|
80
|
-
<DaeryuntalkProvider propsTel={tel} isMobile={isMobile}>
|
|
80
|
+
<DaeryuntalkProvider propsTel={tel} isMobile={isMobile} onClose={closeModal}>
|
|
81
81
|
{isMobile ? (isOpen ? null : (<ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat}/>)) : (<ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat}/>)}
|
|
82
82
|
<ChatWidget isOpen={hashValue ? true : isOpen} isMobile={isMobile} onClose={closeModal} hashValue={hashValue} setHashValue={setHashValue} animationState={animationState}/>
|
|
83
83
|
</DaeryuntalkProvider>
|
|
@@ -95,7 +95,7 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905' }) => {
|
|
|
95
95
|
<div className={``}>
|
|
96
96
|
<DaeryuntalkToastProvider>
|
|
97
97
|
<ViewportHandler />
|
|
98
|
-
<DaeryuntalkProvider propsTel={tel} isMobile={isMobile}>
|
|
98
|
+
<DaeryuntalkProvider propsTel={tel} isMobile={isMobile} onClose={closeModal}>
|
|
99
99
|
{isMobile ? (
|
|
100
100
|
isOpen ? null : (
|
|
101
101
|
<ChatButton
|