@atlaskit/smart-card 26.59.1 → 26.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/cjs/extractors/common/icon/extractIcon.js +19 -1
- package/dist/cjs/extractors/common/icon/index.js +7 -0
- package/dist/cjs/extractors/embed/index.js +26 -1
- package/dist/cjs/extractors/flexible/actions/extract-ai-summary-action.js +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +33 -4
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +2 -1
- package/dist/cjs/utils/{get-is-ai-summary-enabled.js → ai-summary.js} +21 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/utils/index.js +8 -0
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +4 -51
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +2 -0
- package/dist/cjs/view/EmbedCard/components/styled.js +5 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +0 -3
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +22 -14
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/utils.js +32 -0
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/goal-icon/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/action-footer/index.js +67 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +23 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +5 -24
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +4 -4
- package/dist/cjs/view/FlexibleCard/components/{blocks/ai-summary-block/ai-event-error-viewed/index.js → common/ai-summary/ai-event-error-viewed.js} +1 -1
- package/dist/cjs/view/FlexibleCard/components/{blocks/ai-summary-block/ai-state-indicator → common/ai-summary}/ai-learn-more-anchor.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/{blocks/ai-summary-block/ai-motion-wrapper → common/motion-wrapper}/index.js +3 -3
- package/dist/cjs/view/FlexibleCard/components/common/motion-wrapper/types.js +5 -0
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +2 -2
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -7
- package/dist/cjs/view/HoverCard/utils.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-icon/index.js +23 -20
- package/dist/cjs/view/common/ai-summary/index.js +1 -0
- package/dist/es2019/extractors/common/icon/extractIcon.js +21 -1
- package/dist/es2019/extractors/common/icon/index.js +1 -0
- package/dist/es2019/extractors/embed/index.js +28 -2
- package/dist/es2019/extractors/flexible/actions/extract-ai-summary-action.js +1 -1
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +34 -3
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +1 -0
- package/dist/es2019/utils/ai-summary.js +25 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/utils/index.js +8 -0
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -44
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +2 -0
- package/dist/es2019/view/EmbedCard/components/styled.js +8 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +0 -3
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +21 -13
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/utils.js +24 -0
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/goal-icon/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/action-footer/index.js +61 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +19 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +3 -22
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +4 -4
- package/dist/es2019/view/FlexibleCard/components/{blocks/ai-summary-block/ai-event-error-viewed/index.js → common/ai-summary/ai-event-error-viewed.js} +1 -1
- package/dist/es2019/view/FlexibleCard/components/{blocks/ai-summary-block/ai-state-indicator → common/ai-summary}/ai-learn-more-anchor.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/{blocks/ai-summary-block/ai-motion-wrapper → common/motion-wrapper}/index.js +2 -2
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -1
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +1 -7
- package/dist/es2019/view/HoverCard/utils.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-icon/index.js +104 -99
- package/dist/es2019/view/common/ai-summary/index.js +1 -0
- package/dist/esm/extractors/common/icon/extractIcon.js +19 -1
- package/dist/esm/extractors/common/icon/index.js +1 -0
- package/dist/esm/extractors/embed/index.js +27 -2
- package/dist/esm/extractors/flexible/actions/extract-ai-summary-action.js +1 -1
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +33 -3
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +2 -1
- package/dist/esm/utils/{get-is-ai-summary-enabled.js → ai-summary.js} +20 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/utils/index.js +8 -0
- package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +3 -50
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +2 -0
- package/dist/esm/view/EmbedCard/components/styled.js +5 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +0 -3
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +22 -14
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/utils.js +25 -0
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/goal-icon/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/action-footer/index.js +60 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/action-footer/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +23 -4
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.js +5 -24
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +4 -4
- package/dist/esm/view/FlexibleCard/components/{blocks/ai-summary-block/ai-event-error-viewed/index.js → common/ai-summary/ai-event-error-viewed.js} +1 -1
- package/dist/esm/view/FlexibleCard/components/{blocks/ai-summary-block/ai-state-indicator → common/ai-summary}/ai-learn-more-anchor.js +1 -1
- package/dist/esm/view/FlexibleCard/components/{blocks/ai-summary-block/ai-motion-wrapper → common/motion-wrapper}/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/common/motion-wrapper/types.js +1 -0
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -1
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +1 -7
- package/dist/esm/view/HoverCard/utils.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-icon/index.js +23 -20
- package/dist/esm/view/common/ai-summary/index.js +1 -0
- package/dist/types/extractors/common/icon/index.d.ts +1 -0
- package/dist/types/extractors/embed/index.d.ts +3 -3
- package/dist/types/extractors/flexible/actions/extract-ai-summary-action.d.ts +3 -3
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +1 -1
- 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/ai-summary.d.ts +8 -0
- package/dist/types/view/BlockCard/views/flexible/utils/index.d.ts +2 -2
- package/dist/types/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.d.ts +1 -4
- package/dist/types/view/EmbedCard/components/ExpandedFrame.d.ts +2 -2
- package/dist/types/view/EmbedCard/components/styled.d.ts +1 -0
- package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/action/action-icon/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +11 -1
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.d.ts +3 -3
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/utils.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/follow-action/goal-icon/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/follow-action/projects-icon/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-block/action-footer/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/action-footer/types.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/common/motion-wrapper/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/{blocks/ai-summary-block/ai-motion-wrapper → common/motion-wrapper}/types.d.ts +1 -1
- package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +2 -2
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +3 -3
- package/dist/types/view/common/ai-summary/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/icon/index.d.ts +1 -0
- package/dist/types-ts4.5/extractors/embed/index.d.ts +3 -3
- package/dist/types-ts4.5/extractors/flexible/actions/extract-ai-summary-action.d.ts +3 -3
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +1 -1
- 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/ai-summary.d.ts +8 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/utils/index.d.ts +2 -2
- package/dist/types-ts4.5/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.d.ts +1 -4
- package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrame.d.ts +2 -2
- package/dist/types-ts4.5/view/EmbedCard/components/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-icon/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +11 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.d.ts +3 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/utils.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/goal-icon/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/projects-icon/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/action-footer/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/action-footer/types.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-error.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/common/motion-wrapper/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/{blocks/ai-summary-block/ai-motion-wrapper → common/motion-wrapper}/types.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardContent.d.ts +2 -2
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +3 -3
- package/dist/types-ts4.5/view/common/ai-summary/index.d.ts +1 -1
- package/package.json +9 -9
- package/dist/es2019/utils/get-is-ai-summary-enabled.js +0 -5
- package/dist/types/utils/get-is-ai-summary-enabled.d.ts +0 -2
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.d.ts +0 -4
- package/dist/types-ts4.5/utils/get-is-ai-summary-enabled.d.ts +0 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper/index.d.ts +0 -4
- /package/dist/cjs/view/FlexibleCard/components/blocks/{ai-summary-block/ai-motion-wrapper → action-block/action-footer}/types.js +0 -0
- /package/dist/es2019/view/FlexibleCard/components/blocks/{ai-summary-block/ai-motion-wrapper → action-block/action-footer}/types.js +0 -0
- /package/dist/{esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-motion-wrapper → es2019/view/FlexibleCard/components/common/motion-wrapper}/types.js +0 -0
- /package/dist/types/view/FlexibleCard/components/{blocks/ai-summary-block/ai-event-error-viewed/index.d.ts → common/ai-summary/ai-event-error-viewed.d.ts} +0 -0
- /package/dist/types/view/FlexibleCard/components/{blocks/ai-summary-block/ai-state-indicator → common/ai-summary}/ai-learn-more-anchor.d.ts +0 -0
- /package/dist/types-ts4.5/view/FlexibleCard/components/{blocks/ai-summary-block/ai-event-error-viewed/index.d.ts → common/ai-summary/ai-event-error-viewed.d.ts} +0 -0
- /package/dist/types-ts4.5/view/FlexibleCard/components/{blocks/ai-summary-block/ai-state-indicator → common/ai-summary}/ai-learn-more-anchor.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.61.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#97142](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97142)
|
|
8
|
+
[`a2a8c037302c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a2a8c037302c) -
|
|
9
|
+
EDM-9697 Fix embeds to use icon supplied by prioritiseIcon under FF
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#97654](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97654)
|
|
14
|
+
[`98a9f3d7124f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/98a9f3d7124f) -
|
|
15
|
+
Hover preview redesign: Update action icon color
|
|
16
|
+
- [#97682](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97682)
|
|
17
|
+
[`6c631fd32f18`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6c631fd32f18) -
|
|
18
|
+
AI summary: Update word-break behavior for the summary content
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 26.60.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [#96008](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/96008)
|
|
26
|
+
[`a0eb959e967c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a0eb959e967c) -
|
|
27
|
+
[ux] Adds CollaboratorGroup to Trello Flex Block and Hover Previews
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [#95271](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95271)
|
|
32
|
+
[`d22ff5392d9d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d22ff5392d9d) -
|
|
33
|
+
[ux] removing 'overflow: hidden' to fix blurry embed links
|
|
34
|
+
- [#94424](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94424)
|
|
35
|
+
[`236fe37d0c71`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/236fe37d0c71) -
|
|
36
|
+
ActionBlock: Add error message
|
|
37
|
+
- [#94724](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94724)
|
|
38
|
+
[`2c06423cc1aa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c06423cc1aa) -
|
|
39
|
+
Permanently fixes incorrect cleanup of ref for intersection observer, no longer requires ff
|
|
40
|
+
platform.linking-platform.smart-card.fix-intersection-observer
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
3
43
|
## 26.59.1
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.extractIcon = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
var _peopleGroup = _interopRequireDefault(require("@atlaskit/icon/glyph/people-group"));
|
|
10
11
|
var _ = _interopRequireDefault(require("@atlaskit/icon-object/glyph/commit/16"));
|
|
11
12
|
var _2 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/pull-request/16"));
|
|
@@ -18,6 +19,7 @@ var _extractFileFormat = require("./extractFileFormat");
|
|
|
18
19
|
var _extractIconFromDocument = require("./extractIconFromDocument");
|
|
19
20
|
var _extractIconFromTask = require("./extractIconFromTask");
|
|
20
21
|
var _extractTaskType = require("../lozenge/extractTaskType");
|
|
22
|
+
var _prioritiseIcon = require("./prioritiseIcon");
|
|
21
23
|
var extractIcon = exports.extractIcon = function extractIcon(jsonLd) {
|
|
22
24
|
var priority = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'type';
|
|
23
25
|
var type = jsonLd['@type'];
|
|
@@ -94,6 +96,22 @@ var extractIconByType = function extractIconByType(type, opts) {
|
|
|
94
96
|
case 'atlassian:Task':
|
|
95
97
|
return (0, _extractIconFromTask.extractIconFromTask)(opts);
|
|
96
98
|
default:
|
|
97
|
-
return opts.provider && opts.provider.icon;
|
|
99
|
+
return (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour') ? extractDefaultIcon(opts) : opts.provider && opts.provider.icon;
|
|
98
100
|
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Choose which icon to show when the type is not recognized.
|
|
105
|
+
*/
|
|
106
|
+
var extractDefaultIcon = function extractDefaultIcon(opts) {
|
|
107
|
+
var _opts$provider;
|
|
108
|
+
var provider = opts.provider;
|
|
109
|
+
var providerId = provider === null || provider === void 0 ? void 0 : provider.id;
|
|
110
|
+
return (0, _prioritiseIcon.prioritiseIcon)({
|
|
111
|
+
providerId: providerId,
|
|
112
|
+
fileFormatIcon: undefined,
|
|
113
|
+
documentTypeIcon: undefined,
|
|
114
|
+
urlIcon: opts.icon,
|
|
115
|
+
providerIcon: (_opts$provider = opts.provider) === null || _opts$provider === void 0 ? void 0 : _opts$provider.icon
|
|
116
|
+
});
|
|
99
117
|
};
|
|
@@ -27,7 +27,14 @@ Object.defineProperty(exports, "extractIconFromTask", {
|
|
|
27
27
|
return _extractIconFromTask.extractIconFromTask;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "prioritiseIcon", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _prioritiseIcon.prioritiseIcon;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
var _extractFileFormat = require("./extractFileFormat");
|
|
37
|
+
var _prioritiseIcon = require("./prioritiseIcon");
|
|
31
38
|
var _extractIcon = require("./extractIcon");
|
|
32
39
|
var _extractIconFromDocument = require("./extractIconFromDocument");
|
|
33
40
|
var _extractIconFromTask = require("./extractIconFromTask");
|
|
@@ -7,8 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.extractEmbedProps = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var _extractIsTrusted = require("../common/meta/extractIsTrusted");
|
|
11
12
|
var _extractIsSupportTheming = require("../common/meta/extractIsSupportTheming");
|
|
13
|
+
var _icon = require("../common/icon");
|
|
12
14
|
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; }
|
|
13
15
|
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) { (0, _defineProperty2.default)(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; }
|
|
14
16
|
var extractEmbedPreview = function extractEmbedPreview(jsonLd, platform, iframeUrlType) {
|
|
@@ -19,11 +21,34 @@ var extractEmbedPreview = function extractEmbedPreview(jsonLd, platform, iframeU
|
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
23
|
};
|
|
24
|
+
function generateContext(jsonLd) {
|
|
25
|
+
var provider = (0, _linkExtractors.extractProvider)(jsonLd);
|
|
26
|
+
if (!provider) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// If no icon is supplied, return existing context
|
|
31
|
+
if (!jsonLd.icon) {
|
|
32
|
+
return provider;
|
|
33
|
+
}
|
|
34
|
+
var generator = jsonLd.generator;
|
|
35
|
+
var icon = (0, _icon.prioritiseIcon)({
|
|
36
|
+
providerId: generator && typeof generator !== 'string' && generator['@type'] !== 'Link' ? generator['@id'] : undefined,
|
|
37
|
+
fileFormatIcon: undefined,
|
|
38
|
+
documentTypeIcon: undefined,
|
|
39
|
+
urlIcon: (0, _linkExtractors.extractUrlFromIconJsonLd)(jsonLd.icon),
|
|
40
|
+
// We still attempt to follow the icon priority function even if no generator (and therefore provider icon) is defined
|
|
41
|
+
providerIcon: generator && typeof generator !== 'string' && generator['@type'] !== 'Link' && (0, _linkExtractors.extractProviderIcon)(generator.icon)
|
|
42
|
+
});
|
|
43
|
+
return _objectSpread(_objectSpread({}, provider), {}, {
|
|
44
|
+
icon: icon ? icon : provider.icon
|
|
45
|
+
});
|
|
46
|
+
}
|
|
22
47
|
var extractEmbedProps = exports.extractEmbedProps = function extractEmbedProps(jsonLd, meta, platform, iframeUrlType) {
|
|
23
48
|
return {
|
|
24
49
|
link: (0, _linkExtractors.extractLink)(jsonLd) || '',
|
|
25
50
|
title: (0, _linkExtractors.extractTitle)(jsonLd),
|
|
26
|
-
context: (0, _linkExtractors.extractProvider)(jsonLd),
|
|
51
|
+
context: (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour') ? generateContext(jsonLd) : (0, _linkExtractors.extractProvider)(jsonLd),
|
|
27
52
|
preview: extractEmbedPreview(jsonLd, platform, iframeUrlType),
|
|
28
53
|
isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
|
|
29
54
|
isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta)
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.extractAISummaryAction = void 0;
|
|
7
7
|
var _types = require("../../../view/Card/types");
|
|
8
8
|
var _canShowAction = require("../../../utils/actions/can-show-action");
|
|
9
|
-
var
|
|
9
|
+
var _aiSummary = require("../../../utils/ai-summary");
|
|
10
10
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
11
11
|
var extractAISummaryAction = exports.extractAISummaryAction = function extractAISummaryAction(response, url, actionOptions, aiSummaryConfig) {
|
|
12
|
-
if (!(0, _canShowAction.canShowAction)(_types.CardAction.AISummaryAction, actionOptions) || !(0,
|
|
12
|
+
if (!(0, _canShowAction.canShowAction)(_types.CardAction.AISummaryAction, actionOptions) || !(0, _aiSummary.getIsAISummaryEnabled)(aiSummaryConfig === null || aiSummaryConfig === void 0 ? void 0 : aiSummaryConfig.isAdminHubAIEnabled, response) || !(aiSummaryConfig !== null && aiSummaryConfig !== void 0 && aiSummaryConfig.product) || !url) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
return {
|
|
@@ -16,7 +16,7 @@ var _lozenge = require("../../common/lozenge");
|
|
|
16
16
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
17
17
|
var _priority = require("../../common/icon/priority");
|
|
18
18
|
var _constants2 = require("../../../constants");
|
|
19
|
-
var
|
|
19
|
+
var _icon = require("../../common/icon");
|
|
20
20
|
var extractTask = function extractTask(data, label) {
|
|
21
21
|
var _ref = (0, _lozenge.extractTaskType)(data) || {},
|
|
22
22
|
id = _ref.id,
|
|
@@ -75,7 +75,7 @@ var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
|
75
75
|
var fileFormatIcon = (0, _extractFileFormatIcon.default)(fileFormat);
|
|
76
76
|
var documentTypeIcon = (0, _extractDocumentTypeIcon.default)(type, label);
|
|
77
77
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour')) {
|
|
78
|
-
return (0,
|
|
78
|
+
return (0, _icon.prioritiseIcon)({
|
|
79
79
|
providerId: provider,
|
|
80
80
|
fileFormatIcon: fileFormatIcon,
|
|
81
81
|
documentTypeIcon: documentTypeIcon,
|
|
@@ -130,7 +130,36 @@ var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
|
130
130
|
label: label || 'Repository'
|
|
131
131
|
};
|
|
132
132
|
default:
|
|
133
|
-
return
|
|
133
|
+
return (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour') ? extractDefaultIcon({
|
|
134
|
+
data: data,
|
|
135
|
+
type: type,
|
|
136
|
+
label: label,
|
|
137
|
+
provider: provider,
|
|
138
|
+
urlIcon: urlIcon,
|
|
139
|
+
providerIcon: providerIcon
|
|
140
|
+
}) : providerIcon;
|
|
134
141
|
}
|
|
135
142
|
};
|
|
136
|
-
var _default = exports.default = extractJsonldDataIcon;
|
|
143
|
+
var _default = exports.default = extractJsonldDataIcon;
|
|
144
|
+
/**
|
|
145
|
+
* Choose which icon to show when the type is not recognized.
|
|
146
|
+
*/
|
|
147
|
+
var extractDefaultIcon = function extractDefaultIcon(_ref2) {
|
|
148
|
+
var data = _ref2.data,
|
|
149
|
+
type = _ref2.type,
|
|
150
|
+
label = _ref2.label,
|
|
151
|
+
provider = _ref2.provider,
|
|
152
|
+
urlIcon = _ref2.urlIcon,
|
|
153
|
+
providerIcon = _ref2.providerIcon;
|
|
154
|
+
var documentData = data;
|
|
155
|
+
var fileFormat = documentData === null || documentData === void 0 ? void 0 : documentData['schema:fileFormat'];
|
|
156
|
+
var fileFormatIcon = (0, _extractFileFormatIcon.default)(fileFormat);
|
|
157
|
+
var documentTypeIcon = (0, _extractDocumentTypeIcon.default)(type, label);
|
|
158
|
+
return (0, _icon.prioritiseIcon)({
|
|
159
|
+
providerId: provider,
|
|
160
|
+
fileFormatIcon: fileFormatIcon,
|
|
161
|
+
documentTypeIcon: documentTypeIcon,
|
|
162
|
+
urlIcon: urlIcon,
|
|
163
|
+
providerIcon: providerIcon
|
|
164
|
+
});
|
|
165
|
+
};
|
|
@@ -3,11 +3,31 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getIsAISummaryEnabled = void 0;
|
|
6
|
+
exports.getIsAISummaryEnabled = exports.getAISummaryErrorMessage = void 0;
|
|
7
7
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
|
+
var _constants = require("../constants");
|
|
9
|
+
var _messages = require("../messages");
|
|
8
10
|
var getIsAISummaryEnabled = exports.getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
9
11
|
var _response$meta;
|
|
10
12
|
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
11
13
|
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
12
14
|
return Boolean((0, _platformFeatureFlags.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')));
|
|
15
|
+
};
|
|
16
|
+
var getAISummaryErrorMessage = exports.getAISummaryErrorMessage = function getAISummaryErrorMessage(error) {
|
|
17
|
+
switch (error) {
|
|
18
|
+
case 'ACCEPTABLE_USE_VIOLATIONS':
|
|
19
|
+
return {
|
|
20
|
+
message: _messages.messages.ai_summary_error_acceptable_use_violation,
|
|
21
|
+
url: _constants.CONTENT_URL_ACCEPTABLE_USE_POLICY
|
|
22
|
+
};
|
|
23
|
+
case 'HIPAA_CONTENT_DETECTED':
|
|
24
|
+
return {
|
|
25
|
+
message: _messages.messages.ai_summary_error_hipaa_content_detected
|
|
26
|
+
};
|
|
27
|
+
default:
|
|
28
|
+
return {
|
|
29
|
+
message: _messages.messages.ai_summary_error_generic,
|
|
30
|
+
url: _constants.CONTENT_URL_AI_TROUBLESHOOTING
|
|
31
|
+
};
|
|
32
|
+
}
|
|
13
33
|
};
|
|
@@ -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.61.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -112,6 +112,14 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
|
|
|
112
112
|
name: _constants.ElementName.CommentCount
|
|
113
113
|
}]
|
|
114
114
|
};
|
|
115
|
+
case 'trello-object-provider':
|
|
116
|
+
return {
|
|
117
|
+
titleMetadata: defaultTitleMetadata,
|
|
118
|
+
topMetadata: [{
|
|
119
|
+
name: _constants.ElementName.CollaboratorGroup
|
|
120
|
+
}].concat(baseTopMetadata),
|
|
121
|
+
bottomMetadata: defaultBottomMetadata
|
|
122
|
+
};
|
|
115
123
|
default:
|
|
116
124
|
return {
|
|
117
125
|
titleMetadata: defaultTitleMetadata,
|
|
@@ -5,10 +5,9 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.LazyIntersectionObserverCard =
|
|
8
|
+
exports.LazyIntersectionObserverCard = LazyIntersectionObserverCard;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _state = require("../../../state");
|
|
13
12
|
var _component = require("../component");
|
|
14
13
|
var _LoadingCardLink = require("./LoadingCardLink");
|
|
@@ -20,7 +19,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
20
19
|
// being compared to. Since the default container is the `document`, we set this
|
|
21
20
|
// up to check once a Smart Link is within `X` px from the bottom of the viewport.
|
|
22
21
|
var ROOT_MARGIN_VERTICAL = '360px';
|
|
23
|
-
function
|
|
22
|
+
function LazyIntersectionObserverCard(props) {
|
|
23
|
+
var ref = (0, _react.useRef)(null);
|
|
24
24
|
var _useState = (0, _react.useState)(false),
|
|
25
25
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
26
|
isIntersecting = _useState2[0],
|
|
@@ -43,49 +43,6 @@ function LazyIntersectionObserverCardLegacy(props) {
|
|
|
43
43
|
prefetch();
|
|
44
44
|
}
|
|
45
45
|
}, [prefetch, id]);
|
|
46
|
-
var onRef = (0, _react.useCallback)(function (element) {
|
|
47
|
-
if (!element) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
var intersectionObserver = new IntersectionObserver(onIntersection, {
|
|
51
|
-
rootMargin: "".concat(ROOT_MARGIN_VERTICAL, " 0px ").concat(ROOT_MARGIN_VERTICAL, " 0px")
|
|
52
|
-
});
|
|
53
|
-
intersectionObserver.observe(element);
|
|
54
|
-
return function () {
|
|
55
|
-
return intersectionObserver.disconnect();
|
|
56
|
-
};
|
|
57
|
-
}, [onIntersection]);
|
|
58
|
-
var content = isIntersecting ? /*#__PURE__*/_react.default.createElement(_component.CardWithUrlContent, props) : /*#__PURE__*/_react.default.createElement(ComponentObserver, {
|
|
59
|
-
ref: onRef
|
|
60
|
-
}, /*#__PURE__*/_react.default.createElement(_LoadingCardLink.LoadingCardLink, props));
|
|
61
|
-
return /*#__PURE__*/_react.default.createElement(Component, {
|
|
62
|
-
className: "loader-wrapper"
|
|
63
|
-
}, content);
|
|
64
|
-
}
|
|
65
|
-
function LazyIntersectionObserverCardNext(props) {
|
|
66
|
-
var ref = (0, _react.useRef)(null);
|
|
67
|
-
var _useState3 = (0, _react.useState)(false),
|
|
68
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
69
|
-
isIntersecting = _useState4[0],
|
|
70
|
-
setIsIntersecting = _useState4[1];
|
|
71
|
-
var appearance = props.appearance,
|
|
72
|
-
url = props.url,
|
|
73
|
-
id = props.id;
|
|
74
|
-
var prefetch = (0, _state.usePrefetch)(url);
|
|
75
|
-
var Component = appearance === 'inline' ? 'span' : 'div';
|
|
76
|
-
var ComponentObserver = Component;
|
|
77
|
-
var onIntersection = (0, _react.useCallback)(function (entries, observer) {
|
|
78
|
-
var isVisible = entries.some(function (entry) {
|
|
79
|
-
return entry.isIntersecting;
|
|
80
|
-
});
|
|
81
|
-
if (isVisible) {
|
|
82
|
-
(0, _ufoExperiences.startUfoExperience)('smart-link-rendered', id);
|
|
83
|
-
setIsIntersecting(true);
|
|
84
|
-
observer.disconnect();
|
|
85
|
-
} else {
|
|
86
|
-
prefetch();
|
|
87
|
-
}
|
|
88
|
-
}, [prefetch, id]);
|
|
89
46
|
(0, _react.useEffect)(function () {
|
|
90
47
|
if (!ref.current) {
|
|
91
48
|
return;
|
|
@@ -104,8 +61,4 @@ function LazyIntersectionObserverCardNext(props) {
|
|
|
104
61
|
return /*#__PURE__*/_react.default.createElement(Component, {
|
|
105
62
|
className: "loader-wrapper"
|
|
106
63
|
}, content);
|
|
107
|
-
}
|
|
108
|
-
var LazyIntersectionObserverCard = exports.LazyIntersectionObserverCard = function LazyIntersectionObserverCard(props) {
|
|
109
|
-
var Component = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.fix-intersection-observer') ? LazyIntersectionObserverCardNext : LazyIntersectionObserverCardLegacy;
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement(Component, props);
|
|
111
|
-
};
|
|
64
|
+
}
|
|
@@ -36,6 +36,7 @@ var ExpandedFrame = exports.ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
36
36
|
return (0, _handlers.handleClickCommon)(event, onClick);
|
|
37
37
|
};
|
|
38
38
|
var handleMouseDown = (0, _useLinkClicked.useMouseDownEvent)();
|
|
39
|
+
var isFixEmbedCardBlurEnabled = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.fix-embed-card-blurring') ? true : false;
|
|
39
40
|
var renderHeaderOld = function renderHeaderOld() {
|
|
40
41
|
return /*#__PURE__*/_react.default.createElement(_styled.Header, {
|
|
41
42
|
className: "embed-header",
|
|
@@ -71,6 +72,7 @@ var ExpandedFrame = exports.ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
71
72
|
return /*#__PURE__*/_react.default.createElement(_styled.Content, {
|
|
72
73
|
"data-testid": "embed-content-wrapper",
|
|
73
74
|
allowScrollBar: allowScrollBar,
|
|
75
|
+
removeOverflow: isFixEmbedCardBlurEnabled,
|
|
74
76
|
isInteractive: isInteractive(),
|
|
75
77
|
frameStyle: frameStyle
|
|
76
78
|
}, children);
|
|
@@ -133,7 +133,11 @@ var TooltipWrapper = exports.TooltipWrapper = _styled.default.div({
|
|
|
133
133
|
// manage scrolling behaviour.
|
|
134
134
|
// eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression
|
|
135
135
|
var Content = exports.Content = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n border: 1px solid ", ";\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", "\n\n ", "\n\n ", "\n"])), contentBorderRadius, "var(--ds-border, ".concat(_colors.N40, ")"), "var(--ds-surface-raised, white)", function (_ref11) {
|
|
136
|
-
var allowScrollBar = _ref11.allowScrollBar
|
|
136
|
+
var allowScrollBar = _ref11.allowScrollBar,
|
|
137
|
+
removeOverflow = _ref11.removeOverflow;
|
|
138
|
+
if (removeOverflow) {
|
|
139
|
+
return '';
|
|
140
|
+
}
|
|
137
141
|
return allowScrollBar ? 'overflow: auto;' : 'overflow: hidden;';
|
|
138
142
|
}, function (_ref12) {
|
|
139
143
|
var frameStyle = _ref12.frameStyle;
|
|
@@ -28,9 +28,6 @@ var getIconStyles = function getIconStyles(isDisabled) {
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
var backgroundStyles = (0, _react2.css)({
|
|
31
|
-
backgroundColor: "var(--ds-background-brand-subtlest, #E9F2FF)",
|
|
32
|
-
borderRadius: "var(--ds-border-radius-050, 2px)",
|
|
33
|
-
color: "var(--ds-icon-brand, #0C66E4)",
|
|
34
31
|
display: 'inline-block',
|
|
35
32
|
lineHeight: 0,
|
|
36
33
|
padding: "var(--ds-space-025, 2px)",
|
|
@@ -10,16 +10,19 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
13
14
|
var _messages = require("../../../../../messages");
|
|
14
15
|
var _action = _interopRequireDefault(require("../action"));
|
|
15
16
|
var _aiIcon = _interopRequireDefault(require("../../../../common/ai-icon"));
|
|
16
17
|
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
17
18
|
var _useAiSummary = require("../../../../../state/hooks/use-ai-summary");
|
|
18
|
-
var
|
|
19
|
+
var _utils = require("./utils");
|
|
20
|
+
var _excluded = ["onClick", "onError", "url", "ari", "product"];
|
|
19
21
|
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); }
|
|
20
22
|
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; }
|
|
21
23
|
var AISummaryActionComponent = exports.AISummaryActionComponent = function AISummaryActionComponent(_ref) {
|
|
22
24
|
var onClickCallback = _ref.onClick,
|
|
25
|
+
onErrorCallback = _ref.onError,
|
|
23
26
|
_ref$url = _ref.url,
|
|
24
27
|
url = _ref$url === void 0 ? '' : _ref$url,
|
|
25
28
|
_ref$ari = _ref.ari,
|
|
@@ -35,26 +38,31 @@ var AISummaryActionComponent = exports.AISummaryActionComponent = function AISum
|
|
|
35
38
|
}),
|
|
36
39
|
status = _useAISummary.state.status,
|
|
37
40
|
summariseUrl = _useAISummary.summariseUrl;
|
|
41
|
+
var onCompleted = (0, _react.useCallback)(function (state) {
|
|
42
|
+
if ((state === null || state === void 0 ? void 0 : state.status) === 'error') {
|
|
43
|
+
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback((0, _utils.getErrorMessage)(state.error));
|
|
44
|
+
}
|
|
45
|
+
}, [onErrorCallback]);
|
|
38
46
|
var handleActionClick = (0, _react.useCallback)(function () {
|
|
47
|
+
var _summariseUrl;
|
|
39
48
|
fireEvent('ui.button.clicked.aiSummary', {});
|
|
40
49
|
fireEvent('track.aiInteraction.initiated', {
|
|
41
50
|
aiFeatureName: 'Smart Links Summary',
|
|
42
51
|
proactiveAIGenerated: 0,
|
|
43
52
|
userGeneratedAI: 1
|
|
44
53
|
});
|
|
45
|
-
summariseUrl();
|
|
54
|
+
(_summariseUrl = summariseUrl()) === null || _summariseUrl === void 0 || _summariseUrl.then(onCompleted, onCompleted);
|
|
46
55
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
47
|
-
}, [fireEvent, onClickCallback, summariseUrl]);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
56
|
+
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
58
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action),
|
|
59
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiIcon.default, {
|
|
60
|
+
label: "Summarise with AI"
|
|
61
|
+
}),
|
|
62
|
+
isLoading: status === 'loading',
|
|
63
|
+
onClick: handleActionClick,
|
|
64
|
+
testId: "smart-action-ai-summary-action",
|
|
65
|
+
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action_description)
|
|
66
|
+
}, props));
|
|
59
67
|
return null;
|
|
60
68
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getErrorMessage = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _aiSummary = require("../../../../../utils/ai-summary");
|
|
12
|
+
var _aiEventErrorViewed = _interopRequireDefault(require("../../common/ai-summary/ai-event-error-viewed"));
|
|
13
|
+
var _aiLearnMoreAnchor = _interopRequireDefault(require("../../common/ai-summary/ai-learn-more-anchor"));
|
|
14
|
+
var getErrorMessage = exports.getErrorMessage = function getErrorMessage(error) {
|
|
15
|
+
var _getAISummaryErrorMes = (0, _aiSummary.getAISummaryErrorMessage)(error),
|
|
16
|
+
message = _getAISummaryErrorMes.message,
|
|
17
|
+
url = _getAISummaryErrorMes.url;
|
|
18
|
+
return {
|
|
19
|
+
appearance: 'error',
|
|
20
|
+
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_aiEventErrorViewed.default, {
|
|
21
|
+
reason: error
|
|
22
|
+
}), /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, message, {
|
|
23
|
+
values: {
|
|
24
|
+
a: function a(chunks) {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_aiLearnMoreAnchor.default, {
|
|
26
|
+
href: url
|
|
27
|
+
}, chunks);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
})))
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -19,7 +19,7 @@ var GoalGlyph = function GoalGlyph(props) {
|
|
|
19
19
|
fillRule: "evenodd",
|
|
20
20
|
clipRule: "evenodd",
|
|
21
21
|
d: "M12.6667 8C12.6667 10.5773 10.5773 12.6667 8 12.6667C5.42267 12.6667 3.33333 10.5773 3.33333 8C3.33333 5.42267 5.42267 3.33333 8 3.33333C10.5773 3.33333 12.6667 5.42267 12.6667 8ZM14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8ZM9.33333 8C9.33333 8.73638 8.73638 9.33333 8 9.33333C7.26362 9.33333 6.66667 8.73638 6.66667 8C6.66667 7.26362 7.26362 6.66667 8 6.66667C8.73638 6.66667 9.33333 7.26362 9.33333 8ZM10.6667 8C10.6667 9.47276 9.47276 10.6667 8 10.6667C6.52724 10.6667 5.33333 9.47276 5.33333 8C5.33333 6.52724 6.52724 5.33333 8 5.33333C9.47276 5.33333 10.6667 6.52724 10.6667 8Z",
|
|
22
|
-
fill: "#
|
|
22
|
+
fill: "var(--ds-icon, #44546F)"
|
|
23
23
|
}));
|
|
24
24
|
};
|
|
25
25
|
var GoalIcon = exports.GoalIcon = function GoalIcon(props) {
|
|
@@ -19,7 +19,7 @@ var ProjectsGlyph = function ProjectsGlyph(props) {
|
|
|
19
19
|
fillRule: "evenodd",
|
|
20
20
|
clipRule: "evenodd",
|
|
21
21
|
d: "M9.88573 4.00002C9.70892 4.00002 9.53935 4.07026 9.41433 4.19528L6.97282 6.63678L4.20525 6.94429C4.05479 6.96101 3.91451 7.02844 3.80746 7.13548L3.60959 7.33335L4.35367 8.07743C4.6791 8.40287 4.6791 8.93051 4.35367 9.25594L3.47152 10.1381C3.21117 10.3984 2.78906 10.3984 2.52871 10.1381C2.26836 9.87774 2.26836 9.45563 2.52871 9.19528L3.0573 8.66669L2.43108 8.04046C2.04055 7.64993 2.04055 7.01677 2.43108 6.62625L2.86465 6.19267C3.18578 5.87154 3.60664 5.66927 4.05801 5.61911L6.36073 5.36326L8.47152 3.25247C8.84659 2.8774 9.3553 2.66669 9.88573 2.66669H12.0001C12.7365 2.66669 13.3334 3.26364 13.3334 4.00002V6.1144C13.3334 6.64483 13.1227 7.15354 12.7477 7.52862L10.6369 9.6394L10.381 11.9421C10.3309 12.3935 10.1286 12.8143 9.80746 13.1355L9.37389 13.5691C8.98336 13.9596 8.3502 13.9596 7.95967 13.5691L7.33345 12.9428L6.80485 13.4714C6.5445 13.7318 6.12239 13.7318 5.86204 13.4714C5.60169 13.2111 5.60169 12.789 5.86204 12.5286L6.74419 11.6465C7.06963 11.321 7.59726 11.321 7.9227 11.6465L8.66678 12.3905L8.86466 12.1927C8.9717 12.0856 9.03912 11.9453 9.05584 11.7949L9.36335 9.02731L11.8049 6.58581C11.9299 6.46078 12.0001 6.29121 12.0001 6.1144V4.00002H9.88573ZM5.80486 10.1953C6.06521 10.4556 6.06521 10.8777 5.80486 11.1381L3.80486 13.1381C3.54451 13.3984 3.1224 13.3984 2.86205 13.1381C2.6017 12.8777 2.6017 12.4556 2.86205 12.1953L4.86205 10.1953C5.1224 9.93493 5.54451 9.93493 5.80486 10.1953ZM10.0001 6.66669C10.3683 6.66669 10.6668 6.36821 10.6668 6.00002C10.6668 5.63183 10.3683 5.33335 10.0001 5.33335C9.63193 5.33335 9.33346 5.63183 9.33346 6.00002C9.33346 6.36821 9.63193 6.66669 10.0001 6.66669Z",
|
|
22
|
-
fill: "#
|
|
22
|
+
fill: "var(--ds-icon, #44546F)"
|
|
23
23
|
}));
|
|
24
24
|
};
|
|
25
25
|
var ProjectsIcon = exports.ProjectsIcon = function ProjectsIcon(props) {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ActionFooter = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
9
|
+
var _primitives = require("@atlaskit/primitives");
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _motionWrapper = _interopRequireDefault(require("../../../common/motion-wrapper"));
|
|
12
|
+
var containerStyles = (0, _primitives.xcss)({
|
|
13
|
+
all: 'unset',
|
|
14
|
+
borderRadius: 'border.radius',
|
|
15
|
+
margin: 'space.100',
|
|
16
|
+
lineHeight: '20px',
|
|
17
|
+
padding: 'space.050',
|
|
18
|
+
paddingInline: 'space.100',
|
|
19
|
+
width: '100%',
|
|
20
|
+
':empty': {
|
|
21
|
+
display: 'none'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var errorStyles = (0, _primitives.xcss)({
|
|
25
|
+
backgroundColor: 'color.background.danger'
|
|
26
|
+
});
|
|
27
|
+
var titleStyles = (0, _primitives.xcss)({
|
|
28
|
+
color: 'color.text.subtle',
|
|
29
|
+
fontSize: '12px',
|
|
30
|
+
fontStyle: 'normal',
|
|
31
|
+
fontWeight: '400',
|
|
32
|
+
lineHeight: '16px'
|
|
33
|
+
});
|
|
34
|
+
var getIcon = function getIcon(appearance) {
|
|
35
|
+
switch (appearance) {
|
|
36
|
+
case 'error':
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_error.default, {
|
|
38
|
+
primaryColor: "var(--ds-icon-danger, #C9372C)",
|
|
39
|
+
label: "Error",
|
|
40
|
+
size: "small",
|
|
41
|
+
testId: "action-error-icon"
|
|
42
|
+
});
|
|
43
|
+
default:
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var ActionFooter = exports.ActionFooter = function ActionFooter(_ref) {
|
|
48
|
+
var message = _ref.message,
|
|
49
|
+
testId = _ref.testId;
|
|
50
|
+
if (!message) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
54
|
+
testId: "".concat(testId, "-footer"),
|
|
55
|
+
xcss: [containerStyles, message.appearance === 'error' && errorStyles]
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_motionWrapper.default, {
|
|
57
|
+
isFadeIn: true,
|
|
58
|
+
show: true,
|
|
59
|
+
showTransition: true
|
|
60
|
+
}, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
61
|
+
alignBlock: "start",
|
|
62
|
+
grow: "fill",
|
|
63
|
+
space: "space.025"
|
|
64
|
+
}, message.icon || getIcon(message.appearance), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
65
|
+
xcss: titleStyles
|
|
66
|
+
}, message.title))));
|
|
67
|
+
};
|