@megafon/ui-shared 6.2.0 → 6.3.0
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/CHANGELOG.md +12 -0
- package/dist/es/components/ImageBanner/ImageBanner.d.ts +2 -0
- package/dist/es/components/ImageBanner/ImageBanner.js +5 -1
- package/dist/lib/components/ImageBanner/ImageBanner.d.ts +2 -0
- package/dist/lib/components/ImageBanner/ImageBanner.js +5 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,18 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [6.3.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.2.0...@megafon/ui-shared@6.3.0) (2024-09-02)
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* **imagebanner:** add fetchpriority to ImageBanner ([224fd6a](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/224fd6aab695fd945074288611103a5991d9c32f))
|
12
|
+
* **imagebanner:** fix unit tests ([ed90c88](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/ed90c88fc7cf5be0357171f0e95af6ad35d24cbe))
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
6
18
|
# [6.2.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-shared@6.1.2...@megafon/ui-shared@6.2.0) (2024-08-30)
|
7
19
|
|
8
20
|
|
@@ -72,6 +72,8 @@ export interface IImageBannerProps {
|
|
72
72
|
imageDesktop2x?: string;
|
73
73
|
/** Значение тега alt для изображения */
|
74
74
|
imageAlt?: string;
|
75
|
+
/** Приоритет загрузки изображения */
|
76
|
+
fetchPriority?: 'auto' | 'high' | 'low';
|
75
77
|
/** Выравнивание изображения по вертикали (по умолчанию center) */
|
76
78
|
imageVerticalAlign?: ImageVerticalAlignType;
|
77
79
|
/** Высота баннера зависит от высоты контента (по умолчанию фиксированная) */
|
@@ -72,6 +72,8 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
72
72
|
imageDesktop2x = _ref2$imageDesktop2x === void 0 ? '' : _ref2$imageDesktop2x,
|
73
73
|
_ref2$imageAlt = _ref2.imageAlt,
|
74
74
|
imageAlt = _ref2$imageAlt === void 0 ? '' : _ref2$imageAlt,
|
75
|
+
_ref2$fetchPriority = _ref2.fetchPriority,
|
76
|
+
fetchPriority = _ref2$fetchPriority === void 0 ? 'auto' : _ref2$fetchPriority,
|
75
77
|
_ref2$imageVerticalAl = _ref2.imageVerticalAlign,
|
76
78
|
imageVerticalAlign = _ref2$imageVerticalAl === void 0 ? ImageVerticalAlign.CENTER : _ref2$imageVerticalAl,
|
77
79
|
title = _ref2.title,
|
@@ -148,7 +150,8 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
148
150
|
className: cn('image', [classes.image]),
|
149
151
|
src: imageMobile || imageMobile2x,
|
150
152
|
srcSet: imageMobile2x ? "".concat(imageMobile2x, " 2x") : undefined,
|
151
|
-
alt: imageAlt
|
153
|
+
alt: imageAlt,
|
154
|
+
fetchPriority: fetchPriority
|
152
155
|
})));
|
153
156
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
154
157
|
className: cn({
|
@@ -197,6 +200,7 @@ ImageBanner.propTypes = {
|
|
197
200
|
imageDesktop: PropTypes.string,
|
198
201
|
imageDesktop2x: PropTypes.string,
|
199
202
|
imageAlt: PropTypes.string,
|
203
|
+
fetchPriority: PropTypes.oneOf(['auto', 'high', 'low']),
|
200
204
|
imageVerticalAlign: PropTypes.oneOf(Object.values(ImageVerticalAlign)),
|
201
205
|
autoHeight: PropTypes.bool,
|
202
206
|
isImageFullWidth: PropTypes.bool,
|
@@ -72,6 +72,8 @@ export interface IImageBannerProps {
|
|
72
72
|
imageDesktop2x?: string;
|
73
73
|
/** Значение тега alt для изображения */
|
74
74
|
imageAlt?: string;
|
75
|
+
/** Приоритет загрузки изображения */
|
76
|
+
fetchPriority?: 'auto' | 'high' | 'low';
|
75
77
|
/** Выравнивание изображения по вертикали (по умолчанию center) */
|
76
78
|
imageVerticalAlign?: ImageVerticalAlignType;
|
77
79
|
/** Высота баннера зависит от высоты контента (по умолчанию фиксированная) */
|
@@ -100,6 +100,8 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
100
100
|
imageDesktop2x = _ref2$imageDesktop2x === void 0 ? '' : _ref2$imageDesktop2x,
|
101
101
|
_ref2$imageAlt = _ref2.imageAlt,
|
102
102
|
imageAlt = _ref2$imageAlt === void 0 ? '' : _ref2$imageAlt,
|
103
|
+
_ref2$fetchPriority = _ref2.fetchPriority,
|
104
|
+
fetchPriority = _ref2$fetchPriority === void 0 ? 'auto' : _ref2$fetchPriority,
|
103
105
|
_ref2$imageVerticalAl = _ref2.imageVerticalAlign,
|
104
106
|
imageVerticalAlign = _ref2$imageVerticalAl === void 0 ? ImageVerticalAlign.CENTER : _ref2$imageVerticalAl,
|
105
107
|
title = _ref2.title,
|
@@ -181,7 +183,8 @@ var ImageBanner = function ImageBanner(_ref2) {
|
|
181
183
|
className: cn('image', [classes.image]),
|
182
184
|
src: imageMobile || imageMobile2x,
|
183
185
|
srcSet: imageMobile2x ? "".concat(imageMobile2x, " 2x") : undefined,
|
184
|
-
alt: imageAlt
|
186
|
+
alt: imageAlt,
|
187
|
+
fetchPriority: fetchPriority
|
185
188
|
})));
|
186
189
|
|
187
190
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
@@ -231,6 +234,7 @@ ImageBanner.propTypes = {
|
|
231
234
|
imageDesktop: PropTypes.string,
|
232
235
|
imageDesktop2x: PropTypes.string,
|
233
236
|
imageAlt: PropTypes.string,
|
237
|
+
fetchPriority: PropTypes.oneOf(['auto', 'high', 'low']),
|
234
238
|
imageVerticalAlign: PropTypes.oneOf(Object.values(ImageVerticalAlign)),
|
235
239
|
autoHeight: PropTypes.bool,
|
236
240
|
isImageFullWidth: PropTypes.bool,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.3.0",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -82,7 +82,7 @@
|
|
82
82
|
},
|
83
83
|
"dependencies": {
|
84
84
|
"@babel/runtime": "^7.8.4",
|
85
|
-
"@megafon/ui-core": "^6.2.
|
85
|
+
"@megafon/ui-core": "^6.2.1",
|
86
86
|
"@megafon/ui-helpers": "^2.6.0",
|
87
87
|
"core-js": "^3.6.4",
|
88
88
|
"htmr": "^0.9.2",
|
@@ -90,5 +90,5 @@
|
|
90
90
|
"prop-types": "^15.7.2",
|
91
91
|
"swiper": "^6.5.6"
|
92
92
|
},
|
93
|
-
"gitHead": "
|
93
|
+
"gitHead": "fe62002ae1623a7f9316553d35c8c2fa4df36bd7"
|
94
94
|
}
|