@meduza/ui-kit-2 0.1.7 → 0.1.8
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/MaterialTitle/MaterialTitle.types.d.ts +2 -2
- package/dist/Popover/Popover.types.d.ts +2 -2
- package/dist/Tag/Tag.types.d.ts +2 -2
- package/dist/ui-kit-2.cjs.development.js +31 -28
- 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 +31 -28
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +479 -479
- package/dist/utils/DangerousHtml.d.ts +3 -3
- package/package.json +1 -1
- package/src/ChapterBlock/index.tsx +3 -6
- package/src/DocumentItemsCount/DocumentItemsCount.stories.tsx +1 -1
- package/src/GroupedBlock/GroupedBlock.stories.tsx +1 -1
- package/src/GroupedBlock/GroupedBlock.types.ts +1 -1
- package/src/HalfBlock/HalfBlock.types.ts +1 -1
- package/src/Image/index.tsx +0 -2
- package/src/ListBlock/ListBlock.stories.tsx +1 -1
- package/src/ListBlock/index.tsx +1 -2
- package/src/MaterialTitle/MaterialTitle.types.ts +2 -1
- package/src/MediaCaption/MediaCaption.types.ts +2 -2
- package/src/Meta/Meta.stories.tsx +1 -1
- package/src/Popover/Popover.types.ts +2 -1
- package/src/SimpleBlock/index.tsx +6 -8
- package/src/SourceBlock/index.tsx +1 -2
- package/src/SvgSymbol/SvgSymbol.stories.tsx +1 -1
- package/src/Tag/Tag.types.ts +3 -1
- package/src/Toolbar/Toolbar.stories.tsx +0 -1
- package/src/utils/DangerousHtml.tsx +23 -13
package/dist/Tag/Tag.types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare type TagSizes = 'small' | 'large';
|
|
3
3
|
export declare type TagThemes = 'dark' | 'gold' | 'gray' | 'light' | 'inherit';
|
|
4
4
|
export declare type TagStyleContexts = 'isInToolbar' | 'isInSpoiler' | 'isInDropdown';
|
|
5
5
|
export interface TagProps {
|
|
6
|
-
children: JSX.Element[] | JSX.Element;
|
|
6
|
+
children: React.ReactNode | JSX.Element[] | JSX.Element;
|
|
7
7
|
styleContext?: string | string[];
|
|
8
8
|
theme: TagThemes;
|
|
9
9
|
size: TagSizes;
|
|
@@ -439,8 +439,6 @@ var Image = function Image(_ref) {
|
|
|
439
439
|
var _useContext = React.useContext(BlockContext),
|
|
440
440
|
lightBox = _useContext.lightBox;
|
|
441
441
|
|
|
442
|
-
console.log(React.useContext(BlockContext));
|
|
443
|
-
|
|
444
442
|
var handleClick = function handleClick() {
|
|
445
443
|
var _viewportSize = viewportSize(),
|
|
446
444
|
viewportWidth = _viewportSize.width;
|
|
@@ -1005,21 +1003,20 @@ var DangerousHTML = function DangerousHTML(_ref) {
|
|
|
1005
1003
|
});
|
|
1006
1004
|
}, []);
|
|
1007
1005
|
React.useEffect(function () {
|
|
1008
|
-
if (canRenderHtml && html.indexOf('script') > -1 && element.current) {
|
|
1009
|
-
element.current.innerHTML = html;
|
|
1010
|
-
replaceScriptElementsRecursive(element.current);
|
|
1006
|
+
if (canRenderHtml && html.indexOf('script') > -1 && element.current.firstChild) {
|
|
1007
|
+
element.current.firstElementChild.innerHTML = html;
|
|
1008
|
+
replaceScriptElementsRecursive(element.current.firstChild);
|
|
1011
1009
|
prepareAnchors();
|
|
1012
1010
|
}
|
|
1013
|
-
}, [canRenderHtml, element, html]);
|
|
1014
|
-
return React__default.createElement(
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
ref: element,
|
|
1011
|
+
}, [canRenderHtml, element, html, replaceScriptElementsRecursive, prepareAnchors]);
|
|
1012
|
+
return React__default.createElement("div", {
|
|
1013
|
+
ref: element
|
|
1014
|
+
}, React__default.createElement(TagName, {
|
|
1018
1015
|
className: className,
|
|
1019
1016
|
dangerouslySetInnerHTML: {
|
|
1020
1017
|
__html: html
|
|
1021
1018
|
}
|
|
1022
|
-
});
|
|
1019
|
+
}));
|
|
1023
1020
|
};
|
|
1024
1021
|
|
|
1025
1022
|
var styles$h = {"root":"EmbedBlock-module_root__28k9U","object":"EmbedBlock-module_object__2_UZ7","objectWrap":"EmbedBlock-module_objectWrap__1aDVd","proportional":"EmbedBlock-module_proportional__3lAv4","attachment":"EmbedBlock-module_attachment__2pE0t","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-","gameEmbed":"EmbedBlock-module_gameEmbed__AZQSo","mobile":"EmbedBlock-module_mobile__1P-eo","desktop":"EmbedBlock-module_desktop__SF5a_","control":"EmbedBlock-module_control__xr8dZ","raw_html":"EmbedBlock-module_raw_html__MQoAA","mobileFullwidth":"EmbedBlock-module_mobileFullwidth__QFFLH","card":"EmbedBlock-module_card__KTbvp","slide":"EmbedBlock-module_slide__3cL3M","cc":"EmbedBlock-module_cc__1BQ5g","isInAnswer":"EmbedBlock-module_isInAnswer__tLlgs","picture":"EmbedBlock-module_picture__186q0","wrapper":"EmbedBlock-module_wrapper__33XvX"};
|
|
@@ -1333,15 +1330,18 @@ var CardTitle = function CardTitle(_ref) {
|
|
|
1333
1330
|
var styles$k = {"root":"ChapterBlock-module_root__1WyVn","subtitle":"ChapterBlock-module_subtitle__3TXll","mobile":"ChapterBlock-module_mobile__CiO0w","desktop":"ChapterBlock-module_desktop__tk1Nk"};
|
|
1334
1331
|
|
|
1335
1332
|
var ChapterBlock = function ChapterBlock(_ref) {
|
|
1336
|
-
var block = _ref.block,
|
|
1337
|
-
|
|
1333
|
+
var _ref$block = _ref.block,
|
|
1334
|
+
data = _ref$block.data,
|
|
1335
|
+
onlyOn = _ref$block.only_on,
|
|
1338
1336
|
styleContext = _ref.styleContext;
|
|
1339
1337
|
return React__default.createElement("div", {
|
|
1340
1338
|
"data-testid": "chapter-block",
|
|
1341
1339
|
className: makeClassName([[styles$k.root, true], [styles$k[onlyOn], !!onlyOn]])
|
|
1342
|
-
}, React__default.createElement(
|
|
1340
|
+
}, React__default.createElement("div", {
|
|
1343
1341
|
className: makeClassName([[styles$k.subtitle, true], [styles$k[styleContext], !!styleContext && !!styles$k[styleContext]]]),
|
|
1344
|
-
|
|
1342
|
+
dangerouslySetInnerHTML: {
|
|
1343
|
+
__html: data
|
|
1344
|
+
}
|
|
1345
1345
|
}));
|
|
1346
1346
|
};
|
|
1347
1347
|
|
|
@@ -1404,7 +1404,7 @@ var SimpleBlock = function SimpleBlock(_ref) {
|
|
|
1404
1404
|
type = _ref$block.type,
|
|
1405
1405
|
onlyOn = _ref$block.only_on,
|
|
1406
1406
|
styleContext = _ref.styleContext;
|
|
1407
|
-
var
|
|
1407
|
+
var TagName;
|
|
1408
1408
|
var classNames = [[styles$o[type], !!type && !!styles$o[type]], [styles$o[onlyOn], true]];
|
|
1409
1409
|
|
|
1410
1410
|
if (styleContext) {
|
|
@@ -1417,24 +1417,25 @@ var SimpleBlock = function SimpleBlock(_ref) {
|
|
|
1417
1417
|
case 'note_caption':
|
|
1418
1418
|
case 'note_credit':
|
|
1419
1419
|
{
|
|
1420
|
-
|
|
1420
|
+
TagName = 'p';
|
|
1421
1421
|
break;
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
1424
1424
|
case 'lead_hr':
|
|
1425
1425
|
{
|
|
1426
|
-
|
|
1426
|
+
TagName = 'div';
|
|
1427
1427
|
break;
|
|
1428
1428
|
}
|
|
1429
1429
|
|
|
1430
1430
|
default:
|
|
1431
|
-
|
|
1431
|
+
TagName = type;
|
|
1432
1432
|
}
|
|
1433
1433
|
|
|
1434
|
-
return React__default.createElement(
|
|
1434
|
+
return React__default.createElement(TagName, {
|
|
1435
1435
|
className: makeClassName(classNames),
|
|
1436
|
-
|
|
1437
|
-
|
|
1436
|
+
dangerouslySetInnerHTML: {
|
|
1437
|
+
__html: data
|
|
1438
|
+
}
|
|
1438
1439
|
});
|
|
1439
1440
|
};
|
|
1440
1441
|
|
|
@@ -1456,10 +1457,11 @@ var ListBlock = function ListBlock(_ref) {
|
|
|
1456
1457
|
return React__default.createElement(TagName, {
|
|
1457
1458
|
className: makeClassName(classNames)
|
|
1458
1459
|
}, data.map(function (item, index) {
|
|
1459
|
-
return React__default.createElement(
|
|
1460
|
+
return React__default.createElement("li", {
|
|
1460
1461
|
key: index,
|
|
1461
|
-
|
|
1462
|
-
|
|
1462
|
+
dangerouslySetInnerHTML: {
|
|
1463
|
+
__html: item
|
|
1464
|
+
}
|
|
1463
1465
|
});
|
|
1464
1466
|
}));
|
|
1465
1467
|
};
|
|
@@ -1525,10 +1527,11 @@ var SourceBlock = function SourceBlock(_ref) {
|
|
|
1525
1527
|
target: "_blank",
|
|
1526
1528
|
rel: "noopener noreferrer"
|
|
1527
1529
|
}, quote.map(function (item, index) {
|
|
1528
|
-
return React__default.createElement(
|
|
1530
|
+
return React__default.createElement("p", {
|
|
1529
1531
|
key: index,
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
+
dangerouslySetInnerHTML: {
|
|
1533
|
+
__html: item.data
|
|
1534
|
+
}
|
|
1532
1535
|
});
|
|
1533
1536
|
}), React__default.createElement("footer", null, React__default.createElement("cite", {
|
|
1534
1537
|
className: styles$r.origin
|