@meduza/ui-kit-2 1.0.0 → 1.0.2

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.
@@ -2590,6 +2590,10 @@
2590
2590
  height: 100%;
2591
2591
  }
2592
2592
 
2593
+ .EmbedBlock-module_proportional__zDPfm .EmbedBlock-module_isDefaultVideo__UTW9Q video {
2594
+ position: static;
2595
+ }
2596
+
2593
2597
  .EmbedBlock-module_objectWrap__qpbni img,
2594
2598
  .EmbedBlock-module_objectWrap__qpbni video {
2595
2599
  width: 100%;
package/dist/ui-kit.css CHANGED
@@ -2590,6 +2590,10 @@
2590
2590
  height: 100%;
2591
2591
  }
2592
2592
 
2593
+ .EmbedBlock-module_proportional__zDPfm .EmbedBlock-module_isDefaultVideo__UTW9Q video {
2594
+ position: static;
2595
+ }
2596
+
2593
2597
  .EmbedBlock-module_objectWrap__qpbni img,
2594
2598
  .EmbedBlock-module_objectWrap__qpbni video {
2595
2599
  width: 100%;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0",
2
+ "version": "1.0.2",
3
3
  "license": "MIT",
4
4
  "description": "UIKit for Meduza",
5
5
  "repository": "https://github.com/meduza-corp/ui-kit-2.git",
@@ -15,17 +15,6 @@
15
15
  "engines": {
16
16
  "node": ">=16"
17
17
  },
18
- "scripts": {
19
- "start": "dts watch --tsconfig ./tsconfig.build.json --mode development",
20
- "build": "dts build --tsconfig ./tsconfig.build.json --mode production && node build.sh",
21
- "generate": "plop --plopfile generators/index.js",
22
- "test": "dts test --passWithNoTests",
23
- "test:watch": "dts test --watch",
24
- "test:coverage": "dts test --coverage",
25
- "lint": "eslint src",
26
- "storybook": "storybook dev -p 6006",
27
- "build-storybook": "storybook build"
28
- },
29
18
  "peerDependencies": {
30
19
  "dayjs": "^1.10.3",
31
20
  "react": ">=16",
@@ -125,5 +114,16 @@
125
114
  "typescript": "^5.1.6",
126
115
  "typescript-plugin-css-modules": "^5.0.1",
127
116
  "utils": "^0.3.1"
117
+ },
118
+ "scripts": {
119
+ "start": "dts watch --tsconfig ./tsconfig.build.json --mode development",
120
+ "build": "dts build --tsconfig ./tsconfig.build.json --mode production && node build.sh",
121
+ "generate": "plop --plopfile generators/index.js",
122
+ "test": "dts test --passWithNoTests",
123
+ "test:watch": "dts test --watch",
124
+ "test:coverage": "dts test --coverage",
125
+ "lint": "eslint src",
126
+ "storybook": "storybook dev -p 6006",
127
+ "build-storybook": "storybook build"
128
128
  }
129
- }
129
+ }
@@ -65,6 +65,10 @@
65
65
  height: 100%;
66
66
  }
67
67
 
68
+ .proportional .isDefaultVideo video {
69
+ position: static;
70
+ }
71
+
68
72
  .objectWrap img,
