@atlaskit/link-picker 1.39.2 → 1.39.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 1.39.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#121030](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121030)
8
+ [`23d9b73dfcb67`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/23d9b73dfcb67) -
9
+ Adding loading skeleton to issue goals and exporting the LoaderFallback in linking platform
10
+
11
+ ## 1.39.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#119779](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119779)
16
+ [`1915b904e58c6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1915b904e58c6) -
17
+ Improves the height of the suspense fallback when mounting the picker with a url prop (behind ff).
18
+ - Updated dependencies
19
+
3
20
  ## 1.39.2
4
21
 
5
22
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -10,6 +10,12 @@ Object.defineProperty(exports, "LinkPicker", {
10
10
  return _ui.default;
11
11
  }
12
12
  });
13
+ Object.defineProperty(exports, "LoaderFallback", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _loaderFallback.LoaderFallback;
17
+ }
18
+ });
13
19
  Object.defineProperty(exports, "UnauthenticatedError", {
14
20
  enumerable: true,
15
21
  get: function get() {
@@ -17,4 +23,5 @@ Object.defineProperty(exports, "UnauthenticatedError", {
17
23
  }
18
24
  });
19
25
  var _ui = _interopRequireDefault(require("./ui"));
20
- var _errors = require("./common/utils/errors");
26
+ var _errors = require("./common/utils/errors");
27
+ var _loaderFallback = require("./ui/loader-fallback");
@@ -26,7 +26,7 @@ var testIds = exports.testIds = {
26
26
  };
27
27
  var PACKAGE_DATA = exports.PACKAGE_DATA = {
28
28
  packageName: "@atlaskit/link-picker" || '',
29
- packageVersion: "1.39.2" || '',
29
+ packageVersion: "1.39.4" || '',
30
30
  componentName: _constants.COMPONENT_NAME,
31
31
  source: _constants.COMPONENT_NAME
32
32
  };
@@ -63,8 +63,8 @@ var ComposedLinkPicker = /*#__PURE__*/(0, _react.memo)(function (props) {
63
63
  * When ff disabled: component + loader + error boundary each providing their own width
64
64
  * Cannot make this change easier at risk of regression as external adopters may have css override on the form element
65
65
  */
66
- var RootFixedWidthContainer = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : _react.Fragment;
67
- var LoaderFallbackContainer = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-picker.fixed-height-search-results') ? _react.Fragment : FixedWidthContainer;
66
+ var RootFixedWidthContainer = (0, _platformFeatureFlags.fg)('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : _react.Fragment;
67
+ var LoaderFallbackContainer = (0, _platformFeatureFlags.fg)('platform.linking-platform.link-picker.fixed-height-search-results') ? _react.Fragment : FixedWidthContainer;
68
68
  return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
69
69
  data: PACKAGE_DATA
70
70
  }, (0, _react2.jsx)(_sessionProvider.LinkPickerSessionProvider, null, (0, _react2.jsx)(_messagesProvider.MessagesProvider, null, (0, _react2.jsx)("div", {
@@ -72,6 +72,7 @@ var ComposedLinkPicker = /*#__PURE__*/(0, _react.memo)(function (props) {
72
72
  "".concat(_constants.LINK_PICKER_WIDTH_IN_PX, "px")), (0, _defineProperty2.default)(_ref3, '--link-picker-padding-left', (_props$paddingLeft = props.paddingLeft) !== null && _props$paddingLeft !== void 0 ? _props$paddingLeft : "var(--ds-space-200, 16px)"), (0, _defineProperty2.default)(_ref3, '--link-picker-padding-right', (_props$paddingRight = props.paddingRight) !== null && _props$paddingRight !== void 0 ? _props$paddingRight : "var(--ds-space-200, 16px)"), (0, _defineProperty2.default)(_ref3, '--link-picker-padding-top', (_props$paddingTop = props.paddingTop) !== null && _props$paddingTop !== void 0 ? _props$paddingTop : "var(--ds-space-200, 16px)"), (0, _defineProperty2.default)(_ref3, '--link-picker-padding-bottom', (_props$paddingBottom = props.paddingBottom) !== null && _props$paddingBottom !== void 0 ? _props$paddingBottom : "var(--ds-space-200, 16px)"), _ref3)
73
73
  }, (0, _react2.jsx)(RootFixedWidthContainer, null, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(_reactLooselyLazy.LazySuspense, {
74
74
  fallback: (0, _react2.jsx)(LoaderFallbackContainer, null, (0, _react2.jsx)(_loaderFallback.LoaderFallback, {
75
+ url: props.url,
75
76
  hideDisplayText: props.hideDisplayText,
76
77
  isLoadingPlugins: props.isLoadingPlugins,
77
78
  plugins: props.plugins
@@ -15,11 +15,25 @@ var _primitives = require("@atlaskit/primitives");
15
15
  var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
16
16
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
17
17
  var _conditionalSpotlightTargetWrapper = require("./conditional-spotlight-target-wrapper");
18
- var _styled = require("./styled");
19
18
  var _utils = require("./utils");
20
19
  var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown", "onClear", "clearLabel", "error", "spotlightTargetName"];
21
20
  /** @jsx jsx */
22
21
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
+ /**
23
+ * Overidding text input margin top which design system provides as a default spacer
24
+ * but it gets in the way of our layout
25
+ */
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
27
+ var fieldStyles = (0, _react2.css)({
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
29
+ '> div': {
30
+ marginTop: 0
31
+ },
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
33
+ '& + &': {
34
+ marginTop: "var(--ds-space-200, 16px)"
35
+ }
36
+ });
23
37
  var testIds = exports.testIds = {
24
38
  urlError: 'link-error',
25
39
  clearUrlButton: 'clear-text'
@@ -84,25 +98,22 @@ var TextInput = exports.TextInput = function TextInput(_ref) {
84
98
  label: clearLabel || '',
85
99
  primaryColor: "var(--ds-icon-subtle, #626F86)"
86
100
  })));
87
- return (
88
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
89
- (0, _react2.jsx)("div", {
90
- css: _styled.fieldStyles
91
- }, (0, _react2.jsx)(_form.Field, {
92
- label: label,
93
- name: name
94
- }, function (_ref2) {
95
- var fieldProps = _ref2.fieldProps;
96
- return (0, _react2.jsx)(_conditionalSpotlightTargetWrapper.ConditionalSpotlightTargetWrapper, {
97
- spotlightTargetName: spotlightTargetName
98
- }, (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_textfield.default, (0, _extends2.default)({}, fieldProps, restProps, {
99
- onKeyDown: handleKeydown,
100
- ref: handleRef,
101
- elemAfterInput: clearText,
102
- isInvalid: !!error
103
- })), error && (0, _react2.jsx)(_form.ErrorMessage, {
104
- testId: testIds.urlError
105
- }, error)));
106
- }))
107
- );
101
+ return (0, _react2.jsx)("div", {
102
+ css: fieldStyles
103
+ }, (0, _react2.jsx)(_form.Field, {
104
+ label: label,
105
+ name: name
106
+ }, function (_ref2) {
107
+ var fieldProps = _ref2.fieldProps;
108
+ return (0, _react2.jsx)(_conditionalSpotlightTargetWrapper.ConditionalSpotlightTargetWrapper, {
109
+ spotlightTargetName: spotlightTargetName
110
+ }, (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_textfield.default, (0, _extends2.default)({}, fieldProps, restProps, {
111
+ onKeyDown: handleKeydown,
112
+ ref: handleRef,
113
+ elemAfterInput: clearText,
114
+ isInvalid: !!error
115
+ })), error && (0, _react2.jsx)(_form.ErrorMessage, {
116
+ testId: testIds.urlError
117
+ }, error)));
118
+ }));
108
119
  };
@@ -9,10 +9,12 @@ var _react = require("@emotion/react");
9
9
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
10
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
11
11
  var _minHeightContainer = require("../../common/ui/min-height-container");
12
- var _styled = require("./styled");
13
12
  /** @jsx jsx */
14
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
14
 
15
+ var styles = (0, _react.css)({
16
+ alignItems: 'center'
17
+ });
16
18
  var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT = '472px';
17
19
  var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT = '550px';
18
20
  var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT = '505px';
@@ -25,13 +27,26 @@ var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT = '220px';
25
27
  var getEstimatedMinHeight = function getEstimatedMinHeight(_ref) {
26
28
  var hideDisplayText = _ref.hideDisplayText,
27
29
  isLoadingPlugins = _ref.isLoadingPlugins,
28
- plugins = _ref.plugins;
29
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-picker.fixed-height-search-results')) {
30
- if (plugins && plugins.length > 1 || isLoadingPlugins) {
31
- return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
32
- }
33
- if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
34
- return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT;
30
+ plugins = _ref.plugins,
31
+ url = _ref.url;
32
+ if ((0, _platformFeatureFlags.fg)('platform.linking-platform.link-picker.fixed-height-search-results')) {
33
+ /**
34
+ * "Insert mode" (search results shown initially)
35
+ */
36
+ if (!url) {
37
+ /**
38
+ * With tabs
39
+ */
40
+ if (plugins && plugins.length > 1 || isLoadingPlugins) {
41
+ return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
42
+ }
43
+
44
+ /**
45
+ * Without tabs
46
+ */
47
+ if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
48
+ return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT;
49
+ }
35
50
  }
36
51
  return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT;
37
52
  }
@@ -49,7 +64,7 @@ var LoaderFallback = exports.LoaderFallback = function LoaderFallback(props) {
49
64
  "data-testid": "link-picker-root-loader-boundary-ui"
50
65
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
51
66
  ,
52
- css: _styled.styles
67
+ css: styles
53
68
  }, (0, _react.jsx)(_spinner.default, {
54
69
  testId: "link-picker.component-loading-indicator",
55
70
  size: "medium"
@@ -1,2 +1,3 @@
1
1
  export { default as LinkPicker } from './ui';
2
- export { UnauthenticatedError } from './common/utils/errors';
2
+ export { UnauthenticatedError } from './common/utils/errors';
3
+ export { LoaderFallback } from './ui/loader-fallback';
@@ -6,7 +6,7 @@ import React, { Fragment, memo } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
8
8
  import { AnalyticsContext } from '@atlaskit/analytics-next';
9
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
11
11
  import { LinkPickerSessionProvider } from '../controllers/session-provider';
12
12
  import { ErrorBoundary } from './error-boundary';
@@ -18,7 +18,7 @@ export const testIds = {
18
18
  };
19
19
  export const PACKAGE_DATA = {
20
20
  packageName: "@atlaskit/link-picker" || '',
21
- packageVersion: "1.39.2" || '',
21
+ packageVersion: "1.39.4" || '',
22
22
  componentName: COMPONENT_NAME,
23
23
  source: COMPONENT_NAME
24
24
  };
@@ -53,8 +53,8 @@ const ComposedLinkPicker = /*#__PURE__*/memo(props => {
53
53
  * When ff disabled: component + loader + error boundary each providing their own width
54
54
  * Cannot make this change easier at risk of regression as external adopters may have css override on the form element
55
55
  */
56
- const RootFixedWidthContainer = getBooleanFF('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : Fragment;
57
- const LoaderFallbackContainer = getBooleanFF('platform.linking-platform.link-picker.fixed-height-search-results') ? Fragment : FixedWidthContainer;
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
58
  return jsx(AnalyticsContext, {
59
59
  data: PACKAGE_DATA
60
60
  }, jsx(LinkPickerSessionProvider, null, jsx(MessagesProvider, null, jsx("div", {
@@ -69,6 +69,7 @@ const ComposedLinkPicker = /*#__PURE__*/memo(props => {
69
69
  }
70
70
  }, jsx(RootFixedWidthContainer, null, jsx(ErrorBoundary, null, jsx(LazySuspense, {
71
71
  fallback: jsx(LoaderFallbackContainer, null, jsx(LoaderFallback, {
72
+ url: props.url,
72
73
  hideDisplayText: props.hideDisplayText,
73
74
  isLoadingPlugins: props.isLoadingPlugins,
74
75
  plugins: props.plugins
@@ -3,15 +3,30 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import { Fragment, useCallback, useRef } from 'react';
4
4
 
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import { jsx } from '@emotion/react';
6
+ import { css, jsx } from '@emotion/react';
7
7
  import { ErrorMessage, Field } from '@atlaskit/form';
8
8
  import Selectclear from '@atlaskit/icon/glyph/select-clear';
9
9
  import { Pressable, xcss } from '@atlaskit/primitives';
10
10
  import Textfield from '@atlaskit/textfield';
11
11
  import Tooltip from '@atlaskit/tooltip';
12
12
  import { ConditionalSpotlightTargetWrapper } from './conditional-spotlight-target-wrapper';
13
- import { fieldStyles } from './styled';
14
13
  import { isRedoEvent, isUndoEvent } from './utils';
14
+
15
+ /**
16
+ * Overidding text input margin top which design system provides as a default spacer
17
+ * but it gets in the way of our layout
18
+ */
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
20
+ const fieldStyles = css({
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
22
+ '> div': {
23
+ marginTop: 0
24
+ },
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
26
+ '& + &': {
27
+ marginTop: "var(--ds-space-200, 16px)"
28
+ }
29
+ });
15
30
  export const testIds = {
16
31
  urlError: 'link-error',
17
32
  clearUrlButton: 'clear-text'
@@ -77,26 +92,23 @@ export const TextInput = ({
77
92
  label: clearLabel || '',
78
93
  primaryColor: "var(--ds-icon-subtle, #626F86)"
79
94
  })));
80
- return (
81
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
82
- jsx("div", {
83
- css: fieldStyles
84
- }, jsx(Field, {
85
- label: label,
86
- name: name
87
- }, ({
88
- fieldProps
89
- }) => {
90
- return jsx(ConditionalSpotlightTargetWrapper, {
91
- spotlightTargetName: spotlightTargetName
92
- }, jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, restProps, {
93
- onKeyDown: handleKeydown,
94
- ref: handleRef,
95
- elemAfterInput: clearText,
96
- isInvalid: !!error
97
- })), error && jsx(ErrorMessage, {
98
- testId: testIds.urlError
99
- }, error)));
100
- }))
101
- );
95
+ return jsx("div", {
96
+ css: fieldStyles
97
+ }, jsx(Field, {
98
+ label: label,
99
+ name: name
100
+ }, ({
101
+ fieldProps
102
+ }) => {
103
+ return jsx(ConditionalSpotlightTargetWrapper, {
104
+ spotlightTargetName: spotlightTargetName
105
+ }, jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, restProps, {
106
+ onKeyDown: handleKeydown,
107
+ ref: handleRef,
108
+ elemAfterInput: clearText,
109
+ isInvalid: !!error
110
+ })), error && jsx(ErrorMessage, {
111
+ testId: testIds.urlError
112
+ }, error)));
113
+ }));
102
114
  };
@@ -1,10 +1,12 @@
1
1
  /** @jsx jsx */
2
2
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
- import { jsx } from '@emotion/react';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
+ import { css, jsx } from '@emotion/react';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
5
5
  import Spinner from '@atlaskit/spinner';
6
6
  import { MinHeightContainer } from '../../common/ui/min-height-container';
7
- import { styles } from './styled';
7
+ const styles = css({
8
+ alignItems: 'center'
9
+ });
8
10
  const LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT = '472px';
9
11
  const LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT = '550px';
10
12
  const LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT = '505px';
@@ -17,14 +19,27 @@ const LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT = '220px';
17
19
  const getEstimatedMinHeight = ({
18
20
  hideDisplayText,
19
21
  isLoadingPlugins,
20
- plugins
22
+ plugins,
23
+ url
21
24
  }) => {
22
- if (getBooleanFF('platform.linking-platform.link-picker.fixed-height-search-results')) {
23
- if (plugins && plugins.length > 1 || isLoadingPlugins) {
24
- return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
25
- }
26
- if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
27
- return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT;
25
+ if (fg('platform.linking-platform.link-picker.fixed-height-search-results')) {
26
+ /**
27
+ * "Insert mode" (search results shown initially)
28
+ */
29
+ if (!url) {
30
+ /**
31
+ * With tabs
32
+ */
33
+ if (plugins && plugins.length > 1 || isLoadingPlugins) {
34
+ return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
35
+ }
36
+
37
+ /**
38
+ * Without tabs
39
+ */
40
+ if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
41
+ return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT;
42
+ }
28
43
  }
29
44
  return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT;
30
45
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as LinkPicker } from './ui';
2
- export { UnauthenticatedError } from './common/utils/errors';
2
+ export { UnauthenticatedError } from './common/utils/errors';
3
+ export { LoaderFallback } from './ui/loader-fallback';
@@ -7,7 +7,7 @@ import React, { Fragment, memo } from 'react';
7
7
  import { jsx } from '@emotion/react';
8
8
  import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
9
9
  import { AnalyticsContext } from '@atlaskit/analytics-next';
10
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
11
11
  import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
12
12
  import { LinkPickerSessionProvider } from '../controllers/session-provider';
13
13
  import { ErrorBoundary } from './error-boundary';
@@ -19,7 +19,7 @@ export var testIds = {
19
19
  };
20
20
  export var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/link-picker" || '',
22
- packageVersion: "1.39.2" || '',
22
+ packageVersion: "1.39.4" || '',
23
23
  componentName: COMPONENT_NAME,
24
24
  source: COMPONENT_NAME
25
25
  };
@@ -54,8 +54,8 @@ var ComposedLinkPicker = /*#__PURE__*/memo(function (props) {
54
54
  * When ff disabled: component + loader + error boundary each providing their own width
55
55
  * Cannot make this change easier at risk of regression as external adopters may have css override on the form element
56
56
  */
57
- var RootFixedWidthContainer = getBooleanFF('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : Fragment;
58
- var LoaderFallbackContainer = getBooleanFF('platform.linking-platform.link-picker.fixed-height-search-results') ? Fragment : FixedWidthContainer;
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
59
  return jsx(AnalyticsContext, {
60
60
  data: PACKAGE_DATA
61
61
  }, jsx(LinkPickerSessionProvider, null, jsx(MessagesProvider, null, jsx("div", {
@@ -63,6 +63,7 @@ var ComposedLinkPicker = /*#__PURE__*/memo(function (props) {
63
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
64
  }, jsx(RootFixedWidthContainer, null, jsx(ErrorBoundary, null, jsx(LazySuspense, {
65
65
  fallback: jsx(LoaderFallbackContainer, null, jsx(LoaderFallback, {
66
+ url: props.url,
66
67
  hideDisplayText: props.hideDisplayText,
67
68
  isLoadingPlugins: props.isLoadingPlugins,
68
69
  plugins: props.plugins
@@ -5,15 +5,30 @@ var _excluded = ["name", "label", "autoFocus", "onRedo", "onUndo", "onKeyDown",
5
5
  import { Fragment, useCallback, useRef } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { jsx } from '@emotion/react';
8
+ import { css, jsx } from '@emotion/react';
9
9
  import { ErrorMessage, Field } from '@atlaskit/form';
10
10
  import Selectclear from '@atlaskit/icon/glyph/select-clear';
11
11
  import { Pressable, xcss } from '@atlaskit/primitives';
12
12
  import Textfield from '@atlaskit/textfield';
13
13
  import Tooltip from '@atlaskit/tooltip';
14
14
  import { ConditionalSpotlightTargetWrapper } from './conditional-spotlight-target-wrapper';
15
- import { fieldStyles } from './styled';
16
15
  import { isRedoEvent, isUndoEvent } from './utils';
16
+
17
+ /**
18
+ * Overidding text input margin top which design system provides as a default spacer
19
+ * but it gets in the way of our layout
20
+ */
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
22
+ var fieldStyles = css({
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
24
+ '> div': {
25
+ marginTop: 0
26
+ },
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
28
+ '& + &': {
29
+ marginTop: "var(--ds-space-200, 16px)"
30
+ }
31
+ });
17
32
  export var testIds = {
18
33
  urlError: 'link-error',
19
34
  clearUrlButton: 'clear-text'
@@ -78,25 +93,22 @@ export var TextInput = function TextInput(_ref) {
78
93
  label: clearLabel || '',
79
94
  primaryColor: "var(--ds-icon-subtle, #626F86)"
80
95
  })));
81
- return (
82
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
83
- jsx("div", {
84
- css: fieldStyles
85
- }, jsx(Field, {
86
- label: label,
87
- name: name
88
- }, function (_ref2) {
89
- var fieldProps = _ref2.fieldProps;
90
- return jsx(ConditionalSpotlightTargetWrapper, {
91
- spotlightTargetName: spotlightTargetName
92
- }, jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, restProps, {
93
- onKeyDown: handleKeydown,
94
- ref: handleRef,
95
- elemAfterInput: clearText,
96
- isInvalid: !!error
97
- })), error && jsx(ErrorMessage, {
98
- testId: testIds.urlError
99
- }, error)));
100
- }))
101
- );
96
+ return jsx("div", {
97
+ css: fieldStyles
98
+ }, jsx(Field, {
99
+ label: label,
100
+ name: name
101
+ }, function (_ref2) {
102
+ var fieldProps = _ref2.fieldProps;
103
+ return jsx(ConditionalSpotlightTargetWrapper, {
104
+ spotlightTargetName: spotlightTargetName
105
+ }, jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, restProps, {
106
+ onKeyDown: handleKeydown,
107
+ ref: handleRef,
108
+ elemAfterInput: clearText,
109
+ isInvalid: !!error
110
+ })), error && jsx(ErrorMessage, {
111
+ testId: testIds.urlError
112
+ }, error)));
113
+ }));
102
114
  };
@@ -1,10 +1,12 @@
1
1
  /** @jsx jsx */
2
2
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
- import { jsx } from '@emotion/react';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
+ import { css, jsx } from '@emotion/react';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
5
5
  import Spinner from '@atlaskit/spinner';
6
6
  import { MinHeightContainer } from '../../common/ui/min-height-container';
7
- import { styles } from './styled';
7
+ var styles = css({
8
+ alignItems: 'center'
9
+ });
8
10
  var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT = '472px';
9
11
  var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT = '550px';
10
12
  var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT = '505px';
@@ -17,13 +19,26 @@ var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT = '220px';
17
19
  var getEstimatedMinHeight = function getEstimatedMinHeight(_ref) {
18
20
  var hideDisplayText = _ref.hideDisplayText,
19
21
  isLoadingPlugins = _ref.isLoadingPlugins,
20
- plugins = _ref.plugins;
21
- if (getBooleanFF('platform.linking-platform.link-picker.fixed-height-search-results')) {
22
- if (plugins && plugins.length > 1 || isLoadingPlugins) {
23
- return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
24
- }
25
- if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
26
- return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT;
22
+ plugins = _ref.plugins,
23
+ url = _ref.url;
24
+ if (fg('platform.linking-platform.link-picker.fixed-height-search-results')) {
25
+ /**
26
+ * "Insert mode" (search results shown initially)
27
+ */
28
+ if (!url) {
29
+ /**
30
+ * With tabs
31
+ */
32
+ if (plugins && plugins.length > 1 || isLoadingPlugins) {
33
+ return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
34
+ }
35
+
36
+ /**
37
+ * Without tabs
38
+ */
39
+ if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
40
+ return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT;
41
+ }
27
42
  }
28
43
  return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT;
29
44
  }
@@ -2,3 +2,4 @@ export { default as LinkPicker } from './ui';
2
2
  export type { LinkPickerProps } from './ui/link-picker';
3
3
  export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
4
4
  export { UnauthenticatedError } from './common/utils/errors';
5
+ export { LoaderFallback } from './ui/loader-fallback';
@@ -1,6 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  export type LoaderFallbackProps = {
4
+ url?: string;
4
5
  hideDisplayText?: boolean;
5
6
  isLoadingPlugins?: boolean;
6
7
  plugins?: unknown[];
@@ -2,3 +2,4 @@ export { default as LinkPicker } from './ui';
2
2
  export type { LinkPickerProps } from './ui/link-picker';
3
3
  export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
4
4
  export { UnauthenticatedError } from './common/utils/errors';
5
+ export { LoaderFallback } from './ui/loader-fallback';
@@ -1,6 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  export type LoaderFallbackProps = {
4
+ url?: string;
4
5
  hideDisplayText?: boolean;
5
6
  isLoadingPlugins?: boolean;
6
7
  plugins?: unknown[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.39.2",
3
+ "version": "1.39.4",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@atlaskit/analytics-next": "^9.3.0",
56
56
  "@atlaskit/atlassian-context": "^0.0.0",
57
- "@atlaskit/button": "^18.3.0",
57
+ "@atlaskit/button": "^18.4.0",
58
58
  "@atlaskit/form": "^10.4.0",
59
59
  "@atlaskit/frontend-utilities": "^2.7.0",
60
60
  "@atlaskit/heading": "^2.4.0",
@@ -65,10 +65,10 @@
65
65
  "@atlaskit/platform-feature-flags": "^0.3.0",
66
66
  "@atlaskit/primitives": "^11.0.0",
67
67
  "@atlaskit/spinner": "^16.2.0",
68
- "@atlaskit/tabs": "^16.2.0",
68
+ "@atlaskit/tabs": "^16.3.0",
69
69
  "@atlaskit/textfield": "^6.4.0",
70
70
  "@atlaskit/theme": "^12.11.0",
71
- "@atlaskit/tokens": "^1.53.0",
71
+ "@atlaskit/tokens": "^1.55.0",
72
72
  "@atlaskit/tooltip": "^18.5.0",
73
73
  "@atlaskit/ufo": "^0.2.0",
74
74
  "@atlaskit/visually-hidden": "^1.4.0",
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.fieldStyles = void 0;
7
- var _react = require("@emotion/react");
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
-
10
- /**
11
- * Overidding text input margin top which design system provides as a default spacer
12
- * but it gets in the way of our layout
13
- */
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
15
- var fieldStyles = exports.fieldStyles = (0, _react.css)({
16
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
17
- '> div': {
18
- marginTop: 0
19
- },
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
21
- '& + &': {
22
- marginTop: "var(--ds-space-200, 16px)"
23
- }
24
- });
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.styles = void 0;
7
- var _react = require("@emotion/react");
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
-
10
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
11
- var styles = exports.styles = (0, _react.css)({
12
- alignItems: 'center'
13
- });
@@ -1,17 +0,0 @@
1
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
- import { css } from '@emotion/react';
3
- /**
4
- * Overidding text input margin top which design system provides as a default spacer
5
- * but it gets in the way of our layout
6
- */
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
8
- export const fieldStyles = css({
9
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
10
- '> div': {
11
- marginTop: 0
12
- },
13
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
14
- '& + &': {
15
- marginTop: "var(--ds-space-200, 16px)"
16
- }
17
- });
@@ -1,7 +0,0 @@
1
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
- import { css } from '@emotion/react';
3
-
4
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
5
- export const styles = css({
6
- alignItems: 'center'
7
- });
@@ -1,17 +0,0 @@
1
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
- import { css } from '@emotion/react';
3
- /**
4
- * Overidding text input margin top which design system provides as a default spacer
5
- * but it gets in the way of our layout
6
- */
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
8
- export var fieldStyles = css({
9
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
10
- '> div': {
11
- marginTop: 0
12
- },
13
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
14
- '& + &': {
15
- marginTop: "var(--ds-space-200, 16px)"
16
- }
17
- });
@@ -1,7 +0,0 @@
1
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
- import { css } from '@emotion/react';
3
-
4
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
5
- export var styles = css({
6
- alignItems: 'center'
7
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * Overidding text input margin top which design system provides as a default spacer
3
- * but it gets in the way of our layout
4
- */
5
- export declare const fieldStyles: import("@emotion/react").SerializedStyles;
@@ -1 +0,0 @@
1
- export declare const styles: import("@emotion/react").SerializedStyles;
@@ -1,5 +0,0 @@
1
- /**
2
- * Overidding text input margin top which design system provides as a default spacer
3
- * but it gets in the way of our layout
4
- */
5
- export declare const fieldStyles: import("@emotion/react").SerializedStyles;
@@ -1 +0,0 @@
1
- export declare const styles: import("@emotion/react").SerializedStyles;