@webstudio-is/react-sdk 0.67.0 → 0.69.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.
Files changed (184) hide show
  1. package/lib/cjs/components/__generated__/image.props.js +6 -3
  2. package/lib/cjs/components/__generated__/text-block.props.js +7 -0
  3. package/lib/cjs/components/blockquote.ws.js +9 -2
  4. package/lib/cjs/components/box.ws.js +2 -1
  5. package/lib/cjs/components/button.ws.js +3 -1
  6. package/lib/cjs/components/checkbox-field.ws.js +12 -6
  7. package/lib/cjs/components/checkbox.ws.js +1 -0
  8. package/lib/cjs/components/code-text.ws.js +8 -1
  9. package/lib/cjs/components/component-meta.js +6 -3
  10. package/lib/cjs/components/components-utils.js +0 -28
  11. package/lib/cjs/components/form.ws.js +32 -25
  12. package/lib/cjs/components/fragment.ws.js +2 -1
  13. package/lib/cjs/components/heading.ws.js +10 -3
  14. package/lib/cjs/components/html-embed.ws.js +3 -1
  15. package/lib/cjs/components/image.js +27 -19
  16. package/lib/cjs/components/image.ws.js +4 -2
  17. package/lib/cjs/components/index.js +1 -29
  18. package/lib/cjs/components/input.ws.js +1 -0
  19. package/lib/cjs/components/label.ws.js +8 -1
  20. package/lib/cjs/components/link-block.ws.js +2 -1
  21. package/lib/cjs/components/link.ws.js +8 -1
  22. package/lib/cjs/components/list-item.ws.js +11 -4
  23. package/lib/cjs/components/list.ws.js +2 -2
  24. package/lib/cjs/components/paragraph.ws.js +10 -3
  25. package/lib/cjs/components/radio-button-field.ws.js +12 -6
  26. package/lib/cjs/components/radio-button.ws.js +1 -0
  27. package/lib/cjs/components/rich-text-link.ws.js +1 -1
  28. package/lib/cjs/components/separator.ws.js +1 -1
  29. package/lib/cjs/components/slot.ws.js +3 -1
  30. package/lib/cjs/components/text-block.js +5 -2
  31. package/lib/cjs/components/text-block.ws.js +11 -3
  32. package/lib/cjs/components/textarea.ws.js +1 -0
  33. package/lib/cjs/embed-template.js +2 -1
  34. package/lib/cjs/index.js +4 -5
  35. package/lib/cjs/tree/create-elements-tree.js +8 -8
  36. package/lib/cjs/tree/root.js +2 -6
  37. package/lib/cjs/tree/webstudio-component.js +2 -2
  38. package/lib/components/__generated__/image.props.js +6 -3
  39. package/lib/components/__generated__/text-block.props.js +7 -0
  40. package/lib/components/blockquote.ws.js +9 -2
  41. package/lib/components/box.ws.js +2 -1
  42. package/lib/components/button.ws.js +3 -1
  43. package/lib/components/checkbox-field.ws.js +12 -6
  44. package/lib/components/checkbox.ws.js +1 -0
  45. package/lib/components/code-text.ws.js +8 -1
  46. package/lib/components/component-meta.js +6 -3
  47. package/lib/components/components-utils.js +0 -14
  48. package/lib/components/form.ws.js +32 -25
  49. package/lib/components/fragment.ws.js +2 -1
  50. package/lib/components/heading.ws.js +10 -3
  51. package/lib/components/html-embed.ws.js +3 -1
  52. package/lib/components/image.js +34 -20
  53. package/lib/components/image.ws.js +4 -2
  54. package/lib/components/index.js +1 -29
  55. package/lib/components/input.ws.js +1 -0
  56. package/lib/components/label.ws.js +8 -1
  57. package/lib/components/link-block.ws.js +2 -1
  58. package/lib/components/link.ws.js +8 -1
  59. package/lib/components/list-item.ws.js +11 -4
  60. package/lib/components/list.ws.js +2 -2
  61. package/lib/components/paragraph.ws.js +10 -3
  62. package/lib/components/radio-button-field.ws.js +12 -6
  63. package/lib/components/radio-button.ws.js +1 -0
  64. package/lib/components/rich-text-link.ws.js +1 -1
  65. package/lib/components/separator.ws.js +1 -1
  66. package/lib/components/slot.ws.js +3 -1
  67. package/lib/components/text-block.js +9 -3
  68. package/lib/components/text-block.ws.js +11 -3
  69. package/lib/components/textarea.ws.js +1 -0
  70. package/lib/embed-template.js +2 -1
  71. package/lib/index.js +4 -9
  72. package/lib/tree/create-elements-tree.js +8 -8
  73. package/lib/tree/root.js +2 -6
  74. package/lib/tree/webstudio-component.js +2 -2
  75. package/lib/types/components/component-meta.d.ts +363 -1356
  76. package/lib/types/components/components-utils.d.ts +2 -17
  77. package/lib/types/components/image.d.ts +5 -1
  78. package/lib/types/components/image.stories.d.ts +10 -2
  79. package/lib/types/components/index.d.ts +0 -15
  80. package/lib/types/components/text-block.d.ts +6 -2
  81. package/lib/types/components/text-block.stories.d.ts +6 -2
  82. package/lib/types/css/css.d.ts +14 -4
  83. package/lib/types/css/global-rules.d.ts +14 -4
  84. package/lib/types/css/normalize.d.ts +611 -611
  85. package/lib/types/css/style-rules.d.ts +2 -187
  86. package/lib/types/embed-template.d.ts +543 -167
  87. package/lib/types/index.d.ts +2 -2
  88. package/lib/types/props.d.ts +44 -18
  89. package/lib/types/tree/create-elements-tree.d.ts +4 -4
  90. package/lib/types/tree/root.d.ts +3 -5
  91. package/lib/types/tree/webstudio-component.d.ts +3 -3
  92. package/package.json +25 -14
  93. package/src/components/__generated__/image.props.ts +5 -2
  94. package/src/components/__generated__/text-block.props.ts +7 -0
  95. package/src/components/blockquote.ws.tsx +9 -2
  96. package/src/components/box.tsx +1 -1
  97. package/src/components/box.ws.ts +1 -0
  98. package/src/components/button.ws.tsx +2 -0
  99. package/src/components/checkbox-field.ws.tsx +12 -6
  100. package/src/components/checkbox.ws.tsx +1 -0
  101. package/src/components/code-text.ws.tsx +8 -1
  102. package/src/components/component-meta.ts +6 -3
  103. package/src/components/components-utils.ts +2 -31
  104. package/src/components/form.ws.tsx +32 -25
  105. package/src/components/fragment.ws.ts +1 -0
  106. package/src/components/heading.tsx +1 -1
  107. package/src/components/heading.ws.tsx +9 -2
  108. package/src/components/html-embed.ws.ts +2 -0
  109. package/src/components/image.tsx +54 -26
  110. package/src/components/image.ws.tsx +5 -1
  111. package/src/components/index.ts +0 -48
  112. package/src/components/input.ws.tsx +1 -0
  113. package/src/components/label.ws.tsx +8 -1
  114. package/src/components/link-block.ws.tsx +1 -0
  115. package/src/components/link.ws.tsx +8 -1
  116. package/src/components/list-item.ws.tsx +10 -3
  117. package/src/components/list.ws.tsx +2 -2
  118. package/src/components/paragraph.ws.tsx +9 -2
  119. package/src/components/radio-button-field.ws.tsx +12 -6
  120. package/src/components/radio-button.ws.tsx +1 -0
  121. package/src/components/rich-text-link.ws.tsx +1 -1
  122. package/src/components/separator.ws.tsx +1 -1
  123. package/src/components/slot.ws.ts +2 -0
  124. package/src/components/text-block.tsx +16 -5
  125. package/src/components/text-block.ws.tsx +10 -2
  126. package/src/components/textarea.ws.tsx +1 -0
  127. package/src/embed-template.ts +11 -3
  128. package/src/index.ts +2 -5
  129. package/src/props.test.ts +0 -1
  130. package/src/tree/create-elements-tree.tsx +12 -12
  131. package/src/tree/root.ts +4 -9
  132. package/src/tree/webstudio-component.tsx +4 -4
  133. package/lib/app/custom-components/__generated__/form.props.js +0 -411
  134. package/lib/app/custom-components/__generated__/image.props.js +0 -442
  135. package/lib/app/custom-components/__generated__/link-block.props.js +0 -432
  136. package/lib/app/custom-components/__generated__/link.props.js +0 -432
  137. package/lib/app/custom-components/__generated__/rich-text-link.props.js +0 -432
  138. package/lib/app/custom-components/form.js +0 -65
  139. package/lib/app/custom-components/form.ws.js +0 -81
  140. package/lib/app/custom-components/image.js +0 -40
  141. package/lib/app/custom-components/index.js +0 -29
  142. package/lib/app/custom-components/link-block.js +0 -6
  143. package/lib/app/custom-components/link.js +0 -6
  144. package/lib/app/custom-components/rich-text-link.js +0 -6
  145. package/lib/app/custom-components/shared/remix-link.js +0 -22
  146. package/lib/cjs/app/custom-components/__generated__/form.props.js +0 -431
  147. package/lib/cjs/app/custom-components/__generated__/image.props.js +0 -462
  148. package/lib/cjs/app/custom-components/__generated__/link-block.props.js +0 -452
  149. package/lib/cjs/app/custom-components/__generated__/link.props.js +0 -452
  150. package/lib/cjs/app/custom-components/__generated__/rich-text-link.props.js +0 -452
  151. package/lib/cjs/app/custom-components/form.js +0 -81
  152. package/lib/cjs/app/custom-components/form.ws.js +0 -101
  153. package/lib/cjs/app/custom-components/image.js +0 -54
  154. package/lib/cjs/app/custom-components/index.js +0 -49
  155. package/lib/cjs/app/custom-components/link-block.js +0 -26
  156. package/lib/cjs/app/custom-components/link.js +0 -26
  157. package/lib/cjs/app/custom-components/rich-text-link.js +0 -26
  158. package/lib/cjs/app/custom-components/shared/remix-link.js +0 -42
  159. package/lib/types/app/custom-components/__generated__/form.props.d.ts +0 -2
  160. package/lib/types/app/custom-components/__generated__/image.props.d.ts +0 -2
  161. package/lib/types/app/custom-components/__generated__/link-block.props.d.ts +0 -2
  162. package/lib/types/app/custom-components/__generated__/link.props.d.ts +0 -2
  163. package/lib/types/app/custom-components/__generated__/rich-text-link.props.d.ts +0 -2
  164. package/lib/types/app/custom-components/form.d.ts +0 -5
  165. package/lib/types/app/custom-components/form.ws.d.ts +0 -3
  166. package/lib/types/app/custom-components/image.d.ts +0 -6
  167. package/lib/types/app/custom-components/index.d.ts +0 -31
  168. package/lib/types/app/custom-components/link-block.d.ts +0 -6
  169. package/lib/types/app/custom-components/link.d.ts +0 -6
  170. package/lib/types/app/custom-components/rich-text-link.d.ts +0 -6
  171. package/lib/types/app/custom-components/shared/remix-link.d.ts +0 -10
  172. package/src/app/custom-components/__generated__/form.props.ts +0 -456
  173. package/src/app/custom-components/__generated__/image.props.ts +0 -487
  174. package/src/app/custom-components/__generated__/link-block.props.ts +0 -477
  175. package/src/app/custom-components/__generated__/link.props.ts +0 -477
  176. package/src/app/custom-components/__generated__/rich-text-link.props.ts +0 -477
  177. package/src/app/custom-components/form.tsx +0 -111
  178. package/src/app/custom-components/form.ws.tsx +0 -86
  179. package/src/app/custom-components/image.tsx +0 -55
  180. package/src/app/custom-components/index.ts +0 -28
  181. package/src/app/custom-components/link-block.tsx +0 -4
  182. package/src/app/custom-components/link.tsx +0 -4
  183. package/src/app/custom-components/rich-text-link.tsx +0 -4
  184. package/src/app/custom-components/shared/remix-link.tsx +0 -28
