@atlaskit/editor-plugin-table 2.6.6 → 2.6.7

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,11 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 2.6.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`56f4b88f7c2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56f4b88f7c2) - [ux] ED-19317: fix numbered column shifted up issue when sticky header
8
+
3
9
  ## 2.6.6
4
10
 
5
11
  ### 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 = shouldHaveInlineWidth ? "width: ".concat(node.attrs.isNumberColumnEnabled ? (0, _nodeWidth.getTableContainerWidth)(node) - _editorSharedStyles.akEditorTableNumberColumnWidth : (0, _nodeWidth.getTableContainerWidth)(node), "px") : undefined;
41
- return {
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,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
4
4
  "sideEffects": false
5
5
  }
@@ -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 = shouldHaveInlineWidth ? `width: ${node.attrs.isNumberColumnEnabled ? getTableContainerWidth(node) - akEditorTableNumberColumnWidth : getTableContainerWidth(node)}px` : undefined;
23
- return {
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,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
4
4
  "sideEffects": false
5
5
  }
@@ -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 = shouldHaveInlineWidth ? "width: ".concat(node.attrs.isNumberColumnEnabled ? getTableContainerWidth(node) - akEditorTableNumberColumnWidth : getTableContainerWidth(node), "px") : undefined;
34
- return {
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,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
4
4
  "sideEffects": false
5
5
  }
@@ -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-plugin-guideline';
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,3 +1,3 @@
1
- import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
1
+ import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  export declare const defaultGuidelineWidths: number[];
3
3
  export declare const defaultGuidelines: GuidelineConfig[];
@@ -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-plugin-guideline';
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,3 +1,3 @@
1
- import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
1
+ import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  export declare const defaultGuidelineWidths: number[];
3
3
  export declare const defaultGuidelines: GuidelineConfig[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
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.32.0",
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.13.0",
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 = shouldHaveInlineWidth
52
- ? `width: ${
53
- node.attrs.isNumberColumnEnabled
54
- ? getTableContainerWidth(node) - akEditorTableNumberColumnWidth
55
- : getTableContainerWidth(node)
56
- }px`
57
- : undefined;
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,5 +1,5 @@
1
1
  import { createFixedGuidelinesFromLengths } from '@atlaskit/editor-common/guideline';
2
- import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
2
+ import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
3
3
  import {
4
4
  akEditorDefaultLayoutWidth,
5
5
  akEditorFullWidthLayoutWidth,