@atlaskit/smart-card 20.0.1 → 20.0.4
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 +20 -0
- package/dist/cjs/extractors/block/index.js +2 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/components/Provider.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +9 -2
- package/dist/cjs/view/HoverCard/index.js +12 -3
- package/dist/es2019/extractors/block/index.js +2 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/components/Provider.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +6 -2
- package/dist/es2019/view/HoverCard/index.js +7 -2
- package/dist/esm/extractors/block/index.js +2 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/components/Provider.js +3 -2
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +8 -2
- package/dist/esm/view/HoverCard/index.js +9 -2
- package/dist/types/view/HoverCard/index.d.ts +1 -0
- package/package.json +3 -3
- package/report.api.md +864 -159
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 20.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2a5cc0d4297`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2a5cc0d4297) - Block: Update pull request link avatar to author (attributedTo)
|
|
8
|
+
|
|
9
|
+
## 20.0.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4c2c26ca270`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c2c26ca270) - Fix regression in logos in BlockCard footers in preview mode cuased by the `appearance` prop.
|
|
14
|
+
- [`d4133fe0edc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d4133fe0edc) - Fix regression in logos in BlockCard footers caused by inheriting ProseMirror styles after a change in @atlaskit/logo internals.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
17
|
+
## 20.0.2
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`12950ccea1b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12950ccea1b) - Hover Preview: Stop hover preview from propagating click event to parent element
|
|
22
|
+
|
|
3
23
|
## 20.0.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -84,6 +84,8 @@ var extractBlockUsers = function extractBlockUsers(jsonLd) {
|
|
|
84
84
|
if (assignedMembers) {
|
|
85
85
|
return [assignedMembers];
|
|
86
86
|
}
|
|
87
|
+
} else if (jsonLd['@type'] === 'atlassian:SourceCodePullRequest') {
|
|
88
|
+
return (0, _extractors.extractPersonCreatedBy)(jsonLd);
|
|
87
89
|
} else {
|
|
88
90
|
var updatedBy = (0, _extractors.extractPersonUpdatedBy)(jsonLd);
|
|
89
91
|
var updatedByMembers;
|
package/dist/cjs/version.json
CHANGED
|
@@ -33,11 +33,12 @@ var Provider = function Provider(_ref) {
|
|
|
33
33
|
return (0, _core.jsx)("div", {
|
|
34
34
|
css: {
|
|
35
35
|
display: 'flex',
|
|
36
|
-
alignItems: 'center'
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
fontSize: (0, _utils.gs)(1.5),
|
|
38
|
+
whiteSpace: 'normal'
|
|
37
39
|
}
|
|
38
40
|
}, iconToRender, (0, _core.jsx)("span", {
|
|
39
41
|
css: {
|
|
40
|
-
fontSize: (0, _utils.gs)(1.5),
|
|
41
42
|
color: (0, _tokens.token)('color.text.subtlest', _colors.N300),
|
|
42
43
|
margin: 0,
|
|
43
44
|
marginLeft: (0, _utils.gs)(0.5),
|
|
@@ -13,6 +13,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
15
|
|
|
16
|
+
var _react = require("react");
|
|
17
|
+
|
|
16
18
|
var _reactIntlNext = require("react-intl-next");
|
|
17
19
|
|
|
18
20
|
var _core = require("@emotion/core");
|
|
@@ -62,10 +64,15 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
62
64
|
testId = _ref.testId;
|
|
63
65
|
var isMoreThenTwoItems = items.length > visibleButtonsNum;
|
|
64
66
|
var firstActions = isMoreThenTwoItems ? items.slice(0, visibleButtonsNum - 1) : items;
|
|
65
|
-
var restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : [];
|
|
67
|
+
var restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : []; // Stop AK dropdown menu to propagate event on click.
|
|
68
|
+
|
|
69
|
+
var onClick = (0, _react.useCallback)(function (e) {
|
|
70
|
+
return e.stopPropagation();
|
|
71
|
+
}, []);
|
|
66
72
|
return (0, _core.jsx)("div", {
|
|
67
73
|
css: styles,
|
|
68
|
-
className: "actions-button-group"
|
|
74
|
+
className: "actions-button-group",
|
|
75
|
+
onClick: onClick
|
|
69
76
|
}, (0, _core.jsx)(_buttonGroup.default, null, (0, _utils.renderActionItems)(firstActions, size, appearance), restActions.length > 0 ? (0, _core.jsx)(_dropdownMenu.default, {
|
|
70
77
|
onOpenChange: function onOpenChange(_ref2) {
|
|
71
78
|
var isOpen = _ref2.isOpen;
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.HoverCardComponent = exports.HoverCard = void 0;
|
|
10
|
+
exports.hoverCardClassName = exports.HoverCardComponent = exports.HoverCard = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -42,6 +42,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
42
42
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
43
|
|
|
44
44
|
/** @jsx jsx */
|
|
45
|
+
var hoverCardClassName = 'smart-links-hover-preview';
|
|
46
|
+
exports.hoverCardClassName = hoverCardClassName;
|
|
47
|
+
|
|
45
48
|
var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
46
49
|
var children = _ref.children,
|
|
47
50
|
id = _ref.id,
|
|
@@ -105,7 +108,11 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
105
108
|
if (actionId === 'preview-content') {
|
|
106
109
|
hideCard();
|
|
107
110
|
}
|
|
108
|
-
}, [hideCard]);
|
|
111
|
+
}, [hideCard]); // Stop hover preview content to propagate event to parent.
|
|
112
|
+
|
|
113
|
+
var onClick = (0, _react.useCallback)(function (e) {
|
|
114
|
+
return e.stopPropagation();
|
|
115
|
+
}, []);
|
|
109
116
|
return (0, _core.jsx)(_popup.default, {
|
|
110
117
|
testId: "hover-card",
|
|
111
118
|
isOpen: isOpen,
|
|
@@ -116,7 +123,9 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
116
123
|
return (0, _core.jsx)("div", {
|
|
117
124
|
onMouseEnter: initShowCard,
|
|
118
125
|
onMouseLeave: initHideCard,
|
|
119
|
-
|
|
126
|
+
className: hoverCardClassName,
|
|
127
|
+
css: _styled.HoverCardContainer,
|
|
128
|
+
onClick: onClick
|
|
120
129
|
}, (0, _core.jsx)(_hoverCardContent.default, {
|
|
121
130
|
analytics: analytics,
|
|
122
131
|
cardActions: linkActions,
|
|
@@ -55,6 +55,8 @@ export const extractBlockUsers = jsonLd => {
|
|
|
55
55
|
if (assignedMembers) {
|
|
56
56
|
return [assignedMembers];
|
|
57
57
|
}
|
|
58
|
+
} else if (jsonLd['@type'] === 'atlassian:SourceCodePullRequest') {
|
|
59
|
+
return extractPersonCreatedBy(jsonLd);
|
|
58
60
|
} else {
|
|
59
61
|
const updatedBy = extractPersonUpdatedBy(jsonLd);
|
|
60
62
|
let updatedByMembers;
|
package/dist/es2019/version.json
CHANGED
|
@@ -23,11 +23,12 @@ export const Provider = ({
|
|
|
23
23
|
return jsx("div", {
|
|
24
24
|
css: {
|
|
25
25
|
display: 'flex',
|
|
26
|
-
alignItems: 'center'
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
fontSize: gs(1.5),
|
|
28
|
+
whiteSpace: 'normal'
|
|
27
29
|
}
|
|
28
30
|
}, iconToRender, jsx("span", {
|
|
29
31
|
css: {
|
|
30
|
-
fontSize: gs(1.5),
|
|
31
32
|
color: token('color.text.subtlest', N300),
|
|
32
33
|
margin: 0,
|
|
33
34
|
marginLeft: gs(0.5),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
import { useCallback } from 'react';
|
|
4
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
6
|
import { css, jsx } from '@emotion/core';
|
|
6
7
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
@@ -47,10 +48,13 @@ const ActionGroup = ({
|
|
|
47
48
|
}) => {
|
|
48
49
|
const isMoreThenTwoItems = items.length > visibleButtonsNum;
|
|
49
50
|
const firstActions = isMoreThenTwoItems ? items.slice(0, visibleButtonsNum - 1) : items;
|
|
50
|
-
const restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : [];
|
|
51
|
+
const restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : []; // Stop AK dropdown menu to propagate event on click.
|
|
52
|
+
|
|
53
|
+
const onClick = useCallback(e => e.stopPropagation(), []);
|
|
51
54
|
return jsx("div", {
|
|
52
55
|
css: styles,
|
|
53
|
-
className: "actions-button-group"
|
|
56
|
+
className: "actions-button-group",
|
|
57
|
+
onClick: onClick
|
|
54
58
|
}, jsx(ButtonGroup, null, renderActionItems(firstActions, size, appearance), restActions.length > 0 ? jsx(DropdownMenu, {
|
|
55
59
|
onOpenChange: ({
|
|
56
60
|
isOpen
|
|
@@ -13,6 +13,7 @@ import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
|
13
13
|
import { useSmartLinkRenderers } from '../../state/renderers';
|
|
14
14
|
import HoverCardContent from './components/hover-card-content';
|
|
15
15
|
import { HOVER_CARD_ANALYTICS_DISPLAY } from './utils';
|
|
16
|
+
export const hoverCardClassName = 'smart-links-hover-preview';
|
|
16
17
|
export const HoverCardComponent = ({
|
|
17
18
|
children,
|
|
18
19
|
id,
|
|
@@ -70,7 +71,9 @@ export const HoverCardComponent = ({
|
|
|
70
71
|
if (actionId === 'preview-content') {
|
|
71
72
|
hideCard();
|
|
72
73
|
}
|
|
73
|
-
}, [hideCard]);
|
|
74
|
+
}, [hideCard]); // Stop hover preview content to propagate event to parent.
|
|
75
|
+
|
|
76
|
+
const onClick = useCallback(e => e.stopPropagation(), []);
|
|
74
77
|
return jsx(Popup, {
|
|
75
78
|
testId: "hover-card",
|
|
76
79
|
isOpen: isOpen,
|
|
@@ -81,7 +84,9 @@ export const HoverCardComponent = ({
|
|
|
81
84
|
}) => jsx("div", {
|
|
82
85
|
onMouseEnter: initShowCard,
|
|
83
86
|
onMouseLeave: initHideCard,
|
|
84
|
-
|
|
87
|
+
className: hoverCardClassName,
|
|
88
|
+
css: HoverCardContainer,
|
|
89
|
+
onClick: onClick
|
|
85
90
|
}, jsx(HoverCardContent, {
|
|
86
91
|
analytics: analytics,
|
|
87
92
|
cardActions: linkActions,
|
|
@@ -63,6 +63,8 @@ export var extractBlockUsers = function extractBlockUsers(jsonLd) {
|
|
|
63
63
|
if (assignedMembers) {
|
|
64
64
|
return [assignedMembers];
|
|
65
65
|
}
|
|
66
|
+
} else if (jsonLd['@type'] === 'atlassian:SourceCodePullRequest') {
|
|
67
|
+
return extractPersonCreatedBy(jsonLd);
|
|
66
68
|
} else {
|
|
67
69
|
var updatedBy = extractPersonUpdatedBy(jsonLd);
|
|
68
70
|
var updatedByMembers;
|
package/dist/esm/version.json
CHANGED
|
@@ -22,11 +22,12 @@ export var Provider = function Provider(_ref) {
|
|
|
22
22
|
return jsx("div", {
|
|
23
23
|
css: {
|
|
24
24
|
display: 'flex',
|
|
25
|
-
alignItems: 'center'
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
fontSize: gs(1.5),
|
|
27
|
+
whiteSpace: 'normal'
|
|
26
28
|
}
|
|
27
29
|
}, iconToRender, jsx("span", {
|
|
28
30
|
css: {
|
|
29
|
-
fontSize: gs(1.5),
|
|
30
31
|
color: token('color.text.subtlest', N300),
|
|
31
32
|
margin: 0,
|
|
32
33
|
marginLeft: gs(0.5),
|
|
@@ -6,6 +6,7 @@ var _excluded = ["triggerRef"];
|
|
|
6
6
|
var _templateObject;
|
|
7
7
|
|
|
8
8
|
/** @jsx jsx */
|
|
9
|
+
import { useCallback } from 'react';
|
|
9
10
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
11
|
import { css, jsx } from '@emotion/core';
|
|
11
12
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
@@ -39,10 +40,15 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
39
40
|
testId = _ref.testId;
|
|
40
41
|
var isMoreThenTwoItems = items.length > visibleButtonsNum;
|
|
41
42
|
var firstActions = isMoreThenTwoItems ? items.slice(0, visibleButtonsNum - 1) : items;
|
|
42
|
-
var restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : [];
|
|
43
|
+
var restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : []; // Stop AK dropdown menu to propagate event on click.
|
|
44
|
+
|
|
45
|
+
var onClick = useCallback(function (e) {
|
|
46
|
+
return e.stopPropagation();
|
|
47
|
+
}, []);
|
|
43
48
|
return jsx("div", {
|
|
44
49
|
css: styles,
|
|
45
|
-
className: "actions-button-group"
|
|
50
|
+
className: "actions-button-group",
|
|
51
|
+
onClick: onClick
|
|
46
52
|
}, jsx(ButtonGroup, null, renderActionItems(firstActions, size, appearance), restActions.length > 0 ? jsx(DropdownMenu, {
|
|
47
53
|
onOpenChange: function onOpenChange(_ref2) {
|
|
48
54
|
var isOpen = _ref2.isOpen;
|
|
@@ -14,6 +14,7 @@ import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
|
14
14
|
import { useSmartLinkRenderers } from '../../state/renderers';
|
|
15
15
|
import HoverCardContent from './components/hover-card-content';
|
|
16
16
|
import { HOVER_CARD_ANALYTICS_DISPLAY } from './utils';
|
|
17
|
+
export var hoverCardClassName = 'smart-links-hover-preview';
|
|
17
18
|
export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
18
19
|
var children = _ref.children,
|
|
19
20
|
id = _ref.id,
|
|
@@ -77,7 +78,11 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
77
78
|
if (actionId === 'preview-content') {
|
|
78
79
|
hideCard();
|
|
79
80
|
}
|
|
80
|
-
}, [hideCard]);
|
|
81
|
+
}, [hideCard]); // Stop hover preview content to propagate event to parent.
|
|
82
|
+
|
|
83
|
+
var onClick = useCallback(function (e) {
|
|
84
|
+
return e.stopPropagation();
|
|
85
|
+
}, []);
|
|
81
86
|
return jsx(Popup, {
|
|
82
87
|
testId: "hover-card",
|
|
83
88
|
isOpen: isOpen,
|
|
@@ -88,7 +93,9 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
88
93
|
return jsx("div", {
|
|
89
94
|
onMouseEnter: initShowCard,
|
|
90
95
|
onMouseLeave: initHideCard,
|
|
91
|
-
|
|
96
|
+
className: hoverCardClassName,
|
|
97
|
+
css: HoverCardContainer,
|
|
98
|
+
onClick: onClick
|
|
92
99
|
}, jsx(HoverCardContent, {
|
|
93
100
|
analytics: analytics,
|
|
94
101
|
cardActions: linkActions,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { HoverCardProps } from './types';
|
|
3
|
+
export declare const hoverCardClassName = "smart-links-hover-preview";
|
|
3
4
|
export declare const HoverCardComponent: FC<HoverCardProps>;
|
|
4
5
|
export declare const HoverCard: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<HoverCardProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "id" | "analyticsContext" | "key" | "url"> & React.RefAttributes<any>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.4",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
35
35
|
"@atlaskit/in-product-testing": "^0.1.0",
|
|
36
36
|
"@atlaskit/linking-common": "^1.2.0",
|
|
37
|
-
"@atlaskit/logo": "^13.
|
|
37
|
+
"@atlaskit/logo": "^13.8.0",
|
|
38
38
|
"@atlaskit/lozenge": "^11.1.0",
|
|
39
39
|
"@atlaskit/media-common": "^2.15.0",
|
|
40
40
|
"@atlaskit/modal-dialog": "^12.2.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"uuid": "^3.1.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@atlaskit/link-provider": "^1.1.
|
|
61
|
+
"@atlaskit/link-provider": "^1.1.2",
|
|
62
62
|
"react": "^16.8.0",
|
|
63
63
|
"react-dom": "^16.8.0",
|
|
64
64
|
"react-intl-next": "npm:react-intl@^5.18.1"
|