@tiptap/extension-strike 2.7.1 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -66,14 +66,16 @@ export declare class Editor extends EventEmitter<EditorEvents> {
|
|
|
66
66
|
*
|
|
67
67
|
* @param plugin A ProseMirror plugin
|
|
68
68
|
* @param handlePlugins Control how to merge the plugin into the existing plugins.
|
|
69
|
+
* @returns The new editor state
|
|
69
70
|
*/
|
|
70
|
-
registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]):
|
|
71
|
+
registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): EditorState;
|
|
71
72
|
/**
|
|
72
73
|
* Unregister a ProseMirror plugin.
|
|
73
74
|
*
|
|
74
75
|
* @param nameOrPluginKey The plugins name
|
|
76
|
+
* @returns The new editor state or undefined if the editor is destroyed
|
|
75
77
|
*/
|
|
76
|
-
unregisterPlugin(nameOrPluginKey: string | PluginKey):
|
|
78
|
+
unregisterPlugin(nameOrPluginKey: string | PluginKey): EditorState | undefined;
|
|
77
79
|
/**
|
|
78
80
|
* Creates an extension manager.
|
|
79
81
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Schema } from '@tiptap/pm/model';
|
|
2
2
|
import { Plugin } from '@tiptap/pm/state';
|
|
3
|
+
import { NodeViewConstructor } from '@tiptap/pm/view';
|
|
3
4
|
import type { Editor } from './Editor.js';
|
|
4
5
|
import { Extensions, RawCommands } from './types.js';
|
|
5
6
|
export declare class ExtensionManager {
|
|
@@ -46,7 +47,7 @@ export declare class ExtensionManager {
|
|
|
46
47
|
* Get all node views from the extensions.
|
|
47
48
|
* @returns An object with all node views where the key is the node name and the value is the node view function
|
|
48
49
|
*/
|
|
49
|
-
get nodeViews():
|
|
50
|
+
get nodeViews(): Record<string, NodeViewConstructor>;
|
|
50
51
|
/**
|
|
51
52
|
* Go through all extensions, create extension storages & setup marks
|
|
52
53
|
* & bind editor event listener.
|
|
@@ -189,18 +189,15 @@ export type ValuesOf<T> = T[keyof T];
|
|
|
189
189
|
export type KeysWithTypeOf<T, Type> = {
|
|
190
190
|
[P in keyof T]: T[P] extends Type ? P : never;
|
|
191
191
|
}[keyof T];
|
|
192
|
-
export type Simplify<T> = {
|
|
193
|
-
[KeyType in keyof T]: T[KeyType];
|
|
194
|
-
} & {};
|
|
195
192
|
export type DecorationWithType = Decoration & {
|
|
196
193
|
type: NodeType;
|
|
197
194
|
};
|
|
198
|
-
export
|
|
195
|
+
export interface NodeViewProps extends NodeViewRendererProps {
|
|
199
196
|
decorations: readonly DecorationWithType[];
|
|
200
197
|
selected: boolean;
|
|
201
198
|
updateAttributes: (attributes: Record<string, any>) => void;
|
|
202
199
|
deleteNode: () => void;
|
|
203
|
-
}
|
|
200
|
+
}
|
|
204
201
|
export interface NodeViewRendererOptions {
|
|
205
202
|
stopEvent: ((props: {
|
|
206
203
|
event: Event;
|
|
@@ -213,7 +210,7 @@ export interface NodeViewRendererOptions {
|
|
|
213
210
|
}) => boolean) | null;
|
|
214
211
|
contentDOMElementTag: string;
|
|
215
212
|
}
|
|
216
|
-
export
|
|
213
|
+
export interface NodeViewRendererProps {
|
|
217
214
|
node: Parameters<NodeViewConstructor>[0];
|
|
218
215
|
view: Parameters<NodeViewConstructor>[1];
|
|
219
216
|
getPos: () => number;
|
|
@@ -222,7 +219,7 @@ export type NodeViewRendererProps = {
|
|
|
222
219
|
editor: Editor;
|
|
223
220
|
extension: Node;
|
|
224
221
|
HTMLAttributes: Record<string, any>;
|
|
225
|
-
}
|
|
222
|
+
}
|
|
226
223
|
export type NodeViewRenderer = (props: NodeViewRendererProps) => NodeView;
|
|
227
224
|
export type AnyCommands = Record<string, (...args: any[]) => Command>;
|
|
228
225
|
export type UnionCommands<T = Command> = UnionToIntersection<ValuesOf<Pick<Commands<T>, KeysWithTypeOf<Commands<T>, {}>>>>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-strike",
|
|
3
3
|
"description": "strike extension for tiptap",
|
|
4
|
-
"version": "2.7.
|
|
4
|
+
"version": "2.7.3",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tiptap/core": "^2.7.
|
|
32
|
+
"@tiptap/core": "^2.7.3"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@tiptap/core": "^2.7.0"
|