@meduza/ui-kit-2 0.1.51 → 0.1.53

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.
@@ -15,7 +15,6 @@ export interface ImageProps {
15
15
  source?: string[];
16
16
  lazy?: boolean;
17
17
  ratio?: number;
18
- fullscreen?: boolean | undefined;
19
18
  styleContext?: string[] | string;
20
19
  }
21
20
  export interface PictureProps {
@@ -10,7 +10,6 @@ var reactIntersectionObserver = require('react-intersection-observer');
10
10
  var dayjs = _interopDefault(require('dayjs'));
11
11
  require('dayjs/locale/ru');
12
12
  var relativeTime = _interopDefault(require('dayjs/plugin/relativeTime'));
13
- var enableInlineVideo = _interopDefault(require('iphone-inline-video'));
14
13
 
15
14
  var makeClassName = function makeClassName(list) {
16
15
  return list.filter(function (_ref) {
@@ -318,36 +317,6 @@ var postMessage = function postMessage(category, element, action) {
318
317
  }
319
318
  };
320
319
 
321
- var viewportSize = (function () {
322
- return {
323
- width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
324
- height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
325
- };
326
- });
327
-
328
- var MediaQuerySizes = {
329
- MOBILE: 512,
330
- PORTRAIT_TABLET: 768,
331
- LANDSCAPE_TABLET: 1024,
332
- DESKTOP: 1010,
333
- WIDE_DESKTOP: 1200
334
- };
335
- var imageBreakpoints = {
336
- 325: '(min-width: 0)',
337
- 520: '(min-width: 325px)',
338
- 600: '(min-width: 600px)',
339
- 650: '(min-width: 650px)',
340
- 980: '(min-width: 1000px)',
341
- 1335: '(min-width: 1000px)'
342
- };
343
- var imageConditionalKeys = {
344
- xs: [325],
345
- superFull: [1335, 650, 520, 325],
346
- full: [980, 650, 520, 325],
347
- "default": [650, 520, 325],
348
- narrow: [600, 325]
349
- };
350
-
351
320
  var styles$3 = {"root":"Lazy-module_root__2Z72l"};
352
321
 
353
322
  var Lazy = function Lazy(_ref) {
@@ -382,6 +351,29 @@ var Lazy = function Lazy(_ref) {
382
351
  }, visible && children);
383
352
  };
384
353
 
354
+ var MediaQuerySizes = {
355
+ MOBILE: 512,
356
+ PORTRAIT_TABLET: 768,
357
+ LANDSCAPE_TABLET: 1024,
358
+ DESKTOP: 1010,
359
+ WIDE_DESKTOP: 1200
360
+ };
361
+ var imageBreakpoints = {
362
+ 325: '(min-width: 0)',
363
+ 520: '(min-width: 325px)',
364
+ 600: '(min-width: 600px)',
365
+ 650: '(min-width: 650px)',
366
+ 980: '(min-width: 1000px)',
367
+ 1335: '(min-width: 1000px)'
368
+ };
369
+ var imageConditionalKeys = {
370
+ xs: [325],
371
+ superFull: [1335, 650, 520, 325],
372
+ full: [980, 650, 520, 325],
373
+ "default": [650, 520, 325],
374
+ narrow: [600, 325]
375
+ };
376
+
385
377
  var toCamel = function toCamel(s) {
386
378
  return s.replace(/([_][a-z])/gi, function (str) {
387
379
  return str.toUpperCase().replace('_', '');
@@ -451,8 +443,7 @@ var Image = function Image(_ref) {
451
443
  source = _ref.source,
452
444
  lazy = _ref.lazy,
453
445
  ratio = _ref.ratio,
454
- styleContext = _ref.styleContext,
455
- fullscreen = _ref.fullscreen;
446
+ styleContext = _ref.styleContext;
456
447
 
457
448
  var _useContext = React.useContext(BlockContext),
458
449
  lightBox = _useContext.lightBox;
@@ -462,12 +453,7 @@ var Image = function Image(_ref) {
462
453
  setIsLoaded = _useState[1];
463
454
 
464
455
  var handleClick = function handleClick() {
465
- var _viewportSize = viewportSize(),
466
- viewportWidth = _viewportSize.width;
467
-
468
- var disableFullscreenDesktop = viewportWidth >= MediaQuerySizes.LANDSCAPE_TABLET && !fullscreen;
469
-
470
- if (disableFullscreenDesktop || !lightBox || optimized && !optimized.original) {
456
+ if (!lightBox || optimized && !optimized.original) {
471
457
  return;
472
458
  }
473
459
 
@@ -484,7 +470,7 @@ var Image = function Image(_ref) {
484
470
  /* fallback w325 url until w6 was released */
485
471
 
486
472
  var fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
487
- var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, fullscreen && lightBox && optimized && optimized.original]];
473
+ var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, lightBox && optimized && optimized.original]];
488
474
 
489
475
  if (styleContext) {
490
476
  classNames = makeStyleContext(classNames, styleContext, styles$4);
@@ -638,6 +624,13 @@ var Footnote = function Footnote(_ref) {
638
624
  }, children));
639
625
  };
640
626
 
627
+ var viewportSize = (function () {
628
+ return {
629
+ width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
630
+ height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
631
+ };
632
+ });
633
+
641
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"};
642
635
 
643
636
  var DotsOnImage = function DotsOnImage(_ref) {
@@ -1182,8 +1175,6 @@ var EmbedGif = function EmbedGif(_ref) {
1182
1175
  var _viewportSize = viewportSize(),
1183
1176
  viewportWidth = _viewportSize.width;
1184
1177
 
1185
- enableInlineVideo(video);
1186
-
1187
1178
  if (viewportWidth >= MediaQuerySizes.MOBILE) {
1188
1179
  video.setAttribute('autoplay', true);
1189
1180
  video.play();
@@ -1277,7 +1268,6 @@ var EmbedBlock = function EmbedBlock(_ref) {
1277
1268
  alt: block.data.caption,
1278
1269
  display: block.data.display,
1279
1270
  lazy: block.data.lazy,
1280
- fullscreen: block.data.fullscreen,
1281
1271
  styleContext: styleContext
1282
1272
  }));
1283
1273
  }
@@ -2365,7 +2355,7 @@ var Spoiler = function Spoiler(_ref) {
2365
2355
  }, title && React__default.createElement("h3", null, title)), React__default.createElement("div", {
2366
2356
  className: styles$A.body
2367
2357
  }, blocks.map(function (item) {
2368
- return React__default.createElement(RawHtmlBlock, {
2358
+ return React__default.createElement(RenderBlocks, {
2369
2359
  key: item.id,
2370
2360
  block: item,
2371
2361
  styleContext: context