@atlaskit/link-picker 0.8.1 → 0.9.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,11 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c1c010c8ada`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c1c010c8ada) - Remove required container param
8
+
3
9
  ## 0.8.1
4
10
 
5
11
  ### Patch Changes
@@ -52,7 +52,7 @@ var LinkSearchListItem = function LinkSearchListItem(_ref) {
52
52
  }, (0, _core.jsx)(ListItemIcon, {
53
53
  item: item,
54
54
  intl: intl
55
- }), (0, _core.jsx)(_styles.ItemNameWrapper, null, (0, _core.jsx)(_styles.ListItemName, null, item.name), (0, _core.jsx)(_styles.ListItemContext, null, item.container, (0, _core.jsx)(ItemTimeStamp, {
55
+ }), (0, _core.jsx)(_styles.ItemNameWrapper, null, (0, _core.jsx)(_styles.ListItemName, null, item.name), (0, _core.jsx)(_styles.ListItemContext, null, item.container && (0, _core.jsx)(_react.Fragment, null, item.container, "\xA0 \u2022"), (0, _core.jsx)(ItemTimeStamp, {
56
56
  date: (0, _transformTimeStamp.transformTimeStamp)(intl, item.lastViewedDate, item.lastUpdatedDate)
57
57
  }))));
58
58
  };
@@ -68,7 +68,7 @@ var ItemTimeStamp = function ItemTimeStamp(props) {
68
68
  return null;
69
69
  }
70
70
 
71
- return (0, _core.jsx)(_react.Fragment, null, "\xA0 \u2022", (0, _core.jsx)("span", {
71
+ return (0, _core.jsx)(_react.Fragment, null, (0, _core.jsx)("span", {
72
72
  className: "link-search-timestamp",
73
73
  "data-test-id": "link-search-timestamp"
74
74
  }, "\xA0 ", date.pageAction, " ", date.dateString, " ", date.timeSince || ''));
@@ -155,7 +155,8 @@ var LinkPicker = /*#__PURE__*/function (_PureComponent) {
155
155
  lastUpdatedDate = _items$selectedIndex.lastUpdatedDate,
156
156
  lastViewedDate = _items$selectedIndex.lastViewedDate;
157
157
  var date = (0, _transformTimeStamp.transformTimeStamp)(intl, lastViewedDate, lastUpdatedDate);
158
- return "".concat(name, ", ").concat(container, ", ").concat(date === null || date === void 0 ? void 0 : date.pageAction, " ").concat(date === null || date === void 0 ? void 0 : date.dateString, " ").concat((date === null || date === void 0 ? void 0 : date.timeSince) || '');
158
+ var formattedDate = [date === null || date === void 0 ? void 0 : date.pageAction, date === null || date === void 0 ? void 0 : date.dateString, date === null || date === void 0 ? void 0 : date.timeSince].filter(Boolean).join(' ');
159
+ return [name, container, formattedDate].filter(Boolean).join(', ');
159
160
  }
160
161
  });
161
162
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isUrlPopulatedWithSelectedItem", function () {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -35,7 +35,7 @@ const LinkSearchListItem = ({
35
35
  }, jsx(ListItemIcon, {
36
36
  item: item,
37
37
  intl: intl
38
- }), jsx(ItemNameWrapper, null, jsx(ListItemName, null, item.name), jsx(ListItemContext, null, item.container, jsx(ItemTimeStamp, {
38
+ }), jsx(ItemNameWrapper, null, jsx(ListItemName, null, item.name), jsx(ListItemContext, null, item.container && jsx(Fragment, null, item.container, "\xA0 \u2022"), jsx(ItemTimeStamp, {
39
39
  date: transformTimeStamp(intl, item.lastViewedDate, item.lastUpdatedDate)
40
40
  }))));
41
41
  };
@@ -51,7 +51,7 @@ const ItemTimeStamp = props => {
51
51
  return null;
52
52
  }
53
53
 
54
- return jsx(Fragment, null, "\xA0 \u2022", jsx("span", {
54
+ return jsx(Fragment, null, jsx("span", {
55
55
  className: "link-search-timestamp",
56
56
  "data-test-id": "link-search-timestamp"
57
57
  }, "\xA0 ", date.pageAction, " ", date.dateString, " ", date.timeSince || ''));
@@ -84,7 +84,8 @@ class LinkPicker extends PureComponent {
84
84
  lastViewedDate
85
85
  } = items[selectedIndex];
86
86
  const date = transformTimeStamp(intl, lastViewedDate, lastUpdatedDate);
87
- return `${name}, ${container}, ${date === null || date === void 0 ? void 0 : date.pageAction} ${date === null || date === void 0 ? void 0 : date.dateString} ${(date === null || date === void 0 ? void 0 : date.timeSince) || ''}`;
87
+ const formattedDate = [date === null || date === void 0 ? void 0 : date.pageAction, date === null || date === void 0 ? void 0 : date.dateString, date === null || date === void 0 ? void 0 : date.timeSince].filter(Boolean).join(' ');
88
+ return [name, container, formattedDate].filter(Boolean).join(', ');
88
89
  }
89
90
  });
90
91
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -41,7 +41,7 @@ var LinkSearchListItem = function LinkSearchListItem(_ref) {
41
41
  }, jsx(ListItemIcon, {
42
42
  item: item,
43
43
  intl: intl
44
- }), jsx(ItemNameWrapper, null, jsx(ListItemName, null, item.name), jsx(ListItemContext, null, item.container, jsx(ItemTimeStamp, {
44
+ }), jsx(ItemNameWrapper, null, jsx(ListItemName, null, item.name), jsx(ListItemContext, null, item.container && jsx(Fragment, null, item.container, "\xA0 \u2022"), jsx(ItemTimeStamp, {
45
45
  date: transformTimeStamp(intl, item.lastViewedDate, item.lastUpdatedDate)
46
46
  }))));
47
47
  };
@@ -55,7 +55,7 @@ var ItemTimeStamp = function ItemTimeStamp(props) {
55
55
  return null;
56
56
  }
57
57
 
58
- return jsx(Fragment, null, "\xA0 \u2022", jsx("span", {
58
+ return jsx(Fragment, null, jsx("span", {
59
59
  className: "link-search-timestamp",
60
60
  "data-test-id": "link-search-timestamp"
61
61
  }, "\xA0 ", date.pageAction, " ", date.dateString, " ", date.timeSince || ''));
@@ -123,7 +123,8 @@ var LinkPicker = /*#__PURE__*/function (_PureComponent) {
123
123
  lastUpdatedDate = _items$selectedIndex.lastUpdatedDate,
124
124
  lastViewedDate = _items$selectedIndex.lastViewedDate;
125
125
  var date = transformTimeStamp(intl, lastViewedDate, lastUpdatedDate);
126
- return "".concat(name, ", ").concat(container, ", ").concat(date === null || date === void 0 ? void 0 : date.pageAction, " ").concat(date === null || date === void 0 ? void 0 : date.dateString, " ").concat((date === null || date === void 0 ? void 0 : date.timeSince) || '');
126
+ var formattedDate = [date === null || date === void 0 ? void 0 : date.pageAction, date === null || date === void 0 ? void 0 : date.dateString, date === null || date === void 0 ? void 0 : date.timeSince].filter(Boolean).join(' ');
127
+ return [name, container, formattedDate].filter(Boolean).join(', ');
127
128
  }
128
129
  });
129
130
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -8,14 +8,14 @@ export interface LinkSearchListItemData {
8
8
  name: string;
9
9
  /** URL of the resource being linked to */
10
10
  url: string;
11
- /** Context to display in link result */
12
- container: string;
13
11
  /** Icon to display in link result */
14
12
  icon: string | React.ComponentType<{
15
13
  alt: string;
16
14
  }>;
17
15
  /** Alt text describing the icon */
18
16
  iconAlt: string | MessageDescriptor;
17
+ /** Context to display in link result */
18
+ container?: string;
19
19
  /** Optional last view date to display in link result */
20
20
  lastViewedDate?: Date;
21
21
  /** Optional last updated date to display in link result */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/visual-regression": "*",
57
57
  "@atlaskit/webdriver-runner": "*",
58
58
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
59
- "@atlassian/link-picker-atlassian-plugin": "^6.0.0",
59
+ "@atlassian/link-picker-atlassian-plugin": "^7.0.0",
60
60
  "@atlassian/search-provider": "^2.3.0",
61
61
  "@testing-library/react": "^8.0.1",
62
62
  "enzyme": "^3.10.0",