pds-dev-kit-web-test 2.5.333 → 2.5.336
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.
@@ -51,6 +51,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
51
51
|
};
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
53
53
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
54
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
54
55
|
var publ_echo_1 = require("publ-echo");
|
55
56
|
var group_1 = require("publ-echo/dist/lib/GridLayoutEditor/group");
|
56
57
|
var renderHelpers_1 = require("publ-echo/dist/lib/GridLayoutEditor/utils/renderHelpers");
|
@@ -770,18 +771,19 @@ var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas
|
|
770
771
|
// const responsiveFontMode =
|
771
772
|
// // NOTE: local환경에서 CB_CONTENT_PROP_COMPOSITION이 없는 경우가 있음.
|
772
773
|
// !!CB_CONTENT_PROP_COMPOSITION?.CB_CONTENT_PROP_COMPOSITION_SPEC_VARIABLEROOTFONTSIZE;
|
774
|
+
var responsiveFontMode = true;
|
773
775
|
if (device === 'MOBILE') {
|
774
776
|
// const cellWidth = width / rows;
|
775
777
|
var cellWidth_1 = 50;
|
776
778
|
setRowHeight(cellWidth_1 * 0.56);
|
777
|
-
|
778
|
-
|
779
|
+
baseFontSize !== 16 && setBaseFontSize(width * 0.0133);
|
780
|
+
responsiveFontMode ? setBaseFontSize(width * 0.0421) : setBaseFontSize(16);
|
779
781
|
return;
|
780
782
|
}
|
781
783
|
// const cellWidth = width / cols;
|
782
784
|
var cellWidth = 50;
|
783
785
|
setRowHeight(cellWidth * 0.56);
|
784
|
-
|
786
|
+
responsiveFontMode ? setBaseFontSize(width * 0.0133) : setBaseFontSize(16);
|
785
787
|
};
|
786
788
|
var padding = (0, parseSectionPadding_1.default)(CB_LAYOUT_PROP_PADDING, device);
|
787
789
|
var breakpoints = device === 'DESKTOP' ? { lg: 100, sm: 0 } : { lg: 1200, sm: 480 };
|
@@ -56,25 +56,21 @@ var parseCompositionPlacement_1 = __importDefault(require("../sections/CustomSec
|
|
56
56
|
var CompositionBackground_1 = __importDefault(require("./CompositionBackground"));
|
57
57
|
var FlexGridItem_1 = __importDefault(require("./FlexGridItem"));
|
58
58
|
var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
59
|
-
var _a, _b, _c, _d, _e
|
60
|
-
var
|
61
|
-
// NOTE: 이것을 사용해야함
|
62
|
-
contextDevice = _h.device, editingSectionId = _h.editingSectionId, mode = _h.mode, shortcutKeyMode = _h.shortcutKeyMode, sectionActionHandler = _h.sectionActionHandler, queryData = _h.queryData;
|
59
|
+
var _a, _b, _c, _d, _e;
|
60
|
+
var _f = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _f.device, editingSectionId = _f.editingSectionId, mode = _f.mode, shortcutKeyMode = _f.shortcutKeyMode, sectionActionHandler = _f.sectionActionHandler, queryData = _f.queryData;
|
63
61
|
var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
|
64
|
-
// NOTE: 임시. 테스트용.
|
65
|
-
var device = (_b = (_a = props.device) !== null && _a !== void 0 ? _a : contextDevice) !== null && _b !== void 0 ? _b : 'DESKTOP';
|
66
62
|
var isMobile = device === 'MOBILE';
|
67
63
|
var isEditMode = mode === 'EDIT';
|
68
|
-
var
|
69
|
-
var colsDesktop = (
|
70
|
-
var colsMobile = (
|
71
|
-
var rowsDesktop = (
|
72
|
-
var rowsMobile = (
|
64
|
+
var _g = jsonProperties, _h = _g.data, CB_PLACEMENT_PROP_COMPOSITION = _h.CB_PLACEMENT_PROP_COMPOSITION, CB_LAYOUT_PROP_PADDING = _h.CB_LAYOUT_PROP_PADDING, zOrders = _g.zOrders;
|
65
|
+
var colsDesktop = (_a = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLUMNS) !== null && _a !== void 0 ? _a : 24;
|
66
|
+
var colsMobile = (_b = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLUMNS:MOBILE']) !== null && _b !== void 0 ? _b : 8;
|
67
|
+
var rowsDesktop = (_c = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS) !== null && _c !== void 0 ? _c : 26;
|
68
|
+
var rowsMobile = (_d = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS:MOBILE']) !== null && _d !== void 0 ? _d : 26;
|
73
69
|
var rows = isMobile ? rowsMobile : rowsDesktop;
|
74
70
|
var cols = isMobile ? colsMobile : colsDesktop;
|
75
71
|
var containerRef = (0, react_1.useRef)(null);
|
76
72
|
var size = (0, useResizableObserver_1.useResizeObserver)({ ref: containerRef, box: 'border-box' });
|
77
|
-
var
|
73
|
+
var _j = (0, react_1.useState)(null), selectedCB = _j[0], setSelectedCB = _j[1];
|
78
74
|
var gleRef = (0, react_1.useRef)(null);
|
79
75
|
(0, react_1.useEffect)(function () {
|
80
76
|
if (editingSectionId !== props.id) {
|
@@ -123,10 +119,10 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
123
119
|
setSelectedCB('BULK');
|
124
120
|
}
|
125
121
|
}, [selectedCB, shortcutKeyMode, sectionActionHandler, setSelectedCB]);
|
126
|
-
var
|
122
|
+
var _k = (0, parseCompositionPlacement_1.default)({
|
127
123
|
isMobile: isMobile,
|
128
124
|
compositionProps: CB_PLACEMENT_PROP_COMPOSITION
|
129
|
-
}), minHeight =
|
125
|
+
}), minHeight = _k.minHeight, maxHeight = _k.maxHeight, maxWidth = _k.maxWidth, minWidth = _k.minWidth;
|
130
126
|
var canvasWidth = 50 * cols;
|
131
127
|
var customSectionStyles = {
|
132
128
|
minHeight: "".concat(minHeight, "px"),
|
@@ -168,18 +164,19 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
168
164
|
// const responsiveFontMode =
|
169
165
|
// !!props.jsonProperties?.CB_CONTENT_PROP_COMPOSITION
|
170
166
|
// ?.CB_CONTENT_PROP_COMPOSITION_SPEC_VARIABLEROOTFONTSIZE;
|
167
|
+
var responsiveFontMode = true;
|
171
168
|
if (device === 'MOBILE') {
|
172
|
-
|
173
|
-
|
174
|
-
|
169
|
+
if (responsiveFontMode) {
|
170
|
+
return size.width * 0.0421;
|
171
|
+
}
|
175
172
|
if (size.width < 327) {
|
176
173
|
return Math.max(getDefensiveFontSize(device, size.width), 14);
|
177
174
|
}
|
178
175
|
return 16;
|
179
176
|
}
|
180
|
-
|
181
|
-
|
182
|
-
|
177
|
+
if (responsiveFontMode) {
|
178
|
+
return size.width * 0.0133;
|
179
|
+
}
|
183
180
|
if (size.width < 1200) {
|
184
181
|
return Math.max(getDefensiveFontSize(device, size.width), 14);
|
185
182
|
}
|
@@ -201,7 +198,7 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
201
198
|
maxWidth: customSectionStyles.maxWidth,
|
202
199
|
// minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
|
203
200
|
fontSize: "".concat(baseFontSize, "px")
|
204
|
-
} }, { children: (
|
201
|
+
} }, { children: (_e = props.componentBlocks) === null || _e === void 0 ? void 0 : _e.map(function (cb, index) {
|
205
202
|
var _a;
|
206
203
|
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: index, device: device, rowHeight: rowHeight, zIndex: (_a = zOrders === null || zOrders === void 0 ? void 0 : zOrders[device === 'DESKTOP' ? 'desktop' : 'mobile'][cb.id]) !== null && _a !== void 0 ? _a : 0 }) }, cb.id));
|
207
204
|
}) })) })) })) })) }));
|