@daeryun/dr_components 0.8.80 → 0.8.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/components/Daeryuntalk/ChatConversation.jsx +23 -15
  2. package/dist/components/Daeryuntalk/ChatConversation.tsx +47 -36
  3. package/dist/components/Daeryuntalk/ChatHomeView.jsx +15 -5
  4. package/dist/components/Daeryuntalk/ChatHomeView.tsx +24 -11
  5. package/dist/components/Daeryuntalk/ChatInput.jsx +15 -4
  6. package/dist/components/Daeryuntalk/ChatInput.tsx +17 -5
  7. package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +1 -1
  8. package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +1 -1
  9. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.d.ts +3 -1
  10. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.jsx +164 -3
  11. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.tsx +197 -4
  12. package/dist/components/Daeryuntalk/ChatMessage.d.ts +1 -0
  13. package/dist/components/Daeryuntalk/ChatMessage.jsx +31 -29
  14. package/dist/components/Daeryuntalk/ChatMessage.tsx +54 -50
  15. package/dist/components/Daeryuntalk/ChatObject/ObjectButton.jsx +4 -2
  16. package/dist/components/Daeryuntalk/ChatObject/ObjectButton.tsx +6 -4
  17. package/dist/components/Daeryuntalk/ChatWidget.d.ts +1 -0
  18. package/dist/components/Daeryuntalk/ChatWidget.jsx +1 -1
  19. package/dist/components/Daeryuntalk/ChatWidget.tsx +10 -2
  20. package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +1 -0
  21. package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +5 -3
  22. package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +7 -3
  23. package/dist/components/Daeryuntalk/HomeView.jsx +4 -9
  24. package/dist/components/Daeryuntalk/HomeView.tsx +9 -9
  25. package/dist/components/Daeryuntalk/NavigationFooter.jsx +1 -1
  26. package/dist/components/Daeryuntalk/NavigationFooter.tsx +1 -1
  27. package/dist/components/Daeryuntalk/Tiptap/Tiptap.d.ts +2 -1
  28. package/dist/components/Daeryuntalk/Tiptap/Tiptap.jsx +38 -5
  29. package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +48 -9
  30. package/dist/components/Daeryuntalk/Toast/DaeryuntalkToastProvider.d.ts +2 -1
  31. package/dist/components/Daeryuntalk/Toast/DaeryuntalkToastProvider.jsx +18 -7
  32. package/dist/components/Daeryuntalk/Toast/DaeryuntalkToastProvider.tsx +24 -8
  33. package/dist/components/Daeryuntalk/Toast/ToastRender.jsx +9 -3
  34. package/dist/components/Daeryuntalk/Toast/ToastRender.tsx +10 -6
  35. package/dist/components/Daeryuntalk/Viewer/ImageViewer.jsx +6 -8
  36. package/dist/components/Daeryuntalk/Viewer/ImageViewer.tsx +7 -10
  37. package/dist/components/Daeryuntalk/Viewer/MobileViewer.d.ts +2 -0
  38. package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +52 -19
  39. package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +89 -43
  40. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.d.ts +2 -0
  41. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +35 -5
  42. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +57 -21
  43. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.d.ts +1 -0
  44. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +14 -12
  45. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +9 -8
  46. package/dist/components/Daeryuntalk/_enums/ask-status.d.ts +2 -2
  47. package/dist/components/Daeryuntalk/_enums/ask-status.js +9 -9
  48. package/dist/components/Daeryuntalk/_enums/ask-status.ts +5 -5
  49. package/dist/components/Daeryuntalk/_enums/error.js +119 -111
  50. package/dist/components/Daeryuntalk/_enums/error.ts +135 -127
  51. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +1 -0
  52. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +10 -4
  53. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +12 -4
  54. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.js +1 -0
  55. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.ts +1 -0
  56. package/dist/components/Daeryuntalk/_lib/utils.d.ts +2 -0
  57. package/dist/components/Daeryuntalk/_lib/utils.js +12 -0
  58. package/dist/components/Daeryuntalk/_lib/utils.ts +15 -0
  59. package/dist/components/Daeryuntalk/index.jsx +34 -5
  60. package/dist/components/Daeryuntalk/index.tsx +37 -6
  61. package/dist/styles/globals.css +30 -24
  62. package/dist/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +1 -1
@@ -1,19 +1,180 @@
1
1
  import React from 'react';
2
2
  import Image from 'next/image';
