@atlaskit/smart-card 43.24.2 → 43.24.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 43.24.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 43.24.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`6fbe52a1fd019`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6fbe52a1fd019) -
14
+ Add hook to send prompt message to Rovo Chat
15
+ - Updated dependencies
16
+
3
17
  ## 43.24.2
4
18
 
5
19
  ### Patch Changes
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _react = require("react");
10
+ var _postMessageToPubsub = require("@atlaskit/rovo-triggers/post-message-to-pubsub");
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ var SMART_LINK_TO_ROVO_SOURCE = 'smart-link';
14
+ var useRovoChat = function useRovoChat() {
15
+ var _useRovoPostMessageTo = (0, _postMessageToPubsub.useRovoPostMessageToPubsub)(),
16
+ publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
17
+ var sendPromptMessage = (0, _react.useCallback)(function (data) {
18
+ var _window$parent;
19
+ publishWithPostMessage({
20
+ targetWindow: (_window$parent = window.parent) !== null && _window$parent !== void 0 ? _window$parent : window,
21
+ payload: {
22
+ type: 'chat-new',
23
+ source: SMART_LINK_TO_ROVO_SOURCE,
24
+ data: _objectSpread(_objectSpread({
25
+ dialogues: []
26
+ }, data), {}, {
27
+ agentId: undefined
28
+ }),
29
+ openChat: true,
30
+ openChatMode: 'sidebar'
31
+ },
32
+ onAcknowledgeTimeout: function onAcknowledgeTimeout() {
33
+ // NAVX-3599: Add analytics event
34
+ }
35
+ });
36
+ }, [publishWithPostMessage]);
37
+ return (0, _react.useMemo)(function () {
38
+ return {
39
+ sendPromptMessage: sendPromptMessage
40
+ };
41
+ }, [sendPromptMessage]);
42
+ };
43
+ var _default = exports.default = useRovoChat;
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "43.24.1"
14
+ packageVersion: "43.24.3"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
22
22
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
23
23
  var PACKAGE_DATA = {
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "43.24.1",
25
+ packageVersion: "43.24.3",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -0,0 +1,32 @@
1
+ import { useCallback, useMemo } from 'react';
2
+ import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
3
+ const SMART_LINK_TO_ROVO_SOURCE = 'smart-link';
4
+ const useRovoChat = () => {
5
+ const {
6
+ publishWithPostMessage
7
+ } = useRovoPostMessageToPubsub();
8
+ const sendPromptMessage = useCallback(data => {
9
+ var _window$parent;
10
+ publishWithPostMessage({
11
+ targetWindow: (_window$parent = window.parent) !== null && _window$parent !== void 0 ? _window$parent : window,
12
+ payload: {
13
+ type: 'chat-new',
14
+ source: SMART_LINK_TO_ROVO_SOURCE,
15
+ data: {
16
+ dialogues: [],
17
+ ...data,
18
+ agentId: undefined
19
+ },
20
+ openChat: true,
21
+ openChatMode: 'sidebar'
22
+ },
23
+ onAcknowledgeTimeout: () => {
24
+ // NAVX-3599: Add analytics event
25
+ }
26
+ });
27
+ }, [publishWithPostMessage]);
28
+ return useMemo(() => ({
29
+ sendPromptMessage
30
+ }), [sendPromptMessage]);
31
+ };
32
+ export default useRovoChat;
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "43.24.1"
5
+ packageVersion: "43.24.3"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  const PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "43.24.1",
15
+ packageVersion: "43.24.3",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -0,0 +1,36 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ import { useCallback, useMemo } from 'react';
5
+ import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
6
+ var SMART_LINK_TO_ROVO_SOURCE = 'smart-link';
7
+ var useRovoChat = function useRovoChat() {
8
+ var _useRovoPostMessageTo = useRovoPostMessageToPubsub(),
9
+ publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
10
+ var sendPromptMessage = useCallback(function (data) {
11
+ var _window$parent;
12
+ publishWithPostMessage({
13
+ targetWindow: (_window$parent = window.parent) !== null && _window$parent !== void 0 ? _window$parent : window,
14
+ payload: {
15
+ type: 'chat-new',
16
+ source: SMART_LINK_TO_ROVO_SOURCE,
17
+ data: _objectSpread(_objectSpread({
18
+ dialogues: []
19
+ }, data), {}, {
20
+ agentId: undefined
21
+ }),
22
+ openChat: true,
23
+ openChatMode: 'sidebar'
24
+ },
25
+ onAcknowledgeTimeout: function onAcknowledgeTimeout() {
26
+ // NAVX-3599: Add analytics event
27
+ }
28
+ });
29
+ }, [publishWithPostMessage]);
30
+ return useMemo(function () {
31
+ return {
32
+ sendPromptMessage: sendPromptMessage
33
+ };
34
+ }, [sendPromptMessage]);
35
+ };
36
+ export default useRovoChat;
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "43.24.1"
7
+ packageVersion: "43.24.3"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
15
15
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
16
16
  var PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "43.24.1",
18
+ packageVersion: "43.24.3",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -0,0 +1,5 @@
1
+ import type { ChatNewPayload } from '@atlaskit/rovo-triggers/types';
2
+ declare const useRovoChat: () => {
3
+ sendPromptMessage: (data: Partial<ChatNewPayload["data"]>) => void;
4
+ };
5
+ export default useRovoChat;
@@ -0,0 +1,5 @@
1
+ import type { ChatNewPayload } from '@atlaskit/rovo-triggers/types';
2
+ declare const useRovoChat: () => {
3
+ sendPromptMessage: (data: Partial<ChatNewPayload["data"]>) => void;
4
+ };
5
+ export default useRovoChat;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "43.24.2",
3
+ "version": "43.24.4",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -64,7 +64,8 @@
64
64
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
65
65
  "@atlaskit/popup": "^4.13.0",
66
66
  "@atlaskit/primitives": "^18.0.0",
67
- "@atlaskit/react-ufo": "^5.1.0",
67
+ "@atlaskit/react-ufo": "^5.2.0",
68
+ "@atlaskit/rovo-triggers": "^5.13.0",
68
69
  "@atlaskit/section-message": "^8.12.0",
69
70
  "@atlaskit/select": "^21.7.0",
70
71
  "@atlaskit/spinner": "^19.0.0",
@@ -72,7 +73,7 @@
72
73
  "@atlaskit/textfield": "^8.2.0",
73
74
  "@atlaskit/theme": "^21.0.0",
74
75
  "@atlaskit/tile": "^1.0.0",
75
- "@atlaskit/tmp-editor-statsig": "^23.0.0",
76
+ "@atlaskit/tmp-editor-statsig": "^24.0.0",
76
77
  "@atlaskit/tokens": "^11.0.0",
77
78
  "@atlaskit/tooltip": "^20.14.0",
78
79
  "@atlaskit/ufo": "^0.4.0",
@@ -91,7 +92,7 @@
91
92
  "uuid": "^3.1.0"
92
93
  },
93
94
  "peerDependencies": {
94
- "@atlaskit/link-provider": "^4.1.0",
95
+ "@atlaskit/link-provider": "^4.2.0",
95
96
  "react": "^18.2.0",
96
97
  "react-dom": "^18.2.0",
97
98
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -103,7 +104,7 @@
103
104
  "@atlaskit/css-reset": "^7.3.0",
104
105
  "@atlaskit/media-test-helpers": "^39.0.0",
105
106
  "@atlaskit/ssr": "workspace:^",
106
- "@atlassian/a11y-jest-testing": "^0.9.0",
107
+ "@atlassian/a11y-jest-testing": "^0.10.0",
107
108
  "@atlassian/analytics-tooling": "workspace:^",
108
109
  "@atlassian/feature-flags-test-utils": "^1.0.0",
109
110
  "@atlassian/gemini": "^1.33.0",