@atlaskit/link-picker 3.16.8 → 4.0.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 +19 -0
- package/dist/cjs/services/use-plugins/index.js +2 -15
- package/dist/cjs/ui/link-picker/index.js +3 -12
- package/dist/cjs/ui/main.js +1 -1
- package/dist/es2019/services/use-plugins/index.js +2 -10
- package/dist/es2019/ui/link-picker/index.js +3 -12
- package/dist/es2019/ui/main.js +1 -1
- package/dist/esm/services/use-plugins/index.js +2 -14
- package/dist/esm/ui/link-picker/index.js +3 -12
- package/dist/esm/ui/main.js +1 -1
- package/dist/types/common/types.d.ts +0 -3
- package/dist/types/controllers/session-provider/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/services/use-plugins/index.d.ts +2 -3
- package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/index.d.ts +1 -1
- package/dist/types/ui/messages-provider/lazy-messages-provider/index.d.ts +1 -1
- package/dist/types-ts4.5/common/types.d.ts +0 -3
- package/dist/types-ts4.5/controllers/session-provider/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/services/use-plugins/index.d.ts +2 -3
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/messages-provider/lazy-messages-provider/index.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/link-picker
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`28f1fb81658e4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/28f1fb81658e4) -
|
|
8
|
+
[ux] Remove 3P tab experiment code from linking-platform packages
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 3.16.9
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`06d5717d57f36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/06d5717d57f36) -
|
|
19
|
+
Suppress i18n errors
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 3.16.8
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -17,12 +17,8 @@ var _constants = require("../../common/constants");
|
|
|
17
17
|
var _analytics2 = _interopRequireDefault(require("../../common/utils/analytics/analytics.codegen"));
|
|
18
18
|
var _reducer = require("./reducer");
|
|
19
19
|
var _utils = require("./utils");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function usePlugins(state, activeTab, plugins) {
|
|
20
|
+
function usePlugins(state, activeTab, plugins, recentSearchListSize) {
|
|
23
21
|
var _activePlugin$tabKey;
|
|
24
|
-
var thirdPartyTabExperimentEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
25
|
-
var recentSearchListSize = arguments.length > 4 ? arguments[4] : undefined;
|
|
26
22
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
27
23
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
28
24
|
var _useState = (0, _react.useState)(0),
|
|
@@ -137,14 +133,6 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
137
133
|
var items = pluginState.items,
|
|
138
134
|
isLoading = pluginState.isLoading,
|
|
139
135
|
error = pluginState.error;
|
|
140
|
-
|
|
141
|
-
// This is needed for the 3P tab experiments to show a persistent banner across tabs. Will be removed once the experiment is over regardless of outcome.
|
|
142
|
-
var pluginBanner = (0, _react.useMemo)(function () {
|
|
143
|
-
var _plugins$find;
|
|
144
|
-
return thirdPartyTabExperimentEnabled ? plugins === null || plugins === void 0 || (_plugins$find = plugins.find(function (plugin) {
|
|
145
|
-
return plugin.banner;
|
|
146
|
-
})) === null || _plugins$find === void 0 ? void 0 : _plugins$find.banner : undefined;
|
|
147
|
-
}, [plugins, thirdPartyTabExperimentEnabled]);
|
|
148
136
|
return {
|
|
149
137
|
tabs: tabs,
|
|
150
138
|
items: items,
|
|
@@ -154,8 +142,7 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
154
142
|
error: error,
|
|
155
143
|
retry: handleRetry,
|
|
156
144
|
errorFallback: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.errorFallback,
|
|
157
|
-
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
158
|
-
pluginBanner: pluginBanner
|
|
145
|
+
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
159
146
|
};
|
|
160
147
|
}
|
|
161
148
|
function limit(items) {
|
|
@@ -19,7 +19,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
19
19
|
var _reactIntlNext = require("react-intl-next");
|
|
20
20
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
21
21
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
22
|
-
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
23
22
|
var _form = require("@atlaskit/form");
|
|
24
23
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
25
24
|
var _url2 = require("@atlaskit/linking-common/url");
|
|
@@ -141,14 +140,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
141
140
|
hasPreview = state.hasPreview;
|
|
142
141
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
143
142
|
var queryState = (0, _useSearchQuery.useSearchQuery)(state);
|
|
144
|
-
|
|
145
|
-
// Experiment with new 3P tabs in link picker. For more info, please see: go/link-picker-3p-drive-one-pager.
|
|
146
|
-
var linkPicker3pDriveExperimentCohort = _featureGateJsClient.default.initializeCalled() ? _featureGateJsClient.default.getExperimentValue('link_picker_3p_drive_experiment', 'cohort', 'control') : 'control';
|
|
147
|
-
var googleDriveTabExperimentEnabled = linkPicker3pDriveExperimentCohort === 'show_google_drive_tab';
|
|
148
|
-
var linkPicker3pOneDriveExperimentCohort = _featureGateJsClient.default.initializeCalled() ? _featureGateJsClient.default.getExperimentValue('link_picker_3p_onedrive_experiment', 'cohort', 'control') : 'control';
|
|
149
|
-
var oneDriveTabExperimentEnabled = linkPicker3pOneDriveExperimentCohort === 'show_onedrive_tab';
|
|
150
|
-
var thirdPartyTabExperimentEnabled = googleDriveTabExperimentEnabled || oneDriveTabExperimentEnabled;
|
|
151
|
-
var _usePlugins = (0, _usePlugins2.usePlugins)(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled, recentSearchListSize),
|
|
143
|
+
var _usePlugins = (0, _usePlugins2.usePlugins)(queryState, activeTab, plugins, recentSearchListSize),
|
|
152
144
|
items = _usePlugins.items,
|
|
153
145
|
isLoadingResults = _usePlugins.isLoading,
|
|
154
146
|
isActivePlugin = _usePlugins.isActivePlugin,
|
|
@@ -156,8 +148,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
156
148
|
tabs = _usePlugins.tabs,
|
|
157
149
|
error = _usePlugins.error,
|
|
158
150
|
retry = _usePlugins.retry,
|
|
159
|
-
pluginAction = _usePlugins.pluginAction
|
|
160
|
-
pluginBanner = _usePlugins.pluginBanner;
|
|
151
|
+
pluginAction = _usePlugins.pluginAction;
|
|
161
152
|
var isEditing = !!initUrl;
|
|
162
153
|
var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
163
154
|
var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
@@ -502,7 +493,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
502
493
|
submitMessageId: submitMessageId,
|
|
503
494
|
testId: testIds.insertButton,
|
|
504
495
|
url: url
|
|
505
|
-
})),
|
|
496
|
+
})), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(_searchResults.SearchResults, {
|
|
506
497
|
activeTab: activeTab,
|
|
507
498
|
tabs: tabs,
|
|
508
499
|
activePlugin: activePlugin,
|
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: "3.16.
|
|
28
|
+
packageVersion: "3.16.9" || '',
|
|
29
29
|
componentName: _constants.COMPONENT_NAME,
|
|
30
30
|
source: _constants.COMPONENT_NAME
|
|
31
31
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* TODO(ASIMO-2105): cherrera2@ to remove persistent plugin banners once the experiment is over regardless of outcome */
|
|
2
1
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
3
|
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
@@ -8,7 +7,7 @@ import { ANALYTICS_CHANNEL, RECENT_SEARCH_LIST_SIZE } from '../../common/constan
|
|
|
8
7
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
9
8
|
import { usePluginReducer } from './reducer';
|
|
10
9
|
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
11
|
-
export function usePlugins(state, activeTab, plugins,
|
|
10
|
+
export function usePlugins(state, activeTab, plugins, recentSearchListSize) {
|
|
12
11
|
var _activePlugin$tabKey;
|
|
13
12
|
const {
|
|
14
13
|
createAnalyticsEvent
|
|
@@ -92,12 +91,6 @@ export function usePlugins(state, activeTab, plugins, thirdPartyTabExperimentEna
|
|
|
92
91
|
isLoading,
|
|
93
92
|
error
|
|
94
93
|
} = pluginState;
|
|
95
|
-
|
|
96
|
-
// This is needed for the 3P tab experiments to show a persistent banner across tabs. Will be removed once the experiment is over regardless of outcome.
|
|
97
|
-
const pluginBanner = useMemo(() => {
|
|
98
|
-
var _plugins$find;
|
|
99
|
-
return thirdPartyTabExperimentEnabled ? plugins === null || plugins === void 0 ? void 0 : (_plugins$find = plugins.find(plugin => plugin.banner)) === null || _plugins$find === void 0 ? void 0 : _plugins$find.banner : undefined;
|
|
100
|
-
}, [plugins, thirdPartyTabExperimentEnabled]);
|
|
101
94
|
return {
|
|
102
95
|
tabs,
|
|
103
96
|
items,
|
|
@@ -107,8 +100,7 @@ export function usePlugins(state, activeTab, plugins, thirdPartyTabExperimentEna
|
|
|
107
100
|
error,
|
|
108
101
|
retry: handleRetry,
|
|
109
102
|
errorFallback: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.errorFallback,
|
|
110
|
-
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
111
|
-
pluginBanner
|
|
103
|
+
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
112
104
|
};
|
|
113
105
|
}
|
|
114
106
|
function limit(items, recentSearchListSize = RECENT_SEARCH_LIST_SIZE) {
|
|
@@ -8,7 +8,6 @@ import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
9
9
|
import uuid from 'uuid';
|
|
10
10
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
11
|
-
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
12
11
|
import { HelperMessage } from '@atlaskit/form';
|
|
13
12
|
import { CardClient } from '@atlaskit/link-provider';
|
|
14
13
|
import { isSafeUrl, normalizeUrl } from '@atlaskit/linking-common/url';
|
|
@@ -131,13 +130,6 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
131
130
|
} = state;
|
|
132
131
|
const intl = useIntl();
|
|
133
132
|
const queryState = useSearchQuery(state);
|
|
134
|
-
|
|
135
|
-
// Experiment with new 3P tabs in link picker. For more info, please see: go/link-picker-3p-drive-one-pager.
|
|
136
|
-
const linkPicker3pDriveExperimentCohort = FeatureGates.initializeCalled() ? FeatureGates.getExperimentValue('link_picker_3p_drive_experiment', 'cohort', 'control') : 'control';
|
|
137
|
-
const googleDriveTabExperimentEnabled = linkPicker3pDriveExperimentCohort === 'show_google_drive_tab';
|
|
138
|
-
const linkPicker3pOneDriveExperimentCohort = FeatureGates.initializeCalled() ? FeatureGates.getExperimentValue('link_picker_3p_onedrive_experiment', 'cohort', 'control') : 'control';
|
|
139
|
-
const oneDriveTabExperimentEnabled = linkPicker3pOneDriveExperimentCohort === 'show_onedrive_tab';
|
|
140
|
-
const thirdPartyTabExperimentEnabled = googleDriveTabExperimentEnabled || oneDriveTabExperimentEnabled;
|
|
141
133
|
const {
|
|
142
134
|
items,
|
|
143
135
|
isLoading: isLoadingResults,
|
|
@@ -146,9 +138,8 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
146
138
|
tabs,
|
|
147
139
|
error,
|
|
148
140
|
retry,
|
|
149
|
-
pluginAction
|
|
150
|
-
|
|
151
|
-
} = usePlugins(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled, recentSearchListSize);
|
|
141
|
+
pluginAction
|
|
142
|
+
} = usePlugins(queryState, activeTab, plugins, recentSearchListSize);
|
|
152
143
|
const isEditing = !!initUrl;
|
|
153
144
|
const selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
154
145
|
const isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
@@ -457,7 +448,7 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
457
448
|
submitMessageId: submitMessageId,
|
|
458
449
|
testId: testIds.insertButton,
|
|
459
450
|
url: url
|
|
460
|
-
})),
|
|
451
|
+
})), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(SearchResults, {
|
|
461
452
|
activeTab: activeTab,
|
|
462
453
|
tabs: tabs,
|
|
463
454
|
activePlugin: activePlugin,
|
package/dist/es2019/ui/main.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
/* TODO(ASIMO-2105): cherrera2@ to remove persistent plugin banners once the experiment is over regardless of outcome */
|
|
5
4
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
6
|
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
@@ -11,10 +10,8 @@ import { ANALYTICS_CHANNEL, RECENT_SEARCH_LIST_SIZE } from '../../common/constan
|
|
|
11
10
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
12
11
|
import { usePluginReducer } from './reducer';
|
|
13
12
|
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
14
|
-
export function usePlugins(state, activeTab, plugins) {
|
|
13
|
+
export function usePlugins(state, activeTab, plugins, recentSearchListSize) {
|
|
15
14
|
var _activePlugin$tabKey;
|
|
16
|
-
var thirdPartyTabExperimentEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
17
|
-
var recentSearchListSize = arguments.length > 4 ? arguments[4] : undefined;
|
|
18
15
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
19
16
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
20
17
|
var _useState = useState(0),
|
|
@@ -129,14 +126,6 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
129
126
|
var items = pluginState.items,
|
|
130
127
|
isLoading = pluginState.isLoading,
|
|
131
128
|
error = pluginState.error;
|
|
132
|
-
|
|
133
|
-
// This is needed for the 3P tab experiments to show a persistent banner across tabs. Will be removed once the experiment is over regardless of outcome.
|
|
134
|
-
var pluginBanner = useMemo(function () {
|
|
135
|
-
var _plugins$find;
|
|
136
|
-
return thirdPartyTabExperimentEnabled ? plugins === null || plugins === void 0 || (_plugins$find = plugins.find(function (plugin) {
|
|
137
|
-
return plugin.banner;
|
|
138
|
-
})) === null || _plugins$find === void 0 ? void 0 : _plugins$find.banner : undefined;
|
|
139
|
-
}, [plugins, thirdPartyTabExperimentEnabled]);
|
|
140
129
|
return {
|
|
141
130
|
tabs: tabs,
|
|
142
131
|
items: items,
|
|
@@ -146,8 +135,7 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
146
135
|
error: error,
|
|
147
136
|
retry: handleRetry,
|
|
148
137
|
errorFallback: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.errorFallback,
|
|
149
|
-
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
150
|
-
pluginBanner: pluginBanner
|
|
138
|
+
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
151
139
|
};
|
|
152
140
|
}
|
|
153
141
|
function limit(items) {
|
|
@@ -14,7 +14,6 @@ import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
|
14
14
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
15
15
|
import uuid from 'uuid';
|
|
16
16
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
17
|
-
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
18
17
|
import { HelperMessage } from '@atlaskit/form';
|
|
19
18
|
import { CardClient } from '@atlaskit/link-provider';
|
|
20
19
|
import { isSafeUrl, normalizeUrl } from '@atlaskit/linking-common/url';
|
|
@@ -133,14 +132,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
133
132
|
hasPreview = state.hasPreview;
|
|
134
133
|
var intl = useIntl();
|
|
135
134
|
var queryState = useSearchQuery(state);
|
|
136
|
-
|
|
137
|
-
// Experiment with new 3P tabs in link picker. For more info, please see: go/link-picker-3p-drive-one-pager.
|
|
138
|
-
var linkPicker3pDriveExperimentCohort = FeatureGates.initializeCalled() ? FeatureGates.getExperimentValue('link_picker_3p_drive_experiment', 'cohort', 'control') : 'control';
|
|
139
|
-
var googleDriveTabExperimentEnabled = linkPicker3pDriveExperimentCohort === 'show_google_drive_tab';
|
|
140
|
-
var linkPicker3pOneDriveExperimentCohort = FeatureGates.initializeCalled() ? FeatureGates.getExperimentValue('link_picker_3p_onedrive_experiment', 'cohort', 'control') : 'control';
|
|
141
|
-
var oneDriveTabExperimentEnabled = linkPicker3pOneDriveExperimentCohort === 'show_onedrive_tab';
|
|
142
|
-
var thirdPartyTabExperimentEnabled = googleDriveTabExperimentEnabled || oneDriveTabExperimentEnabled;
|
|
143
|
-
var _usePlugins = usePlugins(queryState, activeTab, plugins, thirdPartyTabExperimentEnabled, recentSearchListSize),
|
|
135
|
+
var _usePlugins = usePlugins(queryState, activeTab, plugins, recentSearchListSize),
|
|
144
136
|
items = _usePlugins.items,
|
|
145
137
|
isLoadingResults = _usePlugins.isLoading,
|
|
146
138
|
isActivePlugin = _usePlugins.isActivePlugin,
|
|
@@ -148,8 +140,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
148
140
|
tabs = _usePlugins.tabs,
|
|
149
141
|
error = _usePlugins.error,
|
|
150
142
|
retry = _usePlugins.retry,
|
|
151
|
-
pluginAction = _usePlugins.pluginAction
|
|
152
|
-
pluginBanner = _usePlugins.pluginBanner;
|
|
143
|
+
pluginAction = _usePlugins.pluginAction;
|
|
153
144
|
var isEditing = !!initUrl;
|
|
154
145
|
var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
155
146
|
var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
@@ -494,7 +485,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
494
485
|
submitMessageId: submitMessageId,
|
|
495
486
|
testId: testIds.insertButton,
|
|
496
487
|
url: url
|
|
497
|
-
})),
|
|
488
|
+
})), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(SearchResults, {
|
|
498
489
|
activeTab: activeTab,
|
|
499
490
|
tabs: tabs,
|
|
500
491
|
activePlugin: activePlugin,
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -63,8 +63,6 @@ export interface LinkPickerPlugin {
|
|
|
63
63
|
errorFallback?: LinkPickerPluginErrorFallback;
|
|
64
64
|
/** Render function to customise the UI that is displayed when there are no results, but an empty form (no search term) */
|
|
65
65
|
emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
|
|
66
|
-
/** Render function to display a banner above the search results. This is exclusively used for the Google Drive tab experiment. */
|
|
67
|
-
banner?: LinkPickerPluginBanner;
|
|
68
66
|
/** Metadata about the plugin */
|
|
69
67
|
meta?: {
|
|
70
68
|
/** The data source that provides all results provided by the plugin */
|
|
@@ -83,7 +81,6 @@ export interface LinkPickerPluginAction {
|
|
|
83
81
|
}
|
|
84
82
|
export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
|
|
85
83
|
export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
|
|
86
|
-
export type LinkPickerPluginBanner = () => ReactNode;
|
|
87
84
|
export interface PickerState {
|
|
88
85
|
selectedIndex: number;
|
|
89
86
|
activeIndex: number;
|
|
@@ -5,6 +5,6 @@ export declare const SessionContext: React.Context<string>;
|
|
|
5
5
|
interface SessionProviderProps {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const LinkPickerSessionProvider: ({ children }: SessionProviderProps) => React.JSX.Element;
|
|
8
|
+
export declare const LinkPickerSessionProvider: ({ children, }: SessionProviderProps) => React.JSX.Element;
|
|
9
9
|
export declare const useLinkPickerSessionId: () => string;
|
|
10
10
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default } from './ui';
|
|
2
2
|
export { DeprecatedLazyLinkPickerExport as LinkPicker } from './ui';
|
|
3
3
|
export type { LinkPickerProps } from './common/types';
|
|
4
|
-
export type { LinkInputType, LinkPickerPluginAction,
|
|
4
|
+
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, LinkPickerUiOptions, } from './common/types';
|
|
5
5
|
export { UnauthenticatedError } from './common/utils/errors';
|
|
6
6
|
export { LoaderFallback } from './ui/loader-fallback';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LinkPickerPlugin, type LinkPickerPluginAction, type
|
|
1
|
+
import { type LinkPickerPlugin, type LinkPickerPluginAction, type LinkPickerPluginErrorFallback, type LinkPickerState, type LinkSearchListItemData } from '../../common/types';
|
|
2
2
|
export interface LinkPickerPluginsService {
|
|
3
3
|
items: LinkSearchListItemData[] | null;
|
|
4
4
|
isLoading: boolean;
|
|
@@ -11,6 +11,5 @@ export interface LinkPickerPluginsService {
|
|
|
11
11
|
retry: () => void;
|
|
12
12
|
errorFallback?: LinkPickerPluginErrorFallback;
|
|
13
13
|
pluginAction?: LinkPickerPluginAction;
|
|
14
|
-
pluginBanner?: LinkPickerPluginBanner;
|
|
15
14
|
}
|
|
16
|
-
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[],
|
|
15
|
+
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[], recentSearchListSize?: number): LinkPickerPluginsService;
|
package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/index.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export declare const messages: {
|
|
|
14
14
|
export declare const testIds: {
|
|
15
15
|
emptyResultPage: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const NoResults: ({ shouldRenderImage }: {
|
|
17
|
+
export declare const NoResults: ({ shouldRenderImage, }: {
|
|
18
18
|
shouldRenderImage?: boolean;
|
|
19
19
|
}) => React.JSX.Element;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
type LazyMessagesProviderProps = {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare const LazyMessagesProvider: ({ children }: LazyMessagesProviderProps) => React.JSX.Element;
|
|
5
|
+
export declare const LazyMessagesProvider: ({ children, }: LazyMessagesProviderProps) => React.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -66,8 +66,6 @@ export interface LinkPickerPlugin {
|
|
|
66
66
|
errorFallback?: LinkPickerPluginErrorFallback;
|
|
67
67
|
/** Render function to customise the UI that is displayed when there are no results, but an empty form (no search term) */
|
|
68
68
|
emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
|
|
69
|
-
/** Render function to display a banner above the search results. This is exclusively used for the Google Drive tab experiment. */
|
|
70
|
-
banner?: LinkPickerPluginBanner;
|
|
71
69
|
/** Metadata about the plugin */
|
|
72
70
|
meta?: {
|
|
73
71
|
/** The data source that provides all results provided by the plugin */
|
|
@@ -86,7 +84,6 @@ export interface LinkPickerPluginAction {
|
|
|
86
84
|
}
|
|
87
85
|
export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
|
|
88
86
|
export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
|
|
89
|
-
export type LinkPickerPluginBanner = () => ReactNode;
|
|
90
87
|
export interface PickerState {
|
|
91
88
|
selectedIndex: number;
|
|
92
89
|
activeIndex: number;
|
|
@@ -5,6 +5,6 @@ export declare const SessionContext: React.Context<string>;
|
|
|
5
5
|
interface SessionProviderProps {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const LinkPickerSessionProvider: ({ children }: SessionProviderProps) => React.JSX.Element;
|
|
8
|
+
export declare const LinkPickerSessionProvider: ({ children, }: SessionProviderProps) => React.JSX.Element;
|
|
9
9
|
export declare const useLinkPickerSessionId: () => string;
|
|
10
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default } from './ui';
|
|
2
2
|
export { DeprecatedLazyLinkPickerExport as LinkPicker } from './ui';
|
|
3
3
|
export type { LinkPickerProps } from './common/types';
|
|
4
|
-
export type { LinkInputType, LinkPickerPluginAction,
|
|
4
|
+
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, LinkPickerUiOptions, } from './common/types';
|
|
5
5
|
export { UnauthenticatedError } from './common/utils/errors';
|
|
6
6
|
export { LoaderFallback } from './ui/loader-fallback';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LinkPickerPlugin, type LinkPickerPluginAction, type
|
|
1
|
+
import { type LinkPickerPlugin, type LinkPickerPluginAction, type LinkPickerPluginErrorFallback, type LinkPickerState, type LinkSearchListItemData } from '../../common/types';
|
|
2
2
|
export interface LinkPickerPluginsService {
|
|
3
3
|
items: LinkSearchListItemData[] | null;
|
|
4
4
|
isLoading: boolean;
|
|
@@ -11,6 +11,5 @@ export interface LinkPickerPluginsService {
|
|
|
11
11
|
retry: () => void;
|
|
12
12
|
errorFallback?: LinkPickerPluginErrorFallback;
|
|
13
13
|
pluginAction?: LinkPickerPluginAction;
|
|
14
|
-
pluginBanner?: LinkPickerPluginBanner;
|
|
15
14
|
}
|
|
16
|
-
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[],
|
|
15
|
+
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[], recentSearchListSize?: number): LinkPickerPluginsService;
|
|
@@ -14,6 +14,6 @@ export declare const messages: {
|
|
|
14
14
|
export declare const testIds: {
|
|
15
15
|
emptyResultPage: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const NoResults: ({ shouldRenderImage }: {
|
|
17
|
+
export declare const NoResults: ({ shouldRenderImage, }: {
|
|
18
18
|
shouldRenderImage?: boolean;
|
|
19
19
|
}) => React.JSX.Element;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
type LazyMessagesProviderProps = {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare const LazyMessagesProvider: ({ children }: LazyMessagesProviderProps) => React.JSX.Element;
|
|
5
|
+
export declare const LazyMessagesProvider: ({ children, }: LazyMessagesProviderProps) => React.JSX.Element;
|
|
6
6
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/button": "^23.6.0",
|
|
56
56
|
"@atlaskit/css": "^0.16.0",
|
|
57
57
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
58
|
-
"@atlaskit/form": "^14.
|
|
58
|
+
"@atlaskit/form": "^14.3.0",
|
|
59
59
|
"@atlaskit/frontend-utilities": "^3.2.0",
|
|
60
60
|
"@atlaskit/heading": "^5.2.0",
|
|
61
61
|
"@atlaskit/icon": "^29.0.0",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"@atlaskit/onboarding": "^14.4.0",
|
|
67
67
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
68
68
|
"@atlaskit/primitives": "^16.2.0",
|
|
69
|
-
"@atlaskit/smart-card": "^43.
|
|
69
|
+
"@atlaskit/smart-card": "^43.9.0",
|
|
70
70
|
"@atlaskit/spinner": "^19.0.0",
|
|
71
71
|
"@atlaskit/tabs": "^18.2.0",
|
|
72
72
|
"@atlaskit/textfield": "^8.1.0",
|
|
73
73
|
"@atlaskit/theme": "^21.0.0",
|
|
74
|
-
"@atlaskit/tokens": "^8.
|
|
74
|
+
"@atlaskit/tokens": "^8.2.0",
|
|
75
75
|
"@atlaskit/tooltip": "^20.10.0",
|
|
76
76
|
"@atlaskit/ufo": "^0.4.0",
|
|
77
77
|
"@atlaskit/visually-hidden": "^3.0.0",
|