import { t as TableContainers } from "../define-table-dT1Rll2-.js"; import { ContainerRenderProps } from "@portabletext/editor"; import { JSX, ReactNode } from "react"; /** * The pre-wired container definitions: canonical type names and array * fields with the reference renders. Pass to `defineTable` for the * reference UI: * * ```tsx * import {defineTable} from '@portabletext/plugin-table' * import {referenceContainers} from '@portabletext/plugin-table/ui' * * export const table = defineTable({containers: referenceContainers}) * ``` * * @public */ declare const referenceContainers: TableContainers; /** * The strings the chrome renders: aria-labels and tooltips for the * handles, lanes, dots, trash chips, and the menu trigger, plus the * built-in menu's item labels. The `menu-*` keys only render when the * built-in menu does; a `renderMenu` widget carries its own strings. * * @public */ type TableLabels = { 'add-column': string; 'add-row': string; 'column-handle': string; 'delete-column': string; 'delete-row': string; 'insert-here': string; 'menu-delete-table': string; 'menu-header-row': string; 'menu-select-table': string; 'row-handle': string; 'table-options': string; }; type TableMenuHandlers = { hasHeader: boolean; onToggleHeader: () => void; onSelectTable: () => void; onDeleteTable: () => void; }; /** * What the `renderMenu` slot receives: the menu's state and actions. The * widget itself (trigger, popover, items) is entirely consumer-rendered. * * @public */ type TableMenuProps = TableMenuHandlers & { /** Report the widget's open state so the anchor stays visible while open. */ onOpenChange: (open: boolean) => void; }; /** * Per-instance values for the theming custom properties, applied inline to * the plugin's own roots: the in-tree chrome wrapper and the portal * layers. The keys are the same `--pt-plugin-table-*` names the stylesheet * declares defaults for; inline values win over those defaults. Hosts * whose theme is a runtime object (not static CSS) resolve values and pass * them here. * * @public */ type TableTokens = { [key in '--pt-plugin-table-accent' | '--pt-plugin-table-accent-fg' | '--pt-plugin-table-bg' | '--pt-plugin-table-border' | '--pt-plugin-table-boundary-dot' | '--pt-plugin-table-cell-padding' | '--pt-plugin-table-danger' | '--pt-plugin-table-fg' | '--pt-plugin-table-font-family' | '--pt-plugin-table-handle-bg' | '--pt-plugin-table-handle-dots' | '--pt-plugin-table-handle-rest' | '--pt-plugin-table-handle-ring' | '--pt-plugin-table-header-bg' | '--pt-plugin-table-header-weight' | '--pt-plugin-table-lane-bg' | '--pt-plugin-table-lane-bg-hover' | '--pt-plugin-table-lane-icon' | '--pt-plugin-table-lane-icon-hover' | '--pt-plugin-table-menu-bg' | '--pt-plugin-table-menu-border' | '--pt-plugin-table-menu-hover' | '--pt-plugin-table-radius' | '--pt-plugin-table-scrollbar' | '--pt-plugin-table-scrollbar-hover' | '--pt-plugin-table-selected-bg' | '--pt-plugin-table-toggle-knob' | '--pt-plugin-table-toggle-track' | '--pt-plugin-table-toggle-track-on' | '--pt-plugin-table-trash-bg' | '--pt-plugin-table-trash-fg']?: string; }; /** * The reference render for the table container: chrome (handles, lanes, * menu, trash, drag ghost), scroll handling, and selection visuals around the * editable `