@atlaskit/link-picker 1.45.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/common/analytics/context.js +1 -1
- package/dist/cjs/common/analytics/input-field-tracking.js +1 -1
- package/dist/cjs/common/ui/min-height-container/index.js +1 -1
- package/dist/cjs/common/utils/errors.js +1 -1
- package/dist/cjs/controllers/session-provider/index.js +1 -1
- package/dist/cjs/i18n/cs.js +1 -1
- package/dist/cjs/i18n/da.js +1 -1
- package/dist/cjs/i18n/de.js +1 -1
- package/dist/cjs/i18n/en.js +1 -1
- package/dist/cjs/i18n/en_GB.js +1 -1
- package/dist/cjs/i18n/en_ZZ.js +1 -1
- package/dist/cjs/i18n/es.js +1 -1
- package/dist/cjs/i18n/fi.js +1 -1
- package/dist/cjs/i18n/fr.js +1 -1
- package/dist/cjs/i18n/hu.js +1 -1
- package/dist/cjs/i18n/index.js +1 -1
- package/dist/cjs/i18n/it.js +1 -1
- package/dist/cjs/i18n/ja.js +1 -1
- package/dist/cjs/i18n/ko.js +1 -1
- package/dist/cjs/i18n/nb.js +1 -1
- package/dist/cjs/i18n/nl.js +1 -1
- package/dist/cjs/i18n/pl.js +1 -1
- package/dist/cjs/i18n/pt_BR.js +1 -1
- package/dist/cjs/i18n/ru.js +1 -1
- package/dist/cjs/i18n/sv.js +1 -1
- package/dist/cjs/i18n/th.js +1 -1
- package/dist/cjs/i18n/tr.js +1 -1
- package/dist/cjs/i18n/uk.js +1 -1
- package/dist/cjs/i18n/vi.js +1 -1
- package/dist/cjs/i18n/zh.js +1 -1
- package/dist/cjs/i18n/zh_TW.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/services/use-plugins/utils.js +1 -1
- package/dist/cjs/ui/error-boundary/error-boundary-base/index.js +2 -2
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +11 -30
- package/dist/cjs/ui/error-boundary/index.js +1 -1
- package/dist/cjs/ui/lazy.js +1 -1
- package/dist/cjs/ui/link-picker/announcer.js +1 -1
- package/dist/cjs/ui/link-picker/form-footer/feature-discovery/index.js +12 -2
- package/dist/cjs/ui/link-picker/form-footer/index.js +1 -1
- package/dist/cjs/ui/link-picker/index.js +19 -6
- package/dist/cjs/ui/link-picker/search-results/index.js +9 -10
- package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +5 -4
- package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.js +4 -4
- package/dist/cjs/ui/link-picker/search-results/search-results-container/index.js +20 -15
- package/dist/cjs/ui/loader-fallback/index.js +14 -21
- package/dist/cjs/ui/main.js +5 -14
- package/dist/es2019/i18n/cs.js +1 -1
- package/dist/es2019/i18n/da.js +1 -1
- package/dist/es2019/i18n/de.js +1 -1
- package/dist/es2019/i18n/en.js +1 -1
- package/dist/es2019/i18n/en_GB.js +1 -1
- package/dist/es2019/i18n/en_ZZ.js +1 -1
- package/dist/es2019/i18n/es.js +1 -1
- package/dist/es2019/i18n/fi.js +1 -1
- package/dist/es2019/i18n/fr.js +1 -1
- package/dist/es2019/i18n/hu.js +1 -1
- package/dist/es2019/i18n/it.js +1 -1
- package/dist/es2019/i18n/ja.js +1 -1
- package/dist/es2019/i18n/ko.js +1 -1
- package/dist/es2019/i18n/nb.js +1 -1
- package/dist/es2019/i18n/nl.js +1 -1
- package/dist/es2019/i18n/pl.js +1 -1
- package/dist/es2019/i18n/pt_BR.js +1 -1
- package/dist/es2019/i18n/ru.js +1 -1
- package/dist/es2019/i18n/sv.js +1 -1
- package/dist/es2019/i18n/th.js +1 -1
- package/dist/es2019/i18n/tr.js +1 -1
- package/dist/es2019/i18n/uk.js +1 -1
- package/dist/es2019/i18n/vi.js +1 -1
- package/dist/es2019/i18n/zh.js +1 -1
- package/dist/es2019/i18n/zh_TW.js +1 -1
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +9 -25
- package/dist/es2019/ui/link-picker/form-footer/feature-discovery/index.js +14 -2
- package/dist/es2019/ui/link-picker/index.js +17 -5
- package/dist/es2019/ui/link-picker/search-results/index.js +8 -9
- package/dist/es2019/ui/link-picker/search-results/link-search-list/index.js +4 -3
- package/dist/es2019/ui/link-picker/search-results/search-results-container/index.js +20 -14
- package/dist/es2019/ui/loader-fallback/index.js +14 -21
- package/dist/es2019/ui/main.js +5 -14
- package/dist/esm/common/utils/errors.js +1 -1
- package/dist/esm/i18n/cs.js +1 -1
- package/dist/esm/i18n/da.js +1 -1
- package/dist/esm/i18n/de.js +1 -1
- package/dist/esm/i18n/en.js +1 -1
- package/dist/esm/i18n/en_GB.js +1 -1
- package/dist/esm/i18n/en_ZZ.js +1 -1
- package/dist/esm/i18n/es.js +1 -1
- package/dist/esm/i18n/fi.js +1 -1
- package/dist/esm/i18n/fr.js +1 -1
- package/dist/esm/i18n/hu.js +1 -1
- package/dist/esm/i18n/it.js +1 -1
- package/dist/esm/i18n/ja.js +1 -1
- package/dist/esm/i18n/ko.js +1 -1
- package/dist/esm/i18n/nb.js +1 -1
- package/dist/esm/i18n/nl.js +1 -1
- package/dist/esm/i18n/pl.js +1 -1
- package/dist/esm/i18n/pt_BR.js +1 -1
- package/dist/esm/i18n/ru.js +1 -1
- package/dist/esm/i18n/sv.js +1 -1
- package/dist/esm/i18n/th.js +1 -1
- package/dist/esm/i18n/tr.js +1 -1
- package/dist/esm/i18n/uk.js +1 -1
- package/dist/esm/i18n/vi.js +1 -1
- package/dist/esm/i18n/zh.js +1 -1
- package/dist/esm/i18n/zh_TW.js +1 -1
- package/dist/esm/services/use-plugins/utils.js +1 -1
- package/dist/esm/ui/error-boundary/error-boundary-base/index.js +1 -1
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +11 -29
- package/dist/esm/ui/link-picker/form-footer/feature-discovery/index.js +12 -2
- package/dist/esm/ui/link-picker/index.js +18 -5
- package/dist/esm/ui/link-picker/search-results/index.js +8 -9
- package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +5 -4
- package/dist/esm/ui/link-picker/search-results/scrolling-tabs/index.js +3 -3
- package/dist/esm/ui/link-picker/search-results/search-results-container/index.js +19 -15
- package/dist/esm/ui/loader-fallback/index.js +14 -21
- package/dist/esm/ui/main.js +5 -14
- package/dist/types/common/types.d.ts +2 -0
- package/dist/types/ui/link-picker/search-results/index.d.ts +2 -1
- package/dist/types/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
- package/dist/types/ui/link-picker/search-results/search-results-container/index.d.ts +8 -3
- package/dist/types-ts4.5/common/types.d.ts +2 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/index.d.ts +8 -3
- package/package.json +8 -16
- package/dist/cjs/controllers/use-fix-height/index.js +0 -22
- package/dist/cjs/ui/link-picker/styled.js +0 -18
- package/dist/es2019/controllers/use-fix-height/index.js +0 -16
- package/dist/es2019/ui/link-picker/styled.js +0 -19
- package/dist/esm/controllers/use-fix-height/index.js +0 -16
- package/dist/esm/ui/link-picker/styled.js +0 -12
- package/dist/types/controllers/use-fix-height/index.d.ts +0 -7
- package/dist/types/ui/link-picker/styled.d.ts +0 -2
- package/dist/types-ts4.5/controllers/use-fix-height/index.d.ts +0 -7
- package/dist/types-ts4.5/ui/link-picker/styled.d.ts +0 -2
package/dist/esm/i18n/th.js
CHANGED
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
'fabric.linkPicker.button.cancel': 'ยกเลิก',
|
|
11
11
|
'fabric.linkPicker.button.insert': 'แทรก',
|
|
12
12
|
'fabric.linkPicker.button.save': 'บันทึก',
|
|
13
|
-
'fabric.linkPicker.clearLink': '
|
|
13
|
+
'fabric.linkPicker.clearLink': 'ล้าง',
|
|
14
14
|
'fabric.linkPicker.clearLinkText': 'ล้างข้อความ',
|
|
15
15
|
'fabric.linkPicker.hyperlink.searchLinkResults': '{count, plural, =0 {ไม่พบผลลัพธ์} other {พบผลลัพธ์ {count,number} รายการ}}',
|
|
16
16
|
'fabric.linkPicker.linkAriaLabel': 'พิมพ์หรือวางลิงก์ในช่อง',
|
package/dist/esm/i18n/tr.js
CHANGED
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
'fabric.linkPicker.button.cancel': 'İptal',
|
|
11
11
|
'fabric.linkPicker.button.insert': 'Ekle',
|
|
12
12
|
'fabric.linkPicker.button.save': 'Kaydet',
|
|
13
|
-
'fabric.linkPicker.clearLink': '
|
|
13
|
+
'fabric.linkPicker.clearLink': 'Temizle',
|
|
14
14
|
'fabric.linkPicker.clearLinkText': 'Metni temizle',
|
|
15
15
|
'fabric.linkPicker.hyperlink.searchLinkResults': '{count, plural, =0 {sonuç bulunamadı} one {{count,number} sonuç bulundu} other {{count,number} sonuç bulundu}}',
|
|
16
16
|
'fabric.linkPicker.linkAriaLabel': 'Alana bir bağlantı yazın ya da yapıştırın',
|
package/dist/esm/i18n/uk.js
CHANGED
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
'fabric.linkPicker.button.cancel': 'Скасувати',
|
|
11
11
|
'fabric.linkPicker.button.insert': 'Вставити',
|
|
12
12
|
'fabric.linkPicker.button.save': 'Зберегти',
|
|
13
|
-
'fabric.linkPicker.clearLink': '
|
|
13
|
+
'fabric.linkPicker.clearLink': 'Очистити',
|
|
14
14
|
'fabric.linkPicker.clearLinkText': 'Видалити текст',
|
|
15
15
|
'fabric.linkPicker.hyperlink.searchLinkResults': '{count, plural, =0 {нічого не знайдено} one {{count,number} результат} few {{count,number} результати} many {{count,number} результатів} other {{count,number} результату}}',
|
|
16
16
|
'fabric.linkPicker.linkAriaLabel': 'Введіть або вставте посилання в поле',
|
package/dist/esm/i18n/vi.js
CHANGED
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
'fabric.linkPicker.button.cancel': 'Hủy',
|
|
11
11
|
'fabric.linkPicker.button.insert': 'Chèn',
|
|
12
12
|
'fabric.linkPicker.button.save': 'Lưu',
|
|
13
|
-
'fabric.linkPicker.clearLink': 'Xóa
|
|
13
|
+
'fabric.linkPicker.clearLink': 'Xóa',
|
|
14
14
|
'fabric.linkPicker.clearLinkText': 'Xóa văn bản',
|
|
15
15
|
'fabric.linkPicker.hyperlink.searchLinkResults': '{count, plural, =0 {không tìm thấy kết quả} other {Đã tìm thấy {count,number} kết quả}}',
|
|
16
16
|
'fabric.linkPicker.linkAriaLabel': 'Nhập hoặc dán liên kết vào trường',
|
package/dist/esm/i18n/zh.js
CHANGED
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
'fabric.linkPicker.button.cancel': '取消',
|
|
11
11
|
'fabric.linkPicker.button.insert': '插入',
|
|
12
12
|
'fabric.linkPicker.button.save': '保存',
|
|
13
|
-
'fabric.linkPicker.clearLink': '
|
|
13
|
+
'fabric.linkPicker.clearLink': '清除',
|
|
14
14
|
'fabric.linkPicker.clearLinkText': '清除文本',
|
|
15
15
|
'fabric.linkPicker.hyperlink.searchLinkResults': '{count, plural, =0 {未找到结果} other {找到 {count,number} 个结果}}',
|
|
16
16
|
'fabric.linkPicker.linkAriaLabel': '在字段中输入或粘贴链接',
|
package/dist/esm/i18n/zh_TW.js
CHANGED
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
'fabric.linkPicker.button.cancel': '取消',
|
|
11
11
|
'fabric.linkPicker.button.insert': '插入',
|
|
12
12
|
'fabric.linkPicker.button.save': '儲存',
|
|
13
|
-
'fabric.linkPicker.clearLink': '
|
|
13
|
+
'fabric.linkPicker.clearLink': '清除',
|
|
14
14
|
'fabric.linkPicker.clearLinkText': '清除文字',
|
|
15
15
|
'fabric.linkPicker.hyperlink.searchLinkResults': '{count, plural, =0 {沒有找到任何結果} other {找到 {count,number} 個結果}}',
|
|
16
16
|
'fabric.linkPicker.linkAriaLabel': '在欄位中輸入或貼上連結',
|
|
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
export var CancellationError = /*#__PURE__*/function (_Error) {
|
|
12
12
|
_inherits(CancellationError, _Error);
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
function _createSuper(
|
|
6
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React, { Component } from 'react';
|
|
9
9
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -5,13 +5,10 @@
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { defineMessages, useIntl } from 'react-intl-next';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { LINK_PICKER_MIN_HEIGHT_IN_PX_FALLBACK } from '../../../common/constants';
|
|
10
9
|
import { GenericErrorSVG } from '../../../common/generic-error-svg';
|
|
11
10
|
import { EmptyState } from '../../../common/ui/empty-state';
|
|
12
11
|
import { MinHeightContainer } from '../../../common/ui/min-height-container';
|
|
13
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
14
|
-
import { rootContainerStyles } from '../../link-picker/styled';
|
|
15
12
|
var errorBoundaryFallbackStyles = css({
|
|
16
13
|
lineHeight: 'initial'
|
|
17
14
|
});
|
|
@@ -31,30 +28,15 @@ export var ErrorBoundaryFallback = function ErrorBoundaryFallback() {
|
|
|
31
28
|
var intl = useIntl();
|
|
32
29
|
var header = intl.formatMessage(messages.heading);
|
|
33
30
|
var description = intl.formatMessage(messages.description);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
return (
|
|
48
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
49
|
-
jsx("div", {
|
|
50
|
-
css: rootContainerStyles,
|
|
51
|
-
"data-testid": "link-picker-root-error-boundary-ui"
|
|
52
|
-
}, jsx(EmptyState, {
|
|
53
|
-
header: header,
|
|
54
|
-
renderImage: function renderImage() {
|
|
55
|
-
return jsx(GenericErrorSVG, null);
|
|
56
|
-
},
|
|
57
|
-
description: description
|
|
58
|
-
}))
|
|
59
|
-
);
|
|
31
|
+
return jsx(MinHeightContainer, {
|
|
32
|
+
css: errorBoundaryFallbackStyles,
|
|
33
|
+
minHeight: LINK_PICKER_MIN_HEIGHT_IN_PX_FALLBACK,
|
|
34
|
+
"data-testid": "link-picker-root-error-boundary-ui"
|
|
35
|
+
}, jsx(EmptyState, {
|
|
36
|
+
header: header,
|
|
37
|
+
renderImage: function renderImage() {
|
|
38
|
+
return jsx(GenericErrorSVG, null);
|
|
39
|
+
},
|
|
40
|
+
description: description
|
|
41
|
+
}));
|
|
60
42
|
};
|
|
@@ -26,15 +26,25 @@ var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
|
26
26
|
var storageClient = useMemo(function () {
|
|
27
27
|
return new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
28
28
|
}, []);
|
|
29
|
+
|
|
29
30
|
// Set this to `false` if you want to always show the feature discovery pulse.
|
|
30
31
|
// (or open Application tab in your devtools and delete the relevent row)
|
|
31
32
|
var discovered = useMemo(function () {
|
|
32
|
-
|
|
33
|
+
try {
|
|
34
|
+
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
35
|
+
} catch (_unused) {
|
|
36
|
+
// If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
33
39
|
}, [storageClient]);
|
|
34
40
|
useEffect(function () {
|
|
35
41
|
return function () {
|
|
36
42
|
if (!discovered) {
|
|
37
|
-
|
|
43
|
+
try {
|
|
44
|
+
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
45
|
+
} catch (_unused2) {
|
|
46
|
+
// silent error
|
|
47
|
+
}
|
|
38
48
|
}
|
|
39
49
|
};
|
|
40
50
|
}, [storageClient, discovered]);
|
|
@@ -10,7 +10,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
10
|
import { Fragment, memo, useCallback, useLayoutEffect, useMemo, useReducer } from 'react';
|
|
11
11
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
|
-
import { jsx } from '@emotion/react';
|
|
13
|
+
import { css, jsx } from '@emotion/react';
|
|
14
14
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
15
15
|
import uuid from 'uuid';
|
|
16
16
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -30,10 +30,22 @@ import { FormFooter, testIds as formFooterTestIds } from './form-footer';
|
|
|
30
30
|
import { LinkPickerSubmitButton } from './form-footer/link-picker-submit-button';
|
|
31
31
|
import { formMessages, linkMessages, linkTextMessages, searchMessages } from './messages';
|
|
32
32
|
import { SearchResults, testIds as searchTestIds } from './search-results';
|
|
33
|
-
import { formFooterMargin, rootContainerStyles } from './styled';
|
|
34
33
|
import { testIds as textFieldTestIds, TextInput } from './text-input';
|
|
35
34
|
import { TrackMount } from './track-mount';
|
|
36
35
|
import { getDataSource, getScreenReaderText } from './utils';
|
|
36
|
+
var rootContainerStyles = css({
|
|
37
|
+
paddingLeft: 'var(--link-picker-padding-left)',
|
|
38
|
+
paddingRight: 'var(--link-picker-padding-right)',
|
|
39
|
+
paddingTop: 'var(--link-picker-padding-top)',
|
|
40
|
+
paddingBottom: 'var(--link-picker-padding-bottom)',
|
|
41
|
+
boxSizing: 'border-box',
|
|
42
|
+
lineHeight: 'initial',
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
44
|
+
display: 'block !important'
|
|
45
|
+
});
|
|
46
|
+
var formFooterMargin = css({
|
|
47
|
+
marginTop: "var(--ds-space-200, 16px)"
|
|
48
|
+
});
|
|
37
49
|
export var testIds = _objectSpread(_objectSpread(_objectSpread({
|
|
38
50
|
linkPickerRoot: 'link-picker-root',
|
|
39
51
|
linkPicker: 'link-picker',
|
|
@@ -97,6 +109,8 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
97
109
|
customMessages = _ref.customMessages,
|
|
98
110
|
_ref$isSubmitting = _ref.isSubmitting,
|
|
99
111
|
isSubmitting = _ref$isSubmitting === void 0 ? false : _ref$isSubmitting,
|
|
112
|
+
_ref$adaptiveHeight = _ref.adaptiveHeight,
|
|
113
|
+
adaptiveHeight = _ref$adaptiveHeight === void 0 ? false : _ref$adaptiveHeight,
|
|
100
114
|
_ref$UNSAFE_moveSubmi = _ref.UNSAFE_moveSubmitButton,
|
|
101
115
|
UNSAFE_moveSubmitButton = _ref$UNSAFE_moveSubmi === void 0 ? false : _ref$UNSAFE_moveSubmi;
|
|
102
116
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -327,9 +341,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
327
341
|
var screenReaderText = browser().safari && getScreenReaderText(items !== null && items !== void 0 ? items : [], selectedIndex, intl);
|
|
328
342
|
var customSubmitButtonLabel = customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined;
|
|
329
343
|
return jsx("form", {
|
|
330
|
-
"data-testid": testIds.linkPicker
|
|
331
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
332
|
-
,
|
|
344
|
+
"data-testid": testIds.linkPicker,
|
|
333
345
|
css: rootContainerStyles
|
|
334
346
|
// Use onSubmitCapture instead of onSubmit so that any possible parent form isn't submitted
|
|
335
347
|
,
|
|
@@ -399,6 +411,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
|
|
|
399
411
|
handleSelected: handleSelected,
|
|
400
412
|
handleTabChange: handleTabChange,
|
|
401
413
|
handleSearchListOnChange: handleSearchListOnChange,
|
|
414
|
+
adaptiveHeight: adaptiveHeight,
|
|
402
415
|
retry: retry
|
|
403
416
|
}), jsx(FormFooter, {
|
|
404
417
|
error: error,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
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
3
|
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; }
|
|
@@ -13,7 +12,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
13
12
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
14
13
|
import Spinner from '@atlaskit/spinner/spinner';
|
|
15
14
|
import Tabs, { Tab, TabList } from '@atlaskit/tabs';
|
|
16
|
-
import { useFixHeight } from '../../../controllers/use-fix-height';
|
|
17
15
|
import { LinkSearchError, testIds as searchErrorTestIds } from './link-search-error';
|
|
18
16
|
import { LinkSearchList, testIds as listTestIds } from './link-search-list';
|
|
19
17
|
import { ScrollingTabList } from './scrolling-tabs';
|
|
@@ -54,20 +52,20 @@ export var SearchResults = function SearchResults(_ref) {
|
|
|
54
52
|
selectedIndex = _ref.selectedIndex,
|
|
55
53
|
handleSelected = _ref.handleSelected,
|
|
56
54
|
handleKeyDown = _ref.handleKeyDown,
|
|
55
|
+
adaptiveHeight = _ref.adaptiveHeight,
|
|
57
56
|
retry = _ref.retry;
|
|
58
57
|
var isActivePlugin = !!activePlugin;
|
|
59
|
-
|
|
60
|
-
// This will be redundant if we move towards fixed height search results section
|
|
61
|
-
var fixListHeightProps = useFixHeight(isLoadingResults);
|
|
62
58
|
var tabList = jsx(TabList, null, tabs.map(function (tab) {
|
|
63
59
|
return jsx(Tab, {
|
|
64
60
|
key: tab.tabTitle,
|
|
65
61
|
testId: testIds.tabItem
|
|
66
62
|
}, tab.tabTitle);
|
|
67
63
|
}));
|
|
68
|
-
return jsx(SearchResultsContainer,
|
|
69
|
-
hasTabs: !!tabs.length || isLoadingPlugins
|
|
70
|
-
|
|
64
|
+
return jsx(SearchResultsContainer, {
|
|
65
|
+
hasTabs: !!tabs.length || isLoadingPlugins,
|
|
66
|
+
adaptiveHeight: adaptiveHeight,
|
|
67
|
+
isLoadingResults: isLoadingResults
|
|
68
|
+
}, isLoadingPlugins && !!queryState && jsx("div", {
|
|
71
69
|
css: spinnerContainerStyles
|
|
72
70
|
}, jsx(Spinner, {
|
|
73
71
|
testId: testIds.tabsLoadingIndicator,
|
|
@@ -94,6 +92,7 @@ export var SearchResults = function SearchResults(_ref) {
|
|
|
94
92
|
onChange: handleSearchListOnChange,
|
|
95
93
|
onKeyDown: handleKeyDown,
|
|
96
94
|
hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
|
|
97
|
-
activePlugin: activePlugin
|
|
95
|
+
activePlugin: activePlugin,
|
|
96
|
+
adaptiveHeight: adaptiveHeight
|
|
98
97
|
}), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 || (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : jsx(LinkSearchError, null) : null));
|
|
99
98
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin"];
|
|
4
|
+
var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight"];
|
|
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
7
|
/**
|
|
@@ -65,6 +65,7 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
65
65
|
id = _ref.id,
|
|
66
66
|
hasSearchTerm = _ref.hasSearchTerm,
|
|
67
67
|
activePlugin = _ref.activePlugin,
|
|
68
|
+
adaptiveHeight = _ref.adaptiveHeight,
|
|
68
69
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
69
70
|
var itemsContent;
|
|
70
71
|
var loadingContent;
|
|
@@ -136,7 +137,7 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
136
137
|
}))), jsx("ul", {
|
|
137
138
|
id: id,
|
|
138
139
|
role: role
|
|
139
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
140
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
140
141
|
,
|
|
141
142
|
css: listStyles,
|
|
142
143
|
"aria-controls": "fabric.smartcard.linkpicker.suggested.results",
|
|
@@ -166,8 +167,8 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
166
167
|
}
|
|
167
168
|
if (isLoading) {
|
|
168
169
|
loadingContent = jsx(MinHeightContainer, {
|
|
169
|
-
minHeight:
|
|
170
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
170
|
+
minHeight: adaptiveHeight ? '80px' : '50px'
|
|
171
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
171
172
|
,
|
|
172
173
|
css: spinnerContainerStyles
|
|
173
174
|
}, jsx(Spinner, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
function _createForOfIteratorHelper(
|
|
4
|
-
function _unsupportedIterableToArray(
|
|
5
|
-
function _arrayLikeToArray(
|
|
3
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
6
|
/**
|
|
7
7
|
* @jsxRuntime classic
|
|
8
8
|
* @jsx jsx
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["hasTabs"];
|
|
4
1
|
/**
|
|
5
2
|
* @jsxRuntime classic
|
|
6
3
|
* @jsx jsx
|
|
7
4
|
*/
|
|
8
|
-
import {
|
|
5
|
+
import { useLayoutEffect, useRef } from 'react';
|
|
9
6
|
|
|
10
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
8
|
import { css, jsx } from '@emotion/react';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
9
|
import { MinHeightContainer } from '../../../../common/ui/min-height-container';
|
|
14
10
|
var flexColumn = css({
|
|
15
11
|
display: 'flex',
|
|
@@ -17,16 +13,24 @@ var flexColumn = css({
|
|
|
17
13
|
justifyContent: 'flex-start',
|
|
18
14
|
width: '100%'
|
|
19
15
|
});
|
|
20
|
-
export var SearchResultsContainer =
|
|
16
|
+
export var SearchResultsContainer = function SearchResultsContainer(_ref) {
|
|
21
17
|
var hasTabs = _ref.hasTabs,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
adaptiveHeight = _ref.adaptiveHeight,
|
|
19
|
+
isLoadingResults = _ref.isLoadingResults,
|
|
20
|
+
children = _ref.children;
|
|
21
|
+
var ref = useRef(null);
|
|
22
|
+
var currentHeight = useRef(null);
|
|
23
|
+
var fixedMinHeight = hasTabs ? '347px' : '302px';
|
|
24
|
+
var adaptiveMinHeight = isLoadingResults && !!currentHeight.current ? "".concat(currentHeight.current, "px") : 'auto';
|
|
25
|
+
var minheight = adaptiveHeight ? adaptiveMinHeight : fixedMinHeight;
|
|
26
|
+
useLayoutEffect(function () {
|
|
27
|
+
if (ref.current && adaptiveHeight && !isLoadingResults) {
|
|
28
|
+
currentHeight.current = ref.current.getBoundingClientRect().height;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return jsx(MinHeightContainer, {
|
|
28
32
|
ref: ref,
|
|
29
|
-
minHeight:
|
|
33
|
+
minHeight: minheight,
|
|
30
34
|
css: flexColumn
|
|
31
|
-
},
|
|
32
|
-
}
|
|
35
|
+
}, children);
|
|
36
|
+
};
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import Spinner from '@atlaskit/spinner';
|
|
9
8
|
import { MinHeightContainer } from '../../common/ui/min-height-container';
|
|
10
9
|
var styles = css({
|
|
@@ -16,36 +15,30 @@ var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITH_DISPLAYTEXT = '50
|
|
|
16
15
|
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_PLUGIN_WITHOUT_DISPLAYTEXT = '429px';
|
|
17
16
|
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT = '218px';
|
|
18
17
|
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT = '141px';
|
|
19
|
-
// EDM-7122: can delete these two consts once min height container for link picker is firm for the loader
|
|
20
|
-
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT = '142px';
|
|
21
|
-
var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT = '220px';
|
|
22
18
|
var getEstimatedMinHeight = function getEstimatedMinHeight(_ref) {
|
|
23
19
|
var hideDisplayText = _ref.hideDisplayText,
|
|
24
20
|
isLoadingPlugins = _ref.isLoadingPlugins,
|
|
25
21
|
plugins = _ref.plugins,
|
|
26
22
|
url = _ref.url;
|
|
27
|
-
|
|
23
|
+
/**
|
|
24
|
+
* "Insert mode" (search results shown initially)
|
|
25
|
+
*/
|
|
26
|
+
if (!url) {
|
|
28
27
|
/**
|
|
29
|
-
*
|
|
28
|
+
* With tabs
|
|
30
29
|
*/
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
if (plugins && plugins.length > 1 || isLoadingPlugins) {
|
|
36
|
-
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_TABS_WITH_DISPLAYTEXT;
|
|
37
|
-
}
|
|
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
|
+
}
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
34
|
+
/**
|
|
35
|
+
* Without tabs
|
|
36
|
+
*/
|
|
37
|
+
if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) === 1) {
|
|
38
|
+
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;
|
|
45
39
|
}
|
|
46
|
-
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT;
|
|
47
40
|
}
|
|
48
|
-
return hideDisplayText ?
|
|
41
|
+
return hideDisplayText ? LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITHOUT_DISPLAYTEXT : LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_TABS_WITH_DISPLAYTEXT;
|
|
49
42
|
};
|
|
50
43
|
|
|
51
44
|
/**
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -4,13 +4,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
* @jsxRuntime classic
|
|
5
5
|
* @jsx jsx
|
|
6
6
|
*/
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { memo } from 'react';
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { LazySuspense } from 'react-loosely-lazy';
|
|
12
12
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
|
|
15
14
|
import { LinkPickerSessionProvider } from '../controllers/session-provider';
|
|
16
15
|
import { ErrorBoundary } from './error-boundary';
|
|
@@ -21,7 +20,7 @@ export var testIds = {
|
|
|
21
20
|
};
|
|
22
21
|
export var PACKAGE_DATA = {
|
|
23
22
|
packageName: "@atlaskit/link-picker" || '',
|
|
24
|
-
packageVersion: "1.
|
|
23
|
+
packageVersion: "1.46.0" || '',
|
|
25
24
|
componentName: COMPONENT_NAME,
|
|
26
25
|
source: COMPONENT_NAME
|
|
27
26
|
};
|
|
@@ -44,26 +43,18 @@ export var composeLinkPicker = function composeLinkPicker(Component) {
|
|
|
44
43
|
var _props$paddingLeft, _props$paddingRight, _props$paddingTop, _props$paddingBottom, _ref2;
|
|
45
44
|
var component = props.component;
|
|
46
45
|
var RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* When ff enabled: root container will provide width to component + loader + error boundary
|
|
50
|
-
* When ff disabled: component + loader + error boundary each providing their own width
|
|
51
|
-
* Cannot make this change easier at risk of regression as external adopters may have css override on the form element
|
|
52
|
-
*/
|
|
53
|
-
var RootFixedWidthContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? FixedWidthContainer : Fragment;
|
|
54
|
-
var LoaderFallbackContainer = fg('platform.linking-platform.link-picker.fixed-height-search-results') ? Fragment : FixedWidthContainer;
|
|
55
46
|
return jsx(AnalyticsContext, {
|
|
56
47
|
data: PACKAGE_DATA
|
|
57
48
|
}, jsx(LinkPickerSessionProvider, null, jsx(MessagesProvider, null, jsx("div", {
|
|
58
49
|
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
|
|
59
50
|
"".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)
|
|
60
|
-
}, jsx(
|
|
61
|
-
fallback: jsx(
|
|
51
|
+
}, jsx(FixedWidthContainer, null, jsx(ErrorBoundary, null, jsx(LazySuspense, {
|
|
52
|
+
fallback: jsx(LoaderFallback, {
|
|
62
53
|
url: props.url,
|
|
63
54
|
hideDisplayText: props.hideDisplayText,
|
|
64
55
|
isLoadingPlugins: props.isLoadingPlugins,
|
|
65
56
|
plugins: props.plugins
|
|
66
|
-
})
|
|
57
|
+
})
|
|
67
58
|
}, jsx(RootComponent, _extends({}, props, {
|
|
68
59
|
"data-testid": testIds.linkPickerRoot
|
|
69
60
|
}), jsx(Component, props)))))))));
|
|
@@ -145,6 +145,8 @@ export interface LinkPickerProps {
|
|
|
145
145
|
}>;
|
|
146
146
|
/** Allows for customisation of text in the link picker. */
|
|
147
147
|
customMessages?: CustomLinkPickerMessages;
|
|
148
|
+
/** Allows height of search results to adapt to the number of results being displayed. */
|
|
149
|
+
adaptiveHeight?: boolean;
|
|
148
150
|
featureFlags?: Record<string, unknown>;
|
|
149
151
|
/** Controls showing a "submission in-progres" UX */
|
|
150
152
|
isSubmitting?: boolean;
|
|
@@ -39,6 +39,7 @@ export type SearchResultsProps = {
|
|
|
39
39
|
handleSelected: (objectId: string) => void;
|
|
40
40
|
handleKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
|
|
41
41
|
error?: unknown;
|
|
42
|
+
adaptiveHeight: boolean;
|
|
42
43
|
retry: () => void;
|
|
43
44
|
};
|
|
44
|
-
export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, retry, }: SearchResultsProps) => jsx.JSX.Element;
|
|
45
|
+
export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, adaptiveHeight, retry, }: SearchResultsProps) => jsx.JSX.Element;
|
|
@@ -36,6 +36,7 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
|
|
|
36
36
|
isLoading: boolean;
|
|
37
37
|
selectedIndex: number;
|
|
38
38
|
activeIndex: number;
|
|
39
|
+
adaptiveHeight: boolean;
|
|
39
40
|
onChange: (objectId: string) => void;
|
|
40
41
|
onSelect: (objectId: string) => void;
|
|
41
42
|
onKeyDown?: (e: KeyboardEvent<LinkSearchListElement>) => void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
type SearchResultsContainerProps = {
|
|
4
|
+
adaptiveHeight: boolean;
|
|
5
|
+
isLoadingResults: boolean;
|
|
6
|
+
hasTabs?: boolean;
|
|
4
7
|
children?: React.ReactNode;
|
|
5
|
-
}
|
|
8
|
+
};
|
|
9
|
+
export declare const SearchResultsContainer: ({ hasTabs, adaptiveHeight, isLoadingResults, children, }: SearchResultsContainerProps) => jsx.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -148,6 +148,8 @@ export interface LinkPickerProps {
|
|
|
148
148
|
}>;
|
|
149
149
|
/** Allows for customisation of text in the link picker. */
|
|
150
150
|
customMessages?: CustomLinkPickerMessages;
|
|
151
|
+
/** Allows height of search results to adapt to the number of results being displayed. */
|
|
152
|
+
adaptiveHeight?: boolean;
|
|
151
153
|
featureFlags?: Record<string, unknown>;
|
|
152
154
|
/** Controls showing a "submission in-progres" UX */
|
|
153
155
|
isSubmitting?: boolean;
|
|
@@ -39,6 +39,7 @@ export type SearchResultsProps = {
|
|
|
39
39
|
handleSelected: (objectId: string) => void;
|
|
40
40
|
handleKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
|
|
41
41
|
error?: unknown;
|
|
42
|
+
adaptiveHeight: boolean;
|
|
42
43
|
retry: () => void;
|
|
43
44
|
};
|
|
44
|
-
export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, retry, }: SearchResultsProps) => jsx.JSX.Element;
|
|
45
|
+
export declare const SearchResults: ({ tabs, activeTab, activePlugin, isLoadingPlugins, isLoadingResults, isSubmitting, handleTabChange, handleSearchListOnChange, featureFlags, linkSearchListId, error, queryState, items, activeIndex, selectedIndex, handleSelected, handleKeyDown, adaptiveHeight, retry, }: SearchResultsProps) => jsx.JSX.Element;
|
|
@@ -36,6 +36,7 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
|
|
|
36
36
|
isLoading: boolean;
|
|
37
37
|
selectedIndex: number;
|
|
38
38
|
activeIndex: number;
|
|
39
|
+
adaptiveHeight: boolean;
|
|
39
40
|
onChange: (objectId: string) => void;
|
|
40
41
|
onSelect: (objectId: string) => void;
|
|
41
42
|
onKeyDown?: (e: KeyboardEvent<LinkSearchListElement>) => void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
type SearchResultsContainerProps = {
|
|
4
|
+
adaptiveHeight: boolean;
|
|
5
|
+
isLoadingResults: boolean;
|
|
6
|
+
hasTabs?: boolean;
|
|
4
7
|
children?: React.ReactNode;
|
|
5
|
-
}
|
|
8
|
+
};
|
|
9
|
+
export declare const SearchResultsContainer: ({ hasTabs, adaptiveHeight, isLoadingResults, children, }: SearchResultsContainerProps) => jsx.JSX.Element;
|
|
10
|
+
export {};
|