diff --git a/shared/editor/extensions/DateTime.ts b/shared/editor/extensions/DateTime.ts index 0e4f8919d9..51b84d42a5 100644 --- a/shared/editor/extensions/DateTime.ts +++ b/shared/editor/extensions/DateTime.ts @@ -1,4 +1,3 @@ -import { InputRule } from "prosemirror-inputrules"; import { Schema } from "prosemirror-model"; import { Command } from "prosemirror-state"; import { @@ -7,7 +6,6 @@ import { getCurrentTimeAsString, } from "../../utils/date"; import Extension from "../lib/Extension"; -import { EventType } from "../types"; /** * An editor extension that adds commands to insert the current date and time. @@ -17,30 +15,6 @@ export default class DateTime extends Extension { return "date_time"; } - inputRules() { - return [ - // Note: There is a space at the end of the pattern here otherwise the - // /datetime rule can never be matched. - // these extra input patterns are needed until the block menu matches - // in places other than the start of a line - new InputRule(/\/date\s$/, ({ tr }, _match, start, end) => { - tr.delete(start, end).insertText(getCurrentDateAsString() + " "); - this.editor.events.emit(EventType.SuggestionsMenuClose); - return tr; - }), - new InputRule(/\/time\s$/, ({ tr }, _match, start, end) => { - tr.delete(start, end).insertText(getCurrentTimeAsString() + " "); - this.editor.events.emit(EventType.SuggestionsMenuClose); - return tr; - }), - new InputRule(/\/datetime\s$/, ({ tr }, _match, start, end) => { - tr.delete(start, end).insertText(`${getCurrentDateTimeAsString()} `); - this.editor.events.emit(EventType.SuggestionsMenuClose); - return tr; - }), - ]; - } - commands(_options: { schema: Schema }) { return { date: (): Command => (state, dispatch) => { diff --git a/shared/editor/types/index.ts b/shared/editor/types/index.ts index 55f96027e4..7267ab448e 100644 --- a/shared/editor/types/index.ts +++ b/shared/editor/types/index.ts @@ -8,8 +8,6 @@ import { Primitive } from "utility-types"; export type PlainTextSerializer = (node: ProsemirrorNode) => string; export enum EventType { - SuggestionsMenuOpen = "suggestionMenuOpen", - SuggestionsMenuClose = "suggestionMenuClose", LinkToolbarOpen = "linkMenuOpen", }