@atlaskit/smart-card 43.6.5 → 43.7.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 +14 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/container/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +13 -11
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +3 -2
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +8 -1
- package/dist/cjs/view/InlineCard/Frame/index.js +3 -1
- package/dist/cjs/view/InlineCard/Frame/styled.compiled.css +1 -0
- package/dist/cjs/view/InlineCard/Frame/styled.js +10 -4
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/cjs/view/InlineCard/common/action-button/index.compiled.css +6 -0
- package/dist/cjs/view/InlineCard/common/action-button/index.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/container/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +4 -2
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +3 -2
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +8 -1
- package/dist/es2019/view/InlineCard/Frame/index.js +3 -1
- package/dist/es2019/view/InlineCard/Frame/styled.compiled.css +1 -0
- package/dist/es2019/view/InlineCard/Frame/styled.js +8 -2
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/es2019/view/InlineCard/common/action-button/index.compiled.css +6 -0
- package/dist/es2019/view/InlineCard/common/action-button/index.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/container/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +13 -11
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +3 -2
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +8 -1
- package/dist/esm/view/InlineCard/Frame/index.js +3 -1
- package/dist/esm/view/InlineCard/Frame/styled.compiled.css +1 -0
- package/dist/esm/view/InlineCard/Frame/styled.js +10 -4
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/esm/view/InlineCard/common/action-button/index.compiled.css +6 -0
- package/dist/esm/view/InlineCard/common/action-button/index.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/index.d.ts +5 -1
- package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/types.d.ts +1 -0
- package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +1 -1
- package/dist/types/view/HoverCard/types.d.ts +5 -0
- package/dist/types/view/InlineCard/Frame/index.d.ts +2 -0
- package/dist/types/view/InlineCard/Frame/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/index.d.ts +5 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/types.d.ts +1 -0
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardContent.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +5 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/styled.d.ts +1 -0
- package/package.json +12 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 43.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f14d0a4924e18`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f14d0a4924e18) -
|
|
8
|
+
[ux] Add the design follow ups requested for the blue button on unauthorized smartlinks
|
|
9
|
+
|
|
10
|
+
## 43.7.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`b1b3d2990d636`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b1b3d2990d636) -
|
|
15
|
+
add a new optional render props in HoverPreviewOptions to render a custom component
|
|
16
|
+
|
|
3
17
|
## 43.6.5
|
|
4
18
|
|
|
5
19
|
### 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: "
|
|
14
|
+
packageVersion: "0.0.0-development"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,6 +12,7 @@ require("./index.compiled.css");
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _constants = require("../../../../constants");
|
|
16
17
|
var _flexibleUiContext = require("../../../../state/flexible-ui-context");
|
|
17
18
|
var _utils = require("../../../../state/flexible-ui-context/utils");
|
|
@@ -191,7 +192,7 @@ var Container = function Container(_ref3) {
|
|
|
191
192
|
var _getChildrenOptions = getChildrenOptions(children, context),
|
|
192
193
|
previewOnLeft = _getChildrenOptions.previewOnLeft,
|
|
193
194
|
previewOnRight = _getChildrenOptions.previewOnRight;
|
|
194
|
-
var canShowHoverPreview = showHoverPreview && status === 'resolved';
|
|
195
|
+
var canShowHoverPreview = showHoverPreview && (status === 'resolved' || (hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.render) !== undefined && (0, _platformFeatureFlags.fg)('smart-link-custom-hover-card-content'));
|
|
195
196
|
// `retry` object contains action that can be performed on
|
|
196
197
|
// unresolved link (unauthorized, forbidden, not found, etc.)
|
|
197
198
|
var canShowAuthTooltip = showHoverPreview && status === 'unauthorized' && retry !== undefined;
|
|
@@ -33,7 +33,8 @@ var BaseLozengeElement = function BaseLozengeElement(_ref) {
|
|
|
33
33
|
style = _ref.style,
|
|
34
34
|
text = _ref.text,
|
|
35
35
|
_ref$testId = _ref.testId,
|
|
36
|
-
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId
|
|
36
|
+
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId,
|
|
37
|
+
onAfterChanged = _ref.onAfterChanged;
|
|
37
38
|
var ui = (0, _flexibleUiContext.useFlexibleUiOptionContext)();
|
|
38
39
|
if (!text) {
|
|
39
40
|
return null;
|
|
@@ -43,7 +44,8 @@ var BaseLozengeElement = function BaseLozengeElement(_ref) {
|
|
|
43
44
|
appearance: appearance,
|
|
44
45
|
testId: testId,
|
|
45
46
|
text: text,
|
|
46
|
-
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
47
|
+
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex,
|
|
48
|
+
onAfterChanged: onAfterChanged
|
|
47
49
|
}) : /*#__PURE__*/React.createElement(_lozenge.default, (0, _extends2.default)({
|
|
48
50
|
appearance: appearance
|
|
49
51
|
}, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') ? {
|
|
@@ -41,7 +41,8 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
41
41
|
_ref$testId = _ref.testId,
|
|
42
42
|
testId = _ref$testId === void 0 ? 'smart-element-lozenge-action' : _ref$testId,
|
|
43
43
|
text = _ref.text,
|
|
44
|
-
zIndex = _ref.zIndex
|
|
44
|
+
zIndex = _ref.zIndex,
|
|
45
|
+
onAfterChanged = _ref.onAfterChanged;
|
|
45
46
|
var _useState = (0, _react.useState)({
|
|
46
47
|
appearance: appearance,
|
|
47
48
|
text: text
|
|
@@ -160,7 +161,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
160
161
|
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
161
162
|
updateAction = action === null || action === void 0 ? void 0 : action.update;
|
|
162
163
|
if (!(updateAction && id)) {
|
|
163
|
-
_context2.next =
|
|
164
|
+
_context2.next = 18;
|
|
164
165
|
break;
|
|
165
166
|
}
|
|
166
167
|
setIsLoading(true);
|
|
@@ -168,6 +169,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
168
169
|
_context2.next = 8;
|
|
169
170
|
return invoke(request);
|
|
170
171
|
case 8:
|
|
172
|
+
onAfterChanged === null || onAfterChanged === void 0 || onAfterChanged();
|
|
171
173
|
setSelected({
|
|
172
174
|
appearance: appearance,
|
|
173
175
|
text: text
|
|
@@ -180,16 +182,16 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
180
182
|
smartLinkActionType: _analytics.TrackQuickActionType.StatusUpdate
|
|
181
183
|
});
|
|
182
184
|
if (!url) {
|
|
183
|
-
_context2.next =
|
|
185
|
+
_context2.next = 18;
|
|
184
186
|
break;
|
|
185
187
|
}
|
|
186
|
-
_context2.next =
|
|
188
|
+
_context2.next = 18;
|
|
187
189
|
return reload(url, true, undefined, linkId);
|
|
188
|
-
case
|
|
189
|
-
_context2.next =
|
|
190
|
+
case 18:
|
|
191
|
+
_context2.next = 24;
|
|
190
192
|
break;
|
|
191
|
-
case
|
|
192
|
-
_context2.prev =
|
|
193
|
+
case 20:
|
|
194
|
+
_context2.prev = 20;
|
|
193
195
|
_context2.t0 = _context2["catch"](0);
|
|
194
196
|
setIsLoading(false);
|
|
195
197
|
if ((0, _utils.isInvokeCustomError)(_context2.t0)) {
|
|
@@ -199,16 +201,16 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
199
201
|
setErrorMessage(_types.LozengeActionErrorMessages.updateFailed);
|
|
200
202
|
fireEvent('track.smartLinkQuickAction.failed', _lozengeActionAnalytics.unknownUpdateErrorAnalyticsPayload);
|
|
201
203
|
}
|
|
202
|
-
case
|
|
204
|
+
case 24:
|
|
203
205
|
case "end":
|
|
204
206
|
return _context2.stop();
|
|
205
207
|
}
|
|
206
|
-
}, _callee2, null, [[0,
|
|
208
|
+
}, _callee2, null, [[0, 20]]);
|
|
207
209
|
}));
|
|
208
210
|
return function (_x2, _x3, _x4) {
|
|
209
211
|
return _ref4.apply(this, arguments);
|
|
210
212
|
};
|
|
211
|
-
}(), [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent]);
|
|
213
|
+
}(), [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent, onAfterChanged]);
|
|
212
214
|
var dropdownItemGroup = (0, _react.useMemo)(function () {
|
|
213
215
|
if (errorMessage) {
|
|
214
216
|
return /*#__PURE__*/_react.default.createElement(_lozengeActionError.default, {
|
|
@@ -214,7 +214,8 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
214
214
|
renderers: renderers,
|
|
215
215
|
actionOptions: actionOptions,
|
|
216
216
|
url: url,
|
|
217
|
-
id: id
|
|
217
|
+
id: id,
|
|
218
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
218
219
|
};
|
|
219
220
|
return /*#__PURE__*/_react.default.createElement(_SmartLinkAnalyticsContext.SmartLinkAnalyticsContext, {
|
|
220
221
|
url: url,
|
|
@@ -222,7 +223,7 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
222
223
|
id: id,
|
|
223
224
|
source: HOVER_CARD_SOURCE
|
|
224
225
|
}, /*#__PURE__*/_react.default.createElement(_HoverCardContent.default, hoverCardContentProps));
|
|
225
|
-
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id]);
|
|
226
|
+
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id, hoverPreviewOptions]);
|
|
226
227
|
var trigger = (0, _react.useCallback)(function (_ref3) {
|
|
227
228
|
var ariaHasPopup = _ref3['aria-haspopup'],
|
|
228
229
|
ariaExpanded = _ref3['aria-expanded'],
|
|
@@ -9,6 +9,7 @@ exports.hoverCardClassName = exports.default = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
11
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
|
|
13
14
|
var _constants = require("../../../constants");
|
|
14
15
|
var _helpers = require("../../../state/helpers");
|
|
@@ -36,7 +37,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
36
37
|
url = _ref.url,
|
|
37
38
|
onMouseEnter = _ref.onMouseEnter,
|
|
38
39
|
onMouseLeave = _ref.onMouseLeave,
|
|
39
|
-
actionOptions = _ref.actionOptions
|
|
40
|
+
actionOptions = _ref.actionOptions,
|
|
41
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions;
|
|
40
42
|
var _useAnalyticsEventsNe = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
41
43
|
createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
|
|
42
44
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
@@ -131,6 +133,11 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
131
133
|
return e.stopPropagation();
|
|
132
134
|
}, []);
|
|
133
135
|
var getCardView = function getCardView(cardState) {
|
|
136
|
+
var _hoverPreviewOptions$;
|
|
137
|
+
var overrideView = (0, _platformFeatureFlags.fg)('smart-link-custom-hover-card-content') ? hoverPreviewOptions === null || hoverPreviewOptions === void 0 || (_hoverPreviewOptions$ = hoverPreviewOptions.render) === null || _hoverPreviewOptions$ === void 0 ? void 0 : _hoverPreviewOptions$.call(hoverPreviewOptions) : undefined;
|
|
138
|
+
if (overrideView) {
|
|
139
|
+
return overrideView;
|
|
140
|
+
}
|
|
134
141
|
if (cardState.metadataStatus === 'pending') {
|
|
135
142
|
return /*#__PURE__*/_react.default.createElement(_resolving.default, {
|
|
136
143
|
flexibleCardProps: flexibleCardProps,
|
|
@@ -14,6 +14,7 @@ var Frame = exports.Frame = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
|
14
14
|
children = props.children,
|
|
15
15
|
onClick = props.onClick,
|
|
16
16
|
link = props.link,
|
|
17
|
+
viewType = props.viewType,
|
|
17
18
|
withoutBackground = props.withoutBackground,
|
|
18
19
|
testId = props.testId,
|
|
19
20
|
className = props.className,
|
|
@@ -58,6 +59,7 @@ var Frame = exports.Frame = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
|
58
59
|
className: className,
|
|
59
60
|
ref: ref,
|
|
60
61
|
isHovered: isHovered,
|
|
61
|
-
truncateInline: truncateInline
|
|
62
|
+
truncateInline: truncateInline,
|
|
63
|
+
viewType: viewType
|
|
62
64
|
}, children);
|
|
63
65
|
});
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
._ca0qidpf{padding-top:0}
|
|
27
27
|
._n3tdidpf{padding-bottom:0}
|
|
28
28
|
._sudp1e54{-webkit-box-orient:vertical}
|
|
29
|
+
._syaz15cr{color:var(--ds-text-inverse,#fff)}
|
|
29
30
|
._syaz1y58{color:var(--ds-link,#0052cc)}
|
|
30
31
|
._u5f3idpf{padding-right:0}
|
|
31
32
|
._uizt1kdv{-webkit-user-select:text;-ms-user-select:text;user-select:text}
|
|
@@ -13,8 +13,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
|
-
var
|
|
17
|
-
|
|
16
|
+
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
17
|
+
var _excluded = ["truncateInline", "withoutBackground", "isHovered", "isInteractive", "isSelected", "href", "viewType"],
|
|
18
|
+
_excluded2 = ["truncateInline", "withoutBackground", "isHovered", "isInteractive", "isSelected", "href", "viewType"];
|
|
18
19
|
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); }
|
|
19
20
|
var WrapperSpan = exports.WrapperSpan = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
20
21
|
var truncateInline = _ref.truncateInline,
|
|
@@ -23,11 +24,13 @@ var WrapperSpan = exports.WrapperSpan = /*#__PURE__*/(0, _react.forwardRef)(func
|
|
|
23
24
|
isInteractive = _ref.isInteractive,
|
|
24
25
|
isSelected = _ref.isSelected,
|
|
25
26
|
href = _ref.href,
|
|
27
|
+
viewType = _ref.viewType,
|
|
26
28
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
+
var experimentValue = viewType === 'unauthorised' ? (0, _expVal.expVal)('platform_inline_smartcard_connect_button_exp', 'cohort', 'control') : 'control';
|
|
27
30
|
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({
|
|
28
31
|
ref: ref
|
|
29
32
|
}, props, {
|
|
30
|
-
className: (0, _runtime.ax)(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv"])
|
|
33
|
+
className: (0, _runtime.ax)(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && experimentValue !== 'control' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv"])
|
|
31
34
|
}), props.children);
|
|
32
35
|
});
|
|
33
36
|
var WrapperAnchor = exports.WrapperAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
@@ -37,12 +40,14 @@ var WrapperAnchor = exports.WrapperAnchor = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
37
40
|
isInteractive = _ref2.isInteractive,
|
|
38
41
|
isSelected = _ref2.isSelected,
|
|
39
42
|
href = _ref2.href,
|
|
43
|
+
viewType = _ref2.viewType,
|
|
40
44
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
45
|
+
var experimentValue = viewType === 'unauthorised' ? (0, _expVal.expVal)('platform_inline_smartcard_connect_button_exp', 'cohort', 'control') : 'control';
|
|
41
46
|
return /*#__PURE__*/_react.default.createElement("a", (0, _extends2.default)({
|
|
42
47
|
href: href,
|
|
43
48
|
ref: ref
|
|
44
49
|
}, props, {
|
|
45
|
-
className: (0, _runtime.ax)(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg"])
|
|
50
|
+
className: (0, _runtime.ax)(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && experimentValue !== 'control' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg"])
|
|
46
51
|
}), props.children);
|
|
47
52
|
});
|
|
48
53
|
var baseWrapperStyles = null;
|
|
@@ -54,5 +59,6 @@ var hoveredWithBackgroundStyles = null;
|
|
|
54
59
|
var withoutBackgroundStyles = null;
|
|
55
60
|
var withBackgroundStyles = null;
|
|
56
61
|
var truncateStyles = null;
|
|
62
|
+
var unauthorisedTruncateStyles = null;
|
|
57
63
|
var notSelectedStyle = null;
|
|
58
64
|
var selectedStyles = null;
|
|
@@ -67,7 +67,8 @@ var InlineCardUnauthorizedView = exports.InlineCardUnauthorizedView = function I
|
|
|
67
67
|
testId: testId,
|
|
68
68
|
isSelected: isSelected,
|
|
69
69
|
ref: frameRef,
|
|
70
|
-
truncateInline: truncateInline
|
|
70
|
+
truncateInline: truncateInline,
|
|
71
|
+
viewType: "unauthorised"
|
|
71
72
|
}, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
|
|
72
73
|
icon: icon ? icon : fallbackUnauthorizedIcon(),
|
|
73
74
|
title: url,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
._13lilb4i{border-top-left-radius:var(--ds-radius-xsmall,2px)}
|
|
1
2
|
._16d9qvcn{-webkit-box-decoration-break:clone;box-decoration-break:clone}
|
|
2
3
|
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
3
4
|
._1e0c1bgi{display:contents}
|
|
@@ -5,14 +6,19 @@
|
|
|
5
6
|
._1nmz9jpi{word-break:break-all}
|
|
6
7
|
._1o0zlb4i{border-bottom-right-radius:var(--ds-radius-xsmall,2px)}
|
|
7
8
|
._1y1m1u8q{background-clip:padding-box}
|
|
9
|
+
._2hwxt94y{margin-right:1px}
|
|
8
10
|
._80om13gf{cursor:not-allowed}
|
|
9
11
|
._80omtlke{cursor:pointer}
|
|
10
12
|
._bfhk1i45{background-color:var(--ds-background-accent-gray-bolder,#6b6e76)}
|
|
11
13
|
._bfhkby5v{background-color:var(--ds-background-disabled,#17171708)}
|
|
12
14
|
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
13
15
|
._bfhkjmqp{background-color:var(--ds-background-selected-bold,#1868db)}
|
|
16
|
+
._ca0qt94y{padding-top:1px}
|
|
14
17
|
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
15
18
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
19
|
+
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
20
|
+
._mrkblb4i{border-bottom-left-radius:var(--ds-radius-xsmall,2px)}
|
|
21
|
+
._n3tdt94y{padding-bottom:1px}
|
|
16
22
|
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
17
23
|
._o5721btx{white-space:break-spaces}
|
|
18
24
|
._qrwqlb4i{border-top-right-radius:var(--ds-radius-xsmall,2px)}
|
|
@@ -25,7 +25,7 @@ var styles = {
|
|
|
25
25
|
};
|
|
26
26
|
var experimentEnabledStyles = {
|
|
27
27
|
control: "_syazi7uo _80omtlke _bfhki8nm _irr3plhp _1di61gdz",
|
|
28
|
-
test1: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _irr31q28 _1di612kk",
|
|
28
|
+
test1: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _13lilb4i _mrkblb4i _ca0qt94y _n3tdt94y _2hwxt94y _k48pi7a9 _irr31q28 _1di612kk",
|
|
29
29
|
test2: "_syaz15cr _80omtlke _bfhk1i45 _qrwqlb4i _1o0zlb4i _irr3byip _1di61van"
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
22
22
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
23
23
|
var PACKAGE_DATA = {
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "
|
|
25
|
+
packageVersion: "0.0.0-development",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
28
|
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: "
|
|
5
|
+
packageVersion: "0.0.0-development"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,6 +5,7 @@ import "./index.compiled.css";
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { di } from 'react-magnetic-di';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { MediaPlacement, SmartLinkSize } from '../../../../constants';
|
|
9
10
|
import { useFlexibleUiContext } from '../../../../state/flexible-ui-context';
|
|
10
11
|
import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
|
|
@@ -175,7 +176,7 @@ const Container = ({
|
|
|
175
176
|
previewOnLeft,
|
|
176
177
|
previewOnRight
|
|
177
178
|
} = getChildrenOptions(children, context);
|
|
178
|
-
const canShowHoverPreview = showHoverPreview && status === 'resolved';
|
|
179
|
+
const canShowHoverPreview = showHoverPreview && (status === 'resolved' || (hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.render) !== undefined && fg('smart-link-custom-hover-card-content'));
|
|
179
180
|
// `retry` object contains action that can be performed on
|
|
180
181
|
// unresolved link (unauthorized, forbidden, not found, etc.)
|
|
181
182
|
const canShowAuthTooltip = showHoverPreview && status === 'unauthorized' && retry !== undefined;
|
package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/index.js
CHANGED
|
@@ -22,7 +22,8 @@ const BaseLozengeElement = ({
|
|
|
22
22
|
className,
|
|
23
23
|
style,
|
|
24
24
|
text,
|
|
25
|
-
testId = 'smart-element-lozenge'
|
|
25
|
+
testId = 'smart-element-lozenge',
|
|
26
|
+
onAfterChanged
|
|
26
27
|
}) => {
|
|
27
28
|
const ui = useFlexibleUiOptionContext();
|
|
28
29
|
if (!text) {
|
|
@@ -33,7 +34,8 @@ const BaseLozengeElement = ({
|
|
|
33
34
|
appearance: appearance,
|
|
34
35
|
testId: testId,
|
|
35
36
|
text: text,
|
|
36
|
-
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
37
|
+
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex,
|
|
38
|
+
onAfterChanged: onAfterChanged
|
|
37
39
|
}) : /*#__PURE__*/React.createElement(AtlaskitLozenge, _extends({
|
|
38
40
|
appearance: appearance
|
|
39
41
|
}, fg('platform-component-visual-refresh') ? {
|
|
@@ -23,7 +23,8 @@ const LozengeAction = ({
|
|
|
23
23
|
appearance,
|
|
24
24
|
testId = 'smart-element-lozenge-action',
|
|
25
25
|
text,
|
|
26
|
-
zIndex
|
|
26
|
+
zIndex,
|
|
27
|
+
onAfterChanged
|
|
27
28
|
}) => {
|
|
28
29
|
var _action$update;
|
|
29
30
|
const [selected, setSelected] = useState({
|
|
@@ -97,6 +98,7 @@ const LozengeAction = ({
|
|
|
97
98
|
setIsLoading(true);
|
|
98
99
|
const request = createStatusUpdateRequest(updateAction, id);
|
|
99
100
|
await invoke(request);
|
|
101
|
+
onAfterChanged === null || onAfterChanged === void 0 ? void 0 : onAfterChanged();
|
|
100
102
|
setSelected({
|
|
101
103
|
appearance,
|
|
102
104
|
text
|
|
@@ -122,7 +124,7 @@ const LozengeAction = ({
|
|
|
122
124
|
fireEvent('track.smartLinkQuickAction.failed', unknownUpdateErrorAnalyticsPayload);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
|
-
}, [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent]);
|
|
127
|
+
}, [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent, onAfterChanged]);
|
|
126
128
|
const dropdownItemGroup = useMemo(() => {
|
|
127
129
|
if (errorMessage) {
|
|
128
130
|
return /*#__PURE__*/React.createElement(LozengeActionError, {
|
|
@@ -191,7 +191,8 @@ export const HoverCardComponent = ({
|
|
|
191
191
|
renderers,
|
|
192
192
|
actionOptions,
|
|
193
193
|
url,
|
|
194
|
-
id
|
|
194
|
+
id,
|
|
195
|
+
hoverPreviewOptions
|
|
195
196
|
};
|
|
196
197
|
return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
|
|
197
198
|
url: url,
|
|
@@ -199,7 +200,7 @@ export const HoverCardComponent = ({
|
|
|
199
200
|
id: id,
|
|
200
201
|
source: HOVER_CARD_SOURCE
|
|
201
202
|
}, /*#__PURE__*/React.createElement(HoverCardContent, hoverCardContentProps));
|
|
202
|
-
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id]);
|
|
203
|
+
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id, hoverPreviewOptions]);
|
|
203
204
|
const trigger = useCallback(({
|
|
204
205
|
'aria-haspopup': ariaHasPopup,
|
|
205
206
|
'aria-expanded': ariaExpanded,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
|
|
3
3
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
5
6
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
6
7
|
import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
|
|
@@ -25,7 +26,8 @@ const HoverCardContent = ({
|
|
|
25
26
|
url,
|
|
26
27
|
onMouseEnter,
|
|
27
28
|
onMouseLeave,
|
|
28
|
-
actionOptions
|
|
29
|
+
actionOptions,
|
|
30
|
+
hoverPreviewOptions
|
|
29
31
|
}) => {
|
|
30
32
|
var _linkState$status, _cardState$details;
|
|
31
33
|
const {
|
|
@@ -120,6 +122,11 @@ const HoverCardContent = ({
|
|
|
120
122
|
};
|
|
121
123
|
const onClickStopPropagation = useCallback(e => e.stopPropagation(), []);
|
|
122
124
|
const getCardView = cardState => {
|
|
125
|
+
var _hoverPreviewOptions$;
|
|
126
|
+
const overrideView = fg('smart-link-custom-hover-card-content') ? hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : (_hoverPreviewOptions$ = hoverPreviewOptions.render) === null || _hoverPreviewOptions$ === void 0 ? void 0 : _hoverPreviewOptions$.call(hoverPreviewOptions) : undefined;
|
|
127
|
+
if (overrideView) {
|
|
128
|
+
return overrideView;
|
|
129
|
+
}
|
|
123
130
|
if (cardState.metadataStatus === 'pending') {
|
|
124
131
|
return /*#__PURE__*/React.createElement(HoverCardLoadingView, {
|
|
125
132
|
flexibleCardProps: flexibleCardProps,
|
|
@@ -7,6 +7,7 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7
7
|
children,
|
|
8
8
|
onClick,
|
|
9
9
|
link,
|
|
10
|
+
viewType,
|
|
10
11
|
withoutBackground,
|
|
11
12
|
testId,
|
|
12
13
|
className,
|
|
@@ -52,6 +53,7 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
52
53
|
className: className,
|
|
53
54
|
ref: ref,
|
|
54
55
|
isHovered: isHovered,
|
|
55
|
-
truncateInline: truncateInline
|
|
56
|
+
truncateInline: truncateInline,
|
|
57
|
+
viewType: viewType
|
|
56
58
|
}, children);
|
|
57
59
|
});
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
._ca0qidpf{padding-top:0}
|
|
27
27
|
._n3tdidpf{padding-bottom:0}
|
|
28
28
|
._sudp1e54{-webkit-box-orient:vertical}
|
|
29
|
+
._syaz15cr{color:var(--ds-text-inverse,#fff)}
|
|
29
30
|
._syaz1y58{color:var(--ds-link,#0052cc)}
|
|
30
31
|
._u5f3idpf{padding-right:0}
|
|
31
32
|
._uizt1kdv{-webkit-user-select:text;-ms-user-select:text;user-select:text}
|
|
@@ -4,6 +4,7 @@ import "./styled.compiled.css";
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
import { B100, B200, B400, B50, N40 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
7
8
|
export const WrapperSpan = /*#__PURE__*/forwardRef(({
|
|
8
9
|
truncateInline,
|
|
9
10
|
withoutBackground,
|
|
@@ -11,12 +12,14 @@ export const WrapperSpan = /*#__PURE__*/forwardRef(({
|
|
|
11
12
|
isInteractive,
|
|
12
13
|
isSelected,
|
|
13
14
|
href,
|
|
15
|
+
viewType,
|
|
14
16
|
...props
|
|
15
17
|
}, ref) => {
|
|
18
|
+
const experimentValue = viewType === 'unauthorised' ? expVal('platform_inline_smartcard_connect_button_exp', 'cohort', 'control') : 'control';
|
|
16
19
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
17
20
|
ref: ref
|
|
18
21
|
}, props, {
|
|
19
|
-
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv"])
|
|
22
|
+
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && experimentValue !== 'control' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv"])
|
|
20
23
|
}), props.children);
|
|
21
24
|
});
|
|
22
25
|
export const WrapperAnchor = /*#__PURE__*/forwardRef(({
|
|
@@ -26,13 +29,15 @@ export const WrapperAnchor = /*#__PURE__*/forwardRef(({
|
|
|
26
29
|
isInteractive,
|
|
27
30
|
isSelected,
|
|
28
31
|
href,
|
|
32
|
+
viewType,
|
|
29
33
|
...props
|
|
30
34
|
}, ref) => {
|
|
35
|
+
const experimentValue = viewType === 'unauthorised' ? expVal('platform_inline_smartcard_connect_button_exp', 'cohort', 'control') : 'control';
|
|
31
36
|
return /*#__PURE__*/React.createElement("a", _extends({
|
|
32
37
|
href: href,
|
|
33
38
|
ref: ref
|
|
34
39
|
}, props, {
|
|
35
|
-
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg"])
|
|
40
|
+
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && experimentValue !== 'control' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg"])
|
|
36
41
|
}), props.children);
|
|
37
42
|
});
|
|
38
43
|
const baseWrapperStyles = null;
|
|
@@ -44,5 +49,6 @@ const hoveredWithBackgroundStyles = null;
|
|
|
44
49
|
const withoutBackgroundStyles = null;
|
|
45
50
|
const withBackgroundStyles = null;
|
|
46
51
|
const truncateStyles = null;
|
|
52
|
+
const unauthorisedTruncateStyles = null;
|
|
47
53
|
const notSelectedStyle = null;
|
|
48
54
|
const selectedStyles = null;
|
|
@@ -60,7 +60,8 @@ export const InlineCardUnauthorizedView = ({
|
|
|
60
60
|
testId: testId,
|
|
61
61
|
isSelected: isSelected,
|
|
62
62
|
ref: frameRef,
|
|
63
|
-
truncateInline: truncateInline
|
|
63
|
+
truncateInline: truncateInline,
|
|
64
|
+
viewType: "unauthorised"
|
|
64
65
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
65
66
|
icon: icon ? icon : fallbackUnauthorizedIcon(),
|
|
66
67
|
title: url,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
._13lilb4i{border-top-left-radius:var(--ds-radius-xsmall,2px)}
|
|
1
2
|
._16d9qvcn{-webkit-box-decoration-break:clone;box-decoration-break:clone}
|
|
2
3
|
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
3
4
|
._1e0c1bgi{display:contents}
|
|
@@ -5,14 +6,19 @@
|
|
|
5
6
|
._1nmz9jpi{word-break:break-all}
|
|
6
7
|
._1o0zlb4i{border-bottom-right-radius:var(--ds-radius-xsmall,2px)}
|
|
7
8
|
._1y1m1u8q{background-clip:padding-box}
|
|
9
|
+
._2hwxt94y{margin-right:1px}
|
|
8
10
|
._80om13gf{cursor:not-allowed}
|
|
9
11
|
._80omtlke{cursor:pointer}
|
|
10
12
|
._bfhk1i45{background-color:var(--ds-background-accent-gray-bolder,#6b6e76)}
|
|
11
13
|
._bfhkby5v{background-color:var(--ds-background-disabled,#17171708)}
|
|
12
14
|
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
13
15
|
._bfhkjmqp{background-color:var(--ds-background-selected-bold,#1868db)}
|
|
16
|
+
._ca0qt94y{padding-top:1px}
|
|
14
17
|
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
15
18
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
19
|
+
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
20
|
+
._mrkblb4i{border-bottom-left-radius:var(--ds-radius-xsmall,2px)}
|
|
21
|
+
._n3tdt94y{padding-bottom:1px}
|
|
16
22
|
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
17
23
|
._o5721btx{white-space:break-spaces}
|
|
18
24
|
._qrwqlb4i{border-top-right-radius:var(--ds-radius-xsmall,2px)}
|
|
@@ -14,7 +14,7 @@ const styles = {
|
|
|
14
14
|
};
|
|
15
15
|
const experimentEnabledStyles = {
|
|
16
16
|
control: "_syazi7uo _80omtlke _bfhki8nm _irr3plhp _1di61gdz",
|
|
17
|
-
test1: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _irr31q28 _1di612kk",
|
|
17
|
+
test1: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _13lilb4i _mrkblb4i _ca0qt94y _n3tdt94y _2hwxt94y _k48pi7a9 _irr31q28 _1di612kk",
|
|
18
18
|
test2: "_syaz15cr _80omtlke _bfhk1i45 _qrwqlb4i _1o0zlb4i _irr3byip _1di61van"
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "
|
|
15
|
+
packageVersion: "0.0.0-development",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -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: "
|
|
7
|
+
packageVersion: "0.0.0-development"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,6 +5,7 @@ import "./index.compiled.css";
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { di } from 'react-magnetic-di';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { MediaPlacement, SmartLinkSize } from '../../../../constants';
|
|
9
10
|
import { useFlexibleUiContext } from '../../../../state/flexible-ui-context';
|
|
10
11
|
import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
|
|
@@ -185,7 +186,7 @@ var Container = function Container(_ref3) {
|
|
|
185
186
|
var _getChildrenOptions = getChildrenOptions(children, context),
|
|
186
187
|
previewOnLeft = _getChildrenOptions.previewOnLeft,
|
|
187
188
|
previewOnRight = _getChildrenOptions.previewOnRight;
|
|
188
|
-
var canShowHoverPreview = showHoverPreview && status === 'resolved';
|
|
189
|
+
var canShowHoverPreview = showHoverPreview && (status === 'resolved' || (hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.render) !== undefined && fg('smart-link-custom-hover-card-content'));
|
|
189
190
|
// `retry` object contains action that can be performed on
|
|
190
191
|
// unresolved link (unauthorized, forbidden, not found, etc.)
|
|
191
192
|
var canShowAuthTooltip = showHoverPreview && status === 'unauthorized' && retry !== undefined;
|
|
@@ -24,7 +24,8 @@ var BaseLozengeElement = function BaseLozengeElement(_ref) {
|
|
|
24
24
|
style = _ref.style,
|
|
25
25
|
text = _ref.text,
|
|
26
26
|
_ref$testId = _ref.testId,
|
|
27
|
-
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId
|
|
27
|
+
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId,
|
|
28
|
+
onAfterChanged = _ref.onAfterChanged;
|
|
28
29
|
var ui = useFlexibleUiOptionContext();
|
|
29
30
|
if (!text) {
|
|
30
31
|
return null;
|
|
@@ -34,7 +35,8 @@ var BaseLozengeElement = function BaseLozengeElement(_ref) {
|
|
|
34
35
|
appearance: appearance,
|
|
35
36
|
testId: testId,
|
|
36
37
|
text: text,
|
|
37
|
-
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
38
|
+
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex,
|
|
39
|
+
onAfterChanged: onAfterChanged
|
|
38
40
|
}) : /*#__PURE__*/React.createElement(AtlaskitLozenge, _extends({
|
|
39
41
|
appearance: appearance
|
|
40
42
|
}, fg('platform-component-visual-refresh') ? {
|
|
@@ -32,7 +32,8 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
32
32
|
_ref$testId = _ref.testId,
|
|
33
33
|
testId = _ref$testId === void 0 ? 'smart-element-lozenge-action' : _ref$testId,
|
|
34
34
|
text = _ref.text,
|
|
35
|
-
zIndex = _ref.zIndex
|
|
35
|
+
zIndex = _ref.zIndex,
|
|
36
|
+
onAfterChanged = _ref.onAfterChanged;
|
|
36
37
|
var _useState = useState({
|
|
37
38
|
appearance: appearance,
|
|
38
39
|
text: text
|
|
@@ -151,7 +152,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
151
152
|
fireEvent('ui.button.clicked.smartLinkStatusListItem', {});
|
|
152
153
|
updateAction = action === null || action === void 0 ? void 0 : action.update;
|
|
153
154
|
if (!(updateAction && id)) {
|
|
154
|
-
_context2.next =
|
|
155
|
+
_context2.next = 18;
|
|
155
156
|
break;
|
|
156
157
|
}
|
|
157
158
|
setIsLoading(true);
|
|
@@ -159,6 +160,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
159
160
|
_context2.next = 8;
|
|
160
161
|
return invoke(request);
|
|
161
162
|
case 8:
|
|
163
|
+
onAfterChanged === null || onAfterChanged === void 0 || onAfterChanged();
|
|
162
164
|
setSelected({
|
|
163
165
|
appearance: appearance,
|
|
164
166
|
text: text
|
|
@@ -171,16 +173,16 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
171
173
|
smartLinkActionType: TrackQuickActionType.StatusUpdate
|
|
172
174
|
});
|
|
173
175
|
if (!url) {
|
|
174
|
-
_context2.next =
|
|
176
|
+
_context2.next = 18;
|
|
175
177
|
break;
|
|
176
178
|
}
|
|
177
|
-
_context2.next =
|
|
179
|
+
_context2.next = 18;
|
|
178
180
|
return reload(url, true, undefined, linkId);
|
|
179
|
-
case
|
|
180
|
-
_context2.next =
|
|
181
|
+
case 18:
|
|
182
|
+
_context2.next = 24;
|
|
181
183
|
break;
|
|
182
|
-
case
|
|
183
|
-
_context2.prev =
|
|
184
|
+
case 20:
|
|
185
|
+
_context2.prev = 20;
|
|
184
186
|
_context2.t0 = _context2["catch"](0);
|
|
185
187
|
setIsLoading(false);
|
|
186
188
|
if (isInvokeCustomError(_context2.t0)) {
|
|
@@ -190,16 +192,16 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
190
192
|
setErrorMessage(LozengeActionErrorMessages.updateFailed);
|
|
191
193
|
fireEvent('track.smartLinkQuickAction.failed', unknownUpdateErrorAnalyticsPayload);
|
|
192
194
|
}
|
|
193
|
-
case
|
|
195
|
+
case 24:
|
|
194
196
|
case "end":
|
|
195
197
|
return _context2.stop();
|
|
196
198
|
}
|
|
197
|
-
}, _callee2, null, [[0,
|
|
199
|
+
}, _callee2, null, [[0, 20]]);
|
|
198
200
|
}));
|
|
199
201
|
return function (_x2, _x3, _x4) {
|
|
200
202
|
return _ref4.apply(this, arguments);
|
|
201
203
|
};
|
|
202
|
-
}(), [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent]);
|
|
204
|
+
}(), [action === null || action === void 0 ? void 0 : action.update, invoke, linkId, reload, url, fireEvent, onAfterChanged]);
|
|
203
205
|
var dropdownItemGroup = useMemo(function () {
|
|
204
206
|
if (errorMessage) {
|
|
205
207
|
return /*#__PURE__*/React.createElement(LozengeActionError, {
|
|
@@ -205,7 +205,8 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
205
205
|
renderers: renderers,
|
|
206
206
|
actionOptions: actionOptions,
|
|
207
207
|
url: url,
|
|
208
|
-
id: id
|
|
208
|
+
id: id,
|
|
209
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
209
210
|
};
|
|
210
211
|
return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
|
|
211
212
|
url: url,
|
|
@@ -213,7 +214,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
213
214
|
id: id,
|
|
214
215
|
source: HOVER_CARD_SOURCE
|
|
215
216
|
}, /*#__PURE__*/React.createElement(HoverCardContent, hoverCardContentProps));
|
|
216
|
-
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id]);
|
|
217
|
+
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id, hoverPreviewOptions]);
|
|
217
218
|
var trigger = useCallback(function (_ref3) {
|
|
218
219
|
var ariaHasPopup = _ref3['aria-haspopup'],
|
|
219
220
|
ariaExpanded = _ref3['aria-expanded'],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
|
|
3
3
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
5
6
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
6
7
|
import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
|
|
@@ -27,7 +28,8 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
27
28
|
url = _ref.url,
|
|
28
29
|
onMouseEnter = _ref.onMouseEnter,
|
|
29
30
|
onMouseLeave = _ref.onMouseLeave,
|
|
30
|
-
actionOptions = _ref.actionOptions
|
|
31
|
+
actionOptions = _ref.actionOptions,
|
|
32
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions;
|
|
31
33
|
var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
|
|
32
34
|
createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
|
|
33
35
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -122,6 +124,11 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
122
124
|
return e.stopPropagation();
|
|
123
125
|
}, []);
|
|
124
126
|
var getCardView = function getCardView(cardState) {
|
|
127
|
+
var _hoverPreviewOptions$;
|
|
128
|
+
var overrideView = fg('smart-link-custom-hover-card-content') ? hoverPreviewOptions === null || hoverPreviewOptions === void 0 || (_hoverPreviewOptions$ = hoverPreviewOptions.render) === null || _hoverPreviewOptions$ === void 0 ? void 0 : _hoverPreviewOptions$.call(hoverPreviewOptions) : undefined;
|
|
129
|
+
if (overrideView) {
|
|
130
|
+
return overrideView;
|
|
131
|
+
}
|
|
125
132
|
if (cardState.metadataStatus === 'pending') {
|
|
126
133
|
return /*#__PURE__*/React.createElement(HoverCardLoadingView, {
|
|
127
134
|
flexibleCardProps: flexibleCardProps,
|
|
@@ -6,6 +6,7 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
6
6
|
children = props.children,
|
|
7
7
|
onClick = props.onClick,
|
|
8
8
|
link = props.link,
|
|
9
|
+
viewType = props.viewType,
|
|
9
10
|
withoutBackground = props.withoutBackground,
|
|
10
11
|
testId = props.testId,
|
|
11
12
|
className = props.className,
|
|
@@ -50,6 +51,7 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
50
51
|
className: className,
|
|
51
52
|
ref: ref,
|
|
52
53
|
isHovered: isHovered,
|
|
53
|
-
truncateInline: truncateInline
|
|
54
|
+
truncateInline: truncateInline,
|
|
55
|
+
viewType: viewType
|
|
54
56
|
}, children);
|
|
55
57
|
});
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
._ca0qidpf{padding-top:0}
|
|
27
27
|
._n3tdidpf{padding-bottom:0}
|
|
28
28
|
._sudp1e54{-webkit-box-orient:vertical}
|
|
29
|
+
._syaz15cr{color:var(--ds-text-inverse,#fff)}
|
|
29
30
|
._syaz1y58{color:var(--ds-link,#0052cc)}
|
|
30
31
|
._u5f3idpf{padding-right:0}
|
|
31
32
|
._uizt1kdv{-webkit-user-select:text;-ms-user-select:text;user-select:text}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/* styled.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["truncateInline", "withoutBackground", "isHovered", "isInteractive", "isSelected", "href"],
|
|
5
|
-
_excluded2 = ["truncateInline", "withoutBackground", "isHovered", "isInteractive", "isSelected", "href"];
|
|
4
|
+
var _excluded = ["truncateInline", "withoutBackground", "isHovered", "isInteractive", "isSelected", "href", "viewType"],
|
|
5
|
+
_excluded2 = ["truncateInline", "withoutBackground", "isHovered", "isInteractive", "isSelected", "href", "viewType"];
|
|
6
6
|
import "./styled.compiled.css";
|
|
7
7
|
import { ax, ix } from "@compiled/react/runtime";
|
|
8
8
|
import React, { forwardRef } from 'react';
|
|
9
9
|
import { B100, B200, B400, B50, N40 } from '@atlaskit/theme/colors';
|
|
10
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
10
11
|
export var WrapperSpan = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
11
12
|
var truncateInline = _ref.truncateInline,
|
|
12
13
|
withoutBackground = _ref.withoutBackground,
|
|
@@ -14,11 +15,13 @@ export var WrapperSpan = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
14
15
|
isInteractive = _ref.isInteractive,
|
|
15
16
|
isSelected = _ref.isSelected,
|
|
16
17
|
href = _ref.href,
|
|
18
|
+
viewType = _ref.viewType,
|
|
17
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
var experimentValue = viewType === 'unauthorised' ? expVal('platform_inline_smartcard_connect_button_exp', 'cohort', 'control') : 'control';
|
|
18
21
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
19
22
|
ref: ref
|
|
20
23
|
}, props, {
|
|
21
|
-
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv"])
|
|
24
|
+
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && experimentValue !== 'control' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv"])
|
|
22
25
|
}), props.children);
|
|
23
26
|
});
|
|
24
27
|
export var WrapperAnchor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
@@ -28,12 +31,14 @@ export var WrapperAnchor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
28
31
|
isInteractive = _ref2.isInteractive,
|
|
29
32
|
isSelected = _ref2.isSelected,
|
|
30
33
|
href = _ref2.href,
|
|
34
|
+
viewType = _ref2.viewType,
|
|
31
35
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
36
|
+
var experimentValue = viewType === 'unauthorised' ? expVal('platform_inline_smartcard_connect_button_exp', 'cohort', 'control') : 'control';
|
|
32
37
|
return /*#__PURE__*/React.createElement("a", _extends({
|
|
33
38
|
href: href,
|
|
34
39
|
ref: ref
|
|
35
40
|
}, props, {
|
|
36
|
-
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg"])
|
|
41
|
+
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && experimentValue !== 'control' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg"])
|
|
37
42
|
}), props.children);
|
|
38
43
|
});
|
|
39
44
|
var baseWrapperStyles = null;
|
|
@@ -45,5 +50,6 @@ var hoveredWithBackgroundStyles = null;
|
|
|
45
50
|
var withoutBackgroundStyles = null;
|
|
46
51
|
var withBackgroundStyles = null;
|
|
47
52
|
var truncateStyles = null;
|
|
53
|
+
var unauthorisedTruncateStyles = null;
|
|
48
54
|
var notSelectedStyle = null;
|
|
49
55
|
var selectedStyles = null;
|
|
@@ -60,7 +60,8 @@ export var InlineCardUnauthorizedView = function InlineCardUnauthorizedView(_ref
|
|
|
60
60
|
testId: testId,
|
|
61
61
|
isSelected: isSelected,
|
|
62
62
|
ref: frameRef,
|
|
63
|
-
truncateInline: truncateInline
|
|
63
|
+
truncateInline: truncateInline,
|
|
64
|
+
viewType: "unauthorised"
|
|
64
65
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
65
66
|
icon: icon ? icon : fallbackUnauthorizedIcon(),
|
|
66
67
|
title: url,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
._13lilb4i{border-top-left-radius:var(--ds-radius-xsmall,2px)}
|
|
1
2
|
._16d9qvcn{-webkit-box-decoration-break:clone;box-decoration-break:clone}
|
|
2
3
|
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
3
4
|
._1e0c1bgi{display:contents}
|
|
@@ -5,14 +6,19 @@
|
|
|
5
6
|
._1nmz9jpi{word-break:break-all}
|
|
6
7
|
._1o0zlb4i{border-bottom-right-radius:var(--ds-radius-xsmall,2px)}
|
|
7
8
|
._1y1m1u8q{background-clip:padding-box}
|
|
9
|
+
._2hwxt94y{margin-right:1px}
|
|
8
10
|
._80om13gf{cursor:not-allowed}
|
|
9
11
|
._80omtlke{cursor:pointer}
|
|
10
12
|
._bfhk1i45{background-color:var(--ds-background-accent-gray-bolder,#6b6e76)}
|
|
11
13
|
._bfhkby5v{background-color:var(--ds-background-disabled,#17171708)}
|
|
12
14
|
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
13
15
|
._bfhkjmqp{background-color:var(--ds-background-selected-bold,#1868db)}
|
|
16
|
+
._ca0qt94y{padding-top:1px}
|
|
14
17
|
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
15
18
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
19
|
+
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
20
|
+
._mrkblb4i{border-bottom-left-radius:var(--ds-radius-xsmall,2px)}
|
|
21
|
+
._n3tdt94y{padding-bottom:1px}
|
|
16
22
|
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
17
23
|
._o5721btx{white-space:break-spaces}
|
|
18
24
|
._qrwqlb4i{border-top-right-radius:var(--ds-radius-xsmall,2px)}
|
|
@@ -16,7 +16,7 @@ var styles = {
|
|
|
16
16
|
};
|
|
17
17
|
var experimentEnabledStyles = {
|
|
18
18
|
control: "_syazi7uo _80omtlke _bfhki8nm _irr3plhp _1di61gdz",
|
|
19
|
-
test1: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _irr31q28 _1di612kk",
|
|
19
|
+
test1: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _13lilb4i _mrkblb4i _ca0qt94y _n3tdt94y _2hwxt94y _k48pi7a9 _irr31q28 _1di612kk",
|
|
20
20
|
test2: "_syaz15cr _80omtlke _bfhk1i45 _qrwqlb4i _1o0zlb4i _irr3byip _1di61van"
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "
|
|
18
|
+
packageVersion: "0.0.0-development",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/index.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export type BaseLozengeElementProps = ElementProps & {
|
|
|
11
11
|
* Determines the appearance of the Atlaskit lozenge.
|
|
12
12
|
*/
|
|
13
13
|
appearance?: LozengeAppearance;
|
|
14
|
+
/**
|
|
15
|
+
* Callback fired after lozenge value has changed
|
|
16
|
+
*/
|
|
17
|
+
onAfterChanged?: () => void;
|
|
14
18
|
/**
|
|
15
19
|
* Determines the custom styles of the Atlaskit lozenge.
|
|
16
20
|
*/
|
|
@@ -26,6 +30,6 @@ export type BaseLozengeElementProps = ElementProps & {
|
|
|
26
30
|
* @param {BaseLozengeElementProps} BaseLozengeElementProps - The props necessary for the Lozenge element.
|
|
27
31
|
* @see State
|
|
28
32
|
*/
|
|
29
|
-
declare const BaseLozengeElement: ({ action, appearance, name, className, style, text, testId, }: BaseLozengeElementProps) => JSX.Element | null;
|
|
33
|
+
declare const BaseLozengeElement: ({ action, appearance, name, className, style, text, testId, onAfterChanged, }: BaseLozengeElementProps) => JSX.Element | null;
|
|
30
34
|
export default BaseLozengeElement;
|
|
31
35
|
export declare const toDateLozengeProps: (dateString?: string) => Partial<BaseLozengeElementProps> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type HoverCardContentProps } from '../types';
|
|
3
3
|
export declare const hoverCardClassName = "smart-links-hover-preview";
|
|
4
|
-
declare const HoverCardContent: ({ id, cardState, onActionClick, onResolve, renderers, url, onMouseEnter, onMouseLeave, actionOptions, }: HoverCardContentProps) => React.JSX.Element | null;
|
|
4
|
+
declare const HoverCardContent: ({ id, cardState, onActionClick, onResolve, renderers, url, onMouseEnter, onMouseLeave, actionOptions, hoverPreviewOptions, }: HoverCardContentProps) => React.JSX.Element | null;
|
|
5
5
|
export default HoverCardContent;
|
|
@@ -93,6 +93,7 @@ export type HoverCardContentProps = {
|
|
|
93
93
|
onResolve: () => void;
|
|
94
94
|
renderers?: CardProviderRenderers;
|
|
95
95
|
url: string;
|
|
96
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
96
97
|
};
|
|
97
98
|
export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
98
99
|
isAIEnabled?: boolean;
|
|
@@ -108,4 +109,8 @@ export interface HoverPreviewOptions {
|
|
|
108
109
|
* Delay (in milliseconds) between hovering over the trigger element and the hover card opening. Defaults to 500ms.
|
|
109
110
|
*/
|
|
110
111
|
fadeInDelay?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Render a custom component instead of the default hover card.
|
|
114
|
+
*/
|
|
115
|
+
render?: () => React.ReactNode;
|
|
111
116
|
}
|
|
@@ -13,6 +13,8 @@ export interface FrameViewProps {
|
|
|
13
13
|
testId?: string;
|
|
14
14
|
/** A flag that determines whether a card is truncated to 1 line */
|
|
15
15
|
truncateInline?: boolean;
|
|
16
|
+
/** A flag that determines the type of view */
|
|
17
|
+
viewType?: 'default' | 'unauthorised';
|
|
16
18
|
/** A flag that determines whether the card needs a backgorund or not */
|
|
17
19
|
withoutBackground?: boolean;
|
|
18
20
|
}
|
|
@@ -9,6 +9,7 @@ export interface WrapperProps extends React.ComponentProps<any> {
|
|
|
9
9
|
isInteractive?: boolean;
|
|
10
10
|
isSelected?: boolean;
|
|
11
11
|
truncateInline?: boolean;
|
|
12
|
+
viewType?: 'default' | 'unauthorised';
|
|
12
13
|
withoutBackground?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare const WrapperSpan: React.ForwardRefExoticComponent<Omit<WrapperProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -11,6 +11,10 @@ export type BaseLozengeElementProps = ElementProps & {
|
|
|
11
11
|
* Determines the appearance of the Atlaskit lozenge.
|
|
12
12
|
*/
|
|
13
13
|
appearance?: LozengeAppearance;
|
|
14
|
+
/**
|
|
15
|
+
* Callback fired after lozenge value has changed
|
|
16
|
+
*/
|
|
17
|
+
onAfterChanged?: () => void;
|
|
14
18
|
/**
|
|
15
19
|
* Determines the custom styles of the Atlaskit lozenge.
|
|
16
20
|
*/
|
|
@@ -26,6 +30,6 @@ export type BaseLozengeElementProps = ElementProps & {
|
|
|
26
30
|
* @param {BaseLozengeElementProps} BaseLozengeElementProps - The props necessary for the Lozenge element.
|
|
27
31
|
* @see State
|
|
28
32
|
*/
|
|
29
|
-
declare const BaseLozengeElement: ({ action, appearance, name, className, style, text, testId, }: BaseLozengeElementProps) => JSX.Element | null;
|
|
33
|
+
declare const BaseLozengeElement: ({ action, appearance, name, className, style, text, testId, onAfterChanged, }: BaseLozengeElementProps) => JSX.Element | null;
|
|
30
34
|
export default BaseLozengeElement;
|
|
31
35
|
export declare const toDateLozengeProps: (dateString?: string) => Partial<BaseLozengeElementProps> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type HoverCardContentProps } from '../types';
|
|
3
3
|
export declare const hoverCardClassName = "smart-links-hover-preview";
|
|
4
|
-
declare const HoverCardContent: ({ id, cardState, onActionClick, onResolve, renderers, url, onMouseEnter, onMouseLeave, actionOptions, }: HoverCardContentProps) => React.JSX.Element | null;
|
|
4
|
+
declare const HoverCardContent: ({ id, cardState, onActionClick, onResolve, renderers, url, onMouseEnter, onMouseLeave, actionOptions, hoverPreviewOptions, }: HoverCardContentProps) => React.JSX.Element | null;
|
|
5
5
|
export default HoverCardContent;
|
|
@@ -93,6 +93,7 @@ export type HoverCardContentProps = {
|
|
|
93
93
|
onResolve: () => void;
|
|
94
94
|
renderers?: CardProviderRenderers;
|
|
95
95
|
url: string;
|
|
96
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
96
97
|
};
|
|
97
98
|
export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
98
99
|
isAIEnabled?: boolean;
|
|
@@ -108,4 +109,8 @@ export interface HoverPreviewOptions {
|
|
|
108
109
|
* Delay (in milliseconds) between hovering over the trigger element and the hover card opening. Defaults to 500ms.
|
|
109
110
|
*/
|
|
110
111
|
fadeInDelay?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Render a custom component instead of the default hover card.
|
|
114
|
+
*/
|
|
115
|
+
render?: () => React.ReactNode;
|
|
111
116
|
}
|
|
@@ -13,6 +13,8 @@ export interface FrameViewProps {
|
|
|
13
13
|
testId?: string;
|
|
14
14
|
/** A flag that determines whether a card is truncated to 1 line */
|
|
15
15
|
truncateInline?: boolean;
|
|
16
|
+
/** A flag that determines the type of view */
|
|
17
|
+
viewType?: 'default' | 'unauthorised';
|
|
16
18
|
/** A flag that determines whether the card needs a backgorund or not */
|
|
17
19
|
withoutBackground?: boolean;
|
|
18
20
|
}
|
|
@@ -9,6 +9,7 @@ export interface WrapperProps extends React.ComponentProps<any> {
|
|
|
9
9
|
isInteractive?: boolean;
|
|
10
10
|
isSelected?: boolean;
|
|
11
11
|
truncateInline?: boolean;
|
|
12
|
+
viewType?: 'default' | 'unauthorised';
|
|
12
13
|
withoutBackground?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare const WrapperSpan: React.ForwardRefExoticComponent<Omit<WrapperProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.7.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -53,26 +53,26 @@
|
|
|
53
53
|
"@atlaskit/link-analytics": "^11.0.0",
|
|
54
54
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
55
55
|
"@atlaskit/link-extractors": "^2.4.0",
|
|
56
|
-
"@atlaskit/link-test-helpers": "^8.
|
|
56
|
+
"@atlaskit/link-test-helpers": "^8.5.0",
|
|
57
57
|
"@atlaskit/linking-common": "^9.8.0",
|
|
58
|
-
"@atlaskit/linking-types": "^14.
|
|
58
|
+
"@atlaskit/linking-types": "^14.2.0",
|
|
59
59
|
"@atlaskit/logo": "^19.9.0",
|
|
60
60
|
"@atlaskit/lozenge": "^13.1.0",
|
|
61
61
|
"@atlaskit/menu": "^8.4.0",
|
|
62
|
-
"@atlaskit/modal-dialog": "^14.
|
|
62
|
+
"@atlaskit/modal-dialog": "^14.7.0",
|
|
63
63
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
64
64
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
65
65
|
"@atlaskit/popup": "^4.6.0",
|
|
66
66
|
"@atlaskit/primitives": "^16.1.0",
|
|
67
67
|
"@atlaskit/section-message": "^8.9.0",
|
|
68
|
-
"@atlaskit/select": "^21.
|
|
68
|
+
"@atlaskit/select": "^21.4.0",
|
|
69
69
|
"@atlaskit/spinner": "^19.0.0",
|
|
70
|
-
"@atlaskit/textarea": "^8.
|
|
71
|
-
"@atlaskit/textfield": "^8.
|
|
70
|
+
"@atlaskit/textarea": "^8.1.0",
|
|
71
|
+
"@atlaskit/textfield": "^8.1.0",
|
|
72
72
|
"@atlaskit/theme": "^21.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^13.38.0",
|
|
74
74
|
"@atlaskit/tokens": "^8.0.0",
|
|
75
|
-
"@atlaskit/tooltip": "^20.
|
|
75
|
+
"@atlaskit/tooltip": "^20.9.0",
|
|
76
76
|
"@atlaskit/ufo": "^0.4.0",
|
|
77
77
|
"@babel/runtime": "^7.0.0",
|
|
78
78
|
"@compiled/react": "^0.18.6",
|
|
@@ -237,6 +237,9 @@
|
|
|
237
237
|
},
|
|
238
238
|
"platform-linking-smart-card-layered-link-a11y": {
|
|
239
239
|
"type": "boolean"
|
|
240
|
+
},
|
|
241
|
+
"smart-link-custom-hover-card-content": {
|
|
242
|
+
"type": "boolean"
|
|
240
243
|
}
|
|
241
244
|
},
|
|
242
245
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|