export { DefaultPlaceholder, Editable, RenderPlaceholderProps, Slate, useComposing, useFocused, useReadOnly, useSelected, withReact } from 'slate-react'; import React$1, { HTMLAttributes } from 'react'; import { HotkeysOptions, Keys, HotkeysEvent } from '@udecode/react-hotkeys'; import * as _udecode_slate from '@udecode/slate'; import { Value, Editor, EditorApi, EditorTransforms, NodeEntry, DecoratedRange, TText, TElement, Descendant, Path, ElementEntry, TRange, ValueOf, TSelection, TNode } from '@udecode/slate'; import { Modify, UnionToIntersection, Nullable, Deep2Partial, AnyObject, UnknownObject } from '@udecode/utils'; import * as zustand_x from 'zustand-x'; import { TCreatedStoreType, TEqualityChecker } from 'zustand-x'; export { useStoreSelect, useStoreState, useStoreValue, useTracked, useTrackedStore } from 'zustand-x'; import { f as AnyPluginConfig, P as PluginConfig, a4 as HandlerReturnType, aR as InitOptions, aT as InsertExitBreakOptions, aI as ScrollMode, aG as AutoScrollOperationsMap, aK as WithAutoScrollOptions, W as WithRequiredKey, S as SlatePlugin, _ as InferOptions, Z as InferApi, a0 as InferTransforms, $ as InferSelectors, i as ExtendEditor$1, aH as DomConfig, as as CorePlugin, n as BaseWithSlateOptions, l as InferPlugins, B as BaseEditor, Y as InferKey, t as BasePlugin, u as BasePluginContext, a3 as WithAnyKey, j as AnySlatePlugin, an as SlatePluginConfig, g as SlatePluginContext, aw as CorePluginApi, av as CorePluginTransforms, a1 as NodeComponent, s as BaseInjectProps, V as GetInjectNodePropsOptions, y as BaseTransformOptions, X as GetInjectNodePropsReturnType, a2 as NodeComponents, k as ParserOptions, q as BaseDeserializer, x as BaseSerializer, r as BaseHtmlDeserializer, E as EditableProps, J as MatchRules, bb as RenderElementFn, bc as RenderLeafFn, bd as RenderTextFn, b as RenderLeafProps, R as RenderElementProps, c as RenderTextProps } from '../withSlate-2StnFyHy.js'; import * as jotai from 'jotai'; import { Atom } from 'jotai'; export { atom } from 'jotai'; import * as jotai_x from 'jotai-x'; import { JotaiStore } from 'jotai-x'; export { createAtomStore, useStoreAtomState, useStoreAtomValue, useStoreSetAtom } from 'jotai-x'; import 'mutative'; import 'is-hotkey'; declare function EditorHotkeysEffect({ id, editableRef, }: { editableRef: React$1.RefObject; id?: string; }): React$1.JSX.Element; declare const EditorMethodsEffect: ({ id }: { id?: string; }) => null; type DOMHandler = (ctx: PlatePluginContext & { event: EV; }) => HandlerReturnType; interface DOMHandlers { onAbort?: DOMHandler; onAbortCapture?: DOMHandler; onAnimationEnd?: DOMHandler; onAnimationEndCapture?: DOMHandler; onAnimationIteration?: DOMHandler; onAnimationIterationCapture?: DOMHandler; onAnimationStart?: DOMHandler; onAnimationStartCapture?: DOMHandler; onAuxClick?: DOMHandler; onAuxClickCapture?: DOMHandler; onBeforeInput?: DOMHandler; onBeforeInputCapture?: DOMHandler; onBlur?: DOMHandler; onBlurCapture?: DOMHandler; onCanPlay?: DOMHandler; onCanPlayCapture?: DOMHandler; onCanPlayThrough?: DOMHandler; onCanPlayThroughCapture?: DOMHandler; onClick?: DOMHandler; onClickCapture?: DOMHandler; onCompositionEnd?: DOMHandler; onCompositionEndCapture?: DOMHandler; onCompositionStart?: DOMHandler; onCompositionStartCapture?: DOMHandler; onCompositionUpdate?: DOMHandler; onCompositionUpdateCapture?: DOMHandler; onContextMenu?: DOMHandler; onContextMenuCapture?: DOMHandler; onCopy?: DOMHandler; onCopyCapture?: DOMHandler; onCut?: DOMHandler; onCutCapture?: DOMHandler; onDOMBeforeInput?: DOMHandler; onDoubleClick?: DOMHandler; onDoubleClickCapture?: DOMHandler; onDrag?: DOMHandler; onDragCapture?: DOMHandler; onDragEnd?: DOMHandler; onDragEndCapture?: DOMHandler; onDragEnter?: DOMHandler; onDragEnterCapture?: DOMHandler; onDragExit?: DOMHandler; onDragExitCapture?: DOMHandler; onDragLeave?: DOMHandler; onDragLeaveCapture?: DOMHandler; onDragOver?: DOMHandler; onDragOverCapture?: DOMHandler; onDragStart?: DOMHandler; onDragStartCapture?: DOMHandler; onDrop?: DOMHandler; onDropCapture?: DOMHandler; onDurationChange?: DOMHandler; onDurationChangeCapture?: DOMHandler; onEmptied?: DOMHandler; onEmptiedCapture?: DOMHandler; onEncrypted?: DOMHandler; onEncryptedCapture?: DOMHandler; onEnded?: DOMHandler; onEndedCapture?: DOMHandler; onFocus?: DOMHandler; onFocusCapture?: DOMHandler; onGotPointerCapture?: DOMHandler; onGotPointerCaptureCapture?: DOMHandler; onInput?: DOMHandler; onInputCapture?: DOMHandler; onInvalid?: DOMHandler; onInvalidCapture?: DOMHandler; onKeyDown?: DOMHandler; onKeyDownCapture?: DOMHandler; onKeyPress?: DOMHandler; onKeyPressCapture?: DOMHandler; onKeyUp?: DOMHandler; onKeyUpCapture?: DOMHandler; onLoad?: DOMHandler; onLoadCapture?: DOMHandler; onLoadedData?: DOMHandler; onLoadedDataCapture?: DOMHandler; onLoadedMetadata?: DOMHandler; onLoadedMetadataCapture?: DOMHandler; onLoadStart?: DOMHandler; onLoadStartCapture?: DOMHandler; onLostPointerCapture?: DOMHandler; onLostPointerCaptureCapture?: DOMHandler; onMouseDown?: DOMHandler; onMouseDownCapture?: DOMHandler; onMouseEnter?: DOMHandler; onMouseLeave?: DOMHandler; onMouseMove?: DOMHandler; onMouseMoveCapture?: DOMHandler; onMouseOut?: DOMHandler; onMouseOutCapture?: DOMHandler; onMouseOver?: DOMHandler; onMouseOverCapture?: DOMHandler; onMouseUp?: DOMHandler; onMouseUpCapture?: DOMHandler; onPaste?: DOMHandler; onPasteCapture?: DOMHandler; onPause?: DOMHandler; onPauseCapture?: DOMHandler; onPlay?: DOMHandler; onPlayCapture?: DOMHandler; onPlaying?: DOMHandler; onPlayingCapture?: DOMHandler; onPointerCancel?: DOMHandler; onPointerCancelCapture?: DOMHandler; onPointerDown?: DOMHandler; onPointerDownCapture?: DOMHandler; onPointerEnter?: DOMHandler; onPointerLeave?: DOMHandler; onPointerMove?: DOMHandler; onPointerMoveCapture?: DOMHandler; onPointerOut?: DOMHandler; onPointerOutCapture?: DOMHandler; onPointerOver?: DOMHandler; onPointerOverCapture?: DOMHandler; onPointerUp?: DOMHandler; onPointerUpCapture?: DOMHandler; onProgress?: DOMHandler; onProgressCapture?: DOMHandler; onRateChange?: DOMHandler; onRateChangeCapture?: DOMHandler; onReset?: DOMHandler; onResetCapture?: DOMHandler; onScroll?: DOMHandler; onScrollCapture?: DOMHandler; onSeeked?: DOMHandler; onSeekedCapture?: DOMHandler; onSeeking?: DOMHandler; onSeekingCapture?: DOMHandler; onSelect?: DOMHandler; onSelectCapture?: DOMHandler; onStalled?: DOMHandler; onStalledCapture?: DOMHandler; onSubmit?: DOMHandler; onSubmitCapture?: DOMHandler; onSuspend?: DOMHandler; onSuspendCapture?: DOMHandler; onTimeUpdate?: DOMHandler; onTimeUpdateCapture?: DOMHandler; onTouchCancel?: DOMHandler; onTouchCancelCapture?: DOMHandler; onTouchEnd?: DOMHandler; onTouchEndCapture?: DOMHandler; onTouchMove?: DOMHandler; onTouchMoveCapture?: DOMHandler; onTouchStart?: DOMHandler; onTouchStartCapture?: DOMHandler; onTransitionEnd?: DOMHandler; onTransitionEndCapture?: DOMHandler; onVolumeChange?: DOMHandler; onVolumeChangeCapture?: DOMHandler; onWaiting?: DOMHandler; onWaitingCapture?: DOMHandler; onWheel?: DOMHandler; onWheelCapture?: DOMHandler; } type KeyboardHandler = DOMHandler; type PlatePluginConfig$2 = Omit>, { node: Partial>['node']>; }>>, keyof PlatePluginMethods | 'optionsStore' | 'useOptionsStore'>; type TPlatePluginConfig = Omit, { node: Partial['node']>; }>>, keyof PlatePluginMethods | 'optionsStore' | 'useOptionsStore'>; declare const createPlatePlugin: (config?: ((editor: PlateEditor) => PlatePluginConfig$2) | PlatePluginConfig$2) => PlatePlugin>; /** * Explicitly typed version of `createPlatePlugin`. * * @remarks * While `createPlatePlugin` uses type inference, this function requires an * explicit type parameter. Use this when you need precise control over the * plugin's type structure or when type inference doesn't provide the desired * result. */ declare function createTPlatePlugin(config?: ((editor: PlateEditor) => TPlatePluginConfig) | TPlatePluginConfig): PlatePlugin; declare const getPlateCorePlugins: () => (PlatePlugin void; }, { reset: (options: _udecode_slate.ResetOptions | undefined) => void; init: (args_0: InitOptions) => Promise; insertExitBreak: (args_0?: InsertExitBreakOptions | undefined) => true | undefined; resetBlock: (args_0?: { at?: _udecode_slate.Path; } | undefined) => true | undefined; setValue: (value?: string | _udecode_slate.Value | undefined) => void; }, {}>> | PlatePlugin> | PlatePlugin> | PlatePlugin boolean; }, { withScrolling: (fn: () => void, options?: WithAutoScrollOptions | undefined) => void; }, {}>>)[]; /** * Creates a memoized Plate editor for React components. * * This hook creates a fully configured Plate editor instance that is memoized * based on the provided dependencies. It's optimized for React components to * prevent unnecessary re-creation of the editor on every render. * * Examples: * * ```ts * const editor = usePlateEditor({ * plugins: [ParagraphPlugin, HeadingPlugin], * value: [{ type: 'p', children: [{ text: 'Hello world!' }] }], * }); * * // Editor with custom dependencies * const editor = usePlateEditor( * { * plugins: [ParagraphPlugin], * enabled, * }, * [enabled] * ); // Re-create when enabled changes * ``` * * @param options - Configuration options for creating the Plate editor * @param deps - Additional dependencies for the useMemo hook (default: []) * @see {@link createPlateEditor} for detailed information on React editor creation and configuration. * @see {@link createSlateEditor} for a non-React version of editor creation. * @see {@link withPlate} for the underlying React-specific enhancement function. */ declare function usePlateEditor(options?: CreatePlateEditorOptions & { enabled?: TEnabled; }, deps?: React$1.DependencyList): TEnabled extends false ? null : TEnabled extends true | undefined ? TPlateEditor : TPlateEditor | null; declare function getEditorPlugin

