@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
@@ -88,7 +88,9 @@ exports.components = {
88
88
  }
89
89
  var omitFields = ['link', 'openInNewTab', 'text'];
90
90
  var hasLink = node.properties.link || node.bindings.link;
91
- return (0, create_mitosis_node_1.createMitosisNode)(__assign(__assign({}, node), { name: hasLink ? 'a' : node.properties.$tagName || 'span', properties: __assign(__assign({}, (0, lodash_1.omit)(node.properties, omitFields)), properties), bindings: __assign(__assign({}, (0, lodash_1.omit)(node.bindings, omitFields)), bindings) }));
91
+ return (0, create_mitosis_node_1.createMitosisNode)(__assign(__assign({}, node), {
92
+ // TODO: use 'button' tag for no link, and add `all: unset` to CSS string only then
93
+ name: hasLink ? 'a' : node.properties.$tagName || 'span', properties: __assign(__assign({}, (0, lodash_1.omit)(node.properties, omitFields)), properties), bindings: __assign(__assign({}, (0, lodash_1.omit)(node.bindings, omitFields)), bindings) }));
92
94
  },
93
95
  Embed: function (node, context, components) {
94
96
  return wrapOutput(node, (0, create_mitosis_node_1.createMitosisNode)({
@@ -99,7 +101,8 @@ exports.components = {
99
101
  }), components);
100
102
  },
101
103
  BuilderAccordion: function (node, context, components) {
102
- var itemsJSON = node.bindings.items || '[]';
104
+ var _a;
105
+ var itemsJSON = ((_a = node.bindings.items) === null || _a === void 0 ? void 0 : _a.code) || '[]';
103
106
  var accordionItems = JSON5.parse(itemsJSON);
104
107
  var children = accordionItems.map(function (accordionItem) {
105
108
  var titleChildren = accordionItem.title.map(function (element) {
@@ -169,36 +172,41 @@ exports.components = {
169
172
  }), components);
170
173
  },
171
174
  CoreSection: function (node, context, components) {
175
+ var _a, _b;
172
176
  return wrapOutput(node, (0, create_mitosis_node_1.createMitosisNode)({
173
177
  name: 'section',
174
- properties: __assign(__assign(__assign({}, node.properties), { $name: 'section' }), (node.bindings.lazyLoad === 'true' && {
178
+ properties: __assign(__assign(__assign({}, node.properties), { $name: 'section' }), (((_a = node.bindings.lazyLoad) === null || _a === void 0 ? void 0 : _a.code) === 'true' && {
175
179
  lazyLoad: 'true',
176
180
  })),
177
181
  bindings: {
178
- css: JSON.stringify({
179
- width: '100%',
180
- alignSelf: 'stretch',
181
- flexGrow: '1',
182
- boxSizing: 'border-box',
183
- maxWidth: "".concat((node.bindings.maxWidth && Number(node.bindings.maxWidth)) || 1200, "px"),
184
- display: 'flex',
185
- flexDirection: 'column',
186
- alignItems: 'stretch',
187
- marginLeft: 'auto',
188
- marginRight: 'auto',
189
- }),
182
+ css: {
183
+ code: JSON.stringify({
184
+ width: '100%',
185
+ alignSelf: 'stretch',
186
+ flexGrow: '1',
187
+ boxSizing: 'border-box',
188
+ maxWidth: "".concat((((_b = node.bindings.maxWidth) === null || _b === void 0 ? void 0 : _b.code) && Number(node.bindings.maxWidth.code)) || 1200, "px"),
189
+ display: 'flex',
190
+ flexDirection: 'column',
191
+ alignItems: 'stretch',
192
+ marginLeft: 'auto',
193
+ marginRight: 'auto',
194
+ }),
195
+ },
190
196
  },
191
197
  children: node.children,
192
198
  }), components);
193
199
  },
194
200
  Columns: function (node, context, components) {
195
201
  var _a;
196
- var columns = node.children.filter(filter_empty_text_nodes_1.filterEmptyTextNodes).map(function (item) { return ({
197
- width: parseFloat(item.properties.width || item.bindings.width || '0') || 0,
198
- children: item.children,
199
- }); });
200
- var gutterSize = (node.properties.getterSize && parseFloat(node.properties.getterSize)) ||
201
- 20;
202
+ var columns = node.children.filter(filter_empty_text_nodes_1.filterEmptyTextNodes).map(function (item) {
203
+ var _a;
204
+ return ({
205
+ width: parseFloat(item.properties.width || ((_a = item.bindings.width) === null || _a === void 0 ? void 0 : _a.code) || '0') || 0,
206
+ children: item.children,
207
+ });
208
+ });
209
+ var gutterSize = (node.properties.getterSize && parseFloat(node.properties.getterSize)) || 20;
202
210
  function getWidth(index) {
203
211
  return (columns[index] && columns[index].width) || 100 / columns.length;
204
212
  }
@@ -213,16 +221,18 @@ exports.components = {
213
221
  class: 'builder-columns',
214
222
  },
215
223
  bindings: {
216
- css: JSON.stringify(__assign({ display: 'flex' }, (properties.stackColumnsAt === 'never'
217
- ? {}
218
- : (_a = {},
219
- _a["@media (max-width: ".concat(properties.stackColumnsAt !== 'tablet' ? 639 : 999, "px)")] = {
220
- flexDirection: properties.reverseColumnsWhenStacked === 'true'
221
- ? 'column-reverse'
222
- : 'column',
223
- alignItems: 'stretch',
224
- },
225
- _a)))),
224
+ css: {
225
+ code: JSON.stringify(__assign({ display: 'flex' }, (properties.stackColumnsAt === 'never'
226
+ ? {}
227
+ : (_a = {},
228
+ _a["@media (max-width: ".concat(properties.stackColumnsAt !== 'tablet' ? 639 : 999, "px)")] = {
229
+ flexDirection: properties.reverseColumnsWhenStacked === 'true'
230
+ ? 'column-reverse'
231
+ : 'column',
232
+ alignItems: 'stretch',
233
+ },
234
+ _a)))),
235
+ },
226
236
  },
227
237
  children: columns.map(function (col, index) {
228
238
  var _a;
@@ -233,14 +243,16 @@ exports.components = {
233
243
  class: 'builder-column',
234
244
  },
235
245
  bindings: {
236
- css: JSON.stringify(__assign({ display: 'flex', flexDirection: 'column', alignItems: 'stretch', lineHeight: 'normal', width: "".concat(getColumnWidth(index)), marginLeft: "".concat(index === 0 ? 0 : gutterSize, "px") }, (properties.stackColumnsAt === 'never'
237
- ? {}
238
- : (_a = {},
239
- _a["@media (max-width: ".concat(properties.stackColumnsAt !== 'tablet' ? 639 : 999, "px)")] = {
240
- width: '100%',
241
- marginLeft: 0,
242
- },
243
- _a)))),
246
+ css: {
247
+ code: JSON.stringify(__assign({ display: 'flex', flexDirection: 'column', alignItems: 'stretch', lineHeight: 'normal', width: "".concat(getColumnWidth(index)), marginLeft: "".concat(index === 0 ? 0 : gutterSize, "px") }, (properties.stackColumnsAt === 'never'
248
+ ? {}
249
+ : (_a = {},
250
+ _a["@media (max-width: ".concat(properties.stackColumnsAt !== 'tablet' ? 639 : 999, "px)")] = {
251
+ width: '100%',
252
+ marginLeft: 0,
253
+ },
254
+ _a)))),
255
+ },
244
256
  },
245
257
  children: col.children,
246
258
  });
@@ -248,17 +260,18 @@ exports.components = {
248
260
  }), components);
249
261
  },
250
262
  Image: function (node, context, components) {
251
- var _a = node.properties, backgroundSize = _a.backgroundSize, backgroundPosition = _a.backgroundPosition;
263
+ var _a, _b, _c, _d, _e, _f, _g;
264
+ var _h = node.properties, backgroundSize = _h.backgroundSize, backgroundPosition = _h.backgroundPosition;
252
265
  var srcset = node.properties.srcset;
253
- var aspectRatio = node.bindings.aspectRatio
254
- ? parseFloat(node.bindings.aspectRatio)
266
+ var aspectRatio = ((_a = node.bindings.aspectRatio) === null || _a === void 0 ? void 0 : _a.code)
267
+ ? parseFloat(node.bindings.aspectRatio.code)
255
268
  : null;
256
269
  if (typeof aspectRatio === 'number' && isNaN(aspectRatio)) {
257
270
  aspectRatio = null;
258
271
  }
259
272
  var image = node.properties.image;
260
273
  var srcSet = srcset || generateBuilderIoSrcSet(image);
261
- var source = node.bindings.noWebp !== 'true' &&
274
+ var source = ((_b = node.bindings.noWebp) === null || _b === void 0 ? void 0 : _b.code) !== 'true' &&
262
275
  (0, create_mitosis_node_1.createMitosisNode)({
263
276
  name: 'source',
264
277
  properties: {
@@ -270,24 +283,25 @@ exports.components = {
270
283
  name: 'img',
271
284
  properties: noUndefined({
272
285
  $name: 'image',
273
- loading: node.properties.lazy ? 'lazy' : undefined,
286
+ loading: 'lazy',
274
287
  src: node.properties.image,
275
288
  sizes: node.properties.sizes,
276
289
  srcset: srcSet || null,
277
290
  }),
278
291
  bindings: noUndefined({
279
- loading: node.bindings.lazy ? '"lazy"' : undefined,
280
- src: node.bindings.image,
281
- sizes: node.bindings.sizes,
282
- css: JSON.stringify(__assign({ objectFit: backgroundSize || 'cover', objectPosition: backgroundPosition || 'cover' }, (aspectRatio
283
- ? {
284
- position: 'absolute',
285
- height: '100%',
286
- width: '100%',
287
- top: '0',
288
- left: '0',
289
- }
290
- : {}))),
292
+ src: ((_c = node.bindings.image) === null || _c === void 0 ? void 0 : _c.code) && { code: (_d = node.bindings.image) === null || _d === void 0 ? void 0 : _d.code },
293
+ sizes: ((_e = node.bindings.sizes) === null || _e === void 0 ? void 0 : _e.code) && { code: (_f = node.bindings.sizes) === null || _f === void 0 ? void 0 : _f.code },
294
+ css: {
295
+ code: JSON.stringify(__assign({ objectFit: backgroundSize || 'cover', objectPosition: backgroundPosition || 'cover' }, (aspectRatio
296
+ ? {
297
+ position: 'absolute',
298
+ height: '100%',
299
+ width: '100%',
300
+ top: '0',
301
+ left: '0',
302
+ }
303
+ : {}))),
304
+ },
291
305
  }),
292
306
  });
293
307
  var picture = (0, create_mitosis_node_1.createMitosisNode)({
@@ -302,12 +316,14 @@ exports.components = {
302
316
  class: 'builder-image-sizer',
303
317
  },
304
318
  bindings: {
305
- css: JSON.stringify({
306
- width: '100%',
307
- paddingTop: aspectRatio * 100 + '%',
308
- pointerEvents: 'none',
309
- fontSize: '0',
310
- }),
319
+ css: {
320
+ code: JSON.stringify({
321
+ width: '100%',
322
+ paddingTop: aspectRatio * 100 + '%',
323
+ pointerEvents: 'none',
324
+ fontSize: '0',
325
+ }),
326
+ },
311
327
  },
312
328
  });
313
329
  var children = node.children &&
@@ -318,16 +334,18 @@ exports.components = {
318
334
  $name: 'image-contents',
319
335
  },
320
336
  bindings: {
321
- css: JSON.stringify({
322
- display: 'flex',
323
- flexDirection: 'column',
324
- alignItems: 'stretch',
325
- position: 'absolute',
326
- top: '0',
327
- left: '0',
328
- width: '100%',
329
- height: '100%',
330
- }),
337
+ css: {
338
+ code: JSON.stringify({
339
+ display: 'flex',
340
+ flexDirection: 'column',
341
+ alignItems: 'stretch',
342
+ position: 'absolute',
343
+ top: '0',
344
+ left: '0',
345
+ width: '100%',
346
+ height: '100%',
347
+ }),
348
+ },
331
349
  },
332
350
  children: node.children,
333
351
  });
@@ -335,16 +353,18 @@ exports.components = {
335
353
  imgSizer && imageNodes.push(imgSizer);
336
354
  children && imageNodes.push(children);
337
355
  var href = node.properties.href;
338
- var hrefBinding = node.bindings.href;
356
+ var hrefBinding = (_g = node.bindings.href) === null || _g === void 0 ? void 0 : _g.code;
339
357
  if (href || hrefBinding) {
340
358
  var aHref = (0, create_mitosis_node_1.createMitosisNode)({
341
359
  name: 'a',
342
360
  properties: {
343
361
  href: href,
344
362
  },
345
- bindings: {
346
- href: hrefBinding,
347
- },
363
+ bindings: hrefBinding
364
+ ? {
365
+ href: { code: hrefBinding },
366
+ }
367
+ : undefined,
348
368
  children: imageNodes,
349
369
  });
350
370
  return wrapOutput(node, aHref, components);
@@ -354,8 +374,9 @@ exports.components = {
354
374
  }
355
375
  },
356
376
  Video: function (node, context, components) {
357
- var aspectRatio = node.bindings.aspectRatio
358
- ? parseFloat(node.bindings.aspectRatio)
377
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
378
+ var aspectRatio = ((_a = node.bindings.aspectRatio) === null || _a === void 0 ? void 0 : _a.code)
379
+ ? parseFloat(node.bindings.aspectRatio.code)
359
380
  : null;
360
381
  if (typeof aspectRatio === 'number' && isNaN(aspectRatio)) {
361
382
  aspectRatio = null;
@@ -374,20 +395,32 @@ exports.components = {
374
395
  preload: node.properties.lazy ? 'none' : undefined,
375
396
  }),
376
397
  bindings: noUndefined({
377
- poster: node.bindings.posterImage,
378
- autoplay: node.bindings.autoPlay,
379
- muted: node.bindings.muted,
380
- controls: node.bindings.controls,
381
- playsinline: node.bindings.playsInline,
382
- loop: node.bindings.loop,
383
- css: JSON.stringify({
384
- width: '100%',
385
- height: '100%',
386
- objectFit: node.properties.fit,
387
- objectPosition: node.properties.position,
388
- borderRadius: '1',
389
- position: aspectRatio ? 'absolute' : '',
390
- }),
398
+ poster: ((_b = node.bindings.posterImage) === null || _b === void 0 ? void 0 : _b.code) && {
399
+ code: (_c = node.bindings.posterImage) === null || _c === void 0 ? void 0 : _c.code,
400
+ },
401
+ autoplay: ((_d = node.bindings.autoPlay) === null || _d === void 0 ? void 0 : _d.code) && {
402
+ code: (_e = node.bindings.autoPlay) === null || _e === void 0 ? void 0 : _e.code,
403
+ },
404
+ muted: ((_f = node.bindings.muted) === null || _f === void 0 ? void 0 : _f.code) && {
405
+ code: (_g = node.bindings.muted) === null || _g === void 0 ? void 0 : _g.code,
406
+ },
407
+ controls: ((_h = node.bindings.controls) === null || _h === void 0 ? void 0 : _h.code) && {
408
+ code: (_j = node.bindings.controls) === null || _j === void 0 ? void 0 : _j.code,
409
+ },
410
+ playsinline: ((_k = node.bindings.playsInline) === null || _k === void 0 ? void 0 : _k.code) && {
411
+ code: (_l = node.bindings.playsInline) === null || _l === void 0 ? void 0 : _l.code,
412
+ },
413
+ loop: ((_m = node.bindings.loop) === null || _m === void 0 ? void 0 : _m.code) && { code: (_o = node.bindings.loop) === null || _o === void 0 ? void 0 : _o.code },
414
+ css: {
415
+ code: JSON.stringify({
416
+ width: '100%',
417
+ height: '100%',
418
+ objectFit: node.properties.fit,
419
+ objectPosition: node.properties.position,
420
+ borderRadius: '1',
421
+ position: aspectRatio ? 'absolute' : '',
422
+ }),
423
+ },
391
424
  }),
392
425
  children: [
393
426
  (0, create_mitosis_node_1.createMitosisNode)({
@@ -396,9 +429,11 @@ exports.components = {
396
429
  type: 'video/mp4',
397
430
  src: node.properties.video,
398
431
  },
399
- bindings: {
400
- src: node.bindings.video,
401
- },
432
+ bindings: noUndefined({
433
+ src: ((_p = node.bindings.video) === null || _p === void 0 ? void 0 : _p.code) && {
434
+ code: (_q = node.bindings.video) === null || _q === void 0 ? void 0 : _q.code,
435
+ },
436
+ }),
402
437
  }),
403
438
  ],
404
439
  }));
@@ -409,12 +444,14 @@ exports.components = {
409
444
  $name: 'builder-video-sizer',
410
445
  },
411
446
  bindings: {
412
- css: JSON.stringify({
413
- width: '100%',
414
- paddingTop: aspectRatio * 100 + '%',
415
- pointerEvents: 'none',
416
- fontSize: '0',
417
- }),
447
+ css: {
448
+ code: JSON.stringify({
449
+ width: '100%',
450
+ paddingTop: aspectRatio * 100 + '%',
451
+ pointerEvents: 'none',
452
+ fontSize: '0',
453
+ }),
454
+ },
418
455
  },
419
456
  }));
420
457
  node.children &&
@@ -425,16 +462,18 @@ exports.components = {
425
462
  $name: 'image-contents',
426
463
  },
427
464
  bindings: {
428
- css: JSON.stringify({
429
- display: 'flex',
430
- flexDirection: 'column',
431
- alignItems: 'stretch',
432
- position: 'absolute',
433
- top: '0',
434
- left: '0',
435
- width: '100%',
436
- height: '100%',
437
- }),
465
+ css: {
466
+ code: JSON.stringify({
467
+ display: 'flex',
468
+ flexDirection: 'column',
469
+ alignItems: 'stretch',
470
+ position: 'absolute',
471
+ top: '0',
472
+ left: '0',
473
+ width: '100%',
474
+ height: '100%',
475
+ }),
476
+ },
438
477
  },
439
478
  children: node.children,
440
479
  }));
