@kids-reporter/draft-renderer 1.0.10 → 1.0.11
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.
|
@@ -99,28 +99,12 @@ const SlidesSection = _styledComponents.default.div`
|
|
|
99
99
|
flex-basis: 100%;
|
|
100
100
|
overflow: hidden;
|
|
101
101
|
position: relative;
|
|
102
|
+
width: 100%;
|
|
103
|
+
aspect-ratio: 3 / 2;
|
|
102
104
|
|
|
103
105
|
${_mediaQuery.mediaQuery.smallOnly} {
|
|
104
106
|
order: 2;
|
|
105
107
|
}
|
|
106
|
-
|
|
107
|
-
${_mediaQuery.mediaQuery.smallOnly} {
|
|
108
|
-
padding-bottom: calc(
|
|
109
|
-
${mockup.mobile.slide.height} / ${mockup.mobile.container.width}*100%
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
${_mediaQuery.mediaQuery.mediumOnly} {
|
|
114
|
-
padding-bottom: calc(
|
|
115
|
-
${mockup.desktop.slide.height} / ${mockup.desktop.container.width}*100%
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
${_mediaQuery.mediaQuery.largeOnly} {
|
|
120
|
-
padding-bottom: calc(
|
|
121
|
-
${mockup.hd.slide.height} / ${mockup.hd.container.width}*100%
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
108
|
`;
|
|
125
109
|
const PrevNextSection = _styledComponents.default.div`
|
|
126
110
|
margin-top: 20px;
|
|
@@ -328,42 +312,6 @@ const SlideFlexItem = _styledComponents.default.div`
|
|
|
328
312
|
padding-right: ${mockup.hd.slide.paddingRight}px;
|
|
329
313
|
}
|
|
330
314
|
`;
|
|
331
|
-
const SlideMask = _styledComponents.default.div`
|
|
332
|
-
position: absolute;
|
|
333
|
-
top: 0;
|
|
334
|
-
height: 100%;
|
|
335
|
-
opacity: 0.55;
|
|
336
|
-
`;
|
|
337
|
-
const LeftSlideMask = (0, _styledComponents.default)(SlideMask)`
|
|
338
|
-
left: 0;
|
|
339
|
-
|
|
340
|
-
${_mediaQuery.mediaQuery.smallOnly} {
|
|
341
|
-
width: ${getLeftMaskWidth(mockup.mobile) / getContainerWidth(mockup.mobile) * 100}%;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
${_mediaQuery.mediaQuery.mediumOnly} {
|
|
345
|
-
width: ${getLeftMaskWidth(mockup.desktop)}px;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
${_mediaQuery.mediaQuery.largeOnly} {
|
|
349
|
-
width: ${getLeftMaskWidth(mockup.hd)}px;
|
|
350
|
-
}
|
|
351
|
-
`;
|
|
352
|
-
const RightSlideMask = (0, _styledComponents.default)(SlideMask)`
|
|
353
|
-
right: 0;
|
|
354
|
-
|
|
355
|
-
${_mediaQuery.mediaQuery.smallOnly} {
|
|
356
|
-
width: ${getRightMaskWidth(mockup.mobile) / getContainerWidth(mockup.mobile) * 100}%;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
${_mediaQuery.mediaQuery.mediumOnly} {
|
|
360
|
-
width: ${getRightMaskWidth(mockup.desktop)}px;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
${_mediaQuery.mediaQuery.largeOnly} {
|
|
364
|
-
width: ${getRightMaskWidth(mockup.hd)}px;
|
|
365
|
-
}
|
|
366
|
-
`;
|
|
367
315
|
const SlideshowFlexBox = _styledComponents.default.div`
|
|
368
316
|
${PrevButton} {
|
|
369
317
|
border-color: #d8d8d8;
|
|
@@ -379,11 +327,6 @@ const SlideshowFlexBox = _styledComponents.default.div`
|
|
|
379
327
|
${ImageNumber} {
|
|
380
328
|
color: #fff;
|
|
381
329
|
}
|
|
382
|
-
${SlideMask} {
|
|
383
|
-
background-color: ${({
|
|
384
|
-
theme
|
|
385
|
-
}) => (0, _index.getColorHex)(theme === null || theme === void 0 ? void 0 : theme.themeColor)};
|
|
386
|
-
}
|
|
387
330
|
|
|
388
331
|
width: 100%;
|
|
389
332
|
margin: 0 auto;
|
|
@@ -429,22 +372,6 @@ function getContainerWidth(deviceMockup) {
|
|
|
429
372
|
function getSlideWidth(deviceMockup) {
|
|
430
373
|
return deviceMockup.slide.width + deviceMockup.slide.paddingRight;
|
|
431
374
|
}
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* @param {DeviceMockup} deviceMockup
|
|
435
|
-
* @return {number}
|
|
436
|
-
*/
|
|
437
|
-
function getLeftMaskWidth(deviceMockup) {
|
|
438
|
-
return deviceMockup.offset.left - deviceMockup.slide.paddingRight; // px
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* @param {DeviceMockup} deviceMockup
|
|
443
|
-
* @return {number}
|
|
444
|
-
*/
|
|
445
|
-
function getRightMaskWidth(deviceMockup) {
|
|
446
|
-
return deviceMockup.container.width - deviceMockup.offset.left - getSlideWidth(deviceMockup); // px
|
|
447
|
-
}
|
|
448
375
|
function SlideshowBlock({
|
|
449
376
|
className = '',
|
|
450
377
|
data
|
|
@@ -494,15 +421,18 @@ function SlideshowBlock({
|
|
|
494
421
|
// hence, we append `index` on the key
|
|
495
422
|
_react.default.createElement(SlideFlexItem, {
|
|
496
423
|
key: `slide_${img.id}_${index}`
|
|
424
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
425
|
+
className: "w-full h-full relative overflow-hidden"
|
|
497
426
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
498
427
|
srcSet: imgSrcSetArr.join(','),
|
|
499
428
|
src: imgSrc,
|
|
500
429
|
style: {
|
|
430
|
+
display: 'block',
|
|
501
431
|
objectFit,
|
|
502
|
-
|
|
432
|
+
height: '100%'
|
|
503
433
|
},
|
|
504
434
|
sizes: "(max-width: 768px) 100vw, (min-width: 1400px) 1000px, 500px"
|
|
505
|
-
}))
|
|
435
|
+
})))
|
|
506
436
|
);
|
|
507
437
|
});
|
|
508
438
|
}, [images]);
|
|
@@ -543,7 +473,7 @@ function SlideshowBlock({
|
|
|
543
473
|
translateXUint: translateXUnit,
|
|
544
474
|
duration: duration,
|
|
545
475
|
isSliding: isSliding
|
|
546
|
-
}, slides)
|
|
476
|
+
}, slides)), /*#__PURE__*/_react.default.createElement(PrevNextSection, null, /*#__PURE__*/_react.default.createElement(PrevButton, {
|
|
547
477
|
onClick: isSliding ? undefined : slideToPrev
|
|
548
478
|
}, /*#__PURE__*/_react.default.createElement(PreArrowSvg, null)), /*#__PURE__*/_react.default.createElement(NextButton, {
|
|
549
479
|
onClick: isSliding ? undefined : slideToNext
|