@webstudio-is/sdk-components-react 0.189.0 → 0.191.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 (126) hide show
  1. package/lib/__generated__/blockquote.props.js +514 -0
  2. package/lib/__generated__/body.props.js +508 -0
  3. package/lib/__generated__/bold.props.js +508 -0
  4. package/lib/__generated__/box.props.js +527 -0
  5. package/lib/__generated__/button.props.js +570 -0
  6. package/lib/__generated__/checkbox.props.js +672 -0
  7. package/lib/__generated__/code-text.props.js +509 -0
  8. package/lib/__generated__/form.props.js +556 -0
  9. package/lib/__generated__/heading.props.js +516 -0
  10. package/lib/__generated__/html-embed.props.js +13 -0
  11. package/lib/__generated__/image.props.js +592 -0
  12. package/lib/__generated__/input.props.js +696 -0
  13. package/lib/__generated__/italic.props.js +508 -0
  14. package/lib/__generated__/label.props.js +520 -0
  15. package/lib/__generated__/link.props.js +568 -0
  16. package/lib/__generated__/list-item.props.js +514 -0
  17. package/lib/__generated__/list.props.js +534 -0
  18. package/lib/__generated__/markdown-embed.props.js +7 -0
  19. package/lib/__generated__/option.props.js +532 -0
  20. package/lib/__generated__/paragraph.props.js +508 -0
  21. package/lib/__generated__/radio-button.props.js +672 -0
  22. package/lib/__generated__/select.props.js +556 -0
  23. package/lib/__generated__/separator.props.js +508 -0
  24. package/lib/__generated__/span.props.js +508 -0
  25. package/lib/__generated__/subscript.props.js +508 -0
  26. package/lib/__generated__/superscript.props.js +508 -0
  27. package/lib/__generated__/text.props.js +516 -0
  28. package/lib/__generated__/textarea.props.js +587 -0
  29. package/lib/__generated__/time.props.js +312 -0
  30. package/lib/__generated__/vimeo-play-button.props.js +569 -0
  31. package/lib/__generated__/vimeo-preview-image.props.js +586 -0
  32. package/lib/__generated__/vimeo-spinner.props.js +508 -0
  33. package/lib/__generated__/vimeo.props.js +674 -0
  34. package/lib/__generated__/xml-node.props.js +7 -0
  35. package/lib/__generated__/xml-time.props.js +18 -0
  36. package/lib/blockquote.js +9 -0
  37. package/lib/blockquote.ws.js +79 -0
  38. package/lib/body.js +7 -0
  39. package/lib/body.ws.js +30 -0
  40. package/lib/bold.js +7 -0
  41. package/lib/bold.ws.js +20 -0
  42. package/lib/box.js +9 -0
  43. package/lib/box.ws.js +31 -0
  44. package/lib/button.js +9 -0
  45. package/lib/button.ws.js +44 -0
  46. package/lib/checkbox.js +15 -0
  47. package/lib/checkbox.ws.js +59 -0
  48. package/lib/code-text.js +10 -0
  49. package/lib/code-text.ws.js +60 -0
  50. package/lib/components.js +77 -1357
  51. package/lib/content-embed.ws.js +77 -0
  52. package/lib/form.js +7 -0
  53. package/lib/form.ws.js +31 -0
  54. package/lib/fragment.js +7 -0
  55. package/lib/fragment.ws.js +11 -0
  56. package/lib/heading.js +9 -0
  57. package/lib/heading.ws.js +45 -0
  58. package/lib/home_wsKvRSqvkajPPBeycZ-C8.svg +3 -0
  59. package/lib/hooks.js +5 -0
  60. package/lib/html-embed-patchers.js +29 -0
  61. package/lib/html-embed.js +112 -0
  62. package/lib/html-embed.ws.js +46 -0
  63. package/lib/image.js +40 -0
  64. package/lib/image.ws.js +65 -0
  65. package/lib/input.js +17 -0
  66. package/lib/input.ws.js +55 -0
  67. package/lib/italic.js +7 -0
  68. package/lib/italic.ws.js +26 -0
  69. package/lib/label.js +7 -0
  70. package/lib/label.ws.js +43 -0
  71. package/lib/link.js +15 -0
  72. package/lib/link.ws.js +68 -0
  73. package/lib/list-item.js +9 -0
  74. package/lib/list-item.ws.js +40 -0
  75. package/lib/list.js +6 -0
  76. package/lib/list.ws.js +92 -0
  77. package/lib/markdown-embed.js +14 -0
  78. package/lib/markdown-embed.ws.js +111 -0
  79. package/lib/metas.js +79 -4581
  80. package/lib/option.js +7 -0
  81. package/lib/option.ws.js +47 -0
  82. package/lib/paragraph.js +7 -0
  83. package/lib/paragraph.ws.js +40 -0
  84. package/lib/props.js +77 -17919
  85. package/lib/radio-button.js +15 -0
  86. package/lib/radio-button.ws.js +61 -0
  87. package/lib/rich-text-link.js +8 -0
  88. package/lib/rich-text-link.ws.js +11 -0
  89. package/lib/select.js +19 -0
  90. package/lib/select.ws.js +97 -0
  91. package/lib/separator.js +9 -0
  92. package/lib/separator.ws.js +48 -0
  93. package/lib/slot.js +14 -0
  94. package/lib/slot.ws.js +15 -0
  95. package/lib/span.js +7 -0
  96. package/lib/span.ws.js +20 -0
  97. package/lib/subscript.js +7 -0
  98. package/lib/subscript.ws.js +20 -0
  99. package/lib/superscript.js +7 -0
  100. package/lib/superscript.ws.js +20 -0
  101. package/lib/text.js +10 -0
  102. package/lib/text.ws.js +41 -0
  103. package/lib/textarea.js +7 -0
  104. package/lib/textarea.ws.js +56 -0
  105. package/lib/time.js +319 -0
  106. package/lib/time.ws.js +22 -0
  107. package/lib/types/__generated__/xml-time.props.d.ts +2 -0
  108. package/lib/types/components.d.ts +1 -0
  109. package/lib/types/metas.d.ts +1 -0
  110. package/lib/types/props.d.ts +1 -0
  111. package/lib/types/vimeo-preview-image.d.ts +94 -94
  112. package/lib/types/xml-time.d.ts +6 -0
  113. package/lib/types/xml-time.ws.d.ts +3 -0
  114. package/lib/vimeo-play-button.js +15 -0
  115. package/lib/vimeo-play-button.ws.js +33 -0
  116. package/lib/vimeo-preview-image.js +19 -0
  117. package/lib/vimeo-preview-image.ws.js +20 -0
  118. package/lib/vimeo-spinner.js +13 -0
  119. package/lib/vimeo-spinner.ws.js +26 -0
  120. package/lib/vimeo.js +215 -0
  121. package/lib/vimeo.ws.js +330 -0
  122. package/lib/xml-node.js +44 -0
  123. package/lib/xml-node.ws.js +18 -0
  124. package/lib/xml-time.js +25 -0
  125. package/lib/xml-time.ws.js +18 -0
  126. package/package.json +8 -11
