@atlaskit/link-datasource 2.9.1 → 2.9.3

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 (58) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/analytics/generated/use-analytics-events.js +1 -1
  3. package/dist/cjs/hooks/useDatasourceTableState.js +2 -0
  4. package/dist/cjs/ui/assets-modal/modal/index.js +2 -0
  5. package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +3 -1
  6. package/dist/cjs/ui/common/modal/datasources-table-in-modal-preview/index.js +2 -0
  7. package/dist/cjs/ui/confluence-search-modal/modal/ModalOld.js +3 -1
  8. package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +2 -0
  9. package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +14 -2
  10. package/dist/cjs/ui/issue-like-table/index.js +56 -66
  11. package/dist/cjs/ui/issue-like-table/styled.js +25 -3
  12. package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +54 -0
  13. package/dist/cjs/ui/issue-like-table/truncate-text-tag/index.js +32 -0
  14. package/dist/cjs/ui/jira-issues-modal/modal/ModalOld.js +3 -1
  15. package/dist/es2019/analytics/generated/use-analytics-events.js +1 -1
  16. package/dist/es2019/hooks/useDatasourceTableState.js +2 -1
  17. package/dist/es2019/ui/assets-modal/modal/index.js +2 -0
  18. package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +3 -1
  19. package/dist/es2019/ui/common/modal/datasources-table-in-modal-preview/index.js +2 -0
  20. package/dist/es2019/ui/confluence-search-modal/modal/ModalOld.js +3 -1
  21. package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +2 -0
  22. package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +16 -1
  23. package/dist/es2019/ui/issue-like-table/index.js +32 -52
  24. package/dist/es2019/ui/issue-like-table/styled.js +33 -0
  25. package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +44 -0
  26. package/dist/es2019/ui/issue-like-table/truncate-text-tag/index.js +21 -0
  27. package/dist/es2019/ui/jira-issues-modal/modal/ModalOld.js +3 -1
  28. package/dist/esm/analytics/generated/use-analytics-events.js +1 -1
  29. package/dist/esm/hooks/useDatasourceTableState.js +2 -0
  30. package/dist/esm/ui/assets-modal/modal/index.js +2 -0
  31. package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +3 -1
  32. package/dist/esm/ui/common/modal/datasources-table-in-modal-preview/index.js +2 -0
  33. package/dist/esm/ui/confluence-search-modal/modal/ModalOld.js +3 -1
  34. package/dist/esm/ui/datasource-table-view/datasourceTableView.js +2 -0
  35. package/dist/esm/ui/issue-like-table/draggable-table-heading.js +14 -2
  36. package/dist/esm/ui/issue-like-table/index.js +53 -61
  37. package/dist/esm/ui/issue-like-table/styled.js +24 -2
  38. package/dist/esm/ui/issue-like-table/table-cell-content/index.js +47 -0
  39. package/dist/esm/ui/issue-like-table/truncate-text-tag/index.js +21 -0
  40. package/dist/esm/ui/jira-issues-modal/modal/ModalOld.js +3 -1
  41. package/dist/types/analytics/generated/analytics.types.d.ts +13 -8
  42. package/dist/types/hooks/useDatasourceTableState.d.ts +2 -0
  43. package/dist/types/ui/assets-modal/modal/render-assets-content/index.d.ts +1 -0
  44. package/dist/types/ui/issue-like-table/index.d.ts +1 -17
  45. package/dist/types/ui/issue-like-table/styled.d.ts +4 -0
  46. package/dist/types/ui/issue-like-table/table-cell-content/index.d.ts +12 -0
  47. package/dist/types/ui/issue-like-table/truncate-text-tag/index.d.ts +6 -0
  48. package/dist/types/ui/issue-like-table/types.d.ts +20 -1
  49. package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +13 -8
  50. package/dist/types-ts4.5/hooks/useDatasourceTableState.d.ts +2 -0
  51. package/dist/types-ts4.5/ui/assets-modal/modal/render-assets-content/index.d.ts +1 -0
  52. package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -17
  53. package/dist/types-ts4.5/ui/issue-like-table/styled.d.ts +4 -0
  54. package/dist/types-ts4.5/ui/issue-like-table/table-cell-content/index.d.ts +12 -0
  55. package/dist/types-ts4.5/ui/issue-like-table/truncate-text-tag/index.d.ts +6 -0
  56. package/dist/types-ts4.5/ui/issue-like-table/types.d.ts +20 -1
  57. package/examples-helpers/buildIssueLikeTable.tsx +2 -0
  58. package/package.json +9 -9
