diff --git a/src/common/components/mock-components/front-containers/modal-dialog-shape.tsx b/src/common/components/mock-components/front-containers/modal-dialog-shape.tsx index b1668c90..9a60be4e 100644 --- a/src/common/components/mock-components/front-containers/modal-dialog-shape.tsx +++ b/src/common/components/mock-components/front-containers/modal-dialog-shape.tsx @@ -4,6 +4,7 @@ import { ShapeSizeRestrictions, ShapeType } from '@/core/model'; import { ShapeProps } from '../shape.model'; import { fitSizeToShapeSizeRestrictions } from '@/common/utils/shapes/shape-restrictions'; import { useGroupShapeProps } from '../mock-components.utils'; +import { BASIC_SHAPE } from '../front-components/shape.const'; const modalDialogShapeSizeRestrictions: ShapeSizeRestrictions = { minWidth: 250, @@ -21,14 +22,14 @@ const shapeType: ShapeType = 'modalDialog'; export const ModalDialogContainer = forwardRef( (props, ref) => { - const { x, y, width, height, id, onSelected, ...shapeProps } = props; + const { x, y, width, height, id, onSelected, text, ...shapeProps } = props; const restrictedSize = fitSizeToShapeSizeRestrictions( modalDialogShapeSizeRestrictions, width, height ); const { width: restrictedWidth, height: restrictedHeight } = restrictedSize; - + const margin = 10; const titleBarHeight = 50; const commonGroupProps = useGroupShapeProps( @@ -61,6 +62,16 @@ export const ModalDialogContainer = forwardRef( strokeWidth={2} fill="lightgray" /> + {/* (X) */} diff --git a/src/pods/canvas/model/inline-editable.model.ts b/src/pods/canvas/model/inline-editable.model.ts index d4699523..a4f0cef0 100644 --- a/src/pods/canvas/model/inline-editable.model.ts +++ b/src/pods/canvas/model/inline-editable.model.ts @@ -35,6 +35,7 @@ const inlineEditableShapes = new Set([ 'timepickerinput', 'datepickerinput', 'browser', + 'modalDialog', ]); // Check if a shape type allows inline editing @@ -74,6 +75,7 @@ const shapeTypesWithDefaultText = new Set([ 'timepickerinput', 'datepickerinput', 'browser', + 'modalDialog', ]); // Map of ShapeTypes to their default text values @@ -110,6 +112,7 @@ const defaultTextValueMap: Partial> = { timepickerinput: 'hh:mm', datepickerinput: new Date().toLocaleDateString(), browser: 'https://example.com', + modalDialog: 'Title here...', }; export const generateDefaultTextValue = ( diff --git a/src/pods/canvas/shape-renderer/simple-container/modal-dialog-container.renderer.tsx b/src/pods/canvas/shape-renderer/simple-container/modal-dialog-container.renderer.tsx index 1c603e66..20c26e69 100644 --- a/src/pods/canvas/shape-renderer/simple-container/modal-dialog-container.renderer.tsx +++ b/src/pods/canvas/shape-renderer/simple-container/modal-dialog-container.renderer.tsx @@ -24,6 +24,8 @@ export const renderModalDialogContainer = ( onDragEnd={handleDragEnd(shape.id)} onTransform={handleTransform} onTransformEnd={handleTransform} + isEditable={shape.allowsInlineEdition} + text={shape.text} /> ); };