@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.
- package/dist/EmbedBlock/EmbedBlock.types.d.ts +1 -0
- package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +1 -0
- package/dist/RenderBlocks/RenderBlocks.types.d.ts +1 -0
- package/dist/ui-kit-2.cjs.development.js +28 -9
- 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 +28 -9
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit-game.css +4 -0
- package/dist/ui-kit.css +4 -0
- package/package.json +13 -13
- package/src/EmbedBlock/EmbedBlock.module.css +4 -0
- package/src/EmbedBlock/EmbedBlock.tsx +19 -2
- package/src/EmbedBlock/EmbedBlock.types.ts +1 -0
- package/src/EmbedBlock/index.tsx +5 -2
- package/src/RawHtmlBlock/RawHtmlBlock.types.ts +1 -0
- package/src/RawHtmlBlock/index.tsx +3 -1
- package/src/RenderBlocks/RenderBlocks.types.ts +1 -0
- package/src/RenderBlocks/index.tsx +3 -1
package/dist/ui-kit-game.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/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.
|
|
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
|
+
}
|
|
@@ -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
|
package/src/EmbedBlock/index.tsx
CHANGED
|
@@ -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
|
|
15
|
+
return (
|
|
16
|
+
<EmbedBlock block={block} styleContext={styleContext} platform={platform} />
|
|
17
|
+
)
|
|
15
18
|
}
|
|
@@ -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
|
)
|
|
@@ -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':
|