@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.
@@ -37,7 +37,7 @@ const meta = {
37
37
  {
38
38
  type: "instance",
39
39
  component: "Input",
40
- props: [{ type: "string", name: "email", value: "email" }],
40
+ props: [{ type: "string", name: "name", value: "email" }],
41
41
  children: []
42
42
  },
43
43
  {
@@ -61,7 +61,7 @@ const meta = {
61
61
  {
62
62
  type: "instance",
63
63
  component: "Input",
64
- props: [{ type: "string", name: "email", value: "email" }],
64
+ props: [{ type: "string", name: "name", value: "email" }],
65
65
  children: []
66
66
  },
67
67
  {
@@ -30,7 +30,7 @@ const presetStyle = {
30
30
  button: import_normalize.button
31
31
  };
32
32
  const meta = {
33
- category: "general",
33
+ category: "forms",
34
34
  type: "container",
35
35
  label: "Button",
36
36
  Icon: import_icons.ButtonElementIcon,
@@ -35,7 +35,7 @@ const presetStyle = {
35
35
  const meta = {
36
36
  category: "forms",
37
37
  type: "container",
38
- label: "Checkbox Field",
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
  }
@@ -37,7 +37,7 @@ const presetStyle = {
37
37
  };
38
38
  const meta = {
39
39
  type: "control",
40
- label: "Checkbox",
40
+ label: "Checkbox Input",
41
41
  Icon: import_icons.CheckboxCheckedIcon,
42
42
  presetStyle,
43
43
  states: [
@@ -59,7 +59,7 @@ const meta = {
59
59
  {
60
60
  type: "instance",
61
61
  component: "Input",
62
- props: [{ type: "string", name: "email", value: "email" }],
62
+ props: [{ type: "string", name: "name", value: "email" }],
63
63
  children: []
64
64
  },
65
65
  {
@@ -32,7 +32,7 @@ const presetStyle = {
32
32
  const meta = {
33
33
  category: "forms",
34
34
  type: "control",
35
- label: "Text Field",
35
+ label: "Text Input",
36
36
  Icon: import_icons.FormTextFieldIcon,
37
37
  presetStyle,
38
38
  states: [
@@ -35,7 +35,7 @@ const presetStyle = {
35
35
  const meta = {
36
36
  category: "forms",
37
37
  type: "container",
38
- label: "Radio Button Field",
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
  }
@@ -37,7 +37,7 @@ const presetStyle = {
37
37
  };
38
38
  const meta = {
39
39
  type: "control",
40
- label: "Radio Button",
40
+ label: "Radio Input",
41
41
  Icon: import_icons.RadioCheckedIcon,
42
42
  presetStyle,
43
43
  states: [
@@ -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
  };
@@ -8,7 +8,7 @@ const presetStyle = {
8
8
  button
9
9
  };
10
10
  const meta = {
11
- category: "general",
11
+ category: "forms",
12
12
  type: "container",
13
13
  label: "Button",
14
14
  Icon: ButtonElementIcon,
@@ -13,7 +13,7 @@ const presetStyle = {
13
13
  const meta = {
14
14
  category: "forms",
15
15
  type: "container",
16
- label: "Checkbox Field",
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
  }
@@ -15,7 +15,7 @@ const presetStyle = {
15
15
  };
16
16
  const meta = {
17
17
  type: "control",
18
- label: "Checkbox",
18
+ label: "Checkbox Input",
19
19
  Icon: CheckboxCheckedIcon,
20
20
  presetStyle,
21
21
  states: [
@@ -37,7 +37,7 @@ const meta = {
37
37
  {
38
38
  type: "instance",
39
39
  component: "Input",
40
- props: [{ type: "string", name: "email", value: "email" }],
40
+ props: [{ type: "string", name: "name", value: "email" }],
41
41
  children: []
42
42
  },
43
43
  {
@@ -10,7 +10,7 @@ const presetStyle = {
10
10
  const meta = {
11
11
  category: "forms",
12
12
  type: "control",
13
- label: "Text Field",
13
+ label: "Text Input",
14
14
  Icon: FormTextFieldIcon,
15
15
  presetStyle,
16
16
  states: [
@@ -13,7 +13,7 @@ const presetStyle = {
13
13
  const meta = {
14
14
  category: "forms",
15
15
  type: "container",
16
- label: "Radio Button Field",
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
  }
@@ -15,7 +15,7 @@ const presetStyle = {
15
15
  };
16
16
  const meta = {
17
17
  type: "control",
18
- label: "Radio Button",
18
+ label: "Radio Input",
19
19
  Icon: RadioCheckedIcon,
20
20
  presetStyle,
21
21
  states: [
@@ -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.64.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.64.0",
39
- "@webstudio-is/css-data": "^0.64.0",
40
- "@webstudio-is/css-engine": "^0.64.0",
41
- "@webstudio-is/css-vars": "^0.64.0",
42
- "@webstudio-is/fonts": "^0.64.0",
43
- "@webstudio-is/generate-arg-types": "^0.64.0",
44
- "@webstudio-is/icons": "^0.64.0",
45
- "@webstudio-is/image": "^0.64.0",
46
- "@webstudio-is/prisma-client": "^0.64.0",
47
- "@webstudio-is/project-build": "^0.64.0",
48
- "@webstudio-is/form-handlers": "^0.64.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
  ".": {
@@ -45,7 +45,7 @@ export const meta: WsComponentMeta = {
45
45
  {
46
46
  type: "instance",
47
47
  component: "Input",
48
- props: [{ type: "string", name: "email", value: "email" }],
48
+ props: [{ type: "string", name: "name", value: "email" }],
49
49
  children: [],
50
50
  },
51
51
  {
@@ -14,7 +14,7 @@ const presetStyle = {
14
14
  } satisfies PresetStyle<typeof defaultTag>;
15
15
 
16
16
  export const meta: WsComponentMeta = {
17
- category: "general",
17
+ category: "forms",
18
18
  type: "container",
19
19
  label: "Button",
20
20
  Icon: ButtonElementIcon,
@@ -19,7 +19,7 @@ const presetStyle = {
19
19
  export const meta: WsComponentMeta = {
20
20
  category: "forms",
21
21
  type: "container",
22
- label: "Checkbox Field",
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
  },
@@ -21,7 +21,7 @@ const presetStyle = {
21
21
 
22
22
  export const meta: WsComponentMeta = {
23
23
  type: "control",
24
- label: "Checkbox",
24
+ label: "Checkbox Input",
25
25
  Icon: CheckboxCheckedIcon,
26
26
  presetStyle,
27
27
  states: [
@@ -43,7 +43,7 @@ export const meta: WsComponentMeta = {
43
43
  {
44
44
  type: "instance",
45
45
  component: "Input",
46
- props: [{ type: "string", name: "email", value: "email" }],
46
+ props: [{ type: "string", name: "name", value: "email" }],
47
47
  children: [],
48
48
  },
49
49
  {
@@ -16,7 +16,7 @@ const presetStyle = {
16
16
  export const meta: WsComponentMeta = {
17
17
  category: "forms",
18
18
  type: "control",
19
- label: "Text Field",
19
+ label: "Text Input",
20
20
  Icon: FormTextFieldIcon,
21
21
  presetStyle,
22
22
  states: [
@@ -19,7 +19,7 @@ const presetStyle = {
19
19
  export const meta: WsComponentMeta = {
20
20
  category: "forms",
21
21
  type: "container",
22
- label: "Radio Button Field",
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
  },
@@ -21,7 +21,7 @@ const presetStyle = {
21
21
 
22
22
  export const meta: WsComponentMeta = {
23
23
  type: "control",
24
- label: "Radio Button",
24
+ label: "Radio Input",
25
25
  Icon: RadioCheckedIcon,
26
26
  presetStyle,
27
27
  states: [
@@ -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
  };