import { type ReactNode } from 'react'; import { Extension } from '@tiptap/core'; import { type Editor } from '@tiptap/react'; import { type SelectionToolbarProps } from './SelectionToolbar'; /** * The frame `CommentBox` writes in, from Katerina's Leaf prototype (9 * October): the text, scrolling in a `ScrollArea` past half the window, the * bar down its left while it is marked, what is attached, and a footer. The * send box and the edit box are this one frame with different footers, so a * change to the box is made once (Katerina, 21 Oct: the scrollbar had to be * fixed in two copies). It was `ComposeBox`, a part of its own until 0.85.0; * no app used it, and two box names invited the wrong pick. */ /** The classes the box's editor wears: rich text with no outline. It never scrolls itself; the box does, in a `ScrollArea`. */ export declare const COMPOSE_EDITOR_CLASSES: string; /** * A long draft stops at half the window and scrolls inside the box, so its * first line can be reached (PEE-59). The package's `ScrollArea` scrolls it, * not the browser: its bar, and one that shows while there is more (Katerina, * 21 Oct: the browser's bar, and none at all in some browsers). * * The region reaches into the box's right padding (the box's `p-3`) and its * content gives it back, so the text ends where it did and the bar sits 3px * from the box's edge, as every other box's bar does (Katerina, 21 Oct: the gap * on the right; measured 15px before, 3px after). */ export declare const COMPOSE_SCROLL_CLASSES: { area: string; viewport: string; content: string; }; type ComposeKeysStorage = { send: (() => boolean) | null; }; /** * Enter sends; Shift+Enter is a new line — in a list a new item (or out of the * list, on an empty one), in a quote a new line (or out of it, on an empty one). * Peek's keys, as its ComposeBox has them. Enter while a `/`, `@` or `[` list is * open picks a row instead. `ComposeBox` says what sending does. */ export declare const ComposeKeys: Extension, ComposeKeysStorage>; /** Nothing written: no text, no chip and no picture — empty lines, spaces, lists or quotes only. */ export declare function isEmptyDoc(editor: Editor): boolean; export interface BoxFrameProps { /** The box's editor, with `ComposeKeys` in its extensions and `COMPOSE_EDITOR_CLASSES` on it. `null` while it loads. */ editor: Editor | null; /** The bar down the text's left: an urgent mention or a highlight, as Peek draws it. */ marked?: boolean; /** The selection strip over the text, with these buttons. Absent, no strip (the edit box). */ selection?: Pick; /** Said while the text is empty: words, and a `Kbd` where a key helps. */ placeholder?: ReactNode; empty?: boolean; /** What is attached, under the text: `AttachmentCard pending`s. */ attachments?: ReactNode; /** The row under it all: the tools and Send, or the keys and Cancel/Save. */ footer: ReactNode; /** On the box itself. */ className?: string; } /** The one frame both boxes draw: the bordered box, its text in a `ScrollArea`, what is attached, the footer. */ export declare function BoxFrame({ editor, marked, selection, placeholder, empty, attachments, footer, className }: BoxFrameProps): import("react").JSX.Element; export interface SendBoxProps { /** The box's editor. `null` while it loads. */ editor: Editor | null; /** * Send what is written. The box empties afterwards — unless this returns * `false`: nothing was sent, and the words stay. */ onSend: (editor: Editor) => void | boolean; /** Said in the empty box: words, and a `Kbd` where a key helps ("type / for commands"). */ placeholder: ReactNode; /** The tools under the text, left: `ToolbarButton`s (attach, highlight). One Tab stop. */ tools?: ReactNode; /** What is attached, under the text: `AttachmentCard pending`s. */ attachments?: ReactNode; /** Something to send even with no words — a file ready. */ ready?: boolean; /** Sending waits — a file still uploading. */ holding?: boolean; /** The bar down the text's left: an urgent mention or a highlight, as Peek draws it. */ marked?: boolean; /** The selection strip's buttons: its marks, Link, and the app's own (`actions`). */ selection?: Pick; className?: string; } /** * The send box: the frame with the selection strip over the text, the tools * and Send under it. Enter sends (`ComposeKeys`), and so does the button. */ export declare function SendBox({ editor, onSend, placeholder, tools, attachments, ready, holding, marked, selection, className }: SendBoxProps): import("react").JSX.Element; export {}; //# sourceMappingURL=commentBoxFrame.d.ts.map