pds-dev-kit-web-test 2.3.11 → 2.3.12

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.
@@ -61,14 +61,7 @@ type ActionHandlerPayload = {
61
61
  id: string;
62
62
  };
63
63
  '@CUSTOMSECTION/AUTO_RESIZED_TO_FIT_CONTENT': {
64
- layout: Layout;
65
- cb: {
66
- i: number;
67
- h: number;
68
- x: number;
69
- y: number;
70
- w: number;
71
- };
64
+ item: LayoutItem;
72
65
  };
73
66
  };
74
67
  type ActionMap<M extends {
@@ -320,6 +320,13 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
320
320
  });
321
321
  }
322
322
  };
323
+ var onFitToContent = function (item) {
324
+ sectionActionHandler &&
325
+ sectionActionHandler({
326
+ type: '@CUSTOMSECTION/AUTO_RESIZED_TO_FIT_CONTENT',
327
+ payload: { item: item }
328
+ });
329
+ };
323
330
  var onResizeStop = function (props) {
324
331
  var prev = props.prev, item = props.item;
325
332
  if (!isEditMode || !item) {
@@ -429,7 +436,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
429
436
  maxWidth: customSectionStyles.maxWidth,
430
437
  minWidth: isMobile ? exports.GLE_MIN_WIDTH_MOBILE_PX : exports.GLE_MIN_WIDTH_DESKTOP_PX,
431
438
  fontSize: "".concat(baseFontSize, "px")
432
- }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
439
+ }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, onFitToContent: onFitToContent, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
433
440
  var _a;
434
441
  if (each === null) {
435
442
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
@@ -443,7 +450,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
443
450
  e.stopPropagation();
444
451
  e.preventDefault();
445
452
  onContextMenuCB('group', e);
446
- } }, { children: (0, jsx_runtime_1.jsx)(WidthProvidedRGL, __assign({ cols: each.w, allowOverlap: true, layout: each.groupLayouts, rowHeight: rowHeight, containerPadding: [0, 0], margin: [exports.GUTTER, exports.GUTTER], isDraggable: false, isResizable: false, style: {
453
+ } }, { children: (0, jsx_runtime_1.jsx)(WidthProvidedRGL, __assign({ onFitToContent: onFitToContent, cols: each.w, allowOverlap: true, layout: each.groupLayouts, rowHeight: rowHeight, containerPadding: [0, 0], margin: [exports.GUTTER, exports.GUTTER], isDraggable: false, isResizable: false, style: {
447
454
  width: '100%'
448
455
  } }, { children: (_a = each.groupLayouts) === null || _a === void 0 ? void 0 : _a.map(function (layoutItem, index, array) {
449
456
  var matchedCB = componentBlocks === null || componentBlocks === void 0 ? void 0 : componentBlocks.find(function (cb) { return cb.id.toString() === layoutItem.i; });
@@ -48,7 +48,7 @@ function NewCustomSection() {
48
48
  // const placeholder = document.querySelector('.react-grid-placeholder')
49
49
  // placeholder.height = 100;
50
50
  }
51
- return ((0, jsx_runtime_1.jsx)(CustomSection_1.S_gleStyles, __assign({ style: { backgroundColor: 'white' } }, { children: (0, jsx_runtime_1.jsx)(ReactGridLayout_1.default, __assign({ layout: layout,
51
+ return ((0, jsx_runtime_1.jsx)(CustomSection_1.S_gleStyles, __assign({ style: { backgroundColor: 'white' } }, { children: (0, jsx_runtime_1.jsx)(ReactGridLayout_1.default, __assign({ layout: layout, onFitToContent: function () { return ({}); },
52
52
  // onLayoutChange={onLayoutChange}
53
53
  allowOverlap: true, margin: [50, 50], cols: 12, rowHeight: 30, width: 1200, resizeHandles: ['n', 'e', 'w', 'sw', 'se', 's', 'nw', 'ne'] }, { children: layout.map(function (item, index) { return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(MeasuredCB, { text: item.text, onSizeChange: function (size) { return onSizeChange(size, index); } }) }, item.i)); }) })) })));
54
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.3.11",
3
+ "version": "2.3.12",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "i18next-intervalplural-postprocessor": "^3.0.0",
23
23
  "lottie-react": "^2.3.1",
24
24
  "nuka-carousel": "^4.8.4",
25
- "publ-echo": "^0.0.84",
25
+ "publ-echo": "^0.0.85",
26
26
  "react-hook-form": "^7.28.1",
27
27
  "react-i18next": "^11.12.0",
28
28
  "react-measure": "^2.5.2",