@atlaskit/editor-tables 2.9.51 → 2.9.53
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 +13 -0
- package/dist/cjs/cell-selection.js +1 -0
- package/dist/cjs/utils/copy-paste.js +1 -0
- package/dist/cjs/utils/select-nodes.js +4 -2
- package/dist/es2019/cell-selection.js +1 -0
- package/dist/es2019/utils/copy-paste.js +1 -0
- package/dist/es2019/utils/select-nodes.js +4 -2
- package/dist/esm/cell-selection.js +1 -0
- package/dist/esm/utils/copy-paste.js +1 -0
- package/dist/esm/utils/select-nodes.js +4 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-tables
|
|
2
2
|
|
|
3
|
+
## 2.9.53
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.9.52
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9ed32aea2c1d3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ed32aea2c1d3) -
|
|
14
|
+
Replace feature experiment util with cross platform alternative for platform_editor_block_menu
|
|
15
|
+
|
|
3
16
|
## 2.9.51
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -157,6 +157,7 @@ var CellSelection = exports.CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
157
157
|
$from = _ranges$i.$from,
|
|
158
158
|
$to = _ranges$i.$to;
|
|
159
159
|
var mapping = tr.mapping.slice(mapFrom);
|
|
160
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-split-replace -- Ignored via go/ees017 (to be fixed)
|
|
160
161
|
tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ? _model.Slice.empty : content);
|
|
161
162
|
}
|
|
162
163
|
var sel = _state.Selection.findFrom(tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)), -1);
|
|
@@ -410,6 +410,7 @@ function insertCells(state, dispatch, tableStart, rect, cells) {
|
|
|
410
410
|
for (var row = top; row < bottom; row++) {
|
|
411
411
|
var from = map.positionAt(row, left, table);
|
|
412
412
|
var to = map.positionAt(row, right, table);
|
|
413
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-split-replace -- Ignored via go/ees017 (to be fixed)
|
|
413
414
|
tr.replace(tr.mapping.slice(mapFrom).map(from + tableStart), tr.mapping.slice(mapFrom).map(to + tableStart), new _model.Slice(cells.rows[row - top], 0, 0));
|
|
414
415
|
}
|
|
415
416
|
recomp();
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.selectTableClosestToPos = exports.selectTable = exports.selectRows = exports.selectRow = exports.selectColumns = exports.selectColumn = exports.getTableSelectionClosesToPos = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var
|
|
9
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
10
10
|
var _cellSelection = require("../cell-selection");
|
|
11
11
|
var _tableMap = require("../table-map");
|
|
12
12
|
var _cloneTr = require("./clone-tr");
|
|
@@ -182,7 +182,9 @@ var getTableSelectionClosesToPos = exports.getTableSelectionClosesToPos = functi
|
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
var selectTableClosestToPos = exports.selectTableClosestToPos = function selectTableClosestToPos(tr, $pos) {
|
|
185
|
-
if ((0,
|
|
185
|
+
if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true, {
|
|
186
|
+
exposure: true
|
|
187
|
+
})) {
|
|
186
188
|
var tableSelection = getTableSelectionClosesToPos($pos);
|
|
187
189
|
if (tableSelection) {
|
|
188
190
|
return (0, _cloneTr.cloneTr)(tr.setSelection(tableSelection));
|
|
@@ -139,6 +139,7 @@ export class CellSelection extends Selection {
|
|
|
139
139
|
$to
|
|
140
140
|
} = ranges[i];
|
|
141
141
|
const mapping = tr.mapping.slice(mapFrom);
|
|
142
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-split-replace -- Ignored via go/ees017 (to be fixed)
|
|
142
143
|
tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);
|
|
143
144
|
}
|
|
144
145
|
const sel = Selection.findFrom(tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)), -1);
|
|
@@ -416,6 +416,7 @@ export function insertCells(state, dispatch, tableStart, rect, cells) {
|
|
|
416
416
|
for (let row = top; row < bottom; row++) {
|
|
417
417
|
const from = map.positionAt(row, left, table);
|
|
418
418
|
const to = map.positionAt(row, right, table);
|
|
419
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-split-replace -- Ignored via go/ees017 (to be fixed)
|
|
419
420
|
tr.replace(tr.mapping.slice(mapFrom).map(from + tableStart), tr.mapping.slice(mapFrom).map(to + tableStart), new Slice(cells.rows[row - top], 0, 0));
|
|
420
421
|
}
|
|
421
422
|
recomp();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
2
|
import { CellSelection } from '../cell-selection';
|
|
3
3
|
import { TableMap } from '../table-map';
|
|
4
4
|
import { cloneTr } from './clone-tr';
|
|
@@ -168,7 +168,9 @@ export const getTableSelectionClosesToPos = $pos => {
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
export const selectTableClosestToPos = (tr, $pos) => {
|
|
171
|
-
if (
|
|
171
|
+
if (editorExperiment('platform_editor_block_menu', true, {
|
|
172
|
+
exposure: true
|
|
173
|
+
})) {
|
|
172
174
|
const tableSelection = getTableSelectionClosesToPos($pos);
|
|
173
175
|
if (tableSelection) {
|
|
174
176
|
return cloneTr(tr.setSelection(tableSelection));
|
|
@@ -156,6 +156,7 @@ export var CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
156
156
|
$from = _ranges$i.$from,
|
|
157
157
|
$to = _ranges$i.$to;
|
|
158
158
|
var mapping = tr.mapping.slice(mapFrom);
|
|
159
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-split-replace -- Ignored via go/ees017 (to be fixed)
|
|
159
160
|
tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);
|
|
160
161
|
}
|
|
161
162
|
var sel = Selection.findFrom(tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)), -1);
|
|
@@ -403,6 +403,7 @@ export function insertCells(state, dispatch, tableStart, rect, cells) {
|
|
|
403
403
|
for (var row = top; row < bottom; row++) {
|
|
404
404
|
var from = map.positionAt(row, left, table);
|
|
405
405
|
var to = map.positionAt(row, right, table);
|
|
406
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-split-replace -- Ignored via go/ees017 (to be fixed)
|
|
406
407
|
tr.replace(tr.mapping.slice(mapFrom).map(from + tableStart), tr.mapping.slice(mapFrom).map(to + tableStart), new Slice(cells.rows[row - top], 0, 0));
|
|
407
408
|
}
|
|
408
409
|
recomp();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import {
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { CellSelection } from '../cell-selection';
|
|
4
4
|
import { TableMap } from '../table-map';
|
|
5
5
|
import { cloneTr } from './clone-tr';
|
|
@@ -175,7 +175,9 @@ export var getTableSelectionClosesToPos = function getTableSelectionClosesToPos(
|
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
177
|
export var selectTableClosestToPos = function selectTableClosestToPos(tr, $pos) {
|
|
178
|
-
if (
|
|
178
|
+
if (editorExperiment('platform_editor_block_menu', true, {
|
|
179
|
+
exposure: true
|
|
180
|
+
})) {
|
|
179
181
|
var tableSelection = getTableSelectionClosesToPos($pos);
|
|
180
182
|
if (tableSelection) {
|
|
181
183
|
return cloneTr(tr.setSelection(tableSelection));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-tables",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.53",
|
|
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.3.0",
|
|
31
31
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^44.0.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|