@atlaskit/smart-card 43.12.1 → 43.12.3
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 +16 -0
- package/dist/cjs/messages.js +0 -30
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/analytics/click.js +69 -4
- package/dist/cjs/view/EmbedCard/views/not-found-view/not-found-svg/index.js +1 -1
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +4 -12
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -28
- package/dist/es2019/messages.js +0 -30
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/analytics/click.js +66 -3
- package/dist/es2019/view/EmbedCard/views/not-found-view/not-found-svg/index.js +1 -1
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +4 -12
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -28
- package/dist/esm/messages.js +0 -30
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/analytics/click.js +68 -3
- package/dist/esm/view/EmbedCard/views/not-found-view/not-found-svg/index.js +1 -1
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +4 -12
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +3 -28
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/utils/analytics/click.d.ts +2 -0
- package/dist/types/utils/analytics/types.d.ts +5 -0
- package/dist/types/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +1 -7
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/click.d.ts +2 -0
- package/dist/types-ts4.5/utils/analytics/types.d.ts +5 -0
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
- package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +1 -7
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 43.12.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9448bab5cc2c8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9448bab5cc2c8) -
|
|
8
|
+
[ux] Clean up logic from the platform_editor_google_hovercard_experiment experiment
|
|
9
|
+
|
|
10
|
+
## 43.12.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`62db1dbb5e93b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/62db1dbb5e93b) -
|
|
15
|
+
Add shortlinks to link clicked events. Only for updating metrics. Experiment here -
|
|
16
|
+
smart_link_confluence_short_link_analytics.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 43.12.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/messages.js
CHANGED
|
@@ -185,31 +185,6 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
185
185
|
defaultMessage: 'Connect your account to collaborate on work across Atlassian products.',
|
|
186
186
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view and we do not have the providers name.'
|
|
187
187
|
},
|
|
188
|
-
experiment_connect_unauthorised_account_action: {
|
|
189
|
-
id: 'fabric.linking.experiment_connect_unauthorised_account_action.non-final',
|
|
190
|
-
defaultMessage: 'Connect {context}',
|
|
191
|
-
description: 'Shown on a button to connect user external account to their Atlassian account.'
|
|
192
|
-
},
|
|
193
|
-
experiment_connect_link_account_card_name_title: {
|
|
194
|
-
id: 'fabric.linking.experiment_connect_link_account_card_name.non-final',
|
|
195
|
-
defaultMessage: 'Get more out of {context}',
|
|
196
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. Displayed in title.'
|
|
197
|
-
},
|
|
198
|
-
experiment_connect_hovercard_description_1: {
|
|
199
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_1.non-final',
|
|
200
|
-
defaultMessage: 'Connect your {context} account to turn simple URLs into rich, interactive previews, making it easier to collaborate and stay in context.',
|
|
201
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 1)'
|
|
202
|
-
},
|
|
203
|
-
experiment_connect_hovercard_description_2: {
|
|
204
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_2.non-final',
|
|
205
|
-
defaultMessage: 'Connect your {context} account to turn simple URLs into rich, interactive previews and unlock more AI experiences, making it easier to collaborate and stay in context.',
|
|
206
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 2)'
|
|
207
|
-
},
|
|
208
|
-
experiment_connect_hovercard_description_3: {
|
|
209
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_3.non-final',
|
|
210
|
-
defaultMessage: 'Transform ordinary URLs into rich, interactive previews of your {context} content, and unlock enhanced AI-powered features within your Atlassian apps.',
|
|
211
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 3)'
|
|
212
|
-
},
|
|
213
188
|
continue: {
|
|
214
189
|
id: 'fabric.linking.continue',
|
|
215
190
|
defaultMessage: 'Continue',
|
|
@@ -355,11 +330,6 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
355
330
|
defaultMessage: 'Learn more about Smart Links.',
|
|
356
331
|
description: 'An anchor link to redirect user to a page about Smart Links.'
|
|
357
332
|
},
|
|
358
|
-
experiment_learn_more_about_smart_links: {
|
|
359
|
-
id: 'fabric.linking.experiment_learn_more_about_smart_links.non-final',
|
|
360
|
-
defaultMessage: 'Learn more about smart link security and permissions.',
|
|
361
|
-
description: 'An anchor link to redirect user to a page about Smart Links.'
|
|
362
|
-
},
|
|
363
333
|
learn_more_about_connecting_account: {
|
|
364
334
|
id: 'fabric.linking.learn_more_about_connecting_account',
|
|
365
335
|
defaultMessage: 'Learn more about connecting your account to Atlassian products.',
|
|
@@ -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";
|
|
@@ -4,12 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.getKeys = exports.fireLinkClickedEvent = exports.createLinkClickedPayload = exports.buttonMap = void 0;
|
|
7
|
+
exports.getKeys = exports.fireLinkClickedEvent = exports.createLinkClickedPayloadOld = exports.createLinkClickedPayloadNew = exports.createLinkClickedPayload = exports.buttonMap = void 0;
|
|
8
8
|
exports.getLinkClickOutcome = getLinkClickOutcome;
|
|
9
9
|
exports.withLinkClickedEvent = withLinkClickedEvent;
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _userAgent = require("@atlaskit/linking-common/user-agent");
|
|
13
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
14
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
15
|
var _useLinkClicked = require("../../state/analytics/useLinkClicked");
|
|
14
16
|
var _analytics = require("./analytics");
|
|
15
17
|
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; }
|
|
@@ -78,7 +80,7 @@ function getLinkClickOutcome(e, clickType) {
|
|
|
78
80
|
}
|
|
79
81
|
return 'unknown';
|
|
80
82
|
}
|
|
81
|
-
var
|
|
83
|
+
var linkClickedEventOld = function linkClickedEventOld(_ref) {
|
|
82
84
|
var clickType = _ref.clickType,
|
|
83
85
|
clickOutcome = _ref.clickOutcome,
|
|
84
86
|
keysHeld = _ref.keysHeld,
|
|
@@ -95,7 +97,26 @@ var linkClickedEvent = function linkClickedEvent(_ref) {
|
|
|
95
97
|
}
|
|
96
98
|
};
|
|
97
99
|
};
|
|
98
|
-
var
|
|
100
|
+
var linkClickedEventWithShortLink = function linkClickedEventWithShortLink(_ref2) {
|
|
101
|
+
var clickType = _ref2.clickType,
|
|
102
|
+
clickOutcome = _ref2.clickOutcome,
|
|
103
|
+
keysHeld = _ref2.keysHeld,
|
|
104
|
+
defaultPrevented = _ref2.defaultPrevented,
|
|
105
|
+
isConfluenceShortLink = _ref2.isConfluenceShortLink;
|
|
106
|
+
return {
|
|
107
|
+
action: 'clicked',
|
|
108
|
+
actionSubject: 'link',
|
|
109
|
+
eventType: 'ui',
|
|
110
|
+
attributes: {
|
|
111
|
+
clickType: clickType,
|
|
112
|
+
clickOutcome: clickOutcome,
|
|
113
|
+
keysHeld: keysHeld,
|
|
114
|
+
defaultPrevented: defaultPrevented,
|
|
115
|
+
isConfluenceShortLink: isConfluenceShortLink
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
var createLinkClickedPayloadOld = exports.createLinkClickedPayloadOld = function createLinkClickedPayloadOld(event) {
|
|
99
120
|
// Through the `detail` property, we're able to determine if the event is (most likely) triggered via keyboard
|
|
100
121
|
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
|
|
101
122
|
var isKeyboard = event.nativeEvent.detail === 0;
|
|
@@ -106,7 +127,7 @@ var createLinkClickedPayload = exports.createLinkClickedPayload = function creat
|
|
|
106
127
|
var clickOutcome = getLinkClickOutcome(event, clickType);
|
|
107
128
|
var keysHeld = getKeys(event);
|
|
108
129
|
var defaultPrevented = event.defaultPrevented;
|
|
109
|
-
var linkClickedEventResult =
|
|
130
|
+
var linkClickedEventResult = linkClickedEventOld({
|
|
110
131
|
clickType: clickType,
|
|
111
132
|
clickOutcome: clickOutcome,
|
|
112
133
|
keysHeld: keysHeld,
|
|
@@ -126,6 +147,50 @@ var createLinkClickedPayload = exports.createLinkClickedPayload = function creat
|
|
|
126
147
|
return linkClickedEventResult;
|
|
127
148
|
}
|
|
128
149
|
};
|
|
150
|
+
var createLinkClickedPayloadNew = exports.createLinkClickedPayloadNew = function createLinkClickedPayloadNew(event) {
|
|
151
|
+
// Through the `detail` property, we're able to determine if the event is (most likely) triggered via keyboard
|
|
152
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
|
|
153
|
+
var isKeyboard = event.nativeEvent.detail === 0;
|
|
154
|
+
var clickType = isKeyboard ? 'keyboard' : buttonMap.get(event.button);
|
|
155
|
+
if (!clickType) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
var clickOutcome = getLinkClickOutcome(event, clickType);
|
|
159
|
+
var keysHeld = getKeys(event);
|
|
160
|
+
var defaultPrevented = event.defaultPrevented;
|
|
161
|
+
|
|
162
|
+
// Check if the URL is a Confluence shortLink (contains "/l/cp/")
|
|
163
|
+
var isConfluenceShortLink = false;
|
|
164
|
+
if (event.currentTarget instanceof HTMLAnchorElement) {
|
|
165
|
+
var url = event.currentTarget.href;
|
|
166
|
+
isConfluenceShortLink = url.includes('/l/cp/');
|
|
167
|
+
}
|
|
168
|
+
var linkClickedEventResult = linkClickedEventWithShortLink({
|
|
169
|
+
clickType: clickType,
|
|
170
|
+
clickOutcome: clickOutcome,
|
|
171
|
+
keysHeld: keysHeld,
|
|
172
|
+
defaultPrevented: defaultPrevented,
|
|
173
|
+
isConfluenceShortLink: isConfluenceShortLink
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// if the current target is an anchor tag, we can get the href from it and use that as the url being navigated too.
|
|
177
|
+
if (event.currentTarget instanceof HTMLAnchorElement) {
|
|
178
|
+
var _url = event.currentTarget.href;
|
|
179
|
+
return _objectSpread(_objectSpread({}, linkClickedEventResult), {}, {
|
|
180
|
+
nonPrivacySafeAttributes: {
|
|
181
|
+
url: _url
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
// We can't get the href from the event target, so dont include the url or any non privacy safe attributes
|
|
186
|
+
return linkClickedEventResult;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
var createLinkClickedPayload = exports.createLinkClickedPayload = (0, _platformFeatureFlagsReact.functionWithCondition)(function () {
|
|
190
|
+
return (0, _expValEquals.expValEquals)('smart_link_confluence_short_link_analytics', 'cohort', 'test');
|
|
191
|
+
},
|
|
192
|
+
// 12/17/2025: Clean up this feature gate once it's out in prod for 2 weeks - https://product-fabric.atlassian.net/browse/CCPERMS-5030
|
|
193
|
+
createLinkClickedPayloadNew, createLinkClickedPayloadOld);
|
|
129
194
|
var fireLinkClickedEvent = exports.fireLinkClickedEvent = function fireLinkClickedEvent(createAnalyticsEvent) {
|
|
130
195
|
return function (event) {
|
|
131
196
|
var overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -48,7 +48,7 @@ var NotFoundSVG = exports.NotFoundSVG = function NotFoundSVG() {
|
|
|
48
48
|
stopOpacity: "0.1"
|
|
49
49
|
}))), /*#__PURE__*/_react.default.createElement("title", null, (0, _platformFeatureFlags.fg)('navx-2825-eslint-translation-fix-linking-platform') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, {
|
|
50
50
|
defaultMessage: "Search error"
|
|
51
|
-
}) :
|
|
51
|
+
}) : 'Search error'), /*#__PURE__*/_react.default.createElement("g", {
|
|
52
52
|
id: "Layer_2",
|
|
53
53
|
"data-name": "Layer 2"
|
|
54
54
|
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
@@ -13,7 +13,6 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _reactIntlNext = require("react-intl-next");
|
|
16
|
-
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
17
16
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
18
17
|
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
19
18
|
var _constants = require("../../../../../constants");
|
|
@@ -50,29 +49,23 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
50
49
|
authorize(_constants.CardDisplay.HoverCardPreview);
|
|
51
50
|
}
|
|
52
51
|
}, [authorize, fireEvent]);
|
|
53
|
-
var hoverCardExperimentCohort = providerName === 'Google' ? _featureGateJsClient.default.getExperimentValue('platform_editor_google_hovercard_experiment', 'cohort', 'control') : 'control';
|
|
54
|
-
var connectActionMessage = hoverCardExperimentCohort === 'test1' || hoverCardExperimentCohort === 'test2' || hoverCardExperimentCohort === 'test3' ? _messages.messages.experiment_connect_unauthorised_account_action : _messages.messages.connect_unauthorised_account_action;
|
|
55
|
-
var hoverCardTitle = hoverCardExperimentCohort === 'test1' || hoverCardExperimentCohort === 'test2' ? _messages.messages.experiment_connect_link_account_card_name_title : _messages.messages.connect_link_account_card_name;
|
|
56
52
|
var actions = (0, _react.useMemo)(function () {
|
|
57
53
|
return [{
|
|
58
54
|
name: _constants.ActionName.CustomAction,
|
|
59
|
-
content: /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({},
|
|
55
|
+
content: /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_unauthorised_account_action, {
|
|
60
56
|
values: {
|
|
61
57
|
context: providerName
|
|
62
58
|
}
|
|
63
59
|
})),
|
|
64
60
|
onClick: handleAuthorize
|
|
65
61
|
}];
|
|
66
|
-
}, [handleAuthorize, providerName
|
|
67
|
-
if (hoverCardExperimentCohort === 'test4') {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
62
|
+
}, [handleAuthorize, providerName]);
|
|
70
63
|
return /*#__PURE__*/React.createElement(_FlexibleCard.default, (0, _extends2.default)({}, flexibleCardProps, {
|
|
71
64
|
testId: testId
|
|
72
65
|
}), /*#__PURE__*/React.createElement(_blocks.CustomBlock, {
|
|
73
66
|
testId: "".concat(testId, "-title"),
|
|
74
67
|
className: (0, _runtime.ax)(["_zulpu2gc _13mh1pd9"])
|
|
75
|
-
}, /*#__PURE__*/React.createElement(_elements.LinkIcon, null), /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({},
|
|
68
|
+
}, /*#__PURE__*/React.createElement(_elements.LinkIcon, null), /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages.connect_link_account_card_name, {
|
|
76
69
|
values: {
|
|
77
70
|
context: providerName
|
|
78
71
|
}
|
|
@@ -81,8 +74,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
81
74
|
className: (0, _runtime.ax)(["_11c8dcr7 _19pku2gc"])
|
|
82
75
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_UnauthorisedViewContent.default, {
|
|
83
76
|
providerName: providerName,
|
|
84
|
-
isProductIntegrationSupported: isProductIntegrationSupported
|
|
85
|
-
appearance: hoverCardExperimentCohort !== 'control' ? 'hoverCardPreview' : undefined
|
|
77
|
+
isProductIntegrationSupported: isProductIntegrationSupported
|
|
86
78
|
}))), /*#__PURE__*/React.createElement(_blocks.CustomBlock, {
|
|
87
79
|
testId: "".concat(testId, "-button"),
|
|
88
80
|
className: (0, _runtime.ax)(["_1bahesu3 _19pku2gc"])
|
|
@@ -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');
|
|
@@ -9,21 +9,12 @@ exports.default = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
|
-
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
13
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
14
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
16
15
|
var _constants = require("../../constants");
|
|
17
16
|
var _messages = require("../../messages");
|
|
18
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
|
-
var cohortMessages = {
|
|
20
|
-
control: _messages.messages.connect_unauthorised_account_description,
|
|
21
|
-
test1: _messages.messages.experiment_connect_hovercard_description_1,
|
|
22
|
-
test2: _messages.messages.experiment_connect_hovercard_description_2,
|
|
23
|
-
test3: _messages.messages.experiment_connect_hovercard_description_3,
|
|
24
|
-
test4: _messages.messages.connect_unauthorised_account_description
|
|
25
|
-
};
|
|
26
|
-
|
|
27
18
|
/**
|
|
28
19
|
* This component is used in unauthorized views of a smart link.
|
|
29
20
|
* It represents the main text that provides a user with information on how to connect their account
|
|
@@ -32,30 +23,14 @@ var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
|
32
23
|
var providerName = _ref.providerName,
|
|
33
24
|
isProductIntegrationSupported = _ref.isProductIntegrationSupported,
|
|
34
25
|
_ref$testId = _ref.testId,
|
|
35
|
-
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId
|
|
36
|
-
appearance = _ref.appearance;
|
|
26
|
+
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId;
|
|
37
27
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
38
28
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
39
29
|
var handleLearnMoreClick = (0, _react.useCallback)(function () {
|
|
40
30
|
fireEvent('ui.button.clicked.learnMore', {});
|
|
41
31
|
}, [fireEvent]);
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
if (isProductIntegrationSupported) {
|
|
45
|
-
if (hoverCardExperimentCohort === 'control') {
|
|
46
|
-
learnMoreMessage = (0, _platformFeatureFlags.fg)('product-terminology-refresh') ? _messages.messages.learn_more_about_connecting_account_appify : _messages.messages.learn_more_about_connecting_account;
|
|
47
|
-
} else {
|
|
48
|
-
learnMoreMessage = _messages.messages.experiment_learn_more_about_smart_links;
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
learnMoreMessage = _messages.messages.learn_more_about_smart_links;
|
|
52
|
-
}
|
|
53
|
-
var unauthorizedAccountDescriptionMessage;
|
|
54
|
-
if (hoverCardExperimentCohort === 'control') {
|
|
55
|
-
unauthorizedAccountDescriptionMessage = (0, _platformFeatureFlags.fg)('product-terminology-refresh') ? _messages.messages.connect_unauthorised_account_description_appify : _messages.messages.connect_unauthorised_account_description;
|
|
56
|
-
} else {
|
|
57
|
-
unauthorizedAccountDescriptionMessage = cohortMessages[hoverCardExperimentCohort];
|
|
58
|
-
}
|
|
32
|
+
var learnMoreMessage = isProductIntegrationSupported ? (0, _platformFeatureFlags.fg)('product-terminology-refresh') ? _messages.messages.learn_more_about_connecting_account_appify : _messages.messages.learn_more_about_connecting_account : _messages.messages.learn_more_about_smart_links;
|
|
33
|
+
var unauthorizedAccountDescriptionMessage = (0, _platformFeatureFlags.fg)('product-terminology-refresh') ? _messages.messages.connect_unauthorised_account_description_appify : _messages.messages.connect_unauthorised_account_description;
|
|
59
34
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, providerName ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, unauthorizedAccountDescriptionMessage, {
|
|
60
35
|
values: {
|
|
61
36
|
context: providerName
|
package/dist/es2019/messages.js
CHANGED
|
@@ -179,31 +179,6 @@ export const messages = defineMessages({
|
|
|
179
179
|
defaultMessage: 'Connect your account to collaborate on work across Atlassian products.',
|
|
180
180
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view and we do not have the providers name.'
|
|
181
181
|
},
|
|
182
|
-
experiment_connect_unauthorised_account_action: {
|
|
183
|
-
id: 'fabric.linking.experiment_connect_unauthorised_account_action.non-final',
|
|
184
|
-
defaultMessage: 'Connect {context}',
|
|
185
|
-
description: 'Shown on a button to connect user external account to their Atlassian account.'
|
|
186
|
-
},
|
|
187
|
-
experiment_connect_link_account_card_name_title: {
|
|
188
|
-
id: 'fabric.linking.experiment_connect_link_account_card_name.non-final',
|
|
189
|
-
defaultMessage: 'Get more out of {context}',
|
|
190
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. Displayed in title.'
|
|
191
|
-
},
|
|
192
|
-
experiment_connect_hovercard_description_1: {
|
|
193
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_1.non-final',
|
|
194
|
-
defaultMessage: 'Connect your {context} account to turn simple URLs into rich, interactive previews, making it easier to collaborate and stay in context.',
|
|
195
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 1)'
|
|
196
|
-
},
|
|
197
|
-
experiment_connect_hovercard_description_2: {
|
|
198
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_2.non-final',
|
|
199
|
-
defaultMessage: 'Connect your {context} account to turn simple URLs into rich, interactive previews and unlock more AI experiences, making it easier to collaborate and stay in context.',
|
|
200
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 2)'
|
|
201
|
-
},
|
|
202
|
-
experiment_connect_hovercard_description_3: {
|
|
203
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_3.non-final',
|
|
204
|
-
defaultMessage: 'Transform ordinary URLs into rich, interactive previews of your {context} content, and unlock enhanced AI-powered features within your Atlassian apps.',
|
|
205
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 3)'
|
|
206
|
-
},
|
|
207
182
|
continue: {
|
|
208
183
|
id: 'fabric.linking.continue',
|
|
209
184
|
defaultMessage: 'Continue',
|
|
@@ -349,11 +324,6 @@ export const messages = defineMessages({
|
|
|
349
324
|
defaultMessage: 'Learn more about Smart Links.',
|
|
350
325
|
description: 'An anchor link to redirect user to a page about Smart Links.'
|
|
351
326
|
},
|
|
352
|
-
experiment_learn_more_about_smart_links: {
|
|
353
|
-
id: 'fabric.linking.experiment_learn_more_about_smart_links.non-final',
|
|
354
|
-
defaultMessage: 'Learn more about smart link security and permissions.',
|
|
355
|
-
description: 'An anchor link to redirect user to a page about Smart Links.'
|
|
356
|
-
},
|
|
357
327
|
learn_more_about_connecting_account: {
|
|
358
328
|
id: 'fabric.linking.learn_more_about_connecting_account',
|
|
359
329
|
defaultMessage: 'Learn more about connecting your account to Atlassian products.',
|
|
@@ -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";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
3
|
+
import { functionWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
5
|
import { useLinkClicked, useMouseDownEvent } from '../../state/analytics/useLinkClicked';
|
|
4
6
|
import { ANALYTICS_CHANNEL } from './analytics';
|
|
5
7
|
export const buttonMap = new Map([[undefined, 'none'], [0, 'left'], [1, 'middle'], [2, 'right']]);
|
|
@@ -65,7 +67,7 @@ export function getLinkClickOutcome(e, clickType) {
|
|
|
65
67
|
}
|
|
66
68
|
return 'unknown';
|
|
67
69
|
}
|
|
68
|
-
const
|
|
70
|
+
const linkClickedEventOld = ({
|
|
69
71
|
clickType,
|
|
70
72
|
clickOutcome,
|
|
71
73
|
keysHeld,
|
|
@@ -81,7 +83,25 @@ const linkClickedEvent = ({
|
|
|
81
83
|
defaultPrevented
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
|
-
|
|
86
|
+
const linkClickedEventWithShortLink = ({
|
|
87
|
+
clickType,
|
|
88
|
+
clickOutcome,
|
|
89
|
+
keysHeld,
|
|
90
|
+
defaultPrevented,
|
|
91
|
+
isConfluenceShortLink
|
|
92
|
+
}) => ({
|
|
93
|
+
action: 'clicked',
|
|
94
|
+
actionSubject: 'link',
|
|
95
|
+
eventType: 'ui',
|
|
96
|
+
attributes: {
|
|
97
|
+
clickType,
|
|
98
|
+
clickOutcome,
|
|
99
|
+
keysHeld,
|
|
100
|
+
defaultPrevented,
|
|
101
|
+
isConfluenceShortLink
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
export const createLinkClickedPayloadOld = event => {
|
|
85
105
|
// Through the `detail` property, we're able to determine if the event is (most likely) triggered via keyboard
|
|
86
106
|
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
|
|
87
107
|
const isKeyboard = event.nativeEvent.detail === 0;
|
|
@@ -92,7 +112,7 @@ export const createLinkClickedPayload = event => {
|
|
|
92
112
|
const clickOutcome = getLinkClickOutcome(event, clickType);
|
|
93
113
|
const keysHeld = getKeys(event);
|
|
94
114
|
const defaultPrevented = event.defaultPrevented;
|
|
95
|
-
const linkClickedEventResult =
|
|
115
|
+
const linkClickedEventResult = linkClickedEventOld({
|
|
96
116
|
clickType,
|
|
97
117
|
clickOutcome,
|
|
98
118
|
keysHeld,
|
|
@@ -113,6 +133,49 @@ export const createLinkClickedPayload = event => {
|
|
|
113
133
|
return linkClickedEventResult;
|
|
114
134
|
}
|
|
115
135
|
};
|
|
136
|
+
export const createLinkClickedPayloadNew = event => {
|
|
137
|
+
// Through the `detail` property, we're able to determine if the event is (most likely) triggered via keyboard
|
|
138
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
|
|
139
|
+
const isKeyboard = event.nativeEvent.detail === 0;
|
|
140
|
+
const clickType = isKeyboard ? 'keyboard' : buttonMap.get(event.button);
|
|
141
|
+
if (!clickType) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const clickOutcome = getLinkClickOutcome(event, clickType);
|
|
145
|
+
const keysHeld = getKeys(event);
|
|
146
|
+
const defaultPrevented = event.defaultPrevented;
|
|
147
|
+
|
|
148
|
+
// Check if the URL is a Confluence shortLink (contains "/l/cp/")
|
|
149
|
+
let isConfluenceShortLink = false;
|
|
150
|
+
if (event.currentTarget instanceof HTMLAnchorElement) {
|
|
151
|
+
const url = event.currentTarget.href;
|
|
152
|
+
isConfluenceShortLink = url.includes('/l/cp/');
|
|
153
|
+
}
|
|
154
|
+
const linkClickedEventResult = linkClickedEventWithShortLink({
|
|
155
|
+
clickType,
|
|
156
|
+
clickOutcome,
|
|
157
|
+
keysHeld,
|
|
158
|
+
defaultPrevented,
|
|
159
|
+
isConfluenceShortLink
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// if the current target is an anchor tag, we can get the href from it and use that as the url being navigated too.
|
|
163
|
+
if (event.currentTarget instanceof HTMLAnchorElement) {
|
|
164
|
+
const url = event.currentTarget.href;
|
|
165
|
+
return {
|
|
166
|
+
...linkClickedEventResult,
|
|
167
|
+
nonPrivacySafeAttributes: {
|
|
168
|
+
url
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
} else {
|
|
172
|
+
// We can't get the href from the event target, so dont include the url or any non privacy safe attributes
|
|
173
|
+
return linkClickedEventResult;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
export const createLinkClickedPayload = functionWithCondition(() => expValEquals('smart_link_confluence_short_link_analytics', 'cohort', 'test'),
|
|
177
|
+
// 12/17/2025: Clean up this feature gate once it's out in prod for 2 weeks - https://product-fabric.atlassian.net/browse/CCPERMS-5030
|
|
178
|
+
createLinkClickedPayloadNew, createLinkClickedPayloadOld);
|
|
116
179
|
export const fireLinkClickedEvent = createAnalyticsEvent => (event, overrides = {}) => {
|
|
117
180
|
const payload = createLinkClickedPayload(event);
|
|
118
181
|
if (payload) {
|
|
@@ -40,7 +40,7 @@ export const NotFoundSVG = () => /*#__PURE__*/React.createElement("svg", {
|
|
|
40
40
|
stopOpacity: "0.1"
|
|
41
41
|
}))), /*#__PURE__*/React.createElement("title", null, fg('navx-2825-eslint-translation-fix-linking-platform') ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
42
42
|
defaultMessage: "Search error"
|
|
43
|
-
}) :
|
|
43
|
+
}) : 'Search error'), /*#__PURE__*/React.createElement("g", {
|
|
44
44
|
id: "Layer_2",
|
|
45
45
|
"data-name": "Layer 2"
|
|
46
46
|
}, /*#__PURE__*/React.createElement("g", {
|
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useMemo } from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
|
-
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
9
8
|
import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
10
9
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
11
10
|
import { ActionName, CardDisplay } from '../../../../../constants';
|
|
@@ -44,27 +43,21 @@ const HoverCardUnauthorisedView = ({
|
|
|
44
43
|
authorize(CardDisplay.HoverCardPreview);
|
|
45
44
|
}
|
|
46
45
|
}, [authorize, fireEvent]);
|
|
47
|
-
const hoverCardExperimentCohort = providerName === 'Google' ? FeatureGates.getExperimentValue('platform_editor_google_hovercard_experiment', 'cohort', 'control') : 'control';
|
|
48
|
-
const connectActionMessage = hoverCardExperimentCohort === 'test1' || hoverCardExperimentCohort === 'test2' || hoverCardExperimentCohort === 'test3' ? messages.experiment_connect_unauthorised_account_action : messages.connect_unauthorised_account_action;
|
|
49
|
-
const hoverCardTitle = hoverCardExperimentCohort === 'test1' || hoverCardExperimentCohort === 'test2' ? messages.experiment_connect_link_account_card_name_title : messages.connect_link_account_card_name;
|
|
50
46
|
const actions = useMemo(() => [{
|
|
51
47
|
name: ActionName.CustomAction,
|
|
52
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({},
|
|
48
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
|
|
53
49
|
values: {
|
|
54
50
|
context: providerName
|
|
55
51
|
}
|
|
56
52
|
})),
|
|
57
53
|
onClick: handleAuthorize
|
|
58
|
-
}], [handleAuthorize, providerName
|
|
59
|
-
if (hoverCardExperimentCohort === 'test4') {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
54
|
+
}], [handleAuthorize, providerName]);
|
|
62
55
|
return /*#__PURE__*/React.createElement(FlexibleCard, _extends({}, flexibleCardProps, {
|
|
63
56
|
testId: testId
|
|
64
57
|
}), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
65
58
|
testId: `${testId}-title`,
|
|
66
59
|
className: ax(["_zulpu2gc _13mh1pd9"])
|
|
67
|
-
}, /*#__PURE__*/React.createElement(LinkIcon, null), /*#__PURE__*/React.createElement(FormattedMessage, _extends({},
|
|
60
|
+
}, /*#__PURE__*/React.createElement(LinkIcon, null), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_link_account_card_name, {
|
|
68
61
|
values: {
|
|
69
62
|
context: providerName
|
|
70
63
|
}
|
|
@@ -73,8 +66,7 @@ const HoverCardUnauthorisedView = ({
|
|
|
73
66
|
className: ax(["_11c8dcr7 _19pku2gc"])
|
|
74
67
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
75
68
|
providerName: providerName,
|
|
76
|
-
isProductIntegrationSupported: isProductIntegrationSupported
|
|
77
|
-
appearance: hoverCardExperimentCohort !== 'control' ? 'hoverCardPreview' : undefined
|
|
69
|
+
isProductIntegrationSupported: isProductIntegrationSupported
|
|
78
70
|
}))), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
79
71
|
testId: `${testId}-button`,
|
|
80
72
|
className: ax(["_1bahesu3 _19pku2gc"])
|
|
@@ -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');
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
5
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Anchor } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
8
7
|
import { CONTENT_URL_3P_ACCOUNT_AUTH, CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
|
|
9
8
|
import { messages } from '../../messages';
|
|
10
|
-
const cohortMessages = {
|
|
11
|
-
control: messages.connect_unauthorised_account_description,
|
|
12
|
-
test1: messages.experiment_connect_hovercard_description_1,
|
|
13
|
-
test2: messages.experiment_connect_hovercard_description_2,
|
|
14
|
-
test3: messages.experiment_connect_hovercard_description_3,
|
|
15
|
-
test4: messages.connect_unauthorised_account_description
|
|
16
|
-
};
|
|
17
|
-
|
|
18
9
|
/**
|
|
19
10
|
* This component is used in unauthorized views of a smart link.
|
|
20
11
|
* It represents the main text that provides a user with information on how to connect their account
|
|
@@ -22,8 +13,7 @@ const cohortMessages = {
|
|
|
22
13
|
const UnauthorisedViewContent = ({
|
|
23
14
|
providerName,
|
|
24
15
|
isProductIntegrationSupported,
|
|
25
|
-
testId = 'unauthorised-view-content'
|
|
26
|
-
appearance
|
|
16
|
+
testId = 'unauthorised-view-content'
|
|
27
17
|
}) => {
|
|
28
18
|
const {
|
|
29
19
|
fireEvent
|
|
@@ -31,23 +21,8 @@ const UnauthorisedViewContent = ({
|
|
|
31
21
|
const handleLearnMoreClick = useCallback(() => {
|
|
32
22
|
fireEvent('ui.button.clicked.learnMore', {});
|
|
33
23
|
}, [fireEvent]);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
if (isProductIntegrationSupported) {
|
|
37
|
-
if (hoverCardExperimentCohort === 'control') {
|
|
38
|
-
learnMoreMessage = fg('product-terminology-refresh') ? messages.learn_more_about_connecting_account_appify : messages.learn_more_about_connecting_account;
|
|
39
|
-
} else {
|
|
40
|
-
learnMoreMessage = messages.experiment_learn_more_about_smart_links;
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
learnMoreMessage = messages.learn_more_about_smart_links;
|
|
44
|
-
}
|
|
45
|
-
let unauthorizedAccountDescriptionMessage;
|
|
46
|
-
if (hoverCardExperimentCohort === 'control') {
|
|
47
|
-
unauthorizedAccountDescriptionMessage = fg('product-terminology-refresh') ? messages.connect_unauthorised_account_description_appify : messages.connect_unauthorised_account_description;
|
|
48
|
-
} else {
|
|
49
|
-
unauthorizedAccountDescriptionMessage = cohortMessages[hoverCardExperimentCohort];
|
|
50
|
-
}
|
|
24
|
+
const learnMoreMessage = isProductIntegrationSupported ? fg('product-terminology-refresh') ? messages.learn_more_about_connecting_account_appify : messages.learn_more_about_connecting_account : messages.learn_more_about_smart_links;
|
|
25
|
+
const unauthorizedAccountDescriptionMessage = fg('product-terminology-refresh') ? messages.connect_unauthorised_account_description_appify : messages.connect_unauthorised_account_description;
|
|
51
26
|
return /*#__PURE__*/React.createElement(React.Fragment, null, providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, unauthorizedAccountDescriptionMessage, {
|
|
52
27
|
values: {
|
|
53
28
|
context: providerName
|
package/dist/esm/messages.js
CHANGED
|
@@ -179,31 +179,6 @@ export var messages = defineMessages({
|
|
|
179
179
|
defaultMessage: 'Connect your account to collaborate on work across Atlassian products.',
|
|
180
180
|
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view and we do not have the providers name.'
|
|
181
181
|
},
|
|
182
|
-
experiment_connect_unauthorised_account_action: {
|
|
183
|
-
id: 'fabric.linking.experiment_connect_unauthorised_account_action.non-final',
|
|
184
|
-
defaultMessage: 'Connect {context}',
|
|
185
|
-
description: 'Shown on a button to connect user external account to their Atlassian account.'
|
|
186
|
-
},
|
|
187
|
-
experiment_connect_link_account_card_name_title: {
|
|
188
|
-
id: 'fabric.linking.experiment_connect_link_account_card_name.non-final',
|
|
189
|
-
defaultMessage: 'Get more out of {context}',
|
|
190
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. Displayed in title.'
|
|
191
|
-
},
|
|
192
|
-
experiment_connect_hovercard_description_1: {
|
|
193
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_1.non-final',
|
|
194
|
-
defaultMessage: 'Connect your {context} account to turn simple URLs into rich, interactive previews, making it easier to collaborate and stay in context.',
|
|
195
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 1)'
|
|
196
|
-
},
|
|
197
|
-
experiment_connect_hovercard_description_2: {
|
|
198
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_2.non-final',
|
|
199
|
-
defaultMessage: 'Connect your {context} account to turn simple URLs into rich, interactive previews and unlock more AI experiences, making it easier to collaborate and stay in context.',
|
|
200
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 2)'
|
|
201
|
-
},
|
|
202
|
-
experiment_connect_hovercard_description_3: {
|
|
203
|
-
id: 'fabric.linking.experiment_connect_hovercard_description_3.non-final',
|
|
204
|
-
defaultMessage: 'Transform ordinary URLs into rich, interactive previews of your {context} content, and unlock enhanced AI-powered features within your Atlassian apps.',
|
|
205
|
-
description: 'Shown when a user does not have access to a link, but can connect their external account to view the link on card view. (experiment test 3)'
|
|
206
|
-
},
|
|
207
182
|
continue: {
|
|
208
183
|
id: 'fabric.linking.continue',
|
|
209
184
|
defaultMessage: 'Continue',
|
|
@@ -349,11 +324,6 @@ export var messages = defineMessages({
|
|
|
349
324
|
defaultMessage: 'Learn more about Smart Links.',
|
|
350
325
|
description: 'An anchor link to redirect user to a page about Smart Links.'
|
|
351
326
|
},
|
|
352
|
-
experiment_learn_more_about_smart_links: {
|
|
353
|
-
id: 'fabric.linking.experiment_learn_more_about_smart_links.non-final',
|
|
354
|
-
defaultMessage: 'Learn more about smart link security and permissions.',
|
|
355
|
-
description: 'An anchor link to redirect user to a page about Smart Links.'
|
|
356
|
-
},
|
|
357
327
|
learn_more_about_connecting_account: {
|
|
358
328
|
id: 'fabric.linking.learn_more_about_connecting_account',
|
|
359
329
|
defaultMessage: 'Learn more about connecting your account to Atlassian products.',
|
|
@@ -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";
|
|
@@ -3,6 +3,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
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; }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
6
|
+
import { functionWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
8
|
import { useLinkClicked, useMouseDownEvent } from '../../state/analytics/useLinkClicked';
|
|
7
9
|
import { ANALYTICS_CHANNEL } from './analytics';
|
|
8
10
|
export var buttonMap = new Map([[undefined, 'none'], [0, 'left'], [1, 'middle'], [2, 'right']]);
|
|
@@ -69,7 +71,7 @@ export function getLinkClickOutcome(e, clickType) {
|
|
|
69
71
|
}
|
|
70
72
|
return 'unknown';
|
|
71
73
|
}
|
|
72
|
-
var
|
|
74
|
+
var linkClickedEventOld = function linkClickedEventOld(_ref) {
|
|
73
75
|
var clickType = _ref.clickType,
|
|
74
76
|
clickOutcome = _ref.clickOutcome,
|
|
75
77
|
keysHeld = _ref.keysHeld,
|
|
@@ -86,7 +88,26 @@ var linkClickedEvent = function linkClickedEvent(_ref) {
|
|
|
86
88
|
}
|
|
87
89
|
};
|
|
88
90
|
};
|
|
89
|
-
|
|
91
|
+
var linkClickedEventWithShortLink = function linkClickedEventWithShortLink(_ref2) {
|
|
92
|
+
var clickType = _ref2.clickType,
|
|
93
|
+
clickOutcome = _ref2.clickOutcome,
|
|
94
|
+
keysHeld = _ref2.keysHeld,
|
|
95
|
+
defaultPrevented = _ref2.defaultPrevented,
|
|
96
|
+
isConfluenceShortLink = _ref2.isConfluenceShortLink;
|
|
97
|
+
return {
|
|
98
|
+
action: 'clicked',
|
|
99
|
+
actionSubject: 'link',
|
|
100
|
+
eventType: 'ui',
|
|
101
|
+
attributes: {
|
|
102
|
+
clickType: clickType,
|
|
103
|
+
clickOutcome: clickOutcome,
|
|
104
|
+
keysHeld: keysHeld,
|
|
105
|
+
defaultPrevented: defaultPrevented,
|
|
106
|
+
isConfluenceShortLink: isConfluenceShortLink
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export var createLinkClickedPayloadOld = function createLinkClickedPayloadOld(event) {
|
|
90
111
|
// Through the `detail` property, we're able to determine if the event is (most likely) triggered via keyboard
|
|
91
112
|
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
|
|
92
113
|
var isKeyboard = event.nativeEvent.detail === 0;
|
|
@@ -97,7 +118,7 @@ export var createLinkClickedPayload = function createLinkClickedPayload(event) {
|
|
|
97
118
|
var clickOutcome = getLinkClickOutcome(event, clickType);
|
|
98
119
|
var keysHeld = getKeys(event);
|
|
99
120
|
var defaultPrevented = event.defaultPrevented;
|
|
100
|
-
var linkClickedEventResult =
|
|
121
|
+
var linkClickedEventResult = linkClickedEventOld({
|
|
101
122
|
clickType: clickType,
|
|
102
123
|
clickOutcome: clickOutcome,
|
|
103
124
|
keysHeld: keysHeld,
|
|
@@ -117,6 +138,50 @@ export var createLinkClickedPayload = function createLinkClickedPayload(event) {
|
|
|
117
138
|
return linkClickedEventResult;
|
|
118
139
|
}
|
|
119
140
|
};
|
|
141
|
+
export var createLinkClickedPayloadNew = function createLinkClickedPayloadNew(event) {
|
|
142
|
+
// Through the `detail` property, we're able to determine if the event is (most likely) triggered via keyboard
|
|
143
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
|
|
144
|
+
var isKeyboard = event.nativeEvent.detail === 0;
|
|
145
|
+
var clickType = isKeyboard ? 'keyboard' : buttonMap.get(event.button);
|
|
146
|
+
if (!clickType) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
var clickOutcome = getLinkClickOutcome(event, clickType);
|
|
150
|
+
var keysHeld = getKeys(event);
|
|
151
|
+
var defaultPrevented = event.defaultPrevented;
|
|
152
|
+
|
|
153
|
+
// Check if the URL is a Confluence shortLink (contains "/l/cp/")
|
|
154
|
+
var isConfluenceShortLink = false;
|
|
155
|
+
if (event.currentTarget instanceof HTMLAnchorElement) {
|
|
156
|
+
var url = event.currentTarget.href;
|
|
157
|
+
isConfluenceShortLink = url.includes('/l/cp/');
|
|
158
|
+
}
|
|
159
|
+
var linkClickedEventResult = linkClickedEventWithShortLink({
|
|
160
|
+
clickType: clickType,
|
|
161
|
+
clickOutcome: clickOutcome,
|
|
162
|
+
keysHeld: keysHeld,
|
|
163
|
+
defaultPrevented: defaultPrevented,
|
|
164
|
+
isConfluenceShortLink: isConfluenceShortLink
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// if the current target is an anchor tag, we can get the href from it and use that as the url being navigated too.
|
|
168
|
+
if (event.currentTarget instanceof HTMLAnchorElement) {
|
|
169
|
+
var _url = event.currentTarget.href;
|
|
170
|
+
return _objectSpread(_objectSpread({}, linkClickedEventResult), {}, {
|
|
171
|
+
nonPrivacySafeAttributes: {
|
|
172
|
+
url: _url
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
} else {
|
|
176
|
+
// We can't get the href from the event target, so dont include the url or any non privacy safe attributes
|
|
177
|
+
return linkClickedEventResult;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
export var createLinkClickedPayload = functionWithCondition(function () {
|
|
181
|
+
return expValEquals('smart_link_confluence_short_link_analytics', 'cohort', 'test');
|
|
182
|
+
},
|
|
183
|
+
// 12/17/2025: Clean up this feature gate once it's out in prod for 2 weeks - https://product-fabric.atlassian.net/browse/CCPERMS-5030
|
|
184
|
+
createLinkClickedPayloadNew, createLinkClickedPayloadOld);
|
|
120
185
|
export var fireLinkClickedEvent = function fireLinkClickedEvent(createAnalyticsEvent) {
|
|
121
186
|
return function (event) {
|
|
122
187
|
var overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -41,7 +41,7 @@ export var NotFoundSVG = function NotFoundSVG() {
|
|
|
41
41
|
stopOpacity: "0.1"
|
|
42
42
|
}))), /*#__PURE__*/React.createElement("title", null, fg('navx-2825-eslint-translation-fix-linking-platform') ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
43
43
|
defaultMessage: "Search error"
|
|
44
|
-
}) :
|
|
44
|
+
}) : 'Search error'), /*#__PURE__*/React.createElement("g", {
|
|
45
45
|
id: "Layer_2",
|
|
46
46
|
"data-name": "Layer 2"
|
|
47
47
|
}, /*#__PURE__*/React.createElement("g", {
|
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useMemo } from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
|
-
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
9
8
|
import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
10
9
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
11
10
|
import { ActionName, CardDisplay } from '../../../../../constants';
|
|
@@ -41,29 +40,23 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
41
40
|
authorize(CardDisplay.HoverCardPreview);
|
|
42
41
|
}
|
|
43
42
|
}, [authorize, fireEvent]);
|
|
44
|
-
var hoverCardExperimentCohort = providerName === 'Google' ? FeatureGates.getExperimentValue('platform_editor_google_hovercard_experiment', 'cohort', 'control') : 'control';
|
|
45
|
-
var connectActionMessage = hoverCardExperimentCohort === 'test1' || hoverCardExperimentCohort === 'test2' || hoverCardExperimentCohort === 'test3' ? messages.experiment_connect_unauthorised_account_action : messages.connect_unauthorised_account_action;
|
|
46
|
-
var hoverCardTitle = hoverCardExperimentCohort === 'test1' || hoverCardExperimentCohort === 'test2' ? messages.experiment_connect_link_account_card_name_title : messages.connect_link_account_card_name;
|
|
47
43
|
var actions = useMemo(function () {
|
|
48
44
|
return [{
|
|
49
45
|
name: ActionName.CustomAction,
|
|
50
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({},
|
|
46
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
|
|
51
47
|
values: {
|
|
52
48
|
context: providerName
|
|
53
49
|
}
|
|
54
50
|
})),
|
|
55
51
|
onClick: handleAuthorize
|
|
56
52
|
}];
|
|
57
|
-
}, [handleAuthorize, providerName
|
|
58
|
-
if (hoverCardExperimentCohort === 'test4') {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
53
|
+
}, [handleAuthorize, providerName]);
|
|
61
54
|
return /*#__PURE__*/React.createElement(FlexibleCard, _extends({}, flexibleCardProps, {
|
|
62
55
|
testId: testId
|
|
63
56
|
}), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
64
57
|
testId: "".concat(testId, "-title"),
|
|
65
58
|
className: ax(["_zulpu2gc _13mh1pd9"])
|
|
66
|
-
}, /*#__PURE__*/React.createElement(LinkIcon, null), /*#__PURE__*/React.createElement(FormattedMessage, _extends({},
|
|
59
|
+
}, /*#__PURE__*/React.createElement(LinkIcon, null), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_link_account_card_name, {
|
|
67
60
|
values: {
|
|
68
61
|
context: providerName
|
|
69
62
|
}
|
|
@@ -72,8 +65,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
72
65
|
className: ax(["_11c8dcr7 _19pku2gc"])
|
|
73
66
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
74
67
|
providerName: providerName,
|
|
75
|
-
isProductIntegrationSupported: isProductIntegrationSupported
|
|
76
|
-
appearance: hoverCardExperimentCohort !== 'control' ? 'hoverCardPreview' : undefined
|
|
68
|
+
isProductIntegrationSupported: isProductIntegrationSupported
|
|
77
69
|
}))), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
78
70
|
testId: "".concat(testId, "-button"),
|
|
79
71
|
className: ax(["_1bahesu3 _19pku2gc"])
|
|
@@ -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');
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
5
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Anchor } from '@atlaskit/primitives/compiled';
|
|
7
6
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
8
7
|
import { CONTENT_URL_3P_ACCOUNT_AUTH, CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
|
|
9
8
|
import { messages } from '../../messages';
|
|
10
|
-
var cohortMessages = {
|
|
11
|
-
control: messages.connect_unauthorised_account_description,
|
|
12
|
-
test1: messages.experiment_connect_hovercard_description_1,
|
|
13
|
-
test2: messages.experiment_connect_hovercard_description_2,
|
|
14
|
-
test3: messages.experiment_connect_hovercard_description_3,
|
|
15
|
-
test4: messages.connect_unauthorised_account_description
|
|
16
|
-
};
|
|
17
|
-
|
|
18
9
|
/**
|
|
19
10
|
* This component is used in unauthorized views of a smart link.
|
|
20
11
|
* It represents the main text that provides a user with information on how to connect their account
|
|
@@ -23,30 +14,14 @@ var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
|
23
14
|
var providerName = _ref.providerName,
|
|
24
15
|
isProductIntegrationSupported = _ref.isProductIntegrationSupported,
|
|
25
16
|
_ref$testId = _ref.testId,
|
|
26
|
-
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId
|
|
27
|
-
appearance = _ref.appearance;
|
|
17
|
+
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId;
|
|
28
18
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
29
19
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
30
20
|
var handleLearnMoreClick = useCallback(function () {
|
|
31
21
|
fireEvent('ui.button.clicked.learnMore', {});
|
|
32
22
|
}, [fireEvent]);
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
if (isProductIntegrationSupported) {
|
|
36
|
-
if (hoverCardExperimentCohort === 'control') {
|
|
37
|
-
learnMoreMessage = fg('product-terminology-refresh') ? messages.learn_more_about_connecting_account_appify : messages.learn_more_about_connecting_account;
|
|
38
|
-
} else {
|
|
39
|
-
learnMoreMessage = messages.experiment_learn_more_about_smart_links;
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
learnMoreMessage = messages.learn_more_about_smart_links;
|
|
43
|
-
}
|
|
44
|
-
var unauthorizedAccountDescriptionMessage;
|
|
45
|
-
if (hoverCardExperimentCohort === 'control') {
|
|
46
|
-
unauthorizedAccountDescriptionMessage = fg('product-terminology-refresh') ? messages.connect_unauthorised_account_description_appify : messages.connect_unauthorised_account_description;
|
|
47
|
-
} else {
|
|
48
|
-
unauthorizedAccountDescriptionMessage = cohortMessages[hoverCardExperimentCohort];
|
|
49
|
-
}
|
|
23
|
+
var learnMoreMessage = isProductIntegrationSupported ? fg('product-terminology-refresh') ? messages.learn_more_about_connecting_account_appify : messages.learn_more_about_connecting_account : messages.learn_more_about_smart_links;
|
|
24
|
+
var unauthorizedAccountDescriptionMessage = fg('product-terminology-refresh') ? messages.connect_unauthorised_account_description_appify : messages.connect_unauthorised_account_description;
|
|
50
25
|
return /*#__PURE__*/React.createElement(React.Fragment, null, providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, unauthorizedAccountDescriptionMessage, {
|
|
51
26
|
values: {
|
|
52
27
|
context: providerName
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarized_info_short' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'ai_summary_error_exceeding_context_length_error' | 'ai_summary_action' | 'ai_summary_action_description' | 'automation_action_title' | 'automation_action_tooltip' | 'automation_action_icon_label' | 'automation_action_confluence_page_modal_title' | 'automation_action_confluence_page_modal_description' | 'copy_summary_action' | 'copy_summary_action_description' | 'copied_summary_action_description' | 'beta' | 'cannot_find_link' | 'compass_applied_components_count' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'follow_project_description' | 'follow_project_descriptionGalaxia' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'follow_project_error' | 'follow_project_errorGalaxia' | 'follow_goal_error' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'owned_by_override' | 'preview_description' | 'preview_improved' | 'preview_modal' | 'preview_panel' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'unfollow_project_description' | 'unfollow_project_descriptionGalaxia' | 'unfollow_project' | 'unfollow_project_error' | 'unfollow_project_errorGalaxia' | 'unfollow_goal' | 'unfollow_goal_description' | 'unfollow_goal_error' | 'user_attributes' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related' | 'generic_error_message' | 'related_links_modal_error_title' | 'related_links_modal_error_description' | 'related_links_modal_unavailable_title' | 'related_links_modal_unavailable_description' | 'related_links_modal_title' | 'related_links_view_related_urls' | 'related_links_view_related_links' | 'related_links_found_in' | 'related_links_includes_links_to' | 'related_links_not_found' | 'join_to_viewIssueTermRefresh' | 'open_issue_in_jiraIssueTermRefresh' | 'request_access_to_viewIssueTermRefresh' | 'team_members_count' | 'status_change_permission_errorIssueTermRefresh' | 'connect_unauthorised_account_description_appify' | 'connect_unauthorised_account_description_no_provider_appify' | 'learn_more_about_connecting_account_appify'
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarized_info_short' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'ai_summary_error_exceeding_context_length_error' | 'ai_summary_action' | 'ai_summary_action_description' | 'automation_action_title' | 'automation_action_tooltip' | 'automation_action_icon_label' | 'automation_action_confluence_page_modal_title' | 'automation_action_confluence_page_modal_description' | 'copy_summary_action' | 'copy_summary_action_description' | 'copied_summary_action_description' | 'beta' | 'cannot_find_link' | 'compass_applied_components_count' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'follow_project_description' | 'follow_project_descriptionGalaxia' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'follow_project_error' | 'follow_project_errorGalaxia' | 'follow_goal_error' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'owned_by_override' | 'preview_description' | 'preview_improved' | 'preview_modal' | 'preview_panel' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'unfollow_project_description' | 'unfollow_project_descriptionGalaxia' | 'unfollow_project' | 'unfollow_project_error' | 'unfollow_project_errorGalaxia' | 'unfollow_goal' | 'unfollow_goal_description' | 'unfollow_goal_error' | 'user_attributes' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related' | 'generic_error_message' | 'related_links_modal_error_title' | 'related_links_modal_error_description' | 'related_links_modal_unavailable_title' | 'related_links_modal_unavailable_description' | 'related_links_modal_title' | 'related_links_view_related_urls' | 'related_links_view_related_links' | 'related_links_found_in' | 'related_links_includes_links_to' | 'related_links_not_found' | 'join_to_viewIssueTermRefresh' | 'open_issue_in_jiraIssueTermRefresh' | 'request_access_to_viewIssueTermRefresh' | 'team_members_count' | 'status_change_permission_errorIssueTermRefresh' | 'connect_unauthorised_account_description_appify' | 'connect_unauthorised_account_description_no_provider_appify' | 'learn_more_about_connecting_account_appify';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -7,6 +7,8 @@ import { type ClickOutcome, type ClickType, type UiLinkClickedEventProps } from
|
|
|
7
7
|
export declare const buttonMap: Map<number | undefined, "left" | "right" | "none" | "middle">;
|
|
8
8
|
export declare const getKeys: (e: React.MouseEvent) => ("shift" | "meta" | "alt" | "ctrl")[];
|
|
9
9
|
export declare function getLinkClickOutcome(e: React.MouseEvent, clickType: ClickType): ClickOutcome;
|
|
10
|
+
export declare const createLinkClickedPayloadOld: (event: React.MouseEvent) => AnalyticsPayload | undefined;
|
|
11
|
+
export declare const createLinkClickedPayloadNew: (event: React.MouseEvent) => AnalyticsPayload | undefined;
|
|
10
12
|
export declare const createLinkClickedPayload: (event: React.MouseEvent) => AnalyticsPayload | undefined;
|
|
11
13
|
type DeepPartial<T> = T extends object ? {
|
|
12
14
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
@@ -21,4 +21,9 @@ export type UiLinkClickedEventProps = {
|
|
|
21
21
|
* The keys held by the user at the time of clicking the link (which influence `clickOutcome`)
|
|
22
22
|
*/
|
|
23
23
|
keysHeld: ('alt' | 'ctrl' | 'meta' | 'shift')[];
|
|
24
|
+
/**
|
|
25
|
+
* Whether the clicked URL is a Confluence shortLink (contains "/l/cp")
|
|
26
|
+
* Only included when the experiment is enabled
|
|
27
|
+
*/
|
|
28
|
+
isConfluenceShortLink?: boolean;
|
|
24
29
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type HoverCardUnauthorisedProps } from './types';
|
|
2
|
-
declare const HoverCardUnauthorisedView: ({ id, flexibleCardProps, testId, url, }: HoverCardUnauthorisedProps) => JSX.Element
|
|
2
|
+
declare const HoverCardUnauthorisedView: ({ id, flexibleCardProps, testId, url, }: HoverCardUnauthorisedProps) => JSX.Element;
|
|
3
3
|
export default HoverCardUnauthorisedView;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type CardInnerAppearance } from '../Card/types';
|
|
3
2
|
type UnauthorisedViewContentProps = {
|
|
4
|
-
/**
|
|
5
|
-
* The type of card this component is being used in.
|
|
6
|
-
* Determines the display behavior and messaging.
|
|
7
|
-
*/
|
|
8
|
-
appearance?: CardInnerAppearance;
|
|
9
3
|
/**
|
|
10
4
|
* If `true`, display an alternative message which prompts user to connect all
|
|
11
5
|
* Atlassian products (vs. smart links only) to the 3rd party account.
|
|
@@ -27,5 +21,5 @@ type UnauthorisedViewContentProps = {
|
|
|
27
21
|
* This component is used in unauthorized views of a smart link.
|
|
28
22
|
* It represents the main text that provides a user with information on how to connect their account
|
|
29
23
|
*/
|
|
30
|
-
declare const UnauthorisedViewContent: ({ providerName, isProductIntegrationSupported, testId,
|
|
24
|
+
declare const UnauthorisedViewContent: ({ providerName, isProductIntegrationSupported, testId, }: UnauthorisedViewContentProps) => React.JSX.Element;
|
|
31
25
|
export default UnauthorisedViewContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarized_info_short' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'ai_summary_error_exceeding_context_length_error' | 'ai_summary_action' | 'ai_summary_action_description' | 'automation_action_title' | 'automation_action_tooltip' | 'automation_action_icon_label' | 'automation_action_confluence_page_modal_title' | 'automation_action_confluence_page_modal_description' | 'copy_summary_action' | 'copy_summary_action_description' | 'copied_summary_action_description' | 'beta' | 'cannot_find_link' | 'compass_applied_components_count' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'follow_project_description' | 'follow_project_descriptionGalaxia' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'follow_project_error' | 'follow_project_errorGalaxia' | 'follow_goal_error' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'owned_by_override' | 'preview_description' | 'preview_improved' | 'preview_modal' | 'preview_panel' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'unfollow_project_description' | 'unfollow_project_descriptionGalaxia' | 'unfollow_project' | 'unfollow_project_error' | 'unfollow_project_errorGalaxia' | 'unfollow_goal' | 'unfollow_goal_description' | 'unfollow_goal_error' | 'user_attributes' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related' | 'generic_error_message' | 'related_links_modal_error_title' | 'related_links_modal_error_description' | 'related_links_modal_unavailable_title' | 'related_links_modal_unavailable_description' | 'related_links_modal_title' | 'related_links_view_related_urls' | 'related_links_view_related_links' | 'related_links_found_in' | 'related_links_includes_links_to' | 'related_links_not_found' | 'join_to_viewIssueTermRefresh' | 'open_issue_in_jiraIssueTermRefresh' | 'request_access_to_viewIssueTermRefresh' | 'team_members_count' | 'status_change_permission_errorIssueTermRefresh' | 'connect_unauthorised_account_description_appify' | 'connect_unauthorised_account_description_no_provider_appify' | 'learn_more_about_connecting_account_appify'
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarized_info_short' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'ai_summary_error_exceeding_context_length_error' | 'ai_summary_action' | 'ai_summary_action_description' | 'automation_action_title' | 'automation_action_tooltip' | 'automation_action_icon_label' | 'automation_action_confluence_page_modal_title' | 'automation_action_confluence_page_modal_description' | 'copy_summary_action' | 'copy_summary_action_description' | 'copied_summary_action_description' | 'beta' | 'cannot_find_link' | 'compass_applied_components_count' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'follow_project_description' | 'follow_project_descriptionGalaxia' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'follow_project_error' | 'follow_project_errorGalaxia' | 'follow_goal_error' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'owned_by_override' | 'preview_description' | 'preview_improved' | 'preview_modal' | 'preview_panel' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'unfollow_project_description' | 'unfollow_project_descriptionGalaxia' | 'unfollow_project' | 'unfollow_project_error' | 'unfollow_project_errorGalaxia' | 'unfollow_goal' | 'unfollow_goal_description' | 'unfollow_goal_error' | 'user_attributes' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related' | 'generic_error_message' | 'related_links_modal_error_title' | 'related_links_modal_error_description' | 'related_links_modal_unavailable_title' | 'related_links_modal_unavailable_description' | 'related_links_modal_title' | 'related_links_view_related_urls' | 'related_links_view_related_links' | 'related_links_found_in' | 'related_links_includes_links_to' | 'related_links_not_found' | 'join_to_viewIssueTermRefresh' | 'open_issue_in_jiraIssueTermRefresh' | 'request_access_to_viewIssueTermRefresh' | 'team_members_count' | 'status_change_permission_errorIssueTermRefresh' | 'connect_unauthorised_account_description_appify' | 'connect_unauthorised_account_description_no_provider_appify' | 'learn_more_about_connecting_account_appify';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -7,6 +7,8 @@ import { type ClickOutcome, type ClickType, type UiLinkClickedEventProps } from
|
|
|
7
7
|
export declare const buttonMap: Map<number | undefined, "left" | "right" | "none" | "middle">;
|
|
8
8
|
export declare const getKeys: (e: React.MouseEvent) => ("shift" | "meta" | "alt" | "ctrl")[];
|
|
9
9
|
export declare function getLinkClickOutcome(e: React.MouseEvent, clickType: ClickType): ClickOutcome;
|
|
10
|
+
export declare const createLinkClickedPayloadOld: (event: React.MouseEvent) => AnalyticsPayload | undefined;
|
|
11
|
+
export declare const createLinkClickedPayloadNew: (event: React.MouseEvent) => AnalyticsPayload | undefined;
|
|
10
12
|
export declare const createLinkClickedPayload: (event: React.MouseEvent) => AnalyticsPayload | undefined;
|
|
11
13
|
type DeepPartial<T> = T extends object ? {
|
|
12
14
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
@@ -21,4 +21,9 @@ export type UiLinkClickedEventProps = {
|
|
|
21
21
|
* The keys held by the user at the time of clicking the link (which influence `clickOutcome`)
|
|
22
22
|
*/
|
|
23
23
|
keysHeld: ('alt' | 'ctrl' | 'meta' | 'shift')[];
|
|
24
|
+
/**
|
|
25
|
+
* Whether the clicked URL is a Confluence shortLink (contains "/l/cp")
|
|
26
|
+
* Only included when the experiment is enabled
|
|
27
|
+
*/
|
|
28
|
+
isConfluenceShortLink?: boolean;
|
|
24
29
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type HoverCardUnauthorisedProps } from './types';
|
|
2
|
-
declare const HoverCardUnauthorisedView: ({ id, flexibleCardProps, testId, url, }: HoverCardUnauthorisedProps) => JSX.Element
|
|
2
|
+
declare const HoverCardUnauthorisedView: ({ id, flexibleCardProps, testId, url, }: HoverCardUnauthorisedProps) => JSX.Element;
|
|
3
3
|
export default HoverCardUnauthorisedView;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type CardInnerAppearance } from '../Card/types';
|
|
3
2
|
type UnauthorisedViewContentProps = {
|
|
4
|
-
/**
|
|
5
|
-
* The type of card this component is being used in.
|
|
6
|
-
* Determines the display behavior and messaging.
|
|
7
|
-
*/
|
|
8
|
-
appearance?: CardInnerAppearance;
|
|
9
3
|
/**
|
|
10
4
|
* If `true`, display an alternative message which prompts user to connect all
|
|
11
5
|
* Atlassian products (vs. smart links only) to the 3rd party account.
|
|
@@ -27,5 +21,5 @@ type UnauthorisedViewContentProps = {
|
|
|
27
21
|
* This component is used in unauthorized views of a smart link.
|
|
28
22
|
* It represents the main text that provides a user with information on how to connect their account
|
|
29
23
|
*/
|
|
30
|
-
declare const UnauthorisedViewContent: ({ providerName, isProductIntegrationSupported, testId,
|
|
24
|
+
declare const UnauthorisedViewContent: ({ providerName, isProductIntegrationSupported, testId, }: UnauthorisedViewContentProps) => React.JSX.Element;
|
|
31
25
|
export default UnauthorisedViewContent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.12.
|
|
3
|
+
"version": "43.12.3",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"@atlaskit/heading": "^5.2.0",
|
|
44
44
|
"@atlaskit/icon": "^29.0.0",
|
|
45
45
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
46
|
-
"@atlaskit/icon-lab": "^5.12.0",
|
|
47
46
|
"@atlaskit/icon-object": "^7.3.0",
|
|
48
47
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
49
48
|
"@atlaskit/image": "^3.0.0",
|
|
@@ -71,7 +70,7 @@
|
|
|
71
70
|
"@atlaskit/textarea": "^8.1.0",
|
|
72
71
|
"@atlaskit/textfield": "^8.1.0",
|
|
73
72
|
"@atlaskit/theme": "^21.0.0",
|
|
74
|
-
"@atlaskit/tmp-editor-statsig": "^14.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^14.6.0",
|
|
75
74
|
"@atlaskit/tokens": "^8.4.0",
|
|
76
75
|
"@atlaskit/tooltip": "^20.10.0",
|
|
77
76
|
"@atlaskit/ufo": "^0.4.0",
|
|
@@ -106,6 +105,7 @@
|
|
|
106
105
|
"@atlassian/analytics-tooling": "workspace:^",
|
|
107
106
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
108
107
|
"@atlassian/gemini": "^1.23.0",
|
|
108
|
+
"@atlassian/testing-library": "^0.4.0",
|
|
109
109
|
"@testing-library/dom": "^10.1.0",
|
|
110
110
|
"@testing-library/jest-dom": "^6.4.5",
|
|
111
111
|
"@testing-library/react": "^13.4.0",
|