@atlaskit/link-picker 1.39.5 → 1.41.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/common/generic-error-svg/index.js +4 -1
  3. package/dist/cjs/common/ui/min-height-container/index.js +4 -1
  4. package/dist/cjs/index.js +12 -4
  5. package/dist/cjs/lazy.js +13 -0
  6. package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +4 -1
  7. package/dist/cjs/ui/index.js +17 -78
  8. package/dist/cjs/ui/lazy.js +27 -0
  9. package/dist/cjs/ui/link-picker/form-footer/feature-discovery/index.js +4 -1
  10. package/dist/cjs/ui/link-picker/form-footer/index.js +9 -3
  11. package/dist/cjs/ui/link-picker/index.js +5 -2
  12. package/dist/cjs/ui/link-picker/search-results/index.js +4 -1
  13. package/dist/cjs/ui/link-picker/search-results/link-search-error/index.js +4 -1
  14. package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +4 -1
  15. package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +4 -1
  16. package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.js +4 -1
  17. package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.js +19 -19
  18. package/dist/cjs/ui/link-picker/search-results/search-results-container/index.js +4 -1
  19. package/dist/cjs/ui/link-picker/search-results/track-tab-viewed/index.js +4 -1
  20. package/dist/cjs/ui/link-picker/text-input/index.js +9 -5
  21. package/dist/cjs/ui/link-picker/track-mount/index.js +4 -1
  22. package/dist/cjs/ui/loader-fallback/index.js +4 -1
  23. package/dist/cjs/ui/main.js +81 -0
  24. package/dist/es2019/common/generic-error-svg/index.js +4 -1
  25. package/dist/es2019/common/ui/min-height-container/index.js +4 -1
  26. package/dist/es2019/index.js +2 -1
  27. package/dist/es2019/lazy.js +1 -0
  28. package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +4 -1
  29. package/dist/es2019/ui/index.js +16 -80
  30. package/dist/es2019/ui/lazy.js +12 -0
  31. package/dist/es2019/ui/link-picker/form-footer/feature-discovery/index.js +4 -1
  32. package/dist/es2019/ui/link-picker/form-footer/index.js +9 -3
  33. package/dist/es2019/ui/link-picker/index.js +6 -3
  34. package/dist/es2019/ui/link-picker/search-results/index.js +4 -1
  35. package/dist/es2019/ui/link-picker/search-results/link-search-error/index.js +4 -1
  36. package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +4 -1
  37. package/dist/es2019/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +4 -1
  38. package/dist/es2019/ui/link-picker/search-results/link-search-list/list-item/index.js +4 -1
  39. package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/index.js +19 -19
  40. package/dist/es2019/ui/link-picker/search-results/search-results-container/index.js +4 -1
  41. package/dist/es2019/ui/link-picker/search-results/track-tab-viewed/index.js +4 -1
  42. package/dist/es2019/ui/link-picker/text-input/index.js +8 -4
  43. package/dist/es2019/ui/link-picker/track-mount/index.js +4 -1
  44. package/dist/es2019/ui/loader-fallback/index.js +4 -1
  45. package/dist/es2019/ui/main.js +79 -0
  46. package/dist/esm/common/generic-error-svg/index.js +4 -1
  47. package/dist/esm/common/ui/min-height-container/index.js +4 -1
  48. package/dist/esm/index.js +2 -1
  49. package/dist/esm/lazy.js +1 -0
  50. package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +4 -1
  51. package/dist/esm/ui/index.js +16 -74
  52. package/dist/esm/ui/lazy.js +15 -0
  53. package/dist/esm/ui/link-picker/form-footer/feature-discovery/index.js +4 -1
  54. package/dist/esm/ui/link-picker/form-footer/index.js +9 -3
  55. package/dist/esm/ui/link-picker/index.js +6 -3
  56. package/dist/esm/ui/link-picker/search-results/index.js +4 -1
  57. package/dist/esm/ui/link-picker/search-results/link-search-error/index.js +4 -1
  58. package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +4 -1
  59. package/dist/esm/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +4 -1
  60. package/dist/esm/ui/link-picker/search-results/link-search-list/list-item/index.js +4 -1
  61. package/dist/esm/ui/link-picker/search-results/scrolling-tabs/index.js +19 -19
  62. package/dist/esm/ui/link-picker/search-results/search-results-container/index.js +4 -1
  63. package/dist/esm/ui/link-picker/search-results/track-tab-viewed/index.js +4 -1
  64. package/dist/esm/ui/link-picker/text-input/index.js +8 -4
  65. package/dist/esm/ui/link-picker/track-mount/index.js +4 -1
  66. package/dist/esm/ui/loader-fallback/index.js +4 -1
  67. package/dist/esm/ui/main.js +70 -0
  68. package/dist/types/common/analytics/context.d.ts +2 -2
  69. package/dist/types/common/generic-error-svg/index.d.ts +4 -1
  70. package/dist/types/common/types.d.ts +83 -2
  71. package/dist/types/common/ui/min-height-container/index.d.ts +4 -1
  72. package/dist/types/index.d.ts +3 -2
  73. package/dist/types/lazy.d.ts +1 -0
  74. package/dist/types/ui/error-boundary/error-boundary-fallback/index.d.ts +4 -1
  75. package/dist/types/ui/index.d.ts +15 -11
  76. package/dist/types/ui/lazy.d.ts +3 -0
  77. package/dist/types/ui/link-picker/form-footer/feature-discovery/index.d.ts +4 -1
  78. package/dist/types/ui/link-picker/index.d.ts +1 -83
  79. package/dist/types/ui/link-picker/search-results/index.d.ts +4 -1
  80. package/dist/types/ui/link-picker/search-results/link-search-error/index.d.ts +4 -1
  81. package/dist/types/ui/link-picker/search-results/link-search-list/index.d.ts +4 -1
  82. package/dist/types/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +4 -1
  83. package/dist/types/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +4 -1
  84. package/dist/types/ui/loader-fallback/index.d.ts +4 -1
  85. package/dist/types/ui/main.d.ts +13 -0
  86. package/dist/types-ts4.5/common/analytics/context.d.ts +2 -2
  87. package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +4 -1
  88. package/dist/types-ts4.5/common/types.d.ts +83 -2
  89. package/dist/types-ts4.5/common/ui/min-height-container/index.d.ts +4 -1
  90. package/dist/types-ts4.5/index.d.ts +3 -2
  91. package/dist/types-ts4.5/lazy.d.ts +1 -0
  92. package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/index.d.ts +4 -1
  93. package/dist/types-ts4.5/ui/index.d.ts +15 -11
  94. package/dist/types-ts4.5/ui/lazy.d.ts +3 -0
  95. package/dist/types-ts4.5/ui/link-picker/form-footer/feature-discovery/index.d.ts +4 -1
  96. package/dist/types-ts4.5/ui/link-picker/index.d.ts +1 -83
  97. package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +4 -1
  98. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-error/index.d.ts +4 -1
  99. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +4 -1
  100. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +4 -1
  101. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +4 -1
  102. package/dist/types-ts4.5/ui/loader-fallback/index.d.ts +4 -1
  103. package/dist/types-ts4.5/ui/main.d.ts +13 -0
  104. package/lazy/package.json +15 -0
  105. package/package.json +7 -6
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.testIds = exports.composeLinkPicker = exports.PACKAGE_DATA = void 0;
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _react2 = require("@emotion/react");
13
+ var _reactLooselyLazy = require("react-loosely-lazy");
14
+ var _analyticsNext = require("@atlaskit/analytics-next");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
+ var _constants = require("../common/constants");
17
+ var _sessionProvider = require("../controllers/session-provider");
18
+ var _errorBoundary = require("./error-boundary");
19
+ var _loaderFallback = require("./loader-fallback");
20
+ var _messagesProvider = require("./messages-provider");
21
+ var _styled = require("./styled");
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
+ /**
25
+ * @jsxRuntime classic
26
+ * @jsx jsx
27
+ */
28
+
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
30
+
31
+ var testIds = exports.testIds = {
32
+ linkPickerRoot: 'link-picker-root'
33
+ };
34
+ var PACKAGE_DATA = exports.PACKAGE_DATA = {
35
+ packageName: "@atlaskit/link-picker" || '',
36
+ packageVersion: "1.41.0" || '',
37
+ componentName: _constants.COMPONENT_NAME,
38
+ source: _constants.COMPONENT_NAME
39
+ };
40
+ var DefaultRootComponent = function DefaultRootComponent(_ref) {
41
+ var children = _ref.children;
42
+ return (0, _react2.jsx)("div", {
43
+ "data-testid": testIds.linkPickerRoot
44
+ }, children);
45
+ };
46
+ var FixedWidthContainer = function FixedWidthContainer(props) {
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
48
+ return (0, _react2.jsx)("div", (0, _extends2.default)({
49
+ css: _styled.fixedWidthContainerStyles
50
+ }, props));
51
+ };
52
+ var composeLinkPicker = exports.composeLinkPicker = function composeLinkPicker(Component) {
53
+ return /*#__PURE__*/(0, _react.memo)(function (props) {
54
+ var _props$paddingLeft, _props$paddingRight, _props$paddingTop, _props$paddingBottom, _ref2;
55
+ var component = props.component;
56
+ var RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
57
+
58
+ /**
59
+ * When ff enabled: root container will provide width to component + loader + error boundary
60
+ * When ff disabled: component + loader + error boundary each providing their own width
61
+ * Cannot make this change easier at risk of regression as external adopters may have css override on the form element
62
+ */
63
+ var RootFixedWidthContainer = (0, _platformFeatureFlags.fg)('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : _react.Fragment;
64
+ var LoaderFallbackContainer = (0, _platformFeatureFlags.fg)('platform.linking-platform.link-picker.fixed-height-search-results') ? _react.Fragment : FixedWidthContainer;
65
+ return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
66
+ data: PACKAGE_DATA
67
+ }, (0, _react2.jsx)(_sessionProvider.LinkPickerSessionProvider, null, (0, _react2.jsx)(_messagesProvider.MessagesProvider, null, (0, _react2.jsx)("div", {
68
+ style: (_ref2 = {}, (0, _defineProperty2.default)(_ref2, '--link-picker-width', props.disableWidth ? '100%' : // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
69
+ "".concat(_constants.LINK_PICKER_WIDTH_IN_PX, "px")), (0, _defineProperty2.default)(_ref2, '--link-picker-padding-left', (_props$paddingLeft = props.paddingLeft) !== null && _props$paddingLeft !== void 0 ? _props$paddingLeft : "var(--ds-space-200, 16px)"), (0, _defineProperty2.default)(_ref2, '--link-picker-padding-right', (_props$paddingRight = props.paddingRight) !== null && _props$paddingRight !== void 0 ? _props$paddingRight : "var(--ds-space-200, 16px)"), (0, _defineProperty2.default)(_ref2, '--link-picker-padding-top', (_props$paddingTop = props.paddingTop) !== null && _props$paddingTop !== void 0 ? _props$paddingTop : "var(--ds-space-200, 16px)"), (0, _defineProperty2.default)(_ref2, '--link-picker-padding-bottom', (_props$paddingBottom = props.paddingBottom) !== null && _props$paddingBottom !== void 0 ? _props$paddingBottom : "var(--ds-space-200, 16px)"), _ref2)
70
+ }, (0, _react2.jsx)(RootFixedWidthContainer, null, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(_reactLooselyLazy.LazySuspense, {
71
+ fallback: (0, _react2.jsx)(LoaderFallbackContainer, null, (0, _react2.jsx)(_loaderFallback.LoaderFallback, {
72
+ url: props.url,
73
+ hideDisplayText: props.hideDisplayText,
74
+ isLoadingPlugins: props.isLoadingPlugins,
75
+ plugins: props.plugins
76
+ }))
77
+ }, (0, _react2.jsx)(RootComponent, (0, _extends2.default)({}, props, {
78
+ "data-testid": testIds.linkPickerRoot
79
+ }), (0, _react2.jsx)(Component, props)))))))));
80
+ });
81
+ };
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
7
  import { css, jsx } from '@emotion/react';
