@antscorp/antsomi-ui 1.3.5-beta.23 → 1.3.5-beta.24
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/MobileFrame/MobileFrame.d.ts +1 -0
- package/es/components/atoms/MobileFrame/MobileFrame.js +1 -1
- package/es/components/atoms/MobileFrame/styled.d.ts +2 -1
- package/es/components/atoms/MobileFrame/styled.js +5 -5
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +3 -2
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +1 -1
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +3 -3
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ import { MobileWrapper, MobileInner, MobileBottomLine } from './styled';
|
|
|
16
16
|
export const MobileFrame = (_a) => {
|
|
17
17
|
var { children } = _a, restOfProps = __rest(_a, ["children"]);
|
|
18
18
|
return (React.createElement(MobileWrapper, Object.assign({}, restOfProps),
|
|
19
|
-
React.createElement(MobileInner,
|
|
19
|
+
React.createElement(MobileInner, { size: restOfProps.size },
|
|
20
20
|
children,
|
|
21
21
|
React.createElement(MobileBottomLine, null))));
|
|
22
22
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MobileFrameProps } from './MobileFrame';
|
|
1
2
|
export declare const MobileWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const MobileInner: import("styled-components").StyledComponent<"div", any,
|
|
3
|
+
export declare const MobileInner: import("styled-components").StyledComponent<"div", any, MobileFrameProps, never>;
|
|
3
4
|
export declare const MobileBottomLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -12,11 +12,11 @@ export const MobileWrapper = styled.div `
|
|
|
12
12
|
export const MobileInner = styled.div `
|
|
13
13
|
position: relative;
|
|
14
14
|
width: 100%;
|
|
15
|
-
max-width:
|
|
16
|
-
height:
|
|
17
|
-
margin: 61px 23px 20px 24px;
|
|
18
|
-
border-bottom-left-radius:
|
|
19
|
-
border-bottom-right-radius:
|
|
15
|
+
max-width: ${props => (props.size === 'medium' ? 290 : 336)}px;
|
|
16
|
+
height: ${props => (props.size === 'medium' ? 600 : 695)}px;
|
|
17
|
+
margin: ${props => (props.size === 'medium' ? '52px 23px 18px 24px' : '61px 23px 20px 24px')};
|
|
18
|
+
border-bottom-left-radius: ${props => (props.size === 'medium' ? 37 : 50)}px;
|
|
19
|
+
border-bottom-right-radius: ${props => (props.size === 'medium' ? 37 : 50)}px;
|
|
20
20
|
overflow: hidden;
|
|
21
21
|
`;
|
|
22
22
|
export const MobileBottomLine = styled.div `
|
|
@@ -4,6 +4,7 @@ export interface RichMenuChatBarProps extends React.HtmlHTMLAttributes<HTMLDivEl
|
|
|
4
4
|
showRichMenu?: boolean;
|
|
5
5
|
showTypingChat?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
size?: 'large' | 'medium';
|
|
7
8
|
onToggleRichMenu?: (toggle: boolean) => void;
|
|
8
9
|
onToggleTypingChat?: (toggle: boolean) => void;
|
|
9
10
|
}
|
|
@@ -19,11 +19,12 @@ import { TypingChat } from './TypingChat';
|
|
|
19
19
|
const defaultProps = {
|
|
20
20
|
label: 'Menu',
|
|
21
21
|
showRichMenu: true,
|
|
22
|
+
size: 'large',
|
|
22
23
|
showTypingChat: false,
|
|
23
24
|
};
|
|
24
25
|
export const RichMenuChatBar = props => {
|
|
25
|
-
const { disabled, label, showRichMenu, showTypingChat, className, onToggleRichMenu, onToggleTypingChat = () => { } } = props, restOfProps = __rest(props, ["disabled", "label", "showRichMenu", "showTypingChat", "className", "onToggleRichMenu", "onToggleTypingChat"]);
|
|
26
|
-
return (React.createElement(ChatBarWrapper, Object.assign({ "$showRichMenu": showRichMenu, "$showTypingChat": showTypingChat, "$disabled": disabled, className: `antsomi-chat-bar ${className}` }, restOfProps), showTypingChat ? (React.createElement(TypingChat, { onClickMenu: () => onToggleTypingChat(!showTypingChat) })) : (React.createElement(React.Fragment, null,
|
|
26
|
+
const { disabled, label, showRichMenu, showTypingChat, className, size, onToggleRichMenu, onToggleTypingChat = () => { } } = props, restOfProps = __rest(props, ["disabled", "label", "showRichMenu", "showTypingChat", "className", "size", "onToggleRichMenu", "onToggleTypingChat"]);
|
|
27
|
+
return (React.createElement(ChatBarWrapper, Object.assign({ "$showRichMenu": showRichMenu, "$showTypingChat": showTypingChat, "$disabled": disabled, "$size": size, className: `antsomi-chat-bar ${className}` }, restOfProps), showTypingChat ? (React.createElement(TypingChat, { onClickMenu: () => onToggleTypingChat(!showTypingChat) })) : (React.createElement(React.Fragment, null,
|
|
27
28
|
React.createElement(Icon, { type: "icon-ants-keyboard", className: "icon-keyboard", onClick: () => onToggleTypingChat(!showTypingChat) }),
|
|
28
29
|
React.createElement(ChatBarMenuBox, { onClick: () => onToggleRichMenu && onToggleRichMenu(!showRichMenu) },
|
|
29
30
|
React.createElement(Typography.Text, { className: "ants-text-sm" }, label),
|
|
@@ -3,6 +3,7 @@ interface ChatBarWrapperProps {
|
|
|
3
3
|
$showRichMenu?: boolean;
|
|
4
4
|
$showTypingChat?: boolean;
|
|
5
5
|
$disabled?: boolean;
|
|
6
|
+
$size?: 'large' | 'medium';
|
|
6
7
|
}
|
|
7
8
|
export declare const ChatBarWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, ChatBarWrapperProps, never>;
|
|
8
9
|
export declare const ChatBarMenuBox: 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>;
|
|
@@ -4,7 +4,7 @@ import styled, { css } from 'styled-components';
|
|
|
4
4
|
import { Flex } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
5
5
|
export const ChatBarWrapper = styled(Flex) `
|
|
6
6
|
position: relative;
|
|
7
|
-
height:
|
|
7
|
+
height: ${props => (props.$size === 'medium' ? 45 : 84)}px;
|
|
8
8
|
padding: 10px 20px;
|
|
9
9
|
background-color: #fff;
|
|
10
10
|
z-index: 10;
|
|
@@ -5,6 +5,7 @@ interface RichMenuMobileViewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
isPreview?: boolean;
|
|
6
6
|
onChangeRichMenu?: (richMenu: RichMenu, source?: 'user' | 'system') => void;
|
|
7
7
|
onClickCell?: (cellIndex: number) => void;
|
|
8
|
+
size?: 'large' | 'medium';
|
|
8
9
|
reCalculateFlag?: boolean | number;
|
|
9
10
|
}
|
|
10
11
|
export declare const RichMenuMobileView: React.FC<RichMenuMobileViewProps>;
|
|
@@ -20,7 +20,7 @@ import { RichMenuBlock } from '../RichMenuBlock';
|
|
|
20
20
|
// Styles
|
|
21
21
|
import { MobileContent, RichMenuWrapper, TopBar } from './styled';
|
|
22
22
|
export const RichMenuMobileView = props => {
|
|
23
|
-
const { richMenu, className, isPreview, onChangeRichMenu, onClickCell, reCalculateFlag } = props, restOfProps = __rest(props, ["richMenu", "className", "isPreview", "onChangeRichMenu", "onClickCell", "reCalculateFlag"]);
|
|
23
|
+
const { richMenu, className, isPreview, onChangeRichMenu, onClickCell, reCalculateFlag, size } = props, restOfProps = __rest(props, ["richMenu", "className", "isPreview", "onChangeRichMenu", "onClickCell", "reCalculateFlag", "size"]);
|
|
24
24
|
// State
|
|
25
25
|
const [state, setState] = useState({
|
|
26
26
|
showRichMenu: true,
|
|
@@ -29,9 +29,9 @@ export const RichMenuMobileView = props => {
|
|
|
29
29
|
});
|
|
30
30
|
// Variables
|
|
31
31
|
const { showRichMenu, showTypingChat } = state;
|
|
32
|
-
return (React.createElement(MobileFrame, Object.assign({ className: `ants-mx-auto ${className}` }, restOfProps),
|
|
32
|
+
return (React.createElement(MobileFrame, Object.assign({ size: size, className: `ants-mx-auto ${className}` }, restOfProps),
|
|
33
33
|
isPreview && React.createElement(TopBar, { src: IphoneTopBar, width: "100%", height: "auto" }),
|
|
34
34
|
React.createElement(MobileContent, null,
|
|
35
35
|
React.createElement(RichMenuWrapper, { "$showRichMenu": showRichMenu && !showTypingChat, "$isPreview": !!isPreview }, richMenu && (React.createElement(RichMenuBlock, { richMenu: richMenu, isPreview: isPreview, onChange: onChangeRichMenu, onClickCell: onClickCell, reCalculateFlag: reCalculateFlag }))),
|
|
36
|
-
React.createElement(RichMenuChatBar, { disabled: !isPreview, label: richMenu === null || richMenu === void 0 ? void 0 : richMenu.chatBar.label, showRichMenu: showRichMenu, showTypingChat: showTypingChat, onToggleRichMenu: showRichMenu => setState(prevState => (Object.assign(Object.assign({}, prevState), { showRichMenu: !!showRichMenu }))), onToggleTypingChat: showTypingChat => setState(prevState => (Object.assign(Object.assign({}, prevState), { showTypingChat: !!showTypingChat }))) }))));
|
|
36
|
+
React.createElement(RichMenuChatBar, { disabled: !isPreview, label: richMenu === null || richMenu === void 0 ? void 0 : richMenu.chatBar.label, size: size, showRichMenu: showRichMenu, showTypingChat: showTypingChat, onToggleRichMenu: showRichMenu => setState(prevState => (Object.assign(Object.assign({}, prevState), { showRichMenu: !!showRichMenu }))), onToggleTypingChat: showTypingChat => setState(prevState => (Object.assign(Object.assign({}, prevState), { showTypingChat: !!showTypingChat }))) }))));
|
|
37
37
|
};
|