@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.
- package/lib/__generated__/button.props.js +0 -6
- package/lib/__generated__/image.props.js +0 -1
- package/lib/__generated__/link-block.props.js +1 -7
- package/lib/__generated__/link.props.js +1 -7
- package/lib/__generated__/rich-text-link.props.js +1 -7
- package/lib/__generated__/{radio-button-field.props.js → vimeo-play-button.props.js} +14 -0
- package/lib/__generated__/vimeo-preview-image.props.js +441 -0
- package/lib/__generated__/{checkbox-field.props.js → vimeo-spinner.props.js} +0 -1
- package/lib/__generated__/vimeo.props.js +555 -0
- package/lib/blockquote.ws.js +1 -1
- package/lib/box.js +2 -1
- package/lib/button.js +1 -6
- package/lib/button.ws.js +9 -2
- package/lib/checkbox.ws.js +19 -1
- package/lib/cjs/__generated__/button.props.js +0 -6
- package/lib/cjs/__generated__/image.props.js +0 -1
- package/lib/cjs/__generated__/link-block.props.js +1 -7
- package/lib/cjs/__generated__/link.props.js +1 -7
- package/lib/cjs/__generated__/rich-text-link.props.js +1 -7
- package/lib/cjs/__generated__/{text-block.props.js → text.props.js} +3 -3
- package/lib/cjs/__generated__/{radio-button-field.props.js → vimeo-play-button.props.js} +17 -3
- package/lib/cjs/__generated__/vimeo-preview-image.props.js +461 -0
- package/lib/cjs/__generated__/{checkbox-field.props.js → vimeo-spinner.props.js} +3 -4
- package/lib/cjs/__generated__/vimeo.props.js +575 -0
- package/lib/cjs/blockquote.ws.js +1 -1
- package/lib/cjs/box.js +2 -1
- package/lib/cjs/button.js +1 -6
- package/lib/cjs/button.ws.js +9 -2
- package/lib/cjs/checkbox.ws.js +19 -1
- package/lib/cjs/code-text.ws.js +1 -1
- package/lib/cjs/components.js +11 -9
- package/lib/cjs/heading.ws.js +1 -1
- package/lib/cjs/image.js +3 -3
- package/lib/cjs/image.ws.js +12 -9
- package/lib/cjs/label.ws.js +3 -6
- package/lib/cjs/link.js +1 -1
- package/lib/cjs/link.ws.js +3 -3
- package/lib/cjs/list-item.ws.js +1 -1
- package/lib/cjs/metas.js +11 -9
- package/lib/cjs/paragraph.ws.js +2 -2
- package/lib/cjs/props.js +11 -9
- package/lib/cjs/radio-button.ws.js +19 -1
- package/lib/cjs/rich-text-link.ws.js +3 -10
- package/lib/cjs/span.ws.js +1 -1
- package/lib/cjs/{text-block.js → text.js} +6 -6
- package/lib/cjs/{text-block.ws.js → text.ws.js} +10 -10
- package/lib/cjs/{link-block.js → vimeo-play-button.js} +17 -9
- package/lib/cjs/{link-block.ws.js → vimeo-play-button.ws.js} +13 -22
- package/lib/cjs/vimeo-preview-image.js +40 -0
- package/lib/cjs/{radio-button-field.js → vimeo-preview-image.ws.js} +17 -10
- package/lib/cjs/{checkbox-field.js → vimeo-spinner.js} +16 -8
- package/lib/cjs/{checkbox-field.ws.js → vimeo-spinner.ws.js} +11 -30
- package/lib/cjs/vimeo.js +294 -0
- package/lib/cjs/vimeo.ws.js +345 -0
- package/lib/code-text.ws.js +1 -1
- package/lib/components.js +11 -9
- package/lib/heading.ws.js +1 -1
- package/lib/image.js +6 -5
- package/lib/image.ws.js +12 -9
- package/lib/label.ws.js +4 -7
- package/lib/link.js +3 -3
- package/lib/link.ws.js +3 -3
- package/lib/list-item.ws.js +1 -1
- package/lib/metas.js +52 -50
- package/lib/paragraph.ws.js +2 -2
- package/lib/props.js +52 -50
- package/lib/radio-button.ws.js +19 -1
- package/lib/rich-text-link.ws.js +3 -10
- package/lib/span.ws.js +1 -1
- package/lib/{text-block.js → text.js} +3 -3
- package/lib/{text-block.ws.js → text.ws.js} +7 -7
- package/lib/types/__generated__/vimeo-spinner.props.d.ts +2 -0
- package/lib/types/__generated__/vimeo.props.d.ts +2 -0
- package/lib/types/box.d.ts +1 -1
- package/lib/types/button.d.ts +2 -6
- package/lib/types/button.stories.d.ts +2 -6
- package/lib/types/components.d.ts +5 -4
- package/lib/types/image.d.ts +5 -6
- package/lib/types/image.stories.d.ts +555 -6
- package/lib/types/image.ws.d.ts +8 -0
- package/lib/types/link.d.ts +1 -3
- package/lib/types/link.stories.d.ts +2 -6
- package/lib/types/metas.d.ts +5 -4
- package/lib/types/props.d.ts +5 -4
- package/lib/types/rich-text-link.stories.d.ts +2 -6
- package/lib/types/{text-block.d.ts → text.d.ts} +1 -1
- package/lib/types/{text-block.stories.d.ts → text.stories.d.ts} +1 -1
- package/lib/types/vimeo-play-button.d.ts +4 -0
- package/lib/types/vimeo-play-button.stories.d.ts +5 -0
- package/lib/types/vimeo-preview-image.d.ts +281 -0
- package/lib/types/vimeo-preview-image.stories.d.ts +562 -0
- package/lib/types/vimeo-spinner.d.ts +2 -0
- package/lib/types/vimeo-spinner.stories.d.ts +5 -0
- package/lib/types/{link-block.ws.d.ts → vimeo-spinner.ws.d.ts} +1 -1
- package/lib/types/vimeo.d.ts +73 -0
- package/lib/types/vimeo.stories.d.ts +71 -0
- package/lib/types/vimeo.ws.d.ts +3 -0
- package/lib/vimeo-play-button.js +21 -0
- package/lib/vimeo-play-button.ws.js +26 -0
- package/lib/vimeo-preview-image.js +23 -0
- package/lib/vimeo-preview-image.ws.js +20 -0
- package/lib/vimeo-spinner.js +20 -0
- package/lib/vimeo-spinner.ws.js +25 -0
- package/lib/vimeo.js +282 -0
- package/lib/vimeo.ws.js +327 -0
- package/package.json +9 -7
- package/src/LICENSE +21 -0
- package/src/__generated__/button.props.ts +0 -6
- package/src/__generated__/image.props.ts +0 -1
- package/src/__generated__/link-block.props.ts +1 -7
- package/src/__generated__/link.props.ts +1 -7
- package/src/__generated__/rich-text-link.props.ts +1 -7
- package/src/__generated__/{checkbox-field.props.ts → vimeo-play-button.props.ts} +14 -0
- package/src/__generated__/vimeo-preview-image.props.ts +486 -0
- package/src/__generated__/{radio-button-field.props.ts → vimeo-spinner.props.ts} +0 -1
- package/src/__generated__/vimeo.props.ts +621 -0
- package/src/blockquote.ws.tsx +1 -1
- package/src/box.tsx +1 -1
- package/src/button.tsx +3 -11
- package/src/button.ws.tsx +8 -1
- package/src/checkbox.ws.tsx +19 -1
- package/src/code-text.ws.tsx +1 -1
- package/src/components.ts +5 -4
- package/src/heading.ws.tsx +1 -1
- package/src/image.tsx +6 -5
- package/src/image.ws.tsx +11 -9
- package/src/label.ws.tsx +4 -7
- package/src/link.tsx +5 -11
- package/src/link.ws.tsx +3 -3
- package/src/list-item.ws.tsx +1 -1
- package/src/metas.ts +5 -4
- package/src/paragraph.ws.tsx +2 -2
- package/src/props.ts +5 -4
- package/src/radio-button.ws.tsx +19 -1
- package/src/rich-text-link.ws.tsx +3 -11
- package/src/span.ws.tsx +1 -1
- package/src/text.stories.tsx +16 -0
- package/src/{text-block.tsx → text.tsx} +2 -2
- package/src/{text-block.ws.tsx → text.ws.tsx} +8 -8
- package/src/vimeo-play-button.stories.tsx +17 -0
- package/src/vimeo-play-button.tsx +24 -0
- package/src/vimeo-play-button.ws.ts +29 -0
- package/src/vimeo-preview-image.stories.tsx +17 -0
- package/src/vimeo-preview-image.tsx +30 -0
- package/src/vimeo-preview-image.ws.ts +22 -0
- package/src/vimeo-spinner.stories.tsx +17 -0
- package/src/vimeo-spinner.tsx +25 -0
- package/src/vimeo-spinner.ws.ts +27 -0
- package/src/vimeo.stories.tsx +17 -0
- package/src/vimeo.tsx +430 -0
- package/src/vimeo.ws.ts +331 -0
- package/lib/checkbox-field.js +0 -9
- package/lib/checkbox-field.ws.js +0 -44
- package/lib/cjs/radio-button-field.ws.js +0 -62
- package/lib/link-block.js +0 -10
- package/lib/link-block.ws.js +0 -33
- package/lib/radio-button-field.js +0 -9
- package/lib/radio-button-field.ws.js +0 -44
- package/lib/types/checkbox-field.d.ts +0 -3
- package/lib/types/link-block.d.ts +0 -3
- package/lib/types/link-block.stories.d.ts +0 -13
- package/lib/types/radio-button-field.d.ts +0 -3
- package/src/checkbox-field.tsx +0 -10
- package/src/checkbox-field.ws.tsx +0 -47
- package/src/link-block.stories.tsx +0 -16
- package/src/link-block.tsx +0 -9
- package/src/link-block.ws.tsx +0 -38
- package/src/radio-button-field.tsx +0 -10
- package/src/radio-button-field.ws.tsx +0 -47
- package/src/text-block.stories.tsx +0 -16
- /package/lib/__generated__/{text-block.props.js → text.props.js} +0 -0
- /package/lib/types/__generated__/{checkbox-field.props.d.ts → text.props.d.ts} +0 -0
- /package/lib/types/__generated__/{radio-button-field.props.d.ts → vimeo-play-button.props.d.ts} +0 -0
- /package/lib/types/__generated__/{text-block.props.d.ts → vimeo-preview-image.props.d.ts} +0 -0
- /package/lib/types/{checkbox-field.ws.d.ts → text.ws.d.ts} +0 -0
- /package/lib/types/{radio-button-field.ws.d.ts → vimeo-play-button.ws.d.ts} +0 -0
- /package/lib/types/{text-block.ws.d.ts → vimeo-preview-image.ws.d.ts} +0 -0
- /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
|
+
};
|
package/lib/code-text.ws.js
CHANGED
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 {
|
|
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
|
-
|
|
67
|
-
Textarea
|
|
64
|
+
Text,
|
|
65
|
+
Textarea,
|
|
66
|
+
Vimeo,
|
|
67
|
+
VimeoPlayButton,
|
|
68
|
+
VimeoPreviewImage,
|
|
69
|
+
VimeoSpinner
|
|
68
70
|
};
|
package/lib/heading.ws.js
CHANGED
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|
|
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
|
-
...
|
|
36
|
-
|
|
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 {
|
|
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: "
|
|
15
|
+
type: "container",
|
|
16
16
|
label: "Input Label",
|
|
17
|
-
icon:
|
|
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
|
-
|
|
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
|
-
|
|
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: "
|
|
23
|
-
label: "Link
|
|
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"
|
|
56
|
+
initialProps: ["href", "target"]
|
|
57
57
|
};
|
|
58
58
|
export {
|
|
59
59
|
meta,
|
package/lib/list-item.ws.js
CHANGED
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
|
|
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
|
|
11
|
-
import { meta as meta11 } from "./
|
|
12
|
-
import { meta as meta12 } from "./
|
|
13
|
-
import { meta as meta13 } from "./
|
|
14
|
-
import { meta as meta14 } from "./
|
|
15
|
-
import { meta as meta15 } from "./
|
|
16
|
-
import { meta as meta16 } from "./
|
|
17
|
-
import { meta as meta17 } from "./
|
|
18
|
-
import { meta as meta18 } from "./
|
|
19
|
-
import { meta as meta19 } from "./
|
|
20
|
-
import { meta as meta20 } from "./
|
|
21
|
-
import { meta as meta21 } from "./
|
|
22
|
-
import { meta as meta22 } from "./list.ws";
|
|
23
|
-
import { meta as meta23 } from "./
|
|
24
|
-
import { meta as meta24 } from "./
|
|
25
|
-
import { meta as meta25 } from "./
|
|
26
|
-
import { meta as meta26 } from "./
|
|
27
|
-
import { meta as meta27 } from "./
|
|
28
|
-
import { meta as meta28 } from "./
|
|
29
|
-
import { meta as meta29 } from "./
|
|
30
|
-
import { meta as meta30 } from "./
|
|
31
|
-
import { meta as meta31 } from "./
|
|
32
|
-
import { meta as meta32 } from "./
|
|
33
|
-
import { meta as meta33 } from "./
|
|
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
|
-
|
|
36
|
+
meta20 as Blockquote,
|
|
36
37
|
meta4 as Body,
|
|
37
|
-
|
|
38
|
+
meta12 as Bold,
|
|
38
39
|
meta5 as Box,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
meta19 as Image,
|
|
49
|
+
meta17 as Input,
|
|
50
|
+
meta13 as Italic,
|
|
51
|
+
meta25 as Label,
|
|
52
52
|
meta9 as Link,
|
|
53
|
-
|
|
54
|
-
meta22 as
|
|
55
|
-
meta23 as ListItem,
|
|
53
|
+
meta21 as List,
|
|
54
|
+
meta22 as ListItem,
|
|
56
55
|
meta8 as Paragraph,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
meta24 as Separator,
|
|
56
|
+
meta29 as RadioButton,
|
|
57
|
+
meta10 as RichTextLink,
|
|
58
|
+
meta23 as Separator,
|
|
61
59
|
meta as Slot,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
meta6 as
|
|
67
|
-
|
|
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
|
};
|