@tiptap/extension-table 2.0.0-beta.20 → 2.0.0-beta.201
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/README.md +1 -1
- package/dist/packages/extension-table/src/TableView.d.ts +1 -1
- package/dist/packages/extension-table/src/index.d.ts +1 -0
- package/dist/packages/extension-table/src/table.d.ts +24 -23
- package/dist/packages/extension-table/src/utilities/createCell.d.ts +2 -2
- package/dist/packages/extension-table/src/utilities/createTable.d.ts +2 -2
- package/dist/packages/extension-table/src/utilities/getTableNodeTypes.d.ts +1 -1
- package/dist/packages/extension-table/src/utilities/isCellSelection.d.ts +1 -1
- package/dist/tiptap-extension-table.cjs.js +83 -5766
- package/dist/tiptap-extension-table.cjs.js.map +1 -1
- package/dist/tiptap-extension-table.esm.js +83 -5768
- package/dist/tiptap-extension-table.esm.js.map +1 -1
- package/dist/tiptap-extension-table.umd.js +86 -5770
- package/dist/tiptap-extension-table.umd.js.map +1 -1
- package/package.json +11 -5
- package/src/TableView.ts +3 -1
- package/src/index.ts +1 -0
- package/src/table.ts +61 -56
- package/src/utilities/createCell.ts +2 -6
- package/src/utilities/createTable.ts +6 -5
- package/src/utilities/deleteTableWhenAllCellsSelected.ts +2 -1
- package/src/utilities/getTableNodeTypes.ts +1 -1
- package/src/utilities/isCellSelection.ts +1 -1
- package/CHANGELOG.md +0 -234
- package/LICENSE.md +0 -21
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NodeView } from 'prosemirror-view';
|
|
2
1
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
2
|
+
import { NodeView } from 'prosemirror-view';
|
|
3
3
|
export declare function updateColumns(node: ProseMirrorNode, colgroup: Element, table: Element, cellMinWidth: number, overrideCol?: number, overrideValue?: any): void;
|
|
4
4
|
export declare class TableView implements NodeView {
|
|
5
5
|
node: ProseMirrorNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node,
|
|
1
|
+
import { Node, ParentConfig } from '@tiptap/core';
|
|
2
2
|
import { NodeView } from 'prosemirror-view';
|
|
3
3
|
export interface TableOptions {
|
|
4
4
|
HTMLAttributes: Record<string, any>;
|
|
@@ -10,45 +10,46 @@ export interface TableOptions {
|
|
|
10
10
|
allowTableNodeSelection: boolean;
|
|
11
11
|
}
|
|
12
12
|
declare module '@tiptap/core' {
|
|
13
|
-
interface Commands {
|
|
13
|
+
interface Commands<ReturnType> {
|
|
14
14
|
table: {
|
|
15
15
|
insertTable: (options?: {
|
|
16
16
|
rows?: number;
|
|
17
17
|
cols?: number;
|
|
18
18
|
withHeaderRow?: boolean;
|
|
19
|
-
}) =>
|
|
20
|
-
addColumnBefore: () =>
|
|
21
|
-
addColumnAfter: () =>
|
|
22
|
-
deleteColumn: () =>
|
|
23
|
-
addRowBefore: () =>
|
|
24
|
-
addRowAfter: () =>
|
|
25
|
-
deleteRow: () =>
|
|
26
|
-
deleteTable: () =>
|
|
27
|
-
mergeCells: () =>
|
|
28
|
-
splitCell: () =>
|
|
29
|
-
toggleHeaderColumn: () =>
|
|
30
|
-
toggleHeaderRow: () =>
|
|
31
|
-
toggleHeaderCell: () =>
|
|
32
|
-
mergeOrSplit: () =>
|
|
33
|
-
setCellAttribute: (name: string, value: any) =>
|
|
34
|
-
goToNextCell: () =>
|
|
35
|
-
goToPreviousCell: () =>
|
|
36
|
-
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
37
|
setCellSelection: (position: {
|
|
38
38
|
anchorCell: number;
|
|
39
39
|
headCell?: number;
|
|
40
|
-
}) =>
|
|
40
|
+
}) => ReturnType;
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
interface NodeConfig<Options> {
|
|
43
|
+
interface NodeConfig<Options, Storage> {
|
|
44
44
|
/**
|
|
45
45
|
* Table Role
|
|
46
46
|
*/
|
|
47
47
|
tableRole?: string | ((this: {
|
|
48
48
|
name: string;
|
|
49
49
|
options: Options;
|
|
50
|
+
storage: Storage;
|
|
50
51
|
parent: ParentConfig<NodeConfig<Options>>['tableRole'];
|
|
51
52
|
}) => string);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
|
-
export declare const Table: Node<TableOptions>;
|
|
55
|
+
export declare const Table: Node<TableOptions, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function createCell(cellType: NodeType, cellContent?: Fragment
|
|
1
|
+
import { Fragment, Node as ProsemirrorNode, NodeType } from 'prosemirror-model';
|
|
2
|
+
export declare function createCell(cellType: NodeType, cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>): ProsemirrorNode | null | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment
|
|
1
|
+
import { Fragment, Node as ProsemirrorNode, Schema } from 'prosemirror-model';
|
|
2
|
+
export declare function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>): ProsemirrorNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CellSelection } from 'prosemirror-tables';
|
|
1
|
+
import { CellSelection } from '@_ueberdosis/prosemirror-tables';
|
|
2
2
|
export declare function isCellSelection(value: unknown): value is CellSelection;
|