@daeryun/dr_components 0.8.78 → 0.8.80

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 (43) hide show
  1. package/dist/asset/images/daeryuntalk/firstGo.svg +1 -1
  2. package/dist/asset/images/daeryuntalk/re_send.svg +11 -0
  3. package/dist/asset/images/daeryuntalk/viewer/gray-download.svg +1 -1
  4. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  5. package/dist/components/Daeryuntalk/ChatButton.jsx +1 -1
  6. package/dist/components/Daeryuntalk/ChatButton.tsx +1 -1
  7. package/dist/components/Daeryuntalk/ChatConversation.jsx +59 -94
  8. package/dist/components/Daeryuntalk/ChatConversation.tsx +58 -112
  9. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +2 -2
  10. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +2 -2
  11. package/dist/components/Daeryuntalk/ChatHomeView.jsx +11 -7
  12. package/dist/components/Daeryuntalk/ChatHomeView.tsx +13 -9
  13. package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +8 -8
  14. package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +8 -8
  15. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.jsx +10 -0
  16. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.tsx +15 -0
  17. package/dist/components/Daeryuntalk/ChatMessage.jsx +8 -3
  18. package/dist/components/Daeryuntalk/ChatMessage.tsx +11 -12
  19. package/dist/components/Daeryuntalk/ChatWidget.jsx +13 -12
  20. package/dist/components/Daeryuntalk/ChatWidget.tsx +15 -12
  21. package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +2 -1
  22. package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +2 -1
  23. package/dist/components/Daeryuntalk/HistoryView.jsx +3 -3
  24. package/dist/components/Daeryuntalk/HistoryView.tsx +3 -3
  25. package/dist/components/Daeryuntalk/HomeView.jsx +36 -21
  26. package/dist/components/Daeryuntalk/HomeView.tsx +37 -21
  27. package/dist/components/Daeryuntalk/NoticeMessage.jsx +5 -5
  28. package/dist/components/Daeryuntalk/NoticeMessage.tsx +10 -9
  29. package/dist/components/Daeryuntalk/Tiptap/Tiptap.jsx +4 -4
  30. package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +6 -4
  31. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +9 -6
  32. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +17 -16
  33. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +2 -1
  34. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +10 -5
  35. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +9 -1
  36. package/dist/components/Daeryuntalk/_types/message.d.ts +1 -1
  37. package/dist/components/Daeryuntalk/_types/message.js +6 -1
  38. package/dist/components/Daeryuntalk/_types/message.ts +7 -1
  39. package/dist/components/Daeryuntalk/index.jsx +12 -0
  40. package/dist/components/Daeryuntalk/index.tsx +13 -0
  41. package/dist/styles/globals.css +81 -27
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +1 -1
@@ -92,9 +92,9 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
92
92
  e.stopPropagation();
93
93
  await handleDownload(file);
94
94
  }}
95
- className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover/image:opacity-100"
95
+ className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center bg-transparent opacity-0 transition-opacity group-hover/image:opacity-100"
96
96
  >
97
- <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-drTalkWhite" />
97
+ <FileDownLoadIcon className="h-[25px] w-[24px]" />
98
98
  </button>
99
99
  </div>
100
100
  );
@@ -127,9 +127,9 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
127
127
  await handleDownload(media.images[media.images.length - 1]);
128
128
  }
129
129
  }}
130
- className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover/image:opacity-100"
130
+ className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center opacity-0 transition-opacity group-hover/image:opacity-100"
131
131
  >
132
- <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full text-drTalkGrayscale2 " />
132
+ <FileDownLoadIcon className="h-[25px] w-[24px]" />
133
133
  </button>
134
134
  </div>
135
135
  </div>
@@ -161,9 +161,9 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
161
161
  await handleDownload(media.images[0]);
162
162
  }
163
163
  }}
164
- className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover/image:opacity-100"
164
+ className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center opacity-0 transition-opacity group-hover/image:opacity-100"
165
165
  >
166
- <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-white" />
166
+ <FileDownLoadIcon className="h-[25px] w-[24px]" />
167
167
  </button>
168
168
  </div>
169
169
  </div>
@@ -204,9 +204,9 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
204
204
  e.stopPropagation();
205
205
  await handleDownload(file);
206
206
  }}
207
- className="flex h-[24px] w-[24px] items-center justify-center rounded-full"
207
+ className="flex h-[24px] w-[24px] items-center justify-center "
208
208
  >
