@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.
- package/dist/Image/Image.types.d.ts +0 -1
- package/dist/ui-kit-2.cjs.development.js +34 -44
- 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 +34 -44
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +1481 -1485
- package/package.json +11 -12
- package/src/EmbedBlock/EmbedBlock.tsx +0 -1
- package/src/EmbedBlock/EmbedGif.tsx +0 -3
- package/src/Image/Image.types.ts +0 -1
- package/src/Image/index.tsx +3 -18
- package/src/Spoiler/index.tsx +2 -2
package/dist/ui-kit-2.esm.js
CHANGED
|
@@ -3,7 +3,6 @@ import { useInView } from 'react-intersection-observer';
|
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import 'dayjs/locale/ru';
|
|
5
5
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
6
|
-
import enableInlineVideo from 'iphone-inline-video';
|
|
7
6
|
|
|
8
7
|
var makeClassName = function makeClassName(list) {
|
|
9
8
|
return list.filter(function (_ref) {
|
|
@@ -311,36 +310,6 @@ var postMessage = function postMessage(category, element, action) {
|
|
|
311
310
|
}
|
|
312
311
|
};
|
|
313
312
|
|
|
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
|
-
|
|
344
313
|
var styles$3 = {"root":"Lazy-module_root__2Z72l"};
|
|
345
314
|
|
|
346
315
|
var Lazy = function Lazy(_ref) {
|
|
@@ -375,6 +344,29 @@ var Lazy = function Lazy(_ref) {
|
|
|
375
344
|
}, visible && children);
|
|
376
345
|
};
|
|
377
346
|
|
|
347
|
+
var MediaQuerySizes = {
|
|
348
|
+
MOBILE: 512,
|
|
349
|
+
PORTRAIT_TABLET: 768,
|
|
350
|
+
LANDSCAPE_TABLET: 1024,
|
|
351
|
+
DESKTOP: 1010,
|
|
352
|
+
WIDE_DESKTOP: 1200
|
|
353
|
+
};
|
|
354
|
+
var imageBreakpoints = {
|
|
355
|
+
325: '(min-width: 0)',
|
|
356
|
+
520: '(min-width: 325px)',
|
|
357
|
+
600: '(min-width: 600px)',
|
|
358
|
+
650: '(min-width: 650px)',
|
|
359
|
+
980: '(min-width: 1000px)',
|
|
360
|
+
1335: '(min-width: 1000px)'
|
|
361
|
+
};
|
|
362
|
+
var imageConditionalKeys = {
|
|
363
|
+
xs: [325],
|
|
364
|
+
superFull: [1335, 650, 520, 325],
|
|
365
|
+
full: [980, 650, 520, 325],
|
|
366
|
+
"default": [650, 520, 325],
|
|
367
|
+
narrow: [600, 325]
|
|
368
|
+
};
|
|
369
|
+
|
|
378
370
|
var toCamel = function toCamel(s) {
|
|
379
371
|
return s.replace(/([_][a-z])/gi, function (str) {
|
|
380
372
|
return str.toUpperCase().replace('_', '');
|
|
@@ -444,8 +436,7 @@ var Image = function Image(_ref) {
|
|
|
444
436
|
source = _ref.source,
|
|
445
437
|
lazy = _ref.lazy,
|
|
446
438
|
ratio = _ref.ratio,
|
|
447
|
-
styleContext = _ref.styleContext
|
|
448
|
-
fullscreen = _ref.fullscreen;
|
|
439
|
+
styleContext = _ref.styleContext;
|
|
449
440
|
|
|
450
441
|
var _useContext = useContext(BlockContext),
|
|
451
442
|
lightBox = _useContext.lightBox;
|
|
@@ -455,12 +446,7 @@ var Image = function Image(_ref) {
|
|
|
455
446
|
setIsLoaded = _useState[1];
|
|
456
447
|
|
|
457
448
|
var handleClick = function handleClick() {
|
|
458
|
-
|
|
459
|
-
viewportWidth = _viewportSize.width;
|
|
460
|
-
|
|
461
|
-
var disableFullscreenDesktop = viewportWidth >= MediaQuerySizes.LANDSCAPE_TABLET && !fullscreen;
|
|
462
|
-
|
|
463
|
-
if (disableFullscreenDesktop || !lightBox || optimized && !optimized.original) {
|
|
449
|
+
if (!lightBox || optimized && !optimized.original) {
|
|
464
450
|
return;
|
|
465
451
|
}
|
|
466
452
|
|
|
@@ -477,7 +463,7 @@ var Image = function Image(_ref) {
|
|
|
477
463
|
/* fallback w325 url until w6 was released */
|
|
478
464
|
|
|
479
465
|
var fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
|
|
480
|
-
var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen,
|
|
466
|
+
var classNames = [[styles$4.root, true], [styles$4.isLoaded, isLoaded], [styles$4.fullscreen, lightBox && optimized && optimized.original]];
|
|
481
467
|
|
|
482
468
|
if (styleContext) {
|
|
483
469
|
classNames = makeStyleContext(classNames, styleContext, styles$4);
|
|
@@ -631,6 +617,13 @@ var Footnote = function Footnote(_ref) {
|
|
|
631
617
|
}, children));
|
|
632
618
|
};
|
|
633
619
|
|
|
620
|
+
var viewportSize = (function () {
|
|
621
|
+
return {
|
|
622
|
+
width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
|
|
623
|
+
height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
|
|
624
|
+
};
|
|
625
|
+
});
|
|
626
|
+
|
|
634
627
|
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"};
|
|
635
628
|
|
|
636
629
|
var DotsOnImage = function DotsOnImage(_ref) {
|
|
@@ -1175,8 +1168,6 @@ var EmbedGif = function EmbedGif(_ref) {
|
|
|
1175
1168
|
var _viewportSize = viewportSize(),
|
|
1176
1169
|
viewportWidth = _viewportSize.width;
|
|
1177
1170
|
|
|
1178
|
-
enableInlineVideo(video);
|
|
1179
|
-
|
|
1180
1171
|
if (viewportWidth >= MediaQuerySizes.MOBILE) {
|
|
1181
1172
|
video.setAttribute('autoplay', true);
|
|
1182
1173
|
video.play();
|
|
@@ -1270,7 +1261,6 @@ var EmbedBlock = function EmbedBlock(_ref) {
|
|
|
1270
1261
|
alt: block.data.caption,
|
|
1271
1262
|
display: block.data.display,
|
|
1272
1263
|
lazy: block.data.lazy,
|
|
1273
|
-
fullscreen: block.data.fullscreen,
|
|
1274
1264
|
styleContext: styleContext
|
|
1275
1265
|
}));
|
|
1276
1266
|
}
|
|
@@ -2358,7 +2348,7 @@ var Spoiler = function Spoiler(_ref) {
|
|
|
2358
2348
|
}, title && React.createElement("h3", null, title)), React.createElement("div", {
|
|
2359
2349
|
className: styles$A.body
|
|
2360
2350
|
}, blocks.map(function (item) {
|
|
2361
|
-
return React.createElement(
|
|
2351
|
+
return React.createElement(RenderBlocks, {
|
|
2362
2352
|
key: item.id,
|
|
2363
2353
|
block: item,
|
|
2364
2354
|
styleContext: context
|