@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,96 @@
|
|
|
1
|
+
import { JSX } from '../jsx-runtime';
|
|
2
|
+
import { Dictionary } from './helpers/typescript';
|
|
3
|
+
import { ComponentMetadata } from './types/metadata';
|
|
4
|
+
import { ReactivityType, TargetBlock } from './types/mitosis-component';
|
|
5
|
+
export * from './flow';
|
|
6
|
+
export * from './generators/alpine';
|
|
7
|
+
export * from './generators/angular';
|
|
8
|
+
export * from './generators/builder';
|
|
9
|
+
export * from './generators/context/angular';
|
|
10
|
+
export * from './generators/context/qwik';
|
|
11
|
+
export * from './generators/context/react';
|
|
12
|
+
export * from './generators/context/rsc';
|
|
13
|
+
export * from './generators/context/solid';
|
|
14
|
+
export * from './generators/context/svelte';
|
|
15
|
+
export * from './generators/context/vue';
|
|
16
|
+
export * from './generators/html';
|
|
17
|
+
export * from './generators/liquid';
|
|
18
|
+
export * from './generators/lit';
|
|
19
|
+
export * from './generators/marko';
|
|
20
|
+
export * from './generators/mitosis';
|
|
21
|
+
export * from './generators/qwik/index';
|
|
22
|
+
export * from './generators/react';
|
|
23
|
+
export * from './generators/react-native';
|
|
24
|
+
export * from './generators/rsc';
|
|
25
|
+
export * from './generators/solid';
|
|
26
|
+
export * from './generators/stencil';
|
|
27
|
+
export * from './generators/svelte';
|
|
28
|
+
export * from './generators/swift';
|
|
29
|
+
export * from './generators/taro';
|
|
30
|
+
export * from './generators/template';
|
|
31
|
+
export * from './generators/vue';
|
|
32
|
+
export { checkIsLiteComponentFilePath, checkIsMitosisComponentFilePath, checkIsSvelteComponentFilePath, getComponentFileExtensionForTarget, renameComponentFile, renameComponentImport, renameImport, } from './helpers/component-file-extensions';
|
|
33
|
+
export { createMitosisNode } from './helpers/create-mitosis-node';
|
|
34
|
+
export * from './helpers/is-mitosis-node';
|
|
35
|
+
export { checkShouldOutputTypeScript } from './helpers/output';
|
|
36
|
+
export * from './helpers/signals';
|
|
37
|
+
export * from './helpers/typescript-project';
|
|
38
|
+
export * from './parsers/angular';
|
|
39
|
+
export * from './parsers/builder';
|
|
40
|
+
export * from './parsers/context';
|
|
41
|
+
export * from './parsers/jsx';
|
|
42
|
+
export * from './parsers/svelte';
|
|
43
|
+
export * from './plugins/compile-away-builder-components';
|
|
44
|
+
export * from './plugins/compile-away-components';
|
|
45
|
+
export * from './plugins/map-styles';
|
|
46
|
+
export * from './symbols/symbol-processor';
|
|
47
|
+
export * from './targets';
|
|
48
|
+
export * from './types/config';
|
|
49
|
+
export * from './types/mitosis-component';
|
|
50
|
+
export * from './types/mitosis-node';
|
|
51
|
+
export * from './types/plugins';
|
|
52
|
+
export * from './types/transpiler';
|
|
53
|
+
declare function Provider<T>(props: {
|
|
54
|
+
value: T;
|
|
55
|
+
children: JSX.Element;
|
|
56
|
+
}): any;
|
|
57
|
+
export type Context<T> = {
|
|
58
|
+
Provider: typeof Provider<T>;
|
|
59
|
+
};
|
|
60
|
+
export type Signal<T> = {
|
|
61
|
+
value: T;
|
|
62
|
+
};
|
|
63
|
+
export declare function useStore<T>(obj: T): T;
|
|
64
|
+
export declare function useState<T>(obj: T, args: {
|
|
65
|
+
reactive: true;
|
|
66
|
+
}): [Signal<T>, (value: T) => void];
|
|
67
|
+
export declare function useState<T>(obj: T, args?: {
|
|
68
|
+
reactive?: boolean;
|
|
69
|
+
}): [T, (value: T) => void];
|
|
70
|
+
export declare function useRef<T>(obj?: null | void | T): T;
|
|
71
|
+
export declare function useContext<T = Dictionary<any>>(key: Context<T>, type?: ReactivityType): T;
|
|
72
|
+
export declare function createContext<T = Dictionary<any>>(value: T, args: {
|
|
73
|
+
reactive: true;
|
|
74
|
+
}): Context<Signal<T>>;
|
|
75
|
+
export declare function createContext<T = Dictionary<any>>(value: T, args?: {
|
|
76
|
+
reactive?: boolean;
|
|
77
|
+
}): Context<T>;
|
|
78
|
+
export declare function setContext<T = Dictionary<any>>(key: Context<T>, value: Partial<T>, options?: {
|
|
79
|
+
type?: ReactivityType;
|
|
80
|
+
}): void;
|
|
81
|
+
export declare function onMount(fn: () => any, args?: {
|
|
82
|
+
onSSR?: boolean;
|
|
83
|
+
}): void;
|
|
84
|
+
export declare function onUpdate(fn: () => any, deps?: any[]): void;
|
|
85
|
+
export declare function onInit(fn: () => any): void;
|
|
86
|
+
export declare function onUnMount(fn: () => any): void;
|
|
87
|
+
export declare function useDynamicTag(fn: () => any): void;
|
|
88
|
+
export declare function onError(fn: () => any): void;
|
|
89
|
+
export declare function useMetadata(obj: ComponentMetadata): void;
|
|
90
|
+
export declare function useDefaultProps<T = Dictionary<any>>(value: T): T;
|
|
91
|
+
export declare function useStyle(value: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* Adds an event listener to a given element ref.
|
|
94
|
+
*/
|
|
95
|
+
export declare function onEvent<E extends Event, T extends Element>(eventName: string, fn: (event: E, element: T) => any, elementRef: T, isRoot?: boolean): void;
|
|
96
|
+
export declare function useTarget<Return>(dict: TargetBlock<Return>): Return;
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
exports.checkShouldOutputTypeScript = exports.createMitosisNode = exports.renameImport = exports.renameComponentImport = exports.renameComponentFile = exports.getComponentFileExtensionForTarget = exports.checkIsSvelteComponentFilePath = exports.checkIsMitosisComponentFilePath = exports.checkIsLiteComponentFilePath = void 0;
|
|
18
|
+
__exportStar(require("./flow"), exports);
|
|
19
|
+
__exportStar(require("./generators/alpine"), exports);
|
|
20
|
+
__exportStar(require("./generators/angular"), exports);
|
|
21
|
+
__exportStar(require("./generators/builder"), exports);
|
|
22
|
+
__exportStar(require("./generators/context/angular"), exports);
|
|
23
|
+
__exportStar(require("./generators/context/qwik"), exports);
|
|
24
|
+
__exportStar(require("./generators/context/react"), exports);
|
|
25
|
+
__exportStar(require("./generators/context/rsc"), exports);
|
|
26
|
+
__exportStar(require("./generators/context/solid"), exports);
|
|
27
|
+
__exportStar(require("./generators/context/svelte"), exports);
|
|
28
|
+
__exportStar(require("./generators/context/vue"), exports);
|
|
29
|
+
__exportStar(require("./generators/html"), exports);
|
|
30
|
+
__exportStar(require("./generators/liquid"), exports);
|
|
31
|
+
__exportStar(require("./generators/lit"), exports);
|
|
32
|
+
__exportStar(require("./generators/marko"), exports);
|
|
33
|
+
__exportStar(require("./generators/mitosis"), exports);
|
|
34
|
+
__exportStar(require("./generators/qwik/index"), exports);
|
|
35
|
+
__exportStar(require("./generators/react"), exports);
|
|
36
|
+
__exportStar(require("./generators/react-native"), exports);
|
|
37
|
+
__exportStar(require("./generators/rsc"), exports);
|
|
38
|
+
__exportStar(require("./generators/solid"), exports);
|
|
39
|
+
__exportStar(require("./generators/stencil"), exports);
|
|
40
|
+
__exportStar(require("./generators/svelte"), exports);
|
|
41
|
+
__exportStar(require("./generators/swift"), exports);
|
|
42
|
+
__exportStar(require("./generators/taro"), exports);
|
|
43
|
+
__exportStar(require("./generators/template"), exports);
|
|
44
|
+
__exportStar(require("./generators/vue"), exports);
|
|
45
|
+
var component_file_extensions_1 = require("./helpers/component-file-extensions");
|
|
46
|
+
Object.defineProperty(exports, "checkIsLiteComponentFilePath", { enumerable: true, get: function () { return component_file_extensions_1.checkIsLiteComponentFilePath; } });
|
|
47
|
+
Object.defineProperty(exports, "checkIsMitosisComponentFilePath", { enumerable: true, get: function () { return component_file_extensions_1.checkIsMitosisComponentFilePath; } });
|
|
48
|
+
Object.defineProperty(exports, "checkIsSvelteComponentFilePath", { enumerable: true, get: function () { return component_file_extensions_1.checkIsSvelteComponentFilePath; } });
|
|
49
|
+
Object.defineProperty(exports, "getComponentFileExtensionForTarget", { enumerable: true, get: function () { return component_file_extensions_1.getComponentFileExtensionForTarget; } });
|
|
50
|
+
Object.defineProperty(exports, "renameComponentFile", { enumerable: true, get: function () { return component_file_extensions_1.renameComponentFile; } });
|
|
51
|
+
Object.defineProperty(exports, "renameComponentImport", { enumerable: true, get: function () { return component_file_extensions_1.renameComponentImport; } });
|
|
52
|
+
Object.defineProperty(exports, "renameImport", { enumerable: true, get: function () { return component_file_extensions_1.renameImport; } });
|
|
53
|
+
var create_mitosis_node_1 = require("./helpers/create-mitosis-node");
|
|
54
|
+
Object.defineProperty(exports, "createMitosisNode", { enumerable: true, get: function () { return create_mitosis_node_1.createMitosisNode; } });
|
|
55
|
+
__exportStar(require("./helpers/is-mitosis-node"), exports);
|
|
56
|
+
var output_1 = require("./helpers/output");
|
|
57
|
+
Object.defineProperty(exports, "checkShouldOutputTypeScript", { enumerable: true, get: function () { return output_1.checkShouldOutputTypeScript; } });
|
|
58
|
+
__exportStar(require("./helpers/signals"), exports);
|
|
59
|
+
__exportStar(require("./helpers/typescript-project"), exports);
|
|
60
|
+
__exportStar(require("./parsers/angular"), exports);
|
|
61
|
+
__exportStar(require("./parsers/builder"), exports);
|
|
62
|
+
__exportStar(require("./parsers/context"), exports);
|
|
63
|
+
__exportStar(require("./parsers/jsx"), exports);
|
|
64
|
+
__exportStar(require("./parsers/svelte"), exports);
|
|
65
|
+
__exportStar(require("./plugins/compile-away-builder-components"), exports);
|
|
66
|
+
__exportStar(require("./plugins/compile-away-components"), exports);
|
|
67
|
+
__exportStar(require("./plugins/map-styles"), exports);
|
|
68
|
+
__exportStar(require("./symbols/symbol-processor"), exports);
|
|
69
|
+
__exportStar(require("./targets"), exports);
|
|
70
|
+
__exportStar(require("./types/config"), exports);
|
|
71
|
+
__exportStar(require("./types/mitosis-component"), exports);
|
|
72
|
+
__exportStar(require("./types/mitosis-node"), exports);
|
|
73
|
+
__exportStar(require("./types/plugins"), exports);
|
|
74
|
+
__exportStar(require("./types/transpiler"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MitosisComponent } from '../types/mitosis-component';
|
|
2
|
+
import { MitosisPlugin } from '../types/plugins';
|
|
3
|
+
export type { MitosisPlugin };
|
|
4
|
+
export declare const runPreJsonPlugins: ({ json, plugins, options, }: {
|
|
5
|
+
json: MitosisComponent;
|
|
6
|
+
plugins: MitosisPlugin[];
|
|
7
|
+
options?: any;
|
|
8
|
+
}) => MitosisComponent;
|
|
9
|
+
export declare const runPostJsonPlugins: ({ json, plugins, options, }: {
|
|
10
|
+
json: MitosisComponent;
|
|
11
|
+
plugins: MitosisPlugin[];
|
|
12
|
+
options?: any;
|
|
13
|
+
}) => MitosisComponent;
|
|
14
|
+
export declare const runPreCodePlugins: ({ code, plugins, options, json, }: {
|
|
15
|
+
json: MitosisComponent;
|
|
16
|
+
code: string;
|
|
17
|
+
plugins: MitosisPlugin[];
|
|
18
|
+
options?: any;
|
|
19
|
+
}) => string;
|
|
20
|
+
export declare const runPostCodePlugins: ({ code, plugins, options, json, }: {
|
|
21
|
+
json: MitosisComponent;
|
|
22
|
+
code: string;
|
|
23
|
+
plugins: MitosisPlugin[];
|
|
24
|
+
options?: any;
|
|
25
|
+
}) => string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runPostCodePlugins = exports.runPreCodePlugins = exports.runPostJsonPlugins = exports.runPreJsonPlugins = void 0;
|
|
4
|
+
const runPreJsonPlugins = ({ json, plugins, options, }) => {
|
|
5
|
+
var _a;
|
|
6
|
+
let useJson = json;
|
|
7
|
+
for (const plugin of plugins) {
|
|
8
|
+
const preFunction = (_a = plugin(options).json) === null || _a === void 0 ? void 0 : _a.pre;
|
|
9
|
+
if (preFunction) {
|
|
10
|
+
useJson = preFunction(json) || json;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return useJson;
|
|
14
|
+
};
|
|
15
|
+
exports.runPreJsonPlugins = runPreJsonPlugins;
|
|
16
|
+
const runPostJsonPlugins = ({ json, plugins, options, }) => {
|
|
17
|
+
var _a;
|
|
18
|
+
let useJson = json;
|
|
19
|
+
for (const plugin of plugins) {
|
|
20
|
+
const postFunction = (_a = plugin(options).json) === null || _a === void 0 ? void 0 : _a.post;
|
|
21
|
+
if (postFunction) {
|
|
22
|
+
useJson = postFunction(json) || json;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return useJson;
|
|
26
|
+
};
|
|
27
|
+
exports.runPostJsonPlugins = runPostJsonPlugins;
|
|
28
|
+
const runPreCodePlugins = ({ code, plugins, options, json, }) => {
|
|
29
|
+
var _a;
|
|
30
|
+
let string = code;
|
|
31
|
+
for (const plugin of plugins) {
|
|
32
|
+
const preFunction = (_a = plugin(options).code) === null || _a === void 0 ? void 0 : _a.pre;
|
|
33
|
+
if (preFunction) {
|
|
34
|
+
string = preFunction(string, json);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return string;
|
|
38
|
+
};
|
|
39
|
+
exports.runPreCodePlugins = runPreCodePlugins;
|
|
40
|
+
const runPostCodePlugins = ({ code, plugins, options, json, }) => {
|
|
41
|
+
var _a;
|
|
42
|
+
let string = code;
|
|
43
|
+
for (const plugin of plugins) {
|
|
44
|
+
const postFunction = (_a = plugin(options).code) === null || _a === void 0 ? void 0 : _a.post;
|
|
45
|
+
if (postFunction) {
|
|
46
|
+
string = postFunction(string, json);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return string;
|
|
50
|
+
};
|
|
51
|
+
exports.runPostCodePlugins = runPostCodePlugins;
|
|
@@ -0,0 +1,154 @@
|
|
|
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.angularToMitosisComponent = void 0;
|
|
7
|
+
const compiler_1 = require("@angular/compiler");
|
|
8
|
+
const core_1 = require("@babel/core");
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
11
|
+
const babel_transform_1 = require("../helpers/babel-transform");
|
|
12
|
+
const bindings_1 = require("../helpers/bindings");
|
|
13
|
+
const capitalize_1 = require("../helpers/capitalize");
|
|
14
|
+
const create_mitosis_component_1 = require("../helpers/create-mitosis-component");
|
|
15
|
+
const create_mitosis_node_1 = require("../helpers/create-mitosis-node");
|
|
16
|
+
const getTsAST = (code) => {
|
|
17
|
+
return typescript_1.default.createSourceFile('code.ts', code, typescript_1.default.ScriptTarget.Latest, true);
|
|
18
|
+
};
|
|
19
|
+
const transformBinding = (binding, _options) => {
|
|
20
|
+
return (0, babel_transform_1.babelTransformCode)(binding, {
|
|
21
|
+
Identifier(path) {
|
|
22
|
+
const name = path.node.name;
|
|
23
|
+
if ((core_1.types.isObjectProperty(path.parent) && path.parent.key === path.node) ||
|
|
24
|
+
(core_1.types.isMemberExpression(path.parent) && path.parent.property === path.node)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (!(name.startsWith('state.') || name === 'event' || name === '$event')) {
|
|
28
|
+
path.replaceWith(core_1.types.identifier(`state.${name}`));
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const isElement = (node) =>
|
|
34
|
+
// TODO: theres got to be a better way than this
|
|
35
|
+
Array.isArray(node.attributes);
|
|
36
|
+
const isTemplate = (node) =>
|
|
37
|
+
// TODO: theres got to be a better way than this
|
|
38
|
+
Array.isArray(node.templateAttrs);
|
|
39
|
+
const isText = (node) => typeof node.value === 'string';
|
|
40
|
+
const isBoundText = (node) => typeof node.value === 'object';
|
|
41
|
+
const angularTemplateNodeToMitosisNode = (node, options) => {
|
|
42
|
+
if (isTemplate(node)) {
|
|
43
|
+
const ngIf = node.templateAttrs.find((item) => item.name === 'ngIf');
|
|
44
|
+
if (ngIf) {
|
|
45
|
+
return (0, create_mitosis_node_1.createMitosisNode)({
|
|
46
|
+
name: 'Show',
|
|
47
|
+
bindings: {
|
|
48
|
+
when: (0, bindings_1.createSingleBinding)({
|
|
49
|
+
code: transformBinding(ngIf.value.source, options),
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
children: [angularTemplateNodeToMitosisNode((0, lodash_1.omit)(node, 'templateAttrs'), options)],
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const ngFor = node.templateAttrs.find((item) => item.name === 'ngFor');
|
|
56
|
+
if (ngFor) {
|
|
57
|
+
const value = ngFor.value.source;
|
|
58
|
+
const split = value.split(/let\s|\sof\s/);
|
|
59
|
+
const [_let, itemName, _of, expression] = split;
|
|
60
|
+
return (0, create_mitosis_node_1.createMitosisNode)({
|
|
61
|
+
name: 'For',
|
|
62
|
+
bindings: {
|
|
63
|
+
each: (0, bindings_1.createSingleBinding)({ code: transformBinding(expression, options) }),
|
|
64
|
+
},
|
|
65
|
+
scope: {
|
|
66
|
+
forName: itemName,
|
|
67
|
+
},
|
|
68
|
+
children: [angularTemplateNodeToMitosisNode((0, lodash_1.omit)(node, 'templateAttrs'), options)],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (isElement(node)) {
|
|
73
|
+
const properties = {};
|
|
74
|
+
const bindings = {};
|
|
75
|
+
for (const input of node.inputs) {
|
|
76
|
+
bindings[input.name] = (0, bindings_1.createSingleBinding)({
|
|
77
|
+
code: transformBinding(input.value.source, options),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
for (const output of node.outputs) {
|
|
81
|
+
bindings['on' + (0, capitalize_1.capitalize)(output.name)] = (0, bindings_1.createSingleBinding)({
|
|
82
|
+
code: transformBinding(output.handler
|
|
83
|
+
.source // TODO: proper reference replace
|
|
84
|
+
.replace(/\$event/g, 'event'), options),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
for (const attribute of node.attributes) {
|
|
88
|
+
properties[attribute.name] = attribute.value;
|
|
89
|
+
}
|
|
90
|
+
return (0, create_mitosis_node_1.createMitosisNode)({
|
|
91
|
+
name: node.name,
|
|
92
|
+
properties,
|
|
93
|
+
bindings: bindings,
|
|
94
|
+
children: node.children.map((node) => angularTemplateNodeToMitosisNode(node, options)),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (isText(node)) {
|
|
98
|
+
return (0, create_mitosis_node_1.createMitosisNode)({
|
|
99
|
+
properties: {
|
|
100
|
+
_text: node.value,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (isBoundText(node)) {
|
|
105
|
+
// TODO: handle the bindings
|
|
106
|
+
return (0, create_mitosis_node_1.createMitosisNode)({
|
|
107
|
+
properties: {
|
|
108
|
+
_text: node.value.source,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
throw new Error(`Element node type {${node}} is not supported`);
|
|
113
|
+
};
|
|
114
|
+
const angularTemplateToMitosisNodes = (template, options) => {
|
|
115
|
+
const ast = (0, compiler_1.parseTemplate)(template, '.');
|
|
116
|
+
const blocks = ast.nodes.map((node) => angularTemplateNodeToMitosisNode(node, options));
|
|
117
|
+
return blocks;
|
|
118
|
+
};
|
|
119
|
+
const parseTypescript = (code, options) => {
|
|
120
|
+
const component = (0, create_mitosis_component_1.createMitosisComponent)();
|
|
121
|
+
const ast = getTsAST(code);
|
|
122
|
+
for (const statement of ast.statements) {
|
|
123
|
+
if (typescript_1.default.isClassDeclaration(statement)) {
|
|
124
|
+
const decorators = typescript_1.default.canHaveDecorators(statement) ? typescript_1.default.getDecorators(statement) : undefined;
|
|
125
|
+
if (decorators) {
|
|
126
|
+
for (const decorator of decorators) {
|
|
127
|
+
// TODO: proper reference tracing
|
|
128
|
+
if (typescript_1.default.isCallExpression(decorator.expression))
|
|
129
|
+
if (typescript_1.default.isIdentifier(decorator.expression.expression) &&
|
|
130
|
+
decorator.expression.expression.text === 'Component') {
|
|
131
|
+
const firstArg = decorator.expression.arguments[0];
|
|
132
|
+
if (typescript_1.default.isObjectLiteralExpression(firstArg)) {
|
|
133
|
+
firstArg.properties.find((item) => {
|
|
134
|
+
if (typescript_1.default.isPropertyAssignment(item)) {
|
|
135
|
+
if (typescript_1.default.isIdentifier(item.name) && item.name.text === 'template') {
|
|
136
|
+
if (typescript_1.default.isTemplateLiteral(item.initializer)) {
|
|
137
|
+
const template = item.initializer.getText().trim().slice(1, -1);
|
|
138
|
+
component.children = angularTemplateToMitosisNodes(template, options);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return component;
|
|
150
|
+
};
|
|
151
|
+
function angularToMitosisComponent(code, options = {}) {
|
|
152
|
+
return parseTypescript(code, options);
|
|
153
|
+
}
|
|
154
|
+
exports.angularToMitosisComponent = angularToMitosisComponent;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { MitosisComponent, MitosisState } from '../../types/mitosis-component';
|
|
2
|
+
import { BuilderContent, BuilderElement } from '@builder.io/sdk';
|
|
3
|
+
import { MitosisNode } from '../../types/mitosis-node';
|
|
4
|
+
export declare const getStyleStringFromBlock: (block: BuilderElement, options: BuilderToMitosisOptions) => string;
|
|
5
|
+
type InternalOptions = {
|
|
6
|
+
skipMapper?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const symbolBlocksAsChildren = false;
|
|
9
|
+
type BuilderToMitosisOptions = {
|
|
10
|
+
context?: {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
};
|
|
13
|
+
includeBuilderExtras?: boolean;
|
|
14
|
+
preserveTextBlocks?: boolean;
|
|
15
|
+
includeSpecialBindings?: boolean;
|
|
16
|
+
includeMeta?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* When `true`, invalid bindings will be escaped as strings with special comments.
|
|
19
|
+
* This can then be used to have LLMs such as Claude attempt to repair the broken code.
|
|
20
|
+
* Defaults to `false`.
|
|
21
|
+
*/
|
|
22
|
+
escapeInvalidCode?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* When `true`, the `blocksSlots` field on Mitosis Nodes will be used to transform
|
|
25
|
+
* deeply nested Builder elements found in component options. Note that not every
|
|
26
|
+
* generator supports parsing `blocksSlots`.
|
|
27
|
+
* Defaults to `false`.
|
|
28
|
+
*/
|
|
29
|
+
enableBlocksSlots?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare const builderElementToMitosisNode: (block: BuilderElement, options: BuilderToMitosisOptions, _internalOptions?: InternalOptions) => MitosisNode;
|
|
32
|
+
export declare const getMetaFromBlock: (block: BuilderElement, options: BuilderToMitosisOptions) => {};
|
|
33
|
+
/**
|
|
34
|
+
* Take Builder custom jsCode and extract the contents of the useStore hook
|
|
35
|
+
* and return it as a JS object along with the inputted code with the hook
|
|
36
|
+
* code extracted
|
|
37
|
+
*/
|
|
38
|
+
export declare function extractStateHook(code: string): {
|
|
39
|
+
code: string;
|
|
40
|
+
state: MitosisState;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Extracts Mitosis state from Builder state.
|
|
44
|
+
* @param mitosisState Mitosis state to update
|
|
45
|
+
* @param builderState Builder state to extract from
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
export declare function extractMitosisStateFromBuilderState(mitosisState: MitosisState, builderState?: {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}): void;
|
|
51
|
+
export declare function convertExportDefaultToReturn(code: string): string;
|
|
52
|
+
export declare const createBuilderElement: (options?: Partial<BuilderElement>) => BuilderElement;
|
|
53
|
+
export declare const isBuilderElement: (el: unknown) => el is BuilderElement;
|
|
54
|
+
export declare const builderContentToMitosisComponent: (builderContent: BuilderContent, options?: BuilderToMitosisOptions) => MitosisComponent;
|
|
55
|
+
export {};
|