@atlaskit/smart-card 26.5.11 → 26.5.13
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 +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +2 -2
- package/dist/cjs/view/CardWithUrl/loader.js +4 -2
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +2 -2
- package/dist/es2019/view/CardWithUrl/loader.js +4 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/CardWithUrl/component.js +2 -2
- package/dist/esm/view/CardWithUrl/loader.js +4 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.5.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2d2b6b23bec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2d2b6b23bec) - Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 26.5.12
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`472882f9947`](https://bitbucket.org/atlassian/atlassian-frontend/commits/472882f9947) - fix analytics display to be flexible when it is a flex ui
|
|
14
|
+
|
|
3
15
|
## 26.5.11
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/version.json
CHANGED
|
@@ -141,14 +141,14 @@ function Component(_ref) {
|
|
|
141
141
|
(0, _react.useEffect)(function () {
|
|
142
142
|
if ((0, _helpers.isFinalState)(state.status)) {
|
|
143
143
|
analytics.ui.renderSuccessEvent({
|
|
144
|
-
display: appearance,
|
|
144
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
145
145
|
status: state.status,
|
|
146
146
|
id: id,
|
|
147
147
|
definitionId: definitionId,
|
|
148
148
|
extensionKey: extensionKey
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
}, [appearance, state.status, url, definitionId, extensionKey, analytics.ui, id]);
|
|
151
|
+
}, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id]);
|
|
152
152
|
var onIframeDwell = (0, _react.useCallback)(function (dwellTime, dwellPercentVisible) {
|
|
153
153
|
analytics.ui.iframeDwelledEvent({
|
|
154
154
|
id: id,
|
|
@@ -16,6 +16,7 @@ var _reactErrorBoundary = require("react-error-boundary");
|
|
|
16
16
|
var _analytics2 = require("../../state/analytics");
|
|
17
17
|
var _LazyFallback = require("./component-lazy/LazyFallback");
|
|
18
18
|
var _utils = require("../../utils");
|
|
19
|
+
var _flexible = require("../../utils/flexible");
|
|
19
20
|
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); }
|
|
20
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(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; }
|
|
21
22
|
var LazyCardWithUrlContent = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
@@ -90,6 +91,7 @@ function CardWithURLRenderer(props) {
|
|
|
90
91
|
};
|
|
91
92
|
}, [appearance, createAnalyticsEvent]);
|
|
92
93
|
var analytics = (0, _analytics2.useSmartLinkAnalytics)(url !== null && url !== void 0 ? url : '', dispatchAnalytics, id);
|
|
94
|
+
var isFlexibleUi = (0, _flexible.isFlexibleUiCard)(children);
|
|
93
95
|
var errorHandler = (0, _react.useCallback)(function (error, info) {
|
|
94
96
|
var componentStack = info.componentStack;
|
|
95
97
|
var errorInfo = {
|
|
@@ -108,7 +110,7 @@ function CardWithURLRenderer(props) {
|
|
|
108
110
|
});
|
|
109
111
|
} else if (error.name !== 'APIError') {
|
|
110
112
|
analytics.ui.renderFailedEvent({
|
|
111
|
-
display: appearance,
|
|
113
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
112
114
|
id: id,
|
|
113
115
|
error: error,
|
|
114
116
|
errorInfo: errorInfo
|
|
@@ -119,7 +121,7 @@ function CardWithURLRenderer(props) {
|
|
|
119
121
|
url: url !== null && url !== void 0 ? url : '',
|
|
120
122
|
err: error
|
|
121
123
|
});
|
|
122
|
-
}, [analytics.operational, analytics.ui, appearance, id, onError, url]);
|
|
124
|
+
}, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi]);
|
|
123
125
|
if (!url) {
|
|
124
126
|
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
125
127
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -128,14 +128,14 @@ function Component({
|
|
|
128
128
|
useEffect(() => {
|
|
129
129
|
if (isFinalState(state.status)) {
|
|
130
130
|
analytics.ui.renderSuccessEvent({
|
|
131
|
-
display: appearance,
|
|
131
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
132
132
|
status: state.status,
|
|
133
133
|
id,
|
|
134
134
|
definitionId,
|
|
135
135
|
extensionKey
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
}, [appearance, state.status, url, definitionId, extensionKey, analytics.ui, id]);
|
|
138
|
+
}, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id]);
|
|
139
139
|
const onIframeDwell = useCallback((dwellTime, dwellPercentVisible) => {
|
|
140
140
|
analytics.ui.iframeDwelledEvent({
|
|
141
141
|
id,
|
|
@@ -7,6 +7,7 @@ import { ErrorBoundary } from 'react-error-boundary';
|
|
|
7
7
|
import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
8
8
|
import { LoadingCardLink } from './component-lazy/LazyFallback';
|
|
9
9
|
import { importWithRetry } from '../../utils';
|
|
10
|
+
import { isFlexibleUiCard } from '../../utils/flexible';
|
|
10
11
|
const LazyCardWithUrlContent = /*#__PURE__*/lazy(() => importWithRetry(() => import( /* webpackChunkName: "@atlaskit-internal_smartcard-urlcardcontent" */'./component-lazy/index')));
|
|
11
12
|
export function CardWithURLRenderer(props) {
|
|
12
13
|
const [id] = useState(() => props.id ? props.id : uuid());
|
|
@@ -71,6 +72,7 @@ export function CardWithURLRenderer(props) {
|
|
|
71
72
|
};
|
|
72
73
|
}, [appearance, createAnalyticsEvent]);
|
|
73
74
|
const analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', dispatchAnalytics, id);
|
|
75
|
+
const isFlexibleUi = isFlexibleUiCard(children);
|
|
74
76
|
const errorHandler = useCallback((error, info) => {
|
|
75
77
|
const {
|
|
76
78
|
componentStack
|
|
@@ -91,7 +93,7 @@ export function CardWithURLRenderer(props) {
|
|
|
91
93
|
});
|
|
92
94
|
} else if (error.name !== 'APIError') {
|
|
93
95
|
analytics.ui.renderFailedEvent({
|
|
94
|
-
display: appearance,
|
|
96
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
95
97
|
id,
|
|
96
98
|
error,
|
|
97
99
|
errorInfo
|
|
@@ -102,7 +104,7 @@ export function CardWithURLRenderer(props) {
|
|
|
102
104
|
url: url !== null && url !== void 0 ? url : '',
|
|
103
105
|
err: error
|
|
104
106
|
});
|
|
105
|
-
}, [analytics.operational, analytics.ui, appearance, id, onError, url]);
|
|
107
|
+
}, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi]);
|
|
106
108
|
if (!url) {
|
|
107
109
|
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
108
110
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -131,14 +131,14 @@ function Component(_ref) {
|
|
|
131
131
|
useEffect(function () {
|
|
132
132
|
if (isFinalState(state.status)) {
|
|
133
133
|
analytics.ui.renderSuccessEvent({
|
|
134
|
-
display: appearance,
|
|
134
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
135
135
|
status: state.status,
|
|
136
136
|
id: id,
|
|
137
137
|
definitionId: definitionId,
|
|
138
138
|
extensionKey: extensionKey
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
}, [appearance, state.status, url, definitionId, extensionKey, analytics.ui, id]);
|
|
141
|
+
}, [isFlexibleUi, appearance, state.status, url, definitionId, extensionKey, analytics.ui, id]);
|
|
142
142
|
var onIframeDwell = useCallback(function (dwellTime, dwellPercentVisible) {
|
|
143
143
|
analytics.ui.iframeDwelledEvent({
|
|
144
144
|
id: id,
|
|
@@ -8,6 +8,7 @@ import { ErrorBoundary } from 'react-error-boundary';
|
|
|
8
8
|
import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
9
9
|
import { LoadingCardLink } from './component-lazy/LazyFallback';
|
|
10
10
|
import { importWithRetry } from '../../utils';
|
|
11
|
+
import { isFlexibleUiCard } from '../../utils/flexible';
|
|
11
12
|
var LazyCardWithUrlContent = /*#__PURE__*/lazy(function () {
|
|
12
13
|
return importWithRetry(function () {
|
|
13
14
|
return import( /* webpackChunkName: "@atlaskit-internal_smartcard-urlcardcontent" */'./component-lazy/index');
|
|
@@ -78,6 +79,7 @@ export function CardWithURLRenderer(props) {
|
|
|
78
79
|
};
|
|
79
80
|
}, [appearance, createAnalyticsEvent]);
|
|
80
81
|
var analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', dispatchAnalytics, id);
|
|
82
|
+
var isFlexibleUi = isFlexibleUiCard(children);
|
|
81
83
|
var errorHandler = useCallback(function (error, info) {
|
|
82
84
|
var componentStack = info.componentStack;
|
|
83
85
|
var errorInfo = {
|
|
@@ -96,7 +98,7 @@ export function CardWithURLRenderer(props) {
|
|
|
96
98
|
});
|
|
97
99
|
} else if (error.name !== 'APIError') {
|
|
98
100
|
analytics.ui.renderFailedEvent({
|
|
99
|
-
display: appearance,
|
|
101
|
+
display: isFlexibleUi ? 'flexible' : appearance,
|
|
100
102
|
id: id,
|
|
101
103
|
error: error,
|
|
102
104
|
errorInfo: errorInfo
|
|
@@ -107,7 +109,7 @@ export function CardWithURLRenderer(props) {
|
|
|
107
109
|
url: url !== null && url !== void 0 ? url : '',
|
|
108
110
|
err: error
|
|
109
111
|
});
|
|
110
|
-
}, [analytics.operational, analytics.ui, appearance, id, onError, url]);
|
|
112
|
+
}, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi]);
|
|
111
113
|
if (!url) {
|
|
112
114
|
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
113
115
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.5.
|
|
3
|
+
"version": "26.5.13",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
44
44
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
45
45
|
"@atlaskit/link-analytics": "^8.0.2",
|
|
46
|
-
"@atlaskit/link-client-extension": "^1.2.
|
|
46
|
+
"@atlaskit/link-client-extension": "^1.2.1",
|
|
47
47
|
"@atlaskit/linking-common": "^2.15.0",
|
|
48
48
|
"@atlaskit/linking-types": "^6.0.0",
|
|
49
49
|
"@atlaskit/logo": "^13.14.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/popup": "^1.7.0",
|
|
56
56
|
"@atlaskit/spinner": "^15.5.0",
|
|
57
57
|
"@atlaskit/theme": "^12.5.0",
|
|
58
|
-
"@atlaskit/tokens": "^1.
|
|
58
|
+
"@atlaskit/tokens": "^1.6.0",
|
|
59
59
|
"@atlaskit/tooltip": "^17.8.0",
|
|
60
60
|
"@atlaskit/ufo": "^0.2.0",
|
|
61
61
|
"@babel/runtime": "^7.0.0",
|