From 6e78cc90b93b40a533afd519952a1afccd41898d Mon Sep 17 00:00:00 2001 From: Ivan Date: Mon, 10 Dec 2018 15:46:22 +0300 Subject: [PATCH 01/10] Update Placeholder.js --- packages/tiptap-extensions/src/extensions/Placeholder.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/tiptap-extensions/src/extensions/Placeholder.js b/packages/tiptap-extensions/src/extensions/Placeholder.js index 39f107ed..bed1042d 100644 --- a/packages/tiptap-extensions/src/extensions/Placeholder.js +++ b/packages/tiptap-extensions/src/extensions/Placeholder.js @@ -10,6 +10,7 @@ export default class Placeholder extends Extension { get defaultOptions() { return { emptyNodeClass: 'is-empty', + emptyNodeText: 'Write something...' } } @@ -28,6 +29,7 @@ export default class Placeholder extends Extension { const decoration = Decoration.node(pos, pos + node.nodeSize, { class: this.options.emptyNodeClass, + 'data-empty-text': this.options.emptyNodeText }) decorations.push(decoration) }) From 00a691ed14936892095214c00dd252ed8e6aa465 Mon Sep 17 00:00:00 2001 From: Ivan Date: Mon, 10 Dec 2018 15:55:20 +0300 Subject: [PATCH 02/10] Update Placeholder.js --- packages/tiptap-extensions/src/extensions/Placeholder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tiptap-extensions/src/extensions/Placeholder.js b/packages/tiptap-extensions/src/extensions/Placeholder.js index bed1042d..fb60b929 100644 --- a/packages/tiptap-extensions/src/extensions/Placeholder.js +++ b/packages/tiptap-extensions/src/extensions/Placeholder.js @@ -10,7 +10,7 @@ export default class Placeholder extends Extension { get defaultOptions() { return { emptyNodeClass: 'is-empty', - emptyNodeText: 'Write something...' + emptyNodeText: 'Write something...', } } @@ -29,7 +29,7 @@ export default class Placeholder extends Extension { const decoration = Decoration.node(pos, pos + node.nodeSize, { class: this.options.emptyNodeClass, - 'data-empty-text': this.options.emptyNodeText + 'data-empty-text': this.options.emptyNodeText, }) decorations.push(decoration) }) From f14dfe8396c99db987c57c80d026430a684aa9fe Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 15 Dec 2018 13:48:18 +0300 Subject: [PATCH 03/10] Update index.vue --- examples/Components/Routes/Placeholder/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/Components/Routes/Placeholder/index.vue b/examples/Components/Routes/Placeholder/index.vue index 59ed3880..16db4160 100644 --- a/examples/Components/Routes/Placeholder/index.vue +++ b/examples/Components/Routes/Placeholder/index.vue @@ -24,6 +24,7 @@ export default { new ListItem(), new Placeholder({ emptyClass: 'is-empty', + emptyNodeText: 'Write something cool or die!' }), ], }), @@ -37,7 +38,7 @@ export default { From 4113ac6c68b9b7a7ac1c5cdfd2e8219ae3926b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Wed, 19 Dec 2018 23:13:58 +0100 Subject: [PATCH 09/10] add original event to focus and blur event --- README.md | 4 ++-- packages/tiptap/src/Editor.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87273e41..2ba4fe28 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ useBuiltInExtensions | `extensions` | `Array` | `[]` | A list of extensions used, by the editor. This can be `Nodes`, `Marks` or `Plugins`. | | `useBuiltInExtensions` | `Boolean` | `true` | By default tiptap adds a `Doc`, `Paragraph` and `Text` node to the Prosemirror schema. | | `onInit` | `Function` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on init. | -| `onFocus` | `Function` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on focus. | -| `onBlur` | `Function` | `undefined` | This will return an Object with the current `state` and `view` of Prosemirror on blur. | +| `onFocus` | `Function` | `undefined` | This will return an Object with the `event` and current `state` and `view` of Prosemirror on focus. | +| `onBlur` | `Function` | `undefined` | This will return an Object with the `event` and current `state` and `view` of Prosemirror on blur. | | `onUpdate` | `Function` | `undefined` | This will return an Object with the current `state` of Prosemirror, a `getJSON()` and `getHTML()` function on every change. | ## Components diff --git a/packages/tiptap/src/Editor.js b/packages/tiptap/src/Editor.js index 56803263..84615c99 100644 --- a/packages/tiptap/src/Editor.js +++ b/packages/tiptap/src/Editor.js @@ -185,12 +185,14 @@ export default class Editor { view.dom.style.whiteSpace = 'pre-wrap' - view.dom.addEventListener('focus', () => this.options.onFocus({ + view.dom.addEventListener('focus', event => this.options.onFocus({ + event, state: this.state, view: this.view, })) - view.dom.addEventListener('blur', () => this.options.onBlur({ + view.dom.addEventListener('blur', event => this.options.onBlur({ + event, state: this.state, view: this.view, })) From 19163370f5568ab0d028a5a31598ec4e5486b695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Wed, 19 Dec 2018 23:15:54 +0100 Subject: [PATCH 10/10] Publish - tiptap-commands@1.3.0 - tiptap-extensions@1.5.0 - tiptap-utils@1.1.0 - tiptap@1.5.0 --- packages/tiptap-commands/package.json | 4 ++-- packages/tiptap-extensions/package.json | 6 +++--- packages/tiptap-utils/package.json | 2 +- packages/tiptap/package.json | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/tiptap-commands/package.json b/packages/tiptap-commands/package.json index 23271bdb..f57ba1de 100644 --- a/packages/tiptap-commands/package.json +++ b/packages/tiptap-commands/package.json @@ -1,6 +1,6 @@ { "name": "tiptap-commands", - "version": "1.2.0", + "version": "1.3.0", "description": "Commands for tiptap", "homepage": "https://tiptap.scrumpy.io", "license": "MIT", @@ -24,6 +24,6 @@ "prosemirror-inputrules": "^1.0.1", "prosemirror-schema-list": "^1.0.1", "prosemirror-state": "^1.2.2", - "tiptap-utils": "^1.0.1" + "tiptap-utils": "^1.1.0" } } diff --git a/packages/tiptap-extensions/package.json b/packages/tiptap-extensions/package.json index a7b9cf0a..8a16d1cc 100644 --- a/packages/tiptap-extensions/package.json +++ b/packages/tiptap-extensions/package.json @@ -1,6 +1,6 @@ { "name": "tiptap-extensions", - "version": "1.4.0", + "version": "1.5.0", "description": "Extensions for tiptap", "homepage": "https://tiptap.scrumpy.io", "license": "MIT", @@ -25,8 +25,8 @@ "prosemirror-history": "^1.0.3", "prosemirror-state": "^1.2.2", "prosemirror-view": "^1.6.7", - "tiptap": "^1.4.0", - "tiptap-commands": "^1.2.0" + "tiptap": "^1.5.0", + "tiptap-commands": "^1.3.0" }, "peerDependencies": { "vue": "^2.5.17", diff --git a/packages/tiptap-utils/package.json b/packages/tiptap-utils/package.json index 506dc1ba..ed1b3a80 100644 --- a/packages/tiptap-utils/package.json +++ b/packages/tiptap-utils/package.json @@ -1,6 +1,6 @@ { "name": "tiptap-utils", - "version": "1.0.1", + "version": "1.1.0", "description": "Utility functions for tiptap", "homepage": "https://tiptap.scrumpy.io", "license": "MIT", diff --git a/packages/tiptap/package.json b/packages/tiptap/package.json index 1582f392..65d42d6b 100644 --- a/packages/tiptap/package.json +++ b/packages/tiptap/package.json @@ -1,6 +1,6 @@ { "name": "tiptap", - "version": "1.4.0", + "version": "1.5.0", "description": "A rich-text editor for Vue.js", "homepage": "https://tiptap.scrumpy.io", "license": "MIT", @@ -27,8 +27,8 @@ "prosemirror-model": "^1.6.3", "prosemirror-state": "^1.2.1", "prosemirror-view": "^1.6.7", - "tiptap-commands": "^1.2.0", - "tiptap-utils": "^1.0.1" + "tiptap-commands": "^1.3.0", + "tiptap-utils": "^1.1.0" }, "peerDependencies": { "vue": "^2.5.17",