3
3
  import { InquiryMessageTemplateType } from '../_enums/template';
4
- const WorkFlowImg = ({ message }) => {
4
+ import DOMPurify from 'dompurify';
5
+ import ChatWrapper from './ChatWrapper';
6
+ import { decodeDoubleEscapedHtml } from '../_lib/utils';
7
+ import { useWindowSize } from '../_hooks/useWindowSize';
8
+ const WorkFlowImg = ({ message, isOperator, isMobile }) => {
9
+ var _a, _b, _c;
5
10
  const workFlowItem = message.workFlow;
6
11
  const messageType = (message === null || message === void 0 ? void 0 : message.templateType) || '';
12
+ const windowSize = useWindowSize();
13
+ // 워크플로우 메시지 템플릿 1 : 텍스트
7
14
  if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1) {
15
+ return <ChatWrapper isOperator={isOperator}>{(_a = message === null || message === void 0 ? void 0 : message.blocks) === null || _a === void 0 ? void 0 : _a.map(item => item === null || item === void 0 ? void 0 : item.value)}</ChatWrapper>;
8
16
  }
17
+ // 워크플로우 메시지 템플릿 2 : 이미지 + 텍스트 (이미지)
9
18
  if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2) {
19
+ return (<>
20
+ {/*{message?.blocks && (*/}
21
+ {/* <ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>*/}
22
+ {/*)}*/}
23
+ {(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) && (<div className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
24
+ <Image src={(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) || ''} alt={''} width={500} height={300} className={`h-full w-full rounded-[10px] object-cover`} unoptimized={true}/>
25
+ {(message === null || message === void 0 ? void 0 : message.blocks) &&
26
+ ((_b = message === null || message === void 0 ? void 0 : message.blocks) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
27
+ const decoded = decodeDoubleEscapedHtml(item.value);
28
+ const shouldRemoveBr = windowSize.width <= 480 || isMobile;
29
+ const cleaned = shouldRemoveBr ? decoded.replace(/<br\s*\/?>/gi, '') : decoded;
30
+ // // 여기서 ,
31
+ // windowSize.width<=480 || isMobile 일 경우 <br/>은 제거시켜버리고 싶다
32
+ const sanitizedHtml = DOMPurify.sanitize(cleaned);
33
+ return <div key={index} dangerouslySetInnerHTML={{ __html: sanitizedHtml }}/>;
34
+ }))}
35
+ </div>)}
36
+ </>);
10
37
  }
38
+ // 워크플로우 메시지 템플릿 3 : 아이콘 + 텍스트
11
39
  if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3) {
40
+ return (<>
41
+ {/*{message?.blocks && (*/}
42
+ {/* <ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>*/}
43
+ {/*)}*/}
44
+ {(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) && (<div className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
45
+ <Image src={(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) || ''} alt={''} width={500} height={300} className={`h-full w-full rounded-[10px] object-cover`} unoptimized={true}/>
46
+ {(message === null || message === void 0 ? void 0 : message.blocks) &&
47
+ ((_c = message === null || message === void 0 ? void 0 : message.blocks) === null || _c === void 0 ? void 0 : _c.map((item, index) => {
48
+ const decoded = decodeDoubleEscapedHtml(item.value);
49
+ const sanitizedHtml = DOMPurify.sanitize(decoded);
50
+ return <div key={index} dangerouslySetInnerHTML={{ __html: sanitizedHtml }}/>;
51
+ }))}
52
+ </div>)}
53
+ </>);
12
54
  }
55
+ // 워크플로우 메시지 템플릿 4 : 텍스트 + form
13
56
  if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4) {
14
57
  }
