@webstudio-is/sdk-components-react 0.194.0 → 0.196.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/text.ws.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { TextIcon as t } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as e } from "@webstudio-is/react-sdk";
3
3
  import { div as o } from "@webstudio-is/sdk/normalize.css";
4
- import { props as n } from "./__generated__/text.props.js";
5
- const r = {
4
+ import { props as r } from "./__generated__/text.props.js";
5
+ const n = {
6
6
  div: [
7
7
  ...o,
8
8
  {
@@ -11,12 +11,12 @@ const r = {
11
11
  }
12
12
  ]
13
13
  }, s = {
14
- category: "text",
14
+ category: "typography",
15
15
  type: "container",
16
16
  description: "A generic container for any text content that is not a heading or a link.",
17
17
  icon: t,
18
18
  states: e,
19
- presetStyle: r,
19
+ presetStyle: n,
20
20
  order: 0,
21
21
  template: [
22
22
  {
@@ -32,7 +32,7 @@ const r = {
32
32
  }
33
33
  ]
34
34
  }, m = {
35
- props: n,
35
+ props: r,
36
36
  initialProps: ["id", "className", "tag"]
37
37
  };
38
38
  export {
package/lib/time.ws.js CHANGED
@@ -5,18 +5,17 @@ import { props as o } from "./__generated__/time.props.js";
5
5
  const r = {
6
6
  time: a
7
7
  }, s = {
8
- category: "data",
8
+ category: "localization",
9
9
  type: "container",
10
10
  description: "Converts machine-readable date and time to a human-readable format.",
11
11
  icon: t,
12
12
  states: e,
13
- presetStyle: r,
14
- order: 5
15
- }, d = {
13
+ presetStyle: r
14
+ }, c = {
16
15
  props: o,
17
16
  initialProps: ["datetime", "language", "country", "dateStyle", "timeStyle"]
18
17
  };
19
18
  export {
20
19
  s as meta,
21
- d as propsMeta
20
+ c as propsMeta
22
21
  };
@@ -0,0 +1,2 @@
1
+ import type { PropMeta } from "@webstudio-is/react-sdk";
2
+ export declare const props: Record<string, PropMeta>;
@@ -0,0 +1,2 @@
1
+ import { type TemplateMeta } from "@webstudio-is/template";
2
+ export declare const meta: TemplateMeta;
@@ -16,7 +16,7 @@ export { Superscript } from "./superscript";
16
16
  export { Subscript } from "./subscript";
17
17
  export { Button } from "./button";
18
18
  export { Input } from "./input";
19
- export { Form } from "./form";
19
+ export { WebhookForm as Form } from "./webhook-form";
20
20
  export { Form as RemixForm } from "./form";
21
21
  export { Image } from "./image";
22
22
  export { Blockquote } from "./blockquote";
@@ -2,6 +2,10 @@ export declare const defaultTag = "a";
2
2
  export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target" | "download"> & {
3
3
  target?: "_self" | "_blank" | "_parent" | "_top";
4
4
  download?: boolean;
5
+ prefetch?: "none" | "intent" | "render" | "viewport";
6
+ preventScrollReset?: boolean;
7
+ reloadDocument?: boolean;
8
+ replace?: boolean;
5
9
  } & {
6
10
  $webstudio$canvasOnly$assetId?: string | undefined;
7
11
  }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,2 @@
1
+ import { type TemplateMeta } from "@webstudio-is/template";
2
+ export declare const meta: TemplateMeta;
@@ -17,7 +17,7 @@ export { meta as Superscript } from "./superscript.ws";
17
17
  export { meta as Subscript } from "./subscript.ws";
18
18
  export { meta as Button } from "./button.ws";
19
19
  export { meta as Input } from "./input.ws";
20
- export { meta as Form } from "./form.ws";
20
+ export { meta as Form } from "./webhook-form.ws";
21
21
  export { meta as RemixForm } from "./form.ws";
22
22
  export { meta as Image } from "./image.ws";
23
23
  export { meta as Blockquote } from "./blockquote.ws";
@@ -16,7 +16,7 @@ export { propsMeta as Superscript } from "./superscript.ws";
16
16
  export { propsMeta as Subscript } from "./subscript.ws";
17
17
  export { propsMeta as Button } from "./button.ws";
18
18
  export { propsMeta as Input } from "./input.ws";
19
- export { propsMeta as Form } from "./form.ws";
19
+ export { propsMeta as Form } from "./webhook-form.ws";
20
20
  export { propsMeta as RemixForm } from "./form.ws";
21
21
  export { propsMeta as Image } from "./image.ws";
22
22
  export { propsMeta as Blockquote } from "./blockquote.ws";
@@ -1,2 +1 @@
1
- import { Link } from "./link";
2
- export declare const RichTextLink: typeof Link;
1
+ export { Link as RichTextLink } from "./link";
@@ -0,0 +1,3 @@
1
+ export { meta as Button } from "./button.template";
2
+ export { meta as List } from "./list.template";
3
+ export { meta as Vimeo } from "./vimeo.template";
@@ -0,0 +1,2 @@
1
+ import { type TemplateMeta } from "@webstudio-is/template";
2
+ export declare const meta: TemplateMeta;
@@ -0,0 +1,8 @@
1
+ import { type ComponentProps } from "react";
2
+ type Props = ComponentProps<"form"> & {
3
+ encType?: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
4
+ /** Use this property to reveal the Success and Error states on the canvas so they can be styled. The Initial state is displayed when the page first opens. The Success and Error states are displayed depending on whether the Form submits successfully or unsuccessfully. */
5
+ state?: "initial" | "success" | "error";
6
+ };
7
+ export declare const WebhookForm: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/react-sdk";
2
+ export declare const meta: WsComponentMeta;
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -0,0 +1,92 @@
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import { SpinnerIcon as r, PlayIcon as a } from "@webstudio-is/icons/svg";
3
+ import { $ as e, css as t } from "@webstudio-is/template";
4
+ const p = {
5
+ category: "media",
6
+ order: 1,
7
+ description: "Add a video to your page that is hosted on Vimeo. Paste a Vimeo URL and configure the video in the Settings tab.",
8
+ template: /* @__PURE__ */ i(
9
+ e.Vimeo,
10
+ {
11
+ "ws:style": t`
12
+ position: relative;
13
+ aspect-ratio: 640/360;
14
+ width: 100%;
15
+ `,
16
+ children: [
17
+ /* @__PURE__ */ o(
18
+ e.VimeoPreviewImage,
19
+ {
20
+ "ws:style": t`
21
+ position: absolute;
22
+ object-fit: cover;
23
+ object-position: cover;
24
+ width: 100%;
25
+ height: 100%;
26
+ border-radius: 20px;
27
+ `,
28
+ alt: "Vimeo video preview image",
29
+ sizes: "100vw"
30
+ }
31
+ ),
32
+ /* @__PURE__ */ o(
33
+ e.VimeoSpinner,
34
+ {
35
+ "ws:label": "Spinner",
36
+ "ws:style": t`
37
+ position: absolute;
38
+ top: 50%;
39
+ left: 50%;
40
+ width: 70px;
41
+ height: 70px;
42
+ margin-top: -35px;
43
+ margin-left: -35px;
44
+ `,
45
+ children: /* @__PURE__ */ o(e.HtmlEmbed, { "ws:label": "Spinner SVG", code: r })
46
+ }
47
+ ),
48
+ /* @__PURE__ */ o(
49
+ e.VimeoPlayButton,
50
+ {
51
+ "ws:style": t`
52
+ position: absolute;
53
+ width: 140px;
54
+ height: 80px;
55
+ top: 50%;
56
+ left: 50%;
57
+ margin-top: -40px;
58
+ margin-left: -70px;
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ border-style: none;
63
+ border-radius: 5px;
64
+ cursor: pointer;
65
+ background-color: rgb(18, 18, 18);
66
+ color: rgb(255, 255, 255);
67
+ &:hover {
68
+ background-color: rgb(0, 173, 239);
69
+ }
70
+ `,
71
+ "aria-label": "Play button",
72
+ children: /* @__PURE__ */ o(
73
+ e.Box,
74
+ {
75
+ "ws:label": "Play Icon",
76
+ "ws:style": t`
77
+ width: 60px;
78
+ height: 60px;
79
+ `,
80
+ "aria-hidden": !0,
81
+ children: /* @__PURE__ */ o(e.HtmlEmbed, { "ws:label": "Play SVG", code: a })
82
+ }
83
+ )
84
+ }
85
+ )
86
+ ]
87
+ }
88
+ )
89
+ };
90
+ export {
91
+ p as meta
92
+ };
package/lib/vimeo.ws.js CHANGED
@@ -1,316 +1,26 @@
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/react-sdk";
3
3
  import { div as r } from "@webstudio-is/sdk/normalize.css";
4
- import { props as a } from "./__generated__/vimeo.props.js";
5
- const n = {
4
+ import { props as n } from "./__generated__/vimeo.props.js";
5
+ const i = {
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,
14
- presetStyle: n,
9
+ icon: o,
10
+ states: t,
11
+ presetStyle: i,
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
+ }, s = [
306
17
  "id",
307
18
  "className",
308
19
  "url",
309
20
  "quality",
21
+ "loading",
310
22
  "showPreview",
311
23
  "autoplay",
312
- "loading",
313
- "backgroundMode",
314
24
  "doNotTrack",
315
25
  "loop",
316
26
  "muted",
@@ -319,11 +29,11 @@ const n = {
319
29
  "showTitle",
320
30
  "showControls",
321
31
  "controlsColor"
322
- ], d = {
323
- props: a,
324
- initialProps: u
32
+ ], m = {
33
+ props: n,
34
+ initialProps: s
325
35
  };
326
36
  export {
327
- s as meta,
328
- d as propsMeta
37
+ c as meta,
38
+ m as propsMeta
329
39
  };
@@ -0,0 +1,9 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as e } from "react";
3
+ const i = e(
4
+ ({ children: o, state: a = "initial", ...r }, m) => /* @__PURE__ */ t("form", { ...r, ref: m, children: o })
5
+ );
6
+ i.displayName = "WebhookForm";
7
+ export {
8
+ i as WebhookForm
9
+ };