pds-dev-kit-web-test 2.4.44 → 2.4.46
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.
@@ -367,12 +367,13 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
367
367
|
if (device === 'MOBILE') {
|
368
368
|
var cellWidth_1 = width / MOBILE_GRID_COLS;
|
369
369
|
setRowHeight(cellWidth_1 * 0.56);
|
370
|
-
baseFontSize !== 16 && setBaseFontSize(
|
370
|
+
// baseFontSize !== 16 && setBaseFontSize(width * 0.0133);
|
371
|
+
responsiveFontMode ? setBaseFontSize(width * 0.0133) : setBaseFontSize(16);
|
371
372
|
return;
|
372
373
|
}
|
373
374
|
var cellWidth = width / DESKTOP_GRID_COLS;
|
374
375
|
setRowHeight(cellWidth * 0.56);
|
375
|
-
responsiveFontMode ? setBaseFontSize(
|
376
|
+
responsiveFontMode ? setBaseFontSize(width * 0.0133) : setBaseFontSize(cellWidth / 2.35);
|
376
377
|
};
|
377
378
|
var padding = (0, parseSectionPadding_1.default)(CB_LAYOUT_PROP_PADDING, device);
|
378
379
|
var breakpoints = device === 'DESKTOP' ? { lg: 100, sm: 0 } : { lg: 1200, sm: 480 };
|
@@ -29,16 +29,20 @@ var S_CB_Box_1 = require("../components/S_CB_Box");
|
|
29
29
|
var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
30
30
|
var useCLINK_1 = __importDefault(require("../hooks/useCLINK"));
|
31
31
|
function Text(props) {
|
32
|
-
var _a
|
33
|
-
var
|
34
|
-
var _c =
|
32
|
+
var _a;
|
33
|
+
var _b = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _b.device, mode = _b.mode;
|
34
|
+
var index = props.index, _c = props.CB_CONTENT_PROP_CLINK, CB_CONTENT_PROP_CLINK_SPEC_SRC = _c.CB_CONTENT_PROP_CLINK_SPEC_SRC, CB_CONTENT_PROP_CLINK_SPEC_TYPE = _c.CB_CONTENT_PROP_CLINK_SPEC_TYPE, CB_CONTENT_PROP_CLINK_SPEC_NEWTAB = _c.CB_CONTENT_PROP_CLINK_SPEC_NEWTAB, CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC = _c.CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, CB_PLACEMENT_PROP_PLACEMENT = props.CB_PLACEMENT_PROP_PLACEMENT;
|
35
|
+
var cols = device === 'DESKTOP'
|
36
|
+
? CB_PLACEMENT_PROP_PLACEMENT.CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS
|
37
|
+
: CB_PLACEMENT_PROP_PLACEMENT['CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE'];
|
38
|
+
var _d = (0, useCLINK_1.default)({
|
35
39
|
src: CB_CONTENT_PROP_CLINK_SPEC_SRC,
|
36
40
|
type: CB_CONTENT_PROP_CLINK_SPEC_TYPE,
|
37
41
|
openNewTab: CB_CONTENT_PROP_CLINK_SPEC_NEWTAB,
|
38
42
|
internalSrc: String(CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC)
|
39
|
-
}), CLINKCursor =
|
40
|
-
var
|
41
|
-
var
|
43
|
+
}), CLINKCursor = _d.CLINKCursor, onClickCLINK = _d.onClickCLINK;
|
44
|
+
var _e = getTextStyles(props.CB_STYLE_PROP_TEXT, device), 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,7 +60,15 @@ 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
|
-
|
63
|
+
var rect = (_a = cbRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
64
|
+
var baseWidth = getBaseWidth(cols);
|
65
|
+
var fontsize = textStyle.fontSize;
|
66
|
+
console.log(fontsize);
|
67
|
+
// const rate = fontsize / baseWidth;
|
68
|
+
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({ style: {
|
69
|
+
height: 'fit-content',
|
70
|
+
minWidth: '2ch'
|
71
|
+
}, ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (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), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, height: 'fit-content', minWidth: '2ch' }), hoverStyle: __assign(__assign(__assign({}, textHoverStyle), propsHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT })) }))] }));
|
60
72
|
}
|
61
73
|
function getTextStyles(props, device) {
|
62
74
|
var availableSpecCodes = [
|
@@ -71,4 +83,10 @@ function getTextStyles(props, device) {
|
|
71
83
|
];
|
72
84
|
return (0, textUtil_1.parseStyleTextToCSSProp)({ availableSpecCodes: availableSpecCodes, props: props, device: device, propKey: 'TEXT' });
|
73
85
|
}
|
86
|
+
function getBaseWidth(cols) {
|
87
|
+
if (cols === 1) {
|
88
|
+
return 40;
|
89
|
+
}
|
90
|
+
return 40 * cols + 10 * (cols - 1);
|
91
|
+
}
|
74
92
|
exports.default = Text;
|