@builder.io/sdk-svelte 0.0.1-27 → 0.0.1-28

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.0.1-27",
4
+ "version": "0.0.1-28",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "src"
@@ -1,23 +1,54 @@
1
1
  <script>
2
+ export let autoPlay;
3
+ export let muted;
4
+ export let controls;
5
+ export let loop;
6
+ export let playsInline;
2
7
  export let attributes;
3
8
  export let fit;
4
9
  export let position;
5
10
  export let video;
6
11
  export let posterImage;
7
- export let autoPlay;
8
- export let muted;
9
- export let controls;
10
- export let loop;
11
12
 
12
13
  function mitosis_styling(node, vars) {
13
14
  Object.entries(vars).forEach(([p, v]) => {
14
15
  node.style[p] = v;
15
16
  });
16
17
  }
18
+
19
+ $: videoProps = () => {
20
+ return {
21
+ ...(autoPlay === true
22
+ ? {
23
+ autoPlay: true,
24
+ }
25
+ : {}),
26
+ ...(muted === true
27
+ ? {
28
+ muted: true,
29
+ }
30
+ : {}),
31
+ ...(controls === true
32
+ ? {
33
+ controls: true,
34
+ }
35
+ : {}),
36
+ ...(loop === true
37
+ ? {
38
+ loop: true,
39
+ }
40
+ : {}),
41
+ ...(playsInline === true
42
+ ? {
43
+ playsInline: true,
44
+ }
45
+ : {}),
46
+ };
47
+ };
17
48
  </script>
18
49
 
19
50
  <video
20
- {...attributes}
51
+ {...videoProps()}
21
52
  use:mitosis_styling={{
22
53
  width: "100%",
23
54
  height: "100%",
@@ -28,11 +59,6 @@
28
59
  // not have the video overflow
29
60
  borderRadius: 1,
30
61
  }}
31
- preload="none"
32
62
  src={video || "no-src"}
33
63
  poster={posterImage}
34
- {autoPlay}
35
- {muted}
36
- {controls}
37
- {loop}
38
64
  />