@atlaskit/editor-tables 3.2.16 → 3.2.18

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,19 @@
1
1
  # @atlaskit/editor-tables
2
2
 
3
+ ## 3.2.18
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.2.17
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8d37dc7e55d62`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d37dc7e55d62) -
14
+ Clean up shipped experiment `platform_editor_block_menu`
15
+ - Updated dependencies
16
+
3
17
  ## 3.2.16
4
18
 
5
19
  ### Patch Changes
@@ -4,33 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.selectTableClosestToPos = void 0;
7
- var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
8
- var _cellSelection = require("../cell-selection");
9
- var _tableMap = require("../table-map");
10
7
  var _cloneTr = require("./clone-tr");
11
- var _findTableClosestToPos = require("./find-table-closest-to-pos");
12
8
  var _getTableSelectionClosesToPos = require("./get-table-selection-closes-to-pos");
13
9
  var selectTableClosestToPos = exports.selectTableClosestToPos = function selectTableClosestToPos(tr, $pos) {
14
- if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true, {
15
- exposure: true
16
- })) {
17
- var tableSelection = (0, _getTableSelectionClosesToPos.getTableSelectionClosesToPos)($pos);
18
- if (tableSelection) {
19
- return (0, _cloneTr.cloneTr)(tr.setSelection(tableSelection));
20
- }
21
- return tr;
22
- }
23
- var table = (0, _findTableClosestToPos.findTableClosestToPos)($pos);
24
- if (table) {
25
- var _TableMap$get = _tableMap.TableMap.get(table.node),
26
- map = _TableMap$get.map;
27
- if (map && map.length) {
28
- var head = table.start + map[0];
29
- var anchor = table.start + map[map.length - 1];
30
- var $head = tr.doc.resolve(head);
31
- var $anchor = tr.doc.resolve(anchor);
32
- return (0, _cloneTr.cloneTr)(tr.setSelection(new _cellSelection.CellSelection($anchor, $head)));
33
- }
10
+ var tableSelection = (0, _getTableSelectionClosesToPos.getTableSelectionClosesToPos)($pos);
11
+ if (tableSelection) {
12
+ return (0, _cloneTr.cloneTr)(tr.setSelection(tableSelection));
34
13
  }
35
14
  return tr;
36
15
  };
@@ -214,6 +214,7 @@ export class TableMap {
214
214
  /**
215
215
  * @deprecated Use `import { Rect } from '@atlaskit/editor-tables/rect'` instead.
216
216
  */
217
+
217
218
  export { Rect } from './rect';
218
219
 
219
220
  /**
@@ -1,31 +1,9 @@
1
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
2
- import { CellSelection } from '../cell-selection';
3
- import { TableMap } from '../table-map';
4
1
  import { cloneTr } from './clone-tr';
5
- import { findTableClosestToPos } from './find-table-closest-to-pos';
6
2
  import { getTableSelectionClosesToPos } from './get-table-selection-closes-to-pos';
7
3
  export const selectTableClosestToPos = (tr, $pos) => {
8
- if (editorExperiment('platform_editor_block_menu', true, {
9
- exposure: true
10
- })) {
11
- const tableSelection = getTableSelectionClosesToPos($pos);
12
- if (tableSelection) {
13
- return cloneTr(tr.setSelection(tableSelection));
14
- }
15
- return tr;
16
- }
17
- const table = findTableClosestToPos($pos);
18
- if (table) {
19
- const {
20
- map
21
- } = TableMap.get(table.node);
22
- if (map && map.length) {
23
- const head = table.start + map[0];
24
- const anchor = table.start + map[map.length - 1];
25
- const $head = tr.doc.resolve(head);
26
- const $anchor = tr.doc.resolve(anchor);
27
- return cloneTr(tr.setSelection(new CellSelection($anchor, $head)));
28
- }
4
+ const tableSelection = getTableSelectionClosesToPos($pos);
5
+ if (tableSelection) {
6
+ return cloneTr(tr.setSelection(tableSelection));
29
7
  }
30
8
  return tr;
31
9
  };
@@ -243,6 +243,7 @@ export var TableMap = /*#__PURE__*/function () {
243
243
  /**
244
244
  * @deprecated Use `import { Rect } from '@atlaskit/editor-tables/rect'` instead.
245
245
  */
246
+
246
247
  export { Rect } from './rect';
247
248
 
248
249
  /**
@@ -1,30 +1,9 @@
1
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
2
- import { CellSelection } from '../cell-selection';
3
- import { TableMap } from '../table-map';
4
1
  import { cloneTr } from './clone-tr';
5
- import { findTableClosestToPos } from './find-table-closest-to-pos';
6
2
  import { getTableSelectionClosesToPos } from './get-table-selection-closes-to-pos';
7
3
  export var selectTableClosestToPos = function selectTableClosestToPos(tr, $pos) {
8
- if (editorExperiment('platform_editor_block_menu', true, {
9
- exposure: true
10
- })) {
11
- var tableSelection = getTableSelectionClosesToPos($pos);
12
- if (tableSelection) {
13
- return cloneTr(tr.setSelection(tableSelection));
14
- }
15
- return tr;
16
- }
17
- var table = findTableClosestToPos($pos);
18
- if (table) {
19
- var _TableMap$get = TableMap.get(table.node),
20
- map = _TableMap$get.map;
21
- if (map && map.length) {
22
- var head = table.start + map[0];
23
- var anchor = table.start + map[map.length - 1];
24
- var $head = tr.doc.resolve(head);
25
- var $anchor = tr.doc.resolve(anchor);
26
- return cloneTr(tr.setSelection(new CellSelection($anchor, $head)));
27
- }
4
+ var tableSelection = getTableSelectionClosesToPos($pos);
5
+ if (tableSelection) {
6
+ return cloneTr(tr.setSelection(tableSelection));
28
7
  }
29
8
  return tr;
30
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "3.2.16",
3
+ "version": "3.2.18",
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/"
@@ -21,11 +21,11 @@
21
21
  "dependencies": {
22
22
  "@atlaskit/editor-prosemirror": "^9.0.0",
23
23
  "@atlaskit/platform-feature-flags": "^2.2.0",
24
- "@atlaskit/tmp-editor-statsig": "^199.0.0",
24
+ "@atlaskit/tmp-editor-statsig": "^201.0.0",
25
25
  "@babel/runtime": "^7.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@atlaskit/editor-common": "^123.0.0",
28
+ "@atlaskit/editor-common": "^123.2.0",
29
29
  "@atlaskit/editor-test-helpers": "workspace:^",
30
30
  "@atlassian/a11y-jest-testing": "^0.17.0"
31
31
  },