@webstudio-is/sdk-components-react 0.0.0-c1d6247 → 0.0.0-ca00e2a

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 (120) hide show
  1. package/lib/__generated__/blockquote.props.js +2 -512
  2. package/lib/__generated__/body.props.js +2 -506
  3. package/lib/__generated__/bold.props.js +2 -506
  4. package/lib/__generated__/box.props.js +3 -524
  5. package/lib/__generated__/button.props.js +2 -568
  6. package/lib/__generated__/checkbox.props.js +1 -662
  7. package/lib/__generated__/code-text.props.js +1 -504
  8. package/lib/__generated__/form.props.js +2 -554
  9. package/lib/__generated__/head-link.props.js +2 -618
  10. package/lib/__generated__/head-meta.props.js +2 -530
  11. package/lib/__generated__/head-slot.props.js +4 -0
  12. package/lib/__generated__/head-title.props.js +2 -506
  13. package/lib/__generated__/heading.props.js +3 -513
  14. package/lib/__generated__/html-embed.props.js +6 -1
  15. package/lib/__generated__/image.props.js +1 -581
  16. package/lib/__generated__/input.props.js +2 -694
  17. package/lib/__generated__/italic.props.js +2 -506
  18. package/lib/__generated__/label.props.js +2 -518
  19. package/lib/__generated__/link.props.js +4 -555
  20. package/lib/__generated__/list-item.props.js +2 -512
  21. package/lib/__generated__/list.props.js +1 -523
  22. package/lib/__generated__/markdown-embed.props.js +6 -1
  23. package/lib/__generated__/option.props.js +2 -530
  24. package/lib/__generated__/paragraph.props.js +2 -506
  25. package/lib/__generated__/radio-button.props.js +1 -662
  26. package/lib/__generated__/select.props.js +2 -554
  27. package/lib/__generated__/separator.props.js +2 -506
  28. package/lib/__generated__/span.props.js +2 -506
  29. package/lib/__generated__/subscript.props.js +2 -506
  30. package/lib/__generated__/superscript.props.js +2 -506
  31. package/lib/__generated__/text.props.js +3 -513
  32. package/lib/__generated__/textarea.props.js +2 -585
  33. package/lib/__generated__/time.props.js +3 -3
  34. package/lib/__generated__/video.props.js +4 -0
  35. package/lib/__generated__/vimeo-play-button.props.js +2 -567
  36. package/lib/__generated__/vimeo-preview-image.props.js +1 -580
  37. package/lib/__generated__/vimeo-spinner.props.js +2 -506
  38. package/lib/__generated__/vimeo.props.js +2 -505
  39. package/lib/__generated__/webhook-form.props.js +1 -557
  40. package/lib/__generated__/xml-node.props.js +8 -3
  41. package/lib/__generated__/xml-time.props.js +4 -3
  42. package/lib/__generated__/youtube.props.js +1 -498
  43. package/lib/blockquote.ws.js +14 -14
  44. package/lib/body.ws.js +4 -5
  45. package/lib/bold.ws.js +10 -11
  46. package/lib/box.js +9 -6
  47. package/lib/box.ws.js +38 -19
  48. package/lib/button.ws.js +8 -13
  49. package/lib/checkbox.template.js +1 -1
  50. package/lib/checkbox.ws.js +13 -18
  51. package/lib/code-text.ws.js +12 -13
  52. package/lib/components.js +6 -4
  53. package/lib/form.ws.js +9 -14
  54. package/lib/fragment.ws.js +2 -3
  55. package/lib/head-link.ws.js +7 -9
  56. package/lib/head-meta.ws.js +5 -7
  57. package/lib/head-slot.ws.js +7 -14
  58. package/lib/head-title.ws.js +7 -10
  59. package/lib/heading.js +9 -6
  60. package/lib/heading.ws.js +22 -18
  61. package/lib/html-embed.ws.js +22 -18
  62. package/lib/image.ws.js +3 -4
  63. package/lib/input.ws.js +8 -13
  64. package/lib/italic.ws.js +13 -14
  65. package/lib/label.ws.js +6 -11
  66. package/lib/link.ws.js +3 -7
  67. package/lib/list-item.ws.js +8 -15
  68. package/lib/list.ws.js +11 -12
  69. package/lib/markdown-embed.js +3 -3
  70. package/lib/markdown-embed.ws.js +12 -8
  71. package/lib/metas.js +6 -4
  72. package/lib/option.ws.js +3 -8
  73. package/lib/paragraph.ws.js +7 -11
  74. package/lib/props.js +4 -2
  75. package/lib/radio-button.template.js +1 -1
  76. package/lib/radio-button.ws.js +7 -12
  77. package/lib/rich-text-link.ws.js +4 -7
  78. package/lib/select.ws.js +8 -13
  79. package/lib/separator.ws.js +7 -8
  80. package/lib/shared/video.js +13 -0
  81. package/lib/slot.ws.js +2 -3
  82. package/lib/span.ws.js +8 -9
  83. package/lib/subscript.ws.js +4 -5
  84. package/lib/superscript.ws.js +8 -9
  85. package/lib/text.js +9 -7
  86. package/lib/text.ws.js +25 -18
  87. package/lib/textarea.ws.js +13 -14
  88. package/lib/time.ws.js +2 -3
  89. package/lib/types/box.d.ts +2 -3
  90. package/lib/types/components.d.ts +1 -0
  91. package/lib/types/head-title.ws.d.ts +1 -1
  92. package/lib/types/heading.d.ts +1 -2
  93. package/lib/types/html-embed.ws.d.ts +1 -1
  94. package/lib/types/markdown-embed.ws.d.ts +1 -1
  95. package/lib/types/metas.d.ts +1 -0
  96. package/lib/types/props.d.ts +1 -0
  97. package/lib/types/shared/video.d.ts +7 -0
  98. package/lib/types/text.d.ts +2 -3
  99. package/lib/types/video.d.ts +9 -0
  100. package/lib/types/video.ws.d.ts +3 -0
  101. package/lib/types/vimeo.d.ts +0 -6
  102. package/lib/video.js +53 -0
  103. package/lib/video.ws.js +47 -0
  104. package/lib/vimeo-play-button.js +4 -4
  105. package/lib/vimeo-play-button.ws.js +12 -19
  106. package/lib/vimeo-preview-image.js +5 -5
  107. package/lib/vimeo-preview-image.ws.js +7 -7
  108. package/lib/vimeo-spinner.js +1 -1
  109. package/lib/vimeo-spinner.ws.js +10 -11
  110. package/lib/vimeo.js +98 -99
  111. package/lib/vimeo.ws.js +16 -15
  112. package/lib/webhook-form.template.js +12 -12
  113. package/lib/webhook-form.ws.js +16 -13
  114. package/lib/xml-node.ws.js +4 -5
  115. package/lib/xml-time.ws.js +2 -3
  116. package/lib/youtube.js +152 -131
  117. package/lib/youtube.ws.js +20 -20
  118. package/package.json +13 -11
  119. package/lib/__generated__/head.props.js +0 -508
  120. /package/lib/types/__generated__/{head.props.d.ts → video.props.d.ts} +0 -0
