@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.
@@ -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,4 @@
1
+ import { Table } from './table';
2
+ export * from './table';
3
+ export * from './utilities/createTable';
4
+ export default Table;
@@ -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 { NodeType, Fragment, Node as ProsemirrorNode, Schema } from 'prosemirror-model';
2
+ export declare function createCell(cellType: NodeType, cellContent?: Fragment<Schema> | ProsemirrorNode<Schema> | Array<ProsemirrorNode<Schema>>): ProsemirrorNode | null | undefined;
@@ -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;
@@ -0,0 +1,2 @@
1
+ import { KeyboardShortcutCommand } from '@tiptap/core';
2
+ export declare const deleteTableWhenAllCellsSelected: KeyboardShortcutCommand;
@@ -0,0 +1,4 @@
1
+ import { Schema, NodeType } from 'prosemirror-model';
2
+ export declare function getTableNodeTypes(schema: Schema): {
3
+ [key: string]: NodeType;
4
+ };
@@ -0,0 +1,2 @@
1
+ import { CellSelection } from 'prosemirror-tables';
2
+ export declare function isCellSelection(value: unknown): value is CellSelection;