Merge branch 'main' of github.com:ueberdosis/tiptap-next into main

This commit is contained in:
Hans Pagel
2020-12-04 13:27:02 +01:00
7 changed files with 45 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ export interface ExtensionConfig<Options = any, Commands = {}> {
*/
addGlobalAttributes?: (this: {
options: Options,
}) => GlobalAttributes,
}) => GlobalAttributes | {},
/**
* Commands

View File

@@ -60,7 +60,7 @@ export interface MarkConfig<Options = any, Commands = {}> extends Overwrite<Exte
this: {
options: Options,
},
) => Attributes,
) => Attributes | {},
/**
* Commands

View File

@@ -95,7 +95,7 @@ export interface NodeConfig<Options = any, Commands = {}> extends Overwrite<Exte
this: {
options: Options,
},
) => Attributes,
) => Attributes | {},
/**
* Commands

View File

@@ -7,6 +7,7 @@ import {
} from '@tiptap/core'
export interface HighlightOptions {
multicolor: boolean,
HTMLAttributes: {
[key: string]: any
},
@@ -19,10 +20,15 @@ const Highlight = Mark.create({
name: 'highlight',
defaultOptions: <HighlightOptions>{
multicolor: false,
HTMLAttributes: {},
},
addAttributes() {
if (!this.options.multicolor) {
return {}
}
return {
color: {
default: null,