@daeryun/dr_components 1.2.13 → 1.2.14

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 (79) hide show
  1. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  2. package/dist/components/Daeryuntalk/ChatButton.jsx +2 -2
  3. package/dist/components/Daeryuntalk/ChatButton.tsx +2 -2
  4. package/dist/components/Daeryuntalk/ChatConversation.d.ts +2 -0
  5. package/dist/components/Daeryuntalk/ChatConversation.jsx +23 -35
  6. package/dist/components/Daeryuntalk/ChatConversation.tsx +43 -51
  7. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +12 -9
  8. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +18 -8
  9. package/dist/components/Daeryuntalk/ChatHomeView.d.ts +5 -1
  10. package/dist/components/Daeryuntalk/ChatHomeView.jsx +5 -6
  11. package/dist/components/Daeryuntalk/ChatHomeView.tsx +28 -13
  12. package/dist/components/Daeryuntalk/ChatInput.jsx +12 -7
  13. package/dist/components/Daeryuntalk/ChatInput.tsx +14 -7
  14. package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.jsx +1 -0
  15. package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.tsx +1 -0
  16. package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +11 -6
  17. package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +19 -5
  18. package/dist/components/Daeryuntalk/ChatItem/ChatLoading.jsx +1 -0
  19. package/dist/components/Daeryuntalk/ChatItem/ChatLoading.tsx +1 -0
  20. package/dist/components/Daeryuntalk/ChatItem/ChatPrivacyAuth.jsx +1 -0
  21. package/dist/components/Daeryuntalk/ChatItem/ChatPrivacyAuth.tsx +1 -0
  22. package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.jsx +1 -0
  23. package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.tsx +1 -0
  24. package/dist/components/Daeryuntalk/ChatItem/RichText.jsx +1 -0
  25. package/dist/components/Daeryuntalk/ChatItem/RichText.tsx +1 -0
  26. package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.jsx +1 -0
  27. package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.tsx +1 -0
  28. package/dist/components/Daeryuntalk/ChatItem/TypingComp.jsx +7 -2
  29. package/dist/components/Daeryuntalk/ChatItem/TypingComp.tsx +7 -3
  30. package/dist/components/Daeryuntalk/ChatItem/WorkFlowAuthForm.jsx +1 -0
  31. package/dist/components/Daeryuntalk/ChatItem/WorkFlowAuthForm.tsx +1 -0
  32. package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.jsx +1 -0
  33. package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.tsx +1 -0
  34. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.jsx +1 -0
  35. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.tsx +1 -0
  36. package/dist/components/Daeryuntalk/ChatMessage.jsx +9 -5
  37. package/dist/components/Daeryuntalk/ChatMessage.tsx +11 -4
  38. package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.jsx +8 -3
  39. package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.tsx +12 -3
  40. package/dist/components/Daeryuntalk/ChatObject/ObjectBack.jsx +7 -4
  41. package/dist/components/Daeryuntalk/ChatObject/ObjectBack.tsx +13 -3
  42. package/dist/components/Daeryuntalk/ChatObject/ObjectButton.jsx +1 -0
  43. package/dist/components/Daeryuntalk/ChatObject/ObjectButton.tsx +1 -0
  44. package/dist/components/Daeryuntalk/ChatWidget.d.ts +2 -0
  45. package/dist/components/Daeryuntalk/ChatWidget.jsx +50 -5
  46. package/dist/components/Daeryuntalk/ChatWidget.tsx +71 -5
  47. package/dist/components/Daeryuntalk/DateSeparator.jsx +1 -0
  48. package/dist/components/Daeryuntalk/DateSeparator.tsx +1 -0
  49. package/dist/components/Daeryuntalk/History/AuthForm.jsx +1 -0
  50. package/dist/components/Daeryuntalk/History/AuthForm.tsx +1 -0
  51. package/dist/components/Daeryuntalk/HistoryView.jsx +18 -12
  52. package/dist/components/Daeryuntalk/HistoryView.tsx +29 -11
  53. package/dist/components/Daeryuntalk/HomeView.jsx +17 -12
  54. package/dist/components/Daeryuntalk/HomeView.tsx +29 -12
  55. package/dist/components/Daeryuntalk/NavigationFooter.jsx +8 -5
  56. package/dist/components/Daeryuntalk/NavigationFooter.tsx +10 -4
  57. package/dist/components/Daeryuntalk/NoticeMessage.jsx +10 -4
  58. package/dist/components/Daeryuntalk/NoticeMessage.tsx +10 -4
  59. package/dist/components/Daeryuntalk/Tiptap/Tiptap.jsx +1 -0
  60. package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +1 -0
  61. package/dist/components/Daeryuntalk/Toast/Toast.jsx +1 -0
  62. package/dist/components/Daeryuntalk/Toast/Toast.tsx +1 -0
  63. package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +10 -7
  64. package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +19 -6
  65. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +22 -14
  66. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +59 -13
  67. package/dist/components/Daeryuntalk/ViewportHandler.jsx +2 -0
  68. package/dist/components/Daeryuntalk/ViewportHandler.tsx +1 -0
  69. package/dist/components/Daeryuntalk/_lib/utils.d.ts +1 -1
  70. package/dist/components/Daeryuntalk/_lib/utils.js +1 -1
  71. package/dist/components/Daeryuntalk/_lib/utils.ts +1 -1
  72. package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.jsx +3 -2
  73. package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.tsx +5 -2
  74. package/dist/components/Daeryuntalk/index.jsx +61 -34
  75. package/dist/components/Daeryuntalk/index.tsx +71 -40
  76. package/dist/styles/daeryuntalk.css +4 -4
  77. package/dist/styles/globals.css +0 -4
  78. package/dist/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import React, { useEffect, useMemo, useRef, useState } from 'react';
