37 lines
656 B
TypeScript
37 lines
656 B
TypeScript
import { BaseBoxShapeUtil, TLBaseShape } from "tldraw"
|
|
|
|
export type IEmbedShape = TLBaseShape<
|
|
"Embed",
|
|
{
|
|
w: number
|
|
h: number
|
|
url: string
|
|
title: string
|
|
description: string
|
|
image: string
|
|
}
|
|
>
|
|
|
|
export class EmbedShape extends BaseBoxShapeUtil<IEmbedShape> {
|
|
static override type = "Embed"
|
|
|
|
getDefaultProps(): IEmbedShape["props"] {
|
|
return {
|
|
w: 300,
|
|
h: 200,
|
|
url: "",
|
|
title: "",
|
|
description: "",
|
|
image: "",
|
|
}
|
|
}
|
|
|
|
indicator(shape: IEmbedShape) {
|
|
return null // Simplified for worker
|
|
}
|
|
|
|
component(shape: IEmbedShape) {
|
|
return null // No React components in worker
|
|
}
|
|
}
|