@antscorp/antsomi-ui 1.3.3-beta.4 → 1.3.3-beta.41
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/assets/images/stars_slider.png +0 -0
- package/es/components/atoms/Input/Input.d.ts +3 -0
- package/es/components/atoms/Input/Input.js +4 -3
- package/es/components/atoms/InputDynamic/EditCaretPositioning.d.ts +2 -0
- package/es/components/atoms/InputDynamic/EditCaretPositioning.js +89 -0
- package/es/components/atoms/InputDynamic/InputDynamic.d.ts +30 -0
- package/es/components/atoms/InputDynamic/InputDynamic.js +320 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.d.ts +16 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.js +85 -0
- package/es/components/atoms/InputDynamic/index.d.ts +2 -0
- package/es/components/atoms/InputDynamic/index.js +1 -0
- package/es/components/atoms/InputDynamic/styled.d.ts +12 -0
- package/es/components/atoms/InputDynamic/styled.js +281 -0
- package/es/components/atoms/InputDynamic/utils.d.ts +22 -0
- package/es/components/atoms/InputDynamic/utils.js +751 -0
- 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/Pagination/index.d.ts +1 -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/RateV2/RateV2.d.ts +18 -0
- package/es/components/atoms/RateV2/RateV2.js +73 -0
- package/es/components/atoms/RateV2/index.d.ts +1 -0
- package/es/components/atoms/RateV2/index.js +1 -0
- package/es/components/atoms/RequiredLabel/index.d.ts +1 -0
- package/es/components/atoms/RequiredLabel/index.js +4 -3
- package/es/components/atoms/Slider/index.d.ts +2 -1
- package/es/components/atoms/Slider/index.js +7 -14
- package/es/components/atoms/SliderV2/index.d.ts +6 -0
- package/es/components/atoms/SliderV2/index.js +21 -0
- package/es/components/atoms/Spin/Spin.d.ts +2 -1
- package/es/components/atoms/Spin/styled.d.ts +1 -1
- package/es/components/atoms/index.d.ts +7 -0
- package/es/components/atoms/index.js +5 -0
- package/es/components/common/ConfigProvider/GlobalStyle.js +66 -2
- package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
- package/es/components/icons/AudioRecordIcon.d.ts +2 -1
- package/es/components/icons/BugIcon.d.ts +2 -1
- package/es/components/icons/CameraIcon.d.ts +2 -1
- package/es/components/icons/CaptureIcon.d.ts +2 -1
- package/es/components/icons/CheckSlimIcon.d.ts +2 -1
- package/es/components/icons/CloseIcon.d.ts +2 -1
- package/es/components/icons/CommentIcon.d.ts +2 -1
- package/es/components/icons/EventIcon.d.ts +2 -1
- package/es/components/icons/FreeDrawIcon.d.ts +2 -1
- package/es/components/icons/GPTIcon.d.ts +2 -1
- package/es/components/icons/GPTIconV2.d.ts +2 -1
- package/es/components/icons/GPTIconV3.d.ts +2 -1
- package/es/components/icons/HighlightIcon.d.ts +2 -1
- package/es/components/icons/IdeaIcon.d.ts +2 -1
- package/es/components/icons/InvisibleIcon.d.ts +2 -1
- package/es/components/icons/MuteIcon.d.ts +2 -1
- package/es/components/icons/OpenUrlIcon.d.ts +2 -1
- package/es/components/icons/PauseIcon.d.ts +2 -1
- package/es/components/icons/PlaneIcon.d.ts +2 -1
- package/es/components/icons/RequestIcon.d.ts +2 -1
- package/es/components/icons/StopRecordIcon.d.ts +2 -1
- package/es/components/icons/UserIcon.d.ts +2 -1
- package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
- package/es/components/icons/WarningIcon.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
- package/es/components/molecules/FontSetting/constants.d.ts +3 -0
- package/es/components/molecules/FontSetting/constants.js +22 -0
- package/es/components/molecules/FontSetting/index.d.ts +10 -4
- package/es/components/molecules/FontSetting/index.js +36 -35
- package/es/components/molecules/FontSetting/types.d.ts +1 -1
- package/es/components/molecules/Modal/Modal.d.ts +2 -2
- package/es/components/molecules/Modal/index.d.ts +1 -0
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/ModalV2/ModalV2.d.ts +5 -0
- package/es/components/molecules/ModalV2/ModalV2.js +26 -0
- package/es/components/molecules/ModalV2/index.d.ts +2 -0
- package/es/components/molecules/ModalV2/index.js +1 -0
- package/es/components/molecules/ModalV2/styled.d.ts +7 -0
- package/es/components/molecules/ModalV2/styled.js +22 -0
- package/es/components/molecules/PreviewModal/PreviewModal.d.ts +7 -0
- package/es/components/molecules/PreviewModal/PreviewModal.js +30 -0
- package/es/components/molecules/PreviewModal/index.d.ts +2 -0
- package/es/components/molecules/PreviewModal/index.js +1 -0
- package/es/components/molecules/PreviewModal/styled.d.ts +4 -0
- package/es/components/molecules/PreviewModal/styled.js +39 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +719 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +86 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +80 -0
- package/es/components/molecules/ResizeGrid/constant.d.ts +35 -0
- package/es/components/molecules/ResizeGrid/constant.js +111 -0
- package/es/components/molecules/ResizeGrid/index.d.ts +2 -0
- package/es/components/molecules/ResizeGrid/index.js +1 -0
- package/es/components/molecules/ResizeGrid/styled.d.ts +10 -0
- package/es/components/molecules/ResizeGrid/styled.js +56 -0
- package/es/components/molecules/ResizeGrid/types.d.ts +147 -0
- package/es/components/molecules/ResizeGrid/types.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +49 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.js +47 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.d.ts +8 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +36 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.d.ts +2 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +765 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/index.d.ts +3 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/index.js +2 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +17 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +32 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.d.ts +6 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.js +15 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +4 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +47 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/index.d.ts +2 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/index.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +37 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +37 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/index.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/index.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +6 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +20 -0
- package/es/components/molecules/RichMenu/index.d.ts +3 -0
- package/es/components/molecules/RichMenu/index.js +3 -0
- package/es/components/molecules/Select/Select.d.ts +4 -2
- package/es/components/molecules/Select/Test.d.ts +2 -1
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +4 -2
- package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
- package/es/components/molecules/index.d.ts +6 -0
- package/es/components/molecules/index.js +4 -0
- package/es/components/organism/Help/styled.d.ts +6 -2
- 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 +2 -1
- package/es/constants/theme.js +13 -2
- package/es/hooks/useDeepCompareEffect.d.ts +1 -0
- package/es/hooks/useDeepCompareEffect.js +21 -0
- package/es/locales/en/translation.json +3 -1
- package/es/locales/i18n.d.ts +3 -0
- package/es/locales/translations.d.ts +2 -0
- package/es/locales/vi/translation.json +2 -1
- package/es/test.d.ts +2 -1
- package/es/test.js +164 -66
- 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/common.d.ts +2 -0
- package/es/utils/common.js +16 -0
- package/es/utils/handleError.d.ts +32 -2
- package/es/utils/handleError.js +42 -4
- package/package.json +8 -6
- package/dist/0173b5993573afa04880.woff +0 -0
- package/dist/0dfb9214dfd945cd7290.png +0 -1
- package/dist/2883cad25a2b4e87ce5f.eot +0 -0
- package/dist/4f54a37971347e3d7122.png +0 -1
- package/dist/574b7bee0563a9fe9a29.png +0 -1
- package/dist/6b586356e837581204dc.svg +0 -1
- package/dist/72eec5c1c786b45a667f.ttf +0 -0
- package/dist/bc6bf11c6f5e6743aa4c.png +0 -1
- package/dist/dbc405edd6e0806efbc9.svg +0 -1
- package/dist/e32f09119052a55cce3c.png +0 -1
- package/dist/e3851b9384a984c6fdb5.png +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.LICENSE.txt +0 -69
- package/dist/main.css +0 -69
- package/dist/public/icons/2d496b55d85a9545d7311c073af442bb.png +0 -0
- package/dist/public/icons/2fbb4e0927d18e3f8e5c6511ab88d5b3.png +0 -0
- package/dist/public/icons/725a52bd91a3ce534b10833df510e5fa.png +0 -0
- package/dist/public/icons/7d037e0b378e87a82804443636cd0e13.svg +0 -346
- package/dist/public/icons/90553767e0a05b9585a54797cfd9ce51.png +0 -0
- package/dist/public/icons/bb64e23a1ff390a416d765ee556096ab.svg +0 -87
- package/dist/public/icons/d327b24e9c5d8f486f08d253aab58ce6.png +0 -0
- package/dist/public/icons/f1cf266d0a0a53ce07f2dbb859869b7a.png +0 -0
- package/dist/public/icons/placeholder-image.png +0 -0
- package/dist/public/icons/transparent.svg +0 -1
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const FreeDrawIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const GPTIcon: () => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const GPTIconV2: () => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const GPTIconV3: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const HighlightIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const IdeaIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const InvisibleIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const MuteIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const OpenUrlIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const PauseIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const PlaneIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const RequestIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const StopRecordIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const UserIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const VerticalDotsIcon: (props: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const WarningIcon: (props: any) => React.JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const FONT_SETTING_DEFAULT = {
|
|
2
|
+
fontColor: '#000000',
|
|
3
|
+
fontFamily: 'Roboto',
|
|
4
|
+
fontItalic: false,
|
|
5
|
+
fontSize: 14,
|
|
6
|
+
fontWeight: '400',
|
|
7
|
+
letterSpacing: 2,
|
|
8
|
+
lineHeight: 1.5,
|
|
9
|
+
textTransform: 'none',
|
|
10
|
+
textDecoration: 'none',
|
|
11
|
+
};
|
|
12
|
+
export const FONT_STYLE_DEFAULT = {
|
|
13
|
+
color: '#000000',
|
|
14
|
+
fontFamily: 'Roboto',
|
|
15
|
+
fontSize: 14,
|
|
16
|
+
fontWeight: '400',
|
|
17
|
+
lineHeight: 1.5,
|
|
18
|
+
letterSpacing: 2,
|
|
19
|
+
textTransform: 'none',
|
|
20
|
+
textDecoration: 'none',
|
|
21
|
+
fontStyle: 'normal',
|
|
22
|
+
};
|
|
@@ -2,17 +2,23 @@ import React from 'react';
|
|
|
2
2
|
import { PopoverProps } from 'antd';
|
|
3
3
|
import { SettingWrapperProps } from '../SettingWrapper';
|
|
4
4
|
import { TFontSettings, TFontStyles } from './types';
|
|
5
|
+
type TFontSettingOptions = 'fontFamily' | 'color' | 'fontSize' | 'fontWeight' | 'textTransform' | 'textDecoration' | 'italic' | 'lineHeight' | 'letterSpacing';
|
|
5
6
|
export type TFontSettingProps = {
|
|
6
7
|
label?: string;
|
|
7
|
-
settings: TFontSettings
|
|
8
|
+
settings: Partial<TFontSettings>;
|
|
9
|
+
styles: Partial<TFontStyles>;
|
|
10
|
+
showSettings?: TFontSettingOptions[];
|
|
8
11
|
wrapperProps?: Omit<SettingWrapperProps, 'label'>;
|
|
9
12
|
popoverProps?: Omit<PopoverProps, 'content'>;
|
|
10
13
|
childrenProps?: Omit<TFontSettingEditProps, 'settings' | 'styles' | 'onChange'>;
|
|
11
|
-
onChange?:
|
|
14
|
+
onChange?: (settings: Partial<TFontSettings>, styles: Partial<TFontStyles>) => void;
|
|
12
15
|
};
|
|
13
16
|
export type TFontSettingEditProps = {
|
|
14
|
-
settings: TFontSettings
|
|
15
|
-
|
|
17
|
+
settings: Partial<TFontSettings>;
|
|
18
|
+
styles: Partial<TFontStyles>;
|
|
19
|
+
showSettings?: TFontSettingOptions[];
|
|
20
|
+
onChange?: (settings: Partial<TFontSettings>, styles: Partial<TFontStyles>) => void;
|
|
16
21
|
};
|
|
17
22
|
export declare const FontSettingEdit: React.FC<TFontSettingEditProps>;
|
|
18
23
|
export declare const FontSetting: React.FC<TFontSettingProps>;
|
|
24
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
/* Components */
|
|
3
3
|
import { Space, Switch } from '../../atoms';
|
|
4
4
|
import { ColorSetting } from '../ColorSetting';
|
|
@@ -9,45 +9,46 @@ import { FontFamilySelect } from '../FontFamilySelect';
|
|
|
9
9
|
import { FontWeightSelect } from '../FontWeightSelect';
|
|
10
10
|
import { TextTransformSelect } from '../TextTransformSelect';
|
|
11
11
|
import { TextDecorationSelect } from '../TextDecorationSelect';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
fontFamily: settings.fontFamily,
|
|
16
|
-
fontColor: settings.fontColor,
|
|
17
|
-
fontSize: settings.fontSize,
|
|
18
|
-
fontWeight: settings.fontWeight,
|
|
19
|
-
lineHeight: settings.lineHeight,
|
|
20
|
-
letterSpacing: settings.letterSpacing,
|
|
21
|
-
textTransform: settings.textTransform,
|
|
22
|
-
textDecoration: settings.textDecoration,
|
|
23
|
-
fontStyle: settings.fontItalic ? 'italic' : 'normal',
|
|
24
|
-
});
|
|
25
|
-
const handleChange = (setting) => {
|
|
12
|
+
import { FONT_SETTING_DEFAULT, FONT_STYLE_DEFAULT } from './constants';
|
|
13
|
+
export const FontSettingEdit = ({ settings, styles, showSettings, onChange, }) => {
|
|
14
|
+
const handleChange = (setting, style) => {
|
|
26
15
|
if (typeof onChange === 'function') {
|
|
27
16
|
const newSettings = Object.assign(Object.assign({}, settings), setting);
|
|
28
|
-
const newStyles =
|
|
17
|
+
const newStyles = Object.assign(Object.assign({}, styles), style);
|
|
29
18
|
onChange(newSettings, newStyles);
|
|
30
19
|
}
|
|
31
20
|
};
|
|
32
|
-
|
|
33
|
-
React.createElement(FontFamilySelect, { label: "Font Family", value: settings === null || settings === void 0 ? void 0 : settings.fontFamily, onChange:
|
|
34
|
-
React.createElement(ColorSetting, { label: "Font Color", color: settings === null || settings === void 0 ? void 0 : settings.fontColor, onChange: fontColor => handleChange({ fontColor }) }),
|
|
35
|
-
React.createElement(SettingWrapper, { label: "Font Size", vertical: true },
|
|
36
|
-
React.createElement(SliderWithInputNumber, { value: typeof (settings === null || settings === void 0 ? void 0 : settings.fontSize) !== 'undefined' ? +settings.fontSize : 0, onAfterChange: fontSize => handleChange({ fontSize }) })),
|
|
37
|
-
React.createElement(FontWeightSelect, { label: "Font Weight", value: settings === null || settings === void 0 ? void 0 : settings.fontWeight,
|
|
38
|
-
React.createElement(SettingWrapper, { label: "Line Height", vertical: true },
|
|
39
|
-
React.createElement(SliderWithInputNumber, { defaultValue: typeof (settings === null || settings === void 0 ? void 0 : settings.lineHeight) !== 'undefined' ? +settings.lineHeight : 0, min: 1, max: 5, step: 0.1, onAfterChange: lineHeight => handleChange({ lineHeight }) })),
|
|
40
|
-
React.createElement(SettingWrapper, { label: "Letter Spacing", vertical: true },
|
|
41
|
-
React.createElement(SliderWithInputNumber, { defaultValue: typeof (settings === null || settings === void 0 ? void 0 : settings.letterSpacing) !== 'undefined' ? +settings.letterSpacing : 0, min: -10, max: 10, onAfterChange: letterSpacing => handleChange({ letterSpacing }) })),
|
|
42
|
-
React.createElement(TextTransformSelect, { label: "Text Transform", value: settings === null || settings === void 0 ? void 0 : settings.textTransform, onChange: textTransform => handleChange({ textTransform }) }),
|
|
43
|
-
React.createElement(TextDecorationSelect, { label: "Text Decoration", value: settings === null || settings === void 0 ? void 0 : settings.textDecoration, onChange: textDecoration => handleChange({ textDecoration }) }),
|
|
44
|
-
React.createElement(SettingWrapper, { label: "Font Style Italic" },
|
|
45
|
-
React.createElement(Switch, { checked: settings === null || settings === void 0 ? void 0 : settings.fontItalic, onChange: fontItalic => handleChange({ fontItalic }) })))
|
|
21
|
+
const settingMap = useMemo(() => ({
|
|
22
|
+
fontFamily: (React.createElement(FontFamilySelect, { label: "Font Family", value: settings === null || settings === void 0 ? void 0 : settings.fontFamily, onChange: fontFamily => handleChange({ fontFamily }, { fontFamily }) })),
|
|
23
|
+
color: (React.createElement(ColorSetting, { label: "Font Color", color: settings === null || settings === void 0 ? void 0 : settings.fontColor, onChange: fontColor => handleChange({ fontColor }, { color: fontColor }) })),
|
|
24
|
+
fontSize: (React.createElement(SettingWrapper, { label: "Font Size", vertical: true },
|
|
25
|
+
React.createElement(SliderWithInputNumber, { value: typeof (settings === null || settings === void 0 ? void 0 : settings.fontSize) !== 'undefined' ? +settings.fontSize : 0, onAfterChange: fontSize => handleChange({ fontSize }, { fontSize }) }))),
|
|
26
|
+
fontWeight: (React.createElement(FontWeightSelect, { label: "Font Weight", value: settings === null || settings === void 0 ? void 0 : settings.fontWeight, onChange: fontWeight => handleChange({ fontWeight }, { fontWeight }) })),
|
|
27
|
+
lineHeight: (React.createElement(SettingWrapper, { label: "Line Height", vertical: true },
|
|
28
|
+
React.createElement(SliderWithInputNumber, { defaultValue: typeof (settings === null || settings === void 0 ? void 0 : settings.lineHeight) !== 'undefined' ? +settings.lineHeight : 0, min: 1, max: 5, step: 0.1, onAfterChange: lineHeight => handleChange({ lineHeight }, { lineHeight }) }))),
|
|
29
|
+
letterSpacing: (React.createElement(SettingWrapper, { label: "Letter Spacing", vertical: true },
|
|
30
|
+
React.createElement(SliderWithInputNumber, { defaultValue: typeof (settings === null || settings === void 0 ? void 0 : settings.letterSpacing) !== 'undefined' ? +settings.letterSpacing : 0, min: -10, max: 10, onAfterChange: letterSpacing => handleChange({ letterSpacing }, { letterSpacing }) }))),
|
|
31
|
+
textTransform: (React.createElement(TextTransformSelect, { label: "Text Transform", value: settings === null || settings === void 0 ? void 0 : settings.textTransform, onChange: textTransform => handleChange({ textTransform }, { textTransform }) })),
|
|
32
|
+
textDecoration: (React.createElement(TextDecorationSelect, { label: "Text Decoration", value: settings === null || settings === void 0 ? void 0 : settings.textDecoration, onChange: textDecoration => handleChange({ textDecoration }, { textDecoration }) })),
|
|
33
|
+
italic: (React.createElement(SettingWrapper, { label: "Font Style Italic" },
|
|
34
|
+
React.createElement(Switch, { checked: settings === null || settings === void 0 ? void 0 : settings.fontItalic, onChange: fontItalic => handleChange({ fontItalic }, { fontStyle: fontItalic ? 'italic' : 'normal' }) }))),
|
|
35
|
+
}),
|
|
36
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
+
[settings]);
|
|
38
|
+
const filteredSetting = useMemo(() => {
|
|
39
|
+
if (!showSettings || (showSettings === null || showSettings === void 0 ? void 0 : showSettings.length) === 0) {
|
|
40
|
+
return Object.keys(settingMap).map(keySetting => settingMap[keySetting]);
|
|
41
|
+
}
|
|
42
|
+
return showSettings.map(keySetting => settingMap[keySetting]);
|
|
43
|
+
}, [showSettings, settingMap]);
|
|
44
|
+
return React.createElement(Space, { direction: "vertical" }, filteredSetting);
|
|
46
45
|
};
|
|
47
46
|
export const FontSetting = (props) => {
|
|
48
|
-
const { label, settings, wrapperProps, popoverProps, childrenProps, onChange } = props;
|
|
49
|
-
return (React.createElement(SettingWrapperPopover, { label: label !== null && label !== void 0 ? label : 'Font Settings',
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const { label, settings, styles, wrapperProps, popoverProps, childrenProps, showSettings, onChange, } = props;
|
|
48
|
+
return (React.createElement(SettingWrapperPopover, { label: label !== null && label !== void 0 ? label : 'Font Settings', popoverProps: Object.assign({ overlayStyle: { top: 0 }, placement: 'bottomRight' }, popoverProps), wrapperProps: Object.assign({ containerStyle: { minWidth: '288px' } }, wrapperProps) },
|
|
49
|
+
React.createElement(FontSettingEdit, Object.assign({ settings: settings, styles: styles, showSettings: showSettings, onChange: onChange }, childrenProps))));
|
|
50
|
+
};
|
|
51
|
+
FontSetting.defaultProps = {
|
|
52
|
+
settings: FONT_SETTING_DEFAULT,
|
|
53
|
+
styles: FONT_STYLE_DEFAULT,
|
|
53
54
|
};
|
|
@@ -14,10 +14,10 @@ export declare const Modal: string & import("styled-components").StyledComponent
|
|
|
14
14
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
15
15
|
destroyAll: () => void;
|
|
16
16
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
17
|
-
_InternalPanelDoNotUseOrYouWillBeFired: (props:
|
|
17
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: any) => React.JSX.Element;
|
|
18
18
|
}, any, import("./styled").CustomModalProps, never> & import("hoist-non-react-statics").NonReactStatics<React.FC<AntdModalProps> & import("antd/es/modal/confirm").ModalStaticFunctions & {
|
|
19
19
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
20
20
|
destroyAll: () => void;
|
|
21
21
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
22
|
-
_InternalPanelDoNotUseOrYouWillBeFired: (props:
|
|
22
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: any) => React.JSX.Element;
|
|
23
23
|
}, {}> & React.FC<ModalProps>;
|
|
@@ -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("
|
|
13
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: any) => import("react").JSX.Element;
|
|
14
14
|
}, any, CustomModalProps, never>;
|
|
15
15
|
export declare const WrapperSpin: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
import { StyledModal } from './styled';
|
|
15
|
+
// Components
|
|
16
|
+
import { Button, Flex } from '../../atoms';
|
|
17
|
+
export const ModalV2 = props => {
|
|
18
|
+
const { okButtonProps, cancelButtonProps, okText, cancelText, onCancel, onOk } = props;
|
|
19
|
+
const restOfProps = __rest(props, []);
|
|
20
|
+
return (React.createElement(StyledModal, Object.assign({ footer: React.createElement(Flex, { gap: 10, align: "center" },
|
|
21
|
+
React.createElement(Button, Object.assign({ type: "primary", onClick: onOk }, okButtonProps), okText || 'OK'),
|
|
22
|
+
React.createElement(Button, Object.assign({ onClick: onCancel }, cancelButtonProps), cancelText || 'Cancel')) }, restOfProps)));
|
|
23
|
+
};
|
|
24
|
+
ModalV2.defaultProps = {
|
|
25
|
+
// footer,
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ModalV2';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledModal: import("styled-components").StyledComponent<import("react").FC<import("antd").ModalProps> & import("antd/es/modal/confirm").ModalStaticFunctions & {
|
|
3
|
+
useModal: typeof import("antd/es/modal/useModal").default;
|
|
4
|
+
destroyAll: () => void;
|
|
5
|
+
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
6
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: any) => import("react").JSX.Element;
|
|
7
|
+
}, any, {}, never>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import { Modal } from 'antd';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
export const StyledModal = styled(Modal) `
|
|
5
|
+
.antsomi-modal-content {
|
|
6
|
+
.antsomi-modal-close {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 10px !important;
|
|
9
|
+
right: 10px !important;
|
|
10
|
+
width: 24px !important;
|
|
11
|
+
height: 24px !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.antsomi-modal-body {
|
|
15
|
+
padding: 15px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.antsomi-modal-header {
|
|
19
|
+
padding: 15px 15px 0px 15px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
|
|
15
|
+
import { Button, Icon } from '../../atoms';
|
|
16
|
+
// Styled
|
|
17
|
+
import { ModalBody, ModalHeader, StyledModal } from './styled';
|
|
18
|
+
// Utils
|
|
19
|
+
import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
|
|
20
|
+
export const PreviewModal = props => {
|
|
21
|
+
const { onCancel } = props;
|
|
22
|
+
const { children, modalHeaderClassName, modalBodyClassName } = props, restProps = __rest(props, ["children", "modalHeaderClassName", "modalBodyClassName"]);
|
|
23
|
+
const { t } = i18nInstance;
|
|
24
|
+
return (React.createElement(StyledModal, Object.assign({}, restProps, { centered: true, closeIcon: null, footer: null, width: "100vw" }),
|
|
25
|
+
React.createElement(ModalHeader, { className: modalHeaderClassName },
|
|
26
|
+
React.createElement(Button, { className: "close-btn", onClick: onCancel },
|
|
27
|
+
React.createElement(Icon, { type: "icon-ants-remove-slim", size: 12 }),
|
|
28
|
+
t(translations.close))),
|
|
29
|
+
React.createElement(ModalBody, { className: modalBodyClassName }, children)));
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PreviewModal } from './PreviewModal';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledModal: import("styled-components").StyledComponent<import("react").FC<import("../ModalV2").ModalV2Props>, any, {}, never>;
|
|
3
|
+
export declare const ModalHeader: 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
|
+
export declare const ModalBody: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
// Components
|
|
4
|
+
import { ModalV2 } from '../ModalV2';
|
|
5
|
+
import { Flex } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
6
|
+
const HEADER_HEIGHT = '50px';
|
|
7
|
+
export const StyledModal = styled(ModalV2) `
|
|
8
|
+
max-width: 100vw !important;
|
|
9
|
+
|
|
10
|
+
.antsomi-modal-content {
|
|
11
|
+
border-radius: 0px;
|
|
12
|
+
height: 100vh;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.antsomi-modal-body {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
height: 100%;
|
|
19
|
+
padding: 0px !important;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
export const ModalHeader = styled(Flex) `
|
|
23
|
+
height: ${HEADER_HEIGHT};
|
|
24
|
+
border-bottom: 1px solid #c2cee0;
|
|
25
|
+
box-shadow: 0px 2px 3px rgba(15, 19, 23, 0.1);
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
|
|
28
|
+
.close-btn {
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: 15px;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
ModalHeader.defaultProps = {
|
|
34
|
+
align: 'center',
|
|
35
|
+
justify: 'center',
|
|
36
|
+
};
|
|
37
|
+
export const ModalBody = styled.div.attrs({}) `
|
|
38
|
+
overflow: auto;
|
|
39
|
+
`;
|