@treely/strapi-slices 7.1.2 → 7.1.3
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/README.md +1 -1
- package/dist/strapi-slices.cjs.development.js +9 -15
- package/dist/strapi-slices.cjs.development.js.map +1 -1
- package/dist/strapi-slices.cjs.production.min.js +1 -1
- package/dist/strapi-slices.cjs.production.min.js.map +1 -1
- package/dist/strapi-slices.esm.js +9 -15
- package/dist/strapi-slices.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/slices/CarouselMarqueeBanner/CarouselMarqueeBanner.tsx +10 -23
- package/src/slices/CarouselMarqueeBanner/styles.ts +4 -2
- package/src/utils/getClosestRatio.ts +1 -1
package/README.md
CHANGED
|
@@ -42,10 +42,10 @@ npm pack
|
|
|
42
42
|
Go to the project which uses the strapi-slices package and remove the `node_modules` and the `.next` folder before installing the package there:
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
+
cd ../path/to/your/project
|
|
45
46
|
rm -r node_modules
|
|
46
47
|
rm -r .next
|
|
47
48
|
npm install
|
|
48
|
-
cd ../path/to/your/project
|
|
49
49
|
npm install ../path/to/strapi-slices-package.tgz
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -3541,7 +3541,7 @@ var ImageContainer = /*#__PURE__*/styled__default.default(boemly.Box)(_templateO
|
|
|
3541
3541
|
return aspectRatio;
|
|
3542
3542
|
});
|
|
3543
3543
|
|
|
3544
|
-
var ALLOWED_RATIOS = [2 / 3, 1 / 1, 3 / 2];
|
|
3544
|
+
var ALLOWED_RATIOS = [2 / 3, 1 / 1, 3 / 2, 2 / 1, 3 / 1, 4 / 1, 5 / 1]; // width / height
|
|
3545
3545
|
var getClosestRatio = function getClosestRatio(width, height) {
|
|
3546
3546
|
var ratio = width / height;
|
|
3547
3547
|
var minDiff = Math.abs(ratio - ALLOWED_RATIOS[0]);
|
|
@@ -5384,14 +5384,14 @@ var Comparison = function Comparison(_ref) {
|
|
|
5384
5384
|
};
|
|
5385
5385
|
|
|
5386
5386
|
var _templateObject, _templateObject2;
|
|
5387
|
-
var CarouselInnerContainer = /*#__PURE__*/styled__default.default(framerMotion.motion.div)(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: ", ";\n gap: var(--boemly-space-
|
|
5387
|
+
var CarouselInnerContainer = /*#__PURE__*/styled__default.default(framerMotion.motion.div)(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: ", ";\n gap: var(--boemly-space-24);\n padding-right: var(--boemly-space-24);\n padding-left: var(--boemly-space-24);\n\n @media screen and (max-width: ", ") {\n width: calc(\n ", " *\n (var(--boemly-sizes-16) + var(--boemly-space-6))\n );\n justify-content: ", ";\n }\n"])), function (props) {
|
|
5388
5388
|
return props.logoCount < 5 ? 'center' : 'flex-start';
|
|
5389
5389
|
}, BREAKPOINT_MD, function (props) {
|
|
5390
5390
|
return props.logoCount;
|
|
5391
5391
|
}, function (props) {
|
|
5392
5392
|
return props.logoCount < 5 ? 'center' : 'flex-start';
|
|
5393
5393
|
});
|
|
5394
|
-
var LogoGrid = /*#__PURE__*/styled__default.default(framerMotion.motion.div)(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: var(--boemly-space-
|
|
5394
|
+
var LogoGrid = /*#__PURE__*/styled__default.default(framerMotion.motion.div)(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: var(--boemly-space-24);\n\n @media screen and (max-width: ", ") {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: var(--boemly-space-6);\n }\n"])), BREAKPOINT_MD);
|
|
5395
5395
|
|
|
5396
5396
|
// Separate component containing the actual logic
|
|
5397
5397
|
var CarouselMarqueeBannerContent = function CarouselMarqueeBannerContent(_ref) {
|
|
@@ -5429,7 +5429,6 @@ var CarouselMarqueeBannerContent = function CarouselMarqueeBannerContent(_ref) {
|
|
|
5429
5429
|
return React__default.default.createElement(LogoGrid, null, slice.logos.map(function (logo, index) {
|
|
5430
5430
|
return React__default.default.createElement(boemly.Box, {
|
|
5431
5431
|
key: logo.id + "-" + index,
|
|
5432
|
-
width: isMobile ? '16' : '36',
|
|
5433
5432
|
flexShrink: 0,
|
|
5434
5433
|
transform: "translate3d(0, 0, 0)"
|
|
5435
5434
|
}, React__default.default.createElement(boemly.Flex, {
|
|
@@ -5439,17 +5438,15 @@ var CarouselMarqueeBannerContent = function CarouselMarqueeBannerContent(_ref) {
|
|
|
5439
5438
|
alignItems: "center"
|
|
5440
5439
|
}, React__default.default.createElement(boemly.Box, {
|
|
5441
5440
|
position: "relative",
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
width: isMobile ? '16' : '36',
|
|
5445
|
-
borderRadius: "xl"
|
|
5441
|
+
height: isMobile ? '16' : '36',
|
|
5442
|
+
width: "calc(var(--boemly-sizes-10)\n * " + getClosestRatio(logo.img.data.attributes.width, logo.img.data.attributes.height) + ")"
|
|
5446
5443
|
}, React__default.default.createElement(Image__default.default, {
|
|
5447
5444
|
src: strapiMediaUrl(logo.img, 'large'),
|
|
5448
5445
|
alt: logo.alt,
|
|
5449
5446
|
fill: true,
|
|
5450
5447
|
style: {
|
|
5451
5448
|
objectFit: logo.objectFit || 'contain',
|
|
5452
|
-
|
|
5449
|
+
filter: 'grayscale(100%)'
|
|
5453
5450
|
}
|
|
5454
5451
|
}))));
|
|
5455
5452
|
}));
|
|
@@ -5464,7 +5461,6 @@ var CarouselMarqueeBannerContent = function CarouselMarqueeBannerContent(_ref) {
|
|
|
5464
5461
|
}, logosToRender.map(function (logo, index) {
|
|
5465
5462
|
return React__default.default.createElement(boemly.Box, {
|
|
5466
5463
|
key: logo.id + "-" + index,
|
|
5467
|
-
width: isMobile ? '16' : '36',
|
|
5468
5464
|
flexShrink: 0,
|
|
5469
5465
|
transform: "translate3d(0, 0, 0)"
|
|
5470
5466
|
}, React__default.default.createElement(boemly.Flex, {
|
|
@@ -5474,17 +5470,15 @@ var CarouselMarqueeBannerContent = function CarouselMarqueeBannerContent(_ref) {
|
|
|
5474
5470
|
alignItems: "center"
|
|
5475
5471
|
}, React__default.default.createElement(boemly.Box, {
|
|
5476
5472
|
position: "relative",
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
width: isMobile ? '16' : '36',
|
|
5480
|
-
borderRadius: "xl"
|
|
5473
|
+
height: isMobile ? '16' : '36',
|
|
5474
|
+
width: "calc(var(--boemly-sizes-10) * " + getClosestRatio(logo.img.data.attributes.width, logo.img.data.attributes.height) + ")"
|
|
5481
5475
|
}, React__default.default.createElement(Image__default.default, {
|
|
5482
5476
|
src: strapiMediaUrl(logo.img, 'large'),
|
|
5483
5477
|
alt: logo.alt,
|
|
5484
5478
|
fill: true,
|
|
5485
5479
|
style: {
|
|
5486
5480
|
objectFit: logo.objectFit || 'contain',
|
|
5487
|
-
|
|
5481
|
+
filter: 'grayscale(100%)'
|
|
5488
5482
|
}
|
|
5489
5483
|
}))));
|
|
5490
5484
|
})));
|