@atlaskit/smart-card 26.57.4 → 26.58.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 +12 -0
- package/dist/cjs/extractors/common/lozenge/extractState.js +47 -9
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +10 -6
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +17 -10
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +6 -4
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +2 -0
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/common/lozenge/extractState.js +49 -10
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +11 -7
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +16 -10
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +6 -4
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +2 -0
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/common/lozenge/extractState.js +49 -10
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +11 -7
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +16 -10
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +6 -4
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +2 -0
- package/dist/esm/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/common/lozenge/types.d.ts +3 -0
- package/dist/types/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/index.d.ts +4 -3
- package/dist/types/view/FlexibleCard/components/elements/lozenge/types.d.ts +5 -0
- package/dist/types-ts4.5/extractors/common/lozenge/types.d.ts +3 -0
- package/dist/types-ts4.5/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/index.d.ts +4 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/types.d.ts +5 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.58.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#95182](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95182) [`3d3dd335b8e8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3d3dd335b8e8) - The internal composition of this component has changed. There is no expected change in behavior.
|
|
8
|
+
|
|
9
|
+
## 26.58.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#94308](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94308) [`a76386ed89a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a76386ed89a1) - Add the showFooterMetadata and showErrorIndicator props to AISummaryBlock
|
|
14
|
+
|
|
3
15
|
## 26.57.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -5,6 +5,49 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractState = void 0;
|
|
7
7
|
var _utils = require("./utils");
|
|
8
|
+
// Maps accent color short names to their corresponding background and text colors
|
|
9
|
+
var lozengeAccentStyles = {
|
|
10
|
+
blue: {
|
|
11
|
+
backgroundColor: "var(--ds-background-accent-blue-subtler, #CCE0FF)",
|
|
12
|
+
color: "var(--ds-text-accent-blue, #0055CC)"
|
|
13
|
+
},
|
|
14
|
+
gray: {
|
|
15
|
+
backgroundColor: "var(--ds-background-accent-gray-subtler, #DCDFE4)",
|
|
16
|
+
color: "var(--ds-text-accent-gray, #44546F)"
|
|
17
|
+
},
|
|
18
|
+
green: {
|
|
19
|
+
backgroundColor: "var(--ds-background-accent-green-subtler, #BAF3DB)",
|
|
20
|
+
color: "var(--ds-text-accent-green, #216E4E)"
|
|
21
|
+
},
|
|
22
|
+
lime: {
|
|
23
|
+
backgroundColor: "var(--ds-background-accent-lime-subtler, #D3F1A7)",
|
|
24
|
+
color: "var(--ds-text-accent-lime, #4C6B1F)"
|
|
25
|
+
},
|
|
26
|
+
magenta: {
|
|
27
|
+
backgroundColor: "var(--ds-background-accent-magenta-subtler, #FDD0EC)",
|
|
28
|
+
color: "var(--ds-text-accent-magenta, #943D73)"
|
|
29
|
+
},
|
|
30
|
+
orange: {
|
|
31
|
+
backgroundColor: "var(--ds-background-accent-orange-subtler, #FEDEC8)",
|
|
32
|
+
color: "var(--ds-text-accent-orange, #A54800)"
|
|
33
|
+
},
|
|
34
|
+
purple: {
|
|
35
|
+
backgroundColor: "var(--ds-background-accent-purple-subtler, #DFD8FD)",
|
|
36
|
+
color: "var(--ds-text-accent-purple, #5E4DB2)"
|
|
37
|
+
},
|
|
38
|
+
red: {
|
|
39
|
+
backgroundColor: "var(--ds-background-accent-red-subtler, #FFD5D2)",
|
|
40
|
+
color: "var(--ds-text-accent-red, #AE2E24)"
|
|
41
|
+
},
|
|
42
|
+
teal: {
|
|
43
|
+
backgroundColor: "var(--ds-background-accent-teal-subtler, #C6EDFB)",
|
|
44
|
+
color: "var(--ds-text-accent-teal, #206A83)"
|
|
45
|
+
},
|
|
46
|
+
yellow: {
|
|
47
|
+
backgroundColor: "var(--ds-background-accent-yellow-subtler, #F8E6A0)",
|
|
48
|
+
color: "var(--ds-text-accent-yellow, #7F5F01)"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
8
51
|
var extractState = exports.extractState = function extractState(jsonLd) {
|
|
9
52
|
var state = jsonLd['atlassian:state'];
|
|
10
53
|
if (state) {
|
|
@@ -16,18 +59,13 @@ var extractState = exports.extractState = function extractState(jsonLd) {
|
|
|
16
59
|
appearance: _utils.VALID_STATES[linkState] || 'default'
|
|
17
60
|
};
|
|
18
61
|
}
|
|
19
|
-
} else if (state['@type'] === 'Link') {
|
|
20
|
-
if (state.name) {
|
|
21
|
-
return {
|
|
22
|
-
text: state.name,
|
|
23
|
-
appearance: state.appearance || 'default'
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
} else if (state['@type'] === 'Object') {
|
|
62
|
+
} else if (state['@type'] === 'Link' || state['@type'] === 'Object') {
|
|
27
63
|
if (state.name) {
|
|
64
|
+
var accent = state.accent;
|
|
28
65
|
return {
|
|
29
66
|
text: state.name,
|
|
30
|
-
appearance: state.appearance || 'default'
|
|
67
|
+
appearance: state.appearance || 'default',
|
|
68
|
+
style: accent ? lozengeAccentStyles[accent] : undefined
|
|
31
69
|
};
|
|
32
70
|
}
|
|
33
71
|
}
|
|
@@ -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.
|
|
25
|
+
packageVersion: "26.58.1"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.blockCardResolvedViewClassName = exports.blockCardResolvedViewByClassName = exports.ResolvedView = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var _react = require("@emotion/react");
|
|
9
10
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
10
11
|
var _Frame = require("../components/Frame");
|
|
@@ -25,6 +26,11 @@ var _utils = require("../../common/utils");
|
|
|
25
26
|
var _handlers = require("../utils/handlers");
|
|
26
27
|
/** @jsx jsx */
|
|
27
28
|
|
|
29
|
+
var styles = (0, _react.css)({
|
|
30
|
+
display: 'flex',
|
|
31
|
+
justifyContent: 'space-between',
|
|
32
|
+
alignItems: 'flex-start'
|
|
33
|
+
});
|
|
28
34
|
/**
|
|
29
35
|
* Class name for selecting non-flexible resolved block card
|
|
30
36
|
*
|
|
@@ -89,11 +95,7 @@ var ResolvedView = exports.ResolvedView = function ResolvedView(_ref) {
|
|
|
89
95
|
testId: testId,
|
|
90
96
|
className: blockCardResolvedViewClassName
|
|
91
97
|
}, (0, _react.jsx)(_Content.Content, null, (0, _react.jsx)("div", null, (0, _react.jsx)("div", {
|
|
92
|
-
css:
|
|
93
|
-
display: 'flex',
|
|
94
|
-
justifyContent: 'space-between',
|
|
95
|
-
alignItems: 'flex-start'
|
|
96
|
-
}
|
|
98
|
+
css: styles
|
|
97
99
|
}, (0, _react.jsx)(_ContentHeader.ContentHeader, {
|
|
98
100
|
onClick: handleClick,
|
|
99
101
|
link: link
|
|
@@ -109,7 +111,9 @@ var ResolvedView = exports.ResolvedView = function ResolvedView(_ref) {
|
|
|
109
111
|
alignItems: 'center',
|
|
110
112
|
justifyContent: 'center'
|
|
111
113
|
}
|
|
112
|
-
}, (0, _react.jsx)(_lozenge.default,
|
|
114
|
+
}, (0, _react.jsx)(_lozenge.default, (0, _extends2.default)({
|
|
115
|
+
style: lozenge.style
|
|
116
|
+
}, lozenge), lozenge.text))), (0, _react.jsx)(_CollaboratorList.CollaboratorList, {
|
|
113
117
|
items: users,
|
|
114
118
|
handleAvatarClick: handleAvatarClick,
|
|
115
119
|
handleMoreAvatarsClick: handleMoreAvatarsClick,
|
|
@@ -5,17 +5,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _react = require("@emotion/react");
|
|
8
9
|
var _primitives = require("@atlaskit/primitives");
|
|
9
|
-
var
|
|
10
|
+
var _react2 = require("react");
|
|
10
11
|
var _constants = require("../../../../../constants");
|
|
11
12
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
12
13
|
var Actions = _interopRequireWildcard(require("../../actions"));
|
|
13
14
|
var _utils = require("../../utils");
|
|
14
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var ignoreContainerPaddingStyles = (0,
|
|
17
|
+
/** @jsx jsx */
|
|
18
|
+
|
|
19
|
+
var ignoreContainerPaddingStyles = (0, _react.css)({
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexDirection: 'column',
|
|
22
|
+
boxSizing: 'border-box',
|
|
23
|
+
flexGrow: 1,
|
|
24
|
+
width: '100%',
|
|
25
|
+
// We have to find a better way to ignore container padding
|
|
26
|
+
// This has become more and more of a common use case.
|
|
19
27
|
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
20
28
|
marginRight: 'calc(var(--container-gap-right) * -1)'
|
|
21
29
|
});
|
|
@@ -41,7 +49,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
41
49
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
42
50
|
var ui = (0, _flexibleUiContext.useFlexibleUiOptionContext)();
|
|
43
51
|
var padding = !(ui !== null && ui !== void 0 && ui.hidePadding) ? (0, _utils.getPrimitivesPaddingSpaceBySize)((ui === null || ui === void 0 ? void 0 : ui.size) || _constants.SmartLinkSize.Medium) : undefined;
|
|
44
|
-
var actions = (0,
|
|
52
|
+
var actions = (0, _react2.useMemo)(function () {
|
|
45
53
|
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
46
54
|
return;
|
|
47
55
|
}
|
|
@@ -49,7 +57,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
49
57
|
arr.sort(sort);
|
|
50
58
|
return arr.map(function (name) {
|
|
51
59
|
var Action = name in Actions ? Actions[name] : undefined;
|
|
52
|
-
return Action ?
|
|
60
|
+
return Action ? (0, _react.jsx)(Action, {
|
|
53
61
|
as: "stack-item",
|
|
54
62
|
spaceInline: spaceInline,
|
|
55
63
|
key: name,
|
|
@@ -63,11 +71,10 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
63
71
|
}) : null;
|
|
64
72
|
});
|
|
65
73
|
}, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, spaceInline]);
|
|
66
|
-
return actions ?
|
|
67
|
-
|
|
68
|
-
xcss: ignoreContainerPaddingStyles,
|
|
74
|
+
return actions ? (0, _react.jsx)("div", {
|
|
75
|
+
css: ignoreContainerPaddingStyles,
|
|
69
76
|
ref: blockRef,
|
|
70
|
-
|
|
77
|
+
"data-testid": testId
|
|
71
78
|
}, actions) : null;
|
|
72
79
|
};
|
|
73
80
|
var _default = exports.default = ActionBlock;
|
|
@@ -30,6 +30,7 @@ var _react2 = require("@emotion/react");
|
|
|
30
30
|
var _featureDiscovery = _interopRequireDefault(require("../feature-discovery"));
|
|
31
31
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
32
32
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
33
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
33
34
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
34
35
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
35
36
|
var AISummaryBlockErrorIndicator = exports.AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(_ref) {
|
|
@@ -158,11 +159,12 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
158
159
|
minHeight: aiSummaryMinHeight,
|
|
159
160
|
content: content,
|
|
160
161
|
showIcon: isSummarisedOnMountRef.current
|
|
161
|
-
})), /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
162
|
+
})), !(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-action-redesign') && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
162
163
|
alignBlock: "center",
|
|
163
164
|
alignInline: "end",
|
|
164
165
|
grow: "fill",
|
|
165
|
-
spread: "space-between"
|
|
166
|
+
spread: "space-between",
|
|
167
|
+
testId: "".concat(testId, "-footer-metadata")
|
|
166
168
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Box, null, /*#__PURE__*/_react.default.createElement(AISummaryBlockStatusIndicator, {
|
|
167
169
|
metadata: metadata,
|
|
168
170
|
showStatusIndicator: !isSummarisedOnMountRef.current && (status === 'loading' || status === 'done'),
|
|
@@ -177,7 +179,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
177
179
|
showErrorIndicator: !isErroredOnMountRef.current && status === 'error',
|
|
178
180
|
showTransition: !isErroredOnMountRef.current,
|
|
179
181
|
error: error,
|
|
180
|
-
testId: testId
|
|
181
|
-
}));
|
|
182
|
+
testId: "".concat(testId, "-error-indicator")
|
|
183
|
+
})));
|
|
182
184
|
};
|
|
183
185
|
var _default = exports.default = AISummaryBlockResolvedView;
|
|
@@ -29,6 +29,7 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
29
29
|
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
30
30
|
name = _ref.name,
|
|
31
31
|
overrideCss = _ref.overrideCss,
|
|
32
|
+
style = _ref.style,
|
|
32
33
|
text = _ref.text,
|
|
33
34
|
_ref$testId = _ref.testId,
|
|
34
35
|
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId;
|
|
@@ -44,6 +45,7 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
44
45
|
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
45
46
|
}) : (0, _react2.jsx)(_lozenge.default, {
|
|
46
47
|
appearance: appearance,
|
|
48
|
+
style: style,
|
|
47
49
|
testId: "".concat(testId, "-lozenge")
|
|
48
50
|
}, text);
|
|
49
51
|
return (0, _react2.jsx)("span", {
|
|
@@ -32,9 +32,11 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
|
|
|
32
32
|
if (!lozenge) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
+
var appearance = lozenge.appearance || 'default';
|
|
35
36
|
return /*#__PURE__*/_react.default.createElement(_styled.LozengeWrapper, null, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
36
37
|
testId: "inline-card-resolved-view-lozenge",
|
|
37
|
-
appearance:
|
|
38
|
+
appearance: appearance,
|
|
39
|
+
style: lozenge.style,
|
|
38
40
|
isBold: lozenge.isBold
|
|
39
41
|
}, lozenge.text));
|
|
40
42
|
}
|
|
@@ -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.
|
|
20
|
+
packageVersion: "26.58.1",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,4 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OMIT_STATES, VALID_STATES } from './utils';
|
|
2
|
+
|
|
3
|
+
// Maps accent color short names to their corresponding background and text colors
|
|
4
|
+
const lozengeAccentStyles = {
|
|
5
|
+
blue: {
|
|
6
|
+
backgroundColor: "var(--ds-background-accent-blue-subtler, #CCE0FF)",
|
|
7
|
+
color: "var(--ds-text-accent-blue, #0055CC)"
|
|
8
|
+
},
|
|
9
|
+
gray: {
|
|
10
|
+
backgroundColor: "var(--ds-background-accent-gray-subtler, #DCDFE4)",
|
|
11
|
+
color: "var(--ds-text-accent-gray, #44546F)"
|
|
12
|
+
},
|
|
13
|
+
green: {
|
|
14
|
+
backgroundColor: "var(--ds-background-accent-green-subtler, #BAF3DB)",
|
|
15
|
+
color: "var(--ds-text-accent-green, #216E4E)"
|
|
16
|
+
},
|
|
17
|
+
lime: {
|
|
18
|
+
backgroundColor: "var(--ds-background-accent-lime-subtler, #D3F1A7)",
|
|
19
|
+
color: "var(--ds-text-accent-lime, #4C6B1F)"
|
|
20
|
+
},
|
|
21
|
+
magenta: {
|
|
22
|
+
backgroundColor: "var(--ds-background-accent-magenta-subtler, #FDD0EC)",
|
|
23
|
+
color: "var(--ds-text-accent-magenta, #943D73)"
|
|
24
|
+
},
|
|
25
|
+
orange: {
|
|
26
|
+
backgroundColor: "var(--ds-background-accent-orange-subtler, #FEDEC8)",
|
|
27
|
+
color: "var(--ds-text-accent-orange, #A54800)"
|
|
28
|
+
},
|
|
29
|
+
purple: {
|
|
30
|
+
backgroundColor: "var(--ds-background-accent-purple-subtler, #DFD8FD)",
|
|
31
|
+
color: "var(--ds-text-accent-purple, #5E4DB2)"
|
|
32
|
+
},
|
|
33
|
+
red: {
|
|
34
|
+
backgroundColor: "var(--ds-background-accent-red-subtler, #FFD5D2)",
|
|
35
|
+
color: "var(--ds-text-accent-red, #AE2E24)"
|
|
36
|
+
},
|
|
37
|
+
teal: {
|
|
38
|
+
backgroundColor: "var(--ds-background-accent-teal-subtler, #C6EDFB)",
|
|
39
|
+
color: "var(--ds-text-accent-teal, #206A83)"
|
|
40
|
+
},
|
|
41
|
+
yellow: {
|
|
42
|
+
backgroundColor: "var(--ds-background-accent-yellow-subtler, #F8E6A0)",
|
|
43
|
+
color: "var(--ds-text-accent-yellow, #7F5F01)"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
2
46
|
export const extractState = jsonLd => {
|
|
3
47
|
const state = jsonLd['atlassian:state'];
|
|
4
48
|
if (state) {
|
|
@@ -10,18 +54,13 @@ export const extractState = jsonLd => {
|
|
|
10
54
|
appearance: VALID_STATES[linkState] || 'default'
|
|
11
55
|
};
|
|
12
56
|
}
|
|
13
|
-
} else if (state['@type'] === 'Link') {
|
|
14
|
-
if (state.name) {
|
|
15
|
-
return {
|
|
16
|
-
text: state.name,
|
|
17
|
-
appearance: state.appearance || 'default'
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
} else if (state['@type'] === 'Object') {
|
|
57
|
+
} else if (state['@type'] === 'Link' || state['@type'] === 'Object') {
|
|
21
58
|
if (state.name) {
|
|
59
|
+
const accent = state.accent;
|
|
22
60
|
return {
|
|
23
61
|
text: state.name,
|
|
24
|
-
appearance: state.appearance || 'default'
|
|
62
|
+
appearance: state.appearance || 'default',
|
|
63
|
+
style: accent ? lozengeAccentStyles[accent] : undefined
|
|
25
64
|
};
|
|
26
65
|
}
|
|
27
66
|
}
|
|
@@ -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.
|
|
7
|
+
packageVersion: "26.58.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { jsx, css } from '@emotion/react';
|
|
3
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
4
5
|
import { Frame } from '../components/Frame';
|
|
5
6
|
import { Thumbnail } from '../components/Thumbnail';
|
|
@@ -17,6 +18,11 @@ import { ContentHeader } from '../components/ContentHeader';
|
|
|
17
18
|
import { ContentFooter } from '../components/ContentFooter';
|
|
18
19
|
import { gs } from '../../common/utils';
|
|
19
20
|
import { handleClickCommon } from '../utils/handlers';
|
|
21
|
+
const styles = css({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
alignItems: 'flex-start'
|
|
25
|
+
});
|
|
20
26
|
/**
|
|
21
27
|
* Class name for selecting non-flexible resolved block card
|
|
22
28
|
*
|
|
@@ -67,11 +73,7 @@ export const ResolvedView = ({
|
|
|
67
73
|
testId: testId,
|
|
68
74
|
className: blockCardResolvedViewClassName
|
|
69
75
|
}, jsx(Content, null, jsx("div", null, jsx("div", {
|
|
70
|
-
css:
|
|
71
|
-
display: 'flex',
|
|
72
|
-
justifyContent: 'space-between',
|
|
73
|
-
alignItems: 'flex-start'
|
|
74
|
-
}
|
|
76
|
+
css: styles
|
|
75
77
|
}, jsx(ContentHeader, {
|
|
76
78
|
onClick: handleClick,
|
|
77
79
|
link: link
|
|
@@ -87,7 +89,9 @@ export const ResolvedView = ({
|
|
|
87
89
|
alignItems: 'center',
|
|
88
90
|
justifyContent: 'center'
|
|
89
91
|
}
|
|
90
|
-
}, jsx(Lozenge,
|
|
92
|
+
}, jsx(Lozenge, _extends({
|
|
93
|
+
style: lozenge.style
|
|
94
|
+
}, lozenge), lozenge.text))), jsx(CollaboratorList, {
|
|
91
95
|
items: users,
|
|
92
96
|
handleAvatarClick: handleAvatarClick,
|
|
93
97
|
handleMoreAvatarsClick: handleMoreAvatarsClick,
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { xcss } from '@atlaskit/primitives';
|
|
4
|
+
import { useMemo } from 'react';
|
|
3
5
|
import { SmartLinkSize } from '../../../../../constants';
|
|
4
6
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
5
7
|
import * as Actions from '../../actions';
|
|
6
8
|
import { getPrimitivesPaddingSpaceBySize } from '../../utils';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const ignoreContainerPaddingStyles = css({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
boxSizing: 'border-box',
|
|
13
|
+
flexGrow: 1,
|
|
14
|
+
width: '100%',
|
|
15
|
+
// We have to find a better way to ignore container padding
|
|
16
|
+
// This has become more and more of a common use case.
|
|
10
17
|
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
11
18
|
marginRight: 'calc(var(--container-gap-right) * -1)'
|
|
12
19
|
});
|
|
@@ -40,7 +47,7 @@ const ActionBlock = ({
|
|
|
40
47
|
arr.sort(sort);
|
|
41
48
|
return arr.map(name => {
|
|
42
49
|
const Action = name in Actions ? Actions[name] : undefined;
|
|
43
|
-
return Action ?
|
|
50
|
+
return Action ? jsx(Action, {
|
|
44
51
|
as: "stack-item",
|
|
45
52
|
spaceInline: spaceInline,
|
|
46
53
|
key: name,
|
|
@@ -52,11 +59,10 @@ const ActionBlock = ({
|
|
|
52
59
|
}) : null;
|
|
53
60
|
});
|
|
54
61
|
}, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, spaceInline]);
|
|
55
|
-
return actions ?
|
|
56
|
-
|
|
57
|
-
xcss: ignoreContainerPaddingStyles,
|
|
62
|
+
return actions ? jsx("div", {
|
|
63
|
+
css: ignoreContainerPaddingStyles,
|
|
58
64
|
ref: blockRef,
|
|
59
|
-
|
|
65
|
+
"data-testid": testId
|
|
60
66
|
}, actions) : null;
|
|
61
67
|
};
|
|
62
68
|
export default ActionBlock;
|
|
@@ -21,6 +21,7 @@ import { css } from '@emotion/react';
|
|
|
21
21
|
import FeatureDiscovery from '../feature-discovery';
|
|
22
22
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
23
23
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
24
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
24
25
|
export const AISummaryBlockErrorIndicator = ({
|
|
25
26
|
showErrorIndicator,
|
|
26
27
|
error,
|
|
@@ -150,11 +151,12 @@ const AISummaryBlockResolvedView = props => {
|
|
|
150
151
|
minHeight: aiSummaryMinHeight,
|
|
151
152
|
content: content,
|
|
152
153
|
showIcon: isSummarisedOnMountRef.current
|
|
153
|
-
})), /*#__PURE__*/React.createElement(Inline, {
|
|
154
|
+
})), !getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
|
|
154
155
|
alignBlock: "center",
|
|
155
156
|
alignInline: "end",
|
|
156
157
|
grow: "fill",
|
|
157
|
-
spread: "space-between"
|
|
158
|
+
spread: "space-between",
|
|
159
|
+
testId: `${testId}-footer-metadata`
|
|
158
160
|
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(AISummaryBlockStatusIndicator, {
|
|
159
161
|
metadata: metadata,
|
|
160
162
|
showStatusIndicator: !isSummarisedOnMountRef.current && (status === 'loading' || status === 'done'),
|
|
@@ -169,7 +171,7 @@ const AISummaryBlockResolvedView = props => {
|
|
|
169
171
|
showErrorIndicator: !isErroredOnMountRef.current && status === 'error',
|
|
170
172
|
showTransition: !isErroredOnMountRef.current,
|
|
171
173
|
error: error,
|
|
172
|
-
testId: testId
|
|
173
|
-
}));
|
|
174
|
+
testId: `${testId}-error-indicator`
|
|
175
|
+
})));
|
|
174
176
|
};
|
|
175
177
|
export default AISummaryBlockResolvedView;
|
|
@@ -20,6 +20,7 @@ const Lozenge = ({
|
|
|
20
20
|
appearance = 'default',
|
|
21
21
|
name,
|
|
22
22
|
overrideCss,
|
|
23
|
+
style,
|
|
23
24
|
text,
|
|
24
25
|
testId = 'smart-element-lozenge'
|
|
25
26
|
}) => {
|
|
@@ -35,6 +36,7 @@ const Lozenge = ({
|
|
|
35
36
|
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
36
37
|
}) : jsx(AtlaskitLozenge, {
|
|
37
38
|
appearance: appearance,
|
|
39
|
+
style: style,
|
|
38
40
|
testId: `${testId}-lozenge`
|
|
39
41
|
}, text);
|
|
40
42
|
return jsx("span", {
|
|
@@ -12,9 +12,11 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
12
12
|
if (!lozenge) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
+
const appearance = lozenge.appearance || 'default';
|
|
15
16
|
return /*#__PURE__*/React.createElement(LozengeWrapper, null, /*#__PURE__*/React.createElement(Lozenge, {
|
|
16
17
|
testId: "inline-card-resolved-view-lozenge",
|
|
17
|
-
appearance:
|
|
18
|
+
appearance: appearance,
|
|
19
|
+
style: lozenge.style,
|
|
18
20
|
isBold: lozenge.isBold
|
|
19
21
|
}, lozenge.text));
|
|
20
22
|
}
|
|
@@ -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.
|
|
10
|
+
packageVersion: "26.58.1",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -1,4 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OMIT_STATES, VALID_STATES } from './utils';
|
|
2
|
+
|
|
3
|
+
// Maps accent color short names to their corresponding background and text colors
|
|
4
|
+
var lozengeAccentStyles = {
|
|
5
|
+
blue: {
|
|
6
|
+
backgroundColor: "var(--ds-background-accent-blue-subtler, #CCE0FF)",
|
|
7
|
+
color: "var(--ds-text-accent-blue, #0055CC)"
|
|
8
|
+
},
|
|
9
|
+
gray: {
|
|
10
|
+
backgroundColor: "var(--ds-background-accent-gray-subtler, #DCDFE4)",
|
|
11
|
+
color: "var(--ds-text-accent-gray, #44546F)"
|
|
12
|
+
},
|
|
13
|
+
green: {
|
|
14
|
+
backgroundColor: "var(--ds-background-accent-green-subtler, #BAF3DB)",
|
|
15
|
+
color: "var(--ds-text-accent-green, #216E4E)"
|
|
16
|
+
},
|
|
17
|
+
lime: {
|
|
18
|
+
backgroundColor: "var(--ds-background-accent-lime-subtler, #D3F1A7)",
|
|
19
|
+
color: "var(--ds-text-accent-lime, #4C6B1F)"
|
|
20
|
+
},
|
|
21
|
+
magenta: {
|
|
22
|
+
backgroundColor: "var(--ds-background-accent-magenta-subtler, #FDD0EC)",
|
|
23
|
+
color: "var(--ds-text-accent-magenta, #943D73)"
|
|
24
|
+
},
|
|
25
|
+
orange: {
|
|
26
|
+
backgroundColor: "var(--ds-background-accent-orange-subtler, #FEDEC8)",
|
|
27
|
+
color: "var(--ds-text-accent-orange, #A54800)"
|
|
28
|
+
},
|
|
29
|
+
purple: {
|
|
30
|
+
backgroundColor: "var(--ds-background-accent-purple-subtler, #DFD8FD)",
|
|
31
|
+
color: "var(--ds-text-accent-purple, #5E4DB2)"
|
|
32
|
+
},
|
|
33
|
+
red: {
|
|
34
|
+
backgroundColor: "var(--ds-background-accent-red-subtler, #FFD5D2)",
|
|
35
|
+
color: "var(--ds-text-accent-red, #AE2E24)"
|
|
36
|
+
},
|
|
37
|
+
teal: {
|
|
38
|
+
backgroundColor: "var(--ds-background-accent-teal-subtler, #C6EDFB)",
|
|
39
|
+
color: "var(--ds-text-accent-teal, #206A83)"
|
|
40
|
+
},
|
|
41
|
+
yellow: {
|
|
42
|
+
backgroundColor: "var(--ds-background-accent-yellow-subtler, #F8E6A0)",
|
|
43
|
+
color: "var(--ds-text-accent-yellow, #7F5F01)"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
2
46
|
export var extractState = function extractState(jsonLd) {
|
|
3
47
|
var state = jsonLd['atlassian:state'];
|
|
4
48
|
if (state) {
|
|
@@ -10,18 +54,13 @@ export var extractState = function extractState(jsonLd) {
|
|
|
10
54
|
appearance: VALID_STATES[linkState] || 'default'
|
|
11
55
|
};
|
|
12
56
|
}
|
|
13
|
-
} else if (state['@type'] === 'Link') {
|
|
14
|
-
if (state.name) {
|
|
15
|
-
return {
|
|
16
|
-
text: state.name,
|
|
17
|
-
appearance: state.appearance || 'default'
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
} else if (state['@type'] === 'Object') {
|
|
57
|
+
} else if (state['@type'] === 'Link' || state['@type'] === 'Object') {
|
|
21
58
|
if (state.name) {
|
|
59
|
+
var accent = state.accent;
|
|
22
60
|
return {
|
|
23
61
|
text: state.name,
|
|
24
|
-
appearance: state.appearance || 'default'
|
|
62
|
+
appearance: state.appearance || 'default',
|
|
63
|
+
style: accent ? lozengeAccentStyles[accent] : undefined
|
|
25
64
|
};
|
|
26
65
|
}
|
|
27
66
|
}
|
|
@@ -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.
|
|
18
|
+
packageVersion: "26.58.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { jsx, css } from '@emotion/react';
|
|
3
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
4
5
|
import { Frame } from '../components/Frame';
|
|
5
6
|
import { Thumbnail } from '../components/Thumbnail';
|
|
@@ -17,6 +18,11 @@ import { ContentHeader } from '../components/ContentHeader';
|
|
|
17
18
|
import { ContentFooter } from '../components/ContentFooter';
|
|
18
19
|
import { gs } from '../../common/utils';
|
|
19
20
|
import { handleClickCommon } from '../utils/handlers';
|
|
21
|
+
var styles = css({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
alignItems: 'flex-start'
|
|
25
|
+
});
|
|
20
26
|
/**
|
|
21
27
|
* Class name for selecting non-flexible resolved block card
|
|
22
28
|
*
|
|
@@ -81,11 +87,7 @@ export var ResolvedView = function ResolvedView(_ref) {
|
|
|
81
87
|
testId: testId,
|
|
82
88
|
className: blockCardResolvedViewClassName
|
|
83
89
|
}, jsx(Content, null, jsx("div", null, jsx("div", {
|
|
84
|
-
css:
|
|
85
|
-
display: 'flex',
|
|
86
|
-
justifyContent: 'space-between',
|
|
87
|
-
alignItems: 'flex-start'
|
|
88
|
-
}
|
|
90
|
+
css: styles
|
|
89
91
|
}, jsx(ContentHeader, {
|
|
90
92
|
onClick: handleClick,
|
|
91
93
|
link: link
|
|
@@ -101,7 +103,9 @@ export var ResolvedView = function ResolvedView(_ref) {
|
|
|
101
103
|
alignItems: 'center',
|
|
102
104
|
justifyContent: 'center'
|
|
103
105
|
}
|
|
104
|
-
}, jsx(Lozenge,
|
|
106
|
+
}, jsx(Lozenge, _extends({
|
|
107
|
+
style: lozenge.style
|
|
108
|
+
}, lozenge), lozenge.text))), jsx(CollaboratorList, {
|
|
105
109
|
items: users,
|
|
106
110
|
handleAvatarClick: handleAvatarClick,
|
|
107
111
|
handleMoreAvatarsClick: handleMoreAvatarsClick,
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { xcss } from '@atlaskit/primitives';
|
|
4
|
+
import { useMemo } from 'react';
|
|
3
5
|
import { SmartLinkSize } from '../../../../../constants';
|
|
4
6
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
5
7
|
import * as Actions from '../../actions';
|
|
6
8
|
import { getPrimitivesPaddingSpaceBySize } from '../../utils';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
var ignoreContainerPaddingStyles = css({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
boxSizing: 'border-box',
|
|
13
|
+
flexGrow: 1,
|
|
14
|
+
width: '100%',
|
|
15
|
+
// We have to find a better way to ignore container padding
|
|
16
|
+
// This has become more and more of a common use case.
|
|
10
17
|
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
11
18
|
marginRight: 'calc(var(--container-gap-right) * -1)'
|
|
12
19
|
});
|
|
@@ -40,7 +47,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
40
47
|
arr.sort(sort);
|
|
41
48
|
return arr.map(function (name) {
|
|
42
49
|
var Action = name in Actions ? Actions[name] : undefined;
|
|
43
|
-
return Action ?
|
|
50
|
+
return Action ? jsx(Action, {
|
|
44
51
|
as: "stack-item",
|
|
45
52
|
spaceInline: spaceInline,
|
|
46
53
|
key: name,
|
|
@@ -54,11 +61,10 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
54
61
|
}) : null;
|
|
55
62
|
});
|
|
56
63
|
}, [context === null || context === void 0 ? void 0 : context.actions, onClickCallback, padding, size, spaceInline]);
|
|
57
|
-
return actions ?
|
|
58
|
-
|
|
59
|
-
xcss: ignoreContainerPaddingStyles,
|
|
64
|
+
return actions ? jsx("div", {
|
|
65
|
+
css: ignoreContainerPaddingStyles,
|
|
60
66
|
ref: blockRef,
|
|
61
|
-
|
|
67
|
+
"data-testid": testId
|
|
62
68
|
}, actions) : null;
|
|
63
69
|
};
|
|
64
70
|
export default ActionBlock;
|
|
@@ -22,6 +22,7 @@ import { css } from '@emotion/react';
|
|
|
22
22
|
import FeatureDiscovery from '../feature-discovery';
|
|
23
23
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
24
24
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
25
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
25
26
|
export var AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(_ref) {
|
|
26
27
|
var showErrorIndicator = _ref.showErrorIndicator,
|
|
27
28
|
error = _ref.error,
|
|
@@ -148,11 +149,12 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
148
149
|
minHeight: aiSummaryMinHeight,
|
|
149
150
|
content: content,
|
|
150
151
|
showIcon: isSummarisedOnMountRef.current
|
|
151
|
-
})), /*#__PURE__*/React.createElement(Inline, {
|
|
152
|
+
})), !getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
|
|
152
153
|
alignBlock: "center",
|
|
153
154
|
alignInline: "end",
|
|
154
155
|
grow: "fill",
|
|
155
|
-
spread: "space-between"
|
|
156
|
+
spread: "space-between",
|
|
157
|
+
testId: "".concat(testId, "-footer-metadata")
|
|
156
158
|
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(AISummaryBlockStatusIndicator, {
|
|
157
159
|
metadata: metadata,
|
|
158
160
|
showStatusIndicator: !isSummarisedOnMountRef.current && (status === 'loading' || status === 'done'),
|
|
@@ -167,7 +169,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
167
169
|
showErrorIndicator: !isErroredOnMountRef.current && status === 'error',
|
|
168
170
|
showTransition: !isErroredOnMountRef.current,
|
|
169
171
|
error: error,
|
|
170
|
-
testId: testId
|
|
171
|
-
}));
|
|
172
|
+
testId: "".concat(testId, "-error-indicator")
|
|
173
|
+
})));
|
|
172
174
|
};
|
|
173
175
|
export default AISummaryBlockResolvedView;
|
|
@@ -21,6 +21,7 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
21
21
|
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
22
22
|
name = _ref.name,
|
|
23
23
|
overrideCss = _ref.overrideCss,
|
|
24
|
+
style = _ref.style,
|
|
24
25
|
text = _ref.text,
|
|
25
26
|
_ref$testId = _ref.testId,
|
|
26
27
|
testId = _ref$testId === void 0 ? 'smart-element-lozenge' : _ref$testId;
|
|
@@ -36,6 +37,7 @@ var Lozenge = function Lozenge(_ref) {
|
|
|
36
37
|
zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
|
|
37
38
|
}) : jsx(AtlaskitLozenge, {
|
|
38
39
|
appearance: appearance,
|
|
40
|
+
style: style,
|
|
39
41
|
testId: "".concat(testId, "-lozenge")
|
|
40
42
|
}, text);
|
|
41
43
|
return jsx("span", {
|
|
@@ -25,9 +25,11 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
25
25
|
if (!lozenge) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
+
var appearance = lozenge.appearance || 'default';
|
|
28
29
|
return /*#__PURE__*/React.createElement(LozengeWrapper, null, /*#__PURE__*/React.createElement(Lozenge, {
|
|
29
30
|
testId: "inline-card-resolved-view-lozenge",
|
|
30
|
-
appearance:
|
|
31
|
+
appearance: appearance,
|
|
32
|
+
style: lozenge.style,
|
|
31
33
|
isBold: lozenge.isBold
|
|
32
34
|
}, lozenge.text));
|
|
33
35
|
}
|
|
@@ -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.
|
|
13
|
+
packageVersion: "26.58.1",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
|
|
1
2
|
import { InvokeActions } from '../../../state/hooks/use-invoke/types';
|
|
2
3
|
export type LinkLozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
4
|
+
export type AccentShortName = 'blue' | 'gray' | 'green' | 'lime' | 'magenta' | 'orange' | 'purple' | 'red' | 'teal' | 'yellow';
|
|
3
5
|
export type LinkLozengeInvokeActions = InvokeActions;
|
|
4
6
|
export interface LinkLozenge {
|
|
5
7
|
action?: LinkLozengeInvokeActions;
|
|
6
8
|
text: string;
|
|
7
9
|
appearance?: LinkLozengeColor;
|
|
10
|
+
style?: AtlaskitLozengeProps['style'];
|
|
8
11
|
}
|
|
9
12
|
export type LinkDocumentState = 'archived' | 'draft' | 'current';
|
|
10
13
|
export type LinkPullRequestState = 'open' | 'merged' | 'declined' | 'closed';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { RequestAccessMessageKey } from './messages';
|
|
3
3
|
export type { CardContext } from '@atlaskit/link-provider';
|
|
4
|
+
import type { LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
|
|
4
5
|
import { AccessContext } from './view/types';
|
|
5
6
|
import { ActionProps } from './view/BlockCard/components/Action';
|
|
6
7
|
export type ResolveResponse = JsonLd.Response;
|
|
@@ -16,5 +17,6 @@ export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'n
|
|
|
16
17
|
export interface LozengeProps {
|
|
17
18
|
text: string;
|
|
18
19
|
appearance?: LozengeColor;
|
|
20
|
+
style?: AtlaskitLozengeProps['style'];
|
|
19
21
|
isBold?: boolean;
|
|
20
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { type ActionBlockProps } from './types';
|
|
4
|
+
declare const ActionBlock: ({ blockRef, onClick: onClickCallback, size, spaceInline, testId, }: ActionBlockProps) => jsx.JSX.Element | null;
|
|
4
5
|
export default ActionBlock;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
|
|
2
3
|
import { ElementProps } from '../types';
|
|
3
4
|
import type { LinkLozengeInvokeActions } from '../../../../../extractors/common/lozenge/types';
|
|
4
5
|
export type LozengeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
|
|
@@ -11,6 +12,10 @@ export type LozengeProps = ElementProps & {
|
|
|
11
12
|
* Determines the appearance of the Atlaskit lozenge.
|
|
12
13
|
*/
|
|
13
14
|
appearance?: LozengeAppearance;
|
|
15
|
+
/**
|
|
16
|
+
* Determines the custom styles of the Atlaskit lozenge.
|
|
17
|
+
*/
|
|
18
|
+
style?: AtlaskitLozengeProps['style'];
|
|
14
19
|
/**
|
|
15
20
|
* The text to display within the lozenge.
|
|
16
21
|
*/
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
|
|
1
2
|
import { InvokeActions } from '../../../state/hooks/use-invoke/types';
|
|
2
3
|
export type LinkLozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
4
|
+
export type AccentShortName = 'blue' | 'gray' | 'green' | 'lime' | 'magenta' | 'orange' | 'purple' | 'red' | 'teal' | 'yellow';
|
|
3
5
|
export type LinkLozengeInvokeActions = InvokeActions;
|
|
4
6
|
export interface LinkLozenge {
|
|
5
7
|
action?: LinkLozengeInvokeActions;
|
|
6
8
|
text: string;
|
|
7
9
|
appearance?: LinkLozengeColor;
|
|
10
|
+
style?: AtlaskitLozengeProps['style'];
|
|
8
11
|
}
|
|
9
12
|
export type LinkDocumentState = 'archived' | 'draft' | 'current';
|
|
10
13
|
export type LinkPullRequestState = 'open' | 'merged' | 'declined' | 'closed';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { RequestAccessMessageKey } from './messages';
|
|
3
3
|
export type { CardContext } from '@atlaskit/link-provider';
|
|
4
|
+
import type { LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
|
|
4
5
|
import { AccessContext } from './view/types';
|
|
5
6
|
import { ActionProps } from './view/BlockCard/components/Action';
|
|
6
7
|
export type ResolveResponse = JsonLd.Response;
|
|
@@ -16,5 +17,6 @@ export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'n
|
|
|
16
17
|
export interface LozengeProps {
|
|
17
18
|
text: string;
|
|
18
19
|
appearance?: LozengeColor;
|
|
20
|
+
style?: AtlaskitLozengeProps['style'];
|
|
19
21
|
isBold?: boolean;
|
|
20
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { type ActionBlockProps } from './types';
|
|
4
|
+
declare const ActionBlock: ({ blockRef, onClick: onClickCallback, size, spaceInline, testId, }: ActionBlockProps) => jsx.JSX.Element | null;
|
|
4
5
|
export default ActionBlock;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
|
|
2
3
|
import { ElementProps } from '../types';
|
|
3
4
|
import type { LinkLozengeInvokeActions } from '../../../../../extractors/common/lozenge/types';
|
|
4
5
|
export type LozengeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
|
|
@@ -11,6 +12,10 @@ export type LozengeProps = ElementProps & {
|
|
|
11
12
|
* Determines the appearance of the Atlaskit lozenge.
|
|
12
13
|
*/
|
|
13
14
|
appearance?: LozengeAppearance;
|
|
15
|
+
/**
|
|
16
|
+
* Determines the custom styles of the Atlaskit lozenge.
|
|
17
|
+
*/
|
|
18
|
+
style?: AtlaskitLozengeProps['style'];
|
|
14
19
|
/**
|
|
15
20
|
* The text to display within the lozenge.
|
|
16
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.58.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
33
33
|
"@atlaskit/avatar": "^21.5.0",
|
|
34
34
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
35
|
-
"@atlaskit/badge": "^16.
|
|
35
|
+
"@atlaskit/badge": "^16.1.0",
|
|
36
36
|
"@atlaskit/button": "^17.14.0",
|
|
37
37
|
"@atlaskit/dropdown-menu": "^12.9.0",
|
|
38
38
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"@atlaskit/linking-types": "^8.8.0",
|
|
49
49
|
"@atlaskit/logo": "^13.15.0",
|
|
50
50
|
"@atlaskit/lozenge": "^11.7.0",
|
|
51
|
-
"@atlaskit/modal-dialog": "^12.
|
|
51
|
+
"@atlaskit/modal-dialog": "^12.12.0",
|
|
52
52
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
54
|
-
"@atlaskit/popup": "^1.
|
|
54
|
+
"@atlaskit/popup": "^1.15.0",
|
|
55
55
|
"@atlaskit/primitives": "^5.6.0",
|
|
56
56
|
"@atlaskit/spinner": "^16.0.0",
|
|
57
57
|
"@atlaskit/theme": "^12.7.0",
|
|
58
|
-
"@atlaskit/tokens": "^1.
|
|
58
|
+
"@atlaskit/tokens": "^1.44.0",
|
|
59
59
|
"@atlaskit/tooltip": "^18.2.0",
|
|
60
60
|
"@atlaskit/ufo": "^0.2.0",
|
|
61
61
|
"@babel/runtime": "^7.0.0",
|