@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
@@ -1,78 +1,20 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- /** @jsx jsx */
4
- import React, { Fragment, memo } from 'react';
1
+ import { default as LazyLinkPicker } from './lazy';
2
+ import { LinkPicker } from './link-picker';
3
+ import { composeLinkPicker } from './main';
5
4
 
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { jsx } from '@emotion/react';
8
- import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
9
- import { AnalyticsContext } from '@atlaskit/analytics-next';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
- import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
12
- import { LinkPickerSessionProvider } from '../controllers/session-provider';
13
- import { ErrorBoundary } from './error-boundary';
14
- import { LoaderFallback } from './loader-fallback';
15
- import { MessagesProvider } from './messages-provider';
16
- import { fixedWidthContainerStyles } from './styled';
17
- export var testIds = {
18
- linkPickerRoot: 'link-picker-root'
19
- };
20
- export var PACKAGE_DATA = {
21
- packageName: "@atlaskit/link-picker" || '',
22
- packageVersion: "1.39.5" || '',
23
- componentName: COMPONENT_NAME,
24
- source: COMPONENT_NAME
25
- };
26
- var LazyLinkPicker = lazyForPaint(function () {
27
- return import( /* webpackChunkName: "@atlaskit-internal_link-picker" */
28
- './link-picker').then(function (_ref) {
29
- var LinkPicker = _ref.LinkPicker;
30
- return {
31
- default: LinkPicker
32
- };
33
- });
34
- });
35
- var DefaultRootComponent = function DefaultRootComponent(_ref2) {
36
- var children = _ref2.children;
37
- return jsx("div", {
38
- "data-testid": testIds.linkPickerRoot
39
- }, children);
40
- };
41
- var FixedWidthContainer = function FixedWidthContainer(props) {
42
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
43
- return jsx("div", _extends({
44
- css: fixedWidthContainerStyles
45
- }, props));
46
- };
47
- var ComposedLinkPicker = /*#__PURE__*/memo(function (props) {
48
- var _props$paddingLeft, _props$paddingRight, _props$paddingTop, _props$paddingBottom, _ref3;
49
- var component = props.component;
50
- var RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
51
-
52
- /**
53
- * When ff enabled: root container will provide width to component + loader + error boundary
54
- * When ff disabled: component + loader + error boundary each providing their own width
55
- * Cannot make this change easier at risk of regression as external adopters may have css override on the form element
56
- */
57
- var RootFixedWidthContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : Fragment;
58
- var LoaderFallbackContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? Fragment : FixedWidthContainer;
59
- return jsx(AnalyticsContext, {
60
- data: PACKAGE_DATA
61
- }, jsx(LinkPickerSessionProvider, null, jsx(MessagesProvider, null, jsx("div", {
62
- style: (_ref3 = {}, _defineProperty(_ref3, '--link-picker-width', props.disableWidth ? '100%' : // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
63
- "".concat(LINK_PICKER_WIDTH_IN_PX, "px")), _defineProperty(_ref3, '--link-picker-padding-left', (_props$paddingLeft = props.paddingLeft) !== null && _props$paddingLeft !== void 0 ? _props$paddingLeft : "var(--ds-space-200, 16px)"), _defineProperty(_ref3, '--link-picker-padding-right', (_props$paddingRight = props.paddingRight) !== null && _props$paddingRight !== void 0 ? _props$paddingRight : "var(--ds-space-200, 16px)"), _defineProperty(_ref3, '--link-picker-padding-top', (_props$paddingTop = props.paddingTop) !== null && _props$paddingTop !== void 0 ? _props$paddingTop : "var(--ds-space-200, 16px)"), _defineProperty(_ref3, '--link-picker-padding-bottom', (_props$paddingBottom = props.paddingBottom) !== null && _props$paddingBottom !== void 0 ? _props$paddingBottom : "var(--ds-space-200, 16px)"), _ref3)
64
- }, jsx(RootFixedWidthContainer, null, jsx(ErrorBoundary, null, jsx(LazySuspense, {
65
- fallback: jsx(LoaderFallbackContainer, null, jsx(LoaderFallback, {
66
- url: props.url,
67
- hideDisplayText: props.hideDisplayText,
68
- isLoadingPlugins: props.isLoadingPlugins,
69
- plugins: props.plugins
70
- }))
71
- }, jsx(RootComponent, _extends({}, props, {
72
- "data-testid": testIds.linkPickerRoot
73
- }), jsx(LazyLinkPicker, props)))))))));
74
- });
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 var DeprecatedLazyLinkPickerExport = LazyLinkPicker;
75
17
 
