@webstudio-is/sdk-components-react 0.70.0 → 0.72.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 (101) hide show
  1. package/lib/__generated__/link-block.props.js +1 -7
  2. package/lib/__generated__/link.props.js +1 -7
  3. package/lib/__generated__/rich-text-link.props.js +1 -7
  4. package/lib/__generated__/vimeo-play-button.props.js +414 -0
  5. package/lib/__generated__/vimeo-preview-image.props.js +442 -0
  6. package/lib/__generated__/vimeo-spinner.props.js +398 -0
  7. package/lib/__generated__/vimeo.props.js +555 -0
  8. package/lib/box.js +2 -1
  9. package/lib/cjs/__generated__/link-block.props.js +1 -7
  10. package/lib/cjs/__generated__/link.props.js +1 -7
  11. package/lib/cjs/__generated__/rich-text-link.props.js +1 -7
  12. package/lib/cjs/__generated__/vimeo-play-button.props.js +434 -0
  13. package/lib/cjs/__generated__/vimeo-preview-image.props.js +462 -0
  14. package/lib/cjs/__generated__/vimeo-spinner.props.js +418 -0
  15. package/lib/cjs/__generated__/vimeo.props.js +575 -0
  16. package/lib/cjs/box.js +2 -1
  17. package/lib/cjs/components.js +9 -1
  18. package/lib/cjs/image.ws.js +11 -7
  19. package/lib/cjs/link-block.ws.js +1 -8
  20. package/lib/cjs/link.ws.js +1 -1
  21. package/lib/cjs/metas.js +9 -1
  22. package/lib/cjs/props.js +9 -1
  23. package/lib/cjs/rich-text-link.ws.js +3 -10
  24. package/lib/cjs/vimeo-play-button.js +38 -0
  25. package/lib/cjs/vimeo-play-button.ws.js +44 -0
  26. package/lib/cjs/vimeo-preview-image.js +40 -0
  27. package/lib/cjs/vimeo-preview-image.ws.js +36 -0
  28. package/lib/cjs/vimeo-spinner.js +37 -0
  29. package/lib/cjs/vimeo-spinner.ws.js +43 -0
  30. package/lib/cjs/vimeo.js +294 -0
  31. package/lib/cjs/vimeo.ws.js +340 -0
  32. package/lib/components.js +9 -1
  33. package/lib/image.ws.js +11 -7
  34. package/lib/link-block.ws.js +1 -8
  35. package/lib/link.ws.js +1 -1
  36. package/lib/metas.js +9 -1
  37. package/lib/props.js +9 -1
  38. package/lib/rich-text-link.ws.js +3 -10
  39. package/lib/types/__generated__/vimeo-play-button.props.d.ts +2 -0
  40. package/lib/types/__generated__/vimeo-preview-image.props.d.ts +2 -0
  41. package/lib/types/__generated__/vimeo-spinner.props.d.ts +2 -0
  42. package/lib/types/__generated__/vimeo.props.d.ts +2 -0
  43. package/lib/types/box.d.ts +1 -1
  44. package/lib/types/components.d.ts +4 -0
  45. package/lib/types/image.ws.d.ts +8 -0
  46. package/lib/types/link-block.stories.d.ts +2 -6
  47. package/lib/types/link.d.ts +1 -3
  48. package/lib/types/link.stories.d.ts +2 -6
  49. package/lib/types/metas.d.ts +4 -0
  50. package/lib/types/props.d.ts +4 -0
  51. package/lib/types/rich-text-link.stories.d.ts +2 -6
  52. package/lib/types/vimeo-play-button.d.ts +6 -0
  53. package/lib/types/vimeo-play-button.stories.d.ts +9 -0
  54. package/lib/types/vimeo-play-button.ws.d.ts +3 -0
  55. package/lib/types/vimeo-preview-image.d.ts +6 -0
  56. package/lib/types/vimeo-preview-image.stories.d.ts +13 -0
  57. package/lib/types/vimeo-preview-image.ws.d.ts +3 -0
  58. package/lib/types/vimeo-spinner.d.ts +2 -0
  59. package/lib/types/vimeo-spinner.stories.d.ts +5 -0
  60. package/lib/types/vimeo-spinner.ws.d.ts +3 -0
  61. package/lib/types/vimeo.d.ts +73 -0
  62. package/lib/types/vimeo.stories.d.ts +71 -0
  63. package/lib/types/vimeo.ws.d.ts +3 -0
  64. package/lib/vimeo-play-button.js +21 -0
  65. package/lib/vimeo-play-button.ws.js +26 -0
  66. package/lib/vimeo-preview-image.js +23 -0
  67. package/lib/vimeo-preview-image.ws.js +20 -0
  68. package/lib/vimeo-spinner.js +20 -0
  69. package/lib/vimeo-spinner.ws.js +25 -0
  70. package/lib/vimeo.js +282 -0
  71. package/lib/vimeo.ws.js +322 -0
  72. package/package.json +8 -6
  73. package/src/LICENSE +21 -0
  74. package/src/__generated__/link-block.props.ts +1 -7
  75. package/src/__generated__/link.props.ts +1 -7
  76. package/src/__generated__/rich-text-link.props.ts +1 -7
  77. package/src/__generated__/vimeo-play-button.props.ts +459 -0
  78. package/src/__generated__/vimeo-preview-image.props.ts +487 -0
  79. package/src/__generated__/vimeo-spinner.props.ts +443 -0
  80. package/src/__generated__/vimeo.props.ts +621 -0
  81. package/src/box.tsx +1 -1
  82. package/src/components.ts +4 -0
  83. package/src/image.ws.tsx +11 -6
  84. package/src/link-block.ws.tsx +1 -8
  85. package/src/link.tsx +2 -7
  86. package/src/link.ws.tsx +1 -1
  87. package/src/metas.ts +4 -0
  88. package/src/props.ts +4 -0
  89. package/src/rich-text-link.ws.tsx +3 -11
  90. package/src/vimeo-play-button.stories.tsx +17 -0
  91. package/src/vimeo-play-button.tsx +24 -0
  92. package/src/vimeo-play-button.ws.ts +29 -0
  93. package/src/vimeo-preview-image.stories.tsx +17 -0
  94. package/src/vimeo-preview-image.tsx +30 -0
  95. package/src/vimeo-preview-image.ws.ts +22 -0
  96. package/src/vimeo-spinner.stories.tsx +17 -0
  97. package/src/vimeo-spinner.tsx +25 -0
  98. package/src/vimeo-spinner.ws.ts +27 -0
  99. package/src/vimeo.stories.tsx +17 -0
  100. package/src/vimeo.tsx +430 -0
  101. package/src/vimeo.ws.ts +326 -0