@@ -1,9 +1,7 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _extends from "@babel/runtime/helpers/extends";
4
3
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
5
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
- var _styled$td;
7
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -11,7 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
11
9
  * @jsxRuntime classic
12
10
  * @jsx jsx
13
11
  */
14
- import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
12
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15
13
 
16
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
15
  import { css, jsx } from '@emotion/react';
@@ -21,6 +19,7 @@ import debounce from 'lodash/debounce';
21
19
  import { useIntl } from 'react-intl-next';
22
20
  import invariant from 'tiny-invariant';
23
21
  import { Skeleton } from '@atlaskit/linking-common';
22
+ import { fg } from '@atlaskit/platform-feature-flags';
24
23
  import { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
25
24
  import { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';
26
25
  import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';
@@ -38,7 +37,9 @@ import { DragColumnPreview } from './drag-column-preview';
38
37
  import { DraggableTableHeading } from './draggable-table-heading';
39
38
  import TableEmptyState from './empty-state';
40
39
  import { renderType, stringifyType } from './render-type';
41
- import { fieldTextFontSize, Table, TableHeading, withTablePluginBodyPrefix, withTablePluginHeaderPrefix } from './styled';
40
+ import { Table, TableCell, TableHeading, withTablePluginHeaderPrefix } from './styled';
41
+ import { TableCellContent } from './table-cell-content';
42
+ import { TruncateTextTag } from './truncate-text-tag';
42
43
  import { useIsOnScreen } from './useIsOnScreen';
43
44
  import { COLUMN_BASE_WIDTH, getWidthCss } from './utils';
44
45
  var tableSidePadding = "var(--ds-space-200, 16px)";
@@ -49,11 +50,6 @@ var tableHeadStyles = css({
49
50
  // 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
51
  zIndex: stickyTableHeadersIndex
51
52
  });
52
- var truncateTextStyles = css({
53
- overflow: 'hidden',
54
- textOverflow: 'ellipsis',
55
- whiteSpace: 'nowrap'
56
- });
57
53
  var columnPickerWidth = 80;
58
54
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
59
55
  var ColumnPickerHeader = styled.th(_defineProperty({}, "".concat(withTablePluginHeaderPrefix('&:last-of-type')), {
@@ -77,28 +73,6 @@ var truncateStyles = css({
77
73
  textOverflow: 'ellipsis',
78
74
  whiteSpace: 'nowrap'
79
75
  });
80
-
81
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
82
- var TableCell = styled.td((_styled$td = {}, _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix()), {
83
- /* First section here is to override things editor table plugin css defines */
84
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
85
- font: fieldTextFontSize,
86
- padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)"),
87
- border: 0,
88
- minWidth: 'auto',
89
- verticalAlign: 'inherit',
90
- boxSizing: 'border-box',
91
- borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
92
- borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
93
- overflow: 'hidden'
94
- }), _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix('&:first-child')), {
95
- paddingLeft: "var(--ds-space-100, 8px)"
96
- }), _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix('&:last-child')), {
97
- borderRight: 0,
98
- paddingRight: "var(--ds-space-100, 8px)"
99
- }), _defineProperty(_styled$td, "& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span", {
100
- whiteSpace: 'unset'
101
- }), _styled$td));
102
76
  var tableContainerStyles = css({
103
77
  borderRadius: 'inherit',
104
78
  borderBottomLeftRadius: 0,
@@ -274,18 +248,12 @@ function getDefaultColumnWidth(key, type) {
274
248
  return DEFAULT_WIDTH;
275
249
  }
276
250
  }
277
- var TruncateTextTag = /*#__PURE__*/forwardRef(function (props, ref) {
278
- return jsx("span", _extends({
279
- css: truncateTextStyles
280
- }, props, {
281
- ref: ref
282
- }), props.children);
283
- });
284
251
  export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
285
252
  var testId = _ref5.testId,
286
253
  onNextPage = _ref5.onNextPage,
287
254
  onLoadDatasourceDetails = _ref5.onLoadDatasourceDetails,
288
255
  items = _ref5.items,
256
+ itemIds = _ref5.itemIds,
289
257
  columns = _ref5.columns,
290
258
  _ref5$renderItem = _ref5.renderItem,
291
259
  renderItem = _ref5$renderItem === void 0 ? renderType : _ref5$renderItem,
@@ -394,14 +362,15 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
394
362
  return {
395
363
  key: 'loading',
396
364
  cells: headerColumns.map(function (column) {
397
- return _objectSpread(_objectSpread({}, column), {}, {
365
+ return {
398
366
  content: jsx(Skeleton, {
399
367
  borderRadius: 8,
400
368
  width: "100%",
401
369
  height: 14,
402
370
  testId: "issues-table-row-loading"
403
- })
404
- });
371
+ }),
372
+ key: column.key
373
+ };
405
374
  })
