@atlaskit/rovo-agent-components 0.4.1 → 0.4.2

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/rovo-agent-components
2
2
 
3
+ ## 0.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#132411](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/132411)
8
+ [`097911d8bb135`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/097911d8bb135) -
9
+ Added hidden icon to agent profile
10
+
3
11
  ## 0.4.1
4
12
 
5
13
  ### Patch Changes
@@ -12,6 +12,8 @@ var _star = _interopRequireDefault(require("@atlaskit/icon/glyph/star"));
12
12
  var _logo = require("@atlaskit/logo");
13
13
  var _primitives = require("@atlaskit/primitives");
14
14
  var _skeleton = _interopRequireDefault(require("@atlaskit/skeleton"));
15
+ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
16
+ var _hiddenIcon = require("../../common/ui/hidden-icon");
15
17
  var _starIconButton = require("../../common/ui/star-icon-button");
16
18
  var _messages = require("./messages");
17
19
  var clickableItemStyles = (0, _primitives.xcss)({
@@ -117,13 +119,25 @@ var AgentStarCount = exports.AgentStarCount = function AgentStarCount(_ref2) {
117
119
  var wrapperStyles = (0, _primitives.xcss)({
118
120
  marginBottom: 'space.100'
119
121
  });
122
+ var tooltipWrapperStyles = (0, _primitives.xcss)({
123
+ display: 'inline-flex',
124
+ marginInline: 'space.100',
125
+ position: 'relative',
126
+ bottom: 'space.025'
127
+ });
128
+ var headingWrapperStyles = (0, _primitives.xcss)({
129
+ position: 'relative'
130
+ });
120
131
  var AgentProfileInfo = exports.AgentProfileInfo = function AgentProfileInfo(_ref3) {
121
132
  var agentName = _ref3.agentName,
122
133
  agentDescription = _ref3.agentDescription,
123
134
  creatorRender = _ref3.creatorRender,
124
135
  starCountRender = _ref3.starCountRender,
125
136
  isStarred = _ref3.isStarred,
137
+ isHidden = _ref3.isHidden,
126
138
  onStarToggle = _ref3.onStarToggle;
139
+ var _useIntl3 = (0, _reactIntlNext.useIntl)(),
140
+ formatMessage = _useIntl3.formatMessage;
127
141
  return /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
128
142
  space: "space.100",
129
143
  xcss: wrapperStyles
@@ -131,9 +145,19 @@ var AgentProfileInfo = exports.AgentProfileInfo = function AgentProfileInfo(_ref
131
145
  xcss: nameStyles,
132
146
  space: "space.100",
133
147
  alignBlock: "center"
148
+ }, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
149
+ xcss: headingWrapperStyles
134
150
  }, /*#__PURE__*/_react.default.createElement(_heading.default, {
151
+ as: "span",
135
152
  size: "xlarge"
136
- }, agentName), /*#__PURE__*/_react.default.createElement(_starIconButton.StarIconButton, {
153
+ }, agentName), isHidden && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
154
+ xcss: tooltipWrapperStyles
155
+ }, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
156
+ content: formatMessage(_messages.messages.hiddenTooltip),
157
+ position: "top"
158
+ }, /*#__PURE__*/_react.default.createElement(_hiddenIcon.HiddenIcon, {
159
+ label: formatMessage(_messages.messages.hiddenIcon)
160
+ })))), /*#__PURE__*/_react.default.createElement(_starIconButton.StarIconButton, {
137
161
  isStarred: isStarred,
138
162
  handleToggle: onStarToggle
139
163
  })), creatorRender, !!agentDescription && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
@@ -15,5 +15,20 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
15
15
  id: 'ai-mate.agent-profile-info.starred-count',
16
16
  defaultMessage: '{count} starred',
17
17
  description: 'Message to show how many times this agent has been starred by users'
