pds-dev-kit-web-test 0.2.15 → 0.2.16
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.
- package/dist/src/sub/DynamicLayout/components/Section/CustomSection.d.ts +2 -1
- package/dist/src/sub/DynamicLayout/components/Section/CustomSection.js +2 -4
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackground.d.ts +1 -2
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackground.js +29 -50
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.d.ts +5 -3
- package/dist/src/sub/DynamicLayout/components/Section/components/CustomSectionBackgroundMedia.js +53 -28
- package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.d.ts +1 -4
- package/dist/src/sub/DynamicLayout/components/Section/util/parseSectionBackgroundMediaData.js +3 -12
- package/dist/src/sub/DynamicLayout/mock_customSection.js +9 -1
- package/dist/src/sub/DynamicLayout/mock_samplePage.js +1334 -440
- package/dist/src/sub/DynamicLayout/nakedMocks.json +8 -0
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +645 -0
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +1661 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.d.ts +3 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +50 -23
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +7 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +3 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +7 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/types.d.ts +12 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_BoxWithShadow.js +4 -12
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/hooks/useCLINK.js +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/colorUtil.js +6 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.js +3 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +98 -13
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropArrange.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseLayoutPropArrange.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseSectionPadding.d.ts +23 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/layoutPropParsers/parseSectionPadding.js +26 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCustomSectionPlacement.d.ts +5 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCustomSectionPlacement.js +15 -28
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseJsonProperties.js +2 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/index.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/index.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgColor.js +4 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgImage.js +3 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgOverlay.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBgOverlay.js +6 -12
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropBorder.js +16 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropDivider.js +17 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropImage.js +12 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropOpacity.js +9 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropShadow.js +7 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropTextSpec.d.ts +2 -33
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropTextSpec.js +27 -16
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +4 -4
- package/dist/src/sub/DynamicLayout/types.d.ts +4 -4
- package/package.json +2 -2
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ComponentBlock } from '../../types';
|
|
3
|
-
|
|
3
|
+
import type { Device } from '../../util/types';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
cbProps: ComponentBlock;
|
|
6
|
+
device: Device;
|
|
7
|
+
};
|
|
8
|
+
export default function ComponentBlockMatcher({ cbProps, device }: Props): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -15,10 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
19
18
|
var newUtils_1 = require("../../newUtils");
|
|
20
19
|
var types_1 = require("../../types");
|
|
21
|
-
require("../../util");
|
|
22
20
|
var Button_1 = __importDefault(require("./componentBlocks/Button/Button"));
|
|
23
21
|
var Divider_1 = __importDefault(require("./componentBlocks/Divider/Divider"));
|
|
24
22
|
var Image_1 = __importDefault(require("./componentBlocks/Image/Image"));
|
|
@@ -26,9 +24,9 @@ var RichText_1 = require("./componentBlocks/RichText");
|
|
|
26
24
|
var Text_1 = __importDefault(require("./componentBlocks/Text/Text"));
|
|
27
25
|
var Twitter_1 = __importDefault(require("./componentBlocks/Twitter/Twitter"));
|
|
28
26
|
var Youtube_1 = require("./componentBlocks/Youtube");
|
|
29
|
-
function ComponentBlockMatcher(
|
|
30
|
-
var device =
|
|
31
|
-
var
|
|
27
|
+
function ComponentBlockMatcher(_a) {
|
|
28
|
+
var cbProps = _a.cbProps, device = _a.device;
|
|
29
|
+
var componentBlockCode = cbProps.componentBlockCode, properties = cbProps.properties;
|
|
32
30
|
var propsWithValue = device === 'MOBILE' ? (0, newUtils_1.replaceUndefinedValues)(properties) : properties;
|
|
33
31
|
switch (componentBlockCode) {
|
|
34
32
|
case types_1.CB_ALL_CODES.CB_BTN:
|
|
@@ -65,7 +65,7 @@ function Image(props) {
|
|
|
65
65
|
return;
|
|
66
66
|
onClickBox();
|
|
67
67
|
};
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign({}, layout), effectCssProperties), wrapperStyle), hoverStyle: hoverWrapperStyle, cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, ref: cbRef, onClick: handleOnClick }, { children: (0, jsx_runtime_1.jsx)(S_ImageWrapper, __assign({ normalStyle: componentStyle, hoverStyle: hoverComponentStyle }, { children: (0, jsx_runtime_1.jsx)(S_Image, { src: CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_SELECTOR, normalStyle: { objectFit:
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign({}, layout), effectCssProperties), wrapperStyle), hoverStyle: hoverWrapperStyle, cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, ref: cbRef, onClick: handleOnClick }, { children: (0, jsx_runtime_1.jsx)(S_ImageWrapper, __assign({ normalStyle: componentStyle, hoverStyle: hoverComponentStyle }, { children: (0, jsx_runtime_1.jsx)(S_Image, { src: CB_CONTENT_PROP_IMAGE.CB_CONTENT_PROP_IMAGE_SPEC_SELECTOR, normalStyle: { objectFit: componentStyle.objectFit } }, void 0) }), void 0) }), void 0));
|
|
69
69
|
}
|
|
70
70
|
function imageStyleDivideProvider(style) {
|
|
71
71
|
return {
|
|
@@ -84,7 +84,7 @@ function imageStyleDivideProvider(style) {
|
|
|
84
84
|
borderTopRightRadius: style.borderTopRightRadius,
|
|
85
85
|
borderWidth: style.borderWidth,
|
|
86
86
|
boxShadow: style.boxShadow,
|
|
87
|
-
opacity:
|
|
87
|
+
opacity: style.opacity,
|
|
88
88
|
visibility: style.visibility
|
|
89
89
|
}
|
|
90
90
|
};
|
|
@@ -41,8 +41,11 @@ function Text(props) {
|
|
|
41
41
|
var cbRef = (0, react_1.useRef)(null);
|
|
42
42
|
var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 1, freezeOnceVisible: true });
|
|
43
43
|
var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
|
|
44
|
+
var isOnClickUsable = CB_CONTENT_PROP_CLINK_SPEC_TYPE !== 'DISABLED' &&
|
|
45
|
+
mode !== 'EDIT' &&
|
|
46
|
+
CB_CONTENT_PROP_CLINK_SPEC_SRC.length > 0;
|
|
44
47
|
var effectCssProperties = isVisible ? effect : {};
|
|
45
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, textStyle), propsStyle), layoutStyle), effectCssProperties), hoverStyle: __assign(__assign({}, textHoverStyle), propsHoverStyle),
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}, void 0), (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), layoutStyle), effectCssProperties), { display: 'flex' }), hoverStyle: __assign(__assign(__assign({}, textHoverStyle), propsHoverStyle), { display: 'flex' }), onClick: isOnClickUsable ? onClickBox : undefined, ref: cbRef }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT }), void 0)] }, void 0));
|
|
46
49
|
}
|
|
47
50
|
function getTextStyles(props, device) {
|
|
48
51
|
var availableSpecCodes = [
|
|
@@ -51,7 +54,9 @@ function getTextStyles(props, device) {
|
|
|
51
54
|
'CB_STYLE_PROP_TEXT_SPEC_SIZE',
|
|
52
55
|
'CB_STYLE_PROP_TEXT_SPEC_LINEHEIGHT',
|
|
53
56
|
'CB_STYLE_PROP_TEXT_SPEC_LETTERSPACING',
|
|
54
|
-
'CB_STYLE_PROP_TEXT_SPEC_COLOR'
|
|
57
|
+
'CB_STYLE_PROP_TEXT_SPEC_COLOR',
|
|
58
|
+
'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL',
|
|
59
|
+
'CB_STYLE_PROP_TEXT_SPEC_VERTICAL'
|
|
55
60
|
];
|
|
56
61
|
return (0, textUtil_1.parseStyleTextToCSSProp)({ availableSpecCodes: availableSpecCodes, props: props, device: device, propKey: 'TEXT' });
|
|
57
62
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { ENUM_STRING, NUMBER_INTEGER, STRING_8DIGIT_HEX } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
2
|
-
export declare type TextPropsKeys = keyof
|
|
3
|
-
export declare type
|
|
2
|
+
export declare type TextPropsKeys = keyof CB_STYLE_PROP_TEXT_SPECS;
|
|
3
|
+
export declare type CB_STYLE_PROP_TEXT_SPECS_BASE = {
|
|
4
4
|
CB_STYLE_PROP_TEXT_SPEC_TYPEFACE: ENUM_STRING;
|
|
5
5
|
CB_STYLE_PROP_TEXT_SPEC_WEIGHT: NUMBER_INTEGER;
|
|
6
6
|
CB_STYLE_PROP_TEXT_SPEC_SIZE: NUMBER_INTEGER;
|
|
7
7
|
CB_STYLE_PROP_TEXT_SPEC_LINEHEIGHT: NUMBER_INTEGER;
|
|
8
8
|
CB_STYLE_PROP_TEXT_SPEC_LETTERSPACING: NUMBER_INTEGER;
|
|
9
9
|
CB_STYLE_PROP_TEXT_SPEC_COLOR: STRING_8DIGIT_HEX;
|
|
10
|
+
CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL: ENUM_STRING;
|
|
11
|
+
CB_STYLE_PROP_TEXT_SPEC_VERTICAL: ENUM_STRING;
|
|
12
|
+
};
|
|
13
|
+
export declare type CB_STYLE_PROP_TEXT_SPECS = CB_STYLE_PROP_TEXT_SPECS_BASE & {
|
|
10
14
|
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:HOVER': ENUM_STRING;
|
|
11
15
|
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:MOBILE': ENUM_STRING | undefined;
|
|
12
16
|
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:MOBILE:HOVER': ENUM_STRING | undefined;
|
|
@@ -25,4 +29,10 @@ export declare type CB_TEXT_STYLE_PROPS = {
|
|
|
25
29
|
'CB_STYLE_PROP_TEXT_SPEC_COLOR:HOVER': STRING_8DIGIT_HEX;
|
|
26
30
|
'CB_STYLE_PROP_TEXT_SPEC_COLOR:MOBILE': STRING_8DIGIT_HEX | undefined;
|
|
27
31
|
'CB_STYLE_PROP_TEXT_SPEC_COLOR:MOBILE:HOVER': STRING_8DIGIT_HEX | undefined;
|
|
32
|
+
'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL:HOVER': ENUM_STRING;
|
|
33
|
+
'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL:MOBILE': ENUM_STRING | undefined;
|
|
34
|
+
'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL:MOBILE:HOVER': ENUM_STRING | undefined;
|
|
35
|
+
'CB_STYLE_PROP_TEXT_SPEC_VERTICAL:HOVER': ENUM_STRING;
|
|
36
|
+
'CB_STYLE_PROP_TEXT_SPEC_VERTICAL:MOBILE': ENUM_STRING | undefined;
|
|
37
|
+
'CB_STYLE_PROP_TEXT_SPEC_VERTICAL:MOBILE:HOVER': ENUM_STRING | undefined;
|
|
28
38
|
};
|
|
@@ -33,12 +33,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
33
|
__setModuleDefault(result, mod);
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
37
|
exports.S_CB_BoxWithShadow = void 0;
|
|
41
|
-
var isNullOrUndefined_1 = __importDefault(require("../../../../../../../DynamicLayout/sections/CustomSection/util/isNullOrUndefined"));
|
|
42
38
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
43
39
|
exports.S_CB_BoxWithShadow = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /*\n Introduced in IE 10.\n See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/\n */\n\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n opacity: ", ";\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover {\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n opacity: ", ";\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n }\n"], ["\n /*\n Introduced in IE 10.\n See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/\n */\n\n height: 100%;\n overflow: hidden;\n width: 100%;\n\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n opacity: ", ";\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover {\n ", ";\n\n &:before {\n border-bottom-left-radius: ", "px;\n border-bottom-right-radius: ", "px;\n border-top-left-radius: ", "px;\n border-top-right-radius: ", "px;\n box-shadow: ", ";\n content: '';\n height: 100%;\n left: 0;\n opacity: ", ";\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n }\n"])), function (_a) {
|
|
44
40
|
var normalStyle = _a.normalStyle;
|
|
@@ -62,11 +58,9 @@ exports.S_CB_BoxWithShadow = styled_components_1.default.div(templateObject_3 ||
|
|
|
62
58
|
var cbStylePropsShadowSpecs = _a.cbStylePropsShadowSpecs, device = _a.device;
|
|
63
59
|
switch (device) {
|
|
64
60
|
case 'DESKTOP':
|
|
65
|
-
return cbStylePropsShadowSpecs.CB_STYLE_PROP_SHADOW_SPEC_OPACITY / 100;
|
|
61
|
+
return Number(cbStylePropsShadowSpecs.CB_STYLE_PROP_SHADOW_SPEC_OPACITY) / 100;
|
|
66
62
|
case 'MOBILE':
|
|
67
|
-
return (
|
|
68
|
-
? cbStylePropsShadowSpecs.CB_STYLE_PROP_SHADOW_SPEC_OPACITY / 100
|
|
69
|
-
: Number(cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE']) / 100;
|
|
63
|
+
return Number(cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE']) / 100;
|
|
70
64
|
}
|
|
71
65
|
}, function (_a) {
|
|
72
66
|
var hoverStyle = _a.hoverStyle;
|
|
@@ -92,10 +86,8 @@ exports.S_CB_BoxWithShadow = styled_components_1.default.div(templateObject_3 ||
|
|
|
92
86
|
case 'DESKTOP':
|
|
93
87
|
return cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:HOVER'] / 100;
|
|
94
88
|
case 'MOBILE':
|
|
95
|
-
return (
|
|
96
|
-
|
|
97
|
-
: Number(cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE:HOVER']) /
|
|
98
|
-
100;
|
|
89
|
+
return (Number(cbStylePropsShadowSpecs['CB_STYLE_PROP_SHADOW_SPEC_OPACITY:MOBILE:HOVER']) /
|
|
90
|
+
100);
|
|
99
91
|
}
|
|
100
92
|
});
|
|
101
93
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -8,6 +8,9 @@ function useCLINK(props) {
|
|
|
8
8
|
var navigationHandler = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext).navigationHandler;
|
|
9
9
|
var navType = type === 'INTERNAL' ? 'INTERNAL_LINK' : 'WEB_LINK';
|
|
10
10
|
function onClickCLINK() {
|
|
11
|
+
if (!src) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
11
14
|
// NOTE: EDIT 모드에서는 작동 안해야함. cursor..?
|
|
12
15
|
if (openNewTab) {
|
|
13
16
|
window.open(src, '_blank', 'noopener');
|
|
@@ -8,7 +8,7 @@ export declare type CB_CONTENT_PROP_TEXT = {
|
|
|
8
8
|
CB_CONTENT_PROP_TEXT_SPEC_TEXT: STRING_PLAIN;
|
|
9
9
|
};
|
|
10
10
|
export declare type CB_CONTENT_PROP_CLINK = {
|
|
11
|
-
CB_CONTENT_PROP_CLINK_SPEC_TYPE: 'INTERNAL' | 'EXTERNAL';
|
|
11
|
+
CB_CONTENT_PROP_CLINK_SPEC_TYPE: 'INTERNAL' | 'EXTERNAL' | 'DISABLED';
|
|
12
12
|
CB_CONTENT_PROP_CLINK_SPEC_SRC: STRING_PLAIN;
|
|
13
13
|
CB_CONTENT_PROP_CLINK_SPEC_NEWTAB: boolean;
|
|
14
14
|
};
|
|
@@ -15,15 +15,18 @@ exports.getLinearGradientStyles = exports.getBtnColorStyles = exports.parseStyle
|
|
|
15
15
|
function parseStyleColorToCSSProp(_a) {
|
|
16
16
|
var availableSpecCodes = _a.availableSpecCodes, props = _a.props, propKey = _a.propKey, device = _a.device;
|
|
17
17
|
var valueSet = availableSpecCodes.reduce(function (acc, currentKey) {
|
|
18
|
-
var _a, _b;
|
|
18
|
+
var _a, _b, _c;
|
|
19
19
|
var stringifiedKey = currentKey.toString();
|
|
20
20
|
var baseKey = device === 'DESKTOP' ? currentKey : stringifiedKey + ":MOBILE" || currentKey;
|
|
21
21
|
var keyWithHover = baseKey.toString() + ":HOVER";
|
|
22
22
|
var value = props[baseKey];
|
|
23
23
|
var hoverValue = props[keyWithHover];
|
|
24
|
+
if (hoverValue === null || hoverValue === undefined) {
|
|
25
|
+
return { normal: __assign(__assign({}, acc.normal), (_a = {}, _a[currentKey] = value, _a)), hover: __assign({}, acc.hover) };
|
|
26
|
+
}
|
|
24
27
|
return {
|
|
25
|
-
normal: __assign(__assign({}, acc.normal), (
|
|
26
|
-
hover: __assign(__assign({}, acc.hover), (
|
|
28
|
+
normal: __assign(__assign({}, acc.normal), (_b = {}, _b[currentKey] = value, _b)),
|
|
29
|
+
hover: __assign(__assign({}, acc.hover), (_c = {}, _c[currentKey] = hoverValue, _c))
|
|
27
30
|
};
|
|
28
31
|
}, {
|
|
29
32
|
normal: {},
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.js
CHANGED
|
@@ -19,7 +19,9 @@ function replaceUndefinedValues(jsonData) {
|
|
|
19
19
|
var isIncludedPropKey = propKey.some(function (key) { return currentPropKey.includes(key); });
|
|
20
20
|
if (isIncludedPropKey) {
|
|
21
21
|
var specs = Object.keys(currentProps).reduce(function (accSpecs, curSpec) {
|
|
22
|
-
|
|
22
|
+
var isTargetNeedOverride = curSpec.endsWith(':MOBILE') &&
|
|
23
|
+
(currentProps[curSpec] === undefined || currentProps[curSpec] === null);
|
|
24
|
+
if (isTargetNeedOverride) {
|
|
23
25
|
var undefinedMobileKey = curSpec.replace(':MOBILE', '');
|
|
24
26
|
if (undefinedMobileKey in currentProps) {
|
|
25
27
|
accSpecs[curSpec] = currentProps[undefinedMobileKey];
|
|
@@ -36,7 +38,3 @@ function replaceUndefinedValues(jsonData) {
|
|
|
36
38
|
}, jsonData);
|
|
37
39
|
}
|
|
38
40
|
exports.default = replaceUndefinedValues;
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
40
|
-
function hasOwnProperty(obj, prop) {
|
|
41
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
42
|
-
}
|
|
@@ -14,5 +14,5 @@ declare type ParseStyleTextProps<T> = {
|
|
|
14
14
|
propKey: 'BTNTEXT';
|
|
15
15
|
device: Device;
|
|
16
16
|
};
|
|
17
|
-
export declare function getTextCSSPropKey(key: string, cbName: 'TEXT' | 'BTNTEXT'): "" | "color" | "fontFamily" | "letterSpacing" | "lineHeight" | "fontSize" | "fontWeight";
|
|
17
|
+
export declare function getTextCSSPropKey(key: string, cbName: 'TEXT' | 'BTNTEXT'): "" | "color" | "fontFamily" | "letterSpacing" | "lineHeight" | "fontSize" | "fontWeight" | "HORIZONTAL" | "alignItems";
|
|
18
18
|
export {};
|
|
@@ -15,7 +15,7 @@ exports.getTextCSSPropKey = exports.parseStyleTextToCSSProp = void 0;
|
|
|
15
15
|
function parseStyleTextToCSSProp(_a) {
|
|
16
16
|
var availableSpecCodes = _a.availableSpecCodes, props = _a.props, propKey = _a.propKey, device = _a.device;
|
|
17
17
|
return availableSpecCodes.reduce(function (acc, currentKey) {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
19
19
|
var stringifiedKey = currentKey.toString();
|
|
20
20
|
var keyWithDevice = device === 'DESKTOP' ? currentKey : stringifiedKey + ":MOBILE" || currentKey;
|
|
21
21
|
var keyWithHover = keyWithDevice.toString() + ":HOVER";
|
|
@@ -25,34 +25,87 @@ function parseStyleTextToCSSProp(_a) {
|
|
|
25
25
|
if (cssPropertyKey === 'lineHeight') {
|
|
26
26
|
var numValue = typeof value === 'number' ? value / 100 : value;
|
|
27
27
|
var numHoverValue = typeof hoverValue === 'number' ? hoverValue / 100 : hoverValue;
|
|
28
|
+
if (numHoverValue === null || numHoverValue === undefined) {
|
|
29
|
+
return {
|
|
30
|
+
style: __assign(__assign({}, acc.style), (_a = {}, _a[cssPropertyKey] = numValue, _a)),
|
|
31
|
+
hoverStyle: __assign({}, acc.hoverStyle)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
28
34
|
return {
|
|
29
|
-
style: __assign(__assign({}, acc.style), (
|
|
30
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (
|
|
35
|
+
style: __assign(__assign({}, acc.style), (_b = {}, _b[cssPropertyKey] = numValue, _b)),
|
|
36
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_c = {}, _c[cssPropertyKey] = numHoverValue, _c))
|
|
31
37
|
};
|
|
32
38
|
}
|
|
33
39
|
if (cssPropertyKey === 'fontFamily') {
|
|
40
|
+
if (hoverValue === null || hoverValue === undefined) {
|
|
41
|
+
return {
|
|
42
|
+
style: __assign(__assign({}, acc.style), (_d = {}, _d[cssPropertyKey] = getFontName(String(value)), _d)),
|
|
43
|
+
hoverStyle: __assign({}, acc.hoverStyle)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
34
46
|
return {
|
|
35
|
-
style: __assign(__assign({}, acc.style), (
|
|
36
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (
|
|
47
|
+
style: __assign(__assign({}, acc.style), (_e = {}, _e[cssPropertyKey] = getFontName(String(value)), _e)),
|
|
48
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_f = {}, _f[cssPropertyKey] = getFontName(String(hoverValue)), _f))
|
|
37
49
|
};
|
|
38
50
|
}
|
|
39
51
|
if (cssPropertyKey === 'letterSpacing') {
|
|
40
|
-
var numValue =
|
|
41
|
-
var numHoverValue =
|
|
52
|
+
var numValue = Math.abs(+value) * (+value > 0 ? 0.01 : -0.01) + "em";
|
|
53
|
+
var numHoverValue = Math.abs(+hoverValue) * (+hoverValue > 0 ? 0.01 : -0.01) + "em";
|
|
54
|
+
if (numHoverValue === null || numHoverValue === undefined) {
|
|
55
|
+
return {
|
|
56
|
+
style: __assign(__assign({}, acc.style), (_g = {}, _g[cssPropertyKey] = numValue, _g)),
|
|
57
|
+
hoverStyle: __assign({}, acc.hoverStyle)
|
|
58
|
+
};
|
|
59
|
+
}
|
|
42
60
|
return {
|
|
43
|
-
style: __assign(__assign({}, acc.style), (
|
|
44
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (
|
|
61
|
+
style: __assign(__assign({}, acc.style), (_h = {}, _h[cssPropertyKey] = numValue, _h)),
|
|
62
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_j = {}, _j[cssPropertyKey] = numHoverValue, _j))
|
|
45
63
|
};
|
|
46
64
|
}
|
|
47
65
|
if (cssPropertyKey === 'fontSize') {
|
|
66
|
+
if (hoverValue === null || hoverValue === undefined) {
|
|
67
|
+
return {
|
|
68
|
+
style: __assign(__assign({}, acc.style), (_k = {}, _k[cssPropertyKey] = value + "px", _k)),
|
|
69
|
+
hoverStyle: __assign({}, acc.hoverStyle)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
48
72
|
return {
|
|
49
|
-
style: __assign(__assign({}, acc.style), (
|
|
50
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (
|
|
73
|
+
style: __assign(__assign({}, acc.style), (_l = {}, _l[cssPropertyKey] = value + "px", _l)),
|
|
74
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_m = {}, _m[cssPropertyKey] = hoverValue + "px", _m))
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if (cssPropertyKey === 'HORIZONTAL') {
|
|
78
|
+
var horizontalObj = getHorizontalPositionValue(String(value));
|
|
79
|
+
var hoverHorizontalObj = getHorizontalPositionValue(String(hoverValue));
|
|
80
|
+
if (hoverHorizontalObj === null || hoverHorizontalObj === undefined) {
|
|
81
|
+
return { style: __assign(__assign({}, acc.style), horizontalObj), hoverStyle: __assign({}, acc.hoverStyle) };
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
style: __assign(__assign({}, acc.style), horizontalObj),
|
|
85
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), hoverHorizontalObj)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (cssPropertyKey === 'alignItems') {
|
|
89
|
+
if (hoverValue === null || hoverValue === undefined) {
|
|
90
|
+
return {
|
|
91
|
+
style: __assign(__assign({}, acc.style), (_o = {}, _o[cssPropertyKey] = getVerticalPositionValue(String(value)), _o)),
|
|
92
|
+
hoverStyle: __assign({}, acc.hoverStyle)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
style: __assign(__assign({}, acc.style), (_p = {}, _p[cssPropertyKey] = getVerticalPositionValue(String(value)), _p)),
|
|
97
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_q = {}, _q[cssPropertyKey] = getVerticalPositionValue(String(hoverValue)), _q))
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (hoverValue === null || hoverValue === undefined) {
|
|
101
|
+
return {
|
|
102
|
+
style: __assign(__assign({}, acc.style), (_r = {}, _r[cssPropertyKey] = value, _r)),
|
|
103
|
+
hoverStyle: __assign({}, acc.hoverStyle)
|
|
51
104
|
};
|
|
52
105
|
}
|
|
53
106
|
return {
|
|
54
|
-
style: __assign(__assign({}, acc.style), (
|
|
55
|
-
hoverStyle: __assign(__assign({}, acc.hoverStyle), (
|
|
107
|
+
style: __assign(__assign({}, acc.style), (_s = {}, _s[cssPropertyKey] = value, _s)),
|
|
108
|
+
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_t = {}, _t[cssPropertyKey] = hoverValue, _t))
|
|
56
109
|
};
|
|
57
110
|
}, {
|
|
58
111
|
style: {},
|
|
@@ -92,6 +145,16 @@ function getTextCSSPropKey(key, cbName) {
|
|
|
92
145
|
case "CB_STYLE_PROP_" + cbName + "_SPEC_WEIGHT:MOBILE":
|
|
93
146
|
case "CB_STYLE_PROP_" + cbName + "_SPEC_WEIGHT:MOBILE:HOVER":
|
|
94
147
|
return 'fontWeight';
|
|
148
|
+
case "CB_STYLE_PROP_" + cbName + "_SPEC_HORIZONTAL":
|
|
149
|
+
case "CB_STYLE_PROP_" + cbName + "_SPEC_HORIZONTAL:HOVER":
|
|
150
|
+
case "CB_STYLE_PROP_" + cbName + "_SPEC_HORIZONTAL:MOBILE":
|
|
151
|
+
case "CB_STYLE_PROP_" + cbName + "_SPEC_HORIZONTAL:MOBILE:HOVER":
|
|
152
|
+
return 'HORIZONTAL';
|
|
153
|
+
case "CB_STYLE_PROP_" + cbName + "_SPEC_VERTICAL":
|
|
154
|
+
case "CB_STYLE_PROP_" + cbName + "_SPEC_VERTICAL:HOVER":
|
|
155
|
+
case "CB_STYLE_PROP_" + cbName + "_SPEC_VERTICAL:MOBILE":
|
|
156
|
+
case "CB_STYLE_PROP_" + cbName + "_SPEC_VERTICAL:MOBILE:HOVER":
|
|
157
|
+
return 'alignItems';
|
|
95
158
|
default:
|
|
96
159
|
return '';
|
|
97
160
|
}
|
|
@@ -109,3 +172,25 @@ function getFontName(value) {
|
|
|
109
172
|
return '';
|
|
110
173
|
}
|
|
111
174
|
}
|
|
175
|
+
function getHorizontalPositionValue(value) {
|
|
176
|
+
switch (value) {
|
|
177
|
+
case 'LEFT':
|
|
178
|
+
return { justifyContent: 'flex-start', textAlign: 'left' };
|
|
179
|
+
case 'RIGHT':
|
|
180
|
+
return { justifyContent: 'flex-end', textAlign: 'right' };
|
|
181
|
+
case 'CENTER':
|
|
182
|
+
default:
|
|
183
|
+
return { justifyContent: 'center', textAlign: 'center' };
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function getVerticalPositionValue(value) {
|
|
187
|
+
switch (value) {
|
|
188
|
+
case 'TOP':
|
|
189
|
+
return 'flex-start';
|
|
190
|
+
case 'BOTTOM':
|
|
191
|
+
return 'flex-end';
|
|
192
|
+
case 'CENTER':
|
|
193
|
+
default:
|
|
194
|
+
return 'center';
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -14,7 +14,7 @@ export declare type NAMED_CB_LAYOUT_ARRANGE_PROPS = {
|
|
|
14
14
|
};
|
|
15
15
|
export default function parseLayoutPropArrange(namedProps: NAMED_CB_LAYOUT_ARRANGE_PROPS, device: Device): StyleType;
|
|
16
16
|
declare type CB_LAYOUT_PROP_ARRANGE_ENUM_VERTICAL = 'TOP' | 'MIDDLE' | 'BOTTOM';
|
|
17
|
-
declare type CB_LAYOUT_PROP_ARRANGE_ENUM_HORIZONTAL = '
|
|
17
|
+
declare type CB_LAYOUT_PROP_ARRANGE_ENUM_HORIZONTAL = 'START' | 'CENTER' | 'END';
|
|
18
18
|
export declare type CB_LAYOUT_PROP_ARRANGE_SPECS = {
|
|
19
19
|
[CB_LAYOUT_PROP_ARRANGE_BASE_KEYS.CB_LAYOUT_PROP_ARRANGE_SPEC_VERTICAL]: CB_LAYOUT_PROP_ARRANGE_ENUM_VERTICAL;
|
|
20
20
|
[CB_LAYOUT_PROP_ARRANGE_BASE_KEYS.CB_LAYOUT_PROP_ARRANGE_SPEC_HORIZONTAL]: CB_LAYOUT_PROP_ARRANGE_ENUM_HORIZONTAL;
|
|
@@ -58,7 +58,7 @@ function getCssProperties(value) {
|
|
|
58
58
|
flexDirection: 'column',
|
|
59
59
|
justifyContent: 'flex-end'
|
|
60
60
|
};
|
|
61
|
-
case '
|
|
61
|
+
case 'START':
|
|
62
62
|
return {
|
|
63
63
|
display: 'flex',
|
|
64
64
|
flexDirection: 'column',
|
|
@@ -70,7 +70,7 @@ function getCssProperties(value) {
|
|
|
70
70
|
flexDirection: 'column',
|
|
71
71
|
alignItems: 'center'
|
|
72
72
|
};
|
|
73
|
-
case '
|
|
73
|
+
case 'END':
|
|
74
74
|
return {
|
|
75
75
|
display: 'flex',
|
|
76
76
|
flexDirection: 'column',
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Device } from '../types';
|
|
2
|
+
declare type Padding = {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
right: number;
|
|
6
|
+
bottom: number;
|
|
7
|
+
};
|
|
8
|
+
export declare type SectionPadding = {
|
|
9
|
+
CB_LAYOUT_PROP_PADDING_SPEC_PADDING: Padding;
|
|
10
|
+
'CB_LAYOUT_PROP_PADDING_SPEC_PADDING:MOBILE': null | Padding;
|
|
11
|
+
} | undefined | null;
|
|
12
|
+
declare function parseSectionPadding(prop: SectionPadding, device: Device): {
|
|
13
|
+
top?: undefined;
|
|
14
|
+
left?: undefined;
|
|
15
|
+
bottom?: undefined;
|
|
16
|
+
right?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
top: number;
|
|
19
|
+
left: number;
|
|
20
|
+
bottom: number;
|
|
21
|
+
right: number;
|
|
22
|
+
};
|
|
23
|
+
export default parseSectionPadding;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function parseSectionPadding(prop, device) {
|
|
4
|
+
if (!prop) {
|
|
5
|
+
return {};
|
|
6
|
+
}
|
|
7
|
+
if (device === 'MOBILE') {
|
|
8
|
+
var padding_1 = prop['CB_LAYOUT_PROP_PADDING_SPEC_PADDING:MOBILE'];
|
|
9
|
+
if (padding_1) {
|
|
10
|
+
return {
|
|
11
|
+
top: padding_1.top,
|
|
12
|
+
left: padding_1.left,
|
|
13
|
+
bottom: padding_1.bottom,
|
|
14
|
+
right: padding_1.right
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
var padding = prop.CB_LAYOUT_PROP_PADDING_SPEC_PADDING;
|
|
19
|
+
return {
|
|
20
|
+
top: padding.top,
|
|
21
|
+
left: padding.left,
|
|
22
|
+
bottom: padding.bottom,
|
|
23
|
+
right: padding.right
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.default = parseSectionPadding;
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCustomSectionPlacement.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare type Props = {
|
|
2
2
|
isMobile: boolean;
|
|
3
|
-
customSectionProps
|
|
3
|
+
customSectionProps: {
|
|
4
4
|
CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH: boolean;
|
|
5
5
|
'CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE': boolean | undefined;
|
|
6
6
|
CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT: number;
|
|
@@ -12,9 +12,9 @@ declare type Props = {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
export declare function parseCustomSectionPlacement({ isMobile, customSectionProps }: Props): {
|
|
15
|
-
minHeight: number
|
|
16
|
-
width: number
|
|
17
|
-
rows: number
|
|
18
|
-
isFullWidth: boolean
|
|
15
|
+
minHeight: number;
|
|
16
|
+
width: number;
|
|
17
|
+
rows: number;
|
|
18
|
+
isFullWidth: boolean;
|
|
19
19
|
};
|
|
20
20
|
export default parseCustomSectionPlacement;
|
package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseCustomSectionPlacement.js
CHANGED
|
@@ -1,37 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.parseCustomSectionPlacement = void 0;
|
|
7
|
-
var isNullOrUndefined_1 = __importDefault(require("./isNullOrUndefined"));
|
|
8
4
|
function parseCustomSectionPlacement(_a) {
|
|
5
|
+
var _b, _c, _d, _e;
|
|
9
6
|
var isMobile = _a.isMobile, customSectionProps = _a.customSectionProps;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
!(0, isNullOrUndefined_1.default)(customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE'])
|
|
18
|
-
? customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE']
|
|
19
|
-
: customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH,
|
|
20
|
-
rows: isMobile &&
|
|
21
|
-
!(0, isNullOrUndefined_1.default)(customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE'])
|
|
22
|
-
? customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE']
|
|
23
|
-
: customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_ROWS,
|
|
24
|
-
isFullWidth: isMobile &&
|
|
25
|
-
!(0, isNullOrUndefined_1.default)(customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE'])
|
|
26
|
-
? customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE']
|
|
27
|
-
: customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH
|
|
28
|
-
}
|
|
29
|
-
: {
|
|
30
|
-
minHeight: 0,
|
|
31
|
-
width: 0,
|
|
32
|
-
rows: 0,
|
|
33
|
-
isFullWidth: true
|
|
7
|
+
var CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH = customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH, CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT = customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT, CB_PLACEMENT_PROP_SECTION_SPEC_ROWS = customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_ROWS, CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH = customSectionProps.CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH;
|
|
8
|
+
if (isMobile) {
|
|
9
|
+
return {
|
|
10
|
+
minHeight: (_b = customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE']) !== null && _b !== void 0 ? _b : CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT,
|
|
11
|
+
width: (_c = customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE']) !== null && _c !== void 0 ? _c : CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH,
|
|
12
|
+
rows: (_d = customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE']) !== null && _d !== void 0 ? _d : CB_PLACEMENT_PROP_SECTION_SPEC_ROWS,
|
|
13
|
+
isFullWidth: (_e = customSectionProps['CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE']) !== null && _e !== void 0 ? _e : CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH
|
|
34
14
|
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
minHeight: CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT,
|
|
18
|
+
width: CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH,
|
|
19
|
+
rows: CB_PLACEMENT_PROP_SECTION_SPEC_ROWS,
|
|
20
|
+
isFullWidth: CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH
|
|
21
|
+
};
|
|
35
22
|
}
|
|
36
23
|
exports.parseCustomSectionPlacement = parseCustomSectionPlacement;
|
|
37
24
|
exports.default = parseCustomSectionPlacement;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Device,
|
|
1
|
+
import type { Device, JsonPropertiesParserResult } from './types';
|
|
2
2
|
import type { ISectionJsonProperties } from '../../../../DynamicLayout/types';
|
|
3
|
-
export default function parseJsonProperties(properties: ISectionJsonProperties | undefined, device: Device):
|
|
3
|
+
export default function parseJsonProperties(properties: ISectionJsonProperties | undefined, device: Device): JsonPropertiesParserResult;
|
|
@@ -19,14 +19,11 @@ var layoutPropParsers_1 = require("./layoutPropParsers");
|
|
|
19
19
|
var types_3 = require("./layoutPropParsers/types");
|
|
20
20
|
var stylePropParsers_1 = require("./stylePropParsers");
|
|
21
21
|
var types_4 = require("./stylePropParsers/types");
|
|
22
|
-
// export type specTypes = CB_LAYOUT_PROP_KEYS | CB_STYLE_PROP_KEYS;
|
|
23
22
|
function parseJsonProperties(properties, device) {
|
|
24
23
|
if (!properties) {
|
|
25
24
|
return {
|
|
26
25
|
style: {},
|
|
27
26
|
overlayStyle: {},
|
|
28
|
-
overlayHoverStyle: {},
|
|
29
|
-
hoverStyle: {},
|
|
30
27
|
layout: {},
|
|
31
28
|
effect: {},
|
|
32
29
|
content: {}
|
|
@@ -39,9 +36,9 @@ function parseJsonProperties(properties, device) {
|
|
|
39
36
|
specs: specs
|
|
40
37
|
};
|
|
41
38
|
if (normalizedProperty.name in types_4.CB_STYLE_PROP_KEYS) {
|
|
42
|
-
var _a = (0, stylePropParsers_1.parseStyleProperties)(normalizedProperty, device), style = _a.style,
|
|
39
|
+
var _a = (0, stylePropParsers_1.parseStyleProperties)(normalizedProperty, device), style = _a.style, overlayStyle = _a.overlayStyle;
|
|
43
40
|
// console.log(normalizedProperty.name, ' >>>', overlayStyle, overlayHoverStyle);
|
|
44
|
-
return __assign(__assign({}, acc), { style: __assign(__assign({}, acc.style), style),
|
|
41
|
+
return __assign(__assign({}, acc), { style: __assign(__assign({}, acc.style), style), overlayStyle: __assign(__assign({}, acc.overlayStyle), overlayStyle) });
|
|
45
42
|
}
|
|
46
43
|
if (normalizedProperty.name in types_3.CB_LAYOUT_PROP_KEYS) {
|
|
47
44
|
var style = (0, layoutPropParsers_1.parseLayoutProperties)(normalizedProperty, device).style;
|
|
@@ -62,8 +59,6 @@ function parseJsonProperties(properties, device) {
|
|
|
62
59
|
}, {
|
|
63
60
|
style: {},
|
|
64
61
|
overlayStyle: {},
|
|
65
|
-
overlayHoverStyle: {},
|
|
66
|
-
hoverStyle: {},
|
|
67
62
|
layout: {},
|
|
68
63
|
effect: {},
|
|
69
64
|
content: {}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { NamedStylePropType } from './types';
|
|
2
|
-
import type { Device,
|
|
3
|
-
export declare function parseStyleProperties(normalizedProperty: NamedStylePropType, device: Device): StyleAndHoverStyle & Partial<
|
|
2
|
+
import type { Device, OverlayStyle, StyleAndHoverStyle } from '../types';
|
|
3
|
+
export declare function parseStyleProperties(normalizedProperty: NamedStylePropType, device: Device): StyleAndHoverStyle & Partial<OverlayStyle>;
|
|
@@ -35,7 +35,7 @@ function parseStyleProperties(normalizedProperty, device) {
|
|
|
35
35
|
case types_1.CB_STYLE_PROP_KEYS.CB_STYLE_PROP_BGOVERLAY:
|
|
36
36
|
return (0, parseStylePropBgOverlay_1.default)(normalizedProperty, device);
|
|
37
37
|
default:
|
|
38
|
-
return { style: {}, hoverStyle: {}, overlayStyle: {}
|
|
38
|
+
return { style: {}, hoverStyle: {}, overlayStyle: {} };
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
exports.parseStyleProperties = parseStyleProperties;
|