@atlaskit/editor-plugin-table 2.6.3 → 2.6.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 +6 -0
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +7 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +7 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +7 -1
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 2.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`467515ad237`](https://bitbucket.org/atlassian/atlassian-frontend/commits/467515ad237) - [ux] ED-17628 Maximum table width is calculated using table node to make adding columns behabiour similar to current behaviuor when custom table widths is enabled.
|
|
8
|
+
|
|
3
9
|
## 2.6.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -14,6 +14,7 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
14
14
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
// Translates named layouts in number values.
|
|
18
19
|
function getLayoutSize(tableLayout) {
|
|
19
20
|
var containerWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -74,7 +75,12 @@ var getTableMaxWidth = function getTableMaxWidth(_ref2) {
|
|
|
74
75
|
getEditorContainerWidth = _ref2.getEditorContainerWidth;
|
|
75
76
|
var containerWidth = getEditorContainerWidth();
|
|
76
77
|
var parentWidth = (0, _nodeWidth.getParentNodeWidth)(tableStart, state, containerWidth);
|
|
77
|
-
var maxWidth
|
|
78
|
+
var maxWidth;
|
|
79
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width')) {
|
|
80
|
+
maxWidth = parentWidth || table.attrs.width || getLayoutSize(layout, containerWidth.width, {});
|
|
81
|
+
} else {
|
|
82
|
+
maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {});
|
|
83
|
+
}
|
|
78
84
|
if (table.attrs.isNumberColumnEnabled) {
|
|
79
85
|
maxWidth -= _editorSharedStyles.akEditorTableNumberColumnWidth;
|
|
80
86
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -3,6 +3,7 @@ import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
|
3
3
|
import { getBreakpoint, mapBreakpointToLayoutMaxWidth } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { containsClassName } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
// Translates named layouts in number values.
|
|
7
8
|
export function getLayoutSize(tableLayout, containerWidth = 0, options) {
|
|
8
9
|
const {
|
|
@@ -65,7 +66,12 @@ export const getTableMaxWidth = ({
|
|
|
65
66
|
}) => {
|
|
66
67
|
const containerWidth = getEditorContainerWidth();
|
|
67
68
|
const parentWidth = getParentNodeWidth(tableStart, state, containerWidth);
|
|
68
|
-
let maxWidth
|
|
69
|
+
let maxWidth;
|
|
70
|
+
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
71
|
+
maxWidth = parentWidth || table.attrs.width || getLayoutSize(layout, containerWidth.width, {});
|
|
72
|
+
} else {
|
|
73
|
+
maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {});
|
|
74
|
+
}
|
|
69
75
|
if (table.attrs.isNumberColumnEnabled) {
|
|
70
76
|
maxWidth -= akEditorTableNumberColumnWidth;
|
|
71
77
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -3,6 +3,7 @@ import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
|
3
3
|
import { getBreakpoint, mapBreakpointToLayoutMaxWidth } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { containsClassName } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
// Translates named layouts in number values.
|
|
7
8
|
export function getLayoutSize(tableLayout) {
|
|
8
9
|
var containerWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -63,7 +64,12 @@ export var getTableMaxWidth = function getTableMaxWidth(_ref2) {
|
|
|
63
64
|
getEditorContainerWidth = _ref2.getEditorContainerWidth;
|
|
64
65
|
var containerWidth = getEditorContainerWidth();
|
|
65
66
|
var parentWidth = getParentNodeWidth(tableStart, state, containerWidth);
|
|
66
|
-
var maxWidth
|
|
67
|
+
var maxWidth;
|
|
68
|
+
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
69
|
+
maxWidth = parentWidth || table.attrs.width || getLayoutSize(layout, containerWidth.width, {});
|
|
70
|
+
} else {
|
|
71
|
+
maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {});
|
|
72
|
+
}
|
|
67
73
|
if (table.attrs.isNumberColumnEnabled) {
|
|
68
74
|
maxWidth -= akEditorTableNumberColumnWidth;
|
|
69
75
|
}
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
akEditorGutterPadding,
|
|
20
20
|
akEditorTableNumberColumnWidth,
|
|
21
21
|
} from '@atlaskit/editor-shared-styles';
|
|
22
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
22
23
|
|
|
23
24
|
import { TableOptions } from '../../../nodeviews/types';
|
|
24
25
|
|
|
@@ -116,7 +117,15 @@ export const getTableMaxWidth = ({
|
|
|
116
117
|
const containerWidth = getEditorContainerWidth();
|
|
117
118
|
const parentWidth = getParentNodeWidth(tableStart, state, containerWidth);
|
|
118
119
|
|
|
119
|
-
let maxWidth
|
|
120
|
+
let maxWidth;
|
|
121
|
+
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
122
|
+
maxWidth =
|
|
123
|
+
parentWidth ||
|
|
124
|
+
table.attrs.width ||
|
|
125
|
+
getLayoutSize(layout, containerWidth.width, {});
|
|
126
|
+
} else {
|
|
127
|
+
maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {});
|
|
128
|
+
}
|
|
120
129
|
|
|
121
130
|
if (table.attrs.isNumberColumnEnabled) {
|
|
122
131
|
maxWidth -= akEditorTableNumberColumnWidth;
|