pds-dev-kit-web-test 2.7.392 → 2.7.393
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.
|
@@ -74,33 +74,33 @@ var MOBILE_GRID_COLS = 8;
|
|
|
74
74
|
var GLE_MIN_WIDTH_DESKTOP_PX = "".concat(GRID_CELL_MIN * DESKTOP_GRID_COLS, "px");
|
|
75
75
|
var GLE_MIN_WIDTH_MOBILE_PX = "".concat(GRID_CELL_MIN * MOBILE_GRID_COLS, "px");
|
|
76
76
|
var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
77
|
-
var _a, _b, _c, _d
|
|
78
|
-
var
|
|
77
|
+
var _a, _b, _c, _d;
|
|
78
|
+
var _e = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _e.device, editingSectionId = _e.editingSectionId, mode = _e.mode, shortcutKeyMode = _e.shortcutKeyMode, zoomScale = _e.zoomScale, placementRestriction = _e.placementRestriction, sectionActionHandler = _e.sectionActionHandler;
|
|
79
79
|
var componentBlocks = props.componentBlocks, jsonProperties = props.jsonProperties;
|
|
80
80
|
var sectionPedigree = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree;
|
|
81
|
-
var
|
|
81
|
+
var _f = (0, react_1.useState)(sectionPedigree), pedigreeState = _f[0], setPedigreeState = _f[1];
|
|
82
82
|
(0, react_1.useEffect)(function () {
|
|
83
83
|
setPedigreeState(sectionPedigree);
|
|
84
84
|
}, [sectionPedigree]);
|
|
85
|
-
var
|
|
85
|
+
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;
|
|
86
86
|
var colsDesktop = (_a = CB_PLACEMENT_PROP_SECTION.CB_PLACEMENT_PROP_SECTION_SPEC_COLS) !== null && _a !== void 0 ? _a : 24;
|
|
87
87
|
var colsMobile = (_b = CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_COLS:MOBILE']) !== null && _b !== void 0 ? _b : 8;
|
|
88
|
-
var
|
|
88
|
+
var _j = (0, react_1.useState)(null), selectedBlockId = _j[0], setSelectedBlockId = _j[1];
|
|
89
89
|
var gleRef = (0, react_1.useRef)(null);
|
|
90
|
-
var
|
|
91
|
-
var
|
|
90
|
+
var _k = (0, react_1.useState)(50), rowHeight = _k[0], setRowHeight = _k[1];
|
|
91
|
+
var _l = (0, react_1.useState)(16), baseFontSize = _l[0], setBaseFontSize = _l[1];
|
|
92
92
|
var isMobile = device === 'MOBILE';
|
|
93
93
|
var isEditMode = mode === 'EDIT';
|
|
94
94
|
var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
|
|
95
|
-
var
|
|
95
|
+
var _m = (0, react_1.useState)(function () {
|
|
96
96
|
var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders, placementRestriction), lg = _a.lg, sm = _a.sm;
|
|
97
97
|
return {
|
|
98
98
|
lg: lg,
|
|
99
99
|
sm: sm
|
|
100
100
|
};
|
|
101
|
-
}), layouts =
|
|
102
|
-
var
|
|
103
|
-
var
|
|
101
|
+
}), layouts = _m[0], setLayouts = _m[1];
|
|
102
|
+
var _o = (0, react_1.useState)('ROOT'), editingGroupBlock = _o[0], setEditingGroupBlock = _o[1];
|
|
103
|
+
var _p = (0, react_1.useState)([]), bulkBlockIds = _p[0], setBulkBlockIds = _p[1];
|
|
104
104
|
(0, react_1.useEffect)(function () {
|
|
105
105
|
if (editingGroupBlock) {
|
|
106
106
|
var found = (0, group_1.findBlockByBlockId)(sectionPedigree, editingGroupBlock);
|
|
@@ -388,10 +388,10 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
388
388
|
});
|
|
389
389
|
return __spreadArray(__spreadArray([], collisions, true), [(0, group_1.formatCbIdToBlockId)(cdId1)], false);
|
|
390
390
|
};
|
|
391
|
-
var
|
|
391
|
+
var _q = (0, util_1.parseCustomSectionPlacement)({
|
|
392
392
|
isMobile: isMobile,
|
|
393
393
|
customSectionProps: CB_PLACEMENT_PROP_SECTION
|
|
394
|
-
}), rows =
|
|
394
|
+
}), rows = _q.rows, width = _q.width, minHeight = _q.minHeight, isFullWidth = _q.isFullWidth;
|
|
395
395
|
var customSectionStyles = {
|
|
396
396
|
minHeight: "".concat(minHeight, "vh"),
|
|
397
397
|
width: '100%',
|
|
@@ -1051,7 +1051,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
1051
1051
|
paddingBottom: padding.bottom,
|
|
1052
1052
|
paddingRight: padding.right,
|
|
1053
1053
|
paddingLeft: padding.left
|
|
1054
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ selectedBlockId:
|
|
1054
|
+
} }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ selectedBlockId: selectedBlockId !== null && selectedBlockId !== void 0 ? selectedBlockId : '', sectionId: props.id.toString(), innerRef: innerRef, className: (0, clsx_1.clsx)({
|
|
1055
1055
|
'selected-grid-layout': editingSectionId === props.id
|
|
1056
1056
|
}), allowOverlap: true, layouts: layouts, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: breakpoints, breakpoint: breakpoint, cols: { lg: colsDesktop, sm: colsMobile }, rowHeight: rowHeight, margin: [10, 10], style: {
|
|
1057
1057
|
width: customSectionStyles.width,
|
|
@@ -1060,7 +1060,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
|
1060
1060
|
fontSize: "".concat(baseFontSize, "px")
|
|
1061
1061
|
}, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onResizeStop: onResizeStop, onDragStopForGroup: onBulkDragStop, onFitToContent: onAutoFitContent, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode, zoom: zoomScale,
|
|
1062
1062
|
// GROUP
|
|
1063
|
-
selectedGroupBlock: (
|
|
1063
|
+
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) {
|
|
1064
1064
|
var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
|
|
1065
1065
|
var isInBulk = bulkBlockIds.includes((0, group_1.formatCbIdToBlockId)(Number(each.i)));
|
|
1066
1066
|
if (!matchedCB) {
|