@atlaskit/editor-tables 2.9.12 → 2.9.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-tables
2
2
 
3
+ ## 2.9.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0fdcb6f2f96fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fdcb6f2f96fd) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+ - Updated dependencies
10
+
3
11
  ## 2.9.12
4
12
 
5
13
  ### Patch Changes
@@ -3,9 +3,9 @@
3
3
  "compilerOptions": {
4
4
  "declaration": true,
5
5
  "target": "es5",
6
- "composite": true,
7
6
  "outDir": "../../../../../confluence/tsDist/@atlaskit__editor-tables",
8
- "rootDir": "../"
7
+ "rootDir": "../",
8
+ "composite": true
9
9
  },
10
10
  "include": [
11
11
  "../src/**/*.ts",
@@ -9,13 +9,13 @@ export declare class Rect {
9
9
  }
10
10
  export interface TableRect extends Rect {
11
11
  map: TableMap;
12
- tableStart: number;
13
12
  table: PMNode;
13
+ tableStart: number;
14
14
  }
15
15
  export type TableContext = {
16
16
  map: TableMap;
17
- tableStart: number;
18
17
  table: PMNode;
18
+ tableStart: number;
19
19
  };
20
20
  export declare enum TableProblemTypes {
21
21
  COLLISION = "collision",
@@ -24,25 +24,25 @@ export declare enum TableProblemTypes {
24
24
  COLWIDTH_MISMATCH = "colwidth mismatch"
25
25
  }
26
26
  export type TableProblemCollision = {
27
- type: TableProblemTypes.COLLISION;
28
- row: number;
29
- pos: number;
30
27
  n: number;
28
+ pos: number;
29
+ row: number;
30
+ type: TableProblemTypes.COLLISION;
31
31
  };
32
32
  export type TableProblemLongRowspan = {
33
- type: TableProblemTypes.OVERLONG_ROWSPAN;
34
- pos: number;
35
33
  n: number;
34
+ pos: number;
35
+ type: TableProblemTypes.OVERLONG_ROWSPAN;
36
36
  };
37
37
  export type TableProblemMissing = {
38
- type: TableProblemTypes.MISSING;
39
- row: number;
40
38
  n: number;
39
+ row: number;
40
+ type: TableProblemTypes.MISSING;
41
41
  };
42
42
  export type TableProblemColWidthMismatch = {
43
- type: TableProblemTypes;
44
- pos: number;
45
43
  colwidth: number;
44
+ pos: number;
45
+ type: TableProblemTypes;
46
46
  };
47
47
  export type TableProblem = TableProblemCollision | TableProblemLongRowspan | TableProblemMissing | TableProblemColWidthMismatch;
48
48
  export declare const tableNewColumnMinWidth = 140;
@@ -2,24 +2,24 @@ import type { Fragment, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  export interface CellAttributes {
5
+ background?: string;
5
6
  colspan?: number;
6
- rowspan?: number;
7
7
  colwidth?: number[];
8
- background?: string;
8
+ rowspan?: number;
9
9
  }
10
10
  export interface SelectionBounds {
11
11
  $from: ResolvedPos;
12
12
  $to: ResolvedPos;
13
13
  }
14
14
  export interface SerializedCellSelection {
15
- type: 'cell';
16
15
  anchor: number;
17
16
  head: number;
17
+ type: 'cell';
18
18
  }
19
19
  export interface CellSelectionRect {
20
20
  height: number;
21
- width: number;
22
21
  rows: Fragment[];
22
+ width: number;
23
23
  }
24
24
  export type Axis = 'horiz' | 'vert';
25
25
  export type Direction = -1 | 1;
@@ -38,12 +38,12 @@ export type Writeable<T> = {
38
38
  -readonly [P in keyof T]: T[P];
39
39
  };
40
40
  export interface MoveOptions {
41
- tryToFit?: boolean;
42
41
  direction?: number;
43
42
  selectAfterMove?: boolean;
43
+ tryToFit?: boolean;
44
44
  }
45
45
  export interface CloneOptions {
46
- tryToFit?: boolean;
47
46
  direction?: number;
48
47
  selectAfterClone?: boolean;
48
+ tryToFit?: boolean;
49
49
  }
@@ -2,6 +2,6 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { TableMap } from '../table-map';
3
3
  import type { TableNodeCache } from './table-node-types';
4
4
  export declare function determineTableHeaderStateFromTableNode(table: PMNode, tableMap: TableMap, types: TableNodeCache): {
5
- rowHeaderEnabled: boolean;
6
5
  columnHeaderEnabled: boolean;
6
+ rowHeaderEnabled: boolean;
7
7
  };
@@ -2,10 +2,10 @@ import { type Selection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { TableMap } from '../table-map';
3
3
  import { findTable } from './find';
4
4
  export declare function getSelectedTableInfo(selection: Selection): {
5
- table: ReturnType<typeof findTable> | undefined;
6
5
  map: TableMap | undefined;
7
- totalRowCount: number;
6
+ table: ReturnType<typeof findTable> | undefined;
8
7
  totalColumnCount: number;
8
+ totalRowCount: number;
9
9
  };
10
10
  export declare function getSelectedCellInfo(selection: Selection): {
11
11
  totalRowCount: number;
@@ -1,12 +1,12 @@
1
1
  import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  type CreateTableProps = {
3
- schema: Schema;
4
- rowsCount?: number;
5
- colsCount?: number;
6
- withHeaderRow?: boolean;
7
3
  cellContent?: PMNode;
8
- tableWidth?: number | 'inherit';
4
+ colsCount?: number;
9
5
  layout?: string;
6
+ rowsCount?: number;
7
+ schema: Schema;
8
+ tableWidth?: number | 'inherit';
9
+ withHeaderRow?: boolean;
10
10
  };
11
11
  export declare const createTable: ({ schema, rowsCount, colsCount, withHeaderRow, cellContent, tableWidth, layout, }: CreateTableProps) => PMNode;
12
12
  export {};
@@ -1,9 +1,9 @@
1
1
  import { type Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import { type EditorState, type Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export type ReportFixedTable = ({ state, tr, reason, }: {
4
+ reason: string;
4
5
  state: EditorState;
5
6
  tr: Transaction;
6
- reason: string;
7
7
  }) => void;
8
8
  export declare function fixTables(state: EditorState, oldState?: EditorState, reportFixedTable?: ReportFixedTable): Transaction | undefined;
9
9
  export declare function fixTable(state: EditorState, table: Node, tablePos: number, transaction?: Transaction, reportFixedTable?: ReportFixedTable): Transaction | undefined;
@@ -2,9 +2,9 @@ import { type NodeType, type Node as PMNode, ResolvedPos } from '@atlaskit/edito
2
2
  import { type Command } from '../types';
3
3
  export declare function cellWrapping($pos: ResolvedPos): PMNode | null;
4
4
  export type GetCellTypeArgs = {
5
- row: number;
6
5
  col: number;
7
6
  node: PMNode;
7
+ row: number;
8
8
  };
9
9
  type GetCellTypeCallback = (option: GetCellTypeArgs) => NodeType;
10
10
  export declare function splitCellWithType(getCellType: GetCellTypeCallback): Command;
@@ -9,13 +9,13 @@ export declare class Rect {
9
9
  }
10
10
  export interface TableRect extends Rect {
11
11
  map: TableMap;
12
- tableStart: number;
13
12
  table: PMNode;
13
+ tableStart: number;
14
14
  }
15
15
  export type TableContext = {
16
16
  map: TableMap;
17
- tableStart: number;
18
17
  table: PMNode;
18
+ tableStart: number;
19
19
  };
20
20
  export declare enum TableProblemTypes {
21
21
  COLLISION = "collision",
@@ -24,25 +24,25 @@ export declare enum TableProblemTypes {
24
24
  COLWIDTH_MISMATCH = "colwidth mismatch"
25
25
  }
26
26
  export type TableProblemCollision = {
27
- type: TableProblemTypes.COLLISION;
28
- row: number;
29
- pos: number;
30
27
  n: number;
28
+ pos: number;
29
+ row: number;
30
+ type: TableProblemTypes.COLLISION;
31
31
  };
32
32
  export type TableProblemLongRowspan = {
33
- type: TableProblemTypes.OVERLONG_ROWSPAN;
34
- pos: number;
35
33
  n: number;
34
+ pos: number;
35
+ type: TableProblemTypes.OVERLONG_ROWSPAN;
36
36
  };
37
37
  export type TableProblemMissing = {
38
- type: TableProblemTypes.MISSING;
39
- row: number;
40
38
  n: number;
39
+ row: number;
40
+ type: TableProblemTypes.MISSING;
41
41
  };
42
42
  export type TableProblemColWidthMismatch = {
43
- type: TableProblemTypes;
44
- pos: number;
45
43
  colwidth: number;
44
+ pos: number;
45
+ type: TableProblemTypes;
46
46
  };
47
47
  export type TableProblem = TableProblemCollision | TableProblemLongRowspan | TableProblemMissing | TableProblemColWidthMismatch;
48
48
  export declare const tableNewColumnMinWidth = 140;
@@ -2,24 +2,24 @@ import type { Fragment, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  export interface CellAttributes {
5
+ background?: string;
5
6
  colspan?: number;
6
- rowspan?: number;
7
7
  colwidth?: number[];
8
- background?: string;
8
+ rowspan?: number;
9
9
  }
10
10
  export interface SelectionBounds {
11
11
  $from: ResolvedPos;
12
12
  $to: ResolvedPos;
13
13
  }
14
14
  export interface SerializedCellSelection {
15
- type: 'cell';
16
15
  anchor: number;
17
16
  head: number;
17
+ type: 'cell';
18
18
  }
19
19
  export interface CellSelectionRect {
20
20
  height: number;
21
- width: number;
22
21
  rows: Fragment[];
22
+ width: number;
23
23
  }
24
24
  export type Axis = 'horiz' | 'vert';
25
25
  export type Direction = -1 | 1;
@@ -38,12 +38,12 @@ export type Writeable<T> = {
38
38
  -readonly [P in keyof T]: T[P];
39
39
  };
40
40
  export interface MoveOptions {
41
- tryToFit?: boolean;
42
41
  direction?: number;
43
42
  selectAfterMove?: boolean;
43
+ tryToFit?: boolean;
44
44
  }
45
45
  export interface CloneOptions {
46
- tryToFit?: boolean;
47
46
  direction?: number;
48
47
  selectAfterClone?: boolean;
48
+ tryToFit?: boolean;
49
49
  }
@@ -2,6 +2,6 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { TableMap } from '../table-map';
3
3
  import type { TableNodeCache } from './table-node-types';
4
4
  export declare function determineTableHeaderStateFromTableNode(table: PMNode, tableMap: TableMap, types: TableNodeCache): {
5
- rowHeaderEnabled: boolean;
6
5
  columnHeaderEnabled: boolean;
6
+ rowHeaderEnabled: boolean;
7
7
  };
@@ -2,10 +2,10 @@ import { type Selection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { TableMap } from '../table-map';
3
3
  import { findTable } from './find';
4
4
  export declare function getSelectedTableInfo(selection: Selection): {
5
- table: ReturnType<typeof findTable> | undefined;
6
5
  map: TableMap | undefined;
7
- totalRowCount: number;
6
+ table: ReturnType<typeof findTable> | undefined;
8
7
  totalColumnCount: number;
8
+ totalRowCount: number;
9
9
  };
10
10
  export declare function getSelectedCellInfo(selection: Selection): {
11
11
  totalRowCount: number;
@@ -1,12 +1,12 @@
1
1
  import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  type CreateTableProps = {
3
- schema: Schema;
4
- rowsCount?: number;
5
- colsCount?: number;
6
- withHeaderRow?: boolean;
7
3
  cellContent?: PMNode;
8
- tableWidth?: number | 'inherit';
4
+ colsCount?: number;
9
5
  layout?: string;
6
+ rowsCount?: number;
7
+ schema: Schema;
8
+ tableWidth?: number | 'inherit';
9
+ withHeaderRow?: boolean;
10
10
  };
11
11
  export declare const createTable: ({ schema, rowsCount, colsCount, withHeaderRow, cellContent, tableWidth, layout, }: CreateTableProps) => PMNode;
12
12
  export {};
@@ -1,9 +1,9 @@
1
1
  import { type Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import { type EditorState, type Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export type ReportFixedTable = ({ state, tr, reason, }: {
4
+ reason: string;
4
5
  state: EditorState;
5
6
  tr: Transaction;
6
- reason: string;
7
7
  }) => void;
8
8
  export declare function fixTables(state: EditorState, oldState?: EditorState, reportFixedTable?: ReportFixedTable): Transaction | undefined;
9
9
  export declare function fixTable(state: EditorState, table: Node, tablePos: number, transaction?: Transaction, reportFixedTable?: ReportFixedTable): Transaction | undefined;
@@ -2,9 +2,9 @@ import { type NodeType, type Node as PMNode, ResolvedPos } from '@atlaskit/edito
2
2
  import { type Command } from '../types';
3
3
  export declare function cellWrapping($pos: ResolvedPos): PMNode | null;
4
4
  export type GetCellTypeArgs = {
5
- row: number;
6
5
  col: number;
7
6
  node: PMNode;
7
+ row: number;
8
8
  };
9
9
  type GetCellTypeCallback = (option: GetCellTypeArgs) => NodeType;
10
10
  export declare function splitCellWithType(getCellType: GetCellTypeCallback): Command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.9.12",
3
+ "version": "2.9.13",
4
4
  "description": "A package that contains common classes and utility functions for editor tables",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/editor-prosemirror": "7.0.0",
31
31
  "@atlaskit/platform-feature-flags": "^1.1.0",
32
- "@atlaskit/tmp-editor-statsig": "^11.5.0",
32
+ "@atlaskit/tmp-editor-statsig": "^11.6.0",
33
33
  "@babel/runtime": "^7.0.0"
34
34
  },
35
35
  "techstack": {