import { n as FieldProps } from "../../../Field-DhaPMGcl.mjs"; import { ReactNode, RefObject } from "react"; import { VariantProps } from "class-variance-authority"; import { z } from "zod/v4-mini"; import { FieldName } from "@conform-to/react/future"; import { SerializedEditorState } from "lexical"; //#region src/components/fields/wysiwyg/style.d.ts declare const toolbarVariants: (props?: ({ sticky?: "allDevice" | "mobileOnly" | boolean | null | undefined; visible?: "always" | "custom" | "desktopOnly" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; type ToolbarVariantProps = VariantProps; declare const defaultContentEditableStyle = "p8n-editor-input border-custom-2 rounded-b-2xl border border-t-0 p-2 -outline-offset-2"; declare const chatContentEditableStyle = "p8n-editor-input border-custom-2 rounded-2xl border px-2 py-1 -outline-offset-2 lg:py-2 lg:border-t-0 lg:rounded-t-none"; declare const contentEditableStyles: { normal: string; withoutToolbarOnMobile: string; }; //#endregion //#region src/components/fields/wysiwyg/types.d.ts type WysiwygValue = { html?: string; state: SerializedEditorState; }; declare const wysiwygSchema: z.ZodMiniObject<{ html: z.ZodMiniOptional>; state: z.ZodMiniCustom, SerializedEditorState>; }, z.core.$strip>; declare function parseStringifiedWysiwygValue(payload: unknown): WysiwygValue | null; declare function serializeWysiwygValue(value: unknown): string | null; declare function isWysiwygStateEmpty(value: WysiwygValue): boolean; //#endregion //#region src/components/fields/wysiwyg/Wysiwyg.d.ts interface Props$2 { id?: string; extendedToolbar?: boolean; floatingPosition?: "top" | "bottom"; defaultValue?: WysiwygValue; disabled?: boolean; readOnly?: boolean; proseCompact?: boolean; contentEditableBaseStyle?: "normal" | "withoutToolbarOnMobile"; /** * If you want to define custom height */ contentEditableClassName?: string; containerClassName?: string; /** * by default sticky is only available for mobile device with a top-0 if * you want to change this provide your own className */ toolbarSticky?: ToolbarVariantProps["sticky"]; toolbarVisible?: ToolbarVariantProps["visible"]; ref?: RefObject; debounceChange?: number | false; onChange?: (value: WysiwygValue) => void; children?: ReactNode; } interface WysiwygRef { getValue: () => WysiwygValue; setHtml: (html: string, fireEvent?: boolean) => void; getState: () => SerializedEditorState; setState: (state: SerializedEditorState, fireEvent?: boolean) => void; clear: (fireEvent?: boolean) => void; } declare function Wysiwyg({ id, floatingPosition, extendedToolbar, proseCompact, defaultValue, disabled, readOnly, contentEditableBaseStyle, contentEditableClassName, containerClassName, ref, toolbarSticky, toolbarVisible, debounceChange, onChange, children }: Props$2): import("react").JSX.Element; //#endregion //#region src/components/fields/wysiwyg/WysiwygField.d.ts interface Props$1 extends Omit { name: FieldName; ref?: RefObject; debounceChange?: number | false; toolbarSticky?: ToolbarVariantProps["sticky"]; contentEditableClassName?: string; containerClassName?: string; disabled?: boolean; readOnly?: boolean; } declare function WysiwygField({ name, ref, debounceChange, toolbarSticky, contentEditableClassName, containerClassName, disabled, readOnly, id: forcedId, ...rest }: Props$1): import("react").JSX.Element; //#endregion //#region src/components/fields/wysiwyg/WysiwygReader.d.ts interface Props { value: WysiwygValue; proseCompact?: boolean; className?: string; } declare function WysiwygReader({ value, proseCompact, className }: Props): import("react").JSX.Element; //#endregion //#region src/components/fields/wysiwyg/config/html.d.ts /** * Sérialise un `state` en HTML statique via un éditeur jetable (jamais monté dans le DOM), * pour un affichage en lecture seule sans payer le coût d'un LexicalComposer complet. */ declare function stateToHtml(state: SerializedEditorState): string; //#endregion //#region src/components/fields/wysiwyg/config/state.d.ts declare function isStateEmpty(state: SerializedEditorState): boolean; //#endregion //#region src/components/fields/wysiwyg/config/validation.d.ts declare function isPlausibleLexicalState(state: unknown): state is SerializedEditorState; declare function isValidLexicalState(state: unknown): state is SerializedEditorState; //#endregion //#region src/components/fields/wysiwyg/plugins/SubmitOnEnterPlugin.d.ts interface SubmitOnEnterPluginProps { /** * When true, Shift+Enter or Ctrl+Enter submits the form and Enter inserts * a newline (inverse of the default Enter-to-submit behavior). */ submitOnShiftOrCtrlEnter?: boolean; } declare function SubmitOnEnterPlugin({ submitOnShiftOrCtrlEnter }: SubmitOnEnterPluginProps): null; //#endregion export { SubmitOnEnterPlugin, Wysiwyg, WysiwygField, WysiwygReader, type WysiwygRef, type WysiwygValue, chatContentEditableStyle, contentEditableStyles, defaultContentEditableStyle, isPlausibleLexicalState, isStateEmpty, isValidLexicalState, isWysiwygStateEmpty, parseStringifiedWysiwygValue, serializeWysiwygValue, stateToHtml, toolbarVariants, wysiwygSchema }; //# sourceMappingURL=index.d.mts.map