@builder.io/mitosis 0.5.8 → 0.5.10

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.
@@ -403,6 +403,20 @@ const componentToBuilder = (options = {}) => ({ component }) => {
403
403
  if (value) {
404
404
  (0, lodash_1.set)(el, 'component.options.symbol.content', value);
405
405
  }
406
+ if (el.bindings) {
407
+ for (const [key, value] of Object.entries(el.bindings)) {
408
+ if (value.match(/\n|;/)) {
409
+ if (!el.code) {
410
+ el.code = {};
411
+ }
412
+ if (!el.code.bindings) {
413
+ el.code.bindings = {};
414
+ }
415
+ el.code.bindings[key] = value;
416
+ el.bindings[key] = ` return ${value}`;
417
+ }
418
+ }
419
+ }
406
420
  }
407
421
  });
408
422
  return result;
@@ -243,11 +243,11 @@ const componentToMitosis = (toMitosisOptions = {}) => ({ component }) => {
243
243
 
244
244
  ${json.style ? `useStyle(\`${json.style}\`)` : ''}
245
245
 
246
- return (${addWrapper ? '<>' : ''}
246
+ return ${options.returnArray ? '[' : '('}${addWrapper ? '<>' : ''}
247
247
  ${json.children
248
248
  .map((item) => (0, exports.blockToMitosis)(item, options, component, addWrapper))
249
249
  .join('\n')}
250
- ${addWrapper ? '</>' : ''})
250
+ ${addWrapper ? '</>' : ''}${options.returnArray ? ']' : ')'}
251
251
  }
252
252
 
253
253
  `;
@@ -3,5 +3,6 @@ export interface ToMitosisOptions extends BaseTranspilerOptions {
3
3
  format: 'react' | 'legacy';
4
4
  nativeConditionals?: boolean;
5
5
  nativeLoops?: boolean;
6
+ returnArray?: boolean;
6
7
  }
7
8
  export type MitosisMetadata = {};
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.5.8",
25
+ "version": "0.5.10",
26
26
  "homepage": "https://github.com/BuilderIO/mitosis",
27
27
  "main": "./dist/src/index.js",
28
28
  "exports": {