@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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isComponent = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* This node is a component, vs a plain html tag (<Foo> vs <div>)
|
|
6
|
+
*/
|
|
7
|
+
const isComponent = (json) => json.name.toLowerCase() !== json.name;
|
|
8
|
+
exports.isComponent = isComponent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isHookEmpty = void 0;
|
|
4
|
+
const isHookEmpty = (hook) => {
|
|
5
|
+
var _a;
|
|
6
|
+
if (!hook) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (Array.isArray(hook)) {
|
|
10
|
+
return hook.every((h) => (0, exports.isHookEmpty)(h));
|
|
11
|
+
}
|
|
12
|
+
return !((_a = hook.code) === null || _a === void 0 ? void 0 : _a.trim());
|
|
13
|
+
};
|
|
14
|
+
exports.isHookEmpty = isHookEmpty;
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isHtmlAttribute = exports.htmlElementAttributes = void 0;
|
|
4
|
+
exports.htmlElementAttributes = {
|
|
5
|
+
'*': [
|
|
6
|
+
'accesskey',
|
|
7
|
+
'autocapitalize',
|
|
8
|
+
'autofocus',
|
|
9
|
+
'class',
|
|
10
|
+
'contenteditable',
|
|
11
|
+
'dir',
|
|
12
|
+
'draggable',
|
|
13
|
+
'enterkeyhint',
|
|
14
|
+
'hidden',
|
|
15
|
+
'id',
|
|
16
|
+
'inputmode',
|
|
17
|
+
'is',
|
|
18
|
+
'itemid',
|
|
19
|
+
'itemprop',
|
|
20
|
+
'itemref',
|
|
21
|
+
'itemscope',
|
|
22
|
+
'itemtype',
|
|
23
|
+
'lang',
|
|
24
|
+
'nonce',
|
|
25
|
+
'slot',
|
|
26
|
+
'spellcheck',
|
|
27
|
+
'style',
|
|
28
|
+
'tabindex',
|
|
29
|
+
'title',
|
|
30
|
+
'translate',
|
|
31
|
+
],
|
|
32
|
+
a: [
|
|
33
|
+
'charset',
|
|
34
|
+
'coords',
|
|
35
|
+
'download',
|
|
36
|
+
'href',
|
|
37
|
+
'hreflang',
|
|
38
|
+
'name',
|
|
39
|
+
'ping',
|
|
40
|
+
'referrerpolicy',
|
|
41
|
+
'rel',
|
|
42
|
+
'rev',
|
|
43
|
+
'shape',
|
|
44
|
+
'target',
|
|
45
|
+
'type',
|
|
46
|
+
],
|
|
47
|
+
applet: [
|
|
48
|
+
'align',
|
|
49
|
+
'alt',
|
|
50
|
+
'archive',
|
|
51
|
+
'code',
|
|
52
|
+
'codebase',
|
|
53
|
+
'height',
|
|
54
|
+
'hspace',
|
|
55
|
+
'name',
|
|
56
|
+
'object',
|
|
57
|
+
'vspace',
|
|
58
|
+
'width',
|
|
59
|
+
],
|
|
60
|
+
area: [
|
|
61
|
+
'alt',
|
|
62
|
+
'coords',
|
|
63
|
+
'download',
|
|
64
|
+
'href',
|
|
65
|
+
'hreflang',
|
|
66
|
+
'nohref',
|
|
67
|
+
'ping',
|
|
68
|
+
'referrerpolicy',
|
|
69
|
+
'rel',
|
|
70
|
+
'shape',
|
|
71
|
+
'target',
|
|
72
|
+
'type',
|
|
73
|
+
],
|
|
74
|
+
audio: ['autoplay', 'controls', 'crossorigin', 'loop', 'muted', 'preload', 'src'],
|
|
75
|
+
base: ['href', 'target'],
|
|
76
|
+
basefont: ['color', 'face', 'size'],
|
|
77
|
+
blockquote: ['cite'],
|
|
78
|
+
body: ['alink', 'background', 'bgcolor', 'link', 'text', 'vlink'],
|
|
79
|
+
br: ['clear'],
|
|
80
|
+
button: [
|
|
81
|
+
'disabled',
|
|
82
|
+
'form',
|
|
83
|
+
'formaction',
|
|
84
|
+
'formenctype',
|
|
85
|
+
'formmethod',
|
|
86
|
+
'formnovalidate',
|
|
87
|
+
'formtarget',
|
|
88
|
+
'name',
|
|
89
|
+
'type',
|
|
90
|
+
'value',
|
|
91
|
+
],
|
|
92
|
+
canvas: ['height', 'width'],
|
|
93
|
+
caption: ['align'],
|
|
94
|
+
col: ['align', 'char', 'charoff', 'span', 'valign', 'width'],
|
|
95
|
+
colgroup: ['align', 'char', 'charoff', 'span', 'valign', 'width'],
|
|
96
|
+
data: ['value'],
|
|
97
|
+
del: ['cite', 'datetime'],
|
|
98
|
+
details: ['open'],
|
|
99
|
+
dialog: ['open'],
|
|
100
|
+
dir: ['compact'],
|
|
101
|
+
div: ['align'],
|
|
102
|
+
dl: ['compact'],
|
|
103
|
+
embed: ['height', 'src', 'type', 'width'],
|
|
104
|
+
fieldset: ['disabled', 'form', 'name'],
|
|
105
|
+
font: ['color', 'face', 'size'],
|
|
106
|
+
form: [
|
|
107
|
+
'accept',
|
|
108
|
+
'accept-charset',
|
|
109
|
+
'action',
|
|
110
|
+
'autocomplete',
|
|
111
|
+
'enctype',
|
|
112
|
+
'method',
|
|
113
|
+
'name',
|
|
114
|
+
'novalidate',
|
|
115
|
+
'target',
|
|
116
|
+
],
|
|
117
|
+
frame: [
|
|
118
|
+
'frameborder',
|
|
119
|
+
'longdesc',
|
|
120
|
+
'marginheight',
|
|
121
|
+
'marginwidth',
|
|
122
|
+
'name',
|
|
123
|
+
'noresize',
|
|
124
|
+
'scrolling',
|
|
125
|
+
'src',
|
|
126
|
+
],
|
|
127
|
+
frameset: ['cols', 'rows'],
|
|
128
|
+
h1: ['align'],
|
|
129
|
+
h2: ['align'],
|
|
130
|
+
h3: ['align'],
|
|
131
|
+
h4: ['align'],
|
|
132
|
+
h5: ['align'],
|
|
133
|
+
h6: ['align'],
|
|
134
|
+
head: ['profile'],
|
|
135
|
+
hr: ['align', 'noshade', 'size', 'width'],
|
|
136
|
+
html: ['manifest', 'version'],
|
|
137
|
+
iframe: [
|
|
138
|
+
'align',
|
|
139
|
+
'allow',
|
|
140
|
+
'allowfullscreen',
|
|
141
|
+
'allowpaymentrequest',
|
|
142
|
+
'allowusermedia',
|
|
143
|
+
'frameborder',
|
|
144
|
+
'height',
|
|
145
|
+
'loading',
|
|
146
|
+
'longdesc',
|
|
147
|
+
'marginheight',
|
|
148
|
+
'marginwidth',
|
|
149
|
+
'name',
|
|
150
|
+
'referrerpolicy',
|
|
151
|
+
'sandbox',
|
|
152
|
+
'scrolling',
|
|
153
|
+
'src',
|
|
154
|
+
'srcdoc',
|
|
155
|
+
'width',
|
|
156
|
+
],
|
|
157
|
+
img: [
|
|
158
|
+
'align',
|
|
159
|
+
'alt',
|
|
160
|
+
'border',
|
|
161
|
+
'crossorigin',
|
|
162
|
+
'decoding',
|
|
163
|
+
'height',
|
|
164
|
+
'hspace',
|
|
165
|
+
'ismap',
|
|
166
|
+
'loading',
|
|
167
|
+
'longdesc',
|
|
168
|
+
'name',
|
|
169
|
+
'referrerpolicy',
|
|
170
|
+
'sizes',
|
|
171
|
+
'src',
|
|
172
|
+
'srcset',
|
|
173
|
+
'usemap',
|
|
174
|
+
'vspace',
|
|
175
|
+
'width',
|
|
176
|
+
],
|
|
177
|
+
input: [
|
|
178
|
+
'accept',
|
|
179
|
+
'align',
|
|
180
|
+
'alt',
|
|
181
|
+
'autocomplete',
|
|
182
|
+
'checked',
|
|
183
|
+
'dirname',
|
|
184
|
+
'disabled',
|
|
185
|
+
'form',
|
|
186
|
+
'formaction',
|
|
187
|
+
'formenctype',
|
|
188
|
+
'formmethod',
|
|
189
|
+
'formnovalidate',
|
|
190
|
+
'formtarget',
|
|
191
|
+
'height',
|
|
192
|
+
'ismap',
|
|
193
|
+
'list',
|
|
194
|
+
'max',
|
|
195
|
+
'maxlength',
|
|
196
|
+
'min',
|
|
197
|
+
'minlength',
|
|
198
|
+
'multiple',
|
|
199
|
+
'name',
|
|
200
|
+
'pattern',
|
|
201
|
+
'placeholder',
|
|
202
|
+
'readonly',
|
|
203
|
+
'required',
|
|
204
|
+
'size',
|
|
205
|
+
'src',
|
|
206
|
+
'step',
|
|
207
|
+
'type',
|
|
208
|
+
'usemap',
|
|
209
|
+
'value',
|
|
210
|
+
'width',
|
|
211
|
+
],
|
|
212
|
+
ins: ['cite', 'datetime'],
|
|
213
|
+
isindex: ['prompt'],
|
|
214
|
+
label: ['for', 'form'],
|
|
215
|
+
legend: ['align'],
|
|
216
|
+
li: ['type', 'value'],
|
|
217
|
+
link: [
|
|
218
|
+
'as',
|
|
219
|
+
'charset',
|
|
220
|
+
'color',
|
|
221
|
+
'crossorigin',
|
|
222
|
+
'disabled',
|
|
223
|
+
'href',
|
|
224
|
+
'hreflang',
|
|
225
|
+
'imagesizes',
|
|
226
|
+
'imagesrcset',
|
|
227
|
+
'integrity',
|
|
228
|
+
'media',
|
|
229
|
+
'referrerpolicy',
|
|
230
|
+
'rel',
|
|
231
|
+
'rev',
|
|
232
|
+
'sizes',
|
|
233
|
+
'target',
|
|
234
|
+
'type',
|
|
235
|
+
],
|
|
236
|
+
map: ['name'],
|
|
237
|
+
menu: ['compact'],
|
|
238
|
+
meta: ['charset', 'content', 'http-equiv', 'media', 'name', 'scheme'],
|
|
239
|
+
meter: ['high', 'low', 'max', 'min', 'optimum', 'value'],
|
|
240
|
+
object: [
|
|
241
|
+
'align',
|
|
242
|
+
'archive',
|
|
243
|
+
'border',
|
|
244
|
+
'classid',
|
|
245
|
+
'codebase',
|
|
246
|
+
'codetype',
|
|
247
|
+
'data',
|
|
248
|
+
'declare',
|
|
249
|
+
'form',
|
|
250
|
+
'height',
|
|
251
|
+
'hspace',
|
|
252
|
+
'name',
|
|
253
|
+
'standby',
|
|
254
|
+
'type',
|
|
255
|
+
'typemustmatch',
|
|
256
|
+
'usemap',
|
|
257
|
+
'vspace',
|
|
258
|
+
'width',
|
|
259
|
+
],
|
|
260
|
+
ol: ['compact', 'reversed', 'start', 'type'],
|
|
261
|
+
optgroup: ['disabled', 'label'],
|
|
262
|
+
option: ['disabled', 'label', 'selected', 'value'],
|
|
263
|
+
output: ['for', 'form', 'name'],
|
|
264
|
+
p: ['align'],
|
|
265
|
+
param: ['name', 'type', 'value', 'valuetype'],
|
|
266
|
+
pre: ['width'],
|
|
267
|
+
progress: ['max', 'value'],
|
|
268
|
+
q: ['cite'],
|
|
269
|
+
script: [
|
|
270
|
+
'async',
|
|
271
|
+
'charset',
|
|
272
|
+
'crossorigin',
|
|
273
|
+
'defer',
|
|
274
|
+
'integrity',
|
|
275
|
+
'language',
|
|
276
|
+
'nomodule',
|
|
277
|
+
'referrerpolicy',
|
|
278
|
+
'src',
|
|
279
|
+
'type',
|
|
280
|
+
],
|
|
281
|
+
select: ['autocomplete', 'disabled', 'form', 'multiple', 'name', 'required', 'size'],
|
|
282
|
+
slot: ['name'],
|
|
283
|
+
source: ['height', 'media', 'sizes', 'src', 'srcset', 'type', 'width'],
|
|
284
|
+
style: ['media', 'type'],
|
|
285
|
+
table: [
|
|
286
|
+
'align',
|
|
287
|
+
'bgcolor',
|
|
288
|
+
'border',
|
|
289
|
+
'cellpadding',
|
|
290
|
+
'cellspacing',
|
|
291
|
+
'frame',
|
|
292
|
+
'rules',
|
|
293
|
+
'summary',
|
|
294
|
+
'width',
|
|
295
|
+
],
|
|
296
|
+
tbody: ['align', 'char', 'charoff', 'valign'],
|
|
297
|
+
td: [
|
|
298
|
+
'abbr',
|
|
299
|
+
'align',
|
|
300
|
+
'axis',
|
|
301
|
+
'bgcolor',
|
|
302
|
+
'char',
|
|
303
|
+
'charoff',
|
|
304
|
+
'colspan',
|
|
305
|
+
'headers',
|
|
306
|
+
'height',
|
|
307
|
+
'nowrap',
|
|
308
|
+
'rowspan',
|
|
309
|
+
'scope',
|
|
310
|
+
'valign',
|
|
311
|
+
'width',
|
|
312
|
+
],
|
|
313
|
+
textarea: [
|
|
314
|
+
'autocomplete',
|
|
315
|
+
'cols',
|
|
316
|
+
'dirname',
|
|
317
|
+
'disabled',
|
|
318
|
+
'form',
|
|
319
|
+
'maxlength',
|
|
320
|
+
'minlength',
|
|
321
|
+
'name',
|
|
322
|
+
'placeholder',
|
|
323
|
+
'readonly',
|
|
324
|
+
'required',
|
|
325
|
+
'rows',
|
|
326
|
+
'wrap',
|
|
327
|
+
],
|
|
328
|
+
tfoot: ['align', 'char', 'charoff', 'valign'],
|
|
329
|
+
th: [
|
|
330
|
+
'abbr',
|
|
331
|
+
'align',
|
|
332
|
+
'axis',
|
|
333
|
+
'bgcolor',
|
|
334
|
+
'char',
|
|
335
|
+
'charoff',
|
|
336
|
+
'colspan',
|
|
337
|
+
'headers',
|
|
338
|
+
'height',
|
|
339
|
+
'nowrap',
|
|
340
|
+
'rowspan',
|
|
341
|
+
'scope',
|
|
342
|
+
'valign',
|
|
343
|
+
'width',
|
|
344
|
+
],
|
|
345
|
+
thead: ['align', 'char', 'charoff', 'valign'],
|
|
346
|
+
time: ['datetime'],
|
|
347
|
+
tr: ['align', 'bgcolor', 'char', 'charoff', 'valign'],
|
|
348
|
+
track: ['default', 'kind', 'label', 'src', 'srclang'],
|
|
349
|
+
ul: ['compact', 'type'],
|
|
350
|
+
video: [
|
|
351
|
+
'autoplay',
|
|
352
|
+
'controls',
|
|
353
|
+
'crossorigin',
|
|
354
|
+
'height',
|
|
355
|
+
'loop',
|
|
356
|
+
'muted',
|
|
357
|
+
'playsinline',
|
|
358
|
+
'poster',
|
|
359
|
+
'preload',
|
|
360
|
+
'src',
|
|
361
|
+
'width',
|
|
362
|
+
],
|
|
363
|
+
};
|
|
364
|
+
const isHtmlAttribute = (attr, tagName) => {
|
|
365
|
+
if (/role|aria-/.test(attr)) {
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
const getAttr = [...exports.htmlElementAttributes['*'], ...(exports.htmlElementAttributes[tagName] || [])].find((attribute) => attr === attribute);
|
|
369
|
+
return Boolean(getAttr);
|
|
370
|
+
};
|
|
371
|
+
exports.isHtmlAttribute = isHtmlAttribute;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMitosisNode = void 0;
|
|
4
|
+
const isMitosisNode = (thing) => {
|
|
5
|
+
return Boolean(thing && thing['@type'] === '@builder.io/mitosis/node');
|
|
6
|
+
};
|
|
7
|
+
exports.isMitosisNode = isMitosisNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTextNode = exports.isRootTextNode = void 0;
|
|
4
|
+
function isRootTextNode(json) {
|
|
5
|
+
const firstChild = json.children[0];
|
|
6
|
+
return Boolean(json.children.length === 1 && firstChild && isTextNode(firstChild));
|
|
7
|
+
}
|
|
8
|
+
exports.isRootTextNode = isRootTextNode;
|
|
9
|
+
function isTextNode(node) {
|
|
10
|
+
return Boolean(node.properties._text || node.bindings._text);
|
|
11
|
+
}
|
|
12
|
+
exports.isTextNode = isTextNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isUpperCase: (str: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isValidAttributeName: (str: string) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isValidAttributeName = void 0;
|
|
4
|
+
const isValidAttributeName = (str) => {
|
|
5
|
+
return Boolean(str && /^[a-z0-9\-_:]+$/i.test(str));
|
|
6
|
+
};
|
|
7
|
+
exports.isValidAttributeName = isValidAttributeName;
|
|
@@ -0,0 +1,17 @@
|
|
|
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.tryParseJson = void 0;
|
|
7
|
+
const json5_1 = __importDefault(require("json5"));
|
|
8
|
+
const tryParseJson = (jsonStr) => {
|
|
9
|
+
try {
|
|
10
|
+
return json5_1.default.parse(jsonStr);
|
|
11
|
+
}
|
|
12
|
+
catch (err) {
|
|
13
|
+
console.error('Could not JSON5 parse object:\n', jsonStr);
|
|
14
|
+
throw err;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.tryParseJson = tryParseJson;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NodePath } from '@babel/core';
|
|
2
|
+
import { types } from '@babel/core';
|
|
3
|
+
import { CodeType } from '../helpers/plugins/process-code/types';
|
|
4
|
+
import { MitosisComponent } from '../types/mitosis-component';
|
|
5
|
+
export type RefMapper = (refName: string, extra?: {
|
|
6
|
+
type?: CodeType;
|
|
7
|
+
path: NodePath<types.Identifier>;
|
|
8
|
+
}) => string;
|
|
9
|
+
export declare const mapRefs: (component: MitosisComponent, mapper: RefMapper) => void;
|
|
@@ -0,0 +1,91 @@
|
|
|
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.mapRefs = void 0;
|
|
7
|
+
const core_1 = require("@babel/core");
|
|
8
|
+
const legacy_1 = __importDefault(require("neotraverse/legacy"));
|
|
9
|
+
const babel_transform_1 = require("./babel-transform");
|
|
10
|
+
const get_refs_1 = require("./get-refs");
|
|
11
|
+
const is_mitosis_node_1 = require("./is-mitosis-node");
|
|
12
|
+
const patterns_1 = require("./patterns");
|
|
13
|
+
const replaceRefsInString = (code, refs, mapper, type) => {
|
|
14
|
+
return (0, babel_transform_1.babelTransformExpression)(code, {
|
|
15
|
+
Identifier(path) {
|
|
16
|
+
var _a;
|
|
17
|
+
const name = path.node.name;
|
|
18
|
+
const isRef = refs.includes(name);
|
|
19
|
+
if (isRef && !((_a = path.node.extra) === null || _a === void 0 ? void 0 : _a.replaced)) {
|
|
20
|
+
path.replaceWith(core_1.types.identifier(mapper(name, {
|
|
21
|
+
type,
|
|
22
|
+
path,
|
|
23
|
+
})));
|
|
24
|
+
path.node.extra = { replaced: true };
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const mapRefs = (component, mapper) => {
|
|
30
|
+
const refSet = (0, get_refs_1.getRefs)(component);
|
|
31
|
+
// grab refs not used for bindings
|
|
32
|
+
Object.keys(component.refs).forEach((ref) => refSet.add(ref));
|
|
33
|
+
const refs = Array.from(refSet);
|
|
34
|
+
for (const key of Object.keys(component.state)) {
|
|
35
|
+
const stateVal = component.state[key];
|
|
36
|
+
if (typeof (stateVal === null || stateVal === void 0 ? void 0 : stateVal.code) === 'string') {
|
|
37
|
+
const value = stateVal.code;
|
|
38
|
+
switch (stateVal.type) {
|
|
39
|
+
case 'method':
|
|
40
|
+
case 'getter':
|
|
41
|
+
const isGet = stateVal.type === 'getter';
|
|
42
|
+
const isSet = Boolean(value.match(patterns_1.SETTER));
|
|
43
|
+
component.state[key] = {
|
|
44
|
+
...stateVal,
|
|
45
|
+
code: replaceRefsInString(value.replace(/^(get |set )?/, 'function '), refs, mapper).replace(/^function /, isGet ? 'get ' : isSet ? 'set ' : ''),
|
|
46
|
+
};
|
|
47
|
+
break;
|
|
48
|
+
case 'function':
|
|
49
|
+
component.state[key] = {
|
|
50
|
+
...stateVal,
|
|
51
|
+
code: replaceRefsInString(value, refs, mapper),
|
|
52
|
+
type: 'function',
|
|
53
|
+
};
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
(0, legacy_1.default)(component).forEach(function (item) {
|
|
61
|
+
if ((0, is_mitosis_node_1.isMitosisNode)(item)) {
|
|
62
|
+
for (const key of Object.keys(item.bindings)) {
|
|
63
|
+
const value = item.bindings[key];
|
|
64
|
+
if (typeof value === 'object' && key !== 'ref') {
|
|
65
|
+
item.bindings[key] = {
|
|
66
|
+
...value,
|
|
67
|
+
code: replaceRefsInString(value.code, refs, mapper, 'bindings'),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
for (const key of Object.keys(component.hooks)) {
|
|
74
|
+
const _hook = component.hooks[key];
|
|
75
|
+
const hooks = Array.isArray(_hook) ? _hook : [_hook];
|
|
76
|
+
for (const hook of hooks) {
|
|
77
|
+
if (!hook)
|
|
78
|
+
continue;
|
|
79
|
+
if (hook.code) {
|
|
80
|
+
hook.code = replaceRefsInString(hook.code, refs, mapper);
|
|
81
|
+
}
|
|
82
|
+
if (hook.deps) {
|
|
83
|
+
hook.deps = replaceRefsInString(hook.deps, refs, mapper, 'hooks-deps');
|
|
84
|
+
}
|
|
85
|
+
if (hook === null || hook === void 0 ? void 0 : hook.depsArray) {
|
|
86
|
+
hook.depsArray = hook.depsArray.map((dep) => replaceRefsInString(dep, refs, mapper, 'hooks-deps-array'));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
exports.mapRefs = mapRefs;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseTranspilerOptions, MitosisComponent, Target } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* Merges options while combining the `plugins` array, and adds any default plugins.
|
|
4
|
+
*/
|
|
5
|
+
export declare const mergeOptions: <T extends BaseTranspilerOptions>(a: T, b?: Partial<T>, c?: Partial<T> | undefined, d?: Partial<T> | undefined) => T & {
|
|
6
|
+
plugins: NonNullable<T["plugins"]>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Merges options while combining the `plugins` array, and adds any default plugins.
|
|
10
|
+
*/
|
|
11
|
+
export declare const initializeOptions: <T extends BaseTranspilerOptions>({ target, component, defaults, userOptions, extra, }: {
|
|
12
|
+
target: Target;
|
|
13
|
+
component: MitosisComponent;
|
|
14
|
+
defaults: T;
|
|
15
|
+
userOptions?: Partial<T> | undefined;
|
|
16
|
+
extra?: Partial<T> | undefined;
|
|
17
|
+
}) => T & {
|
|
18
|
+
plugins: NonNullable<T["plugins"]>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initializeOptions = exports.mergeOptions = void 0;
|
|
4
|
+
const process_signals_1 = require("./plugins/process-signals");
|
|
5
|
+
const process_target_blocks_1 = require("./plugins/process-target-blocks");
|
|
6
|
+
/**
|
|
7
|
+
* Merges options while combining the `plugins` array, and adds any default plugins.
|
|
8
|
+
*/
|
|
9
|
+
const mergeOptions = (a, b = {}, c, d) => {
|
|
10
|
+
return {
|
|
11
|
+
...a,
|
|
12
|
+
...b,
|
|
13
|
+
...c,
|
|
14
|
+
...d,
|
|
15
|
+
plugins: [
|
|
16
|
+
...(a.plugins || []),
|
|
17
|
+
...(b.plugins || []),
|
|
18
|
+
...((c === null || c === void 0 ? void 0 : c.plugins) || []),
|
|
19
|
+
...((d === null || d === void 0 ? void 0 : d.plugins) || []),
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
exports.mergeOptions = mergeOptions;
|
|
24
|
+
/**
|
|
25
|
+
* Merges options while combining the `plugins` array, and adds any default plugins.
|
|
26
|
+
*/
|
|
27
|
+
const initializeOptions = ({ target, component, defaults, userOptions, extra, }) => {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
const metadataOverrides = (_c = (_b = (_a = component.meta) === null || _a === void 0 ? void 0 : _a.useMetadata) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c[target];
|
|
30
|
+
const options = (0, exports.mergeOptions)(defaults, userOptions, extra, metadataOverrides);
|
|
31
|
+
// we want this plugin to run first in every case, as it replaces magic strings with the correct code.
|
|
32
|
+
options.plugins.unshift((0, process_target_blocks_1.processTargetBlocks)(target), (0, process_signals_1.getSignalTypePlugin)({ target }), (0, process_signals_1.getSignalAccessPlugin)({ target }));
|
|
33
|
+
return options;
|
|
34
|
+
};
|
|
35
|
+
exports.initializeOptions = initializeOptions;
|