From 640094171e9372afafd0a85fb4f7579b358d09ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Sat, 29 Sep 2018 12:34:11 +0200 Subject: [PATCH] wording --- examples/Components/Routes/Suggestions/index.vue | 2 +- packages/tiptap-commands/src/commands/replaceText.js | 4 ++-- packages/tiptap-extensions/src/plugins/Suggestions.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/Components/Routes/Suggestions/index.vue b/examples/Components/Routes/Suggestions/index.vue index ed4abb34..e7aa3dfc 100644 --- a/examples/Components/Routes/Suggestions/index.vue +++ b/examples/Components/Routes/Suggestions/index.vue @@ -184,7 +184,7 @@ export default { // so it's important to pass also the position of your suggestion text selectUser(user) { this.insertMention({ - replaceRange: this.suggestionRange, + range: this.suggestionRange, attrs: { id: user.id, label: user.name, diff --git a/packages/tiptap-commands/src/commands/replaceText.js b/packages/tiptap-commands/src/commands/replaceText.js index 4ac8480c..5555ae65 100644 --- a/packages/tiptap-commands/src/commands/replaceText.js +++ b/packages/tiptap-commands/src/commands/replaceText.js @@ -1,4 +1,4 @@ -export default function (pos, type, attrs = {}) { +export default function (range, type, attrs = {}) { return (state, dispatch) => { const { $from } = state.selection const index = $from.index() @@ -8,7 +8,7 @@ export default function (pos, type, attrs = {}) { } if (dispatch) { - dispatch(state.tr.replaceWith(pos.from, pos.to, type.create(attrs))) + dispatch(state.tr.replaceWith(range.from, range.to, type.create(attrs))) } return true diff --git a/packages/tiptap-extensions/src/plugins/Suggestions.js b/packages/tiptap-extensions/src/plugins/Suggestions.js index 876b94c6..a2844d38 100644 --- a/packages/tiptap-extensions/src/plugins/Suggestions.js +++ b/packages/tiptap-extensions/src/plugins/Suggestions.js @@ -146,9 +146,9 @@ export default function SuggestionsPlugin({ decorationNode, virtualNode, items: onFilter(items, next.text), - command: ({ replaceRange, attrs }) => { + command: ({ range, attrs }) => { command({ - range: replaceRange, + range, attrs, schema: view.state.schema, })(view.state, view.dispatch, view)