UNPKG

@empoleon/tiptap

Version:

Rich text editor based on tiptap

51 lines (50 loc) 1.88 kB
import { BoxProps, CompoundStylesApiProps, ElementProps, Factory } from '@empoleon/core'; import { RichTextEditorLabels } from '../labels'; import { Component, JSX } from 'solid-js'; export type RichTextEditorControlStylesNames = 'control'; export interface RichTextEditorControlProps extends BoxProps, CompoundStylesApiProps<RichTextEditorControlFactory>, ElementProps<'button'> { /** Determines whether the control should have active state, false by default */ active?: boolean; /** Determines whether the control can be interacted with, set `false` to make the control to act as a label */ interactive?: boolean; } export type RichTextEditorControlFactory = Factory<{ props: RichTextEditorControlProps; ref: HTMLButtonElement; stylesNames: RichTextEditorControlStylesNames; compound: true; }>; export declare const RichTextEditorControl: import("@empoleon/core").EmpoleonComponent<{ props: RichTextEditorControlProps; ref: HTMLButtonElement; stylesNames: RichTextEditorControlStylesNames; compound: true; }>; export interface RichTextEditorControlBaseProps extends RichTextEditorControlProps { icon?: Component<{ style: JSX.CSSProperties; }>; } export declare const RichTextEditorControlBase: { (props: RichTextEditorControlBaseProps): JSX.Element; displayName: string; }; export interface CreateControlProps { label: keyof RichTextEditorLabels; icon: Component<{ style: JSX.CSSProperties; }>; isActive?: { name: string; attributes?: Record<string, any> | string; }; isDisabled?: (editor: any) => boolean; operation: { name: string; attributes?: Record<string, any> | string; }; } export declare function createControl(config: CreateControlProps): { (props: RichTextEditorControlBaseProps): JSX.Element; displayName: string; };