@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,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,9 @@
|
|
|
1
|
+
import { ToLiquidOptions } from '../../generators/liquid/types';
|
|
2
|
+
import { TranspilerGenerator } from '../../types/transpiler';
|
|
3
|
+
/**
|
|
4
|
+
* Test if the binding expression would be likely to generate
|
|
5
|
+
* valid or invalid liquid. If we generate invalid liquid tags
|
|
6
|
+
* Shopify will reject our PUT to update the template
|
|
7
|
+
*/
|
|
8
|
+
export declare const isValidLiquidBinding: (str?: string) => boolean;
|
|
9
|
+
export declare const componentToLiquid: TranspilerGenerator<ToLiquidOptions>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.componentToLiquid = exports.isValidLiquidBinding = 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 fast_clone_1 = require("../../helpers/fast-clone");
|
|
8
|
+
const get_state_object_string_1 = require("../../helpers/get-state-object-string");
|
|
9
|
+
const strip_meta_properties_1 = require("../../helpers/strip-meta-properties");
|
|
10
|
+
const strip_state_and_props_refs_1 = require("../../helpers/strip-state-and-props-refs");
|
|
11
|
+
const collect_css_1 = require("../../helpers/styles/collect-css");
|
|
12
|
+
const plugins_1 = require("../../modules/plugins");
|
|
13
|
+
const mitosis_node_1 = require("../../types/mitosis-node");
|
|
14
|
+
/**
|
|
15
|
+
* Test if the binding expression would be likely to generate
|
|
16
|
+
* valid or invalid liquid. If we generate invalid liquid tags
|
|
17
|
+
* Shopify will reject our PUT to update the template
|
|
18
|
+
*/
|
|
19
|
+
const isValidLiquidBinding = (str = '') => {
|
|
20
|
+
const strictMatches = Boolean(
|
|
21
|
+
// Test for our `context.shopify.liquid.*(expression), which
|
|
22
|
+
// we regex out later to transform back into valid liquid expressions
|
|
23
|
+
str.match(/(context|ctx)\s*(\.shopify\s*)?\.liquid\s*\./));
|
|
24
|
+
return (strictMatches ||
|
|
25
|
+
// Test is the expression is simple and would map to Shopify bindings // Test for our `context.shopify.liquid.*(expression), which
|
|
26
|
+
// e.g. `state.product.price` -> `{{product.price}} // we regex out later to transform back into valid liquid expressions
|
|
27
|
+
Boolean(str.match(/^[a-z0-9_\.\s]+$/i)));
|
|
28
|
+
};
|
|
29
|
+
exports.isValidLiquidBinding = isValidLiquidBinding;
|
|
30
|
+
const mappers = {
|
|
31
|
+
Fragment: (json, options) => {
|
|
32
|
+
return `<div>${json.children.map((item) => blockToLiquid(item, options)).join('\n')}</div>`;
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
// TODO: spread support
|
|
36
|
+
const blockToLiquid = (json, options = {}) => {
|
|
37
|
+
var _a, _b, _c, _d, _e, _f;
|
|
38
|
+
if (mappers[json.name]) {
|
|
39
|
+
return mappers[json.name](json, options);
|
|
40
|
+
}
|
|
41
|
+
// TODO: Add support for `{props.children}` bindings
|
|
42
|
+
if (json.properties._text) {
|
|
43
|
+
return json.properties._text;
|
|
44
|
+
}
|
|
45
|
+
if ((_a = json.bindings._text) === null || _a === void 0 ? void 0 : _a.code) {
|
|
46
|
+
if (!(0, exports.isValidLiquidBinding)(json.bindings._text.code)) {
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
49
|
+
return `{{${(0, strip_state_and_props_refs_1.stripStateAndPropsRefs)(json.bindings._text.code)}}}`;
|
|
50
|
+
}
|
|
51
|
+
let str = '';
|
|
52
|
+
if ((0, mitosis_node_1.checkIsForNode)(json)) {
|
|
53
|
+
if (!((0, exports.isValidLiquidBinding)((_b = json.bindings.each) === null || _b === void 0 ? void 0 : _b.code) && (0, exports.isValidLiquidBinding)(json.scope.forName))) {
|
|
54
|
+
return str;
|
|
55
|
+
}
|
|
56
|
+
str += `{% for ${json.scope.forName} in ${(0, strip_state_and_props_refs_1.stripStateAndPropsRefs)((_c = json.bindings.each) === null || _c === void 0 ? void 0 : _c.code)} %}`;
|
|
57
|
+
if (json.children) {
|
|
58
|
+
str += json.children.map((item) => blockToLiquid(item, options)).join('\n');
|
|
59
|
+
}
|
|
60
|
+
str += '{% endfor %}';
|
|
61
|
+
}
|
|
62
|
+
else if (json.name === 'Show') {
|
|
63
|
+
if (!(0, exports.isValidLiquidBinding)((_d = json.bindings.when) === null || _d === void 0 ? void 0 : _d.code)) {
|
|
64
|
+
return str;
|
|
65
|
+
}
|
|
66
|
+
str += `{% if ${(0, strip_state_and_props_refs_1.stripStateAndPropsRefs)((_e = json.bindings.when) === null || _e === void 0 ? void 0 : _e.code)} %}`;
|
|
67
|
+
if (json.children) {
|
|
68
|
+
str += json.children.map((item) => blockToLiquid(item, options)).join('\n');
|
|
69
|
+
}
|
|
70
|
+
str += '{% endif %}';
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
str += `<${json.name} `;
|
|
74
|
+
if (((_f = json.bindings._spread) === null || _f === void 0 ? void 0 : _f.code) === '_spread' &&
|
|
75
|
+
(0, exports.isValidLiquidBinding)(json.bindings._spread.code)) {
|
|
76
|
+
str += `
|
|
77
|
+
{% for _attr in ${json.bindings._spread.code} %}
|
|
78
|
+
{{ _attr[0] }}="{{ _attr[1] }}"
|
|
79
|
+
{% endfor %}
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
for (const key in json.properties) {
|
|
83
|
+
const value = json.properties[key];
|
|
84
|
+
str += ` ${key}="${value}" `;
|
|
85
|
+
}
|
|
86
|
+
for (const key in json.bindings) {
|
|
87
|
+
if (key === '_spread' || key === 'ref' || key === 'css') {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const { code: value } = json.bindings[key];
|
|
91
|
+
// TODO: proper babel transform to replace. Util for this
|
|
92
|
+
const useValue = (0, strip_state_and_props_refs_1.stripStateAndPropsRefs)(value);
|
|
93
|
+
if ((0, event_handlers_1.checkIsEvent)(key)) {
|
|
94
|
+
// Do nothing
|
|
95
|
+
}
|
|
96
|
+
else if ((0, exports.isValidLiquidBinding)(useValue)) {
|
|
97
|
+
str += ` ${key}="{{${useValue}}}" `;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(json.name)) {
|
|
101
|
+
return str + ' />';
|
|
102
|
+
}
|
|
103
|
+
str += '>';
|
|
104
|
+
if (json.children) {
|
|
105
|
+
str += json.children.map((item) => blockToLiquid(item, options)).join('\n');
|
|
106
|
+
}
|
|
107
|
+
str += `</${json.name}>`;
|
|
108
|
+
}
|
|
109
|
+
return str;
|
|
110
|
+
};
|
|
111
|
+
// TODO: add JS support similar to componentToHtml()
|
|
112
|
+
const componentToLiquid = (options = {}) => ({ component }) => {
|
|
113
|
+
let json = (0, fast_clone_1.fastClone)(component);
|
|
114
|
+
if (options.plugins) {
|
|
115
|
+
json = (0, plugins_1.runPreJsonPlugins)({ json, plugins: options.plugins });
|
|
116
|
+
}
|
|
117
|
+
const css = (0, collect_css_1.collectCss)(json);
|
|
118
|
+
(0, strip_meta_properties_1.stripMetaProperties)(json);
|
|
119
|
+
if (options.plugins) {
|
|
120
|
+
json = (0, plugins_1.runPostJsonPlugins)({ json, plugins: options.plugins });
|
|
121
|
+
}
|
|
122
|
+
let str = json.children.map((item) => blockToLiquid(item)).join('\n');
|
|
123
|
+
if (css.trim().length) {
|
|
124
|
+
str += `<style>${css}</style>`;
|
|
125
|
+
}
|
|
126
|
+
if (options.reactive) {
|
|
127
|
+
const stateObjectString = (0, get_state_object_string_1.getStateObjectStringFromComponent)(json);
|
|
128
|
+
if (stateObjectString.trim().length > 4) {
|
|
129
|
+
str += `<script reactive>
|
|
130
|
+
export default {
|
|
131
|
+
state: ${stateObjectString}
|
|
132
|
+
}
|
|
133
|
+
</script>`;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (options.plugins) {
|
|
137
|
+
str = (0, plugins_1.runPreCodePlugins)({ json, code: str, plugins: options.plugins });
|
|
138
|
+
}
|
|
139
|
+
if (options.prettier !== false) {
|
|
140
|
+
try {
|
|
141
|
+
str = (0, standalone_1.format)(str, {
|
|
142
|
+
parser: 'html',
|
|
143
|
+
htmlWhitespaceSensitivity: 'ignore',
|
|
144
|
+
plugins: [
|
|
145
|
+
// To support running in browsers
|
|
146
|
+
require('prettier/parser-html'),
|
|
147
|
+
require('prettier/parser-postcss'),
|
|
148
|
+
require('prettier/parser-babel'),
|
|
149
|
+
],
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
console.warn('Could not prettify', { string: str }, err);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (options.plugins) {
|
|
157
|
+
str = (0, plugins_1.runPostCodePlugins)({ json, code: str, plugins: options.plugins });
|
|
158
|
+
}
|
|
159
|
+
return str;
|
|
160
|
+
};
|
|
161
|
+
exports.componentToLiquid = componentToLiquid;
|
|
@@ -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,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collectClassString = void 0;
|
|
4
|
+
// This should really be a preprocessor mapping the `class` attribute binding based on what other values have
|
|
5
|
+
// to make this more pluggable
|
|
6
|
+
function collectClassString(json, bindingOpenChar = '{', bindingCloseChar = '}') {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const staticClasses = [];
|
|
9
|
+
const hasStaticClasses = Boolean(staticClasses.length);
|
|
10
|
+
if (json.properties.class) {
|
|
11
|
+
staticClasses.push(json.properties.class);
|
|
12
|
+
delete json.properties.class;
|
|
13
|
+
}
|
|
14
|
+
if (json.properties.className) {
|
|
15
|
+
staticClasses.push(json.properties.className);
|
|
16
|
+
delete json.properties.className;
|
|
17
|
+
}
|
|
18
|
+
const dynamicClasses = [];
|
|
19
|
+
if (typeof ((_a = json.bindings.class) === null || _a === void 0 ? void 0 : _a.code) === 'string') {
|
|
20
|
+
dynamicClasses.push(json.bindings.class.code);
|
|
21
|
+
delete json.bindings.class;
|
|
22
|
+
}
|
|
23
|
+
if (typeof ((_b = json.bindings.className) === null || _b === void 0 ? void 0 : _b.code) === 'string') {
|
|
24
|
+
dynamicClasses.push(json.bindings.className.code);
|
|
25
|
+
delete json.bindings.className;
|
|
26
|
+
}
|
|
27
|
+
const staticClassesString = staticClasses.join(' ');
|
|
28
|
+
const dynamicClassesString = dynamicClasses.join(" + ' ' + ");
|
|
29
|
+
const hasDynamicClasses = Boolean(dynamicClasses.length);
|
|
30
|
+
if (hasStaticClasses && !hasDynamicClasses) {
|
|
31
|
+
return `"${staticClassesString}"`;
|
|
32
|
+
}
|
|
33
|
+
if (hasDynamicClasses && !hasStaticClasses) {
|
|
34
|
+
return `${bindingOpenChar}${dynamicClassesString}${bindingCloseChar}`;
|
|
35
|
+
}
|
|
36
|
+
if (hasDynamicClasses && hasStaticClasses) {
|
|
37
|
+
return `${bindingOpenChar}"${staticClassesString} " + ${dynamicClassesString}${bindingCloseChar}`;
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
exports.collectClassString = collectClassString;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.componentToLit = void 0;
|
|
4
|
+
const dash_case_1 = require("../../helpers/dash-case");
|
|
5
|
+
const dedent_1 = require("../../helpers/dedent");
|
|
6
|
+
const event_handlers_1 = require("../../helpers/event-handlers");
|
|
7
|
+
const fast_clone_1 = require("../../helpers/fast-clone");
|
|
8
|
+
const filter_empty_text_nodes_1 = require("../../helpers/filter-empty-text-nodes");
|
|
9
|
+
const get_props_1 = require("../../helpers/get-props");
|
|
10
|
+
const get_refs_1 = require("../../helpers/get-refs");
|
|
11
|
+
const get_state_object_string_1 = require("../../helpers/get-state-object-string");
|
|
12
|
+
const has_1 = require("../../helpers/has");
|
|
13
|
+
const indent_1 = require("../../helpers/indent");
|
|
14
|
+
const is_upper_case_1 = require("../../helpers/is-upper-case");
|
|
15
|
+
const map_refs_1 = require("../../helpers/map-refs");
|
|
16
|
+
const merge_options_1 = require("../../helpers/merge-options");
|
|
17
|
+
const render_imports_1 = require("../../helpers/render-imports");
|
|
18
|
+
const strip_meta_properties_1 = require("../../helpers/strip-meta-properties");
|
|
19
|
+
const strip_state_and_props_refs_1 = require("../../helpers/strip-state-and-props-refs");
|
|
20
|
+
const collect_css_1 = require("../../helpers/styles/collect-css");
|
|
21
|
+
const mitosis_node_1 = require("../../types/mitosis-node");
|
|
22
|
+
const lodash_1 = require("lodash");
|
|
23
|
+
const standalone_1 = require("prettier/standalone");
|
|
24
|
+
const html_tags_1 = require("../../constants/html_tags");
|
|
25
|
+
const plugins_1 = require("../../modules/plugins");
|
|
26
|
+
const on_mount_1 = require("../helpers/on-mount");
|
|
27
|
+
const collect_class_string_1 = require("./collect-class-string");
|
|
28
|
+
const getCustomTagName = (name, options) => {
|
|
29
|
+
if (!name || !(0, is_upper_case_1.isUpperCase)(name[0])) {
|
|
30
|
+
return name;
|
|
31
|
+
}
|
|
32
|
+
const kebabCaseName = (0, dash_case_1.dashCase)(name);
|
|
33
|
+
if (!kebabCaseName.includes('-')) {
|
|
34
|
+
// TODO: option to choose your prefix
|
|
35
|
+
return 'my-' + kebabCaseName;
|
|
36
|
+
}
|
|
37
|
+
return kebabCaseName;
|
|
38
|
+
};
|
|
39
|
+
const blockToLit = (json, options = {}) => {
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
41
|
+
if (json.properties._text) {
|
|
42
|
+
return json.properties._text;
|
|
43
|
+
}
|
|
44
|
+
if ((_a = json.bindings._text) === null || _a === void 0 ? void 0 : _a.code) {
|
|
45
|
+
return `\${${processBinding((_b = json.bindings) === null || _b === void 0 ? void 0 : _b._text.code)}}`;
|
|
46
|
+
}
|
|
47
|
+
if ((0, mitosis_node_1.checkIsForNode)(json)) {
|
|
48
|
+
return `\${${processBinding((_c = json.bindings.each) === null || _c === void 0 ? void 0 : _c.code)}?.map((${(_d = json.scope.forName) !== null && _d !== void 0 ? _d : '_'}, ${(_e = json.scope.indexName) !== null && _e !== void 0 ? _e : 'index'}) => (
|
|
49
|
+
html\`${json.children
|
|
50
|
+
.filter(filter_empty_text_nodes_1.filterEmptyTextNodes)
|
|
51
|
+
.map((item) => blockToLit(item, options))
|
|
52
|
+
.join('\n')}\`
|
|
53
|
+
))}`;
|
|
54
|
+
}
|
|
55
|
+
else if (json.name === 'Show') {
|
|
56
|
+
return `\${${processBinding((_f = json.bindings.when) === null || _f === void 0 ? void 0 : _f.code)} ?
|
|
57
|
+
html\`${json.children
|
|
58
|
+
.filter(filter_empty_text_nodes_1.filterEmptyTextNodes)
|
|
59
|
+
.map((item) => blockToLit(item, options))
|
|
60
|
+
.join('\n')}\`
|
|
61
|
+
: ${!json.meta.else ? 'null' : `html\`${blockToLit(json.meta.else, options)}\``}}`;
|
|
62
|
+
}
|
|
63
|
+
let str = '';
|
|
64
|
+
const tagName = getCustomTagName(json.name, options);
|
|
65
|
+
str += `<${tagName} `;
|
|
66
|
+
const classString = (0, collect_class_string_1.collectClassString)(json);
|
|
67
|
+
if (classString) {
|
|
68
|
+
str += ` class=${classString} `;
|
|
69
|
+
}
|
|
70
|
+
for (const key in json.properties) {
|
|
71
|
+
const value = json.properties[key];
|
|
72
|
+
str += ` ${key}="${value}" `;
|
|
73
|
+
}
|
|
74
|
+
for (const key in json.bindings) {
|
|
75
|
+
const { code, arguments: cusArgs = ['event'], type } = json.bindings[key];
|
|
76
|
+
if (type === 'spread') {
|
|
77
|
+
str += ` \${spread(${code})} `;
|
|
78
|
+
}
|
|
79
|
+
else if (key === 'ref') {
|
|
80
|
+
// TODO: maybe use ref directive instead
|
|
81
|
+
// https://lit.dev/docs/templates/directives/#ref
|
|
82
|
+
str += ` ref="${code}" `;
|
|
83
|
+
}
|
|
84
|
+
else if ((0, event_handlers_1.checkIsEvent)(key)) {
|
|
85
|
+
const asyncKeyword = ((_g = json.bindings[key]) === null || _g === void 0 ? void 0 : _g.async) ? 'async ' : '';
|
|
86
|
+
const useKey = '@' + key.substring(2).toLowerCase();
|
|
87
|
+
str += ` ${useKey}=\${${asyncKeyword}(${cusArgs.join(',')}) => ${processBinding(code)}} `;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const value = processBinding(code);
|
|
91
|
+
// If they key includes a '-' it's an attribute, not a property
|
|
92
|
+
if (key.includes('-')) {
|
|
93
|
+
str += ` ${key}=\${${value}} `;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
// TODO: handle boolean attributes too by matching list of html boolean attributes
|
|
97
|
+
// https://lit.dev/docs/templates/expressions/#boolean-attribute-expressions
|
|
98
|
+
str += ` .${key}=\${${value}} `;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (html_tags_1.SELF_CLOSING_HTML_TAGS.has(json.name)) {
|
|
103
|
+
return str + ' />';
|
|
104
|
+
}
|
|
105
|
+
str += '>';
|
|
106
|
+
if (json.children) {
|
|
107
|
+
str += json.children.map((item) => blockToLit(item, options)).join('\n');
|
|
108
|
+
}
|
|
109
|
+
str += `</${tagName}>`;
|
|
110
|
+
return str;
|
|
111
|
+
};
|
|
112
|
+
function processBinding(code) {
|
|
113
|
+
return (0, strip_state_and_props_refs_1.stripStateAndPropsRefs)(code, { replaceWith: 'this.' });
|
|
114
|
+
}
|
|
115
|
+
const componentToLit = (_options = {}) => ({ component }) => {
|
|
116
|
+
var _a, _b, _c;
|
|
117
|
+
const options = (0, merge_options_1.initializeOptions)({ target: 'lit', component, defaults: _options });
|
|
118
|
+
let json = (0, fast_clone_1.fastClone)(component);
|
|
119
|
+
if (options.plugins) {
|
|
120
|
+
json = (0, plugins_1.runPreJsonPlugins)({ json, plugins: options.plugins });
|
|
121
|
+
}
|
|
122
|
+
const props = (0, get_props_1.getProps)(component);
|
|
123
|
+
let css = (0, collect_css_1.collectCss)(json);
|
|
124
|
+
const domRefs = (0, get_refs_1.getRefs)(json);
|
|
125
|
+
(0, map_refs_1.mapRefs)(json, (refName) => `this.${(0, lodash_1.camelCase)(refName)}`);
|
|
126
|
+
if (options.plugins) {
|
|
127
|
+
json = (0, plugins_1.runPostJsonPlugins)({ json, plugins: options.plugins });
|
|
128
|
+
}
|
|
129
|
+
(0, strip_meta_properties_1.stripMetaProperties)(json);
|
|
130
|
+
const dataString = (0, get_state_object_string_1.getStateObjectStringFromComponent)(json, {
|
|
131
|
+
format: 'class',
|
|
132
|
+
data: true,
|
|
133
|
+
functions: false,
|
|
134
|
+
getters: false,
|
|
135
|
+
keyPrefix: '@state() ',
|
|
136
|
+
valueMapper: (code) => processBinding(code),
|
|
137
|
+
});
|
|
138
|
+
const methodsString = (0, get_state_object_string_1.getStateObjectStringFromComponent)(json, {
|
|
139
|
+
format: 'class',
|
|
140
|
+
data: false,
|
|
141
|
+
functions: true,
|
|
142
|
+
getters: true,
|
|
143
|
+
valueMapper: (code) => processBinding(code),
|
|
144
|
+
});
|
|
145
|
+
if (options.prettier !== false) {
|
|
146
|
+
try {
|
|
147
|
+
css = (0, standalone_1.format)(css, {
|
|
148
|
+
parser: 'css',
|
|
149
|
+
plugins: [require('prettier/parser-postcss')],
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
console.warn('Could not format css', err);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
let html = json.children.map((item) => blockToLit(item, options)).join('\n');
|
|
157
|
+
const hasSpread = (0, has_1.has)(json, (node) => (0, lodash_1.some)(node.bindings, { type: 'spread' }));
|
|
158
|
+
if (options.prettier !== false) {
|
|
159
|
+
try {
|
|
160
|
+
css = (0, standalone_1.format)(css, {
|
|
161
|
+
parser: 'css',
|
|
162
|
+
plugins: [require('prettier/parser-postcss')],
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
console.warn('Could not format css', err);
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
html = (0, standalone_1.format)(html, {
|
|
170
|
+
parser: 'html',
|
|
171
|
+
plugins: [require('prettier/parser-html')],
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
// If can't format HTML (this can happen with lit given it is tagged template strings),
|
|
176
|
+
// at least remove excess fspace
|
|
177
|
+
html = html.replace(/\n{3,}/g, '\n\n');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
let str = (0, dedent_1.dedent) `
|
|
181
|
+
${(0, render_imports_1.renderPreComponent)({
|
|
182
|
+
explicitImportFileExtension: options.explicitImportFileExtension,
|
|
183
|
+
component: json,
|
|
184
|
+
target: 'lit',
|
|
185
|
+
})}
|
|
186
|
+
import { LitElement, html, css } from 'lit';
|
|
187
|
+
import { customElement, property, state, query } from 'lit/decorators.js';
|
|
188
|
+
|
|
189
|
+
${json.types ? json.types.join('\n') : ''}
|
|
190
|
+
${hasSpread
|
|
191
|
+
? `
|
|
192
|
+
const spread = (properties) =>
|
|
193
|
+
directive((part) => {
|
|
194
|
+
for (const property in properties) {
|
|
195
|
+
const value = properties[attr];
|
|
196
|
+
part.element[property] = value;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
`
|
|
200
|
+
: ''}
|
|
201
|
+
|
|
202
|
+
@customElement('${((_a = json.meta.useMetadata) === null || _a === void 0 ? void 0 : _a.tagName) || getCustomTagName(json.name, options)}')
|
|
203
|
+
export default class ${json.name} extends LitElement {
|
|
204
|
+
${options.useShadowDom
|
|
205
|
+
? ''
|
|
206
|
+
: `
|
|
207
|
+
createRenderRoot() {
|
|
208
|
+
return this;
|
|
209
|
+
}
|
|
210
|
+
`}
|
|
211
|
+
|
|
212
|
+
${options.useShadowDom && css.length
|
|
213
|
+
? `static styles = css\`
|
|
214
|
+
${(0, indent_1.indent)(css, 8)}\`;`
|
|
215
|
+
: ''}
|
|
216
|
+
|
|
217
|
+
${Array.from(domRefs)
|
|
218
|
+
.map((refName) => `
|
|
219
|
+
@query('[ref="${refName}"]')
|
|
220
|
+
${(0, lodash_1.camelCase)(refName)}!: HTMLElement;
|
|
221
|
+
`)
|
|
222
|
+
.join('\n')}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
${Array.from(props)
|
|
226
|
+
.map((item) => `@property() ${item}: any`)
|
|
227
|
+
.join('\n')}
|
|
228
|
+
|
|
229
|
+
${dataString}
|
|
230
|
+
${methodsString}
|
|
231
|
+
|
|
232
|
+
${json.hooks.onMount.length === 0
|
|
233
|
+
? ''
|
|
234
|
+
: `connectedCallback() { ${processBinding((0, on_mount_1.stringifySingleScopeOnMount)(json))} }`}
|
|
235
|
+
${!((_b = json.hooks.onUnMount) === null || _b === void 0 ? void 0 : _b.code)
|
|
236
|
+
? ''
|
|
237
|
+
: `disconnectedCallback() { ${processBinding(json.hooks.onUnMount.code)} }`}
|
|
238
|
+
${!((_c = json.hooks.onUpdate) === null || _c === void 0 ? void 0 : _c.length)
|
|
239
|
+
? ''
|
|
240
|
+
: `updated() {
|
|
241
|
+
${json.hooks.onUpdate.map((hook) => processBinding(hook.code)).join('\n\n')}
|
|
242
|
+
}`}
|
|
243
|
+
|
|
244
|
+
render() {
|
|
245
|
+
return html\`
|
|
246
|
+
${options.useShadowDom || !css.length ? '' : `<style>${css}</style>`}
|
|
247
|
+
${(0, indent_1.indent)(html, 8)}
|
|
248
|
+
\`
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
`;
|
|
252
|
+
if (options.plugins) {
|
|
253
|
+
str = (0, plugins_1.runPreCodePlugins)({ json, code: str, plugins: options.plugins });
|
|
254
|
+
}
|
|
255
|
+
if (options.prettier !== false) {
|
|
256
|
+
try {
|
|
257
|
+
str = (0, standalone_1.format)(str, {
|
|
258
|
+
parser: 'typescript',
|
|
259
|
+
plugins: [require('prettier/parser-typescript')],
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
console.warn('Could not format Lit typescript', err);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (options.plugins) {
|
|
267
|
+
str = (0, plugins_1.runPostCodePlugins)({ json, code: str, plugins: options.plugins });
|
|
268
|
+
}
|
|
269
|
+
return str;
|
|
270
|
+
};
|
|
271
|
+
exports.componentToLit = componentToLit;
|
|
@@ -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("./generate"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseTranspilerOptions } from '../../types/transpiler';
|
|
2
|
+
export interface ToLitOptions extends BaseTranspilerOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Enabled shadowDOM for generated lit components. Default: enabled
|
|
5
|
+
*/
|
|
6
|
+
useShadowDom?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type LitMetadata = {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ToMarkoOptions } from '../../generators/marko/types';
|
|
2
|
+
import { TranspilerGenerator } from '../../types/transpiler';
|
|
3
|
+
export declare const componentToMarko: TranspilerGenerator<ToMarkoOptions>;
|
|
4
|
+
/**
|
|
5
|
+
* Convert marko expressions to valid html
|
|
6
|
+
*
|
|
7
|
+
* <div on-click=(() => doSomething())> -> <div on-click="() => doSomething()">
|
|
8
|
+
*/
|
|
9
|
+
export declare function preprocessHtml(htmlString: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Convert HTML back to marko expressions
|
|
12
|
+
*
|
|
13
|
+
* <div on-click="() => doSomething()"> -> <div on-click=(() => doSomething())>
|
|
14
|
+
*/
|
|
15
|
+
export declare function postprocessHtml(htmlString: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Format Marko HTML using the built-in HTML parser for prettier,
|
|
18
|
+
* given issues with Marko's plugin
|
|
19
|
+
*/
|
|
20
|
+
export declare function markoFormatHtml(htmlString: string): string;
|