pds-dev-kit-web-test 2.2.85 → 2.2.86

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.
@@ -63,7 +63,9 @@ function Text(props) {
63
63
  var hasEffect = !isNoneEffectType;
64
64
  var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
65
65
  var baseFontSize = (0, useMaxFontAdjustment_1.default)(cbRef, textStyle.fontSize, mode);
66
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box cb-text-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), effectCssProperties), layoutStyle), { cursor: CLINKCursor, paddingTop: 0, paddingBottom: 0, paddingLeft: 0, paddingRight: 0, fontSize: baseFontSize }), hoverStyle: __assign(__assign({}, textHoverStyle), propsHoverStyle), onClick: onClickCLINK }, { children: (0, jsx_runtime_1.jsx)(S_TextContent, __assign({ className: "cb-text-content", style: {
66
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle, style: {
67
+ fontSize: "".concat(baseFontSize, "px")
68
+ } }, { children: (0, jsx_runtime_1.jsx)(S_CB_Box_1.S_CB_Box, __assign({ className: "cb-layout-box cb-text-box", normalStyle: __assign(__assign(__assign(__assign(__assign({}, textStyle), propsStyle), effectCssProperties), layoutStyle), { cursor: CLINKCursor, paddingTop: 0, paddingBottom: 0, paddingLeft: 0, paddingRight: 0 }), hoverStyle: __assign(__assign({}, textHoverStyle), propsHoverStyle), onClick: onClickCLINK }, { children: (0, jsx_runtime_1.jsx)(S_TextContent, __assign({ className: "cb-text-content", style: {
67
69
  whiteSpace: 'pre-wrap',
68
70
  wordBreak: 'break-word',
69
71
  height: 'fit-content',
@@ -1,3 +1,3 @@
1
1
  import type { DynamicLayoutProps } from '../../../../../../../DynamicLayout/types';
2
- declare const useMaxFontAdjustment: (ref: any, defaultSize: string, mode: DynamicLayoutProps['mode']) => string;
2
+ declare const useMaxFontAdjustment: (ref: any, defaultSize: string, mode: DynamicLayoutProps['mode']) => number;
3
3
  export default useMaxFontAdjustment;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var react_1 = require("react");
4
+ var DEFAULT_BASE_FONT = 16;
4
5
  var useMaxFontAdjustment = function (ref, defaultSize, mode) {
5
- var _a = (0, react_1.useState)(defaultSize), fontSize = _a[0], setFontSize = _a[1];
6
+ var _a = (0, react_1.useState)(DEFAULT_BASE_FONT), fontSize = _a[0], setFontSize = _a[1];
6
7
  (0, react_1.useEffect)(function () {
7
8
  if (mode !== 'PREVIEW') {
8
9
  return;
@@ -15,13 +16,14 @@ var useMaxFontAdjustment = function (ref, defaultSize, mode) {
15
16
  var contentHeight = object.target.children[0].children[0].clientHeight;
16
17
  var isOverflow = contentHeight > height;
17
18
  if (isOverflow) {
18
- setFontSize(function (prev) {
19
- var value = parseEmToNumber(prev);
20
- if (value === null) {
21
- return prev;
22
- }
23
- return "".concat((value - 0.3).toFixed(3), "em");
24
- });
19
+ setFontSize(function (prev) { return prev - 0.3; });
20
+ // setFontSize((prev) => {
21
+ // const value = parseEmToNumber(prev);
22
+ // if (value === null) {
23
+ // return prev;
24
+ // }
25
+ // return `${(value - 0.3).toFixed(3)}em`;
26
+ // });
25
27
  }
26
28
  });
27
29
  resizeObserver.observe(ref.current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.2.85",
3
+ "version": "2.2.86",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",