11import {
2- ShapeUtil ,
3- Rectangle2d ,
2+ BaseBoxShapeUtil ,
43 HTMLContainer ,
54 TLBaseShape ,
65 useEditor ,
76 DefaultColorStyle ,
87 Editor ,
9- TLOnResizeHandler ,
10- resizeBox ,
118 createShapeId ,
129 TLDefaultHorizontalAlignStyle ,
1310 TLDefaultVerticalAlignStyle ,
@@ -167,7 +164,7 @@ export type DiscourseNodeShape = TLBaseShape<
167164 fontFamily : TLDefaultFontStyle ;
168165 }
169166> ;
170- export class BaseDiscourseNodeUtil extends ShapeUtil < DiscourseNodeShape > {
167+ export class BaseDiscourseNodeUtil extends BaseBoxShapeUtil < DiscourseNodeShape > {
171168 type : string ;
172169
173170 constructor ( editor : Editor , type : string ) {
@@ -190,14 +187,6 @@ export class BaseDiscourseNodeUtil extends ShapeUtil<DiscourseNodeShape> {
190187 override canResize = ( ) => true ;
191188 override canBind = ( ) => true ;
192189 override canEdit = ( ) => true ;
193- getGeometry ( shape : DiscourseNodeShape ) {
194- return new Rectangle2d ( {
195- width : shape . props . w ,
196- height : shape . props . h ,
197- isFilled : true ,
198- } ) ;
199- }
200-
201190 getDefaultProps ( ) : DiscourseNodeShape [ "props" ] {
202191 return {
203192 // opacity: "1" as DiscourseNodeShape["props"]["opacity"],
@@ -419,10 +408,6 @@ export class BaseDiscourseNodeUtil extends ShapeUtil<DiscourseNodeShape> {
419408 ) ;
420409 }
421410
422- override onResize : TLOnResizeHandler < DiscourseNodeShape > = ( shape , info ) => {
423- return resizeBox ( shape , info ) ;
424- } ;
425-
426411 indicator ( shape : DiscourseNodeShape ) {
427412 const { bounds } = this . editor . getShapeGeometry ( shape ) ;
428413 return (
0 commit comments