@builder.io/mitosis 0.0.56-47 → 0.0.56-48
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.
|
@@ -27,7 +27,6 @@ var jsx_1 = require("../../parsers/jsx");
|
|
|
27
27
|
var plugins_1 = require("../../modules/plugins");
|
|
28
28
|
var fast_clone_1 = require("../../helpers/fast-clone");
|
|
29
29
|
var strip_meta_properties_1 = require("../../helpers/strip-meta-properties");
|
|
30
|
-
var collect_class_string_1 = require("../stencil/collect-class-string");
|
|
31
30
|
var strip_state_and_props_refs_1 = require("../../helpers/strip-state-and-props-refs");
|
|
32
31
|
var filter_empty_text_nodes_1 = require("../../helpers/filter-empty-text-nodes");
|
|
33
32
|
var collect_css_1 = require("../../helpers/styles/collect-css");
|
|
@@ -115,10 +114,6 @@ var blockToMarko = function (json, options) {
|
|
|
115
114
|
}
|
|
116
115
|
var str = '';
|
|
117
116
|
str += "<".concat(toTagName(json.name), " ");
|
|
118
|
-
var classString = (0, collect_class_string_1.collectClassString)(json, '(', ')');
|
|
119
|
-
if (classString) {
|
|
120
|
-
str += " class=".concat(classString, " ");
|
|
121
|
-
}
|
|
122
117
|
if ((_e = json.bindings._spread) === null || _e === void 0 ? void 0 : _e.code) {
|
|
123
118
|
str += " ...(".concat(json.bindings._spread.code, ") ");
|
|
124
119
|
}
|
|
@@ -246,8 +241,11 @@ var componentToMarko = function (userOptions) {
|
|
|
246
241
|
console.warn('Could not format js', err);
|
|
247
242
|
}
|
|
248
243
|
}
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
htmlString = htmlString
|
|
245
|
+
// Convert on-click=(...) -> on-click(...)
|
|
246
|
+
.replace(/(on-[a-z]+)=\(/g, function (_match, group) { return group + '('; })
|
|
247
|
+
// Fix a weird edge case where </if> becomes </if \n > which is invalid in marko
|
|
248
|
+
.replace(/<\/([a-z]+)\s+>/g, '</$1>');
|
|
251
249
|
var finalStr = "\n".concat(jsString, "\n").concat(cssString, "\n").concat(htmlString, "\n ")
|
|
252
250
|
.replace(/\n{3,}/g, '\n\n')
|
|
253
251
|
.trim();
|