5
8
  const HEIGHT = 90;
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import React, { forwardRef } from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,3 +1,4 @@
1
- export { default as LinkPicker } from './ui';
1
+ export { default } from './ui';
2
+ export { DeprecatedLazyLinkPickerExport as LinkPicker } from './ui';
2
3
  export { UnauthenticatedError } from './common/utils/errors';
3
4
  export { LoaderFallback } from './ui/loader-fallback';
@@ -0,0 +1 @@
1
+ export { default as LazyLinkPicker } from './ui/lazy';
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
6
  import { jsx } from '@emotion/react';
4
7
  import { defineMessages, useIntl } from 'react-intl-next';
@@ -1,84 +1,20 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
3
- import React, { Fragment, memo } from 'react';
1
+ import { default as LazyLinkPicker } from './lazy';
2
+ import { LinkPicker } from './link-picker';
3
+ import { composeLinkPicker } from './main';
4
4
 
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import { jsx } from '@emotion/react';
7
- import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
8
- import { AnalyticsContext } from '@atlaskit/analytics-next';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
- import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
11
- import { LinkPickerSessionProvider } from '../controllers/session-provider';
12
- import { ErrorBoundary } from './error-boundary';
13
- import { LoaderFallback } from './loader-fallback';
14
- import { MessagesProvider } from './messages-provider';
15
- import { fixedWidthContainerStyles } from './styled';
16
- export const testIds = {
17
- linkPickerRoot: 'link-picker-root'
18
- };
19
- export const PACKAGE_DATA = {
20
- packageName: "@atlaskit/link-picker" || '',
21
- packageVersion: "1.39.5" || '',
22
- componentName: COMPONENT_NAME,
23
- source: COMPONENT_NAME
24
- };
25
- const LazyLinkPicker = lazyForPaint(() => import( /* webpackChunkName: "@atlaskit-internal_link-picker" */
26
- './link-picker').then(({
27
- LinkPicker
28
- }) => ({
29
- default: LinkPicker
30
- })));
31
- const DefaultRootComponent = ({
32
- children
33
- }) => {
34
- return jsx("div", {
35
- "data-testid": testIds.linkPickerRoot
36
- }, children);
37
- };
38
- const FixedWidthContainer = props => {
39
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
40
- return jsx("div", _extends({
41
- css: fixedWidthContainerStyles
42
- }, props));
43
- };
44
- const ComposedLinkPicker = /*#__PURE__*/memo(props => {
45
- var _props$paddingLeft, _props$paddingRight, _props$paddingTop, _props$paddingBottom;
46
- const {
47
- component
48
- } = props;
49
- const RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
50
-
51
- /**
52
- * When ff enabled: root container will provide width to component + loader + error boundary
53
- * When ff disabled: component + loader + error boundary each providing their own width
54
- * Cannot make this change easier at risk of regression as external adopters may have css override on the form element
55
- */
56
- const RootFixedWidthContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : Fragment;
57
- const LoaderFallbackContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? Fragment : FixedWidthContainer;
58
- return jsx(AnalyticsContext, {
59
- data: PACKAGE_DATA
60
- }, jsx(LinkPickerSessionProvider, null, jsx(MessagesProvider, null, jsx("div", {
61
- style: {
62
- ['--link-picker-width']: props.disableWidth ? '100%' :
63
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
64
- `${LINK_PICKER_WIDTH_IN_PX}px`,
65
- ['--link-picker-padding-left']: (_props$paddingLeft = props.paddingLeft) !== null && _props$paddingLeft !== void 0 ? _props$paddingLeft : "var(--ds-space-200, 16px)",
66
- ['--link-picker-padding-right']: (_props$paddingRight = props.paddingRight) !== null && _props$paddingRight !== void 0 ? _props$paddingRight : "var(--ds-space-200, 16px)",
67
- ['--link-picker-padding-top']: (_props$paddingTop = props.paddingTop) !== null && _props$paddingTop !== void 0 ? _props$paddingTop : "var(--ds-space-200, 16px)",
68
- ['--link-picker-padding-bottom']: (_props$paddingBottom = props.paddingBottom) !== null && _props$paddingBottom !== void 0 ? _props$paddingBottom : "var(--ds-space-200, 16px)"
69
- }
70
- }, jsx(RootFixedWidthContainer, null, jsx(ErrorBoundary, null, jsx(LazySuspense, {
71
- fallback: jsx(LoaderFallbackContainer, null, jsx(LoaderFallback, {
72
- url: props.url,
73
- hideDisplayText: props.hideDisplayText,
74
- isLoadingPlugins: props.isLoadingPlugins,
75
- plugins: props.plugins
76
- }))
77
- }, jsx(RootComponent, _extends({}, props, {
78
- "data-testid": testIds.linkPickerRoot
79
- }), jsx(LazyLinkPicker, props)))))))));
80
- });
5
+ /**
6
+ * @deprecated A `/lazy` entrypoint has been added.
7
+ * @example Prefer the default export from the default entrypoint if you do not want a lazy-loaded version.
8
+ * ```tsx
9
+ * import LinkPicker from '@atlaskit/link-picker';
10
+ * ```
11
+ * @example Prefer the `LazyLinkPicker` export from the `/lazy` entrypoint if you want a lazy-loaded version.
12
+ * ```tsx
13
+ * import { LazyLinkPicker } from '@atlaskit/link-picker/lazy';
14
+ * ```
15
+ */
16
+ export const DeprecatedLazyLinkPickerExport = LazyLinkPicker;
81
17
 
