@builder.io/mitosis 0.0.56-1 → 0.0.56-101

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 (394) hide show
  1. package/dist/src/__tests__/angular.test.js +5 -13
  2. package/dist/src/__tests__/builder.test.js +3 -3
  3. package/dist/src/__tests__/data/advanced-ref.raw.d.ts +4 -0
  4. package/dist/src/__tests__/data/advanced-ref.raw.jsx +39 -0
  5. package/dist/src/__tests__/data/basic-child-component.raw.d.ts +1 -0
  6. package/dist/src/__tests__/data/basic-child-component.raw.jsx +21 -0
  7. package/dist/src/__tests__/data/basic-context.raw.d.ts +1 -0
  8. package/dist/src/__tests__/data/basic-context.raw.jsx +29 -0
  9. package/dist/src/__tests__/data/basic-custom-mitosis-package.raw.d.ts +1 -0
  10. package/dist/src/__tests__/data/basic-custom-mitosis-package.raw.jsx +10 -0
  11. package/dist/src/__tests__/data/basic-for-show.raw.d.ts +1 -0
  12. package/dist/src/__tests__/data/basic-for-show.raw.jsx +20 -0
  13. package/dist/src/__tests__/data/basic-for.raw.d.ts +1 -0
  14. package/dist/src/__tests__/data/basic-for.raw.jsx +23 -0
  15. package/dist/src/__tests__/data/basic-forwardRef-metadata.raw.d.ts +5 -0
  16. package/dist/src/__tests__/data/basic-forwardRef-metadata.raw.jsx +17 -0
  17. package/dist/src/__tests__/data/basic-forwardRef.raw.d.ts +5 -0
  18. package/dist/src/__tests__/data/basic-forwardRef.raw.jsx +14 -0
  19. package/dist/src/__tests__/data/basic-onChange.raw.d.ts +1 -0
  20. package/dist/src/__tests__/data/basic-onChange.raw.jsx +17 -0
  21. package/dist/src/__tests__/data/basic-onMount-update.raw.d.ts +5 -0
  22. package/dist/src/__tests__/data/basic-onMount-update.raw.jsx +17 -0
  23. package/dist/src/__tests__/data/basic-onUpdate-return.raw.d.ts +1 -0
  24. package/dist/src/__tests__/data/basic-onUpdate-return.raw.jsx +24 -0
  25. package/dist/src/__tests__/data/basic-outputs-meta.raw.d.ts +1 -0
  26. package/dist/src/__tests__/data/basic-outputs-meta.raw.jsx +17 -0
  27. package/dist/src/__tests__/data/basic-outputs.raw.d.ts +1 -0
  28. package/dist/src/__tests__/data/basic-outputs.raw.jsx +14 -0
  29. package/dist/src/__tests__/data/basic-preserve-export-or-local-statement.raw.d.ts +6 -0
  30. package/dist/src/__tests__/data/basic-preserve-export-or-local-statement.raw.jsx +14 -0
  31. package/dist/src/__tests__/data/basic-props-destructure.raw.d.ts +6 -0
  32. package/dist/src/__tests__/data/basic-props-destructure.raw.jsx +14 -0
  33. package/dist/src/__tests__/data/basic-props.raw.d.ts +6 -0
  34. package/dist/src/__tests__/data/basic-props.raw.jsx +13 -0
  35. package/dist/src/__tests__/data/basic-ref-assignment.raw.d.ts +4 -0
  36. package/dist/src/__tests__/data/basic-ref-assignment.raw.jsx +15 -0
  37. package/dist/src/__tests__/data/basic-ref-usePrevious.raw.d.ts +5 -0
  38. package/dist/src/__tests__/data/basic-ref-usePrevious.raw.jsx +35 -0
  39. package/dist/src/__tests__/data/basic-ref.raw.d.ts +4 -0
  40. package/dist/src/__tests__/data/basic-ref.raw.jsx +36 -0
  41. package/dist/src/__tests__/data/basic.raw.d.ts +6 -1
  42. package/dist/src/__tests__/data/basic.raw.jsx +13 -4
  43. package/dist/src/__tests__/data/blocks/button-with-metadata.raw.d.ts +1 -1
  44. package/dist/src/__tests__/data/blocks/button.raw.d.ts +1 -1
  45. package/dist/src/__tests__/data/blocks/classname-jsx.raw.d.ts +7 -0
  46. package/dist/src/__tests__/data/blocks/classname-jsx.raw.jsx +15 -0
  47. package/dist/src/__tests__/data/blocks/columns.raw.d.ts +1 -1
  48. package/dist/src/__tests__/data/blocks/columns.raw.jsx +1 -1
  49. package/dist/src/__tests__/data/blocks/content-slot-html.raw.d.ts +7 -0
  50. package/dist/src/__tests__/data/blocks/content-slot-html.raw.jsx +15 -0
  51. package/dist/src/__tests__/data/blocks/content-slot-jsx.raw.d.ts +6 -0
  52. package/dist/src/__tests__/data/blocks/content-slot-jsx.raw.jsx +12 -0
  53. package/dist/src/__tests__/data/blocks/custom-code.raw.d.ts +1 -1
  54. package/dist/src/__tests__/data/blocks/custom-code.raw.jsx +3 -7
  55. package/dist/src/__tests__/data/blocks/embed.raw.d.ts +1 -1
  56. package/dist/src/__tests__/data/blocks/embed.raw.jsx +3 -7
  57. package/dist/src/__tests__/data/blocks/form.raw.d.ts +1 -1
  58. package/dist/src/__tests__/data/blocks/form.raw.jsx +8 -8
  59. package/dist/src/__tests__/data/blocks/image.raw.d.ts +2 -2
  60. package/dist/src/__tests__/data/blocks/image.raw.jsx +9 -10
  61. package/dist/src/__tests__/data/blocks/img-state.raw.d.ts +1 -0
  62. package/dist/src/__tests__/data/blocks/img-state.raw.jsx +17 -0
  63. package/dist/src/__tests__/data/blocks/img.raw.d.ts +1 -1
  64. package/dist/src/__tests__/data/blocks/input.raw.d.ts +1 -1
  65. package/dist/src/__tests__/data/blocks/input.raw.jsx +1 -3
  66. package/dist/src/__tests__/data/blocks/multiple-onUpdate.raw.d.ts +1 -1
  67. package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.d.ts +1 -1
  68. package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.jsx +7 -1
  69. package/dist/src/__tests__/data/blocks/onInit-onMount.raw.d.ts +1 -0
  70. package/dist/src/__tests__/data/blocks/onInit-onMount.raw.jsx +13 -0
  71. package/dist/src/__tests__/data/blocks/onInit.raw.d.ts +8 -0
  72. package/dist/src/__tests__/data/blocks/onInit.raw.jsx +20 -0
  73. package/dist/src/__tests__/data/blocks/onMount.raw.d.ts +1 -1
  74. package/dist/src/__tests__/data/blocks/onUpdate.raw.d.ts +1 -1
  75. package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.d.ts +1 -1
  76. package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.jsx +1 -1
  77. package/dist/src/__tests__/data/blocks/raw-text.raw.d.ts +1 -1
  78. package/dist/src/__tests__/data/blocks/rootShow.raw.d.ts +1 -1
  79. package/dist/src/__tests__/data/blocks/section-state.raw.d.ts +6 -0
  80. package/dist/src/__tests__/data/blocks/section-state.raw.jsx +17 -0
  81. package/dist/src/__tests__/data/blocks/section.raw.d.ts +1 -1
  82. package/dist/src/__tests__/data/blocks/select.raw.d.ts +1 -1
  83. package/dist/src/__tests__/data/blocks/select.raw.jsx +1 -3
  84. package/dist/src/__tests__/data/blocks/self-referencing-component-with-children.raw.d.ts +1 -1
  85. package/dist/src/__tests__/data/blocks/self-referencing-component.raw.d.ts +1 -1
  86. package/dist/src/__tests__/data/blocks/shadow-dom.raw.d.ts +1 -1
  87. package/dist/src/__tests__/data/blocks/shadow-dom.raw.jsx +2 -4
  88. package/dist/src/__tests__/data/blocks/slot-html.raw.d.ts +5 -0
  89. package/dist/src/__tests__/data/blocks/slot-html.raw.jsx +15 -0
  90. package/dist/src/__tests__/data/blocks/slot-jsx.raw.d.ts +5 -0
  91. package/dist/src/__tests__/data/blocks/slot-jsx.raw.jsx +12 -0
  92. package/dist/src/__tests__/data/blocks/stamped-io.raw.d.ts +1 -1
  93. package/dist/src/__tests__/data/blocks/stamped-io.raw.jsx +4 -5
  94. package/dist/src/__tests__/data/blocks/submit-button.raw.d.ts +1 -1
  95. package/dist/src/__tests__/data/blocks/text.raw.d.ts +1 -1
  96. package/dist/src/__tests__/data/blocks/text.raw.jsx +3 -1
  97. package/dist/src/__tests__/data/blocks/textarea.raw.d.ts +1 -1
  98. package/dist/src/__tests__/data/blocks/video.raw.d.ts +1 -1
  99. package/dist/src/__tests__/data/blocks/video.raw.jsx +1 -1
  100. package/dist/src/__tests__/data/context/component-with-context.lite.d.ts +3 -1
  101. package/dist/src/__tests__/data/context/component-with-context.lite.jsx +7 -2
  102. package/dist/src/__tests__/data/default-props/default-props.raw.d.ts +7 -0
  103. package/dist/src/__tests__/data/default-props/default-props.raw.jsx +23 -0
  104. package/dist/src/__tests__/data/jsx-json.spec.d.ts +2 -0
  105. package/dist/src/__tests__/data/jsx-json.spec.js +10226 -0
  106. package/dist/src/__tests__/data/nested-styles.lite.d.ts +1 -0
  107. package/dist/src/__tests__/data/nested-styles.lite.jsx +20 -0
  108. package/dist/src/__tests__/data/show/nested-show.raw.d.ts +6 -0
  109. package/dist/src/__tests__/data/show/nested-show.raw.jsx +11 -0
  110. package/dist/src/__tests__/data/show/show-with-for.raw.d.ts +6 -0
  111. package/dist/src/__tests__/data/show/show-with-for.raw.jsx +9 -0
  112. package/dist/src/__tests__/data/styles/class-and-className.raw.d.ts +1 -0
  113. package/dist/src/__tests__/data/styles/class-and-className.raw.jsx +10 -0
  114. package/dist/src/__tests__/data/styles/class.raw.d.ts +1 -0
  115. package/dist/src/__tests__/data/styles/class.raw.jsx +10 -0
  116. package/dist/src/__tests__/data/styles/className.raw.d.ts +1 -0
  117. package/dist/src/__tests__/data/styles/className.raw.jsx +10 -0
  118. package/dist/src/__tests__/data/styles/classState.raw.d.ts +1 -0
  119. package/dist/src/__tests__/data/styles/classState.raw.jsx +13 -0
  120. package/dist/src/__tests__/data/types/component-props-interface.raw.d.ts +6 -0
  121. package/dist/src/__tests__/data/types/component-props-interface.raw.jsx +6 -0
  122. package/dist/src/__tests__/data/types/component-props-type.raw.d.ts +6 -0
  123. package/dist/src/__tests__/data/types/component-props-type.raw.jsx +6 -0
  124. package/dist/src/__tests__/data/types/component-with-default-values-types.raw.d.ts +5 -0
  125. package/dist/src/__tests__/data/types/component-with-default-values-types.raw.jsx +9 -0
  126. package/dist/src/__tests__/data/types/foo-type.d.ts +1 -0
  127. package/dist/src/{jsx-types.js → __tests__/data/types/foo-type.js} +0 -0
  128. package/dist/src/__tests__/data/types/preserve-typing.raw.d.ts +8 -0
  129. package/dist/src/__tests__/data/types/preserve-typing.raw.jsx +6 -0
  130. package/dist/src/__tests__/data/types/type-dependency.raw.d.ts +7 -0
  131. package/dist/src/__tests__/data/types/type-dependency.raw.jsx +6 -0
  132. package/dist/src/__tests__/data/types/type-export.lite.d.ts +3 -0
  133. package/dist/src/__tests__/data/types/type-export.lite.jsx +6 -0
  134. package/dist/src/__tests__/hash-code.test.d.ts +1 -0
  135. package/dist/src/__tests__/hash-code.test.js +11 -0
  136. package/dist/src/__tests__/html.test.js +2 -13
  137. package/dist/src/__tests__/liquid.test.js +2 -103
  138. package/dist/src/__tests__/lit.test.d.ts +1 -0
  139. package/dist/src/__tests__/lit.test.js +7 -0
  140. package/dist/src/__tests__/marko.test.d.ts +1 -0
  141. package/dist/src/__tests__/marko.test.js +14 -0
  142. package/dist/src/__tests__/parse-jsx.test.js +28 -0
  143. package/dist/src/__tests__/qwik/convert-method-to-function.test.d.ts +1 -0
  144. package/dist/src/__tests__/qwik/convert-method-to-function.test.js +37 -0
  145. package/dist/src/__tests__/qwik/src-generator.test.d.ts +1 -0
  146. package/dist/src/__tests__/qwik/src-generator.test.js +65 -0
  147. package/dist/src/__tests__/qwik.directive.test.js +1 -0
  148. package/dist/src/__tests__/qwik.test.js +54 -23
  149. package/dist/src/__tests__/react-native.test.js +3 -136
  150. package/dist/src/__tests__/react.test.js +9 -136
  151. package/dist/src/__tests__/shared.d.ts +3 -0
  152. package/dist/src/__tests__/shared.js +308 -0
  153. package/dist/src/__tests__/solid.test.js +5 -97
  154. package/dist/src/__tests__/stencil.test.js +3 -98
  155. package/dist/src/__tests__/styles.test.d.ts +1 -0
  156. package/dist/src/__tests__/styles.test.js +23 -0
  157. package/dist/src/__tests__/svelte.test.js +2 -31
  158. package/dist/src/__tests__/vue.test.js +2 -134
  159. package/dist/src/__tests__/webcomponent.test.js +8 -5
  160. package/dist/src/constants/hooks.d.ts +7 -0
  161. package/dist/src/constants/hooks.js +10 -0
  162. package/dist/src/flow.d.ts +6 -0
  163. package/dist/src/flow.js +6 -2
  164. package/dist/src/generators/angular.d.ts +10 -2
  165. package/dist/src/generators/angular.js +245 -47
  166. package/dist/src/generators/builder.d.ts +2 -2
  167. package/dist/src/generators/builder.js +26 -29
  168. package/dist/src/generators/context/{react copy.d.ts → qwik.d.ts} +2 -2
  169. package/dist/src/generators/context/{react copy.js → qwik.js} +4 -5
  170. package/dist/src/generators/context/react.js +1 -1
  171. package/dist/src/generators/context/solid.js +1 -1
  172. package/dist/src/generators/context/svelte.d.ts +1 -1
  173. package/dist/src/generators/context/svelte.js +1 -1
  174. package/dist/src/generators/helpers/context.js +1 -2
  175. package/dist/src/generators/html.d.ts +1 -1
  176. package/dist/src/generators/html.js +365 -108
  177. package/dist/src/generators/liquid.d.ts +1 -1
  178. package/dist/src/generators/liquid.js +18 -25
  179. package/dist/src/generators/lit/collect-class-string.d.ts +2 -0
  180. package/dist/src/generators/lit/collect-class-string.js +43 -0
  181. package/dist/src/generators/lit/generate.d.ts +5 -0
  182. package/dist/src/generators/lit/generate.js +223 -0
  183. package/dist/src/generators/lit/index.d.ts +1 -0
  184. package/dist/src/generators/lit/index.js +17 -0
  185. package/dist/src/generators/marko/generate.d.ts +21 -0
  186. package/dist/src/generators/marko/generate.js +289 -0
  187. package/dist/src/generators/marko/index.d.ts +1 -0
  188. package/dist/src/generators/marko/index.js +17 -0
  189. package/dist/src/generators/mitosis.d.ts +1 -1
  190. package/dist/src/generators/mitosis.js +39 -34
  191. package/dist/src/generators/qwik/add-prevent-default.d.ts +7 -0
  192. package/dist/src/generators/qwik/add-prevent-default.js +32 -0
  193. package/dist/src/generators/qwik/component-generator.d.ts +4 -0
  194. package/dist/src/generators/qwik/component-generator.js +311 -0
  195. package/dist/src/generators/qwik/component.d.ts +1 -0
  196. package/dist/src/generators/qwik/component.js +68 -36
  197. package/dist/src/generators/qwik/convert-method-to-function.d.ts +1 -0
  198. package/dist/src/generators/qwik/convert-method-to-function.js +162 -0
  199. package/dist/src/generators/qwik/directives.js +43 -23
  200. package/dist/src/generators/qwik/handlers.js +6 -22
  201. package/dist/src/generators/qwik/index.d.ts +3 -1
  202. package/dist/src/generators/qwik/index.js +3 -1
  203. package/dist/src/generators/qwik/jsx.d.ts +12 -0
  204. package/dist/src/generators/qwik/jsx.js +81 -24
  205. package/dist/src/generators/qwik/src-generator.d.ts +21 -8
  206. package/dist/src/generators/qwik/src-generator.js +177 -43
  207. package/dist/src/generators/qwik/styles.js +3 -3
  208. package/dist/src/generators/react/generator.d.ts +6 -0
  209. package/dist/src/generators/react/generator.js +447 -0
  210. package/dist/src/generators/react/helpers.d.ts +2 -0
  211. package/dist/src/generators/react/helpers.js +14 -0
  212. package/dist/src/generators/react/index.d.ts +2 -0
  213. package/dist/src/generators/react/index.js +18 -0
  214. package/dist/src/generators/react/state.d.ts +9 -0
  215. package/dist/src/generators/react/state.js +109 -0
  216. package/dist/src/generators/react/types.d.ts +10 -0
  217. package/dist/src/generators/react/types.js +2 -0
  218. package/dist/src/generators/react-native.d.ts +2 -2
  219. package/dist/src/generators/react-native.js +8 -10
  220. package/dist/src/generators/react.d.ts +7 -3
  221. package/dist/src/generators/react.js +190 -92
  222. package/dist/src/generators/solid/index.d.ts +3 -0
  223. package/dist/src/generators/solid/index.js +345 -0
  224. package/dist/src/generators/solid/state.d.ts +19 -0
  225. package/dist/src/generators/solid/state.js +144 -0
  226. package/dist/src/generators/solid/types.d.ts +6 -0
  227. package/dist/src/generators/solid/types.js +2 -0
  228. package/dist/src/generators/solid.d.ts +3 -2
  229. package/dist/src/generators/solid.js +86 -50
  230. package/dist/src/generators/stencil/collect-class-string.d.ts +1 -1
  231. package/dist/src/generators/stencil/collect-class-string.js +10 -11
  232. package/dist/src/generators/stencil/generate.d.ts +1 -1
  233. package/dist/src/generators/stencil/generate.js +16 -31
  234. package/dist/src/generators/svelte.d.ts +2 -2
  235. package/dist/src/generators/svelte.js +160 -88
  236. package/dist/src/generators/swift-ui.d.ts +1 -1
  237. package/dist/src/generators/swift-ui.js +19 -20
  238. package/dist/src/generators/template.d.ts +1 -1
  239. package/dist/src/generators/template.js +11 -18
  240. package/dist/src/generators/vue.d.ts +17 -9
  241. package/dist/src/generators/vue.js +227 -106
  242. package/dist/src/helpers/babel-transform.js +8 -14
  243. package/dist/src/helpers/create-mitosis-component.d.ts +1 -1
  244. package/dist/src/helpers/create-mitosis-component.js +1 -1
  245. package/dist/src/helpers/create-mitosis-node.js +1 -1
  246. package/dist/src/helpers/fast-clone.js +1 -3
  247. package/dist/src/helpers/filter-empty-text-nodes.js +1 -2
  248. package/dist/src/helpers/get-bindings.d.ts +2 -0
  249. package/dist/src/helpers/get-bindings.js +18 -0
  250. package/dist/src/helpers/get-custom-imports.d.ts +15 -0
  251. package/dist/src/helpers/get-custom-imports.js +40 -0
  252. package/dist/src/helpers/get-prop-functions.d.ts +5 -0
  253. package/dist/src/helpers/get-prop-functions.js +29 -0
  254. package/dist/src/helpers/get-props-ref.d.ts +2 -0
  255. package/dist/src/helpers/get-props-ref.js +32 -0
  256. package/dist/src/helpers/get-refs.js +3 -2
  257. package/dist/src/helpers/get-state-object-string.d.ts +6 -4
  258. package/dist/src/helpers/get-state-object-string.js +37 -27
  259. package/dist/src/helpers/get-styles.js +4 -3
  260. package/dist/src/helpers/getters-to-functions.d.ts +1 -1
  261. package/dist/src/helpers/getters-to-functions.js +3 -2
  262. package/dist/src/helpers/handle-missing-state.js +1 -1
  263. package/dist/src/helpers/has-bindings-text.d.ts +2 -0
  264. package/dist/src/helpers/has-bindings-text.js +21 -0
  265. package/dist/src/helpers/has-stateful-dom.d.ts +2 -0
  266. package/dist/src/helpers/has-stateful-dom.js +21 -0
  267. package/dist/src/helpers/has.d.ts +9 -0
  268. package/dist/src/helpers/has.js +27 -0
  269. package/dist/src/helpers/is-children.js +3 -1
  270. package/dist/src/helpers/is-component.js +1 -3
  271. package/dist/src/helpers/is-html-attribute.d.ts +4 -0
  272. package/dist/src/helpers/is-html-attribute.js +380 -0
  273. package/dist/src/helpers/json.d.ts +3 -1
  274. package/dist/src/helpers/map-refs.js +39 -14
  275. package/dist/src/helpers/nullable.d.ts +3 -0
  276. package/dist/src/helpers/nullable.js +7 -0
  277. package/dist/src/helpers/parsers.js +1 -2
  278. package/dist/src/helpers/process-http-requests.js +1 -1
  279. package/dist/src/helpers/render-imports.d.ts +20 -2
  280. package/dist/src/helpers/render-imports.js +115 -54
  281. package/dist/src/helpers/render-imports.test.d.ts +1 -0
  282. package/dist/src/helpers/render-imports.test.js +33 -0
  283. package/dist/src/helpers/replace-idenifiers.js +5 -7
  284. package/dist/src/helpers/slots.d.ts +2 -0
  285. package/dist/src/helpers/slots.js +8 -0
  286. package/dist/src/helpers/state.d.ts +11 -0
  287. package/dist/src/helpers/state.js +43 -0
  288. package/dist/src/helpers/strip-state-and-props-refs.d.ts +6 -1
  289. package/dist/src/helpers/strip-state-and-props-refs.js +70 -15
  290. package/dist/src/helpers/styles/collect-css.d.ts +6 -0
  291. package/dist/src/helpers/styles/collect-css.js +87 -0
  292. package/dist/src/helpers/styles/collect-css.test.d.ts +1 -0
  293. package/dist/src/helpers/styles/collect-css.test.js +18 -0
  294. package/dist/src/helpers/styles/collect-styled-components.d.ts +2 -0
  295. package/dist/src/helpers/styles/collect-styled-components.js +61 -0
  296. package/dist/src/helpers/styles/helpers.d.ts +31 -0
  297. package/dist/src/helpers/styles/helpers.js +80 -0
  298. package/dist/src/helpers/typescript.d.ts +5 -0
  299. package/dist/src/helpers/typescript.js +2 -0
  300. package/dist/src/index.d.ts +12 -4
  301. package/dist/src/index.js +28 -8
  302. package/dist/src/modules/plugins.d.ts +1 -1
  303. package/dist/src/parsers/angular.js +22 -34
  304. package/dist/src/parsers/builder.d.ts +32 -29
  305. package/dist/src/parsers/builder.js +99 -85
  306. package/dist/src/parsers/jsx/ast.d.ts +3 -0
  307. package/dist/src/parsers/jsx/ast.js +74 -0
  308. package/dist/src/parsers/jsx/component-types.d.ts +6 -0
  309. package/dist/src/parsers/jsx/component-types.js +88 -0
  310. package/dist/src/parsers/jsx/context.d.ts +6 -0
  311. package/dist/src/parsers/jsx/context.js +68 -0
  312. package/dist/src/parsers/jsx/helpers.d.ts +3 -0
  313. package/dist/src/parsers/jsx/helpers.js +36 -0
  314. package/dist/src/parsers/jsx/index.d.ts +4 -0
  315. package/dist/src/parsers/jsx/index.js +25 -0
  316. package/dist/src/parsers/jsx/jsx.d.ts +10 -0
  317. package/dist/src/parsers/{jsx.js → jsx/jsx.js} +258 -330
  318. package/dist/src/parsers/jsx/metadata.d.ts +12 -0
  319. package/dist/src/parsers/jsx/metadata.js +70 -0
  320. package/dist/src/parsers/jsx/props.d.ts +2 -0
  321. package/dist/src/parsers/jsx/props.js +72 -0
  322. package/dist/src/parsers/jsx/state.d.ts +13 -0
  323. package/dist/src/parsers/jsx/state.js +161 -0
  324. package/dist/src/parsers/jsx/types.d.ts +11 -0
  325. package/dist/src/parsers/jsx/types.js +2 -0
  326. package/dist/src/parsers/liquid.js +51 -149
  327. package/dist/src/plugins/compile-away-builder-components.js +161 -116
  328. package/dist/src/symbols/symbol-processor.d.ts +2 -0
  329. package/dist/src/symbols/symbol-processor.js +58 -20
  330. package/dist/src/targets.d.ts +11 -6
  331. package/dist/src/targets.js +13 -1
  332. package/dist/src/types/config.d.ts +42 -13
  333. package/dist/src/types/json.d.ts +5 -2
  334. package/dist/src/types/mitosis-component.d.ts +40 -12
  335. package/dist/src/types/mitosis-node.d.ts +15 -9
  336. package/dist/src/types/transpiler.d.ts +14 -0
  337. package/dist/src/types/transpiler.js +2 -0
  338. package/dist/test/qwik/Accordion/low.jsx +45 -12
  339. package/dist/test/qwik/Accordion/med.jsx +2 -8
  340. package/dist/test/qwik/For/low.jsx +46 -27
  341. package/dist/test/qwik/For/med.jsx +2 -8
  342. package/dist/test/qwik/Image/high.js +1 -1
  343. package/dist/test/qwik/Image/med.js +24 -18
  344. package/dist/test/qwik/Image.slow/high.js +1 -1
  345. package/dist/test/qwik/Image.slow/med.js +24 -18
  346. package/dist/test/qwik/bindings/low.cjs +16 -4
  347. package/dist/test/qwik/bindings/med.cjs +1 -10
  348. package/dist/test/qwik/button/high.js +1 -1
  349. package/dist/test/qwik/button/low.js +18 -4
  350. package/dist/test/qwik/button/med.js +4 -10
  351. package/dist/test/qwik/component/bindings/low.jsx +72 -11
  352. package/dist/test/qwik/component/bindings/med.jsx +3 -49
  353. package/dist/test/qwik/component/component/inputs/high.cjsx +1 -1
  354. package/dist/test/qwik/component/component/inputs/med.cjsx +18 -15
  355. package/dist/test/qwik/for-loop.bindings/high.cjs +0 -0
  356. package/dist/test/qwik/for-loop.bindings/low.cjs +56 -0
  357. package/dist/test/qwik/for-loop.bindings/med.cjs +5 -0
  358. package/dist/test/qwik/hello_world/stylesheet/low.jsx +17 -3
  359. package/dist/test/qwik/hello_world/stylesheet/med.jsx +2 -8
  360. package/dist/test/qwik/mount/high.cjs +0 -0
  361. package/dist/test/qwik/mount/low.cjs +47 -0
  362. package/dist/test/qwik/mount/med.cjs +3 -0
  363. package/dist/test/qwik/page-with-symbol/low.js +17 -3
  364. package/dist/test/qwik/page-with-symbol/med.js +2 -8
  365. package/dist/test/qwik/show-hide/high.jsx +1 -1
  366. package/dist/test/qwik/show-hide/med.jsx +28 -21
  367. package/dist/test/qwik/svg/low.js +22 -5
  368. package/dist/test/qwik/svg/med.js +2 -8
  369. package/dist/test/qwik/todo/Todo.cjs/high.cjs +6 -10
  370. package/dist/test/qwik/todo/Todo.cjs/med.cjs +18 -15
  371. package/dist/test/qwik/todo/Todo.js/high.js +7 -10
  372. package/dist/test/qwik/todo/Todo.js/med.js +17 -15
  373. package/dist/test/qwik/todo/Todo.tsx/high.tsx +7 -10
  374. package/dist/test/qwik/todo/Todo.tsx/med.tsx +17 -15
  375. package/dist/test/qwik/todos/Todo.tsx/high.tsx +1 -1
  376. package/dist/test/qwik/todos/Todo.tsx/low.tsx +18 -13
  377. package/dist/test/qwik/todos/Todo.tsx/med.tsx +1 -6
  378. package/dist/tsconfig.build.tsbuildinfo +1 -1
  379. package/dist/tsconfig.tsbuildinfo +1 -1
  380. package/jsx-runtime.d.ts +2133 -0
  381. package/package.json +20 -8
  382. package/README.md +0 -239
  383. package/dist/src/__tests__/data/blocks/onUpdate.raw copy.d.ts +0 -1
  384. package/dist/src/__tests__/data/blocks/onUpdate.raw copy.jsx +0 -10
  385. package/dist/src/__tests__/data/blocks/slot.raw.d.ts +0 -5
  386. package/dist/src/__tests__/data/blocks/slot.raw.jsx +0 -6
  387. package/dist/src/__tests__/data/blocks/styles.raw.d.ts +0 -1
  388. package/dist/src/__tests__/data/blocks/styles.raw.jsx +0 -10
  389. package/dist/src/helpers/babel-transform copy.d.ts +0 -8
  390. package/dist/src/helpers/babel-transform copy.js +0 -138
  391. package/dist/src/helpers/collect-styles.d.ts +0 -35
  392. package/dist/src/helpers/collect-styles.js +0 -178
  393. package/dist/src/jsx-types.d.ts +0 -1171
  394. package/dist/src/parsers/jsx.d.ts +0 -20