76
18
  // Must be a default export to be able to support prop docs
77
19
  // eslint-disable-next-line import/no-default-export
78
- export default ComposedLinkPicker;
20
+ export default composeLinkPicker(LinkPicker);
@@ -0,0 +1,15 @@
1
+ import { lazyForPaint } from 'react-loosely-lazy';
2
+ import { composeLinkPicker } from './main';
3
+ var LazyLinkPickerComponent = lazyForPaint(function () {
4
+ return import( /* webpackChunkName: "@atlaskit-internal_link-picker" */
5
+ './link-picker').then(function (_ref) {
6
+ var LinkPicker = _ref.LinkPicker;
7
+ return {
8
+ default: LinkPicker
9
+ };
10
+ });
11
+ });
12
+
13
+ // Must be a default export to be able to support prop docs
14
+ // eslint-disable-next-line import/no-default-export
15
+ 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,7 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["isLoading", "isSubmitting", "error", "url", "queryState", "items", "isEditing", "onCancel", "action", "createFeatureDiscovery", "customSubmitButtonLabel"];
4
- /** @jsx jsx */
4
+ /**
5
+ * @jsxRuntime classic
6
+ * @jsx jsx
7
+ */
5
8
  import { memo, useMemo } from 'react';
6
9
 
7
10
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -10,7 +13,8 @@ import { defineMessages, useIntl } from 'react-intl-next';
10
13
  import uuid from 'uuid';
11
14
  import Button, { ButtonGroup } from '@atlaskit/button';
12
15
  import LoadingButton from '@atlaskit/button/loading-button';
13
- import EditorAddIcon from '@atlaskit/icon/glyph/editor/add';
16
+ import EditorAddIconLegacy from '@atlaskit/icon/glyph/editor/add';
17
+ import EditorAddIcon from '@atlaskit/icon/utility/add';
14
18
  import VisuallyHidden from '@atlaskit/visually-hidden';
15
19
  import { UnauthenticatedError } from '../../../common/utils/errors';
16
20
  import FeatureDiscovery from './feature-discovery';
@@ -77,7 +81,9 @@ export var FormFooter = /*#__PURE__*/memo(function (_ref) {
77
81
  appearance: "default",
78
82
  iconBefore: jsx(EditorAddIcon, {
79
83
  label: "",
80
- size: "medium"
84
+ LEGACY_size: "medium",
85
+ LEGACY_fallbackIcon: EditorAddIconLegacy,
86
+ color: "currentColor"
81
87
  }),
82
88
  isDisabled: isSubmitting,
83
89
  "aria-labelledby": isSubmitting ? submitMessageId : undefined
@@ -3,7 +3,10 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- /** @jsx jsx */
6
+ /**
7
+ * @jsxRuntime classic
8
+ * @jsx jsx
9
+ */
7
10
  import { Fragment, memo, useCallback, useLayoutEffect, useReducer } from 'react';
8
11
 
9
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
@@ -12,7 +15,7 @@ import { FormattedMessage, useIntl } from 'react-intl-next';
12
15
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
13
16
  import { isSafeUrl, normalizeUrl } from '@atlaskit/linking-common/url';
14
17
  import { browser } from '@atlaskit/linking-common/user-agent';
15
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
18
+ import { fg } from '@atlaskit/platform-feature-flags';
16
19
  import VisuallyHidden from '@atlaskit/visually-hidden';
17
20
  import { useLinkPickerAnalytics, withInputFieldTracking, withLinkPickerAnalyticsContext } from '../../common/analytics';
18
21
  import { ANALYTICS_CHANNEL } from '../../common/constants';
@@ -386,7 +389,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
386
389
  css: !queryState || !(plugins !== null && plugins !== void 0 && plugins.length) ? formFooterMargin : undefined
387
390
  /* Show the feature discovery pulse when we're on the Jira tab, we haven't started typing a url and
388
391
  the feature flag is enabled */,
389
- createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && getBooleanFF('platform.linking-platform.link-picker.enable-jira-create'),
392
+ createFeatureDiscovery: (activePlugin === null || activePlugin === void 0 ? void 0 : activePlugin.tabKey) === 'jira' && allowCreateFeatureDiscovery && fg('platform.linking-platform.link-picker.enable-jira-create'),
390
393
  customSubmitButtonLabel: customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined
391
394
  }));
