pds-dev-kit-web-test 2.2.70 → 2.2.72
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/dynamicLayoutContext.d.ts +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +5 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/ComponentBlockMatcher.d.ts +2 -1
- 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 +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +10 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +22 -12
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_AnimationObserverBox.d.ts +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/components/S_CB_AnimationObserverBox.js +28 -5
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +5 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.d.ts +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +7 -7
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.d.ts +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parsePlacement.js +20 -13
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { DynamicLayoutProps } from './types';
|
|
3
|
-
|
|
3
|
+
type DL_CONTEXT_TYPE = Omit<DynamicLayoutProps, 'sections'>;
|
|
4
|
+
export declare const dynamicLayoutContext: import("react").Context<DL_CONTEXT_TYPE>;
|
|
5
|
+
export {};
|
|
@@ -76,6 +76,7 @@ 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);
|
|
79
80
|
var _c = (0, react_1.useState)(null), selectedCB = _c[0], setSelectedCB = _c[1];
|
|
80
81
|
var gleRef = (0, react_1.useRef)(null);
|
|
81
82
|
var _d = (0, react_1.useState)(50), rowHeight = _d[0], setRowHeight = _d[1];
|
|
@@ -354,9 +355,6 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
354
355
|
});
|
|
355
356
|
};
|
|
356
357
|
var onWidthChange = function (width) {
|
|
357
|
-
var responsiveFontMode =
|
|
358
|
-
// NOTE: local환경에서 CB_CONTENT_PROP_SECTION이 없는 경우가 있음.
|
|
359
|
-
!!(CB_CONTENT_PROP_SECTION === null || CB_CONTENT_PROP_SECTION === void 0 ? void 0 : CB_CONTENT_PROP_SECTION.CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE);
|
|
360
358
|
if (device === 'MOBILE') {
|
|
361
359
|
var cellWidth_1 = width / MOBILE_GRID_COLS;
|
|
362
360
|
setRowHeight(cellWidth_1 * 0.56);
|
|
@@ -364,10 +362,10 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
364
362
|
setBaseFontSize(cellWidth_1 / 2.35);
|
|
365
363
|
return;
|
|
366
364
|
}
|
|
367
|
-
var theValue =
|
|
365
|
+
var theValue = 2.35;
|
|
368
366
|
var cellWidth = width / DESKTOP_GRID_COLS;
|
|
369
367
|
setRowHeight(cellWidth * 0.56);
|
|
370
|
-
|
|
368
|
+
setBaseFontSize(cellWidth / theValue);
|
|
371
369
|
// setBaseFontSize(cellWidth / 2.35);
|
|
372
370
|
};
|
|
373
371
|
var padding = (0, parseSectionPadding_1.default)(CB_LAYOUT_PROP_PADDING, device);
|
|
@@ -445,7 +443,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
445
443
|
return ((0, jsx_runtime_1.jsx)("div", __assign({ className: "cb-box-in-group", onClick: function (e) {
|
|
446
444
|
e.stopPropagation();
|
|
447
445
|
clickOneCBInBulk(matchedCB.id, array);
|
|
448
|
-
} }, { 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));
|
|
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, isSectionFontResponsive: isSectionFontResponsive }) }) }), matchedCB.id));
|
|
449
447
|
}) })) }), each.i));
|
|
450
448
|
}
|
|
451
449
|
if (!matchedCB) {
|
|
@@ -461,7 +459,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
461
459
|
e.stopPropagation();
|
|
462
460
|
e.preventDefault();
|
|
463
461
|
onContextMenuCB(matchedCB.id, e);
|
|
464
|
-
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { cbProps: matchedCB, device: device,
|
|
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, isSectionFontResponsive: isSectionFontResponsive }) }) })) }), each.i));
|
|
465
463
|
}) })) })) })) }) }));
|
|
466
464
|
});
|
|
467
465
|
function keepSimilarOrderToPreventRerender(arr) {
|
|
@@ -5,6 +5,7 @@ type Props = {
|
|
|
5
5
|
cbProps: ComponentBlock;
|
|
6
6
|
device: Device;
|
|
7
7
|
index: number;
|
|
8
|
+
isSectionFontResponsive: boolean;
|
|
8
9
|
};
|
|
9
|
-
export default function ComponentBlockMatcher({ cbProps, device, index }: Props): JSX.Element;
|
|
10
|
+
export default function ComponentBlockMatcher({ cbProps, device, index, isSectionFontResponsive }: Props): JSX.Element;
|
|
10
11
|
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, isSectionFontResponsive = _a.isSectionFontResponsive;
|
|
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 (0, jsx_runtime_1.jsx)(Button_1.default, __assign({}, propsWithValue, { index: index }));
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(Button_1.default, __assign({}, propsWithValue, { index: index, isSectionResponsiveFont: isSectionFontResponsive })));
|
|
36
36
|
case types_1.CB_ALL_CODES.CB_TEXT:
|
|
37
|
-
return (0, jsx_runtime_1.jsx)(Text_1.default, __assign({}, propsWithValue, { index: index }));
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(Text_1.default, __assign({}, propsWithValue, { index: index, isSectionResponsiveFont: isSectionFontResponsive })));
|
|
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,5 +1,7 @@
|
|
|
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
|
|
3
|
+
type Props = CB_BTN_PROPERTIES_TYPE & IndexForIntersection & {
|
|
4
|
+
isSectionResponsiveFont: boolean;
|
|
5
|
+
};
|
|
4
6
|
declare function Button(props: Props): JSX.Element;
|
|
5
7
|
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, isSectionResponsiveFont = props.isSectionResponsiveFont;
|
|
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), btnTextStyle = _d.style, btnTextHoverStyle = _d.hoverStyle;
|
|
50
|
+
var _d = getBTNStyles(props.CB_STYLE_PROP_BTNTEXT, device, isSectionResponsiveFont), 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, isResponsive) {
|
|
78
78
|
var availableSpecCodes = [
|
|
79
79
|
'CB_STYLE_PROP_BTNTEXT_SPEC_TYPEFACE',
|
|
80
80
|
'CB_STYLE_PROP_BTNTEXT_SPEC_WEIGHT',
|
|
@@ -85,7 +85,13 @@ function getBTNStyles(props, device) {
|
|
|
85
85
|
'CB_STYLE_PROP_BTNTEXT_SPEC_HORIZONTAL',
|
|
86
86
|
'CB_STYLE_PROP_BTNTEXT_SPEC_VERTICAL'
|
|
87
87
|
];
|
|
88
|
-
return (0, newUtils_1.parseStyleTextToCSSProp)({
|
|
88
|
+
return (0, newUtils_1.parseStyleTextToCSSProp)({
|
|
89
|
+
availableSpecCodes: availableSpecCodes,
|
|
90
|
+
props: props,
|
|
91
|
+
device: device,
|
|
92
|
+
propKey: 'BTNTEXT',
|
|
93
|
+
isResponsive: isResponsive
|
|
94
|
+
});
|
|
89
95
|
}
|
|
90
96
|
function getBTNColorStyles(props, device) {
|
|
91
97
|
var availableSpecCodes = [
|
|
@@ -1,5 +1,7 @@
|
|
|
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
|
|
3
|
+
type Props = CB_TEXT_PROPERTIES_TYPE & IndexForIntersection & {
|
|
4
|
+
isSectionResponsiveFont: boolean;
|
|
5
|
+
};
|
|
4
6
|
declare function Text(props: Props): JSX.Element;
|
|
5
7
|
export default Text;
|
|
@@ -30,15 +30,19 @@ 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, _c = props.CB_CONTENT_PROP_TEXTOPTION, CB_CONTENT_PROP_TEXTOPTION_SPEC_RESPONSIVE_DESKTOP = _c.CB_CONTENT_PROP_TEXTOPTION_SPEC_RESPONSIVE_DESKTOP, CB_CONTENT_PROP_TEXTOPTION_SPEC_RESPONSIVE_MOBILE = _c.CB_CONTENT_PROP_TEXTOPTION_SPEC_RESPONSIVE_MOBILE, isSectionResponsiveFont = props.isSectionResponsiveFont;
|
|
34
|
+
var _d = (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
|
-
|
|
39
|
+
}), CLINKCursor = _d.CLINKCursor, onClickCLINK = _d.onClickCLINK;
|
|
40
|
+
var isCBFontResponsive = device === 'DESKTOP'
|
|
41
|
+
? CB_CONTENT_PROP_TEXTOPTION_SPEC_RESPONSIVE_DESKTOP
|
|
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;
|
|
42
46
|
var isEditModeAndHidden = propsStyle.visibility === 'hidden' && mode === 'EDIT';
|
|
43
47
|
var googleFonts = (0, getGoogleFonts_1.getGoogleFontsFromTextCB)(props.CB_STYLE_PROP_TEXT, device === 'MOBILE');
|
|
44
48
|
(0, useGoogleFonts_1.default)({ fonts: googleFonts });
|
|
@@ -56,13 +60,13 @@ function Text(props) {
|
|
|
56
60
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
57
61
|
var hasEffect = !isNoneEffectType;
|
|
58
62
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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: __assign({ display: 'flex' }, layoutStyle), 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({}, textStyle), propsStyle), effectCssProperties), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, height: 'fit-content' }), hoverStyle: {
|
|
64
|
+
whiteSpace: 'pre-wrap',
|
|
65
|
+
wordBreak: 'break-word',
|
|
66
|
+
height: 'fit-content'
|
|
67
|
+
}, onClick: onClickCLINK }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT })) }))] }));
|
|
64
68
|
}
|
|
65
|
-
function getTextStyles(props, device) {
|
|
69
|
+
function getTextStyles(props, device, isResponsive) {
|
|
66
70
|
var availableSpecCodes = [
|
|
67
71
|
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE',
|
|
68
72
|
'CB_STYLE_PROP_TEXT_SPEC_WEIGHT',
|
|
@@ -73,6 +77,12 @@ function getTextStyles(props, device) {
|
|
|
73
77
|
'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL',
|
|
74
78
|
'CB_STYLE_PROP_TEXT_SPEC_VERTICAL'
|
|
75
79
|
];
|
|
76
|
-
return (0, textUtil_1.parseStyleTextToCSSProp)({
|
|
80
|
+
return (0, textUtil_1.parseStyleTextToCSSProp)({
|
|
81
|
+
availableSpecCodes: availableSpecCodes,
|
|
82
|
+
props: props,
|
|
83
|
+
device: device,
|
|
84
|
+
propKey: 'TEXT',
|
|
85
|
+
isResponsive: isResponsive
|
|
86
|
+
});
|
|
77
87
|
}
|
|
78
88
|
exports.default = Text;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type Props = {
|
|
3
3
|
effectVisibleStyle: React.CSSProperties;
|
|
4
|
+
hoverStyle?: React.CSSProperties;
|
|
4
5
|
};
|
|
5
6
|
export declare const S_CB_AnimationObserverBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Props, never>;
|
|
6
7
|
export {};
|
|
@@ -14,14 +14,37 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
};
|
|
15
15
|
return __assign.apply(this, arguments);
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
19
39
|
};
|
|
20
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
41
|
exports.S_CB_AnimationObserverBox = void 0;
|
|
22
|
-
var styled_components_1 =
|
|
23
|
-
exports.S_CB_AnimationObserverBox = styled_components_1.default.div(
|
|
42
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
43
|
+
exports.S_CB_AnimationObserverBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n width: 100%;\n\n ", ";\n\n &:hover {\n ", ";\n }\n"], ["\n height: 100%;\n width: 100%;\n\n ", ";\n\n &:hover {\n ", ";\n }\n"])), function (_a) {
|
|
24
44
|
var effectVisibleStyle = _a.effectVisibleStyle;
|
|
25
45
|
return effectVisibleStyle && __assign({}, effectVisibleStyle);
|
|
46
|
+
}, function (_a) {
|
|
47
|
+
var hoverStyle = _a.hoverStyle;
|
|
48
|
+
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), __assign(__assign({}, hoverStyle), { boxShadow: '' }));
|
|
26
49
|
});
|
|
27
|
-
var templateObject_1;
|
|
50
|
+
var templateObject_1, templateObject_2;
|
|
@@ -7,6 +7,11 @@ export type StylesProps = {
|
|
|
7
7
|
export type CB_CONTENT_PROP_TEXT = {
|
|
8
8
|
CB_CONTENT_PROP_TEXT_SPEC_TEXT: STRING_PLAIN;
|
|
9
9
|
};
|
|
10
|
+
export type CB_CONTENT_PROP_TEXTOPTION = {
|
|
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
|
+
};
|
|
10
15
|
export type CB_CONTENT_PROP_CLINK = {
|
|
11
16
|
CB_CONTENT_PROP_CLINK_SPEC_TYPE: 'INTERNAL' | 'EXTERNAL' | 'DISABLED';
|
|
12
17
|
CB_CONTENT_PROP_CLINK_SPEC_SRC: STRING_PLAIN;
|
|
@@ -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 }: ParseStyleTextProps<T>): {
|
|
3
|
+
export declare function parseStyleTextToCSSProp<T>({ availableSpecCodes, props, propKey, device, isResponsive }: ParseStyleTextProps<T>): {
|
|
4
4
|
style: CSSProperties;
|
|
5
5
|
hoverStyle: CSSProperties;
|
|
6
6
|
};
|
|
@@ -9,11 +9,13 @@ type ParseStyleTextProps<T> = {
|
|
|
9
9
|
props: T;
|
|
10
10
|
propKey: 'TEXT';
|
|
11
11
|
device: Device;
|
|
12
|
+
isResponsive: boolean;
|
|
12
13
|
} | {
|
|
13
14
|
availableSpecCodes: Array<keyof T>;
|
|
14
15
|
props: T;
|
|
15
16
|
propKey: 'BTNTEXT';
|
|
16
17
|
device: Device;
|
|
18
|
+
isResponsive: boolean;
|
|
17
19
|
};
|
|
18
20
|
export declare function getTextCSSPropKey(key: string, cbName: 'TEXT' | 'BTNTEXT'): "" | "color" | "letterSpacing" | "fontWeight" | "fontFamily" | "lineHeight" | "fontSize" | "HORIZONTAL" | "alignItems";
|
|
19
21
|
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, isResponsive = _a.isResponsive;
|
|
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 =
|
|
69
|
+
var emValue_1 = getFontSize(device, value, isResponsive);
|
|
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 =
|
|
76
|
-
var hoverEmValue =
|
|
75
|
+
var emValue = getFontSize(device, value, isResponsive);
|
|
76
|
+
var hoverEmValue = getFontSize(device, hoverValue, isResponsive);
|
|
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,9 @@ function getVerticalPositionValue(value) {
|
|
|
204
204
|
return '';
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
if (
|
|
209
|
-
return "".concat(
|
|
207
|
+
function getFontSize(device, size, isResponsive) {
|
|
208
|
+
if (!isResponsive) {
|
|
209
|
+
return "".concat(size, "px");
|
|
210
210
|
}
|
|
211
211
|
return "".concat((size / 16).toFixed(3), "em");
|
|
212
212
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentBlock } from '../types';
|
|
2
2
|
export declare function parsePlacement(components: ComponentBlock[]): {
|
|
3
3
|
sm: {
|
|
4
4
|
i: string;
|
|
@@ -7,6 +7,7 @@ export declare function parsePlacement(components: ComponentBlock[]): {
|
|
|
7
7
|
w: number;
|
|
8
8
|
h: number;
|
|
9
9
|
z: number;
|
|
10
|
+
activeAutoResize: boolean;
|
|
10
11
|
}[];
|
|
11
12
|
lg: {
|
|
12
13
|
i: string;
|
|
@@ -15,6 +16,7 @@ export declare function parsePlacement(components: ComponentBlock[]): {
|
|
|
15
16
|
w: number;
|
|
16
17
|
h: number;
|
|
17
18
|
z: number;
|
|
19
|
+
activeAutoResize: boolean;
|
|
18
20
|
}[];
|
|
19
21
|
};
|
|
20
22
|
export default parsePlacement;
|
|
@@ -10,10 +10,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.parsePlacement = void 0;
|
|
13
|
+
var types_1 = require("../types");
|
|
13
14
|
function parsePlacement(components) {
|
|
14
15
|
return components.reduce(function (acc, cur) {
|
|
15
|
-
var id = cur.id, jsonProperties = cur.jsonProperties;
|
|
16
|
-
var
|
|
16
|
+
var id = cur.id, jsonProperties = cur.jsonProperties, componentBlockCode = cur.componentBlockCode;
|
|
17
|
+
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
|
+
activeAutoResize = true;
|
|
20
|
+
}
|
|
21
|
+
var _a = parsePropPlacement(id, jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, activeAutoResize), mobileLayout = _a.mobileLayout, desktopLayout = _a.desktopLayout;
|
|
17
22
|
return {
|
|
18
23
|
sm: __spreadArray(__spreadArray([], acc.sm, true), [mobileLayout], false),
|
|
19
24
|
lg: __spreadArray(__spreadArray([], acc.lg, true), [desktopLayout], false)
|
|
@@ -21,22 +26,24 @@ function parsePlacement(components) {
|
|
|
21
26
|
}, { sm: [], lg: [] });
|
|
22
27
|
}
|
|
23
28
|
exports.parsePlacement = parsePlacement;
|
|
24
|
-
function parsePropPlacement(
|
|
29
|
+
function parsePropPlacement(id, placementProps, activeAutoResize) {
|
|
25
30
|
var desktopLayout = {
|
|
26
31
|
i: id.toString(),
|
|
27
|
-
x:
|
|
28
|
-
y:
|
|
29
|
-
w:
|
|
30
|
-
h:
|
|
31
|
-
z:
|
|
32
|
+
x: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX,
|
|
33
|
+
y: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY,
|
|
34
|
+
w: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS,
|
|
35
|
+
h: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS,
|
|
36
|
+
z: placementProps.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX + 500,
|
|
37
|
+
activeAutoResize: activeAutoResize
|
|
32
38
|
};
|
|
33
39
|
var mobileLayout = {
|
|
34
40
|
i: id.toString(),
|
|
35
|
-
x:
|
|
36
|
-
y:
|
|
37
|
-
w:
|
|
38
|
-
h:
|
|
39
|
-
z:
|
|
41
|
+
x: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX:MOBILE'],
|
|
42
|
+
y: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE'],
|
|
43
|
+
w: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE'],
|
|
44
|
+
h: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'],
|
|
45
|
+
z: placementProps['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX:MOBILE'] + 500,
|
|
46
|
+
activeAutoResize: activeAutoResize
|
|
40
47
|
};
|
|
41
48
|
return {
|
|
42
49
|
mobileLayout: mobileLayout,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CB_BTNTEXT_STYLE_PROPS, CB_STYLE_PROP_BTNCOLOR_SPECS } from '../components/ComponentBlock/componentBlocks/Button/btnTypes';
|
|
2
2
|
import type { CB_STYLE_PROP_TEXT_SPECS } from '../components/ComponentBlock/componentBlocks/Text/types';
|
|
3
3
|
import type { CB_TWITTER_STYLE_PROPS } from '../components/ComponentBlock/componentBlocks/Twitter/types';
|
|
4
|
-
import type { CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CODEBLOCK, CB_CONTENT_PROP_IMAGE, CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TWITTER } from '../components/ComponentBlock/componentBlocks/types';
|
|
4
|
+
import type { CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CODEBLOCK, CB_CONTENT_PROP_IMAGE, CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TEXTOPTION, CB_CONTENT_PROP_TWITTER } from '../components/ComponentBlock/componentBlocks/types';
|
|
5
5
|
import type { CB_CONTENT_PROP_YOUTUBE_TYPE, CB_STYLE_PROP_BGCOLOR_SPECS } from '../components/ComponentBlock/componentBlocks/Youtube/types';
|
|
6
6
|
import type { CB_CONTENT_PROP_VISIBILITY_SPECS } from './contentPropParsers/parseContentVisibility';
|
|
7
7
|
import type { CB_EFFECT_PROP_ENTANIM_SPECS } from './effectPropParsers/parseEffectPropEntAnim';
|
|
@@ -41,6 +41,7 @@ export type CB_TEXT_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
|
41
41
|
CB_CONTENT_PROP_TEXT: CB_CONTENT_PROP_TEXT;
|
|
42
42
|
CB_CONTENT_PROP_CLINK: CB_CONTENT_PROP_CLINK;
|
|
43
43
|
CB_CONTENT_PROP_VISIBILITY: CB_CONTENT_PROP_VISIBILITY_SPECS;
|
|
44
|
+
CB_CONTENT_PROP_TEXTOPTION: CB_CONTENT_PROP_TEXTOPTION;
|
|
44
45
|
CB_STYLE_PROP_TEXT: CB_STYLE_PROP_TEXT_SPECS;
|
|
45
46
|
CB_STYLE_PROP_OPACITY: CB_STYLE_PROP_TEXT_OPACITY_SPECS;
|
|
46
47
|
CB_LAYOUT_PROP_PADDING: CB_LAYOUT_PROP_PADDING_SPECS;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pds-dev-kit-web-test",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.72",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"i18next-intervalplural-postprocessor": "^3.0.0",
|
|
23
23
|
"lottie-react": "^2.3.1",
|
|
24
24
|
"nuka-carousel": "^4.8.4",
|
|
25
|
-
"publ-echo": "^0.0.
|
|
25
|
+
"publ-echo": "^0.0.78",
|
|
26
26
|
"react-hook-form": "^7.28.1",
|
|
27
27
|
"react-i18next": "^11.12.0",
|
|
28
28
|
"react-router-dom": "^5.2.0",
|