@tiptap/core
Advanced tools
Comparing version 2.5.0-beta.3 to 2.5.0-beta.4
@@ -341,4 +341,4 @@ import { Plugin, Transaction } from '@tiptap/pm/state'; | ||
static create<O = any, S = any>(config?: Partial<ExtensionConfig<O, S>>): Extension<O, S>; | ||
configure(options?: Partial<Options>): Extension<Options, Storage>; | ||
configure(options?: Partial<Options>): Extension<any, any>; | ||
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<ExtensionConfig<ExtendedOptions, ExtendedStorage>>): Extension<ExtendedOptions, ExtendedStorage>; | ||
} |
@@ -445,3 +445,3 @@ import { DOMOutputSpec, Mark as ProseMirrorMark, MarkSpec, MarkType } from '@tiptap/pm/model'; | ||
static create<O = any, S = any>(config?: Partial<MarkConfig<O, S>>): Mark<O, S>; | ||
configure(options?: Partial<Options>): Mark<Options, Storage>; | ||
configure(options?: Partial<Options>): Mark<any, any>; | ||
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<MarkConfig<ExtendedOptions, ExtendedStorage>>): Mark<ExtendedOptions, ExtendedStorage>; | ||
@@ -448,0 +448,0 @@ static handleExit({ editor, mark }: { |
@@ -609,4 +609,4 @@ import { DOMOutputSpec, Node as ProseMirrorNode, NodeSpec, NodeType } from '@tiptap/pm/model'; | ||
static create<O = any, S = any>(config?: Partial<NodeConfig<O, S>>): Node<O, S>; | ||
configure(options?: Partial<Options>): Node<Options, Storage>; | ||
configure(options?: Partial<Options>): Node<any, any>; | ||
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<NodeConfig<ExtendedOptions, ExtendedStorage>>): Node<ExtendedOptions, ExtendedStorage>; | ||
} |
{ | ||
"name": "@tiptap/core", | ||
"description": "headless rich text editor", | ||
"version": "2.5.0-beta.3", | ||
"version": "2.5.0-beta.4", | ||
"homepage": "https://tiptap.dev", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@tiptap/pm": "^2.5.0-beta.3" | ||
"@tiptap/pm": "^2.5.0-beta.4" | ||
}, | ||
@@ -38,0 +38,0 @@ "peerDependencies": { |
@@ -460,14 +460,14 @@ import { Plugin, Transaction } from '@tiptap/pm/state' | ||
// with different calls of `configure` | ||
const extension = this.extend() | ||
const extension = this.extend({ | ||
...this.config, | ||
addOptions() { | ||
return mergeDeep(this.parent?.() || {}, options) as Options | ||
}, | ||
}) | ||
// Always preserve the current name | ||
extension.name = this.name | ||
// Set the parent to be our parent | ||
extension.parent = this.parent | ||
extension.options = mergeDeep(this.options as Record<string, any>, options) as Options | ||
extension.storage = callOrReturn( | ||
getExtensionField<AnyConfig['addStorage']>(extension, 'addStorage', { | ||
name: extension.name, | ||
options: extension.options, | ||
}), | ||
) | ||
return extension | ||
@@ -487,3 +487,3 @@ } | ||
if (extendedConfig.defaultOptions) { | ||
if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) { | ||
console.warn( | ||
@@ -490,0 +490,0 @@ `[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`, |
@@ -184,3 +184,3 @@ import { keymap } from '@tiptap/pm/keymap' | ||
// bind exit handling | ||
if (extension.type === 'mark' && extension.config.exitable) { | ||
if (extension.type === 'mark' && getExtensionField<AnyConfig['exitable']>(extension, 'exitable', context)) { | ||
defaultBindings.ArrowRight = () => Mark.handleExit({ editor, mark: extension as Mark }) | ||
@@ -187,0 +187,0 @@ } |
@@ -13,3 +13,3 @@ import { Plugin, PluginKey } from '@tiptap/pm/state' | ||
props: { | ||
attributes: this.editor.isEditable ? { tabindex: '0' } : {}, | ||
attributes: (): { [name: string]: string; } => (this.editor.isEditable ? { tabindex: '0' } : {}), | ||
}, | ||
@@ -16,0 +16,0 @@ }), |
@@ -80,2 +80,3 @@ import { | ||
code: callOrReturn(getExtensionField<NodeConfig['code']>(extension, 'code', context)), | ||
whitespace: callOrReturn(getExtensionField<NodeConfig['whitespace']>(extension, 'whitespace', context)), | ||
defining: callOrReturn( | ||
@@ -82,0 +83,0 @@ getExtensionField<NodeConfig['defining']>(extension, 'defining', context), |
@@ -592,13 +592,14 @@ import { | ||
// with different calls of `configure` | ||
const extension = this.extend() | ||
const extension = this.extend({ | ||
...this.config, | ||
addOptions() { | ||
return mergeDeep(this.parent?.() || {}, options) as Options | ||
}, | ||
}) | ||
extension.options = mergeDeep(this.options as Record<string, any>, options) as Options | ||
// Always preserve the current name | ||
extension.name = this.name | ||
// Set the parent to be our parent | ||
extension.parent = this.parent | ||
extension.storage = callOrReturn( | ||
getExtensionField<AnyConfig['addStorage']>(extension, 'addStorage', { | ||
name: extension.name, | ||
options: extension.options, | ||
}), | ||
) | ||
return extension | ||
@@ -610,3 +611,3 @@ } | ||
) { | ||
const extension = new Mark<ExtendedOptions, ExtendedStorage>({ ...this.config, ...extendedConfig }) | ||
const extension = new Mark<ExtendedOptions, ExtendedStorage>(extendedConfig) | ||
@@ -619,3 +620,3 @@ extension.parent = this | ||
if (extendedConfig.defaultOptions) { | ||
if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) { | ||
console.warn( | ||
@@ -622,0 +623,0 @@ `[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`, |
@@ -783,13 +783,14 @@ import { | ||
// with different calls of `configure` | ||
const extension = this.extend() | ||
const extension = this.extend({ | ||
...this.config, | ||
addOptions() { | ||
return mergeDeep(this.parent?.() || {}, options) as Options | ||
}, | ||
}) | ||
extension.options = mergeDeep(this.options as Record<string, any>, options) as Options | ||
// Always preserve the current name | ||
extension.name = this.name | ||
// Set the parent to be our parent | ||
extension.parent = this.parent | ||
extension.storage = callOrReturn( | ||
getExtensionField<AnyConfig['addStorage']>(extension, 'addStorage', { | ||
name: extension.name, | ||
options: extension.options, | ||
}), | ||
) | ||
return extension | ||
@@ -801,3 +802,3 @@ } | ||
) { | ||
const extension = new Node<ExtendedOptions, ExtendedStorage>({ ...this.config, ...extendedConfig }) | ||
const extension = new Node<ExtendedOptions, ExtendedStorage>(extendedConfig) | ||
@@ -810,3 +811,3 @@ extension.parent = this | ||
if (extendedConfig.defaultOptions) { | ||
if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) { | ||
console.warn( | ||
@@ -813,0 +814,0 @@ `[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2288319
27054