@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.
Files changed (197) hide show
  1. package/es/assets/images/iphone-top-bar.png +0 -0
  2. package/es/assets/images/iphone.png +0 -0
  3. package/es/assets/images/stars_slider.png +0 -0
  4. package/es/components/atoms/Input/Input.d.ts +3 -0
  5. package/es/components/atoms/Input/Input.js +4 -3
  6. package/es/components/atoms/InputDynamic/EditCaretPositioning.d.ts +2 -0
  7. package/es/components/atoms/InputDynamic/EditCaretPositioning.js +89 -0
  8. package/es/components/atoms/InputDynamic/InputDynamic.d.ts +30 -0
  9. package/es/components/atoms/InputDynamic/InputDynamic.js +320 -0
  10. package/es/components/atoms/InputDynamic/PopupShortLink.d.ts +16 -0
  11. package/es/components/atoms/InputDynamic/PopupShortLink.js +85 -0
  12. package/es/components/atoms/InputDynamic/index.d.ts +2 -0
  13. package/es/components/atoms/InputDynamic/index.js +1 -0
  14. package/es/components/atoms/InputDynamic/styled.d.ts +12 -0
  15. package/es/components/atoms/InputDynamic/styled.js +281 -0
  16. package/es/components/atoms/InputDynamic/utils.d.ts +22 -0
  17. package/es/components/atoms/InputDynamic/utils.js +751 -0
  18. package/es/components/atoms/MobileFrame/MobileFrame.d.ts +4 -0
  19. package/es/components/atoms/MobileFrame/MobileFrame.js +22 -0
  20. package/es/components/atoms/MobileFrame/constants.d.ts +4 -0
  21. package/es/components/atoms/MobileFrame/constants.js +4 -0
  22. package/es/components/atoms/MobileFrame/index.d.ts +2 -0
  23. package/es/components/atoms/MobileFrame/index.js +1 -0
  24. package/es/components/atoms/MobileFrame/styled.d.ts +3 -0
  25. package/es/components/atoms/MobileFrame/styled.js +33 -0
  26. package/es/components/atoms/Pagination/index.d.ts +1 -0
  27. package/es/components/atoms/PreviewTabs/PreviewTabs.d.ts +7 -0
  28. package/es/components/atoms/PreviewTabs/PreviewTabs.js +67 -0
  29. package/es/components/atoms/PreviewTabs/index.d.ts +2 -0
  30. package/es/components/atoms/PreviewTabs/index.js +1 -0
  31. package/es/components/atoms/PreviewTabs/styled.d.ts +6 -0
  32. package/es/components/atoms/PreviewTabs/styled.js +79 -0
  33. package/es/components/atoms/RateV2/RateV2.d.ts +18 -0
  34. package/es/components/atoms/RateV2/RateV2.js +73 -0
  35. package/es/components/atoms/RateV2/index.d.ts +1 -0
  36. package/es/components/atoms/RateV2/index.js +1 -0
  37. package/es/components/atoms/RequiredLabel/index.d.ts +1 -0
  38. package/es/components/atoms/RequiredLabel/index.js +4 -3
  39. package/es/components/atoms/Slider/index.d.ts +2 -1
  40. package/es/components/atoms/Slider/index.js +7 -14
  41. package/es/components/atoms/SliderV2/index.d.ts +6 -0
  42. package/es/components/atoms/SliderV2/index.js +21 -0
  43. package/es/components/atoms/Spin/Spin.d.ts +2 -1
  44. package/es/components/atoms/Spin/styled.d.ts +1 -1
  45. package/es/components/atoms/index.d.ts +7 -0
  46. package/es/components/atoms/index.js +5 -0
  47. package/es/components/common/ConfigProvider/GlobalStyle.js +66 -2
  48. package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
  49. package/es/components/icons/AudioRecordIcon.d.ts +2 -1
  50. package/es/components/icons/BugIcon.d.ts +2 -1
  51. package/es/components/icons/CameraIcon.d.ts +2 -1
  52. package/es/components/icons/CaptureIcon.d.ts +2 -1
  53. package/es/components/icons/CheckSlimIcon.d.ts +2 -1
  54. package/es/components/icons/CloseIcon.d.ts +2 -1
  55. package/es/components/icons/CommentIcon.d.ts +2 -1
  56. package/es/components/icons/EventIcon.d.ts +2 -1
  57. package/es/components/icons/FreeDrawIcon.d.ts +2 -1
  58. package/es/components/icons/GPTIcon.d.ts +2 -1
  59. package/es/components/icons/GPTIconV2.d.ts +2 -1
  60. package/es/components/icons/GPTIconV3.d.ts +2 -1
  61. package/es/components/icons/HighlightIcon.d.ts +2 -1
  62. package/es/components/icons/IdeaIcon.d.ts +2 -1
  63. package/es/components/icons/InvisibleIcon.d.ts +2 -1
  64. package/es/components/icons/MuteIcon.d.ts +2 -1
  65. package/es/components/icons/OpenUrlIcon.d.ts +2 -1
  66. package/es/components/icons/PauseIcon.d.ts +2 -1
  67. package/es/components/icons/PlaneIcon.d.ts +2 -1
  68. package/es/components/icons/RequestIcon.d.ts +2 -1
  69. package/es/components/icons/StopRecordIcon.d.ts +2 -1
  70. package/es/components/icons/UserIcon.d.ts +2 -1
  71. package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
  72. package/es/components/icons/WarningIcon.d.ts +2 -1
  73. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
  74. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
  75. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
  76. package/es/components/molecules/FontSetting/constants.d.ts +3 -0
  77. package/es/components/molecules/FontSetting/constants.js +22 -0
  78. package/es/components/molecules/FontSetting/index.d.ts +10 -4
  79. package/es/components/molecules/FontSetting/index.js +36 -35
  80. package/es/components/molecules/FontSetting/types.d.ts +1 -1
  81. package/es/components/molecules/Modal/Modal.d.ts +2 -2
  82. package/es/components/molecules/Modal/index.d.ts +1 -0
  83. package/es/components/molecules/Modal/styled.d.ts +1 -1
  84. package/es/components/molecules/ModalV2/ModalV2.d.ts +5 -0
  85. package/es/components/molecules/ModalV2/ModalV2.js +26 -0
  86. package/es/components/molecules/ModalV2/index.d.ts +2 -0
  87. package/es/components/molecules/ModalV2/index.js +1 -0
  88. package/es/components/molecules/ModalV2/styled.d.ts +7 -0
  89. package/es/components/molecules/ModalV2/styled.js +22 -0
  90. package/es/components/molecules/PreviewModal/PreviewModal.d.ts +7 -0
  91. package/es/components/molecules/PreviewModal/PreviewModal.js +30 -0
  92. package/es/components/molecules/PreviewModal/index.d.ts +2 -0
  93. package/es/components/molecules/PreviewModal/index.js +1 -0
  94. package/es/components/molecules/PreviewModal/styled.d.ts +4 -0
  95. package/es/components/molecules/PreviewModal/styled.js +39 -0
  96. package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -0
  97. package/es/components/molecules/ResizeGrid/ResizeGrid.js +719 -0
  98. package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -0
  99. package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +86 -0
  100. package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -0
  101. package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -0
  102. package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -0
  103. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +80 -0
  104. package/es/components/molecules/ResizeGrid/constant.d.ts +35 -0
  105. package/es/components/molecules/ResizeGrid/constant.js +111 -0
  106. package/es/components/molecules/ResizeGrid/index.d.ts +2 -0
  107. package/es/components/molecules/ResizeGrid/index.js +1 -0
  108. package/es/components/molecules/ResizeGrid/styled.d.ts +10 -0
  109. package/es/components/molecules/ResizeGrid/styled.js +56 -0
  110. package/es/components/molecules/ResizeGrid/types.d.ts +147 -0
  111. package/es/components/molecules/ResizeGrid/types.js +1 -0
  112. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +9 -0
  113. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +49 -0
  114. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.d.ts +10 -0
  115. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.js +47 -0
  116. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.d.ts +8 -0
  117. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +36 -0
  118. package/es/components/molecules/RichMenu/RichMenuBlock/constants.d.ts +2 -0
  119. package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +765 -0
  120. package/es/components/molecules/RichMenu/RichMenuBlock/index.d.ts +3 -0
  121. package/es/components/molecules/RichMenu/RichMenuBlock/index.js +2 -0
  122. package/es/components/molecules/RichMenu/RichMenuBlock/styled.d.ts +9 -0
  123. package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +17 -0
  124. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +10 -0
  125. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +32 -0
  126. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.d.ts +6 -0
  127. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.js +15 -0
  128. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +4 -0
  129. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +47 -0
  130. package/es/components/molecules/RichMenu/RichMenuChatBar/index.d.ts +2 -0
  131. package/es/components/molecules/RichMenu/RichMenuChatBar/index.js +1 -0
  132. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +9 -0
  133. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +37 -0
  134. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +10 -0
  135. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +37 -0
  136. package/es/components/molecules/RichMenu/RichMenuMobileView/index.d.ts +1 -0
  137. package/es/components/molecules/RichMenu/RichMenuMobileView/index.js +1 -0
  138. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +6 -0
  139. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +20 -0
  140. package/es/components/molecules/RichMenu/index.d.ts +3 -0
  141. package/es/components/molecules/RichMenu/index.js +3 -0
  142. package/es/components/molecules/Select/Select.d.ts +4 -2
  143. package/es/components/molecules/Select/Test.d.ts +2 -1
  144. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +4 -2
  145. package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
  146. package/es/components/molecules/index.d.ts +6 -0
  147. package/es/components/molecules/index.js +4 -0
  148. package/es/components/organism/Help/styled.d.ts +6 -2
  149. package/es/constants/index.d.ts +1 -0
  150. package/es/constants/index.js +1 -0
  151. package/es/constants/richMenu.d.ts +19 -0
  152. package/es/constants/richMenu.js +19 -0
  153. package/es/constants/storybook.d.ts +2 -1
  154. package/es/constants/theme.js +13 -2
  155. package/es/hooks/useDeepCompareEffect.d.ts +1 -0
  156. package/es/hooks/useDeepCompareEffect.js +21 -0
  157. package/es/locales/en/translation.json +3 -1
  158. package/es/locales/i18n.d.ts +3 -0
  159. package/es/locales/translations.d.ts +2 -0
  160. package/es/locales/vi/translation.json +2 -1
  161. package/es/test.d.ts +2 -1
  162. package/es/test.js +164 -66
  163. package/es/types/index.d.ts +12 -0
  164. package/es/types/index.js +2 -1
  165. package/es/types/richMenu.d.ts +191 -0
  166. package/es/types/richMenu.js +1 -0
  167. package/es/types/variables.d.ts +2 -0
  168. package/es/types/variables.js +1 -0
  169. package/es/utils/common.d.ts +2 -0
  170. package/es/utils/common.js +16 -0
  171. package/es/utils/handleError.d.ts +32 -2
  172. package/es/utils/handleError.js +42 -4
  173. package/package.json +8 -6
  174. package/dist/0173b5993573afa04880.woff +0 -0
  175. package/dist/0dfb9214dfd945cd7290.png +0 -1
  176. package/dist/2883cad25a2b4e87ce5f.eot +0 -0
  177. package/dist/4f54a37971347e3d7122.png +0 -1
  178. package/dist/574b7bee0563a9fe9a29.png +0 -1
  179. package/dist/6b586356e837581204dc.svg +0 -1
  180. package/dist/72eec5c1c786b45a667f.ttf +0 -0
  181. package/dist/bc6bf11c6f5e6743aa4c.png +0 -1
  182. package/dist/dbc405edd6e0806efbc9.svg +0 -1
  183. package/dist/e32f09119052a55cce3c.png +0 -1
  184. package/dist/e3851b9384a984c6fdb5.png +0 -1
  185. package/dist/index.js +0 -2
  186. package/dist/index.js.LICENSE.txt +0 -69
  187. package/dist/main.css +0 -69
  188. package/dist/public/icons/2d496b55d85a9545d7311c073af442bb.png +0 -0
  189. package/dist/public/icons/2fbb4e0927d18e3f8e5c6511ab88d5b3.png +0 -0
  190. package/dist/public/icons/725a52bd91a3ce534b10833df510e5fa.png +0 -0
  191. package/dist/public/icons/7d037e0b378e87a82804443636cd0e13.svg +0 -346
  192. package/dist/public/icons/90553767e0a05b9585a54797cfd9ce51.png +0 -0
  193. package/dist/public/icons/bb64e23a1ff390a416d765ee556096ab.svg +0 -87
  194. package/dist/public/icons/d327b24e9c5d8f486f08d253aab58ce6.png +0 -0
  195. package/dist/public/icons/f1cf266d0a0a53ce07f2dbb859869b7a.png +0 -0
  196. package/dist/public/icons/placeholder-image.png +0 -0
  197. package/dist/public/icons/transparent.svg +0 -1
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  export declare const EventIcon: ({ ...props }: {
2
3
  [x: string]: any;
3
- }) => JSX.Element;
4
+ }) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const FreeDrawIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const FreeDrawIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const GPTIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const GPTIcon: () => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const GPTIconV2: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const GPTIconV2: () => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const GPTIconV3: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const GPTIconV3: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const HighlightIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const HighlightIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const IdeaIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const IdeaIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const InvisibleIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const InvisibleIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const MuteIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const MuteIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const OpenUrlIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const OpenUrlIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const PauseIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const PauseIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const PlaneIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const PlaneIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const RequestIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const RequestIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const StopRecordIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const StopRecordIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const UserIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const UserIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const VerticalDotsIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const VerticalDotsIcon: (props: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const WarningIcon: (props: any) => JSX.Element;
1
+ import React from 'react';
2
+ export declare const WarningIcon: (props: any) => React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  import { IImageEditorProps } from './types';
2
3
  declare const CaptureScreen: {
3
- (props: IImageEditorProps): JSX.Element;
4
+ (props: IImageEditorProps): React.JSX.Element;
4
5
  defaultProps: {
5
6
  isOpen: boolean;
6
7
  src: string;
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  import { CommentBoxProps } from './types';
2
3
  declare const CommentBox: {
3
- (props: CommentBoxProps): JSX.Element;
4
+ (props: CommentBoxProps): React.JSX.Element;
4
5
  defaultProps: {
5
6
  info: {
6
7
  id: string;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { CursorProps } from './types';
2
- declare const Cursor: (props: CursorProps) => JSX.Element | null;
3
+ declare const Cursor: (props: CursorProps) => React.JSX.Element | null;
3
4
  export { Cursor };
@@ -0,0 +1,3 @@
1
+ import { TFontSettings, TFontStyles } from './types';
2
+ export declare const FONT_SETTING_DEFAULT: TFontSettings;
3
+ export declare const FONT_STYLE_DEFAULT: TFontStyles;
@@ -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?: TFontSettingEditProps['onChange'];
14
+ onChange?: (settings: Partial<TFontSettings>, styles: Partial<TFontStyles>) => void;
12
15
  };
13
16
  export type TFontSettingEditProps = {
14
- settings: TFontSettings;
15
- onChange?: (settings: Partial<TFontSettings>, styles?: TFontStyles) => void;
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
- export const FontSettingEdit = (props) => {
13
- const { settings, onChange } = props;
14
- const generateStyles = (settings) => ({
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 = generateStyles(newSettings);
17
+ const newStyles = Object.assign(Object.assign({}, styles), style);
29
18
  onChange(newSettings, newStyles);
30
19
  }
31
20
  };
32
- return (React.createElement(Space, { direction: "vertical" },
33
- React.createElement(FontFamilySelect, { label: "Font Family", value: settings === null || settings === void 0 ? void 0 : settings.fontFamily, onChange: family => handleChange({ fontFamily: family }) }),
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, showOptions: ['Light', 'Black'], onChange: fontWeight => handleChange({ 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
- // labelStyle={{ fontWeight: 'bold', ...wrapperProps?.labelStyle }}
51
- popoverProps: Object.assign({ overlayStyle: { top: 0 }, placement: 'bottomRight' }, popoverProps), wrapperProps: Object.assign({ containerStyle: { minWidth: '288px' } }, wrapperProps) },
52
- React.createElement(FontSettingEdit, Object.assign({ settings: settings, onChange: onChange }, childrenProps))));
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
  };
@@ -11,7 +11,7 @@ export type TFontSettings = {
11
11
  };
12
12
  export type TFontStyles = {
13
13
  fontFamily: string;
14
- fontColor: string;
14
+ color: string;
15
15
  fontSize: string | number;
16
16
  fontWeight: string | number;
17
17
  lineHeight: string | number;
@@ -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: import("antd/es/modal/PurePanel").PurePanelProps) => React.JSX.Element;
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: import("antd/es/modal/PurePanel").PurePanelProps) => React.JSX.Element;
22
+ _InternalPanelDoNotUseOrYouWillBeFired: (props: any) => React.JSX.Element;
23
23
  }, {}> & React.FC<ModalProps>;
@@ -1 +1,2 @@
1
1
  export { Modal } from './Modal';
2
+ export type { ModalProps } from './Modal';
@@ -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) => React.JSX.Element;
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,5 @@
1
+ import React from 'react';
2
+ import { ModalProps } from 'antd';
3
+ export interface ModalV2Props extends ModalProps {
4
+ }
5
+ export declare const ModalV2: React.FC<ModalV2Props>;
@@ -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,2 @@
1
+ export * from './ModalV2';
2
+ export type { ModalProps } from 'antd';
@@ -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,7 @@
1
+ import React from 'react';
2
+ import { ModalProps } from '../ModalV2';
3
+ export interface PreviewModalProps extends ModalProps {
4
+ modalHeaderClassName?: string;
5
+ modalBodyClassName?: string;
6
+ }
7
+ export declare const PreviewModal: React.FC<PreviewModalProps>;
@@ -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,2 @@
1
+ export { PreviewModal } from './PreviewModal';
2
+ export type { PreviewModalProps } from './PreviewModal';
@@ -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
+ `;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { IResizeGridProps } from './types';
3
+ export declare const ResizeGrid: FC<IResizeGridProps>;