chore: Editor refactor (#3286)

* cleanup

* add context

* EventEmitter allows removal of toolbar props from extensions

* Move to 'packages' of extensions
Remove EmojiTrigger extension

* types

* iteration

* fix render flashing

* fix: Missing nodes in collection descriptions
This commit is contained in:
Tom Moor
2022-03-30 19:10:34 -07:00
committed by GitHub
parent c5b9a742c0
commit 6f2a4488e8
30 changed files with 517 additions and 581 deletions

View File

@@ -6,7 +6,6 @@ import uploadPlaceholderPlugin, {
findPlaceholder,
} from "../lib/uploadPlaceholder";
import findAttachmentById from "../queries/findAttachmentById";
import { ToastType } from "../types";
export type Options = {
dictionary: any;
@@ -17,7 +16,7 @@ export type Options = {
uploadFile?: (file: File) => Promise<string>;
onFileUploadStart?: () => void;
onFileUploadStop?: () => void;
onShowToast: (message: string, code: string) => void;
onShowToast: (message: string) => void;
};
const insertFiles = function (
@@ -187,10 +186,7 @@ const insertFiles = function (
view.dispatch(view.state.tr.deleteRange(from, to || from));
}
onShowToast(
error.message || dictionary.fileUploadError,
ToastType.Error
);
onShowToast(error.message || dictionary.fileUploadError);
})
.finally(() => {
complete++;