@atlaskit/smart-card 19.1.5 → 19.1.6
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/actions/index.js +3 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/state/actions/index.js +3 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/state/actions/index.js +4 -4
- package/dist/esm/state/hooks/usePrefetch.js +1 -1
- package/dist/esm/utils/mocks.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/DownloadAction.js +1 -1
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +1 -1
- package/dist/esm/view/BlockCard/actions/RetryAction.js +1 -1
- package/dist/esm/view/BlockCard/actions/ViewAction.js +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +1 -0
- package/package.json +3 -2
- package/docs-helpers/flexible-ui-action-item.tsx +0 -6
- package/docs-helpers/flexible-ui-actions-prop.tsx +0 -6
- package/docs-helpers/flexible-ui-element-item.tsx +0 -6
- package/docs-helpers/flexible-ui-prop.tsx +0 -6
- package/docs-helpers/flexible-ui.tsx +0 -28
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 19.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`28410ec919d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/28410ec919d) - Flexible UI: Passing JsonLD response on authFlow disabled
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 19.1.5
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -53,7 +53,7 @@ var useSmartCardActions = function useSmartCardActions(id, url, analytics) {
|
|
|
53
53
|
|
|
54
54
|
var hasAuthFlowSupported = config.authFlow !== 'disabled';
|
|
55
55
|
var hasData = !!(details && details.data);
|
|
56
|
-
var handleResolvedLinkError = (0, _react.useCallback)(function (url, error) {
|
|
56
|
+
var handleResolvedLinkError = (0, _react.useCallback)(function (url, error, response) {
|
|
57
57
|
if (error.kind === 'fatal') {
|
|
58
58
|
// If there's no previous data in the store for this URL, then bail
|
|
59
59
|
// out and let the editor handle fallbacks (returns to a blue link).
|
|
@@ -82,7 +82,7 @@ var useSmartCardActions = function useSmartCardActions(id, url, analytics) {
|
|
|
82
82
|
// Fallback to blue link with smart link formatting. Not part of reliability.
|
|
83
83
|
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_ERROR_FALLBACK, {
|
|
84
84
|
url: url
|
|
85
|
-
},
|
|
85
|
+
}, response, error));
|
|
86
86
|
} else {
|
|
87
87
|
// Fallback to blue link with smart link formatting. Part of reliability.
|
|
88
88
|
dispatch((0, _linkingCommon.cardAction)(_linkingCommon.ACTION_ERROR, {
|
|
@@ -97,7 +97,7 @@ var useSmartCardActions = function useSmartCardActions(id, url, analytics) {
|
|
|
97
97
|
// throw an error and render as a normal blue link.
|
|
98
98
|
|
|
99
99
|
if ((nextStatus === 'unauthorized' || nextStatus === 'forbidden') && !hasAuthFlowSupported) {
|
|
100
|
-
handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('fallback', hostname, _constants.ERROR_MESSAGE_OAUTH));
|
|
100
|
+
handleResolvedLinkError(resourceUrl, new _linkingCommon.APIError('fallback', hostname, _constants.ERROR_MESSAGE_OAUTH), response);
|
|
101
101
|
return;
|
|
102
102
|
} // Handle any other errors
|
|
103
103
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -27,7 +27,7 @@ export const useSmartCardActions = (id, url, analytics) => {
|
|
|
27
27
|
};
|
|
28
28
|
const hasAuthFlowSupported = config.authFlow !== 'disabled';
|
|
29
29
|
const hasData = !!(details && details.data);
|
|
30
|
-
const handleResolvedLinkError = useCallback((url, error) => {
|
|
30
|
+
const handleResolvedLinkError = useCallback((url, error, response) => {
|
|
31
31
|
if (error.kind === 'fatal') {
|
|
32
32
|
// If there's no previous data in the store for this URL, then bail
|
|
33
33
|
// out and let the editor handle fallbacks (returns to a blue link).
|
|
@@ -56,7 +56,7 @@ export const useSmartCardActions = (id, url, analytics) => {
|
|
|
56
56
|
// Fallback to blue link with smart link formatting. Not part of reliability.
|
|
57
57
|
dispatch(cardAction(ACTION_ERROR_FALLBACK, {
|
|
58
58
|
url
|
|
59
|
-
},
|
|
59
|
+
}, response, error));
|
|
60
60
|
} else {
|
|
61
61
|
// Fallback to blue link with smart link formatting. Part of reliability.
|
|
62
62
|
dispatch(cardAction(ACTION_ERROR, {
|
|
@@ -71,7 +71,7 @@ export const useSmartCardActions = (id, url, analytics) => {
|
|
|
71
71
|
// throw an error and render as a normal blue link.
|
|
72
72
|
|
|
73
73
|
if ((nextStatus === 'unauthorized' || nextStatus === 'forbidden') && !hasAuthFlowSupported) {
|
|
74
|
-
handleResolvedLinkError(resourceUrl, new APIError('fallback', hostname, ERROR_MESSAGE_OAUTH));
|
|
74
|
+
handleResolvedLinkError(resourceUrl, new APIError('fallback', hostname, ERROR_MESSAGE_OAUTH), response);
|
|
75
75
|
return;
|
|
76
76
|
} // Handle any other errors
|
|
77
77
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { useMemo, useCallback } from 'react';
|
|
4
4
|
import { auth } from '@atlaskit/outbound-auth-flow-client';
|
|
5
5
|
import { APIError } from '@atlaskit/linking-common';
|
|
@@ -28,7 +28,7 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
|
|
|
28
28
|
|
|
29
29
|
var hasAuthFlowSupported = config.authFlow !== 'disabled';
|
|
30
30
|
var hasData = !!(details && details.data);
|
|
31
|
-
var handleResolvedLinkError = useCallback(function (url, error) {
|
|
31
|
+
var handleResolvedLinkError = useCallback(function (url, error, response) {
|
|
32
32
|
if (error.kind === 'fatal') {
|
|
33
33
|
// If there's no previous data in the store for this URL, then bail
|
|
34
34
|
// out and let the editor handle fallbacks (returns to a blue link).
|
|
@@ -57,7 +57,7 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
|
|
|
57
57
|
// Fallback to blue link with smart link formatting. Not part of reliability.
|
|
58
58
|
dispatch(cardAction(ACTION_ERROR_FALLBACK, {
|
|
59
59
|
url: url
|
|
60
|
-
},
|
|
60
|
+
}, response, error));
|
|
61
61
|
} else {
|
|
62
62
|
// Fallback to blue link with smart link formatting. Part of reliability.
|
|
63
63
|
dispatch(cardAction(ACTION_ERROR, {
|
|
@@ -72,7 +72,7 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
|
|
|
72
72
|
// throw an error and render as a normal blue link.
|
|
73
73
|
|
|
74
74
|
if ((nextStatus === 'unauthorized' || nextStatus === 'forbidden') && !hasAuthFlowSupported) {
|
|
75
|
-
handleResolvedLinkError(resourceUrl, new APIError('fallback', hostname, ERROR_MESSAGE_OAUTH));
|
|
75
|
+
handleResolvedLinkError(resourceUrl, new APIError('fallback', hostname, ERROR_MESSAGE_OAUTH), response);
|
|
76
76
|
return;
|
|
77
77
|
} // Handle any other errors
|
|
78
78
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
5
5
|
export function usePrefetch(url) {
|
package/dist/esm/utils/mocks.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
5
|
import { downloadUrl } from '@atlaskit/media-common';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
6
5
|
var _excluded = ["popupMountPointId", "onClose"],
|
|
7
6
|
_excluded2 = ["details"];
|
|
7
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
|
|
9
9
|
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; }
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
5
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
5
|
import { messages } from '@atlaskit/media-ui/messages';
|
|
@@ -41,6 +41,7 @@ export declare type ElementItem = {
|
|
|
41
41
|
name: ElementName.AuthorGroup | ElementName.CollaboratorGroup | ElementName.CommentCount | ElementName.CreatedBy | ElementName.CreatedOn | ElementName.ModifiedBy | ElementName.ModifiedOn | ElementName.Priority | ElementName.ProgrammingLanguage | ElementName.Provider | ElementName.ReactCount | ElementName.State | ElementName.SubscriberCount | ElementName.ViewCount | ElementName.VoteCount;
|
|
42
42
|
/**
|
|
43
43
|
* The size of the element to render.
|
|
44
|
+
* The elements that support sizing are AuthorGroup and CollaboratorGroup.
|
|
44
45
|
*/
|
|
45
46
|
size?: SmartLinkSize;
|
|
46
47
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.6",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"uuid": "^3.1.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@atlaskit/link-provider": "^1.0.
|
|
62
|
+
"@atlaskit/link-provider": "^1.0.1",
|
|
63
63
|
"react": "^16.8.0",
|
|
64
64
|
"react-dom": "^16.8.0",
|
|
65
65
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"@atlaskit/section-message": "^6.1.5",
|
|
82
82
|
"@atlaskit/select": "^15.2.0",
|
|
83
83
|
"@atlaskit/table-tree": "^9.1.0",
|
|
84
|
+
"@atlaskit/tabs": "^13.2.10",
|
|
84
85
|
"@atlaskit/textarea": "^4.3.0",
|
|
85
86
|
"@atlaskit/textfield": "^5.1.0",
|
|
86
87
|
"@atlaskit/visual-regression": "*",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { css, jsx } from '@emotion/core';
|
|
3
|
-
import { Prop, Props } from '@atlaskit/docs';
|
|
4
|
-
|
|
5
|
-
const actionsStyles = css`
|
|
6
|
-
> div,
|
|
7
|
-
> div > div {
|
|
8
|
-
margin-top: 0;
|
|
9
|
-
}
|
|
10
|
-
h3 {
|
|
11
|
-
display: none;
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
const actionsProps = (
|
|
16
|
-
<Props
|
|
17
|
-
heading=""
|
|
18
|
-
props={require('!!extract-react-types-loader!../docs-helpers/flexible-ui-actions-prop')}
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
export const overrideActionsProps = (props: Object) => (
|
|
23
|
-
<Prop
|
|
24
|
-
{...props}
|
|
25
|
-
shapeComponent={() => <div css={actionsStyles}>{actionsProps}</div>}
|
|
26
|
-
type="arrayType"
|
|
27
|
-
/>
|
|
28
|
-
);
|