Skip to content
Merged
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
19 changes: 2 additions & 17 deletions apps/roam/src/components/canvas/DiscourseNodeUtil.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import {
ShapeUtil,
Rectangle2d,
BaseBoxShapeUtil,
HTMLContainer,
TLBaseShape,
useEditor,
DefaultColorStyle,
Editor,
TLOnResizeHandler,
resizeBox,
createShapeId,
TLDefaultHorizontalAlignStyle,
TLDefaultVerticalAlignStyle,
Expand Down Expand Up @@ -167,7 +164,7 @@ export type DiscourseNodeShape = TLBaseShape<
fontFamily: TLDefaultFontStyle;
}
>;
export class BaseDiscourseNodeUtil extends ShapeUtil<DiscourseNodeShape> {
export class BaseDiscourseNodeUtil extends BaseBoxShapeUtil<DiscourseNodeShape> {
type: string;

constructor(editor: Editor, type: string) {
Expand All @@ -190,14 +187,6 @@ export class BaseDiscourseNodeUtil extends ShapeUtil<DiscourseNodeShape> {
override canResize = () => true;
override canBind = () => true;
override canEdit = () => true;
getGeometry(shape: DiscourseNodeShape) {
return new Rectangle2d({
width: shape.props.w,
height: shape.props.h,
isFilled: true,
});
}

getDefaultProps(): DiscourseNodeShape["props"] {
return {
// opacity: "1" as DiscourseNodeShape["props"]["opacity"],
Expand Down Expand Up @@ -419,10 +408,6 @@ export class BaseDiscourseNodeUtil extends ShapeUtil<DiscourseNodeShape> {
);
}

override onResize: TLOnResizeHandler<DiscourseNodeShape> = (shape, info) => {
return resizeBox(shape, info);
};

indicator(shape: DiscourseNodeShape) {
const { bounds } = this.editor.getShapeGeometry(shape);
return (
Expand Down