@atlaskit/smart-card 26.9.15 → 26.9.16
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 +7 -0
- package/dist/cjs/state/helpers.js +1 -21
- package/dist/cjs/state/hooks/use-resolve/index.js +1 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/state/helpers.js +0 -22
- package/dist/es2019/state/hooks/use-resolve/index.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/state/helpers.js +0 -19
- package/dist/esm/state/hooks/use-resolve/index.js +1 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/state/helpers.d.ts +0 -1
- package/dist/types-ts4.5/state/helpers.d.ts +0 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.9.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a4ff4c2f918`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a4ff4c2f918) - Update to use 'getStatus' from '@atlaskit/linking-common'
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 26.9.15
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isVisible = exports.isFinalState = exports.isAccessible = exports.hasResolved = exports.getSubproduct = exports.getStatusDetails = exports.
|
|
6
|
+
exports.isVisible = exports.isFinalState = exports.isAccessible = exports.hasResolved = exports.getSubproduct = exports.getStatusDetails = exports.getServices = exports.getResourceType = exports.getProduct = exports.getExtensionKey = exports.getDefinitionId = exports.getClickUrl = exports.getByDefinitionId = void 0;
|
|
7
7
|
var _extractVisitUrl = require("../extractors/common/primitives/extractVisitUrl");
|
|
8
8
|
var getByDefinitionId = function getByDefinitionId(definitionId, store) {
|
|
9
9
|
var urls = Object.keys(store);
|
|
@@ -65,27 +65,7 @@ var isVisible = function isVisible(_ref2) {
|
|
|
65
65
|
var visibility = _ref2.meta.visibility;
|
|
66
66
|
return visibility === 'restricted' || visibility === 'public';
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
// Be aware, this is a copy of a function in link-provider/src/helpers
|
|
70
68
|
exports.isVisible = isVisible;
|
|
71
|
-
var getStatus = function getStatus(_ref3) {
|
|
72
|
-
var meta = _ref3.meta;
|
|
73
|
-
var access = meta.access,
|
|
74
|
-
visibility = meta.visibility;
|
|
75
|
-
switch (access) {
|
|
76
|
-
case 'forbidden':
|
|
77
|
-
if (visibility === 'not_found') {
|
|
78
|
-
return 'not_found';
|
|
79
|
-
} else {
|
|
80
|
-
return 'forbidden';
|
|
81
|
-
}
|
|
82
|
-
case 'unauthorized':
|
|
83
|
-
return 'unauthorized';
|
|
84
|
-
default:
|
|
85
|
-
return 'resolved';
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
exports.getStatus = getStatus;
|
|
89
69
|
var getStatusDetails = function getStatusDetails(details) {
|
|
90
70
|
var _details$meta6, _details$meta6$reques;
|
|
91
71
|
return details === null || details === void 0 ? void 0 : (_details$meta6 = details.meta) === null || _details$meta6 === void 0 ? void 0 : (_details$meta6$reques = _details$meta6.requestAccess) === null || _details$meta6$reques === void 0 ? void 0 : _details$meta6$reques.accessType;
|
|
@@ -10,7 +10,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _reactDom = require("react-dom");
|
|
12
12
|
var _analytics = require("../../analytics");
|
|
13
|
-
var _helpers = require("../../helpers");
|
|
14
13
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
15
14
|
var _constants = require("../../actions/constants");
|
|
16
15
|
var _jsonld = require("../../../utils/jsonld");
|
|
@@ -99,7 +98,7 @@ var useResolve = function useResolve() {
|
|
|
99
98
|
var isReloading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
100
99
|
var isMetadataRequest = arguments.length > 3 ? arguments[3] : undefined;
|
|
101
100
|
var hostname = new URL(resourceUrl).hostname;
|
|
102
|
-
var nextStatus = response ? (0,
|
|
101
|
+
var nextStatus = response ? (0, _linkingCommon.getStatus)(response) : 'fatal';
|
|
103
102
|
|
|
104
103
|
// If we require authorization & do not have an authFlow available,
|
|
105
104
|
// throw an error and render as a normal blue link.
|
package/dist/cjs/version.json
CHANGED
|
@@ -49,28 +49,6 @@ export const isVisible = ({
|
|
|
49
49
|
visibility
|
|
50
50
|
}
|
|
51
51
|
}) => visibility === 'restricted' || visibility === 'public';
|
|
52
|
-
|
|
53
|
-
// Be aware, this is a copy of a function in link-provider/src/helpers
|
|
54
|
-
export const getStatus = ({
|
|
55
|
-
meta
|
|
56
|
-
}) => {
|
|
57
|
-
const {
|
|
58
|
-
access,
|
|
59
|
-
visibility
|
|
60
|
-
} = meta;
|
|
61
|
-
switch (access) {
|
|
62
|
-
case 'forbidden':
|
|
63
|
-
if (visibility === 'not_found') {
|
|
64
|
-
return 'not_found';
|
|
65
|
-
} else {
|
|
66
|
-
return 'forbidden';
|
|
67
|
-
}
|
|
68
|
-
case 'unauthorized':
|
|
69
|
-
return 'unauthorized';
|
|
70
|
-
default:
|
|
71
|
-
return 'resolved';
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
52
|
export const getStatusDetails = details => {
|
|
75
53
|
var _details$meta6, _details$meta6$reques;
|
|
76
54
|
return details === null || details === void 0 ? void 0 : (_details$meta6 = details.meta) === null || _details$meta6 === void 0 ? void 0 : (_details$meta6$reques = _details$meta6.requestAccess) === null || _details$meta6$reques === void 0 ? void 0 : _details$meta6$reques.accessType;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
3
3
|
import { addMetadataToExperience } from '../../analytics';
|
|
4
|
-
import { getStatus } from '
|
|
5
|
-
import { ACTION_ERROR, ACTION_ERROR_FALLBACK, ACTION_RELOADING, ACTION_RESOLVED, ACTION_UPDATE_METADATA_STATUS, APIError, cardAction } from '@atlaskit/linking-common';
|
|
4
|
+
import { ACTION_ERROR, ACTION_ERROR_FALLBACK, ACTION_RELOADING, ACTION_RESOLVED, ACTION_UPDATE_METADATA_STATUS, APIError, cardAction, getStatus } from '@atlaskit/linking-common';
|
|
6
5
|
import { ERROR_MESSAGE_FATAL, ERROR_MESSAGE_METADATA, ERROR_MESSAGE_OAUTH } from '../../actions/constants';
|
|
7
6
|
import { getUnauthorizedJsonLd } from '../../../utils/jsonld';
|
|
8
7
|
import { SmartLinkStatus } from '../../../constants';
|
package/dist/es2019/version.json
CHANGED
|
@@ -49,25 +49,6 @@ export var isVisible = function isVisible(_ref2) {
|
|
|
49
49
|
var visibility = _ref2.meta.visibility;
|
|
50
50
|
return visibility === 'restricted' || visibility === 'public';
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
// Be aware, this is a copy of a function in link-provider/src/helpers
|
|
54
|
-
export var getStatus = function getStatus(_ref3) {
|
|
55
|
-
var meta = _ref3.meta;
|
|
56
|
-
var access = meta.access,
|
|
57
|
-
visibility = meta.visibility;
|
|
58
|
-
switch (access) {
|
|
59
|
-
case 'forbidden':
|
|
60
|
-
if (visibility === 'not_found') {
|
|
61
|
-
return 'not_found';
|
|
62
|
-
} else {
|
|
63
|
-
return 'forbidden';
|
|
64
|
-
}
|
|
65
|
-
case 'unauthorized':
|
|
66
|
-
return 'unauthorized';
|
|
67
|
-
default:
|
|
68
|
-
return 'resolved';
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
52
|
export var getStatusDetails = function getStatusDetails(details) {
|
|
72
53
|
var _details$meta6, _details$meta6$reques;
|
|
73
54
|
return details === null || details === void 0 ? void 0 : (_details$meta6 = details.meta) === null || _details$meta6 === void 0 ? void 0 : (_details$meta6$reques = _details$meta6.requestAccess) === null || _details$meta6$reques === void 0 ? void 0 : _details$meta6$reques.accessType;
|
|
@@ -3,8 +3,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
5
5
|
import { addMetadataToExperience } from '../../analytics';
|
|
6
|
-
import { getStatus } from '
|
|
7
|
-
import { ACTION_ERROR, ACTION_ERROR_FALLBACK, ACTION_RELOADING, ACTION_RESOLVED, ACTION_UPDATE_METADATA_STATUS, APIError, cardAction } from '@atlaskit/linking-common';
|
|
6
|
+
import { ACTION_ERROR, ACTION_ERROR_FALLBACK, ACTION_RELOADING, ACTION_RESOLVED, ACTION_UPDATE_METADATA_STATUS, APIError, cardAction, getStatus } from '@atlaskit/linking-common';
|
|
8
7
|
import { ERROR_MESSAGE_FATAL, ERROR_MESSAGE_METADATA, ERROR_MESSAGE_OAUTH } from '../../actions/constants';
|
|
9
8
|
import { getUnauthorizedJsonLd } from '../../../utils/jsonld';
|
|
10
9
|
import { SmartLinkStatus } from '../../../constants';
|
package/dist/esm/version.json
CHANGED
|
@@ -12,6 +12,5 @@ export declare const getServices: (details?: JsonLd.Response) => JsonLd.Primitiv
|
|
|
12
12
|
export declare const hasResolved: (details?: JsonLd.Response) => boolean | undefined;
|
|
13
13
|
export declare const isAccessible: ({ meta: { access } }: JsonLd.Response) => boolean;
|
|
14
14
|
export declare const isVisible: ({ meta: { visibility } }: JsonLd.Response) => boolean;
|
|
15
|
-
export declare const getStatus: ({ meta }: JsonLd.Response) => CardType;
|
|
16
15
|
export declare const getStatusDetails: (details?: JsonLd.Response) => string | undefined;
|
|
17
16
|
export declare const isFinalState: (status: CardType) => boolean;
|
|
@@ -12,6 +12,5 @@ export declare const getServices: (details?: JsonLd.Response) => JsonLd.Primitiv
|
|
|
12
12
|
export declare const hasResolved: (details?: JsonLd.Response) => boolean | undefined;
|
|
13
13
|
export declare const isAccessible: ({ meta: { access } }: JsonLd.Response) => boolean;
|
|
14
14
|
export declare const isVisible: ({ meta: { visibility } }: JsonLd.Response) => boolean;
|
|
15
|
-
export declare const getStatus: ({ meta }: JsonLd.Response) => CardType;
|
|
16
15
|
export declare const getStatusDetails: (details?: JsonLd.Response) => string | undefined;
|
|
17
16
|
export declare const isFinalState: (status: CardType) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.9.
|
|
3
|
+
"version": "26.9.16",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/link-analytics": "^8.2.0",
|
|
38
38
|
"@atlaskit/link-client-extension": "^1.5.0",
|
|
39
39
|
"@atlaskit/link-extractors": "^1.1.0",
|
|
40
|
-
"@atlaskit/linking-common": "^4.
|
|
40
|
+
"@atlaskit/linking-common": "^4.1.0",
|
|
41
41
|
"@atlaskit/linking-types": "^8.2.0",
|
|
42
42
|
"@atlaskit/logo": "^13.14.0",
|
|
43
43
|
"@atlaskit/lozenge": "^11.4.0",
|