pds-dev-kit-web-test 2.7.118 → 2.7.120
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/CompositionRenderer/Composition.js +2 -2
- package/dist/src/sub/DynamicLayout/CompositionRenderer/FlexGridItem.d.ts +4 -2
- package/dist/src/sub/DynamicLayout/CompositionRenderer/FlexGridItem.js +7 -5
- package/dist/src/sub/DynamicLayout/CompositionRenderer/FlexGridItemForCCB.d.ts +14 -0
- package/dist/src/sub/DynamicLayout/CompositionRenderer/FlexGridItemForCCB.js +68 -0
- package/dist/src/sub/DynamicLayout/GridAutoRowEditor/GridAutoRowEditor.js +63 -28
- package/dist/src/sub/DynamicLayout/mock_componentBlocks.d.ts +135 -0
- package/dist/src/sub/DynamicLayout/mock_componentBlocks.js +3 -1
- package/dist/src/sub/DynamicLayout/mocks.js +0 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/FlexGridItem.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/FlexGridItem.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/ContentsCarousel.js +3 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsCarousel/hooks/useFlexGridLayout.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/ContentsList.js +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/ContentsList/hooks/useFlexGridLayout.js +3 -3
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/SlideBanner/components/CustomPagination.js +14 -16
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +14 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/sections/FlexGridCustomSection.js +29 -11
- package/dist/src/sub/DynamicLayout/utils/groupUtils.d.ts +24 -0
- package/dist/src/sub/DynamicLayout/utils/groupUtils.js +224 -0
- package/package.json +1 -1
- /package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/{ComponentBlockMatcher.d.ts → ComponentBlockMatcherWithCCB.d.ts} +0 -0
- /package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/{ComponentBlockMatcher.js → ComponentBlockMatcherWithCCB.js} +0 -0
|
@@ -57,7 +57,7 @@ var parseStylePropBorder_1 = __importDefault(require("../sections/CustomSection/
|
|
|
57
57
|
var parseStylePropShadow_1 = __importDefault(require("../sections/CustomSection/util/stylePropParsers/parseStylePropShadow"));
|
|
58
58
|
var types_1 = require("../sections/CustomSection/util/stylePropParsers/types");
|
|
59
59
|
var CompositionBackground_1 = __importDefault(require("./CompositionBackground"));
|
|
60
|
-
var
|
|
60
|
+
var FlexGridItemForCCB_1 = __importDefault(require("./FlexGridItemForCCB"));
|
|
61
61
|
var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
62
62
|
var _a, _b, _c, _d, _e;
|
|
63
63
|
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;
|
|
@@ -213,7 +213,7 @@ var Composition = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
213
213
|
// fontSize: `${baseFontSize}px`
|
|
214
214
|
} }, { children: (_e = props.componentBlocks) === null || _e === void 0 ? void 0 : _e.map(function (cb, index) {
|
|
215
215
|
var _a;
|
|
216
|
-
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(
|
|
216
|
+
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItemForCCB_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));
|
|
217
217
|
}) })) })) })) })) })) }));
|
|
218
218
|
});
|
|
219
219
|
var MOCK_BORDER = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ComponentBlock } from '../sections/CustomSection/types';
|
|
3
|
-
import type { Device } from '../sections/CustomSection/util/types';
|
|
3
|
+
import type { CB_PLACEMENT_PROP_SPECS, Device } from '../sections/CustomSection/util/types';
|
|
4
4
|
type Props = {
|
|
5
5
|
cb: ComponentBlock;
|
|
6
6
|
index: number;
|
|
@@ -9,6 +9,8 @@ type Props = {
|
|
|
9
9
|
zIndex: number;
|
|
10
10
|
showPinned?: boolean;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
|
+
isParentGroupPinned: boolean;
|
|
12
13
|
};
|
|
13
|
-
declare function FlexGridItem({ cb, index, device, rowHeight, zIndex, showPinned, style }: Props): JSX.Element;
|
|
14
|
+
declare function FlexGridItem({ cb, index, device, rowHeight, zIndex, showPinned, style, isParentGroupPinned }: Props): JSX.Element;
|
|
15
|
+
export declare function getGridAreaFromCB(props: CB_PLACEMENT_PROP_SPECS, device: Device): string;
|
|
14
16
|
export default FlexGridItem;
|
|
@@ -18,19 +18,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.getGridAreaFromCB = void 0;
|
|
21
22
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
23
|
var react_1 = require("react");
|
|
23
24
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
var
|
|
25
|
-
require("./ComponentBlockMatcher");
|
|
25
|
+
var ComponentBlockMatcherWithCCB_1 = __importDefault(require("../sections/CustomSection/components/ComponentBlock/ComponentBlockMatcherWithCCB"));
|
|
26
26
|
var gap = 10;
|
|
27
27
|
function FlexGridItem(_a) {
|
|
28
|
-
var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight, zIndex = _a.zIndex, showPinned = _a.showPinned, style = _a.style;
|
|
28
|
+
var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight, zIndex = _a.zIndex, showPinned = _a.showPinned, style = _a.style, isParentGroupPinned = _a.isParentGroupPinned;
|
|
29
29
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
30
|
var defaultHeight = getMaxHeight(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device, rowHeight);
|
|
31
31
|
var gridArea = getGridAreaFromCB(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device);
|
|
32
|
-
var _b = (0, react_1.useState)(false),
|
|
33
|
-
|
|
32
|
+
var _b = (0, react_1.useState)(false), isCBPinned = _b[0], setIsCBPinned = _b[1];
|
|
33
|
+
var isPinned = isParentGroupPinned || isCBPinned;
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(GridItem, __assign({ style: __assign({ zIndex: zIndex, gridArea: gridArea, position: 'relative', maxHeight: isPinned ? defaultHeight : 'none' }, style) }, { children: [showPinned && ((0, jsx_runtime_1.jsx)(S_Pinned, { children: isCBPinned ? ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", disabled: isParentGroupPinned, onClick: function () { return setIsCBPinned(false); } }, { children: "H\uACE0\uC815\uB428 \uD83D\uDCCC" }))) : ((0, jsx_runtime_1.jsx)("button", __assign({ disabled: isParentGroupPinned, type: "button", onClick: function () { return setIsCBPinned(true); } }, { children: "H\uB298\uC5B4\uB0A8 \uD83E\uDEB1" }))) })), (0, jsx_runtime_1.jsx)(ComponentBlockMatcherWithCCB_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index })] })));
|
|
34
35
|
}
|
|
35
36
|
var S_Pinned = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"], ["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"])));
|
|
36
37
|
var GridItem = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: auto;\n word-break: break-word;\n"], ["\n height: auto;\n word-break: break-word;\n"])));
|
|
@@ -65,5 +66,6 @@ function getGridAreaFromCB(props, device) {
|
|
|
65
66
|
var colEnd = colsMobile + colStart;
|
|
66
67
|
return "".concat(rowStart, " / ").concat(colStart, " / ").concat(rowEnd, " / ").concat(colEnd);
|
|
67
68
|
}
|
|
69
|
+
exports.getGridAreaFromCB = getGridAreaFromCB;
|
|
68
70
|
exports.default = FlexGridItem;
|
|
69
71
|
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ComponentBlock } from '../sections/CustomSection/types';
|
|
3
|
+
import type { Device } from '../sections/CustomSection/util/types';
|
|
4
|
+
type Props = {
|
|
5
|
+
cb: ComponentBlock;
|
|
6
|
+
index: number;
|
|
7
|
+
device: Device;
|
|
8
|
+
rowHeight: number;
|
|
9
|
+
zIndex: number;
|
|
10
|
+
showPinned?: boolean;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
declare function FlexGridItem({ cb, index, device, rowHeight, zIndex, showPinned, style }: Props): JSX.Element;
|
|
14
|
+
export default FlexGridItem;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
|
+
var react_1 = require("react");
|
|
23
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
+
var ComponentBlockMatcher_1 = __importDefault(require("./ComponentBlockMatcher"));
|
|
25
|
+
var gap = 10;
|
|
26
|
+
function FlexGridItem(_a) {
|
|
27
|
+
var cb = _a.cb, index = _a.index, device = _a.device, rowHeight = _a.rowHeight, zIndex = _a.zIndex, showPinned = _a.showPinned, style = _a.style;
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
+
var defaultHeight = getMaxHeight(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device, rowHeight);
|
|
30
|
+
var gridArea = getGridAreaFromCB(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device);
|
|
31
|
+
var _b = (0, react_1.useState)(false), isPinned = _b[0], setIsPinned = _b[1];
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(GridItem, __assign({ style: __assign({ zIndex: zIndex, gridArea: gridArea, position: 'relative', maxHeight: isPinned ? defaultHeight : 'none' }, style) }, { children: [showPinned && ((0, jsx_runtime_1.jsx)(S_Pinned, { children: isPinned ? ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: function () { return setIsPinned(false); } }, { children: "H\uACE0\uC815\uB428 \uD83D\uDCCC" }))) : ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: function () { return setIsPinned(true); } }, { children: "H\uB298\uC5B4\uB0A8 \uD83E\uDEB1" }))) })), (0, jsx_runtime_1.jsx)(ComponentBlockMatcher_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index })] })));
|
|
33
|
+
}
|
|
34
|
+
var S_Pinned = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"], ["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"])));
|
|
35
|
+
var GridItem = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: auto;\n word-break: break-word;\n"], ["\n height: auto;\n word-break: break-word;\n"])));
|
|
36
|
+
function getMaxHeight(props, device, rowHeight) {
|
|
37
|
+
if (device === 'DESKTOP') {
|
|
38
|
+
var CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS;
|
|
39
|
+
var height_1 = CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS * rowHeight +
|
|
40
|
+
(CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS - 1) * gap;
|
|
41
|
+
return height_1;
|
|
42
|
+
}
|
|
43
|
+
var rowsMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'];
|
|
44
|
+
var height = rowsMobile * rowHeight + (rowsMobile - 1) * gap;
|
|
45
|
+
return height;
|
|
46
|
+
}
|
|
47
|
+
function getGridAreaFromCB(props, device) {
|
|
48
|
+
var CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX, CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY, cols = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS, rows = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS;
|
|
49
|
+
if (device === 'DESKTOP') {
|
|
50
|
+
var colStart_1 = CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX + 1;
|
|
51
|
+
var rowStart_1 = CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY + 1;
|
|
52
|
+
var rowEnd_1 = rows + rowStart_1;
|
|
53
|
+
var colEnd_1 = cols + colStart_1;
|
|
54
|
+
// <grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end>;
|
|
55
|
+
return "".concat(rowStart_1, " / ").concat(colStart_1, " / ").concat(rowEnd_1, " / ").concat(colEnd_1);
|
|
56
|
+
}
|
|
57
|
+
var startXMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX:MOBILE'];
|
|
58
|
+
var startYMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE'];
|
|
59
|
+
var colsMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE'];
|
|
60
|
+
var rowsMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'];
|
|
61
|
+
var colStart = startXMobile + 1;
|
|
62
|
+
var rowStart = startYMobile + 1;
|
|
63
|
+
var rowEnd = rowsMobile + rowStart;
|
|
64
|
+
var colEnd = colsMobile + colStart;
|
|
65
|
+
return "".concat(rowStart, " / ").concat(colStart, " / ").concat(rowEnd, " / ").concat(colEnd);
|
|
66
|
+
}
|
|
67
|
+
exports.default = FlexGridItem;
|
|
68
|
+
var templateObject_1, templateObject_2;
|
|
@@ -55,7 +55,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
55
55
|
var group_1 = require("publ-echo-test/dist/lib/GridLayoutEditor/group");
|
|
56
56
|
var renderHelpers_1 = require("publ-echo-test/dist/lib/GridLayoutEditor/utils/renderHelpers");
|
|
57
57
|
require("publ-echo/dist/lib/GridItem/OutsideClickHandler");
|
|
58
|
-
var group_2 = require("publ-echo/dist/lib/GridLayoutEditor/group");
|
|
59
58
|
var react_1 = __importStar(require("react"));
|
|
60
59
|
var ErrorBoundary_1 = require("../../DynamicLayout/components/Section/ErrorBoundary");
|
|
61
60
|
var dynamicLayoutContext_1 = require("../../DynamicLayout/dynamicLayoutContext");
|
|
@@ -66,6 +65,7 @@ var gleStyles_1 = require("../gleStyles");
|
|
|
66
65
|
var useResizableObserver_1 = require("../sections/CustomSection/hooks/useResizableObserver");
|
|
67
66
|
var util_1 = require("../sections/CustomSection/util");
|
|
68
67
|
var parseSectionPadding_1 = __importDefault(require("../sections/CustomSection/util/layoutPropParsers/parseSectionPadding"));
|
|
68
|
+
var groupUtils_1 = __importDefault(require("../utils/groupUtils"));
|
|
69
69
|
var GRID_CELL_MIN = 24;
|
|
70
70
|
var DESKTOP_GRID_COLS = 24;
|
|
71
71
|
var MOBILE_GRID_COLS = 8;
|
|
@@ -77,16 +77,15 @@ var GLE_MIN_WIDTH_MOBILE_PX = "".concat(GRID_CELL_MIN * MOBILE_GRID_COLS, "px");
|
|
|
77
77
|
// queryData: QueryData;
|
|
78
78
|
// };
|
|
79
79
|
var GridAutoRowEditor = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
80
|
-
var _a,
|
|
81
|
-
var _c = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _c.device, editingSectionId = _c.editingSectionId, mode = _c.mode, shortcutKeyMode = _c.shortcutKeyMode, sectionActionHandler = _c.sectionActionHandler, queryData = _c.queryData;
|
|
80
|
+
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, editingSectionId = _a.editingSectionId, mode = _a.mode, shortcutKeyMode = _a.shortcutKeyMode, sectionActionHandler = _a.sectionActionHandler, queryData = _a.queryData;
|
|
82
81
|
var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
|
|
83
|
-
var
|
|
82
|
+
var _b = jsonProperties, _c = _b.data, CB_PLACEMENT_PROP_SECTION = _c.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _c.CB_LAYOUT_PROP_PADDING, zOrders = _b.zOrders;
|
|
84
83
|
var layouts = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders);
|
|
85
84
|
var containerRef = (0, react_1.useRef)(null);
|
|
86
85
|
var size = (0, useResizableObserver_1.useResizeObserver)({ ref: containerRef, box: 'border-box' });
|
|
87
|
-
var
|
|
86
|
+
var _d = (0, react_1.useState)(null), selectedCB = _d[0], setSelectedCB = _d[1];
|
|
88
87
|
var gleRef = (0, react_1.useRef)(null);
|
|
89
|
-
var
|
|
88
|
+
var _e = (0, react_1.useState)([]), selectedRows = _e[0], setSelectedRows = _e[1]; // 빈 배열로 초기화
|
|
90
89
|
var isMobile = device === 'MOBILE';
|
|
91
90
|
var isEditMode = mode === 'EDIT';
|
|
92
91
|
// const layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
|
|
@@ -144,10 +143,10 @@ var GridAutoRowEditor = (0, react_1.forwardRef)(function CustomSection(props, re
|
|
|
144
143
|
setSelectedCB('BULK');
|
|
145
144
|
}
|
|
146
145
|
}, [selectedCB, shortcutKeyMode, sectionActionHandler, setSelectedCB]);
|
|
147
|
-
var
|
|
146
|
+
var _f = (0, util_1.parseCustomSectionPlacement)({
|
|
148
147
|
isMobile: isMobile,
|
|
149
148
|
customSectionProps: CB_PLACEMENT_PROP_SECTION
|
|
150
|
-
}), width =
|
|
149
|
+
}), width = _f.width, minHeight = _f.minHeight, isFullWidth = _f.isFullWidth;
|
|
151
150
|
var customSectionStyles = {
|
|
152
151
|
minHeight: "".concat(minHeight, "vh"),
|
|
153
152
|
width: '100%',
|
|
@@ -206,13 +205,25 @@ var GridAutoRowEditor = (0, react_1.forwardRef)(function CustomSection(props, re
|
|
|
206
205
|
return 16;
|
|
207
206
|
})();
|
|
208
207
|
var pedigree = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
208
|
+
// const [editingGroupBlock, setEditingGroupBlock] = useState<string>('ROOT');
|
|
209
|
+
// const editableCBIds = findDirectChildrenCbIds(pedigree, 'ROOT');
|
|
210
|
+
// const groupblocks = findGroupBlocks(pedigree, editingGroupBlock) ?? [];
|
|
211
|
+
// const handleGroupBlockDoubleClick = (blockId: string) => {
|
|
212
|
+
// setEditingGroupBlock(blockId);
|
|
213
|
+
// };
|
|
214
|
+
var _g = (0, react_1.useState)([]), pinnedGBs = _g[0], setPinnedGBs = _g[1];
|
|
215
|
+
// const pinnedChildrens = pinnedGBs.map((gbId) => findAllChildrenCbIds(pedigree, gbId)).flat();
|
|
216
|
+
// const currentDepthCbs = props.componentBlocks?.filter((cb) => {
|
|
217
|
+
// return editableCBIds.includes(cb.id);
|
|
218
|
+
// });
|
|
219
|
+
var onToggleGBPinned = function (gbId) {
|
|
220
|
+
setPinnedGBs(function (prev) {
|
|
221
|
+
if (prev.includes(gbId)) {
|
|
222
|
+
return prev.filter(function (id) { return id !== gbId; });
|
|
223
|
+
}
|
|
224
|
+
return __spreadArray(__spreadArray([], prev, true), [gbId], false);
|
|
225
|
+
});
|
|
214
226
|
};
|
|
215
|
-
console.log(editingGroupBlock);
|
|
216
227
|
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(dynamicLayoutContext_1.dynamicLayoutContext.Provider, __assign({ value: {
|
|
217
228
|
device: device,
|
|
218
229
|
mode: mode,
|
|
@@ -259,19 +270,26 @@ var GridAutoRowEditor = (0, react_1.forwardRef)(function CustomSection(props, re
|
|
|
259
270
|
backgroundColor: '#e8e1e189',
|
|
260
271
|
border: '1px solid #6b666688'
|
|
261
272
|
}, "data-row": rIdx + 1, "data-col": cIdx + 1 }, "bg-grid-item-".concat(rIdx + 1, "-").concat(cIdx + 1))); }) }), "bg-grid-row-".concat(rIdx + 1)));
|
|
262
|
-
}), (
|
|
263
|
-
var _a;
|
|
264
|
-
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, style: editableCBIds.includes(cb.id)
|
|
265
|
-
? { pointerEvents: 'none', boxShadow: '0 0 0 3px #e602ff' }
|
|
266
|
-
: { pointerEvents: 'none', opacity: 0.3 }, showPinned: editableCBIds.includes(cb.id) }) }, cb.id));
|
|
267
|
-
}), groupblocks.map(function (groupblock, gIdx) {
|
|
268
|
-
return ((0, jsx_runtime_1.jsx)(GroupBlockRender, { block: groupblock, layouts: layouts, pedigree: pedigree, onDoubleClick: function () { return handleGroupBlockDoubleClick(groupblock.blockId); } }, groupblock.blockId));
|
|
269
|
-
})] })) })) })) }) })) }));
|
|
273
|
+
}), pedigree.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(groupUtils_1.default, { block: child, rowHeight: rowHeight, layoutItems: layouts[device === 'DESKTOP' ? 'lg' : 'sm'], cbs: props.componentBlocks, device: device, selectedRows: selectedRows, pinnedGBs: pinnedGBs, onToggleGBPinned: onToggleGBPinned, isEditMode: true }, child.blockId)); })] })) })) })) }) })) }));
|
|
270
274
|
});
|
|
271
275
|
function GroupBlockRender(_a) {
|
|
272
|
-
var block = _a.block, layouts = _a.layouts, pedigree = _a.pedigree, onDoubleClick = _a.onDoubleClick;
|
|
276
|
+
var block = _a.block, layouts = _a.layouts, pedigree = _a.pedigree, isEditing = _a.isEditing, isPinned = _a.isPinned, componentBlocks = _a.componentBlocks, onTogglePinned = _a.onTogglePinned, onDoubleClick = _a.onDoubleClick, onDoubleClickOutside = _a.onDoubleClickOutside;
|
|
273
277
|
var childrenIds = (0, group_1.findAllChildrenCbIds)(pedigree, block.blockId).map(function (i) { return i.toString(); });
|
|
274
|
-
var bounding = (0, renderHelpers_1.getBoundingArea)(layouts
|
|
278
|
+
var bounding = (0, renderHelpers_1.getBoundingArea)(layouts, childrenIds);
|
|
279
|
+
(0, react_1.useEffect)(function () {
|
|
280
|
+
if (!isEditing) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
function handleDoubleClickOutside(e) {
|
|
284
|
+
if (!e.target.closest('.group')) {
|
|
285
|
+
onDoubleClickOutside();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
document.addEventListener('dblclick', handleDoubleClickOutside);
|
|
289
|
+
return function () {
|
|
290
|
+
document.removeEventListener('dblclick', handleDoubleClickOutside);
|
|
291
|
+
};
|
|
292
|
+
}, [isEditing]);
|
|
275
293
|
if (!bounding) {
|
|
276
294
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
277
295
|
}
|
|
@@ -281,8 +299,25 @@ function GroupBlockRender(_a) {
|
|
|
281
299
|
cols: bounding.w,
|
|
282
300
|
rows: bounding.h
|
|
283
301
|
});
|
|
284
|
-
|
|
302
|
+
var children = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.filter(function (cb) { return childrenIds.includes(cb.id.toString()); });
|
|
303
|
+
if (childrenIds.length === 0) {
|
|
304
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "\uB529\uD06C\uADF8\uB8F9" });
|
|
305
|
+
}
|
|
306
|
+
return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: {
|
|
307
|
+
gridArea: gridArea,
|
|
308
|
+
position: 'relative',
|
|
309
|
+
width: '100%',
|
|
310
|
+
height: '100%'
|
|
311
|
+
}, onDoubleClick: onDoubleClick }, { children: [!isEditing && ((0, jsx_runtime_1.jsx)(S_Pinned, { children: isPinned ? ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: onTogglePinned }, { children: "(\uADF8\uB8F9)H\uACE0\uC815\uB428 \uD83D\uDCCC" }))) : ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: onTogglePinned }, { children: "(\uADF8\uB8F9)H\uB298\uC5B4\uB0A8 \uD83E\uDEB1" }))) })), (0, jsx_runtime_1.jsx)("div", { className: "group", style: {
|
|
312
|
+
position: 'absolute',
|
|
313
|
+
top: 0,
|
|
314
|
+
left: 0,
|
|
315
|
+
right: 0,
|
|
316
|
+
bottom: 0,
|
|
317
|
+
boxShadow: '0 0 0 3px #e602ff'
|
|
318
|
+
} }), children === null || children === void 0 ? void 0 : children.map(function (cb, index) { return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: index, device: "DESKTOP", rowHeight: 50, zIndex: 0, style: { pointerEvents: 'none', opacity: isEditing ? 1 : 0.3 }, showPinned: isEditing, isParentGroupPinned: isPinned }) }, cb.id)); })] })));
|
|
285
319
|
}
|
|
320
|
+
var S_Pinned = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"], ["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"])));
|
|
286
321
|
function getGridAreaFromGroup(position) {
|
|
287
322
|
var x = position.x, y = position.y, cols = position.cols, rows = position.rows;
|
|
288
323
|
var colStart = clamp(x + 1, 1, Math.max(1, 25 - cols));
|
|
@@ -303,7 +338,7 @@ function getGridAreaFromGroup(position) {
|
|
|
303
338
|
function clamp(num, min, max) {
|
|
304
339
|
return Math.max(Math.min(num, max), min);
|
|
305
340
|
}
|
|
306
|
-
var GridContainer = styled_components_1.default.div(
|
|
341
|
+
var GridContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-auto-rows: minmax(", ", auto);\n grid-template-columns: repeat(", ", 1fr);\n\n grid-template-rows: ", "; /* \uBC30\uC5F4\uC744 \uACF5\uBC31\uC73C\uB85C \uAD6C\uBD84\uB41C \uBB38\uC790\uC5F4\uB85C \uD569\uCE69\uB2C8\uB2E4. */\n padding: 10px 10px;\n\n * {\n box-sizing: border-box;\n }\n\n .bg-grid-item {\n transition: background-color 0.2s ease;\n }\n\n /* 1. \uAE30\uBCF8 \uD638\uBC84 (\uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC744 \uB54C) */\n .bg-grid-row:not(.selected):hover > .bg-grid-item {\n background-color: #90ee90 !important; /* \uC5F0\uB450\uC0C9 */\n }\n\n /* 2. 'selected' \uD074\uB798\uC2A4\uAC00 \uBD99\uC740 \uD589\uC758 \uC544\uC774\uD15C (\uC120\uD0DD\uB428) */\n .bg-grid-row.selected > .bg-grid-item {\n background-color: #90ee90 !important; /* \uC5F0\uB450\uC0C9 */\n }\n\n /* 3. \uC120\uD0DD\uB41C \uD589\uC5D0 \uD638\uBC84\uD588\uC744 \uB54C */\n .bg-grid-row.selected:hover > .bg-grid-item {\n background-color: #ffc0cb !important; /* \uD551\uD06C\uC0C9 */\n }\n"], ["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-auto-rows: minmax(", ", auto);\n grid-template-columns: repeat(", ", 1fr);\n\n grid-template-rows: ", "; /* \uBC30\uC5F4\uC744 \uACF5\uBC31\uC73C\uB85C \uAD6C\uBD84\uB41C \uBB38\uC790\uC5F4\uB85C \uD569\uCE69\uB2C8\uB2E4. */\n padding: 10px 10px;\n\n * {\n box-sizing: border-box;\n }\n\n .bg-grid-item {\n transition: background-color 0.2s ease;\n }\n\n /* 1. \uAE30\uBCF8 \uD638\uBC84 (\uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC744 \uB54C) */\n .bg-grid-row:not(.selected):hover > .bg-grid-item {\n background-color: #90ee90 !important; /* \uC5F0\uB450\uC0C9 */\n }\n\n /* 2. 'selected' \uD074\uB798\uC2A4\uAC00 \uBD99\uC740 \uD589\uC758 \uC544\uC774\uD15C (\uC120\uD0DD\uB428) */\n .bg-grid-row.selected > .bg-grid-item {\n background-color: #90ee90 !important; /* \uC5F0\uB450\uC0C9 */\n }\n\n /* 3. \uC120\uD0DD\uB41C \uD589\uC5D0 \uD638\uBC84\uD588\uC744 \uB54C */\n .bg-grid-row.selected:hover > .bg-grid-item {\n background-color: #ffc0cb !important; /* \uD551\uD06C\uC0C9 */\n }\n"])), function (props) { return "".concat(props.rowHeight, "px"); }, function (props) { return props.cols; }, function (props) {
|
|
307
342
|
// 전체 행 개수만큼 배열을 생성하여 각 행의 CSS 값을 정의합니다.
|
|
308
343
|
return Array.from({ length: props.sectionRow })
|
|
309
344
|
.map(function (_, index) {
|
|
@@ -315,7 +350,7 @@ var GridContainer = styled_components_1.default.div(templateObject_1 || (templat
|
|
|
315
350
|
)
|
|
316
351
|
.join(' ');
|
|
317
352
|
});
|
|
318
|
-
var S_SectionWrapper = styled_components_1.default.div(
|
|
353
|
+
var S_SectionWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
319
354
|
exports.default = react_1.default.memo(GridAutoRowEditor);
|
|
320
355
|
function getDefensiveFontSize(device, width) {
|
|
321
356
|
if (device === 'MOBILE') {
|
|
@@ -323,4 +358,4 @@ function getDefensiveFontSize(device, width) {
|
|
|
323
358
|
}
|
|
324
359
|
return width * (0.0000246 * width - 0.01618);
|
|
325
360
|
}
|
|
326
|
-
var templateObject_1, templateObject_2;
|
|
361
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -178,6 +178,8 @@ export declare const MOCK_COMPONENT_BLOCKS: ({
|
|
|
178
178
|
};
|
|
179
179
|
CB_CONTENT_PROP_TEXT: {
|
|
180
180
|
CB_CONTENT_PROP_TEXT_SPEC_TEXT: string;
|
|
181
|
+
CB_CONTENT_PROP_TEXT_SPEC_PREFIX?: undefined;
|
|
182
|
+
CB_CONTENT_PROP_TEXT_SPEC_SUFFIX?: undefined;
|
|
181
183
|
};
|
|
182
184
|
CB_CONTENT_PROP_VISIBILITY: {
|
|
183
185
|
CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP: boolean;
|
|
@@ -388,6 +390,137 @@ export declare const MOCK_COMPONENT_BLOCKS: ({
|
|
|
388
390
|
};
|
|
389
391
|
CB_CONTENT_PROP_TEXT: {
|
|
390
392
|
CB_CONTENT_PROP_TEXT_SPEC_TEXT: string;
|
|
393
|
+
CB_CONTENT_PROP_TEXT_SPEC_PREFIX: string;
|
|
394
|
+
CB_CONTENT_PROP_TEXT_SPEC_SUFFIX: string;
|
|
395
|
+
};
|
|
396
|
+
CB_CONTENT_PROP_VISIBILITY: {
|
|
397
|
+
CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP: boolean;
|
|
398
|
+
CB_CONTENT_PROP_VISIBILITY_SPEC_MOBILEWEB: boolean;
|
|
399
|
+
};
|
|
400
|
+
CB_EFFECT_PROP_ENTANIM: {
|
|
401
|
+
CB_EFFECT_PROP_ENTANIM_SPEC_DURATION: number;
|
|
402
|
+
'CB_EFFECT_PROP_ENTANIM_SPEC_DURATION:MOBILE': null;
|
|
403
|
+
CB_EFFECT_PROP_ENTANIM_SPEC_REPEAT: number;
|
|
404
|
+
'CB_EFFECT_PROP_ENTANIM_SPEC_REPEAT:MOBILE': null;
|
|
405
|
+
CB_EFFECT_PROP_ENTANIM_SPEC_TFUNC: string;
|
|
406
|
+
'CB_EFFECT_PROP_ENTANIM_SPEC_TFUNC:MOBILE': null;
|
|
407
|
+
CB_EFFECT_PROP_ENTANIM_SPEC_TYPE: string;
|
|
408
|
+
'CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE': null;
|
|
409
|
+
};
|
|
410
|
+
CB_EFFECT_PROP_HOVERANIM: {
|
|
411
|
+
CB_EFFECT_PROP_HOVERANIM_SPEC_DURATION: number;
|
|
412
|
+
'CB_EFFECT_PROP_HOVERANIM_SPEC_DURATION:MOBILE': null;
|
|
413
|
+
CB_EFFECT_PROP_HOVERANIM_SPEC_REPEAT: number;
|
|
414
|
+
'CB_EFFECT_PROP_HOVERANIM_SPEC_REPEAT:MOBILE': null;
|
|
415
|
+
CB_EFFECT_PROP_HOVERANIM_SPEC_TFUNC: string;
|
|
416
|
+
'CB_EFFECT_PROP_HOVERANIM_SPEC_TFUNC:MOBILE': null;
|
|
417
|
+
CB_EFFECT_PROP_HOVERANIM_SPEC_TYPE: string;
|
|
418
|
+
'CB_EFFECT_PROP_HOVERANIM_SPEC_TYPE:MOBILE': null;
|
|
419
|
+
};
|
|
420
|
+
CB_LAYOUT_PROP_PADDING: {
|
|
421
|
+
CB_LAYOUT_PROP_PADDING_SPEC_FIX: boolean;
|
|
422
|
+
'CB_LAYOUT_PROP_PADDING_SPEC_FIX:MOBILE': null;
|
|
423
|
+
CB_LAYOUT_PROP_PADDING_SPEC_PADDING: {
|
|
424
|
+
bottom: number;
|
|
425
|
+
left: number;
|
|
426
|
+
right: number;
|
|
427
|
+
top: number;
|
|
428
|
+
};
|
|
429
|
+
'CB_LAYOUT_PROP_PADDING_SPEC_PADDING:MOBILE': {
|
|
430
|
+
bottom: number;
|
|
431
|
+
left: number;
|
|
432
|
+
right: number;
|
|
433
|
+
top: number;
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
CB_PLACEMENT_PROP_PLACEMENT: {
|
|
437
|
+
CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS: number;
|
|
438
|
+
'CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE': number;
|
|
439
|
+
CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS: number;
|
|
440
|
+
'CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE': number;
|
|
441
|
+
CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX: number;
|
|
442
|
+
'CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX:MOBILE': number;
|
|
443
|
+
CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY: number;
|
|
444
|
+
'CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE': number;
|
|
445
|
+
CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX: number;
|
|
446
|
+
'CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX:MOBILE': number;
|
|
447
|
+
};
|
|
448
|
+
CB_STYLE_PROP_OPACITY: {
|
|
449
|
+
CB_STYLE_PROP_OPACITY_SPEC_OPACITY: number;
|
|
450
|
+
'CB_STYLE_PROP_OPACITY_SPEC_OPACITY:HOVER': null;
|
|
451
|
+
'CB_STYLE_PROP_OPACITY_SPEC_OPACITY:MOBILE': null;
|
|
452
|
+
'CB_STYLE_PROP_OPACITY_SPEC_OPACITY:MOBILE:HOVER': null;
|
|
453
|
+
};
|
|
454
|
+
CB_STYLE_PROP_TEXT: {
|
|
455
|
+
CB_STYLE_PROP_TEXT_SPEC_COLOR: string;
|
|
456
|
+
'CB_STYLE_PROP_TEXT_SPEC_COLOR:HOVER': null;
|
|
457
|
+
'CB_STYLE_PROP_TEXT_SPEC_COLOR:MOBILE': null;
|
|
458
|
+
'CB_STYLE_PROP_TEXT_SPEC_COLOR:MOBILE:HOVER': null;
|
|
459
|
+
CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL: string;
|
|
460
|
+
'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL:HOVER': null;
|
|
461
|
+
'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL:MOBILE': null;
|
|
462
|
+
'CB_STYLE_PROP_TEXT_SPEC_HORIZONTAL:MOBILE:HOVER': null;
|
|
463
|
+
CB_STYLE_PROP_TEXT_SPEC_LETTERSPACING: number;
|
|
464
|
+
'CB_STYLE_PROP_TEXT_SPEC_LETTERSPACING:HOVER': null;
|
|
465
|
+
'CB_STYLE_PROP_TEXT_SPEC_LETTERSPACING:MOBILE': null;
|
|
466
|
+
'CB_STYLE_PROP_TEXT_SPEC_LETTERSPACING:MOBILE:HOVER': null;
|
|
467
|
+
CB_STYLE_PROP_TEXT_SPEC_LINEHEIGHT: number;
|
|
468
|
+
'CB_STYLE_PROP_TEXT_SPEC_LINEHEIGHT:HOVER': null;
|
|
469
|
+
'CB_STYLE_PROP_TEXT_SPEC_LINEHEIGHT:MOBILE': null;
|
|
470
|
+
'CB_STYLE_PROP_TEXT_SPEC_LINEHEIGHT:MOBILE:HOVER': null;
|
|
471
|
+
CB_STYLE_PROP_TEXT_SPEC_SIZE: number;
|
|
472
|
+
'CB_STYLE_PROP_TEXT_SPEC_SIZE:HOVER': null;
|
|
473
|
+
'CB_STYLE_PROP_TEXT_SPEC_SIZE:MOBILE': null;
|
|
474
|
+
'CB_STYLE_PROP_TEXT_SPEC_SIZE:MOBILE:HOVER': null;
|
|
475
|
+
CB_STYLE_PROP_TEXT_SPEC_TYPEFACE: string;
|
|
476
|
+
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:HOVER': null;
|
|
477
|
+
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:MOBILE': null;
|
|
478
|
+
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE:MOBILE:HOVER': null;
|
|
479
|
+
CB_STYLE_PROP_TEXT_SPEC_VERTICAL: string;
|
|
480
|
+
'CB_STYLE_PROP_TEXT_SPEC_VERTICAL:HOVER': null;
|
|
481
|
+
'CB_STYLE_PROP_TEXT_SPEC_VERTICAL:MOBILE': null;
|
|
482
|
+
'CB_STYLE_PROP_TEXT_SPEC_VERTICAL:MOBILE:HOVER': null;
|
|
483
|
+
CB_STYLE_PROP_TEXT_SPEC_WEIGHT: number;
|
|
484
|
+
'CB_STYLE_PROP_TEXT_SPEC_WEIGHT:HOVER': null;
|
|
485
|
+
'CB_STYLE_PROP_TEXT_SPEC_WEIGHT:MOBILE': null;
|
|
486
|
+
'CB_STYLE_PROP_TEXT_SPEC_WEIGHT:MOBILE:HOVER': null;
|
|
487
|
+
};
|
|
488
|
+
CB_CONTENT_PROP_IMAGE?: undefined;
|
|
489
|
+
CB_STYLE_PROP_BORDER?: undefined;
|
|
490
|
+
CB_STYLE_PROP_IMAGE?: undefined;
|
|
491
|
+
CB_STYLE_PROP_SHADOW?: undefined;
|
|
492
|
+
CB_STYLE_PROP_COLOR?: undefined;
|
|
493
|
+
};
|
|
494
|
+
minVersion: string;
|
|
495
|
+
version: string;
|
|
496
|
+
};
|
|
497
|
+
queryableDefinitionPreset: string;
|
|
498
|
+
queryableTapSrc: string;
|
|
499
|
+
updatedAt: string;
|
|
500
|
+
} | {
|
|
501
|
+
availablePlugins: never[];
|
|
502
|
+
blockId: string;
|
|
503
|
+
componentBlockCode: string;
|
|
504
|
+
componentBlockType: string;
|
|
505
|
+
dynamicLayoutSectionId: number;
|
|
506
|
+
id: number;
|
|
507
|
+
insertedAt: string;
|
|
508
|
+
jsonProperties: {
|
|
509
|
+
currentVersion: string;
|
|
510
|
+
data: {
|
|
511
|
+
CB_CONTENT_PROP_CLINK: {
|
|
512
|
+
CB_CONTENT_PROP_CLINK_SPEC_INTERNALSRC: string;
|
|
513
|
+
CB_CONTENT_PROP_CLINK_SPEC_NEWTAB: boolean;
|
|
514
|
+
CB_CONTENT_PROP_CLINK_SPEC_SRC: string;
|
|
515
|
+
CB_CONTENT_PROP_CLINK_SPEC_TYPE: string;
|
|
516
|
+
};
|
|
517
|
+
CB_CONTENT_PROP_HOVER: {
|
|
518
|
+
CB_CONTENT_PROP_HOVER_SPEC_MUSE: boolean;
|
|
519
|
+
};
|
|
520
|
+
CB_CONTENT_PROP_TEXT: {
|
|
521
|
+
CB_CONTENT_PROP_TEXT_SPEC_TEXT: string;
|
|
522
|
+
CB_CONTENT_PROP_TEXT_SPEC_PREFIX?: undefined;
|
|
523
|
+
CB_CONTENT_PROP_TEXT_SPEC_SUFFIX?: undefined;
|
|
391
524
|
};
|
|
392
525
|
CB_CONTENT_PROP_VISIBILITY: {
|
|
393
526
|
CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP: boolean;
|
|
@@ -673,6 +806,8 @@ export declare const MOCK_COMPONENT_BLOCKS: ({
|
|
|
673
806
|
};
|
|
674
807
|
CB_CONTENT_PROP_TEXT: {
|
|
675
808
|
CB_CONTENT_PROP_TEXT_SPEC_TEXT: string;
|
|
809
|
+
CB_CONTENT_PROP_TEXT_SPEC_PREFIX?: undefined;
|
|
810
|
+
CB_CONTENT_PROP_TEXT_SPEC_SUFFIX?: undefined;
|
|
676
811
|
};
|
|
677
812
|
CB_CONTENT_PROP_VISIBILITY: {
|
|
678
813
|
CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP: boolean;
|
|
@@ -1171,7 +1171,9 @@ exports.MOCK_COMPONENT_BLOCKS = [
|
|
|
1171
1171
|
CB_CONTENT_PROP_HOVER_SPEC_MUSE: true
|
|
1172
1172
|
},
|
|
1173
1173
|
CB_CONTENT_PROP_TEXT: {
|
|
1174
|
-
CB_CONTENT_PROP_TEXT_SPEC_TEXT: "Today's Book Highlight"
|
|
1174
|
+
CB_CONTENT_PROP_TEXT_SPEC_TEXT: "Today's Book Highlight",
|
|
1175
|
+
CB_CONTENT_PROP_TEXT_SPEC_PREFIX: '[Prefix]',
|
|
1176
|
+
CB_CONTENT_PROP_TEXT_SPEC_SUFFIX: '[Suffix]'
|
|
1175
1177
|
},
|
|
1176
1178
|
CB_CONTENT_PROP_VISIBILITY: {
|
|
1177
1179
|
CB_CONTENT_PROP_VISIBILITY_SPEC_DESKTOP: true,
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MOCK_SECTIONS = void 0;
|
|
4
|
-
require("./mock_componentBlocks");
|
|
5
4
|
var mock_contentsCarousel_1 = require("./mock_contentsCarousel");
|
|
6
5
|
var mock_contentsList_1 = require("./mock_contentsList");
|
|
7
6
|
var mock_slideBanner_1 = require("./mock_slideBanner");
|
|
8
|
-
require("./mock_video");
|
|
9
|
-
require("./types");
|
|
10
7
|
exports.MOCK_SECTIONS = [
|
|
11
8
|
{
|
|
12
9
|
administrativeTitle: 'Daily Pages',
|
|
@@ -60,7 +60,7 @@ var dynamicLayoutContext_1 = require("../../../DynamicLayout/dynamicLayoutContex
|
|
|
60
60
|
var gleStyles_1 = require("../../../DynamicLayout/gleStyles");
|
|
61
61
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
62
62
|
var components_1 = require("../../components");
|
|
63
|
-
var
|
|
63
|
+
var ComponentBlockMatcherWithCCB_1 = __importDefault(require("./components/ComponentBlock/ComponentBlockMatcherWithCCB"));
|
|
64
64
|
var S_HiddenCover_1 = require("./components/ComponentBlock/componentBlocks/components/S_HiddenCover");
|
|
65
65
|
var clsx_1 = require("./newUtils/clsx");
|
|
66
66
|
var group_2 = require("./newUtils/group");
|
|
@@ -1084,7 +1084,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
1084
1084
|
e.stopPropagation();
|
|
1085
1085
|
e.preventDefault();
|
|
1086
1086
|
onContextMenuCB(matchedCB.id, e);
|
|
1087
|
-
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(
|
|
1087
|
+
} }, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcherWithCCB_1.default, { cbProps: matchedCB, device: device, rowHeight: rowHeight, index: index }) }) })) }), each.i));
|
|
1088
1088
|
}) })) })) }))] })) }));
|
|
1089
1089
|
});
|
|
1090
1090
|
function isLayoutPlacementSame(current, prev) {
|
|
@@ -20,7 +20,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
22
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
23
|
-
var
|
|
23
|
+
var ComponentBlockMatcherWithCCB_1 = __importDefault(require("./components/ComponentBlock/ComponentBlockMatcherWithCCB"));
|
|
24
24
|
var types_1 = require("./types");
|
|
25
25
|
var gap = 10;
|
|
26
26
|
function FlexGridItem(_a) {
|
|
@@ -32,7 +32,7 @@ function FlexGridItem(_a) {
|
|
|
32
32
|
return ((0, jsx_runtime_1.jsx)(GridItem, __assign({ "data-cb-id": cb.id, style: __assign({ zIndex: zIndex, gridArea: gridArea }, (isRichText && {
|
|
33
33
|
minHeight: 0,
|
|
34
34
|
overflowY: 'scroll'
|
|
35
|
-
})) }, { children: (0, jsx_runtime_1.jsx)(
|
|
35
|
+
})) }, { children: (0, jsx_runtime_1.jsx)(ComponentBlockMatcherWithCCB_1.default, { rowHeight: rowHeight, cbProps: cb, device: device, index: index }) })));
|
|
36
36
|
}
|
|
37
37
|
var GridItem = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: auto;\n word-break: break-word;\n"], ["\n height: auto;\n word-break: break-word;\n"])));
|
|
38
38
|
function getMaxHeight(props, device, rowHeight) {
|
|
@@ -131,7 +131,9 @@ function ContentsCarousel(props) {
|
|
|
131
131
|
? contentsCarouselHoverStyle === null || contentsCarouselHoverStyle === void 0 ? void 0 : contentsCarouselHoverStyle.customStyle
|
|
132
132
|
: contentsCarouselNormalStyle === null || contentsCarouselNormalStyle === void 0 ? void 0 : contentsCarouselNormalStyle.customStyle }, { children: (0, jsx_runtime_1.jsx)(ContentsCarouselCore_1.default, __assign({ ref: swiperRef, className: "cb-contentscarousel", allowTouchMove: mode !== 'EDIT' ? true : false, onSwiper: onSwiper, onSlideChangeTransitionEnd: onSlideChangeTransitionEnd, onAutoplayTimeLeft: onAutoplayTimeLeft, slidesPerView: 1, styles: isHovered ? contentsCarouselHoverStyle : contentsCarouselNormalStyle, effect: CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE === 'CARD'
|
|
133
133
|
? 'cards'
|
|
134
|
-
: CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE ===
|
|
134
|
+
: CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE === 'FADEOUTANDIN'
|
|
135
|
+
? 'fade'
|
|
136
|
+
: CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE === null || CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE === void 0 ? void 0 : CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE.toLowerCase() }, { children: (0, createCompositions_1.createCompositions)({
|
|
135
137
|
valueType: CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_VALUETYPE,
|
|
136
138
|
queryPath: CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_CONNECTDATA,
|
|
137
139
|
limit: CB_CONTENT_PROP_CONTENTSCAROUSEL_SPEC_ITEMCOUNTS,
|
|
@@ -81,9 +81,9 @@ var useFlexGridLayout = function (_a) {
|
|
|
81
81
|
OUTSET1: { top: -50, left: ccbLeft },
|
|
82
82
|
OUTSET2: { top: -50, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
83
83
|
OUTSET3: { top: -50, right: ccbRight },
|
|
84
|
-
OUTSET4: { top: ccbTop, right: 50 },
|
|
85
|
-
OUTSET5: { top: "".concat(ccbCenterY, "px"), right: 50, transform: 'translateY(-50%)' },
|
|
86
|
-
OUTSET6: { bottom: ccbBottom, right: 50 },
|
|
84
|
+
OUTSET4: { top: ccbTop, right: -50 },
|
|
85
|
+
OUTSET5: { top: "".concat(ccbCenterY, "px"), right: -50, transform: 'translateY(-50%)' },
|
|
86
|
+
OUTSET6: { bottom: ccbBottom, right: -50 },
|
|
87
87
|
OUTSET7: { bottom: -50, right: ccbRight },
|
|
88
88
|
OUTSET8: { bottom: -50, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
89
89
|
OUTSET9: { bottom: -50, left: ccbLeft },
|
|
@@ -19,6 +19,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
22
23
|
var react_1 = require("react");
|
|
23
24
|
var CustomSectionBackgroundMedia_1 = require("../../../../../../../DynamicLayout/components/Section/components/CustomSectionBackgroundMedia");
|
|
24
25
|
var createCompositions_1 = require("../../../../../../../DynamicLayout/CompositionRenderer/createCompositions");
|
|
@@ -81,9 +81,9 @@ var useFlexGridLayout = function (_a) {
|
|
|
81
81
|
OUTSET1: { top: -50, left: ccbLeft },
|
|
82
82
|
OUTSET2: { top: -50, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
83
83
|
OUTSET3: { top: -50, right: ccbRight },
|
|
84
|
-
OUTSET4: { top: ccbTop, right: 50 },
|
|
85
|
-
OUTSET5: { top: "".concat(ccbCenterY, "px"), right: 50, transform: 'translateY(-50%)' },
|
|
86
|
-
OUTSET6: { bottom: ccbBottom, right: 50 },
|
|
84
|
+
OUTSET4: { top: ccbTop, right: -50 },
|
|
85
|
+
OUTSET5: { top: "".concat(ccbCenterY, "px"), right: -50, transform: 'translateY(-50%)' },
|
|
86
|
+
OUTSET6: { bottom: ccbBottom, right: -50 },
|
|
87
87
|
OUTSET7: { bottom: -50, right: ccbRight },
|
|
88
88
|
OUTSET8: { bottom: -50, left: "".concat(ccbCenterX, "px"), transform: 'translateX(-50%)' },
|
|
89
89
|
OUTSET9: { bottom: -50, left: ccbLeft },
|
|
@@ -137,15 +137,13 @@ var body2Regular = (0, styled_components_1.css)(templateObject_4 || (templateObj
|
|
|
137
137
|
var theme = _a.theme;
|
|
138
138
|
return theme.desktopLineHeight.body2;
|
|
139
139
|
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
});
|
|
148
|
-
var S_TextLabel = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
140
|
+
// const sysTextWhite = css`
|
|
141
|
+
// color: ${({ theme }) => theme.ui_cpnt_textlabel_sys_white};
|
|
142
|
+
// `;
|
|
143
|
+
// const sysTextBlack = css`
|
|
144
|
+
// color: ${({ theme }) => theme.ui_cpnt_textlabel_sys_black};
|
|
145
|
+
// `;
|
|
146
|
+
var S_TextLabel = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
149
147
|
var styleTheme = _a.styleTheme;
|
|
150
148
|
return styleTheme &&
|
|
151
149
|
{
|
|
@@ -153,24 +151,24 @@ var S_TextLabel = styled_components_1.default.div(templateObject_7 || (templateO
|
|
|
153
151
|
body2Regular: body2Regular
|
|
154
152
|
}[styleTheme];
|
|
155
153
|
});
|
|
156
|
-
var verticalDivider = (0, styled_components_1.css)(
|
|
157
|
-
var horizontalDivider = (0, styled_components_1.css)(
|
|
158
|
-
var S_Divider = styled_components_1.default.div(
|
|
154
|
+
var verticalDivider = (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 16px;\n width: 1px;\n"], ["\n height: 16px;\n width: 1px;\n"])));
|
|
155
|
+
var horizontalDivider = (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n height: 1px;\n width: 100%;\n"], ["\n height: 1px;\n width: 100%;\n"])));
|
|
156
|
+
var S_Divider = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n opacity: 0.6;\n ", ";\n"], ["\n background-color: ", ";\n opacity: 0.6;\n ", ";\n"])), function (_a) {
|
|
159
157
|
var color = _a.color;
|
|
160
158
|
return color;
|
|
161
159
|
}, function (_a) {
|
|
162
160
|
var type = _a.type;
|
|
163
161
|
return (type === 'VERTICAL' ? verticalDivider : horizontalDivider);
|
|
164
162
|
});
|
|
165
|
-
var S_Dot = styled_components_1.default.div(
|
|
163
|
+
var S_Dot = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: 50%;\n cursor: pointer;\n height: 8px;\n width: 8px;\n"], ["\n background-color: ", ";\n border-radius: 50%;\n cursor: pointer;\n height: 8px;\n width: 8px;\n"])), function (_a) {
|
|
166
164
|
var color = _a.color;
|
|
167
165
|
return color;
|
|
168
166
|
});
|
|
169
|
-
var S_Bar = styled_components_1.default.div(
|
|
167
|
+
var S_Bar = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background-color: ", ";\n cursor: pointer;\n height: 2px;\n width: 40px;\n"], ["\n background-color: ", ";\n cursor: pointer;\n height: 2px;\n width: 40px;\n"])), function (_a) {
|
|
170
168
|
var color = _a.color;
|
|
171
169
|
return color;
|
|
172
170
|
});
|
|
173
|
-
var S_Pointer = styled_components_1.default.div(
|
|
171
|
+
var S_Pointer = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n cursor: ", ";\n height: 16px;\n opacity: ", ";\n"], ["\n cursor: ", ";\n height: 16px;\n opacity: ", ";\n"])), function (_a) {
|
|
174
172
|
var disabled = _a.disabled;
|
|
175
173
|
return (disabled ? 'not-allowed' : 'pointer');
|
|
176
174
|
}, function (_a) {
|
|
@@ -178,4 +176,4 @@ var S_Pointer = styled_components_1.default.div(templateObject_13 || (templateOb
|
|
|
178
176
|
return (disabled ? 0.4 : 1);
|
|
179
177
|
});
|
|
180
178
|
exports.default = exports.CustomPagination;
|
|
181
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11
|
|
179
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CB_TEXT_PROPERTIES_TYPE, IndexForIntersection } from '../../../../util/types';
|
|
3
3
|
type Props = CB_TEXT_PROPERTIES_TYPE & IndexForIntersection;
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
export default function Text(props: Props): JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -32,7 +32,7 @@ var textSpecFormatOptions_1 = require("./textSpecFormatOptions");
|
|
|
32
32
|
function Text(props) {
|
|
33
33
|
var _a = (0, react_1.useContext)(DynamicLayout_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
|
34
34
|
var queryContext = (0, compositionQueryContext_1.useCCBQueryPath)();
|
|
35
|
-
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_CONTENT_PROP_CLINK_SPEC_VALUETYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE, CB_CONTENT_PROP_CLINK_SPEC_CONNECTDATA = _b.CB_CONTENT_PROP_CLINK_SPEC_CONNECTDATA, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, _c = props.CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE = _c.CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE, CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA = _c.CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA;
|
|
35
|
+
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_CONTENT_PROP_CLINK_SPEC_VALUETYPE = _b.CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE, CB_CONTENT_PROP_CLINK_SPEC_CONNECTDATA = _b.CB_CONTENT_PROP_CLINK_SPEC_CONNECTDATA, CB_EFFECT_PROP_ENTANIM = props.CB_EFFECT_PROP_ENTANIM, _c = props.CB_CONTENT_PROP_TEXT, CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE = _c.CB_CONTENT_PROP_TEXT_SPEC_VALUETYPE, CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA = _c.CB_CONTENT_PROP_TEXT_SPEC_CONNECTDATA, CB_CONTENT_PROP_TEXT_SPEC_SUFFIX = _c.CB_CONTENT_PROP_TEXT_SPEC_SUFFIX, CB_CONTENT_PROP_TEXT_SPEC_PREFIX = _c.CB_CONTENT_PROP_TEXT_SPEC_PREFIX;
|
|
36
36
|
var cLinkValue = function () {
|
|
37
37
|
if (CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE === 'DATA' ||
|
|
38
38
|
CB_CONTENT_PROP_CLINK_SPEC_VALUETYPE === 'DELEGATEDDATA') {
|
|
@@ -115,16 +115,27 @@ function Text(props) {
|
|
|
115
115
|
}
|
|
116
116
|
return props.CB_CONTENT_PROP_TEXT.CB_CONTENT_PROP_TEXT_SPEC_TEXT;
|
|
117
117
|
};
|
|
118
|
+
var getTruncatedText = function (text) {
|
|
119
|
+
var maxLength = props.CB_STYLE_PROP_TEXT.CB_STYLE_PROP_TEXT_SPEC_ELLIPSIS;
|
|
120
|
+
if (!maxLength) {
|
|
121
|
+
return text;
|
|
122
|
+
}
|
|
123
|
+
if (text.length > maxLength) {
|
|
124
|
+
return "".concat(text.slice(0, maxLength), "...");
|
|
125
|
+
}
|
|
126
|
+
return text;
|
|
127
|
+
};
|
|
118
128
|
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: {
|
|
119
129
|
height: '100%',
|
|
120
130
|
display: 'flex',
|
|
121
131
|
alignItems: textStyle.alignItems
|
|
122
|
-
}, ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.
|
|
132
|
+
}, ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsxs)(S_CB_Box_1.S_CB_Box, __assign({ onMouseEnter: function (e) {
|
|
123
133
|
e.currentTarget.classList.add('hovered');
|
|
124
134
|
}, onMouseLeave: function (e) {
|
|
125
135
|
e.currentTarget.classList.remove('hovered');
|
|
126
|
-
}, className: "cb-layout-box cb-text", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), layoutStyle), effectCssProperties), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, height: 'fit-content', minWidth: "calc(2ch + ".concat(layoutStyle.paddingLeft, " + ").concat(layoutStyle.paddingRight, ")") }), hoverStyle: __assign(__assign(__assign({}, textHoverStyle), propsHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: textValue() === 'ERROR' ? 'EDITOR:FALLBACK_TEXT' : textValue() })) }))] }));
|
|
136
|
+
}, className: "cb-layout-box cb-text", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), layoutStyle), effectCssProperties), { whiteSpace: 'pre-wrap', wordBreak: 'break-word', cursor: CLINKCursor, height: 'fit-content', minWidth: "calc(2ch + ".concat(layoutStyle.paddingLeft, " + ").concat(layoutStyle.paddingRight, ")") }), hoverStyle: __assign(__assign(__assign({}, textHoverStyle), propsHoverStyle), { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }), onClick: onClickCLINK }, { children: [CB_CONTENT_PROP_TEXT_SPEC_PREFIX, textValue() === 'ERROR' ? 'EDITOR:FALLBACK_TEXT' : getTruncatedText(textValue()), CB_CONTENT_PROP_TEXT_SPEC_SUFFIX] })) }))] }));
|
|
127
137
|
}
|
|
138
|
+
exports.default = Text;
|
|
128
139
|
function getTextStyles(props, device) {
|
|
129
140
|
var availableSpecCodes = [
|
|
130
141
|
'CB_STYLE_PROP_TEXT_SPEC_TYPEFACE',
|
|
@@ -138,4 +149,3 @@ function getTextStyles(props, device) {
|
|
|
138
149
|
];
|
|
139
150
|
return (0, textUtil_1.parseStyleTextToCSSProp)({ availableSpecCodes: availableSpecCodes, props: props, device: device, propKey: 'TEXT' });
|
|
140
151
|
}
|
|
141
|
-
exports.default = Text;
|
|
@@ -146,7 +146,7 @@ export type CB_CONTENTSCAROUSEL_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
|
146
146
|
CB_EFFECT_PROP_CONTENTSCAROUSEL: CB_EFFECT_PROP_CONTENTSCAROUSEL;
|
|
147
147
|
};
|
|
148
148
|
export type CB_EFFECT_PROP_CONTENTSCAROUSEL = {
|
|
149
|
-
CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE: 'SLIDE' | 'CUBE' | '
|
|
149
|
+
CB_EFFECT_PROP_CONTENTSCAROUSEL_SPEC_TRANSITIONTYPE: 'SLIDE' | 'CUBE' | 'FADEOUTANDIN' | 'CARD' | 'COVERFLOW' | 'FLIP';
|
|
150
150
|
};
|
|
151
151
|
export type CB_SLIDEBANNER_PROPERTIES_TYPE = CB_GENERAL_PROPERTIES_TYPE & {
|
|
152
152
|
CB_CONTENT_PROP_SLIDEBANNER: CB_CONTENT_PROP_SLIDEBANNER;
|
|
@@ -37,6 +37,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
37
|
__setModuleDefault(result, mod);
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
+
if (ar || !(i in from)) {
|
|
43
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
+
ar[i] = from[i];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
+
};
|
|
40
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
51
|
};
|
|
@@ -49,7 +58,8 @@ var dynamicLayoutContext_1 = require("../../DynamicLayout/dynamicLayoutContext")
|
|
|
49
58
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
50
59
|
var components_1 = require("../components");
|
|
51
60
|
var gleStyles_1 = require("../gleStyles");
|
|
52
|
-
var
|
|
61
|
+
var groupUtils_1 = __importDefault(require("../utils/groupUtils"));
|
|
62
|
+
require("./CustomSection/FlexGridItem");
|
|
53
63
|
var useResizableObserver_1 = require("./CustomSection/hooks/useResizableObserver");
|
|
54
64
|
var util_1 = require("./CustomSection/util");
|
|
55
65
|
var parseSectionPadding_1 = __importDefault(require("./CustomSection/util/layoutPropParsers/parseSectionPadding"));
|
|
@@ -59,13 +69,12 @@ var MOBILE_GRID_COLS = 8;
|
|
|
59
69
|
var GLE_MIN_WIDTH_DESKTOP_PX = "".concat(GRID_CELL_MIN * DESKTOP_GRID_COLS, "px");
|
|
60
70
|
var GLE_MIN_WIDTH_MOBILE_PX = "".concat(GRID_CELL_MIN * MOBILE_GRID_COLS, "px");
|
|
61
71
|
var FlexGridCustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
62
|
-
var _a;
|
|
63
|
-
var _b = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _b.device, editingSectionId = _b.editingSectionId, mode = _b.mode, shortcutKeyMode = _b.shortcutKeyMode, sectionActionHandler = _b.sectionActionHandler;
|
|
72
|
+
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, editingSectionId = _a.editingSectionId, mode = _a.mode, shortcutKeyMode = _a.shortcutKeyMode, sectionActionHandler = _a.sectionActionHandler;
|
|
64
73
|
var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
|
|
65
|
-
var
|
|
74
|
+
var _b = jsonProperties, _c = _b.data, CB_PLACEMENT_PROP_SECTION = _c.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _c.CB_LAYOUT_PROP_PADDING, zOrders = _b.zOrders;
|
|
66
75
|
var containerRef = (0, react_1.useRef)(null);
|
|
67
76
|
var size = (0, useResizableObserver_1.useResizeObserver)({ ref: containerRef, box: 'border-box' });
|
|
68
|
-
var
|
|
77
|
+
var _d = (0, react_1.useState)(null), selectedCB = _d[0], setSelectedCB = _d[1];
|
|
69
78
|
var gleRef = (0, react_1.useRef)(null);
|
|
70
79
|
var isMobile = device === 'MOBILE';
|
|
71
80
|
var isEditMode = mode === 'EDIT';
|
|
@@ -124,10 +133,10 @@ var FlexGridCustomSection = (0, react_1.forwardRef)(function CustomSection(props
|
|
|
124
133
|
setSelectedCB('BULK');
|
|
125
134
|
}
|
|
126
135
|
}, [selectedCB, shortcutKeyMode, sectionActionHandler, setSelectedCB]);
|
|
127
|
-
var
|
|
136
|
+
var _e = (0, util_1.parseCustomSectionPlacement)({
|
|
128
137
|
isMobile: isMobile,
|
|
129
138
|
customSectionProps: CB_PLACEMENT_PROP_SECTION
|
|
130
|
-
}), width =
|
|
139
|
+
}), width = _e.width, minHeight = _e.minHeight, isFullWidth = _e.isFullWidth;
|
|
131
140
|
var customSectionStyles = {
|
|
132
141
|
minHeight: "".concat(minHeight, "vh"),
|
|
133
142
|
width: '100%',
|
|
@@ -185,6 +194,18 @@ var FlexGridCustomSection = (0, react_1.forwardRef)(function CustomSection(props
|
|
|
185
194
|
}
|
|
186
195
|
return 16;
|
|
187
196
|
})();
|
|
197
|
+
var pedigree = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree;
|
|
198
|
+
var layouts = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders);
|
|
199
|
+
var _f = (0, react_1.useState)([]), selectedRows = _f[0], setSelectedRows = _f[1];
|
|
200
|
+
var _g = (0, react_1.useState)([]), pinnedGBs = _g[0], setPinnedGBs = _g[1];
|
|
201
|
+
var onToggleGBPinned = function (gbId) {
|
|
202
|
+
setPinnedGBs(function (prev) {
|
|
203
|
+
if (prev.includes(gbId)) {
|
|
204
|
+
return prev.filter(function (id) { return id !== gbId; });
|
|
205
|
+
}
|
|
206
|
+
return __spreadArray(__spreadArray([], prev, true), [gbId], false);
|
|
207
|
+
});
|
|
208
|
+
};
|
|
188
209
|
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(gleStyles_1.S_gleStyles, { children: (0, jsx_runtime_1.jsx)(S_SectionWrapper, __assign({ ref: gleRef, "x-dlayout-section-type": "NO_NAME", onClick: onClickSection }, { children: (0, jsx_runtime_1.jsx)(components_1.CustomSection, __assign({}, props, { isMobile: isMobile, overrideStyles: {
|
|
189
210
|
minHeight: customSectionStyles.minHeight,
|
|
190
211
|
paddingTop: padding.top,
|
|
@@ -196,10 +217,7 @@ var FlexGridCustomSection = (0, react_1.forwardRef)(function CustomSection(props
|
|
|
196
217
|
maxWidth: customSectionStyles.maxWidth,
|
|
197
218
|
minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
|
|
198
219
|
fontSize: "".concat(baseFontSize, "px")
|
|
199
|
-
} }, { children: (
|
|
200
|
-
var _a;
|
|
201
|
-
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));
|
|
202
|
-
}) })) })) })) }) }));
|
|
220
|
+
} }, { children: pedigree.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(groupUtils_1.default, { block: child, rowHeight: rowHeight, layoutItems: layouts[device === 'DESKTOP' ? 'lg' : 'sm'], cbs: props.componentBlocks, device: device, selectedRows: selectedRows, pinnedGBs: pinnedGBs, onToggleGBPinned: onToggleGBPinned, isEditMode: false }, child.blockId)); }) })) })) })) }) }));
|
|
203
221
|
});
|
|
204
222
|
var GridContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-auto-rows: minmax(", ", auto);\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(\n ", ",\n minmax(", ", auto)\n );\n padding: 10px 10px;\n\n * {\n box-sizing: border-box;\n }\n"], ["\n display: grid; /* Space between grid items */\n gap: 10px;\n grid-auto-rows: minmax(", ", auto);\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: repeat(\n ", ",\n minmax(", ", auto)\n );\n padding: 10px 10px;\n\n * {\n box-sizing: border-box;\n }\n"])), function (props) { return "".concat(props.rowHeight, "px"); }, function (props) { return props.cols; }, function (props) { return props.sectionRow; }, function (props) { return "".concat(props.rowHeight, "px"); });
|
|
205
223
|
var S_SectionWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ComponentBlock } from '../sections/CustomSection/types';
|
|
3
|
+
import type { Device } from '../sections/CustomSection/util/types';
|
|
4
|
+
import type { LayoutItem } from 'publ-echo/dist/lib';
|
|
5
|
+
import type { Block } from 'publ-echo/dist/lib/GridLayoutEditor/group';
|
|
6
|
+
export declare function findAllChildrenCbIds(block: Block, targetGroupId: string): number[];
|
|
7
|
+
export default function RenderPedigreeRecursively({ isEditMode, block, layoutItems, cbs, parentGroupArea, rowHeight, device, selectedRows, pinnedGBs, isParentGroupPinned, onToggleGBPinned }: {
|
|
8
|
+
isEditMode: boolean;
|
|
9
|
+
block: Block;
|
|
10
|
+
layoutItems: LayoutItem[];
|
|
11
|
+
cbs: ComponentBlock[];
|
|
12
|
+
rowHeight: number;
|
|
13
|
+
device: Device;
|
|
14
|
+
selectedRows: number[];
|
|
15
|
+
pinnedGBs: string[];
|
|
16
|
+
onToggleGBPinned: (gbId: string) => void;
|
|
17
|
+
isParentGroupPinned?: boolean;
|
|
18
|
+
parentGroupArea?: {
|
|
19
|
+
rowStart: number;
|
|
20
|
+
colStart: number;
|
|
21
|
+
rowEnd: number;
|
|
22
|
+
colEnd: number;
|
|
23
|
+
};
|
|
24
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
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;
|
|
39
|
+
};
|
|
40
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
+
if (ar || !(i in from)) {
|
|
43
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
+
ar[i] = from[i];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.findAllChildrenCbIds = void 0;
|
|
54
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
55
|
+
var renderHelpers_1 = require("publ-echo-test/dist/lib/GridLayoutEditor/utils/renderHelpers");
|
|
56
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
57
|
+
var ErrorBoundary_1 = require("../components/Section/ErrorBoundary");
|
|
58
|
+
var FlexGridItem_1 = __importStar(require("../CompositionRenderer/FlexGridItem"));
|
|
59
|
+
function findAllChildrenCbIds(block, targetGroupId) {
|
|
60
|
+
// 현재 블록이 target group이면, 모든 하위 컴포넌트 블록 ID를 수집
|
|
61
|
+
if (block.blockId === targetGroupId) {
|
|
62
|
+
if (block.type === 'COMPONENT_BLOCK') {
|
|
63
|
+
return [block.componentBlockId];
|
|
64
|
+
}
|
|
65
|
+
// GROUP_BLOCK인 경우 모든 자식들의 ID를 재귀적으로 수집
|
|
66
|
+
return block.children.reduce(function (acc, child) {
|
|
67
|
+
return __spreadArray(__spreadArray([], acc, true), findAllChildrenCbIds(child, child.blockId), true);
|
|
68
|
+
}, []);
|
|
69
|
+
}
|
|
70
|
+
// 현재 블록이 target group이 아니고 COMPONENT_BLOCK이면 빈 배열 반환
|
|
71
|
+
if (block.type === 'COMPONENT_BLOCK') {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
// GROUP_BLOCK이면 자식들에 대해 재귀적으로 탐색
|
|
75
|
+
return block.children.reduce(function (acc, child) {
|
|
76
|
+
return __spreadArray(__spreadArray([], acc, true), findAllChildrenCbIds(child, targetGroupId), true);
|
|
77
|
+
}, []);
|
|
78
|
+
}
|
|
79
|
+
exports.findAllChildrenCbIds = findAllChildrenCbIds;
|
|
80
|
+
function RenderPedigreeRecursively(_a) {
|
|
81
|
+
var isEditMode = _a.isEditMode, block = _a.block, layoutItems = _a.layoutItems, cbs = _a.cbs, parentGroupArea = _a.parentGroupArea, rowHeight = _a.rowHeight, device = _a.device, selectedRows = _a.selectedRows, pinnedGBs = _a.pinnedGBs, _b = _a.isParentGroupPinned, isParentGroupPinned = _b === void 0 ? false : _b, onToggleGBPinned = _a.onToggleGBPinned;
|
|
82
|
+
var type = block.type;
|
|
83
|
+
if (type === 'GROUP_BLOCK') {
|
|
84
|
+
var childrenIds = findAllChildrenCbIds(block, block.blockId).map(function (i) { return i.toString(); });
|
|
85
|
+
var bounding_1 = (0, renderHelpers_1.getBoundingArea)(layoutItems, childrenIds);
|
|
86
|
+
if (!bounding_1) {
|
|
87
|
+
return (0, jsx_runtime_1.jsx)("div", { children: "GROUP: NO BOUNDING AREA" });
|
|
88
|
+
}
|
|
89
|
+
var gridArea_1 = getGridAreaFromGroup({
|
|
90
|
+
x: bounding_1.x,
|
|
91
|
+
y: bounding_1.y,
|
|
92
|
+
cols: bounding_1.w,
|
|
93
|
+
rows: bounding_1.h
|
|
94
|
+
});
|
|
95
|
+
var relativeGridArea_1 = parentGroupArea
|
|
96
|
+
? calculateRelativeGridArea(gridArea_1, parentGroupArea)
|
|
97
|
+
: gridArea_1;
|
|
98
|
+
// 그룹의 시작 행을 기준으로 상대적인 selectedRows 계산
|
|
99
|
+
var relativeSelectedRows_1 = selectedRows
|
|
100
|
+
.map(function (row) { return row - gridArea_1.rowStart + 1; })
|
|
101
|
+
.filter(function (row) { return row >= 0 && row <= bounding_1.h; });
|
|
102
|
+
var isGBPinned_1 = pinnedGBs.includes(block.blockId);
|
|
103
|
+
var defaultHeight = getMaxHeight({ cols: bounding_1.w, rows: bounding_1.h, x: bounding_1.x, y: bounding_1.y }, rowHeight);
|
|
104
|
+
return ((0, jsx_runtime_1.jsxs)(S_GroupItem, __assign({ cols: bounding_1.w, sectionRow: bounding_1.h, isEditMode: isEditMode, rowHeight: rowHeight, selectedRows: relativeSelectedRows_1, style: {
|
|
105
|
+
gridArea: gridAreaObjToString(relativeGridArea_1),
|
|
106
|
+
display: 'grid',
|
|
107
|
+
zIndex: device === 'DESKTOP'
|
|
108
|
+
? block.zOrderDesktopInternal
|
|
109
|
+
: block.zOrderMobileInternal,
|
|
110
|
+
maxHeight: isGBPinned_1 ? defaultHeight : 'none'
|
|
111
|
+
} }, { children: [isEditMode && ((0, jsx_runtime_1.jsx)(S_Pinned, { children: isGBPinned_1 ? ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: function () { return onToggleGBPinned(block.blockId); } }, { children: "H\uACE0\uC815\uB428 \uD83D\uDCCC" }))) : ((0, jsx_runtime_1.jsx)("button", __assign({ type: "button", onClick: function () { return onToggleGBPinned(block.blockId); } }, { children: "H\uB298\uC5B4\uB0A8 \uD83E\uDEB1" }))) })), block.children.map(function (child) { return ((0, jsx_runtime_1.jsx)(RenderPedigreeRecursively, { rowHeight: rowHeight, block: child, layoutItems: layoutItems, cbs: cbs, parentGroupArea: gridArea_1, device: device, selectedRows: relativeSelectedRows_1, pinnedGBs: pinnedGBs, onToggleGBPinned: onToggleGBPinned, isEditMode: isEditMode, isParentGroupPinned: isGBPinned_1 }, child.blockId)); })] })));
|
|
112
|
+
}
|
|
113
|
+
// default: TYPE === 'COMPONENT_BLOCK'
|
|
114
|
+
var cbIndex = cbs.findIndex(function (c) { return c.blockId === block.blockId; });
|
|
115
|
+
var cb = cbs[cbIndex];
|
|
116
|
+
if (!cb) {
|
|
117
|
+
return (0, jsx_runtime_1.jsxs)("div", { children: ["NO CB FOUND FOR ", block.blockId] });
|
|
118
|
+
}
|
|
119
|
+
var originalGridAreaString = (0, FlexGridItem_1.getGridAreaFromCB)(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device);
|
|
120
|
+
var originalGridArea = parseGridArea(originalGridAreaString);
|
|
121
|
+
// 부모 그룹이 있는 경우, 상대적 위치 계산
|
|
122
|
+
var relativeGridArea = parentGroupArea
|
|
123
|
+
? calculateRelativeGridArea(originalGridArea, parentGroupArea)
|
|
124
|
+
: originalGridArea;
|
|
125
|
+
return (
|
|
126
|
+
// <S_GridItem
|
|
127
|
+
// style={{
|
|
128
|
+
// gridArea: gridAreaObjToString(relativeGridArea)
|
|
129
|
+
// }}
|
|
130
|
+
// data-og-grid-area={originalGridAreaString}
|
|
131
|
+
// data-rel-grid-area={gridAreaObjToString(relativeGridArea)}
|
|
132
|
+
// >
|
|
133
|
+
(0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(FlexGridItem_1.default, { cb: cb, index: cbIndex, device: device, rowHeight: rowHeight, zIndex: device === 'DESKTOP'
|
|
134
|
+
? block.zOrderDesktopInternal
|
|
135
|
+
: block.zOrderMobileInternal, style: {
|
|
136
|
+
gridArea: gridAreaObjToString(relativeGridArea),
|
|
137
|
+
pointerEvents: isEditMode ? 'none' : 'auto',
|
|
138
|
+
boxShadow: isEditMode ? '0 0 0 2px red' : ''
|
|
139
|
+
}, showPinned: isEditMode && !parentGroupArea, isParentGroupPinned: isParentGroupPinned }) }, cb.id)
|
|
140
|
+
// </S_GridItem>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
exports.default = RenderPedigreeRecursively;
|
|
144
|
+
var S_Pinned = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"], ["\n pointer-events: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 9999999;\n"])));
|
|
145
|
+
function clamp(num, min, max) {
|
|
146
|
+
return Math.max(Math.min(num, max), min);
|
|
147
|
+
}
|
|
148
|
+
function gridAreaObjToString(area) {
|
|
149
|
+
var rowStart = area.rowStart, colStart = area.colStart, rowEnd = area.rowEnd, colEnd = area.colEnd;
|
|
150
|
+
return "".concat(rowStart, " / ").concat(colStart, " / ").concat(rowEnd, " / ").concat(colEnd);
|
|
151
|
+
}
|
|
152
|
+
function getGridAreaFromGroup(position) {
|
|
153
|
+
var x = position.x, y = position.y, cols = position.cols, rows = position.rows;
|
|
154
|
+
var colStart = clamp(x + 1, 1, Math.max(1, 25 - cols));
|
|
155
|
+
var rowStart = clamp(y + 1, 1, Infinity);
|
|
156
|
+
var rowEnd = clamp(rows + rowStart, rowStart + 1, Infinity);
|
|
157
|
+
var colEnd = clamp(colStart + cols, colStart + 1, 25);
|
|
158
|
+
return {
|
|
159
|
+
rowStart: rowStart,
|
|
160
|
+
colStart: colStart,
|
|
161
|
+
rowEnd: rowEnd,
|
|
162
|
+
colEnd: colEnd
|
|
163
|
+
};
|
|
164
|
+
// const startXMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX:MOBILE'];
|
|
165
|
+
// const startYMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE'];
|
|
166
|
+
// const colsMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE'];
|
|
167
|
+
// const rowsMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'];
|
|
168
|
+
// const colStart = clamp(startXMobile + 1, 1, Math.max(1, 9 - colsMobile));
|
|
169
|
+
// const rowStart = clamp(startYMobile + 1, 1, Infinity);
|
|
170
|
+
// const rowEnd = clamp(rowsMobile + rowStart, rowStart + 1, Infinity);
|
|
171
|
+
// const colEnd = clamp(colStart + colsMobile, colStart + 1, 9);
|
|
172
|
+
// return `${rowStart} / ${colStart} / ${rowEnd} / ${colEnd}`;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* grid-area 문자열을 파싱하여 객체로 변환합니다.
|
|
176
|
+
* 예: "1 / 2 / 3 / 4" => { rowStart: 1, colStart: 2, rowEnd: 3, colEnd: 4 }
|
|
177
|
+
*/
|
|
178
|
+
function parseGridArea(gridArea) {
|
|
179
|
+
var _a = gridArea
|
|
180
|
+
.split('/')
|
|
181
|
+
.map(function (str) { return parseInt(str.trim(), 10); }), rowStart = _a[0], colStart = _a[1], rowEnd = _a[2], colEnd = _a[3];
|
|
182
|
+
return { rowStart: rowStart, colStart: colStart, rowEnd: rowEnd, colEnd: colEnd };
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* 부모 그룹 영역을 기준으로 컴포넌트의 상대적 위치를 계산합니다.
|
|
186
|
+
* 예: 부모가 row 21에서 시작하고 컴포넌트가 row 21에 있다면, 상대적으로는 row 1에 위치하게 됩니다.
|
|
187
|
+
*/
|
|
188
|
+
function calculateRelativeGridArea(componentArea, parentArea) {
|
|
189
|
+
return {
|
|
190
|
+
// 컴포넌트의 시작 위치에서 부모의 시작 위치를 빼서 상대적 위치 계산
|
|
191
|
+
rowStart: componentArea.rowStart - parentArea.rowStart + 1,
|
|
192
|
+
colStart: componentArea.colStart - parentArea.colStart + 1,
|
|
193
|
+
// 상대적 끝 위치도 같은 방식으로 계산
|
|
194
|
+
rowEnd: componentArea.rowEnd - parentArea.rowStart + 1,
|
|
195
|
+
colEnd: componentArea.colEnd - parentArea.colStart + 1
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function getMaxHeight(props, rowHeight) {
|
|
199
|
+
var gap = 10;
|
|
200
|
+
var rows = props.rows;
|
|
201
|
+
var height = rows * rowHeight + (rows - 1) * gap;
|
|
202
|
+
return height;
|
|
203
|
+
// if (device === 'DESKTOP') {
|
|
204
|
+
// const { rows } = props;
|
|
205
|
+
// const height = rows * rowHeight + (rows - 1) * gap;
|
|
206
|
+
// return height;
|
|
207
|
+
// }
|
|
208
|
+
// const rowsMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'];
|
|
209
|
+
// const height = rowsMobile * rowHeight + (rowsMobile - 1) * gap;
|
|
210
|
+
// return height;
|
|
211
|
+
}
|
|
212
|
+
var S_GroupItem = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n box-shadow: ", ";\n gap: 10px;\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: ", ";\n pointer-events: none;\n position: relative; /* \uBC30\uC5F4\uC744 \uACF5\uBC31\uC73C\uB85C \uAD6C\uBD84\uB41C \uBB38\uC790\uC5F4\uB85C \uD569\uCE69\uB2C8\uB2E4. */\n"], ["\n box-shadow: ", ";\n gap: 10px;\n grid-template-columns: repeat(", ", 1fr);\n grid-template-rows: ", ";\n pointer-events: none;\n position: relative; /* \uBC30\uC5F4\uC744 \uACF5\uBC31\uC73C\uB85C \uAD6C\uBD84\uB41C \uBB38\uC790\uC5F4\uB85C \uD569\uCE69\uB2C8\uB2E4. */\n"])), function (props) { return (props.isEditMode ? '0 0 0 2px blue' : 'none'); }, function (props) { return props.cols; }, function (props) {
|
|
213
|
+
// // 전체 행 개수만큼 배열을 생성하여 각 행의 CSS 값을 정의합니다.
|
|
214
|
+
return Array.from({ length: props.sectionRow })
|
|
215
|
+
.map(function (_, index) {
|
|
216
|
+
// props로 받은 selectedRows 배열에 현재 행(index)이 포함되어 있는지 확인합니다.
|
|
217
|
+
return props.selectedRows.includes(index)
|
|
218
|
+
? "minmax(".concat(props.rowHeight, "px, auto)") // 포함되어 있다면 minmax 사용
|
|
219
|
+
: "".concat(props.rowHeight, "px");
|
|
220
|
+
} // 포함되어 있지 않다면 고정 높이 사용
|
|
221
|
+
)
|
|
222
|
+
.join(' ');
|
|
223
|
+
});
|
|
224
|
+
var templateObject_1, templateObject_2;
|
package/package.json
CHANGED
|
File without changes
|