@builder.io/mitosis 0.0.56-2 → 0.0.56-22
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/__tests__/angular.test.js +2 -13
- package/dist/src/__tests__/builder.test.js +3 -3
- package/dist/src/__tests__/data/basic-child-component.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-child-component.raw.jsx +21 -0
- package/dist/src/__tests__/data/basic-context.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-context.raw.jsx +29 -0
- package/dist/src/__tests__/data/basic-custom-mitosis-package.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-custom-mitosis-package.raw.jsx +10 -0
- package/dist/src/__tests__/data/basic-for-show.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-for-show.raw.jsx +20 -0
- package/dist/src/__tests__/data/basic-for.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-for.raw.jsx +23 -0
- package/dist/src/__tests__/data/basic-forwardRef-metadata.raw.d.ts +5 -0
- package/dist/src/__tests__/data/basic-forwardRef-metadata.raw.jsx +17 -0
- package/dist/src/__tests__/data/basic-forwardRef.raw.d.ts +5 -0
- package/dist/src/__tests__/data/basic-forwardRef.raw.jsx +14 -0
- package/dist/src/__tests__/data/basic-onChange.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-onChange.raw.jsx +17 -0
- package/dist/src/__tests__/data/basic-onMount-update.raw.d.ts +5 -0
- package/dist/src/__tests__/data/basic-onMount-update.raw.jsx +17 -0
- package/dist/src/__tests__/data/basic-onUpdate-return.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-onUpdate-return.raw.jsx +24 -0
- package/dist/src/__tests__/data/basic-outputs-meta.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-outputs-meta.raw.jsx +17 -0
- package/dist/src/__tests__/data/basic-outputs.raw.d.ts +1 -0
- package/dist/src/__tests__/data/basic-outputs.raw.jsx +14 -0
- package/dist/src/__tests__/data/basic-preserve-export-or-local-statement.raw.d.ts +6 -0
- package/dist/src/__tests__/data/basic-preserve-export-or-local-statement.raw.jsx +14 -0
- package/dist/src/__tests__/data/basic-props-destructure.raw.d.ts +6 -0
- package/dist/src/__tests__/data/basic-props-destructure.raw.jsx +14 -0
- package/dist/src/__tests__/data/basic-props.raw.d.ts +6 -0
- package/dist/src/__tests__/data/basic-props.raw.jsx +13 -0
- package/dist/src/__tests__/data/basic-ref-assignment.raw.d.ts +4 -0
- package/dist/src/__tests__/data/basic-ref-assignment.raw.jsx +15 -0
- package/dist/src/__tests__/data/basic-ref-usePrevious.raw.d.ts +5 -0
- package/dist/src/__tests__/data/basic-ref-usePrevious.raw.jsx +35 -0
- package/dist/src/__tests__/data/basic-ref.raw.d.ts +4 -0
- package/dist/src/__tests__/data/basic-ref.raw.jsx +36 -0
- package/dist/src/__tests__/data/basic.raw.d.ts +6 -1
- package/dist/src/__tests__/data/basic.raw.jsx +13 -4
- package/dist/src/__tests__/data/blocks/button-with-metadata.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/button.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/classname-jsx.raw.d.ts +7 -0
- package/dist/src/__tests__/data/blocks/classname-jsx.raw.jsx +15 -0
- package/dist/src/__tests__/data/blocks/columns.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/columns.raw.jsx +1 -1
- package/dist/src/__tests__/data/blocks/content-slot-html.raw.d.ts +7 -0
- package/dist/src/__tests__/data/blocks/content-slot-html.raw.jsx +15 -0
- package/dist/src/__tests__/data/blocks/content-slot-jsx.raw.d.ts +6 -0
- package/dist/src/__tests__/data/blocks/content-slot-jsx.raw.jsx +12 -0
- package/dist/src/__tests__/data/blocks/custom-code.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/custom-code.raw.jsx +3 -7
- package/dist/src/__tests__/data/blocks/embed.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/embed.raw.jsx +3 -7
- package/dist/src/__tests__/data/blocks/form.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/form.raw.jsx +3 -3
- package/dist/src/__tests__/data/blocks/image.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/image.raw.jsx +8 -9
- package/dist/src/__tests__/data/blocks/img-state.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/img-state.raw.jsx +17 -0
- package/dist/src/__tests__/data/blocks/img.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/input.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/input.raw.jsx +1 -3
- package/dist/src/__tests__/data/blocks/multiple-onUpdate.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.jsx +7 -1
- package/dist/src/__tests__/data/blocks/onInit-onMount.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/onInit-onMount.raw.jsx +13 -0
- package/dist/src/__tests__/data/blocks/onInit.raw.d.ts +8 -0
- package/dist/src/__tests__/data/blocks/onInit.raw.jsx +20 -0
- package/dist/src/__tests__/data/blocks/onMount.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/onUpdate.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.jsx +1 -1
- package/dist/src/__tests__/data/blocks/raw-text.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/rootShow.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/section-state.raw.d.ts +6 -0
- package/dist/src/__tests__/data/blocks/section-state.raw.jsx +17 -0
- package/dist/src/__tests__/data/blocks/section.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/select.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/select.raw.jsx +1 -3
- package/dist/src/__tests__/data/blocks/self-referencing-component-with-children.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/self-referencing-component.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/shadow-dom.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/shadow-dom.raw.jsx +2 -4
- package/dist/src/__tests__/data/blocks/slot-html.raw.d.ts +5 -0
- package/dist/src/__tests__/data/blocks/slot-html.raw.jsx +15 -0
- package/dist/src/__tests__/data/blocks/slot-jsx.raw.d.ts +5 -0
- package/dist/src/__tests__/data/blocks/slot-jsx.raw.jsx +12 -0
- package/dist/src/__tests__/data/blocks/stamped-io.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/stamped-io.raw.jsx +2 -4
- package/dist/src/__tests__/data/blocks/submit-button.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/text.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/text.raw.jsx +3 -1
- package/dist/src/__tests__/data/blocks/textarea.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/video.raw.d.ts +1 -1
- package/dist/src/__tests__/data/blocks/video.raw.jsx +1 -1
- package/dist/src/__tests__/data/context/component-with-context.lite.d.ts +3 -1
- package/dist/src/__tests__/data/context/component-with-context.lite.jsx +7 -2
- package/dist/src/__tests__/data/styles/class-and-className.raw.d.ts +1 -0
- package/dist/src/__tests__/data/styles/class-and-className.raw.jsx +10 -0
- package/dist/src/__tests__/data/styles/class.raw.d.ts +1 -0
- package/dist/src/__tests__/data/styles/class.raw.jsx +10 -0
- package/dist/src/__tests__/data/styles/className.raw.d.ts +1 -0
- package/dist/src/__tests__/data/styles/className.raw.jsx +10 -0
- package/dist/src/__tests__/data/styles/classState.raw.d.ts +1 -0
- package/dist/src/__tests__/data/styles/classState.raw.jsx +12 -0
- package/dist/src/__tests__/data/types/component-props-interface.raw.d.ts +6 -0
- package/dist/src/__tests__/data/types/component-props-interface.raw.jsx +6 -0
- package/dist/src/__tests__/data/types/component-props-type.raw.d.ts +6 -0
- package/dist/src/__tests__/data/types/component-props-type.raw.jsx +6 -0
- package/dist/src/__tests__/data/types/preserve-typing.raw.d.ts +8 -0
- package/dist/src/__tests__/data/types/preserve-typing.raw.jsx +6 -0
- package/dist/src/__tests__/html.test.js +2 -13
- package/dist/src/__tests__/liquid.test.js +2 -103
- package/dist/src/__tests__/parse-jsx.test.js +22 -0
- package/dist/src/__tests__/qwik/convertMethodToFunction.test.d.ts +1 -0
- package/dist/src/__tests__/qwik/convertMethodToFunction.test.js +34 -0
- package/dist/src/__tests__/qwik/src-generator.test.d.ts +1 -0
- package/dist/src/__tests__/qwik/src-generator.test.js +65 -0
- package/dist/src/__tests__/qwik.directive.test.js +1 -0
- package/dist/src/__tests__/qwik.test.js +54 -23
- package/dist/src/__tests__/react-native.test.js +3 -136
- package/dist/src/__tests__/react.test.js +5 -135
- package/dist/src/__tests__/shared.d.ts +3 -0
- package/dist/src/__tests__/shared.js +232 -0
- package/dist/src/__tests__/solid.test.js +2 -97
- package/dist/src/__tests__/stencil.test.js +3 -98
- package/dist/src/__tests__/styles.test.d.ts +1 -0
- package/dist/src/__tests__/styles.test.js +23 -0
- package/dist/src/__tests__/svelte.test.js +2 -31
- package/dist/src/__tests__/vue.test.js +2 -134
- package/dist/src/__tests__/webcomponent.test.js +8 -5
- package/dist/src/constants/hooks.d.ts +6 -0
- package/dist/src/constants/hooks.js +9 -0
- package/dist/src/flow.d.ts +6 -0
- package/dist/src/flow.js +6 -2
- package/dist/src/generators/angular.d.ts +8 -2
- package/dist/src/generators/angular.js +202 -44
- package/dist/src/generators/builder.d.ts +2 -2
- package/dist/src/generators/builder.js +19 -26
- package/dist/src/generators/context/{react copy.d.ts → qwik.d.ts} +2 -2
- package/dist/src/generators/context/{react copy.js → qwik.js} +4 -5
- package/dist/src/generators/context/svelte.d.ts +1 -1
- package/dist/src/generators/helpers/context.js +1 -2
- package/dist/src/generators/html.d.ts +1 -1
- package/dist/src/generators/html.js +365 -108
- package/dist/src/generators/liquid.d.ts +1 -1
- package/dist/src/generators/liquid.js +18 -25
- package/dist/src/generators/mitosis.d.ts +1 -1
- package/dist/src/generators/mitosis.js +37 -35
- package/dist/src/generators/qwik/component-generator.d.ts +4 -0
- package/dist/src/generators/qwik/component-generator.js +276 -0
- package/dist/src/generators/qwik/component.js +21 -25
- package/dist/src/generators/qwik/convertMethodToFunction.d.ts +1 -0
- package/dist/src/generators/qwik/convertMethodToFunction.js +161 -0
- package/dist/src/generators/qwik/directives.js +27 -22
- package/dist/src/generators/qwik/handlers.js +3 -19
- package/dist/src/generators/qwik/index.d.ts +3 -1
- package/dist/src/generators/qwik/index.js +3 -1
- package/dist/src/generators/qwik/jsx.js +33 -13
- package/dist/src/generators/qwik/src-generator.d.ts +21 -8
- package/dist/src/generators/qwik/src-generator.js +163 -42
- package/dist/src/generators/qwik/styles.js +3 -3
- package/dist/src/generators/react-native.d.ts +2 -2
- package/dist/src/generators/react-native.js +8 -10
- package/dist/src/generators/react.d.ts +4 -2
- package/dist/src/generators/react.js +152 -80
- package/dist/src/generators/solid.d.ts +1 -1
- package/dist/src/generators/solid.js +41 -35
- package/dist/src/generators/stencil/collect-class-string.js +5 -8
- package/dist/src/generators/stencil/generate.d.ts +1 -1
- package/dist/src/generators/stencil/generate.js +16 -21
- package/dist/src/generators/svelte.d.ts +2 -2
- package/dist/src/generators/svelte.js +97 -43
- package/dist/src/generators/swift-ui.d.ts +1 -1
- package/dist/src/generators/swift-ui.js +17 -19
- package/dist/src/generators/template.d.ts +1 -1
- package/dist/src/generators/template.js +11 -18
- package/dist/src/generators/vue.d.ts +12 -8
- package/dist/src/generators/vue.js +111 -63
- package/dist/src/helpers/babel-transform.js +3 -8
- package/dist/src/helpers/create-mitosis-component.d.ts +1 -1
- package/dist/src/helpers/create-mitosis-component.js +1 -1
- package/dist/src/helpers/create-mitosis-node.js +1 -1
- package/dist/src/helpers/fast-clone.js +1 -3
- package/dist/src/helpers/filter-empty-text-nodes.js +1 -2
- package/dist/src/helpers/get-bindings.d.ts +2 -0
- package/dist/src/helpers/get-bindings.js +18 -0
- package/dist/src/helpers/get-prop-functions.d.ts +5 -0
- package/dist/src/helpers/get-prop-functions.js +29 -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-refs.js +3 -2
- package/dist/src/helpers/get-state-object-string.d.ts +4 -3
- package/dist/src/helpers/get-state-object-string.js +23 -20
- package/dist/src/helpers/get-styles.js +4 -3
- package/dist/src/helpers/getters-to-functions.d.ts +1 -1
- package/dist/src/helpers/getters-to-functions.js +1 -1
- 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-stateful-dom.d.ts +2 -0
- package/dist/src/helpers/has-stateful-dom.js +21 -0
- package/dist/src/helpers/is-children.js +2 -1
- package/dist/src/helpers/is-component.js +1 -3
- package/dist/src/helpers/is-html-attribute.d.ts +4 -0
- package/dist/src/helpers/is-html-attribute.js +380 -0
- package/dist/src/helpers/map-refs.js +17 -3
- package/dist/src/helpers/parsers.js +1 -2
- package/dist/src/helpers/render-imports.d.ts +18 -2
- package/dist/src/helpers/render-imports.js +100 -54
- package/dist/src/helpers/render-imports.test.d.ts +1 -0
- package/dist/src/helpers/render-imports.test.js +19 -0
- package/dist/src/helpers/replace-idenifiers.js +5 -7
- package/dist/src/helpers/strip-state-and-props-refs.d.ts +4 -1
- package/dist/src/helpers/strip-state-and-props-refs.js +24 -6
- package/dist/src/helpers/styles/collect-css.d.ts +6 -0
- package/dist/src/helpers/styles/collect-css.js +87 -0
- package/dist/src/helpers/styles/collect-css.test.d.ts +1 -0
- package/dist/src/helpers/styles/collect-css.test.js +18 -0
- package/dist/src/helpers/styles/collect-styled-components.d.ts +2 -0
- package/dist/src/helpers/styles/collect-styled-components.js +61 -0
- package/dist/src/helpers/{collect-styles.d.ts → styles/helpers.d.ts} +5 -10
- package/dist/src/helpers/styles/helpers.js +61 -0
- package/dist/src/helpers/typescript.d.ts +2 -0
- package/dist/src/{jsx-types.js → helpers/typescript.js} +0 -0
- package/dist/src/index.d.ts +7 -4
- package/dist/src/index.js +24 -8
- package/dist/src/modules/plugins.d.ts +1 -1
- package/dist/src/parsers/angular.js +22 -34
- package/dist/src/parsers/builder.d.ts +25 -23
- package/dist/src/parsers/builder.js +59 -67
- package/dist/src/parsers/jsx.d.ts +2 -1
- package/dist/src/parsers/jsx.js +300 -93
- package/dist/src/parsers/liquid.js +51 -149
- package/dist/src/plugins/compile-away-builder-components.js +158 -115
- package/dist/src/symbols/symbol-processor.js +10 -7
- package/dist/src/targets.d.ts +7 -5
- package/dist/src/targets.js +7 -1
- package/dist/src/types/config.d.ts +42 -13
- package/dist/src/types/mitosis-component.d.ts +31 -10
- package/dist/src/types/mitosis-node.d.ts +15 -9
- package/dist/src/types/transpiler.d.ts +14 -0
- package/dist/src/types/transpiler.js +2 -0
- package/dist/test/qwik/Accordion/low.jsx +9 -3
- package/dist/test/qwik/Accordion/med.jsx +2 -8
- package/dist/test/qwik/For/low.jsx +29 -25
- package/dist/test/qwik/For/med.jsx +2 -8
- package/dist/test/qwik/Image/high.js +1 -1
- package/dist/test/qwik/Image/med.js +15 -13
- package/dist/test/qwik/Image.slow/high.js +1 -1
- package/dist/test/qwik/Image.slow/med.js +15 -13
- package/dist/test/qwik/bindings/low.cjs +12 -3
- package/dist/test/qwik/bindings/med.cjs +1 -10
- package/dist/test/qwik/button/high.js +1 -1
- package/dist/test/qwik/button/low.js +9 -3
- package/dist/test/qwik/button/med.js +2 -8
- package/dist/test/qwik/component/bindings/low.jsx +48 -5
- package/dist/test/qwik/component/bindings/med.jsx +3 -49
- package/dist/test/qwik/component/component/inputs/high.cjsx +1 -1
- package/dist/test/qwik/component/component/inputs/med.cjsx +8 -9
- package/dist/test/qwik/for-loop.bindings/high.cjs +0 -0
- package/dist/test/qwik/for-loop.bindings/low.cjs +46 -0
- package/dist/test/qwik/for-loop.bindings/med.cjs +5 -0
- package/dist/test/qwik/hello_world/stylesheet/low.jsx +9 -3
- package/dist/test/qwik/hello_world/stylesheet/med.jsx +2 -8
- package/dist/test/qwik/mount/high.cjs +0 -0
- package/dist/test/qwik/mount/low.cjs +45 -0
- package/dist/test/qwik/mount/med.cjs +3 -0
- package/dist/test/qwik/page-with-symbol/low.js +9 -3
- package/dist/test/qwik/page-with-symbol/med.js +2 -8
- package/dist/test/qwik/show-hide/high.jsx +1 -1
- package/dist/test/qwik/show-hide/med.jsx +15 -13
- package/dist/test/qwik/svg/low.js +9 -3
- package/dist/test/qwik/svg/med.js +2 -8
- package/dist/test/qwik/todo/Todo.cjs/high.cjs +6 -10
- package/dist/test/qwik/todo/Todo.cjs/med.cjs +9 -9
- package/dist/test/qwik/todo/Todo.js/high.js +7 -10
- package/dist/test/qwik/todo/Todo.js/med.js +9 -9
- package/dist/test/qwik/todo/Todo.tsx/high.tsx +7 -10
- package/dist/test/qwik/todo/Todo.tsx/med.tsx +9 -9
- package/dist/test/qwik/todos/Todo.tsx/high.tsx +1 -1
- package/dist/test/qwik/todos/Todo.tsx/low.tsx +15 -12
- package/dist/test/qwik/todos/Todo.tsx/med.tsx +1 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -6
- package/README.md +0 -239
- package/dist/src/__tests__/data/blocks/onUpdate.raw copy.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/onUpdate.raw copy.jsx +0 -10
- package/dist/src/__tests__/data/blocks/slot.raw.d.ts +0 -5
- package/dist/src/__tests__/data/blocks/slot.raw.jsx +0 -6
- package/dist/src/__tests__/data/blocks/styles.raw.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/styles.raw.jsx +0 -10
- package/dist/src/helpers/babel-transform copy.d.ts +0 -8
- package/dist/src/helpers/babel-transform copy.js +0 -138
- package/dist/src/helpers/collect-styles.js +0 -178
- package/dist/src/jsx-types.d.ts +0 -1171
|
@@ -99,7 +99,8 @@ exports.components = {
|
|
|
99
99
|
}), components);
|
|
100
100
|
},
|
|
101
101
|
BuilderAccordion: function (node, context, components) {
|
|
102
|
-
var
|
|
102
|
+
var _a;
|
|
103
|
+
var itemsJSON = ((_a = node.bindings.items) === null || _a === void 0 ? void 0 : _a.code) || '[]';
|
|
103
104
|
var accordionItems = JSON5.parse(itemsJSON);
|
|
104
105
|
var children = accordionItems.map(function (accordionItem) {
|
|
105
106
|
var titleChildren = accordionItem.title.map(function (element) {
|
|
@@ -169,36 +170,41 @@ exports.components = {
|
|
|
169
170
|
}), components);
|
|
170
171
|
},
|
|
171
172
|
CoreSection: function (node, context, components) {
|
|
173
|
+
var _a, _b;
|
|
172
174
|
return wrapOutput(node, (0, create_mitosis_node_1.createMitosisNode)({
|
|
173
175
|
name: 'section',
|
|
174
|
-
properties: __assign(__assign(__assign({}, node.properties), { $name: 'section' }), (node.bindings.lazyLoad === 'true' && {
|
|
176
|
+
properties: __assign(__assign(__assign({}, node.properties), { $name: 'section' }), (((_a = node.bindings.lazyLoad) === null || _a === void 0 ? void 0 : _a.code) === 'true' && {
|
|
175
177
|
lazyLoad: 'true',
|
|
176
178
|
})),
|
|
177
179
|
bindings: {
|
|
178
|
-
css:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
180
|
+
css: {
|
|
181
|
+
code: JSON.stringify({
|
|
182
|
+
width: '100%',
|
|
183
|
+
alignSelf: 'stretch',
|
|
184
|
+
flexGrow: '1',
|
|
185
|
+
boxSizing: 'border-box',
|
|
186
|
+
maxWidth: "".concat((((_b = node.bindings.maxWidth) === null || _b === void 0 ? void 0 : _b.code) && Number(node.bindings.maxWidth.code)) || 1200, "px"),
|
|
187
|
+
display: 'flex',
|
|
188
|
+
flexDirection: 'column',
|
|
189
|
+
alignItems: 'stretch',
|
|
190
|
+
marginLeft: 'auto',
|
|
191
|
+
marginRight: 'auto',
|
|
192
|
+
}),
|
|
193
|
+
},
|
|
190
194
|
},
|
|
191
195
|
children: node.children,
|
|
192
196
|
}), components);
|
|
193
197
|
},
|
|
194
198
|
Columns: function (node, context, components) {
|
|
195
199
|
var _a;
|
|
196
|
-
var columns = node.children.filter(filter_empty_text_nodes_1.filterEmptyTextNodes).map(function (item) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
var columns = node.children.filter(filter_empty_text_nodes_1.filterEmptyTextNodes).map(function (item) {
|
|
201
|
+
var _a;
|
|
202
|
+
return ({
|
|
203
|
+
width: parseFloat(item.properties.width || ((_a = item.bindings.width) === null || _a === void 0 ? void 0 : _a.code) || '0') || 0,
|
|
204
|
+
children: item.children,
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
var gutterSize = (node.properties.getterSize && parseFloat(node.properties.getterSize)) || 20;
|
|
202
208
|
function getWidth(index) {
|
|
203
209
|
return (columns[index] && columns[index].width) || 100 / columns.length;
|
|
204
210
|
}
|
|
@@ -213,16 +219,18 @@ exports.components = {
|
|
|
213
219
|
class: 'builder-columns',
|
|
214
220
|
},
|
|
215
221
|
bindings: {
|
|
216
|
-
css:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
css: {
|
|
223
|
+
code: JSON.stringify(__assign({ display: 'flex' }, (properties.stackColumnsAt === 'never'
|
|
224
|
+
? {}
|
|
225
|
+
: (_a = {},
|
|
226
|
+
_a["@media (max-width: ".concat(properties.stackColumnsAt !== 'tablet' ? 639 : 999, "px)")] = {
|
|
227
|
+
flexDirection: properties.reverseColumnsWhenStacked === 'true'
|
|
228
|
+
? 'column-reverse'
|
|
229
|
+
: 'column',
|
|
230
|
+
alignItems: 'stretch',
|
|
231
|
+
},
|
|
232
|
+
_a)))),
|
|
233
|
+
},
|
|
226
234
|
},
|
|
227
235
|
children: columns.map(function (col, index) {
|
|
228
236
|
var _a;
|
|
@@ -233,14 +241,16 @@ exports.components = {
|
|
|
233
241
|
class: 'builder-column',
|
|
234
242
|
},
|
|
235
243
|
bindings: {
|
|
236
|
-
css:
|
|
237
|
-
?
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
width: '
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
css: {
|
|
245
|
+
code: JSON.stringify(__assign({ display: 'flex', flexDirection: 'column', alignItems: 'stretch', lineHeight: 'normal', width: "".concat(getColumnWidth(index)), marginLeft: "".concat(index === 0 ? 0 : gutterSize, "px") }, (properties.stackColumnsAt === 'never'
|
|
246
|
+
? {}
|
|
247
|
+
: (_a = {},
|
|
248
|
+
_a["@media (max-width: ".concat(properties.stackColumnsAt !== 'tablet' ? 639 : 999, "px)")] = {
|
|
249
|
+
width: '100%',
|
|
250
|
+
marginLeft: 0,
|
|
251
|
+
},
|
|
252
|
+
_a)))),
|
|
253
|
+
},
|
|
244
254
|
},
|
|
245
255
|
children: col.children,
|
|
246
256
|
});
|
|
@@ -248,17 +258,18 @@ exports.components = {
|
|
|
248
258
|
}), components);
|
|
249
259
|
},
|
|
250
260
|
Image: function (node, context, components) {
|
|
251
|
-
var _a
|
|
261
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
262
|
+
var _h = node.properties, backgroundSize = _h.backgroundSize, backgroundPosition = _h.backgroundPosition;
|
|
252
263
|
var srcset = node.properties.srcset;
|
|
253
|
-
var aspectRatio = node.bindings.aspectRatio
|
|
254
|
-
? parseFloat(node.bindings.aspectRatio)
|
|
264
|
+
var aspectRatio = ((_a = node.bindings.aspectRatio) === null || _a === void 0 ? void 0 : _a.code)
|
|
265
|
+
? parseFloat(node.bindings.aspectRatio.code)
|
|
255
266
|
: null;
|
|
256
267
|
if (typeof aspectRatio === 'number' && isNaN(aspectRatio)) {
|
|
257
268
|
aspectRatio = null;
|
|
258
269
|
}
|
|
259
270
|
var image = node.properties.image;
|
|
260
271
|
var srcSet = srcset || generateBuilderIoSrcSet(image);
|
|
261
|
-
var source = node.bindings.noWebp !== 'true' &&
|
|
272
|
+
var source = ((_b = node.bindings.noWebp) === null || _b === void 0 ? void 0 : _b.code) !== 'true' &&
|
|
262
273
|
(0, create_mitosis_node_1.createMitosisNode)({
|
|
263
274
|
name: 'source',
|
|
264
275
|
properties: {
|
|
@@ -270,24 +281,25 @@ exports.components = {
|
|
|
270
281
|
name: 'img',
|
|
271
282
|
properties: noUndefined({
|
|
272
283
|
$name: 'image',
|
|
273
|
-
loading:
|
|
284
|
+
loading: 'lazy',
|
|
274
285
|
src: node.properties.image,
|
|
275
286
|
sizes: node.properties.sizes,
|
|
276
287
|
srcset: srcSet || null,
|
|
277
288
|
}),
|
|
278
289
|
bindings: noUndefined({
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
290
|
+
src: ((_c = node.bindings.image) === null || _c === void 0 ? void 0 : _c.code) && { code: (_d = node.bindings.image) === null || _d === void 0 ? void 0 : _d.code },
|
|
291
|
+
sizes: ((_e = node.bindings.sizes) === null || _e === void 0 ? void 0 : _e.code) && { code: (_f = node.bindings.sizes) === null || _f === void 0 ? void 0 : _f.code },
|
|
292
|
+
css: {
|
|
293
|
+
code: JSON.stringify(__assign({ objectFit: backgroundSize || 'cover', objectPosition: backgroundPosition || 'cover' }, (aspectRatio
|
|
294
|
+
? {
|
|
295
|
+
position: 'absolute',
|
|
296
|
+
height: '100%',
|
|
297
|
+
width: '100%',
|
|
298
|
+
top: '0',
|
|
299
|
+
left: '0',
|
|
300
|
+
}
|
|
301
|
+
: {}))),
|
|
302
|
+
},
|
|
291
303
|
}),
|
|
292
304
|
});
|
|
293
305
|
var picture = (0, create_mitosis_node_1.createMitosisNode)({
|
|
@@ -302,12 +314,14 @@ exports.components = {
|
|
|
302
314
|
class: 'builder-image-sizer',
|
|
303
315
|
},
|
|
304
316
|
bindings: {
|
|
305
|
-
css:
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
317
|
+
css: {
|
|
318
|
+
code: JSON.stringify({
|
|
319
|
+
width: '100%',
|
|
320
|
+
paddingTop: aspectRatio * 100 + '%',
|
|
321
|
+
pointerEvents: 'none',
|
|
322
|
+
fontSize: '0',
|
|
323
|
+
}),
|
|
324
|
+
},
|
|
311
325
|
},
|
|
312
326
|
});
|
|
313
327
|
var children = node.children &&
|
|
@@ -318,16 +332,18 @@ exports.components = {
|
|
|
318
332
|
$name: 'image-contents',
|
|
319
333
|
},
|
|
320
334
|
bindings: {
|
|
321
|
-
css:
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
335
|
+
css: {
|
|
336
|
+
code: JSON.stringify({
|
|
337
|
+
display: 'flex',
|
|
338
|
+
flexDirection: 'column',
|
|
339
|
+
alignItems: 'stretch',
|
|
340
|
+
position: 'absolute',
|
|
341
|
+
top: '0',
|
|
342
|
+
left: '0',
|
|
343
|
+
width: '100%',
|
|
344
|
+
height: '100%',
|
|
345
|
+
}),
|
|
346
|
+
},
|
|
331
347
|
},
|
|
332
348
|
children: node.children,
|
|
333
349
|
});
|
|
@@ -335,16 +351,18 @@ exports.components = {
|
|
|
335
351
|
imgSizer && imageNodes.push(imgSizer);
|
|
336
352
|
children && imageNodes.push(children);
|
|
337
353
|
var href = node.properties.href;
|
|
338
|
-
var hrefBinding = node.bindings.href;
|
|
354
|
+
var hrefBinding = (_g = node.bindings.href) === null || _g === void 0 ? void 0 : _g.code;
|
|
339
355
|
if (href || hrefBinding) {
|
|
340
356
|
var aHref = (0, create_mitosis_node_1.createMitosisNode)({
|
|
341
357
|
name: 'a',
|
|
342
358
|
properties: {
|
|
343
359
|
href: href,
|
|
344
360
|
},
|
|
345
|
-
bindings:
|
|
346
|
-
|
|
347
|
-
|
|
361
|
+
bindings: hrefBinding
|
|
362
|
+
? {
|
|
363
|
+
href: { code: hrefBinding },
|
|
364
|
+
}
|
|
365
|
+
: undefined,
|
|
348
366
|
children: imageNodes,
|
|
349
367
|
});
|
|
350
368
|
return wrapOutput(node, aHref, components);
|
|
@@ -354,8 +372,9 @@ exports.components = {
|
|
|
354
372
|
}
|
|
355
373
|
},
|
|
356
374
|
Video: function (node, context, components) {
|
|
357
|
-
var
|
|
358
|
-
|
|
375
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
376
|
+
var aspectRatio = ((_a = node.bindings.aspectRatio) === null || _a === void 0 ? void 0 : _a.code)
|
|
377
|
+
? parseFloat(node.bindings.aspectRatio.code)
|
|
359
378
|
: null;
|
|
360
379
|
if (typeof aspectRatio === 'number' && isNaN(aspectRatio)) {
|
|
361
380
|
aspectRatio = null;
|
|
@@ -374,20 +393,32 @@ exports.components = {
|
|
|
374
393
|
preload: node.properties.lazy ? 'none' : undefined,
|
|
375
394
|
}),
|
|
376
395
|
bindings: noUndefined({
|
|
377
|
-
poster: node.bindings.posterImage
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
396
|
+
poster: ((_b = node.bindings.posterImage) === null || _b === void 0 ? void 0 : _b.code) && {
|
|
397
|
+
code: (_c = node.bindings.posterImage) === null || _c === void 0 ? void 0 : _c.code,
|
|
398
|
+
},
|
|
399
|
+
autoplay: ((_d = node.bindings.autoPlay) === null || _d === void 0 ? void 0 : _d.code) && {
|
|
400
|
+
code: (_e = node.bindings.autoPlay) === null || _e === void 0 ? void 0 : _e.code,
|
|
401
|
+
},
|
|
402
|
+
muted: ((_f = node.bindings.muted) === null || _f === void 0 ? void 0 : _f.code) && {
|
|
403
|
+
code: (_g = node.bindings.muted) === null || _g === void 0 ? void 0 : _g.code,
|
|
404
|
+
},
|
|
405
|
+
controls: ((_h = node.bindings.controls) === null || _h === void 0 ? void 0 : _h.code) && {
|
|
406
|
+
code: (_j = node.bindings.controls) === null || _j === void 0 ? void 0 : _j.code,
|
|
407
|
+
},
|
|
408
|
+
playsinline: ((_k = node.bindings.playsInline) === null || _k === void 0 ? void 0 : _k.code) && {
|
|
409
|
+
code: (_l = node.bindings.playsInline) === null || _l === void 0 ? void 0 : _l.code,
|
|
410
|
+
},
|
|
411
|
+
loop: ((_m = node.bindings.loop) === null || _m === void 0 ? void 0 : _m.code) && { code: (_o = node.bindings.loop) === null || _o === void 0 ? void 0 : _o.code },
|
|
412
|
+
css: {
|
|
413
|
+
code: JSON.stringify({
|
|
414
|
+
width: '100%',
|
|
415
|
+
height: '100%',
|
|
416
|
+
objectFit: node.properties.fit,
|
|
417
|
+
objectPosition: node.properties.position,
|
|
418
|
+
borderRadius: '1',
|
|
419
|
+
position: aspectRatio ? 'absolute' : '',
|
|
420
|
+
}),
|
|
421
|
+
},
|
|
391
422
|
}),
|
|
392
423
|
children: [
|
|
393
424
|
(0, create_mitosis_node_1.createMitosisNode)({
|
|
@@ -396,9 +427,11 @@ exports.components = {
|
|
|
396
427
|
type: 'video/mp4',
|
|
397
428
|
src: node.properties.video,
|
|
398
429
|
},
|
|
399
|
-
bindings: {
|
|
400
|
-
src: node.bindings.video
|
|
401
|
-
|
|
430
|
+
bindings: noUndefined({
|
|
431
|
+
src: ((_p = node.bindings.video) === null || _p === void 0 ? void 0 : _p.code) && {
|
|
432
|
+
code: (_q = node.bindings.video) === null || _q === void 0 ? void 0 : _q.code,
|
|
433
|
+
},
|
|
434
|
+
}),
|
|
402
435
|
}),
|
|
403
436
|
],
|
|
404
437
|
}));
|
|
@@ -409,12 +442,14 @@ exports.components = {
|
|
|
409
442
|
$name: 'builder-video-sizer',
|
|
410
443
|
},
|
|
411
444
|
bindings: {
|
|
412
|
-
css:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
445
|
+
css: {
|
|
446
|
+
code: JSON.stringify({
|
|
447
|
+
width: '100%',
|
|
448
|
+
paddingTop: aspectRatio * 100 + '%',
|
|
449
|
+
pointerEvents: 'none',
|
|
450
|
+
fontSize: '0',
|
|
451
|
+
}),
|
|
452
|
+
},
|
|
418
453
|
},
|
|
419
454
|
}));
|
|
420
455
|
node.children &&
|
|
@@ -425,16 +460,18 @@ exports.components = {
|
|
|
425
460
|
$name: 'image-contents',
|
|
426
461
|
},
|
|
427
462
|
bindings: {
|
|
428
|
-
css:
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
463
|
+
css: {
|
|
464
|
+
code: JSON.stringify({
|
|
465
|
+
display: 'flex',
|
|
466
|
+
flexDirection: 'column',
|
|
467
|
+
alignItems: 'stretch',
|
|
468
|
+
position: 'absolute',
|
|
469
|
+
top: '0',
|
|
470
|
+
left: '0',
|
|
471
|
+
width: '100%',
|
|
472
|
+
height: '100%',
|
|
473
|
+
}),
|
|
474
|
+
},
|
|
438
475
|
},
|
|
439
476
|
children: node.children,
|
|
440
477
|
}));
|
|
@@ -444,7 +481,7 @@ exports.components = {
|
|
|
444
481
|
$name: 'video-container',
|
|
445
482
|
},
|
|
446
483
|
bindings: {
|
|
447
|
-
css: JSON.stringify({ position: 'relative' }),
|
|
484
|
+
css: { code: JSON.stringify({ position: 'relative' }) },
|
|
448
485
|
},
|
|
449
486
|
children: videoContainerNodes,
|
|
450
487
|
});
|
|
@@ -496,9 +533,7 @@ function generateBuilderIoSrcSet(image) {
|
|
|
496
533
|
var isBuilderIo = !!(image || '').match(/builder\.io/);
|
|
497
534
|
return isBuilderIo
|
|
498
535
|
? [100, 200, 400, 800, 1200, 1600, 2000]
|
|
499
|
-
.map(function (size) {
|
|
500
|
-
return "".concat(updateQueryParam(image, 'width', String(size)), " ").concat(size, "w");
|
|
501
|
-
})
|
|
536
|
+
.map(function (size) { return "".concat(updateQueryParam(image, 'width', String(size)), " ").concat(size, "w"); })
|
|
502
537
|
.concat([image])
|
|
503
538
|
.join(', ')
|
|
504
539
|
: '';
|
|
@@ -509,7 +544,15 @@ function noUndefined(obj) {
|
|
|
509
544
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
510
545
|
var value = obj[key];
|
|
511
546
|
if (value != null) {
|
|
512
|
-
|
|
547
|
+
if (typeof value == 'object') {
|
|
548
|
+
var ret = noUndefined(value);
|
|
549
|
+
if (Object.keys(ret).length) {
|
|
550
|
+
cleanObj[key] = ret;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
else {
|
|
554
|
+
cleanObj[key] = value;
|
|
555
|
+
}
|
|
513
556
|
}
|
|
514
557
|
}
|
|
515
558
|
}
|
|
@@ -28,9 +28,7 @@ function ensureAllSymbolsHaveIds(content) {
|
|
|
28
28
|
var ids = new Set();
|
|
29
29
|
(0, traverse_1.forEach)(content, function (el) {
|
|
30
30
|
var _a, _b, _c;
|
|
31
|
-
if (this.key === 'jsCode' &&
|
|
32
|
-
isString(el) &&
|
|
33
|
-
el.endsWith('return _virtual_index')) {
|
|
31
|
+
if (this.key === 'jsCode' && isString(el) && el.endsWith('return _virtual_index')) {
|
|
34
32
|
// Sometimes rollup adds a final `return _virtual_index` but that causes VM evaluation to fail.
|
|
35
33
|
// Instead of a return on the last line, it needs a plain expression on the last line. Luckily
|
|
36
34
|
// because the rollup compile behavior is consistent this works pretty reliably
|
|
@@ -63,7 +61,12 @@ exports.ensureAllSymbolsHaveIds = ensureAllSymbolsHaveIds;
|
|
|
63
61
|
//TODO(misko): needs test
|
|
64
62
|
function convertBuilderContentToSymbolHierarchy(content, _a) {
|
|
65
63
|
var _b;
|
|
66
|
-
var _c
|
|
64
|
+
var _c, _d;
|
|
65
|
+
var _e = _a === void 0 ? {} : _a, collectComponentStyles = _e.collectComponentStyles, collectComponentState = _e.collectComponentState;
|
|
66
|
+
if (collectComponentState && ((_c = content.data) === null || _c === void 0 ? void 0 : _c.state)) {
|
|
67
|
+
var state = (_d = content.data) === null || _d === void 0 ? void 0 : _d.state;
|
|
68
|
+
collectComponentState['ROOT_COMPONENT_STATE'] = state;
|
|
69
|
+
}
|
|
67
70
|
var path = [-1, content.id];
|
|
68
71
|
var hierarchy = (_b = {
|
|
69
72
|
depthFirstSymbols: []
|
|
@@ -76,7 +79,7 @@ function convertBuilderContentToSymbolHierarchy(content, _a) {
|
|
|
76
79
|
if (cssCode) {
|
|
77
80
|
collectComponentStyles && collectComponentStyles.push((0, minify_1.minify)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", ""], ["", ""])), cssCode));
|
|
78
81
|
}
|
|
79
|
-
while (path[0 /* DEPTH */] >= this.path.length) {
|
|
82
|
+
while (path[0 /* Path.DEPTH */] >= this.path.length) {
|
|
80
83
|
path.shift();
|
|
81
84
|
path.shift();
|
|
82
85
|
}
|
|
@@ -92,10 +95,10 @@ function convertBuilderContentToSymbolHierarchy(content, _a) {
|
|
|
92
95
|
collectComponentState[id] = state;
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
|
-
if (path[0 /* DEPTH */] < this.path.length) {
|
|
98
|
+
if (path[0 /* Path.DEPTH */] < this.path.length) {
|
|
96
99
|
var id = getIdFromSymbol(el);
|
|
97
100
|
hierarchy[id] = [];
|
|
98
|
-
addIfMissing(hierarchy[path[1 /* ID */]], id);
|
|
101
|
+
addIfMissing(hierarchy[path[1 /* Path.ID */]], id);
|
|
99
102
|
path.unshift(this.path.length, id);
|
|
100
103
|
}
|
|
101
104
|
// TODO(misko): This should be `el.content` not `el`
|
package/dist/src/targets.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const targets: {
|
|
|
2
2
|
angular: (options?: import("./generators/angular").ToAngularOptions) => import(".").Transpiler;
|
|
3
3
|
builder: (options?: import("./generators/builder").ToBuilderOptions) => ({ component }: import(".").TranspilerArgs) => {
|
|
4
4
|
data: {
|
|
5
|
-
httpRequests:
|
|
5
|
+
httpRequests: import("./types/json").JSON;
|
|
6
6
|
jsCode: string;
|
|
7
7
|
tsCode: string;
|
|
8
8
|
blocks: import("@builder.io/sdk").BuilderElement[];
|
|
@@ -15,11 +15,13 @@ export declare const targets: {
|
|
|
15
15
|
react: (reactOptions?: import("./generators/react").ToReactOptions) => import(".").Transpiler;
|
|
16
16
|
reactNative: (options?: import("./generators/react-native").ToReactNativeOptions) => import(".").Transpiler;
|
|
17
17
|
solid: (options?: import("./generators/solid").ToSolidOptions) => import(".").Transpiler;
|
|
18
|
-
svelte: (options?: import("./generators/svelte").ToSvelteOptions) => import(".").Transpiler;
|
|
18
|
+
svelte: ({ plugins, ...options }?: import("./generators/svelte").ToSvelteOptions) => import(".").Transpiler;
|
|
19
19
|
swift: (options?: import("./generators/swift-ui").ToSwiftOptions) => import(".").Transpiler;
|
|
20
20
|
template: (options?: import("./generators/template").ToTemplateOptions) => import(".").Transpiler;
|
|
21
21
|
webcomponent: (options?: import("./generators/html").ToHtmlOptions) => import(".").Transpiler;
|
|
22
|
-
vue: (
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
vue: (vueOptions?: Omit<import("./generators/vue").ToVueOptions, "vueVersion"> | undefined) => import(".").Transpiler;
|
|
23
|
+
vue2: (vueOptions?: Omit<import("./generators/vue").ToVueOptions, "vueVersion"> | undefined) => import(".").Transpiler;
|
|
24
|
+
vue3: (vueOptions?: Omit<import("./generators/vue").ToVueOptions, "vueVersion"> | undefined) => import(".").Transpiler;
|
|
25
|
+
stencil: (options?: import("./generators/stencil").ToStencilOptions) => import(".").Transpiler;
|
|
26
|
+
qwik: (userOptions?: import("./generators/qwik/component-generator").ToQwikOptions) => import(".").Transpiler;
|
|
25
27
|
};
|
package/dist/src/targets.js
CHANGED
|
@@ -13,6 +13,8 @@ var svelte_1 = require("./generators/svelte");
|
|
|
13
13
|
var swift_ui_1 = require("./generators/swift-ui");
|
|
14
14
|
var template_1 = require("./generators/template");
|
|
15
15
|
var vue_1 = require("./generators/vue");
|
|
16
|
+
var stencil_1 = require("./generators/stencil");
|
|
17
|
+
var qwik_1 = require("./generators/qwik");
|
|
16
18
|
exports.targets = {
|
|
17
19
|
angular: angular_1.componentToAngular,
|
|
18
20
|
builder: builder_1.componentToBuilder,
|
|
@@ -27,5 +29,9 @@ exports.targets = {
|
|
|
27
29
|
swift: swift_ui_1.componentToSwift,
|
|
28
30
|
template: template_1.componentToTemplate,
|
|
29
31
|
webcomponent: html_1.componentToCustomElement,
|
|
30
|
-
vue: vue_1.
|
|
32
|
+
vue: vue_1.componentToVue3,
|
|
33
|
+
vue2: vue_1.componentToVue2,
|
|
34
|
+
vue3: vue_1.componentToVue3,
|
|
35
|
+
stencil: stencil_1.componentToStencil,
|
|
36
|
+
qwik: qwik_1.componentToQwik,
|
|
31
37
|
};
|
|
@@ -1,25 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare type Format = 'esm' | 'cjs';
|
|
2
|
+
export declare type Language = 'js' | 'ts';
|
|
3
|
+
interface TranspilerOptions {
|
|
4
|
+
format?: Format;
|
|
5
|
+
languages?: Language[];
|
|
6
|
+
}
|
|
3
7
|
declare type Targets = typeof import('../targets').targets;
|
|
4
8
|
export declare type Target = keyof Targets;
|
|
5
9
|
export declare type GeneratorOptions = {
|
|
6
|
-
[K in
|
|
10
|
+
[K in Target]: NonNullable<Parameters<Targets[K]>[0]> & {
|
|
11
|
+
transpiler?: TranspilerOptions;
|
|
12
|
+
};
|
|
7
13
|
};
|
|
8
|
-
export interface TranspilerArgs {
|
|
9
|
-
path?: string;
|
|
10
|
-
component: MitosisComponent;
|
|
11
|
-
}
|
|
12
|
-
export declare type Transpiler = (args: TranspilerArgs) => string;
|
|
13
|
-
export interface BaseTranspilerOptions {
|
|
14
|
-
prettier?: boolean;
|
|
15
|
-
plugins?: Plugin[];
|
|
16
|
-
}
|
|
17
14
|
export declare type MitosisConfig = {
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* List of targets to compile to.
|
|
17
|
+
*/
|
|
19
18
|
targets: Target[];
|
|
19
|
+
/**
|
|
20
|
+
* The output directory. Defaults to `output`.
|
|
21
|
+
*/
|
|
20
22
|
dest?: string;
|
|
23
|
+
/**
|
|
24
|
+
* globs of files to transpile. Defaults to `src/*`.
|
|
25
|
+
*/
|
|
21
26
|
files?: string | string[];
|
|
27
|
+
/**
|
|
28
|
+
* The directory where overrides are stored. The structure of the override directory must match that of the source code,
|
|
29
|
+
* with each target having its own sub-directory: `${overridesDir}/${target}/*`
|
|
30
|
+
* Defaults to `overrides`.
|
|
31
|
+
*/
|
|
22
32
|
overridesDir?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Dictionary of per-target configuration. For each target, the available options can be inspected by going to
|
|
35
|
+
* `packages/core/src/targets.ts` and looking at the first argument of the desired generator.
|
|
36
|
+
*
|
|
37
|
+
* Example:
|
|
38
|
+
*
|
|
39
|
+
* ```js
|
|
40
|
+
* options: {
|
|
41
|
+
* vue: {
|
|
42
|
+
* prettier: false,
|
|
43
|
+
* namePrefix: (path) => path + '-my-vue-code',
|
|
44
|
+
* },
|
|
45
|
+
* react: {
|
|
46
|
+
* stateType: 'builder';
|
|
47
|
+
* stylesType: 'styled-jsx'
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
23
52
|
options: Partial<GeneratorOptions>;
|
|
24
53
|
};
|
|
25
54
|
export {};
|
|
@@ -27,9 +27,20 @@ export interface MitosisImport {
|
|
|
27
27
|
[key: string]: string | undefined;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
export interface ContextGetInfo {
|
|
31
31
|
name: string;
|
|
32
32
|
path: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ContextSetInfo {
|
|
35
|
+
name: string;
|
|
36
|
+
value?: JSONObject;
|
|
37
|
+
ref?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare type ContextGet = {
|
|
40
|
+
[key: string]: ContextGetInfo;
|
|
41
|
+
};
|
|
42
|
+
export declare type ContextSet = {
|
|
43
|
+
[key: string]: ContextSetInfo;
|
|
33
44
|
};
|
|
34
45
|
export declare type extendedHook = {
|
|
35
46
|
code: string;
|
|
@@ -39,28 +50,36 @@ export declare type MitosisComponentInput = {
|
|
|
39
50
|
name: string;
|
|
40
51
|
defaultValue: any;
|
|
41
52
|
};
|
|
53
|
+
export declare type MitosisExport = {
|
|
54
|
+
[name: string]: {
|
|
55
|
+
code: string;
|
|
56
|
+
usedInLocal?: boolean;
|
|
57
|
+
isFunction?: boolean;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
42
60
|
export declare type MitosisComponent = {
|
|
43
61
|
'@type': '@builder.io/mitosis/component';
|
|
44
62
|
name: string;
|
|
45
63
|
imports: MitosisImport[];
|
|
64
|
+
exports?: MitosisExport;
|
|
46
65
|
meta: JSONObject & {
|
|
47
66
|
useMetadata?: JSONObject;
|
|
48
67
|
};
|
|
49
68
|
inputs: MitosisComponentInput[];
|
|
50
69
|
state: JSONObject;
|
|
51
70
|
context: {
|
|
52
|
-
get:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
71
|
+
get: ContextGet;
|
|
72
|
+
set: ContextSet;
|
|
73
|
+
};
|
|
74
|
+
refs: {
|
|
75
|
+
[useRef: string]: {
|
|
76
|
+
typeParameter?: string;
|
|
77
|
+
argument: string;
|
|
60
78
|
};
|
|
61
79
|
};
|
|
62
80
|
hooks: {
|
|
63
81
|
init?: extendedHook;
|
|
82
|
+
onInit?: extendedHook;
|
|
64
83
|
onMount?: extendedHook;
|
|
65
84
|
onUnMount?: extendedHook;
|
|
66
85
|
preComponent?: extendedHook;
|
|
@@ -69,5 +88,7 @@ export declare type MitosisComponent = {
|
|
|
69
88
|
};
|
|
70
89
|
children: MitosisNode[];
|
|
71
90
|
subComponents: MitosisComponent[];
|
|
91
|
+
types?: string[];
|
|
92
|
+
interfaces?: string[];
|
|
93
|
+
propsTypeRef?: string;
|
|
72
94
|
};
|
|
73
|
-
export {};
|