@daeryun/dr_components 0.8.21 → 0.8.23

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.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import Image from 'next/image';
3
3
  const WorkFlowImg = ({ message }) => {
4
4
  const workFlowItem = message.workFlow;
5
- return (<div className={`mb-[10px] h-[311px] w-[281px] overflow-hidden rounded-[10px] border-[1px] border-solid`}>
5
+ return (<div className={`h-auto overflow-hidden rounded-[10px]`}>
6
6
  <Image src={(workFlowItem === null || workFlowItem === void 0 ? void 0 : workFlowItem.imageUrl) || ''} alt={''} width={300} height={300} className={`h-full w-full`}/>
7
7
  </div>);
8
8
  };
@@ -7,7 +7,7 @@ interface props {
7
7
  const WorkFlowImg = ({ message }: props) => {
8
8
  const workFlowItem = message.workFlow;
9
9
  return (
10
- <div className={`mb-[10px] h-[311px] w-[281px] overflow-hidden rounded-[10px] border-[1px] border-solid`}>
10
+ <div className={`h-auto overflow-hidden rounded-[10px]`}>
11
11
  <Image src={workFlowItem?.imageUrl || ''} alt={''} width={300} height={300} className={`h-full w-full`} />
12
12
  </div>
13
13
  );
@@ -31,7 +31,7 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
31
31
  };
32
32
  const time = formatTime(message.createdAt);
33
33
  // 텍스트 블록 렌더링
34
- const renderText = (message) => {
34
+ const renderText = (message, isObject) => {
35
35
  /**
36
36
  * 메세지 UICode 기반으로 바꿔야할 듯함 ->
37
37
  *
@@ -65,18 +65,21 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
65
65
  // } else if (message.templateType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1) {
66
66
  // }
67
67
  if (isAuthForm) {
68
- return (<div className={`max-w-[80%]`}>
68
+ return (<div className={`flex flex-row items-end gap-[4px]`}>
69
69
  <WorkFlowAuthForm message={message} isOperator={isOperator}/>
70
+ <div className={`text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>
70
71
  </div>);
71
72
  }
72
73
  if (isWorkFlowCustomerClickData) {
73
- return (<div className={``}>
74
+ return (<div className={`flex flex-row items-end gap-[4px]`}>
75
+ <div className={`text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>
74
76
  <WorkFlowClickData message={message}/>
75
77
  </div>);
76
78
  }
77
79
  if (isWorkFlowImg) {
78
- return (<div className={``}>
80
+ return (<div className={`relative flex flex-row items-end gap-[4px]`}>
79
81
  <WorkFlowImg message={message}/>
82
+ {/*<div className={` text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>*/}
80
83
  </div>);
81
84
  }
82
85
  if (isRichForm) {
@@ -99,11 +102,12 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
99
102
  ? Object.values(ObjectNumber).every(enumValue => { var _a; return (_a = object === null || object === void 0 ? void 0 : object.objectList) === null || _a === void 0 ? void 0 : _a.some(obj => (obj === null || obj === void 0 ? void 0 : obj.objectNumber) === enumValue); })
100
103
  : false;
101
104
  const objectIsBack = workFlowStack.length >= 3;
105
+ const isObject = Boolean(object && object.exposeObjectListYn);
102
106
  return (<div className={`
103
- message-content
107
+ message-content max-w-[280px]
104
108
  `}>
105
109
  {/*{hasBlocks(message) && message.blocks?.map((block, index) => renderTextBlock(block, index))}*/}
106
- {renderText(message)}
110
+ {renderText(message, isObject)}
107
111
  {/* 오브젝트 박스 */}
108
112
  {object && object.exposeObjectListYn && (<div className={`mt-[10px] flex flex-col gap-[10px]`}>
109
113
  <div className={`
@@ -145,17 +149,11 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
145
149
  <span className="font-[700] leading-[100%] tracking-[-4%]">법무법인(유한)대륜</span>
146
150
  </div>
147
151
 
148
- <div className="flex items-end gap-2 pl-9">
149
- {renderMessageContent()}
150
- {/*<span className="mb-1 text-xs text-gray-500">{time}</span>*/}
151
- </div>
152
+ <div className="flex items-end gap-2 pl-9">{renderMessageContent()}</div>
152
153
  </div>) : (
153
154
  // 유저
154
155
  <div className="flex max-w-[80%] flex-col">
155
- <div className="flex items-end gap-2">
156
- {/*<span className="mb-1 text-xs text-gray-500">{time}</span>*/}
157
- {renderMessageContent()}
158
- </div>
156
+ <div className="flex items-end gap-2">{renderMessageContent()}</div>
159
157
  </div>)}
160
158
  </div>);
161
159
  };
@@ -64,7 +64,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
64
64
  const time = formatTime(message.createdAt);
65
65
 
66
66
  // 텍스트 블록 렌더링
67
- const renderText = (message: Message) => {
67
+ const renderText = (message: Message, isObject: boolean) => {
68
68
  /**
69
69
  * 메세지 UICode 기반으로 바꿔야할 듯함 ->
70
70
  *
@@ -106,22 +106,25 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
106
106
 
107
107
  if (isAuthForm) {
108
108
  return (
109
- <div className={`max-w-[80%]`}>
109
+ <div className={`flex flex-row items-end gap-[4px]`}>
110
110
  <WorkFlowAuthForm message={message} isOperator={isOperator} />
111
+ <div className={`text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>
111
112
  </div>
112
113
  );
113
114
  }
114
115
  if (isWorkFlowCustomerClickData) {
115
116
  return (
116
- <div className={``}>
117
+ <div className={`flex flex-row items-end gap-[4px]`}>
118
+ <div className={`text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>
117
119
  <WorkFlowClickData message={message} />
118
120
  </div>
119
121
  );
120
122
  }
121
123
  if (isWorkFlowImg) {
122
124
  return (
123
- <div className={``}>
125
+ <div className={`relative flex flex-row items-end gap-[4px]`}>
124
126
  <WorkFlowImg message={message} />
127
+ {/*<div className={` text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>*/}
125
128
  </div>
126
129
  );
127
130
  }
@@ -155,14 +158,16 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
155
158
 
156
159
  const objectIsBack = workFlowStack.length >= 3;
157
160
 
161
+ const isObject = Boolean(object && object.exposeObjectListYn);
162
+
158
163
  return (
159
164
  <div
160
165
  className={`
161
- message-content
166
+ message-content max-w-[280px]
162
167
  `}
163
168
  >
164
169
  {/*{hasBlocks(message) && message.blocks?.map((block, index) => renderTextBlock(block, index))}*/}
165
- {renderText(message)}
170
+ {renderText(message, isObject)}
166
171
  {/* 오브젝트 박스 */}
167
172
  {object && object.exposeObjectListYn && (
168
173
  <div className={`mt-[10px] flex flex-col gap-[10px]`}>
@@ -236,18 +241,12 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
236
241
  <span className="font-[700] leading-[100%] tracking-[-4%]">법무법인(유한)대륜</span>
237
242
  </div>
238
243
 
239
- <div className="flex items-end gap-2 pl-9">
240
- {renderMessageContent()}
241
- {/*<span className="mb-1 text-xs text-gray-500">{time}</span>*/}
242
- </div>
244
+ <div className="flex items-end gap-2 pl-9">{renderMessageContent()}</div>
243
245
  </div>
244
246
  ) : (
245
247
  // 유저
246
248
  <div className="flex max-w-[80%] flex-col">
247
- <div className="flex items-end gap-2">
248
- {/*<span className="mb-1 text-xs text-gray-500">{time}</span>*/}
249
- {renderMessageContent()}
250
- </div>
249
+ <div className="flex items-end gap-2">{renderMessageContent()}</div>
251
250
  </div>
252
251
  )}
253
252
  </div>
@@ -4,7 +4,7 @@ import { isEmptyHtml } from '../_lib/utils';
4
4
  // 메시지에 특정 컨텐츠가 있는지 확인하는 헬퍼 함수들
5
5
  export const hasBlocks = (message) => !!message.blocks && message.blocks.length > 0;
6
6
  //
7
- export const hasRichForm = (message) => { var _a; return !!message.richText && message.richText.structuredData && isEmptyHtml((_a = message === null || message === void 0 ? void 0 : message.richText) === null || _a === void 0 ? void 0 : _a.htmlContent); };
7
+ export const hasRichForm = (message) => { var _a; return !!(message.richText && message.richText.structuredData && isEmptyHtml((_a = message === null || message === void 0 ? void 0 : message.richText) === null || _a === void 0 ? void 0 : _a.htmlContent)); };
8
8
  // 사용자가 워크플로우 대답 클릭한거
9
9
  export const hasCustomerWorkFlowClickData = (message) => message.templateType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3;
10
10
  export const hasButtons = (message) => !!message.buttons && message.buttons.length > 0;
@@ -127,7 +127,7 @@ export const hasBlocks = (message: Message): boolean => !!message.blocks && mess
127
127
 
128
128
  //
129
129
  export const hasRichForm = (message: Message): boolean =>
130
- !!message.richText && message.richText.structuredData && isEmptyHtml(message?.richText?.htmlContent);
130
+ !!(message.richText && message.richText.structuredData && isEmptyHtml(message?.richText?.htmlContent));
131
131
 
132
132
  // 사용자가 워크플로우 대답 클릭한거
133
133
  export const hasCustomerWorkFlowClickData = (message: Message): boolean =>
@@ -35,6 +35,7 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905' }) => {
35
35
  const path = window.location.pathname;
36
36
  if (path === (isLocal ? '/chat-test' : '/daeryuntalk')) {
37
37
  const hash = window.location.hash;
38
+
38
39
  const value = hash ? hash.substring(1) : null;
39
40
 
40
41
  if (value) {
@@ -2384,10 +2384,6 @@ video {
2384
2384
  height: 30px;
2385
2385
  }
2386
2386
 
2387
- .h-\[311px\] {
2388
- height: 311px;
2389
- }
2390
-
2391
2387
  .h-\[32\%\] {
2392
2388
  height: 32%;
2393
2389
  }
@@ -3027,10 +3023,6 @@ video {
3027
3023
  width: 27px;
3028
3024
  }
3029
3025
 
3030
- .w-\[281px\] {
3031
- width: 281px;
3032
- }
3033
-
3034
3026
  .w-\[28px\] {
3035
3027
  width: 28px;
3036
3028
  }
@@ -3456,6 +3448,10 @@ video {
3456
3448
  max-width: 1920px;
3457
3449
  }
3458
3450
 
3451
+ .max-w-\[280px\] {
3452
+ max-width: 280px;
3453
+ }
3454
+
3459
3455
  .max-w-\[300px\] {
3460
3456
  max-width: 300px;
3461
3457
  }