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