@atlaskit/rovo-agent-components 1.5.0 → 1.6.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/rovo-agent-components
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#143665](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/143665)
8
+ [`5b80eb79ccf08`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5b80eb79ccf08) -
9
+ Add browse agents chat pill
10
+
3
11
  ## 1.5.0
4
12
 
5
13
  ### Minor Changes
@@ -4,12 +4,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.ChatPill = void 0;
7
+ exports.ChatPill = exports.BrowseAgentsPill = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
+ var _reactIntlNext = require("react-intl-next");
12
+ var _aiAgent = _interopRequireDefault(require("@atlaskit/icon/core/ai-agent"));
11
13
  var _primitives = require("@atlaskit/primitives");
12
14
  var _chatIcon = require("../chat-icon");
15
+ var _messages = _interopRequireDefault(require("./messages"));
13
16
  var _excluded = ["children", "whiteSpacePreWrap"];
14
17
  var buttonStyles = (0, _primitives.xcss)({
15
18
  color: 'color.text',
@@ -55,4 +58,21 @@ var ChatPill = exports.ChatPill = /*#__PURE__*/_react.default.forwardRef(functio
55
58
  }, /*#__PURE__*/_react.default.createElement(_chatIcon.ChatPillIcon, null), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
56
59
  xcss: [queryTextStyles, whiteSpacePreWrap && whiteSpacePreWrapStyles]
57
60
  }, children)));
61
+ });
62
+ var BrowseAgentsPill = exports.BrowseAgentsPill = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
63
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
64
+ formatMessage = _useIntl.formatMessage;
65
+ return /*#__PURE__*/_react.default.createElement(_primitives.Pressable, (0, _extends2.default)({
66
+ ref: ref
67
+ }, props, {
68
+ xcss: buttonStyles
69
+ }), /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
70
+ space: "space.050",
71
+ xcss: buttonInlineStyles
72
+ }, /*#__PURE__*/_react.default.createElement(_aiAgent.default, {
73
+ color: "currentColor",
74
+ label: ""
75
+ }), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
76
+ xcss: queryTextStyles
77
+ }, formatMessage(_messages.default.browseAgentsPillLabel))));
58
78
  });
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var _default = exports.default = (0, _reactIntlNext.defineMessages)({
9
+ browseAgentsPillLabel: {
10
+ id: 'ai-mate.rovo-agent-components.browse-agents-pill.label',
11
+ defaultMessage: 'Browse Agents',
12
+ description: 'The label displayed on the browse agents pill'
13
+ }
14
+ });
package/dist/cjs/index.js CHANGED
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "AgentStarCount", {
39
39
  return _agentProfileInfo.AgentStarCount;
40
40
  }
41
41
  });
42
+ Object.defineProperty(exports, "BrowseAgentsPill", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _chatPill.BrowseAgentsPill;
46
+ }
47
+ });
42
48
  Object.defineProperty(exports, "ChatPill", {
43
49
  enumerable: true,
44
50
  get: function get() {
@@ -68,7 +68,8 @@ var ConversationStarters = exports.ConversationStarters = function ConversationS
68
68
  _ref3$showReloadButto = _ref3.showReloadButton,
69
69
  showReloadButton = _ref3$showReloadButto === void 0 ? false : _ref3$showReloadButto,
70
70
  _ref3$onReloadButtonC = _ref3.onReloadButtonClick,
71
- onReloadButtonClick = _ref3$onReloadButtonC === void 0 ? function () {} : _ref3$onReloadButtonC;
71
+ onReloadButtonClick = _ref3$onReloadButtonC === void 0 ? function () {} : _ref3$onReloadButtonC,
72
+ onBrowseAgentsClick = _ref3.onBrowseAgentsClick;
72
73
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, starters.map(function (starter, index) {
73
74
  var isLastStarter = index === starters.length - 1;
74
75
  var chatPill = /*#__PURE__*/_react.default.createElement(_chatPill.ChatPill, {
@@ -89,5 +90,7 @@ var ConversationStarters = exports.ConversationStarters = function ConversationS
89
90
  appearance: "subtle",
90
91
  label: ""
91
92
  })) : chatPill;
93
+ }), !!onBrowseAgentsClick && /*#__PURE__*/_react.default.createElement(_chatPill.BrowseAgentsPill, {
94
+ onClick: onBrowseAgentsClick
92
95
  }));
93
96
  };
@@ -1,7 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { useIntl } from 'react-intl-next';
4
+ import AgentIcon from '@atlaskit/icon/core/ai-agent';
3
5
  import { Box, Inline, Pressable, xcss } from '@atlaskit/primitives';