>(editor: PlateEditor, plugin: WithRequiredKey

): PlatePluginContext extends never ? P : InferConfig

>; /** Get editor plugin by key or plugin object. */ declare function getPlugin(editor: PlateEditor, plugin: WithRequiredKey): C extends { node: any; } ? C : PlatePlugin; declare const omitPluginContext: >(ctx: T) => Omit; type PlatePluginConfig$1 = Omit, EA & InferApi, ET & InferTransforms, ES & InferSelectors>>>, keyof PlatePluginMethods | 'api' | 'node' | 'options' | 'transforms'> & { api?: EA & Partial>; node?: Partial['node']>; options?: EO & Partial>; selectors?: ES & Partial>; transforms?: ET & Partial>; }; /** * Extends a SlatePlugin to create a React PlatePlugin. * * @remarks * This function transforms a SlatePlugin into a React PlatePlugin, allowing for * React-specific functionality to be added. * @param basePlugin - The base SlatePlugin to be extended. * @param extendConfig - A function or object that provides the extension * configuration. If a function, it receives the plugin context and should * return a partial PlatePlugin. If an object, it should be a partial * PlatePlugin configuration. * @returns A new PlatePlugin that combines the base SlatePlugin functionality * with React-specific features defined in the extension configuration. */ declare function toPlatePlugin(basePlugin: SlatePlugin, extendConfig?: ((ctx: PlatePluginContext) => PlatePluginConfig$1) | PlatePluginConfig$1): PlatePlugin, EA & InferApi, ET & InferTransforms, ES & InferSelectors>>; type ExtendPluginConfig = Omit>, Partial>, Partial>>>>, keyof PlatePluginMethods>; /** * Explicitly typed version of {@link toPlatePlugin}. * * @remarks * This function requires explicit type parameters for both the base plugin * configuration and the extension configuration. Use this when you need * precise control over the plugin's type structure or when type inference * doesn't provide the desired result. * @typeParam C - The type of the extension configuration for the PlatePlugin * (required). * @typeParam TContext - The type of the base SlatePlugin configuration * (optional). */ declare function toTPlatePlugin(basePlugin: SlatePlugin, extendConfig?: ((ctx: PlatePluginContext) => ExtendPluginConfig) | ExtendPluginConfig): PlatePlugin, InferApi, InferTransforms, InferSelectors>>; declare const SlateReactExtensionPlugin: PlatePlugin void; }, { reset: (options: _udecode_slate.ResetOptions | undefined) => void; init: (args_0: InitOptions) => Promise; insertExitBreak: (args_0?: InsertExitBreakOptions | undefined) => true | undefined; resetBlock: (args_0?: { at?: _udecode_slate.Path; } | undefined) => true | undefined; setValue: (value?: string | _udecode_slate.Value | undefined) => void; }, {}>>; declare const EventEditorPlugin: PlatePlugin>; type EventEditorState = { /** Last editor id that has been blurred. */ blur: string | null; /** Editor id that is currently being focused. */ focus: string | null; /** Last editor id. */ last: string | null; }; /** Store where the keys are event names and the values are editor ids. */ declare const EventEditorStore: zustand_x.TStateApi; declare const useEventEditorValue: { (key: K): EventEditorState[K]; (key: K, ...args: Parameters<{}[K]>): ReturnType<{}[K]>; (key: "state"): EventEditorState; (key: K, equalityFn?: zustand_x.TEqualityChecker | undefined): EventEditorState[K]; (key: K, ...args: [...Parameters<{}[K]>, (zustand_x.TEqualityChecker> | undefined)?]): ReturnType<{}[K]>; }; declare const getEventPlateId: (id?: string) => string; declare const FOCUS_EDITOR_EVENT = "focus-editor-event"; declare const BLUR_EDITOR_EVENT = "blur-editor-event"; declare const useFocusEditorEvents: ({ editorRef, onEditorBlur, onEditorFocus, }: { editorRef: PlateEditor | null; onEditorBlur?: () => void; onEditorFocus?: () => void; }) => void; declare const ParagraphPlugin: PlatePlugin>; /** @see {@link withReact} */ declare const ReactPlugin: PlatePlugin boolean; }, { withScrolling: (fn: () => void, options?: WithAutoScrollOptions | undefined) => void; }, {}>>; declare const withPlateReact: ExtendEditor$1; type PlateCorePlugin = CorePlugin | typeof EventEditorPlugin | typeof SlateReactExtensionPlugin; type WithPlateOptions = BaseWithSlateOptions

