@tiptap/extension-task-item 2.7.2 → 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.
@@ -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(): any;
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 type NodeViewProps = Simplify<Omit<NodeViewRendererProps, 'decorations'> & {
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 type NodeViewRendererProps = {
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-task-item",
3
3
  "description": "task item extension for tiptap",
4
- "version": "2.7.2",
4
+ "version": "2.7.3",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -29,8 +29,8 @@
29
29
  "dist"
30
30
  ],
31
31
  "devDependencies": {
32
- "@tiptap/core": "^2.7.2",
33
- "@tiptap/pm": "^2.7.2"
32
+ "@tiptap/core": "^2.7.3",
33
+ "@tiptap/pm": "^2.7.3"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@tiptap/core": "^2.7.0",