2
3
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
4
  import ChatMessage from './ChatMessage';
@@ -29,22 +30,26 @@ type ChatConversationProps = {
29
30
  isAuthenticated: boolean;
30
31
  historyList: History[];
31
32
  ageCheckStatus: AgeCheckStatusEnums | null;
33
+ isMobileSafari?: boolean;
34
+ androidViewportHeight?: number;
32
35
  };
33
36
 
34
37
  const ChatConversation: React.FC<ChatConversationProps> = ({
35
- // onBackClick,
36
- onChatNew,
37
- isActive,
38
- isMobile,
39
- onClose,
40
- isHash,
41
- initialLoading,
42
- viewState,
43
- handleHistoryClick,
44
- isAuthenticated,
45
- historyList,
46
- ageCheckStatus
47
- }) => {
38
+ // onBackClick,
39
+ onChatNew,
40
+ isActive,
41
+ isMobile,
42
+ onClose,
43
+ isHash,
44
+ initialLoading,
45
+ viewState,
46
+ handleHistoryClick,
47
+ isAuthenticated,
48
+ historyList,
49
+ ageCheckStatus,
50
+ isMobileSafari = false,
51
+ androidViewportHeight = 0
52
+ }) => {
48
53
  const {
49
54
  getNextMessageList,
50
55
  isNextPage,
@@ -72,7 +77,6 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
72
77
 
73
78
  const headerRef = useRef<HTMLDivElement | null>(null);
74
79
  const pcBottomRef = useRef<HTMLDivElement | null>(null);
75
- const mobileBottomRef = useRef<HTMLDivElement | null>(null);
76
80
  const [bottomHeight, setBottomHeight] = useState(0);
77
81
 
78
82
  const isClosed = inquiryStatus === InquiryStatusEnum.CLOSED;
@@ -88,41 +92,24 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
88
92
  const { style: hoverStyle } = useHoverScrollbar(messagesContainerRef, [messages.length]);
89
93
 
90
94
  useEffect(() => {
91
- if (!mobileBottomRef.current || !pcBottomRef.current) return;
95
+ const bottomRef = pcBottomRef;
92
96
 
93
- // 현재 브라우저 크기에 따라 참조할 요소 결정
94
- // - 모바일이거나 화면 너비가 480px 이하인 경우: mobileBottomRef 추적
95
- // - 그 외에는 pcBottomRef 추적
96
- const bottomRef = windowSize.width <= 480 ? pcBottomRef : pcBottomRef;
97
+ let retries = 10;
97
98
 
98
- const updateHeight = () => {
99
+ const tryMeasure = () => {
99
100
  const height = bottomRef.current?.getBoundingClientRect().height ?? 0;
100
- setBottomHeight(height);
101
- };
102
-
103
- updateHeight(); // 초기 높이 측정
104
-
105
- const resizeObserver = new ResizeObserver(updateHeight);
101
+ console.log('measure:', height);
106
102
 
107
- if (bottomRef.current) {
108
- // bottomRef 요소의 크기 변화를 감지
109
- resizeObserver.observe(bottomRef?.current);
110
-
111
- // TipTap 에디터 내부 `.tiptap-editor-wrapper` 요소도 함께 감지
112
- const tiptapWrapper = bottomRef?.current?.querySelector('.tiptap-editor-wrapper');
113
- if (tiptapWrapper) {
114
- resizeObserver.observe(tiptapWrapper);
103
+ if (height > 0 || retries-- <= 0) {
104
+ setBottomHeight(height);
105
+ } else {
106
+ requestAnimationFrame(tryMeasure);
115
107
  }
116
- }
108
+ };
117
109
 
118
- // 윈도우 리사이즈 시 높이 재측정
119
- window.addEventListener('resize', updateHeight);
110
+ tryMeasure();
111
+ }, [windowSize.width]);
120
112
 
121
- return () => {
122
- resizeObserver.disconnect();
123
- window.removeEventListener('resize', updateHeight);
124
- };
125
- }, []);
126
113
 
127
114
  const defaultNoticeContent = inquiryMainData?.channel_explanation || '';
128
115
 
@@ -292,11 +279,13 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
292
279
  ageConfirm(chatInquiryNumber || '', AgeCheckStatusEnums.AGREED);
293
280
  };