15
- return (<div className={`h-auto overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
16
- <Image src={(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) || ''} alt={''} width={1000} height={300} className={`h-full w-full rounded-[10px] object-cover`} unoptimized={true}/>
58
+ // const case1 = `
59
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; color: #000;">
60
+ // <div style="display: flex; height: 30px; align-items: flex-start; justify-content: center; border-bottom: 1px solid #EDEDED; text-align: center; font-size: 16px; font-weight: 700; line-height: 140%; letter-spacing: -4%; color: #000;">
61
+ // 대륜의&nbsp;<span style="color: #AA1D36;">차별화</span>된
62
+ // <span style="color: #AA1D36;">조력 시스템</span>
63
+ // </div>
64
+ //
65
+ // <div style="display: flex; flex-direction: column; font-size: 16px; font-weight: 400; line-height: 100%; letter-spacing: -4%;">
66
+ // <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
67
+ // <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
68
+ // <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
69
+ // <path
70
+ // d="M9.5 1L4.5 7.5L1.5 4"
71
+ // stroke="#AA1D36"
72
+ // stroke-width="2"
73
+ // stroke-linecap="round"
74
+ // stroke-linejoin="round"
75
+ // />
76
+ // </svg>
77
+ // </div>
78
+ // 전문 변호사 직접 상담
79
+ // </div>
80
+ //
81
+ // <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
82
+ // <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
83
+ // <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
84
+ // <path
85
+ // d="M9.5 1L4.5 7.5L1.5 4"
86
+ // stroke="#AA1D36"
87
+ // stroke-width="2"
88
+ // stroke-linecap="round"
89
+ // stroke-linejoin="round"
90
+ // />
91
+ // </svg>
92
+ // </div>
93
+ // 분야별 해결사례 데이터베이스
94
+ // </div>
95
+ //
96
+ // <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
97
+ // <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
98
+ // <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
99
+ // <path
100
+ // d="M9.5 1L4.5 7.5L1.5 4"
101
+ // stroke="#AA1D36"
102
+ // stroke-width="2"
103
+ // stroke-linecap="round"
104
+ // stroke-linejoin="round"
105
+ // />
106
+ // </svg>
107
+ // </div>
108
+ // 전국 사무소 운영
109
+ // </div>
110
+ // </div>
111
+ // </div>
112
+ // `;
113
+ //
114
+ // const case2 = `
115
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
116
+ // <div style="font-weight: 400;">
117
+ // <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">법무법인 대륜</span>은 다양한 분야의 법률<br/>
118
+ // 문제를 다루고 있습니다. 궁금하신 분<br/>야를 선택해 주세요.
119
+ // </div>
120
+ // </div>
121
+ // `;
122
+ //
123
+ // const case3 = `
124
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
125
+ // <div style="font-weight: 400;">
126
+ // 아래 버튼을 클릭하시면&nbsp;<span style="font-weight: 700; color: #AA1D36; line-height: 100%;">채팅 문의 외<br/>다른 방법</span>으로 빠르게 문의하실 수 있<br/>습니다.
127
+ // </div>
128
+ // </div>
129
+ // `;
130
+ //
131
+ // const case4 = `
132
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
133
+ // <div style="font-weight: 400;">
134
+ // 해당 사건에&nbsp;<span style="font-weight: 700; color: #AA1D36; line-height: 100%;">특화된 전문변호사</span>가<br/>토 후 신속한 대응 전략을 제시합니<br/>다.
135
+ // </div>
136
+ // </div>
137
+ // `;
138
+ //
139
+ // //
140
+ // const case5 = `
141
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; font-weight: 400; line-height: 140%; letter-spacing: -4%; color: #000000;">
142
+ // <div>
143
+ // 전화 상담을 이용하시면 가장 빠르게<br />관련 상담을 진행하실 수 있습니다.
144
+ // </div>
145
+ // <div>
146
+ // <span style="font-weight: 700; color: #AA1D36; ">T.</span>&nbsp;<span style="font-weight: 700; ">1800-7905</span>
147
+ // </div>
148
+ // </div>
149
+ // `;
150
+ // const case6 = `
151
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
152
+ // <div style="font-weight: 400;">
153
+ // <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">AI대륜</span>과 함께하면 법률상담이 더<br />쉬워집니다!
154
+ // </div>
155
+ // <div>
156
+ // <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">24시간 신속</span>하고
157
+ // <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">정확한 법률 정보</span>를<br />제공받고, 변호사 상담까지 빠르게 진<br />행하세요.
158
+ // </div>
159
+ // </div>
160
+ // `;
161
+ //
162
+ // const case7 = `
163
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; font-weight: 400; line-height: 140%; letter-spacing: -4%; color: #000000;">
164
+ // <div>
165
+ // 많은 고객님들께서 실제로 궁금해하<br />
166
+ // 셨던 질문을 정리해 두었습니다.
167
+ // </div>
168
+ // <div>
169
+ // 문의 전 확인하시면 더욱 빠르고<br />
170
+ // 정확한 안내가 가능합니다.
171
+ // </div>
172
+ // </div>
173
+ // `;
174
+ // const sanitizedHtml = DOMPurify.sanitize(case1);
175
+ return (<div className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
176
+ <Image src={(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) || ''} alt={''} width={500} height={300} className={`h-full w-full rounded-[10px] object-cover`} unoptimized={true}/>
177
+ {/*<div dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />*/}
17
178
  </div>);
18
179
  };
19
180
  export default WorkFlowImg;
@@ -2,35 +2,228 @@ import React from 'react';
2
2
  import Image from 'next/image';
3
3
  import { Message } from '../_types/message';
4
4
  import { InquiryMessageTemplateType } from '../_enums/template';
5
+ import DOMPurify from 'dompurify';
6
+ import RichText from './RichText';
7
+ import ChatWrapper from './ChatWrapper';
8
+ import { decodeDoubleEscapedHtml } from '../_lib/utils';
9
+ import { useWindowSize } from '../_hooks/useWindowSize';
10
+
5
11
  interface props {
6
12
  message: Message;
13
+ isOperator: boolean;
14
+ isMobile: boolean;
7
15
  }
8
- const WorkFlowImg = ({ message }: props) => {
16
+ const WorkFlowImg = ({ message, isOperator, isMobile }: props) => {
9
17
  const workFlowItem = message.workFlow;
10
18
  const messageType = message?.templateType || '';
11
-
19
+ const windowSize = useWindowSize();
20
+ // 워크플로우 메시지 템플릿 1 : 텍스트
12
21
  if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1) {
22
+ return <ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>;
13
23
  }
14
24
 
25
+ // 워크플로우 메시지 템플릿 2 : 이미지 + 텍스트 (이미지)
15
26
  if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2) {
27
+ return (
28
+ <>
29
+ {/*{message?.blocks && (*/}
30
+ {/* <ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>*/}
31
+ {/*)}*/}
32
+ {workFlowItem?.imageUrl && (
33
+ <div
34
+ className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}
35
+ >
36
+ <Image
37
+ src={workFlowItem?.imageUrl || ''}
38
+ alt={''}
39
+ width={500}
40
+ height={300}
41
+ className={`h-full w-full rounded-[10px] object-cover`}
42
+ unoptimized={true}
43
+ />
44
+ {message?.blocks &&
45
+ message?.blocks?.map((item, index) => {
46
+ const decoded = decodeDoubleEscapedHtml(item.value);
47
+ const shouldRemoveBr = windowSize.width <= 480 || isMobile;
48
+ const cleaned = shouldRemoveBr ? decoded.replace(/<br\s*\/?>/gi, '') : decoded;
49
+
50
+ // // 여기서 ,
51
+ // windowSize.width<=480 || isMobile 일 경우 <br/>은 제거시켜버리고 싶다
52
+ const sanitizedHtml = DOMPurify.sanitize(cleaned);
53
+
54
+ return <div key={index} dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />;
55
+ })}
56
+ </div>
57
+ )}
58
+ </>
59
+ );
16
60
  }
