@tiptap/vue-2
Advanced tools
Comparing version 2.0.0-beta.56 to 2.0.0-beta.57
@@ -6,3 +6,3 @@ import { EditorState, Plugin, PluginKey, Transaction } from 'prosemirror-state'; | ||
import EventEmitter from './EventEmitter'; | ||
import { EditorOptions, CanCommands, ChainedCommands, SingleCommands, TextSerializer } from './types'; | ||
import { EditorOptions, CanCommands, ChainedCommands, SingleCommands, TextSerializer, EditorEvents } from './types'; | ||
import * as extensions from './extensions'; | ||
@@ -13,3 +13,3 @@ export { extensions }; | ||
} | ||
export declare class Editor extends EventEmitter { | ||
export declare class Editor extends EventEmitter<EditorEvents> { | ||
private commandManager; | ||
@@ -67,3 +67,3 @@ extensionManager: ExtensionManager; | ||
* | ||
* @param name The plugins name | ||
* @param nameOrPluginKey The plugins name | ||
*/ | ||
@@ -70,0 +70,0 @@ unregisterPlugin(nameOrPluginKey: string | PluginKey): void; |
@@ -1,7 +0,11 @@ | ||
export default class EventEmitter { | ||
declare type StringKeyOf<T> = Extract<keyof T, string>; | ||
declare type CallbackType<T extends Record<string, any>, EventName extends StringKeyOf<T>> = T[EventName] extends any[] ? T[EventName] : [T[EventName]]; | ||
declare type CallbackFunction<T extends Record<string, any>, EventName extends StringKeyOf<T>> = (...props: CallbackType<T, EventName>) => any; | ||
export default class EventEmitter<T extends Record<string, any>> { | ||
private callbacks; | ||
on(event: string, fn: Function): this; | ||
protected emit(event: string, ...args: any): this; | ||
off(event: string, fn?: Function): this; | ||
on<EventName extends StringKeyOf<T>>(event: EventName, fn: CallbackFunction<T, EventName>): this; | ||
protected emit<EventName extends StringKeyOf<T>>(event: EventName, ...args: CallbackType<T, EventName>): this; | ||
off<EventName extends StringKeyOf<T>>(event: EventName, fn?: CallbackFunction<T, EventName>): this; | ||
protected removeAllListeners(): void; | ||
} | ||
export {}; |
@@ -17,44 +17,54 @@ import { Node as ProseMirrorNode, Mark as ProseMirrorMark, ParseOptions } from 'prosemirror-model'; | ||
export declare type MaybeReturnType<T> = T extends (...args: any) => any ? ReturnType<T> : T; | ||
export interface EditorOptions { | ||
element: Element; | ||
content: Content; | ||
extensions: Extensions; | ||
injectCSS: boolean; | ||
autofocus: FocusPosition; | ||
editable: boolean; | ||
editorProps: EditorProps; | ||
parseOptions: ParseOptions; | ||
enableInputRules: boolean; | ||
enablePasteRules: boolean; | ||
enableCoreExtensions: boolean; | ||
onBeforeCreate: (props: { | ||
export interface EditorEvents { | ||
beforeCreate: { | ||
editor: Editor; | ||
}) => void; | ||
onCreate: (props: { | ||
}; | ||
create: { | ||
editor: Editor; | ||
}) => void; | ||
onUpdate: (props: { | ||
}; | ||
update: { | ||
editor: Editor; | ||
transaction: Transaction; | ||
}) => void; | ||
onSelectionUpdate: (props: { | ||
}; | ||
selectionUpdate: { | ||
editor: Editor; | ||
transaction: Transaction; | ||
}) => void; | ||
onTransaction: (props: { | ||
}; | ||
transaction: { | ||
editor: Editor; | ||
transaction: Transaction; | ||
}) => void; | ||
onFocus: (props: { | ||
}; | ||
focus: { | ||
editor: Editor; | ||
event: FocusEvent; | ||
transaction: Transaction; | ||
}) => void; | ||
onBlur: (props: { | ||
}; | ||
blur: { | ||
editor: Editor; | ||
event: FocusEvent; | ||
transaction: Transaction; | ||
}) => void; | ||
onDestroy: () => void; | ||
}; | ||
destroy: void; | ||
} | ||
export interface EditorOptions { | ||
element: Element; | ||
content: Content; | ||
extensions: Extensions; | ||
injectCSS: boolean; | ||
autofocus: FocusPosition; | ||
editable: boolean; | ||
editorProps: EditorProps; | ||
parseOptions: ParseOptions; | ||
enableInputRules: boolean; | ||
enablePasteRules: boolean; | ||
enableCoreExtensions: boolean; | ||
onBeforeCreate: (props: EditorEvents['beforeCreate']) => void; | ||
onCreate: (props: EditorEvents['create']) => void; | ||
onUpdate: (props: EditorEvents['update']) => void; | ||
onSelectionUpdate: (props: EditorEvents['selectionUpdate']) => void; | ||
onTransaction: (props: EditorEvents['transaction']) => void; | ||
onFocus: (props: EditorEvents['focus']) => void; | ||
onBlur: (props: EditorEvents['blur']) => void; | ||
onDestroy: (props: EditorEvents['destroy']) => void; | ||
} | ||
export declare type HTMLContent = string; | ||
@@ -61,0 +71,0 @@ export declare type JSONContent = { |
/// <reference types="react" /> | ||
export interface ReactNodeViewContextProps { | ||
onDragStart: (event: DragEvent) => void; | ||
maybeMoveContentDOM: () => void; | ||
nodeViewContentRef: (element: HTMLElement | null) => void; | ||
} | ||
export declare const ReactNodeViewContext: import("react").Context<Partial<ReactNodeViewContextProps>>; | ||
export declare const useReactNodeView: () => Partial<ReactNodeViewContextProps>; |
{ | ||
"name": "@tiptap/vue-2", | ||
"description": "Vue components for tiptap", | ||
"version": "2.0.0-beta.56", | ||
"version": "2.0.0-beta.57", | ||
"homepage": "https://tiptap.dev", | ||
@@ -31,4 +31,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@tiptap/extension-bubble-menu": "^2.0.0-beta.38", | ||
"@tiptap/extension-floating-menu": "^2.0.0-beta.32", | ||
"@tiptap/extension-bubble-menu": "^2.0.0-beta.39", | ||
"@tiptap/extension-floating-menu": "^2.0.0-beta.33", | ||
"prosemirror-view": "^1.20.1" | ||
@@ -41,3 +41,3 @@ }, | ||
}, | ||
"gitHead": "14f62dddb377701c9409495cc1a99922bb5f725f" | ||
"gitHead": "dc868b3d2a034abbd308da63057a6ae52c194b8d" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
239315
5142
0