@atlaskit/editor-tables 2.5.1 → 2.5.3

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.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
9
+ ## 2.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#69650](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69650) [`91a5b96796cb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/91a5b96796cb) - Migrate @atlaskit/editor-tables to use declarative entry points
14
+
3
15
  ## 2.5.1
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
  }
package/dist/cjs/utils.js CHANGED
@@ -357,6 +357,12 @@ Object.defineProperty(exports, "selectTable", {
357
357
  return _selectNodes.selectTable;
358
358
  }
359
359
  });
360
+ Object.defineProperty(exports, "selectTableClosestToPos", {
361
+ enumerable: true,
362
+ get: function get() {
363
+ return _selectNodes.selectTableClosestToPos;
364
+ }
365
+ });
360
366
  Object.defineProperty(exports, "selectedRect", {
361
367
  enumerable: true,
362
368
  get: function get() {
@@ -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
  }
@@ -27,7 +27,7 @@ export { normalizeSelection } from './utils/normalize-selection';
27
27
  export { removeColumnAt, removeSelectedColumns, removeColumnClosestToPos } from './utils/remove-column';
28
28
  export { removeRowAt, removeSelectedRows, removeRowClosestToPos } from './utils/remove-row';
29
29
  export { removeTable } from './utils/remove-table';
30
- export { selectColumn, selectColumns, selectRow, selectRows, selectTable } from './utils/select-nodes';
30
+ export { selectColumn, selectColumns, selectRow, selectRows, selectTable, selectTableClosestToPos } from './utils/select-nodes';
31
31
  export { selectionCell } from './utils/selection-cell';
32
32
  export { selectedRect } from './utils/selection-rect';
33
33
  export { setCellAttrs } from './utils/set-cell-attrs';
@@ -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
  }
package/dist/esm/utils.js CHANGED
@@ -27,7 +27,7 @@ export { normalizeSelection } from './utils/normalize-selection';
27
27
  export { removeColumnAt, removeSelectedColumns, removeColumnClosestToPos } from './utils/remove-column';
28
28
  export { removeRowAt, removeSelectedRows, removeRowClosestToPos } from './utils/remove-row';
29
29
  export { removeTable } from './utils/remove-table';
30
- export { selectColumn, selectColumns, selectRow, selectRows, selectTable } from './utils/select-nodes';
30
+ export { selectColumn, selectColumns, selectRow, selectRows, selectTable, selectTableClosestToPos } from './utils/select-nodes';
31
31
  export { selectionCell } from './utils/selection-cell';
32
32
  export { selectedRect } from './utils/selection-rect';
33
33
  export { setCellAttrs } from './utils/set-cell-attrs';
@@ -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;
@@ -27,7 +27,7 @@ export { normalizeSelection } from './utils/normalize-selection';
27
27
  export { removeColumnAt, removeSelectedColumns, removeColumnClosestToPos, } from './utils/remove-column';
28
28
  export { removeRowAt, removeSelectedRows, removeRowClosestToPos, } from './utils/remove-row';
29
29
  export { removeTable } from './utils/remove-table';
30
- export { selectColumn, selectColumns, selectRow, selectRows, selectTable, } from './utils/select-nodes';
30
+ export { selectColumn, selectColumns, selectRow, selectRows, selectTable, selectTableClosestToPos, } from './utils/select-nodes';
31
31
  export { selectionCell } from './utils/selection-cell';
32
32
  export { selectedRect } from './utils/selection-rect';
33
33
  export type { SelectionRect } from './utils/selection-rect';
@@ -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;
@@ -27,7 +27,7 @@ export { normalizeSelection } from './utils/normalize-selection';
27
27
  export { removeColumnAt, removeSelectedColumns, removeColumnClosestToPos, } from './utils/remove-column';
28
28
  export { removeRowAt, removeSelectedRows, removeRowClosestToPos, } from './utils/remove-row';
29
29
  export { removeTable } from './utils/remove-table';
30
- export { selectColumn, selectColumns, selectRow, selectRows, selectTable, } from './utils/select-nodes';
30
+ export { selectColumn, selectColumns, selectRow, selectRows, selectTable, selectTableClosestToPos, } from './utils/select-nodes';
31
31
  export { selectionCell } from './utils/selection-cell';
32
32
  export { selectedRect } from './utils/selection-rect';
33
33
  export type { SelectionRect } from './utils/selection-rect';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
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/"
@@ -24,7 +24,6 @@
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
26
  "team": "Editor: Jenga",
27
- "deprecatedAutoEntryPoints": true,
28
27
  "singleton": true,
29
28
  "releaseModel": "continuous"
30
29
  },
@@ -35,7 +34,7 @@
35
34
  },
36
35
  "devDependencies": {
37
36
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
38
- "@atlassian/feature-flags-test-utils": "^0.1.2"
37
+ "@atlassian/feature-flags-test-utils": "^0.2.0"
39
38
  },
40
39
  "techstack": {
41
40
  "@atlassian/frontend": {
@@ -62,5 +61,14 @@
62
61
  "platform.editor.table-shift-click-selection-backward": {
63
62
  "type": "boolean"
64
63
  }
64
+ },
65
+ "af:exports": {
66
+ ".": "./src/index.ts",
67
+ "./cell-bookmark": "./src/cell-bookmark.ts",
68
+ "./cell-selection": "./src/cell-selection.ts",
69
+ "./pm-plugins": "./src/pm-plugins.ts",
70
+ "./table-map": "./src/table-map.ts",
71
+ "./types": "./src/types.ts",
72
+ "./utils": "./src/utils.ts"
65
73
  }
66
74
  }