package/lib/bold.ws.js CHANGED
@@ -1,17 +1,16 @@
1
- import { BoldIcon as t } from "@webstudio-is/icons/svg";
2
- import { defaultStates as o } from "@webstudio-is/sdk";
3
- import { b as e } from "@webstudio-is/sdk/normalize.css";
4
- import { props as r } from "./__generated__/bold.props.js";
5
- const p = {
6
- b: e
1
+ import { BoldIcon as o } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as t } from "@webstudio-is/sdk";
3
+ import { b as r } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as e } from "./__generated__/bold.props.js";
5
+ const s = {
6
+ b: r
7
7
  }, l = {
8
- type: "rich-text-child",
9
8
  label: "Bold Text",
10
- icon: t,
11
- states: o,
12
- presetStyle: p
9
+ icon: o,
10
+ states: t,
11
+ presetStyle: s
13
12
  }, c = {
14
- props: r,
13
+ props: e,
15
14
  initialProps: ["id", "className"]
16
15
  };
17
16
  export {
package/lib/box.js CHANGED
@@ -1,9 +1,12 @@
1
- import { forwardRef as t, createElement as a } from "react";
2
- const d = "div", f = t(
3
- ({ tag: e = d, ...o }, r) => a(e, { ...o, ref: r })
1
+ import { forwardRef as a, createElement as m } from "react";
2
+ import { getTagFromProps as f } from "@webstudio-is/sdk/runtime";
3
+ const g = "div", n = a(
4
+ ({ tag: o, ...t }, r) => {
5
+ const e = f(t) ?? o ?? g;
6
+ return m(e, { ...t, ref: r });
7
+ }
4
8
  );
5
- f.displayName = "Box";
9
+ n.displayName = "Box";
6
10
  export {
7
- f as Box,
8
- d as defaultTag
11
+ n as Box
9
12
  };
package/lib/box.ws.js CHANGED
@@ -1,31 +1,50 @@
1
1
  import { BoxIcon as t } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as e } from "@webstudio-is/sdk";
3
- import { div as o, address as r, article as a, aside as i, figure as n, footer as s, header as c, main as p, nav as d, section as m } from "@webstudio-is/sdk/normalize.css";
3
+ import { section as r, nav as o, main as a, header as i, footer as s, figure as n, aside as d, article as p, address as c, div as m } from "@webstudio-is/sdk/normalize.css";
4
4
  import { props as f } from "./__generated__/box.props.js";
5
- const g = {
6
- div: o,
7
- address: r,
8
- article: a,
9
- aside: i,
10
- figure: n,
11
- footer: s,
12
- header: c,
13
- main: p,
14
- nav: d,
15
- section: m
16
- }, v = {
5
+ const v = {
17
6
  category: "general",
18
- type: "container",
19
7
  description: "A container for content. By default this is a Div, but the tag can be changed in settings.",
20
8
  icon: t,
21
9
  states: e,
22
- presetStyle: g,
10
+ presetStyle: {
11
+ div: m,
12
+ address: c,
13
+ article: p,
14
+ aside: d,
15
+ figure: n,
16
+ footer: s,
17
+ header: i,
18
+ main: a,
19
+ nav: o,
20
+ section: r
21
+ },
23
22
  order: 0
24
- }, b = {
25
- props: f,
26
- initialProps: ["id", "className", "tag"]
23
+ }, y = {
24
+ props: {
25
+ ...f,
26
+ tag: {
27
+ required: !0,
28
+ control: "tag",
29
+ type: "string",
30
+ options: [
31
+ "div",
32
+ "header",
33
+ "footer",
34
+ "nav",
35
+ "main",
36
+ "section",
37
+ "article",
38
+ "aside",
39
+ "address",
40
+ "figure",
41
+ "span"
42
+ ]
43
+ }
44
+ },
45
+ initialProps: ["tag", "id", "className"]
27
46
  };
28
47
  export {
29
48
  v as meta,
30
- b as propsMeta
49
+ y as propsMeta
31
50
  };
package/lib/button.ws.js CHANGED
@@ -1,27 +1,22 @@
1
1
  import { ButtonElementIcon as t } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as e } from "@webstudio-is/sdk";
3
3
  import { button as o } from "@webstudio-is/sdk/normalize.css";
4
- import { props as n } from "./__generated__/button.props.js";
5
- const a = {
4
+ import { props as a } from "./__generated__/button.props.js";
5
+ const l = {
6
6
  button: o
7
- }, p = {
7
+ }, m = {
8
8
  icon: t,
9
- type: "container",
10
- constraints: {
11
- relation: "ancestor",
12
- component: { $nin: ["Button", "Link"] }
13
- },
14
- presetStyle: a,
9
+ presetStyle: l,
15
10
  states: [
16
11
  ...e,
17
12
  { selector: ":disabled", label: "Disabled" },
18
13
  { selector: ":enabled", label: "Enabled" }
19
14
  ]
20
- }, c = {
21
- props: n,
15
+ }, n = {
16
+ props: a,
22
17
  initialProps: ["id", "className", "type", "aria-label"]
23
18
  };
24
19
  export {
25
- p as meta,
26
- c as propsMeta
20
+ m as meta,
21
+ n as propsMeta
27
22
  };
@@ -6,7 +6,7 @@ const l = {
6
6
  order: 6,
7
7
  template: /* @__PURE__ */ r(e.Label, { "ws:label": "Checkbox Field", children: [
8
8
  /* @__PURE__ */ o(e.Checkbox, {}),
9
- /* @__PURE__ */ o(e.Text, { "ws:label": "Checkbox Label", tag: "span", children: new c("Checkbox") })
9
+ /* @__PURE__ */ o(e.Text, { "ws:label": "Checkbox Label", "ws:tag": "span", children: new c("Checkbox") })
10
10
  ] })
11
11
  };
12
12
  export {
@@ -1,25 +1,20 @@
1
1
  import { CheckboxCheckedIcon as e } from "@webstudio-is/icons/svg";
2
- import { defaultStates as t } from "@webstudio-is/sdk";
3
- import { checkbox as o } from "@webstudio-is/sdk/normalize.css";
4
- import { props as l } from "./__generated__/checkbox.props.js";
5
- const r = {
2
+ import { defaultStates as l } from "@webstudio-is/sdk";
3
+ import { checkbox as t } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as r } from "./__generated__/checkbox.props.js";
5
+ const o = {
6
6
  input: [
7
- ...o,
7
+ ...t,
8
8
  {
9
- property: "marginRight",
9
+ property: "margin-right",
10
10
  value: { type: "unit", unit: "em", value: 0.5 }
11
11
  }
12
12
  ]
13
- }, s = {
14
- constraints: {
15
- relation: "ancestor",
16
- component: { $nin: ["Button", "Link"] }
17
- },
18
- type: "control",
13
+ }, d = {
19
14
  icon: e,
20
- presetStyle: r,
15
+ presetStyle: o,
21
16
  states: [
22
- ...t,
17
+ ...l,
23
18
  { selector: ":checked", label: "Checked" },
24
19
  { selector: ":required", label: "Required" },
25
20
  { selector: ":optional", label: "Optional" },
@@ -28,11 +23,11 @@ const r = {
28
23
  { selector: ":read-only", label: "Read Only" },
29
24
  { selector: ":read-write", label: "Read Write" }
30
25
  ]
31
- }, p = {
32
- props: l,
26
+ }, n = {
27
+ props: r,
33
28
  initialProps: ["id", "className", "name", "value", "required", "checked"]
34
29
  };
35
30
  export {
36
- s as meta,
37
- p as propsMeta
31
+ d as meta,
32
+ n as propsMeta
38
33
  };
@@ -10,39 +10,38 @@ const p = {
10
10
  value: { type: "keyword", value: "block" }
11
11
  },
12
12
  {
13
- property: "whiteSpaceCollapse",
13
+ property: "white-space-collapse",
14
14
  value: { type: "keyword", value: "preserve" }
15
15
  },
16
16
  {
17
- property: "textWrapMode",
17
+ property: "text-wrap-mode",
18
18
  value: { type: "keyword", value: "wrap" }
19
19
  },
20
20
  {
21
- property: "paddingLeft",
21
+ property: "padding-left",
22
22
  value: { type: "unit", value: 0.2, unit: "em" }
23
23
  },
24
24
  {
25
- property: "paddingRight",
25
+ property: "padding-right",
26
26
  value: { type: "unit", value: 0.2, unit: "em" }
27
27
  },
28
28
  {
29
- property: "backgroundColor",
29
+ property: "background-color",
30
30
  value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 }
31
31
  }
32
32
  ]
33
- }, s = {
33
+ }, i = {
34
34
  category: "general",
35
- type: "embed",
36
35
  description: "Use this component when you want to display code as text on the page.",
37
36
  icon: e,
38
- constraints: {
39
- relation: "ancestor",
40
- component: { $neq: "CodeText" }
37
+ contentModel: {
38
+ category: "instance",
39
+ children: []
41
40
  },
42
41
  states: t,
43
42
  presetStyle: p,
44
43
  order: 5
45
- }, d = {
44
+ }, s = {
46
45
  props: {
47
46
  ...r,
48
47
  code: {
@@ -54,6 +53,6 @@ const p = {
54
53
  initialProps: ["id", "className", "lang", "code"]
55
54
  };
56
55
  export {
57
- s as meta,
58
- d as propsMeta
56
+ i as meta,
57
+ s as propsMeta
59
58
  };
package/lib/components.js CHANGED
@@ -10,7 +10,7 @@ import { Paragraph as c } from "./paragraph.js";
10
10
  import { Link as B, Link as L } from "./link.js";
11
11
  import { Span as g } from "./span.js";
12
12
  import { Bold as I } from "./bold.js";
13
- import { Italic as V } from "./italic.js";
13
+ import { Italic as h } from "./italic.js";
14
14
  import { Superscript as R } from "./superscript.js";
15
15
  import { Subscript as y } from "./subscript.js";
16
16
  import { Button as E } from "./button.js";
@@ -36,11 +36,12 @@ import { XmlNode as co } from "./xml-node.js";
36
36
  import { XmlTime as Bo } from "./xml-time.js";
37
37
  import { Time as Ho } from "./time.js";
38
38
  import { Select as Fo } from "./select.js";
39
- import { Option as ho } from "./option.js";
39
+ import { Option as Vo } from "./option.js";
40
40
  import { HeadSlot as Po } from "./head-slot.js";
41
41
  import { HeadLink as wo } from "./head-link.js";
42
42
  import { HeadMeta as Co } from "./head-meta.js";
43
43
  import { HeadTitle as Mo } from "./head-title.js";
44
+ import { Video as qo } from "./video.js";
44
45
  export {
45
46
  z as Blockquote,
46
47
  n as Body,
@@ -59,13 +60,13 @@ export {
59
60
  x as HtmlEmbed,
60
61
  Y as Image,
61
62
  X as Input,
62
- V as Italic,
63
+ h as Italic,
63
64
  $ as Label,
64
65
  B as Link,
65
66
  D as List,
66
67
  J as ListItem,
67
68
  a as MarkdownEmbed,
68
- ho as Option,
69
+ Vo as Option,
69
70
  c as Paragraph,
70
71
  to as RadioButton,
71
72
  O as RemixForm,
@@ -79,6 +80,7 @@ export {
79
80
  k as Text,
80
81
  ro as Textarea,
81
82
  Ho as Time,
83
+ qo as Video,
82
84
  fo as Vimeo,
83
85
  ko as VimeoPlayButton,
84
86
  lo as VimeoPreviewImage,
package/lib/form.ws.js CHANGED
@@ -1,30 +1,25 @@
1
- import { FormIcon as t } from "@webstudio-is/icons/svg";
1
+ import { FormIcon as r } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as o } from "@webstudio-is/sdk";
3
- import { form as r } from "@webstudio-is/sdk/normalize.css";
3
+ import { form as t } from "@webstudio-is/sdk/normalize.css";
4
4
  import { props as e } from "./__generated__/form.props.js";
5
- const n = {
5
+ const s = {
6
6
  form: [
7
- ...r,
8
- { property: "minHeight", value: { type: "unit", unit: "px", value: 20 } }
7
+ ...t,
8
+ { property: "min-height", value: { type: "unit", unit: "px", value: 20 } }
9
9
  ]
10
- }, p = {
10
+ }, n = {
11
11
  category: "forms",
12
- type: "container",
13
12
  label: "Form",
14
- constraints: {
15
- relation: "ancestor",
16
- component: { $nin: ["Form", "Button", "Link"] }
17
- },
18
13
  description: "Create filters, surveys, searches and more.",
19
- icon: t,
14
+ icon: r,
20
15
  states: o,
21
- presetStyle: n,
16
+ presetStyle: s,
22
17
  order: 0
23
18
  }, c = {
24
19
  props: e,
25
20
  initialProps: ["id", "className", "action"]
26
21
  };
27
22
  export {
28
- p as meta,
23
+ n as meta,
29
24
  c as propsMeta
30
25
  };
@@ -1,10 +1,9 @@
1
1
  const o = {
2
- type: "container",
3
2
  icon: ""
4
- }, t = {
3
+ }, p = {
5
4
  props: {}
6
5
  };
7
6
  export {
8
7
  o as meta,
9
- t as propsMeta
8
+ p as propsMeta
10
9
  };
@@ -1,19 +1,17 @@
1
1
  import { ResourceIcon as o } from "@webstudio-is/icons/svg";
2
2
  import "@webstudio-is/sdk";
3
- import { props as t } from "./__generated__/head-link.props.js";
3
+ import { props as r } from "./__generated__/head-link.props.js";
4
4
  const p = {
5
- category: "hidden",
6
5
  icon: o,
7
- type: "container",
8
- constraints: {
9
- relation: "parent",
10
- component: { $eq: "HeadSlot" }
6
+ contentModel: {
7
+ category: "none",
8
+ children: []
11
9
  }
12
- }, a = {
13
- props: t,
10
+ }, c = {
11
+ props: r,
14
12
  initialProps: ["rel", "hrefLang", "href", "type", "as"]
15
13
  };
16
14
  export {
17
15
  p as meta,
18
- a as propsMeta
16
+ c as propsMeta
19
17
  };
@@ -1,16 +1,14 @@
1
1
  import { WindowInfoIcon as o } from "@webstudio-is/icons/svg";
2
2
  import "@webstudio-is/sdk";
3
- import { props as t } from "./__generated__/head-meta.props.js";
3
+ import { props as n } from "./__generated__/head-meta.props.js";
4
4
  const p = {
5
- category: "hidden",
6
5
  icon: o,
7
- type: "container",
8
- constraints: {
9
- relation: "parent",
10
- component: { $eq: "HeadSlot" }
6
+ contentModel: {
7
+ category: "none",
8
+ children: []
11
9
  }
12
10
  }, i = {
13
- props: t,
11
+ props: n,
14
12
  initialProps: ["name", "property", "content"]
15
13
  };
16
14
  export {
@@ -1,20 +1,13 @@
1
- import { HeaderIcon as o } from "@webstudio-is/icons/svg";
1
+ import { HeaderIcon as e } from "@webstudio-is/icons/svg";
2
2
  import "@webstudio-is/sdk";
3
- import { props as t } from "./__generated__/head.props.js";
3
+ import { props as t } from "./__generated__/head-slot.props.js";
4
4
  const r = {
5
- icon: o,
6
- type: "container",
5
+ icon: e,
7
6
  description: "Inserts children into the head of the document",
8
- constraints: [
9
- {
10
- relation: "ancestor",
11
- component: { $nin: ["HeadSlot"] }
12
- },
13
- {
14
- relation: "child",
15
- component: { $in: ["HeadLink", "HeadMeta", "HeadTitle"] }
16
- }
17
- ]
7
+ contentModel: {
8
+ category: "instance",
9
+ children: ["HeadLink", "HeadMeta", "HeadTitle"]
10
+ }
18
11
  }, a = {
19
12
  props: t,
20
13
  initialProps: []
@@ -1,18 +1,15 @@
1
1
  import { WindowTitleIcon as o } from "@webstudio-is/icons/svg";
2
- import "@webstudio-is/sdk";
3
2
  import { props as t } from "./__generated__/head-title.props.js";
4
- const p = {
5
- category: "hidden",
3
+ const r = {
6
4
  icon: o,
7
- type: "container",
8
- constraints: {
9
- relation: "parent",
10
- component: { $eq: "HeadSlot" }
5
+ contentModel: {
6
+ category: "none",
7
+ children: ["text"]
11
8
  }
12
- }, i = {
9
+ }, c = {
13
10
  props: t
14
11
  };
15
12
  export {
16
- p as meta,
17
- i as propsMeta
13
+ r as meta,
14
+ c as propsMeta
18
15
  };
package/lib/heading.js CHANGED
@@ -1,9 +1,12 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as n } from "react";
3
- const d = "h1", f = n(
4
- ({ tag: a = d, children: o, ...r }, t) => /* @__PURE__ */ e(a, { ...r, ref: t, children: o })
1
+ import { forwardRef as o, createElement as g } from "react";
2
+ import { getTagFromProps as m } from "@webstudio-is/sdk/runtime";
3
+ const n = "h1", d = o(
4
+ ({ tag: e, ...t }, a) => {
5
+ const r = m(t) ?? e ?? n;
6
+ return g(r, { ...t, ref: a });
7
+ }
5
8
  );
6
- f.displayName = "Heading";
9
+ d.displayName = "Heading";
7
10
  export {
8
- f as Heading
11
+ d as Heading
9
12
  };
package/lib/heading.ws.js CHANGED
@@ -1,26 +1,30 @@
1
1
  import { HeadingIcon as t } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as o } from "@webstudio-is/sdk";
3
- import { h1 as e, h2 as n, h3 as r, h4 as a, h5 as s, h6 as i } from "@webstudio-is/sdk/normalize.css";
4
- import { props as p } from "./__generated__/heading.props.js";
5
- const m = {
6
- h1: e,
7
- h2: n,
8
- h3: r,
9
- h4: a,
10
- h5: s,
11
- h6: i
12
- }, d = {
13
- type: "container",
3
+ import { h6 as r, h5 as e, h4 as p, h3 as a, h2 as i, h1 as s } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as h } from "./__generated__/heading.props.js";
5
+ const d = {
6
+ placeholder: "Heading",
14
7
  icon: t,
15
- constraints: {
16
- relation: "ancestor",
17
- component: { $neq: "Heading" }
18
- },
19
8
  states: o,
20
- presetStyle: m
9
+ presetStyle: {
10
+ h1: s,
11
+ h2: i,
12
+ h3: a,
13
+ h4: p,
14
+ h5: e,
15
+ h6: r
16
+ }
21
17
  }, g = {
22
- props: p,
23
- initialProps: ["id", "className", "tag"]
18
+ props: {
19
+ ...h,
20
+ tag: {
21
+ required: !0,
22
+ control: "tag",
23
+ type: "string",
24
+ options: ["h1", "h2", "h3", "h4", "h5", "h6"]
25
+ }
26
+ },
27
+ initialProps: ["tag", "id", "className"]
24
28
  };
25
29
  export {
26
30
  d as meta,
@@ -1,25 +1,29 @@
1
1
  import { EmbedIcon as t } from "@webstudio-is/icons/svg";
2
+ import { descendantComponent as n } from "@webstudio-is/sdk";
2
3
  import { props as e } from "./__generated__/html-embed.props.js";
3
- const i = {
4
- div: [
5
- {
6
- property: "display",
7
- value: { type: "keyword", value: "contents" }
8
- },
9
- {
10
- property: "whiteSpaceCollapse",
11
- value: { type: "keyword", value: "collapse" }
12
- }
13
- ]
14
- }, a = {
4
+ const r = {
15
5
  category: "general",
16
- type: "embed",
17
6
  label: "HTML Embed",
18
7
  description: "Used to add HTML code to the page, such as an SVG or script.",
19
8
  icon: t,
20
- presetStyle: i,
21
- order: 2
22
- }, r = {
9
+ order: 2,
10
+ contentModel: {
11
+ category: "instance",
12
+ children: [n]
13
+ },
14
+ presetStyle: {
15
+ div: [
16
+ {
17
+ property: "display",
18
+ value: { type: "keyword", value: "contents" }
19
+ },
20
+ {
21
+ property: "white-space-collapse",
22
+ value: { type: "keyword", value: "collapse" }
23
+ }
24
+ ]
25
+ }
26
+ }, c = {
23
27
  props: {
24
28
  ...e,
25
29
  clientOnly: {
@@ -41,6 +45,6 @@ const i = {
41
45
  initialProps: ["className", "clientOnly", "executeScriptOnCanvas"]
42
46
  };
43
47
  export {
44
- a as meta,
45
- r as propsMeta
48
+ r as meta,
49
+ c as propsMeta
46
50
  };
package/lib/image.ws.js CHANGED
@@ -7,7 +7,7 @@ const a = {
7
7
  ...o,
8
8
  // Otherwise on new image insert onto canvas it can overfit screen size multiple times
9
9
  {
10
- property: "maxWidth",
10
+ property: "max-width",
11
11
  value: { type: "unit", unit: "%", value: 100 }
12
12
  },
13
13
  // inline | inline-block is not suitable because without line-height: 0 on the parent you get unsuitable spaces/margins
@@ -26,13 +26,12 @@ const a = {
26
26
  ]
27
27
  }, l = {
28
28
  category: "media",
29
- type: "embed",
30
29
  description: "Add an image asset to the page. Webstudio automatically converts images to WebP or AVIF format and makes them responsive for best performance.",
31
30
  icon: e,
32
31
  states: t,
33
32
  presetStyle: a,
34
33
  order: 0
35
- }, d = {
34
+ }, n = {
36
35
  props: {
37
36
  ...r,
38
37
  // Automatically generated props don't have the right control.
@@ -56,5 +55,5 @@ const a = {
56
55
  };
57
56
  export {
58
57
  l as meta,
59
- d as propsMeta
58
+ n as propsMeta
60
59
  };