@atlaskit/link-datasource 4.3.1 → 4.4.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 (24) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/ui/assets-modal/search-container/object-schema-select/index.js +27 -2
  3. package/dist/cjs/ui/common/modal/display-view-dropdown/display-view-drop-down.compiled.css +3 -1
  4. package/dist/cjs/ui/common/modal/display-view-dropdown/display-view-drop-down.js +35 -8
  5. package/dist/cjs/ui/common/modal/display-view-dropdown/messages.js +10 -0
  6. package/dist/cjs/ui/common/modal/site-selector/index.js +45 -14
  7. package/dist/cjs/ui/common/modal/site-selector/messages.js +5 -0
  8. package/dist/es2019/ui/assets-modal/search-container/object-schema-select/index.js +25 -2
  9. package/dist/es2019/ui/common/modal/display-view-dropdown/display-view-drop-down.compiled.css +3 -1
  10. package/dist/es2019/ui/common/modal/display-view-dropdown/display-view-drop-down.js +35 -8
  11. package/dist/es2019/ui/common/modal/display-view-dropdown/messages.js +10 -0
  12. package/dist/es2019/ui/common/modal/site-selector/index.js +34 -5
  13. package/dist/es2019/ui/common/modal/site-selector/messages.js +5 -0
  14. package/dist/esm/ui/assets-modal/search-container/object-schema-select/index.js +28 -3
  15. package/dist/esm/ui/common/modal/display-view-dropdown/display-view-drop-down.compiled.css +3 -1
  16. package/dist/esm/ui/common/modal/display-view-dropdown/display-view-drop-down.js +35 -8
  17. package/dist/esm/ui/common/modal/display-view-dropdown/messages.js +10 -0
  18. package/dist/esm/ui/common/modal/site-selector/index.js +45 -14
  19. package/dist/esm/ui/common/modal/site-selector/messages.js +5 -0
  20. package/dist/types/ui/common/modal/display-view-dropdown/messages.d.ts +10 -0
  21. package/dist/types/ui/common/modal/site-selector/messages.d.ts +5 -0
  22. package/dist/types-ts4.5/ui/common/modal/display-view-dropdown/messages.d.ts +10 -0
  23. package/dist/types-ts4.5/ui/common/modal/site-selector/messages.d.ts +5 -0
  24. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 4.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#143100](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/143100)
8
+ [`bc885672e7886`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bc885672e7886) -
9
+ [ux] Behind fg `platform-linking-visual-refresh-sllv` - Updates styles for modal header
10
+
3
11
  ## 4.3.1
4
12
 
5
13
  ### Patch Changes
@@ -18,7 +18,10 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
18
18
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
19
19
  var _debouncePromise = _interopRequireDefault(require("debounce-promise"));
20
20
  var _reactIntlNext = require("react-intl-next");
21
+ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
21
22
  var _form = require("@atlaskit/form");
23
+ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
24
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
25
  var _select = require("@atlaskit/select");
23
26
  var _constants = require("@atlaskit/theme/constants");
24
27
  var _useObjectSchemas2 = require("../../../../hooks/useObjectSchemas");
@@ -26,7 +29,8 @@ var _types = require("../../../../types/assets/types");
26
29
  var _messages = require("./messages");
27
30
  var _utils = require("./utils");
28
31
  var _excluded = ["as", "style"],
29
- _excluded2 = ["onChange", "onFocus"];
32
+ _excluded2 = ["onChange", "onFocus"],
33
+ _excluded3 = ["isOpen"];
30
34
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
31
35
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
36
  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; }
@@ -119,7 +123,28 @@ var AssetsObjectSchemaSelect = exports.AssetsObjectSchemaSelect = function Asset
119
123
  _onChange = _ref4$fieldProps.onChange,
120
124
  onFocus = _ref4$fieldProps.onFocus,
121
125
  restFieldProps = (0, _objectWithoutProperties2.default)(_ref4$fieldProps, _excluded2);