392
395
  }));
@@ -2,7 +2,10 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- /** @jsx jsx */
5
+ /**
6
+ * @jsxRuntime classic
7
+ * @jsx jsx
8
+ */
6
9
  import { Fragment } from 'react';
7
10
 
8
11
  // 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';
@@ -4,7 +4,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin"];
5
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
- /** @jsx jsx */
7
+ /**
8
+ * @jsxRuntime classic
9
+ * @jsx jsx
10
+ */
8
11
  import { forwardRef, Fragment, useCallback, useRef } from 'react';
9
12
 
10
13
  // 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
  var 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
@@ -3,14 +3,17 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4
4
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
5
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
- /** @jsx jsx */
6
+ /**
7
+ * @jsxRuntime classic
8
+ * @jsx jsx
9
+ */
7
10
  import React, { useCallback, useMemo, useRef, useState } from 'react';
8
11
 
9
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
13
  import { jsx } from '@emotion/react';
11
- import Button from '@atlaskit/button';
12
- import ChevronLeftIcon from '@atlaskit/icon/glyph/chevron-left';
13
- import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
14
+ import { IconButton } from '@atlaskit/button/new';
15
+ import ChevronLeftIcon from '@atlaskit/icon/utility/migration/chevron-left';
16
+ import ChevronRightIcon from '@atlaskit/icon/utility/migration/chevron-right';
14
17
  import { calculateConditionalButtons, createGhost, getTabList, scrollBack, scrollForward } from './scrolling-tabs';
15
18
  import { backButtonStyles, containerStyles, nextButtonStyles, scrollingContainerStyles } from './styles';
16
19
  function isTouchDevice() {
@@ -114,7 +117,7 @@ export var ScrollingTabList = function ScrollingTabList(props) {
114
117
  }, [onTabClick, ghost, ref]);
115
118
  var buttonProps = {
116
119
  appearance: 'subtle',
117
- spacing: 'none'
120
+ spacing: 'compact'
118
121
  };
119
122
  return (
120
123
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -127,30 +130,27 @@ export var ScrollingTabList = function ScrollingTabList(props) {
127
130
  jsx("div", {
128
131
  className: "back",
129
132
  css: backButtonStyles
130
- }, jsx(Button, _extends({
131
- "data-test-id": "back"
132
- }, buttonProps, {
133
- iconBefore: jsx(ChevronLeftIcon, {
134
- label: "back"
135
- }),
133
+ }, jsx(IconButton, _extends({
134
+ "data-test-id": "back",
136
135
  onClick: function onClick() {
137
136
  return scrollBack(ref);
138
- }
139
- }))), jsx("div", {
137
+ },
138
+ label: "back",
139
+ icon: ChevronLeftIcon
140
+ }, buttonProps))), jsx("div", {
140
141
  css: scrollingContainerStyles
141
142
  }, props.children), conditionalButtons.forward &&
142
143
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
143
144
  jsx("div", {
144
145
  css: nextButtonStyles
145
- }, jsx(Button, _extends({
146
- "data-test-id": "forward"
147
- }, buttonProps, {
148
- iconBefore: jsx(ChevronRightIcon, {
149
- label: "forward"
150
- }),
146
+ }, jsx(IconButton, _extends({
147
+ "data-test-id": "forward",
151
148
  onClick: function onClick() {
152
149
  return scrollForward(ref);
153
150
  }
151
+ }, buttonProps, {
152
+ label: "forward",
153
+ icon: ChevronRightIcon
154
154
  }))))
155
155
  );
156
156
  };
