@daeryun/dr_components 1.2.12 → 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.
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Daeryuntalk/ChatButton.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatButton.tsx +2 -2
- package/dist/components/Daeryuntalk/ChatConversation.d.ts +2 -0
- package/dist/components/Daeryuntalk/ChatConversation.jsx +23 -35
- package/dist/components/Daeryuntalk/ChatConversation.tsx +43 -51
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +12 -9
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +18 -8
- package/dist/components/Daeryuntalk/ChatHomeView.d.ts +5 -1
- package/dist/components/Daeryuntalk/ChatHomeView.jsx +5 -6
- package/dist/components/Daeryuntalk/ChatHomeView.tsx +28 -13
- package/dist/components/Daeryuntalk/ChatInput.jsx +12 -7
- package/dist/components/Daeryuntalk/ChatInput.tsx +14 -7
- package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +11 -6
- package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +19 -5
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatPrivacyAuth.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatPrivacyAuth.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/RichText.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/RichText.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/TypingComp.jsx +7 -2
- package/dist/components/Daeryuntalk/ChatItem/TypingComp.tsx +7 -3
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowAuthForm.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowAuthForm.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatMessage.jsx +9 -5
- package/dist/components/Daeryuntalk/ChatMessage.tsx +11 -4
- package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.jsx +8 -3
- package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.tsx +12 -3
- package/dist/components/Daeryuntalk/ChatObject/ObjectBack.jsx +7 -4
- package/dist/components/Daeryuntalk/ChatObject/ObjectBack.tsx +13 -3
- package/dist/components/Daeryuntalk/ChatObject/ObjectButton.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatObject/ObjectButton.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatWidget.d.ts +2 -0
- package/dist/components/Daeryuntalk/ChatWidget.jsx +50 -5
- package/dist/components/Daeryuntalk/ChatWidget.tsx +71 -5
- package/dist/components/Daeryuntalk/DateSeparator.jsx +1 -0
- package/dist/components/Daeryuntalk/DateSeparator.tsx +1 -0
- package/dist/components/Daeryuntalk/History/AuthForm.jsx +1 -0
- package/dist/components/Daeryuntalk/History/AuthForm.tsx +1 -0
- package/dist/components/Daeryuntalk/HistoryView.jsx +18 -12
- package/dist/components/Daeryuntalk/HistoryView.tsx +29 -11
- package/dist/components/Daeryuntalk/HomeView.jsx +17 -12
- package/dist/components/Daeryuntalk/HomeView.tsx +29 -12
- package/dist/components/Daeryuntalk/NavigationFooter.jsx +8 -5
- package/dist/components/Daeryuntalk/NavigationFooter.tsx +10 -4
- package/dist/components/Daeryuntalk/NoticeMessage.jsx +10 -4
- package/dist/components/Daeryuntalk/NoticeMessage.tsx +10 -4
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.jsx +1 -0
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +1 -0
- package/dist/components/Daeryuntalk/Toast/Toast.jsx +1 -0
- package/dist/components/Daeryuntalk/Toast/Toast.tsx +1 -0
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +10 -7
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +19 -6
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +22 -14
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +59 -13
- package/dist/components/Daeryuntalk/ViewportHandler.jsx +2 -0
- package/dist/components/Daeryuntalk/ViewportHandler.tsx +1 -0
- package/dist/components/Daeryuntalk/_lib/utils.d.ts +1 -1
- package/dist/components/Daeryuntalk/_lib/utils.js +1 -1
- package/dist/components/Daeryuntalk/_lib/utils.ts +1 -1
- package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.jsx +3 -2
- package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.tsx +5 -2
- package/dist/components/Daeryuntalk/index.jsx +61 -34
- package/dist/components/Daeryuntalk/index.tsx +71 -40
- package/dist/components/page/Integrate/ViewMore.jsx +2 -2
- package/dist/components/page/Integrate/ViewMore.tsx +2 -2
- package/dist/styles/daeryuntalk.css +4 -4
- package/dist/styles/globals.css +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -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) {
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import ChatWrapper from './ChatWrapper';
|
|
4
|
+
import Image from 'next/image';
|
|
3
5
|
// 이미지
|
|
4
|
-
import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
6
|
+
// import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
5
7
|
const TypingComp = () => {
|
|
8
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
9
|
+
const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
|
|
6
10
|
return (<div className="flex flex-col">
|
|
7
11
|
<div className="flex items-center gap-[10px]">
|
|
8
12
|
<div className="flex-shrink-0 rounded-full">
|
|
9
13
|
<div className="relative h-full w-full">
|
|
10
|
-
<DaeryunLogoIcon width={24} height={24}/>
|
|
14
|
+
<Image src={DaeryunLogoIcon} alt="대륜 로고" width={24} height={24}/>
|
|
15
|
+
{/* <DaeryunLogoIcon width={24} height={24} /> */}
|
|
11
16
|
</div>
|
|
12
17
|
</div>
|
|
13
18
|
<span className="dr_talk_subtitle_medium text-drTalkBlack">법무법인(유한)대륜</span>
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import ChatWrapper from './ChatWrapper';
|
|
3
|
-
|
|
4
|
+
import Image from 'next/image';
|
|
4
5
|
// 이미지
|
|
5
|
-
import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
6
|
+
// import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
6
7
|
const TypingComp = () => {
|
|
8
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
9
|
+
const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
|
|
7
10
|
return (
|
|
8
11
|
<div className="flex flex-col">
|
|
9
12
|
<div className="flex items-center gap-[10px]">
|
|
10
13
|
<div className="flex-shrink-0 rounded-full">
|
|
11
14
|
<div className="relative h-full w-full">
|
|
12
|
-
<DaeryunLogoIcon width={24} height={24} />
|
|
15
|
+
<Image src={DaeryunLogoIcon} alt="대륜 로고" width={24} height={24} />
|
|
16
|
+
{/* <DaeryunLogoIcon width={24} height={24} /> */}
|
|
13
17
|
</div>
|
|
14
18
|
</div>
|
|
15
19
|
<span className="dr_talk_subtitle_medium text-drTalkBlack">법무법인(유한)대륜</span>
|
|
@@ -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) {
|
|
@@ -9,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
10
|
};
|
|
10
11
|
import React from 'react';
|
|
11
12
|
import { hasBlocks, hasCustomerWorkFlowClickData, hasFileArray, hasForm, hasRichForm, hasWorkFlow } from './_types/message';
|
|
13
|
+
import Image from 'next/image';
|
|
12
14
|
import { ObjectNumber, WorkFlowBackOrInit, WorkFlowButtonUiCode } from './_enums/work_flow_object_expose';
|
|
13
15
|
import { MessageSenderType } from './_enums/sender_type';
|
|
14
16
|
import ObjectButton from './ChatObject/ObjectButton';
|
|
@@ -22,12 +24,12 @@ import ChatFile from './ChatItem/ChatFile';
|
|
|
22
24
|
import FieldWorkObject from './ChatObject/FieldWorkObject';
|
|
23
25
|
import TimeWrapper from './ChatItem/TimeWrapper';
|
|
24
26
|
import { InquiryStatusEnum } from './_enums/ask-status';
|
|
25
|
-
// 이미지
|
|
26
|
-
import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
27
|
-
import ResendIcon from '../../asset/images/daeryuntalk/re_send.svg';
|
|
28
27
|
const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, workFlowStack, isHovered, scrollEnd, inquiryStatus, isMobile }) => {
|
|
29
28
|
// 고객 , 오퍼레이터 분리
|
|
30
29
|
const isOperator = message.senderType !== MessageSenderType.CUSTOMER;
|
|
30
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
31
|
+
const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
|
|
32
|
+
const ResendIcon = `${s3Url}/daeryuntalk/re_send.svg`;
|
|
31
33
|
const formatTime = (date) => {
|
|
32
34
|
const hours = date.getHours().toString().padStart(2, '0');
|
|
33
35
|
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
@@ -115,7 +117,8 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
|
|
|
115
117
|
</ChatWrapper>
|
|
116
118
|
</TimeWrapper>) : (<div className={`flex w-full flex-row items-end gap-[8px] `}>
|
|
117
119
|
<button type={'button'} onClick={() => { }} className={`cursor-pointer`}>
|
|
118
|
-
<ResendIcon width={18} height={18}/>
|
|
120
|
+
<Image src={ResendIcon} alt="재전송" width={18} height={18}/>
|
|
121
|
+
{/* <ResendIcon width={18} height={18} /> */}
|
|
119
122
|
</button>
|
|
120
123
|
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
121
124
|
<RichText message={message}/>
|
|
@@ -177,7 +180,8 @@ const ChatMessage = ({ message, object, handelObjectBack, chatInquiryNumber, wor
|
|
|
177
180
|
<div className="flex items-center gap-[10px]">
|
|
178
181
|
<div className="flex-shrink-0 rounded-full">
|
|
179
182
|
<div className="relative h-full w-full">
|
|
180
|
-
<DaeryunLogoIcon width={24} height={24}/>
|
|
183
|
+
<Image src={DaeryunLogoIcon} alt="대륜 로고" width={24} height={24}/>
|
|
184
|
+
{/* <DaeryunLogoIcon width={24} height={24} /> */}
|
|
181
185
|
</div>
|
|
182
186
|
</div>
|
|
183
187
|
<span className="dr_talk_subtitle_medium text-drTalkBlack">법무법인(유한)대륜</span>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import {
|
|
3
4
|
hasBlocks,
|
|
@@ -8,6 +9,7 @@ import {
|
|
|
8
9
|
hasWorkFlow,
|
|
9
10
|
Message
|
|
10
11
|
} from './_types/message';
|
|
12
|
+
import Image from 'next/image';
|
|
11
13
|
import { MessageObject } from './_types/message_object';
|
|
12
14
|
import { ObjectNumber, WorkFlowBackOrInit, WorkFlowButtonUiCode } from './_enums/work_flow_object_expose';
|
|
13
15
|
import { MessageSenderType } from './_enums/sender_type';
|
|
@@ -23,8 +25,8 @@ import FieldWorkObject from './ChatObject/FieldWorkObject';
|
|
|
23
25
|
import TimeWrapper from './ChatItem/TimeWrapper';
|
|
24
26
|
import { InquiryStatusEnum } from './_enums/ask-status';
|
|
25
27
|
// 이미지
|
|
26
|
-
import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
27
|
-
import ResendIcon from '../../asset/images/daeryuntalk/re_send.svg';
|
|
28
|
+
// import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
29
|
+
// import ResendIcon from '../../asset/images/daeryuntalk/re_send.svg';
|
|
28
30
|
|
|
29
31
|
type ChatMessageProps = {
|
|
30
32
|
message: Message;
|
|
@@ -55,6 +57,9 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
|
|
|
55
57
|
}) => {
|
|
56
58
|
// 고객 , 오퍼레이터 분리
|
|
57
59
|
const isOperator = message.senderType !== MessageSenderType.CUSTOMER;
|
|
60
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
61
|
+
const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
|
|
62
|
+
const ResendIcon = `${s3Url}/daeryuntalk/re_send.svg`;
|
|
58
63
|
|
|
59
64
|
const formatTime = (date: Date): string => {
|
|
60
65
|
const hours = date.getHours().toString().padStart(2, '0');
|
|
@@ -161,7 +166,8 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
|
|
|
161
166
|
) : (
|
|
162
167
|
<div className={`flex w-full flex-row items-end gap-[8px] `}>
|
|
163
168
|
<button type={'button'} onClick={() => {}} className={`cursor-pointer`}>
|
|
164
|
-
<ResendIcon width={18} height={18} />
|
|
169
|
+
<Image src={ResendIcon} alt="재전송" width={18} height={18} />
|
|
170
|
+
{/* <ResendIcon width={18} height={18} /> */}
|
|
165
171
|
</button>
|
|
166
172
|
<ChatWrapper isOperator={isOperator} className={`w-[calc(100%-31.25px)]`}>
|
|
167
173
|
<RichText message={message} />
|
|
@@ -267,7 +273,8 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
|
|
|
267
273
|
<div className="flex items-center gap-[10px]">
|
|
268
274
|
<div className="flex-shrink-0 rounded-full">
|
|
269
275
|
<div className="relative h-full w-full">
|
|
270
|
-
<DaeryunLogoIcon width={24} height={24} />
|
|
276
|
+
<Image src={DaeryunLogoIcon} alt="대륜 로고" width={24} height={24} />
|
|
277
|
+
{/* <DaeryunLogoIcon width={24} height={24} /> */}
|
|
271
278
|
</div>
|
|
272
279
|
</div>
|
|
273
280
|
<span className="dr_talk_subtitle_medium text-drTalkBlack">법무법인(유한)대륜</span>
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import ObjectButton from './ObjectButton';
|
|
3
|
+
import Image from 'next/image';
|
|
3
4
|
// 이미지
|
|
4
|
-
import PlusIcon from '../../../asset/images/daeryuntalk/plus.svg';
|
|
5
|
-
import MinusIcon from '../../../asset/images/daeryuntalk/minus.svg';
|
|
5
|
+
// import PlusIcon from '../../../asset/images/daeryuntalk/plus.svg';
|
|
6
|
+
// import MinusIcon from '../../../asset/images/daeryuntalk/minus.svg';
|
|
6
7
|
const FieldWorkObject = ({ object, message, isFirstObject, scrollEnd }) => {
|
|
7
8
|
var _a, _b;
|
|
9
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
10
|
+
const PlusIcon = `${s3Url}/daeryuntalk/plus.svg`;
|
|
11
|
+
const MinusIcon = `${s3Url}/daeryuntalk/minus.svg`;
|
|
8
12
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
9
13
|
const objectList = (_b = (_a = object === null || object === void 0 ? void 0 : object.objectList) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.sequence - b.sequence)) !== null && _b !== void 0 ? _b : [];
|
|
10
14
|
const MAX_VISIBLE = 10;
|
|
@@ -24,7 +28,8 @@ const FieldWorkObject = ({ object, message, isFirstObject, scrollEnd }) => {
|
|
|
24
28
|
{hasMoreThanMax && (<button type="button" onClick={() => {
|
|
25
29
|
setIsExpanded(prev => !prev);
|
|
26
30
|
}} className={`flex h-[36px] w-full items-center justify-center gap-[4px] rounded-[20px] bg-drTalkGrayscale5 `}>
|
|
27
|
-
{isExpanded ? <MinusIcon /> : <PlusIcon />}
|
|
31
|
+
{/* {isExpanded ? <MinusIcon /> : <PlusIcon />} */}
|
|
32
|
+
{isExpanded ? (<Image src={MinusIcon} alt="접기" width={18} height={18}/>) : (<Image src={PlusIcon} alt="더보기" width={13} height={12}/>)}
|
|
28
33
|
<span className={`dr_talk_subtitle_medium2 text-drTalkGrayscale2 `}>
|
|
29
34
|
{isExpanded ? '접기' : '더보기'}
|
|
30
35
|
</span>
|
|
@@ -2,9 +2,10 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import ObjectButton from './ObjectButton';
|
|
3
3
|
import { MessageObject, MessageObjectExpose } from '../_types/message_object';
|
|
4
4
|
import { Message } from '../_types/message'; // 실제 경로에 맞게 수정하세요
|
|
5
|
+
import Image from 'next/image';
|
|
5
6
|
// 이미지
|
|
6
|
-
import PlusIcon from '../../../asset/images/daeryuntalk/plus.svg';
|
|
7
|
-
import MinusIcon from '../../../asset/images/daeryuntalk/minus.svg';
|
|
7
|
+
// import PlusIcon from '../../../asset/images/daeryuntalk/plus.svg';
|
|
8
|
+
// import MinusIcon from '../../../asset/images/daeryuntalk/minus.svg';
|
|
8
9
|
|
|
9
10
|
const FieldWorkObject = ({
|
|
10
11
|
object,
|
|
@@ -17,6 +18,9 @@ const FieldWorkObject = ({
|
|
|
17
18
|
isFirstObject: boolean;
|
|
18
19
|
scrollEnd: () => void;
|
|
19
20
|
}) => {
|
|
21
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
22
|
+
const PlusIcon = `${s3Url}/daeryuntalk/plus.svg`;
|
|
23
|
+
const MinusIcon = `${s3Url}/daeryuntalk/minus.svg`;
|
|
20
24
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
21
25
|
|
|
22
26
|
const objectList: MessageObjectExpose[] = object?.objectList?.sort((a, b) => a.sequence - b.sequence) ?? [];
|
|
@@ -53,7 +57,12 @@ const FieldWorkObject = ({
|
|
|
53
57
|
}}
|
|
54
58
|
className={`flex h-[36px] w-full items-center justify-center gap-[4px] rounded-[20px] bg-drTalkGrayscale5 `}
|
|
55
59
|
>
|
|
56
|
-
{isExpanded ? <MinusIcon /> : <PlusIcon />}
|
|
60
|
+
{/* {isExpanded ? <MinusIcon /> : <PlusIcon />} */}
|
|
61
|
+
{isExpanded ? (
|
|
62
|
+
<Image src={MinusIcon} alt="접기" width={18} height={18} />
|
|
63
|
+
) : (
|
|
64
|
+
<Image src={PlusIcon} alt="더보기" width={13} height={12} />
|
|
65
|
+
)}
|
|
57
66
|
<span className={`dr_talk_subtitle_medium2 text-drTalkGrayscale2 `}>
|
|
58
67
|
{isExpanded ? '접기' : '더보기'}
|
|
59
68
|
</span>
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import BackIcon from '../../../asset/images/daeryuntalk/objectBack.svg';
|
|
4
|
-
import FirstGoICon from '../../../asset/images/daeryuntalk/firstGo.svg';
|
|
3
|
+
import Image from 'next/image';
|
|
5
4
|
const ObjectBack = ({ isBack, handleBtn }) => {
|
|
5
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
6
|
+
const BackIcon = `${s3Url}/daeryuntalk/objectBack.svg`;
|
|
7
|
+
const FirstGoICon = `${s3Url}/daeryuntalk/firstGo.svg`;
|
|
6
8
|
return (<button type={'button'} onClick={() => {
|
|
7
9
|
if (handleBtn) {
|
|
8
10
|
handleBtn();
|
|
9
11
|
}
|
|
10
12
|
}} className={`flex flex-row items-center gap-[4px] `}>
|
|
11
|
-
{isBack ? <BackIcon /> : <FirstGoICon />}
|
|
13
|
+
{/* {isBack ? <BackIcon /> : <FirstGoICon />} */}
|
|
14
|
+
{isBack ? (<Image src={BackIcon} alt="이전" width={16} height={16}/>) : (<Image src={FirstGoICon} alt="처음" width={16} height={16}/>)}
|
|
12
15
|
<p className={` dr_talk_body_medium2 text-[14px] text-drTalkGrayscale1 `}>
|
|
13
16
|
{isBack ? '이전으로' : '처음으로'}
|
|
14
17
|
</p>
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
2
4
|
// 이미지
|
|
3
|
-
import BackIcon from '../../../asset/images/daeryuntalk/objectBack.svg';
|
|
4
|
-
import FirstGoICon from '../../../asset/images/daeryuntalk/firstGo.svg';
|
|
5
|
+
// import BackIcon from '../../../asset/images/daeryuntalk/objectBack.svg';
|
|
6
|
+
// import FirstGoICon from '../../../asset/images/daeryuntalk/firstGo.svg';
|
|
5
7
|
|
|
6
8
|
interface props {
|
|
7
9
|
isBack: boolean;
|
|
8
10
|
handleBtn?: () => void;
|
|
9
11
|
}
|
|
10
12
|
const ObjectBack = ({ isBack, handleBtn }: props) => {
|
|
13
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
14
|
+
const BackIcon = `${s3Url}/daeryuntalk/objectBack.svg`;
|
|
15
|
+
const FirstGoICon = `${s3Url}/daeryuntalk/firstGo.svg`;
|
|
11
16
|
return (
|
|
12
17
|
<button
|
|
13
18
|
type={'button'}
|
|
@@ -18,7 +23,12 @@ const ObjectBack = ({ isBack, handleBtn }: props) => {
|
|
|
18
23
|
}}
|
|
19
24
|
className={`flex flex-row items-center gap-[4px] `}
|
|
20
25
|
>
|
|
21
|
-
{isBack ? <BackIcon /> : <FirstGoICon />}
|
|
26
|
+
{/* {isBack ? <BackIcon /> : <FirstGoICon />} */}
|
|
27
|
+
{isBack ? (
|
|
28
|
+
<Image src={BackIcon} alt="이전" width={16} height={16} />
|
|
29
|
+
) : (
|
|
30
|
+
<Image src={FirstGoICon} alt="처음" width={16} height={16} />
|
|
31
|
+
)}
|
|
22
32
|
<p className={` dr_talk_body_medium2 text-[14px] text-drTalkGrayscale1 `}>
|
|
23
33
|
{isBack ? '이전으로' : '처음으로'}
|
|
24
34
|
</p>
|
|
@@ -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) {
|
|
@@ -6,6 +6,8 @@ interface ChatWidgetProps {
|
|
|
6
6
|
hashValue: string | null;
|
|
7
7
|
setHashValue: Dispatch<SetStateAction<string | null>>;
|
|
8
8
|
animationState: string;
|
|
9
|
+
isMobileSafari?: boolean;
|
|
10
|
+
androidViewportHeight?: number;
|
|
9
11
|
}
|
|
10
12
|
declare const ChatWidget: React.FC<ChatWidgetProps>;
|
|
11
13
|
export default ChatWidget;
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
3
|
import ChatHomeView from './ChatHomeView';
|
|
3
4
|
import ImageViewer from './Viewer/ImageViewer';
|
|
4
5
|
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
5
|
-
const ChatWidget = ({ isOpen, isMobile, onClose, hashValue, setHashValue, animationState }) => {
|
|
6
|
+
const ChatWidget = ({ isOpen, isMobile, onClose, hashValue, setHashValue, animationState, isMobileSafari = false, androidViewportHeight = 0 }) => {
|
|
6
7
|
const { containerRef, isScroll, isBottom } = useScrollShadow();
|
|
7
8
|
const isHash = !!hashValue; // 해쉬 있을 경우
|
|
8
9
|
const chatWidgetRef = useRef(null);
|
|
10
|
+
// iOS Safari viewport 계산
|
|
11
|
+
const [viewportOffset, setViewportOffset] = useState(0);
|
|
12
|
+
const [viewportHeight, setViewportHeight] = useState(0);
|
|
13
|
+
const [viewState, setViewState] = useState('conversation');
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
if (!isMobileSafari)
|
|
17
|
+
return;
|
|
18
|
+
const updateViewport = () => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (!window.visualViewport)
|
|
21
|
+
return;
|
|
22
|
+
const offset = (_a = window.visualViewport.offsetTop) !== null && _a !== void 0 ? _a : 0;
|
|
23
|
+
const height = (_b = window.visualViewport.height) !== null && _b !== void 0 ? _b : window.innerHeight;
|
|
24
|
+
setViewportOffset(offset);
|
|
25
|
+
setViewportHeight(height);
|
|
26
|
+
};
|
|
27
|
+
updateViewport();
|
|
28
|
+
const onResize = () => updateViewport();
|
|
29
|
+
const onScroll = () => updateViewport();
|
|
30
|
+
(_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.addEventListener('resize', onResize);
|
|
31
|
+
(_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.addEventListener('scroll', onScroll);
|
|
32
|
+
return () => {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
(_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.removeEventListener('resize', onResize);
|
|
35
|
+
(_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.removeEventListener('scroll', onScroll);
|
|
36
|
+
};
|
|
37
|
+
}, [isMobileSafari]);
|
|
9
38
|
useEffect(() => {
|
|
10
39
|
const isScrollableElement = (element) => {
|
|
11
40
|
const style = window.getComputedStyle(element);
|
|
@@ -91,16 +120,32 @@ const ChatWidget = ({ isOpen, isMobile, onClose, hashValue, setHashValue, animat
|
|
|
91
120
|
return (<>
|
|
92
121
|
<ImageViewer />
|
|
93
122
|
|
|
94
|
-
<div className="relative
|
|
123
|
+
<div className="relative">
|
|
95
124
|
<div ref={chatWidgetRef} className={`
|
|
125
|
+
|
|
96
126
|
${isMobile ? `${mobileWrapperCss}` : `${webSmallWrapperCss} ${webTbPCWrapperCss} `}
|
|
97
127
|
`}>
|
|
98
128
|
<div ref={containerRef} className={`
|
|
99
129
|
relative z-[999998]
|
|
100
130
|
flex h-full flex-col items-center ${isHash ? 'justify-center' : 'justify-end'}
|
|
101
131
|
${isMobile ? `${innerMobileWrapperCss}` : `${innerWebSmallWrapperCss} ${innerWebTbPCWrapperCss}`}
|
|
102
|
-
`}
|
|
103
|
-
|
|
132
|
+
`} style={viewState !== 'conversation' || !isMobile
|
|
133
|
+
? undefined
|
|
134
|
+
: isMobileSafari
|
|
135
|
+
? {
|
|
136
|
+
position: 'fixed',
|
|
137
|
+
top: `${viewportOffset}px`,
|
|
138
|
+
left: 0,
|
|
139
|
+
right: 0,
|
|
140
|
+
height: viewportHeight ? `${viewportHeight}px` : '100%',
|
|
141
|
+
maxHeight: viewportHeight ? `${viewportHeight}px` : '100%',
|
|
142
|
+
minHeight: viewportHeight ? `${viewportHeight}px` : '100%'
|
|
143
|
+
}
|
|
144
|
+
: {
|
|
145
|
+
height: `${androidViewportHeight}px`,
|
|
146
|
+
maxHeight: `${androidViewportHeight}px`
|
|
147
|
+
}}>
|
|
148
|
+
<ChatHomeView hashValue={hashValue} isMobile={isMobile} isHash={isHash} onClose={onClose} androidViewportHeight={androidViewportHeight} isMobileSafari={isMobileSafari} viewState={viewState} setViewState={setViewState}/>
|
|
104
149
|
</div>
|
|
105
150
|
</div>
|
|
106
151
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import ChatHomeView, { ViewState } from './ChatHomeView';
|
|
3
4
|
import ImageViewer from './Viewer/ImageViewer';
|
|
4
5
|
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
5
6
|
|
|
@@ -10,6 +11,8 @@ interface ChatWidgetProps {
|
|
|
10
11
|
hashValue: string | null;
|
|
11
12
|
setHashValue: Dispatch<SetStateAction<string | null>>;
|
|
12
13
|
animationState: string;
|
|
14
|
+
isMobileSafari?: boolean;
|
|
15
|
+
androidViewportHeight?: number;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
const ChatWidget: React.FC<ChatWidgetProps> = ({
|
|
@@ -18,12 +21,47 @@ const ChatWidget: React.FC<ChatWidgetProps> = ({
|
|
|
18
21
|
onClose,
|
|
19
22
|
hashValue,
|
|
20
23
|
setHashValue,
|
|
21
|
-
animationState
|
|
24
|
+
animationState,
|
|
25
|
+
isMobileSafari = false,
|
|
26
|
+
androidViewportHeight = 0
|
|
22
27
|
}) => {
|
|
23
28
|
const { containerRef, isScroll, isBottom } = useScrollShadow<HTMLDivElement>();
|
|
24
29
|
const isHash = !!hashValue; // 해쉬 있을 경우
|
|
25
30
|
const chatWidgetRef = useRef<HTMLDivElement>(null);
|
|
26
31
|
|
|
32
|
+
// iOS Safari viewport 계산
|
|
33
|
+
const [viewportOffset, setViewportOffset] = useState(0);
|
|
34
|
+
const [viewportHeight, setViewportHeight] = useState(0);
|
|
35
|
+
|
|
36
|
+
const [viewState, setViewState] = useState<ViewState>('conversation');
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!isMobileSafari) return;
|
|
40
|
+
|
|
41
|
+
const updateViewport = () => {
|
|
42
|
+
if (!window.visualViewport) return;
|
|
43
|
+
|
|
44
|
+
const offset = window.visualViewport.offsetTop ?? 0;
|
|
45
|
+
const height = window.visualViewport.height ?? window.innerHeight;
|
|
46
|
+
|
|
47
|
+
setViewportOffset(offset);
|
|
48
|
+
setViewportHeight(height);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
updateViewport();
|
|
52
|
+
|
|
53
|
+
const onResize = () => updateViewport();
|
|
54
|
+
const onScroll = () => updateViewport();
|
|
55
|
+
|
|
56
|
+
window.visualViewport?.addEventListener('resize', onResize);
|
|
57
|
+
window.visualViewport?.addEventListener('scroll', onScroll);
|
|
58
|
+
|
|
59
|
+
return () => {
|
|
60
|
+
window.visualViewport?.removeEventListener('resize', onResize);
|
|
61
|
+
window.visualViewport?.removeEventListener('scroll', onScroll);
|
|
62
|
+
};
|
|
63
|
+
}, [isMobileSafari]);
|
|
64
|
+
|
|
27
65
|
useEffect(() => {
|
|
28
66
|
const isScrollableElement = (element: Element): boolean => {
|
|
29
67
|
const style = window.getComputedStyle(element);
|
|
@@ -129,10 +167,11 @@ const ChatWidget: React.FC<ChatWidgetProps> = ({
|
|
|
129
167
|
<>
|
|
130
168
|
<ImageViewer />
|
|
131
169
|
|
|
132
|
-
<div className="relative
|
|
170
|
+
<div className="relative">
|
|
133
171
|
<div
|
|
134
172
|
ref={chatWidgetRef}
|
|
135
173
|
className={`
|
|
174
|
+
|
|
136
175
|
${isMobile ? `${mobileWrapperCss}` : `${webSmallWrapperCss} ${webTbPCWrapperCss} `}
|
|
137
176
|
`}
|
|
138
177
|
>
|
|
@@ -143,8 +182,35 @@ const ChatWidget: React.FC<ChatWidgetProps> = ({
|
|
|
143
182
|
flex h-full flex-col items-center ${isHash ? 'justify-center' : 'justify-end'}
|
|
144
183
|
${isMobile ? `${innerMobileWrapperCss}` : `${innerWebSmallWrapperCss} ${innerWebTbPCWrapperCss}`}
|
|
145
184
|
`}
|
|
185
|
+
style={
|
|
186
|
+
viewState !== 'conversation' || !isMobile
|
|
187
|
+
? undefined
|
|
188
|
+
: isMobileSafari
|
|
189
|
+
? {
|
|
190
|
+
position: 'fixed',
|
|
191
|
+
top: `${viewportOffset}px`,
|
|
192
|
+
left: 0,
|
|
193
|
+
right: 0,
|
|
194
|
+
height: viewportHeight ? `${viewportHeight}px` : '100%',
|
|
195
|
+
maxHeight: viewportHeight ? `${viewportHeight}px` : '100%',
|
|
196
|
+
minHeight: viewportHeight ? `${viewportHeight}px` : '100%'
|
|
197
|
+
}
|
|
198
|
+
: {
|
|
199
|
+
height: `${androidViewportHeight}px`,
|
|
200
|
+
maxHeight: `${androidViewportHeight}px`
|
|
201
|
+
}
|
|
202
|
+
}
|
|
146
203
|
>
|
|
147
|
-
<ChatHomeView
|
|
204
|
+
<ChatHomeView
|
|
205
|
+
hashValue={hashValue}
|
|
206
|
+
isMobile={isMobile}
|
|
207
|
+
isHash={isHash}
|
|
208
|
+
onClose={onClose}
|
|
209
|
+
androidViewportHeight={androidViewportHeight}
|
|
210
|
+
isMobileSafari={isMobileSafari}
|
|
211
|
+
viewState={viewState}
|
|
212
|
+
setViewState={setViewState}
|
|
213
|
+
/>
|
|
148
214
|
</div>
|
|
149
215
|
</div>
|
|
150
216
|
</div>
|
|
@@ -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) {
|