122
- return /*#__PURE__*/React.createElement(_select.AsyncSelect, (0, _extends2.default)({
126
+ return (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(_select.PopupSelect, (0, _extends2.default)({
127
+ autoFocus: true,
128
+ maxMenuWidth: 300,
129
+ minMenuWidth: 300,
130
+ isLoading: objectSchemasLoading,
131
+ options: mapObjectSchemasToOptions(initialObjectSchemas),
132
+ placeholder: formatMessage(_messages.objectSchemaSelectMessages.placeholder),
133
+ onChange: function onChange(newOption) {
134
+ return newOption && _onChange(newOption);
135
+ }
136
+ }, restFieldProps, {
137
+ label: formatMessage(_messages.objectSchemaSelectMessages.placeholder),
138
+ target: function target(_ref5) {
139
+ var _restFieldProps$value;
140
+ var isOpen = _ref5.isOpen,
141
+ triggerProps = (0, _objectWithoutProperties2.default)(_ref5, _excluded3);
142
+ return /*#__PURE__*/React.createElement(_new.default, (0, _extends2.default)({}, triggerProps, {
143
+ isSelected: isOpen,
144
+ iconAfter: _chevronDown.default
145
+ }), ((_restFieldProps$value = restFieldProps.value) === null || _restFieldProps$value === void 0 ? void 0 : _restFieldProps$value.label) || formatMessage(_messages.objectSchemaSelectMessages.placeholder));
146
+ }
147
+ })) : /*#__PURE__*/React.createElement(_select.AsyncSelect, (0, _extends2.default)({
123
148
  autoFocus: true,
124
149
  classNamePrefix: classNamePrefix,
125
150
  isLoading: objectSchemasLoading,
@@ -1,5 +1,7 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._1bsbnklw{width:20pc}
2
+ ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._1bsb1pna{width:420px}
3
+ ._1bsbnklw{width:20pc}
3
4
  ._4t3i11ux{height:140px}
5
+ ._4t3i7iqz{height:87pt}
4
6
  ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
5
7
  ._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
@@ -10,16 +10,19 @@ exports.DisplayViewDropDown = void 0;
10
10
  require("./display-view-drop-down.compiled.css");
11
11
  var _runtime = require("@compiled/react/runtime");
12
12
  var _react = _interopRequireDefault(require("react"));
13
+ var _react2 = require("@compiled/react");
13
14
  var _reactIntlNext = require("react-intl-next");
14
15
  var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
17
  var _compiled = require("@atlaskit/primitives/compiled");
16
18
  var _messages = require("./messages");
17
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
20
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
21
  var styles = {
20
- dropDownItemGroupStyles: "_2rkoglpi _1bsbnklw _4t3i11ux _ca0q1b66 _n3td1b66"
22
+ dropDownItemGroupStylesOld: "_2rkoglpi _1bsbnklw _4t3i11ux _ca0q1b66 _n3td1b66",
23
+ dropDownItemGroupStyles: "_2rkoglpi _1bsb1pna _4t3i7iqz"
21
24
  };
22
- var InlineIcon = /*#__PURE__*/_react.default.createElement("svg", {
25
+ var InlineIconOld = /*#__PURE__*/_react.default.createElement("svg", {
23
26
  xmlns: "http://www.w3.org/2000/svg",
24
27
  width: "24",
25
28
  height: "24",
@@ -31,7 +34,19 @@ var InlineIcon = /*#__PURE__*/_react.default.createElement("svg", {
31
34
  d: "M4 9C2.89543 9 2 9.67155 2 10.5V13.5C2 14.3285 2.89543 15 4 15H20C21.1046 15 22 14.3285 22 13.5V10.5C22 9.67155 21.1046 9 20 9H4ZM4.22222 11.25C4.22222 10.5 4.22222 10.5 5 10.5H7C7.55556 10.5 7.55556 10.5 7.55556 11.25V13C7.55556 13.5 7.55556 13.5 7 13.5H5C4.22222 13.5 4.22222 13.5 4.22222 13V11.25ZM9 12C9 11.7929 9.2239 11.625 9.5 11.625H19.5C19.7761 11.625 20 11.7929 20 12C20 12.2071 19.7761 12.375 19.5 12.375H9.5C9.2239 12.375 9 12.2071 9 12Z",
32
35
  fill: 'currentColor'
33
36
  }));
34
- var ListIcon = /*#__PURE__*/_react.default.createElement("svg", {
37
+ var InlineIcon = /*#__PURE__*/_react.default.createElement("svg", {
38
+ xmlns: "http://www.w3.org/2000/svg",
39
+ width: "24",
40
+ height: "24",
41
+ fill: "none",
42
+ viewBox: "0 0 24 24"
43
+ }, /*#__PURE__*/_react.default.createElement("path", {
44
+ fill: "currentColor",
45
+ fillRule: "evenodd",
46
+ d: "M6 10.5a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 .5.5h2.5v-3H6Zm4 0v3h8a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-8ZM4 11a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-2Z",
47
+ clipRule: "evenodd"
48
+ }));
49
+ var ListIconOld = /*#__PURE__*/_react.default.createElement("svg", {
35
50
  xmlns: "http://www.w3.org/2000/svg",
36
51
  width: "24",
37
52
  height: "24",
@@ -43,6 +58,18 @@ var ListIcon = /*#__PURE__*/_react.default.createElement("svg", {
43
58
  d: "M0 2C0 0.89543 0.895431 0 2 0H13C14.1046 0 15 0.895431 15 2V13C15 14.1046 14.1046 15 13 15H2C0.89543 15 0 14.1046 0 13V2ZM5 6C5 5.44772 5.44772 5 6 5L12 5C12.5523 5 13 5.44772 13 6C13 6.55229 12.5523 7 12 7L6 7C5.44772 7 5 6.55228 5 6ZM6 8C5.44772 8 5 8.44771 5 9C5 9.55228 5.44772 10 6 10L12 10C12.5523 10 13 9.55229 13 9C13 8.44772 12.5523 8 12 8L6 8ZM5 12C5 11.4477 5.44772 11 6 11L12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13L6 13C5.44772 13 5 12.5523 5 12ZM3 7C3.55228 7 4 6.55228 4 6C4 5.44772 3.55228 5 3 5C2.44772 5 2 5.44772 2 6C2 6.55228 2.44772 7 3 7ZM5 3C5 2.44772 5.44772 2 6 2L12 2C12.5523 2 13 2.44772 13 3C13 3.55229 12.5523 4 12 4L6 4C5.44772 4 5 3.55228 5 3ZM3 4C3.55228 4 4 3.55228 4 3C4 2.44772 3.55228 2 3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4ZM4 9C4 9.55229 3.55228 10 3 10C2.44772 10 2 9.55229 2 9C2 8.44771 2.44772 8 3 8C3.55228 8 4 8.44771 4 9ZM3 13C3.55228 13 4 12.5523 4 12C4 11.4477 3.55228 11 3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13Z",
44
59
  fill: 'currentColor'
45
60
  }));
61
+ var ListIcon = /*#__PURE__*/_react.default.createElement("svg", {
62
+ xmlns: "http://www.w3.org/2000/svg",
63
+ width: "24",
64
+ height: "24",
65
+ fill: "none",
66
+ viewBox: "0 0 24 24"
67
+ }, /*#__PURE__*/_react.default.createElement("path", {
68
+ fill: "currentColor",
69
+ fillRule: "evenodd",
70
+ d: "M5 7a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7Zm2-.5a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V7a.5.5 0 0 0-.5-.5H7Zm2.5 3H8V8h1.5v1.5Zm6.5 0h-5V8h5v1.5Zm-6.5 3.25H8v-1.5h1.5v1.5Zm6.5 0h-5v-1.5h5v1.5ZM9.5 16H8v-1.5h1.5V16Zm6.5 0h-5v-1.5h5V16Z",
71
+ clipRule: "evenodd"
72
+ }));
46
73
  var DisplayViewDropDown = exports.DisplayViewDropDown = function DisplayViewDropDown(_ref) {
47
74
  var onViewModeChange = _ref.onViewModeChange,
48
75
  viewMode = _ref.viewMode;
@@ -54,22 +81,22 @@ var DisplayViewDropDown = exports.DisplayViewDropDown = function DisplayViewDrop
54
81
  trigger: triggerText,
55
82
  testId: "datasource-modal--view-drop-down"
56
83
  }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
57
- xcss: styles.dropDownItemGroupStyles
84
+ xcss: (0, _react2.cx)((0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-sllv') ? styles.dropDownItemGroupStyles : styles.dropDownItemGroupStylesOld)
58
85
  }, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItemGroup, null, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
59
86
  testId: "dropdown-item-table",
60
87
  onClick: function onClick() {
61
88
  return onViewModeChange('table');
62
89
  },
63
90
  isSelected: isTable,
64
- description: formatMessage(_messages.displayViewDropDownMessages.viewModeListDescription),
65
- elemBefore: ListIcon
91
+ description: formatMessage((0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-sllv') ? _messages.displayViewDropDownMessages.viewModeListDescription : _messages.displayViewDropDownMessages.viewModeListDescriptionOld),
92
+ elemBefore: (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-sllv') ? ListIcon : ListIconOld
66
93
  }, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.displayViewDropDownMessages.viewModeListLabel)), /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
67
94
  testId: "dropdown-item-inline-link",
68
95
  onClick: function onClick() {
69
96
  return onViewModeChange('inline');
70
97
  },
71
98
  isSelected: !isTable,
72
- description: formatMessage(_messages.displayViewDropDownMessages.viewModeInlineLinkDescription),
73
- elemBefore: InlineIcon
99
+ description: formatMessage((0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-sllv') ? _messages.displayViewDropDownMessages.viewModeInlineLinkDescription : _messages.displayViewDropDownMessages.viewModeInlineLinkDescriptionOld),
100
+ elemBefore: (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-sllv') ? InlineIcon : InlineIconOld
74
101
  }, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.displayViewDropDownMessages.viewModeInlineLinkLabel)))));
75
102
  };
@@ -14,6 +14,11 @@ var displayViewDropDownMessages = exports.displayViewDropDownMessages = (0, _rea
14
14
  viewModeListDescription: {
15
15
  id: 'linkDataSource.jira-issues.configmodal.viewModeListDescription',
16
16
  description: 'Description for list view mode',
17
+ defaultMessage: 'Display the number of search results as a list'
18
+ },
19
+ viewModeListDescriptionOld: {
20
+ id: 'linkDataSource.jira-issues.configmodal.viewModeListDescriptionOld',
21
+ description: 'Description for list view mode',
17
22
  defaultMessage: 'Display search results as a list'
18
23
  },
19
24
  viewModeInlineLinkLabel: {
@@ -24,6 +29,11 @@ var displayViewDropDownMessages = exports.displayViewDropDownMessages = (0, _rea
24
29
  viewModeInlineLinkDescription: {
25
30
  id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescription',
26
31
  description: 'Description for inline link view mode',
32
+ defaultMessage: 'Display the number of search results or as an inline Smart Link'
33
+ },
34
+ viewModeInlineLinkDescriptionOld: {
35
+ id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescriptionOld',
36
+ description: 'Description for inline link view mode',
27
37
  defaultMessage: 'Display the number of search results as an inline Smart Link'
28
38
  }
29
39
  });
@@ -11,14 +11,20 @@ require("./index.compiled.css");
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
16
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
16
17
  var _reactIntlNext = require("react-intl-next");
18
+ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
19
+ var _heading = _interopRequireDefault(require("@atlaskit/heading"));
20
+ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
21
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
22
  var _compiled = require("@atlaskit/primitives/compiled");
18
- var _select = _interopRequireDefault(require("@atlaskit/select"));
23
+ var _select = _interopRequireWildcard(require("@atlaskit/select"));
19
24
  var _messages = require("./messages");
20
- var _excluded = ["width"],
21
- _excluded2 = ["width"];
25
+ var _excluded = ["isOpen"],
26
+ _excluded2 = ["width"],
27
+ _excluded3 = ["width"];
22
28
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
29
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
30
  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; }
@@ -56,14 +62,39 @@ var SiteSelector = exports.SiteSelector = function SiteSelector(props) {
56
62
  };
57
63
  return /*#__PURE__*/React.createElement(_compiled.Box, {
58
64
  xcss: styles.dropdownContainerStyles
59
- }, formatMessage(label), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
65
+ }, (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(_heading.default, {
66
+ size: "medium",
67
+ as: "h1"
68
+ }, formatMessage(label)) : formatMessage(label), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
60
69
  "data-testid": "".concat(testId, "--trigger")
61
- }, /*#__PURE__*/React.createElement(_select.default, {
62
- classNamePrefix: testId,
70
+ }, (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(_select.PopupSelect, {
71
+ searchThreshold: 10,
72
+ maxMenuWidth: 300,
73
+ minMenuWidth: 300,
63
74
  isLoading: !availableSites,
75
+ testId: testId,
64
76
  onChange: onChange,
77
+ value: selectedSiteOption,
78
+ label: formatMessage(_messages.siteSelectorMessages.chooseSite),
65
79
  options: availableSitesOptions,
66
80
  placeholder: formatMessage(_messages.siteSelectorMessages.chooseSite),
81
+ target: function target(_ref) {
82
+ var isOpen = _ref.isOpen,
83
+ triggerProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
84
+ return /*#__PURE__*/React.createElement(_new.default, (0, _extends2.default)({}, triggerProps, {
85
+ isSelected: isOpen,
86
+ iconAfter: _chevronDown.default,
87
+ testId: "".concat(testId, "__control")
88
+ }), (selectedSiteOption === null || selectedSiteOption === void 0 ? void 0 : selectedSiteOption.label) || formatMessage(_messages.siteSelectorMessages.chooseSite));
89
+ }
90
+ }) : /*#__PURE__*/React.createElement(_select.default, {
91
+ classNamePrefix: testId,
92
+ isLoading: !availableSites,
93
+ onChange: onChange,
94
+ options: availableSitesOptions,
95
+ placeholder: formatMessage(_messages.siteSelectorMessages.chooseSiteOld)
96
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
97
+ ,
67
98
  styles: {
68
99
  container: function container(css) {
69
100
  return _objectSpread(_objectSpread({}, css), {}, {
@@ -74,9 +105,9 @@ var SiteSelector = exports.SiteSelector = function SiteSelector(props) {
74
105
  },
75
106
  // prevents the popup menu with available sites from being too narrow
76
107
  // if the selected site is much shorter than the other options
77
- menu: function menu(_ref) {
78
- var width = _ref.width,
79
- css = (0, _objectWithoutProperties2.default)(_ref, _excluded);
108
+ menu: function menu(_ref2) {
109
+ var width = _ref2.width,
110
+ css = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
80
111
  return _objectSpread(_objectSpread({}, css), {}, {
81
112
  minWidth: '100%',
82
113
  width: 'max-content',
@@ -84,9 +115,9 @@ var SiteSelector = exports.SiteSelector = function SiteSelector(props) {
84
115
  fontWeight: "var(--ds-font-weight-medium, 500)"
85
116
  });
86
117
  },
87
- valueContainer: function valueContainer(_ref2) {
88
- var width = _ref2.width,
89
- css = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
118
+ valueContainer: function valueContainer(_ref3) {
119
+ var width = _ref3.width,
120
+ css = (0, _objectWithoutProperties2.default)(_ref3, _excluded3);
90
121
  return _objectSpread(_objectSpread({}, css), {}, {
91
122
  // font-weight has to be overridden here so that it gets applied after the font styles in teh css element above
92
123
  fontWeight: "var(--ds-font-weight-medium, 500)"
@@ -95,6 +126,6 @@ var SiteSelector = exports.SiteSelector = function SiteSelector(props) {
95
126
  },
96
127
  testId: testId,
97
128
  value: selectedSiteOption,
98
- label: formatMessage(_messages.siteSelectorMessages.chooseSite)
129
+ label: formatMessage(_messages.siteSelectorMessages.chooseSiteOld)
99
130
  })));
100
131
  };
@@ -15,6 +15,11 @@ var siteSelectorMessages = exports.siteSelectorMessages = (0, _reactIntlNext.def
15
15
  chooseSite: {
16
16
  id: 'linkDataSource.jira-issues.configmodal.chooseSite',
17
17
  description: 'Label for input letting user know they have to choose a site',
18
+ defaultMessage: 'Select a site'
19
+ },
20
+ chooseSiteOld: {
21
+ id: 'linkDataSource.jira-issues.configmodal.chooseSiteOld',
22
+ description: 'Label for input letting user know they have to choose a site',
18
23
  defaultMessage: 'Choose site'
19
24
  }
20
25
  });
@@ -6,8 +6,11 @@ import * as React from 'react';
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import debounce from 'debounce-promise';
8
8
  import { useIntl } from 'react-intl-next';
9
+ import Button from '@atlaskit/button/new';
9
10
  import { Field } from '@atlaskit/form';
10
- import { AsyncSelect } from '@atlaskit/select';
11
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { AsyncSelect, PopupSelect } from '@atlaskit/select';
11
14
  import { layers } from '@atlaskit/theme/constants';
12
15
  import { useObjectSchemas } from '../../../../hooks/useObjectSchemas';
13
16
  import { objectSchemaKey } from '../../../../types/assets/types';
@@ -84,7 +87,27 @@ export const AssetsObjectSchemaSelect = ({
84
87
  onFocus,
85
88
  ...restFieldProps
86
89
  }
87
- }) => /*#__PURE__*/React.createElement(AsyncSelect, _extends({
90
+ }) => fg('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(PopupSelect, _extends({
91
+ autoFocus: true,
92
+ maxMenuWidth: 300,
93
+ minMenuWidth: 300,
94
+ isLoading: objectSchemasLoading,
95
+ options: mapObjectSchemasToOptions(initialObjectSchemas),
96
+ placeholder: formatMessage(objectSchemaSelectMessages.placeholder),
97
+ onChange: newOption => newOption && onChange(newOption)
98
+ }, restFieldProps, {
99
+ label: formatMessage(objectSchemaSelectMessages.placeholder),
100
+ target: ({
101
+ isOpen,
102
+ ...triggerProps
103
+ }) => {
104
+ var _restFieldProps$value;
105
+ return /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
106
+ isSelected: isOpen,
107
+ iconAfter: ChevronDownIcon
108
+ }), ((_restFieldProps$value = restFieldProps.value) === null || _restFieldProps$value === void 0 ? void 0 : _restFieldProps$value.label) || formatMessage(objectSchemaSelectMessages.placeholder));
109
+ }
110
+ })) : /*#__PURE__*/React.createElement(AsyncSelect, _extends({
88
111
  autoFocus: true,
89
112
  classNamePrefix: classNamePrefix,
90
113
  isLoading: objectSchemasLoading,
@@ -1,5 +1,7 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._1bsbnklw{width:20pc}
2
+ ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._1bsb1pna{width:420px}
3
+ ._1bsbnklw{width:20pc}
3
4
  ._4t3i11ux{height:140px}
5
+ ._4t3i7iqz{height:87pt}
4
6
  ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
5
7
  ._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
@@ -2,14 +2,17 @@
2
2
  import "./display-view-drop-down.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
5
+ import { cx } from '@compiled/react';
5
6
  import { FormattedMessage, useIntl } from 'react-intl-next';
6
7
  import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
7
9
  import { Box } from '@atlaskit/primitives/compiled';
8
10
  import { displayViewDropDownMessages } from './messages';
9
11
  const styles = {
10
- dropDownItemGroupStyles: "_2rkoglpi _1bsbnklw _4t3i11ux _ca0q1b66 _n3td1b66"
12
+ dropDownItemGroupStylesOld: "_2rkoglpi _1bsbnklw _4t3i11ux _ca0q1b66 _n3td1b66",
13
+ dropDownItemGroupStyles: "_2rkoglpi _1bsb1pna _4t3i7iqz"
11
14
  };
12
- const InlineIcon = /*#__PURE__*/React.createElement("svg", {
15
+ const InlineIconOld = /*#__PURE__*/React.createElement("svg", {
13
16
  xmlns: "http://www.w3.org/2000/svg",
14
17
  width: "24",
15
18
  height: "24",
@@ -21,7 +24,19 @@ const InlineIcon = /*#__PURE__*/React.createElement("svg", {
21
24
  d: "M4 9C2.89543 9 2 9.67155 2 10.5V13.5C2 14.3285 2.89543 15 4 15H20C21.1046 15 22 14.3285 22 13.5V10.5C22 9.67155 21.1046 9 20 9H4ZM4.22222 11.25C4.22222 10.5 4.22222 10.5 5 10.5H7C7.55556 10.5 7.55556 10.5 7.55556 11.25V13C7.55556 13.5 7.55556 13.5 7 13.5H5C4.22222 13.5 4.22222 13.5 4.22222 13V11.25ZM9 12C9 11.7929 9.2239 11.625 9.5 11.625H19.5C19.7761 11.625 20 11.7929 20 12C20 12.2071 19.7761 12.375 19.5 12.375H9.5C9.2239 12.375 9 12.2071 9 12Z",
22
25
  fill: 'currentColor'
23
26
  }));
24
- const ListIcon = /*#__PURE__*/React.createElement("svg", {
27
+ const InlineIcon = /*#__PURE__*/React.createElement("svg", {
28
+ xmlns: "http://www.w3.org/2000/svg",
29
+ width: "24",
30
+ height: "24",
31
+ fill: "none",
32
+ viewBox: "0 0 24 24"
33
+ }, /*#__PURE__*/React.createElement("path", {
34
+ fill: "currentColor",
35
+ fillRule: "evenodd",
36
+ d: "M6 10.5a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 .5.5h2.5v-3H6Zm4 0v3h8a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-8ZM4 11a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-2Z",
37
+ clipRule: "evenodd"
38
+ }));
39
+ const ListIconOld = /*#__PURE__*/React.createElement("svg", {
25
40
  xmlns: "http://www.w3.org/2000/svg",
26
41
  width: "24",
27
42
  height: "24",
@@ -33,6 +48,18 @@ const ListIcon = /*#__PURE__*/React.createElement("svg", {
33
48
  d: "M0 2C0 0.89543 0.895431 0 2 0H13C14.1046 0 15 0.895431 15 2V13C15 14.1046 14.1046 15 13 15H2C0.89543 15 0 14.1046 0 13V2ZM5 6C5 5.44772 5.44772 5 6 5L12 5C12.5523 5 13 5.44772 13 6C13 6.55229 12.5523 7 12 7L6 7C5.44772 7 5 6.55228 5 6ZM6 8C5.44772 8 5 8.44771 5 9C5 9.55228 5.44772 10 6 10L12 10C12.5523 10 13 9.55229 13 9C13 8.44772 12.5523 8 12 8L6 8ZM5 12C5 11.4477 5.44772 11 6 11L12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13L6 13C5.44772 13 5 12.5523 5 12ZM3 7C3.55228 7 4 6.55228 4 6C4 5.44772 3.55228 5 3 5C2.44772 5 2 5.44772 2 6C2 6.55228 2.44772 7 3 7ZM5 3C5 2.44772 5.44772 2 6 2L12 2C12.5523 2 13 2.44772 13 3C13 3.55229 12.5523 4 12 4L6 4C5.44772 4 5 3.55228 5 3ZM3 4C3.55228 4 4 3.55228 4 3C4 2.44772 3.55228 2 3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4ZM4 9C4 9.55229 3.55228 10 3 10C2.44772 10 2 9.55229 2 9C2 8.44771 2.44772 8 3 8C3.55228 8 4 8.44771 4 9ZM3 13C3.55228 13 4 12.5523 4 12C4 11.4477 3.55228 11 3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13Z",
34
49
  fill: 'currentColor'
35
50
  }));
51
+ const ListIcon = /*#__PURE__*/React.createElement("svg", {
52
+ xmlns: "http://www.w3.org/2000/svg",
53
+ width: "24",
54
+ height: "24",
55
+ fill: "none",
56
+ viewBox: "0 0 24 24"
57
+ }, /*#__PURE__*/React.createElement("path", {
58
+ fill: "currentColor",
59
+ fillRule: "evenodd",
60
+ d: "M5 7a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7Zm2-.5a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V7a.5.5 0 0 0-.5-.5H7Zm2.5 3H8V8h1.5v1.5Zm6.5 0h-5V8h5v1.5Zm-6.5 3.25H8v-1.5h1.5v1.5Zm6.5 0h-5v-1.5h5v1.5ZM9.5 16H8v-1.5h1.5V16Zm6.5 0h-5v-1.5h5V16Z",
61
+ clipRule: "evenodd"
62
+ }));
36
63
  export const DisplayViewDropDown = ({
37
64
  onViewModeChange,
38
65
  viewMode
@@ -46,18 +73,18 @@ export const DisplayViewDropDown = ({
46
73
  trigger: triggerText,
47
74
  testId: "datasource-modal--view-drop-down"
48
75
  }, /*#__PURE__*/React.createElement(Box, {
49
- xcss: styles.dropDownItemGroupStyles
76
+ xcss: cx(fg('platform-linking-visual-refresh-sllv') ? styles.dropDownItemGroupStyles : styles.dropDownItemGroupStylesOld)
50
77
  }, /*#__PURE__*/React.createElement(DropdownItemGroup, null, /*#__PURE__*/React.createElement(DropdownItem, {
51
78
  testId: "dropdown-item-table",
52
79
  onClick: () => onViewModeChange('table'),
53
80
  isSelected: isTable,
54
- description: formatMessage(displayViewDropDownMessages.viewModeListDescription),
55
- elemBefore: ListIcon
81
+ description: formatMessage(fg('platform-linking-visual-refresh-sllv') ? displayViewDropDownMessages.viewModeListDescription : displayViewDropDownMessages.viewModeListDescriptionOld),
82
+ elemBefore: fg('platform-linking-visual-refresh-sllv') ? ListIcon : ListIconOld
56
83
  }, /*#__PURE__*/React.createElement(FormattedMessage, displayViewDropDownMessages.viewModeListLabel)), /*#__PURE__*/React.createElement(DropdownItem, {
57
84
  testId: "dropdown-item-inline-link",
58
85
  onClick: () => onViewModeChange('inline'),
59
86
  isSelected: !isTable,
60
- description: formatMessage(displayViewDropDownMessages.viewModeInlineLinkDescription),
61
- elemBefore: InlineIcon
87
+ description: formatMessage(fg('platform-linking-visual-refresh-sllv') ? displayViewDropDownMessages.viewModeInlineLinkDescription : displayViewDropDownMessages.viewModeInlineLinkDescriptionOld),
88
+ elemBefore: fg('platform-linking-visual-refresh-sllv') ? InlineIcon : InlineIconOld
62
89
  }, /*#__PURE__*/React.createElement(FormattedMessage, displayViewDropDownMessages.viewModeInlineLinkLabel)))));
63
90
  };
@@ -8,6 +8,11 @@ export const displayViewDropDownMessages = defineMessages({
8
8
  viewModeListDescription: {
9
9
  id: 'linkDataSource.jira-issues.configmodal.viewModeListDescription',
10
10
  description: 'Description for list view mode',
11
+ defaultMessage: 'Display the number of search results as a list'
12
+ },
13
+ viewModeListDescriptionOld: {
14
+ id: 'linkDataSource.jira-issues.configmodal.viewModeListDescriptionOld',
15
+ description: 'Description for list view mode',
11
16
  defaultMessage: 'Display search results as a list'
12
17
  },
13
18
  viewModeInlineLinkLabel: {
@@ -18,6 +23,11 @@ export const displayViewDropDownMessages = defineMessages({
18
23
  viewModeInlineLinkDescription: {
19
24
  id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescription',
20
25
  description: 'Description for inline link view mode',
26
+ defaultMessage: 'Display the number of search results or as an inline Smart Link'
27
+ },
28
+ viewModeInlineLinkDescriptionOld: {
29
+ id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescriptionOld',
30
+ description: 'Description for inline link view mode',
21
31
  defaultMessage: 'Display the number of search results as an inline Smart Link'
22
32
  }
23
33
  });
@@ -1,11 +1,16 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import "./index.compiled.css";
3
4
  import * as React from 'react';
4
5
  import { ax, ix } from "@compiled/react/runtime";
5
6
  import { useMemo } from 'react';
6
7
  import { useIntl } from 'react-intl-next';
8
+ import Button from '@atlaskit/button/new';
9
+ import Heading from '@atlaskit/heading';
10
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
7
12
  import { Box } from '@atlaskit/primitives/compiled';
8
- import Select from '@atlaskit/select';
13
+ import Select, { PopupSelect } from '@atlaskit/select';
9
14
  import { siteSelectorMessages } from './messages';
10
15
  const styles = {
11
16
  dropdownContainerStyles: "_zulpu2gc _1e0c1txw _4cvr1h6o _1tke1ylp"
@@ -37,14 +42,38 @@ export const SiteSelector = props => {
37
42
  };
38
43
  return /*#__PURE__*/React.createElement(Box, {
39
44
  xcss: styles.dropdownContainerStyles
40
- }, formatMessage(label), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
45
+ }, fg('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(Heading, {
46
+ size: "medium",
47
+ as: "h1"
48
+ }, formatMessage(label)) : formatMessage(label), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
41
49
  "data-testid": `${testId}--trigger`
42
- }, /*#__PURE__*/React.createElement(Select, {
43
- classNamePrefix: testId,
50
+ }, fg('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(PopupSelect, {
51
+ searchThreshold: 10,
52
+ maxMenuWidth: 300,
53
+ minMenuWidth: 300,
44
54
  isLoading: !availableSites,
55
+ testId: testId,
45
56
  onChange: onChange,
57
+ value: selectedSiteOption,
58
+ label: formatMessage(siteSelectorMessages.chooseSite),
46
59
  options: availableSitesOptions,
47
60
  placeholder: formatMessage(siteSelectorMessages.chooseSite),
61
+ target: ({
62
+ isOpen,
63
+ ...triggerProps
64
+ }) => /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
65
+ isSelected: isOpen,
66
+ iconAfter: ChevronDownIcon,
67
+ testId: `${testId}__control`
68
+ }), (selectedSiteOption === null || selectedSiteOption === void 0 ? void 0 : selectedSiteOption.label) || formatMessage(siteSelectorMessages.chooseSite))
69
+ }) : /*#__PURE__*/React.createElement(Select, {
70
+ classNamePrefix: testId,
71
+ isLoading: !availableSites,
72
+ onChange: onChange,
73
+ options: availableSitesOptions,
74
+ placeholder: formatMessage(siteSelectorMessages.chooseSiteOld)
75
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
76
+ ,
48
77
  styles: {
49
78
  container: css => ({
50
79
  ...css,
@@ -75,6 +104,6 @@ export const SiteSelector = props => {
75
104
  },
76
105
  testId: testId,
77
106
  value: selectedSiteOption,
78
- label: formatMessage(siteSelectorMessages.chooseSite)
107
+ label: formatMessage(siteSelectorMessages.chooseSiteOld)
79
108
  })));
80
109
  };
@@ -9,6 +9,11 @@ export const siteSelectorMessages = defineMessages({
9
9
  chooseSite: {
10
10
  id: 'linkDataSource.jira-issues.configmodal.chooseSite',
11
11
  description: 'Label for input letting user know they have to choose a site',
12
+ defaultMessage: 'Select a site'
13
+ },
14
+ chooseSiteOld: {
15
+ id: 'linkDataSource.jira-issues.configmodal.chooseSiteOld',
16
+ description: 'Label for input letting user know they have to choose a site',
12
17
  defaultMessage: 'Choose site'
13
18
  }
14
19
  });
@@ -4,7 +4,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import _extends from "@babel/runtime/helpers/extends";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
6
6
  var _excluded = ["as", "style"],
7
- _excluded2 = ["onChange", "onFocus"];
7
+ _excluded2 = ["onChange", "onFocus"],
8
+ _excluded3 = ["isOpen"];
8
9
  import "./index.compiled.css";
9
10
  import { forwardRef } from 'react';
10
11
  import * as React from 'react';
@@ -14,8 +15,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
14
15
  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; }
15
16
  import debounce from 'debounce-promise';
16
17
  import { useIntl } from 'react-intl-next';
18
+ import Button from '@atlaskit/button/new';
17
19
  import { Field } from '@atlaskit/form';
18
- import { AsyncSelect } from '@atlaskit/select';
20
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
21
+ import { fg } from '@atlaskit/platform-feature-flags';
22
+ import { AsyncSelect, PopupSelect } from '@atlaskit/select';
19
23
  import { layers } from '@atlaskit/theme/constants';
20
24
  import { useObjectSchemas } from '../../../../hooks/useObjectSchemas';
21
25
  import { objectSchemaKey } from '../../../../types/assets/types';
@@ -110,7 +114,28 @@ export var AssetsObjectSchemaSelect = function AssetsObjectSchemaSelect(_ref2) {
110
114
  _onChange = _ref4$fieldProps.onChange,
111
115
  onFocus = _ref4$fieldProps.onFocus,
112
116
  restFieldProps = _objectWithoutProperties(_ref4$fieldProps, _excluded2);
113
- return /*#__PURE__*/React.createElement(AsyncSelect, _extends({
117
+ return fg('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(PopupSelect, _extends({
118
+ autoFocus: true,
119
+ maxMenuWidth: 300,
120
+ minMenuWidth: 300,
121
+ isLoading: objectSchemasLoading,
122
+ options: mapObjectSchemasToOptions(initialObjectSchemas),
123
+ placeholder: formatMessage(objectSchemaSelectMessages.placeholder),
124
+ onChange: function onChange(newOption) {
125
+ return newOption && _onChange(newOption);
126
+ }
127
+ }, restFieldProps, {
128
+ label: formatMessage(objectSchemaSelectMessages.placeholder),
129
+ target: function target(_ref5) {
130
+ var _restFieldProps$value;
131
+ var isOpen = _ref5.isOpen,
132
+ triggerProps = _objectWithoutProperties(_ref5, _excluded3);
133
+ return /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
134
+ isSelected: isOpen,
135
+ iconAfter: ChevronDownIcon
136
+ }), ((_restFieldProps$value = restFieldProps.value) === null || _restFieldProps$value === void 0 ? void 0 : _restFieldProps$value.label) || formatMessage(objectSchemaSelectMessages.placeholder));
137
+ }
138
+ })) : /*#__PURE__*/React.createElement(AsyncSelect, _extends({
114
139
  autoFocus: true,
115
140
  classNamePrefix: classNamePrefix,
116
141
  isLoading: objectSchemasLoading,
@@ -1,5 +1,7 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._1bsbnklw{width:20pc}
2
+ ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._1bsb1pna{width:420px}
3
+ ._1bsbnklw{width:20pc}
3
4
  ._4t3i11ux{height:140px}
5
+ ._4t3i7iqz{height:87pt}
4
6
  ._ca0q1b66{padding-top:var(--ds-space-050,4px)}
5
7
  ._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
@@ -2,14 +2,17 @@
2
2
  import "./display-view-drop-down.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
5
+ import { cx } from '@compiled/react';
5
6
  import { FormattedMessage, useIntl } from 'react-intl-next';
6
7
  import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
7
9
  import { Box } from '@atlaskit/primitives/compiled';
8
10
  import { displayViewDropDownMessages } from './messages';
9
11
  var styles = {
10
- dropDownItemGroupStyles: "_2rkoglpi _1bsbnklw _4t3i11ux _ca0q1b66 _n3td1b66"
12
+ dropDownItemGroupStylesOld: "_2rkoglpi _1bsbnklw _4t3i11ux _ca0q1b66 _n3td1b66",
13
+ dropDownItemGroupStyles: "_2rkoglpi _1bsb1pna _4t3i7iqz"
11
14
  };
12
- var InlineIcon = /*#__PURE__*/React.createElement("svg", {
15
+ var InlineIconOld = /*#__PURE__*/React.createElement("svg", {
13
16
  xmlns: "http://www.w3.org/2000/svg",
14
17
  width: "24",
15
18
  height: "24",
@@ -21,7 +24,19 @@ var InlineIcon = /*#__PURE__*/React.createElement("svg", {
21
24
  d: "M4 9C2.89543 9 2 9.67155 2 10.5V13.5C2 14.3285 2.89543 15 4 15H20C21.1046 15 22 14.3285 22 13.5V10.5C22 9.67155 21.1046 9 20 9H4ZM4.22222 11.25C4.22222 10.5 4.22222 10.5 5 10.5H7C7.55556 10.5 7.55556 10.5 7.55556 11.25V13C7.55556 13.5 7.55556 13.5 7 13.5H5C4.22222 13.5 4.22222 13.5 4.22222 13V11.25ZM9 12C9 11.7929 9.2239 11.625 9.5 11.625H19.5C19.7761 11.625 20 11.7929 20 12C20 12.2071 19.7761 12.375 19.5 12.375H9.5C9.2239 12.375 9 12.2071 9 12Z",
22
25
  fill: 'currentColor'
23
26
  }));
24
- var ListIcon = /*#__PURE__*/React.createElement("svg", {
27
+ var InlineIcon = /*#__PURE__*/React.createElement("svg", {
28
+ xmlns: "http://www.w3.org/2000/svg",
29
+ width: "24",
30
+ height: "24",
31
+ fill: "none",
32
+ viewBox: "0 0 24 24"
33
+ }, /*#__PURE__*/React.createElement("path", {
34
+ fill: "currentColor",
35
+ fillRule: "evenodd",
36
+ d: "M6 10.5a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 .5.5h2.5v-3H6Zm4 0v3h8a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-8ZM4 11a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-2Z",
37
+ clipRule: "evenodd"
38
+ }));
39
+ var ListIconOld = /*#__PURE__*/React.createElement("svg", {
25
40
  xmlns: "http://www.w3.org/2000/svg",
26
41
  width: "24",
27
42
  height: "24",
@@ -33,6 +48,18 @@ var ListIcon = /*#__PURE__*/React.createElement("svg", {
33
48
  d: "M0 2C0 0.89543 0.895431 0 2 0H13C14.1046 0 15 0.895431 15 2V13C15 14.1046 14.1046 15 13 15H2C0.89543 15 0 14.1046 0 13V2ZM5 6C5 5.44772 5.44772 5 6 5L12 5C12.5523 5 13 5.44772 13 6C13 6.55229 12.5523 7 12 7L6 7C5.44772 7 5 6.55228 5 6ZM6 8C5.44772 8 5 8.44771 5 9C5 9.55228 5.44772 10 6 10L12 10C12.5523 10 13 9.55229 13 9C13 8.44772 12.5523 8 12 8L6 8ZM5 12C5 11.4477 5.44772 11 6 11L12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13L6 13C5.44772 13 5 12.5523 5 12ZM3 7C3.55228 7 4 6.55228 4 6C4 5.44772 3.55228 5 3 5C2.44772 5 2 5.44772 2 6C2 6.55228 2.44772 7 3 7ZM5 3C5 2.44772 5.44772 2 6 2L12 2C12.5523 2 13 2.44772 13 3C13 3.55229 12.5523 4 12 4L6 4C5.44772 4 5 3.55228 5 3ZM3 4C3.55228 4 4 3.55228 4 3C4 2.44772 3.55228 2 3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4ZM4 9C4 9.55229 3.55228 10 3 10C2.44772 10 2 9.55229 2 9C2 8.44771 2.44772 8 3 8C3.55228 8 4 8.44771 4 9ZM3 13C3.55228 13 4 12.5523 4 12C4 11.4477 3.55228 11 3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13Z",
34
49
  fill: 'currentColor'
35
50
  }));
51
+ var ListIcon = /*#__PURE__*/React.createElement("svg", {
52
+ xmlns: "http://www.w3.org/2000/svg",
53
+ width: "24",
54
+ height: "24",
55
+ fill: "none",
56
+ viewBox: "0 0 24 24"
57
+ }, /*#__PURE__*/React.createElement("path", {
58
+ fill: "currentColor",
59
+ fillRule: "evenodd",
60
+ d: "M5 7a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7Zm2-.5a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V7a.5.5 0 0 0-.5-.5H7Zm2.5 3H8V8h1.5v1.5Zm6.5 0h-5V8h5v1.5Zm-6.5 3.25H8v-1.5h1.5v1.5Zm6.5 0h-5v-1.5h5v1.5ZM9.5 16H8v-1.5h1.5V16Zm6.5 0h-5v-1.5h5V16Z",
61
+ clipRule: "evenodd"
62
+ }));
36
63
  export var DisplayViewDropDown = function DisplayViewDropDown(_ref) {
37
64
  var onViewModeChange = _ref.onViewModeChange,
38
65
  viewMode = _ref.viewMode;
@@ -44,22 +71,22 @@ export var DisplayViewDropDown = function DisplayViewDropDown(_ref) {
44
71
  trigger: triggerText,
45
72
  testId: "datasource-modal--view-drop-down"
46
73
  }, /*#__PURE__*/React.createElement(Box, {
47
- xcss: styles.dropDownItemGroupStyles
74
+ xcss: cx(fg('platform-linking-visual-refresh-sllv') ? styles.dropDownItemGroupStyles : styles.dropDownItemGroupStylesOld)
48
75
  }, /*#__PURE__*/React.createElement(DropdownItemGroup, null, /*#__PURE__*/React.createElement(DropdownItem, {
49
76
  testId: "dropdown-item-table",
50
77
  onClick: function onClick() {
51
78
  return onViewModeChange('table');
52
79
  },
53
80
  isSelected: isTable,
54
- description: formatMessage(displayViewDropDownMessages.viewModeListDescription),
55
- elemBefore: ListIcon
81
+ description: formatMessage(fg('platform-linking-visual-refresh-sllv') ? displayViewDropDownMessages.viewModeListDescription : displayViewDropDownMessages.viewModeListDescriptionOld),
82
+ elemBefore: fg('platform-linking-visual-refresh-sllv') ? ListIcon : ListIconOld
56
83
  }, /*#__PURE__*/React.createElement(FormattedMessage, displayViewDropDownMessages.viewModeListLabel)), /*#__PURE__*/React.createElement(DropdownItem, {
57
84
  testId: "dropdown-item-inline-link",
58
85
  onClick: function onClick() {
59
86
  return onViewModeChange('inline');
60
87
  },
61
88
  isSelected: !isTable,
62
- description: formatMessage(displayViewDropDownMessages.viewModeInlineLinkDescription),
63
- elemBefore: InlineIcon
89
+ description: formatMessage(fg('platform-linking-visual-refresh-sllv') ? displayViewDropDownMessages.viewModeInlineLinkDescription : displayViewDropDownMessages.viewModeInlineLinkDescriptionOld),
90
+ elemBefore: fg('platform-linking-visual-refresh-sllv') ? InlineIcon : InlineIconOld
64
91
  }, /*#__PURE__*/React.createElement(FormattedMessage, displayViewDropDownMessages.viewModeInlineLinkLabel)))));
65
92
  };
@@ -8,6 +8,11 @@ export var displayViewDropDownMessages = defineMessages({
8
8
  viewModeListDescription: {
9
9
  id: 'linkDataSource.jira-issues.configmodal.viewModeListDescription',
10
10
  description: 'Description for list view mode',
11
+ defaultMessage: 'Display the number of search results as a list'
12
+ },
13
+ viewModeListDescriptionOld: {
14
+ id: 'linkDataSource.jira-issues.configmodal.viewModeListDescriptionOld',
15
+ description: 'Description for list view mode',
11
16
  defaultMessage: 'Display search results as a list'
12
17
  },
13
18
  viewModeInlineLinkLabel: {
@@ -18,6 +23,11 @@ export var displayViewDropDownMessages = defineMessages({
18
23
  viewModeInlineLinkDescription: {
19
24
  id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescription',
20
25
  description: 'Description for inline link view mode',
26
+ defaultMessage: 'Display the number of search results or as an inline Smart Link'
27
+ },
28
+ viewModeInlineLinkDescriptionOld: {
29
+ id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescriptionOld',
30
+ description: 'Description for inline link view mode',
21
31
  defaultMessage: 'Display the number of search results as an inline Smart Link'
22
32
  }
23
33
  });
@@ -1,8 +1,10 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["width"],
5
- _excluded2 = ["width"];
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
+ var _excluded = ["isOpen"],
6
+ _excluded2 = ["width"],
7
+ _excluded3 = ["width"];
6
8
  import "./index.compiled.css";
7
9
  import * as React from 'react';
8
10
  import { ax, ix } from "@compiled/react/runtime";
@@ -10,8 +12,12 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
10
12
  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
13
  import { useMemo } from 'react';
12
14
  import { useIntl } from 'react-intl-next';
15
+ import Button from '@atlaskit/button/new';
16
+ import Heading from '@atlaskit/heading';
17
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
18
+ import { fg } from '@atlaskit/platform-feature-flags';
13
19
  import { Box } from '@atlaskit/primitives/compiled';
14
- import Select from '@atlaskit/select';
20
+ import Select, { PopupSelect } from '@atlaskit/select';
15
21
  import { siteSelectorMessages } from './messages';
16
22
  var styles = {
17
23
  dropdownContainerStyles: "_zulpu2gc _1e0c1txw _4cvr1h6o _1tke1ylp"
@@ -46,14 +52,39 @@ export var SiteSelector = function SiteSelector(props) {
46
52
  };
47
53
  return /*#__PURE__*/React.createElement(Box, {
48
54
  xcss: styles.dropdownContainerStyles
49
- }, formatMessage(label), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
55
+ }, fg('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(Heading, {
56
+ size: "medium",
57
+ as: "h1"
58
+ }, formatMessage(label)) : formatMessage(label), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
50
59
  "data-testid": "".concat(testId, "--trigger")
51
- }, /*#__PURE__*/React.createElement(Select, {
52
- classNamePrefix: testId,
60
+ }, fg('platform-linking-visual-refresh-sllv') ? /*#__PURE__*/React.createElement(PopupSelect, {
61
+ searchThreshold: 10,
62
+ maxMenuWidth: 300,
63
+ minMenuWidth: 300,
53
64
  isLoading: !availableSites,
65
+ testId: testId,
54
66
  onChange: onChange,
67
+ value: selectedSiteOption,
68
+ label: formatMessage(siteSelectorMessages.chooseSite),
55
69
  options: availableSitesOptions,
56
70
  placeholder: formatMessage(siteSelectorMessages.chooseSite),
71
+ target: function target(_ref) {
72
+ var isOpen = _ref.isOpen,
73
+ triggerProps = _objectWithoutProperties(_ref, _excluded);
74
+ return /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
75
+ isSelected: isOpen,
76
+ iconAfter: ChevronDownIcon,
77
+ testId: "".concat(testId, "__control")
78
+ }), (selectedSiteOption === null || selectedSiteOption === void 0 ? void 0 : selectedSiteOption.label) || formatMessage(siteSelectorMessages.chooseSite));
79
+ }
80
+ }) : /*#__PURE__*/React.createElement(Select, {
81
+ classNamePrefix: testId,
82
+ isLoading: !availableSites,
83
+ onChange: onChange,
84
+ options: availableSitesOptions,
85
+ placeholder: formatMessage(siteSelectorMessages.chooseSiteOld)
86
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
87
+ ,
57
88
  styles: {
58
89
  container: function container(css) {
59
90
  return _objectSpread(_objectSpread({}, css), {}, {
@@ -64,9 +95,9 @@ export var SiteSelector = function SiteSelector(props) {
64
95
  },
65
96
  // prevents the popup menu with available sites from being too narrow
66
97
  // if the selected site is much shorter than the other options
67
- menu: function menu(_ref) {
68
- var width = _ref.width,
69
- css = _objectWithoutProperties(_ref, _excluded);
98
+ menu: function menu(_ref2) {
99
+ var width = _ref2.width,
100
+ css = _objectWithoutProperties(_ref2, _excluded2);
70
101
  return _objectSpread(_objectSpread({}, css), {}, {
71
102
  minWidth: '100%',
72
103
  width: 'max-content',
@@ -74,9 +105,9 @@ export var SiteSelector = function SiteSelector(props) {
74
105
  fontWeight: "var(--ds-font-weight-medium, 500)"
75
106
  });
76
107
  },
77
- valueContainer: function valueContainer(_ref2) {
78
- var width = _ref2.width,
79
- css = _objectWithoutProperties(_ref2, _excluded2);
108
+ valueContainer: function valueContainer(_ref3) {
109
+ var width = _ref3.width,
110
+ css = _objectWithoutProperties(_ref3, _excluded3);
80
111
  return _objectSpread(_objectSpread({}, css), {}, {
81
112
  // font-weight has to be overridden here so that it gets applied after the font styles in teh css element above
82
113
  fontWeight: "var(--ds-font-weight-medium, 500)"
@@ -85,6 +116,6 @@ export var SiteSelector = function SiteSelector(props) {
85
116
  },
86
117
  testId: testId,
87
118
  value: selectedSiteOption,
88
- label: formatMessage(siteSelectorMessages.chooseSite)
119
+ label: formatMessage(siteSelectorMessages.chooseSiteOld)
89
120
  })));
90
121
  };
@@ -9,6 +9,11 @@ export var siteSelectorMessages = defineMessages({
9
9
  chooseSite: {
10
10
  id: 'linkDataSource.jira-issues.configmodal.chooseSite',
11
11
  description: 'Label for input letting user know they have to choose a site',
12
+ defaultMessage: 'Select a site'
13
+ },
14
+ chooseSiteOld: {
15
+ id: 'linkDataSource.jira-issues.configmodal.chooseSiteOld',
16
+ description: 'Label for input letting user know they have to choose a site',
12
17
  defaultMessage: 'Choose site'
13
18
  }
14
19
  });
@@ -9,6 +9,11 @@ export declare const displayViewDropDownMessages: {
9
9
  description: string;
10
10
  defaultMessage: string;
11
11
  };
12
+ viewModeListDescriptionOld: {
13
+ id: string;
14
+ description: string;
15
+ defaultMessage: string;
16
+ };
12
17
  viewModeInlineLinkLabel: {
13
18
  id: string;
14
19
  description: string;
@@ -19,4 +24,9 @@ export declare const displayViewDropDownMessages: {
19
24
  description: string;
20
25
  defaultMessage: string;
21
26
  };
27
+ viewModeInlineLinkDescriptionOld: {
28
+ id: string;
29
+ description: string;
30
+ defaultMessage: string;
31
+ };
22
32
  };
@@ -9,4 +9,9 @@ export declare const siteSelectorMessages: {
9
9
  description: string;
10
10
  defaultMessage: string;
11
11
  };
12
+ chooseSiteOld: {
13
+ id: string;
14
+ description: string;
15
+ defaultMessage: string;
16
+ };
12
17
  };
@@ -9,6 +9,11 @@ export declare const displayViewDropDownMessages: {
9
9
  description: string;
10
10
  defaultMessage: string;
11
11
  };
12
+ viewModeListDescriptionOld: {
13
+ id: string;
14
+ description: string;
15
+ defaultMessage: string;
16
+ };
12
17
  viewModeInlineLinkLabel: {
13
18
  id: string;
14
19
  description: string;
@@ -19,4 +24,9 @@ export declare const displayViewDropDownMessages: {
19
24
  description: string;
20
25
  defaultMessage: string;
21
26
  };
27
+ viewModeInlineLinkDescriptionOld: {
28
+ id: string;
29
+ description: string;
30
+ defaultMessage: string;
31
+ };
22
32
  };
@@ -9,4 +9,9 @@ export declare const siteSelectorMessages: {
9
9
  description: string;
10
10
  defaultMessage: string;
11
11
  };
12
+ chooseSiteOld: {
13
+ id: string;
14
+ description: string;
15
+ defaultMessage: string;
16
+ };
12
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "4.3.1",
3
+ "version": "4.4.0",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -64,7 +64,7 @@
64
64
  "@atlaskit/link": "^3.1.0",
65
65
  "@atlaskit/link-client-extension": "^4.0.0",
66
66
  "@atlaskit/linking-common": "^8.0.0",
67
- "@atlaskit/linking-types": "^9.8.0",
67
+ "@atlaskit/linking-types": "^9.9.0",
68
68
  "@atlaskit/logo": "^16.0.0",
69
69
  "@atlaskit/lozenge": "^12.2.0",
70
70
  "@atlaskit/modal-dialog": "^14.1.0",