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

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,22 +353,23 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
353
353
  }
354
354
  });
355
355
  };
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);
356
+ var onWidthChange = function (width) {
357
+ var _a, _b;
358
+ var viewport = width + ((_a = padding === null || padding === void 0 ? void 0 : padding.left) !== null && _a !== void 0 ? _a : 0) + ((_b = padding === null || padding === void 0 ? void 0 : padding.right) !== null && _b !== void 0 ? _b : 0);
360
359
  if (device === 'MOBILE') {
361
360
  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);
361
+ var baseViewPort = 375;
362
+ var gap = baseViewPort - viewport;
363
+ if (gap > 0) {
364
+ var magicNumber = Math.pow((gap / 18), 1.1);
365
+ var resSize = 16 - magicNumber;
366
+ setBaseFontSize(resSize);
367
+ }
365
368
  setRowHeight(cellWidth_1 * 0.56);
366
- setBaseFontSize(resSize);
367
- console.log({ viewport: viewport, cellWidth: cellWidth_1, magicNumber: magicNumber, resSize: resSize });
368
369
  return;
369
370
  }
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);
371
371
  var cellWidth = viewport / DESKTOP_GRID_COLS;
372
+ 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);
372
373
  setRowHeight(cellWidth * 0.56);
373
374
  isSectionFontResponsive ? setBaseFontSize(cellWidth / 2.35) : setBaseFontSize(16);
374
375
  };
@@ -416,7 +417,7 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
416
417
  paddingLeft: padding.left
417
418
  } }, { 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: {
418
419
  width: customSectionStyles.width,
419
- maxWidth: isMobile ? '512px' : customSectionStyles.maxWidth,
420
+ maxWidth: isMobile ? '480' : customSectionStyles.maxWidth,
420
421
  minWidth: isMobile ? GLE_MIN_WIDTH_MOBILE_PX : GLE_MIN_WIDTH_DESKTOP_PX,
421
422
  fontSize: "".concat(baseFontSize, "px")
422
423
  }, 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.80",
3
+ "version": "2.2.82",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",