@webstudio-is/sdk-components-react 0.72.0 → 0.74.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 (130) hide show
  1. package/lib/__generated__/button.props.js +0 -6
  2. package/lib/__generated__/image.props.js +0 -1
  3. package/lib/__generated__/vimeo-play-button.props.js +1 -2
  4. package/lib/__generated__/vimeo-preview-image.props.js +0 -1
  5. package/lib/blockquote.ws.js +1 -1
  6. package/lib/button.js +1 -6
  7. package/lib/button.ws.js +9 -2
  8. package/lib/checkbox.ws.js +19 -1
  9. package/lib/cjs/__generated__/button.props.js +0 -6
  10. package/lib/cjs/__generated__/image.props.js +0 -1
  11. package/lib/cjs/__generated__/{text-block.props.js → text.props.js} +3 -3
  12. package/lib/cjs/__generated__/vimeo-play-button.props.js +1 -2
  13. package/lib/cjs/__generated__/vimeo-preview-image.props.js +0 -1
  14. package/lib/cjs/blockquote.ws.js +1 -1
  15. package/lib/cjs/button.js +1 -6
  16. package/lib/cjs/button.ws.js +9 -2
  17. package/lib/cjs/checkbox.ws.js +19 -1
  18. package/lib/cjs/code-text.ws.js +1 -1
  19. package/lib/cjs/components.js +2 -8
  20. package/lib/cjs/heading.ws.js +1 -1
  21. package/lib/cjs/image.js +3 -3
  22. package/lib/cjs/image.ws.js +1 -2
  23. package/lib/cjs/label.ws.js +3 -6
  24. package/lib/cjs/link.js +1 -1
  25. package/lib/cjs/link.ws.js +2 -2
  26. package/lib/cjs/list-item.ws.js +1 -1
  27. package/lib/cjs/metas.js +2 -8
  28. package/lib/cjs/paragraph.ws.js +2 -2
  29. package/lib/cjs/props.js +2 -8
  30. package/lib/cjs/radio-button.ws.js +19 -1
  31. package/lib/cjs/span.ws.js +1 -1
  32. package/lib/cjs/{text-block.js → text.js} +6 -6
  33. package/lib/cjs/{text-block.ws.js → text.ws.js} +10 -10
  34. package/lib/cjs/vimeo.ws.js +6 -1
  35. package/lib/code-text.ws.js +1 -1
  36. package/lib/components.js +2 -8
  37. package/lib/heading.ws.js +1 -1
  38. package/lib/image.js +6 -5
  39. package/lib/image.ws.js +1 -2
  40. package/lib/label.ws.js +4 -7
  41. package/lib/link.js +3 -3
  42. package/lib/link.ws.js +2 -2
  43. package/lib/list-item.ws.js +1 -1
  44. package/lib/metas.js +52 -58
  45. package/lib/paragraph.ws.js +2 -2
  46. package/lib/props.js +52 -58
  47. package/lib/radio-button.ws.js +19 -1
  48. package/lib/span.ws.js +1 -1
  49. package/lib/{text-block.js → text.js} +3 -3
  50. package/lib/{text-block.ws.js → text.ws.js} +7 -7
  51. package/lib/types/button.d.ts +2 -6
  52. package/lib/types/button.stories.d.ts +2 -6
  53. package/lib/types/components.d.ts +1 -4
  54. package/lib/types/image.d.ts +5 -6
  55. package/lib/types/image.stories.d.ts +555 -6
  56. package/lib/types/metas.d.ts +1 -4
  57. package/lib/types/props.d.ts +1 -4
  58. package/lib/types/{text-block.d.ts → text.d.ts} +1 -1
  59. package/lib/types/{text-block.stories.d.ts → text.stories.d.ts} +1 -1
  60. package/lib/types/vimeo-play-button.d.ts +1 -3
  61. package/lib/types/vimeo-play-button.stories.d.ts +2 -6
  62. package/lib/types/vimeo-preview-image.d.ts +278 -3
  63. package/lib/types/vimeo-preview-image.stories.d.ts +555 -6
  64. package/lib/vimeo.ws.js +6 -1
  65. package/package.json +7 -7
  66. package/src/__generated__/button.props.ts +0 -6
  67. package/src/__generated__/image.props.ts +0 -1
  68. package/src/__generated__/vimeo-play-button.props.ts +0 -1
  69. package/src/__generated__/vimeo-preview-image.props.ts +0 -1
  70. package/src/blockquote.ws.tsx +1 -1
  71. package/src/button.tsx +3 -11
  72. package/src/button.ws.tsx +8 -1
  73. package/src/checkbox.ws.tsx +19 -1
  74. package/src/code-text.ws.tsx +1 -1
  75. package/src/components.ts +1 -4
  76. package/src/heading.ws.tsx +1 -1
  77. package/src/image.tsx +6 -5
  78. package/src/image.ws.tsx +1 -4
  79. package/src/label.ws.tsx +4 -7
  80. package/src/link.tsx +3 -4
  81. package/src/link.ws.tsx +2 -2
  82. package/src/list-item.ws.tsx +1 -1
  83. package/src/metas.ts +1 -4
  84. package/src/paragraph.ws.tsx +2 -2
  85. package/src/props.ts +1 -4
  86. package/src/radio-button.ws.tsx +19 -1
  87. package/src/span.ws.tsx +1 -1
  88. package/src/text.stories.tsx +16 -0
  89. package/src/{text-block.tsx → text.tsx} +2 -2
  90. package/src/{text-block.ws.tsx → text.ws.tsx} +8 -8
  91. package/src/vimeo.ws.ts +6 -1
  92. package/lib/__generated__/checkbox-field.props.js +0 -399
  93. package/lib/__generated__/radio-button-field.props.js +0 -399
  94. package/lib/checkbox-field.js +0 -9
  95. package/lib/checkbox-field.ws.js +0 -44
  96. package/lib/cjs/__generated__/checkbox-field.props.js +0 -419
  97. package/lib/cjs/__generated__/radio-button-field.props.js +0 -419
  98. package/lib/cjs/checkbox-field.js +0 -29
  99. package/lib/cjs/checkbox-field.ws.js +0 -62
  100. package/lib/cjs/link-block.js +0 -30
  101. package/lib/cjs/link-block.ws.js +0 -46
  102. package/lib/cjs/radio-button-field.js +0 -29
  103. package/lib/cjs/radio-button-field.ws.js +0 -62
  104. package/lib/link-block.js +0 -10
  105. package/lib/link-block.ws.js +0 -26
  106. package/lib/radio-button-field.js +0 -9
  107. package/lib/radio-button-field.ws.js +0 -44
  108. package/lib/types/__generated__/radio-button-field.props.d.ts +0 -2
  109. package/lib/types/__generated__/text-block.props.d.ts +0 -2
  110. package/lib/types/checkbox-field.d.ts +0 -3
  111. package/lib/types/link-block.d.ts +0 -3
  112. package/lib/types/link-block.stories.d.ts +0 -9
  113. package/lib/types/link-block.ws.d.ts +0 -3
  114. package/lib/types/radio-button-field.d.ts +0 -3
  115. package/lib/types/radio-button-field.ws.d.ts +0 -3
  116. package/lib/types/text-block.ws.d.ts +0 -3
  117. package/src/__generated__/checkbox-field.props.ts +0 -444
  118. package/src/__generated__/radio-button-field.props.ts +0 -444
  119. package/src/checkbox-field.tsx +0 -10
  120. package/src/checkbox-field.ws.tsx +0 -47
  121. package/src/link-block.stories.tsx +0 -16
  122. package/src/link-block.tsx +0 -9
  123. package/src/link-block.ws.tsx +0 -31
  124. package/src/radio-button-field.tsx +0 -10
  125. package/src/radio-button-field.ws.tsx +0 -47
  126. package/src/text-block.stories.tsx +0 -16
  127. /package/lib/__generated__/{text-block.props.js → text.props.js} +0 -0
  128. /package/lib/types/__generated__/{checkbox-field.props.d.ts → text.props.d.ts} +0 -0
  129. /package/lib/types/{checkbox-field.ws.d.ts → text.ws.d.ts} +0 -0
  130. /package/src/__generated__/{text-block.props.ts → text.props.ts} +0 -0
