@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/__generated__/link.props.js +10 -0
- package/lib/__generated__/webhook-form.props.js +569 -0
- package/lib/__generated__/xml-node.props.js +17 -3
- package/lib/blockquote.ws.js +2 -8
- package/lib/button.template.js +11 -0
- package/lib/button.ws.js +1 -17
- package/lib/code-text.ws.js +5 -5
- package/lib/components.js +44 -44
- package/lib/heading.ws.js +7 -13
- package/lib/link.ws.js +2 -12
- package/lib/list-item.ws.js +7 -13
- package/lib/list.template.js +15 -0
- package/lib/list.ws.js +10 -54
- package/lib/metas.js +41 -40
- package/lib/paragraph.ws.js +10 -16
- package/lib/props.js +41 -40
- package/lib/separator.ws.js +1 -1
- package/lib/templates.js +8 -0
- package/lib/text.ws.js +5 -5
- package/lib/time.ws.js +4 -5
- package/lib/types/__generated__/webhook-form.props.d.ts +2 -0
- package/lib/types/button.template.d.ts +2 -0
- package/lib/types/components.d.ts +1 -1
- package/lib/types/link.d.ts +4 -0
- package/lib/types/list.template.d.ts +2 -0
- package/lib/types/metas.d.ts +1 -1
- package/lib/types/props.d.ts +1 -1
- package/lib/types/rich-text-link.d.ts +1 -2
- package/lib/types/templates.d.ts +3 -0
- package/lib/types/vimeo.template.d.ts +2 -0
- package/lib/types/webhook-form.d.ts +8 -0
- package/lib/types/webhook-form.ws.d.ts +3 -0
- package/lib/vimeo.template.js +92 -0
- package/lib/vimeo.ws.js +16 -306
- package/lib/webhook-form.js +9 -0
- package/lib/webhook-form.ws.js +127 -0
- package/package.json +12 -6
- package/lib/rich-text-link.js +0 -8
|
@@ -0,0 +1,127 @@
|
|
|
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",
|
|
8
|
+
label: "Webhook Form",
|
|
9
|
+
description: "Collect user data and send it to any webhook.",
|
|
10
|
+
order: 1,
|
|
11
|
+
icon: a,
|
|
12
|
+
states: [
|
|
13
|
+
{ selector: "[data-state=error]", label: "Error" },
|
|
14
|
+
{ 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
|
+
]
|
|
120
|
+
}, i = {
|
|
121
|
+
props: o,
|
|
122
|
+
initialProps: ["id", "className", "state", "action"]
|
|
123
|
+
};
|
|
124
|
+
export {
|
|
125
|
+
c as meta,
|
|
126
|
+
i as propsMeta
|
|
127
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.196.0",
|
|
4
4
|
"description": "Webstudio default library for react",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -32,6 +32,11 @@
|
|
|
32
32
|
"webstudio": "./src/hooks.ts",
|
|
33
33
|
"types": "./lib/types/hooks.d.ts",
|
|
34
34
|
"import": "./lib/hooks.js"
|
|
35
|
+
},
|
|
36
|
+
"./templates": {
|
|
37
|
+
"webstudio": "./src/templates.ts",
|
|
38
|
+
"types": "./lib/types/templates.d.ts",
|
|
39
|
+
"import": "./lib/templates.js"
|
|
35
40
|
}
|
|
36
41
|
},
|
|
37
42
|
"peerDependencies": {
|
|
@@ -43,10 +48,10 @@
|
|
|
43
48
|
"colord": "^2.9.3",
|
|
44
49
|
"micromark": "^4.0.0",
|
|
45
50
|
"await-interaction-response": "^0.0.2",
|
|
46
|
-
"@webstudio-is/icons": "0.
|
|
47
|
-
"@webstudio-is/image": "0.
|
|
48
|
-
"@webstudio-is/sdk": "0.
|
|
49
|
-
"@webstudio-is/
|
|
51
|
+
"@webstudio-is/icons": "0.196.0",
|
|
52
|
+
"@webstudio-is/image": "0.196.0",
|
|
53
|
+
"@webstudio-is/react-sdk": "0.196.0",
|
|
54
|
+
"@webstudio-is/sdk": "0.196.0"
|
|
50
55
|
},
|
|
51
56
|
"devDependencies": {
|
|
52
57
|
"@testing-library/react": "^14.2.2",
|
|
@@ -55,8 +60,9 @@
|
|
|
55
60
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
56
61
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
57
62
|
"vitest": "^2.1.8",
|
|
63
|
+
"@webstudio-is/tsconfig": "1.0.7",
|
|
58
64
|
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
59
|
-
"@webstudio-is/
|
|
65
|
+
"@webstudio-is/template": "0.196.0"
|
|
60
66
|
},
|
|
61
67
|
"scripts": {
|
|
62
68
|
"build": "vite build --config ../../vite.sdk-components.config.ts",
|
package/lib/rich-text-link.js
DELETED