@builder.io/mitosis 0.1.0 → 0.1.1

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.
@@ -198,7 +198,12 @@ var blockToReact = function (json, options, component, parentSlots) {
198
198
  str += " ".concat(newKey, "={").concat(newValue, "} ");
199
199
  }
200
200
  else {
201
- str += " ".concat(BINDING_MAPPERS[key], "={").concat(useBindingValue, "} ");
201
+ if (useBindingValue === 'true') {
202
+ str += " ".concat(BINDING_MAPPERS[key], " ");
203
+ }
204
+ else {
205
+ str += " ".concat(BINDING_MAPPERS[key], "={").concat(useBindingValue, "} ");
206
+ }
202
207
  }
203
208
  }
204
209
  else if (key === 'style' && options.type === 'native' && json.name === 'ScrollView') {
@@ -527,7 +527,17 @@ var builderElementToMitosisNode = function (block, options, _internalOptions) {
527
527
  for (var key in block.component.options) {
528
528
  var value = block.component.options[key];
529
529
  var valueIsArrayOfBuilderElements = Array.isArray(value) && value.every(exports.isBuilderElement);
530
- if (typeof value === 'string') {
530
+ var transformBldrElementToBinding = function (item) {
531
+ var node = (0, exports.builderElementToMitosisNode)(item, __assign(__assign({}, options), { includeSpecialBindings: false }));
532
+ // For now, stringify to Mitosis nodes even though that only really works in React, due to syntax overlap.
533
+ // the correct long term solution is to hold on to the Mitosis Node, and have a plugin for each framework
534
+ // which processes any Mitosis nodes set into the attribute and moves them as slots when relevant (Svelte/Vue)
535
+ return (0, __1.blockToMitosis)(node, {}, null);
536
+ };
537
+ if ((0, exports.isBuilderElement)(value)) {
538
+ bindings[key] = (0, bindings_1.createSingleBinding)({ code: transformBldrElementToBinding(value) });
539
+ }
540
+ else if (typeof value === 'string') {
531
541
  properties[key] = value;
532
542
  }
533
543
  else if (valueIsArrayOfBuilderElements) {
@@ -539,13 +549,7 @@ var builderElementToMitosisNode = function (block, options, _internalOptions) {
539
549
  }
540
550
  return true;
541
551
  })
542
- .map(function (item) {
543
- var node = (0, exports.builderElementToMitosisNode)(item, __assign(__assign({}, options), { includeSpecialBindings: false }));
544
- // For now, stringify to Mitosis nodes even though that only really works in React, due to syntax overlap.
545
- // the correct long term solution is to hold on to the Mitosis Node, and have a plugin for each framework
546
- // which processes any Mitosis nodes set into the attribute and moves them as slots when relevant (Svelte/Vue)
547
- return (0, __1.blockToMitosis)(node, {}, null);
548
- });
552
+ .map(transformBldrElementToBinding);
549
553
  var strVal = childrenElements.length === 1 ? childrenElements[0] : "<>".concat(childrenElements.join(''), "</>");
550
554
  bindings[key] = (0, bindings_1.createSingleBinding)({ code: strVal });
551
555
  }
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "name": "Builder.io",
23
23
  "url": "https://www.builder.io"
24
24
  },
25
- "version": "0.1.0",
25
+ "version": "0.1.1",
26
26
  "homepage": "https://github.com/BuilderIO/mitosis",
27
27
  "main": "./dist/src/index.js",
28
28
  "exports": {