@atlaskit/user-picker 8.8.1 → 8.8.2
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 +6 -0
- package/dist/cjs/components/ExternalUserOption/SourcesTooltipContent.js +2 -3
- package/dist/cjs/components/ExternalUserSourcesContainer.js +3 -6
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/ExternalUserOption/SourcesTooltipContent.js +2 -3
- package/dist/es2019/components/ExternalUserSourcesContainer.js +3 -6
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/ExternalUserOption/SourcesTooltipContent.js +2 -3
- package/dist/esm/components/ExternalUserSourcesContainer.js +3 -6
- package/dist/esm/version.json +1 -1
- package/dist/types/components/ExternalUserSourcesContainer.d.ts +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -78,8 +78,7 @@ var SUPPORTED_SOURCES = [{
|
|
|
78
78
|
|
|
79
79
|
var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
80
80
|
var sources = _ref.sources,
|
|
81
|
-
sourcesLoading = _ref.sourcesLoading
|
|
82
|
-
sourcesError = _ref.sourcesError;
|
|
81
|
+
sourcesLoading = _ref.sourcesLoading;
|
|
83
82
|
|
|
84
83
|
var sourcesToRender = _react.default.useMemo(function () {
|
|
85
84
|
return SUPPORTED_SOURCES.filter(function (supportedSource) {
|
|
@@ -87,7 +86,7 @@ var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
|
87
86
|
});
|
|
88
87
|
}, [sources]);
|
|
89
88
|
|
|
90
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
89
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !sourcesLoading && sources.length === 0 ? /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.externalUserSourcesError)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.externalUserSourcesHeading)), /*#__PURE__*/_react.default.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
91
90
|
size: "small",
|
|
92
91
|
appearance: "invert"
|
|
93
92
|
}), !sourcesLoading && sourcesToRender.map(function (_ref2) {
|
|
@@ -19,22 +19,19 @@ var ExternalUserSourcesContainer = function ExternalUserSourcesContainer(_ref) {
|
|
|
19
19
|
|
|
20
20
|
var _useUserSource = (0, _UserSourceProvider.useUserSource)(accountId, shouldFetchSources, initialSources),
|
|
21
21
|
sources = _useUserSource.sources,
|
|
22
|
-
sourcesLoading = _useUserSource.loading
|
|
23
|
-
sourcesError = _useUserSource.error;
|
|
22
|
+
sourcesLoading = _useUserSource.loading;
|
|
24
23
|
|
|
25
24
|
if (typeof children === 'function') {
|
|
26
25
|
return children({
|
|
27
26
|
sources: sources,
|
|
28
|
-
sourcesLoading: sourcesLoading
|
|
29
|
-
sourcesError: sourcesError
|
|
27
|
+
sourcesLoading: sourcesLoading
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
return _react.default.Children.map(children, function (child) {
|
|
34
32
|
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
35
33
|
sources: sources,
|
|
36
|
-
sourcesLoading: sourcesLoading
|
|
37
|
-
sourcesError: sourcesError
|
|
34
|
+
sourcesLoading: sourcesLoading
|
|
38
35
|
});
|
|
39
36
|
});
|
|
40
37
|
};
|
package/dist/cjs/version.json
CHANGED
|
@@ -55,11 +55,10 @@ const SUPPORTED_SOURCES = [{
|
|
|
55
55
|
}];
|
|
56
56
|
export const SourcesTooltipContent = ({
|
|
57
57
|
sources,
|
|
58
|
-
sourcesLoading
|
|
59
|
-
sourcesError
|
|
58
|
+
sourcesLoading
|
|
60
59
|
}) => {
|
|
61
60
|
const sourcesToRender = React.useMemo(() => SUPPORTED_SOURCES.filter(supportedSource => sources.includes(supportedSource.sourceType)), [sources]);
|
|
62
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
61
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !sourcesLoading && sources.length === 0 ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesError)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesHeading)), /*#__PURE__*/React.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/React.createElement(Spinner, {
|
|
63
62
|
size: "small",
|
|
64
63
|
appearance: "invert"
|
|
65
64
|
}), !sourcesLoading && sourcesToRender.map(({
|
|
@@ -8,21 +8,18 @@ export const ExternalUserSourcesContainer = ({
|
|
|
8
8
|
}) => {
|
|
9
9
|
const {
|
|
10
10
|
sources,
|
|
11
|
-
loading: sourcesLoading
|
|
12
|
-
error: sourcesError
|
|
11
|
+
loading: sourcesLoading
|
|
13
12
|
} = useUserSource(accountId, shouldFetchSources, initialSources);
|
|
14
13
|
|
|
15
14
|
if (typeof children === 'function') {
|
|
16
15
|
return children({
|
|
17
16
|
sources,
|
|
18
|
-
sourcesLoading
|
|
19
|
-
sourcesError
|
|
17
|
+
sourcesLoading
|
|
20
18
|
});
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
return React.Children.map(children, child => /*#__PURE__*/React.cloneElement(child, {
|
|
24
22
|
sources,
|
|
25
|
-
sourcesLoading
|
|
26
|
-
sourcesError
|
|
23
|
+
sourcesLoading
|
|
27
24
|
}));
|
|
28
25
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -52,14 +52,13 @@ var SUPPORTED_SOURCES = [{
|
|
|
52
52
|
}];
|
|
53
53
|
export var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
54
54
|
var sources = _ref.sources,
|
|
55
|
-
sourcesLoading = _ref.sourcesLoading
|
|
56
|
-
sourcesError = _ref.sourcesError;
|
|
55
|
+
sourcesLoading = _ref.sourcesLoading;
|
|
57
56
|
var sourcesToRender = React.useMemo(function () {
|
|
58
57
|
return SUPPORTED_SOURCES.filter(function (supportedSource) {
|
|
59
58
|
return sources.includes(supportedSource.sourceType);
|
|
60
59
|
});
|
|
61
60
|
}, [sources]);
|
|
62
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
61
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !sourcesLoading && sources.length === 0 ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesError)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesHeading)), /*#__PURE__*/React.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/React.createElement(Spinner, {
|
|
63
62
|
size: "small",
|
|
64
63
|
appearance: "invert"
|
|
65
64
|
}), !sourcesLoading && sourcesToRender.map(function (_ref2) {
|
|
@@ -8,22 +8,19 @@ export var ExternalUserSourcesContainer = function ExternalUserSourcesContainer(
|
|
|
8
8
|
|
|
9
9
|
var _useUserSource = useUserSource(accountId, shouldFetchSources, initialSources),
|
|
10
10
|
sources = _useUserSource.sources,
|
|
11
|
-
sourcesLoading = _useUserSource.loading
|
|
12
|
-
sourcesError = _useUserSource.error;
|
|
11
|
+
sourcesLoading = _useUserSource.loading;
|
|
13
12
|
|
|
14
13
|
if (typeof children === 'function') {
|
|
15
14
|
return children({
|
|
16
15
|
sources: sources,
|
|
17
|
-
sourcesLoading: sourcesLoading
|
|
18
|
-
sourcesError: sourcesError
|
|
16
|
+
sourcesLoading: sourcesLoading
|
|
19
17
|
});
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
return React.Children.map(children, function (child) {
|
|
23
21
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
24
22
|
sources: sources,
|
|
25
|
-
sourcesLoading: sourcesLoading
|
|
26
|
-
sourcesError: sourcesError
|
|
23
|
+
sourcesLoading: sourcesLoading
|
|
27
24
|
});
|
|
28
25
|
});
|
|
29
26
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -3,7 +3,6 @@ import { UserSource } from '../types';
|
|
|
3
3
|
export interface ExternalUserSourcesData {
|
|
4
4
|
sources: UserSource[];
|
|
5
5
|
sourcesLoading: boolean;
|
|
6
|
-
sourcesError: string | null;
|
|
7
6
|
}
|
|
8
7
|
declare type SourcesChildrenFunc = (sourcesData: ExternalUserSourcesData) => ReactNode;
|
|
9
8
|
interface SourcesContainerProps {
|