@builder.io/mitosis 0.2.6 → 0.2.8

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.
@@ -7,4 +7,5 @@ export interface ToVueOptions extends BaseTranspilerOptions {
7
7
  defineComponent?: boolean;
8
8
  api: Api;
9
9
  convertClassStringToObject?: boolean;
10
+ casing?: 'pascal' | 'kebab';
10
11
  }
@@ -97,6 +97,7 @@ var onUpdatePlugin = function (options) { return ({
97
97
  var BASE_OPTIONS = {
98
98
  api: 'options',
99
99
  defineComponent: true,
100
+ casing: 'pascal',
100
101
  };
101
102
  var componentToVue = function (userOptions) {
102
103
  return function (_a) {
@@ -181,7 +182,12 @@ var componentToVue = function (userOptions) {
181
182
  prefix: (_d = (_c = options.cssNamespace) === null || _c === void 0 ? void 0 : _c.call(options)) !== null && _d !== void 0 ? _d : undefined,
182
183
  });
183
184
  (0, strip_meta_properties_1.stripMetaProperties)(component);
184
- var template = (0, function_1.pipe)(component.children.map(function (item) { return (0, blocks_1.blockToVue)(item, options, { isRootNode: true }); }).join('\n'), helpers_1.renameMitosisComponentsToKebabCase);
185
+ var templateStrBody = component.children
186
+ .map(function (item) { return (0, blocks_1.blockToVue)(item, options, { isRootNode: true }); })
187
+ .join('\n');
188
+ var template = options.casing === 'kebab'
189
+ ? (0, helpers_1.renameMitosisComponentsToKebabCase)(templateStrBody)
190
+ : templateStrBody;
185
191
  var onUpdateWithDeps = ((_e = component.hooks.onUpdate) === null || _e === void 0 ? void 0 : _e.filter(function (hook) { var _a; return (_a = hook.deps) === null || _a === void 0 ? void 0 : _a.length; })) || [];
186
192
  var onUpdateWithoutDeps = ((_f = component.hooks.onUpdate) === null || _f === void 0 ? void 0 : _f.filter(function (hook) { var _a; return !((_a = hook.deps) === null || _a === void 0 ? void 0 : _a.length); })) || [];
187
193
  var getterKeys = Object.keys((0, lodash_1.pickBy)(component.state, function (i) { return (i === null || i === void 0 ? void 0 : i.type) === 'getter'; }));
@@ -12,6 +12,7 @@ type BuilderToMitosisOptions = {
12
12
  includeBuilderExtras?: boolean;
13
13
  preserveTextBlocks?: boolean;
14
14
  includeSpecialBindings?: boolean;
15
+ includeMeta?: boolean;
15
16
  };
16
17
  export declare const builderElementToMitosisNode: (block: BuilderElement, options: BuilderToMitosisOptions, _internalOptions?: InternalOptions) => MitosisNode;
17
18
  /**
@@ -417,7 +417,7 @@ var builderElementToMitosisNode = function (block, options, _internalOptions) {
417
417
  var _a;
418
418
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
419
419
  if (_internalOptions === void 0) { _internalOptions = {}; }
420
- var _x = options.includeSpecialBindings, includeSpecialBindings = _x === void 0 ? true : _x;
420
+ var _x = options.includeSpecialBindings, includeSpecialBindings = _x === void 0 ? true : _x, _y = options.includeMeta, includeMeta = _y === void 0 ? false : _y;
421
421
  if (((_b = block.component) === null || _b === void 0 ? void 0 : _b.name) === 'Core:Fragment') {
422
422
  block.component.name = 'Fragment';
423
423
  }
@@ -580,6 +580,8 @@ var builderElementToMitosisNode = function (block, options, _internalOptions) {
580
580
  css: (0, bindings_1.createSingleBinding)({ code: JSON.stringify(css) }),
581
581
  })),
582
582
  slots: __assign({}, slots),
583
+ meta: includeMeta
584
+ ? __assign({ 'builder-id': block.id }, block.meta) : {},
583
585
  });
584
586
  // Has single text node child
585
587
  var firstChild = (_s = block.children) === null || _s === void 0 ? void 0 : _s[0];
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.2.6",
25
+ "version": "0.2.8",
26
26
  "homepage": "https://github.com/BuilderIO/mitosis",
27
27
  "main": "./dist/src/index.js",
28
28
  "exports": {