@@ -444,7 +483,7 @@ exports.components = {
444
483
  $name: 'video-container',
445
484
  },
446
485
  bindings: {
447
- css: JSON.stringify({ position: 'relative' }),
486
+ css: { code: JSON.stringify({ position: 'relative' }) },
448
487
  },
449
488
  children: videoContainerNodes,
450
489
  });
@@ -496,9 +535,7 @@ function generateBuilderIoSrcSet(image) {
496
535
  var isBuilderIo = !!(image || '').match(/builder\.io/);
497
536
  return isBuilderIo
498
537
  ? [100, 200, 400, 800, 1200, 1600, 2000]
499
- .map(function (size) {
500
- return "".concat(updateQueryParam(image, 'width', String(size)), " ").concat(size, "w");
501
- })
538
+ .map(function (size) { return "".concat(updateQueryParam(image, 'width', String(size)), " ").concat(size, "w"); })
502
539
  .concat([image])
503
540
  .join(', ')
504
541
  : '';
@@ -509,7 +546,15 @@ function noUndefined(obj) {
509
546
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
510
547
  var value = obj[key];
511
548
  if (value != null) {
512
- cleanObj[key] = value;
549
+ if (typeof value == 'object') {
550
+ var ret = noUndefined(value);
551
+ if (Object.keys(ret).length) {
552
+ cleanObj[key] = ret;
553
+ }
554
+ }
555
+ else {
556
+ cleanObj[key] = value;
557
+ }
513
558
  }
514
559
  }
515
560
  }