@@ -456,10 +456,4 @@ export const props: Record<string, PropMeta> = {
456
456
  control: "text",
457
457
  type: "string",
458
458
  },
459
- innerText: {
460
- required: false,
461
- control: "text",
462
- type: "string",
463
- defaultValue: "Edit Inner Text in Properties",
464
- },
465
459
  };
@@ -482,6 +482,5 @@ export const props: Record<string, PropMeta> = {
482
482
  type: "string",
483
483
  },
484
484
  quality: { required: false, control: "number", type: "number" },
485
- loader: { required: true, control: "text", type: "string" },
486
485
  optimize: { required: false, control: "boolean", type: "boolean" },
487
486
  };
@@ -455,5 +455,4 @@ export const props: Record<string, PropMeta> = {
455
455
  control: "text",
456
456
  type: "string",
457
457
  },
458
- innerText: { required: false, control: "text", type: "string" },
459
458
  };
@@ -482,6 +482,5 @@ export const props: Record<string, PropMeta> = {
482
482
  type: "string",
483
483
  },
484
484
  quality: { required: false, control: "number", type: "number" },
485
- loader: { required: true, control: "text", type: "string" },
486
485
  optimize: { required: false, control: "boolean", type: "boolean" },
487
486
  };
@@ -61,7 +61,7 @@ const presetStyle = {
61
61
 
62
62
  export const meta: WsComponentMeta = {
63
63
  category: "text",
64
- type: "rich-text",
64
+ type: "container",
65
65
  label: "Blockquote",
66
66
  icon: BlockquoteIcon,
67
67
  states: defaultStates,
package/src/button.tsx CHANGED
@@ -2,20 +2,12 @@ import { forwardRef, type ElementRef, type ComponentProps } from "react";
2
2
 
3
3
  export const defaultTag = "button";
4
4
 
5
- type ButtonProps = ComponentProps<typeof defaultTag> & { innerText?: string };
5
+ type ButtonProps = ComponentProps<typeof defaultTag>;
6
6
 
7
7
  export const Button = forwardRef<ElementRef<typeof defaultTag>, ButtonProps>(
8
- (
9
- {
10
- type = "submit",
11
- innerText = "Edit Inner Text in Properties",
12
- children,
13
- ...props
14
- },
15
- ref
16
- ) => (
8
+ ({ type = "submit", children, ...props }, ref) => (
17
9
  <button type={type} {...props} ref={ref}>
18
- {children ? children : innerText}
10
+ {children}
19
11
  </button>
20
12
  )
21
13
  );
package/src/button.ws.tsx CHANGED
@@ -26,9 +26,16 @@ export const meta: WsComponentMeta = {
26
26
  { selector: ":enabled", label: "Enabled" },
27
27
  ],
28
28
  order: 1,
29
+ template: [
30
+ {
31
+ type: "instance",
32
+ component: "Button",
33
+ children: [{ type: "text", value: "Button you can edit" }],
34
+ },
35
+ ],
29
36
  };
30
37
 
31
38
  export const propsMeta: WsComponentPropsMeta = {
32
39
  props,
33
- initialProps: ["type", "innerText", "aria-label"],
40
+ initialProps: ["type", "aria-label"],
34
41
  };
@@ -20,8 +20,9 @@ const presetStyle = {
20
20
  } satisfies PresetStyle<typeof defaultTag>;
21
21
 
22
22
  export const meta: WsComponentMeta = {
23
+ category: "forms",
23
24
  type: "control",
24
- label: "Checkbox Input",
25
+ label: "Checkbox",
25
26
  icon: CheckboxCheckedIcon,
26
27
  presetStyle,
27
28
  order: 6,
@@ -35,6 +36,23 @@ export const meta: WsComponentMeta = {
35
36
  { selector: ":read-only", label: "Read Only" },
36
37
  { selector: ":read-write", label: "Read Write" },
37
38
  ],
39
+ template: [
40
+ {
41
+ type: "instance",
42
+ component: "Label",
43
+ label: "Checkbox Field",
44
+ children: [
45
+ { type: "instance", component: "Checkbox", children: [] },
46
+ {
47
+ type: "instance",
48
+ component: "Text",
49
+ label: "Checkbox Label",
50
+ props: [{ type: "string", name: "tag", value: "span" }],
51
+ children: [{ type: "text", value: "Checkbox" }],
52
+ },
53
+ ],
54
+ },
55
+ ],
38
56
  };
39
57
 
40
58
  export const propsMeta: WsComponentPropsMeta = {
@@ -37,7 +37,7 @@ const presetStyle = {
37
37
 
38
38
  export const meta: WsComponentMeta = {
39
39
  category: "general",
40
- type: "rich-text",
40
+ type: "container",
41
41
  label: "Code Text",
42
42
  icon: CodeTextIcon,
43
43
  states: defaultStates,
package/src/components.ts CHANGED
@@ -3,11 +3,10 @@ export { Fragment } from "./fragment";
3
3
  export { HtmlEmbed } from "./html-embed";
4
4
  export { Body } from "./body";
5
5
  export { Box } from "./box";
6
- export { TextBlock } from "./text-block";
6
+ export { Text } from "./text";
7
7
  export { Heading } from "./heading";
8
8
  export { Paragraph } from "./paragraph";
9
9
  export { Link } from "./link";
10
- export { LinkBlock } from "./link-block";
11
10
  export { RichTextLink } from "./rich-text-link";
12
11
  export { Span } from "./span";
13
12
  export { Bold } from "./bold";
@@ -27,9 +26,7 @@ export { Label } from "./label";
27
26
  export { SuccessMessage } from "./success-message";
28
27
  export { ErrorMessage } from "./error-message";
29
28
  export { Textarea } from "./textarea";
30
- export { RadioButtonField } from "./radio-button-field";
31
29
  export { RadioButton } from "./radio-button";
32
- export { CheckboxField } from "./checkbox-field";
33
30
  export { Checkbox } from "./checkbox";
34
31
  export { Vimeo } from "./vimeo";
35
32
  export { VimeoPreviewImage } from "./vimeo-preview-image";
@@ -23,7 +23,7 @@ const presetStyle = {
23
23
 
24
24
  export const meta: WsComponentMeta = {
25
25
  category: "text",
26
- type: "rich-text",
26
+ type: "container",
27
27
  label: "Heading",
28
28
  icon: HeadingIcon,
29
29
  states: defaultStates,
package/src/image.tsx CHANGED
@@ -3,6 +3,7 @@ import {
3
3
  type ElementRef,
4
4
  forwardRef,
5
5
  useMemo,
6
+ useContext,
6
7
  } from "react";
7
8
  import {
8
9
  Image as WebstudioImage,
@@ -11,7 +12,7 @@ import {
11
12
  import {
12
13
  usePropAsset,
13
14
  getInstanceIdFromComponentProps,
14
- getParams,
15
+ ReactSdkContext,
15
16
  } from "@webstudio-is/react-sdk";
16
17
 
17
18
  export const defaultTag = "img";
@@ -40,16 +41,16 @@ const imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
40
41
  />
41
42
  </svg>`)}`;
42
43
 
43
- type Props = ComponentPropsWithoutRef<typeof WebstudioImage>;
44
+ type Props = Omit<ComponentPropsWithoutRef<typeof WebstudioImage>, "loader">;
44
45
 
45
46
  export const Image = forwardRef<ElementRef<typeof defaultTag>, Props>(
46
47
  (props, ref) => {
48
+ const { imageBaseUrl } = useContext(ReactSdkContext);
47
49
  const asset = usePropAsset(getInstanceIdFromComponentProps(props), "src");
48
50
 
49
51
  const loader = useMemo(() => {
50
- const params = getParams();
51
- return createImageLoader({ imageBaseUrl: params.imageBaseUrl });
52
- }, []);
52
+ return createImageLoader({ imageBaseUrl });
53
+ }, [imageBaseUrl]);
53
54
 
54
55
  const src = asset?.name ?? props.src;
55
56
 
package/src/image.ws.tsx CHANGED
@@ -37,9 +37,6 @@ export const meta: WsComponentMeta = {
37
37
  order: 0,
38
38
  };
39
39
 
40
- // "loader" is our internal prop not intended to show up in the props panel
41
- const { loader, ...publicProps } = props;
42
-
43
40
  // Automatically generated props don't have the right control.
44
41
  export const propsOverrides = {
45
42
  src: {
@@ -52,7 +49,7 @@ export const propsOverrides = {
52
49
 
53
50
  export const propsMeta: WsComponentPropsMeta = {
54
51
  props: {
55
- ...publicProps,
52
+ ...props,
56
53
  ...propsOverrides,
57
54
  },
58
55
  initialProps: ["src", "width", "height", "alt", "loading"],
package/src/label.ws.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { TextBlockIcon } from "@webstudio-is/icons/svg";
1
+ import { TextIcon } from "@webstudio-is/icons/svg";
2
2
  import {
3
3
  type WsComponentMeta,
4
4
  type WsComponentPropsMeta,
@@ -18,9 +18,9 @@ const presetStyle = {
18
18
 
19
19
  export const meta: WsComponentMeta = {
20
20
  category: "forms",
21
- type: "rich-text",
21
+ type: "container",
22
22
  label: "Input Label",
23
- icon: TextBlockIcon,
23
+ icon: TextIcon,
24
24
  states: defaultStates,
25
25
  presetStyle,
26
26
  order: 2,
@@ -37,10 +37,7 @@ export const propsMeta: WsComponentPropsMeta = {
37
37
  props: {
38
38
  ...props,
39
39
  htmlFor: {
40
- required: false,
41
- control: "text",
42
- type: "string",
43
- rows: 0,
40
+ ...props.htmlFor,
44
41
  label: "For",
45
42
  },
46
43
  },
package/src/link.tsx CHANGED
@@ -1,8 +1,8 @@
1
- import { forwardRef, type ComponentProps } from "react";
1
+ import { forwardRef, type ComponentProps, useContext } from "react";
2
2
  import {
3
3
  usePropUrl,
4
4
  getInstanceIdFromComponentProps,
5
- getParams,
5
+ ReactSdkContext,
6
6
  } from "@webstudio-is/react-sdk";
7
7
 
8
8
  export const defaultTag = "a";
@@ -13,10 +13,9 @@ type Props = Omit<ComponentProps<"a">, "target"> & {
13
13
  };
14
14
 
15
15
  export const Link = forwardRef<HTMLAnchorElement, Props>((props, ref) => {
16
+ const { assetBaseUrl } = useContext(ReactSdkContext);
16
17
  const href = usePropUrl(getInstanceIdFromComponentProps(props), "href");
17
18
 
18
- const { assetBaseUrl } = getParams();
19
-
20
19
  let url = "#";
21
20
 
22
21
  switch (href?.type) {
package/src/link.ws.tsx CHANGED
@@ -25,8 +25,8 @@ const presetStyle = {
25
25
 
26
26
  export const meta: WsComponentMeta = {
27
27
  category: "general",
28
- type: "rich-text",
29
- label: "Link Text",
28
+ type: "container",
29
+ label: "Link",
30
30
  icon: LinkIcon,
31
31
  presetStyle,
32
32
  order: 1,
@@ -15,7 +15,7 @@ const presetStyle = {
15
15
 
16
16
  export const meta: WsComponentMeta = {
17
17
  category: "general",
18
- type: "rich-text",
18
+ type: "container",
19
19
  requiredAncestors: ["List"],
20
20
  label: "List Item",
21
21
  icon: ListItemIcon,
package/src/metas.ts CHANGED
@@ -3,11 +3,10 @@ export { meta as Fragment } from "./fragment.ws";
3
3
  export { meta as HtmlEmbed } from "./html-embed.ws";
4
4
  export { meta as Body } from "./body.ws";
5
5
  export { meta as Box } from "./box.ws";
6
- export { meta as TextBlock } from "./text-block.ws";
6
+ export { meta as Text } from "./text.ws";
7
7
  export { meta as Heading } from "./heading.ws";
8
8
  export { meta as Paragraph } from "./paragraph.ws";
9
9
  export { meta as Link } from "./link.ws";
10
- export { meta as LinkBlock } from "./link-block.ws";
11
10
  export { meta as RichTextLink } from "./rich-text-link.ws";
12
11
  export { meta as Span } from "./span.ws";
13
12
  export { meta as Bold } from "./bold.ws";
@@ -27,9 +26,7 @@ export { meta as Label } from "./label.ws";
27
26
  export { meta as SuccessMessage } from "./success-message.ws";
28
27
  export { meta as ErrorMessage } from "./error-message.ws";
29
28
  export { meta as Textarea } from "./textarea.ws";
30
- export { meta as RadioButtonField } from "./radio-button-field.ws";
31
29
  export { meta as RadioButton } from "./radio-button.ws";
32
- export { meta as CheckboxField } from "./checkbox-field.ws";
33
30
  export { meta as Checkbox } from "./checkbox.ws";
34
31
  export { meta as Vimeo } from "./vimeo.ws";
35
32
  export { meta as VimeoPreviewImage } from "./vimeo-preview-image.ws";
@@ -15,7 +15,7 @@ const presetStyle = {
15
15
 
16
16
  export const meta: WsComponentMeta = {
17
17
  category: "text",
18
- type: "rich-text",
18
+ type: "container",
19
19
  label: "Paragraph",
20
20
  icon: TextAlignLeftIcon,
21
21
  states: defaultStates,
@@ -24,7 +24,7 @@ export const meta: WsComponentMeta = {
24
24
  {
25
25
  type: "instance",
26
26
  component: "Paragraph",
27
- children: [{ type: "text", value: "Pragraph you can edit" }],
27
+ children: [{ type: "text", value: "Paragraph you can edit" }],
28
28
  },
29
29
  ],
30
30
  order: 2,
package/src/props.ts CHANGED
@@ -3,11 +3,10 @@ export { propsMeta as Fragment } from "./fragment.ws";
3
3
  export { propsMeta as HtmlEmbed } from "./html-embed.ws";
4
4
  export { propsMeta as Body } from "./body.ws";
5
5
  export { propsMeta as Box } from "./box.ws";
6
- export { propsMeta as TextBlock } from "./text-block.ws";
6
+ export { propsMeta as Text } from "./text.ws";
7
7
  export { propsMeta as Heading } from "./heading.ws";
8
8
  export { propsMeta as Paragraph } from "./paragraph.ws";
9
9
  export { propsMeta as Link } from "./link.ws";
10
- export { propsMeta as LinkBlock } from "./link-block.ws";
11
10
  export { propsMeta as RichTextLink } from "./rich-text-link.ws";
12
11
  export { propsMeta as Span } from "./span.ws";
13
12
  export { propsMeta as Bold } from "./bold.ws";
@@ -27,9 +26,7 @@ export { propsMeta as Label } from "./label.ws";
27
26
  export { propsMeta as SuccessMessage } from "./success-message.ws";
28
27
  export { propsMeta as ErrorMessage } from "./error-message.ws";
29
28
  export { propsMeta as Textarea } from "./textarea.ws";
30
- export { propsMeta as RadioButtonField } from "./radio-button-field.ws";
31
29
  export { propsMeta as RadioButton } from "./radio-button.ws";
32
- export { propsMeta as CheckboxField } from "./checkbox-field.ws";
33
30
  export { propsMeta as Checkbox } from "./checkbox.ws";
34
31
  export { propsMeta as Vimeo } from "./vimeo.ws";
35
32
  export { propsMeta as VimeoPreviewImage } from "./vimeo-preview-image.ws";
@@ -20,8 +20,9 @@ const presetStyle = {
20
20
  } satisfies PresetStyle<typeof defaultTag>;
21
21
 
22
22
  export const meta: WsComponentMeta = {
23
+ category: "forms",
23
24
  type: "control",
24
- label: "Radio Input",
25
+ label: "Radio",
25
26
  icon: RadioCheckedIcon,
26
27
  presetStyle,
27
28
  order: 5,
@@ -35,6 +36,23 @@ export const meta: WsComponentMeta = {
35
36
  { selector: ":read-only", label: "Read Only" },
36
37
  { selector: ":read-write", label: "Read Write" },
37
38
  ],
39
+ template: [
40
+ {
41
+ type: "instance",
42
+ component: "Label",
43
+ label: "Radio Field",
44
+ children: [
45
+ { type: "instance", component: "RadioButton", props: [], children: [] },
46
+ {
47
+ type: "instance",
48
+ component: "Text",
49
+ label: "Radio Label",
50
+ props: [{ type: "string", name: "tag", value: "span" }],
51
+ children: [{ type: "text", value: "Radio" }],
52
+ },
53
+ ],
54
+ },
55
+ ],
38
56
  };
39
57
 
40
58
  export const propsMeta: WsComponentPropsMeta = {
package/src/span.ws.tsx CHANGED
@@ -15,7 +15,7 @@ const presetStyle = {
15
15
 
16
16
  export const meta: WsComponentMeta = {
17
17
  type: "rich-text-child",
18
- label: "Styled Text",
18
+ label: "Text",
19
19
  icon: PaintBrushIcon,
20
20
  states: defaultStates,
21
21
  presetStyle,
@@ -0,0 +1,16 @@
1
+ import type { ComponentStory, ComponentMeta } from "@storybook/react";
2
+ import { Text as TextPrimitive } from "./text";
3
+
4
+ export default {
5
+ title: "Components/Text",
6
+ component: TextPrimitive,
7
+ } as ComponentMeta<typeof TextPrimitive>;
8
+
9
+ const Template: ComponentStory<typeof TextPrimitive> = (args) => (
10
+ <TextPrimitive {...args} />
11
+ );
12
+
13
+ export const Text = Template.bind({});
14
+ Text.args = {
15
+ children: "text",
16
+ };
@@ -12,10 +12,10 @@ type Props = ComponentProps<typeof defaultTag> & {
12
12
  tag?: "div" | "span" | "figcaption";
13
13
  };
14
14
 
15
- export const TextBlock = forwardRef<ElementRef<typeof defaultTag>, Props>(
15
+ export const Text = forwardRef<ElementRef<typeof defaultTag>, Props>(
16
16
  ({ tag = defaultTag, ...props }, ref) => {
17
17
  return createElement(tag, { ...props, ref });
18
18
  }
19
19
  );
20
20
 
21
- TextBlock.displayName = "TextBlock";
21
+ Text.displayName = "Text";
@@ -1,4 +1,4 @@
1
- import { TextBlockIcon } from "@webstudio-is/icons/svg";
1
+ import { TextIcon } from "@webstudio-is/icons/svg";
2
2
  import {
3
3
  defaultStates,
4
4
  type PresetStyle,
@@ -6,8 +6,8 @@ import {
6
6
  type WsComponentPropsMeta,
7
7
  } from "@webstudio-is/react-sdk";
8
8
  import { div } from "@webstudio-is/react-sdk/css-normalize";
9
- import { props } from "./__generated__/text-block.props";
10
- import type { defaultTag } from "./text-block";
9
+ import { props } from "./__generated__/text.props";
10
+ import type { defaultTag } from "./text";
11
11
 
12
12
  const presetStyle = {
13
13
  div: [
@@ -21,16 +21,16 @@ const presetStyle = {
21
21
 
22
22
  export const meta: WsComponentMeta = {
23
23
  category: "text",
24
- type: "rich-text",
25
- label: "Text Block",
26
- icon: TextBlockIcon,
24
+ type: "container",
25
+ label: "Text",
26
+ icon: TextIcon,
27
27
  states: defaultStates,
28
28
  presetStyle,
29
29
  template: [
30
30
  {
31
31
  type: "instance",
32
- component: "TextBlock",
33
- children: [{ type: "text", value: "Block of text you can edit" }],
32
+ component: "Text",
33
+ children: [{ type: "text", value: "The text you can edit" }],
34
34
  },
35
35
  ],
36
36
  order: 0,
package/src/vimeo.ws.ts CHANGED
@@ -49,7 +49,7 @@ export const meta: WsComponentMeta = {
49
49
  value: { type: "keyword", value: "absolute" },
50
50
  },
51
51
  {
52
- property: "objectPosition",
52
+ property: "objectFit",
53
53
  value: { type: "keyword", value: "cover" },
54
54
  },
55
55
  {
@@ -88,6 +88,11 @@ export const meta: WsComponentMeta = {
88
88
  name: "alt",
89
89
  value: "Vimeo video preview image",
90
90
  },
91
+ {
92
+ type: "string",
93
+ name: "sizes",
94
+ value: "100vw",
95
+ },
91
96
  ],
92
97
  },
93
98
  {