@atlaskit/editor-plugin-table 2.6.6 → 2.6.8
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 +12 -0
- package/dist/cjs/plugins/table/nodeviews/table.js +13 -5
- package/dist/cjs/plugins/table/utils/guidelines.js +11 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/nodeviews/table.js +11 -4
- package/dist/es2019/plugins/table/utils/guidelines.js +9 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/nodeviews/table.js +13 -5
- package/dist/esm/plugins/table/utils/guidelines.js +10 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types/plugins/table/utils/guidelines.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/guidelines.d.ts +1 -1
- package/package.json +3 -3
- package/src/plugins/table/nodeviews/TableContainer.tsx +1 -1
- package/src/plugins/table/nodeviews/TableResizer.tsx +1 -1
- package/src/plugins/table/nodeviews/table.tsx +17 -10
- package/src/plugins/table/utils/guidelines.ts +14 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 2.6.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d432ad14798`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d432ad14798) - [ux] Added standard page guidelines when custom table width enabled and is resizing table.
|
|
8
|
+
|
|
9
|
+
## 2.6.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`56f4b88f7c2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56f4b88f7c2) - [ux] ED-19317: fix numbered column shifted up issue when sticky header
|
|
14
|
+
|
|
3
15
|
## 2.6.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -13,8 +13,8 @@ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
19
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
20
20
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
@@ -32,20 +32,28 @@ var _utils2 = require("../utils");
|
|
|
32
32
|
var _TableComponent = _interopRequireDefault(require("./TableComponent"));
|
|
33
33
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
34
34
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
36
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35
37
|
var tableAttributes = function tableAttributes(node, options, state, pos) {
|
|
36
38
|
// provide a width for tables when custom table width is supported
|
|
37
39
|
// this is to ensure 'responsive' tables (colgroup widths are undefined) become fixed to
|
|
38
40
|
// support screen size adjustments
|
|
39
41
|
var shouldHaveInlineWidth = (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && !(0, _utils2.isTableNested)(state, pos);
|
|
40
|
-
var style =
|
|
41
|
-
|
|
42
|
+
var style = "width: ".concat(node.attrs.isNumberColumnEnabled ? (0, _nodeWidth.getTableContainerWidth)(node) - _editorSharedStyles.akEditorTableNumberColumnWidth : (0, _nodeWidth.getTableContainerWidth)(node), "px");
|
|
43
|
+
var dataAttrsInTable = {
|
|
42
44
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
43
45
|
'data-layout': node.attrs.layout,
|
|
44
46
|
'data-autosize': node.attrs.__autoSize,
|
|
45
47
|
'data-table-local-id': node.attrs.localId || '',
|
|
46
|
-
'data-table-width': node.attrs.width
|
|
47
|
-
style: style
|
|
48
|
+
'data-table-width': node.attrs.width
|
|
48
49
|
};
|
|
50
|
+
if (shouldHaveInlineWidth) {
|
|
51
|
+
// this should be fixed because style will overwrite any existing styles, current found conflict with sticky headers
|
|
52
|
+
return _objectSpread(_objectSpread({}, dataAttrsInTable), {}, {
|
|
53
|
+
style: style
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return dataAttrsInTable;
|
|
49
57
|
};
|
|
50
58
|
var toDOM = function toDOM(node, props) {
|
|
51
59
|
var colgroup = '';
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.defaultGuidelines = exports.defaultGuidelineWidths = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
7
9
|
var _guideline = require("@atlaskit/editor-common/guideline");
|
|
8
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
9
|
-
var
|
|
11
|
+
var numberOfLanesInDefaultLayoutWidth = 12;
|
|
12
|
+
var calculateGuidelineWidthsInDefaultLayoutWidth = function calculateGuidelineWidthsInDefaultLayoutWidth() {
|
|
13
|
+
var widths = [];
|
|
14
|
+
for (var i = 0; i <= numberOfLanesInDefaultLayoutWidth / 2; i++) {
|
|
15
|
+
widths.push(_editorSharedStyles.akEditorDefaultLayoutWidth / numberOfLanesInDefaultLayoutWidth * i * 2);
|
|
16
|
+
}
|
|
17
|
+
return widths;
|
|
18
|
+
};
|
|
19
|
+
var defaultGuidelineWidths = [].concat((0, _toConsumableArray2.default)(calculateGuidelineWidthsInDefaultLayoutWidth()), [_editorSharedStyles.akEditorDefaultLayoutWidth, _editorSharedStyles.akEditorWideLayoutWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth]);
|
|
10
20
|
exports.defaultGuidelineWidths = defaultGuidelineWidths;
|
|
11
21
|
var defaultGuidelines = (0, _guideline.createFixedGuidelinesFromLengths)(defaultGuidelineWidths);
|
|
12
22
|
exports.defaultGuidelines = defaultGuidelines;
|
package/dist/cjs/version.json
CHANGED
|
@@ -19,15 +19,22 @@ const tableAttributes = (node, options, state, pos) => {
|
|
|
19
19
|
// this is to ensure 'responsive' tables (colgroup widths are undefined) become fixed to
|
|
20
20
|
// support screen size adjustments
|
|
21
21
|
const shouldHaveInlineWidth = (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && !isTableNested(state, pos);
|
|
22
|
-
let style =
|
|
23
|
-
|
|
22
|
+
let style = `width: ${node.attrs.isNumberColumnEnabled ? getTableContainerWidth(node) - akEditorTableNumberColumnWidth : getTableContainerWidth(node)}px`;
|
|
23
|
+
const dataAttrsInTable = {
|
|
24
24
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
25
25
|
'data-layout': node.attrs.layout,
|
|
26
26
|
'data-autosize': node.attrs.__autoSize,
|
|
27
27
|
'data-table-local-id': node.attrs.localId || '',
|
|
28
|
-
'data-table-width': node.attrs.width
|
|
29
|
-
style
|
|
28
|
+
'data-table-width': node.attrs.width
|
|
30
29
|
};
|
|
30
|
+
if (shouldHaveInlineWidth) {
|
|
31
|
+
// this should be fixed because style will overwrite any existing styles, current found conflict with sticky headers
|
|
32
|
+
return {
|
|
33
|
+
...dataAttrsInTable,
|
|
34
|
+
style
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return dataAttrsInTable;
|
|
31
38
|
};
|
|
32
39
|
const toDOM = (node, props) => {
|
|
33
40
|
let colgroup = '';
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { createFixedGuidelinesFromLengths } from '@atlaskit/editor-common/guideline';
|
|
2
2
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
|
|
3
|
+
const numberOfLanesInDefaultLayoutWidth = 12;
|
|
4
|
+
const calculateGuidelineWidthsInDefaultLayoutWidth = () => {
|
|
5
|
+
let widths = [];
|
|
6
|
+
for (let i = 0; i <= numberOfLanesInDefaultLayoutWidth / 2; i++) {
|
|
7
|
+
widths.push(akEditorDefaultLayoutWidth / numberOfLanesInDefaultLayoutWidth * i * 2);
|
|
8
|
+
}
|
|
9
|
+
return widths;
|
|
10
|
+
};
|
|
11
|
+
export const defaultGuidelineWidths = [...calculateGuidelineWidthsInDefaultLayoutWidth(), akEditorDefaultLayoutWidth, akEditorWideLayoutWidth, akEditorFullWidthLayoutWidth];
|
|
4
12
|
export const defaultGuidelines = createFixedGuidelinesFromLengths(defaultGuidelineWidths);
|
package/dist/es2019/version.json
CHANGED
|
@@ -6,10 +6,12 @@ import _get from "@babel/runtime/helpers/get";
|
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
10
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
15
|
import React from 'react';
|
|
14
16
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
15
17
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
@@ -30,15 +32,21 @@ var tableAttributes = function tableAttributes(node, options, state, pos) {
|
|
|
30
32
|
// this is to ensure 'responsive' tables (colgroup widths are undefined) become fixed to
|
|
31
33
|
// support screen size adjustments
|
|
32
34
|
var shouldHaveInlineWidth = (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && !isTableNested(state, pos);
|
|
33
|
-
var style =
|
|
34
|
-
|
|
35
|
+
var style = "width: ".concat(node.attrs.isNumberColumnEnabled ? getTableContainerWidth(node) - akEditorTableNumberColumnWidth : getTableContainerWidth(node), "px");
|
|
36
|
+
var dataAttrsInTable = {
|
|
35
37
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
36
38
|
'data-layout': node.attrs.layout,
|
|
37
39
|
'data-autosize': node.attrs.__autoSize,
|
|
38
40
|
'data-table-local-id': node.attrs.localId || '',
|
|
39
|
-
'data-table-width': node.attrs.width
|
|
40
|
-
style: style
|
|
41
|
+
'data-table-width': node.attrs.width
|
|
41
42
|
};
|
|
43
|
+
if (shouldHaveInlineWidth) {
|
|
44
|
+
// this should be fixed because style will overwrite any existing styles, current found conflict with sticky headers
|
|
45
|
+
return _objectSpread(_objectSpread({}, dataAttrsInTable), {}, {
|
|
46
|
+
style: style
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return dataAttrsInTable;
|
|
42
50
|
};
|
|
43
51
|
var toDOM = function toDOM(node, props) {
|
|
44
52
|
var colgroup = '';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
import { createFixedGuidelinesFromLengths } from '@atlaskit/editor-common/guideline';
|
|
2
3
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
|
|
4
|
+
var numberOfLanesInDefaultLayoutWidth = 12;
|
|
5
|
+
var calculateGuidelineWidthsInDefaultLayoutWidth = function calculateGuidelineWidthsInDefaultLayoutWidth() {
|
|
6
|
+
var widths = [];
|
|
7
|
+
for (var i = 0; i <= numberOfLanesInDefaultLayoutWidth / 2; i++) {
|
|
8
|
+
widths.push(akEditorDefaultLayoutWidth / numberOfLanesInDefaultLayoutWidth * i * 2);
|
|
9
|
+
}
|
|
10
|
+
return widths;
|
|
11
|
+
};
|
|
12
|
+
export var defaultGuidelineWidths = [].concat(_toConsumableArray(calculateGuidelineWidthsInDefaultLayoutWidth()), [akEditorDefaultLayoutWidth, akEditorWideLayoutWidth, akEditorFullWidthLayoutWidth]);
|
|
4
13
|
export var defaultGuidelines = createFixedGuidelinesFromLengths(defaultGuidelineWidths);
|
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { TableEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { GuidelineConfig } from '@atlaskit/editor-
|
|
3
|
+
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
4
4
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { TableEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { GuidelineConfig } from '@atlaskit/editor-
|
|
3
|
+
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
4
4
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.8",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^26.4.0",
|
|
31
|
-
"@atlaskit/editor-common": "^74.
|
|
31
|
+
"@atlaskit/editor-common": "^74.34.0",
|
|
32
32
|
"@atlaskit/editor-palette": "1.5.1",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
34
34
|
"@atlaskit/editor-plugin-content-insertion": "^0.0.7",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/icon": "^21.12.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
40
40
|
"@atlaskit/theme": "^12.5.0",
|
|
41
|
-
"@atlaskit/tokens": "^1.
|
|
41
|
+
"@atlaskit/tokens": "^1.14.0",
|
|
42
42
|
"@atlaskit/tooltip": "^17.8.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1",
|
|
@@ -8,10 +8,10 @@ import React, {
|
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
|
|
10
10
|
import { TableEventPayload } from '@atlaskit/editor-common/analytics';
|
|
11
|
+
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
11
12
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
12
13
|
import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
13
14
|
import { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
14
|
-
import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
|
|
15
15
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
16
16
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
17
17
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
TableEventPayload,
|
|
16
16
|
} from '@atlaskit/editor-common/analytics';
|
|
17
17
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
18
|
+
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
18
19
|
import {
|
|
19
20
|
HandleHeightSizeType,
|
|
20
21
|
HandleResize,
|
|
21
22
|
ResizerNext,
|
|
22
23
|
} from '@atlaskit/editor-common/resizer';
|
|
23
|
-
import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
|
|
24
24
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
25
25
|
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
26
26
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -48,22 +48,29 @@ const tableAttributes = (
|
|
|
48
48
|
const shouldHaveInlineWidth =
|
|
49
49
|
options?.isTableResizingEnabled && !isTableNested(state, pos);
|
|
50
50
|
|
|
51
|
-
let style =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return {
|
|
51
|
+
let style = `width: ${
|
|
52
|
+
node.attrs.isNumberColumnEnabled
|
|
53
|
+
? getTableContainerWidth(node) - akEditorTableNumberColumnWidth
|
|
54
|
+
: getTableContainerWidth(node)
|
|
55
|
+
}px`;
|
|
56
|
+
|
|
57
|
+
const dataAttrsInTable = {
|
|
60
58
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
61
59
|
'data-layout': node.attrs.layout,
|
|
62
60
|
'data-autosize': node.attrs.__autoSize,
|
|
63
61
|
'data-table-local-id': node.attrs.localId || '',
|
|
64
62
|
'data-table-width': node.attrs.width,
|
|
65
|
-
style,
|
|
66
63
|
};
|
|
64
|
+
|
|
65
|
+
if (shouldHaveInlineWidth) {
|
|
66
|
+
// this should be fixed because style will overwrite any existing styles, current found conflict with sticky headers
|
|
67
|
+
return {
|
|
68
|
+
...dataAttrsInTable,
|
|
69
|
+
style,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return dataAttrsInTable;
|
|
67
74
|
};
|
|
68
75
|
|
|
69
76
|
const toDOM = (node: PmNode, props: Props) => {
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { createFixedGuidelinesFromLengths } from '@atlaskit/editor-common/guideline';
|
|
2
|
-
import type { GuidelineConfig } from '@atlaskit/editor-
|
|
2
|
+
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
3
3
|
import {
|
|
4
4
|
akEditorDefaultLayoutWidth,
|
|
5
5
|
akEditorFullWidthLayoutWidth,
|
|
6
6
|
akEditorWideLayoutWidth,
|
|
7
7
|
} from '@atlaskit/editor-shared-styles';
|
|
8
8
|
|
|
9
|
+
const numberOfLanesInDefaultLayoutWidth = 12;
|
|
10
|
+
|
|
11
|
+
const calculateGuidelineWidthsInDefaultLayoutWidth = () => {
|
|
12
|
+
let widths: number[] = [];
|
|
13
|
+
for (let i = 0; i <= numberOfLanesInDefaultLayoutWidth / 2; i++) {
|
|
14
|
+
widths.push(
|
|
15
|
+
(akEditorDefaultLayoutWidth / numberOfLanesInDefaultLayoutWidth) * i * 2,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return widths;
|
|
19
|
+
};
|
|
20
|
+
|
|
9
21
|
export const defaultGuidelineWidths = [
|
|
22
|
+
...calculateGuidelineWidthsInDefaultLayoutWidth(),
|
|
10
23
|
akEditorDefaultLayoutWidth,
|
|
11
24
|
akEditorWideLayoutWidth,
|
|
12
25
|
akEditorFullWidthLayoutWidth,
|