import { ComponentProps, CompositionContext, SlotDefinition } from '@uniformdev/canvas-next-rsc-shared'; export { ComponentProps, CompositionContext } from '@uniformdev/canvas-next-rsc-shared'; import React, { PropsWithChildren, ReactNode, Key } from 'react'; export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-CfpHU4f0.js'; import { ComponentInstance } from '@uniformdev/canvas'; import { RichTextNode } from '@uniformdev/richtext'; import { PureUniformTextProps } from '@uniformdev/canvas-react/core'; export { ClientContextComponent, createClientUniformContext, useInitUniformContext, useUniformContext } from '@uniformdev/canvas-next-rsc-client'; declare const DefaultNotImplementedComponent: ({ component }: ComponentProps) => React.JSX.Element | null; type RichTextComponentProps = { node: TNode; }; type RichTextRendererComponent = React.ComponentType>>; /** * Function that maps a Rich Text node instance to its React component to render it. * The resolver would commonly inspect the `type` of the component to decide. */ type RenderRichTextComponentResolver = (node: RichTextNode) => RichTextRendererComponent | null | undefined; type UniformRichTextProps = { /** * The name of the HTML tag to render. * @default "div" */ as?: React.ElementType; /** The ID of the parameter. */ parameterId: string; /** * A function which can provide a custom react component * for rendering a rich text node */ resolveRichTextRenderer?: RenderRichTextComponentResolver; /** The component instance. */ component: ComponentInstance; context?: Pick; /** * Sets the value to show in Canvas editor when the parameter value is empty. * Can be a static string, or a function to generate the placeholder out of parameter info. * @default undefined */ placeholder?: string | ((parameter: { id: string; }) => string | undefined); } & Omit, 'children' | 'placeholder'>; /** * Adds rendering support for Uniform Rich Text parameters */ declare const UniformRichText: React.ForwardRefExoticComponent<{ /** * The name of the HTML tag to render. * @default "div" */ as?: React.ElementType; /** The ID of the parameter. */ parameterId: string; /** * A function which can provide a custom react component * for rendering a rich text node */ resolveRichTextRenderer?: RenderRichTextComponentResolver; /** The component instance. */ component: ComponentInstance; context?: Pick; /** * Sets the value to show in Canvas editor when the parameter value is empty. * Can be a static string, or a function to generate the placeholder out of parameter info. * @default undefined */ placeholder?: string | ((parameter: { id: string; }) => string | undefined); } & Omit, "children" | "placeholder"> & React.RefAttributes>; type UniformRichTextNodeProps = { node: RichTextNode; resolveRichTextRenderer?: RenderRichTextComponentResolver; }; /** * Render a single RichText node */ declare function UniformRichTextNode({ node, ...props }: UniformRichTextNodeProps): React.JSX.Element | null; type CustomSlotChildRenderFunc = (options: { child: ReactNode; component: ComponentInstance; key: Key; slotName: string; slotIndex: number; }) => ReactNode; type UniformSlotProps = { data: ComponentInstance; context: CompositionContext; slot: SlotDefinition | undefined; children?: CustomSlotChildRenderFunc; }; declare const UniformSlot: ({ data, slot, children }: UniformSlotProps) => ReactNode[]; type UniformTextProps = { context: Pick; } & Omit; declare const UniformText: ({ context, ...rest }: UniformTextProps) => React.JSX.Element; export { type CustomSlotChildRenderFunc, DefaultNotImplementedComponent, UniformRichText, UniformRichTextNode, type UniformRichTextNodeProps, type UniformRichTextProps, UniformSlot, type UniformSlotProps, UniformText, type UniformTextProps };