@daeryun/dr_components 0.8.83 → 0.8.85

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.
@@ -53,7 +53,6 @@ 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);
57
56
  // 파일이 있는경우
58
57
  if (isFile) {
59
58
  return (<div className={`flex flex-col gap-[10px]`}>
@@ -109,34 +108,35 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
109
108
  `}>
110
109
  {renderText(message, isObject)}
111
110
  {/* 오브젝트 박스 */}
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] `}>
111
+ {(inquiryStatus === InquiryStatusEnum.OPEN || inquiryStatus === InquiryStatusEnum.PERSONAL_INFO) &&
112
+ object &&
113
+ object.exposeObjectListYn && (<div className={`mt-[10px] flex w-[calc(100%-35px)] flex-col gap-[10px] `}>
114
114
  <div className={`
115
115
  ${WorkFlowButtonUiCode.TILE_BUTTON === (object === null || object === void 0 ? void 0 : object.objectGroupUiCode)
116
- ? 'flex flex-row flex-wrap gap-x-[4px] gap-y-[8px]'
117
- : 'flex flex-col gap-[8px]'}
116
+ ? 'flex flex-row flex-wrap gap-x-[4px] gap-y-[8px]'
117
+ : 'flex flex-col gap-[8px]'}
118
118
  `}>
119
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}
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
125
  {/* 더보기 들어간 타입 */}
126
126
  {WorkFlowButtonUiCode.TILE_BUTTON === (object === null || object === void 0 ? void 0 : object.objectGroupUiCode) && (<FieldWorkObject object={object} message={message} isFirstObject={objectFirstQuestionCheck} scrollEnd={scrollEnd}/>)}
127
127
  </div>
128
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>))}
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>)}
140
140
  </div>);
141
141
  };