& Pick, 'api' | 'decorate' | 'extendEditor' | 'handlers' | 'inject' | 'normalizeInitialValue' | 'options' | 'override' | 'priority' | 'render' | 'shortcuts' | 'transforms' | 'useHooks'> & { value?: ((editor: PlateEditor) => V) | V | string; rootPlugin?: (plugin: AnyPlatePlugin) => AnyPlatePlugin; }; /** * Applies Plate enhancements to an editor instance (React version). * * @remarks * This function supports React-specific features including component rendering, * event handlers, and React hooks integration. * @see {@link createPlateEditor} for a higher-level React editor creation function. * @see {@link usePlateEditor} for a memoized version in React components. * @see {@link withSlate} for the non-React version of editor enhancement. */ declare const withPlate: (e: Editor, { plugins, ...options }?: WithPlateOptions) => TPlateEditor>; type CreatePlateEditorOptions = WithPlateOptions & { /** * Initial editor to be extended with `withPlate`. * * @default createEditor() */ editor?: Editor; }; /** * Creates a Plate editor (React version). * * This function creates a fully configured Plate editor instance with * React-specific enhancements including component rendering, event handlers, * and hooks integration. It applies all specified plugins and configurations to * create a functional editor. * * Examples: * * ```ts * const editor = createPlateEditor({ * plugins: [ParagraphPlugin, HeadingPlugin], * value: [{ type: 'p', children: [{ text: 'Hello world!' }] }], * }); * * // Editor with custom components * const editor = createPlateEditor({ * plugins: [ParagraphPlugin.withComponent(ParagraphElement)], * components: { [CodePlugin.key]: CodeLeaf }, * }); * * // Editor with React-specific options * const editor = createPlateEditor({ * plugins: [ParagraphPlugin], * handlers: { onKeyDown: customKeyHandler }, * }); * ``` * * @see {@link createSlateEditor} for a non-React version of editor creation. * @see {@link usePlateEditor} for a memoized version in React components. * @see {@link withPlate} for the underlying function that applies Plate enhancements to an editor. */ declare const createPlateEditor: ({ editor, ...options }?: CreatePlateEditorOptions) => TPlateEditor>; type PlateEditor = BaseEditor & { api: EditorApi & UnionToIntersection>; meta: BaseEditor['meta'] & { pluginList: AnyEditorPlatePlugin[]; shortcuts: Shortcuts; }; plugins: Record; tf: EditorTransforms & UnionToIntersection>; transforms: EditorTransforms & UnionToIntersection>; getApi: (plugin?: WithRequiredKey) => PlateEditor['api'] & InferApi; getPlugin: (plugin: WithRequiredKey) => C extends { node: any; } ? C : EditorPlatePlugin; getTransforms: (plugin?: WithRequiredKey) => PlateEditor['tf'] & InferTransforms; uid?: string; }; type TPlateEditor = PlateEditor & { api: EditorApi & UnionToIntersection>; children: V; meta: BaseEditor['meta'] & { pluginList: P[]; shortcuts: Shortcuts; }; plugins: { [K in P['key']]: Extract; }; tf: EditorTransforms & UnionToIntersection>; transforms: EditorTransforms & UnionToIntersection>; getApi: (plugin?: WithRequiredKey) => TPlateEditor['api'] & InferApi; getTransforms: (plugin?: WithRequiredKey) => TPlateEditor['tf'] & InferTransforms; }; type KeyofPlugins = (string & {}) | InferKey; type AnyEditorPlatePlugin = EditorPlatePlugin; type AnyPlatePlugin = PlatePlugin; /** * Property used by Plate to decorate editor ranges. If the function returns * undefined then no ranges are modified. If the function returns an array the * returned ranges are merged with the ranges called by other plugins. */ type Decorate = (ctx: PlatePluginContext & { entry: NodeEntry; }) => DecoratedRange[] | undefined; type Deserializer = BaseDeserializer & { parse?: (options: PlatePluginContext & { element: any; }) => Partial | undefined | void; query?: (options: PlatePluginContext & { element: any; }) => boolean; }; type EditableSiblingComponent = (editableProps: EditableProps) => React$1.ReactElement | null; type EditorPlatePlugin = Omit, keyof PlatePluginMethods | 'override' | 'plugins'>; /** Plate plugin overriding the `editor` methods. Naming convention is `with*`. */ type ExtendEditor = (ctx: PlatePluginContext) => PlateEditor; type ExtendEditorApi = (ctx: PlatePluginContext) => EA & Deep2Partial & { [K in keyof InferApi]?: InferApi[K] extends (...args: any[]) => any ? (...args: Parameters[K]>) => ReturnType[K]> : InferApi[K] extends Record any> ? { [N in keyof InferApi[K]]?: (...args: Parameters[K][N]>) => ReturnType[K][N]>; } : never; }; type ExtendEditorTransforms = (ctx: PlatePluginContext) => ET & Deep2Partial & { [K in keyof InferTransforms]?: InferTransforms[K] extends (...args: any[]) => any ? (...args: Parameters[K]>) => ReturnType[K]> : InferTransforms[K] extends Record any> ? { [N in keyof InferTransforms[K]]?: (...args: Parameters[K][N]>) => ReturnType[K][N]>; } : never; }; type HtmlDeserializer = BaseHtmlDeserializer & { parse?: (options: PlatePluginContext & { element: HTMLElement; node: AnyObject; }) => Partial | undefined | void; query?: (options: PlatePluginContext & { element: HTMLElement; }) => boolean; }; type HtmlReactSerializer = { parse?: React$1.FC & PlateLeafProps>; query?: (options: PlateElementProps) => boolean; }; type HtmlSerializer = { parse?: (options: PlatePluginContext & { node: Descendant; }) => string; query?: (options: PlatePluginContext & { node: Descendant; }) => boolean; }; type InferConfig

