@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.
Files changed (63) hide show
  1. package/lib/__generated__/blockquote.props.js +2 -512
  2. package/lib/__generated__/body.props.js +2 -506
  3. package/lib/__generated__/bold.props.js +2 -506
  4. package/lib/__generated__/box.props.js +3 -506
  5. package/lib/__generated__/button.props.js +2 -568
  6. package/lib/__generated__/checkbox.props.js +1 -662
  7. package/lib/__generated__/code-text.props.js +1 -504
  8. package/lib/__generated__/form.props.js +2 -554
  9. package/lib/__generated__/head-link.props.js +2 -618
  10. package/lib/__generated__/head-meta.props.js +2 -530
  11. package/lib/__generated__/head-slot.props.js +4 -0
  12. package/lib/__generated__/head-title.props.js +2 -506
  13. package/lib/__generated__/heading.props.js +3 -506
  14. package/lib/__generated__/html-embed.props.js +6 -1
  15. package/lib/__generated__/image.props.js +1 -581
  16. package/lib/__generated__/input.props.js +2 -694
  17. package/lib/__generated__/italic.props.js +2 -506
  18. package/lib/__generated__/label.props.js +2 -518
  19. package/lib/__generated__/link.props.js +4 -555
  20. package/lib/__generated__/list-item.props.js +2 -512
  21. package/lib/__generated__/list.props.js +1 -523
  22. package/lib/__generated__/markdown-embed.props.js +6 -1
  23. package/lib/__generated__/option.props.js +2 -530
  24. package/lib/__generated__/paragraph.props.js +2 -506
  25. package/lib/__generated__/radio-button.props.js +1 -662
  26. package/lib/__generated__/select.props.js +2 -554
  27. package/lib/__generated__/separator.props.js +2 -506
  28. package/lib/__generated__/span.props.js +2 -506
  29. package/lib/__generated__/subscript.props.js +2 -506
  30. package/lib/__generated__/superscript.props.js +2 -506
  31. package/lib/__generated__/text.props.js +3 -506
  32. package/lib/__generated__/textarea.props.js +2 -585
  33. package/lib/__generated__/time.props.js +3 -3
  34. package/lib/__generated__/video.props.js +2 -585
  35. package/lib/__generated__/vimeo-play-button.props.js +2 -567
  36. package/lib/__generated__/vimeo-preview-image.props.js +1 -580
  37. package/lib/__generated__/vimeo-spinner.props.js +2 -506
  38. package/lib/__generated__/vimeo.props.js +2 -505
  39. package/lib/__generated__/webhook-form.props.js +1 -557
  40. package/lib/__generated__/xml-node.props.js +8 -3
  41. package/lib/__generated__/xml-time.props.js +4 -3
  42. package/lib/__generated__/youtube.props.js +1 -498
  43. package/lib/box.ws.js +11 -11
  44. package/lib/head-slot.js +4 -5
  45. package/lib/head-slot.ws.js +1 -1
  46. package/lib/heading.ws.js +7 -7
  47. package/lib/list.ws.js +3 -3
  48. package/lib/markdown-embed.js +3 -3
  49. package/lib/shared/video.js +13 -0
  50. package/lib/types/link.d.ts +1 -1
  51. package/lib/types/shared/video.d.ts +7 -0
  52. package/lib/types/vimeo.d.ts +0 -7
  53. package/lib/video.js +19 -23
  54. package/lib/vimeo-play-button.js +4 -4
  55. package/lib/vimeo-preview-image.js +5 -5
  56. package/lib/vimeo-spinner.js +1 -1
  57. package/lib/vimeo.js +113 -121
  58. package/lib/webhook-form.template.js +12 -12
  59. package/lib/xml-node.js +4 -4
  60. package/lib/youtube.js +1 -1
  61. package/package.json +8 -8
  62. package/lib/__generated__/head.props.js +0 -508
  63. 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 { ol as r, ul as o } from "@webstudio-is/sdk/normalize.css";
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
- ...r,
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
- ...o,
22
+ ...r,
23
23
  {
24
24
  property: "margin-top",
25
25
  value: { type: "keyword", value: "0" }
@@ -1,14 +1,14 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { micromark as s } from "micromark";
3
- import { gfmTable as l, gfmTableHtml as i } from "micromark-extension-gfm-table";
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: [l()],
11
- htmlExtensions: [i()]
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
+ };
@@ -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>, "download" | "target"> & {
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
+ }>;
@@ -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 _ } from "react/jsx-runtime";
2
- import { forwardRef as H, useId as N, useContext as v, useEffect as y } from "react";
3
- import { ReactSdkContext as D } from "@webstudio-is/react-sdk/runtime";
4
- const c = "data-ws-video-id", R = {
5
- HAVE_NOTHING: 0,
6
- HAVE_METADATA: 1,
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: U,
11
+ $webstudio$canvasOnly$assetId: p,
16
12
  children: l,
17
13
  src: s,
18
- ...A
19
- }, T) => {
20
- const a = N(), E = {
14
+ ...b
15
+ }, m) => {
16
+ const a = N(), A = {
21
17
  [c]: a
22
- }, { assetBaseUrl: d } = v(D), b = s != null && s.startsWith(d) ? `/cgi/video/${s.slice(d.length)}` : s;
23
- return y(() => {
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 < R.HAVE_METADATA || (e.paused || e.pause(), e.seeking))
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 m = r.subscribe((t) => {
34
+ const v = r.subscribe((t) => {
39
35
  o = t, o === !1 && i === !1 && !e.loop && (e.currentTime = 0);
40
- }), V = n.subscribe((t) => {
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
- V(), m();
45
+ E(), v();
50
46
  };
51
- }, [n, f, r, a]), /* @__PURE__ */ _("video", { src: b, ...A, ...E, ref: T, children: l });
47
+ }, [n, f, r, a]), /* @__PURE__ */ y("video", { src: T, ...b, ...A, ref: m, children: l });
52
48
  }
