@meduza/ui-kit-2 0.1.50 → 0.1.51
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 +42 -35
- 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 +42 -35
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1024 -1024
- package/package.json +1 -1
- package/src/EmbedBlock/EmbedBlock.tsx +1 -0
- package/src/Image/Image.types.ts +1 -0
- package/src/Image/index.tsx +19 -4
- package/src/RawHtmlBlock/mock.json +4 -4
- package/src/RelatedRichBlock/mock.json +12 -12
- package/src/Spoiler/index.tsx +2 -2
package/dist/ui-kit-2.esm.js
CHANGED
|
@@ -311,6 +311,36 @@ var postMessage = function postMessage(category, element, action) {
|
|
|
311
311
|
}
|
|
312
312
|
};
|
|
313
313
|
|
|
314
|
+
var viewportSize = (function () {
|
|
315
|
+
return {
|
|
316
|
+
width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
|
|
317
|
+
height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
|
|
318
|
+
};
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
var MediaQuerySizes = {
|
|
322
|
+
MOBILE: 512,
|
|
323
|
+
PORTRAIT_TABLET: 768,
|
|
324
|
+
LANDSCAPE_TABLET: 1024,
|
|
325
|
+
DESKTOP: 1010,
|
|
326
|
+
WIDE_DESKTOP: 1200
|
|
327
|
+
};
|
|
328
|
+
var imageBreakpoints = {
|
|
329
|
+
325: '(min-width: 0)',
|
|
330
|
+
520: '(min-width: 325px)',
|
|
331
|
+
600: '(min-width: 600px)',
|
|
332
|
+
650: '(min-width: 650px)',
|
|
333
|
+
980: '(min-width: 1000px)',
|
|
334
|
+
1335: '(min-width: 1000px)'
|
|
335
|
+
};
|
|
336
|
+
var imageConditionalKeys = {
|
|
337
|
+
xs: [325],
|
|
338
|
+
superFull: [1335, 650, 520, 325],
|
|
339
|
+
full: [980, 650, 520, 325],
|
|
340
|
+
"default": [650, 520, 325],
|
|
341
|
+
narrow: [600, 325]
|
|
342
|
+
};
|
|
343
|
+
|
|
314
344
|
var styles$3 = {"root":"Lazy-module_root__2Z72l"};
|
|
315
345
|
|
|
316
346
|
var Lazy = function Lazy(_ref) {
|
|
@@ -345,29 +375,6 @@ var Lazy = function Lazy(_ref) {
|
|
|
345
375
|
}, visible && children);
|
|
346
376
|
};
|
|
347
377
|
|
|
348
|
-
var MediaQuerySizes = {
|
|
349
|
-
MOBILE: 512,
|
|
350
|
-
PORTRAIT_TABLET: 768,
|
|
351
|
-
LANDSCAPE_TABLET: 1024,
|
|
352
|
-
DESKTOP: 1010,
|
|
353
|
-
WIDE_DESKTOP: 1200
|
|
354
|
-
};
|
|
355
|
-
var imageBreakpoints = {
|
|
356
|
-
325: '(min-width: 0)',
|
|
357
|
-
520: '(min-width: 325px)',
|
|
358
|
-
600: '(min-width: 600px)',
|
|
359
|
-
650: '(min-width: 650px)',
|
|
360
|
-
980: '(min-width: 1000px)',
|
|
361
|
-
1335: '(min-width: 1000px)'
|
|
362
|
-
};
|
|
363
|
-
var imageConditionalKeys = {
|
|
364
|
-
xs: [325],
|
|
365
|
-
superFull: [1335, 650, 520, 325],
|
|
366
|
-
full: [980, 650, 520, 325],
|
|
367
|
-
"default": [650, 520, 325],
|
|
368
|
-
narrow: [600, 325]
|
|
369
|
-
};
|
|
370
|
-
|
|
371
378
|
var toCamel = function toCamel(s) {
|
|
372
379
|
return s.replace(/([_][a-z])/gi, function (str) {
|
|
373
380
|
return str.toUpperCase().replace('_', '');
|
|
@@ -437,17 +444,23 @@ var Image = function Image(_ref) {
|
|
|
437
444
|
source = _ref.source,
|
|
438
445
|
lazy = _ref.lazy,
|
|
439
446
|
ratio = _ref.ratio,
|
|
440
|
-
styleContext = _ref.styleContext
|
|
447
|
+
styleContext = _ref.styleContext,
|
|
448
|
+
fullscreen = _ref.fullscreen;
|
|
441
449
|
|
|
442
450
|
var _useContext = useContext(BlockContext),
|
|
443
451
|
lightBox = _useContext.lightBox;
|
|
444
452
|
|
|
445
|
-
var _useState = useState(false),
|
|
453
|
+
var _useState = useState(lazy ? false : true),
|
|
446
454
|
isLoaded = _useState[0],
|
|
447
455
|
setIsLoaded = _useState[1];
|
|
448
456
|
|
|
449
457
|
var handleClick = function handleClick() {
|
|
450
|
-
|
|
458
|
+
var _viewportSize = viewportSize(),
|
|
459
|
+
viewportWidth = _viewportSize.width;
|
|
460
|
+
|
|
461
|
+
var disableFullscreenDesktop = viewportWidth >= MediaQuerySizes.LANDSCAPE_TABLET && !fullscreen;
|
|
462
|
+
|
|
463
|
+
if (disableFullscreenDesktop || !lightBox || optimized && !optimized.original) {
|
|
451
464
|
return;
|
|
452
465
|
}
|
|
453
466
|
|
|
@@ -464,7 +477,7 @@ var Image = function Image(_ref) {
|
|
|
464
477
|
/* fallback w325 url until w6 was released */
|
|
465
478
|
|
|
466
479
|
var fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
|
|
467
|
-
var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, lightBox && optimized && optimized.original]];
|
|
480
|
+
var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, fullscreen && lightBox && optimized && optimized.original]];
|
|
468
481
|
|
|
469
482
|
if (styleContext) {
|
|
470
483
|
classNames = makeStyleContext(classNames, styleContext, styles$4);
|
|
@@ -618,13 +631,6 @@ var Footnote = function Footnote(_ref) {
|
|
|
618
631
|
}, children));
|
|
619
632
|
};
|
|
620
633
|
|
|
621
|
-
var viewportSize = (function () {
|
|
622
|
-
return {
|
|
623
|
-
width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
|
|
624
|
-
height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
|
|
625
|
-
};
|
|
626
|
-
});
|
|
627
|
-
|
|
628
634
|
var styles$7 = {"root":"DotsOnImage-module_root__2XP3Q","isVisible":"DotsOnImage-module_isVisible__Wqqqt","marker":"DotsOnImage-module_marker__lH5cP","show":"DotsOnImage-module_show__2TMBv","dot":"DotsOnImage-module_dot__H1wua","isActive":"DotsOnImage-module_isActive__3hh31","popover":"DotsOnImage-module_popover__35Cpj","isRight":"DotsOnImage-module_isRight__2RsJe","isTop":"DotsOnImage-module_isTop__3zmSK","isLeft":"DotsOnImage-module_isLeft__3quc9","isBottom":"DotsOnImage-module_isBottom__3Nk1T"};
|
|
629
635
|
|
|
630
636
|
var DotsOnImage = function DotsOnImage(_ref) {
|
|
@@ -1264,6 +1270,7 @@ var EmbedBlock = function EmbedBlock(_ref) {
|
|
|
1264
1270
|
alt: block.data.caption,
|
|
1265
1271
|
display: block.data.display,
|
|
1266
1272
|
lazy: block.data.lazy,
|
|
1273
|
+
fullscreen: block.data.fullscreen,
|
|
1267
1274
|
styleContext: styleContext
|
|
1268
1275
|
}));
|
|
1269
1276
|
}
|
|
@@ -2351,7 +2358,7 @@ var Spoiler = function Spoiler(_ref) {
|
|
|
2351
2358
|
}, title && React.createElement("h3", null, title)), React.createElement("div", {
|
|
2352
2359
|
className: styles$A.body
|
|
2353
2360
|
}, blocks.map(function (item) {
|
|
2354
|
-
return React.createElement(
|
|
2361
|
+
return React.createElement(RawHtmlBlock, {
|
|
2355
2362
|
key: item.id,
|
|
2356
2363
|
block: item,
|
|
2357
2364
|
styleContext: context
|