@webstudio-is/sdk-components-react 0.210.0 → 0.213.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 (42) hide show
  1. package/lib/__generated__/box.props.js +1 -19
  2. package/lib/__generated__/heading.props.js +1 -8
  3. package/lib/__generated__/text.props.js +1 -8
  4. package/lib/__generated__/video.props.js +587 -0
  5. package/lib/box.js +9 -6
  6. package/lib/box.ws.js +38 -18
  7. package/lib/checkbox.template.js +1 -1
  8. package/lib/components.js +6 -4
  9. package/lib/head-link.ws.js +9 -9
  10. package/lib/head-meta.ws.js +3 -3
  11. package/lib/head-slot.ws.js +6 -12
  12. package/lib/head-title.ws.js +5 -5
  13. package/lib/heading.js +9 -6
  14. package/lib/heading.ws.js +22 -14
  15. package/lib/html-embed.ws.js +23 -18
  16. package/lib/markdown-embed.ws.js +12 -7
  17. package/lib/metas.js +6 -4
  18. package/lib/props.js +4 -2
  19. package/lib/radio-button.template.js +1 -1
  20. package/lib/text.js +9 -7
  21. package/lib/text.ws.js +23 -15
  22. package/lib/types/__generated__/video.props.d.ts +2 -0
  23. package/lib/types/box.d.ts +2 -3
  24. package/lib/types/components.d.ts +1 -0
  25. package/lib/types/heading.d.ts +1 -2
  26. package/lib/types/html-embed.ws.d.ts +1 -1
  27. package/lib/types/link.d.ts +1 -1
  28. package/lib/types/markdown-embed.ws.d.ts +1 -1
  29. package/lib/types/metas.d.ts +1 -0
  30. package/lib/types/props.d.ts +1 -0
  31. package/lib/types/text.d.ts +2 -3
  32. package/lib/types/video.d.ts +7 -0
  33. package/lib/types/video.ws.d.ts +3 -0
  34. package/lib/video.js +46 -0
  35. package/lib/video.ws.js +34 -0
  36. package/lib/vimeo-play-button.ws.js +10 -16
  37. package/lib/vimeo-preview-image.ws.js +7 -7
  38. package/lib/vimeo-spinner.ws.js +13 -13
  39. package/lib/vimeo.ws.js +20 -15
  40. package/lib/youtube.js +115 -101
  41. package/lib/youtube.ws.js +24 -19
  42. package/package.json +9 -8