= P extends PlatePlugin | SlatePlugin ? C : never; /** Properties used by Plate to inject props into any {@link NodeComponent}. */ type InjectNodeProps = BaseInjectProps & { /** Whether to inject the props. If true, overrides all other checks. */ query?: (options: NonNullable> & PlatePluginContext & { nodeProps: GetInjectNodePropsOptions; }) => boolean; /** * Transform the className. * * @default clsx(className, classNames[value]) */ transformClassName?: (options: TransformOptions) => any; /** * Transform the node value for the style or className. * * @default nodeValue */ transformNodeValue?: (options: TransformOptions) => any; /** Transform the injected props. */ transformProps?: (options: TransformOptions & { props: GetInjectNodePropsReturnType; }) => AnyObject | undefined; /** * Transform the style. * * @default { ...style, [styleKey]: value } */ transformStyle?: (options: TransformOptions) => CSSStyleDeclaration; }; type LeafNodeProps = ((props: PlateLeafProps) => AnyObject | undefined) | AnyObject; /** * Property used by Plate to override node `component` props. If function, its * returning value will be shallow merged to the old props, with the old props * as parameter. If object, its value will be shallow merged to the old props. */ type NodeProps = ((props: PlateElementProps & PlateLeafProps) => AnyObject | undefined) | AnyObject; /** @deprecated Use {@link RenderNodeWrapper} instead. */ type NodeWrapperComponent = (props: NodeWrapperComponentProps) => NodeWrapperComponentReturnType; /** @deprecated Use {@link RenderNodeWrapperProps} instead. */ interface NodeWrapperComponentProps extends PlateElementProps { key: string; } /** @deprecated Use {@link RenderNodeWrapperFunction} instead. */ type NodeWrapperComponentReturnType = React$1.FC> | undefined; type NormalizeInitialValue = (ctx: PlatePluginContext & { value: Value; }) => void; /** * Function called whenever a change occurs in the editor. Return `false` to * prevent calling the next plugin handler. * * @see {@link SlatePropsOnChange} */ type OnChange = (ctx: PlatePluginContext & { value: Value; }) => HandlerReturnType; type OverrideEditor = (ctx: PlatePluginContext) => { api?: Deep2Partial & { [K in keyof InferApi]?: InferApi[K] extends (...args: any[]) => any ? (...args: Parameters[K]>) => ReturnType[K]> : InferApi[K] extends Record any> ? { [N in keyof InferApi[K]]?: (...args: Parameters[K][N]>) => ReturnType[K][N]>; } : never; }; transforms?: Deep2Partial & { [K in keyof InferTransforms]?: InferTransforms[K] extends (...args: any[]) => any ? (...args: Parameters[K]>) => ReturnType[K]> : InferTransforms[K] extends Record any> ? { [N in keyof InferTransforms[K]]?: (...args: Parameters[K][N]>) => ReturnType[K][N]>; } : never; }; }; /** * Used by parser plugins like html to deserialize inserted data to a slate * fragment. The fragment will be inserted to the editor if not empty. */ type Parser = { /** Format to get data. Example data types are text/plain and text/uri-list. */ format?: string[] | string; mimeTypes?: string[]; /** Deserialize data to fragment */ deserialize?: (options: ParserOptions & PlatePluginContext) => Descendant[] | undefined; /** * Function called on `editor.tf.insertData` just before * `editor.tf.insertFragment`. Default: if the block above the selection is * empty and the first fragment node type is not inline, set the selected node * type to the first fragment node type. * * @returns If true, the next handlers will be skipped. */ preInsert?: (options: ParserOptions & PlatePluginContext & { fragment: Descendant[]; }) => HandlerReturnType; /** Query to skip this plugin. */ query?: (options: ParserOptions & PlatePluginContext) => boolean; /** Transform the inserted data. */ transformData?: (options: ParserOptions & PlatePluginContext) => string; /** Transform the fragment to insert. */ transformFragment?: (options: ParserOptions & PlatePluginContext & { fragment: Descendant[]; }) => Descendant[]; }; /** The `PlatePlugin` interface is a React interface for all plugins. */ type PlatePlugin = BasePlugin & Nullable<{ /** @see {@link Decorate} */ decorate?: Decorate>; /** @see {@link ExtendEditor} */ extendEditor?: ExtendEditor>; /** Normalize initial value before passing it into the editor. */ normalizeInitialValue?: NormalizeInitialValue>; /** @see {@link UseHooks} */ useHooks?: UseHooks>; }> & PlatePluginMethods & { /** * Handlers called whenever the corresponding event occurs in the editor. * Event handlers can return a boolean flag to specify whether the event * can be treated as being handled. If it returns `true`, the next * handlers will not be called. */ handlers: Nullable> & { /** @see {@link OnChange} */ onChange?: OnChange>; }>; /** Plugin injection. */ inject: Nullable<{ nodeProps?: InjectNodeProps>; /** * Property that can be used by a plugin to allow other plugins to * inject code. For example, if multiple plugins have defined * `inject.editor.tf.insertData.transformData` for `key=HtmlPlugin.key`, * `insertData` plugin will call all of these `transformData` for * `HtmlPlugin.key` plugin. Differs from `override.plugins` as this is * not overriding any plugin. */ plugins?: Record>>; /** * A function that returns a plugin config to be injected into other * plugins `inject.plugins` specified by targetPlugins. */ targetPluginToInject?: (ctx: PlatePluginContext & { targetPlugin: string; }) => Partial>; }>; node: { /** Override `data-slate-leaf` element attributes */ leafProps?: LeafNodeProps>; /** Override node attributes */ props?: NodeProps>; /** Override `data-slate-node="text"` element attributes */ textProps?: TextNodeProps>; }; override: { /** Replace plugin {@link NodeComponent} by key. */ components?: NodeComponents; /** Extend {@link PlatePlugin} by key. */ plugins?: Record>>; }; /** @see {@link Parser} */ parser: Nullable>>; parsers: (Record>; /** @see {@link Serializer} */ serializer?: Serializer>; }> & { html?: never; htmlReact?: never; }) | { html?: Nullable<{ /** @see {@link HtmlDeserializer} */ deserializer?: HtmlDeserializer>; /** @see {@link HtmlSerializer} */ serializer?: HtmlSerializer>; }>; htmlReact?: Nullable<{ /** Function to deserialize HTML to Slate nodes using React. */ serializer?: HtmlReactSerializer>; }>; }; /** * Recursive plugin support to allow having multiple plugins in a single * plugin. Plate eventually flattens all the plugins into the editor. */ plugins: any[]; render: Nullable<{ /** * When other plugins' node components are rendered, this function can * return an optional wrapper function that turns a node's props to a * wrapper React node as its parent. Useful for wrapping or decorating * nodes with additional UI elements. * * NOTE: The function can run React hooks. NOTE: Do not run React hooks * in the wrapper function. It is not equivalent to a React component. */ aboveNodes?: RenderNodeWrapper>; /** Renders a component after the `Container` component. */ afterContainer?: EditableSiblingComponent; /** * Renders a component after the `Editable` component. This is the last * render position within the editor structure. */ afterEditable?: EditableSiblingComponent; /** Renders a component before the `Container` component. */ beforeContainer?: EditableSiblingComponent; /** Renders a component before the `Editable` component. */ beforeEditable?: EditableSiblingComponent; /** * When other plugins' node components are rendered, this function can * return an optional wrapper function that turns a node's props to a * wrapper React node. The wrapper node is the node's child and its * original children's parent. Useful for wrapping or decorating nodes * with additional UI elements. * * NOTE: The function can run React hooks. NOTE: Do not run React hooks * in the wrapper function. It is not equivalent to a React component. */ belowNodes?: RenderNodeWrapper>; /** * Function to render content below the root element but above its * children. Similar to belowNodes but renders directly in the element * rather than wrapping. Multiple plugins can provide this, and all * their content will be rendered in sequence. */ belowRootNodes?: (props: PlateElementProps) => React$1.ReactNode; }>; rules: { /** * Function to determine if this plugin's rules should apply to a node. * Used to override behavior based on node properties beyond just type * matching. * * Example: List plugin sets `match: ({ node }) => !!node.listStyleType` * to override paragraph behavior when the paragraph is a list item. * * @default type === node.type */ match?: (options: { node: TElement; path: Path; rule: MatchRules; } & PlatePluginContext) => boolean; }; /** * Keyboard shortcuts configuration mapping shortcut names to their key * combinations and handlers. Each shortcut can link to a transform * method, an API method, or use a custom handler function. */ shortcuts: Partial[C['key']], keyof InferTransforms[C['key']]> | keyof InferTransforms[C['key']], Shortcut | null>>; useOptionsStore: TCreatedStoreType; }; type PlatePluginConfig = Partial, A, T, S>>, keyof PlatePluginMethods | 'api' | 'node' | 'optionsStore' | 'transforms' | 'useOptionsStore'> & { api: EA; node: Partial>['node']>; options: EO; selectors: ES; transforms: ET; }>; type PlatePluginContext = BasePluginContext & { editor: E; plugin: EditorPlatePlugin; }; type PlatePluginMethods = { __apiExtensions: ((ctx: PlatePluginContext) => any)[]; __configuration: ((ctx: PlatePluginContext) => any) | null; __extensions: ((ctx: PlatePluginContext) => any)[]; __selectorExtensions: ((ctx: PlatePluginContext) => any)[]; clone: () => PlatePlugin; configure: (config: ((ctx: PlatePluginContext) => PlatePluginConfig, InferApi, InferTransforms, InferSelectors>) | PlatePluginConfig, InferApi, InferTransforms, InferSelectors>) => PlatePlugin; configurePlugin:

(plugin: Partial

, config: (P extends AnyPlatePlugin ? PlatePluginConfig, InferApi

, InferTransforms

, InferSelectors

> : SlatePluginConfig, InferApi

, InferTransforms

, InferSelectors

>) | ((ctx: P extends AnyPlatePlugin ? PlatePluginContext

: SlatePluginContext

) => P extends AnyPlatePlugin ? PlatePluginConfig, InferApi

, InferTransforms

, InferSelectors

> : SlatePluginConfig, InferApi

, InferTransforms

, InferSelectors

>)) => PlatePlugin; extend: (extendConfig: ((ctx: PlatePluginContext) => PlatePluginConfig, InferApi, InferTransforms, InferSelectors, EO, EA, ET, ES>) | PlatePluginConfig, InferApi, InferTransforms, InferSelectors, EO, EA, ET, ES>) => PlatePlugin, EA & InferApi, ET & InferTransforms, InferSelectors>>; extendApi: any> = Record>(extension: (ctx: PlatePluginContext) => EA) => PlatePlugin, InferApi & Record, InferTransforms, InferSelectors>>; /** * Extends the plugin's API with new methods or nested objects. * * This method allows you to add new functionality to the plugin's API or * extend existing ones. You can add top-level methods, nested objects with * methods, or extend existing nested objects. The types of existing methods * and nested objects are preserved, while new ones are inferred. * * @remarks * - New methods can be added at the top level or within nested objects. * - Existing methods can be overridden, but their parameter and return types * must match the original. * - When extending nested objects, you don't need to specify all existing * properties; they will be preserved. * - Only one level of nesting is supported for API objects. * * @example * ```typescript * const extendedPlugin = basePlugin.extendEditorApi(({ plugin }) => ({ * newMethod: (param: string) => param.length, * existingMethod: (n) => n * 2, // Must match original signature * nested: { * newNestedMethod: () => 'new nested method', * }, * })); * ```; * * @template EA - The type of the extended API, inferred from the returned * object. * @param extendedApi - A function that returns an object with the new or * extended API methods. * @returns A new instance of the plugin with the extended API. */ extendEditorApi: any) | Record any>> = Record>(extension: ExtendEditorApi) => PlatePlugin, { [K in keyof (EA & InferApi)]: (EA & InferApi)[K] extends (...args: any[]) => any ? (EA & InferApi)[K] : { [N in keyof (EA & InferApi)[K]]: (EA & InferApi)[K][N]; }; }, InferTransforms, InferSelectors>>; extendEditorTransforms: any) | Record any>> = Record>(extension: ExtendEditorTransforms) => PlatePlugin, InferApi, { [K in keyof (ET & InferTransforms)]: (ET & InferTransforms)[K] extends (...args: any[]) => any ? (ET & InferTransforms)[K] : { [N in keyof (ET & InferTransforms)[K]]: (ET & InferTransforms)[K][N]; }; }, InferSelectors>>; extendPlugin:

