add tiptap-models

This commit is contained in:
Philipp Kühn
2018-08-23 11:13:59 +02:00
parent 0552faa68a
commit 9fafc6b00f
32 changed files with 136 additions and 113 deletions

View File

@@ -0,0 +1,22 @@
{
"name": "tiptap-models",
"version": "0.1.1",
"description": "Models for tiptap",
"homepage": "https://tiptap.scrumpy.io",
"license": "MIT",
"main": "dist/models.common.js",
"module": "dist/models.esm.js",
"unpkg": "dist/models.js",
"jsdelivr": "dist/models.js",
"files": [
"src",
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/heyscrumpy/tiptap.git"
},
"bugs": {
"url": "https://github.com/heyscrumpy/tiptap/issues"
}
}

View File

@@ -0,0 +1,2 @@
export { default as Mark } from './models/mark'
export { default as Node } from './models/node'

View File

@@ -0,0 +1,46 @@
export default class Mark {
constructor(options = {}) {
this.options = {
...this.defaultOptions,
...options,
}
}
get name() {
return null
}
get defaultOptions() {
return {}
}
get type() {
return 'mark'
}
get view() {
return null
}
get schema() {
return null
}
get plugins() {
return []
}
command() {
return () => {}
}
keys() {
return {}
}
inputRules() {
return []
}
}

View File

@@ -0,0 +1,46 @@
export default class Node {
constructor(options = {}) {
this.options = {
...this.defaultOptions,
...options,
}
}
get name() {
return null
}
get defaultOptions() {
return {}
}
get type() {
return 'node'
}
get view() {
return null
}
get schema() {
return null
}
get plugins() {
return []
}
command() {
return () => {}
}
keys() {
return {}
}
inputRules() {
return []
}
}