@webstudio-is/react-sdk 0.59.0 → 0.61.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 (163) hide show
  1. package/lib/app/custom-components/shared/remix-link.js +2 -2
  2. package/lib/app/index.js +0 -1
  3. package/lib/cjs/app/custom-components/shared/remix-link.js +2 -2
  4. package/lib/cjs/app/index.js +0 -1
  5. package/lib/cjs/components/__generated__/blockquote.props.js +5 -0
  6. package/lib/cjs/components/__generated__/body.props.js +5 -0
  7. package/lib/cjs/components/__generated__/bold.props.js +5 -0
  8. package/lib/cjs/components/__generated__/box.props.js +5 -0
  9. package/lib/cjs/components/__generated__/button.props.js +5 -1
  10. package/lib/cjs/components/__generated__/code.props.js +5 -0
  11. package/lib/cjs/components/__generated__/form.props.js +5 -0
  12. package/lib/cjs/components/__generated__/heading.props.js +5 -0
  13. package/lib/cjs/components/__generated__/image.props.js +5 -0
  14. package/lib/cjs/components/__generated__/input.props.js +11 -2
  15. package/lib/cjs/components/__generated__/italic.props.js +5 -0
  16. package/lib/cjs/components/__generated__/link-block.props.js +5 -1
  17. package/lib/cjs/components/__generated__/link.props.js +5 -1
  18. package/lib/cjs/components/__generated__/list-item.props.js +5 -0
  19. package/lib/cjs/components/__generated__/list.props.js +5 -0
  20. package/lib/cjs/components/__generated__/paragraph.props.js +5 -0
  21. package/lib/cjs/components/__generated__/rich-text-link.props.js +5 -1
  22. package/lib/cjs/components/__generated__/separator.props.js +5 -0
  23. package/lib/cjs/components/__generated__/span.props.js +5 -0
  24. package/lib/cjs/components/__generated__/subscript.props.js +5 -0
  25. package/lib/cjs/components/__generated__/superscript.props.js +5 -0
  26. package/lib/cjs/components/__generated__/text-block.props.js +5 -0
  27. package/lib/cjs/components/blockquote.ws.js +36 -48
  28. package/lib/cjs/components/body.ws.js +19 -24
  29. package/lib/cjs/components/button.ws.js +1 -1
  30. package/lib/cjs/components/code.ws.js +20 -28
  31. package/lib/cjs/components/component-meta.js +2 -1
  32. package/lib/cjs/components/form.ws.js +14 -7
  33. package/lib/cjs/components/heading.ws.js +1 -1
  34. package/lib/cjs/components/image.ws.js +8 -9
  35. package/lib/cjs/components/italic.ws.js +5 -5
  36. package/lib/cjs/components/link-block.ws.js +5 -5
  37. package/lib/cjs/components/link.js +1 -1
  38. package/lib/cjs/components/link.ws.js +9 -10
  39. package/lib/cjs/components/list-item.ws.js +1 -1
  40. package/lib/cjs/components/list.ws.js +22 -22
  41. package/lib/cjs/components/paragraph.ws.js +1 -1
  42. package/lib/cjs/components/separator.ws.js +20 -20
  43. package/lib/cjs/components/text-block.ws.js +6 -7
  44. package/lib/cjs/css/css.js +6 -9
  45. package/lib/cjs/css/normalize.js +166 -185
  46. package/lib/cjs/css/presets.js +14 -34
  47. package/lib/cjs/css/style-rules.js +17 -0
  48. package/lib/cjs/embed-template.js +160 -0
  49. package/lib/cjs/index.js +1 -0
  50. package/lib/components/__generated__/blockquote.props.js +5 -0
  51. package/lib/components/__generated__/body.props.js +5 -0
  52. package/lib/components/__generated__/bold.props.js +5 -0
  53. package/lib/components/__generated__/box.props.js +5 -0
  54. package/lib/components/__generated__/button.props.js +5 -1
  55. package/lib/components/__generated__/code.props.js +5 -0
  56. package/lib/components/__generated__/form.props.js +5 -0
  57. package/lib/components/__generated__/heading.props.js +5 -0
  58. package/lib/components/__generated__/image.props.js +5 -0
  59. package/lib/components/__generated__/input.props.js +11 -2
  60. package/lib/components/__generated__/italic.props.js +5 -0
  61. package/lib/components/__generated__/link-block.props.js +5 -1
  62. package/lib/components/__generated__/link.props.js +5 -1
  63. package/lib/components/__generated__/list-item.props.js +5 -0
  64. package/lib/components/__generated__/list.props.js +5 -0
  65. package/lib/components/__generated__/paragraph.props.js +5 -0
  66. package/lib/components/__generated__/rich-text-link.props.js +5 -1
  67. package/lib/components/__generated__/separator.props.js +5 -0
  68. package/lib/components/__generated__/span.props.js +5 -0
  69. package/lib/components/__generated__/subscript.props.js +5 -0
  70. package/lib/components/__generated__/superscript.props.js +5 -0
  71. package/lib/components/__generated__/text-block.props.js +5 -0
  72. package/lib/components/blockquote.ws.js +36 -48
  73. package/lib/components/body.ws.js +19 -24
  74. package/lib/components/button.ws.js +1 -1
  75. package/lib/components/code.ws.js +20 -28
  76. package/lib/components/component-meta.js +2 -1
  77. package/lib/components/form.ws.js +14 -7
  78. package/lib/components/heading.ws.js +1 -1
  79. package/lib/components/image.ws.js +8 -9
  80. package/lib/components/italic.ws.js +5 -5
  81. package/lib/components/link-block.ws.js +5 -5
  82. package/lib/components/link.js +1 -1
  83. package/lib/components/link.ws.js +9 -10
  84. package/lib/components/list-item.ws.js +1 -1
  85. package/lib/components/list.ws.js +22 -22
  86. package/lib/components/paragraph.ws.js +1 -1
  87. package/lib/components/separator.ws.js +20 -20
  88. package/lib/components/text-block.ws.js +6 -7
  89. package/lib/css/css.js +8 -11
  90. package/lib/css/normalize.js +166 -185
  91. package/lib/css/presets.js +14 -34
  92. package/lib/css/style-rules.js +17 -0
  93. package/lib/embed-template.js +140 -0
  94. package/lib/index.js +1 -0
  95. package/lib/types/app/index.d.ts +0 -1
  96. package/lib/types/components/box.stories.d.ts +2 -2
  97. package/lib/types/components/component-meta.d.ts +20 -5
  98. package/lib/types/components/components-utils.d.ts +1 -1
  99. package/lib/types/css/normalize.d.ts +8786 -2286
  100. package/lib/types/css/presets.d.ts +2 -38
  101. package/lib/types/css/style-rules.d.ts +11 -9
  102. package/lib/types/embed-template.d.ts +1725 -0
  103. package/lib/types/embed-template.test.d.ts +1 -0
  104. package/lib/types/index.d.ts +1 -0
  105. package/package.json +16 -19
  106. package/src/app/custom-components/shared/remix-link.tsx +2 -2
  107. package/src/app/index.ts +0 -1
  108. package/src/components/__generated__/blockquote.props.ts +5 -0
  109. package/src/components/__generated__/body.props.ts +5 -0
  110. package/src/components/__generated__/bold.props.ts +5 -0
  111. package/src/components/__generated__/box.props.ts +5 -0
  112. package/src/components/__generated__/button.props.ts +5 -1
  113. package/src/components/__generated__/code.props.ts +5 -0
  114. package/src/components/__generated__/form.props.ts +5 -0
  115. package/src/components/__generated__/heading.props.ts +5 -0
  116. package/src/components/__generated__/image.props.ts +5 -0
  117. package/src/components/__generated__/input.props.ts +11 -2
  118. package/src/components/__generated__/italic.props.ts +5 -0
  119. package/src/components/__generated__/link-block.props.ts +5 -1
  120. package/src/components/__generated__/link.props.ts +5 -1
  121. package/src/components/__generated__/list-item.props.ts +5 -0
  122. package/src/components/__generated__/list.props.ts +5 -0
  123. package/src/components/__generated__/paragraph.props.ts +5 -0
  124. package/src/components/__generated__/rich-text-link.props.ts +5 -1
  125. package/src/components/__generated__/separator.props.ts +5 -0
  126. package/src/components/__generated__/span.props.ts +5 -0
  127. package/src/components/__generated__/subscript.props.ts +5 -0
  128. package/src/components/__generated__/superscript.props.ts +5 -0
  129. package/src/components/__generated__/text-block.props.ts +5 -0
  130. package/src/components/blockquote.ws.tsx +42 -52
  131. package/src/components/body.ws.tsx +25 -32
  132. package/src/components/bold.ws.tsx +6 -3
  133. package/src/components/box.ws.ts +6 -3
  134. package/src/components/button.ws.tsx +7 -4
  135. package/src/components/code.ws.tsx +26 -32
  136. package/src/components/component-meta.ts +5 -3
  137. package/src/components/form.ws.tsx +19 -9
  138. package/src/components/heading.ws.tsx +7 -4
  139. package/src/components/image.ws.tsx +14 -12
  140. package/src/components/input.ws.tsx +6 -3
  141. package/src/components/italic.ws.tsx +11 -8
  142. package/src/components/link-block.ws.tsx +11 -8
  143. package/src/components/link.tsx +1 -1
  144. package/src/components/link.ws.tsx +15 -13
  145. package/src/components/list-item.ws.tsx +7 -4
  146. package/src/components/list.ws.tsx +28 -25
  147. package/src/components/paragraph.ws.tsx +7 -4
  148. package/src/components/separator.ws.tsx +26 -25
  149. package/src/components/span.ws.tsx +6 -3
  150. package/src/components/subscript.ws.tsx +6 -3
  151. package/src/components/superscript.ws.tsx +6 -3
  152. package/src/components/text-block.ws.tsx +12 -11
  153. package/src/css/css.ts +8 -11
  154. package/src/css/normalize.ts +165 -188
  155. package/src/css/presets.ts +15 -37
  156. package/src/css/style-rules.ts +24 -0
  157. package/src/embed-template.test.ts +210 -0
  158. package/src/embed-template.ts +187 -0
  159. package/src/index.ts +1 -0
  160. package/lib/app/handle-request.server.js +0 -16
  161. package/lib/cjs/app/handle-request.server.js +0 -36
  162. package/lib/types/app/handle-request.server.d.ts +0 -2
  163. package/src/app/handle-request.server.tsx +0 -21
