import type { PageHost, PageRect } from './artifacts.svelte'; import type { Target } from './board.svelte'; // The tie being drawn from a note's grip to whatever it will be about, while // the pointer is down. The canvas draws it; the note sets it. export const tying = $state<{ note: string | null; x: number; y: number }>({ note: null, x: 0, y: 0 }); /** * Text the person has selected in a window, which a note can be made for or * tied to: in the client's own document (`range`), or in an artifact's page * (`page`, with the lines it covers in the page's pixels). Whichever was * selected last. */ export type Selected = { target: Target; range: Range; page?: undefined } | { target: Target; page: PageHost; lines: PageRect[]; range?: undefined }; export const selection = $state<{ current: Selected | null }>({ current: null });