@builder.io/mitosis 0.11.1 → 0.11.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.
|
@@ -583,6 +583,12 @@ const blockToBuilder = (json, options = {}, _internalOptions = {}) => {
|
|
|
583
583
|
responsiveStyles,
|
|
584
584
|
}),
|
|
585
585
|
layerName: json.properties.$name,
|
|
586
|
+
...(json.properties['data-builder-layerLocked'] !== undefined && {
|
|
587
|
+
layerLocked: json.properties['data-builder-layerLocked'] === 'true',
|
|
588
|
+
}),
|
|
589
|
+
...(json.properties['data-builder-groupLocked'] !== undefined && {
|
|
590
|
+
groupLocked: json.properties['data-builder-groupLocked'] === 'true',
|
|
591
|
+
}),
|
|
586
592
|
...(thisIsComponent && {
|
|
587
593
|
component: {
|
|
588
594
|
name: mapComponentName(json.name),
|
|
@@ -498,6 +498,14 @@ const componentMappers = {
|
|
|
498
498
|
if (block.layerName) {
|
|
499
499
|
properties.$name = block.layerName;
|
|
500
500
|
}
|
|
501
|
+
// Add data attributes for Builder layer properties
|
|
502
|
+
const dataAttributes = {};
|
|
503
|
+
if (block.layerLocked !== undefined) {
|
|
504
|
+
dataAttributes['data-builder-layerLocked'] = String(block.layerLocked);
|
|
505
|
+
}
|
|
506
|
+
if (block.groupLocked !== undefined) {
|
|
507
|
+
dataAttributes['data-builder-groupLocked'] = String(block.groupLocked);
|
|
508
|
+
}
|
|
501
509
|
const innerBindings = {};
|
|
502
510
|
const componentOptionsText = blockBindings['component.options.text'];
|
|
503
511
|
if (componentOptionsText) {
|
|
@@ -522,7 +530,10 @@ const componentMappers = {
|
|
|
522
530
|
return (0, create_mitosis_node_1.createMitosisNode)({
|
|
523
531
|
name: block.tagName || 'div',
|
|
524
532
|
bindings,
|
|
525
|
-
properties
|
|
533
|
+
properties: {
|
|
534
|
+
...properties,
|
|
535
|
+
...dataAttributes,
|
|
536
|
+
},
|
|
526
537
|
meta: (0, exports.getMetaFromBlock)(block, options),
|
|
527
538
|
...(Object.keys(localizedValues).length && { localizedValues }),
|
|
528
539
|
children: [
|
|
@@ -546,6 +557,7 @@ const componentMappers = {
|
|
|
546
557
|
}
|
|
547
558
|
: {}),
|
|
548
559
|
...properties,
|
|
560
|
+
...dataAttributes,
|
|
549
561
|
};
|
|
550
562
|
const finalTagname = block.tagName || (assumeLink ? 'a' : 'div');
|
|
551
563
|
if ((block.tagName && block.tagName !== 'div') ||
|
|
@@ -817,6 +829,14 @@ const builderElementToMitosisNode = (block, options, _internalOptions = {}) => {
|
|
|
817
829
|
bindings[useKey] = (0, bindings_1.createSingleBinding)({ code: value });
|
|
818
830
|
}
|
|
819
831
|
}
|
|
832
|
+
// Add data attributes for Builder layer properties
|
|
833
|
+
const dataAttributes = {};
|
|
834
|
+
if (block.layerLocked !== undefined) {
|
|
835
|
+
dataAttributes['data-builder-layerLocked'] = String(block.layerLocked);
|
|
836
|
+
}
|
|
837
|
+
if (block.groupLocked !== undefined) {
|
|
838
|
+
dataAttributes['data-builder-groupLocked'] = String(block.groupLocked);
|
|
839
|
+
}
|
|
820
840
|
const node = (0, create_mitosis_node_1.createMitosisNode)({
|
|
821
841
|
name: ((_r = (_q = block.component) === null || _q === void 0 ? void 0 : _q.name) === null || _r === void 0 ? void 0 : _r.replace(/[^a-z0-9]/gi, '')) ||
|
|
822
842
|
block.tagName ||
|
|
@@ -825,6 +845,7 @@ const builderElementToMitosisNode = (block, options, _internalOptions = {}) => {
|
|
|
825
845
|
...(block.component && includeSpecialBindings && { $tagName: block.tagName }),
|
|
826
846
|
...(block.class && { class: block.class }),
|
|
827
847
|
...properties,
|
|
848
|
+
...dataAttributes,
|
|
828
849
|
},
|
|
829
850
|
bindings: {
|
|
830
851
|
...bindings,
|