@@ -1,7 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["hasTabs"];
4
- /** @jsx jsx */
4
+ /**
5
+ * @jsxRuntime classic
6
+ * @jsx jsx
7
+ */
5
8
  import { forwardRef } from 'react';
6
9
 
7
10
  // 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,13 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName"];
4
- /** @jsx jsx */
4
+ /**
5
+ * @jsxRuntime classic
6
+ * @jsx jsx
7
+ */
5
8
  import { Fragment, useCallback, useRef } from 'react';
6
9
 
7
10
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
11
  import { css, jsx } from '@emotion/react';
9
12
  import { ErrorMessage, Field } from '@atlaskit/form';
10
- import Selectclear from '@atlaskit/icon/glyph/select-clear';
13
+ import Selectclear from '@atlaskit/icon/core/migration/cross-circle--select-clear';
11
14
  import { Pressable, xcss } from '@atlaskit/primitives';
12
15
  import Textfield from '@atlaskit/textfield';
13
16
  import Tooltip from '@atlaskit/tooltip';
@@ -89,9 +92,10 @@ export var TextInput = function TextInput(_ref) {
89
92
  onClick: handleClear,
90
93
  testId: testIds.clearUrlButton
91
94
  }, jsx(Selectclear, {
92
- size: "medium",
95
+ LEGACY_size: "medium",
93
96
  label: clearLabel || '',
94
- primaryColor: "var(--ds-icon-subtle, #626F86)"
97
+ color: "var(--ds-icon-subtle, #626F86)",
98
+ spacing: "spacious"
95
99
  })));
