@atlaskit/smart-card 27.17.0 → 27.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/extractors/inline/index.js +2 -2
- package/dist/cjs/utils/ai-summary.js +1 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +4 -2
- package/dist/cjs/view/CardWithUrl/loader.js +4 -2
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +1 -2
- package/dist/cjs/view/HoverCard/components/ContentContainer.js +4 -15
- package/dist/cjs/view/HoverCard/components/CustomPopupContainer.js +1 -9
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -3
- package/dist/cjs/view/HoverCard/styled.js +1 -2
- package/dist/cjs/view/InlineCard/index.js +3 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/inline/index.js +2 -2
- package/dist/es2019/utils/ai-summary.js +1 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +4 -2
- package/dist/es2019/view/CardWithUrl/loader.js +4 -2
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +1 -2
- package/dist/es2019/view/HoverCard/components/ContentContainer.js +5 -18
- package/dist/es2019/view/HoverCard/components/CustomPopupContainer.js +1 -9
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +2 -4
- package/dist/es2019/view/HoverCard/styled.js +1 -3
- package/dist/es2019/view/InlineCard/index.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/inline/index.js +2 -2
- package/dist/esm/utils/ai-summary.js +1 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +4 -2
- package/dist/esm/view/CardWithUrl/loader.js +4 -2
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +1 -2
- package/dist/esm/view/HoverCard/components/ContentContainer.js +4 -15
- package/dist/esm/view/HoverCard/components/CustomPopupContainer.js +1 -9
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +2 -4
- package/dist/esm/view/HoverCard/styled.js +1 -3
- package/dist/esm/view/InlineCard/index.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/inline/index.d.ts +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +7 -0
- package/dist/types/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types/view/HoverCard/components/ContentContainer.d.ts +2 -6
- package/dist/types/view/InlineCard/index.d.ts +1 -1
- package/dist/types/view/InlineCard/types.d.ts +1 -0
- package/dist/types-ts4.5/extractors/inline/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +7 -0
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types-ts4.5/view/HoverCard/components/ContentContainer.d.ts +2 -6
- package/dist/types-ts4.5/view/InlineCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +1 -0
- package/package.json +5 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 27.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#134316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134316)
|
|
8
|
+
[`921e345ee41da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/921e345ee41da) -
|
|
9
|
+
[ux] Remove hover card AI Summary feature flag
|
|
10
|
+
|
|
11
|
+
## 27.18.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#133311](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/133311)
|
|
16
|
+
[`d0dfe717c6cc3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d0dfe717c6cc3) -
|
|
17
|
+
Added removeTextHighlightingFromTitle prop to allow for removal of text fragment from the title
|
|
18
|
+
ofan inline smart card
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#133829](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/133829)
|
|
23
|
+
[`25a2501a70195`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/25a2501a70195) -
|
|
24
|
+
Cleaning up platform.linking-platform.smart-card.fix-embed-card-blurring FF
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 27.17.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
|
@@ -19,10 +19,10 @@ var extractInlineIcon = exports.extractInlineIcon = function extractInlineIcon(j
|
|
|
19
19
|
}
|
|
20
20
|
return (0, _icon.extractIcon)(jsonLd, 'provider');
|
|
21
21
|
};
|
|
22
|
-
var extractInlineProps = exports.extractInlineProps = function extractInlineProps(jsonLd, renderers) {
|
|
22
|
+
var extractInlineProps = exports.extractInlineProps = function extractInlineProps(jsonLd, renderers, removeTextHighlightingFromTitle) {
|
|
23
23
|
return {
|
|
24
24
|
link: (0, _linkExtractors.extractLink)(jsonLd),
|
|
25
|
-
title: (0, _linkExtractors.extractTitle)(jsonLd),
|
|
25
|
+
title: (0, _linkExtractors.extractTitle)(jsonLd, removeTextHighlightingFromTitle),
|
|
26
26
|
lozenge: (0, _lozenge.extractLozenge)(jsonLd),
|
|
27
27
|
icon: extractInlineIcon(jsonLd),
|
|
28
28
|
titleTextColor: (0, _primitives.extractTitleTextColor)(jsonLd),
|
|
@@ -4,14 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getIsAISummaryEnabled = exports.getAISummaryErrorMessage = void 0;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
7
|
var _constants = require("../constants");
|
|
9
8
|
var _messages = require("../messages");
|
|
10
9
|
var getIsAISummaryEnabled = exports.getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
11
10
|
var _response$meta;
|
|
12
11
|
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
13
12
|
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
14
|
-
return Boolean(
|
|
13
|
+
return Boolean(isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
|
|
15
14
|
};
|
|
16
15
|
var getAISummaryErrorMessage = exports.getAISummaryErrorMessage = function getAISummaryErrorMessage(error) {
|
|
17
16
|
switch (error) {
|
|
@@ -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: "27.
|
|
25
|
+
packageVersion: "27.19.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -52,7 +52,8 @@ function Component(_ref) {
|
|
|
52
52
|
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
53
53
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
54
54
|
analyticsEvents = _ref.analyticsEvents,
|
|
55
|
-
useLegacyBlockCard = _ref.useLegacyBlockCard
|
|
55
|
+
useLegacyBlockCard = _ref.useLegacyBlockCard,
|
|
56
|
+
removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle;
|
|
56
57
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
57
58
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
58
59
|
|
|
@@ -233,7 +234,8 @@ function Component(_ref) {
|
|
|
233
234
|
showHoverPreview: showHoverPreview,
|
|
234
235
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
235
236
|
showAuthTooltip: showAuthTooltip,
|
|
236
|
-
actionOptions: actionOptions
|
|
237
|
+
actionOptions: actionOptions,
|
|
238
|
+
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle
|
|
237
239
|
});
|
|
238
240
|
case 'block':
|
|
239
241
|
return /*#__PURE__*/_react.default.createElement(_BlockCard.BlockCard, {
|
|
@@ -66,7 +66,8 @@ function CardWithURLRenderer(props) {
|
|
|
66
66
|
analyticsEvents = props.analyticsEvents,
|
|
67
67
|
placeholder = props.placeholder,
|
|
68
68
|
fallbackComponent = props.fallbackComponent,
|
|
69
|
-
useLegacyBlockCard = props.useLegacyBlockCard
|
|
69
|
+
useLegacyBlockCard = props.useLegacyBlockCard,
|
|
70
|
+
removeTextHighlightingFromTitle = props.removeTextHighlightingFromTitle;
|
|
70
71
|
var analytics = (0, _analytics.useSmartLinkAnalytics)(url !== null && url !== void 0 ? url : '', undefined, id);
|
|
71
72
|
var isFlexibleUi = (0, _flexible.isFlexibleUiCard)(children);
|
|
72
73
|
var errorHandler = (0, _react.useCallback)(function (error, info) {
|
|
@@ -136,7 +137,8 @@ function CardWithURLRenderer(props) {
|
|
|
136
137
|
showAuthTooltip: showAuthTooltip,
|
|
137
138
|
analyticsEvents: analyticsEvents,
|
|
138
139
|
placeholder: placeholder,
|
|
139
|
-
useLegacyBlockCard: useLegacyBlockCard
|
|
140
|
+
useLegacyBlockCard: useLegacyBlockCard,
|
|
141
|
+
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle
|
|
140
142
|
};
|
|
141
143
|
return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
|
|
142
144
|
FallbackComponent: ErrorFallback,
|
|
@@ -10,7 +10,6 @@ var _styled = require("./styled");
|
|
|
10
10
|
var _handlers = require("../../BlockCard/utils/handlers");
|
|
11
11
|
var _useLinkClicked = require("../../../state/analytics/useLinkClicked");
|
|
12
12
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var ExpandedFrame = exports.ExpandedFrame = function ExpandedFrame(_ref) {
|
|
15
14
|
var _ref$isPlaceholder = _ref.isPlaceholder,
|
|
16
15
|
isPlaceholder = _ref$isPlaceholder === void 0 ? false : _ref$isPlaceholder,
|
|
@@ -63,7 +62,7 @@ var ExpandedFrame = exports.ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
63
62
|
return /*#__PURE__*/_react.default.createElement(_styled.Content, {
|
|
64
63
|
"data-testid": "embed-content-wrapper",
|
|
65
64
|
allowScrollBar: allowScrollBar,
|
|
66
|
-
removeOverflow:
|
|
65
|
+
removeOverflow: !setOverflow,
|
|
67
66
|
isInteractive: isInteractive(),
|
|
68
67
|
frameStyle: frameStyle
|
|
69
68
|
// This fixes an issue with input fields in cross domain iframes (ie. databases and jira fields from different domains)
|
|
@@ -10,7 +10,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = require("@emotion/react");
|
|
12
12
|
var _react2 = require("react");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _styled = require("../styled");
|
|
15
14
|
var _aiPrism = _interopRequireDefault(require("../../common/ai-prism"));
|
|
16
15
|
var _HoverCardContent = require("./HoverCardContent");
|
|
@@ -59,20 +58,10 @@ var ContentContainer = function ContentContainer(_ref2) {
|
|
|
59
58
|
testId = _ref2.testId,
|
|
60
59
|
url = _ref2.url,
|
|
61
60
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
testId: testId
|
|
67
|
-
}, props), children);
|
|
68
|
-
}
|
|
69
|
-
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
70
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
71
|
-
className: _HoverCardContent.hoverCardClassName
|
|
72
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
73
|
-
,
|
|
74
|
-
css: _styled.HoverCardContainer,
|
|
75
|
-
"data-testid": testId
|
|
61
|
+
return (0, _react.jsx)(ConnectedAIPrismContainer, (0, _extends2.default)({
|
|
62
|
+
isAIEnabled: isAIEnabled,
|
|
63
|
+
url: url,
|
|
64
|
+
testId: testId
|
|
76
65
|
}, props), children);
|
|
77
66
|
};
|
|
78
67
|
var _default = exports.default = ContentContainer;
|
|
@@ -8,8 +8,6 @@ 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");
|
|
12
|
-
var _styled = require("../styled");
|
|
13
11
|
var _react2 = require("@emotion/react");
|
|
14
12
|
var _excluded = ["children", "shouldFitContainer", "shouldRenderToParent"];
|
|
15
13
|
/**
|
|
@@ -27,13 +25,7 @@ var CustomPopupContainer = /*#__PURE__*/_react.default.forwardRef(function (_ref
|
|
|
27
25
|
_ = _ref.shouldFitContainer,
|
|
28
26
|
__ = _ref.shouldRenderToParent,
|
|
29
27
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
|
-
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
31
|
-
css:
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
33
|
-
(0, _platformFeatureFlags.fg)('platform.linking-platform.smart-card.hover-card-ai-summaries') ? undefined :
|
|
34
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
35
|
-
_styled.popupContainerStyles
|
|
36
|
-
}, props, {
|
|
28
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({}, props, {
|
|
37
29
|
ref: ref
|
|
38
30
|
}), children);
|
|
39
31
|
});
|
|
@@ -57,8 +57,6 @@ var toFooterActions = exports.toFooterActions = function toFooterActions(cardAct
|
|
|
57
57
|
});
|
|
58
58
|
return [followAction].concat((0, _toConsumableArray2.default)(actions));
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
//This component encapsulates useAISummarySmartLink hook under the AI Summary FF 'platform.linking-platform.smart-card.hover-card-ai-summaries'
|
|
62
60
|
var ConnectedAIBlock = function ConnectedAIBlock(_ref) {
|
|
63
61
|
var bottomPrimary = _ref.bottomPrimary,
|
|
64
62
|
imagePreview = _ref.imagePreview,
|
|
@@ -165,7 +163,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
|
|
|
165
163
|
overrideCss: _styled.metadataBlockCss,
|
|
166
164
|
maxLines: 1,
|
|
167
165
|
status: _constants.SmartLinkStatus.Resolved
|
|
168
|
-
}), (0, _platformFeatureFlags.
|
|
166
|
+
}), (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/_react.default.createElement(_blocks.RelatedUrlsBlock, {
|
|
169
167
|
url: url,
|
|
170
168
|
size: _constants.SmartLinkSize.Small
|
|
171
169
|
}), isAISummaryEnabled && /*#__PURE__*/_react.default.createElement(_blocks.AISummaryBlock, {
|
|
@@ -10,7 +10,6 @@ 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");
|
|
14
13
|
var _templateObject, _templateObject2; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
14
|
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
16
15
|
var HOVER_CARD_Z_INDEX = exports.HOVER_CARD_Z_INDEX = _constants2.layers.modal();
|
|
@@ -37,7 +36,7 @@ var separatorCss = exports.separatorCss = (0, _react.css)({
|
|
|
37
36
|
});
|
|
38
37
|
|
|
39
38
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
40
|
-
var HoverCardContainer = exports.HoverCardContainer = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tbackground: none;\n\tborder-width: 0;\n\tbox-sizing: border-box;\n\twidth: ", "rem;\n\n\t.", " {\n\t\tdisplay: none;\n\t}\n"])),
|
|
39
|
+
var HoverCardContainer = exports.HoverCardContainer = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tbackground: none;\n\tborder-width: 0;\n\tbox-sizing: border-box;\n\twidth: ", "rem;\n\n\t.", " {\n\t\tdisplay: none;\n\t}\n"])), NEW_CARD_WIDTH_REM, _index.loadingPlaceholderClassName);
|
|
41
40
|
|
|
42
41
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
43
42
|
var titleBlockCss = exports.titleBlockCss = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\tgap: ", ";\n\n\t", "\n\n\t// title and subtitle element group\n [data-smart-element-group] {\n\t\t// gap between title and subtitle\n\t\tgap: 0.06rem;\n\t\tdisplay: flex;\n\t\t/* subtitle element group */\n\t\t> [data-smart-element-group] {\n\t\t\t> span {\n\t\t\t\tmargin-right: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t[data-smart-element='Title'] {\n\t\tfont-weight: 600;\n\t}\n"])), blockGap, separatorCss, elementGap);
|
|
@@ -72,7 +72,8 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
72
72
|
showHoverPreview = _ref.showHoverPreview,
|
|
73
73
|
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
74
74
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
75
|
-
actionOptions = _ref.actionOptions
|
|
75
|
+
actionOptions = _ref.actionOptions,
|
|
76
|
+
removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle;
|
|
76
77
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
77
78
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
78
79
|
var status = cardState.status,
|
|
@@ -84,7 +85,7 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
84
85
|
if (showHoverPreview === undefined && showHoverPreviewFlag !== undefined) {
|
|
85
86
|
showHoverPreview = Boolean(showHoverPreviewFlag);
|
|
86
87
|
}
|
|
87
|
-
var resolvedProps = status === _constants.SmartLinkStatus.Resolved ? (0, _inline.extractInlineProps)(cardDetails, renderers) : {};
|
|
88
|
+
var resolvedProps = status === _constants.SmartLinkStatus.Resolved ? (0, _inline.extractInlineProps)(cardDetails, renderers, removeTextHighlightingFromTitle) : {};
|
|
88
89
|
(0, _react.useEffect)(function () {
|
|
89
90
|
switch (status) {
|
|
90
91
|
case _constants.SmartLinkStatus.Resolved:
|
|
@@ -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: "27.
|
|
20
|
+
packageVersion: "27.19.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -13,9 +13,9 @@ export const extractInlineIcon = jsonLd => {
|
|
|
13
13
|
}
|
|
14
14
|
return extractIcon(jsonLd, 'provider');
|
|
15
15
|
};
|
|
16
|
-
export const extractInlineProps = (jsonLd, renderers) => ({
|
|
16
|
+
export const extractInlineProps = (jsonLd, renderers, removeTextHighlightingFromTitle) => ({
|
|
17
17
|
link: extractLink(jsonLd),
|
|
18
|
-
title: extractTitle(jsonLd),
|
|
18
|
+
title: extractTitle(jsonLd, removeTextHighlightingFromTitle),
|
|
19
19
|
lozenge: extractLozenge(jsonLd),
|
|
20
20
|
icon: extractInlineIcon(jsonLd),
|
|
21
21
|
titleTextColor: extractTitleTextColor(jsonLd),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { CONTENT_URL_ACCEPTABLE_USE_POLICY, CONTENT_URL_AI_TROUBLESHOOTING } from '../constants';
|
|
3
2
|
import { messages } from '../messages';
|
|
4
3
|
export const getIsAISummaryEnabled = (isAdminHubAIEnabled = false, response) => {
|
|
5
4
|
var _response$meta, _response$meta$suppor;
|
|
6
|
-
return Boolean(
|
|
5
|
+
return Boolean(isAdminHubAIEnabled && (response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$suppor = _response$meta.supportedFeature) === null || _response$meta$suppor === void 0 ? void 0 : _response$meta$suppor.includes('AISummary')));
|
|
7
6
|
};
|
|
8
7
|
export const getAISummaryErrorMessage = error => {
|
|
9
8
|
switch (error) {
|
|
@@ -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: "27.
|
|
7
|
+
packageVersion: "27.19.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -42,7 +42,8 @@ function Component({
|
|
|
42
42
|
hoverPreviewOptions,
|
|
43
43
|
showAuthTooltip,
|
|
44
44
|
analyticsEvents,
|
|
45
|
-
useLegacyBlockCard
|
|
45
|
+
useLegacyBlockCard,
|
|
46
|
+
removeTextHighlightingFromTitle
|
|
46
47
|
}) {
|
|
47
48
|
const {
|
|
48
49
|
createAnalyticsEvent
|
|
@@ -220,7 +221,8 @@ function Component({
|
|
|
220
221
|
showHoverPreview: showHoverPreview,
|
|
221
222
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
222
223
|
showAuthTooltip: showAuthTooltip,
|
|
223
|
-
actionOptions: actionOptions
|
|
224
|
+
actionOptions: actionOptions,
|
|
225
|
+
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle
|
|
224
226
|
});
|
|
225
227
|
case 'block':
|
|
226
228
|
return /*#__PURE__*/React.createElement(BlockCard, {
|
|
@@ -45,7 +45,8 @@ export function CardWithURLRenderer(props) {
|
|
|
45
45
|
analyticsEvents,
|
|
46
46
|
placeholder,
|
|
47
47
|
fallbackComponent,
|
|
48
|
-
useLegacyBlockCard
|
|
48
|
+
useLegacyBlockCard,
|
|
49
|
+
removeTextHighlightingFromTitle
|
|
49
50
|
} = props;
|
|
50
51
|
const analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', undefined, id);
|
|
51
52
|
const isFlexibleUi = isFlexibleUiCard(children);
|
|
@@ -114,7 +115,8 @@ export function CardWithURLRenderer(props) {
|
|
|
114
115
|
showAuthTooltip,
|
|
115
116
|
analyticsEvents,
|
|
116
117
|
placeholder,
|
|
117
|
-
useLegacyBlockCard
|
|
118
|
+
useLegacyBlockCard,
|
|
119
|
+
removeTextHighlightingFromTitle
|
|
118
120
|
};
|
|
119
121
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
120
122
|
FallbackComponent: ErrorFallback,
|
|
@@ -3,7 +3,6 @@ import { className, LinkWrapper, Wrapper, Header, IconWrapper, TextWrapper, Tool
|
|
|
3
3
|
import { handleClickCommon } from '../../BlockCard/utils/handlers';
|
|
4
4
|
import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
|
|
5
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
export const ExpandedFrame = ({
|
|
8
7
|
isPlaceholder = false,
|
|
9
8
|
children,
|
|
@@ -44,7 +43,7 @@ export const ExpandedFrame = ({
|
|
|
44
43
|
const renderContent = () => /*#__PURE__*/React.createElement(Content, {
|
|
45
44
|
"data-testid": "embed-content-wrapper",
|
|
46
45
|
allowScrollBar: allowScrollBar,
|
|
47
|
-
removeOverflow:
|
|
46
|
+
removeOverflow: !setOverflow,
|
|
48
47
|
isInteractive: isInteractive(),
|
|
49
48
|
frameStyle: frameStyle
|
|
50
49
|
// This fixes an issue with input fields in cross domain iframes (ie. databases and jira fields from different domains)
|
|
@@ -6,7 +6,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { useState, useEffect } from 'react';
|
|
9
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { HoverCardContainer, popupContainerStyles } from '../styled';
|
|
11
10
|
import AIPrism from '../../common/ai-prism';
|
|
12
11
|
import { hoverCardClassName } from './HoverCardContent';
|
|
@@ -47,21 +46,9 @@ const ContentContainer = ({
|
|
|
47
46
|
testId,
|
|
48
47
|
url,
|
|
49
48
|
...props
|
|
50
|
-
}) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
testId: testId
|
|
56
|
-
}, props), children);
|
|
57
|
-
}
|
|
58
|
-
return jsx("div", _extends({
|
|
59
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
60
|
-
className: hoverCardClassName
|
|
61
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
62
|
-
,
|
|
63
|
-
css: HoverCardContainer,
|
|
64
|
-
"data-testid": testId
|
|
65
|
-
}, props), children);
|
|
66
|
-
};
|
|
49
|
+
}) => jsx(ConnectedAIPrismContainer, _extends({
|
|
50
|
+
isAIEnabled: isAIEnabled,
|
|
51
|
+
url: url,
|
|
52
|
+
testId: testId
|
|
53
|
+
}, props), children);
|
|
67
54
|
export default ContentContainer;
|
|
@@ -4,8 +4,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import { popupContainerStyles } from '../styled';
|
|
9
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
8
|
import { jsx } from '@emotion/react';
|
|
11
9
|
|
|
@@ -19,13 +17,7 @@ const CustomPopupContainer = /*#__PURE__*/React.forwardRef(({
|
|
|
19
17
|
shouldFitContainer: _,
|
|
20
18
|
shouldRenderToParent: __,
|
|
21
19
|
...props
|
|
22
|
-
}, ref) => jsx("div", _extends({
|
|
23
|
-
css:
|
|
24
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
25
|
-
fg('platform.linking-platform.smart-card.hover-card-ai-summaries') ? undefined :
|
|
26
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
27
|
-
popupContainerStyles
|
|
28
|
-
}, props, {
|
|
20
|
+
}, ref) => jsx("div", _extends({}, props, {
|
|
29
21
|
ref: ref
|
|
30
22
|
}), children));
|
|
31
23
|
export default CustomPopupContainer;
|
|
@@ -8,7 +8,7 @@ import { getMetadata } from '../../../utils';
|
|
|
8
8
|
import ImagePreview from '../../ImagePreview';
|
|
9
9
|
import { messages } from '../../../../../messages';
|
|
10
10
|
import { FormattedMessage } from 'react-intl-next';
|
|
11
|
-
import {
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import { getCanBeDatasource } from '../../../../../state/helpers';
|
|
13
13
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
14
14
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
@@ -47,8 +47,6 @@ export const toFooterActions = (cardActions, onActionClick) => {
|
|
|
47
47
|
});
|
|
48
48
|
return [followAction, ...actions];
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
//This component encapsulates useAISummarySmartLink hook under the AI Summary FF 'platform.linking-platform.smart-card.hover-card-ai-summaries'
|
|
52
50
|
const ConnectedAIBlock = ({
|
|
53
51
|
bottomPrimary,
|
|
54
52
|
imagePreview,
|
|
@@ -157,7 +155,7 @@ const HoverCardResolvedView = ({
|
|
|
157
155
|
overrideCss: metadataBlockCss,
|
|
158
156
|
maxLines: 1,
|
|
159
157
|
status: SmartLinkStatus.Resolved
|
|
160
|
-
}),
|
|
158
|
+
}), fg('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/React.createElement(RelatedUrlsBlock, {
|
|
161
159
|
url: url,
|
|
162
160
|
size: SmartLinkSize.Small
|
|
163
161
|
}), isAISummaryEnabled && /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
@@ -3,8 +3,6 @@ import { css } from '@emotion/react';
|
|
|
3
3
|
import { loadingPlaceholderClassName } from '../../index';
|
|
4
4
|
import { SmartLinkSize } from '../../constants';
|
|
5
5
|
import { layers } from '@atlaskit/theme/constants';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
|
|
8
6
|
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
9
7
|
export const HOVER_CARD_Z_INDEX = layers.modal();
|
|
10
8
|
export const flexibleUiOptions = {
|
|
@@ -34,7 +32,7 @@ export const HoverCardContainer = css`
|
|
|
34
32
|
background: none;
|
|
35
33
|
border-width: 0;
|
|
36
34
|
box-sizing: border-box;
|
|
37
|
-
width: ${
|
|
35
|
+
width: ${NEW_CARD_WIDTH_REM}rem;
|
|
38
36
|
|
|
39
37
|
.${loadingPlaceholderClassName} {
|
|
40
38
|
display: none;
|
|
@@ -32,7 +32,8 @@ export const InlineCard = ({
|
|
|
32
32
|
showHoverPreview,
|
|
33
33
|
hoverPreviewOptions,
|
|
34
34
|
showAuthTooltip,
|
|
35
|
-
actionOptions
|
|
35
|
+
actionOptions,
|
|
36
|
+
removeTextHighlightingFromTitle
|
|
36
37
|
}) => {
|
|
37
38
|
var _details$meta, _providerForbidden$te;
|
|
38
39
|
const {
|
|
@@ -49,7 +50,7 @@ export const InlineCard = ({
|
|
|
49
50
|
if (showHoverPreview === undefined && showHoverPreviewFlag !== undefined) {
|
|
50
51
|
showHoverPreview = Boolean(showHoverPreviewFlag);
|
|
51
52
|
}
|
|
52
|
-
const resolvedProps = status === SmartLinkStatus.Resolved ? extractInlineProps(cardDetails, renderers) : {};
|
|
53
|
+
const resolvedProps = status === SmartLinkStatus.Resolved ? extractInlineProps(cardDetails, renderers, removeTextHighlightingFromTitle) : {};
|
|
53
54
|
useEffect(() => {
|
|
54
55
|
switch (status) {
|
|
55
56
|
case SmartLinkStatus.Resolved:
|
|
@@ -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: "27.
|
|
10
|
+
packageVersion: "27.19.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -13,10 +13,10 @@ export var extractInlineIcon = function extractInlineIcon(jsonLd) {
|
|
|
13
13
|
}
|
|
14
14
|
return extractIcon(jsonLd, 'provider');
|
|
15
15
|
};
|
|
16
|
-
export var extractInlineProps = function extractInlineProps(jsonLd, renderers) {
|
|
16
|
+
export var extractInlineProps = function extractInlineProps(jsonLd, renderers, removeTextHighlightingFromTitle) {
|
|
17
17
|
return {
|
|
18
18
|
link: extractLink(jsonLd),
|
|
19
|
-
title: extractTitle(jsonLd),
|
|
19
|
+
title: extractTitle(jsonLd, removeTextHighlightingFromTitle),
|
|
20
20
|
lozenge: extractLozenge(jsonLd),
|
|
21
21
|
icon: extractInlineIcon(jsonLd),
|
|
22
22
|
titleTextColor: extractTitleTextColor(jsonLd),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { CONTENT_URL_ACCEPTABLE_USE_POLICY, CONTENT_URL_AI_TROUBLESHOOTING } from '../constants';
|
|
3
2
|
import { messages } from '../messages';
|
|
4
3
|
export var getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
5
4
|
var _response$meta;
|
|
6
5
|
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
7
6
|
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
8
|
-
return Boolean(
|
|
7
|
+
return Boolean(isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
|
|
9
8
|
};
|
|
10
9
|
export var getAISummaryErrorMessage = function getAISummaryErrorMessage(error) {
|
|
11
10
|
switch (error) {
|
|
@@ -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: "27.
|
|
18
|
+
packageVersion: "27.19.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -42,7 +42,8 @@ function Component(_ref) {
|
|
|
42
42
|
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
43
43
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
44
44
|
analyticsEvents = _ref.analyticsEvents,
|
|
45
|
-
useLegacyBlockCard = _ref.useLegacyBlockCard
|
|
45
|
+
useLegacyBlockCard = _ref.useLegacyBlockCard,
|
|
46
|
+
removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle;
|
|
46
47
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
47
48
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
48
49
|
|
|
@@ -223,7 +224,8 @@ function Component(_ref) {
|
|
|
223
224
|
showHoverPreview: showHoverPreview,
|
|
224
225
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
225
226
|
showAuthTooltip: showAuthTooltip,
|
|
226
|
-
actionOptions: actionOptions
|
|
227
|
+
actionOptions: actionOptions,
|
|
228
|
+
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle
|
|
227
229
|
});
|
|
228
230
|
case 'block':
|
|
229
231
|
return /*#__PURE__*/React.createElement(BlockCard, {
|
|
@@ -53,7 +53,8 @@ export function CardWithURLRenderer(props) {
|
|
|
53
53
|
analyticsEvents = props.analyticsEvents,
|
|
54
54
|
placeholder = props.placeholder,
|
|
55
55
|
fallbackComponent = props.fallbackComponent,
|
|
56
|
-
useLegacyBlockCard = props.useLegacyBlockCard
|
|
56
|
+
useLegacyBlockCard = props.useLegacyBlockCard,
|
|
57
|
+
removeTextHighlightingFromTitle = props.removeTextHighlightingFromTitle;
|
|
57
58
|
var analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', undefined, id);
|
|
58
59
|
var isFlexibleUi = isFlexibleUiCard(children);
|
|
59
60
|
var errorHandler = useCallback(function (error, info) {
|
|
@@ -123,7 +124,8 @@ export function CardWithURLRenderer(props) {
|
|
|
123
124
|
showAuthTooltip: showAuthTooltip,
|
|
124
125
|
analyticsEvents: analyticsEvents,
|
|
125
126
|
placeholder: placeholder,
|
|
126
|
-
useLegacyBlockCard: useLegacyBlockCard
|
|
127
|
+
useLegacyBlockCard: useLegacyBlockCard,
|
|
128
|
+
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle
|
|
127
129
|
};
|
|
128
130
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
129
131
|
FallbackComponent: ErrorFallback,
|
|
@@ -3,7 +3,6 @@ import { className, LinkWrapper, Wrapper, Header, IconWrapper, TextWrapper, Tool
|
|
|
3
3
|
import { handleClickCommon } from '../../BlockCard/utils/handlers';
|
|
4
4
|
import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
|
|
5
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
8
7
|
var _ref$isPlaceholder = _ref.isPlaceholder,
|
|
9
8
|
isPlaceholder = _ref$isPlaceholder === void 0 ? false : _ref$isPlaceholder,
|
|
@@ -56,7 +55,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
56
55
|
return /*#__PURE__*/React.createElement(Content, {
|
|
57
56
|
"data-testid": "embed-content-wrapper",
|
|
58
57
|
allowScrollBar: allowScrollBar,
|
|
59
|
-
removeOverflow:
|
|
58
|
+
removeOverflow: !setOverflow,
|
|
60
59
|
isInteractive: isInteractive(),
|
|
61
60
|
frameStyle: frameStyle
|
|
62
61
|
// This fixes an issue with input fields in cross domain iframes (ie. databases and jira fields from different domains)
|
|
@@ -10,7 +10,6 @@ var _excluded = ["children", "isAIEnabled", "testId", "url"],
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
11
|
import { jsx } from '@emotion/react';
|
|
12
12
|
import { useState, useEffect } from 'react';
|
|
13
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { HoverCardContainer, popupContainerStyles } from '../styled';
|
|
15
14
|
import AIPrism from '../../common/ai-prism';
|
|
16
15
|
import { hoverCardClassName } from './HoverCardContent';
|
|
@@ -52,20 +51,10 @@ var ContentContainer = function ContentContainer(_ref2) {
|
|
|
52
51
|
testId = _ref2.testId,
|
|
53
52
|
url = _ref2.url,
|
|
54
53
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
testId: testId
|
|
60
|
-
}, props), children);
|
|
61
|
-
}
|
|
62
|
-
return jsx("div", _extends({
|
|
63
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
64
|
-
className: hoverCardClassName
|
|
65
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
66
|
-
,
|
|
67
|
-
css: HoverCardContainer,
|
|
68
|
-
"data-testid": testId
|
|
54
|
+
return jsx(ConnectedAIPrismContainer, _extends({
|
|
55
|
+
isAIEnabled: isAIEnabled,
|
|
56
|
+
url: url,
|
|
57
|
+
testId: testId
|
|
69
58
|
}, props), children);
|
|
70
59
|
};
|
|
71
60
|
export default ContentContainer;
|
|
@@ -6,8 +6,6 @@ var _excluded = ["children", "shouldFitContainer", "shouldRenderToParent"];
|
|
|
6
6
|
* @jsx jsx
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import { popupContainerStyles } from '../styled';
|
|
11
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
10
|
import { jsx } from '@emotion/react';
|
|
13
11
|
|
|
@@ -21,13 +19,7 @@ var CustomPopupContainer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
21
19
|
_ = _ref.shouldFitContainer,
|
|
22
20
|
__ = _ref.shouldRenderToParent,
|
|
23
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
-
return jsx("div", _extends({
|
|
25
|
-
css:
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
27
|
-
fg('platform.linking-platform.smart-card.hover-card-ai-summaries') ? undefined :
|
|
28
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
29
|
-
popupContainerStyles
|
|
30
|
-
}, props, {
|
|
22
|
+
return jsx("div", _extends({}, props, {
|
|
31
23
|
ref: ref
|
|
32
24
|
}), children);
|
|
33
25
|
});
|
|
@@ -9,7 +9,7 @@ import { getMetadata } from '../../../utils';
|
|
|
9
9
|
import ImagePreview from '../../ImagePreview';
|
|
10
10
|
import { messages } from '../../../../../messages';
|
|
11
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
12
|
-
import {
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { getCanBeDatasource } from '../../../../../state/helpers';
|
|
14
14
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
15
15
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
@@ -48,8 +48,6 @@ export var toFooterActions = function toFooterActions(cardActions, onActionClick
|
|
|
48
48
|
});
|
|
49
49
|
return [followAction].concat(_toConsumableArray(actions));
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
//This component encapsulates useAISummarySmartLink hook under the AI Summary FF 'platform.linking-platform.smart-card.hover-card-ai-summaries'
|
|
53
51
|
var ConnectedAIBlock = function ConnectedAIBlock(_ref) {
|
|
54
52
|
var bottomPrimary = _ref.bottomPrimary,
|
|
55
53
|
imagePreview = _ref.imagePreview,
|
|
@@ -156,7 +154,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
|
|
|
156
154
|
overrideCss: metadataBlockCss,
|
|
157
155
|
maxLines: 1,
|
|
158
156
|
status: SmartLinkStatus.Resolved
|
|
159
|
-
}),
|
|
157
|
+
}), fg('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/React.createElement(RelatedUrlsBlock, {
|
|
160
158
|
url: url,
|
|
161
159
|
size: SmartLinkSize.Small
|
|
162
160
|
}), isAISummaryEnabled && /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
@@ -5,8 +5,6 @@ import { css } from '@emotion/react';
|
|
|
5
5
|
import { loadingPlaceholderClassName } from '../../index';
|
|
6
6
|
import { SmartLinkSize } from '../../constants';
|
|
7
7
|
import { layers } from '@atlaskit/theme/constants';
|
|
8
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
|
|
10
8
|
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
11
9
|
export var HOVER_CARD_Z_INDEX = layers.modal();
|
|
12
10
|
export var flexibleUiOptions = {
|
|
@@ -32,7 +30,7 @@ export var separatorCss = css({
|
|
|
32
30
|
});
|
|
33
31
|
|
|
34
32
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
35
|
-
export var HoverCardContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tbackground: none;\n\tborder-width: 0;\n\tbox-sizing: border-box;\n\twidth: ", "rem;\n\n\t.", " {\n\t\tdisplay: none;\n\t}\n"])),
|
|
33
|
+
export var HoverCardContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tbackground: none;\n\tborder-width: 0;\n\tbox-sizing: border-box;\n\twidth: ", "rem;\n\n\t.", " {\n\t\tdisplay: none;\n\t}\n"])), NEW_CARD_WIDTH_REM, loadingPlaceholderClassName);
|
|
36
34
|
|
|
37
35
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
38
36
|
export var titleBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tgap: ", ";\n\n\t", "\n\n\t// title and subtitle element group\n [data-smart-element-group] {\n\t\t// gap between title and subtitle\n\t\tgap: 0.06rem;\n\t\tdisplay: flex;\n\t\t/* subtitle element group */\n\t\t> [data-smart-element-group] {\n\t\t\t> span {\n\t\t\t\tmargin-right: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t[data-smart-element='Title'] {\n\t\tfont-weight: 600;\n\t}\n"])), blockGap, separatorCss, elementGap);
|
|
@@ -33,7 +33,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
33
33
|
showHoverPreview = _ref.showHoverPreview,
|
|
34
34
|
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
35
35
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
36
|
-
actionOptions = _ref.actionOptions
|
|
36
|
+
actionOptions = _ref.actionOptions,
|
|
37
|
+
removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle;
|
|
37
38
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
38
39
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
39
40
|
var status = cardState.status,
|
|
@@ -45,7 +46,7 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
45
46
|
if (showHoverPreview === undefined && showHoverPreviewFlag !== undefined) {
|
|
46
47
|
showHoverPreview = Boolean(showHoverPreviewFlag);
|
|
47
48
|
}
|
|
48
|
-
var resolvedProps = status === SmartLinkStatus.Resolved ? extractInlineProps(cardDetails, renderers) : {};
|
|
49
|
+
var resolvedProps = status === SmartLinkStatus.Resolved ? extractInlineProps(cardDetails, renderers, removeTextHighlightingFromTitle) : {};
|
|
49
50
|
useEffect(function () {
|
|
50
51
|
switch (status) {
|
|
51
52
|
case SmartLinkStatus.Resolved:
|
|
@@ -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: "27.
|
|
13
|
+
packageVersion: "27.19.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -3,4 +3,4 @@ import { type JsonLd } from 'json-ld-types';
|
|
|
3
3
|
import { type CardProviderRenderers } from '@atlaskit/link-provider';
|
|
4
4
|
import { type InlineCardResolvedViewProps } from '../../view/InlineCard/ResolvedView';
|
|
5
5
|
export declare const extractInlineIcon: (jsonLd: JsonLd.Data.BaseData) => import("react").ReactNode;
|
|
6
|
-
export declare const extractInlineProps: (jsonLd: JsonLd.Data.BaseData, renderers?: CardProviderRenderers) => InlineCardResolvedViewProps;
|
|
6
|
+
export declare const extractInlineProps: (jsonLd: JsonLd.Data.BaseData, renderers?: CardProviderRenderers, removeTextHighlightingFromTitle?: boolean) => InlineCardResolvedViewProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
3
3
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "removeTextHighlightingFromTitle" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -112,4 +112,11 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
112
112
|
* unable to use the new flexible block cards.
|
|
113
113
|
*/
|
|
114
114
|
useLegacyBlockCard?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* When set to true, the text fragment will be removed from the title.
|
|
117
|
+
* This will have no impact on the url and text highlighting will still persist in the url,
|
|
118
|
+
* however the the text fragment will be stripped from the title of the smart card.
|
|
119
|
+
* For example, when set to true: "my name | :~:text=highlight this" will be displayed as "my name"
|
|
120
|
+
*/
|
|
121
|
+
removeTextHighlightingFromTitle?: boolean;
|
|
115
122
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
/// <reference types="react" />
|
|
6
2
|
import type { ContentContainerProps } from '../types';
|
|
7
|
-
declare const ContentContainer: ({ children, isAIEnabled, testId, url, ...props }: ContentContainerProps) =>
|
|
3
|
+
declare const ContentContainer: ({ children, isAIEnabled, testId, url, ...props }: ContentContainerProps) => JSX.Element;
|
|
8
4
|
export default ContentContainer;
|
|
@@ -6,4 +6,4 @@ import { InlineCardResolvedView } from './ResolvedView';
|
|
|
6
6
|
import { InlineCardResolvingView } from './ResolvingView';
|
|
7
7
|
import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
8
8
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView, };
|
|
9
|
-
export declare const InlineCard: ({ analytics, id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, showAuthTooltip, actionOptions, }: InlineCardProps) => JSX.Element;
|
|
9
|
+
export declare const InlineCard: ({ analytics, id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, showAuthTooltip, actionOptions, removeTextHighlightingFromTitle, }: InlineCardProps) => JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { type JsonLd } from 'json-ld-types';
|
|
|
3
3
|
import { type CardProviderRenderers } from '@atlaskit/link-provider';
|
|
4
4
|
import { type InlineCardResolvedViewProps } from '../../view/InlineCard/ResolvedView';
|
|
5
5
|
export declare const extractInlineIcon: (jsonLd: JsonLd.Data.BaseData) => import("react").ReactNode;
|
|
6
|
-
export declare const extractInlineProps: (jsonLd: JsonLd.Data.BaseData, renderers?: CardProviderRenderers) => InlineCardResolvedViewProps;
|
|
6
|
+
export declare const extractInlineProps: (jsonLd: JsonLd.Data.BaseData, renderers?: CardProviderRenderers, removeTextHighlightingFromTitle?: boolean) => InlineCardResolvedViewProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
3
3
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "removeTextHighlightingFromTitle" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -112,4 +112,11 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
112
112
|
* unable to use the new flexible block cards.
|
|
113
113
|
*/
|
|
114
114
|
useLegacyBlockCard?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* When set to true, the text fragment will be removed from the title.
|
|
117
|
+
* This will have no impact on the url and text highlighting will still persist in the url,
|
|
118
|
+
* however the the text fragment will be stripped from the title of the smart card.
|
|
119
|
+
* For example, when set to true: "my name | :~:text=highlight this" will be displayed as "my name"
|
|
120
|
+
*/
|
|
121
|
+
removeTextHighlightingFromTitle?: boolean;
|
|
115
122
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
/// <reference types="react" />
|
|
6
2
|
import type { ContentContainerProps } from '../types';
|
|
7
|
-
declare const ContentContainer: ({ children, isAIEnabled, testId, url, ...props }: ContentContainerProps) =>
|
|
3
|
+
declare const ContentContainer: ({ children, isAIEnabled, testId, url, ...props }: ContentContainerProps) => JSX.Element;
|
|
8
4
|
export default ContentContainer;
|
|
@@ -6,4 +6,4 @@ import { InlineCardResolvedView } from './ResolvedView';
|
|
|
6
6
|
import { InlineCardResolvingView } from './ResolvingView';
|
|
7
7
|
import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
8
8
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView, };
|
|
9
|
-
export declare const InlineCard: ({ analytics, id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, showAuthTooltip, actionOptions, }: InlineCardProps) => JSX.Element;
|
|
9
|
+
export declare const InlineCard: ({ analytics, id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, showAuthTooltip, actionOptions, removeTextHighlightingFromTitle, }: InlineCardProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.19.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"@atlaskit/badge": "^16.4.0",
|
|
37
37
|
"@atlaskit/button": "^20.1.0",
|
|
38
38
|
"@atlaskit/checkbox": "^13.7.0",
|
|
39
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
39
|
+
"@atlaskit/dropdown-menu": "^12.18.0",
|
|
40
40
|
"@atlaskit/form": "^10.5.0",
|
|
41
41
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
42
42
|
"@atlaskit/heading": "^2.4.0",
|
|
43
|
-
"@atlaskit/icon": "^22.
|
|
43
|
+
"@atlaskit/icon": "^22.15.0",
|
|
44
44
|
"@atlaskit/icon-file-type": "^6.5.0",
|
|
45
45
|
"@atlaskit/icon-object": "^6.5.0",
|
|
46
46
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
47
47
|
"@atlaskit/link-analytics": "^8.5.0",
|
|
48
|
-
"@atlaskit/link-client-extension": "^2.
|
|
49
|
-
"@atlaskit/link-extractors": "^1.
|
|
48
|
+
"@atlaskit/link-client-extension": "^2.2.0",
|
|
49
|
+
"@atlaskit/link-extractors": "^1.9.0",
|
|
50
50
|
"@atlaskit/linking-common": "^5.11.0",
|
|
51
51
|
"@atlaskit/linking-types": "^9.0.0",
|
|
52
52
|
"@atlaskit/logo": "^14.2.0",
|
|
@@ -157,18 +157,12 @@
|
|
|
157
157
|
"platform.linking-platform.smart-card.enable-hover-card-related-urls": {
|
|
158
158
|
"type": "boolean"
|
|
159
159
|
},
|
|
160
|
-
"platform.linking-platform.smart-card.hover-card-ai-summaries": {
|
|
161
|
-
"type": "boolean"
|
|
162
|
-
},
|
|
163
160
|
"platform.linking-platform.smart-card.hover-card-ai-summaries-release-stable": {
|
|
164
161
|
"type": "boolean"
|
|
165
162
|
},
|
|
166
163
|
"platform.linking-platform.smart-card.hover-card-action-redesign": {
|
|
167
164
|
"type": "boolean"
|
|
168
165
|
},
|
|
169
|
-
"platform.linking-platform.smart-card.fix-embed-card-blurring": {
|
|
170
|
-
"type": "boolean"
|
|
171
|
-
},
|
|
172
166
|
"platform.linking-platform.smart-card.action-icon-redesign": {
|
|
173
167
|
"type": "boolean"
|
|
174
168
|
},
|