18
+ },
19
+ hiddenIcon: {
20
+ id: 'ai-mate.agent-profile-info.hidden-icon',
21
+ defaultMessage: 'Hidden',
22
+ description: 'Icon to show that this agent is hidden'
23
+ },
24
+ hiddenTooltip: {
25
+ id: 'ai-mate.agent-profile-info.hidden-tooltip',
26
+ defaultMessage: "Agent won't show in search results",
27
+ description: 'Tooltip to explain what strikethough eye icon means'
28
+ },
29
+ starAgentTooltip: {
30
+ id: 'ai-mate.agent-profile-info.star-agent-tooltip',
31
+ defaultMessage: 'Star Agent',
32
+ description: 'Tooltip to explain what star icon does'
18
33
  }
19
34
  });
@@ -5,6 +5,8 @@ import StarIcon from '@atlaskit/icon/glyph/star';
5
5
  import { AtlassianIcon, RovoIcon } from '@atlaskit/logo';
6
6
  import { Box, Inline, Stack, xcss } from '@atlaskit/primitives';
7
7
  import Skeleton from '@atlaskit/skeleton';
8
+ import Tooltip from '@atlaskit/tooltip';
9
+ import { HiddenIcon } from '../../common/ui/hidden-icon';
8
10
  import { StarIconButton } from '../../common/ui/star-icon-button';
9
11
  import { messages } from './messages';
