@daeryun/dr_components 1.2.18 → 1.2.19
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 +1 -1
- package/dist/components/Daeryuntalk/ChatButton.tsx +1 -1
- package/dist/components/Daeryuntalk/ChatWidget.d.ts +1 -0
- package/dist/components/Daeryuntalk/ChatWidget.jsx +114 -31
- package/dist/components/Daeryuntalk/ChatWidget.tsx +120 -37
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +0 -9
- package/dist/components/Daeryuntalk/index.jsx +17 -1
- package/dist/components/Daeryuntalk/index.tsx +26 -2
- package/dist/components/DaeryuntalkBackup/ChatButton.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.jsx +123 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.tsx +157 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.d.ts +21 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.jsx +259 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.tsx +390 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.d.ts +16 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.jsx +50 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.tsx +108 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.d.ts +14 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.jsx +147 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.tsx +262 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.jsx +19 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.tsx +27 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.jsx +165 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.tsx +244 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.tsx +25 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.jsx +100 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.tsx +135 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.tsx +26 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.jsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.tsx +45 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.tsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.d.ts +3 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.tsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.tsx +233 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.jsx +198 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.tsx +295 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.jsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.tsx +75 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.jsx +138 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.tsx +177 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.jsx +154 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.tsx +221 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.d.ts +103 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.jsx +207 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.tsx +350 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.tsx +24 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.tsx +73 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.jsx +157 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.tsx +206 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.d.ts +19 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.jsx +94 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/HomeView.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/HomeView.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/HomeView.tsx +261 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.jsx +44 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.tsx +60 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.jsx +17 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.tsx +28 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.jsx +130 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.tsx +181 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.d.ts +23 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.tsx +70 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.jsx +22 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.tsx +30 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.jsx +98 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.tsx +138 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.jsx +104 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.jsx +141 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.tsx +278 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.jsx +25 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.d.ts +177 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.js +801 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.ts +1097 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.d.ts +131 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.js +1 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.ts +159 -0
- package/dist/components/DaeryuntalkBackup/_api/index.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.js +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.d.ts +5 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.js +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.js +25 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.ts +26 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.d.ts +109 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.js +254 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.ts +289 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.js +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.js +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.ts +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.d.ts +34 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.js +46 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.ts +56 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.d.ts +32 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.js +76 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.ts +81 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.d.ts +33 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.js +66 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.ts +71 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.d.ts +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.js +465 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.ts +595 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.tsx +17 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.js +112 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.ts +144 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.d.ts +44 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.js +534 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.ts +706 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.js +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.ts +23 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.js +109 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.ts +121 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.js +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.ts +73 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.js +42 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.ts +52 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.js +20 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.ts +30 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.d.ts +2 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.js +26 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.ts +43 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.d.ts +27 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.js +80 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.ts +101 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.js +66 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.ts +75 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.js +103 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.ts +136 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.js +94 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.ts +119 -0
- package/dist/components/DaeryuntalkBackup/_types/message.d.ts +92 -0
- package/dist/components/DaeryuntalkBackup/_types/message.js +25 -0
- package/dist/components/DaeryuntalkBackup/_types/message.ts +156 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.d.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.jsx +5 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.tsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.tsx +38 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.tsx +50 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.jsx +9 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/index.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/index.jsx +190 -0
- package/dist/components/DaeryuntalkBackup/index.tsx +261 -0
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/styles/globals.css +415 -410
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export const formatFileSize = (size) => {
|
|
2
|
+
if (size === 0)
|
|
3
|
+
return '0 B';
|
|
4
|
+
const i = Math.floor(Math.log(size) / Math.log(1024));
|
|
5
|
+
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
6
|
+
return (size / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
|
|
7
|
+
};
|
|
8
|
+
export const formatDateToKorean = (timestamp) => {
|
|
9
|
+
const date = new Date(timestamp);
|
|
10
|
+
const year = date.getFullYear();
|
|
11
|
+
const month = date.getMonth() + 1; // 0-based
|
|
12
|
+
const day = date.getDate();
|
|
13
|
+
const hour = date.getHours();
|
|
14
|
+
const minute = date.getMinutes().toString().padStart(2, '0');
|
|
15
|
+
return `${year}년 ${month}월 ${day}일 ${hour}:${minute}`;
|
|
16
|
+
};
|
|
17
|
+
export const onlyNumbers = (phoneNumber) => {
|
|
18
|
+
return phoneNumber.replace(/\D/g, '');
|
|
19
|
+
};
|
|
20
|
+
export const isEmptyHtml = (html) => {
|
|
21
|
+
if (!html)
|
|
22
|
+
return true;
|
|
23
|
+
const trimmed = html
|
|
24
|
+
.replace(/<p><br><\/p>/g, '')
|
|
25
|
+
.replace(/<p>\s*<\/p>/g, '')
|
|
26
|
+
.trim();
|
|
27
|
+
return trimmed === '';
|
|
28
|
+
};
|
|
29
|
+
export const phoneCheck = (value) => {
|
|
30
|
+
const phoneNumber = onlyNumbers(value);
|
|
31
|
+
// 10자리 또는 11자리만 통과
|
|
32
|
+
const isValid = /^010\d{7,8}$/.test(phoneNumber);
|
|
33
|
+
return { phoneNumber, isValid };
|
|
34
|
+
};
|
|
35
|
+
const keepOnlyKoreanCharacters = (text) => {
|
|
36
|
+
// 한글(자음, 모음, 결합된 문자)을 제외한 모든 문자를 제거하는 정규식
|
|
37
|
+
return text.replace(/[^\u3131-\u318E\uAC00-\uD7A3]+/g, '') || '';
|
|
38
|
+
};
|
|
39
|
+
export const nameFilter = (value) => {
|
|
40
|
+
const nameRegex = /^[가-힣]*$/;
|
|
41
|
+
const ko = keepOnlyKoreanCharacters(value);
|
|
42
|
+
return { name: ko, isValid: ko !== '' && ko.length >= 2 && ko.length <= 6 && nameRegex.test(ko) };
|
|
43
|
+
};
|
|
44
|
+
export const formatSecondsToMMSS = (seconds) => {
|
|
45
|
+
const min = Math.floor(seconds / 60);
|
|
46
|
+
const sec = seconds % 60;
|
|
47
|
+
const paddedMin = String(min).padStart(2, '0');
|
|
48
|
+
const paddedSec = String(sec).padStart(2, '0');
|
|
49
|
+
return `${paddedMin}:${paddedSec}`;
|
|
50
|
+
};
|
|
51
|
+
export const formatTimestamp = (timestamp) => {
|
|
52
|
+
if (!timestamp)
|
|
53
|
+
return '';
|
|
54
|
+
// UTC string을 Date 객체로 변환
|
|
55
|
+
const date = new Date(timestamp);
|
|
56
|
+
const now = new Date();
|
|
57
|
+
// 시간 차이(초)
|
|
58
|
+
const diffInSeconds = Math.floor((now.getTime() - date.getTime()) / 1000);
|
|
59
|
+
if (diffInSeconds < 5) {
|
|
60
|
+
return '방금';
|
|
61
|
+
}
|
|
62
|
+
if (diffInSeconds < 60 * 60 * 24) {
|
|
63
|
+
// 오늘 내 메시지: 시:분
|
|
64
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
|
65
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
66
|
+
return `${hours}:${minutes}`;
|
|
67
|
+
}
|
|
68
|
+
if (diffInSeconds < 60 * 60 * 24 * 7) {
|
|
69
|
+
// 일주일 내: N일전
|
|
70
|
+
const days = Math.floor(diffInSeconds / (60 * 60 * 24));
|
|
71
|
+
return `${days}일전`;
|
|
72
|
+
}
|
|
73
|
+
// 그 외: 월일
|
|
74
|
+
const month = date.getMonth() + 1;
|
|
75
|
+
const day = date.getDate();
|
|
76
|
+
return `${month}월${day}일`;
|
|
77
|
+
};
|
|
78
|
+
export const stripHtmlTags = (input) => {
|
|
79
|
+
// 모든 HTML 태그 제거
|
|
80
|
+
const withoutTags = input.replace(/<[^>]*>/g, '');
|
|
81
|
+
return Boolean(withoutTags.trim());
|
|
82
|
+
};
|
|
83
|
+
export const decodeDoubleEscapedHtml = (escaped) => {
|
|
84
|
+
const textArea = document.createElement('textarea');
|
|
85
|
+
textArea.innerHTML = escaped;
|
|
86
|
+
const onceDecoded = textArea.value;
|
|
87
|
+
textArea.innerHTML = onceDecoded;
|
|
88
|
+
return textArea.value;
|
|
89
|
+
};
|
|
90
|
+
export const consoleFn = (...args) => {
|
|
91
|
+
if (process.env.NODE_ENV === 'development' || process.env.DEVELOP_TEST === 'true') {
|
|
92
|
+
console.log(...args);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export const formatFileSize = (size: number): string => {
|
|
2
|
+
if (size === 0) return '0 B';
|
|
3
|
+
const i = Math.floor(Math.log(size) / Math.log(1024));
|
|
4
|
+
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
5
|
+
return (size / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const formatDateToKorean = (timestamp: string) => {
|
|
9
|
+
const date = new Date(timestamp);
|
|
10
|
+
const year = date.getFullYear();
|
|
11
|
+
const month = date.getMonth() + 1; // 0-based
|
|
12
|
+
const day = date.getDate();
|
|
13
|
+
const hour = date.getHours();
|
|
14
|
+
const minute = date.getMinutes().toString().padStart(2, '0');
|
|
15
|
+
|
|
16
|
+
return `${year}년 ${month}월 ${day}일 ${hour}:${minute}`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const onlyNumbers = (phoneNumber: string): string => {
|
|
20
|
+
return phoneNumber.replace(/\D/g, '');
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const isEmptyHtml = (html: string | null | undefined): boolean => {
|
|
24
|
+
if (!html) return true;
|
|
25
|
+
const trimmed = html
|
|
26
|
+
.replace(/<p><br><\/p>/g, '')
|
|
27
|
+
.replace(/<p>\s*<\/p>/g, '')
|
|
28
|
+
.trim();
|
|
29
|
+
return trimmed === '';
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const phoneCheck = (
|
|
33
|
+
value: string
|
|
34
|
+
): {
|
|
35
|
+
phoneNumber: string;
|
|
36
|
+
isValid: boolean;
|
|
37
|
+
} => {
|
|
38
|
+
const phoneNumber = onlyNumbers(value);
|
|
39
|
+
// 10자리 또는 11자리만 통과
|
|
40
|
+
const isValid = /^010\d{7,8}$/.test(phoneNumber);
|
|
41
|
+
return { phoneNumber, isValid };
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const keepOnlyKoreanCharacters = (text: string) => {
|
|
45
|
+
// 한글(자음, 모음, 결합된 문자)을 제외한 모든 문자를 제거하는 정규식
|
|
46
|
+
return text.replace(/[^\u3131-\u318E\uAC00-\uD7A3]+/g, '') || '';
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const nameFilter = (value: string): { name: string; isValid: boolean } => {
|
|
50
|
+
const nameRegex = /^[가-힣]*$/;
|
|
51
|
+
|
|
52
|
+
const ko = keepOnlyKoreanCharacters(value);
|
|
53
|
+
|
|
54
|
+
return { name: ko, isValid: ko !== '' && ko.length >= 2 && ko.length <= 6 && nameRegex.test(ko) };
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const formatSecondsToMMSS = (seconds: number): string => {
|
|
58
|
+
const min = Math.floor(seconds / 60);
|
|
59
|
+
const sec = seconds % 60;
|
|
60
|
+
|
|
61
|
+
const paddedMin = String(min).padStart(2, '0');
|
|
62
|
+
const paddedSec = String(sec).padStart(2, '0');
|
|
63
|
+
|
|
64
|
+
return `${paddedMin}:${paddedSec}`;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const formatTimestamp = (timestamp: string): string => {
|
|
68
|
+
if (!timestamp) return '';
|
|
69
|
+
|
|
70
|
+
// UTC string을 Date 객체로 변환
|
|
71
|
+
const date = new Date(timestamp);
|
|
72
|
+
const now = new Date();
|
|
73
|
+
|
|
74
|
+
// 시간 차이(초)
|
|
75
|
+
const diffInSeconds = Math.floor((now.getTime() - date.getTime()) / 1000);
|
|
76
|
+
|
|
77
|
+
if (diffInSeconds < 5) {
|
|
78
|
+
return '방금';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (diffInSeconds < 60 * 60 * 24) {
|
|
82
|
+
// 오늘 내 메시지: 시:분
|
|
83
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
|
84
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
85
|
+
return `${hours}:${minutes}`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (diffInSeconds < 60 * 60 * 24 * 7) {
|
|
89
|
+
// 일주일 내: N일전
|
|
90
|
+
const days = Math.floor(diffInSeconds / (60 * 60 * 24));
|
|
91
|
+
return `${days}일전`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 그 외: 월일
|
|
95
|
+
const month = date.getMonth() + 1;
|
|
96
|
+
const day = date.getDate();
|
|
97
|
+
return `${month}월${day}일`;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const stripHtmlTags = (input: string) => {
|
|
101
|
+
// 모든 HTML 태그 제거
|
|
102
|
+
const withoutTags = input.replace(/<[^>]*>/g, '');
|
|
103
|
+
return Boolean(withoutTags.trim());
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const decodeDoubleEscapedHtml = (escaped: string) => {
|
|
107
|
+
const textArea = document.createElement('textarea');
|
|
108
|
+
textArea.innerHTML = escaped;
|
|
109
|
+
const onceDecoded = textArea.value;
|
|
110
|
+
|
|
111
|
+
textArea.innerHTML = onceDecoded;
|
|
112
|
+
return textArea.value;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const consoleFn = (...args: any[]) => {
|
|
116
|
+
if (process.env.NODE_ENV === 'development' || process.env.DEVELOP_TEST === 'true') {
|
|
117
|
+
console.log(...args);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export interface TextBlock {
|
|
2
|
+
type: string;
|
|
3
|
+
value: string;
|
|
4
|
+
iconUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface WorkFlowInfo {
|
|
7
|
+
workFlowNumber: string;
|
|
8
|
+
optionExposureYn: boolean;
|
|
9
|
+
imageUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Button {
|
|
12
|
+
id: string;
|
|
13
|
+
text: string;
|
|
14
|
+
action: 'send' | 'url' | 'form';
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
export type FormInputType = 'text' | 'phone' | 'email' | 'select' | 'textarea' | 'date' | 'checkbox';
|
|
18
|
+
export interface FormInput {
|
|
19
|
+
type: FormInputType;
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
bindingKey?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Form {
|
|
26
|
+
type: string;
|
|
27
|
+
inputs: FormInput[];
|
|
28
|
+
submittedAt?: string;
|
|
29
|
+
submitButton?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface FileInfo {
|
|
32
|
+
fileNumber: string;
|
|
33
|
+
fileKey: string;
|
|
34
|
+
name: string;
|
|
35
|
+
type: 'image' | 'file';
|
|
36
|
+
contentType: string;
|
|
37
|
+
size: number;
|
|
38
|
+
sequence: number;
|
|
39
|
+
thumbnailUrl: string;
|
|
40
|
+
originalUrl: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ImageInfo {
|
|
43
|
+
url: string;
|
|
44
|
+
alt?: string;
|
|
45
|
+
caption?: string;
|
|
46
|
+
width?: number;
|
|
47
|
+
height?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface IRichText {
|
|
50
|
+
version: number;
|
|
51
|
+
htmlContent: string;
|
|
52
|
+
structuredData: any | null;
|
|
53
|
+
}
|
|
54
|
+
export interface Message {
|
|
55
|
+
messageNumber: string;
|
|
56
|
+
plainText: string;
|
|
57
|
+
senderType: string;
|
|
58
|
+
messageType?: string;
|
|
59
|
+
messageStatus?: string;
|
|
60
|
+
userKey?: string;
|
|
61
|
+
inquiryNumber?: string;
|
|
62
|
+
templateType?: string;
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt?: Date;
|
|
65
|
+
language?: string;
|
|
66
|
+
timestamp: number;
|
|
67
|
+
richText?: IRichText;
|
|
68
|
+
blocks?: TextBlock[];
|
|
69
|
+
workFlow?: WorkFlowInfo;
|
|
70
|
+
buttons?: Button[];
|
|
71
|
+
form?: Form;
|
|
72
|
+
files?: FileInfo[];
|
|
73
|
+
images?: ImageInfo[];
|
|
74
|
+
webPage?: string;
|
|
75
|
+
userNo?: string;
|
|
76
|
+
centerCd?: string;
|
|
77
|
+
msgIconUrl?: string;
|
|
78
|
+
userType?: string;
|
|
79
|
+
isBot?: boolean;
|
|
80
|
+
isAPIMessage?: boolean;
|
|
81
|
+
type: 'live' | 'basic' | 'prev';
|
|
82
|
+
}
|
|
83
|
+
export declare const hasBlocks: (message: Message) => boolean;
|
|
84
|
+
export declare const hasRichForm: (message: Message) => boolean;
|
|
85
|
+
export declare const hasCustomerWorkFlowClickData: (message: Message) => boolean;
|
|
86
|
+
export declare const hasButtons: (message: Message) => boolean;
|
|
87
|
+
export declare const hasForm: (message: Message) => boolean;
|
|
88
|
+
export declare const hasFileArray: (message: Message) => boolean;
|
|
89
|
+
export declare const hasFiles: (message: Message) => boolean;
|
|
90
|
+
export declare const hasImages: (message: Message) => boolean;
|
|
91
|
+
export declare const hasWebPage: (message: Message) => boolean;
|
|
92
|
+
export declare const hasWorkFlow: (message: Message) => boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// todo 올바른 타입 정의 필요
|
|
2
|
+
// 텍스트 블록 타입
|
|
3
|
+
import { InquiryMessageTemplateType } from '../_enums/template';
|
|
4
|
+
// 메시지에 특정 컨텐츠가 있는지 확인하는 헬퍼 함수들
|
|
5
|
+
export const hasBlocks = (message) => !!message.blocks && message.blocks.length > 0;
|
|
6
|
+
//
|
|
7
|
+
export const hasRichForm = (message) => !!(message.richText && message.richText.structuredData);
|
|
8
|
+
// 사용자가 워크플로우 대답 클릭한거
|
|
9
|
+
export const hasCustomerWorkFlowClickData = (message) => message.templateType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3;
|
|
10
|
+
export const hasButtons = (message) => !!message.buttons && message.buttons.length > 0;
|
|
11
|
+
// 폼인지 여부
|
|
12
|
+
export const hasForm = (message) => message.templateType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4;
|
|
13
|
+
// 파일 자체가 있는지
|
|
14
|
+
export const hasFileArray = (message) => !!message.files && message.files.length > 0;
|
|
15
|
+
// 이미지 외 파일이 있는지
|
|
16
|
+
export const hasFiles = (message) => !!message.files && message.files.filter(fil => fil.type !== 'image').length > 0;
|
|
17
|
+
// 이미지가 있는지
|
|
18
|
+
export const hasImages = (message) => !!message.files && message.files.filter(fil => fil.type === 'image').length > 0;
|
|
19
|
+
export const hasWebPage = (message) => !!message.webPage;
|
|
20
|
+
export const hasWorkFlow = (message) => [
|
|
21
|
+
String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1),
|
|
22
|
+
String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2),
|
|
23
|
+
String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3),
|
|
24
|
+
String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4)
|
|
25
|
+
].includes((message === null || message === void 0 ? void 0 : message.templateType) || '');
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// todo 올바른 타입 정의 필요
|
|
2
|
+
|
|
3
|
+
// 텍스트 블록 타입
|
|
4
|
+
import { InquiryMessageTemplateType } from '../_enums/template';
|
|
5
|
+
|
|
6
|
+
export interface TextBlock {
|
|
7
|
+
type: string;
|
|
8
|
+
value: string;
|
|
9
|
+
iconUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// 워크플로우
|
|
13
|
+
export interface WorkFlowInfo {
|
|
14
|
+
workFlowNumber: string; // 워크플로우 번호
|
|
15
|
+
optionExposureYn: boolean; // 옵션 노출 여부
|
|
16
|
+
imageUrl: string; // 이미지
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 버튼 타입
|
|
20
|
+
export interface Button {
|
|
21
|
+
id: string;
|
|
22
|
+
text: string;
|
|
23
|
+
action: 'send' | 'url' | 'form';
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 폼 입력 타입 정의 (확장 가능성 열어두기)
|
|
28
|
+
export type FormInputType = 'text' | 'phone' | 'email' | 'select' | 'textarea' | 'date' | 'checkbox';
|
|
29
|
+
|
|
30
|
+
// 폼 입력 필드 정의
|
|
31
|
+
export interface FormInput {
|
|
32
|
+
type: FormInputType;
|
|
33
|
+
label: string;
|
|
34
|
+
value: string;
|
|
35
|
+
// placeholder?: string;
|
|
36
|
+
// required?: boolean;
|
|
37
|
+
readOnly?: boolean;
|
|
38
|
+
bindingKey?: string;
|
|
39
|
+
// options?: Array<{ value: string; label: string }>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Form {
|
|
43
|
+
type: string;
|
|
44
|
+
inputs: FormInput[];
|
|
45
|
+
submittedAt?: string;
|
|
46
|
+
submitButton?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// todo 파일 정보 정의
|
|
50
|
+
export interface FileInfo {
|
|
51
|
+
fileNumber: string;
|
|
52
|
+
fileKey: string;
|
|
53
|
+
name: string;
|
|
54
|
+
type: 'image' | 'file'; // 확장 가능
|
|
55
|
+
contentType: string;
|
|
56
|
+
size: number;
|
|
57
|
+
sequence: number;
|
|
58
|
+
thumbnailUrl: string;
|
|
59
|
+
originalUrl: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// todo 이미지 정보 정의
|
|
63
|
+
export interface ImageInfo {
|
|
64
|
+
url: string;
|
|
65
|
+
alt?: string;
|
|
66
|
+
caption?: string;
|
|
67
|
+
width?: number;
|
|
68
|
+
height?: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface IRichText {
|
|
72
|
+
version: number;
|
|
73
|
+
htmlContent: string;
|
|
74
|
+
structuredData: any | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// 기본 메시지 인터페이스
|
|
78
|
+
export interface Message {
|
|
79
|
+
// 핵심 필드
|
|
80
|
+
messageNumber: string; // API의 msg_no
|
|
81
|
+
plainText: string; // API의 plain_text
|
|
82
|
+
|
|
83
|
+
// API에서 오는 필드들
|
|
84
|
+
senderType: string; // UI 표시용 발신자 타입 (msg_type에서 변환)
|
|
85
|
+
messageType?: string; // API의 msg_type
|
|
86
|
+
messageStatus?: string; // API의 msg_status
|
|
87
|
+
userKey?: string; // API의 user_key
|
|
88
|
+
inquiryNumber?: string; // API의 inquiry_no
|
|
89
|
+
templateType?: string;
|
|
90
|
+
createdAt: Date; // API의 created_at (Date 객체로 변환)
|
|
91
|
+
updatedAt?: Date; // API의 updated_at (Date 객체로 변환)
|
|
92
|
+
language?: string; // API의 language
|
|
93
|
+
timestamp: number;
|
|
94
|
+
|
|
95
|
+
// 팁탭 에디터
|
|
96
|
+
richText?: IRichText;
|
|
97
|
+
|
|
98
|
+
// 블록 관련
|
|
99
|
+
blocks?: TextBlock[]; // API의 blocks를 UI 타입으로 변환
|
|
100
|
+
|
|
101
|
+
// 워크블로우 관련
|
|
102
|
+
workFlow?: WorkFlowInfo;
|
|
103
|
+
|
|
104
|
+
// UI 관련 추가 필드
|
|
105
|
+
buttons?: Button[]; // 버튼이 있는 경우
|
|
106
|
+
form?: Form; // 폼이 있는 경우
|
|
107
|
+
files?: FileInfo[]; // 파일이 있는 경우
|
|
108
|
+
images?: ImageInfo[]; // 이미지가 있는 경우
|
|
109
|
+
webPage?: string; // 임베드 웹페이지가 있는 경우
|
|
110
|
+
|
|
111
|
+
// 확장성을 위한 추가 필드
|
|
112
|
+
userNo?: string; // 사용자 번호
|
|
113
|
+
centerCd?: string; // 센터 코드
|
|
114
|
+
msgIconUrl?: string; // 메시지 아이콘 URL
|
|
115
|
+
userType?: string; // 사용자 타입
|
|
116
|
+
isBot?: boolean; // 봇 여부
|
|
117
|
+
|
|
118
|
+
// 임시 메시지 구분용
|
|
119
|
+
isAPIMessage?: boolean; // 임시 메시지 여부 (웹소켓 응답 전)
|
|
120
|
+
|
|
121
|
+
// 실시간 메시지인지 확인요
|
|
122
|
+
type: 'live' | 'basic' | 'prev'; // live : 소켓 , basic : 최초 API , prev : 무한스크롤
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// 메시지에 특정 컨텐츠가 있는지 확인하는 헬퍼 함수들
|
|
126
|
+
export const hasBlocks = (message: Message): boolean => !!message.blocks && message.blocks.length > 0;
|
|
127
|
+
|
|
128
|
+
//
|
|
129
|
+
export const hasRichForm = (message: Message): boolean => !!(message.richText && message.richText.structuredData);
|
|
130
|
+
|
|
131
|
+
// 사용자가 워크플로우 대답 클릭한거
|
|
132
|
+
export const hasCustomerWorkFlowClickData = (message: Message): boolean =>
|
|
133
|
+
message.templateType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3;
|
|
134
|
+
export const hasButtons = (message: Message): boolean => !!message.buttons && message.buttons.length > 0;
|
|
135
|
+
// 폼인지 여부
|
|
136
|
+
export const hasForm = (message: Message): boolean =>
|
|
137
|
+
message.templateType === InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4;
|
|
138
|
+
|
|
139
|
+
// 파일 자체가 있는지
|
|
140
|
+
export const hasFileArray = (message: Message): boolean => !!message.files && message.files.length > 0;
|
|
141
|
+
|
|
142
|
+
// 이미지 외 파일이 있는지
|
|
143
|
+
export const hasFiles = (message: Message): boolean =>
|
|
144
|
+
!!message.files && message.files.filter(fil => fil.type !== 'image').length > 0;
|
|
145
|
+
|
|
146
|
+
// 이미지가 있는지
|
|
147
|
+
export const hasImages = (message: Message): boolean =>
|
|
148
|
+
!!message.files && message.files.filter(fil => fil.type === 'image').length > 0;
|
|
149
|
+
export const hasWebPage = (message: Message): boolean => !!message.webPage;
|
|
150
|
+
export const hasWorkFlow = (message: Message): boolean =>
|
|
151
|
+
[
|
|
152
|
+
String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_1),
|
|
153
|
+
String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_2),
|
|
154
|
+
String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_3),
|
|
155
|
+
String(InquiryMessageTemplateType.WORK_FLOW_TEMPLATE_4)
|
|
156
|
+
].includes(message?.templateType || '');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface MessageObject {
|
|
2
|
+
exposeObjectListYn?: boolean;
|
|
3
|
+
messageNumber?: string;
|
|
4
|
+
workFlowNumber?: string;
|
|
5
|
+
objectList?: MessageObjectExpose[];
|
|
6
|
+
workFlowProgressStack: string[];
|
|
7
|
+
objectGroupUiCode: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MessageObjectExpose {
|
|
10
|
+
objectNumber: string;
|
|
11
|
+
objectName: string;
|
|
12
|
+
iconImageUrl: string;
|
|
13
|
+
sequence: number;
|
|
14
|
+
actionCode: string;
|
|
15
|
+
objectUiCode: string;
|
|
16
|
+
linkUrl: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface MessageObject {
|
|
2
|
+
exposeObjectListYn?: boolean; // 오브젝트 목록 노출 여부
|
|
3
|
+
messageNumber?: string; // 연결된 메시지 번호
|
|
4
|
+
workFlowNumber?: string; // 연결된 워크플로우 번호
|
|
5
|
+
objectList?: MessageObjectExpose[]; // 노출될 오브젝트 리스트
|
|
6
|
+
workFlowProgressStack: string[];
|
|
7
|
+
objectGroupUiCode: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface MessageObjectExpose {
|
|
11
|
+
objectNumber: string; // 오브젝트 고유 번호
|
|
12
|
+
objectName: string; // 오브젝트 이름 (버튼/옵션 텍스트 등)
|
|
13
|
+
iconImageUrl: string; // 오브젝트 아이콘 이미지 URL
|
|
14
|
+
sequence: number; // 노출 순서
|
|
15
|
+
actionCode: string; // 액션 코드 (예: WFL00900004)
|
|
16
|
+
objectUiCode: string; // 오브젝트 UI 코드 (예: WFL01000001)
|
|
17
|
+
linkUrl: string; //링크정보
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface IInquiryWorkFlowUpdate {
|
|
2
|
+
chat_inquiry_number: string;
|
|
3
|
+
message_number: string;
|
|
4
|
+
object_group_ui_code: string;
|
|
5
|
+
object_list: {
|
|
6
|
+
action_code: string;
|
|
7
|
+
icon_image_url: string;
|
|
8
|
+
link_url: string;
|
|
9
|
+
object_name: string;
|
|
10
|
+
object_number: string;
|
|
11
|
+
object_ui_code: string;
|
|
12
|
+
sequence: number;
|
|
13
|
+
}[];
|
|
14
|
+
work_flow_progress_stack: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface IInquiryWorkFlowUpdate {
|
|
2
|
+
chat_inquiry_number: string;
|
|
3
|
+
message_number: string;
|
|
4
|
+
object_group_ui_code: string;
|
|
5
|
+
object_list: {
|
|
6
|
+
action_code: string;
|
|
7
|
+
icon_image_url: string;
|
|
8
|
+
link_url: string;
|
|
9
|
+
object_name: string;
|
|
10
|
+
object_number: string;
|
|
11
|
+
object_ui_code: string;
|
|
12
|
+
sequence: number;
|
|
13
|
+
}[];
|
|
14
|
+
work_flow_progress_stack: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const ShadowBox = ({ className = '' }) => {
|
|
3
|
+
return (<div className={`${className} pointer-events-none absolute bottom-0 left-0 z-[0] h-[50px] w-full bg-gradient-to-t from-[rgba(255,255,255,1)] to-[rgba(255,255,255,0)]`}/>);
|
|
4
|
+
};
|
|
5
|
+
export default ShadowBox;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface IShadowBox {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const ShadowBox = ({ className = '' }: IShadowBox) => {
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
className={`${className} pointer-events-none absolute bottom-0 left-0 z-[0] h-[50px] w-full bg-gradient-to-t from-[rgba(255,255,255,1)] to-[rgba(255,255,255,0)]`}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default ShadowBox;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Button1Props {
|
|
3
|
+
onClick?: () => void | Promise<void>;
|
|
4
|
+
type?: 'button' | 'submit' | 'reset';
|
|
5
|
+
className?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Button1: ({ onClick, type, className, children, isDisabled }: Button1Props) => React.JSX.Element;
|
|
10
|
+
export default Button1;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const Button1 = ({ onClick, type = 'button', className = '', children, isDisabled = false }) => {
|
|
3
|
+
return (<button disabled={isDisabled} type={type} onClick={onClick} className={`
|
|
4
|
+
h-[38px] rounded-[10px] bg-[#2E385B] text-center text-[14px]
|
|
5
|
+
font-[700] leading-[100%] tracking-[-4%] text-white
|
|
6
|
+
disabled:bg-drTalkDisabled
|
|
7
|
+
${className}
|
|
8
|
+
`}>
|
|
9
|
+
{children}
|
|
10
|
+
</button>);
|
|
11
|
+
};
|
|
12
|
+
export default Button1;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface Button1Props {
|
|
4
|
+
onClick?: () => void | Promise<void>;
|
|
5
|
+
type?: 'button' | 'submit' | 'reset';
|
|
6
|
+
className?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Button1 = ({ onClick, type = 'button', className = '', children, isDisabled = false }: Button1Props) => {
|
|
12
|
+
return (
|
|
13
|
+
<button
|
|
14
|
+
disabled={isDisabled}
|
|
15
|
+
type={type}
|
|
16
|
+
onClick={onClick}
|
|
17
|
+
className={`
|
|
18
|
+
h-[38px] rounded-[10px] bg-[#2E385B] text-center text-[14px]
|
|
19
|
+
font-[700] leading-[100%] tracking-[-4%] text-white
|
|
20
|
+
disabled:bg-drTalkDisabled
|
|
21
|
+
${className}
|
|
22
|
+
`}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</button>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Button1;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Button2Props {
|
|
3
|
+
onClick?: () => void | Promise<void>;
|
|
4
|
+
type?: 'button' | 'submit' | 'reset';
|
|
5
|
+
className?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Button2: ({ onClick, type, className, children, isDisabled }: Button2Props) => React.JSX.Element;
|
|
10
|
+
export default Button2;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const Button2 = ({ onClick, type = 'button', className = '', children, isDisabled = false }) => {
|
|
3
|
+
return (<button disabled={isDisabled} type={type} onClick={onClick} className={`
|
|
4
|
+
dr_talk_body_small1 h-[40px] rounded-[6px] bg-[#AA1D36]
|
|
5
|
+
text-center text-drTalkWhite
|
|
6
|
+
disabled:bg-drTalkDisabled
|
|
7
|
+
${className}
|
|
8
|
+
`}>
|
|
9
|
+
{children}
|
|
10
|
+
</button>);
|
|
11
|
+
};
|
|
12
|
+
export default Button2;
|