(plugin: Partial

, extendConfig: (P extends AnyPlatePlugin ? PlatePluginConfig, InferApi

, InferTransforms

, InferSelectors

, EO, EA, ET> : SlatePluginConfig, InferApi

, InferTransforms

, InferSelectors

, EO, EA, ET>) | ((ctx: P extends AnyPlatePlugin ? PlatePluginContext

: SlatePluginContext

) => P extends AnyPlatePlugin ? PlatePluginConfig, InferApi

, InferTransforms

, InferSelectors

, EO, EA, ET> : SlatePluginConfig, InferApi

, InferTransforms

, InferSelectors

, EO, EA, ET>)) => PlatePlugin; extendSelectors: any> = Record>(extension: (ctx: PlatePluginContext) => ES) => PlatePlugin, InferApi, InferTransforms, ES & InferSelectors>>; extendTransforms: any> = Record>(extension: (ctx: PlatePluginContext) => ET) => PlatePlugin, InferApi, InferTransforms & Record, InferSelectors>>; overrideEditor: (override: OverrideEditor) => PlatePlugin; /** Returns a new instance of the plugin with the component. */ withComponent: (component: NodeComponent) => PlatePlugin; __resolved?: boolean; }; type PlatePlugins = AnyPlatePlugin[]; type RenderNodeWrapper = (props: RenderNodeWrapperProps) => RenderNodeWrapperFunction; type RenderNodeWrapperFunction = ((elementProps: PlateElementProps) => React$1.ReactNode) | undefined; interface RenderNodeWrapperProps extends PlateElementProps { key: string; } type Serializer = BaseSerializer & { parser?: (options: PlatePluginContext & { node: Descendant; }) => any; query?: (options: PlatePluginContext & { node: Descendant; }) => boolean; }; type Shortcut = HotkeysOptions & { keys?: Keys | null; priority?: number; handler?: (ctx: { editor: PlateEditor; event: KeyboardEvent; eventDetails: HotkeysEvent; }) => boolean | void; }; type Shortcuts = Record; type TextNodeProps = ((props: PlateLeafProps) => AnyObject | undefined) | AnyObject; type TransformOptions = BaseTransformOptions & PlatePluginContext; /** Hook called when the editor is initialized. */ type UseHooks = (ctx: PlatePluginContext) => void; declare function EditorRefPluginEffect({ id, plugin, }: { plugin: AnyEditorPlatePlugin; id?: string; }): null; declare function EditorRefEffect({ id }: { id?: string; }): React$1.JSX.Element; /** * Get the element by plugin key. If no element is found in the context, it will * return an empty object. */ declare const useElement: (pluginKey?: string) => T; interface UseElementSelectorOptions { key?: string; equalityFn?: (a: T, b: T) => boolean; } declare const useElementSelector: (selector: (state: NodeEntry, prev?: T) => T, deps: React$1.DependencyList, { key, equalityFn, }?: UseElementSelectorOptions) => T; declare const SCOPE_ELEMENT = "element"; type ElementStoreState = { element: TElement; entry: ElementEntry; path: Path; }; declare const ElementProvider: React$1.FC>; declare const elementStore: jotai_x.StoreApi; declare const useElementStore: jotai_x.UseStoreApi; /** Get the memoized path of the closest element. */ declare const usePath: (pluginKey?: string) => Path; /** Get last event editor id: focus, blur or last. */ declare const useEventPlateId: (id?: string) => string; type PlateChangeKey = 'versionDecorate' | 'versionEditor' | 'versionSelection' | 'versionValue'; type PlateStoreState = Nullable<{ composing: boolean; decorate: NonNullable<(options: { editor: E; entry: NodeEntry; }) => TRange[]>; /** Whether `Editable` is rendered so slate DOM is resolvable. */ isMounted: boolean; /** * Whether the editor is primary. If no editor is active, then PlateController * will use the first-mounted primary editor. * * @default true */ primary: boolean; readOnly: boolean; renderElement: NonNullable; renderLeaf: NonNullable; renderText: NonNullable; /** * Version incremented when calling `redecorate`. This is a dependency of the * `decorate` function. */ versionDecorate: number; /** Version incremented on each editor change. */ versionEditor: number; /** Version incremented on each editor.selection change. */ versionSelection: number; /** Version incremented on each editor.children change. */ versionValue: number; /** Controlled callback called when the editor state changes. */ onChange: (options: { editor: E; value: ValueOf; }) => void; /** Controlled callback called when the editor.selection changes. */ onSelectionChange: (options: { editor: E; selection: TSelection; }) => void; /** Controlled callback called when the editor.children changes. */ onValueChange: (options: { editor: E; value: ValueOf; }) => void; }> & { /** * A unique id used as a provider scope. Use it if you have multiple `Plate` * in the same React tree. * * @default random id */ id: string; /** A reference to the editor container element. */ containerRef: React.RefObject; /** * Slate editor reference. * * @default createPlateFallbackEditor() */ editor: E; /** * A reference to the editor scroll container element. * * @default containerRef */ scrollRef: React.RefObject; }; type PlateStore = ReturnType; declare const PLATE_SCOPE = "plate"; declare const GLOBAL_PLATE_SCOPE: unique symbol; declare const createPlateStore: ({ id, composing, containerRef, decorate, editor, isMounted, primary, readOnly, renderElement, renderLeaf, renderText, scrollRef, versionDecorate, versionEditor, versionSelection, versionValue, onChange, onSelectionChange, onValueChange, ...state }?: Partial>) => jotai_x.AtomStoreApi, { trackedEditor: jotai.Atom<{ editor: any; version: number | null; }>; trackedSelection: jotai.Atom<{ selection: any; version: number | null; }>; trackedValue: jotai.Atom<{ value: any; version: number | null; }>; }, "plate">; declare const PlateStoreProvider: React$1.FC _udecode_slate.TRange[]) | null; isMounted: boolean | null; primary: boolean | null; readOnly: boolean | null; renderElement: RenderElementFn | null; renderLeaf: RenderLeafFn | null; renderText: RenderTextFn | null; versionDecorate: number | null; versionEditor: number | null; versionSelection: number | null; versionValue: number | null; onChange: ((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null; onSelectionChange: ((options: { editor: PlateEditor; selection: _udecode_slate.TSelection; }) => void) | null; onValueChange: ((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null; id: string; containerRef: React$1.RefObject; editor: PlateEditor; scrollRef: React$1.RefObject; }>>; declare const plateStore: jotai_x.StoreApi, { trackedEditor: jotai.Atom<{ editor: any; version: number | null; }>; trackedSelection: jotai.Atom<{ selection: any; version: number | null; }>; trackedValue: jotai.Atom<{ value: any; version: number | null; }>; }, "plate">; declare const usePlateLocalSet: (key: K, options?: string | jotai_x.UseAtomOptions) => ({ composing: jotai_x.SimpleWritableAtom; decorate: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; entry: _udecode_slate.NodeEntry; }) => _udecode_slate.TRange[]) | null>; isMounted: jotai_x.SimpleWritableAtom; primary: jotai_x.SimpleWritableAtom; readOnly: jotai_x.SimpleWritableAtom; renderElement: jotai_x.SimpleWritableAtom; renderLeaf: jotai_x.SimpleWritableAtom; renderText: jotai_x.SimpleWritableAtom; versionDecorate: jotai_x.SimpleWritableAtom; versionEditor: jotai_x.SimpleWritableAtom; versionSelection: jotai_x.SimpleWritableAtom; versionValue: jotai_x.SimpleWritableAtom; onChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null>; onSelectionChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; selection: _udecode_slate.TSelection; }) => void) | null>; onValueChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null>; id: jotai_x.SimpleWritableAtom; containerRef: jotai_x.SimpleWritableAtom>; editor: jotai_x.SimpleWritableAtom; scrollRef: jotai_x.SimpleWritableAtom>; } & { trackedEditor: jotai.Atom<{ editor: any; version: number | null; }>; trackedSelection: jotai.Atom<{ selection: any; version: number | null; }>; trackedValue: jotai.Atom<{ value: any; version: number | null; }>; })[K] extends jotai.WritableAtom ? (...args: A) => R : never; declare const usePlateLocalState: (key: K, options?: string | jotai_x.UseAtomOptions) => ({ composing: jotai_x.SimpleWritableAtom; decorate: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; entry: _udecode_slate.NodeEntry; }) => _udecode_slate.TRange[]) | null>; isMounted: jotai_x.SimpleWritableAtom; primary: jotai_x.SimpleWritableAtom; readOnly: jotai_x.SimpleWritableAtom; renderElement: jotai_x.SimpleWritableAtom; renderLeaf: jotai_x.SimpleWritableAtom; renderText: jotai_x.SimpleWritableAtom; versionDecorate: jotai_x.SimpleWritableAtom; versionEditor: jotai_x.SimpleWritableAtom; versionSelection: jotai_x.SimpleWritableAtom; versionValue: jotai_x.SimpleWritableAtom; onChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null>; onSelectionChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; selection: _udecode_slate.TSelection; }) => void) | null>; onValueChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null>; id: jotai_x.SimpleWritableAtom; containerRef: jotai_x.SimpleWritableAtom>; editor: jotai_x.SimpleWritableAtom; scrollRef: jotai_x.SimpleWritableAtom>; } & { trackedEditor: jotai.Atom<{ editor: any; version: number | null; }>; trackedSelection: jotai.Atom<{ selection: any; version: number | null; }>; trackedValue: jotai.Atom<{ value: any; version: number | null; }>; })[K] extends jotai.WritableAtom ? [V, (...args: A) => R] : never; declare const usePlateLocalStore: jotai_x.UseStoreApi, { trackedEditor: jotai.Atom<{ editor: any; version: number | null; }>; trackedSelection: jotai.Atom<{ selection: any; version: number | null; }>; trackedValue: jotai.Atom<{ value: any; version: number | null; }>; }>; declare const usePlateLocalValue: ; decorate: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; entry: _udecode_slate.NodeEntry; }) => _udecode_slate.TRange[]) | null>; isMounted: jotai_x.SimpleWritableAtom; primary: jotai_x.SimpleWritableAtom; readOnly: jotai_x.SimpleWritableAtom; renderElement: jotai_x.SimpleWritableAtom; renderLeaf: jotai_x.SimpleWritableAtom; renderText: jotai_x.SimpleWritableAtom; versionDecorate: jotai_x.SimpleWritableAtom; versionEditor: jotai_x.SimpleWritableAtom; versionSelection: jotai_x.SimpleWritableAtom; versionValue: jotai_x.SimpleWritableAtom; onChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null>; onSelectionChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; selection: _udecode_slate.TSelection; }) => void) | null>; onValueChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null>; id: jotai_x.SimpleWritableAtom; containerRef: jotai_x.SimpleWritableAtom>; editor: jotai_x.SimpleWritableAtom; scrollRef: jotai_x.SimpleWritableAtom>; } & { trackedEditor: jotai.Atom<{ editor: any; version: number | null; }>; trackedSelection: jotai.Atom<{ selection: any; version: number | null; }>; trackedValue: jotai.Atom<{ value: any; version: number | null; }>; })[K] extends jotai.Atom ? V : never>(key: K, options?: ({ selector?: ((v: ({ composing: jotai_x.SimpleWritableAtom; decorate: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; entry: _udecode_slate.NodeEntry; }) => _udecode_slate.TRange[]) | null>; isMounted: jotai_x.SimpleWritableAtom; primary: jotai_x.SimpleWritableAtom; readOnly: jotai_x.SimpleWritableAtom; renderElement: jotai_x.SimpleWritableAtom; renderLeaf: jotai_x.SimpleWritableAtom; renderText: jotai_x.SimpleWritableAtom; versionDecorate: jotai_x.SimpleWritableAtom; versionEditor: jotai_x.SimpleWritableAtom; versionSelection: jotai_x.SimpleWritableAtom; versionValue: jotai_x.SimpleWritableAtom; onChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null>; onSelectionChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; selection: _udecode_slate.TSelection; }) => void) | null>; onValueChange: jotai_x.SimpleWritableAtom<((options: { editor: PlateEditor; value: _udecode_slate.Value; }) => void) | null>; id: jotai_x.SimpleWritableAtom; containerRef: jotai_x.SimpleWritableAtom>; editor: jotai_x.SimpleWritableAtom; scrollRef: jotai_x.SimpleWritableAtom>; } & { trackedEditor: jotai.Atom<{ editor: any; version: number | null; }>; trackedSelection: jotai.Atom<{ selection: any; version: number | null; }>; trackedValue: jotai.Atom<{ value: any; version: number | null; }>; })[K] extends jotai.Atom ? V_1 : never, prevSelectorOutput?: S | undefined) => S) | undefined; equalityFn?: ((prev: S, next: S) => boolean) | undefined; } & jotai_x.UseAtomOptions) | undefined, deps?: unknown[]) => S; declare const usePlateStore: (id?: string) => jotai_x.ReturnOfUseStoreApi, { trackedEditor: jotai.Atom<{ editor: any; version: number | null; }>; trackedSelection: jotai.Atom<{ selection: any; version: number | null; }>; trackedValue: jotai.Atom<{ value: any; version: number | null; }>; }>; declare const usePlateSet: typeof usePlateLocalSet; declare const usePlateValue: typeof usePlateLocalValue; declare const usePlateState: typeof usePlateLocalState; /** Get the closest `Plate` id. */ declare const useEditorId: () => string; declare const useEditorContainerRef: (id?: string) => React$1.RefObject; declare const useEditorScrollRef: (id?: string) => React$1.RefObject; /** Returns the scrollRef if it exists, otherwise returns the containerRef. */ declare const useScrollRef: (id?: string) => React$1.RefObject; declare const useEditorMounted: (id?: string) => boolean; /** * Whether the editor is read-only. You can also use `useReadOnly` from * `slate-react` in node components. */ declare const useEditorReadOnly: (id?: string) => boolean; /** Whether the editor is composing. */ declare const useEditorComposing: (id?: string) => boolean; /** * Get a reference to the editor instance that remains stable across re-renders. * The editor object is enhanced with a `store` property that provides access to * the Plate store. * * @example * ```tsx * const editor = useEditorRef(); * const readOnly = useAtomStoreValue(editor.store, 'readOnly'); */ declare const useEditorRef: (id?: string) => E & { store: PlateStore; }; /** Get the editor selection (deeply memoized). */ declare const useEditorSelection: (id?: string) => any; /** Get editor state which is updated on editor change. */ declare const useEditorState: (id?: string) => E; /** Version incremented on each editor change. */ declare const useEditorVersion: (id?: string) => number | null; /** Version incremented on selection change. */ declare const useSelectionVersion: (id?: string) => number | null; /** Get the editor value (deeply memoized). */ declare const useEditorValue: (id?: string) => any; /** Version incremented on value change. */ declare const useValueVersion: (id?: string) => number | null; declare const useIncrementVersion: (key: PlateChangeKey, id?: string) => () => void; declare const useRedecorate: (id?: string) => () => void; /** Get editor and plugin context. */ declare function useEditorPlugin

