@daeryun/dr_components 0.8.79 → 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.
@@ -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, hasCustomerWorkFlowClickData, hasFileArray, hasForm, hasRichForm, hasWorkFlowImg } 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>);
@@ -5,7 +5,7 @@ import {
5
5
  hasFileArray,
6
6
  hasForm,
7
7
  hasRichForm,
8
- hasWorkFlowImg,
8
+ hasWorkFlow,
9
9
  Message
10
10
  } from './_types/message';
11
11
  import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
@@ -72,9 +72,11 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
72
72
  * MSP00300202 워크플로우이미지+(텍스트) -> 워크플로우 메시지 템플릿 2
73
73
  * MSP00300203 아이콘+텍스트 -> 워크플로우 메시지 템플릿 3
74
74
  * MSP00300204 텍스트+폼 -> 워크플로우 메시지 템플릿 4
75
+ *
76
+ *
75
77
  */
76
78
 
77
- const isWorkFlowImg = hasWorkFlowImg(message);
79
+ const isWorkFlow = hasWorkFlow(message);
78
80
  const isBlock = hasBlocks(message);
79
81
  const isWorkFlowCustomerClickData = hasCustomerWorkFlowClickData(message);
80
82
  const isAuthForm = hasForm(message);
@@ -98,6 +100,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
98
100
  );
99
101
  }
100
102
 
103
+ // 워크플로우 개인정보 인증 폼
101
104
  if (isAuthForm) {
102
105
  return (
103
106
  <TimeWrapper time={time}>
@@ -105,6 +108,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
105
108
  </TimeWrapper>
106
109
  );
107
110
  }
111
+ // 워크플로우 고객이 클릭한 내역
108
112
  if (isWorkFlowCustomerClickData) {
109
113
  return (
110
114
  <TimeWrapper time={time} timePosition={'left'}>
@@ -112,7 +116,9 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
112
116
  </TimeWrapper>
113
117
  );
114
118
  }
115
- if (isWorkFlowImg) {
119
+
120
+ // 워크플로우 이미지 -> ( 이미지 + 텍스트 ) 로 잡힐 예정
121
+ if (isWorkFlow) {
116
122
  return (
117
123
  <TimeWrapper time={time}>
118
124
  <WorkFlowImg message={message} />
@@ -9,7 +9,6 @@ import ShadowBox from './_ui/ShadowBox';
9
9
  import CloseSvgIcon from '../../asset/images/daeryuntalk/close.svg';
10
10
  import { formatTimestamp } from './_lib/utils';
11
11
  const HistoryView = ({ onBackClick, onChatHistoryClick, onNewChatClick, isAuthenticated, historyLit, goGetHistoryList, isMobile, onClose, isHash, handleGoRequestPhone, handleGoHistoryPhoneAuth }) => {
12
- var _a;
13
12
  const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow();
14
13
  useEffect(() => {
15
14
  checkScroll();
@@ -39,7 +38,7 @@ const HistoryView = ({ onBackClick, onChatHistoryClick, onNewChatClick, isAuthen
39
38
  {/* 스크롤 가능한 컨텐츠 영역 */}
40
39
  <div className="relative w-full flex-1 overflow-hidden">
41
40
  <div ref={containerRef} className="no-scrollbar h-full overflow-y-auto px-[20px] pb-[20px] pt-[24px]">
42
- {hasHistories ? ((_a = historyLit.slice(0, 1)) === null || _a === void 0 ? void 0 : _a.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)}>
43
42
  <div className="flex items-center justify-between">
44
43
  <div className={`flex flex-row items-center gap-[10px]`}>
45
44
  <span className="dr_talk_subtitle_medium">{history.customer_name}</span>
@@ -90,7 +90,7 @@ const HistoryView: React.FC<HistoryViewProps> = ({
90
90
  className="no-scrollbar h-full overflow-y-auto px-[20px] pb-[20px] pt-[24px]"
91
91
  >
92
92
  {hasHistories ? (
93
- historyLit.slice(0, 1)?.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"
@@ -88,4 +88,4 @@ export declare const hasFileArray: (message: Message) => boolean;
88
88
  export declare const hasFiles: (message: Message) => boolean;
89
89
  export declare const hasImages: (message: Message) => boolean;
90
90
  export declare const hasWebPage: (message: Message) => boolean;
91
- export declare const hasWorkFlowImg: (message: Message) => boolean;
91
+ export declare const hasWorkFlow: (message: Message) => boolean;
@@ -16,4 +16,9 @@ export const hasFiles = (message) => !!message.files && message.files.filter(fil
16
16
  // 이미지가 있는지
17
17
  export const hasImages = (message) => !!message.files && message.files.filter(fil => fil.type === 'image').length > 0;
18
18
  export const hasWebPage = (message) => !!message.webPage;
19
- export const hasWorkFlowImg = (message) => { var _a; return !!((_a = message === null || message === void 0 ? void 0 : message.workFlow) === null || _a === void 0 ? void 0 : _a.imageUrl); };
19
+ export const hasWorkFlow = (message) => [
20
+ String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1),
21
+ String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2),
22
+ String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3),
23
+ String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4)
24
+ ].includes((message === null || message === void 0 ? void 0 : message.templateType) || '');
@@ -146,4 +146,10 @@ export const hasFiles = (message: Message): boolean =>
146
146
  export const hasImages = (message: Message): boolean =>
147
147
  !!message.files && message.files.filter(fil => fil.type === 'image').length > 0;
148
148
  export const hasWebPage = (message: Message): boolean => !!message.webPage;
149
- export const hasWorkFlowImg = (message: Message): boolean => !!message?.workFlow?.imageUrl;
149
+ export const hasWorkFlow = (message: Message): boolean =>
150
+ [
151
+ String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1),
152
+ String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2),
153
+ String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3),
154
+ String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4)
155
+ ].includes(message?.templateType || '');