From 1a9b90698bb9c2a64daafdcfaafb14e4fa5c75b3 Mon Sep 17 00:00:00 2001 From: yanmao <55792257+yanmao-cc@users.noreply.github.com> Date: Fri, 31 Dec 2021 01:14:24 +0800 Subject: [PATCH] Update config.tsx --- examples/react/components/editor/config.tsx | 163 ++++++++++---------- 1 file changed, 83 insertions(+), 80 deletions(-) diff --git a/examples/react/components/editor/config.tsx b/examples/react/components/editor/config.tsx index ccff08cb..1a0a9b95 100644 --- a/examples/react/components/editor/config.tsx +++ b/examples/react/components/editor/config.tsx @@ -86,6 +86,7 @@ import { ToolbarComponent, fontFamilyDefaultData, } from '@aomao/toolbar'; +import type { ToolbarOptions } from '@aomao/toolbar'; import ReactDOM from 'react-dom'; import Loading from '../loading'; @@ -309,87 +310,89 @@ export const lineHeightOptions: LineHeightOptions = { }, }; +export const toolbarOptions: ToolbarOptions = { + // popup: { + // items: [ + // ['undo', 'redo'], + // { + // icon: 'text', + // items: [ + // 'bold', + // 'italic', + // 'strikethrough', + // 'underline', + // 'fontsize', + // 'fontcolor', + // 'backcolor', + // 'moremark', + // ], + // }, + // [ + // { + // type: 'button', + // name: 'image-uploader', + // icon: 'image', + // }, + // 'link', + // 'tasklist', + // 'heading', + // ], + // { + // icon: 'more', + // items: [ + // { + // type: 'button', + // name: 'video-uploader', + // icon: 'video', + // }, + // { + // type: 'button', + // name: 'file-uploader', + // icon: 'attachment', + // }, + // { + // type: 'button', + // name: 'table', + // icon: 'table', + // }, + // { + // type: 'button', + // name: 'math', + // icon: 'math', + // }, + // { + // type: 'button', + // name: 'codeblock', + // icon: 'codeblock', + // }, + // { + // type: 'button', + // name: 'orderedlist', + // icon: 'orderedlist', + // }, + // { + // type: 'button', + // name: 'unorderedlist', + // icon: 'unorderedlist', + // }, + // { + // type: 'button', + // name: 'hr', + // icon: 'hr', + // }, + // { + // type: 'button', + // name: 'quote', + // icon: 'quote', + // }, + // ], + // }, + // ] + // } +}; + export const pluginConfig: Record = { - [ToolbarPlugin.pluginName]: { - // popup: { - // items: [ - // ['undo', 'redo'], - // { - // icon: 'text', - // items: [ - // 'bold', - // 'italic', - // 'strikethrough', - // 'underline', - // 'fontsize', - // 'fontcolor', - // 'backcolor', - // 'moremark', - // ], - // }, - // [ - // { - // type: 'button', - // name: 'image-uploader', - // icon: 'image', - // }, - // 'link', - // 'tasklist', - // 'heading', - // ], - // { - // icon: 'more', - // items: [ - // { - // type: 'button', - // name: 'video-uploader', - // icon: 'video', - // }, - // { - // type: 'button', - // name: 'file-uploader', - // icon: 'attachment', - // }, - // { - // type: 'button', - // name: 'table', - // icon: 'table', - // }, - // { - // type: 'button', - // name: 'math', - // icon: 'math', - // }, - // { - // type: 'button', - // name: 'codeblock', - // icon: 'codeblock', - // }, - // { - // type: 'button', - // name: 'orderedlist', - // icon: 'orderedlist', - // }, - // { - // type: 'button', - // name: 'unorderedlist', - // icon: 'unorderedlist', - // }, - // { - // type: 'button', - // name: 'hr', - // icon: 'hr', - // }, - // { - // type: 'button', - // name: 'quote', - // icon: 'quote', - // }, - // ], - // }, - // ] - // } - }, + [ToolbarPlugin.pluginName]: toolbarOptions, [Table.pluginName]: tableOptions, [MarkRange.pluginName]: markRangeOptions, [Italic.pluginName]: italicOptions,