@webstudio-is/sdk-components-react 0.213.0 → 0.215.0
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/lib/bold.ws.js +3 -3
- package/lib/checkbox.ws.js +0 -1
- package/lib/code-text.ws.js +8 -5
- package/lib/head-link.ws.js +5 -7
- package/lib/head-meta.ws.js +3 -5
- package/lib/head-title.ws.js +4 -5
- package/lib/image.ws.js +2 -3
- package/lib/input.ws.js +0 -1
- package/lib/italic.ws.js +5 -5
- package/lib/option.ws.js +0 -1
- package/lib/radio-button.ws.js +2 -3
- package/lib/rich-text-link.ws.js +6 -6
- package/lib/separator.ws.js +0 -1
- package/lib/span.ws.js +5 -5
- package/lib/subscript.ws.js +5 -5
- package/lib/superscript.ws.js +9 -9
- package/lib/textarea.ws.js +8 -5
- package/lib/video.ws.js +8 -5
- package/lib/vimeo-preview-image.ws.js +3 -3
- package/lib/youtube.js +94 -92
- package/package.json +6 -6
package/lib/bold.ws.js
CHANGED
|
@@ -5,16 +5,16 @@ import { props as r } from "./__generated__/bold.props.js";
|
|
|
5
5
|
const p = {
|
|
6
6
|
b: e
|
|
7
7
|
}, l = {
|
|
8
|
-
type: "
|
|
8
|
+
type: "container",
|
|
9
9
|
label: "Bold Text",
|
|
10
10
|
icon: t,
|
|
11
11
|
states: o,
|
|
12
12
|
presetStyle: p
|
|
13
|
-
},
|
|
13
|
+
}, n = {
|
|
14
14
|
props: r,
|
|
15
15
|
initialProps: ["id", "className"]
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
18
|
l as meta,
|
|
19
|
-
|
|
19
|
+
n as propsMeta
|
|
20
20
|
};
|
package/lib/checkbox.ws.js
CHANGED
package/lib/code-text.ws.js
CHANGED
|
@@ -30,15 +30,18 @@ const p = {
|
|
|
30
30
|
value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 }
|
|
31
31
|
}
|
|
32
32
|
]
|
|
33
|
-
},
|
|
33
|
+
}, i = {
|
|
34
34
|
category: "general",
|
|
35
|
-
type: "embed",
|
|
36
35
|
description: "Use this component when you want to display code as text on the page.",
|
|
37
36
|
icon: e,
|
|
37
|
+
contentModel: {
|
|
38
|
+
category: "instance",
|
|
39
|
+
children: []
|
|
40
|
+
},
|
|
38
41
|
states: t,
|
|
39
42
|
presetStyle: p,
|
|
40
43
|
order: 5
|
|
41
|
-
},
|
|
44
|
+
}, s = {
|
|
42
45
|
props: {
|
|
43
46
|
...r,
|
|
44
47
|
code: {
|
|
@@ -50,6 +53,6 @@ const p = {
|
|
|
50
53
|
initialProps: ["id", "className", "lang", "code"]
|
|
51
54
|
};
|
|
52
55
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
i as meta,
|
|
57
|
+
s as propsMeta
|
|
55
58
|
};
|
package/lib/head-link.ws.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { ResourceIcon as
|
|
1
|
+
import { ResourceIcon as o } from "@webstudio-is/icons/svg";
|
|
2
2
|
import "@webstudio-is/sdk";
|
|
3
|
-
import { props as
|
|
3
|
+
import { props as r } from "./__generated__/head-link.props.js";
|
|
4
4
|
const p = {
|
|
5
|
-
|
|
6
|
-
icon: e,
|
|
7
|
-
type: "embed",
|
|
5
|
+
icon: o,
|
|
8
6
|
contentModel: {
|
|
9
7
|
category: "none",
|
|
10
|
-
children: [
|
|
8
|
+
children: []
|
|
11
9
|
}
|
|
12
10
|
}, c = {
|
|
13
|
-
props:
|
|
11
|
+
props: r,
|
|
14
12
|
initialProps: ["rel", "hrefLang", "href", "type", "as"]
|
|
15
13
|
};
|
|
16
14
|
export {
|
package/lib/head-meta.ws.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { WindowInfoIcon as o } from "@webstudio-is/icons/svg";
|
|
2
2
|
import "@webstudio-is/sdk";
|
|
3
|
-
import { props as
|
|
3
|
+
import { props as n } from "./__generated__/head-meta.props.js";
|
|
4
4
|
const p = {
|
|
5
|
-
category: "hidden",
|
|
6
5
|
icon: o,
|
|
7
|
-
type: "embed",
|
|
8
6
|
contentModel: {
|
|
9
7
|
category: "none",
|
|
10
|
-
children: [
|
|
8
|
+
children: []
|
|
11
9
|
}
|
|
12
10
|
}, i = {
|
|
13
|
-
props:
|
|
11
|
+
props: n,
|
|
14
12
|
initialProps: ["name", "property", "content"]
|
|
15
13
|
};
|
|
16
14
|
export {
|
package/lib/head-title.ws.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { WindowTitleIcon as o } from "@webstudio-is/icons/svg";
|
|
2
2
|
import "@webstudio-is/sdk";
|
|
3
3
|
import { props as t } from "./__generated__/head-title.props.js";
|
|
4
|
-
const
|
|
5
|
-
category: "hidden",
|
|
4
|
+
const p = {
|
|
6
5
|
icon: o,
|
|
7
6
|
type: "container",
|
|
8
7
|
contentModel: {
|
|
9
8
|
category: "none",
|
|
10
9
|
children: ["text"]
|
|
11
10
|
}
|
|
12
|
-
},
|
|
11
|
+
}, c = {
|
|
13
12
|
props: t
|
|
14
13
|
};
|
|
15
14
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
p as meta,
|
|
16
|
+
c as propsMeta
|
|
18
17
|
};
|
package/lib/image.ws.js
CHANGED
|
@@ -26,13 +26,12 @@ const a = {
|
|
|
26
26
|
]
|
|
27
27
|
}, l = {
|
|
28
28
|
category: "media",
|
|
29
|
-
type: "embed",
|
|
30
29
|
description: "Add an image asset to the page. Webstudio automatically converts images to WebP or AVIF format and makes them responsive for best performance.",
|
|
31
30
|
icon: e,
|
|
32
31
|
states: t,
|
|
33
32
|
presetStyle: a,
|
|
34
33
|
order: 0
|
|
35
|
-
},
|
|
34
|
+
}, n = {
|
|
36
35
|
props: {
|
|
37
36
|
...r,
|
|
38
37
|
// Automatically generated props don't have the right control.
|
|
@@ -56,5 +55,5 @@ const a = {
|
|
|
56
55
|
};
|
|
57
56
|
export {
|
|
58
57
|
l as meta,
|
|
59
|
-
|
|
58
|
+
n as propsMeta
|
|
60
59
|
};
|
package/lib/input.ws.js
CHANGED
package/lib/italic.ws.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TextItalicIcon as t } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { defaultStates as e } from "@webstudio-is/sdk";
|
|
3
3
|
import { i as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
-
import { props as
|
|
5
|
-
const
|
|
4
|
+
import { props as r } from "./__generated__/italic.props.js";
|
|
5
|
+
const i = {
|
|
6
6
|
i: [
|
|
7
7
|
...o,
|
|
8
8
|
{
|
|
@@ -11,13 +11,13 @@ const r = {
|
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}, c = {
|
|
14
|
-
type: "
|
|
14
|
+
type: "container",
|
|
15
15
|
label: "Italic Text",
|
|
16
16
|
icon: t,
|
|
17
17
|
states: e,
|
|
18
|
-
presetStyle:
|
|
18
|
+
presetStyle: i
|
|
19
19
|
}, m = {
|
|
20
|
-
props:
|
|
20
|
+
props: r,
|
|
21
21
|
initialProps: ["id", "className"]
|
|
22
22
|
};
|
|
23
23
|
export {
|
package/lib/option.ws.js
CHANGED
package/lib/radio-button.ws.js
CHANGED
|
@@ -11,7 +11,6 @@ const a = {
|
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}, s = {
|
|
14
|
-
type: "control",
|
|
15
14
|
label: "Radio",
|
|
16
15
|
icon: e,
|
|
17
16
|
presetStyle: a,
|
|
@@ -26,11 +25,11 @@ const a = {
|
|
|
26
25
|
//{ selector: ":read-only", label: "Read Only" },
|
|
27
26
|
//{ selector: ":read-write", label: "Read Write" },
|
|
28
27
|
]
|
|
29
|
-
},
|
|
28
|
+
}, m = {
|
|
30
29
|
props: r,
|
|
31
30
|
initialProps: ["id", "className", "name", "value", "required", "checked"]
|
|
32
31
|
};
|
|
33
32
|
export {
|
|
34
33
|
s as meta,
|
|
35
|
-
|
|
34
|
+
m as propsMeta
|
|
36
35
|
};
|
package/lib/rich-text-link.ws.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { meta as t, propsMeta as
|
|
2
|
-
const
|
|
1
|
+
import { meta as t, propsMeta as a } from "./link.ws.js";
|
|
2
|
+
const o = {
|
|
3
3
|
...t,
|
|
4
|
-
type: "
|
|
5
|
-
},
|
|
4
|
+
type: "container"
|
|
5
|
+
}, p = a;
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
o as meta,
|
|
8
|
+
p as propsMeta
|
|
9
9
|
};
|
package/lib/separator.ws.js
CHANGED
package/lib/span.ws.js
CHANGED
|
@@ -4,17 +4,17 @@ import { span as r } from "@webstudio-is/sdk/normalize.css";
|
|
|
4
4
|
import { props as e } from "./__generated__/span.props.js";
|
|
5
5
|
const s = {
|
|
6
6
|
span: r
|
|
7
|
-
},
|
|
8
|
-
type: "
|
|
7
|
+
}, n = {
|
|
8
|
+
type: "container",
|
|
9
9
|
label: "Text",
|
|
10
10
|
icon: t,
|
|
11
11
|
states: o,
|
|
12
12
|
presetStyle: s
|
|
13
|
-
},
|
|
13
|
+
}, c = {
|
|
14
14
|
props: e,
|
|
15
15
|
initialProps: ["id", "className"]
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
n as meta,
|
|
19
|
+
c as propsMeta
|
|
20
20
|
};
|
package/lib/subscript.ws.js
CHANGED
|
@@ -4,17 +4,17 @@ import { sub as r } from "@webstudio-is/sdk/normalize.css";
|
|
|
4
4
|
import { props as s } from "./__generated__/subscript.props.js";
|
|
5
5
|
const e = {
|
|
6
6
|
sub: r
|
|
7
|
-
},
|
|
8
|
-
type: "
|
|
7
|
+
}, c = {
|
|
8
|
+
type: "container",
|
|
9
9
|
label: "Subscript Text",
|
|
10
10
|
icon: t,
|
|
11
11
|
states: o,
|
|
12
12
|
presetStyle: e
|
|
13
|
-
},
|
|
13
|
+
}, n = {
|
|
14
14
|
props: s,
|
|
15
15
|
initialProps: ["id", "className"]
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
c as meta,
|
|
19
|
+
n as propsMeta
|
|
20
20
|
};
|
package/lib/superscript.ws.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { SuperscriptIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
-
import { defaultStates as
|
|
3
|
-
import { sup as
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
3
|
+
import { sup as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
4
|
import { props as p } from "./__generated__/superscript.props.js";
|
|
5
5
|
const e = {
|
|
6
|
-
sup:
|
|
7
|
-
},
|
|
8
|
-
type: "
|
|
6
|
+
sup: r
|
|
7
|
+
}, c = {
|
|
8
|
+
type: "container",
|
|
9
9
|
label: "Superscript Text",
|
|
10
10
|
icon: t,
|
|
11
|
-
states:
|
|
11
|
+
states: o,
|
|
12
12
|
presetStyle: e
|
|
13
|
-
},
|
|
13
|
+
}, n = {
|
|
14
14
|
props: p,
|
|
15
15
|
initialProps: ["id", "className"]
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
c as meta,
|
|
19
|
+
n as propsMeta
|
|
20
20
|
};
|
package/lib/textarea.ws.js
CHANGED
|
@@ -12,14 +12,17 @@ const l = {
|
|
|
12
12
|
value: { type: "keyword", value: "block" }
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
|
-
},
|
|
15
|
+
}, n = {
|
|
16
16
|
category: "forms",
|
|
17
|
-
type: "control",
|
|
18
17
|
label: "Text Area",
|
|
19
18
|
description: "A multi-line text input for collecting longer string data from your users.",
|
|
20
19
|
icon: e,
|
|
21
20
|
presetStyle: l,
|
|
22
21
|
order: 4,
|
|
22
|
+
contentModel: {
|
|
23
|
+
category: "instance",
|
|
24
|
+
children: []
|
|
25
|
+
},
|
|
23
26
|
states: [
|
|
24
27
|
...r,
|
|
25
28
|
{ selector: "::placeholder", label: "Placeholder" },
|
|
@@ -33,7 +36,7 @@ const l = {
|
|
|
33
36
|
//{ selector: ":read-only", label: "Read Only" },
|
|
34
37
|
//{ selector: ":read-write", label: "Read Write" },
|
|
35
38
|
]
|
|
36
|
-
},
|
|
39
|
+
}, p = {
|
|
37
40
|
props: t,
|
|
38
41
|
initialProps: [
|
|
39
42
|
"id",
|
|
@@ -46,6 +49,6 @@ const l = {
|
|
|
46
49
|
]
|
|
47
50
|
};
|
|
48
51
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
n as meta,
|
|
53
|
+
p as propsMeta
|
|
51
54
|
};
|
package/lib/video.ws.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { VideoIcon as o } from "@webstudio-is/icons/svg";
|
|
2
2
|
import "@webstudio-is/sdk";
|
|
3
3
|
import { props as t } from "./__generated__/video.props.js";
|
|
4
|
-
const
|
|
5
|
-
type: "control",
|
|
4
|
+
const p = {
|
|
6
5
|
icon: o,
|
|
6
|
+
contentModel: {
|
|
7
|
+
category: "instance",
|
|
8
|
+
children: []
|
|
9
|
+
},
|
|
7
10
|
presetStyle: {
|
|
8
11
|
video: [
|
|
9
12
|
{
|
|
@@ -12,7 +15,7 @@ const r = {
|
|
|
12
15
|
}
|
|
13
16
|
]
|
|
14
17
|
}
|
|
15
|
-
},
|
|
18
|
+
}, n = {
|
|
16
19
|
props: t,
|
|
17
20
|
initialProps: [
|
|
18
21
|
"id",
|
|
@@ -29,6 +32,6 @@ const r = {
|
|
|
29
32
|
]
|
|
30
33
|
};
|
|
31
34
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
p as meta,
|
|
36
|
+
n as propsMeta
|
|
34
37
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { meta as e, propsMeta as o } from "./image.ws.js";
|
|
2
2
|
import { props as r } from "./__generated__/vimeo-preview-image.props.js";
|
|
3
|
-
const
|
|
3
|
+
const p = {
|
|
4
4
|
...e,
|
|
5
5
|
category: "hidden",
|
|
6
6
|
label: "Preview Image",
|
|
7
7
|
contentModel: {
|
|
8
8
|
category: "none",
|
|
9
|
-
children: [
|
|
9
|
+
children: []
|
|
10
10
|
}
|
|
11
11
|
}, i = {
|
|
12
12
|
props: {
|
|
@@ -22,6 +22,6 @@ const a = {
|
|
|
22
22
|
initialProps: o.initialProps
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
p as meta,
|
|
26
26
|
i as propsMeta
|
|
27
27
|
};
|
package/lib/youtube.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as u, jsxs as E, Fragment as O } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as x, useState as p, useContext as S, useRef as T, useEffect as
|
|
2
|
+
import { forwardRef as x, useState as p, useContext as S, useRef as T, useEffect as y } from "react";
|
|
3
3
|
import { ReactSdkContext as A } from "@webstudio-is/react-sdk/runtime";
|
|
4
4
|
import { VimeoContext as N, requestFullscreen as P } from "./vimeo.js";
|
|
5
5
|
const U = "https://www.youtube-nocookie.com", V = "https://www.youtube.com", j = "https://img.youtube.com", L = (e) => {
|
|
@@ -12,9 +12,9 @@ const U = "https://www.youtube-nocookie.com", V = "https://www.youtube.com", j =
|
|
|
12
12
|
}
|
|
13
13
|
}, D = (e, t) => {
|
|
14
14
|
var o, n;
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
r.pathname = `/embed/${
|
|
15
|
+
const s = L(e.url), r = new URL(t);
|
|
16
|
+
if (s)
|
|
17
|
+
r.pathname = `/embed/${s}`;
|
|
18
18
|
else if (e.url)
|
|
19
19
|
try {
|
|
20
20
|
const c = new URL(e.url);
|
|
@@ -22,77 +22,79 @@ const U = "https://www.youtube-nocookie.com", V = "https://www.youtube.com", j =
|
|
|
22
22
|
} catch {
|
|
23
23
|
}
|
|
24
24
|
const i = Object.keys(e), a = {};
|
|
25
|
+
a.autoplay = "1";
|
|
25
26
|
for (const c of i)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
27
|
+
if (e[c] !== void 0)
|
|
28
|
+
switch (c) {
|
|
29
|
+
case "autoplay":
|
|
30
|
+
e.autoplay && e.muted === void 0 && (a.mute = "1");
|
|
31
|
+
break;
|
|
32
|
+
case "muted":
|
|
33
|
+
a.mute = e.muted ? "1" : "0";
|
|
34
|
+
break;
|
|
35
|
+
case "showControls":
|
|
36
|
+
a.controls = e.showControls ? "1" : "0";
|
|
37
|
+
break;
|
|
38
|
+
case "showRelatedVideos":
|
|
39
|
+
a.rel = e.showRelatedVideos ? "1" : "0";
|
|
40
|
+
break;
|
|
41
|
+
case "keyboard":
|
|
42
|
+
a.keyboard = e.keyboard ? "1" : "0";
|
|
43
|
+
break;
|
|
44
|
+
case "loop":
|
|
45
|
+
a.loop = e.loop ? "1" : "0", e.loop && (e.playlist ?? "").trim() === "" && (a.playlist = s);
|
|
46
|
+
break;
|
|
47
|
+
case "inline":
|
|
48
|
+
a.playsinline = e.inline ? "1" : "0";
|
|
49
|
+
break;
|
|
50
|
+
case "allowFullscreen":
|
|
51
|
+
a.fs = e.allowFullscreen ? "1" : "0";
|
|
52
|
+
break;
|
|
53
|
+
case "captionLanguage":
|
|
54
|
+
a.cc_lang_pref = e.captionLanguage;
|
|
55
|
+
break;
|
|
56
|
+
case "showCaptions":
|
|
57
|
+
a.cc_load_policy = e.showCaptions ? "1" : "0";
|
|
58
|
+
break;
|
|
59
|
+
case "showAnnotations":
|
|
60
|
+
a.iv_load_policy = e.showAnnotations ? "1" : "3";
|
|
61
|
+
break;
|
|
62
|
+
case "startTime":
|
|
63
|
+
a.start = (o = e.startTime) == null ? void 0 : o.toString();
|
|
64
|
+
break;
|
|
65
|
+
case "endTime":
|
|
66
|
+
a.end = (n = e.endTime) == null ? void 0 : n.toString();
|
|
67
|
+
break;
|
|
68
|
+
case "disableKeyboard":
|
|
69
|
+
a.disablekb = e.disableKeyboard ? "1" : "0";
|
|
70
|
+
break;
|
|
71
|
+
case "language":
|
|
72
|
+
a.hl = e.language;
|
|
73
|
+
break;
|
|
74
|
+
case "listId":
|
|
75
|
+
a.list = e.listId;
|
|
76
|
+
break;
|
|
77
|
+
case "listType":
|
|
78
|
+
a.listType = e.listType;
|
|
79
|
+
break;
|
|
80
|
+
case "color":
|
|
81
|
+
a.color = e.color;
|
|
82
|
+
break;
|
|
83
|
+
case "origin":
|
|
84
|
+
a.origin = e.origin;
|
|
85
|
+
break;
|
|
86
|
+
case "referrer":
|
|
87
|
+
a.widget_referrer = e.referrer;
|
|
88
|
+
break;
|
|
89
|
+
case "playlist":
|
|
90
|
+
a.playlist = e.playlist;
|
|
91
|
+
break;
|
|
92
|
+
case "enablejsapi":
|
|
93
|
+
a.enablejsapi = e.enablejsapi ? "1" : "0";
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
return Object.entries(a).forEach(([c, l]) => {
|
|
97
|
+
l !== void 0 && r.searchParams.append(c, l.toString());
|
|
96
98
|
}), r.toString();
|
|
97
99
|
}, R = (e) => {
|
|
98
100
|
const t = document.createElement("link");
|
|
@@ -111,22 +113,22 @@ const F = (e) => {
|
|
|
111
113
|
}, Y = (e) => new URL(`${j}/vi/${e}/maxresdefault.jpg`), K = () => /* @__PURE__ */ u("div", { className: "flex w-full h-full items-center justify-center text-lg", children: 'Open the "Settings" panel and paste a video URL, e.g. https://youtube.com/watch?v=dQw4w9WgXcQ' }), M = ({
|
|
112
114
|
title: e,
|
|
113
115
|
status: t,
|
|
114
|
-
loading:
|
|
116
|
+
loading: s,
|
|
115
117
|
videoUrl: r,
|
|
116
118
|
previewImageUrl: i,
|
|
117
119
|
autoplay: a,
|
|
118
120
|
inline: o,
|
|
119
121
|
renderer: n,
|
|
120
122
|
showPreview: c,
|
|
121
|
-
onStatusChange:
|
|
123
|
+
onStatusChange: l,
|
|
122
124
|
onPreviewImageUrlChange: d
|
|
123
125
|
}) => {
|
|
124
|
-
const [
|
|
125
|
-
return
|
|
126
|
-
a && n !== "canvas" && t === "initial" &&
|
|
127
|
-
}, [a, t, n,
|
|
126
|
+
const [h, m] = p(0), b = T(null);
|
|
127
|
+
return y(() => {
|
|
128
|
+
a && n !== "canvas" && t === "initial" && l("loading");
|
|
129
|
+
}, [a, t, n, l]), y(() => {
|
|
128
130
|
n !== "canvas" && F(r);
|
|
129
|
-
}, [n, r]),
|
|
131
|
+
}, [n, r]), y(() => {
|
|
130
132
|
const f = L(r);
|
|
131
133
|
if (!f || !c) {
|
|
132
134
|
d(void 0);
|
|
@@ -139,19 +141,19 @@ const F = (e) => {
|
|
|
139
141
|
ref: b,
|
|
140
142
|
title: e,
|
|
141
143
|
src: r,
|
|
142
|
-
loading:
|
|
144
|
+
loading: s,
|
|
143
145
|
allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",
|
|
144
146
|
allowFullScreen: !0,
|
|
145
147
|
style: {
|
|
146
148
|
position: "absolute",
|
|
147
149
|
width: "100%",
|
|
148
150
|
height: "100%",
|
|
149
|
-
opacity:
|
|
151
|
+
opacity: h,
|
|
150
152
|
transition: "opacity 1s",
|
|
151
153
|
border: "none"
|
|
152
154
|
},
|
|
153
155
|
onLoad: () => {
|
|
154
|
-
|
|
156
|
+
l("ready"), m(1), !o && !a && b.current && P(b.current);
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
);
|
|
@@ -159,29 +161,29 @@ const F = (e) => {
|
|
|
159
161
|
({
|
|
160
162
|
url: e,
|
|
161
163
|
loading: t = "lazy",
|
|
162
|
-
autoplay:
|
|
164
|
+
autoplay: s,
|
|
163
165
|
showPreview: r,
|
|
164
166
|
showAnnotations: i,
|
|
165
167
|
showCaptions: a,
|
|
166
168
|
showControls: o,
|
|
167
169
|
allowFullscreen: n,
|
|
168
170
|
keyboard: c,
|
|
169
|
-
children:
|
|
171
|
+
children: l,
|
|
170
172
|
privacyEnhancedMode: d,
|
|
171
|
-
inline:
|
|
173
|
+
inline: h = !1,
|
|
172
174
|
...m
|
|
173
175
|
}, b) => {
|
|
174
176
|
const [f, g] = p("initial"), [w, C] = p(), { renderer: k } = S(A), I = d ?? !0 ? U : V, v = D(
|
|
175
177
|
{
|
|
176
178
|
...m,
|
|
177
|
-
inline:
|
|
179
|
+
inline: h,
|
|
178
180
|
url: e,
|
|
179
181
|
keyboard: c,
|
|
180
182
|
showAnnotations: i,
|
|
181
183
|
showCaptions: a,
|
|
182
184
|
allowFullscreen: n,
|
|
183
185
|
showControls: o,
|
|
184
|
-
autoplay:
|
|
186
|
+
autoplay: s,
|
|
185
187
|
enablejsapi: !1
|
|
186
188
|
},
|
|
187
189
|
I
|
|
@@ -197,16 +199,16 @@ const F = (e) => {
|
|
|
197
199
|
}
|
|
198
200
|
},
|
|
199
201
|
children: /* @__PURE__ */ u("div", { ...m, ref: b, children: v ? /* @__PURE__ */ E(O, { children: [
|
|
200
|
-
|
|
202
|
+
l,
|
|
201
203
|
/* @__PURE__ */ u(
|
|
202
204
|
M,
|
|
203
205
|
{
|
|
204
206
|
title: m.title,
|
|
205
|
-
autoplay:
|
|
207
|
+
autoplay: s,
|
|
206
208
|
videoUrl: v,
|
|
207
209
|
previewImageUrl: w,
|
|
208
210
|
loading: t,
|
|
209
|
-
inline:
|
|
211
|
+
inline: h,
|
|
210
212
|
showPreview: r,
|
|
211
213
|
renderer: k,
|
|
212
214
|
status: f,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.215.0",
|
|
4
4
|
"description": "Webstudio default library for react",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"colord": "^2.9.3",
|
|
50
50
|
"micromark": "^4.0.2",
|
|
51
51
|
"micromark-extension-gfm-table": "^2.1.1",
|
|
52
|
-
"@webstudio-is/
|
|
53
|
-
"@webstudio-is/
|
|
54
|
-
"@webstudio-is/react-sdk": "0.
|
|
55
|
-
"@webstudio-is/sdk": "0.
|
|
52
|
+
"@webstudio-is/image": "0.215.0",
|
|
53
|
+
"@webstudio-is/icons": "0.215.0",
|
|
54
|
+
"@webstudio-is/react-sdk": "0.215.0",
|
|
55
|
+
"@webstudio-is/sdk": "0.215.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"vitest": "^3.0.8",
|
|
66
66
|
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
67
67
|
"@webstudio-is/sdk-cli": "0.94.0",
|
|
68
|
-
"@webstudio-is/template": "0.
|
|
68
|
+
"@webstudio-is/template": "0.215.0",
|
|
69
69
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|