@tiptap/extension-table-cell 2.5.8 → 2.6.0
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.
- package/dist/packages/core/src/Editor.d.ts +4 -0
- package/dist/packages/core/src/Extension.d.ts +5 -4
- package/dist/packages/core/src/Mark.d.ts +5 -4
- package/dist/packages/core/src/Node.d.ts +5 -4
- package/dist/packages/core/src/commands/setMeta.d.ts +2 -1
- package/dist/packages/core/src/commands/splitListItem.d.ts +2 -1
- package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +10 -4
- package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +2 -1
- package/package.json +3 -3
|
@@ -16,6 +16,10 @@ export declare class Editor extends EventEmitter<EditorEvents> {
|
|
|
16
16
|
schema: Schema;
|
|
17
17
|
view: EditorView;
|
|
18
18
|
isFocused: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The editor is considered initialized after the `create` event has been emitted.
|
|
21
|
+
*/
|
|
22
|
+
isInitialized: boolean;
|
|
19
23
|
extensionStorage: Record<string, any>;
|
|
20
24
|
options: EditorOptions;
|
|
21
25
|
constructor(options?: Partial<EditorOptions>);
|
|
@@ -17,10 +17,10 @@ declare module '@tiptap/core' {
|
|
|
17
17
|
*/
|
|
18
18
|
name: string;
|
|
19
19
|
/**
|
|
20
|
-
* The priority of your extension. The higher, the
|
|
20
|
+
* The priority of your extension. The higher, the earlier it will be called
|
|
21
21
|
* and will take precedence over other extensions with a lower priority.
|
|
22
|
-
* @default
|
|
23
|
-
* @example
|
|
22
|
+
* @default 100
|
|
23
|
+
* @example 101
|
|
24
24
|
*/
|
|
25
25
|
priority?: number;
|
|
26
26
|
/**
|
|
@@ -286,6 +286,7 @@ declare module '@tiptap/core' {
|
|
|
286
286
|
editor: Editor;
|
|
287
287
|
parent: ParentConfig<ExtensionConfig<Options, Storage>>['onTransaction'];
|
|
288
288
|
}, props: {
|
|
289
|
+
editor: Editor;
|
|
289
290
|
transaction: Transaction;
|
|
290
291
|
}) => void) | null;
|
|
291
292
|
/**
|
|
@@ -338,6 +339,6 @@ export declare class Extension<Options = any, Storage = any> {
|
|
|
338
339
|
config: ExtensionConfig;
|
|
339
340
|
constructor(config?: Partial<ExtensionConfig<Options, Storage>>);
|
|
340
341
|
static create<O = any, S = any>(config?: Partial<ExtensionConfig<O, S>>): Extension<O, S>;
|
|
341
|
-
configure(options?: Partial<Options>): Extension<
|
|
342
|
+
configure(options?: Partial<Options>): Extension<Options, Storage>;
|
|
342
343
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<ExtensionConfig<ExtendedOptions, ExtendedStorage>>): Extension<ExtendedOptions, ExtendedStorage>;
|
|
343
344
|
}
|
|
@@ -17,10 +17,10 @@ declare module '@tiptap/core' {
|
|
|
17
17
|
*/
|
|
18
18
|
name: string;
|
|
19
19
|
/**
|
|
20
|
-
* The priority of your extension. The higher, the
|
|
20
|
+
* The priority of your extension. The higher, the earlier it will be called
|
|
21
21
|
* and will take precedence over other extensions with a lower priority.
|
|
22
|
-
* @default
|
|
23
|
-
* @example
|
|
22
|
+
* @default 100
|
|
23
|
+
* @example 101
|
|
24
24
|
*/
|
|
25
25
|
priority?: number;
|
|
26
26
|
/**
|
|
@@ -296,6 +296,7 @@ declare module '@tiptap/core' {
|
|
|
296
296
|
type: MarkType;
|
|
297
297
|
parent: ParentConfig<MarkConfig<Options, Storage>>['onTransaction'];
|
|
298
298
|
}, props: {
|
|
299
|
+
editor: Editor;
|
|
299
300
|
transaction: Transaction;
|
|
300
301
|
}) => void) | null;
|
|
301
302
|
/**
|
|
@@ -442,7 +443,7 @@ export declare class Mark<Options = any, Storage = any> {
|
|
|
442
443
|
config: MarkConfig;
|
|
443
444
|
constructor(config?: Partial<MarkConfig<Options, Storage>>);
|
|
444
445
|
static create<O = any, S = any>(config?: Partial<MarkConfig<O, S>>): Mark<O, S>;
|
|
445
|
-
configure(options?: Partial<Options>): Mark<
|
|
446
|
+
configure(options?: Partial<Options>): Mark<Options, Storage>;
|
|
446
447
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<MarkConfig<ExtendedOptions, ExtendedStorage>>): Mark<ExtendedOptions, ExtendedStorage>;
|
|
447
448
|
static handleExit({ editor, mark }: {
|
|
448
449
|
editor: Editor;
|
|
@@ -17,10 +17,10 @@ declare module '@tiptap/core' {
|
|
|
17
17
|
*/
|
|
18
18
|
name: string;
|
|
19
19
|
/**
|
|
20
|
-
* The priority of your extension. The higher, the
|
|
20
|
+
* The priority of your extension. The higher, the earlier it will be called
|
|
21
21
|
* and will take precedence over other extensions with a lower priority.
|
|
22
|
-
* @default
|
|
23
|
-
* @example
|
|
22
|
+
* @default 100
|
|
23
|
+
* @example 101
|
|
24
24
|
*/
|
|
25
25
|
priority?: number;
|
|
26
26
|
/**
|
|
@@ -297,6 +297,7 @@ declare module '@tiptap/core' {
|
|
|
297
297
|
type: NodeType;
|
|
298
298
|
parent: ParentConfig<NodeConfig<Options, Storage>>['onTransaction'];
|
|
299
299
|
}, props: {
|
|
300
|
+
editor: Editor;
|
|
300
301
|
transaction: Transaction;
|
|
301
302
|
}) => void) | null;
|
|
302
303
|
/**
|
|
@@ -606,6 +607,6 @@ export declare class Node<Options = any, Storage = any> {
|
|
|
606
607
|
config: NodeConfig;
|
|
607
608
|
constructor(config?: Partial<NodeConfig<Options, Storage>>);
|
|
608
609
|
static create<O = any, S = any>(config?: Partial<NodeConfig<O, S>>): Node<O, S>;
|
|
609
|
-
configure(options?: Partial<Options>): Node<
|
|
610
|
+
configure(options?: Partial<Options>): Node<Options, Storage>;
|
|
610
611
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<NodeConfig<ExtendedOptions, ExtendedStorage>>): Node<ExtendedOptions, ExtendedStorage>;
|
|
611
612
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
1
2
|
import { RawCommands } from '../types.js';
|
|
2
3
|
declare module '@tiptap/core' {
|
|
3
4
|
interface Commands<ReturnType> {
|
|
@@ -8,7 +9,7 @@ declare module '@tiptap/core' {
|
|
|
8
9
|
* @param value The value to store.
|
|
9
10
|
* @example editor.commands.setMeta('foo', 'bar')
|
|
10
11
|
*/
|
|
11
|
-
setMeta: (key: string, value: any) => ReturnType;
|
|
12
|
+
setMeta: (key: string | Plugin | PluginKey, value: any) => ReturnType;
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -6,9 +6,10 @@ declare module '@tiptap/core' {
|
|
|
6
6
|
/**
|
|
7
7
|
* Splits one list item into two list items.
|
|
8
8
|
* @param typeOrName The type or name of the node.
|
|
9
|
+
* @param overrideAttrs The attributes to ensure on the new node.
|
|
9
10
|
* @example editor.commands.splitListItem('listItem')
|
|
10
11
|
*/
|
|
11
|
-
splitListItem: (typeOrName: string | NodeType) => ReturnType;
|
|
12
|
+
splitListItem: (typeOrName: string | NodeType, overrideAttrs?: Record<string, any>) => ReturnType;
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
2
|
/**
|
|
3
|
-
* Returns true if the given node is empty.
|
|
4
|
-
* When `checkChildren` is true (default), it will also check if all children are empty.
|
|
3
|
+
* Returns true if the given prosemirror node is empty.
|
|
5
4
|
*/
|
|
6
|
-
export declare function isNodeEmpty(node: ProseMirrorNode, { checkChildren }?: {
|
|
7
|
-
|
|
5
|
+
export declare function isNodeEmpty(node: ProseMirrorNode, { checkChildren, ignoreWhitespace, }?: {
|
|
6
|
+
/**
|
|
7
|
+
* When true (default), it will also check if all children are empty.
|
|
8
|
+
*/
|
|
9
|
+
checkChildren?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* When true, it will ignore whitespace when checking for emptiness.
|
|
12
|
+
*/
|
|
13
|
+
ignoreWhitespace?: boolean;
|
|
8
14
|
}): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeType } from '@tiptap/pm/model';
|
|
2
2
|
import { PasteRule, PasteRuleFinder } from '../PasteRule.js';
|
|
3
|
-
import { ExtendedRegExpMatchArray } from '../types.js';
|
|
3
|
+
import { ExtendedRegExpMatchArray, JSONContent } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Build an paste rule that adds a node when the
|
|
6
6
|
* matched text is pasted into it.
|
|
@@ -10,4 +10,5 @@ export declare function nodePasteRule(config: {
|
|
|
10
10
|
find: PasteRuleFinder;
|
|
11
11
|
type: NodeType;
|
|
12
12
|
getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray, event: ClipboardEvent) => Record<string, any>) | false | null;
|
|
13
|
+
getContent?: JSONContent[] | ((attrs: Record<string, any>) => JSONContent[]) | false | null;
|
|
13
14
|
}): PasteRule;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-table-cell",
|
|
3
3
|
"description": "table cell extension for tiptap",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tiptap/core": "^2.
|
|
32
|
+
"@tiptap/core": "^2.6.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@tiptap/core": "^2.
|
|
35
|
+
"@tiptap/core": "^2.6.0"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|