@atlaskit/smart-card 26.46.2 → 26.46.3
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 +6 -0
- package/dist/cjs/constants.js +2 -2
- package/dist/cjs/messages.js +15 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-container.js +28 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.js +35 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-learn-more-anchor.js +22 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +116 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-loading.js +35 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/index.js +35 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +37 -28
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-icon-loading/index.js +60 -0
- package/dist/es2019/constants.js +1 -1
- package/dist/es2019/messages.js +15 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-container.js +22 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.js +29 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-learn-more-anchor.js +12 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +105 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-loading.js +29 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/index.js +26 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +36 -31
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-icon-loading/index.js +64 -0
- package/dist/esm/constants.js +1 -1
- package/dist/esm/messages.js +15 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-container.js +21 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.js +25 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-learn-more-anchor.js +15 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.js +108 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-loading.js +28 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/index.js +27 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +40 -31
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-icon-loading/index.js +54 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-container.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-learn-more-anchor.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-loading.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.d.ts +18 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -1
- package/dist/types/view/common/ai-icon-loading/index.d.ts +7 -0
- package/dist/types-ts4.5/constants.d.ts +1 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-container.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-learn-more-anchor.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-done.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-state-loading.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.d.ts +18 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -1
- package/dist/types-ts4.5/view/common/ai-icon-loading/index.d.ts +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
|
+
import EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';
|
|
7
|
+
import { Box, Inline, Stack, xcss } from '@atlaskit/primitives';
|
|
8
|
+
import { messages } from '../../../../../../messages';
|
|
9
|
+
import AIIcon from '../../../../../common/ai-icon';
|
|
10
|
+
import AIIndicatorTooltip from './ai-indicator-tooltip';
|
|
11
|
+
import AIIndicatorContainer from './ai-indicator-container';
|
|
12
|
+
import AILearnMoreAnchor from './ai-learn-more-anchor';
|
|
13
|
+
const tooltipMsgStyles = xcss({
|
|
14
|
+
color: 'color.text',
|
|
15
|
+
fontSize: '14px',
|
|
16
|
+
fontWeight: '400',
|
|
17
|
+
lineHeight: '20px'
|
|
18
|
+
});
|
|
19
|
+
const iconTooltipLinkStyles = css({
|
|
20
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
21
|
+
'&:link, :visited': {
|
|
22
|
+
color: "var(--ds-text-subtlest, #626F86)"
|
|
23
|
+
},
|
|
24
|
+
'&:hover': {
|
|
25
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
26
|
+
},
|
|
27
|
+
'&:active': {
|
|
28
|
+
color: "var(--ds-text, #172B4D)"
|
|
29
|
+
},
|
|
30
|
+
textDecoration: 'underline'
|
|
31
|
+
});
|
|
32
|
+
const iconTooltipTitleStyles = xcss({
|
|
33
|
+
color: 'color.text',
|
|
34
|
+
fontSize: '12px',
|
|
35
|
+
fontWeight: '400',
|
|
36
|
+
lineHeight: '16px'
|
|
37
|
+
});
|
|
38
|
+
const iconTooltipDescStyles = xcss({
|
|
39
|
+
color: 'color.text.subtlest',
|
|
40
|
+
fontSize: '11px',
|
|
41
|
+
fontWeight: '400',
|
|
42
|
+
lineHeight: '14px'
|
|
43
|
+
});
|
|
44
|
+
const AIStateDone = ({
|
|
45
|
+
appearance,
|
|
46
|
+
testId
|
|
47
|
+
}) => {
|
|
48
|
+
const icon = jsx(AIIcon, {
|
|
49
|
+
label: "AI",
|
|
50
|
+
size: "small",
|
|
51
|
+
testId: `${testId}-done-icon`
|
|
52
|
+
});
|
|
53
|
+
switch (appearance) {
|
|
54
|
+
case 'icon-only':
|
|
55
|
+
return jsx(AIIndicatorTooltip, {
|
|
56
|
+
content: jsx(Inline, {
|
|
57
|
+
alignBlock: "center",
|
|
58
|
+
space: "space.100"
|
|
59
|
+
}, jsx(AIIcon, {
|
|
60
|
+
label: "AI",
|
|
61
|
+
size: "medium",
|
|
62
|
+
testId: `${testId}-done-tooltip-icon`
|
|
63
|
+
}), jsx(Stack, null, jsx(Box, {
|
|
64
|
+
xcss: iconTooltipTitleStyles,
|
|
65
|
+
testId: `${testId}-done-tooltip-title`
|
|
66
|
+
}, jsx(FormattedMessage, messages.ai_summarized)), jsx(Box, {
|
|
67
|
+
xcss: iconTooltipDescStyles
|
|
68
|
+
}, jsx(FormattedMessage, _extends({}, messages.ai_summarized_info, {
|
|
69
|
+
values: {
|
|
70
|
+
a: chunks => jsx(AILearnMoreAnchor, {
|
|
71
|
+
css: iconTooltipLinkStyles
|
|
72
|
+
}, chunks)
|
|
73
|
+
}
|
|
74
|
+
}))))),
|
|
75
|
+
trigger: icon
|
|
76
|
+
});
|
|
77
|
+
default:
|
|
78
|
+
return jsx(AIIndicatorContainer, {
|
|
79
|
+
icon: icon,
|
|
80
|
+
content: jsx(Inline, {
|
|
81
|
+
alignBlock: "center",
|
|
82
|
+
alignInline: "start",
|
|
83
|
+
space: "space.050"
|
|
84
|
+
}, jsx(Box, {
|
|
85
|
+
testId: `${testId}-done-message`
|
|
86
|
+
}, jsx(FormattedMessage, messages.ai_summarized)), jsx(AIIndicatorTooltip, {
|
|
87
|
+
content: jsx(Box, {
|
|
88
|
+
xcss: tooltipMsgStyles,
|
|
89
|
+
testId: `${testId}-done-tooltip`
|
|
90
|
+
}, jsx(FormattedMessage, _extends({}, messages.ai_summarized_info, {
|
|
91
|
+
values: {
|
|
92
|
+
a: chunks => jsx(AILearnMoreAnchor, null, chunks)
|
|
93
|
+
}
|
|
94
|
+
}))),
|
|
95
|
+
trigger: jsx(EditorPanelIcon, {
|
|
96
|
+
label: "Info",
|
|
97
|
+
size: "small",
|
|
98
|
+
testId: `${testId}-done-info`
|
|
99
|
+
})
|
|
100
|
+
})),
|
|
101
|
+
testId: `${testId}-done`
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
export default AIStateDone;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
+
import { Box } from '@atlaskit/primitives';
|
|
4
|
+
import { messages } from '../../../../../../messages';
|
|
5
|
+
import AIIconLoading from '../../../../../common/ai-icon-loading';
|
|
6
|
+
import AIIndicatorContainer from './ai-indicator-container';
|
|
7
|
+
const AIStateLoading = ({
|
|
8
|
+
appearance,
|
|
9
|
+
testId
|
|
10
|
+
}) => {
|
|
11
|
+
const icon = /*#__PURE__*/React.createElement(AIIconLoading, {
|
|
12
|
+
label: "AI",
|
|
13
|
+
size: "small",
|
|
14
|
+
testId: `${testId}-loading-icon`
|
|
15
|
+
});
|
|
16
|
+
switch (appearance) {
|
|
17
|
+
case 'icon-only':
|
|
18
|
+
return icon;
|
|
19
|
+
default:
|
|
20
|
+
return /*#__PURE__*/React.createElement(AIIndicatorContainer, {
|
|
21
|
+
icon: icon,
|
|
22
|
+
content: /*#__PURE__*/React.createElement(Box, {
|
|
23
|
+
testId: `${testId}-loading-message`
|
|
24
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summarizing)),
|
|
25
|
+
testId: `${testId}-loading`
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export default AIStateLoading;
|
package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import AIStateLoading from './ai-state-loading';
|
|
5
|
+
import AIStateDone from './ai-state-done';
|
|
6
|
+
const AIStateIndicator = ({
|
|
7
|
+
state,
|
|
8
|
+
appearance = 'default',
|
|
9
|
+
testId = 'ai-state-indicator'
|
|
10
|
+
}) => {
|
|
11
|
+
switch (state) {
|
|
12
|
+
case 'loading':
|
|
13
|
+
return jsx(AIStateLoading, {
|
|
14
|
+
appearance: appearance,
|
|
15
|
+
testId: testId
|
|
16
|
+
});
|
|
17
|
+
case 'done':
|
|
18
|
+
return jsx(AIStateDone, {
|
|
19
|
+
appearance: appearance,
|
|
20
|
+
testId: testId
|
|
21
|
+
});
|
|
22
|
+
default:
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export default AIStateIndicator;
|
package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { Box, Inline } from '@atlaskit/primitives';
|
|
5
|
+
import { ActionName, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
6
6
|
import ActionGroup from '../../action-group';
|
|
7
7
|
import Block from '../../block';
|
|
8
8
|
import ElementGroup from '../../element-group';
|
|
9
|
-
import
|
|
9
|
+
import AIStateIndicator from '../ai-state-indicator';
|
|
10
|
+
import { renderElementItems } from '../../utils';
|
|
10
11
|
import { messages } from '../../../../../../messages';
|
|
11
12
|
import AiIcon from '../../../../../common/ai-icon';
|
|
12
13
|
const AISummaryBlockResolvedView = props => {
|
|
@@ -18,29 +19,29 @@ const AISummaryBlockResolvedView = props => {
|
|
|
18
19
|
onAIActionChange,
|
|
19
20
|
size = SmartLinkSize.Medium
|
|
20
21
|
} = props;
|
|
21
|
-
const
|
|
22
|
+
const [aiState, setAIState] = useState('ready');
|
|
22
23
|
const metadataElements = renderElementItems(metadata);
|
|
23
24
|
const onAIActionClick = useCallback(() => {
|
|
25
|
+
setAIState('loading');
|
|
24
26
|
if (onAIActionChange) {
|
|
25
|
-
onAIActionChange();
|
|
27
|
+
onAIActionChange('loading');
|
|
26
28
|
}
|
|
27
29
|
}, [onAIActionChange]);
|
|
28
30
|
const combinedActions = useMemo(() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [combinedActions, context]);
|
|
31
|
+
if (aiState === 'ready') {
|
|
32
|
+
const aiAction = {
|
|
33
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summarize),
|
|
34
|
+
name: ActionName.CustomAction,
|
|
35
|
+
onClick: onAIActionClick,
|
|
36
|
+
testId: `${testId}-ai-summary-action`,
|
|
37
|
+
icon: /*#__PURE__*/React.createElement(AiIcon, {
|
|
38
|
+
label: "AiIcon"
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
return [aiAction, ...actions];
|
|
42
|
+
}
|
|
43
|
+
return actions;
|
|
44
|
+
}, [actions, aiState, onAIActionClick, testId]);
|
|
44
45
|
const onDropdownOpenChange = useCallback(isOpen => {
|
|
45
46
|
if (onActionMenuOpenChange) {
|
|
46
47
|
onActionMenuOpenChange({
|
|
@@ -50,17 +51,21 @@ const AISummaryBlockResolvedView = props => {
|
|
|
50
51
|
}, [onActionMenuOpenChange]);
|
|
51
52
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
52
53
|
testId: `${testId}-resolved-view`
|
|
53
|
-
}), /*#__PURE__*/React.createElement(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
}), /*#__PURE__*/React.createElement(Inline, {
|
|
55
|
+
alignBlock: "center",
|
|
56
|
+
alignInline: "end",
|
|
57
|
+
grow: "fill",
|
|
58
|
+
spread: "space-between"
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Box, null, aiState === 'loading' || aiState === 'done' ? /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
60
|
+
state: aiState,
|
|
61
|
+
testId: testId
|
|
62
|
+
}) : /*#__PURE__*/React.createElement(ElementGroup, {
|
|
63
|
+
width: SmartLinkWidth.FitToContent
|
|
64
|
+
}, metadataElements)), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
61
65
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
62
66
|
items: combinedActions,
|
|
63
|
-
appearance: "default"
|
|
64
|
-
|
|
67
|
+
appearance: "default",
|
|
68
|
+
size: size
|
|
69
|
+
}))));
|
|
65
70
|
};
|
|
66
71
|
export default AISummaryBlockResolvedView;
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.46.
|
|
10
|
+
packageVersion: "26.46.3",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx, keyframes } from '@emotion/react';
|
|
3
|
+
import SVG from '@atlaskit/icon/svg';
|
|
4
|
+
import { aiThemeTokens } from '../ai-prism/constants';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The bulk of this file is originally from
|
|
8
|
+
* https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
|
|
9
|
+
* with modifications
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const bounce = keyframes`
|
|
13
|
+
from {
|
|
14
|
+
transform: translateY(0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 200ms of 1200ms = 16.67%
|
|
18
|
+
16.67% {
|
|
19
|
+
transform: translateY(-2px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 400ms of 1200ms = 33.33%
|
|
23
|
+
33.33% {
|
|
24
|
+
transform: translateY(0px);
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
const BASE_DELAY = 400;
|
|
28
|
+
const QUEUE_DELAY = 200;
|
|
29
|
+
const animationStyles = css({
|
|
30
|
+
animation: `${bounce} 1.2s linear infinite normal`
|
|
31
|
+
});
|
|
32
|
+
const firstDelayStyles = css({
|
|
33
|
+
animationDelay: `${BASE_DELAY + QUEUE_DELAY}ms`
|
|
34
|
+
});
|
|
35
|
+
const secondDelayStyles = css({
|
|
36
|
+
animationDelay: `${BASE_DELAY + QUEUE_DELAY * 2}ms`
|
|
37
|
+
});
|
|
38
|
+
const thirdDelayStyles = css({
|
|
39
|
+
animationDelay: `${BASE_DELAY + QUEUE_DELAY * 3}ms`
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* this icon is theme agnostic, no need for tokens
|
|
44
|
+
*/
|
|
45
|
+
const AIIconLoading = props => jsx(SVG, props, jsx("circle", {
|
|
46
|
+
css: [animationStyles, firstDelayStyles],
|
|
47
|
+
cx: "6",
|
|
48
|
+
cy: "12",
|
|
49
|
+
r: "1.5",
|
|
50
|
+
fill: aiThemeTokens.blue700
|
|
51
|
+
}), jsx("circle", {
|
|
52
|
+
css: [animationStyles, secondDelayStyles],
|
|
53
|
+
cx: "12",
|
|
54
|
+
cy: "12",
|
|
55
|
+
r: "1.5",
|
|
56
|
+
fill: aiThemeTokens.blue600
|
|
57
|
+
}), jsx("circle", {
|
|
58
|
+
css: [animationStyles, thirdDelayStyles],
|
|
59
|
+
cx: "17.5",
|
|
60
|
+
cy: "12",
|
|
61
|
+
r: "1.5",
|
|
62
|
+
fill: aiThemeTokens.blue500
|
|
63
|
+
}));
|
|
64
|
+
export default AIIconLoading;
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links';
|
|
2
2
|
export var CONTENT_URL_3P_ACCOUNT_AUTH = 'https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/';
|
|
3
|
-
|
|
3
|
+
export var CONTENT_URL_AI = 'https://www.atlassian.com/trust/atlassian-intelligence';
|
|
4
4
|
/**
|
|
5
5
|
* The alignment of Flexible UI component.
|
|
6
6
|
*/
|
package/dist/esm/messages.js
CHANGED
|
@@ -18,6 +18,21 @@ export var messages = defineMessages({
|
|
|
18
18
|
defaultMessage: 'Summarize',
|
|
19
19
|
description: 'Action to summarize link resource content with AI'
|
|
20
20
|
},
|
|
21
|
+
ai_summarized: {
|
|
22
|
+
id: 'fabric.linking.ai_summarized',
|
|
23
|
+
defaultMessage: 'Summarized by Atlassian Intelligence',
|
|
24
|
+
description: 'Shown with the content summarised by AI.'
|
|
25
|
+
},
|
|
26
|
+
ai_summarized_info: {
|
|
27
|
+
id: 'fabric.linking.ai_summarized_info',
|
|
28
|
+
defaultMessage: 'Information quality may vary. <a>Learn more</a>',
|
|
29
|
+
description: 'Additional info about the content summarised by AI.'
|
|
30
|
+
},
|
|
31
|
+
ai_summarizing: {
|
|
32
|
+
id: 'fabric.linking.ai_summarizing',
|
|
33
|
+
defaultMessage: 'Atlassian Intelligence is working...',
|
|
34
|
+
description: 'Shown when AI summary is summarising the link resource content.'
|
|
35
|
+
},
|
|
21
36
|
assigned_to: {
|
|
22
37
|
id: 'fabric.linking.assigned_to',
|
|
23
38
|
defaultMessage: 'Assigned to {context}',
|
|
@@ -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.46.
|
|
18
|
+
packageVersion: "26.46.3"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Inline, xcss } from '@atlaskit/primitives';
|
|
3
|
+
var contentStyles = xcss({
|
|
4
|
+
color: 'color.text.subtle',
|
|
5
|
+
fontSize: '12px',
|
|
6
|
+
fontWeight: '400',
|
|
7
|
+
lineHeight: '16px'
|
|
8
|
+
});
|
|
9
|
+
var AIIndicatorContainer = function AIIndicatorContainer(_ref) {
|
|
10
|
+
var icon = _ref.icon,
|
|
11
|
+
content = _ref.content,
|
|
12
|
+
testId = _ref.testId;
|
|
13
|
+
return /*#__PURE__*/React.createElement(Inline, {
|
|
14
|
+
alignBlock: "center",
|
|
15
|
+
alignInline: "start",
|
|
16
|
+
space: "space.050",
|
|
17
|
+
xcss: contentStyles,
|
|
18
|
+
testId: testId
|
|
19
|
+
}, icon, content);
|
|
20
|
+
};
|
|
21
|
+
export default AIIndicatorContainer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
var _templateObject;
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import styled from '@emotion/styled';
|
|
6
|
+
import Tooltip, { TooltipPrimitive } from '@atlaskit/tooltip';
|
|
7
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
8
|
+
var AIIndicatorTooltipPrimitive = styled(TooltipPrimitive)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", ";\n background-color: ", ";\n box-shadow: ", ";\n box-sizing: content-box;\n padding: ", ";\n max-width: 350px;\n"])), "var(--ds-border-radius, 3px)", "var(--ds-surface-raised, white)", "var(--ds-shadow-overlay, 0px 8px 12px rgba(9, 30, 66, 0.15),0px 0px 1px rgba(9, 30, 66, 0.31))", "var(--ds-space-200, 16px)");
|
|
9
|
+
var triggerStyles = xcss({
|
|
10
|
+
display: 'inline-flex'
|
|
11
|
+
});
|
|
12
|
+
var AIIndicatorTooltip = function AIIndicatorTooltip(_ref) {
|
|
13
|
+
var content = _ref.content,
|
|
14
|
+
trigger = _ref.trigger;
|
|
15
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
16
|
+
component: AIIndicatorTooltipPrimitive,
|
|
17
|
+
content: content,
|
|
18
|
+
tag: "span"
|
|
19
|
+
}, function (tooltipProps) {
|
|
20
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
21
|
+
xcss: triggerStyles
|
|
22
|
+
}, tooltipProps), trigger);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export default AIIndicatorTooltip;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { CONTENT_URL_AI } from '../../../../../../constants';
|
|
6
|
+
var AILearnMoreAnchor = function AILearnMoreAnchor(_ref) {
|
|
7
|
+
var children = _ref.children,
|
|
8
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
return /*#__PURE__*/React.createElement("a", _extends({
|
|
10
|
+
href: CONTENT_URL_AI,
|
|
11
|
+
target: "_blank",
|
|
12
|
+
rel: "noopener noreferrer"
|
|
13
|
+
}, props), children);
|
|
14
|
+
};
|
|
15
|
+
export default AILearnMoreAnchor;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
|
+
import EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';
|
|
7
|
+
import { Box, Inline, Stack, xcss } from '@atlaskit/primitives';
|
|
8
|
+
import { messages } from '../../../../../../messages';
|
|
9
|
+
import AIIcon from '../../../../../common/ai-icon';
|
|
10
|
+
import AIIndicatorTooltip from './ai-indicator-tooltip';
|
|
11
|
+
import AIIndicatorContainer from './ai-indicator-container';
|
|
12
|
+
import AILearnMoreAnchor from './ai-learn-more-anchor';
|
|
13
|
+
var tooltipMsgStyles = xcss({
|
|
14
|
+
color: 'color.text',
|
|
15
|
+
fontSize: '14px',
|
|
16
|
+
fontWeight: '400',
|
|
17
|
+
lineHeight: '20px'
|
|
18
|
+
});
|
|
19
|
+
var iconTooltipLinkStyles = css({
|
|
20
|
+
color: "var(--ds-text-subtlest, #626F86)",
|
|
21
|
+
'&:link, :visited': {
|
|
22
|
+
color: "var(--ds-text-subtlest, #626F86)"
|
|
23
|
+
},
|
|
24
|
+
'&:hover': {
|
|
25
|
+
color: "var(--ds-text-subtle, #44546F)"
|
|
26
|
+
},
|
|
27
|
+
'&:active': {
|
|
28
|
+
color: "var(--ds-text, #172B4D)"
|
|
29
|
+
},
|
|
30
|
+
textDecoration: 'underline'
|
|
31
|
+
});
|
|
32
|
+
var iconTooltipTitleStyles = xcss({
|
|
33
|
+
color: 'color.text',
|
|
34
|
+
fontSize: '12px',
|
|
35
|
+
fontWeight: '400',
|
|
36
|
+
lineHeight: '16px'
|
|
37
|
+
});
|
|
38
|
+
var iconTooltipDescStyles = xcss({
|
|
39
|
+
color: 'color.text.subtlest',
|
|
40
|
+
fontSize: '11px',
|
|
41
|
+
fontWeight: '400',
|
|
42
|
+
lineHeight: '14px'
|
|
43
|
+
});
|
|
44
|
+
var AIStateDone = function AIStateDone(_ref) {
|
|
45
|
+
var appearance = _ref.appearance,
|
|
46
|
+
testId = _ref.testId;
|
|
47
|
+
var icon = jsx(AIIcon, {
|
|
48
|
+
label: "AI",
|
|
49
|
+
size: "small",
|
|
50
|
+
testId: "".concat(testId, "-done-icon")
|
|
51
|
+
});
|
|
52
|
+
switch (appearance) {
|
|
53
|
+
case 'icon-only':
|
|
54
|
+
return jsx(AIIndicatorTooltip, {
|
|
55
|
+
content: jsx(Inline, {
|
|
56
|
+
alignBlock: "center",
|
|
57
|
+
space: "space.100"
|
|
58
|
+
}, jsx(AIIcon, {
|
|
59
|
+
label: "AI",
|
|
60
|
+
size: "medium",
|
|
61
|
+
testId: "".concat(testId, "-done-tooltip-icon")
|
|
62
|
+
}), jsx(Stack, null, jsx(Box, {
|
|
63
|
+
xcss: iconTooltipTitleStyles,
|
|
64
|
+
testId: "".concat(testId, "-done-tooltip-title")
|
|
65
|
+
}, jsx(FormattedMessage, messages.ai_summarized)), jsx(Box, {
|
|
66
|
+
xcss: iconTooltipDescStyles
|
|
67
|
+
}, jsx(FormattedMessage, _extends({}, messages.ai_summarized_info, {
|
|
68
|
+
values: {
|
|
69
|
+
a: function a(chunks) {
|
|
70
|
+
return jsx(AILearnMoreAnchor, {
|
|
71
|
+
css: iconTooltipLinkStyles
|
|
72
|
+
}, chunks);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}))))),
|
|
76
|
+
trigger: icon
|
|
77
|
+
});
|
|
78
|
+
default:
|
|
79
|
+
return jsx(AIIndicatorContainer, {
|
|
80
|
+
icon: icon,
|
|
81
|
+
content: jsx(Inline, {
|
|
82
|
+
alignBlock: "center",
|
|
83
|
+
alignInline: "start",
|
|
84
|
+
space: "space.050"
|
|
85
|
+
}, jsx(Box, {
|
|
86
|
+
testId: "".concat(testId, "-done-message")
|
|
87
|
+
}, jsx(FormattedMessage, messages.ai_summarized)), jsx(AIIndicatorTooltip, {
|
|
88
|
+
content: jsx(Box, {
|
|
89
|
+
xcss: tooltipMsgStyles,
|
|
90
|
+
testId: "".concat(testId, "-done-tooltip")
|
|
91
|
+
}, jsx(FormattedMessage, _extends({}, messages.ai_summarized_info, {
|
|
92
|
+
values: {
|
|
93
|
+
a: function a(chunks) {
|
|
94
|
+
return jsx(AILearnMoreAnchor, null, chunks);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}))),
|
|
98
|
+
trigger: jsx(EditorPanelIcon, {
|
|
99
|
+
label: "Info",
|
|
100
|
+
size: "small",
|
|
101
|
+
testId: "".concat(testId, "-done-info")
|
|
102
|
+
})
|
|
103
|
+
})),
|
|
104
|
+
testId: "".concat(testId, "-done")
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
export default AIStateDone;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
+
import { Box } from '@atlaskit/primitives';
|
|
4
|
+
import { messages } from '../../../../../../messages';
|
|
5
|
+
import AIIconLoading from '../../../../../common/ai-icon-loading';
|
|
6
|
+
import AIIndicatorContainer from './ai-indicator-container';
|
|
7
|
+
var AIStateLoading = function AIStateLoading(_ref) {
|
|
8
|
+
var appearance = _ref.appearance,
|
|
9
|
+
testId = _ref.testId;
|
|
10
|
+
var icon = /*#__PURE__*/React.createElement(AIIconLoading, {
|
|
11
|
+
label: "AI",
|
|
12
|
+
size: "small",
|
|
13
|
+
testId: "".concat(testId, "-loading-icon")
|
|
14
|
+
});
|
|
15
|
+
switch (appearance) {
|
|
16
|
+
case 'icon-only':
|
|
17
|
+
return icon;
|
|
18
|
+
default:
|
|
19
|
+
return /*#__PURE__*/React.createElement(AIIndicatorContainer, {
|
|
20
|
+
icon: icon,
|
|
21
|
+
content: /*#__PURE__*/React.createElement(Box, {
|
|
22
|
+
testId: "".concat(testId, "-loading-message")
|
|
23
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summarizing)),
|
|
24
|
+
testId: "".concat(testId, "-loading")
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export default AIStateLoading;
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import AIStateLoading from './ai-state-loading';
|
|
5
|
+
import AIStateDone from './ai-state-done';
|
|
6
|
+
var AIStateIndicator = function AIStateIndicator(_ref) {
|
|
7
|
+
var state = _ref.state,
|
|
8
|
+
_ref$appearance = _ref.appearance,
|
|
9
|
+
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
|
|
10
|
+
_ref$testId = _ref.testId,
|
|
11
|
+
testId = _ref$testId === void 0 ? 'ai-state-indicator' : _ref$testId;
|
|
12
|
+
switch (state) {
|
|
13
|
+
case 'loading':
|
|
14
|
+
return jsx(AIStateLoading, {
|
|
15
|
+
appearance: appearance,
|
|
16
|
+
testId: testId
|
|
17
|
+
});
|
|
18
|
+
case 'done':
|
|
19
|
+
return jsx(AIStateDone, {
|
|
20
|
+
appearance: appearance,
|
|
21
|
+
testId: testId
|
|
22
|
+
});
|
|
23
|
+
default:
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export default AIStateIndicator;
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|