@webstudio-is/sdk-components-react 0.71.0 → 0.73.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 (178) hide show
  1. package/lib/__generated__/button.props.js +0 -6
  2. package/lib/__generated__/image.props.js +0 -1
  3. package/lib/__generated__/link-block.props.js +1 -7
  4. package/lib/__generated__/link.props.js +1 -7
  5. package/lib/__generated__/rich-text-link.props.js +1 -7
  6. package/lib/__generated__/{radio-button-field.props.js → vimeo-play-button.props.js} +14 -0
  7. package/lib/__generated__/vimeo-preview-image.props.js +441 -0
  8. package/lib/__generated__/{checkbox-field.props.js → vimeo-spinner.props.js} +0 -1
  9. package/lib/__generated__/vimeo.props.js +555 -0
  10. package/lib/blockquote.ws.js +1 -1
  11. package/lib/box.js +2 -1
  12. package/lib/button.js +1 -6
  13. package/lib/button.ws.js +9 -2
  14. package/lib/checkbox.ws.js +19 -1
  15. package/lib/cjs/__generated__/button.props.js +0 -6
  16. package/lib/cjs/__generated__/image.props.js +0 -1
  17. package/lib/cjs/__generated__/link-block.props.js +1 -7
  18. package/lib/cjs/__generated__/link.props.js +1 -7
  19. package/lib/cjs/__generated__/rich-text-link.props.js +1 -7
  20. package/lib/cjs/__generated__/{text-block.props.js → text.props.js} +3 -3
  21. package/lib/cjs/__generated__/{radio-button-field.props.js → vimeo-play-button.props.js} +17 -3
  22. package/lib/cjs/__generated__/vimeo-preview-image.props.js +461 -0
  23. package/lib/cjs/__generated__/{checkbox-field.props.js → vimeo-spinner.props.js} +3 -4
  24. package/lib/cjs/__generated__/vimeo.props.js +575 -0
  25. package/lib/cjs/blockquote.ws.js +1 -1
  26. package/lib/cjs/box.js +2 -1
  27. package/lib/cjs/button.js +1 -6
  28. package/lib/cjs/button.ws.js +9 -2
  29. package/lib/cjs/checkbox.ws.js +19 -1
  30. package/lib/cjs/code-text.ws.js +1 -1
  31. package/lib/cjs/components.js +11 -9
  32. package/lib/cjs/heading.ws.js +1 -1
  33. package/lib/cjs/image.js +3 -3
  34. package/lib/cjs/image.ws.js +12 -9
  35. package/lib/cjs/label.ws.js +3 -6
  36. package/lib/cjs/link.js +1 -1
  37. package/lib/cjs/link.ws.js +3 -3
  38. package/lib/cjs/list-item.ws.js +1 -1
  39. package/lib/cjs/metas.js +11 -9
  40. package/lib/cjs/paragraph.ws.js +2 -2
  41. package/lib/cjs/props.js +11 -9
  42. package/lib/cjs/radio-button.ws.js +19 -1
  43. package/lib/cjs/rich-text-link.ws.js +3 -10
  44. package/lib/cjs/span.ws.js +1 -1
  45. package/lib/cjs/{text-block.js → text.js} +6 -6
  46. package/lib/cjs/{text-block.ws.js → text.ws.js} +10 -10
  47. package/lib/cjs/{link-block.js → vimeo-play-button.js} +17 -9
  48. package/lib/cjs/{link-block.ws.js → vimeo-play-button.ws.js} +13 -22
  49. package/lib/cjs/vimeo-preview-image.js +40 -0
  50. package/lib/cjs/{radio-button-field.js → vimeo-preview-image.ws.js} +17 -10
  51. package/lib/cjs/{checkbox-field.js → vimeo-spinner.js} +16 -8
  52. package/lib/cjs/{checkbox-field.ws.js → vimeo-spinner.ws.js} +11 -30
  53. package/lib/cjs/vimeo.js +294 -0
  54. package/lib/cjs/vimeo.ws.js +345 -0
  55. package/lib/code-text.ws.js +1 -1
  56. package/lib/components.js +11 -9
  57. package/lib/heading.ws.js +1 -1
  58. package/lib/image.js +6 -5
  59. package/lib/image.ws.js +12 -9
  60. package/lib/label.ws.js +4 -7
  61. package/lib/link.js +3 -3
  62. package/lib/link.ws.js +3 -3
  63. package/lib/list-item.ws.js +1 -1
  64. package/lib/metas.js +52 -50
  65. package/lib/paragraph.ws.js +2 -2
  66. package/lib/props.js +52 -50
  67. package/lib/radio-button.ws.js +19 -1
  68. package/lib/rich-text-link.ws.js +3 -10
  69. package/lib/span.ws.js +1 -1
  70. package/lib/{text-block.js → text.js} +3 -3
  71. package/lib/{text-block.ws.js → text.ws.js} +7 -7
  72. package/lib/types/__generated__/vimeo-spinner.props.d.ts +2 -0
  73. package/lib/types/__generated__/vimeo.props.d.ts +2 -0
  74. package/lib/types/box.d.ts +1 -1
  75. package/lib/types/button.d.ts +2 -6
  76. package/lib/types/button.stories.d.ts +2 -6
  77. package/lib/types/components.d.ts +5 -4
  78. package/lib/types/image.d.ts +5 -6
  79. package/lib/types/image.stories.d.ts +555 -6
  80. package/lib/types/image.ws.d.ts +8 -0
  81. package/lib/types/link.d.ts +1 -3
  82. package/lib/types/link.stories.d.ts +2 -6
  83. package/lib/types/metas.d.ts +5 -4
  84. package/lib/types/props.d.ts +5 -4
  85. package/lib/types/rich-text-link.stories.d.ts +2 -6
  86. package/lib/types/{text-block.d.ts → text.d.ts} +1 -1
  87. package/lib/types/{text-block.stories.d.ts → text.stories.d.ts} +1 -1
  88. package/lib/types/vimeo-play-button.d.ts +4 -0
  89. package/lib/types/vimeo-play-button.stories.d.ts +5 -0
  90. package/lib/types/vimeo-preview-image.d.ts +281 -0
  91. package/lib/types/vimeo-preview-image.stories.d.ts +562 -0
  92. package/lib/types/vimeo-spinner.d.ts +2 -0
  93. package/lib/types/vimeo-spinner.stories.d.ts +5 -0
  94. package/lib/types/{link-block.ws.d.ts → vimeo-spinner.ws.d.ts} +1 -1
  95. package/lib/types/vimeo.d.ts +73 -0
  96. package/lib/types/vimeo.stories.d.ts +71 -0
  97. package/lib/types/vimeo.ws.d.ts +3 -0
  98. package/lib/vimeo-play-button.js +21 -0
  99. package/lib/vimeo-play-button.ws.js +26 -0
  100. package/lib/vimeo-preview-image.js +23 -0
  101. package/lib/vimeo-preview-image.ws.js +20 -0
  102. package/lib/vimeo-spinner.js +20 -0
  103. package/lib/vimeo-spinner.ws.js +25 -0
  104. package/lib/vimeo.js +282 -0
  105. package/lib/vimeo.ws.js +327 -0
  106. package/package.json +9 -7
  107. package/src/LICENSE +21 -0
  108. package/src/__generated__/button.props.ts +0 -6
  109. package/src/__generated__/image.props.ts +0 -1
  110. package/src/__generated__/link-block.props.ts +1 -7
  111. package/src/__generated__/link.props.ts +1 -7
  112. package/src/__generated__/rich-text-link.props.ts +1 -7
  113. package/src/__generated__/{checkbox-field.props.ts → vimeo-play-button.props.ts} +14 -0
  114. package/src/__generated__/vimeo-preview-image.props.ts +486 -0
  115. package/src/__generated__/{radio-button-field.props.ts → vimeo-spinner.props.ts} +0 -1
  116. package/src/__generated__/vimeo.props.ts +621 -0
  117. package/src/blockquote.ws.tsx +1 -1
  118. package/src/box.tsx +1 -1
  119. package/src/button.tsx +3 -11
  120. package/src/button.ws.tsx +8 -1
  121. package/src/checkbox.ws.tsx +19 -1
  122. package/src/code-text.ws.tsx +1 -1
  123. package/src/components.ts +5 -4
  124. package/src/heading.ws.tsx +1 -1
  125. package/src/image.tsx +6 -5
  126. package/src/image.ws.tsx +11 -9
  127. package/src/label.ws.tsx +4 -7
  128. package/src/link.tsx +5 -11
  129. package/src/link.ws.tsx +3 -3
  130. package/src/list-item.ws.tsx +1 -1
  131. package/src/metas.ts +5 -4
  132. package/src/paragraph.ws.tsx +2 -2
  133. package/src/props.ts +5 -4
  134. package/src/radio-button.ws.tsx +19 -1
  135. package/src/rich-text-link.ws.tsx +3 -11
  136. package/src/span.ws.tsx +1 -1
  137. package/src/text.stories.tsx +16 -0
  138. package/src/{text-block.tsx → text.tsx} +2 -2
  139. package/src/{text-block.ws.tsx → text.ws.tsx} +8 -8
  140. package/src/vimeo-play-button.stories.tsx +17 -0
  141. package/src/vimeo-play-button.tsx +24 -0
  142. package/src/vimeo-play-button.ws.ts +29 -0
  143. package/src/vimeo-preview-image.stories.tsx +17 -0
  144. package/src/vimeo-preview-image.tsx +30 -0
  145. package/src/vimeo-preview-image.ws.ts +22 -0
  146. package/src/vimeo-spinner.stories.tsx +17 -0
  147. package/src/vimeo-spinner.tsx +25 -0
  148. package/src/vimeo-spinner.ws.ts +27 -0
  149. package/src/vimeo.stories.tsx +17 -0
  150. package/src/vimeo.tsx +430 -0
  151. package/src/vimeo.ws.ts +331 -0
  152. package/lib/checkbox-field.js +0 -9
  153. package/lib/checkbox-field.ws.js +0 -44
  154. package/lib/cjs/radio-button-field.ws.js +0 -62
  155. package/lib/link-block.js +0 -10
  156. package/lib/link-block.ws.js +0 -33
  157. package/lib/radio-button-field.js +0 -9
  158. package/lib/radio-button-field.ws.js +0 -44
  159. package/lib/types/checkbox-field.d.ts +0 -3
  160. package/lib/types/link-block.d.ts +0 -3
  161. package/lib/types/link-block.stories.d.ts +0 -13
  162. package/lib/types/radio-button-field.d.ts +0 -3
  163. package/src/checkbox-field.tsx +0 -10
  164. package/src/checkbox-field.ws.tsx +0 -47
  165. package/src/link-block.stories.tsx +0 -16
  166. package/src/link-block.tsx +0 -9
  167. package/src/link-block.ws.tsx +0 -38
  168. package/src/radio-button-field.tsx +0 -10
  169. package/src/radio-button-field.ws.tsx +0 -47
  170. package/src/text-block.stories.tsx +0 -16
  171. /package/lib/__generated__/{text-block.props.js → text.props.js} +0 -0
  172. /package/lib/types/__generated__/{checkbox-field.props.d.ts → text.props.d.ts} +0 -0
  173. /package/lib/types/__generated__/{radio-button-field.props.d.ts → vimeo-play-button.props.d.ts} +0 -0
  174. /package/lib/types/__generated__/{text-block.props.d.ts → vimeo-preview-image.props.d.ts} +0 -0
  175. /package/lib/types/{checkbox-field.ws.d.ts → text.ws.d.ts} +0 -0
  176. /package/lib/types/{radio-button-field.ws.d.ts → vimeo-play-button.ws.d.ts} +0 -0
  177. /package/lib/types/{text-block.ws.d.ts → vimeo-preview-image.ws.d.ts} +0 -0
  178. /package/src/__generated__/{text-block.props.ts → text.props.ts} +0 -0
