@atlaskit/smart-card 26.48.3 → 26.48.5
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 +13 -0
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +37 -26
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +15 -2
- package/dist/cjs/view/CardWithUrl/component.js +2 -2
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +6 -11
- package/dist/cjs/view/EmbedCard/index.js +4 -3
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +0 -2
- package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +10 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.js +11 -5
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +6 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +13 -10
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +2 -3
- package/dist/cjs/view/FlexibleCard/components/container/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +2 -3
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +2 -3
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +1 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-summary/index.js +23 -5
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +21 -14
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +13 -0
- package/dist/es2019/view/CardWithUrl/component.js +3 -3
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +4 -6
- package/dist/es2019/view/EmbedCard/index.js +4 -3
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +0 -2
- package/dist/es2019/view/EmbedCard/views/unresolved-view/index.js +10 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.js +11 -10
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +6 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +18 -13
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -4
- package/dist/es2019/view/FlexibleCard/components/container/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +6 -7
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +1 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-summary/index.js +19 -9
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +37 -26
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +14 -1
- package/dist/esm/view/CardWithUrl/component.js +3 -3
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +5 -8
- package/dist/esm/view/EmbedCard/index.js +4 -3
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +0 -2
- package/dist/esm/view/EmbedCard/views/unresolved-view/index.js +10 -2
- package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.js +11 -5
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +6 -1
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +15 -12
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +2 -3
- package/dist/esm/view/FlexibleCard/components/container/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +2 -3
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/elements/link/index.js +2 -3
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +1 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-summary/index.js +22 -5
- package/dist/types/utils/index.d.ts +7 -1
- package/dist/types/view/EmbedCard/components/ExpandedFrame.d.ts +0 -2
- package/dist/types/view/EmbedCard/types.d.ts +0 -1
- package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +0 -2
- package/dist/types/view/EmbedCard/views/forbidden-view/types.d.ts +4 -4
- package/dist/types/view/EmbedCard/views/not-found-view/types.d.ts +4 -4
- package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +3 -3
- package/dist/types/view/EmbedCard/views/unresolved-view/types.d.ts +5 -12
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.d.ts +2 -0
- package/dist/types/view/common/ai-summary/index.d.ts +3 -1
- package/dist/types-ts4.5/utils/index.d.ts +7 -1
- package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrame.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedCard/types.d.ts +0 -1
- package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedCard/views/forbidden-view/types.d.ts +4 -4
- package/dist/types-ts4.5/view/EmbedCard/views/not-found-view/types.d.ts +4 -4
- package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +3 -3
- package/dist/types-ts4.5/view/EmbedCard/views/unresolved-view/types.d.ts +5 -12
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.d.ts +2 -0
- package/dist/types-ts4.5/view/common/ai-summary/index.d.ts +3 -1
- package/package.json +4 -3
- package/dist/cjs/utils/token.js +0 -27
- package/dist/cjs/view/EmbedCard/views/UnresolvedView.js +0 -82
- package/dist/es2019/utils/token.js +0 -21
- package/dist/es2019/view/EmbedCard/views/UnresolvedView.js +0 -75
- package/dist/esm/utils/token.js +0 -21
- package/dist/esm/view/EmbedCard/views/UnresolvedView.js +0 -74
- package/dist/types/utils/token.d.ts +0 -21
- package/dist/types/view/EmbedCard/views/UnresolvedView.d.ts +0 -22
- package/dist/types-ts4.5/utils/token.d.ts +0 -21
- package/dist/types-ts4.5/view/EmbedCard/views/UnresolvedView.d.ts +0 -22
|
@@ -111,21 +111,22 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
111
111
|
} finally {
|
|
112
112
|
_iterator2.f();
|
|
113
113
|
}
|
|
114
|
-
_context2.
|
|
114
|
+
_context2.prev = 4;
|
|
115
|
+
_context2.next = 7;
|
|
115
116
|
return this.fetchStream(summaryStyle);
|
|
116
|
-
case
|
|
117
|
+
case 7:
|
|
117
118
|
stream = _context2.sent;
|
|
118
119
|
bufferContent = '';
|
|
119
120
|
_iteratorAbruptCompletion = false;
|
|
120
121
|
_didIteratorError = false;
|
|
121
|
-
_context2.prev =
|
|
122
|
+
_context2.prev = 11;
|
|
122
123
|
_iterator = _asyncIterator(stream);
|
|
123
|
-
case
|
|
124
|
-
_context2.next =
|
|
124
|
+
case 13:
|
|
125
|
+
_context2.next = 15;
|
|
125
126
|
return _iterator.next();
|
|
126
|
-
case
|
|
127
|
+
case 15:
|
|
127
128
|
if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
|
|
128
|
-
_context2.next =
|
|
129
|
+
_context2.next = 21;
|
|
129
130
|
break;
|
|
130
131
|
}
|
|
131
132
|
chunk = _step.value;
|
|
@@ -145,43 +146,53 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
145
146
|
_iterator3.f();
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
|
-
case
|
|
149
|
+
case 18:
|
|
149
150
|
_iteratorAbruptCompletion = false;
|
|
150
|
-
_context2.next =
|
|
151
|
+
_context2.next = 13;
|
|
151
152
|
break;
|
|
152
|
-
case
|
|
153
|
-
_context2.next =
|
|
153
|
+
case 21:
|
|
154
|
+
_context2.next = 27;
|
|
154
155
|
break;
|
|
155
|
-
case
|
|
156
|
-
_context2.prev =
|
|
157
|
-
_context2.t0 = _context2["catch"](
|
|
156
|
+
case 23:
|
|
157
|
+
_context2.prev = 23;
|
|
158
|
+
_context2.t0 = _context2["catch"](11);
|
|
158
159
|
_didIteratorError = true;
|
|
159
160
|
_iteratorError = _context2.t0;
|
|
160
|
-
case
|
|
161
|
-
_context2.prev = 26;
|
|
161
|
+
case 27:
|
|
162
162
|
_context2.prev = 27;
|
|
163
|
+
_context2.prev = 28;
|
|
163
164
|
if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
|
|
164
|
-
_context2.next =
|
|
165
|
+
_context2.next = 32;
|
|
165
166
|
break;
|
|
166
167
|
}
|
|
167
|
-
_context2.next =
|
|
168
|
+
_context2.next = 32;
|
|
168
169
|
return _iterator.return();
|
|
169
|
-
case
|
|
170
|
-
_context2.prev =
|
|
170
|
+
case 32:
|
|
171
|
+
_context2.prev = 32;
|
|
171
172
|
if (!_didIteratorError) {
|
|
172
|
-
_context2.next =
|
|
173
|
+
_context2.next = 35;
|
|
173
174
|
break;
|
|
174
175
|
}
|
|
175
176
|
throw _iteratorError;
|
|
176
|
-
case 34:
|
|
177
|
-
return _context2.finish(31);
|
|
178
177
|
case 35:
|
|
179
|
-
return _context2.finish(
|
|
178
|
+
return _context2.finish(32);
|
|
180
179
|
case 36:
|
|
180
|
+
return _context2.finish(27);
|
|
181
|
+
case 37:
|
|
181
182
|
this.state = {
|
|
182
183
|
status: 'done',
|
|
183
184
|
content: bufferContent
|
|
184
185
|
};
|
|
186
|
+
_context2.next = 43;
|
|
187
|
+
break;
|
|
188
|
+
case 40:
|
|
189
|
+
_context2.prev = 40;
|
|
190
|
+
_context2.t1 = _context2["catch"](4);
|
|
191
|
+
this.state = {
|
|
192
|
+
status: 'error',
|
|
193
|
+
content: ''
|
|
194
|
+
};
|
|
195
|
+
case 43:
|
|
185
196
|
_iterator4 = _createForOfIteratorHelper(this.subscribedStateSetters);
|
|
186
197
|
try {
|
|
187
198
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -193,11 +204,11 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
193
204
|
} finally {
|
|
194
205
|
_iterator4.f();
|
|
195
206
|
}
|
|
196
|
-
case
|
|
207
|
+
case 45:
|
|
197
208
|
case "end":
|
|
198
209
|
return _context2.stop();
|
|
199
210
|
}
|
|
200
|
-
}, _callee2, this, [[
|
|
211
|
+
}, _callee2, this, [[4, 40], [11, 23, 27, 37], [28,, 32, 36]]);
|
|
201
212
|
}));
|
|
202
213
|
function summariseUrl() {
|
|
203
214
|
return _summariseUrl.apply(this, arguments);
|
|
@@ -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.48.
|
|
18
|
+
packageVersion: "26.48.5"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -341,4 +341,17 @@ export var openUrl = /*#__PURE__*/function () {
|
|
|
341
341
|
return function openUrl(_x3) {
|
|
342
342
|
return _ref3.apply(this, arguments);
|
|
343
343
|
};
|
|
344
|
-
}();
|
|
344
|
+
}();
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Migrate internal usages of the deprecated isFrameVisible to frameStyle
|
|
348
|
+
* This function is to be removed on deprecation of isFrameVisible.
|
|
349
|
+
*/
|
|
350
|
+
export var combineFrameStyle = function combineFrameStyle(frameStyle, isFrameVisible) {
|
|
351
|
+
if (frameStyle !== undefined) {
|
|
352
|
+
return frameStyle;
|
|
353
|
+
}
|
|
354
|
+
if (isFrameVisible) {
|
|
355
|
+
return 'show';
|
|
356
|
+
}
|
|
357
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useCallback, useMemo } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
3
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
4
|
-
import { isSpecialEvent } from '../../utils';
|
|
4
|
+
import { combineFrameStyle, isSpecialEvent } from '../../utils';
|
|
5
5
|
import * as measure from '../../utils/performance';
|
|
6
6
|
import { getDefinitionId, getServices, isFinalState, getClickUrl, getResourceType, getExtensionKey, getSubproduct, getProduct, getCanBeDatasource } from '../../state/helpers';
|
|
7
7
|
import { useSmartLink } from '../../state';
|
|
@@ -20,7 +20,7 @@ function Component(_ref) {
|
|
|
20
20
|
isSelected = _ref.isSelected,
|
|
21
21
|
isHovered = _ref.isHovered,
|
|
22
22
|
isFrameVisible = _ref.isFrameVisible,
|
|
23
|
-
|
|
23
|
+
frameStyleProp = _ref.frameStyle,
|
|
24
24
|
platform = _ref.platform,
|
|
25
25
|
onClick = _ref.onClick,
|
|
26
26
|
appearance = _ref.appearance,
|
|
@@ -65,6 +65,7 @@ function Component(_ref) {
|
|
|
65
65
|
}, [children]);
|
|
66
66
|
var enableFlexibleBlockCardFlag = Boolean(useFeatureFlag('enableFlexibleBlockCard'));
|
|
67
67
|
var actionOptions = combineActionOptions(actionOptionsProp, showServerActions, showActions, platform);
|
|
68
|
+
var frameStyle = combineFrameStyle(frameStyleProp, isFrameVisible);
|
|
68
69
|
|
|
69
70
|
// Setup UI handlers.
|
|
70
71
|
var handleClickWrapper = useCallback(function (event) {
|
|
@@ -251,7 +252,6 @@ function Component(_ref) {
|
|
|
251
252
|
handleInvoke: handleInvoke,
|
|
252
253
|
analytics: analytics,
|
|
253
254
|
isSelected: isSelected,
|
|
254
|
-
isFrameVisible: isFrameVisible,
|
|
255
255
|
frameStyle: frameStyle,
|
|
256
256
|
platform: platform,
|
|
257
257
|
onResolve: onResolve,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { className, LinkWrapper, Wrapper, Header, IconWrapper, TextWrapper, Content } from './styled';
|
|
3
3
|
import { handleClickCommon } from '../../BlockCard/utils/handlers';
|
|
4
4
|
import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
|
|
@@ -10,8 +10,8 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
10
10
|
icon = _ref.icon,
|
|
11
11
|
text = _ref.text,
|
|
12
12
|
isSelected = _ref.isSelected,
|
|
13
|
-
|
|
14
|
-
frameStyle = _ref
|
|
13
|
+
_ref$frameStyle = _ref.frameStyle,
|
|
14
|
+
frameStyle = _ref$frameStyle === void 0 ? 'showOnHover' : _ref$frameStyle,
|
|
15
15
|
href = _ref.href,
|
|
16
16
|
minWidth = _ref.minWidth,
|
|
17
17
|
maxWidth = _ref.maxWidth,
|
|
@@ -27,9 +27,6 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
27
27
|
return handleClickCommon(event, onClick);
|
|
28
28
|
};
|
|
29
29
|
var handleMouseDown = useMouseDownEvent();
|
|
30
|
-
var calculatedFrameStyle = useMemo(function () {
|
|
31
|
-
return frameStyle !== undefined ? frameStyle : isFrameVisible ? 'show' : 'showOnHover';
|
|
32
|
-
}, [frameStyle, isFrameVisible]);
|
|
33
30
|
var renderHeader = function renderHeader() {
|
|
34
31
|
return /*#__PURE__*/React.createElement(Header, {
|
|
35
32
|
className: "embed-header",
|
|
@@ -57,7 +54,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
57
54
|
className: className,
|
|
58
55
|
isInteractive: isInteractive(),
|
|
59
56
|
isSelected: isSelected,
|
|
60
|
-
frameStyle:
|
|
57
|
+
frameStyle: frameStyle,
|
|
61
58
|
minWidth: minWidth,
|
|
62
59
|
maxWidth: maxWidth,
|
|
63
60
|
"data-testid": testId,
|
|
@@ -73,7 +70,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
73
70
|
isInteractive: isInteractive(),
|
|
74
71
|
isSelected: isSelected,
|
|
75
72
|
minWidth: minWidth,
|
|
76
|
-
frameStyle:
|
|
73
|
+
frameStyle: frameStyle,
|
|
77
74
|
maxWidth: maxWidth,
|
|
78
75
|
"data-testid": testId,
|
|
79
76
|
"data-trello-do-not-use-override": testId,
|
|
@@ -26,7 +26,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
26
26
|
analytics = _ref.analytics,
|
|
27
27
|
handleInvoke = _ref.handleInvoke,
|
|
28
28
|
isSelected = _ref.isSelected,
|
|
29
|
-
isFrameVisible = _ref.isFrameVisible,
|
|
30
29
|
frameStyle = _ref.frameStyle,
|
|
31
30
|
platform = _ref.platform,
|
|
32
31
|
onResolve = _ref.onResolve,
|
|
@@ -64,7 +63,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
64
63
|
if (resolvedViewProps.preview) {
|
|
65
64
|
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
|
|
66
65
|
isSelected: isSelected,
|
|
67
|
-
isFrameVisible: isFrameVisible,
|
|
68
66
|
frameStyle: frameStyle,
|
|
69
67
|
inheritDimensions: inheritDimensions,
|
|
70
68
|
onClick: handleFrameClick,
|
|
@@ -107,6 +105,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
107
105
|
analytics: analytics,
|
|
108
106
|
context: unauthorisedViewProps.context,
|
|
109
107
|
extensionKey: extensionKey,
|
|
108
|
+
frameStyle: frameStyle,
|
|
110
109
|
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
111
110
|
inheritDimensions: inheritDimensions,
|
|
112
111
|
isSelected: isSelected,
|
|
@@ -127,8 +126,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
127
126
|
if (forbiddenViewProps.preview) {
|
|
128
127
|
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, forbiddenViewProps, {
|
|
129
128
|
title: forbiddenViewProps.link,
|
|
129
|
+
frameStyle: frameStyle,
|
|
130
130
|
isSelected: isSelected,
|
|
131
|
-
isFrameVisible: isFrameVisible,
|
|
132
131
|
inheritDimensions: inheritDimensions,
|
|
133
132
|
onClick: handleFrameClick,
|
|
134
133
|
ref: iframeRef
|
|
@@ -142,6 +141,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
142
141
|
});
|
|
143
142
|
return /*#__PURE__*/React.createElement(ForbiddenView, {
|
|
144
143
|
context: forbiddenViewProps.context,
|
|
144
|
+
frameStyle: frameStyle,
|
|
145
145
|
inheritDimensions: inheritDimensions,
|
|
146
146
|
isSelected: isSelected,
|
|
147
147
|
onAuthorize: handleAuthorize,
|
|
@@ -165,6 +165,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
165
165
|
}) : undefined;
|
|
166
166
|
return /*#__PURE__*/React.createElement(NotFoundView, {
|
|
167
167
|
context: notFoundViewProps.context,
|
|
168
|
+
frameStyle: frameStyle,
|
|
168
169
|
inheritDimensions: inheritDimensions,
|
|
169
170
|
isSelected: isSelected,
|
|
170
171
|
onClick: handleFrameClick,
|
|
@@ -11,7 +11,6 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
|
|
|
11
11
|
context = _ref.context,
|
|
12
12
|
onClick = _ref.onClick,
|
|
13
13
|
isSelected = _ref.isSelected,
|
|
14
|
-
isFrameVisible = _ref.isFrameVisible,
|
|
15
14
|
frameStyle = _ref.frameStyle,
|
|
16
15
|
preview = _ref.preview,
|
|
17
16
|
title = _ref.title,
|
|
@@ -49,7 +48,6 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
|
|
|
49
48
|
}
|
|
50
49
|
return jsx(ExpandedFrame, {
|
|
51
50
|
isSelected: isSelected,
|
|
52
|
-
isFrameVisible: isFrameVisible,
|
|
53
51
|
frameStyle: frameStyle,
|
|
54
52
|
href: link,
|
|
55
53
|
testId: testId,
|
|
@@ -8,6 +8,7 @@ import { containerStyles, contentStyles, descriptionStyles, imageStyles, titleSt
|
|
|
8
8
|
var UnresolvedView = function UnresolvedView(_ref) {
|
|
9
9
|
var button = _ref.button,
|
|
10
10
|
description = _ref.description,
|
|
11
|
+
frameStyle = _ref.frameStyle,
|
|
11
12
|
iconUrlOrElement = _ref.icon,
|
|
12
13
|
image = _ref.image,
|
|
13
14
|
inheritDimensions = _ref.inheritDimensions,
|
|
@@ -31,8 +32,15 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
31
32
|
});
|
|
32
33
|
}, [iconUrlOrElement]);
|
|
33
34
|
return jsx(ExpandedFrame, {
|
|
34
|
-
allowScrollBar: true
|
|
35
|
-
|
|
35
|
+
allowScrollBar: true
|
|
36
|
+
// EDM-9259: Fix embed frame showing on unresolved views when frameStyle is set to hide.
|
|
37
|
+
// Set fallback to 'show' here to maintain the current behaviour when platform.editor.show-embed-card-frame-renderer is OFF.
|
|
38
|
+
// Remove 'show' on platform.editor.show-embed-card-frame-renderer cleanup as frameStyle will be set to 'show' both in renderer and editor.
|
|
39
|
+
// We want all views to be consistent and respect frameStyle instead of
|
|
40
|
+
// having resolved view default to showOnHover and unresolved view default to show.
|
|
41
|
+
// Default frameStyle is set inside <ExpandedFrame />
|
|
42
|
+
,
|
|
43
|
+
frameStyle: frameStyle !== null && frameStyle !== void 0 ? frameStyle : 'show',
|
|
36
44
|
href: url,
|
|
37
45
|
icon: icon,
|
|
38
46
|
inheritDimensions: inheritDimensions,
|
|
@@ -7,8 +7,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Action from '../index';
|
|
9
9
|
import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
|
|
10
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
11
|
-
import { messages } from '../../../../../../messages';
|
|
12
10
|
import { openEmbedModalWithFlexibleUiIcon } from '../../../utils';
|
|
13
11
|
import useInvokeClientAction from '../../../../../../state/hooks/use-invoke-client-action';
|
|
14
12
|
import { ActionName } from '../../../../../../constants';
|
|
@@ -68,8 +66,7 @@ var PreviewAction = function PreviewAction(props) {
|
|
|
68
66
|
if (_onClick) {
|
|
69
67
|
_onClick();
|
|
70
68
|
}
|
|
71
|
-
}
|
|
72
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_improved)
|
|
69
|
+
}
|
|
73
70
|
});
|
|
74
71
|
return /*#__PURE__*/React.createElement(Action, _extends({}, action, {
|
|
75
72
|
appearance: appearance,
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
-
var _templateObject;
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import styled from '@emotion/styled';
|
|
6
4
|
import Tooltip, { TooltipPrimitive } from '@atlaskit/tooltip';
|
|
7
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
|
-
var AIIndicatorTooltipPrimitive = styled(TooltipPrimitive)(
|
|
6
|
+
var AIIndicatorTooltipPrimitive = styled(TooltipPrimitive)({
|
|
7
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
8
|
+
backgroundColor: "var(--ds-surface-raised, white)",
|
|
9
|
+
boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px rgba(9, 30, 66, 0.15),0px 0px 1px rgba(9, 30, 66, 0.31))",
|
|
10
|
+
boxSizing: 'content-box',
|
|
11
|
+
padding: "var(--ds-space-200, 16px)",
|
|
12
|
+
maxWidth: '350px'
|
|
13
|
+
});
|
|
9
14
|
var triggerStyles = xcss({
|
|
10
15
|
display: 'inline-flex'
|
|
11
16
|
});
|
|
12
17
|
var AIIndicatorTooltip = function AIIndicatorTooltip(_ref) {
|
|
13
18
|
var content = _ref.content,
|
|
14
|
-
trigger = _ref.trigger
|
|
19
|
+
trigger = _ref.trigger,
|
|
20
|
+
overrideXcss = _ref.xcss;
|
|
15
21
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
16
22
|
component: AIIndicatorTooltipPrimitive,
|
|
17
23
|
content: content,
|
|
18
24
|
tag: "span"
|
|
19
25
|
}, function (tooltipProps) {
|
|
20
26
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
21
|
-
xcss: triggerStyles
|
|
27
|
+
xcss: [triggerStyles, overrideXcss]
|
|
22
28
|
}, tooltipProps), trigger);
|
|
23
29
|
});
|
|
24
30
|
};
|
|
@@ -41,6 +41,10 @@ var iconTooltipDescStyles = xcss({
|
|
|
41
41
|
fontWeight: '400',
|
|
42
42
|
lineHeight: '14px'
|
|
43
43
|
});
|
|
44
|
+
var iconTooltipTriggerStyles = xcss({
|
|
45
|
+
position: 'relative',
|
|
46
|
+
bottom: 'space.negative.050'
|
|
47
|
+
});
|
|
44
48
|
var AIStateDone = function AIStateDone(_ref) {
|
|
45
49
|
var appearance = _ref.appearance,
|
|
46
50
|
testId = _ref.testId;
|
|
@@ -73,7 +77,8 @@ var AIStateDone = function AIStateDone(_ref) {
|
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
}))))),
|
|
76
|
-
trigger: icon
|
|
80
|
+
trigger: icon,
|
|
81
|
+
xcss: iconTooltipTriggerStyles
|
|
77
82
|
});
|
|
78
83
|
default:
|
|
79
84
|
return jsx(AIIndicatorContainer, {
|
|
@@ -4,26 +4,26 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
7
|
-
import { ActionName, SmartLinkSize, SmartLinkWidth
|
|
7
|
+
import { ActionName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
8
8
|
import ActionGroup from '../../action-group';
|
|
9
9
|
import Block from '../../block';
|
|
10
10
|
import ElementGroup from '../../element-group';
|
|
11
11
|
import AIStateIndicator from '../ai-state-indicator';
|
|
12
12
|
import { renderElementItems } from '../../utils';
|
|
13
13
|
import { messages } from '../../../../../../messages';
|
|
14
|
-
import AiIcon from '../../../../../common/ai-icon';
|
|
15
|
-
import AISummary from '../../../../../common/ai-summary';
|
|
16
14
|
import { useAISummary } from '../../../../../../state/hooks/use-ai-summary';
|
|
17
15
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
16
|
+
import AIIcon from '../../../../../common/ai-icon';
|
|
17
|
+
import AISummary from '../../../../../common/ai-summary';
|
|
18
18
|
var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
19
19
|
var _props$actions = props.actions,
|
|
20
20
|
actions = _props$actions === void 0 ? [] : _props$actions,
|
|
21
21
|
metadata = props.metadata,
|
|
22
|
-
testId = props.testId,
|
|
23
22
|
onActionMenuOpenChange = props.onActionMenuOpenChange,
|
|
24
23
|
onAIActionChange = props.onAIActionChange,
|
|
25
24
|
_props$size = props.size,
|
|
26
|
-
size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size
|
|
25
|
+
size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size,
|
|
26
|
+
testId = props.testId;
|
|
27
27
|
var _useState = useState('ready'),
|
|
28
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
29
|
aiState = _useState2[0],
|
|
@@ -34,7 +34,8 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
34
34
|
var aiSummary = useAISummary({
|
|
35
35
|
url: url
|
|
36
36
|
});
|
|
37
|
-
var content = aiSummary.state.content
|
|
37
|
+
var content = aiSummary.state.content,
|
|
38
|
+
isSummarisedOnMount = aiSummary.isSummarisedOnMount;
|
|
38
39
|
var onAIActionClick = useCallback(function () {
|
|
39
40
|
setAIState('loading');
|
|
40
41
|
if (onAIActionChange) {
|
|
@@ -48,8 +49,8 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
48
49
|
name: ActionName.CustomAction,
|
|
49
50
|
onClick: onAIActionClick,
|
|
50
51
|
testId: "".concat(testId, "-ai-summary-action"),
|
|
51
|
-
icon: /*#__PURE__*/React.createElement(
|
|
52
|
-
label: "
|
|
52
|
+
icon: /*#__PURE__*/React.createElement(AIIcon, {
|
|
53
|
+
label: "AIIcon"
|
|
53
54
|
})
|
|
54
55
|
};
|
|
55
56
|
return [aiAction].concat(_toConsumableArray(actions));
|
|
@@ -67,17 +68,19 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
67
68
|
direction: SmartLinkDirection.Vertical,
|
|
68
69
|
testId: "".concat(testId, "-resolved-view")
|
|
69
70
|
}), /*#__PURE__*/React.createElement(AISummary, {
|
|
70
|
-
content: content
|
|
71
|
+
content: content,
|
|
72
|
+
showIcon: isSummarisedOnMount
|
|
71
73
|
}), /*#__PURE__*/React.createElement(Inline, {
|
|
72
74
|
alignBlock: "center",
|
|
73
75
|
alignInline: "end",
|
|
74
76
|
grow: "fill",
|
|
75
77
|
spread: "space-between"
|
|
76
|
-
}, /*#__PURE__*/React.createElement(Box, null, aiState === 'loading' || aiState === 'done' ? /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Box, null, !isSummarisedOnMount && (aiState === 'loading' || aiState === 'done') ? /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
77
79
|
state: aiState,
|
|
78
|
-
testId: testId
|
|
80
|
+
testId: "".concat(testId, "-state-indicator")
|
|
79
81
|
}) : /*#__PURE__*/React.createElement(ElementGroup, {
|
|
80
|
-
width: SmartLinkWidth.FitToContent
|
|
82
|
+
width: SmartLinkWidth.FitToContent,
|
|
83
|
+
testId: "".concat(testId, "-metadata-group")
|
|
81
84
|
}, metadataElements)), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
82
85
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
83
86
|
items: combinedActions,
|
|
@@ -12,11 +12,10 @@ import Block from '../../block';
|
|
|
12
12
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize } from '../../../../../../constants';
|
|
13
13
|
import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles } from '../../../utils';
|
|
14
14
|
import ElementGroup from '../../element-group';
|
|
15
|
-
|
|
16
|
-
var actionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), tokens.errorMessageHover);
|
|
15
|
+
var actionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), "var(--ds-text-subtle, #8993A4)");
|
|
17
16
|
var getMessageStyles = function getMessageStyles(size, hasAction) {
|
|
18
17
|
var sizeStyles = getLinkSizeStyles(size);
|
|
19
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n justify-content: flex-end;\n ", "\n ", "\n ", "\n color: ", ";\n :focus {\n outline: ", " solid 2px;\n }\n "])), hasAction ? actionStyles : '', sizeStyles, getTruncateStyles(1, getLinkLineHeight(size)),
|
|
18
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n justify-content: flex-end;\n ", "\n ", "\n ", "\n color: ", ";\n :focus {\n outline: ", " solid 2px;\n }\n "])), hasAction ? actionStyles : '', sizeStyles, getTruncateStyles(1, getLinkLineHeight(size)), "var(--ds-text-disabled, #6B778C)", "var(--ds-border-focused, #388BFF)");
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
/**
|
|
@@ -5,7 +5,6 @@ import React, { useContext } from 'react';
|
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { MediaPlacement, SmartLinkSize, SmartLinkTheme } from '../../../../constants';
|
|
7
7
|
import { isFlexibleUiBlock, isFlexibleUiPreviewBlock, isFlexibleUiTitleBlock } from '../../../../utils/flexible';
|
|
8
|
-
import { tokens } from '../../../../utils/token';
|
|
9
8
|
import { FlexibleUiContext } from '../../../../state/flexible-ui-context';
|
|
10
9
|
import LayeredLink from './layered-link';
|
|
11
10
|
import HoverCardControl from './hover-card-control';
|
|
@@ -68,7 +67,7 @@ var getChildrenOptions = function getChildrenOptions(children, context) {
|
|
|
68
67
|
};
|
|
69
68
|
export var getContainerStyles = function getContainerStyles(size, hideBackground, hideElevation, hidePadding, clickableContainer, childrenOptions) {
|
|
70
69
|
var paddingCss = getContainerPaddingStyles(size, hidePadding, childrenOptions);
|
|
71
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n gap: ", " 0;\n flex-direction: column;\n min-width: 0;\n overflow-x: hidden;\n position: relative;\n ", "\n ", "\n ", "\n ", "\n &:hover ~ .actions-button-group {\n opacity: 1;\n }\n a:focus,\n .has-action:focus {\n outline-offset: -2px;\n }\n "])), getGap(size), hideBackground ? '' : "background-color: ".concat(
|
|
70
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n gap: ", " 0;\n flex-direction: column;\n min-width: 0;\n overflow-x: hidden;\n position: relative;\n ", "\n ", "\n ", "\n ", "\n &:hover ~ .actions-button-group {\n opacity: 1;\n }\n a:focus,\n .has-action:focus {\n outline-offset: -2px;\n }\n "])), getGap(size), hideBackground ? '' : "background-color: ".concat("var(--ds-surface-raised, #FFFFFF)", ";"), paddingCss, hideElevation ? '' : elevationStyles, clickableContainer ? clickableContainerStyles : '');
|
|
72
71
|
};
|
|
73
72
|
var renderChildren = function renderChildren(children, containerSize, containerTheme, status, retry, onClick) {
|
|
74
73
|
return React.Children.map(children, function (child) {
|
|
@@ -4,15 +4,14 @@ var _templateObject, _templateObject2, _templateObject3, _messageMapper;
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
import { tokens } from '../../../../../utils/token';
|
|
8
7
|
import { getFormattedMessage, getIconSizeStyles } from '../../utils';
|
|
9
8
|
import { IconType } from '../../../../../constants';
|
|
10
9
|
import { messages } from '../../../../../messages';
|
|
11
10
|
import ImageIcon from '../../common/image-icon';
|
|
12
11
|
import AtlaskitIcon from '../../common/atlaskit-icon';
|
|
13
12
|
var badgeStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n display: inline-flex;\n min-width: fit-content;\n"])));
|
|
14
|
-
var iconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n line-height: 0;\n vertical-align: middle;\n ", "\n img,\n span,\n svg {\n line-height: 0;\n vertical-align: middle;\n }\n"])),
|
|
15
|
-
var labelStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n padding-left: 0.125rem;\n vertical-align: middle;\n"])),
|
|
13
|
+
var iconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n line-height: 0;\n vertical-align: middle;\n ", "\n img,\n span,\n svg {\n line-height: 0;\n vertical-align: middle;\n }\n"])), "var(--ds-icon-subtle, #626F86)", getIconSizeStyles('1rem'));
|
|
14
|
+
var labelStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n padding-left: 0.125rem;\n vertical-align: middle;\n"])), "var(--ds-text-subtlest, #626F86)");
|
|
16
15
|
var messageMapper = (_messageMapper = {}, _defineProperty(_messageMapper, IconType.PriorityBlocker, messages.priority_blocker), _defineProperty(_messageMapper, IconType.PriorityCritical, messages.priority_critical), _defineProperty(_messageMapper, IconType.PriorityHigh, messages.priority_high), _defineProperty(_messageMapper, IconType.PriorityHighest, messages.priority_highest), _defineProperty(_messageMapper, IconType.PriorityLow, messages.priority_low), _defineProperty(_messageMapper, IconType.PriorityLowest, messages.priority_lowest), _defineProperty(_messageMapper, IconType.PriorityMajor, messages.priority_major), _defineProperty(_messageMapper, IconType.PriorityMedium, messages.priority_medium), _defineProperty(_messageMapper, IconType.PriorityMinor, messages.priority_minor), _defineProperty(_messageMapper, IconType.PriorityTrivial, messages.priority_trivial), _defineProperty(_messageMapper, IconType.PriorityUndefined, messages.priority_undefined), _messageMapper);
|
|
17
16
|
var getFormattedMessageFromIcon = function getFormattedMessageFromIcon(icon) {
|
|
18
17
|
if (icon) {
|
|
@@ -6,10 +6,9 @@ import React from 'react';
|
|
|
6
6
|
import { useIntl, FormattedMessage } from 'react-intl-next';
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import { getTruncateStyles } from '../../utils';
|
|
9
|
-
import { tokens } from '../../../../../utils/token';
|
|
10
9
|
import { selectUnit } from '@formatjs/intl-utils';
|
|
11
10
|
import { messages } from '../../../../../messages';
|
|
12
|
-
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n ", "\n"])),
|
|
11
|
+
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n ", "\n"])), "var(--ds-text-subtlest, #626F86)", getTruncateStyles(1));
|
|
13
12
|
var typeToDescriptorMap = {
|
|
14
13
|
created: {
|
|
15
14
|
relative: messages.created_on_relative,
|
|
@@ -7,7 +7,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
8
|
import { SmartLinkInternalTheme, SmartLinkSize, SmartLinkTheme } from '../../../../../constants';
|
|
9
9
|
import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles, hasWhiteSpace } from '../../utils';
|
|
10
|
-
import { tokens } from '../../../../../utils/token';
|
|
11
10
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
12
11
|
var DEFAULT_MAX_LINES = 2;
|
|
13
12
|
var MAXIMUM_MAX_LINES = 2;
|
|
@@ -21,10 +20,10 @@ var getThemeStyles = function getThemeStyles(theme) {
|
|
|
21
20
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n a& {\n color: ", ";\n &:active,\n &:visited,\n &:focus,\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n font-size: 12px;\n }\n "])), "var(--ds-text-subtlest, #626F86)", "var(--ds-text-subtlest, #626F86)");
|
|
22
21
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
23
22
|
case SmartLinkTheme.Black:
|
|
24
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])),
|
|
23
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), "var(--ds-text-subtle, #44546F)", "var(--ds-text, #172B4D)", "var(--ds-text-subtle, #44546F)");
|
|
25
24
|
case SmartLinkTheme.Link:
|
|
26
25
|
default:
|
|
27
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])),
|
|
26
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), "var(--ds-link, #0C66E4)", "var(--ds-link-pressed, #0055CC)", "var(--ds-link, #0C66E4)");
|
|
28
27
|
}
|
|
29
28
|
};
|
|
30
29
|
var getAnchorStyles = function getAnchorStyles(size, theme, maxLines, hasSpace) {
|
|
@@ -4,9 +4,8 @@ var _templateObject;
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { getFormattedMessage, getTruncateStyles } from '../../utils';
|
|
7
|
-
import { tokens } from '../../../../../utils/token';
|
|
8
7
|
var getStyles = function getStyles(maxLines) {
|
|
9
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n white-space: normal;\n ", "\n"])),
|
|
8
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n white-space: normal;\n ", "\n"])), "var(--ds-text-subtlest, #626F86)", getTruncateStyles(maxLines));
|
|
10
9
|
};
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -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.48.
|
|
13
|
+
packageVersion: "26.48.5",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import Markdown from 'markdown-to-jsx';
|
|
6
4
|
import { css, jsx } from '@emotion/react';
|
|
7
|
-
|
|
5
|
+
import AIStateIndicator from '../../FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator';
|
|
6
|
+
var AITooltipIcon = function AITooltipIcon() {
|
|
7
|
+
return jsx(AIStateIndicator, {
|
|
8
|
+
appearance: "icon-only",
|
|
9
|
+
state: "done",
|
|
10
|
+
testId: "ai-tooltip"
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var AISummaryCSS = css({
|
|
14
|
+
fontSize: '0.75rem',
|
|
15
|
+
lineHeight: '1rem',
|
|
16
|
+
wordWrap: 'break-word',
|
|
17
|
+
whiteSpace: 'normal'
|
|
18
|
+
});
|
|
8
19
|
/**
|
|
9
20
|
* A component to render a response from AI in markdown text.
|
|
10
21
|
* @internal
|
|
@@ -13,6 +24,9 @@ var AISummaryCSS = css(_templateObject || (_templateObject = _taggedTemplateLite
|
|
|
13
24
|
|
|
14
25
|
var AISummary = function AISummary(_ref) {
|
|
15
26
|
var content = _ref.content,
|
|
27
|
+
_ref$showIcon = _ref.showIcon,
|
|
28
|
+
showIcon = _ref$showIcon === void 0 ? false : _ref$showIcon,
|
|
29
|
+
iconComponent = _ref.iconComponent,
|
|
16
30
|
overrideCss = _ref.overrideCss,
|
|
17
31
|
_ref$testId = _ref.testId,
|
|
18
32
|
testId = _ref$testId === void 0 ? 'ai-summary' : _ref$testId;
|
|
@@ -22,9 +36,12 @@ var AISummary = function AISummary(_ref) {
|
|
|
22
36
|
return jsx(Markdown, {
|
|
23
37
|
"data-testid": testId,
|
|
24
38
|
css: [AISummaryCSS, overrideCss],
|
|
25
|
-
children: content,
|
|
39
|
+
children: showIcon ? "".concat(content, " <Icon />") : content,
|
|
26
40
|
options: {
|
|
27
|
-
forceWrapper: true
|
|
41
|
+
forceWrapper: true,
|
|
42
|
+
overrides: {
|
|
43
|
+
Icon: iconComponent !== null && iconComponent !== void 0 ? iconComponent : AITooltipIcon
|
|
44
|
+
}
|
|
28
45
|
}
|
|
29
46
|
});
|
|
30
47
|
};
|