UNPKG

@wordpress/components

Version:
31 lines • 1.6 kB
/** * A presentational `contentEditable` form control: a labeled editable element * rendered with the chrome (`BaseControl` + label) shared by the other form * controls in the package. * * Unlike the in-canvas `RichText` from `@wordpress/block-editor`, this control * is intended for standalone form fields (DataForms, sidebar inputs, etc.). * It is deliberately **presentational only** and has no `@wordpress/rich-text` * dependency: the editable behavior (value, formatting, keyboard shortcuts) * and any focus/selection tracking are owned by the consumer, which wires them * through the forwarded ref and native event props (see the richtext DataForm * control in `@wordpress/dataviews` for the canonical assembly). * * ```jsx * // The rich-text "assembly" lives in the consumer. * <ContentEditableControl * label="Caption" * ref={ mergedRef } * onFocus={ onEditableFocus } * onBlur={ onEditableBlur } * /> * ``` */ export declare const ContentEditableControl: import("react").ForwardRefExoticComponent<Pick<import("../base-control/types").BaseControlProps, "className" | "help" | "hideLabelFromVision"> & { label: string; disabled?: boolean; required?: boolean; placeholder?: string; } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "as" | "children" | "className" | "disabled" | "help" | "hideLabelFromVision" | "label" | "placeholder" | "required"> & import("react").RefAttributes<HTMLDivElement>>; export default ContentEditableControl; //# sourceMappingURL=index.d.ts.map