@atlaskit/link-picker 1.22.2 → 1.23.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,15 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 1.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`5b744a84924`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5b744a84924) - [ux] Support for an empty state in LinkPicker, and implementation of empty state for the link-picker-atlassian-plugin
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 1.22.2
4
14
 
5
15
  ### Patch Changes
@@ -88,7 +88,7 @@ var LinkInputField = (0, _analytics2.withInputFieldTracking)(_textInput.default,
88
88
  });
89
89
  var DisplayTextInputField = (0, _analytics2.withInputFieldTracking)(_textInput.default, 'displayText');
90
90
  function LinkPicker(_ref) {
91
- var _errorFallback;
91
+ var _activePlugin$errorFa, _activePlugin$errorFa2;
92
92
  var onSubmit = _ref.onSubmit,
93
93
  onCancel = _ref.onCancel,
94
94
  onContentResize = _ref.onContentResize,
@@ -122,7 +122,6 @@ function LinkPicker(_ref) {
122
122
  tabs = _usePlugins.tabs,
123
123
  error = _usePlugins.error,
124
124
  retry = _usePlugins.retry,
125
- errorFallback = _usePlugins.errorFallback,
126
125
  pluginAction = _usePlugins.pluginAction;
127
126
  var fixListHeightProps = (0, _useFixHeight.default)(isLoading);
128
127
  var isEditing = !!initUrl;
@@ -368,8 +367,9 @@ function LinkPicker(_ref) {
368
367
  onSelect: handleSelected,
369
368
  onChange: handleSearchListOnChange,
370
369
  onKeyDown: handleKeyDown,
371
- hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length)
372
- }), error && ((_errorFallback = errorFallback === null || errorFallback === void 0 ? void 0 : errorFallback(error, retry)) !== null && _errorFallback !== void 0 ? _errorFallback : (0, _react2.jsx)(_linkSearchError.default, null)))), (0, _react2.jsx)(_formFooter.default, {
370
+ hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
371
+ activePlugin: activePlugin
372
+ }), error && ((_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : (0, _react2.jsx)(_linkSearchError.default, null)))), (0, _react2.jsx)(_formFooter.default, {
373
373
  error: error,
374
374
  items: items,
375
375
  state: queryState,
@@ -11,6 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
12
  var _react = require("react");
13
13
  var _react2 = require("@emotion/react");
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _reactIntlNext = require("react-intl-next");
15
16
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
16
17
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
@@ -19,7 +20,8 @@ var _styled = require("./styled");
19
20
  var _linkSearchNoResults = _interopRequireWildcard(require("./link-search-no-results"));
20
21
  var _useTrackResultsShown = require("./use-track-results-shown");
21
22
  var _utils = require("../utils");
22
- var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "role", "id", "hasSearchTerm"];
23
+ var _styled2 = require("./link-search-no-results/styled");
24
+ var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "role", "id", "hasSearchTerm", "activePlugin"];
23
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
27
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -62,6 +64,7 @@ var LinkSearchList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
62
64
  role = _ref.role,
63
65
  id = _ref.id,
64
66
  hasSearchTerm = _ref.hasSearchTerm,
67
+ activePlugin = _ref.activePlugin,
65
68
  restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
66
69
  var itemsContent;
67
70
  var loadingContent;
@@ -109,7 +112,17 @@ var LinkSearchList = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
109
112
  }
110
113
  }, [activeIndex, items, onChange, onKeyDown]);
111
114
  if ((items === null || items === void 0 ? void 0 : items.length) === 0) {
112
- return (0, _react2.jsx)(_linkSearchNoResults.default, null);
115
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-picker.enable-empty-state')) {
116
+ if (hasSearchTerm) {
117
+ return (0, _react2.jsx)(_linkSearchNoResults.default, null);
118
+ } else {
119
+ return (0, _react2.jsx)("div", {
120
+ css: _styled2.emptyStateNoResultsWrapper
121
+ }, activePlugin !== null && activePlugin !== void 0 && activePlugin.emptyStateNoResults ? activePlugin.emptyStateNoResults() : null);
122
+ }
123
+ } else {
124
+ return (0, _react2.jsx)(_linkSearchNoResults.default, null);
125
+ }
113
126
  }
