@atlaskit/smart-card 26.59.1 → 26.60.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 +22 -0
- package/dist/cjs/extractors/flexible/actions/extract-ai-summary-action.js +2 -2
- 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/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/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/es2019/extractors/flexible/actions/extract-ai-summary-action.js +1 -1
- 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/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/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/esm/extractors/flexible/actions/extract-ai-summary-action.js +1 -1
- 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/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/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/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/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/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-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/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/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/package.json +5 -5
- 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
|
@@ -106,6 +106,14 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
106
106
|
name: ElementName.CommentCount
|
|
107
107
|
}]
|
|
108
108
|
};
|
|
109
|
+
case 'trello-object-provider':
|
|
110
|
+
return {
|
|
111
|
+
titleMetadata: defaultTitleMetadata,
|
|
112
|
+
topMetadata: [{
|
|
113
|
+
name: ElementName.CollaboratorGroup
|
|
114
|
+
}].concat(baseTopMetadata),
|
|
115
|
+
bottomMetadata: defaultBottomMetadata
|
|
116
|
+
};
|
|
109
117
|
default:
|
|
110
118
|
return {
|
|
111
119
|
titleMetadata: defaultTitleMetadata,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { usePrefetch } from '../../../state';
|
|
5
4
|
import { CardWithUrlContent } from '../component';
|
|
6
5
|
import { LoadingCardLink } from './LoadingCardLink';
|
|
@@ -11,7 +10,8 @@ import { startUfoExperience } from '../../../state/analytics/ufoExperiences';
|
|
|
11
10
|
// being compared to. Since the default container is the `document`, we set this
|
|
12
11
|
// up to check once a Smart Link is within `X` px from the bottom of the viewport.
|
|
13
12
|
var ROOT_MARGIN_VERTICAL = '360px';
|
|
14
|
-
function
|
|
13
|
+
export function LazyIntersectionObserverCard(props) {
|
|
14
|
+
var ref = useRef(null);
|
|
15
15
|
var _useState = useState(false),
|
|
16
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17
17
|
isIntersecting = _useState2[0],
|
|
@@ -34,49 +34,6 @@ function LazyIntersectionObserverCardLegacy(props) {
|
|
|
34
34
|
prefetch();
|
|
35
35
|
}
|
|
36
36
|
}, [prefetch, id]);
|
|
37
|
-
var onRef = useCallback(function (element) {
|
|
38
|
-
if (!element) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
var intersectionObserver = new IntersectionObserver(onIntersection, {
|
|
42
|
-
rootMargin: "".concat(ROOT_MARGIN_VERTICAL, " 0px ").concat(ROOT_MARGIN_VERTICAL, " 0px")
|
|
43
|
-
});
|
|
44
|
-
intersectionObserver.observe(element);
|
|
45
|
-
return function () {
|
|
46
|
-
return intersectionObserver.disconnect();
|
|
47
|
-
};
|
|
48
|
-
}, [onIntersection]);
|
|
49
|
-
var content = isIntersecting ? /*#__PURE__*/React.createElement(CardWithUrlContent, props) : /*#__PURE__*/React.createElement(ComponentObserver, {
|
|
50
|
-
ref: onRef
|
|
51
|
-
}, /*#__PURE__*/React.createElement(LoadingCardLink, props));
|
|
52
|
-
return /*#__PURE__*/React.createElement(Component, {
|
|
53
|
-
className: "loader-wrapper"
|
|
54
|
-
}, content);
|
|
55
|
-
}
|
|
56
|
-
function LazyIntersectionObserverCardNext(props) {
|
|
57
|
-
var ref = useRef(null);
|
|
58
|
-
var _useState3 = useState(false),
|
|
59
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
-
isIntersecting = _useState4[0],
|
|
61
|
-
setIsIntersecting = _useState4[1];
|
|
62
|
-
var appearance = props.appearance,
|
|
63
|
-
url = props.url,
|
|
64
|
-
id = props.id;
|
|
65
|
-
var prefetch = usePrefetch(url);
|
|
66
|
-
var Component = appearance === 'inline' ? 'span' : 'div';
|
|
67
|
-
var ComponentObserver = Component;
|
|
68
|
-
var onIntersection = useCallback(function (entries, observer) {
|
|
69
|
-
var isVisible = entries.some(function (entry) {
|
|
70
|
-
return entry.isIntersecting;
|
|
71
|
-
});
|
|
72
|
-
if (isVisible) {
|
|
73
|
-
startUfoExperience('smart-link-rendered', id);
|
|
74
|
-
setIsIntersecting(true);
|
|
75
|
-
observer.disconnect();
|
|
76
|
-
} else {
|
|
77
|
-
prefetch();
|
|
78
|
-
}
|
|
79
|
-
}, [prefetch, id]);
|
|
80
37
|
useEffect(function () {
|
|
81
38
|
if (!ref.current) {
|
|
82
39
|
return;
|
|
@@ -95,8 +52,4 @@ function LazyIntersectionObserverCardNext(props) {
|
|
|
95
52
|
return /*#__PURE__*/React.createElement(Component, {
|
|
96
53
|
className: "loader-wrapper"
|
|
97
54
|
}, content);
|
|
98
|
-
}
|
|
99
|
-
export var LazyIntersectionObserverCard = function LazyIntersectionObserverCard(props) {
|
|
100
|
-
var Component = getBooleanFF('platform.linking-platform.smart-card.fix-intersection-observer') ? LazyIntersectionObserverCardNext : LazyIntersectionObserverCardLegacy;
|
|
101
|
-
return /*#__PURE__*/React.createElement(Component, props);
|
|
102
|
-
};
|
|
55
|
+
}
|
|
@@ -29,6 +29,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
29
29
|
return handleClickCommon(event, onClick);
|
|
30
30
|
};
|
|
31
31
|
var handleMouseDown = useMouseDownEvent();
|
|
32
|
+
var isFixEmbedCardBlurEnabled = getBooleanFF('platform.linking-platform.smart-card.fix-embed-card-blurring') ? true : false;
|
|
32
33
|
var renderHeaderOld = function renderHeaderOld() {
|
|
33
34
|
return /*#__PURE__*/React.createElement(Header, {
|
|
34
35
|
className: "embed-header",
|
|
@@ -64,6 +65,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
64
65
|
return /*#__PURE__*/React.createElement(Content, {
|
|
65
66
|
"data-testid": "embed-content-wrapper",
|
|
66
67
|
allowScrollBar: allowScrollBar,
|
|
68
|
+
removeOverflow: isFixEmbedCardBlurEnabled,
|
|
67
69
|
isInteractive: isInteractive(),
|
|
68
70
|
frameStyle: frameStyle
|
|
69
71
|
}, children);
|
|
@@ -123,7 +123,11 @@ export var TooltipWrapper = styled.div({
|
|
|
123
123
|
// manage scrolling behaviour.
|
|
124
124
|
// eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression
|
|
125
125
|
export var Content = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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(N40, ")"), "var(--ds-surface-raised, white)", function (_ref11) {
|
|
126
|
-
var allowScrollBar = _ref11.allowScrollBar
|
|
126
|
+
var allowScrollBar = _ref11.allowScrollBar,
|
|
127
|
+
removeOverflow = _ref11.removeOverflow;
|
|
128
|
+
if (removeOverflow) {
|
|
129
|
+
return '';
|
|
130
|
+
}
|
|
127
131
|
return allowScrollBar ? 'overflow: auto;' : 'overflow: hidden;';
|
|
128
132
|
}, function (_ref12) {
|
|
129
133
|
var frameStyle = _ref12.frameStyle;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["onClick", "url", "ari", "product"];
|
|
3
|
+
var _excluded = ["onClick", "onError", "url", "ari", "product"];
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import { di } from 'react-magnetic-di';
|
|
6
7
|
import { messages } from '../../../../../messages';
|
|
7
8
|
import Action from '../action';
|
|
8
9
|
import AiIcon from '../../../../common/ai-icon';
|
|
9
10
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
10
11
|
import { useAISummary } from '../../../../../state/hooks/use-ai-summary';
|
|
12
|
+
import { getErrorMessage } from './utils';
|
|
11
13
|
export var AISummaryActionComponent = function AISummaryActionComponent(_ref) {
|
|
12
14
|
var onClickCallback = _ref.onClick,
|
|
15
|
+
onErrorCallback = _ref.onError,
|
|
13
16
|
_ref$url = _ref.url,
|
|
14
17
|
url = _ref$url === void 0 ? '' : _ref$url,
|
|
15
18
|
_ref$ari = _ref.ari,
|
|
@@ -25,26 +28,31 @@ export var AISummaryActionComponent = function AISummaryActionComponent(_ref) {
|
|
|
25
28
|
}),
|
|
26
29
|
status = _useAISummary.state.status,
|
|
27
30
|
summariseUrl = _useAISummary.summariseUrl;
|
|
31
|
+
var onCompleted = useCallback(function (state) {
|
|
32
|
+
if ((state === null || state === void 0 ? void 0 : state.status) === 'error') {
|
|
33
|
+
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback(getErrorMessage(state.error));
|
|
34
|
+
}
|
|
35
|
+
}, [onErrorCallback]);
|
|
28
36
|
var handleActionClick = useCallback(function () {
|
|
37
|
+
var _summariseUrl;
|
|
29
38
|
fireEvent('ui.button.clicked.aiSummary', {});
|
|
30
39
|
fireEvent('track.aiInteraction.initiated', {
|
|
31
40
|
aiFeatureName: 'Smart Links Summary',
|
|
32
41
|
proactiveAIGenerated: 0,
|
|
33
42
|
userGeneratedAI: 1
|
|
34
43
|
});
|
|
35
|
-
summariseUrl();
|
|
44
|
+
(_summariseUrl = summariseUrl()) === null || _summariseUrl === void 0 || _summariseUrl.then(onCompleted, onCompleted);
|
|
36
45
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
37
|
-
}, [fireEvent, onClickCallback, summariseUrl]);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
46
|
+
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
47
|
+
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
48
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
|
|
49
|
+
icon: /*#__PURE__*/React.createElement(AiIcon, {
|
|
50
|
+
label: "Summarise with AI"
|
|
51
|
+
}),
|
|
52
|
+
isLoading: status === 'loading',
|
|
53
|
+
onClick: handleActionClick,
|
|
54
|
+
testId: "smart-action-ai-summary-action",
|
|
55
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action_description)
|
|
56
|
+
}, props));
|
|
49
57
|
return null;
|
|
50
58
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import { getAISummaryErrorMessage } from '../../../../../utils/ai-summary';
|
|
5
|
+
import AIEventErrorViewed from '../../common/ai-summary/ai-event-error-viewed';
|
|
6
|
+
import AILearnMoreAnchor from '../../common/ai-summary/ai-learn-more-anchor';
|
|
7
|
+
export var getErrorMessage = function getErrorMessage(error) {
|
|
8
|
+
var _getAISummaryErrorMes = getAISummaryErrorMessage(error),
|
|
9
|
+
message = _getAISummaryErrorMes.message,
|
|
10
|
+
url = _getAISummaryErrorMes.url;
|
|
11
|
+
return {
|
|
12
|
+
appearance: 'error',
|
|
13
|
+
title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AIEventErrorViewed, {
|
|
14
|
+
reason: error
|
|
15
|
+
}), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
|
|
16
|
+
values: {
|
|
17
|
+
a: function a(chunks) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(AILearnMoreAnchor, {
|
|
19
|
+
href: url
|
|
20
|
+
}, chunks);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
})))
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
2
|
+
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import MotionWrapper from '../../../common/motion-wrapper';
|
|
5
|
+
var containerStyles = xcss({
|
|
6
|
+
all: 'unset',
|
|
7
|
+
borderRadius: 'border.radius',
|
|
8
|
+
margin: 'space.100',
|
|
9
|
+
lineHeight: '20px',
|
|
10
|
+
padding: 'space.050',
|
|
11
|
+
paddingInline: 'space.100',
|
|
12
|
+
width: '100%',
|
|
13
|
+
':empty': {
|
|
14
|
+
display: 'none'
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var errorStyles = xcss({
|
|
18
|
+
backgroundColor: 'color.background.danger'
|
|
19
|
+
});
|
|
20
|
+
var titleStyles = xcss({
|
|
21
|
+
color: 'color.text.subtle',
|
|
22
|
+
fontSize: '12px',
|
|
23
|
+
fontStyle: 'normal',
|
|
24
|
+
fontWeight: '400',
|
|
25
|
+
lineHeight: '16px'
|
|
26
|
+
});
|
|
27
|
+
var getIcon = function getIcon(appearance) {
|
|
28
|
+
switch (appearance) {
|
|
29
|
+
case 'error':
|
|
30
|
+
return /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
31
|
+
primaryColor: "var(--ds-icon-danger, #C9372C)",
|
|
32
|
+
label: "Error",
|
|
33
|
+
size: "small",
|
|
34
|
+
testId: "action-error-icon"
|
|
35
|
+
});
|
|
36
|
+
default:
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export var ActionFooter = function ActionFooter(_ref) {
|
|
41
|
+
var message = _ref.message,
|
|
42
|
+
testId = _ref.testId;
|
|
43
|
+
if (!message) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
47
|
+
testId: "".concat(testId, "-footer"),
|
|
48
|
+
xcss: [containerStyles, message.appearance === 'error' && errorStyles]
|
|
49
|
+
}, /*#__PURE__*/React.createElement(MotionWrapper, {
|
|
50
|
+
isFadeIn: true,
|
|
51
|
+
show: true,
|
|
52
|
+
showTransition: true
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
54
|
+
alignBlock: "start",
|
|
55
|
+
grow: "fill",
|
|
56
|
+
space: "space.025"
|
|
57
|
+
}, message.icon || getIcon(message.appearance), /*#__PURE__*/React.createElement(Box, {
|
|
58
|
+
xcss: titleStyles
|
|
59
|
+
}, message.title))));
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { xcss } from '@atlaskit/primitives';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
5
6
|
import { SmartLinkSize } from '../../../../../constants';
|
|
6
7
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
7
8
|
import * as Actions from '../../actions';
|
|
8
9
|
import { getPrimitivesPaddingSpaceBySize } from '../../utils';
|
|
10
|
+
import { ActionFooter } from './action-footer';
|
|
11
|
+
import { di } from 'react-magnetic-di';
|
|
9
12
|
var ignoreContainerPaddingStyles = css({
|
|
10
13
|
display: 'flex',
|
|
11
14
|
flexDirection: 'column',
|
|
@@ -38,7 +41,18 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
38
41
|
testId = _ref$testId === void 0 ? 'smart-block-action' : _ref$testId;
|
|
39
42
|
var context = useFlexibleUiContext();
|
|
40
43
|
var ui = useFlexibleUiOptionContext();
|
|
44
|
+
var _useState = useState(),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
message = _useState2[0],
|
|
47
|
+
setMessage = _useState2[1];
|
|
41
48
|
var padding = !(ui !== null && ui !== void 0 && ui.hidePadding) ? getPrimitivesPaddingSpaceBySize((ui === null || ui === void 0 ? void 0 : ui.size) || SmartLinkSize.Medium) : undefined;
|
|
49
|
+
var _onClick = useCallback(function (name) {
|
|
50
|
+
setMessage(undefined);
|
|
51
|
+
onClickCallback === null || onClickCallback === void 0 || onClickCallback(name);
|
|
52
|
+
}, [onClickCallback]);
|
|
53
|
+
var onError = useCallback(function (error) {
|
|
54
|
+
setMessage(error);
|
|
55
|
+
}, []);
|
|
42
56
|
var actions = useMemo(function () {
|
|
43
57
|
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
44
58
|
return;
|
|
@@ -52,19 +66,24 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
52
66
|
spaceInline: spaceInline,
|
|
53
67
|
key: name,
|
|
54
68
|
onClick: function onClick() {
|
|
55
|
-
return
|
|
69
|
+
return _onClick(name);
|
|
56
70
|
},
|
|
71
|
+
onError: onError,
|
|
57
72
|
size: size,
|
|
58
73
|
xcss: xcss({
|
|
59
74
|
paddingInline: padding
|
|
60
75
|
})
|
|
61
76
|
}) : null;
|
|
62
77
|
});
|
|
63
|
-
}, [context === null || context === void 0 ? void 0 : context.actions,
|
|
78
|
+
}, [context === null || context === void 0 ? void 0 : context.actions, _onClick, onError, padding, size, spaceInline]);
|
|
64
79
|
return actions ? jsx("div", {
|
|
65
80
|
css: ignoreContainerPaddingStyles,
|
|
66
81
|
ref: blockRef,
|
|
67
82
|
"data-testid": testId
|
|
68
|
-
}, actions
|
|
83
|
+
}, actions, jsx(ActionFooter, {
|
|
84
|
+
message: message,
|
|
85
|
+
paddingInline: padding,
|
|
86
|
+
testId: testId
|
|
87
|
+
})) : null;
|
|
69
88
|
};
|
|
70
89
|
export default ActionBlock;
|
|
@@ -11,7 +11,7 @@ import { messages } from '../../../../../../messages';
|
|
|
11
11
|
import AIIcon from '../../../../../common/ai-icon';
|
|
12
12
|
import AIIndicatorTooltip from './ai-indicator-tooltip';
|
|
13
13
|
import AIIndicatorContainer from './ai-indicator-container';
|
|
14
|
-
import AILearnMoreAnchor from '
|
|
14
|
+
import AILearnMoreAnchor from '../../../common/ai-summary/ai-learn-more-anchor';
|
|
15
15
|
var tooltipMsgStyles = xcss({
|
|
16
16
|
color: 'color.text',
|
|
17
17
|
fontSize: '14px',
|
|
@@ -3,10 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
4
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
5
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
6
|
-
import {
|
|
6
|
+
import { getAISummaryErrorMessage } from '../../../../../../utils/ai-summary';
|
|
7
|
+
import AILearnMoreAnchor from '../../../common/ai-summary/ai-learn-more-anchor';
|
|
7
8
|
import AIIndicatorContainer from './ai-indicator-container';
|
|
8
|
-
import AILearnMoreAnchor from './ai-learn-more-anchor';
|
|
9
|
-
import { CONTENT_URL_ACCEPTABLE_USE_POLICY, CONTENT_URL_AI_TROUBLESHOOTING } from '../../../../../../constants';
|
|
10
9
|
var contentStyles = xcss({
|
|
11
10
|
color: 'color.text.subtle',
|
|
12
11
|
fontSize: '11px',
|
|
@@ -27,31 +26,13 @@ var FormattedErrorMessage = function FormattedErrorMessage(_ref) {
|
|
|
27
26
|
}
|
|
28
27
|
}));
|
|
29
28
|
};
|
|
30
|
-
var getErrorMesssageProps = function getErrorMesssageProps(error) {
|
|
31
|
-
switch (error) {
|
|
32
|
-
case 'ACCEPTABLE_USE_VIOLATIONS':
|
|
33
|
-
return {
|
|
34
|
-
message: messages.ai_summary_error_acceptable_use_violation,
|
|
35
|
-
url: CONTENT_URL_ACCEPTABLE_USE_POLICY
|
|
36
|
-
};
|
|
37
|
-
case 'HIPAA_CONTENT_DETECTED':
|
|
38
|
-
return {
|
|
39
|
-
message: messages.ai_summary_error_hipaa_content_detected
|
|
40
|
-
};
|
|
41
|
-
default:
|
|
42
|
-
return {
|
|
43
|
-
message: messages.ai_summary_error_generic,
|
|
44
|
-
url: CONTENT_URL_AI_TROUBLESHOOTING
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
29
|
var AIStateError = function AIStateError(_ref2) {
|
|
49
30
|
var appearance = _ref2.appearance,
|
|
50
31
|
testId = _ref2.testId,
|
|
51
32
|
error = _ref2.error;
|
|
52
|
-
var
|
|
53
|
-
message =
|
|
54
|
-
url =
|
|
33
|
+
var _getAISummaryErrorMes = getAISummaryErrorMessage(error),
|
|
34
|
+
message = _getAISummaryErrorMes.message,
|
|
35
|
+
url = _getAISummaryErrorMes.url;
|
|
55
36
|
switch (appearance) {
|
|
56
37
|
case 'icon-only':
|
|
57
38
|
return null;
|
|
@@ -7,7 +7,7 @@ import { ActionName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '.
|
|
|
7
7
|
import ActionGroup from '../../action-group';
|
|
8
8
|
import Block from '../../block';
|
|
9
9
|
import ElementGroup from '../../element-group';
|
|
10
|
-
import
|
|
10
|
+
import MotionWrapper from '../../../common/motion-wrapper';
|
|
11
11
|
import AIStateIndicator from '../ai-state-indicator';
|
|
12
12
|
import { renderElementItems } from '../../utils';
|
|
13
13
|
import { messages } from '../../../../../../messages';
|
|
@@ -16,7 +16,7 @@ import AIIcon from '../../../../../common/ai-icon';
|
|
|
16
16
|
import AISummary from '../../../../../common/ai-summary';
|
|
17
17
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
18
18
|
import AIEventSummaryViewed from '../ai-event-summary-viewed';
|
|
19
|
-
import AIEventErrorViewed from '
|
|
19
|
+
import AIEventErrorViewed from '../../../common/ai-summary/ai-event-error-viewed';
|
|
20
20
|
import { di } from 'react-magnetic-di';
|
|
21
21
|
import { css } from '@emotion/react';
|
|
22
22
|
import FeatureDiscovery from '../feature-discovery';
|
|
@@ -28,7 +28,7 @@ export var AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(
|
|
|
28
28
|
error = _ref.error,
|
|
29
29
|
showTransition = _ref.showTransition,
|
|
30
30
|
testId = _ref.testId;
|
|
31
|
-
return /*#__PURE__*/React.createElement(
|
|
31
|
+
return /*#__PURE__*/React.createElement(MotionWrapper, {
|
|
32
32
|
isFadeIn: true,
|
|
33
33
|
show: showErrorIndicator,
|
|
34
34
|
showTransition: showTransition
|
|
@@ -140,7 +140,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
140
140
|
}, props.overrideCss)
|
|
141
141
|
}), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
142
142
|
fromCache: isSummarisedOnMountRef.current
|
|
143
|
-
}), /*#__PURE__*/React.createElement(
|
|
143
|
+
}), /*#__PURE__*/React.createElement(MotionWrapper, {
|
|
144
144
|
minHeight: aiSummaryMinHeight,
|
|
145
145
|
show: showAISummary,
|
|
146
146
|
showTransition: !isSummarisedOnMountRef.current
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import { useAnalyticsEvents } from '
|
|
2
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
3
3
|
var AIEventErrorViewed = function AIEventErrorViewed(_ref) {
|
|
4
4
|
var reason = _ref.reason;
|
|
5
5
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["children"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { CONTENT_URL_AI } from '
|
|
5
|
+
import { CONTENT_URL_AI } from '../../../../../constants';
|
|
6
6
|
var AILearnMoreAnchor = function AILearnMoreAnchor(_ref) {
|
|
7
7
|
var children = _ref.children,
|
|
8
8
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { Box } from '@atlaskit/primitives';
|
|
3
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
-
export var
|
|
4
|
+
export var MotionWrapper = function MotionWrapper(_ref) {
|
|
5
5
|
var children = _ref.children,
|
|
6
6
|
_ref$isFadeIn = _ref.isFadeIn,
|
|
7
7
|
isFadeIn = _ref$isFadeIn === void 0 ? false : _ref$isFadeIn,
|
|
@@ -42,4 +42,4 @@ export var AIMotionWrapper = function AIMotionWrapper(_ref) {
|
|
|
42
42
|
ref: ref
|
|
43
43
|
}, children) : null;
|
|
44
44
|
};
|
|
45
|
-
export default
|
|
45
|
+
export default MotionWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,7 +22,7 @@ import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
|
22
22
|
import { useSmartCardState } from '../../../state/store';
|
|
23
23
|
import HoverCardForbiddenView from './views/forbidden';
|
|
24
24
|
import ContentContainer from './ContentContainer';
|
|
25
|
-
import { getIsAISummaryEnabled } from '../../../utils/
|
|
25
|
+
import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
|
|
26
26
|
export var hoverCardClassName = 'smart-links-hover-preview';
|
|
27
27
|
export var getCopyAction = function getCopyAction(url) {
|
|
28
28
|
return {
|
|
@@ -179,13 +179,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
|
|
|
179
179
|
}), isActionBlockEnabled && /*#__PURE__*/React.createElement(ActionBlock, {
|
|
180
180
|
onClick: onActionClick,
|
|
181
181
|
spaceInline: "space.150"
|
|
182
|
-
}), isActionBlockEnabled && /*#__PURE__*/React.createElement(
|
|
183
|
-
secondary: [{
|
|
184
|
-
name: ElementName.Provider,
|
|
185
|
-
testId: 'smart-element-provider'
|
|
186
|
-
}],
|
|
187
|
-
testId: "smart-block-action-footer"
|
|
188
|
-
}), !isAISummaryEnabled && !isActionBlockEnabled && /*#__PURE__*/React.createElement(FooterBlock, {
|
|
182
|
+
}), isActionBlockEnabled && /*#__PURE__*/React.createElement(FooterBlock, null), !isAISummaryEnabled && !isActionBlockEnabled && /*#__PURE__*/React.createElement(FooterBlock, {
|
|
189
183
|
actions: footerActions,
|
|
190
184
|
size: SmartLinkSize.Large,
|
|
191
185
|
overrideCss: footerBlockCss
|
|
@@ -41,7 +41,7 @@ var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(extensionKe
|
|
|
41
41
|
});
|
|
42
42
|
case 'trello-object-provider':
|
|
43
43
|
return {
|
|
44
|
-
primary: [ElementName.
|
|
44
|
+
primary: [ElementName.CollaboratorGroup, ElementName.State, ElementName.DueOn],
|
|
45
45
|
secondary: [ElementName.ReactCount, ElementName.CommentCount, ElementName.AttachmentCount, ElementName.ChecklistProgress],
|
|
46
46
|
subtitle: [ElementName.Location]
|
|
47
47
|
};
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.
|
|
13
|
+
packageVersion: "26.60.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JsonLd } from 'json-ld-types';
|
|
1
|
+
import { type JsonLd } from 'json-ld-types';
|
|
2
2
|
import { type CardActionOptions } from '../../../view/Card/types';
|
|
3
|
-
import { AISummaryActionData } from '../../../state/flexible-ui-context/types';
|
|
4
|
-
import { AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
3
|
+
import { type AISummaryActionData } from '../../../state/flexible-ui-context/types';
|
|
4
|
+
import { type AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
5
5
|
export declare const extractAISummaryAction: (response: JsonLd.Response, url?: string, actionOptions?: CardActionOptions, aiSummaryConfig?: AISummaryConfig) => AISummaryActionData | undefined;
|
|
@@ -10,7 +10,7 @@ export declare class AISummaryService implements AISummaryServiceInt {
|
|
|
10
10
|
private onError?;
|
|
11
11
|
constructor(props: AISummaryServiceProps);
|
|
12
12
|
private fetchStream;
|
|
13
|
-
summariseUrl(): Promise<
|
|
13
|
+
summariseUrl(): Promise<AISummaryState>;
|
|
14
14
|
private isExpectedError;
|
|
15
15
|
subscribe(stateSetter: StateSetter): () => void;
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="filesystem" />
|
|
2
2
|
import type { ProductType } from '@atlaskit/linking-common';
|
|
3
3
|
export interface AISummaryServiceInt {
|
|
4
|
-
summariseUrl: () => Promise<
|
|
4
|
+
summariseUrl: () => Promise<AISummaryState>;
|
|
5
5
|
state: AISummaryState;
|
|
6
6
|
subscribe: (stateSetter: StateSetter) => () => void;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AISummaryServiceProps, AISummaryState } from './ai-summary-service/types';
|
|
2
2
|
export declare const useAISummary: (props: AISummaryServiceProps) => {
|
|
3
|
-
summariseUrl: () => Promise<
|
|
3
|
+
summariseUrl: () => Promise<AISummaryState> | undefined;
|
|
4
4
|
state: AISummaryState;
|
|
5
5
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JsonLd } from 'json-ld-types';
|
|
2
|
+
import type { MessageDescriptor } from 'react-intl-next';
|
|
3
|
+
import type { ErrorMessage } from '../state/hooks/use-ai-summary/ai-summary-service/types';
|
|
4
|
+
export declare const getIsAISummaryEnabled: (isAdminHubAIEnabled?: boolean, response?: JsonLd.Response) => boolean;
|
|
5
|
+
export declare const getAISummaryErrorMessage: (error?: ErrorMessage) => {
|
|
6
|
+
message: MessageDescriptor;
|
|
7
|
+
url?: string;
|
|
8
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { JsonLd } from 'json-ld-types';
|
|
1
|
+
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { FlexibleUiOptions } from '../../../../FlexibleCard/types';
|
|
3
3
|
import type { FooterBlockProps } from '../../../../FlexibleCard/components/blocks/footer-block/types';
|
|
4
4
|
import type { PreviewBlockProps } from '../../../../FlexibleCard/components/blocks/preview-block/types';
|
|
5
5
|
import type { TitleBlockProps } from '../../../../FlexibleCard/components/blocks/title-block/types';
|
|
6
|
-
import { ElementItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
6
|
+
import type { ElementItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
7
7
|
export declare const getSimulatedBetterMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
8
8
|
type SimulatedMetadata = {
|
|
9
9
|
titleMetadata: ElementItem[];
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardWithUrlContentProps } from '../types';
|
|
3
|
-
declare function
|
|
4
|
-
declare function LazyIntersectionObserverCardNext(props: CardWithUrlContentProps): JSX.Element;
|
|
5
|
-
export declare const LazyIntersectionObserverCard: typeof LazyIntersectionObserverCardNext | typeof LazyIntersectionObserverCardLegacy;
|
|
6
|
-
export {};
|
|
3
|
+
export declare function LazyIntersectionObserverCard(props: CardWithUrlContentProps): JSX.Element;
|
|
@@ -46,6 +46,7 @@ export declare const TooltipWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
46
46
|
export interface ContentProps {
|
|
47
47
|
isInteractive: boolean;
|
|
48
48
|
allowScrollBar: boolean;
|
|
49
|
+
removeOverflow?: boolean;
|
|
49
50
|
frameStyle?: FrameStyle;
|
|
50
51
|
}
|
|
51
52
|
export declare const Content: import("@emotion/styled").StyledComponent<{
|