@webstudio-is/sdk-components-react 0.195.0 → 0.197.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 (176) hide show
  1. package/lib/__generated__/image.props.js +1 -0
  2. package/lib/__generated__/vimeo-preview-image.props.js +6 -1
  3. package/lib/__generated__/vimeo.props.js +4 -5
  4. package/lib/__generated__/youtube.props.js +665 -0
  5. package/lib/blockquote.template.js +11 -0
  6. package/lib/blockquote.ws.js +5 -21
  7. package/lib/body.ws.js +1 -1
  8. package/lib/bold.ws.js +1 -1
  9. package/lib/box.ws.js +1 -1
  10. package/lib/button.template.js +11 -0
  11. package/lib/button.ws.js +2 -18
  12. package/lib/checkbox.template.js +14 -0
  13. package/lib/checkbox.ws.js +5 -25
  14. package/lib/code-text.ws.js +6 -6
  15. package/lib/components.js +35 -33
  16. package/lib/content-embed.template.js +83 -0
  17. package/lib/form.ws.js +1 -1
  18. package/lib/heading.template.js +11 -0
  19. package/lib/heading.ws.js +15 -31
  20. package/lib/image.ws.js +17 -22
  21. package/lib/input.ws.js +1 -1
  22. package/lib/italic.ws.js +1 -1
  23. package/lib/label.template.js +10 -0
  24. package/lib/label.ws.js +13 -28
  25. package/lib/link.template.js +11 -0
  26. package/lib/link.ws.js +3 -23
  27. package/lib/list-item.template.js +11 -0
  28. package/lib/list-item.ws.js +12 -28
  29. package/lib/list.template.js +15 -0
  30. package/lib/list.ws.js +10 -54
  31. package/lib/markdown-embed.js +10 -5
  32. package/lib/markdown-embed.template.js +75 -0
  33. package/lib/markdown-embed.ws.js +9 -87
  34. package/lib/metas.js +59 -59
  35. package/lib/option.ws.js +4 -5
  36. package/lib/paragraph.template.js +11 -0
  37. package/lib/paragraph.ws.js +12 -28
  38. package/lib/props.js +32 -30
  39. package/lib/radio-button.template.js +14 -0
  40. package/lib/radio-button.ws.js +7 -27
  41. package/lib/rich-text-link.ws.js +3 -5
  42. package/lib/select.template.js +16 -0
  43. package/lib/select.ws.js +11 -63
  44. package/lib/separator.ws.js +2 -2
  45. package/lib/span.ws.js +1 -1
  46. package/lib/subscript.ws.js +1 -1
  47. package/lib/superscript.ws.js +1 -1
  48. package/lib/templates.js +36 -0
  49. package/lib/text.template.js +11 -0
  50. package/lib/text.ws.js +8 -24
  51. package/lib/textarea.ws.js +1 -1
  52. package/lib/time.ws.js +5 -6
  53. package/lib/types/__generated__/blockquote.props.d.ts +1 -1
  54. package/lib/types/__generated__/body.props.d.ts +1 -1
  55. package/lib/types/__generated__/bold.props.d.ts +1 -1
  56. package/lib/types/__generated__/box.props.d.ts +1 -1
  57. package/lib/types/__generated__/button.props.d.ts +1 -1
  58. package/lib/types/__generated__/checkbox.props.d.ts +1 -1
  59. package/lib/types/__generated__/code-text.props.d.ts +1 -1
  60. package/lib/types/__generated__/form.props.d.ts +1 -1
  61. package/lib/types/__generated__/fragment.props.d.ts +1 -1
  62. package/lib/types/__generated__/heading.props.d.ts +1 -1
  63. package/lib/types/__generated__/html-embed.props.d.ts +1 -1
  64. package/lib/types/__generated__/image.props.d.ts +1 -1
  65. package/lib/types/__generated__/input.props.d.ts +1 -1
  66. package/lib/types/__generated__/italic.props.d.ts +1 -1
  67. package/lib/types/__generated__/label.props.d.ts +1 -1
  68. package/lib/types/__generated__/link.props.d.ts +1 -1
  69. package/lib/types/__generated__/list-item.props.d.ts +1 -1
  70. package/lib/types/__generated__/list.props.d.ts +1 -1
  71. package/lib/types/__generated__/markdown-embed.props.d.ts +1 -1
  72. package/lib/types/__generated__/option.props.d.ts +1 -1
  73. package/lib/types/__generated__/paragraph.props.d.ts +1 -1
  74. package/lib/types/__generated__/radio-button.props.d.ts +1 -1
  75. package/lib/types/__generated__/rich-text-link.props.d.ts +1 -1
  76. package/lib/types/__generated__/select.props.d.ts +1 -1
  77. package/lib/types/__generated__/separator.props.d.ts +1 -1
  78. package/lib/types/__generated__/slot.props.d.ts +1 -1
  79. package/lib/types/__generated__/span.props.d.ts +1 -1
  80. package/lib/types/__generated__/subscript.props.d.ts +1 -1
  81. package/lib/types/__generated__/superscript.props.d.ts +1 -1
  82. package/lib/types/__generated__/text.props.d.ts +1 -1
  83. package/lib/types/__generated__/textarea.props.d.ts +1 -1
  84. package/lib/types/__generated__/time.props.d.ts +1 -1
  85. package/lib/types/__generated__/vimeo-play-button.props.d.ts +1 -1
  86. package/lib/types/__generated__/vimeo-preview-image.props.d.ts +1 -1
  87. package/lib/types/__generated__/vimeo-spinner.props.d.ts +1 -1
  88. package/lib/types/__generated__/vimeo.props.d.ts +1 -1
  89. package/lib/types/__generated__/webhook-form.props.d.ts +1 -1
  90. package/lib/types/__generated__/xml-node.props.d.ts +1 -1
  91. package/lib/types/__generated__/xml-time.props.d.ts +1 -1
  92. package/lib/types/__generated__/youtube.props.d.ts +2 -0
  93. package/lib/types/blockquote.template.d.ts +2 -0
  94. package/lib/types/blockquote.ws.d.ts +1 -1
  95. package/lib/types/body.ws.d.ts +1 -1
  96. package/lib/types/bold.ws.d.ts +1 -1
  97. package/lib/types/box.ws.d.ts +1 -1
  98. package/lib/types/button.template.d.ts +2 -0
  99. package/lib/types/button.ws.d.ts +1 -1
  100. package/lib/types/checkbox.d.ts +1 -1
  101. package/lib/types/checkbox.template.d.ts +2 -0
  102. package/lib/types/checkbox.ws.d.ts +1 -1
  103. package/lib/types/code-text.ws.d.ts +1 -1
  104. package/lib/types/components.d.ts +1 -0
  105. package/lib/types/content-embed.template.d.ts +2 -0
  106. package/lib/types/form.ws.d.ts +1 -1
  107. package/lib/types/fragment.ws.d.ts +1 -1
  108. package/lib/types/heading.template.d.ts +2 -0
  109. package/lib/types/heading.ws.d.ts +1 -1
  110. package/lib/types/html-embed.ws.d.ts +1 -1
  111. package/lib/types/image.ws.d.ts +1 -9
  112. package/lib/types/input.ws.d.ts +1 -1
  113. package/lib/types/italic.ws.d.ts +1 -1
  114. package/lib/types/label.template.d.ts +2 -0
  115. package/lib/types/label.ws.d.ts +1 -1
  116. package/lib/types/link.template.d.ts +2 -0
  117. package/lib/types/link.ws.d.ts +1 -1
  118. package/lib/types/list-item.template.d.ts +2 -0
  119. package/lib/types/list-item.ws.d.ts +1 -1
  120. package/lib/types/list.template.d.ts +2 -0
  121. package/lib/types/list.ws.d.ts +1 -1
  122. package/lib/types/markdown-embed.template.d.ts +2 -0
  123. package/lib/types/markdown-embed.ws.d.ts +1 -1
  124. package/lib/types/metas.d.ts +1 -1
  125. package/lib/types/option.ws.d.ts +1 -1
  126. package/lib/types/paragraph.template.d.ts +2 -0
  127. package/lib/types/paragraph.ws.d.ts +1 -1
  128. package/lib/types/props.d.ts +1 -0
  129. package/lib/types/radio-button.d.ts +1 -1
  130. package/lib/types/radio-button.template.d.ts +2 -0
  131. package/lib/types/radio-button.ws.d.ts +1 -1
  132. package/lib/types/rich-text-link.ws.d.ts +1 -1
  133. package/lib/types/select.template.d.ts +2 -0
  134. package/lib/types/select.ws.d.ts +1 -1
  135. package/lib/types/separator.ws.d.ts +1 -1
  136. package/lib/types/slot.ws.d.ts +1 -1
  137. package/lib/types/span.ws.d.ts +1 -1
  138. package/lib/types/subscript.ws.d.ts +1 -1
  139. package/lib/types/superscript.ws.d.ts +1 -1
  140. package/lib/types/templates.d.ts +17 -0
  141. package/lib/types/text.template.d.ts +2 -0
  142. package/lib/types/text.ws.d.ts +1 -1
  143. package/lib/types/textarea.ws.d.ts +1 -1
  144. package/lib/types/time.ws.d.ts +1 -1
  145. package/lib/types/vimeo-play-button.ws.d.ts +1 -1
  146. package/lib/types/vimeo-preview-image.d.ts +21 -21
  147. package/lib/types/vimeo-preview-image.ws.d.ts +1 -1
  148. package/lib/types/vimeo-spinner.ws.d.ts +1 -1
  149. package/lib/types/vimeo.d.ts +12 -2
  150. package/lib/types/vimeo.template.d.ts +2 -0
  151. package/lib/types/vimeo.ws.d.ts +1 -1
  152. package/lib/types/webhook-form.template.d.ts +2 -0
  153. package/lib/types/webhook-form.ws.d.ts +1 -1
  154. package/lib/types/xml-node.ws.d.ts +1 -1
  155. package/lib/types/xml-time.ws.d.ts +1 -1
  156. package/lib/types/youtube.d.ts +143 -0
  157. package/lib/types/youtube.template.d.ts +2 -0
  158. package/lib/types/youtube.ws.d.ts +3 -0
  159. package/lib/vimeo-play-button.ws.js +8 -8
  160. package/lib/vimeo-preview-image.ws.js +17 -9
  161. package/lib/vimeo-spinner.ws.js +8 -8
  162. package/lib/vimeo.js +88 -87
  163. package/lib/vimeo.template.js +93 -0
  164. package/lib/vimeo.ws.js +14 -302
  165. package/lib/webhook-form.template.js +49 -0
  166. package/lib/webhook-form.ws.js +17 -118
  167. package/lib/xml-node.js +18 -14
  168. package/lib/xml-node.ws.js +4 -5
  169. package/lib/xml-time.ws.js +4 -5
  170. package/lib/youtube.js +200 -0
  171. package/lib/youtube.template.js +97 -0
  172. package/lib/youtube.ws.js +51 -0
  173. package/package.json +16 -9
  174. package/lib/content-embed.ws.js +0 -77
  175. package/lib/types/__generated__/local-date.props.d.ts +0 -2
  176. package/lib/types/content-embed.ws.d.ts +0 -2
