@atlaskit/smart-card 17.0.0 → 17.0.1
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 +10 -0
- package/dist/cjs/client/api.js +5 -3
- package/dist/cjs/client/errors.js +3 -1
- package/dist/cjs/constants.js +77 -0
- package/dist/cjs/extractors/block/index.js +2 -2
- package/dist/cjs/extractors/common/actions/extractActions.js +2 -2
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +2 -2
- package/dist/cjs/extractors/common/context/extractAccessContext.js +2 -2
- package/dist/cjs/extractors/embed/index.js +2 -2
- package/dist/cjs/extractors/flexible/index.js +22 -0
- package/dist/cjs/state/flexible-ui-context/index.js +17 -0
- package/dist/cjs/state/flexible-ui-context/types.js +5 -0
- package/dist/cjs/state/reducers/index.js +2 -2
- package/dist/cjs/utils/analytics/analytics.js +2 -2
- package/dist/cjs/utils/analytics/index.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +87 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/container/index.js +117 -0
- package/dist/cjs/view/FlexibleCard/components/container/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/icon/atlaskit-icon/index.js +244 -0
- package/dist/cjs/view/FlexibleCard/components/elements/icon/atlaskit-icon/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/icon/image-icon/index.js +32 -0
- package/dist/cjs/view/FlexibleCard/components/elements/icon/image-icon/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +144 -0
- package/dist/cjs/view/FlexibleCard/components/elements/icon/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +135 -0
- package/dist/cjs/view/FlexibleCard/components/elements/link/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/elements/types.js +5 -0
- package/dist/es2019/constants.js +67 -0
- package/dist/es2019/extractors/flexible/index.js +14 -0
- package/dist/es2019/state/flexible-ui-context/index.js +3 -0
- package/dist/es2019/state/flexible-ui-context/types.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +62 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/container/index.js +89 -0
- package/dist/es2019/view/FlexibleCard/components/container/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/atlaskit-icon/index.js +175 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/atlaskit-icon/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/image-icon/index.js +19 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/image-icon/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +112 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +118 -0
- package/dist/es2019/view/FlexibleCard/components/elements/link/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/types.js +1 -0
- package/dist/esm/client/api.js +4 -3
- package/dist/esm/client/errors.js +2 -1
- package/dist/esm/constants.js +67 -0
- package/dist/esm/extractors/block/index.js +2 -2
- package/dist/esm/extractors/common/actions/extractActions.js +2 -2
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -2
- package/dist/esm/extractors/common/context/extractAccessContext.js +2 -2
- package/dist/esm/extractors/embed/index.js +2 -2
- package/dist/esm/extractors/flexible/index.js +14 -0
- package/dist/esm/state/flexible-ui-context/index.js +5 -0
- package/dist/esm/state/flexible-ui-context/types.js +1 -0
- package/dist/esm/state/reducers/index.js +2 -2
- package/dist/esm/utils/analytics/analytics.js +2 -2
- package/dist/esm/utils/analytics/index.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +74 -0
- package/dist/esm/view/FlexibleCard/components/blocks/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/container/index.js +102 -0
- package/dist/esm/view/FlexibleCard/components/container/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/icon/atlaskit-icon/index.js +224 -0
- package/dist/esm/view/FlexibleCard/components/elements/icon/atlaskit-icon/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/icon/image-icon/index.js +20 -0
- package/dist/esm/view/FlexibleCard/components/elements/icon/image-icon/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +124 -0
- package/dist/esm/view/FlexibleCard/components/elements/icon/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/link/index.js +120 -0
- package/dist/esm/view/FlexibleCard/components/elements/link/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/types.js +1 -0
- package/dist/types/constants.d.ts +56 -0
- package/dist/types/extractors/flexible/index.d.ts +4 -0
- package/dist/types/state/flexible-ui-context/index.d.ts +4 -0
- package/dist/types/state/flexible-ui-context/types.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/container/index.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/container/types.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/elements/icon/atlaskit-icon/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/icon/atlaskit-icon/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/elements/icon/image-icon/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/elements/icon/image-icon/types.d.ts +6 -0
- package/dist/types/view/FlexibleCard/components/elements/icon/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/elements/icon/types.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/elements/link/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/elements/link/types.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/elements/types.d.ts +5 -0
- package/package.json +10 -6
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export var SmartLinkDirection;
|
|
2
|
+
|
|
3
|
+
(function (SmartLinkDirection) {
|
|
4
|
+
SmartLinkDirection["Horizontal"] = "Horizontal";
|
|
5
|
+
SmartLinkDirection["Vertical"] = "Vertical";
|
|
6
|
+
})(SmartLinkDirection || (SmartLinkDirection = {}));
|
|
7
|
+
|
|
8
|
+
export var SmartLinkSize;
|
|
9
|
+
|
|
10
|
+
(function (SmartLinkSize) {
|
|
11
|
+
SmartLinkSize["XLarge"] = "xlarge";
|
|
12
|
+
SmartLinkSize["Large"] = "large";
|
|
13
|
+
SmartLinkSize["Medium"] = "medium";
|
|
14
|
+
SmartLinkSize["Small"] = "small";
|
|
15
|
+
})(SmartLinkSize || (SmartLinkSize = {}));
|
|
16
|
+
|
|
17
|
+
export var SmartLinkTheme;
|
|
18
|
+
|
|
19
|
+
(function (SmartLinkTheme) {
|
|
20
|
+
SmartLinkTheme["Black"] = "Black";
|
|
21
|
+
SmartLinkTheme["Link"] = "Link";
|
|
22
|
+
})(SmartLinkTheme || (SmartLinkTheme = {}));
|
|
23
|
+
|
|
24
|
+
export var IconType;
|
|
25
|
+
|
|
26
|
+
(function (IconType) {
|
|
27
|
+
IconType["Archive"] = "FileType:Archive";
|
|
28
|
+
IconType["Audio"] = "FileType:Audio";
|
|
29
|
+
IconType["Blog"] = "FileType:Blog";
|
|
30
|
+
IconType["Code"] = "FileType:Code";
|
|
31
|
+
IconType["Document"] = "FileType:Document";
|
|
32
|
+
IconType["Executable"] = "FileType:Executable";
|
|
33
|
+
IconType["File"] = "FileType:File";
|
|
34
|
+
IconType["Folder"] = "FileType:Folder";
|
|
35
|
+
IconType["Generic"] = "FileType:Generic";
|
|
36
|
+
IconType["GIF"] = "FileType:GIF";
|
|
37
|
+
IconType["GoogleDocs"] = "FileType:GoogleDocs";
|
|
38
|
+
IconType["GoogleForms"] = "FileType:GoogleForms";
|
|
39
|
+
IconType["GoogleSheets"] = "FileType:GoogleSheets";
|
|
40
|
+
IconType["GoogleSlides"] = "FileType:GoogleSlides";
|
|
41
|
+
IconType["Image"] = "FileType.Image";
|
|
42
|
+
IconType["MSExcel"] = "FileType:Excel";
|
|
43
|
+
IconType["MSPowerpoint"] = "FileType:Powerpoint";
|
|
44
|
+
IconType["MSWord"] = "FileType:WordDocument";
|
|
45
|
+
IconType["PDF"] = "FileType:PDF";
|
|
46
|
+
IconType["Presentation"] = "FileType:Presentation";
|
|
47
|
+
IconType["Sketch"] = "FileType:Sketch";
|
|
48
|
+
IconType["Spreadsheet"] = "FileType:Spreadsheet";
|
|
49
|
+
IconType["Template"] = "FileType:Template";
|
|
50
|
+
IconType["Video"] = "FileType:Video";
|
|
51
|
+
IconType["Branch"] = "BitBucket:Branch";
|
|
52
|
+
IconType["Commit"] = "BitBucket:Commit";
|
|
53
|
+
IconType["Project"] = "BitBucket:Project";
|
|
54
|
+
IconType["PullRequest"] = "BitBucket:PullRequest";
|
|
55
|
+
IconType["Repo"] = "BitBucket:Repo";
|
|
56
|
+
IconType["Bug"] = "Jira:Bug";
|
|
57
|
+
IconType["Change"] = "Jira:Change";
|
|
58
|
+
IconType["Epic"] = "Jira:Epic";
|
|
59
|
+
IconType["Incident"] = "Jira:Incident";
|
|
60
|
+
IconType["Problem"] = "Jira:Problem";
|
|
61
|
+
IconType["ServiceRequest"] = "Jira:ServiceRequest";
|
|
62
|
+
IconType["Story"] = "Jira:Story";
|
|
63
|
+
IconType["SubTask"] = "Jira:SubTask";
|
|
64
|
+
IconType["Task"] = "Jira:Task";
|
|
65
|
+
IconType["Confluence"] = "Provider:Confluence";
|
|
66
|
+
IconType["Jira"] = "Provider:Jira";
|
|
67
|
+
})(IconType || (IconType = {}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { extractLink, extractTitle, extractTitleTextColor, extractSummary } from '../common/primitives';
|
|
8
8
|
import { extractLozenge } from '../common/lozenge';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
8
|
import { DownloadAction, ViewAction } from '@atlaskit/media-ui';
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { PreviewAction } from '@atlaskit/media-ui';
|
|
8
8
|
import { uiRenderSuccessEvent, uiRenderFailedEvent } from '../../../utils/analytics';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { ForbiddenAction, messages } from '@atlaskit/media-ui';
|
|
8
8
|
export var extractRequestAccessContext = function extractRequestAccessContext(_ref) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { extractLink, extractTitle } from '../common/primitives';
|
|
8
8
|
import { extractProvider } from '../common/context';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { extractTitle } from '../common/primitives';
|
|
2
|
+
|
|
3
|
+
var extractFlexibleUiContext = function extractFlexibleUiContext(response) {
|
|
4
|
+
if (!response) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
var data = response.data;
|
|
9
|
+
return {
|
|
10
|
+
title: extractTitle(data)
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default extractFlexibleUiContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,9 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
|
|
3
3
|
var _cardReducerMap;
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
|
|
9
9
|
import * as actions from '../actions/constants';
|
|
10
10
|
import { getStatus } from '../helpers';
|
|
@@ -2,9 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
|
|
9
9
|
import { name as packageName, version as packageVersion } from '../../version.json';
|
|
10
10
|
import { getMeasure } from '../performance';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { resolvedEvent, unresolvedEvent } from './analytics';
|
|
8
8
|
import { getMeasure } from '../performance';
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { css, jsx } from '@emotion/core';
|
|
10
|
+
import { SmartLinkDirection, SmartLinkSize } from '../../../../../constants';
|
|
11
|
+
|
|
12
|
+
var getDirectionStyles = function getDirectionStyles(direction) {
|
|
13
|
+
switch (direction) {
|
|
14
|
+
case SmartLinkDirection.Vertical:
|
|
15
|
+
return {
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
alignItems: 'flex-start'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
case SmartLinkDirection.Horizontal:
|
|
21
|
+
default:
|
|
22
|
+
return {
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
alignItems: 'center'
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var getGapSize = function getGapSize(size) {
|
|
30
|
+
switch (size) {
|
|
31
|
+
case SmartLinkSize.XLarge:
|
|
32
|
+
return '1.25rem';
|
|
33
|
+
|
|
34
|
+
case SmartLinkSize.Large:
|
|
35
|
+
return '1rem';
|
|
36
|
+
|
|
37
|
+
case SmartLinkSize.Medium:
|
|
38
|
+
return '.5rem';
|
|
39
|
+
|
|
40
|
+
case SmartLinkSize.Small:
|
|
41
|
+
default:
|
|
42
|
+
return '.25rem';
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export var getBlockStyles = function getBlockStyles(direction, size) {
|
|
47
|
+
return css(_objectSpread(_objectSpread({
|
|
48
|
+
display: 'flex',
|
|
49
|
+
gap: getGapSize(size),
|
|
50
|
+
lineHeight: '1rem',
|
|
51
|
+
minWidth: 0
|
|
52
|
+
}, getDirectionStyles(direction)), {}, {
|
|
53
|
+
'& > *': {
|
|
54
|
+
minWidth: 0
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var Block = function Block(_ref) {
|
|
60
|
+
var children = _ref.children,
|
|
61
|
+
_ref$direction = _ref.direction,
|
|
62
|
+
direction = _ref$direction === void 0 ? SmartLinkDirection.Horizontal : _ref$direction,
|
|
63
|
+
_ref$size = _ref.size,
|
|
64
|
+
size = _ref$size === void 0 ? SmartLinkSize.Medium : _ref$size,
|
|
65
|
+
_ref$testId = _ref.testId,
|
|
66
|
+
testId = _ref$testId === void 0 ? 'smart-block' : _ref$testId;
|
|
67
|
+
return jsx("div", {
|
|
68
|
+
css: getBlockStyles(direction, size),
|
|
69
|
+
"data-smart-block": true,
|
|
70
|
+
"data-testid": testId
|
|
71
|
+
}, children);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default Block;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { N0, N40A, N50A } from '@atlaskit/theme/colors';
|
|
10
|
+
import { css, jsx } from '@emotion/core';
|
|
11
|
+
import { SmartLinkSize } from '../../../../constants';
|
|
12
|
+
import { token } from '@atlaskit/tokens';
|
|
13
|
+
|
|
14
|
+
var getElevationStyles = function getElevationStyles() {
|
|
15
|
+
return {
|
|
16
|
+
border: "1px solid transparent",
|
|
17
|
+
borderRadius: '1.5px',
|
|
18
|
+
boxShadow: token('elevation.shadow.raised', "0 1px 1px ".concat(N50A, ", 0 0 1px 1px ").concat(N40A)),
|
|
19
|
+
margin: '2px'
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var getGapSize = function getGapSize(size) {
|
|
24
|
+
switch (size) {
|
|
25
|
+
case SmartLinkSize.XLarge:
|
|
26
|
+
return '1.25rem';
|
|
27
|
+
|
|
28
|
+
case SmartLinkSize.Large:
|
|
29
|
+
return '1rem';
|
|
30
|
+
|
|
31
|
+
case SmartLinkSize.Medium:
|
|
32
|
+
return '.5rem';
|
|
33
|
+
|
|
34
|
+
case SmartLinkSize.Small:
|
|
35
|
+
default:
|
|
36
|
+
return '.25rem';
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var getPaddingSize = function getPaddingSize(size) {
|
|
41
|
+
switch (size) {
|
|
42
|
+
case SmartLinkSize.XLarge:
|
|
43
|
+
return '1.5rem';
|
|
44
|
+
|
|
45
|
+
case SmartLinkSize.Large:
|
|
46
|
+
return '1.25rem';
|
|
47
|
+
|
|
48
|
+
case SmartLinkSize.Medium:
|
|
49
|
+
return '1rem';
|
|
50
|
+
|
|
51
|
+
case SmartLinkSize.Small:
|
|
52
|
+
default:
|
|
53
|
+
return '.5rem';
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export var getContainerStyles = function getContainerStyles(size, hideBackground, hideElevation, hidePadding) {
|
|
58
|
+
var elevation = hideElevation ? {} : getElevationStyles();
|
|
59
|
+
return css(_objectSpread({
|
|
60
|
+
backgroundColor: hideBackground ? undefined : token('elevation.surface', N0),
|
|
61
|
+
display: 'flex',
|
|
62
|
+
gap: "".concat(getGapSize(size), " 0"),
|
|
63
|
+
flexDirection: 'column',
|
|
64
|
+
minWidth: 0,
|
|
65
|
+
overflow: 'hidden',
|
|
66
|
+
padding: hidePadding ? undefined : getPaddingSize(size)
|
|
67
|
+
}, elevation));
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var renderChildren = function renderChildren(children, containerSize) {
|
|
71
|
+
return React.Children.map(children, function (child) {
|
|
72
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
73
|
+
var blockSize = child.props.size;
|
|
74
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
75
|
+
size: blockSize || containerSize
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return child;
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
var Container = function Container(_ref) {
|
|
84
|
+
var children = _ref.children,
|
|
85
|
+
_ref$hideBackground = _ref.hideBackground,
|
|
86
|
+
hideBackground = _ref$hideBackground === void 0 ? false : _ref$hideBackground,
|
|
87
|
+
_ref$hideElevation = _ref.hideElevation,
|
|
88
|
+
hideElevation = _ref$hideElevation === void 0 ? false : _ref$hideElevation,
|
|
89
|
+
_ref$hidePadding = _ref.hidePadding,
|
|
90
|
+
hidePadding = _ref$hidePadding === void 0 ? false : _ref$hidePadding,
|
|
91
|
+
_ref$size = _ref.size,
|
|
92
|
+
size = _ref$size === void 0 ? SmartLinkSize.Medium : _ref$size,
|
|
93
|
+
_ref$testId = _ref.testId,
|
|
94
|
+
testId = _ref$testId === void 0 ? 'smart-links-container' : _ref$testId;
|
|
95
|
+
return jsx("div", {
|
|
96
|
+
css: getContainerStyles(size, hideBackground, hideElevation, hidePadding),
|
|
97
|
+
"data-smart-link-container": true,
|
|
98
|
+
"data-testid": testId
|
|
99
|
+
}, renderChildren(children, size));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export default Container;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
var _importIconMapper;
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import Loadable from 'react-loadable';
|
|
7
|
+
import { B200, B400, N700 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { IconType } from '../../../../../../constants';
|
|
9
|
+
// prettier-ignore
|
|
10
|
+
var importIconMapper = (_importIconMapper = {}, _defineProperty(_importIconMapper, IconType.Archive, function () {
|
|
11
|
+
return import(
|
|
12
|
+
/* webpackChunkName: "glyphArchive" */
|
|
13
|
+
'@atlaskit/icon-file-type/glyph/archive/16');
|
|
14
|
+
}), _defineProperty(_importIconMapper, IconType.Audio, function () {
|
|
15
|
+
return import(
|
|
16
|
+
/* webpackChunkName: "glyphAudio" */
|
|
17
|
+
'@atlaskit/icon-file-type/glyph/audio/16');
|
|
18
|
+
}), _defineProperty(_importIconMapper, IconType.Blog, function () {
|
|
19
|
+
return import(
|
|
20
|
+
/* webpackChunkName: "glyphBlog" */
|
|
21
|
+
'@atlaskit/icon-object/glyph/blog/16');
|
|
22
|
+
}), _defineProperty(_importIconMapper, IconType.Code, function () {
|
|
23
|
+
return import(
|
|
24
|
+
/* webpackChunkName: "glyphCode" */
|
|
25
|
+
'@atlaskit/icon-file-type/glyph/source-code/16');
|
|
26
|
+
}), _defineProperty(_importIconMapper, IconType.Document, function () {
|
|
27
|
+
return import(
|
|
28
|
+
/* webpackChunkName: "glyphDocument" */
|
|
29
|
+
'@atlaskit/icon-file-type/glyph/document/16');
|
|
30
|
+
}), _defineProperty(_importIconMapper, IconType.Executable, function () {
|
|
31
|
+
return import(
|
|
32
|
+
/* webpackChunkName: "glyphExecutable" */
|
|
33
|
+
'@atlaskit/icon-file-type/glyph/executable/16');
|
|
34
|
+
}), _defineProperty(_importIconMapper, IconType.File, function () {
|
|
35
|
+
return import(
|
|
36
|
+
/* webpackChunkName: "glyphFile" */
|
|
37
|
+
'@atlaskit/icon-file-type/glyph/generic/16');
|
|
38
|
+
}), _defineProperty(_importIconMapper, IconType.Folder, function () {
|
|
39
|
+
return import(
|
|
40
|
+
/* webpackChunkName: "glyphFolder" */
|
|
41
|
+
'@atlaskit/icon-file-type/glyph/folder/16');
|
|
42
|
+
}), _defineProperty(_importIconMapper, IconType.Generic, function () {
|
|
43
|
+
return import(
|
|
44
|
+
/* webpackChunkName: "glyphGeneric" */
|
|
45
|
+
'@atlaskit/icon-file-type/glyph/generic/16');
|
|
46
|
+
}), _defineProperty(_importIconMapper, IconType.GIF, function () {
|
|
47
|
+
return import(
|
|
48
|
+
/* webpackChunkName: "glyphGIF" */
|
|
49
|
+
'@atlaskit/icon-file-type/glyph/gif/16');
|
|
50
|
+
}), _defineProperty(_importIconMapper, IconType.GoogleDocs, function () {
|
|
51
|
+
return import(
|
|
52
|
+
/* webpackChunkName: "glyphGoogleDocs" */
|
|
53
|
+
'@atlaskit/icon-file-type/glyph/google-doc/16');
|
|
54
|
+
}), _defineProperty(_importIconMapper, IconType.GoogleForms, function () {
|
|
55
|
+
return import(
|
|
56
|
+
/* webpackChunkName: "glyphGoogleForms" */
|
|
57
|
+
'@atlaskit/icon-file-type/glyph/google-form/16');
|
|
58
|
+
}), _defineProperty(_importIconMapper, IconType.GoogleSheets, function () {
|
|
59
|
+
return import(
|
|
60
|
+
/* webpackChunkName: "glyphGoogleSheets" */
|
|
61
|
+
'@atlaskit/icon-file-type/glyph/google-sheet/16');
|
|
62
|
+
}), _defineProperty(_importIconMapper, IconType.GoogleSlides, function () {
|
|
63
|
+
return import(
|
|
64
|
+
/* webpackChunkName: "glyphGoogleSlides" */
|
|
65
|
+
'@atlaskit/icon-file-type/glyph/google-slide/16');
|
|
66
|
+
}), _defineProperty(_importIconMapper, IconType.Image, function () {
|
|
67
|
+
return import(
|
|
68
|
+
/* webpackChunkName: "glyphImage" */
|
|
69
|
+
'@atlaskit/icon-file-type/glyph/image/16');
|
|
70
|
+
}), _defineProperty(_importIconMapper, IconType.MSExcel, function () {
|
|
71
|
+
return import(
|
|
72
|
+
/* webpackChunkName: "glyphMSExcel" */
|
|
73
|
+
'@atlaskit/icon-file-type/glyph/excel-spreadsheet/16');
|
|
74
|
+
}), _defineProperty(_importIconMapper, IconType.MSPowerpoint, function () {
|
|
75
|
+
return import(
|
|
76
|
+
/* webpackChunkName: "glyphMSPowerpoint" */
|
|
77
|
+
'@atlaskit/icon-file-type/glyph/powerpoint-presentation/16');
|
|
78
|
+
}), _defineProperty(_importIconMapper, IconType.MSWord, function () {
|
|
79
|
+
return import(
|
|
80
|
+
/* webpackChunkName: "glyphMSWord" */
|
|
81
|
+
'@atlaskit/icon-file-type/glyph/word-document/16');
|
|
82
|
+
}), _defineProperty(_importIconMapper, IconType.PDF, function () {
|
|
83
|
+
return import(
|
|
84
|
+
/* webpackChunkName: "glyphPDF" */
|
|
85
|
+
'@atlaskit/icon-file-type/glyph/pdf-document/16');
|
|
86
|
+
}), _defineProperty(_importIconMapper, IconType.Presentation, function () {
|
|
87
|
+
return import(
|
|
88
|
+
/* webpackChunkName: "glyphPresentation" */
|
|
89
|
+
'@atlaskit/icon-file-type/glyph/presentation/16');
|
|
90
|
+
}), _defineProperty(_importIconMapper, IconType.Sketch, function () {
|
|
91
|
+
return import(
|
|
92
|
+
/* webpackChunkName: "glyphSketch" */
|
|
93
|
+
'@atlaskit/icon-file-type/glyph/sketch/16');
|
|
94
|
+
}), _defineProperty(_importIconMapper, IconType.Spreadsheet, function () {
|
|
95
|
+
return import(
|
|
96
|
+
/* webpackChunkName: "glyphSpreadsheet" */
|
|
97
|
+
'@atlaskit/icon-file-type/glyph/spreadsheet/16');
|
|
98
|
+
}), _defineProperty(_importIconMapper, IconType.Template, function () {
|
|
99
|
+
return import(
|
|
100
|
+
/* webpackChunkName: "glyphTemplate" */
|
|
101
|
+
'@atlaskit/icon/glyph/document-filled');
|
|
102
|
+
}), _defineProperty(_importIconMapper, IconType.Video, function () {
|
|
103
|
+
return import(
|
|
104
|
+
/* webpackChunkName: "glyphVideo" */
|
|
105
|
+
'@atlaskit/icon-file-type/glyph/video/16');
|
|
106
|
+
}), _defineProperty(_importIconMapper, IconType.Branch, function () {
|
|
107
|
+
return import(
|
|
108
|
+
/* webpackChunkName: "glyphBranch" */
|
|
109
|
+
'@atlaskit/icon-object/glyph/branch/16');
|
|
110
|
+
}), _defineProperty(_importIconMapper, IconType.Commit, function () {
|
|
111
|
+
return import(
|
|
112
|
+
/* webpackChunkName: "glyphCommit" */
|
|
113
|
+
'@atlaskit/icon-object/glyph/commit/16');
|
|
114
|
+
}), _defineProperty(_importIconMapper, IconType.Project, function () {
|
|
115
|
+
return import(
|
|
116
|
+
/* webpackChunkName: "glyphProject" */
|
|
117
|
+
'@atlaskit/icon/glyph/people-group');
|
|
118
|
+
}), _defineProperty(_importIconMapper, IconType.PullRequest, function () {
|
|
119
|
+
return import(
|
|
120
|
+
/* webpackChunkName: "glyphPullRequest" */
|
|
121
|
+
'@atlaskit/icon-object/glyph/pull-request/16');
|
|
122
|
+
}), _defineProperty(_importIconMapper, IconType.Repo, function () {
|
|
123
|
+
return import(
|
|
124
|
+
/* webpackChunkName: "glyphRepo" */
|
|
125
|
+
'@atlaskit/icon-object/glyph/code/16');
|
|
126
|
+
}), _defineProperty(_importIconMapper, IconType.Bug, function () {
|
|
127
|
+
return import(
|
|
128
|
+
/* webpackChunkName: "glyphBug" */
|
|
129
|
+
'@atlaskit/icon-object/glyph/bug/16');
|
|
130
|
+
}), _defineProperty(_importIconMapper, IconType.Change, function () {
|
|
131
|
+
return import(
|
|
132
|
+
/* webpackChunkName: "glyphChange" */
|
|
133
|
+
'@atlaskit/icon-object/glyph/changes/16');
|
|
134
|
+
}), _defineProperty(_importIconMapper, IconType.Epic, function () {
|
|
135
|
+
return import(
|
|
136
|
+
/* webpackChunkName: "glyphEpic" */
|
|
137
|
+
'@atlaskit/icon-object/glyph/epic/16');
|
|
138
|
+
}), _defineProperty(_importIconMapper, IconType.Incident, function () {
|
|
139
|
+
return import(
|
|
140
|
+
/* webpackChunkName: "glyphIncident" */
|
|
141
|
+
'@atlaskit/icon-object/glyph/incident/16');
|
|
142
|
+
}), _defineProperty(_importIconMapper, IconType.Problem, function () {
|
|
143
|
+
return import(
|
|
144
|
+
/* webpackChunkName: "glyphProblem" */
|
|
145
|
+
'@atlaskit/icon-object/glyph/problem/16');
|
|
146
|
+
}), _defineProperty(_importIconMapper, IconType.ServiceRequest, function () {
|
|
147
|
+
return import(
|
|
148
|
+
/* webpackChunkName: "glyphServiceRequest" */
|
|
149
|
+
'@atlaskit/icon-object/glyph/issue/16');
|
|
150
|
+
}), _defineProperty(_importIconMapper, IconType.Story, function () {
|
|
151
|
+
return import(
|
|
152
|
+
/* webpackChunkName: "glyphStory" */
|
|
153
|
+
'@atlaskit/icon-object/glyph/story/16');
|
|
154
|
+
}), _defineProperty(_importIconMapper, IconType.SubTask, function () {
|
|
155
|
+
return import(
|
|
156
|
+
/* webpackChunkName: "glyphSubTask" */
|
|
157
|
+
'@atlaskit/icon-object/glyph/subtask/16');
|
|
158
|
+
}), _defineProperty(_importIconMapper, IconType.Task, function () {
|
|
159
|
+
return import(
|
|
160
|
+
/* webpackChunkName: "glyphTask" */
|
|
161
|
+
'@atlaskit/icon-object/glyph/task/16');
|
|
162
|
+
}), _defineProperty(_importIconMapper, IconType.Confluence, function () {
|
|
163
|
+
return import(
|
|
164
|
+
/* webpackChunkName: "glyphConfluence" */
|
|
165
|
+
'@atlaskit/logo/confluence-icon').then(function (_ref) {
|
|
166
|
+
var ConfluenceIcon = _ref.ConfluenceIcon;
|
|
167
|
+
return {
|
|
168
|
+
default: ConfluenceIcon
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
}), _defineProperty(_importIconMapper, IconType.Jira, function () {
|
|
172
|
+
return import(
|
|
173
|
+
/* webpackChunkName: "glyphJira" */
|
|
174
|
+
'@atlaskit/logo/jira-icon').then(function (_ref2) {
|
|
175
|
+
var JiraIcon = _ref2.JiraIcon;
|
|
176
|
+
return {
|
|
177
|
+
default: JiraIcon
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
}), _importIconMapper);
|
|
181
|
+
|
|
182
|
+
var getIconImportFn = function getIconImportFn(icon) {
|
|
183
|
+
return importIconMapper[icon];
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
var importIcon = function importIcon(importFn) {
|
|
187
|
+
return Loadable({
|
|
188
|
+
loader: function loader() {
|
|
189
|
+
return importFn().then(function (module) {
|
|
190
|
+
return module.default;
|
|
191
|
+
});
|
|
192
|
+
},
|
|
193
|
+
loading: function loading() {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}); // Because we're using dynamic loading here, TS will not be able to infer the type.
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
var AtlaskitIcon = function AtlaskitIcon(_ref3) {
|
|
200
|
+
var icon = _ref3.icon,
|
|
201
|
+
label = _ref3.label,
|
|
202
|
+
testId = _ref3.testId;
|
|
203
|
+
var importFn = getIconImportFn(icon);
|
|
204
|
+
|
|
205
|
+
if (!importFn) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
var ImportedIcon = importIcon(importFn); // Logo component has a different prop set from other icon components
|
|
210
|
+
// and yet to support the token system.
|
|
211
|
+
|
|
212
|
+
var importedIcon = icon === IconType.Confluence || icon === IconType.Jira ? /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
213
|
+
textColor: N700,
|
|
214
|
+
iconColor: B200,
|
|
215
|
+
iconGradientStart: B400,
|
|
216
|
+
iconGradientStop: B200
|
|
217
|
+
}) : /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
218
|
+
label: label,
|
|
219
|
+
testId: testId
|
|
220
|
+
});
|
|
221
|
+
return importedIcon;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export default AtlaskitIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/core';
|
|
4
|
+
import ImageLoader from 'react-render-image';
|
|
5
|
+
|
|
6
|
+
var ImageIcon = function ImageIcon(_ref) {
|
|
7
|
+
var defaultIcon = _ref.defaultIcon,
|
|
8
|
+
testId = _ref.testId,
|
|
9
|
+
url = _ref.url;
|
|
10
|
+
return jsx(ImageLoader, {
|
|
11
|
+
src: url,
|
|
12
|
+
loaded: jsx("img", {
|
|
13
|
+
src: url,
|
|
14
|
+
"data-testid": "".concat(testId, "-image")
|
|
15
|
+
}),
|
|
16
|
+
errored: defaultIcon
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default ImageIcon;
|