@atlaskit/media-table 13.0.2 → 14.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/component/mediaTable.js +40 -17
  3. package/dist/cjs/component/previewButton.js +68 -0
  4. package/dist/cjs/component/styles.js +1 -1
  5. package/dist/cjs/util/constants.js +3 -1
  6. package/dist/cjs/util/generateHeadValues.js +1 -1
  7. package/dist/cjs/util/index.js +6 -0
  8. package/dist/cjs/version.json +1 -1
  9. package/dist/es2019/component/mediaTable.js +32 -12
  10. package/dist/es2019/component/previewButton.js +44 -0
  11. package/dist/es2019/component/styles.js +2 -1
  12. package/dist/es2019/util/constants.js +1 -0
  13. package/dist/es2019/util/generateHeadValues.js +2 -2
  14. package/dist/es2019/util/index.js +1 -1
  15. package/dist/es2019/version.json +1 -1
  16. package/dist/esm/component/mediaTable.js +41 -18
  17. package/dist/esm/component/previewButton.js +53 -0
  18. package/dist/esm/component/styles.js +1 -1
  19. package/dist/esm/util/constants.js +1 -0
  20. package/dist/esm/util/generateHeadValues.js +2 -2
  21. package/dist/esm/util/index.js +1 -1
  22. package/dist/esm/version.json +1 -1
  23. package/dist/types/component/mediaTable.d.ts +1 -0
  24. package/dist/types/component/previewButton.d.ts +9 -0
  25. package/dist/types/types.d.ts +4 -0
  26. package/dist/types/util/constants.d.ts +1 -0
  27. package/dist/types/util/index.d.ts +1 -1
  28. package/dist/types-ts4.0/component/mediaTable.d.ts +1 -0
  29. package/dist/types-ts4.0/component/previewButton.d.ts +9 -0
  30. package/dist/types-ts4.0/types.d.ts +4 -0
  31. package/dist/types-ts4.0/util/constants.d.ts +1 -0
  32. package/dist/types-ts4.0/util/index.d.ts +1 -1
  33. package/package.json +8 -10
  34. package/report.api.md +8 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/media-table
2
2
 