package/lib/video.js ADDED
@@ -0,0 +1,46 @@
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import { forwardRef as m, useId as V, useEffect as _ } from "react";
3
+ const a = "data-ws-video-id", H = {
4
+ HAVE_NOTHING: 0,
5
+ HAVE_METADATA: 1,
6
+ HAVE_CURRENT_DATA: 2,
7
+ HAVE_FUTURE_DATA: 3,
8
+ HAVE_ENOUGH_DATA: 4
9
+ }, N = m(({ $progress: r, $visible: n, $timeline: f, children: d, ...c }, A) => {
10
+ const s = V(), l = {
11
+ [a]: s
12
+ };
13
+ return _(() => {
14
+ if (r === void 0 || n === void 0)
15
+ return;
16
+ const e = document.querySelector(`[${a}="${s}"]`);
17
+ if (e === null || !(e instanceof HTMLVideoElement))
18
+ return;
19
+ if (e.play().catch(() => {
20
+ }), e.pause(), f)
21
+ return r.subscribe((i) => {
22
+ if (e.readyState < H.HAVE_METADATA || (e.paused || e.pause(), e.seeking))
23
+ return;
24
+ let u = e.duration;
25
+ Number.isNaN(u) || (Number.isFinite(u) || (u = 60), e.currentTime = (i ?? 0) * u);
26
+ });
27
+ let t = !1, o = !1;
28
+ const T = n.subscribe((i) => {
29
+ o = i, o === !1 && t === !1 && !e.loop && (e.currentTime = 0);
30
+ }), E = r.subscribe((i) => {
31
+ if (t && (i === void 0 || i === 0 || i === 1)) {
32
+ t = !1, e.pause(), o === !1 && t === !1 && !e.loop && (e.currentTime = 0);
33
+ return;
34
+ }
35
+ t || (t = !0, e.ended || e.play().catch(() => {
36
+ }));
37
+ });
38
+ return () => {
39
+ E(), T();
40
+ };
41
+ }, [r, f, n, s]), /* @__PURE__ */ b("video", { ...c, ...l, ref: A, children: d });
42
+ });
43
+ N.displayName = "Video";
44
+ export {
45
+ N as Video
46
+ };
@@ -0,0 +1,34 @@
1
+ import { VideoIcon as o } from "@webstudio-is/icons/svg";
2
+ import "@webstudio-is/sdk";
3
+ import { props as t } from "./__generated__/video.props.js";
4
+ const r = {
5
+ type: "control",
6
+ icon: o,
7
+ presetStyle: {
8
+ video: [
9
+ {
10
+ property: "max-width",
11
+ value: { type: "unit", unit: "%", value: 100 }
12
+ }
13
+ ]
14
+ }
15
+ }, a = {
16
+ props: t,
17
+ initialProps: [
18
+ "id",
19
+ "className",
20
+ "width",
21
+ "height",
22
+ "src",
23
+ "autoPlay",
24
+ "controls",
25
+ "loop",
26
+ "muted",
27
+ "preload",
28
+ "playsInline"
29
+ ]
30
+ };
31
+ export {
32
+ r as meta,
33
+ a as propsMeta
34
+ };
@@ -2,30 +2,24 @@ import { defaultStates as t } from "@webstudio-is/sdk";
2
2
  import { ButtonElementIcon as o } from "@webstudio-is/icons/svg";
3
3
  import { button as e } from "@webstudio-is/sdk/normalize.css";
4
4
  import { props as n } from "./__generated__/vimeo-play-button.props.js";