82
18
  // Must be a default export to be able to support prop docs
83
19
  // eslint-disable-next-line import/no-default-export
84
- export default ComposedLinkPicker;
20
+ export default composeLinkPicker(LinkPicker);
@@ -0,0 +1,12 @@
1
+ import { lazyForPaint } from 'react-loosely-lazy';
2
+ import { composeLinkPicker } from './main';
3
+ const LazyLinkPickerComponent = lazyForPaint(() => import( /* webpackChunkName: "@atlaskit-internal_link-picker" */
4
+ './link-picker').then(({
5
+ LinkPicker
6
+ }) => ({
7
+ default: LinkPicker
8
+ })));
9
+
10
+ // Must be a default export to be able to support prop docs
11
+ // eslint-disable-next-line import/no-default-export
12
+ export default composeLinkPicker(LazyLinkPickerComponent);
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import { useEffect, useMemo } from 'react';
3
6
 
4
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import { memo, useMemo } from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -8,7 +11,8 @@ import { defineMessages, useIntl } from 'react-intl-next';
8
11
  import uuid from 'uuid';
9
12
  import Button, { ButtonGroup } from '@atlaskit/button';
10
13
  import LoadingButton from '@atlaskit/button/loading-button';
11
- import EditorAddIcon from '@atlaskit/icon/glyph/editor/add';
14
+ import EditorAddIconLegacy from '@atlaskit/icon/glyph/editor/add';
15
+ import EditorAddIcon from '@atlaskit/icon/utility/add';
12
16
  import VisuallyHidden from '@atlaskit/visually-hidden';
