@tiptap/core
Advanced tools
Comparing version 2.0.0-beta.38 to 2.0.0-beta.39
@@ -6,2 +6,15 @@ # Change Log | ||
# [2.0.0-beta.39](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.38...@tiptap/core@2.0.0-beta.39) (2021-04-27) | ||
### Bug Fixes | ||
* add correct type for parseOptions ([592892e](https://github.com/ueberdosis/tiptap/commit/592892edd1c4d6dbaa9ea3ddd21f4615f0087053)) | ||
* fix type error for commands ([26785db](https://github.com/ueberdosis/tiptap/commit/26785dbec00cbb3dc3196bd9a7cbebb7452e4a2e)) | ||
* set correct type for emitUpdate ([9a40c17](https://github.com/ueberdosis/tiptap/commit/9a40c17b3422b22a2cfe1fbac76ca06c9e78ae8c)) | ||
# [2.0.0-beta.38](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.37...@tiptap/core@2.0.0-beta.38) (2021-04-23) | ||
@@ -8,0 +21,0 @@ |
@@ -8,3 +8,3 @@ import { Command, RawCommands } from '../types'; | ||
*/ | ||
clearContent: (emitUpdate?: Boolean) => Command; | ||
clearContent: (emitUpdate?: boolean) => Command; | ||
}; | ||
@@ -11,0 +11,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { ParseOptions } from 'prosemirror-model'; | ||
import { Command, RawCommands, Content } from '../types'; | ||
@@ -8,3 +9,3 @@ declare module '@tiptap/core' { | ||
*/ | ||
setContent: (content: Content, emitUpdate?: Boolean, parseOptions?: Record<string, any>) => Command; | ||
setContent: (content: Content, emitUpdate?: boolean, parseOptions?: ParseOptions) => Command; | ||
}; | ||
@@ -11,0 +12,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { Schema, Node as ProseMirrorNode } from 'prosemirror-model'; | ||
import { Schema, Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model'; | ||
import { Content } from '../types'; | ||
export default function createDocument(content: Content, schema: Schema, parseOptions?: Record<string, any>): ProseMirrorNode; | ||
export default function createDocument(content: Content, schema: Schema, parseOptions?: ParseOptions): ProseMirrorNode; |
@@ -1,7 +0,7 @@ | ||
import { Schema, Node as ProseMirrorNode, Fragment } from 'prosemirror-model'; | ||
import { Schema, Node as ProseMirrorNode, Fragment, ParseOptions } from 'prosemirror-model'; | ||
import { Content } from '../types'; | ||
export declare type CreateNodeFromContentOptions = { | ||
slice?: boolean; | ||
parseOptions?: Record<string, any>; | ||
parseOptions?: ParseOptions; | ||
}; | ||
export default function createNodeFromContent(content: Content, schema: Schema, options?: CreateNodeFromContentOptions): string | ProseMirrorNode | Fragment; |
{ | ||
"name": "@tiptap/core", | ||
"description": "headless rich text editor", | ||
"version": "2.0.0-beta.38", | ||
"version": "2.0.0-beta.39", | ||
"homepage": "https://tiptap.dev", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
"prosemirror-keymap": "^1.1.3", | ||
"prosemirror-model": "^1.14.0", | ||
"prosemirror-model": "^1.14.1", | ||
"prosemirror-schema-list": "^1.1.4", | ||
@@ -45,3 +45,3 @@ "prosemirror-state": "^1.3.4", | ||
}, | ||
"gitHead": "bd9e15d78f9159afb05d09e7ba279ff7d74a85ea" | ||
"gitHead": "fe61a6e3d89965bffb8e50bd3e48d452cbcc42f0" | ||
} |
@@ -31,3 +31,3 @@ import { EditorState, Transaction } from 'prosemirror-state' | ||
.map(([name, command]) => { | ||
const method = (...args: any) => { | ||
const method = (...args: never[]) => { | ||
const callback = command(...args)(props) | ||
@@ -63,3 +63,3 @@ | ||
...Object.fromEntries(Object.entries(commands).map(([name, command]) => { | ||
const chainedCommand = (...args: any[]) => { | ||
const chainedCommand = (...args: never[]) => { | ||
const props = this.buildProps(tr, shouldDispatch) | ||
@@ -90,3 +90,3 @@ const callback = command(...args)(props) | ||
.map(([name, command]) => { | ||
return [name, (...args: any[]) => command(...args)({ ...props, dispatch })] | ||
return [name, (...args: never[]) => command(...args)({ ...props, dispatch })] | ||
})) as SingleCommands | ||
@@ -122,3 +122,3 @@ | ||
.map(([name, command]) => { | ||
return [name, (...args: any[]) => command(...args)(props)] | ||
return [name, (...args: never[]) => command(...args)(props)] | ||
})) as SingleCommands | ||
@@ -125,0 +125,0 @@ }, |
@@ -9,3 +9,3 @@ import { Command, RawCommands } from '../types' | ||
*/ | ||
clearContent: (emitUpdate?: Boolean) => Command, | ||
clearContent: (emitUpdate?: boolean) => Command, | ||
} | ||
@@ -12,0 +12,0 @@ } |
import { TextSelection } from 'prosemirror-state' | ||
import { ParseOptions } from 'prosemirror-model' | ||
import createDocument from '../helpers/createDocument' | ||
@@ -13,4 +14,4 @@ import { Command, RawCommands, Content } from '../types' | ||
content: Content, | ||
emitUpdate?: Boolean, | ||
parseOptions?: Record<string, any>, | ||
emitUpdate?: boolean, | ||
parseOptions?: ParseOptions, | ||
) => Command, | ||
@@ -17,0 +18,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { Schema, Node as ProseMirrorNode } from 'prosemirror-model' | ||
import { Schema, Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model' | ||
import { Content } from '../types' | ||
@@ -8,5 +8,5 @@ import createNodeFromContent from './createNodeFromContent' | ||
schema: Schema, | ||
parseOptions: Record<string, any> = {}, | ||
parseOptions: ParseOptions = {}, | ||
): ProseMirrorNode { | ||
return createNodeFromContent(content, schema, { slice: false, parseOptions }) as ProseMirrorNode | ||
} |
@@ -6,2 +6,3 @@ import { | ||
Fragment, | ||
ParseOptions, | ||
} from 'prosemirror-model' | ||
@@ -13,3 +14,3 @@ import elementFromString from '../utilities/elementFromString' | ||
slice?: boolean, | ||
parseOptions?: Record<string, any>, | ||
parseOptions?: ParseOptions, | ||
} | ||
@@ -16,0 +17,0 @@ |
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 not supported yet
Sorry, the diff of this file is not supported yet
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
2510153
16941
Updatedprosemirror-model@^1.14.1