From 63ddb2917d0500dc72538c8c1123267271255a61 Mon Sep 17 00:00:00 2001 From: STEVEN Date: Tue, 21 Dec 2021 22:31:42 +0800 Subject: [PATCH] Feat: update editor tools (#14) * fileupload * update memo editor comman tool btns * update editor tools Co-authored-by: lqwakeup --- web/public/icons/image.svg | 1 + web/src/components/Editor/Editor.tsx | 19 ++++-- web/src/components/MemoEditor.tsx | 98 +++++++++++++++++++++------- web/src/less/editor.less | 18 ++++- 4 files changed, 104 insertions(+), 32 deletions(-) create mode 100644 web/public/icons/image.svg diff --git a/web/public/icons/image.svg b/web/public/icons/image.svg new file mode 100644 index 00000000..4d5f44c8 --- /dev/null +++ b/web/public/icons/image.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/src/components/Editor/Editor.tsx b/web/src/components/Editor/Editor.tsx index 4a30d259..48f09615 100644 --- a/web/src/components/Editor/Editor.tsx +++ b/web/src/components/Editor/Editor.tsx @@ -14,7 +14,7 @@ export interface EditorRefActions { getContent: () => string; } -interface Props { +export interface EditorProps { className: string; initialContent: string; placeholder: string; @@ -23,11 +23,13 @@ interface Props { showTools: boolean; onConfirmBtnClick: (content: string) => void; onCancelBtnClick: () => void; + onTagTextBtnClick: () => void; + onUploadFileBtnClick: () => void; onContentChange: (content: string) => void; } // eslint-disable-next-line react/display-name -const Editor = forwardRef((props: Props, ref: React.ForwardedRef) => { +const Editor = forwardRef((props: EditorProps, ref: React.ForwardedRef) => { const { globalState: { useTinyUndoHistoryCache }, } = useContext(appContext); @@ -40,6 +42,8 @@ const Editor = forwardRef((props: Props, ref: React.ForwardedRef(null); @@ -169,9 +173,14 @@ const Editor = forwardRef((props: Props, ref: React.ForwardedRef
- -
{/* nth */}
-
+
+ + <> + + + + +