@tiptap/extension-table 2.0.0-beta.4 → 2.0.0-beta.43
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/LICENSE.md +1 -1
- package/README.md +2 -2
- package/dist/packages/extension-table/src/index.d.ts +1 -0
- package/dist/packages/extension-table/src/table.d.ts +30 -25
- package/dist/packages/extension-table/src/utilities/deleteTableWhenAllCellsSelected.d.ts +2 -0
- package/dist/tiptap-extension-table.cjs.js +143 -555
- package/dist/tiptap-extension-table.cjs.js.map +1 -1
- package/dist/tiptap-extension-table.esm.js +143 -557
- package/dist/tiptap-extension-table.esm.js.map +1 -1
- package/dist/tiptap-extension-table.umd.js +146 -558
- package/dist/tiptap-extension-table.umd.js.map +1 -1
- package/package.json +8 -4
- package/src/index.ts +1 -0
- package/src/table.ts +62 -72
- package/src/utilities/deleteTableWhenAllCellsSelected.ts +35 -0
- package/CHANGELOG.md +0 -88
- package/dist/tiptap-extension-table.bundle.umd.min.js +0 -2
- package/dist/tiptap-extension-table.bundle.umd.min.js.map +0 -1
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
## Introduction
|
|
8
8
|
tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Official Documentation
|
|
11
11
|
Documentation can be found on the [tiptap website](https://tiptap.dev).
|
|
12
12
|
|
|
13
13
|
## License
|
|
14
|
-
tiptap is open
|
|
14
|
+
tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Node, ParentConfig } from '@tiptap/core';
|
|
2
2
|
import { NodeView } from 'prosemirror-view';
|
|
3
3
|
export interface TableOptions {
|
|
4
|
-
HTMLAttributes:
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
};
|
|
4
|
+
HTMLAttributes: Record<string, any>;
|
|
7
5
|
resizable: boolean;
|
|
8
6
|
handleWidth: number;
|
|
9
7
|
cellMinWidth: number;
|
|
@@ -12,39 +10,46 @@ export interface TableOptions {
|
|
|
12
10
|
allowTableNodeSelection: boolean;
|
|
13
11
|
}
|
|
14
12
|
declare module '@tiptap/core' {
|
|
15
|
-
interface Commands {
|
|
13
|
+
interface Commands<ReturnType> {
|
|
16
14
|
table: {
|
|
17
15
|
insertTable: (options?: {
|
|
18
16
|
rows?: number;
|
|
19
17
|
cols?: number;
|
|
20
18
|
withHeaderRow?: boolean;
|
|
21
|
-
}) =>
|
|
22
|
-
addColumnBefore: () =>
|
|
23
|
-
addColumnAfter: () =>
|
|
24
|
-
deleteColumn: () =>
|
|
25
|
-
addRowBefore: () =>
|
|
26
|
-
addRowAfter: () =>
|
|
27
|
-
deleteRow: () =>
|
|
28
|
-
deleteTable: () =>
|
|
29
|
-
mergeCells: () =>
|
|
30
|
-
splitCell: () =>
|
|
31
|
-
toggleHeaderColumn: () =>
|
|
32
|
-
toggleHeaderRow: () =>
|
|
33
|
-
toggleHeaderCell: () =>
|
|
34
|
-
mergeOrSplit: () =>
|
|
35
|
-
setCellAttribute: (name: string, value: any) =>
|
|
36
|
-
goToNextCell: () =>
|
|
37
|
-
goToPreviousCell: () =>
|
|
38
|
-
fixTables: () =>
|
|
19
|
+
}) => ReturnType;
|
|
20
|
+
addColumnBefore: () => ReturnType;
|
|
21
|
+
addColumnAfter: () => ReturnType;
|
|
22
|
+
deleteColumn: () => ReturnType;
|
|
23
|
+
addRowBefore: () => ReturnType;
|
|
24
|
+
addRowAfter: () => ReturnType;
|
|
25
|
+
deleteRow: () => ReturnType;
|
|
26
|
+
deleteTable: () => ReturnType;
|
|
27
|
+
mergeCells: () => ReturnType;
|
|
28
|
+
splitCell: () => ReturnType;
|
|
29
|
+
toggleHeaderColumn: () => ReturnType;
|
|
30
|
+
toggleHeaderRow: () => ReturnType;
|
|
31
|
+
toggleHeaderCell: () => ReturnType;
|
|
32
|
+
mergeOrSplit: () => ReturnType;
|
|
33
|
+
setCellAttribute: (name: string, value: any) => ReturnType;
|
|
34
|
+
goToNextCell: () => ReturnType;
|
|
35
|
+
goToPreviousCell: () => ReturnType;
|
|
36
|
+
fixTables: () => ReturnType;
|
|
37
|
+
setCellSelection: (position: {
|
|
38
|
+
anchorCell: number;
|
|
39
|
+
headCell?: number;
|
|
40
|
+
}) => ReturnType;
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
|
-
interface NodeConfig<Options> {
|
|
43
|
+
interface NodeConfig<Options, Storage> {
|
|
42
44
|
/**
|
|
43
45
|
* Table Role
|
|
44
46
|
*/
|
|
45
47
|
tableRole?: string | ((this: {
|
|
48
|
+
name: string;
|
|
46
49
|
options: Options;
|
|
50
|
+
storage: Storage;
|
|
51
|
+
parent: ParentConfig<NodeConfig<Options>>['tableRole'];
|
|
47
52
|
}) => string);
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
|
-
export declare const Table: Node<TableOptions>;
|
|
55
|
+
export declare const Table: Node<TableOptions, unknown>;
|