@atlaskit/smart-card 18.0.7 → 18.0.10
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 +18 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +5 -1
- package/dist/cjs/view/CardWithUrl/loader.js +9 -11
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/utils.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +5 -1
- package/dist/es2019/view/CardWithUrl/loader.js +21 -23
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/utils.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/CardWithUrl/component.js +5 -1
- package/dist/esm/view/CardWithUrl/loader.js +9 -11
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/utils.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 18.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b687926f768`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b687926f768) - Fix bug where individual action item was not hidden by default with showActionOnHover flag
|
|
8
|
+
|
|
9
|
+
## 18.0.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`6adaa6b5c18`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6adaa6b5c18) - Updated default renderer onClick to not fire on a Flexible UI link to prevent links from being openned twice
|
|
14
|
+
|
|
15
|
+
## 18.0.8
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`d9b55e7cd29`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d9b55e7cd29) - Add classname for placeholder element that is shown while we load js module
|
|
20
|
+
|
|
3
21
|
## 18.0.7
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/version.json
CHANGED
|
@@ -80,7 +80,11 @@ function CardWithUrlContent(_ref) {
|
|
|
80
80
|
analytics.ui.cardClickedEvent(isFlexibleUi ? 'flexible' : appearance, definitionId, extensionKey, isModifierKeyPressed);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
if (onClick) {
|
|
84
|
+
onClick(event);
|
|
85
|
+
} else if (!isFlexibleUi) {
|
|
86
|
+
handleClick(event);
|
|
87
|
+
}
|
|
84
88
|
}, [state.status, analytics.ui, appearance, definitionId, extensionKey, onClick, handleClick, isFlexibleUi]);
|
|
85
89
|
var handleAuthorize = (0, _react.useCallback)(function () {
|
|
86
90
|
return actions.authorize(appearance);
|
|
@@ -23,7 +23,7 @@ var _reactErrorBoundary = require("react-error-boundary");
|
|
|
23
23
|
|
|
24
24
|
var _ufoExperiences = require("../../state/analytics/ufoExperiences");
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _LazyFallback = require("./component-lazy/LazyFallback");
|
|
27
27
|
|
|
28
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
29
|
|
|
@@ -106,15 +106,7 @@ function CardWithURLRenderer(props) {
|
|
|
106
106
|
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
FallbackComponent: ErrorFallback,
|
|
111
|
-
onError: logError
|
|
112
|
-
}, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
113
|
-
fallback: /*#__PURE__*/_react.default.createElement(_LinkView.CardLinkView, {
|
|
114
|
-
key: 'chunk-placeholder',
|
|
115
|
-
link: url
|
|
116
|
-
})
|
|
117
|
-
}, /*#__PURE__*/_react.default.createElement(LazyCardWithUrlContent, {
|
|
109
|
+
var cardWithUrlProps = {
|
|
118
110
|
id: id,
|
|
119
111
|
url: url,
|
|
120
112
|
appearance: appearance,
|
|
@@ -131,7 +123,13 @@ function CardWithURLRenderer(props) {
|
|
|
131
123
|
embedIframeRef: embedIframeRef,
|
|
132
124
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
133
125
|
ui: ui
|
|
134
|
-
}
|
|
126
|
+
};
|
|
127
|
+
return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
|
|
128
|
+
FallbackComponent: ErrorFallback,
|
|
129
|
+
onError: logError
|
|
130
|
+
}, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
131
|
+
fallback: /*#__PURE__*/_react.default.createElement(_LazyFallback.LoadingCardLink, cardWithUrlProps)
|
|
132
|
+
}, /*#__PURE__*/_react.default.createElement(LazyCardWithUrlContent, cardWithUrlProps, children)));
|
|
135
133
|
}
|
|
136
134
|
|
|
137
135
|
var ErrorFallback = function ErrorFallback() {
|
|
@@ -48,7 +48,8 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
48
48
|
var firstActions = isMoreThenTwoItems ? items.slice(0, visibleButtonsNum - 1) : items;
|
|
49
49
|
var restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : [];
|
|
50
50
|
return (0, _core.jsx)("div", {
|
|
51
|
-
css: styles
|
|
51
|
+
css: styles,
|
|
52
|
+
className: "actions-button-group"
|
|
52
53
|
}, (0, _core.jsx)(_buttonGroup.default, null, (0, _utils.renderActionItems)(firstActions, size, appearance), restActions.length > 0 ? (0, _core.jsx)(_dropdownMenu.default, {
|
|
53
54
|
onOpenChange: function onOpenChange(_ref2) {
|
|
54
55
|
var isOpen = _ref2.isOpen;
|
|
@@ -59,7 +60,6 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
59
60
|
props = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
60
61
|
return (0, _core.jsx)(_standardButton.default, (0, _extends2.default)({}, props, {
|
|
61
62
|
spacing: _action.sizeToSpacing[size],
|
|
62
|
-
className: "action-group-more-button",
|
|
63
63
|
testId: "action-group-more-button",
|
|
64
64
|
iconBefore: (0, _core.jsx)(_more.default, {
|
|
65
65
|
label: "more"
|
|
@@ -41,7 +41,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
41
41
|
|
|
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
|
-
var actionOnHoverOnlyStyle = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .
|
|
44
|
+
var actionOnHoverOnlyStyle = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .actions-button-group {\n visibility: hidden;\n }\n\n &:hover {\n .actions-button-group {\n visibility: visible;\n }\n }\n"])));
|
|
45
45
|
exports.actionOnHoverOnlyStyle = actionOnHoverOnlyStyle;
|
|
46
46
|
|
|
47
47
|
var BaseTitleBlockComponent = function BaseTitleBlockComponent(_ref) {
|
package/dist/es2019/version.json
CHANGED
|
@@ -52,7 +52,11 @@ export function CardWithUrlContent({
|
|
|
52
52
|
analytics.ui.cardClickedEvent(isFlexibleUi ? 'flexible' : appearance, definitionId, extensionKey, isModifierKeyPressed);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
if (onClick) {
|
|
56
|
+
onClick(event);
|
|
57
|
+
} else if (!isFlexibleUi) {
|
|
58
|
+
handleClick(event);
|
|
59
|
+
}
|
|
56
60
|
}, [state.status, analytics.ui, appearance, definitionId, extensionKey, onClick, handleClick, isFlexibleUi]);
|
|
57
61
|
const handleAuthorize = useCallback(() => actions.authorize(appearance), [actions, appearance]);
|
|
58
62
|
const handleRetry = useCallback(() => {
|
|
@@ -4,7 +4,7 @@ import { uiRenderFailedEvent, fireSmartLinkEvent } from '../../utils/analytics';
|
|
|
4
4
|
import { clearMarks, clearMeasures } from '../../utils/performance';
|
|
5
5
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
6
6
|
import { failUfoExperience, startUfoExperience } from '../../state/analytics/ufoExperiences';
|
|
7
|
-
import {
|
|
7
|
+
import { LoadingCardLink } from './component-lazy/LazyFallback';
|
|
8
8
|
const LazyCardWithUrlContent = /*#__PURE__*/lazy(() => import(
|
|
9
9
|
/* webpackChunkName: "@atlaskit-internal_smartcard-urlcardcontent" */
|
|
10
10
|
'./component-lazy/index'));
|
|
@@ -78,32 +78,30 @@ export function CardWithURLRenderer(props) {
|
|
|
78
78
|
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
const cardWithUrlProps = {
|
|
82
|
+
id,
|
|
83
|
+
url,
|
|
84
|
+
appearance,
|
|
85
|
+
onClick,
|
|
86
|
+
isSelected,
|
|
87
|
+
isFrameVisible,
|
|
88
|
+
dispatchAnalytics,
|
|
89
|
+
container,
|
|
90
|
+
onResolve,
|
|
91
|
+
testId,
|
|
92
|
+
showActions,
|
|
93
|
+
inheritDimensions,
|
|
94
|
+
platform,
|
|
95
|
+
embedIframeRef,
|
|
96
|
+
inlinePreloaderStyle,
|
|
97
|
+
ui
|
|
98
|
+
};
|
|
81
99
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
82
100
|
FallbackComponent: ErrorFallback,
|
|
83
101
|
onError: logError
|
|
84
102
|
}, /*#__PURE__*/React.createElement(Suspense, {
|
|
85
|
-
fallback: /*#__PURE__*/React.createElement(
|
|
86
|
-
|
|
87
|
-
link: url
|
|
88
|
-
})
|
|
89
|
-
}, /*#__PURE__*/React.createElement(LazyCardWithUrlContent, {
|
|
90
|
-
id: id,
|
|
91
|
-
url: url,
|
|
92
|
-
appearance: appearance,
|
|
93
|
-
onClick: onClick,
|
|
94
|
-
isSelected: isSelected,
|
|
95
|
-
isFrameVisible: isFrameVisible,
|
|
96
|
-
dispatchAnalytics: dispatchAnalytics,
|
|
97
|
-
container: container,
|
|
98
|
-
onResolve: onResolve,
|
|
99
|
-
testId: testId,
|
|
100
|
-
showActions: showActions,
|
|
101
|
-
inheritDimensions: inheritDimensions,
|
|
102
|
-
platform: platform,
|
|
103
|
-
embedIframeRef: embedIframeRef,
|
|
104
|
-
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
105
|
-
ui: ui
|
|
106
|
-
}, children)));
|
|
103
|
+
fallback: /*#__PURE__*/React.createElement(LoadingCardLink, cardWithUrlProps)
|
|
104
|
+
}, /*#__PURE__*/React.createElement(LazyCardWithUrlContent, cardWithUrlProps, children)));
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
const ErrorFallback = () => {
|
|
@@ -25,7 +25,8 @@ const ActionGroup = ({
|
|
|
25
25
|
const firstActions = isMoreThenTwoItems ? items.slice(0, visibleButtonsNum - 1) : items;
|
|
26
26
|
const restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : [];
|
|
27
27
|
return jsx("div", {
|
|
28
|
-
css: styles
|
|
28
|
+
css: styles,
|
|
29
|
+
className: "actions-button-group"
|
|
29
30
|
}, jsx(ButtonGroup, null, renderActionItems(firstActions, size, appearance), restActions.length > 0 ? jsx(DropdownMenu, {
|
|
30
31
|
onOpenChange: ({
|
|
31
32
|
isOpen
|
|
@@ -35,7 +36,6 @@ const ActionGroup = ({
|
|
|
35
36
|
...props
|
|
36
37
|
}) => jsx(Button, _extends({}, props, {
|
|
37
38
|
spacing: sizeToSpacing[size],
|
|
38
|
-
className: "action-group-more-button",
|
|
39
39
|
testId: "action-group-more-button",
|
|
40
40
|
iconBefore: jsx(MoreIcon, {
|
|
41
41
|
label: "more"
|
|
@@ -11,12 +11,12 @@ import { SmartLinkAlignment, SmartLinkWidth, SmartLinkDirection } from '../../..
|
|
|
11
11
|
import ElementGroup from '../element-group';
|
|
12
12
|
import { renderElementItems } from '../utils';
|
|
13
13
|
export const actionOnHoverOnlyStyle = css`
|
|
14
|
-
.
|
|
14
|
+
.actions-button-group {
|
|
15
15
|
visibility: hidden;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
&:hover {
|
|
19
|
-
.
|
|
19
|
+
.actions-button-group {
|
|
20
20
|
visibility: visible;
|
|
21
21
|
}
|
|
22
22
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -54,7 +54,11 @@ export function CardWithUrlContent(_ref) {
|
|
|
54
54
|
analytics.ui.cardClickedEvent(isFlexibleUi ? 'flexible' : appearance, definitionId, extensionKey, isModifierKeyPressed);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
if (onClick) {
|
|
58
|
+
onClick(event);
|
|
59
|
+
} else if (!isFlexibleUi) {
|
|
60
|
+
handleClick(event);
|
|
61
|
+
}
|
|
58
62
|
}, [state.status, analytics.ui, appearance, definitionId, extensionKey, onClick, handleClick, isFlexibleUi]);
|
|
59
63
|
var handleAuthorize = useCallback(function () {
|
|
60
64
|
return actions.authorize(appearance);
|
|
@@ -5,7 +5,7 @@ import { uiRenderFailedEvent, fireSmartLinkEvent } from '../../utils/analytics';
|
|
|
5
5
|
import { clearMarks, clearMeasures } from '../../utils/performance';
|
|
6
6
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
7
7
|
import { failUfoExperience, startUfoExperience } from '../../state/analytics/ufoExperiences';
|
|
8
|
-
import {
|
|
8
|
+
import { LoadingCardLink } from './component-lazy/LazyFallback';
|
|
9
9
|
var LazyCardWithUrlContent = /*#__PURE__*/lazy(function () {
|
|
10
10
|
return import(
|
|
11
11
|
/* webpackChunkName: "@atlaskit-internal_smartcard-urlcardcontent" */
|
|
@@ -82,15 +82,7 @@ export function CardWithURLRenderer(props) {
|
|
|
82
82
|
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
FallbackComponent: ErrorFallback,
|
|
87
|
-
onError: logError
|
|
88
|
-
}, /*#__PURE__*/React.createElement(Suspense, {
|
|
89
|
-
fallback: /*#__PURE__*/React.createElement(CardLinkView, {
|
|
90
|
-
key: 'chunk-placeholder',
|
|
91
|
-
link: url
|
|
92
|
-
})
|
|
93
|
-
}, /*#__PURE__*/React.createElement(LazyCardWithUrlContent, {
|
|
85
|
+
var cardWithUrlProps = {
|
|
94
86
|
id: id,
|
|
95
87
|
url: url,
|
|
96
88
|
appearance: appearance,
|
|
@@ -107,7 +99,13 @@ export function CardWithURLRenderer(props) {
|
|
|
107
99
|
embedIframeRef: embedIframeRef,
|
|
108
100
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
109
101
|
ui: ui
|
|
110
|
-
}
|
|
102
|
+
};
|
|
103
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
104
|
+
FallbackComponent: ErrorFallback,
|
|
105
|
+
onError: logError
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Suspense, {
|
|
107
|
+
fallback: /*#__PURE__*/React.createElement(LoadingCardLink, cardWithUrlProps)
|
|
108
|
+
}, /*#__PURE__*/React.createElement(LazyCardWithUrlContent, cardWithUrlProps, children)));
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
var ErrorFallback = function ErrorFallback() {
|
|
@@ -29,7 +29,8 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
29
29
|
var firstActions = isMoreThenTwoItems ? items.slice(0, visibleButtonsNum - 1) : items;
|
|
30
30
|
var restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : [];
|
|
31
31
|
return jsx("div", {
|
|
32
|
-
css: styles
|
|
32
|
+
css: styles,
|
|
33
|
+
className: "actions-button-group"
|
|
33
34
|
}, jsx(ButtonGroup, null, renderActionItems(firstActions, size, appearance), restActions.length > 0 ? jsx(DropdownMenu, {
|
|
34
35
|
onOpenChange: function onOpenChange(_ref2) {
|
|
35
36
|
var isOpen = _ref2.isOpen;
|
|
@@ -41,7 +42,6 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
41
42
|
|
|
42
43
|
return jsx(Button, _extends({}, props, {
|
|
43
44
|
spacing: sizeToSpacing[size],
|
|
44
|
-
className: "action-group-more-button",
|
|
45
45
|
testId: "action-group-more-button",
|
|
46
46
|
iconBefore: jsx(MoreIcon, {
|
|
47
47
|
label: "more"
|
|
@@ -16,7 +16,7 @@ import ActionGroup from '../action-group';
|
|
|
16
16
|
import { SmartLinkAlignment, SmartLinkWidth, SmartLinkDirection } from '../../../../../constants';
|
|
17
17
|
import ElementGroup from '../element-group';
|
|
18
18
|
import { renderElementItems } from '../utils';
|
|
19
|
-
export var actionOnHoverOnlyStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .
|
|
19
|
+
export var actionOnHoverOnlyStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .actions-button-group {\n visibility: hidden;\n }\n\n &:hover {\n .actions-button-group {\n visibility: visible;\n }\n }\n"])));
|
|
20
20
|
export var BaseTitleBlockComponent = function BaseTitleBlockComponent(_ref) {
|
|
21
21
|
var children = _ref.children,
|
|
22
22
|
blockTestIdPostfix = _ref.blockTestIdPostfix,
|