pds-dev-kit-web-test 2.2.78 → 2.2.80

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.
@@ -353,16 +353,22 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
353
353
  }
354
354
  });
355
355
  };
356
- var onWidthChange = function (width) {
356
+ var onWidthChange = function (width, _a) {
357
+ var _b, _c;
358
+ var marginL = _a[0], marginR = _a[1];
359
+ var viewport = width + ((_b = padding === null || padding === void 0 ? void 0 : padding.left) !== null && _b !== void 0 ? _b : 0) + ((_c = padding === null || padding === void 0 ? void 0 : padding.right) !== null && _c !== void 0 ? _c : 0);
357
360
  if (device === 'MOBILE') {
358
- var cellWidth_1 = width / MOBILE_GRID_COLS;
361
+ var cellWidth_1 = viewport / MOBILE_GRID_COLS;
362
+ var magicNumber = Math.pow(cellWidth_1, 1.5);
363
+ var resSize = magicNumber / 20;
364
+ // const mobileBaseFontSize = Math.min(resSize, 16);
359
365
  setRowHeight(cellWidth_1 * 0.56);
360
- var mobileBaseFontSize = Math.min(cellWidth_1 / 2.35, 16);
361
- setBaseFontSize(mobileBaseFontSize);
366
+ setBaseFontSize(resSize);
367
+ console.log({ viewport: viewport, cellWidth: cellWidth_1, magicNumber: magicNumber, resSize: resSize });
362
368
  return;
363
369
  }
364
370
  var isSectionFontResponsive = !!(CB_CONTENT_PROP_SECTION === null || CB_CONTENT_PROP_SECTION === void 0 ? void 0 : CB_CONTENT_PROP_SECTION.CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE);
365
- var cellWidth = width / DESKTOP_GRID_COLS;
371
+ var cellWidth = viewport / DESKTOP_GRID_COLS;
366
372
  setRowHeight(cellWidth * 0.56);
367
373
  isSectionFontResponsive ? setBaseFontSize(cellWidth / 2.35) : setBaseFontSize(16);
368
374
  };
@@ -410,7 +416,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
410
416
  paddingLeft: padding.left
411
417
  } }, { 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: {
412
418
  width: customSectionStyles.width,
413
- maxWidth: customSectionStyles.maxWidth,
419
+ maxWidth: isMobile ? '512px' : customSectionStyles.maxWidth,
414
420
  minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
415
421
  fontSize: "".concat(baseFontSize, "px")
416
422
  }, onLayoutChange: onLayoutChange, onDragStop: onDragStop, onResizeStop: onResizeStop, onWidthChange: onWidthChange, minNbRow: rows, isDraggable: isEditMode, isResizable: isEditMode }, { children: keepSimilarOrderToPreventRerender(layouts[layoutByDevice]).map(function (each, index) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.2.78",
3
+ "version": "2.2.80",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",