@builder.io/mitosis 0.1.1 → 0.1.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.
|
@@ -256,8 +256,8 @@ exports.components = {
|
|
|
256
256
|
}), components);
|
|
257
257
|
},
|
|
258
258
|
Image: function (node, context, components) {
|
|
259
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
260
|
-
var
|
|
259
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
260
|
+
var _k = node.properties, backgroundSize = _k.backgroundSize, backgroundPosition = _k.backgroundPosition;
|
|
261
261
|
var srcset = node.properties.srcset;
|
|
262
262
|
var aspectRatio = ((_a = node.bindings.aspectRatio) === null || _a === void 0 ? void 0 : _a.code)
|
|
263
263
|
? parseFloat(node.bindings.aspectRatio.code)
|
|
@@ -281,12 +281,13 @@ exports.components = {
|
|
|
281
281
|
bindings: noUndefined({
|
|
282
282
|
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 },
|
|
283
283
|
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 },
|
|
284
|
+
style: ((_g = node.bindings.style) === null || _g === void 0 ? void 0 : _g.code) && { code: (_h = node.bindings.style) === null || _h === void 0 ? void 0 : _h.code },
|
|
284
285
|
css: (0, bindings_1.createSingleBinding)({
|
|
285
286
|
code: JSON.stringify(__assign(__assign({ aspectRatio: aspectRatio ? String((0, lodash_1.round)(1 / aspectRatio, 2)) : undefined, objectFit: backgroundSize || 'cover', objectPosition: backgroundPosition || 'center', width: '100%' }, css), { display: undefined, flexDirection: undefined, position: css.position === 'relative' ? undefined : css.position })),
|
|
286
287
|
}),
|
|
287
288
|
}),
|
|
288
289
|
});
|
|
289
|
-
if (!((
|
|
290
|
+
if (!((_j = node.children) === null || _j === void 0 ? void 0 : _j.length)) {
|
|
290
291
|
return img;
|
|
291
292
|
}
|
|
292
293
|
// TODO: deal with links: anchor tag and href
|