53
49
  );
54
- I.displayName = "Video";
50
+ _.displayName = "Video";
55
51
  export {
56
- I as Video
52
+ _ as Video
57
53
  };
@@ -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 { VimeoContext as s } from "./vimeo.js";
3
+ import s from "await-interaction-response";
4
4
  import { Button as l } from "./button.js";
5
- import c from "await-interaction-response";
5
+ import { VideoContext as c } from "./shared/video.js";
6
6
  const f = r(
7
7
  (o, i) => {
8
- const t = a(s), n = m(async () => {
9
- await c(), t.onInitPlayer();
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 m } from "react/jsx-runtime";
2
- import { forwardRef as i, useContext as t } from "react";
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 { VimeoContext as g } from "./vimeo.js";
5
- const n = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkOAMAANIAzr59FiYAAAAASUVORK5CYII=", s = i(({ src: A, ...e }, o) => {
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__ */ m(
7
+ return /* @__PURE__ */ i(
8
8
  a,
9
9
  {
10
10
  ...e,
@@ -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 { VimeoContext as n } from "./vimeo.js";
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 s, jsxs as q, Fragment as A } from "react/jsx-runtime";
2
- import { colord as B } from "colord";
3
- import { createContext as T, forwardRef as z, useState as y, useContext as G, useRef as H, useEffect as v } from "react";
4
- import { ReactSdkContext as Y } from "@webstudio-is/react-sdk/runtime";
5
- const J = (e) => {
6
- if (e.url === void 0)
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 t;
9
+ let e;
9
10
  try {
10
- const n = new URL(e.url);
11
- t = new URL(M), t.pathname = `/video${n.pathname}`;
11
+ const o = new URL(t.url);
12
+ e = new URL(S), e.pathname = `/video${o.pathname}`;
12
13
  } catch {
13
14
  }
14
- if (t === void 0)
15
+ if (e === void 0)
15
16
  return;
16
- const r = {
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 o;
27
- for (o in e) {
28
- const n = e[o];
29
- if (o === "url" || n === void 0)
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 i = r[o] ?? o;
32
- t.searchParams.append(i, n.toString());
32
+ const s = a[r] ?? r;
33
+ e.searchParams.append(s, o.toString());
33
34
  }
34
- if (t.searchParams.set("autoplay", "true"), typeof e.controlsColor == "string") {
35
- const n = B(e.controlsColor).toHex().replace("#", "");
36
- t.searchParams.set("color", n);
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 e.showPortrait && t.searchParams.set("title", "true"), e.showByline && (t.searchParams.set("portrait", "true"), t.searchParams.set("title", "true")), t.toString();
39
- }, w = (e) => {
40
- const t = document.createElement("link");
41
- t.rel = "preconnect", t.href = e, t.crossOrigin = "true", document.head.appendChild(t);
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 K = "https://f.vimeocdn.com", M = "https://player.vimeo.com", S = "https://i.vimeocdn.com", Q = () => {
45
- U || window.matchMedia("(hover: none)").matches || (w(K), w(M), w(S), U = !0);
46
- }, W = (e) => {
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 r = new URL(e).pathname.split("/")[2];
49
- return r === "" || r == null ? void 0 : r;
49
+ const a = new URL(t).pathname.split("/")[2];
50
+ return a === "" || a == null ? void 0 : a;
50
51
  } catch {
51
52
  }
52
- }, X = async (e) => {
53
- const r = `https://vimeo.com/api/v2/video/${W(e)}.json`, n = (await (await fetch(r)).json())[0].thumbnail_large, i = n.substr(n.lastIndexOf("/") + 1).split("_")[0], a = new URL(S);
54
- return a.pathname = `/video/${i}.webp`, a.searchParams.append("mw", "1100"), a.searchParams.append("mh", "619"), a.searchParams.append("q", "70"), a;
55
- }, Z = () => /* @__PURE__ */ s(
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
- ), tt = (e) => {
69
- const t = "ontouchstart" in window;
70
- (window.matchMedia("(max-width: 1024px)").matches || t) && e.requestFullscreen();
71
- }, et = ({
72
- title: e,
73
- status: t,
74
- loading: r,
75
- videoUrl: o,
76
- previewImageUrl: n,
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 [m, h] = y(0), d = H(null);
82
+ const [u, h] = y(0), d = G(null);
85
83
  if (v(() => {
86
- i && a !== "canvas" && t === "initial" && c("loading");
87
- }, [i, t, a, c]), v(() => {
88
- a !== "canvas" && Q();
89
- }, [a]), v(() => {
90
- if (o !== void 0) {
91
- if (u === !1) {
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
- n === void 0 && X(o).then(l).catch(() => {
96
- console.error(`Could not load preview image for ${o}`);
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, u, o, n]), !(a === "canvas" || t === "initial"))
100
- return /* @__PURE__ */ s(
97
+ }, [l, m, r, o]), !(n === "canvas" || e === "initial"))
98
+ return /* @__PURE__ */ i(
101
99
  "iframe",
102
100
  {
103
101
  ref: d,
104
- title: e,
105
- src: o,
106
- loading: r,
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: m,
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 && !i && tt(d.current);
116
+ c("ready"), h(1), d.current && !f && !s && J(d.current);
119
117
  }
120
118
  }
121
119
  );
122
- }, ot = T({
123
- onInitPlayer: () => {
124
- },
125
- status: "initial"
126
- }), rt = z(
120
+ }, re = z(
127
121
  ({
128
- url: e,
129
- loading: t = "lazy",
130
- autoplay: r = !1,
131
- autopause: o = !0,
132
- showByline: n = !1,
133
- showControls: i = !0,
134
- doNotTrack: a = !1,
135
- keyboard: u = !0,
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: m = !1,
133
+ playsinline: u = !1,
140
134
  showPortrait: h = !0,
141
135
  quality: d = "auto",
142
- responsive: L = !0,
143
- speed: k = !1,
144
- showTitle: E = !1,
145
- transparent: _ = !0,
146
- showPreview: j = !1,
147
- autopip: F,
148
- controlsColor: N,
149
- interactiveParams: O,
150
- texttrack: V,
151
- children: D,
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"), [x, $] = y(), { renderer: R } = G(Y), b = J({
155
- url: e,
156
- autoplay: r,
157
- autopause: o,
158
- showControls: i,
159
- controlsColor: N,
160
- doNotTrack: a,
161
- interactiveParams: O,
162
- keyboard: u,
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: m,
160
+ playsinline: u,
167
161
  quality: d,
168
- responsive: L,
169
- speed: k,
170
- texttrack: V,
171
- showTitle: E,
172
- transparent: _,
162
+ responsive: k,
163
+ speed: E,
164
+ texttrack: F,
165
+ showTitle: _,
166
+ transparent: j,
173
167
  showPortrait: h,
174
- autopip: F
168
+ autopip: N
175
169
  });
176
- return /* @__PURE__ */ s(
177
- ot.Provider,
170
+ return /* @__PURE__ */ i(
171
+ Y.Provider,
178
172
  {
179
173
  value: {
180
174
  status: P,
181
- previewImageUrl: x,
175
+ previewImageUrl: I,
182
176
  onInitPlayer() {
183
177
  R !== "canvas" && C("loading");
184
178
  }
185
179
  },
186
- children: /* @__PURE__ */ s(
180
+ children: /* @__PURE__ */ i(
187
181
  "div",
188
182
  {
189
183
  ...g,
190
- ref: (I) => {
191
- p !== null && (typeof p == "function" ? p(I) : p.current = I);
184
+ ref: (x) => {
185
+ p !== null && (typeof p == "function" ? p(x) : p.current = x);
192
186
  },
193
- children: b === void 0 ? /* @__PURE__ */ s(Z, {}) : /* @__PURE__ */ q(A, { children: [
194
- D,
195
- /* @__PURE__ */ s(
196
- et,
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: r,
200
- playsinline: m,
193
+ autoplay: a,
194
+ playsinline: u,
201
195
  videoUrl: b,
202
- previewImageUrl: x,
203
- loading: t,
204
- showPreview: j,
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
- rt.displayName = "Vimeo";
212
+ re.displayName = "Vimeo";
219
213
  export {
220
- rt as Vimeo,
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 { 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 = {
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: o`${n}`,
11
- onStateChange: new i(["state"], o`${n} = state`),
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": o`${n} === 'initial' || ${n} === 'error'`,
17
+ "ws:show": a`${n} === 'initial' || ${n} === 'error'`,
18
18
  children: [
19
- /* @__PURE__ */ t(e.Label, { children: new a("Name") }),
19
+ /* @__PURE__ */ t(e.Label, { children: new o("Name") }),
20
20
  /* @__PURE__ */ t(e.Input, { name: "name" }),
21
- /* @__PURE__ */ t(e.Label, { children: new a("Email") }),
21
+ /* @__PURE__ */ t(e.Label, { children: new o("Email") }),
22
22
  /* @__PURE__ */ t(e.Input, { name: "email" }),
23
- /* @__PURE__ */ t(e.Button, { children: new a("Submit") })
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": o`${n} === 'success'`,
32
- children: new a("Thank you for getting in touch!")
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": o`${n} === 'error'`,
40
- children: new a("Sorry, something went wrong.")
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 N, createElement as C, Children as F } from "react";
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 } = N(g), o = Object.entries(i).filter(
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 C(
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 { VimeoContext as N, requestFullscreen as P } from "./vimeo.js";
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 {