@atlaskit/dynamic-table 15.2.0 → 16.0.0

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/dynamic-table
2
2
 
3
+ ## 16.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#150464](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150464)
8
+ [`b813bd74ede6d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b813bd74ede6d) -
9
+ Migrates usage of react-beautiful-dnd to pragmatic-dnd using the interop-layer from PDND. There
10
+ are no breaking changes however there may be minor behavioural and visual chagnes as a result
11
+ since the experiences are fundamentally different.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 15.2.0
4
18
 
5
19
  ### Minor Changes
@@ -14,7 +14,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
14
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  var _react = _interopRequireDefault(require("react"));
17
- var _reactBeautifulDnd = require("react-beautiful-dnd");
17
+ var _pragmaticDragAndDropReactBeautifulDndMigration = require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");
18
18
  var _withSortedPageRows = _interopRequireDefault(require("../../hoc/with-sorted-page-rows"));
19
19
  var _tableRow = _interopRequireDefault(require("./table-row"));
20
20
  function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
@@ -87,10 +87,10 @@ var RankableBody = exports.RankableBody = /*#__PURE__*/function (_React$Componen
87
87
  isRankingDisabled = _this$props2.isRankingDisabled,
88
88
  testId = _this$props2.testId,
89
89
  forwardedRef = _this$props2.forwardedRef;
90
- return /*#__PURE__*/_react.default.createElement(_reactBeautifulDnd.DragDropContext, {
90
+ return /*#__PURE__*/_react.default.createElement(_pragmaticDragAndDropReactBeautifulDndMigration.DragDropContext, {
91
91
  onBeforeDragStart: this.onBeforeDragStart,
92
92
  onDragEnd: this.onDragEnd
93
- }, /*#__PURE__*/_react.default.createElement(_reactBeautifulDnd.Droppable, {
93
+ }, /*#__PURE__*/_react.default.createElement(_pragmaticDragAndDropReactBeautifulDndMigration.Droppable, {
94
94
  droppableId: "dynamic-table-droppable",
95
95
  isDropDisabled: isRankingDisabled
96
96
  }, function (provided) {
@@ -114,7 +114,7 @@ var RankableBody = exports.RankableBody = /*#__PURE__*/function (_React$Componen
114
114
  row: row,
115
115
  isRankingDisabled: isRankingDisabled,
116
116
  isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
117
- testId: testId && "".concat(testId, "--rankable--table--row")
117
+ testId: testId && "".concat(testId, "--").concat(row.key, "--rankable--table--row")
118
118
  });
119
119
  }), provided.placeholder);
120
120
  }));
@@ -15,7 +15,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
15
15
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
17
  var _react = _interopRequireDefault(require("react"));
18
- var _reactBeautifulDnd = require("react-beautiful-dnd");
18
+ var _pragmaticDragAndDropReactBeautifulDndMigration = require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");
19
19
  var _withDimensions = _interopRequireDefault(require("../../hoc/with-dimensions"));
20
20
  var _helpers = require("../../internal/helpers");
21
21
  var _tableRow = require("../../styled/rankable/table-row");
@@ -69,7 +69,7 @@ var RankableTableRow = exports.RankableTableRow = /*#__PURE__*/function (_React$
69
69
  if (typeof key !== 'string' && !isRankingDisabled) {
70
70
  throw new Error('dynamic-table: ranking is not possible because table row does not have a key. Add the key to the row or disable ranking.');
71
71
  }
72
- return /*#__PURE__*/_react.default.createElement(_reactBeautifulDnd.Draggable, {
72
+ return /*#__PURE__*/_react.default.createElement(_pragmaticDragAndDropReactBeautifulDndMigration.Draggable, {
73
73
  draggableId: key || rowIndex.toString(),
74
74
  index: rowIndex,
75
75
  isDragDisabled: isRankingDisabled
@@ -86,14 +86,14 @@ var DynamicTable = function DynamicTable(_ref) {
86
86
  action: 'sorted',
87
87
  componentName: 'dynamicTable',
88
88
  packageName: "@atlaskit/dynamic-table",
89
- packageVersion: "15.2.0"
89
+ packageVersion: "16.0.0"
90
90
  });
91
91
  var onRankEnd = (0, _analyticsNext.usePlatformLeafEventHandler)({
92
92
  fn: providedOnRankEnd,
93
93
  action: 'ranked',
94
94
  componentName: 'dynamicTable',
95
95
  packageName: "@atlaskit/dynamic-table",
96
- packageVersion: "15.2.0"
96
+ packageVersion: "16.0.0"
97
97
  });
98
98
  (0, _react.useEffect)(function () {
99
99
  (0, _helpers.validateSortKey)(sortKey, head);
@@ -10,6 +10,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = require("react");
12
12
  var _react2 = require("@emotion/react");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  var _colors = require("@atlaskit/theme/colors");
14
15
  var _constants = require("../internal/constants");
15
16
  var _theme = require("../theme");
@@ -42,6 +43,20 @@ var Head = exports.Head = function Head(_ref) {
42
43
  }, props));
43
44
  };
44
45
  var headCellBaseStyles = (0, _react2.css)({
46
+ boxSizing: 'border-box',
47
+ position: 'relative',
48
+ border: 'none',
49
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
50
+ borderBlockEnd: "2px solid ".concat(_theme.tableBorder.borderColor),
51
+ color: "var(--ds-text-subtlest, ".concat("var(".concat(CSS_VAR_TEXT_COLOR, ")"), ")"),
52
+ font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
53
+ textAlign: 'left',
54
+ verticalAlign: 'top',
55
+ '&:focus-visible': {
56
+ outline: "solid 2px ".concat("var(--ds-border-focused, ".concat(_colors.B100, ")"))
57
+ }
58
+ });
59
+ var headCellBaseStylesModernized = (0, _react2.css)({
45
60
  boxSizing: 'border-box',
46
61
  position: 'relative',
47
62
  border: 'none',
@@ -182,7 +197,7 @@ var HeadCell = exports.HeadCell = /*#__PURE__*/(0, _react.forwardRef)(function (
182
197
  style: mergedStyles,
183
198
  css: [
184
199
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
185
- _constants2.cellStyles, headCellBaseStyles, onClick && onClickStyles,
200
+ _constants2.cellStyles, (0, _platformFeatureFlags.fg)('design_system_team_dynamic_table_typography') ? headCellBaseStylesModernized : headCellBaseStyles, onClick && onClickStyles,
186
201
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
187
202
  _constants2.truncationWidthStyles,
188
203
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -4,7 +4,7 @@ import React from 'react';
4
4
 
5
5
  // Allowing existing usage of non Pragmatic drag and drop solution
6
6
  // eslint-disable-next-line @atlaskit/design-system/no-unsupported-drag-and-drop-libraries
7
- import { DragDropContext, Droppable } from 'react-beautiful-dnd';
7
+ import { DragDropContext, Droppable } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';
8
8
  import withSortedPageRows from '../../hoc/with-sorted-page-rows';
9
9
  import TableRow from './table-row';
10
10
  // computes destination of ranking
@@ -105,7 +105,7 @@ export class RankableBody extends React.Component {
105
105
  row: row,
106
106
  isRankingDisabled: isRankingDisabled,
107
107
  isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
108
- testId: testId && `${testId}--rankable--table--row`
108
+ testId: testId && `${testId}--${row.key}--rankable--table--row`
109
109
  })), provided.placeholder)));
110
110
  }
111
111
  }
@@ -4,7 +4,7 @@ import React from 'react';
4
4
 
5
5
  // Allowing existing usage of non Pragmatic drag and drop solution
6
6
  // eslint-disable-next-line @atlaskit/design-system/no-unsupported-drag-and-drop-libraries
7
- import { Draggable } from 'react-beautiful-dnd';
7
+ import { Draggable } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';
8
8
  import withDimensions from '../../hoc/with-dimensions';
9
9
  import { inlineStylesIfRanking } from '../../internal/helpers';
10
10
  import { RankableTableBodyRow } from '../../styled/rankable/table-row';
@@ -60,14 +60,14 @@ const DynamicTable = ({
60
60
  action: 'sorted',
61
61
  componentName: 'dynamicTable',
62
62
  packageName: "@atlaskit/dynamic-table",
63
- packageVersion: "15.2.0"
63
+ packageVersion: "16.0.0"
64
64
  });
65
65
  const onRankEnd = usePlatformLeafEventHandler({
66
66
  fn: providedOnRankEnd,
67
67
  action: 'ranked',
68
68
  componentName: 'dynamicTable',
69
69
  packageName: "@atlaskit/dynamic-table",
70
- packageVersion: "15.2.0"
70
+ packageVersion: "16.0.0"
71
71
  });
72
72
  useEffect(() => {
73
73
  validateSortKey(sortKey, head);
@@ -8,6 +8,7 @@ import { forwardRef } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { B100, N30A } from '@atlaskit/theme/colors';
12
13
  import { ASC, DESC } from '../internal/constants';
13
14
  import { arrow, head, MSThemeColors, tableBorder } from '../theme';
@@ -31,6 +32,20 @@ export const Head = ({
31
32
  }, props));
32
33
  };
33
34
  const headCellBaseStyles = css({
35
+ boxSizing: 'border-box',
36
+ position: 'relative',
37
+ border: 'none',
38
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
39
+ borderBlockEnd: `2px solid ${tableBorder.borderColor}`,
40
+ color: `var(--ds-text-subtlest, ${`var(${CSS_VAR_TEXT_COLOR})`})`,
41
+ font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
42
+ textAlign: 'left',
43
+ verticalAlign: 'top',
44
+ '&:focus-visible': {
45
+ outline: `solid 2px ${`var(--ds-border-focused, ${B100})`}`
46
+ }
47
+ });
48
+ const headCellBaseStylesModernized = css({
34
49
  boxSizing: 'border-box',
35
50
  position: 'relative',
36
51
  border: 'none',
@@ -176,7 +191,7 @@ export const HeadCell = /*#__PURE__*/forwardRef(({
176
191
  style: mergedStyles,
177
192
  css: [
178
193
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
179
- cellStyles, headCellBaseStyles, onClick && onClickStyles,
194
+ cellStyles, fg('design_system_team_dynamic_table_typography') ? headCellBaseStylesModernized : headCellBaseStyles, onClick && onClickStyles,
180
195
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
181
196
  truncationWidthStyles,
182
197
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -12,7 +12,7 @@ import React from 'react';
12
12
 
13
13
  // Allowing existing usage of non Pragmatic drag and drop solution
14
14
  // eslint-disable-next-line @atlaskit/design-system/no-unsupported-drag-and-drop-libraries
15
- import { DragDropContext, Droppable } from 'react-beautiful-dnd';
15
+ import { DragDropContext, Droppable } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';
16
16
  import withSortedPageRows from '../../hoc/with-sorted-page-rows';
17
17
  import TableRow from './table-row';
18
18
  // computes destination of ranking
@@ -109,7 +109,7 @@ export var RankableBody = /*#__PURE__*/function (_React$Component) {
109
109
  row: row,
110
110
  isRankingDisabled: isRankingDisabled,
111
111
  isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
112
- testId: testId && "".concat(testId, "--rankable--table--row")
112
+ testId: testId && "".concat(testId, "--").concat(row.key, "--rankable--table--row")
113
113
  });
114
114
  }), provided.placeholder);
115
115
  }));
@@ -16,7 +16,7 @@ import React from 'react';
16
16
 
17
17
  // Allowing existing usage of non Pragmatic drag and drop solution
18
18
  // eslint-disable-next-line @atlaskit/design-system/no-unsupported-drag-and-drop-libraries
19
- import { Draggable } from 'react-beautiful-dnd';
19
+ import { Draggable } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';
20
20
  import withDimensions from '../../hoc/with-dimensions';
21
21
  import { inlineStylesIfRanking } from '../../internal/helpers';
22
22
  import { RankableTableBodyRow } from '../../styled/rankable/table-row';
@@ -76,14 +76,14 @@ var DynamicTable = function DynamicTable(_ref) {
76
76
  action: 'sorted',
77
77
  componentName: 'dynamicTable',
78
78
  packageName: "@atlaskit/dynamic-table",
79
- packageVersion: "15.2.0"
79
+ packageVersion: "16.0.0"
80
80
  });
81
81
  var onRankEnd = usePlatformLeafEventHandler({
82
82
  fn: providedOnRankEnd,
83
83
  action: 'ranked',
84
84
  componentName: 'dynamicTable',
85
85
  packageName: "@atlaskit/dynamic-table",
86
- packageVersion: "15.2.0"
86
+ packageVersion: "16.0.0"
87
87
  });
88
88
  useEffect(function () {
89
89
  validateSortKey(sortKey, head);
@@ -14,6 +14,7 @@ import { forwardRef } from 'react';
14
14
 
15
15
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
16
16
  import { css, jsx } from '@emotion/react';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
17
18
  import { B100, N30A } from '@atlaskit/theme/colors';
18
19
  import { ASC, DESC } from '../internal/constants';
19
20
  import { arrow, head, MSThemeColors, tableBorder } from '../theme';
@@ -36,6 +37,20 @@ export var Head = function Head(_ref) {
36
37
  }, props));
37
38
  };
38
39
  var headCellBaseStyles = css({
40
+ boxSizing: 'border-box',
41
+ position: 'relative',
42
+ border: 'none',
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
44
+ borderBlockEnd: "2px solid ".concat(tableBorder.borderColor),
45
+ color: "var(--ds-text-subtlest, ".concat("var(".concat(CSS_VAR_TEXT_COLOR, ")"), ")"),
46
+ font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
47
+ textAlign: 'left',
48
+ verticalAlign: 'top',
49
+ '&:focus-visible': {
50
+ outline: "solid 2px ".concat("var(--ds-border-focused, ".concat(B100, ")"))
51
+ }
52
+ });
53
+ var headCellBaseStylesModernized = css({
39
54
  boxSizing: 'border-box',
40
55
  position: 'relative',
41
56
  border: 'none',
@@ -176,7 +191,7 @@ export var HeadCell = /*#__PURE__*/forwardRef(function (_ref2, ref) {
176
191
  style: mergedStyles,
177
192
  css: [
178
193
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
179
- cellStyles, headCellBaseStyles, onClick && onClickStyles,
194
+ cellStyles, fg('design_system_team_dynamic_table_typography') ? headCellBaseStylesModernized : headCellBaseStyles, onClick && onClickStyles,
180
195
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
181
196
  truncationWidthStyles,
182
197
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type DragStart, type DropResult } from 'react-beautiful-dnd';
2
+ import { type DragStart, type DropResult } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';
3
3
  import { type WithSortedPageRowsProps } from '../../hoc/with-sorted-page-rows';
4
4
  import { type HeadType, type RankEnd, type RankStart } from '../../types';
5
5
  export interface RankableBodyProps extends WithSortedPageRowsProps {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type DragStart, type DropResult } from 'react-beautiful-dnd';
2
+ import { type DragStart, type DropResult } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';
3
3
  import { type WithSortedPageRowsProps } from '../../hoc/with-sorted-page-rows';
4
4
  import { type HeadType, type RankEnd, type RankStart } from '../../types';
5
5
  export interface RankableBodyProps extends WithSortedPageRowsProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "15.2.0",
3
+ "version": "16.0.0",
4
4
  "description": "A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,8 +38,10 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@atlaskit/analytics-next": "^10.1.0",
41
- "@atlaskit/ds-lib": "^3.0.0",
41
+ "@atlaskit/ds-lib": "^3.1.0",
42
42
  "@atlaskit/pagination": "^14.9.0",
43
+ "@atlaskit/platform-feature-flags": "^0.3.0",
44
+ "@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration": "^1.2.1",
43
45
  "@atlaskit/spinner": "^16.3.0",
44
46
  "@atlaskit/theme": "^13.0.0",
45
47
  "@atlaskit/tokens": "^2.0.0",
@@ -81,5 +83,10 @@
81
83
  "emotion"
82
84
  ]
83
85
  }
86
+ },
87
+ "platform-feature-flags": {
88
+ "design_system_team_dynamic_table_typography": {
89
+ "type": "boolean"
90
+ }
84
91
  }
85
92
  }