@meduza/ui-kit-2 1.4.0 → 1.4.2
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/dist/ui-kit-2.cjs.development.js +9 -42
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +9 -42
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit-game.css +56 -258
- package/dist/ui-kit.css +56 -258
- package/package.json +1 -1
- package/src/Image/Image.module.css +16 -7
- package/src/Meta/Meta.module.css +4 -0
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +28 -201
- package/src/RelatedRichBlock/index.tsx +11 -64
- package/src/RichTitle/RichTitle.module.css +8 -12
- package/src/Tag/Tag.module.css +0 -1
|
@@ -427,7 +427,7 @@ const RenderPicture = ({
|
|
|
427
427
|
}));
|
|
428
428
|
};
|
|
429
429
|
|
|
430
|
-
var styles$F = {"root":"Image-module_root__H5wAh","fullRatio":"Image-module_fullRatio__q7QPa","isStatic":"Image-module_isStatic__TmQ1V","isLoaded":"Image-module_isLoaded__keFnD","wrapper":"Image-module_wrapper__gJtbB","fullscreen":"Image-module_fullscreen__4PU9c","dark":"Image-module_dark__qjo5O"};
|
|
430
|
+
var styles$F = {"root":"Image-module_root__H5wAh","fullRatio":"Image-module_fullRatio__q7QPa","isStatic":"Image-module_isStatic__TmQ1V","isLoaded":"Image-module_isLoaded__keFnD","wrapper":"Image-module_wrapper__gJtbB","fullscreen":"Image-module_fullscreen__4PU9c","dark":"Image-module_dark__qjo5O","isRelated":"Image-module_isRelated__uSeSM"};
|
|
431
431
|
|
|
432
432
|
const Image = ({
|
|
433
433
|
alt,
|
|
@@ -2391,15 +2391,14 @@ const Spoiler = ({
|
|
|
2391
2391
|
}))));
|
|
2392
2392
|
};
|
|
2393
2393
|
|
|
2394
|
-
var styles$6 = {"root":"RelatedRichBlock-module_root__-SEe7","
|
|
2394
|
+
var styles$6 = {"root":"RelatedRichBlock-module_root__-SEe7","content":"RelatedRichBlock-module_content__iyMrN","cover":"RelatedRichBlock-module_cover__3gnIx","body":"RelatedRichBlock-module_body__XhS0U","isCard":"RelatedRichBlock-module_isCard__wkMw-","tag":"RelatedRichBlock-module_tag__c18sv","center":"RelatedRichBlock-module_center__KANd-","mobile":"RelatedRichBlock-module_mobile__N-G4U","desktop":"RelatedRichBlock-module_desktop__EaPOr"};
|
|
2395
2395
|
|
|
2396
|
-
/* eslint-disable react/jsx-no-target-blank */
|
|
2397
2396
|
const RelatedRichBlock = ({
|
|
2398
2397
|
block: {
|
|
2399
2398
|
only_on: onlyOn,
|
|
2400
2399
|
data: {
|
|
2401
|
-
blocks,
|
|
2402
2400
|
url,
|
|
2401
|
+
blocks,
|
|
2403
2402
|
cover: {
|
|
2404
2403
|
urls,
|
|
2405
2404
|
gradients,
|
|
@@ -2411,70 +2410,38 @@ const RelatedRichBlock = ({
|
|
|
2411
2410
|
},
|
|
2412
2411
|
styleContext
|
|
2413
2412
|
}) => {
|
|
2414
|
-
const style = {};
|
|
2415
|
-
const styleHeader = {};
|
|
2416
2413
|
const cardType = `is${toCapitalize(layout)}`;
|
|
2417
|
-
const [ref, inView] = reactIntersectionObserver.useInView({
|
|
2418
|
-
threshold: 0,
|
|
2419
|
-
triggerOnce: true
|
|
2420
|
-
});
|
|
2421
|
-
React.useEffect(() => {
|
|
2422
|
-
if (inView) {
|
|
2423
|
-
if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
|
|
2424
|
-
postMessage('richRelated', url, 'view');
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
2427
|
-
}, [inView]);
|
|
2428
|
-
const handleClick = () => {
|
|
2429
|
-
postMessage('richRelated', url, 'click');
|
|
2430
|
-
};
|
|
2431
2414
|
let classNames = [[styles$6.root, true], [styles$6[cardType], !!layout && !!styles$6[cardType]], [styles$6.hasGradient, !!gradients], [styles$6[onlyOn], !!onlyOn && !!styles$6[onlyOn]]];
|
|
2432
2415
|
let context = ['isInMediaBlock'];
|
|
2433
2416
|
if (styleContext) {
|
|
2434
2417
|
classNames = makeStyleContext(classNames, styleContext, styles$6);
|
|
2435
2418
|
context = [...styleContext, 'isInMediaBlock'];
|
|
2436
2419
|
}
|
|
2437
|
-
if (gradients) {
|
|
2438
|
-
styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
|
|
2439
|
-
const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
|
|
2440
|
-
classNames = makeStyleContext(classNames, theme, styles$6);
|
|
2441
|
-
if (onlyOn === 'desktop') {
|
|
2442
|
-
style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
|
|
2443
|
-
}
|
|
2444
|
-
}
|
|
2445
2420
|
return /*#__PURE__*/React.createElement(reactRouterDom.Link, {
|
|
2446
2421
|
"data-testid": "related-rich-block",
|
|
2447
2422
|
className: makeClassName(classNames),
|
|
2448
|
-
to: `/${url}
|
|
2449
|
-
|
|
2450
|
-
ref: ref
|
|
2451
|
-
}, layout === 'rich' && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
2452
|
-
className: styles$6.overlay,
|
|
2453
|
-
style: style
|
|
2454
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
2455
|
-
className: styles$6.overlayHeader,
|
|
2456
|
-
style: styleHeader
|
|
2457
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
2423
|
+
to: `/${url}`
|
|
2424
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2458
2425
|
className: styles$6.tag
|
|
2459
2426
|
}, /*#__PURE__*/React.createElement(Tag, {
|
|
2460
2427
|
size: "small",
|
|
2461
2428
|
theme: "inherit",
|
|
2462
2429
|
styleContext: "richRelated"
|
|
2463
2430
|
}, tag)), /*#__PURE__*/React.createElement("div", {
|
|
2464
|
-
className: styles$6.
|
|
2431
|
+
className: styles$6.content
|
|
2465
2432
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2466
|
-
className: styles$6.
|
|
2433
|
+
className: styles$6.cover
|
|
2467
2434
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
2468
2435
|
optimized: urls,
|
|
2469
2436
|
ratio: ratio,
|
|
2470
2437
|
display: "narrow"
|
|
2471
|
-
}))
|
|
2438
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2472
2439
|
className: styles$6.body
|
|
2473
2440
|
}, blocks.map(item => (/*#__PURE__*/React.createElement(RenderBlocks, {
|
|
2474
2441
|
key: item.id,
|
|
2475
2442
|
block: item,
|
|
2476
2443
|
styleContext: context
|
|
2477
|
-
})))));
|
|
2444
|
+
}))))));
|
|
2478
2445
|
};
|
|
2479
2446
|
|
|
2480
2447
|
var styles$5 = {"root":"ShopRelatedBlock-module_root__eTGjC","wrapper":"ShopRelatedBlock-module_wrapper__v6yE3","overlay":"ShopRelatedBlock-module_overlay__oR67Y","overlayHeader":"ShopRelatedBlock-module_overlayHeader__YMcNw","body":"ShopRelatedBlock-module_body__W4pBN","hasGradient":"ShopRelatedBlock-module_hasGradient__50JTl","picture":"ShopRelatedBlock-module_picture__zjFL4","tag":"ShopRelatedBlock-module_tag__ixkda","center":"ShopRelatedBlock-module_center__IpBP4","title":"ShopRelatedBlock-module_title__COl93","price":"ShopRelatedBlock-module_price__5Qitu","dark":"ShopRelatedBlock-module_dark__d0QiW","light":"ShopRelatedBlock-module_light__lUDWA","mobile":"ShopRelatedBlock-module_mobile__I6Hih","desktop":"ShopRelatedBlock-module_desktop__ywKrb"};
|