@meduza/ui-kit-2 0.1.41 → 0.1.42
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/Image/Image.types.d.ts +1 -0
- package/dist/ui-kit-2.cjs.development.js +21 -13
- 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 +21 -13
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1315 -1312
- package/package.json +1 -1
- package/src/EmbedBlock/EmbedBlock.tsx +1 -0
- package/src/Image/Image.module.css +5 -1
- package/src/Image/Image.types.ts +1 -0
- package/src/Image/index.tsx +15 -7
package/dist/ui-kit-2.esm.js
CHANGED
|
@@ -282,6 +282,15 @@ var Switcher = function Switcher(_ref) {
|
|
|
282
282
|
}, children));
|
|
283
283
|
};
|
|
284
284
|
|
|
285
|
+
var makeStyleContext = function makeStyleContext(classNames, styleContext, styles) {
|
|
286
|
+
var context = Array.isArray(styleContext) ? styleContext.filter(function (ctx) {
|
|
287
|
+
return styles[ctx];
|
|
288
|
+
}).map(function (ctx) {
|
|
289
|
+
return [[styles[ctx]], true];
|
|
290
|
+
}) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
|
|
291
|
+
return classNames.concat(context);
|
|
292
|
+
};
|
|
293
|
+
|
|
285
294
|
var BlockContext = /*#__PURE__*/React.createContext({
|
|
286
295
|
lightBox: null
|
|
287
296
|
});
|
|
@@ -424,7 +433,7 @@ var RenderPicture = function RenderPicture(_ref) {
|
|
|
424
433
|
}));
|
|
425
434
|
};
|
|
426
435
|
|
|
427
|
-
var styles$4 = {"root":"Image-module_root__1vsA_","isLoaded":"Image-module_isLoaded__3XhU5","wrapper":"Image-module_wrapper__3fLjs","fullscreen":"Image-module_fullscreen__29apx"};
|
|
436
|
+
var styles$4 = {"root":"Image-module_root__1vsA_","isLoaded":"Image-module_isLoaded__3XhU5","wrapper":"Image-module_wrapper__3fLjs","fullscreen":"Image-module_fullscreen__29apx","dark":"Image-module_dark__3o0nU"};
|
|
428
437
|
|
|
429
438
|
var Image = function Image(_ref) {
|
|
430
439
|
var alt = _ref.alt,
|
|
@@ -435,7 +444,8 @@ var Image = function Image(_ref) {
|
|
|
435
444
|
source = _ref.source,
|
|
436
445
|
lazy = _ref.lazy,
|
|
437
446
|
fullscreen = _ref.fullscreen,
|
|
438
|
-
ratio = _ref.ratio
|
|
447
|
+
ratio = _ref.ratio,
|
|
448
|
+
styleContext = _ref.styleContext;
|
|
439
449
|
|
|
440
450
|
var _useContext = useContext(BlockContext),
|
|
441
451
|
lightBox = _useContext.lightBox;
|
|
@@ -472,8 +482,14 @@ var Image = function Image(_ref) {
|
|
|
472
482
|
/* fallback w325 url until w6 was released */
|
|
473
483
|
|
|
474
484
|
var fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
|
|
485
|
+
var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, fullscreen && fullscreen.desktop]];
|
|
486
|
+
|
|
487
|
+
if (styleContext) {
|
|
488
|
+
classNames = makeStyleContext(classNames, styleContext, styles$4);
|
|
489
|
+
}
|
|
490
|
+
|
|
475
491
|
return React.createElement("div", {
|
|
476
|
-
className: makeClassName(
|
|
492
|
+
className: makeClassName(classNames),
|
|
477
493
|
style: blockStyles,
|
|
478
494
|
"data-testid": "image"
|
|
479
495
|
}, React.createElement("div", {
|
|
@@ -793,15 +809,6 @@ var DotsOnImage = function DotsOnImage(_ref) {
|
|
|
793
809
|
})))));
|
|
794
810
|
};
|
|
795
811
|
|
|
796
|
-
var makeStyleContext = function makeStyleContext(classNames, styleContext, styles) {
|
|
797
|
-
var context = Array.isArray(styleContext) ? styleContext.filter(function (ctx) {
|
|
798
|
-
return styles[ctx];
|
|
799
|
-
}).map(function (ctx) {
|
|
800
|
-
return [[styles[ctx]], true];
|
|
801
|
-
}) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
|
|
802
|
-
return classNames.concat(context);
|
|
803
|
-
};
|
|
804
|
-
|
|
805
812
|
var styles$8 = {"root":"Tag-module_root__3IqWC","small":"Tag-module_small__2IAb7","large":"Tag-module_large__22z_o","dark":"Tag-module_dark__sgnt1","light":"Tag-module_light__1zUhp","gold":"Tag-module_gold__2ksA7","gray":"Tag-module_gray__mGAO_","inherit":"Tag-module_inherit__2QB5U","is1to1":"Tag-module_is1to1__3EDbC","is1to2":"Tag-module_is1to2__3xbC6","isInSuperBlock":"Tag-module_isInSuperBlock__38JE0","is1to3":"Tag-module_is1to3__3j5K-","is1to4":"Tag-module_is1to4__2vq4r","slide":"Tag-module_slide__2nMDw","game":"Tag-module_game__3j5yG","richRelated":"Tag-module_richRelated__2vbQQ","card":"Tag-module_card__1EAeF","live":"Tag-module_live__rwXuR","episode":"Tag-module_episode__3o6gg","podcast":"Tag-module_podcast__VPoll","rich":"Tag-module_rich__2URd9","isInDynamicBlock":"Tag-module_isInDynamicBlock__1YM9I","mobile":"Tag-module_mobile__QQxuv","desktop":"Tag-module_desktop__1Bjsy"};
|
|
806
813
|
|
|
807
814
|
var Tag = function Tag(_ref) {
|
|
@@ -1275,7 +1282,8 @@ var EmbedBlock = function EmbedBlock(_ref) {
|
|
|
1275
1282
|
height: block.data.height,
|
|
1276
1283
|
alt: block.data.caption,
|
|
1277
1284
|
display: block.data.display,
|
|
1278
|
-
lazy: block.data.lazy
|
|
1285
|
+
lazy: block.data.lazy,
|
|
1286
|
+
styleContext: styleContext
|
|
1279
1287
|
}));
|
|
1280
1288
|
}
|
|
1281
1289
|
|