@meduza/ui-kit-2 1.4.11 → 1.4.12-analytics.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/dist/RelatedCarousel/RelatedCarousel.types.d.ts +1 -0
- package/dist/ui-kit-2.cjs.development.js +38 -10
- 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 +38 -10
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit-game.css +105 -99
- package/dist/ui-kit.css +105 -99
- package/package.json +1 -1
- package/src/Button/Button.module.css +5 -5
- package/src/CardTitle/CardTitle.module.css +1 -1
- package/src/ChapterBlock/ChapterBlock.module.css +1 -1
- package/src/Dropdown/Dropdown.module.css +4 -4
- package/src/EmbedBlock/EmbedBlock.module.css +1 -1
- package/src/Footnote/Footnote.module.css +3 -3
- package/src/HalfBlock/HalfBlock.module.css +1 -1
- package/src/Image/Image.module.css +1 -1
- package/src/ImportantLead/ImportantLead.module.css +4 -4
- package/src/ListBlock/ListBlock.module.css +1 -1
- package/src/ListViewSwitcher/ListViewSwitcher.module.css +2 -2
- package/src/MaterialNote/MaterialNote.module.css +2 -2
- package/src/MediaCaption/MediaCaption.module.css +2 -2
- package/src/Meta/Meta.module.css +3 -3
- package/src/Popover/Popover.module.css +4 -0
- package/src/QuoteBlock/QuoteBlock.module.css +1 -1
- package/src/RelatedBlock/RelatedBlock.module.css +6 -6
- package/src/RelatedBlock/index.tsx +24 -9
- package/src/RelatedBook/RelatedBook.module.css +4 -4
- package/src/RelatedBook/index.tsx +9 -0
- package/src/RelatedCarousel/RelatedCarousel.module.css +2 -2
- package/src/RelatedCarousel/RelatedCarousel.types.ts +1 -0
- package/src/RelatedCarousel/index.tsx +6 -2
- package/src/RelatedRichBlock/RelatedRichBlock.module.css +5 -5
- package/src/RelatedRichBlock/index.tsx +9 -0
- package/src/ShopRelatedBlock/ShopRelatedBlock.module.css +4 -4
- package/src/SimpleBlock/FootnoteLink.css +9 -7
- package/src/SimpleBlock/SimpleBlock.module.css +8 -8
- package/src/SourceBlock/SourceBlock.module.css +6 -6
- package/src/Spoiler/Spoiler.module.css +4 -4
- package/src/Switcher/Switcher.module.css +2 -2
- package/src/Table/Table.module.css +10 -10
- package/src/Tag/Tag.module.css +2 -2
- package/src/Toolbar/Toolbar.module.css +5 -5
- package/src/ToolbarButton/ToolbarButton.module.css +1 -1
- package/src/VersesBlock/VersesBlock.module.css +1 -1
|
@@ -1536,6 +1536,11 @@ const ListBlock = ({
|
|
|
1536
1536
|
|
|
1537
1537
|
var styles$k = {"root":"RelatedBlock-module_root__cr1c-","header":"RelatedBlock-module_header__bfUJD","items":"RelatedBlock-module_items__rzzam","rich":"RelatedBlock-module_rich__1cWdn","first":"RelatedBlock-module_first__ZkcP5","simple":"RelatedBlock-module_simple__m22bj","center":"RelatedBlock-module_center__WVpIJ","isInSlideMaterial":"RelatedBlock-module_isInSlideMaterial__VumDw","mobile":"RelatedBlock-module_mobile__AScBA","desktop":"RelatedBlock-module_desktop__uMXUY"};
|
|
1538
1538
|
|
|
1539
|
+
const handleClick = (event, to) => {
|
|
1540
|
+
if (event.button <= 1) {
|
|
1541
|
+
postMessage('related', to, 'click');
|
|
1542
|
+
}
|
|
1543
|
+
};
|
|
1539
1544
|
const RelatedBlock = ({
|
|
1540
1545
|
block: {
|
|
1541
1546
|
data: {
|
|
@@ -1557,14 +1562,19 @@ const RelatedBlock = ({
|
|
|
1557
1562
|
className: styles$k.header
|
|
1558
1563
|
}, title), /*#__PURE__*/React.createElement("ul", {
|
|
1559
1564
|
className: styles$k.items
|
|
1560
|
-
}, related.map((item, index) =>
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1565
|
+
}, related.map((item, index) => {
|
|
1566
|
+
const to = item.full_url || `/${item.url}`;
|
|
1567
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
1568
|
+
key: item.id || index,
|
|
1569
|
+
className: styles$k[item.layout]
|
|
1570
|
+
}, /*#__PURE__*/React.createElement(reactRouterDom.Link, {
|
|
1571
|
+
to: to,
|
|
1572
|
+
onClick: event => handleClick(event, to),
|
|
1573
|
+
onAuxClick: event => handleClick(event, to)
|
|
1574
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
1575
|
+
className: styles$k.first
|
|
1576
|
+
}, item.title), item.second_title && ' ', item.second_title && /*#__PURE__*/React.createElement("span", null, item.second_title)));
|
|
1577
|
+
})));
|
|
1568
1578
|
};
|
|
1569
1579
|
|
|
1570
1580
|
var styles$j = {"root":"SourceBlock-module_root__9dnI4","text":"SourceBlock-module_text__M5-uy","origin":"SourceBlock-module_origin__fyvxH","center":"SourceBlock-module_center__UOMwy","mobile":"SourceBlock-module_mobile__QVEyg","desktop":"SourceBlock-module_desktop__xdXWm","isDark":"SourceBlock-module_isDark__etwk1"};
|
|
@@ -2423,10 +2433,17 @@ const RelatedRichBlock = ({
|
|
|
2423
2433
|
classNames = makeStyleContext(classNames, styleContext, styles$6);
|
|
2424
2434
|
context = [...styleContext, 'isInMediaBlock', 'richRelated'];
|
|
2425
2435
|
}
|
|
2436
|
+
const handleClick = event => {
|
|
2437
|
+
if (event.button <= 1) {
|
|
2438
|
+
postMessage('related', `/${url}`, 'click');
|
|
2439
|
+
}
|
|
2440
|
+
};
|
|
2426
2441
|
return /*#__PURE__*/React.createElement(reactRouterDom.Link, {
|
|
2427
2442
|
"data-testid": "related-rich-block",
|
|
2428
2443
|
className: makeClassName(classNames),
|
|
2429
|
-
to: `/${url}
|
|
2444
|
+
to: `/${url}`,
|
|
2445
|
+
onClick: handleClick,
|
|
2446
|
+
onAuxClick: handleClick
|
|
2430
2447
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2431
2448
|
className: styles$6.tag
|
|
2432
2449
|
}, /*#__PURE__*/React.createElement(Tag, {
|
|
@@ -2550,8 +2567,15 @@ const RelatedBook = ({
|
|
|
2550
2567
|
const cssProps = {
|
|
2551
2568
|
'--bgColor': `rgb(${block.data.theme.background_color || '0, 0, 0'})`
|
|
2552
2569
|
};
|
|
2570
|
+
const handleClick = event => {
|
|
2571
|
+
if (event.button <= 1) {
|
|
2572
|
+
postMessage('related', `/${block.data.url}`, 'click');
|
|
2573
|
+
}
|
|
2574
|
+
};
|
|
2553
2575
|
return /*#__PURE__*/React.createElement(reactRouterDom.Link, {
|
|
2554
2576
|
to: `/${block.data.url}`,
|
|
2577
|
+
onClick: handleClick,
|
|
2578
|
+
onAuxClick: handleClick,
|
|
2555
2579
|
className: makeClassName(classNames),
|
|
2556
2580
|
style: cssProps
|
|
2557
2581
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -2715,7 +2739,8 @@ const getDotScale = (index, start, total) => {
|
|
|
2715
2739
|
};
|
|
2716
2740
|
const RelatedCarousel = ({
|
|
2717
2741
|
children,
|
|
2718
|
-
ariaLabel
|
|
2742
|
+
ariaLabel,
|
|
2743
|
+
onSlideChange
|
|
2719
2744
|
}) => {
|
|
2720
2745
|
const [viewportRef, embla] = useEmblaCarousel({
|
|
2721
2746
|
loop: true,
|
|
@@ -2723,6 +2748,8 @@ const RelatedCarousel = ({
|
|
|
2723
2748
|
containScroll: false
|
|
2724
2749
|
});
|
|
2725
2750
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
2751
|
+
const onSlideChangeRef = React.useRef(onSlideChange);
|
|
2752
|
+
onSlideChangeRef.current = onSlideChange;
|
|
2726
2753
|
const [dotsStart, setDotsStart] = React.useState(0);
|
|
2727
2754
|
const slides = React.Children.toArray(children);
|
|
2728
2755
|
const total = slides.length;
|
|
@@ -2732,6 +2759,7 @@ const RelatedCarousel = ({
|
|
|
2732
2759
|
}
|
|
2733
2760
|
const index = embla.selectedScrollSnap();
|
|
2734
2761
|
setActiveIndex(index);
|
|
2762
|
+
onSlideChangeRef.current?.(index);
|
|
2735
2763
|
setDotsStart(start => getDotsStart(index, start, total));
|
|
2736
2764
|
}, [embla, total]);
|
|
2737
2765
|
React.useEffect(() => {
|