13
17
  import { UnauthenticatedError } from '../../../common/utils/errors';
14
18
  import FeatureDiscovery from './feature-discovery';
@@ -71,7 +75,9 @@ export const FormFooter = /*#__PURE__*/memo(({
71
75
  appearance: "default",
72
76
  iconBefore: jsx(EditorAddIcon, {
73
77
  label: "",
74
- size: "medium"
78
+ LEGACY_size: "medium",
79
+ LEGACY_fallbackIcon: EditorAddIconLegacy,
80
+ color: "currentColor"
75
81
  }),
76
82
  isDisabled: isSubmitting,
77
83
  "aria-labelledby": isSubmitting ? submitMessageId : undefined
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import { Fragment, memo, useCallback, useLayoutEffect, useReducer } from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -8,7 +11,7 @@ import { FormattedMessage, useIntl } from 'react-intl-next';
8
11
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
9
12
  import { isSafeUrl, normalizeUrl } from '@atlaskit/linking-common/url';
10
13
  import { browser } from '@atlaskit/linking-common/user-agent';
11
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
12
15
  import VisuallyHidden from '@atlaskit/visually-hidden';
13
16
  import { useLinkPickerAnalytics, withInputFieldTracking, withLinkPickerAnalyticsContext } from '../../common/analytics';
14
17
  import { ANALYTICS_CHANNEL } from '../../common/constants';
@@ -394,7 +397,7 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
394
397
  css: !queryState || !(plugins !== null && plugins !== void 0 && plugins.length) ? formFooterMargin : undefined
395
398
  /* Show the feature discovery pulse when we're on the Jira tab, we haven't started typing a url and
396
399
  the feature flag is enabled */,
397
- createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && getBooleanFF('platform.linking-platform.link-picker.enable-jira-create'),
400
+ createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && fg('platform.linking-platform.link-picker.enable-jira-create'),
398
401
  customSubmitButtonLabel: customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined
399
402
  }));
