@meduza/ui-kit-2 0.1.37 → 0.1.38
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/SensitiveBlock/SensitiveBlock.stories.d.ts +10 -0
- package/dist/SensitiveBlock/SensitiveBlock.types.d.ts +15 -0
- package/dist/SensitiveBlock/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/ui-kit-2.cjs.development.js +195 -126
- 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 +195 -127
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1282 -1162
- package/package.json +6 -6
- package/src/.DS_Store +0 -0
- package/src/EmbedBlock/EmbedBlock.module.css +20 -60
- package/src/EmbedBlock/EmbedBlock.tsx +10 -12
- package/src/GroupedBlock/index.tsx +22 -8
- package/src/GroupedBlock/mock.json +54 -47
- package/src/RawHtmlBlock/RawHtmlBlock.stories.module.css +3 -0
- package/src/RawHtmlBlock/RawHtmlBlock.stories.tsx +6 -1
- package/src/RawHtmlBlock/index.tsx +5 -0
- package/src/RawHtmlBlock/mock.json +113 -24
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +19 -12
- package/src/RenderBlocks/index.tsx +4 -5
- package/src/RenderBlocks/mock.json +0 -73
- package/src/SensitiveBlock/SensitiveBlock.module.css +143 -0
- package/src/SensitiveBlock/SensitiveBlock.stories.module.css +8 -0
- package/src/SensitiveBlock/SensitiveBlock.stories.tsx +40 -0
- package/src/SensitiveBlock/SensitiveBlock.test.tsx +20 -0
- package/src/SensitiveBlock/SensitiveBlock.types.ts +15 -0
- package/src/SensitiveBlock/index.tsx +70 -0
- package/src/SensitiveBlock/mock.json +61 -0
- package/src/Spoiler/index.tsx +2 -1
- package/src/SvgSymbol/SvgSymbol.module.css +1 -1
- package/src/index.tsx +1 -0
- package/src/vars.css +8 -8
package/dist/ui-kit-2.esm.js
CHANGED
|
@@ -1135,7 +1135,7 @@ var DangerousHTML = function DangerousHTML(_ref) {
|
|
|
1135
1135
|
}));
|
|
1136
1136
|
};
|
|
1137
1137
|
|
|
1138
|
-
var styles$i = {"root":"EmbedBlock-module_root__28k9U","object":"EmbedBlock-module_object__2_UZ7","objectWrap":"EmbedBlock-module_objectWrap__1aDVd","
|
|
1138
|
+
var styles$i = {"root":"EmbedBlock-module_root__28k9U","object":"EmbedBlock-module_object__2_UZ7","objectWrap":"EmbedBlock-module_objectWrap__1aDVd","gameEmbed":"EmbedBlock-module_gameEmbed__AZQSo","proportional":"EmbedBlock-module_proportional__3lAv4","default":"EmbedBlock-module_default__LSDny","xs":"EmbedBlock-module_xs__1hFgW","full":"EmbedBlock-module_full__1TEjx","super_full":"EmbedBlock-module_super_full__1Fn9A","figure":"EmbedBlock-module_figure__vAvcN","dark":"EmbedBlock-module_dark__1be2G","isInGroupedBlock":"EmbedBlock-module_isInGroupedBlock__3r_i-","control":"EmbedBlock-module_control__xr8dZ","raw_html":"EmbedBlock-module_raw_html__MQoAA","mobileFullwidth":"EmbedBlock-module_mobileFullwidth__QFFLH","isInCard":"EmbedBlock-module_isInCard__37rtq","isInSlide":"EmbedBlock-module_isInSlide__2ea5q","cc":"EmbedBlock-module_cc__1BQ5g","isInAnswer":"EmbedBlock-module_isInAnswer__tLlgs","picture":"EmbedBlock-module_picture__186q0","wrapper":"EmbedBlock-module_wrapper__33XvX","mobile":"EmbedBlock-module_mobile__1P-eo","desktop":"EmbedBlock-module_desktop__SF5a_"};
|
|
1139
1139
|
|
|
1140
1140
|
var EmbedGif = function EmbedGif(_ref) {
|
|
1141
1141
|
var gif = _ref.gif,
|
|
@@ -1252,7 +1252,7 @@ var EmbedBlock = function EmbedBlock(_ref) {
|
|
|
1252
1252
|
{
|
|
1253
1253
|
return React.createElement("div", {
|
|
1254
1254
|
className: styles$i.figure
|
|
1255
|
-
},
|
|
1255
|
+
}, React.createElement(Image, {
|
|
1256
1256
|
fullscreen: {
|
|
1257
1257
|
desktop: block.data.fullscreen,
|
|
1258
1258
|
mobile: true
|
|
@@ -1672,126 +1672,60 @@ var SourceBlock = function SourceBlock(_ref) {
|
|
|
1672
1672
|
}, origin))));
|
|
1673
1673
|
};
|
|
1674
1674
|
|
|
1675
|
-
var styles$s = {"root":"
|
|
1675
|
+
var styles$s = {"root":"SensitiveBlock-module_root__2iJbD","container":"SensitiveBlock-module_container__1Wtix","overlay":"SensitiveBlock-module_overlay__hfDVS","content":"SensitiveBlock-module_content__sNpxZ","button":"SensitiveBlock-module_button__3BGZK","default":"SensitiveBlock-module_default__2HgmZ","full":"SensitiveBlock-module_full__3Hph9","super_full":"SensitiveBlock-module_super_full__14UOv","visible":"SensitiveBlock-module_visible__1B-NV"};
|
|
1676
1676
|
|
|
1677
|
-
|
|
1678
|
-
var
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
_ref$block$data$cover = _ref$block$data.cover,
|
|
1686
|
-
urls = _ref$block$data$cover.urls,
|
|
1687
|
-
gradients = _ref$block$data$cover.gradients,
|
|
1688
|
-
tag = _ref$block$data$cover.tag,
|
|
1689
|
-
layout = _ref$block$data$cover.layout,
|
|
1690
|
-
ratio = _ref$block$data$cover.ratio,
|
|
1677
|
+
var SensitiveBlock = function SensitiveBlock(_ref) {
|
|
1678
|
+
var block = _ref.block,
|
|
1679
|
+
_ref$block = _ref.block,
|
|
1680
|
+
cc = _ref$block.cc,
|
|
1681
|
+
caption = _ref$block.caption,
|
|
1682
|
+
credit = _ref$block.credit,
|
|
1683
|
+
blurredImage = _ref$block.blurred_image,
|
|
1684
|
+
display = _ref.block.item.data.display,
|
|
1691
1685
|
styleContext = _ref.styleContext;
|
|
1692
|
-
var style = {};
|
|
1693
|
-
var styleHeader = {};
|
|
1694
|
-
|
|
1695
|
-
var _useState = useState('unset'),
|
|
1696
|
-
type = _useState[0],
|
|
1697
|
-
setType = _useState[1];
|
|
1698
|
-
|
|
1699
|
-
var cardType = "is" + toCapitalize(layout);
|
|
1700
|
-
useEffect(function () {
|
|
1701
|
-
setType(Math.random() >= 0.5 ? 'simpleRelated' : 'richRelated');
|
|
1702
|
-
}, []);
|
|
1703
1686
|
|
|
1704
|
-
var
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
}),
|
|
1708
|
-
ref = _useInView[0],
|
|
1709
|
-
inView = _useInView[1];
|
|
1710
|
-
|
|
1711
|
-
useEffect(function () {
|
|
1712
|
-
if (inView) {
|
|
1713
|
-
if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
|
|
1714
|
-
postMessage(type, url, 'view');
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
}, [inView]);
|
|
1687
|
+
var _useState = useState(false),
|
|
1688
|
+
visible = _useState[0],
|
|
1689
|
+
isVisible = _useState[1];
|
|
1718
1690
|
|
|
1719
1691
|
var handleClick = function handleClick() {
|
|
1720
|
-
|
|
1692
|
+
isVisible(true);
|
|
1721
1693
|
};
|
|
1722
1694
|
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
|
|
1733
|
-
var theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
|
|
1734
|
-
classNames = makeStyleContext(classNames, theme, styles$s);
|
|
1735
|
-
|
|
1736
|
-
if (onlyOn === 'desktop') {
|
|
1737
|
-
style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
|
|
1695
|
+
return React.createElement("div", {
|
|
1696
|
+
"data-testid": "sensitive-block",
|
|
1697
|
+
className: makeClassName([[styles$s.root, true], [styles$s.visible, visible], [styles$s[display], display && styles$s[display]]])
|
|
1698
|
+
}, React.createElement("div", {
|
|
1699
|
+
className: styles$s.container
|
|
1700
|
+
}, React.createElement("div", {
|
|
1701
|
+
className: styles$s.overlay,
|
|
1702
|
+
style: {
|
|
1703
|
+
backgroundImage: "url(" + blurredImage + ")"
|
|
1738
1704
|
}
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
return React.createElement("div", {
|
|
1749
|
-
ref: ref,
|
|
1750
|
-
className: styles$s.wrapper
|
|
1751
|
-
}, React.createElement(RelatedBlock, {
|
|
1752
|
-
block: fallback,
|
|
1753
|
-
trackClick: true,
|
|
1754
|
-
styleContext: styleContext
|
|
1755
|
-
}));
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
return React.createElement("a", {
|
|
1759
|
-
"data-testid": "related-rich-block",
|
|
1760
|
-
className: makeClassName(classNames),
|
|
1761
|
-
href: "/" + url,
|
|
1762
|
-
target: "_blank",
|
|
1705
|
+
}, React.createElement("div", {
|
|
1706
|
+
className: styles$s.content
|
|
1707
|
+
}, React.createElement("p", {
|
|
1708
|
+
dangerouslySetInnerHTML: {
|
|
1709
|
+
__html: block.title
|
|
1710
|
+
}
|
|
1711
|
+
}), React.createElement("div", {
|
|
1712
|
+
className: styles$s.button
|
|
1713
|
+
}, React.createElement(Button, {
|
|
1763
1714
|
onClick: function onClick() {
|
|
1764
1715
|
return handleClick();
|
|
1765
1716
|
},
|
|
1766
|
-
|
|
1767
|
-
},
|
|
1768
|
-
className: styles$s.
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
styleContext: "richRelated"
|
|
1779
|
-
}, tag)), React.createElement("div", {
|
|
1780
|
-
className: styles$s.cover
|
|
1781
|
-
}, React.createElement("div", {
|
|
1782
|
-
className: styles$s.picture
|
|
1783
|
-
}, React.createElement(Image, {
|
|
1784
|
-
optimized: urls,
|
|
1785
|
-
ratio: ratio,
|
|
1786
|
-
display: "narrow"
|
|
1787
|
-
}))), React.createElement("div", {
|
|
1788
|
-
className: styles$s.body
|
|
1789
|
-
}, blocks.map(function (item) {
|
|
1790
|
-
return React.createElement(RenderBlocks, {
|
|
1791
|
-
key: item.id,
|
|
1792
|
-
block: item,
|
|
1793
|
-
styleContext: context
|
|
1794
|
-
});
|
|
1717
|
+
theme: "light"
|
|
1718
|
+
}, block.button.text)))), React.createElement("div", {
|
|
1719
|
+
className: styles$s.media
|
|
1720
|
+
}, React.createElement(EmbedBlockContainer, {
|
|
1721
|
+
block: block.item,
|
|
1722
|
+
styleContext: ['isInSensitiveBlock']
|
|
1723
|
+
}))), cc && React.createElement("figcaption", {
|
|
1724
|
+
className: styles$s.figcaption
|
|
1725
|
+
}, React.createElement(MediaCaption, {
|
|
1726
|
+
credit: credit,
|
|
1727
|
+
caption: caption,
|
|
1728
|
+
styleContext: styleContext
|
|
1795
1729
|
})));
|
|
1796
1730
|
};
|
|
1797
1731
|
|
|
@@ -1802,10 +1736,12 @@ var GroupedBlock = function GroupedBlock(_ref) {
|
|
|
1802
1736
|
onlyOn = _ref.block.only_on,
|
|
1803
1737
|
styleContext = _ref.styleContext;
|
|
1804
1738
|
var maxHeight = Math.min.apply(Math, block.data.map(function (item) {
|
|
1805
|
-
return item.data.height;
|
|
1739
|
+
return item.data && item.data.height || item.item.data.height;
|
|
1806
1740
|
}));
|
|
1807
1741
|
var normalizedBoxesWidth = block.data.map(function (item) {
|
|
1808
|
-
|
|
1742
|
+
var width = item.data && item.data.width || item.item.data.heigh;
|
|
1743
|
+
var height = item.data && item.data.height || item.item.data.heigh;
|
|
1744
|
+
return width / (height / maxHeight);
|
|
1809
1745
|
});
|
|
1810
1746
|
var sumWidth = normalizedBoxesWidth.reduce(function (sum, x) {
|
|
1811
1747
|
return sum + x;
|
|
@@ -1829,7 +1765,10 @@ var GroupedBlock = function GroupedBlock(_ref) {
|
|
|
1829
1765
|
style: {
|
|
1830
1766
|
width: percentWidth + "%"
|
|
1831
1767
|
}
|
|
1832
|
-
}, React.createElement(
|
|
1768
|
+
}, item.type === 'sensitive' ? React.createElement(SensitiveBlock, {
|
|
1769
|
+
block: item,
|
|
1770
|
+
styleContext: ['isInGroupedBlock']
|
|
1771
|
+
}) : React.createElement(EmbedBlockContainer, {
|
|
1833
1772
|
block: item,
|
|
1834
1773
|
styleContext: ['isInGroupedBlock']
|
|
1835
1774
|
}));
|
|
@@ -2143,14 +2082,6 @@ var RenderBlocks = function RenderBlocks(_ref) {
|
|
|
2143
2082
|
});
|
|
2144
2083
|
}
|
|
2145
2084
|
|
|
2146
|
-
case 'related_rich':
|
|
2147
|
-
{
|
|
2148
|
-
return React.createElement(RelatedRichBlock, {
|
|
2149
|
-
block: block,
|
|
2150
|
-
styleContext: styleContext
|
|
2151
|
-
});
|
|
2152
|
-
}
|
|
2153
|
-
|
|
2154
2085
|
case 'chapter-subtitle':
|
|
2155
2086
|
{
|
|
2156
2087
|
return React.createElement(ChapterBlock, {
|
|
@@ -2187,6 +2118,12 @@ var RenderBlocks = function RenderBlocks(_ref) {
|
|
|
2187
2118
|
styleContext: styleContext
|
|
2188
2119
|
});
|
|
2189
2120
|
|
|
2121
|
+
case 'sensitive':
|
|
2122
|
+
return React.createElement(SensitiveBlock, {
|
|
2123
|
+
block: block,
|
|
2124
|
+
styleContext: styleContext
|
|
2125
|
+
});
|
|
2126
|
+
|
|
2190
2127
|
case 'embed':
|
|
2191
2128
|
case 'embed_code':
|
|
2192
2129
|
case 'game_embed':
|
|
@@ -2398,7 +2335,7 @@ var Spoiler = function Spoiler(_ref) {
|
|
|
2398
2335
|
};
|
|
2399
2336
|
|
|
2400
2337
|
var classNames = [[styles$A.root, true], [styles$A[onlyOn], !!onlyOn], [styles$A[display], !!display && styles$A[display]], [[styles$A.spoiled], !!spoiled]];
|
|
2401
|
-
var context = ['center']
|
|
2338
|
+
var context = ['center'];
|
|
2402
2339
|
|
|
2403
2340
|
if (styleContext) {
|
|
2404
2341
|
classNames = makeStyleContext(classNames, styleContext, styles$A);
|
|
@@ -2434,6 +2371,129 @@ var Spoiler = function Spoiler(_ref) {
|
|
|
2434
2371
|
}))));
|
|
2435
2372
|
};
|
|
2436
2373
|
|
|
2374
|
+
var styles$B = {"root":"RelatedRichBlock-module_root__3NYmj","wrapper":"RelatedRichBlock-module_wrapper__1eLIQ","overlay":"RelatedRichBlock-module_overlay__3XSg_","overlayHeader":"RelatedRichBlock-module_overlayHeader__2Nmbv","body":"RelatedRichBlock-module_body__1ZHZS","isRich":"RelatedRichBlock-module_isRich__1LnA4","hasGradient":"RelatedRichBlock-module_hasGradient__27LOk","picture":"RelatedRichBlock-module_picture__128HJ","isCard":"RelatedRichBlock-module_isCard__2naDz","cover":"RelatedRichBlock-module_cover__3yygp","tag":"RelatedRichBlock-module_tag__3OLyG","center":"RelatedRichBlock-module_center__197sx","dark":"RelatedRichBlock-module_dark__3Y1fE","light":"RelatedRichBlock-module_light__2mUxL","mobile":"RelatedRichBlock-module_mobile__JpCS4","desktop":"RelatedRichBlock-module_desktop__trL0D"};
|
|
2375
|
+
|
|
2376
|
+
/* eslint-disable react/jsx-no-target-blank */
|
|
2377
|
+
var RelatedRichBlock = function RelatedRichBlock(_ref) {
|
|
2378
|
+
var _ref$block = _ref.block,
|
|
2379
|
+
onlyOn = _ref$block.only_on,
|
|
2380
|
+
_ref$block$data = _ref$block.data,
|
|
2381
|
+
blocks = _ref$block$data.blocks,
|
|
2382
|
+
fallback = _ref$block$data.fallback,
|
|
2383
|
+
url = _ref$block$data.url,
|
|
2384
|
+
_ref$block$data$cover = _ref$block$data.cover,
|
|
2385
|
+
urls = _ref$block$data$cover.urls,
|
|
2386
|
+
gradients = _ref$block$data$cover.gradients,
|
|
2387
|
+
tag = _ref$block$data$cover.tag,
|
|
2388
|
+
layout = _ref$block$data$cover.layout,
|
|
2389
|
+
ratio = _ref$block$data$cover.ratio,
|
|
2390
|
+
styleContext = _ref.styleContext;
|
|
2391
|
+
var style = {};
|
|
2392
|
+
var styleHeader = {};
|
|
2393
|
+
|
|
2394
|
+
var _useState = useState('unset'),
|
|
2395
|
+
type = _useState[0],
|
|
2396
|
+
setType = _useState[1];
|
|
2397
|
+
|
|
2398
|
+
var cardType = "is" + toCapitalize(layout);
|
|
2399
|
+
useEffect(function () {
|
|
2400
|
+
setType(Math.random() >= 0.5 ? 'simpleRelated' : 'richRelated');
|
|
2401
|
+
}, []);
|
|
2402
|
+
|
|
2403
|
+
var _useInView = useInView({
|
|
2404
|
+
threshold: 0,
|
|
2405
|
+
triggerOnce: true
|
|
2406
|
+
}),
|
|
2407
|
+
ref = _useInView[0],
|
|
2408
|
+
inView = _useInView[1];
|
|
2409
|
+
|
|
2410
|
+
useEffect(function () {
|
|
2411
|
+
if (inView) {
|
|
2412
|
+
if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
|
|
2413
|
+
postMessage(type, url, 'view');
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
}, [inView]);
|
|
2417
|
+
|
|
2418
|
+
var handleClick = function handleClick() {
|
|
2419
|
+
postMessage(type, url, 'click');
|
|
2420
|
+
};
|
|
2421
|
+
|
|
2422
|
+
var classNames = [[styles$B.root, true], [styles$B[cardType], !!layout && !!styles$B[cardType]], [styles$B.hasGradient, !!gradients], [styles$B[onlyOn], !!onlyOn && !!styles$B[onlyOn]]];
|
|
2423
|
+
var context = ['isInMediaBlock'];
|
|
2424
|
+
|
|
2425
|
+
if (styleContext) {
|
|
2426
|
+
classNames = makeStyleContext(classNames, styleContext, styles$B);
|
|
2427
|
+
context = [].concat(styleContext, ['isInMediaBlock']);
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
if (gradients) {
|
|
2431
|
+
styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
|
|
2432
|
+
var theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
|
|
2433
|
+
classNames = makeStyleContext(classNames, theme, styles$B);
|
|
2434
|
+
|
|
2435
|
+
if (onlyOn === 'desktop') {
|
|
2436
|
+
style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2440
|
+
if (type === 'unset') {
|
|
2441
|
+
return React.createElement("div", {
|
|
2442
|
+
className: styles$B.wrapper
|
|
2443
|
+
});
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
if (type === 'simpleRelated') {
|
|
2447
|
+
return React.createElement("div", {
|
|
2448
|
+
ref: ref,
|
|
2449
|
+
className: styles$B.wrapper
|
|
2450
|
+
}, React.createElement(RelatedBlock, {
|
|
2451
|
+
block: fallback,
|
|
2452
|
+
trackClick: true,
|
|
2453
|
+
styleContext: styleContext
|
|
2454
|
+
}));
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
return React.createElement("a", {
|
|
2458
|
+
"data-testid": "related-rich-block",
|
|
2459
|
+
className: makeClassName(classNames),
|
|
2460
|
+
href: "/" + url,
|
|
2461
|
+
target: "_blank",
|
|
2462
|
+
onClick: function onClick() {
|
|
2463
|
+
return handleClick();
|
|
2464
|
+
},
|
|
2465
|
+
ref: ref
|
|
2466
|
+
}, layout === 'rich' && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
2467
|
+
className: styles$B.overlay,
|
|
2468
|
+
style: style
|
|
2469
|
+
}), React.createElement("div", {
|
|
2470
|
+
className: styles$B.overlayHeader,
|
|
2471
|
+
style: styleHeader
|
|
2472
|
+
})), React.createElement("div", {
|
|
2473
|
+
className: styles$B.tag
|
|
2474
|
+
}, React.createElement(Tag, {
|
|
2475
|
+
size: "small",
|
|
2476
|
+
theme: "inherit",
|
|
2477
|
+
styleContext: "richRelated"
|
|
2478
|
+
}, tag)), React.createElement("div", {
|
|
2479
|
+
className: styles$B.cover
|
|
2480
|
+
}, React.createElement("div", {
|
|
2481
|
+
className: styles$B.picture
|
|
2482
|
+
}, React.createElement(Image, {
|
|
2483
|
+
optimized: urls,
|
|
2484
|
+
ratio: ratio,
|
|
2485
|
+
display: "narrow"
|
|
2486
|
+
}))), React.createElement("div", {
|
|
2487
|
+
className: styles$B.body
|
|
2488
|
+
}, blocks.map(function (item) {
|
|
2489
|
+
return React.createElement(RenderBlocks, {
|
|
2490
|
+
key: item.id,
|
|
2491
|
+
block: item,
|
|
2492
|
+
styleContext: context
|
|
2493
|
+
});
|
|
2494
|
+
})));
|
|
2495
|
+
};
|
|
2496
|
+
|
|
2437
2497
|
var RawHtmlBlock = function RawHtmlBlock(_ref) {
|
|
2438
2498
|
var block = _ref.block,
|
|
2439
2499
|
styleContext = _ref.styleContext,
|
|
@@ -2481,6 +2541,14 @@ var RawHtmlBlock = function RawHtmlBlock(_ref) {
|
|
|
2481
2541
|
});
|
|
2482
2542
|
}
|
|
2483
2543
|
|
|
2544
|
+
case 'related_rich':
|
|
2545
|
+
{
|
|
2546
|
+
return React.createElement(RelatedRichBlock, {
|
|
2547
|
+
block: block,
|
|
2548
|
+
styleContext: styleContext
|
|
2549
|
+
});
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2484
2552
|
default:
|
|
2485
2553
|
{
|
|
2486
2554
|
return React.createElement(BlockProvider, {
|
|
@@ -2497,7 +2565,7 @@ var RawHtmlBlock = function RawHtmlBlock(_ref) {
|
|
|
2497
2565
|
}
|
|
2498
2566
|
};
|
|
2499
2567
|
|
|
2500
|
-
var styles$
|
|
2568
|
+
var styles$C = {"root":"ToolbarButton-module_root__xN-fq","dark":"ToolbarButton-module_dark__GrIOr","bookmark":"ToolbarButton-module_bookmark__3369b","isActive":"ToolbarButton-module_isActive__3NLAE","text":"ToolbarButton-module_text__32m6s"};
|
|
2501
2569
|
|
|
2502
2570
|
var ToolbarButton = function ToolbarButton(_ref) {
|
|
2503
2571
|
var children = _ref.children,
|
|
@@ -2505,7 +2573,7 @@ var ToolbarButton = function ToolbarButton(_ref) {
|
|
|
2505
2573
|
theme = _ref.theme,
|
|
2506
2574
|
isActive = _ref.isActive,
|
|
2507
2575
|
_onClick = _ref.onClick;
|
|
2508
|
-
var classNames = [[styles$
|
|
2576
|
+
var classNames = [[styles$C.root, true], [styles$C[type], !!styles$C[type]], [styles$C[theme], !!styles$C[theme] && !!theme], [styles$C.isActive, !!isActive]];
|
|
2509
2577
|
return React.createElement("button", {
|
|
2510
2578
|
"data-testid": "toolbar-button",
|
|
2511
2579
|
className: makeClassName(classNames),
|
|
@@ -2518,9 +2586,9 @@ var ToolbarButton = function ToolbarButton(_ref) {
|
|
|
2518
2586
|
icon: type,
|
|
2519
2587
|
styleContext: "isInToolbar"
|
|
2520
2588
|
}), children && React.createElement("span", {
|
|
2521
|
-
className: styles$
|
|
2589
|
+
className: styles$C.text
|
|
2522
2590
|
}, children));
|
|
2523
2591
|
};
|
|
2524
2592
|
|
|
2525
|
-
export { BookmarkButton, Button, CardTitle, ChapterBlock, Cover, DocumentItemsCount, DotsOnImage, Dropdown, EmbedBlockContainer, Footnote, GroupedBlock, HalfBlock, Image, ImportantLead, Lazy, ListBlock, MaterialNote, MaterialTitle, MediaCaption, Menu, Meta, MetaItem, MetaItemLive, Popover, Primary, QuoteBlock, RawHtmlBlock, RelatedBlock, RelatedRichBlock, RenderBlocks, RichTitle, Secondary, SimpleBlock, SimpleTitle, SourceBlock, Spoiler, SvgSymbol, Switcher, Table, Tag, Timestamp, Toolbar, ToolbarButton };
|
|
2593
|
+
export { BookmarkButton, Button, CardTitle, ChapterBlock, Cover, DocumentItemsCount, DotsOnImage, Dropdown, EmbedBlockContainer, Footnote, GroupedBlock, HalfBlock, Image, ImportantLead, Lazy, ListBlock, MaterialNote, MaterialTitle, MediaCaption, Menu, Meta, MetaItem, MetaItemLive, Popover, Primary, QuoteBlock, RawHtmlBlock, RelatedBlock, RelatedRichBlock, RenderBlocks, RichTitle, Secondary, SensitiveBlock, SimpleBlock, SimpleTitle, SourceBlock, Spoiler, SvgSymbol, Switcher, Table, Tag, Timestamp, Toolbar, ToolbarButton };
|
|
2526
2594
|
//# sourceMappingURL=ui-kit-2.esm.js.map
|