@@ -25,7 +25,7 @@ const props = {
25
25
  slot: { required: false, control: "text", type: "string" },
26
26
  style: { required: false, control: "text", type: "string" },
27
27
  title: { required: false, control: "text", type: "string" },
28
- alt: { required: false, control: "text", type: "string", defaultValue: "" },
28
+ alt: { required: false, control: "text", type: "string" },
29
29
  crossOrigin: {
30
30
  required: false,
31
31
  control: "radio",
@@ -62,7 +62,7 @@ const props = {
62
62
  ]
63
63
  },
64
64
  sizes: { required: false, control: "text", type: "string" },
65
- src: { required: false, control: "text", type: "string", defaultValue: "" },
65
+ src: { required: false, control: "text", type: "string" },
66
66
  srcSet: { required: false, control: "text", type: "string" },
67
67
  useMap: { required: false, control: "text", type: "string" },
68
68
  width: { required: false, control: "number", type: "number" },
@@ -455,5 +455,8 @@ const props = {
455
455
  required: false,
456
456
  control: "text",
457
457
  type: "string"
458
- }
458
+ },
459
+ quality: { required: false, control: "number", type: "number" },
460
+ loader: { required: true, control: "text", type: "string" },
461
+ optimize: { required: false, control: "boolean", type: "boolean" }
459
462
  };