@@ -0,0 +1,20 @@
1
+ import "@webstudio-is/react-sdk";
2
+ import { meta as o, propsOverrides as e, propsMeta as r } from "./image.ws.js";
3
+ import { props as t } from "./__generated__/vimeo-preview-image.props.js";
4
+ const a = {
5
+ ...o,
6
+ category: "hidden",
7
+ label: "Preview Image",
8
+ requiredAncestors: ["Vimeo"],
9
+ constraints: {
10
+ relation: "ancestor",
11
+ component: { $eq: "Vimeo" }
12
+ }
13
+ }, m = {
14
+ props: { ...t, ...e },
15
+ initialProps: r.initialProps
16
+ };
17
+ export {
18
+ a as meta,
19
+ m as propsMeta
20
+ };
@@ -0,0 +1,13 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as r, useContext as i } from "react";
3
+ import { VimeoContext as n } from "./vimeo.js";
4
+ const m = r(
5
+ (o, t) => {
6
+ if (i(n).status === "loading")
7
+ return /* @__PURE__ */ e("div", { ...o, ref: t });
8
+ }
9
+ );
10
+ m.displayName = "VimeoSpinner";
11
+ export {
12
+ m as VimeoSpinner
13
+ };
@@ -0,0 +1,26 @@
1
+ import { defaultStates as o } from "@webstudio-is/react-sdk";
2
+ import { props as t } from "./__generated__/vimeo-spinner.props.js";
3
+ import { div as e } from "@webstudio-is/sdk/normalize.css";
4
+ import { BoxIcon as r } from "@webstudio-is/icons/svg";
5
+ const i = {
6
+ div: e
7
+ }, m = {
8
+ type: "container",
9
+ requiredAncestors: ["Vimeo"],
10
+ constraints: {
11
+ relation: "ancestor",
12
+ component: { $eq: "Vimeo" }
13
+ },
14
+ icon: r,
15
+ states: o,
16
+ presetStyle: i,
17
+ category: "hidden",
18
+ label: "Spinner"
19
+ }, c = {
20
+ props: t,
21
+ initialProps: ["id", "className"]
22
+ };
23
+ export {
24
+ m as meta,
25
+ c as propsMeta
26
+ };
package/lib/vimeo.js ADDED
@@ -0,0 +1,215 @@
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
+ };
@@ -0,0 +1,330 @@
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
+ };
@@ -0,0 +1,44 @@
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
+ };
@@ -0,0 +1,18 @@
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
+ };
@@ -0,0 +1,25 @@
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
+ };