@builder.io/mitosis 0.11.3 → 0.11.4
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MitosisComponent, MitosisState } from '../../types/mitosis-component';
|
|
2
2
|
import { BuilderContent, BuilderElement } from '@builder.io/sdk';
|
|
3
3
|
import { MitosisNode } from '../../types/mitosis-node';
|
|
4
|
+
export declare const getStyleStringFromBlock: (block: BuilderElement, options: BuilderToMitosisOptions) => string;
|
|
4
5
|
type InternalOptions = {
|
|
5
6
|
skipMapper?: boolean;
|
|
6
7
|
};
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.builderContentToMitosisComponent = exports.isBuilderElement = exports.createBuilderElement = exports.convertExportDefaultToReturn = exports.extractStateHook = exports.getMetaFromBlock = exports.builderElementToMitosisNode = exports.symbolBlocksAsChildren = void 0;
|
|
29
|
+
exports.builderContentToMitosisComponent = exports.isBuilderElement = exports.createBuilderElement = exports.convertExportDefaultToReturn = exports.extractStateHook = exports.getMetaFromBlock = exports.builderElementToMitosisNode = exports.symbolBlocksAsChildren = exports.getStyleStringFromBlock = void 0;
|
|
30
30
|
const symbol_processor_1 = require("../../symbols/symbol-processor");
|
|
31
31
|
const babel = __importStar(require("@babel/core"));
|
|
32
32
|
const generator_1 = __importDefault(require("@babel/generator"));
|
|
@@ -154,7 +154,9 @@ const getStyleStringFromBlock = (block, options) => {
|
|
|
154
154
|
*/
|
|
155
155
|
}
|
|
156
156
|
else if (key.includes('responsiveStyles')) {
|
|
157
|
-
const
|
|
157
|
+
const parts = key.split('.');
|
|
158
|
+
const size = parts[parts.length - 2];
|
|
159
|
+
const prop = parts[parts.length - 1];
|
|
158
160
|
const mediaKey = `@media (max-width: ${media_sizes_1.sizes[size].max}px)`;
|
|
159
161
|
/**
|
|
160
162
|
* The media query key has spaces/special characters so we need to ensure
|
|
@@ -195,6 +197,7 @@ const getStyleStringFromBlock = (block, options) => {
|
|
|
195
197
|
}
|
|
196
198
|
return styleString;
|
|
197
199
|
};
|
|
200
|
+
exports.getStyleStringFromBlock = getStyleStringFromBlock;
|
|
198
201
|
const hasComponent = (block) => {
|
|
199
202
|
var _a;
|
|
200
203
|
return Boolean((_a = block.component) === null || _a === void 0 ? void 0 : _a.name);
|
|
@@ -301,7 +304,7 @@ const componentMappers = {
|
|
|
301
304
|
Symbol(block, options) {
|
|
302
305
|
var _a;
|
|
303
306
|
let css = getCssFromBlock(block);
|
|
304
|
-
const styleString = getStyleStringFromBlock(block, options);
|
|
307
|
+
const styleString = (0, exports.getStyleStringFromBlock)(block, options);
|
|
305
308
|
const actionBindings = getActionBindingsFromBlock(block, options);
|
|
306
309
|
const bindings = {
|
|
307
310
|
symbol: (0, bindings_1.createSingleBinding)({
|
|
@@ -329,7 +332,7 @@ const componentMappers = {
|
|
|
329
332
|
Symbol(block, options) {
|
|
330
333
|
var _a, _b, _c;
|
|
331
334
|
let css = getCssFromBlock(block);
|
|
332
|
-
const styleString = getStyleStringFromBlock(block, options);
|
|
335
|
+
const styleString = (0, exports.getStyleStringFromBlock)(block, options);
|
|
333
336
|
const actionBindings = getActionBindingsFromBlock(block, options);
|
|
334
337
|
const content = (_a = block.component) === null || _a === void 0 ? void 0 : _a.options.symbol.content;
|
|
335
338
|
const blocks = (_b = content === null || content === void 0 ? void 0 : content.data) === null || _b === void 0 ? void 0 : _b.blocks;
|
|
@@ -456,7 +459,7 @@ const componentMappers = {
|
|
|
456
459
|
Text: (block, options) => {
|
|
457
460
|
var _a, _b, _c;
|
|
458
461
|
let css = getCssFromBlock(block);
|
|
459
|
-
const styleString = getStyleStringFromBlock(block, options);
|
|
462
|
+
const styleString = (0, exports.getStyleStringFromBlock)(block, options);
|
|
460
463
|
const actionBindings = getActionBindingsFromBlock(block, options);
|
|
461
464
|
const localizedValues = {};
|
|
462
465
|
const blockBindings = {
|
|
@@ -820,7 +823,7 @@ const builderElementToMitosisNode = (block, options, _internalOptions = {}) => {
|
|
|
820
823
|
}
|
|
821
824
|
}
|
|
822
825
|
const css = getCssFromBlock(block);
|
|
823
|
-
let styleString = getStyleStringFromBlock(block, options);
|
|
826
|
+
let styleString = (0, exports.getStyleStringFromBlock)(block, options);
|
|
824
827
|
const actionBindings = getActionBindingsFromBlock(block, options);
|
|
825
828
|
for (const binding in blockBindings) {
|
|
826
829
|
if (binding.startsWith('component.options') || binding.startsWith('options')) {
|