400
403
  }));
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import { Fragment } from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
7
  import { jsx } from '@emotion/react';
5
8
  import { defineMessages, FormattedMessage, useIntl } from 'react-intl-next';
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import { forwardRef, Fragment, useCallback, useRef } from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
6
  import { css, jsx } from '@emotion/react';
4
7
  const HEIGHT = 120;
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import { forwardRef, Fragment } from 'react';
3
6
 
4
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,12 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import React, { useCallback, useMemo, useRef, useState } from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
9
  import { jsx } from '@emotion/react';
7
- import Button from '@atlaskit/button';
8
- import ChevronLeftIcon from '@atlaskit/icon/glyph/chevron-left';
9
- import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
10
+ import { IconButton } from '@atlaskit/button/new';
11
+ import ChevronLeftIcon from '@atlaskit/icon/utility/migration/chevron-left';
12
+ import ChevronRightIcon from '@atlaskit/icon/utility/migration/chevron-right';
10
13
  import { calculateConditionalButtons, createGhost, getTabList, scrollBack, scrollForward } from './scrolling-tabs';
11
14
  import { backButtonStyles, containerStyles, nextButtonStyles, scrollingContainerStyles } from './styles';
12
15
  function isTouchDevice() {
@@ -90,7 +93,7 @@ export const ScrollingTabList = props => {
90
93
  }, [onTabClick, ghost, ref]);