17
61
 
62
+ // 워크플로우 메시지 템플릿 3 : 아이콘 + 텍스트
18
63
  if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3) {
64
+ return (
65
+ <>
66
+ {/*{message?.blocks && (*/}
67
+ {/* <ChatWrapper isOperator={isOperator}>{message?.blocks?.map(item => item?.value)}</ChatWrapper>*/}
68
+ {/*)}*/}
69
+ {workFlowItem?.imageUrl && (
70
+ <div
71
+ className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}
72
+ >
73
+ <Image
74
+ src={workFlowItem?.imageUrl || ''}
75
+ alt={''}
76
+ width={500}
77
+ height={300}
78
+ className={`h-full w-full rounded-[10px] object-cover`}
79
+ unoptimized={true}
80
+ />
81
+ {message?.blocks &&
82
+ message?.blocks?.map((item, index) => {
83
+ const decoded = decodeDoubleEscapedHtml(item.value);
84
+ const sanitizedHtml = DOMPurify.sanitize(decoded);
85
+
86
+ return <div key={index} dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />;
87
+ })}
88
+ </div>
89
+ )}
90
+ </>
91
+ );
19
92
  }
20
93
 
94
+ // 워크플로우 메시지 템플릿 4 : 텍스트 + form
21
95
  if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4) {
22
96
  }
23
97
 
