@atlaskit/smart-card 26.47.0 → 26.47.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 +8 -0
- package/dist/cjs/extractors/common/meta/extractIsTrusted.js +0 -7
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +0 -5
- package/dist/cjs/view/HoverCard/components/ContentContainer.js +43 -0
- package/dist/cjs/view/HoverCard/components/CustomPopupContainer.js +7 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +18 -3
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +6 -7
- package/dist/cjs/view/HoverCard/styled.js +4 -2
- package/dist/cjs/view/HoverCard/utils.js +7 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/common/meta/extractIsTrusted.js +0 -7
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +0 -5
- package/dist/es2019/view/HoverCard/components/ContentContainer.js +33 -0
- package/dist/es2019/view/HoverCard/components/CustomPopupContainer.js +8 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +18 -6
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +6 -8
- package/dist/es2019/view/HoverCard/styled.js +4 -1
- package/dist/es2019/view/HoverCard/utils.js +4 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/common/meta/extractIsTrusted.js +0 -7
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +0 -5
- package/dist/esm/view/HoverCard/components/ContentContainer.js +36 -0
- package/dist/esm/view/HoverCard/components/CustomPopupContainer.js +8 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -6
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +6 -7
- package/dist/esm/view/HoverCard/styled.js +4 -1
- package/dist/esm/view/HoverCard/utils.js +6 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/view/HoverCard/components/ContentContainer.d.ts +4 -0
- package/dist/types/view/HoverCard/components/CustomPopupContainer.d.ts +5 -0
- package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +3 -0
- package/dist/types/view/HoverCard/styled.d.ts +1 -0
- package/dist/types/view/HoverCard/types.d.ts +5 -0
- package/dist/types/view/HoverCard/utils.d.ts +2 -1
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/ContentContainer.d.ts +4 -0
- package/dist/types-ts4.5/view/HoverCard/components/CustomPopupContainer.d.ts +5 -0
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +3 -0
- package/dist/types-ts4.5/view/HoverCard/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +5 -0
- package/dist/types-ts4.5/view/HoverCard/utils.d.ts +2 -1
- package/package.json +2 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.47.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#71683](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71683) [`eff650c49a32`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/eff650c49a32) - Add AI prism border to hover preview (behind platform.linking-platform.smart-card.hover-card-ai-summaries feature flag)
|
|
8
|
+
- [#72180](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72180) [`268634b4c024`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/268634b4c024) - Removes two unshipped feature flags, platform.linking-platform.smart-card.fix-is-trusted-pop and platform.linking-platform.smart-card.iframes-allow-storage-access-by-user-activation
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 26.47.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.extractIsTrusted = void 0;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
7
|
var extractIsTrusted = exports.extractIsTrusted = function extractIsTrusted(meta) {
|
|
9
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.fix-is-trusted-pop')) {
|
|
10
|
-
if (!(meta !== null && meta !== void 0 && meta.key)) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
return !['iframely-object-provider', 'public-object-provider'].includes(meta.key);
|
|
14
|
-
}
|
|
15
8
|
return Boolean((meta === null || meta === void 0 ? void 0 : meta.key) && meta.key !== 'iframely-object-provider');
|
|
16
9
|
};
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.47.
|
|
25
|
+
packageVersion: "26.47.1"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -11,7 +11,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
16
|
var isCardWithData = exports.isCardWithData = function isCardWithData(props) {
|
|
@@ -336,10 +335,6 @@ var getIframeSandboxAttribute = exports.getIframeSandboxAttribute = function get
|
|
|
336
335
|
return undefined;
|
|
337
336
|
}
|
|
338
337
|
var sandboxPermissions = 'allow-downloads allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts';
|
|
339
|
-
var allowStorageAccess = 'allow-storage-access-by-user-activation';
|
|
340
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.iframes-allow-storage-access-by-user-activation')) {
|
|
341
|
-
return "".concat(sandboxPermissions, " ").concat(allowStorageAccess);
|
|
342
|
-
}
|
|
343
338
|
return sandboxPermissions;
|
|
344
339
|
};
|
|
345
340
|
var handleOnClick = exports.handleOnClick = function handleOnClick(handler) {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = require("@emotion/react");
|
|
11
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
+
var _styled = require("../styled");
|
|
14
|
+
var _aiPrism = _interopRequireDefault(require("../../common/ai-prism"));
|
|
15
|
+
var _HoverCardContent = require("./HoverCardContent");
|
|
16
|
+
var _excluded = ["children", "isAIEnabled", "showPrism", "testId"];
|
|
17
|
+
/** @jsx jsx */
|
|
18
|
+
var ContentContainer = function ContentContainer(_ref) {
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
_ref$isAIEnabled = _ref.isAIEnabled,
|
|
21
|
+
isAIEnabled = _ref$isAIEnabled === void 0 ? false : _ref$isAIEnabled,
|
|
22
|
+
_ref$showPrism = _ref.showPrism,
|
|
23
|
+
showPrism = _ref$showPrism === void 0 ? false : _ref$showPrism,
|
|
24
|
+
testId = _ref.testId,
|
|
25
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
26
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-ai-summaries')) {
|
|
27
|
+
var container = (0, _react.jsx)("div", (0, _extends2.default)({
|
|
28
|
+
className: _HoverCardContent.hoverCardClassName,
|
|
29
|
+
css: [_styled.HoverCardContainer, isAIEnabled && showPrism ? undefined : _styled.popupContainerStyles],
|
|
30
|
+
"data-testid": testId
|
|
31
|
+
}, props), children);
|
|
32
|
+
return isAIEnabled ? (0, _react.jsx)(_aiPrism.default, {
|
|
33
|
+
isVisible: showPrism,
|
|
34
|
+
testId: "".concat(testId, "-prism")
|
|
35
|
+
}, container) : container;
|
|
36
|
+
}
|
|
37
|
+
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
38
|
+
className: _HoverCardContent.hoverCardClassName,
|
|
39
|
+
css: _styled.HoverCardContainer,
|
|
40
|
+
"data-testid": testId
|
|
41
|
+
}, props), children);
|
|
42
|
+
};
|
|
43
|
+
var _default = exports.default = ContentContainer;
|
|
@@ -8,15 +8,21 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _styled = require("../styled");
|
|
12
13
|
var _react2 = require("@emotion/react");
|
|
13
14
|
var _excluded = ["children"];
|
|
14
15
|
/** @jsx jsx */
|
|
16
|
+
/**
|
|
17
|
+
* The purpose of this component is to hide the default Popup border.
|
|
18
|
+
* HoverCard border implementation is in ContentContainer where it can
|
|
19
|
+
* change between the default border and prism border during runtime.
|
|
20
|
+
*/
|
|
15
21
|
var CustomPopupContainer = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
16
22
|
var children = _ref.children,
|
|
17
23
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
18
24
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
19
|
-
css: _styled.popupContainerStyles
|
|
25
|
+
css: (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-ai-summaries') ? undefined : _styled.popupContainerStyles
|
|
20
26
|
}, props, {
|
|
21
27
|
ref: ref
|
|
22
28
|
}), children);
|
|
@@ -7,11 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.hoverCardClassName = exports.getCopyAction = exports.default = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
12
|
var _react = require("@emotion/react");
|
|
12
13
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
14
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/glyph/copy"));
|
|
14
15
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
15
17
|
var _constants = require("../../../constants");
|
|
16
18
|
var _extractMetadata2 = require("../../../extractors/hover/extractMetadata");
|
|
17
19
|
var _analytics2 = require("../../../state/analytics");
|
|
@@ -27,6 +29,7 @@ var _messages = require("../../../messages");
|
|
|
27
29
|
var _click = require("../../../utils/analytics/click");
|
|
28
30
|
var _store = require("../../../state/store");
|
|
29
31
|
var _forbidden = _interopRequireDefault(require("./views/forbidden"));
|
|
32
|
+
var _ContentContainer = _interopRequireDefault(require("./ContentContainer"));
|
|
30
33
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
32
35
|
/** @jsx jsx */
|
|
@@ -88,9 +91,16 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
88
91
|
}, [cardState.details]);
|
|
89
92
|
var linkState = (0, _store.useSmartCardState)(url);
|
|
90
93
|
var linkStatus = (_linkState$status = linkState.status) !== null && _linkState$status !== void 0 ? _linkState$status : 'pending';
|
|
94
|
+
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
95
|
+
isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
|
|
96
|
+
var isAISummaryEnabled = (0, _utils2.getIsAISummaryEnabled)(isAdminHubAIEnabled, cardState.details);
|
|
91
97
|
var services = (0, _helpers.getServices)(linkState.details);
|
|
92
98
|
var statusRef = (0, _react2.useRef)(linkStatus);
|
|
93
99
|
var analyticsRef = (0, _react2.useRef)(analytics);
|
|
100
|
+
var _useState = (0, _react2.useState)(false),
|
|
101
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
102
|
+
showPrism = _useState2[0],
|
|
103
|
+
setShowPrism = _useState2[1];
|
|
94
104
|
(0, _react2.useEffect)(function () {
|
|
95
105
|
/**
|
|
96
106
|
* Must access current analytics object value via ref because its not stable
|
|
@@ -163,6 +173,9 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
163
173
|
var onClickStopPropagation = (0, _react2.useCallback)(function (e) {
|
|
164
174
|
return e.stopPropagation();
|
|
165
175
|
}, []);
|
|
176
|
+
var onAIActionChange = (0, _react2.useCallback)(function (state) {
|
|
177
|
+
setShowPrism(state === 'loading');
|
|
178
|
+
}, []);
|
|
166
179
|
var getCardView = function getCardView(cardState) {
|
|
167
180
|
if (cardState.metadataStatus === 'pending') {
|
|
168
181
|
return (0, _react.jsx)(_resolving.default, {
|
|
@@ -193,19 +206,21 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
193
206
|
cardActions: cardActions,
|
|
194
207
|
cardState: cardState,
|
|
195
208
|
flexibleCardProps: flexibleCardProps,
|
|
209
|
+
isAISummaryEnabled: isAISummaryEnabled,
|
|
196
210
|
onActionClick: onActionClick,
|
|
211
|
+
onAIActionChange: onAIActionChange,
|
|
197
212
|
titleBlockProps: titleBlockProps
|
|
198
213
|
});
|
|
199
214
|
}
|
|
200
215
|
return null;
|
|
201
216
|
};
|
|
202
217
|
var cardView = getCardView(cardState);
|
|
203
|
-
return cardView ? (0, _react.jsx)(
|
|
218
|
+
return cardView ? (0, _react.jsx)(_ContentContainer.default, {
|
|
204
219
|
onMouseEnter: onMouseEnter,
|
|
205
220
|
onMouseLeave: onMouseLeave,
|
|
206
221
|
onClick: onClickStopPropagation,
|
|
207
|
-
|
|
208
|
-
|
|
222
|
+
isAIEnabled: isAISummaryEnabled,
|
|
223
|
+
showPrism: showPrism
|
|
209
224
|
}, cardView) : null;
|
|
210
225
|
};
|
|
211
226
|
var _default = exports.default = HoverCardContent;
|
|
@@ -20,7 +20,6 @@ var _messages = require("../../../../../messages");
|
|
|
20
20
|
var _reactIntlNext = require("react-intl-next");
|
|
21
21
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
22
|
var _helpers = require("../../../../../state/helpers");
|
|
23
|
-
var _state = require("../../../../../state");
|
|
24
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
25
|
var toFooterActions = exports.toFooterActions = function toFooterActions(cardActions, onActionClick) {
|
|
@@ -58,14 +57,16 @@ var toFooterActions = exports.toFooterActions = function toFooterActions(cardAct
|
|
|
58
57
|
return [followAction].concat((0, _toConsumableArray2.default)(actions));
|
|
59
58
|
};
|
|
60
59
|
var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
61
|
-
var _cardState$details
|
|
60
|
+
var _cardState$details;
|
|
62
61
|
var flexibleCardProps = _ref.flexibleCardProps,
|
|
63
62
|
titleBlockProps = _ref.titleBlockProps,
|
|
64
63
|
analytics = _ref.analytics,
|
|
65
64
|
cardState = _ref.cardState,
|
|
66
65
|
_ref$cardActions = _ref.cardActions,
|
|
67
66
|
cardActions = _ref$cardActions === void 0 ? [] : _ref$cardActions,
|
|
67
|
+
isAISummaryEnabled = _ref.isAISummaryEnabled,
|
|
68
68
|
onActionClick = _ref.onActionClick,
|
|
69
|
+
onAIActionChange = _ref.onAIActionChange,
|
|
69
70
|
extensionKey = _ref.extensionKey,
|
|
70
71
|
url = _ref.url;
|
|
71
72
|
var canBeDatasource = (0, _helpers.getCanBeDatasource)(cardState.details);
|
|
@@ -103,9 +104,6 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
103
104
|
data: data,
|
|
104
105
|
fallbackElementHeight: snippetHeight.current
|
|
105
106
|
});
|
|
106
|
-
var _useSmartLinkContext = (0, _state.useSmartLinkContext)(),
|
|
107
|
-
isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
|
|
108
|
-
var showAiView = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && ((_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 || (_cardState$details2 = _cardState$details2.meta) === null || _cardState$details2 === void 0 || (_cardState$details2 = _cardState$details2.supportedFeatures) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.includes('AISummary'));
|
|
109
107
|
return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, flexibleCardProps, imagePreview, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, titleBlockProps, {
|
|
110
108
|
metadataPosition: _constants.SmartLinkPosition.Top
|
|
111
109
|
})), /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
|
|
@@ -127,11 +125,12 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
127
125
|
}), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/_react.default.createElement(_blocks.RelatedUrlsBlock, {
|
|
128
126
|
url: url,
|
|
129
127
|
size: _constants.SmartLinkSize.Small
|
|
130
|
-
}),
|
|
128
|
+
}), isAISummaryEnabled ? /*#__PURE__*/_react.default.createElement(_blocks.AISummaryBlock, {
|
|
131
129
|
metadata: [{
|
|
132
130
|
name: _constants.ElementName.Provider
|
|
133
131
|
}],
|
|
134
|
-
actions: footerActions
|
|
132
|
+
actions: footerActions,
|
|
133
|
+
onAIActionChange: onAIActionChange
|
|
135
134
|
}) : /*#__PURE__*/_react.default.createElement(_blocks.FooterBlock, {
|
|
136
135
|
actions: footerActions,
|
|
137
136
|
size: _constants.SmartLinkSize.Large,
|
|
@@ -4,12 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.titleBlockCss = exports.separatorCss = exports.popupContainerStyles = exports.getTransitionStyles = exports.getPreviewBlockStyles = exports.flexibleUiOptions = exports.HoverCardContainer = exports.HOVER_CARD_Z_INDEX = exports.CARD_WIDTH_REM = exports.CARD_GAP_PX = void 0;
|
|
7
|
+
exports.titleBlockCss = exports.separatorCss = exports.popupContainerStyles = exports.getTransitionStyles = exports.getPreviewBlockStyles = exports.flexibleUiOptions = exports.NEW_CARD_WIDTH_REM = exports.HoverCardContainer = exports.HOVER_CARD_Z_INDEX = exports.CARD_WIDTH_REM = exports.CARD_GAP_PX = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _index = require("../../index");
|
|
11
11
|
var _constants = require("../../constants");
|
|
12
12
|
var _constants2 = require("@atlaskit/theme/constants");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
14
15
|
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
15
16
|
var HOVER_CARD_Z_INDEX = exports.HOVER_CARD_Z_INDEX = _constants2.layers.modal();
|
|
@@ -21,12 +22,13 @@ var flexibleUiOptions = exports.flexibleUiOptions = {
|
|
|
21
22
|
zIndex: HOVER_CARD_Z_INDEX + 1
|
|
22
23
|
};
|
|
23
24
|
var CARD_WIDTH_REM = exports.CARD_WIDTH_REM = 24;
|
|
25
|
+
var NEW_CARD_WIDTH_REM = exports.NEW_CARD_WIDTH_REM = 28;
|
|
24
26
|
// gap between mouse cursor and hover card
|
|
25
27
|
var CARD_GAP_PX = exports.CARD_GAP_PX = 10;
|
|
26
28
|
var blockGap = '0.5rem';
|
|
27
29
|
var elementGap = '0.5rem';
|
|
28
30
|
var separatorCss = exports.separatorCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n [data-separator] + [data-separator]:before {\n margin-right: ", ";\n }\n"])), elementGap);
|
|
29
|
-
var HoverCardContainer = exports.HoverCardContainer = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: ", "rem;\n\n .", " {\n display: none;\n }\n"])), CARD_WIDTH_REM, _index.loadingPlaceholderClassName);
|
|
31
|
+
var HoverCardContainer = exports.HoverCardContainer = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: ", "rem;\n\n .", " {\n display: none;\n }\n"])), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-ai-summaries') ? NEW_CARD_WIDTH_REM : CARD_WIDTH_REM, _index.loadingPlaceholderClassName);
|
|
30
32
|
var titleBlockCss = exports.titleBlockCss = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n gap: ", ";\n\n ", "\n\n // title and subtitle element group\n [data-smart-element-group] {\n // gap between title and subtitle\n gap: 0.06rem;\n display: flex;\n /* subtitle element group */\n > [data-smart-element-group] {\n > span {\n margin-right: ", ";\n }\n }\n }\n\n [data-smart-element='Title'] {\n font-weight: 600;\n }\n"])), blockGap, separatorCss, elementGap);
|
|
31
33
|
var getTransitionStyles = exports.getTransitionStyles = function getTransitionStyles(snippetHeight) {
|
|
32
34
|
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n transition: height 300ms ease-in-out;\n height: ", "px;\n"])), snippetHeight);
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.getSimulatedMetadata = exports.getSimulatedBetterMetadata = void 0;
|
|
7
|
+
exports.getSimulatedMetadata = exports.getSimulatedBetterMetadata = exports.getIsAISummaryEnabled = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _constants = require("../../constants");
|
|
10
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
@@ -205,4 +205,10 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
|
|
|
205
205
|
default:
|
|
206
206
|
return defaultMetadata;
|
|
207
207
|
}
|
|
208
|
+
};
|
|
209
|
+
var getIsAISummaryEnabled = exports.getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
210
|
+
var _response$meta;
|
|
211
|
+
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
212
|
+
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
213
|
+
return Boolean((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeatures) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
|
|
208
214
|
};
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.47.
|
|
20
|
+
packageVersion: "26.47.1",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
export const extractIsTrusted = meta => {
|
|
3
|
-
if (getBooleanFF('platform.linking-platform.smart-card.fix-is-trusted-pop')) {
|
|
4
|
-
if (!(meta !== null && meta !== void 0 && meta.key)) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
return !['iframely-object-provider', 'public-object-provider'].includes(meta.key);
|
|
8
|
-
}
|
|
9
2
|
return Boolean((meta === null || meta === void 0 ? void 0 : meta.key) && meta.key !== 'iframely-object-provider');
|
|
10
3
|
};
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.47.
|
|
7
|
+
packageVersion: "26.47.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
export const isCardWithData = props => !!props.data;
|
|
5
4
|
export const isSpecialEvent = evt => evt.isDefaultPrevented() && (isIframe() || isSpecialKey(evt) || isSpecialClick(evt));
|
|
6
5
|
export const isIframe = () => window.parent !== parent;
|
|
@@ -104,10 +103,6 @@ export const getIframeSandboxAttribute = isTrusted => {
|
|
|
104
103
|
return undefined;
|
|
105
104
|
}
|
|
106
105
|
const sandboxPermissions = 'allow-downloads allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts';
|
|
107
|
-
const allowStorageAccess = 'allow-storage-access-by-user-activation';
|
|
108
|
-
if (getBooleanFF('platform.linking-platform.smart-card.iframes-allow-storage-access-by-user-activation')) {
|
|
109
|
-
return `${sandboxPermissions} ${allowStorageAccess}`;
|
|
110
|
-
}
|
|
111
106
|
return sandboxPermissions;
|
|
112
107
|
};
|
|
113
108
|
export const handleOnClick = handler => e => {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { HoverCardContainer, popupContainerStyles } from '../styled';
|
|
7
|
+
import AIPrism from '../../common/ai-prism';
|
|
8
|
+
import { hoverCardClassName } from './HoverCardContent';
|
|
9
|
+
const ContentContainer = ({
|
|
10
|
+
children,
|
|
11
|
+
isAIEnabled = false,
|
|
12
|
+
showPrism = false,
|
|
13
|
+
testId,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
if (getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries')) {
|
|
17
|
+
const container = jsx("div", _extends({
|
|
18
|
+
className: hoverCardClassName,
|
|
19
|
+
css: [HoverCardContainer, isAIEnabled && showPrism ? undefined : popupContainerStyles],
|
|
20
|
+
"data-testid": testId
|
|
21
|
+
}, props), children);
|
|
22
|
+
return isAIEnabled ? jsx(AIPrism, {
|
|
23
|
+
isVisible: showPrism,
|
|
24
|
+
testId: `${testId}-prism`
|
|
25
|
+
}, container) : container;
|
|
26
|
+
}
|
|
27
|
+
return jsx("div", _extends({
|
|
28
|
+
className: hoverCardClassName,
|
|
29
|
+
css: HoverCardContainer,
|
|
30
|
+
"data-testid": testId
|
|
31
|
+
}, props), children);
|
|
32
|
+
};
|
|
33
|
+
export default ContentContainer;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { popupContainerStyles } from '../styled';
|
|
5
6
|
import { jsx } from '@emotion/react';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The purpose of this component is to hide the default Popup border.
|
|
10
|
+
* HoverCard border implementation is in ContentContainer where it can
|
|
11
|
+
* change between the default border and prism border during runtime.
|
|
12
|
+
*/
|
|
6
13
|
const CustomPopupContainer = /*#__PURE__*/React.forwardRef(({
|
|
7
14
|
children,
|
|
8
15
|
...props
|
|
9
16
|
}, ref) => jsx("div", _extends({
|
|
10
|
-
css: popupContainerStyles
|
|
17
|
+
css: getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') ? undefined : popupContainerStyles
|
|
11
18
|
}, props, {
|
|
12
19
|
ref: ref
|
|
13
20
|
}), children));
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
5
|
-
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
6
7
|
import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
7
8
|
import { extractMetadata } from '../../../extractors/hover/extractMetadata';
|
|
8
9
|
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
9
10
|
import { getExtensionKey, getServices } from '../../../state/helpers';
|
|
10
11
|
import { isSpecialEvent } from '../../../utils';
|
|
11
|
-
import {
|
|
12
|
-
import { getSimulatedMetadata } from '../utils';
|
|
12
|
+
import { flexibleUiOptions, titleBlockCss } from '../styled';
|
|
13
|
+
import { getSimulatedMetadata, getIsAISummaryEnabled } from '../utils';
|
|
13
14
|
import HoverCardLoadingView from './views/resolving';
|
|
14
15
|
import HoverCardUnauthorisedView from './views/unauthorised';
|
|
15
16
|
import HoverCardResolvedView from './views/resolved';
|
|
@@ -18,6 +19,7 @@ import { messages } from '../../../messages';
|
|
|
18
19
|
import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
19
20
|
import { useSmartCardState } from '../../../state/store';
|
|
20
21
|
import HoverCardForbiddenView from './views/forbidden';
|
|
22
|
+
import ContentContainer from './ContentContainer';
|
|
21
23
|
export const hoverCardClassName = 'smart-links-hover-preview';
|
|
22
24
|
export const getCopyAction = url => ({
|
|
23
25
|
name: ActionName.CustomAction,
|
|
@@ -52,9 +54,14 @@ const HoverCardContent = ({
|
|
|
52
54
|
const extensionKey = useMemo(() => getExtensionKey(cardState.details), [cardState.details]);
|
|
53
55
|
const linkState = useSmartCardState(url);
|
|
54
56
|
const linkStatus = (_linkState$status = linkState.status) !== null && _linkState$status !== void 0 ? _linkState$status : 'pending';
|
|
57
|
+
const {
|
|
58
|
+
isAdminHubAIEnabled
|
|
59
|
+
} = useSmartLinkContext();
|
|
60
|
+
const isAISummaryEnabled = getIsAISummaryEnabled(isAdminHubAIEnabled, cardState.details);
|
|
55
61
|
const services = getServices(linkState.details);
|
|
56
62
|
const statusRef = useRef(linkStatus);
|
|
57
63
|
const analyticsRef = useRef(analytics);
|
|
64
|
+
const [showPrism, setShowPrism] = useState(false);
|
|
58
65
|
useEffect(() => {
|
|
59
66
|
/**
|
|
60
67
|
* Must access current analytics object value via ref because its not stable
|
|
@@ -124,6 +131,9 @@ const HoverCardContent = ({
|
|
|
124
131
|
analytics
|
|
125
132
|
};
|
|
126
133
|
const onClickStopPropagation = useCallback(e => e.stopPropagation(), []);
|
|
134
|
+
const onAIActionChange = useCallback(state => {
|
|
135
|
+
setShowPrism(state === 'loading');
|
|
136
|
+
}, []);
|
|
127
137
|
const getCardView = cardState => {
|
|
128
138
|
if (cardState.metadataStatus === 'pending') {
|
|
129
139
|
return jsx(HoverCardLoadingView, {
|
|
@@ -154,19 +164,21 @@ const HoverCardContent = ({
|
|
|
154
164
|
cardActions: cardActions,
|
|
155
165
|
cardState: cardState,
|
|
156
166
|
flexibleCardProps: flexibleCardProps,
|
|
167
|
+
isAISummaryEnabled: isAISummaryEnabled,
|
|
157
168
|
onActionClick: onActionClick,
|
|
169
|
+
onAIActionChange: onAIActionChange,
|
|
158
170
|
titleBlockProps: titleBlockProps
|
|
159
171
|
});
|
|
160
172
|
}
|
|
161
173
|
return null;
|
|
162
174
|
};
|
|
163
175
|
const cardView = getCardView(cardState);
|
|
164
|
-
return cardView ? jsx(
|
|
176
|
+
return cardView ? jsx(ContentContainer, {
|
|
165
177
|
onMouseEnter: onMouseEnter,
|
|
166
178
|
onMouseLeave: onMouseLeave,
|
|
167
179
|
onClick: onClickStopPropagation,
|
|
168
|
-
|
|
169
|
-
|
|
180
|
+
isAIEnabled: isAISummaryEnabled,
|
|
181
|
+
showPrism: showPrism
|
|
170
182
|
}, cardView) : null;
|
|
171
183
|
};
|
|
172
184
|
export default HoverCardContent;
|
|
@@ -11,7 +11,6 @@ import { messages } from '../../../../../messages';
|
|
|
11
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
12
12
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { getCanBeDatasource } from '../../../../../state/helpers';
|
|
14
|
-
import { useSmartLinkContext } from '../../../../../state';
|
|
15
14
|
export const toFooterActions = (cardActions, onActionClick) => {
|
|
16
15
|
const followAction = {
|
|
17
16
|
hideIcon: true,
|
|
@@ -52,11 +51,13 @@ const HoverCardResolvedView = ({
|
|
|
52
51
|
analytics,
|
|
53
52
|
cardState,
|
|
54
53
|
cardActions = [],
|
|
54
|
+
isAISummaryEnabled,
|
|
55
55
|
onActionClick,
|
|
56
|
+
onAIActionChange,
|
|
56
57
|
extensionKey,
|
|
57
58
|
url
|
|
58
59
|
}) => {
|
|
59
|
-
var _cardState$details
|
|
60
|
+
var _cardState$details;
|
|
60
61
|
const canBeDatasource = getCanBeDatasource(cardState.details);
|
|
61
62
|
useEffect(() => {
|
|
62
63
|
// Since this hover view is only rendered on resolved status,
|
|
@@ -91,10 +92,6 @@ const HoverCardResolvedView = ({
|
|
|
91
92
|
data: data,
|
|
92
93
|
fallbackElementHeight: snippetHeight.current
|
|
93
94
|
});
|
|
94
|
-
const {
|
|
95
|
-
isAdminHubAIEnabled
|
|
96
|
-
} = useSmartLinkContext();
|
|
97
|
-
const showAiView = getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && ((_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 ? void 0 : (_cardState$details2$m = _cardState$details2.meta) === null || _cardState$details2$m === void 0 ? void 0 : (_cardState$details2$m2 = _cardState$details2$m.supportedFeatures) === null || _cardState$details2$m2 === void 0 ? void 0 : _cardState$details2$m2.includes('AISummary'));
|
|
98
95
|
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
|
|
99
96
|
metadataPosition: SmartLinkPosition.Top
|
|
100
97
|
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
@@ -116,11 +113,12 @@ const HoverCardResolvedView = ({
|
|
|
116
113
|
}), getBooleanFF('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/React.createElement(RelatedUrlsBlock, {
|
|
117
114
|
url: url,
|
|
118
115
|
size: SmartLinkSize.Small
|
|
119
|
-
}),
|
|
116
|
+
}), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
120
117
|
metadata: [{
|
|
121
118
|
name: ElementName.Provider
|
|
122
119
|
}],
|
|
123
|
-
actions: footerActions
|
|
120
|
+
actions: footerActions,
|
|
121
|
+
onAIActionChange: onAIActionChange
|
|
124
122
|
}) : /*#__PURE__*/React.createElement(FooterBlock, {
|
|
125
123
|
actions: footerActions,
|
|
126
124
|
size: SmartLinkSize.Large,
|
|
@@ -2,6 +2,8 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { loadingPlaceholderClassName } from '../../index';
|
|
3
3
|
import { SmartLinkSize } from '../../constants';
|
|
4
4
|
import { layers } from '@atlaskit/theme/constants';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
|
|
5
7
|
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
6
8
|
export const HOVER_CARD_Z_INDEX = layers.modal();
|
|
7
9
|
export const flexibleUiOptions = {
|
|
@@ -12,6 +14,7 @@ export const flexibleUiOptions = {
|
|
|
12
14
|
zIndex: HOVER_CARD_Z_INDEX + 1
|
|
13
15
|
};
|
|
14
16
|
export const CARD_WIDTH_REM = 24;
|
|
17
|
+
export const NEW_CARD_WIDTH_REM = 28;
|
|
15
18
|
// gap between mouse cursor and hover card
|
|
16
19
|
export const CARD_GAP_PX = 10;
|
|
17
20
|
const blockGap = '0.5rem';
|
|
@@ -25,7 +28,7 @@ export const HoverCardContainer = css`
|
|
|
25
28
|
background: none;
|
|
26
29
|
border-width: 0;
|
|
27
30
|
box-sizing: border-box;
|
|
28
|
-
width: ${CARD_WIDTH_REM}rem;
|
|
31
|
+
width: ${getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') ? NEW_CARD_WIDTH_REM : CARD_WIDTH_REM}rem;
|
|
29
32
|
|
|
30
33
|
.${loadingPlaceholderClassName} {
|
|
31
34
|
display: none;
|
|
@@ -201,4 +201,8 @@ export const getSimulatedBetterMetadata = (extensionKey = '', data) => {
|
|
|
201
201
|
default:
|
|
202
202
|
return defaultMetadata;
|
|
203
203
|
}
|
|
204
|
+
};
|
|
205
|
+
export const getIsAISummaryEnabled = (isAdminHubAIEnabled = false, response) => {
|
|
206
|
+
var _response$meta, _response$meta$suppor;
|
|
207
|
+
return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$suppor = _response$meta.supportedFeatures) === null || _response$meta$suppor === void 0 ? void 0 : _response$meta$suppor.includes('AISummary')));
|
|
204
208
|
};
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.47.
|
|
10
|
+
packageVersion: "26.47.1",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
export var extractIsTrusted = function extractIsTrusted(meta) {
|
|
3
|
-
if (getBooleanFF('platform.linking-platform.smart-card.fix-is-trusted-pop')) {
|
|
4
|
-
if (!(meta !== null && meta !== void 0 && meta.key)) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
return !['iframely-object-provider', 'public-object-provider'].includes(meta.key);
|
|
8
|
-
}
|
|
9
2
|
return Boolean((meta === null || meta === void 0 ? void 0 : meta.key) && meta.key !== 'iframely-object-provider');
|
|
10
3
|
};
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.47.
|
|
18
|
+
packageVersion: "26.47.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Loadable from 'react-loadable';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
export var isCardWithData = function isCardWithData(props) {
|
|
8
7
|
return !!props.data;
|
|
9
8
|
};
|
|
@@ -226,10 +225,6 @@ export var getIframeSandboxAttribute = function getIframeSandboxAttribute(isTrus
|
|
|
226
225
|
return undefined;
|
|
227
226
|
}
|
|
228
227
|
var sandboxPermissions = 'allow-downloads allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts';
|
|
229
|
-
var allowStorageAccess = 'allow-storage-access-by-user-activation';
|
|
230
|
-
if (getBooleanFF('platform.linking-platform.smart-card.iframes-allow-storage-access-by-user-activation')) {
|
|
231
|
-
return "".concat(sandboxPermissions, " ").concat(allowStorageAccess);
|
|
232
|
-
}
|
|
233
228
|
return sandboxPermissions;
|
|
234
229
|
};
|
|
235
230
|
export var handleOnClick = function handleOnClick(handler) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "isAIEnabled", "showPrism", "testId"];
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { HoverCardContainer, popupContainerStyles } from '../styled';
|
|
9
|
+
import AIPrism from '../../common/ai-prism';
|
|
10
|
+
import { hoverCardClassName } from './HoverCardContent';
|
|
11
|
+
var ContentContainer = function ContentContainer(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
_ref$isAIEnabled = _ref.isAIEnabled,
|
|
14
|
+
isAIEnabled = _ref$isAIEnabled === void 0 ? false : _ref$isAIEnabled,
|
|
15
|
+
_ref$showPrism = _ref.showPrism,
|
|
16
|
+
showPrism = _ref$showPrism === void 0 ? false : _ref$showPrism,
|
|
17
|
+
testId = _ref.testId,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
if (getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries')) {
|
|
20
|
+
var container = jsx("div", _extends({
|
|
21
|
+
className: hoverCardClassName,
|
|
22
|
+
css: [HoverCardContainer, isAIEnabled && showPrism ? undefined : popupContainerStyles],
|
|
23
|
+
"data-testid": testId
|
|
24
|
+
}, props), children);
|
|
25
|
+
return isAIEnabled ? jsx(AIPrism, {
|
|
26
|
+
isVisible: showPrism,
|
|
27
|
+
testId: "".concat(testId, "-prism")
|
|
28
|
+
}, container) : container;
|
|
29
|
+
}
|
|
30
|
+
return jsx("div", _extends({
|
|
31
|
+
className: hoverCardClassName,
|
|
32
|
+
css: HoverCardContainer,
|
|
33
|
+
"data-testid": testId
|
|
34
|
+
}, props), children);
|
|
35
|
+
};
|
|
36
|
+
export default ContentContainer;
|
|
@@ -3,13 +3,20 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["children"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { popupContainerStyles } from '../styled';
|
|
7
8
|
import { jsx } from '@emotion/react';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The purpose of this component is to hide the default Popup border.
|
|
12
|
+
* HoverCard border implementation is in ContentContainer where it can
|
|
13
|
+
* change between the default border and prism border during runtime.
|
|
14
|
+
*/
|
|
8
15
|
var CustomPopupContainer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
9
16
|
var children = _ref.children,
|
|
10
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
18
|
return jsx("div", _extends({
|
|
12
|
-
css: popupContainerStyles
|
|
19
|
+
css: getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') ? undefined : popupContainerStyles
|
|
13
20
|
}, props, {
|
|
14
21
|
ref: ref
|
|
15
22
|
}), children);
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
4
|
/** @jsx jsx */
|
|
4
5
|
import { jsx } from '@emotion/react';
|
|
5
6
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
7
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
8
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
8
10
|
import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
9
11
|
import { extractMetadata } from '../../../extractors/hover/extractMetadata';
|
|
10
12
|
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
11
13
|
import { getExtensionKey, getServices } from '../../../state/helpers';
|
|
12
14
|
import { isSpecialEvent } from '../../../utils';
|
|
13
|
-
import {
|
|
14
|
-
import { getSimulatedMetadata } from '../utils';
|
|
15
|
+
import { flexibleUiOptions, titleBlockCss } from '../styled';
|
|
16
|
+
import { getSimulatedMetadata, getIsAISummaryEnabled } from '../utils';
|
|
15
17
|
import HoverCardLoadingView from './views/resolving';
|
|
16
18
|
import HoverCardUnauthorisedView from './views/unauthorised';
|
|
17
19
|
import HoverCardResolvedView from './views/resolved';
|
|
@@ -20,6 +22,7 @@ import { messages } from '../../../messages';
|
|
|
20
22
|
import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
21
23
|
import { useSmartCardState } from '../../../state/store';
|
|
22
24
|
import HoverCardForbiddenView from './views/forbidden';
|
|
25
|
+
import ContentContainer from './ContentContainer';
|
|
23
26
|
export var hoverCardClassName = 'smart-links-hover-preview';
|
|
24
27
|
export var getCopyAction = function getCopyAction(url) {
|
|
25
28
|
return {
|
|
@@ -77,9 +80,16 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
77
80
|
}, [cardState.details]);
|
|
78
81
|
var linkState = useSmartCardState(url);
|
|
79
82
|
var linkStatus = (_linkState$status = linkState.status) !== null && _linkState$status !== void 0 ? _linkState$status : 'pending';
|
|
83
|
+
var _useSmartLinkContext = useSmartLinkContext(),
|
|
84
|
+
isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
|
|
85
|
+
var isAISummaryEnabled = getIsAISummaryEnabled(isAdminHubAIEnabled, cardState.details);
|
|
80
86
|
var services = getServices(linkState.details);
|
|
81
87
|
var statusRef = useRef(linkStatus);
|
|
82
88
|
var analyticsRef = useRef(analytics);
|
|
89
|
+
var _useState = useState(false),
|
|
90
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
91
|
+
showPrism = _useState2[0],
|
|
92
|
+
setShowPrism = _useState2[1];
|
|
83
93
|
useEffect(function () {
|
|
84
94
|
/**
|
|
85
95
|
* Must access current analytics object value via ref because its not stable
|
|
@@ -152,6 +162,9 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
152
162
|
var onClickStopPropagation = useCallback(function (e) {
|
|
153
163
|
return e.stopPropagation();
|
|
154
164
|
}, []);
|
|
165
|
+
var onAIActionChange = useCallback(function (state) {
|
|
166
|
+
setShowPrism(state === 'loading');
|
|
167
|
+
}, []);
|
|
155
168
|
var getCardView = function getCardView(cardState) {
|
|
156
169
|
if (cardState.metadataStatus === 'pending') {
|
|
157
170
|
return jsx(HoverCardLoadingView, {
|
|
@@ -182,19 +195,21 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
182
195
|
cardActions: cardActions,
|
|
183
196
|
cardState: cardState,
|
|
184
197
|
flexibleCardProps: flexibleCardProps,
|
|
198
|
+
isAISummaryEnabled: isAISummaryEnabled,
|
|
185
199
|
onActionClick: onActionClick,
|
|
200
|
+
onAIActionChange: onAIActionChange,
|
|
186
201
|
titleBlockProps: titleBlockProps
|
|
187
202
|
});
|
|
188
203
|
}
|
|
189
204
|
return null;
|
|
190
205
|
};
|
|
191
206
|
var cardView = getCardView(cardState);
|
|
192
|
-
return cardView ? jsx(
|
|
207
|
+
return cardView ? jsx(ContentContainer, {
|
|
193
208
|
onMouseEnter: onMouseEnter,
|
|
194
209
|
onMouseLeave: onMouseLeave,
|
|
195
210
|
onClick: onClickStopPropagation,
|
|
196
|
-
|
|
197
|
-
|
|
211
|
+
isAIEnabled: isAISummaryEnabled,
|
|
212
|
+
showPrism: showPrism
|
|
198
213
|
}, cardView) : null;
|
|
199
214
|
};
|
|
200
215
|
export default HoverCardContent;
|
|
@@ -12,7 +12,6 @@ import { messages } from '../../../../../messages';
|
|
|
12
12
|
import { FormattedMessage } from 'react-intl-next';
|
|
13
13
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { getCanBeDatasource } from '../../../../../state/helpers';
|
|
15
|
-
import { useSmartLinkContext } from '../../../../../state';
|
|
16
15
|
export var toFooterActions = function toFooterActions(cardActions, onActionClick) {
|
|
17
16
|
var followAction = {
|
|
18
17
|
hideIcon: true,
|
|
@@ -48,14 +47,16 @@ export var toFooterActions = function toFooterActions(cardActions, onActionClick
|
|
|
48
47
|
return [followAction].concat(_toConsumableArray(actions));
|
|
49
48
|
};
|
|
50
49
|
var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
51
|
-
var _cardState$details
|
|
50
|
+
var _cardState$details;
|
|
52
51
|
var flexibleCardProps = _ref.flexibleCardProps,
|
|
53
52
|
titleBlockProps = _ref.titleBlockProps,
|
|
54
53
|
analytics = _ref.analytics,
|
|
55
54
|
cardState = _ref.cardState,
|
|
56
55
|
_ref$cardActions = _ref.cardActions,
|
|
57
56
|
cardActions = _ref$cardActions === void 0 ? [] : _ref$cardActions,
|
|
57
|
+
isAISummaryEnabled = _ref.isAISummaryEnabled,
|
|
58
58
|
onActionClick = _ref.onActionClick,
|
|
59
|
+
onAIActionChange = _ref.onAIActionChange,
|
|
59
60
|
extensionKey = _ref.extensionKey,
|
|
60
61
|
url = _ref.url;
|
|
61
62
|
var canBeDatasource = getCanBeDatasource(cardState.details);
|
|
@@ -93,9 +94,6 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
93
94
|
data: data,
|
|
94
95
|
fallbackElementHeight: snippetHeight.current
|
|
95
96
|
});
|
|
96
|
-
var _useSmartLinkContext = useSmartLinkContext(),
|
|
97
|
-
isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
|
|
98
|
-
var showAiView = getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && ((_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 || (_cardState$details2 = _cardState$details2.meta) === null || _cardState$details2 === void 0 || (_cardState$details2 = _cardState$details2.supportedFeatures) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.includes('AISummary'));
|
|
99
97
|
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
|
|
100
98
|
metadataPosition: SmartLinkPosition.Top
|
|
101
99
|
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
@@ -117,11 +115,12 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
117
115
|
}), getBooleanFF('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/React.createElement(RelatedUrlsBlock, {
|
|
118
116
|
url: url,
|
|
119
117
|
size: SmartLinkSize.Small
|
|
120
|
-
}),
|
|
118
|
+
}), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
121
119
|
metadata: [{
|
|
122
120
|
name: ElementName.Provider
|
|
123
121
|
}],
|
|
124
|
-
actions: footerActions
|
|
122
|
+
actions: footerActions,
|
|
123
|
+
onAIActionChange: onAIActionChange
|
|
125
124
|
}) : /*#__PURE__*/React.createElement(FooterBlock, {
|
|
126
125
|
actions: footerActions,
|
|
127
126
|
size: SmartLinkSize.Large,
|
|
@@ -4,6 +4,8 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import { loadingPlaceholderClassName } from '../../index';
|
|
5
5
|
import { SmartLinkSize } from '../../constants';
|
|
6
6
|
import { layers } from '@atlaskit/theme/constants';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
|
|
7
9
|
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
8
10
|
export var HOVER_CARD_Z_INDEX = layers.modal();
|
|
9
11
|
export var flexibleUiOptions = {
|
|
@@ -14,12 +16,13 @@ export var flexibleUiOptions = {
|
|
|
14
16
|
zIndex: HOVER_CARD_Z_INDEX + 1
|
|
15
17
|
};
|
|
16
18
|
export var CARD_WIDTH_REM = 24;
|
|
19
|
+
export var NEW_CARD_WIDTH_REM = 28;
|
|
17
20
|
// gap between mouse cursor and hover card
|
|
18
21
|
export var CARD_GAP_PX = 10;
|
|
19
22
|
var blockGap = '0.5rem';
|
|
20
23
|
var elementGap = '0.5rem';
|
|
21
24
|
export var separatorCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-separator] + [data-separator]:before {\n margin-right: ", ";\n }\n"])), elementGap);
|
|
22
|
-
export var HoverCardContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: ", "rem;\n\n .", " {\n display: none;\n }\n"])), CARD_WIDTH_REM, loadingPlaceholderClassName);
|
|
25
|
+
export var HoverCardContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: ", "rem;\n\n .", " {\n display: none;\n }\n"])), getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') ? NEW_CARD_WIDTH_REM : CARD_WIDTH_REM, loadingPlaceholderClassName);
|
|
23
26
|
export var titleBlockCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: ", ";\n\n ", "\n\n // title and subtitle element group\n [data-smart-element-group] {\n // gap between title and subtitle\n gap: 0.06rem;\n display: flex;\n /* subtitle element group */\n > [data-smart-element-group] {\n > span {\n margin-right: ", ";\n }\n }\n }\n\n [data-smart-element='Title'] {\n font-weight: 600;\n }\n"])), blockGap, separatorCss, elementGap);
|
|
24
27
|
export var getTransitionStyles = function getTransitionStyles(snippetHeight) {
|
|
25
28
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transition: height 300ms ease-in-out;\n height: ", "px;\n"])), snippetHeight);
|
|
@@ -198,4 +198,10 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
|
|
|
198
198
|
default:
|
|
199
199
|
return defaultMetadata;
|
|
200
200
|
}
|
|
201
|
+
};
|
|
202
|
+
export var getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
203
|
+
var _response$meta;
|
|
204
|
+
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
205
|
+
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
206
|
+
return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeatures) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
|
|
201
207
|
};
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.47.
|
|
13
|
+
packageVersion: "26.47.1",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -16,7 +16,7 @@ export declare const isSpecialKey: (event: React.MouseEvent | React.KeyboardEven
|
|
|
16
16
|
export declare const isSpecialClick: (event: React.MouseEvent) => boolean;
|
|
17
17
|
export declare const getIconForFileType: (fileMimeType: string) => React.ReactNode | undefined;
|
|
18
18
|
export declare const getLabelForFileType: (fileMimeType: string) => React.ReactNode | undefined;
|
|
19
|
-
export declare const getIframeSandboxAttribute: (isTrusted: boolean) =>
|
|
19
|
+
export declare const getIframeSandboxAttribute: (isTrusted: boolean) => "allow-downloads allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts" | undefined;
|
|
20
20
|
export declare const handleOnClick: (handler: Function) => (e: React.BaseSyntheticEvent) => void;
|
|
21
21
|
export declare const isIntersectionObserverSupported: () => boolean;
|
|
22
22
|
export declare const sleep: (ms: number) => Promise<void>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PopupComponentProps } from '@atlaskit/popup';
|
|
4
|
+
/**
|
|
5
|
+
* The purpose of this component is to hide the default Popup border.
|
|
6
|
+
* HoverCard border implementation is in ContentContainer where it can
|
|
7
|
+
* change between the default border and prism border during runtime.
|
|
8
|
+
*/
|
|
4
9
|
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "children" | "style" | "id" | "tabIndex" | "data-testid" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
10
|
export default CustomPopupContainer;
|
|
@@ -2,6 +2,7 @@ import { AnalyticsFacade } from '../../../../../state/analytics';
|
|
|
2
2
|
import { LinkAction } from '../../../../../state/hooks-external/useSmartLinkActions';
|
|
3
3
|
import { CardState } from '@atlaskit/linking-common';
|
|
4
4
|
import { HoverCardLoadingViewProps } from '../resolving/types';
|
|
5
|
+
import { AISummaryBlockProps } from '../../../../FlexibleCard/components/blocks/ai-summary-block/types';
|
|
5
6
|
export type HoverCardResolvedProps = {
|
|
6
7
|
extensionKey?: string;
|
|
7
8
|
id?: string;
|
|
@@ -9,5 +10,7 @@ export type HoverCardResolvedProps = {
|
|
|
9
10
|
analytics: AnalyticsFacade;
|
|
10
11
|
cardActions?: LinkAction[];
|
|
11
12
|
cardState: CardState;
|
|
13
|
+
isAISummaryEnabled?: boolean;
|
|
12
14
|
onActionClick: (actionId: string) => void;
|
|
15
|
+
onAIActionChange?: AISummaryBlockProps['onAIActionChange'];
|
|
13
16
|
} & HoverCardLoadingViewProps;
|
|
@@ -2,6 +2,7 @@ import { FlexibleUiOptions } from '../FlexibleCard/types';
|
|
|
2
2
|
export declare const HOVER_CARD_Z_INDEX: 510;
|
|
3
3
|
export declare const flexibleUiOptions: FlexibleUiOptions;
|
|
4
4
|
export declare const CARD_WIDTH_REM = 24;
|
|
5
|
+
export declare const NEW_CARD_WIDTH_REM = 28;
|
|
5
6
|
export declare const CARD_GAP_PX = 10;
|
|
6
7
|
export declare const separatorCss: import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const HoverCardContainer: import("@emotion/react").SerializedStyles;
|
|
@@ -99,6 +99,11 @@ export type HoverCardContentProps = {
|
|
|
99
99
|
onMouseLeave?: MouseEventHandler;
|
|
100
100
|
actionOptions?: CardActionOptions;
|
|
101
101
|
};
|
|
102
|
+
export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
103
|
+
isAIEnabled?: boolean;
|
|
104
|
+
showPrism?: boolean;
|
|
105
|
+
testId?: string;
|
|
106
|
+
};
|
|
102
107
|
export type ImagePreviewProps = {
|
|
103
108
|
data: JsonLd.Data.BaseData;
|
|
104
109
|
fallbackElementHeight: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { JsonLd } from 'json-ld-types';
|
|
1
|
+
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
export declare const getSimulatedMetadata: (extensionKey: string | undefined, data: JsonLd.Data.BaseData) => JsonLd.Primitives.Property<any>;
|
|
3
3
|
export declare const getSimulatedBetterMetadata: (extensionKey: string | undefined, data: JsonLd.Data.BaseData) => JsonLd.Primitives.Property<any>;
|
|
4
|
+
export declare const getIsAISummaryEnabled: (isAdminHubAIEnabled?: boolean, response?: JsonLd.Response) => boolean;
|
|
@@ -16,7 +16,7 @@ export declare const isSpecialKey: (event: React.MouseEvent | React.KeyboardEven
|
|
|
16
16
|
export declare const isSpecialClick: (event: React.MouseEvent) => boolean;
|
|
17
17
|
export declare const getIconForFileType: (fileMimeType: string) => React.ReactNode | undefined;
|
|
18
18
|
export declare const getLabelForFileType: (fileMimeType: string) => React.ReactNode | undefined;
|
|
19
|
-
export declare const getIframeSandboxAttribute: (isTrusted: boolean) =>
|
|
19
|
+
export declare const getIframeSandboxAttribute: (isTrusted: boolean) => "allow-downloads allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts" | undefined;
|
|
20
20
|
export declare const handleOnClick: (handler: Function) => (e: React.BaseSyntheticEvent) => void;
|
|
21
21
|
export declare const isIntersectionObserverSupported: () => boolean;
|
|
22
22
|
export declare const sleep: (ms: number) => Promise<void>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PopupComponentProps } from '@atlaskit/popup';
|
|
4
|
+
/**
|
|
5
|
+
* The purpose of this component is to hide the default Popup border.
|
|
6
|
+
* HoverCard border implementation is in ContentContainer where it can
|
|
7
|
+
* change between the default border and prism border during runtime.
|
|
8
|
+
*/
|
|
4
9
|
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "children" | "style" | "id" | "tabIndex" | "data-testid" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
10
|
export default CustomPopupContainer;
|
|
@@ -2,6 +2,7 @@ import { AnalyticsFacade } from '../../../../../state/analytics';
|
|
|
2
2
|
import { LinkAction } from '../../../../../state/hooks-external/useSmartLinkActions';
|
|
3
3
|
import { CardState } from '@atlaskit/linking-common';
|
|
4
4
|
import { HoverCardLoadingViewProps } from '../resolving/types';
|
|
5
|
+
import { AISummaryBlockProps } from '../../../../FlexibleCard/components/blocks/ai-summary-block/types';
|
|
5
6
|
export type HoverCardResolvedProps = {
|
|
6
7
|
extensionKey?: string;
|
|
7
8
|
id?: string;
|
|
@@ -9,5 +10,7 @@ export type HoverCardResolvedProps = {
|
|
|
9
10
|
analytics: AnalyticsFacade;
|
|
10
11
|
cardActions?: LinkAction[];
|
|
11
12
|
cardState: CardState;
|
|
13
|
+
isAISummaryEnabled?: boolean;
|
|
12
14
|
onActionClick: (actionId: string) => void;
|
|
15
|
+
onAIActionChange?: AISummaryBlockProps['onAIActionChange'];
|
|
13
16
|
} & HoverCardLoadingViewProps;
|
|
@@ -2,6 +2,7 @@ import { FlexibleUiOptions } from '../FlexibleCard/types';
|
|
|
2
2
|
export declare const HOVER_CARD_Z_INDEX: 510;
|
|
3
3
|
export declare const flexibleUiOptions: FlexibleUiOptions;
|
|
4
4
|
export declare const CARD_WIDTH_REM = 24;
|
|
5
|
+
export declare const NEW_CARD_WIDTH_REM = 28;
|
|
5
6
|
export declare const CARD_GAP_PX = 10;
|
|
6
7
|
export declare const separatorCss: import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const HoverCardContainer: import("@emotion/react").SerializedStyles;
|
|
@@ -99,6 +99,11 @@ export type HoverCardContentProps = {
|
|
|
99
99
|
onMouseLeave?: MouseEventHandler;
|
|
100
100
|
actionOptions?: CardActionOptions;
|
|
101
101
|
};
|
|
102
|
+
export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
103
|
+
isAIEnabled?: boolean;
|
|
104
|
+
showPrism?: boolean;
|
|
105
|
+
testId?: string;
|
|
106
|
+
};
|
|
102
107
|
export type ImagePreviewProps = {
|
|
103
108
|
data: JsonLd.Data.BaseData;
|
|
104
109
|
fallbackElementHeight: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { JsonLd } from 'json-ld-types';
|
|
1
|
+
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
export declare const getSimulatedMetadata: (extensionKey: string | undefined, data: JsonLd.Data.BaseData) => JsonLd.Primitives.Property<any>;
|
|
3
3
|
export declare const getSimulatedBetterMetadata: (extensionKey: string | undefined, data: JsonLd.Data.BaseData) => JsonLd.Primitives.Property<any>;
|
|
4
|
+
export declare const getIsAISummaryEnabled: (isAdminHubAIEnabled?: boolean, response?: JsonLd.Response) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.47.
|
|
3
|
+
"version": "26.47.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/primitives": "^2.0.0",
|
|
52
52
|
"@atlaskit/spinner": "^16.0.0",
|
|
53
53
|
"@atlaskit/theme": "^12.6.0",
|
|
54
|
-
"@atlaskit/tokens": "^1.
|
|
54
|
+
"@atlaskit/tokens": "^1.37.0",
|
|
55
55
|
"@atlaskit/tooltip": "^18.1.0",
|
|
56
56
|
"@atlaskit/ufo": "^0.2.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
@@ -138,12 +138,6 @@
|
|
|
138
138
|
".": "./src/index.ts"
|
|
139
139
|
},
|
|
140
140
|
"platform-feature-flags": {
|
|
141
|
-
"platform.linking-platform.smart-card.fix-is-trusted-pop": {
|
|
142
|
-
"type": "boolean"
|
|
143
|
-
},
|
|
144
|
-
"platform.linking-platform.smart-card.iframes-allow-storage-access-by-user-activation": {
|
|
145
|
-
"type": "boolean"
|
|
146
|
-
},
|
|
147
141
|
"platform.linking-platform.smart-card.enable-hover-card-related-urls": {
|
|
148
142
|
"type": "boolean"
|
|
149
143
|
},
|