@@ -0,0 +1,7 @@
1
+ import type { JSX } from '../../../../jsx-runtime';
2
+ declare type Props = {
3
+ [key: string]: string | JSX.Element;
4
+ slotTesting: JSX.Element;
5
+ };
6
+ export default function ClassNameCode(props: Props): JSX.Element;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var mitosis_1 = require("@builder.io/mitosis");
4
+ function ClassNameCode(props) {
5
+ var state = (0, mitosis_1.useStore)({
6
+ bindings: 'a binding',
7
+ });
8
+ return (<div>
9
+ {/*// @ts-ignore */}
10
+ <div className="no binding">Without Binding</div>
11
+ {/*// @ts-ignore */}
12
+ <div className={state.bindings}>With binding</div>
13
+ </div>);
14
+ }
15
+ exports.default = ClassNameCode;
@@ -8,5 +8,5 @@ export interface ColumnProps {
8
8
  stackColumnsAt?: 'tablet' | 'mobile' | 'never';
9
9
  reverseColumnsWhenStacked?: boolean;
10
10
  }
11
- export default function Column(props: ColumnProps): JSX.Element;
11
+ export default function Column(props: ColumnProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
12
12
  export {};
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var mitosis_1 = require("@builder.io/mitosis");
4
4
  function Column(props) {
5
- var state = (0, mitosis_1.useState)({
5
+ var state = (0, mitosis_1.useStore)({
6
6
  getColumns: function () {
7
7
  return props.columns || [];
8
8
  },
@@ -0,0 +1,7 @@
1
+ import type { JSX } from '../../../../jsx-runtime';
2
+ declare type Props = {
3
+ [key: string]: string | JSX.Element;
4
+ slotTesting: JSX.Element;
5
+ };
6
+ export default function ContentSlotCode(props: Props): JSX.Element;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var mitosis_1 = require("@builder.io/mitosis");
4
+ function ContentSlotCode(props) {
5
+ return (<div>
6
+ <mitosis_1.Slot name={props.slotTesting}/>
7
+ <div>
8
+ <hr />
9
+ </div>
10
+ <div>
11
+ <mitosis_1.Slot />
12
+ </div>
13
+ </div>);
14
+ }
15
+ exports.default = ContentSlotCode;
@@ -0,0 +1,6 @@
1
+ import type { JSX } from '../../../../jsx-runtime';
2
+ declare type Props = {
3
+ [key: string]: string | JSX.Element;
4
+ };
5
+ export default function ContentSlotJsxCode(props: Props): JSX.Element;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function ContentSlotJsxCode(props) {
4
+ return (<div>
5
+ {props.slotTesting}
6
+ <div>
7
+ <hr />
8
+ </div>
9
+ <div>{props.children}</div>
10
+ </div>);
11
+ }
12
+ exports.default = ContentSlotJsxCode;
@@ -2,4 +2,4 @@ export interface CustomCodeProps {
2
2
  code: string;
3
3
  replaceNodes?: boolean;
4
4
  }
5
- export default function CustomCode(props: CustomCodeProps): JSX.Element;
5
+ export default function CustomCode(props: CustomCodeProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var mitosis_1 = require("@builder.io/mitosis");
4
4
  function CustomCode(props) {
5
- var elem = (0, mitosis_1.useRef)();
6
- var state = (0, mitosis_1.useState)({
5
+ var elem = (0, mitosis_1.useRef)(null);
6
+ var state = (0, mitosis_1.useStore)({
7
7
  scriptsInserted: [],
8
8
  scriptsRun: [],
9
9
  findAndRunScripts: function () {
@@ -24,11 +24,7 @@ function CustomCode(props) {
24
24
  document.head.appendChild(newScript);
25
25
  }
26
26
  else if (!script.type ||
27
- [
28
- 'text/javascript',
29
- 'application/javascript',
30
- 'application/ecmascript',
31
- ].includes(script.type)) {
27
+ ['text/javascript', 'application/javascript', 'application/ecmascript'].includes(script.type)) {
32
28
  if (state.scriptsRun.includes(script.innerText)) {
33
29
  continue;
34
30
  }
@@ -1,4 +1,4 @@
1
1
  export interface EmbedProps {
2
2
  content: string;
3
3
  }
4
- export default function Embed(props: EmbedProps): JSX.Element;
4
+ export default function Embed(props: EmbedProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var mitosis_1 = require("@builder.io/mitosis");
4
4
  function Embed(props) {
5
- var elem = (0, mitosis_1.useRef)();
6
- var state = (0, mitosis_1.useState)({
5
+ var elem = (0, mitosis_1.useRef)(null);
6
+ var state = (0, mitosis_1.useStore)({
7
7
  scriptsInserted: [],
8
8
  scriptsRun: [],
9
9
  findAndRunScripts: function () {
@@ -24,11 +24,7 @@ function Embed(props) {
24
24
  document.head.appendChild(newScript);
25
25
  }
26
26
  else if (!script.type ||
27
- [
28
- 'text/javascript',
29
- 'application/javascript',
30
- 'application/ecmascript',
31
- ].includes(script.type)) {
27
+ ['text/javascript', 'application/javascript', 'application/ecmascript'].includes(script.type)) {
32
28
  if (state.scriptsRun.includes(script.innerText)) {
33
29
  continue;
34
30
  }
@@ -22,4 +22,4 @@ export interface FormProps {
22
22
  errorMessagePath?: string;
23
23
  }
24
24
  export declare type FormState = 'unsubmitted' | 'sending' | 'success' | 'error';
25
- export default function FormComponent(props: FormProps): JSX.Element;
25
+ export default function FormComponent(props: FormProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -44,13 +44,13 @@ var _fake_3 = require("@fake");
44
44
  var _fake_4 = require("@fake");
45
45
  function FormComponent(props) {
46
46
  var _a;
47
- var state = (0, mitosis_1.useState)({
48
- state: 'unsubmitted',
47
+ var state = (0, mitosis_1.useStore)({
48
+ formState: 'unsubmitted',
49
49
  // TODO: separate response and error?
50
50
  responseData: null,
51
51
  formErrorMessage: '',
52
52
  get submissionState() {
53
- return (sdk_1.Builder.isEditing && props.previewState) || state.state;
53
+ return (sdk_1.Builder.isEditing && props.previewState) || state.formState;
54
54
  },
55
55
  onSubmit: function (event) {
56
56
  var _this = this;
@@ -149,7 +149,7 @@ function FormComponent(props) {
149
149
  return;
150
150
  }
151
151
  }
152
- state.state = 'sending';
152
+ state.formState = 'sending';
153
153
  var formUrl = "".concat(sdk_1.builder.env === 'dev' ? 'http://localhost:5000' : 'https://builder.io', "/api/v1/form-submit?apiKey=").concat(sdk_1.builder.apiKey, "&to=").concat(btoa(props.sendSubmissionsToEmail || ''), "&name=").concat(encodeURIComponent(props.name || ''));
154
154
  fetch(props.sendSubmissionsTo === 'email'
155
155
  ? formUrl
@@ -185,7 +185,7 @@ function FormComponent(props) {
185
185
  }
186
186
  }
187
187
  state.responseData = body;
188
- state.state = res.ok ? 'success' : 'error';
188
+ state.formState = res.ok ? 'success' : 'error';
189
189
  if (res.ok) {
190
190
  submitSuccessEvent = new CustomEvent('submit:success', {
191
191
  detail: {
@@ -237,16 +237,16 @@ function FormComponent(props) {
237
237
  }
238
238
  }
239
239
  state.responseData = err;
240
- state.state = 'error';
240
+ state.formState = 'error';
241
241
  });
242
242
  }
243
243
  },
244
244
  });
245
- var formRef = (0, mitosis_1.useRef)();
245
+ var formRef = (0, mitosis_1.useRef)(null);
246
246
  return (<form validate={props.validate} ref={formRef} action={!props.sendWithJs && props.action} method={props.method} name={props.name} onSubmit={function (event) { return state.onSubmit(event); }} {...props.attributes}>
247
247
  <mitosis_1.Show when={props.builderBlock && props.builderBlock.children}>
248
248
  <mitosis_1.For each={(_a = props.builderBlock) === null || _a === void 0 ? void 0 : _a.children}>
249
- {function (block, index) { return (<_fake_1.BuilderBlock key={block.id} block={block} index={index}/>); }}
249
+ {function (block, index) { return <_fake_1.BuilderBlock key={block.id} block={block} index={index}/>; }}
250
250
  </mitosis_1.For>
251
251
  </mitosis_1.Show>
252
252
 
@@ -1,5 +1,5 @@
1
1
  export interface ImageProps {
2
- class?: string;
2
+ _class?: string;
3
3
  image: string;
4
4
  sizes?: string;
5
5
  lazy?: boolean;
@@ -12,4 +12,4 @@ export interface ImageProps {
12
12
  aspectRatio?: number;
13
13
  children?: any;
14
14
  }
15
- export default function Image(props: ImageProps): JSX.Element;
15
+ export default function Image(props: ImageProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -3,22 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var mitosis_1 = require("@builder.io/mitosis");
4
4
  function Image(props) {
5
5
  var pictureRef = (0, mitosis_1.useRef)();
6
- var state = (0, mitosis_1.useState)({
6
+ var state = (0, mitosis_1.useStore)({
7
7
  scrollListener: null,
8
8
  imageLoaded: false,
9
- load: false,
10
9
  setLoaded: function () {
11
10
  state.imageLoaded = true;
12
11
  },
13
- isBrowser: function () {
14
- return (typeof window !== 'undefined' &&
15
- window.navigator.product != 'ReactNative');
16
- },
17
12
  useLazyLoading: function () {
18
13
  // TODO: Add more checks here, like testing for real web browsers
19
- return !!props.lazy && state.isBrowser();
14
+ return !!props.lazy && isBrowser();
20
15
  },
21
16
  });
17
+ function isBrowser() {
18
+ return typeof window !== 'undefined' && window.navigator.product != 'ReactNative';
19
+ }
20
+ var _a = (0, mitosis_1.useState)(false), load = _a[0], setLoad = _a[1];
22
21
  (0, mitosis_1.onMount)(function () {
23
22
  if (state.useLazyLoading()) {
24
23
  // throttled scroll capture listener
@@ -27,7 +26,7 @@ function Image(props) {
27
26
  var rect = pictureRef.getBoundingClientRect();
28
27
  var buffer = window.innerHeight / 2;
29
28
  if (rect.top < window.innerHeight + buffer) {
30
- state.load = true;
29
+ setLoad(true);
31
30
  state.scrollListener = null;
32
31
  window.removeEventListener('scroll', listener_1);
33
32
  }
@@ -48,13 +47,13 @@ function Image(props) {
48
47
  });
49
48
  return (<>
50
49
  <picture ref={pictureRef}>
51
- <mitosis_1.Show when={!state.useLazyLoading() || state.load}>
50
+ <mitosis_1.Show when={!state.useLazyLoading() || load}>
52
51
  <img alt={props.altText} aria-role={props.altText ? 'presentation' : undefined} css={{
53
52
  opacity: '1',
54
53
  transition: 'opacity 0.2s ease-in-out',
55
54
  objectFit: 'cover',
56
55
  objectPosition: 'center',
57
- }} class={'builder-image' + (props.class ? ' ' + props.class : '')} src={props.image} onLoad={function () { return state.setLoaded(); }}
56
+ }} class={'builder-image' + (props._class ? ' ' + props._class : '')} src={props.image} onLoad={function () { return state.setLoaded(); }}
58
57
  // TODO: memoize on image on client
59
58
  srcset={props.srcset} sizes={props.sizes}/>
60
59
  </mitosis_1.Show>
@@ -0,0 +1 @@
1
+ export default function ImgStateComponent(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var mitosis_1 = require("@builder.io/mitosis");
4
+ function ImgStateComponent() {
5
+ var state = (0, mitosis_1.useStore)({
6
+ canShow: true,
7
+ images: ['http://example.com/qwik.png'],
8
+ });
9
+ return (<div>
10
+ <mitosis_1.For each={state.images}>
11
+ {function (item, itemIndex) { return (<>
12
+ <img class={'custom-class'} src={item} key={itemIndex}/>
13
+ </>); }}
14
+ </mitosis_1.For>
15
+ </div>);
16
+ }
17
+ exports.default = ImgStateComponent;
@@ -6,4 +6,4 @@ export interface ImgProps {
6
6
  backgroundSize?: 'cover' | 'contain';
7
7
  backgroundPosition?: 'center' | 'top' | 'left' | 'right' | 'bottom' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
8
8
  }
9
- export default function ImgComponent(props: ImgProps): JSX.Element;
9
+ export default function ImgComponent(props: ImgProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -8,4 +8,4 @@ export interface FormInputProps {
8
8
  defaultValue?: string;
9
9
  required?: boolean;
10
10
  }
11
- export default function FormInputComponent(props: FormInputProps): JSX.Element;
11
+ export default function FormInputComponent(props: FormInputProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  require("@builder.io/mitosis");
4
4
  var sdk_1 = require("@builder.io/sdk");
5
5
  function FormInputComponent(props) {
6
- return (<input {...props.attributes} key={sdk_1.Builder.isEditing && props.defaultValue
7
- ? props.defaultValue
8
- : 'default-key'} placeholder={props.placeholder} type={props.type} name={props.name} value={props.value} defaultValue={props.defaultValue} required={props.required}/>);
6
+ return (<input {...props.attributes} key={sdk_1.Builder.isEditing && props.defaultValue ? props.defaultValue : 'default-key'} placeholder={props.placeholder} type={props.type} name={props.name} value={props.value} defaultValue={props.defaultValue} required={props.required}/>);
9
7
  }
10
8
  exports.default = FormInputComponent;
@@ -1 +1 @@
1
- export default function MultipleOnUpdate(): JSX.Element;
1
+ export default function MultipleOnUpdate(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export default function MultipleOnUpdateWithDeps(): JSX.Element;
1
+ export default function MultipleOnUpdateWithDeps(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var mitosis_1 = require("@builder.io/mitosis");
4
4
  function MultipleOnUpdateWithDeps() {
5
- var state = (0, mitosis_1.useState)({
5
+ var state = (0, mitosis_1.useStore)({
6
6
  a: 'a',
7
7
  b: 'b',
8
8
  c: 'c',
@@ -10,9 +10,15 @@ function MultipleOnUpdateWithDeps() {
10
10
  });
11
11
  (0, mitosis_1.onUpdate)(function () {
12
12
  console.log('Runs when a or b changes', state.a, state.b);
13
+ if (state.a === 'a') {
14
+ state.a = 'b';
15
+ }
13
16
  }, [state.a, state.b]);
14
17
  (0, mitosis_1.onUpdate)(function () {
15
18
  console.log('Runs when c or d changes', state.c, state.d);
19
+ if (state.a === 'a') {
20
+ state.a = 'b';
21
+ }
16
22
  }, [state.c, state.d]);
17
23
  return <div />;
18
24
  }
@@ -0,0 +1 @@
1
+ export default function OnInit(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var mitosis_1 = require("@builder.io/mitosis");
4
+ function OnInit() {
5
+ (0, mitosis_1.onInit)(function () {
6
+ console.log('onInit');
7
+ });
8
+ (0, mitosis_1.onMount)(function () {
9
+ console.log('onMount');
10
+ });
11
+ return <div />;
12
+ }
13
+ exports.default = OnInit;
@@ -0,0 +1,8 @@
1
+ declare type Props = {
2
+ name: string;
3
+ };
4
+ export declare const defaultValues: {
5
+ name: string;
6
+ };
7
+ export default function OnInit(props: Props): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultValues = void 0;
4
+ var mitosis_1 = require("@builder.io/mitosis");
5
+ exports.defaultValues = {
6
+ name: 'PatrickJS',
7
+ };
8
+ function OnInit(props) {
9
+ var state = (0, mitosis_1.useStore)({
10
+ // name: props.name
11
+ // name: defaultValues.name || props.name,
12
+ name: '',
13
+ });
14
+ (0, mitosis_1.onInit)(function () {
15
+ state.name = exports.defaultValues.name || props.name;
16
+ console.log('set defaults with props');
17
+ });
18
+ return <div>Default name defined by parent {state.name}</div>;
19
+ }
20
+ exports.default = OnInit;
@@ -1 +1 @@
1
- export default function Comp(): JSX.Element;
1
+ export default function Comp(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export default function OnUpdate(): JSX.Element;
1
+ export default function OnUpdate(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export default function OnUpdateWithDeps(): JSX.Element;
1
+ export default function OnUpdateWithDeps(): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var mitosis_1 = require("@builder.io/mitosis");
4
4
  function OnUpdateWithDeps() {
5
- var state = (0, mitosis_1.useState)({
5
+ var state = (0, mitosis_1.useStore)({
6
6
  a: 'a',
7
7
  b: 'b',
8
8
  });
@@ -2,4 +2,4 @@ export interface RawTextProps {
2
2
  attributes?: any;
3
3
  text?: string;
4
4
  }
5
- export default function RawText(props: RawTextProps): JSX.Element;
5
+ export default function RawText(props: RawTextProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  export default function RenderStyles(props: {
2
2
  foo: string;
3
- }): JSX.Element;
3
+ }): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface SectionProps {
2
+ maxWidth?: number;
3
+ attributes?: any;
4
+ children?: any;
5
+ }
6
+ export default function SectionStateComponent(props: SectionProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var mitosis_1 = require("@builder.io/mitosis");
4
+ function SectionStateComponent(props) {
5
+ var state = (0, mitosis_1.useStore)({
6
+ max: 42,
7
+ items: [42],
8
+ });
9
+ return (<mitosis_1.Show when={state.max}>
10
+ <mitosis_1.For each={state.items}>
11
+ {function (item) { return (<section {...props.attributes} style={{ maxWidth: item + state.max }}>
12
+ {props.children}
13
+ </section>); }}
14
+ </mitosis_1.For>
15
+ </mitosis_1.Show>);
16
+ }
17
+ exports.default = SectionStateComponent;
@@ -4,4 +4,4 @@ export interface SectionProps {
4
4
  attributes?: any;
5
5
  children?: any;
6
6
  }
7
- export default function SectionComponent(props: SectionProps): JSX.Element;
7
+ export default function SectionComponent(props: SectionProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -8,4 +8,4 @@ export interface FormSelectProps {
8
8
  value?: string;
9
9
  defaultValue?: string;
10
10
  }
11
- export default function SelectComponent(props: FormSelectProps): JSX.Element;
11
+ export default function SelectComponent(props: FormSelectProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -3,9 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var mitosis_1 = require("@builder.io/mitosis");
4
4
  var sdk_1 = require("@builder.io/sdk");
5
5
  function SelectComponent(props) {
6
- return (<select {...props.attributes} value={props.value} key={sdk_1.Builder.isEditing && props.defaultValue
7
- ? props.defaultValue
8
- : 'default-key'} defaultValue={props.defaultValue} name={props.name}>
6
+ return (<select {...props.attributes} value={props.value} key={sdk_1.Builder.isEditing && props.defaultValue ? props.defaultValue : 'default-key'} defaultValue={props.defaultValue} name={props.name}>
9
7
  <mitosis_1.For each={props.options}>
10
8
  {function (option, index) { return (<option value={option.value} data-index={index}>
11
9
  {option.name || option.value}
@@ -1 +1 @@
1
- export default function MyComponent(props: any): JSX.Element;
1
+ export default function MyComponent(props: any): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export default function MyComponent(props: any): JSX.Element;
1
+ export default function MyComponent(props: any): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
@@ -2,5 +2,5 @@ declare type SmileReviewsProps = {
2
2
  productId: string;
3
3
  apiKey: string;
4
4
  };
5
- export default function SmileReviews(props: SmileReviewsProps): JSX.Element;
5
+ export default function SmileReviews(props: SmileReviewsProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var mitosis_1 = require("@builder.io/mitosis");
4
4
  (0, mitosis_1.useMetadata)({ isAttachedToShadowDom: true });
5
5
  function SmileReviews(props) {
6
- var state = (0, mitosis_1.useState)({
6
+ var state = (0, mitosis_1.useStore)({
7
7
  reviews: [],
8
8
  name: 'test',
9
9
  showReviewPrompt: false,
@@ -17,9 +17,7 @@ function SmileReviews(props) {
17
17
  });
18
18
  });
19
19
  return (<div data-user={state.name}>
20
- <button onClick={function () { return (state.showReviewPrompt = true); }}>
21
- Write a review
22
- </button>
20
+ <button onClick={function () { return (state.showReviewPrompt = true); }}>Write a review</button>
23
21
  <mitosis_1.Show when={state.showReviewPrompt}>
24
22
  <input placeholder="Email"/>
25
23
 
@@ -0,0 +1,5 @@
1
+ declare type Props = {
2
+ [key: string]: string;
3
+ };
4
+ export default function SlotCode(props: Props): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var mitosis_1 = require("@builder.io/mitosis");
7
+ var content_slot_jsx_raw_1 = __importDefault(require("./content-slot-jsx.raw"));
8
+ function SlotCode(props) {
9
+ return (<div>
10
+ <content_slot_jsx_raw_1.default>
11
+ <mitosis_1.Slot testing={<div>Hello</div>}></mitosis_1.Slot>
12
+ </content_slot_jsx_raw_1.default>
13
+ </div>);
14
+ }
15
+ exports.default = SlotCode;
@@ -0,0 +1,5 @@
1
+ declare type Props = {
2
+ [key: string]: string;
3
+ };
4
+ export default function SlotCode(props: Props): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var content_slot_jsx_raw_1 = __importDefault(require("./content-slot-jsx.raw"));
7
+ function SlotCode(props) {
8
+ return (<div>
9
+ <content_slot_jsx_raw_1.default slotTesting={<div>Hello</div>}/>
10
+ </div>);
11
+ }
12
+ exports.default = SlotCode;
@@ -2,5 +2,5 @@ declare type SmileReviewsProps = {
2
2
  productId: string;
3
3
  apiKey: string;
4
4
  };
5
- export default function SmileReviews(props: SmileReviewsProps): JSX.Element;
5
+ export default function SmileReviews(props: SmileReviewsProps): import("@builder.io/mitosis/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -4,7 +4,7 @@ var mitosis_1 = require("@builder.io/mitosis");
4
4
  var lodash_1 = require("lodash");
5
5
  var lodash_2 = require("lodash");
6
6
  function SmileReviews(props) {
7
- var state = (0, mitosis_1.useState)({
7
+ var state = (0, mitosis_1.useStore)({
8
8
  reviews: [],
9
9
  name: 'test',
10
10
  showReviewPrompt: false,
@@ -24,16 +24,15 @@ function SmileReviews(props) {
24
24
  });
25
25
  });
26
26
  return (<div data-user={state.name}>
27
- <button onClick={function () { return (state.showReviewPrompt = true); }}>
28
- Write a review
29
- </button>
27
+ <button onClick={function () { return (state.showReviewPrompt = true); }}>Write a review</button>
30
28
  <mitosis_1.Show when={state.showReviewPrompt}>
31
29
  <input placeholder="Email"/>
32
30
 
33
31
  <input css={{ display: 'block' }} placeholder="Title"/>
34
32
 
35
33
  <textarea css={{ display: 'block' }} placeholder="How was your experience?"/>
36
- <button css={{ display: 'block' }} onClick={function () {
34
+ <button css={{ display: 'block' }} onClick={function (event) {
35
+ event.preventDefault();
37
36
  state.showReviewPrompt = false;
38
37
  }}>
39
38
  Submit