Merge branch 'master' into v1.0

This commit is contained in:
Philipp Kühn
2018-11-05 20:58:09 +01:00
5 changed files with 9 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "tiptap", "name": "tiptap",
"version": "0.19.0", "version": "0.20.0",
"description": "A rich-text editor for Vue.js", "description": "A rich-text editor for Vue.js",
"homepage": "https://tiptap.scrumpy.io", "homepage": "https://tiptap.scrumpy.io",
"license": "MIT", "license": "MIT",

View File

@@ -219,6 +219,7 @@ export default {
state: this.state, state: this.state,
dispatchTransaction: this.dispatchTransaction, dispatchTransaction: this.dispatchTransaction,
nodeViews: initNodeViews({ nodeViews: initNodeViews({
parent: this,
nodes: this.views, nodes: this.views,
editable: this.editable, editable: this.editable,
}), }),

View File

@@ -1,6 +1,6 @@
{ {
"name": "tiptap-extensions", "name": "tiptap-extensions",
"version": "0.21.1", "version": "0.22.0",
"description": "Extensions for tiptap", "description": "Extensions for tiptap",
"homepage": "https://tiptap.scrumpy.io", "homepage": "https://tiptap.scrumpy.io",
"license": "MIT", "license": "MIT",
@@ -25,7 +25,7 @@
"prosemirror-history": "^1.0.2", "prosemirror-history": "^1.0.2",
"prosemirror-state": "^1.2.2", "prosemirror-state": "^1.2.2",
"prosemirror-view": "^1.6.1", "prosemirror-view": "^1.6.1",
"tiptap": "^0.19.0", "tiptap": "^0.20.0",
"tiptap-commands": "^0.7.0" "tiptap-commands": "^0.7.0"
}, },
"peerDependencies": { "peerDependencies": {

View File

@@ -2,12 +2,14 @@ import Vue from 'vue'
export default class ComponentView { export default class ComponentView {
constructor(component, { constructor(component, {
parent,
node, node,
view, view,
getPos, getPos,
decorations, decorations,
editable, editable,
}) { }) {
this.parent = parent
this.component = component this.component = component
this.node = node this.node = node
this.view = view this.view = view
@@ -22,6 +24,7 @@ export default class ComponentView {
createDOM() { createDOM() {
const Component = Vue.extend(this.component) const Component = Vue.extend(this.component)
this.vm = new Component({ this.vm = new Component({
parent: this.parent,
propsData: { propsData: {
node: this.node, node: this.node,
view: this.view, view: this.view,

View File

@@ -1,6 +1,6 @@
import ComponentView from './ComponentView' import ComponentView from './ComponentView'
export default function initNodeViews({ nodes, editable }) { export default function initNodeViews({ parent, nodes, editable }) {
const nodeViews = {} const nodeViews = {}
Object.keys(nodes).forEach(nodeName => { Object.keys(nodes).forEach(nodeName => {
@@ -8,6 +8,7 @@ export default function initNodeViews({ nodes, editable }) {
const component = nodes[nodeName] const component = nodes[nodeName]
return new ComponentView(component, { return new ComponentView(component, {
parent,
node, node,
view, view,
getPos, getPos,