3
+ ## 14.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`64a9be7d742`](https://bitbucket.org/atlassian/atlassian-frontend/commits/64a9be7d742) - [ux] Add a preconfiguration for columns with the key 'preview' to display a media preview button
8
+
9
+ ### Minor Changes
10
+
11
+ - [`692477d9854`](https://bitbucket.org/atlassian/atlassian-frontend/commits/692477d9854) - [ux] Adds row selection & row highlighting to media table component
12
+
13
+ ### Patch Changes
14
+
15
+ - [`153829bfcb3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/153829bfcb3) - Upgrade caching algorithm library lru-fast to lru_map.
16
+ - Updated dependencies
17
+
3
18
  ## 13.0.2
4
19
 
5
20
  ### Patch Changes
@@ -45,6 +45,8 @@ var _styles = require("./styles");
45
45
 
46
46
  var _downloadButton = _interopRequireDefault(require("./downloadButton"));
47
47
 
48
+ var _previewButton = _interopRequireDefault(require("./previewButton"));
49
+
48
50
  var _util = require("../util");
49
51
 
50
52
  var _analyticsNext = require("@atlaskit/analytics-next");
@@ -94,6 +96,8 @@ var MediaTable = /*#__PURE__*/function (_Component) {
94
96
  columns.cells.forEach(function (cell) {
95
97
  var content = cell.key === _util.CELL_KEY_DOWNLOAD ? (0, _react.jsx)(_downloadButton.default, {
96
98
  onClick: _this.onDownloadClick(identifier)
99
+ }) : cell.key === _util.CELL_KEY_PREVIEW ? (0, _react.jsx)(_previewButton.default, {
100
+ onClick: _this.onPreviewClick(identifier)
97
101
  }) : cell.key && data[cell.key] || '';
98
102
  cellValues.push({
99
103
  key: cell.key,
@@ -113,6 +117,13 @@ var MediaTable = /*#__PURE__*/function (_Component) {
113
117
  mediaClient.file.downloadBinary(id, nameInfo ? nameInfo.fileName : '', collectionName);
114
118
  };
115
119
  });
120
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onPreviewClick", function (identifier) {
121
+ return function (event) {
122
+ event.stopPropagation();
123
+
124
+ _this.openPreview(identifier);
125
+ };
126
+ });
116
127
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSort", function (data) {
117
128
  var onSort = _this.props.onSort;
118
129
  var key = data.key,
@@ -124,7 +135,7 @@ var MediaTable = /*#__PURE__*/function (_Component) {
124
135
  var _this$props = _this.props,
125
136
  items = _this$props.items,
126
137
  columns = _this$props.columns;
127
- var rowValues = items.map(function (item) {
138
+ var rowValues = items.map(function (item, index) {
128
139
  var data = item.data,
129
140
  identifier = item.identifier,
130
141
  rowProps = item.rowProps;
@@ -132,10 +143,10 @@ var MediaTable = /*#__PURE__*/function (_Component) {
132
143
  cells: _this.generateCellValues(data, identifier),
133
144
  key: identifier.id,
134
145
  tabIndex: 0,
135
- onClick: _this.onRowClick(identifier),
146
+ onClick: _this.onRowClick(identifier, data, index),
136
147
  onKeyPress: function onKeyPress(event) {
137
148
  if (event.key === 'Enter') {
138
- _this.onRowEnterKeyPressed(identifier);
149
+ _this.onRowEnterKeyPressed(identifier, data, index);
139
150
  }
140
151
  }
141
152
  }, rowProps);
@@ -158,7 +169,8 @@ var MediaTable = /*#__PURE__*/function (_Component) {
158
169
  totalItems = _this$props2.totalItems,
159
170
  items = _this$props2.items,
160
171
  sortKey = _this$props2.sortKey,
161
- sortOrder = _this$props2.sortOrder;
172
+ sortOrder = _this$props2.sortOrder,
173
+ highlightedRowIndex = _this$props2.highlightedRowIndex;
162
174
 
163
175
  var _getValidTableProps = (0, _util.getValidTableProps)(items.length, itemsPerPage, pageNumber, totalItems),
164
176
  validItemsPerPage = _getValidTableProps.validItemsPerPage,
@@ -178,7 +190,8 @@ var MediaTable = /*#__PURE__*/function (_Component) {
178
190
  sortOrder: sortOrder,
179
191
  onSort: _this.onSort,
180
192
  onSetPage: onSetPage,
181
- isFixedSize: true
193
+ isFixedSize: true,
194
+ highlightedRowIndex: highlightedRowIndex
182
195
  });
183
196
  });
184
197
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openPreview", function (identifier) {
@@ -190,8 +203,10 @@ var MediaTable = /*#__PURE__*/function (_Component) {
190
203
 
191
204
  onPreviewOpen && onPreviewOpen();
192
205
  });
193
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRowEnterKeyPressed", function (identifier) {
194
- var createAnalyticsEvent = _this.props.createAnalyticsEvent;
206
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRowEnterKeyPressed", function (identifier, data, index) {
207
+ var _this$props3 = _this.props,
208
+ createAnalyticsEvent = _this$props3.createAnalyticsEvent,
209
+ onRowClick = _this$props3.onRowClick;
195
210
  var ev = createAnalyticsEvent({
196
211
  eventType: 'ui',
197
212
  action: 'keyPressed',
@@ -199,12 +214,17 @@ var MediaTable = /*#__PURE__*/function (_Component) {
199
214
  actionSubjectId: 'mediaFileRow'
200
215
  });
201
216
  ev.fire(_util.ANALYTICS_MEDIA_CHANNEL);
217
+ var shouldPreventDefaultRowClick = onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(data, index);
202
218
 
203
- _this.openPreview(identifier);
219
+ if (!shouldPreventDefaultRowClick) {
220
+ _this.openPreview(identifier);
221
+ }
204
222
  });
205
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRowClick", function (identifier) {
223
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRowClick", function (identifier, data, index) {
206
224
  return function () {
207
- var createAnalyticsEvent = _this.props.createAnalyticsEvent;
225
+ var _this$props4 = _this.props,
226
+ createAnalyticsEvent = _this$props4.createAnalyticsEvent,
227
+ onRowClick = _this$props4.onRowClick;
208
228
  var ev = createAnalyticsEvent({
209
229
  eventType: 'ui',
210
230
  action: 'clicked',
@@ -212,8 +232,11 @@ var MediaTable = /*#__PURE__*/function (_Component) {
212
232
  actionSubjectId: 'mediaFileRow'
213
233
  });
214
234
  ev.fire(_util.ANALYTICS_MEDIA_CHANNEL);
235
+ var shouldPreventDefaultRowClick = onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(data, index);
215
236
 
216
- _this.openPreview(identifier);
237
+ if (!shouldPreventDefaultRowClick) {
238
+ _this.openPreview(identifier);
239
+ }
217
240
  };
218
241
  });
219
242
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "safeSetState", function (state) {
@@ -232,9 +255,9 @@ var MediaTable = /*#__PURE__*/function (_Component) {
232
255
  });
233
256
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderMediaViewer", function () {
234
257
  var mediaViewerSelectedItem = _this.state.mediaViewerSelectedItem;
235
- var _this$props3 = _this.props,
236
- mediaClient = _this$props3.mediaClient,
237
- items = _this$props3.items;
258
+ var _this$props5 = _this.props,
259
+ mediaClient = _this$props5.mediaClient,
260
+ items = _this$props5.items;
238
261
 
239
262
  if (!mediaViewerSelectedItem) {
240
263
  return null;
@@ -263,9 +286,9 @@ var MediaTable = /*#__PURE__*/function (_Component) {
263
286
  var _this2 = this;
264
287
 
265
288
  this.hasBeenMounted = true;
266
- var _this$props4 = this.props,
267
- items = _this$props4.items,
268
- mediaClient = _this$props4.mediaClient;
289
+ var _this$props6 = this.props,
290
+ items = _this$props6.items,
291
+ mediaClient = _this$props6.mediaClient;
269
292
  items.forEach( /*#__PURE__*/function () {
270
293
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(item) {
271
294
  var _item$identifier, id, _item$identifier$coll, collectionName, subscription;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _reactIntlNext = require("react-intl-next");
15
+
16
+ var _colors = require("@atlaskit/theme/colors");
17
+
18
+ var _filePreview = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/file-preview"));
19
+
20
+ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
21
+
22
+ var _mediaUi = require("@atlaskit/media-ui");
23
+
24
+ var _util = require("../util");
25
+
26
+ 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; }
27
+
28
+ 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; }
29
+
30
+ var MediaPreviewButton = function MediaPreviewButton(props) {
31
+ var _onClick = props.onClick,
32
+ formatMessage = props.intl.formatMessage;
33
+ return /*#__PURE__*/_react.default.createElement(_customThemeButton.default, {
34
+ appearance: "subtle",
35
+ testId: "preview-button",
36
+ iconAfter: /*#__PURE__*/_react.default.createElement(_filePreview.default, {
37
+ label: formatMessage(_mediaUi.messages.preview)
38
+ }),
39
+ onKeyPress: function onKeyPress(event) {
40
+ return event.stopPropagation();
41
+ },
42
+ onClick: function onClick(event, analyticsEvent) {
43
+ analyticsEvent.update(function (payload) {
44
+ return _objectSpread(_objectSpread({}, payload), {}, {
45
+ eventType: 'ui',
46
+ actionSubjectId: 'mediaTablePreview'
47
+ });
48
+ }).fire(_util.ANALYTICS_MEDIA_CHANNEL);
49
+
50
+ _onClick(event);
51
+ },
52
+ theme: function theme(current, themeProps) {
53
+ return {
54
+ buttonStyles: _objectSpread(_objectSpread({}, current(themeProps).buttonStyles), {}, {
55
+ minWidth: 'max-content',
56
+ '&:hover': {
57
+ background: _colors.N40
58
+ }
59
+ }),
60
+ spinnerStyles: current(themeProps).spinnerStyles
61
+ };
62
+ }
63
+ });
64
+ };
65
+
66
+ var _default = (0, _reactIntlNext.injectIntl)(MediaPreviewButton);
67
+
68
+ exports.default = _default;
@@ -19,5 +19,5 @@ var nameCellWrapperStyles = (0, _react.css)(_templateObject || (_templateObject
19
19
  exports.nameCellWrapperStyles = nameCellWrapperStyles;
20
20
  var truncateWrapperStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n min-width: 0;\n width: 100%;\n margin-left: 4px;\n\n span:first-of-type {\n &::first-letter {\n text-transform: capitalize;\n }\n }\n"])));
21
21
  exports.truncateWrapperStyles = truncateWrapperStyles;
22
- var mediaTableWrapperStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n tr {\n cursor: pointer;\n\n &:hover {\n background: ", ";\n }\n\n td:empty {\n padding: 0;\n }\n }\n"])), _colors.N20);
22
+ var mediaTableWrapperStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n tr {\n cursor: pointer;\n\n &:hover,\n &:focus {\n background: ", ";\n }\n\n td:empty {\n padding: 0;\n }\n }\n"])), _colors.N20);
23
23
  exports.mediaTableWrapperStyles = mediaTableWrapperStyles;
@@ -3,8 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.CELL_KEY_DOWNLOAD = exports.ANALYTICS_MEDIA_CHANNEL = void 0;
6
+ exports.CELL_KEY_PREVIEW = exports.CELL_KEY_DOWNLOAD = exports.ANALYTICS_MEDIA_CHANNEL = void 0;
7
7
  var CELL_KEY_DOWNLOAD = 'download';
8
8
  exports.CELL_KEY_DOWNLOAD = CELL_KEY_DOWNLOAD;
9
+ var CELL_KEY_PREVIEW = 'preview';
10
+ exports.CELL_KEY_PREVIEW = CELL_KEY_PREVIEW;
9
11
  var ANALYTICS_MEDIA_CHANNEL = 'media';
10
12
  exports.ANALYTICS_MEDIA_CHANNEL = ANALYTICS_MEDIA_CHANNEL;
@@ -20,7 +20,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
20
20
  var generateHeadValues = (0, _memoizeOne.default)(function (columns) {
21
21
  return {
22
22
  cells: columns.cells.map(function (cell) {
23
- return cell.key === _constants.CELL_KEY_DOWNLOAD ? _objectSpread({
23
+ return cell.key === _constants.CELL_KEY_DOWNLOAD || cell.key === _constants.CELL_KEY_PREVIEW ? _objectSpread({
24
24
  style: {
25
25
  width: '48px'
26
26
  }
@@ -17,6 +17,12 @@ Object.defineProperty(exports, "CELL_KEY_DOWNLOAD", {
17
17
  return _constants.CELL_KEY_DOWNLOAD;
18
18
  }
19
19
  });
20
+ Object.defineProperty(exports, "CELL_KEY_PREVIEW", {
21
+ enumerable: true,
22
+ get: function get() {
23
+ return _constants.CELL_KEY_PREVIEW;
24
+ }
25
+ });
20
26
  Object.defineProperty(exports, "generateHeadValues", {
21
27
  enumerable: true,
22
28
  get: function get() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-table",
3
- "version": "13.0.2",
3
+ "version": "14.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -11,7 +11,8 @@ import { isFileIdentifier, withMediaClient, isProcessedFileState } from '@atlask
11
11
  import { MediaViewer } from '@atlaskit/media-viewer';
12
12
  import { mediaTableWrapperStyles } from './styles';
13
13
  import DownloadButton from './downloadButton';
14
- import { generateRowValues, getValidTableProps, generateHeadValues, CELL_KEY_DOWNLOAD, ANALYTICS_MEDIA_CHANNEL } from '../util';
14
+ import PreviewButton from './previewButton';
15
+ import { generateRowValues, getValidTableProps, generateHeadValues, CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW, ANALYTICS_MEDIA_CHANNEL } from '../util';
15
16
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
16
17
  export class MediaTable extends Component {
17
18
  constructor(...args) {
@@ -38,6 +39,8 @@ export class MediaTable extends Component {
38
39
  columns.cells.forEach(cell => {
39
40
  const content = cell.key === CELL_KEY_DOWNLOAD ? jsx(DownloadButton, {
40
41
  onClick: this.onDownloadClick(identifier)
42
+ }) : cell.key === CELL_KEY_PREVIEW ? jsx(PreviewButton, {
43
+ onClick: this.onPreviewClick(identifier)
41
44
  }) : cell.key && data[cell.key] || '';
42
45
  cellValues.push({
43
46
  key: cell.key,
@@ -63,6 +66,11 @@ export class MediaTable extends Component {
63
66
  mediaClient.file.downloadBinary(id, nameInfo ? nameInfo.fileName : '', collectionName);
64
67
  });
65
68
 
69
+ _defineProperty(this, "onPreviewClick", identifier => event => {
70
+ event.stopPropagation();
71
+ this.openPreview(identifier);
72
+ });
73
+
66
74
  _defineProperty(this, "onSort", data => {
67
75
  const {
68
76
  onSort
@@ -80,7 +88,7 @@ export class MediaTable extends Component {
80
88
  items,
81
89
  columns
82
90
  } = this.props;
83
- const rowValues = items.map(item => {
91
+ const rowValues = items.map((item, index) => {
84
92
  const {
85
93
  data,
86
94
  identifier,
@@ -90,10 +98,10 @@ export class MediaTable extends Component {
90
98
  cells: this.generateCellValues(data, identifier),
91
99
  key: identifier.id,
92
100
  tabIndex: 0,
93
- onClick: this.onRowClick(identifier),
101
+ onClick: this.onRowClick(identifier, data, index),
94
102
  onKeyPress: event => {
95
103
  if (event.key === 'Enter') {
96
- this.onRowEnterKeyPressed(identifier);
104
+ this.onRowEnterKeyPressed(identifier, data, index);
97
105
  }
98
106
  },
99
107
  ...rowProps
@@ -118,7 +126,8 @@ export class MediaTable extends Component {
118
126
  totalItems,
119
127
  items,
120
128
  sortKey,
121
- sortOrder
129
+ sortOrder,
130
+ highlightedRowIndex
122
131
  } = this.props;
123
132
  const {
124
133
  validItemsPerPage,
@@ -138,7 +147,8 @@ export class MediaTable extends Component {
138
147
  sortOrder: sortOrder,
139
148
  onSort: this.onSort,
140
149
  onSetPage: onSetPage,
141
- isFixedSize: true
150
+ isFixedSize: true,
151
+ highlightedRowIndex: highlightedRowIndex
142
152
  });
143
153
  });
144
154
 
@@ -152,9 +162,10 @@ export class MediaTable extends Component {
152
162
  onPreviewOpen && onPreviewOpen();
153
163
  });
154
164
 
155
- _defineProperty(this, "onRowEnterKeyPressed", identifier => {
165
+ _defineProperty(this, "onRowEnterKeyPressed", (identifier, data, index) => {
156
166
  const {
157
- createAnalyticsEvent
167
+ createAnalyticsEvent,
168
+ onRowClick
158
169
  } = this.props;
159
170
  const ev = createAnalyticsEvent({
160
171
  eventType: 'ui',
@@ -163,12 +174,17 @@ export class MediaTable extends Component {
163
174
  actionSubjectId: 'mediaFileRow'
164
175
  });
165
176
  ev.fire(ANALYTICS_MEDIA_CHANNEL);
166
- this.openPreview(identifier);
177
+ const shouldPreventDefaultRowClick = onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(data, index);
178
+
179
+ if (!shouldPreventDefaultRowClick) {
180
+ this.openPreview(identifier);
181
+ }
167
182
  });
168
183
 
169
- _defineProperty(this, "onRowClick", identifier => () => {
184
+ _defineProperty(this, "onRowClick", (identifier, data, index) => () => {
170
185
  const {
171
- createAnalyticsEvent
186
+ createAnalyticsEvent,
187
+ onRowClick
172
188
  } = this.props;
173
189
  const ev = createAnalyticsEvent({
174
190
  eventType: 'ui',
@@ -177,7 +193,11 @@ export class MediaTable extends Component {
177
193
  actionSubjectId: 'mediaFileRow'
178
194
  });
179
195
  ev.fire(ANALYTICS_MEDIA_CHANNEL);
180
- this.openPreview(identifier);
196
+ const shouldPreventDefaultRowClick = onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(data, index);
197
+
198
+ if (!shouldPreventDefaultRowClick) {
199
+ this.openPreview(identifier);
200
+ }
181
201
  });
182
202
 
183
203
  _defineProperty(this, "safeSetState", state => {
@@ -0,0 +1,44 @@
1
+ import React from 'react'; // eslint-disable-next-line import/no-extraneous-dependencies
2
+
3
+ import { injectIntl } from 'react-intl-next';
4
+ import { N40 } from '@atlaskit/theme/colors';
5
+ import EditorFilePreviewIcon from '@atlaskit/icon/glyph/editor/file-preview';
6
+ import Button from '@atlaskit/button/custom-theme-button';
7
+ import { messages } from '@atlaskit/media-ui'; // eslint-disable-next-line import/no-extraneous-dependencies
8
+
9
+ import { ANALYTICS_MEDIA_CHANNEL } from '../util';
10
+
11
+ const MediaPreviewButton = props => {
12
+ const {
13
+ onClick,
14
+ intl: {
15
+ formatMessage
16
+ }
17
+ } = props;
18
+ return /*#__PURE__*/React.createElement(Button, {
19
+ appearance: "subtle",
20
+ testId: "preview-button",
21
+ iconAfter: /*#__PURE__*/React.createElement(EditorFilePreviewIcon, {
22
+ label: formatMessage(messages.preview)
23
+ }),
24
+ onKeyPress: event => event.stopPropagation(),
25
+ onClick: (event, analyticsEvent) => {
26
+ analyticsEvent.update(payload => ({ ...payload,
27
+ eventType: 'ui',
28
+ actionSubjectId: 'mediaTablePreview'
29
+ })).fire(ANALYTICS_MEDIA_CHANNEL);
30
+ onClick(event);
31
+ },
32
+ theme: (current, themeProps) => ({
33
+ buttonStyles: { ...current(themeProps).buttonStyles,
34
+ minWidth: 'max-content',
35
+ '&:hover': {
36
+ background: N40
37
+ }
38
+ },
39
+ spinnerStyles: current(themeProps).spinnerStyles
40
+ })
41
+ });
42
+ };
43
+
44
+ export default injectIntl(MediaPreviewButton);
@@ -20,7 +20,8 @@ export const mediaTableWrapperStyles = css`
20
20
  tr {
21
21
  cursor: pointer;
22
22
 
23
- &:hover {
23
+ &:hover,
24
+ &:focus {
24
25
  background: ${N20};
25
26
  }
26
27
 
@@ -1,2 +1,3 @@
1
1
  export const CELL_KEY_DOWNLOAD = 'download';
2
+ export const CELL_KEY_PREVIEW = 'preview';
2
3
  export const ANALYTICS_MEDIA_CHANNEL = 'media';
@@ -1,7 +1,7 @@
1
1
  import memoizeOne from 'memoize-one';
2
- import { CELL_KEY_DOWNLOAD } from './constants';
2
+ import { CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW } from './constants';
3
3
  const generateHeadValues = memoizeOne(columns => ({
4
- cells: columns.cells.map(cell => cell.key === CELL_KEY_DOWNLOAD ? {
4
+ cells: columns.cells.map(cell => cell.key === CELL_KEY_DOWNLOAD || cell.key === CELL_KEY_PREVIEW ? {
5
5
  style: {
6
6
  width: '48px'
7
7
  },
@@ -1,4 +1,4 @@
1
1
  export { default as generateRowValues } from './generateRowValues';
2
2
  export { default as getValidTableProps } from './getValidTableProps';
3
3
  export { default as generateHeadValues } from './generateHeadValues';
4
- export { CELL_KEY_DOWNLOAD, ANALYTICS_MEDIA_CHANNEL } from './constants';
4
+ export { CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW, ANALYTICS_MEDIA_CHANNEL } from './constants';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-table",
3
- "version": "13.0.2",
3
+ "version": "14.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -27,7 +27,8 @@ import { isFileIdentifier, withMediaClient, isProcessedFileState } from '@atlask
27
27
  import { MediaViewer } from '@atlaskit/media-viewer';
28
28
  import { mediaTableWrapperStyles } from './styles';
29
29
  import DownloadButton from './downloadButton';
30
- import { generateRowValues, getValidTableProps, generateHeadValues, CELL_KEY_DOWNLOAD, ANALYTICS_MEDIA_CHANNEL } from '../util';
30
+ import PreviewButton from './previewButton';
31
+ import { generateRowValues, getValidTableProps, generateHeadValues, CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW, ANALYTICS_MEDIA_CHANNEL } from '../util';
31
32
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
32
33
  export var MediaTable = /*#__PURE__*/function (_Component) {
33
34
  _inherits(MediaTable, _Component);
@@ -67,6 +68,8 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
67
68
  columns.cells.forEach(function (cell) {
68
69
  var content = cell.key === CELL_KEY_DOWNLOAD ? jsx(DownloadButton, {
69
70
  onClick: _this.onDownloadClick(identifier)
71
+ }) : cell.key === CELL_KEY_PREVIEW ? jsx(PreviewButton, {
72
+ onClick: _this.onPreviewClick(identifier)
70
73
  }) : cell.key && data[cell.key] || '';
71
74
  cellValues.push({
72
75
  key: cell.key,
@@ -88,6 +91,14 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
88
91
  };
89
92
  });
90
93
 
94
+ _defineProperty(_assertThisInitialized(_this), "onPreviewClick", function (identifier) {
95
+ return function (event) {
96
+ event.stopPropagation();
97
+
98
+ _this.openPreview(identifier);
99
+ };
100
+ });
101
+
91
102
  _defineProperty(_assertThisInitialized(_this), "onSort", function (data) {
92
103
  var onSort = _this.props.onSort;
93
104
  var key = data.key,
@@ -100,7 +111,7 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
100
111
  var _this$props = _this.props,
101
112
  items = _this$props.items,
102
113
  columns = _this$props.columns;
103
- var rowValues = items.map(function (item) {
114
+ var rowValues = items.map(function (item, index) {
104
115
  var data = item.data,
105
116
  identifier = item.identifier,
106
117
  rowProps = item.rowProps;
@@ -108,10 +119,10 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
108
119
  cells: _this.generateCellValues(data, identifier),
109
120
  key: identifier.id,
110
121
  tabIndex: 0,
111
- onClick: _this.onRowClick(identifier),
122
+ onClick: _this.onRowClick(identifier, data, index),
112
123
  onKeyPress: function onKeyPress(event) {
113
124
  if (event.key === 'Enter') {
114
- _this.onRowEnterKeyPressed(identifier);
125
+ _this.onRowEnterKeyPressed(identifier, data, index);
115
126
  }
116
127
  }
117
128
  }, rowProps);
@@ -135,7 +146,8 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
135
146
  totalItems = _this$props2.totalItems,
136
147
  items = _this$props2.items,
137
148
  sortKey = _this$props2.sortKey,
138
- sortOrder = _this$props2.sortOrder;
149
+ sortOrder = _this$props2.sortOrder,
150
+ highlightedRowIndex = _this$props2.highlightedRowIndex;
139
151
 
140
152
  var _getValidTableProps = getValidTableProps(items.length, itemsPerPage, pageNumber, totalItems),
141
153
  validItemsPerPage = _getValidTableProps.validItemsPerPage,
@@ -155,7 +167,8 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
155
167
  sortOrder: sortOrder,
156
168
  onSort: _this.onSort,
157
169
  onSetPage: onSetPage,
158
- isFixedSize: true
170
+ isFixedSize: true,
171
+ highlightedRowIndex: highlightedRowIndex
159
172
  });
160
173
  });
161
174
 
@@ -169,8 +182,10 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
169
182
  onPreviewOpen && onPreviewOpen();
170
183
  });
171
184
 
172
- _defineProperty(_assertThisInitialized(_this), "onRowEnterKeyPressed", function (identifier) {
173
- var createAnalyticsEvent = _this.props.createAnalyticsEvent;
185
+ _defineProperty(_assertThisInitialized(_this), "onRowEnterKeyPressed", function (identifier, data, index) {
186
+ var _this$props3 = _this.props,
187
+ createAnalyticsEvent = _this$props3.createAnalyticsEvent,
188
+ onRowClick = _this$props3.onRowClick;
174
189
  var ev = createAnalyticsEvent({
175
190
  eventType: 'ui',
176
191
  action: 'keyPressed',
@@ -178,13 +193,18 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
178
193
  actionSubjectId: 'mediaFileRow'
179
194
  });
180
195
  ev.fire(ANALYTICS_MEDIA_CHANNEL);
196
+ var shouldPreventDefaultRowClick = onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(data, index);
181
197
 
182
- _this.openPreview(identifier);
198
+ if (!shouldPreventDefaultRowClick) {
199
+ _this.openPreview(identifier);
200
+ }
183
201
  });
184
202
 
185
- _defineProperty(_assertThisInitialized(_this), "onRowClick", function (identifier) {
203
+ _defineProperty(_assertThisInitialized(_this), "onRowClick", function (identifier, data, index) {
186
204
  return function () {
187
- var createAnalyticsEvent = _this.props.createAnalyticsEvent;
205
+ var _this$props4 = _this.props,
206
+ createAnalyticsEvent = _this$props4.createAnalyticsEvent,
207
+ onRowClick = _this$props4.onRowClick;
188
208
  var ev = createAnalyticsEvent({
189
209
  eventType: 'ui',
190
210
  action: 'clicked',
@@ -192,8 +212,11 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
192
212
  actionSubjectId: 'mediaFileRow'
193
213
  });
194
214
  ev.fire(ANALYTICS_MEDIA_CHANNEL);
215
+ var shouldPreventDefaultRowClick = onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(data, index);
195
216
 
196
- _this.openPreview(identifier);
217
+ if (!shouldPreventDefaultRowClick) {
218
+ _this.openPreview(identifier);
219
+ }
197
220
  };
198
221
  });
199
222
 
@@ -215,9 +238,9 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
215
238
 
216
239
  _defineProperty(_assertThisInitialized(_this), "renderMediaViewer", function () {
217
240
  var mediaViewerSelectedItem = _this.state.mediaViewerSelectedItem;
218
- var _this$props3 = _this.props,
219
- mediaClient = _this$props3.mediaClient,
220
- items = _this$props3.items;
241
+ var _this$props5 = _this.props,
242
+ mediaClient = _this$props5.mediaClient,
243
+ items = _this$props5.items;
221
244
 
222
245
  if (!mediaViewerSelectedItem) {
223
246
  return null;
@@ -247,9 +270,9 @@ export var MediaTable = /*#__PURE__*/function (_Component) {
247
270
  var _this2 = this;
248
271
 
249
272
  this.hasBeenMounted = true;
250
- var _this$props4 = this.props,
251
- items = _this$props4.items,
252
- mediaClient = _this$props4.mediaClient;
273
+ var _this$props6 = this.props,
274
+ items = _this$props6.items,
275
+ mediaClient = _this$props6.mediaClient;
253
276
  items.forEach( /*#__PURE__*/function () {
254
277
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(item) {
255
278
  var _item$identifier, id, _item$identifier$coll, collectionName, subscription;
@@ -0,0 +1,53 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ 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; }
4
+
5
+ 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; }
6
+
7
+ import React from 'react'; // eslint-disable-next-line import/no-extraneous-dependencies
8
+
9
+ import { injectIntl } from 'react-intl-next';
10
+ import { N40 } from '@atlaskit/theme/colors';
11
+ import EditorFilePreviewIcon from '@atlaskit/icon/glyph/editor/file-preview';
12
+ import Button from '@atlaskit/button/custom-theme-button';
13
+ import { messages } from '@atlaskit/media-ui'; // eslint-disable-next-line import/no-extraneous-dependencies
14
+
15
+ import { ANALYTICS_MEDIA_CHANNEL } from '../util';
16
+
17
+ var MediaPreviewButton = function MediaPreviewButton(props) {
18
+ var _onClick = props.onClick,
19
+ formatMessage = props.intl.formatMessage;
20
+ return /*#__PURE__*/React.createElement(Button, {
21
+ appearance: "subtle",
22
+ testId: "preview-button",
23
+ iconAfter: /*#__PURE__*/React.createElement(EditorFilePreviewIcon, {
24
+ label: formatMessage(messages.preview)
25
+ }),
26
+ onKeyPress: function onKeyPress(event) {
27
+ return event.stopPropagation();
28
+ },
29
+ onClick: function onClick(event, analyticsEvent) {
30
+ analyticsEvent.update(function (payload) {
31
+ return _objectSpread(_objectSpread({}, payload), {}, {
32
+ eventType: 'ui',
33
+ actionSubjectId: 'mediaTablePreview'
34
+ });
35
+ }).fire(ANALYTICS_MEDIA_CHANNEL);
36
+
37
+ _onClick(event);
38
+ },
39
+ theme: function theme(current, themeProps) {
40
+ return {
41
+ buttonStyles: _objectSpread(_objectSpread({}, current(themeProps).buttonStyles), {}, {
42
+ minWidth: 'max-content',
43
+ '&:hover': {
44
+ background: N40
45
+ }
46
+ }),
47
+ spinnerStyles: current(themeProps).spinnerStyles
48
+ };
49
+ }
50
+ });
51
+ };
52
+
53
+ export default injectIntl(MediaPreviewButton);
@@ -6,4 +6,4 @@ import { css } from '@emotion/react';
6
6
  import { N20 } from '@atlaskit/theme/colors';
7
7
  export var nameCellWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-content: center;\n align-items: center;\n"])));
8
8
  export var truncateWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 0;\n width: 100%;\n margin-left: 4px;\n\n span:first-of-type {\n &::first-letter {\n text-transform: capitalize;\n }\n }\n"])));
9
- export var mediaTableWrapperStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n tr {\n cursor: pointer;\n\n &:hover {\n background: ", ";\n }\n\n td:empty {\n padding: 0;\n }\n }\n"])), N20);
9
+ export var mediaTableWrapperStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n tr {\n cursor: pointer;\n\n &:hover,\n &:focus {\n background: ", ";\n }\n\n td:empty {\n padding: 0;\n }\n }\n"])), N20);
@@ -1,2 +1,3 @@
1
1
  export var CELL_KEY_DOWNLOAD = 'download';
2
+ export var CELL_KEY_PREVIEW = 'preview';
2
3
  export var ANALYTICS_MEDIA_CHANNEL = 'media';
@@ -5,11 +5,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
  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; }
6
6
 
7
7
  import memoizeOne from 'memoize-one';
8
- import { CELL_KEY_DOWNLOAD } from './constants';
8
+ import { CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW } from './constants';
9
9
  var generateHeadValues = memoizeOne(function (columns) {
10
10
  return {
11
11
  cells: columns.cells.map(function (cell) {
12
- return cell.key === CELL_KEY_DOWNLOAD ? _objectSpread({
12
+ return cell.key === CELL_KEY_DOWNLOAD || cell.key === CELL_KEY_PREVIEW ? _objectSpread({
13
13
  style: {
14
14
  width: '48px'
15
15
  }
@@ -1,4 +1,4 @@
1
1
  export { default as generateRowValues } from './generateRowValues';
2
2
  export { default as getValidTableProps } from './getValidTableProps';
3
3
  export { default as generateHeadValues } from './generateHeadValues';
4
- export { CELL_KEY_DOWNLOAD, ANALYTICS_MEDIA_CHANNEL } from './constants';
4
+ export { CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW, ANALYTICS_MEDIA_CHANNEL } from './constants';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-table",
3
- "version": "13.0.2",
3
+ "version": "14.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -12,6 +12,7 @@ export declare class MediaTable extends Component<MediaTableProps & WrappedCompo
12
12
  componentWillUnmount(): void;
13
13
  private generateCellValues;
14
14
  private onDownloadClick;
15
+ private onPreviewClick;
15
16
  private onSort;
16
17
  private renderRowValues;
17
18
  private renderTable;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ interface Props {
4
+ onClick: (event: React.MouseEvent<HTMLElement>) => void;
5
+ }
6
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
7
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
8
+ };
9
+ export default _default;
@@ -57,6 +57,10 @@ export interface MediaTableProps {
57
57
  onPreviewOpen?: () => void;
58
58
  /** Called when the preview is closed */
59
59
  onPreviewClose?: () => void;
60
+ /** Row index that will be highlighted **/
61
+ highlightedRowIndex?: number[];
62
+ /** callback triggered when row click is passed, if returned true it will prevent default behaviour. **/
63
+ onRowClick?: (rowData: RowData, index: number) => boolean;
60
64
  }
61
65
  export interface MediaTableState {
62
66
  mediaViewerSelectedItem?: Identifier;
@@ -1,2 +1,3 @@
1
1
  export declare const CELL_KEY_DOWNLOAD = "download";
2
+ export declare const CELL_KEY_PREVIEW = "preview";
2
3
  export declare const ANALYTICS_MEDIA_CHANNEL = "media";
@@ -1,4 +1,4 @@
1
1
  export { default as generateRowValues } from './generateRowValues';
2
2
  export { default as getValidTableProps } from './getValidTableProps';
3
3
  export { default as generateHeadValues } from './generateHeadValues';
4
- export { CELL_KEY_DOWNLOAD, ANALYTICS_MEDIA_CHANNEL } from './constants';
4
+ export { CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW, ANALYTICS_MEDIA_CHANNEL, } from './constants';
@@ -12,6 +12,7 @@ export declare class MediaTable extends Component<MediaTableProps & WrappedCompo
12
12
  componentWillUnmount(): void;
13
13
  private generateCellValues;
14
14
  private onDownloadClick;
15
+ private onPreviewClick;
15
16
  private onSort;
16
17
  private renderRowValues;
17
18
  private renderTable;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ interface Props {
4
+ onClick: (event: React.MouseEvent<HTMLElement>) => void;
5
+ }
6
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
7
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
8
+ };
9
+ export default _default;
@@ -57,6 +57,10 @@ export interface MediaTableProps {
57
57
  onPreviewOpen?: () => void;
58
58
  /** Called when the preview is closed */
59
59
  onPreviewClose?: () => void;
60
+ /** Row index that will be highlighted **/
61
+ highlightedRowIndex?: number[];
62
+ /** callback triggered when row click is passed, if returned true it will prevent default behaviour. **/
63
+ onRowClick?: (rowData: RowData, index: number) => boolean;
60
64
  }
61
65
  export interface MediaTableState {
62
66
  mediaViewerSelectedItem?: Identifier;
@@ -1,2 +1,3 @@
1
1
  export declare const CELL_KEY_DOWNLOAD = "download";
2
+ export declare const CELL_KEY_PREVIEW = "preview";
2
3
  export declare const ANALYTICS_MEDIA_CHANNEL = "media";
@@ -1,4 +1,4 @@
1
1
  export { default as generateRowValues } from './generateRowValues';
2
2
  export { default as getValidTableProps } from './getValidTableProps';
3
3
  export { default as generateHeadValues } from './generateHeadValues';
4
- export { CELL_KEY_DOWNLOAD, ANALYTICS_MEDIA_CHANNEL } from './constants';
4
+ export { CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW, ANALYTICS_MEDIA_CHANNEL, } from './constants';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-table",
3
- "version": "13.0.2",
3
+ "version": "14.0.0",
4
4
  "description": "Table UI component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,17 +36,17 @@
36
36
  "@atlaskit/analytics-next": "^8.0.0",
37
37
  "@atlaskit/button": "^16.3.0",
38
38
  "@atlaskit/dynamic-table": "^14.8.0",
39
- "@atlaskit/icon": "^21.10.0",
40
- "@atlaskit/media-client": "^17.1.0",
39
+ "@atlaskit/icon": "^21.11.0",
40
+ "@atlaskit/media-client": "^18.0.0",
41
41
  "@atlaskit/media-ui": "^22.1.0",
42
42
  "@atlaskit/media-viewer": "^47.1.0",
43
43
  "@atlaskit/theme": "^12.2.0",
44
- "@atlaskit/tooltip": "^17.5.0",
44
+ "@atlaskit/tooltip": "^17.6.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "memoize-one": "^6.0.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/media-core": "^33.0.3",
49
+ "@atlaskit/media-core": "^34.0.0",
50
50
  "@emotion/react": "^11.7.1",
51
51
  "react": "^16.8.0",
52
52
  "react-dom": "^16.8.0",
@@ -56,9 +56,9 @@
56
56
  "@atlaskit/docs": "^9.0.0",
57
57
  "@atlaskit/icon-file-type": "^6.3.0",
58
58
  "@atlaskit/media-common": "^2.16.0",
59
- "@atlaskit/media-core": "^33.0.0",
59
+ "@atlaskit/media-core": "^34.0.0",
60
60
  "@atlaskit/media-test-helpers": "^30.0.0",
61
- "@atlaskit/range": "^6.0.0",
61
+ "@atlaskit/range": "^6.1.0",
62
62
  "@atlaskit/ssr": "*",
63
63
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
64
64
  "@emotion/react": "^11.7.1",
@@ -68,8 +68,6 @@
68
68
  "react-dom": "^16.8.0",
69
69
  "typescript": "4.5.5"
70
70
  },
71
- "resolutions": {
72
- "lru-fast": "0.2.2"
73
- },
71
+ "resolutions": {},
74
72
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
75
73
  }
package/report.api.md CHANGED
@@ -1,6 +1,8 @@
1
- ## API Report File for "@atlaskit/media-table"
1
+ ## API Report File for "@atlaskit/media-table".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  /// <reference types="react" />
@@ -63,6 +65,10 @@ export declare interface MediaTableProps {
63
65
  onPreviewOpen?: () => void;
64
66
  /** Called when the preview is closed */
65
67
  onPreviewClose?: () => void;
68
+ /** Row index that will be highlighted **/
69
+ highlightedRowIndex?: number[];
70
+ /** callback triggered when row click is passed, if returned true it will prevent default behaviour. **/
71
+ onRowClick?: (rowData: RowData, index: number) => boolean;
66
72
  }
67
73
 
68
74
  export declare const NameCell: FC<NameCellProps>;