142
142
  return (<div className={`mb-[20px] flex ${isOperator ? 'justify-start' : 'justify-end'}`}>
@@ -84,7 +84,6 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
84
84
  const isAuthForm = hasForm(message);
85
85
  const isRichForm = hasRichForm(message);
86
86
  const isFile = hasFileArray(message);
87
- console.log('inquiryStatus', inquiryStatus);
88
87
 
89
88
  // 파일이 있는경우
90
89
  if (isFile) {
@@ -166,8 +165,9 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
166
165
  >
167
166
  {renderText(message, isObject)}
168
167
  {/* 오브젝트 박스 */}
169
- {inquiryStatus === InquiryStatusEnum.OPEN ||
170
- (inquiryStatus === InquiryStatusEnum.PERSONAL_INFO && object && object.exposeObjectListYn && (
168
+ {(inquiryStatus === InquiryStatusEnum.OPEN || inquiryStatus === InquiryStatusEnum.PERSONAL_INFO) &&
169
+ object &&
170
+ object.exposeObjectListYn && (
171
171
  <div className={`mt-[10px] flex w-[calc(100%-35px)] flex-col gap-[10px] `}>
172
172
  <div
173
173
  className={`
@@ -221,7 +221,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
221
221
  />
222
222
  )}
223
223
  </div>
224
- ))}
224
+ )}
225
225
  </div>
226
226
  );
227
227
  };
@@ -51,7 +51,7 @@ const HistoryView = ({ onBackClick, onChatHistoryClick, onNewChatClick, isAuthen
51
51
  </span>
52
52
  </div>
53
53
  <div className=" mt-[10px] flex items-center justify-between">
54
- <p className="dr_talk_body_medium2 line-clamp-2 w-[calc(100%-24px)] text-drTalkGrayscale2 ">
54
+ <p className={`${history.unread_message_count && history.unread_message_count > 0 ? 'text-black' : 'text-drTalkGrayscale2'} dr_talk_body_medium2 line-clamp-2 w-[calc(100%-24px)] `}>
55
55
  {history.recent_message_content}
56
56
  </p>
57
57
  <LinkRight width={18} height={18} className="flex-shrink-0"/>
@@ -112,7 +112,9 @@ const HistoryView: React.FC<HistoryViewProps> = ({
112
112
  </span>
113
113
  </div>
114
114
  <div className=" mt-[10px] flex items-center justify-between">
115
- <p className="dr_talk_body_medium2 line-clamp-2 w-[calc(100%-24px)] text-drTalkGrayscale2 ">
115
+ <p
116
+ className={`${history.unread_message_count && history.unread_message_count > 0 ? 'text-black' : 'text-drTalkGrayscale2'} dr_talk_body_medium2 line-clamp-2 w-[calc(100%-24px)] `}
117
+ >
116
118
  {history.recent_message_content}
117
119
  </p>
118
120
  <LinkRight width={18} height={18} className="flex-shrink-0" />
@@ -5,7 +5,6 @@ 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
- import ShadowBox from '../_ui/ShadowBox';
9
8
  const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력해 주세요.', onEnterKeyPress, onKeyDown, contentClassName = '' }, ref) => {
10
9
  const containerRef = useRef(null);
11
10
  const [isScroll, setIsScroll] = useState(false);
@@ -40,7 +39,7 @@ const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력해 주
40
39
  },
41
40
  editorProps: {
42
41
  attributes: {
43
- class: `dr_talk_body_medium2 focus:outline-none overflow-y-auto resize-none pt-[6px] pb-[4px] break-words whitespace-pre-wrap word-wrap break-word overflow-wrap-anywhere no-scrollbar `
42
+ class: `max-h-[72px] min-h-[36px] overflow-auto dr_talk_body_medium2 focus:outline-none overflow-y-auto resize-none pt-[6px] pb-[4px] break-words whitespace-pre-wrap word-wrap break-word overflow-wrap-anywhere no-scrollbar `
44
43
  },
45
44
  handleKeyDown: (view, event) => {
46
45
  const isMobile = /Mobi|Android/i.test(navigator.userAgent); // 모바일 여부 판별
@@ -121,9 +120,9 @@ const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력해 주
121
120
  return null;
122
121
  return (<div className={`relative w-full `}>
123
122
  <div ref={containerRef} className={`w-full`}>
124
- <EditorContent editor={editor} tabIndex={0} className={`${contentClassName} max-h-[72px] min-h-[36px] w-full overflow-hidden rounded-md border !text-black dark:text-white `}/>
123
+ <EditorContent editor={editor} tabIndex={0} className={`${contentClassName} w-full rounded-md border !text-black dark:text-white `}/>
125
124
  </div>
126
- {isScroll && !isBottom && <ShadowBox />}
125
+ {/*{isScroll && !isBottom && <ShadowBox className={`!h-[5px]`} />}*/}
127
126
  </div>);
128
127
  });
129
128
  Tiptap.displayName = 'Tiptap';
@@ -64,7 +64,7 @@ const Tiptap = forwardRef<TiptapEditorRef, TiptapProps>(
64
64
  },
65
65
  editorProps: {
66
66
  attributes: {
67
- class: `dr_talk_body_medium2 focus:outline-none overflow-y-auto resize-none pt-[6px] pb-[4px] break-words whitespace-pre-wrap word-wrap break-word overflow-wrap-anywhere no-scrollbar `
67
+ class: `max-h-[72px] min-h-[36px] overflow-auto dr_talk_body_medium2 focus:outline-none overflow-y-auto resize-none pt-[6px] pb-[4px] break-words whitespace-pre-wrap word-wrap break-word overflow-wrap-anywhere no-scrollbar `
68
68
  },
69
69
  handleKeyDown: (view, event) => {
70
70
  const isMobile = /Mobi|Android/i.test(navigator.userAgent); // 모바일 여부 판별
@@ -157,10 +157,10 @@ const Tiptap = forwardRef<TiptapEditorRef, TiptapProps>(
157
157
  <EditorContent
158
158
  editor={editor}
159
159
  tabIndex={0}
160
- className={`${contentClassName} max-h-[72px] min-h-[36px] w-full overflow-hidden rounded-md border !text-black dark:text-white `}
160
+ className={`${contentClassName} w-full rounded-md border !text-black dark:text-white `}
161
161
  />
162
162
  </div>
163
- {isScroll && !isBottom && <ShadowBox />}
163
+ {/*{isScroll && !isBottom && <ShadowBox className={`!h-[5px]`} />}*/}
164
164
  </div>
165
165
  );
166
166
  }
@@ -253,6 +253,7 @@ export function connectWebSocket(wsUrl, token, isOpen, setIsConnected, onMessage
253
253
  setupSocketHandlers(newSocket);
254
254
  }
255
255
  catch (error) {
256
+ console.log('socket error', error);
256
257
  setIsConnected(false);
257
258
  }
258
259
  }
@@ -314,6 +314,7 @@ export function connectWebSocket(
314
314
  // 새 소켓에 핸들러 등록
315
315
  setupSocketHandlers(newSocket);
316
316
  } catch (error) {
317
+ console.log('socket error', error);
317
318
  setIsConnected(false);
318
319
  }
319
320
  } else {
@@ -1,3 +1,6 @@
1
1
  import React from 'react';
2
- declare const ShadowBox: () => React.JSX.Element;
2
+ interface IShadowBox {
3
+ className?: string;
4
+ }
5
+ declare const ShadowBox: ({ className }: IShadowBox) => React.JSX.Element;
3
6
  export default ShadowBox;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- const ShadowBox = () => {
3
- return (<div className="absolute bottom-0 left-0 z-[10] h-[50px] w-full bg-gradient-to-t from-[rgba(255,255,255,1)] to-[rgba(255,255,255,0)]"/>);
2
+ const ShadowBox = ({ className = '' }) => {
3
+ return (<div className={`${className} absolute bottom-0 left-0 z-[10] h-[50px] w-full bg-gradient-to-t from-[rgba(255,255,255,1)] to-[rgba(255,255,255,0)]`}/>);
4
4
  };
5
5
  export default ShadowBox;
@@ -1,8 +1,13 @@
1
1
  import React from 'react';
2
2
 
3
- const ShadowBox = () => {
3
+ interface IShadowBox {
4
+ className?: string;
5
+ }
6
+ const ShadowBox = ({ className = '' }: IShadowBox) => {
4
7
  return (
5
- <div className="absolute bottom-0 left-0 z-[10] h-[50px] w-full bg-gradient-to-t from-[rgba(255,255,255,1)] to-[rgba(255,255,255,0)]" />
8
+ <div
9
+ className={`${className} absolute bottom-0 left-0 z-[10] h-[50px] w-full bg-gradient-to-t from-[rgba(255,255,255,1)] to-[rgba(255,255,255,0)]`}
10
+ />
6
11
  );
7
12
  };
8
13
 
@@ -2267,6 +2267,10 @@ video {
2267
2267
  aspect-ratio: 16 / 9;
2268
2268
  }
2269
2269
 
2270
+ .\!h-\[5px\] {
2271
+ height: 5px !important;
2272
+ }
2273
+
2270
2274
  .\!h-\[83px\] {
2271
2275
  height: 83px !important;
2272
2276
  }