@antscorp/antsomi-ui 1.3.3-beta.56 → 1.3.3-beta.58
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.
|
@@ -70,12 +70,15 @@ export const RichMenuCell = props => {
|
|
|
70
70
|
React.createElement(AddLabel, null, t(translations.cellAction).toString())));
|
|
71
71
|
return (React.createElement(CellImage, { active: active && !isPreview, src: imageUrl, imagePosition: objectPosition, imageSize: objectFit, style: restImageStyles }));
|
|
72
72
|
};
|
|
73
|
-
const renderVideoLayer = (action) => {
|
|
73
|
+
const renderVideoLayer = (action, cell) => {
|
|
74
74
|
if (!action || action.type !== 'video' || layerActive === 'image')
|
|
75
75
|
return null;
|
|
76
76
|
const { previewImage, isAddLabel, videoUrl } = action;
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const { active } = cell;
|
|
78
|
+
if (!previewImage && !videoUrl)
|
|
79
|
+
return null;
|
|
80
|
+
return (React.createElement(LayerVideoContainer, { active: active && !isPreview && videoState.status === 'idle' },
|
|
81
|
+
!isPreview && videoUrl && (React.createElement(Video, { ref: videoRef, style: { width: '100%', height: '100%', objectFit: 'cover' }, onEnded: () => {
|
|
79
82
|
setVideoState(prev => (Object.assign(Object.assign({}, prev), { status: 'idle' })));
|
|
80
83
|
}, onClick: handleVideoStop, onLoadedData: () => {
|
|
81
84
|
setVideoState(prev => (Object.assign(Object.assign({}, prev), { status: 'idle' })));
|
|
@@ -83,11 +86,11 @@ export const RichMenuCell = props => {
|
|
|
83
86
|
React.createElement("source", { src: videoUrl, type: "video/mp4" }))),
|
|
84
87
|
previewImage && (videoState.status === 'idle' || isPreview) && (React.createElement(ThumbnailBox, null,
|
|
85
88
|
React.createElement(Image, { src: previewImage, alt: "thumbnail" }))),
|
|
86
|
-
(videoState.status === 'idle' || isPreview) && (React.createElement(VideoAction, null,
|
|
87
|
-
React.createElement(ActionButton, { onClick: handleVideoPlay },
|
|
89
|
+
(videoState.status === 'idle' || isPreview) && videoUrl && (React.createElement(VideoAction, null,
|
|
90
|
+
React.createElement(ActionButton, { id: "video-capture-action-play", onClick: handleVideoPlay },
|
|
88
91
|
React.createElement(Icon, { type: "icon-ants-play-circle", size: 24, style: { width: 26, color: '#fff' } }),
|
|
89
92
|
isAddLabel && React.createElement(ActionButtonLabel, null, "Play")),
|
|
90
|
-
isAddLabel && (React.createElement(Link, { href: action.externalUrl, target: "_blank", rel: "noreferrer" },
|
|
93
|
+
isAddLabel && action.label && (React.createElement(Link, { id: "video-capture-action-external", href: action.externalUrl, target: "_blank", rel: "noreferrer" },
|
|
91
94
|
React.createElement("div", { style: { width: 26 } },
|
|
92
95
|
React.createElement(CircleBorder, null,
|
|
93
96
|
React.createElement(Icon, { type: "icon-ants-redo", size: 14, style: { color: '#fff', height: '17px' } }))),
|
|
@@ -98,5 +101,5 @@ export const RichMenuCell = props => {
|
|
|
98
101
|
tryCatchWrapper(onClick, PATH)(context);
|
|
99
102
|
} },
|
|
100
103
|
renderCellContent(!isSingleMode, cell),
|
|
101
|
-
renderVideoLayer(action)));
|
|
104
|
+
renderVideoLayer(action, cell)));
|
|
102
105
|
};
|
|
@@ -7,7 +7,9 @@ export declare const CellImage: import("styled-components").StyledComponent<"div
|
|
|
7
7
|
imagePosition: string;
|
|
8
8
|
imageSize: string;
|
|
9
9
|
}, never>;
|
|
10
|
-
export declare const LayerVideoContainer: import("styled-components").StyledComponent<"div", any, {
|
|
10
|
+
export declare const LayerVideoContainer: import("styled-components").StyledComponent<"div", any, {
|
|
11
|
+
active?: boolean | undefined;
|
|
12
|
+
}, never>;
|
|
11
13
|
export declare const Video: import("styled-components").StyledComponent<"video", any, {}, never>;
|
|
12
14
|
export declare const VideoAction: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
15
|
export declare const ActionButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -58,6 +58,21 @@ export const LayerVideoContainer = styled.div `
|
|
|
58
58
|
bottom: 0;
|
|
59
59
|
z-index: 9999;
|
|
60
60
|
overflow: hidden;
|
|
61
|
+
|
|
62
|
+
${props => props.active &&
|
|
63
|
+
css `
|
|
64
|
+
&::after {
|
|
65
|
+
content: '';
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0;
|
|
68
|
+
right: 0;
|
|
69
|
+
bottom: 0;
|
|
70
|
+
left: 0;
|
|
71
|
+
background-color: rgba(0, 95, 184, 0.5);
|
|
72
|
+
display: block;
|
|
73
|
+
z-index: 9999;
|
|
74
|
+
}
|
|
75
|
+
`}
|
|
61
76
|
`;
|
|
62
77
|
export const Video = styled.video ``;
|
|
63
78
|
export const VideoAction = styled.div `
|
|
@@ -68,14 +83,15 @@ export const VideoAction = styled.div `
|
|
|
68
83
|
flex-direction: column;
|
|
69
84
|
justify-content: center;
|
|
70
85
|
align-items: flex-start;
|
|
71
|
-
gap:
|
|
72
|
-
z-index:
|
|
86
|
+
gap: 10px;
|
|
87
|
+
z-index: 99999;
|
|
73
88
|
transform: translate(-50%, -50%);
|
|
74
89
|
`;
|
|
75
90
|
export const ActionButton = styled.div `
|
|
76
91
|
display: flex;
|
|
77
92
|
justify-content: center;
|
|
78
93
|
align-items: center;
|
|
94
|
+
height: auto;
|
|
79
95
|
`;
|
|
80
96
|
export const ThumbnailBox = styled.div `
|
|
81
97
|
position: absolute;
|
|
@@ -95,6 +111,7 @@ export const Link = styled.a `
|
|
|
95
111
|
justify-content: center;
|
|
96
112
|
align-items: center;
|
|
97
113
|
text-decoration: none;
|
|
114
|
+
height: auto;
|
|
98
115
|
`;
|
|
99
116
|
export const ActionButtonLabel = styled.span `
|
|
100
117
|
font-size: 14px;
|
|
@@ -104,7 +121,7 @@ export const ActionButtonLabel = styled.span `
|
|
|
104
121
|
overflow: hidden;
|
|
105
122
|
line-height: 18px;
|
|
106
123
|
height: 18px;
|
|
107
|
-
max-width:
|
|
124
|
+
max-width: 300px;
|
|
108
125
|
`;
|
|
109
126
|
export const CircleBorder = styled.div `
|
|
110
127
|
width: 18px;
|