@webstudio-is/sdk-components-react 0.196.0 → 0.198.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/__generated__/image.props.js +1 -0
- package/lib/__generated__/vimeo-preview-image.props.js +6 -1
- package/lib/__generated__/vimeo.props.js +4 -5
- package/lib/__generated__/youtube.props.js +665 -0
- package/lib/blockquote.template.js +11 -0
- package/lib/blockquote.ws.js +5 -15
- package/lib/body.ws.js +1 -1
- package/lib/bold.ws.js +1 -1
- package/lib/box.ws.js +1 -1
- package/lib/button.ws.js +1 -1
- package/lib/checkbox.template.js +14 -0
- package/lib/checkbox.ws.js +5 -25
- package/lib/code-text.ws.js +1 -1
- package/lib/components.js +35 -33
- package/lib/content-embed.template.js +83 -0
- package/lib/form.ws.js +1 -1
- package/lib/heading.template.js +11 -0
- package/lib/heading.ws.js +12 -22
- package/lib/image.ws.js +17 -22
- package/lib/input.ws.js +1 -1
- package/lib/italic.ws.js +1 -1
- package/lib/label.template.js +10 -0
- package/lib/label.ws.js +13 -28
- package/lib/link.template.js +11 -0
- package/lib/link.ws.js +3 -13
- package/lib/list-item.template.js +11 -0
- package/lib/list-item.ws.js +8 -18
- package/lib/list.ws.js +1 -1
- package/lib/markdown-embed.js +10 -5
- package/lib/markdown-embed.template.js +75 -0
- package/lib/markdown-embed.ws.js +9 -87
- package/lib/metas.js +59 -59
- package/lib/option.ws.js +4 -5
- package/lib/paragraph.template.js +11 -0
- package/lib/paragraph.ws.js +10 -20
- package/lib/props.js +32 -30
- package/lib/radio-button.template.js +14 -0
- package/lib/radio-button.ws.js +7 -27
- package/lib/rich-text-link.ws.js +3 -5
- package/lib/select.template.js +16 -0
- package/lib/select.ws.js +11 -63
- package/lib/separator.ws.js +1 -1
- package/lib/span.ws.js +1 -1
- package/lib/subscript.ws.js +1 -1
- package/lib/superscript.ws.js +1 -1
- package/lib/templates.js +34 -6
- package/lib/text.template.js +11 -0
- package/lib/text.ws.js +9 -25
- package/lib/textarea.ws.js +1 -1
- package/lib/time.ws.js +1 -1
- package/lib/types/__generated__/blockquote.props.d.ts +1 -1
- package/lib/types/__generated__/body.props.d.ts +1 -1
- package/lib/types/__generated__/bold.props.d.ts +1 -1
- package/lib/types/__generated__/box.props.d.ts +1 -1
- package/lib/types/__generated__/button.props.d.ts +1 -1
- package/lib/types/__generated__/checkbox.props.d.ts +1 -1
- package/lib/types/__generated__/code-text.props.d.ts +1 -1
- package/lib/types/__generated__/form.props.d.ts +1 -1
- package/lib/types/__generated__/fragment.props.d.ts +1 -1
- package/lib/types/__generated__/heading.props.d.ts +1 -1
- package/lib/types/__generated__/html-embed.props.d.ts +1 -1
- package/lib/types/__generated__/image.props.d.ts +1 -1
- package/lib/types/__generated__/input.props.d.ts +1 -1
- package/lib/types/__generated__/italic.props.d.ts +1 -1
- package/lib/types/__generated__/label.props.d.ts +1 -1
- package/lib/types/__generated__/link.props.d.ts +1 -1
- package/lib/types/__generated__/list-item.props.d.ts +1 -1
- package/lib/types/__generated__/list.props.d.ts +1 -1
- package/lib/types/__generated__/markdown-embed.props.d.ts +1 -1
- package/lib/types/__generated__/option.props.d.ts +1 -1
- package/lib/types/__generated__/paragraph.props.d.ts +1 -1
- package/lib/types/__generated__/radio-button.props.d.ts +1 -1
- package/lib/types/__generated__/rich-text-link.props.d.ts +1 -1
- package/lib/types/__generated__/select.props.d.ts +1 -1
- package/lib/types/__generated__/separator.props.d.ts +1 -1
- package/lib/types/__generated__/slot.props.d.ts +1 -1
- package/lib/types/__generated__/span.props.d.ts +1 -1
- package/lib/types/__generated__/subscript.props.d.ts +1 -1
- package/lib/types/__generated__/superscript.props.d.ts +1 -1
- package/lib/types/__generated__/text.props.d.ts +1 -1
- package/lib/types/__generated__/textarea.props.d.ts +1 -1
- package/lib/types/__generated__/time.props.d.ts +1 -1
- package/lib/types/__generated__/vimeo-play-button.props.d.ts +1 -1
- package/lib/types/__generated__/vimeo-preview-image.props.d.ts +1 -1
- package/lib/types/__generated__/vimeo-spinner.props.d.ts +1 -1
- package/lib/types/__generated__/vimeo.props.d.ts +1 -1
- package/lib/types/__generated__/webhook-form.props.d.ts +1 -1
- package/lib/types/__generated__/xml-node.props.d.ts +1 -1
- package/lib/types/__generated__/xml-time.props.d.ts +1 -1
- package/lib/types/__generated__/youtube.props.d.ts +2 -0
- package/lib/types/blockquote.template.d.ts +2 -0
- package/lib/types/blockquote.ws.d.ts +1 -1
- package/lib/types/body.ws.d.ts +1 -1
- package/lib/types/bold.ws.d.ts +1 -1
- package/lib/types/box.ws.d.ts +1 -1
- package/lib/types/button.ws.d.ts +1 -1
- package/lib/types/checkbox.d.ts +1 -1
- package/lib/types/checkbox.template.d.ts +2 -0
- package/lib/types/checkbox.ws.d.ts +1 -1
- package/lib/types/code-text.ws.d.ts +1 -1
- package/lib/types/components.d.ts +1 -0
- package/lib/types/content-embed.template.d.ts +2 -0
- package/lib/types/form.ws.d.ts +1 -1
- package/lib/types/fragment.ws.d.ts +1 -1
- package/lib/types/heading.template.d.ts +2 -0
- package/lib/types/heading.ws.d.ts +1 -1
- package/lib/types/html-embed.ws.d.ts +1 -1
- package/lib/types/image.ws.d.ts +1 -9
- package/lib/types/input.ws.d.ts +1 -1
- package/lib/types/italic.ws.d.ts +1 -1
- package/lib/types/label.template.d.ts +2 -0
- package/lib/types/label.ws.d.ts +1 -1
- package/lib/types/link.template.d.ts +2 -0
- package/lib/types/link.ws.d.ts +1 -1
- package/lib/types/list-item.template.d.ts +2 -0
- package/lib/types/list-item.ws.d.ts +1 -1
- package/lib/types/list.ws.d.ts +1 -1
- package/lib/types/markdown-embed.template.d.ts +2 -0
- package/lib/types/markdown-embed.ws.d.ts +1 -1
- package/lib/types/metas.d.ts +1 -1
- package/lib/types/option.ws.d.ts +1 -1
- package/lib/types/paragraph.template.d.ts +2 -0
- package/lib/types/paragraph.ws.d.ts +1 -1
- package/lib/types/props.d.ts +1 -0
- package/lib/types/radio-button.d.ts +1 -1
- package/lib/types/radio-button.template.d.ts +2 -0
- package/lib/types/radio-button.ws.d.ts +1 -1
- package/lib/types/rich-text-link.ws.d.ts +1 -1
- package/lib/types/select.template.d.ts +2 -0
- package/lib/types/select.ws.d.ts +1 -1
- package/lib/types/separator.ws.d.ts +1 -1
- package/lib/types/slot.ws.d.ts +1 -1
- package/lib/types/span.ws.d.ts +1 -1
- package/lib/types/subscript.ws.d.ts +1 -1
- package/lib/types/superscript.ws.d.ts +1 -1
- package/lib/types/templates.d.ts +14 -0
- package/lib/types/text.template.d.ts +2 -0
- package/lib/types/text.ws.d.ts +1 -1
- package/lib/types/textarea.ws.d.ts +1 -1
- package/lib/types/time.ws.d.ts +1 -1
- package/lib/types/vimeo-play-button.ws.d.ts +1 -1
- package/lib/types/vimeo-preview-image.d.ts +21 -21
- package/lib/types/vimeo-preview-image.ws.d.ts +1 -1
- package/lib/types/vimeo-spinner.ws.d.ts +1 -1
- package/lib/types/vimeo.d.ts +12 -2
- package/lib/types/vimeo.ws.d.ts +1 -1
- package/lib/types/webhook-form.d.ts +1 -0
- package/lib/types/webhook-form.template.d.ts +2 -0
- package/lib/types/webhook-form.ws.d.ts +1 -1
- package/lib/types/xml-node.ws.d.ts +1 -1
- package/lib/types/xml-time.ws.d.ts +1 -1
- package/lib/types/youtube.d.ts +143 -0
- package/lib/types/youtube.template.d.ts +2 -0
- package/lib/types/youtube.ws.d.ts +3 -0
- package/lib/vimeo-play-button.ws.js +8 -8
- package/lib/vimeo-preview-image.ws.js +17 -9
- package/lib/vimeo-spinner.ws.js +8 -8
- package/lib/vimeo.js +88 -87
- package/lib/vimeo.template.js +17 -16
- package/lib/vimeo.ws.js +8 -7
- package/lib/webhook-form.template.js +49 -0
- package/lib/webhook-form.ws.js +17 -118
- package/lib/xml-node.js +18 -14
- package/lib/xml-node.ws.js +4 -5
- package/lib/xml-time.ws.js +4 -5
- package/lib/youtube.js +200 -0
- package/lib/youtube.template.js +97 -0
- package/lib/youtube.ws.js +51 -0
- package/package.json +14 -11
- package/lib/content-embed.ws.js +0 -77
- package/lib/types/__generated__/local-date.props.d.ts +0 -2
- package/lib/types/content-embed.ws.d.ts +0 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defaultStates as t } from "@webstudio-is/
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
2
|
+
import { ButtonElementIcon as o } from "@webstudio-is/icons/svg";
|
|
3
|
+
import { button as e } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as n } from "./__generated__/vimeo-play-button.props.js";
|
|
5
5
|
const r = {
|
|
6
|
-
button:
|
|
6
|
+
button: e
|
|
7
7
|
}, p = {
|
|
8
8
|
category: "hidden",
|
|
9
9
|
type: "container",
|
|
10
10
|
constraints: [
|
|
11
11
|
{
|
|
12
12
|
relation: "ancestor",
|
|
13
|
-
component: { $
|
|
13
|
+
component: { $in: ["Vimeo", "YouTube"] }
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
relation: "ancestor",
|
|
@@ -18,11 +18,11 @@ const r = {
|
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
20
|
label: "Play Button",
|
|
21
|
-
icon:
|
|
21
|
+
icon: o,
|
|
22
22
|
presetStyle: r,
|
|
23
23
|
states: t
|
|
24
24
|
}, c = {
|
|
25
|
-
props:
|
|
25
|
+
props: n,
|
|
26
26
|
initialProps: ["id", "className"]
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import { props as t } from "./__generated__/vimeo-preview-image.props.js";
|
|
1
|
+
import { meta as e, propsMeta as o } from "./image.ws.js";
|
|
2
|
+
import { props as r } from "./__generated__/vimeo-preview-image.props.js";
|
|
4
3
|
const i = {
|
|
5
|
-
...
|
|
4
|
+
...e,
|
|
6
5
|
category: "hidden",
|
|
7
6
|
label: "Preview Image",
|
|
8
7
|
constraints: {
|
|
9
8
|
relation: "ancestor",
|
|
10
|
-
component: { $
|
|
9
|
+
component: { $in: ["Vimeo", "YouTube"] }
|
|
11
10
|
}
|
|
12
|
-
},
|
|
13
|
-
props: {
|
|
14
|
-
|
|
11
|
+
}, p = {
|
|
12
|
+
props: {
|
|
13
|
+
...r,
|
|
14
|
+
// Automatically generated props don't have the right control.
|
|
15
|
+
src: {
|
|
16
|
+
type: "string",
|
|
17
|
+
control: "file",
|
|
18
|
+
label: "Source",
|
|
19
|
+
required: !1
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
initialProps: o.initialProps
|
|
15
23
|
};
|
|
16
24
|
export {
|
|
17
25
|
i as meta,
|
|
18
|
-
|
|
26
|
+
p as propsMeta
|
|
19
27
|
};
|
package/lib/vimeo-spinner.ws.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defaultStates as o } from "@webstudio-is/
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
2
|
+
import { div as t } from "@webstudio-is/sdk/normalize.css";
|
|
3
|
+
import { BoxIcon as e } from "@webstudio-is/icons/svg";
|
|
4
|
+
import { props as r } from "./__generated__/vimeo-spinner.props.js";
|
|
5
5
|
const n = {
|
|
6
|
-
div:
|
|
6
|
+
div: t
|
|
7
7
|
}, m = {
|
|
8
8
|
type: "container",
|
|
9
9
|
constraints: {
|
|
10
10
|
relation: "ancestor",
|
|
11
|
-
component: { $
|
|
11
|
+
component: { $in: ["Vimeo", "YouTube"] }
|
|
12
12
|
},
|
|
13
|
-
icon:
|
|
13
|
+
icon: e,
|
|
14
14
|
states: o,
|
|
15
15
|
presetStyle: n,
|
|
16
16
|
category: "hidden",
|
|
17
17
|
label: "Spinner"
|
|
18
18
|
}, c = {
|
|
19
|
-
props:
|
|
19
|
+
props: r,
|
|
20
20
|
initialProps: ["id", "className"]
|
|
21
21
|
};
|
|
22
22
|
export {
|
package/lib/vimeo.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { colord as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { ReactSdkContext as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as s, jsxs as D, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import { colord as z } from "colord";
|
|
3
|
+
import { createContext as T, forwardRef as q, useState as v, useContext as G, useEffect as f } from "react";
|
|
4
|
+
import { ReactSdkContext as H } from "@webstudio-is/react-sdk/runtime";
|
|
5
|
+
const Y = (e) => {
|
|
6
6
|
if (e.url === void 0)
|
|
7
7
|
return;
|
|
8
8
|
let t;
|
|
9
9
|
try {
|
|
10
10
|
const o = new URL(e.url);
|
|
11
|
-
t = new URL(
|
|
11
|
+
t = new URL(R), t.pathname = `/video${o.pathname}`;
|
|
12
12
|
} catch {
|
|
13
13
|
}
|
|
14
14
|
if (t === void 0)
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
16
|
+
const a = {
|
|
17
17
|
showPortrait: "portrait",
|
|
18
18
|
showByline: "byline",
|
|
19
19
|
showTitle: "title",
|
|
@@ -23,36 +23,36 @@ const J = (e) => {
|
|
|
23
23
|
backgroundMode: "background",
|
|
24
24
|
doNotTrack: "dnt"
|
|
25
25
|
};
|
|
26
|
-
let
|
|
27
|
-
for (
|
|
28
|
-
const o = e[
|
|
29
|
-
if (
|
|
26
|
+
let r;
|
|
27
|
+
for (r in e) {
|
|
28
|
+
const o = e[r];
|
|
29
|
+
if (r === "url" || o === void 0)
|
|
30
30
|
continue;
|
|
31
|
-
const
|
|
32
|
-
t.searchParams.append(
|
|
31
|
+
const i = a[r] ?? r;
|
|
32
|
+
t.searchParams.append(i, o.toString());
|
|
33
33
|
}
|
|
34
34
|
if (t.searchParams.set("autoplay", "true"), typeof e.controlsColor == "string") {
|
|
35
|
-
const o =
|
|
35
|
+
const o = z(e.controlsColor).toHex().replace("#", "");
|
|
36
36
|
t.searchParams.set("color", o);
|
|
37
37
|
}
|
|
38
38
|
return e.showPortrait && t.searchParams.set("title", "true"), e.showByline && (t.searchParams.set("portrait", "true"), t.searchParams.set("title", "true")), t.toString();
|
|
39
|
-
},
|
|
39
|
+
}, h = (e) => {
|
|
40
40
|
const t = document.createElement("link");
|
|
41
41
|
t.rel = "preconnect", t.href = e, t.crossOrigin = "true", document.head.appendChild(t);
|
|
42
42
|
};
|
|
43
|
-
let
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
},
|
|
43
|
+
let b = !1;
|
|
44
|
+
const J = "https://f.vimeocdn.com", R = "https://player.vimeo.com", U = "https://i.vimeocdn.com", K = () => {
|
|
45
|
+
b || window.matchMedia("(hover: none)").matches || (h(J), h(R), h(U), b = !0);
|
|
46
|
+
}, Q = (e) => {
|
|
47
47
|
try {
|
|
48
|
-
const
|
|
49
|
-
return
|
|
48
|
+
const a = new URL(e).pathname.split("/")[2];
|
|
49
|
+
return a === "" || a == null ? void 0 : a;
|
|
50
50
|
} catch {
|
|
51
51
|
}
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
},
|
|
52
|
+
}, W = async (e) => {
|
|
53
|
+
const a = `https://vimeo.com/api/v2/video/${Q(e)}.json`, o = (await (await fetch(a)).json())[0].thumbnail_large, i = o.substr(o.lastIndexOf("/") + 1).split("_")[0], n = new URL(U);
|
|
54
|
+
return n.pathname = `/video/${i}.webp`, n.searchParams.append("mw", "1100"), n.searchParams.append("mh", "619"), n.searchParams.append("q", "70"), n;
|
|
55
|
+
}, X = () => /* @__PURE__ */ s(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
58
|
style: {
|
|
@@ -65,72 +65,73 @@ const K = "https://f.vimeocdn.com", x = "https://player.vimeo.com", b = "https:/
|
|
|
65
65
|
},
|
|
66
66
|
children: 'Open the "Settings" panel and paste a video URL, e.g. https://vimeo.com/831343124.'
|
|
67
67
|
}
|
|
68
|
-
),
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
), Z = ({
|
|
69
|
+
title: e,
|
|
70
|
+
status: t,
|
|
71
|
+
loading: a,
|
|
71
72
|
videoUrl: r,
|
|
72
|
-
previewImageUrl:
|
|
73
|
-
autoplay:
|
|
74
|
-
renderer:
|
|
75
|
-
showPreview:
|
|
73
|
+
previewImageUrl: o,
|
|
74
|
+
autoplay: i,
|
|
75
|
+
renderer: n,
|
|
76
|
+
showPreview: d,
|
|
76
77
|
onStatusChange: c,
|
|
77
78
|
onPreviewImageUrlChange: l
|
|
78
79
|
}) => {
|
|
79
|
-
const [
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
|
|
84
|
-
}, [
|
|
80
|
+
const [p, u] = v(0);
|
|
81
|
+
if (f(() => {
|
|
82
|
+
i && n !== "canvas" && t === "initial" && c("loading");
|
|
83
|
+
}, [i, t, n, c]), f(() => {
|
|
84
|
+
n !== "canvas" && K();
|
|
85
|
+
}, [n]), f(() => {
|
|
85
86
|
if (r !== void 0) {
|
|
86
|
-
if (
|
|
87
|
+
if (d === !1) {
|
|
87
88
|
l(void 0);
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
+
o === void 0 && W(r).then(l).catch(() => {
|
|
91
92
|
console.error(`Could not load preview image for ${r}`);
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
|
-
}, [l,
|
|
95
|
+
}, [l, d, r, o]), !(n === "canvas" || t === "initial"))
|
|
95
96
|
return /* @__PURE__ */ s(
|
|
96
97
|
"iframe",
|
|
97
98
|
{
|
|
99
|
+
title: e,
|
|
98
100
|
src: r,
|
|
99
|
-
loading:
|
|
101
|
+
loading: a,
|
|
100
102
|
allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture;",
|
|
101
103
|
allowFullScreen: !0,
|
|
102
104
|
style: {
|
|
103
105
|
position: "absolute",
|
|
104
106
|
width: "100%",
|
|
105
107
|
height: "100%",
|
|
106
|
-
opacity:
|
|
108
|
+
opacity: p,
|
|
107
109
|
transition: "opacity 1s",
|
|
108
110
|
border: "none"
|
|
109
111
|
},
|
|
110
112
|
onLoad: () => {
|
|
111
|
-
c("ready"),
|
|
113
|
+
c("ready"), u(1);
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
);
|
|
115
|
-
},
|
|
117
|
+
}, tt = T({
|
|
116
118
|
onInitPlayer: () => {
|
|
117
119
|
},
|
|
118
120
|
status: "initial"
|
|
119
|
-
}),
|
|
121
|
+
}), et = q(
|
|
120
122
|
({
|
|
121
123
|
url: e,
|
|
122
124
|
loading: t = "lazy",
|
|
123
|
-
autoplay:
|
|
124
|
-
autopause:
|
|
125
|
-
|
|
126
|
-
showByline: a = !1,
|
|
125
|
+
autoplay: a = !1,
|
|
126
|
+
autopause: r = !0,
|
|
127
|
+
showByline: o = !1,
|
|
127
128
|
showControls: i = !0,
|
|
128
|
-
doNotTrack:
|
|
129
|
-
keyboard:
|
|
130
|
-
loop:
|
|
131
|
-
muted:
|
|
132
|
-
pip:
|
|
133
|
-
playsinline:
|
|
129
|
+
doNotTrack: n = !1,
|
|
130
|
+
keyboard: d = !0,
|
|
131
|
+
loop: c = !1,
|
|
132
|
+
muted: l = !1,
|
|
133
|
+
pip: p = !1,
|
|
134
|
+
playsinline: u = !0,
|
|
134
135
|
showPortrait: S = !0,
|
|
135
136
|
quality: L = "auto",
|
|
136
137
|
responsive: k = !0,
|
|
@@ -143,22 +144,21 @@ const K = "https://f.vimeocdn.com", x = "https://player.vimeo.com", b = "https:/
|
|
|
143
144
|
interactiveParams: V,
|
|
144
145
|
texttrack: $,
|
|
145
146
|
children: A,
|
|
146
|
-
...
|
|
147
|
-
},
|
|
148
|
-
const [
|
|
147
|
+
...y
|
|
148
|
+
}, m) => {
|
|
149
|
+
const [w, g] = v("initial"), [P, B] = v(), { renderer: C } = G(H), I = Y({
|
|
149
150
|
url: e,
|
|
150
|
-
autoplay:
|
|
151
|
-
autopause:
|
|
152
|
-
backgroundMode: o,
|
|
151
|
+
autoplay: a,
|
|
152
|
+
autopause: r,
|
|
153
153
|
showControls: i,
|
|
154
154
|
controlsColor: O,
|
|
155
|
-
doNotTrack:
|
|
155
|
+
doNotTrack: n,
|
|
156
156
|
interactiveParams: V,
|
|
157
|
-
keyboard:
|
|
158
|
-
loop:
|
|
159
|
-
muted:
|
|
160
|
-
pip:
|
|
161
|
-
playsinline:
|
|
157
|
+
keyboard: d,
|
|
158
|
+
loop: c,
|
|
159
|
+
muted: l,
|
|
160
|
+
pip: p,
|
|
161
|
+
playsinline: u,
|
|
162
162
|
quality: L,
|
|
163
163
|
responsive: k,
|
|
164
164
|
speed: E,
|
|
@@ -169,36 +169,37 @@ const K = "https://f.vimeocdn.com", x = "https://player.vimeo.com", b = "https:/
|
|
|
169
169
|
autopip: N
|
|
170
170
|
});
|
|
171
171
|
return /* @__PURE__ */ s(
|
|
172
|
-
|
|
172
|
+
tt.Provider,
|
|
173
173
|
{
|
|
174
174
|
value: {
|
|
175
|
-
status:
|
|
176
|
-
previewImageUrl:
|
|
175
|
+
status: w,
|
|
176
|
+
previewImageUrl: P,
|
|
177
177
|
onInitPlayer() {
|
|
178
|
-
|
|
178
|
+
C !== "canvas" && g("loading");
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
children: /* @__PURE__ */ s(
|
|
182
182
|
"div",
|
|
183
183
|
{
|
|
184
|
-
...
|
|
185
|
-
ref: (
|
|
186
|
-
|
|
184
|
+
...y,
|
|
185
|
+
ref: (x) => {
|
|
186
|
+
m !== null && (typeof m == "function" ? m(x) : m.current = x);
|
|
187
187
|
},
|
|
188
|
-
children:
|
|
188
|
+
children: I === void 0 ? /* @__PURE__ */ s(X, {}) : /* @__PURE__ */ D(F, { children: [
|
|
189
189
|
A,
|
|
190
190
|
/* @__PURE__ */ s(
|
|
191
|
-
|
|
191
|
+
Z,
|
|
192
192
|
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
title: y.title,
|
|
194
|
+
autoplay: a,
|
|
195
|
+
videoUrl: I,
|
|
196
|
+
previewImageUrl: P,
|
|
196
197
|
loading: t,
|
|
197
198
|
showPreview: M,
|
|
198
|
-
renderer:
|
|
199
|
-
status:
|
|
200
|
-
onStatusChange:
|
|
201
|
-
onPreviewImageUrlChange:
|
|
199
|
+
renderer: C,
|
|
200
|
+
status: w,
|
|
201
|
+
onStatusChange: g,
|
|
202
|
+
onPreviewImageUrlChange: B
|
|
202
203
|
}
|
|
203
204
|
)
|
|
204
205
|
] })
|
|
@@ -208,8 +209,8 @@ const K = "https://f.vimeocdn.com", x = "https://player.vimeo.com", b = "https:/
|
|
|
208
209
|
);
|
|
209
210
|
}
|
|
210
211
|
);
|
|
211
|
-
|
|
212
|
+
et.displayName = "Vimeo";
|
|
212
213
|
export {
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
et as Vimeo,
|
|
215
|
+
tt as VimeoContext
|
|
215
216
|
};
|
package/lib/vimeo.template.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import { SpinnerIcon as r, PlayIcon as
|
|
3
|
-
import { $ as e, css as
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { SpinnerIcon as r, PlayIcon as n } from "@webstudio-is/icons/svg";
|
|
3
|
+
import { $ as e, css as o } from "@webstudio-is/template";
|
|
4
4
|
const p = {
|
|
5
5
|
category: "media",
|
|
6
6
|
order: 1,
|
|
@@ -8,32 +8,33 @@ const p = {
|
|
|
8
8
|
template: /* @__PURE__ */ i(
|
|
9
9
|
e.Vimeo,
|
|
10
10
|
{
|
|
11
|
-
"ws:style":
|
|
11
|
+
"ws:style": o`
|
|
12
12
|
position: relative;
|
|
13
13
|
aspect-ratio: 640/360;
|
|
14
14
|
width: 100%;
|
|
15
15
|
`,
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ t(
|
|
18
18
|
e.VimeoPreviewImage,
|
|
19
19
|
{
|
|
20
|
-
"ws:style":
|
|
20
|
+
"ws:style": o`
|
|
21
21
|
position: absolute;
|
|
22
22
|
object-fit: cover;
|
|
23
|
-
object-position:
|
|
23
|
+
object-position: center;
|
|
24
24
|
width: 100%;
|
|
25
25
|
height: 100%;
|
|
26
26
|
border-radius: 20px;
|
|
27
27
|
`,
|
|
28
28
|
alt: "Vimeo video preview image",
|
|
29
|
-
sizes: "100vw"
|
|
29
|
+
sizes: "100vw",
|
|
30
|
+
optimize: !0
|
|
30
31
|
}
|
|
31
32
|
),
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ t(
|
|
33
34
|
e.VimeoSpinner,
|
|
34
35
|
{
|
|
35
36
|
"ws:label": "Spinner",
|
|
36
|
-
"ws:style":
|
|
37
|
+
"ws:style": o`
|
|
37
38
|
position: absolute;
|
|
38
39
|
top: 50%;
|
|
39
40
|
left: 50%;
|
|
@@ -42,13 +43,13 @@ const p = {
|
|
|
42
43
|
margin-top: -35px;
|
|
43
44
|
margin-left: -35px;
|
|
44
45
|
`,
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ t(e.HtmlEmbed, { "ws:label": "Spinner SVG", code: r })
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ t(
|
|
49
50
|
e.VimeoPlayButton,
|
|
50
51
|
{
|
|
51
|
-
"ws:style":
|
|
52
|
+
"ws:style": o`
|
|
52
53
|
position: absolute;
|
|
53
54
|
width: 140px;
|
|
54
55
|
height: 80px;
|
|
@@ -69,16 +70,16 @@ const p = {
|
|
|
69
70
|
}
|
|
70
71
|
`,
|
|
71
72
|
"aria-label": "Play button",
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ t(
|
|
73
74
|
e.Box,
|
|
74
75
|
{
|
|
75
76
|
"ws:label": "Play Icon",
|
|
76
|
-
"ws:style":
|
|
77
|
+
"ws:style": o`
|
|
77
78
|
width: 60px;
|
|
78
79
|
height: 60px;
|
|
79
80
|
`,
|
|
80
81
|
"aria-hidden": !0,
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ t(e.HtmlEmbed, { "ws:label": "Play SVG", code: n })
|
|
82
83
|
}
|
|
83
84
|
)
|
|
84
85
|
}
|
package/lib/vimeo.ws.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { VimeoIcon as o } from "@webstudio-is/icons/svg";
|
|
2
|
-
import { defaultStates as t } from "@webstudio-is/
|
|
2
|
+
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
3
3
|
import { div as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
-
import { props as
|
|
5
|
-
const
|
|
4
|
+
import { props as i } from "./__generated__/vimeo.props.js";
|
|
5
|
+
const n = {
|
|
6
6
|
div: r
|
|
7
7
|
}, c = {
|
|
8
8
|
type: "container",
|
|
9
9
|
icon: o,
|
|
10
10
|
states: t,
|
|
11
|
-
presetStyle:
|
|
11
|
+
presetStyle: n,
|
|
12
12
|
constraints: {
|
|
13
13
|
relation: "ancestor",
|
|
14
14
|
component: { $nin: ["Button", "Link", "Heading"] }
|
|
15
15
|
}
|
|
16
|
-
},
|
|
16
|
+
}, e = [
|
|
17
17
|
"id",
|
|
18
18
|
"className",
|
|
19
19
|
"url",
|
|
20
|
+
"title",
|
|
20
21
|
"quality",
|
|
21
22
|
"loading",
|
|
22
23
|
"showPreview",
|
|
@@ -30,8 +31,8 @@ const i = {
|
|
|
30
31
|
"showControls",
|
|
31
32
|
"controlsColor"
|
|
32
33
|
], m = {
|
|
33
|
-
props:
|
|
34
|
-
initialProps:
|
|
34
|
+
props: i,
|
|
35
|
+
initialProps: e
|
|
35
36
|
};
|
|
36
37
|
export {
|
|
37
38
|
c as meta,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Variable as s, $ as e, expression as o, ActionValue as i, PlaceholderValue as a } from "@webstudio-is/template";
|
|
3
|
+
const n = new s("formState", "initial"), w = {
|
|
4
|
+
category: "data",
|
|
5
|
+
order: 1,
|
|
6
|
+
description: "Collect user data and send it to any webhook.",
|
|
7
|
+
template: /* @__PURE__ */ r(
|
|
8
|
+
e.Form,
|
|
9
|
+
{
|
|
10
|
+
state: o`${n}`,
|
|
11
|
+
onStateChange: new i(["state"], o`${n} = state`),
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ r(
|
|
14
|
+
e.Box,
|
|
15
|
+
{
|
|
16
|
+
"ws:label": "Form Content",
|
|
17
|
+
"ws:show": o`${n} === 'initial' || ${n} === 'error'`,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ t(e.Label, { children: new a("Name") }),
|
|
20
|
+
/* @__PURE__ */ t(e.Input, { name: "name" }),
|
|
21
|
+
/* @__PURE__ */ t(e.Label, { children: new a("Email") }),
|
|
22
|
+
/* @__PURE__ */ t(e.Input, { name: "email" }),
|
|
23
|
+
/* @__PURE__ */ t(e.Button, { children: new a("Submit") })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ t(
|
|
28
|
+
e.Box,
|
|
29
|
+
{
|
|
30
|
+
"ws:label": "Success Message",
|
|
31
|
+
"ws:show": o`${n} === 'success'`,
|
|
32
|
+
children: new a("Thank you for getting in touch!")
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ t(
|
|
36
|
+
e.Box,
|
|
37
|
+
{
|
|
38
|
+
"ws:label": "Error Message",
|
|
39
|
+
"ws:show": o`${n} === 'error'`,
|
|
40
|
+
children: new a("Sorry, something went wrong.")
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
w as meta
|
|
49
|
+
};
|