@atlaskit/smart-card 18.0.22 → 18.0.23
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/dist/cjs/ssr.js +17 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/ssr.js +9 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/ssr.js +16 -3
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
package/dist/cjs/ssr.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.CardSSR = void 0;
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
|
|
@@ -17,12 +17,20 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
19
19
|
|
|
20
|
+
var _reactErrorBoundary = require("react-error-boundary");
|
|
21
|
+
|
|
20
22
|
var _component = require("./view/CardWithUrl/component");
|
|
21
23
|
|
|
24
|
+
var _LazyFallback = require("./view/CardWithUrl/component-lazy/LazyFallback");
|
|
25
|
+
|
|
22
26
|
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); }
|
|
23
27
|
|
|
24
28
|
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; }
|
|
25
29
|
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
33
|
+
|
|
26
34
|
// SSR friendly version of smart-card
|
|
27
35
|
// simplifies the logic around rendering and loading placeholders and
|
|
28
36
|
// only contains whats necessary to render the card on SSR mode
|
|
@@ -36,10 +44,16 @@ var CardSSR = function CardSSR(props) {
|
|
|
36
44
|
var dispatchAnalytics = function dispatchAnalytics() {}; // we can't dispatch events on SSR, after hydration the we will provide the real callback
|
|
37
45
|
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
var cardProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
40
48
|
id: id,
|
|
41
49
|
dispatchAnalytics: dispatchAnalytics
|
|
42
|
-
})
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
|
|
53
|
+
FallbackComponent: function FallbackComponent() {
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_LazyFallback.LoadingCardLink, cardProps);
|
|
55
|
+
}
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_component.CardWithUrlContent, cardProps));
|
|
43
57
|
};
|
|
44
58
|
|
|
45
59
|
exports.CardSSR = CardSSR;
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/ssr.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { useState } from 'react';
|
|
4
3
|
import uuid from 'uuid';
|
|
4
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
5
5
|
import { CardWithUrlContent } from './view/CardWithUrl/component';
|
|
6
|
+
import { LoadingCardLink } from './view/CardWithUrl/component-lazy/LazyFallback';
|
|
6
7
|
// SSR friendly version of smart-card
|
|
7
8
|
// simplifies the logic around rendering and loading placeholders and
|
|
8
9
|
// only contains whats necessary to render the card on SSR mode
|
|
@@ -12,8 +13,11 @@ export const CardSSR = props => {
|
|
|
12
13
|
const dispatchAnalytics = () => {}; // we can't dispatch events on SSR, after hydration the we will provide the real callback
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
id
|
|
17
|
-
dispatchAnalytics
|
|
18
|
-
}
|
|
16
|
+
const cardProps = { ...props,
|
|
17
|
+
id,
|
|
18
|
+
dispatchAnalytics
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
21
|
+
FallbackComponent: () => /*#__PURE__*/React.createElement(LoadingCardLink, cardProps)
|
|
22
|
+
}, /*#__PURE__*/React.createElement(CardWithUrlContent, cardProps));
|
|
19
23
|
};
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/ssr.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
|
|
4
|
+
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; }
|
|
5
|
+
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
|
|
3
8
|
import React from 'react';
|
|
4
9
|
import { useState } from 'react';
|
|
5
10
|
import uuid from 'uuid';
|
|
11
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
6
12
|
import { CardWithUrlContent } from './view/CardWithUrl/component';
|
|
13
|
+
import { LoadingCardLink } from './view/CardWithUrl/component-lazy/LazyFallback';
|
|
7
14
|
// SSR friendly version of smart-card
|
|
8
15
|
// simplifies the logic around rendering and loading placeholders and
|
|
9
16
|
// only contains whats necessary to render the card on SSR mode
|
|
@@ -17,8 +24,14 @@ export var CardSSR = function CardSSR(props) {
|
|
|
17
24
|
var dispatchAnalytics = function dispatchAnalytics() {}; // we can't dispatch events on SSR, after hydration the we will provide the real callback
|
|
18
25
|
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
var cardProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
21
28
|
id: id,
|
|
22
29
|
dispatchAnalytics: dispatchAnalytics
|
|
23
|
-
})
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
33
|
+
FallbackComponent: function FallbackComponent() {
|
|
34
|
+
return /*#__PURE__*/React.createElement(LoadingCardLink, cardProps);
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React.createElement(CardWithUrlContent, cardProps));
|
|
24
37
|
};
|
package/dist/esm/version.json
CHANGED