91
94
  const buttonProps = {
92
95
  appearance: 'subtle',
93
- spacing: 'none'
96
+ spacing: 'compact'
94
97
  };
95
98
  return (
96
99
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -103,26 +106,23 @@ export const ScrollingTabList = props => {
103
106
  jsx("div", {
104
107
  className: "back",
105
108
  css: backButtonStyles
106
- }, jsx(Button, _extends({
107
- "data-test-id": "back"
108
- }, buttonProps, {
109
- iconBefore: jsx(ChevronLeftIcon, {
110
- label: "back"
111
- }),
112
- onClick: () => scrollBack(ref)
113
- }))), jsx("div", {
109
+ }, jsx(IconButton, _extends({
110
+ "data-test-id": "back",
111
+ onClick: () => scrollBack(ref),
112
+ label: "back",
113
+ icon: ChevronLeftIcon
114
+ }, buttonProps))), jsx("div", {
114
115
  css: scrollingContainerStyles
115
116
  }, props.children), conditionalButtons.forward &&
116
117
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
117
118
  jsx("div", {
118
119
  css: nextButtonStyles
119
- }, jsx(Button, _extends({
120
- "data-test-id": "forward"
121
- }, buttonProps, {
122
- iconBefore: jsx(ChevronRightIcon, {
123
- label: "forward"
124
- }),
120
+ }, jsx(IconButton, _extends({
121
+ "data-test-id": "forward",
125
122
  onClick: () => scrollForward(ref)
123
+ }, buttonProps, {
124
+ label: "forward",
125
+ icon: ChevronRightIcon
126
126
  }))))
127
127
  );
128
128
  };
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import { forwardRef } from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import { useLayoutEffect } from 'react';
3
6
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
4
7
  import { ANALYTICS_CHANNEL } from '../../../../common/constants';
@@ -1,11 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  import { Fragment, useCallback, useRef } from 'react';
4
7
 
5
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
9
  import { css, jsx } from '@emotion/react';
7
10
  import { ErrorMessage, Field } from '@atlaskit/form';
8
- import Selectclear from '@atlaskit/icon/glyph/select-clear';
11
+ import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
9
12
  import { Pressable, xcss } from '@atlaskit/primitives';
10
13
  import Textfield from '@atlaskit/textfield';
11
14
  import Tooltip from '@atlaskit/tooltip';
@@ -88,9 +91,10 @@ export const TextInput = ({
88
91
  onClick: handleClear,
89
92
  testId: testIds.clearUrlButton
90
93
  }, jsx(Selectclear, {
91
- size: "medium",
94
+ LEGACY_size: "medium",
92
95
  label: clearLabel || '',
93
- primaryColor: "var(--ds-icon-subtle, #626F86)"
96
+ color: "var(--ds-icon-subtle, #626F86)",
97
+ spacing: "spacious"
94
98
  })));