294
281
 
282
+
295
283
  return (
296
284
  <>
297
285
  {/*isMoblie true일때 헤더 주의 내용이 상단에 있고 ,나머지 높이영역은 메시지 리스트로 붙게*/}
298
286
  <div
299
- className={` flex ${isMobile ? 'h-full' : 'h-[100vh]'} flex-col items-center justify-between xs:h-[calc(100vh-165px)] xs:max-h-[690px] lg:h-[calc(100vh-110px)] `}
287
+ className={` flex ${isMobile ? ' h-full' : 'h-[100vh]'} flex-col items-center justify-between xs:h-[calc(100vh-165px)] xs:max-h-[690px] lg:h-[calc(100vh-110px)] `
288
+ }
300
289
  >
301
290
  <div
302
291
  className={`
@@ -319,6 +308,7 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
319
308
  isAuthenticated={isAuthenticated}
320
309
  historyList={historyList}
321
310
  />
311
+
322
312
  <NoticeMessage content={noticeContent} isMobile={isMobile} />
323
313
  </div>
324
314
  {/* 메시지 노출 부분 -> 무한스크롤 변환 필요 */}
@@ -326,14 +316,16 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
326
316
  <div
327
317
  ref={messagesContainerRef}
328
318
  className={`
329
- ${isMobile ? `${isLoading ? ' pb-[50px]' : ''} mx-[20px] overflow-y-auto ` : 'flex- ml-[20px] mr-[5px] xs:pb-[100px] '} overlay-scrollbar overflow-auto pt-[20px]
319
+ ${isMobile ? ` ${isLoading ? ' pb-[50px]' : ''} mx-[20px] overflow-y-auto ` : 'flex- ml-[20px] mr-[5px] xs:pb-[100px] '} overlay-scrollbar overflow-auto pt-[20px]
330
320
  `}
331
321
  style={{
332
- height: isMobile
333
- ? `calc(100vh - ${bottomHeight}px - ${headerRef.current?.offsetHeight || 0}px)`
322
+ height: isMobile ?
323
+ isMobileSafari ?
324
+ `calc(100vh - ${bottomHeight}px - ${headerRef.current?.offsetHeight || 0}px)`
325
+ : `100%`
334
326
  : bottomHeight && headerRef.current
335
- ? `calc(100% - ${bottomHeight}px - ${headerRef.current?.offsetHeight}px)`
336
- : '100%', // fallback
327
+ ? `calc(100% - ${bottomHeight}px - ${headerRef.current?.offsetHeight}px)`
328
+ : '100%', // fallback
337
329
  ...(!isMobile ? hoverStyle : {})
338
330
  }}
339
331
  >
@@ -367,8 +359,8 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
367
359
  <div ref={pcBottomRef} className={`!z-[50] w-full`}>
368
360
  {/* 높이가 부모에 스크롤이 줄어도 해당 부분은 바텀에 고정 필요 */}
369
361
  {isClosed ? (
370
- <div className="w-full border-t border-drTalkGrayscale4 px-[20px] py-[16px]">
371
- <div className="">
362
+ <div className='w-full border-t border-drTalkGrayscale4 px-[20px] py-[16px]'>
363
+ <div className=''>
372
364
  <Button3
373
365
  onClick={() => {
374
366
  onChatNew && onChatNew();
@@ -380,7 +372,7 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
380
372
  </div>
381
373
  </div>
382
374
  ) : (
383
- <div className=" w-full border-t border-drTalkGrayscale4 px-[20px] py-[8px]">
375
+ <div className=' w-full border-t border-drTalkGrayscale4 px-[20px] py-[8px]'>
384
376
  <ChatInput
385
377
  isMobile={isMobile}
386
378
  isNotAgeCheck={isNotAgeCheck}
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
  import Image from 'next/image';
3
- // 이미지
4
- import HistoryNewbadge from '../../../asset/images/daeryuntalk/history-new-badge.png';
5
- import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
6
- import PrevIcon from '../../../asset/images/daeryuntalk/prev.svg';
7
- import CloseSvgIcon from '../../../asset/images/daeryuntalk/close.svg';
8
- import HistoryIcon from '../../../asset/images/daeryuntalk/history-icon.png';
9
3
  const ChatConversationHeader = ({ inquiryMainData, isMobile, onClose, isHash,
10
4
  // onBackClick,
11
5
  viewState, onHistoryClick, isAuthenticated, historyList }) => {
6
+ const s3Url = process.env.NEXT_PUBLIC_S3_URL;
7
+ const HistoryNewbadge = `${s3Url}/daeryuntalk/history-new-badge.png`;
8
+ const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
9
+ const PrevIcon = `${s3Url}/daeryuntalk/prev.svg`;
10
+ const CloseSvgIcon = `${s3Url}/daeryuntalk/close.svg`;
11
+ const HistoryIcon = `${s3Url}/daeryuntalk/history-icon.png`;
12
12
  const channelName = (inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_name) || '';
13
13
  const logoImageUrl = (inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_logo_image_url) || '';
14
14
  const unreadCount = historyList.length > 0 ? historyList.reduce((sum, item) => sum + (item.unread_message_count || 0), 0) : 0;
@@ -31,16 +31,19 @@ viewState, onHistoryClick, isAuthenticated, historyList }) => {
31
31
  <Image src={HistoryNewbadge} alt="뉴 히스토리 뱃지" width={12} height={12}/>
32
32
  </div>
33
33
  </button>) : (<button className={`flex h-[28px] w-[28px] items-center justify-center `} aria-label="이전" onClick={handleBackClick}>
34
- <PrevIcon width={28} height={28}/>
34
+ <Image src={PrevIcon} alt="이전" width={28} height={28}/>
35
+ {/* <PrevIcon width={28} height={28} /> */}
35
36
  </button>)}
36
37
  <div className="flex items-center gap-[10px] ">
37
- {logoImageUrl ? (<Image src={logoImageUrl} alt="로고" width={28} height={28} className=""/>) : (<DaeryunLogoIcon width={28} height={28}/>)}
38
+ {logoImageUrl ? (<Image src={logoImageUrl} alt="로고" width={28} height={28} className=""/>) : (<Image src={DaeryunLogoIcon} alt="대륜 로고" width={28} height={28}/>)}
39
+ {/* <DaeryunLogoIcon width={28} height={28} /> */}
38
40
  <p className={`dr_talk_title_small text-drTalkBlack`}>{channelName}</p>
39
41
  </div>
40
42
  <div
41
43
  // className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : ' xs:pointer-events-none xs:!opacity-0 '} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
42
44
  className={`py-[14px] text-black hover:cursor-pointer`} onClick={onClose}>
43
- <CloseSvgIcon width={28} height={28}/>
45
+ <Image src={CloseSvgIcon} alt="닫기" width={28} height={28}/>
46
+ {/* <CloseSvgIcon width={28} height={28} /> */}
44
47
  </div>
45
48
  </div>);
46
49
  };
@@ -5,11 +5,11 @@ import { ViewState } from '../ChatHomeView';
5
5
  import { History } from '../_api/daeryuntalk/type/response';
6
6
 
7
7
  // 이미지
8
- import HistoryNewbadge from '../../../asset/images/daeryuntalk/history-new-badge.png';
9
- import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
10
- import PrevIcon from '../../../asset/images/daeryuntalk/prev.svg';
11
- import CloseSvgIcon from '../../../asset/images/daeryuntalk/close.svg';
12
- import HistoryIcon from '../../../asset/images/daeryuntalk/history-icon.png';
8
+ // import HistoryNewbadge from '../../../asset/images/daeryuntalk/history-new-badge.png';
9
+ // import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
10
+ // import PrevIcon from '../../../asset/images/daeryuntalk/prev.svg';
11
+ // import CloseSvgIcon from '../../../asset/images/daeryuntalk/close.svg';
12
+ // import HistoryIcon from '../../../asset/images/daeryuntalk/history-icon.png';
13
13
 
14
14
  interface IChatConversationHeaderProps {
15
15
  inquiryMainData: IChatInquiryMainDataResponse | null;
@@ -34,6 +34,13 @@ const ChatConversationHeader = ({
34
34
  isAuthenticated,
35
35
  historyList
36
36
  }: IChatConversationHeaderProps) => {
37
+ const s3Url = process.env.NEXT_PUBLIC_S3_URL;
38
+ const HistoryNewbadge = `${s3Url}/daeryuntalk/history-new-badge.png`;
39
+ const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
40
+ const PrevIcon = `${s3Url}/daeryuntalk/prev.svg`;
41
+ const CloseSvgIcon = `${s3Url}/daeryuntalk/close.svg`;
42
+ const HistoryIcon = `${s3Url}/daeryuntalk/history-icon.png`;
43
+
37
44
  const channelName = inquiryMainData?.channel_name || '';
38
45
  const logoImageUrl = inquiryMainData?.channel_logo_image_url || '';
39
46
  const unreadCount =
@@ -73,15 +80,17 @@ const ChatConversationHeader = ({
73
80
  aria-label="이전"
74
81
  onClick={handleBackClick}
75
82
  >
76
- <PrevIcon width={28} height={28} />
83
+ <Image src={PrevIcon} alt="이전" width={28} height={28} />
84
+ {/* <PrevIcon width={28} height={28} /> */}
77
85
  </button>
78
86
  )}
79
87
  <div className="flex items-center gap-[10px] ">
80
88
  {logoImageUrl ? (
81
89
  <Image src={logoImageUrl} alt="로고" width={28} height={28} className="" />
82
90
  ) : (
83
- <DaeryunLogoIcon width={28} height={28} />
91
+ <Image src={DaeryunLogoIcon} alt="대륜 로고" width={28} height={28} />
84
92
  )}
93
+ {/* <DaeryunLogoIcon width={28} height={28} /> */}
85
94
  <p className={`dr_talk_title_small text-drTalkBlack`}>{channelName}</p>
86
95
  </div>
87
96
  <div
@@ -89,7 +98,8 @@ const ChatConversationHeader = ({
89
98
  className={`py-[14px] text-black hover:cursor-pointer`}
90
99
  onClick={onClose}
91
100
  >
92
- <CloseSvgIcon width={28} height={28} />
101
+ <Image src={CloseSvgIcon} alt="닫기" width={28} height={28} />
102
+ {/* <CloseSvgIcon width={28} height={28} /> */}
93
103
  </div>
94
104
  </div>
95
105
  );
@@ -1,10 +1,14 @@
1
- import React from 'react';
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
2
  export type ViewState = 'conversation' | 'history';
3
3
  type ChatHomeViewProps = {
4
4
  hashValue: string | null;
5
5
  isMobile: boolean;
6
6
  isHash: boolean;
7
7
  onClose: () => void;
8
+ androidViewportHeight?: number;
9
+ isMobileSafari?: boolean;
10
+ viewState: ViewState;
11
+ setViewState: Dispatch<SetStateAction<ViewState>>;
8
12
  };
9
13
  declare const ChatHomeView: React.FC<ChatHomeViewProps>;
10
14
  export default ChatHomeView;
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useState } from 'react';
1
+ 'use client';
2
+ import React, { useEffect } from 'react';
2
3
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
4
  import ChatConversation from './ChatConversation';
4
5
  import HistoryView from './HistoryView';
@@ -6,9 +7,7 @@ import { useChatSocketState } from './_hooks/view/useChatSocketState';
6
7
  import ToastRenderer from './Toast/ToastRender';
7
8
  import { useHistoryView } from './_hooks/view/useHistoryView';
8
9
  import FixedErrorBox from './FixedErrorBox';
9
- const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
10
- const [viewState, setViewState] = useState('conversation');
11
- // const [isLoading, setIsLoading] = useState<boolean>(false);
10
+ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash, isMobileSafari = false, androidViewportHeight = 0, viewState, setViewState }) => {
12
11
  const { isUserExpired, isConnected, isAuthenticated, historyList, ageCheckStatus,
13
12
  // inquiryMainData,
14
13
  chatInquiryNumber,
@@ -98,7 +97,7 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
98
97
  `}
99
98
 
100
99
  `}>
101
- <div className=" flex h-full flex-col justify-between border-[0px] border-solid xs:justify-start xs:rounded-[30px]">
100
+ <div className=' flex h-full flex-col justify-between border-[0px] border-solid xs:justify-start xs:rounded-[30px]'>
102
101
  <div className={`
103
102
  no-scrollbar ${isMobile ? 'h-full' : ` overflow-hidden xs:overflow-auto `}
104
103
  `}>
@@ -130,7 +129,7 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
130
129
  // if (viewState === 'conversation') {
131
130
  return renderWithNavigation(<ChatConversation
132
131
  // onBackClick={handleBackToHome}
133
- isActive={viewState === 'conversation'} initialLoading={initialLoading} onChatNew={handleNewStartChat} isMobile={isMobile} onClose={onClose} isHash={isHash} viewState={viewState} handleHistoryClick={handleHistoryClick} isAuthenticated={isAuthenticated !== null && isAuthenticated !== void 0 ? isAuthenticated : false} historyList={historyList !== null && historyList !== void 0 ? historyList : []} ageCheckStatus={ageCheckStatus}/>, 'conversation');
132
+ isActive={viewState === 'conversation'} initialLoading={initialLoading} onChatNew={handleNewStartChat} isMobile={isMobile} onClose={onClose} isHash={isHash} viewState={viewState} handleHistoryClick={handleHistoryClick} isAuthenticated={isAuthenticated !== null && isAuthenticated !== void 0 ? isAuthenticated : false} historyList={historyList !== null && historyList !== void 0 ? historyList : []} ageCheckStatus={ageCheckStatus} isMobileSafari={isMobileSafari} androidViewportHeight={androidViewportHeight}/>, 'conversation');
134
133
  // }
135
134
  // // 홈
136
135
  // return renderWithNavigation(
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useState } from 'react';
1
+ 'use client';
2
+ import React, { Dispatch, SetStateAction, useEffect, useState } from 'react';
2
3
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
4
  import ChatConversation from './ChatConversation';
4
5
  import HistoryView from './HistoryView';
@@ -14,10 +15,21 @@ type ChatHomeViewProps = {
14
15
  isMobile: boolean;
15
16
  isHash: boolean;
16
17
  onClose: () => void;
18
+ androidViewportHeight?: number;
19
+ isMobileSafari?: boolean;
20
+ viewState:ViewState
21
+ setViewState:Dispatch<SetStateAction<ViewState>>;
17
22
  };
18
- const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobile, isHash }) => {
19
- const [viewState, setViewState] = useState<ViewState>('conversation');
20
- // const [isLoading, setIsLoading] = useState<boolean>(false);
23
+ const ChatHomeView: React.FC<ChatHomeViewProps> = ({
24
+ hashValue,
25
+ onClose,
26
+ isMobile,
27
+ isHash,
28
+ isMobileSafari = false,
29
+ androidViewportHeight = 0,
30
+ viewState,
31
+ setViewState
32
+ }) => {
21
33
 
22
34
  const {
23
35
  isUserExpired,
@@ -137,27 +149,28 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
137
149
  className={`
138
150
  relative overflow-hidden
139
151
  ${
140
- isMobile
141
- ? `h-full w-screen rounded-[0px]`
142
- : `
152
+ isMobile
153
+ ? `h-full w-screen rounded-[0px]`
154
+ : `
143
155
  ${
144
- isHash
145
- ? `
156
+ isHash
157
+ ? `
146
158
  h-[100dvh] w-full rounded-[0px]
147
159
  xs:max-h-[690px] xs:w-[390px] xs:rounded-[30px]
148
160
  xs:shadow-[0px_12px_60px_5px_rgba(0,0,0,0.3)]
149
161
  `
150
- : `
162
+ : `
151
163
  w-screen rounded-[0px]
152
164
  xs:w-[390px] xs:rounded-[30px]
153
165
  `
154
- }
166
+ }
155
167
  `
156
- }
168
+ }
157
169
 
158
170
  `}
