@antscorp/antsomi-ui 1.3.3-beta.32 → 1.3.3-beta.33
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/assets/images/iphone-top-bar.png +0 -0
- package/es/assets/images/iphone.png +0 -0
- package/es/components/atoms/InputDynamic/InputDynamic.d.ts +1 -2
- package/es/components/atoms/InputDynamic/styled.d.ts +1 -1
- package/es/components/atoms/MobileFrame/MobileFrame.d.ts +4 -0
- package/es/components/atoms/MobileFrame/MobileFrame.js +22 -0
- package/es/components/atoms/MobileFrame/constants.d.ts +4 -0
- package/es/components/atoms/MobileFrame/constants.js +4 -0
- package/es/components/atoms/MobileFrame/index.d.ts +2 -0
- package/es/components/atoms/MobileFrame/index.js +1 -0
- package/es/components/atoms/MobileFrame/styled.d.ts +3 -0
- package/es/components/atoms/MobileFrame/styled.js +33 -0
- package/es/components/atoms/PreviewTabs/PreviewTabs.d.ts +7 -0
- package/es/components/atoms/PreviewTabs/PreviewTabs.js +67 -0
- package/es/components/atoms/PreviewTabs/index.d.ts +2 -0
- package/es/components/atoms/PreviewTabs/index.js +1 -0
- package/es/components/atoms/PreviewTabs/styled.d.ts +6 -0
- package/es/components/atoms/PreviewTabs/styled.js +79 -0
- package/es/components/atoms/Spin/Spin.d.ts +1 -2
- package/es/components/atoms/index.d.ts +1 -0
- package/es/components/atoms/index.js +1 -0
- package/es/components/common/ConfigProvider/GlobalStyle.js +25 -0
- package/es/components/icons/ArrowGrowIcon.d.ts +1 -2
- package/es/components/icons/AudioRecordIcon.d.ts +1 -2
- package/es/components/icons/BugIcon.d.ts +1 -2
- package/es/components/icons/CameraIcon.d.ts +1 -2
- package/es/components/icons/CaptureIcon.d.ts +1 -2
- package/es/components/icons/CheckSlimIcon.d.ts +1 -2
- package/es/components/icons/CloseIcon.d.ts +1 -2
- package/es/components/icons/CommentIcon.d.ts +1 -2
- package/es/components/icons/EventIcon.d.ts +1 -2
- package/es/components/icons/FreeDrawIcon.d.ts +1 -2
- package/es/components/icons/GPTIcon.d.ts +1 -2
- package/es/components/icons/GPTIconV2.d.ts +1 -2
- package/es/components/icons/GPTIconV3.d.ts +1 -2
- package/es/components/icons/HighlightIcon.d.ts +1 -2
- package/es/components/icons/IdeaIcon.d.ts +1 -2
- package/es/components/icons/InvisibleIcon.d.ts +1 -2
- package/es/components/icons/MuteIcon.d.ts +1 -2
- package/es/components/icons/OpenUrlIcon.d.ts +1 -2
- package/es/components/icons/PauseIcon.d.ts +1 -2
- package/es/components/icons/PlaneIcon.d.ts +1 -2
- package/es/components/icons/RequestIcon.d.ts +1 -2
- package/es/components/icons/StopRecordIcon.d.ts +1 -2
- package/es/components/icons/UserIcon.d.ts +1 -2
- package/es/components/icons/VerticalDotsIcon.d.ts +1 -2
- package/es/components/icons/WarningIcon.d.ts +1 -2
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +1 -2
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +1 -2
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +1 -2
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/ModalV2/styled.d.ts +1 -1
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +1 -0
- package/es/components/molecules/RichMenuBlock/RichMenuBlock.d.ts +9 -0
- package/es/components/molecules/RichMenuBlock/RichMenuBlock.js +49 -0
- package/es/components/molecules/RichMenuBlock/RichMenuCell/index.d.ts +10 -0
- package/es/components/molecules/RichMenuBlock/RichMenuCell/index.js +47 -0
- package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.d.ts +8 -0
- package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.js +36 -0
- package/es/components/molecules/RichMenuBlock/constants.d.ts +2 -0
- package/es/components/molecules/RichMenuBlock/constants.js +765 -0
- package/es/components/molecules/RichMenuBlock/index.d.ts +3 -0
- package/es/components/molecules/RichMenuBlock/index.js +2 -0
- package/es/components/molecules/RichMenuBlock/styled.d.ts +9 -0
- package/es/components/molecules/RichMenuBlock/styled.js +17 -0
- package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.d.ts +9 -0
- package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.js +32 -0
- package/es/components/molecules/RichMenuChatBar/TypingChat/index.d.ts +6 -0
- package/es/components/molecules/RichMenuChatBar/TypingChat/index.js +15 -0
- package/es/components/molecules/RichMenuChatBar/TypingChat/styled.d.ts +4 -0
- package/es/components/molecules/RichMenuChatBar/TypingChat/styled.js +47 -0
- package/es/components/molecules/RichMenuChatBar/index.d.ts +2 -0
- package/es/components/molecules/RichMenuChatBar/index.js +1 -0
- package/es/components/molecules/RichMenuChatBar/styled.d.ts +8 -0
- package/es/components/molecules/RichMenuChatBar/styled.js +33 -0
- package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.d.ts +8 -0
- package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.js +37 -0
- package/es/components/molecules/RichMenuMobileView/index.d.ts +1 -0
- package/es/components/molecules/RichMenuMobileView/index.js +1 -0
- package/es/components/molecules/RichMenuMobileView/styled.d.ts +6 -0
- package/es/components/molecules/RichMenuMobileView/styled.js +20 -0
- package/es/components/molecules/Select/Test.d.ts +1 -2
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +1 -1
- package/es/components/molecules/UploadImage/MediaIcon.d.ts +1 -2
- package/es/components/molecules/index.d.ts +3 -0
- package/es/components/molecules/index.js +3 -0
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.js +1 -0
- package/es/constants/richMenu.d.ts +19 -0
- package/es/constants/richMenu.js +19 -0
- package/es/constants/storybook.d.ts +1 -2
- package/es/locales/en/translation.json +2 -1
- package/es/locales/i18n.d.ts +1 -0
- package/es/locales/translations.d.ts +1 -0
- package/es/test.d.ts +1 -2
- package/es/types/index.d.ts +12 -0
- package/es/types/index.js +2 -1
- package/es/types/richMenu.d.ts +191 -0
- package/es/types/richMenu.js +1 -0
- package/es/types/variables.d.ts +2 -0
- package/es/types/variables.js +1 -0
- package/es/utils/handleError.d.ts +32 -2
- package/es/utils/handleError.js +42 -4
- package/package.json +2 -2
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { DisableShortLinkTypeProps } from './PopupShortLink';
|
|
3
2
|
export type KeyTagType = 'shortlink' | 'shortlink_static';
|
|
4
3
|
export type SelectedPropertiesProps = {
|
|
@@ -17,7 +16,7 @@ export type InputDynamicProps = {
|
|
|
17
16
|
addMessageToQueue?: Function;
|
|
18
17
|
};
|
|
19
18
|
export declare const InputDynamic: {
|
|
20
|
-
(props: InputDynamicProps):
|
|
19
|
+
(props: InputDynamicProps): JSX.Element;
|
|
21
20
|
defaultProps: {
|
|
22
21
|
value: string;
|
|
23
22
|
isViewMode: boolean;
|
|
@@ -4,7 +4,7 @@ export declare const SpanIcon: import("styled-components").StyledComponent<"span
|
|
|
4
4
|
isDisabled?: boolean | undefined;
|
|
5
5
|
}, never>;
|
|
6
6
|
export declare const InputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
-
export declare const InputShortLink: import("styled-components").StyledComponent<import("react").ComponentType<any> | keyof
|
|
7
|
+
export declare const InputShortLink: import("styled-components").StyledComponent<import("react").ComponentType<any> | keyof JSX.IntrinsicElements, any, import("../Input/Input").InputProps, any>;
|
|
8
8
|
export declare const TooltipHover: import("styled-components").StyledComponent<"div", any, {
|
|
9
9
|
top: number;
|
|
10
10
|
left: number;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
// Libraries
|
|
13
|
+
import React from 'react';
|
|
14
|
+
// Styled
|
|
15
|
+
import { MobileWrapper, MobileInner, MobileBottomLine } from './styled';
|
|
16
|
+
export const MobileFrame = (_a) => {
|
|
17
|
+
var { children } = _a, restOfProps = __rest(_a, ["children"]);
|
|
18
|
+
return (React.createElement(MobileWrapper, Object.assign({}, restOfProps),
|
|
19
|
+
React.createElement(MobileInner, null,
|
|
20
|
+
children,
|
|
21
|
+
React.createElement(MobileBottomLine, null))));
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MobileFrame } from './MobileFrame';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const MobileWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const MobileInner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const MobileBottomLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
// Assets
|
|
4
|
+
import MobileFrame from '@antscorp/antsomi-ui/es/assets/images/iphone.png';
|
|
5
|
+
export const MobileWrapper = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
width: 100%;
|
|
9
|
+
background: url(${MobileFrame}) no-repeat center center;
|
|
10
|
+
background-size: contain;
|
|
11
|
+
`;
|
|
12
|
+
export const MobileInner = styled.div `
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
max-width: 336px;
|
|
16
|
+
height: 695px;
|
|
17
|
+
margin: 61px 23px 20px 24px;
|
|
18
|
+
border-bottom-left-radius: 50px;
|
|
19
|
+
border-bottom-right-radius: 50px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
`;
|
|
22
|
+
export const MobileBottomLine = styled.div `
|
|
23
|
+
width: 145px;
|
|
24
|
+
height: 5px;
|
|
25
|
+
background-color: #000000;
|
|
26
|
+
border-radius: 20px;
|
|
27
|
+
position: absolute;
|
|
28
|
+
margin: auto;
|
|
29
|
+
bottom: 10px;
|
|
30
|
+
left: 50%;
|
|
31
|
+
transform: translateX(-50%);
|
|
32
|
+
z-index: 10;
|
|
33
|
+
`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PreviewTabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
+
total?: number;
|
|
4
|
+
current?: number;
|
|
5
|
+
onChange?: (current: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const PreviewTabs: React.FC<PreviewTabProps>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
// Libraries
|
|
13
|
+
import React, { useEffect, useState } from 'react';
|
|
14
|
+
import cn from 'classnames';
|
|
15
|
+
// Components
|
|
16
|
+
import { Flex, Icon } from '..';
|
|
17
|
+
// Styled
|
|
18
|
+
import { NavigationButton, StyledRichMenuTabs } from './styled';
|
|
19
|
+
import { tryCatchWrapper } from '@antscorp/antsomi-ui/es/utils';
|
|
20
|
+
const defaultProps = {
|
|
21
|
+
total: 20,
|
|
22
|
+
current: 1,
|
|
23
|
+
};
|
|
24
|
+
const PATH = 'antsomi-ui/src/components/atoms/PreviewTabs/PreviewTabs.tsx';
|
|
25
|
+
export const PreviewTabs = props => {
|
|
26
|
+
const { total = 20, current = 1, onChange } = props, restProps = __rest(props, ["total", "current", "onChange"]);
|
|
27
|
+
const tabsRef = React.useRef(null);
|
|
28
|
+
// State
|
|
29
|
+
const [state, setState] = useState({
|
|
30
|
+
disablePrev: true,
|
|
31
|
+
disableNext: true,
|
|
32
|
+
});
|
|
33
|
+
// Variables
|
|
34
|
+
const { disableNext, disablePrev } = state;
|
|
35
|
+
// Handlers
|
|
36
|
+
const checkScroll = () => {
|
|
37
|
+
if (tabsRef.current) {
|
|
38
|
+
const { scrollLeft, clientWidth, scrollWidth } = tabsRef.current;
|
|
39
|
+
setState(prevState => (Object.assign(Object.assign({}, prevState), { disableNext: scrollLeft + clientWidth === scrollWidth })));
|
|
40
|
+
setState(prevState => (Object.assign(Object.assign({}, prevState), { disablePrev: scrollLeft === 0 })));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
// Check disable next navigation base length of tabs
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
checkScroll();
|
|
46
|
+
}, []);
|
|
47
|
+
// Handlers
|
|
48
|
+
const onClickNavigation = tryCatchWrapper((isPrev) => {
|
|
49
|
+
if (tabsRef.current) {
|
|
50
|
+
const { scrollLeft } = tabsRef.current;
|
|
51
|
+
tabsRef.current.scrollTo({ left: scrollLeft + (isPrev ? -40 : 40), behavior: 'smooth' });
|
|
52
|
+
checkScroll();
|
|
53
|
+
}
|
|
54
|
+
}, PATH);
|
|
55
|
+
return (React.createElement(StyledRichMenuTabs, Object.assign({}, restProps),
|
|
56
|
+
React.createElement(NavigationButton, { className: cn('navigation--previous', {
|
|
57
|
+
'navigation--disabled': disablePrev,
|
|
58
|
+
}), onClick: () => onClickNavigation(true) },
|
|
59
|
+
React.createElement(Icon, { type: "icon-ants-angle-left" })),
|
|
60
|
+
React.createElement(Flex, { ref: tabsRef, className: "tabs antsomi-scrollbar-hidden", align: "center", onScroll: () => checkScroll() }, Array.from({ length: total }).map((_, index) => (React.createElement(Flex, { key: `${index + 1}`, align: "center", justify: "center", className: `tabs__item ${current === index + 1 ? 'tabs__item--active' : ''}`, onClick: () => onChange && onChange(index + 1) },
|
|
61
|
+
React.createElement(Flex, { align: "center", justify: "center", className: "tabs__label" }, index + 1))))),
|
|
62
|
+
React.createElement(NavigationButton, { className: cn('navigation--next', {
|
|
63
|
+
'navigation--disabled': disableNext,
|
|
64
|
+
}), onClick: () => onClickNavigation(false) },
|
|
65
|
+
React.createElement(Icon, { type: "icon-ants-angle-right" }))));
|
|
66
|
+
};
|
|
67
|
+
PreviewTabs.defaultProps = defaultProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PreviewTabs } from './PreviewTabs';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface StyledRichMenuTabsProps {
|
|
3
|
+
width?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const StyledRichMenuTabs: import("styled-components").StyledComponent<"div", any, StyledRichMenuTabsProps, never>;
|
|
6
|
+
export declare const NavigationButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Components
|
|
2
|
+
import { Flex } from '../Flex';
|
|
3
|
+
// Styled
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
export const StyledRichMenuTabs = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background: #f0f0f0;
|
|
9
|
+
box-shadow: 0px 3px 3px 0px rgba(0, 46, 89, 0.1);
|
|
10
|
+
height: 40px;
|
|
11
|
+
width: ${({ width }) => width || 467}px;
|
|
12
|
+
|
|
13
|
+
.tabs {
|
|
14
|
+
flex: 1;
|
|
15
|
+
width: 100%;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
|
|
18
|
+
&__item {
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
height: 40px;
|
|
21
|
+
width: 40px;
|
|
22
|
+
border-right: 1px solid #d4d4d4;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: all 200ms;
|
|
25
|
+
|
|
26
|
+
&--active {
|
|
27
|
+
background-color: #fff;
|
|
28
|
+
|
|
29
|
+
.tabs__label {
|
|
30
|
+
background-color: var(--primary-color);
|
|
31
|
+
color: #fff;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__label {
|
|
37
|
+
height: 24px;
|
|
38
|
+
width: 24px;
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
color: var(--primary-color);
|
|
42
|
+
border-radius: 100%;
|
|
43
|
+
border: 1px solid #b8cfe6;
|
|
44
|
+
background-color: #fff;
|
|
45
|
+
transition: all 200ms;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
export const NavigationButton = styled(Flex) `
|
|
50
|
+
width: 40px;
|
|
51
|
+
height: 40px;
|
|
52
|
+
background-color: #fff;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
|
|
55
|
+
i {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: #595959;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.navigation--previous {
|
|
61
|
+
border-right: 1px solid #d4d4d4;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.navigation--next {
|
|
65
|
+
border-left: 1px solid #d4d4d4;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.navigation--disabled {
|
|
69
|
+
cursor: not-allowed;
|
|
70
|
+
|
|
71
|
+
i {
|
|
72
|
+
color: #59595980;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
NavigationButton.defaultProps = {
|
|
77
|
+
align: 'center',
|
|
78
|
+
justify: 'center',
|
|
79
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { SpinProps as AntdSpinProps } from 'antd';
|
|
3
2
|
export interface TSpinProps extends AntdSpinProps {
|
|
4
3
|
indicatorSize?: number;
|
|
5
4
|
children?: any;
|
|
6
5
|
}
|
|
7
6
|
export declare const Spin: {
|
|
8
|
-
(props: TSpinProps):
|
|
7
|
+
(props: TSpinProps): JSX.Element;
|
|
9
8
|
defaultProps: {};
|
|
10
9
|
};
|
|
@@ -34,6 +34,7 @@ export { SliderV2 } from './SliderV2';
|
|
|
34
34
|
export * from './Flex';
|
|
35
35
|
export * from './RateV2';
|
|
36
36
|
export { InputDynamic } from './InputDynamic';
|
|
37
|
+
export * from './PreviewTabs';
|
|
37
38
|
export type { SliderProps } from './Slider';
|
|
38
39
|
export type { PaginationProps } from './Pagination';
|
|
39
40
|
export type { InputDynamicProps } from './InputDynamic';
|
|
@@ -15,6 +15,16 @@ export const GlobalStyle = () => {
|
|
|
15
15
|
return (React.createElement(Global, { styles: css `
|
|
16
16
|
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap');
|
|
17
17
|
|
|
18
|
+
/* Custom */
|
|
19
|
+
.antsomi-scrollbar-hidden {
|
|
20
|
+
-ms-overflow-style: none; /* for Internet Explorer, Edge */
|
|
21
|
+
scrollbar-width: none; /* for Firefox */
|
|
22
|
+
|
|
23
|
+
&::-webkit-scrollbar {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
/* width */
|
|
19
29
|
::-webkit-scrollbar {
|
|
20
30
|
width: ${scrollBarSize};
|
|
@@ -553,5 +563,20 @@ export const GlobalStyle = () => {
|
|
|
553
563
|
}
|
|
554
564
|
}
|
|
555
565
|
}
|
|
566
|
+
|
|
567
|
+
/* Form */
|
|
568
|
+
.antsomi-form {
|
|
569
|
+
.antsomi-form-item {
|
|
570
|
+
.antsomi-form-item-label {
|
|
571
|
+
> label.antsomi-form-item-required:not(.antsomi-form-item-required-mark-optional) {
|
|
572
|
+
&::before {
|
|
573
|
+
position: absolute;
|
|
574
|
+
right: 0px;
|
|
575
|
+
font-family: Roboto;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
556
581
|
` }));
|
|
557
582
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ArrowGrowIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const ArrowGrowIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const AudioRecordIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const AudioRecordIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const BugIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const BugIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const CameraIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const CameraIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const CaptureIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const CaptureIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const CheckSlimIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const CheckSlimIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const CommentIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const CommentIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const FreeDrawIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const FreeDrawIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const GPTIcon: () => React.JSX.Element;
|
|
1
|
+
export declare const GPTIcon: () => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const GPTIconV2: () => React.JSX.Element;
|
|
1
|
+
export declare const GPTIconV2: () => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const GPTIconV3: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const GPTIconV3: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const HighlightIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const HighlightIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const IdeaIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const IdeaIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const InvisibleIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const InvisibleIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const MuteIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const MuteIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const OpenUrlIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const OpenUrlIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const PauseIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const PauseIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const PlaneIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const PlaneIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const RequestIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const RequestIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const StopRecordIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const StopRecordIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const UserIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const UserIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const VerticalDotsIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const VerticalDotsIcon: (props: any) => JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const WarningIcon: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const WarningIcon: (props: any) => JSX.Element;
|
|
@@ -10,6 +10,6 @@ export declare const StyledModal: import("styled-components").StyledComponent<im
|
|
|
10
10
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
11
11
|
destroyAll: () => void;
|
|
12
12
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
13
|
-
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) =>
|
|
13
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) => React.JSX.Element;
|
|
14
14
|
}, any, CustomModalProps, never>;
|
|
15
15
|
export declare const WrapperSpin: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -3,5 +3,5 @@ export declare const StyledModal: import("styled-components").StyledComponent<im
|
|
|
3
3
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
4
4
|
destroyAll: () => void;
|
|
5
5
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
6
|
-
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) =>
|
|
6
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) => React.JSX.Element;
|
|
7
7
|
}, any, {}, never>;
|
|
@@ -107,6 +107,7 @@ export const ResizeGrid = props => {
|
|
|
107
107
|
}, [grid]);
|
|
108
108
|
useDeepCompareEffect(() => {
|
|
109
109
|
if (acceptUpdateRef.current && (initGrid === null || initGrid === void 0 ? void 0 : initGrid.rows) && (initGrid === null || initGrid === void 0 ? void 0 : initGrid.cols)) {
|
|
110
|
+
firstChangeRef.current = true;
|
|
110
111
|
setGrid(buildGrid(initGrid));
|
|
111
112
|
resetBackgroundCellRef();
|
|
112
113
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RichMenu } from '@antscorp/antsomi-ui/es/types';
|
|
3
|
+
export interface RichMenuBlockProps {
|
|
4
|
+
richMenu: RichMenu;
|
|
5
|
+
isPreview?: boolean;
|
|
6
|
+
onClickCell?: (cellIdx: number) => void;
|
|
7
|
+
onChange?: (richMenu: RichMenu, source?: 'user' | 'system') => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const RichMenuBlock: React.FC<RichMenuBlockProps>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cloneDeep, pick } from 'lodash';
|
|
4
|
+
// Components
|
|
5
|
+
import { ResizeGrid } from '@antscorp/antsomi-ui/es/components';
|
|
6
|
+
import { RichMenuCell } from './RichMenuCell';
|
|
7
|
+
// Utils
|
|
8
|
+
import { tryCatchWrapper } from '@antscorp/antsomi-ui/es/utils';
|
|
9
|
+
const PATH = 'src/app/modules/Dashboard/containers/RichMenu/containers/Design/components/Workspace/components/RichMenuBlock/index.tsx';
|
|
10
|
+
export const RichMenuBlock = props => {
|
|
11
|
+
const { richMenu, isPreview, onClickCell, onChange } = props;
|
|
12
|
+
const { gridTemplateCols = [], gridTemplateRows = [], cells = [], uploadMode, image, layoutType, rows, cols, } = richMenu || {};
|
|
13
|
+
const { imageUrl, imageStyles } = image || {};
|
|
14
|
+
const grid = {
|
|
15
|
+
rows,
|
|
16
|
+
cols,
|
|
17
|
+
gridTemplateColumns: gridTemplateCols.map(col => +String(col).replace('%', '')),
|
|
18
|
+
gridTemplateRows: gridTemplateRows.map(row => +String(row).replace('%', '')),
|
|
19
|
+
childs: cells.map(item => item),
|
|
20
|
+
};
|
|
21
|
+
const isSingleUploadMode = uploadMode === 'single';
|
|
22
|
+
// Handlers
|
|
23
|
+
const handleClickCell = (cellIdx) => {
|
|
24
|
+
// If is preview is true then not do anything
|
|
25
|
+
if (isPreview)
|
|
26
|
+
return;
|
|
27
|
+
if (onClickCell) {
|
|
28
|
+
onClickCell(cellIdx);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const handleGridChange = tryCatchWrapper((gridInfo, ctx, source) => {
|
|
32
|
+
if (richMenu) {
|
|
33
|
+
const { rows, cols, gridTemplateRows, gridTemplateColumns, childs } = gridInfo;
|
|
34
|
+
const gridTemplateColsUnit = (gridTemplateColumns === null || gridTemplateColumns === void 0 ? void 0 : gridTemplateColumns.map(col => `${col}%`)) || [];
|
|
35
|
+
const gridTemplateRowsUnit = (gridTemplateRows === null || gridTemplateRows === void 0 ? void 0 : gridTemplateRows.map(row => `${row}%`)) || [];
|
|
36
|
+
const cells = childs === null || childs === void 0 ? void 0 : childs.map((child, idx) => {
|
|
37
|
+
const item = cloneDeep(child);
|
|
38
|
+
const cellBounds = pick(ctx[idx], ['x', 'y', 'width', 'height']);
|
|
39
|
+
return Object.assign(Object.assign({}, item), cellBounds);
|
|
40
|
+
});
|
|
41
|
+
const newRichMenu = Object.assign(Object.assign({}, richMenu), { rows: rows || 1, cols: cols || 1, gridTemplateRows: gridTemplateRowsUnit, gridTemplateCols: gridTemplateColsUnit, cells: cells });
|
|
42
|
+
if (onChange) {
|
|
43
|
+
onChange(newRichMenu, source);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, PATH);
|
|
47
|
+
const renderCell = (cellInfo, ctx) => (React.createElement(RichMenuCell, { context: ctx, cell: cellInfo, isSingleMode: isSingleUploadMode, onClick: handleClickCell }));
|
|
48
|
+
return (React.createElement(ResizeGrid, { grid: grid, image: imageUrl, isPreview: isPreview, containerStyle: imageStyles, imagePosition: imageStyles === null || imageStyles === void 0 ? void 0 : imageStyles.objectPosition, imageSize: imageStyles === null || imageStyles === void 0 ? void 0 : imageStyles.objectFit, isCompact: layoutType === 'compact', renderCell: renderCell, cellActiveStyle: { background: 'rgba(0, 95, 184, 0.5)' }, cellBorder: isSingleUploadMode ? '1px solid rgba(0, 95, 184, 1)' : '1px dotted #000000', onChange: handleGridChange }));
|
|
49
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { TChildrenCell } from '../../../../types';
|
|
3
|
+
interface RichMenuCellProps {
|
|
4
|
+
cell: TChildrenCell;
|
|
5
|
+
context: number;
|
|
6
|
+
isSingleMode: boolean;
|
|
7
|
+
onClick: (index: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const RichMenuCell: FC<RichMenuCellProps>;
|
|
10
|
+
export {};
|