@atlaskit/smart-card 40.13.3 → 40.14.1
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 +24 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +4 -0
- package/dist/cjs/view/CardWithUrl/component.js +2 -1
- package/dist/cjs/view/EmbedCard/components/ImageIcon.compiled.css +1 -1
- package/dist/cjs/view/EmbedCard/components/ImageIcon.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +4 -1
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.compiled.css +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-badge-element/index.js +9 -3
- package/dist/cjs/view/FlexibleCard/components/elements/media-element/index.js +6 -0
- package/dist/cjs/view/InlineCard/Icon.compiled.css +1 -1
- package/dist/cjs/view/InlineCard/Icon.js +1 -1
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.compiled.css +2 -2
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +25 -4
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +5 -2
- package/dist/cjs/view/InlineCard/index.js +5 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +4 -0
- package/dist/es2019/view/CardWithUrl/component.js +2 -1
- package/dist/es2019/view/EmbedCard/components/ImageIcon.compiled.css +1 -1
- package/dist/es2019/view/EmbedCard/components/ImageIcon.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +5 -2
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.compiled.css +1 -1
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +1 -1
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-badge-element/index.js +9 -3
- package/dist/es2019/view/FlexibleCard/components/elements/media-element/index.js +6 -0
- package/dist/es2019/view/InlineCard/Icon.compiled.css +1 -1
- package/dist/es2019/view/InlineCard/Icon.js +1 -1
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.compiled.css +2 -2
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +20 -5
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +5 -2
- package/dist/es2019/view/InlineCard/index.js +5 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +4 -0
- package/dist/esm/view/CardWithUrl/component.js +2 -1
- package/dist/esm/view/EmbedCard/components/ImageIcon.compiled.css +1 -1
- package/dist/esm/view/EmbedCard/components/ImageIcon.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +5 -2
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.compiled.css +1 -1
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +1 -1
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-badge-element/index.js +9 -3
- package/dist/esm/view/FlexibleCard/components/elements/media-element/index.js +6 -0
- package/dist/esm/view/InlineCard/Icon.compiled.css +1 -1
- package/dist/esm/view/InlineCard/Icon.js +1 -1
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.compiled.css +2 -2
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +26 -5
- package/dist/esm/view/InlineCard/ResolvedView/index.js +5 -2
- package/dist/esm/view/InlineCard/index.js +5 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/FlexibleCard/components/elements/common/base-badge-element/index.d.ts +10 -0
- package/dist/types/view/FlexibleCard/types.d.ts +4 -0
- package/dist/types/view/InlineCard/IconAndTitleLayout/index.d.ts +2 -1
- package/dist/types/view/InlineCard/ResolvedView/index.d.ts +5 -0
- package/dist/types/view/InlineCard/index.d.ts +1 -1
- package/dist/types/view/InlineCard/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-badge-element/index.d.ts +10 -0
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +4 -0
- package/dist/types-ts4.5/view/InlineCard/IconAndTitleLayout/index.d.ts +2 -1
- package/dist/types-ts4.5/view/InlineCard/ResolvedView/index.d.ts +5 -0
- package/dist/types-ts4.5/view/InlineCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +1 -0
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 40.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9611ba1c6ba80`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9611ba1c6ba80) -
|
|
8
|
+
NO-ISSUE cleaning up smart-links-noun-support leftover references
|
|
9
|
+
- [`ef3b2dfa2f8a8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef3b2dfa2f8a8) -
|
|
10
|
+
Internal changes to use radius tokens. No visual changes.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 40.14.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [`5763f85b421a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5763f85b421a2) - -
|
|
18
|
+
The new method `getCacheStatusForNode` is added to `NodeDataProvider` class to get the cache
|
|
19
|
+
status for a given node.
|
|
20
|
+
- The `CardSSR` component will start supporting `hideIconLoadingSkeleton` property for any type of
|
|
21
|
+
smart card.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 40.13.3
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "40.
|
|
14
|
+
packageVersion: "40.14.0"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -15,6 +15,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _userAgent = require("@atlaskit/linking-common/user-agent");
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
19
|
var _constants = require("../../../constants");
|
|
19
20
|
var _FlexibleCard = _interopRequireDefault(require("../../FlexibleCard"));
|
|
20
21
|
var _blocks = require("../../FlexibleCard/components/blocks");
|
|
@@ -75,6 +76,9 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
75
76
|
if ((0, _platformFeatureFlags.fg)('cc-ai-linking-platform-snippet-renderer')) {
|
|
76
77
|
uiOptions.enableSnippetRenderer = true;
|
|
77
78
|
}
|
|
79
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
80
|
+
uiOptions.hideLoadingSkeleton = hideIconLoadingSkeleton;
|
|
81
|
+
}
|
|
78
82
|
return /*#__PURE__*/React.createElement(_FlexibleCard.default, {
|
|
79
83
|
appearance: "block",
|
|
80
84
|
cardState: cardState,
|
|
@@ -285,7 +285,8 @@ function Component(_ref) {
|
|
|
285
285
|
actionOptions: actionOptions,
|
|
286
286
|
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle,
|
|
287
287
|
resolvingPlaceholder: resolvingPlaceholder,
|
|
288
|
-
truncateInline: truncateInline
|
|
288
|
+
truncateInline: truncateInline,
|
|
289
|
+
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
289
290
|
});
|
|
290
291
|
case 'block':
|
|
291
292
|
return /*#__PURE__*/_react.default.createElement(_BlockCard.BlockCard, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._2rko1twn{border-radius:var(--ds-border-radius-circle,9999px)}
|
|
@@ -12,7 +12,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _reactRenderImage = _interopRequireDefault(require("react-render-image"));
|
|
13
13
|
var _styled = require("./styled");
|
|
14
14
|
var styles = {
|
|
15
|
-
roundedImage: "
|
|
15
|
+
roundedImage: "_2rko1twn"
|
|
16
16
|
};
|
|
17
17
|
var ImageIcon = exports.ImageIcon = function ImageIcon(_ref) {
|
|
18
18
|
var _ref$alt = _ref.alt,
|
|
@@ -65,7 +65,10 @@ var PreviewBlockResolvedView = function PreviewBlockResolvedView(_ref) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}, [ignoreContainerPadding, placement, style]);
|
|
68
|
-
|
|
68
|
+
|
|
69
|
+
// Should be useLayoutEffect to avoid flicker.
|
|
70
|
+
// Styles should be set before paint.
|
|
71
|
+
(0, _react.useLayoutEffect)(function () {
|
|
69
72
|
updateStyles();
|
|
70
73
|
}, [ignoreContainerPadding, placement, updateStyles, className]);
|
|
71
74
|
var handleOnLoad = (0, _react.useCallback)(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._2rko1twn{border-radius:var(--ds-border-radius-circle,9999px)}
|
|
@@ -16,7 +16,7 @@ var _reactRenderImage = _interopRequireDefault(require("react-render-image"));
|
|
|
16
16
|
var _loadingSkeleton = require("../loading-skeleton");
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
18
|
var styles = {
|
|
19
|
-
roundImg: "
|
|
19
|
+
roundImg: "_2rko1twn"
|
|
20
20
|
};
|
|
21
21
|
var ImageIcon = function ImageIcon(_ref) {
|
|
22
22
|
var defaultIcon = _ref.defaultIcon,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
.
|
|
2
|
+
._2rkolb4i{border-radius:var(--ds-radius-xsmall,2px)}._12vemgnk{background-repeat:no-repeat}
|
|
3
3
|
._1e0c1o8l{display:inline-block}
|
|
4
4
|
._1itkx3i8{background-image:var(--_16116mi)}
|
|
5
5
|
._1lrw6rms{background-size:280% 100%}
|
|
@@ -18,7 +18,7 @@ var LoadingSkeleton = exports.LoadingSkeleton = function LoadingSkeleton(_ref) {
|
|
|
18
18
|
height = _ref.height;
|
|
19
19
|
return /*#__PURE__*/React.createElement("span", {
|
|
20
20
|
"data-testid": testId,
|
|
21
|
-
className: (0, _runtime.ax)(["
|
|
21
|
+
className: (0, _runtime.ax)(["_2rkolb4i _uiztglyw _bfhk178v _1itkx3i8 _12vemgnk _1lrw6rms _1e0c1o8l _5sag9cwz _1o51q7pw _tip812c5 _j7hqqkar _1pglp3kn"]),
|
|
22
22
|
style: {
|
|
23
23
|
width: width,
|
|
24
24
|
height: height,
|
|
@@ -12,8 +12,10 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
16
|
var _constants = require("../../../../../../constants");
|
|
16
17
|
var _messages = require("../../../../../../messages");
|
|
18
|
+
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
17
19
|
var _atlaskitIcon = _interopRequireDefault(require("../../../common/atlaskit-icon"));
|
|
18
20
|
var _imageIcon = _interopRequireDefault(require("../../../common/image-icon"));
|
|
19
21
|
var _withOverrideCss = require("../../../common/with-override-css");
|
|
@@ -50,11 +52,12 @@ var renderAtlaskitIcon = function renderAtlaskitIcon(icon, testId) {
|
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
|
-
var renderImageIcon = function renderImageIcon(url, testId) {
|
|
55
|
+
var renderImageIcon = function renderImageIcon(url, testId, hideLoadingSkeleton) {
|
|
54
56
|
if (url) {
|
|
55
57
|
return /*#__PURE__*/_react.default.createElement(_imageIcon.default, {
|
|
56
58
|
testId: testId,
|
|
57
|
-
url: url
|
|
59
|
+
url: url,
|
|
60
|
+
hideLoadingSkeleton: (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && hideLoadingSkeleton
|
|
58
61
|
});
|
|
59
62
|
}
|
|
60
63
|
};
|
|
@@ -83,8 +86,11 @@ var BaseBadgeRefreshNew = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
83
86
|
testId = _ref$testId === void 0 ? 'smart-element-badge' : _ref$testId,
|
|
84
87
|
url = _ref.url,
|
|
85
88
|
color = _ref.color;
|
|
89
|
+
var ui = (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) ?
|
|
90
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
91
|
+
(0, _flexibleUiContext.useFlexibleUiOptionContext)() : undefined;
|
|
86
92
|
var formattedMessageOrLabel = getFormattedMessageFromIcon(icon) || label;
|
|
87
|
-
var badgeIcon = renderAtlaskitIcon(icon, testId) || renderImageIcon(url, testId);
|
|
93
|
+
var badgeIcon = renderAtlaskitIcon(icon, testId) || renderImageIcon(url, testId, ui === null || ui === void 0 ? void 0 : ui.hideLoadingSkeleton);
|
|
88
94
|
if (!formattedMessageOrLabel || !badgeIcon) {
|
|
89
95
|
return null;
|
|
90
96
|
}
|
|
@@ -10,6 +10,8 @@ exports.default = void 0;
|
|
|
10
10
|
require("./index.compiled.css");
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
|
+
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
13
15
|
var _imageIcon = _interopRequireDefault(require("../../common/image-icon"));
|
|
14
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
17
|
/**
|
|
@@ -37,6 +39,9 @@ var MediaElement = function MediaElement(_ref) {
|
|
|
37
39
|
url = _ref.url,
|
|
38
40
|
onLoad = _ref.onLoad,
|
|
39
41
|
onError = _ref.onError;
|
|
42
|
+
var ui = (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) ?
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
44
|
+
(0, _flexibleUiContext.useFlexibleUiOptionContext)() : undefined;
|
|
40
45
|
if (!type || !url) {
|
|
41
46
|
return null;
|
|
42
47
|
}
|
|
@@ -48,6 +53,7 @@ var MediaElement = function MediaElement(_ref) {
|
|
|
48
53
|
,
|
|
49
54
|
className: (0, _runtime.ax)(["_1h1tcq2i _1e0c1txw _1bsb1osq _4t3i1ns9 _jqez1osq _1lg71osq _6slq1osq _x1m21osq _1chb1osq _1usb1osq _5c331osq _l9z01osq _6o691dfr _vr2g1dfr _173baqso _1niwaqso _t0h9stnw _1ulbstnw _byj21ooe _3hvr1ooe _1c0s1ssb _15j31ssb _1npy1ssb _19he1ssb _n3vc1wug _1qj91wug _4fdy1wug _18cv1wug _1aoq15vq _1iqz15vq _6fioj63w _l0jmidpf _12zuh2mm", className])
|
|
50
55
|
}, /*#__PURE__*/React.createElement(_imageIcon.default, {
|
|
56
|
+
hideLoadingSkeleton: ui === null || ui === void 0 ? void 0 : ui.hideLoadingSkeleton,
|
|
51
57
|
testId: "".concat(testId, "-image"),
|
|
52
58
|
url: url,
|
|
53
59
|
onError: onError,
|
|
@@ -29,7 +29,7 @@ var Icon = exports.Icon = (0, _react.forwardRef)(function (_ref, __cmplr) {
|
|
|
29
29
|
return /*#__PURE__*/_react.default.createElement(C, (0, _extends2.default)({}, __cmplp, {
|
|
30
30
|
style: __cmpls,
|
|
31
31
|
ref: __cmplr,
|
|
32
|
-
className: (0, _runtime.ax)(["
|
|
32
|
+
className: (0, _runtime.ax)(["_2rkolb4i _4t3i7vkz _1bsb7vkz _2hwx1b66 _uiztglyw _kqswstnw _154i1ssb _1ltv1ssb _t9ec1ooe", __cmplp.className])
|
|
33
33
|
}));
|
|
34
34
|
});
|
|
35
35
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
._11c81o8v{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
.
|
|
2
|
+
._2rko1twn{border-radius:var(--ds-border-radius-circle,9999px)}
|
|
3
3
|
._2rkogqwt{border-radius:var(--ds-border-radius-050,2px)}
|
|
4
|
-
.
|
|
4
|
+
._2rkolb4i{border-radius:var(--ds-radius-xsmall,2px)}
|
|
5
5
|
._154i1ssb{top:50%}
|
|
6
6
|
._16d9qvcn{-webkit-box-decoration-break:clone;box-decoration-break:clone}
|
|
7
7
|
._18u01b66{margin-left:var(--ds-space-050,4px)}
|
|
@@ -10,6 +10,7 @@ exports.IconTitleWrapper = exports.IconAndTitleLayout = void 0;
|
|
|
10
10
|
require("./index.compiled.css");
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
16
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
@@ -17,6 +18,7 @@ var _reactRenderImage = _interopRequireDefault(require("react-render-image"));
|
|
|
17
18
|
var _link = _interopRequireDefault(require("@atlaskit/icon/core/migration/link"));
|
|
18
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
20
|
var _colors = require("@atlaskit/theme/colors");
|
|
21
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
22
|
var _utils = require("../../../utils");
|
|
21
23
|
var _Icon = require("../Icon");
|
|
22
24
|
var _excluded = ["as", "style"];
|
|
@@ -29,7 +31,7 @@ var styles = {
|
|
|
29
31
|
iconTitleWrapperStyle: "_o5721jtm _1nmz9jpi _16d9qvcn _ca0qv77o _u5f31b66 _n3tdv77o _19bv1b66",
|
|
30
32
|
linkStyle: "_2rkogqwt",
|
|
31
33
|
noLinkAppearanceStyle: "_syaz131l _18u01b66",
|
|
32
|
-
roundImageStyle: "
|
|
34
|
+
roundImageStyle: "_2rko1twn"
|
|
33
35
|
};
|
|
34
36
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled,@atlaskit/design-system/no-html-anchor -- Ignored via go/DSP-18766
|
|
35
37
|
var LinkAppearance = (0, _react.forwardRef)(function (_ref, __cmplr) {
|
|
@@ -59,7 +61,12 @@ var IconAndTitleLayout = exports.IconAndTitleLayout = function IconAndTitleLayou
|
|
|
59
61
|
rightSide = _ref2.rightSide,
|
|
60
62
|
_ref2$testId = _ref2.testId,
|
|
61
63
|
testId = _ref2$testId === void 0 ? 'inline-card-icon-and-title' : _ref2$testId,
|
|
62
|
-
type = _ref2.type
|
|
64
|
+
type = _ref2.type,
|
|
65
|
+
hideIconLoadingSkeleton = _ref2.hideIconLoadingSkeleton;
|
|
66
|
+
var _useState = (0, _react.useState)(false),
|
|
67
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
68
|
+
hasImageErrored = _useState2[0],
|
|
69
|
+
setHasImageErrored = _useState2[1];
|
|
63
70
|
var renderAtlaskitIcon = _react.default.useCallback(function () {
|
|
64
71
|
if (emoji) {
|
|
65
72
|
return emoji;
|
|
@@ -74,6 +81,20 @@ var IconAndTitleLayout = exports.IconAndTitleLayout = function IconAndTitleLayou
|
|
|
74
81
|
if (!icon || typeof icon !== 'string') {
|
|
75
82
|
return null;
|
|
76
83
|
}
|
|
84
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && hideIconLoadingSkeleton) {
|
|
85
|
+
if (hasImageErrored) {
|
|
86
|
+
return errored;
|
|
87
|
+
}
|
|
88
|
+
return /*#__PURE__*/_react.default.createElement("img", {
|
|
89
|
+
src: icon,
|
|
90
|
+
"data-testid": "".concat(testId, "-image"),
|
|
91
|
+
alt: "",
|
|
92
|
+
onError: function onError() {
|
|
93
|
+
return setHasImageErrored(true);
|
|
94
|
+
},
|
|
95
|
+
className: (0, _runtime.ax)(["_c71l7vkz _p12f7vkz _1bsb1osq", profileType && styles.roundImageStyle])
|
|
96
|
+
});
|
|
97
|
+
}
|
|
77
98
|
return /*#__PURE__*/_react.default.createElement(_reactRenderImage.default, {
|
|
78
99
|
src: icon,
|
|
79
100
|
loaded: /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -87,7 +108,7 @@ var IconAndTitleLayout = exports.IconAndTitleLayout = function IconAndTitleLayou
|
|
|
87
108
|
testId: "".concat(testId, "-loading")
|
|
88
109
|
})
|
|
89
110
|
});
|
|
90
|
-
}, [icon, profileType]);
|
|
111
|
+
}, [icon, profileType, hideIconLoadingSkeleton, hasImageErrored]);
|
|
91
112
|
var renderIconPlaceholder = _react.default.useCallback(function (testId) {
|
|
92
113
|
return defaultIcon || /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
93
114
|
label: "link",
|
|
@@ -141,7 +162,7 @@ var IconAndTitleLayout = exports.IconAndTitleLayout = function IconAndTitleLayou
|
|
|
141
162
|
testId: "icon-empty-wrapper"
|
|
142
163
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
143
164
|
"data-testId": "icon-wrapper",
|
|
144
|
-
className: (0, _runtime.ax)(["_11c81o8v
|
|
165
|
+
className: (0, _runtime.ax)(["_11c81o8v _2rkolb4i _1e0c116y _kqswstnw _2hwx1b66 _4t3i7vkz _1bsb7vkz _154i1ssb _1ltv1ssb _t9ec1ooe _uiztglyw"])
|
|
145
166
|
}, renderIcon(testId)))), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
146
167
|
as: "span",
|
|
147
168
|
style: {
|
|
@@ -12,6 +12,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
16
|
var _HoverCard = require("../../HoverCard");
|
|
16
17
|
var _inlineLozenge = _interopRequireDefault(require("../common/inline-lozenge"));
|
|
17
18
|
var _Frame = require("../Frame");
|
|
@@ -64,7 +65,8 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
|
|
|
64
65
|
hoverPreviewOptions = _this$props.hoverPreviewOptions,
|
|
65
66
|
actionOptions = _this$props.actionOptions,
|
|
66
67
|
truncateInline = _this$props.truncateInline,
|
|
67
|
-
type = _this$props.type
|
|
68
|
+
type = _this$props.type,
|
|
69
|
+
hideIconLoadingSkeleton = _this$props.hideIconLoadingSkeleton;
|
|
68
70
|
var inlineCardResolvedView = /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
|
|
69
71
|
testId: testId,
|
|
70
72
|
link: link,
|
|
@@ -77,7 +79,8 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
|
|
|
77
79
|
icon: icon,
|
|
78
80
|
title: title,
|
|
79
81
|
titleTextColor: titleTextColor,
|
|
80
|
-
type: type
|
|
82
|
+
type: type,
|
|
83
|
+
hideIconLoadingSkeleton: (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && hideIconLoadingSkeleton
|
|
81
84
|
}), this.renderLozenge());
|
|
82
85
|
if (showHoverPreview && link) {
|
|
83
86
|
return /*#__PURE__*/_react.default.createElement(_HoverCard.HoverCard, {
|
|
@@ -42,6 +42,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
42
42
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
43
43
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
44
44
|
var _loadHold = _interopRequireDefault(require("@atlaskit/react-ufo/load-hold"));
|
|
45
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
45
46
|
var _constants = require("../../constants");
|
|
46
47
|
var _extractAccessContext = require("../../extractors/common/context/extractAccessContext");
|
|
47
48
|
var _inline = require("../../extractors/inline");
|
|
@@ -82,7 +83,8 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref2) {
|
|
|
82
83
|
actionOptions = _ref2.actionOptions,
|
|
83
84
|
removeTextHighlightingFromTitle = _ref2.removeTextHighlightingFromTitle,
|
|
84
85
|
resolvingPlaceholder = _ref2.resolvingPlaceholder,
|
|
85
|
-
truncateInline = _ref2.truncateInline
|
|
86
|
+
truncateInline = _ref2.truncateInline,
|
|
87
|
+
hideIconLoadingSkeleton = _ref2.hideIconLoadingSkeleton;
|
|
86
88
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
87
89
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
88
90
|
var status = cardState.status,
|
|
@@ -135,7 +137,8 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref2) {
|
|
|
135
137
|
isHovered: isHovered,
|
|
136
138
|
onClick: handleFrameClick,
|
|
137
139
|
testId: testIdWithStatus,
|
|
138
|
-
truncateInline: truncateInline
|
|
140
|
+
truncateInline: truncateInline,
|
|
141
|
+
hideIconLoadingSkeleton: (0, _expValEquals.expValEquals)('platform_editor_smart_card_otp', 'isEnabled', true) && hideIconLoadingSkeleton
|
|
139
142
|
}));
|
|
140
143
|
case 'unauthorized':
|
|
141
144
|
var provider = (0, _linkExtractors.extractSmartLinkProvider)(details);
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "40.
|
|
22
|
+
packageVersion: "40.14.0",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "40.
|
|
5
|
+
packageVersion: "40.14.0"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import { useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
10
|
import { ActionName, ElementName, SmartLinkPosition } from '../../../constants';
|
|
10
11
|
import FlexibleCard from '../../FlexibleCard';
|
|
11
12
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
|
|
@@ -59,6 +60,9 @@ const ResolvedView = ({
|
|
|
59
60
|
if (fg('cc-ai-linking-platform-snippet-renderer')) {
|
|
60
61
|
uiOptions.enableSnippetRenderer = true;
|
|
61
62
|
}
|
|
63
|
+
if (expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
64
|
+
uiOptions.hideLoadingSkeleton = hideIconLoadingSkeleton;
|
|
65
|
+
}
|
|
62
66
|
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
63
67
|
appearance: "block",
|
|
64
68
|
cardState: cardState,
|
|
@@ -274,7 +274,8 @@ function Component({
|
|
|
274
274
|
actionOptions: actionOptions,
|
|
275
275
|
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle,
|
|
276
276
|
resolvingPlaceholder: resolvingPlaceholder,
|
|
277
|
-
truncateInline: truncateInline
|
|
277
|
+
truncateInline: truncateInline,
|
|
278
|
+
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
278
279
|
});
|
|
279
280
|
case 'block':
|
|
280
281
|
return /*#__PURE__*/React.createElement(BlockCard, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._2rko1twn{border-radius:var(--ds-border-radius-circle,9999px)}
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "./index.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
-
import { useCallback,
|
|
6
|
+
import { useCallback, useLayoutEffect, useState } from 'react';
|
|
7
7
|
import { MediaPlacement } from '../../../../../../constants';
|
|
8
8
|
import { Preview } from '../../../elements';
|
|
9
9
|
import Block from '../../block';
|
|
@@ -52,7 +52,10 @@ const PreviewBlockResolvedView = ({
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}, [ignoreContainerPadding, placement, style]);
|
|
55
|
-
|
|
55
|
+
|
|
56
|
+
// Should be useLayoutEffect to avoid flicker.
|
|
57
|
+
// Styles should be set before paint.
|
|
58
|
+
useLayoutEffect(() => {
|
|
56
59
|
updateStyles();
|
|
57
60
|
}, [ignoreContainerPadding, placement, updateStyles, className]);
|
|
58
61
|
const handleOnLoad = useCallback(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._2rko1twn{border-radius:var(--ds-border-radius-circle,9999px)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
.
|
|
2
|
+
._2rkolb4i{border-radius:var(--ds-radius-xsmall,2px)}._12vemgnk{background-repeat:no-repeat}
|
|
3
3
|
._1e0c1o8l{display:inline-block}
|
|
4
4
|
._1itkvl7m{background-image:linear-gradient(to right,transparent 0,var(--ds-skeleton,#edeef1) 20%,transparent 40%,transparent 100%)}
|
|
5
5
|
._1lrw6rms{background-size:280% 100%}
|
|
@@ -15,6 +15,6 @@ export const LoadingSkeleton = ({
|
|
|
15
15
|
width,
|
|
16
16
|
height
|
|
17
17
|
},
|
|
18
|
-
className: ax(["
|
|
18
|
+
className: ax(["_2rkolb4i _uiztglyw _bfhk178v _1itkvl7m _12vemgnk _1lrw6rms _1e0c1o8l _5sag9cwz _1o51q7pw _tip812c5 _j7hqqkar _1pglp3kn"])
|
|
19
19
|
});
|
|
20
20
|
};
|
package/dist/es2019/view/FlexibleCard/components/elements/common/base-badge-element/index.js
CHANGED
|
@@ -4,8 +4,10 @@ import "./index.compiled.css";
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
import { IconType } from '../../../../../../constants';
|
|
8
9
|
import { messages } from '../../../../../../messages';
|
|
10
|
+
import { useFlexibleUiOptionContext } from '../../../../../../state/flexible-ui-context';
|
|
9
11
|
import AtlaskitIcon from '../../../common/atlaskit-icon';
|
|
10
12
|
import ImageIcon from '../../../common/image-icon';
|
|
11
13
|
import { withOverrideCss } from '../../../common/with-override-css';
|
|
@@ -51,11 +53,12 @@ const renderAtlaskitIcon = (icon, testId) => {
|
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
|
-
const renderImageIcon = (url, testId) => {
|
|
56
|
+
const renderImageIcon = (url, testId, hideLoadingSkeleton) => {
|
|
55
57
|
if (url) {
|
|
56
58
|
return /*#__PURE__*/React.createElement(ImageIcon, {
|
|
57
59
|
testId: testId,
|
|
58
|
-
url: url
|
|
60
|
+
url: url,
|
|
61
|
+
hideLoadingSkeleton: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && hideLoadingSkeleton
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
};
|
|
@@ -82,8 +85,11 @@ const BaseBadgeRefreshNew = /*#__PURE__*/forwardRef(({
|
|
|
82
85
|
url,
|
|
83
86
|
color
|
|
84
87
|
}, ref) => {
|
|
88
|
+
const ui = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) ?
|
|
89
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
90
|
+
useFlexibleUiOptionContext() : undefined;
|
|
85
91
|
const formattedMessageOrLabel = getFormattedMessageFromIcon(icon) || label;
|
|
86
|
-
const badgeIcon = renderAtlaskitIcon(icon, testId) || renderImageIcon(url, testId);
|
|
92
|
+
const badgeIcon = renderAtlaskitIcon(icon, testId) || renderImageIcon(url, testId, ui === null || ui === void 0 ? void 0 : ui.hideLoadingSkeleton);
|
|
87
93
|
if (!formattedMessageOrLabel || !badgeIcon) {
|
|
88
94
|
return null;
|
|
89
95
|
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
|
+
import { useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
5
7
|
import ImageIcon from '../../common/image-icon';
|
|
6
8
|
/**
|
|
7
9
|
* Media: Image
|
|
@@ -28,6 +30,9 @@ const MediaElement = ({
|
|
|
28
30
|
onLoad,
|
|
29
31
|
onError
|
|
30
32
|
}) => {
|
|
33
|
+
const ui = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) ?
|
|
34
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
35
|
+
useFlexibleUiOptionContext() : undefined;
|
|
31
36
|
if (!type || !url) {
|
|
32
37
|
return null;
|
|
33
38
|
}
|
|
@@ -39,6 +44,7 @@ const MediaElement = ({
|
|
|
39
44
|
,
|
|
40
45
|
className: ax(["_1h1tcq2i _1e0c1txw _1bsb1osq _4t3i1ns9 _jqez1osq _1lg71osq _6slq1osq _x1m21osq _1chb1osq _1usb1osq _5c331osq _l9z01osq _6o691dfr _vr2g1dfr _173baqso _1niwaqso _t0h9stnw _1ulbstnw _byj21ooe _3hvr1ooe _1c0s1ssb _15j31ssb _1npy1ssb _19he1ssb _n3vc1wug _1qj91wug _4fdy1wug _18cv1wug _1aoq15vq _1iqz15vq _6fioj63w _l0jmidpf _12zuh2mm", className])
|
|
41
46
|
}, /*#__PURE__*/React.createElement(ImageIcon, {
|
|
47
|
+
hideLoadingSkeleton: ui === null || ui === void 0 ? void 0 : ui.hideLoadingSkeleton,
|
|
42
48
|
testId: `${testId}-image`,
|
|
43
49
|
url: url,
|
|
44
50
|
onError: onError,
|
|
@@ -19,7 +19,7 @@ export const Icon = forwardRef(({
|
|
|
19
19
|
return /*#__PURE__*/React.createElement(C, _extends({}, __cmplp, {
|
|
20
20
|
style: __cmpls,
|
|
21
21
|
ref: __cmplr,
|
|
22
|
-
className: ax(["
|
|
22
|
+
className: ax(["_2rkolb4i _4t3i7vkz _1bsb7vkz _2hwx1b66 _uiztglyw _kqswstnw _154i1ssb _1ltv1ssb _t9ec1ooe", __cmplp.className])
|
|
23
23
|
}));
|
|
24
24
|
});
|
|
25
25
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
._11c81o8v{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
.
|
|
2
|
+
._2rko1twn{border-radius:var(--ds-border-radius-circle,9999px)}
|
|
3
3
|
._2rkogqwt{border-radius:var(--ds-border-radius-050,2px)}
|
|
4
|
-
.
|
|
4
|
+
._2rkolb4i{border-radius:var(--ds-radius-xsmall,2px)}
|
|
5
5
|
._154i1ssb{top:50%}
|
|
6
6
|
._16d9qvcn{-webkit-box-decoration-break:clone;box-decoration-break:clone}
|
|
7
7
|
._18u01b66{margin-left:var(--ds-space-050,4px)}
|