@atlaskit/smart-card 42.3.1 → 42.3.3
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 +13 -0
- package/dist/cjs/view/CardWithUrl/component.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +15 -11
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +6 -2
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +4 -2
- package/dist/es2019/view/CardWithUrl/component.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +15 -11
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +6 -2
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +4 -2
- package/dist/esm/view/CardWithUrl/component.js +2 -2
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.js +15 -11
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-trigger/index.js +6 -2
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +4 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 42.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 42.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`17a96e7d76434`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/17a96e7d76434) -
|
|
14
|
+
Internal change to unreleased feature behind `placeholderData` prop.
|
|
15
|
+
|
|
3
16
|
## 42.3.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -71,7 +71,7 @@ function Component(_ref) {
|
|
|
71
71
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
72
72
|
(0, _react.useMemo)(function () {
|
|
73
73
|
// execute some basic validation logic to ensure we should consider using placeholder data
|
|
74
|
-
if (appearance === 'inline' &&
|
|
74
|
+
if (appearance === 'inline' && isValidPlaceholderData(placeholderData)) {
|
|
75
75
|
var data = {
|
|
76
76
|
status: 'resolved',
|
|
77
77
|
metadataStatus: undefined,
|
|
@@ -79,7 +79,7 @@ function Component(_ref) {
|
|
|
79
79
|
};
|
|
80
80
|
return data;
|
|
81
81
|
}
|
|
82
|
-
}, [appearance,
|
|
82
|
+
}, [appearance, placeholderData]) : undefined;
|
|
83
83
|
|
|
84
84
|
// Get state, actions for this card.
|
|
85
85
|
var _useSmartLink = (0, _state.useSmartLink)(id, url, (0, _platformFeatureFlags.fg)('platform_initial_data_for_smart_cards') ? structuredPlaceholderData : undefined),
|
|
@@ -70,6 +70,7 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
70
70
|
url: url,
|
|
71
71
|
hoverPreviewOptions: hoverPreviewOptions
|
|
72
72
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
73
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
73
74
|
onMouseLeave: onMouseLeave,
|
|
74
75
|
onMouseMove: onMouseMove,
|
|
75
76
|
"data-testid": "".concat(testId, "-hover-card-wrapper"),
|
|
@@ -30,16 +30,20 @@ var LozengeActionItem = function LozengeActionItem(_ref) {
|
|
|
30
30
|
var _e$currentTarget;
|
|
31
31
|
(_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 || (_e$currentTarget = _e$currentTarget.firstElementChild) === null || _e$currentTarget === void 0 || _e$currentTarget.focus();
|
|
32
32
|
}, []);
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
return (
|
|
34
|
+
/*#__PURE__*/
|
|
35
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
36
|
+
_react.default.createElement("span", {
|
|
37
|
+
onMouseEnter: handleMouseEnter,
|
|
38
|
+
role: "presentation"
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
|
|
40
|
+
onClick: handleClick,
|
|
41
|
+
testId: testId
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, (0, _extends2.default)({
|
|
43
|
+
appearance: appearance
|
|
44
|
+
}, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? {
|
|
45
|
+
isBold: true
|
|
46
|
+
} : undefined), text)))
|
|
47
|
+
);
|
|
44
48
|
};
|
|
45
49
|
var _default = exports.default = LozengeActionItem;
|
|
@@ -112,8 +112,12 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
112
112
|
type: "button"
|
|
113
113
|
}, props, {
|
|
114
114
|
"data-action-open": isOpen,
|
|
115
|
-
"data-testid": "".concat(testId, "--trigger")
|
|
116
|
-
|
|
115
|
+
"data-testid": "".concat(testId, "--trigger")
|
|
116
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
117
|
+
,
|
|
118
|
+
onMouseEnter: onMouseEnter
|
|
119
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
120
|
+
,
|
|
117
121
|
onMouseLeave: onMouseLeave,
|
|
118
122
|
onMouseDown: onMouseOrKeyDown,
|
|
119
123
|
onMouseUp: onMouseOrKeyUp,
|
|
@@ -230,8 +230,10 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
230
230
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
231
231
|
ref: parentSpan
|
|
232
232
|
}, /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, triggerProps, {
|
|
233
|
-
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
234
|
-
onMouseOver: initShowCard
|
|
233
|
+
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events, @atlassian/a11y/mouse-events-have-key-events
|
|
234
|
+
onMouseOver: initShowCard
|
|
235
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
236
|
+
,
|
|
235
237
|
onMouseLeave: initHideCard,
|
|
236
238
|
onMouseMove: setMousePosition,
|
|
237
239
|
onClick: onChildClick,
|
|
@@ -61,7 +61,7 @@ function Component({
|
|
|
61
61
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
62
62
|
useMemo(() => {
|
|
63
63
|
// execute some basic validation logic to ensure we should consider using placeholder data
|
|
64
|
-
if (appearance === 'inline' &&
|
|
64
|
+
if (appearance === 'inline' && isValidPlaceholderData(placeholderData)) {
|
|
65
65
|
const data = {
|
|
66
66
|
status: 'resolved',
|
|
67
67
|
metadataStatus: undefined,
|
|
@@ -69,7 +69,7 @@ function Component({
|
|
|
69
69
|
};
|
|
70
70
|
return data;
|
|
71
71
|
}
|
|
72
|
-
}, [appearance,
|
|
72
|
+
}, [appearance, placeholderData]) : undefined;
|
|
73
73
|
|
|
74
74
|
// Get state, actions for this card.
|
|
75
75
|
const {
|
|
@@ -57,6 +57,7 @@ const HoverCardControl = ({
|
|
|
57
57
|
url: url,
|
|
58
58
|
hoverPreviewOptions: hoverPreviewOptions
|
|
59
59
|
}, /*#__PURE__*/React.createElement("span", {
|
|
60
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
60
61
|
onMouseLeave: onMouseLeave,
|
|
61
62
|
onMouseMove: onMouseMove,
|
|
62
63
|
"data-testid": `${testId}-hover-card-wrapper`,
|
|
@@ -22,16 +22,20 @@ const LozengeActionItem = ({
|
|
|
22
22
|
var _e$currentTarget, _e$currentTarget$firs;
|
|
23
23
|
(_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 ? void 0 : (_e$currentTarget$firs = _e$currentTarget.firstElementChild) === null || _e$currentTarget$firs === void 0 ? void 0 : _e$currentTarget$firs.focus();
|
|
24
24
|
}, []);
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
28
|
+
React.createElement("span", {
|
|
29
|
+
onMouseEnter: handleMouseEnter,
|
|
30
|
+
role: "presentation"
|
|
31
|
+
}, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
32
|
+
onClick: handleClick,
|
|
33
|
+
testId: testId
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Lozenge, _extends({
|
|
35
|
+
appearance: appearance
|
|
36
|
+
}, fg('platform-component-visual-refresh') ? {
|
|
37
|
+
isBold: true
|
|
38
|
+
} : undefined), text)))
|
|
39
|
+
);
|
|
36
40
|
};
|
|
37
41
|
export default LozengeActionItem;
|
|
@@ -82,8 +82,12 @@ const LozengeActionTrigger = ({
|
|
|
82
82
|
type: "button"
|
|
83
83
|
}, props, {
|
|
84
84
|
"data-action-open": isOpen,
|
|
85
|
-
"data-testid": `${testId}--trigger
|
|
86
|
-
|
|
85
|
+
"data-testid": `${testId}--trigger`
|
|
86
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
87
|
+
,
|
|
88
|
+
onMouseEnter: onMouseEnter
|
|
89
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
90
|
+
,
|
|
87
91
|
onMouseLeave: onMouseLeave,
|
|
88
92
|
onMouseDown: onMouseOrKeyDown,
|
|
89
93
|
onMouseUp: onMouseOrKeyUp,
|
|
@@ -207,8 +207,10 @@ export const HoverCardComponent = ({
|
|
|
207
207
|
}) => /*#__PURE__*/React.createElement("span", {
|
|
208
208
|
ref: parentSpan
|
|
209
209
|
}, /*#__PURE__*/React.createElement("span", _extends({}, triggerProps, {
|
|
210
|
-
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
211
|
-
onMouseOver: initShowCard
|
|
210
|
+
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events, @atlassian/a11y/mouse-events-have-key-events
|
|
211
|
+
onMouseOver: initShowCard
|
|
212
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
213
|
+
,
|
|
212
214
|
onMouseLeave: initHideCard,
|
|
213
215
|
onMouseMove: setMousePosition,
|
|
214
216
|
onClick: onChildClick,
|
|
@@ -62,7 +62,7 @@ function Component(_ref) {
|
|
|
62
62
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
63
63
|
useMemo(function () {
|
|
64
64
|
// execute some basic validation logic to ensure we should consider using placeholder data
|
|
65
|
-
if (appearance === 'inline' &&
|
|
65
|
+
if (appearance === 'inline' && isValidPlaceholderData(placeholderData)) {
|
|
66
66
|
var data = {
|
|
67
67
|
status: 'resolved',
|
|
68
68
|
metadataStatus: undefined,
|
|
@@ -70,7 +70,7 @@ function Component(_ref) {
|
|
|
70
70
|
};
|
|
71
71
|
return data;
|
|
72
72
|
}
|
|
73
|
-
}, [appearance,
|
|
73
|
+
}, [appearance, placeholderData]) : undefined;
|
|
74
74
|
|
|
75
75
|
// Get state, actions for this card.
|
|
76
76
|
var _useSmartLink = useSmartLink(id, url, fg('platform_initial_data_for_smart_cards') ? structuredPlaceholderData : undefined),
|
|
@@ -61,6 +61,7 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
61
61
|
url: url,
|
|
62
62
|
hoverPreviewOptions: hoverPreviewOptions
|
|
63
63
|
}, /*#__PURE__*/React.createElement("span", {
|
|
64
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
64
65
|
onMouseLeave: onMouseLeave,
|
|
65
66
|
onMouseMove: onMouseMove,
|
|
66
67
|
"data-testid": "".concat(testId, "-hover-card-wrapper"),
|
|
@@ -21,16 +21,20 @@ var LozengeActionItem = function LozengeActionItem(_ref) {
|
|
|
21
21
|
var _e$currentTarget;
|
|
22
22
|
(_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 || (_e$currentTarget = _e$currentTarget.firstElementChild) === null || _e$currentTarget === void 0 || _e$currentTarget.focus();
|
|
23
23
|
}, []);
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
return (
|
|
25
|
+
/*#__PURE__*/
|
|
26
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
27
|
+
React.createElement("span", {
|
|
28
|
+
onMouseEnter: handleMouseEnter,
|
|
29
|
+
role: "presentation"
|
|
30
|
+
}, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
31
|
+
onClick: handleClick,
|
|
32
|
+
testId: testId
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Lozenge, _extends({
|
|
34
|
+
appearance: appearance
|
|
35
|
+
}, fg('platform-component-visual-refresh') ? {
|
|
36
|
+
isBold: true
|
|
37
|
+
} : undefined), text)))
|
|
38
|
+
);
|
|
35
39
|
};
|
|
36
40
|
export default LozengeActionItem;
|
|
@@ -104,8 +104,12 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
104
104
|
type: "button"
|
|
105
105
|
}, props, {
|
|
106
106
|
"data-action-open": isOpen,
|
|
107
|
-
"data-testid": "".concat(testId, "--trigger")
|
|
108
|
-
|
|
107
|
+
"data-testid": "".concat(testId, "--trigger")
|
|
108
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
109
|
+
,
|
|
110
|
+
onMouseEnter: onMouseEnter
|
|
111
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
112
|
+
,
|
|
109
113
|
onMouseLeave: onMouseLeave,
|
|
110
114
|
onMouseDown: onMouseOrKeyDown,
|
|
111
115
|
onMouseUp: onMouseOrKeyUp,
|
|
@@ -221,8 +221,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
221
221
|
return /*#__PURE__*/React.createElement("span", {
|
|
222
222
|
ref: parentSpan
|
|
223
223
|
}, /*#__PURE__*/React.createElement("span", _extends({}, triggerProps, {
|
|
224
|
-
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
225
|
-
onMouseOver: initShowCard
|
|
224
|
+
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events, @atlassian/a11y/mouse-events-have-key-events
|
|
225
|
+
onMouseOver: initShowCard
|
|
226
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
227
|
+
,
|
|
226
228
|
onMouseLeave: initHideCard,
|
|
227
229
|
onMouseMove: setMousePosition,
|
|
228
230
|
onClick: onChildClick,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "42.3.
|
|
3
|
+
"version": "42.3.3",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
32
32
|
"@atlaskit/avatar": "^25.2.0",
|
|
33
33
|
"@atlaskit/avatar-group": "^12.2.0",
|
|
34
|
-
"@atlaskit/badge": "^18.
|
|
34
|
+
"@atlaskit/badge": "^18.2.0",
|
|
35
35
|
"@atlaskit/button": "^23.4.0",
|
|
36
36
|
"@atlaskit/checkbox": "^17.1.0",
|
|
37
37
|
"@atlaskit/css": "^0.14.0",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"@atlaskit/embedded-confluence": "^4.3.0",
|
|
40
40
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
41
41
|
"@atlaskit/form": "^14.2.0",
|
|
42
|
-
"@atlaskit/frontend-utilities": "^3.
|
|
42
|
+
"@atlaskit/frontend-utilities": "^3.2.0",
|
|
43
43
|
"@atlaskit/heading": "^5.2.0",
|
|
44
44
|
"@atlaskit/icon": "^28.3.0",
|
|
45
45
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
46
|
-
"@atlaskit/icon-lab": "^5.
|
|
46
|
+
"@atlaskit/icon-lab": "^5.8.0",
|
|
47
47
|
"@atlaskit/icon-object": "^7.2.0",
|
|
48
48
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
49
49
|
"@atlaskit/image": "^3.0.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/link-test-helpers": "^8.4.0",
|
|
57
57
|
"@atlaskit/linking-common": "^9.7.0",
|
|
58
58
|
"@atlaskit/linking-types": "^14.0.0",
|
|
59
|
-
"@atlaskit/logo": "^19.
|
|
59
|
+
"@atlaskit/logo": "^19.8.0",
|
|
60
60
|
"@atlaskit/lozenge": "^13.0.0",
|
|
61
61
|
"@atlaskit/menu": "^8.4.0",
|
|
62
62
|
"@atlaskit/modal-dialog": "^14.4.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@atlaskit/textarea": "^8.0.0",
|
|
71
71
|
"@atlaskit/textfield": "^8.0.0",
|
|
72
72
|
"@atlaskit/theme": "^21.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^13.0.0",
|
|
74
74
|
"@atlaskit/tokens": "^6.4.0",
|
|
75
75
|
"@atlaskit/tooltip": "^20.5.0",
|
|
76
76
|
"@atlaskit/ufo": "^0.4.0",
|