@atlaskit/link-picker 3.10.6 → 3.11.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 +13 -1
- package/dist/cjs/ui/link-picker/index.js +9 -3
- package/dist/cjs/ui/main.js +1 -1
- package/dist/es2019/services/use-plugins/index.js +10 -2
- package/dist/es2019/ui/link-picker/index.js +9 -3
- package/dist/es2019/ui/main.js +1 -1
- package/dist/esm/services/use-plugins/index.js +12 -1
- package/dist/esm/ui/link-picker/index.js +9 -3
- package/dist/esm/ui/main.js +1 -1
- package/dist/types/common/types.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/services/use-plugins/index.d.ts +3 -2
- package/dist/types-ts4.5/common/types.d.ts +3 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/services/use-plugins/index.d.ts +3 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/link-picker
|
|
2
2
|
|
|
3
|
+
## 3.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`489caede2951a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/489caede2951a) -
|
|
8
|
+
[ux] link-picker-atlassian-plugin changes:
|
|
9
|
+
|
|
10
|
+
- Introduce GoogleDriveConnectBanner to support Google Drive tab experiment
|
|
11
|
+
|
|
12
|
+
link-picker changes:
|
|
13
|
+
|
|
14
|
+
- Extend the LinkPickerPlugin interface to include an optional banner render function
|
|
15
|
+
- Modify the usePlugins hook to collect the banner from the active plugin
|
|
16
|
+
- Add banner rendering in LinkPicker between the moveSubmitButton clause and SearchResults
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 3.10.6
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -16,8 +16,11 @@ var _constants = require("../../common/constants");
|
|
|
16
16
|
var _analytics2 = _interopRequireDefault(require("../../common/utils/analytics/analytics.codegen"));
|
|
17
17
|
var _reducer = require("./reducer");
|
|
18
18
|
var _utils = require("./utils");
|
|
19
|
+
/* TODO(ASIMO-2105): cherrera2@ to remove persistent plugin banners once the experiment is over regardless of outcome */
|
|
20
|
+
|
|
19
21
|
function usePlugins(state, activeTab, plugins) {
|
|
20
22
|
var _activePlugin$tabKey;
|
|
23
|
+
var googleDriveTabExperimentEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
21
24
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
22
25
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
23
26
|
var _useState = (0, _react.useState)(0),
|
|
@@ -132,6 +135,14 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
132
135
|
var items = pluginState.items,
|
|
133
136
|
isLoading = pluginState.isLoading,
|
|
134
137
|
error = pluginState.error;
|
|
138
|
+
|
|
139
|
+
// This is needed for the Google Drive tab experiment to show a persistent banner across tabs. Will be removed once the experiment is over regardless of outcome.
|
|
140
|
+
var pluginBanner = (0, _react.useMemo)(function () {
|
|
141
|
+
var _plugins$find;
|
|
142
|
+
return googleDriveTabExperimentEnabled ? plugins === null || plugins === void 0 || (_plugins$find = plugins.find(function (plugin) {
|
|
143
|
+
return plugin.banner;
|
|
144
|
+
})) === null || _plugins$find === void 0 ? void 0 : _plugins$find.banner : undefined;
|
|
145
|
+
}, [plugins, googleDriveTabExperimentEnabled]);
|
|
135
146
|
return {
|
|
136
147
|
tabs: tabs,
|
|
137
148
|
items: items,
|
|
@@ -141,7 +152,8 @@ function usePlugins(state, activeTab, plugins) {
|
|
|
141
152
|
error: error,
|
|
142
153
|
retry: handleRetry,
|
|
143
154
|
errorFallback: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.errorFallback,
|
|
144
|
-
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
155
|
+
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action,
|
|
156
|
+
pluginBanner: pluginBanner
|
|
145
157
|
};
|
|
146
158
|
}
|
|
147
159
|
function limit(items) {
|
|
@@ -19,6 +19,7 @@ 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"));
|
|
22
23
|
var _form = require("@atlaskit/form");
|
|
23
24
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
24
25
|
var _url2 = require("@atlaskit/linking-common/url");
|
|
@@ -135,7 +136,11 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
135
136
|
hasPreview = state.hasPreview;
|
|
136
137
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
137
138
|
var queryState = (0, _useSearchQuery.useSearchQuery)(state);
|
|
138
|
-
|
|
139
|
+
|
|
140
|
+
// Experiment with new 3P tabs in link picker where "Google Drive" is shown as the second tab. For more info, please see: go/link-picker-3p-drive-one-pager.
|
|
141
|
+
var linkPicker3pDriveExperimentCohort = _featureGateJsClient.default.initializeCalled() ? _featureGateJsClient.default.getExperimentValue('link_picker_3p_drive_experiment', 'cohort', 'control') : 'control';
|
|
142
|
+
var googleDriveTabExperimentEnabled = linkPicker3pDriveExperimentCohort === 'show_google_drive_tab';
|
|
143
|
+
var _usePlugins = (0, _usePlugins2.usePlugins)(queryState, activeTab, plugins, googleDriveTabExperimentEnabled),
|
|
139
144
|
items = _usePlugins.items,
|
|
140
145
|
isLoadingResults = _usePlugins.isLoading,
|
|
141
146
|
isActivePlugin = _usePlugins.isActivePlugin,
|
|
@@ -143,7 +148,8 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
143
148
|
tabs = _usePlugins.tabs,
|
|
144
149
|
error = _usePlugins.error,
|
|
145
150
|
retry = _usePlugins.retry,
|
|
146
|
-
pluginAction = _usePlugins.pluginAction
|
|
151
|
+
pluginAction = _usePlugins.pluginAction,
|
|
152
|
+
pluginBanner = _usePlugins.pluginBanner;
|
|
147
153
|
var isEditing = !!initUrl;
|
|
148
154
|
var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
149
155
|
var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
@@ -472,7 +478,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
|
|
|
472
478
|
submitMessageId: submitMessageId,
|
|
473
479
|
testId: testIds.insertButton,
|
|
474
480
|
url: url
|
|
475
|
-
})), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(_searchResults.SearchResults, {
|
|
481
|
+
})), googleDriveTabExperimentEnabled && pluginBanner && pluginBanner(), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(_searchResults.SearchResults, {
|
|
476
482
|
activeTab: activeTab,
|
|
477
483
|
tabs: tabs,
|
|
478
484
|
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: "
|
|
28
|
+
packageVersion: "3.10.6" || '',
|
|
29
29
|
componentName: _constants.COMPONENT_NAME,
|
|
30
30
|
source: _constants.COMPONENT_NAME
|
|
31
31
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* TODO(ASIMO-2105): cherrera2@ to remove persistent plugin banners once the experiment is over regardless of outcome */
|
|
1
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
4
|
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
@@ -6,7 +7,7 @@ import { ANALYTICS_CHANNEL, RECENT_SEARCH_LIST_SIZE } from '../../common/constan
|
|
|
6
7
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
7
8
|
import { usePluginReducer } from './reducer';
|
|
8
9
|
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
9
|
-
export function usePlugins(state, activeTab, plugins) {
|
|
10
|
+
export function usePlugins(state, activeTab, plugins, googleDriveTabExperimentEnabled = false) {
|
|
10
11
|
var _activePlugin$tabKey;
|
|
11
12
|
const {
|
|
12
13
|
createAnalyticsEvent
|
|
@@ -90,6 +91,12 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
90
91
|
isLoading,
|
|
91
92
|
error
|
|
92
93
|
} = pluginState;
|
|
94
|
+
|
|
95
|
+
// This is needed for the Google Drive tab experiment to show a persistent banner across tabs. Will be removed once the experiment is over regardless of outcome.
|
|
96
|
+
const pluginBanner = useMemo(() => {
|
|
97
|
+
var _plugins$find;
|
|
98
|
+
return googleDriveTabExperimentEnabled ? 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;
|
|
99
|
+
}, [plugins, googleDriveTabExperimentEnabled]);
|
|
93
100
|
return {
|
|
94
101
|
tabs,
|
|
95
102
|
items,
|
|
@@ -99,7 +106,8 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
99
106
|
error,
|
|
100
107
|
retry: handleRetry,
|
|
101
108
|
errorFallback: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.errorFallback,
|
|
102
|
-
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
109
|
+
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action,
|
|
110
|
+
pluginBanner
|
|
103
111
|
};
|
|
104
112
|
}
|
|
105
113
|
function limit(items) {
|
|
@@ -7,6 +7,7 @@ import { Fragment, memo, useCallback, useLayoutEffect, useMemo, useReducer } fro
|
|
|
7
7
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
8
8
|
import uuid from 'uuid';
|
|
9
9
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
|
+
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
10
11
|
import { HelperMessage } from '@atlaskit/form';
|
|
11
12
|
import { CardClient } from '@atlaskit/link-provider';
|
|
12
13
|
import { isSafeUrl, normalizeUrl } from '@atlaskit/linking-common/url';
|
|
@@ -125,6 +126,10 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
125
126
|
} = state;
|
|
126
127
|
const intl = useIntl();
|
|
127
128
|
const queryState = useSearchQuery(state);
|
|
129
|
+
|
|
130
|
+
// Experiment with new 3P tabs in link picker where "Google Drive" is shown as the second tab. For more info, please see: go/link-picker-3p-drive-one-pager.
|
|
131
|
+
const linkPicker3pDriveExperimentCohort = FeatureGates.initializeCalled() ? FeatureGates.getExperimentValue('link_picker_3p_drive_experiment', 'cohort', 'control') : 'control';
|
|
132
|
+
const googleDriveTabExperimentEnabled = linkPicker3pDriveExperimentCohort === 'show_google_drive_tab';
|
|
128
133
|
const {
|
|
129
134
|
items,
|
|
130
135
|
isLoading: isLoadingResults,
|
|
@@ -133,8 +138,9 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
133
138
|
tabs,
|
|
134
139
|
error,
|
|
135
140
|
retry,
|
|
136
|
-
pluginAction
|
|
137
|
-
|
|
141
|
+
pluginAction,
|
|
142
|
+
pluginBanner
|
|
143
|
+
} = usePlugins(queryState, activeTab, plugins, googleDriveTabExperimentEnabled);
|
|
138
144
|
const isEditing = !!initUrl;
|
|
139
145
|
const selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
140
146
|
const isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
@@ -427,7 +433,7 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
|
427
433
|
submitMessageId: submitMessageId,
|
|
428
434
|
testId: testIds.insertButton,
|
|
429
435
|
url: url
|
|
430
|
-
})), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(SearchResults, {
|
|
436
|
+
})), googleDriveTabExperimentEnabled && pluginBanner && pluginBanner(), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(SearchResults, {
|
|
431
437
|
activeTab: activeTab,
|
|
432
438
|
tabs: tabs,
|
|
433
439
|
activePlugin: activePlugin,
|
package/dist/es2019/ui/main.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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 */
|
|
4
5
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
6
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
7
|
import { convertToError } from '@atlaskit/frontend-utilities/convert-to-error';
|
|
@@ -11,6 +12,7 @@ import { usePluginReducer } from './reducer';
|
|
|
11
12
|
import { CancellationError, resolvePluginUpdates } from './utils';
|
|
12
13
|
export function usePlugins(state, activeTab, plugins) {
|
|
13
14
|
var _activePlugin$tabKey;
|
|
15
|
+
var googleDriveTabExperimentEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
14
16
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
15
17
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
16
18
|
var _useState = useState(0),
|
|
@@ -125,6 +127,14 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
125
127
|
var items = pluginState.items,
|
|
126
128
|
isLoading = pluginState.isLoading,
|
|
127
129
|
error = pluginState.error;
|
|
130
|
+
|
|
131
|
+
// This is needed for the Google Drive tab experiment to show a persistent banner across tabs. Will be removed once the experiment is over regardless of outcome.
|
|
132
|
+
var pluginBanner = useMemo(function () {
|
|
133
|
+
var _plugins$find;
|
|
134
|
+
return googleDriveTabExperimentEnabled ? plugins === null || plugins === void 0 || (_plugins$find = plugins.find(function (plugin) {
|
|
135
|
+
return plugin.banner;
|
|
136
|
+
})) === null || _plugins$find === void 0 ? void 0 : _plugins$find.banner : undefined;
|
|
137
|
+
}, [plugins, googleDriveTabExperimentEnabled]);
|
|
128
138
|
return {
|
|
129
139
|
tabs: tabs,
|
|
130
140
|
items: items,
|
|
@@ -134,7 +144,8 @@ export function usePlugins(state, activeTab, plugins) {
|
|
|
134
144
|
error: error,
|
|
135
145
|
retry: handleRetry,
|
|
136
146
|
errorFallback: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.errorFallback,
|
|
137
|
-
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action
|
|
147
|
+
pluginAction: activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.action,
|
|
148
|
+
pluginBanner: pluginBanner
|
|
138
149
|
};
|
|
139
150
|
}
|
|
140
151
|
function limit(items) {
|
|
@@ -13,6 +13,7 @@ import { Fragment, memo, useCallback, useLayoutEffect, useMemo, useReducer } fro
|
|
|
13
13
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
14
14
|
import uuid from 'uuid';
|
|
15
15
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
|
+
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
16
17
|
import { HelperMessage } from '@atlaskit/form';
|
|
17
18
|
import { CardClient } from '@atlaskit/link-provider';
|
|
18
19
|
import { isSafeUrl, normalizeUrl } from '@atlaskit/linking-common/url';
|
|
@@ -126,7 +127,11 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
126
127
|
hasPreview = state.hasPreview;
|
|
127
128
|
var intl = useIntl();
|
|
128
129
|
var queryState = useSearchQuery(state);
|
|
129
|
-
|
|
130
|
+
|
|
131
|
+
// Experiment with new 3P tabs in link picker where "Google Drive" is shown as the second tab. For more info, please see: go/link-picker-3p-drive-one-pager.
|
|
132
|
+
var linkPicker3pDriveExperimentCohort = FeatureGates.initializeCalled() ? FeatureGates.getExperimentValue('link_picker_3p_drive_experiment', 'cohort', 'control') : 'control';
|
|
133
|
+
var googleDriveTabExperimentEnabled = linkPicker3pDriveExperimentCohort === 'show_google_drive_tab';
|
|
134
|
+
var _usePlugins = usePlugins(queryState, activeTab, plugins, googleDriveTabExperimentEnabled),
|
|
130
135
|
items = _usePlugins.items,
|
|
131
136
|
isLoadingResults = _usePlugins.isLoading,
|
|
132
137
|
isActivePlugin = _usePlugins.isActivePlugin,
|
|
@@ -134,7 +139,8 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
134
139
|
tabs = _usePlugins.tabs,
|
|
135
140
|
error = _usePlugins.error,
|
|
136
141
|
retry = _usePlugins.retry,
|
|
137
|
-
pluginAction = _usePlugins.pluginAction
|
|
142
|
+
pluginAction = _usePlugins.pluginAction,
|
|
143
|
+
pluginBanner = _usePlugins.pluginBanner;
|
|
138
144
|
var isEditing = !!initUrl;
|
|
139
145
|
var selectedItem = items === null || items === void 0 ? void 0 : items[selectedIndex];
|
|
140
146
|
var isSelectedItem = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.url) === url;
|
|
@@ -463,7 +469,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
463
469
|
submitMessageId: submitMessageId,
|
|
464
470
|
testId: testIds.insertButton,
|
|
465
471
|
url: url
|
|
466
|
-
})), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(SearchResults, {
|
|
472
|
+
})), googleDriveTabExperimentEnabled && pluginBanner && pluginBanner(), !!queryState && (isLoadingPlugins || isActivePlugin) && /*#__PURE__*/React.createElement(SearchResults, {
|
|
467
473
|
activeTab: activeTab,
|
|
468
474
|
tabs: tabs,
|
|
469
475
|
activePlugin: activePlugin,
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -55,6 +55,8 @@ export interface LinkPickerPlugin {
|
|
|
55
55
|
errorFallback?: LinkPickerPluginErrorFallback;
|
|
56
56
|
/** Render function to customise the UI that is displayed when there are no results, but an empty form (no search term) */
|
|
57
57
|
emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
|
|
58
|
+
/** Render function to display a banner above the search results. This is exclusively used for the Google Drive tab experiment. */
|
|
59
|
+
banner?: LinkPickerPluginBanner;
|
|
58
60
|
/** Metadata about the plugin */
|
|
59
61
|
meta?: {
|
|
60
62
|
/** The data source that provides all results provided by the plugin */
|
|
@@ -73,6 +75,7 @@ export interface LinkPickerPluginAction {
|
|
|
73
75
|
}
|
|
74
76
|
export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
|
|
75
77
|
export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
|
|
78
|
+
export type LinkPickerPluginBanner = () => ReactNode;
|
|
76
79
|
export interface PickerState {
|
|
77
80
|
selectedIndex: number;
|
|
78
81
|
activeIndex: number;
|
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, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, LinkPickerUiOptions, } from './common/types';
|
|
4
|
+
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPluginBanner, 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 LinkPickerPluginErrorFallback, type LinkPickerState, type LinkSearchListItemData } from '../../common/types';
|
|
1
|
+
import { type LinkPickerPlugin, type LinkPickerPluginAction, type LinkPickerPluginBanner, type LinkPickerPluginErrorFallback, type LinkPickerState, type LinkSearchListItemData } from '../../common/types';
|
|
2
2
|
export interface LinkPickerPluginsService {
|
|
3
3
|
items: LinkSearchListItemData[] | null;
|
|
4
4
|
isLoading: boolean;
|
|
@@ -11,5 +11,6 @@ export interface LinkPickerPluginsService {
|
|
|
11
11
|
retry: () => void;
|
|
12
12
|
errorFallback?: LinkPickerPluginErrorFallback;
|
|
13
13
|
pluginAction?: LinkPickerPluginAction;
|
|
14
|
+
pluginBanner?: LinkPickerPluginBanner;
|
|
14
15
|
}
|
|
15
|
-
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[]): LinkPickerPluginsService;
|
|
16
|
+
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[], googleDriveTabExperimentEnabled?: boolean): LinkPickerPluginsService;
|
|
@@ -58,6 +58,8 @@ export interface LinkPickerPlugin {
|
|
|
58
58
|
errorFallback?: LinkPickerPluginErrorFallback;
|
|
59
59
|
/** Render function to customise the UI that is displayed when there are no results, but an empty form (no search term) */
|
|
60
60
|
emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
|
|
61
|
+
/** Render function to display a banner above the search results. This is exclusively used for the Google Drive tab experiment. */
|
|
62
|
+
banner?: LinkPickerPluginBanner;
|
|
61
63
|
/** Metadata about the plugin */
|
|
62
64
|
meta?: {
|
|
63
65
|
/** The data source that provides all results provided by the plugin */
|
|
@@ -76,6 +78,7 @@ export interface LinkPickerPluginAction {
|
|
|
76
78
|
}
|
|
77
79
|
export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
|
|
78
80
|
export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
|
|
81
|
+
export type LinkPickerPluginBanner = () => ReactNode;
|
|
79
82
|
export interface PickerState {
|
|
80
83
|
selectedIndex: number;
|
|
81
84
|
activeIndex: number;
|
|
@@ -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, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, LinkPickerUiOptions, } from './common/types';
|
|
4
|
+
export type { LinkInputType, LinkPickerPluginAction, LinkPickerPluginBanner, 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 LinkPickerPluginErrorFallback, type LinkPickerState, type LinkSearchListItemData } from '../../common/types';
|
|
1
|
+
import { type LinkPickerPlugin, type LinkPickerPluginAction, type LinkPickerPluginBanner, type LinkPickerPluginErrorFallback, type LinkPickerState, type LinkSearchListItemData } from '../../common/types';
|
|
2
2
|
export interface LinkPickerPluginsService {
|
|
3
3
|
items: LinkSearchListItemData[] | null;
|
|
4
4
|
isLoading: boolean;
|
|
@@ -11,5 +11,6 @@ export interface LinkPickerPluginsService {
|
|
|
11
11
|
retry: () => void;
|
|
12
12
|
errorFallback?: LinkPickerPluginErrorFallback;
|
|
13
13
|
pluginAction?: LinkPickerPluginAction;
|
|
14
|
+
pluginBanner?: LinkPickerPluginBanner;
|
|
14
15
|
}
|
|
15
|
-
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[]): LinkPickerPluginsService;
|
|
16
|
+
export declare function usePlugins(state: LinkPickerState | null, activeTab: number, plugins?: LinkPickerPlugin[], googleDriveTabExperimentEnabled?: boolean): LinkPickerPluginsService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@atlaskit/afm-i18n-platform-linking-platform-link-picker": "2.7.0",
|
|
53
53
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
54
|
-
"@atlaskit/atlassian-context": "^0.
|
|
54
|
+
"@atlaskit/atlassian-context": "^0.6.0",
|
|
55
55
|
"@atlaskit/button": "^23.4.0",
|
|
56
56
|
"@atlaskit/css": "^0.14.0",
|
|
57
57
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|