rename set to configure
This commit is contained in:
@@ -135,11 +135,11 @@ export default {
|
|||||||
this.editor = new Editor({
|
this.editor = new Editor({
|
||||||
extensions: [
|
extensions: [
|
||||||
...defaultExtensions(),
|
...defaultExtensions(),
|
||||||
Collaboration.set({
|
Collaboration.configure({
|
||||||
provider: this.provider,
|
provider: this.provider,
|
||||||
type: this.type,
|
type: this.type,
|
||||||
}),
|
}),
|
||||||
CollaborationCursor.set({
|
CollaborationCursor.configure({
|
||||||
provider: this.provider,
|
provider: this.provider,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
color: this.color,
|
color: this.color,
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export default {
|
|||||||
Document,
|
Document,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
Text,
|
Text,
|
||||||
Heading.set({
|
Heading.configure({
|
||||||
level: [1, 2, 3],
|
level: [1, 2, 3],
|
||||||
}),
|
}),
|
||||||
Bold,
|
Bold,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default {
|
|||||||
Document,
|
Document,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
Text,
|
Text,
|
||||||
Collaboration.set({
|
Collaboration.configure({
|
||||||
provider: this.provider,
|
provider: this.provider,
|
||||||
type: this.type,
|
type: this.type,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ export default {
|
|||||||
Document,
|
Document,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
Text,
|
Text,
|
||||||
Collaboration.set({
|
Collaboration.configure({
|
||||||
provider: this.provider,
|
provider: this.provider,
|
||||||
type: this.type,
|
type: this.type,
|
||||||
}),
|
}),
|
||||||
CollaborationCursor.set({
|
CollaborationCursor.configure({
|
||||||
provider: this.provider,
|
provider: this.provider,
|
||||||
name: 'Cyndi Lauper',
|
name: 'Cyndi Lauper',
|
||||||
color: '#f783ac',
|
color: '#f783ac',
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default {
|
|||||||
Document,
|
Document,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
Text,
|
Text,
|
||||||
Focus.set({
|
Focus.configure({
|
||||||
className: 'has-focus',
|
className: 'has-focus',
|
||||||
nested: true,
|
nested: true,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default {
|
|||||||
Document,
|
Document,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
Text,
|
Text,
|
||||||
Heading.set({
|
Heading.configure({
|
||||||
levels: [1, 2, 3],
|
levels: [1, 2, 3],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ Most extensions allow you to add attributes to the rendered HTML through the `HT
|
|||||||
new Editor({
|
new Editor({
|
||||||
extensions: [
|
extensions: [
|
||||||
Document,
|
Document,
|
||||||
Paragraph.set({
|
Paragraph.configure({
|
||||||
HTMLAttributes: {
|
HTMLAttributes: {
|
||||||
class: 'my-custom-paragraph',
|
class: 'my-custom-paragraph',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
Heading.set({
|
Heading.configure({
|
||||||
HTMLAttributes: {
|
HTMLAttributes: {
|
||||||
class: 'my-custom-heading',
|
class: 'my-custom-heading',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -90,16 +90,16 @@ export class Extension<Options = any, Commands = any> {
|
|||||||
return new Extension<O, C>(config)
|
return new Extension<O, C>(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
set(options: Partial<Options>) {
|
configure(options: Partial<Options>) {
|
||||||
return Extension
|
return Extension
|
||||||
.create<Options, Commands>(this.config as ExtensionSpec<Options, Commands>)
|
.create<Options, Commands>(this.config as ExtensionSpec<Options, Commands>)
|
||||||
.#set({
|
.#configure({
|
||||||
...this.config.defaultOptions,
|
...this.config.defaultOptions,
|
||||||
...options,
|
...options,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#set = (options: Partial<Options>) => {
|
#configure = (options: Partial<Options>) => {
|
||||||
this.options = {
|
this.options = {
|
||||||
...this.config.defaultOptions,
|
...this.config.defaultOptions,
|
||||||
...options,
|
...options,
|
||||||
|
|||||||
@@ -140,16 +140,16 @@ export class MarkExtension<Options = any, Commands = {}> {
|
|||||||
return new MarkExtension<O, C>(config)
|
return new MarkExtension<O, C>(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
set(options: Partial<Options>) {
|
configure(options: Partial<Options>) {
|
||||||
return MarkExtension
|
return MarkExtension
|
||||||
.create<Options, Commands>(this.config as MarkExtensionSpec<Options, Commands>)
|
.create<Options, Commands>(this.config as MarkExtensionSpec<Options, Commands>)
|
||||||
.#set({
|
.#configure({
|
||||||
...this.config.defaultOptions,
|
...this.config.defaultOptions,
|
||||||
...options,
|
...options,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#set = (options: Partial<Options>) => {
|
#configure = (options: Partial<Options>) => {
|
||||||
this.options = {
|
this.options = {
|
||||||
...this.config.defaultOptions,
|
...this.config.defaultOptions,
|
||||||
...options,
|
...options,
|
||||||
|
|||||||
@@ -192,16 +192,16 @@ export class NodeExtension<Options = any, Commands = {}> {
|
|||||||
return new NodeExtension<O, C>(config)
|
return new NodeExtension<O, C>(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
set(options: Partial<Options>) {
|
configure(options: Partial<Options>) {
|
||||||
return NodeExtension
|
return NodeExtension
|
||||||
.create<Options, Commands>(this.config as NodeExtensionSpec<Options, Commands>)
|
.create<Options, Commands>(this.config as NodeExtensionSpec<Options, Commands>)
|
||||||
.#set({
|
.#configure({
|
||||||
...this.config.defaultOptions,
|
...this.config.defaultOptions,
|
||||||
...options,
|
...options,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#set = (options: Partial<Options>) => {
|
#configure = (options: Partial<Options>) => {
|
||||||
this.options = {
|
this.options = {
|
||||||
...this.config.defaultOptions,
|
...this.config.defaultOptions,
|
||||||
...options,
|
...options,
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ export function defaultExtensions(options: {
|
|||||||
Dropcursor,
|
Dropcursor,
|
||||||
Gapcursor,
|
Gapcursor,
|
||||||
Document,
|
Document,
|
||||||
History.set(options?.history),
|
History.configure(options?.history),
|
||||||
Paragraph,
|
Paragraph,
|
||||||
Text,
|
Text,
|
||||||
Bold,
|
Bold,
|
||||||
Italic,
|
Italic,
|
||||||
Code,
|
Code,
|
||||||
CodeBlock.set(options?.codeBlock),
|
CodeBlock.configure(options?.codeBlock),
|
||||||
Heading.set(options?.heading),
|
Heading.configure(options?.heading),
|
||||||
HardBreak,
|
HardBreak,
|
||||||
Strike,
|
Strike,
|
||||||
Blockquote,
|
Blockquote,
|
||||||
|
|||||||
Reference in New Issue
Block a user