209
- <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-white" />
209
+ <FileDownLoadIcon className="h-[25px] w-[24px] bg-white" />
210
210
  </button>
211
211
  </div>
212
212
  </div>
@@ -1,7 +1,17 @@
1
1
  import React from 'react';
2
2
  import Image from 'next/image';
3
+ import { InquiryMessageTemplateType } from '../_enums/template';
3
4
  const WorkFlowImg = ({ message }) => {
4
5
  const workFlowItem = message.workFlow;
6
+ const messageType = (message === null || message === void 0 ? void 0 : message.templateType) || '';
7
+ if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1) {
8
+ }
9
+ if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2) {
10
+ }
11
+ if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3) {
12
+ }
13
+ if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4) {
14
+ }
5
15
  return (<div className={`h-auto overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
6
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}/>
7
17
  </div>);
@@ -1,11 +1,26 @@
1
1
  import React from 'react';
2
2
  import Image from 'next/image';
3
3
  import { Message } from '../_types/message';
4
+ import { InquiryMessageTemplateType } from '../_enums/template';
4
5
  interface props {
5
6
  message: Message;
6
7
  }
7
8
  const WorkFlowImg = ({ message }: props) => {
8
9
  const workFlowItem = message.workFlow;
10
+ const messageType = message?.templateType || '';
11
+
12
+ if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1) {
13
+ }
14
+
15
+ if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2) {
16
+ }
17
+
18
+ if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3) {
19
+ }
20
+
21
+ if (messageType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4) {
22
+ }
23
+
9
24
  return (
10
25
  <div className={`h-auto overflow-hidden rounded-[10px] border-[1px] border-drTalkGrayscale4`}>
11
26
  <Image
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import React from 'react';
11
- import { hasBlocks, hasWorkFlowImg, hasCustomerWorkFlowClickData, hasForm, hasRichForm, hasFileArray } from './_types/message';
11
+ import { hasBlocks, hasCustomerWorkFlowClickData, hasFileArray, hasForm, hasRichForm, hasWorkFlow } from './_types/message';
12
12
  import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
13
13
  import { ObjectNumber, WorkFlowBackOrInit, WorkFlowButtonUiCode } from './_enums/work_flow_object_expose';
14
14
  import { MessageSenderType } from './_enums/sender_type';
@@ -44,8 +44,10 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
44
44
  * MSP00300202 워크플로우이미지+(텍스트) -> 워크플로우 메시지 템플릿 2
45
45
  * MSP00300203 아이콘+텍스트 -> 워크플로우 메시지 템플릿 3
46
46
  * MSP00300204 텍스트+폼 -> 워크플로우 메시지 템플릿 4
47
+ *
48
+ *
47
49
  */
48
- const isWorkFlowImg = hasWorkFlowImg(message);
50
+ const isWorkFlow = hasWorkFlow(message);
49
51
  const isBlock = hasBlocks(message);
50
52
  const isWorkFlowCustomerClickData = hasCustomerWorkFlowClickData(message);
51
53
  const isAuthForm = hasForm(message);
@@ -63,17 +65,20 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
63
65
  <ChatFile message={message} isOperator={isOperator} isHovered={isHovered} time={time}/>
64
66
  </div>);
65
67
  }
68
+ // 워크플로우 개인정보 인증 폼
66
69
  if (isAuthForm) {
67
70
  return (<TimeWrapper time={time}>
68
71
  <WorkFlowAuthForm message={message} isOperator={isOperator}/>
69
72
  </TimeWrapper>);
70
73
  }
74
+ // 워크플로우 고객이 클릭한 내역
71
75
  if (isWorkFlowCustomerClickData) {
72
76
  return (<TimeWrapper time={time} timePosition={'left'}>
73
77
  <WorkFlowClickData message={message}/>
74
78
  </TimeWrapper>);
75
79
  }
76
- if (isWorkFlowImg) {
80
+ // 워크플로우 이미지 -> ( 이미지 + 텍스트 ) 로 잡힐 예정
81
+ if (isWorkFlow) {
77
82
  return (<TimeWrapper time={time}>
78
83
  <WorkFlowImg message={message}/>
79
84
  </TimeWrapper>);
@@ -1,22 +1,17 @@
1
1
  import React from 'react';
2
2
  import {
3
- Message,
4
- TextBlock,
5
3
  hasBlocks,
6
- hasWorkFlowImg,
7
4
  hasCustomerWorkFlowClickData,
5
+ hasFileArray,
8
6
  hasForm,
9
7
  hasRichForm,
10
- hasFiles,
11
- hasImages,
12
- hasFileArray
8
+ hasWorkFlow,
9
+ Message
13
10
  } from './_types/message';
14
11
  import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
15
12
  import { MessageObject } from './_types/message_object';
16
- import Image from 'next/image';
17
13
  import { ObjectNumber, WorkFlowBackOrInit, WorkFlowButtonUiCode } from './_enums/work_flow_object_expose';
18
14
  import { MessageSenderType } from './_enums/sender_type';
19
- import { useDaeryuntalk } from './DaeryuntalkContext';
20
15
  import ObjectButton from './ChatObject/ObjectButton';
21
16
  import ObjectBack from './ChatObject/ObjectBack';
22
17
  import WorkFlowClickData from './ChatItem/WorkFlowClickData';
@@ -25,9 +20,7 @@ import WorkFlowAuthForm from './ChatItem/WorkFlowAuthForm';
25
20
  import ChatWrapper from './ChatItem/ChatWrapper';
26
21
  import RichText from './ChatItem/RichText';
27
22
  import ChatFile from './ChatItem/ChatFile';
28
- import { getMessageFileDownloadUrl } from './_api';
29
23
  import FieldWorkObject from './ChatObject/FieldWorkObject';
30
- import { InquiryMessageTemplateType } from './_enums/template';
31
24
  import TimeWrapper from './ChatItem/TimeWrapper';
32
25
  import { InquiryStatus } from './_enums/ask-status';
33
26
 
@@ -79,9 +72,11 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
79
72
  * MSP00300202 워크플로우이미지+(텍스트) -> 워크플로우 메시지 템플릿 2
80
73
  * MSP00300203 아이콘+텍스트 -> 워크플로우 메시지 템플릿 3
81
74
  * MSP00300204 텍스트+폼 -> 워크플로우 메시지 템플릿 4
75
+ *
76
+ *
82
77
  */
83
78
 
84
- const isWorkFlowImg = hasWorkFlowImg(message);
79
+ const isWorkFlow = hasWorkFlow(message);
85
80
  const isBlock = hasBlocks(message);
86
81
  const isWorkFlowCustomerClickData = hasCustomerWorkFlowClickData(message);
87
82
  const isAuthForm = hasForm(message);
@@ -105,6 +100,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
105
100
  );
106
101
  }
107
102
 
103
+ // 워크플로우 개인정보 인증 폼
108
104
  if (isAuthForm) {
109
105
  return (
110
106
  <TimeWrapper time={time}>
@@ -112,6 +108,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
112
108
  </TimeWrapper>
113
109
  );
114
110
  }
111
+ // 워크플로우 고객이 클릭한 내역
115
112
  if (isWorkFlowCustomerClickData) {
116
113
  return (
117
114
  <TimeWrapper time={time} timePosition={'left'}>
@@ -119,7 +116,9 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
119
116
  </TimeWrapper>
120
117
  );
121
118
  }
122
- if (isWorkFlowImg) {
119
+
120
+ // 워크플로우 이미지 -> ( 이미지 + 텍스트 ) 로 잡힐 예정
121
+ if (isWorkFlow) {
123
122
  return (
124
123
  <TimeWrapper time={time}>
125
124
  <WorkFlowImg message={message} />
@@ -19,24 +19,26 @@ const ChatWidget = ({ isOpen, isMobile, onClose, hashValue, setHashValue }) => {
19
19
  bottom-0 right-0 h-[100dvh]
20
20
  `;
21
21
  // 해쉬 있을 경우는 여기서 중앙배치 css로
22
- const webTbPCWrapperCss = `
23
- ${isHash ? '' : 'duration-300 ease-in-out'}
24
- ${isHash ? '' : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
22
+ const webTbPCWrapperCss = `
23
+ ${isHash ? '' : 'xs:duration-300 ease-in-out'}
24
+ ${isHash
25
+ ? ''
26
+ : isOpen
27
+ ? 'opacity-100 pointer-events-auto xs:translate-y-0 xs:duration-500'
28
+ : 'opacity-0 pointer-events-none xs:translate-y-4 xs:duration-500 '}
25
29
  ${isHash
26
30
  ? `
27
31
  xs:fixed xs:flex xs:justify-center xs:items-center xs:inset-0 xs:bg-white
28
32
  xs:w-screen xs:h-[100dvh] xs:inset-0 xs:pt-[70px]
29
33
  `
30
- : `
31
- h-[100dvh]
32
- xs:bottom-[165px] xs:right-[30px] xs:max-w-[400px]
34
+ : `
35
+ h-[100dvh] ease-in-out
36
+ xs:bottom-[165px] xs:right-[25px] xs:max-w-[390px]
33
37
  xs:max-h-[690px] xs:rounded-[30px]
34
- lg:bottom-[110px]
35
- `}
36
-
37
-
38
+ lg:bottom-[100px]
39
+ `}
38
40
  `;
39
- // // // // //
41
+ //
40
42
  const innerMobileWrapperCss = `
41
43
  rounded-none sm:max-w-[640px] sm:m-auto
42
44
  `;
@@ -56,7 +58,6 @@ const ChatWidget = ({ isOpen, isMobile, onClose, hashValue, setHashValue }) => {
56
58
  <div className="relative ">
57
59
  <div className={`
58
60
  ${isMobile ? `${mobileWrapperCss}` : `${webSmallWrapperCss} ${webTbPCWrapperCss} `}
59
-
60
61
  `}>
61
62
  {/* 여기서 외각 스크롤 생김 */}
62
63
  <div ref={containerRef} className={`
@@ -32,27 +32,31 @@ const ChatWidget: React.FC<ChatWidgetProps> = ({ isOpen, isMobile, onClose, hash
32
32
  `;
33
33
 
34
34
  // 해쉬 있을 경우는 여기서 중앙배치 css로
35
- const webTbPCWrapperCss = `
36
- ${isHash ? '' : 'duration-300 ease-in-out'}
37
- ${isHash ? '' : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
35
+ const webTbPCWrapperCss = `
36
+ ${isHash ? '' : 'xs:duration-300 ease-in-out'}
37
+ ${
38
+ isHash
39
+ ? ''
40
+ : isOpen
41
+ ? 'opacity-100 pointer-events-auto xs:translate-y-0 xs:duration-500'
42
+ : 'opacity-0 pointer-events-none xs:translate-y-4 xs:duration-500 '
43
+ }
38
44
  ${
39
45
  isHash
40
46
  ? `
41
47
  xs:fixed xs:flex xs:justify-center xs:items-center xs:inset-0 xs:bg-white
42
48
  xs:w-screen xs:h-[100dvh] xs:inset-0 xs:pt-[70px]
43
49
  `
44
- : `
45
- h-[100dvh]
46
- xs:bottom-[165px] xs:right-[30px] xs:max-w-[400px]
50
+ : `
51
+ h-[100dvh] ease-in-out
52
+ xs:bottom-[165px] xs:right-[25px] xs:max-w-[390px]
47
53
  xs:max-h-[690px] xs:rounded-[30px]
48
- lg:bottom-[110px]
49
- `
54
+ lg:bottom-[100px]
55
+ `
50
56
  }
51
-
52
-
53
57
  `;
54
58
 
55
- // // // // //
59
+ //
56
60
  const innerMobileWrapperCss = `
57
61
  rounded-none sm:max-w-[640px] sm:m-auto
58
62
  `;
@@ -79,7 +83,6 @@ const ChatWidget: React.FC<ChatWidgetProps> = ({ isOpen, isMobile, onClose, hash
79
83
  <div
80
84
  className={`
81
85
  ${isMobile ? `${mobileWrapperCss}` : `${webSmallWrapperCss} ${webTbPCWrapperCss} `}
82
-
83
86
  `}
84
87
  >
85
88
  {/* 여기서 외각 스크롤 생김 */}
@@ -88,7 +88,8 @@ export const DaeryuntalkProvider = ({ children, propsTel, isMobile }) => {
88
88
  setHistoryList,
89
89
  historyList,
90
90
  inquiryMainData,
91
- isMobile
91
+ isMobile,
92
+ setIsAuthenticated
92
93
  });
93
94
  // MSG15591497825895676
94
95
  // 채팅 관련
@@ -178,7 +178,8 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ childr
178
178
  setHistoryList,
179
179
  historyList,
180
180
  inquiryMainData,
181
- isMobile
181
+ isMobile,
182
+ setIsAuthenticated
182
183
  });
183
184
 
184
185
  // MSG15591497825895676
@@ -18,7 +18,7 @@ const HistoryView = ({ onBackClick, onChatHistoryClick, onNewChatClick, isAuthen
18
18
  no-scrollbar relative w-full rounded-t-[30px]
19
19
  ${isMobile
20
20
  ? ` flex h-[calc(100dvh-64px)] flex-col items-center justify-start `
21
- : 'flex flex-col items-center xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ' +
21
+ : ' flex h-[calc(100dvh-64px)] flex-col items-center xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ' +
22
22
  ' xs:max-h-[626px] xs:min-h-[320px] '}
23
23
  `}>
24
24
  {/* 헤더 */}
@@ -36,9 +36,9 @@ const HistoryView = ({ onBackClick, onChatHistoryClick, onNewChatClick, isAuthen
36
36
 
37
37
  {!isAuthenticated ? (<AuthForm goGetHistoryList={goGetHistoryList} handleGoRequestPhone={handleGoRequestPhone} handleGoHistoryPhoneAuth={handleGoHistoryPhoneAuth}/>) : (<>
38
38
  {/* 스크롤 가능한 컨텐츠 영역 */}
39
- <div className="relative flex-1 overflow-hidden">
39
+ <div className="relative w-full flex-1 overflow-hidden">
40
40
  <div ref={containerRef} className="no-scrollbar h-full overflow-y-auto px-[20px] pb-[20px] pt-[24px]">
41
- {hasHistories ? (historyLit === null || historyLit === void 0 ? void 0 : historyLit.map((history, index) => (<div key={`${history.chat_inquiry_number}-${index}`} className="cursor-pointer border-b border-drTalkGrayscale4 px-[12px] py-[18px] hover:bg-gray-50" onClick={() => onChatHistoryClick(history.chat_inquiry_number)}>
41
+ {hasHistories ? (historyLit.map((history, index) => (<div key={`${history.chat_inquiry_number}-${index}`} className="cursor-pointer border-b border-drTalkGrayscale4 px-[12px] py-[18px] hover:bg-gray-50" onClick={() => onChatHistoryClick(history.chat_inquiry_number)}>
42
42
  <div className="flex items-center justify-between">
43
43
  <div className={`flex flex-row items-center gap-[10px]`}>
44
44
  <span className="dr_talk_subtitle_medium">{history.customer_name}</span>
@@ -52,7 +52,7 @@ const HistoryView: React.FC<HistoryViewProps> = ({
52
52
  ${
53
53
  isMobile
54
54
  ? ` flex h-[calc(100dvh-64px)] flex-col items-center justify-start `
55
- : 'flex flex-col items-center xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ' +
55
+ : ' flex h-[calc(100dvh-64px)] flex-col items-center xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ' +
56
56
  ' xs:max-h-[626px] xs:min-h-[320px] '
57
57
  }
58
58
  `}
@@ -84,13 +84,13 @@ const HistoryView: React.FC<HistoryViewProps> = ({
84
84
  ) : (
85
85
  <>
86
86
  {/* 스크롤 가능한 컨텐츠 영역 */}
87
- <div className="relative flex-1 overflow-hidden">
87
+ <div className="relative w-full flex-1 overflow-hidden">
88
88
  <div
89
89
  ref={containerRef}
90
90
  className="no-scrollbar h-full overflow-y-auto px-[20px] pb-[20px] pt-[24px]"
91
91
  >
92
92
  {hasHistories ? (
93
- historyLit?.map((history, index) => (
93
+ historyLit.map((history, index) => (
94
94
  <div
95
95
  key={`${history.chat_inquiry_number}-${index}`}
96
96
  className="cursor-pointer border-b border-drTalkGrayscale4 px-[12px] py-[18px] hover:bg-gray-50"
@@ -15,8 +15,10 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
15
15
  const wrapperRef = useRef(null);
16
16
  const [contentHeight, setContentHeight] = useState(210);
17
17
  const currentHeightRef = useRef(210);
18
+ const prevWrapperHeightRef = useRef(null);
18
19
  useEffect(() => {
19
20
  const updateContentHeight = () => {
21
+ var _a;
20
22
  if (!wrapperRef.current)
21
23
  return;
22
24
  // 모바일이거나 width가 480px 미만이면 contentHeight를 210으로 되돌림
@@ -25,26 +27,37 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
25
27
  setContentHeight(210);
26
28
  return;
27
29
  }
28
- const rect = wrapperRef.current.getBoundingClientRect();
30
+ const rect = (_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
29
31
  const gap = rect.top;
32
+ const wrapperHeight = wrapperRef.current.offsetHeight;
30
33
  const currentHeight = currentHeightRef.current;
34
+ // 이전 높이와 비교하여 줄어드는 중인지 판단
35
+ const prevHeight = prevWrapperHeightRef.current;
36
+ const isShrinking = prevHeight !== null && wrapperHeight < prevHeight;
37
+ const isExpanding = prevHeight !== null && wrapperHeight > prevHeight;
38
+ prevWrapperHeightRef.current = wrapperHeight; // 현재 높이를 저장
31
39
  // 줄어드는 애니메이션 (2단계)
32
- if (gap <= 1) {
40
+ if (isShrinking) {
33
41
  if (currentHeight > 140) {
34
- // 1단계: 210 → 140
35
- const next = Math.max(140, currentHeight - 6);
36
- currentHeightRef.current = next;
37
- setContentHeight(next);
42
+ if (wrapperHeight <= 625) {
43
+ // 1단계: 210 → 140
44
+ const next = Math.max(140, currentHeight - 6);
45
+ currentHeightRef.current = next;
46
+ setContentHeight(next);
47
+ }
38
48
  }
39
49
  else if (currentHeight > 80) {
50
+ // 여기에 height가 526 경우에만 가능
40
51
  // 2단계: 140 → 80
41
- const next = Math.max(80, currentHeight - 4);
42
- currentHeightRef.current = next;
43
- setContentHeight(next);
52
+ if (wrapperHeight <= 526) {
53
+ const next = Math.max(80, currentHeight - 4);
54
+ currentHeightRef.current = next;
55
+ setContentHeight(next);
56
+ }
44
57
  }
45
58
  }
46
59
  // 다시 늘어나는 애니메이션 (2단계)
47
- else if (gap > 1) {
60
+ else if (isExpanding) {
48
61
  if (currentHeight < 140) {
49
62
  // 1단계: 80 → 140
50
63
  const next = Math.min(140, currentHeight + 4);
@@ -52,10 +65,12 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
52
65
  setContentHeight(next);
53
66
  }
54
67
  else if (currentHeight < 210) {
55
- // 2단계: 140 → 210
56
- const next = Math.min(210, currentHeight + 6);
57
- currentHeightRef.current = next;
58
- setContentHeight(next);
68
+ if (wrapperHeight >= 526) {
69
+ // 2단계: 140 → 210
70
+ const next = Math.min(210, currentHeight + 6);
71
+ currentHeightRef.current = next;
72
+ setContentHeight(next);
73
+ }
59
74
  }
60
75
  }
61
76
  };
@@ -74,9 +89,9 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
74
89
  return (<div ref={wrapperRef} className={`
75
90
  no-scrollbar relative w-full rounded-t-[30px]
76
91
  ${isMobile
77
- ? 'flex h-[calc(100dvh-64px)] flex-col items-center justify-between '
78
- : 'flex h-[100vh] flex-col items-center justify-between xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ' +
79
- ' xs:max-h-[626px] xs:min-h-[320px] '}
92
+ ? ` flex h-[calc(100dvh-64px)] flex-col items-center justify-between `
93
+ : ` flex h-[100vh] flex-col items-center justify-between xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ` +
94
+ ` xs:max-h-[626px] xs:min-h-[320px] `}
80
95
  `}>
81
96
  <header className="z-10 flex h-[56px] w-full justify-between rounded-t-[30px] px-[20px]">
82
97
  <div className="dr_talk_subtitle_small flex items-center gap-[2px] pt-[31.5px] text-drTalkGrayscale1">
@@ -90,12 +105,12 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
90
105
 
91
106
  <div className="absolute left-0 top-0 z-0 h-full w-full overflow-hidden">
92
107
  <Image src={backgroundImage} alt="대화 배경" fill className={`${isMobile
93
- ? 'h-full max-h-[360px] w-full object-center will-change-transform'
94
- : 'w-full object-contain object-top will-change-transform'}`}/>
108
+ ? ' h-full max-h-[360px] w-full object-center will-change-transform '
109
+ : ` w-full object-contain object-top will-change-transform `}`}/>
95
110
  </div>
96
111
 
97
- <div className={`relative z-10 px-[20px] ${isMobile ? 'flex w-full justify-center' : 'flex h-full w-full flex-col justify-center'}`}>
98
- <section className={`flex flex-col rounded-[12px] bg-white px-[16px] py-[24px] ${isMobile ? 'w-full' : ''}`} style={{ boxShadow: '0px 4px 10px 0px #00000026' }}>
112
+ <div className={`relative z-10 px-[20px] ${isMobile ? 'flex w-full justify-center' : 'flex h-full w-full flex-col justify-center pb-[34px] xs:h-fit'}`}>
113
+ <section className={` flex flex-col rounded-[12px] bg-white px-[16px] py-[24px] ${isMobile ? 'w-full' : ''}`} style={{ boxShadow: '0px 4px 10px 0px #00000026' }}>
99
114
  {/* 해당 컴포넌트의 최상위 부모와 브라우저 상단과 닿았을 때 우선적으로 해당 부분의 높이가 먼저 줄어들게 하고 싶다*/}
100
115
  <div className="relative">
101
116
  <div ref={containerRef} className="no-scrollbar flex max-h-[210px] min-h-[80px] flex-col overflow-auto" style={{ maxHeight: `${contentHeight}px` }}>
@@ -29,6 +29,7 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
29
29
  const wrapperRef = useRef<HTMLDivElement | null>(null);
30
30
  const [contentHeight, setContentHeight] = useState(210);
31
31
  const currentHeightRef = useRef(210);
32
+ const prevWrapperHeightRef = useRef<number | null>(null);
32
33
 
33
34
  useEffect(() => {
34
35
  const updateContentHeight = () => {
@@ -41,37 +42,52 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
41
42
  return;
42
43
  }
43
44
 
44
- const rect = wrapperRef.current.getBoundingClientRect();
45
+ const rect = wrapperRef.current?.getBoundingClientRect();
45
46
  const gap = rect.top;
47
+ const wrapperHeight = wrapperRef.current.offsetHeight;
46
48
 
47
49
  const currentHeight = currentHeightRef.current;
48
50
 
51
+ // 이전 높이와 비교하여 줄어드는 중인지 판단
52
+ const prevHeight = prevWrapperHeightRef.current;
53
+ const isShrinking = prevHeight !== null && wrapperHeight < prevHeight;
54
+ const isExpanding = prevHeight !== null && wrapperHeight > prevHeight;
55
+
56
+ prevWrapperHeightRef.current = wrapperHeight; // 현재 높이를 저장
57
+
49
58
  // 줄어드는 애니메이션 (2단계)
50
- if (gap <= 1) {
59
+ if (isShrinking) {
51
60
  if (currentHeight > 140) {
52
- // 1단계: 210 → 140
53
- const next = Math.max(140, currentHeight - 6);
54
- currentHeightRef.current = next;
55
- setContentHeight(next);
61
+ if (wrapperHeight <= 625) {
62
+ // 1단계: 210 → 140
63
+ const next = Math.max(140, currentHeight - 6);
64
+ currentHeightRef.current = next;
65
+ setContentHeight(next);
66
+ }
56
67
  } else if (currentHeight > 80) {
68
+ // 여기에 height가 526 경우에만 가능
57
69
  // 2단계: 140 → 80
58
- const next = Math.max(80, currentHeight - 4);
59
- currentHeightRef.current = next;
60
- setContentHeight(next);
70
+ if (wrapperHeight <= 526) {
71
+ const next = Math.max(80, currentHeight - 4);
72
+ currentHeightRef.current = next;
73
+ setContentHeight(next);
74
+ }
61
75
  }
62
76
  }
63
77
  // 다시 늘어나는 애니메이션 (2단계)
64
- else if (gap > 1) {
78
+ else if (isExpanding) {
65
79
  if (currentHeight < 140) {
66
80
  // 1단계: 80 → 140
67
81
  const next = Math.min(140, currentHeight + 4);
68
82
  currentHeightRef.current = next;
69
83
  setContentHeight(next);
70
84
  } else if (currentHeight < 210) {
71
- // 2단계: 140 → 210
72
- const next = Math.min(210, currentHeight + 6);
73
- currentHeightRef.current = next;
74
- setContentHeight(next);
85
+ if (wrapperHeight >= 526) {
86
+ // 2단계: 140 → 210
87
+ const next = Math.min(210, currentHeight + 6);
88
+ currentHeightRef.current = next;
89
+ setContentHeight(next);
90
+ }
75
91
  }
76
92
  }
77
93
  };
@@ -98,9 +114,9 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
98
114
  no-scrollbar relative w-full rounded-t-[30px]
99
115
  ${
100
116
  isMobile
101
- ? 'flex h-[calc(100dvh-64px)] flex-col items-center justify-between '
102
- : 'flex h-[100vh] flex-col items-center justify-between xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ' +
103
- ' xs:max-h-[626px] xs:min-h-[320px] '
117
+ ? ` flex h-[calc(100dvh-64px)] flex-col items-center justify-between `
118
+ : ` flex h-[100vh] flex-col items-center justify-between xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ` +
119
+ ` xs:max-h-[626px] xs:min-h-[320px] `
104
120
  }
105
121
  `}
106
122
  >
@@ -124,17 +140,17 @@ const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClo
124
140
  fill
125
141
  className={`${
126
142
  isMobile
127
- ? 'h-full max-h-[360px] w-full object-center will-change-transform'
128
- : 'w-full object-contain object-top will-change-transform'
143
+ ? ' h-full max-h-[360px] w-full object-center will-change-transform '
144
+ : ` w-full object-contain object-top will-change-transform `
129
145
  }`}
130
146
  />
131
147
  </div>
132
148
 
133
149
  <div
134
- className={`relative z-10 px-[20px] ${isMobile ? 'flex w-full justify-center' : 'flex h-full w-full flex-col justify-center'}`}
150
+ className={`relative z-10 px-[20px] ${isMobile ? 'flex w-full justify-center' : 'flex h-full w-full flex-col justify-center pb-[34px] xs:h-fit'}`}
135
151
  >
136
152
  <section
137
- className={`flex flex-col rounded-[12px] bg-white px-[16px] py-[24px] ${isMobile ? 'w-full' : ''}`}
153
+ className={` flex flex-col rounded-[12px] bg-white px-[16px] py-[24px] ${isMobile ? 'w-full' : ''}`}
138
154
  style={{ boxShadow: '0px 4px 10px 0px #00000026' }}
139
155
  >
140
156
  {/* 해당 컴포넌트의 최상위 부모와 브라우저 상단과 닿았을 때 우선적으로 해당 부분의 높이가 먼저 줄어들게 하고 싶다*/}
@@ -3,22 +3,22 @@ import NoticeIcon from '../../asset/images/daeryuntalk/notice.svg';
3
3
  import PrevIcon from '../../asset/images/daeryuntalk/prev.svg';
4
4
  const NoticeMessage = ({ content, isMobile }) => {
5
5
  const [isExpanded, setIsExpanded] = useState(false);
6
- return (<div className={`bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]`}>
6
+ return (<button type={'button'} onClick={() => setIsExpanded(!isExpanded)} className={`bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]`} aria-label={isExpanded ? '접기' : '펼치기'}>
7
7
  <div className="flex items-start gap-[8px]">
8
8
  <div className="flex-shrink-0">
9
9
  <NoticeIcon width={24} height={24}/>
10
10
  </div>
11
11
  <div className="">
12
- <div className={`dr_talk_body_medium2 overflow-hidden pt-[0.5px] ${isExpanded ? '' : 'line-clamp-2'}`}>
12
+ <div className={`dr_talk_body_medium2 overflow-hidden whitespace-pre-line break-words pt-[0.5px] text-left ${isExpanded ? '' : 'line-clamp-2'}`}>
13
13
  {content}
14
14
  </div>
15
15
  </div>
16
- <button onClick={() => setIsExpanded(!isExpanded)} className="ml-1 flex-shrink-0 transform transition-transform duration-200" aria-label={isExpanded ? '접기' : '펼치기'}>
16
+ <div className="ml-1 flex-shrink-0 transform transition-transform duration-200">
17
17
  <div className={`transform transition-transform duration-200 ${isExpanded ? 'rotate-90' : '-rotate-90'}`}>
18
18
  <PrevIcon width={24} height={24}/>
19
19
  </div>
20
- </button>
20
+ </div>
21
21
  </div>
22
- </div>);
22
+ </button>);
23
23
  };
24
24
  export default NoticeMessage;