95
99
  return jsx("div", {
96
100
  css: fieldStyles
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import { useLayoutEffect } from 'react';
3
6
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
4
7
  import { succeedUfoExperience, ufoExperience } from '../../../common/analytics/experiences';
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
6
  import { css, jsx } from '@emotion/react';
4
7
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -0,0 +1,79 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+ import React, { Fragment, memo } from 'react';
7
+
8
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
+ import { jsx } from '@emotion/react';
10
+ import { LazySuspense } from 'react-loosely-lazy';
11
+ import { AnalyticsContext } from '@atlaskit/analytics-next';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
14
+ import { LinkPickerSessionProvider } from '../controllers/session-provider';
15
+ import { ErrorBoundary } from './error-boundary';
16
+ import { LoaderFallback } from './loader-fallback';
17
+ import { MessagesProvider } from './messages-provider';
18
+ import { fixedWidthContainerStyles } from './styled';
19
+ export const testIds = {
20
+ linkPickerRoot: 'link-picker-root'
21
+ };
22
+ export const PACKAGE_DATA = {
23
+ packageName: "@atlaskit/link-picker" || '',
24
+ packageVersion: "1.41.0" || '',
25
+ componentName: COMPONENT_NAME,
26
+ source: COMPONENT_NAME
27
+ };
28
+ const DefaultRootComponent = ({
29
+ children
30
+ }) => {
31
+ return jsx("div", {
32
+ "data-testid": testIds.linkPickerRoot
33
+ }, children);
34
+ };
35
+ const FixedWidthContainer = props => {
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
37
+ return jsx("div", _extends({
38
+ css: fixedWidthContainerStyles
39
+ }, props));
40
+ };
41
+ export const composeLinkPicker = Component => {
42
+ return /*#__PURE__*/memo(props => {
43
+ var _props$paddingLeft, _props$paddingRight, _props$paddingTop, _props$paddingBottom;
44
+ const {
45
+ component
46
+ } = props;
47
+ const RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
48
+
49
+ /**
50
+ * When ff enabled: root container will provide width to component + loader + error boundary
51
+ * When ff disabled: component + loader + error boundary each providing their own width
52
+ * Cannot make this change easier at risk of regression as external adopters may have css override on the form element
53
+ */
54
+ const RootFixedWidthContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : Fragment;
55
+ const LoaderFallbackContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? Fragment : FixedWidthContainer;
56
+ return jsx(AnalyticsContext, {
57
+ data: PACKAGE_DATA
58
+ }, jsx(LinkPickerSessionProvider, null, jsx(MessagesProvider, null, jsx("div", {
59
+ style: {
60
+ ['--link-picker-width']: props.disableWidth ? '100%' :
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
62
+ `${LINK_PICKER_WIDTH_IN_PX}px`,
63
+ ['--link-picker-padding-left']: (_props$paddingLeft = props.paddingLeft) !== null && _props$paddingLeft !== void 0 ? _props$paddingLeft : "var(--ds-space-200, 16px)",
64
+ ['--link-picker-padding-right']: (_props$paddingRight = props.paddingRight) !== null && _props$paddingRight !== void 0 ? _props$paddingRight : "var(--ds-space-200, 16px)",
65
+ ['--link-picker-padding-top']: (_props$paddingTop = props.paddingTop) !== null && _props$paddingTop !== void 0 ? _props$paddingTop : "var(--ds-space-200, 16px)",
66
+ ['--link-picker-padding-bottom']: (_props$paddingBottom = props.paddingBottom) !== null && _props$paddingBottom !== void 0 ? _props$paddingBottom : "var(--ds-space-200, 16px)"
67
+ }
68
+ }, jsx(RootFixedWidthContainer, null, jsx(ErrorBoundary, null, jsx(LazySuspense, {
69
+ fallback: jsx(LoaderFallbackContainer, null, jsx(LoaderFallback, {
70
+ url: props.url,
71
+ hideDisplayText: props.hideDisplayText,
72
+ isLoadingPlugins: props.isLoadingPlugins,
73
+ plugins: props.plugins
74
+ }))
75
+ }, jsx(RootComponent, _extends({}, props, {
76
+ "data-testid": testIds.linkPickerRoot
77
+ }), jsx(Component, props)))))))));
78
+ });
79
+ };
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /** @jsx jsx */
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
3
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
7
  import { css, jsx } from '@emotion/react';
5
8
  var HEIGHT = 90;
@@ -2,7 +2,10 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["minHeight"];
5
- /** @jsx jsx */
5
+ /**
6
+ * @jsxRuntime classic
7
+ * @jsx jsx
8
+ */
6
9
  import React, { forwardRef } from 'react';
7
10
 
8
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
- export { default as LinkPicker } from './ui';
1
+ export { default } from './ui';
2
+ export { DeprecatedLazyLinkPickerExport as LinkPicker } from './ui';
2
3
  export { UnauthenticatedError } from './common/utils/errors';
3
4
  export { LoaderFallback } from './ui/loader-fallback';
@@ -0,0 +1 @@
1
+ export { default as LazyLinkPicker } from './ui/lazy';
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
6
  import { jsx } from '@emotion/react';
4
7
  import { defineMessages, useIntl } from 'react-intl-next';