rename some vars
This commit is contained in:
@@ -15,7 +15,7 @@ export default abstract class Extension {
|
||||
|
||||
public abstract name: string
|
||||
|
||||
public type = 'extension'
|
||||
public extensionType = 'extension'
|
||||
|
||||
public created() {}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ export default class ExtensionManager {
|
||||
|
||||
get nodes(): any {
|
||||
return collect(this.extensions)
|
||||
.where('type', 'node')
|
||||
.where('extensionType', 'node')
|
||||
.mapWithKeys((extension: any) => [extension.name, extension.schema()])
|
||||
.all()
|
||||
}
|
||||
|
||||
get marks(): any {
|
||||
return collect(this.extensions)
|
||||
.where('type', 'mark')
|
||||
.where('extensionType', 'mark')
|
||||
.mapWithKeys((extension: any) => [extension.name, extension.schema()])
|
||||
.all()
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ export default abstract class Mark extends Extension {
|
||||
super(options)
|
||||
}
|
||||
|
||||
public type = 'mark'
|
||||
public extensionType = 'mark'
|
||||
|
||||
abstract schema(): MarkSpec
|
||||
|
||||
get schemaType() {
|
||||
get type() {
|
||||
return this.editor.schema.marks[this.name]
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ export default abstract class Node extends Extension {
|
||||
super(options)
|
||||
}
|
||||
|
||||
public type = 'node'
|
||||
public extensionType = 'node'
|
||||
|
||||
public topNode = false
|
||||
|
||||
abstract schema(): NodeSpec
|
||||
|
||||
get schemaType() {
|
||||
get type() {
|
||||
return this.editor.schema.nodes[this.name]
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ export default class Bold extends Mark {
|
||||
commands(): CommandSpec {
|
||||
return {
|
||||
bold: (next, { view }) => {
|
||||
toggleMark(this.schemaType)(view.state, view.dispatch)
|
||||
toggleMark(this.type)(view.state, view.dispatch)
|
||||
next()
|
||||
},
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export default class Bold extends Mark {
|
||||
.find(character)
|
||||
.endCapture()
|
||||
.endOfLine(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
// match before whitespace
|
||||
markInputRule(
|
||||
@@ -75,7 +75,7 @@ export default class Bold extends Mark {
|
||||
.find(character)
|
||||
.endCapture()
|
||||
.endOfLine(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
]))
|
||||
.flat(1)
|
||||
@@ -94,7 +94,7 @@ export default class Bold extends Mark {
|
||||
.endCapture()
|
||||
.find(character)
|
||||
.endCapture(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
// match before whitespace
|
||||
markPasteRule(
|
||||
@@ -107,7 +107,7 @@ export default class Bold extends Mark {
|
||||
.endCapture()
|
||||
.find(character)
|
||||
.endCapture(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
]))
|
||||
.flat(1)
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class Code extends Mark {
|
||||
commands(): CommandSpec {
|
||||
return {
|
||||
code: (next, { view }) => {
|
||||
toggleMark(this.schemaType)(view.state, view.dispatch)
|
||||
toggleMark(this.type)(view.state, view.dispatch)
|
||||
next()
|
||||
},
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export default class Code extends Mark {
|
||||
.find(character)
|
||||
.endCapture()
|
||||
.endOfLine(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
// match before whitespace
|
||||
markInputRule(
|
||||
@@ -66,7 +66,7 @@ export default class Code extends Mark {
|
||||
.find(character)
|
||||
.endCapture()
|
||||
.endOfLine(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
]))
|
||||
.flat(1)
|
||||
@@ -85,7 +85,7 @@ export default class Code extends Mark {
|
||||
.endCapture()
|
||||
.find(character)
|
||||
.endCapture(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
// match before whitespace
|
||||
markPasteRule(
|
||||
@@ -98,7 +98,7 @@ export default class Code extends Mark {
|
||||
.endCapture()
|
||||
.find(character)
|
||||
.endCapture(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
]))
|
||||
.flat(1)
|
||||
|
||||
@@ -27,7 +27,7 @@ export default class Italic extends Mark {
|
||||
commands(): CommandSpec {
|
||||
return {
|
||||
italic: (next, { view }) => {
|
||||
toggleMark(this.schemaType)(view.state, view.dispatch)
|
||||
toggleMark(this.type)(view.state, view.dispatch)
|
||||
next()
|
||||
},
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export default class Italic extends Mark {
|
||||
.find(character)
|
||||
.endCapture()
|
||||
.endOfLine(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
// match before whitespace
|
||||
markInputRule(
|
||||
@@ -67,7 +67,7 @@ export default class Italic extends Mark {
|
||||
.find(character)
|
||||
.endCapture()
|
||||
.endOfLine(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
]))
|
||||
.flat(1)
|
||||
@@ -86,7 +86,7 @@ export default class Italic extends Mark {
|
||||
.endCapture()
|
||||
.find(character)
|
||||
.endCapture(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
// match before whitespace
|
||||
markPasteRule(
|
||||
@@ -99,7 +99,7 @@ export default class Italic extends Mark {
|
||||
.endCapture()
|
||||
.find(character)
|
||||
.endCapture(),
|
||||
this.schemaType,
|
||||
this.type,
|
||||
),
|
||||
]))
|
||||
.flat(1)
|
||||
|
||||
Reference in New Issue
Block a user