@@ -38,6 +38,7 @@ const props = {
38
38
  type: "boolean"
39
39
  },
40
40
  accessKey: { required: false, control: "text", type: "string" },
41
+ autoFocus: { required: false, control: "boolean", type: "boolean" },
41
42
  className: { required: false, control: "text", type: "string" },
42
43
  contentEditable: { required: false, control: "text", type: "string" },
43
44
  contextMenu: { required: false, control: "text", type: "string" },
@@ -46,6 +47,7 @@ const props = {
46
47
  hidden: { required: false, control: "boolean", type: "boolean" },
47
48
  id: { required: false, control: "text", type: "string" },
48
49
  lang: { required: false, control: "text", type: "string" },
50
+ nonce: { required: false, control: "text", type: "string" },
49
51
  placeholder: { required: false, control: "text", type: "string" },
50
52
  spellCheck: { required: false, control: "boolean", type: "boolean" },
51
53
  tabIndex: { required: false, control: "number", type: "number" },
@@ -58,11 +60,14 @@ const props = {
58
60
  radioGroup: { required: false, control: "text", type: "string" },
59
61
  role: { required: false, control: "text", type: "string" },
60
62
  about: { required: false, control: "text", type: "string" },
63
+ content: { required: false, control: "text", type: "string" },
61
64
  datatype: { required: false, control: "text", type: "string" },
62
65
  inlist: { required: false, control: "text", type: "string" },
63
66
  prefix: { required: false, control: "text", type: "string" },
64
67
  property: { required: false, control: "text", type: "string" },
68
+ rel: { required: false, control: "text", type: "string" },
65
69
  resource: { required: false, control: "text", type: "string" },
70
+ rev: { required: false, control: "text", type: "string" },
66
71
  typeof: { required: false, control: "text", type: "string" },
67
72
  vocab: { required: false, control: "text", type: "string" },
68
73
  autoCapitalize: { required: false, control: "text", type: "string" },
@@ -38,6 +38,7 @@ const props = {
38
38
  type: "boolean"
39
39
  },
40
40
  accessKey: { required: false, control: "text", type: "string" },
41
+ autoFocus: { required: false, control: "boolean", type: "boolean" },
41
42
  className: { required: false, control: "text", type: "string" },
42
43
  contentEditable: { required: false, control: "text", type: "string" },
43
44
  contextMenu: { required: false, control: "text", type: "string" },
@@ -46,6 +47,7 @@ const props = {
46
47
  hidden: { required: false, control: "boolean", type: "boolean" },
47
48
  id: { required: false, control: "text", type: "string" },
48
49
  lang: { required: false, control: "text", type: "string" },
50
+ nonce: { required: false, control: "text", type: "string" },
49
51
  placeholder: { required: false, control: "text", type: "string" },
50
52
  spellCheck: { required: false, control: "boolean", type: "boolean" },
51
53
  tabIndex: { required: false, control: "number", type: "number" },
@@ -58,11 +60,14 @@ const props = {
58
60
  radioGroup: { required: false, control: "text", type: "string" },
59
61
  role: { required: false, control: "text", type: "string" },
60
62
  about: { required: false, control: "text", type: "string" },
63
+ content: { required: false, control: "text", type: "string" },
61
64
  datatype: { required: false, control: "text", type: "string" },
62
65
  inlist: { required: false, control: "text", type: "string" },
63
66
  prefix: { required: false, control: "text", type: "string" },
64
67
  property: { required: false, control: "text", type: "string" },
68
+ rel: { required: false, control: "text", type: "string" },
65
69
  resource: { required: false, control: "text", type: "string" },
70
+ rev: { required: false, control: "text", type: "string" },
66
71
  typeof: { required: false, control: "text", type: "string" },
67
72
  vocab: { required: false, control: "text", type: "string" },
68
73
  autoCapitalize: { required: false, control: "text", type: "string" },
@@ -38,6 +38,7 @@ const props = {
38
38
  type: "boolean"
39
39
  },
40
40
  accessKey: { required: false, control: "text", type: "string" },
41
+ autoFocus: { required: false, control: "boolean", type: "boolean" },
41
42
  className: { required: false, control: "text", type: "string" },
42
43
  contentEditable: { required: false, control: "text", type: "string" },
43
44
  contextMenu: { required: false, control: "text", type: "string" },
@@ -46,6 +47,7 @@ const props = {
46
47
  hidden: { required: false, control: "boolean", type: "boolean" },
47
48
  id: { required: false, control: "text", type: "string" },
48
49
  lang: { required: false, control: "text", type: "string" },
50
+ nonce: { required: false, control: "text", type: "string" },
49
51
  placeholder: { required: false, control: "text", type: "string" },
50
52
  spellCheck: { required: false, control: "boolean", type: "boolean" },
51
53
  tabIndex: { required: false, control: "number", type: "number" },
@@ -58,11 +60,14 @@ const props = {
58
60
  radioGroup: { required: false, control: "text", type: "string" },
59
61
  role: { required: false, control: "text", type: "string" },
60
62
  about: { required: false, control: "text", type: "string" },
63
+ content: { required: false, control: "text", type: "string" },
61
64
  datatype: { required: false, control: "text", type: "string" },
62
65
  inlist: { required: false, control: "text", type: "string" },
63
66
  prefix: { required: false, control: "text", type: "string" },
64
67
  property: { required: false, control: "text", type: "string" },
68
+ rel: { required: false, control: "text", type: "string" },
65
69
  resource: { required: false, control: "text", type: "string" },
70
+ rev: { required: false, control: "text", type: "string" },
66
71
  typeof: { required: false, control: "text", type: "string" },
67
72
  vocab: { required: false, control: "text", type: "string" },
68
73
  autoCapitalize: { required: false, control: "text", type: "string" },
@@ -38,6 +38,7 @@ const props = {
38
38
  type: "boolean"
39
39
  },
40
40
  accessKey: { required: false, control: "text", type: "string" },
41
+ autoFocus: { required: false, control: "boolean", type: "boolean" },
41
42
  className: { required: false, control: "text", type: "string" },
42
43
  contentEditable: { required: false, control: "text", type: "string" },
43
44
  contextMenu: { required: false, control: "text", type: "string" },
@@ -46,6 +47,7 @@ const props = {
46
47
  hidden: { required: false, control: "boolean", type: "boolean" },
47
48
  id: { required: false, control: "text", type: "string" },
48
49
  lang: { required: false, control: "text", type: "string" },
50
+ nonce: { required: false, control: "text", type: "string" },
49
51
  placeholder: { required: false, control: "text", type: "string" },
50
52
  spellCheck: { required: false, control: "boolean", type: "boolean" },
51
53
  tabIndex: { required: false, control: "number", type: "number" },
@@ -58,11 +60,14 @@ const props = {
58
60
  radioGroup: { required: false, control: "text", type: "string" },
59
61
  role: { required: false, control: "text", type: "string" },
60
62
  about: { required: false, control: "text", type: "string" },
63
+ content: { required: false, control: "text", type: "string" },
61
64
  datatype: { required: false, control: "text", type: "string" },
62
65
  inlist: { required: false, control: "text", type: "string" },
63
66
  prefix: { required: false, control: "text", type: "string" },
64
67
  property: { required: false, control: "text", type: "string" },
68
+ rel: { required: false, control: "text", type: "string" },
65
69
  resource: { required: false, control: "text", type: "string" },
70
+ rev: { required: false, control: "text", type: "string" },
66
71
  typeof: { required: false, control: "text", type: "string" },
67
72
  vocab: { required: false, control: "text", type: "string" },
68
73
  autoCapitalize: { required: false, control: "text", type: "string" },
@@ -38,6 +38,7 @@ const props = {
38
38
  type: "boolean"
39
39
  },
40
40
  accessKey: { required: false, control: "text", type: "string" },
41
+ autoFocus: { required: false, control: "boolean", type: "boolean" },
41
42
  className: { required: false, control: "text", type: "string" },
42
43
  contentEditable: { required: false, control: "text", type: "string" },
43
44
  contextMenu: { required: false, control: "text", type: "string" },
@@ -46,6 +47,7 @@ const props = {
46
47
  hidden: { required: false, control: "boolean", type: "boolean" },
47
48
  id: { required: false, control: "text", type: "string" },
48
49
  lang: { required: false, control: "text", type: "string" },
50
+ nonce: { required: false, control: "text", type: "string" },
49
51
  placeholder: { required: false, control: "text", type: "string" },
50
52
  spellCheck: { required: false, control: "boolean", type: "boolean" },
51
53
  tabIndex: { required: false, control: "number", type: "number" },
@@ -58,11 +60,14 @@ const props = {
58
60
  radioGroup: { required: false, control: "text", type: "string" },
59
61
  role: { required: false, control: "text", type: "string" },
60
62
  about: { required: false, control: "text", type: "string" },
63
+ content: { required: false, control: "text", type: "string" },
61
64
  datatype: { required: false, control: "text", type: "string" },
62
65
  inlist: { required: false, control: "text", type: "string" },
63
66
  prefix: { required: false, control: "text", type: "string" },
64
67
  property: { required: false, control: "text", type: "string" },
68
+ rel: { required: false, control: "text", type: "string" },
65
69
  resource: { required: false, control: "text", type: "string" },
70
+ rev: { required: false, control: "text", type: "string" },
66
71
  typeof: { required: false, control: "text", type: "string" },
67
72
  vocab: { required: false, control: "text", type: "string" },
68
73
  autoCapitalize: { required: false, control: "text", type: "string" },
@@ -25,64 +25,52 @@ module.exports = __toCommonJS(blockquote_ws_exports);
25
25
  var import_icons = require("@webstudio-is/icons");
26
26
  var import_blockquote = require("./__generated__/blockquote.props");
27
27
  const presetStyle = {
28
- blockquote: {
29
- marginTop: {
30
- type: "unit",
31
- value: 0,
32
- unit: "number"
28
+ blockquote: [
29
+ {
30
+ property: "marginTop",
31
+ value: { type: "unit", value: 0, unit: "number" }
33
32
  },
34
- marginRight: {
35
- type: "unit",
36
- value: 0,
37
- unit: "number"
33
+ {
34
+ property: "marginRight",
35
+ value: { type: "unit", value: 0, unit: "number" }
38
36
  },
39
- marginBottom: {
40
- type: "unit",
41
- value: 10,
42
- unit: "px"
37
+ {
38
+ property: "marginBottom",
39
+ value: { type: "unit", value: 10, unit: "px" }
43
40
  },
44
- marginLeft: {
45
- type: "unit",
46
- value: 0,
47
- unit: "number"
41
+ {
42
+ property: "marginLeft",
43
+ value: { type: "unit", value: 0, unit: "number" }
48
44
  },
49
- paddingTop: {
50
- type: "unit",
51
- value: 10,
52
- unit: "px"
45
+ {
46
+ property: "paddingTop",
47
+ value: { type: "unit", value: 10, unit: "px" }
53
48
  },
54
- paddingBottom: {
55
- type: "unit",
56
- value: 10,
57
- unit: "px"
49
+ {
50
+ property: "paddingBottom",
51
+ value: { type: "unit", value: 10, unit: "px" }
58
52
  },
59
- paddingLeft: {
60
- type: "unit",
61
- value: 20,
62
- unit: "px"
53
+ {
54
+ property: "paddingLeft",
55
+ value: { type: "unit", value: 20, unit: "px" }
63
56
  },
64
- paddingRight: {
65
- type: "unit",
66
- value: 20,
67
- unit: "px"
57
+ {
58
+ property: "paddingRight",
59
+ value: { type: "unit", value: 20, unit: "px" }
68
60
  },
69
- borderLeftWidth: {
70
- type: "unit",
71
- value: 5,
72
- unit: "px"
61
+ {
62
+ property: "borderLeftWidth",
63
+ value: { type: "unit", value: 5, unit: "px" }
73
64
  },
74
- borderLeftStyle: {
75
- type: "keyword",
76
- value: "solid"
65
+ {
66
+ property: "borderLeftStyle",
67
+ value: { type: "keyword", value: "solid" }
77
68
  },
78
- borderLeftColor: {
79
- type: "rgb",
80
- r: 226,
81
- g: 226,
82
- b: 226,
83
- alpha: 1
69
+ {
70
+ property: "borderLeftColor",
71
+ value: { type: "rgb", r: 226, g: 226, b: 226, alpha: 1 }
84
72
  }
85
- }
73
+ ]
86
74
  };
87
75
  const meta = {
88
76
  category: "typography",
@@ -90,7 +78,7 @@ const meta = {
90
78
  label: "Blockquote",
91
79
  Icon: import_icons.BlockquoteIcon,
92
80
  presetStyle,
93
- children: ["Blockquote you can edit"]
81
+ children: [{ type: "text", value: "Blockquote you can edit" }]
94
82
  };
95
83
  const propsMeta = {
96
84
  props: import_blockquote.props
@@ -26,36 +26,31 @@ var import_icons = require("@webstudio-is/icons");
26
26
  var import_normalize = require("../css/normalize");
27
27
  var import_body = require("./__generated__/body.props");
28
28
  const presetStyle = {
29
- body: {
29
+ body: [
30
30
  ...import_normalize.body,
31
- minHeight: {
32
- type: "unit",
33
- unit: "%",
34
- value: 100
31
+ {
32
+ property: "minHeight",
33
+ value: { type: "unit", unit: "%", value: 100 }
35
34
  },
36
- backgroundColor: {
37
- type: "keyword",
38
- value: "white"
35
+ {
36
+ property: "fontFamily",
37
+ value: { type: "keyword", value: "Arial" }
39
38
  },
40
- fontFamily: {
41
- type: "keyword",
42
- value: "Arial"
39
+ {
40
+ property: "fontSize",
41
+ value: { type: "unit", unit: "px", value: 14 }
43
42
  },
44
- fontSize: {
45
- type: "unit",
46
- unit: "px",
47
- value: 14
43
+ {
44
+ property: "lineHeight",
45
+ value: { type: "unit", unit: "number", value: 1.5 }
48
46
  },
49
- lineHeight: {
50
- type: "unit",
51
- unit: "number",
52
- value: 1.5
53
- },
54
- color: {
55
- type: "keyword",
56
- value: "#232323"
47
+ // temporary set root color
48
+ // until builder start to fallback "inherit" to black
49
+ {
50
+ property: "color",
51
+ value: { type: "keyword", value: "black" }
57
52
  }
58
- }
53
+ ]
59
54
  };
60
55
  const meta = {
61
56
  type: "container",
@@ -23,8 +23,8 @@ __export(button_ws_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(button_ws_exports);
25
25
  var import_icons = require("@webstudio-is/icons");
26
- var import_button = require("./__generated__/button.props");
27
26
  var import_normalize = require("../css/normalize");
27
+ var import_button = require("./__generated__/button.props");
28
28
  const presetStyle = {
29
29
  button: import_normalize.button
30
30
  };
@@ -26,38 +26,30 @@ var import_icons = require("@webstudio-is/icons");
26
26
  var import_code = require("./code");
27
27
  var import_code2 = require("./__generated__/code.props");
28
28
  var import_normalize = require("../css/normalize");
29
- const display = {
30
- type: "var",
31
- value: import_code.displayVarNamespace,
32
- fallbacks: [
33
- {
34
- type: "keyword",
35
- value: "inline-block"
36
- }
37
- ]
38
- };
39
29
  const presetStyle = {
40
- code: {
30
+ code: [
41
31
  ...import_normalize.code,
42
- display,
43
- paddingLeft: {
44
- type: "unit",
45
- value: 0.2,
46
- unit: "em"
32
+ {
33
+ property: "display",
34
+ value: {
35
+ type: "var",
36
+ value: import_code.displayVarNamespace,
37
+ fallbacks: [{ type: "keyword", value: "inline-block" }]
38
+ }
47
39
  },
48
- paddingRight: {
49
- type: "unit",
50
- value: 0.2,
51
- unit: "em"
40
+ {
41
+ property: "paddingLeft",
42
+ value: { type: "unit", value: 0.2, unit: "em" }
52
43
  },
53
- backgroundColor: {
54
- type: "rgb",
55
- r: 238,
56
- g: 238,
57
- b: 238,
58
- alpha: 1
44
+ {
45
+ property: "paddingRight",
46
+ value: { type: "unit", value: 0.2, unit: "em" }
47
+ },
48
+ {
49
+ property: "backgroundColor",
50
+ value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 }
59
51
  }
60
- }
52
+ ]
61
53
  };
62
54
  const meta = {
63
55
  category: "general",
@@ -65,7 +57,7 @@ const meta = {
65
57
  label: "Code",
66
58
  Icon: import_icons.CodeIcon,
67
59
  presetStyle,
68
- children: ["Code you can edit"]
60
+ children: [{ type: "text", value: "Code you can edit" }]
69
61
  };
70
62
  const propsMeta = {
71
63
  props: import_code2.props,
@@ -24,6 +24,7 @@ __export(component_meta_exports, {
24
24
  module.exports = __toCommonJS(component_meta_exports);
25
25
  var import_zod = require("zod");
26
26
  var import_generate_arg_types = require("@webstudio-is/generate-arg-types");
27
+ var import_embed_template = require("../embed-template");
27
28
  const WsComponentPropsMeta = import_zod.z.object({
28
29
  props: import_zod.z.record(import_generate_arg_types.PropMeta),
29
30
  initialProps: import_zod.z.array(import_zod.z.string()).optional()
@@ -56,5 +57,5 @@ const WsComponentMeta = import_zod.z.object({
56
57
  Icon: import_zod.z.function(),
57
58
  presetStyle: import_zod.z.optional(import_zod.z.any()),
58
59
  states: import_zod.z.optional(import_zod.z.array(ComponentState)),
59
- children: import_zod.z.optional(import_zod.z.array(import_zod.z.string()))
60
+ children: import_zod.z.optional(import_embed_template.WsEmbedTemplate)
60
61
  });
@@ -26,21 +26,28 @@ var import_icons = require("@webstudio-is/icons");
26
26
  var import_normalize = require("../css/normalize");
27
27
  var import_form = require("./__generated__/form.props");
28
28
  const presetStyle = {
29
- form: {
29
+ form: [
30
30
  ...import_normalize.form,
31
- minHeight: {
32
- type: "unit",
33
- unit: "px",
34
- value: 20
31
+ {
32
+ property: "minHeight",
33
+ value: { type: "unit", unit: "px", value: 20 }
35
34
  }
36
- }
35
+ ]
37
36
  };
38
37
  const meta = {
39
38
  category: "forms",
40
39
  type: "container",
41
40
  label: "Form",
42
41
  Icon: import_icons.FormIcon,
43
- presetStyle
42
+ presetStyle,
43
+ children: [
44
+ { type: "instance", component: "Input", children: [] },
45
+ {
46
+ type: "instance",
47
+ component: "Button",
48
+ children: [{ type: "text", value: "Submit" }]
49
+ }
50
+ ]
44
51
  };
45
52
  const propsMeta = {
46
53
  props: import_form.props
@@ -38,7 +38,7 @@ const meta = {
38
38
  type: "rich-text",
39
39
  label: "Heading",
40
40
  Icon: import_icons.HeadingIcon,
41
- children: ["Heading you can edit"],
41
+ children: [{ type: "text", value: "Heading you can edit" }],
42
42
  presetStyle
43
43
  };
44
44
  const propsMeta = {
@@ -26,21 +26,20 @@ var import_icons = require("@webstudio-is/icons");
26
26
  var import_normalize = require("../css/normalize");
27
27
  var import_image = require("./__generated__/image.props");
28
28
  const presetStyle = {
29
- img: {
29
+ img: [
30
30
  ...import_normalize.img,
31
31
  // Otherwise on new image insert onto canvas it can overfit screen size multiple times
32
- maxWidth: {
33
- type: "unit",
34
- unit: "%",
35
- value: 100
32
+ {
33
+ property: "maxWidth",
34
+ value: { type: "unit", unit: "%", value: 100 }
36
35
  },
37
36
  // inline | inline-block is not suitable because without line-height: 0 on the parent you get unsuitable spaces/margins
38
37
  // see https://stackoverflow.com/questions/24771194/is-the-margin-of-inline-block-4px-is-static-for-all-browsers
39
- display: {
40
- type: "keyword",
41
- value: "block"
38
+ {
39
+ property: "display",
40
+ value: { type: "keyword", value: "block" }
42
41
  }
43
- }
42
+ ]
44
43
  };
45
44
  const meta = {
46
45
  category: "media",
@@ -26,13 +26,13 @@ var import_icons = require("@webstudio-is/icons");
26
26
  var import_italic = require("./__generated__/italic.props");
27
27
  var import_normalize = require("../css/normalize");
28
28
  const presetStyle = {
29
- i: {
29
+ i: [
30
30
  ...import_normalize.i,
31
- fontStyle: {
32
- type: "keyword",
33
- value: "italic"
31
+ {
32
+ property: "fontStyle",
33
+ value: { type: "keyword", value: "italic" }
34
34
  }
35
- }
35
+ ]
36
36
  };
37
37
  const meta = {
38
38
  type: "rich-text-child",
@@ -27,13 +27,13 @@ var import_link_block = require("./__generated__/link-block.props");
27
27
  var import_link = require("./link.ws");
28
28
  var import_normalize = require("../css/normalize");
29
29
  const presetStyle = {
30
- a: {
30
+ a: [
31
31
  ...import_normalize.a,
32
- display: {
33
- type: "keyword",
34
- value: "inline-block"
32
+ {
33
+ property: "display",
34
+ value: { type: "keyword", value: "inline-block" }
35
35
  }
36
- }
36
+ ]
37
37
  };
38
38
  const meta = {
39
39
  category: "general",
@@ -33,7 +33,7 @@ const Link = (0, import_react.forwardRef)((props, ref) => {
33
33
  let url = "#";
34
34
  switch (href?.type) {
35
35
  case "page":
36
- url = href.page.path;
36
+ url = href.page.path === "" ? "/" : href.page.path;
37
37
  if (href.hash !== void 0) {
38
38
  url += `#${href.hash}`;
39
39
  }
@@ -26,18 +26,17 @@ var import_icons = require("@webstudio-is/icons");
26
26
  var import_normalize = require("../css/normalize");
27
27
  var import_link = require("./__generated__/link.props");
28
28
  const presetStyle = {
29
- a: {
29
+ a: [
30
30
  ...import_normalize.a,
31
- minHeight: {
32
- type: "unit",
33
- unit: "em",
34
- value: 1
31
+ {
32
+ property: "minHeight",
33
+ value: { type: "unit", unit: "em", value: 1 }
35
34
  },
36
- display: {
37
- type: "keyword",
38
- value: "inline-block"
35
+ {
36
+ property: "display",
37
+ value: { type: "keyword", value: "inline-block" }
39
38
  }
40
- }
39
+ ]
41
40
  };
42
41
  const meta = {
43
42
  category: "general",
@@ -46,7 +45,7 @@ const meta = {
46
45
  Icon: import_icons.LinkIcon,
47
46
  presetStyle,
48
47
  states: [{ selector: "[aria-current=page]", label: "Current page" }],
49
- children: ["Link text you can edit"]
48
+ children: [{ type: "text", value: "Link text you can edit" }]
50
49
  };
51
50
  const propsMeta = {
52
51
  props: {
@@ -33,7 +33,7 @@ const meta = {
33
33
  type: "rich-text",
34
34
  label: "List Item",
35
35
  Icon: import_icons.ListItemIcon,
36
- children: ["List Item you can edit"],
36
+ children: [{ type: "text", value: "List Item you can edit" }],
37
37
  presetStyle
38
38
  };
39
39
  const propsMeta = {
@@ -26,36 +26,36 @@ var import_icons = require("@webstudio-is/icons");
26
26
  var import_list = require("./__generated__/list.props");
27
27
  var import_normalize = require("../css/normalize");
28
28
  const presetStyle = {
29
- ol: {
29
+ ol: [
30
30
  ...import_normalize.ol,
31
- marginTop: {
32
- type: "keyword",
33
- value: "0"
31
+ {
32
+ property: "marginTop",
33
+ value: { type: "keyword", value: "0" }
34
34
  },
35
- marginBottom: {
36
- type: "keyword",
37
- value: "10px"
35
+ {
36
+ property: "marginBottom",
37
+ value: { type: "keyword", value: "10px" }
38
38
  },
39
- paddingLeft: {
40
- type: "keyword",
41
- value: "40px"
39
+ {
40
+ property: "paddingLeft",
41
+ value: { type: "keyword", value: "40px" }
42
42
  }
43
- },
44
- ul: {
43
+ ],
44
+ ul: [
45
45
  ...import_normalize.ul,
46
- marginTop: {
47
- type: "keyword",
48
- value: "0"
46
+ {
47
+ property: "marginTop",
48
+ value: { type: "keyword", value: "0" }
49
49
  },
50
- marginBottom: {
51
- type: "keyword",
52
- value: "10px"
50
+ {
51
+ property: "marginBottom",
52
+ value: { type: "keyword", value: "10px" }
53
53
  },
54
- paddingLeft: {
55
- type: "keyword",
56
- value: "40px"
54
+ {
55
+ property: "paddingLeft",
56
+ value: { type: "keyword", value: "40px" }
57
57
  }
58
- }
58
+ ]
59
59
  };
60
60
  const meta = {
61
61
  category: "typography",