@meduza/ui-kit-2 1.0.0 → 1.0.1

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.
@@ -9,4 +9,5 @@ export interface EmbedBlockProps {
9
9
  styleContext?: string[] | string;
10
10
  lang?: 'ru' | 'en';
11
11
  children?: React.ReactNode;
12
+ platform?: 'website' | 'mirror';
12
13
  }
@@ -14,4 +14,5 @@ export interface RawHtmlBlockProps {
14
14
  bookmarkAction?: (service: CallToActions, place: string) => void;
15
15
  lightBox?: LightboxContext | null | undefined;
16
16
  lang?: 'ru' | 'en';
17
+ platform?: 'website' | 'mirror';
17
18
  }
@@ -8,4 +8,5 @@ export interface RenderBlocksProps {
8
8
  bookmarkAction?: (service: CallToActions, place: string) => void;
9
9
  lightBox?: LightboxContext | null | undefined;
10
10
  lang?: 'ru' | 'en';
11
+ platform?: 'website' | 'mirror';
11
12
  }
@@ -1161,6 +1161,7 @@ const EmbedGif = ({
1161
1161
  }))));
1162
1162
  };
1163
1163
 
1164
+ /* eslint-disable jsx-a11y/media-has-caption */
1164
1165
  const EmbedBlock = ({
1165
1166
  block,
1166
1167
  block: {
@@ -1175,11 +1176,13 @@ const EmbedBlock = ({
1175
1176
  small_url: small,
1176
1177
  large_url: large,
1177
1178
  gif_url: gifUrl,
1178
- mp4_url: mp4Url
1179
+ mp4_url: mp4Url,
1180
+ video_file_path: videoFileUrl
1179
1181
  }
1180
1182
  },
1181
1183
  styleContext,
1182
- children
1184
+ children,
1185
+ platform
1183
1186
  }) => {
1184
1187
  const [isPopoverShown, setIsPopoverShown] = React.useState(false);
1185
1188
  const style = {};
@@ -1236,6 +1239,16 @@ const EmbedBlock = ({
1236
1239
  }
1237
1240
  default:
1238
1241
  {
1242
+ if (platform === 'mirror' && videoFileUrl) {
1243
+ return /*#__PURE__*/React.createElement("div", {
1244
+ className: styles$r.object
1245
+ }, /*#__PURE__*/React.createElement("div", {
1246
+ className: styles$r.objectWrap
1247
+ }, /*#__PURE__*/React.createElement("video", {
1248
+ src: videoFileUrl,
1249
+ controls: true
1250
+ })));
1251
+ }
1239
1252
  return /*#__PURE__*/React.createElement("div", {
1240
1253
  className: styles$r.object
1241
1254
  }, /*#__PURE__*/React.createElement("div", {
@@ -1360,7 +1373,8 @@ const IframeBlock = ({
1360
1373
  const EmbedBlockContainer = ({
1361
1374
  block,
1362
1375
  styleContext,
1363
- lang
1376
+ lang,
1377
+ platform
1364
1378
  }) => {
1365
1379
  if (block.data && block.data.wrap_with_iframe) {
1366
1380
  return /*#__PURE__*/React.createElement(IframeBlock, {
@@ -1371,7 +1385,8 @@ const EmbedBlockContainer = ({
1371
1385
  }
1372
1386
  return /*#__PURE__*/React.createElement(EmbedBlock, {
1373
1387
  block: block,
1374
- styleContext: styleContext
1388
+ styleContext: styleContext,
1389
+ platform: platform
1375
1390
  });
1376
1391
  };
1377
1392
 
@@ -2101,7 +2116,8 @@ const RenderBlocks = ({
2101
2116
  isRead,
2102
2117
  isListened,
2103
2118
  bookmarkAction,
2104
- isInBookmarks
2119
+ isInBookmarks,
2120
+ platform
2105
2121
  }) => {
2106
2122
  switch (block.type) {
2107
2123
  case 'tag':
@@ -2228,7 +2244,8 @@ const RenderBlocks = ({
2228
2244
  return /*#__PURE__*/React.createElement(EmbedBlockContainer, {
2229
2245
  block: block,
2230
2246
  styleContext: styleContext,
2231
- lang: lang
2247
+ lang: lang,
2248
+ platform: platform
2232
2249
  });
2233
2250
  case 'grouped':
2234
2251
  return /*#__PURE__*/React.createElement(GroupedBlock, {
@@ -2675,7 +2692,8 @@ const RawHtmlBlock = ({
2675
2692
  isInBookmarks,
2676
2693
  bookmarkAction,
2677
2694
  lightBox,
2678
- lang
2695
+ lang,
2696
+ platform
2679
2697
  }) => {
2680
2698
  const context = {
2681
2699
  lightBox: lightBox || null
@@ -2743,7 +2761,8 @@ const RawHtmlBlock = ({
2743
2761
  isListened: isListened,
2744
2762
  isInBookmarks: isInBookmarks,
2745
2763
  bookmarkAction: bookmarkAction,
2746
- lang: lang
2764
+ lang: lang,
2765
+ platform: platform
2747
2766
  }));
2748
2767
  }
2749
2768
  }