@meduza/ui-kit-2 0.1.42 → 0.1.45

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.
@@ -14,10 +14,7 @@ export interface ImageProps {
14
14
  height?: number;
15
15
  source?: string[];
16
16
  lazy?: boolean;
17
- fullscreen?: {
18
- mobile: boolean;
19
- desktop: boolean;
20
- };
17
+ fullscreen?: boolean;
21
18
  ratio?: number;
22
19
  styleContext?: string[] | string;
23
20
  }
@@ -303,13 +303,6 @@ var BlockContext = /*#__PURE__*/React__default.createContext({
303
303
  });
304
304
  var BlockProvider = BlockContext.Provider;
305
305
 
306
- var viewportSize = (function () {
307
- return {
308
- width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
309
- height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
310
- };
311
- });
312
-
313
306
  var POST_MESSAGE_PREFIX = 'mdzKitMsg';
314
307
 
315
308
  var postMessage = function postMessage(category, element, action) {
@@ -325,29 +318,6 @@ var postMessage = function postMessage(category, element, action) {
325
318
  }
326
319
  };
327
320
 
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
321
  var styles$3 = {"root":"Lazy-module_root__2Z72l"};
352
322
 
353
323
  var Lazy = function Lazy(_ref) {
@@ -382,6 +352,29 @@ var Lazy = function Lazy(_ref) {
382
352
  }, visible && children);
383
353
  };
384
354
 
355
+ var MediaQuerySizes = {
356
+ MOBILE: 512,
357
+ PORTRAIT_TABLET: 768,
358
+ LANDSCAPE_TABLET: 1024,
359
+ DESKTOP: 1010,
360
+ WIDE_DESKTOP: 1200
361
+ };
362
+ var imageBreakpoints = {
363
+ 325: '(min-width: 0)',
364
+ 520: '(min-width: 325px)',
365
+ 600: '(min-width: 600px)',
366
+ 650: '(min-width: 650px)',
367
+ 980: '(min-width: 1000px)',
368
+ 1335: '(min-width: 1000px)'
369
+ };
370
+ var imageConditionalKeys = {
371
+ xs: [325],
372
+ superFull: [1335, 650, 520, 325],
373
+ full: [980, 650, 520, 325],
374
+ "default": [650, 520, 325],
375
+ narrow: [600, 325]
376
+ };
377
+
385
378
  var toCamel = function toCamel(s) {
386
379
  return s.replace(/([_][a-z])/gi, function (str) {
387
380
  return str.toUpperCase().replace('_', '');
@@ -450,7 +443,8 @@ var Image = function Image(_ref) {
450
443
  height = _ref.height,
451
444
  source = _ref.source,
452
445
  lazy = _ref.lazy,
453
- fullscreen = _ref.fullscreen,
446
+ _ref$fullscreen = _ref.fullscreen,
447
+ fullscreen = _ref$fullscreen === void 0 ? true : _ref$fullscreen,
454
448
  ratio = _ref.ratio,
455
449
  styleContext = _ref.styleContext;
456
450
 
@@ -462,17 +456,7 @@ var Image = function Image(_ref) {
462
456
  setIsLoaded = _useState[1];
463
457
 
464
458
  var handleClick = function handleClick() {
465
- if (!fullscreen || !lightBox || optimized && !optimized.original) {
466
- return;
467
- }
468
-
469
- var _viewportSize = viewportSize(),
470
- viewportWidth = _viewportSize.width;
471
-
472
- var disableFullscreenDesktop = viewportWidth >= MediaQuerySizes.LANDSCAPE_TABLET && !fullscreen.desktop;
473
- var disableFullscreenMobile = viewportWidth < MediaQuerySizes.LANDSCAPE_TABLET && !fullscreen.mobile;
474
-
475
- if (disableFullscreenDesktop || disableFullscreenMobile) {
459
+ if (!lightBox || optimized && !optimized.original) {
476
460
  return;
477
461
  }
478
462
 
@@ -489,7 +473,7 @@ var Image = function Image(_ref) {
489
473
  /* fallback w325 url until w6 was released */
490
474
 
491
475
  var fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
492
- var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, fullscreen && fullscreen.desktop]];
476
+ var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, fullscreen]];
493
477
 
494
478
  if (styleContext) {
495
479
  classNames = makeStyleContext(classNames, styleContext, styles$4);
@@ -643,6 +627,13 @@ var Footnote = function Footnote(_ref) {
643
627
  }, children));
644
628
  };
645
629
 
630
+ var viewportSize = (function () {
631
+ return {
632
+ width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
633
+ height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
634
+ };
635
+ });
636
+
646
637
  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"};
647
638
 
648
639
  var DotsOnImage = function DotsOnImage(_ref) {
@@ -761,10 +752,7 @@ var DotsOnImage = function DotsOnImage(_ref) {
761
752
  height: height,
762
753
  alt: credit,
763
754
  display: display,
764
- fullscreen: {
765
- mobile: false,
766
- desktop: false
767
- }
755
+ fullscreen: false
768
756
  }), React__default.createElement("div", {
769
757
  ref: container
770
758
  }, dots.map(function (dot) {
@@ -1279,10 +1267,6 @@ var EmbedBlock = function EmbedBlock(_ref) {
1279
1267
  return React__default.createElement("div", {
1280
1268
  className: styles$i.figure
1281
1269
  }, React__default.createElement(Image, {
1282
- fullscreen: {
1283
- desktop: block.data.fullscreen,
1284
- mobile: true
1285
- },
1286
1270
  source: !optimized && [small, large],
1287
1271
  optimized: block.data.optimized,
1288
1272
  width: block.data.width,