import { type ComponentType, type ReactElement } from "react"; import { type IExecutionConfig, type IFilter, type ISeparators, type ObjRef } from "@gooddata/sdk-model"; import { type OnError, type OnLoadingChanged } from "@gooddata/sdk-ui"; import { type RichTextFeature } from "./plugins/remark-markdown-features.js"; /** * @internal */ export interface IRichTextProps { value: string; onChange?: (text: string) => void; renderMode?: "view" | "edit"; editPlaceholder?: string; execConfig?: IExecutionConfig; editRows?: number; emptyElement?: ReactElement; className?: string; referencesEnabled?: boolean; /** * Which markdown features are recognised, narrowing what the text may contain. Syntax for a * feature left out renders as the characters that were typed rather than as markup. Omit for * full CommonMark; pass `[]` for no markup at all. * * Paragraphs, trailing-whitespace line breaks and backslash escapes are recognised whatever * is asked for: escapes are the only way to write a marker literally, and text needs * paragraphs to be text. `backslashBreaks` adds the backslash spelling of a line break on top. * * `html` only governs whether HTML syntax is *recognised*, which affects block structure. * A tag is rendered as the characters that were typed either way — there is no `rehype-raw`. * * `typedWhitespace` keeps the whitespace CommonMark drops. Blank lines at the start and the end * of the text, every blank line beyond the first between two blocks, and every line of text * that holds only blank lines or spaces become `.gd-rich-text-blank-line` elements one line * tall, which this component's stylesheet lays out. Spaces and newlines inside paragraphs and * headings, and the indentation of a paragraph's lines, stay in the text, but only show where * the host lays that text out with `white-space: pre-wrap`: in paragraphs, headings and list * items that hold only inline text, not in a list item that holds blocks, whose newlines sit * between the blocks. The host must also hide `
`, which arrives followed by a newline of * its own and would break the line twice. Blank lines between list items are not kept. * * Applies to `renderMode="view"`; the editor takes whatever is typed either way. */ allowedMarkdown?: readonly RichTextFeature[]; /** * If provided, the textarea starts at just 1 row, * resizing dynamically up to editRows value. */ autoResize?: boolean; /** * This will enable of rendering hidden input with markdown content * and data attributes for export purposes. */ rawContent?: { show: boolean; dataAttributes?: Record; }; /** * Filters to be used for rendering references. */ filters?: IFilter[]; /** * References the current user is not allowed to read. Each of them renders as a marker in place * of its value, and is left out of the execution that resolves the remaining references — one * execution serves them all, and it fails as a whole if it asks for a restricted object. */ restrictedReferences?: ObjRef[]; /** * The display text of every parameter the text may name, by parameter identifier. Without it a * `{parameter/}` token stays as it was typed. */ parameterDisplayValues?: ReadonlyMap; /** * The reference execution waits while the filters, or the parameters they use, load. */ isExecutionInputLoading?: boolean; /** * Separators to be used for rendering references. */ separators?: ISeparators; /** * @alpha */ onLoadingChanged?: OnLoadingChanged; /** * @alpha */ onError?: OnError; LoadingComponent?: ComponentType; } /** * @internal */ export declare function RichText(props: IRichTextProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=RichText.d.ts.map