@builder.io/mitosis 0.0.45 → 0.0.46
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__/builder.test.js +71 -68
- package/dist/src/__tests__/context.test.js +13 -10
- package/dist/src/__tests__/data/basic.raw.jsx +1 -1
- package/dist/src/__tests__/data/blocks/button-with-metadata.raw.jsx +1 -1
- package/dist/src/__tests__/data/blocks/columns.raw.jsx +2 -2
- package/dist/src/__tests__/data/blocks/custom-code.raw.jsx +3 -3
- package/dist/src/__tests__/data/blocks/embed.raw.jsx +3 -3
- package/dist/src/__tests__/data/blocks/form.raw.jsx +5 -5
- package/dist/src/__tests__/data/blocks/image.raw.jsx +4 -4
- package/dist/src/__tests__/data/blocks/stamped-io.raw.jsx +4 -4
- package/dist/src/__tests__/data/context/component-with-context.lite.jsx +2 -2
- package/dist/src/__tests__/data/context/simple.context.lite.js +1 -1
- package/dist/src/__tests__/html.test.js +2 -2
- package/dist/src/__tests__/liquid.test.js +34 -34
- package/dist/src/__tests__/parse-jsx.test.js +1 -1
- package/dist/src/__tests__/qwik.test.js +36 -36
- package/dist/src/__tests__/react-native.test.js +35 -35
- package/dist/src/__tests__/react.test.js +35 -35
- package/dist/src/__tests__/solid.test.js +32 -32
- package/dist/src/__tests__/vue.test.js +35 -34
- package/dist/src/generators/angular.d.ts +4 -7
- package/dist/src/generators/angular.js +77 -81
- package/dist/src/generators/builder.d.ts +4 -4
- package/dist/src/generators/builder.js +57 -57
- package/dist/src/generators/context/react.d.ts +3 -1
- package/dist/src/generators/context/react.js +20 -17
- package/dist/src/generators/html.d.ts +5 -9
- package/dist/src/generators/html.js +205 -199
- package/dist/src/generators/liquid.d.ts +5 -9
- package/dist/src/generators/liquid.js +62 -59
- package/dist/src/generators/mitosis.d.ts +6 -7
- package/dist/src/generators/mitosis.js +61 -63
- package/dist/src/generators/qwik/component.js +13 -13
- package/dist/src/generators/qwik/handlers.js +12 -8
- package/dist/src/generators/qwik/jsx.js +13 -9
- package/dist/src/generators/qwik/styles.js +11 -7
- package/dist/src/generators/react-native.d.ts +4 -7
- package/dist/src/generators/react-native.js +25 -22
- package/dist/src/generators/react.d.ts +4 -8
- package/dist/src/generators/react.js +103 -112
- package/dist/src/generators/solid.d.ts +4 -8
- package/dist/src/generators/solid.js +55 -54
- package/dist/src/generators/svelte.d.ts +4 -7
- package/dist/src/generators/svelte.js +120 -123
- package/dist/src/generators/swift-ui.d.ts +2 -2
- package/dist/src/generators/swift-ui.js +62 -62
- package/dist/src/generators/template.d.ts +4 -8
- package/dist/src/generators/template.js +48 -45
- package/dist/src/generators/vue.d.ts +9 -9
- package/dist/src/generators/vue.js +169 -169
- package/dist/src/helpers/babel-transform.js +9 -9
- package/dist/src/helpers/collect-styles.js +39 -39
- package/dist/src/helpers/dash-case.js +1 -1
- package/dist/src/helpers/generic-format.test.js +2 -2
- package/dist/src/helpers/get-components-used.js +2 -2
- package/dist/src/helpers/get-components.js +3 -3
- package/dist/src/helpers/get-props.js +1 -1
- package/dist/src/helpers/get-refs.js +2 -2
- package/dist/src/helpers/get-state-object-string.js +5 -5
- package/dist/src/helpers/get-state-used.js +1 -1
- package/dist/src/helpers/get-styles.js +1 -1
- package/dist/src/helpers/getters-to-functions.js +4 -4
- package/dist/src/helpers/handle-missing-state.js +1 -1
- package/dist/src/helpers/has-component.js +2 -2
- package/dist/src/helpers/has-props.js +1 -1
- package/dist/src/helpers/is-children.js +1 -1
- package/dist/src/helpers/json.d.ts +1 -0
- package/dist/src/helpers/json.js +17 -0
- package/dist/src/helpers/map-refs.js +4 -4
- package/dist/src/helpers/map-to-attributes.js +4 -4
- package/dist/src/helpers/map-to-css.js +2 -2
- package/dist/src/helpers/parse-node.js +2 -2
- package/dist/src/helpers/parse-reactive-script.js +4 -4
- package/dist/src/helpers/process-http-requests.js +1 -1
- package/dist/src/helpers/process-tag-references.js +4 -4
- package/dist/src/helpers/remove-surrounding-block.test.js +1 -1
- package/dist/src/helpers/render-imports.js +7 -7
- package/dist/src/helpers/replace-idenifiers.js +1 -1
- package/dist/src/helpers/strip-meta-properties.js +2 -2
- package/dist/src/helpers/trace-reference-to-module-path.js +1 -1
- package/dist/src/helpers/traverse-nodes.js +2 -2
- package/dist/src/helpers/try-prettier-format.js +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/modules/plugins.d.ts +2 -10
- package/dist/src/parsers/angular.js +13 -13
- package/dist/src/parsers/builder.js +54 -58
- package/dist/src/parsers/context.js +2 -2
- package/dist/src/parsers/jsx.js +59 -87
- package/dist/src/parsers/liquid.js +191 -194
- package/dist/src/plugins/compile-away-builder-components.js +49 -45
- package/dist/src/plugins/compile-away-components.js +3 -3
- package/dist/src/plugins/map-styles.js +3 -3
- package/dist/src/targets.d.ts +24 -0
- package/dist/src/targets.js +30 -0
- package/dist/src/types/config.d.ts +31 -0
- package/dist/src/types/{jsx-lite-component.js → config.js} +0 -0
- package/dist/{test/qwik/Todo/Todo.js/low.js → src/types/generators.d.ts} +0 -0
- package/dist/src/types/generators.js +1 -0
- package/dist/src/types/plugins.d.ts +11 -0
- package/dist/src/types/{jsx-lite-context.js → plugins.js} +0 -0
- package/dist/test/qwik/{Todo → todo}/Todo.cjs/high.cjs +0 -0
- package/dist/test/qwik/{Todo → todo}/Todo.cjs/low.cjs +0 -0
- package/dist/test/qwik/{Todo → todo}/Todo.cjs/med.cjs +0 -0
- package/dist/test/qwik/{Todo → todo}/Todo.js/high.js +0 -0
- package/dist/test/qwik/{qwik/todo → todo}/Todo.js/low.js +0 -0
- package/dist/test/qwik/{Todo → todo}/Todo.js/med.js +0 -0
- package/dist/test/qwik/{Todo → todo}/Todo.tsx/high.tsx +0 -0
- package/dist/test/qwik/{Todo → todo}/Todo.tsx/low.tsx +0 -0
- package/dist/test/qwik/{Todo → todo}/Todo.tsx/med.tsx +0 -0
- package/dist/test/qwik/{Todos → todos}/Todo.tsx/high.tsx +0 -0
- package/dist/test/qwik/{Todos → todos}/Todo.tsx/low.tsx +0 -0
- package/dist/test/qwik/{Todos → todos}/Todo.tsx/med.tsx +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/src/__tests__/data/blocks/tabs.raw.d.ts +0 -11
- package/dist/src/__tests__/data/blocks/tabs.raw.jsx +0 -24
- package/dist/src/__tests__/qoot.test.d.ts +0 -1
- package/dist/src/__tests__/qoot.test.js +0 -115
- package/dist/src/generators/jsx-lite.d.ts +0 -10
- package/dist/src/generators/jsx-lite.js +0 -176
- package/dist/src/generators/qoot.d.ts +0 -21
- package/dist/src/generators/qoot.js +0 -442
- package/dist/src/generators/qwik.d.ts +0 -21
- package/dist/src/generators/qwik.js +0 -458
- package/dist/src/helpers/create-jsx-lite-component.d.ts +0 -2
- package/dist/src/helpers/create-jsx-lite-component.js +0 -16
- package/dist/src/helpers/create-jsx-lite-context.d.ts +0 -4
- package/dist/src/helpers/create-jsx-lite-context.js +0 -18
- package/dist/src/helpers/create-jsx-lite-node.d.ts +0 -2
- package/dist/src/helpers/create-jsx-lite-node.js +0 -16
- package/dist/src/helpers/is-jsx-lite-node.d.ts +0 -2
- package/dist/src/helpers/is-jsx-lite-node.js +0 -7
- package/dist/src/types/jsx-lite-component.d.ts +0 -63
- package/dist/src/types/jsx-lite-context.d.ts +0 -6
- package/dist/src/types/jsx-lite-node.d.ts +0 -13
- package/dist/src/types/jsx-lite-node.js +0 -2
- package/dist/src/types/jsx-lite-styles.d.ts +0 -1
- package/dist/src/types/jsx-lite-styles.js +0 -2
- package/dist/test/qoot/Todo/bundle.js +0 -88
- package/dist/test/qoot/Todo/component.ts +0 -17
- package/dist/test/qoot/Todo/onButtonClick.ts +0 -13
- package/dist/test/qoot/Todo/onInput2Blur.ts +0 -11
- package/dist/test/qoot/Todo/onInput2KeyUp.ts +0 -10
- package/dist/test/qoot/Todo/onInputClick.ts +0 -10
- package/dist/test/qoot/Todo/onLabelDblClick.ts +0 -11
- package/dist/test/qoot/Todo/public.ts +0 -4
- package/dist/test/qoot/Todo/template.tsx +0 -46
- package/dist/test/qoot/Todos/component.ts +0 -9
- package/dist/test/qoot/Todos/onInputClick.ts +0 -14
- package/dist/test/qoot/Todos/public.ts +0 -3
- package/dist/test/qoot/Todos/template.tsx +0 -30
- package/dist/test/qwik/Todo/bundle.js +0 -46
- package/dist/test/qwik/Todo/component.ts +0 -17
- package/dist/test/qwik/Todo/onButtonClick.ts +0 -10
- package/dist/test/qwik/Todo/onInput2Blur.ts +0 -14
- package/dist/test/qwik/Todo/onInput2KeyUp.ts +0 -10
- package/dist/test/qwik/Todo/onInputClick.ts +0 -13
- package/dist/test/qwik/Todo/onLabelDblClick.ts +0 -11
- package/dist/test/qwik/Todo/public.ts +0 -3
- package/dist/test/qwik/Todo/template.tsx +0 -46
- package/dist/test/qwik/Todo.ts +0 -4
- package/dist/test/qwik/Todo_component.ts +0 -17
- package/dist/test/qwik/Todo_onButtonClick.ts +0 -13
- package/dist/test/qwik/Todo_onInput2Blur.ts +0 -14
- package/dist/test/qwik/Todo_onInput2KeyUp.ts +0 -10
- package/dist/test/qwik/Todo_onInputClick.ts +0 -13
- package/dist/test/qwik/Todo_onLabelDblClick.ts +0 -14
- package/dist/test/qwik/Todo_template.tsx +0 -46
- package/dist/test/qwik/Todos/component.ts +0 -9
- package/dist/test/qwik/Todos/onInputClick.ts +0 -14
- package/dist/test/qwik/Todos/public.ts +0 -3
- package/dist/test/qwik/Todos/template.tsx +0 -30
- package/dist/test/qwik/Todos.ts +0 -3
- package/dist/test/qwik/Todos_component.ts +0 -9
- package/dist/test/qwik/Todos_onInputClick.ts +0 -14
- package/dist/test/qwik/Todos_template.tsx +0 -30
- package/dist/test/qwik/qwik/Image/high.js +0 -1
- package/dist/test/qwik/qwik/Image/low.js +0 -75
- package/dist/test/qwik/qwik/Image/med.js +0 -9
- package/dist/test/qwik/qwik/Image.slow/high.js +0 -1
- package/dist/test/qwik/qwik/Image.slow/low.js +0 -75
- package/dist/test/qwik/qwik/Image.slow/med.js +0 -9
- package/dist/test/qwik/qwik/button/high.js +0 -8
- package/dist/test/qwik/qwik/button/low.js +0 -34
- package/dist/test/qwik/qwik/button/med.js +0 -9
- package/dist/test/qwik/qwik/hello_world/stylesheet/high.jsx +0 -1
- package/dist/test/qwik/qwik/hello_world/stylesheet/low.jsx +0 -24
- package/dist/test/qwik/qwik/hello_world/stylesheet/med.jsx +0 -9
- package/dist/test/qwik/qwik/page-with-symbol/high.js +0 -1
- package/dist/test/qwik/qwik/page-with-symbol/low.js +0 -49
- package/dist/test/qwik/qwik/page-with-symbol/med.js +0 -9
- package/dist/test/qwik/qwik/svg/high.js +0 -1
- package/dist/test/qwik/qwik/svg/low.js +0 -30
- package/dist/test/qwik/qwik/svg/med.js +0 -9
- package/dist/test/qwik/qwik/todo/Todo.cjs/high.cjs +0 -31
- package/dist/test/qwik/qwik/todo/Todo.cjs/low.cjs +0 -1
- package/dist/test/qwik/qwik/todo/Todo.cjs/med.cjs +0 -59
- package/dist/test/qwik/qwik/todo/Todo.js/high.js +0 -5
- package/dist/test/qwik/qwik/todo/Todo.js/med.js +0 -1
- package/dist/test/qwik/qwik/todo/Todo.tsx/high.tsx +0 -30
- package/dist/test/qwik/qwik/todo/Todo.tsx/low.tsx +0 -1
- package/dist/test/qwik/qwik/todo/Todo.tsx/med.tsx +0 -34
- package/dist/test/qwik/qwik/todos/Todo.tsx/high.tsx +0 -12
- package/dist/test/qwik/qwik/todos/Todo.tsx/low.tsx +0 -24
- package/dist/test/qwik/qwik/todos/Todo.tsx/med.tsx +0 -8
|
@@ -4,7 +4,7 @@ var jsx_1 = require("../parsers/jsx");
|
|
|
4
4
|
var buttonWithMetadata = require('./data/blocks/button-with-metadata.raw');
|
|
5
5
|
describe('Parse JSX', function () {
|
|
6
6
|
test('metadata', function () {
|
|
7
|
-
var json = jsx_1.parseJsx(buttonWithMetadata);
|
|
7
|
+
var json = (0, jsx_1.parseJsx)(buttonWithMetadata);
|
|
8
8
|
expect(json).toMatchSnapshot();
|
|
9
9
|
});
|
|
10
10
|
});
|
|
@@ -61,7 +61,7 @@ var debugOutput = function (fileSet) { return __awaiter(void 0, void 0, void 0,
|
|
|
61
61
|
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
62
62
|
key = _a[_i];
|
|
63
63
|
file = fileSet[key];
|
|
64
|
-
return [4 /*yield*/, fs_extra_promise_1.outputFileAsync(base + file.path, file.contents)];
|
|
64
|
+
return [4 /*yield*/, (0, fs_extra_promise_1.outputFileAsync)(base + file.path, file.contents)];
|
|
65
65
|
case 2:
|
|
66
66
|
_c.sent();
|
|
67
67
|
_c.label = 3;
|
|
@@ -77,9 +77,9 @@ describe('qwik', function () {
|
|
|
77
77
|
test('Todo.tsx', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
78
78
|
var json, fileSet;
|
|
79
79
|
return __generator(this, function (_a) {
|
|
80
|
-
json = jsx_1.parseJsx(todo);
|
|
81
|
-
fileSet = index_1.createFileSet({ output: 'ts' });
|
|
82
|
-
index_1.addComponent(fileSet, json);
|
|
80
|
+
json = (0, jsx_1.parseJsx)(todo);
|
|
81
|
+
fileSet = (0, index_1.createFileSet)({ output: 'ts' });
|
|
82
|
+
(0, index_1.addComponent)(fileSet, json);
|
|
83
83
|
debugOutput(fileSet);
|
|
84
84
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
85
85
|
return [2 /*return*/];
|
|
@@ -88,9 +88,9 @@ describe('qwik', function () {
|
|
|
88
88
|
test('Todo.cjs', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
89
|
var json, fileSet;
|
|
90
90
|
return __generator(this, function (_a) {
|
|
91
|
-
json = jsx_1.parseJsx(todo);
|
|
92
|
-
fileSet = index_1.createFileSet({ output: 'cjs', jsx: false });
|
|
93
|
-
index_1.addComponent(fileSet, json);
|
|
91
|
+
json = (0, jsx_1.parseJsx)(todo);
|
|
92
|
+
fileSet = (0, index_1.createFileSet)({ output: 'cjs', jsx: false });
|
|
93
|
+
(0, index_1.addComponent)(fileSet, json);
|
|
94
94
|
debugOutput(fileSet);
|
|
95
95
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
96
96
|
return [2 /*return*/];
|
|
@@ -99,13 +99,13 @@ describe('qwik', function () {
|
|
|
99
99
|
test('Todo.js', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
100
100
|
var json, fileSet;
|
|
101
101
|
return __generator(this, function (_a) {
|
|
102
|
-
json = jsx_1.parseJsx(todo);
|
|
103
|
-
fileSet = index_1.createFileSet({
|
|
102
|
+
json = (0, jsx_1.parseJsx)(todo);
|
|
103
|
+
fileSet = (0, index_1.createFileSet)({
|
|
104
104
|
output: 'mjs',
|
|
105
105
|
minify: true,
|
|
106
106
|
jsx: false,
|
|
107
107
|
});
|
|
108
|
-
index_1.addComponent(fileSet, json);
|
|
108
|
+
(0, index_1.addComponent)(fileSet, json);
|
|
109
109
|
debugOutput(fileSet);
|
|
110
110
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
111
111
|
return [2 /*return*/];
|
|
@@ -116,9 +116,9 @@ describe('qwik', function () {
|
|
|
116
116
|
test('Todo.tsx', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
117
117
|
var json, fileSet;
|
|
118
118
|
return __generator(this, function (_a) {
|
|
119
|
-
json = jsx_1.parseJsx(todos);
|
|
120
|
-
fileSet = index_1.createFileSet({ output: 'ts' });
|
|
121
|
-
index_1.addComponent(fileSet, json);
|
|
119
|
+
json = (0, jsx_1.parseJsx)(todos);
|
|
120
|
+
fileSet = (0, index_1.createFileSet)({ output: 'ts' });
|
|
121
|
+
(0, index_1.addComponent)(fileSet, json);
|
|
122
122
|
debugOutput(fileSet);
|
|
123
123
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
124
124
|
return [2 /*return*/];
|
|
@@ -129,9 +129,9 @@ describe('qwik', function () {
|
|
|
129
129
|
test('stylesheet', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
130
130
|
var component, fileSet;
|
|
131
131
|
return __generator(this, function (_a) {
|
|
132
|
-
component = __1.builderContentToMitosisComponent(require('./qwik.test.hello_world.json'));
|
|
133
|
-
fileSet = index_1.createFileSet({ output: 'mjs' });
|
|
134
|
-
index_1.addComponent(fileSet, component);
|
|
132
|
+
component = (0, __1.builderContentToMitosisComponent)(require('./qwik.test.hello_world.json'));
|
|
133
|
+
fileSet = (0, index_1.createFileSet)({ output: 'mjs' });
|
|
134
|
+
(0, index_1.addComponent)(fileSet, component);
|
|
135
135
|
debugOutput(fileSet);
|
|
136
136
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
137
137
|
return [2 /*return*/];
|
|
@@ -141,9 +141,9 @@ describe('qwik', function () {
|
|
|
141
141
|
test('page-with-symbol', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
142
142
|
var component, fileSet;
|
|
143
143
|
return __generator(this, function (_a) {
|
|
144
|
-
component = __1.builderContentToMitosisComponent(require('./qwik.test.page-with-symbol.json'));
|
|
145
|
-
fileSet = index_1.createFileSet({ output: 'mjs', jsx: false });
|
|
146
|
-
index_1.addComponent(fileSet, component);
|
|
144
|
+
component = (0, __1.builderContentToMitosisComponent)(require('./qwik.test.page-with-symbol.json'));
|
|
145
|
+
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
146
|
+
(0, index_1.addComponent)(fileSet, component);
|
|
147
147
|
debugOutput(fileSet);
|
|
148
148
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
149
149
|
return [2 /*return*/];
|
|
@@ -152,9 +152,9 @@ describe('qwik', function () {
|
|
|
152
152
|
test('button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
153
153
|
var component, fileSet;
|
|
154
154
|
return __generator(this, function (_a) {
|
|
155
|
-
component = __1.builderContentToMitosisComponent(require('./qwik.test.button.json'));
|
|
156
|
-
fileSet = index_1.createFileSet({ output: 'mjs', jsx: false });
|
|
157
|
-
index_1.addComponent(fileSet, component);
|
|
155
|
+
component = (0, __1.builderContentToMitosisComponent)(require('./qwik.test.button.json'));
|
|
156
|
+
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
157
|
+
(0, index_1.addComponent)(fileSet, component);
|
|
158
158
|
debugOutput(fileSet);
|
|
159
159
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
160
160
|
return [2 /*return*/];
|
|
@@ -163,12 +163,12 @@ describe('qwik', function () {
|
|
|
163
163
|
test('svg', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
164
164
|
var component, fileSet;
|
|
165
165
|
return __generator(this, function (_a) {
|
|
166
|
-
component = __1.builderContentToMitosisComponent(require('./qwik.test.svg.json'), {
|
|
166
|
+
component = (0, __1.builderContentToMitosisComponent)(require('./qwik.test.svg.json'), {
|
|
167
167
|
includeBuilderExtras: true,
|
|
168
168
|
preserveTextBlocks: true,
|
|
169
169
|
});
|
|
170
|
-
fileSet = index_1.createFileSet({ output: 'mjs', jsx: false });
|
|
171
|
-
index_1.addComponent(fileSet, component);
|
|
170
|
+
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
171
|
+
(0, index_1.addComponent)(fileSet, component);
|
|
172
172
|
debugOutput(fileSet);
|
|
173
173
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
174
174
|
return [2 /*return*/];
|
|
@@ -177,12 +177,12 @@ describe('qwik', function () {
|
|
|
177
177
|
test('Image', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
178
178
|
var component, fileSet;
|
|
179
179
|
return __generator(this, function (_a) {
|
|
180
|
-
component = __1.builderContentToMitosisComponent(require('./qwik.test.image.json'), {
|
|
180
|
+
component = (0, __1.builderContentToMitosisComponent)(require('./qwik.test.image.json'), {
|
|
181
181
|
includeBuilderExtras: true,
|
|
182
182
|
preserveTextBlocks: true,
|
|
183
183
|
});
|
|
184
|
-
fileSet = index_1.createFileSet({ output: 'mjs', jsx: false });
|
|
185
|
-
index_1.addComponent(fileSet, component);
|
|
184
|
+
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
185
|
+
(0, index_1.addComponent)(fileSet, component);
|
|
186
186
|
debugOutput(fileSet);
|
|
187
187
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
188
188
|
return [2 /*return*/];
|
|
@@ -191,13 +191,13 @@ describe('qwik', function () {
|
|
|
191
191
|
test('Image.slow', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
192
192
|
var component, fileSet;
|
|
193
193
|
return __generator(this, function (_a) {
|
|
194
|
-
component = __1.builderContentToMitosisComponent(require('./qwik.test.image.json'), {
|
|
194
|
+
component = (0, __1.builderContentToMitosisComponent)(require('./qwik.test.image.json'), {
|
|
195
195
|
includeBuilderExtras: true,
|
|
196
196
|
preserveTextBlocks: true,
|
|
197
197
|
});
|
|
198
|
-
compile_away_builder_components_1.compileAwayBuilderComponentsFromTree(component, compile_away_builder_components_1.components);
|
|
199
|
-
fileSet = index_1.createFileSet({ output: 'mjs', jsx: false });
|
|
200
|
-
index_1.addComponent(fileSet, component);
|
|
198
|
+
(0, compile_away_builder_components_1.compileAwayBuilderComponentsFromTree)(component, compile_away_builder_components_1.components);
|
|
199
|
+
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
200
|
+
(0, index_1.addComponent)(fileSet, component);
|
|
201
201
|
debugOutput(fileSet);
|
|
202
202
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
203
203
|
return [2 /*return*/];
|
|
@@ -206,13 +206,13 @@ describe('qwik', function () {
|
|
|
206
206
|
test('Accordion', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
207
207
|
var component, fileSet;
|
|
208
208
|
return __generator(this, function (_a) {
|
|
209
|
-
component = __1.builderContentToMitosisComponent(require('./qwik.test.accordion.json'), {
|
|
209
|
+
component = (0, __1.builderContentToMitosisComponent)(require('./qwik.test.accordion.json'), {
|
|
210
210
|
includeBuilderExtras: true,
|
|
211
211
|
preserveTextBlocks: true,
|
|
212
212
|
});
|
|
213
|
-
compile_away_builder_components_1.compileAwayBuilderComponentsFromTree(component, compile_away_builder_components_1.components);
|
|
214
|
-
fileSet = index_1.createFileSet({ output: 'mjs', jsx: true });
|
|
215
|
-
index_1.addComponent(fileSet, component);
|
|
213
|
+
(0, compile_away_builder_components_1.compileAwayBuilderComponentsFromTree)(component, compile_away_builder_components_1.components);
|
|
214
|
+
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: true });
|
|
215
|
+
(0, index_1.addComponent)(fileSet, component);
|
|
216
216
|
debugOutput(fileSet);
|
|
217
217
|
expect(toObj(fileSet)).toMatchSnapshot();
|
|
218
218
|
return [2 /*return*/];
|
|
@@ -21,90 +21,90 @@ var image = require('./data/blocks/image.raw');
|
|
|
21
21
|
var columns = require('./data/blocks/columns.raw');
|
|
22
22
|
describe('React', function () {
|
|
23
23
|
test('Basic', function () {
|
|
24
|
-
var
|
|
25
|
-
var output = react_native_1.componentToReactNative(
|
|
24
|
+
var component = (0, jsx_1.parseJsx)(basic);
|
|
25
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
26
26
|
expect(output).toMatchSnapshot();
|
|
27
27
|
});
|
|
28
28
|
test('Input block', function () {
|
|
29
|
-
var
|
|
30
|
-
var output = react_native_1.componentToReactNative(
|
|
29
|
+
var component = (0, jsx_1.parseJsx)(inputBlock);
|
|
30
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
31
31
|
expect(output).toMatchSnapshot();
|
|
32
32
|
});
|
|
33
33
|
test('Submit button block', function () {
|
|
34
|
-
var
|
|
35
|
-
var output = react_native_1.componentToReactNative(
|
|
34
|
+
var component = (0, jsx_1.parseJsx)(submitButtonBlock);
|
|
35
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
36
36
|
expect(output).toMatchSnapshot();
|
|
37
37
|
});
|
|
38
38
|
test('Select block', function () {
|
|
39
|
-
var
|
|
40
|
-
var output = react_native_1.componentToReactNative(
|
|
39
|
+
var component = (0, jsx_1.parseJsx)(selectBlock);
|
|
40
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
41
41
|
expect(output).toMatchSnapshot();
|
|
42
42
|
});
|
|
43
43
|
test('Form block', function () {
|
|
44
|
-
var
|
|
45
|
-
var output = react_native_1.componentToReactNative(
|
|
44
|
+
var component = (0, jsx_1.parseJsx)(formBlock);
|
|
45
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
46
46
|
expect(output).toMatchSnapshot();
|
|
47
47
|
});
|
|
48
48
|
test('Button', function () {
|
|
49
|
-
var
|
|
50
|
-
var output = react_native_1.componentToReactNative(
|
|
49
|
+
var component = (0, jsx_1.parseJsx)(button);
|
|
50
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
51
51
|
expect(output).toMatchSnapshot();
|
|
52
52
|
});
|
|
53
53
|
test('Textarea', function () {
|
|
54
|
-
var
|
|
55
|
-
var output = react_native_1.componentToReactNative(
|
|
54
|
+
var component = (0, jsx_1.parseJsx)(textarea);
|
|
55
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
56
56
|
expect(output).toMatchSnapshot();
|
|
57
57
|
});
|
|
58
58
|
test('Img', function () {
|
|
59
|
-
var
|
|
60
|
-
var output = react_native_1.componentToReactNative(
|
|
59
|
+
var component = (0, jsx_1.parseJsx)(img);
|
|
60
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
61
61
|
expect(output).toMatchSnapshot();
|
|
62
62
|
});
|
|
63
63
|
test('Video', function () {
|
|
64
|
-
var
|
|
65
|
-
var output = react_native_1.componentToReactNative(
|
|
64
|
+
var component = (0, jsx_1.parseJsx)(video);
|
|
65
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
66
66
|
expect(output).toMatchSnapshot();
|
|
67
67
|
});
|
|
68
68
|
test('Section', function () {
|
|
69
|
-
var
|
|
70
|
-
var output = react_native_1.componentToReactNative(
|
|
69
|
+
var component = (0, jsx_1.parseJsx)(section);
|
|
70
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
71
71
|
expect(output).toMatchSnapshot();
|
|
72
72
|
});
|
|
73
73
|
test('Text', function () {
|
|
74
|
-
var
|
|
75
|
-
var output = react_native_1.componentToReactNative(
|
|
74
|
+
var component = (0, jsx_1.parseJsx)(text);
|
|
75
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
76
76
|
expect(output).toMatchSnapshot();
|
|
77
77
|
});
|
|
78
78
|
test('RawText', function () {
|
|
79
|
-
var
|
|
80
|
-
var output = react_native_1.componentToReactNative(
|
|
79
|
+
var component = (0, jsx_1.parseJsx)(rawText);
|
|
80
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
81
81
|
expect(output).toMatchSnapshot();
|
|
82
82
|
});
|
|
83
83
|
test('Stamped.io', function () {
|
|
84
|
-
var
|
|
85
|
-
var output = react_native_1.componentToReactNative(
|
|
84
|
+
var component = (0, jsx_1.parseJsx)(stamped);
|
|
85
|
+
var output = (0, react_native_1.componentToReactNative)({
|
|
86
86
|
stateType: 'useState',
|
|
87
|
-
});
|
|
87
|
+
})({ component: component });
|
|
88
88
|
expect(output).toMatchSnapshot();
|
|
89
89
|
});
|
|
90
90
|
test('CustomCode', function () {
|
|
91
|
-
var
|
|
92
|
-
var output = react_native_1.componentToReactNative(
|
|
91
|
+
var component = (0, jsx_1.parseJsx)(customCode);
|
|
92
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
93
93
|
expect(output).toMatchSnapshot();
|
|
94
94
|
});
|
|
95
95
|
test('Embed', function () {
|
|
96
|
-
var
|
|
97
|
-
var output = react_native_1.componentToReactNative(
|
|
96
|
+
var component = (0, jsx_1.parseJsx)(customCode);
|
|
97
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
98
98
|
expect(output).toMatchSnapshot();
|
|
99
99
|
});
|
|
100
100
|
test('Image', function () {
|
|
101
|
-
var
|
|
102
|
-
var output = react_native_1.componentToReactNative(
|
|
101
|
+
var component = (0, jsx_1.parseJsx)(image);
|
|
102
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
103
103
|
expect(output).toMatchSnapshot();
|
|
104
104
|
});
|
|
105
105
|
test('Columns', function () {
|
|
106
|
-
var
|
|
107
|
-
var output = react_native_1.componentToReactNative(
|
|
106
|
+
var component = (0, jsx_1.parseJsx)(columns);
|
|
107
|
+
var output = (0, react_native_1.componentToReactNative)()({ component: component });
|
|
108
108
|
expect(output).toMatchSnapshot();
|
|
109
109
|
});
|
|
110
110
|
});
|
|
@@ -21,91 +21,91 @@ var image = require('./data/blocks/image.raw');
|
|
|
21
21
|
var columns = require('./data/blocks/columns.raw');
|
|
22
22
|
describe('React', function () {
|
|
23
23
|
test('Basic', function () {
|
|
24
|
-
var
|
|
25
|
-
var output = react_1.componentToReact(
|
|
24
|
+
var component = (0, jsx_1.parseJsx)(basic);
|
|
25
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
26
26
|
expect(output).toMatchSnapshot();
|
|
27
27
|
});
|
|
28
28
|
test('Input block', function () {
|
|
29
|
-
var
|
|
30
|
-
var output = react_1.componentToReact(
|
|
29
|
+
var component = (0, jsx_1.parseJsx)(inputBlock);
|
|
30
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
31
31
|
expect(output).toMatchSnapshot();
|
|
32
32
|
});
|
|
33
33
|
test('Submit button block', function () {
|
|
34
|
-
var
|
|
35
|
-
var output = react_1.componentToReact(
|
|
34
|
+
var component = (0, jsx_1.parseJsx)(submitButtonBlock);
|
|
35
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
36
36
|
expect(output).toMatchSnapshot();
|
|
37
37
|
});
|
|
38
38
|
test('Select block', function () {
|
|
39
|
-
var
|
|
40
|
-
var output = react_1.componentToReact(
|
|
39
|
+
var component = (0, jsx_1.parseJsx)(selectBlock);
|
|
40
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
41
41
|
expect(output).toMatchSnapshot();
|
|
42
42
|
});
|
|
43
43
|
test('Form block', function () {
|
|
44
|
-
var
|
|
45
|
-
var output = react_1.componentToReact(
|
|
44
|
+
var component = (0, jsx_1.parseJsx)(formBlock);
|
|
45
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
46
46
|
expect(output).toMatchSnapshot();
|
|
47
47
|
});
|
|
48
48
|
test('Button', function () {
|
|
49
|
-
var
|
|
50
|
-
var output = react_1.componentToReact(
|
|
49
|
+
var component = (0, jsx_1.parseJsx)(button);
|
|
50
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
51
51
|
expect(output).toMatchSnapshot();
|
|
52
52
|
});
|
|
53
53
|
test('Textarea', function () {
|
|
54
|
-
var
|
|
55
|
-
var output = react_1.componentToReact(
|
|
54
|
+
var component = (0, jsx_1.parseJsx)(textarea);
|
|
55
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
56
56
|
expect(output).toMatchSnapshot();
|
|
57
57
|
});
|
|
58
58
|
test('Img', function () {
|
|
59
|
-
var
|
|
60
|
-
var output = react_1.componentToReact(
|
|
59
|
+
var component = (0, jsx_1.parseJsx)(img);
|
|
60
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
61
61
|
expect(output).toMatchSnapshot();
|
|
62
62
|
});
|
|
63
63
|
test('Video', function () {
|
|
64
|
-
var
|
|
65
|
-
var output = react_1.componentToReact(
|
|
64
|
+
var component = (0, jsx_1.parseJsx)(video);
|
|
65
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
66
66
|
expect(output).toMatchSnapshot();
|
|
67
67
|
});
|
|
68
68
|
test('Section', function () {
|
|
69
|
-
var
|
|
70
|
-
var output = react_1.componentToReact(
|
|
69
|
+
var component = (0, jsx_1.parseJsx)(section);
|
|
70
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
71
71
|
expect(output).toMatchSnapshot();
|
|
72
72
|
});
|
|
73
73
|
test('Text', function () {
|
|
74
|
-
var
|
|
75
|
-
var output = react_1.componentToReact(
|
|
74
|
+
var component = (0, jsx_1.parseJsx)(text);
|
|
75
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
76
76
|
expect(output).toMatchSnapshot();
|
|
77
77
|
});
|
|
78
78
|
test('RawText', function () {
|
|
79
|
-
var
|
|
80
|
-
var output = react_1.componentToReact(
|
|
79
|
+
var component = (0, jsx_1.parseJsx)(rawText);
|
|
80
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
81
81
|
expect(output).toMatchSnapshot();
|
|
82
82
|
});
|
|
83
83
|
test('Stamped.io', function () {
|
|
84
|
-
var
|
|
85
|
-
var output = react_1.componentToReact(
|
|
84
|
+
var component = (0, jsx_1.parseJsx)(stamped);
|
|
85
|
+
var output = (0, react_1.componentToReact)({
|
|
86
86
|
stylesType: 'styled-components',
|
|
87
87
|
stateType: 'useState',
|
|
88
|
-
});
|
|
88
|
+
})({ component: component });
|
|
89
89
|
expect(output).toMatchSnapshot();
|
|
90
90
|
});
|
|
91
91
|
test('CustomCode', function () {
|
|
92
|
-
var
|
|
93
|
-
var output = react_1.componentToReact(
|
|
92
|
+
var component = (0, jsx_1.parseJsx)(customCode);
|
|
93
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
94
94
|
expect(output).toMatchSnapshot();
|
|
95
95
|
});
|
|
96
96
|
test('Embed', function () {
|
|
97
|
-
var
|
|
98
|
-
var output = react_1.componentToReact(
|
|
97
|
+
var component = (0, jsx_1.parseJsx)(customCode);
|
|
98
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
99
99
|
expect(output).toMatchSnapshot();
|
|
100
100
|
});
|
|
101
101
|
test('Image', function () {
|
|
102
|
-
var
|
|
103
|
-
var output = react_1.componentToReact(
|
|
102
|
+
var component = (0, jsx_1.parseJsx)(image);
|
|
103
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
104
104
|
expect(output).toMatchSnapshot();
|
|
105
105
|
});
|
|
106
106
|
test('Columns', function () {
|
|
107
|
-
var
|
|
108
|
-
var output = react_1.componentToReact(
|
|
107
|
+
var component = (0, jsx_1.parseJsx)(columns);
|
|
108
|
+
var output = (0, react_1.componentToReact)()({ component: component });
|
|
109
109
|
expect(output).toMatchSnapshot();
|
|
110
110
|
});
|
|
111
111
|
});
|
|
@@ -20,83 +20,83 @@ var image = require('./data/blocks/image.raw');
|
|
|
20
20
|
var columns = require('./data/blocks/columns.raw');
|
|
21
21
|
describe('Solid', function () {
|
|
22
22
|
test('Basic', function () {
|
|
23
|
-
var
|
|
24
|
-
var output = solid_1.componentToSolid(
|
|
23
|
+
var component = (0, jsx_1.parseJsx)(basic);
|
|
24
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
25
25
|
expect(output).toMatchSnapshot();
|
|
26
26
|
});
|
|
27
27
|
test('Input block', function () {
|
|
28
|
-
var
|
|
29
|
-
var output = solid_1.componentToSolid(
|
|
28
|
+
var component = (0, jsx_1.parseJsx)(inputBlock);
|
|
29
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
30
30
|
expect(output).toMatchSnapshot();
|
|
31
31
|
});
|
|
32
32
|
test('Submit button block', function () {
|
|
33
|
-
var
|
|
34
|
-
var output = solid_1.componentToSolid(
|
|
33
|
+
var component = (0, jsx_1.parseJsx)(submitButtonBlock);
|
|
34
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
35
35
|
expect(output).toMatchSnapshot();
|
|
36
36
|
});
|
|
37
37
|
test('Select block', function () {
|
|
38
|
-
var
|
|
39
|
-
var output = solid_1.componentToSolid(
|
|
38
|
+
var component = (0, jsx_1.parseJsx)(selectBlock);
|
|
39
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
40
40
|
expect(output).toMatchSnapshot();
|
|
41
41
|
});
|
|
42
42
|
test('Form block', function () {
|
|
43
|
-
var
|
|
44
|
-
var output = solid_1.componentToSolid(
|
|
43
|
+
var component = (0, jsx_1.parseJsx)(formBlock);
|
|
44
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
45
45
|
expect(output).toMatchSnapshot();
|
|
46
46
|
});
|
|
47
47
|
test('Button', function () {
|
|
48
|
-
var
|
|
49
|
-
var output = solid_1.componentToSolid(
|
|
48
|
+
var component = (0, jsx_1.parseJsx)(button);
|
|
49
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
50
50
|
expect(output).toMatchSnapshot();
|
|
51
51
|
});
|
|
52
52
|
test('Textarea', function () {
|
|
53
|
-
var
|
|
54
|
-
var output = solid_1.componentToSolid(
|
|
53
|
+
var component = (0, jsx_1.parseJsx)(textarea);
|
|
54
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
55
55
|
expect(output).toMatchSnapshot();
|
|
56
56
|
});
|
|
57
57
|
test('Img', function () {
|
|
58
|
-
var
|
|
59
|
-
var output = solid_1.componentToSolid(
|
|
58
|
+
var component = (0, jsx_1.parseJsx)(img);
|
|
59
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
60
60
|
expect(output).toMatchSnapshot();
|
|
61
61
|
});
|
|
62
62
|
test('Video', function () {
|
|
63
|
-
var
|
|
64
|
-
var output = solid_1.componentToSolid(
|
|
63
|
+
var component = (0, jsx_1.parseJsx)(video);
|
|
64
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
65
65
|
expect(output).toMatchSnapshot();
|
|
66
66
|
});
|
|
67
67
|
test('Section', function () {
|
|
68
|
-
var
|
|
69
|
-
var output = solid_1.componentToSolid(
|
|
68
|
+
var component = (0, jsx_1.parseJsx)(section);
|
|
69
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
70
70
|
expect(output).toMatchSnapshot();
|
|
71
71
|
});
|
|
72
72
|
test('Text', function () {
|
|
73
|
-
var
|
|
74
|
-
var output = solid_1.componentToSolid(
|
|
73
|
+
var component = (0, jsx_1.parseJsx)(text);
|
|
74
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
75
75
|
expect(output).toMatchSnapshot();
|
|
76
76
|
});
|
|
77
77
|
test('RawText', function () {
|
|
78
|
-
var
|
|
79
|
-
var output = solid_1.componentToSolid(
|
|
78
|
+
var component = (0, jsx_1.parseJsx)(rawText);
|
|
79
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
80
80
|
expect(output).toMatchSnapshot();
|
|
81
81
|
});
|
|
82
82
|
test('CustomCode', function () {
|
|
83
|
-
var
|
|
84
|
-
var output = solid_1.componentToSolid(
|
|
83
|
+
var component = (0, jsx_1.parseJsx)(customCode);
|
|
84
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
85
85
|
expect(output).toMatchSnapshot();
|
|
86
86
|
});
|
|
87
87
|
test('Embed', function () {
|
|
88
|
-
var
|
|
89
|
-
var output = solid_1.componentToSolid(
|
|
88
|
+
var component = (0, jsx_1.parseJsx)(customCode);
|
|
89
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
90
90
|
expect(output).toMatchSnapshot();
|
|
91
91
|
});
|
|
92
92
|
test('Image', function () {
|
|
93
|
-
var
|
|
94
|
-
var output = solid_1.componentToSolid(
|
|
93
|
+
var component = (0, jsx_1.parseJsx)(image);
|
|
94
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
95
95
|
expect(output).toMatchSnapshot();
|
|
96
96
|
});
|
|
97
97
|
test('Columns', function () {
|
|
98
|
-
var
|
|
99
|
-
var output = solid_1.componentToSolid(
|
|
98
|
+
var component = (0, jsx_1.parseJsx)(columns);
|
|
99
|
+
var output = (0, solid_1.componentToSolid)()({ component: component });
|
|
100
100
|
expect(output).toMatchSnapshot();
|
|
101
101
|
});
|
|
102
102
|
});
|