@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,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.componentToTemplate = void 0;
|
|
4
|
+
const event_handlers_1 = require("../../helpers/event-handlers");
|
|
5
|
+
const standalone_1 = require("prettier/standalone");
|
|
6
|
+
const html_tags_1 = require("../../constants/html_tags");
|
|
7
|
+
const dedent_1 = require("../../helpers/dedent");
|
|
8
|
+
const fast_clone_1 = require("../../helpers/fast-clone");
|
|
9
|
+
const get_state_object_string_1 = require("../../helpers/get-state-object-string");
|
|
10
|
+
const collect_css_1 = require("../../helpers/styles/collect-css");
|
|
11
|
+
const plugins_1 = require("../../modules/plugins");
|
|
12
|
+
const mitosis_node_1 = require("../../types/mitosis-node");
|
|
13
|
+
const mappers = {
|
|
14
|
+
Fragment: (json, options) => {
|
|
15
|
+
return `<div>${json.children.map((item) => blockToTemplate(item, options)).join('\n')}</div>`;
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
// TODO: spread support
|
|
19
|
+
const blockToTemplate = (json, options = {}) => {
|
|
20
|
+
var _a, _b, _c, _d, _e;
|
|
21
|
+
if (mappers[json.name]) {
|
|
22
|
+
return mappers[json.name](json, options);
|
|
23
|
+
}
|
|
24
|
+
if (json.properties._text) {
|
|
25
|
+
return json.properties._text;
|
|
26
|
+
}
|
|
27
|
+
if (json.bindings._text) {
|
|
28
|
+
return `\${${(_a = json.bindings._text) === null || _a === void 0 ? void 0 : _a.code}}`;
|
|
29
|
+
}
|
|
30
|
+
let str = '';
|
|
31
|
+
if ((0, mitosis_node_1.checkIsForNode)(json)) {
|
|
32
|
+
str += `\${${(_b = json.bindings.each) === null || _b === void 0 ? void 0 : _b.code}?.map(${json.scope.forName} => \``;
|
|
33
|
+
if (json.children) {
|
|
34
|
+
str += json.children.map((item) => blockToTemplate(item, options)).join('\n');
|
|
35
|
+
}
|
|
36
|
+
str += '`).join("")}';
|
|
37
|
+
}
|
|
38
|
+
else if (json.name === 'Show') {
|
|
39
|
+
str += `\${!(${(_c = json.bindings.when) === null || _c === void 0 ? void 0 : _c.code}) ? '' : \``;
|
|
40
|
+
if (json.children) {
|
|
41
|
+
str += json.children.map((item) => blockToTemplate(item, options)).join('\n');
|
|
42
|
+
}
|
|
43
|
+
str += '`}';
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
str += `<${json.name} `;
|
|
47
|
+
// TODO: JS iteration or with helper
|
|
48
|
+
// if (json.bindings._spread === '_spread') {
|
|
49
|
+
// str += `
|
|
50
|
+
// {% for _attr in ${json.bindings._spread} %}
|
|
51
|
+
// {{ _attr[0] }}="{{ _attr[1] }}"
|
|
52
|
+
// {% endfor %}
|
|
53
|
+
// `;
|
|
54
|
+
// }
|
|
55
|
+
for (const key in json.properties) {
|
|
56
|
+
const value = json.properties[key];
|
|
57
|
+
str += ` ${key}="${value}" `;
|
|
58
|
+
}
|
|
59
|
+
for (const key in json.bindings) {
|
|
60
|
+
if (((_d = json.bindings[key]) === null || _d === void 0 ? void 0 : _d.type) === 'spread' || key === 'ref' || key === 'css') {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const value = (_e = json.bindings[key]) === null || _e === void 0 ? void 0 : _e.code;
|
|
64
|
+
// TODO: proper babel transform to replace. Util for this
|
|
65
|
+
const useValue = value;
|
|
66
|
+
if ((0, event_handlers_1.checkIsEvent)(key)) {
|
|
67
|
+
// Do nothing
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
str += ` ${key}="\${${useValue}}" `;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(json.name)) {
|
|
74
|
+
return str + ' />';
|
|
75
|
+
}
|
|
76
|
+
str += '>';
|
|
77
|
+
if (json.children) {
|
|
78
|
+
str += json.children.map((item) => blockToTemplate(item, options)).join('\n');
|
|
79
|
+
}
|
|
80
|
+
str += `</${json.name}>`;
|
|
81
|
+
}
|
|
82
|
+
return str;
|
|
83
|
+
};
|
|
84
|
+
// TODO: add JS support similar to componentToHtml()
|
|
85
|
+
const componentToTemplate = (options = {}) => ({ component }) => {
|
|
86
|
+
let json = (0, fast_clone_1.fastClone)(component);
|
|
87
|
+
if (options.plugins) {
|
|
88
|
+
json = (0, plugins_1.runPreJsonPlugins)({ json, plugins: options.plugins });
|
|
89
|
+
}
|
|
90
|
+
const css = (0, collect_css_1.collectCss)(json);
|
|
91
|
+
if (options.plugins) {
|
|
92
|
+
json = (0, plugins_1.runPostJsonPlugins)({ json, plugins: options.plugins });
|
|
93
|
+
}
|
|
94
|
+
let str = json.children.map((item) => blockToTemplate(item)).join('\n');
|
|
95
|
+
if (css.trim().length) {
|
|
96
|
+
str += `<style>${css}</style>`;
|
|
97
|
+
}
|
|
98
|
+
str = (0, dedent_1.dedent) `
|
|
99
|
+
export default function template(props) {
|
|
100
|
+
let state = ${(0, get_state_object_string_1.getStateObjectStringFromComponent)(json)}
|
|
101
|
+
|
|
102
|
+
return \`${str.replace(/\s+/g, ' ')}\`
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
`;
|
|
106
|
+
if (options.plugins) {
|
|
107
|
+
str = (0, plugins_1.runPreCodePlugins)({ json, code: str, plugins: options.plugins });
|
|
108
|
+
}
|
|
109
|
+
if (options.prettier !== false) {
|
|
110
|
+
try {
|
|
111
|
+
str = (0, standalone_1.format)(str, {
|
|
112
|
+
parser: 'typescript',
|
|
113
|
+
htmlWhitespaceSensitivity: 'ignore',
|
|
114
|
+
plugins: [
|
|
115
|
+
// To support running in browsers
|
|
116
|
+
require('prettier/parser-typescript'),
|
|
117
|
+
require('prettier/parser-postcss'),
|
|
118
|
+
require('prettier/parser-babel'),
|
|
119
|
+
],
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
console.warn('Could not prettify', { string: str }, err);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (options.plugins) {
|
|
127
|
+
str = (0, plugins_1.runPostCodePlugins)({ json, code: str, plugins: options.plugins });
|
|
128
|
+
}
|
|
129
|
+
return str;
|
|
130
|
+
};
|
|
131
|
+
exports.componentToTemplate = componentToTemplate;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./generator"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MitosisNode } from '../../types/mitosis-node';
|
|
2
|
+
import { ToVueOptions } from './types';
|
|
3
|
+
type BlockRenderer = (json: MitosisNode, options: ToVueOptions, scope?: Scope) => string;
|
|
4
|
+
interface Scope {
|
|
5
|
+
isRootNode?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const blockToVue: BlockRenderer;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,217 @@
|
|
|
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.blockToVue = void 0;
|
|
7
|
+
const bindings_1 = require("../../helpers/bindings");
|
|
8
|
+
const event_handlers_1 = require("../../helpers/event-handlers");
|
|
9
|
+
const filter_empty_text_nodes_1 = require("../../helpers/filter-empty-text-nodes");
|
|
10
|
+
const is_children_1 = __importDefault(require("../../helpers/is-children"));
|
|
11
|
+
const is_mitosis_node_1 = require("../../helpers/is-mitosis-node");
|
|
12
|
+
const nullable_1 = require("../../helpers/nullable");
|
|
13
|
+
const remove_surrounding_block_1 = require("../../helpers/remove-surrounding-block");
|
|
14
|
+
const replace_identifiers_1 = require("../../helpers/replace-identifiers");
|
|
15
|
+
const slots_1 = require("../../helpers/slots");
|
|
16
|
+
const function_1 = require("fp-ts/lib/function");
|
|
17
|
+
const html_tags_1 = require("../../constants/html_tags");
|
|
18
|
+
const helpers_1 = require("./helpers");
|
|
19
|
+
const SPECIAL_PROPERTIES = {
|
|
20
|
+
V_IF: 'v-if',
|
|
21
|
+
V_FOR: 'v-for',
|
|
22
|
+
V_ELSE: 'v-else',
|
|
23
|
+
V_ELSE_IF: 'v-else-if',
|
|
24
|
+
V_ON: 'v-on',
|
|
25
|
+
V_ON_AT: '@',
|
|
26
|
+
V_BIND: 'v-bind',
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* blockToVue executed after processBinding,
|
|
30
|
+
* when processBinding is executed,
|
|
31
|
+
* SLOT_PREFIX from `slot` change to `$slots.`
|
|
32
|
+
*/
|
|
33
|
+
const SLOT_PREFIX = '$slots.';
|
|
34
|
+
// TODO: Maybe in the future allow defining `string | function` as values
|
|
35
|
+
const BINDING_MAPPERS = {
|
|
36
|
+
innerHTML: 'v-html',
|
|
37
|
+
};
|
|
38
|
+
const NODE_MAPPERS = {
|
|
39
|
+
Fragment(json, options, scope) {
|
|
40
|
+
const children = json.children.filter(filter_empty_text_nodes_1.filterEmptyTextNodes);
|
|
41
|
+
const childrenStr = children.map((item) => (0, exports.blockToVue)(item, options)).join('\n');
|
|
42
|
+
return childrenStr;
|
|
43
|
+
},
|
|
44
|
+
For(_json, options) {
|
|
45
|
+
var _a, _b, _c, _d;
|
|
46
|
+
const json = _json;
|
|
47
|
+
const keyValue = json.bindings.key || { code: (_a = json.scope.indexName) !== null && _a !== void 0 ? _a : 'index', type: 'single' };
|
|
48
|
+
const forValue = `(${(_b = json.scope.forName) !== null && _b !== void 0 ? _b : '_'}, ${(_c = json.scope.indexName) !== null && _c !== void 0 ? _c : 'index'}) in ${(_d = json.bindings.each) === null || _d === void 0 ? void 0 : _d.code}`;
|
|
49
|
+
// TODO: tmk key goes on different element (parent vs child) based on Vue 2 vs Vue 3
|
|
50
|
+
return `<template :key="${(0, helpers_1.encodeQuotes)((keyValue === null || keyValue === void 0 ? void 0 : keyValue.code) || 'index')}" v-for="${(0, helpers_1.encodeQuotes)(forValue)}">
|
|
51
|
+
${json.children.map((item) => (0, exports.blockToVue)(item, options)).join('\n')}
|
|
52
|
+
</template>`;
|
|
53
|
+
},
|
|
54
|
+
Show(json, options, scope) {
|
|
55
|
+
var _a;
|
|
56
|
+
const ifValue = ((_a = json.bindings.when) === null || _a === void 0 ? void 0 : _a.code) || '';
|
|
57
|
+
const defaultShowTemplate = `
|
|
58
|
+
<template ${SPECIAL_PROPERTIES.V_IF}="${(0, helpers_1.encodeQuotes)(ifValue)}">
|
|
59
|
+
${json.children.map((item) => (0, exports.blockToVue)(item, options)).join('\n')}
|
|
60
|
+
</template>
|
|
61
|
+
${(0, is_mitosis_node_1.isMitosisNode)(json.meta.else)
|
|
62
|
+
? `
|
|
63
|
+
<template ${SPECIAL_PROPERTIES.V_ELSE}>
|
|
64
|
+
${(0, exports.blockToVue)(json.meta.else, options)}
|
|
65
|
+
</template>`
|
|
66
|
+
: ''}
|
|
67
|
+
`;
|
|
68
|
+
return defaultShowTemplate;
|
|
69
|
+
},
|
|
70
|
+
Slot(json, options) {
|
|
71
|
+
var _a, _b, _c;
|
|
72
|
+
const slotName = ((_a = json.bindings.name) === null || _a === void 0 ? void 0 : _a.code) || json.properties.name;
|
|
73
|
+
const renderChildren = () => { var _a; return (_a = json.children) === null || _a === void 0 ? void 0 : _a.map((item) => (0, exports.blockToVue)(item, options)).join('\n'); };
|
|
74
|
+
if (!slotName) {
|
|
75
|
+
const key = Object.keys(json.bindings).find(Boolean);
|
|
76
|
+
if (!key) {
|
|
77
|
+
if (!((_b = json.children) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
78
|
+
return '<slot/>';
|
|
79
|
+
}
|
|
80
|
+
return `<slot>${renderChildren()}</slot>`;
|
|
81
|
+
}
|
|
82
|
+
return `
|
|
83
|
+
<template #${key}>
|
|
84
|
+
${(_c = json.bindings[key]) === null || _c === void 0 ? void 0 : _c.code}
|
|
85
|
+
</template>
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
if (slotName === 'default') {
|
|
89
|
+
return `<slot>${renderChildren()}</slot>`;
|
|
90
|
+
}
|
|
91
|
+
return `<slot name="${(0, slots_1.toKebabSlot)(slotName, SLOT_PREFIX)}">${renderChildren()}</slot>`;
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
const SPECIAL_HTML_TAGS = ['style', 'script'];
|
|
95
|
+
const stringifyBinding = (node, options) => ([key, value]) => {
|
|
96
|
+
const isValidHtmlTag = html_tags_1.VALID_HTML_TAGS.includes(node.name);
|
|
97
|
+
if (value.type === 'spread') {
|
|
98
|
+
return ''; // we handle this after
|
|
99
|
+
}
|
|
100
|
+
else if (key === 'class' && options.convertClassStringToObject) {
|
|
101
|
+
return `:class="_classStringToObject(${value === null || value === void 0 ? void 0 : value.code})"`;
|
|
102
|
+
// TODO: support dynamic classes as objects somehow like Vue requires
|
|
103
|
+
// https://vuejs.org/v2/guide/class-and-style.html
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
// TODO: proper babel transform to replace. Util for this
|
|
107
|
+
const useValue = (value === null || value === void 0 ? void 0 : value.code) || '';
|
|
108
|
+
if ((0, event_handlers_1.checkIsEvent)(key) && isValidHtmlTag) {
|
|
109
|
+
// handle html native on[event] props
|
|
110
|
+
const { arguments: cusArgs = ['event'], async } = value;
|
|
111
|
+
let event = key.replace('on', '').toLowerCase();
|
|
112
|
+
const isAssignmentExpression = useValue.includes('=');
|
|
113
|
+
let eventHandlerValue;
|
|
114
|
+
if (async) {
|
|
115
|
+
eventHandlerValue = (0, function_1.pipe)((0, replace_identifiers_1.replaceIdentifiers)({
|
|
116
|
+
code: useValue,
|
|
117
|
+
from: cusArgs[0],
|
|
118
|
+
to: '$event',
|
|
119
|
+
}), isAssignmentExpression ? function_1.identity : remove_surrounding_block_1.removeSurroundingBlock, remove_surrounding_block_1.removeSurroundingBlock, helpers_1.encodeQuotes);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
eventHandlerValue = `async (${cusArgs.join(', ')}) => ${useValue}`;
|
|
123
|
+
}
|
|
124
|
+
const eventHandlerKey = `${SPECIAL_PROPERTIES.V_ON_AT}${event}`;
|
|
125
|
+
return `${eventHandlerKey}="${eventHandlerValue}"`;
|
|
126
|
+
}
|
|
127
|
+
else if ((0, event_handlers_1.checkIsEvent)(key)) {
|
|
128
|
+
// handle on[custom event] props
|
|
129
|
+
const { arguments: cusArgs = ['event'] } = node.bindings[key];
|
|
130
|
+
return `:${key}="(${cusArgs.join(',')}) => ${(0, helpers_1.encodeQuotes)(useValue)}"`;
|
|
131
|
+
}
|
|
132
|
+
else if (key === 'ref') {
|
|
133
|
+
return `ref="${(0, helpers_1.encodeQuotes)(useValue)}"`;
|
|
134
|
+
}
|
|
135
|
+
else if (BINDING_MAPPERS[key]) {
|
|
136
|
+
return `${BINDING_MAPPERS[key]}="${(0, helpers_1.encodeQuotes)(useValue.replace(/"/g, "\\'"))}"`;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return `:${key}="${(0, helpers_1.encodeQuotes)(useValue)}"`;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const stringifySpreads = ({ node, spreadType }) => {
|
|
144
|
+
const spreads = Object.values(node.bindings)
|
|
145
|
+
.filter(nullable_1.checkIsDefined)
|
|
146
|
+
.filter((binding) => binding.type === 'spread' && binding.spreadType === spreadType)
|
|
147
|
+
.map((value) => (value.code === 'props' ? '$props' : value.code));
|
|
148
|
+
if (spreads.length === 0) {
|
|
149
|
+
return '';
|
|
150
|
+
}
|
|
151
|
+
const stringifiedValue = spreads.length > 1 ? `{${spreads.map((spread) => `...${spread}`).join(', ')}}` : spreads[0];
|
|
152
|
+
const key = spreadType === 'normal' ? SPECIAL_PROPERTIES.V_BIND : SPECIAL_PROPERTIES.V_ON;
|
|
153
|
+
return ` ${key}="${(0, helpers_1.encodeQuotes)(stringifiedValue)}" `;
|
|
154
|
+
};
|
|
155
|
+
const getBlockBindings = (node, options) => {
|
|
156
|
+
const stringifiedProperties = Object.entries(node.properties)
|
|
157
|
+
.map(([key, value]) => {
|
|
158
|
+
if (key === 'className') {
|
|
159
|
+
return '';
|
|
160
|
+
}
|
|
161
|
+
else if (key === SPECIAL_PROPERTIES.V_ELSE) {
|
|
162
|
+
return `${key}`;
|
|
163
|
+
}
|
|
164
|
+
else if (typeof value === 'string') {
|
|
165
|
+
return `${key}="${(0, helpers_1.encodeQuotes)(value)}"`;
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
.join(' ');
|
|
169
|
+
const stringifiedBindings = Object.entries(node.bindings)
|
|
170
|
+
.map(stringifyBinding(node, options))
|
|
171
|
+
.join(' ');
|
|
172
|
+
return [
|
|
173
|
+
stringifiedProperties,
|
|
174
|
+
stringifiedBindings,
|
|
175
|
+
stringifySpreads({ node, spreadType: 'normal' }),
|
|
176
|
+
stringifySpreads({ node, spreadType: 'event-handlers' }),
|
|
177
|
+
].join(' ');
|
|
178
|
+
};
|
|
179
|
+
const blockToVue = (node, options, scope) => {
|
|
180
|
+
var _a;
|
|
181
|
+
const nodeMapper = NODE_MAPPERS[node.name];
|
|
182
|
+
if (nodeMapper) {
|
|
183
|
+
return nodeMapper(node, options, scope);
|
|
184
|
+
}
|
|
185
|
+
if ((0, is_children_1.default)({ node })) {
|
|
186
|
+
return `<slot/>`;
|
|
187
|
+
}
|
|
188
|
+
if (SPECIAL_HTML_TAGS.includes(node.name)) {
|
|
189
|
+
// Vue doesn't allow style/script tags in templates, but does support them through dynamic components.
|
|
190
|
+
node.bindings.is = (0, bindings_1.createSingleBinding)({ code: `'${node.name}'` });
|
|
191
|
+
node.name = 'component';
|
|
192
|
+
}
|
|
193
|
+
if (node.properties._text) {
|
|
194
|
+
return `${node.properties._text}`;
|
|
195
|
+
}
|
|
196
|
+
const textCode = (_a = node.bindings._text) === null || _a === void 0 ? void 0 : _a.code;
|
|
197
|
+
if (textCode) {
|
|
198
|
+
if ((0, slots_1.isSlotProperty)(textCode, SLOT_PREFIX)) {
|
|
199
|
+
const slotName = (0, slots_1.stripSlotPrefix)(textCode, SLOT_PREFIX).toLowerCase();
|
|
200
|
+
if (slotName === 'default')
|
|
201
|
+
return `<slot/>`;
|
|
202
|
+
return `<slot name="${slotName}"/>`;
|
|
203
|
+
}
|
|
204
|
+
return `{{${textCode}}}`;
|
|
205
|
+
}
|
|
206
|
+
let str = `<${node.name} `;
|
|
207
|
+
str += getBlockBindings(node, options);
|
|
208
|
+
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(node.name)) {
|
|
209
|
+
return str + ' />';
|
|
210
|
+
}
|
|
211
|
+
str += '>';
|
|
212
|
+
if (node.children) {
|
|
213
|
+
str += node.children.map((item) => (0, exports.blockToVue)(item, options)).join('');
|
|
214
|
+
}
|
|
215
|
+
return str + `</${node.name}>`;
|
|
216
|
+
};
|
|
217
|
+
exports.blockToVue = blockToVue;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BaseHook, MitosisComponent } from '../../types/mitosis-component';
|
|
2
|
+
import { ToVueOptions } from './types';
|
|
3
|
+
export declare function generateCompositionApiScript(component: MitosisComponent, options: ToVueOptions, template: string, props: Array<string>, onUpdateWithDeps: BaseHook[], onUpdateWithoutDeps: BaseHook[]): string;
|
|
@@ -0,0 +1,128 @@
|
|
|
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.generateCompositionApiScript = void 0;
|
|
7
|
+
const dedent_1 = require("../../helpers/dedent");
|
|
8
|
+
const get_state_object_string_1 = require("../../helpers/get-state-object-string");
|
|
9
|
+
const get_typed_function_1 = require("../../helpers/get-typed-function");
|
|
10
|
+
const json5_1 = __importDefault(require("json5"));
|
|
11
|
+
const lodash_1 = require("lodash");
|
|
12
|
+
const helpers_1 = require("./helpers");
|
|
13
|
+
const getCompositionPropDefinition = ({ options, component, props, }) => {
|
|
14
|
+
const isTs = options.typescript;
|
|
15
|
+
let str = 'const props = ';
|
|
16
|
+
if (component.defaultProps) {
|
|
17
|
+
const generic = isTs && component.propsTypeRef !== 'any' ? `<${component.propsTypeRef}>` : '';
|
|
18
|
+
const defalutPropsString = props
|
|
19
|
+
.map((prop) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const value = component.defaultProps.hasOwnProperty(prop)
|
|
22
|
+
? (_a = component.defaultProps[prop]) === null || _a === void 0 ? void 0 : _a.code
|
|
23
|
+
: 'undefined';
|
|
24
|
+
return `${prop}: ${value}`;
|
|
25
|
+
})
|
|
26
|
+
.join(',');
|
|
27
|
+
str += `withDefaults(defineProps${generic}(), {${defalutPropsString}})`;
|
|
28
|
+
}
|
|
29
|
+
else if (isTs && component.propsTypeRef && component.propsTypeRef !== 'any') {
|
|
30
|
+
str += `defineProps<${component.propsTypeRef}>()`;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
str += `defineProps(${json5_1.default.stringify(props)})`;
|
|
34
|
+
}
|
|
35
|
+
return str;
|
|
36
|
+
};
|
|
37
|
+
function generateCompositionApiScript(component, options, template, props, onUpdateWithDeps, onUpdateWithoutDeps) {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39
|
+
const isTs = options.typescript;
|
|
40
|
+
let refs = (0, get_state_object_string_1.getStateObjectStringFromComponent)(component, {
|
|
41
|
+
data: true,
|
|
42
|
+
functions: false,
|
|
43
|
+
getters: false,
|
|
44
|
+
format: 'variables',
|
|
45
|
+
valueMapper: (code, _, typeParameter) => {
|
|
46
|
+
return isTs && typeParameter ? `ref<${typeParameter}>(${code})` : `ref(${code})`;
|
|
47
|
+
},
|
|
48
|
+
keyPrefix: 'const',
|
|
49
|
+
});
|
|
50
|
+
let methods = (0, get_state_object_string_1.getStateObjectStringFromComponent)(component, {
|
|
51
|
+
data: false,
|
|
52
|
+
getters: false,
|
|
53
|
+
functions: true,
|
|
54
|
+
format: 'variables',
|
|
55
|
+
valueMapper: (code, type, typeParameter) => {
|
|
56
|
+
if (type != 'data') {
|
|
57
|
+
return (0, get_typed_function_1.getTypedFunction)(code, isTs, typeParameter);
|
|
58
|
+
}
|
|
59
|
+
return code;
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
if (template.includes('_classStringToObject')) {
|
|
63
|
+
methods += ` function _classStringToObject(str${isTs ? ': string' : ''}) {
|
|
64
|
+
const obj${isTs ? ': Record<string, boolean>' : ''} = {};
|
|
65
|
+
if (typeof str !== 'string') { return obj }
|
|
66
|
+
const classNames = str.trim().split(/\\s+/);
|
|
67
|
+
for (const name of classNames) {
|
|
68
|
+
obj[name] = true;
|
|
69
|
+
}
|
|
70
|
+
return obj;
|
|
71
|
+
} `;
|
|
72
|
+
}
|
|
73
|
+
const getterKeys = Object.keys((0, lodash_1.pickBy)(component.state, (i) => (i === null || i === void 0 ? void 0 : i.type) === 'getter'));
|
|
74
|
+
let str = (0, dedent_1.dedent) `
|
|
75
|
+
${props.length ? getCompositionPropDefinition({ component, props, options }) : ''}
|
|
76
|
+
${refs}
|
|
77
|
+
|
|
78
|
+
${(_a = Object.entries(component.context.get)) === null || _a === void 0 ? void 0 : _a.map(([key, context]) => {
|
|
79
|
+
return `const ${key} = inject(${(0, helpers_1.getContextKey)(context)})`;
|
|
80
|
+
}).join('\n')}
|
|
81
|
+
|
|
82
|
+
${(_b = Object.values(component.context.set)) === null || _b === void 0 ? void 0 : _b.map((contextSet) => {
|
|
83
|
+
const contextValue = (0, helpers_1.getContextValue)(contextSet);
|
|
84
|
+
const key = (0, helpers_1.getContextKey)(contextSet);
|
|
85
|
+
return `provide(${key}, ${contextValue})`;
|
|
86
|
+
}).join('\n')}
|
|
87
|
+
|
|
88
|
+
${(_c = Object.keys(component.refs)) === null || _c === void 0 ? void 0 : _c.map((key) => {
|
|
89
|
+
var _a;
|
|
90
|
+
if (isTs) {
|
|
91
|
+
const type = (_a = component.refs[key].typeParameter) !== null && _a !== void 0 ? _a : 'any';
|
|
92
|
+
return `const ${key} = ref<${type}>(null)`;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return `const ${key} = ref(null)`;
|
|
96
|
+
}
|
|
97
|
+
}).join('\n')}
|
|
98
|
+
${(_e = (_d = component.hooks.onInit) === null || _d === void 0 ? void 0 : _d.code) !== null && _e !== void 0 ? _e : ''}
|
|
99
|
+
${component.hooks.onMount.map((hook) => `onMounted(() => { ${hook.code} })`).join('\n')}
|
|
100
|
+
${!((_f = component.hooks.onUnMount) === null || _f === void 0 ? void 0 : _f.code)
|
|
101
|
+
? ''
|
|
102
|
+
: `onUnmounted(() => { ${component.hooks.onUnMount.code}})`}
|
|
103
|
+
${(getterKeys === null || getterKeys === void 0 ? void 0 : getterKeys.map((key) => {
|
|
104
|
+
var _a, _b;
|
|
105
|
+
const code = (_b = (_a = component.state[key]) === null || _a === void 0 ? void 0 : _a.code) === null || _b === void 0 ? void 0 : _b.toString();
|
|
106
|
+
if (!code) {
|
|
107
|
+
return '';
|
|
108
|
+
}
|
|
109
|
+
// transform `foo() { return this.bar }` to `() => { return bar.value }`
|
|
110
|
+
const getterAsFunction = code.replace(key, '').trim().replace(/^\(\)/, '() =>');
|
|
111
|
+
const computedCode = `const ${key} = computed(${getterAsFunction})`;
|
|
112
|
+
return computedCode;
|
|
113
|
+
}).join('\n')) || ''}
|
|
114
|
+
|
|
115
|
+
${(onUpdateWithoutDeps === null || onUpdateWithoutDeps === void 0 ? void 0 : onUpdateWithoutDeps.map((hook) => `onUpdated(() => {${hook.code}})`).join('\n')) || ''}
|
|
116
|
+
|
|
117
|
+
${(onUpdateWithDeps === null || onUpdateWithDeps === void 0 ? void 0 : onUpdateWithDeps.map((hook) => {
|
|
118
|
+
return `watch(() => ${(0, helpers_1.processBinding)({
|
|
119
|
+
code: hook.deps || '',
|
|
120
|
+
options,
|
|
121
|
+
json: component,
|
|
122
|
+
})}, () => { ${hook.code} }, {immediate: true})`;
|
|
123
|
+
}).join('\n')) || ''}
|
|
124
|
+
${methods !== null && methods !== void 0 ? methods : ''}
|
|
125
|
+
`;
|
|
126
|
+
return str;
|
|
127
|
+
}
|
|
128
|
+
exports.generateCompositionApiScript = generateCompositionApiScript;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Nullable } from '../../helpers/nullable';
|
|
2
|
+
import { ContextGetInfo, ContextSetInfo, MitosisComponent } from '../../types/mitosis-component';
|
|
3
|
+
import { MitosisNode } from '../../types/mitosis-node';
|
|
4
|
+
import { ToVueOptions } from './types';
|
|
5
|
+
export declare const addPropertiesToJson: (properties: MitosisNode['properties']) => (json: MitosisNode) => MitosisNode;
|
|
6
|
+
export declare const addBindingsToJson: (bindings: MitosisNode['bindings']) => (json: MitosisNode) => MitosisNode;
|
|
7
|
+
export declare const getOnUpdateHookName: (index: number) => string;
|
|
8
|
+
export declare const invertBooleanExpression: (expression: string) => string;
|
|
9
|
+
export declare function encodeQuotes(string: string): string;
|
|
10
|
+
export declare const mapMitosisComponentToKebabCase: (componentName: string) => string;
|
|
11
|
+
export declare const renameMitosisComponentsToKebabCase: (str: string) => string;
|
|
12
|
+
export declare function getContextNames(json: MitosisComponent): string[];
|
|
13
|
+
type ProcessBinding = {
|
|
14
|
+
code: string;
|
|
15
|
+
options: ToVueOptions;
|
|
16
|
+
json: MitosisComponent;
|
|
17
|
+
preserveGetter?: boolean;
|
|
18
|
+
thisPrefix?: 'this' | '_this';
|
|
19
|
+
codeType?: 'state' | 'hooks' | 'bindings' | 'hooks-deps' | 'properties';
|
|
20
|
+
};
|
|
21
|
+
export declare const processBinding: ({ code, options, json, preserveGetter, thisPrefix, codeType, }: ProcessBinding) => string;
|
|
22
|
+
export declare const getContextValue: ({ name, ref, value }: ContextSetInfo) => Nullable<string>;
|
|
23
|
+
export declare const checkIfContextHasStrName: (context: ContextGetInfo | ContextSetInfo) => boolean;
|
|
24
|
+
export declare const getContextKey: (context: ContextGetInfo | ContextSetInfo) => string;
|
|
25
|
+
export {};
|