159
171
  >
160
- <div className=" flex h-full flex-col justify-between border-[0px] border-solid xs:justify-start xs:rounded-[30px]">
172
+ <div
173
+ className=' flex h-full flex-col justify-between border-[0px] border-solid xs:justify-start xs:rounded-[30px]'>
161
174
  <div
162
175
  className={`
163
176
  no-scrollbar ${isMobile ? 'h-full' : ` overflow-hidden xs:overflow-auto `}
@@ -225,6 +238,8 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
225
238
  isAuthenticated={isAuthenticated ?? false}
226
239
  historyList={historyList ?? []}
227
240
  ageCheckStatus={ageCheckStatus}
241
+ isMobileSafari={isMobileSafari}
242
+ androidViewportHeight={androidViewportHeight}
228
243
  />,
229
244
  'conversation'
230
245
  );
@@ -1,18 +1,22 @@
1
- import React, { useEffect, useRef, useState } from 'react';
1
+ 'use client';
2
+ import React, { useMemo, useRef, useState } from 'react';
2
3
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
4
  import Tiptap from './Tiptap/Tiptap';
4
5
  import { stripHtmlTags } from './_lib/utils';
5
6
  import DisabledInput from './Tiptap/DisabledInput';
6
- // 이미지
7
- import SendIcon from '../../asset/images/daeryuntalk/send.svg';
7
+ import Image from 'next/image';
8
8
  const ChatInput = ({ isMobile, isNotAgeCheck, chatInquiryNumber }) => {
9
+ const s3Url = process.env.NEXT_PUBLIC_S3_URL;
10
+ const SendIcon = `${s3Url}/daeryuntalk/send.svg`;
9
11
  const [message, setMessage] = useState('');
10
12
  const { sendMessage, isLoading } = useDaeryuntalk();
11
13
  const tiptapRef = useRef(null);
12
- const [isEmpty, setIsEmpty] = useState(false);
13
- useEffect(() => {
14
- setIsEmpty(!stripHtmlTags(message));
14
+ const isEmpty = useMemo(() => {
15
+ return !stripHtmlTags(message);
15
16
  }, [message]);
17
+ // useEffect(() => {
18
+ // setIsEmpty(!stripHtmlTags(message));
19
+ // }, [message]);
16
20
  const handleSubmit = (e) => {
17
21
  var _a, _b, _c;
18
22
  e.preventDefault();
@@ -49,7 +53,8 @@ const ChatInput = ({ isMobile, isNotAgeCheck, chatInquiryNumber }) => {
49
53
  ? ' bg-drTalkBtnActive2 '
50
54
  : ' bg-drTalkCrimson '}`} disabled={isLoading || isNotAgeCheck}>
