@atlaskit/smart-card 46.19.1 → 46.19.5
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 +31 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +71 -21
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +5 -12
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +1 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +68 -20
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +5 -10
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +1 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +70 -20
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +5 -12
- package/dist/esm/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +1 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.d.ts +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 46.19.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`90e0787d8eeb7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/90e0787d8eeb7) -
|
|
8
|
+
Removed the `platform_smart_link_preview_a11y_label` feature gate. Smart Link preview controls
|
|
9
|
+
include the resource title in their accessible names when a title is available.
|
|
10
|
+
|
|
11
|
+
## 46.19.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`be79f728fefbf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be79f728fefbf) -
|
|
16
|
+
Preserve inherited embed dimensions for cached lazy Smart Links. With
|
|
17
|
+
`platform_smartlink_render_settled_link_on_mount` on, observe the loader and retain the
|
|
18
|
+
placeholder wrapper for consumer styling. With the gate off, use the original placeholder observer
|
|
19
|
+
and render the card after intersection.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 46.19.3
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
28
|
+
## 46.19.2
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
|
|
3
34
|
## 46.19.1
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
@@ -25,7 +25,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
25
25
|
var context = exports.context = {
|
|
26
26
|
componentName: 'smart-cards',
|
|
27
27
|
packageName: "@atlaskit/smart-card" || '',
|
|
28
|
-
packageVersion: "46.19.
|
|
28
|
+
packageVersion: "46.19.4" || ''
|
|
29
29
|
};
|
|
30
30
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
31
31
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.LazyIntersectionObserverCard =
|
|
8
|
+
exports.LazyIntersectionObserverCard = LazyIntersectionObserverCard;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -22,7 +22,13 @@ var _LoadingCardLink = require("./LoadingCardLink");
|
|
|
22
22
|
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); }
|
|
23
23
|
/** Statuses that came from a resolver response, so the card can show them again without loading. */
|
|
24
24
|
var SETTLED_STATUSES = new Set(['resolved', 'unauthorized', 'forbidden', 'not_found']);
|
|
25
|
-
|
|
25
|
+
function LazyIntersectionObserverCard(props) {
|
|
26
|
+
if ((0, _fg.fg)('platform_smartlink_render_settled_link_on_mount')) {
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(LazyCardWithSettledRender, props);
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(LegacyLazyCard, props);
|
|
30
|
+
}
|
|
31
|
+
function LazyCardWithSettledRender(props) {
|
|
26
32
|
var _useState = (0, _react.useState)(false),
|
|
27
33
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
34
|
isIntersected = _useState2[0],
|
|
@@ -43,7 +49,7 @@ var LazyIntersectionObserverCard = exports.LazyIntersectionObserverCard = functi
|
|
|
43
49
|
var _useState5 = (0, _react.useState)(function () {
|
|
44
50
|
var _store$getState$url;
|
|
45
51
|
var status = store === null || store === void 0 || (_store$getState$url = store.getState()[url]) === null || _store$getState$url === void 0 ? void 0 : _store$getState$url.status;
|
|
46
|
-
var settled = !!status && SETTLED_STATUSES.has(status)
|
|
52
|
+
var settled = !!status && SETTLED_STATUSES.has(status);
|
|
47
53
|
if (settled && shouldSendRenderedUFOEvent) {
|
|
48
54
|
(0, _startUfoExperience.startUfoExperience)('smart-link-rendered', id);
|
|
49
55
|
}
|
|
@@ -52,7 +58,9 @@ var LazyIntersectionObserverCard = exports.LazyIntersectionObserverCard = functi
|
|
|
52
58
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 1),
|
|
53
59
|
isSettledOnMount = _useState6[0];
|
|
54
60
|
var prefetch = (0, _usePrefetch.usePrefetch)(url, appearance);
|
|
55
|
-
|
|
61
|
+
// Redundant for observation, but kept because many consumer styles depend on
|
|
62
|
+
// the placeholder wrapper's DOM hierarchy.
|
|
63
|
+
var PlaceholderWrapper = appearance === 'inline' ? 'span' : 'div';
|
|
56
64
|
var _useSmartLinkSeenEven = (0, _useSmartLinkSeenEvent.useSmartLinkSeenEvent)({
|
|
57
65
|
appearance: appearance,
|
|
58
66
|
children: children,
|
|
@@ -82,23 +90,65 @@ var LazyIntersectionObserverCard = exports.LazyIntersectionObserverCard = functi
|
|
|
82
90
|
var ref = (0, _useIntersectionObserver.default)({
|
|
83
91
|
onIntersection: onIntersection
|
|
84
92
|
});
|
|
85
|
-
var content
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
var content = isSettledOnMount || isIntersected ? /*#__PURE__*/_react.default.createElement(_component.CardWithUrlContent, (0, _extends2.default)({}, props, {
|
|
94
|
+
onError: onError
|
|
95
|
+
})) : /*#__PURE__*/_react.default.createElement(PlaceholderWrapper, null, /*#__PURE__*/_react.default.createElement(_LoadingCardLink.LoadingCardLink, props));
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(_cardLoaderWrapper.default, {
|
|
97
|
+
appearance: appearance,
|
|
98
|
+
ref: ref
|
|
99
|
+
}, content);
|
|
100
|
+
}
|
|
101
|
+
function LegacyLazyCard(props) {
|
|
102
|
+
var _useState7 = (0, _react.useState)(false),
|
|
103
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
104
|
+
isIntersected = _useState8[0],
|
|
105
|
+
setIsIntersected = _useState8[1];
|
|
106
|
+
var _useState9 = (0, _react.useState)((0, _shouldSample.shouldSample)()),
|
|
107
|
+
_useState0 = (0, _slicedToArray2.default)(_useState9, 1),
|
|
108
|
+
shouldSendRenderedUFOEvent = _useState0[0];
|
|
109
|
+
var appearance = props.appearance,
|
|
110
|
+
children = props.children,
|
|
111
|
+
id = props.id,
|
|
112
|
+
onErrorCallback = props.onError,
|
|
113
|
+
ui = props.ui,
|
|
114
|
+
url = props.url;
|
|
115
|
+
var prefetch = (0, _usePrefetch.usePrefetch)(url, appearance);
|
|
116
|
+
var ComponentObserver = appearance === 'inline' ? 'span' : 'div';
|
|
117
|
+
var _useSmartLinkSeenEven2 = (0, _useSmartLinkSeenEvent.useSmartLinkSeenEvent)({
|
|
118
|
+
appearance: appearance,
|
|
119
|
+
children: children,
|
|
120
|
+
id: id,
|
|
121
|
+
ui: ui,
|
|
122
|
+
url: url
|
|
123
|
+
}),
|
|
124
|
+
onSeenIntersecting = _useSmartLinkSeenEven2.onIntersecting,
|
|
125
|
+
onStatusSettled = _useSmartLinkSeenEven2.onStatusSettled;
|
|
126
|
+
var onError = (0, _react.useCallback)(function (data) {
|
|
127
|
+
if (data !== null && data !== void 0 && data.status) {
|
|
128
|
+
onStatusSettled(data.status);
|
|
129
|
+
}
|
|
130
|
+
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback(data);
|
|
131
|
+
}, [onStatusSettled, onErrorCallback]);
|
|
132
|
+
var onIntersection = (0, _react.useCallback)(function (isIntersecting) {
|
|
133
|
+
if (isIntersecting) {
|
|
134
|
+
if (shouldSendRenderedUFOEvent) {
|
|
135
|
+
(0, _startUfoExperience.startUfoExperience)('smart-link-rendered', id);
|
|
136
|
+
}
|
|
137
|
+
onSeenIntersecting();
|
|
138
|
+
setIsIntersected(true);
|
|
139
|
+
} else {
|
|
140
|
+
prefetch();
|
|
141
|
+
}
|
|
142
|
+
}, [id, onSeenIntersecting, prefetch, shouldSendRenderedUFOEvent]);
|
|
143
|
+
var ref = (0, _useIntersectionObserver.default)({
|
|
144
|
+
onIntersection: onIntersection
|
|
145
|
+
});
|
|
146
|
+
var content = isIntersected ? /*#__PURE__*/_react.default.createElement(_component.CardWithUrlContent, (0, _extends2.default)({}, props, {
|
|
147
|
+
onError: onError
|
|
148
|
+
})) : /*#__PURE__*/_react.default.createElement(ComponentObserver, {
|
|
149
|
+
ref: ref
|
|
150
|
+
}, /*#__PURE__*/_react.default.createElement(_LoadingCardLink.LoadingCardLink, props));
|
|
101
151
|
return /*#__PURE__*/_react.default.createElement(_cardLoaderWrapper.default, {
|
|
102
152
|
appearance: appearance
|
|
103
153
|
}, content);
|
|
104
|
-
}
|
|
154
|
+
}
|
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("./index.compiled.css");
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
13
|
var _react2 = require("@compiled/react");
|
|
15
14
|
var _button = _interopRequireDefault(require("@atlaskit/button/default/button"));
|
|
@@ -17,7 +16,6 @@ var _button2 = _interopRequireDefault(require("@atlaskit/button/icon/button"));
|
|
|
17
16
|
var _link = _interopRequireDefault(require("@atlaskit/button/icon/link"));
|
|
18
17
|
var _link2 = _interopRequireDefault(require("@atlaskit/button/link"));
|
|
19
18
|
var _loadingButton = _interopRequireDefault(require("@atlaskit/button/loading-button"));
|
|
20
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
21
19
|
var _box = require("@atlaskit/primitives/compiled/box");
|
|
22
20
|
var _Tooltip = _interopRequireDefault(require("@atlaskit/tooltip/Tooltip"));
|
|
23
21
|
var _constants = require("../../../../../../constants");
|
|
@@ -27,8 +25,6 @@ var _useRovoConfig2 = _interopRequireDefault(require("../../../../../../state/ho
|
|
|
27
25
|
var _withOverrideCss = require("../../../common/with-override-css");
|
|
28
26
|
var _utils = require("../../../utils");
|
|
29
27
|
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); }
|
|
30
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
28
|
var IconOnlyLarge = null;
|
|
33
29
|
var SizeSmall = null;
|
|
34
30
|
var styles = {
|
|
@@ -54,9 +50,6 @@ var ButtonAppearanceMap = {
|
|
|
54
50
|
'subtle-link': 'subtle',
|
|
55
51
|
warning: 'warning'
|
|
56
52
|
};
|
|
57
|
-
var tooltipOptions = {
|
|
58
|
-
hideTooltipOnClick: true
|
|
59
|
-
};
|
|
60
53
|
var ActionButtonRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
61
54
|
var _context$actions;
|
|
62
55
|
var _ref$appearance = _ref.appearance,
|
|
@@ -73,7 +66,6 @@ var ActionButtonRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
73
66
|
href = _ref.href,
|
|
74
67
|
ariaLabel = _ref.ariaLabel;
|
|
75
68
|
var iconOnly = !content;
|
|
76
|
-
var isPreviewA11yLabelEnabled = (0, _fg.fg)('platform_smart_link_preview_a11y_label');
|
|
77
69
|
var context = (0, _useFlexibleUiContext.useFlexibleUiContext)();
|
|
78
70
|
var _useRovoConfig = (0, _useRovoConfig2.default)(),
|
|
79
71
|
product = _useRovoConfig.product;
|
|
@@ -92,10 +84,11 @@ var ActionButtonRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
92
84
|
return icon;
|
|
93
85
|
} : undefined;
|
|
94
86
|
if (iconOnly && iconFn) {
|
|
95
|
-
var label =
|
|
96
|
-
var tooltip =
|
|
87
|
+
var label = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : tooltipMessage;
|
|
88
|
+
var tooltip = {
|
|
89
|
+
hideTooltipOnClick: true,
|
|
97
90
|
content: tooltipMessage
|
|
98
|
-
}
|
|
91
|
+
};
|
|
99
92
|
if (isLinkButton && iconFn) {
|
|
100
93
|
return /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
101
94
|
appearance: IconButtonAppearanceMap[appearance],
|
|
@@ -161,7 +154,7 @@ var ActionButtonRefresh = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
161
154
|
spacing: spacing,
|
|
162
155
|
testId: testId
|
|
163
156
|
}, content));
|
|
164
|
-
}, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading,
|
|
157
|
+
}, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading, onButtonClick, onClick, size, testId, tooltipMessage]);
|
|
165
158
|
return /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
166
159
|
testId: "".concat(testId, "-button-wrapper"),
|
|
167
160
|
ref: ref,
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _dropdownItem = require("@atlaskit/dropdown-menu/dropdown-item");
|
|
10
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
11
10
|
var _handleOnClick = require("../../../../../../utils/handle-on-click");
|
|
12
11
|
var ActionDropdownItem = function ActionDropdownItem(_ref) {
|
|
13
12
|
var ariaLabel = _ref.ariaLabel,
|
|
@@ -18,7 +17,7 @@ var ActionDropdownItem = function ActionDropdownItem(_ref) {
|
|
|
18
17
|
onClick = _ref.onClick,
|
|
19
18
|
testId = _ref.testId;
|
|
20
19
|
return /*#__PURE__*/_react.default.createElement(_dropdownItem.DropdownItem, {
|
|
21
|
-
"aria-label":
|
|
20
|
+
"aria-label": ariaLabel,
|
|
22
21
|
elemAfter: iconAfter,
|
|
23
22
|
elemBefore: iconBefore,
|
|
24
23
|
isDisabled: isLoading,
|
|
@@ -12,7 +12,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _reactIntl = require("react-intl");
|
|
13
13
|
var _growDiagonal = _interopRequireDefault(require("@atlaskit/icon/core/grow-diagonal"));
|
|
14
14
|
var _panelRight = _interopRequireDefault(require("@atlaskit/icon/core/panel-right"));
|
|
15
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
16
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
var _constants = require("../../../../../constants");
|
|
18
17
|
var _messages = require("../../../../../messages");
|
|
@@ -74,7 +73,7 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
74
73
|
} else if (actionLabel === _messages.messages.preview_modal) {
|
|
75
74
|
actionLabelWithTitle = _messages.messages.preview_modal_with_title;
|
|
76
75
|
}
|
|
77
|
-
var ariaLabel =
|
|
76
|
+
var ariaLabel = title ? intl.formatMessage(actionLabelWithTitle, {
|
|
78
77
|
title: title
|
|
79
78
|
}) : actionMessage;
|
|
80
79
|
return data ? /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
@@ -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: "46.19.
|
|
22
|
+
packageVersion: "46.19.4",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "46.19.
|
|
7
|
+
packageVersion: "46.19.4" || ''
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -13,7 +13,13 @@ import { LoadingCardLink } from './LoadingCardLink';
|
|
|
13
13
|
|
|
14
14
|
/** Statuses that came from a resolver response, so the card can show them again without loading. */
|
|
15
15
|
const SETTLED_STATUSES = new Set(['resolved', 'unauthorized', 'forbidden', 'not_found']);
|
|
16
|
-
export
|
|
16
|
+
export function LazyIntersectionObserverCard(props) {
|
|
17
|
+
if (fg('platform_smartlink_render_settled_link_on_mount')) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(LazyCardWithSettledRender, props);
|
|
19
|
+
}
|
|
20
|
+
return /*#__PURE__*/React.createElement(LegacyLazyCard, props);
|
|
21
|
+
}
|
|
22
|
+
function LazyCardWithSettledRender(props) {
|
|
17
23
|
const [isIntersected, setIsIntersected] = useState(false);
|
|
18
24
|
const [shouldSendRenderedUFOEvent] = useState(shouldSample());
|
|
19
25
|
const {
|
|
@@ -32,14 +38,16 @@ export const LazyIntersectionObserverCard = props => {
|
|
|
32
38
|
const [isSettledOnMount] = useState(() => {
|
|
33
39
|
var _store$getState$url;
|
|
34
40
|
const status = store === null || store === void 0 ? void 0 : (_store$getState$url = store.getState()[url]) === null || _store$getState$url === void 0 ? void 0 : _store$getState$url.status;
|
|
35
|
-
const settled = !!status && SETTLED_STATUSES.has(status)
|
|
41
|
+
const settled = !!status && SETTLED_STATUSES.has(status);
|
|
36
42
|
if (settled && shouldSendRenderedUFOEvent) {
|
|
37
43
|
startUfoExperience('smart-link-rendered', id);
|
|
38
44
|
}
|
|
39
45
|
return settled;
|
|
40
46
|
});
|
|
41
47
|
const prefetch = usePrefetch(url, appearance);
|
|
42
|
-
|
|
48
|
+
// Redundant for observation, but kept because many consumer styles depend on
|
|
49
|
+
// the placeholder wrapper's DOM hierarchy.
|
|
50
|
+
const PlaceholderWrapper = appearance === 'inline' ? 'span' : 'div';
|
|
43
51
|
const {
|
|
44
52
|
onIntersecting: onSeenIntersecting,
|
|
45
53
|
onStatusSettled
|
|
@@ -70,23 +78,63 @@ export const LazyIntersectionObserverCard = props => {
|
|
|
70
78
|
const ref = useIntersectionObserver({
|
|
71
79
|
onIntersection
|
|
72
80
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
const content = isSettledOnMount || isIntersected ? /*#__PURE__*/React.createElement(CardWithUrlContent, _extends({}, props, {
|
|
82
|
+
onError: onError
|
|
83
|
+
})) : /*#__PURE__*/React.createElement(PlaceholderWrapper, null, /*#__PURE__*/React.createElement(LoadingCardLink, props));
|
|
84
|
+
return /*#__PURE__*/React.createElement(CardLoaderWrapper, {
|
|
85
|
+
appearance: appearance,
|
|
86
|
+
ref: ref
|
|
87
|
+
}, content);
|
|
88
|
+
}
|
|
89
|
+
function LegacyLazyCard(props) {
|
|
90
|
+
const [isIntersected, setIsIntersected] = useState(false);
|
|
91
|
+
const [shouldSendRenderedUFOEvent] = useState(shouldSample());
|
|
92
|
+
const {
|
|
93
|
+
appearance,
|
|
94
|
+
children,
|
|
95
|
+
id,
|
|
96
|
+
onError: onErrorCallback,
|
|
97
|
+
ui,
|
|
98
|
+
url
|
|
99
|
+
} = props;
|
|
100
|
+
const prefetch = usePrefetch(url, appearance);
|
|
101
|
+
const ComponentObserver = appearance === 'inline' ? 'span' : 'div';
|
|
102
|
+
const {
|
|
103
|
+
onIntersecting: onSeenIntersecting,
|
|
104
|
+
onStatusSettled
|
|
105
|
+
} = useSmartLinkSeenEvent({
|
|
106
|
+
appearance,
|
|
107
|
+
children,
|
|
108
|
+
id,
|
|
109
|
+
ui,
|
|
110
|
+
url
|
|
111
|
+
});
|
|
112
|
+
const onError = useCallback(data => {
|
|
113
|
+
if (data !== null && data !== void 0 && data.status) {
|
|
114
|
+
onStatusSettled(data.status);
|
|
115
|
+
}
|
|
116
|
+
onErrorCallback === null || onErrorCallback === void 0 ? void 0 : onErrorCallback(data);
|
|
117
|
+
}, [onStatusSettled, onErrorCallback]);
|
|
118
|
+
const onIntersection = useCallback(isIntersecting => {
|
|
119
|
+
if (isIntersecting) {
|
|
120
|
+
if (shouldSendRenderedUFOEvent) {
|
|
121
|
+
startUfoExperience('smart-link-rendered', id);
|
|
122
|
+
}
|
|
123
|
+
onSeenIntersecting();
|
|
124
|
+
setIsIntersected(true);
|
|
125
|
+
} else {
|
|
126
|
+
prefetch();
|
|
127
|
+
}
|
|
128
|
+
}, [id, onSeenIntersecting, prefetch, shouldSendRenderedUFOEvent]);
|
|
129
|
+
const ref = useIntersectionObserver({
|
|
130
|
+
onIntersection
|
|
131
|
+
});
|
|
132
|
+
const content = isIntersected ? /*#__PURE__*/React.createElement(CardWithUrlContent, _extends({}, props, {
|
|
133
|
+
onError: onError
|
|
134
|
+
})) : /*#__PURE__*/React.createElement(ComponentObserver, {
|
|
135
|
+
ref: ref
|
|
136
|
+
}, /*#__PURE__*/React.createElement(LoadingCardLink, props));
|
|
89
137
|
return /*#__PURE__*/React.createElement(CardLoaderWrapper, {
|
|
90
138
|
appearance: appearance
|
|
91
139
|
}, content);
|
|
92
|
-
}
|
|
140
|
+
}
|
|
@@ -8,7 +8,6 @@ import IconButton from '@atlaskit/button/icon/button';
|
|
|
8
8
|
import LinkIconButton from '@atlaskit/button/icon/link';
|
|
9
9
|
import LinkButton from '@atlaskit/button/link';
|
|
10
10
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
11
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
13
12
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
14
13
|
import { ActionName, SmartLinkSize } from '../../../../../../constants';
|
|
@@ -42,9 +41,6 @@ const ButtonAppearanceMap = {
|
|
|
42
41
|
'subtle-link': 'subtle',
|
|
43
42
|
warning: 'warning'
|
|
44
43
|
};
|
|
45
|
-
const tooltipOptions = {
|
|
46
|
-
hideTooltipOnClick: true
|
|
47
|
-
};
|
|
48
44
|
const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
|
|
49
45
|
appearance = 'default',
|
|
50
46
|
content,
|
|
@@ -61,7 +57,6 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
|
|
|
61
57
|
}, ref) => {
|
|
62
58
|
var _context$actions;
|
|
63
59
|
const iconOnly = !content;
|
|
64
|
-
const isPreviewA11yLabelEnabled = fg('platform_smart_link_preview_a11y_label');
|
|
65
60
|
const context = useFlexibleUiContext();
|
|
66
61
|
const {
|
|
67
62
|
product
|
|
@@ -77,11 +72,11 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
|
|
|
77
72
|
const icon = iconBefore || iconAfter;
|
|
78
73
|
const iconFn = icon ? () => icon : undefined;
|
|
79
74
|
if (iconOnly && iconFn) {
|
|
80
|
-
const label =
|
|
81
|
-
const tooltip =
|
|
82
|
-
|
|
75
|
+
const label = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : tooltipMessage;
|
|
76
|
+
const tooltip = {
|
|
77
|
+
hideTooltipOnClick: true,
|
|
83
78
|
content: tooltipMessage
|
|
84
|
-
}
|
|
79
|
+
};
|
|
85
80
|
if (isLinkButton && iconFn) {
|
|
86
81
|
return /*#__PURE__*/React.createElement(LinkIconButton, {
|
|
87
82
|
appearance: IconButtonAppearanceMap[appearance],
|
|
@@ -143,7 +138,7 @@ const ActionButtonRefresh = /*#__PURE__*/forwardRef(({
|
|
|
143
138
|
spacing: spacing,
|
|
144
139
|
testId: testId
|
|
145
140
|
}, content));
|
|
146
|
-
}, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading,
|
|
141
|
+
}, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading, onButtonClick, onClick, size, testId, tooltipMessage]);
|
|
147
142
|
return /*#__PURE__*/React.createElement(Box, {
|
|
148
143
|
testId: `${testId}-button-wrapper`,
|
|
149
144
|
ref: ref,
|
package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownItem } from '@atlaskit/dropdown-menu/dropdown-item';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
3
|
import { handleOnClick } from '../../../../../../utils/handle-on-click';
|
|
5
4
|
const ActionDropdownItem = ({
|
|
6
5
|
ariaLabel,
|
|
@@ -11,7 +10,7 @@ const ActionDropdownItem = ({
|
|
|
11
10
|
onClick,
|
|
12
11
|
testId
|
|
13
12
|
}) => /*#__PURE__*/React.createElement(DropdownItem, {
|
|
14
|
-
"aria-label":
|
|
13
|
+
"aria-label": ariaLabel,
|
|
15
14
|
elemAfter: iconAfter,
|
|
16
15
|
elemBefore: iconBefore,
|
|
17
16
|
isDisabled: isLoading,
|
|
@@ -3,7 +3,6 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
3
3
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
4
|
import MediaServicesActualSizeIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
5
5
|
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { ActionName } from '../../../../../constants';
|
|
9
8
|
import { messages } from '../../../../../messages';
|
|
@@ -64,7 +63,7 @@ const PreviewAction = ({
|
|
|
64
63
|
} else if (actionLabel === messages.preview_modal) {
|
|
65
64
|
actionLabelWithTitle = messages.preview_modal_with_title;
|
|
66
65
|
}
|
|
67
|
-
const ariaLabel =
|
|
66
|
+
const ariaLabel = title ? intl.formatMessage(actionLabelWithTitle, {
|
|
68
67
|
title
|
|
69
68
|
}) : actionMessage;
|
|
70
69
|
return data ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "46.19.
|
|
12
|
+
packageVersion: "46.19.4",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "46.19.
|
|
7
|
+
packageVersion: "46.19.4" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -14,7 +14,13 @@ import { LoadingCardLink } from './LoadingCardLink';
|
|
|
14
14
|
|
|
15
15
|
/** Statuses that came from a resolver response, so the card can show them again without loading. */
|
|
16
16
|
var SETTLED_STATUSES = new Set(['resolved', 'unauthorized', 'forbidden', 'not_found']);
|
|
17
|
-
export
|
|
17
|
+
export function LazyIntersectionObserverCard(props) {
|
|
18
|
+
if (fg('platform_smartlink_render_settled_link_on_mount')) {
|
|
19
|
+
return /*#__PURE__*/React.createElement(LazyCardWithSettledRender, props);
|
|
20
|
+
}
|
|
21
|
+
return /*#__PURE__*/React.createElement(LegacyLazyCard, props);
|
|
22
|
+
}
|
|
23
|
+
function LazyCardWithSettledRender(props) {
|
|
18
24
|
var _useState = useState(false),
|
|
19
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
26
|
isIntersected = _useState2[0],
|
|
@@ -35,7 +41,7 @@ export var LazyIntersectionObserverCard = function LazyIntersectionObserverCard(
|
|
|
35
41
|
var _useState5 = useState(function () {
|
|
36
42
|
var _store$getState$url;
|
|
37
43
|
var status = store === null || store === void 0 || (_store$getState$url = store.getState()[url]) === null || _store$getState$url === void 0 ? void 0 : _store$getState$url.status;
|
|
38
|
-
var settled = !!status && SETTLED_STATUSES.has(status)
|
|
44
|
+
var settled = !!status && SETTLED_STATUSES.has(status);
|
|
39
45
|
if (settled && shouldSendRenderedUFOEvent) {
|
|
40
46
|
startUfoExperience('smart-link-rendered', id);
|
|
41
47
|
}
|
|
@@ -44,7 +50,9 @@ export var LazyIntersectionObserverCard = function LazyIntersectionObserverCard(
|
|
|
44
50
|
_useState6 = _slicedToArray(_useState5, 1),
|
|
45
51
|
isSettledOnMount = _useState6[0];
|
|
46
52
|
var prefetch = usePrefetch(url, appearance);
|
|
47
|
-
|
|
53
|
+
// Redundant for observation, but kept because many consumer styles depend on
|
|
54
|
+
// the placeholder wrapper's DOM hierarchy.
|
|
55
|
+
var PlaceholderWrapper = appearance === 'inline' ? 'span' : 'div';
|
|
48
56
|
var _useSmartLinkSeenEven = useSmartLinkSeenEvent({
|
|
49
57
|
appearance: appearance,
|
|
50
58
|
children: children,
|
|
@@ -74,23 +82,65 @@ export var LazyIntersectionObserverCard = function LazyIntersectionObserverCard(
|
|
|
74
82
|
var ref = useIntersectionObserver({
|
|
75
83
|
onIntersection: onIntersection
|
|
76
84
|
});
|
|
77
|
-
var content
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
var content = isSettledOnMount || isIntersected ? /*#__PURE__*/React.createElement(CardWithUrlContent, _extends({}, props, {
|
|
86
|
+
onError: onError
|
|
87
|
+
})) : /*#__PURE__*/React.createElement(PlaceholderWrapper, null, /*#__PURE__*/React.createElement(LoadingCardLink, props));
|
|
88
|
+
return /*#__PURE__*/React.createElement(CardLoaderWrapper, {
|
|
89
|
+
appearance: appearance,
|
|
90
|
+
ref: ref
|
|
91
|
+
}, content);
|
|
92
|
+
}
|
|
93
|
+
function LegacyLazyCard(props) {
|
|
94
|
+
var _useState7 = useState(false),
|
|
95
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
96
|
+
isIntersected = _useState8[0],
|
|
97
|
+
setIsIntersected = _useState8[1];
|
|
98
|
+
var _useState9 = useState(shouldSample()),
|
|
99
|
+
_useState0 = _slicedToArray(_useState9, 1),
|
|
100
|
+
shouldSendRenderedUFOEvent = _useState0[0];
|
|
101
|
+
var appearance = props.appearance,
|
|
102
|
+
children = props.children,
|
|
103
|
+
id = props.id,
|
|
104
|
+
onErrorCallback = props.onError,
|
|
105
|
+
ui = props.ui,
|
|
106
|
+
url = props.url;
|
|
107
|
+
var prefetch = usePrefetch(url, appearance);
|
|
108
|
+
var ComponentObserver = appearance === 'inline' ? 'span' : 'div';
|
|
109
|
+
var _useSmartLinkSeenEven2 = useSmartLinkSeenEvent({
|
|
110
|
+
appearance: appearance,
|
|
111
|
+
children: children,
|
|
112
|
+
id: id,
|
|
113
|
+
ui: ui,
|
|
114
|
+
url: url
|
|
115
|
+
}),
|
|
116
|
+
onSeenIntersecting = _useSmartLinkSeenEven2.onIntersecting,
|
|
117
|
+
onStatusSettled = _useSmartLinkSeenEven2.onStatusSettled;
|
|
118
|
+
var onError = useCallback(function (data) {
|
|
119
|
+
if (data !== null && data !== void 0 && data.status) {
|
|
120
|
+
onStatusSettled(data.status);
|
|
121
|
+
}
|
|
122
|
+
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback(data);
|
|
123
|
+
}, [onStatusSettled, onErrorCallback]);
|
|
124
|
+
var onIntersection = useCallback(function (isIntersecting) {
|
|
125
|
+
if (isIntersecting) {
|
|
126
|
+
if (shouldSendRenderedUFOEvent) {
|
|
127
|
+
startUfoExperience('smart-link-rendered', id);
|
|
128
|
+
}
|
|
129
|
+
onSeenIntersecting();
|
|
130
|
+
setIsIntersected(true);
|
|
131
|
+
} else {
|
|
132
|
+
prefetch();
|
|
133
|
+
}
|
|
134
|
+
}, [id, onSeenIntersecting, prefetch, shouldSendRenderedUFOEvent]);
|
|
135
|
+
var ref = useIntersectionObserver({
|
|
136
|
+
onIntersection: onIntersection
|
|
137
|
+
});
|
|
138
|
+
var content = isIntersected ? /*#__PURE__*/React.createElement(CardWithUrlContent, _extends({}, props, {
|
|
139
|
+
onError: onError
|
|
140
|
+
})) : /*#__PURE__*/React.createElement(ComponentObserver, {
|
|
141
|
+
ref: ref
|
|
142
|
+
}, /*#__PURE__*/React.createElement(LoadingCardLink, props));
|
|
93
143
|
return /*#__PURE__*/React.createElement(CardLoaderWrapper, {
|
|
94
144
|
appearance: appearance
|
|
95
145
|
}, content);
|
|
96
|
-
}
|
|
146
|
+
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v3.0.4 */
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
import "./index.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
4
|
import React, { forwardRef, useCallback, useMemo } from 'react';
|
|
8
5
|
import { cx } from '@compiled/react';
|
|
9
6
|
import Button from '@atlaskit/button/default/button';
|
|
@@ -11,7 +8,6 @@ import IconButton from '@atlaskit/button/icon/button';
|
|
|
11
8
|
import LinkIconButton from '@atlaskit/button/icon/link';
|
|
12
9
|
import LinkButton from '@atlaskit/button/link';
|
|
13
10
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
11
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
16
12
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
17
13
|
import { ActionName, SmartLinkSize } from '../../../../../../constants';
|
|
@@ -45,9 +41,6 @@ var ButtonAppearanceMap = {
|
|
|
45
41
|
'subtle-link': 'subtle',
|
|
46
42
|
warning: 'warning'
|
|
47
43
|
};
|
|
48
|
-
var tooltipOptions = {
|
|
49
|
-
hideTooltipOnClick: true
|
|
50
|
-
};
|
|
51
44
|
var ActionButtonRefresh = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
52
45
|
var _context$actions;
|
|
53
46
|
var _ref$appearance = _ref.appearance,
|
|
@@ -64,7 +57,6 @@ var ActionButtonRefresh = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
64
57
|
href = _ref.href,
|
|
65
58
|
ariaLabel = _ref.ariaLabel;
|
|
66
59
|
var iconOnly = !content;
|
|
67
|
-
var isPreviewA11yLabelEnabled = fg('platform_smart_link_preview_a11y_label');
|
|
68
60
|
var context = useFlexibleUiContext();
|
|
69
61
|
var _useRovoConfig = useRovoConfig(),
|
|
70
62
|
product = _useRovoConfig.product;
|
|
@@ -83,10 +75,11 @@ var ActionButtonRefresh = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
83
75
|
return icon;
|
|
84
76
|
} : undefined;
|
|
85
77
|
if (iconOnly && iconFn) {
|
|
86
|
-
var label =
|
|
87
|
-
var tooltip =
|
|
78
|
+
var label = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : tooltipMessage;
|
|
79
|
+
var tooltip = {
|
|
80
|
+
hideTooltipOnClick: true,
|
|
88
81
|
content: tooltipMessage
|
|
89
|
-
}
|
|
82
|
+
};
|
|
90
83
|
if (isLinkButton && iconFn) {
|
|
91
84
|
return /*#__PURE__*/React.createElement(LinkIconButton, {
|
|
92
85
|
appearance: IconButtonAppearanceMap[appearance],
|
|
@@ -152,7 +145,7 @@ var ActionButtonRefresh = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
152
145
|
spacing: spacing,
|
|
153
146
|
testId: testId
|
|
154
147
|
}, content));
|
|
155
|
-
}, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading,
|
|
148
|
+
}, [appearance, ariaLabel, content, href, iconAfter, iconBefore, iconOnly, isDisabled, isLoading, onButtonClick, onClick, size, testId, tooltipMessage]);
|
|
156
149
|
return /*#__PURE__*/React.createElement(Box, {
|
|
157
150
|
testId: "".concat(testId, "-button-wrapper"),
|
|
158
151
|
ref: ref,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownItem } from '@atlaskit/dropdown-menu/dropdown-item';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
3
|
import { handleOnClick } from '../../../../../../utils/handle-on-click';
|
|
5
4
|
var ActionDropdownItem = function ActionDropdownItem(_ref) {
|
|
6
5
|
var ariaLabel = _ref.ariaLabel,
|
|
@@ -11,7 +10,7 @@ var ActionDropdownItem = function ActionDropdownItem(_ref) {
|
|
|
11
10
|
onClick = _ref.onClick,
|
|
12
11
|
testId = _ref.testId;
|
|
13
12
|
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
14
|
-
"aria-label":
|
|
13
|
+
"aria-label": ariaLabel,
|
|
15
14
|
elemAfter: iconAfter,
|
|
16
15
|
elemBefore: iconBefore,
|
|
17
16
|
isDisabled: isLoading,
|
|
@@ -5,7 +5,6 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
5
5
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
6
6
|
import MediaServicesActualSizeIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
7
7
|
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
8
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
9
|
import { ActionName } from '../../../../../constants';
|
|
11
10
|
import { messages } from '../../../../../messages';
|
|
@@ -65,7 +64,7 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
65
64
|
} else if (actionLabel === messages.preview_modal) {
|
|
66
65
|
actionLabelWithTitle = messages.preview_modal_with_title;
|
|
67
66
|
}
|
|
68
|
-
var ariaLabel =
|
|
67
|
+
var ariaLabel = title ? intl.formatMessage(actionLabelWithTitle, {
|
|
69
68
|
title: title
|
|
70
69
|
}) : actionMessage;
|
|
71
70
|
return data ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "46.19.
|
|
15
|
+
packageVersion: "46.19.4",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardWithUrlContentProps } from '../types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare function LazyIntersectionObserverCard(props: CardWithUrlContentProps): React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "46.19.
|
|
3
|
+
"version": "46.19.5",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/checkbox": "^19.3.0",
|
|
53
53
|
"@atlaskit/css": "^1.1.0",
|
|
54
54
|
"@atlaskit/docs": "^12.3.0",
|
|
55
|
-
"@atlaskit/dropdown-menu": "^
|
|
55
|
+
"@atlaskit/dropdown-menu": "^22.0.0",
|
|
56
56
|
"@atlaskit/embedded-confluence": "^6.4.0",
|
|
57
57
|
"@atlaskit/feature-gate-js-client": "^8.0.0",
|
|
58
58
|
"@atlaskit/flag": "^19.0.0",
|
|
@@ -82,21 +82,21 @@
|
|
|
82
82
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
83
83
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
84
84
|
"@atlaskit/popup": "^10.2.0",
|
|
85
|
-
"@atlaskit/primitives": "^22.
|
|
85
|
+
"@atlaskit/primitives": "^22.8.0",
|
|
86
86
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
87
87
|
"@atlaskit/react-ufo": "^8.5.0",
|
|
88
|
-
"@atlaskit/rovo-triggers": "^12.
|
|
88
|
+
"@atlaskit/rovo-triggers": "^12.17.0",
|
|
89
89
|
"@atlaskit/section-message": "^10.3.0",
|
|
90
90
|
"@atlaskit/select": "^23.2.0",
|
|
91
91
|
"@atlaskit/spinner": "^20.4.0",
|
|
92
92
|
"@atlaskit/tabs": "^21.3.0",
|
|
93
93
|
"@atlaskit/tag": "^17.1.0",
|
|
94
|
-
"@atlaskit/textarea": "^
|
|
94
|
+
"@atlaskit/textarea": "^11.0.0",
|
|
95
95
|
"@atlaskit/textfield": "^11.0.0",
|
|
96
96
|
"@atlaskit/theme": "^28.2.0",
|
|
97
97
|
"@atlaskit/tile": "^5.0.0",
|
|
98
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
99
|
-
"@atlaskit/tokens": "^20.
|
|
98
|
+
"@atlaskit/tmp-editor-statsig": "^266.0.0",
|
|
99
|
+
"@atlaskit/tokens": "^20.14.0",
|
|
100
100
|
"@atlaskit/tooltip": "^24.4.0",
|
|
101
101
|
"@atlaskit/top-layer": "^8.1.0",
|
|
102
102
|
"@atlaskit/ufo": "^2.0.0",
|