@webstudio-is/react-sdk 0.64.0 → 0.65.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/app/custom-components/form.ws.js +1 -1
- package/lib/cjs/app/custom-components/form.ws.js +1 -1
- package/lib/cjs/components/button.ws.js +1 -1
- package/lib/cjs/components/checkbox-field.ws.js +2 -1
- package/lib/cjs/components/checkbox.ws.js +1 -1
- package/lib/cjs/components/form.ws.js +1 -1
- package/lib/cjs/components/input.ws.js +1 -1
- package/lib/cjs/components/radio-button-field.ws.js +2 -1
- package/lib/cjs/components/radio-button.ws.js +1 -1
- package/lib/cjs/embed-template.js +2 -0
- package/lib/components/button.ws.js +1 -1
- package/lib/components/checkbox-field.ws.js +2 -1
- package/lib/components/checkbox.ws.js +1 -1
- package/lib/components/form.ws.js +1 -1
- package/lib/components/input.ws.js +1 -1
- package/lib/components/radio-button-field.ws.js +2 -1
- package/lib/components/radio-button.ws.js +1 -1
- package/lib/embed-template.js +2 -0
- package/lib/types/embed-template.d.ts +1 -0
- package/package.json +12 -12
- package/src/app/custom-components/form.ws.tsx +1 -1
- package/src/components/button.ws.tsx +1 -1
- package/src/components/checkbox-field.ws.tsx +2 -1
- package/src/components/checkbox.ws.tsx +1 -1
- package/src/components/form.ws.tsx +1 -1
- package/src/components/input.ws.tsx +1 -1
- package/src/components/radio-button-field.ws.tsx +2 -1
- package/src/components/radio-button.ws.tsx +1 -1
- package/src/embed-template.ts +3 -0
|
@@ -35,7 +35,7 @@ const presetStyle = {
|
|
|
35
35
|
const meta = {
|
|
36
36
|
category: "forms",
|
|
37
37
|
type: "container",
|
|
38
|
-
label: "Checkbox
|
|
38
|
+
label: "Checkbox",
|
|
39
39
|
Icon: import_icons.CheckboxCheckedIcon,
|
|
40
40
|
states: import_component_meta.defaultStates,
|
|
41
41
|
presetStyle,
|
|
@@ -44,6 +44,7 @@ const meta = {
|
|
|
44
44
|
{
|
|
45
45
|
type: "instance",
|
|
46
46
|
component: "TextBlock",
|
|
47
|
+
label: "Checkbox Label",
|
|
47
48
|
props: [],
|
|
48
49
|
children: [{ type: "text", value: "Checkbox" }]
|
|
49
50
|
}
|
|
@@ -35,7 +35,7 @@ const presetStyle = {
|
|
|
35
35
|
const meta = {
|
|
36
36
|
category: "forms",
|
|
37
37
|
type: "container",
|
|
38
|
-
label: "Radio
|
|
38
|
+
label: "Radio",
|
|
39
39
|
Icon: import_icons.RadioCheckedIcon,
|
|
40
40
|
states: import_component_meta.defaultStates,
|
|
41
41
|
presetStyle,
|
|
@@ -44,6 +44,7 @@ const meta = {
|
|
|
44
44
|
{
|
|
45
45
|
type: "instance",
|
|
46
46
|
component: "TextBlock",
|
|
47
|
+
label: "Radio Label",
|
|
47
48
|
props: [],
|
|
48
49
|
children: [{ type: "text", value: "Radio" }]
|
|
49
50
|
}
|
|
@@ -62,6 +62,7 @@ const EmbedTemplateInstance = import_zod.z.lazy(
|
|
|
62
62
|
() => import_zod.z.object({
|
|
63
63
|
type: import_zod.z.literal("instance"),
|
|
64
64
|
component: import_zod.z.string(),
|
|
65
|
+
label: import_zod.z.optional(import_zod.z.string()),
|
|
65
66
|
props: import_zod.z.optional(import_zod.z.array(EmbedTemplateProp)),
|
|
66
67
|
styles: import_zod.z.optional(import_zod.z.array(EmbedTemplateStyleDecl)),
|
|
67
68
|
children: WsEmbedTemplate
|
|
@@ -107,6 +108,7 @@ const createInstancesFromTemplate = (treeTemplate, instances, props, styleSource
|
|
|
107
108
|
const instance = {
|
|
108
109
|
type: "instance",
|
|
109
110
|
id: instanceId,
|
|
111
|
+
label: item.label,
|
|
110
112
|
component: item.component,
|
|
111
113
|
children: []
|
|
112
114
|
};
|
|
@@ -13,7 +13,7 @@ const presetStyle = {
|
|
|
13
13
|
const meta = {
|
|
14
14
|
category: "forms",
|
|
15
15
|
type: "container",
|
|
16
|
-
label: "Checkbox
|
|
16
|
+
label: "Checkbox",
|
|
17
17
|
Icon: CheckboxCheckedIcon,
|
|
18
18
|
states: defaultStates,
|
|
19
19
|
presetStyle,
|
|
@@ -22,6 +22,7 @@ const meta = {
|
|
|
22
22
|
{
|
|
23
23
|
type: "instance",
|
|
24
24
|
component: "TextBlock",
|
|
25
|
+
label: "Checkbox Label",
|
|
25
26
|
props: [],
|
|
26
27
|
children: [{ type: "text", value: "Checkbox" }]
|
|
27
28
|
}
|
|
@@ -13,7 +13,7 @@ const presetStyle = {
|
|
|
13
13
|
const meta = {
|
|
14
14
|
category: "forms",
|
|
15
15
|
type: "container",
|
|
16
|
-
label: "Radio
|
|
16
|
+
label: "Radio",
|
|
17
17
|
Icon: RadioCheckedIcon,
|
|
18
18
|
states: defaultStates,
|
|
19
19
|
presetStyle,
|
|
@@ -22,6 +22,7 @@ const meta = {
|
|
|
22
22
|
{
|
|
23
23
|
type: "instance",
|
|
24
24
|
component: "TextBlock",
|
|
25
|
+
label: "Radio Label",
|
|
25
26
|
props: [],
|
|
26
27
|
children: [{ type: "text", value: "Radio" }]
|
|
27
28
|
}
|
package/lib/embed-template.js
CHANGED
|
@@ -36,6 +36,7 @@ const EmbedTemplateInstance = z.lazy(
|
|
|
36
36
|
() => z.object({
|
|
37
37
|
type: z.literal("instance"),
|
|
38
38
|
component: z.string(),
|
|
39
|
+
label: z.optional(z.string()),
|
|
39
40
|
props: z.optional(z.array(EmbedTemplateProp)),
|
|
40
41
|
styles: z.optional(z.array(EmbedTemplateStyleDecl)),
|
|
41
42
|
children: WsEmbedTemplate
|
|
@@ -81,6 +82,7 @@ const createInstancesFromTemplate = (treeTemplate, instances, props, styleSource
|
|
|
81
82
|
const instance = {
|
|
82
83
|
type: "instance",
|
|
83
84
|
id: instanceId,
|
|
85
|
+
label: item.label,
|
|
84
86
|
component: item.component,
|
|
85
87
|
children: []
|
|
86
88
|
};
|
|
@@ -1436,6 +1436,7 @@ export type EmbedTemplateStyleDecl = z.infer<typeof EmbedTemplateStyleDecl>;
|
|
|
1436
1436
|
export type EmbedTemplateInstance = {
|
|
1437
1437
|
type: "instance";
|
|
1438
1438
|
component: string;
|
|
1439
|
+
label?: string;
|
|
1439
1440
|
props?: EmbedTemplateProp[];
|
|
1440
1441
|
styles?: EmbedTemplateStyleDecl[];
|
|
1441
1442
|
children: Array<EmbedTemplateInstance | EmbedTemplateText>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"nanoevents": "^7.0.1",
|
|
36
36
|
"nanoid": "^3.2.0",
|
|
37
37
|
"nanostores": "^0.7.1",
|
|
38
|
-
"@webstudio-is/asset-uploader": "^0.
|
|
39
|
-
"@webstudio-is/css-data": "^0.
|
|
40
|
-
"@webstudio-is/css-engine": "^0.
|
|
41
|
-
"@webstudio-is/css-vars": "^0.
|
|
42
|
-
"@webstudio-is/fonts": "^0.
|
|
43
|
-
"@webstudio-is/generate-arg-types": "^0.
|
|
44
|
-
"@webstudio-is/icons": "^0.
|
|
45
|
-
"@webstudio-is/image": "^0.
|
|
46
|
-
"@webstudio-is/prisma-client": "^0.
|
|
47
|
-
"@webstudio-is/project-build": "^0.
|
|
48
|
-
"@webstudio-is/form-handlers": "^0.
|
|
38
|
+
"@webstudio-is/asset-uploader": "^0.65.0",
|
|
39
|
+
"@webstudio-is/css-data": "^0.65.0",
|
|
40
|
+
"@webstudio-is/css-engine": "^0.65.0",
|
|
41
|
+
"@webstudio-is/css-vars": "^0.65.0",
|
|
42
|
+
"@webstudio-is/fonts": "^0.65.0",
|
|
43
|
+
"@webstudio-is/generate-arg-types": "^0.65.0",
|
|
44
|
+
"@webstudio-is/icons": "^0.65.0",
|
|
45
|
+
"@webstudio-is/image": "^0.65.0",
|
|
46
|
+
"@webstudio-is/prisma-client": "^0.65.0",
|
|
47
|
+
"@webstudio-is/project-build": "^0.65.0",
|
|
48
|
+
"@webstudio-is/form-handlers": "^0.65.0"
|
|
49
49
|
},
|
|
50
50
|
"exports": {
|
|
51
51
|
".": {
|
|
@@ -19,7 +19,7 @@ const presetStyle = {
|
|
|
19
19
|
export const meta: WsComponentMeta = {
|
|
20
20
|
category: "forms",
|
|
21
21
|
type: "container",
|
|
22
|
-
label: "Checkbox
|
|
22
|
+
label: "Checkbox",
|
|
23
23
|
Icon: CheckboxCheckedIcon,
|
|
24
24
|
states: defaultStates,
|
|
25
25
|
presetStyle,
|
|
@@ -28,6 +28,7 @@ export const meta: WsComponentMeta = {
|
|
|
28
28
|
{
|
|
29
29
|
type: "instance",
|
|
30
30
|
component: "TextBlock",
|
|
31
|
+
label: "Checkbox Label",
|
|
31
32
|
props: [],
|
|
32
33
|
children: [{ type: "text", value: "Checkbox" }],
|
|
33
34
|
},
|
|
@@ -19,7 +19,7 @@ const presetStyle = {
|
|
|
19
19
|
export const meta: WsComponentMeta = {
|
|
20
20
|
category: "forms",
|
|
21
21
|
type: "container",
|
|
22
|
-
label: "Radio
|
|
22
|
+
label: "Radio",
|
|
23
23
|
Icon: RadioCheckedIcon,
|
|
24
24
|
states: defaultStates,
|
|
25
25
|
presetStyle,
|
|
@@ -28,6 +28,7 @@ export const meta: WsComponentMeta = {
|
|
|
28
28
|
{
|
|
29
29
|
type: "instance",
|
|
30
30
|
component: "TextBlock",
|
|
31
|
+
label: "Radio Label",
|
|
31
32
|
props: [],
|
|
32
33
|
children: [{ type: "text", value: "Radio" }],
|
|
33
34
|
},
|
package/src/embed-template.ts
CHANGED
|
@@ -54,6 +54,7 @@ export type EmbedTemplateStyleDecl = z.infer<typeof EmbedTemplateStyleDecl>;
|
|
|
54
54
|
export type EmbedTemplateInstance = {
|
|
55
55
|
type: "instance";
|
|
56
56
|
component: string;
|
|
57
|
+
label?: string;
|
|
57
58
|
props?: EmbedTemplateProp[];
|
|
58
59
|
styles?: EmbedTemplateStyleDecl[];
|
|
59
60
|
children: Array<EmbedTemplateInstance | EmbedTemplateText>;
|
|
@@ -64,6 +65,7 @@ export const EmbedTemplateInstance: z.ZodType<EmbedTemplateInstance> = z.lazy(
|
|
|
64
65
|
z.object({
|
|
65
66
|
type: z.literal("instance"),
|
|
66
67
|
component: z.string(),
|
|
68
|
+
label: z.optional(z.string()),
|
|
67
69
|
props: z.optional(z.array(EmbedTemplateProp)),
|
|
68
70
|
styles: z.optional(z.array(EmbedTemplateStyleDecl)),
|
|
69
71
|
children: WsEmbedTemplate,
|
|
@@ -127,6 +129,7 @@ const createInstancesFromTemplate = (
|
|
|
127
129
|
const instance: Instance = {
|
|
128
130
|
type: "instance",
|
|
129
131
|
id: instanceId,
|
|
132
|
+
label: item.label,
|
|
130
133
|
component: item.component,
|
|
131
134
|
children: [],
|
|
132
135
|
};
|