@atlaskit/editor-tables 2.3.0 → 2.3.1

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,11 @@
1
1
  # @atlaskit/editor-tables
2
2
 
3
+ ## 2.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
8
+
3
9
  ## 2.3.0
4
10
 
5
11
  ### Minor Changes
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/cell-bookmark.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/cell-bookmark.d.ts"
11
+ "../dist/types-ts4.5/cell-bookmark.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/cell-selection.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/cell-selection.d.ts"
11
+ "../dist/types-ts4.5/cell-selection.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from 'prosemirror-state';
2
2
  import { ReportFixedTable } from '../utils/fix-tables';
3
- declare type PluginState = number | null;
3
+ type PluginState = number | null;
4
4
  export declare function tableEditing({ allowTableNodeSelection, reportFixedTable, }?: {
5
5
  allowTableNodeSelection?: boolean;
6
6
  reportFixedTable?: ReportFixedTable;
@@ -12,7 +12,7 @@ export interface TableRect extends Rect {
12
12
  tableStart: number;
13
13
  table: PMNode;
14
14
  }
15
- export declare type TableContext = {
15
+ export type TableContext = {
16
16
  map: TableMap;
17
17
  tableStart: number;
18
18
  table: PMNode;
@@ -23,28 +23,28 @@ export declare enum TableProblemTypes {
23
23
  MISSING = "missing",
24
24
  COLWIDTH_MISMATCH = "colwidth mismatch"
25
25
  }
26
- export declare type TableProblemCollision = {
26
+ export type TableProblemCollision = {
27
27
  type: TableProblemTypes.COLLISION;
28
28
  row: number;
29
29
  pos: number;
30
30
  n: number;
31
31
  };
32
- export declare type TableProblemLongRowspan = {
32
+ export type TableProblemLongRowspan = {
33
33
  type: TableProblemTypes.OVERLONG_ROWSPAN;
34
34
  pos: number;
35
35
  n: number;
36
36
  };
37
- export declare type TableProblemMissing = {
37
+ export type TableProblemMissing = {
38
38
  type: TableProblemTypes.MISSING;
39
39
  row: number;
40
40
  n: number;
41
41
  };
42
- export declare type TableProblemColWidthMismatch = {
42
+ export type TableProblemColWidthMismatch = {
43
43
  type: TableProblemTypes;
44
44
  pos: number;
45
45
  colwidth: number;
46
46
  };
47
- export declare type TableProblem = TableProblemCollision | TableProblemLongRowspan | TableProblemMissing | TableProblemColWidthMismatch;
47
+ export type TableProblem = TableProblemCollision | TableProblemLongRowspan | TableProblemMissing | TableProblemColWidthMismatch;
48
48
  export declare const tableNewColumnMinWidth = 140;
49
49
  export declare class TableMap {
50
50
  width: number;
@@ -21,16 +21,16 @@ export interface CellSelectionRect {
21
21
  width: number;
22
22
  rows: Fragment[];
23
23
  }
24
- export declare type Axis = 'horiz' | 'vert';
25
- export declare type Direction = -1 | 1;
26
- export declare type Dispatch = (tr: Transaction) => void;
27
- export declare type Command = (state: EditorState, dispatch?: Dispatch) => boolean;
28
- export declare type CommandWithView = (state: EditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
29
- export declare type SelectionRange = {
24
+ export type Axis = 'horiz' | 'vert';
25
+ export type Direction = -1 | 1;
26
+ export type Dispatch = (tr: Transaction) => void;
27
+ export type Command = (state: EditorState, dispatch?: Dispatch) => boolean;
28
+ export type CommandWithView = (state: EditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
29
+ export type SelectionRange = {
30
30
  $anchor: ResolvedPos;
31
31
  $head: ResolvedPos;
32
32
  indexes: number[];
33
33
  };
34
- export declare type CellAttributesWithColSpan = CellAttributes & {
34
+ export type CellAttributesWithColSpan = CellAttributes & {
35
35
  colspan: number;
36
36
  };
@@ -1,3 +1,3 @@
1
1
  import { Transaction } from 'prosemirror-state';
2
2
  export declare const cloneRowAt: (rowIndex: number) => (tr: Transaction) => Transaction;
3
- export declare const addRowAt: (rowIndex: number, clonePreviousRow?: boolean | undefined) => (tr: Transaction) => Transaction;
3
+ export declare const addRowAt: (rowIndex: number, clonePreviousRow?: boolean) => (tr: Transaction) => Transaction;
@@ -1,5 +1,5 @@
1
1
  import { Node as PMNode, Schema } from 'prosemirror-model';
2
- declare type CreateTableProps = {
2
+ type CreateTableProps = {
3
3
  schema: Schema;
4
4
  rowsCount?: number;
5
5
  colsCount?: number;
@@ -1,6 +1,6 @@
1
1
  import { Node } from 'prosemirror-model';
2
2
  import { EditorState, Transaction } from 'prosemirror-state';
3
- export declare type ReportFixedTable = ({ state, tr, reason, }: {
3
+ export type ReportFixedTable = ({ state, tr, reason, }: {
4
4
  state: EditorState;
5
5
  tr: Transaction;
6
6
  reason: string;
@@ -1,4 +1,4 @@
1
1
  import { Transaction } from 'prosemirror-state';
2
2
  import { ContentNodeWithPos } from 'prosemirror-utils';
3
- export declare const forEachCellInColumn: (columnIndex: number, cellTransform: (cell: ContentNodeWithPos, tr: Transaction) => Transaction, setCursorToLastCell?: boolean | undefined) => (tr: Transaction) => Transaction;
3
+ export declare const forEachCellInColumn: (columnIndex: number, cellTransform: (cell: ContentNodeWithPos, tr: Transaction) => Transaction, setCursorToLastCell?: boolean) => (tr: Transaction) => Transaction;
4
4
  export declare const forEachCellInRow: (rowIndex: number, cellTransform: (cell: ContentNodeWithPos, tr: Transaction) => Transaction, setCursorToLastCell: boolean) => (tr: Transaction) => Transaction;
@@ -1,6 +1,6 @@
1
1
  import { Node as PMNode } from 'prosemirror-model';
2
2
  import { NodeWithPos } from 'prosemirror-utils';
3
- declare type ArrayOfRows = Array<PMNode | null>[];
3
+ type ArrayOfRows = Array<PMNode | null>[];
4
4
  export declare const transpose: (array: Array<any>) => Array<any>;
5
5
  export declare const convertArrayOfRowsToTableNode: (tableNode: PMNode, arrayOfNodes: ArrayOfRows) => PMNode;
6
6
  export declare const convertTableNodeToArrayOfRows: (tableNode: PMNode) => ArrayOfRows;
@@ -1,6 +1,6 @@
1
1
  import { ResolvedPos } from 'prosemirror-model';
2
2
  import { Transaction } from 'prosemirror-state';
3
- export declare const selectColumn: (index: number, expand?: boolean | undefined) => (tr: Transaction) => Transaction;
4
- export declare const selectRow: (index: number, expand?: boolean | undefined) => (tr: Transaction) => Transaction;
3
+ export declare const selectColumn: (index: number, expand?: boolean) => (tr: Transaction) => Transaction;
4
+ export declare const selectRow: (index: number, expand?: boolean) => (tr: Transaction) => Transaction;
5
5
  export declare const selectTable: (tr: Transaction) => Transaction;
6
6
  export declare const selectTableClosestToPos: (tr: Transaction, $pos: ResolvedPos) => Transaction;
@@ -1,4 +1,4 @@
1
1
  import { EditorState } from 'prosemirror-state';
2
2
  import { Rect, TableContext } from '../table-map';
3
- export declare type SelectionRect = Rect & TableContext;
3
+ export type SelectionRect = Rect & TableContext;
4
4
  export declare function selectedRect(state: EditorState): SelectionRect;
@@ -1,11 +1,11 @@
1
1
  import { NodeType, Node as PMNode, ResolvedPos } from 'prosemirror-model';
2
2
  import { Command } from '../types';
3
3
  export declare function cellWrapping($pos: ResolvedPos): PMNode | null;
4
- export declare type GetCellTypeArgs = {
4
+ export type GetCellTypeArgs = {
5
5
  row: number;
6
6
  col: number;
7
7
  node: PMNode;
8
8
  };
9
- declare type GetCellTypeCallback = (option: GetCellTypeArgs) => NodeType;
9
+ type GetCellTypeCallback = (option: GetCellTypeArgs) => NodeType;
10
10
  export declare function splitCellWithType(getCellType: GetCellTypeCallback): Command;
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import { NodeType, Schema } from 'prosemirror-model';
2
- export declare type TableNodeCache = {
2
+ export type TableNodeCache = {
3
3
  [key: string]: NodeType;
4
4
  };
5
5
  export declare function tableNodeTypes(schema: Schema): TableNodeCache;
@@ -1,6 +1,6 @@
1
1
  import { Command } from '../types';
2
2
  import { SelectionRect } from './selection-rect';
3
3
  import { TableNodeCache } from './table-node-types';
4
- export declare type ToggleType = 'column' | 'row';
4
+ export type ToggleType = 'column' | 'row';
5
5
  export declare function isHeaderEnabledByType(type: ToggleType, rect: SelectionRect, types: TableNodeCache): boolean;
6
6
  export declare function toggleHeader(type: ToggleType): Command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
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/"
@@ -12,6 +12,14 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.5 <4.9": {
17
+ "*": [
18
+ "dist/types-ts4.5/*",
19
+ "dist/types-ts4.5/index.d.ts"
20
+ ]
21
+ }
22
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.ts",
17
25
  "atlassian": {
@@ -30,7 +38,7 @@
30
38
  },
31
39
  "devDependencies": {
32
40
  "@atlaskit/adf-schema": "^25.6.0",
33
- "@atlaskit/editor-test-helpers": "^18.2.0",
41
+ "@atlaskit/editor-test-helpers": "^18.3.0",
34
42
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1"
35
43
  },
36
44
  "techstack": {
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/pm-plugins.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/pm-plugins.d.ts"
11
+ "../dist/types-ts4.5/pm-plugins.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/table-map.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/table-map.d.ts"
11
+ "../dist/types-ts4.5/table-map.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/types.d.ts"
11
+ "../dist/types-ts4.5/types.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/utils.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/utils.d.ts"
11
+ "../dist/types-ts4.5/utils.d.ts"
12
12
  ]
13
13
  }
14
14
  }