@atlaskit/smart-card 26.48.2 → 26.48.4
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/state/hooks/use-ai-summary/ai-summary-service/index.js +79 -33
- package/dist/cjs/state/hooks/use-ai-summary/index.js +41 -16
- 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/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/HoverCard/utils.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +17 -8
- package/dist/es2019/state/hooks/use-ai-summary/index.js +38 -17
- 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/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/HoverCard/utils.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +79 -33
- package/dist/esm/state/hooks/use-ai-summary/index.js +42 -17
- 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/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/HoverCard/utils.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +2 -2
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +1 -1
- package/dist/types/state/hooks/use-ai-summary/index.d.ts +1 -1
- 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-ts4.5/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +2 -2
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-ai-summary/index.d.ts +1 -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/package.json +2 -2
- 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
|
@@ -2,6 +2,9 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
10
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
@@ -16,7 +19,7 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
16
19
|
content: '',
|
|
17
20
|
status: 'ready'
|
|
18
21
|
});
|
|
19
|
-
_defineProperty(this, "
|
|
22
|
+
_defineProperty(this, "subscribedStateSetters", new Set());
|
|
20
23
|
_defineProperty(this, "fetchStream", /*#__PURE__*/function () {
|
|
21
24
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(summaryStyle) {
|
|
22
25
|
var payload, options, path, requestUrl, response;
|
|
@@ -72,6 +75,9 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
72
75
|
value: function () {
|
|
73
76
|
var _summariseUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
74
77
|
var summaryStyle,
|
|
78
|
+
_iterator2,
|
|
79
|
+
_step2,
|
|
80
|
+
_subscriber,
|
|
75
81
|
stream,
|
|
76
82
|
bufferContent,
|
|
77
83
|
_iteratorAbruptCompletion,
|
|
@@ -80,6 +86,12 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
80
86
|
_iterator,
|
|
81
87
|
_step,
|
|
82
88
|
chunk,
|
|
89
|
+
_iterator3,
|
|
90
|
+
_step3,
|
|
91
|
+
subscriber,
|
|
92
|
+
_iterator4,
|
|
93
|
+
_step4,
|
|
94
|
+
_subscriber2,
|
|
83
95
|
_args2 = arguments;
|
|
84
96
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
85
97
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -88,74 +100,104 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
88
100
|
this.state = _objectSpread(_objectSpread({}, this.state), {}, {
|
|
89
101
|
status: 'loading'
|
|
90
102
|
});
|
|
91
|
-
|
|
92
|
-
|
|
103
|
+
_iterator2 = _createForOfIteratorHelper(this.subscribedStateSetters);
|
|
104
|
+
try {
|
|
105
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
106
|
+
_subscriber = _step2.value;
|
|
107
|
+
_subscriber(this.state);
|
|
108
|
+
}
|
|
109
|
+
} catch (err) {
|
|
110
|
+
_iterator2.e(err);
|
|
111
|
+
} finally {
|
|
112
|
+
_iterator2.f();
|
|
113
|
+
}
|
|
114
|
+
_context2.next = 6;
|
|
93
115
|
return this.fetchStream(summaryStyle);
|
|
94
|
-
case
|
|
116
|
+
case 6:
|
|
95
117
|
stream = _context2.sent;
|
|
96
118
|
bufferContent = '';
|
|
97
119
|
_iteratorAbruptCompletion = false;
|
|
98
120
|
_didIteratorError = false;
|
|
99
|
-
_context2.prev =
|
|
121
|
+
_context2.prev = 10;
|
|
100
122
|
_iterator = _asyncIterator(stream);
|
|
101
|
-
case
|
|
102
|
-
_context2.next =
|
|
123
|
+
case 12:
|
|
124
|
+
_context2.next = 14;
|
|
103
125
|
return _iterator.next();
|
|
104
|
-
case
|
|
126
|
+
case 14:
|
|
105
127
|
if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
|
|
106
|
-
_context2.next =
|
|
128
|
+
_context2.next = 20;
|
|
107
129
|
break;
|
|
108
130
|
}
|
|
109
131
|
chunk = _step.value;
|
|
110
132
|
if (chunk.type === 'ANSWER_PART') {
|
|
111
133
|
bufferContent += chunk.message.content;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
134
|
+
_iterator3 = _createForOfIteratorHelper(this.subscribedStateSetters);
|
|
135
|
+
try {
|
|
136
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
137
|
+
subscriber = _step3.value;
|
|
138
|
+
subscriber(_objectSpread(_objectSpread({}, this.state), {}, {
|
|
139
|
+
content: bufferContent
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
} catch (err) {
|
|
143
|
+
_iterator3.e(err);
|
|
144
|
+
} finally {
|
|
145
|
+
_iterator3.f();
|
|
146
|
+
}
|
|
115
147
|
}
|
|
116
|
-
case
|
|
148
|
+
case 17:
|
|
117
149
|
_iteratorAbruptCompletion = false;
|
|
118
|
-
_context2.next =
|
|
150
|
+
_context2.next = 12;
|
|
119
151
|
break;
|
|
120
|
-
case
|
|
121
|
-
_context2.next =
|
|
152
|
+
case 20:
|
|
153
|
+
_context2.next = 26;
|
|
122
154
|
break;
|
|
123
|
-
case
|
|
124
|
-
_context2.prev =
|
|
125
|
-
_context2.t0 = _context2["catch"](
|
|
155
|
+
case 22:
|
|
156
|
+
_context2.prev = 22;
|
|
157
|
+
_context2.t0 = _context2["catch"](10);
|
|
126
158
|
_didIteratorError = true;
|
|
127
159
|
_iteratorError = _context2.t0;
|
|
128
|
-
case
|
|
129
|
-
_context2.prev = 25;
|
|
160
|
+
case 26:
|
|
130
161
|
_context2.prev = 26;
|
|
162
|
+
_context2.prev = 27;
|
|
131
163
|
if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
|
|
132
|
-
_context2.next =
|
|
164
|
+
_context2.next = 31;
|
|
133
165
|
break;
|
|
134
166
|
}
|
|
135
|
-
_context2.next =
|
|
167
|
+
_context2.next = 31;
|
|
136
168
|
return _iterator.return();
|
|
137
|
-
case
|
|
138
|
-
_context2.prev =
|
|
169
|
+
case 31:
|
|
170
|
+
_context2.prev = 31;
|
|
139
171
|
if (!_didIteratorError) {
|
|
140
|
-
_context2.next =
|
|
172
|
+
_context2.next = 34;
|
|
141
173
|
break;
|
|
142
174
|
}
|
|
143
175
|
throw _iteratorError;
|
|
144
|
-
case 33:
|
|
145
|
-
return _context2.finish(30);
|
|
146
176
|
case 34:
|
|
147
|
-
return _context2.finish(
|
|
177
|
+
return _context2.finish(31);
|
|
148
178
|
case 35:
|
|
179
|
+
return _context2.finish(26);
|
|
180
|
+
case 36:
|
|
149
181
|
this.state = {
|
|
150
182
|
status: 'done',
|
|
151
183
|
content: bufferContent
|
|
152
184
|
};
|
|
153
|
-
|
|
154
|
-
|
|
185
|
+
_iterator4 = _createForOfIteratorHelper(this.subscribedStateSetters);
|
|
186
|
+
try {
|
|
187
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
188
|
+
_subscriber2 = _step4.value;
|
|
189
|
+
_subscriber2(this.state);
|
|
190
|
+
}
|
|
191
|
+
} catch (err) {
|
|
192
|
+
_iterator4.e(err);
|
|
193
|
+
} finally {
|
|
194
|
+
_iterator4.f();
|
|
195
|
+
}
|
|
196
|
+
case 39:
|
|
155
197
|
case "end":
|
|
156
198
|
return _context2.stop();
|
|
157
199
|
}
|
|
158
|
-
}, _callee2, this, [[
|
|
200
|
+
}, _callee2, this, [[10, 22, 26, 36], [27,, 31, 35]]);
|
|
159
201
|
}));
|
|
160
202
|
function summariseUrl() {
|
|
161
203
|
return _summariseUrl.apply(this, arguments);
|
|
@@ -165,7 +207,11 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
165
207
|
}, {
|
|
166
208
|
key: "subscribe",
|
|
167
209
|
value: function subscribe(stateSetter) {
|
|
168
|
-
|
|
210
|
+
var _this2 = this;
|
|
211
|
+
this.subscribedStateSetters.add(stateSetter);
|
|
212
|
+
return function () {
|
|
213
|
+
_this2.subscribedStateSetters.delete(stateSetter);
|
|
214
|
+
};
|
|
169
215
|
}
|
|
170
216
|
}]);
|
|
171
217
|
return AISummaryService;
|
|
@@ -1,36 +1,61 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
3
3
|
import { AISummariesStore } from './ai-summary-service/store';
|
|
4
4
|
import { AISummaryService } from './ai-summary-service';
|
|
5
5
|
export var useAISummary = function useAISummary(props) {
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
var _AISummariesStore$get;
|
|
7
|
+
var url = props.url,
|
|
8
|
+
baseUrl = props.baseUrl,
|
|
9
|
+
product = props.product,
|
|
10
|
+
headers = props.headers;
|
|
11
|
+
var _useState = useState(((_AISummariesStore$get = AISummariesStore.get(url)) === null || _AISummariesStore$get === void 0 ? void 0 : _AISummariesStore$get.state) || {
|
|
10
12
|
status: 'ready',
|
|
11
13
|
content: ''
|
|
12
14
|
}),
|
|
13
15
|
_useState2 = _slicedToArray(_useState, 2),
|
|
14
16
|
state = _useState2[0],
|
|
15
17
|
setState = _useState2[1];
|
|
16
|
-
|
|
18
|
+
|
|
19
|
+
// Can be used to know the summary status upon mounting a component (HoverCard UI state for example).
|
|
20
|
+
// For other scenarios, opt for dynamic status updates via state.status.
|
|
21
|
+
var isSummarisedOnMount = useMemo(function () {
|
|
22
|
+
var _AISummariesStore$get2;
|
|
23
|
+
return ((_AISummariesStore$get2 = AISummariesStore.get(url)) === null || _AISummariesStore$get2 === void 0 ? void 0 : _AISummariesStore$get2.state.status) === 'done';
|
|
24
|
+
}, [url]);
|
|
17
25
|
useEffect(function () {
|
|
18
|
-
if
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
// Create or subscribe to an AI service only if a summary has not been previously generated.
|
|
27
|
+
// Otherwise, use the data from the current state synchronized with a cache (AISummariesStore).
|
|
28
|
+
if (!isSummarisedOnMount) {
|
|
29
|
+
var aISummaryService = AISummariesStore.get(url);
|
|
30
|
+
var isAISummaryServiceInitiated = !!aISummaryService;
|
|
31
|
+
if (isAISummaryServiceInitiated) {
|
|
32
|
+
//if we want to subscribe to updates from an existing AI service that has not yet provided a summary or is currently in progress.
|
|
33
|
+
var unsubscribe = aISummaryService.subscribe(setState);
|
|
34
|
+
return function () {
|
|
35
|
+
return unsubscribe();
|
|
36
|
+
};
|
|
37
|
+
} else {
|
|
38
|
+
var _AISummariesStore$get3;
|
|
39
|
+
//if we want to create a new AI service and wish to subscribe for updates
|
|
40
|
+
AISummariesStore.set(url, new AISummaryService({
|
|
41
|
+
url: url,
|
|
42
|
+
baseUrl: baseUrl,
|
|
43
|
+
product: product,
|
|
44
|
+
headers: headers
|
|
45
|
+
}));
|
|
46
|
+
var _unsubscribe = (_AISummariesStore$get3 = AISummariesStore.get(url)) === null || _AISummariesStore$get3 === void 0 ? void 0 : _AISummariesStore$get3.subscribe(setState);
|
|
47
|
+
return function () {
|
|
48
|
+
return _unsubscribe && _unsubscribe();
|
|
49
|
+
};
|
|
22
50
|
}
|
|
23
|
-
return (_AISummariesStore$get = AISummariesStore.get(url)) === null || _AISummariesStore$get === void 0 ? void 0 : _AISummariesStore$get.subscribe(setState);
|
|
24
51
|
}
|
|
25
|
-
}, [
|
|
52
|
+
}, [isSummarisedOnMount, url, baseUrl, product, headers]);
|
|
26
53
|
var summariseUrl = function summariseUrl() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
return;
|
|
54
|
+
var _AISummariesStore$get4;
|
|
55
|
+
return (_AISummariesStore$get4 = AISummariesStore.get(url)) === null || _AISummariesStore$get4 === void 0 ? void 0 : _AISummariesStore$get4.summariseUrl();
|
|
31
56
|
};
|
|
32
57
|
return {
|
|
33
|
-
|
|
58
|
+
isSummarisedOnMount: isSummarisedOnMount,
|
|
34
59
|
summariseUrl: summariseUrl,
|
|
35
60
|
state: state
|
|
36
61
|
};
|
|
@@ -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.4"
|
|
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,
|
|
@@ -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
|
/**
|
|
@@ -203,5 +203,5 @@ export var getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
|
203
203
|
var _response$meta;
|
|
204
204
|
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
205
205
|
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
206
|
-
return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.
|
|
206
|
+
return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
|
|
207
207
|
};
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.48.
|
|
13
|
+
packageVersion: "26.48.4",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -3,9 +3,9 @@ export declare class AISummaryService implements AISummaryServiceInt {
|
|
|
3
3
|
state: AISummaryState;
|
|
4
4
|
private config;
|
|
5
5
|
private url;
|
|
6
|
-
private
|
|
6
|
+
private subscribedStateSetters;
|
|
7
7
|
constructor(props: AISummaryServiceProps);
|
|
8
8
|
private fetchStream;
|
|
9
9
|
summariseUrl(summaryStyle?: SummaryStyle): Promise<void>;
|
|
10
|
-
subscribe(stateSetter: StateSetter): void;
|
|
10
|
+
subscribe(stateSetter: StateSetter): () => void;
|
|
11
11
|
}
|