@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.
Files changed (150) hide show
  1. package/lib/__generated__/blockquote.props.js +2 -178
  2. package/lib/__generated__/body.props.js +2 -172
  3. package/lib/__generated__/bold.props.js +2 -172
  4. package/lib/__generated__/box.props.js +3 -172
  5. package/lib/__generated__/button.props.js +2 -234
  6. package/lib/__generated__/checkbox.props.js +1 -328
  7. package/lib/__generated__/code-text.props.js +1 -170
  8. package/lib/__generated__/form.props.js +2 -220
  9. package/lib/__generated__/head-link.props.js +2 -284
  10. package/lib/__generated__/head-meta.props.js +2 -196
  11. package/lib/__generated__/head-title.props.js +2 -172
  12. package/lib/__generated__/heading.props.js +3 -172
  13. package/lib/__generated__/html-embed.props.js +6 -1
  14. package/lib/__generated__/image.props.js +1 -247
  15. package/lib/__generated__/input.props.js +2 -360
  16. package/lib/__generated__/italic.props.js +2 -172
  17. package/lib/__generated__/label.props.js +2 -184
  18. package/lib/__generated__/link.props.js +4 -221
  19. package/lib/__generated__/list-item.props.js +2 -178
  20. package/lib/__generated__/list.props.js +1 -189
  21. package/lib/__generated__/markdown-embed.props.js +6 -1
  22. package/lib/__generated__/option.props.js +2 -196
  23. package/lib/__generated__/paragraph.props.js +2 -172
  24. package/lib/__generated__/radio-button.props.js +1 -328
  25. package/lib/__generated__/select.props.js +2 -220
  26. package/lib/__generated__/separator.props.js +2 -172
  27. package/lib/__generated__/span.props.js +2 -172
  28. package/lib/__generated__/subscript.props.js +2 -172
  29. package/lib/__generated__/superscript.props.js +2 -172
  30. package/lib/__generated__/text.props.js +3 -172
  31. package/lib/__generated__/textarea.props.js +2 -251
  32. package/lib/__generated__/time.props.js +1 -8
  33. package/lib/__generated__/video.props.js +2 -251
  34. package/lib/__generated__/vimeo-play-button.props.js +2 -233
  35. package/lib/__generated__/vimeo-preview-image.props.js +1 -246
  36. package/lib/__generated__/vimeo-spinner.props.js +2 -172
  37. package/lib/__generated__/vimeo.props.js +118 -365
  38. package/lib/__generated__/webhook-form.props.js +1 -223
  39. package/lib/__generated__/xml-node.props.js +8 -3
  40. package/lib/__generated__/xml-time.props.js +4 -3
  41. package/lib/__generated__/youtube.props.js +1 -164
  42. package/lib/blockquote.ws.js +9 -14
  43. package/lib/body.ws.js +11 -15
  44. package/lib/bold.ws.js +6 -12
  45. package/lib/box.ws.js +17 -21
  46. package/lib/button.ws.js +10 -14
  47. package/lib/checkbox.ws.js +4 -6
  48. package/lib/code-text.ws.js +5 -7
  49. package/lib/form.ws.js +9 -13
  50. package/lib/fragment.ws.js +2 -7
  51. package/lib/head-link.ws.js +6 -9
  52. package/lib/head-meta.ws.js +5 -8
  53. package/lib/head-slot.js +4 -5
  54. package/lib/head-slot.ws.js +3 -7
  55. package/lib/head-title.ws.js +2 -4
  56. package/lib/heading.ws.js +16 -21
  57. package/lib/html-embed.ws.js +5 -7
  58. package/lib/image.ws.js +22 -26
  59. package/lib/input.ws.js +11 -15
  60. package/lib/italic.ws.js +9 -13
  61. package/lib/label.ws.js +8 -12
  62. package/lib/link.ws.js +13 -18
  63. package/lib/list-item.ws.js +8 -15
  64. package/lib/list.ws.js +10 -14
  65. package/lib/markdown-embed.js +3 -3
  66. package/lib/markdown-embed.ws.js +6 -8
  67. package/lib/option.ws.js +6 -10
  68. package/lib/paragraph.ws.js +9 -16
  69. package/lib/radio-button.ws.js +6 -8
  70. package/lib/rich-text-link.ws.js +3 -4
  71. package/lib/select.ws.js +13 -17
  72. package/lib/separator.ws.js +10 -14
  73. package/lib/shared/video.js +13 -0
  74. package/lib/slot.ws.js +4 -7
  75. package/lib/span.ws.js +5 -9
  76. package/lib/subscript.ws.js +7 -13
  77. package/lib/superscript.ws.js +8 -14
  78. package/lib/text.ws.js +10 -12
  79. package/lib/textarea.ws.js +14 -18
  80. package/lib/time.js +2 -1
  81. package/lib/time.ws.js +15 -15
  82. package/lib/types/blockquote.ws.d.ts +1 -2
  83. package/lib/types/body.ws.d.ts +1 -2
  84. package/lib/types/bold.ws.d.ts +1 -2
  85. package/lib/types/box.ws.d.ts +1 -2
  86. package/lib/types/button.ws.d.ts +1 -2
  87. package/lib/types/checkbox.ws.d.ts +1 -2
  88. package/lib/types/code-text.ws.d.ts +1 -2
  89. package/lib/types/form.ws.d.ts +1 -2
  90. package/lib/types/fragment.ws.d.ts +1 -2
  91. package/lib/types/head-link.ws.d.ts +1 -2
  92. package/lib/types/head-meta.ws.d.ts +1 -2
  93. package/lib/types/head-slot.ws.d.ts +1 -2
  94. package/lib/types/head-title.ws.d.ts +1 -2
  95. package/lib/types/heading.ws.d.ts +1 -2
  96. package/lib/types/html-embed.ws.d.ts +1 -2
  97. package/lib/types/image.ws.d.ts +1 -2
  98. package/lib/types/input.ws.d.ts +1 -2
  99. package/lib/types/italic.ws.d.ts +1 -2
  100. package/lib/types/label.ws.d.ts +1 -2
  101. package/lib/types/link.d.ts +1 -1
  102. package/lib/types/link.ws.d.ts +1 -2
  103. package/lib/types/list-item.ws.d.ts +1 -2
  104. package/lib/types/list.ws.d.ts +1 -2
  105. package/lib/types/markdown-embed.ws.d.ts +1 -2
  106. package/lib/types/option.ws.d.ts +1 -2
  107. package/lib/types/paragraph.ws.d.ts +1 -2
  108. package/lib/types/radio-button.ws.d.ts +1 -2
  109. package/lib/types/rich-text-link.ws.d.ts +1 -2
  110. package/lib/types/select.ws.d.ts +1 -2
  111. package/lib/types/separator.ws.d.ts +1 -2
  112. package/lib/types/shared/video.d.ts +7 -0
  113. package/lib/types/slot.ws.d.ts +1 -2
  114. package/lib/types/span.ws.d.ts +1 -2
  115. package/lib/types/subscript.ws.d.ts +1 -2
  116. package/lib/types/superscript.ws.d.ts +1 -2
  117. package/lib/types/text.ws.d.ts +1 -2
  118. package/lib/types/textarea.ws.d.ts +1 -2
  119. package/lib/types/time.d.ts +2 -4
  120. package/lib/types/time.ws.d.ts +1 -2
  121. package/lib/types/video.ws.d.ts +1 -2
  122. package/lib/types/vimeo-play-button.ws.d.ts +1 -2
  123. package/lib/types/vimeo-preview-image.ws.d.ts +1 -2
  124. package/lib/types/vimeo-spinner.ws.d.ts +1 -2
  125. package/lib/types/vimeo.d.ts +0 -7
  126. package/lib/types/vimeo.ws.d.ts +1 -2
  127. package/lib/types/webhook-form.ws.d.ts +1 -2
  128. package/lib/types/xml-node.ws.d.ts +1 -2
  129. package/lib/types/xml-time.ws.d.ts +1 -2
  130. package/lib/types/youtube.ws.d.ts +1 -2
  131. package/lib/video.js +19 -23
  132. package/lib/video.ws.js +14 -17
  133. package/lib/vimeo-play-button.js +4 -4
  134. package/lib/vimeo-play-button.ws.js +4 -8
  135. package/lib/vimeo-preview-image.js +5 -5
  136. package/lib/vimeo-preview-image.ws.js +6 -8
  137. package/lib/vimeo-spinner.js +1 -1
  138. package/lib/vimeo-spinner.ws.js +4 -8
  139. package/lib/vimeo.js +113 -121
  140. package/lib/vimeo.ws.js +13 -17
  141. package/lib/webhook-form.template.js +12 -12
  142. package/lib/webhook-form.ws.js +4 -6
  143. package/lib/xml-node.js +4 -4
  144. package/lib/xml-node.ws.js +5 -7
  145. package/lib/xml-time.ws.js +5 -7
  146. package/lib/youtube.js +1 -1
  147. package/lib/youtube.ws.js +13 -17
  148. package/package.json +9 -14
  149. package/lib/props.js +0 -92
  150. package/lib/types/props.d.ts +0 -45
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
  };
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 m = {
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
- ], p = {
35
- props: i,
36
- initialProps: r
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 { 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
  ]
@@ -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
- }, i = {
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 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
  "<",
@@ -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 i = {
3
+ const m = {
4
4
  category: "xml",
5
5
  order: 6,
6
6
  icon: o,
7
- description: "XML Node"
8
- }, e = {
9
- props: r,
10
- initialProps: ["tag"]
7
+ description: "XML Node",
8
+ initialProps: ["tag"],
9
+ props: r
11
10
  };
12
11
  export {
13
- i as meta,
14
- e as propsMeta
12
+ m as meta
15
13
  };
@@ -1,15 +1,13 @@
1
1
  import { CalendarIcon as t } from "@webstudio-is/icons/svg";
2
- import { props as o } from "./__generated__/xml-time.props.js";
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
- }, i = {
9
- props: o,
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 { 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 {
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 p = {
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
- ], c = {
45
- props: i,
46
- initialProps: n
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
- p as meta,
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.218.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.218.0",
53
- "@webstudio-is/image": "0.218.0",
54
- "@webstudio-is/react-sdk": "0.218.0",
55
- "@webstudio-is/sdk": "0.218.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.0.8",
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",