@webstudio-is/sdk-components-react 0.0.0-588fe22 → 0.0.0-73cd6ea

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 (204) 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 +2 -3
  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 +1 -8
  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 +18 -25
  44. package/lib/body.ws.js +6 -25
  45. package/lib/bold.ws.js +6 -15
  46. package/lib/box.js +9 -6
  47. package/lib/box.ws.js +37 -27
  48. package/lib/button.ws.js +7 -24
  49. package/lib/checkbox.ws.js +8 -26
  50. package/lib/code-text.ws.js +18 -26
  51. package/lib/components.js +6 -4
  52. package/lib/form.ws.js +9 -23
  53. package/lib/fragment.ws.js +2 -8
  54. package/lib/head-link.ws.js +9 -14
  55. package/lib/head-meta.ws.js +9 -14
  56. package/lib/head-slot.js +4 -5
  57. package/lib/head-slot.template.js +1 -1
  58. package/lib/head-slot.ws.js +9 -20
  59. package/lib/head-title.ws.js +6 -11
  60. package/lib/heading.js +9 -6
  61. package/lib/heading.ws.js +20 -23
  62. package/lib/html-embed.ws.js +22 -20
  63. package/lib/image.ws.js +21 -28
  64. package/lib/input.js +18 -14
  65. package/lib/input.ws.js +11 -37
  66. package/lib/italic.ws.js +6 -21
  67. package/lib/label.ws.js +7 -18
  68. package/lib/link.ws.js +11 -32
  69. package/lib/list-item.ws.js +6 -22
  70. package/lib/list.ws.js +15 -22
  71. package/lib/markdown-embed.js +3 -3
  72. package/lib/markdown-embed.ws.js +13 -11
  73. package/lib/metas.js +6 -4
  74. package/lib/option.js +3 -1
  75. package/lib/option.ws.js +9 -18
  76. package/lib/paragraph.ws.js +7 -20
  77. package/lib/radio-button.ws.js +10 -29
  78. package/lib/rich-text-link.ws.js +3 -7
  79. package/lib/select.js +27 -14
  80. package/lib/select.ws.js +10 -28
  81. package/lib/separator.ws.js +14 -24
  82. package/lib/shared/video.js +13 -0
  83. package/lib/slot.ws.js +3 -7
  84. package/lib/span.ws.js +8 -15
  85. package/lib/subscript.ws.js +7 -16
  86. package/lib/superscript.ws.js +7 -16
  87. package/lib/templates.js +12 -36
  88. package/lib/text.js +9 -7
  89. package/lib/text.ws.js +22 -19
  90. package/lib/textarea.js +16 -5
  91. package/lib/textarea.ws.js +13 -35
  92. package/lib/time.js +2 -1
  93. package/lib/time.ws.js +12 -15
  94. package/lib/types/blockquote.ws.d.ts +1 -2
  95. package/lib/types/body.ws.d.ts +1 -2
  96. package/lib/types/bold.ws.d.ts +1 -2
  97. package/lib/types/box.d.ts +2 -3
  98. package/lib/types/box.ws.d.ts +1 -2
  99. package/lib/types/button.ws.d.ts +1 -2
  100. package/lib/types/checkbox.d.ts +1 -1
  101. package/lib/types/checkbox.ws.d.ts +1 -2
  102. package/lib/types/code-text.ws.d.ts +1 -2
  103. package/lib/types/components.d.ts +1 -0
  104. package/lib/types/form.ws.d.ts +1 -2
  105. package/lib/types/fragment.ws.d.ts +1 -2
  106. package/lib/types/head-link.ws.d.ts +1 -2
  107. package/lib/types/head-meta.ws.d.ts +1 -2
  108. package/lib/types/head-slot.ws.d.ts +1 -2
  109. package/lib/types/head-title.ws.d.ts +1 -2
  110. package/lib/types/heading.d.ts +1 -2
  111. package/lib/types/heading.ws.d.ts +1 -2
  112. package/lib/types/html-embed.ws.d.ts +1 -2
  113. package/lib/types/image.ws.d.ts +1 -2
  114. package/lib/types/input.d.ts +1 -4
  115. package/lib/types/input.ws.d.ts +1 -2
  116. package/lib/types/italic.ws.d.ts +1 -2
  117. package/lib/types/label.ws.d.ts +1 -2
  118. package/lib/types/link.ws.d.ts +1 -2
  119. package/lib/types/list-item.ws.d.ts +1 -2
  120. package/lib/types/list.ws.d.ts +1 -2
  121. package/lib/types/markdown-embed.d.ts +3 -3
  122. package/lib/types/markdown-embed.ws.d.ts +1 -2
  123. package/lib/types/metas.d.ts +1 -0
  124. package/lib/types/option.d.ts +0 -1
  125. package/lib/types/option.ws.d.ts +1 -2
  126. package/lib/types/paragraph.ws.d.ts +1 -2
  127. package/lib/types/radio-button.d.ts +1 -1
  128. package/lib/types/radio-button.ws.d.ts +1 -2
  129. package/lib/types/rich-text-link.ws.d.ts +1 -2
  130. package/lib/types/select.d.ts +0 -1
  131. package/lib/types/select.ws.d.ts +1 -2
  132. package/lib/types/separator.ws.d.ts +1 -2
  133. package/lib/types/shared/video.d.ts +7 -0
  134. package/lib/types/slot.ws.d.ts +1 -2
  135. package/lib/types/span.ws.d.ts +1 -2
  136. package/lib/types/subscript.ws.d.ts +1 -2
  137. package/lib/types/superscript.ws.d.ts +1 -2
  138. package/lib/types/templates.d.ts +0 -12
  139. package/lib/types/text.d.ts +2 -3
  140. package/lib/types/text.ws.d.ts +1 -2
  141. package/lib/types/textarea.d.ts +0 -1
  142. package/lib/types/textarea.ws.d.ts +1 -2
  143. package/lib/types/time.d.ts +2 -4
  144. package/lib/types/time.ws.d.ts +1 -2
  145. package/lib/types/video.d.ts +9 -0
  146. package/lib/types/video.ws.d.ts +2 -0
  147. package/lib/types/vimeo-play-button.ws.d.ts +1 -2
  148. package/lib/types/vimeo-preview-image.d.ts +21 -21
  149. package/lib/types/vimeo-preview-image.ws.d.ts +1 -2
  150. package/lib/types/vimeo-spinner.ws.d.ts +1 -2
  151. package/lib/types/vimeo.d.ts +0 -6
  152. package/lib/types/vimeo.ws.d.ts +1 -2
  153. package/lib/types/webhook-form.ws.d.ts +1 -2
  154. package/lib/types/xml-node.ws.d.ts +1 -2
  155. package/lib/types/xml-time.ws.d.ts +1 -2
  156. package/lib/types/youtube.ws.d.ts +1 -2
  157. package/lib/video.js +53 -0
  158. package/lib/video.ws.js +44 -0
  159. package/lib/vimeo-play-button.js +4 -4
  160. package/lib/vimeo-play-button.ws.js +13 -26
  161. package/lib/vimeo-preview-image.js +5 -5
  162. package/lib/vimeo-preview-image.ws.js +8 -10
  163. package/lib/vimeo-spinner.js +1 -1
  164. package/lib/vimeo-spinner.ws.js +12 -19
  165. package/lib/vimeo.js +98 -99
  166. package/lib/vimeo.template.js +22 -21
  167. package/lib/vimeo.ws.js +16 -21
  168. package/lib/webhook-form.template.js +59 -20
  169. package/lib/webhook-form.ws.js +16 -15
  170. package/lib/xml-node.js +17 -16
  171. package/lib/xml-node.ws.js +5 -8
  172. package/lib/xml-time.ws.js +4 -7
  173. package/lib/youtube.js +152 -131
  174. package/lib/youtube.template.js +16 -15
  175. package/lib/youtube.ws.js +15 -21
  176. package/package.json +13 -16
  177. package/lib/__generated__/head.props.js +0 -508
  178. package/lib/blockquote.template.js +0 -11
  179. package/lib/button.template.js +0 -11
  180. package/lib/checkbox.template.js +0 -14
  181. package/lib/heading.template.js +0 -11
  182. package/lib/label.template.js +0 -10
  183. package/lib/link.template.js +0 -11
  184. package/lib/list-item.template.js +0 -11
  185. package/lib/list.template.js +0 -15
  186. package/lib/paragraph.template.js +0 -11
  187. package/lib/props.js +0 -90
  188. package/lib/radio-button.template.js +0 -14
  189. package/lib/select.template.js +0 -16
  190. package/lib/text.template.js +0 -11
  191. package/lib/types/blockquote.template.d.ts +0 -2
  192. package/lib/types/button.template.d.ts +0 -2
  193. package/lib/types/checkbox.template.d.ts +0 -2
  194. package/lib/types/heading.template.d.ts +0 -2
  195. package/lib/types/label.template.d.ts +0 -2
  196. package/lib/types/link.template.d.ts +0 -2
  197. package/lib/types/list-item.template.d.ts +0 -2
  198. package/lib/types/list.template.d.ts +0 -2
  199. package/lib/types/paragraph.template.d.ts +0 -2
  200. package/lib/types/props.d.ts +0 -44
  201. package/lib/types/radio-button.template.d.ts +0 -2
  202. package/lib/types/select.template.d.ts +0 -2
  203. package/lib/types/text.template.d.ts +0 -2
  204. /package/lib/types/__generated__/{head.props.d.ts → video.props.d.ts} +0 -0