4
6
  import { ChatPillIcon } from '../chat-icon';
7
+ import messages from './messages';
5
8
  const buttonStyles = xcss({
6
9
  color: 'color.text',
7
10
  padding: 'space.100',
@@ -44,4 +47,22 @@ export const ChatPill = /*#__PURE__*/React.forwardRef(({
44
47
  xcss: buttonInlineStyles
45
48
  }, /*#__PURE__*/React.createElement(ChatPillIcon, null), /*#__PURE__*/React.createElement(Box, {
46
49
  xcss: [queryTextStyles, whiteSpacePreWrap && whiteSpacePreWrapStyles]
47
- }, children))));
50
+ }, children))));
51
+ export const BrowseAgentsPill = /*#__PURE__*/React.forwardRef((props, ref) => {
52
+ const {
53
+ formatMessage
54
+ } = useIntl();
55
+ return /*#__PURE__*/React.createElement(Pressable, _extends({
56
+ ref: ref
57
+ }, props, {
58
+ xcss: buttonStyles
59
+ }), /*#__PURE__*/React.createElement(Inline, {
60
+ space: "space.050",
61
+ xcss: buttonInlineStyles
62
+ }, /*#__PURE__*/React.createElement(AgentIcon, {
63
+ color: "currentColor",
64
+ label: ""
65
+ }), /*#__PURE__*/React.createElement(Box, {
66
+ xcss: queryTextStyles
67
+ }, formatMessage(messages.browseAgentsPillLabel))));
68
+ });
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export default defineMessages({
3
+ browseAgentsPillLabel: {
4
+ id: 'ai-mate.rovo-agent-components.browse-agents-pill.label',
5
+ defaultMessage: 'Browse Agents',
6
+ description: 'The label displayed on the browse agents pill'
7
+ }
8
+ });
@@ -1,7 +1,7 @@
1
1
  export { AgentProfileInfo, AgentProfileCreator, AgentStarCount } from './ui/agent-profile-info';
2
2
  export { StarIconButton } from './common/ui/star-icon-button';
3
3
  export { AgentConversationStarters, ConversationStarters, getConversationStarters } from './ui/agent-conversation-starters';
4
- export { ChatPill } from './common/ui/chat-pill';
4
+ export { ChatPill, BrowseAgentsPill } from './common/ui/chat-pill';
5
5
  export { ChatPillIcon } from './common/ui/chat-icon';
6
6
  export { ShowIcon } from './common/ui/show-icon';
7
7
  export { HiddenIcon } from './common/ui/hidden-icon';
@@ -4,7 +4,7 @@ import { useIntl } from 'react-intl-next';
4
4
  import { IconButton } from '@atlaskit/button/new';
5
5
  import RetryIcon from '@atlaskit/icon/core/retry';
6
6
  import { Inline } from '@atlaskit/primitives';
7
- import { ChatPill } from '../../common/ui/chat-pill';
7
+ import { BrowseAgentsPill, ChatPill } from '../../common/ui/chat-pill';
8
8
  import { messages } from './messages';
9
9
  export const getConversationStarters = ({
10
10
  userDefinedConversationStarters: userDefinedConversationStartersParam,
@@ -51,7 +51,8 @@ export const ConversationStarters = ({
51
51
  starters,
52
52
  onConversationStarterClick,
53
53
  showReloadButton = false,
54
- onReloadButtonClick = () => {}
54
+ onReloadButtonClick = () => {},
55
+ onBrowseAgentsClick
55
56
  }) => {
56
57
  return /*#__PURE__*/React.createElement(React.Fragment, null, starters.map((starter, index) => {
57
58
  const isLastStarter = index === starters.length - 1;
@@ -71,5 +72,7 @@ export const ConversationStarters = ({
71
72
  appearance: "subtle",
72
73
  label: ""
73
74
  })) : chatPill;
75
+ }), !!onBrowseAgentsClick && /*#__PURE__*/React.createElement(BrowseAgentsPill, {
76
+ onClick: onBrowseAgentsClick
74
77
  }));
75
78
  };
@@ -2,8 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["children", "whiteSpacePreWrap"];
4
4
  import React from 'react';
5
+ import { useIntl } from 'react-intl-next';
6
+ import AgentIcon from '@atlaskit/icon/core/ai-agent';
5
7
  import { Box, Inline, Pressable, xcss } from '@atlaskit/primitives';
6
8
  import { ChatPillIcon } from '../chat-icon';
9
+ import messages from './messages';
7
10
  var buttonStyles = xcss({
8
11
  color: 'color.text',
9
12
  padding: 'space.100',
@@ -48,4 +51,21 @@ export var ChatPill = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
48
51
  }, /*#__PURE__*/React.createElement(ChatPillIcon, null), /*#__PURE__*/React.createElement(Box, {
49
52
  xcss: [queryTextStyles, whiteSpacePreWrap && whiteSpacePreWrapStyles]
50
53
  }, children)));
