@atlaskit/link-picker 1.25.2 → 1.25.3
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/.eslintrc.js +18 -0
- package/CHANGELOG.md +6 -0
- package/compass.yml +43 -0
- package/dist/cjs/common/generic-error-svg/index.js +2 -3
- package/dist/cjs/controllers/use-fix-height/index.js +2 -3
- package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +2 -2
- package/dist/cjs/ui/error-boundary/index.js +5 -6
- package/dist/cjs/ui/index.js +11 -8
- package/dist/cjs/ui/link-picker/announcer.js +4 -5
- package/dist/cjs/ui/link-picker/form-footer/index.js +4 -5
- package/dist/cjs/ui/link-picker/index.js +21 -22
- package/dist/cjs/ui/link-picker/link-search-error/index.js +4 -5
- package/dist/cjs/ui/link-picker/link-search-list/index.js +8 -13
- package/dist/cjs/ui/link-picker/link-search-list/link-search-no-results/index.js +4 -5
- package/dist/cjs/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/cjs/ui/link-picker/list-item/index.js +44 -42
- package/dist/cjs/ui/link-picker/text-input/index.js +2 -3
- package/dist/cjs/ui/link-picker/track-mount/index.js +2 -4
- package/dist/cjs/ui/link-picker/track-tab-viewed/index.js +2 -4
- package/dist/cjs/ui/scrolling-tabs/index.js +2 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/generic-error-svg/index.js +2 -3
- package/dist/es2019/controllers/use-fix-height/index.js +2 -3
- package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +1 -1
- package/dist/es2019/ui/error-boundary/index.js +7 -6
- package/dist/es2019/ui/index.js +7 -4
- package/dist/es2019/ui/link-picker/announcer.js +2 -3
- package/dist/es2019/ui/link-picker/form-footer/index.js +2 -3
- package/dist/es2019/ui/link-picker/index.js +13 -14
- package/dist/es2019/ui/link-picker/link-search-error/index.js +3 -4
- package/dist/es2019/ui/link-picker/link-search-list/index.js +7 -8
- package/dist/es2019/ui/link-picker/link-search-list/link-search-no-results/index.js +3 -4
- package/dist/es2019/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/es2019/ui/link-picker/list-item/index.js +40 -39
- package/dist/es2019/ui/link-picker/text-input/index.js +2 -3
- package/dist/es2019/ui/link-picker/track-mount/index.js +2 -3
- package/dist/es2019/ui/link-picker/track-tab-viewed/index.js +2 -3
- package/dist/es2019/ui/scrolling-tabs/index.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/generic-error-svg/index.js +2 -3
- package/dist/esm/controllers/use-fix-height/index.js +2 -3
- package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +1 -1
- package/dist/esm/ui/error-boundary/index.js +6 -6
- package/dist/esm/ui/index.js +10 -6
- package/dist/esm/ui/link-picker/announcer.js +2 -3
- package/dist/esm/ui/link-picker/form-footer/index.js +2 -3
- package/dist/esm/ui/link-picker/index.js +12 -13
- package/dist/esm/ui/link-picker/link-search-error/index.js +3 -4
- package/dist/esm/ui/link-picker/link-search-list/index.js +7 -9
- package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/index.js +3 -4
- package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
- package/dist/esm/ui/link-picker/list-item/index.js +40 -39
- package/dist/esm/ui/link-picker/text-input/index.js +2 -3
- package/dist/esm/ui/link-picker/track-mount/index.js +2 -3
- package/dist/esm/ui/link-picker/track-tab-viewed/index.js +2 -3
- package/dist/esm/ui/scrolling-tabs/index.js +1 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/common/generic-error-svg/index.d.ts +1 -2
- package/dist/types/controllers/use-fix-height/index.d.ts +1 -2
- package/dist/types/ui/error-boundary/index.d.ts +4 -5
- package/dist/types/ui/index.d.ts +0 -1
- package/dist/types/ui/link-picker/announcer.d.ts +2 -2
- package/dist/types/ui/link-picker/form-footer/index.d.ts +2 -2
- package/dist/types/ui/link-picker/index.d.ts +4 -3
- package/dist/types/ui/link-picker/link-search-error/index.d.ts +1 -2
- package/dist/types/ui/link-picker/link-search-list/index.d.ts +4 -3
- package/dist/types/ui/link-picker/link-search-list/link-search-no-results/index.d.ts +1 -2
- package/dist/types/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.d.ts +1 -2
- package/dist/types/ui/link-picker/list-item/index.d.ts +6 -3
- package/dist/types/ui/link-picker/text-input/index.d.ts +1 -2
- package/dist/types/ui/link-picker/track-mount/index.d.ts +1 -2
- package/dist/types/ui/link-picker/track-tab-viewed/index.d.ts +1 -2
- package/dist/types/ui/scrolling-tabs/index.d.ts +1 -1
- package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +1 -2
- package/dist/types-ts4.5/controllers/use-fix-height/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/error-boundary/index.d.ts +4 -5
- package/dist/types-ts4.5/ui/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-picker/announcer.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/link-picker/index.d.ts +4 -3
- package/dist/types-ts4.5/ui/link-picker/link-search-error/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/link-search-list/index.d.ts +4 -3
- package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/list-item/index.d.ts +6 -3
- package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/track-mount/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/link-picker/track-tab-viewed/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/scrolling-tabs/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -13,7 +13,7 @@ import React, { forwardRef, memo, useState, useEffect } from 'react';
|
|
|
13
13
|
// Note: Flag 'contentRendered' resolves bug with duplicates messages (NVDA + Firefox)
|
|
14
14
|
// https://github.com/nvaccess/nvda/labels/bug%2Fdouble-speaking
|
|
15
15
|
var timer;
|
|
16
|
-
var Announcer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
16
|
+
export var Announcer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
17
17
|
var _ref$ariaAtomic = _ref.ariaAtomic,
|
|
18
18
|
ariaAtomic = _ref$ariaAtomic === void 0 ? 'true' : _ref$ariaAtomic,
|
|
19
19
|
_ref$ariaLive = _ref.ariaLive,
|
|
@@ -48,5 +48,4 @@ var Announcer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
48
48
|
"aria-relevant": ariaRelevant,
|
|
49
49
|
"aria-live": ariaLive
|
|
50
50
|
}, contentRendered && /*#__PURE__*/React.createElement("span", null, text));
|
|
51
|
-
});
|
|
52
|
-
export default /*#__PURE__*/memo(Announcer);
|
|
51
|
+
}));
|
|
@@ -32,7 +32,7 @@ export var testIds = {
|
|
|
32
32
|
cancelButton: 'link-picker-cancel-button',
|
|
33
33
|
actionButton: 'link-picker-action-button'
|
|
34
34
|
};
|
|
35
|
-
var FormFooter = function
|
|
35
|
+
export var FormFooter = /*#__PURE__*/memo(function (_ref) {
|
|
36
36
|
var isLoading = _ref.isLoading,
|
|
37
37
|
error = _ref.error,
|
|
38
38
|
url = _ref.url,
|
|
@@ -70,5 +70,4 @@ var FormFooter = function FormFooter(_ref) {
|
|
|
70
70
|
testId: testIds.insertButton,
|
|
71
71
|
isDisabled: isSubmitDisabled
|
|
72
72
|
}, intl.formatMessage(insertButtonMsg))));
|
|
73
|
-
};
|
|
74
|
-
export default /*#__PURE__*/memo(FormFooter);
|
|
73
|
+
});
|
|
@@ -11,6 +11,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
11
11
|
import EditorSearchIcon from '@atlaskit/icon/glyph/editor/search';
|
|
12
12
|
import Tabs, { Tab, TabList } from '@atlaskit/tabs';
|
|
13
13
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
14
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
14
15
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
15
16
|
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
16
17
|
import { useLinkPickerAnalytics, withInputFieldTracking, withLinkPickerAnalyticsContext } from '../../common/analytics';
|
|
@@ -18,20 +19,19 @@ import { normalizeUrl, isSafeUrl } from '@atlaskit/linking-common/url';
|
|
|
18
19
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
19
20
|
import { usePlugins } from '../../services/use-plugins';
|
|
20
21
|
import { useSearchQuery } from '../../services/use-search-query';
|
|
21
|
-
import useFixHeight from '../../controllers/use-fix-height';
|
|
22
|
+
import { useFixHeight } from '../../controllers/use-fix-height';
|
|
22
23
|
import { searchMessages, linkMessages, formMessages, linkTextMessages } from './messages';
|
|
23
|
-
import TextInput,
|
|
24
|
+
import { TextInput, testIds as textFieldTestIds } from './text-input';
|
|
24
25
|
import { rootContainerStyles, searchIconStyles, tabsWrapperStyles, flexColumnStyles, formFooterMargin } from './styled';
|
|
25
|
-
import Announcer from './announcer';
|
|
26
|
-
import ScrollingTabList from '../scrolling-tabs';
|
|
27
|
-
import LinkSearchList,
|
|
28
|
-
import LinkSearchError,
|
|
29
|
-
import FormFooter,
|
|
26
|
+
import { Announcer } from './announcer';
|
|
27
|
+
import { ScrollingTabList } from '../scrolling-tabs';
|
|
28
|
+
import { LinkSearchList, testIds as listTestIds } from './link-search-list';
|
|
29
|
+
import { LinkSearchError, testIds as searchErrorTestIds } from './link-search-error';
|
|
30
|
+
import { FormFooter, testIds as formFooterTestIds } from './form-footer';
|
|
30
31
|
import { getDataSource, getScreenReaderText, handleNavKeyDown } from './utils';
|
|
31
|
-
import TrackTabViewed from './track-tab-viewed';
|
|
32
|
-
import TrackMount from './track-mount';
|
|
32
|
+
import { TrackTabViewed } from './track-tab-viewed';
|
|
33
|
+
import { TrackMount } from './track-mount';
|
|
33
34
|
import { spinnerContainerStyles } from './link-search-list/styled';
|
|
34
|
-
import Spinner from '@atlaskit/spinner/spinner';
|
|
35
35
|
export var RECENT_SEARCH_LIST_SIZE = 5;
|
|
36
36
|
export var testIds = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
37
37
|
linkPickerRoot: 'link-picker-root',
|
|
@@ -78,7 +78,7 @@ var LinkInputField = withInputFieldTracking(TextInput, 'link', function (event,
|
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
var DisplayTextInputField = withInputFieldTracking(TextInput, 'displayText');
|
|
81
|
-
|
|
81
|
+
export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(function (_ref) {
|
|
82
82
|
var _activePlugin$errorFa, _activePlugin$errorFa2;
|
|
83
83
|
var onSubmit = _ref.onSubmit,
|
|
84
84
|
onCancel = _ref.onCancel,
|
|
@@ -378,5 +378,4 @@ function LinkPicker(_ref) {
|
|
|
378
378
|
action: pluginAction,
|
|
379
379
|
css: !queryState || !(plugins !== null && plugins !== void 0 && plugins.length) ? formFooterMargin : undefined
|
|
380
380
|
}));
|
|
381
|
-
}
|
|
382
|
-
export default withLinkPickerAnalyticsContext( /*#__PURE__*/memo(LinkPicker));
|
|
381
|
+
}));
|
|
@@ -4,7 +4,7 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import { useIntl, FormattedMessage, defineMessages } from 'react-intl-next';
|
|
5
5
|
import Button from '@atlaskit/button';
|
|
6
6
|
import EmptyState from '@atlaskit/empty-state';
|
|
7
|
-
import GenericErrorSVG from '../../../common/generic-error-svg';
|
|
7
|
+
import { GenericErrorSVG } from '../../../common/generic-error-svg';
|
|
8
8
|
export var CONTACT_SUPPORT_LINK = 'https://support.atlassian.com/contact/';
|
|
9
9
|
export var messages = defineMessages({
|
|
10
10
|
searchErrorHeader: {
|
|
@@ -21,7 +21,7 @@ export var messages = defineMessages({
|
|
|
21
21
|
export var testIds = {
|
|
22
22
|
searchError: 'link-search-error'
|
|
23
23
|
};
|
|
24
|
-
var LinkSearchError = function LinkSearchError() {
|
|
24
|
+
export var LinkSearchError = function LinkSearchError() {
|
|
25
25
|
var intl = useIntl();
|
|
26
26
|
return jsx(EmptyState, {
|
|
27
27
|
testId: testIds.searchError,
|
|
@@ -43,5 +43,4 @@ var LinkSearchError = function LinkSearchError() {
|
|
|
43
43
|
return jsx(GenericErrorSVG, null);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
};
|
|
47
|
-
export default LinkSearchError;
|
|
46
|
+
};
|
|
@@ -11,9 +11,9 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
11
11
|
import { defineMessages, FormattedMessage } from 'react-intl-next';
|
|
12
12
|
import Spinner from '@atlaskit/spinner';
|
|
13
13
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
14
|
-
import LinkSearchListItem from '../list-item';
|
|
14
|
+
import { LinkSearchListItem, testIds as searchResultItemTestIds } from '../list-item';
|
|
15
15
|
import { listContainerStyles, spinnerContainerStyles, listStyles, listTitleStyles } from './styled';
|
|
16
|
-
import
|
|
16
|
+
import { NoResults, testIds as noResultsTestIds } from './link-search-no-results';
|
|
17
17
|
import { useTrackResultsShown } from './use-track-results-shown';
|
|
18
18
|
import { handleNavKeyDown } from '../utils';
|
|
19
19
|
import { emptyStateNoResultsWrapper } from './link-search-no-results/styled';
|
|
@@ -34,14 +34,13 @@ export var messages = defineMessages({
|
|
|
34
34
|
description: 'Announce search results for screen-reader users.'
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
export var testIds = _objectSpread(_objectSpread({}, noResultsTestIds), {}, {
|
|
37
|
+
export var testIds = _objectSpread(_objectSpread(_objectSpread({}, noResultsTestIds), searchResultItemTestIds), {}, {
|
|
38
38
|
resultListTitle: 'link-picker-list-title',
|
|
39
|
-
searchResultItem: 'link-search-list-item',
|
|
40
39
|
searchResultList: 'link-search-list',
|
|
41
40
|
searchResultLoadingIndicator: 'link-picker.results-loading-indicator',
|
|
42
41
|
tabsLoadingIndicator: 'link-picker.tabs-loading-indicator'
|
|
43
42
|
});
|
|
44
|
-
var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
43
|
+
export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
45
44
|
var onChange = _ref.onChange,
|
|
46
45
|
onSelect = _ref.onSelect,
|
|
47
46
|
onKeyDown = _ref.onKeyDown,
|
|
@@ -104,14 +103,14 @@ var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
104
103
|
if ((items === null || items === void 0 ? void 0 : items.length) === 0) {
|
|
105
104
|
if (getBooleanFF('platform.linking-platform.link-picker.enable-empty-state')) {
|
|
106
105
|
if (hasSearchTerm) {
|
|
107
|
-
return jsx(
|
|
106
|
+
return jsx(NoResults, null);
|
|
108
107
|
} else {
|
|
109
108
|
return jsx("div", {
|
|
110
109
|
css: emptyStateNoResultsWrapper
|
|
111
110
|
}, activePlugin !== null && activePlugin !== void 0 && activePlugin.emptyStateNoResults ? activePlugin.emptyStateNoResults() : null);
|
|
112
111
|
}
|
|
113
112
|
} else {
|
|
114
|
-
return jsx(
|
|
113
|
+
return jsx(NoResults, null);
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
if (items && items.length > 0) {
|
|
@@ -164,5 +163,4 @@ var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
164
163
|
ref: ref,
|
|
165
164
|
css: listContainerStyles
|
|
166
165
|
}, restProps), itemsContent, loadingContent);
|
|
167
|
-
});
|
|
168
|
-
export default LinkSearchList;
|
|
166
|
+
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import EmptyState from '@atlaskit/empty-state';
|
|
4
4
|
import { useIntl, defineMessages } from 'react-intl-next';
|
|
5
|
-
import NoResultsSVG from './no-results-svg';
|
|
5
|
+
import { NoResultsSVG } from './no-results-svg';
|
|
6
6
|
import { emptyStateWrapperStyles } from './styled';
|
|
7
7
|
export var messages = defineMessages({
|
|
8
8
|
noResults: {
|
|
@@ -19,7 +19,7 @@ export var messages = defineMessages({
|
|
|
19
19
|
export var testIds = {
|
|
20
20
|
emptyResultPage: 'link-search-no-results'
|
|
21
21
|
};
|
|
22
|
-
var NoResults = function NoResults() {
|
|
22
|
+
export var NoResults = function NoResults() {
|
|
23
23
|
var intl = useIntl();
|
|
24
24
|
return jsx("div", {
|
|
25
25
|
css: emptyStateWrapperStyles
|
|
@@ -31,5 +31,4 @@ var NoResults = function NoResults() {
|
|
|
31
31
|
return jsx(NoResultsSVG, null);
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
34
|
-
};
|
|
35
|
-
export default NoResults;
|
|
34
|
+
};
|
package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/no-results-svg/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { noResultsSVGStyles } from './styled';
|
|
5
|
-
var NoResultsSVG = function NoResultsSVG() {
|
|
5
|
+
export var NoResultsSVG = function NoResultsSVG() {
|
|
6
6
|
var id = 'link-picker-ui-no-results-svg';
|
|
7
7
|
return jsx("svg", {
|
|
8
8
|
css: noResultsSVGStyles,
|
|
@@ -53,5 +53,4 @@ var NoResultsSVG = function NoResultsSVG() {
|
|
|
53
53
|
transform: "translate(0 .62)",
|
|
54
54
|
d: "M0 0h207.16v189.87H0z"
|
|
55
55
|
}))));
|
|
56
|
-
};
|
|
57
|
-
export default NoResultsSVG;
|
|
56
|
+
};
|
|
@@ -1,11 +1,47 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { forwardRef, Fragment } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import { useIntl } from 'react-intl-next';
|
|
4
5
|
import { transformTimeStamp } from '../transformTimeStamp';
|
|
5
6
|
import { itemNameStyles, itemIconStyles, listItemContextStyles, listItemNameStyles, composeListItemStyles, imgStyles, listItemContainerStyles, listItemContainerInnerStyles } from './styled';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export var testIds = {
|
|
8
|
+
searchResultItem: 'link-search-list-item',
|
|
9
|
+
searchResultIcon: 'link-search-list-item-icon'
|
|
10
|
+
};
|
|
11
|
+
var isSVG = function isSVG(icon) {
|
|
12
|
+
return icon.startsWith('<svg') && icon.endsWith('</svg>');
|
|
13
|
+
};
|
|
14
|
+
var base64SVG = function base64SVG(icon) {
|
|
15
|
+
return "data:image/svg+xml;base64,".concat(Buffer.from(icon).toString('base64'));
|
|
16
|
+
};
|
|
17
|
+
var ListItemIcon = function ListItemIcon(props) {
|
|
18
|
+
var item = props.item,
|
|
19
|
+
intl = props.intl;
|
|
20
|
+
var icon = item.icon,
|
|
21
|
+
iconAlt = item.iconAlt;
|
|
22
|
+
if (!icon) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
var alt = typeof iconAlt === 'string' ? iconAlt : intl.formatMessage(iconAlt);
|
|
26
|
+
if (typeof icon !== 'string') {
|
|
27
|
+
var Glyph = icon;
|
|
28
|
+
return jsx("span", {
|
|
29
|
+
css: itemIconStyles
|
|
30
|
+
}, jsx(Glyph, {
|
|
31
|
+
alt: alt,
|
|
32
|
+
"data-testid": testIds.searchResultIcon
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
return jsx("span", {
|
|
36
|
+
css: itemIconStyles
|
|
37
|
+
}, jsx("img", {
|
|
38
|
+
"data-testid": testIds.searchResultIcon,
|
|
39
|
+
src: isSVG(icon) ? base64SVG(icon) : icon,
|
|
40
|
+
alt: alt,
|
|
41
|
+
css: imgStyles
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
44
|
+
export var LinkSearchListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
9
45
|
var item = _ref.item,
|
|
10
46
|
selected = _ref.selected,
|
|
11
47
|
active = _ref.active,
|
|
@@ -50,39 +86,4 @@ var LinkSearchListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
50
86
|
}, container)), date && jsx("div", {
|
|
51
87
|
css: listItemContainerInnerStyles
|
|
52
88
|
}, container && jsx(Fragment, null, "\xA0 \u2022\xA0 "), jsx(Fragment, null, date)))));
|
|
53
|
-
});
|
|
54
|
-
export default LinkSearchListItem;
|
|
55
|
-
var isSVG = function isSVG(icon) {
|
|
56
|
-
return icon.startsWith('<svg') && icon.endsWith('</svg>');
|
|
57
|
-
};
|
|
58
|
-
var base64SVG = function base64SVG(icon) {
|
|
59
|
-
return "data:image/svg+xml;base64,".concat(Buffer.from(icon).toString('base64'));
|
|
60
|
-
};
|
|
61
|
-
var testId = 'link-search-list-item-icon';
|
|
62
|
-
var ListItemIcon = function ListItemIcon(props) {
|
|
63
|
-
var item = props.item,
|
|
64
|
-
intl = props.intl;
|
|
65
|
-
var icon = item.icon,
|
|
66
|
-
iconAlt = item.iconAlt;
|
|
67
|
-
if (!icon) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
var alt = typeof iconAlt === 'string' ? iconAlt : intl.formatMessage(iconAlt);
|
|
71
|
-
if (typeof icon !== 'string') {
|
|
72
|
-
var Glyph = icon;
|
|
73
|
-
return jsx("span", {
|
|
74
|
-
css: itemIconStyles
|
|
75
|
-
}, jsx(Glyph, {
|
|
76
|
-
alt: alt,
|
|
77
|
-
"data-testid": testId
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
return jsx("span", {
|
|
81
|
-
css: itemIconStyles
|
|
82
|
-
}, jsx("img", {
|
|
83
|
-
"data-testid": testId,
|
|
84
|
-
src: isSVG(icon) ? base64SVG(icon) : icon,
|
|
85
|
-
alt: alt,
|
|
86
|
-
css: imgStyles
|
|
87
|
-
}));
|
|
88
|
-
};
|
|
89
|
+
});
|
|
@@ -15,7 +15,7 @@ export var testIds = {
|
|
|
15
15
|
urlError: 'link-error',
|
|
16
16
|
clearUrlButton: 'clear-text'
|
|
17
17
|
};
|
|
18
|
-
var TextInput = function TextInput(_ref) {
|
|
18
|
+
export var TextInput = function TextInput(_ref) {
|
|
19
19
|
var name = _ref.name,
|
|
20
20
|
label = _ref.label,
|
|
21
21
|
autoFocus = _ref.autoFocus,
|
|
@@ -87,5 +87,4 @@ var TextInput = function TextInput(_ref) {
|
|
|
87
87
|
testId: testIds.urlError
|
|
88
88
|
}, error)));
|
|
89
89
|
}));
|
|
90
|
-
};
|
|
91
|
-
export default TextInput;
|
|
90
|
+
};
|
|
@@ -9,7 +9,7 @@ import { useLinkPickerSessionId } from '../../../controllers/session-provider';
|
|
|
9
9
|
/**
|
|
10
10
|
* UFO + Analytics tracking for component mount (and unmount)
|
|
11
11
|
*/
|
|
12
|
-
function TrackMount() {
|
|
12
|
+
export function TrackMount() {
|
|
13
13
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
14
14
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
15
15
|
var linkPickerSessionId = useLinkPickerSessionId();
|
|
@@ -25,5 +25,4 @@ function TrackMount() {
|
|
|
25
25
|
};
|
|
26
26
|
}, [createAnalyticsEvent]);
|
|
27
27
|
return null;
|
|
28
|
-
}
|
|
29
|
-
export default TrackMount;
|
|
28
|
+
}
|
|
@@ -3,7 +3,7 @@ import { useLayoutEffect } from 'react';
|
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
5
5
|
import { ANALYTICS_CHANNEL } from '../../../common/constants';
|
|
6
|
-
function TrackTabViewed(_ref) {
|
|
6
|
+
export function TrackTabViewed(_ref) {
|
|
7
7
|
var activePlugin = _ref.activePlugin;
|
|
8
8
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
9
9
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
@@ -13,5 +13,4 @@ function TrackTabViewed(_ref) {
|
|
|
13
13
|
}
|
|
14
14
|
}, [activePlugin, createAnalyticsEvent]);
|
|
15
15
|
return null;
|
|
16
|
-
}
|
|
17
|
-
export default TrackTabViewed;
|
|
16
|
+
}
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
|
|
4
|
-
export default GenericErrorSVG;
|
|
3
|
+
export declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const useFixHeight: (shouldFixHeight: boolean) => {
|
|
2
|
+
export declare const useFixHeight: (shouldFixHeight: boolean) => {
|
|
3
3
|
ref: import("react").RefObject<HTMLDivElement>;
|
|
4
4
|
style: {
|
|
5
5
|
minHeight: string | number;
|
|
6
6
|
} | undefined;
|
|
7
7
|
};
|
|
8
|
-
export default useFixHeight;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
interface ErrorBoundaryProps extends WithAnalyticsEventsProps {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
}
|
|
6
|
-
declare
|
|
7
|
-
export
|
|
5
|
+
export declare function ErrorBoundary({ children }: ErrorBoundaryProps): JSX.Element;
|
|
6
|
+
export {};
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -18,5 +18,5 @@ type AnnouncerProps = {
|
|
|
18
18
|
* It can be useful for cases when the parent component re-renders with the same announcer's text. */
|
|
19
19
|
delay?: number;
|
|
20
20
|
};
|
|
21
|
-
declare const
|
|
22
|
-
export
|
|
21
|
+
export declare const Announcer: React.FC<AnnouncerProps>;
|
|
22
|
+
export {};
|
|
@@ -18,5 +18,5 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
18
18
|
onCancel?: () => void;
|
|
19
19
|
action?: LinkPickerPluginAction;
|
|
20
20
|
}
|
|
21
|
-
declare const
|
|
22
|
-
export
|
|
21
|
+
export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
|
|
22
|
+
export {};
|
|
@@ -8,10 +8,11 @@ export declare const testIds: {
|
|
|
8
8
|
readonly urlError: string;
|
|
9
9
|
readonly clearUrlButton: string;
|
|
10
10
|
readonly resultListTitle: string;
|
|
11
|
-
readonly searchResultItem: string;
|
|
12
11
|
readonly searchResultList: string;
|
|
13
12
|
readonly searchResultLoadingIndicator: string;
|
|
14
13
|
readonly tabsLoadingIndicator: string;
|
|
14
|
+
readonly searchResultItem: string;
|
|
15
|
+
readonly searchResultIcon: string;
|
|
15
16
|
readonly emptyResultPage: string;
|
|
16
17
|
readonly searchError: string;
|
|
17
18
|
readonly insertButton: "link-picker-insert-button";
|
|
@@ -79,5 +80,5 @@ export interface PickerState {
|
|
|
79
80
|
/** When true, even if the selected index is -1, don't hide the recents. */
|
|
80
81
|
preventHidingRecents: boolean;
|
|
81
82
|
}
|
|
82
|
-
declare const
|
|
83
|
-
export
|
|
83
|
+
export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
|
|
84
|
+
export {};
|
|
@@ -20,10 +20,11 @@ export declare const messages: {
|
|
|
20
20
|
};
|
|
21
21
|
export declare const testIds: {
|
|
22
22
|
resultListTitle: string;
|
|
23
|
-
searchResultItem: string;
|
|
24
23
|
searchResultList: string;
|
|
25
24
|
searchResultLoadingIndicator: string;
|
|
26
25
|
tabsLoadingIndicator: string;
|
|
26
|
+
searchResultItem: string;
|
|
27
|
+
searchResultIcon: string;
|
|
27
28
|
emptyResultPage: string;
|
|
28
29
|
};
|
|
29
30
|
type LinkSearchListElement = HTMLElement;
|
|
@@ -42,5 +43,5 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
|
|
|
42
43
|
hasSearchTerm?: boolean;
|
|
43
44
|
activePlugin?: LinkPickerPlugin;
|
|
44
45
|
}
|
|
45
|
-
declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
-
export
|
|
46
|
+
export declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { KeyboardEvent } from 'react';
|
|
3
3
|
import { LinkSearchListItemData } from '../../types';
|
|
4
|
-
export
|
|
4
|
+
export declare const testIds: {
|
|
5
|
+
searchResultItem: string;
|
|
6
|
+
searchResultIcon: string;
|
|
7
|
+
};
|
|
8
|
+
export interface LinkSearchListItemProps {
|
|
5
9
|
item: LinkSearchListItemData;
|
|
6
10
|
selected: boolean;
|
|
7
11
|
active: boolean;
|
|
@@ -12,5 +16,4 @@ export interface Props {
|
|
|
12
16
|
id?: string;
|
|
13
17
|
role?: string;
|
|
14
18
|
}
|
|
15
|
-
declare const LinkSearchListItem: import("react").ForwardRefExoticComponent<
|
|
16
|
-
export default LinkSearchListItem;
|
|
19
|
+
export declare const LinkSearchListItem: import("react").ForwardRefExoticComponent<LinkSearchListItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -15,5 +15,4 @@ export declare const testIds: {
|
|
|
15
15
|
urlError: string;
|
|
16
16
|
clearUrlButton: string;
|
|
17
17
|
};
|
|
18
|
-
declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, spotlightTargetName, ...restProps }: TextInputProps) => jsx.JSX.Element;
|
|
19
|
-
export default TextInput;
|
|
18
|
+
export declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, spotlightTargetName, ...restProps }: TextInputProps) => jsx.JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
|
|
4
|
-
export default GenericErrorSVG;
|
|
3
|
+
export declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => jsx.JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const useFixHeight: (shouldFixHeight: boolean) => {
|
|
2
|
+
export declare const useFixHeight: (shouldFixHeight: boolean) => {
|
|
3
3
|
ref: import("react").RefObject<HTMLDivElement>;
|
|
4
4
|
style: {
|
|
5
5
|
minHeight: string | number;
|
|
6
6
|
} | undefined;
|
|
7
7
|
};
|
|
8
|
-
export default useFixHeight;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
interface ErrorBoundaryProps extends WithAnalyticsEventsProps {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
}
|
|
6
|
-
declare
|
|
7
|
-
export
|
|
5
|
+
export declare function ErrorBoundary({ children }: ErrorBoundaryProps): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -18,5 +18,5 @@ type AnnouncerProps = {
|
|
|
18
18
|
* It can be useful for cases when the parent component re-renders with the same announcer's text. */
|
|
19
19
|
delay?: number;
|
|
20
20
|
};
|
|
21
|
-
declare const
|
|
22
|
-
export
|
|
21
|
+
export declare const Announcer: React.FC<AnnouncerProps>;
|
|
22
|
+
export {};
|
|
@@ -18,5 +18,5 @@ interface FormFooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
18
18
|
onCancel?: () => void;
|
|
19
19
|
action?: LinkPickerPluginAction;
|
|
20
20
|
}
|
|
21
|
-
declare const
|
|
22
|
-
export
|
|
21
|
+
export declare const FormFooter: import("react").MemoExoticComponent<({ isLoading, error, url, queryState, items, isEditing, onCancel, action, ...restProps }: FormFooterProps) => jsx.JSX.Element | null>;
|
|
22
|
+
export {};
|
|
@@ -8,10 +8,11 @@ export declare const testIds: {
|
|
|
8
8
|
readonly urlError: string;
|
|
9
9
|
readonly clearUrlButton: string;
|
|
10
10
|
readonly resultListTitle: string;
|
|
11
|
-
readonly searchResultItem: string;
|
|
12
11
|
readonly searchResultList: string;
|
|
13
12
|
readonly searchResultLoadingIndicator: string;
|
|
14
13
|
readonly tabsLoadingIndicator: string;
|
|
14
|
+
readonly searchResultItem: string;
|
|
15
|
+
readonly searchResultIcon: string;
|
|
15
16
|
readonly emptyResultPage: string;
|
|
16
17
|
readonly searchError: string;
|
|
17
18
|
readonly insertButton: "link-picker-insert-button";
|
|
@@ -79,5 +80,5 @@ export interface PickerState {
|
|
|
79
80
|
/** When true, even if the selected index is -1, don't hide the recents. */
|
|
80
81
|
preventHidingRecents: boolean;
|
|
81
82
|
}
|
|
82
|
-
declare const
|
|
83
|
-
export
|
|
83
|
+
export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
|
|
84
|
+
export {};
|