96
100
  return jsx("div", {
97
101
  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,70 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ /**
4
+ * @jsxRuntime classic
5
+ * @jsx jsx
6
+ */
7
+ import React, { Fragment, memo } from 'react';
8
+
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
+ import { jsx } from '@emotion/react';
11
+ import { LazySuspense } from 'react-loosely-lazy';
12
+ import { AnalyticsContext } from '@atlaskit/analytics-next';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
15
+ import { LinkPickerSessionProvider } from '../controllers/session-provider';
16
+ import { ErrorBoundary } from './error-boundary';
17
+ import { LoaderFallback } from './loader-fallback';
18
+ import { MessagesProvider } from './messages-provider';
19
+ import { fixedWidthContainerStyles } from './styled';
20
+ export var testIds = {
21
+ linkPickerRoot: 'link-picker-root'
22
+ };
23
+ export var PACKAGE_DATA = {
24
+ packageName: "@atlaskit/link-picker" || '',
25
+ packageVersion: "1.41.0" || '',
26
+ componentName: COMPONENT_NAME,
27
+ source: COMPONENT_NAME
28
+ };
29
+ var DefaultRootComponent = function DefaultRootComponent(_ref) {
30
+ var children = _ref.children;
31
+ return jsx("div", {
32
+ "data-testid": testIds.linkPickerRoot
33
+ }, children);
34
+ };
35
+ var FixedWidthContainer = function 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 var composeLinkPicker = function composeLinkPicker(Component) {
42
+ return /*#__PURE__*/memo(function (props) {
43
+ var _props$paddingLeft, _props$paddingRight, _props$paddingTop, _props$paddingBottom, _ref2;
44
+ var component = props.component;
45
+ var RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
46
+
47
+ /**
48
+ * When ff enabled: root container will provide width to component + loader + error boundary
49
+ * When ff disabled: component + loader + error boundary each providing their own width
50
+ * Cannot make this change easier at risk of regression as external adopters may have css override on the form element
51
+ */
52
+ var RootFixedWidthContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : Fragment;
53
+ var LoaderFallbackContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? Fragment : FixedWidthContainer;
54
+ return jsx(AnalyticsContext, {
55
+ data: PACKAGE_DATA
56
+ }, jsx(LinkPickerSessionProvider, null, jsx(MessagesProvider, null, jsx("div", {
57
+ style: (_ref2 = {}, _defineProperty(_ref2, '--link-picker-width', props.disableWidth ? '100%' : // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
58
+ "".concat(LINK_PICKER_WIDTH_IN_PX, "px")), _defineProperty(_ref2, '--link-picker-padding-left', (_props$paddingLeft = props.paddingLeft) !== null && _props$paddingLeft !== void 0 ? _props$paddingLeft : "var(--ds-space-200, 16px)"), _defineProperty(_ref2, '--link-picker-padding-right', (_props$paddingRight = props.paddingRight) !== null && _props$paddingRight !== void 0 ? _props$paddingRight : "var(--ds-space-200, 16px)"), _defineProperty(_ref2, '--link-picker-padding-top', (_props$paddingTop = props.paddingTop) !== null && _props$paddingTop !== void 0 ? _props$paddingTop : "var(--ds-space-200, 16px)"), _defineProperty(_ref2, '--link-picker-padding-bottom', (_props$paddingBottom = props.paddingBottom) !== null && _props$paddingBottom !== void 0 ? _props$paddingBottom : "var(--ds-space-200, 16px)"), _ref2)
59
+ }, jsx(RootFixedWidthContainer, null, jsx(ErrorBoundary, null, jsx(LazySuspense, {
60
+ fallback: jsx(LoaderFallbackContainer, null, jsx(LoaderFallback, {
61
+ url: props.url,
62
+ hideDisplayText: props.hideDisplayText,
63
+ isLoadingPlugins: props.isLoadingPlugins,
64
+ plugins: props.plugins
65
+ }))
66
+ }, jsx(RootComponent, _extends({}, props, {
67
+ "data-testid": testIds.linkPickerRoot
68
+ }), jsx(Component, props)))))))));
69
+ });
70
+ };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { type LinkPickerProps } from '../../index';
3
- import { type LinkPickerAnalyticsContextType } from '../utils/analytics/analytics.codegen';
2
+ import type { LinkPickerProps } from '../types';
3
+ import type { LinkPickerAnalyticsContextType } from '../utils/analytics/analytics.codegen';
4
4
  type AnalyticsContextAttributesType = LinkPickerAnalyticsContextType;
5
5
  export type TrackAttribute = <K extends keyof LinkPickerAnalyticsContextType>(attribute: K, value: AnalyticsContextAttributesType[K]) => void;
6
6
  interface AnalyticsContextType {
@@ -1,3 +1,6 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import { jsx } from '@emotion/react';
3
6
  export declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
@@ -1,5 +1,6 @@
1
- import { type ReactNode } from 'react';
2
- import { type MessageDescriptor } from 'react-intl-next';
1
+ import type { ReactNode } from 'react';
2
+ import type { MessageDescriptor } from 'react-intl-next';
3
+ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
4
  export type LinkInputType = 'manual' | 'typeAhead';
4
5
  export interface LinkSearchListItemData {
5
6
  /** Unique identifiable attribute for the item */
@@ -72,3 +73,83 @@ export interface PickerState {
72
73
  preventHidingRecents: boolean;
73
74
  allowCreateFeatureDiscovery: boolean;
74
75
  }
76
+ interface Meta {
77
+ /** Indicates how the link was picked. */
78
+ inputMethod: LinkInputType;
79
+ }
80
+ interface OnSubmitParameter {
81
+ /** The `url` of the linked resource. */
82
+ url: string;
83
+ /** The desired text to be displayed alternatively to the title of the linked resource. */
84
+ displayText: string | null;
85
+ /** The resolved `title` of the resource at the time of link picking (if applicable, null if not known). */
86
+ title: string | null;
87
+ /** Meta data about the link picking submission. */
88
+ meta: Meta;
89
+ /**
90
+ * The input value of the `url` field at time of submission if inserted "manually".
91
+ * This can useful if the `url` was manually inserted with a value that is different from the normalised value returned as `url`.
92
+ * @example
93
+ * { url: 'https://google.com', rawUrl: 'google.com' }
94
+ */
95
+ rawUrl?: string;
96
+ /** Raw object from the selected resource */
97
+ data?: Record<string, unknown>;
98
+ }
99
+ export interface LinkPickerProps {
100
+ /**
101
+ * Callback to fire on form submission.
102
+ */
103
+ onSubmit: (arg: OnSubmitParameter, analytic?: UIAnalyticsEvent | null) => void;
104
+ /**
105
+ * Callback to fire when the cancel button is clicked.
106
+ * If not provided, cancel button is not displayed.
107
+ */
108
+ onCancel?: () => void;
109
+ /** Callback to fire when content is changed inside the link picker e.g. items, when loading, tabs */
110
+ onContentResize?: () => void;
111
+ /** The url of the linked resource for editing. */
112
+ url?: string;
113
+ /** The desired text to be displayed alternatively to the title of the linked resource for editing. */
114
+ displayText?: string | null;
115
+ /** Plugins that provide link suggestions / search capabilities. */
116
+ plugins?: LinkPickerPlugin[];
117
+ /** If set true, Link picker will show the loading spinner where the tabs and results will show. */
118
+ isLoadingPlugins?: boolean;
119
+ /** Hides the link picker display text field if set to true. */
120
+ hideDisplayText?: boolean;
121
+ /** Disables the default width containing the link picker. */
122
+ disableWidth?: boolean;
123
+ /** Override the default left padding. */
124
+ paddingLeft?: string;
125
+ /** Override the default right padding. */
126
+ paddingRight?: string;
127
+ /** Override the default top padding. */
128
+ paddingTop?: string;
129
+ /** Override the default bottom padding. */
130
+ paddingBottom?: string;
131
+ /** Customise the link picker root component */
132
+ component?: React.ComponentType<Partial<LinkPickerProps> & {
133
+ children: React.ReactElement;
134
+ }>;
135
+ /** Allows for customisation of text in the link picker. */
136
+ customMessages?: CustomLinkPickerMessages;
137
+ featureFlags?: Record<string, unknown>;
138
+ /** Controls showing a "submission in-progres" UX */
139
+ isSubmitting?: boolean;
140
+ }
141
+ type CustomLinkPickerMessages = {
142
+ /** Label for the link input field */
143
+ linkLabel?: MessageDescriptor;
144
+ /** Aria label for the link input field */
145
+ linkAriaLabel?: MessageDescriptor;
146
+ /** Placeholder for the link input field */
147
+ linkPlaceholder?: MessageDescriptor;
148
+ /** Label for the link display text field */
149
+ linkTextLabel?: MessageDescriptor;
150
+ /** Placeholder for the link display text field */
151
+ linkTextPlaceholder?: MessageDescriptor;
152
+ /** Label for the submit button */
153
+ submitButtonLabel?: MessageDescriptor;
154
+ };
155
+ export {};
@@ -1,4 +1,7 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import React from 'react';
3
6
  export declare const MinHeightContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
4
7
  minHeight: string;
@@ -1,5 +1,6 @@
1
- export { default as LinkPicker } from './ui';
2
- export type { LinkPickerProps } from './ui/link-picker';
1
+ export { default } from './ui';
2
+ export { DeprecatedLazyLinkPickerExport as LinkPicker } from './ui';
3
+ export type { LinkPickerProps } from './common/types';
3
4
  export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
4
5
  export { UnauthenticatedError } from './common/utils/errors';
5
6
  export { LoaderFallback } from './ui/loader-fallback';
@@ -0,0 +1 @@
1
+ export { default as LazyLinkPicker } from './ui/lazy';
@@ -1,3 +1,6 @@
1
- /** @jsx jsx */
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
2
5
  import { jsx } from '@emotion/react';
3
6
  export declare const ErrorBoundaryFallback: () => jsx.JSX.Element;