@atlaskit/smart-card 26.9.14 → 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 CHANGED
@@ -1,5 +1,18 @@
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
+
10
+ ## 26.9.15
11
+
12
+ ### Patch Changes
13
+
14
+ - [`b9355830504`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9355830504) - Opt out of peer dependency enforcement
15
+
3
16
  ## 26.9.14
4
17
 
5
18
  ### 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.getStatus = exports.getServices = exports.getResourceType = exports.getProduct = exports.getExtensionKey = exports.getDefinitionId = exports.getClickUrl = exports.getByDefinitionId = void 0;
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, _helpers.getStatus)(response) : 'fatal';
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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.9.14",
3
+ "version": "26.9.16",
4
4
  "sideEffects": false
5
5
  }
@@ -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 '../../helpers';
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';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.9.14",
3
+ "version": "26.9.16",
4
4
  "sideEffects": false
5
5
  }
@@ -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 '../../helpers';
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';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.9.14",
3
+ "version": "26.9.16",
4
4
  "sideEffects": false
5
5
  }
@@ -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.14",
3
+ "version": "26.9.16",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,7 +28,6 @@
28
28
  "@atlaskit/avatar-group": "^9.3.0",
29
29
  "@atlaskit/button": "^16.8.0",
30
30
  "@atlaskit/dropdown-menu": "^11.10.0",
31
- "@atlaskit/enforce-peer-dependencies": "^1.0.1",
32
31
  "@atlaskit/frontend-utilities": "^2.7.0",
33
32
  "@atlaskit/icon": "^21.12.0",
34
33
  "@atlaskit/icon-file-type": "^6.4.0",
@@ -38,7 +37,7 @@
38
37
  "@atlaskit/link-analytics": "^8.2.0",
39
38
  "@atlaskit/link-client-extension": "^1.5.0",
40
39
  "@atlaskit/link-extractors": "^1.1.0",
41
- "@atlaskit/linking-common": "^4.0.0",
40
+ "@atlaskit/linking-common": "^4.1.0",
42
41
  "@atlaskit/linking-types": "^8.2.0",
43
42
  "@atlaskit/logo": "^13.14.0",
44
43
  "@atlaskit/lozenge": "^11.4.0",
@@ -145,8 +144,5 @@
145
144
  "type": "boolean"
146
145
  }
147
146
  },
148
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
149
- "scripts": {
150
- "postinstall": "npx enforce-peer-dependencies --internal-packages"
151
- }
147
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
152
148
  }