98
+ // const case1 = `
99
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; color: #000;">
100
+ // <div style="display: flex; height: 30px; align-items: flex-start; justify-content: center; border-bottom: 1px solid #EDEDED; text-align: center; font-size: 16px; font-weight: 700; line-height: 140%; letter-spacing: -4%; color: #000;">
101
+ // 대륜의&nbsp;<span style="color: #AA1D36;">차별화</span>된
102
+ // <span style="color: #AA1D36;">조력 시스템</span>
103
+ // </div>
104
+ //
105
+ // <div style="display: flex; flex-direction: column; font-size: 16px; font-weight: 400; line-height: 100%; letter-spacing: -4%;">
106
+ // <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
107
+ // <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
108
+ // <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
109
+ // <path
110
+ // d="M9.5 1L4.5 7.5L1.5 4"
111
+ // stroke="#AA1D36"
112
+ // stroke-width="2"
113
+ // stroke-linecap="round"
114
+ // stroke-linejoin="round"
115
+ // />
116
+ // </svg>
117
+ // </div>
118
+ // 전문 변호사 직접 상담
119
+ // </div>
120
+ //
121
+ // <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
122
+ // <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
123
+ // <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
124
+ // <path
125
+ // d="M9.5 1L4.5 7.5L1.5 4"
126
+ // stroke="#AA1D36"
127
+ // stroke-width="2"
128
+ // stroke-linecap="round"
129
+ // stroke-linejoin="round"
130
+ // />
131
+ // </svg>
132
+ // </div>
133
+ // 분야별 해결사례 데이터베이스
134
+ // </div>
135
+ //
136
+ // <div style="display: flex; flex-direction: row; align-items: center; height: 24px;">
137
+ // <div style="display: flex; height: 24px; width: 24px; align-items: center; justify-content: center;">
138
+ // <svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
139
+ // <path
140
+ // d="M9.5 1L4.5 7.5L1.5 4"
141
+ // stroke="#AA1D36"
142
+ // stroke-width="2"
143
+ // stroke-linecap="round"
144
+ // stroke-linejoin="round"
145
+ // />
146
+ // </svg>
147
+ // </div>
148
+ // 전국 사무소 운영
149
+ // </div>
150
+ // </div>
151
+ // </div>
152
+ // `;
153
+ //
154
+ // const case2 = `
155
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
156
+ // <div style="font-weight: 400;">
157
+ // <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">법무법인 대륜</span>은 다양한 분야의 법률<br/>
158
+ // 문제를 다루고 있습니다. 궁금하신 분<br/>야를 선택해 주세요.
159
+ // </div>
160
+ // </div>
161
+ // `;
162
+ //
163
+ // const case3 = `
164
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
165
+ // <div style="font-weight: 400;">
166
+ // 아래 버튼을 클릭하시면&nbsp;<span style="font-weight: 700; color: #AA1D36; line-height: 100%;">채팅 문의 외<br/>다른 방법</span>으로 빠르게 문의하실 수 있<br/>습니다.
167
+ // </div>
168
+ // </div>
169
+ // `;
170
+ //
171
+ // const case4 = `
172
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
173
+ // <div style="font-weight: 400;">
174
+ // 해당 사건에&nbsp;<span style="font-weight: 700; color: #AA1D36; line-height: 100%;">특화된 전문변호사</span>가<br/>토 후 신속한 대응 전략을 제시합니<br/>다.
175
+ // </div>
176
+ // </div>
177
+ // `;
178
+ //
179
+ // //
180
+ // const case5 = `
181
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; font-weight: 400; line-height: 140%; letter-spacing: -4%; color: #000000;">
182
+ // <div>
183
+ // 전화 상담을 이용하시면 가장 빠르게<br />관련 상담을 진행하실 수 있습니다.
184
+ // </div>
185
+ // <div>
186
+ // <span style="font-weight: 700; color: #AA1D36; ">T.</span>&nbsp;<span style="font-weight: 700; ">1800-7905</span>
187
+ // </div>
188
+ // </div>
189
+ // `;
190
+ // const case6 = `
191
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; line-height: 140%; letter-spacing: -4%; color: #000000;">
192
+ // <div style="font-weight: 400;">
193
+ // <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">AI대륜</span>과 함께하면 법률상담이 더<br />쉬워집니다!
194
+ // </div>
195
+ // <div>
196
+ // <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">24시간 신속</span>하고
197
+ // <span style="font-weight: 700; color: #AA1D36; line-height: 100%;">정확한 법률 정보</span>를<br />제공받고, 변호사 상담까지 빠르게 진<br />행하세요.
198
+ // </div>
199
+ // </div>
200
+ // `;
201
+ //
202
+ // const case7 = `
203
+ // <div style="display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; font-size: 16px; font-weight: 400; line-height: 140%; letter-spacing: -4%; color: #000000;">
204
+ // <div>
205
+ // 많은 고객님들께서 실제로 궁금해하<br />
206
+ // 셨던 질문을 정리해 두었습니다.
207
+ // </div>
208
+ // <div>
209
+ // 문의 전 확인하시면 더욱 빠르고<br />
210
+ // 정확한 안내가 가능합니다.
211
+ // </div>
212
+ // </div>
213
+ // `;
214
+ // const sanitizedHtml = DOMPurify.sanitize(case1);
215
+
24
216
  return (
25
- <div className={`h-auto overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
217
+ <div className={`flex h-auto flex-col overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
26
218
  <Image
27
219
  src={workFlowItem?.imageUrl || ''}
28
220
  alt={''}
29
- width={1000}
221
+ width={500}
30
222
  height={300}
31
223
  className={`h-full w-full rounded-[10px] object-cover`}
32
224
  unoptimized={true}
33
225
  />
226
+ {/*<div dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />*/}
34
227
  </div>
35
228
  );
36
229
  };