@@ -0,0 +1,322 @@
1
+ import { PlayIcon, SpinnerIcon, VimeoIcon } from "@webstudio-is/icons/svg";
2
+ import {
3
+ defaultStates
4
+ } from "@webstudio-is/react-sdk";
5
+ import { div } from "@webstudio-is/react-sdk/css-normalize";
6
+ import { props } from "./__generated__/vimeo.props";
7
+ const presetStyle = {
8
+ div
9
+ };
10
+ const meta = {
11
+ category: "media",
12
+ type: "container",
13
+ label: "Vimeo",
14
+ order: 1,
15
+ icon: VimeoIcon,
16
+ states: defaultStates,
17
+ presetStyle,
18
+ template: [
19
+ {
20
+ type: "instance",
21
+ component: "Vimeo",
22
+ styles: [
23
+ {
24
+ property: "position",
25
+ value: { type: "keyword", value: "relative" }
26
+ },
27
+ {
28
+ property: "aspectRatio",
29
+ value: { type: "keyword", value: "640/360" }
30
+ },
31
+ {
32
+ property: "width",
33
+ value: { type: "unit", value: 100, unit: "%" }
34
+ }
35
+ ],
36
+ children: [
37
+ {
38
+ type: "instance",
39
+ component: "VimeoPreviewImage",
40
+ styles: [
41
+ {
42
+ property: "position",
43
+ value: { type: "keyword", value: "absolute" }
44
+ },
45
+ {
46
+ property: "objectPosition",
47
+ value: { type: "keyword", value: "cover" }
48
+ },
49
+ {
50
+ property: "width",
51
+ value: { type: "unit", value: 100, unit: "%" }
52
+ },
53
+ {
54
+ property: "height",
55
+ value: { type: "unit", value: 100, unit: "%" }
56
+ },
57
+ {
58
+ property: "borderTopLeftRadius",
59
+ value: { type: "unit", value: 20, unit: "px" }
60
+ },
61
+ {
62
+ property: "borderTopRightRadius",
63
+ value: { type: "unit", value: 20, unit: "px" }
64
+ },
65
+ {
66
+ property: "borderBottomLeftRadius",
67
+ value: { type: "unit", value: 20, unit: "px" }
68
+ },
69
+ {
70
+ property: "borderBottomRightRadius",
71
+ value: { type: "unit", value: 20, unit: "px" }
72
+ },
73
+ {
74
+ property: "objectPosition",
75
+ value: { type: "keyword", value: "cover" }
76
+ }
77
+ ],
78
+ children: [],
79
+ props: [
80
+ {
81
+ type: "string",
82
+ name: "alt",
83
+ value: "Vimeo video preview image"
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ type: "instance",
89
+ component: "Box",
90
+ label: "Spinner",
91
+ styles: [
92
+ {
93
+ property: "position",
94
+ value: { type: "keyword", value: "absolute" }
95
+ },
96
+ {
97
+ property: "top",
98
+ value: { type: "unit", value: 50, unit: "%" }
99
+ },
100
+ {
101
+ property: "left",
102
+ value: { type: "unit", value: 50, unit: "%" }
103
+ },
104
+ {
105
+ property: "width",
106
+ value: { type: "unit", value: 70, unit: "px" }
107
+ },
108
+ {
109
+ property: "height",
110
+ value: { type: "unit", value: 70, unit: "px" }
111
+ },
112
+ {
113
+ property: "marginTop",
114
+ value: { type: "unit", value: -35, unit: "px" }
115
+ },
116
+ {
117
+ property: "marginLeft",
118
+ value: { type: "unit", value: -35, unit: "px" }
119
+ }
120
+ ],
121
+ children: [
122
+ {
123
+ type: "instance",
124
+ component: "HtmlEmbed",
125
+ label: "Spinner SVG",
126
+ props: [
127
+ {
128
+ type: "string",
129
+ name: "code",
130
+ value: SpinnerIcon
131
+ }
132
+ ],
133
+ children: []
134
+ }
135
+ ]
136
+ },
137
+ {
138
+ type: "instance",
139
+ component: "VimeoPlayButton",
140
+ props: [
141
+ {
142
+ type: "string",
143
+ name: "aria-label",
144
+ value: "Play button"
145
+ }
146
+ ],
147
+ styles: [
148
+ {
149
+ property: "position",
150
+ value: { type: "keyword", value: "absolute" }
151
+ },
152
+ {
153
+ property: "width",
154
+ value: { type: "unit", value: 140, unit: "px" }
155
+ },
156
+ {
157
+ property: "height",
158
+ value: { type: "unit", value: 80, unit: "px" }
159
+ },
160
+ {
161
+ property: "top",
162
+ value: { type: "unit", value: 50, unit: "%" }
163
+ },
164
+ {
165
+ property: "left",
166
+ value: { type: "unit", value: 50, unit: "%" }
167
+ },
168
+ {
169
+ property: "marginTop",
170
+ value: { type: "unit", value: -40, unit: "px" }
171
+ },
172
+ {
173
+ property: "marginLeft",
174
+ value: { type: "unit", value: -70, unit: "px" }
175
+ },
176
+ {
177
+ property: "display",
178
+ value: { type: "keyword", value: "flex" }
179
+ },
180
+ {
181
+ property: "alignItems",
182
+ value: { type: "keyword", value: "center" }
183
+ },
184
+ {
185
+ property: "justifyContent",
186
+ value: { type: "keyword", value: "center" }
187
+ },
188
+ {
189
+ property: "borderTopStyle",
190
+ value: { type: "keyword", value: "none" }
191
+ },
192
+ {
193
+ property: "borderRightStyle",
194
+ value: { type: "keyword", value: "none" }
195
+ },
196
+ {
197
+ property: "borderBottomStyle",
198
+ value: { type: "keyword", value: "none" }
199
+ },
200
+ {
201
+ property: "borderLeftStyle",
202
+ value: { type: "keyword", value: "none" }
203
+ },
204
+ {
205
+ property: "borderTopLeftRadius",
206
+ value: { type: "unit", value: 5, unit: "px" }
207
+ },
208
+ {
209
+ property: "borderTopRightRadius",
210
+ value: { type: "unit", value: 5, unit: "px" }
211
+ },
212
+ {
213
+ property: "borderBottomLeftRadius",
214
+ value: { type: "unit", value: 5, unit: "px" }
215
+ },
216
+ {
217
+ property: "borderBottomRightRadius",
218
+ value: { type: "unit", value: 5, unit: "px" }
219
+ },
220
+ {
221
+ property: "cursor",
222
+ value: { type: "keyword", value: "pointer" }
223
+ },
224
+ {
225
+ property: "backgroundColor",
226
+ value: {
227
+ type: "rgb",
228
+ r: 18,
229
+ g: 18,
230
+ b: 18,
231
+ alpha: 1
232
+ }
233
+ },
234
+ {
235
+ property: "color",
236
+ value: {
237
+ type: "rgb",
238
+ r: 255,
239
+ g: 255,
240
+ b: 255,
241
+ alpha: 1
242
+ }
243
+ },
244
+ {
245
+ state: ":hover",
246
+ property: "backgroundColor",
247
+ value: {
248
+ type: "rgb",
249
+ r: 0,
250
+ g: 173,
251
+ b: 239,
252
+ alpha: 1
253
+ }
254
+ }
255
+ ],
256
+ children: [
257
+ {
258
+ type: "instance",
259
+ component: "Box",
260
+ label: "Play Icon",
261
+ styles: [
262
+ {
263
+ property: "width",
264
+ value: { type: "unit", value: 60, unit: "px" }
265
+ },
266
+ {
267
+ property: "height",
268
+ value: { type: "unit", value: 60, unit: "px" }
269
+ }
270
+ ],
271
+ props: [
272
+ {
273
+ type: "string",
274
+ name: "aria-hidden",
275
+ value: "true"
276
+ }
277
+ ],
278
+ children: [
279
+ {
280
+ type: "instance",
281
+ component: "HtmlEmbed",
282
+ label: "Play SVG",
283
+ props: [
284
+ {
285
+ type: "string",
286
+ name: "code",
287
+ value: PlayIcon
288
+ }
289
+ ],
290
+ children: []
291
+ }
292
+ ]
293
+ }
294
+ ]
295
+ }
296
+ ]
297
+ }
298
+ ]
299
+ };
300
+ const initialProps = [
301
+ "url",
302
+ "quality",
303
+ "showPreview",
304
+ "autoplay",
305
+ "backgroundMode",
306
+ "doNotTrack",
307
+ "loop",
308
+ "muted",
309
+ "showPortrait",
310
+ "showByline",
311
+ "showTitle",
312
+ "showControls",
313
+ "controlsColor"
314
+ ];
315
+ const propsMeta = {
316
+ props,
317
+ initialProps
318
+ };
319
+ export {
320
+ meta,
321
+ propsMeta
322
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react",
3
- "version": "0.70.0",
3
+ "version": "0.72.0",
4
4
  "description": "Webstudio default library for react",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -38,11 +38,13 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@react-aria/utils": "^3.13.3",
41
- "@webstudio-is/css-vars": "^0.70.0",
42
- "@webstudio-is/generate-arg-types": "^0.70.0",
43
- "@webstudio-is/icons": "^0.70.0",
44
- "@webstudio-is/image": "^0.70.0",
45
- "@webstudio-is/react-sdk": "^0.70.0"
41
+ "colord": "^2.9.3",
42
+ "shallow-equal": "^3.1.0",
43
+ "@webstudio-is/css-vars": "^0.72.0",
44
+ "@webstudio-is/generate-arg-types": "^0.72.0",
45
+ "@webstudio-is/icons": "^0.72.0",
46
+ "@webstudio-is/image": "^0.72.0",
47
+ "@webstudio-is/react-sdk": "^0.72.0"
46
48
  },
47
49
  "devDependencies": {
48
50
  "@storybook/react": "^6.5.16",
package/src/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Webstudio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -4,7 +4,6 @@ export const props: Record<string, PropMeta> = {
4
4
  slot: { required: false, control: "text", type: "string" },
5
5
  style: { required: false, control: "text", type: "string" },
6
6
  title: { required: false, control: "text", type: "string" },
7
- href: { required: false, control: "text", type: "string" },
8
7
  target: {
9
8
  required: false,
10
9
  control: "select",
@@ -12,6 +11,7 @@ export const props: Record<string, PropMeta> = {
12
11
  options: ["_self", "_blank", "_parent", "_top"],
13
12
  },
14
13
  download: { required: false, control: "text", type: "string" },
14
+ href: { required: false, control: "text", type: "string" },
15
15
  hrefLang: { required: false, control: "text", type: "string" },
16
16
  media: { required: false, control: "text", type: "string" },
17
17
  ping: { required: false, control: "text", type: "string" },
@@ -468,10 +468,4 @@ export const props: Record<string, PropMeta> = {
468
468
  control: "text",
469
469
  type: "string",
470
470
  },
471
- prefetch: {
472
- required: false,
473
- control: "radio",
474
- type: "string",
475
- options: ["none", "intent", "render"],
476
- },
477
471
  };
@@ -4,7 +4,6 @@ export const props: Record<string, PropMeta> = {
4
4
  slot: { required: false, control: "text", type: "string" },
5
5
  style: { required: false, control: "text", type: "string" },
6
6
  title: { required: false, control: "text", type: "string" },
7
- href: { required: false, control: "text", type: "string" },
8
7
  target: {
9
8
  required: false,
10
9
  control: "select",
@@ -12,6 +11,7 @@ export const props: Record<string, PropMeta> = {
12
11
  options: ["_self", "_blank", "_parent", "_top"],
13
12
  },
14
13
  download: { required: false, control: "text", type: "string" },
14
+ href: { required: false, control: "text", type: "string" },
15
15
  hrefLang: { required: false, control: "text", type: "string" },
16
16
  media: { required: false, control: "text", type: "string" },
17
17
  ping: { required: false, control: "text", type: "string" },
@@ -468,10 +468,4 @@ export const props: Record<string, PropMeta> = {
468
468
  control: "text",
469
469
  type: "string",
470
470
  },
471
- prefetch: {
472
- required: false,
473
- control: "radio",
474
- type: "string",
475
- options: ["none", "intent", "render"],
476
- },
477
471
  };
@@ -4,7 +4,6 @@ export const props: Record<string, PropMeta> = {
4
4
  slot: { required: false, control: "text", type: "string" },
5
5
  style: { required: false, control: "text", type: "string" },
6
6
  title: { required: false, control: "text", type: "string" },
7
- href: { required: false, control: "text", type: "string" },
8
7
  target: {
9
8
  required: false,
10
9
  control: "select",
@@ -12,6 +11,7 @@ export const props: Record<string, PropMeta> = {
12
11
  options: ["_self", "_blank", "_parent", "_top"],
13
12
  },
14
13
  download: { required: false, control: "text", type: "string" },
14
+ href: { required: false, control: "text", type: "string" },
15
15
  hrefLang: { required: false, control: "text", type: "string" },
16
16
  media: { required: false, control: "text", type: "string" },
17
17
  ping: { required: false, control: "text", type: "string" },
@@ -468,10 +468,4 @@ export const props: Record<string, PropMeta> = {
468
468
  control: "text",
469
469
  type: "string",
470
470
  },
471
- prefetch: {
472
- required: false,
473
- control: "radio",
474
- type: "string",
475
- options: ["none", "intent", "render"],
476
- },
477
471
  };