@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.
Files changed (104) 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/components/atoms/InputDynamic/InputDynamic.d.ts +1 -2
  4. package/es/components/atoms/InputDynamic/styled.d.ts +1 -1
  5. package/es/components/atoms/MobileFrame/MobileFrame.d.ts +4 -0
  6. package/es/components/atoms/MobileFrame/MobileFrame.js +22 -0
  7. package/es/components/atoms/MobileFrame/constants.d.ts +4 -0
  8. package/es/components/atoms/MobileFrame/constants.js +4 -0
  9. package/es/components/atoms/MobileFrame/index.d.ts +2 -0
  10. package/es/components/atoms/MobileFrame/index.js +1 -0
  11. package/es/components/atoms/MobileFrame/styled.d.ts +3 -0
  12. package/es/components/atoms/MobileFrame/styled.js +33 -0
  13. package/es/components/atoms/PreviewTabs/PreviewTabs.d.ts +7 -0
  14. package/es/components/atoms/PreviewTabs/PreviewTabs.js +67 -0
  15. package/es/components/atoms/PreviewTabs/index.d.ts +2 -0
  16. package/es/components/atoms/PreviewTabs/index.js +1 -0
  17. package/es/components/atoms/PreviewTabs/styled.d.ts +6 -0
  18. package/es/components/atoms/PreviewTabs/styled.js +79 -0
  19. package/es/components/atoms/Spin/Spin.d.ts +1 -2
  20. package/es/components/atoms/index.d.ts +1 -0
  21. package/es/components/atoms/index.js +1 -0
  22. package/es/components/common/ConfigProvider/GlobalStyle.js +25 -0
  23. package/es/components/icons/ArrowGrowIcon.d.ts +1 -2
  24. package/es/components/icons/AudioRecordIcon.d.ts +1 -2
  25. package/es/components/icons/BugIcon.d.ts +1 -2
  26. package/es/components/icons/CameraIcon.d.ts +1 -2
  27. package/es/components/icons/CaptureIcon.d.ts +1 -2
  28. package/es/components/icons/CheckSlimIcon.d.ts +1 -2
  29. package/es/components/icons/CloseIcon.d.ts +1 -2
  30. package/es/components/icons/CommentIcon.d.ts +1 -2
  31. package/es/components/icons/EventIcon.d.ts +1 -2
  32. package/es/components/icons/FreeDrawIcon.d.ts +1 -2
  33. package/es/components/icons/GPTIcon.d.ts +1 -2
  34. package/es/components/icons/GPTIconV2.d.ts +1 -2
  35. package/es/components/icons/GPTIconV3.d.ts +1 -2
  36. package/es/components/icons/HighlightIcon.d.ts +1 -2
  37. package/es/components/icons/IdeaIcon.d.ts +1 -2
  38. package/es/components/icons/InvisibleIcon.d.ts +1 -2
  39. package/es/components/icons/MuteIcon.d.ts +1 -2
  40. package/es/components/icons/OpenUrlIcon.d.ts +1 -2
  41. package/es/components/icons/PauseIcon.d.ts +1 -2
  42. package/es/components/icons/PlaneIcon.d.ts +1 -2
  43. package/es/components/icons/RequestIcon.d.ts +1 -2
  44. package/es/components/icons/StopRecordIcon.d.ts +1 -2
  45. package/es/components/icons/UserIcon.d.ts +1 -2
  46. package/es/components/icons/VerticalDotsIcon.d.ts +1 -2
  47. package/es/components/icons/WarningIcon.d.ts +1 -2
  48. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +1 -2
  49. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +1 -2
  50. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +1 -2
  51. package/es/components/molecules/Modal/styled.d.ts +1 -1
  52. package/es/components/molecules/ModalV2/styled.d.ts +1 -1
  53. package/es/components/molecules/ResizeGrid/ResizeGrid.js +1 -0
  54. package/es/components/molecules/RichMenuBlock/RichMenuBlock.d.ts +9 -0
  55. package/es/components/molecules/RichMenuBlock/RichMenuBlock.js +49 -0
  56. package/es/components/molecules/RichMenuBlock/RichMenuCell/index.d.ts +10 -0
  57. package/es/components/molecules/RichMenuBlock/RichMenuCell/index.js +47 -0
  58. package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.d.ts +8 -0
  59. package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.js +36 -0
  60. package/es/components/molecules/RichMenuBlock/constants.d.ts +2 -0
  61. package/es/components/molecules/RichMenuBlock/constants.js +765 -0
  62. package/es/components/molecules/RichMenuBlock/index.d.ts +3 -0
  63. package/es/components/molecules/RichMenuBlock/index.js +2 -0
  64. package/es/components/molecules/RichMenuBlock/styled.d.ts +9 -0
  65. package/es/components/molecules/RichMenuBlock/styled.js +17 -0
  66. package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.d.ts +9 -0
  67. package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.js +32 -0
  68. package/es/components/molecules/RichMenuChatBar/TypingChat/index.d.ts +6 -0
  69. package/es/components/molecules/RichMenuChatBar/TypingChat/index.js +15 -0
  70. package/es/components/molecules/RichMenuChatBar/TypingChat/styled.d.ts +4 -0
  71. package/es/components/molecules/RichMenuChatBar/TypingChat/styled.js +47 -0
  72. package/es/components/molecules/RichMenuChatBar/index.d.ts +2 -0
  73. package/es/components/molecules/RichMenuChatBar/index.js +1 -0
  74. package/es/components/molecules/RichMenuChatBar/styled.d.ts +8 -0
  75. package/es/components/molecules/RichMenuChatBar/styled.js +33 -0
  76. package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.d.ts +8 -0
  77. package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.js +37 -0
  78. package/es/components/molecules/RichMenuMobileView/index.d.ts +1 -0
  79. package/es/components/molecules/RichMenuMobileView/index.js +1 -0
  80. package/es/components/molecules/RichMenuMobileView/styled.d.ts +6 -0
  81. package/es/components/molecules/RichMenuMobileView/styled.js +20 -0
  82. package/es/components/molecules/Select/Test.d.ts +1 -2
  83. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +1 -1
  84. package/es/components/molecules/UploadImage/MediaIcon.d.ts +1 -2
  85. package/es/components/molecules/index.d.ts +3 -0
  86. package/es/components/molecules/index.js +3 -0
  87. package/es/constants/index.d.ts +1 -0
  88. package/es/constants/index.js +1 -0
  89. package/es/constants/richMenu.d.ts +19 -0
  90. package/es/constants/richMenu.js +19 -0
  91. package/es/constants/storybook.d.ts +1 -2
  92. package/es/locales/en/translation.json +2 -1
  93. package/es/locales/i18n.d.ts +1 -0
  94. package/es/locales/translations.d.ts +1 -0
  95. package/es/test.d.ts +1 -2
  96. package/es/types/index.d.ts +12 -0
  97. package/es/types/index.js +2 -1
  98. package/es/types/richMenu.d.ts +191 -0
  99. package/es/types/richMenu.js +1 -0
  100. package/es/types/variables.d.ts +2 -0
  101. package/es/types/variables.js +1 -0
  102. package/es/utils/handleError.d.ts +32 -2
  103. package/es/utils/handleError.js +42 -4
  104. package/package.json +2 -2
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): React.JSX.Element;
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 import("react").JSX.IntrinsicElements, any, import("../Input/Input").InputProps, any>;
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,4 @@
1
+ import React from 'react';
2
+ export interface MobileFrameProps extends React.HtmlHTMLAttributes<HTMLDivElement> {
3
+ }
4
+ export declare const MobileFrame: React.FC<React.PropsWithChildren<MobileFrameProps>>;
@@ -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,4 @@
1
+ export declare const MOBILE_SETTING: {
2
+ width: number;
3
+ height: number;
4
+ };
@@ -0,0 +1,4 @@
1
+ export const MOBILE_SETTING = {
2
+ width: 391,
3
+ height: 660,
4
+ };
@@ -0,0 +1,2 @@
1
+ export { MobileFrame } from './MobileFrame';
2
+ export type { MobileFrameProps } from './MobileFrame';
@@ -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,2 @@
1
+ export { PreviewTabs } from './PreviewTabs';
2
+ export type { PreviewTabProps } from './PreviewTabs';
@@ -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): React.JSX.Element;
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';
@@ -34,3 +34,4 @@ export { SliderV2 } from './SliderV2';
34
34
  export * from './Flex';
