pds-dev-kit-web-test 2.5.130 → 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 _b = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _b.device, editingSectionId = _b.editingSectionId, mode = _b.mode, shortcutKeyMode = _b.shortcutKeyMode, sectionActionHandler = _b.sectionActionHandler;
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 _c = (0, react_1.useState)(sectionPedigree), pedigreeState = _c[0], setPedigreeState = _c[1];
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 _d = jsonProperties, _e = _d.data, CB_PLACEMENT_PROP_SECTION = _e.CB_PLACEMENT_PROP_SECTION, CB_LAYOUT_PROP_PADDING = _e.CB_LAYOUT_PROP_PADDING, CB_CONTENT_PROP_SECTION = _e.CB_CONTENT_PROP_SECTION, zOrders = _d.zOrders;
87
- var _f = (0, react_1.useState)(null), selectedBlockId = _f[0], setSelectedBlockId = _f[1];
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 _g = (0, react_1.useState)(50), rowHeight = _g[0], setRowHeight = _g[1];
90
- var _h = (0, react_1.useState)(16), baseFontSize = _h[0], setBaseFontSize = _h[1];
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 _j = (0, react_1.useState)(function () {
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 = _j[0], setLayouts = _j[1];
101
- var _k = (0, react_1.useState)('ROOT'), editingGroupBlock = _k[0], setEditingGroupBlock = _k[1];
102
- var _l = (0, react_1.useState)([]), bulkBlockIds = _l[0], setBulkBlockIds = _l[1];
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 _m = (0, util_1.parseCustomSectionPlacement)({
294
+ var _p = (0, util_1.parseCustomSectionPlacement)({
293
295
  isMobile: isMobile,
294
296
  customSectionProps: CB_PLACEMENT_PROP_SECTION
295
- }), rows = _m.rows, width = _m.width, minHeight = _m.minHeight, isFullWidth = _m.isFullWidth;
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%',
@@ -740,10 +742,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
740
742
  }
741
743
  return selectedBlockId ? [selectedBlockId, id] : [id];
742
744
  })();
743
- console.log('added', added);
744
- console.log('selectedBlockId', selectedBlockId);
745
- console.log('id', id);
746
- if (added.length === 1) {
745
+ if (bulkBlockIds.length === 0 && added.length === 1) {
747
746
  setSelectedBlockId(id);
748
747
  setBulkBlockIds([]);
749
748
  sectionActionHandler &&
@@ -827,14 +826,14 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
827
826
  paddingBottom: padding.bottom,
828
827
  paddingRight: padding.right,
829
828
  paddingLeft: padding.left
830
- } }, { 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: 24, sm: 8 }, rowHeight: rowHeight, margin: [10, 10], style: {
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: {
831
830
  width: customSectionStyles.width,
832
831
  maxWidth: customSectionStyles.maxWidth,
833
832
  minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
834
833
  fontSize: "".concat(baseFontSize, "px")
835
834
  }, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onResizeStop: onResizeStop, onDragStopForGroup: onGroupDragStop, onFitToContent: onAutoFitContent, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode,
836
835
  // GROUP
837
- selectedGroupBlock: (_a = selectedBlockId === null || selectedBlockId === void 0 ? void 0 : selectedBlockId.toString()) !== null && _a !== void 0 ? _a : 'ROOT', editingGroupBlock: editingGroupBlock, blockStructure: newblock, bulkIds: bulkBlockIds, onDoubleClickGroup: onDoubleClickGroup, onClickGroup: onClickGroup, onDoubleClickOutsideGroup: onDoubleClickOutsideGroup, onContextGroup: onContextGroup }, { children: layouts[layoutByDevice].map(function (each, index) {
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) {
838
837
  var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
839
838
  var isInBulk = bulkBlockIds.includes((0, group_1.formatCbIdToBlockId)(Number(each.i)));
840
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.130",
3
+ "version": "2.5.132",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",