pds-dev-kit-web-test 2.2.72 → 2.2.74
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/sections/CustomSection/CustomSection.js +6 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +1 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.d.ts +1 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +4 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +1 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +10 -13
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +0 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.d.ts +1 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +5 -8
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +3 -2
- package/package.json +1 -1
|
@@ -76,7 +76,6 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
76
76
|
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, editingSectionId = _a.editingSectionId, mode = _a.mode, shortcutKeyMode = _a.shortcutKeyMode, sectionActionHandler = _a.sectionActionHandler;
|
|
77
77
|
var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
|
|
78
78
|
var _b = jsonProperties.data, CB_PLACEMENT_PROP_SECTION = _b.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _b.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _b.CB_CONTENT_PROP_SECTION;
|
|
79
|
-
var isSectionFontResponsive = !!(CB_CONTENT_PROP_SECTION === null || CB_CONTENT_PROP_SECTION === void 0 ? void 0 : CB_CONTENT_PROP_SECTION.CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE);
|
|
80
79
|
var _c = (0, react_1.useState)(null), selectedCB = _c[0], setSelectedCB = _c[1];
|
|
81
80
|
var gleRef = (0, react_1.useRef)(null);
|
|
82
81
|
var _d = (0, react_1.useState)(50), rowHeight = _d[0], setRowHeight = _d[1];
|
|
@@ -358,15 +357,14 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
358
357
|
if (device === 'MOBILE') {
|
|
359
358
|
var cellWidth_1 = width / MOBILE_GRID_COLS;
|
|
360
359
|
setRowHeight(cellWidth_1 * 0.56);
|
|
361
|
-
|
|
362
|
-
setBaseFontSize(
|
|
360
|
+
var mobileBaseFontSize = Math.min(cellWidth_1 / 2.35, 16);
|
|
361
|
+
setBaseFontSize(mobileBaseFontSize);
|
|
363
362
|
return;
|
|
364
363
|
}
|
|
365
|
-
var
|
|
364
|
+
var isSectionFontResponsive = !!(CB_CONTENT_PROP_SECTION === null || CB_CONTENT_PROP_SECTION === void 0 ? void 0 : CB_CONTENT_PROP_SECTION.CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE);
|
|
366
365
|
var cellWidth = width / DESKTOP_GRID_COLS;
|
|
367
366
|
setRowHeight(cellWidth * 0.56);
|
|
368
|
-
setBaseFontSize(cellWidth /
|
|
369
|
-
// setBaseFontSize(cellWidth / 2.35);
|
|
367
|
+
isSectionFontResponsive ? setBaseFontSize(cellWidth / 2.35) : setBaseFontSize(16);
|
|
370
368
|
};
|
|
371
369
|
var padding = (0, parseSectionPadding_1.default)(CB_LAYOUT_PROP_PADDING, device);
|
|
372
370
|
var breakpoints = device === 'DESKTOP' ? { lg: 100, sm: 0 } : { lg: 1200, sm: 480 };
|
|
@@ -443,7 +441,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
443
441
|
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-box-in-group", onClick: function (e) {
|
|
444
442
|
e.stopPropagation();
|
|
445
443
|
clickOneCBInBulk(matchedCB.id, array);
|
|
446
|
-
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: cbCopy, device: device, index: index
|
|
444
|
+
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: cbCopy, device: device, index: index }) }) }), matchedCB.id));
|
|
447
445
|
}) })) }), each.i));
|
|
448
446
|
}
|
|
449
447
|
if (!matchedCB) {
|
|
@@ -459,7 +457,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
459
457
|
e.stopPropagation();
|
|
460
458
|
e.preventDefault();
|
|
461
459
|
onContextMenuCB(matchedCB.id, e);
|
|
462
|
-
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { index: index, cbProps: matchedCB, device: device
|
|
460
|
+
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { index: index, cbProps: matchedCB, device: device }) }) })) }), each.i));
|
|
463
461
|
}) })) })) })) }) }));
|
|
464
462
|
});
|
|
465
463
|
function keepSimilarOrderToPreventRerender(arr) {
|
|
@@ -5,7 +5,6 @@ type Props = {
|
|
|
5
5
|
cbProps: ComponentBlock;
|
|
6
6
|
device: Device;
|
|
7
7
|
index: number;
|
|
8
|
-
isSectionFontResponsive: boolean;
|
|
9
8
|
};
|
|
10
|
-
export default function ComponentBlockMatcher({ cbProps, device, index
|
|
9
|
+
export default function ComponentBlockMatcher({ cbProps, device, index }: Props): JSX.Element;
|
|
11
10
|
export {};
|
|
@@ -27,14 +27,14 @@ var Text_1 = __importDefault(require("./componentBlocks/Text/Text"));
|
|
|
27
27
|
var Twitter_1 = __importDefault(require("./componentBlocks/Twitter/Twitter"));
|
|
28
28
|
var Youtube_1 = require("./componentBlocks/Youtube");
|
|
29
29
|
function ComponentBlockMatcher(_a) {
|
|
30
|
-
var cbProps = _a.cbProps, device = _a.device, index = _a.index
|
|
30
|
+
var cbProps = _a.cbProps, device = _a.device, index = _a.index;
|
|
31
31
|
var componentBlockCode = cbProps.componentBlockCode, data = cbProps.jsonProperties.data;
|
|
32
32
|
var propsWithValue = device === 'MOBILE' ? (0, newUtils_1.replaceUndefinedValues)(data) : data;
|
|
33
33
|
switch (componentBlockCode) {
|
|
34
34
|
case types_1.CB_ALL_CODES.CB_BTN:
|
|
35
|
-
return (
|
|
35
|
+
return (0, jsx_runtime_1.jsx)(Button_1.default, __assign({}, propsWithValue, { index: index }));
|
|
36
36
|
case types_1.CB_ALL_CODES.CB_TEXT:
|
|
37
|
-
return (
|
|
37
|
+
return (0, jsx_runtime_1.jsx)(Text_1.default, __assign({}, propsWithValue, { index: index }));
|
|
38
38
|
case types_1.CB_ALL_CODES.CB_RICHTEXT:
|
|
39
39
|
return (0, jsx_runtime_1.jsx)(RichText_1.RichText, __assign({}, propsWithValue, { index: index }));
|
|
40
40
|
case types_1.CB_ALL_CODES.CB_DIVIDER:
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CB_BTN_PROPERTIES_TYPE, IndexForIntersection } from '../../../../../../../DynamicLayout/sections/CustomSection/util/types';
|
|
3
|
-
type Props = CB_BTN_PROPERTIES_TYPE & IndexForIntersection
|
|
4
|
-
isSectionResponsiveFont: boolean;
|
|
5
|
-
};
|
|
3
|
+
type Props = CB_BTN_PROPERTIES_TYPE & IndexForIntersection;
|
|
6
4
|
declare function Button(props: Props): JSX.Element;
|
|
7
5
|
export default Button;
|
|
@@ -40,14 +40,14 @@ var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
|
|
40
40
|
var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
|
|
41
41
|
function Button(props) {
|
|
42
42
|
var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
43
|
-
var index = props.index, CB_STYLE_PROP_BTNCOLOR = props.CB_STYLE_PROP_BTNCOLOR, _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM
|
|
43
|
+
var index = props.index, CB_STYLE_PROP_BTNCOLOR = props.CB_STYLE_PROP_BTNCOLOR, _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_STYLE_PROP_SHADOW = props.CB_STYLE_PROP_SHADOW, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
44
44
|
var _c = (0, useCLINK_1.default)({
|
|
45
45
|
src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
|
|
46
46
|
type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
|
|
47
47
|
openNewTab: CB_CONTENT_PROP_CLINK_SPEC_NEWTAB,
|
|
48
48
|
internalSrc: String(CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC)
|
|
49
49
|
}), onClickCLINK = _c.onClickCLINK, CLINKCursor = _c.CLINKCursor;
|
|
50
|
-
var _d = getBTNStyles(props.CB_STYLE_PROP_BTNTEXT, device
|
|
50
|
+
var _d = getBTNStyles(props.CB_STYLE_PROP_BTNTEXT, device), btnTextStyle = _d.style, btnTextHoverStyle = _d.hoverStyle;
|
|
51
51
|
var _e = getBTNColorStyles(CB_STYLE_PROP_BTNCOLOR, device), btnColorStyle = _e.style, btnColorHoverStyle = _e.hoverStyle;
|
|
52
52
|
var _f = (0, util_1.parseProperties)(props, device), propsStyle = _f.style, propsHoverStyle = _f.hoverStyle, _g = _f.layout, paddingLeft = _g.paddingLeft, paddingRight = _g.paddingRight, paddingTop = _g.paddingTop, paddingBottom = _g.paddingBottom, layoutStyle = __rest(_g, ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"]), effect = _f.effect;
|
|
53
53
|
var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
|
|
@@ -74,7 +74,7 @@ function Button(props) {
|
|
|
74
74
|
paddingTop: paddingTop
|
|
75
75
|
} }, { children: (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign(__assign(__assign({}, btnTextStyle), propsStyle), layoutStyle), effectCssProperties), btnColorStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor }), hoverStyle: __assign(__assign(__assign(__assign({}, btnTextHoverStyle), propsHoverStyle), btnColorHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device, onClick: onClickCLINK }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT })) }))] }));
|
|
76
76
|
}
|
|
77
|
-
function getBTNStyles(props, device
|
|
77
|
+
function getBTNStyles(props, device) {
|
|
78
78
|
var availableSpecCodes = [
|
|
79
79
|
'CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE',
|
|
80
80
|
'CB_STYLE_PROP_BTNTEXT_SPEC_WEIGHT',
|
|
@@ -89,8 +89,7 @@ function getBTNStyles(props, device, isResponsive) {
|
|
|
89
89
|
availableSpecCodes: availableSpecCodes,
|
|
90
90
|
props: props,
|
|
91
91
|
device: device,
|
|
92
|
-
propKey: 'BTNTEXT'
|
|
93
|
-
isResponsive: isResponsive
|
|
92
|
+
propKey: 'BTNTEXT'
|
|
94
93
|
});
|
|
95
94
|
}
|
|
96
95
|
function getBTNColorStyles(props, device) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CB_TEXT_PROPERTIES_TYPE, IndexForIntersection } from '../../../../util/types';
|
|
3
|
-
type Props = CB_TEXT_PROPERTIES_TYPE & IndexForIntersection
|
|
4
|
-
isSectionResponsiveFont: boolean;
|
|
5
|
-
};
|
|
3
|
+
type Props = CB_TEXT_PROPERTIES_TYPE & IndexForIntersection;
|
|
6
4
|
declare function Text(props: Props): JSX.Element;
|
|
7
5
|
export default Text;
|
|
@@ -30,19 +30,15 @@ var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
|
|
30
30
|
var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
|
|
31
31
|
function Text(props) {
|
|
32
32
|
var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
33
|
-
var index = props.index, _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM
|
|
34
|
-
var
|
|
33
|
+
var index = props.index, _b = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _b.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _b.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _b.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM;
|
|
34
|
+
var _c = (0, useCLINK_1.default)({
|
|
35
35
|
src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
|
|
36
36
|
type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
|
|
37
37
|
openNewTab: CB_CONTENT_PROP_CLINK_SPEC_NEWTAB,
|
|
38
38
|
internalSrc: String(CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC)
|
|
39
|
-
}), CLINKCursor =
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
: CB_CONTENT_PROP_TEXTOPTION_SPEC_RESPONSIVE_MOBILE;
|
|
43
|
-
var isFontResponsive = isSectionResponsiveFont || isCBFontResponsive;
|
|
44
|
-
var _e = getTextStyles(props.CB_STYLE_PROP_TEXT, device, isFontResponsive), textStyle = _e.style, textHoverStyle = _e.hoverStyle;
|
|
45
|
-
var _f = (0, util_1.parseProperties)(props, device), propsStyle = _f.style, propsHoverStyle = _f.hoverStyle, layoutStyle = _f.layout, effect = _f.effect;
|
|
39
|
+
}), CLINKCursor = _c.CLINKCursor, onClickCLINK = _c.onClickCLINK;
|
|
40
|
+
var _d = getTextStyles(props.CB_STYLE_PROP_TEXT, device), textStyle = _d.style, textHoverStyle = _d.hoverStyle;
|
|
41
|
+
var _e = (0, util_1.parseProperties)(props, device), propsStyle = _e.style, propsHoverStyle = _e.hoverStyle, layoutStyle = _e.layout, effect = _e.effect;
|
|
46
42
|
var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
|
|
47
43
|
var googleFonts = (0, getGoogleFonts_1.getGoogleFontsFromTextCB)(props.CB_STYLE_PROP_TEXT, device === 'MOBILE');
|
|
48
44
|
(0, useGoogleFonts_1.default)({ fonts: googleFonts });
|
|
@@ -60,13 +56,15 @@ function Text(props) {
|
|
|
60
56
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
61
57
|
var hasEffect = !isNoneEffectType;
|
|
62
58
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle, style:
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle, style: {
|
|
60
|
+
display: 'flex'
|
|
61
|
+
}, hoverStyle: __assign(__assign({}, textHoverStyle), propsHoverStyle) }, { children: (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box cb-text-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), effectCssProperties), layoutStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, height: 'fit-content' }), hoverStyle: {
|
|
64
62
|
whiteSpace: 'pre-wrap',
|
|
65
63
|
wordBreak: 'break-word',
|
|
66
64
|
height: 'fit-content'
|
|
67
65
|
}, onClick: onClickCLINK }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT })) }))] }));
|
|
68
66
|
}
|
|
69
|
-
function getTextStyles(props, device
|
|
67
|
+
function getTextStyles(props, device) {
|
|
70
68
|
var availableSpecCodes = [
|
|
71
69
|
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE',
|
|
72
70
|
'CB_STYLE_PROP_TEXT_SPEC_WEIGHT',
|
|
@@ -81,8 +79,7 @@ function getTextStyles(props, device, isResponsive) {
|
|
|
81
79
|
availableSpecCodes: availableSpecCodes,
|
|
82
80
|
props: props,
|
|
83
81
|
device: device,
|
|
84
|
-
propKey: 'TEXT'
|
|
85
|
-
isResponsive: isResponsive
|
|
82
|
+
propKey: 'TEXT'
|
|
86
83
|
});
|
|
87
84
|
}
|
|
88
85
|
exports.default = Text;
|
|
@@ -9,8 +9,6 @@ export type CB_CONTENT_PROP_TEXT = {
|
|
|
9
9
|
};
|
|
10
10
|
export type CB_CONTENT_PROP_TEXTOPTION = {
|
|
11
11
|
CB_CONTENT_PROP_TEXTOPTION_SPEC_FITCONTENT: boolean;
|
|
12
|
-
CB_CONTENT_PROP_TEXTOPTION_SPEC_RESPONSIVE_MOBILE: boolean;
|
|
13
|
-
CB_CONTENT_PROP_TEXTOPTION_SPEC_RESPONSIVE_DESKTOP: boolean;
|
|
14
12
|
};
|
|
15
13
|
export type CB_CONTENT_PROP_CLINK = {
|
|
16
14
|
CB_CONTENT_PROP_CLINK_SPEC_TYPE: 'INTERNAL' | 'EXTERNAL' | 'DISABLED';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Device } from '../util/types';
|
|
2
2
|
import type { CSSProperties } from 'styled-components';
|
|
3
|
-
export declare function parseStyleTextToCSSProp<T>({ availableSpecCodes, props, propKey, device
|
|
3
|
+
export declare function parseStyleTextToCSSProp<T>({ availableSpecCodes, props, propKey, device }: ParseStyleTextProps<T>): {
|
|
4
4
|
style: CSSProperties;
|
|
5
5
|
hoverStyle: CSSProperties;
|
|
6
6
|
};
|
|
@@ -9,13 +9,11 @@ type ParseStyleTextProps<T> = {
|
|
|
9
9
|
props: T;
|
|
10
10
|
propKey: 'TEXT';
|
|
11
11
|
device: Device;
|
|
12
|
-
isResponsive: boolean;
|
|
13
12
|
} | {
|
|
14
13
|
availableSpecCodes: Array<keyof T>;
|
|
15
14
|
props: T;
|
|
16
15
|
propKey: 'BTNTEXT';
|
|
17
16
|
device: Device;
|
|
18
|
-
isResponsive: boolean;
|
|
19
17
|
};
|
|
20
18
|
export declare function getTextCSSPropKey(key: string, cbName: 'TEXT' | 'BTNTEXT'): "" | "color" | "letterSpacing" | "fontWeight" | "fontFamily" | "lineHeight" | "fontSize" | "HORIZONTAL" | "alignItems";
|
|
21
19
|
export {};
|
|
@@ -13,7 +13,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.getTextCSSPropKey = exports.parseStyleTextToCSSProp = void 0;
|
|
15
15
|
function parseStyleTextToCSSProp(_a) {
|
|
16
|
-
var availableSpecCodes = _a.availableSpecCodes, props = _a.props, propKey = _a.propKey, device = _a.device
|
|
16
|
+
var availableSpecCodes = _a.availableSpecCodes, props = _a.props, propKey = _a.propKey, device = _a.device;
|
|
17
17
|
return availableSpecCodes.reduce(function (acc, currentKey) {
|
|
18
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();
|
|
@@ -66,14 +66,14 @@ function parseStyleTextToCSSProp(_a) {
|
|
|
66
66
|
}
|
|
67
67
|
if (cssPropertyKey === 'fontSize') {
|
|
68
68
|
if (hoverValue === null || hoverValue === undefined) {
|
|
69
|
-
var emValue_1 = getFontSize(device, value
|
|
69
|
+
var emValue_1 = getFontSize(device, value);
|
|
70
70
|
return {
|
|
71
71
|
style: __assign(__assign({}, acc.style), (_k = {}, _k[cssPropertyKey] = emValue_1, _k)),
|
|
72
72
|
hoverStyle: __assign({}, acc.hoverStyle)
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
var emValue = getFontSize(device, value
|
|
76
|
-
var hoverEmValue = getFontSize(device, hoverValue
|
|
75
|
+
var emValue = getFontSize(device, value);
|
|
76
|
+
var hoverEmValue = getFontSize(device, hoverValue);
|
|
77
77
|
return {
|
|
78
78
|
style: __assign(__assign({}, acc.style), (_l = {}, _l[cssPropertyKey] = emValue, _l)),
|
|
79
79
|
hoverStyle: __assign(__assign({}, acc.hoverStyle), (_m = {}, _m[cssPropertyKey] = hoverEmValue, _m))
|
|
@@ -204,9 +204,6 @@ function getVerticalPositionValue(value) {
|
|
|
204
204
|
return '';
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
function getFontSize(device, size
|
|
208
|
-
if (!isResponsive) {
|
|
209
|
-
return "".concat(size, "px");
|
|
210
|
-
}
|
|
207
|
+
function getFontSize(device, size) {
|
|
211
208
|
return "".concat((size / 16).toFixed(3), "em");
|
|
212
209
|
}
|
|
@@ -13,12 +13,13 @@ exports.parsePlacement = void 0;
|
|
|
13
13
|
var types_1 = require("../types");
|
|
14
14
|
function parsePlacement(components) {
|
|
15
15
|
return components.reduce(function (acc, cur) {
|
|
16
|
+
var _a;
|
|
16
17
|
var id = cur.id, jsonProperties = cur.jsonProperties, componentBlockCode = cur.componentBlockCode;
|
|
17
18
|
var activeAutoResize = false;
|
|
18
|
-
if (componentBlockCode === types_1.CB_ALL_CODES.CB_TEXT && jsonProperties.data.CB_CONTENT_PROP_TEXTOPTION.CB_CONTENT_PROP_TEXTOPTION_SPEC_FITCONTENT) {
|
|
19
|
+
if (componentBlockCode === types_1.CB_ALL_CODES.CB_TEXT && ((_a = jsonProperties.data.CB_CONTENT_PROP_TEXTOPTION) === null || _a === void 0 ? void 0 : _a.CB_CONTENT_PROP_TEXTOPTION_SPEC_FITCONTENT)) {
|
|
19
20
|
activeAutoResize = true;
|
|
20
21
|
}
|
|
21
|
-
var
|
|
22
|
+
var _b = parsePropPlacement(id, jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, activeAutoResize), mobileLayout = _b.mobileLayout, desktopLayout = _b.desktopLayout;
|
|
22
23
|
return {
|
|
23
24
|
sm: __spreadArray(__spreadArray([], acc.sm, true), [mobileLayout], false),
|
|
24
25
|
lg: __spreadArray(__spreadArray([], acc.lg, true), [desktopLayout], false)
|