@tiptap/extension-table 2.0.0-beta.41 → 2.0.0-beta.42
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/extension-table/src/TableView.d.ts +17 -0
- package/dist/packages/extension-table/src/index.d.ts +4 -0
- package/dist/packages/extension-table/src/table.d.ts +55 -0
- package/dist/packages/extension-table/src/utilities/createCell.d.ts +2 -0
- package/dist/packages/extension-table/src/utilities/createTable.d.ts +2 -0
- package/dist/packages/extension-table/src/utilities/deleteTableWhenAllCellsSelected.d.ts +2 -0
- package/dist/packages/extension-table/src/utilities/getTableNodeTypes.d.ts +4 -0
- package/dist/packages/extension-table/src/utilities/isCellSelection.d.ts +2 -0
- package/dist/tiptap-extension-table.cjs.js +5457 -0
- package/dist/tiptap-extension-table.cjs.js.map +1 -0
- package/dist/tiptap-extension-table.esm.js +5451 -0
- package/dist/tiptap-extension-table.esm.js.map +1 -0
- package/dist/tiptap-extension-table.umd.js +5460 -0
- package/dist/tiptap-extension-table.umd.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NodeView } from 'prosemirror-view';
|
|
2
|
+
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
3
|
+
export declare function updateColumns(node: ProseMirrorNode, colgroup: Element, table: Element, cellMinWidth: number, overrideCol?: number, overrideValue?: any): void;
|
|
4
|
+
export declare class TableView implements NodeView {
|
|
5
|
+
node: ProseMirrorNode;
|
|
6
|
+
cellMinWidth: number;
|
|
7
|
+
dom: Element;
|
|
8
|
+
table: Element;
|
|
9
|
+
colgroup: Element;
|
|
10
|
+
contentDOM: Element;
|
|
11
|
+
constructor(node: ProseMirrorNode, cellMinWidth: number);
|
|
12
|
+
update(node: ProseMirrorNode): boolean;
|
|
13
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
14
|
+
type: 'selection';
|
|
15
|
+
target: Element;
|
|
16
|
+
}): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Node, ParentConfig } from '@tiptap/core';
|
|
2
|
+
import { NodeView } from 'prosemirror-view';
|
|
3
|
+
export interface TableOptions {
|
|
4
|
+
HTMLAttributes: Record<string, any>;
|
|
5
|
+
resizable: boolean;
|
|
6
|
+
handleWidth: number;
|
|
7
|
+
cellMinWidth: number;
|
|
8
|
+
View: NodeView;
|
|
9
|
+
lastColumnResizable: boolean;
|
|
10
|
+
allowTableNodeSelection: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare module '@tiptap/core' {
|
|
13
|
+
interface Commands<ReturnType> {
|
|
14
|
+
table: {
|
|
15
|
+
insertTable: (options?: {
|
|
16
|
+
rows?: number;
|
|
17
|
+
cols?: number;
|
|
18
|
+
withHeaderRow?: boolean;
|
|
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;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
interface NodeConfig<Options, Storage> {
|
|
44
|
+
/**
|
|
45
|
+
* Table Role
|
|
46
|
+
*/
|
|
47
|
+
tableRole?: string | ((this: {
|
|
48
|
+
name: string;
|
|
49
|
+
options: Options;
|
|
50
|
+
storage: Storage;
|
|
51
|
+
parent: ParentConfig<NodeConfig<Options>>['tableRole'];
|
|
52
|
+
}) => string);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export declare const Table: Node<TableOptions, unknown>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Schema, Fragment, Node as ProsemirrorNode } from 'prosemirror-model';
|
|
2
|
+
export declare function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>): ProsemirrorNode;
|