pds-dev-kit-web-test 2.5.206 → 2.5.208
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.
@@ -73,38 +73,43 @@ var MOBILE_GRID_COLS = 8;
|
|
73
73
|
var GLE_MIN_WIDTH_DESKTOP_PX = "".concat(GRID_CELL_MIN * DESKTOP_GRID_COLS, "px");
|
74
74
|
var GLE_MIN_WIDTH_MOBILE_PX = "".concat(GRID_CELL_MIN * MOBILE_GRID_COLS, "px");
|
75
75
|
var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
76
|
-
var _a, _b, _c;
|
77
|
-
var
|
76
|
+
var _a, _b, _c, _d;
|
77
|
+
var _e = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _e.device, editingSectionId = _e.editingSectionId, mode = _e.mode, shortcutKeyMode = _e.shortcutKeyMode, sectionActionHandler = _e.sectionActionHandler, zoomScale = _e.zoomScale;
|
78
78
|
var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
|
79
79
|
var sectionPedigree = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree;
|
80
|
-
var
|
80
|
+
var _f = (0, react_1.useState)(sectionPedigree), pedigreeState = _f[0], setPedigreeState = _f[1];
|
81
81
|
(0, react_1.useEffect)(function () {
|
82
82
|
setPedigreeState(sectionPedigree);
|
83
83
|
}, [sectionPedigree]);
|
84
|
-
var
|
84
|
+
var _g = jsonProperties, _h = _g.data, CB_PLACEMENT_PROP_SECTION = _h.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _h.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _h.CB_CONTENT_PROP_SECTION, zOrders = _g.zOrders;
|
85
85
|
var colsDesktop = (_a = CB_PLACEMENT_PROP_SECTION.CB_PLACEMENT_PROP_SECTION_SPEC_COLS) !== null && _a !== void 0 ? _a : 24;
|
86
86
|
var colsMobile = (_b = CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_COLS:MOBILE']) !== null && _b !== void 0 ? _b : 8;
|
87
|
-
var
|
87
|
+
var _j = (0, react_1.useState)(null), selectedBlockId = _j[0], setSelectedBlockId = _j[1];
|
88
88
|
var gleRef = (0, react_1.useRef)(null);
|
89
|
-
var
|
90
|
-
var
|
89
|
+
var _k = (0, react_1.useState)(50), rowHeight = _k[0], setRowHeight = _k[1];
|
90
|
+
var _l = (0, react_1.useState)(16), baseFontSize = _l[0], setBaseFontSize = _l[1];
|
91
91
|
var isMobile = device === 'MOBILE';
|
92
92
|
var isEditMode = mode === 'EDIT';
|
93
93
|
var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
|
94
|
-
var
|
94
|
+
var _m = (0, react_1.useState)(function () {
|
95
95
|
var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders), lg = _a.lg, sm = _a.sm;
|
96
96
|
return {
|
97
97
|
lg: lg,
|
98
98
|
sm: sm
|
99
99
|
};
|
100
|
-
}), layouts =
|
101
|
-
var
|
102
|
-
var
|
100
|
+
}), layouts = _m[0], setLayouts = _m[1];
|
101
|
+
var _o = (0, react_1.useState)('ROOT'), editingGroupBlock = _o[0], setEditingGroupBlock = _o[1];
|
102
|
+
var _p = (0, react_1.useState)([]), bulkBlockIds = _p[0], setBulkBlockIds = _p[1];
|
103
103
|
(0, react_1.useEffect)(function () {
|
104
104
|
if (editingGroupBlock) {
|
105
105
|
var found = (0, group_1.findBlockByBlockId)(sectionPedigree, editingGroupBlock);
|
106
106
|
if (!found) {
|
107
107
|
setEditingGroupBlock('ROOT');
|
108
|
+
return;
|
109
|
+
}
|
110
|
+
if (found.type === 'GROUP_BLOCK' && found.children.length === 0) {
|
111
|
+
setEditingGroupBlock('ROOT');
|
112
|
+
return;
|
108
113
|
}
|
109
114
|
}
|
110
115
|
}, [editingGroupBlock, sectionPedigree]);
|
@@ -151,9 +156,8 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
151
156
|
setBulkBlockIds([]);
|
152
157
|
}
|
153
158
|
}, [editingSectionId]);
|
159
|
+
var workDir = (_c = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _c !== void 0 ? _c : '/ROOT';
|
154
160
|
(0, react_1.useEffect)(function () {
|
155
|
-
var _a;
|
156
|
-
var workDir = (_a = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _a !== void 0 ? _a : 'ROOT';
|
157
161
|
sectionActionHandler &&
|
158
162
|
sectionActionHandler({
|
159
163
|
type: '@CUSTOMSECTION/WORKDIR_CHANGED',
|
@@ -161,7 +165,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
161
165
|
workDir: workDir
|
162
166
|
}
|
163
167
|
});
|
164
|
-
}, [
|
168
|
+
}, [workDir]);
|
165
169
|
// NOTE: 추후에 event를 외부에서 전달받게하거나, 아예 상태를 끌어올리거나 해야합니다.
|
166
170
|
(0, react_1.useLayoutEffect)(function () {
|
167
171
|
var _a, _b, _c, _d, _e, _f;
|
@@ -373,10 +377,10 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
373
377
|
});
|
374
378
|
return __spreadArray(__spreadArray([], collisions, true), [(0, group_1.formatCbIdToBlockId)(cdId1)], false);
|
375
379
|
};
|
376
|
-
var
|
380
|
+
var _q = (0, util_1.parseCustomSectionPlacement)({
|
377
381
|
isMobile: isMobile,
|
378
382
|
customSectionProps: CB_PLACEMENT_PROP_SECTION
|
379
|
-
}), rows =
|
383
|
+
}), rows = _q.rows, width = _q.width, minHeight = _q.minHeight, isFullWidth = _q.isFullWidth;
|
380
384
|
var customSectionStyles = {
|
381
385
|
minHeight: "".concat(minHeight, "vh"),
|
382
386
|
width: '100%',
|
@@ -979,7 +983,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
979
983
|
fontSize: "".concat(baseFontSize, "px")
|
980
984
|
}, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onResizeStop: onResizeStop, onDragStopForGroup: onBulkDragStop, onFitToContent: onAutoFitContent, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode, zoom: zoomScale,
|
981
985
|
// GROUP
|
982
|
-
selectedGroupBlock: (
|
986
|
+
selectedGroupBlock: (_d = selectedBlockId === null || selectedBlockId === void 0 ? void 0 : selectedBlockId.toString()) !== null && _d !== void 0 ? _d : 'ROOT', editingGroupBlock: editingGroupBlock, blockStructure: newblock, bulkIds: bulkBlockIds, onDoubleClickGroup: onDoubleClickGroup, onClickGroup: onClickGroup, onDoubleClickOutsideGroup: onDoubleClickOutsideGroup, onContextGroup: onContextGroup }, { children: layouts[layoutByDevice].map(function (each, index) {
|
983
987
|
var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
|
984
988
|
var isInBulk = bulkBlockIds.includes((0, group_1.formatCbIdToBlockId)(Number(each.i)));
|
985
989
|
if (!matchedCB) {
|