@antscorp/antsomi-ui 1.3.5-beta.244 → 1.3.5-beta.246
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/background/skeleton-background.png +0 -0
- package/es/components/common/ConfigProvider/GlobalStyle.js +1 -1
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +23 -6
- package/es/components/molecules/ThumbnailCard/styled.js +6 -4
- package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +5 -4
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +4 -4
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +3 -3
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +4 -4
- package/es/components/organism/PreviewTemplateModal/index.js +9 -12
- package/es/components/template/TemplateListing/index.js +25 -28
- package/es/constants/theme.js +6 -1
- package/es/providers/index.d.ts +0 -1
- package/es/providers/index.js +0 -1
- package/package.json +1 -1
- package/es/providers/AntdConfigProviderV2.d.ts +0 -7
- package/es/providers/AntdConfigProviderV2.js +0 -28
|
Binary file
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
var _a, _b;
|
|
1
2
|
// Libraries
|
|
2
3
|
import styled, { css } from 'styled-components';
|
|
3
4
|
import { Flex } from '@antscorp/antsomi-ui/es/components';
|
|
4
5
|
// Assets
|
|
5
|
-
import SkeletonBg from '@antscorp/antsomi-ui/es/assets/images/
|
|
6
|
+
import SkeletonBg from '@antscorp/antsomi-ui/es/assets/images/background/skeleton-background.png';
|
|
7
|
+
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
6
8
|
const backgroundImage = css `
|
|
7
9
|
${() => css `
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
&::after {
|
|
11
|
+
content: '';
|
|
12
|
+
position: absolute;
|
|
13
|
+
width: 90%;
|
|
14
|
+
height: 90%;
|
|
15
|
+
background: url(${SkeletonBg}) no-repeat center center;
|
|
16
|
+
background-size: contain;
|
|
17
|
+
z-index: 0;
|
|
18
|
+
}
|
|
10
19
|
`}
|
|
11
20
|
`;
|
|
12
21
|
const setWidthHeight = ({ w, h }) => `
|
|
@@ -125,7 +134,7 @@ export const ImageSliderStyled = styled(Flex) `
|
|
|
125
134
|
width: 100%;
|
|
126
135
|
height: 100%;
|
|
127
136
|
background-color: transparent;
|
|
128
|
-
z-index:
|
|
137
|
+
z-index: 2;
|
|
129
138
|
transition: background-color 150ms ease-in-out;
|
|
130
139
|
}
|
|
131
140
|
|
|
@@ -137,14 +146,21 @@ export const ImageSliderStyled = styled(Flex) `
|
|
|
137
146
|
.image-container {
|
|
138
147
|
&--big,
|
|
139
148
|
&--small {
|
|
140
|
-
|
|
149
|
+
position: relative;
|
|
150
|
+
box-sizing: border-box;
|
|
151
|
+
background: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorBgSkeleton};
|
|
152
|
+
border: 1px solid ${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.blue1_1};
|
|
153
|
+
border-radius: 5px;
|
|
154
|
+
|
|
141
155
|
${centerBlock}
|
|
142
156
|
&:not(.hide-skeleton) {
|
|
143
157
|
${backgroundImage}
|
|
144
158
|
}
|
|
145
159
|
|
|
146
160
|
img {
|
|
161
|
+
position: relative;
|
|
147
162
|
object-fit: contain;
|
|
163
|
+
z-index: 1;
|
|
148
164
|
}
|
|
149
165
|
|
|
150
166
|
div:has(> img) {
|
|
@@ -169,7 +185,8 @@ export const ImageSliderStyled = styled(Flex) `
|
|
|
169
185
|
height: 72px;
|
|
170
186
|
flex-shrink: 0;
|
|
171
187
|
|
|
172
|
-
border: 2px solid #e5e5e5;
|
|
188
|
+
/* border: 2px solid #e5e5e5; */
|
|
189
|
+
border-width: 2px;
|
|
173
190
|
border-radius: 2px;
|
|
174
191
|
user-select: none;
|
|
175
192
|
cursor: pointer;
|
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
// Images
|
|
4
4
|
import skeletonBackground from '../../../assets/images/background/skeleton-background.png';
|
|
5
|
-
|
|
5
|
+
// Constants
|
|
6
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
6
7
|
export const ThumbnailCardWrapper = styled.div `
|
|
7
|
-
background-color:
|
|
8
|
+
background-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorBgSkeleton};
|
|
8
9
|
padding: 10px;
|
|
9
|
-
border-radius: ${globalToken.borderRadius}px;
|
|
10
|
+
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadius}px;
|
|
10
11
|
position: relative;
|
|
11
12
|
box-sizing: border-box;
|
|
12
13
|
width: 100%;
|
|
13
14
|
display: flex;
|
|
14
15
|
align-items: center;
|
|
15
16
|
justify-content: center;
|
|
17
|
+
border: 1px solid ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.blue1_1};
|
|
16
18
|
|
|
17
19
|
:hover {
|
|
18
20
|
.center-action {
|
|
@@ -77,7 +79,7 @@ export const ThumbnailCardWrapper = styled.div `
|
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
.backdrop {
|
|
80
|
-
border-radius: ${globalToken.borderRadius}px;
|
|
82
|
+
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadius}px;
|
|
81
83
|
position: absolute;
|
|
82
84
|
width: 100%;
|
|
83
85
|
height: 100%;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
// Images
|
|
3
3
|
import skeletonBackground from '../../../../../assets/images/background/skeleton-background.png';
|
|
4
|
-
//
|
|
5
|
-
import { globalToken } from '@antscorp/antsomi-ui/es/
|
|
4
|
+
// Constants
|
|
5
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
6
6
|
const THUMBNAIL_CARD_RADIUS = 5;
|
|
7
7
|
export const BannerWrapper = styled.div `
|
|
8
8
|
width: 100%;
|
|
@@ -10,8 +10,9 @@ export const BannerWrapper = styled.div `
|
|
|
10
10
|
display: flex;
|
|
11
11
|
justify-content: center;
|
|
12
12
|
align-items: center;
|
|
13
|
-
background-color:
|
|
14
|
-
border-radius: ${globalToken.borderRadius}px;
|
|
13
|
+
background-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorBgSkeleton};
|
|
14
|
+
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadius}px;
|
|
15
|
+
border: 1px solid ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.blue1_1};
|
|
15
16
|
|
|
16
17
|
${props => props.$height
|
|
17
18
|
? css `
|
|
@@ -3,7 +3,7 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
// Components
|
|
4
4
|
import { Button, Flex } from '../../../../atoms';
|
|
5
5
|
// Providers
|
|
6
|
-
import { globalToken } from '@antscorp/antsomi-ui/es/
|
|
6
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
7
7
|
export const InformationWrapper = styled(Flex) `
|
|
8
8
|
width: 300px;
|
|
9
9
|
flex-shrink: 0;
|
|
@@ -51,11 +51,11 @@ export const InformationWrapper = styled(Flex) `
|
|
|
51
51
|
}
|
|
52
52
|
`;
|
|
53
53
|
export const CheckboxButton = styled(Button) `
|
|
54
|
-
color: ${globalToken.colorText} !important;
|
|
54
|
+
color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorText} !important;
|
|
55
55
|
|
|
56
56
|
${p => p.$active &&
|
|
57
57
|
css `
|
|
58
|
-
color: ${globalToken.colorPrimary} !important;
|
|
59
|
-
background-color: ${globalToken.blue1_1} !important;
|
|
58
|
+
color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorPrimary} !important;
|
|
59
|
+
background-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.blue1_1} !important;
|
|
60
60
|
`}
|
|
61
61
|
`;
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
// Components
|
|
4
4
|
import { Flex } from '../../../../atoms';
|
|
5
5
|
// Providers
|
|
6
|
-
import { globalToken } from '@antscorp/antsomi-ui/es/
|
|
6
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
7
7
|
export const SimilarTemplateWrapper = styled(Flex) `
|
|
8
8
|
margin-top: 15px;
|
|
9
9
|
|
|
@@ -17,10 +17,10 @@ export const TemplateListWrapper = styled.div `
|
|
|
17
17
|
gap: 30px;
|
|
18
18
|
|
|
19
19
|
.thumbnail-card {
|
|
20
|
-
border-radius: ${globalToken.borderRadius}px;
|
|
20
|
+
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadius}px;
|
|
21
21
|
|
|
22
22
|
> div {
|
|
23
|
-
border-radius: ${globalToken.borderRadius}px;
|
|
23
|
+
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadius}px;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
3
|
-
import { globalToken } from '@antscorp/antsomi-ui/es/providers';
|
|
4
2
|
import styled from 'styled-components';
|
|
5
3
|
import { SwiperSlide } from 'swiper/react';
|
|
4
|
+
// Constants
|
|
5
|
+
import { THEME, globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
6
6
|
export const ThumbnailSliderWrapper = styled.div `
|
|
7
7
|
width: 100%;
|
|
8
8
|
display: flex;
|
|
@@ -21,10 +21,10 @@ export const ThumbnailSliderWrapper = styled.div `
|
|
|
21
21
|
.thumbnail-animation {
|
|
22
22
|
box-shadow: none;
|
|
23
23
|
transition: box-shadow 0.1s ease-in-out;
|
|
24
|
-
border-radius: ${globalToken.borderRadius}px;
|
|
24
|
+
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadius}px;
|
|
25
25
|
|
|
26
26
|
> div {
|
|
27
|
-
border-radius: ${globalToken.borderRadius}px;
|
|
27
|
+
border-radius: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.borderRadius}px;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&:hover {
|
|
@@ -18,20 +18,17 @@ import { Banner, Information, SimilarTemplate, ThumbnailSlider } from './compone
|
|
|
18
18
|
import { ModalContainer, ModalWrapper } from './styled';
|
|
19
19
|
// Constants
|
|
20
20
|
import { DEVICE_TYPE, SIMILAR_TEMPLATE_DEFAULT, THUMBNAIL_DEFAULT } from './constants';
|
|
21
|
-
// Providers
|
|
22
|
-
import { AntdConfigProviderV2 } from '@antscorp/antsomi-ui/es/providers';
|
|
23
21
|
export const PreviewTemplateModal = memo(props => {
|
|
24
22
|
const { bannerProps, thumbnailProps = THUMBNAIL_DEFAULT, similarTemplateProps = SIMILAR_TEMPLATE_DEFAULT, informationProps, loading = false } = props, restOfProps = __rest(props, ["bannerProps", "thumbnailProps", "similarTemplateProps", "informationProps", "loading"]);
|
|
25
23
|
// States
|
|
26
24
|
const [deviceType, setDeviceType] = useState(DEVICE_TYPE.DESKTOP.value);
|
|
27
|
-
return (React.createElement(
|
|
28
|
-
React.createElement(
|
|
29
|
-
React.createElement(
|
|
30
|
-
React.createElement(
|
|
31
|
-
React.createElement(
|
|
32
|
-
React.createElement(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
React.createElement(SimilarTemplate, Object.assign({}, similarTemplateProps))))));
|
|
25
|
+
return (React.createElement(ModalContainer, Object.assign({ footer: null, centered: true, modalRender: node => React.createElement(ModalWrapper, null, node) }, restOfProps),
|
|
26
|
+
React.createElement(Spin, { spinning: loading },
|
|
27
|
+
React.createElement(Flex, { gap: 20 },
|
|
28
|
+
React.createElement("div", { className: "overview" },
|
|
29
|
+
React.createElement(Flex, { gap: 20, vertical: true, style: { width: '100%' } },
|
|
30
|
+
React.createElement(Banner, Object.assign({ deviceType: deviceType }, bannerProps)),
|
|
31
|
+
React.createElement(ThumbnailSlider, Object.assign({}, thumbnailProps)))),
|
|
32
|
+
React.createElement(Information, Object.assign({ deviceType: deviceType, onDeviceTypeChange: value => setDeviceType(value) }, informationProps))),
|
|
33
|
+
React.createElement(SimilarTemplate, Object.assign({}, similarTemplateProps)))));
|
|
37
34
|
});
|
|
@@ -12,8 +12,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
/* eslint-disable react/function-component-definition */
|
|
13
13
|
// Libraries
|
|
14
14
|
import React, { memo, useState } from 'react';
|
|
15
|
-
// Config Providers
|
|
16
|
-
import { AntdConfigProviderV2 } from '../../..';
|
|
17
15
|
// Components
|
|
18
16
|
import { CategoryListing, BlankTemplate, Empty } from './components';
|
|
19
17
|
import { Spin } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
@@ -66,32 +64,31 @@ export const TemplateListing = memo(props => {
|
|
|
66
64
|
};
|
|
67
65
|
return (
|
|
68
66
|
/** The className "template-listing-wrapper" is used to detect dom in useListingItemResize hook */
|
|
69
|
-
React.createElement(
|
|
70
|
-
React.createElement(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
React.createElement(
|
|
75
|
-
React.createElement("div", {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
React.createElement(PreviewTemplateModal, Object.assign({ open: openPreviewModal, onOk: handleOkPreviewModal, onCancel: handleCancelPreviewModal }, restOfPreviewModalProps)))));
|
|
67
|
+
React.createElement(TemplateListingWrapper, { className: "template-listing-wrapper" },
|
|
68
|
+
React.createElement(CategoryListing, Object.assign({}, categoryListingProps, { emptyProps: emptyProps })),
|
|
69
|
+
React.createElement(TemplateWrapper, { className: wrapperClassName, style: wrapperStyle },
|
|
70
|
+
header,
|
|
71
|
+
React.createElement(Spin, { spinning: loading || !itemPerRow, wrapperClassName: "template-listing__loading template-listing__loading--full" },
|
|
72
|
+
React.createElement("div", { className: "template-listing" },
|
|
73
|
+
React.createElement("div", { ref: containerRef, style: {
|
|
74
|
+
display: 'grid',
|
|
75
|
+
gap: listingGap,
|
|
76
|
+
gridTemplateColumns: `repeat(${itemPerRow}, minmax(0, 1fr))`,
|
|
77
|
+
} },
|
|
78
|
+
React.createElement(BlankTemplate, Object.assign({ width: width * ratio, height: height * ratio }, blankTemplateProps)),
|
|
79
|
+
!!itemPerRow &&
|
|
80
|
+
(items === null || items === void 0 ? void 0 : items.map((item, index) => {
|
|
81
|
+
const { id, name, thumbnail } = item || {};
|
|
82
|
+
const loading = typeof (item === null || item === void 0 ? void 0 : item.name) === 'undefined';
|
|
83
|
+
return (React.createElement("div", { key: id },
|
|
84
|
+
index === items.length - 2 && React.createElement(LoadMoreBlock, { ref: loadMoreRef }),
|
|
85
|
+
React.createElement(ThumbnailCard, Object.assign({ id: id || 0, name: name || 'Untitled', loading: loading, width: width * ratio, height: height * ratio, thumbnail: thumbnail, className: `${templateItemProps.className}`, previewBtnProps: {
|
|
86
|
+
onClick: handleClickThumbnailPreview,
|
|
87
|
+
} }, restOfTemplateItemProps))));
|
|
88
|
+
}))),
|
|
89
|
+
!loading && !blankTemplateProps.show && !isHasData && React.createElement(Empty, Object.assign({}, emptyProps)))),
|
|
90
|
+
footer),
|
|
91
|
+
React.createElement(PreviewTemplateModal, Object.assign({ open: openPreviewModal, onOk: handleOkPreviewModal, onCancel: handleCancelPreviewModal }, restOfPreviewModalProps))));
|
|
95
92
|
});
|
|
96
93
|
TemplateListing.displayName = 'TemplateListing';
|
|
97
94
|
TemplateListing.defaultProps = TEMPLATE_LISTING_DEFAULT;
|
package/es/constants/theme.js
CHANGED
|
@@ -22,7 +22,8 @@ export const THEME = {
|
|
|
22
22
|
colorTextActive: '#e0ebf7',
|
|
23
23
|
colorIcon: '#666666',
|
|
24
24
|
/* Border radius */
|
|
25
|
-
borderRadius:
|
|
25
|
+
borderRadius: 10,
|
|
26
|
+
borderRadiusLG: 10,
|
|
26
27
|
borderRadiusXL: 10,
|
|
27
28
|
/* Font */
|
|
28
29
|
fontFamily: 'Roboto',
|
|
@@ -76,6 +77,8 @@ export const THEME = {
|
|
|
76
77
|
gold1,
|
|
77
78
|
gold6,
|
|
78
79
|
scrollBarSize: '4px',
|
|
80
|
+
/** Skeleton */
|
|
81
|
+
colorBgSkeleton: '#FCFDFF',
|
|
79
82
|
},
|
|
80
83
|
};
|
|
81
84
|
THEME.components = {
|
|
@@ -88,6 +91,7 @@ THEME.components = {
|
|
|
88
91
|
colorBgTextHover: (_c = THEME.token) === null || _c === void 0 ? void 0 : _c.blue,
|
|
89
92
|
colorBgContainerDisabled: (_d = THEME.token) === null || _d === void 0 ? void 0 : _d.bw6,
|
|
90
93
|
colorTextDisabled: (_e = THEME.token) === null || _e === void 0 ? void 0 : _e.bw0,
|
|
94
|
+
textHoverBg: '#F2F9FF',
|
|
91
95
|
},
|
|
92
96
|
Input: {
|
|
93
97
|
controlHeight: 32,
|
|
@@ -150,6 +154,7 @@ THEME.components = {
|
|
|
150
154
|
controlInteractiveSize: 18,
|
|
151
155
|
colorBorder: (_t = THEME.token) === null || _t === void 0 ? void 0 : _t.colorPrimary,
|
|
152
156
|
lineWidth: 2,
|
|
157
|
+
borderRadiusSM: 5,
|
|
153
158
|
},
|
|
154
159
|
Modal: {
|
|
155
160
|
titleFontSize: 16,
|
package/es/providers/index.d.ts
CHANGED
package/es/providers/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ConfigProviderProps } from 'antd';
|
|
3
|
-
interface AntdConfigProviderV2Props extends ConfigProviderProps {
|
|
4
|
-
}
|
|
5
|
-
export declare const AntdConfigProviderV2: React.FC<AntdConfigProviderV2Props>;
|
|
6
|
-
export declare const globalToken: import("antd/es/theme/internal").AliasToken;
|
|
7
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
var _a;
|
|
13
|
-
// Libraries
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import { ConfigProvider, theme } from 'antd';
|
|
16
|
-
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
17
|
-
const { getDesignToken } = theme;
|
|
18
|
-
const themeV2 = {
|
|
19
|
-
token: Object.assign(Object.assign({}, THEME.token), { colorText: '#000000', borderRadius: 10, borderRadiusLG: 10 }),
|
|
20
|
-
components: Object.assign(Object.assign({}, THEME.components), { Button: Object.assign(Object.assign({}, (_a = THEME.components) === null || _a === void 0 ? void 0 : _a.Button), { borderRadius: 10, textHoverBg: '#F2F9FF' }), Checkbox: {
|
|
21
|
-
borderRadiusSM: 5,
|
|
22
|
-
} }),
|
|
23
|
-
};
|
|
24
|
-
export const AntdConfigProviderV2 = props => {
|
|
25
|
-
const { children } = props, restProps = __rest(props, ["children"]);
|
|
26
|
-
return (React.createElement(ConfigProvider, Object.assign({ theme: themeV2 }, restProps), children));
|
|
27
|
-
};
|
|
28
|
-
export const globalToken = getDesignToken(themeV2);
|