, E extends PlateEditor = PlateEditor>(p: WithRequiredKey

, id?: string): PlatePluginContext extends never ? P : InferConfig

, E> & { store: PlateStore; }; interface UseEditorSelectorOptions { id?: string; equalityFn?: (a: T, b: T) => boolean; } declare const useEditorSelector: (selector: (editor: E, prev?: T) => T, deps: React$1.DependencyList, { id, equalityFn }?: UseEditorSelectorOptions) => T; /** * Hook to access plugin options. For usage outside ``, use * `useEditorPluginOption` instead. * * @example * const value = usePluginOption(plugin, 'value'); * const doubleValue = usePluginOption(plugin, 'doubleValue', 2); */ declare function usePluginOption, TSelectors extends InferSelectors, K extends keyof StateType | keyof TSelectors | 'state'>(plugin: WithRequiredKey, key: K, ...args: [ ...(K extends keyof TSelectors ? Parameters : unknown[]), TEqualityChecker : K extends keyof StateType ? StateType[K] : never>? ]): K extends 'state' ? StateType : K extends keyof TSelectors ? ReturnType : K extends keyof StateType ? StateType[K] : never; declare function useEditorPluginOption, TSelectors extends InferSelectors, K extends keyof StateType | keyof TSelectors | 'state'>(editor: PlateEditor, plugin: WithRequiredKey, key: K, ...args: [ ...(K extends keyof TSelectors ? Parameters : unknown[]), TEqualityChecker : K extends keyof StateType ? StateType[K] : never>? ]): K extends 'state' ? StateType : K extends keyof TSelectors ? ReturnType : K extends keyof StateType ? StateType[K] : never; /** * Use zustand store selector. * * @example * const name = usePluginOptions(plugin, (state) => state.name, equalityFn); */ declare function usePluginOptions(plugin: WithRequiredKey, selector: (state: InferOptions) => U, { id, equalityFn, }?: { id?: string; equalityFn?: (a: U, b: U) => boolean; }): U; declare function useEditorPluginOptions(editor: PlateEditor, plugin: WithRequiredKey, selector: (state: InferOptions) => U, { equalityFn, }?: { equalityFn?: (a: U, b: U) => boolean; }): U; declare const PlateController: React$1.FC(atom: Atom) => Value; set: (atom: jotai.WritableAtom, ...args: Args) => Result; sub: (atom: Atom, listener: () => void) => () => void; } & Partial<{ dev_subscribe_store: (l: (action: { type: "write"; flushed: Set>; } | { type: "async-write"; flushed: Set>; } | { type: "sub"; flushed: Set>; } | { type: "unsub"; } | { type: "restore"; flushed: Set>; }) => void, rev: 2) => () => void; dev_get_mounted_atoms: () => IterableIterator>; dev_get_atom_state: (a: Atom) => ({ d: Map, /*elided*/ any & ({ e: unknown; } | { v: unknown; })>; } & ({ e: unknown; } | { v: unknown; })) | undefined; dev_get_mounted: (a: Atom) => { l: Set<() => void>; t: Set>; u?: () => void; } | undefined; dev_restore_atoms: (values: Iterable, unknown]>) => void; }>) | null>; primaryEditorIds: string[]; }>>; declare const plateControllerStore: jotai_x.StoreApi<{ activeId: jotai.PrimitiveAtom & { init: string | null; }; editorStores: jotai.PrimitiveAtom(atom: Atom) => Value; set: (atom: jotai.WritableAtom, ...args: Args) => Result; sub: (atom: Atom, listener: () => void) => () => void; } & Partial<{ dev_subscribe_store: (l: (action: { type: "write"; flushed: Set>; } | { type: "async-write"; flushed: Set>; } | { type: "sub"; flushed: Set>; } | { type: "unsub"; } | { type: "restore"; flushed: Set>; }) => void, rev: 2) => () => void; dev_get_mounted_atoms: () => IterableIterator>; dev_get_atom_state: (a: Atom) => ({ d: Map, /*elided*/ any & ({ e: unknown; } | { v: unknown; })>; } & ({ e: unknown; } | { v: unknown; })) | undefined; dev_get_mounted: (a: Atom) => { l: Set<() => void>; t: Set>; u?: () => void; } | undefined; dev_restore_atoms: (values: Iterable, unknown]>) => void; }>) | null>> & { init: Record(atom: Atom) => Value; set: (atom: jotai.WritableAtom, ...args: Args) => Result; sub: (atom: Atom, listener: () => void) => () => void; } & Partial<{ dev_subscribe_store: (l: (action: { type: "write"; flushed: Set>; } | { type: "async-write"; flushed: Set>; } | { type: "sub"; flushed: Set>; } | { type: "unsub"; } | { type: "restore"; flushed: Set>; }) => void, rev: 2) => () => void; dev_get_mounted_atoms: () => IterableIterator>; dev_get_atom_state: (a: Atom) => ({ d: Map, /*elided*/ any & ({ e: unknown; } | { v: unknown; })>; } & ({ e: unknown; } | { v: unknown; })) | undefined; dev_get_mounted: (a: Atom) => { l: Set<() => void>; t: Set>; u?: () => void; } | undefined; dev_restore_atoms: (values: Iterable, unknown]>) => void; }>) | null>; }; primaryEditorIds: jotai.PrimitiveAtom & { init: string[]; }; }, object, "plateController">; declare const _usePlateControllerStore: jotai_x.UseStoreApi<{ activeId: jotai.PrimitiveAtom & { init: string | null; }; editorStores: jotai.PrimitiveAtom(atom: Atom) => Value; set: (atom: jotai.WritableAtom, ...args: Args) => Result; sub: (atom: Atom, listener: () => void) => () => void; } & Partial<{ dev_subscribe_store: (l: (action: { type: "write"; flushed: Set>; } | { type: "async-write"; flushed: Set>; } | { type: "sub"; flushed: Set>; } | { type: "unsub"; } | { type: "restore"; flushed: Set>; }) => void, rev: 2) => () => void; dev_get_mounted_atoms: () => IterableIterator>; dev_get_atom_state: (a: Atom) => ({ d: Map, /*elided*/ any & ({ e: unknown; } | { v: unknown; })>; } & ({ e: unknown; } | { v: unknown; })) | undefined; dev_get_mounted: (a: Atom) => { l: Set<() => void>; t: Set>; u?: () => void; } | undefined; dev_restore_atoms: (values: Iterable, unknown]>) => void; }>) | null>> & { init: Record(atom: Atom) => Value; set: (atom: jotai.WritableAtom, ...args: Args) => Result; sub: (atom: Atom, listener: () => void) => () => void; } & Partial<{ dev_subscribe_store: (l: (action: { type: "write"; flushed: Set>; } | { type: "async-write"; flushed: Set>; } | { type: "sub"; flushed: Set>; } | { type: "unsub"; } | { type: "restore"; flushed: Set>; }) => void, rev: 2) => () => void; dev_get_mounted_atoms: () => IterableIterator>; dev_get_atom_state: (a: Atom) => ({ d: Map, /*elided*/ any & ({ e: unknown; } | { v: unknown; })>; } & ({ e: unknown; } | { v: unknown; })) | undefined; dev_get_mounted: (a: Atom) => { l: Set<() => void>; t: Set>; u?: () => void; } | undefined; dev_restore_atoms: (values: Iterable, unknown]>) => void; }>) | null>; }; primaryEditorIds: jotai.PrimitiveAtom & { init: string[]; }; }, object>; declare const usePlateControllerLocalStore: typeof _usePlateControllerStore; declare const usePlateControllerExists: () => boolean; /** * Retrieve from PlateController the JotaiStore for the editor with a given ID, * or the active editor if no ID is provided, or the first primary editor if no * editor is active, or null. */ declare const usePlateControllerStore: (idProp?: string) => JotaiStore | null; interface PlateProps extends Partial, 'decorate' | 'onChange' | 'onSelectionChange' | 'onValueChange' | 'primary' | 'readOnly'>> { children: React$1.ReactNode; editor: E | null; renderElement?: EditableProps['renderElement']; renderLeaf?: EditableProps['renderLeaf']; suppressInstanceWarning?: boolean; } declare function Plate(props: PlateProps): React$1.JSX.Element | null; declare const PlateContainer: { ({ children, ...props }: HTMLAttributes): React$1.JSX.Element; displayName: string; }; type PlateContentProps = Omit & { /** Autofocus when it becomes editable (readOnly false -> readOnly true) */ autoFocusOnEditable?: boolean; decorate?: PlateStoreState['decorate']; disabled?: boolean; /** R enders the editable content. */ renderEditable?: (editable: React$1.ReactElement) => React$1.ReactNode; }; /** * Editable with plugins. * * - Decorate prop * - DOM handler props * - ReadOnly prop * - Render.afterEditable * - Render.beforeEditable * - RenderElement prop * - RenderLeaf prop * - UseHooks */ declare const PlateContent: React$1.ForwardRefExoticComponent & { /** Autofocus when it becomes editable (readOnly false -> readOnly true) */ autoFocusOnEditable?: boolean; decorate?: PlateStoreState["decorate"]; disabled?: boolean; /** R enders the editable content. */ renderEditable?: (editable: React$1.ReactElement) => React$1.ReactNode; } & React$1.RefAttributes>; interface PlateControllerEffectProps { id?: string; } declare const PlateControllerEffect: ({ id: idProp, }: PlateControllerEffectProps) => null; /** * Slate with plugins. * * - OnChange prop * - RenderAboveSlate */ declare function PlateSlate({ id, children, }: { children: React$1.ReactNode; id?: string; }): React$1.ReactElement>; declare function PlateTest({ editableProps, shouldNormalizeEditor, variant, ...props }: CreatePlateEditorOptions & PlateProps & { editableProps?: PlateContentProps; variant?: 'comment' | 'wordProcessor'; }): React$1.JSX.Element; declare const useNodeAttributes: (props: any, ref?: any) => any; type PlateElementProps = PlateNodeProps & RenderElementProps & { path: Path; } & DeprecatedNodeProps; type DeprecatedNodeProps = { /** * @deprecated Optional class to be merged with `attributes.className`. * @default undefined */ className?: string; /** * @deprecated Optional style to be merged with `attributes.style` * @default undefined */ style?: React$1.CSSProperties; }; type PlateNodeProps = PlatePluginContext & { /** * Optional ref to be merged with `attributes.ref` * * @default undefined */ ref?: any; }; type PlateHTMLProps = PlateNodeProps & { /** HTML attributes to pass to the underlying HTML element */ attributes: React$1.PropsWithoutRef & UnknownObject; as?: T; /** Class to be merged with `attributes.className` */ className?: string; /** Style to be merged with `attributes.style` */ style?: React$1.CSSProperties; }; type StyledPlateElementProps = Omit, keyof DeprecatedNodeProps> & PlateHTMLProps & { insetProp?: boolean; }; declare const PlateElement: (props: StyledPlateElementProps) => React$1.ReactElement; type PlateTextProps = PlateNodeProps & RenderTextProps & DeprecatedNodeProps; type StyledPlateTextProps = Omit, keyof DeprecatedNodeProps> & PlateHTMLProps; declare const PlateText: (props: StyledPlateTextProps) => React$1.ReactElement; type PlateLeafProps = PlateNodeProps & RenderLeafProps & DeprecatedNodeProps & { inset?: boolean; }; type StyledPlateLeafProps = Omit, keyof DeprecatedNodeProps> & PlateHTMLProps; declare const PlateLeaf: ({ className, ...props }: StyledPlateLeafProps) => React$1.ReactElement; type RefComponent = React$1.FC