@@ -1,40 +1,21 @@
1
1
  import { RadioCheckedIcon as e } from "@webstudio-is/icons/svg";
2
- import { defaultStates as t } from "@webstudio-is/sdk";
3
- import { radio as o } from "@webstudio-is/sdk/normalize.css";
4
- import { props as r } from "./__generated__/radio-button.props.js";
5
- const i = {
2
+ import { radio as i } from "@webstudio-is/sdk/normalize.css";
3
+ import { props as o } from "./__generated__/radio-button.props.js";
4
+ const r = {
6
5
  input: [
7
- ...o,
6
+ ...i,
8
7
  {
9
- property: "marginRight",
8
+ property: "margin-right",
10
9
  value: { type: "unit", unit: "em", value: 0.5 }
11
10
  }
12
11
  ]
13
- }, p = {
14
- constraints: {
15
- relation: "ancestor",
16
- component: { $nin: ["Button", "Link"] }
17
- },
18
- type: "control",
12
+ }, m = {
19
13
  label: "Radio",
20
14
  icon: e,
21
- presetStyle: i,
22
- states: [
23
- ...t,
24
- { selector: ":checked", label: "Checked" },
25
- { selector: ":required", label: "Required" },
26
- { selector: ":optional", label: "Optional" }
27
- // Additional states will go into submenu
28
- //{ selector: ":disabled", label: "Disabled" },
29
- //{ selector: ":enabled", label: "Enabled" },
30
- //{ selector: ":read-only", label: "Read Only" },
31
- //{ selector: ":read-write", label: "Read Write" },
32
- ]
33
- }, s = {
34
- props: r,
35
- initialProps: ["id", "className", "name", "value", "required", "checked"]
15
+ presetStyle: r,
16
+ initialProps: ["id", "class", "name", "value", "required", "checked"],
17
+ props: o
36
18
  };
37
19
  export {
38
- p as meta,
39
- s as propsMeta
20
+ m as meta
40
21
  };
@@ -1,9 +1,5 @@
1
- import { meta as t, propsMeta as e } from "./link.ws.js";
2
- const a = {
3
- ...t,
4
- type: "rich-text-child"
5
- }, o = e;
1
+ import { meta as t } from "./link.ws.js";
2
+ const a = t;
6
3
  export {
7
- a as meta,
8
- o as propsMeta
4
+ a as meta
9
5
  };
package/lib/select.js CHANGED
@@ -1,19 +1,32 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import "@webstudio-is/react-sdk/runtime";
3
- import { forwardRef as r } from "react";
4
- const s = r(({ value: o, defaultValue: t, ...e }, n) => /* @__PURE__ */ c("select", { ...e, defaultValue: o ?? t, ref: n }));
5
- s.displayName = "Select";
6
- const l = {
7
- onNavigatorUnselect: (o, t) => {
8
- for (const e of t.instancePath)
9
- e.component === "Option" && o.setMemoryProp(e, "selected", void 0);
1
+ import { forwardRef as r, useContext as s, createElement as i } from "react";
2
+ import { ReactSdkContext as l } from "@webstudio-is/react-sdk/runtime";
3
+ const p = r(
4
+ ({ value: o, defaultValue: n, ...e }, t) => {
5
+ const { renderer: c } = s(l), a = c === "canvas" ? String(o ?? n) : void 0;
6
+ return /* @__PURE__ */ i(
7
+ "select",
8
+ {
9
+ ...e,
10
+ key: a,
11
+ defaultValue: o ?? n,
12
+ ref: t
13
+ }
14
+ );
15
+ }
16
+ );
17
+ p.displayName = "Select";
18
+ const S = {
19
+ onNavigatorUnselect: (o, n) => {
20
+ for (const e of n.instancePath)
21
+ (e.component === "Select" || e.tag === "select") && o.setMemoryProp(e, "value", void 0);
10
22
  },
11
- onNavigatorSelect: (o, t) => {
12
- for (const e of t.instancePath)
13
- e.component === "Option" && o.setMemoryProp(e, "selected", !0);
23
+ onNavigatorSelect: (o, n) => {
24
+ let e;
25
+ for (const t of n.instancePath)
26
+ (t.component === "Option" || t.tag === "option") && (e = o.getPropValue(t, "value")), (t.component === "Select" || t.tag === "select") && o.setMemoryProp(t, "value", e);
14
27
  }
15
28
  };
16
29
  export {
17
- s as Select,
18
- l as hooksSelect
30
+ p as Select,
31
+ S as hooksSelect
19
32
  };
package/lib/select.ws.js CHANGED
@@ -1,44 +1,26 @@
1
- import { SelectIcon as e } from "@webstudio-is/icons/svg";
2
- import { defaultStates as t } from "@webstudio-is/sdk";
3
- import { select as l } from "@webstudio-is/sdk/normalize.css";
4
- import { props as o } from "./__generated__/select.props.js";
5
- const r = {
1
+ import { select as e } from "@webstudio-is/sdk/normalize.css";
2
+ import { props as t } from "./__generated__/select.props.js";
3
+ const o = {
6
4
  select: [
7
- ...l,
5
+ ...e,
8
6
  {
9
7
  property: "display",
10
8
  value: { type: "keyword", value: "block" }
11
9
  }
12
10
  ]
13
- }, c = {
14
- constraints: {
15
- relation: "ancestor",
16
- component: { $nin: ["Button", "Link"] }
17
- },
18
- type: "container",
19
- icon: e,
20
- presetStyle: r,
21
- states: [
22
- ...t,
23
- { selector: "::placeholder", label: "Placeholder" },
24
- { selector: ":valid", label: "Valid" },
25
- { selector: ":invalid", label: "Invalid" },
26
- { selector: ":required", label: "Required" },
27
- { selector: ":optional", label: "Optional" }
28
- ]
29
11
  }, p = {
30
- props: o,
12
+ presetStyle: o,
31
13
  initialProps: [
32
14
  "id",
33
- "className",
15
+ "class",
34
16
  "name",
35
17
  "value",
36
18
  "multiple",
37
19
  "required",
38
- "autoFocus"
39
- ]
20
+ "autofocus"
21
+ ],
22
+ props: t
40
23
  };
41
24
  export {
42
- c as meta,
43
- p as propsMeta
25
+ p as meta
44
26
  };
@@ -1,48 +1,38 @@
1
- import { MinusIcon as e } from "@webstudio-is/icons/svg";
2
- import { defaultStates as o } from "@webstudio-is/sdk";
3
- import { hr as r } from "@webstudio-is/sdk/normalize.css";
4
- import { props as t } from "./__generated__/separator.props.js";
5
- const p = {
1
+ import { hr as e } from "@webstudio-is/sdk/normalize.css";
2
+ import { props as r } from "./__generated__/separator.props.js";
3
+ const o = {
6
4
  hr: [
7
- ...r,
5
+ ...e,
8
6
  {
9
7
  property: "height",
10
8
  value: { type: "keyword", value: "1px" }
11
9
  },
12
10
  {
13
- property: "backgroundColor",
11
+ property: "background-color",
14
12
  value: { type: "keyword", value: "gray" }
15
13
  },
16
14
  {
17
- property: "borderTopStyle",
15
+ property: "border-top-style",
18
16
  value: { type: "keyword", value: "none" }
19
17
  },
20
18
  {
21
- property: "borderRightStyle",
19
+ property: "border-right-style",
22
20
  value: { type: "keyword", value: "none" }
23
21
  },
24
22
  {
25
- property: "borderLeftStyle",
23
+ property: "border-left-style",
26
24
  value: { type: "keyword", value: "none" }
27
25
  },
28
26
  {
29
- property: "borderBottomStyle",
27
+ property: "border-bottom-style",
30
28
  value: { type: "keyword", value: "none" }
31
29
  }
32
30
  ]
33
- }, n = {
34
- category: "general",
35
- type: "embed",
36
- description: "Used to visually divide sections of content, helping to improve readability and organization within a webpage.",
37
- icon: e,
38
- states: o,
39
- presetStyle: p,
40
- order: 3
41
- }, d = {
42
- props: t,
43
- initialProps: ["id", "className"]
31
+ }, y = {
32
+ presetStyle: o,
33
+ initialProps: ["id", "class"],
34
+ props: r
44
35
  };
45
36
  export {
46
- n as meta,
47
- d as propsMeta
37
+ y as meta
48
38
  };
@@ -0,0 +1,13 @@
1
+ import { createContext as o } from "react";
2
+ const s = (t) => {
3
+ const e = "ontouchstart" in window;
4
+ (window.matchMedia("(max-width: 1024px)").matches || e) && t.requestFullscreen();
5
+ }, c = o({
6
+ onInitPlayer: () => {
7
+ },
8
+ status: "initial"
9
+ });
10
+ export {
11
+ c as VideoContext,
12
+ s as requestFullscreen
13
+ };
package/lib/slot.ws.js CHANGED
@@ -1,14 +1,10 @@
1
1
  import { SlotComponentIcon as t } from "@webstudio-is/icons/svg";
2
- const e = {
2
+ const o = {
3
3
  category: "general",
4
- type: "container",
5
4
  description: "Slot is a container for content that you want to reference across the project. Changes made to a Slot's children will be reflected in all other instances of that Slot.",
6
5
  icon: t,
7
- order: 5
8
- }, n = {
9
- props: {}
6
+ order: 4
10
7
  };
11
8
  export {
12
- e as meta,
13
- n as propsMeta
9
+ o as meta
14
10
  };
package/lib/span.ws.js CHANGED
@@ -1,20 +1,13 @@
1
- import { PaintBrushIcon as t } from "@webstudio-is/icons/svg";
2
- import { defaultStates as o } from "@webstudio-is/sdk";
1
+ import { PaintBrushIcon as o } from "@webstudio-is/icons/svg";
3
2
  import { span as r } from "@webstudio-is/sdk/normalize.css";
4
- import { props as e } from "./__generated__/span.props.js";
5
- const s = {
6
- span: r
7
- }, c = {
8
- type: "rich-text-child",
3
+ import { props as t } from "./__generated__/span.props.js";
4
+ const e = {
9
5
  label: "Text",
10
- icon: t,
11
- states: o,
12
- presetStyle: s
13
- }, n = {
14
- props: e,
15
- initialProps: ["id", "className"]
6
+ icon: o,
7
+ presetStyle: { span: r },
8
+ initialProps: ["id", "class"],
9
+ props: t
16
10
  };
17
11
  export {
18
- c as meta,
19
- n as propsMeta
12
+ e as meta
20
13
  };
@@ -1,20 +1,11 @@
1
- import { SubscriptIcon as t } from "@webstudio-is/icons/svg";
2
- import { defaultStates as o } from "@webstudio-is/sdk";
3
- import { sub as r } from "@webstudio-is/sdk/normalize.css";
4
- import { props as s } from "./__generated__/subscript.props.js";
5
- const e = {
6
- sub: r
7
- }, a = {
8
- type: "rich-text-child",
1
+ import { sub as t } from "@webstudio-is/sdk/normalize.css";
2
+ import { props as r } from "./__generated__/subscript.props.js";
3
+ const s = {
9
4
  label: "Subscript Text",
10
- icon: t,
11
- states: o,
12
- presetStyle: e
13
- }, l = {
14
- props: s,
15
- initialProps: ["id", "className"]
5
+ presetStyle: { sub: t },
6
+ initialProps: ["id", "class"],
7
+ props: r
16
8
  };
17
9
  export {
18
- a as meta,
19
- l as propsMeta
10
+ s as meta
20
11
  };
@@ -1,20 +1,11 @@
1
- import { SuperscriptIcon as t } from "@webstudio-is/icons/svg";
2
- import { defaultStates as r } from "@webstudio-is/sdk";
3
- import { sup as o } from "@webstudio-is/sdk/normalize.css";
4
- import { props as p } from "./__generated__/superscript.props.js";
5
- const e = {
6
- sup: o
7
- }, a = {
8
- type: "rich-text-child",
1
+ import { sup as p } from "@webstudio-is/sdk/normalize.css";
2
+ import { props as r } from "./__generated__/superscript.props.js";
3
+ const o = {
9
4
  label: "Superscript Text",
10
- icon: t,
11
- states: r,
12
- presetStyle: e
13
- }, l = {
14
- props: p,
15
- initialProps: ["id", "className"]
5
+ presetStyle: { sup: p },
6
+ initialProps: ["id", "class"],
7
+ props: r
16
8
  };
17
9
  export {
18
- a as meta,
19
- l as propsMeta
10
+ o as meta
20
11
  };
package/lib/templates.js CHANGED
@@ -1,38 +1,14 @@
1
- import { meta as o } from "./content-embed.template.js";
2
- import { meta as m } from "./markdown-embed.template.js";
3
- import { meta as s } from "./text.template.js";
4
- import { meta as p } from "./heading.template.js";
5
- import { meta as n } from "./paragraph.template.js";
6
- import { meta as i } from "./link.template.js";
7
- import { meta as u } from "./button.template.js";
8
- import { meta as l } from "./webhook-form.template.js";
9
- import { meta as c } from "./blockquote.template.js";
10
- import { meta as g } from "./list.template.js";
11
- import { meta as C } from "./list-item.template.js";
12
- import { meta as H } from "./label.template.js";
13
- import { meta as T } from "./radio-button.template.js";
14
- import { meta as w } from "./checkbox.template.js";
15
- import { meta as I } from "./vimeo.template.js";
16
- import { meta as P } from "./youtube.template.js";
17
- import { meta as V } from "./select.template.js";
18
- import { meta as j } from "./head-slot.template.js";
1
+ import { meta as m } from "./content-embed.template.js";
2
+ import { meta as a } from "./markdown-embed.template.js";
3
+ import { meta as f } from "./webhook-form.template.js";
4
+ import { meta as s } from "./vimeo.template.js";
5
+ import { meta as d } from "./youtube.template.js";
6
+ import { meta as n } from "./head-slot.template.js";
19
7
  export {
20
- c as Blockquote,
21
- u as Button,
22
- w as Checkbox,
23
- o as ContentEmbed,
24
- l as Form,
25
- j as HeadSlot,
26
- p as Heading,
27
- H as Label,
28
- i as Link,
29
- g as List,
30
- C as ListItem,
31
- m as MarkdownEmbed,
32
- n as Paragraph,
33
- T as RadioButton,
34
- V as Select,
35
- s as Text,
36
- I as Vimeo,
37
- P as YouTube
8
+ m as ContentEmbed,
9
+ f as Form,
10
+ n as HeadSlot,
11
+ a as MarkdownEmbed,
12
+ s as Vimeo,
13
+ d as YouTube
38
14
  };
package/lib/text.js CHANGED
@@ -1,10 +1,12 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as f } from "react";
3
- const m = "div", s = f(
4
- ({ tag: t = m, children: o, ...r }, a) => /* @__PURE__ */ e(t, { ...r, ref: a, children: o })
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: e, ...t }, r) => {
5
+ const o = f(t) ?? e ?? g;
6
+ return m(o, { ...t, ref: r });
7
+ }
5
8
  );
6
- s.displayName = "Text";
9
+ n.displayName = "Text";
7
10
  export {
8
- s as Text,
9
- m as defaultTag
11
+ n as Text
10
12
  };
package/lib/text.ws.js CHANGED
@@ -1,25 +1,28 @@
1
1
  import { TextIcon as t } from "@webstudio-is/icons/svg";
2
- import { defaultStates as e } from "@webstudio-is/sdk";
3
- import { div as o } from "@webstudio-is/sdk/normalize.css";
4
- import { props as i } from "./__generated__/text.props.js";
5
- const r = {
6
- div: [
2
+ import { div as i } from "@webstudio-is/sdk/normalize.css";
3
+ import { props as o } from "./__generated__/text.props.js";
4
+ const n = {
5
+ icon: t,
6
+ presetStyle: {
7
+ div: [
8
+ ...i,
9
+ {
10
+ property: "min-height",
11
+ value: { type: "unit", unit: "em", value: 1 }
12
+ }
13
+ ]
14
+ },
15
+ initialProps: ["tag", "id", "class"],
16
+ props: {
7
17
  ...o,
8
- {
9
- property: "minHeight",
10
- value: { type: "unit", unit: "em", value: 1 }
18
+ tag: {
19
+ required: !0,
20
+ control: "tag",
21
+ type: "string",
22
+ options: ["div", "cite", "figcaption", "span"]
11
23
  }
12
- ]
13
- }, n = {
14
- type: "container",
15
- icon: t,
16
- states: e,
17
- presetStyle: r
18
- }, c = {
19
- props: i,
20
- initialProps: ["id", "className", "tag"]
24
+ }
21
25
  };
22
26
  export {
23
- n as meta,
24
- c as propsMeta
27
+ n as meta
25
28
  };
package/lib/textarea.js CHANGED
@@ -1,7 +1,18 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as d } from "react";
3
- const f = d(({ children: i, value: e, defaultValue: r, ...a }, t) => /* @__PURE__ */ o("textarea", { ...a, defaultValue: e ?? r, ref: t }));
4
- f.displayName = "Textarea";
1
+ import { forwardRef as c, useContext as m, createElement as s } from "react";
2
+ import { ReactSdkContext as x } from "@webstudio-is/react-sdk/runtime";
3
+ const d = c(({ value: e, defaultValue: t, ...r }, a) => {
4
+ const { renderer: o } = m(x), n = o === "canvas" ? String(e ?? t) : void 0;
5
+ return /* @__PURE__ */ s(
6
+ "textarea",
7
+ {
8
+ ...r,
9
+ key: n,
10
+ defaultValue: e ?? t,
11
+ ref: a
12
+ }
13
+ );
14
+ });
15
+ d.displayName = "Textarea";
5
16
  export {
6
- f as Textarea
17
+ d as Textarea
7
18
  };
@@ -1,10 +1,8 @@
1
- import { FormTextAreaIcon as e } from "@webstudio-is/icons/svg";
2
- import { defaultStates as o } from "@webstudio-is/sdk";
3
- import { textarea as t } from "@webstudio-is/sdk/normalize.css";
1
+ import { textarea as e } from "@webstudio-is/sdk/normalize.css";
4
2
  import { props as r } from "./__generated__/textarea.props.js";
5
- const l = {
3
+ const t = {
6
4
  textarea: [
7
- ...t,
5
+ ...e,
8
6
  // resize doesn't work well while on canvas
9
7
  { property: "resize", value: { type: "keyword", value: "none" } },
10
8
  {
@@ -12,44 +10,24 @@ const l = {
12
10
  value: { type: "keyword", value: "block" }
13
11
  }
14
12
  ]
15
- }, p = {
16
- category: "forms",
17
- type: "control",
13
+ }, l = {
18
14
  label: "Text Area",
19
- description: "A multi-line text input for collecting longer string data from your users.",
20
- icon: e,
21
- presetStyle: l,
22
- order: 4,
23
- constraints: {
24
- relation: "ancestor",
25
- component: { $nin: ["Button", "Link"] }
15
+ presetStyle: t,
16
+ contentModel: {
17
+ category: "instance",
18
+ children: []
26
19
  },
27
- states: [
28
- ...o,
29
- { selector: "::placeholder", label: "Placeholder" },
30
- { selector: ":valid", label: "Valid" },
31
- { selector: ":invalid", label: "Invalid" },
32
- { selector: ":required", label: "Required" },
33
- { selector: ":optional", label: "Optional" }
34
- // Additional states will go into submenu
35
- //{ selector: ":disabled", label: "Disabled" },
36
- //{ selector: ":enabled", label: "Enabled" },
37
- //{ selector: ":read-only", label: "Read Only" },
38
- //{ selector: ":read-write", label: "Read Write" },
39
- ]
40
- }, c = {
41
- props: r,
42
20
  initialProps: [
43
21
  "id",
44
- "className",
22
+ "class",
45
23
  "name",
46
24
  "value",
47
25
  "placeholder",
48
26
  "required",
49
- "autoFocus"
50
- ]
27
+ "autofocus"
28
+ ],
29
+ props: r
51
30
  };
52
31
  export {
53
- p as meta,
54
- c as propsMeta
32
+ l as meta
55
33
  };
package/lib/time.js CHANGED
@@ -296,7 +296,8 @@ const c = [
296
296
  country: e = A,
297
297
  dateStyle: n = L,
298
298
  timeStyle: l = f,
299
- datetime: s = D,
299
+ // native html attribute in react style
300
+ dateTime: s = D,
300
301
  ...a
301
302
  }, u) => {
302
303
  const S = `${I(t)}-${B(
package/lib/time.ws.js CHANGED
@@ -1,21 +1,18 @@
1
- import { CalendarIcon as t } from "@webstudio-is/icons/svg";
2
- import { defaultStates as e } from "@webstudio-is/sdk";
3
- import { time as a } from "@webstudio-is/sdk/normalize.css";
4
- import { props as o } from "./__generated__/time.props.js";
1
+ import { time as e } from "@webstudio-is/sdk/normalize.css";
2
+ import { props as t } from "./__generated__/time.props.js";
5
3
  const r = {
6
- time: a
7
- }, s = {
8
4
  category: "localization",
9
- type: "container",
10
5
  description: "Converts machine-readable date and time to a human-readable format.",
11
- icon: t,
12
- states: e,
13
- presetStyle: r
14
- }, c = {
15
- props: o,
16
- initialProps: ["datetime", "language", "country", "dateStyle", "timeStyle"]
6
+ contentModel: {
7
+ category: "instance",
8
+ children: []
9
+ },
10
+ presetStyle: {
11
+ time: e
12
+ },
13
+ initialProps: ["datetime", "language", "country", "dateStyle", "timeStyle"],
14
+ props: t
17
15
  };
18
16
  export {
19
- s as meta,
20
- c as propsMeta
17
+ r as meta
21
18
  };
@@ -1,3 +1,2 @@
1
- import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
1
+ import type { WsComponentMeta } from "@webstudio-is/sdk";
2
2
  export declare const meta: WsComponentMeta;
3
- export declare const propsMeta: WsComponentPropsMeta;
@@ -1,3 +1,2 @@
1
- import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
1
+ import type { WsComponentMeta } from "@webstudio-is/sdk";
2
2
  export declare const meta: WsComponentMeta;
3
- export declare const propsMeta: WsComponentPropsMeta;
@@ -1,3 +1,2 @@
1
- import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
1
+ import type { WsComponentMeta } from "@webstudio-is/sdk";
2
2
  export declare const meta: WsComponentMeta;
3
- export declare const propsMeta: WsComponentPropsMeta;
@@ -1,8 +1,7 @@
1
1
  import { type ComponentProps } from "react";
2
- export declare const defaultTag = "div";
2
+ declare const defaultTag = "div";
3
3
  type Props = ComponentProps<typeof defaultTag> & {
4
- /** Use this property to change the HTML tag of this element to semantically structure and describe the content of a webpage. This can be important for accessibility tools and search engine optimization. */
5
- tag?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure";
4
+ tag?: string;
6
5
  };
7
6
  export declare const Box: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
8
7
  export {};
@@ -1,3 +1,2 @@
1
- import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
1
+ import type { WsComponentMeta } from "@webstudio-is/sdk";
2
2
  export declare const meta: WsComponentMeta;
3
- export declare const propsMeta: WsComponentPropsMeta;
@@ -1,3 +1,2 @@
1
- import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/sdk";
1
+ import type { WsComponentMeta } from "@webstudio-is/sdk";
2
2
  export declare const meta: WsComponentMeta;
3
- export declare const propsMeta: WsComponentPropsMeta;