51
55
  <div className="flex h-9 w-9 items-center justify-center">
52
- <SendIcon width={24} height={24}/>
56
+ <Image src={SendIcon} alt="전송" width={24} height={24}/>
57
+ {/* <SendIcon width={24} height={24} /> */}
53
58
  </div>
54
59
  </button>
55
60
  </div>
@@ -1,11 +1,13 @@
1
- import React, { useEffect, useRef, useState } from 'react';
1
+ 'use client';
2
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
2
3
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
4
  import Tiptap, { TiptapEditorRef } from './Tiptap/Tiptap';
4
5
  import { stripHtmlTags } from './_lib/utils';
5
6
  import DisabledInput from './Tiptap/DisabledInput';
7
+ import Image from 'next/image';
6
8
 
7
9
  // 이미지
8
- import SendIcon from '../../asset/images/daeryuntalk/send.svg';
10
+ // import SendIcon from '../../asset/images/daeryuntalk/send.svg';
9
11
 
10
12
  interface props {
11
13
  isMobile: boolean;
@@ -14,14 +16,18 @@ interface props {
14
16
  }
15
17
 
16
18
  const ChatInput: React.FC<props> = ({ isMobile, isNotAgeCheck, chatInquiryNumber }) => {
19
+ const s3Url = process.env.NEXT_PUBLIC_S3_URL;
20
+ const SendIcon = `${s3Url}/daeryuntalk/send.svg`;
17
21
  const [message, setMessage] = useState('');
18
22
  const { sendMessage, isLoading } = useDaeryuntalk();
19
23
  const tiptapRef = useRef<TiptapEditorRef | null>(null);
20
- const [isEmpty, setIsEmpty] = useState<boolean>(false);
21
-
22
- useEffect(() => {
23
- setIsEmpty(!stripHtmlTags(message));
24
+ const isEmpty = useMemo(() => {
25
+ return !stripHtmlTags(message);
24
26
  }, [message]);
27
+
28
+ // useEffect(() => {
29
+ // setIsEmpty(!stripHtmlTags(message));
30
+ // }, [message]);
25
31
  const handleSubmit = (e: React.FormEvent) => {
26
32
  e.preventDefault();
27
33
  if (message.trim() && !isLoading) {
@@ -79,7 +85,8 @@ const ChatInput: React.FC<props> = ({ isMobile, isNotAgeCheck, chatInquiryNumber
79
85
  disabled={isLoading || isNotAgeCheck}
80
86
  >
81
87
  <div className="flex h-9 w-9 items-center justify-center">
82
- <SendIcon width={24} height={24} />
88
+ <Image src={SendIcon} alt="전송" width={24} height={24} />
89
+ {/* <SendIcon width={24} height={24} /> */}
83
90
  </div>
84
91
  </button>
85
92
  </div>
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import React, { useState } from 'react';
2
3
  import CheckBox2 from '../_ui/checkboxs/CheckBox2';
3
4
  import Button4 from '../_ui/buttons/Button4';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import React, { useState } from 'react';
2
3
  import CheckBox2 from '../_ui/checkboxs/CheckBox2';
3
4
  import Button4 from '../_ui/buttons/Button4';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -13,8 +14,8 @@ import { formatFileSize } from '../_lib/utils';
13
14
  import { useDaeryuntalk } from '../DaeryuntalkContext';
14
15
  import { getMessageFileDownloadUrl } from '../_api';
15
16
  import TimeWrapper from './TimeWrapper';
16
- //이미지
17
- import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
17
+ const s3Url = process.env.NEXT_PUBLIC_S3_URL;
18
+ const FileDownLoadIcon = `${s3Url}/daeryuntalk/viewer/gray-download.svg`;
18
19
  const ChatFile = ({ message, isOperator, isHovered, time }) => {
19
20
  const { openImageViewer } = useDaeryuntalk();
20
21
  const handleDownload = (file) => __awaiter(void 0, void 0, void 0, function* () {
@@ -72,7 +73,8 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
72
73
  e.stopPropagation();
73
74
  yield handleDownload(file);
74
75
  })} 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">
75
- <FileDownLoadIcon className="h-[25px] w-[24px]"/>
76
+ <Image src={FileDownLoadIcon} alt="다운로드" width={25} height={24}/>
77
+ {/* <FileDownLoadIcon className="h-[25px] w-[24px]" /> */}
76
78
  </button>
77
79
  </div>);
78
80
  })}
@@ -92,7 +94,8 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
92
94
  yield handleDownload(media.images[media.images.length - 1]);
93
95
  }
94
96
  })} 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">