& { ref?: React$1.Ref; }; declare const withHOC: (HOC: RefComponent, Component: RefComponent, hocProps?: Omit, hocRef?: React$1.Ref) => React$1.ForwardRefExoticComponent & React$1.RefAttributes>; declare const useEditableProps: ({ disabled, readOnly, ...editableProps }?: Omit & Pick) => EditableProps; declare const useNodePath: (node: TNode) => _udecode_slate.Path | undefined; interface SlateProps extends UnknownObject { children: React$1.ReactNode; editor: Editor; initialValue: Value; onChange?: (value: Value) => void; onSelectionChange?: (selection: TSelection) => void; onValueChange?: (value: Value) => void; } /** Get Slate props stored in a global store. */ declare const useSlateProps: ({ id, }: { id?: string; }) => Omit; declare const createPlateFallbackEditor: (options?: CreatePlateEditorOptions) => TPlateEditor<_udecode_slate.Value, PlateCorePlugin>; declare const DOM_HANDLERS: (keyof DOMHandlers)[]; /** * Override node props with plugin props. Allowed properties in * `props.element.attributes` are passed into `props.attributes`. Extend the * class name with the node type. */ declare const getRenderNodeProps: ({ attributes: nodeAttributes, editor, plugin, props, readOnly, }: { editor: PlateEditor; props: PlateHTMLProps; attributes?: AnyObject; plugin?: AnyEditorPlatePlugin; readOnly?: boolean; }) => PlateHTMLProps; declare const convertDomEventToSyntheticEvent: (domEvent: Event) => React$1.SyntheticEvent; /** Check if an event is overrided by a handler. */ declare const isEventHandled: >(event: EventType, handler?: (event: EventType) => boolean | void) => boolean; /** * Generic pipe for handlers. * * - Get all the plugins handlers by `handlerKey`. * - If there is no plugin handler or editable prop handler for this key, return * `undefined`. * - Return a handler calling all the plugins handlers then the prop handler. * - Any handler returning true will stop the next handlers to be called, * including slate internal handler. */ declare const pipeHandler: (editor: PlateEditor, { editableProps, handlerKey, }: { handlerKey: K; editableProps?: Omit | null; }) => ((event: any) => void) | undefined; declare const pipeOnChange: (editor: PlateEditor, value: Value) => boolean; /** @see {@link RenderElement} */ declare const pipeRenderElement: (editor: PlateEditor, renderElementProp?: EditableProps["renderElement"]) => EditableProps["renderElement"]; /** @see {@link RenderLeaf} */ declare const pipeRenderLeaf: (editor: PlateEditor, renderLeafProp?: EditableProps["renderLeaf"]) => EditableProps["renderLeaf"]; /** @see {@link RenderText} */ declare const pipeRenderText: (editor: PlateEditor, renderTextProp?: EditableProps["renderText"]) => EditableProps["renderText"]; /** * Function used to render an element. If the function returns undefined then * the next RenderElement function is called. If the function renders a JSX * element then that JSX element is rendered. */ type RenderElement = (props: PlateElementProps) => React$1.ReactElement | undefined; declare function BelowRootNodes(props: any): React$1.JSX.Element; /** * Get a `Editable.renderElement` handler for `plugin.node.type`. If the type is * equals to the slate element type, render `plugin.render.node`. Else, return * `undefined` so the pipeline can check the next plugin. */ declare const pluginRenderElement: (editor: PlateEditor, plugin: AnyEditorPlatePlugin) => RenderElement; type RenderLeaf = (props: PlateLeafProps) => React$1.ReactElement; /** * Get a `Editable.renderLeaf` handler for `plugin.node.type`. If the type is * equals to the slate leaf type, render `plugin.render.node`. Else, return * `children`. */ declare const pluginRenderLeaf: (editor: PlateEditor, plugin: AnyEditorPlatePlugin) => RenderLeaf; type RenderText = (props: PlateTextProps) => React$1.ReactElement; /** * Get a `Editable.renderText` handler for `plugin.node.type`. If the type is * equals to the slate text type and isDecoration is false, render * `plugin.render.node`. Else, return the default text rendering. */ declare const pluginRenderText: (editor: PlateEditor, plugin: AnyEditorPlatePlugin) => RenderText; export { type AnyEditorPlatePlugin, type AnyPlatePlugin, BLUR_EDITOR_EVENT, BelowRootNodes, type CreatePlateEditorOptions, type DOMHandler, type DOMHandlers, DOM_HANDLERS, type Decorate, type Deserializer, type EditableSiblingComponent, EditorHotkeysEffect, EditorMethodsEffect, type EditorPlatePlugin, EditorRefEffect, EditorRefPluginEffect, ElementProvider, type ElementStoreState, EventEditorPlugin, type EventEditorState, EventEditorStore, type ExtendEditor, type ExtendEditorApi, type ExtendEditorTransforms, FOCUS_EDITOR_EVENT, GLOBAL_PLATE_SCOPE, type HtmlDeserializer, type HtmlReactSerializer, type HtmlSerializer, type InferConfig, type InjectNodeProps, type KeyboardHandler, type KeyofPlugins, type LeafNodeProps, type NodeProps, type NodeWrapperComponent, type NodeWrapperComponentProps, type NodeWrapperComponentReturnType, type NormalizeInitialValue, type OnChange, type OverrideEditor, PLATE_SCOPE, ParagraphPlugin, type Parser, Plate, type PlateChangeKey, PlateContainer, PlateContent, type PlateContentProps, PlateController, PlateControllerEffect, type PlateControllerEffectProps, type PlateCorePlugin, type PlateEditor, PlateElement, type PlateElementProps, type PlateHTMLProps, PlateLeaf, type PlateLeafProps, type PlateNodeProps, type PlatePlugin, type PlatePluginConfig, type PlatePluginContext, type PlatePluginMethods, type PlatePlugins, type PlateProps, PlateSlate, type PlateStore, PlateStoreProvider, type PlateStoreState, PlateTest, PlateText, type PlateTextProps, ReactPlugin, type RenderElement, type RenderLeaf, type RenderNodeWrapper, type RenderNodeWrapperFunction, type RenderNodeWrapperProps, type RenderText, SCOPE_ELEMENT, type Serializer, type Shortcut, type Shortcuts, SlateReactExtensionPlugin, type StyledPlateElementProps, type StyledPlateLeafProps, type StyledPlateTextProps, type TPlateEditor, type TextNodeProps, type TransformOptions, type UseEditorSelectorOptions, type UseHooks, type WithPlateOptions, convertDomEventToSyntheticEvent, createPlateEditor, createPlateFallbackEditor, createPlatePlugin, createPlateStore, createTPlatePlugin, elementStore, getEditorPlugin, getEventPlateId, getPlateCorePlugins, getPlugin, getRenderNodeProps, isEventHandled, omitPluginContext, pipeHandler, pipeOnChange, pipeRenderElement, pipeRenderLeaf, pipeRenderText, plateControllerStore, plateStore, pluginRenderElement, pluginRenderLeaf, pluginRenderText, toPlatePlugin, toTPlatePlugin, useEditableProps, useEditorComposing, useEditorContainerRef, useEditorId, useEditorMounted, useEditorPlugin, useEditorPluginOption, useEditorPluginOptions, useEditorReadOnly, useEditorRef, useEditorScrollRef, useEditorSelection, useEditorSelector, useEditorState, useEditorValue, useEditorVersion, useElement, useElementSelector, useElementStore, useEventEditorValue, useEventPlateId, useFocusEditorEvents, useIncrementVersion, useNodeAttributes, useNodePath, usePath, usePlateControllerExists, usePlateControllerLocalStore, usePlateControllerStore, usePlateEditor, usePlateLocalStore, usePlateSet, usePlateState, usePlateStore, usePlateValue, usePluginOption, usePluginOptions, useRedecorate, useScrollRef, useSelectionVersion, useSlateProps, useValueVersion, withHOC, withPlate, withPlateReact };