@builder.io/mitosis 0.0.0-dev-20260605060721
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.
- package/dist/src/constants/hooks.d.ts +16 -0
- package/dist/src/constants/hooks.js +19 -0
- package/dist/src/constants/html_tags.d.ts +2 -0
- package/dist/src/constants/html_tags.js +198 -0
- package/dist/src/constants/media-sizes.d.ts +22 -0
- package/dist/src/constants/media-sizes.js +34 -0
- package/dist/src/constants/method-literal-prefix.d.ts +1 -0
- package/dist/src/constants/method-literal-prefix.js +2 -0
- package/dist/src/flow.d.ts +26 -0
- package/dist/src/flow.js +27 -0
- package/dist/src/generators/alpine/generate.d.ts +11 -0
- package/dist/src/generators/alpine/generate.js +201 -0
- package/dist/src/generators/alpine/index.d.ts +2 -0
- package/dist/src/generators/alpine/index.js +18 -0
- package/dist/src/generators/alpine/render-mount-hook.d.ts +2 -0
- package/dist/src/generators/alpine/render-mount-hook.js +17 -0
- package/dist/src/generators/alpine/render-update-hooks.d.ts +5 -0
- package/dist/src/generators/alpine/render-update-hooks.js +44 -0
- package/dist/src/generators/alpine/types.d.ts +12 -0
- package/dist/src/generators/alpine/types.js +2 -0
- package/dist/src/generators/angular/classic/blocks.d.ts +10 -0
- package/dist/src/generators/angular/classic/blocks.js +409 -0
- package/dist/src/generators/angular/classic/component.d.ts +3 -0
- package/dist/src/generators/angular/classic/component.js +356 -0
- package/dist/src/generators/angular/classic/plugins/get-class-properties-plugin.d.ts +2 -0
- package/dist/src/generators/angular/classic/plugins/get-class-properties-plugin.js +138 -0
- package/dist/src/generators/angular/classic/plugins/get-code-processor-plugins.d.ts +8 -0
- package/dist/src/generators/angular/classic/plugins/get-code-processor-plugins.js +60 -0
- package/dist/src/generators/angular/component.d.ts +3 -0
- package/dist/src/generators/angular/component.js +27 -0
- package/dist/src/generators/angular/helpers/format.d.ts +1 -0
- package/dist/src/generators/angular/helpers/format.js +24 -0
- package/dist/src/generators/angular/helpers/get-inputs.d.ts +7 -0
- package/dist/src/generators/angular/helpers/get-inputs.js +18 -0
- package/dist/src/generators/angular/helpers/get-outputs.d.ts +7 -0
- package/dist/src/generators/angular/helpers/get-outputs.js +23 -0
- package/dist/src/generators/angular/helpers/get-refs.d.ts +8 -0
- package/dist/src/generators/angular/helpers/get-refs.js +40 -0
- package/dist/src/generators/angular/helpers/get-styles.d.ts +6 -0
- package/dist/src/generators/angular/helpers/get-styles.js +17 -0
- package/dist/src/generators/angular/helpers/hooks.d.ts +25 -0
- package/dist/src/generators/angular/helpers/hooks.js +59 -0
- package/dist/src/generators/angular/helpers/index.d.ts +33 -0
- package/dist/src/generators/angular/helpers/index.js +221 -0
- package/dist/src/generators/angular/helpers/parse-selector.d.ts +5 -0
- package/dist/src/generators/angular/helpers/parse-selector.js +19 -0
- package/dist/src/generators/angular/index.d.ts +2 -0
- package/dist/src/generators/angular/index.js +18 -0
- package/dist/src/generators/angular/signals/blocks.d.ts +10 -0
- package/dist/src/generators/angular/signals/blocks.js +379 -0
- package/dist/src/generators/angular/signals/component.d.ts +3 -0
- package/dist/src/generators/angular/signals/component.js +377 -0
- package/dist/src/generators/angular/signals/helpers/get-computed.d.ts +6 -0
- package/dist/src/generators/angular/signals/helpers/get-computed.js +79 -0
- package/dist/src/generators/angular/signals/helpers/get-dynamic-template-refs.d.ts +2 -0
- package/dist/src/generators/angular/signals/helpers/get-dynamic-template-refs.js +25 -0
- package/dist/src/generators/angular/signals/helpers/get-inputs.d.ts +7 -0
- package/dist/src/generators/angular/signals/helpers/get-inputs.js +15 -0
- package/dist/src/generators/angular/signals/helpers/index.d.ts +16 -0
- package/dist/src/generators/angular/signals/helpers/index.js +30 -0
- package/dist/src/generators/angular/signals/plugins/get-code-processor-plugins.d.ts +4 -0
- package/dist/src/generators/angular/signals/plugins/get-code-processor-plugins.js +547 -0
- package/dist/src/generators/angular/types.d.ts +72 -0
- package/dist/src/generators/angular/types.js +12 -0
- package/dist/src/generators/builder/generator.d.ts +12 -0
- package/dist/src/generators/builder/generator.js +876 -0
- package/dist/src/generators/builder/index.d.ts +2 -0
- package/dist/src/generators/builder/index.js +18 -0
- package/dist/src/generators/builder/types.d.ts +6 -0
- package/dist/src/generators/builder/types.js +2 -0
- package/dist/src/generators/context/angular.d.ts +9 -0
- package/dist/src/generators/context/angular.js +40 -0
- package/dist/src/generators/context/helpers/context-with-symbol-key.d.ts +5 -0
- package/dist/src/generators/context/helpers/context-with-symbol-key.js +33 -0
- package/dist/src/generators/context/qwik.d.ts +8 -0
- package/dist/src/generators/context/qwik.js +29 -0
- package/dist/src/generators/context/react.d.ts +10 -0
- package/dist/src/generators/context/react.js +30 -0
- package/dist/src/generators/context/rsc.d.ts +12 -0
- package/dist/src/generators/context/rsc.js +32 -0
- package/dist/src/generators/context/solid.d.ts +8 -0
- package/dist/src/generators/context/solid.js +30 -0
- package/dist/src/generators/context/svelte.d.ts +11 -0
- package/dist/src/generators/context/svelte.js +44 -0
- package/dist/src/generators/context/vue.d.ts +3 -0
- package/dist/src/generators/context/vue.js +5 -0
- package/dist/src/generators/helpers/context.d.ts +8 -0
- package/dist/src/generators/helpers/context.js +15 -0
- package/dist/src/generators/helpers/functions.d.ts +2 -0
- package/dist/src/generators/helpers/functions.js +31 -0
- package/dist/src/generators/helpers/minify.d.ts +1 -0
- package/dist/src/generators/helpers/minify.js +20 -0
- package/dist/src/generators/helpers/on-mount.d.ts +5 -0
- package/dist/src/generators/helpers/on-mount.js +25 -0
- package/dist/src/generators/helpers/rsc.d.ts +2 -0
- package/dist/src/generators/helpers/rsc.js +38 -0
- package/dist/src/generators/html/generator.d.ts +4 -0
- package/dist/src/generators/html/generator.js +1232 -0
- package/dist/src/generators/html/index.d.ts +2 -0
- package/dist/src/generators/html/index.js +18 -0
- package/dist/src/generators/html/types.d.ts +6 -0
- package/dist/src/generators/html/types.js +2 -0
- package/dist/src/generators/liquid/generator.d.ts +9 -0
- package/dist/src/generators/liquid/generator.js +161 -0
- package/dist/src/generators/liquid/index.d.ts +2 -0
- package/dist/src/generators/liquid/index.js +18 -0
- package/dist/src/generators/liquid/types.d.ts +5 -0
- package/dist/src/generators/liquid/types.js +2 -0
- package/dist/src/generators/lit/collect-class-string.d.ts +2 -0
- package/dist/src/generators/lit/collect-class-string.js +41 -0
- package/dist/src/generators/lit/generate.d.ts +3 -0
- package/dist/src/generators/lit/generate.js +271 -0
- package/dist/src/generators/lit/index.d.ts +2 -0
- package/dist/src/generators/lit/index.js +18 -0
- package/dist/src/generators/lit/types.d.ts +8 -0
- package/dist/src/generators/lit/types.js +2 -0
- package/dist/src/generators/marko/generate.d.ts +20 -0
- package/dist/src/generators/marko/generate.js +316 -0
- package/dist/src/generators/marko/index.d.ts +2 -0
- package/dist/src/generators/marko/index.js +18 -0
- package/dist/src/generators/marko/types.d.ts +4 -0
- package/dist/src/generators/marko/types.js +2 -0
- package/dist/src/generators/mitosis/generator.d.ts +7 -0
- package/dist/src/generators/mitosis/generator.js +367 -0
- package/dist/src/generators/mitosis/index.d.ts +2 -0
- package/dist/src/generators/mitosis/index.js +18 -0
- package/dist/src/generators/mitosis/types.d.ts +8 -0
- package/dist/src/generators/mitosis/types.js +2 -0
- package/dist/src/generators/qwik/component-generator.d.ts +3 -0
- package/dist/src/generators/qwik/component-generator.js +337 -0
- package/dist/src/generators/qwik/component.d.ts +21 -0
- package/dist/src/generators/qwik/component.js +170 -0
- package/dist/src/generators/qwik/directives.d.ts +24 -0
- package/dist/src/generators/qwik/directives.js +152 -0
- package/dist/src/generators/qwik/helpers/add-prevent-default.d.ts +7 -0
- package/dist/src/generators/qwik/helpers/add-prevent-default.js +33 -0
- package/dist/src/generators/qwik/helpers/convert-method-to-function.d.ts +2 -0
- package/dist/src/generators/qwik/helpers/convert-method-to-function.js +161 -0
- package/dist/src/generators/qwik/helpers/handlers.d.ts +3 -0
- package/dist/src/generators/qwik/helpers/handlers.js +60 -0
- package/dist/src/generators/qwik/helpers/stable-inject.d.ts +5 -0
- package/dist/src/generators/qwik/helpers/stable-inject.js +49 -0
- package/dist/src/generators/qwik/helpers/stable-serialize.d.ts +6 -0
- package/dist/src/generators/qwik/helpers/stable-serialize.js +50 -0
- package/dist/src/generators/qwik/helpers/state.d.ts +32 -0
- package/dist/src/generators/qwik/helpers/state.js +111 -0
- package/dist/src/generators/qwik/helpers/styles.d.ts +7 -0
- package/dist/src/generators/qwik/helpers/styles.js +70 -0
- package/dist/src/generators/qwik/index.d.ts +5 -0
- package/dist/src/generators/qwik/index.js +26 -0
- package/dist/src/generators/qwik/jsx.d.ts +17 -0
- package/dist/src/generators/qwik/jsx.js +223 -0
- package/dist/src/generators/qwik/src-generator.d.ts +83 -0
- package/dist/src/generators/qwik/src-generator.js +575 -0
- package/dist/src/generators/qwik/types.d.ts +14 -0
- package/dist/src/generators/qwik/types.js +2 -0
- package/dist/src/generators/react/blocks.d.ts +4 -0
- package/dist/src/generators/react/blocks.js +332 -0
- package/dist/src/generators/react/generator.d.ts +5 -0
- package/dist/src/generators/react/generator.js +399 -0
- package/dist/src/generators/react/helpers/default-props.d.ts +2 -0
- package/dist/src/generators/react/helpers/default-props.js +21 -0
- package/dist/src/generators/react/helpers/hooks.d.ts +20 -0
- package/dist/src/generators/react/helpers/hooks.js +67 -0
- package/dist/src/generators/react/helpers/index.d.ts +11 -0
- package/dist/src/generators/react/helpers/index.js +97 -0
- package/dist/src/generators/react/helpers/state.d.ts +17 -0
- package/dist/src/generators/react/helpers/state.js +198 -0
- package/dist/src/generators/react/index.d.ts +3 -0
- package/dist/src/generators/react/index.js +21 -0
- package/dist/src/generators/react/types.d.ts +22 -0
- package/dist/src/generators/react/types.js +2 -0
- package/dist/src/generators/react-native/extract-css-var-default-value.d.ts +1 -0
- package/dist/src/generators/react-native/extract-css-var-default-value.js +15 -0
- package/dist/src/generators/react-native/helpers.d.ts +3 -0
- package/dist/src/generators/react-native/helpers.js +133 -0
- package/dist/src/generators/react-native/index.d.ts +8 -0
- package/dist/src/generators/react-native/index.js +286 -0
- package/dist/src/generators/react-native/sanitize-react-native-block-styles.d.ts +4 -0
- package/dist/src/generators/react-native/sanitize-react-native-block-styles.js +57 -0
- package/dist/src/generators/react-native/types.d.ts +9 -0
- package/dist/src/generators/react-native/types.js +2 -0
- package/dist/src/generators/rsc/generator.d.ts +3 -0
- package/dist/src/generators/rsc/generator.js +77 -0
- package/dist/src/generators/rsc/index.d.ts +2 -0
- package/dist/src/generators/rsc/index.js +18 -0
- package/dist/src/generators/rsc/types.d.ts +5 -0
- package/dist/src/generators/rsc/types.js +2 -0
- package/dist/src/generators/solid/blocks.d.ts +4 -0
- package/dist/src/generators/solid/blocks.js +138 -0
- package/dist/src/generators/solid/helpers/styles.d.ts +3 -0
- package/dist/src/generators/solid/helpers/styles.js +47 -0
- package/dist/src/generators/solid/index.d.ts +4 -0
- package/dist/src/generators/solid/index.js +264 -0
- package/dist/src/generators/solid/state/helpers.d.ts +13 -0
- package/dist/src/generators/solid/state/helpers.js +88 -0
- package/dist/src/generators/solid/state/index.d.ts +1 -0
- package/dist/src/generators/solid/state/index.js +5 -0
- package/dist/src/generators/solid/state/signals.d.ts +7 -0
- package/dist/src/generators/solid/state/signals.js +53 -0
- package/dist/src/generators/solid/state/state.d.ts +14 -0
- package/dist/src/generators/solid/state/state.js +55 -0
- package/dist/src/generators/solid/state/store.d.ts +7 -0
- package/dist/src/generators/solid/state/store.js +76 -0
- package/dist/src/generators/solid/types.d.ts +10 -0
- package/dist/src/generators/solid/types.js +2 -0
- package/dist/src/generators/stencil/blocks.d.ts +9 -0
- package/dist/src/generators/stencil/blocks.js +122 -0
- package/dist/src/generators/stencil/component.d.ts +3 -0
- package/dist/src/generators/stencil/component.js +199 -0
- package/dist/src/generators/stencil/helpers/collect-class-string.d.ts +2 -0
- package/dist/src/generators/stencil/helpers/collect-class-string.js +43 -0
- package/dist/src/generators/stencil/helpers/index.d.ts +37 -0
- package/dist/src/generators/stencil/helpers/index.js +129 -0
- package/dist/src/generators/stencil/index.d.ts +2 -0
- package/dist/src/generators/stencil/index.js +18 -0
- package/dist/src/generators/stencil/plugins/get-code-processor-plugins.d.ts +4 -0
- package/dist/src/generators/stencil/plugins/get-code-processor-plugins.js +25 -0
- package/dist/src/generators/stencil/types.d.ts +37 -0
- package/dist/src/generators/stencil/types.js +2 -0
- package/dist/src/generators/svelte/blocks.d.ts +10 -0
- package/dist/src/generators/svelte/blocks.js +280 -0
- package/dist/src/generators/svelte/helpers.d.ts +6 -0
- package/dist/src/generators/svelte/helpers.js +14 -0
- package/dist/src/generators/svelte/index.d.ts +2 -0
- package/dist/src/generators/svelte/index.js +20 -0
- package/dist/src/generators/svelte/svelte.d.ts +3 -0
- package/dist/src/generators/svelte/svelte.js +412 -0
- package/dist/src/generators/svelte/types.d.ts +5 -0
- package/dist/src/generators/svelte/types.js +2 -0
- package/dist/src/generators/swift/blocks.d.ts +8 -0
- package/dist/src/generators/swift/blocks.js +304 -0
- package/dist/src/generators/swift/generator.d.ts +3 -0
- package/dist/src/generators/swift/generator.js +287 -0
- package/dist/src/generators/swift/helpers.d.ts +42 -0
- package/dist/src/generators/swift/helpers.js +412 -0
- package/dist/src/generators/swift/index.d.ts +2 -0
- package/dist/src/generators/swift/index.js +18 -0
- package/dist/src/generators/swift/types.d.ts +29 -0
- package/dist/src/generators/swift/types.js +2 -0
- package/dist/src/generators/taro/generator.d.ts +8 -0
- package/dist/src/generators/taro/generator.js +168 -0
- package/dist/src/generators/taro/index.d.ts +2 -0
- package/dist/src/generators/taro/index.js +18 -0
- package/dist/src/generators/taro/types.d.ts +3 -0
- package/dist/src/generators/taro/types.js +2 -0
- package/dist/src/generators/template/generator.d.ts +3 -0
- package/dist/src/generators/template/generator.js +131 -0
- package/dist/src/generators/template/index.d.ts +2 -0
- package/dist/src/generators/template/index.js +18 -0
- package/dist/src/generators/template/types.d.ts +4 -0
- package/dist/src/generators/template/types.js +2 -0
- package/dist/src/generators/vue/blocks.d.ts +8 -0
- package/dist/src/generators/vue/blocks.js +217 -0
- package/dist/src/generators/vue/compositionApi.d.ts +3 -0
- package/dist/src/generators/vue/compositionApi.js +128 -0
- package/dist/src/generators/vue/helpers.d.ts +25 -0
- package/dist/src/generators/vue/helpers.js +179 -0
- package/dist/src/generators/vue/index.d.ts +2 -0
- package/dist/src/generators/vue/index.js +18 -0
- package/dist/src/generators/vue/optionsApi.d.ts +3 -0
- package/dist/src/generators/vue/optionsApi.js +210 -0
- package/dist/src/generators/vue/types.d.ts +33 -0
- package/dist/src/generators/vue/types.js +2 -0
- package/dist/src/generators/vue/vue.d.ts +3 -0
- package/dist/src/generators/vue/vue.js +272 -0
- package/dist/src/helpers/apply-meta-tagname.d.ts +2 -0
- package/dist/src/helpers/apply-meta-tagname.js +20 -0
- package/dist/src/helpers/babel-transform.d.ts +7 -0
- package/dist/src/helpers/babel-transform.js +130 -0
- package/dist/src/helpers/bindings.d.ts +6 -0
- package/dist/src/helpers/bindings.js +9 -0
- package/dist/src/helpers/camel-case.d.ts +8 -0
- package/dist/src/helpers/camel-case.js +17 -0
- package/dist/src/helpers/capitalize.d.ts +1 -0
- package/dist/src/helpers/capitalize.js +10 -0
- package/dist/src/helpers/class-components.d.ts +13 -0
- package/dist/src/helpers/class-components.js +51 -0
- package/dist/src/helpers/component-file-extensions.d.ts +50 -0
- package/dist/src/helpers/component-file-extensions.js +141 -0
- package/dist/src/helpers/create-mitosis-component.d.ts +7 -0
- package/dist/src/helpers/create-mitosis-component.js +27 -0
- package/dist/src/helpers/create-mitosis-context.d.ts +4 -0
- package/dist/src/helpers/create-mitosis-context.js +11 -0
- package/dist/src/helpers/create-mitosis-node.d.ts +2 -0
- package/dist/src/helpers/create-mitosis-node.js +14 -0
- package/dist/src/helpers/dash-case.d.ts +1 -0
- package/dist/src/helpers/dash-case.js +6 -0
- package/dist/src/helpers/dedent.d.ts +1 -0
- package/dist/src/helpers/dedent.js +83 -0
- package/dist/src/helpers/event-handlers.d.ts +3 -0
- package/dist/src/helpers/event-handlers.js +115 -0
- package/dist/src/helpers/fast-clone.d.ts +1 -0
- package/dist/src/helpers/fast-clone.js +5 -0
- package/dist/src/helpers/filter-empty-text-nodes.d.ts +3 -0
- package/dist/src/helpers/filter-empty-text-nodes.js +9 -0
- package/dist/src/helpers/generic-format.d.ts +6 -0
- package/dist/src/helpers/generic-format.js +35 -0
- package/dist/src/helpers/get-bindings.d.ts +2 -0
- package/dist/src/helpers/get-bindings.js +16 -0
- package/dist/src/helpers/get-child-components.d.ts +2 -0
- package/dist/src/helpers/get-child-components.js +26 -0
- package/dist/src/helpers/get-components-used.d.ts +2 -0
- package/dist/src/helpers/get-components-used.js +18 -0
- package/dist/src/helpers/get-components.d.ts +2 -0
- package/dist/src/helpers/get-components.js +21 -0
- package/dist/src/helpers/get-custom-imports.d.ts +15 -0
- package/dist/src/helpers/get-custom-imports.js +38 -0
- package/dist/src/helpers/get-function-string.d.ts +1 -0
- package/dist/src/helpers/get-function-string.js +5 -0
- package/dist/src/helpers/get-prop-functions.d.ts +5 -0
- package/dist/src/helpers/get-prop-functions.js +28 -0
- package/dist/src/helpers/get-props-ref.d.ts +2 -0
- package/dist/src/helpers/get-props-ref.js +32 -0
- package/dist/src/helpers/get-props.d.ts +5 -0
- package/dist/src/helpers/get-props.js +41 -0
- package/dist/src/helpers/get-refs.d.ts +2 -0
- package/dist/src/helpers/get-refs.js +21 -0
- package/dist/src/helpers/get-state-object-string.d.ts +20 -0
- package/dist/src/helpers/get-state-object-string.js +86 -0
- package/dist/src/helpers/get-state-used.d.ts +5 -0
- package/dist/src/helpers/get-state-used.js +28 -0
- package/dist/src/helpers/get-styles.d.ts +4 -0
- package/dist/src/helpers/get-styles.js +34 -0
- package/dist/src/helpers/get-tag-name.d.ts +2 -0
- package/dist/src/helpers/get-tag-name.js +7 -0
- package/dist/src/helpers/get-typed-function.d.ts +4 -0
- package/dist/src/helpers/get-typed-function.js +20 -0
- package/dist/src/helpers/getters-to-functions.d.ts +5 -0
- package/dist/src/helpers/getters-to-functions.js +36 -0
- package/dist/src/helpers/handle-missing-state.d.ts +2 -0
- package/dist/src/helpers/handle-missing-state.js +13 -0
- package/dist/src/helpers/has-bindings-text.d.ts +2 -0
- package/dist/src/helpers/has-bindings-text.js +21 -0
- package/dist/src/helpers/has-component.d.ts +2 -0
- package/dist/src/helpers/has-component.js +21 -0
- package/dist/src/helpers/has-props.d.ts +2 -0
- package/dist/src/helpers/has-props.js +19 -0
- package/dist/src/helpers/has-stateful-dom.d.ts +2 -0
- package/dist/src/helpers/has-stateful-dom.js +21 -0
- package/dist/src/helpers/has.d.ts +9 -0
- package/dist/src/helpers/has.js +27 -0
- package/dist/src/helpers/html-escape.d.ts +1 -0
- package/dist/src/helpers/html-escape.js +7 -0
- package/dist/src/helpers/indent.d.ts +1 -0
- package/dist/src/helpers/indent.js +7 -0
- package/dist/src/helpers/is-children.d.ts +6 -0
- package/dist/src/helpers/is-children.js +14 -0
- package/dist/src/helpers/is-component.d.ts +5 -0
- package/dist/src/helpers/is-component.js +8 -0
- package/dist/src/helpers/is-hook-empty.d.ts +2 -0
- package/dist/src/helpers/is-hook-empty.js +14 -0
- package/dist/src/helpers/is-html-attribute.d.ts +4 -0
- package/dist/src/helpers/is-html-attribute.js +371 -0
- package/dist/src/helpers/is-mitosis-node.d.ts +2 -0
- package/dist/src/helpers/is-mitosis-node.js +7 -0
- package/dist/src/helpers/is-root-text-node.d.ts +4 -0
- package/dist/src/helpers/is-root-text-node.js +12 -0
- package/dist/src/helpers/is-upper-case.d.ts +1 -0
- package/dist/src/helpers/is-upper-case.js +5 -0
- package/dist/src/helpers/is-valid-attribute-name.d.ts +1 -0
- package/dist/src/helpers/is-valid-attribute-name.js +7 -0
- package/dist/src/helpers/json.d.ts +3 -0
- package/dist/src/helpers/json.js +17 -0
- package/dist/src/helpers/map-refs.d.ts +9 -0
- package/dist/src/helpers/map-refs.js +91 -0
- package/dist/src/helpers/merge-options.d.ts +19 -0
- package/dist/src/helpers/merge-options.js +35 -0
- package/dist/src/helpers/mitosis-imports.d.ts +5 -0
- package/dist/src/helpers/mitosis-imports.js +48 -0
- package/dist/src/helpers/nodes/for.d.ts +4 -0
- package/dist/src/helpers/nodes/for.js +12 -0
- package/dist/src/helpers/nullable.d.ts +2 -0
- package/dist/src/helpers/nullable.js +5 -0
- package/dist/src/helpers/on-event.d.ts +14 -0
- package/dist/src/helpers/on-event.js +52 -0
- package/dist/src/helpers/output.d.ts +5 -0
- package/dist/src/helpers/output.js +10 -0
- package/dist/src/helpers/parse-node.d.ts +2 -0
- package/dist/src/helpers/parse-node.js +20 -0
- package/dist/src/helpers/parsers.d.ts +9 -0
- package/dist/src/helpers/parsers.js +66 -0
- package/dist/src/helpers/patterns.d.ts +8 -0
- package/dist/src/helpers/patterns.js +17 -0
- package/dist/src/helpers/plugins/process-code/index.d.ts +12 -0
- package/dist/src/helpers/plugins/process-code/index.js +169 -0
- package/dist/src/helpers/plugins/process-code/types.d.ts +7 -0
- package/dist/src/helpers/plugins/process-code/types.js +2 -0
- package/dist/src/helpers/plugins/process-signals.d.ts +22 -0
- package/dist/src/helpers/plugins/process-signals.js +179 -0
- package/dist/src/helpers/plugins/process-target-blocks.d.ts +6 -0
- package/dist/src/helpers/plugins/process-target-blocks.js +59 -0
- package/dist/src/helpers/process-http-requests.d.ts +2 -0
- package/dist/src/helpers/process-http-requests.js +25 -0
- package/dist/src/helpers/remove-surrounding-block.d.ts +6 -0
- package/dist/src/helpers/remove-surrounding-block.js +25 -0
- package/dist/src/helpers/render-imports.d.ts +42 -0
- package/dist/src/helpers/render-imports.js +169 -0
- package/dist/src/helpers/replace-identifiers.d.ts +27 -0
- package/dist/src/helpers/replace-identifiers.js +187 -0
- package/dist/src/helpers/replace-new-lines-in-strings.d.ts +1 -0
- package/dist/src/helpers/replace-new-lines-in-strings.js +26 -0
- package/dist/src/helpers/set.d.ts +7 -0
- package/dist/src/helpers/set.js +24 -0
- package/dist/src/helpers/signals/index.d.ts +1 -0
- package/dist/src/helpers/signals/index.js +17 -0
- package/dist/src/helpers/signals/signals.d.ts +22 -0
- package/dist/src/helpers/signals/signals.js +109 -0
- package/dist/src/helpers/slots.d.ts +5 -0
- package/dist/src/helpers/slots.js +26 -0
- package/dist/src/helpers/state.d.ts +2 -0
- package/dist/src/helpers/state.js +5 -0
- package/dist/src/helpers/strip-meta-properties.d.ts +2 -0
- package/dist/src/helpers/strip-meta-properties.js +26 -0
- package/dist/src/helpers/strip-state-and-props-refs.d.ts +38 -0
- package/dist/src/helpers/strip-state-and-props-refs.js +86 -0
- package/dist/src/helpers/styles/collect-css.d.ts +7 -0
- package/dist/src/helpers/styles/collect-css.js +113 -0
- package/dist/src/helpers/styles/collect-styled-components.d.ts +2 -0
- package/dist/src/helpers/styles/collect-styled-components.js +64 -0
- package/dist/src/helpers/styles/helpers.d.ts +31 -0
- package/dist/src/helpers/styles/helpers.js +90 -0
- package/dist/src/helpers/trace-reference-to-module-path.d.ts +2 -0
- package/dist/src/helpers/trace-reference-to-module-path.js +13 -0
- package/dist/src/helpers/transform-state-setters.d.ts +14 -0
- package/dist/src/helpers/transform-state-setters.js +24 -0
- package/dist/src/helpers/transform-to-jsx.d.ts +4 -0
- package/dist/src/helpers/transform-to-jsx.js +13 -0
- package/dist/src/helpers/traverse-nodes.d.ts +4 -0
- package/dist/src/helpers/traverse-nodes.js +16 -0
- package/dist/src/helpers/try-prettier-format.d.ts +1 -0
- package/dist/src/helpers/try-prettier-format.js +24 -0
- package/dist/src/helpers/typescript-project.d.ts +7 -0
- package/dist/src/helpers/typescript-project.js +63 -0
- package/dist/src/helpers/typescript.d.ts +9 -0
- package/dist/src/helpers/typescript.js +5 -0
- package/dist/src/helpers/web-components/attribute-passing.d.ts +6 -0
- package/dist/src/helpers/web-components/attribute-passing.js +47 -0
- package/dist/src/index.d.ts +96 -0
- package/dist/src/index.js +74 -0
- package/dist/src/modules/plugins.d.ts +25 -0
- package/dist/src/modules/plugins.js +51 -0
- package/dist/src/parsers/angular.d.ts +5 -0
- package/dist/src/parsers/angular.js +154 -0
- package/dist/src/parsers/builder/builder.d.ts +55 -0
- package/dist/src/parsers/builder/builder.js +1198 -0
- package/dist/src/parsers/builder/helpers.d.ts +3 -0
- package/dist/src/parsers/builder/helpers.js +26 -0
- package/dist/src/parsers/builder/index.d.ts +1 -0
- package/dist/src/parsers/builder/index.js +17 -0
- package/dist/src/parsers/context.d.ts +6 -0
- package/dist/src/parsers/context.js +82 -0
- package/dist/src/parsers/jsx/ast.d.ts +5 -0
- package/dist/src/parsers/jsx/ast.js +74 -0
- package/dist/src/parsers/jsx/component-types.d.ts +8 -0
- package/dist/src/parsers/jsx/component-types.js +82 -0
- package/dist/src/parsers/jsx/context.d.ts +6 -0
- package/dist/src/parsers/jsx/context.js +68 -0
- package/dist/src/parsers/jsx/element-parser.d.ts +9 -0
- package/dist/src/parsers/jsx/element-parser.js +418 -0
- package/dist/src/parsers/jsx/exports.d.ts +5 -0
- package/dist/src/parsers/jsx/exports.js +76 -0
- package/dist/src/parsers/jsx/function-parser.d.ts +9 -0
- package/dist/src/parsers/jsx/function-parser.js +360 -0
- package/dist/src/parsers/jsx/helpers.d.ts +17 -0
- package/dist/src/parsers/jsx/helpers.js +85 -0
- package/dist/src/parsers/jsx/hooks/helpers.d.ts +5 -0
- package/dist/src/parsers/jsx/hooks/helpers.js +54 -0
- package/dist/src/parsers/jsx/hooks/index.d.ts +16 -0
- package/dist/src/parsers/jsx/hooks/index.js +96 -0
- package/dist/src/parsers/jsx/hooks/use-metadata.d.ts +9 -0
- package/dist/src/parsers/jsx/hooks/use-metadata.js +184 -0
- package/dist/src/parsers/jsx/hooks/use-target.d.ts +13 -0
- package/dist/src/parsers/jsx/hooks/use-target.js +135 -0
- package/dist/src/parsers/jsx/imports.d.ts +7 -0
- package/dist/src/parsers/jsx/imports.js +23 -0
- package/dist/src/parsers/jsx/index.d.ts +2 -0
- package/dist/src/parsers/jsx/index.js +5 -0
- package/dist/src/parsers/jsx/jsx.d.ts +10 -0
- package/dist/src/parsers/jsx/jsx.js +227 -0
- package/dist/src/parsers/jsx/props-types.d.ts +5 -0
- package/dist/src/parsers/jsx/props-types.js +22 -0
- package/dist/src/parsers/jsx/props.d.ts +2 -0
- package/dist/src/parsers/jsx/props.js +64 -0
- package/dist/src/parsers/jsx/signals.d.ts +9 -0
- package/dist/src/parsers/jsx/signals.js +99 -0
- package/dist/src/parsers/jsx/state.d.ts +17 -0
- package/dist/src/parsers/jsx/state.js +274 -0
- package/dist/src/parsers/jsx/types.d.ts +29 -0
- package/dist/src/parsers/jsx/types.js +2 -0
- package/dist/src/parsers/svelte/css/index.d.ts +3 -0
- package/dist/src/parsers/svelte/css/index.js +8 -0
- package/dist/src/parsers/svelte/helpers/bindings.d.ts +3 -0
- package/dist/src/parsers/svelte/helpers/bindings.js +75 -0
- package/dist/src/parsers/svelte/helpers/children.d.ts +5 -0
- package/dist/src/parsers/svelte/helpers/children.js +22 -0
- package/dist/src/parsers/svelte/helpers/expressions.d.ts +3 -0
- package/dist/src/parsers/svelte/helpers/expressions.js +20 -0
- package/dist/src/parsers/svelte/helpers/hooks.d.ts +2 -0
- package/dist/src/parsers/svelte/helpers/hooks.js +15 -0
- package/dist/src/parsers/svelte/helpers/mitosis-node.d.ts +2 -0
- package/dist/src/parsers/svelte/helpers/mitosis-node.js +16 -0
- package/dist/src/parsers/svelte/helpers/post-process.d.ts +15 -0
- package/dist/src/parsers/svelte/helpers/post-process.js +174 -0
- package/dist/src/parsers/svelte/helpers/string.d.ts +3 -0
- package/dist/src/parsers/svelte/helpers/string.js +26 -0
- package/dist/src/parsers/svelte/html/actions.d.ts +3 -0
- package/dist/src/parsers/svelte/html/actions.js +46 -0
- package/dist/src/parsers/svelte/html/each.d.ts +4 -0
- package/dist/src/parsers/svelte/html/each.js +20 -0
- package/dist/src/parsers/svelte/html/element.d.ts +3 -0
- package/dist/src/parsers/svelte/html/element.js +224 -0
- package/dist/src/parsers/svelte/html/fragment.d.ts +3 -0
- package/dist/src/parsers/svelte/html/fragment.js +16 -0
- package/dist/src/parsers/svelte/html/if-else.d.ts +3 -0
- package/dist/src/parsers/svelte/html/if-else.js +31 -0
- package/dist/src/parsers/svelte/html/index.d.ts +5 -0
- package/dist/src/parsers/svelte/html/index.js +80 -0
- package/dist/src/parsers/svelte/html/mustache-tag.d.ts +3 -0
- package/dist/src/parsers/svelte/html/mustache-tag.js +24 -0
- package/dist/src/parsers/svelte/html/slot.d.ts +3 -0
- package/dist/src/parsers/svelte/html/slot.js +20 -0
- package/dist/src/parsers/svelte/html/text.d.ts +66 -0
- package/dist/src/parsers/svelte/html/text.js +14 -0
- package/dist/src/parsers/svelte/index.d.ts +2 -0
- package/dist/src/parsers/svelte/index.js +59 -0
- package/dist/src/parsers/svelte/instance/context.d.ts +5 -0
- package/dist/src/parsers/svelte/instance/context.js +59 -0
- package/dist/src/parsers/svelte/instance/expressions.d.ts +3 -0
- package/dist/src/parsers/svelte/instance/expressions.js +11 -0
- package/dist/src/parsers/svelte/instance/functions.d.ts +3 -0
- package/dist/src/parsers/svelte/instance/functions.js +66 -0
- package/dist/src/parsers/svelte/instance/hooks.d.ts +5 -0
- package/dist/src/parsers/svelte/instance/hooks.js +32 -0
- package/dist/src/parsers/svelte/instance/imports.d.ts +3 -0
- package/dist/src/parsers/svelte/instance/imports.js +32 -0
- package/dist/src/parsers/svelte/instance/index.d.ts +3 -0
- package/dist/src/parsers/svelte/instance/index.js +123 -0
- package/dist/src/parsers/svelte/instance/properties.d.ts +3 -0
- package/dist/src/parsers/svelte/instance/properties.js +22 -0
- package/dist/src/parsers/svelte/instance/reactive.d.ts +3 -0
- package/dist/src/parsers/svelte/instance/reactive.js +33 -0
- package/dist/src/parsers/svelte/instance/references.d.ts +4 -0
- package/dist/src/parsers/svelte/instance/references.js +68 -0
- package/dist/src/parsers/svelte/instance/statements.d.ts +3 -0
- package/dist/src/parsers/svelte/instance/statements.js +10 -0
- package/dist/src/parsers/svelte/module/index.d.ts +3 -0
- package/dist/src/parsers/svelte/module/index.js +34 -0
- package/dist/src/parsers/svelte/types/index.d.ts +4 -0
- package/dist/src/parsers/svelte/types/index.js +2 -0
- package/dist/src/parsers/svelte/typescript/index.d.ts +7 -0
- package/dist/src/parsers/svelte/typescript/index.js +121 -0
- package/dist/src/plugins/compile-away-builder-components.d.ts +15 -0
- package/dist/src/plugins/compile-away-builder-components.js +609 -0
- package/dist/src/plugins/compile-away-components.d.ts +33 -0
- package/dist/src/plugins/compile-away-components.js +50 -0
- package/dist/src/plugins/map-styles.d.ts +12 -0
- package/dist/src/plugins/map-styles.js +16 -0
- package/dist/src/symbols/symbol-processor.d.ts +20 -0
- package/dist/src/symbols/symbol-processor.js +202 -0
- package/dist/src/targets.d.ts +25 -0
- package/dist/src/targets.js +46 -0
- package/dist/src/types/config.d.ts +103 -0
- package/dist/src/types/config.js +2 -0
- package/dist/src/types/json.d.ts +13 -0
- package/dist/src/types/json.js +2 -0
- package/dist/src/types/metadata.d.ts +55 -0
- package/dist/src/types/metadata.js +2 -0
- package/dist/src/types/mitosis-component.d.ts +162 -0
- package/dist/src/types/mitosis-component.js +2 -0
- package/dist/src/types/mitosis-context.d.ts +6 -0
- package/dist/src/types/mitosis-context.js +2 -0
- package/dist/src/types/mitosis-node.d.ts +117 -0
- package/dist/src/types/mitosis-node.js +12 -0
- package/dist/src/types/mitosis-styles.d.ts +1 -0
- package/dist/src/types/mitosis-styles.js +2 -0
- package/dist/src/types/plugins.d.ts +19 -0
- package/dist/src/types/plugins.js +2 -0
- package/dist/src/types/transpiler.d.ts +48 -0
- package/dist/src/types/transpiler.js +2 -0
- package/jsx-runtime.d.ts +2143 -0
- package/package.json +106 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.componentToReactNative = exports.collectReactNativeStyles = void 0;
|
|
21
|
+
const bindings_1 = require("../../helpers/bindings");
|
|
22
|
+
const fast_clone_1 = require("../../helpers/fast-clone");
|
|
23
|
+
const is_children_1 = __importDefault(require("../../helpers/is-children"));
|
|
24
|
+
const is_mitosis_node_1 = require("../../helpers/is-mitosis-node");
|
|
25
|
+
const merge_options_1 = require("../../helpers/merge-options");
|
|
26
|
+
const json5_1 = __importDefault(require("json5"));
|
|
27
|
+
const lodash_1 = require("lodash");
|
|
28
|
+
const legacy_1 = __importDefault(require("neotraverse/legacy"));
|
|
29
|
+
const html_tags_1 = require("../../constants/html_tags");
|
|
30
|
+
const react_1 = require("../react");
|
|
31
|
+
const sanitize_react_native_block_styles_1 = require("./sanitize-react-native-block-styles");
|
|
32
|
+
const stylePropertiesThatMustBeNumber = new Set(['lineHeight']);
|
|
33
|
+
const MEDIA_QUERY_KEY_REGEX = /^@media.*/;
|
|
34
|
+
const sanitizeStyle = (obj) => (key, value) => {
|
|
35
|
+
const propertyValue = obj[key];
|
|
36
|
+
if (key.match(MEDIA_QUERY_KEY_REGEX)) {
|
|
37
|
+
console.warn('Unsupported: skipping media queries for react-native: ', key, propertyValue);
|
|
38
|
+
delete obj[key];
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const collectReactNativeStyles = (json, options) => {
|
|
43
|
+
const styleMap = {};
|
|
44
|
+
const componentIndexes = {};
|
|
45
|
+
const getStyleSheetName = (item) => {
|
|
46
|
+
const componentName = (0, lodash_1.camelCase)(item.name || 'view');
|
|
47
|
+
// If we have already seen this component name, we will increment the index. Otherwise, we will set the index to 1.
|
|
48
|
+
const index = (componentIndexes[componentName] = (componentIndexes[componentName] || 0) + 1);
|
|
49
|
+
return `${componentName}${index}`;
|
|
50
|
+
};
|
|
51
|
+
(0, legacy_1.default)(json).forEach(function (item) {
|
|
52
|
+
var _a, _b, _c;
|
|
53
|
+
if (!(0, is_mitosis_node_1.isMitosisNode)(item)) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
let cssValue = json5_1.default.parse(((_a = item.bindings.css) === null || _a === void 0 ? void 0 : _a.code) || '{}');
|
|
57
|
+
delete item.bindings.css;
|
|
58
|
+
if ((0, lodash_1.size)(cssValue)) {
|
|
59
|
+
// Style properties like `"20px"` need to be numbers like `20` for react native
|
|
60
|
+
for (const key in cssValue) {
|
|
61
|
+
sanitizeStyle(cssValue)(key, cssValue[key]);
|
|
62
|
+
cssValue = (0, sanitize_react_native_block_styles_1.sanitizeReactNativeBlockStyles)(cssValue, options);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
let styleValue = json5_1.default.parse(((_b = item.bindings.style) === null || _b === void 0 ? void 0 : _b.code) || '{}');
|
|
67
|
+
if ((0, lodash_1.size)(styleValue)) {
|
|
68
|
+
// Style properties like `"20px"` need to be numbers like `20` for react native
|
|
69
|
+
for (const key in styleValue) {
|
|
70
|
+
sanitizeStyle(styleValue)(key, styleValue[key]);
|
|
71
|
+
styleValue = (0, sanitize_react_native_block_styles_1.sanitizeReactNativeBlockStyles)(styleValue, options);
|
|
72
|
+
}
|
|
73
|
+
item.bindings.style.code = json5_1.default.stringify(styleValue);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (e) { }
|
|
77
|
+
if (!(0, lodash_1.size)(cssValue)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const styleSheetName = getStyleSheetName(item);
|
|
81
|
+
const styleSheetAccess = `styles.${styleSheetName}`;
|
|
82
|
+
styleMap[styleSheetName] = cssValue;
|
|
83
|
+
if (!item.bindings.style) {
|
|
84
|
+
item.bindings.style = (0, bindings_1.createSingleBinding)({
|
|
85
|
+
code: styleSheetAccess,
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
// run the code below only if the style binding is a JSON object
|
|
91
|
+
json5_1.default.parse(item.bindings.style.code || '{}');
|
|
92
|
+
item.bindings.style = (0, bindings_1.createSingleBinding)({
|
|
93
|
+
code: ((_c = item.bindings.style) === null || _c === void 0 ? void 0 : _c.code.replace(/}$/, `, ...${styleSheetAccess} }`)) || styleSheetAccess,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
// if not a JSON, then it's a property, so we should spread it.
|
|
98
|
+
item.bindings.style = (0, bindings_1.createSingleBinding)({
|
|
99
|
+
code: `{
|
|
100
|
+
...${styleSheetAccess},
|
|
101
|
+
...${item.bindings.style.code}
|
|
102
|
+
}`,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return styleMap;
|
|
107
|
+
};
|
|
108
|
+
exports.collectReactNativeStyles = collectReactNativeStyles;
|
|
109
|
+
/**
|
|
110
|
+
* Plugin that handles necessary transformations from React to React Native:
|
|
111
|
+
* - Converts DOM tags to <View /> and <Text />
|
|
112
|
+
*/
|
|
113
|
+
const PROCESS_REACT_NATIVE_PLUGIN = () => ({
|
|
114
|
+
json: {
|
|
115
|
+
pre: (json) => {
|
|
116
|
+
(0, legacy_1.default)(json).forEach((node) => {
|
|
117
|
+
var _a, _b, _c, _d;
|
|
118
|
+
if ((0, is_mitosis_node_1.isMitosisNode)(node)) {
|
|
119
|
+
// TODO: handle TextInput, Image, etc
|
|
120
|
+
if ((0, is_children_1.default)({ node })) {
|
|
121
|
+
node.name = '';
|
|
122
|
+
}
|
|
123
|
+
else if (node.name.toLowerCase() === node.name && html_tags_1.VALID_HTML_TAGS.includes(node.name)) {
|
|
124
|
+
if (node.name === 'input') {
|
|
125
|
+
node.name = 'TextInput';
|
|
126
|
+
}
|
|
127
|
+
else if (node.name === 'img') {
|
|
128
|
+
node.name = 'Image';
|
|
129
|
+
}
|
|
130
|
+
else if (node.name === 'a') {
|
|
131
|
+
node.name = 'TouchableOpacity';
|
|
132
|
+
}
|
|
133
|
+
else if (node.name === 'button') {
|
|
134
|
+
node.name = 'Button';
|
|
135
|
+
}
|
|
136
|
+
// if node is not button or a and still has onClick it needs to pressable
|
|
137
|
+
else if (node.bindings.onClick) {
|
|
138
|
+
node.name = 'Pressable';
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
node.name = 'View';
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else if (((_a = node.properties._text) === null || _a === void 0 ? void 0 : _a.trim().length) ||
|
|
145
|
+
((_d = (_c = (_b = node.bindings._text) === null || _b === void 0 ? void 0 : _b.code) === null || _c === void 0 ? void 0 : _c.trim()) === null || _d === void 0 ? void 0 : _d.length)) {
|
|
146
|
+
node.name = 'Text';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* Removes React Native className and class properties from the JSON
|
|
155
|
+
*/
|
|
156
|
+
const REMOVE_REACT_NATIVE_CLASSES_PLUGIN = () => ({
|
|
157
|
+
json: {
|
|
158
|
+
pre: (json) => {
|
|
159
|
+
(0, legacy_1.default)(json).forEach(function (node) {
|
|
160
|
+
if ((0, is_mitosis_node_1.isMitosisNode)(node)) {
|
|
161
|
+
if (node.properties.class) {
|
|
162
|
+
delete node.properties.class;
|
|
163
|
+
}
|
|
164
|
+
if (node.properties.className) {
|
|
165
|
+
delete node.properties.className;
|
|
166
|
+
}
|
|
167
|
+
if (node.bindings.class) {
|
|
168
|
+
delete node.bindings.class;
|
|
169
|
+
}
|
|
170
|
+
if (node.bindings.className) {
|
|
171
|
+
delete node.bindings.className;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
/**
|
|
179
|
+
* Converts class and className properties to twrnc style syntax
|
|
180
|
+
*/
|
|
181
|
+
const TWRNC_STYLES_PLUGIN = () => ({
|
|
182
|
+
json: {
|
|
183
|
+
post: (json) => {
|
|
184
|
+
(0, legacy_1.default)(json).forEach(function (node) {
|
|
185
|
+
if ((0, is_mitosis_node_1.isMitosisNode)(node)) {
|
|
186
|
+
let staticClasses = [node.properties.class, node.properties.className]
|
|
187
|
+
.filter(Boolean)
|
|
188
|
+
.join(' ');
|
|
189
|
+
let dynamicClasses = [node.bindings.class, node.bindings.className].filter(Boolean);
|
|
190
|
+
if (staticClasses || dynamicClasses.length) {
|
|
191
|
+
let styleCode = '';
|
|
192
|
+
if (staticClasses) {
|
|
193
|
+
styleCode = `tw\`${staticClasses}\``;
|
|
194
|
+
}
|
|
195
|
+
if (dynamicClasses.length) {
|
|
196
|
+
let dynamicCode = dynamicClasses
|
|
197
|
+
.map((dc) => (dc && dc.code ? dc.code : null))
|
|
198
|
+
.filter(Boolean)
|
|
199
|
+
.join(', ');
|
|
200
|
+
if (dynamicCode) {
|
|
201
|
+
if (styleCode) {
|
|
202
|
+
// If we have both static and dynamic classes
|
|
203
|
+
styleCode = `tw.style(${styleCode}, ${dynamicCode})`;
|
|
204
|
+
}
|
|
205
|
+
else if (dynamicClasses.length > 1) {
|
|
206
|
+
// If we have multiple dynamic classes
|
|
207
|
+
styleCode = `tw.style([${dynamicCode}])`;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
// If we have a single dynamic class
|
|
211
|
+
styleCode = `tw.style(${dynamicCode})`;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (styleCode) {
|
|
216
|
+
node.bindings.style = (0, bindings_1.createSingleBinding)({ code: styleCode });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// Clean up original class and className properties/bindings
|
|
220
|
+
delete node.properties.class;
|
|
221
|
+
delete node.properties.className;
|
|
222
|
+
delete node.bindings.class;
|
|
223
|
+
delete node.bindings.className;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
/**
|
|
230
|
+
* Converts class and className properties to native-wind style syntax
|
|
231
|
+
* Note: We only support the "with babel" setup: https://www.nativewind.dev/guides/babel
|
|
232
|
+
*/
|
|
233
|
+
const NATIVE_WIND_STYLES_PLUGIN = () => ({
|
|
234
|
+
json: {
|
|
235
|
+
post: (json) => {
|
|
236
|
+
(0, legacy_1.default)(json).forEach(function (node) {
|
|
237
|
+
if ((0, is_mitosis_node_1.isMitosisNode)(node)) {
|
|
238
|
+
let combinedClasses = [
|
|
239
|
+
node.properties.class,
|
|
240
|
+
node.properties.className,
|
|
241
|
+
node.bindings.class,
|
|
242
|
+
node.bindings.className,
|
|
243
|
+
]
|
|
244
|
+
.filter(Boolean)
|
|
245
|
+
.join(' ');
|
|
246
|
+
if (node.properties.class) {
|
|
247
|
+
delete node.properties.class;
|
|
248
|
+
}
|
|
249
|
+
if (node.properties.className) {
|
|
250
|
+
delete node.properties.className;
|
|
251
|
+
}
|
|
252
|
+
if (node.bindings.class) {
|
|
253
|
+
delete node.bindings.class;
|
|
254
|
+
}
|
|
255
|
+
if (node.bindings.className) {
|
|
256
|
+
delete node.bindings.className;
|
|
257
|
+
}
|
|
258
|
+
if (combinedClasses) {
|
|
259
|
+
node.properties.className = combinedClasses;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
const DEFAULT_OPTIONS = {
|
|
267
|
+
stateType: 'useState',
|
|
268
|
+
stylesType: 'react-native',
|
|
269
|
+
plugins: [PROCESS_REACT_NATIVE_PLUGIN],
|
|
270
|
+
};
|
|
271
|
+
const componentToReactNative = (_options = {}) => ({ component, path }) => {
|
|
272
|
+
const json = (0, fast_clone_1.fastClone)(component);
|
|
273
|
+
const options = (0, merge_options_1.mergeOptions)(DEFAULT_OPTIONS, _options);
|
|
274
|
+
if (options.stylesType === 'twrnc') {
|
|
275
|
+
options.plugins.push(TWRNC_STYLES_PLUGIN);
|
|
276
|
+
}
|
|
277
|
+
else if (options.stylesType === 'native-wind') {
|
|
278
|
+
options.plugins.push(NATIVE_WIND_STYLES_PLUGIN);
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
options.plugins.push(REMOVE_REACT_NATIVE_CLASSES_PLUGIN);
|
|
282
|
+
}
|
|
283
|
+
return (0, react_1.componentToReact)({ ...options, type: 'native' })({ component: json, path });
|
|
284
|
+
};
|
|
285
|
+
exports.componentToReactNative = componentToReactNative;
|
|
286
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sanitizeReactNativeBlockStyles = void 0;
|
|
4
|
+
const helpers_1 = require("./helpers");
|
|
5
|
+
const propertiesThatMustBeNumber = new Set(['lineHeight']);
|
|
6
|
+
const displayValues = new Set(['flex', 'none']);
|
|
7
|
+
const normalizeNumber = (value) => {
|
|
8
|
+
if (Number.isNaN(value)) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
else if (value < 0) {
|
|
12
|
+
// TODO: why are negative values not allowed?
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const sanitizeReactNativeBlockStyles = (styles, options) => {
|
|
20
|
+
if (options.sanitizeReactNative) {
|
|
21
|
+
return (0, helpers_1.cleanReactNativeBlockStyles)(styles);
|
|
22
|
+
}
|
|
23
|
+
return Object.keys(styles).reduce((acc, key) => {
|
|
24
|
+
const propertyValue = styles[key];
|
|
25
|
+
if (typeof propertyValue === 'string' &&
|
|
26
|
+
key === 'display' &&
|
|
27
|
+
!displayValues.has(propertyValue)) {
|
|
28
|
+
console.warn(`Style value for key "display" must be "flex" or "none" but had ${propertyValue}`);
|
|
29
|
+
return acc;
|
|
30
|
+
}
|
|
31
|
+
if (propertiesThatMustBeNumber.has(key) && typeof propertyValue !== 'number') {
|
|
32
|
+
console.warn(`Style key ${key} must be a number, but had value \`${styles[key]}\``);
|
|
33
|
+
return acc;
|
|
34
|
+
}
|
|
35
|
+
if (typeof propertyValue === 'string') {
|
|
36
|
+
// `px` units need to be stripped and replaced with numbers
|
|
37
|
+
// https://regexr.com/6ualn
|
|
38
|
+
const isPixelUnit = propertyValue.match(/^-?(\d*)(\.?)(\d*)*px$/);
|
|
39
|
+
if (isPixelUnit) {
|
|
40
|
+
const newValue = parseFloat(propertyValue);
|
|
41
|
+
const normalizedValue = normalizeNumber(newValue);
|
|
42
|
+
if (normalizedValue) {
|
|
43
|
+
return { ...acc, [key]: normalizedValue };
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return acc;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else if (propertyValue === '0') {
|
|
50
|
+
// 0 edge case needs to be handled
|
|
51
|
+
return { ...acc, [key]: 0 };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return { ...acc, [key]: propertyValue };
|
|
55
|
+
}, {});
|
|
56
|
+
};
|
|
57
|
+
exports.sanitizeReactNativeBlockStyles = sanitizeReactNativeBlockStyles;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseTranspilerOptions } from '../../types/transpiler';
|
|
2
|
+
export interface ToReactNativeOptions extends BaseTranspilerOptions {
|
|
3
|
+
sanitizeReactNative?: boolean;
|
|
4
|
+
stylesType: 'emotion' | 'react-native' | 'twrnc' | 'native-wind';
|
|
5
|
+
stateType: 'useState' | 'mobx' | 'valtio' | 'solid' | 'builder';
|
|
6
|
+
}
|
|
7
|
+
export type ReactNativeMetadata = {
|
|
8
|
+
forwardRef?: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
exports.componentToRsc = void 0;
|
|
7
|
+
const legacy_1 = __importDefault(require("neotraverse/legacy"));
|
|
8
|
+
const is_mitosis_node_1 = require("../../helpers/is-mitosis-node");
|
|
9
|
+
const merge_options_1 = require("../../helpers/merge-options");
|
|
10
|
+
const nullable_1 = require("../../helpers/nullable");
|
|
11
|
+
const rsc_1 = require("../helpers/rsc");
|
|
12
|
+
const react_1 = require("../react");
|
|
13
|
+
/**
|
|
14
|
+
* Transform react to be RSC compatible, such as
|
|
15
|
+
* - remove event listeners
|
|
16
|
+
* - remove lifecycle hooks
|
|
17
|
+
* - remove refs
|
|
18
|
+
* - transform context to prop drilling
|
|
19
|
+
*/
|
|
20
|
+
const RSC_TRANSFORM_PLUGIN = () => ({
|
|
21
|
+
json: {
|
|
22
|
+
pre: (json) => {
|
|
23
|
+
json.hooks.onMount = [];
|
|
24
|
+
delete json.hooks.onUnMount;
|
|
25
|
+
delete json.hooks.onUpdate;
|
|
26
|
+
json.refs = {};
|
|
27
|
+
json.context.get = {};
|
|
28
|
+
json.context.set = {};
|
|
29
|
+
(0, legacy_1.default)(json).forEach((node) => {
|
|
30
|
+
if ((0, is_mitosis_node_1.isMitosisNode)(node)) {
|
|
31
|
+
const isComponent = node.name.match(/[A-Z]/);
|
|
32
|
+
// if (isComponent) {
|
|
33
|
+
// // Drill context down, aka
|
|
34
|
+
// // function (props) { return <Component _context{props._context} /> }
|
|
35
|
+
// if (!node.bindings[contextPropDrillingKey]) {
|
|
36
|
+
// node.bindings[contextPropDrillingKey] = createSingleBinding({
|
|
37
|
+
// code: contextPropDrillingKey,
|
|
38
|
+
// });
|
|
39
|
+
// }
|
|
40
|
+
// }
|
|
41
|
+
if (node.bindings.ref) {
|
|
42
|
+
delete node.bindings.ref;
|
|
43
|
+
}
|
|
44
|
+
// for (const key in node.bindings) {
|
|
45
|
+
// if (key.match(/^on[A-Z]/)) {
|
|
46
|
+
// delete node.bindings[key];
|
|
47
|
+
// }
|
|
48
|
+
// }
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
const RscOptions = {
|
|
55
|
+
plugins: [RSC_TRANSFORM_PLUGIN],
|
|
56
|
+
stateType: 'variables',
|
|
57
|
+
};
|
|
58
|
+
const componentToRsc = (_options = {}) => ({ component, path }) => {
|
|
59
|
+
var _a, _b, _c, _d, _e;
|
|
60
|
+
if (!(0, nullable_1.checkIsDefined)((_b = (_a = component.meta.useMetadata) === null || _a === void 0 ? void 0 : _a.rsc) === null || _b === void 0 ? void 0 : _b.componentType) &&
|
|
61
|
+
!(0, rsc_1.checkIfIsClientComponent)(component)) {
|
|
62
|
+
component.meta.useMetadata = {
|
|
63
|
+
...component.meta.useMetadata,
|
|
64
|
+
rsc: {
|
|
65
|
+
...(_c = component.meta.useMetadata) === null || _c === void 0 ? void 0 : _c.rsc,
|
|
66
|
+
componentType: 'server',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const isRSC = ((_e = (_d = component.meta.useMetadata) === null || _d === void 0 ? void 0 : _d.rsc) === null || _e === void 0 ? void 0 : _e.componentType) === 'server';
|
|
71
|
+
const options = (0, merge_options_1.mergeOptions)({
|
|
72
|
+
rsc: true,
|
|
73
|
+
...(isRSC ? RscOptions : {}),
|
|
74
|
+
}, _options);
|
|
75
|
+
return (0, react_1.componentToReact)(options)({ component, path });
|
|
76
|
+
};
|
|
77
|
+
exports.componentToRsc = componentToRsc;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./generator"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MitosisComponent } from '../../types/mitosis-component';
|
|
2
|
+
import { MitosisNode } from '../../types/mitosis-node';
|
|
3
|
+
import { ToSolidOptions } from './types';
|
|
4
|
+
export declare const blockToSolid: (json: MitosisNode, component: MitosisComponent, options: ToSolidOptions, insideJsx: boolean) => string;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.blockToSolid = void 0;
|
|
4
|
+
const babel_transform_1 = require("../../helpers/babel-transform");
|
|
5
|
+
const event_handlers_1 = require("../../helpers/event-handlers");
|
|
6
|
+
const filter_empty_text_nodes_1 = require("../../helpers/filter-empty-text-nodes");
|
|
7
|
+
const is_mitosis_node_1 = require("../../helpers/is-mitosis-node");
|
|
8
|
+
const typescript_1 = require("../../helpers/typescript");
|
|
9
|
+
const mitosis_node_1 = require("../../types/mitosis-node");
|
|
10
|
+
const core_1 = require("@babel/core");
|
|
11
|
+
const lodash_1 = require("lodash");
|
|
12
|
+
const html_tags_1 = require("../../constants/html_tags");
|
|
13
|
+
const styles_1 = require("./helpers/styles");
|
|
14
|
+
const ATTTRIBUTE_MAPPERS = {
|
|
15
|
+
// for: 'htmlFor',
|
|
16
|
+
};
|
|
17
|
+
const transformAttributeName = (name) => {
|
|
18
|
+
if ((0, typescript_1.objectHasKey)(ATTTRIBUTE_MAPPERS, name))
|
|
19
|
+
return ATTTRIBUTE_MAPPERS[name];
|
|
20
|
+
return name;
|
|
21
|
+
};
|
|
22
|
+
const blockToSolid = (json, component, options, insideJsx) => {
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
|
+
if (insideJsx) {
|
|
25
|
+
if (json.properties._text) {
|
|
26
|
+
return json.properties._text;
|
|
27
|
+
}
|
|
28
|
+
if ((_a = json.bindings._text) === null || _a === void 0 ? void 0 : _a.code) {
|
|
29
|
+
return `{${json.bindings._text.code}}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
if (json.properties._text) {
|
|
34
|
+
return `<>${json.properties._text}</>`;
|
|
35
|
+
}
|
|
36
|
+
if ((_b = json.bindings._text) === null || _b === void 0 ? void 0 : _b.code) {
|
|
37
|
+
return `${json.bindings._text.code}`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if ((0, mitosis_node_1.checkIsForNode)(json)) {
|
|
41
|
+
const needsWrapper = json.children.length !== 1;
|
|
42
|
+
// The SolidJS `<For>` component has a special index() signal function.
|
|
43
|
+
// https://www.solidjs.com/docs/latest#%3Cfor%3E
|
|
44
|
+
return `<For each={${(_c = json.bindings.each) === null || _c === void 0 ? void 0 : _c.code}}>
|
|
45
|
+
{(${json.scope.forName}, _index) => {
|
|
46
|
+
const ${json.scope.indexName || 'index'} = _index();
|
|
47
|
+
return ${needsWrapper ? '<>' : ''}${json.children
|
|
48
|
+
.filter(filter_empty_text_nodes_1.filterEmptyTextNodes)
|
|
49
|
+
.map((child) => (0, exports.blockToSolid)(child, component, options, needsWrapper))}}}
|
|
50
|
+
${needsWrapper ? '</>' : ''}
|
|
51
|
+
</For>`;
|
|
52
|
+
}
|
|
53
|
+
let str = '';
|
|
54
|
+
const isFragment = json.name === 'Fragment';
|
|
55
|
+
if (isFragment) {
|
|
56
|
+
str += '<';
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
str += `<${json.name} `;
|
|
60
|
+
}
|
|
61
|
+
if (json.name === 'Show' && (0, is_mitosis_node_1.isMitosisNode)(json.meta.else)) {
|
|
62
|
+
str += `fallback={${(0, exports.blockToSolid)(json.meta.else, component, options, false)}}`;
|
|
63
|
+
}
|
|
64
|
+
const classString = (0, styles_1.collectClassString)(json, options);
|
|
65
|
+
if (classString && !isFragment) {
|
|
66
|
+
str += ` class=${classString} `;
|
|
67
|
+
}
|
|
68
|
+
for (const key in json.properties) {
|
|
69
|
+
if (isFragment)
|
|
70
|
+
continue;
|
|
71
|
+
const value = json.properties[key];
|
|
72
|
+
const newKey = transformAttributeName(key);
|
|
73
|
+
str += ` ${newKey}="${value}" `;
|
|
74
|
+
}
|
|
75
|
+
for (const key in json.bindings) {
|
|
76
|
+
if (isFragment)
|
|
77
|
+
continue;
|
|
78
|
+
const { code, arguments: cusArg = ['event'], type } = json.bindings[key];
|
|
79
|
+
if (!code)
|
|
80
|
+
continue;
|
|
81
|
+
if (type === 'spread') {
|
|
82
|
+
str += ` {...(${code})} `;
|
|
83
|
+
}
|
|
84
|
+
else if ((0, event_handlers_1.checkIsEvent)(key)) {
|
|
85
|
+
const useKey = key === 'onChange' && json.name === 'input' ? 'onInput' : key;
|
|
86
|
+
const asyncKeyword = ((_d = json.bindings[key]) === null || _d === void 0 ? void 0 : _d.async) ? 'async ' : '';
|
|
87
|
+
str += ` ${useKey}={${asyncKeyword}(${cusArg.join(',')}) => ${code}} `;
|
|
88
|
+
}
|
|
89
|
+
else if (key === 'ref' && options.typescript) {
|
|
90
|
+
str += ` ${key}={${code}!} `;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
let useValue = code;
|
|
94
|
+
if (key === 'style') {
|
|
95
|
+
// Convert camelCase keys to kebab-case
|
|
96
|
+
// TODO: support more than top level objects, may need
|
|
97
|
+
// a runtime helper for expressions that are not a direct
|
|
98
|
+
// object literal, such as ternaries and other expression
|
|
99
|
+
// types
|
|
100
|
+
useValue = (0, babel_transform_1.babelTransformExpression)(code, {
|
|
101
|
+
ObjectExpression(path) {
|
|
102
|
+
// TODO: limit to top level objects only
|
|
103
|
+
for (const property of path.node.properties) {
|
|
104
|
+
if (core_1.types.isObjectProperty(property)) {
|
|
105
|
+
if (core_1.types.isIdentifier(property.key) || core_1.types.isStringLiteral(property.key)) {
|
|
106
|
+
const key = core_1.types.isIdentifier(property.key)
|
|
107
|
+
? property.key.name
|
|
108
|
+
: property.key.value;
|
|
109
|
+
property.key = core_1.types.stringLiteral((0, lodash_1.kebabCase)(key));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const newKey = transformAttributeName(key);
|
|
117
|
+
str += ` ${newKey}={${useValue}} `;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(json.name)) {
|
|
121
|
+
return str + ' />';
|
|
122
|
+
}
|
|
123
|
+
str += '>';
|
|
124
|
+
if (json.children) {
|
|
125
|
+
str += json.children
|
|
126
|
+
.filter(filter_empty_text_nodes_1.filterEmptyTextNodes)
|
|
127
|
+
.map((item) => (0, exports.blockToSolid)(item, component, options, true))
|
|
128
|
+
.join('\n');
|
|
129
|
+
}
|
|
130
|
+
if (isFragment) {
|
|
131
|
+
str += '</>';
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
str += `</${json.name}>`;
|
|
135
|
+
}
|
|
136
|
+
return str;
|
|
137
|
+
};
|
|
138
|
+
exports.blockToSolid = blockToSolid;
|