95
- <FileDownLoadIcon className="h-[25px] w-[24px]"/>
97
+ <Image src={FileDownLoadIcon} alt="다운로드" width={25} height={24}/>
98
+ {/* <FileDownLoadIcon className="h-[25px] w-[24px]" /> */}
96
99
  </button>
97
100
  </div>
98
101
  </div>)}
@@ -111,7 +114,8 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
111
114
  yield handleDownload(media.images[0]);
112
115
  }
113
116
  })} 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">
114
- <FileDownLoadIcon className="h-[25px] w-[24px]"/>
117
+ <Image src={FileDownLoadIcon} alt="다운로드" width={25} height={24}/>
118
+ {/* <FileDownLoadIcon className="h-[25px] w-[24px]" /> */}
115
119
  </button>
116
120
  </div>
117
121
  </div>)}
@@ -142,7 +146,8 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
142
146
  e.stopPropagation();
143
147
  yield handleDownload(file);
144
148
  })} className="flex h-[24px] w-[24px] items-center justify-center ">
145
- <FileDownLoadIcon className="h-[25px] w-[24px] bg-white"/>
149
+ <Image src={FileDownLoadIcon} alt="다운로드" width={25} height={24} className="bg-white"/>
150
+ {/* <FileDownLoadIcon className="h-[25px] w-[24px] bg-white" /> */}
146
151
  </button>