@@ -14,6 +14,7 @@ type ChatMessageProps = {
14
14
  isHovered: boolean;
15
15
  scrollEnd: () => void;
16
16
  inquiryStatus: string;
17
+ isMobile: boolean;
17
18
  };
18
19
  declare const ChatMessage: React.FC<ChatMessageProps>;
19
20
  export default ChatMessage;
@@ -22,8 +22,8 @@ import RichText from './ChatItem/RichText';
22
22
  import ChatFile from './ChatItem/ChatFile';
23
23
  import FieldWorkObject from './ChatObject/FieldWorkObject';
24
24
  import TimeWrapper from './ChatItem/TimeWrapper';
25
- import { InquiryStatus } from './_enums/ask-status';
26
- const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, workFlowStack, isHovered, scrollEnd, inquiryStatus }) => {
25
+ import { InquiryStatusEnum } from './_enums/ask-status';
26
+ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, workFlowStack, isHovered, scrollEnd, inquiryStatus, isMobile }) => {
27
27
  // 고객 , 오퍼레이터 분리
28
28
  const isOperator = message.senderType !== MessageSenderType.CUSTOMER;
29
29
  const formatTime = (date) => {
@@ -53,6 +53,7 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
53
53
  const isAuthForm = hasForm(message);
54
54
  const isRichForm = hasRichForm(message);
55
55
  const isFile = hasFileArray(message);
56
+ console.log('inquiryStatus', inquiryStatus);
56
57
  // 파일이 있는경우
57
58
  if (isFile) {
58
59
  return (<div className={`flex flex-col gap-[10px]`}>
@@ -80,7 +81,7 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
80
81
  // 워크플로우 이미지 -> ( 이미지 + 텍스트 ) 로 잡힐 예정
81
82
  if (isWorkFlow) {
82
83
  return (<TimeWrapper time={time}>
83
- <WorkFlowImg message={message}/>
84
+ <WorkFlowImg message={message} isOperator={isOperator} isMobile={isMobile}/>
84
85
  </TimeWrapper>);
85
86
  }
86
87
  if (isRichForm) {
@@ -92,7 +93,7 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
92
93
  }
93
94
  return (<TimeWrapper time={time}>
94
95
  <ChatWrapper isOperator={isOperator}>
95
- <p className="dr_talk_body_medium2 whitespace-pre-line">{message.plainText}</p>
96
+ <p className="dr_talk_body_medium2 whitespace-pre-line">{message === null || message === void 0 ? void 0 : message.plainText}</p>
96
97
  </ChatWrapper>
97
98
  </TimeWrapper>);
98
99
  };
@@ -108,33 +109,34 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
108
109
  `}>
109
110
  {renderText(message, isObject)}
110
111
  {/* 오브젝트 박스 */}
111
- {inquiryStatus === InquiryStatus.OPEN && object && object.exposeObjectListYn && (<div className={`mt-[10px] flex w-[calc(100%-35px)] flex-col gap-[10px] `}>
112
- <div className={`
112
+ {inquiryStatus === InquiryStatusEnum.OPEN ||
113
+ (inquiryStatus === InquiryStatusEnum.PERSONAL_INFO && object && object.exposeObjectListYn && (<div className={`mt-[10px] flex w-[calc(100%-35px)] flex-col gap-[10px] `}>
114
+ <div className={`
113
115
  ${WorkFlowButtonUiCode.TILE_BUTTON === (object === null || object === void 0 ? void 0 : object.objectGroupUiCode)
114
- ? 'flex flex-row flex-wrap gap-x-[4px] gap-y-[8px]'
115
- : 'flex flex-col gap-[8px]'}
116
+ ? 'flex flex-row flex-wrap gap-x-[4px] gap-y-[8px]'
117
+ : 'flex flex-col gap-[8px]'}
116
118
  `}>
117
- {WorkFlowButtonUiCode.TILE_BUTTON !== (object === null || object === void 0 ? void 0 : object.objectGroupUiCode)
118
- ? (_b = (_a = object.objectList) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.sequence - b.sequence)) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
119
- var _a;
120
- return (<ObjectButton key={`object-expose-${index}`} object={item} messageNumber={(object === null || object === void 0 ? void 0 : object.messageNumber) || ''} workFlowNumber={((_a = message === null || message === void 0 ? void 0 : message.workFlow) === null || _a === void 0 ? void 0 : _a.workFlowNumber) || ''} isFirstObject={objectFirstQuestionCheck} objectGroupUiCode={(object === null || object === void 0 ? void 0 : object.objectGroupUiCode) || ''}/>);
121
- })
122
- : null}
123
- {/* 더보기 들어간 타입 */}
124
- {WorkFlowButtonUiCode.TILE_BUTTON === (object === null || object === void 0 ? void 0 : object.objectGroupUiCode) && (<FieldWorkObject object={object} message={message} isFirstObject={objectFirstQuestionCheck} scrollEnd={scrollEnd}/>)}
125
- </div>
126
- {!objectFirstQuestionCheck && (<ObjectBack isBack={objectIsBack} handleBtn={() => __awaiter(void 0, void 0, void 0, function* () {
127
- if (handelObjectBack) {
128
- yield handelObjectBack({
129
- chatInquiryNumber: chatInquiryNumber,
130
- messageNumber: (object === null || object === void 0 ? void 0 : object.messageNumber) || '',
131
- workFlowNavigationCode: objectIsBack
132
- ? WorkFlowBackOrInit.BACK
133
- : WorkFlowBackOrInit.INIT
134
- });
135
- }
136
- })}/>)}
137
- </div>)}
119
+ {WorkFlowButtonUiCode.TILE_BUTTON !== (object === null || object === void 0 ? void 0 : object.objectGroupUiCode)
120
+ ? (_b = (_a = object.objectList) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.sequence - b.sequence)) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
121
+ var _a;
122
+ return (<ObjectButton key={`object-expose-${index}`} object={item} messageNumber={(object === null || object === void 0 ? void 0 : object.messageNumber) || ''} workFlowNumber={((_a = message === null || message === void 0 ? void 0 : message.workFlow) === null || _a === void 0 ? void 0 : _a.workFlowNumber) || ''} isFirstObject={objectFirstQuestionCheck} objectGroupUiCode={(object === null || object === void 0 ? void 0 : object.objectGroupUiCode) || ''}/>);
123
+ })
124
+ : null}
125
+ {/* 더보기 들어간 타입 */}
126
+ {WorkFlowButtonUiCode.TILE_BUTTON === (object === null || object === void 0 ? void 0 : object.objectGroupUiCode) && (<FieldWorkObject object={object} message={message} isFirstObject={objectFirstQuestionCheck} scrollEnd={scrollEnd}/>)}
127
+ </div>
128
+ {!objectFirstQuestionCheck && (<ObjectBack isBack={objectIsBack} handleBtn={() => __awaiter(void 0, void 0, void 0, function* () {
129
+ if (handelObjectBack) {
130
+ yield handelObjectBack({
131
+ chatInquiryNumber: chatInquiryNumber,
132
+ messageNumber: (object === null || object === void 0 ? void 0 : object.messageNumber) || '',
133
+ workFlowNavigationCode: objectIsBack
134
+ ? WorkFlowBackOrInit.BACK
135
+ : WorkFlowBackOrInit.INIT
136
+ });
137
+ }
138
+ })}/>)}
139
+ </div>))}
138
140
  </div>);
139
141
  };
140
142
  return (<div className={`mb-[20px] flex ${isOperator ? 'justify-start' : 'justify-end'}`}>