@builder.io/mitosis 0.4.0 → 0.4.2
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/media-sizes.js +4 -5
- package/dist/src/generators/alpine/generate.js +114 -132
- package/dist/src/generators/alpine/render-mount-hook.js +8 -5
- package/dist/src/generators/alpine/render-update-hooks.js +13 -13
- package/dist/src/generators/angular/helpers.js +19 -9
- package/dist/src/generators/angular/index.js +599 -584
- package/dist/src/generators/builder.js +200 -165
- package/dist/src/generators/context/angular.js +32 -26
- package/dist/src/generators/context/helpers/context-with-symbol-key.js +25 -21
- package/dist/src/generators/context/qwik.js +21 -21
- package/dist/src/generators/context/react.js +22 -22
- package/dist/src/generators/context/rsc.js +20 -22
- package/dist/src/generators/context/solid.js +22 -22
- package/dist/src/generators/context/svelte.js +33 -28
- package/dist/src/generators/context/vue.js +1 -1
- package/dist/src/generators/helpers/context.js +6 -13
- package/dist/src/generators/helpers/functions.js +8 -8
- package/dist/src/generators/helpers/on-mount.js +9 -5
- package/dist/src/generators/helpers/rsc.js +7 -9
- package/dist/src/generators/html.js +995 -534
- package/dist/src/generators/liquid.js +81 -79
- package/dist/src/generators/lit/collect-class-string.js +10 -12
- package/dist/src/generators/lit/generate.js +204 -159
- package/dist/src/generators/marko/generate.js +193 -183
- package/dist/src/generators/minify.js +5 -9
- package/dist/src/generators/mitosis.js +135 -134
- package/dist/src/generators/qwik/component-generator.js +159 -154
- package/dist/src/generators/qwik/component.js +51 -81
- package/dist/src/generators/qwik/directives.js +68 -84
- package/dist/src/generators/qwik/helpers/add-prevent-default.js +6 -7
- package/dist/src/generators/qwik/helpers/convert-method-to-function.js +38 -38
- package/dist/src/generators/qwik/helpers/handlers.js +16 -25
- package/dist/src/generators/qwik/helpers/stable-inject.js +7 -8
- package/dist/src/generators/qwik/helpers/stable-serialize.js +7 -8
- package/dist/src/generators/qwik/helpers/state.js +36 -43
- package/dist/src/generators/qwik/helpers/styles.js +19 -40
- package/dist/src/generators/qwik/jsx.js +63 -75
- package/dist/src/generators/qwik/src-generator.js +134 -167
- package/dist/src/generators/react/blocks.js +122 -127
- package/dist/src/generators/react/generator.js +314 -259
- package/dist/src/generators/react/helpers.js +23 -28
- package/dist/src/generators/react/state.js +34 -51
- package/dist/src/generators/react-native/index.js +72 -84
- package/dist/src/generators/react-native/sanitize-react-native-block-styles.js +14 -26
- package/dist/src/generators/rsc.js +30 -36
- package/dist/src/generators/solid/blocks.js +46 -43
- package/dist/src/generators/solid/helpers/styles.js +11 -11
- package/dist/src/generators/solid/index.js +199 -190
- package/dist/src/generators/solid/state/helpers.js +76 -90
- package/dist/src/generators/solid/state/signals.js +30 -37
- package/dist/src/generators/solid/state/state.js +35 -48
- package/dist/src/generators/solid/state/store.js +40 -46
- package/dist/src/generators/stencil/collect-class-string.js +10 -12
- package/dist/src/generators/stencil/generate.js +158 -145
- package/dist/src/generators/svelte/blocks.js +146 -144
- package/dist/src/generators/svelte/helpers.js +10 -17
- package/dist/src/generators/svelte/svelte.js +321 -287
- package/dist/src/generators/swift-ui.js +162 -101
- package/dist/src/generators/taro.js +32 -36
- package/dist/src/generators/template.js +71 -74
- package/dist/src/generators/vue/blocks.js +116 -107
- package/dist/src/generators/vue/compositionApi.js +67 -50
- package/dist/src/generators/vue/helpers.js +71 -96
- package/dist/src/generators/vue/optionsApi.js +134 -105
- package/dist/src/generators/vue/vue.js +210 -207
- package/dist/src/helpers/babel-transform.js +40 -63
- package/dist/src/helpers/bindings.js +4 -12
- package/dist/src/helpers/camel-case.js +4 -5
- package/dist/src/helpers/capitalize.js +1 -1
- package/dist/src/helpers/component-file-extensions.js +23 -35
- package/dist/src/helpers/create-mitosis-component.js +22 -26
- package/dist/src/helpers/create-mitosis-context.js +5 -12
- package/dist/src/helpers/create-mitosis-node.js +10 -12
- package/dist/src/helpers/dash-case.js +2 -2
- package/dist/src/helpers/dedent.js +18 -22
- package/dist/src/helpers/event-handlers.js +1 -1
- package/dist/src/helpers/fast-clone.js +1 -1
- package/dist/src/helpers/filter-empty-text-nodes.js +2 -2
- package/dist/src/helpers/generic-format.js +7 -8
- package/dist/src/helpers/get-bindings.js +4 -4
- package/dist/src/helpers/get-components-used.js +3 -3
- package/dist/src/helpers/get-components.js +4 -4
- package/dist/src/helpers/get-custom-imports.js +10 -12
- package/dist/src/helpers/get-prop-functions.js +7 -8
- package/dist/src/helpers/get-props-ref.js +8 -8
- package/dist/src/helpers/get-props.js +12 -13
- package/dist/src/helpers/get-refs.js +4 -4
- package/dist/src/helpers/get-state-object-string.js +42 -61
- package/dist/src/helpers/get-state-used.js +7 -8
- package/dist/src/helpers/get-styles.js +6 -6
- package/dist/src/helpers/getters-to-functions.js +8 -12
- package/dist/src/helpers/handle-missing-state.js +3 -3
- package/dist/src/helpers/has-bindings-text.js +6 -6
- package/dist/src/helpers/has-component.js +4 -4
- package/dist/src/helpers/has-props.js +3 -3
- package/dist/src/helpers/has-stateful-dom.js +4 -4
- package/dist/src/helpers/has.js +3 -3
- package/dist/src/helpers/indent.js +2 -3
- package/dist/src/helpers/is-children.js +4 -5
- package/dist/src/helpers/is-component.js +1 -1
- package/dist/src/helpers/is-html-attribute.js +2 -11
- package/dist/src/helpers/is-mitosis-node.js +1 -1
- package/dist/src/helpers/is-root-text-node.js +1 -1
- package/dist/src/helpers/is-upper-case.js +1 -1
- package/dist/src/helpers/is-valid-attribute-name.js +1 -1
- package/dist/src/helpers/json.js +2 -2
- package/dist/src/helpers/map-refs.js +29 -40
- package/dist/src/helpers/merge-options.js +20 -31
- package/dist/src/helpers/mitosis-imports.js +5 -6
- package/dist/src/helpers/nodes/for.js +2 -3
- package/dist/src/helpers/nullable.js +1 -3
- package/dist/src/helpers/on-event.js +32 -36
- package/dist/src/helpers/output.js +4 -5
- package/dist/src/helpers/parse-node.js +13 -5
- package/dist/src/helpers/parsers.js +10 -14
- package/dist/src/helpers/patterns.js +6 -8
- package/dist/src/helpers/plugins/process-code/index.js +114 -120
- package/dist/src/helpers/plugins/process-signals.js +114 -125
- package/dist/src/helpers/plugins/process-target-blocks.js +18 -20
- package/dist/src/helpers/process-http-requests.js +8 -4
- package/dist/src/helpers/remove-surrounding-block.js +2 -2
- package/dist/src/helpers/render-imports.js +99 -111
- package/dist/src/helpers/replace-identifiers.js +40 -49
- package/dist/src/helpers/replace-new-lines-in-strings.js +3 -3
- package/dist/src/helpers/signals/signals.js +27 -35
- package/dist/src/helpers/slots.js +11 -20
- package/dist/src/helpers/state.js +1 -3
- package/dist/src/helpers/strip-meta-properties.js +6 -6
- package/dist/src/helpers/strip-state-and-props-refs.js +21 -32
- package/dist/src/helpers/styles/collect-css.js +39 -44
- package/dist/src/helpers/styles/collect-styled-components.js +30 -28
- package/dist/src/helpers/styles/helpers.js +23 -29
- package/dist/src/helpers/trace-reference-to-module-path.js +3 -4
- package/dist/src/helpers/transform-state-setters.js +16 -19
- package/dist/src/helpers/traverse-nodes.js +2 -2
- package/dist/src/helpers/try-prettier-format.js +3 -3
- package/dist/src/helpers/typescript-project.js +25 -25
- package/dist/src/helpers/typescript.js +1 -3
- package/dist/src/modules/plugins.js +20 -28
- package/dist/src/parsers/angular.js +49 -57
- package/dist/src/parsers/builder/builder.js +448 -343
- package/dist/src/parsers/builder/helpers.js +10 -10
- package/dist/src/parsers/context.js +15 -17
- package/dist/src/parsers/jsx/ast.js +11 -11
- package/dist/src/parsers/jsx/component-types.js +22 -32
- package/dist/src/parsers/jsx/context.js +12 -12
- package/dist/src/parsers/jsx/element-parser.js +43 -54
- package/dist/src/parsers/jsx/exports.js +12 -14
- package/dist/src/parsers/jsx/function-parser.js +108 -119
- package/dist/src/parsers/jsx/helpers.js +11 -13
- package/dist/src/parsers/jsx/hooks/helpers.js +14 -16
- package/dist/src/parsers/jsx/hooks/index.js +34 -44
- package/dist/src/parsers/jsx/hooks/use-target.js +27 -27
- package/dist/src/parsers/jsx/imports.js +7 -17
- package/dist/src/parsers/jsx/jsx.js +92 -91
- package/dist/src/parsers/jsx/props-types.js +8 -10
- package/dist/src/parsers/jsx/props.js +15 -23
- package/dist/src/parsers/jsx/signals.js +28 -29
- package/dist/src/parsers/jsx/state.d.ts +2 -4
- package/dist/src/parsers/jsx/state.js +59 -93
- package/dist/src/parsers/svelte/css/index.js +1 -1
- package/dist/src/parsers/svelte/helpers/bindings.js +18 -19
- package/dist/src/parsers/svelte/helpers/children.js +5 -6
- package/dist/src/parsers/svelte/helpers/expressions.js +7 -9
- package/dist/src/parsers/svelte/helpers/hooks.js +2 -2
- package/dist/src/parsers/svelte/helpers/post-process.js +49 -70
- package/dist/src/parsers/svelte/helpers/string.js +5 -5
- package/dist/src/parsers/svelte/html/actions.js +17 -10
- package/dist/src/parsers/svelte/html/each.js +11 -16
- package/dist/src/parsers/svelte/html/element.js +68 -78
- package/dist/src/parsers/svelte/html/fragment.js +3 -3
- package/dist/src/parsers/svelte/html/if-else.js +11 -18
- package/dist/src/parsers/svelte/html/index.js +14 -14
- package/dist/src/parsers/svelte/html/mustache-tag.js +5 -5
- package/dist/src/parsers/svelte/html/slot.js +5 -5
- package/dist/src/parsers/svelte/html/text.js +7 -14
- package/dist/src/parsers/svelte/index.js +23 -72
- package/dist/src/parsers/svelte/instance/context.js +17 -17
- package/dist/src/parsers/svelte/instance/expressions.js +2 -2
- package/dist/src/parsers/svelte/instance/functions.js +35 -30
- package/dist/src/parsers/svelte/instance/hooks.js +4 -5
- package/dist/src/parsers/svelte/instance/imports.js +11 -21
- package/dist/src/parsers/svelte/instance/index.js +22 -22
- package/dist/src/parsers/svelte/instance/properties.js +11 -23
- package/dist/src/parsers/svelte/instance/reactive.js +11 -11
- package/dist/src/parsers/svelte/instance/references.js +13 -13
- package/dist/src/parsers/svelte/instance/statements.js +3 -3
- package/dist/src/parsers/svelte/module/index.js +14 -26
- package/dist/src/parsers/svelte/typescript/index.js +27 -36
- package/dist/src/plugins/compile-away-builder-components.js +223 -156
- package/dist/src/plugins/compile-away-components.js +13 -21
- package/dist/src/plugins/map-styles.js +7 -7
- package/dist/src/symbols/symbol-processor.js +44 -62
- package/dist/src/targets.js +19 -19
- package/dist/src/types/mitosis-node.js +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapStyles = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const get_styles_1 = require("../helpers/get-styles");
|
|
5
|
+
const traverse_nodes_1 = require("../helpers/traverse-nodes");
|
|
6
|
+
const mapStyles = (pluginOptions) => (options) => ({
|
|
7
7
|
json: {
|
|
8
|
-
pre:
|
|
9
|
-
(0, traverse_nodes_1.traverseNodes)(json,
|
|
10
|
-
|
|
8
|
+
pre: (json) => {
|
|
9
|
+
(0, traverse_nodes_1.traverseNodes)(json, (node, context) => {
|
|
10
|
+
const styles = (0, get_styles_1.getStyles)(node);
|
|
11
11
|
(0, get_styles_1.setStyles)(node, pluginOptions.map(styles || {}, context));
|
|
12
12
|
});
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
|
-
});
|
|
15
|
+
});
|
|
16
16
|
exports.mapStyles = mapStyles;
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
6
|
exports.hashCode = exports.hashCodeAsString = exports.getJsxSymbolComponentName = exports.convertBuilderElementToMitosisComponent = exports.convertBuilderContentToSymbolHierarchy = exports.ensureAllSymbolsHaveIds = void 0;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
const legacy_1 = __importDefault(require("neotraverse/legacy"));
|
|
8
|
+
const minify_1 = require("../generators/minify");
|
|
9
|
+
const builder_1 = require("../parsers/builder");
|
|
25
10
|
/**
|
|
26
11
|
* Ensure every symbol in a BuilderContent tree has a unique ID.
|
|
27
12
|
* Mutates the data tree directly.
|
|
28
13
|
*/
|
|
29
14
|
function ensureAllSymbolsHaveIds(content) {
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
let counter = 0;
|
|
16
|
+
const ids = new Set();
|
|
32
17
|
(0, legacy_1.default)(content).forEach(function (el) {
|
|
33
18
|
var _a, _b, _c;
|
|
34
19
|
if (this.key === 'jsCode' && isString(el) && el.endsWith('return _virtual_index')) {
|
|
@@ -40,16 +25,16 @@ function ensureAllSymbolsHaveIds(content) {
|
|
|
40
25
|
}
|
|
41
26
|
if ((0, builder_1.isBuilderElement)(el)) {
|
|
42
27
|
if (((_a = el === null || el === void 0 ? void 0 : el.component) === null || _a === void 0 ? void 0 : _a.name) === 'Symbol') {
|
|
43
|
-
|
|
28
|
+
const id = getIdFromSymbol(el);
|
|
44
29
|
if (id) {
|
|
45
30
|
if (ids.has(id)) {
|
|
46
31
|
if ((_c = (_b = el.component) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.symbol) {
|
|
47
|
-
|
|
48
|
-
el.component.options.symbol.entry =
|
|
32
|
+
const id = pad(counter++);
|
|
33
|
+
el.component.options.symbol.entry = id;
|
|
49
34
|
if (el.component.options.symbol.content) {
|
|
50
|
-
el.component.options.symbol.content.id =
|
|
35
|
+
el.component.options.symbol.content.id = id;
|
|
51
36
|
}
|
|
52
|
-
ids.add(
|
|
37
|
+
ids.add(id);
|
|
53
38
|
}
|
|
54
39
|
}
|
|
55
40
|
else {
|
|
@@ -62,25 +47,22 @@ function ensureAllSymbolsHaveIds(content) {
|
|
|
62
47
|
}
|
|
63
48
|
exports.ensureAllSymbolsHaveIds = ensureAllSymbolsHaveIds;
|
|
64
49
|
//TODO(misko): needs test
|
|
65
|
-
function convertBuilderContentToSymbolHierarchy(content,
|
|
66
|
-
var _b;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (collectComponentState && ((_c = content.data) === null || _c === void 0 ? void 0 : _c.state)) {
|
|
70
|
-
var state = (_d = content.data) === null || _d === void 0 ? void 0 : _d.state;
|
|
50
|
+
function convertBuilderContentToSymbolHierarchy(content, { collectComponentStyles, collectComponentState, } = {}) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
if (collectComponentState && ((_a = content.data) === null || _a === void 0 ? void 0 : _a.state)) {
|
|
53
|
+
const state = (_b = content.data) === null || _b === void 0 ? void 0 : _b.state;
|
|
71
54
|
collectComponentState['ROOT_COMPONENT_STATE'] = state;
|
|
72
55
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
_b);
|
|
56
|
+
const path = [-1, content.id];
|
|
57
|
+
const hierarchy = {
|
|
58
|
+
depthFirstSymbols: [],
|
|
59
|
+
[content.id]: [],
|
|
60
|
+
};
|
|
79
61
|
(0, legacy_1.default)(content).forEach(function (el) {
|
|
80
62
|
var _a, _b, _c;
|
|
81
|
-
|
|
63
|
+
let cssCode = el === null || el === void 0 ? void 0 : el.cssCode;
|
|
82
64
|
if (cssCode) {
|
|
83
|
-
collectComponentStyles && collectComponentStyles.push((0, minify_1.minify)
|
|
65
|
+
collectComponentStyles && collectComponentStyles.push((0, minify_1.minify) `${cssCode}`);
|
|
84
66
|
}
|
|
85
67
|
while (path[0 /* Path.DEPTH */] >= this.path.length) {
|
|
86
68
|
path.shift();
|
|
@@ -89,17 +71,17 @@ function convertBuilderContentToSymbolHierarchy(content, _a) {
|
|
|
89
71
|
if ((0, builder_1.isBuilderElement)(el)) {
|
|
90
72
|
if (((_a = el === null || el === void 0 ? void 0 : el.component) === null || _a === void 0 ? void 0 : _a.name) === 'Symbol') {
|
|
91
73
|
if (collectComponentState) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
74
|
+
const symbol = el.component.options.symbol;
|
|
75
|
+
const props = symbol.data || (symbol.data = {});
|
|
76
|
+
const state = (_c = (_b = symbol.content) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.state;
|
|
95
77
|
if (state) {
|
|
96
|
-
|
|
78
|
+
const id = hashCodeAsString(state);
|
|
97
79
|
props['serverStateId'] = id;
|
|
98
80
|
collectComponentState[id] = state;
|
|
99
81
|
}
|
|
100
82
|
}
|
|
101
83
|
if (path[0 /* Path.DEPTH */] < this.path.length) {
|
|
102
|
-
|
|
84
|
+
const id = getIdFromSymbol(el);
|
|
103
85
|
hierarchy[id] = [];
|
|
104
86
|
addIfMissing(hierarchy[path[1 /* Path.ID */]], id);
|
|
105
87
|
path.unshift(this.path.length, id);
|
|
@@ -116,16 +98,16 @@ function convertBuilderContentToSymbolHierarchy(content, _a) {
|
|
|
116
98
|
exports.convertBuilderContentToSymbolHierarchy = convertBuilderContentToSymbolHierarchy;
|
|
117
99
|
function convertBuilderElementToMitosisComponent(element) {
|
|
118
100
|
var _a, _b;
|
|
119
|
-
|
|
120
|
-
|
|
101
|
+
const symbolValue = (_b = (_a = element.component) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.symbol;
|
|
102
|
+
const elContent = symbolValue === null || symbolValue === void 0 ? void 0 : symbolValue.content;
|
|
121
103
|
if (!elContent) {
|
|
122
104
|
console.warn('Symbol missing content', element.id);
|
|
123
105
|
delete element.component; // TODO(misko): Should this be assign `undefined` for perf?
|
|
124
106
|
element.children = [];
|
|
125
107
|
return null;
|
|
126
108
|
}
|
|
127
|
-
|
|
128
|
-
|
|
109
|
+
const id = getIdFromSymbol(element);
|
|
110
|
+
const componentName = getJsxSymbolComponentName(id);
|
|
129
111
|
delete element.component; // TODO(misko): Should this be assign `undefined` for perf?
|
|
130
112
|
element.children = [
|
|
131
113
|
(0, builder_1.createBuilderElement)({
|
|
@@ -138,10 +120,13 @@ function convertBuilderElementToMitosisComponent(element) {
|
|
|
138
120
|
},
|
|
139
121
|
}),
|
|
140
122
|
];
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
123
|
+
const mitosisComponent = {
|
|
124
|
+
...(0, builder_1.builderContentToMitosisComponent)(elContent, {
|
|
125
|
+
includeBuilderExtras: true,
|
|
126
|
+
preserveTextBlocks: true,
|
|
127
|
+
}),
|
|
128
|
+
name: componentName,
|
|
129
|
+
};
|
|
145
130
|
mitosisComponent.meta.builderElId = element.id;
|
|
146
131
|
return mitosisComponent;
|
|
147
132
|
}
|
|
@@ -167,9 +152,8 @@ function hashCodeAsString(obj) {
|
|
|
167
152
|
return Number(Math.abs(hashCode(obj))).toString(36);
|
|
168
153
|
}
|
|
169
154
|
exports.hashCodeAsString = hashCodeAsString;
|
|
170
|
-
function hashCode(obj, hash) {
|
|
171
|
-
|
|
172
|
-
var value = 0;
|
|
155
|
+
function hashCode(obj, hash = 0) {
|
|
156
|
+
let value = 0;
|
|
173
157
|
switch (typeof obj) {
|
|
174
158
|
case 'number':
|
|
175
159
|
value = obj;
|
|
@@ -178,7 +162,7 @@ function hashCode(obj, hash) {
|
|
|
178
162
|
value = Number.MIN_SAFE_INTEGER;
|
|
179
163
|
break;
|
|
180
164
|
case 'string':
|
|
181
|
-
for (
|
|
165
|
+
for (let i = 0; i < obj.length; i++) {
|
|
182
166
|
hash = hashCodeApply(hash, obj.charCodeAt(i));
|
|
183
167
|
}
|
|
184
168
|
value = obj.length;
|
|
@@ -190,13 +174,12 @@ function hashCode(obj, hash) {
|
|
|
190
174
|
value = Number.MAX_SAFE_INTEGER;
|
|
191
175
|
}
|
|
192
176
|
else if (Array.isArray(obj)) {
|
|
193
|
-
for (
|
|
177
|
+
for (let i = 0; i < obj.length; i++) {
|
|
194
178
|
hash = hashCode(obj[i], hash);
|
|
195
179
|
}
|
|
196
180
|
}
|
|
197
181
|
else {
|
|
198
|
-
for (
|
|
199
|
-
var key = _a[_i];
|
|
182
|
+
for (const key of Object.keys(obj).sort()) {
|
|
200
183
|
if (obj.hasOwnProperty(key)) {
|
|
201
184
|
hash = hashCode(obj[key], hash);
|
|
202
185
|
}
|
|
@@ -213,8 +196,7 @@ function hashCodeApply(hash, value) {
|
|
|
213
196
|
return hash;
|
|
214
197
|
}
|
|
215
198
|
function pad(value) {
|
|
216
|
-
|
|
217
|
-
|
|
199
|
+
const padding = '000000';
|
|
200
|
+
let result = padding + String(value);
|
|
218
201
|
return result.substring(result.length - padding.length);
|
|
219
202
|
}
|
|
220
|
-
var templateObject_1;
|
package/dist/src/targets.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.targets = exports.builder = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
const alpine_1 = require("./generators/alpine");
|
|
5
|
+
const angular_1 = require("./generators/angular");
|
|
6
|
+
const builder_1 = require("./generators/builder");
|
|
7
|
+
const html_1 = require("./generators/html");
|
|
8
|
+
const liquid_1 = require("./generators/liquid");
|
|
9
|
+
const lit_1 = require("./generators/lit");
|
|
10
|
+
const marko_1 = require("./generators/marko");
|
|
11
|
+
const mitosis_1 = require("./generators/mitosis");
|
|
12
|
+
const qwik_1 = require("./generators/qwik");
|
|
13
|
+
const react_1 = require("./generators/react");
|
|
14
|
+
const react_native_1 = require("./generators/react-native");
|
|
15
|
+
const rsc_1 = require("./generators/rsc");
|
|
16
|
+
const solid_1 = require("./generators/solid");
|
|
17
|
+
const stencil_1 = require("./generators/stencil");
|
|
18
|
+
const svelte_1 = require("./generators/svelte");
|
|
19
|
+
const swift_ui_1 = require("./generators/swift-ui");
|
|
20
|
+
const taro_1 = require("./generators/taro");
|
|
21
|
+
const template_1 = require("./generators/template");
|
|
22
|
+
const vue_1 = require("./generators/vue");
|
|
23
23
|
exports.builder = builder_1.componentToBuilder;
|
|
24
24
|
exports.targets = {
|
|
25
25
|
alpine: alpine_1.componentToAlpine,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkIsForNode = void 0;
|
|
4
|
-
|
|
4
|
+
const checkIsForNode = (node) => node.name === 'For';
|
|
5
5
|
exports.checkIsForNode = checkIsForNode;
|