@builder.io/sdk-solid 0.0.8-18 → 0.0.8-20
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/package.json
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
|
+
import { createMutable } from "solid-js/store";
|
|
2
|
+
|
|
1
3
|
function Video(props) {
|
|
2
|
-
|
|
4
|
+
const state = createMutable({
|
|
5
|
+
get videoProps() {
|
|
6
|
+
return { ...(props.autoPlay === true ? {
|
|
7
|
+
autoPlay: true
|
|
8
|
+
} : {}),
|
|
9
|
+
...(props.muted === true ? {
|
|
10
|
+
muted: true
|
|
11
|
+
} : {}),
|
|
12
|
+
...(props.controls === true ? {
|
|
13
|
+
controls: true
|
|
14
|
+
} : {}),
|
|
15
|
+
...(props.loop === true ? {
|
|
16
|
+
loop: true
|
|
17
|
+
} : {}),
|
|
18
|
+
...(props.playsInline === true ? {
|
|
19
|
+
playsInline: true
|
|
20
|
+
} : {})
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
});
|
|
25
|
+
return <video {...state.videoProps} style={{
|
|
3
26
|
width: "100%",
|
|
4
27
|
height: "100%",
|
|
5
28
|
...props.attributes?.style,
|
|
@@ -8,7 +31,7 @@ function Video(props) {
|
|
|
8
31
|
// Hack to get object fit to work as expected and
|
|
9
32
|
// not have the video overflow
|
|
10
33
|
"border-radius": 1
|
|
11
|
-
}} src={props.video || "no-src"} poster={props.posterImage}
|
|
34
|
+
}} src={props.video || "no-src"} poster={props.posterImage}></video>;
|
|
12
35
|
}
|
|
13
36
|
|
|
14
37
|
export default Video;
|
|
@@ -243,7 +243,7 @@ function RenderContent(props) {
|
|
|
243
243
|
<Show when={state.useContent}>
|
|
244
244
|
<div onClick={event => track("click", {
|
|
245
245
|
contentId: state.useContent.id
|
|
246
|
-
})}
|
|
246
|
+
})} builder-content-id={state.useContent?.id}>
|
|
247
247
|
<Show when={state.shouldRenderContentStyles}>
|
|
248
248
|
<RenderContentStyles cssCode={state.useContent?.data?.cssCode} customFonts={state.useContent?.data?.customFonts}></RenderContentStyles>
|
|
249
249
|
</Show>
|