@mocanvas/mocanvas · function
declare function createEmptyBookmarkShape(editor: Editor, url: string, point?: VecLike): BookmarkShapeCreate a bookmark card for url with no asset behind it yet.
The card is a valid card without one — it renders the host and the url and
nothing else — so this is the half of "paste a link" that does not need a
network round trip, and the half that is safe to do optimistically while an
unfurl is still in flight. Attaching the preview afterwards is a matter of
setting props.assetId.
point is the card's *centre* in page space, defaulting to the middle of the
viewport, which is where a paste with no pointer position belongs.
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.