@@ -16,3 +16,5 @@ export declare function convertBuilderContentToSymbolHierarchy(content: BuilderC
16
16
  }): SymbolHierarchy;
17
17
  export declare function convertBuilderElementToMitosisComponent(element: BuilderElement): MitosisComponent | null;
18
18
  export declare function getJsxSymbolComponentName(id: string): string;
19
+ export declare function hashCodeAsString(obj: any): string;
20
+ export declare function hashCode(obj: any, hash?: number): number;
@@ -15,7 +15,7 @@ var __assign = (this && this.__assign) || function () {
15
15
  return __assign.apply(this, arguments);
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.getJsxSymbolComponentName = exports.convertBuilderElementToMitosisComponent = exports.convertBuilderContentToSymbolHierarchy = exports.ensureAllSymbolsHaveIds = void 0;
18
+ exports.hashCode = exports.hashCodeAsString = exports.getJsxSymbolComponentName = exports.convertBuilderElementToMitosisComponent = exports.convertBuilderContentToSymbolHierarchy = exports.ensureAllSymbolsHaveIds = void 0;
19
19
  var traverse_1 = require("traverse");
20
20
  var builder_1 = require("../parsers/builder");
21
21
  var minify_1 = require("../generators/minify");
@@ -28,9 +28,7 @@ function ensureAllSymbolsHaveIds(content) {
28
28
  var ids = new Set();
29
29
  (0, traverse_1.forEach)(content, function (el) {
30
30
  var _a, _b, _c;
31
- if (this.key === 'jsCode' &&
32
- isString(el) &&
33
- el.endsWith('return _virtual_index')) {
31
+ if (this.key === 'jsCode' && isString(el) && el.endsWith('return _virtual_index')) {
34
32
  // Sometimes rollup adds a final `return _virtual_index` but that causes VM evaluation to fail.
35
33
  // Instead of a return on the last line, it needs a plain expression on the last line. Luckily
36
34
  // because the rollup compile behavior is consistent this works pretty reliably
@@ -63,7 +61,12 @@ exports.ensureAllSymbolsHaveIds = ensureAllSymbolsHaveIds;
63
61
  //TODO(misko): needs test
64
62
  function convertBuilderContentToSymbolHierarchy(content, _a) {
65
63
  var _b;
66
- var _c = _a === void 0 ? {} : _a, collectComponentStyles = _c.collectComponentStyles, collectComponentState = _c.collectComponentState;
64
+ var _c, _d;
65
+ var _e = _a === void 0 ? {} : _a, collectComponentStyles = _e.collectComponentStyles, collectComponentState = _e.collectComponentState;
66
+ if (collectComponentState && ((_c = content.data) === null || _c === void 0 ? void 0 : _c.state)) {
67
+ var state = (_d = content.data) === null || _d === void 0 ? void 0 : _d.state;
68
+ collectComponentState['ROOT_COMPONENT_STATE'] = state;
69
+ }
67
70
  var path = [-1, content.id];
68
71
  var hierarchy = (_b = {
69
72
  depthFirstSymbols: []
@@ -76,7 +79,7 @@ function convertBuilderContentToSymbolHierarchy(content, _a) {
76
79
  if (cssCode) {
77
80
  collectComponentStyles && collectComponentStyles.push((0, minify_1.minify)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", ""], ["", ""])), cssCode));
78
81
  }
79
- while (path[0 /* DEPTH */] >= this.path.length) {
82
+ while (path[0 /* Path.DEPTH */] >= this.path.length) {
80
83
  path.shift();
81
84
  path.shift();
82
85
  }
@@ -87,15 +90,15 @@ function convertBuilderContentToSymbolHierarchy(content, _a) {
87
90
  var props = symbol.data;
88
91
  var state = (_c = (_b = symbol.content) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.state;
89
92
  if (state) {
90
- var id = toHash(state);
93
+ var id = hashCodeAsString(state);
91
94
  props['serverStateId'] = id;
92
95
  collectComponentState[id] = state;
93
96
  }
94
97
  }
95
- if (path[0 /* DEPTH */] < this.path.length) {
98
+ if (path[0 /* Path.DEPTH */] < this.path.length) {
96
99
  var id = getIdFromSymbol(el);
97
100
  hierarchy[id] = [];
98
- addIfMissing(hierarchy[path[1 /* ID */]], id);
101
+ addIfMissing(hierarchy[path[1 /* Path.ID */]], id);
99
102
  path.unshift(this.path.length, id);
100
103
  }
101
104
  // TODO(misko): This should be `el.content` not `el`
@@ -154,19 +157,54 @@ function addIfMissing(array, value) {
154
157
  function isString(value) {
155
158
  return typeof value == 'string';
156
159
  }
157
- function toHash(obj) {
158
- return hashCode(JSON.stringify(obj));
160
+ function hashCodeAsString(obj) {
161
+ return Number(Math.abs(hashCode(obj))).toString(36);
159
162
  }
160
- function hashCode(text) {
161
- var hash = 0, i, chr;
162
- if (text.length === 0)
163
- return String(hash);
164
- for (i = 0; i < text.length; i++) {
165
- chr = text.charCodeAt(i);
166
- hash = (hash << 5) - hash + chr;
167
- hash |= 0; // Convert to 32bit integer
163
+ exports.hashCodeAsString = hashCodeAsString;
164
+ function hashCode(obj, hash) {
165
+ if (hash === void 0) { hash = 0; }
166
+ var value = 0;
167
+ switch (typeof obj) {
168
+ case 'number':
169
+ value = obj;
170
+ break;
171
+ case 'undefined':
172
+ value = Number.MIN_SAFE_INTEGER;
173
+ break;
174
+ case 'string':
175
+ for (var i = 0; i < obj.length; i++) {
176
+ hash = hashCodeApply(hash, obj.charCodeAt(i));
177
+ }
178
+ value = obj.length;
179
+ case 'boolean':
180
+ value = obj ? 1 : 0;
181
+ break;
182
+ case 'object':
183
+ if (obj === null) {
184
+ value = Number.MAX_SAFE_INTEGER;
185
+ }
186
+ else if (Array.isArray(obj)) {
187
+ for (var i = 0; i < obj.length; i++) {
188
+ hash = hashCode(obj[i], hash);
189
+ }
190
+ }
191
+ else {
192
+ for (var _i = 0, _a = Object.keys(obj).sort(); _i < _a.length; _i++) {
193
+ var key = _a[_i];
194
+ if (obj.hasOwnProperty(key)) {
195
+ hash = hashCode(obj[key], hash);
196
+ }
197
+ }
198
+ }
199
+ break;
168
200
  }
169
- return Number(Math.abs(hash)).toString(36);
201
+ return hashCodeApply(hash, value);
202
+ }
203
+ exports.hashCode = hashCode;
204
+ function hashCodeApply(hash, value) {
205
+ hash = (hash << 5) - hash + value;
206
+ hash |= 0; // Convert to 32bit integer
207
+ return hash;
170
208
  }
171
209
  function pad(value) {
172
210
  var padding = '000000';
@@ -2,7 +2,7 @@ export declare const targets: {
2
2
  angular: (options?: import("./generators/angular").ToAngularOptions) => import(".").Transpiler;
3
3
  builder: (options?: import("./generators/builder").ToBuilderOptions) => ({ component }: import(".").TranspilerArgs) => {
4
4
  data: {
5
- httpRequests: any;
5
+ httpRequests: import("./types/json")._JSON;
6
6
  jsCode: string;
7
7
  tsCode: string;
8
8
  blocks: import("@builder.io/sdk").BuilderElement[];
@@ -14,12 +14,17 @@ export declare const targets: {
14
14
  liquid: (options?: import("./generators/liquid").ToLiquidOptions) => import(".").Transpiler;
15
15
  react: (reactOptions?: import("./generators/react").ToReactOptions) => import(".").Transpiler;
16
16
  reactNative: (options?: import("./generators/react-native").ToReactNativeOptions) => import(".").Transpiler;
17
- solid: (options?: import("./generators/solid").ToSolidOptions) => import(".").Transpiler;
18
- svelte: (options?: import("./generators/svelte").ToSvelteOptions) => import(".").Transpiler;
17
+ solid: (passedOptions?: Partial<import("./generators/solid/types").ToSolidOptions>) => import(".").Transpiler;
18
+ svelte: ({ plugins, ...userProvidedOptions }?: import("./generators/svelte").ToSvelteOptions) => import(".").Transpiler;
19
19
  swift: (options?: import("./generators/swift-ui").ToSwiftOptions) => import(".").Transpiler;
20
20
  template: (options?: import("./generators/template").ToTemplateOptions) => import(".").Transpiler;
21
21
  webcomponent: (options?: import("./generators/html").ToHtmlOptions) => import(".").Transpiler;
22
- vue: (userOptions?: import("./generators/vue").ToVueOptions) => ({ component, path }: import(".").TranspilerArgs & {
23
- path: string;
24
- }) => string;
22
+ vue: (vueOptions?: Omit<import("./generators/vue").ToVueOptions, "vueVersion"> | undefined) => import(".").Transpiler;
23
+ vue2: (vueOptions?: Omit<import("./generators/vue").ToVueOptions, "vueVersion"> | undefined) => import(".").Transpiler;
24
+ vue3: (vueOptions?: Omit<import("./generators/vue").ToVueOptions, "vueVersion"> | undefined) => import(".").Transpiler;
25
+ stencil: (options?: import("./generators/stencil").ToStencilOptions) => import(".").Transpiler;
26
+ qwik: (userOptions?: import("./generators/qwik/component-generator").ToQwikOptions) => import(".").Transpiler;
27
+ marko: (userOptions?: import("./generators/marko").ToMarkoOptions) => import(".").Transpiler;
28
+ preact: (reactOptions?: import("./generators/react").ToReactOptions) => import(".").Transpiler;
29
+ lit: (options?: import("./generators/lit").ToLitOptions) => import(".").Transpiler;
25
30
  };
@@ -7,12 +7,17 @@ var html_1 = require("./generators/html");
7
7
  var mitosis_1 = require("./generators/mitosis");
8
8
  var liquid_1 = require("./generators/liquid");
9
9
  var react_1 = require("./generators/react");
10
+ var react_2 = require("./generators/react");
10
11
  var react_native_1 = require("./generators/react-native");
11
12
  var solid_1 = require("./generators/solid");
12
13
  var svelte_1 = require("./generators/svelte");
13
14
  var swift_ui_1 = require("./generators/swift-ui");
14
15
  var template_1 = require("./generators/template");
15
16
  var vue_1 = require("./generators/vue");
17
+ var stencil_1 = require("./generators/stencil");
18
+ var qwik_1 = require("./generators/qwik");
19
+ var marko_1 = require("./generators/marko");
20
+ var lit_1 = require("./generators/lit");
16
21
  exports.targets = {
17
22
  angular: angular_1.componentToAngular,
18
23
  builder: builder_1.componentToBuilder,
@@ -27,5 +32,12 @@ exports.targets = {
27
32
  swift: swift_ui_1.componentToSwift,
28
33
  template: template_1.componentToTemplate,
29
34
  webcomponent: html_1.componentToCustomElement,
30
- vue: vue_1.componentToVue,
35
+ vue: vue_1.componentToVue3,
36
+ vue2: vue_1.componentToVue2,
37
+ vue3: vue_1.componentToVue3,
38
+ stencil: stencil_1.componentToStencil,
39
+ qwik: qwik_1.componentToQwik,
40
+ marko: marko_1.componentToMarko,
41
+ preact: react_2.componentToPreact,
42
+ lit: lit_1.componentToLit,
31
43
  };