Skip to content

Commit 5f83193

Browse files
authored
Merge pull request #779 from creativoma/feature/decrease-paragraph-min-width-656
Feat/decrease paragraph min width
2 parents 17e2634 + a380a3d commit 5f83193

File tree

7 files changed

+12
-6
lines changed

7 files changed

+12
-6
lines changed

src/common/components/mock-components/front-components/input-shape.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
88
import { useGroupShapeProps } from '../mock-components.utils';
99

1010
const inputShapeRestrictions: ShapeSizeRestrictions = {
11-
minWidth: 38,
11+
minWidth: INPUT_SHAPE.DEFAULT_MIN_WIDTH,
1212
minHeight: 38,
1313
maxWidth: -1,
1414
maxHeight: 38,

src/common/components/mock-components/front-components/shape.const.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const DEFAULT_TEXT_ALIGNMENT = 'left';
1919
const DEFAULT_DISABLED = false;
2020
const DEFAULT_CORNER_RADIUS_CHIP = 1000;
2121
const DEFAULT_FONT_SIZE_CHIP = 14;
22+
const DEFAULT_MIN_WIDTH = 10;
2223

2324
export interface DefaultStyleShape {
2425
DEFAULT_CORNER_RADIUS: number;
@@ -38,6 +39,7 @@ export interface DefaultStyleShape {
3839
DEFAULT_TEXT_DECORATION: string;
3940
DEFAULT_TEXT_ALIGNMENT: 'left' | 'center' | 'right';
4041
DEFAULT_DISABLED: boolean;
42+
DEFAULT_MIN_WIDTH: number;
4143
}
4244

4345
export const BASIC_SHAPE: DefaultStyleShape = {
@@ -58,6 +60,7 @@ export const BASIC_SHAPE: DefaultStyleShape = {
5860
DEFAULT_TEXT_DECORATION,
5961
DEFAULT_TEXT_ALIGNMENT,
6062
DEFAULT_DISABLED,
63+
DEFAULT_MIN_WIDTH,
6164
};
6265

6366
export const LOW_WIREFRAME_SHAPE = {
@@ -82,6 +85,7 @@ export const INPUT_SHAPE: DefaultStyleShape = {
8285
DEFAULT_TEXT_DECORATION,
8386
DEFAULT_TEXT_ALIGNMENT,
8487
DEFAULT_DISABLED,
88+
DEFAULT_MIN_WIDTH,
8589
};
8690

8791
//! maybe a function to calc max height base on the text
@@ -103,6 +107,7 @@ export const POSTIT_SHAPE: DefaultStyleShape = {
103107
DEFAULT_TEXT_DECORATION,
104108
DEFAULT_TEXT_ALIGNMENT,
105109
DEFAULT_DISABLED,
110+
DEFAULT_MIN_WIDTH,
106111
};
107112

108113
interface FontValues {
@@ -160,4 +165,5 @@ export const CHIP_SHAPE: DefaultStyleShape = {
160165
DEFAULT_TEXT_DECORATION,
161166
DEFAULT_TEXT_ALIGNMENT,
162167
DEFAULT_DISABLED,
168+
DEFAULT_MIN_WIDTH,
163169
};

src/common/components/mock-components/front-components/textarea-shape.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
88
import { useGroupShapeProps } from '../mock-components.utils';
99

1010
const textAreaShapeRestrictions: ShapeSizeRestrictions = {
11-
minWidth: 70,
11+
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
1212
minHeight: 44,
1313
maxWidth: -1,
1414
maxHeight: -1,

src/common/components/mock-components/front-low-wireframes-components/paragraph-scribbled-shape/paragraph-scribbled-shape.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { MIN_LINE_HEIGHT } from './paragraph-scribbled.const';
1010
import { calculateParagraphPaths } from './paragraph-scribbled.business';
1111

1212
const paragraphScribbledShapeRestrictions: ShapeSizeRestrictions = {
13-
minWidth: 100,
13+
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
1414
minHeight: MIN_LINE_HEIGHT,
1515
maxWidth: -1,
1616
maxHeight: -1,

src/common/components/mock-components/front-low-wireframes-components/text-scribbled-shape/text-scribbled-shape.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { calculatePath } from './text-scribbled.business';
99
import { fitSizeToShapeSizeRestrictions } from '@/common/utils/shapes';
1010

1111
const textScribbledShapeRestrictions: ShapeSizeRestrictions = {
12-
minWidth: 100,
12+
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
1313
minHeight: 45,
1414
maxWidth: -1,
1515
maxHeight: -1,

src/common/components/mock-components/front-text-components/paragraph-text-shape.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
88
import { useGroupShapeProps } from '../mock-components.utils';
99

1010
const paragraphSizeRestrictions: ShapeSizeRestrictions = {
11-
minWidth: 20,
11+
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
1212
minHeight: 20,
1313
maxWidth: -1,
1414
maxHeight: -1,

src/common/components/mock-components/front-text-components/smalltext-shape.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useGroupShapeProps } from '../mock-components.utils';
99
import { useResizeOnFontSizeChange } from './front-text-hooks/resize-fontsize-change.hook';
1010

1111
const smalltextSizeRestrictions: ShapeSizeRestrictions = {
12-
minWidth: 40,
12+
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
1313
minHeight: 20,
1414
maxWidth: -1,
1515
maxHeight: -1,

0 commit comments

Comments
 (0)