@webstudio-is/sdk-components-react 0.191.0 → 0.191.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/lib/__generated__/blockquote.props.js +0 -514
- package/lib/__generated__/body.props.js +0 -508
- package/lib/__generated__/bold.props.js +0 -508
- package/lib/__generated__/box.props.js +0 -527
- package/lib/__generated__/button.props.js +0 -570
- package/lib/__generated__/checkbox.props.js +0 -672
- package/lib/__generated__/code-text.props.js +0 -509
- package/lib/__generated__/form.props.js +0 -556
- package/lib/__generated__/heading.props.js +0 -516
- package/lib/__generated__/html-embed.props.js +0 -13
- package/lib/__generated__/image.props.js +0 -592
- package/lib/__generated__/input.props.js +0 -696
- package/lib/__generated__/italic.props.js +0 -508
- package/lib/__generated__/label.props.js +0 -520
- package/lib/__generated__/link.props.js +0 -568
- package/lib/__generated__/list-item.props.js +0 -514
- package/lib/__generated__/list.props.js +0 -534
- package/lib/__generated__/markdown-embed.props.js +0 -7
- package/lib/__generated__/option.props.js +0 -532
- package/lib/__generated__/paragraph.props.js +0 -508
- package/lib/__generated__/radio-button.props.js +0 -672
- package/lib/__generated__/select.props.js +0 -556
- package/lib/__generated__/separator.props.js +0 -508
- package/lib/__generated__/span.props.js +0 -508
- package/lib/__generated__/subscript.props.js +0 -508
- package/lib/__generated__/superscript.props.js +0 -508
- package/lib/__generated__/text.props.js +0 -516
- package/lib/__generated__/textarea.props.js +0 -587
- package/lib/__generated__/time.props.js +0 -312
- package/lib/__generated__/vimeo-play-button.props.js +0 -569
- package/lib/__generated__/vimeo-preview-image.props.js +0 -586
- package/lib/__generated__/vimeo-spinner.props.js +0 -508
- package/lib/__generated__/vimeo.props.js +0 -674
- package/lib/__generated__/xml-node.props.js +0 -7
- package/lib/__generated__/xml-time.props.js +0 -18
- package/lib/blockquote.js +0 -9
- package/lib/blockquote.ws.js +0 -79
- package/lib/body.js +0 -7
- package/lib/body.ws.js +0 -30
- package/lib/bold.js +0 -7
- package/lib/bold.ws.js +0 -20
- package/lib/box.js +0 -9
- package/lib/box.ws.js +0 -31
- package/lib/button.js +0 -9
- package/lib/button.ws.js +0 -44
- package/lib/checkbox.js +0 -15
- package/lib/checkbox.ws.js +0 -59
- package/lib/code-text.js +0 -10
- package/lib/code-text.ws.js +0 -60
- package/lib/components.js +0 -79
- package/lib/content-embed.ws.js +0 -77
- package/lib/form.js +0 -7
- package/lib/form.ws.js +0 -31
- package/lib/fragment.js +0 -7
- package/lib/fragment.ws.js +0 -11
- package/lib/heading.js +0 -9
- package/lib/heading.ws.js +0 -45
- package/lib/home_wsKvRSqvkajPPBeycZ-C8.svg +0 -3
- package/lib/hooks.js +0 -5
- package/lib/html-embed-patchers.js +0 -29
- package/lib/html-embed.js +0 -112
- package/lib/html-embed.ws.js +0 -46
- package/lib/image.js +0 -40
- package/lib/image.ws.js +0 -65
- package/lib/input.js +0 -17
- package/lib/input.ws.js +0 -55
- package/lib/italic.js +0 -7
- package/lib/italic.ws.js +0 -26
- package/lib/label.js +0 -7
- package/lib/label.ws.js +0 -43
- package/lib/link.js +0 -15
- package/lib/link.ws.js +0 -68
- package/lib/list-item.js +0 -9
- package/lib/list-item.ws.js +0 -40
- package/lib/list.js +0 -6
- package/lib/list.ws.js +0 -92
- package/lib/markdown-embed.js +0 -14
- package/lib/markdown-embed.ws.js +0 -111
- package/lib/metas.js +0 -81
- package/lib/option.js +0 -7
- package/lib/option.ws.js +0 -47
- package/lib/paragraph.js +0 -7
- package/lib/paragraph.ws.js +0 -40
- package/lib/props.js +0 -79
- package/lib/radio-button.js +0 -15
- package/lib/radio-button.ws.js +0 -61
- package/lib/rich-text-link.js +0 -8
- package/lib/rich-text-link.ws.js +0 -11
- package/lib/select.js +0 -19
- package/lib/select.ws.js +0 -97
- package/lib/separator.js +0 -9
- package/lib/separator.ws.js +0 -48
- package/lib/slot.js +0 -14
- package/lib/slot.ws.js +0 -15
- package/lib/span.js +0 -7
- package/lib/span.ws.js +0 -20
- package/lib/subscript.js +0 -7
- package/lib/subscript.ws.js +0 -20
- package/lib/superscript.js +0 -7
- package/lib/superscript.ws.js +0 -20
- package/lib/text.js +0 -10
- package/lib/text.ws.js +0 -41
- package/lib/textarea.js +0 -7
- package/lib/textarea.ws.js +0 -56
- package/lib/time.js +0 -319
- package/lib/time.ws.js +0 -22
- package/lib/types/__generated__/blockquote.props.d.ts +0 -2
- package/lib/types/__generated__/body.props.d.ts +0 -2
- package/lib/types/__generated__/bold.props.d.ts +0 -2
- package/lib/types/__generated__/box.props.d.ts +0 -2
- package/lib/types/__generated__/button.props.d.ts +0 -2
- package/lib/types/__generated__/checkbox.props.d.ts +0 -2
- package/lib/types/__generated__/code-text.props.d.ts +0 -2
- package/lib/types/__generated__/form.props.d.ts +0 -2
- package/lib/types/__generated__/fragment.props.d.ts +0 -2
- package/lib/types/__generated__/heading.props.d.ts +0 -2
- package/lib/types/__generated__/html-embed.props.d.ts +0 -2
- package/lib/types/__generated__/image.props.d.ts +0 -2
- package/lib/types/__generated__/input.props.d.ts +0 -2
- package/lib/types/__generated__/italic.props.d.ts +0 -2
- package/lib/types/__generated__/label.props.d.ts +0 -2
- package/lib/types/__generated__/link.props.d.ts +0 -2
- package/lib/types/__generated__/list-item.props.d.ts +0 -2
- package/lib/types/__generated__/list.props.d.ts +0 -2
- package/lib/types/__generated__/local-date.props.d.ts +0 -2
- package/lib/types/__generated__/markdown-embed.props.d.ts +0 -2
- package/lib/types/__generated__/option.props.d.ts +0 -2
- package/lib/types/__generated__/paragraph.props.d.ts +0 -2
- package/lib/types/__generated__/radio-button.props.d.ts +0 -2
- package/lib/types/__generated__/rich-text-link.props.d.ts +0 -2
- package/lib/types/__generated__/select.props.d.ts +0 -2
- package/lib/types/__generated__/separator.props.d.ts +0 -2
- package/lib/types/__generated__/slot.props.d.ts +0 -2
- package/lib/types/__generated__/span.props.d.ts +0 -2
- package/lib/types/__generated__/subscript.props.d.ts +0 -2
- package/lib/types/__generated__/superscript.props.d.ts +0 -2
- package/lib/types/__generated__/text.props.d.ts +0 -2
- package/lib/types/__generated__/textarea.props.d.ts +0 -2
- package/lib/types/__generated__/time.props.d.ts +0 -2
- package/lib/types/__generated__/vimeo-play-button.props.d.ts +0 -2
- package/lib/types/__generated__/vimeo-preview-image.props.d.ts +0 -2
- package/lib/types/__generated__/vimeo-spinner.props.d.ts +0 -2
- package/lib/types/__generated__/vimeo.props.d.ts +0 -2
- package/lib/types/__generated__/xml-node.props.d.ts +0 -2
- package/lib/types/__generated__/xml-time.props.d.ts +0 -2
- package/lib/types/blockquote.d.ts +0 -2
- package/lib/types/blockquote.ws.d.ts +0 -3
- package/lib/types/body.d.ts +0 -2
- package/lib/types/body.ws.d.ts +0 -3
- package/lib/types/bold.d.ts +0 -2
- package/lib/types/bold.ws.d.ts +0 -3
- package/lib/types/box.d.ts +0 -8
- package/lib/types/box.ws.d.ts +0 -3
- package/lib/types/button.d.ts +0 -2
- package/lib/types/button.ws.d.ts +0 -3
- package/lib/types/checkbox.d.ts +0 -4
- package/lib/types/checkbox.ws.d.ts +0 -3
- package/lib/types/code-text.d.ts +0 -4
- package/lib/types/code-text.ws.d.ts +0 -3
- package/lib/types/components.d.ts +0 -39
- package/lib/types/content-embed.ws.d.ts +0 -2
- package/lib/types/form.d.ts +0 -2
- package/lib/types/form.ws.d.ts +0 -3
- package/lib/types/fragment.d.ts +0 -6
- package/lib/types/fragment.ws.d.ts +0 -3
- package/lib/types/heading.d.ts +0 -8
- package/lib/types/heading.ws.d.ts +0 -3
- package/lib/types/hooks.d.ts +0 -2
- package/lib/types/html-embed-patchers.d.ts +0 -2
- package/lib/types/html-embed.d.ts +0 -12
- package/lib/types/html-embed.test.d.ts +0 -1
- package/lib/types/html-embed.ws.d.ts +0 -3
- package/lib/types/image.d.ts +0 -8
- package/lib/types/image.ws.d.ts +0 -11
- package/lib/types/input.d.ts +0 -4
- package/lib/types/input.ws.d.ts +0 -3
- package/lib/types/italic.d.ts +0 -2
- package/lib/types/italic.ws.d.ts +0 -3
- package/lib/types/label.d.ts +0 -2
- package/lib/types/label.ws.d.ts +0 -3
- package/lib/types/link.d.ts +0 -7
- package/lib/types/link.ws.d.ts +0 -3
- package/lib/types/list-item.d.ts +0 -2
- package/lib/types/list-item.ws.d.ts +0 -3
- package/lib/types/list.d.ts +0 -10
- package/lib/types/list.ws.d.ts +0 -3
- package/lib/types/markdown-embed.d.ts +0 -7
- package/lib/types/markdown-embed.ws.d.ts +0 -3
- package/lib/types/metas.d.ts +0 -40
- package/lib/types/option.d.ts +0 -2
- package/lib/types/option.ws.d.ts +0 -3
- package/lib/types/paragraph.d.ts +0 -2
- package/lib/types/paragraph.ws.d.ts +0 -3
- package/lib/types/props.d.ts +0 -39
- package/lib/types/radio-button.d.ts +0 -4
- package/lib/types/radio-button.ws.d.ts +0 -3
- package/lib/types/rich-text-link.d.ts +0 -2
- package/lib/types/rich-text-link.ws.d.ts +0 -3
- package/lib/types/select.d.ts +0 -4
- package/lib/types/select.ws.d.ts +0 -3
- package/lib/types/separator.d.ts +0 -2
- package/lib/types/separator.ws.d.ts +0 -3
- package/lib/types/slot.d.ts +0 -6
- package/lib/types/slot.ws.d.ts +0 -3
- package/lib/types/span.d.ts +0 -2
- package/lib/types/span.ws.d.ts +0 -3
- package/lib/types/subscript.d.ts +0 -2
- package/lib/types/subscript.ws.d.ts +0 -3
- package/lib/types/superscript.d.ts +0 -2
- package/lib/types/superscript.ws.d.ts +0 -3
- package/lib/types/test-utils/cartesian.d.ts +0 -2
- package/lib/types/text.d.ts +0 -8
- package/lib/types/text.ws.d.ts +0 -3
- package/lib/types/textarea.d.ts +0 -2
- package/lib/types/textarea.ws.d.ts +0 -3
- package/lib/types/time.d.ts +0 -18
- package/lib/types/time.test.d.ts +0 -1
- package/lib/types/time.ws.d.ts +0 -3
- package/lib/types/vimeo-play-button.d.ts +0 -3
- package/lib/types/vimeo-play-button.ws.d.ts +0 -3
- package/lib/types/vimeo-preview-image.d.ts +0 -284
- package/lib/types/vimeo-preview-image.ws.d.ts +0 -3
- package/lib/types/vimeo-spinner.d.ts +0 -1
- package/lib/types/vimeo-spinner.ws.d.ts +0 -3
- package/lib/types/vimeo.d.ts +0 -75
- package/lib/types/vimeo.ws.d.ts +0 -3
- package/lib/types/xml-node.d.ts +0 -13
- package/lib/types/xml-node.ws.d.ts +0 -3
- package/lib/types/xml-time.d.ts +0 -6
- package/lib/types/xml-time.ws.d.ts +0 -3
- package/lib/vimeo-play-button.js +0 -15
- package/lib/vimeo-play-button.ws.js +0 -33
- package/lib/vimeo-preview-image.js +0 -19
- package/lib/vimeo-preview-image.ws.js +0 -20
- package/lib/vimeo-spinner.js +0 -13
- package/lib/vimeo-spinner.ws.js +0 -26
- package/lib/vimeo.js +0 -215
- package/lib/vimeo.ws.js +0 -330
- package/lib/xml-node.js +0 -44
- package/lib/xml-node.ws.js +0 -18
- package/lib/xml-time.js +0 -25
- package/lib/xml-time.ws.js +0 -18
package/lib/vimeo.js
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as F, Fragment as z } from "react/jsx-runtime";
|
|
2
|
-
import { colord as T } from "colord";
|
|
3
|
-
import { createContext as q, forwardRef as G, useState as h, useContext as H, useEffect as u } from "react";
|
|
4
|
-
import { ReactSdkContext as Y } from "@webstudio-is/react-sdk/runtime";
|
|
5
|
-
const J = (e) => {
|
|
6
|
-
if (e.url === void 0)
|
|
7
|
-
return;
|
|
8
|
-
let t;
|
|
9
|
-
try {
|
|
10
|
-
const o = new URL(e.url);
|
|
11
|
-
t = new URL(x), t.pathname = `/video${o.pathname}`;
|
|
12
|
-
} catch {
|
|
13
|
-
}
|
|
14
|
-
if (t === void 0)
|
|
15
|
-
return;
|
|
16
|
-
const r = {
|
|
17
|
-
showPortrait: "portrait",
|
|
18
|
-
showByline: "byline",
|
|
19
|
-
showTitle: "title",
|
|
20
|
-
controlsColor: "color",
|
|
21
|
-
showControls: "controls",
|
|
22
|
-
interactiveParams: "interactive_params",
|
|
23
|
-
backgroundMode: "background",
|
|
24
|
-
doNotTrack: "dnt"
|
|
25
|
-
};
|
|
26
|
-
let n;
|
|
27
|
-
for (n in e) {
|
|
28
|
-
const o = e[n];
|
|
29
|
-
if (n === "url" || o === void 0)
|
|
30
|
-
continue;
|
|
31
|
-
const a = r[n] ?? n;
|
|
32
|
-
t.searchParams.append(a, o.toString());
|
|
33
|
-
}
|
|
34
|
-
if (t.searchParams.set("autoplay", "true"), typeof e.controlsColor == "string") {
|
|
35
|
-
const o = T(e.controlsColor).toHex().replace("#", "");
|
|
36
|
-
t.searchParams.set("color", o);
|
|
37
|
-
}
|
|
38
|
-
return e.showPortrait && t.searchParams.set("title", "true"), e.showByline && (t.searchParams.set("portrait", "true"), t.searchParams.set("title", "true")), t.toString();
|
|
39
|
-
}, f = (e) => {
|
|
40
|
-
const t = document.createElement("link");
|
|
41
|
-
t.rel = "preconnect", t.href = e, t.crossOrigin = "true", document.head.appendChild(t);
|
|
42
|
-
};
|
|
43
|
-
let I = !1;
|
|
44
|
-
const K = "https://f.vimeocdn.com", x = "https://player.vimeo.com", b = "https://i.vimeocdn.com", Q = () => {
|
|
45
|
-
I || window.matchMedia("(hover: none)").matches || (f(K), f(x), f(b), I = !0);
|
|
46
|
-
}, W = (e) => {
|
|
47
|
-
try {
|
|
48
|
-
const r = new URL(e).pathname.split("/")[2];
|
|
49
|
-
return r === "" || r == null ? void 0 : r;
|
|
50
|
-
} catch {
|
|
51
|
-
}
|
|
52
|
-
}, X = async (e) => {
|
|
53
|
-
const r = `https://vimeo.com/api/v2/video/${W(e)}.json`, o = (await (await fetch(r)).json())[0].thumbnail_large, a = o.substr(o.lastIndexOf("/") + 1).split("_")[0], i = new URL(b);
|
|
54
|
-
return i.pathname = `/video/${a}.webp`, i.searchParams.append("mw", "1100"), i.searchParams.append("mh", "619"), i.searchParams.append("q", "70"), i;
|
|
55
|
-
}, Z = () => /* @__PURE__ */ s(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
style: {
|
|
59
|
-
display: "flex",
|
|
60
|
-
width: "100%",
|
|
61
|
-
height: "100%",
|
|
62
|
-
alignItems: "center",
|
|
63
|
-
justifyContent: "center",
|
|
64
|
-
fontSize: "1.2em"
|
|
65
|
-
},
|
|
66
|
-
children: 'Open the "Settings" panel and paste a video URL, e.g. https://vimeo.com/831343124.'
|
|
67
|
-
}
|
|
68
|
-
), tt = ({
|
|
69
|
-
status: e,
|
|
70
|
-
loading: t,
|
|
71
|
-
videoUrl: r,
|
|
72
|
-
previewImageUrl: n,
|
|
73
|
-
autoplay: o,
|
|
74
|
-
renderer: a,
|
|
75
|
-
showPreview: i,
|
|
76
|
-
onStatusChange: c,
|
|
77
|
-
onPreviewImageUrlChange: l
|
|
78
|
-
}) => {
|
|
79
|
-
const [m, p] = h(0);
|
|
80
|
-
if (u(() => {
|
|
81
|
-
o && a !== "canvas" && e === "initial" && c("loading");
|
|
82
|
-
}, [o, e, a, c]), u(() => {
|
|
83
|
-
a !== "canvas" && Q();
|
|
84
|
-
}, [a]), u(() => {
|
|
85
|
-
if (r !== void 0) {
|
|
86
|
-
if (i === !1) {
|
|
87
|
-
l(void 0);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
n === void 0 && X(r).then(l).catch(() => {
|
|
91
|
-
console.error(`Could not load preview image for ${r}`);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}, [l, i, r, n]), !(a === "canvas" || e === "initial"))
|
|
95
|
-
return /* @__PURE__ */ s(
|
|
96
|
-
"iframe",
|
|
97
|
-
{
|
|
98
|
-
src: r,
|
|
99
|
-
loading: t,
|
|
100
|
-
allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture;",
|
|
101
|
-
allowFullScreen: !0,
|
|
102
|
-
style: {
|
|
103
|
-
position: "absolute",
|
|
104
|
-
width: "100%",
|
|
105
|
-
height: "100%",
|
|
106
|
-
opacity: m,
|
|
107
|
-
transition: "opacity 1s",
|
|
108
|
-
border: "none"
|
|
109
|
-
},
|
|
110
|
-
onLoad: () => {
|
|
111
|
-
c("ready"), p(1);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
}, et = q({
|
|
116
|
-
onInitPlayer: () => {
|
|
117
|
-
},
|
|
118
|
-
status: "initial"
|
|
119
|
-
}), rt = G(
|
|
120
|
-
({
|
|
121
|
-
url: e,
|
|
122
|
-
loading: t = "lazy",
|
|
123
|
-
autoplay: r = !1,
|
|
124
|
-
autopause: n = !0,
|
|
125
|
-
backgroundMode: o = !1,
|
|
126
|
-
showByline: a = !1,
|
|
127
|
-
showControls: i = !0,
|
|
128
|
-
doNotTrack: c = !1,
|
|
129
|
-
keyboard: l = !0,
|
|
130
|
-
loop: m = !1,
|
|
131
|
-
muted: p = !1,
|
|
132
|
-
pip: R = !1,
|
|
133
|
-
playsinline: U = !0,
|
|
134
|
-
showPortrait: S = !0,
|
|
135
|
-
quality: L = "auto",
|
|
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: $,
|
|
145
|
-
children: A,
|
|
146
|
-
...B
|
|
147
|
-
}, d) => {
|
|
148
|
-
const [v, y] = h("initial"), [w, D] = h(), { renderer: g } = H(Y), P = J({
|
|
149
|
-
url: e,
|
|
150
|
-
autoplay: r,
|
|
151
|
-
autopause: n,
|
|
152
|
-
backgroundMode: o,
|
|
153
|
-
showControls: i,
|
|
154
|
-
controlsColor: O,
|
|
155
|
-
doNotTrack: c,
|
|
156
|
-
interactiveParams: V,
|
|
157
|
-
keyboard: l,
|
|
158
|
-
loop: m,
|
|
159
|
-
muted: p,
|
|
160
|
-
pip: R,
|
|
161
|
-
playsinline: U,
|
|
162
|
-
quality: L,
|
|
163
|
-
responsive: k,
|
|
164
|
-
speed: E,
|
|
165
|
-
texttrack: $,
|
|
166
|
-
showTitle: _,
|
|
167
|
-
transparent: j,
|
|
168
|
-
showPortrait: S,
|
|
169
|
-
autopip: N
|
|
170
|
-
});
|
|
171
|
-
return /* @__PURE__ */ s(
|
|
172
|
-
et.Provider,
|
|
173
|
-
{
|
|
174
|
-
value: {
|
|
175
|
-
status: v,
|
|
176
|
-
previewImageUrl: w,
|
|
177
|
-
onInitPlayer() {
|
|
178
|
-
g !== "canvas" && y("loading");
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
children: /* @__PURE__ */ s(
|
|
182
|
-
"div",
|
|
183
|
-
{
|
|
184
|
-
...B,
|
|
185
|
-
ref: (C) => {
|
|
186
|
-
d !== null && (typeof d == "function" ? d(C) : d.current = C);
|
|
187
|
-
},
|
|
188
|
-
children: P === void 0 ? /* @__PURE__ */ s(Z, {}) : /* @__PURE__ */ F(z, { children: [
|
|
189
|
-
A,
|
|
190
|
-
/* @__PURE__ */ s(
|
|
191
|
-
tt,
|
|
192
|
-
{
|
|
193
|
-
autoplay: r,
|
|
194
|
-
videoUrl: P,
|
|
195
|
-
previewImageUrl: w,
|
|
196
|
-
loading: t,
|
|
197
|
-
showPreview: M,
|
|
198
|
-
renderer: g,
|
|
199
|
-
status: v,
|
|
200
|
-
onStatusChange: y,
|
|
201
|
-
onPreviewImageUrlChange: D
|
|
202
|
-
}
|
|
203
|
-
)
|
|
204
|
-
] })
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
}
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
rt.displayName = "Vimeo";
|
|
212
|
-
export {
|
|
213
|
-
rt as Vimeo,
|
|
214
|
-
et as VimeoContext
|
|
215
|
-
};
|
package/lib/vimeo.ws.js
DELETED
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import { VimeoIcon as e, SpinnerIcon as t, PlayIcon as p } from "@webstudio-is/icons/svg";
|
|
2
|
-
import { defaultStates as o } from "@webstudio-is/react-sdk";
|
|
3
|
-
import { div as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
-
import { props as a } from "./__generated__/vimeo.props.js";
|
|
5
|
-
const n = {
|
|
6
|
-
div: r
|
|
7
|
-
}, s = {
|
|
8
|
-
category: "media",
|
|
9
|
-
type: "container",
|
|
10
|
-
description: "Add a video to your page that is hosted on Vimeo. Paste a Vimeo URL and configure the video in the Settings tab.",
|
|
11
|
-
order: 1,
|
|
12
|
-
icon: e,
|
|
13
|
-
states: o,
|
|
14
|
-
presetStyle: n,
|
|
15
|
-
invalidAncestors: ["Button", "Heading", "Link"],
|
|
16
|
-
constraints: {
|
|
17
|
-
relation: "ancestor",
|
|
18
|
-
component: { $nin: ["Button", "Link", "Heading"] }
|
|
19
|
-
},
|
|
20
|
-
template: [
|
|
21
|
-
{
|
|
22
|
-
type: "instance",
|
|
23
|
-
component: "Vimeo",
|
|
24
|
-
styles: [
|
|
25
|
-
{
|
|
26
|
-
property: "position",
|
|
27
|
-
value: { type: "keyword", value: "relative" }
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
property: "aspectRatio",
|
|
31
|
-
value: { type: "keyword", value: "640/360" }
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
property: "width",
|
|
35
|
-
value: { type: "unit", value: 100, unit: "%" }
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
children: [
|
|
39
|
-
{
|
|
40
|
-
type: "instance",
|
|
41
|
-
component: "VimeoPreviewImage",
|
|
42
|
-
styles: [
|
|
43
|
-
{
|
|
44
|
-
property: "position",
|
|
45
|
-
value: { type: "keyword", value: "absolute" }
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
property: "objectFit",
|
|
49
|
-
value: { type: "keyword", value: "cover" }
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
property: "width",
|
|
53
|
-
value: { type: "unit", value: 100, unit: "%" }
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
property: "height",
|
|
57
|
-
value: { type: "unit", value: 100, unit: "%" }
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
property: "borderTopLeftRadius",
|
|
61
|
-
value: { type: "unit", value: 20, unit: "px" }
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
property: "borderTopRightRadius",
|
|
65
|
-
value: { type: "unit", value: 20, unit: "px" }
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
property: "borderBottomLeftRadius",
|
|
69
|
-
value: { type: "unit", value: 20, unit: "px" }
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
property: "borderBottomRightRadius",
|
|
73
|
-
value: { type: "unit", value: 20, unit: "px" }
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
property: "objectPosition",
|
|
77
|
-
value: { type: "keyword", value: "cover" }
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
children: [],
|
|
81
|
-
props: [
|
|
82
|
-
{
|
|
83
|
-
type: "string",
|
|
84
|
-
name: "alt",
|
|
85
|
-
value: "Vimeo video preview image"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
type: "string",
|
|
89
|
-
name: "sizes",
|
|
90
|
-
value: "100vw"
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
type: "instance",
|
|
96
|
-
component: "VimeoSpinner",
|
|
97
|
-
label: "Spinner",
|
|
98
|
-
styles: [
|
|
99
|
-
{
|
|
100
|
-
property: "position",
|
|
101
|
-
value: { type: "keyword", value: "absolute" }
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
property: "top",
|
|
105
|
-
value: { type: "unit", value: 50, unit: "%" }
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
property: "left",
|
|
109
|
-
value: { type: "unit", value: 50, unit: "%" }
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
property: "width",
|
|
113
|
-
value: { type: "unit", value: 70, unit: "px" }
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
property: "height",
|
|
117
|
-
value: { type: "unit", value: 70, unit: "px" }
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
property: "marginTop",
|
|
121
|
-
value: { type: "unit", value: -35, unit: "px" }
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
property: "marginLeft",
|
|
125
|
-
value: { type: "unit", value: -35, unit: "px" }
|
|
126
|
-
}
|
|
127
|
-
],
|
|
128
|
-
children: [
|
|
129
|
-
{
|
|
130
|
-
type: "instance",
|
|
131
|
-
component: "HtmlEmbed",
|
|
132
|
-
label: "Spinner SVG",
|
|
133
|
-
props: [
|
|
134
|
-
{
|
|
135
|
-
type: "string",
|
|
136
|
-
name: "code",
|
|
137
|
-
value: t
|
|
138
|
-
}
|
|
139
|
-
],
|
|
140
|
-
children: []
|
|
141
|
-
}
|
|
142
|
-
]
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
type: "instance",
|
|
146
|
-
component: "VimeoPlayButton",
|
|
147
|
-
props: [
|
|
148
|
-
{
|
|
149
|
-
type: "string",
|
|
150
|
-
name: "aria-label",
|
|
151
|
-
value: "Play button"
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
styles: [
|
|
155
|
-
{
|
|
156
|
-
property: "position",
|
|
157
|
-
value: { type: "keyword", value: "absolute" }
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
property: "width",
|
|
161
|
-
value: { type: "unit", value: 140, unit: "px" }
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
property: "height",
|
|
165
|
-
value: { type: "unit", value: 80, unit: "px" }
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
property: "top",
|
|
169
|
-
value: { type: "unit", value: 50, unit: "%" }
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
property: "left",
|
|
173
|
-
value: { type: "unit", value: 50, unit: "%" }
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
property: "marginTop",
|
|
177
|
-
value: { type: "unit", value: -40, unit: "px" }
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
property: "marginLeft",
|
|
181
|
-
value: { type: "unit", value: -70, unit: "px" }
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
property: "display",
|
|
185
|
-
value: { type: "keyword", value: "flex" }
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
property: "alignItems",
|
|
189
|
-
value: { type: "keyword", value: "center" }
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
property: "justifyContent",
|
|
193
|
-
value: { type: "keyword", value: "center" }
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
property: "borderTopStyle",
|
|
197
|
-
value: { type: "keyword", value: "none" }
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
property: "borderRightStyle",
|
|
201
|
-
value: { type: "keyword", value: "none" }
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
property: "borderBottomStyle",
|
|
205
|
-
value: { type: "keyword", value: "none" }
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
property: "borderLeftStyle",
|
|
209
|
-
value: { type: "keyword", value: "none" }
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
property: "borderTopLeftRadius",
|
|
213
|
-
value: { type: "unit", value: 5, unit: "px" }
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
property: "borderTopRightRadius",
|
|
217
|
-
value: { type: "unit", value: 5, unit: "px" }
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
property: "borderBottomLeftRadius",
|
|
221
|
-
value: { type: "unit", value: 5, unit: "px" }
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
property: "borderBottomRightRadius",
|
|
225
|
-
value: { type: "unit", value: 5, unit: "px" }
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
property: "cursor",
|
|
229
|
-
value: { type: "keyword", value: "pointer" }
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
property: "backgroundColor",
|
|
233
|
-
value: {
|
|
234
|
-
type: "rgb",
|
|
235
|
-
r: 18,
|
|
236
|
-
g: 18,
|
|
237
|
-
b: 18,
|
|
238
|
-
alpha: 1
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
property: "color",
|
|
243
|
-
value: {
|
|
244
|
-
type: "rgb",
|
|
245
|
-
r: 255,
|
|
246
|
-
g: 255,
|
|
247
|
-
b: 255,
|
|
248
|
-
alpha: 1
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
state: ":hover",
|
|
253
|
-
property: "backgroundColor",
|
|
254
|
-
value: {
|
|
255
|
-
type: "rgb",
|
|
256
|
-
r: 0,
|
|
257
|
-
g: 173,
|
|
258
|
-
b: 239,
|
|
259
|
-
alpha: 1
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
],
|
|
263
|
-
children: [
|
|
264
|
-
{
|
|
265
|
-
type: "instance",
|
|
266
|
-
component: "Box",
|
|
267
|
-
label: "Play Icon",
|
|
268
|
-
styles: [
|
|
269
|
-
{
|
|
270
|
-
property: "width",
|
|
271
|
-
value: { type: "unit", value: 60, unit: "px" }
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
property: "height",
|
|
275
|
-
value: { type: "unit", value: 60, unit: "px" }
|
|
276
|
-
}
|
|
277
|
-
],
|
|
278
|
-
props: [
|
|
279
|
-
{
|
|
280
|
-
type: "string",
|
|
281
|
-
name: "aria-hidden",
|
|
282
|
-
value: "true"
|
|
283
|
-
}
|
|
284
|
-
],
|
|
285
|
-
children: [
|
|
286
|
-
{
|
|
287
|
-
type: "instance",
|
|
288
|
-
component: "HtmlEmbed",
|
|
289
|
-
label: "Play SVG",
|
|
290
|
-
props: [
|
|
291
|
-
{
|
|
292
|
-
type: "string",
|
|
293
|
-
name: "code",
|
|
294
|
-
value: p
|
|
295
|
-
}
|
|
296
|
-
],
|
|
297
|
-
children: []
|
|
298
|
-
}
|
|
299
|
-
]
|
|
300
|
-
}
|
|
301
|
-
]
|
|
302
|
-
}
|
|
303
|
-
]
|
|
304
|
-
}
|
|
305
|
-
]
|
|
306
|
-
}, i = [
|
|
307
|
-
"id",
|
|
308
|
-
"className",
|
|
309
|
-
"url",
|
|
310
|
-
"quality",
|
|
311
|
-
"showPreview",
|
|
312
|
-
"autoplay",
|
|
313
|
-
"loading",
|
|
314
|
-
"backgroundMode",
|
|
315
|
-
"doNotTrack",
|
|
316
|
-
"loop",
|
|
317
|
-
"muted",
|
|
318
|
-
"showPortrait",
|
|
319
|
-
"showByline",
|
|
320
|
-
"showTitle",
|
|
321
|
-
"showControls",
|
|
322
|
-
"controlsColor"
|
|
323
|
-
], d = {
|
|
324
|
-
props: a,
|
|
325
|
-
initialProps: i
|
|
326
|
-
};
|
|
327
|
-
export {
|
|
328
|
-
s as meta,
|
|
329
|
-
d as propsMeta
|
|
330
|
-
};
|
package/lib/xml-node.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsxs as n, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { ReactSdkContext as y } from "@webstudio-is/react-sdk/runtime";
|
|
3
|
-
import { forwardRef as b, useContext as h, createElement as u, Children as g } from "react";
|
|
4
|
-
const x = b(
|
|
5
|
-
({ tag: i = "", children: e, ...o }, c) => {
|
|
6
|
-
const { renderer: f } = h(y), s = Object.entries(o).filter(
|
|
7
|
-
([t]) => t.startsWith("data-") === !1 && t.startsWith("aria-") === !1
|
|
8
|
-
).filter(([t]) => t !== "tabIndex").filter(([, t]) => typeof t != "function");
|
|
9
|
-
if (f === void 0) {
|
|
10
|
-
const t = Object.fromEntries(s);
|
|
11
|
-
return u(i, t, e);
|
|
12
|
-
}
|
|
13
|
-
const r = g.toArray(e), l = r.length > 0 && r.every((t) => typeof t == "string"), a = i.replace(/^[^\p{L}_]+/u, "").replaceAll(/[^\p{L}\p{N}\-._:]+/gu, ""), d = s.map(
|
|
14
|
-
([t, m]) => `${t}=${JSON.stringify(m)}`
|
|
15
|
-
);
|
|
16
|
-
return /* @__PURE__ */ n("div", { ...o, children: [
|
|
17
|
-
/* @__PURE__ */ n("span", { style: { color: "rgb(16, 23, 233)" }, children: [
|
|
18
|
-
"<",
|
|
19
|
-
[a, ...d].join(" "),
|
|
20
|
-
">"
|
|
21
|
-
] }),
|
|
22
|
-
r.length > 0 && /* @__PURE__ */ p(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
ref: c,
|
|
26
|
-
style: {
|
|
27
|
-
display: l ? "inline" : "block",
|
|
28
|
-
marginLeft: l ? 0 : "1rem"
|
|
29
|
-
},
|
|
30
|
-
children: e
|
|
31
|
-
}
|
|
32
|
-
),
|
|
33
|
-
/* @__PURE__ */ n("span", { style: { color: "rgb(16, 23, 233)" }, children: [
|
|
34
|
-
"</",
|
|
35
|
-
a,
|
|
36
|
-
">"
|
|
37
|
-
] })
|
|
38
|
-
] });
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
x.displayName = "XmlNode";
|
|
42
|
-
export {
|
|
43
|
-
x as XmlNode
|
|
44
|
-
};
|
package/lib/xml-node.ws.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { XmlIcon as o } from "@webstudio-is/icons/svg";
|
|
2
|
-
import "@webstudio-is/react-sdk";
|
|
3
|
-
import { props as t } from "./__generated__/xml-node.props.js";
|
|
4
|
-
const i = {
|
|
5
|
-
category: "xml",
|
|
6
|
-
order: 6,
|
|
7
|
-
type: "container",
|
|
8
|
-
icon: o,
|
|
9
|
-
stylable: !1,
|
|
10
|
-
description: "XML Node"
|
|
11
|
-
}, a = {
|
|
12
|
-
props: t,
|
|
13
|
-
initialProps: ["tag"]
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
i as meta,
|
|
17
|
-
a as propsMeta
|
|
18
|
-
};
|
package/lib/xml-time.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as m, useContext as a } from "react";
|
|
3
|
-
import { ReactSdkContext as T } from "@webstudio-is/react-sdk/runtime";
|
|
4
|
-
const l = "short", u = "dateTime attribute is not set", N = "", c = (e) => {
|
|
5
|
-
if (e === "")
|
|
6
|
-
return;
|
|
7
|
-
let t = new Date(e);
|
|
8
|
-
if (Number.isNaN(t.getTime()) === !1)
|
|
9
|
-
return t;
|
|
10
|
-
if (/^\d+$/.test(e)) {
|
|
11
|
-
let o = Number(e);
|
|
12
|
-
e.length === 10 && (o *= 1e3), t = new Date(o);
|
|
13
|
-
}
|
|
14
|
-
if (Number.isNaN(t.getTime()) === !1)
|
|
15
|
-
return t;
|
|
16
|
-
}, d = m(
|
|
17
|
-
({ dateStyle: e = l, datetime: t = u }, o) => {
|
|
18
|
-
const { renderer: i } = a(T), s = t === null ? N : t.toString(), n = c(s);
|
|
19
|
-
let r = s;
|
|
20
|
-
return n && (r = n.toISOString(), e === "short" && (r = r.split("T")[0])), i === void 0 ? r : /* @__PURE__ */ f("time", { ref: o, children: r });
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
export {
|
|
24
|
-
d as XmlTime
|
|
25
|
-
};
|
package/lib/xml-time.ws.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CalendarIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
-
import "@webstudio-is/react-sdk";
|
|
3
|
-
import { props as e } from "./__generated__/xml-time.props.js";
|
|
4
|
-
const i = {
|
|
5
|
-
category: "xml",
|
|
6
|
-
type: "container",
|
|
7
|
-
description: "Converts machine-readable date and time to ISO format.",
|
|
8
|
-
icon: t,
|
|
9
|
-
stylable: !1,
|
|
10
|
-
order: 7
|
|
11
|
-
}, n = {
|
|
12
|
-
props: e,
|
|
13
|
-
initialProps: ["datetime", "dateStyle"]
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
i as meta,
|
|
17
|
-
n as propsMeta
|
|
18
|
-
};
|