Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
import { useGroupShapeProps } from '../mock-components.utils';

const inputShapeRestrictions: ShapeSizeRestrictions = {
minWidth: 38,
minWidth: INPUT_SHAPE.DEFAULT_MIN_WIDTH,
minHeight: 38,
maxWidth: -1,
maxHeight: 38,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const DEFAULT_TEXT_ALIGNMENT = 'left';
const DEFAULT_DISABLED = false;
const DEFAULT_CORNER_RADIUS_CHIP = 1000;
const DEFAULT_FONT_SIZE_CHIP = 14;
const DEFAULT_MIN_WIDTH = 10;

export interface DefaultStyleShape {
DEFAULT_CORNER_RADIUS: number;
Expand All @@ -38,6 +39,7 @@ export interface DefaultStyleShape {
DEFAULT_TEXT_DECORATION: string;
DEFAULT_TEXT_ALIGNMENT: 'left' | 'center' | 'right';
DEFAULT_DISABLED: boolean;
DEFAULT_MIN_WIDTH: number;
}

export const BASIC_SHAPE: DefaultStyleShape = {
Expand All @@ -58,6 +60,7 @@ export const BASIC_SHAPE: DefaultStyleShape = {
DEFAULT_TEXT_DECORATION,
DEFAULT_TEXT_ALIGNMENT,
DEFAULT_DISABLED,
DEFAULT_MIN_WIDTH,
};

export const LOW_WIREFRAME_SHAPE = {
Expand All @@ -82,6 +85,7 @@ export const INPUT_SHAPE: DefaultStyleShape = {
DEFAULT_TEXT_DECORATION,
DEFAULT_TEXT_ALIGNMENT,
DEFAULT_DISABLED,
DEFAULT_MIN_WIDTH,
};

//! maybe a function to calc max height base on the text
Expand All @@ -103,6 +107,7 @@ export const POSTIT_SHAPE: DefaultStyleShape = {
DEFAULT_TEXT_DECORATION,
DEFAULT_TEXT_ALIGNMENT,
DEFAULT_DISABLED,
DEFAULT_MIN_WIDTH,
};

interface FontValues {
Expand Down Expand Up @@ -160,4 +165,5 @@ export const CHIP_SHAPE: DefaultStyleShape = {
DEFAULT_TEXT_DECORATION,
DEFAULT_TEXT_ALIGNMENT,
DEFAULT_DISABLED,
DEFAULT_MIN_WIDTH,
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
import { useGroupShapeProps } from '../mock-components.utils';

const textAreaShapeRestrictions: ShapeSizeRestrictions = {
minWidth: 70,
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
minHeight: 44,
maxWidth: -1,
maxHeight: -1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { MIN_LINE_HEIGHT } from './paragraph-scribbled.const';
import { calculateParagraphPaths } from './paragraph-scribbled.business';

const paragraphScribbledShapeRestrictions: ShapeSizeRestrictions = {
minWidth: 100,
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
minHeight: MIN_LINE_HEIGHT,
maxWidth: -1,
maxHeight: -1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { calculatePath } from './text-scribbled.business';
import { fitSizeToShapeSizeRestrictions } from '@/common/utils/shapes';

const textScribbledShapeRestrictions: ShapeSizeRestrictions = {
minWidth: 100,
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
minHeight: 45,
maxWidth: -1,
maxHeight: -1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
import { useGroupShapeProps } from '../mock-components.utils';

const paragraphSizeRestrictions: ShapeSizeRestrictions = {
minWidth: 20,
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
minHeight: 20,
maxWidth: -1,
maxHeight: -1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useGroupShapeProps } from '../mock-components.utils';
import { useResizeOnFontSizeChange } from './front-text-hooks/resize-fontsize-change.hook';

const smalltextSizeRestrictions: ShapeSizeRestrictions = {
minWidth: 40,
minWidth: BASIC_SHAPE.DEFAULT_MIN_WIDTH,
minHeight: 20,
maxWidth: -1,
maxHeight: -1,
Expand Down