import { Node, type NodeViewProps } from "@tiptap/react"; import { type ReactNode } from "react"; import { type RegistryBlockEditSurfaceOptions, type RegistryBlockSideMapBlock } from "./RegistryBlockContext.js"; export { RegistryBlockDataProvider, useRegistryBlockData, type RegistryBlockDataChangeMeta, type RegistryBlockDataValue, type RegistryBlockEditSurfaceOptions, type RegistryBlockNestedBlock, type RegistryBlockRenderOptions, type RegistryBlockRenderResult, type RegistryBlockSideMapBlock, } from "./RegistryBlockContext.js"; export declare function selectRegistryBlockNode({ editable, allowInteractiveChild, target, getPos, view, preventDefault, stopPropagation, }: { editable: boolean; allowInteractiveChild: boolean; target: EventTarget | null; getPos: (() => number | undefined) | boolean; view: NodeViewProps["editor"]["view"]; preventDefault: () => void; stopPropagation: () => void; }): boolean; /** * Renders one registry-block atom. The block is non-editable as far as * ProseMirror is concerned (`contentEditable={false}`); all interaction happens * inside the registry-driven ``. Read vs edit is toggled by * `props.selected` (the node is "selected" in the editor) AND the document being * editable. `data-plan-interactive` keeps existing host click-guards from * treating clicks inside the block as document clicks. */ export declare function RegistryBlockNodeView(props: NodeViewProps): import("react").JSX.Element; export declare function RegistryBlockLoadErrorView({ message, rawSource, }: { message: string; rawSource?: string; }): import("react").JSX.Element; export declare function LegacyJsonEditSurface({ block, blockType, open, onOpenChange, renderEditSurface, onChange, selected, customEditor, }: { block: RegistryBlockSideMapBlock; blockType?: string; open: boolean; onOpenChange: (open: boolean) => void; renderEditSurface?: (options: RegistryBlockEditSurfaceOptions) => ReactNode; onChange: (nextData: unknown) => void; selected: boolean; /** * A host-provided form editor. When present it * replaces the raw-JSON textarea + Save button; the form autosaves through its * own `onChange`. */ customEditor?: ReactNode; }): string | number | bigint | boolean | import("react").JSX.Element | Iterable | Promise | import("react").ReactElement> | import("react").ReactPortal | null | undefined> | null | undefined; /** Options for {@link createRegistryBlockNode}. */ export interface CreateRegistryBlockNodeOptions { /** * The Tiptap node name (e.g. `"planBlock"`). Hosts that serialize the doc by * node name (plan's `plan-doc.ts` keys off `"planBlock"`) must pass the exact * name their serializer expects. */ nodeName: string; /** * The HTML data-attribute that marks a serialized registry block on copy/paste * round-trip (e.g. `"data-plan-block"`). */ dataTag: string; /** * Mint a fresh, unique block id for a given block type. Used by the dedupe * plugin to re-mint duplicate / missing ids (paste/duplicate). Plan passes * `createPlanBlockId`. */ mintId: (blockType: string) => string; /** Node group (default `"block"`). */ group?: string; } /** * Build the generic registry-block Tiptap atom node. Returns a Tiptap `Node` * that: * - carries identity attrs `blockType` / `blockId` / `title` / `summary`, a * `sourceBlockId` (set when a duplicate is re-minted, so the host can copy the * original block's data), and an optional `__raw` verbatim-MDX attr for * byte-stable source round-trips; * - is an atom + isolating + draggable block that renders through * {@link RegistryBlockNodeView} (via `ReactNodeViewRenderer`); * - installs a dedupe `appendTransaction` plugin that re-mints any duplicate or * empty `blockId` (the classic paste/duplicate case), preserving the original * block's id + side-map data and tagging its own transaction so it never * loops. */ export declare function createRegistryBlockNode(options: CreateRegistryBlockNodeOptions): Node; //# sourceMappingURL=RegistryBlockNode.d.ts.map