@atlaskit/link-picker 3.12.1 → 3.14.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 +17 -0
- package/dist/cjs/services/use-plugins/index.js +6 -3
- package/dist/cjs/ui/link-picker/autoSubmitOnChange.js +44 -0
- package/dist/cjs/ui/link-picker/index.js +25 -5
- package/dist/cjs/ui/link-picker/search-results/index.js +4 -2
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +5 -2
- package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/index.js +5 -2
- package/dist/cjs/ui/main.js +1 -1
- package/dist/es2019/services/use-plugins/index.js +6 -5
- package/dist/es2019/ui/link-picker/autoSubmitOnChange.js +35 -0
- package/dist/es2019/ui/link-picker/index.js +24 -5
- package/dist/es2019/ui/link-picker/search-results/index.js +4 -2
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +4 -1
- package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/index.js +5 -2
- package/dist/es2019/ui/main.js +1 -1
- package/dist/esm/services/use-plugins/index.js +6 -3
- package/dist/esm/ui/link-picker/autoSubmitOnChange.js +37 -0
- package/dist/esm/ui/link-picker/index.js +25 -5
- package/dist/esm/ui/link-picker/search-results/index.js +4 -2
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +5 -2
- package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/index.js +5 -2
- package/dist/esm/ui/main.js +1 -1
- package/dist/types/common/types.d.ts +14 -0
- package/dist/types/services/use-plugins/index.d.ts +1 -1
- package/dist/types/ui/link-picker/autoSubmitOnChange.d.ts +9 -0
- package/dist/types/ui/link-picker/search-results/index.d.ts +2 -1
- package/dist/types/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/index.d.ts +3 -1
- package/dist/types-ts4.5/common/types.d.ts +14 -0
- package/dist/types-ts4.5/services/use-plugins/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/link-picker/autoSubmitOnChange.d.ts +9 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/index.d.ts +3 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/link-picker
|
|
2
2
|
|
|
3
|
+
## 3.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`d21c47b4f935f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d21c47b4f935f) -
|
|
8
|
+
[ux] New prop submitOnInputChange for link picker that removes the submit button and adds a submit
|
|
9
|
+
on input change
|
|
10
|
+
|
|
11
|
+
## 3.13.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`be449d28b1149`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be449d28b1149) -
|
|
16
|
+
[ux] Adding optional props recentSearchListSize, and shouldRenderNoResultsImage for Link Picker to
|
|
17
|
+
allow for showing insert button on smaller screens. Additionally updating the hideLinkDisplayText
|
|
18
|
+
prop to be passed as a part of a new linkPickerOptions object instead of as a standalone variable.
|
|
19
|
+
|
|
3
20
|
## 3.12.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -11,6 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
13
|
var _convertToError = require("@atlaskit/frontend-utilities/convert-to-error");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _analytics = require("../../common/analytics");
|
|
15
16
|
var _constants = require("../../common/constants");
|
|
16
17
|
var _analytics2 = _interopRequireDefault(require("../../common/utils/analytics/analytics.codegen"));
|
|
@@ -21,6 +22,7 @@ var _utils = require("./utils");
|
|
|
21
22
|
function usePlugins(state, activeTab, plugins) {
|
|
22
23
|
var _activePlugin$tabKey;
|
|
23
24
|
var thirdPartyTabExperimentEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
25
|
+
var recentSearchListSize = arguments.length > 4 ? arguments[4] : undefined;
|
|
24
26
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
25
27
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
26
28
|
var _useState = (0, _react.useState)(0),
|
|
@@ -81,7 +83,7 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
81
83
|
dispatch({
|
|
82
84
|
type: 'SUCCESS',
|
|
83
85
|
payload: {
|
|
84
|
-
items: limit(value.data),
|
|
86
|
+
items: limit(value.data, (0, _platformFeatureFlags.fg)('aifc_create_enabled') ? recentSearchListSize : undefined),
|
|
85
87
|
isLoading: !done
|
|
86
88
|
}
|
|
87
89
|
});
|
|
@@ -114,7 +116,7 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
114
116
|
}();
|
|
115
117
|
updateResults();
|
|
116
118
|
return cancel;
|
|
117
|
-
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch]);
|
|
119
|
+
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch, recentSearchListSize]);
|
|
118
120
|
var tabs = (0, _react.useMemo)(function () {
|
|
119
121
|
if (!plugins || plugins.length <= 1) {
|
|
120
122
|
return [];
|
|
@@ -157,5 +159,6 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
157
159
|
};
|
|
158
160
|
}
|
|
159
161
|
function limit(items) {
|
|
160
|
-
|
|
162
|
+
var recentSearchListSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _constants.RECENT_SEARCH_LIST_SIZE;
|
|
163
|
+
return items.slice(0, recentSearchListSize);
|
|
161
164
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _useDebounce3 = require("use-debounce");
|
|
11
|
+
var _url = require("@atlaskit/linking-common/url");
|
|
12
|
+
var AutoSubmitOnChange = function AutoSubmitOnChange(_ref) {
|
|
13
|
+
var url = _ref.url,
|
|
14
|
+
isSubmitting = _ref.isSubmitting,
|
|
15
|
+
isSelectedItem = _ref.isSelectedItem,
|
|
16
|
+
onSubmit = _ref.onSubmit,
|
|
17
|
+
onClearInvalidUrl = _ref.onClearInvalidUrl;
|
|
18
|
+
// Debounce the URL to avoid rapid successive submissions during typing
|
|
19
|
+
var _useDebounce = (0, _useDebounce3.useDebounce)(url, 300),
|
|
20
|
+
_useDebounce2 = (0, _slicedToArray2.default)(_useDebounce, 1),
|
|
21
|
+
debouncedUrl = _useDebounce2[0];
|
|
22
|
+
var isBlank = url === '';
|
|
23
|
+
// Auto-submit when URL changes
|
|
24
|
+
(0, _react.useEffect)(function () {
|
|
25
|
+
//prevents misalignment between url and debounced url when clear button is clicked
|
|
26
|
+
if (isBlank) {
|
|
27
|
+
onClearInvalidUrl();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// Only auto-submit if debouncedUrl is not empty and not already submitting
|
|
31
|
+
if (debouncedUrl.trim() && !isSubmitting && !isSelectedItem) {
|
|
32
|
+
var normalized = (0, _url.normalizeUrl)(debouncedUrl);
|
|
33
|
+
if (normalized) {
|
|
34
|
+
onSubmit();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//onSubmit() left out to prevent infinite loop
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
+
}, [debouncedUrl, isSubmitting, isSelectedItem, onClearInvalidUrl, isBlank]);
|
|
40
|
+
|
|
41
|
+
// This component renders nothing
|
|
42
|
+
return null;
|
|
43
|
+
};
|
|
44
|
+
var _default = exports.default = AutoSubmitOnChange;
|
|
@@ -36,6 +36,7 @@ var _handleNavKeyDown = require("../../common/utils/handleNavKeyDown");
|
|
|
36
36
|
var _usePlugins2 = require("../../services/use-plugins");
|
|
37
37
|
var _useSearchQuery = require("../../services/use-search-query");
|
|
38
38
|
var _announcer = require("./announcer");
|
|
39
|
+
var _autoSubmitOnChange = _interopRequireDefault(require("./autoSubmitOnChange"));
|
|
39
40
|
var _formFooter = require("./form-footer");
|
|
40
41
|
var _linkPickerSubmitButton = require("./form-footer/link-picker-submit-button");
|
|
41
42
|
var _messages = require("./messages");
|
|
@@ -117,7 +118,11 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
117
118
|
inputRef = _ref.inputRef,
|
|
118
119
|
_ref$previewableLinks = _ref.previewableLinksOnly,
|
|
119
120
|
previewableLinksOnly = _ref$previewableLinks === void 0 ? false : _ref$previewableLinks,
|
|
120
|
-
additionalError = _ref.additionalError
|
|
121
|
+
additionalError = _ref.additionalError,
|
|
122
|
+
_ref$submitOnInputCha = _ref.submitOnInputChange,
|
|
123
|
+
submitOnInputChange = _ref$submitOnInputCha === void 0 ? false : _ref$submitOnInputCha,
|
|
124
|
+
recentSearchListSize = _ref.recentSearchListSize,
|
|
125
|
+
shouldRenderNoResultsImage = _ref.shouldRenderNoResultsImage;
|
|
121
126
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
122
127
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
123
128
|
var _useReducer = (0, _react.useReducer)(reducer, _objectSpread(_objectSpread({}, initState), {}, {
|
|
@@ -143,7 +148,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
143
148
|
var linkPicker3pOneDriveExperimentCohort = _featureGateJsClient.default.initializeCalled() ? _featureGateJsClient.default.getExperimentValue('link_picker_3p_onedrive_experiment', 'cohort', 'control') : 'control';
|
|
144
149
|
var oneDriveTabExperimentEnabled = linkPicker3pOneDriveExperimentCohort === 'show_onedrive_tab';
|
|
145
150
|
var thirdPartyTabExperimentEnabled = googleDriveTabExperimentEnabled || oneDriveTabExperimentEnabled;
|
|
146
|
-
var _usePlugins = (0, _usePlugins2.usePlugins)(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled),
|
|
151
|
+
var _usePlugins = (0, _usePlugins2.usePlugins)(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled, recentSearchListSize),
|
|
147
152
|
items = _usePlugins.items,
|
|
148
153
|
isLoadingResults = _usePlugins.isLoading,
|
|
149
154
|
isActivePlugin = _usePlugins.isActivePlugin,
|
|
@@ -157,6 +162,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
157
162
|
var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
158
163
|
var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
159
164
|
var previewableOnly = (0, _platformFeatureFlags.fg)('platform-linking-link-picker-previewable-only') && previewableLinksOnly;
|
|
165
|
+
var flaggedSubmitOnInputChange = (0, _platformFeatureFlags.fg)('platform-linking-link-picker-previewable-only') && submitOnInputChange;
|
|
160
166
|
var _useLinkPickerAnalyti = (0, _analytics.useLinkPickerAnalytics)(),
|
|
161
167
|
trackAttribute = _useLinkPickerAnalyti.trackAttribute,
|
|
162
168
|
getAttributes = _useLinkPickerAnalyti.getAttributes;
|
|
@@ -247,6 +253,13 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
247
253
|
handleInsert(_url, name, 'typeAhead', _objectSpread({}, selectedItem));
|
|
248
254
|
}
|
|
249
255
|
}, [handleInsert, trackAttribute, items, activePlugin, isSubmitting]);
|
|
256
|
+
var handleClearInvalidUrl = (0, _platformFeatureFlags.fg)('platform-linking-link-picker-previewable-only') ?
|
|
257
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
258
|
+
(0, _react.useCallback)(function () {
|
|
259
|
+
dispatch({
|
|
260
|
+
invalidUrl: false
|
|
261
|
+
});
|
|
262
|
+
}, [dispatch]) : function () {};
|
|
250
263
|
var handleSubmit = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
251
264
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(event) {
|
|
252
265
|
var normalized, urlResponse, responseObject;
|
|
@@ -430,7 +443,13 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
430
443
|
// Use onSubmitCapture instead of onSubmit so that any possible parent form isn't submitted
|
|
431
444
|
onSubmitCapture: handleSubmit,
|
|
432
445
|
className: (0, _runtime.ax)(["_19bv164s _u5f31pah _ca0q1k79 _n3td1t3k _vchhusvi _1e0ctcjq"])
|
|
433
|
-
}, /*#__PURE__*/React.createElement(_trackMount.TrackMount, null),
|
|
446
|
+
}, /*#__PURE__*/React.createElement(_trackMount.TrackMount, null), flaggedSubmitOnInputChange && /*#__PURE__*/React.createElement(_autoSubmitOnChange.default, {
|
|
447
|
+
url: url,
|
|
448
|
+
isSubmitting: isSubmitting,
|
|
449
|
+
isSelectedItem: isSelectedItem,
|
|
450
|
+
onSubmit: handleSubmit,
|
|
451
|
+
onClearInvalidUrl: handleClearInvalidUrl
|
|
452
|
+
}), isActivePlugin && /*#__PURE__*/React.createElement(_react.Fragment, null, screenReaderText && /*#__PURE__*/React.createElement(_announcer.Announcer, {
|
|
434
453
|
ariaLive: "assertive",
|
|
435
454
|
text: screenReaderText,
|
|
436
455
|
ariaRelevant: "additions",
|
|
@@ -500,7 +519,8 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
500
519
|
handleTabChange: handleTabChange,
|
|
501
520
|
handleSearchListOnChange: handleSearchListOnChange,
|
|
502
521
|
adaptiveHeight: adaptiveHeight,
|
|
503
|
-
retry: retry
|
|
522
|
+
retry: retry,
|
|
523
|
+
shouldRenderNoResultsImage: shouldRenderNoResultsImage
|
|
504
524
|
}), /*#__PURE__*/React.createElement(_formFooter.FormFooter, {
|
|
505
525
|
error: error,
|
|
506
526
|
items: items
|
|
@@ -514,7 +534,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
514
534
|
action: pluginAction,
|
|
515
535
|
customSubmitButtonLabel: customSubmitButtonLabel,
|
|
516
536
|
submitMessageId: submitMessageId,
|
|
517
|
-
hideSubmitButton: moveSubmitButton,
|
|
537
|
+
hideSubmitButton: moveSubmitButton || flaggedSubmitOnInputChange,
|
|
518
538
|
className: (0, _runtime.ax)([(!queryState || !(plugins !== null && plugins !== void 0 && plugins.length)) && "_19pkpxbi"])
|
|
519
539
|
}));
|
|
520
540
|
}));
|
|
@@ -53,7 +53,8 @@ var SearchResults = exports.SearchResults = function SearchResults(_ref) {
|
|
|
53
53
|
handleSelected = _ref.handleSelected,
|
|
54
54
|
handleKeyDown = _ref.handleKeyDown,
|
|
55
55
|
adaptiveHeight = _ref.adaptiveHeight,
|
|
56
|
-
retry = _ref.retry
|
|
56
|
+
retry = _ref.retry,
|
|
57
|
+
shouldRenderNoResultsImage = _ref.shouldRenderNoResultsImage;
|
|
57
58
|
var isActivePlugin = !!activePlugin;
|
|
58
59
|
// Experiment with new 3P tabs in link picker. For more info, please see: go/link-picker-3p-drive-one-pager.
|
|
59
60
|
var linkPicker3pDriveExperimentCohort = _featureGateJsClient.default.initializeCalled() ? _featureGateJsClient.default.getExperimentValue('link_picker_3p_drive_experiment', 'cohort', 'control') : 'control';
|
|
@@ -101,7 +102,8 @@ var SearchResults = exports.SearchResults = function SearchResults(_ref) {
|
|
|
101
102
|
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
102
103
|
activePlugin: activePlugin,
|
|
103
104
|
adaptiveHeight: adaptiveHeight,
|
|
104
|
-
tabPanelId: "".concat(testIds.tabList, "-").concat(activeTab, "-tab")
|
|
105
|
+
tabPanelId: "".concat(testIds.tabList, "-").concat(activeTab, "-tab"),
|
|
106
|
+
shouldRenderNoResultsImage: shouldRenderNoResultsImage
|
|
105
107
|
}), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === 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 : /*#__PURE__*/React.createElement(_linkSearchError.LinkSearchError, {
|
|
106
108
|
onRetry: retry
|
|
107
109
|
}) : null));
|
|
@@ -22,7 +22,7 @@ var _handleNavKeyDown = require("../../../../common/utils/handleNavKeyDown");
|
|
|
22
22
|
var _linkSearchNoResults = require("./link-search-no-results");
|
|
23
23
|
var _listItem = require("./list-item");
|
|
24
24
|
var _useTrackResultsShown = require("./use-track-results-shown");
|
|
25
|
-
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className", "tabPanelId"];
|
|
25
|
+
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className", "tabPanelId", "shouldRenderNoResultsImage"];
|
|
26
26
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
27
27
|
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; }
|
|
28
28
|
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) { (0, _defineProperty2.default)(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; }
|
|
@@ -76,6 +76,7 @@ var LinkSearchList = exports.LinkSearchList = /*#__PURE__*/(0, _react.forwardRef
|
|
|
76
76
|
adaptiveHeight = _ref.adaptiveHeight,
|
|
77
77
|
className = _ref.className,
|
|
78
78
|
tabPanelId = _ref.tabPanelId,
|
|
79
|
+
shouldRenderNoResultsImage = _ref.shouldRenderNoResultsImage,
|
|
79
80
|
restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
80
81
|
var itemsContent;
|
|
81
82
|
var loadingContent;
|
|
@@ -128,7 +129,9 @@ var LinkSearchList = exports.LinkSearchList = /*#__PURE__*/(0, _react.forwardRef
|
|
|
128
129
|
}
|
|
129
130
|
return /*#__PURE__*/React.createElement("div", {
|
|
130
131
|
id: tabPanelId
|
|
131
|
-
}, /*#__PURE__*/React.createElement(_linkSearchNoResults.NoResults,
|
|
132
|
+
}, /*#__PURE__*/React.createElement(_linkSearchNoResults.NoResults, {
|
|
133
|
+
shouldRenderImage: shouldRenderNoResultsImage
|
|
134
|
+
}));
|
|
132
135
|
}
|
|
133
136
|
var listItemNameMaxLines = activePlugin === null || activePlugin === void 0 || (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
|
|
134
137
|
if (items && items.length > 0) {
|
package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/index.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.testIds = exports.messages = exports.NoResults = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var _emptyState = require("../../../../../common/ui/empty-state");
|
|
11
12
|
var _noResultsSvg = require("./no-results-svg");
|
|
12
13
|
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
@@ -24,13 +25,15 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
24
25
|
var testIds = exports.testIds = {
|
|
25
26
|
emptyResultPage: 'link-search-no-results'
|
|
26
27
|
};
|
|
27
|
-
var NoResults = exports.NoResults = function NoResults() {
|
|
28
|
+
var NoResults = exports.NoResults = function NoResults(_ref) {
|
|
29
|
+
var _ref$shouldRenderImag = _ref.shouldRenderImage,
|
|
30
|
+
shouldRenderImage = _ref$shouldRenderImag === void 0 ? true : _ref$shouldRenderImag;
|
|
28
31
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
29
32
|
return /*#__PURE__*/_react.default.createElement(_emptyState.EmptyState, {
|
|
30
33
|
testId: testIds.emptyResultPage,
|
|
31
34
|
header: intl.formatMessage(messages.noResults),
|
|
32
35
|
description: intl.formatMessage(messages.noResultsDescription),
|
|
33
|
-
renderImage: function
|
|
36
|
+
renderImage: !shouldRenderImage && (0, _platformFeatureFlags.fg)('aifc_create_enabled') ? undefined : function () {
|
|
34
37
|
return /*#__PURE__*/_react.default.createElement(_noResultsSvg.NoResultsSVG, null);
|
|
35
38
|
}
|
|
36
39
|
});
|
package/dist/cjs/ui/main.js
CHANGED
|
@@ -25,7 +25,7 @@ var testIds = exports.testIds = {
|
|
|
25
25
|
};
|
|
26
26
|
var PACKAGE_DATA = exports.PACKAGE_DATA = {
|
|
27
27
|
packageName: "@atlaskit/link-picker" || '',
|
|
28
|
-
packageVersion: "
|
|
28
|
+
packageVersion: "0.0.0-development" || '',
|
|
29
29
|
componentName: _constants.COMPONENT_NAME,
|
|
30
30
|
source: _constants.COMPONENT_NAME
|
|
31
31
|
};
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { useLinkPickerAnalytics } from '../../common/analytics';
|
|
6
7
|
import { ANALYTICS_CHANNEL, RECENT_SEARCH_LIST_SIZE } from '../../common/constants';
|
|
7
8
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
8
9
|
import { usePluginReducer } from './reducer';
|
|
9
10
|
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
10
|
-
export function usePlugins(state, activeTab, plugins, thirdPartyTabExperimentEnabled = false) {
|
|
11
|
+
export function usePlugins(state, activeTab, plugins, thirdPartyTabExperimentEnabled = false, recentSearchListSize) {
|
|
11
12
|
var _activePlugin$tabKey;
|
|
12
13
|
const {
|
|
13
14
|
createAnalyticsEvent
|
|
@@ -55,7 +56,7 @@ export function usePlugins(state, activeTab, plugins, thirdPartyTabExperimentEna
|
|
|
55
56
|
dispatch({
|
|
56
57
|
type: 'SUCCESS',
|
|
57
58
|
payload: {
|
|
58
|
-
items: limit(value.data),
|
|
59
|
+
items: limit(value.data, fg('aifc_create_enabled') ? recentSearchListSize : undefined),
|
|
59
60
|
isLoading: !done
|
|
60
61
|
}
|
|
61
62
|
});
|
|
@@ -74,7 +75,7 @@ export function usePlugins(state, activeTab, plugins, thirdPartyTabExperimentEna
|
|
|
74
75
|
};
|
|
75
76
|
updateResults();
|
|
76
77
|
return cancel;
|
|
77
|
-
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch]);
|
|
78
|
+
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch, recentSearchListSize]);
|
|
78
79
|
const tabs = useMemo(() => {
|
|
79
80
|
if (!plugins || plugins.length <= 1) {
|
|
80
81
|
return [];
|
|
@@ -110,6 +111,6 @@ export function usePlugins(state, activeTab, plugins, thirdPartyTabExperimentEna
|
|
|
110
111
|
pluginBanner
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
|
-
function limit(items) {
|
|
114
|
-
return items.slice(0,
|
|
114
|
+
function limit(items, recentSearchListSize = RECENT_SEARCH_LIST_SIZE) {
|
|
115
|
+
return items.slice(0, recentSearchListSize);
|
|
115
116
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useDebounce } from 'use-debounce';
|
|
3
|
+
import { normalizeUrl } from '@atlaskit/linking-common/url';
|
|
4
|
+
const AutoSubmitOnChange = ({
|
|
5
|
+
url,
|
|
6
|
+
isSubmitting,
|
|
7
|
+
isSelectedItem,
|
|
8
|
+
onSubmit,
|
|
9
|
+
onClearInvalidUrl
|
|
10
|
+
}) => {
|
|
11
|
+
// Debounce the URL to avoid rapid successive submissions during typing
|
|
12
|
+
const [debouncedUrl] = useDebounce(url, 300);
|
|
13
|
+
const isBlank = url === '';
|
|
14
|
+
// Auto-submit when URL changes
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
//prevents misalignment between url and debounced url when clear button is clicked
|
|
17
|
+
if (isBlank) {
|
|
18
|
+
onClearInvalidUrl();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// Only auto-submit if debouncedUrl is not empty and not already submitting
|
|
22
|
+
if (debouncedUrl.trim() && !isSubmitting && !isSelectedItem) {
|
|
23
|
+
const normalized = normalizeUrl(debouncedUrl);
|
|
24
|
+
if (normalized) {
|
|
25
|
+
onSubmit();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//onSubmit() left out to prevent infinite loop
|
|
29
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
|
+
}, [debouncedUrl, isSubmitting, isSelectedItem, onClearInvalidUrl, isBlank]);
|
|
31
|
+
|
|
32
|
+
// This component renders nothing
|
|
33
|
+
return null;
|
|
34
|
+
};
|
|
35
|
+
export default AutoSubmitOnChange;
|
|
@@ -24,6 +24,7 @@ import { handleNavKeyDown } from '../../common/utils/handleNavKeyDown';
|
|
|
24
24
|
import { usePlugins } from '../../services/use-plugins';
|
|
25
25
|
import { useSearchQuery } from '../../services/use-search-query';
|
|
26
26
|
import { Announcer } from './announcer';
|
|
27
|
+
import AutoSubmitOnChange from './autoSubmitOnChange';
|
|
27
28
|
import { FormFooter, testIds as formFooterTestIds } from './form-footer';
|
|
28
29
|
import { LinkPickerSubmitButton } from './form-footer/link-picker-submit-button';
|
|
29
30
|
import { formMessages, linkMessages, linkTextMessages, searchMessages } from './messages';
|
|
@@ -105,7 +106,10 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
105
106
|
moveSubmitButton = false,
|
|
106
107
|
inputRef,
|
|
107
108
|
previewableLinksOnly = false,
|
|
108
|
-
additionalError
|
|
109
|
+
additionalError,
|
|
110
|
+
submitOnInputChange = false,
|
|
111
|
+
recentSearchListSize,
|
|
112
|
+
shouldRenderNoResultsImage
|
|
109
113
|
}) => {
|
|
110
114
|
const {
|
|
111
115
|
createAnalyticsEvent
|
|
@@ -143,11 +147,12 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
143
147
|
retry,
|
|
144
148
|
pluginAction,
|
|
145
149
|
pluginBanner
|
|
146
|
-
} = usePlugins(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled);
|
|
150
|
+
} = usePlugins(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled, recentSearchListSize);
|
|
147
151
|
const isEditing = !!initUrl;
|
|
148
152
|
const selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
149
153
|
const isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
150
154
|
const previewableOnly = fg('platform-linking-link-picker-previewable-only') && previewableLinksOnly;
|
|
155
|
+
const flaggedSubmitOnInputChange = fg('platform-linking-link-picker-previewable-only') && submitOnInputChange;
|
|
151
156
|
const {
|
|
152
157
|
trackAttribute,
|
|
153
158
|
getAttributes
|
|
@@ -242,6 +247,13 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
242
247
|
});
|
|
243
248
|
}
|
|
244
249
|
}, [handleInsert, trackAttribute, items, activePlugin, isSubmitting]);
|
|
250
|
+
const handleClearInvalidUrl = fg('platform-linking-link-picker-previewable-only') ?
|
|
251
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
252
|
+
useCallback(() => {
|
|
253
|
+
dispatch({
|
|
254
|
+
invalidUrl: false
|
|
255
|
+
});
|
|
256
|
+
}, [dispatch]) : () => {};
|
|
245
257
|
const handleSubmit = useCallback(async event => {
|
|
246
258
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
247
259
|
if (isSubmitting) {
|
|
@@ -385,7 +397,13 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
385
397
|
// Use onSubmitCapture instead of onSubmit so that any possible parent form isn't submitted
|
|
386
398
|
onSubmitCapture: handleSubmit,
|
|
387
399
|
className: ax(["_19bv164s _u5f31pah _ca0q1k79 _n3td1t3k _vchhusvi _1e0ctcjq"])
|
|
388
|
-
}, /*#__PURE__*/React.createElement(TrackMount, null),
|
|
400
|
+
}, /*#__PURE__*/React.createElement(TrackMount, null), flaggedSubmitOnInputChange && /*#__PURE__*/React.createElement(AutoSubmitOnChange, {
|
|
401
|
+
url: url,
|
|
402
|
+
isSubmitting: isSubmitting,
|
|
403
|
+
isSelectedItem: isSelectedItem,
|
|
404
|
+
onSubmit: handleSubmit,
|
|
405
|
+
onClearInvalidUrl: handleClearInvalidUrl
|
|
406
|
+
}), isActivePlugin && /*#__PURE__*/React.createElement(Fragment, null, screenReaderText && /*#__PURE__*/React.createElement(Announcer, {
|
|
389
407
|
ariaLive: "assertive",
|
|
390
408
|
text: screenReaderText,
|
|
391
409
|
ariaRelevant: "additions",
|
|
@@ -455,7 +473,8 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
455
473
|
handleTabChange: handleTabChange,
|
|
456
474
|
handleSearchListOnChange: handleSearchListOnChange,
|
|
457
475
|
adaptiveHeight: adaptiveHeight,
|
|
458
|
-
retry: retry
|
|
476
|
+
retry: retry,
|
|
477
|
+
shouldRenderNoResultsImage: shouldRenderNoResultsImage
|
|
459
478
|
}), /*#__PURE__*/React.createElement(FormFooter, {
|
|
460
479
|
error: error,
|
|
461
480
|
items: items
|
|
@@ -469,7 +488,7 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
469
488
|
action: pluginAction,
|
|
470
489
|
customSubmitButtonLabel: customSubmitButtonLabel,
|
|
471
490
|
submitMessageId: submitMessageId,
|
|
472
|
-
hideSubmitButton: moveSubmitButton,
|
|
491
|
+
hideSubmitButton: moveSubmitButton || flaggedSubmitOnInputChange,
|
|
473
492
|
className: ax([(!queryState || !(plugins !== null && plugins !== void 0 && plugins.length)) && "_19pkpxbi"])
|
|
474
493
|
}));
|
|
475
494
|
}));
|
|
@@ -42,7 +42,8 @@ export const SearchResults = ({
|
|
|
42
42
|
handleSelected,
|
|
43
43
|
handleKeyDown,
|
|
44
44
|
adaptiveHeight,
|
|
45
|
-
retry
|
|
45
|
+
retry,
|
|
46
|
+
shouldRenderNoResultsImage
|
|
46
47
|
}) => {
|
|
47
48
|
var _activePlugin$errorFa, _activePlugin$errorFa2;
|
|
48
49
|
const isActivePlugin = !!activePlugin;
|
|
@@ -90,7 +91,8 @@ export const SearchResults = ({
|
|
|
90
91
|
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
91
92
|
activePlugin: activePlugin,
|
|
92
93
|
adaptiveHeight: adaptiveHeight,
|
|
93
|
-
tabPanelId: `${testIds.tabList}-${activeTab}-tab
|
|
94
|
+
tabPanelId: `${testIds.tabList}-${activeTab}-tab`,
|
|
95
|
+
shouldRenderNoResultsImage: shouldRenderNoResultsImage
|
|
94
96
|
}), 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 : /*#__PURE__*/React.createElement(LinkSearchError, {
|
|
95
97
|
onRetry: retry
|
|
96
98
|
}) : null));
|
|
@@ -63,6 +63,7 @@ export const LinkSearchList = /*#__PURE__*/forwardRef(({
|
|
|
63
63
|
adaptiveHeight,
|
|
64
64
|
className,
|
|
65
65
|
tabPanelId,
|
|
66
|
+
shouldRenderNoResultsImage,
|
|
66
67
|
...restProps
|
|
67
68
|
}, ref) => {
|
|
68
69
|
var _activePlugin$uiOptio;
|
|
@@ -117,7 +118,9 @@ export const LinkSearchList = /*#__PURE__*/forwardRef(({
|
|
|
117
118
|
}
|
|
118
119
|
return /*#__PURE__*/React.createElement("div", {
|
|
119
120
|
id: tabPanelId
|
|
120
|
-
}, /*#__PURE__*/React.createElement(NoResults,
|
|
121
|
+
}, /*#__PURE__*/React.createElement(NoResults, {
|
|
122
|
+
shouldRenderImage: shouldRenderNoResultsImage
|
|
123
|
+
}));
|
|
121
124
|
}
|
|
122
125
|
const listItemNameMaxLines = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
|
|
123
126
|
if (items && items.length > 0) {
|
package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { defineMessages, useIntl } from 'react-intl-next';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { EmptyState } from '../../../../../common/ui/empty-state';
|
|
4
5
|
import { NoResultsSVG } from './no-results-svg';
|
|
5
6
|
export const messages = defineMessages({
|
|
@@ -17,12 +18,14 @@ export const messages = defineMessages({
|
|
|
17
18
|
export const testIds = {
|
|
18
19
|
emptyResultPage: 'link-search-no-results'
|
|
19
20
|
};
|
|
20
|
-
export const NoResults = (
|
|
21
|
+
export const NoResults = ({
|
|
22
|
+
shouldRenderImage = true
|
|
23
|
+
}) => {
|
|
21
24
|
const intl = useIntl();
|
|
22
25
|
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
23
26
|
testId: testIds.emptyResultPage,
|
|
24
27
|
header: intl.formatMessage(messages.noResults),
|
|
25
28
|
description: intl.formatMessage(messages.noResultsDescription),
|
|
26
|
-
renderImage: () => /*#__PURE__*/React.createElement(NoResultsSVG, null)
|
|
29
|
+
renderImage: !shouldRenderImage && fg('aifc_create_enabled') ? undefined : () => /*#__PURE__*/React.createElement(NoResultsSVG, null)
|
|
27
30
|
});
|
|
28
31
|
};
|
package/dist/es2019/ui/main.js
CHANGED
|
@@ -5,6 +5,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
5
5
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
7
|
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { useLinkPickerAnalytics } from '../../common/analytics';
|
|
9
10
|
import { ANALYTICS_CHANNEL, RECENT_SEARCH_LIST_SIZE } from '../../common/constants';
|
|
10
11
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
@@ -13,6 +14,7 @@ import { CancellationError, resolvePluginUpdates } from './utils';
|
|
|
13
14
|
export function usePlugins(state, activeTab, plugins) {
|
|
14
15
|
var _activePlugin$tabKey;
|
|
15
16
|
var thirdPartyTabExperimentEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
17
|
+
var recentSearchListSize = arguments.length > 4 ? arguments[4] : undefined;
|
|
16
18
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
17
19
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
18
20
|
var _useState = useState(0),
|
|
@@ -73,7 +75,7 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
73
75
|
dispatch({
|
|
74
76
|
type: 'SUCCESS',
|
|
75
77
|
payload: {
|
|
76
|
-
items: limit(value.data),
|
|
78
|
+
items: limit(value.data, fg('aifc_create_enabled') ? recentSearchListSize : undefined),
|
|
77
79
|
isLoading: !done
|
|
78
80
|
}
|
|
79
81
|
});
|
|
@@ -106,7 +108,7 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
106
108
|
}();
|
|
107
109
|
updateResults();
|
|
108
110
|
return cancel;
|
|
109
|
-
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch]);
|
|
111
|
+
}, [activePlugin, state, retries, createAnalyticsEvent, dispatch, recentSearchListSize]);
|
|
110
112
|
var tabs = useMemo(function () {
|
|
111
113
|
if (!plugins || plugins.length <= 1) {
|
|
112
114
|
return [];
|
|
@@ -149,5 +151,6 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
149
151
|
};
|
|
150
152
|
}
|
|
151
153
|
function limit(items) {
|
|
152
|
-
|
|
154
|
+
var recentSearchListSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RECENT_SEARCH_LIST_SIZE;
|
|
155
|
+
return items.slice(0, recentSearchListSize);
|
|
153
156
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { useDebounce } from 'use-debounce';
|
|
4
|
+
import { normalizeUrl } from '@atlaskit/linking-common/url';
|
|
5
|
+
var AutoSubmitOnChange = function AutoSubmitOnChange(_ref) {
|
|
6
|
+
var url = _ref.url,
|
|
7
|
+
isSubmitting = _ref.isSubmitting,
|
|
8
|
+
isSelectedItem = _ref.isSelectedItem,
|
|
9
|
+
onSubmit = _ref.onSubmit,
|
|
10
|
+
onClearInvalidUrl = _ref.onClearInvalidUrl;
|
|
11
|
+
// Debounce the URL to avoid rapid successive submissions during typing
|
|
12
|
+
var _useDebounce = useDebounce(url, 300),
|
|
13
|
+
_useDebounce2 = _slicedToArray(_useDebounce, 1),
|
|
14
|
+
debouncedUrl = _useDebounce2[0];
|
|
15
|
+
var isBlank = url === '';
|
|
16
|
+
// Auto-submit when URL changes
|
|
17
|
+
useEffect(function () {
|
|
18
|
+
//prevents misalignment between url and debounced url when clear button is clicked
|
|
19
|
+
if (isBlank) {
|
|
20
|
+
onClearInvalidUrl();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// Only auto-submit if debouncedUrl is not empty and not already submitting
|
|
24
|
+
if (debouncedUrl.trim() && !isSubmitting && !isSelectedItem) {
|
|
25
|
+
var normalized = normalizeUrl(debouncedUrl);
|
|
26
|
+
if (normalized) {
|
|
27
|
+
onSubmit();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//onSubmit() left out to prevent infinite loop
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
+
}, [debouncedUrl, isSubmitting, isSelectedItem, onClearInvalidUrl, isBlank]);
|
|
33
|
+
|
|
34
|
+
// This component renders nothing
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
export default AutoSubmitOnChange;
|
|
@@ -30,6 +30,7 @@ import { handleNavKeyDown } from '../../common/utils/handleNavKeyDown';
|
|
|
30
30
|
import { usePlugins } from '../../services/use-plugins';
|
|
31
31
|
import { useSearchQuery } from '../../services/use-search-query';
|
|
32
32
|
import { Announcer } from './announcer';
|
|
33
|
+
import AutoSubmitOnChange from './autoSubmitOnChange';
|
|
33
34
|
import { FormFooter, testIds as formFooterTestIds } from './form-footer';
|
|
34
35
|
import { LinkPickerSubmitButton } from './form-footer/link-picker-submit-button';
|
|
35
36
|
import { formMessages, linkMessages, linkTextMessages, searchMessages } from './messages';
|
|
@@ -108,7 +109,11 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
108
109
|
inputRef = _ref.inputRef,
|
|
109
110
|
_ref$previewableLinks = _ref.previewableLinksOnly,
|
|
110
111
|
previewableLinksOnly = _ref$previewableLinks === void 0 ? false : _ref$previewableLinks,
|
|
111
|
-
additionalError = _ref.additionalError
|
|
112
|
+
additionalError = _ref.additionalError,
|
|
113
|
+
_ref$submitOnInputCha = _ref.submitOnInputChange,
|
|
114
|
+
submitOnInputChange = _ref$submitOnInputCha === void 0 ? false : _ref$submitOnInputCha,
|
|
115
|
+
recentSearchListSize = _ref.recentSearchListSize,
|
|
116
|
+
shouldRenderNoResultsImage = _ref.shouldRenderNoResultsImage;
|
|
112
117
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
113
118
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
114
119
|
var _useReducer = useReducer(reducer, _objectSpread(_objectSpread({}, initState), {}, {
|
|
@@ -134,7 +139,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
134
139
|
var linkPicker3pOneDriveExperimentCohort = FeatureGates.initializeCalled() ? FeatureGates.getExperimentValue('link_picker_3p_onedrive_experiment', 'cohort', 'control') : 'control';
|
|
135
140
|
var oneDriveTabExperimentEnabled = linkPicker3pOneDriveExperimentCohort === 'show_onedrive_tab';
|
|
136
141
|
var thirdPartyTabExperimentEnabled = googleDriveTabExperimentEnabled || oneDriveTabExperimentEnabled;
|
|
137
|
-
var _usePlugins = usePlugins(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled),
|
|
142
|
+
var _usePlugins = usePlugins(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled, recentSearchListSize),
|
|
138
143
|
items = _usePlugins.items,
|
|
139
144
|
isLoadingResults = _usePlugins.isLoading,
|
|
140
145
|
isActivePlugin = _usePlugins.isActivePlugin,
|
|
@@ -148,6 +153,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
148
153
|
var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
149
154
|
var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
150
155
|
var previewableOnly = fg('platform-linking-link-picker-previewable-only') && previewableLinksOnly;
|
|
156
|
+
var flaggedSubmitOnInputChange = fg('platform-linking-link-picker-previewable-only') && submitOnInputChange;
|
|
151
157
|
var _useLinkPickerAnalyti = useLinkPickerAnalytics(),
|
|
152
158
|
trackAttribute = _useLinkPickerAnalyti.trackAttribute,
|
|
153
159
|
getAttributes = _useLinkPickerAnalyti.getAttributes;
|
|
@@ -238,6 +244,13 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
238
244
|
handleInsert(_url, name, 'typeAhead', _objectSpread({}, selectedItem));
|
|
239
245
|
}
|
|
240
246
|
}, [handleInsert, trackAttribute, items, activePlugin, isSubmitting]);
|
|
247
|
+
var handleClearInvalidUrl = fg('platform-linking-link-picker-previewable-only') ?
|
|
248
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
249
|
+
useCallback(function () {
|
|
250
|
+
dispatch({
|
|
251
|
+
invalidUrl: false
|
|
252
|
+
});
|
|
253
|
+
}, [dispatch]) : function () {};
|
|
241
254
|
var handleSubmit = useCallback( /*#__PURE__*/function () {
|
|
242
255
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
243
256
|
var normalized, urlResponse, responseObject;
|
|
@@ -421,7 +434,13 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
421
434
|
// Use onSubmitCapture instead of onSubmit so that any possible parent form isn't submitted
|
|
422
435
|
onSubmitCapture: handleSubmit,
|
|
423
436
|
className: ax(["_19bv164s _u5f31pah _ca0q1k79 _n3td1t3k _vchhusvi _1e0ctcjq"])
|
|
424
|
-
}, /*#__PURE__*/React.createElement(TrackMount, null),
|
|
437
|
+
}, /*#__PURE__*/React.createElement(TrackMount, null), flaggedSubmitOnInputChange && /*#__PURE__*/React.createElement(AutoSubmitOnChange, {
|
|
438
|
+
url: url,
|
|
439
|
+
isSubmitting: isSubmitting,
|
|
440
|
+
isSelectedItem: isSelectedItem,
|
|
441
|
+
onSubmit: handleSubmit,
|
|
442
|
+
onClearInvalidUrl: handleClearInvalidUrl
|
|
443
|
+
}), isActivePlugin && /*#__PURE__*/React.createElement(Fragment, null, screenReaderText && /*#__PURE__*/React.createElement(Announcer, {
|
|
425
444
|
ariaLive: "assertive",
|
|
426
445
|
text: screenReaderText,
|
|
427
446
|
ariaRelevant: "additions",
|
|
@@ -491,7 +510,8 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
491
510
|
handleTabChange: handleTabChange,
|
|
492
511
|
handleSearchListOnChange: handleSearchListOnChange,
|
|
493
512
|
adaptiveHeight: adaptiveHeight,
|
|
494
|
-
retry: retry
|
|
513
|
+
retry: retry,
|
|
514
|
+
shouldRenderNoResultsImage: shouldRenderNoResultsImage
|
|
495
515
|
}), /*#__PURE__*/React.createElement(FormFooter, {
|
|
496
516
|
error: error,
|
|
497
517
|
items: items
|
|
@@ -505,7 +525,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
505
525
|
action: pluginAction,
|
|
506
526
|
customSubmitButtonLabel: customSubmitButtonLabel,
|
|
507
527
|
submitMessageId: submitMessageId,
|
|
508
|
-
hideSubmitButton: moveSubmitButton,
|
|
528
|
+
hideSubmitButton: moveSubmitButton || flaggedSubmitOnInputChange,
|
|
509
529
|
className: ax([(!queryState || !(plugins !== null && plugins !== void 0 && plugins.length)) && "_19pkpxbi"])
|
|
510
530
|
}));
|
|
511
531
|
}));
|
|
@@ -44,7 +44,8 @@ export var SearchResults = function SearchResults(_ref) {
|
|
|
44
44
|
handleSelected = _ref.handleSelected,
|
|
45
45
|
handleKeyDown = _ref.handleKeyDown,
|
|
46
46
|
adaptiveHeight = _ref.adaptiveHeight,
|
|
47
|
-
retry = _ref.retry
|
|
47
|
+
retry = _ref.retry,
|
|
48
|
+
shouldRenderNoResultsImage = _ref.shouldRenderNoResultsImage;
|
|
48
49
|
var isActivePlugin = !!activePlugin;
|
|
49
50
|
// Experiment with new 3P tabs in link picker. For more info, please see: go/link-picker-3p-drive-one-pager.
|
|
50
51
|
var linkPicker3pDriveExperimentCohort = FeatureGates.initializeCalled() ? FeatureGates.getExperimentValue('link_picker_3p_drive_experiment', 'cohort', 'control') : 'control';
|
|
@@ -92,7 +93,8 @@ export var SearchResults = function SearchResults(_ref) {
|
|
|
92
93
|
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
93
94
|
activePlugin: activePlugin,
|
|
94
95
|
adaptiveHeight: adaptiveHeight,
|
|
95
|
-
tabPanelId: "".concat(testIds.tabList, "-").concat(activeTab, "-tab")
|
|
96
|
+
tabPanelId: "".concat(testIds.tabList, "-").concat(activeTab, "-tab"),
|
|
97
|
+
shouldRenderNoResultsImage: shouldRenderNoResultsImage
|
|
96
98
|
}), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === 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 : /*#__PURE__*/React.createElement(LinkSearchError, {
|
|
97
99
|
onRetry: retry
|
|
98
100
|
}) : null));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className", "tabPanelId"];
|
|
5
|
+
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className", "tabPanelId", "shouldRenderNoResultsImage"];
|
|
6
6
|
import "./index.compiled.css";
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -67,6 +67,7 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
67
67
|
adaptiveHeight = _ref.adaptiveHeight,
|
|
68
68
|
className = _ref.className,
|
|
69
69
|
tabPanelId = _ref.tabPanelId,
|
|
70
|
+
shouldRenderNoResultsImage = _ref.shouldRenderNoResultsImage,
|
|
70
71
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
71
72
|
var itemsContent;
|
|
72
73
|
var loadingContent;
|
|
@@ -119,7 +120,9 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
119
120
|
}
|
|
120
121
|
return /*#__PURE__*/React.createElement("div", {
|
|
121
122
|
id: tabPanelId
|
|
122
|
-
}, /*#__PURE__*/React.createElement(NoResults,
|
|
123
|
+
}, /*#__PURE__*/React.createElement(NoResults, {
|
|
124
|
+
shouldRenderImage: shouldRenderNoResultsImage
|
|
125
|
+
}));
|
|
123
126
|
}
|
|
124
127
|
var listItemNameMaxLines = activePlugin === null || activePlugin === void 0 || (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
|
|
125
128
|
if (items && items.length > 0) {
|
package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { defineMessages, useIntl } from 'react-intl-next';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { EmptyState } from '../../../../../common/ui/empty-state';
|
|
4
5
|
import { NoResultsSVG } from './no-results-svg';
|
|
5
6
|
export var messages = defineMessages({
|
|
@@ -17,13 +18,15 @@ export var messages = defineMessages({
|
|
|
17
18
|
export var testIds = {
|
|
18
19
|
emptyResultPage: 'link-search-no-results'
|
|
19
20
|
};
|
|
20
|
-
export var NoResults = function NoResults() {
|
|
21
|
+
export var NoResults = function NoResults(_ref) {
|
|
22
|
+
var _ref$shouldRenderImag = _ref.shouldRenderImage,
|
|
23
|
+
shouldRenderImage = _ref$shouldRenderImag === void 0 ? true : _ref$shouldRenderImag;
|
|
21
24
|
var intl = useIntl();
|
|
22
25
|
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
23
26
|
testId: testIds.emptyResultPage,
|
|
24
27
|
header: intl.formatMessage(messages.noResults),
|
|
25
28
|
description: intl.formatMessage(messages.noResultsDescription),
|
|
26
|
-
renderImage: function
|
|
29
|
+
renderImage: !shouldRenderImage && fg('aifc_create_enabled') ? undefined : function () {
|
|
27
30
|
return /*#__PURE__*/React.createElement(NoResultsSVG, null);
|
|
28
31
|
}
|
|
29
32
|
});
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -44,6 +44,14 @@ export interface ResolveResult {
|
|
|
44
44
|
export interface LinkPickerUiOptions {
|
|
45
45
|
/** Maximum number of lines to display for the item name */
|
|
46
46
|
listItemNameMaxLines?: number;
|
|
47
|
+
/** Showing dynamic list size based on window height */
|
|
48
|
+
recentSearchListSize?: number;
|
|
49
|
+
/** Adaptive height */
|
|
50
|
+
adaptiveHeight?: boolean;
|
|
51
|
+
/** Hide display text */
|
|
52
|
+
hideDisplayText?: boolean;
|
|
53
|
+
/** Controls showing the image in the no results state */
|
|
54
|
+
shouldRenderNoResultsImage?: boolean;
|
|
47
55
|
}
|
|
48
56
|
export interface LinkPickerPlugin {
|
|
49
57
|
resolve: (state: LinkPickerState) => Promise<ResolveResult> | AsyncGenerator<ResolveResult, ResolveResult>;
|
|
@@ -163,6 +171,12 @@ export interface LinkPickerProps {
|
|
|
163
171
|
previewableLinksOnly?: boolean;
|
|
164
172
|
/**This prop passes one additional error that is secondary to component errors */
|
|
165
173
|
additionalError?: React.ReactNode;
|
|
174
|
+
/**This prop disables submit button and handles submit on input change */
|
|
175
|
+
submitOnInputChange?: boolean;
|
|
176
|
+
/** Showing dynamic list size based on window height */
|
|
177
|
+
recentSearchListSize?: number;
|
|
178
|
+
/** Controls showing the image in the no results state */
|
|
179
|
+
shouldRenderNoResultsImage?: boolean;
|
|
166
180
|
}
|
|
167
181
|
type CustomLinkPickerMessages = {
|
|
168
182
|
/** Label for the link input field */
|
|
@@ -13,4 +13,4 @@ export interface LinkPickerPluginsService {
|
|
|
13
13
|
pluginAction?: LinkPickerPluginAction;
|
|
14
14
|
pluginBanner?: LinkPickerPluginBanner;
|
|
15
15
|
}
|
|
16
|
-
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[], thirdPartyTabExperimentEnabled?: boolean): LinkPickerPluginsService;
|
|
16
|
+
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[], thirdPartyTabExperimentEnabled?: boolean, recentSearchListSize?: number): LinkPickerPluginsService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface AutoSubmitOnChangeProps {
|
|
2
|
+
url: string;
|
|
3
|
+
isSubmitting: boolean;
|
|
4
|
+
isSelectedItem: boolean;
|
|
5
|
+
onSubmit: () => void;
|
|
6
|
+
onClearInvalidUrl: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const AutoSubmitOnChange: ({ url, isSubmitting, isSelectedItem, onSubmit, onClearInvalidUrl, }: AutoSubmitOnChangeProps) => null;
|
|
9
|
+
export default AutoSubmitOnChange;
|
|
@@ -40,5 +40,6 @@ export type SearchResultsProps = {
|
|
|
40
40
|
error?: unknown;
|
|
41
41
|
adaptiveHeight: boolean;
|
|
42
42
|
retry: () => void;
|
|
43
|
+
shouldRenderNoResultsImage?: boolean;
|
|
43
44
|
};
|
|
44
|
-
export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, adaptiveHeight, retry, }: SearchResultsProps) => JSX.Element;
|
|
45
|
+
export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, adaptiveHeight, retry, shouldRenderNoResultsImage, }: SearchResultsProps) => JSX.Element;
|
|
@@ -49,6 +49,7 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
|
|
|
49
49
|
activePlugin?: LinkPickerPlugin;
|
|
50
50
|
/** Because we don't use the DST TabPanels component, tabPanelId is needed to set the correct aria-controls for a11y. */
|
|
51
51
|
tabPanelId?: string;
|
|
52
|
+
shouldRenderNoResultsImage?: boolean;
|
|
52
53
|
}
|
|
53
54
|
export declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
55
|
export {};
|
package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/index.d.ts
CHANGED
|
@@ -14,4 +14,6 @@ export declare const messages: {
|
|
|
14
14
|
export declare const testIds: {
|
|
15
15
|
emptyResultPage: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const NoResults: (
|
|
17
|
+
export declare const NoResults: ({ shouldRenderImage }: {
|
|
18
|
+
shouldRenderImage?: boolean;
|
|
19
|
+
}) => React.JSX.Element;
|
|
@@ -47,6 +47,14 @@ export interface ResolveResult {
|
|
|
47
47
|
export interface LinkPickerUiOptions {
|
|
48
48
|
/** Maximum number of lines to display for the item name */
|
|
49
49
|
listItemNameMaxLines?: number;
|
|
50
|
+
/** Showing dynamic list size based on window height */
|
|
51
|
+
recentSearchListSize?: number;
|
|
52
|
+
/** Adaptive height */
|
|
53
|
+
adaptiveHeight?: boolean;
|
|
54
|
+
/** Hide display text */
|
|
55
|
+
hideDisplayText?: boolean;
|
|
56
|
+
/** Controls showing the image in the no results state */
|
|
57
|
+
shouldRenderNoResultsImage?: boolean;
|
|
50
58
|
}
|
|
51
59
|
export interface LinkPickerPlugin {
|
|
52
60
|
resolve: (state: LinkPickerState) => Promise<ResolveResult> | AsyncGenerator<ResolveResult, ResolveResult>;
|
|
@@ -166,6 +174,12 @@ export interface LinkPickerProps {
|
|
|
166
174
|
previewableLinksOnly?: boolean;
|
|
167
175
|
/**This prop passes one additional error that is secondary to component errors */
|
|
168
176
|
additionalError?: React.ReactNode;
|
|
177
|
+
/**This prop disables submit button and handles submit on input change */
|
|
178
|
+
submitOnInputChange?: boolean;
|
|
179
|
+
/** Showing dynamic list size based on window height */
|
|
180
|
+
recentSearchListSize?: number;
|
|
181
|
+
/** Controls showing the image in the no results state */
|
|
182
|
+
shouldRenderNoResultsImage?: boolean;
|
|
169
183
|
}
|
|
170
184
|
type CustomLinkPickerMessages = {
|
|
171
185
|
/** Label for the link input field */
|
|
@@ -13,4 +13,4 @@ export interface LinkPickerPluginsService {
|
|
|
13
13
|
pluginAction?: LinkPickerPluginAction;
|
|
14
14
|
pluginBanner?: LinkPickerPluginBanner;
|
|
15
15
|
}
|
|
16
|
-
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[], thirdPartyTabExperimentEnabled?: boolean): LinkPickerPluginsService;
|
|
16
|
+
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[], thirdPartyTabExperimentEnabled?: boolean, recentSearchListSize?: number): LinkPickerPluginsService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface AutoSubmitOnChangeProps {
|
|
2
|
+
url: string;
|
|
3
|
+
isSubmitting: boolean;
|
|
4
|
+
isSelectedItem: boolean;
|
|
5
|
+
onSubmit: () => void;
|
|
6
|
+
onClearInvalidUrl: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const AutoSubmitOnChange: ({ url, isSubmitting, isSelectedItem, onSubmit, onClearInvalidUrl, }: AutoSubmitOnChangeProps) => null;
|
|
9
|
+
export default AutoSubmitOnChange;
|
|
@@ -40,5 +40,6 @@ export type SearchResultsProps = {
|
|
|
40
40
|
error?: unknown;
|
|
41
41
|
adaptiveHeight: boolean;
|
|
42
42
|
retry: () => void;
|
|
43
|
+
shouldRenderNoResultsImage?: boolean;
|
|
43
44
|
};
|
|
44
|
-
export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, adaptiveHeight, retry, }: SearchResultsProps) => JSX.Element;
|
|
45
|
+
export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, adaptiveHeight, retry, shouldRenderNoResultsImage, }: SearchResultsProps) => JSX.Element;
|
|
@@ -49,6 +49,7 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
|
|
|
49
49
|
activePlugin?: LinkPickerPlugin;
|
|
50
50
|
/** Because we don't use the DST TabPanels component, tabPanelId is needed to set the correct aria-controls for a11y. */
|
|
51
51
|
tabPanelId?: string;
|
|
52
|
+
shouldRenderNoResultsImage?: boolean;
|
|
52
53
|
}
|
|
53
54
|
export declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
55
|
export {};
|
|
@@ -14,4 +14,6 @@ export declare const messages: {
|
|
|
14
14
|
export declare const testIds: {
|
|
15
15
|
emptyResultPage: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const NoResults: (
|
|
17
|
+
export declare const NoResults: ({ shouldRenderImage }: {
|
|
18
|
+
shouldRenderImage?: boolean;
|
|
19
|
+
}) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,6 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"should-render-to-parent-should-be-true-linking-pla": {
|
|
45
45
|
"type": "boolean"
|
|
46
|
+
},
|
|
47
|
+
"aifc_create_enabled": {
|
|
48
|
+
"type": "boolean"
|
|
46
49
|
}
|
|
47
50
|
},
|
|
48
51
|
"scripts": {
|