@atlaskit/smart-card 43.24.2 → 43.24.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 +8 -0
- package/dist/cjs/state/hooks/use-rovo-chat/index.js +43 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/hooks/use-rovo-chat/index.js +32 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/hooks/use-rovo-chat/index.js +36 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/hooks/use-rovo-chat/index.d.ts +5 -0
- package/dist/types-ts4.5/state/hooks/use-rovo-chat/index.d.ts +5 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 43.24.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6fbe52a1fd019`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6fbe52a1fd019) -
|
|
8
|
+
Add hook to send prompt message to Rovo Chat
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 43.24.2
|
|
4
12
|
|
|
5
13
|
### 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.
|
|
14
|
+
packageVersion: "43.24.2"
|
|
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.
|
|
25
|
+
packageVersion: "43.24.2",
|
|
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.
|
|
5
|
+
packageVersion: "43.24.2"
|
|
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.
|
|
15
|
+
packageVersion: "43.24.2",
|
|
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.
|
|
7
|
+
packageVersion: "43.24.2"
|
|
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.
|
|
18
|
+
packageVersion: "43.24.2",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.24.
|
|
3
|
+
"version": "43.24.3",
|
|
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.
|
|
67
|
+
"@atlaskit/react-ufo": "^5.2.0",
|
|
68
|
+
"@atlaskit/rovo-triggers": "^5.12.0",
|
|
68
69
|
"@atlaskit/section-message": "^8.12.0",
|
|
69
70
|
"@atlaskit/select": "^21.7.0",
|
|
70
71
|
"@atlaskit/spinner": "^19.0.0",
|