147
152
  </div>
148
153
  </div>);
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import React from 'react';
2
3
  import { FileInfo, Message } from '../_types/message';
3
4
  import Image from 'next/image';
@@ -6,7 +7,7 @@ import { useDaeryuntalk } from '../DaeryuntalkContext';
6
7
  import { getMessageFileDownloadUrl } from '../_api';
7
8
  import TimeWrapper from './TimeWrapper';
8
9
  //이미지
9
- import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
10
+ // import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
10
11
 
11
12
  interface props {
12
13
  message: Message;
@@ -15,6 +16,9 @@ interface props {
15
16
  time: string;
16
17
  }
17
18
 
19
+ const s3Url = process.env.NEXT_PUBLIC_S3_URL;
20
+ const FileDownLoadIcon = `${s3Url}/daeryuntalk/viewer/gray-download.svg`;
21
+
18
22
  const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
19
23
  const { openImageViewer } = useDaeryuntalk();
20
24
 
@@ -96,7 +100,8 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
96
100
  }}
97
101
  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"
98
102
  >
99
- <FileDownLoadIcon className="h-[25px] w-[24px]" />
103
+ <Image src={FileDownLoadIcon} alt="다운로드" width={25} height={24} />
104
+ {/* <FileDownLoadIcon className="h-[25px] w-[24px]" /> */}
100
105
  </button>
