/** * P1 Puck Provider * * React context provider for P1 Puck integration. */ import React from 'react'; import type { P1PuckConfig } from '../core/types.js'; import type { P1FeaturePlugin } from '../core/plugin-types.js'; import type { P1FeatureConfig } from '../core/featureConfig.js'; export interface P1PuckProviderProps extends P1PuckConfig { children: React.ReactNode; /** * Whether to show error notifications automatically. * @default true */ showErrorNotifications?: boolean; /** * Whether the provider renders the toasts for the notices it adds (save * errors, a failed refresh after a revert, a successful publish, ...). * Set to `false` if you mount your own `NotificationContainer` inside the * provider, otherwise every toast shows twice. * @default true */ showNotificationContainer?: boolean; /** * Optional token refresher for WebSocket reconnection with fresh tokens. */ realtimeTokenRefresher?: () => Promise; /** * Feature plugins to compose into the provider tree. * Each plugin can provide a React context wrapper, Puck plugins, and overrides. * Defaults to DEFAULT_CCR_FEATURE_PLUGINS when not provided. */ featurePlugins?: P1FeaturePlugin[]; /** * Feature configuration flags controlling which UI features are enabled. * When provided, overrides boolean props (presenceEnabled, agentModeEnabled, etc.). * When omitted, derived from the existing boolean props for backwards compatibility. */ featureConfig?: P1FeatureConfig; } /** * Provider component for P1 Puck integration. * * Wraps your Puck editor to provide P1 functionality including: * - Auto-save with debouncing * - Document loading * - Checkpoint (publish) creation * - Branch switching * - Toast notifications for errors and success * * @example * ```tsx * import { P1PuckProvider, P1PuckEditor } from '@pantheon-systems/puck-css'; * import { P1Client } from '@pantheon-systems/css-client'; * * const client = new P1Client({ * baseUrl: 'http://localhost:8787', * apiKey: 'your-api-key', * }); * * function App() { * return ( * * * * ); * } * ``` */ export declare function P1PuckProvider(props: P1PuckProviderProps): React.ReactElement;