@atlaskit/editor-tables 2.5.2 → 2.5.4

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,17 @@
1
1
  # @atlaskit/editor-tables
2
2
 
3
+ ## 2.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#68572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68572) [`15d407fe5143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15d407fe5143) - Upgrading @atlaskit/editor-prosemirror dependency
8
+
9
+ ## 2.5.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#70718](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70718) [`e5d2832002bb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e5d2832002bb) - Patched a bug in the table paste logic which was throwing an error during the selection phase of the paste event when the pasted data contained a table row ending with a merged cell. The error from the selection is causing the table data to be injected as plain text inline.
14
+
3
15
  ## 2.5.2
4
16
 
5
17
  ### Patch Changes
@@ -399,6 +399,6 @@ function insertCells(state, dispatch, tableStart, rect, cells) {
399
399
  }
400
400
  recomp();
401
401
  applyHeaderCells(tr, map, state, tableStart, table, headerRowEnabled, headerColumnEnabled);
402
- tr.setSelection(new _cellSelection.CellSelection(tr.doc.resolve(tableStart + map.positionAt(top, left, table)), tr.doc.resolve(tableStart + map.positionAt(bottom - 1, right - 1, table))));
402
+ tr.setSelection(new _cellSelection.CellSelection(tr.doc.resolve(tableStart + map.map[top * map.width + left]), tr.doc.resolve(tableStart + map.map[(bottom - 1) * map.width + right - 1])));
403
403
  dispatch(tr);
404
404
  }
@@ -406,6 +406,6 @@ export function insertCells(state, dispatch, tableStart, rect, cells) {
406
406
  }
407
407
  recomp();
408
408
  applyHeaderCells(tr, map, state, tableStart, table, headerRowEnabled, headerColumnEnabled);
409
- tr.setSelection(new CellSelection(tr.doc.resolve(tableStart + map.positionAt(top, left, table)), tr.doc.resolve(tableStart + map.positionAt(bottom - 1, right - 1, table))));
409
+ tr.setSelection(new CellSelection(tr.doc.resolve(tableStart + map.map[top * map.width + left]), tr.doc.resolve(tableStart + map.map[(bottom - 1) * map.width + right - 1])));
410
410
  dispatch(tr);
411
411
  }
@@ -393,6 +393,6 @@ export function insertCells(state, dispatch, tableStart, rect, cells) {
393
393
  }
394
394
  recomp();
395
395
  applyHeaderCells(tr, map, state, tableStart, table, headerRowEnabled, headerColumnEnabled);
396
- tr.setSelection(new CellSelection(tr.doc.resolve(tableStart + map.positionAt(top, left, table)), tr.doc.resolve(tableStart + map.positionAt(bottom - 1, right - 1, table))));
396
+ tr.setSelection(new CellSelection(tr.doc.resolve(tableStart + map.map[top * map.width + left]), tr.doc.resolve(tableStart + map.map[(bottom - 1) * map.width + right - 1])));
397
397
  dispatch(tr);
398
398
  }
@@ -1,7 +1,8 @@
1
- import { NodeType, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import { Rect } from '../table-map';
4
- import { CellSelectionRect, Dispatch } from '../types';
1
+ import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { Slice } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
+ import type { Rect } from '../table-map';
5
+ import type { CellSelectionRect, Dispatch } from '../types';
5
6
  export declare function pastedCells(slice: Slice): CellSelectionRect | null;
6
7
  export declare function fitSlice(nodeType: NodeType, slice: Slice): PMNode;
7
8
  export declare function clipCells({ width: currentWidth, height: currentHeight, rows: currentRows, }: CellSelectionRect, newWidth: number, newHeight: number): CellSelectionRect;
@@ -1,7 +1,8 @@
1
- import { NodeType, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/model';
2
- import { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import { Rect } from '../table-map';
4
- import { CellSelectionRect, Dispatch } from '../types';
1
+ import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import { Slice } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
+ import type { Rect } from '../table-map';
5
+ import type { CellSelectionRect, Dispatch } from '../types';
5
6
  export declare function pastedCells(slice: Slice): CellSelectionRect | null;
6
7
  export declare function fitSlice(nodeType: NodeType, slice: Slice): PMNode;
7
8
  export declare function clipCells({ width: currentWidth, height: currentHeight, rows: currentRows, }: CellSelectionRect, newWidth: number, newHeight: number): CellSelectionRect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
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/"
@@ -28,13 +28,13 @@
28
28
  "releaseModel": "continuous"
29
29
  },
30
30
  "dependencies": {
31
- "@atlaskit/editor-prosemirror": "1.1.0",
31
+ "@atlaskit/editor-prosemirror": "3.0.0",
32
32
  "@atlaskit/platform-feature-flags": "^0.2.4",
33
33
  "@babel/runtime": "^7.0.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
37
- "@atlassian/feature-flags-test-utils": "^0.1.2"
37
+ "@atlassian/feature-flags-test-utils": "^0.2.0"
38
38
  },
39
39
  "techstack": {
40
40
  "@atlassian/frontend": {
package/tsconfig.json CHANGED
@@ -1,36 +1,7 @@
1
1
  {
2
2
  "extends": "../../../tsconfig.json",
3
3
  "compilerOptions": {
4
- "baseUrl": "./",
5
- "paths": {
6
- "@atlaskit/platform-feature-flags": [
7
- "../../platform/feature-flags/src/index.ts"
8
- ],
9
- "@atlassian/feature-flags-test-utils": [
10
- "../../platform/feature-flags-test-utils/src/index.ts"
11
- ],
12
- "@atlaskit/editor-tables/cell-bookmark": [
13
- "src/cell-bookmark.ts"
14
- ],
15
- "@atlaskit/editor-tables/cell-selection": [
16
- "src/cell-selection.ts"
17
- ],
18
- "@atlaskit/editor-tables/pm-plugins": [
19
- "src/pm-plugins.ts"
20
- ],
21
- "@atlaskit/editor-tables/table-map": [
22
- "src/table-map.ts"
23
- ],
24
- "@atlaskit/editor-tables/types": [
25
- "src/types.ts"
26
- ],
27
- "@atlaskit/editor-tables/utils": [
28
- "src/utils.ts"
29
- ],
30
- "@atlaskit/editor-tables": [
31
- "./src"
32
- ]
33
- }
4
+ "baseUrl": "./"
34
5
  },
35
6
  "include": [
36
7
  "src/**/*.ts",