@@ -0,0 +1,345 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var vimeo_ws_exports = {};
20
+ __export(vimeo_ws_exports, {
21
+ meta: () => meta,
22
+ propsMeta: () => propsMeta
23
+ });
24
+ module.exports = __toCommonJS(vimeo_ws_exports);
25
+ var import_svg = require("@webstudio-is/icons/svg");
26
+ var import_react_sdk = require("@webstudio-is/react-sdk");
27
+ var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
28
+ var import_vimeo = require("./__generated__/vimeo.props");
29
+ const presetStyle = {
30
+ div: import_css_normalize.div
31
+ };
32
+ const meta = {
33
+ category: "media",
34
+ type: "container",
35
+ label: "Vimeo",
36
+ order: 1,
37
+ icon: import_svg.VimeoIcon,
38
+ states: import_react_sdk.defaultStates,
39
+ presetStyle,
40
+ template: [
41
+ {
42
+ type: "instance",
43
+ component: "Vimeo",
44
+ styles: [
45
+ {
46
+ property: "position",
47
+ value: { type: "keyword", value: "relative" }
48
+ },
49
+ {
50
+ property: "aspectRatio",
51
+ value: { type: "keyword", value: "640/360" }
52
+ },
53
+ {
54
+ property: "width",
55
+ value: { type: "unit", value: 100, unit: "%" }
56
+ }
57
+ ],
58
+ children: [
59
+ {
60
+ type: "instance",
61
+ component: "VimeoPreviewImage",
62
+ styles: [
63
+ {
64
+ property: "position",
65
+ value: { type: "keyword", value: "absolute" }
66
+ },
67
+ {
68
+ property: "objectFit",
69
+ value: { type: "keyword", value: "cover" }
70
+ },
71
+ {
72
+ property: "width",
73
+ value: { type: "unit", value: 100, unit: "%" }
74
+ },
75
+ {
76
+ property: "height",
77
+ value: { type: "unit", value: 100, unit: "%" }
78
+ },
79
+ {
80
+ property: "borderTopLeftRadius",
81
+ value: { type: "unit", value: 20, unit: "px" }
82
+ },
83
+ {
84
+ property: "borderTopRightRadius",
85
+ value: { type: "unit", value: 20, unit: "px" }
86
+ },
87
+ {
88
+ property: "borderBottomLeftRadius",
89
+ value: { type: "unit", value: 20, unit: "px" }
90
+ },
91
+ {
92
+ property: "borderBottomRightRadius",
93
+ value: { type: "unit", value: 20, unit: "px" }
94
+ },
95
+ {
96
+ property: "objectPosition",
97
+ value: { type: "keyword", value: "cover" }
98
+ }
99
+ ],
100
+ children: [],
101
+ props: [
102
+ {
103
+ type: "string",
104
+ name: "alt",
105
+ value: "Vimeo video preview image"
106
+ },
107
+ {
108
+ type: "string",
109
+ name: "sizes",
110
+ value: "100vw"
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ type: "instance",
116
+ component: "Box",
117
+ label: "Spinner",
118
+ styles: [
119
+ {
120
+ property: "position",
121
+ value: { type: "keyword", value: "absolute" }
122
+ },
123
+ {
124
+ property: "top",
125
+ value: { type: "unit", value: 50, unit: "%" }
126
+ },
127
+ {
128
+ property: "left",
129
+ value: { type: "unit", value: 50, unit: "%" }
130
+ },
131
+ {
132
+ property: "width",
133
+ value: { type: "unit", value: 70, unit: "px" }
134
+ },
135
+ {
136
+ property: "height",
137
+ value: { type: "unit", value: 70, unit: "px" }
138
+ },
139
+ {
140
+ property: "marginTop",
141
+ value: { type: "unit", value: -35, unit: "px" }
142
+ },
143
+ {
144
+ property: "marginLeft",
145
+ value: { type: "unit", value: -35, unit: "px" }
146
+ }
147
+ ],
148
+ children: [
149
+ {
150
+ type: "instance",
151
+ component: "HtmlEmbed",
152
+ label: "Spinner SVG",
153
+ props: [
154
+ {
155
+ type: "string",
156
+ name: "code",
157
+ value: import_svg.SpinnerIcon
158
+ }
159
+ ],
160
+ children: []
161
+ }
162
+ ]
163
+ },
164
+ {
165
+ type: "instance",
166
+ component: "VimeoPlayButton",
167
+ props: [
168
+ {
169
+ type: "string",
170
+ name: "aria-label",
171
+ value: "Play button"
172
+ }
173
+ ],
174
+ styles: [
175
+ {
176
+ property: "position",
177
+ value: { type: "keyword", value: "absolute" }
178
+ },
179
+ {
180
+ property: "width",
181
+ value: { type: "unit", value: 140, unit: "px" }
182
+ },
183
+ {
184
+ property: "height",
185
+ value: { type: "unit", value: 80, unit: "px" }
186
+ },
187
+ {
188
+ property: "top",
189
+ value: { type: "unit", value: 50, unit: "%" }
190
+ },
191
+ {
192
+ property: "left",
193
+ value: { type: "unit", value: 50, unit: "%" }
194
+ },
195
+ {
196
+ property: "marginTop",
197
+ value: { type: "unit", value: -40, unit: "px" }
198
+ },
199
+ {
200
+ property: "marginLeft",
201
+ value: { type: "unit", value: -70, unit: "px" }
202
+ },
203
+ {
204
+ property: "display",
205
+ value: { type: "keyword", value: "flex" }
206
+ },
207
+ {
208
+ property: "alignItems",
209
+ value: { type: "keyword", value: "center" }
210
+ },
211
+ {
212
+ property: "justifyContent",
213
+ value: { type: "keyword", value: "center" }
214
+ },
215
+ {
216
+ property: "borderTopStyle",
217
+ value: { type: "keyword", value: "none" }
218
+ },
219
+ {
220
+ property: "borderRightStyle",
221
+ value: { type: "keyword", value: "none" }
222
+ },
223
+ {
224
+ property: "borderBottomStyle",
225
+ value: { type: "keyword", value: "none" }
226
+ },
227
+ {
228
+ property: "borderLeftStyle",
229
+ value: { type: "keyword", value: "none" }
230
+ },
231
+ {
232
+ property: "borderTopLeftRadius",
233
+ value: { type: "unit", value: 5, unit: "px" }
234
+ },
235
+ {
236
+ property: "borderTopRightRadius",
237
+ value: { type: "unit", value: 5, unit: "px" }
238
+ },
239
+ {
240
+ property: "borderBottomLeftRadius",
241
+ value: { type: "unit", value: 5, unit: "px" }
242
+ },
243
+ {
244
+ property: "borderBottomRightRadius",
245
+ value: { type: "unit", value: 5, unit: "px" }
246
+ },
247
+ {
248
+ property: "cursor",
249
+ value: { type: "keyword", value: "pointer" }
250
+ },
251
+ {
252
+ property: "backgroundColor",
253
+ value: {
254
+ type: "rgb",
255
+ r: 18,
256
+ g: 18,
257
+ b: 18,
258
+ alpha: 1
259
+ }
260
+ },
261
+ {
262
+ property: "color",
263
+ value: {
264
+ type: "rgb",
265
+ r: 255,
266
+ g: 255,
267
+ b: 255,
268
+ alpha: 1
269
+ }
270
+ },
271
+ {
272
+ state: ":hover",
273
+ property: "backgroundColor",
274
+ value: {
275
+ type: "rgb",
276
+ r: 0,
277
+ g: 173,
278
+ b: 239,
279
+ alpha: 1
280
+ }
281
+ }
282
+ ],
283
+ children: [
284
+ {
285
+ type: "instance",
286
+ component: "Box",
287
+ label: "Play Icon",
288
+ styles: [
289
+ {
290
+ property: "width",
291
+ value: { type: "unit", value: 60, unit: "px" }
292
+ },
293
+ {
294
+ property: "height",
295
+ value: { type: "unit", value: 60, unit: "px" }
296
+ }
297
+ ],
298
+ props: [
299
+ {
300
+ type: "string",
301
+ name: "aria-hidden",
302
+ value: "true"
303
+ }
304
+ ],
305
+ children: [
306
+ {
307
+ type: "instance",
308
+ component: "HtmlEmbed",
309
+ label: "Play SVG",
310
+ props: [
311
+ {
312
+ type: "string",
313
+ name: "code",
314
+ value: import_svg.PlayIcon
315
+ }
316
+ ],
317
+ children: []
318
+ }
319
+ ]
320
+ }
321
+ ]
322
+ }
323
+ ]
324
+ }
325
+ ]
326
+ };
327
+ const initialProps = [
328
+ "url",
329
+ "quality",
330
+ "showPreview",
331
+ "autoplay",
332
+ "backgroundMode",
333
+ "doNotTrack",
334
+ "loop",
335
+ "muted",
336
+ "showPortrait",
337
+ "showByline",
338
+ "showTitle",
339
+ "showControls",
340
+ "controlsColor"
341
+ ];
342
+ const propsMeta = {
343
+ props: import_vimeo.props,
344
+ initialProps
345
+ };
@@ -32,7 +32,7 @@ const presetStyle = {
32
32
  };
33
33
  const meta = {
34
34
  category: "general",
35
- type: "rich-text",
35
+ type: "container",
36
36
  label: "Code Text",
37
37
  icon: CodeTextIcon,
38
38
  states: defaultStates,
package/lib/components.js CHANGED
@@ -3,11 +3,10 @@ import { Fragment } from "./fragment";
3
3
  import { HtmlEmbed } from "./html-embed";
4
4
  import { Body } from "./body";
5
5
  import { Box } from "./box";
6
- import { TextBlock } from "./text-block";
6
+ import { Text } from "./text";
7
7
  import { Heading } from "./heading";
8
8
  import { Paragraph } from "./paragraph";
9
9
  import { Link } from "./link";
10
- import { LinkBlock } from "./link-block";
11
10
  import { RichTextLink } from "./rich-text-link";
12
11
  import { Span } from "./span";
13
12
  import { Bold } from "./bold";
@@ -27,10 +26,12 @@ import { Label } from "./label";
27
26
  import { SuccessMessage } from "./success-message";
28
27
  import { ErrorMessage } from "./error-message";
29
28
  import { Textarea } from "./textarea";
30
- import { RadioButtonField } from "./radio-button-field";
31
29
  import { RadioButton } from "./radio-button";
32
- import { CheckboxField } from "./checkbox-field";
33
30
  import { Checkbox } from "./checkbox";
31
+ import { Vimeo } from "./vimeo";
32
+ import { VimeoPreviewImage } from "./vimeo-preview-image";
33
+ import { VimeoPlayButton } from "./vimeo-play-button";
34
+ import { VimeoSpinner } from "./vimeo-spinner";
34
35
  export {
35
36
  Blockquote,
36
37
  Body,
@@ -38,7 +39,6 @@ export {
38
39
  Box,
39
40
  Button,
40
41
  Checkbox,
41
- CheckboxField,
42
42
  CodeText,
43
43
  ErrorMessage,
44
44
  Form,
@@ -50,12 +50,10 @@ export {
50
50
  Italic,
51
51
  Label,
52
52
  Link,
53
- LinkBlock,
54
53
  List,
55
54
  ListItem,
56
55
  Paragraph,
57
56
  RadioButton,
58
- RadioButtonField,
59
57
  RichTextLink,
60
58
  Separator,
61
59
  Slot,
@@ -63,6 +61,10 @@ export {
63
61
  Subscript,
64
62
  SuccessMessage,
65
63
  Superscript,
66
- TextBlock,
67
- Textarea
64
+ Text,
65
+ Textarea,
66
+ Vimeo,
67
+ VimeoPlayButton,
68
+ VimeoPreviewImage,
69
+ VimeoSpinner
68
70
  };
package/lib/heading.ws.js CHANGED
@@ -14,7 +14,7 @@ const presetStyle = {
14
14
  };
15
15
  const meta = {
16
16
  category: "text",
17
- type: "rich-text",
17
+ type: "container",
18
18
  label: "Heading",
19
19
  icon: HeadingIcon,
20
20
  states: defaultStates,
package/lib/image.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import {
3
3
  forwardRef,
4
- useMemo
4
+ useMemo,
5
+ useContext
5
6
  } from "react";
6
7
  import {
7
8
  Image as WebstudioImage,
@@ -10,7 +11,7 @@ import {
10
11
  import {
11
12
  usePropAsset,
12
13
  getInstanceIdFromComponentProps,
13
- getParams
14
+ ReactSdkContext
14
15
  } from "@webstudio-is/react-sdk";
15
16
  const defaultTag = "img";
16
17
  const imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
@@ -38,11 +39,11 @@ const imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
38
39
  </svg>`)}`;
39
40
  const Image = forwardRef(
40
41
  (props, ref) => {
42
+ const { imageBaseUrl } = useContext(ReactSdkContext);
41
43
  const asset = usePropAsset(getInstanceIdFromComponentProps(props), "src");
42
44
  const loader = useMemo(() => {
43
- const params = getParams();
44
- return createImageLoader({ imageBaseUrl: params.imageBaseUrl });
45
- }, []);
45
+ return createImageLoader({ imageBaseUrl });
46
+ }, [imageBaseUrl]);
46
47
  const src = asset?.name ?? props.src;
47
48
  if (asset == null || loader == null) {
48
49
  return /* @__PURE__ */ jsx("img", { ...props, src: src || imagePlaceholderSvg, ref }, src);
package/lib/image.ws.js CHANGED
@@ -29,20 +29,23 @@ const meta = {
29
29
  presetStyle,
30
30
  order: 0
31
31
  };
32
- const { loader, ...publicProps } = props;
32
+ const propsOverrides = {
33
+ src: {
34
+ type: "string",
35
+ control: "file",
36
+ label: "Source",
37
+ required: false
38
+ }
39
+ };
33
40
  const propsMeta = {
34
41
  props: {
35
- ...publicProps,
36
- src: {
37
- type: "string",
38
- control: "file",
39
- label: "Source",
40
- required: false
41
- }
42
+ ...props,
43
+ ...propsOverrides
42
44
  },
43
45
  initialProps: ["src", "width", "height", "alt", "loading"]
44
46
  };
45
47
  export {
46
48
  meta,
47
- propsMeta
49
+ propsMeta,
50
+ propsOverrides
48
51
  };
package/lib/label.ws.js CHANGED
@@ -1,4 +1,4 @@
1
- import { TextBlockIcon } from "@webstudio-is/icons/svg";
1
+ import { TextIcon } from "@webstudio-is/icons/svg";
2
2
  import {
3
3
  defaultStates
4
4
  } from "@webstudio-is/react-sdk";
@@ -12,9 +12,9 @@ const presetStyle = {
12
12
  };
13
13
  const meta = {
14
14
  category: "forms",
15
- type: "rich-text",
15
+ type: "container",
16
16
  label: "Input Label",
17
- icon: TextBlockIcon,
17
+ icon: TextIcon,
18
18
  states: defaultStates,
19
19
  presetStyle,
20
20
  order: 2,
@@ -30,10 +30,7 @@ const propsMeta = {
30
30
  props: {
31
31
  ...props,
32
32
  htmlFor: {
33
- required: false,
34
- control: "text",
35
- type: "string",
36
- rows: 0,
33
+ ...props.htmlFor,
37
34
  label: "For"
38
35
  }
39
36
  },
package/lib/link.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
2
+ import { forwardRef, useContext } from "react";
3
3
  import {
4
4
  usePropUrl,
5
5
  getInstanceIdFromComponentProps,
6
- getParams
6
+ ReactSdkContext
7
7
  } from "@webstudio-is/react-sdk";
8
8
  const defaultTag = "a";
9
9
  const Link = forwardRef((props, ref) => {
10
+ const { assetBaseUrl } = useContext(ReactSdkContext);
10
11
  const href = usePropUrl(getInstanceIdFromComponentProps(props), "href");
11
- const { assetBaseUrl } = getParams();
12
12
  let url = "#";
13
13
  switch (href?.type) {
14
14
  case "page":
package/lib/link.ws.js CHANGED
@@ -19,8 +19,8 @@ const presetStyle = {
19
19
  };
20
20
  const meta = {
21
21
  category: "general",
22
- type: "rich-text",
23
- label: "Link Text",
22
+ type: "container",
23
+ label: "Link",
24
24
  icon: LinkIcon,
25
25
  presetStyle,
26
26
  order: 1,
@@ -53,7 +53,7 @@ const propsMeta = {
53
53
  required: false
54
54
  }
55
55
  },
56
- initialProps: ["href", "target", "prefetch"]
56
+ initialProps: ["href", "target"]
57
57
  };
58
58
  export {
59
59
  meta,
@@ -9,7 +9,7 @@ const presetStyle = {
9
9
  };
10
10
  const meta = {
11
11
  category: "general",
12
- type: "rich-text",
12
+ type: "container",
13
13
  requiredAncestors: ["List"],
14
14
  label: "List Item",
15
15
  icon: ListItemIcon,
package/lib/metas.js CHANGED
@@ -3,66 +3,68 @@ import { meta as meta2 } from "./fragment.ws";
3
3
  import { meta as meta3 } from "./html-embed.ws";
4
4
  import { meta as meta4 } from "./body.ws";
5
5
  import { meta as meta5 } from "./box.ws";
6
- import { meta as meta6 } from "./text-block.ws";
6
+ import { meta as meta6 } from "./text.ws";
7
7
  import { meta as meta7 } from "./heading.ws";
8
8
  import { meta as meta8 } from "./paragraph.ws";
9
9
  import { meta as meta9 } from "./link.ws";
10
- import { meta as meta10 } from "./link-block.ws";
11
- import { meta as meta11 } from "./rich-text-link.ws";
12
- import { meta as meta12 } from "./span.ws";
13
- import { meta as meta13 } from "./bold.ws";
14
- import { meta as meta14 } from "./italic.ws";
15
- import { meta as meta15 } from "./superscript.ws";
16
- import { meta as meta16 } from "./subscript.ws";
17
- import { meta as meta17 } from "./button.ws";
18
- import { meta as meta18 } from "./input.ws";
19
- import { meta as meta19 } from "./form.ws";
20
- import { meta as meta20 } from "./image.ws";
21
- import { meta as meta21 } from "./blockquote.ws";
22
- import { meta as meta22 } from "./list.ws";
23
- import { meta as meta23 } from "./list-item.ws";
24
- import { meta as meta24 } from "./separator.ws";
25
- import { meta as meta25 } from "./code-text.ws";
26
- import { meta as meta26 } from "./label.ws";
27
- import { meta as meta27 } from "./success-message.ws";
28
- import { meta as meta28 } from "./error-message.ws";
29
- import { meta as meta29 } from "./textarea.ws";
30
- import { meta as meta30 } from "./radio-button-field.ws";
31
- import { meta as meta31 } from "./radio-button.ws";
32
- import { meta as meta32 } from "./checkbox-field.ws";
33
- import { meta as meta33 } from "./checkbox.ws";
10
+ import { meta as meta10 } from "./rich-text-link.ws";
11
+ import { meta as meta11 } from "./span.ws";
12
+ import { meta as meta12 } from "./bold.ws";
13
+ import { meta as meta13 } from "./italic.ws";
14
+ import { meta as meta14 } from "./superscript.ws";
15
+ import { meta as meta15 } from "./subscript.ws";
16
+ import { meta as meta16 } from "./button.ws";
17
+ import { meta as meta17 } from "./input.ws";
18
+ import { meta as meta18 } from "./form.ws";
19
+ import { meta as meta19 } from "./image.ws";
20
+ import { meta as meta20 } from "./blockquote.ws";
21
+ import { meta as meta21 } from "./list.ws";
22
+ import { meta as meta22 } from "./list-item.ws";
23
+ import { meta as meta23 } from "./separator.ws";
24
+ import { meta as meta24 } from "./code-text.ws";
25
+ import { meta as meta25 } from "./label.ws";
26
+ import { meta as meta26 } from "./success-message.ws";
27
+ import { meta as meta27 } from "./error-message.ws";
28
+ import { meta as meta28 } from "./textarea.ws";
29
+ import { meta as meta29 } from "./radio-button.ws";
30
+ import { meta as meta30 } from "./checkbox.ws";
31
+ import { meta as meta31 } from "./vimeo.ws";
32
+ import { meta as meta32 } from "./vimeo-preview-image.ws";
33
+ import { meta as meta33 } from "./vimeo-play-button.ws";
34
+ import { meta as meta34 } from "./vimeo-spinner.ws";
34
35
  export {
35
- meta21 as Blockquote,
36
+ meta20 as Blockquote,
36
37
  meta4 as Body,
37
- meta13 as Bold,
38
+ meta12 as Bold,
38
39
  meta5 as Box,
39
- meta17 as Button,
40
- meta33 as Checkbox,
41
- meta32 as CheckboxField,
42
- meta25 as CodeText,
43
- meta28 as ErrorMessage,
44
- meta19 as Form,
40
+ meta16 as Button,
41
+ meta30 as Checkbox,
42
+ meta24 as CodeText,
43
+ meta27 as ErrorMessage,
44
+ meta18 as Form,
45
45
  meta2 as Fragment,
46
46
  meta7 as Heading,
47
47
  meta3 as HtmlEmbed,
48
- meta20 as Image,
49
- meta18 as Input,
50
- meta14 as Italic,
51
- meta26 as Label,
48
+ meta19 as Image,
49
+ meta17 as Input,
50
+ meta13 as Italic,
51
+ meta25 as Label,
52
52
  meta9 as Link,
53
- meta10 as LinkBlock,
54
- meta22 as List,
55
- meta23 as ListItem,
53
+ meta21 as List,
54
+ meta22 as ListItem,
56
55
  meta8 as Paragraph,
57
- meta31 as RadioButton,
58
- meta30 as RadioButtonField,
59
- meta11 as RichTextLink,
60
- meta24 as Separator,
56
+ meta29 as RadioButton,
57
+ meta10 as RichTextLink,
58
+ meta23 as Separator,
61
59
  meta as Slot,
62
- meta12 as Span,
63
- meta16 as Subscript,
64
- meta27 as SuccessMessage,
65
- meta15 as Superscript,
66
- meta6 as TextBlock,
67
- meta29 as Textarea
60
+ meta11 as Span,
61
+ meta15 as Subscript,
62
+ meta26 as SuccessMessage,
63
+ meta14 as Superscript,
64
+ meta6 as Text,
65
+ meta28 as Textarea,
66
+ meta31 as Vimeo,
67
+ meta33 as VimeoPlayButton,
68
+ meta32 as VimeoPreviewImage,
69
+ meta34 as VimeoSpinner
68
70
  };