From ccb11ca8760020bd5c30247b01069dc8bd78b900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Sat, 29 Sep 2018 13:03:31 +0200 Subject: [PATCH] remove some comments --- .../src/plugins/Suggestions.js | 47 +++---------------- 1 file changed, 7 insertions(+), 40 deletions(-) diff --git a/packages/tiptap-extensions/src/plugins/Suggestions.js b/packages/tiptap-extensions/src/plugins/Suggestions.js index 2fb9ce0c..aefbaf4d 100644 --- a/packages/tiptap-extensions/src/plugins/Suggestions.js +++ b/packages/tiptap-extensions/src/plugins/Suggestions.js @@ -1,22 +1,13 @@ import { Plugin, PluginKey } from 'prosemirror-state'; import { Decoration, DecorationSet } from 'prosemirror-view'; -/** - * Create a matcher that matches when a specific character is typed. Useful for @mentions and #tags. - * - * @param {String} char - * @param {Boolean} allowSpaces - * @returns {function(*)} - */ +// Create a matcher that matches when a specific character is typed. Useful for @mentions and #tags. function triggerCharacter({ char = '@', allowSpaces = false, startOfLine = false, }) { - /** - * @param {ResolvedPos} $position - */ return $position => { // Matching expressions used for later const suffix = new RegExp(`\\s${char}$`) @@ -64,9 +55,6 @@ function triggerCharacter({ } } -/** - * @returns {Plugin} - */ export default function SuggestionsPlugin({ matcher = { char: '@', @@ -159,11 +147,8 @@ export default function SuggestionsPlugin({ }, state: { - /** - * Initialize the plugin's internal state. - * - * @returns {Object} - */ + + // Initialize the plugin's internal state. init() { return { active: false, @@ -173,14 +158,7 @@ export default function SuggestionsPlugin({ } }, - /** - * Apply changes to the plugin state from a view transaction. - * - * @param {Transaction} tr - * @param {Object} prev - * - * @returns {Object} - */ + // Apply changes to the plugin state from a view transaction. apply(tr, prev) { const { selection } = tr const next = { ...prev } @@ -224,13 +202,8 @@ export default function SuggestionsPlugin({ }, props: { - /** - * Call the keydown hook if suggestion is active. - * - * @param view - * @param event - * @returns {boolean} - */ + + // Call the keydown hook if suggestion is active. handleKeyDown(view, event) { const { active, range } = this.getState(view.state) @@ -239,13 +212,7 @@ export default function SuggestionsPlugin({ return onKeyDown({ view, event, range }) }, - /** - * Setup decorator on the currently active suggestion. - * - * @param {EditorState} editorState - * - * @returns {?DecorationSet} - */ + // Setup decorator on the currently active suggestion. decorations(editorState) { const { active, range, decorationId } = this.getState(editorState)