@builder.io/mitosis 0.5.33 → 0.5.35
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.
|
@@ -131,8 +131,13 @@ const BINDING_MAPPERS = {
|
|
|
131
131
|
}
|
|
132
132
|
return [ref, value];
|
|
133
133
|
},
|
|
134
|
-
innerHTML(_key, value) {
|
|
135
|
-
|
|
134
|
+
innerHTML(_key, value, _options, isProperty) {
|
|
135
|
+
const wrapChar = isProperty ? '"' : '';
|
|
136
|
+
let useValue = value.replace(/\s+/g, ' ');
|
|
137
|
+
if (isProperty) {
|
|
138
|
+
useValue = value.replace(/"/g, '\\"');
|
|
139
|
+
}
|
|
140
|
+
return ['dangerouslySetInnerHTML', `{__html: ${wrapChar}${useValue}${wrapChar}}`];
|
|
136
141
|
},
|
|
137
142
|
...ATTTRIBUTE_MAPPERS,
|
|
138
143
|
};
|
|
@@ -196,7 +201,7 @@ const blockToReact = (json, options, component, insideJsx, parentSlots = []) =>
|
|
|
196
201
|
else if (BINDING_MAPPERS[key]) {
|
|
197
202
|
const mapper = BINDING_MAPPERS[key];
|
|
198
203
|
if (typeof mapper === 'function') {
|
|
199
|
-
const [newKey, newValue] = mapper(key, value, options);
|
|
204
|
+
const [newKey, newValue] = mapper(key, value, options, true);
|
|
200
205
|
str += ` ${newKey}={${newValue}} `;
|
|
201
206
|
}
|
|
202
207
|
else {
|
|
@@ -371,7 +371,7 @@ const componentMappers = {
|
|
|
371
371
|
* If width if undefined, do not create a binding otherwise its JSX will
|
|
372
372
|
* be <Column width={} /> which is not valid due to the empty expression.
|
|
373
373
|
*/
|
|
374
|
-
...(col.width
|
|
374
|
+
...(col.width != null && {
|
|
375
375
|
bindings: {
|
|
376
376
|
width: { code: col.width.toString() },
|
|
377
377
|
},
|
|
@@ -171,7 +171,10 @@ exports.components = {
|
|
|
171
171
|
if ((_a = node === null || node === void 0 ? void 0 : node.bindings) === null || _a === void 0 ? void 0 : _a.code) {
|
|
172
172
|
bindings.innerHTML = node.bindings.code;
|
|
173
173
|
}
|
|
174
|
-
return wrapOutput(
|
|
174
|
+
return wrapOutput({
|
|
175
|
+
...node,
|
|
176
|
+
properties: (0, lodash_1.omit)(node.properties, 'code'),
|
|
177
|
+
}, (0, create_mitosis_node_1.createMitosisNode)({
|
|
175
178
|
name: node.properties.builderTag || 'div',
|
|
176
179
|
properties: {
|
|
177
180
|
innerHTML: node.properties.code || '',
|