@tiptap/core
Advanced tools
Comparing version 2.0.0-alpha.2 to 2.0.0-alpha.3
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.0.0-alpha.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.2...@tiptap/core@2.0.0-alpha.3) (2020-11-16) | ||
### Reverts | ||
* Revert "use global namespace" ([0c9ce26](https://github.com/ueberdosis/tiptap-next/commit/0c9ce26c02c07d88a757c01b0a9d7f9e2b0b7502)) | ||
# [2.0.0-alpha.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.1...@tiptap/core@2.0.0-alpha.2) (2020-11-16) | ||
@@ -8,0 +19,0 @@ |
import { EditorState, Transaction } from 'prosemirror-state'; | ||
import { Editor, CommandSpec, SingleCommands, ChainedCommands } from './Editor'; | ||
import { SingleCommands, ChainedCommands, Editor, CommandSpec } from './Editor'; | ||
export default class CommandManager { | ||
@@ -4,0 +4,0 @@ editor: Editor; |
@@ -9,2 +9,4 @@ import { EditorState, Plugin, Transaction } from 'prosemirror-state'; | ||
import { Extensions, UnionToIntersection } from './types'; | ||
import * as extensions from './extensions'; | ||
export { extensions }; | ||
export declare type Command = (props: { | ||
@@ -26,16 +28,12 @@ editor: Editor; | ||
} | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
} | ||
} | ||
export interface AllExtensions { | ||
} | ||
declare type UnfilteredCommands = { | ||
[Item in keyof Tiptap.AllExtensions]: Tiptap.AllExtensions[Item] extends Extension<any, infer ExtensionCommands> ? ExtensionCommands : Tiptap.AllExtensions[Item] extends Node<any, infer NodeCommands> ? NodeCommands : Tiptap.AllExtensions[Item] extends Mark<any, infer MarkCommands> ? MarkCommands : never; | ||
export declare type UnfilteredCommands = { | ||
[Item in keyof AllExtensions]: AllExtensions[Item] extends Extension<any, infer ExtensionCommands> ? ExtensionCommands : AllExtensions[Item] extends Node<any, infer NodeCommands> ? NodeCommands : AllExtensions[Item] extends Mark<any, infer MarkCommands> ? MarkCommands : never; | ||
}; | ||
declare type ValuesOf<T> = T[keyof T]; | ||
declare type KeysWithTypeOf<T, Type> = ({ | ||
export declare type ValuesOf<T> = T[keyof T]; | ||
export declare type KeysWithTypeOf<T, Type> = ({ | ||
[P in keyof T]: T[P] extends Type ? P : never; | ||
})[keyof T]; | ||
declare type AllCommands = UnionToIntersection<ValuesOf<Pick<UnfilteredCommands, KeysWithTypeOf<UnfilteredCommands, {}>>>>; | ||
export declare type AllCommands = UnionToIntersection<ValuesOf<Pick<UnfilteredCommands, KeysWithTypeOf<UnfilteredCommands, {}>>>>; | ||
export declare type SingleCommands = { | ||
@@ -255,2 +253,1 @@ [Item in keyof AllCommands]: AllCommands[Item] extends (...args: any[]) => any ? (...args: Parameters<AllCommands[Item]>) => boolean : never; | ||
} | ||
export {}; |
@@ -6,129 +6,127 @@ import { Extension } from '../Extension'; | ||
*/ | ||
blur: () => import("..").Command; | ||
blur: () => import("@tiptap/core").Command; | ||
/** | ||
* Clear the whole document. | ||
*/ | ||
clearContent: (emitUpdate?: Boolean) => import("..").Command; | ||
clearContent: (emitUpdate?: Boolean) => import("@tiptap/core").Command; | ||
/** | ||
* Normalize nodes to a simple paragraph. | ||
*/ | ||
clearNodes: () => import("..").Command; | ||
clearNodes: () => import("@tiptap/core").Command; | ||
/** | ||
* Delete the selection, if there is one. | ||
*/ | ||
deleteSelection: () => import("..").Command; | ||
deleteSelection: () => import("@tiptap/core").Command; | ||
/** | ||
* Extends the text selection to the current mark. | ||
*/ | ||
extendMarkRange: (typeOrName: string | import("prosemirror-model").MarkType<any>) => import("..").Command; | ||
extendMarkRange: (typeOrName: string | import("prosemirror-model").MarkType<any>) => import("@tiptap/core").Command; | ||
/** | ||
* Focus the editor at the given position. | ||
*/ | ||
focus: (position?: number | boolean | "start" | "end" | null) => import("..").Command; | ||
focus: (position?: number | boolean | "start" | "end" | null) => import("@tiptap/core").Command; | ||
/** | ||
* Insert a string of HTML at the current position. | ||
*/ | ||
insertHTML: (value: string) => import("..").Command; | ||
insertHTML: (value: string) => import("@tiptap/core").Command; | ||
/** | ||
* Insert a string of text at the current position. | ||
*/ | ||
insertText: (value: string) => import("..").Command; | ||
insertText: (value: string) => import("@tiptap/core").Command; | ||
/** | ||
* Lift the list item into a wrapping list. | ||
*/ | ||
liftListItem: (typeOrName: string | import("prosemirror-model").NodeType<any>) => import("..").Command; | ||
liftListItem: (typeOrName: string | import("prosemirror-model").NodeType<any>) => import("@tiptap/core").Command; | ||
/** | ||
* Remove all marks in the current selection. | ||
*/ | ||
removeMark: (typeOrName: string | import("prosemirror-model").MarkType<any>) => import("..").Command; | ||
removeMark: (typeOrName: string | import("prosemirror-model").MarkType<any>) => import("@tiptap/core").Command; | ||
/** | ||
* Remove all marks in the current selection. | ||
*/ | ||
removeMarks: () => import("..").Command; | ||
removeMarks: () => import("@tiptap/core").Command; | ||
/** | ||
* Resets all node attributes to the default value. | ||
*/ | ||
resetNodeAttributes: (attributeNames?: string[]) => import("..").Command; | ||
resetNodeAttributes: (attributeNames?: string[]) => import("@tiptap/core").Command; | ||
/** | ||
* Scroll the selection into view. | ||
*/ | ||
scrollIntoView: () => import("..").Command; | ||
scrollIntoView: () => import("@tiptap/core").Command; | ||
/** | ||
* Select the whole document. | ||
*/ | ||
selectAll: () => import("..").Command; | ||
selectAll: () => import("@tiptap/core").Command; | ||
/** | ||
* Select the parent node. | ||
*/ | ||
selectParentNode: () => import("..").Command; | ||
selectParentNode: () => import("@tiptap/core").Command; | ||
/** | ||
* Replace a given range with a node. | ||
*/ | ||
setBlockType: (typeOrName: string | import("prosemirror-model").NodeType<any>, attrs?: {}) => import("..").Command; | ||
setBlockType: (typeOrName: string | import("prosemirror-model").NodeType<any>, attrs?: {}) => import("@tiptap/core").Command; | ||
/** | ||
* Replace the whole document with new content. | ||
*/ | ||
setContent: (content: string, emitUpdate?: Boolean, parseOptions?: {}) => import("..").Command; | ||
setContent: (content: string, emitUpdate?: Boolean, parseOptions?: {}) => import("@tiptap/core").Command; | ||
/** | ||
* Sink the list item down into an inner list. | ||
*/ | ||
sinkListItem: (typeOrName: string | import("prosemirror-model").NodeType<any>) => import("..").Command; | ||
sinkListItem: (typeOrName: string | import("prosemirror-model").NodeType<any>) => import("@tiptap/core").Command; | ||
/** | ||
* Forks a new node from an existing node. | ||
*/ | ||
splitBlock: (options?: Partial<import("../commands/splitBlock").SplitBlockOptions>) => import("..").Command; | ||
splitBlock: (options?: Partial<import("../commands/splitBlock").SplitBlockOptions>) => import("@tiptap/core").Command; | ||
/** | ||
* Splits one list item into two list items. | ||
*/ | ||
splitListItem: (typeOrName: string | import("prosemirror-model").NodeType<any>) => import("..").Command; | ||
splitListItem: (typeOrName: string | import("prosemirror-model").NodeType<any>) => import("@tiptap/core").Command; | ||
/** | ||
* Toggle a node with another node. | ||
*/ | ||
toggleBlockType: (typeOrName: string | import("prosemirror-model").NodeType<any>, toggleTypeOrName: string | import("prosemirror-model").NodeType<any>, attrs?: {}) => import("..").Command; | ||
toggleBlockType: (typeOrName: string | import("prosemirror-model").NodeType<any>, toggleTypeOrName: string | import("prosemirror-model").NodeType<any>, attrs?: {}) => import("@tiptap/core").Command; | ||
/** | ||
* Toggle between different list types. | ||
*/ | ||
toggleList: (listTypeOrName: string | import("prosemirror-model").NodeType<any>, itemTypeOrName: string | import("prosemirror-model").NodeType<any>) => import("..").Command; | ||
toggleList: (listTypeOrName: string | import("prosemirror-model").NodeType<any>, itemTypeOrName: string | import("prosemirror-model").NodeType<any>) => import("@tiptap/core").Command; | ||
/** | ||
* Toggle a mark on and off. | ||
*/ | ||
toggleMark: (typeOrName: string | import("prosemirror-model").MarkType<any>, attributes?: {} | undefined) => import("..").Command; | ||
toggleMark: (typeOrName: string | import("prosemirror-model").MarkType<any>, attributes?: {} | undefined) => import("@tiptap/core").Command; | ||
/** | ||
* Wraps nodes in another node, or removes an existing wrap. | ||
*/ | ||
toggleWrap: (typeOrName: string | import("prosemirror-model").NodeType<any>, attrs?: {}) => import("..").Command; | ||
toggleWrap: (typeOrName: string | import("prosemirror-model").NodeType<any>, attrs?: {}) => import("@tiptap/core").Command; | ||
/** | ||
* Runs one command after the other and stops at the first which returns true. | ||
*/ | ||
try: (commands: import("..").Command[] | ((props: { | ||
editor: import("..").Editor; | ||
try: (commands: import("@tiptap/core").Command[] | ((props: { | ||
editor: import("@tiptap/core").Editor; | ||
tr: import("prosemirror-state").Transaction<any>; | ||
commands: Tiptap.SingleCommands; | ||
can: () => Tiptap.SingleCommands & { | ||
chain: () => Tiptap.ChainedCommands; | ||
commands: import("@tiptap/core").SingleCommands; | ||
can: () => import("@tiptap/core").SingleCommands & { | ||
chain: () => import("@tiptap/core").ChainedCommands; | ||
}; | ||
chain: () => Tiptap.ChainedCommands; | ||
chain: () => import("@tiptap/core").ChainedCommands; | ||
state: import("prosemirror-state").EditorState<any>; | ||
view: import("prosemirror-view").EditorView<any>; | ||
dispatch: ((args?: any) => any) | undefined; | ||
}) => import("..").Command[])) => import("..").Command; | ||
}) => import("@tiptap/core").Command[])) => import("@tiptap/core").Command; | ||
/** | ||
* Update a mark with new attributes. | ||
*/ | ||
updateMarkAttributes: (typeOrName: string | import("prosemirror-model").MarkType<any>, attributes: {}) => import("..").Command; | ||
updateMarkAttributes: (typeOrName: string | import("prosemirror-model").MarkType<any>, attributes: {}) => import("@tiptap/core").Command; | ||
/** | ||
* Update attributes of a node. | ||
*/ | ||
updateNodeAttributes: (attributes: {}) => import("..").Command; | ||
updateNodeAttributes: (attributes: {}) => import("@tiptap/core").Command; | ||
/** | ||
* Wrap a node in a list. | ||
*/ | ||
wrapInList: (typeOrName: string | import("prosemirror-model").NodeType<any>, attrs?: {} | undefined) => import("..").Command; | ||
wrapInList: (typeOrName: string | import("prosemirror-model").NodeType<any>, attrs?: {} | undefined) => import("@tiptap/core").Command; | ||
}>; | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
Commands: typeof Commands; | ||
} | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
Commands: typeof Commands; | ||
} | ||
} |
import { Extension } from '../Extension'; | ||
export declare const Editable: Extension<unknown, unknown>; | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
Editable: typeof Editable; | ||
} | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
Editable: typeof Editable; | ||
} | ||
} |
import { Extension } from '../Extension'; | ||
export declare const FocusEvents: Extension<unknown, unknown>; | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
FocusEvents: typeof FocusEvents; | ||
} | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
FocusEvents: typeof FocusEvents; | ||
} | ||
} |
import { Extension } from '../Extension'; | ||
export declare const Keymap: Extension<unknown, unknown>; | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
Keymap: typeof Keymap; | ||
} | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
Keymap: typeof Keymap; | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
export { Editor, Command, CommandsSpec, } from './Editor'; | ||
export * from './Editor'; | ||
export * from './Extension'; | ||
@@ -3,0 +3,0 @@ export * from './Node'; |
{ | ||
"name": "@tiptap/core", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0-alpha.3", | ||
"homepage": "https://tiptap.dev", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "0cee9fb3b714db02ef0434215676e5badb467e83" | ||
"gitHead": "163c8f3034325a0ee530333030c595642a5e4b61" | ||
} |
import { EditorState, Transaction } from 'prosemirror-state' | ||
import { | ||
SingleCommands, | ||
ChainedCommands, | ||
Editor, | ||
CommandSpec, | ||
SingleCommands, | ||
ChainedCommands, | ||
} from './Editor' | ||
@@ -8,0 +8,0 @@ import getAllMethodNames from './utils/getAllMethodNames' |
@@ -24,2 +24,4 @@ import { EditorState, Plugin, Transaction } from 'prosemirror-state' | ||
export { extensions } | ||
export type Command = (props: { | ||
@@ -42,14 +44,10 @@ editor: Editor, | ||
declare global { | ||
namespace Tiptap { | ||
export interface AllExtensions {} | ||
} | ||
} | ||
export interface AllExtensions {} | ||
type UnfilteredCommands = { | ||
[Item in keyof Tiptap.AllExtensions]: Tiptap.AllExtensions[Item] extends Extension<any, infer ExtensionCommands> | ||
export type UnfilteredCommands = { | ||
[Item in keyof AllExtensions]: AllExtensions[Item] extends Extension<any, infer ExtensionCommands> | ||
? ExtensionCommands | ||
: Tiptap.AllExtensions[Item] extends Node<any, infer NodeCommands> | ||
: AllExtensions[Item] extends Node<any, infer NodeCommands> | ||
? NodeCommands | ||
: Tiptap.AllExtensions[Item] extends Mark<any, infer MarkCommands> | ||
: AllExtensions[Item] extends Mark<any, infer MarkCommands> | ||
? MarkCommands | ||
@@ -59,5 +57,5 @@ : never | ||
type ValuesOf<T> = T[keyof T]; | ||
type KeysWithTypeOf<T, Type> = ({[P in keyof T]: T[P] extends Type ? P : never })[keyof T] | ||
type AllCommands = UnionToIntersection<ValuesOf<Pick<UnfilteredCommands, KeysWithTypeOf<UnfilteredCommands, {}>>>> | ||
export type ValuesOf<T> = T[keyof T]; | ||
export type KeysWithTypeOf<T, Type> = ({[P in keyof T]: T[P] extends Type ? P : never })[keyof T] | ||
export type AllCommands = UnionToIntersection<ValuesOf<Pick<UnfilteredCommands, KeysWithTypeOf<UnfilteredCommands, {}>>>> | ||
@@ -64,0 +62,0 @@ export type SingleCommands = { |
@@ -150,8 +150,6 @@ import { Extension } from '../Extension' | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
Commands: typeof Commands, | ||
} | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
Commands: typeof Commands, | ||
} | ||
} |
@@ -17,8 +17,6 @@ import { Plugin, PluginKey } from 'prosemirror-state' | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
Editable: typeof Editable, | ||
} | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
Editable: typeof Editable, | ||
} | ||
} |
@@ -39,8 +39,6 @@ import { Plugin, PluginKey } from 'prosemirror-state' | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
FocusEvents: typeof FocusEvents, | ||
} | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
FocusEvents: typeof FocusEvents, | ||
} | ||
} |
@@ -48,8 +48,6 @@ import { | ||
declare global { | ||
namespace Tiptap { | ||
interface AllExtensions { | ||
Keymap: typeof Keymap, | ||
} | ||
declare module '@tiptap/core' { | ||
interface AllExtensions { | ||
Keymap: typeof Keymap, | ||
} | ||
} |
@@ -1,7 +0,2 @@ | ||
export { | ||
Editor, | ||
Command, | ||
CommandsSpec, | ||
} from './Editor' | ||
export * from './Editor' | ||
export * from './Extension' | ||
@@ -8,0 +3,0 @@ export * from './Node' |
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
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
1933521
10496