1 | import { Node as PmNode, NodeSpec } from 'prosemirror-model';
|
2 | import { CellAttributes } from '@atlaskit/editor-tables/types';
|
3 | import { PanelDefinition as Panel } from './panel';
|
4 | import { ParagraphDefinition as Paragraph, ParagraphWithAlignmentDefinition as ParagraphWithMarks } from './paragraph';
|
5 | import { BlockQuoteDefinition as Blockquote } from './blockquote';
|
6 | import { OrderedListDefinition as OrderedList } from './types/list';
|
7 | import { BulletListDefinition as BulletList } from './types/list';
|
8 | import { RuleDefinition as Rule } from './rule';
|
9 | import { HeadingDefinition as Heading, HeadingWithMarksDefinition as HeadingWithMarks } from './heading';
|
10 | import { CodeBlockDefinition as CodeBlock } from './code-block';
|
11 | import { MediaGroupDefinition as MediaGroup } from './media-group';
|
12 | import { MediaSingleDefinition as MediaSingle } from './media-single';
|
13 | import { DecisionListDefinition as DecisionList } from './decision-list';
|
14 | import { TaskListDefinition as TaskList } from './task-list';
|
15 | import { ExtensionDefinition as Extension } from './extension';
|
16 | import { BlockCardDefinition as BlockCard } from './block-card';
|
17 | import { EmbedCardDefinition as EmbedCard } from './embed-card';
|
18 | import { NestedExpandDefinition as NestedExpand } from './nested-expand';
|
19 | import { FragmentDefinition } from '../marks/fragment';
|
20 | export type { CellAttributes };
|
21 | export declare const tablePrefixSelector = "pm-table";
|
22 | export declare const tableCellSelector: string;
|
23 | export declare const tableHeaderSelector: string;
|
24 | export declare const tableCellContentWrapperSelector: string;
|
25 | export declare const tableCellContentDomSelector: string;
|
26 | export declare const getCellAttrs: (dom: HTMLElement, defaultValues?: CellAttributes) => {
|
27 | colspan: number;
|
28 | rowspan: number;
|
29 | colwidth: number[] | null;
|
30 | background: string | null;
|
31 | };
|
32 | export declare type CellDomAttrs = {
|
33 | colspan?: string;
|
34 | rowspan?: string;
|
35 | style?: string;
|
36 | colorname?: string;
|
37 | 'data-colwidth'?: string;
|
38 | 'data-cell-background'?: string;
|
39 | class?: string;
|
40 | };
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export declare const getCellDomAttrs: (node: PmNode) => CellDomAttrs;
|
46 | export declare const tableBackgroundColorPalette: Map<string, string>;
|
47 | export declare const tableBackgroundBorderColor: string;
|
48 | export declare const tableBackgroundColorNames: Map<string, string>;
|
49 | export declare type Layout = 'default' | 'full-width' | 'wide';
|
50 | export interface TableAttributes {
|
51 | isNumberColumnEnabled?: boolean;
|
52 | layout?: Layout;
|
53 | __autoSize?: boolean;
|
54 | |
55 |
|
56 |
|
57 | localId?: string;
|
58 | }
|
59 |
|
60 |
|
61 |
|
62 | export interface TableDefinition {
|
63 | type: 'table';
|
64 | attrs?: TableAttributes;
|
65 | |
66 |
|
67 |
|
68 | content: Array<TableRow>;
|
69 | marks?: Array<FragmentDefinition>;
|
70 | }
|
71 |
|
72 |
|
73 |
|
74 | export interface TableRow {
|
75 | type: 'tableRow';
|
76 | content: Array<TableHeader | TableCell>;
|
77 | }
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | export declare type TableCellContent = Array<Panel | Paragraph | ParagraphWithMarks | Blockquote | OrderedList | BulletList | Rule | Heading | HeadingWithMarks | CodeBlock | MediaGroup | MediaSingle | DecisionList | TaskList | Extension | BlockCard | NestedExpand | EmbedCard>;
|
84 |
|
85 |
|
86 |
|
87 | export interface TableCell {
|
88 | type: 'tableCell';
|
89 | attrs?: CellAttributes;
|
90 | content: TableCellContent;
|
91 | }
|
92 |
|
93 |
|
94 |
|
95 | export interface TableHeader {
|
96 | type: 'tableHeader';
|
97 | attrs?: CellAttributes;
|
98 | content: TableCellContent;
|
99 | }
|
100 | export declare const table: NodeSpec;
|
101 | export declare const tableToJSON: (node: PmNode) => {
|
102 | attrs: {
|
103 | [key: string]: any;
|
104 | };
|
105 | };
|
106 | export declare const tableRow: NodeSpec;
|
107 | export declare const tableCell: NodeSpec;
|
108 | export declare const toJSONTableCell: (node: PmNode) => {
|
109 | attrs: Record<string, any>;
|
110 | };
|
111 | export declare const tableHeader: NodeSpec;
|
112 | export declare const toJSONTableHeader: (node: PmNode) => {
|
113 | attrs: Record<string, any>;
|
114 | };
|