69
73
  .objectWrap video {
70
74
  width: 100%;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable jsx-a11y/media-has-caption */
1
2
  import React, { useState } from 'react'
2
3
  import { Image } from '../Image'
3
4
  import { Popover } from '../Popover'
@@ -25,11 +26,13 @@ export const EmbedBlock: React.FC<EmbedBlockProps> = ({
25
26
  small_url: small,
26
27
  large_url: large,
27
28
  gif_url: gifUrl,
28
- mp4_url: mp4Url
29
+ mp4_url: mp4Url,
30
+ video_file_path: videoFileUrl
29
31
  }
30
32
  },
31
33
  styleContext,
32
- children
34
+ children,
35
+ platform
33
36
  }) => {
34
37
  const [isPopoverShown, setIsPopoverShown] = useState(false)
35
38
  const style: React.CSSProperties = {}
@@ -96,6 +99,20 @@ export const EmbedBlock: React.FC<EmbedBlockProps> = ({
96
99
  }
97
100
 
98
101
  default: {
102
+ if (platform === 'mirror' && videoFileUrl) {
103
+ return (
104
+ <div className={styles.object}>
105
+ <div
106
+ className={makeClassName([
107
+ [styles.objectWrap, true],
108
+ [styles.isDefaultVideo, true]
109
+ ])}
110
+ >
111
+ <video src={videoFileUrl} controls />
112
+ </div>
113
+ </div>
114
+ )
115
+ }
99
116
  return (
100
117
  <div className={styles.object}>
101
118
  <div
@@ -11,4 +11,5 @@ export interface EmbedBlockProps {
11
11
  styleContext?: string[] | string
12
12
  lang?: 'ru' | 'en'
13
13
  children?: React.ReactNode
14
+ platform?: 'website' | 'mirror'
14
15
  }
@@ -6,10 +6,13 @@ import { IframeBlock } from './IframeBlock'
6
6
  export const EmbedBlockContainer: React.FC<EmbedBlockProps> = ({
7
7
  block,
8
8
  styleContext,
9
- lang
9
+ lang,
10
+ platform
10
11
  }) => {
11
12
  if (block.data && block.data.wrap_with_iframe) {
12
13
  return <IframeBlock block={block} styleContext={styleContext} lang={lang} />
13
14
  }
14
- return <EmbedBlock block={block} styleContext={styleContext} />
15
+ return (
16
+ <EmbedBlock block={block} styleContext={styleContext} platform={platform} />
17
+ )
15
18
  }
@@ -17,4 +17,5 @@ export interface RawHtmlBlockProps {
17
17
  bookmarkAction?: (service: CallToActions, place: string) => void
18
18
  lightBox?: LightboxContext | null | undefined
19
19
  lang?: 'ru' | 'en'
20
+ platform?: 'website' | 'mirror'
20
21
  }
@@ -18,7 +18,8 @@ export const RawHtmlBlock: React.FC<RawHtmlBlockProps> = ({
18
18
  isInBookmarks,
19
19
  bookmarkAction,
20
20
  lightBox,
21
- lang
21
+ lang,
22
+ platform
22
23
  }) => {
23
24
  const context = {
24
25
  lightBox: lightBox || null
@@ -68,6 +69,7 @@ export const RawHtmlBlock: React.FC<RawHtmlBlockProps> = ({
68
69
  isInBookmarks={isInBookmarks}
69
70
  bookmarkAction={bookmarkAction}
70
71
  lang={lang}
72
+ platform={platform}
71
73
  />
72
74
  </BlockProvider>
73
75
  )
@@ -10,4 +10,5 @@ export interface RenderBlocksProps {
10
10
  bookmarkAction?: (service: CallToActions, place: string) => void
11
11
  lightBox?: LightboxContext | null | undefined
12
12
  lang?: 'ru' | 'en'
13
+ platform?: 'website' | 'mirror'
13
14
  }
@@ -27,7 +27,8 @@ export const RenderBlocks: React.FC<RenderBlocksProps> = ({
27
27
  isRead,
28
28
  isListened,
29
29
  bookmarkAction,
30
- isInBookmarks
30
+ isInBookmarks,
31
+ platform
31
32
  }) => {
32
33
  switch (block.type) {
33
34
  case 'tag': {
@@ -129,6 +130,7 @@ export const RenderBlocks: React.FC<RenderBlocksProps> = ({
129
130
  block={block}
130
131
  styleContext={styleContext}
131
132
  lang={lang}
133
+ platform={platform}
132
134
  />
133
135
  )
134
136
  case 'grouped':