feat: add markdown shortcodes (#215)

This commit is contained in:
Daniel Lautzenheiser
2022-12-11 09:03:53 -05:00
committed by GitHub
parent 388de1e0c4
commit bb84382f6e
51 changed files with 4229 additions and 399 deletions

View File

@ -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,