@meduza/ui-kit-2 1.0.5 → 1.0.7
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/ui-kit-2.cjs.development.js +12 -7
- 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 +12 -7
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/EmbedBlock/EmbedBlock.tsx +2 -1
- package/src/Image/index.tsx +16 -13
|
@@ -482,8 +482,9 @@ const Image = ({
|
|
|
482
482
|
lightBox
|
|
483
483
|
} = React.useContext(BlockContext);
|
|
484
484
|
const [isLoaded, setIsLoaded] = React.useState(lazy ? false : true);
|
|
485
|
+
const isFullscreenEnabled = Boolean(lightBox && optimized?.original && fullscreen);
|
|
485
486
|
const handleClick = () => {
|
|
486
|
-
if (!
|
|
487
|
+
if (!isFullscreenEnabled) {
|
|
487
488
|
return;
|
|
488
489
|
}
|
|
489
490
|
postMessage('', 'fullscreen_click', 'click');
|
|
@@ -497,10 +498,16 @@ const Image = ({
|
|
|
497
498
|
};
|
|
498
499
|
/* fallback w325 url until w6 was released */
|
|
499
500
|
const fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
|
|
500
|
-
let classNames = [[styles$F.root, true], [styles$F.isLoaded, isLoaded], [styles$F.fullscreen,
|
|
501
|
+
let classNames = [[styles$F.root, true], [styles$F.isLoaded, isLoaded], [styles$F.fullscreen, isFullscreenEnabled], [styles$F.fullRatio, ratio === null]];
|
|
501
502
|
if (styleContext) {
|
|
502
503
|
classNames = makeStyleContext(classNames, styleContext, styles$F);
|
|
503
504
|
}
|
|
505
|
+
const wrapperProps = isFullscreenEnabled ? {
|
|
506
|
+
onClick: handleClick,
|
|
507
|
+
onKeyPress: handleClick,
|
|
508
|
+
role: 'button',
|
|
509
|
+
tabIndex: 0
|
|
510
|
+
} : {};
|
|
504
511
|
return /*#__PURE__*/React.createElement("div", {
|
|
505
512
|
className: makeClassName(classNames),
|
|
506
513
|
style: blockStyles,
|
|
@@ -508,10 +515,7 @@ const Image = ({
|
|
|
508
515
|
}, /*#__PURE__*/React.createElement("div", {
|
|
509
516
|
className: styles$F.wrapper,
|
|
510
517
|
style: pictureStyles,
|
|
511
|
-
|
|
512
|
-
onKeyPress: () => handleClick(),
|
|
513
|
-
role: "button",
|
|
514
|
-
tabIndex: 0
|
|
518
|
+
...wrapperProps
|
|
515
519
|
}, lazy ? (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Lazy, {
|
|
516
520
|
threshold: 0.25
|
|
517
521
|
}, /*#__PURE__*/React.createElement(RenderPicture, {
|
|
@@ -1217,6 +1221,7 @@ const EmbedBlock = ({
|
|
|
1217
1221
|
alt: block.data.caption,
|
|
1218
1222
|
display: block.data.display,
|
|
1219
1223
|
lazy: block.data.lazy,
|
|
1224
|
+
fullscreen: block.data.fullscreen,
|
|
1220
1225
|
styleContext: styleContext
|
|
1221
1226
|
}));
|
|
1222
1227
|
}
|
|
@@ -1246,7 +1251,7 @@ const EmbedBlock = ({
|
|
|
1246
1251
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1247
1252
|
className: makeClassName([[styles$r.objectWrap, true], [styles$r.isDefaultVideo, true]])
|
|
1248
1253
|
}, /*#__PURE__*/React.createElement("video", {
|
|
1249
|
-
src: videoFileUrl
|
|
1254
|
+
src: `${videoFileUrl}#t=0.001`,
|
|
1250
1255
|
controls: true,
|
|
1251
1256
|
playsInline: true,
|
|
1252
1257
|
preload: "metadata"
|