35
35
  export * from './RateV2';
36
36
  export { InputDynamic } from './InputDynamic';
37
+ export * from './PreviewTabs';
@@ -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
- import React from 'react';
2
- export declare const ArrowGrowIcon: (props: any) => React.JSX.Element;
1
+ export declare const ArrowGrowIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const AudioRecordIcon: (props: any) => React.JSX.Element;
1
+ export declare const AudioRecordIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const BugIcon: (props: any) => React.JSX.Element;
1
+ export declare const BugIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const CameraIcon: (props: any) => React.JSX.Element;
1
+ export declare const CameraIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const CaptureIcon: (props: any) => React.JSX.Element;
1
+ export declare const CaptureIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const CheckSlimIcon: (props: any) => React.JSX.Element;
1
+ export declare const CheckSlimIcon: (props: any) => JSX.Element;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  export declare const CloseIcon: ({ ...props }: {
3
2
  [x: string]: any;
4
- }) => React.JSX.Element;
3
+ }) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const CommentIcon: (props: any) => React.JSX.Element;
1
+ export declare const CommentIcon: (props: any) => JSX.Element;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  export declare const EventIcon: ({ ...props }: {
3
2
  [x: string]: any;
4
- }) => React.JSX.Element;
3
+ }) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const FreeDrawIcon: (props: any) => React.JSX.Element;
1
+ export declare const FreeDrawIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const GPTIcon: () => React.JSX.Element;
1
+ export declare const GPTIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const GPTIconV2: () => React.JSX.Element;
1
+ export declare const GPTIconV2: () => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const GPTIconV3: (props: any) => React.JSX.Element;
1
+ export declare const GPTIconV3: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const HighlightIcon: (props: any) => React.JSX.Element;
1
+ export declare const HighlightIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const IdeaIcon: (props: any) => React.JSX.Element;
1
+ export declare const IdeaIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const InvisibleIcon: (props: any) => React.JSX.Element;
1
+ export declare const InvisibleIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const MuteIcon: (props: any) => React.JSX.Element;
1
+ export declare const MuteIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const OpenUrlIcon: (props: any) => React.JSX.Element;
1
+ export declare const OpenUrlIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const PauseIcon: (props: any) => React.JSX.Element;
1
+ export declare const PauseIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const PlaneIcon: (props: any) => React.JSX.Element;
1
+ export declare const PlaneIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const RequestIcon: (props: any) => React.JSX.Element;
1
+ export declare const RequestIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const StopRecordIcon: (props: any) => React.JSX.Element;
1
+ export declare const StopRecordIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const UserIcon: (props: any) => React.JSX.Element;
1
+ export declare const UserIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const VerticalDotsIcon: (props: any) => React.JSX.Element;
1
+ export declare const VerticalDotsIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const WarningIcon: (props: any) => React.JSX.Element;
1
+ export declare const WarningIcon: (props: any) => JSX.Element;
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  import { IImageEditorProps } from './types';
3
2
  declare const CaptureScreen: {
4
- (props: IImageEditorProps): React.JSX.Element;
3
+ (props: IImageEditorProps): JSX.Element;
5
4
  defaultProps: {
6
5
  isOpen: boolean;
7
6
  src: string;
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  import { CommentBoxProps } from './types';
3
2
  declare const CommentBox: {
4
- (props: CommentBoxProps): React.JSX.Element;
3
+ (props: CommentBoxProps): JSX.Element;
5
4
  defaultProps: {
6
5
  info: {
7
6
  id: string;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { CursorProps } from './types';
3
- declare const Cursor: (props: CursorProps) => React.JSX.Element | null;
2
+ declare const Cursor: (props: CursorProps) => JSX.Element | null;
4
3
  export { Cursor };
@@ -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) => import("react").JSX.Element;
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) => import("react").JSX.Element;
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 {};