54
+ });
55
+ export var BrowseAgentsPill = /*#__PURE__*/React.forwardRef(function (props, ref) {
56
+ var _useIntl = useIntl(),
57
+ formatMessage = _useIntl.formatMessage;
58
+ return /*#__PURE__*/React.createElement(Pressable, _extends({
59
+ ref: ref
60
+ }, props, {
61
+ xcss: buttonStyles
62
+ }), /*#__PURE__*/React.createElement(Inline, {
63
+ space: "space.050",
64
+ xcss: buttonInlineStyles
65
+ }, /*#__PURE__*/React.createElement(AgentIcon, {
66
+ color: "currentColor",
67
+ label: ""
68
+ }), /*#__PURE__*/React.createElement(Box, {
69
+ xcss: queryTextStyles
70
+ }, formatMessage(messages.browseAgentsPillLabel))));
51
71
  });
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export default defineMessages({
3
+ browseAgentsPillLabel: {
4
+ id: 'ai-mate.rovo-agent-components.browse-agents-pill.label',
5
+ defaultMessage: 'Browse Agents',
6
+ description: 'The label displayed on the browse agents pill'
7
+ }
8
+ });
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { AgentProfileInfo, AgentProfileCreator, AgentStarCount } from './ui/agent-profile-info';
2
2
  export { StarIconButton } from './common/ui/star-icon-button';
3
3
  export { AgentConversationStarters, ConversationStarters, getConversationStarters } from './ui/agent-conversation-starters';
4
- export { ChatPill } from './common/ui/chat-pill';
4
+ export { ChatPill, BrowseAgentsPill } from './common/ui/chat-pill';
5
5
  export { ChatPillIcon } from './common/ui/chat-icon';
6
6
  export { ShowIcon } from './common/ui/show-icon';
7
7
  export { HiddenIcon } from './common/ui/hidden-icon';
@@ -7,7 +7,7 @@ import { useIntl } from 'react-intl-next';
7
7
  import { IconButton } from '@atlaskit/button/new';
8
8
  import RetryIcon from '@atlaskit/icon/core/retry';
9
9
  import { Inline } from '@atlaskit/primitives';
10
- import { ChatPill } from '../../common/ui/chat-pill';
10
+ import { BrowseAgentsPill, ChatPill } from '../../common/ui/chat-pill';
11
11
  import { messages } from './messages';