5
- const r = {
6
- button: e
7
- }, p = {
5
+ const s = {
8
6
  category: "hidden",
9
7
  type: "container",
10
- constraints: [
11
- {
12
- relation: "ancestor",
13
- component: { $in: ["Vimeo", "YouTube"] }
14
- },
15
- {
16
- relation: "ancestor",
17
- component: { $neq: "Button" }
18
- }
19
- ],
20
8
  label: "Play Button",
21
9
  icon: o,
22
- presetStyle: r,
23
- states: t
10
+ states: t,
11
+ contentModel: {
12
+ category: "none",
13
+ children: ["instance"]
14
+ },
15
+ presetStyle: {
16
+ button: e
17
+ }
24
18
  }, c = {
25
19
  props: n,
26
20
  initialProps: ["id", "className"]
27
21
  };
28
22
  export {
29
- p as meta,
23
+ s as meta,
30
24
  c as propsMeta
31
25
  };
@@ -1,14 +1,14 @@
1
1
  import { meta as e, propsMeta as o } from "./image.ws.js";
2
2
  import { props as r } from "./__generated__/vimeo-preview-image.props.js";
3
- const i = {
3
+ const a = {
4
4
  ...e,
5
5
  category: "hidden",
6
6
  label: "Preview Image",
7
- constraints: {
8
- relation: "ancestor",
9
- component: { $in: ["Vimeo", "YouTube"] }
7
+ contentModel: {
8
+ category: "none",
9
+ children: ["empty"]
10
10
  }
11
- }, p = {
11
+ }, i = {
12
12
  props: {
13
13
  ...r,
14
14
  // Automatically generated props don't have the right control.
@@ -22,6 +22,6 @@ const i = {
22
22
  initialProps: o.initialProps
23
23
  };
24
24
  export {
25
- i as meta,
26
- p as propsMeta
25
+ a as meta,
26
+ i as propsMeta
27
27
  };
@@ -1,25 +1,25 @@
1
- import { defaultStates as o } from "@webstudio-is/sdk";
2
- import { div as t } from "@webstudio-is/sdk/normalize.css";
1
+ import { defaultStates as t } from "@webstudio-is/sdk";
2
+ import { div as o } from "@webstudio-is/sdk/normalize.css";
3
3
  import { BoxIcon as e } from "@webstudio-is/icons/svg";
4
4
  import { props as r } from "./__generated__/vimeo-spinner.props.js";
5
- const n = {
6
- div: t
7
- }, m = {
5
+ const s = {
8
6
  type: "container",
9
- constraints: {
10
- relation: "ancestor",
11
- component: { $in: ["Vimeo", "YouTube"] }
12
- },
13
7
  icon: e,
14
- states: o,
15
- presetStyle: n,
8
+ states: t,
16
9
  category: "hidden",
17
- label: "Spinner"
10
+ label: "Spinner",
11
+ contentModel: {
12
+ category: "none",
13
+ children: ["instance"]
14
+ },
15
+ presetStyle: {
16
+ div: o
17
+ }
18
18
  }, c = {
19
19
  props: r,
20
20
  initialProps: ["id", "className"]
21
21
  };
22
22
  export {
23
- m as meta,
23
+ s as meta,
24
24
  c as propsMeta
25
25
  };
package/lib/vimeo.ws.js CHANGED
@@ -1,19 +1,24 @@
1
1
  import { VimeoIcon as o } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as t } from "@webstudio-is/sdk";
3
- import { div as i } from "@webstudio-is/sdk/normalize.css";
4
- import { props as n } from "./__generated__/vimeo.props.js";
5
- const r = {
6
- div: i
7
- }, c = {
3
+ import { div as e } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as i } from "./__generated__/vimeo.props.js";
5
+ const m = {
8
6
  type: "container",
9
7
  icon: o,
10
8
  states: t,
11
- presetStyle: r,
12
- constraints: {
13
- relation: "ancestor",
14
- component: { $nin: ["Button", "Link", "Heading"] }
9
+ contentModel: {
10
+ category: "instance",
11
+ children: [
12
+ "instance",
13
+ "VimeoSpinner",
14
+ "VimeoPlayButton",
15
+ "VimeoPreviewImage"
16
+ ]
17
+ },
18
+ presetStyle: {
19
+ div: e
15
20
  }
16
- }, e = [
21
+ }, r = [
17
22
  "id",
18
23
  "className",
19
24
  "url",
@@ -31,11 +36,11 @@ const r = {
31
36
  "showControls",
32
37
  "controlsColor",
33
38
  "playsinline"
34
- ], m = {
35
- props: n,
36
- initialProps: e
39
+ ], p = {
40
+ props: i,
41
+ initialProps: r
37
42
  };
38
43
  export {
39
- c as meta,
40
- m as propsMeta
44
+ m as meta,
45
+ p as propsMeta
41
46
  };
package/lib/youtube.js CHANGED
@@ -1,139 +1,142 @@
1
- import { jsx as m, jsxs as _, Fragment as L } from "react/jsx-runtime";
2
- import { forwardRef as C, useState as p, useContext as I, useRef as E, useEffect as h } from "react";
3
- import { ReactSdkContext as O } from "@webstudio-is/react-sdk/runtime";
4
- import { VimeoContext as x, requestFullscreen as S } from "./vimeo.js";
5
- const T = "https://www.youtube-nocookie.com", j = "https://www.youtube.com", v = "https://img.youtube.com", R = (e) => {
1
+ import { jsx as u, jsxs as E, Fragment as O } from "react/jsx-runtime";
2
+ import { forwardRef as x, useState as p, useContext as S, useRef as T, useEffect as h } from "react";
3
+ import { ReactSdkContext as A } from "@webstudio-is/react-sdk/runtime";
4
+ import { VimeoContext as N, requestFullscreen as P } from "./vimeo.js";
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 {
8
- const a = new URL(e);
9
- return a.pathname === "/embed" ? void 0 : a.hostname === "youtu.be" ? a.pathname.slice(1) : a.searchParams.get("v") || a.pathname.split("/").pop();
8
+ const t = new URL(e);
9
+ return t.pathname === "/embed" ? void 0 : t.hostname === "youtu.be" ? t.pathname.slice(1) : t.searchParams.get("v") || t.pathname.split("/").pop();
10
10
  } catch {
11
11
  return e;
12
12
  }
13
- }, A = (e, a) => {
14
- var i, c;
15
- const l = R(e.url), r = new URL(a);
13
+ }, D = (e, t) => {
14
+ var o, n;
15
+ const l = L(e.url), r = new URL(t);
16
16
  if (l)
17
17
  r.pathname = `/embed/${l}`;
18
18
  else if (e.url)
19
19
  try {
20
- const n = new URL(e.url);
21
- r.pathname = n.pathname, r.search = n.search;
20
+ const c = new URL(e.url);
21
+ r.pathname = c.pathname, r.search = c.search;
22
22
  } catch {
23
23
  }
24
- const o = Object.keys(e), t = {};
25
- for (const n of o)
26
- switch (n) {
24
+ const i = Object.keys(e), a = {};
25
+ for (const c of i)
26
+ switch (c) {
27
27
  case "autoplay":
28
- t.autoplay = e.autoplay ? "1" : "0", e.autoplay && e.muted === void 0 && (t.mute = "1");
28
+ a.autoplay = e.autoplay ? "1" : "0", e.autoplay && e.muted === void 0 && (a.mute = "1");
29
29
  break;
30
30
  case "muted":
31
- t.mute = e.muted ? "1" : "0";
31
+ a.mute = e.muted ? "1" : "0";
32
32
  break;
33
33
  case "showControls":
34
- t.controls = e.showControls ? "1" : "0";
34
+ a.controls = e.showControls ? "1" : "0";
35
35
  break;
36
36
  case "showRelatedVideos":
37
- t.rel = e.showRelatedVideos ? "1" : "0";
37
+ a.rel = e.showRelatedVideos ? "1" : "0";
38
38
  break;
39
39
  case "keyboard":
40
- t.keyboard = e.keyboard ? "1" : "0";
40
+ a.keyboard = e.keyboard ? "1" : "0";
41
41
  break;
42
42
  case "loop":
43
- t.loop = e.loop ? "1" : "0", e.loop && (e.playlist ?? "").trim() === "" && (t.playlist = l);
43
+ a.loop = e.loop ? "1" : "0", e.loop && (e.playlist ?? "").trim() === "" && (a.playlist = l);
44
44
  break;
45
45
  case "inline":
46
- t.playsinline = e.inline ? "1" : "0";
46
+ a.playsinline = e.inline ? "1" : "0";
47
47
  break;
48
48
  case "allowFullscreen":
49
- t.fs = e.allowFullscreen ? "1" : "0";
49
+ a.fs = e.allowFullscreen ? "1" : "0";
50
50
  break;
51
51
  case "captionLanguage":
52
- t.cc_lang_pref = e.captionLanguage;
52
+ a.cc_lang_pref = e.captionLanguage;
53
53
  break;
54
54
  case "showCaptions":
55
- t.cc_load_policy = e.showCaptions ? "1" : "0";
55
+ a.cc_load_policy = e.showCaptions ? "1" : "0";
56
56
  break;
57
57
  case "showAnnotations":
58
- t.iv_load_policy = e.showAnnotations ? "1" : "3";
58
+ a.iv_load_policy = e.showAnnotations ? "1" : "3";
59
59
  break;
60
60
  case "startTime":
61
- t.start = (i = e.startTime) == null ? void 0 : i.toString();
61
+ a.start = (o = e.startTime) == null ? void 0 : o.toString();
62
62
  break;
63
63
  case "endTime":
64
- t.end = (c = e.endTime) == null ? void 0 : c.toString();
64
+ a.end = (n = e.endTime) == null ? void 0 : n.toString();
65
65
  break;
66
66
  case "disableKeyboard":
67
- t.disablekb = e.disableKeyboard ? "1" : "0";
67
+ a.disablekb = e.disableKeyboard ? "1" : "0";
68
68
  break;
69
69
  case "language":
70
- t.hl = e.language;
70
+ a.hl = e.language;
71
71
  break;
72
72
  case "listId":
73
- t.list = e.listId;
73
+ a.list = e.listId;
74
74
  break;
75
75
  case "listType":
76
- t.listType = e.listType;
76
+ a.listType = e.listType;
77
77
  break;
78
78
  case "color":
79
- t.color = e.color;
79
+ a.color = e.color;
80
80
  break;
81
81
  case "origin":
82
- t.origin = e.origin;
82
+ a.origin = e.origin;
83
83
  break;
84
84
  case "referrer":
85
- t.widget_referrer = e.referrer;
85
+ a.widget_referrer = e.referrer;
86
86
  break;
87
87
  case "playlist":
88
- t.playlist = e.playlist;
88
+ a.playlist = e.playlist;
89
+ break;
90
+ case "enablejsapi":
91
+ a.enablejsapi = e.enablejsapi ? "1" : "0";
89
92
  break;
90
93
  }
91
- return Object.entries(t).forEach(([n, s]) => {
92
- s !== void 0 && r.searchParams.append(n, s.toString());
94
+ return Object.entries(a).forEach(([c, s]) => {
95
+ s !== void 0 && r.searchParams.append(c, s.toString());
93
96
  }), r.toString();
94
- }, w = (e) => {
95
- const a = document.createElement("link");
96
- a.rel = "preconnect", a.href = e, a.crossOrigin = "true", document.head.appendChild(a);
97
+ }, R = (e) => {
98
+ const t = document.createElement("link");
99
+ t.rel = "preconnect", t.href = e, t.crossOrigin = "true", document.head.appendChild(t);
97
100
  };
98
- let k = !1;
99
- const N = (e) => {
100
- if (!(k || window.matchMedia("(hover: none)").matches)) {
101
+ let _ = !1;
102
+ const F = (e) => {
103
+ if (!(_ || window.matchMedia("(hover: none)").matches)) {
101
104
  try {
102
- const a = new URL(e);
103
- w(a.origin);
105
+ const t = new URL(e);
106
+ R(t.origin);
104
107
  } catch {
105
108
  }
106
- w(v), k = !0;
109
+ R(j), _ = !0;
107
110
  }
108
- }, P = (e) => new URL(`${v}/vi/${e}/maxresdefault.jpg`), U = () => /* @__PURE__ */ m("div", { className: "flex w-full h-full items-center justify-center text-lg", children: 'Open the "Settings" panel and paste a video URL, e.g. https://youtube.com/watch?v=dQw4w9WgXcQ' }), V = ({
111
+ }, Y = (e) => new URL(`${j}/vi/${e}/maxresdefault.jpg`), K = () => /* @__PURE__ */ u("div", { className: "flex w-full h-full items-center justify-center text-lg", children: 'Open the "Settings" panel and paste a video URL, e.g. https://youtube.com/watch?v=dQw4w9WgXcQ' }), M = ({
109
112
  title: e,
110
- status: a,
113
+ status: t,
111
114
  loading: l,
112
115
  videoUrl: r,
113
- previewImageUrl: o,
114
- autoplay: t,
115
- inline: i,
116
- renderer: c,
117
- showPreview: n,
116
+ previewImageUrl: i,
117
+ autoplay: a,
118
+ inline: o,
119
+ renderer: n,
120
+ showPreview: c,
118
121
  onStatusChange: s,
119
- onPreviewImageUrlChange: u
122
+ onPreviewImageUrlChange: d
120
123
  }) => {
121
- const [b, f] = p(0), d = E(null);
124
+ const [y, m] = p(0), b = T(null);
122
125
  return h(() => {
123
- t && c !== "canvas" && a === "initial" && s("loading");
124
- }, [t, a, c, s]), h(() => {
125
- c !== "canvas" && N(r);
126
- }, [c, r]), h(() => {
127
- const y = R(r);
128
- if (!y || !n) {
129
- u(void 0);
126
+ a && n !== "canvas" && t === "initial" && s("loading");
127
+ }, [a, t, n, s]), h(() => {
128
+ n !== "canvas" && F(r);
129
+ }, [n, r]), h(() => {
130
+ const f = L(r);
131
+ if (!f || !c) {
132
+ d(void 0);
130
133
  return;
131
134
  }
132
- o || u(P(y));
133
- }, [u, n, r, o]), c === "canvas" || a === "initial" ? null : /* @__PURE__ */ m(
135
+ i || d(Y(f));
136
+ }, [d, c, r, i]), n === "canvas" || t === "initial" ? null : /* @__PURE__ */ u(
134
137
  "iframe",
135
138
  {
136
- ref: d,
139
+ ref: b,
137
140
  title: e,
138
141
  src: r,
139
142
  loading: l,
@@ -143,69 +146,80 @@ const N = (e) => {
143
146
  position: "absolute",
144
147
  width: "100%",
145
148
  height: "100%",
146
- opacity: b,
149
+ opacity: y,
147
150
  transition: "opacity 1s",
148
151
  border: "none"
149
152
  },
150
153
  onLoad: () => {
151
- s("ready"), f(1), !i && !t && d.current && S(d.current);
154
+ s("ready"), m(1), !o && !a && b.current && P(b.current);
152
155
  }
153
156
  }
154
157
  );
155
- }, D = C(
158
+ }, $ = x(
156
159
  ({
157
160
  url: e,
158
- loading: a = "lazy",
161
+ loading: t = "lazy",
159
162
  autoplay: l,
160
163
  showPreview: r,
161
- children: o,
162
- privacyEnhancedMode: t,
163
- inline: i = !1,
164
- ...c
165
- }, n) => {
166
- const [s, u] = p("initial"), [b, f] = p(), { renderer: d } = I(O), y = t ?? !0 ? T : j, g = A(
164
+ showAnnotations: i,
165
+ showCaptions: a,
166
+ showControls: o,
167
+ allowFullscreen: n,
168
+ keyboard: c,
169
+ children: s,
170
+ privacyEnhancedMode: d,
171
+ inline: y = !1,
172
+ ...m
173
+ }, b) => {
174
+ const [f, g] = p("initial"), [w, C] = p(), { renderer: k } = S(A), I = d ?? !0 ? U : V, v = D(
167
175
  {
168
- ...c,
169
- inline: i,
176
+ ...m,
177
+ inline: y,
170
178
  url: e,
171
- autoplay: !0
179
+ keyboard: c,
180
+ showAnnotations: i,
181
+ showCaptions: a,
182
+ allowFullscreen: n,
183
+ showControls: o,
184
+ autoplay: !0,
185
+ enablejsapi: !1
172
186
  },
173
- y
187
+ I
174
188
  );
175
- return /* @__PURE__ */ m(
176
- x.Provider,
189
+ return /* @__PURE__ */ u(
190
+ N.Provider,
177
191
  {
178
192
  value: {
179
- status: s,
180
- previewImageUrl: b,
193
+ status: f,
194
+ previewImageUrl: w,
181
195
  onInitPlayer() {
182
- d !== "canvas" && u("loading");
196
+ k !== "canvas" && g("loading");
183
197
  }
184
198
  },
185
- children: /* @__PURE__ */ m("div", { ...c, ref: n, children: g ? /* @__PURE__ */ _(L, { children: [
186
- o,
187
- /* @__PURE__ */ m(
188
- V,
199
+ children: /* @__PURE__ */ u("div", { ...m, ref: b, children: v ? /* @__PURE__ */ E(O, { children: [
200
+ s,
201
+ /* @__PURE__ */ u(
202
+ M,
189
203
  {
190
- title: c.title,
204
+ title: m.title,
191
205
  autoplay: l,
192
- videoUrl: g,
193
- previewImageUrl: b,
194
- loading: a,
195
- inline: i,
206
+ videoUrl: v,
207
+ previewImageUrl: w,
208
+ loading: t,
209
+ inline: y,
196
210
  showPreview: r,
197
- renderer: d,
198
- status: s,
199
- onStatusChange: u,
200
- onPreviewImageUrlChange: f
211
+ renderer: k,
212
+ status: f,
213
+ onStatusChange: g,
214
+ onPreviewImageUrlChange: C
201
215
  }
202
216
  )
203
- ] }) : /* @__PURE__ */ m(U, {}) })
217
+ ] }) : /* @__PURE__ */ u(K, {}) })
204
218
  }
205
219
  );
206
220
  }
207
221
  );
208
- D.displayName = "YouTube";
222
+ $.displayName = "YouTube";
209
223
  export {
210
- D as YouTube
224
+ $ as YouTube
211
225
  };
package/lib/youtube.ws.js CHANGED
@@ -1,19 +1,24 @@
1
- import { YoutubeIcon as o } from "@webstudio-is/icons/svg";
2
- import { defaultStates as t } from "@webstudio-is/sdk";
3
- import { div as e } from "@webstudio-is/sdk/normalize.css";
4
- import { props as n } from "./__generated__/youtube.props.js";
5
- const i = {
6
- div: e
7
- }, c = {
1
+ import { YoutubeIcon as e } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as o } from "@webstudio-is/sdk";
3
+ import { div as t } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as i } from "./__generated__/youtube.props.js";
5
+ const p = {
8
6
  type: "container",
9
- icon: o,
10
- states: t,
11
- presetStyle: i,
12
- constraints: {
13
- relation: "ancestor",
14
- component: { $nin: ["Button", "Link", "Heading"] }
7
+ icon: e,
8
+ states: o,
9
+ contentModel: {
10
+ category: "instance",
11
+ children: [
12
+ "instance",
13
+ "VimeoSpinner",
14
+ "VimeoPlayButton",
15
+ "VimeoPreviewImage"
16
+ ]
17
+ },
18
+ presetStyle: {
19
+ div: t
15
20
  }
16
- }, a = [
21
+ }, n = [
17
22
  "id",
18
23
  "className",
19
24
  "url",
@@ -41,11 +46,11 @@ const i = {
41
46
  "language",
42
47
  "color",
43
48
  "playlist"
44
- ], d = {
45
- props: n,
46
- initialProps: a
49
+ ], c = {
50
+ props: i,
51
+ initialProps: n
47
52
  };
48
53
  export {
49
- c as meta,
50
- d as propsMeta
54
+ p as meta,
55
+ c as propsMeta
51
56
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react",
3
- "version": "0.210.0",
3
+ "version": "0.213.0",
4
4
  "description": "Webstudio default library for react",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -49,23 +49,24 @@
49
49
  "colord": "^2.9.3",
50
50
  "micromark": "^4.0.2",
51
51
  "micromark-extension-gfm-table": "^2.1.1",
52
- "@webstudio-is/icons": "0.210.0",
53
- "@webstudio-is/react-sdk": "0.210.0",
54
- "@webstudio-is/image": "0.210.0",
55
- "@webstudio-is/sdk": "0.210.0"
52
+ "@webstudio-is/icons": "0.213.0",
53
+ "@webstudio-is/image": "0.213.0",
54
+ "@webstudio-is/react-sdk": "0.213.0",
55
+ "@webstudio-is/sdk": "0.213.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@testing-library/dom": "^10.4.0",
59
59
  "@testing-library/react": "^16.2.0",
60
60
  "@types/react": "^18.2.70",
61
61
  "@types/react-dom": "^18.2.25",
62
+ "nanostores": "^0.11.3",
62
63
  "react": "18.3.0-canary-14898b6a9-20240318",
63
64
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
64
65
  "vitest": "^3.0.8",
65
- "@webstudio-is/sdk-cli": "0.94.0",
66
- "@webstudio-is/tsconfig": "1.0.7",
67
66
  "@webstudio-is/generate-arg-types": "0.0.0",
68
- "@webstudio-is/template": "0.210.0"
67
+ "@webstudio-is/sdk-cli": "0.94.0",
68
+ "@webstudio-is/template": "0.213.0",
69
+ "@webstudio-is/tsconfig": "1.0.7"
69
70
  },
70
71
  "scripts": {
71
72
  "build": "vite build --config ../../vite.sdk-components.config.ts",