pds-dev-kit-web-test 2.5.131 → 2.5.132
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,32 +74,34 @@ 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;
|
78
|
-
var
|
77
|
+
var _a, _b, _c;
|
78
|
+
var _d = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _d.device, editingSectionId = _d.editingSectionId, mode = _d.mode, shortcutKeyMode = _d.shortcutKeyMode, sectionActionHandler = _d.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 _e = (0, react_1.useState)(sectionPedigree), pedigreeState = _e[0], setPedigreeState = _e[1];
|
82
82
|
(0, react_1.useEffect)(function () {
|
83
83
|
setPedigreeState(sectionPedigree);
|
84
84
|
// setBlockIdMap(mapComponentBlockIdsToBlockIds(sectionPedigree));
|
85
85
|
}, [sectionPedigree]);
|
86
|
-
var
|
87
|
-
var
|
86
|
+
var _f = jsonProperties, _g = _f.data, CB_PLACEMENT_PROP_SECTION = _g.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _g.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _g.CB_CONTENT_PROP_SECTION, zOrders = _f.zOrders;
|
87
|
+
var colsDesktop = (_a = CB_PLACEMENT_PROP_SECTION.CB_PLACEMENT_PROP_SECTION_SPEC_COLS) !== null && _a !== void 0 ? _a : 24;
|
88
|
+
var colsMobile = (_b = CB_PLACEMENT_PROP_SECTION['CB_PLACEMENT_PROP_SECTION_SPEC_COLS:MOBILE']) !== null && _b !== void 0 ? _b : 8;
|
89
|
+
var _h = (0, react_1.useState)(null), selectedBlockId = _h[0], setSelectedBlockId = _h[1];
|
88
90
|
var gleRef = (0, react_1.useRef)(null);
|
89
|
-
var
|
90
|
-
var
|
91
|
+
var _j = (0, react_1.useState)(50), rowHeight = _j[0], setRowHeight = _j[1];
|
92
|
+
var _k = (0, react_1.useState)(16), baseFontSize = _k[0], setBaseFontSize = _k[1];
|
91
93
|
var isMobile = device === 'MOBILE';
|
92
94
|
var isEditMode = mode === 'EDIT';
|
93
95
|
var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
|
94
|
-
var
|
96
|
+
var _l = (0, react_1.useState)(function () {
|
95
97
|
var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders), lg = _a.lg, sm = _a.sm;
|
96
98
|
return {
|
97
99
|
lg: lg,
|
98
100
|
sm: sm
|
99
101
|
};
|
100
|
-
}), layouts =
|
101
|
-
var
|
102
|
-
var
|
102
|
+
}), layouts = _l[0], setLayouts = _l[1];
|
103
|
+
var _m = (0, react_1.useState)('ROOT'), editingGroupBlock = _m[0], setEditingGroupBlock = _m[1];
|
104
|
+
var _o = (0, react_1.useState)([]), bulkBlockIds = _o[0], setBulkBlockIds = _o[1];
|
103
105
|
var newblock = bulkBlockIds.length > 0
|
104
106
|
? (0, group_1.addBulkToTarget)(pedigreeState, editingGroupBlock, bulkBlockIds)
|
105
107
|
: pedigreeState;
|
@@ -289,10 +291,10 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
289
291
|
});
|
290
292
|
return __spreadArray(__spreadArray([], collisions, true), [(0, group_1.formatCbIdToBlockId)(cdId1)], false);
|
291
293
|
};
|
292
|
-
var
|
294
|
+
var _p = (0, util_1.parseCustomSectionPlacement)({
|
293
295
|
isMobile: isMobile,
|
294
296
|
customSectionProps: CB_PLACEMENT_PROP_SECTION
|
295
|
-
}), rows =
|
297
|
+
}), rows = _p.rows, width = _p.width, minHeight = _p.minHeight, isFullWidth = _p.isFullWidth;
|
296
298
|
var customSectionStyles = {
|
297
299
|
minHeight: "".concat(minHeight, "vh"),
|
298
300
|
width: '100%',
|
@@ -824,14 +826,14 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
|
|
824
826
|
paddingBottom: padding.bottom,
|
825
827
|
paddingRight: padding.right,
|
826
828
|
paddingLeft: padding.left
|
827
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ innerRef: innerRef, allowOverlap: true, layouts: layouts, resizeHandles: ['nw', 'e', 'n', 'ne', 's', 'se', 'sw', 'w'], breakpoints: breakpoints, breakpoint: breakpoint, cols: { lg:
|
829
|
+
} }, { children: (0, jsx_runtime_1.jsx)(Responsive, __assign({ innerRef: innerRef, 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: {
|
828
830
|
width: customSectionStyles.width,
|
829
831
|
maxWidth: customSectionStyles.maxWidth,
|
830
832
|
minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
|
831
833
|
fontSize: "".concat(baseFontSize, "px")
|
832
834
|
}, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onResizeStop: onResizeStop, onDragStopForGroup: onGroupDragStop, onFitToContent: onAutoFitContent, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode,
|
833
835
|
// GROUP
|
834
|
-
selectedGroupBlock: (
|
836
|
+
selectedGroupBlock: (_c = selectedBlockId === null || selectedBlockId === void 0 ? void 0 : selectedBlockId.toString()) !== null && _c !== void 0 ? _c : 'ROOT', editingGroupBlock: editingGroupBlock, blockStructure: newblock, bulkIds: bulkBlockIds, onDoubleClickGroup: onDoubleClickGroup, onClickGroup: onClickGroup, onDoubleClickOutsideGroup: onDoubleClickOutsideGroup, onContextGroup: onContextGroup }, { children: layouts[layoutByDevice].map(function (each, index) {
|
835
837
|
var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
|
836
838
|
var isInBulk = bulkBlockIds.includes((0, group_1.formatCbIdToBlockId)(Number(each.i)));
|
837
839
|
if (!matchedCB) {
|
@@ -319,6 +319,8 @@ export type ISectionJsonProperties = {
|
|
319
319
|
'CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE': number | null | undefined;
|
320
320
|
CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH: number;
|
321
321
|
'CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE': number | null | undefined;
|
322
|
+
CB_PLACEMENT_PROP_SECTION_SPEC_COLS?: number;
|
323
|
+
'CB_PLACEMENT_PROP_SECTION_SPEC_COLS:MOBILE': number | null | undefined;
|
322
324
|
};
|
323
325
|
CB_STYLE_PROP_BGCOLOR?: CB_STYLE_PROP_BGCOLOR_SPECS;
|
324
326
|
CB_STYLE_PROP_BGMEDIA?: CB_STYLE_PROP_BGMEDIA_SPECS;
|