package/lib/vimeo.ws.js CHANGED
@@ -1,311 +1,23 @@
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";
1
+ import { VimeoIcon as o } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as t } from "@webstudio-is/sdk";
3
3
  import { div as r } from "@webstudio-is/sdk/normalize.css";
4
- import { props as a } from "./__generated__/vimeo.props.js";
4
+ import { props as i } from "./__generated__/vimeo.props.js";
5
5
  const n = {
6
6
  div: r
7
- }, s = {
8
- category: "media",
7
+ }, c = {
9
8
  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,
9
+ icon: o,
10
+ states: t,
14
11
  presetStyle: n,
15
12
  constraints: {
16
13
  relation: "ancestor",
17
14
  component: { $nin: ["Button", "Link", "Heading"] }
18
- },
19
- template: [
20
- {
21
- type: "instance",
22
- component: "Vimeo",
23
- styles: [
24
- {
25
- property: "position",
26
- value: { type: "keyword", value: "relative" }
27
- },
28
- {
29
- property: "aspectRatio",
30
- value: { type: "keyword", value: "640/360" }
31
- },
32
- {
33
- property: "width",
34
- value: { type: "unit", value: 100, unit: "%" }
35
- }
36
- ],
37
- children: [
38
- {
39
- type: "instance",
40
- component: "VimeoPreviewImage",
41
- styles: [
42
- {
43
- property: "position",
44
- value: { type: "keyword", value: "absolute" }
45
- },
46
- {
47
- property: "objectFit",
48
- value: { type: "keyword", value: "cover" }
49
- },
50
- {
51
- property: "width",
52
- value: { type: "unit", value: 100, unit: "%" }
53
- },
54
- {
55
- property: "height",
56
- value: { type: "unit", value: 100, unit: "%" }
57
- },
58
- {
59
- property: "borderTopLeftRadius",
60
- value: { type: "unit", value: 20, unit: "px" }
61
- },
62
- {
63
- property: "borderTopRightRadius",
64
- value: { type: "unit", value: 20, unit: "px" }
65
- },
66
- {
67
- property: "borderBottomLeftRadius",
68
- value: { type: "unit", value: 20, unit: "px" }
69
- },
70
- {
71
- property: "borderBottomRightRadius",
72
- value: { type: "unit", value: 20, unit: "px" }
73
- },
74
- {
75
- property: "objectPosition",
76
- value: { type: "keyword", value: "cover" }
77
- }
78
- ],
79
- children: [],
80
- props: [
81
- {
82
- type: "string",
83
- name: "alt",
84
- value: "Vimeo video preview image"
85
- },
86
- {
87
- type: "string",
88
- name: "sizes",
89
- value: "100vw"
90
- }
91
- ]
92
- },
93
- {
94
- type: "instance",
95
- component: "VimeoSpinner",
96
- label: "Spinner",
97
- styles: [
98
- {
99
- property: "position",
100
- value: { type: "keyword", value: "absolute" }
101
- },
102
- {
103
- property: "top",
104
- value: { type: "unit", value: 50, unit: "%" }
105
- },
106
- {
107
- property: "left",
108
- value: { type: "unit", value: 50, unit: "%" }
109
- },
110
- {
111
- property: "width",
112
- value: { type: "unit", value: 70, unit: "px" }
113
- },
114
- {
115
- property: "height",
116
- value: { type: "unit", value: 70, unit: "px" }
117
- },
118
- {
119
- property: "marginTop",
120
- value: { type: "unit", value: -35, unit: "px" }
121
- },
122
- {
123
- property: "marginLeft",
124
- value: { type: "unit", value: -35, unit: "px" }
125
- }
126
- ],
127
- children: [
128
- {
129
- type: "instance",
130
- component: "HtmlEmbed",
131
- label: "Spinner SVG",
132
- props: [
133
- {
134
- type: "string",
135
- name: "code",
136
- value: t
137
- }
138
- ],
139
- children: []
140
- }
141
- ]
142
- },
143
- {
144
- type: "instance",
145
- component: "VimeoPlayButton",
146
- props: [
147
- {
148
- type: "string",
149
- name: "aria-label",
150
- value: "Play button"
151
- }
152
- ],
153
- styles: [
154
- {
155
- property: "position",
156
- value: { type: "keyword", value: "absolute" }
157
- },
158
- {
159
- property: "width",
160
- value: { type: "unit", value: 140, unit: "px" }
161
- },
162
- {
163
- property: "height",
164
- value: { type: "unit", value: 80, unit: "px" }
165
- },
166
- {
167
- property: "top",
168
- value: { type: "unit", value: 50, unit: "%" }
169
- },
170
- {
171
- property: "left",
172
- value: { type: "unit", value: 50, unit: "%" }
173
- },
174
- {
175
- property: "marginTop",
176
- value: { type: "unit", value: -40, unit: "px" }
177
- },
178
- {
179
- property: "marginLeft",
180
- value: { type: "unit", value: -70, unit: "px" }
181
- },
182
- {
183
- property: "display",
184
- value: { type: "keyword", value: "flex" }
185
- },
186
- {
187
- property: "alignItems",
188
- value: { type: "keyword", value: "center" }
189
- },
190
- {
191
- property: "justifyContent",
192
- value: { type: "keyword", value: "center" }
193
- },
194
- {
195
- property: "borderTopStyle",
196
- value: { type: "keyword", value: "none" }
197
- },
198
- {
199
- property: "borderRightStyle",
200
- value: { type: "keyword", value: "none" }
201
- },
202
- {
203
- property: "borderBottomStyle",
204
- value: { type: "keyword", value: "none" }
205
- },
206
- {
207
- property: "borderLeftStyle",
208
- value: { type: "keyword", value: "none" }
209
- },
210
- {
211
- property: "borderTopLeftRadius",
212
- value: { type: "unit", value: 5, unit: "px" }
213
- },
214
- {
215
- property: "borderTopRightRadius",
216
- value: { type: "unit", value: 5, unit: "px" }
217
- },
218
- {
219
- property: "borderBottomLeftRadius",
220
- value: { type: "unit", value: 5, unit: "px" }
221
- },
222
- {
223
- property: "borderBottomRightRadius",
224
- value: { type: "unit", value: 5, unit: "px" }
225
- },
226
- {
227
- property: "cursor",
228
- value: { type: "keyword", value: "pointer" }
229
- },
230
- {
231
- property: "backgroundColor",
232
- value: {
233
- type: "rgb",
234
- r: 18,
235
- g: 18,
236
- b: 18,
237
- alpha: 1
238
- }
239
- },
240
- {
241
- property: "color",
242
- value: {
243
- type: "rgb",
244
- r: 255,
245
- g: 255,
246
- b: 255,
247
- alpha: 1
248
- }
249
- },
250
- {
251
- state: ":hover",
252
- property: "backgroundColor",
253
- value: {
254
- type: "rgb",
255
- r: 0,
256
- g: 173,
257
- b: 239,
258
- alpha: 1
259
- }
260
- }
261
- ],
262
- children: [
263
- {
264
- type: "instance",
265
- component: "Box",
266
- label: "Play Icon",
267
- styles: [
268
- {
269
- property: "width",
270
- value: { type: "unit", value: 60, unit: "px" }
271
- },
272
- {
273
- property: "height",
274
- value: { type: "unit", value: 60, unit: "px" }
275
- }
276
- ],
277
- props: [
278
- {
279
- type: "string",
280
- name: "aria-hidden",
281
- value: "true"
282
- }
283
- ],
284
- children: [
285
- {
286
- type: "instance",
287
- component: "HtmlEmbed",
288
- label: "Play SVG",
289
- props: [
290
- {
291
- type: "string",
292
- name: "code",
293
- value: p
294
- }
295
- ],
296
- children: []
297
- }
298
- ]
299
- }
300
- ]
301
- }
302
- ]
303
- }
304
- ]
305
- }, u = [
15
+ }
16
+ }, e = [
306
17
  "id",
307
18
  "className",
308
19
  "url",
20
+ "title",
309
21
  "quality",
310
22
  "loading",
311
23
  "showPreview",
@@ -318,11 +30,11 @@ const n = {
318
30
  "showTitle",
319
31
  "showControls",
320
32
  "controlsColor"
321
- ], d = {
322
- props: a,
323
- initialProps: u
33
+ ], m = {
34
+ props: i,
35
+ initialProps: e
324
36
  };
325
37
  export {
326
- s as meta,
327
- d as propsMeta
38
+ c as meta,
39
+ m as propsMeta
328
40
  };
@@ -0,0 +1,49 @@
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 = {
4
+ category: "data",
5
+ order: 1,
6
+ description: "Collect user data and send it to any webhook.",
7
+ template: /* @__PURE__ */ r(
8
+ e.Form,
9
+ {
10
+ state: o`${n}`,
11
+ onStateChange: new i(["state"], o`${n} = state`),
12
+ children: [
13
+ /* @__PURE__ */ r(
14
+ e.Box,
15
+ {
16
+ "ws:label": "Form Content",
17
+ "ws:show": o`${n} === 'initial' || ${n} === 'error'`,
18
+ children: [
19
+ /* @__PURE__ */ t(e.Label, { children: new a("Name") }),
20
+ /* @__PURE__ */ t(e.Input, { name: "name" }),
21
+ /* @__PURE__ */ t(e.Label, { children: new a("Email") }),
22
+ /* @__PURE__ */ t(e.Input, { name: "email" }),
23
+ /* @__PURE__ */ t(e.Button, { children: new a("Submit") })
24
+ ]
25
+ }
26
+ ),
27
+ /* @__PURE__ */ t(
28
+ e.Box,
29
+ {
30
+ "ws:label": "Success Message",
31
+ "ws:show": o`${n} === 'success'`,
32
+ children: new a("Thank you for getting in touch!")
33
+ }
34
+ ),
35
+ /* @__PURE__ */ t(
36
+ e.Box,
37
+ {
38
+ "ws:label": "Error Message",
39
+ "ws:show": o`${n} === 'error'`,
40
+ children: new a("Sorry, something went wrong.")
41
+ }
42
+ )
43
+ ]
44
+ }
45
+ )
46
+ };
47
+ export {
48
+ w as meta
49
+ };
@@ -1,127 +1,26 @@
1
- import { meta as t } from "./form.ws.js";
2
- import { showAttribute as e } from "@webstudio-is/react-sdk";
3
- import { props as o } from "./__generated__/webhook-form.props.js";
4
- import { WebhookFormIcon as a } from "@webstudio-is/icons/svg";
5
- const c = {
6
- ...t,
7
- category: "data",
1
+ import { WebhookFormIcon as o } from "@webstudio-is/icons/svg";
2
+ import { form as t } from "@webstudio-is/sdk/normalize.css";
3
+ import { props as e } from "./__generated__/webhook-form.props.js";
4
+ const n = {
8
5
  label: "Webhook Form",
9
- description: "Collect user data and send it to any webhook.",
10
- order: 1,
11
- icon: a,
6
+ icon: o,
7
+ type: "container",
8
+ constraints: {
9
+ relation: "ancestor",
10
+ component: { $nin: ["Form", "Button", "Link"] }
11
+ },
12
+ presetStyle: {
13
+ form: t
14
+ },
12
15
  states: [
13
16
  { selector: "[data-state=error]", label: "Error" },
14
17
  { selector: "[data-state=success]", label: "Success" }
15
- ],
16
- template: [
17
- {
18
- type: "instance",
19
- component: "Form",
20
- variables: {
21
- formState: { initialValue: "initial" }
22
- },
23
- props: [
24
- {
25
- type: "expression",
26
- name: "state",
27
- code: "formState"
28
- },
29
- {
30
- type: "action",
31
- name: "onStateChange",
32
- value: [
33
- { type: "execute", args: ["state"], code: "formState = state" }
34
- ]
35
- }
36
- ],
37
- children: [
38
- {
39
- type: "instance",
40
- label: "Form Content",
41
- component: "Box",
42
- props: [
43
- {
44
- type: "expression",
45
- name: e,
46
- code: "formState === 'initial' || formState === 'error'"
47
- }
48
- ],
49
- children: [
50
- {
51
- type: "instance",
52
- component: "Label",
53
- children: [{ type: "text", value: "Name", placeholder: !0 }]
54
- },
55
- {
56
- type: "instance",
57
- component: "Input",
58
- props: [{ type: "string", name: "name", value: "name" }],
59
- children: []
60
- },
61
- {
62
- type: "instance",
63
- component: "Label",
64
- children: [{ type: "text", value: "Email", placeholder: !0 }]
65
- },
66
- {
67
- type: "instance",
68
- component: "Input",
69
- props: [{ type: "string", name: "name", value: "email" }],
70
- children: []
71
- },
72
- {
73
- type: "instance",
74
- component: "Button",
75
- children: [{ type: "text", value: "Submit", placeholder: !0 }]
76
- }
77
- ]
78
- },
79
- {
80
- type: "instance",
81
- label: "Success Message",
82
- component: "Box",
83
- props: [
84
- {
85
- type: "expression",
86
- name: e,
87
- code: "formState === 'success'"
88
- }
89
- ],
90
- children: [
91
- {
92
- type: "text",
93
- value: "Thank you for getting in touch!",
94
- placeholder: !0
95
- }
96
- ]
97
- },
98
- {
99
- type: "instance",
100
- label: "Error Message",
101
- component: "Box",
102
- props: [
103
- {
104
- type: "expression",
105
- name: e,
106
- code: "formState === 'error'"
107
- }
108
- ],
109
- children: [
110
- {
111
- type: "text",
112
- value: "Sorry, something went wrong.",
113
- placeholder: !0
114
- }
115
- ]
116
- }
117
- ]
118
- }
119
18
  ]
120
- }, i = {
121
- props: o,
19
+ }, c = {
20
+ props: e,
122
21
  initialProps: ["id", "className", "state", "action"]
123
22
  };
124
23
  export {
125
- c as meta,
126
- i as propsMeta
24
+ n as meta,
25
+ c as propsMeta
127
26
  };
package/lib/xml-node.js CHANGED
@@ -1,25 +1,29 @@
1
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(
2
+ import { ReactSdkContext as y, xmlNodeTagSuffix as g } from "@webstudio-is/react-sdk/runtime";
3
+ import { forwardRef as u, useContext as x, createElement as b, Children as h } from "react";
4
+ const N = u(
5
+ ({ tag: a = "", children: e, ...o }, c) => {
6
+ const { renderer: f } = x(y), s = Object.entries(o).filter(
7
7
  ([t]) => t.startsWith("data-") === !1 && t.startsWith("aria-") === !1
8
- ).filter(([t]) => t !== "tabIndex").filter(([, t]) => typeof t != "function");
8
+ ).filter(([t]) => t !== "tabIndex").filter(([, t]) => typeof t != "function"), r = a.replace(/^[^\p{L}_]+/u, "").replaceAll(/[^\p{L}\p{N}\-._:]+/gu, "").trim();
9
9
  if (f === void 0) {
10
10
  const t = Object.fromEntries(s);
11
- return u(i, t, e);
11
+ return b(
12
+ `${r}${g}`,
13
+ t,
14
+ e
15
+ );
12
16
  }
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)}`
17
+ const i = h.toArray(e), l = i.length > 0 && i.every((t) => typeof t == "string"), m = s.map(
18
+ ([t, d]) => `${t}=${JSON.stringify(d)}`
15
19
  );
16
20
  return /* @__PURE__ */ n("div", { ...o, children: [
17
21
  /* @__PURE__ */ n("span", { style: { color: "rgb(16, 23, 233)" }, children: [
18
22
  "<",
19
- [a, ...d].join(" "),
23
+ [r, ...m].join(" "),
20
24
  ">"
21
25
  ] }),
22
- r.length > 0 && /* @__PURE__ */ p(
26
+ i.length > 0 && /* @__PURE__ */ p(
23
27
  "div",
24
28
  {
25
29
  ref: c,
@@ -32,13 +36,13 @@ const x = b(
32
36
  ),
33
37
  /* @__PURE__ */ n("span", { style: { color: "rgb(16, 23, 233)" }, children: [
34
38
  "</",
35
- a,
39
+ r,
36
40
  ">"
37
41
  ] })
38
42
  ] });
39
43
  }
40
44
  );
41
- x.displayName = "XmlNode";
45
+ N.displayName = "XmlNode";
42
46
  export {
43
- x as XmlNode
47
+ N as XmlNode
44
48
  };
@@ -1,18 +1,17 @@
1
1
  import { XmlIcon as o } from "@webstudio-is/icons/svg";
2
- import "@webstudio-is/react-sdk";
3
2
  import { props as t } from "./__generated__/xml-node.props.js";
4
- const i = {
3
+ const p = {
5
4
  category: "xml",
6
5
  order: 6,
7
6
  type: "container",
8
7
  icon: o,
9
8
  stylable: !1,
10
9
  description: "XML Node"
11
- }, a = {
10
+ }, i = {
12
11
  props: t,
13
12
  initialProps: ["tag"]
14
13
  };
15
14
  export {
16
- i as meta,
17
- a as propsMeta
15
+ p as meta,
16
+ i as propsMeta
18
17
  };
@@ -1,18 +1,17 @@
1
1
  import { CalendarIcon as t } from "@webstudio-is/icons/svg";
2
- import "@webstudio-is/react-sdk";
3
2
  import { props as e } from "./__generated__/xml-time.props.js";
4
- const i = {
3
+ const r = {
5
4
  category: "xml",
6
5
  type: "container",
7
6
  description: "Converts machine-readable date and time to ISO format.",
8
7
  icon: t,
9
8
  stylable: !1,
10
9
  order: 7
11
- }, n = {
10
+ }, i = {
12
11
  props: e,
13
12
  initialProps: ["datetime", "dateStyle"]
14
13
  };
15
14
  export {
16
- i as meta,
17
- n as propsMeta
15
+ r as meta,
16
+ i as propsMeta
18
17
  };