@atlaskit/smart-card 26.46.2 → 26.46.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/constants.js +2 -2
- package/dist/cjs/extractors/common/context/extractAccessContext.js +34 -31
- package/dist/cjs/messages.js +44 -76
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/index.js +1 -1
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +6 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +2 -2
- 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/FlexibleCard/utils.js +1 -1
- 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/extractors/common/context/extractAccessContext.js +35 -31
- package/dist/es2019/messages.js +44 -76
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/index.js +1 -1
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +5 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +2 -2
- 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/FlexibleCard/utils.js +1 -1
- 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/extractors/common/context/extractAccessContext.js +34 -31
- package/dist/esm/messages.js +44 -76
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/index.js +1 -1
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +6 -2
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +2 -2
- 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/FlexibleCard/utils.js +1 -1
- 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/extractors/common/context/extractAccessContext.d.ts +2 -2
- package/dist/types/messages.d.ts +2 -2
- 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/extractors/common/context/extractAccessContext.d.ts +2 -2
- package/dist/types-ts4.5/messages.d.ts +2 -2
- 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,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 {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
4
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { Box, Inline } from '@atlaskit/primitives';
|
|
7
|
+
import { ActionName, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
7
8
|
import ActionGroup from '../../action-group';
|
|
8
9
|
import Block from '../../block';
|
|
9
10
|
import ElementGroup from '../../element-group';
|
|
10
|
-
import
|
|
11
|
+
import AIStateIndicator from '../ai-state-indicator';
|
|
12
|
+
import { renderElementItems } from '../../utils';
|
|
11
13
|
import { messages } from '../../../../../../messages';
|
|
12
14
|
import AiIcon from '../../../../../common/ai-icon';
|
|
13
15
|
var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
@@ -19,29 +21,32 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
19
21
|
onAIActionChange = props.onAIActionChange,
|
|
20
22
|
_props$size = props.size,
|
|
21
23
|
size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size;
|
|
22
|
-
var
|
|
24
|
+
var _useState = useState('ready'),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
aiState = _useState2[0],
|
|
27
|
+
setAIState = _useState2[1];
|
|
23
28
|
var metadataElements = renderElementItems(metadata);
|
|
24
29
|
var onAIActionClick = useCallback(function () {
|
|
30
|
+
setAIState('loading');
|
|
25
31
|
if (onAIActionChange) {
|
|
26
|
-
onAIActionChange();
|
|
32
|
+
onAIActionChange('loading');
|
|
27
33
|
}
|
|
28
34
|
}, [onAIActionChange]);
|
|
29
35
|
var combinedActions = useMemo(function () {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, [combinedActions, context]);
|
|
36
|
+
if (aiState === 'ready') {
|
|
37
|
+
var aiAction = {
|
|
38
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summarize),
|
|
39
|
+
name: ActionName.CustomAction,
|
|
40
|
+
onClick: onAIActionClick,
|
|
41
|
+
testId: "".concat(testId, "-ai-summary-action"),
|
|
42
|
+
icon: /*#__PURE__*/React.createElement(AiIcon, {
|
|
43
|
+
label: "AiIcon"
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
return [aiAction].concat(_toConsumableArray(actions));
|
|
47
|
+
}
|
|
48
|
+
return actions;
|
|
49
|
+
}, [actions, aiState, onAIActionClick, testId]);
|
|
45
50
|
var onDropdownOpenChange = useCallback(function (isOpen) {
|
|
46
51
|
if (onActionMenuOpenChange) {
|
|
47
52
|
onActionMenuOpenChange({
|
|
@@ -51,17 +56,21 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
51
56
|
}, [onActionMenuOpenChange]);
|
|
52
57
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
53
58
|
testId: "".concat(testId, "-resolved-view")
|
|
54
|
-
}), /*#__PURE__*/React.createElement(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
}), /*#__PURE__*/React.createElement(Inline, {
|
|
60
|
+
alignBlock: "center",
|
|
61
|
+
alignInline: "end",
|
|
62
|
+
grow: "fill",
|
|
63
|
+
spread: "space-between"
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Box, null, aiState === 'loading' || aiState === 'done' ? /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
65
|
+
state: aiState,
|
|
66
|
+
testId: testId
|
|
67
|
+
}) : /*#__PURE__*/React.createElement(ElementGroup, {
|
|
68
|
+
width: SmartLinkWidth.FitToContent
|
|
69
|
+
}, metadataElements)), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
62
70
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
63
71
|
items: combinedActions,
|
|
64
|
-
appearance: "default"
|
|
65
|
-
|
|
72
|
+
appearance: "default",
|
|
73
|
+
size: size
|
|
74
|
+
}))));
|
|
66
75
|
};
|
|
67
76
|
export default AISummaryBlockResolvedView;
|
|
@@ -72,7 +72,7 @@ export var getRetryOptions = function getRetryOptions(url, status, response, onA
|
|
|
72
72
|
var access = extractRequestAccessContext({
|
|
73
73
|
jsonLd: meta,
|
|
74
74
|
url: url,
|
|
75
|
-
|
|
75
|
+
product: context
|
|
76
76
|
});
|
|
77
77
|
var messageKey = getForbiddenMessageKey(meta);
|
|
78
78
|
var descriptor = messages[messageKey];
|
|
@@ -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.46.
|
|
13
|
+
packageVersion: "26.46.4",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx, keyframes } from '@emotion/react';
|
|
5
|
+
import SVG from '@atlaskit/icon/svg';
|
|
6
|
+
import { aiThemeTokens } from '../ai-prism/constants';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The bulk of this file is originally from
|
|
10
|
+
* https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
|
|
11
|
+
* with modifications
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var bounce = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n transform: translateY(0);\n }\n\n // 200ms of 1200ms = 16.67%\n 16.67% {\n transform: translateY(-2px);\n }\n\n // 400ms of 1200ms = 33.33%\n 33.33% {\n transform: translateY(0px);\n }\n"])));
|
|
15
|
+
var BASE_DELAY = 400;
|
|
16
|
+
var QUEUE_DELAY = 200;
|
|
17
|
+
var animationStyles = css({
|
|
18
|
+
animation: "".concat(bounce, " 1.2s linear infinite normal")
|
|
19
|
+
});
|
|
20
|
+
var firstDelayStyles = css({
|
|
21
|
+
animationDelay: "".concat(BASE_DELAY + QUEUE_DELAY, "ms")
|
|
22
|
+
});
|
|
23
|
+
var secondDelayStyles = css({
|
|
24
|
+
animationDelay: "".concat(BASE_DELAY + QUEUE_DELAY * 2, "ms")
|
|
25
|
+
});
|
|
26
|
+
var thirdDelayStyles = css({
|
|
27
|
+
animationDelay: "".concat(BASE_DELAY + QUEUE_DELAY * 3, "ms")
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* this icon is theme agnostic, no need for tokens
|
|
32
|
+
*/
|
|
33
|
+
var AIIconLoading = function AIIconLoading(props) {
|
|
34
|
+
return jsx(SVG, props, jsx("circle", {
|
|
35
|
+
css: [animationStyles, firstDelayStyles],
|
|
36
|
+
cx: "6",
|
|
37
|
+
cy: "12",
|
|
38
|
+
r: "1.5",
|
|
39
|
+
fill: aiThemeTokens.blue700
|
|
40
|
+
}), jsx("circle", {
|
|
41
|
+
css: [animationStyles, secondDelayStyles],
|
|
42
|
+
cx: "12",
|
|
43
|
+
cy: "12",
|
|
44
|
+
r: "1.5",
|
|
45
|
+
fill: aiThemeTokens.blue600
|
|
46
|
+
}), jsx("circle", {
|
|
47
|
+
css: [animationStyles, thirdDelayStyles],
|
|
48
|
+
cx: "17.5",
|
|
49
|
+
cy: "12",
|
|
50
|
+
r: "1.5",
|
|
51
|
+
fill: aiThemeTokens.blue500
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
export default AIIconLoading;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const CONTENT_URL_SECURITY_AND_PERMISSIONS = "https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links";
|
|
2
2
|
export declare const CONTENT_URL_3P_ACCOUNT_AUTH = "https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/";
|
|
3
|
+
export declare const CONTENT_URL_AI = "https://www.atlassian.com/trust/atlassian-intelligence";
|
|
3
4
|
/**
|
|
4
5
|
* The alignment of Flexible UI component.
|
|
5
6
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { RequestAccessContextProps } from '../../../view/types';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
export declare const extractRequestAccessContext: ({ jsonLd, url,
|
|
4
|
+
export declare const extractRequestAccessContext: ({ jsonLd, url, product, }: {
|
|
5
5
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
6
6
|
url: string;
|
|
7
|
-
|
|
7
|
+
product?: string | undefined;
|
|
8
8
|
}) => RequestAccessContextProps;
|
|
9
9
|
export declare const extractRequestAccessContextImproved: ({ jsonLd, url, product, createAnalyticsEvent, }: {
|
|
10
10
|
jsonLd: JsonLd.Meta.BaseMeta;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
|
-
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | '
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'follow' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
2
|
+
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_info' | 'ai_summarizing' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'follow' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TooltipProps } from '@atlaskit/tooltip';
|
|
3
|
+
import type { AIState } from '../types';
|
|
4
|
+
export type AIStateAppearance = 'default' | 'icon-only';
|
|
5
|
+
export type AIStateIndicatorProps = {
|
|
6
|
+
appearance?: AIStateAppearance;
|
|
7
|
+
state: AIState;
|
|
8
|
+
testId?: string;
|
|
9
|
+
};
|
|
10
|
+
export type AIIndicatorContainerProps = {
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
content?: React.ReactNode;
|
|
13
|
+
testId?: string;
|
|
14
|
+
};
|
|
15
|
+
export type AIIndicatorTooltipProps = {
|
|
16
|
+
content: TooltipProps['content'];
|
|
17
|
+
trigger: React.ReactNode;
|
|
18
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActionItem, BlockProps, ElementItem } from '../types';
|
|
2
2
|
import { OnActionMenuOpenChangeOptions } from '../types';
|
|
3
|
+
export type AIState = 'ready' | 'loading' | 'error' | 'done';
|
|
3
4
|
export type AISummaryBlockProps = {
|
|
4
5
|
/**
|
|
5
6
|
* An array of actions to be displayed on the right
|
|
@@ -19,5 +20,5 @@ export type AISummaryBlockProps = {
|
|
|
19
20
|
/**
|
|
20
21
|
* Function to be called when AI Summary state changed.
|
|
21
22
|
*/
|
|
22
|
-
onAIActionChange?: () => void;
|
|
23
|
+
onAIActionChange?: (state: AIState) => void;
|
|
23
24
|
} & BlockProps;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const CONTENT_URL_SECURITY_AND_PERMISSIONS = "https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links";
|
|
2
2
|
export declare const CONTENT_URL_3P_ACCOUNT_AUTH = "https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/";
|
|
3
|
+
export declare const CONTENT_URL_AI = "https://www.atlassian.com/trust/atlassian-intelligence";
|
|
3
4
|
/**
|
|
4
5
|
* The alignment of Flexible UI component.
|
|
5
6
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { RequestAccessContextProps } from '../../../view/types';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
-
export declare const extractRequestAccessContext: ({ jsonLd, url,
|
|
4
|
+
export declare const extractRequestAccessContext: ({ jsonLd, url, product, }: {
|
|
5
5
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
6
6
|
url: string;
|
|
7
|
-
|
|
7
|
+
product?: string | undefined;
|
|
8
8
|
}) => RequestAccessContextProps;
|
|
9
9
|
export declare const extractRequestAccessContextImproved: ({ jsonLd, url, product, createAnalyticsEvent, }: {
|
|
10
10
|
jsonLd: JsonLd.Meta.BaseMeta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
|
-
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | '
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'follow' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
2
|
+
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_info' | 'ai_summarizing' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'follow' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { TooltipProps } from '@atlaskit/tooltip';
|
|
3
|
+
import type { AIState } from '../types';
|
|
4
|
+
export type AIStateAppearance = 'default' | 'icon-only';
|
|
5
|
+
export type AIStateIndicatorProps = {
|
|
6
|
+
appearance?: AIStateAppearance;
|
|
7
|
+
state: AIState;
|
|
8
|
+
testId?: string;
|
|
9
|
+
};
|
|
10
|
+
export type AIIndicatorContainerProps = {
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
content?: React.ReactNode;
|
|
13
|
+
testId?: string;
|
|
14
|
+
};
|
|
15
|
+
export type AIIndicatorTooltipProps = {
|
|
16
|
+
content: TooltipProps['content'];
|
|
17
|
+
trigger: React.ReactNode;
|
|
18
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActionItem, BlockProps, ElementItem } from '../types';
|
|
2
2
|
import { OnActionMenuOpenChangeOptions } from '../types';
|
|
3
|
+
export type AIState = 'ready' | 'loading' | 'error' | 'done';
|
|
3
4
|
export type AISummaryBlockProps = {
|
|
4
5
|
/**
|
|
5
6
|
* An array of actions to be displayed on the right
|
|
@@ -19,5 +20,5 @@ export type AISummaryBlockProps = {
|
|
|
19
20
|
/**
|
|
20
21
|
* Function to be called when AI Summary state changed.
|
|
21
22
|
*/
|
|
22
|
-
onAIActionChange?: () => void;
|
|
23
|
+
onAIActionChange?: (state: AIState) => void;
|
|
23
24
|
} & BlockProps;
|