10
12
  const clickableItemStyles = xcss({
@@ -112,14 +114,27 @@ export const AgentStarCount = ({
112
114
  const wrapperStyles = xcss({
113
115
  marginBottom: 'space.100'
114
116
  });
117
+ const tooltipWrapperStyles = xcss({
118
+ display: 'inline-flex',
119
+ marginInline: 'space.100',
120
+ position: 'relative',
121
+ bottom: 'space.025'
122
+ });
123
+ const headingWrapperStyles = xcss({
124
+ position: 'relative'
125
+ });
115
126
  export const AgentProfileInfo = ({
116
127
  agentName,
117
128
  agentDescription,
118
129
  creatorRender,
119
130
  starCountRender,
120
131
  isStarred,
132
+ isHidden,
121
133
  onStarToggle
122
134
  }) => {
135
+ const {
136
+ formatMessage
137
+ } = useIntl();
123
138
  return /*#__PURE__*/React.createElement(Stack, {
124
139
  space: "space.100",
125
140
  xcss: wrapperStyles
@@ -127,9 +142,19 @@ export const AgentProfileInfo = ({
127
142
  xcss: nameStyles,
128
143
  space: "space.100",
129
144
  alignBlock: "center"
145
+ }, /*#__PURE__*/React.createElement(Box, {
146
+ xcss: headingWrapperStyles
130
147
  }, /*#__PURE__*/React.createElement(Heading, {
148
+ as: "span",
131
149
  size: "xlarge"
132
- }, agentName), /*#__PURE__*/React.createElement(StarIconButton, {
150
+ }, agentName), isHidden && /*#__PURE__*/React.createElement(Box, {
151
+ xcss: tooltipWrapperStyles
152
+ }, /*#__PURE__*/React.createElement(Tooltip, {
153
+ content: formatMessage(messages.hiddenTooltip),
154
+ position: "top"
155
+ }, /*#__PURE__*/React.createElement(HiddenIcon, {
156
+ label: formatMessage(messages.hiddenIcon)
157
+ })))), /*#__PURE__*/React.createElement(StarIconButton, {
133
158
  isStarred: isStarred,
134
159
  handleToggle: onStarToggle
135
160
  })), creatorRender, !!agentDescription && /*#__PURE__*/React.createElement(Box, {
@@ -9,5 +9,20 @@ export const messages = defineMessages({
9
9
  id: 'ai-mate.agent-profile-info.starred-count',
10
10
  defaultMessage: '{count} starred',
11
11
  description: 'Message to show how many times this agent has been starred by users'
12
+ },
13
+ hiddenIcon: {
14
+ id: 'ai-mate.agent-profile-info.hidden-icon',
15
+ defaultMessage: 'Hidden',
16
+ description: 'Icon to show that this agent is hidden'
17
+ },
18
+ hiddenTooltip: {
19
+ id: 'ai-mate.agent-profile-info.hidden-tooltip',
20
+ defaultMessage: "Agent won't show in search results",
21
+ description: 'Tooltip to explain what strikethough eye icon means'
22
+ },
23
+ starAgentTooltip: {
24
+ id: 'ai-mate.agent-profile-info.star-agent-tooltip',
25
+ defaultMessage: 'Star Agent',
26
+ description: 'Tooltip to explain what star icon does'
12
27
  }
13
28
  });
@@ -5,6 +5,8 @@ import StarIcon from '@atlaskit/icon/glyph/star';
5
5
  import { AtlassianIcon, RovoIcon } from '@atlaskit/logo';
6
6
  import { Box, Inline, Stack, xcss } from '@atlaskit/primitives';
7
7
  import Skeleton from '@atlaskit/skeleton';
8
+ import Tooltip from '@atlaskit/tooltip';
9
+ import { HiddenIcon } from '../../common/ui/hidden-icon';
8
10
  import { StarIconButton } from '../../common/ui/star-icon-button';
9
11
  import { messages } from './messages';
10
12
  var clickableItemStyles = xcss({
@@ -110,13 +112,25 @@ export var AgentStarCount = function AgentStarCount(_ref2) {
110
112
  var wrapperStyles = xcss({
111
113
  marginBottom: 'space.100'
112
114
  });
115
+ var tooltipWrapperStyles = xcss({
116
+ display: 'inline-flex',
117
+ marginInline: 'space.100',
118
+ position: 'relative',
119
+ bottom: 'space.025'
120
+ });
121
+ var headingWrapperStyles = xcss({
122
+ position: 'relative'
123
+ });
113
124
  export var AgentProfileInfo = function AgentProfileInfo(_ref3) {
114
125
  var agentName = _ref3.agentName,
115
126
  agentDescription = _ref3.agentDescription,
116
127
  creatorRender = _ref3.creatorRender,
117
128
  starCountRender = _ref3.starCountRender,
118
129
  isStarred = _ref3.isStarred,
130
+ isHidden = _ref3.isHidden,
119
131
  onStarToggle = _ref3.onStarToggle;
132
+ var _useIntl3 = useIntl(),
133
+ formatMessage = _useIntl3.formatMessage;
120
134
  return /*#__PURE__*/React.createElement(Stack, {
121
135
  space: "space.100",
122
136
  xcss: wrapperStyles
@@ -124,9 +138,19 @@ export var AgentProfileInfo = function AgentProfileInfo(_ref3) {
124
138
  xcss: nameStyles,
125
139
  space: "space.100",
126
140
  alignBlock: "center"
141
+ }, /*#__PURE__*/React.createElement(Box, {
142
+ xcss: headingWrapperStyles
127
143
  }, /*#__PURE__*/React.createElement(Heading, {
144
+ as: "span",
128
145
  size: "xlarge"
129
- }, agentName), /*#__PURE__*/React.createElement(StarIconButton, {
146
+ }, agentName), isHidden && /*#__PURE__*/React.createElement(Box, {
147
+ xcss: tooltipWrapperStyles
148
+ }, /*#__PURE__*/React.createElement(Tooltip, {
149
+ content: formatMessage(messages.hiddenTooltip),
150
+ position: "top"
151
+ }, /*#__PURE__*/React.createElement(HiddenIcon, {
152
+ label: formatMessage(messages.hiddenIcon)
153
+ })))), /*#__PURE__*/React.createElement(StarIconButton, {
130
154
  isStarred: isStarred,
131
155
  handleToggle: onStarToggle
132
156
  })), creatorRender, !!agentDescription && /*#__PURE__*/React.createElement(Box, {
@@ -9,5 +9,20 @@ export var messages = defineMessages({
9
9
  id: 'ai-mate.agent-profile-info.starred-count',
10
10
  defaultMessage: '{count} starred',
11
11
  description: 'Message to show how many times this agent has been starred by users'
12
+ },
13
+ hiddenIcon: {
14
+ id: 'ai-mate.agent-profile-info.hidden-icon',
15
+ defaultMessage: 'Hidden',
16
+ description: 'Icon to show that this agent is hidden'
17
+ },
18
+ hiddenTooltip: {
19
+ id: 'ai-mate.agent-profile-info.hidden-tooltip',
20
+ defaultMessage: "Agent won't show in search results",
21
+ description: 'Tooltip to explain what strikethough eye icon means'
22
+ },
23
+ starAgentTooltip: {
24
+ id: 'ai-mate.agent-profile-info.star-agent-tooltip',
25
+ defaultMessage: 'Star Agent',
26
+ description: 'Tooltip to explain what star icon does'
12
27
  }
13
28
  });
@@ -17,11 +17,12 @@ export declare const AgentStarCount: ({ starCount, isLoading, }: {
17
17
  starCount: number | null | undefined;
18
18
  isLoading: boolean;
19
19
  }) => JSX.Element | null;
20
- export declare const AgentProfileInfo: ({ agentName, agentDescription, creatorRender, starCountRender, isStarred, onStarToggle, }: {
20
+ export declare const AgentProfileInfo: ({ agentName, agentDescription, creatorRender, starCountRender, isStarred, isHidden, onStarToggle, }: {
21
21
  agentName: string;
22
22
  agentDescription?: string | null | undefined;
23
23
  creatorRender: React.ReactNode;
24
24
  starCountRender: React.ReactNode;
25
25
  isStarred: boolean;
26
+ isHidden: boolean;
26
27
  onStarToggle: () => void;
27
28
  }) => JSX.Element;
@@ -9,4 +9,19 @@ export declare const messages: {
9
9
  defaultMessage: string;
10
10
  description: string;
11
11
  };
12
+ hiddenIcon: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ hiddenTooltip: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ starAgentTooltip: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
12
27
  };
@@ -17,11 +17,12 @@ export declare const AgentStarCount: ({ starCount, isLoading, }: {
17
17
  starCount: number | null | undefined;
18
18
  isLoading: boolean;
19
19
  }) => JSX.Element | null;
20
- export declare const AgentProfileInfo: ({ agentName, agentDescription, creatorRender, starCountRender, isStarred, onStarToggle, }: {
20
+ export declare const AgentProfileInfo: ({ agentName, agentDescription, creatorRender, starCountRender, isStarred, isHidden, onStarToggle, }: {
21
21
  agentName: string;
22
22
  agentDescription?: string | null | undefined;
23
23
  creatorRender: React.ReactNode;
24
24
  starCountRender: React.ReactNode;
25
25
  isStarred: boolean;
26
+ isHidden: boolean;
26
27
  onStarToggle: () => void;
27
28
  }) => JSX.Element;
@@ -9,4 +9,19 @@ export declare const messages: {
9
9
  defaultMessage: string;
10
10
  description: string;
11
11
  };
12
+ hiddenIcon: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ hiddenTooltip: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ starAgentTooltip: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
12
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-agent-components",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "This package host public components related to rovo agents, the components here are needed for other public atlaskit packages",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,6 +44,7 @@
44
44
  "@atlaskit/primitives": "^12.0.0",
45
45
  "@atlaskit/skeleton": "^0.5.0",
46
46
  "@atlaskit/tokens": "^1.59.0",
47
+ "@atlaskit/tooltip": "^18.7.0",
47
48
  "@babel/runtime": "^7.0.0",
48
49
  "react-intl-next": "npm:react-intl@^5.18.1"
49
50
  },