@webstudio-is/sdk-components-react 0.217.0 → 0.219.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__/blockquote.props.js +2 -512
- package/lib/__generated__/body.props.js +2 -506
- package/lib/__generated__/bold.props.js +2 -506
- package/lib/__generated__/box.props.js +3 -506
- package/lib/__generated__/button.props.js +2 -568
- package/lib/__generated__/checkbox.props.js +1 -662
- package/lib/__generated__/code-text.props.js +1 -504
- package/lib/__generated__/form.props.js +2 -554
- package/lib/__generated__/head-link.props.js +2 -618
- package/lib/__generated__/head-meta.props.js +2 -530
- package/lib/__generated__/head-slot.props.js +4 -0
- package/lib/__generated__/head-title.props.js +2 -506
- package/lib/__generated__/heading.props.js +3 -506
- package/lib/__generated__/html-embed.props.js +6 -1
- package/lib/__generated__/image.props.js +1 -581
- package/lib/__generated__/input.props.js +2 -694
- package/lib/__generated__/italic.props.js +2 -506
- package/lib/__generated__/label.props.js +2 -518
- package/lib/__generated__/link.props.js +4 -555
- package/lib/__generated__/list-item.props.js +2 -512
- package/lib/__generated__/list.props.js +1 -523
- package/lib/__generated__/markdown-embed.props.js +6 -1
- package/lib/__generated__/option.props.js +2 -530
- package/lib/__generated__/paragraph.props.js +2 -506
- package/lib/__generated__/radio-button.props.js +1 -662
- package/lib/__generated__/select.props.js +2 -554
- package/lib/__generated__/separator.props.js +2 -506
- package/lib/__generated__/span.props.js +2 -506
- package/lib/__generated__/subscript.props.js +2 -506
- package/lib/__generated__/superscript.props.js +2 -506
- package/lib/__generated__/text.props.js +3 -506
- package/lib/__generated__/textarea.props.js +2 -585
- package/lib/__generated__/time.props.js +3 -3
- package/lib/__generated__/video.props.js +2 -585
- package/lib/__generated__/vimeo-play-button.props.js +2 -567
- package/lib/__generated__/vimeo-preview-image.props.js +1 -580
- package/lib/__generated__/vimeo-spinner.props.js +2 -506
- package/lib/__generated__/vimeo.props.js +2 -505
- package/lib/__generated__/webhook-form.props.js +1 -557
- package/lib/__generated__/xml-node.props.js +8 -3
- package/lib/__generated__/xml-time.props.js +4 -3
- package/lib/__generated__/youtube.props.js +1 -498
- package/lib/box.ws.js +11 -11
- package/lib/head-slot.js +4 -5
- package/lib/head-slot.ws.js +1 -1
- package/lib/heading.ws.js +7 -7
- package/lib/list.ws.js +3 -3
- package/lib/markdown-embed.js +3 -3
- package/lib/shared/video.js +13 -0
- package/lib/types/link.d.ts +1 -1
- package/lib/types/shared/video.d.ts +7 -0
- package/lib/types/vimeo.d.ts +0 -7
- package/lib/video.js +19 -23
- package/lib/vimeo-play-button.js +4 -4
- package/lib/vimeo-preview-image.js +5 -5
- package/lib/vimeo-spinner.js +1 -1
- package/lib/vimeo.js +113 -121
- package/lib/webhook-form.template.js +12 -12
- package/lib/xml-node.js +4 -4
- package/lib/youtube.js +1 -1
- package/package.json +8 -8
- package/lib/__generated__/head.props.js +0 -508
- package/lib/types/__generated__/head.props.d.ts +0 -2
package/lib/list.ws.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ListIcon as e } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
3
|
-
import {
|
|
3
|
+
import { ul as r, ol as o } from "@webstudio-is/sdk/normalize.css";
|
|
4
4
|
import { props as p } from "./__generated__/list.props.js";
|
|
5
5
|
const a = {
|
|
6
6
|
ol: [
|
|
7
|
-
...
|
|
7
|
+
...o,
|
|
8
8
|
{
|
|
9
9
|
property: "margin-top",
|
|
10
10
|
value: { type: "keyword", value: "0" }
|
|
@@ -19,7 +19,7 @@ const a = {
|
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
ul: [
|
|
22
|
-
...
|
|
22
|
+
...r,
|
|
23
23
|
{
|
|
24
24
|
property: "margin-top",
|
|
25
25
|
value: { type: "keyword", value: "0" }
|
package/lib/markdown-embed.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { micromark as s } from "micromark";
|
|
3
|
-
import {
|
|
3
|
+
import { gfmTableHtml as l, gfmTable as i } from "micromark-extension-gfm-table";
|
|
4
4
|
import { forwardRef as a, useMemo as f } from "react";
|
|
5
5
|
const h = /* @__PURE__ */ a((r, e) => {
|
|
6
6
|
const { code: o, children: c, ...t } = r, m = f(
|
|
7
7
|
// support data uri protocol in images
|
|
8
8
|
() => s(o ?? "", {
|
|
9
9
|
allowDangerousProtocol: !0,
|
|
10
|
-
extensions: [
|
|
11
|
-
htmlExtensions: [
|
|
10
|
+
extensions: [i()],
|
|
11
|
+
htmlExtensions: [l()]
|
|
12
12
|
}),
|
|
13
13
|
[o]
|
|
14
14
|
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext as o } from "react";
|
|
2
|
+
const s = (t) => {
|
|
3
|
+
const e = "ontouchstart" in window;
|
|
4
|
+
(window.matchMedia("(max-width: 1024px)").matches || e) && t.requestFullscreen();
|
|
5
|
+
}, c = o({
|
|
6
|
+
onInitPlayer: () => {
|
|
7
|
+
},
|
|
8
|
+
status: "initial"
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
c as VideoContext,
|
|
12
|
+
s as requestFullscreen
|
|
13
|
+
};
|
package/lib/types/link.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const defaultTag = "a";
|
|
2
|
-
export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "
|
|
2
|
+
export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target" | "download"> & {
|
|
3
3
|
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
4
4
|
download?: boolean;
|
|
5
5
|
prefetch?: "none" | "intent" | "render" | "viewport";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const requestFullscreen: (element: HTMLIFrameElement) => void;
|
|
2
|
+
export type PlayerStatus = "initial" | "loading" | "ready";
|
|
3
|
+
export declare const VideoContext: import("react").Context<{
|
|
4
|
+
previewImageUrl?: URL;
|
|
5
|
+
onInitPlayer: () => void;
|
|
6
|
+
status: PlayerStatus;
|
|
7
|
+
}>;
|
package/lib/types/vimeo.d.ts
CHANGED
|
@@ -66,13 +66,6 @@ export type VimeoOptions = Omit<VimeoPlayerOptions, "dnt" | "interactive_params"
|
|
|
66
66
|
/** Whether to display the video owner's portrait. Only works if either title or byline are also enabled */
|
|
67
67
|
showPortrait?: VimeoPlayerOptions["portrait"];
|
|
68
68
|
};
|
|
69
|
-
export declare const requestFullscreen: (element: HTMLIFrameElement) => void;
|
|
70
|
-
type PlayerStatus = "initial" | "loading" | "ready";
|
|
71
|
-
export declare const VimeoContext: import("react").Context<{
|
|
72
|
-
previewImageUrl?: URL;
|
|
73
|
-
onInitPlayer: () => void;
|
|
74
|
-
status: PlayerStatus;
|
|
75
|
-
}>;
|
|
76
69
|
declare const defaultTag = "div";
|
|
77
70
|
type Props = Omit<ComponentProps<typeof defaultTag>, keyof VimeoOptions> & VimeoOptions & {
|
|
78
71
|
/**
|
package/lib/video.js
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { ReactSdkContext as
|
|
4
|
-
const c = "data-ws-video-id",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
HAVE_CURRENT_DATA: 2,
|
|
8
|
-
HAVE_FUTURE_DATA: 3,
|
|
9
|
-
HAVE_ENOUGH_DATA: 4
|
|
10
|
-
}, I = H(
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as V, useId as N, useContext as h, useEffect as x } from "react";
|
|
3
|
+
import { ReactSdkContext as I } from "@webstudio-is/react-sdk/runtime";
|
|
4
|
+
const c = "data-ws-video-id", S = {
|
|
5
|
+
HAVE_METADATA: 1
|
|
6
|
+
}, _ = V(
|
|
11
7
|
({
|
|
12
8
|
$progress: n,
|
|
13
9
|
$visible: r,
|
|
14
10
|
$timeline: f,
|
|
15
|
-
$webstudio$canvasOnly$assetId:
|
|
11
|
+
$webstudio$canvasOnly$assetId: p,
|
|
16
12
|
children: l,
|
|
17
13
|
src: s,
|
|
18
|
-
...
|
|
19
|
-
},
|
|
20
|
-
const a = N(),
|
|
14
|
+
...b
|
|
15
|
+
}, m) => {
|
|
16
|
+
const a = N(), A = {
|
|
21
17
|
[c]: a
|
|
22
|
-
}, { assetBaseUrl: d } =
|
|
23
|
-
return
|
|
18
|
+
}, { assetBaseUrl: d } = h(I), T = s != null && s.startsWith(d) ? `/cgi/video/${s.slice(d.length)}` : s;
|
|
19
|
+
return x(() => {
|
|
24
20
|
if (n === void 0 || r === void 0)
|
|
25
21
|
return;
|
|
26
22
|
const e = document.querySelector(`[${c}="${a}"]`);
|
|
@@ -29,15 +25,15 @@ const c = "data-ws-video-id", R = {
|
|
|
29
25
|
if (e.play().catch(() => {
|
|
30
26
|
}), e.pause(), f)
|
|
31
27
|
return n.subscribe((t) => {
|
|
32
|
-
if (e.readyState <
|
|
28
|
+
if (e.readyState < S.HAVE_METADATA || (e.paused || e.pause(), e.seeking))
|
|
33
29
|
return;
|
|
34
30
|
let u = e.duration;
|
|
35
31
|
Number.isNaN(u) || (Number.isFinite(u) || (u = 60), e.currentTime = (t ?? 0) * u);
|
|
36
32
|
});
|
|
37
33
|
let i = !1, o = !1;
|
|
38
|
-
const
|
|
34
|
+
const v = r.subscribe((t) => {
|
|
39
35
|
o = t, o === !1 && i === !1 && !e.loop && (e.currentTime = 0);
|
|
40
|
-
}),
|
|
36
|
+
}), E = n.subscribe((t) => {
|
|
41
37
|
if (i && (t === void 0 || t === 0 || t === 1)) {
|
|
42
38
|
i = !1, e.pause(), o === !1 && i === !1 && !e.loop && (e.currentTime = 0);
|
|
43
39
|
return;
|
|
@@ -46,12 +42,12 @@ const c = "data-ws-video-id", R = {
|
|
|
46
42
|
}));
|
|
47
43
|
});
|
|
48
44
|
return () => {
|
|
49
|
-
|
|
45
|
+
E(), v();
|
|
50
46
|
};
|
|
51
|
-
}, [n, f, r, a]), /* @__PURE__ */
|
|
47
|
+
}, [n, f, r, a]), /* @__PURE__ */ y("video", { src: T, ...b, ...A, ref: m, children: l });
|
|
52
48
|
}
|
|
53
49
|
);
|
|
54
|
-
|
|
50
|
+
_.displayName = "Video";
|
|
55
51
|
export {
|
|
56
|
-
|
|
52
|
+
_ as Video
|
|
57
53
|
};
|
package/lib/vimeo-play-button.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as r, useContext as a, useCallback as m } from "react";
|
|
3
|
-
import
|
|
3
|
+
import s from "await-interaction-response";
|
|
4
4
|
import { Button as l } from "./button.js";
|
|
5
|
-
import c from "
|
|
5
|
+
import { VideoContext as c } from "./shared/video.js";
|
|
6
6
|
const f = r(
|
|
7
7
|
(o, i) => {
|
|
8
|
-
const t = a(
|
|
9
|
-
await
|
|
8
|
+
const t = a(c), n = m(async () => {
|
|
9
|
+
await s(), t.onInitPlayer();
|
|
10
10
|
}, [t]);
|
|
11
11
|
if (t.status === "initial")
|
|
12
12
|
return /* @__PURE__ */ e(l, { ...o, onClick: n, ref: i });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m, useContext as t } from "react";
|
|
3
3
|
import { Image as a } from "./image.js";
|
|
4
|
-
import {
|
|
5
|
-
const n = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=", s =
|
|
4
|
+
import { VideoContext as g } from "./shared/video.js";
|
|
5
|
+
const n = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=", s = m(({ src: A, ...e }, o) => {
|
|
6
6
|
const r = t(g);
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ i(
|
|
8
8
|
a,
|
|
9
9
|
{
|
|
10
10
|
...e,
|
package/lib/vimeo-spinner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as r, useContext as i } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { VideoContext as n } from "./shared/video.js";
|
|
4
4
|
const m = r(
|
|
5
5
|
(o, t) => {
|
|
6
6
|
if (i(n).status === "loading")
|
package/lib/vimeo.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { colord as
|
|
3
|
-
import {
|
|
4
|
-
import { ReactSdkContext as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as i, jsxs as B, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { colord as q } from "colord";
|
|
3
|
+
import { forwardRef as z, useState as y, useContext as T, useRef as G, useEffect as v } from "react";
|
|
4
|
+
import { ReactSdkContext as H } from "@webstudio-is/react-sdk/runtime";
|
|
5
|
+
import { VideoContext as Y, requestFullscreen as J } from "./shared/video.js";
|
|
6
|
+
const K = (t) => {
|
|
7
|
+
if (t.url === void 0)
|
|
7
8
|
return;
|
|
8
|
-
let
|
|
9
|
+
let e;
|
|
9
10
|
try {
|
|
10
|
-
const
|
|
11
|
-
|
|
11
|
+
const o = new URL(t.url);
|
|
12
|
+
e = new URL(S), e.pathname = `/video${o.pathname}`;
|
|
12
13
|
} catch {
|
|
13
14
|
}
|
|
14
|
-
if (
|
|
15
|
+
if (e === void 0)
|
|
15
16
|
return;
|
|
16
|
-
const
|
|
17
|
+
const a = {
|
|
17
18
|
showPortrait: "portrait",
|
|
18
19
|
showByline: "byline",
|
|
19
20
|
showTitle: "title",
|
|
@@ -23,36 +24,36 @@ const J = (e) => {
|
|
|
23
24
|
backgroundMode: "background",
|
|
24
25
|
doNotTrack: "dnt"
|
|
25
26
|
};
|
|
26
|
-
let
|
|
27
|
-
for (
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
27
|
+
let r;
|
|
28
|
+
for (r in t) {
|
|
29
|
+
const o = t[r];
|
|
30
|
+
if (r === "url" || o === void 0)
|
|
30
31
|
continue;
|
|
31
|
-
const
|
|
32
|
-
|
|
32
|
+
const s = a[r] ?? r;
|
|
33
|
+
e.searchParams.append(s, o.toString());
|
|
33
34
|
}
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
if (e.searchParams.set("autoplay", "true"), typeof t.controlsColor == "string") {
|
|
36
|
+
const o = q(t.controlsColor).toHex().replace("#", "");
|
|
37
|
+
e.searchParams.set("color", o);
|
|
37
38
|
}
|
|
38
|
-
return
|
|
39
|
-
}, w = (
|
|
40
|
-
const
|
|
41
|
-
|
|
39
|
+
return t.showPortrait && e.searchParams.set("title", "true"), t.showByline && (e.searchParams.set("portrait", "true"), e.searchParams.set("title", "true")), e.toString();
|
|
40
|
+
}, w = (t) => {
|
|
41
|
+
const e = document.createElement("link");
|
|
42
|
+
e.rel = "preconnect", e.href = t, e.crossOrigin = "true", document.head.appendChild(e);
|
|
42
43
|
};
|
|
43
44
|
let U = !1;
|
|
44
|
-
const
|
|
45
|
-
U || window.matchMedia("(hover: none)").matches || (w(
|
|
46
|
-
},
|
|
45
|
+
const Q = "https://f.vimeocdn.com", S = "https://player.vimeo.com", L = "https://i.vimeocdn.com", W = () => {
|
|
46
|
+
U || window.matchMedia("(hover: none)").matches || (w(Q), w(S), w(L), U = !0);
|
|
47
|
+
}, X = (t) => {
|
|
47
48
|
try {
|
|
48
|
-
const
|
|
49
|
-
return
|
|
49
|
+
const a = new URL(t).pathname.split("/")[2];
|
|
50
|
+
return a === "" || a == null ? void 0 : a;
|
|
50
51
|
} catch {
|
|
51
52
|
}
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
},
|
|
53
|
+
}, Z = async (t) => {
|
|
54
|
+
const a = `https://vimeo.com/api/v2/video/${X(t)}.json`, o = (await (await fetch(a)).json())[0].thumbnail_large, s = o.substr(o.lastIndexOf("/") + 1).split("_")[0], n = new URL(L);
|
|
55
|
+
return n.pathname = `/video/${s}.webp`, n.searchParams.append("mw", "1100"), n.searchParams.append("mh", "619"), n.searchParams.append("q", "70"), n;
|
|
56
|
+
}, ee = () => /* @__PURE__ */ i(
|
|
56
57
|
"div",
|
|
57
58
|
{
|
|
58
59
|
style: {
|
|
@@ -65,147 +66,140 @@ const K = "https://f.vimeocdn.com", M = "https://player.vimeo.com", S = "https:/
|
|
|
65
66
|
},
|
|
66
67
|
children: 'Open the "Settings" panel and paste a video URL, e.g. https://vimeo.com/831343124.'
|
|
67
68
|
}
|
|
68
|
-
),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
autoplay: i,
|
|
78
|
-
renderer: a,
|
|
79
|
-
showPreview: u,
|
|
69
|
+
), te = ({
|
|
70
|
+
title: t,
|
|
71
|
+
status: e,
|
|
72
|
+
loading: a,
|
|
73
|
+
videoUrl: r,
|
|
74
|
+
previewImageUrl: o,
|
|
75
|
+
autoplay: s,
|
|
76
|
+
renderer: n,
|
|
77
|
+
showPreview: m,
|
|
80
78
|
playsinline: f,
|
|
81
79
|
onStatusChange: c,
|
|
82
80
|
onPreviewImageUrlChange: l
|
|
83
81
|
}) => {
|
|
84
|
-
const [
|
|
82
|
+
const [u, h] = y(0), d = G(null);
|
|
85
83
|
if (v(() => {
|
|
86
|
-
|
|
87
|
-
}, [
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
if (
|
|
91
|
-
if (
|
|
84
|
+
s && n !== "canvas" && e === "initial" && c("loading");
|
|
85
|
+
}, [s, e, n, c]), v(() => {
|
|
86
|
+
n !== "canvas" && W();
|
|
87
|
+
}, [n]), v(() => {
|
|
88
|
+
if (r !== void 0) {
|
|
89
|
+
if (m === !1) {
|
|
92
90
|
l(void 0);
|
|
93
91
|
return;
|
|
94
92
|
}
|
|
95
|
-
|
|
96
|
-
console.error(`Could not load preview image for ${
|
|
93
|
+
o === void 0 && Z(r).then(l).catch(() => {
|
|
94
|
+
console.error(`Could not load preview image for ${r}`);
|
|
97
95
|
});
|
|
98
96
|
}
|
|
99
|
-
}, [l,
|
|
100
|
-
return /* @__PURE__ */
|
|
97
|
+
}, [l, m, r, o]), !(n === "canvas" || e === "initial"))
|
|
98
|
+
return /* @__PURE__ */ i(
|
|
101
99
|
"iframe",
|
|
102
100
|
{
|
|
103
101
|
ref: d,
|
|
104
|
-
title:
|
|
105
|
-
src:
|
|
106
|
-
loading:
|
|
102
|
+
title: t,
|
|
103
|
+
src: r,
|
|
104
|
+
loading: a,
|
|
107
105
|
allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture;",
|
|
108
106
|
allowFullScreen: !0,
|
|
109
107
|
style: {
|
|
110
108
|
position: "absolute",
|
|
111
109
|
width: "100%",
|
|
112
110
|
height: "100%",
|
|
113
|
-
opacity:
|
|
111
|
+
opacity: u,
|
|
114
112
|
transition: "opacity 1s",
|
|
115
113
|
border: "none"
|
|
116
114
|
},
|
|
117
115
|
onLoad: () => {
|
|
118
|
-
c("ready"), h(1), d.current && !f && !
|
|
116
|
+
c("ready"), h(1), d.current && !f && !s && J(d.current);
|
|
119
117
|
}
|
|
120
118
|
}
|
|
121
119
|
);
|
|
122
|
-
},
|
|
123
|
-
onInitPlayer: () => {
|
|
124
|
-
},
|
|
125
|
-
status: "initial"
|
|
126
|
-
}), rt = z(
|
|
120
|
+
}, re = z(
|
|
127
121
|
({
|
|
128
|
-
url:
|
|
129
|
-
loading:
|
|
130
|
-
autoplay:
|
|
131
|
-
autopause:
|
|
132
|
-
showByline:
|
|
133
|
-
showControls:
|
|
134
|
-
doNotTrack:
|
|
135
|
-
keyboard:
|
|
122
|
+
url: t,
|
|
123
|
+
loading: e = "lazy",
|
|
124
|
+
autoplay: a = !1,
|
|
125
|
+
autopause: r = !0,
|
|
126
|
+
showByline: o = !1,
|
|
127
|
+
showControls: s = !0,
|
|
128
|
+
doNotTrack: n = !1,
|
|
129
|
+
keyboard: m = !0,
|
|
136
130
|
loop: f = !1,
|
|
137
131
|
muted: c = !1,
|
|
138
132
|
pip: l = !1,
|
|
139
|
-
playsinline:
|
|
133
|
+
playsinline: u = !1,
|
|
140
134
|
showPortrait: h = !0,
|
|
141
135
|
quality: d = "auto",
|
|
142
|
-
responsive:
|
|
143
|
-
speed:
|
|
144
|
-
showTitle:
|
|
145
|
-
transparent:
|
|
146
|
-
showPreview:
|
|
147
|
-
autopip:
|
|
148
|
-
controlsColor:
|
|
149
|
-
interactiveParams:
|
|
150
|
-
texttrack:
|
|
151
|
-
children:
|
|
136
|
+
responsive: k = !0,
|
|
137
|
+
speed: E = !1,
|
|
138
|
+
showTitle: _ = !1,
|
|
139
|
+
transparent: j = !0,
|
|
140
|
+
showPreview: M = !1,
|
|
141
|
+
autopip: N,
|
|
142
|
+
controlsColor: O,
|
|
143
|
+
interactiveParams: V,
|
|
144
|
+
texttrack: F,
|
|
145
|
+
children: $,
|
|
152
146
|
...g
|
|
153
147
|
}, p) => {
|
|
154
|
-
const [P, C] = y("initial"), [
|
|
155
|
-
url:
|
|
156
|
-
autoplay:
|
|
157
|
-
autopause:
|
|
158
|
-
showControls:
|
|
159
|
-
controlsColor:
|
|
160
|
-
doNotTrack:
|
|
161
|
-
interactiveParams:
|
|
162
|
-
keyboard:
|
|
148
|
+
const [P, C] = y("initial"), [I, A] = y(), { renderer: R } = T(H), b = K({
|
|
149
|
+
url: t,
|
|
150
|
+
autoplay: a,
|
|
151
|
+
autopause: r,
|
|
152
|
+
showControls: s,
|
|
153
|
+
controlsColor: O,
|
|
154
|
+
doNotTrack: n,
|
|
155
|
+
interactiveParams: V,
|
|
156
|
+
keyboard: m,
|
|
163
157
|
loop: f,
|
|
164
158
|
muted: c,
|
|
165
159
|
pip: l,
|
|
166
|
-
playsinline:
|
|
160
|
+
playsinline: u,
|
|
167
161
|
quality: d,
|
|
168
|
-
responsive:
|
|
169
|
-
speed:
|
|
170
|
-
texttrack:
|
|
171
|
-
showTitle:
|
|
172
|
-
transparent:
|
|
162
|
+
responsive: k,
|
|
163
|
+
speed: E,
|
|
164
|
+
texttrack: F,
|
|
165
|
+
showTitle: _,
|
|
166
|
+
transparent: j,
|
|
173
167
|
showPortrait: h,
|
|
174
|
-
autopip:
|
|
168
|
+
autopip: N
|
|
175
169
|
});
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
|
|
170
|
+
return /* @__PURE__ */ i(
|
|
171
|
+
Y.Provider,
|
|
178
172
|
{
|
|
179
173
|
value: {
|
|
180
174
|
status: P,
|
|
181
|
-
previewImageUrl:
|
|
175
|
+
previewImageUrl: I,
|
|
182
176
|
onInitPlayer() {
|
|
183
177
|
R !== "canvas" && C("loading");
|
|
184
178
|
}
|
|
185
179
|
},
|
|
186
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ i(
|
|
187
181
|
"div",
|
|
188
182
|
{
|
|
189
183
|
...g,
|
|
190
|
-
ref: (
|
|
191
|
-
p !== null && (typeof p == "function" ? p(
|
|
184
|
+
ref: (x) => {
|
|
185
|
+
p !== null && (typeof p == "function" ? p(x) : p.current = x);
|
|
192
186
|
},
|
|
193
|
-
children: b === void 0 ? /* @__PURE__ */
|
|
194
|
-
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
|
|
187
|
+
children: b === void 0 ? /* @__PURE__ */ i(ee, {}) : /* @__PURE__ */ B(D, { children: [
|
|
188
|
+
$,
|
|
189
|
+
/* @__PURE__ */ i(
|
|
190
|
+
te,
|
|
197
191
|
{
|
|
198
192
|
title: g.title,
|
|
199
|
-
autoplay:
|
|
200
|
-
playsinline:
|
|
193
|
+
autoplay: a,
|
|
194
|
+
playsinline: u,
|
|
201
195
|
videoUrl: b,
|
|
202
|
-
previewImageUrl:
|
|
203
|
-
loading:
|
|
204
|
-
showPreview:
|
|
196
|
+
previewImageUrl: I,
|
|
197
|
+
loading: e,
|
|
198
|
+
showPreview: M,
|
|
205
199
|
renderer: R,
|
|
206
200
|
status: P,
|
|
207
201
|
onStatusChange: C,
|
|
208
|
-
onPreviewImageUrlChange:
|
|
202
|
+
onPreviewImageUrlChange: A
|
|
209
203
|
}
|
|
210
204
|
)
|
|
211
205
|
] })
|
|
@@ -215,9 +209,7 @@ const K = "https://f.vimeocdn.com", M = "https://player.vimeo.com", S = "https:/
|
|
|
215
209
|
);
|
|
216
210
|
}
|
|
217
211
|
);
|
|
218
|
-
|
|
212
|
+
re.displayName = "Vimeo";
|
|
219
213
|
export {
|
|
220
|
-
|
|
221
|
-
ot as VimeoContext,
|
|
222
|
-
tt as requestFullscreen
|
|
214
|
+
re as Vimeo
|
|
223
215
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
const n = new
|
|
2
|
+
import { $ as e, ActionValue as s, PlaceholderValue as o, Variable as i, expression as a } from "@webstudio-is/template";
|
|
3
|
+
const n = new i("formState", "initial"), w = {
|
|
4
4
|
category: "data",
|
|
5
5
|
order: 1,
|
|
6
6
|
description: "Collect user data and send it to any webhook.",
|
|
7
7
|
template: /* @__PURE__ */ r(
|
|
8
8
|
e.Form,
|
|
9
9
|
{
|
|
10
|
-
state:
|
|
11
|
-
onStateChange: new
|
|
10
|
+
state: a`${n}`,
|
|
11
|
+
onStateChange: new s(["state"], a`${n} = state`),
|
|
12
12
|
children: [
|
|
13
13
|
/* @__PURE__ */ r(
|
|
14
14
|
e.Box,
|
|
15
15
|
{
|
|
16
16
|
"ws:label": "Form Content",
|
|
17
|
-
"ws:show":
|
|
17
|
+
"ws:show": a`${n} === 'initial' || ${n} === 'error'`,
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */ t(e.Label, { children: new
|
|
19
|
+
/* @__PURE__ */ t(e.Label, { children: new o("Name") }),
|
|
20
20
|
/* @__PURE__ */ t(e.Input, { name: "name" }),
|
|
21
|
-
/* @__PURE__ */ t(e.Label, { children: new
|
|
21
|
+
/* @__PURE__ */ t(e.Label, { children: new o("Email") }),
|
|
22
22
|
/* @__PURE__ */ t(e.Input, { name: "email" }),
|
|
23
|
-
/* @__PURE__ */ t(e.Button, { children: new
|
|
23
|
+
/* @__PURE__ */ t(e.Button, { children: new o("Submit") })
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
),
|
|
@@ -28,16 +28,16 @@ const n = new s("formState", "initial"), w = {
|
|
|
28
28
|
e.Box,
|
|
29
29
|
{
|
|
30
30
|
"ws:label": "Success Message",
|
|
31
|
-
"ws:show":
|
|
32
|
-
children: new
|
|
31
|
+
"ws:show": a`${n} === 'success'`,
|
|
32
|
+
children: new o("Thank you for getting in touch!")
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
35
|
/* @__PURE__ */ t(
|
|
36
36
|
e.Box,
|
|
37
37
|
{
|
|
38
38
|
"ws:label": "Error Message",
|
|
39
|
-
"ws:show":
|
|
40
|
-
children: new
|
|
39
|
+
"ws:show": a`${n} === 'error'`,
|
|
40
|
+
children: new o("Sorry, something went wrong.")
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
]
|
package/lib/xml-node.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r, Fragment as u } from "react/jsx-runtime";
|
|
2
2
|
import { ReactSdkContext as g, xmlNodeTagSuffix as x } from "@webstudio-is/react-sdk/runtime";
|
|
3
|
-
import { forwardRef as b, useContext as
|
|
3
|
+
import { forwardRef as b, useContext as C, createElement as N, Children as F } from "react";
|
|
4
4
|
const j = b(
|
|
5
5
|
({ tag: c = "", children: l, ...i }, d) => {
|
|
6
|
-
const { renderer: p } =
|
|
6
|
+
const { renderer: p } = C(g), o = Object.entries(i).filter(
|
|
7
7
|
([e]) => e.startsWith("data-") === !1 && e.startsWith("aria-") === !1
|
|
8
8
|
).filter(([e]) => e.toLowerCase() !== "tabindex").filter(([, e]) => typeof e != "function"), s = c.replace(/^[^\p{L}_]+/u, "").replaceAll(/[^\p{L}\p{N}\-._:]+/gu, "").trim();
|
|
9
9
|
if (p === void 0) {
|
|
10
10
|
const e = Object.fromEntries(o);
|
|
11
|
-
return
|
|
11
|
+
return N(
|
|
12
12
|
`${s}${x}`,
|
|
13
13
|
e,
|
|
14
14
|
l
|
|
@@ -24,7 +24,7 @@ const j = b(
|
|
|
24
24
|
'"'
|
|
25
25
|
] })
|
|
26
26
|
] }, y));
|
|
27
|
-
return /* @__PURE__ */ t("div", { ...i, children: [
|
|
27
|
+
return /* @__PURE__ */ t("div", { ...i, style: { backgroundColor: "rgba(255,255,255,1)" }, children: [
|
|
28
28
|
/* @__PURE__ */ t("span", { children: [
|
|
29
29
|
/* @__PURE__ */ t("span", { style: { color: "#800000" }, children: [
|
|
30
30
|
"<",
|
package/lib/youtube.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as u, jsxs as E, Fragment as O } from "react/jsx-runtime";
|
|
2
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
|
-
import {
|
|
4
|
+
import { VideoContext as N, requestFullscreen as P } from "./shared/video.js";
|
|
5
5
|
const U = "https://www.youtube-nocookie.com", V = "https://www.youtube.com", j = "https://img.youtube.com", L = (e) => {
|
|
6
6
|
if (e)
|
|
7
7
|
try {
|