@atlaskit/editor-tables 2.10.18 → 2.10.20
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
|
+
## 2.10.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.10.19
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7f8f275864fb6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f8f275864fb6) -
|
|
14
|
+
Cleanup experiment `platform_editor_analyse_table_with_merged_cells`.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 2.10.18
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.determineTableHeaderStateFromTableNode = determineTableHeaderStateFromTableNode;
|
|
7
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
8
7
|
function determineTableHeaderStateFromTableNode(table, tableMap, types) {
|
|
9
8
|
// We only really need to check the nth (last) cell in the row/col if it's a header, since we only support a single full row/col header on the top & left
|
|
10
9
|
// of a table. We can assume that if the nth (last) cell is also a header then the entire row/col is a header.
|
|
@@ -16,21 +15,20 @@ function determineTableHeaderStateFromTableNode(table, tableMap, types) {
|
|
|
16
15
|
// bit: 1 = Identifies if the cell at (0, n) is a header cell or not
|
|
17
16
|
// bit: 2 = Identifies if the cell at (n, 0) is a header cell or not
|
|
18
17
|
var mask = 0;
|
|
19
|
-
var isExperimentEnabled = (0, _expValEquals.expValEquals)('platform_editor_analyse_table_with_merged_cells', 'isEnabled', true);
|
|
20
18
|
|
|
21
19
|
// At minimum we should have 1 cell in the table.
|
|
22
20
|
var topLeftCell = table.nodeAt(tableMap.map[0]);
|
|
23
21
|
// If this cell is a header that could indicate
|
|
24
22
|
mask |= topLeftCell && topLeftCell.type === types.header_cell ? 1 : 0;
|
|
25
23
|
if (tableMap.width > 1) {
|
|
26
|
-
var cell =
|
|
24
|
+
var cell = table.nodeAt(tableMap.map[tableMap.width - 1]);
|
|
27
25
|
// If the cell at (0, n) is a header then we set the bit flag to indicate row headers are enabled, otherwise if it's
|
|
28
26
|
// not then we will set the col headers enabled flag (and vice versa in the branch below) only if the cell at (0,0)
|
|
29
27
|
// was a header cell.
|
|
30
28
|
mask |= cell && cell.type === types.header_cell ? 2 : 4 * (mask & 1);
|
|
31
29
|
}
|
|
32
30
|
if (tableMap.height > 1) {
|
|
33
|
-
var _cell =
|
|
31
|
+
var _cell = table.nodeAt(tableMap.map[tableMap.width * (tableMap.height - 1)]);
|
|
34
32
|
mask |= _cell && _cell.type === types.header_cell ? 4 : 2 * (mask & 1);
|
|
35
33
|
}
|
|
36
34
|
return {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
1
|
export function determineTableHeaderStateFromTableNode(table, tableMap, types) {
|
|
3
2
|
// We only really need to check the nth (last) cell in the row/col if it's a header, since we only support a single full row/col header on the top & left
|
|
4
3
|
// of a table. We can assume that if the nth (last) cell is also a header then the entire row/col is a header.
|
|
@@ -10,21 +9,20 @@ export function determineTableHeaderStateFromTableNode(table, tableMap, types) {
|
|
|
10
9
|
// bit: 1 = Identifies if the cell at (0, n) is a header cell or not
|
|
11
10
|
// bit: 2 = Identifies if the cell at (n, 0) is a header cell or not
|
|
12
11
|
let mask = 0;
|
|
13
|
-
const isExperimentEnabled = expValEquals('platform_editor_analyse_table_with_merged_cells', 'isEnabled', true);
|
|
14
12
|
|
|
15
13
|
// At minimum we should have 1 cell in the table.
|
|
16
14
|
const topLeftCell = table.nodeAt(tableMap.map[0]);
|
|
17
15
|
// If this cell is a header that could indicate
|
|
18
16
|
mask |= topLeftCell && topLeftCell.type === types.header_cell ? 1 : 0;
|
|
19
17
|
if (tableMap.width > 1) {
|
|
20
|
-
const cell =
|
|
18
|
+
const cell = table.nodeAt(tableMap.map[tableMap.width - 1]);
|
|
21
19
|
// If the cell at (0, n) is a header then we set the bit flag to indicate row headers are enabled, otherwise if it's
|
|
22
20
|
// not then we will set the col headers enabled flag (and vice versa in the branch below) only if the cell at (0,0)
|
|
23
21
|
// was a header cell.
|
|
24
22
|
mask |= cell && cell.type === types.header_cell ? 2 : 4 * (mask & 1);
|
|
25
23
|
}
|
|
26
24
|
if (tableMap.height > 1) {
|
|
27
|
-
const cell =
|
|
25
|
+
const cell = table.nodeAt(tableMap.map[tableMap.width * (tableMap.height - 1)]);
|
|
28
26
|
mask |= cell && cell.type === types.header_cell ? 4 : 2 * (mask & 1);
|
|
29
27
|
}
|
|
30
28
|
return {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
1
|
export function determineTableHeaderStateFromTableNode(table, tableMap, types) {
|
|
3
2
|
// We only really need to check the nth (last) cell in the row/col if it's a header, since we only support a single full row/col header on the top & left
|
|
4
3
|
// of a table. We can assume that if the nth (last) cell is also a header then the entire row/col is a header.
|
|
@@ -10,21 +9,20 @@ export function determineTableHeaderStateFromTableNode(table, tableMap, types) {
|
|
|
10
9
|
// bit: 1 = Identifies if the cell at (0, n) is a header cell or not
|
|
11
10
|
// bit: 2 = Identifies if the cell at (n, 0) is a header cell or not
|
|
12
11
|
var mask = 0;
|
|
13
|
-
var isExperimentEnabled = expValEquals('platform_editor_analyse_table_with_merged_cells', 'isEnabled', true);
|
|
14
12
|
|
|
15
13
|
// At minimum we should have 1 cell in the table.
|
|
16
14
|
var topLeftCell = table.nodeAt(tableMap.map[0]);
|
|
17
15
|
// If this cell is a header that could indicate
|
|
18
16
|
mask |= topLeftCell && topLeftCell.type === types.header_cell ? 1 : 0;
|
|
19
17
|
if (tableMap.width > 1) {
|
|
20
|
-
var cell =
|
|
18
|
+
var cell = table.nodeAt(tableMap.map[tableMap.width - 1]);
|
|
21
19
|
// If the cell at (0, n) is a header then we set the bit flag to indicate row headers are enabled, otherwise if it's
|
|
22
20
|
// not then we will set the col headers enabled flag (and vice versa in the branch below) only if the cell at (0,0)
|
|
23
21
|
// was a header cell.
|
|
24
22
|
mask |= cell && cell.type === types.header_cell ? 2 : 4 * (mask & 1);
|
|
25
23
|
}
|
|
26
24
|
if (tableMap.height > 1) {
|
|
27
|
-
var _cell =
|
|
25
|
+
var _cell = table.nodeAt(tableMap.map[tableMap.width * (tableMap.height - 1)]);
|
|
28
26
|
mask |= _cell && _cell.type === types.header_cell ? 4 : 2 * (mask & 1);
|
|
29
27
|
}
|
|
30
28
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-tables",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.20",
|
|
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": "^100.0.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|