@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
91 lines (90 loc) • 2.37 kB
TypeScript
import React from 'react';
import { ToolbarPluginProps } from './plugins/ToolbarPlugin';
import { MediaPluginProps } from './plugins';
import { SCMediaType } from '@selfcommunity/types';
export declare type EditorRef = {
focus: () => void;
};
export interface EditorProps {
/**
* Id of the feed object
* @default 'poll'
*/
id?: string;
/**
* Overrides or extends the styles applied to the component.
* @default null
*/
className?: string;
/**
* Default value for the editor
* @default null
*/
defaultValue?: string;
/**
* Is the content of the editor read only
* @default true
*/
editable?: boolean;
/**
* Show the toolbar on top of the editor, elsewhere show buttons at the bottom of the editor
* @default false
*/
toolbar?: boolean;
/**
* This editor can upload images and insert into the html dom
* @default false
*/
uploadImage?: boolean;
/**
* This editor can upload files
* @default false
*/
uploadFile?: boolean;
/**
* Handler for change event of the editor
* @default null
* */
onChange?: (value: string) => void;
/**
* Handler for change media in the editor
* @default null
* */
onMediaChange?: (media: SCMediaType) => void;
/**
* Props to spread to ToolBar.
* @default {}
*/
ToolBarProps?: ToolbarPluginProps;
/**
* Props to spread to MediaPlugin.
* @default {}
*/
MediaPluginProps?: MediaPluginProps;
/**
* Handler for blur event of the editor
* @default null
* */
onBlur?: (event: FocusEvent) => void;
/**
* Handler for focus event of the editor
* @default null
* */
onFocus?: (event: FocusEvent) => void;
/**
* Action to add to actions
*/
action?: React.ReactNode | null;
/**
* The text displayed when the editor is empty
* @default <FormattedMessage id="ui.editor.placeholder" defaultMessage="ui.editor.placeholder" />
*/
placeholder?: React.ReactNode;
/**
* Prop to customize emoji plugin position
* @default false
*/
isLessonCommentEditor?: boolean;
}
declare const _default: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorRef>>;
export default _default;