@mocanvas/editor · type
type TLCommentAnchor = {
type: "shape";
shapeId: ShapeId;
pageId: PageId;
x: number;
y: number;
} | {
type: "page";
pageId: PageId;
x: number;
y: number;
} | {
type: "document";
}Where a thread is pinned.
A thread on a *shape* moves with the shape and disappears with it; a thread on a *page* sits at a fixed point on the canvas; a thread with no anchor belongs to the document as a whole. The three are genuinely different lifetimes, which is why this is a union rather than an optional shape id.
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.