12
12
  export var getConversationStarters = function getConversationStarters(_ref) {
13
13
  var userDefinedConversationStartersParam = _ref.userDefinedConversationStarters,
@@ -58,7 +58,8 @@ export var ConversationStarters = function ConversationStarters(_ref3) {
58
58
  _ref3$showReloadButto = _ref3.showReloadButton,
59
59
  showReloadButton = _ref3$showReloadButto === void 0 ? false : _ref3$showReloadButto,
60
60
  _ref3$onReloadButtonC = _ref3.onReloadButtonClick,
61
- onReloadButtonClick = _ref3$onReloadButtonC === void 0 ? function () {} : _ref3$onReloadButtonC;
61
+ onReloadButtonClick = _ref3$onReloadButtonC === void 0 ? function () {} : _ref3$onReloadButtonC,
62
+ onBrowseAgentsClick = _ref3.onBrowseAgentsClick;
62
63
  return /*#__PURE__*/React.createElement(React.Fragment, null, starters.map(function (starter, index) {
63
64
  var isLastStarter = index === starters.length - 1;
64
65
  var chatPill = /*#__PURE__*/React.createElement(ChatPill, {
@@ -79,5 +80,7 @@ export var ConversationStarters = function ConversationStarters(_ref3) {
79
80
  appearance: "subtle",
80
81
  label: ""
81
82
  })) : chatPill;
83
+ }), !!onBrowseAgentsClick && /*#__PURE__*/React.createElement(BrowseAgentsPill, {
84
+ onClick: onBrowseAgentsClick
82
85
  }));
83
86
  };
@@ -6,3 +6,5 @@ export type ChatPillProps = Omit<ButtonProps, 'iconBefore'> & {
6
6
  export declare const ChatPill: React.ForwardRefExoticComponent<Omit<ButtonProps, "iconBefore"> & {
7
7
  whiteSpacePreWrap?: boolean | undefined;
8
8
  } & React.RefAttributes<HTMLButtonElement>>;
9
+ export type BrowseAgentsPillProps = Omit<ButtonProps, 'iconBefore' | 'children'>;
10
+ export declare const BrowseAgentsPill: React.ForwardRefExoticComponent<BrowseAgentsPillProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ browseAgentsPillLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -1,7 +1,8 @@
1
1
  export { AgentProfileInfo, AgentProfileCreator, AgentStarCount } from './ui/agent-profile-info';
2
2
  export { StarIconButton } from './common/ui/star-icon-button';
3
3
  export { AgentConversationStarters, ConversationStarters, type AgentConversationStartersProps, type ConversationStartersProps, getConversationStarters, } from './ui/agent-conversation-starters';
4
- export { ChatPill, type ChatPillProps } from './common/ui/chat-pill';
4
+ export { ChatPill, type ChatPillProps, BrowseAgentsPill } from './common/ui/chat-pill';
5
+ export type { BrowseAgentsPillProps } from './common/ui/chat-pill';
5
6
  export { ChatPillIcon } from './common/ui/chat-icon';
6
7
  export { ShowIcon } from './common/ui/show-icon';
7
8
  export { HiddenIcon } from './common/ui/hidden-icon';
@@ -21,6 +21,7 @@ export type ConversationStartersProps = {
21
21
  onConversationStarterClick: (conversationStarter: string) => void;
22
22
  showReloadButton?: boolean;
23
23
  onReloadButtonClick?: () => void;
24
+ onBrowseAgentsClick?: () => void;
24
25
  };
25
- export declare const ConversationStarters: ({ starters, onConversationStarterClick, showReloadButton, onReloadButtonClick, }: ConversationStartersProps) => JSX.Element;
26
+ export declare const ConversationStarters: ({ starters, onConversationStarterClick, showReloadButton, onReloadButtonClick, onBrowseAgentsClick, }: ConversationStartersProps) => JSX.Element;
26
27
  export {};
@@ -6,3 +6,5 @@ export type ChatPillProps = Omit<ButtonProps, 'iconBefore'> & {
6
6
  export declare const ChatPill: React.ForwardRefExoticComponent<Omit<ButtonProps, "iconBefore"> & {
7
7
  whiteSpacePreWrap?: boolean | undefined;
8
8
  } & React.RefAttributes<HTMLButtonElement>>;
9
+ export type BrowseAgentsPillProps = Omit<ButtonProps, 'iconBefore' | 'children'>;
10
+ export declare const BrowseAgentsPill: React.ForwardRefExoticComponent<BrowseAgentsPillProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ browseAgentsPillLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -1,7 +1,8 @@
1
1
  export { AgentProfileInfo, AgentProfileCreator, AgentStarCount } from './ui/agent-profile-info';
2
2
  export { StarIconButton } from './common/ui/star-icon-button';
3
3
  export { AgentConversationStarters, ConversationStarters, type AgentConversationStartersProps, type ConversationStartersProps, getConversationStarters, } from './ui/agent-conversation-starters';
4
- export { ChatPill, type ChatPillProps } from './common/ui/chat-pill';
4
+ export { ChatPill, type ChatPillProps, BrowseAgentsPill } from './common/ui/chat-pill';
5
+ export type { BrowseAgentsPillProps } from './common/ui/chat-pill';
5
6
  export { ChatPillIcon } from './common/ui/chat-icon';
6
7
  export { ShowIcon } from './common/ui/show-icon';
7
8
  export { HiddenIcon } from './common/ui/hidden-icon';
@@ -21,6 +21,7 @@ export type ConversationStartersProps = {
21
21
  onConversationStarterClick: (conversationStarter: string) => void;
22
22
  showReloadButton?: boolean;
23
23
  onReloadButtonClick?: () => void;
24
+ onBrowseAgentsClick?: () => void;
24
25
  };
25
- export declare const ConversationStarters: ({ starters, onConversationStarterClick, showReloadButton, onReloadButtonClick, }: ConversationStartersProps) => JSX.Element;
26
+ export declare const ConversationStarters: ({ starters, onConversationStarterClick, showReloadButton, onReloadButtonClick, onBrowseAgentsClick, }: ConversationStartersProps) => JSX.Element;
26
27
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-agent-components",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
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",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@atlaskit/avatar": "^21.15.0",
39
- "@atlaskit/button": "^20.1.0",
39
+ "@atlaskit/button": "^20.2.0",
40
40
  "@atlaskit/heading": "^2.4.3",
41
41
  "@atlaskit/icon": "^22.18.0",
42
42
  "@atlaskit/logo": "^14.3.0",