@antscorp/antsomi-ui 1.3.5-beta.570 → 1.3.5-beta.571
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/es/components/atoms/SlideBar/SlideBar.js +3 -1
- package/es/components/atoms/Slider/index.js +3 -8
- package/es/components/icons/PivotTableChartIcon.d.ts +3 -0
- package/es/components/icons/PivotTableChartIcon.js +11 -0
- package/es/components/icons/index.d.ts +5 -4
- package/es/components/icons/index.js +5 -4
- package/es/components/molecules/AccountSelection/index.d.ts +2 -1
- package/es/components/molecules/CalendarSelection/CalendarSelection.js +2 -2
- package/es/components/molecules/ChatBox/ChatBox.js +22 -34
- package/es/components/molecules/ChatBox/MessageItem.js +8 -14
- package/es/components/molecules/ChatBox/constants.d.ts +0 -5
- package/es/components/molecules/ChatBox/constants.js +0 -27
- package/es/components/molecules/ChatBox/styled.d.ts +1 -5
- package/es/components/molecules/ChatBox/styled.js +2 -28
- package/es/components/molecules/ChatBox/types.d.ts +0 -3
- package/es/components/molecules/ColorPicker/CustomPicker/index.js +3 -3
- package/es/components/molecules/ColorPicker/index.d.ts +0 -1
- package/es/components/molecules/ColorPicker/index.js +2 -3
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +1 -1
- package/es/components/molecules/FontSetting/index.js +1 -1
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +1 -1
- package/es/components/molecules/TemplateSaveAs/styled.js +1 -1
- package/es/components/molecules/UploadImage/index.d.ts +0 -1
- package/es/components/molecules/UploadImage/index.js +4 -38
- package/es/components/molecules/index.d.ts +1 -1
- package/es/components/molecules/index.js +1 -1
- package/es/components/organism/ContentSources/Settings.d.ts +0 -3
- package/es/components/organism/ContentSources/Settings.js +1 -1
- package/es/components/organism/ContentSources/index.d.ts +0 -3
- package/es/components/organism/ContentSources/index.js +3 -4
- package/es/components/organism/DataTable/components/Toolbar/GroupByPopover.d.ts +5 -0
- package/es/components/organism/DataTable/components/Toolbar/GroupByPopover.js +19 -0
- package/es/components/organism/DataTable/components/Toolbar/ToolbarActionButtons.js +13 -0
- package/es/components/organism/DataTable/components/Toolbar/index.js +1 -0
- package/es/components/organism/DataTable/constants/toolbar.d.ts +1 -0
- package/es/components/organism/DataTable/constants/toolbar.js +8 -2
- package/es/components/organism/PreviewTemplateModal/components/Banner/index.js +1 -1
- package/es/components/organism/index.d.ts +0 -1
- package/es/components/organism/index.js +0 -1
- package/es/components/template/Layout/Layout.js +0 -6
- package/es/constants/queries.d.ts +0 -1
- package/es/constants/queries.js +0 -1
- package/es/locales/en/translation.json +2 -1
- package/es/locales/i18n.d.ts +2 -0
- package/es/locales/translations.d.ts +1 -0
- package/es/locales/vi/translation.json +2 -1
- package/es/providers/ConfigProvider/GlobalStyle.js +0 -9
- package/es/queries/index.d.ts +0 -1
- package/es/queries/index.js +0 -1
- package/es/test.d.ts +11 -0
- package/es/test.js +358 -151
- package/package.json +1 -1
- package/es/__tests__/fileMock.test.d.ts +0 -2
- package/es/__tests__/fileMock.test.js +0 -2
- package/es/__tests__/styleMock.test.d.ts +0 -1
- package/es/__tests__/styleMock.test.js +0 -2
- package/es/components/atoms/Popover/styled.d.ts +0 -4
- package/es/components/atoms/Popover/styled.js +0 -5
- package/es/components/molecules/ChatBox/QuestionItem.d.ts +0 -7
- package/es/components/molecules/ChatBox/QuestionItem.js +0 -11
- package/es/components/molecules/ChatBox/utils.d.ts +0 -2
- package/es/components/molecules/ChatBox/utils.js +0 -18
- package/es/components/molecules/UploadImage/MediaThumb.d.ts +0 -8
- package/es/components/molecules/UploadImage/MediaThumb.js +0 -15
- package/es/components/molecules/UploadImage/VideoThumbnail.d.ts +0 -4
- package/es/components/molecules/UploadImage/VideoThumbnail.js +0 -43
- package/es/components/organism/GenerativeInsights/constants.d.ts +0 -1
- package/es/components/organism/GenerativeInsights/constants.js +0 -1
- package/es/components/organism/GenerativeInsights/index.d.ts +0 -11
- package/es/components/organism/GenerativeInsights/index.js +0 -57
- package/es/components/organism/GenerativeInsights/styled.d.ts +0 -12
- package/es/components/organism/GenerativeInsights/styled.js +0 -66
- package/es/components/organism/GenerativeInsights/utils.d.ts +0 -13
- package/es/components/organism/GenerativeInsights/utils.js +0 -50
- package/es/queries/Media/index.d.ts +0 -1
- package/es/queries/Media/index.js +0 -1
- package/es/queries/Media/useGetListingSavedMedia.d.ts +0 -12
- package/es/queries/Media/useGetListingSavedMedia.js +0 -10
|
@@ -264,7 +264,9 @@ export const SlideBar = props => {
|
|
|
264
264
|
fontSize: `${BTN_ADD_SIZE}px`,
|
|
265
265
|
cursor: disabledAdd ? 'not-allowed' : 'pointer',
|
|
266
266
|
color: disabledAdd ? (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.colorTextDisabled : (_d = THEME.token) === null || _d === void 0 ? void 0 : _d.colorPrimary,
|
|
267
|
-
},
|
|
267
|
+
},
|
|
268
|
+
// disabled={disabledAdd}
|
|
269
|
+
onClick: (e) => {
|
|
268
270
|
e.stopPropagation();
|
|
269
271
|
if (!disabledAdd) {
|
|
270
272
|
handleAddSlide();
|
|
@@ -9,20 +9,15 @@ export const Slider = memo(props => {
|
|
|
9
9
|
const { range, value, min = 0, max = 0, className, tooltipVisible } = props;
|
|
10
10
|
const isNegative = useMemo(() => !!(!range && min < 0), [range, min]);
|
|
11
11
|
const calculateWidth = useMemo(() => ((value || 0) * 100) / (Math.abs(max) + Math.abs(min) || 1), [min, max, value]);
|
|
12
|
-
|
|
13
|
-
const restProps = omit(props, ['tooltipVisible']);
|
|
12
|
+
const restProps = tooltipVisible === 'default' ? omit(props, ['tooltipVisible']) : props;
|
|
14
13
|
if (isNegative) {
|
|
15
14
|
return (React.createElement(SliderWrapper, { isNegative: true, width: calculateWidth, className: className },
|
|
16
|
-
React.createElement(AntdSlider, Object.assign({}, omit(restProps, ['marks', 'className']), {
|
|
17
|
-
open: tooltipVisible,
|
|
18
|
-
}, marks: {
|
|
15
|
+
React.createElement(AntdSlider, Object.assign({}, omit(restProps, ['marks', 'className']), { marks: {
|
|
19
16
|
0: ' ',
|
|
20
17
|
} }))));
|
|
21
18
|
}
|
|
22
19
|
return (React.createElement(SliderWrapper, { className: className },
|
|
23
|
-
React.createElement(AntdSlider, Object.assign({}, restProps
|
|
24
|
-
open: tooltipVisible,
|
|
25
|
-
} }))));
|
|
20
|
+
React.createElement(AntdSlider, Object.assign({}, restProps))));
|
|
26
21
|
});
|
|
27
22
|
Slider.defaultProps = {
|
|
28
23
|
tooltipVisible: false,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { useIcon } from './hooks/useIcon';
|
|
3
|
+
export const PivotTableChartIcon = forwardRef((props, ref) => {
|
|
4
|
+
// search tag: group by, pivot table
|
|
5
|
+
const { width, height } = useIcon(props);
|
|
6
|
+
return (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", enableBackground: "new 0 0 24 24", viewBox: "0 0 24 24", fill: "currentColor" }, props, { ref: ref, width: width, height: height }),
|
|
7
|
+
React.createElement("g", null,
|
|
8
|
+
React.createElement("path", { d: "M0,0h24v24H0V0z", fill: "none" })),
|
|
9
|
+
React.createElement("g", null,
|
|
10
|
+
React.createElement("path", { d: "M21,5c0-1.1-0.9-2-2-2h-9v5h11V5z M3,19c0,1.1,0.9,2,2,2h3V10H3V19z M3,5v3h5V3H5C3.9,3,3,3.9,3,5z M18,8.99L14,13 l1.41,1.41l1.59-1.6V15c0,1.1-0.9,2-2,2h-2.17l1.59-1.59L13,14l-4,4l4,4l1.41-1.41L12.83,19H15c2.21,0,4-1.79,4-4v-2.18l1.59,1.6 L22,13L18,8.99z" }))));
|
|
11
|
+
});
|
|
@@ -32,13 +32,13 @@ export { ChatBubbleOutlineIcon } from './ChatBubbleOutlineIcon';
|
|
|
32
32
|
export { ChatConversationCommentAddCommentIcon } from './ChatConversationCommentAddCommentIcon';
|
|
33
33
|
export { ChatMentionIcon } from './ChatMentionIcon';
|
|
34
34
|
export { ChatUnreadIcon } from './ChatUnreadIcon';
|
|
35
|
+
export { CheckSlimIcon } from './CheckSlimIcon';
|
|
35
36
|
export { CheckboxChecked5RadiusIcon } from './CheckboxChecked5RadiusIcon';
|
|
36
37
|
export { CheckboxCheckedIcon } from './CheckboxCheckedIcon';
|
|
37
38
|
export { CheckboxIndeterminate5RadiusIcon } from './CheckboxIndeterminate5RadiusIcon';
|
|
38
39
|
export { CheckboxIndeterminateIcon } from './CheckboxIndeterminateIcon';
|
|
39
40
|
export { CheckboxUnchecked5RadiusIcon } from './CheckboxUnchecked5RadiusIcon';
|
|
40
41
|
export { CheckboxUncheckedIcon } from './CheckboxUncheckedIcon';
|
|
41
|
-
export { CheckSlimIcon } from './CheckSlimIcon';
|
|
42
42
|
export { CircleAddElementIcon } from './CircleAddElementIcon';
|
|
43
43
|
export { CircleNotificationsIcon } from './CircleNotificationsIcon';
|
|
44
44
|
export { CloseIcon } from './CloseIcon';
|
|
@@ -100,9 +100,9 @@ export { ForecastIcon } from './ForecastIcon';
|
|
|
100
100
|
export { ForwardIcon } from './ForwardIcon';
|
|
101
101
|
export { FreeDrawIcon } from './FreeDrawIcon';
|
|
102
102
|
export { FullReviewIcon } from './FullReviewIcon';
|
|
103
|
+
export { GPTIcon } from './GPTIcon';
|
|
103
104
|
export { GenerateAutoWizardIcon } from './GenerateAutoWizardIcon';
|
|
104
105
|
export { GetInsightIcon } from './GetInsightIcon';
|
|
105
|
-
export { GPTIcon } from './GPTIcon';
|
|
106
106
|
export { GridViewIcon } from './GridViewIcon';
|
|
107
107
|
export { GroupIcon } from './GroupIcon';
|
|
108
108
|
export { GroupLayerIcon } from './GroupLayerIcon';
|
|
@@ -145,8 +145,8 @@ export { MoveToIcon } from './MoveToIcon';
|
|
|
145
145
|
export { MuteIcon } from './MuteIcon';
|
|
146
146
|
export { NodeViewIcon } from './NodeViewIcon';
|
|
147
147
|
export { NotificationIcon } from './NotificationIcon';
|
|
148
|
-
export { NotificationsActiveIcon } from './NotificationsActiveIcon';
|
|
149
148
|
export { NotificationSettingIcon } from './NotificationSettingIcon';
|
|
149
|
+
export { NotificationsActiveIcon } from './NotificationsActiveIcon';
|
|
150
150
|
export { OpenNewTabIcon } from './OpenNewTabIcon';
|
|
151
151
|
export { OpenUrlIcon } from './OpenUrlIcon';
|
|
152
152
|
export { PageArticleIcon } from './PageArticleIcon';
|
|
@@ -156,6 +156,7 @@ export { PenDrawingIcon } from './PenDrawingIcon';
|
|
|
156
156
|
export { PersonAddDisabledIcon } from './PersonAddDisabledIcon';
|
|
157
157
|
export { PersonUserAccountIcon } from './PersonUserAccountIcon';
|
|
158
158
|
export { PhoneCallbackIcon } from './PhoneCallbackIcon';
|
|
159
|
+
export { PivotTableChartIcon } from './PivotTableChartIcon';
|
|
159
160
|
export { PlaneIcon } from './PlaneIcon';
|
|
160
161
|
export { PreviewIcon } from './PreviewIcon';
|
|
161
162
|
export { PreviewVisibilityEyeIcon } from './PreviewVisibilityEyeIcon';
|
|
@@ -231,7 +232,7 @@ export { ViewDetailsInformationIcon } from './ViewDetailsInformationIcon';
|
|
|
231
232
|
export { VisibilityOffEyeIcon } from './VisibilityOffEyeIcon';
|
|
232
233
|
export { WarningIcon } from './WarningIcon';
|
|
233
234
|
export { WebAssetIcon } from './WebAssetIcon';
|
|
234
|
-
export { WebhookIcon } from './WebhookIcon';
|
|
235
235
|
export { WebIcon } from './WebIcon';
|
|
236
|
+
export { WebhookIcon } from './WebhookIcon';
|
|
236
237
|
export { WidgetIcon } from './WidgetIcon';
|
|
237
238
|
export { WritingAIAssitantIcon } from './WritingAIAssitantIcon';
|
|
@@ -32,13 +32,13 @@ export { ChatBubbleOutlineIcon } from './ChatBubbleOutlineIcon';
|
|
|
32
32
|
export { ChatConversationCommentAddCommentIcon } from './ChatConversationCommentAddCommentIcon';
|
|
33
33
|
export { ChatMentionIcon } from './ChatMentionIcon';
|
|
34
34
|
export { ChatUnreadIcon } from './ChatUnreadIcon';
|
|
35
|
+
export { CheckSlimIcon } from './CheckSlimIcon';
|
|
35
36
|
export { CheckboxChecked5RadiusIcon } from './CheckboxChecked5RadiusIcon';
|
|
36
37
|
export { CheckboxCheckedIcon } from './CheckboxCheckedIcon';
|
|
37
38
|
export { CheckboxIndeterminate5RadiusIcon } from './CheckboxIndeterminate5RadiusIcon';
|
|
38
39
|
export { CheckboxIndeterminateIcon } from './CheckboxIndeterminateIcon';
|
|
39
40
|
export { CheckboxUnchecked5RadiusIcon } from './CheckboxUnchecked5RadiusIcon';
|
|
40
41
|
export { CheckboxUncheckedIcon } from './CheckboxUncheckedIcon';
|
|
41
|
-
export { CheckSlimIcon } from './CheckSlimIcon';
|
|
42
42
|
export { CircleAddElementIcon } from './CircleAddElementIcon';
|
|
43
43
|
export { CircleNotificationsIcon } from './CircleNotificationsIcon';
|
|
44
44
|
export { CloseIcon } from './CloseIcon';
|
|
@@ -100,9 +100,9 @@ export { ForecastIcon } from './ForecastIcon';
|
|
|
100
100
|
export { ForwardIcon } from './ForwardIcon';
|
|
101
101
|
export { FreeDrawIcon } from './FreeDrawIcon';
|
|
102
102
|
export { FullReviewIcon } from './FullReviewIcon';
|
|
103
|
+
export { GPTIcon } from './GPTIcon';
|
|
103
104
|
export { GenerateAutoWizardIcon } from './GenerateAutoWizardIcon';
|
|
104
105
|
export { GetInsightIcon } from './GetInsightIcon';
|
|
105
|
-
export { GPTIcon } from './GPTIcon';
|
|
106
106
|
export { GridViewIcon } from './GridViewIcon';
|
|
107
107
|
export { GroupIcon } from './GroupIcon';
|
|
108
108
|
export { GroupLayerIcon } from './GroupLayerIcon';
|
|
@@ -145,8 +145,8 @@ export { MoveToIcon } from './MoveToIcon';
|
|
|
145
145
|
export { MuteIcon } from './MuteIcon';
|
|
146
146
|
export { NodeViewIcon } from './NodeViewIcon';
|
|
147
147
|
export { NotificationIcon } from './NotificationIcon';
|
|
148
|
-
export { NotificationsActiveIcon } from './NotificationsActiveIcon';
|
|
149
148
|
export { NotificationSettingIcon } from './NotificationSettingIcon';
|
|
149
|
+
export { NotificationsActiveIcon } from './NotificationsActiveIcon';
|
|
150
150
|
export { OpenNewTabIcon } from './OpenNewTabIcon';
|
|
151
151
|
export { OpenUrlIcon } from './OpenUrlIcon';
|
|
152
152
|
export { PageArticleIcon } from './PageArticleIcon';
|
|
@@ -156,6 +156,7 @@ export { PenDrawingIcon } from './PenDrawingIcon';
|
|
|
156
156
|
export { PersonAddDisabledIcon } from './PersonAddDisabledIcon';
|
|
157
157
|
export { PersonUserAccountIcon } from './PersonUserAccountIcon';
|
|
158
158
|
export { PhoneCallbackIcon } from './PhoneCallbackIcon';
|
|
159
|
+
export { PivotTableChartIcon } from './PivotTableChartIcon';
|
|
159
160
|
export { PlaneIcon } from './PlaneIcon';
|
|
160
161
|
export { PreviewIcon } from './PreviewIcon';
|
|
161
162
|
export { PreviewVisibilityEyeIcon } from './PreviewVisibilityEyeIcon';
|
|
@@ -231,7 +232,7 @@ export { ViewDetailsInformationIcon } from './ViewDetailsInformationIcon';
|
|
|
231
232
|
export { VisibilityOffEyeIcon } from './VisibilityOffEyeIcon';
|
|
232
233
|
export { WarningIcon } from './WarningIcon';
|
|
233
234
|
export { WebAssetIcon } from './WebAssetIcon';
|
|
234
|
-
export { WebhookIcon } from './WebhookIcon';
|
|
235
235
|
export { WebIcon } from './WebIcon';
|
|
236
|
+
export { WebhookIcon } from './WebhookIcon';
|
|
236
237
|
export { WidgetIcon } from './WidgetIcon';
|
|
237
238
|
export { WritingAIAssitantIcon } from './WritingAIAssitantIcon';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { AccountSelection, type AccountSelectionProps } from './AccountSelection';
|
|
2
|
-
export { AccountListing
|
|
2
|
+
export { AccountListing } from './AccountListing';
|
|
3
|
+
export type { AccountListingHandle } from './AccountListing';
|
|
3
4
|
export { useAccountSelection } from './hooks';
|
|
@@ -13,9 +13,9 @@ export const CalendarSelection = props => {
|
|
|
13
13
|
const { value, rangeLimit = RANGE_LIMIT, timezone = LOCAL_TIMEZONE, timeDisplayProps, popoverProps, rangePickerProps, onChange, } = props;
|
|
14
14
|
const [state, dispatch] = useReducer(reducer, INITIAL_STATE);
|
|
15
15
|
useLayoutEffect(() => {
|
|
16
|
-
if (!value
|
|
16
|
+
if (!value)
|
|
17
17
|
return;
|
|
18
|
-
dispatch(initState(value, initialed.current));
|
|
18
|
+
dispatch(initState(value, !initialed.current));
|
|
19
19
|
initialed.current = true;
|
|
20
20
|
}, [value]);
|
|
21
21
|
useLayoutEffect(() => {
|
|
@@ -13,23 +13,18 @@ import React, { useEffect, useState, useRef, useCallback } from 'react';
|
|
|
13
13
|
import clsx from 'clsx';
|
|
14
14
|
import axios from 'axios';
|
|
15
15
|
// Atoms
|
|
16
|
-
import { Button,
|
|
16
|
+
import { Button, Typography } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
17
17
|
import { Input as AntdInput } from 'antd';
|
|
18
18
|
// Components
|
|
19
19
|
import MessageItem from './MessageItem';
|
|
20
20
|
import { CloseIcon, PlaneIcon, WarningIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
21
|
-
import { QuestionItem } from './QuestionItem';
|
|
22
21
|
// Styled
|
|
23
|
-
import { ChatBoxWrapper, ChatBoxHeader, ChatBoxBody, ChatBoxFooter, WarningWrapper, InputWrapper,
|
|
24
|
-
// Utils
|
|
25
|
-
import { buildConversation } from './utils';
|
|
26
|
-
// Constants
|
|
27
|
-
import { SUGGESTED_QUESTIONS } from './constants';
|
|
22
|
+
import { ChatBoxWrapper, ChatBoxHeader, ChatBoxBody, ChatBoxFooter, WarningWrapper, InputWrapper, } from './styled';
|
|
28
23
|
const { TextArea } = AntdInput;
|
|
29
24
|
const { Text } = Typography;
|
|
30
25
|
export const ChatBox = props => {
|
|
31
26
|
var _a;
|
|
32
|
-
const { onClose, domain, userId, token, withoutBox, avatar, style
|
|
27
|
+
const { onClose, domain, userId, token, withoutBox, avatar, style } = props;
|
|
33
28
|
const [question, setQuestion] = useState('');
|
|
34
29
|
const [isClosed, setIsClosed] = useState(false);
|
|
35
30
|
const [limitMessage, setLimitMessage] = useState('');
|
|
@@ -40,7 +35,6 @@ export const ChatBox = props => {
|
|
|
40
35
|
const inputRef = useRef(null);
|
|
41
36
|
const initRef = useRef(false);
|
|
42
37
|
const answeringRef = useRef(false);
|
|
43
|
-
const [isOpenSuggestedQuestion, setIsOpenSuggestedQuestions] = useState(false);
|
|
44
38
|
const scrollBody = useCallback(() => {
|
|
45
39
|
if (bodyRef.current) {
|
|
46
40
|
bodyRef.current.scrollTo(0, bodyRef.current.scrollHeight);
|
|
@@ -75,16 +69,24 @@ export const ChatBox = props => {
|
|
|
75
69
|
},
|
|
76
70
|
});
|
|
77
71
|
if (result && result.data && result.data.data && result.data.data.rows) {
|
|
78
|
-
const initConversation =
|
|
72
|
+
const initConversation = [];
|
|
73
|
+
result.data.data.rows
|
|
74
|
+
.sort((a, b) => a.message_id - b.message_id)
|
|
75
|
+
.forEach(mess => {
|
|
76
|
+
initConversation.push({
|
|
77
|
+
id: mess.message_id,
|
|
78
|
+
role: "user" /* Role.User */,
|
|
79
|
+
content: mess.message,
|
|
80
|
+
});
|
|
81
|
+
initConversation.push({
|
|
82
|
+
id: `gpt_${mess.message_id}`,
|
|
83
|
+
role: "assistant" /* Role.Assistant */,
|
|
84
|
+
content: mess.response_message,
|
|
85
|
+
});
|
|
86
|
+
});
|
|
79
87
|
setConversation(initConversation);
|
|
80
88
|
}
|
|
81
89
|
});
|
|
82
|
-
const handleClickQuestion = question => {
|
|
83
|
-
const { message } = question;
|
|
84
|
-
setQuestion(message);
|
|
85
|
-
setIsOpenSuggestedQuestions(false);
|
|
86
|
-
};
|
|
87
|
-
const renderContentSuggested = () => (React.createElement(WrapperContentSuggest, null, SUGGESTED_QUESTIONS.map((question) => (React.createElement(QuestionItem, Object.assign({}, question, { message: question.message, onClickItem: question => handleClickQuestion(question) }))))));
|
|
88
90
|
const request = (question) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
91
|
if (!question)
|
|
90
92
|
return;
|
|
@@ -106,17 +108,9 @@ export const ChatBox = props => {
|
|
|
106
108
|
}
|
|
107
109
|
});
|
|
108
110
|
useEffect(() => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
}, [conversationData]);
|
|
114
|
-
useEffect(() => {
|
|
115
|
-
if (!isGenerativeMode) {
|
|
116
|
-
loadConversation();
|
|
117
|
-
if (inputRef.current) {
|
|
118
|
-
inputRef.current.focus();
|
|
119
|
-
}
|
|
111
|
+
loadConversation();
|
|
112
|
+
if (inputRef.current) {
|
|
113
|
+
inputRef.current.focus();
|
|
120
114
|
}
|
|
121
115
|
}, []);
|
|
122
116
|
useEffect(() => {
|
|
@@ -145,7 +139,7 @@ export const ChatBox = props => {
|
|
|
145
139
|
onClose();
|
|
146
140
|
}
|
|
147
141
|
};
|
|
148
|
-
const renderMessage = (message, idx, isPlaceholder = false) => (React.createElement(MessageItem, Object.assign({ key: idx, idx: idx }, message, { scrollBody: scrollBody, renderDone: renderDone, doAnimation: initRef.current && idx === conversation.length - 1, avatar: avatar, isPlaceholder: isPlaceholder
|
|
142
|
+
const renderMessage = (message, idx, isPlaceholder = false) => (React.createElement(MessageItem, Object.assign({ key: idx, idx: idx }, message, { scrollBody: scrollBody, renderDone: renderDone, doAnimation: initRef.current && idx === conversation.length - 1, avatar: avatar, isPlaceholder: isPlaceholder })));
|
|
149
143
|
const handleKeyDown = e => {
|
|
150
144
|
if (e.key === 'Enter') {
|
|
151
145
|
e.preventDefault();
|
|
@@ -183,12 +177,6 @@ export const ChatBox = props => {
|
|
|
183
177
|
limitMessage && (React.createElement(WarningWrapper, null,
|
|
184
178
|
React.createElement(WarningIcon, { className: clsx('icon') }),
|
|
185
179
|
React.createElement(Text, null, limitMessage))),
|
|
186
|
-
isGenerativeMode && (React.createElement(Popover, { arrow: false, title: "Suggested Questions", placement: "bottom", content: renderContentSuggested(), trigger: "click", open: isOpenSuggestedQuestion, getPopupContainer: triggerNode => triggerNode, onOpenChange: isOpen => setIsOpenSuggestedQuestions(isOpen), overlayInnerStyle: {
|
|
187
|
-
padding: '12px 16px',
|
|
188
|
-
minWidth: '330px',
|
|
189
|
-
overflow: 'auto',
|
|
190
|
-
} },
|
|
191
|
-
React.createElement(Button, { onClick: () => setIsOpenSuggestedQuestions(true), type: "text" }, "Suggested Questions"))),
|
|
192
180
|
React.createElement(InputWrapper, null,
|
|
193
181
|
React.createElement(TextArea, { ref: inputRef, value: question, onChange: e => setQuestion(e.target.value), className: clsx('input'), placeholder: "Type your question...", onKeyDown: handleKeyDown, autoSize: true }),
|
|
194
182
|
React.createElement(Button, { disabled: isAnswering, className: clsx('submit-btn', { disabled: isAnswering }), onClick: () => handleKeyDown({ key: 'Enter', preventDefault: () => null }) },
|
|
@@ -9,10 +9,9 @@ import { Typography } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
|
9
9
|
// Components
|
|
10
10
|
import { GPTIcon, UserIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
11
11
|
// Style
|
|
12
|
-
import { MessageItemWrapper
|
|
13
|
-
import Icon from '@antscorp/icons';
|
|
12
|
+
import { MessageItemWrapper } from './styled';
|
|
14
13
|
const { Text } = Typography;
|
|
15
|
-
const MessageItem = ({ role, content, scrollBody, renderDone, doAnimation, avatar, idx, isPlaceholder, renderType,
|
|
14
|
+
const MessageItem = ({ role, content, scrollBody, renderDone, doAnimation, avatar, idx, isPlaceholder, renderType, }) => {
|
|
16
15
|
const isBot = role === "assistant" /* Role.Assistant */;
|
|
17
16
|
const [text, setText] = useState(isBot && doAnimation ? '' : content);
|
|
18
17
|
const contentRef = useRef();
|
|
@@ -47,7 +46,7 @@ const MessageItem = ({ role, content, scrollBody, renderDone, doAnimation, avata
|
|
|
47
46
|
const newContent = isPlaceholder ? (React.createElement("div", { className: "reactMarkDown" },
|
|
48
47
|
React.createElement("pre", null,
|
|
49
48
|
React.createElement("code", null,
|
|
50
|
-
React.createElement("span", null))))) : (React.createElement(ReactMarkdown, { remarkPlugins: [remarkGfm], rehypePlugins: [rehypeHighlight], className:
|
|
49
|
+
React.createElement("span", null))))) : (React.createElement(ReactMarkdown, { remarkPlugins: [remarkGfm], rehypePlugins: [rehypeHighlight], className: "reactMarkDown" }, text));
|
|
51
50
|
contentRef.current = newContent;
|
|
52
51
|
return contentRef.current;
|
|
53
52
|
}
|
|
@@ -55,16 +54,11 @@ const MessageItem = ({ role, content, scrollBody, renderDone, doAnimation, avata
|
|
|
55
54
|
return contentRef.current;
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
|
-
return (React.createElement(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
: '' }, renderMarkdown())) : (React.createElement(Text, { className: isPlaceholder || (isBot && doAnimation && text !== content) ? 'ants-text-streaming' : '' }, isPlaceholder ? '' : text))),
|
|
64
|
-
isGenerativeMode && role === "assistant" /* Role.Assistant */ && (React.createElement(WrapperIsHelpful, null,
|
|
65
|
-
React.createElement("span", null, "Was this answer helful?"),
|
|
66
|
-
React.createElement(Icon, { className: 'icon-vote', type: 'icon-ants-angle-up' }),
|
|
67
|
-
React.createElement(Icon, { className: 'icon-vote', type: 'icon-ants-angle-down' })))));
|
|
57
|
+
return (React.createElement(MessageItemWrapper, { className: clsx({ greyBg: isBot }) },
|
|
58
|
+
MAP_ICON[role],
|
|
59
|
+
renderType === 'markdown' ? (React.createElement("div", { className: isPlaceholder || (isBot && doAnimation && text.length < content.length)
|
|
60
|
+
? 'ants-text-streaming'
|
|
61
|
+
: '' }, renderMarkdown())) : (React.createElement(Text, { className: isPlaceholder || (isBot && doAnimation && text !== content) ? 'ants-text-streaming' : '' }, isPlaceholder ? '' : text))));
|
|
68
62
|
};
|
|
69
63
|
MessageItem.defaultProps = {
|
|
70
64
|
renderType: 'markdown',
|
|
@@ -49,30 +49,3 @@ export const CONVERSATION = [
|
|
|
49
49
|
},
|
|
50
50
|
];
|
|
51
51
|
export const LIMIT_MESSAGE = 10;
|
|
52
|
-
export const SUGGESTED_QUESTIONS = [
|
|
53
|
-
{
|
|
54
|
-
message_id: 54000,
|
|
55
|
-
message: `How many users did I have last week?`,
|
|
56
|
-
ctime: '2023-05-30T08:58:42.017Z',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
message_id: 54001,
|
|
60
|
-
message: `What are my top pages and screens by weeks?`,
|
|
61
|
-
ctime: '2023-05-30T08:58:42.017Z',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
message_id: 54002,
|
|
65
|
-
message: `On what days I get the most users?`,
|
|
66
|
-
ctime: '2023-05-30T08:58:42.017Z',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
message_id: 54003,
|
|
70
|
-
message: `How many new users this year?`,
|
|
71
|
-
ctime: '2023-05-30T08:58:42.017Z',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
message_id: 54004,
|
|
75
|
-
message: `What are my top events by users?`,
|
|
76
|
-
ctime: '2023-05-30T08:58:42.017Z',
|
|
77
|
-
},
|
|
78
|
-
];
|
|
@@ -4,11 +4,7 @@ export declare const ChatBoxWrapper: import("styled-components").StyledComponent
|
|
|
4
4
|
export declare const ChatBoxHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
export declare const ChatBoxBody: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
6
|
export declare const ChatBoxFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
-
export declare const MessageItemWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
-
isGenerativeMode?: boolean | undefined;
|
|
9
|
-
}, never>;
|
|
7
|
+
export declare const MessageItemWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
8
|
export declare const WarningWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
9
|
export declare const InputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
10
|
export declare const TypingCursor: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
-
export declare const WrapperIsHelpful: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
-
export declare const WrapperContentSuggest: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var _a;
|
|
1
2
|
// Libraries
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
// Constantsim
|
|
@@ -97,7 +98,7 @@ export const MessageItemWrapper = styled.div `
|
|
|
97
98
|
// text-align: justify;
|
|
98
99
|
|
|
99
100
|
&.greyBg {
|
|
100
|
-
background: ${
|
|
101
|
+
background: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.bw2};
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
.icon {
|
|
@@ -118,14 +119,6 @@ export const MessageItemWrapper = styled.div `
|
|
|
118
119
|
}
|
|
119
120
|
.reactMarkDown {
|
|
120
121
|
white-space: pre-wrap;
|
|
121
|
-
|
|
122
|
-
&.user {
|
|
123
|
-
${({ isGenerativeMode }) => isGenerativeMode &&
|
|
124
|
-
`
|
|
125
|
-
padding: 5px;
|
|
126
|
-
background-color: #F3F9FF;
|
|
127
|
-
`}
|
|
128
|
-
}
|
|
129
122
|
}
|
|
130
123
|
.reactMarkDown * {
|
|
131
124
|
font-size: 12px;
|
|
@@ -285,22 +278,3 @@ export const TypingCursor = styled.div `
|
|
|
285
278
|
// typing 3.5s steps(40, end),
|
|
286
279
|
// blink-caret .75s step-end infinite;
|
|
287
280
|
`;
|
|
288
|
-
export const WrapperIsHelpful = styled.div `
|
|
289
|
-
font-size: 11px;
|
|
290
|
-
color: #949494;
|
|
291
|
-
padding: 0 60px;
|
|
292
|
-
|
|
293
|
-
.icon-vote {
|
|
294
|
-
font-size: 18px;
|
|
295
|
-
margin-left: 10px;
|
|
296
|
-
cursor: pointer;
|
|
297
|
-
&:hover {
|
|
298
|
-
background-color: #e8e8e8;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
`;
|
|
302
|
-
export const WrapperContentSuggest = styled.div `
|
|
303
|
-
display: flex;
|
|
304
|
-
flex-direction: column;
|
|
305
|
-
gap: 10px;
|
|
306
|
-
`;
|
|
@@ -20,7 +20,6 @@ export interface IChatBoxMessageProps extends Message {
|
|
|
20
20
|
avatar?: string;
|
|
21
21
|
idx?: number;
|
|
22
22
|
renderType: 'text' | 'markdown';
|
|
23
|
-
isGenerativeMode?: boolean;
|
|
24
23
|
}
|
|
25
24
|
export interface IChatBoxProps {
|
|
26
25
|
onClose?: Function;
|
|
@@ -30,6 +29,4 @@ export interface IChatBoxProps {
|
|
|
30
29
|
token: string;
|
|
31
30
|
avatar?: string;
|
|
32
31
|
style?: Record<string, any>;
|
|
33
|
-
isGenerativeMode?: boolean;
|
|
34
|
-
conversationData?: Record<string, any>[];
|
|
35
32
|
}
|
|
@@ -53,7 +53,7 @@ const styleContainAlpha = {
|
|
|
53
53
|
const CustomPicker = props => {
|
|
54
54
|
var _a, _b, _c, _d;
|
|
55
55
|
// Props
|
|
56
|
-
const { className, style, children,
|
|
56
|
+
const { className, style, children, onChange, onChangeComplete, presetColors } = props, restOf = __rest(props, ["className", "style", "children", "onChange", "onChangeComplete", "presetColors"]);
|
|
57
57
|
// State
|
|
58
58
|
const [isShowRgbaInput, setShowRgbaInput] = useState(true);
|
|
59
59
|
const onChangeRgbaColor = (key, value) => {
|
|
@@ -101,9 +101,9 @@ const CustomPicker = props => {
|
|
|
101
101
|
React.createElement("div", { style: rgbaStyling },
|
|
102
102
|
React.createElement(InputNumberWrapper, { value: (_c = props.rgb) === null || _c === void 0 ? void 0 : _c.b, controls: false, onChange: value => onChangeRgbaColor('b', value) }),
|
|
103
103
|
React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "B")),
|
|
104
|
-
|
|
104
|
+
React.createElement("div", { style: rgbaStyling },
|
|
105
105
|
React.createElement(InputNumberWrapper, { value: (_d = props.rgb) === null || _d === void 0 ? void 0 : _d.a, controls: false, onChange: value => onChangeRgbaColor('a', value) }),
|
|
106
|
-
React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "A"))))
|
|
106
|
+
React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "A")))) : (React.createElement(EditableInputWrapper, null,
|
|
107
107
|
React.createElement(EditableInput, { value: props.color, onChange: onChange }),
|
|
108
108
|
React.createElement(Text, { style: { position: 'absolute', bottom: '-20px' } }, "HEX"))),
|
|
109
109
|
React.createElement(Button, { onClick: () => {
|
|
@@ -21,7 +21,7 @@ const styleBtnColor = {
|
|
|
21
21
|
};
|
|
22
22
|
export const ColorPicker = props => {
|
|
23
23
|
// Props
|
|
24
|
-
const { className = '', defaultColor = '#000000', presetColors, positionInput = 'left', icon, showInput = true, style = {},
|
|
24
|
+
const { className = '', defaultColor = '#000000', presetColors, positionInput = 'left', icon, showInput = true, style = {}, } = props;
|
|
25
25
|
const { onChange = () => { } } = props;
|
|
26
26
|
// States
|
|
27
27
|
const [color, setColor] = useState(defaultColor);
|
|
@@ -74,7 +74,7 @@ export const ColorPicker = props => {
|
|
|
74
74
|
};
|
|
75
75
|
return (React.createElement(ColorPickerWrapper, { className: `antsomi-color-picker ${className || ''}`, style: style },
|
|
76
76
|
showInput && positionInput === 'left' && (React.createElement(Input, { style: { textTransform: 'uppercase' }, value: color, onChange: onChangeColorInput })),
|
|
77
|
-
React.createElement(Popover, { arrow: true, content: React.createElement(CustomPicker, { color: color, presetColors: presetColors,
|
|
77
|
+
React.createElement(Popover, { arrow: true, content: React.createElement(CustomPicker, { color: color, presetColors: presetColors, onChange: onChangeColorPicker, onChangeComplete: onChangeComplete }), trigger: "click", open: popoverVisible, getPopupContainer: triggerNode => triggerNode, onOpenChange: onPopoverVisibleChange },
|
|
78
78
|
React.createElement("div", { className: "antsomi-popover-button", style: styleBtnColor }, iconNode || (React.createElement("span", { style: {
|
|
79
79
|
backgroundColor: color,
|
|
80
80
|
display: 'block',
|
|
@@ -88,7 +88,6 @@ ColorPicker.defaultProps = {
|
|
|
88
88
|
className: '',
|
|
89
89
|
color: '#000000',
|
|
90
90
|
defaultColor: '#000000',
|
|
91
|
-
isHideAlpha: false,
|
|
92
91
|
onChange: () => { },
|
|
93
92
|
showInput: true,
|
|
94
93
|
positionInput: 'left',
|
package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js
CHANGED
|
@@ -57,7 +57,7 @@ export const AdvancedRangePicker = props => {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
return (React.createElement(Space, { size:
|
|
60
|
+
return (React.createElement(Space, { size: 20, align: "end", className: className || '' },
|
|
61
61
|
React.createElement(AdvancedPicker, { valueType: valueType, disabled: disabled, label: showLabel ? t(translations.datePicker.startDate) || '' : '', date: timeRange.startDate.date, option: omit(timeRange.startDate, 'date'), operatorKey: "between", type: "startDate", format: useFormatMapping
|
|
62
62
|
? getFormatDisplayFromValueType('startDate', valueType)
|
|
63
63
|
: ADVANCED_RANGE_PICKER_FORMAT.startDate,
|
|
@@ -37,7 +37,7 @@ export const FontSettingEdit = ({ settings, styles, showSettings, onChange, }) =
|
|
|
37
37
|
[settings]);
|
|
38
38
|
const filteredSetting = useMemo(() => {
|
|
39
39
|
if (!showSettings || (showSettings === null || showSettings === void 0 ? void 0 : showSettings.length) === 0) {
|
|
40
|
-
return Object.keys(settingMap).map(keySetting =>
|
|
40
|
+
return Object.keys(settingMap).map(keySetting => settingMap[keySetting]);
|
|
41
41
|
}
|
|
42
42
|
return showSettings.map(keySetting => settingMap[keySetting]);
|
|
43
43
|
}, [showSettings, settingMap]);
|
|
@@ -721,7 +721,7 @@ export const SAMPLE_RICHMENU = {
|
|
|
721
721
|
displayDefault: true,
|
|
722
722
|
},
|
|
723
723
|
image: {
|
|
724
|
-
imageUrl: 'https://
|
|
724
|
+
imageUrl: 'https://sandbox-st-media-template.antsomi.com/upload/2024/01/04/8d8cf39a-748f-435c-b6c6-b71b5facc739.gif',
|
|
725
725
|
imageStyles: {
|
|
726
726
|
borderTopLeftRadius: '0px',
|
|
727
727
|
borderTopRightRadius: '0px',
|
|
@@ -131,8 +131,8 @@ export const TemplateSaveAsStyled = styled(Flex) `
|
|
|
131
131
|
width: 250px;
|
|
132
132
|
height: 36px;
|
|
133
133
|
border: 1px solid #b8cfe6;
|
|
134
|
+
padding: 0 5px;
|
|
134
135
|
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadiusXL}px;
|
|
135
|
-
padding: 0 10px;
|
|
136
136
|
|
|
137
137
|
& > .remove-btn {
|
|
138
138
|
cursor: pointer;
|