114
127
  if (items && items.length > 0) {
115
128
  itemsContent = (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("div", {
@@ -4,9 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.emptyStateWrapperStyles = void 0;
7
+ exports.emptyStateWrapperStyles = exports.emptyStateNoResultsWrapper = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
- var _templateObject;
10
+ var _templateObject, _templateObject2;
11
11
  var emptyStateWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & p {\n margin: 0;\n }\n"])));
12
- exports.emptyStateWrapperStyles = emptyStateWrapperStyles;
12
+ exports.emptyStateWrapperStyles = emptyStateWrapperStyles;
13
+ var emptyStateNoResultsWrapper = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n min-height: ", ";\n"])), "var(--ds-space-200, 16px)");
14
+ exports.emptyStateNoResultsWrapper = emptyStateNoResultsWrapper;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.22.2",
3
+ "version": "1.23.0",
4
4
  "sideEffects": false
5
5
  }
@@ -89,7 +89,7 @@ function LinkPicker({
89
89
  hideDisplayText,
90
90
  featureFlags
91
91
  }) {
92
- var _errorFallback;
92
+ var _activePlugin$errorFa, _activePlugin$errorFa2;
93
93
  const {
94
94
  createAnalyticsEvent
95
95
  } = useAnalyticsEvents();
@@ -116,7 +116,6 @@ function LinkPicker({
116
116
  tabs,
117
117
  error,
118
118
  retry,
119
- errorFallback,
120
119
  pluginAction
121
120
  } = usePlugins(queryState, activeTab, plugins);
122
121
  const fixListHeightProps = useFixHeight(isLoading);
@@ -362,8 +361,9 @@ function LinkPicker({
362
361
  onSelect: handleSelected,
363
362
  onChange: handleSearchListOnChange,
364
363
  onKeyDown: handleKeyDown,
365
- hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length)
366
- }), error && ((_errorFallback = errorFallback === null || errorFallback === void 0 ? void 0 : errorFallback(error, retry)) !== null && _errorFallback !== void 0 ? _errorFallback : jsx(LinkSearchError, null)))), jsx(FormFooter, {
364
+ hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
365
+ activePlugin: activePlugin
366
+ }), error && ((_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : jsx(LinkSearchError, null)))), jsx(FormFooter, {
367
367
  error: error,
368
368
  items: items,
369
369
  state: queryState,
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
3
  import { forwardRef, Fragment, useCallback, useRef } from 'react';
4
4
  import { jsx } from '@emotion/react';
5
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
6
  import { defineMessages, FormattedMessage } from 'react-intl-next';
6
7
  import Spinner from '@atlaskit/spinner';
7
8
  import VisuallyHidden from '@atlaskit/visually-hidden';
@@ -10,6 +11,7 @@ import { listContainerStyles, spinnerContainerStyles, listStyles, listTitleStyle
10
11
  import LinkSearchNoResults, { testIds as noResultsTestIds } from './link-search-no-results';
11
12
  import { useTrackResultsShown } from './use-track-results-shown';
12
13
  import { handleNavKeyDown } from '../utils';
14
+ import { emptyStateNoResultsWrapper } from './link-search-no-results/styled';
13
15
  export const messages = defineMessages({
14
16
  titleRecentlyViewed: {
15
17
  id: 'fabric.linkPicker.listTitle.recentlyViewed',
@@ -47,6 +49,7 @@ const LinkSearchList = /*#__PURE__*/forwardRef(({
47
49
  role,
48
50
  id,
49
51
  hasSearchTerm,
52
+ activePlugin,
50
53
  ...restProps
51
54
  }, ref) => {
52
55
  let itemsContent;
@@ -95,7 +98,17 @@ const LinkSearchList = /*#__PURE__*/forwardRef(({
95
98
  }
96
99
  }, [activeIndex, items, onChange, onKeyDown]);
97
100
  if ((items === null || items === void 0 ? void 0 : items.length) === 0) {
98
- return jsx(LinkSearchNoResults, null);
101
+ if (getBooleanFF('platform.linking-platform.link-picker.enable-empty-state')) {
102
+ if (hasSearchTerm) {
103
+ return jsx(LinkSearchNoResults, null);
104
+ } else {
105
+ return jsx("div", {
106
+ css: emptyStateNoResultsWrapper
107
+ }, activePlugin !== null && activePlugin !== void 0 && activePlugin.emptyStateNoResults ? activePlugin.emptyStateNoResults() : null);
108
+ }
109
+ } else {
110
+ return jsx(LinkSearchNoResults, null);
111
+ }
99
112
  }
100
113
  if (items && items.length > 0) {
101
114
  itemsContent = jsx(Fragment, null, jsx("div", {
@@ -3,4 +3,7 @@ export const emptyStateWrapperStyles = css`
3
3
  & p {
4
4
  margin: 0;
5
5
  }
6
+ `;
7
+ export const emptyStateNoResultsWrapper = css`
8
+ min-height: ${"var(--ds-space-200, 16px)"};
6
9
  `;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.22.2",
3
+ "version": "1.23.0",
4
4
  "sideEffects": false
5
5
  }
@@ -77,7 +77,7 @@ var LinkInputField = withInputFieldTracking(TextInput, 'link', function (event,
77
77
  });
78
78
  var DisplayTextInputField = withInputFieldTracking(TextInput, 'displayText');
79
79
  function LinkPicker(_ref) {
80
- var _errorFallback;
80
+ var _activePlugin$errorFa, _activePlugin$errorFa2;
81
81
  var onSubmit = _ref.onSubmit,
82
82
  onCancel = _ref.onCancel,
83
83
  onContentResize = _ref.onContentResize,
@@ -111,7 +111,6 @@ function LinkPicker(_ref) {
111
111
  tabs = _usePlugins.tabs,
112
112
  error = _usePlugins.error,
113
113
  retry = _usePlugins.retry,
114
- errorFallback = _usePlugins.errorFallback,
115
114
  pluginAction = _usePlugins.pluginAction;
116
115
  var fixListHeightProps = useFixHeight(isLoading);
117
116
  var isEditing = !!initUrl;
@@ -357,8 +356,9 @@ function LinkPicker(_ref) {
357
356
  onSelect: handleSelected,
358
357
  onChange: handleSearchListOnChange,
359
358
  onKeyDown: handleKeyDown,
360
- hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length)
361
- }), error && ((_errorFallback = errorFallback === null || errorFallback === void 0 ? void 0 : errorFallback(error, retry)) !== null && _errorFallback !== void 0 ? _errorFallback : jsx(LinkSearchError, null)))), jsx(FormFooter, {
359
+ hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
360
+ activePlugin: activePlugin
361
+ }), error && ((_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : jsx(LinkSearchError, null)))), jsx(FormFooter, {
362
362
  error: error,
363
363
  items: items,
364
364
  state: queryState,
@@ -1,12 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "role", "id", "hasSearchTerm"];
4
+ var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "role", "id", "hasSearchTerm", "activePlugin"];
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  /** @jsx jsx */
8
8
  import { forwardRef, Fragment, useCallback, useRef } from 'react';
9
9
  import { jsx } from '@emotion/react';
10
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
10
11
  import { defineMessages, FormattedMessage } from 'react-intl-next';
11
12
  import Spinner from '@atlaskit/spinner';
12
13
  import VisuallyHidden from '@atlaskit/visually-hidden';
@@ -15,6 +16,7 @@ import { listContainerStyles, spinnerContainerStyles, listStyles, listTitleStyle
15
16
  import LinkSearchNoResults, { testIds as noResultsTestIds } from './link-search-no-results';
16
17
  import { useTrackResultsShown } from './use-track-results-shown';
17
18
  import { handleNavKeyDown } from '../utils';
19
+ import { emptyStateNoResultsWrapper } from './link-search-no-results/styled';
18
20
  export var messages = defineMessages({
19
21
  titleRecentlyViewed: {
20
22
  id: 'fabric.linkPicker.listTitle.recentlyViewed',
@@ -51,6 +53,7 @@ var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
51
53
  role = _ref.role,
52
54
  id = _ref.id,
53
55
  hasSearchTerm = _ref.hasSearchTerm,
56
+ activePlugin = _ref.activePlugin,
54
57
  restProps = _objectWithoutProperties(_ref, _excluded);
55
58
  var itemsContent;
56
59
  var loadingContent;
@@ -98,7 +101,17 @@ var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
98
101
  }
99
102
  }, [activeIndex, items, onChange, onKeyDown]);
100
103
  if ((items === null || items === void 0 ? void 0 : items.length) === 0) {
101
- return jsx(LinkSearchNoResults, null);
104
+ if (getBooleanFF('platform.linking-platform.link-picker.enable-empty-state')) {
105
+ if (hasSearchTerm) {
106
+ return jsx(LinkSearchNoResults, null);
107
+ } else {
108
+ return jsx("div", {
109
+ css: emptyStateNoResultsWrapper
110
+ }, activePlugin !== null && activePlugin !== void 0 && activePlugin.emptyStateNoResults ? activePlugin.emptyStateNoResults() : null);
111
+ }
112
+ } else {
113
+ return jsx(LinkSearchNoResults, null);
114
+ }
102
115
  }
103
116
  if (items && items.length > 0) {
104
117
  itemsContent = jsx(Fragment, null, jsx("div", {
@@ -1,4 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject;
2
+ var _templateObject, _templateObject2;
3
3
  import { css } from '@emotion/react';
4
- export var emptyStateWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & p {\n margin: 0;\n }\n"])));
4
+ export var emptyStateWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & p {\n margin: 0;\n }\n"])));
5
+ export var emptyStateNoResultsWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-height: ", ";\n"])), "var(--ds-space-200, 16px)");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.22.2",
3
+ "version": "1.23.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
1
  export { ComposedLinkPicker as LinkPicker } from './ui';
2
2
  export type { LinkPickerProps } from './ui/link-picker';
3
- export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, } from './ui/types';
3
+ export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './ui/types';
4
4
  export { UnauthenticatedError } from './common/utils/errors';
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { KeyboardEvent } from 'react';
3
- import { LinkSearchListItemData } from '../../types';
3
+ import { LinkPickerPlugin, LinkSearchListItemData } from '../../types';
4
4
  export declare const messages: {
5
5
  titleRecentlyViewed: {
6
6
  id: string;
@@ -39,6 +39,7 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
39
39
  role?: string;
40
40
  id?: string;
41
41
  hasSearchTerm?: boolean;
42
+ activePlugin?: LinkPickerPlugin;
42
43
  }
43
44
  declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
44
45
  export default LinkSearchList;
@@ -1 +1,2 @@
1
1
  export declare const emptyStateWrapperStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const emptyStateNoResultsWrapper: import("@emotion/react").SerializedStyles;
@@ -48,6 +48,8 @@ export interface LinkPickerPlugin {
48
48
  tabTitle?: string;
49
49
  /** Render function to customise the UI that is displayed when an error occurs resolving results */
50
50
  errorFallback?: LinkPickerPluginErrorFallback;
51
+ /** Render function to customise the UI that is displayed when there are no results, but an empty form (no search term) */
52
+ emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
51
53
  /** Metadata about the plugin */
52
54
  meta?: {
53
55
  /** The data source that provides all results provided by the plugin */
@@ -63,3 +65,4 @@ export interface LinkPickerPluginAction {
63
65
  callback: () => void;
64
66
  }
65
67
  export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
68
+ export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
@@ -1,4 +1,4 @@
1
1
  export { ComposedLinkPicker as LinkPicker } from './ui';
2
2
  export type { LinkPickerProps } from './ui/link-picker';
3
- export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, } from './ui/types';
3
+ export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './ui/types';
4
4
  export { UnauthenticatedError } from './common/utils/errors';
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { KeyboardEvent } from 'react';
3
- import { LinkSearchListItemData } from '../../types';
3
+ import { LinkPickerPlugin, LinkSearchListItemData } from '../../types';
4
4
  export declare const messages: {
5
5
  titleRecentlyViewed: {
6
6
  id: string;
@@ -39,6 +39,7 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
39
39
  role?: string;
40
40
  id?: string;
41
41
  hasSearchTerm?: boolean;
42
+ activePlugin?: LinkPickerPlugin;
42
43
  }
43
44
  declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
44
45
  export default LinkSearchList;
@@ -1 +1,2 @@
1
1
  export declare const emptyStateWrapperStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const emptyStateNoResultsWrapper: import("@emotion/react").SerializedStyles;
@@ -48,6 +48,8 @@ export interface LinkPickerPlugin {
48
48
  tabTitle?: string;
49
49
  /** Render function to customise the UI that is displayed when an error occurs resolving results */
50
50
  errorFallback?: LinkPickerPluginErrorFallback;
51
+ /** Render function to customise the UI that is displayed when there are no results, but an empty form (no search term) */
52
+ emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
51
53
  /** Metadata about the plugin */
52
54
  meta?: {
53
55
  /** The data source that provides all results provided by the plugin */
@@ -63,3 +65,4 @@ export interface LinkPickerPluginAction {
63
65
  callback: () => void;
64
66
  }
65
67
  export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
68
+ export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.22.2",
3
+ "version": "1.23.0",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -33,6 +33,11 @@
33
33
  "af:exports": {
34
34
  ".": "./src/index.ts"
35
35
  },
36
+ "platform-feature-flags": {
37
+ "platform.linking-platform.link-picker.enable-empty-state": {
38
+ "type": "boolean"
39
+ }
40
+ },
36
41
  "scripts": {
37
42
  "ak-postbuild": "ls -d dist/* | grep -v dist/types | xargs -n 1 copyfiles -u 1 -V src/**/*.svg",
38
43
  "codegen-analytics": "yarn run ts-analytics-codegen --command='yarn workspace @atlaskit/link-picker run codegen-analytics'"
@@ -44,8 +49,9 @@
44
49
  "@atlaskit/form": "^8.11.0",
45
50
  "@atlaskit/frontend-utilities": "^2.6.0",
46
51
  "@atlaskit/icon": "^21.12.0",
47
- "@atlaskit/linking-common": "^2.13.0",
52
+ "@atlaskit/linking-common": "^2.15.0",
48
53
  "@atlaskit/onboarding": "^10.8.2",
54
+ "@atlaskit/platform-feature-flags": "^0.2.1",
49
55
  "@atlaskit/spinner": "^15.5.0",
50
56
  "@atlaskit/tabs": "^13.4.0",
51
57
  "@atlaskit/textfield": "^5.5.0",
@@ -72,13 +78,15 @@
72
78
  "@atlaskit/link-analytics": "^8.0.0",
73
79
  "@atlaskit/link-provider": "^1.6.0",
74
80
  "@atlaskit/link-test-helpers": "^4.0.0",
81
+ "@atlaskit/linking-common": "^2.15.0",
75
82
  "@atlaskit/popup": "^1.6.0",
76
83
  "@atlaskit/toggle": "^12.6.0",
77
84
  "@atlaskit/visual-regression": "*",
78
85
  "@atlaskit/webdriver-runner": "*",
79
86
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
80
- "@atlassian/link-picker-atlassian-plugin": "^32.1.0",
81
- "@atlassian/link-picker-plugins": "^22.1.0",
87
+ "@atlassian/feature-flags-test-utils": "*",
88
+ "@atlassian/link-picker-atlassian-plugin": "^33.2.0",
89
+ "@atlassian/link-picker-plugins": "^22.2.0",
82
90
  "@atlassian/recent-work-client": "^1.8.0",
83
91
  "@testing-library/dom": "^8.17.1",
84
92
  "@testing-library/jest-dom": "^5.16.5",
package/report.api.md CHANGED
@@ -33,6 +33,7 @@ export const LinkPicker: React_2.MemoExoticComponent<
33
33
  // @public (undocumented)
34
34
  export interface LinkPickerPlugin {
35
35
  action?: LinkPickerPluginAction;
36
+ emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
36
37
  errorFallback?: LinkPickerPluginErrorFallback;
37
38
  meta?: {
38
39
  source?: string;
@@ -54,6 +55,9 @@ export interface LinkPickerPluginAction {
54
55
  label: MessageDescriptor | string;
55
56
  }
56
57
 
58
+ // @public (undocumented)
59
+ export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
60
+
57
61
  // @public (undocumented)
58
62
  export type LinkPickerPluginErrorFallback = (
59
63
  error: unknown,
@@ -20,6 +20,7 @@ export const LinkPicker: React_2.MemoExoticComponent<(props: LinkPickerProps) =>
20
20
  // @public (undocumented)
21
21
  export interface LinkPickerPlugin {
22
22
  action?: LinkPickerPluginAction;
23
+ emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
23
24
  errorFallback?: LinkPickerPluginErrorFallback;
24
25
  meta?: {
25
26
  source?: string;
@@ -39,6 +40,9 @@ export interface LinkPickerPluginAction {
39
40
  label: MessageDescriptor | string;
40
41
  }
41
42
 
43
+ // @public (undocumented)
44
+ export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
45
+
42
46
  // @public (undocumented)
43
47
  export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
44
48