101
106
  </div>
102
107
  );
@@ -131,7 +136,8 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
131
136
  }}
132
137
  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"
133
138
  >
134
- <FileDownLoadIcon className="h-[25px] w-[24px]" />
139
+ <Image src={FileDownLoadIcon} alt="다운로드" width={25} height={24} />
140
+ {/* <FileDownLoadIcon className="h-[25px] w-[24px]" /> */}
135
141
  </button>
136
142
  </div>
137
143
  </div>
@@ -165,7 +171,8 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
165
171
  }}
166
172
  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"
167
173
  >
168
- <FileDownLoadIcon className="h-[25px] w-[24px]" />
174
+ <Image src={FileDownLoadIcon} alt="다운로드" width={25} height={24} />
175
+ {/* <FileDownLoadIcon className="h-[25px] w-[24px]" /> */}
169
176
  </button>
170
177
  </div>
171
178
  </div>
@@ -208,7 +215,14 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
208
215
  }}
209
216
  className="flex h-[24px] w-[24px] items-center justify-center "
210
217
  >
211
- <FileDownLoadIcon className="h-[25px] w-[24px] bg-white" />
218
+ <Image
219
+ src={FileDownLoadIcon}
220
+ alt="다운로드"
221
+ width={25}
222
+ height={24}
223
+ className="bg-white"
224
+ />
225
+ {/* <FileDownLoadIcon className="h-[25px] w-[24px] bg-white" /> */}
212
226
  </button>
213
227
  </div>
214
228
  </div>
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import React from 'react';
2
3
  const ChatLoading = ({ outerClass }) => {
3
4
  return (<div className={`flex justify-start pl-8 ${outerClass}`}>