@atlaskit/smart-card 27.18.0 → 27.19.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 +16 -0
- package/dist/cjs/utils/ai-summary.js +1 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +3 -0
- 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/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/ai-summary.js +1 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +3 -0
- 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/LinkUrl/index.js +1 -1
- package/dist/esm/utils/ai-summary.js +1 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +3 -0
- 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/LinkUrl/index.js +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +5 -1
- package/dist/types/view/HoverCard/components/ContentContainer.d.ts +2 -6
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +5 -1
- package/dist/types-ts4.5/view/HoverCard/components/ContentContainer.d.ts +2 -6
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 27.19.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6993bb3b59334`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6993bb3b59334) -
|
|
8
|
+
Added check if entrypoint wrapper is available then pass it to the the wrapper prop of
|
|
9
|
+
action-group-item
|
|
10
|
+
|
|
11
|
+
## 27.19.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#134316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134316)
|
|
16
|
+
[`921e345ee41da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/921e345ee41da) -
|
|
17
|
+
[ux] Remove hover card AI Summary feature flag
|
|
18
|
+
|
|
3
19
|
## 27.18.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -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.1"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js
CHANGED
|
@@ -53,6 +53,9 @@ var ActionGroupItem = function ActionGroupItem(_ref) {
|
|
|
53
53
|
if (hideIcon) {
|
|
54
54
|
actionProps.icon = undefined;
|
|
55
55
|
}
|
|
56
|
+
if (item !== null && item !== void 0 && item.entryPointWrapper) {
|
|
57
|
+
actionProps.wrapper = item.entryPointWrapper;
|
|
58
|
+
}
|
|
56
59
|
return (0, _react.jsx)(Action, (0, _extends2.default)({
|
|
57
60
|
asDropDownItem: asDropDownItems,
|
|
58
61
|
size: size,
|
|
@@ -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);
|
|
@@ -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.1",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -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.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js
CHANGED
|
@@ -43,6 +43,9 @@ const ActionGroupItem = ({
|
|
|
43
43
|
if (hideIcon) {
|
|
44
44
|
actionProps.icon = undefined;
|
|
45
45
|
}
|
|
46
|
+
if (item !== null && item !== void 0 && item.entryPointWrapper) {
|
|
47
|
+
actionProps.wrapper = item.entryPointWrapper;
|
|
48
|
+
}
|
|
46
49
|
return jsx(Action, _extends({
|
|
47
50
|
asDropDownItem: asDropDownItems,
|
|
48
51
|
size: size,
|
|
@@ -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;
|
|
@@ -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.1",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -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.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js
CHANGED
|
@@ -43,6 +43,9 @@ var ActionGroupItem = function ActionGroupItem(_ref) {
|
|
|
43
43
|
if (hideIcon) {
|
|
44
44
|
actionProps.icon = undefined;
|
|
45
45
|
}
|
|
46
|
+
if (item !== null && item !== void 0 && item.entryPointWrapper) {
|
|
47
|
+
actionProps.wrapper = item.entryPointWrapper;
|
|
48
|
+
}
|
|
46
49
|
return jsx(Action, _extends({
|
|
47
50
|
asDropDownItem: asDropDownItems,
|
|
48
51
|
size: size,
|
|
@@ -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);
|
|
@@ -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.1",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -185,7 +185,11 @@ export type CustomActionItem = BaseActionItem & {
|
|
|
185
185
|
href?: string;
|
|
186
186
|
ariaLabel?: string;
|
|
187
187
|
} & ((Required<Pick<ActionProps, 'icon' | 'iconPosition'>> & Pick<ActionProps, 'content'>) | ((Required<Pick<ActionProps, 'content'>> & Pick<ActionProps, 'icon' | 'iconPosition'>) & Pick<ActionProps, 'tooltipMessage'>));
|
|
188
|
-
export type ActionItem = NamedActionItem | NamedDataActionItem | CustomActionItem
|
|
188
|
+
export type ActionItem = (NamedActionItem | NamedDataActionItem | CustomActionItem) & {
|
|
189
|
+
entryPointWrapper?: React.FC<{
|
|
190
|
+
children: React.ReactNode;
|
|
191
|
+
}>;
|
|
192
|
+
};
|
|
189
193
|
export type OnActionMenuOpenChangeOptions = {
|
|
190
194
|
isOpen: boolean;
|
|
191
195
|
};
|
|
@@ -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;
|
|
@@ -185,7 +185,11 @@ export type CustomActionItem = BaseActionItem & {
|
|
|
185
185
|
href?: string;
|
|
186
186
|
ariaLabel?: string;
|
|
187
187
|
} & ((Required<Pick<ActionProps, 'icon' | 'iconPosition'>> & Pick<ActionProps, 'content'>) | ((Required<Pick<ActionProps, 'content'>> & Pick<ActionProps, 'icon' | 'iconPosition'>) & Pick<ActionProps, 'tooltipMessage'>));
|
|
188
|
-
export type ActionItem = NamedActionItem | NamedDataActionItem | CustomActionItem
|
|
188
|
+
export type ActionItem = (NamedActionItem | NamedDataActionItem | CustomActionItem) & {
|
|
189
|
+
entryPointWrapper?: React.FC<{
|
|
190
|
+
children: React.ReactNode;
|
|
191
|
+
}>;
|
|
192
|
+
};
|
|
189
193
|
export type OnActionMenuOpenChangeOptions = {
|
|
190
194
|
isOpen: boolean;
|
|
191
195
|
};
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.19.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
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",
|
|
@@ -45,7 +45,7 @@
|
|
|
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.
|
|
48
|
+
"@atlaskit/link-client-extension": "^2.2.0",
|
|
49
49
|
"@atlaskit/link-extractors": "^1.9.0",
|
|
50
50
|
"@atlaskit/linking-common": "^5.11.0",
|
|
51
51
|
"@atlaskit/linking-types": "^9.0.0",
|
|
@@ -157,9 +157,6 @@
|
|
|
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
|
},
|