@atlaskit/link-picker 3.10.6 → 3.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/common/generic-error-svg/index.js +1 -1
  3. package/dist/cjs/common/ui/empty-state/index.js +1 -1
  4. package/dist/cjs/common/ui/min-height-container/index.js +1 -1
  5. package/dist/cjs/services/use-plugins/index.js +13 -1
  6. package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +1 -1
  7. package/dist/cjs/ui/link-picker/form-footer/index.js +1 -1
  8. package/dist/cjs/ui/link-picker/index.js +10 -4
  9. package/dist/cjs/ui/link-picker/search-results/index.js +1 -1
  10. package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +1 -1
  11. package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +1 -1
  12. package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.compiled.css +2 -2
  13. package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.js +2 -4
  14. package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.js +1 -1
  15. package/dist/cjs/ui/link-picker/search-results/search-results-container/index.js +1 -1
  16. package/dist/cjs/ui/link-picker/text-input/index.js +1 -1
  17. package/dist/cjs/ui/loader-fallback/index.js +1 -1
  18. package/dist/cjs/ui/main.js +2 -2
  19. package/dist/es2019/common/generic-error-svg/index.js +1 -1
  20. package/dist/es2019/common/ui/empty-state/index.js +1 -1
  21. package/dist/es2019/common/ui/min-height-container/index.js +1 -1
  22. package/dist/es2019/services/use-plugins/index.js +10 -2
  23. package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +1 -1
  24. package/dist/es2019/ui/link-picker/form-footer/index.js +1 -1
  25. package/dist/es2019/ui/link-picker/index.js +10 -4
  26. package/dist/es2019/ui/link-picker/search-results/index.js +1 -1
  27. package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +1 -1
  28. package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +1 -1
  29. package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/index.js +1 -1
  30. package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/index.js +1 -1
  31. package/dist/es2019/ui/link-picker/search-results/search-results-container/index.js +1 -1
  32. package/dist/es2019/ui/link-picker/text-input/index.js +1 -1
  33. package/dist/es2019/ui/loader-fallback/index.js +1 -1
  34. package/dist/es2019/ui/main.js +2 -2
  35. package/dist/esm/common/generic-error-svg/index.js +1 -1
  36. package/dist/esm/common/ui/empty-state/index.js +1 -1
  37. package/dist/esm/common/ui/min-height-container/index.js +1 -1
  38. package/dist/esm/services/use-plugins/index.js +12 -1
  39. package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +1 -1
  40. package/dist/esm/ui/link-picker/form-footer/index.js +1 -1
  41. package/dist/esm/ui/link-picker/index.js +10 -4
  42. package/dist/esm/ui/link-picker/search-results/index.js +1 -1
  43. package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +1 -1
  44. package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +1 -1
  45. package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.compiled.css +2 -2
  46. package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.js +2 -4
  47. package/dist/esm/ui/link-picker/search-results/scrolling-tabs/index.js +1 -1
  48. package/dist/esm/ui/link-picker/search-results/search-results-container/index.js +1 -1
  49. package/dist/esm/ui/link-picker/text-input/index.js +1 -1
  50. package/dist/esm/ui/loader-fallback/index.js +1 -1
  51. package/dist/esm/ui/main.js +2 -2
  52. package/dist/types/common/types.d.ts +3 -0
  53. package/dist/types/index.d.ts +1 -1
  54. package/dist/types/services/use-plugins/index.d.ts +3 -2
  55. package/dist/types-ts4.5/common/types.d.ts +3 -0
  56. package/dist/types-ts4.5/index.d.ts +1 -1
  57. package/dist/types-ts4.5/services/use-plugins/index.d.ts +3 -2
  58. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 3.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`489caede2951a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/489caede2951a) -
14
+ [ux] link-picker-atlassian-plugin changes:
15
+
16
+ - Introduce GoogleDriveConnectBanner to support Google Drive tab experiment
17
+
18
+ link-picker changes:
19
+
20
+ - Extend the LinkPickerPlugin interface to include an optional banner render function
21
+ - Modify the usePlugins hook to collect the banner from the active plugin
22
+ - Add banner rendering in LinkPicker between the moveSubmitButton clause and SearchResults
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 3.10.6
4
29
 
5
30
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -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) {
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -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
- var _usePlugins = (0, _usePlugins2.usePlugins)(queryState, activeTab, plugins),
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,
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -2,7 +2,7 @@
2
2
  ._16qs1f4r{box-shadow:var(--_1mo126v)}
3
3
  ._18m915vq{overflow-y:hidden}
4
4
  ._18u0idpf{margin-left:0}
5
- ._19bvrvlv{padding-left:var(--_u7ouzj)}
5
+ ._19bvsy6a{padding-left:clamp(var(--ds-space-100,8px),var(--link-picker-padding-left),100%)}
6
6
  ._19pk1b66{margin-top:var(--ds-space-050,4px)}
7
7
  ._19pkidpf{margin-top:0}
8
8
  ._1bsb1osq{width:100%}
@@ -23,7 +23,7 @@
23
23
  ._syaz121t{color:var(--_1pseksa)}
24
24
  ._syaz1svm{color:var(--_1trgtlr)}
25
25
  ._syazct01{color:var(--_khvm95)}
26
- ._u5f3kq6n{padding-right:var(--_1kucder)}
26
+ ._u5f3fxbg{padding-right:clamp(var(--ds-space-100,8px),var(--link-picker-padding-right),100%)}
27
27
  ._1a3b1r31:focus{text-decoration-color:currentColor}
28
28
  ._1hvw1o36:focus{outline-width:medium}
29
29
  ._49pcglyw:focus{outline-style:none}
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -134,10 +134,8 @@ var LinkSearchListItem = exports.LinkSearchListItem = /*#__PURE__*/(0, _react.fo
134
134
  onFocus: onFocus,
135
135
  tabIndex: tabIndex,
136
136
  ref: ref,
137
- className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _ca0qu2gc _n3tdu2gc _19bvrvlv _u5f3kq6n _80omtlke", !selected && "_irr38iyy _1dbz1f4r", selected && "_bfhk1kxl _16qs1f4r", "_nt751r31 _49pcglyw _1hvw1o36 _1a3b1r31 _4fprglyw _5goinqa1 _7ehif7x9"]),
137
+ className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _ca0qu2gc _n3tdu2gc _19bvsy6a _u5f3fxbg _80omtlke", !selected && "_irr38iyy _1dbz1f4r", selected && "_bfhk1kxl _16qs1f4r", "_nt751r31 _49pcglyw _1hvw1o36 _1a3b1r31 _4fprglyw _5goinqa1 _7ehif7x9"]),
138
138
  style: {
139
- "--_u7ouzj": (0, _runtime.ix)("clamp( ".concat("var(--ds-space-100, 8px)", ", var(--link-picker-padding-left), 100% )")),
140
- "--_1kucder": (0, _runtime.ix)("clamp( ".concat("var(--ds-space-100, 8px)", ", var(--link-picker-padding-right), 100% )")),
141
139
  "--_mmrjro": (0, _runtime.ix)("var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")")),
142
140
  "--_1mo126v": (0, _runtime.ix)("inset 2px 0px 0px ".concat("var(--ds-border-selected, ".concat(_colors.B400, ")"))),
143
141
  "--_rryx0a": (0, _runtime.ix)("var(--ds-background-selected, ".concat(_colors.B50, ")")),
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* main.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* main.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -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: "0.0.0-development" || '',
28
+ packageVersion: "3.11.0" || '',
29
29
  componentName: _constants.COMPONENT_NAME,
30
30
  source: _constants.COMPONENT_NAME
31
31
  };
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -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) {
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
@@ -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
- } = usePlugins(queryState, activeTab, plugins);
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,
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* main.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* main.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./main.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -15,7 +15,7 @@ export const testIds = {
15
15
  };
16
16
  export const PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/link-picker" || '',
18
- packageVersion: "0.0.0-development" || '',
18
+ packageVersion: "3.11.0" || '',
19
19
  componentName: COMPONENT_NAME,
20
20
  source: COMPONENT_NAME
21
21
  };
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
@@ -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) {
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["isLoading", "isSubmitting", "error", "url", "queryState", "items", "isEditing", "onCancel", "action", "customSubmitButtonLabel", "submitMessageId", "hideSubmitButton", "className"];
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
@@ -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
- var _usePlugins = usePlugins(queryState, activeTab, plugins),
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,
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
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";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -2,7 +2,7 @@
2
2
  ._16qs1f4r{box-shadow:var(--_1mo126v)}
3
3
  ._18m915vq{overflow-y:hidden}
4
4
  ._18u0idpf{margin-left:0}
5
- ._19bvrvlv{padding-left:var(--_u7ouzj)}
5
+ ._19bvsy6a{padding-left:clamp(var(--ds-space-100,8px),var(--link-picker-padding-left),100%)}
6
6
  ._19pk1b66{margin-top:var(--ds-space-050,4px)}
7
7
  ._19pkidpf{margin-top:0}
8
8
  ._1bsb1osq{width:100%}
@@ -23,7 +23,7 @@
23
23
  ._syaz121t{color:var(--_1pseksa)}
24
24
  ._syaz1svm{color:var(--_1trgtlr)}
25
25
  ._syazct01{color:var(--_khvm95)}
26
- ._u5f3kq6n{padding-right:var(--_1kucder)}
26
+ ._u5f3fxbg{padding-right:clamp(var(--ds-space-100,8px),var(--link-picker-padding-right),100%)}
27
27
  ._1a3b1r31:focus{text-decoration-color:currentColor}
28
28
  ._1hvw1o36:focus{outline-width:medium}
29
29
  ._49pcglyw:focus{outline-style:none}
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
@@ -125,10 +125,8 @@ export var LinkSearchListItem = /*#__PURE__*/forwardRef(function (_ref2, ref) {
125
125
  onFocus: onFocus,
126
126
  tabIndex: tabIndex,
127
127
  ref: ref,
128
- className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _ca0qu2gc _n3tdu2gc _19bvrvlv _u5f3kq6n _80omtlke", !selected && "_irr38iyy _1dbz1f4r", selected && "_bfhk1kxl _16qs1f4r", "_nt751r31 _49pcglyw _1hvw1o36 _1a3b1r31 _4fprglyw _5goinqa1 _7ehif7x9"]),
128
+ className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _ca0qu2gc _n3tdu2gc _19bvsy6a _u5f3fxbg _80omtlke", !selected && "_irr38iyy _1dbz1f4r", selected && "_bfhk1kxl _16qs1f4r", "_nt751r31 _49pcglyw _1hvw1o36 _1a3b1r31 _4fprglyw _5goinqa1 _7ehif7x9"]),
129
129
  style: {
130
- "--_u7ouzj": ix("clamp( ".concat("var(--ds-space-100, 8px)", ", var(--link-picker-padding-left), 100% )")),
131
- "--_1kucder": ix("clamp( ".concat("var(--ds-space-100, 8px)", ", var(--link-picker-padding-right), 100% )")),
132
130
  "--_mmrjro": ix("var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")")),
133
131
  "--_1mo126v": ix("inset 2px 0px 0px ".concat("var(--ds-border-selected, ".concat(B400, ")"))),
134
132
  "--_rryx0a": ix("var(--ds-background-selected, ".concat(B50, ")")),
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import "./index.compiled.css";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName", "inputRef", "isRequired"];
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* main.tsx generated by @compiled/babel-plugin v0.36.1 */
1
+ /* main.tsx generated by @compiled/babel-plugin v0.38.1 */
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _extends from "@babel/runtime/helpers/extends";
4
4
  import "./main.compiled.css";
@@ -16,7 +16,7 @@ export var testIds = {
16
16
  };
17
17
  export var PACKAGE_DATA = {
18
18
  packageName: "@atlaskit/link-picker" || '',
19
- packageVersion: "0.0.0-development" || '',
19
+ packageVersion: "3.11.0" || '',
20
20
  componentName: COMPONENT_NAME,
21
21
  source: COMPONENT_NAME
22
22
  };
@@ -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;
@@ -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.10.6",
3
+ "version": "3.11.1",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -51,11 +51,11 @@
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.5.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",
58
- "@atlaskit/form": "^12.7.0",
58
+ "@atlaskit/form": "^13.0.0",
59
59
  "@atlaskit/frontend-utilities": "^3.1.0",
60
60
  "@atlaskit/heading": "^5.2.0",
61
61
  "@atlaskit/icon": "^28.2.0",
@@ -65,7 +65,7 @@
65
65
  "@atlaskit/linking-common": "^9.6.0",
66
66
  "@atlaskit/onboarding": "^14.4.0",
67
67
  "@atlaskit/platform-feature-flags": "^1.1.0",
68
- "@atlaskit/primitives": "^14.14.0",
68
+ "@atlaskit/primitives": "^14.15.0",
69
69
  "@atlaskit/smart-card": "^42.0.0",
70
70
  "@atlaskit/spinner": "^19.0.0",
71
71
  "@atlaskit/tabs": "^18.1.0",