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

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,18 +353,20 @@ 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') {
360
+ var baseViewPort = 375;
361
+ var gap = baseViewPort - viewport;
361
362
  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);
363
+ if (gap > 0) {
364
+ var magicNumber = Math.pow((gap / 15), 1.1);
365
+ var resSize = 16 - magicNumber;
366
+ console.log(viewport, resSize);
367
+ setBaseFontSize(resSize);
368
+ }
365
369
  setRowHeight(cellWidth_1 * 0.56);
366
- setBaseFontSize(resSize);
367
- console.log({ viewport: viewport, cellWidth: cellWidth_1, magicNumber: magicNumber, resSize: resSize });
368
370
  return;
369
371
  }
370
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);
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.81",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",