@webstudio-is/sdk-components-react 0.218.0 → 0.220.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 -178
- package/lib/__generated__/body.props.js +2 -172
- package/lib/__generated__/bold.props.js +2 -172
- package/lib/__generated__/box.props.js +3 -172
- package/lib/__generated__/button.props.js +2 -234
- package/lib/__generated__/checkbox.props.js +1 -328
- package/lib/__generated__/code-text.props.js +1 -170
- package/lib/__generated__/form.props.js +2 -220
- package/lib/__generated__/head-link.props.js +2 -284
- package/lib/__generated__/head-meta.props.js +2 -196
- package/lib/__generated__/head-title.props.js +2 -172
- package/lib/__generated__/heading.props.js +3 -172
- package/lib/__generated__/html-embed.props.js +6 -1
- package/lib/__generated__/image.props.js +1 -247
- package/lib/__generated__/input.props.js +2 -360
- package/lib/__generated__/italic.props.js +2 -172
- package/lib/__generated__/label.props.js +2 -184
- package/lib/__generated__/link.props.js +4 -221
- package/lib/__generated__/list-item.props.js +2 -178
- package/lib/__generated__/list.props.js +1 -189
- package/lib/__generated__/markdown-embed.props.js +6 -1
- package/lib/__generated__/option.props.js +2 -196
- package/lib/__generated__/paragraph.props.js +2 -172
- package/lib/__generated__/radio-button.props.js +1 -328
- package/lib/__generated__/select.props.js +2 -220
- package/lib/__generated__/separator.props.js +2 -172
- package/lib/__generated__/span.props.js +2 -172
- package/lib/__generated__/subscript.props.js +2 -172
- package/lib/__generated__/superscript.props.js +2 -172
- package/lib/__generated__/text.props.js +3 -172
- package/lib/__generated__/textarea.props.js +2 -251
- package/lib/__generated__/time.props.js +1 -8
- package/lib/__generated__/video.props.js +2 -251
- package/lib/__generated__/vimeo-play-button.props.js +2 -233
- package/lib/__generated__/vimeo-preview-image.props.js +1 -246
- package/lib/__generated__/vimeo-spinner.props.js +2 -172
- package/lib/__generated__/vimeo.props.js +118 -365
- package/lib/__generated__/webhook-form.props.js +1 -223
- 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 -164
- package/lib/blockquote.ws.js +9 -14
- package/lib/body.ws.js +11 -15
- package/lib/bold.ws.js +6 -12
- package/lib/box.ws.js +17 -21
- package/lib/button.ws.js +10 -14
- package/lib/checkbox.ws.js +4 -6
- package/lib/code-text.ws.js +5 -7
- package/lib/form.ws.js +9 -13
- package/lib/fragment.ws.js +2 -7
- package/lib/head-link.ws.js +6 -9
- package/lib/head-meta.ws.js +5 -8
- package/lib/head-slot.js +4 -5
- package/lib/head-slot.ws.js +3 -7
- package/lib/head-title.ws.js +2 -4
- package/lib/heading.ws.js +16 -21
- package/lib/html-embed.ws.js +5 -7
- package/lib/image.ws.js +22 -26
- package/lib/input.ws.js +11 -15
- package/lib/italic.ws.js +9 -13
- package/lib/label.ws.js +8 -12
- package/lib/link.ws.js +13 -18
- package/lib/list-item.ws.js +8 -15
- package/lib/list.ws.js +10 -14
- package/lib/markdown-embed.js +3 -3
- package/lib/markdown-embed.ws.js +6 -8
- package/lib/option.ws.js +6 -10
- package/lib/paragraph.ws.js +9 -16
- package/lib/radio-button.ws.js +6 -8
- package/lib/rich-text-link.ws.js +3 -4
- package/lib/select.ws.js +13 -17
- package/lib/separator.ws.js +10 -14
- package/lib/shared/video.js +13 -0
- package/lib/slot.ws.js +4 -7
- package/lib/span.ws.js +5 -9
- package/lib/subscript.ws.js +7 -13
- package/lib/superscript.ws.js +8 -14
- package/lib/text.ws.js +10 -12
- package/lib/textarea.ws.js +14 -18
- package/lib/time.js +2 -1
- package/lib/time.ws.js +15 -15
- package/lib/types/blockquote.ws.d.ts +1 -2
- package/lib/types/body.ws.d.ts +1 -2
- package/lib/types/bold.ws.d.ts +1 -2
- package/lib/types/box.ws.d.ts +1 -2
- package/lib/types/button.ws.d.ts +1 -2
- package/lib/types/checkbox.ws.d.ts +1 -2
- package/lib/types/code-text.ws.d.ts +1 -2
- package/lib/types/form.ws.d.ts +1 -2
- package/lib/types/fragment.ws.d.ts +1 -2
- package/lib/types/head-link.ws.d.ts +1 -2
- package/lib/types/head-meta.ws.d.ts +1 -2
- package/lib/types/head-slot.ws.d.ts +1 -2
- package/lib/types/head-title.ws.d.ts +1 -2
- package/lib/types/heading.ws.d.ts +1 -2
- package/lib/types/html-embed.ws.d.ts +1 -2
- package/lib/types/image.ws.d.ts +1 -2
- package/lib/types/input.ws.d.ts +1 -2
- package/lib/types/italic.ws.d.ts +1 -2
- package/lib/types/label.ws.d.ts +1 -2
- package/lib/types/link.d.ts +1 -1
- package/lib/types/link.ws.d.ts +1 -2
- package/lib/types/list-item.ws.d.ts +1 -2
- package/lib/types/list.ws.d.ts +1 -2
- package/lib/types/markdown-embed.ws.d.ts +1 -2
- package/lib/types/option.ws.d.ts +1 -2
- package/lib/types/paragraph.ws.d.ts +1 -2
- package/lib/types/radio-button.ws.d.ts +1 -2
- package/lib/types/rich-text-link.ws.d.ts +1 -2
- package/lib/types/select.ws.d.ts +1 -2
- package/lib/types/separator.ws.d.ts +1 -2
- package/lib/types/shared/video.d.ts +7 -0
- package/lib/types/slot.ws.d.ts +1 -2
- package/lib/types/span.ws.d.ts +1 -2
- package/lib/types/subscript.ws.d.ts +1 -2
- package/lib/types/superscript.ws.d.ts +1 -2
- package/lib/types/text.ws.d.ts +1 -2
- package/lib/types/textarea.ws.d.ts +1 -2
- package/lib/types/time.d.ts +2 -4
- package/lib/types/time.ws.d.ts +1 -2
- package/lib/types/video.ws.d.ts +1 -2
- package/lib/types/vimeo-play-button.ws.d.ts +1 -2
- package/lib/types/vimeo-preview-image.ws.d.ts +1 -2
- package/lib/types/vimeo-spinner.ws.d.ts +1 -2
- package/lib/types/vimeo.d.ts +0 -7
- package/lib/types/vimeo.ws.d.ts +1 -2
- package/lib/types/webhook-form.ws.d.ts +1 -2
- package/lib/types/xml-node.ws.d.ts +1 -2
- package/lib/types/xml-time.ws.d.ts +1 -2
- package/lib/types/youtube.ws.d.ts +1 -2
- package/lib/video.js +19 -23
- package/lib/video.ws.js +14 -17
- package/lib/vimeo-play-button.js +4 -4
- package/lib/vimeo-play-button.ws.js +4 -8
- package/lib/vimeo-preview-image.js +5 -5
- package/lib/vimeo-preview-image.ws.js +6 -8
- package/lib/vimeo-spinner.js +1 -1
- package/lib/vimeo-spinner.ws.js +4 -8
- package/lib/vimeo.js +113 -121
- package/lib/vimeo.ws.js +13 -17
- package/lib/webhook-form.template.js +12 -12
- package/lib/webhook-form.ws.js +4 -6
- package/lib/xml-node.js +4 -4
- package/lib/xml-node.ws.js +5 -7
- package/lib/xml-time.ws.js +5 -7
- package/lib/youtube.js +1 -1
- package/lib/youtube.ws.js +13 -17
- package/package.json +9 -14
- package/lib/props.js +0 -92
- package/lib/types/props.d.ts +0 -45
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
|
};
|
package/lib/vimeo.ws.js
CHANGED
|
@@ -2,18 +2,7 @@ import { VimeoIcon as o } from "@webstudio-is/icons/svg";
|
|
|
2
2
|
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
3
3
|
import { div as e } from "@webstudio-is/sdk/normalize.css";
|
|
4
4
|
import { props as i } from "./__generated__/vimeo.props.js";
|
|
5
|
-
const
|
|
6
|
-
icon: o,
|
|
7
|
-
states: t,
|
|
8
|
-
contentModel: {
|
|
9
|
-
category: "instance",
|
|
10
|
-
children: ["instance"],
|
|
11
|
-
descendants: ["VimeoSpinner", "VimeoPlayButton", "VimeoPreviewImage"]
|
|
12
|
-
},
|
|
13
|
-
presetStyle: {
|
|
14
|
-
div: e
|
|
15
|
-
}
|
|
16
|
-
}, r = [
|
|
5
|
+
const r = [
|
|
17
6
|
"id",
|
|
18
7
|
"className",
|
|
19
8
|
"url",
|
|
@@ -31,11 +20,18 @@ const m = {
|
|
|
31
20
|
"showControls",
|
|
32
21
|
"controlsColor",
|
|
33
22
|
"playsinline"
|
|
34
|
-
],
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
], m = {
|
|
24
|
+
icon: o,
|
|
25
|
+
states: t,
|
|
26
|
+
contentModel: {
|
|
27
|
+
category: "instance",
|
|
28
|
+
children: ["instance"],
|
|
29
|
+
descendants: ["VimeoSpinner", "VimeoPlayButton", "VimeoPreviewImage"]
|
|
30
|
+
},
|
|
31
|
+
presetStyle: { div: e },
|
|
32
|
+
initialProps: r,
|
|
33
|
+
props: i
|
|
37
34
|
};
|
|
38
35
|
export {
|
|
39
|
-
m as meta
|
|
40
|
-
p as propsMeta
|
|
36
|
+
m as meta
|
|
41
37
|
};
|
|
@@ -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/webhook-form.ws.js
CHANGED
|
@@ -10,8 +10,8 @@ const c = {
|
|
|
10
10
|
states: [
|
|
11
11
|
{ selector: "[data-state=error]", label: "Error" },
|
|
12
12
|
{ selector: "[data-state=success]", label: "Success" }
|
|
13
|
-
]
|
|
14
|
-
|
|
13
|
+
],
|
|
14
|
+
initialProps: ["id", "class", "state", "action"],
|
|
15
15
|
props: {
|
|
16
16
|
...r,
|
|
17
17
|
action: {
|
|
@@ -20,10 +20,8 @@ const c = {
|
|
|
20
20
|
description: "The URI of a program that processes the information submitted via the form.",
|
|
21
21
|
required: !1
|
|
22
22
|
}
|
|
23
|
-
}
|
|
24
|
-
initialProps: ["id", "className", "state", "action"]
|
|
23
|
+
}
|
|
25
24
|
};
|
|
26
25
|
export {
|
|
27
|
-
c as meta
|
|
28
|
-
i as propsMeta
|
|
26
|
+
c as meta
|
|
29
27
|
};
|
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/xml-node.ws.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { XmlIcon as o } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { props as r } from "./__generated__/xml-node.props.js";
|
|
3
|
-
const
|
|
3
|
+
const m = {
|
|
4
4
|
category: "xml",
|
|
5
5
|
order: 6,
|
|
6
6
|
icon: o,
|
|
7
|
-
description: "XML Node"
|
|
8
|
-
|
|
9
|
-
props: r
|
|
10
|
-
initialProps: ["tag"]
|
|
7
|
+
description: "XML Node",
|
|
8
|
+
initialProps: ["tag"],
|
|
9
|
+
props: r
|
|
11
10
|
};
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
e as propsMeta
|
|
12
|
+
m as meta
|
|
15
13
|
};
|
package/lib/xml-time.ws.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { CalendarIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
-
import { props as
|
|
2
|
+
import { props as e } from "./__generated__/xml-time.props.js";
|
|
3
3
|
const a = {
|
|
4
4
|
category: "xml",
|
|
5
5
|
description: "Converts machine-readable date and time to ISO format.",
|
|
6
6
|
icon: t,
|
|
7
|
-
order: 7
|
|
8
|
-
|
|
9
|
-
props:
|
|
10
|
-
initialProps: ["datetime", "dateStyle"]
|
|
7
|
+
order: 7,
|
|
8
|
+
initialProps: ["datetime", "dateStyle"],
|
|
9
|
+
props: e
|
|
11
10
|
};
|
|
12
11
|
export {
|
|
13
|
-
a as meta
|
|
14
|
-
i as propsMeta
|
|
12
|
+
a as meta
|
|
15
13
|
};
|
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 {
|
package/lib/youtube.ws.js
CHANGED
|
@@ -2,18 +2,7 @@ import { YoutubeIcon as e } from "@webstudio-is/icons/svg";
|
|
|
2
2
|
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
3
3
|
import { div as t } from "@webstudio-is/sdk/normalize.css";
|
|
4
4
|
import { props as i } from "./__generated__/youtube.props.js";
|
|
5
|
-
const
|
|
6
|
-
icon: e,
|
|
7
|
-
states: o,
|
|
8
|
-
contentModel: {
|
|
9
|
-
category: "instance",
|
|
10
|
-
children: ["instance"],
|
|
11
|
-
descendants: ["VimeoSpinner", "VimeoPlayButton", "VimeoPreviewImage"]
|
|
12
|
-
},
|
|
13
|
-
presetStyle: {
|
|
14
|
-
div: t
|
|
15
|
-
}
|
|
16
|
-
}, n = [
|
|
5
|
+
const n = [
|
|
17
6
|
"id",
|
|
18
7
|
"className",
|
|
19
8
|
"url",
|
|
@@ -41,11 +30,18 @@ const p = {
|
|
|
41
30
|
"language",
|
|
42
31
|
"color",
|
|
43
32
|
"playlist"
|
|
44
|
-
],
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
], d = {
|
|
34
|
+
icon: e,
|
|
35
|
+
states: o,
|
|
36
|
+
contentModel: {
|
|
37
|
+
category: "instance",
|
|
38
|
+
children: ["instance"],
|
|
39
|
+
descendants: ["VimeoSpinner", "VimeoPlayButton", "VimeoPreviewImage"]
|
|
40
|
+
},
|
|
41
|
+
presetStyle: { div: t },
|
|
42
|
+
initialProps: n,
|
|
43
|
+
props: i
|
|
47
44
|
};
|
|
48
45
|
export {
|
|
49
|
-
|
|
50
|
-
c as propsMeta
|
|
46
|
+
d as meta
|
|
51
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.220.0",
|
|
4
4
|
"description": "Webstudio default library for react",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -23,11 +23,6 @@
|
|
|
23
23
|
"types": "./lib/types/metas.d.ts",
|
|
24
24
|
"import": "./lib/metas.js"
|
|
25
25
|
},
|
|
26
|
-
"./props": {
|
|
27
|
-
"webstudio": "./src/props.ts",
|
|
28
|
-
"types": "./lib/types/props.d.ts",
|
|
29
|
-
"import": "./lib/props.js"
|
|
30
|
-
},
|
|
31
26
|
"./hooks": {
|
|
32
27
|
"webstudio": "./src/hooks.ts",
|
|
33
28
|
"types": "./lib/types/hooks.d.ts",
|
|
@@ -49,10 +44,10 @@
|
|
|
49
44
|
"colord": "^2.9.3",
|
|
50
45
|
"micromark": "^4.0.2",
|
|
51
46
|
"micromark-extension-gfm-table": "^2.1.1",
|
|
52
|
-
"@webstudio-is/icons": "0.
|
|
53
|
-
"@webstudio-is/image": "0.
|
|
54
|
-
"@webstudio-is/react-sdk": "0.
|
|
55
|
-
"@webstudio-is/sdk": "0.
|
|
47
|
+
"@webstudio-is/icons": "0.220.0",
|
|
48
|
+
"@webstudio-is/image": "0.220.0",
|
|
49
|
+
"@webstudio-is/react-sdk": "0.220.0",
|
|
50
|
+
"@webstudio-is/sdk": "0.220.0"
|
|
56
51
|
},
|
|
57
52
|
"devDependencies": {
|
|
58
53
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -62,11 +57,11 @@
|
|
|
62
57
|
"nanostores": "^0.11.3",
|
|
63
58
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
64
59
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
65
|
-
"vitest": "^3.
|
|
66
|
-
"@webstudio-is/template": "0.218.0",
|
|
67
|
-
"@webstudio-is/tsconfig": "1.0.7",
|
|
60
|
+
"vitest": "^3.1.2",
|
|
68
61
|
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
69
|
-
"@webstudio-is/sdk-cli": "0.94.0"
|
|
62
|
+
"@webstudio-is/sdk-cli": "0.94.0",
|
|
63
|
+
"@webstudio-is/template": "0.220.0",
|
|
64
|
+
"@webstudio-is/tsconfig": "1.0.7"
|
|
70
65
|
},
|
|
71
66
|
"scripts": {
|
|
72
67
|
"build": "vite build --config ../../vite.sdk-components.config.ts",
|