feat: add markdown shortcodes (#215)
This commit is contained in:
committed by
GitHub
parent
388de1e0c4
commit
bb84382f6e
@ -889,6 +889,26 @@ export interface MarkdownEditorOptions {
|
||||
plugins?: MarkdownPluginFactory[];
|
||||
}
|
||||
|
||||
export type ShortcodeControlProps<P = {}> = P & {
|
||||
onChange: (props: P) => void;
|
||||
controlProps: WidgetControlProps<string, MarkdownField>;
|
||||
};
|
||||
|
||||
export type ShortcodePreviewProps<P = {}> = P & {
|
||||
previewProps: WidgetPreviewProps<string, MarkdownField>;
|
||||
};
|
||||
|
||||
export interface ShortcodeConfig<P = {}> {
|
||||
label?: string;
|
||||
openTag: string;
|
||||
closeTag: string;
|
||||
separator: string;
|
||||
toProps?: (args: string[]) => P;
|
||||
toArgs?: (props: P) => string[];
|
||||
control: ComponentType<ShortcodeControlProps>;
|
||||
preview: ComponentType<ShortcodePreviewProps>;
|
||||
}
|
||||
|
||||
export enum CollectionType {
|
||||
FOLDER,
|
||||
FILES,
|
||||
|
Reference in New Issue
Block a user