406
375
  };
407
376
  }, [headerColumns]);
@@ -487,13 +456,36 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
487
456
  }));
488
457
  }, [visibleColumnKeys, onVisibleColumnKeysChange, tableId, hasData]);
489
458
  var tableRows = useMemo(function () {
490
- return items.map(function (newRowData, rowIndex) {
459
+ return fg('enable_datasource_react_sweet_state') ? itemIds.map(function (id, rowIndex) {
491
460
  return {
492
- key: "".concat(identityColumnKey && newRowData[identityColumnKey] && newRowData[identityColumnKey].data || rowIndex),
461
+ key: id,
493
462
  cells: visibleSortedColumns.map(function (_ref12, cellIndex) {
494
- var _newRowData$key;
495
463
  var key = _ref12.key,
496
464
  type = _ref12.type;
465
+ return {
466
+ key: key,
467
+ columnKey: key,
468
+ content: jsx(TableCellContent, {
469
+ id: id,
470
+ columnKey: key,
471
+ columnType: type,
472
+ wrappedColumnKeys: wrappedColumnKeys,
473
+ renderItem: renderItem
474
+ }),
475
+ width: getColumnWidth(key, type, cellIndex === visibleSortedColumns.length - 1)
476
+ };
477
+ }),
478
+ ref: rowIndex === items.length - 1 ? function (el) {
479
+ return setLastRowElement(el);
480
+ } : undefined
481
+ };
482
+ }) : items.map(function (newRowData, rowIndex) {
483
+ return {
484
+ key: "".concat(identityColumnKey && newRowData[identityColumnKey] && newRowData[identityColumnKey].data || rowIndex),
485
+ cells: visibleSortedColumns.map(function (_ref13, cellIndex) {
486
+ var _newRowData$key;
487
+ var key = _ref13.key,
488
+ type = _ref13.type;
497
489
  // Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
498
490
  var value = (_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data;
499
491
  var values = Array.isArray(value) ? value : [value];
@@ -527,7 +519,7 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
527
519
  } : undefined
528
520
  };
529
521
  });
530
- }, [items, visibleSortedColumns, renderItem, wrappedColumnKeys, getColumnWidth, intl.formatMessage, intl.formatDate]);
522
+ }, [items, itemIds, renderItem, wrappedColumnKeys, visibleSortedColumns, getColumnWidth, intl.formatMessage, intl.formatDate]);
531
523
  var rows = useMemo(function () {
532
524
  if (status !== 'loading') {
533
525
  return tableRows;
@@ -618,10 +610,10 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
618
610
  className: !!onVisibleColumnKeysChange ? 'has-column-picker' : ''
619
611
  }, jsx("tr", {
620
612
  ref: tableHeaderRowRef
621
- }, headerColumns.map(function (_ref14, cellIndex) {
622
- var key = _ref14.key,
623
- content = _ref14.content,
624
- width = _ref14.width;
613
+ }, headerColumns.map(function (_ref15, cellIndex) {
614
+ var key = _ref15.key,
615
+ content = _ref15.content,
616
+ width = _ref15.width;
625
617
  var heading = jsx(Tooltip, {
626
618
  content: content,
627
619
  tag: "span",
@@ -638,10 +630,10 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
638
630
  }
639
631
  if (isEditable) {
640
632
  var _containerRef$current3;
641
- var previewRows = tableRows.map(function (_ref15) {
642
- var cells = _ref15.cells;
643
- var cell = cells.find(function (_ref16) {
644
- var cellKey = _ref16.key;
633
+ var previewRows = tableRows.map(function (_ref16) {
634
+ var cells = _ref16.cells;
635
+ var cell = cells.find(function (_ref17) {
636
+ var cellKey = _ref17.key;
645
637
  return cellKey === key;
646
638
  });
647
639
  if (cell) {
@@ -684,18 +676,18 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
684
676
  })))), jsx("tbody", {
685
677
  css: noDefaultBorderStyles,
686
678
  "data-testid": testId && "".concat(testId, "--body")
687
- }, rows.map(function (_ref17) {
688
- var key = _ref17.key,
689
- cells = _ref17.cells,
690
- ref = _ref17.ref;
679
+ }, rows.map(function (_ref18) {
680
+ var key = _ref18.key,
681
+ cells = _ref18.cells,
682
+ ref = _ref18.ref;
691
683
  return jsx("tr", {
692
684
  key: key,
693
685
  "data-testid": testId && "".concat(testId, "--row-").concat(key),
694
686
  ref: ref
695
- }, cells.map(function (_ref18, cellIndex) {
696
- var cellKey = _ref18.key,
697
- content = _ref18.content,
698
- width = _ref18.width;
687
+ }, cells.map(function (_ref19, cellIndex) {
688
+ var cellKey = _ref19.key,
689
+ content = _ref19.content,
690
+ width = _ref19.width;
699
691
  var isLastCell = cellIndex === cells.length - 1;
700
692
  var loadingRowStyle = getWidthCss({
701
693
  shouldUseWidth: shouldUseWidth,
@@ -1,5 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- var _styled$th;
2
+ var _styled$th, _styled$td;
3
3
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
4
  import styled from '@emotion/styled';
5
5
  import { N40 } from '@atlaskit/theme/colors';
@@ -65,4 +65,26 @@ export var TableHeading = styled.th((_styled$th = {}, _defineProperty(_styled$th
65
65
  whiteSpace: 'normal',
66
66
  overflow: 'hidden',
67
67
  wordWrap: 'break-word'
68
- }), _styled$th));
68
+ }), _styled$th));
69
+
70
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
71
+ export var TableCell = styled.td((_styled$td = {}, _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix()), {
72
+ /* First section here is to override things editor table plugin css defines */
73
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
74
+ font: fieldTextFontSize,
75
+ padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)"),
76
+ border: 0,
77
+ minWidth: 'auto',
78
+ verticalAlign: 'inherit',
79
+ boxSizing: 'border-box',
80
+ borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
81
+ borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
82
+ overflow: 'hidden'
83
+ }), _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix('&:first-child')), {
84
+ paddingLeft: "var(--ds-space-100, 8px)"
85
+ }), _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix('&:last-child')), {
86
+ borderRight: 0,
87
+ paddingRight: "var(--ds-space-100, 8px)"
88
+ }), _defineProperty(_styled$td, "& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span", {
89
+ whiteSpace: 'unset'
90
+ }), _styled$td));
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import Tooltip from '@atlaskit/tooltip';
4
+ import { useDatasourceItem } from '../../../state';
5
+ import { stringifyType } from '../render-type';
6
+ import { TruncateTextTag } from '../truncate-text-tag';
7
+ export var TableCellContent = function TableCellContent(_ref) {
8
+ var _rowData$columnKey;
9
+ var columnKey = _ref.columnKey,
10
+ columnType = _ref.columnType,
11
+ id = _ref.id,
12
+ renderItem = _ref.renderItem,
13
+ wrappedColumnKeys = _ref.wrappedColumnKeys;
14
+ var intl = useIntl();
15
+ var rowData = useDatasourceItem({
16
+ id: id
17
+ });
18
+ if (!rowData || !columnKey || !rowData[columnKey]) {
19
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
20
+ }
21
+
22
+ // Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
23
+ var value = (_rowData$columnKey = rowData[columnKey]) === null || _rowData$columnKey === void 0 ? void 0 : _rowData$columnKey.data;
24
+ var values = Array.isArray(value) ? value : [value];
25
+ var renderedValues = renderItem({
26
+ type: columnType,
27
+ values: values
28
+ });
29
+ var stringifiedContent = values.map(function (value) {
30
+ return stringifyType({
31
+ type: columnType,
32
+ value: value
33
+ }, intl.formatMessage, intl.formatDate);
34
+ }).filter(function (value) {
35
+ return value !== '';
36
+ }).join(', ');
37
+ if (stringifiedContent && !(wrappedColumnKeys !== null && wrappedColumnKeys !== void 0 && wrappedColumnKeys.includes(columnKey))) {
38
+ return /*#__PURE__*/React.createElement(Tooltip
39
+ // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
40
+ , {
41
+ tag: TruncateTextTag,
42
+ content: stringifiedContent,
43
+ testId: "issues-table-cell-tooltip"
44
+ }, renderedValues);
45
+ }
46
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderedValues);
47
+ };
@@ -0,0 +1,21 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+ import React, { forwardRef } from 'react';
7
+
8
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
9
+ import { css, jsx } from '@emotion/react';
10
+ var truncateTextStyles = css({
11
+ overflow: 'hidden',
12
+ textOverflow: 'ellipsis',
13
+ whiteSpace: 'nowrap'
14
+ });
15
+ export var TruncateTextTag = /*#__PURE__*/forwardRef(function (props, ref) {
16
+ return jsx("span", _extends({
17
+ css: truncateTextStyles
18
+ }, props, {
19
+ ref: ref
20
+ }), props.children);
21
+ });
@@ -129,6 +129,7 @@ export var PlainJiraIssuesConfigModalOld = function PlainJiraIssuesConfigModalOl
129
129
  status = _useDatasourceTableSt.status,
130
130
  onNextPage = _useDatasourceTableSt.onNextPage,
131
131
  responseItems = _useDatasourceTableSt.responseItems,
132
+ responseItemIds = _useDatasourceTableSt.responseItemIds,
132
133
  hasNextPage = _useDatasourceTableSt.hasNextPage,
133
134
  columns = _useDatasourceTableSt.columns,
134
135
  defaultVisibleColumnKeys = _useDatasourceTableSt.defaultVisibleColumnKeys,
@@ -366,6 +367,7 @@ export var PlainJiraIssuesConfigModalOld = function PlainJiraIssuesConfigModalOl
366
367
  status: status,
367
368
  columns: columns,
368
369
  items: responseItems,
370
+ itemIds: responseItemIds,
369
371
  hasNextPage: hasNextPage,
370
372
  visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
371
373
  onNextPage: handleOnNextPage,
@@ -377,7 +379,7 @@ export var PlainJiraIssuesConfigModalOld = function PlainJiraIssuesConfigModalOl
377
379
  wrappedColumnKeys: wrappedColumnKeys,
378
380
  onWrappedColumnChange: fg('platform.linking-platform.datasource-word_wrap') ? onWrappedColumnChange : undefined
379
381
  }));
380
- }, [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, handleOnNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
382
+ }, [status, columns, responseItems, responseItemIds, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, handleOnNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
381
383
  var renderCountModeContent = useCallback(function () {
382
384
  var selectedJiraSiteUrl = selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url;
383
385
  if (status === 'unauthorized') {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6518dea178189cd102e0ca6ce7eae059>>
6
+ * @codegen <<SignedSource::a526398bbb8839b31c26c69ef2845c19>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -16,10 +16,6 @@ export type AnalyticsContextAttributesType = {
16
16
  dataProvider: 'jira-issues' | 'jsm-assets' | 'confluence-search';
17
17
  };
18
18
  export type DatasourceModalDialogViewedAttributesType = {};
19
- export type LinkClickedPoweredByAttributesType = {
20
- extensionKey: string;
21
- componentHierarchy: string;
22
- };
23
19
  export type ModalReadyDatasourceAttributesType = {
24
20
  instancesCount: number | null;
25
21
  schemasCount: number | null;
@@ -57,6 +53,8 @@ export type ButtonClickedCancelAttributesType = {
57
53
  extensionKey: string | null;
58
54
  actions: unknown[];
59
55
  };
56
+ export type ButtonClickedWrapAttributesType = {};
57
+ export type ButtonClickedUnwrapAttributesType = {};
60
58
  export type LinkClickedSingleItemAttributesType = {
61
59
  extensionKey: string | null;
62
60
  destinationObjectTypes: unknown[];
@@ -126,6 +124,7 @@ export type ButtonClickedBasicSearchDropdownAttributesType = {
126
124
  type: 'showMore';
127
125
  };
128
126
  export type AqlEditorSearchedAttributesType = {};
127
+ export type LinkClickedPoweredByAttributesType = {};
129
128
  export type GetWorkspaceIdSuccessAttributesType = {};
130
129
  export type GetWorkspaceIdFailedAttributesType = {
131
130
  statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
@@ -170,6 +169,12 @@ export type AnalyticsEventAttributes = {
170
169
  /**
171
170
  * Fired on cancel button click */
172
171
  'ui.button.clicked.cancel': ButtonClickedCancelAttributesType;
172
+ /**
173
+ * Fired on wrap button click */
174
+ 'ui.button.clicked.wrap': ButtonClickedWrapAttributesType;
175
+ /**
176
+ * Fired on unwrap button click */
177
+ 'ui.button.clicked.unwrap': ButtonClickedUnwrapAttributesType;
173
178
  /**
174
179
  * Fired when user clicks on datasource items */
175
180
  'ui.link.clicked.singleItem': LinkClickedSingleItemAttributesType;
@@ -215,12 +220,12 @@ export type AnalyticsEventAttributes = {
215
220
  /**
216
221
  * Fired when the “show more” button inside the dropdown menu is clicked */
217
222
  'ui.button.clicked.basicSearchDropdown': ButtonClickedBasicSearchDropdownAttributesType;
218
- /**
219
- * Fired when the “show more” button inside the dropdown menu is clicked */
220
- 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
221
223
  /**
222
224
  * Fired when search is initiated via the search icon or enter key press for aql editor input field. */
223
225
  'ui.aqlEditor.searched': AqlEditorSearchedAttributesType;
226
+ /**
227
+ * Fired when the power by link on the issue like table footer is clicked. */
228
+ 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
224
229
  /**
225
230
  * Fired when fetching a workspace Id is successful. */
226
231
  'operational.getWorkspaceId.success': GetWorkspaceIdSuccessAttributesType;
@@ -20,6 +20,8 @@ export interface DatasourceTableState {
20
20
  reset: (options?: ResetOptions) => void;
21
21
  /** Requests the available column schemas that can be displayed within the table */
22
22
  loadDatasourceDetails: () => void;
23
+ /** Item ids to be hydrated from a store by consumers [NOTE: They must be in the same order as responseItems] */
24
+ responseItemIds: string[];
23
25
  /** Items to be rendered within the table */
24
26
  responseItems: DatasourceDataResponseItem[];
25
27
  /** Indicates whether there is still more data that can be paginated */
@@ -4,6 +4,7 @@ export interface RenderAssetsContentProps {
4
4
  isFetchingInitialData: boolean;
5
5
  status: DatasourceTableStatusType;
6
6
  responseItems: DatasourceDataResponseItem[];
7
+ responseItemIds: string[];
7
8
  visibleColumnKeys?: string[];
8
9
  datasourceId: string;
9
10
  aql?: string;
@@ -1,8 +1,3 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type Ref } from 'react';
6
1
  import { jsx } from '@emotion/react';
7
2
  import { type DatasourceResponseSchemaProperty } from '@atlaskit/linking-types/datasource';
8
3
  import { type IssueLikeDataTableViewProps } from './types';
@@ -13,17 +8,6 @@ export declare const scrollableContainerShadowsCssComponents: {
13
8
  backgroundSize: string;
14
9
  backgroundAttachment: string;
15
10
  };
16
- export interface RowType {
17
- cells: Array<RowCellType>;
18
- key?: string;
19
- ref?: Ref<HTMLTableRowElement>;
20
- }
21
- export interface RowCellType {
22
- key: string;
23
- width?: number;
24
- shouldTruncate?: boolean;
25
- content?: React.ReactNode | string;
26
- }
27
11
  export declare const getOrderedColumns: (columns: DatasourceResponseSchemaProperty[], visibleColumnKeys: string[]) => DatasourceResponseSchemaProperty[];
28
- export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange, status, hasNextPage, scrollableContainerHeight, extensionKey, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
12
+ export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, itemIds, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange, status, hasNextPage, scrollableContainerHeight, extensionKey, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
29
13
  export declare const EmptyState: ({ isCompact, testId }: import("./empty-state").Props) => jsx.JSX.Element;
@@ -18,3 +18,7 @@ export declare const TableHeading: import("@emotion/styled").StyledComponent<{
18
18
  theme?: import("@emotion/react").Theme | undefined;
19
19
  as?: import("react").ElementType<any> | undefined;
20
20
  }, import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, {}>;
21
+ export declare const TableCell: import("@emotion/styled").StyledComponent<{
22
+ theme?: import("@emotion/react").Theme | undefined;
23
+ as?: import("react").ElementType<any> | undefined;
24
+ }, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { type TableViewPropsRenderType } from '../types';
3
+ interface TableCellContentProps {
4
+ id: string;
5
+ columnKey: string | null;
6
+ columnType: string;
7
+ /** Used to retrieve cell content from the store */
8
+ renderItem: TableViewPropsRenderType;
9
+ wrappedColumnKeys: string[] | undefined;
10
+ }
11
+ export declare const TableCellContent: ({ columnKey, columnType, id, renderItem, wrappedColumnKeys, }: TableCellContentProps) => JSX.Element;
12
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export declare const TruncateTextTag: React.ForwardRefExoticComponent<React.RefAttributes<HTMLElement>>;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { type Ref } from 'react';
2
2
  import type { DatasourceDataResponseItem, DatasourceResponseSchemaProperty, DatasourceTableStatusType, DatasourceType } from '@atlaskit/linking-types';
3
3
  import type { NextPageType } from '../../hooks/useDatasourceTableState';
4
4
  export type DatasourceTypeWithOnlyValues = {
@@ -32,6 +32,7 @@ export interface IssueLikeDataTableViewProps {
32
32
  hasNextPage: boolean;
33
33
  status: DatasourceTableStatusType;
34
34
  items: DatasourceDataResponseItem[];
35
+ itemIds: string[];
35
36
  onNextPage: NextPageType;
36
37
  onLoadDatasourceDetails: () => void;
37
38
  /**
@@ -76,3 +77,21 @@ export interface IssueLikeDataTableViewProps {
76
77
  */
77
78
  onWrappedColumnChange?: (key: string, shouldWrap: boolean) => void;
78
79
  }
80
+ export interface HeaderRowCellType {
81
+ key: string;
82
+ width?: number;
83
+ shouldTruncate?: boolean;
84
+ content?: React.ReactNode | string;
85
+ }
86
+ export interface RowType {
87
+ cells: Array<RowCellType>;
88
+ key?: string;
89
+ ref?: Ref<HTMLTableRowElement>;
90
+ }
91
+ export interface RowCellType {
92
+ key: string;
93
+ type?: DatasourceType['type'];
94
+ width?: number;
95
+ shouldTruncate?: boolean;
96
+ content?: React.ReactNode | string;
97
+ }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6518dea178189cd102e0ca6ce7eae059>>
6
+ * @codegen <<SignedSource::a526398bbb8839b31c26c69ef2845c19>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -16,10 +16,6 @@ export type AnalyticsContextAttributesType = {
16
16
  dataProvider: 'jira-issues' | 'jsm-assets' | 'confluence-search';
17
17
  };
18
18
  export type DatasourceModalDialogViewedAttributesType = {};
19
- export type LinkClickedPoweredByAttributesType = {
20
- extensionKey: string;
21
- componentHierarchy: string;
22
- };
23
19
  export type ModalReadyDatasourceAttributesType = {
24
20
  instancesCount: number | null;
25
21
  schemasCount: number | null;
@@ -57,6 +53,8 @@ export type ButtonClickedCancelAttributesType = {
57
53
  extensionKey: string | null;
58
54
  actions: unknown[];
59
55
  };
56
+ export type ButtonClickedWrapAttributesType = {};
57
+ export type ButtonClickedUnwrapAttributesType = {};
60
58
  export type LinkClickedSingleItemAttributesType = {
61
59
  extensionKey: string | null;
62
60
  destinationObjectTypes: unknown[];
@@ -126,6 +124,7 @@ export type ButtonClickedBasicSearchDropdownAttributesType = {
126
124
  type: 'showMore';
127
125
  };
128
126
  export type AqlEditorSearchedAttributesType = {};
127
+ export type LinkClickedPoweredByAttributesType = {};
129
128
  export type GetWorkspaceIdSuccessAttributesType = {};
130
129
  export type GetWorkspaceIdFailedAttributesType = {
131
130
  statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
@@ -170,6 +169,12 @@ export type AnalyticsEventAttributes = {
170
169
  /**
171
170
  * Fired on cancel button click */
172
171
  'ui.button.clicked.cancel': ButtonClickedCancelAttributesType;
172
+ /**
173
+ * Fired on wrap button click */
174
+ 'ui.button.clicked.wrap': ButtonClickedWrapAttributesType;
175
+ /**
176
+ * Fired on unwrap button click */
177
+ 'ui.button.clicked.unwrap': ButtonClickedUnwrapAttributesType;
173
178
  /**
174
179
  * Fired when user clicks on datasource items */
175
180
  'ui.link.clicked.singleItem': LinkClickedSingleItemAttributesType;
@@ -215,12 +220,12 @@ export type AnalyticsEventAttributes = {
215
220
  /**
216
221
  * Fired when the “show more” button inside the dropdown menu is clicked */
217
222
  'ui.button.clicked.basicSearchDropdown': ButtonClickedBasicSearchDropdownAttributesType;
218
- /**
219
- * Fired when the “show more” button inside the dropdown menu is clicked */
220
- 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
221
223
  /**
222
224
  * Fired when search is initiated via the search icon or enter key press for aql editor input field. */
223
225
  'ui.aqlEditor.searched': AqlEditorSearchedAttributesType;
226
+ /**
227
+ * Fired when the power by link on the issue like table footer is clicked. */
228
+ 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
224
229
  /**
225
230
  * Fired when fetching a workspace Id is successful. */
226
231
  'operational.getWorkspaceId.success': GetWorkspaceIdSuccessAttributesType;
@@ -20,6 +20,8 @@ export interface DatasourceTableState {
20
20
  reset: (options?: ResetOptions) => void;
21
21
  /** Requests the available column schemas that can be displayed within the table */
22
22
  loadDatasourceDetails: () => void;
23
+ /** Item ids to be hydrated from a store by consumers [NOTE: They must be in the same order as responseItems] */
24
+ responseItemIds: string[];
23
25
  /** Items to be rendered within the table */
24
26
  responseItems: DatasourceDataResponseItem[];
25
27
  /** Indicates whether there is still more data that can be paginated */
@@ -4,6 +4,7 @@ export interface RenderAssetsContentProps {
4
4
  isFetchingInitialData: boolean;
5
5
  status: DatasourceTableStatusType;
6
6
  responseItems: DatasourceDataResponseItem[];
7
+ responseItemIds: string[];
7
8
  visibleColumnKeys?: string[];
8
9
  datasourceId: string;
9
10
  aql?: string;
@@ -1,8 +1,3 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type Ref } from 'react';
6
1
  import { jsx } from '@emotion/react';
7
2
  import { type DatasourceResponseSchemaProperty } from '@atlaskit/linking-types/datasource';
8
3
  import { type IssueLikeDataTableViewProps } from './types';
@@ -13,17 +8,6 @@ export declare const scrollableContainerShadowsCssComponents: {
13
8
  backgroundSize: string;
14
9
  backgroundAttachment: string;
15
10
  };
16
- export interface RowType {
17
- cells: Array<RowCellType>;
18
- key?: string;
19
- ref?: Ref<HTMLTableRowElement>;
20
- }
21
- export interface RowCellType {
22
- key: string;
23
- width?: number;
24
- shouldTruncate?: boolean;
25
- content?: React.ReactNode | string;
26
- }
27
11
  export declare const getOrderedColumns: (columns: DatasourceResponseSchemaProperty[], visibleColumnKeys: string[]) => DatasourceResponseSchemaProperty[];
28
- export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange, status, hasNextPage, scrollableContainerHeight, extensionKey, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
12
+ export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, itemIds, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange, status, hasNextPage, scrollableContainerHeight, extensionKey, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
29
13
  export declare const EmptyState: ({ isCompact, testId }: import("./empty-state").Props) => jsx.JSX.Element;
@@ -18,3 +18,7 @@ export declare const TableHeading: import("@emotion/styled").StyledComponent<{
18
18
  theme?: import("@emotion/react").Theme | undefined;
19
19
  as?: import("react").ElementType<any> | undefined;
20
20
  }, import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, {}>;
21
+ export declare const TableCell: import("@emotion/styled").StyledComponent<{
22
+ theme?: import("@emotion/react").Theme | undefined;
23
+ as?: import("react").ElementType<any> | undefined;
24
+ }, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;