pds-dev-kit-web-test 2.5.337 → 2.5.338

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.
@@ -70,42 +70,42 @@ var parseSectionPadding_1 = __importDefault(require("../sections/CustomSection/u
70
70
  var parseCompositionPlacement_1 = __importDefault(require("../sections/CustomSection/util/parseCompositionPlacement"));
71
71
  var Responsive = (0, publ_echo_1.WidthProvider)(publ_echo_1.ResponsiveGridEditor);
72
72
  var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas(props, ref) {
73
- var _a, _b, _c, _d, _e, _f;
74
- var _g = props.editorProps, device = _g.device, shortcutKeyMode = _g.shortcutKeyMode, compositionActionHandler = _g.compositionActionHandler;
73
+ var _a, _b, _c, _d;
74
+ var _e = props.editorProps, device = _e.device, shortcutKeyMode = _e.shortcutKeyMode, compositionActionHandler = _e.compositionActionHandler;
75
75
  // const GLE_MIN_WIDTH_DESKTOP_PX = `${GRID_CELL_MIN * cols}px`;
76
76
  // const GLE_MIN_WIDTH_MOBILE_PX = `${GRID_CELL_MIN * rows}px`;
77
77
  var editingSectionId = props.compositionData.id;
78
78
  var mode = 'EDIT';
79
- var _h = props.compositionData, componentBlocks = _h.componentBlocks, jsonProperties = _h.jsonProperties;
79
+ var _f = props.compositionData, componentBlocks = _f.componentBlocks, jsonProperties = _f.jsonProperties;
80
80
  var sectionPedigree = jsonProperties === null || jsonProperties === void 0 ? void 0 : jsonProperties.pedigree;
81
- var _j = (0, react_1.useState)(sectionPedigree), pedigreeState = _j[0], setPedigreeState = _j[1];
81
+ var _g = (0, react_1.useState)(sectionPedigree), pedigreeState = _g[0], setPedigreeState = _g[1];
82
82
  (0, react_1.useEffect)(function () {
83
83
  setPedigreeState(sectionPedigree);
84
84
  }, [sectionPedigree]);
85
- var _k = jsonProperties, _l = _k.data, CB_PLACEMENT_PROP_COMPOSITION = _l.CB_PLACEMENT_PROP_COMPOSITION, CB_LAYOUT_PROP_PADDING = _l.CB_LAYOUT_PROP_PADDING, zOrders = _k.zOrders;
86
- var _m = (0, react_1.useState)(null), selectedBlockId = _m[0], setSelectedBlockId = _m[1];
85
+ var _h = jsonProperties, _j = _h.data, CB_PLACEMENT_PROP_COMPOSITION = _j.CB_PLACEMENT_PROP_COMPOSITION, CB_LAYOUT_PROP_PADDING = _j.CB_LAYOUT_PROP_PADDING, zOrders = _h.zOrders;
86
+ var _k = (0, react_1.useState)(null), selectedBlockId = _k[0], setSelectedBlockId = _k[1];
87
87
  var gleRef = (0, react_1.useRef)(null);
88
- var _o = (0, react_1.useState)(50), rowHeight = _o[0], setRowHeight = _o[1];
89
- var _p = (0, react_1.useState)(16), baseFontSize = _p[0], setBaseFontSize = _p[1];
88
+ var _l = (0, react_1.useState)(50), rowHeight = _l[0], setRowHeight = _l[1];
89
+ var _m = (0, react_1.useState)(16), baseFontSize = _m[0], setBaseFontSize = _m[1];
90
90
  var isMobile = device === 'MOBILE';
91
91
  var isEditMode = mode === 'EDIT';
92
92
  var layoutByDevice = device === 'DESKTOP' ? 'lg' : 'sm';
93
- var colsDesktop = (_a = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLUMNS) !== null && _a !== void 0 ? _a : 24;
94
- var colsMobile = (_b = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLUMNS:MOBILE']) !== null && _b !== void 0 ? _b : 8;
95
- var rowsDesktop = (_c = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS) !== null && _c !== void 0 ? _c : 26;
96
- var rowsMobile = (_d = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS:MOBILE']) !== null && _d !== void 0 ? _d : 26;
93
+ var colsDesktop = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLUMNS;
94
+ var colsMobile = (_a = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_COLUMNS:MOBILE']) !== null && _a !== void 0 ? _a : colsDesktop;
95
+ var rowsDesktop = CB_PLACEMENT_PROP_COMPOSITION.CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS;
96
+ var rowsMobile = (_b = CB_PLACEMENT_PROP_COMPOSITION['CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS:MOBILE']) !== null && _b !== void 0 ? _b : rowsDesktop;
97
97
  var rows = isMobile ? rowsMobile : rowsDesktop;
98
98
  var cols = isMobile ? colsMobile : colsDesktop;
99
99
  var canvasWidth = 50 * cols;
100
- var _q = (0, react_1.useState)(function () {
100
+ var _o = (0, react_1.useState)(function () {
101
101
  var _a = (0, util_1.parsePlacement)(componentBlocks !== null && componentBlocks !== void 0 ? componentBlocks : [], zOrders), lg = _a.lg, sm = _a.sm;
102
102
  return {
103
103
  lg: lg,
104
104
  sm: sm
105
105
  };
106
- }), layouts = _q[0], setLayouts = _q[1];
107
- var _r = (0, react_1.useState)('ROOT'), editingGroupBlock = _r[0], setEditingGroupBlock = _r[1];
108
- var _s = (0, react_1.useState)([]), bulkBlockIds = _s[0], setBulkBlockIds = _s[1];
106
+ }), layouts = _o[0], setLayouts = _o[1];
107
+ var _p = (0, react_1.useState)('ROOT'), editingGroupBlock = _p[0], setEditingGroupBlock = _p[1];
108
+ var _q = (0, react_1.useState)([]), bulkBlockIds = _q[0], setBulkBlockIds = _q[1];
109
109
  (0, react_1.useEffect)(function () {
110
110
  if (editingGroupBlock) {
111
111
  var found = (0, group_1.findBlockByBlockId)(sectionPedigree, editingGroupBlock);
@@ -163,7 +163,7 @@ var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas
163
163
  setEditingGroupBlock('ROOT');
164
164
  }
165
165
  }, [editingSectionId]);
166
- var workDir = (_e = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _e !== void 0 ? _e : '/ROOT';
166
+ var workDir = (_c = (0, group_1.getBlockWorkDirPath)(newblock, editingGroupBlock)) !== null && _c !== void 0 ? _c : '/ROOT';
167
167
  (0, react_1.useEffect)(function () {
168
168
  compositionActionHandler &&
169
169
  compositionActionHandler({
@@ -397,10 +397,10 @@ var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas
397
397
  });
398
398
  return __spreadArray(__spreadArray([], collisions, true), [(0, group_1.formatCbIdToBlockId)(cdId1)], false);
399
399
  };
400
- var _t = (0, parseCompositionPlacement_1.default)({
400
+ var _r = (0, parseCompositionPlacement_1.default)({
401
401
  isMobile: isMobile,
402
402
  compositionProps: CB_PLACEMENT_PROP_COMPOSITION
403
- }), minHeight = _t.minHeight, maxWidth = _t.maxWidth, maxHeight = _t.maxHeight, minWidth = _t.minWidth;
403
+ }), minHeight = _r.minHeight, maxWidth = _r.maxWidth, maxHeight = _r.maxHeight, minWidth = _r.minWidth;
404
404
  var customSectionStyles = {
405
405
  minHeight: "".concat(minHeight, "px"),
406
406
  maxHeight: "".concat(maxHeight, "px"),
@@ -1071,7 +1071,7 @@ var CompositionEditor = (0, react_1.forwardRef)(function CompositionEditorCanvas
1071
1071
  fontSize: "".concat(baseFontSize, "px")
1072
1072
  }, onLayoutChange: onLayoutChange, onDragStart: onDragStart, onDragStop: onDragStop, onResizeStop: onResizeStop, onDragStopForGroup: onBulkDragStop, onFitToContent: onAutoFitContent, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode, zoom: props.editorProps.zoomScale,
1073
1073
  // GROUP
1074
- selectedGroupBlock: (_f = selectedBlockId === null || selectedBlockId === void 0 ? void 0 : selectedBlockId.toString()) !== null && _f !== void 0 ? _f : 'ROOT', editingGroupBlock: editingGroupBlock, blockStructure: newblock, bulkIds: bulkBlockIds, onDoubleClickGroup: onDoubleClickGroup, onClickGroup: onClickGroup, onDoubleClickOutsideGroup: onDoubleClickOutsideGroup, onContextGroup: onContextGroup }, { children: layouts[layoutByDevice].map(function (each, index) {
1074
+ 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) {
1075
1075
  var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === each.i; });
1076
1076
  var isInBulk = bulkBlockIds.includes((0, group_1.formatCbIdToBlockId)(Number(each.i)));
1077
1077
  if (!matchedCB) {
@@ -8,7 +8,7 @@ declare function parseCompositionPlacement({ isMobile, compositionProps }: Props
8
8
  maxHeight: number | null;
9
9
  minWidth: number | null;
10
10
  maxWidth: number | null;
11
- rows: number | null;
11
+ rows: number;
12
12
  columns: number;
13
13
  };
14
14
  export default parseCompositionPlacement;
@@ -422,7 +422,7 @@ export type ICompositionJsonProperties = {
422
422
  'CB_PLACEMENT_PROP_COMPOSITION_SPEC_MINHEIGHT:MOBILE': number | null;
423
423
  CB_PLACEMENT_PROP_COMPOSITION_SPEC_MINWIDTH: number | null;
424
424
  'CB_PLACEMENT_PROP_COMPOSITION_SPEC_MINWIDTH:MOBILE': number | null;
425
- CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS: number | null;
425
+ CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS: number;
426
426
  'CB_PLACEMENT_PROP_COMPOSITION_SPEC_ROWS:MOBILE': number | null;
427
427
  };
428
428
  CB_STYLE_PROP_BGCOLOR: CB_STYLE_PROP_BGCOLOR_SPECS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.337",
3
+ "version": "2.5.338",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",