@@ -414,5 +414,12 @@ const props = {
414
414
  required: false,
415
415
  control: "text",
416
416
  type: "string"
417
+ },
418
+ tag: {
419
+ required: false,
420
+ control: "radio",
421
+ type: "string",
422
+ defaultValue: "div",
423
+ options: ["div", "figcaption", "span"]
417
424
  }
418
425
  };
@@ -74,13 +74,20 @@ const presetStyle = {
74
74
  ]
75
75
  };
76
76
  const meta = {
77
- category: "typography",
77
+ category: "text",
78
78
  type: "rich-text",
79
79
  label: "Blockquote",
80
80
  icon: import_svg.BlockquoteIcon,
81
81
  states: import_component_meta.defaultStates,
82
82
  presetStyle,
83
- children: [{ type: "text", value: "Blockquote you can edit" }]
83
+ template: [
84
+ {
85
+ type: "instance",
86
+ component: "Blockquote",
87
+ children: [{ type: "text", value: "Blockquote you can edit" }]
88
+ }
89
+ ],
90
+ order: 3
84
91
  };
85
92
  const propsMeta = {
86
93
  props: import_blockquote.props
@@ -44,7 +44,8 @@ const meta = {
44
44
  label: "Box",
45
45
  icon: import_svg.BoxIcon,
46
46
  states: import_component_meta.defaultStates,
47
- presetStyle
47
+ presetStyle,
48
+ order: 0
48
49
  };
49
50
  const propsMeta = {
50
51
  props: import_box.props,
@@ -32,6 +32,7 @@ const presetStyle = {
32
32
  const meta = {
33
33
  category: "forms",
34
34
  type: "container",
35
+ invalidAncestors: ["Button"],
35
36
  label: "Button",
36
37
  icon: import_svg.ButtonElementIcon,
37
38
  presetStyle,
@@ -39,7 +40,8 @@ const meta = {
39
40
  ...import_component_meta.defaultStates,
40
41
  { selector: ":disabled", label: "Disabled" },
41
42
  { selector: ":enabled", label: "Enabled" }
42
- ]
43
+ ],
44
+ order: 1
43
45
  };
44
46
  const propsMeta = {
45
47
  props: import_button.props,
@@ -39,14 +39,20 @@ const meta = {
39
39
  icon: import_svg.CheckboxCheckedIcon,
40
40
  states: import_component_meta.defaultStates,
41
41
  presetStyle,
42
- children: [
43
- { type: "instance", component: "Checkbox", props: [], children: [] },
42
+ template: [
44
43
  {
45
44
  type: "instance",
46
- component: "TextBlock",
47
- label: "Checkbox Label",
48
- props: [],
49
- children: [{ type: "text", value: "Checkbox" }]
45
+ component: "CheckboxField",
46
+ children: [
47
+ { type: "instance", component: "Checkbox", children: [] },
48
+ {
49
+ type: "instance",
50
+ component: "TextBlock",
51
+ label: "Checkbox Label",
52
+ props: [],
53
+ children: [{ type: "text", value: "Checkbox" }]
54
+ }
55
+ ]
50
56
  }
51
57
  ]
52
58
  };
@@ -40,6 +40,7 @@ const meta = {
40
40
  label: "Checkbox Input",
41
41
  icon: import_svg.CheckboxCheckedIcon,
42
42
  presetStyle,
43
+ order: 6,
43
44
  states: [
44
45
  ...import_component_meta.defaultStates,
45
46
  { selector: ":checked", label: "Checked" },
@@ -59,7 +59,14 @@ const meta = {
59
59
  icon: import_svg.CodeTextIcon,
60
60
  states: import_component_meta.defaultStates,
61
61
  presetStyle,
62
- children: [{ type: "text", value: "Code you can edit" }]
62
+ template: [
63
+ {
64
+ type: "instance",
65
+ component: "CodeText",
66
+ children: [{ type: "text", value: "Code you can edit" }]
67
+ }
68
+ ],
69
+ order: 8
63
70
  };
64
71
  const propsMeta = {
65
72
  props: import_code_text2.props,
@@ -33,7 +33,7 @@ const WsComponentPropsMeta = import_zod.z.object({
33
33
  });
34
34
  const componentCategories = [
35
35
  "general",
36
- "typography",
36
+ "text",
37
37
  "media",
38
38
  "forms"
39
39
  ];
@@ -64,10 +64,13 @@ const WsComponentMeta = import_zod.z.object({
64
64
  "rich-text",
65
65
  "rich-text-child"
66
66
  ]),
67
- acceptedParents: import_zod.z.optional(import_zod.z.array(import_zod.z.string())),
67
+ requiredAncestors: import_zod.z.optional(import_zod.z.array(import_zod.z.string())),
68
+ invalidAncestors: import_zod.z.optional(import_zod.z.array(import_zod.z.string())),
69
+ stylable: import_zod.z.optional(import_zod.z.boolean()),
68
70
  label: import_zod.z.string(),
69
71
  icon: import_zod.z.string(),
70
72
  presetStyle: import_zod.z.optional(import_zod.z.record(import_zod.z.string(), import_embed_template.EmbedTemplateStyleDecl)),
71
73
  states: import_zod.z.optional(import_zod.z.array(ComponentState)),
72
- children: import_zod.z.optional(import_embed_template.WsEmbedTemplate)
74
+ template: import_zod.z.optional(import_embed_template.WsEmbedTemplate),
75
+ order: import_zod.z.number().optional()
73
76
  });
@@ -1,14 +1,8 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
6
  var __copyProps = (to, from, except, desc) => {
13
7
  if (from && typeof from === "object" || typeof from === "function") {
14
8
  for (let key of __getOwnPropNames(from))
@@ -17,28 +11,6 @@ var __copyProps = (to, from, except, desc) => {
17
11
  }
18
12
  return to;
19
13
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
15
  var components_utils_exports = {};
30
- __export(components_utils_exports, {
31
- createGetComponent: () => createGetComponent,
32
- getComponent: () => getComponent
33
- });
34
16
  module.exports = __toCommonJS(components_utils_exports);
35
- var components = __toESM(require("./components"), 1);
36
- var import_index = require("./index");
37
- const getComponent = (name) => {
38
- return import_index.registeredComponents != null && name in import_index.registeredComponents ? import_index.registeredComponents[name] : components[name];
39
- };
40
- const createGetComponent = (comps) => {
41
- return (name) => {
42
- return import_index.registeredComponents != null && name in import_index.registeredComponents ? import_index.registeredComponents[name] : comps[name];
43
- };
44
- };
@@ -39,33 +39,40 @@ const meta = {
39
39
  icon: import_svg.FormIcon,
40
40
  states: import_component_meta.defaultStates,
41
41
  presetStyle,
42
- children: [
42
+ order: 0,
43
+ template: [
43
44
  {
44
45
  type: "instance",
45
- component: "Label",
46
- children: [{ type: "text", value: "Name" }]
47
- },
48
- {
49
- type: "instance",
50
- component: "Input",
51
- props: [{ type: "string", name: "name", value: "name" }],
52
- children: []
53
- },
54
- {
55
- type: "instance",
56
- component: "Label",
57
- children: [{ type: "text", value: "Email" }]
58
- },
59
- {
60
- type: "instance",
61
- component: "Input",
62
- props: [{ type: "string", name: "name", value: "email" }],
63
- children: []
64
- },
65
- {
66
- type: "instance",
67
- component: "Button",
68
- children: [{ type: "text", value: "Submit" }]
46
+ component: "Form",
47
+ children: [
48
+ {
49
+ type: "instance",
50
+ component: "Label",
51
+ children: [{ type: "text", value: "Name" }]
52
+ },
53
+ {
54
+ type: "instance",
55
+ component: "Input",
56
+ props: [{ type: "string", name: "name", value: "name" }],
57
+ children: []
58
+ },
59
+ {
60
+ type: "instance",
61
+ component: "Label",
62
+ children: [{ type: "text", value: "Email" }]
63
+ },
64
+ {
65
+ type: "instance",
66
+ component: "Input",
67
+ props: [{ type: "string", name: "name", value: "email" }],
68
+ children: []
69
+ },
70
+ {
71
+ type: "instance",
72
+ component: "Button",
73
+ children: [{ type: "text", value: "Submit" }]
74
+ }
75
+ ]
69
76
  }
70
77
  ]
71
78
  };
@@ -25,7 +25,8 @@ module.exports = __toCommonJS(fragment_ws_exports);
25
25
  const meta = {
26
26
  type: "container",
27
27
  label: "Fragment",
28
- icon: ""
28
+ icon: "",
29
+ stylable: false
29
30
  };
30
31
  const propsMeta = {
31
32
  props: {}
@@ -35,13 +35,20 @@ const presetStyle = {
35
35
  h6: import_normalize.h6
36
36
  };
37
37
  const meta = {
38
- category: "typography",
38
+ category: "text",
39
39
  type: "rich-text",
40
40
  label: "Heading",
41
41
  icon: import_svg.HeadingIcon,
42
- children: [{ type: "text", value: "Heading you can edit" }],
43
42
  states: import_component_meta.defaultStates,
44
- presetStyle
43
+ presetStyle,
44
+ template: [
45
+ {
46
+ type: "instance",
47
+ component: "Heading",
48
+ children: [{ type: "text", value: "Heading you can edit" }]
49
+ }
50
+ ],
51
+ order: 1
45
52
  };
46
53
  const propsMeta = {
47
54
  props: import_heading.props,
@@ -28,7 +28,9 @@ const meta = {
28
28
  category: "general",
29
29
  type: "embed",
30
30
  label: "HTML Embed",
31
- icon: import_svg.EmbedIcon
31
+ icon: import_svg.EmbedIcon,
32
+ stylable: false,
33
+ order: 7
32
34
  };
33
35
  const propsMeta = {
34
36
  props: {
@@ -24,26 +24,10 @@ __export(image_exports, {
24
24
  module.exports = __toCommonJS(image_exports);
25
25
  var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_react = require("react");
27
+ var import_image = require("@webstudio-is/image");
28
+ var import_props = require("../props");
29
+ var import_params = require("../app/params");
27
30
  const defaultTag = "img";
28
- const Image = (0, import_react.forwardRef)(
29
- (imageProps, ref) => {
30
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
31
- "img",
32
- {
33
- ...imageProps,
34
- src: imageProps.src || imagePlaceholderSvg,
35
- ref
36
- }
37
- );
38
- }
39
- );
40
- Image.defaultProps = {
41
- src: "",
42
- width: "",
43
- height: "",
44
- alt: ""
45
- };
46
- Image.displayName = "Image";
47
31
  const imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
48
32
  width="140"
49
33
  height="140"
@@ -67,3 +51,27 @@ const imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
67
51
  fill="#A2A2A2"
68
52
  />
69
53
  </svg>`)}`;
54
+ const Image = (0, import_react.forwardRef)(
55
+ (props, ref) => {
56
+ const asset = (0, import_props.usePropAsset)((0, import_props.getInstanceIdFromComponentProps)(props), "src");
57
+ const loader = (0, import_react.useMemo)(() => {
58
+ const params = (0, import_params.getParams)();
59
+ return (0, import_image.createImageLoader)({ imageBaseUrl: params.imageBaseUrl });
60
+ }, []);
61
+ const src = asset?.name ?? props.src;
62
+ if (asset == null || loader == null) {
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { ...props, src: src || imagePlaceholderSvg, ref }, src);
64
+ }
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ import_image.Image,
67
+ {
68
+ ...props,
69
+ loader,
70
+ src,
71
+ ref
72
+ },
73
+ src
74
+ );
75
+ }
76
+ );
77
+ Image.displayName = "Image";
@@ -48,11 +48,13 @@ const meta = {
48
48
  label: "Image",
49
49
  icon: import_svg.ImageIcon,
50
50
  states: import_component_meta.defaultStates,
51
- presetStyle
51
+ presetStyle,
52
+ order: 0
52
53
  };
54
+ const { loader, ...publicProps } = import_image.props;
53
55
  const propsMeta = {
54
56
  props: {
55
- ...import_image.props,
57
+ ...publicProps,
56
58
  src: {
57
59
  type: "string",
58
60
  control: "file",
@@ -18,13 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var components_exports = {};
20
20
  __export(components_exports, {
21
- canAcceptComponent: () => canAcceptComponent,
22
21
  defaultMetas: () => defaultMetas,
23
- defaultPropsMetas: () => defaultPropsMetas,
24
- getComponentMeta: () => getComponentMeta,
25
- registerComponentMetas: () => registerComponentMetas,
26
- registerComponents: () => registerComponents,
27
- registeredComponents: () => registeredComponents
22
+ defaultPropsMetas: () => defaultPropsMetas
28
23
  });
29
24
  module.exports = __toCommonJS(components_exports);
30
25
  var import_slot = require("./slot.ws");
@@ -128,17 +123,6 @@ const defaultMetas = {
128
123
  CheckboxField: import_checkbox_field.meta,
129
124
  Checkbox: import_checkbox.meta
130
125
  };
131
- let currentMetas = defaultMetas;
132
- const getComponentMeta = (name) => {
133
- return currentMetas[name];
134
- };
135
- const registerComponentMetas = (overrides) => {
136
- const result = {};
137
- for (const name of Object.keys(defaultMetas)) {
138
- result[name] = { ...defaultMetas[name], ...overrides[name] };
139
- }
140
- currentMetas = result;
141
- };
142
126
  const defaultPropsMetas = {
143
127
  Slot: import_slot2.propsMeta,
144
128
  Fragment: import_fragment2.propsMeta,
@@ -174,15 +158,3 @@ const defaultPropsMetas = {
174
158
  CheckboxField: import_checkbox_field2.propsMeta,
175
159
  Checkbox: import_checkbox2.propsMeta
176
160
  };
177
- let registeredComponents;
178
- const registerComponents = (components) => {
179
- registeredComponents = components;
180
- };
181
- const canAcceptComponent = (parentComponent, childComponent) => {
182
- const parentMeta = getComponentMeta(parentComponent);
183
- const childMeta = getComponentMeta(childComponent);
184
- if (parentMeta?.type !== "container" || childMeta === void 0) {
185
- return false;
186
- }
187
- return childMeta.acceptedParents === void 0 || childMeta.acceptedParents.includes(parentComponent);
188
- };
@@ -35,6 +35,7 @@ const meta = {
35
35
  label: "Text Input",
36
36
  icon: import_svg.FormTextFieldIcon,
37
37
  presetStyle,
38
+ order: 3,
38
39
  states: [
39
40
  ...import_component_meta.defaultStates,
40
41
  { selector: "::placeholder", label: "Placeholder" },
@@ -39,7 +39,14 @@ const meta = {
39
39
  icon: import_svg.TextBlockIcon,
40
40
  states: import_component_meta.defaultStates,
41
41
  presetStyle,
42
- children: [{ type: "text", value: "Form Label" }]
42
+ order: 2,
43
+ template: [
44
+ {
45
+ type: "instance",
46
+ component: "Label",
47
+ children: [{ type: "text", value: "Form Label" }]
48
+ }
49
+ ]
43
50
  };
44
51
  const propsMeta = {
45
52
  props: {
@@ -41,7 +41,8 @@ const meta = {
41
41
  label: "Link Block",
42
42
  icon: import_svg.LinkBlockIcon,
43
43
  states: import_link.meta.states,
44
- presetStyle
44
+ presetStyle,
45
+ order: 2
45
46
  };
46
47
  const propsMeta = {
47
48
  props: {
@@ -45,6 +45,7 @@ const meta = {
45
45
  label: "Link Text",
46
46
  icon: import_svg.LinkIcon,
47
47
  presetStyle,
48
+ order: 1,
48
49
  states: [
49
50
  ...import_component_meta.defaultStates,
50
51
  {
@@ -57,7 +58,13 @@ const meta = {
57
58
  label: "Current page"
58
59
  }
59
60
  ],
60
- children: [{ type: "text", value: "Link text you can edit" }]
61
+ template: [
62
+ {
63
+ type: "instance",
64
+ component: "Link",
65
+ children: [{ type: "text", value: "Link text you can edit" }]
66
+ }
67
+ ]
61
68
  };
62
69
  const propsMeta = {
63
70
  props: {
@@ -30,14 +30,21 @@ const presetStyle = {
30
30
  li: import_normalize.li
31
31
  };
32
32
  const meta = {
33
- category: "typography",
33
+ category: "general",
34
34
  type: "rich-text",
35
- acceptedParents: ["List"],
35
+ requiredAncestors: ["List"],
36
36
  label: "List Item",
37
37
  icon: import_svg.ListItemIcon,
38
- children: [{ type: "text", value: "List Item you can edit" }],
39
38
  states: import_component_meta.defaultStates,
40
- presetStyle
39
+ presetStyle,
40
+ template: [
41
+ {
42
+ type: "instance",
43
+ component: "ListItem",
44
+ children: [{ type: "text", value: "List Item you can edit" }]
45
+ }
46
+ ],
47
+ order: 4
41
48
  };
42
49
  const propsMeta = {
43
50
  props: import_list_item.props
@@ -59,13 +59,13 @@ const presetStyle = {
59
59
  ]
60
60
  };
61
61
  const meta = {
62
- category: "typography",
62
+ category: "general",
63
63
  type: "container",
64
64
  label: "List",
65
65
  icon: import_svg.ListIcon,
66
66
  states: import_component_meta.defaultStates,
67
67
  presetStyle,
68
- children: []
68
+ order: 3
69
69
  };
70
70
  const propsMeta = {
71
71
  props: import_list.props,
@@ -30,13 +30,20 @@ const presetStyle = {
30
30
  p: import_normalize.p
31
31
  };
32
32
  const meta = {
33
- category: "typography",
33
+ category: "text",
34
34
  type: "rich-text",
35
35
  label: "Paragraph",
36
36
  icon: import_svg.TextAlignLeftIcon,
37
- children: [{ type: "text", value: "Pragraph you can edit" }],
38
37
  states: import_component_meta.defaultStates,
39
- presetStyle
38
+ presetStyle,
39
+ template: [
40
+ {
41
+ type: "instance",
42
+ component: "Paragraph",
43
+ children: [{ type: "text", value: "Pragraph you can edit" }]
44
+ }
45
+ ],
46
+ order: 2
40
47
  };
41
48
  const propsMeta = {
42
49
  props: import_paragraph.props
@@ -39,14 +39,20 @@ const meta = {
39
39
  icon: import_svg.RadioCheckedIcon,
40
40
  states: import_component_meta.defaultStates,
41
41
  presetStyle,
42
- children: [
43
- { type: "instance", component: "RadioButton", props: [], children: [] },
42
+ template: [
44
43
  {
45
44
  type: "instance",
46
- component: "TextBlock",
47
- label: "Radio Label",
48
- props: [],
49
- children: [{ type: "text", value: "Radio" }]
45
+ component: "RadioButtonField",
46
+ children: [
47
+ { type: "instance", component: "RadioButton", props: [], children: [] },
48
+ {
49
+ type: "instance",
50
+ component: "TextBlock",
51
+ label: "Radio Label",
52
+ props: [],
53
+ children: [{ type: "text", value: "Radio" }]
54
+ }
55
+ ]
50
56
  }
51
57
  ]
52
58
  };
@@ -40,6 +40,7 @@ const meta = {
40
40
  label: "Radio Input",
41
41
  icon: import_svg.RadioCheckedIcon,
42
42
  presetStyle,
43
+ order: 5,
43
44
  states: [
44
45
  ...import_component_meta.defaultStates,
45
46
  { selector: ":checked", label: "Checked" },
@@ -28,7 +28,7 @@ const { category, ...linkMetaRest } = import_link.meta;
28
28
  const meta = {
29
29
  ...linkMetaRest,
30
30
  type: "rich-text-child",
31
- children: []
31
+ template: []
32
32
  };
33
33
  const propsMeta = {
34
34
  initialProps: import_link.propsMeta.initialProps,
@@ -62,7 +62,7 @@ const meta = {
62
62
  icon: import_svg.DashIcon,
63
63
  states: import_component_meta.defaultStates,
64
64
  presetStyle,
65
- children: []
65
+ order: 5
66
66
  };
67
67
  const propsMeta = {
68
68
  props: import_separator.props,
@@ -27,7 +27,9 @@ const meta = {
27
27
  category: "general",
28
28
  type: "container",
29
29
  label: "Slot",
30
- icon: import_svg.SlotComponentIcon
30
+ icon: import_svg.SlotComponentIcon,
31
+ stylable: false,
32
+ order: 6
31
33
  };
32
34
  const propsMeta = {
33
35
  props: {}