@atlaskit/profilecard 19.25.0 → 19.25.1
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/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +2 -2
- package/dist/cjs/components/common/PopupTrigger.js +6 -8
- package/dist/cjs/components/common/ProfileCardTrigger.js +1 -1
- package/dist/cjs/util/analytics.js +2 -2
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +2 -2
- package/dist/es2019/components/common/PopupTrigger.js +10 -12
- package/dist/es2019/components/common/ProfileCardTrigger.js +1 -1
- package/dist/es2019/util/analytics.js +2 -2
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/hooks/useAgentActions.js +2 -2
- package/dist/esm/components/common/PopupTrigger.js +6 -8
- package/dist/esm/components/common/ProfileCardTrigger.js +1 -1
- package/dist/esm/util/analytics.js +2 -2
- package/dist/types/components/common/PopupTrigger.d.ts +2 -3
- package/dist/types-ts4.5/components/common/PopupTrigger.d.ts +2 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 19.25.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#136007](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136007)
|
|
8
|
+
[`f41e92bc2025c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f41e92bc2025c) -
|
|
9
|
+
Fix pathway not set for full screen conversation starter
|
|
10
|
+
|
|
3
11
|
## 19.25.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -57,7 +57,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
57
57
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
58
58
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
59
59
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
60
|
-
headers.append('atl-client-version', "19.25.
|
|
60
|
+
headers.append('atl-client-version', "19.25.1");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -22,7 +22,6 @@ var createRovoParams = function createRovoParams(params) {
|
|
|
22
22
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
23
23
|
key = _ref2[0],
|
|
24
24
|
value = _ref2[1];
|
|
25
|
-
rovoParams["".concat(ROVO_PARAM_PREFIX, ".").concat(key)] = encodeURIComponent(value);
|
|
26
25
|
rovoParams["".concat(ROVO_PARAM_PREFIX).concat(firstCharUpper(key))] = encodeURIComponent(value);
|
|
27
26
|
});
|
|
28
27
|
return rovoParams;
|
|
@@ -61,7 +60,8 @@ var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlAction
|
|
|
61
60
|
}, createRovoParams({
|
|
62
61
|
cloudId: cloudId,
|
|
63
62
|
agentId: agentId,
|
|
64
|
-
prompt: prompt
|
|
63
|
+
prompt: prompt,
|
|
64
|
+
pathway: 'chat'
|
|
65
65
|
})));
|
|
66
66
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
67
67
|
};
|
|
@@ -9,13 +9,12 @@ exports.PopupTrigger = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _excluded = ["children", "trigger", "
|
|
12
|
+
var _excluded = ["children", "trigger", "showProfilecard", "hideProfilecard", "ariaLabelledBy"];
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
-
var
|
|
15
|
+
var PopupTriggerInner = function PopupTriggerInner(_ref, ref) {
|
|
16
16
|
var children = _ref.children,
|
|
17
17
|
trigger = _ref.trigger,
|
|
18
|
-
forwardRef = _ref.forwardRef,
|
|
19
18
|
showProfilecard = _ref.showProfilecard,
|
|
20
19
|
hideProfilecard = _ref.hideProfilecard,
|
|
21
20
|
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
@@ -30,9 +29,7 @@ var PopupTrigger = exports.PopupTrigger = function PopupTrigger(_ref) {
|
|
|
30
29
|
}
|
|
31
30
|
}, [showProfilecard]);
|
|
32
31
|
var onClick = (0, _react.useCallback)(function (event) {
|
|
33
|
-
//
|
|
34
|
-
// propagate out to parent containers. For example when clicking a mention
|
|
35
|
-
// lozenge in an inline-edit.
|
|
32
|
+
// Prevent the click event from propagating to parent containers.
|
|
36
33
|
event.stopPropagation();
|
|
37
34
|
showProfilecard();
|
|
38
35
|
}, [showProfilecard]);
|
|
@@ -48,7 +45,8 @@ var PopupTrigger = exports.PopupTrigger = function PopupTrigger(_ref) {
|
|
|
48
45
|
};
|
|
49
46
|
}, [hideProfilecard, onClick, onKeyPress, onMouseEnter, trigger]);
|
|
50
47
|
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, props, containerListeners, {
|
|
51
|
-
ref:
|
|
48
|
+
ref: ref,
|
|
52
49
|
"aria-labelledby": ariaLabelledBy
|
|
53
50
|
}), children);
|
|
54
|
-
};
|
|
51
|
+
};
|
|
52
|
+
var PopupTrigger = exports.PopupTrigger = /*#__PURE__*/_react.default.forwardRef(PopupTriggerInner);
|
|
@@ -100,7 +100,7 @@ function ProfileCardTrigger(_ref) {
|
|
|
100
100
|
__ = triggerProps['aria-haspopup'],
|
|
101
101
|
restInnerProps = (0, _objectWithoutProperties2.default)(triggerProps, _excluded2);
|
|
102
102
|
return /*#__PURE__*/_react.default.createElement(_PopupTrigger.PopupTrigger, (0, _extends2.default)({}, disabledAriaAttributes ? restInnerProps : triggerProps, {
|
|
103
|
-
|
|
103
|
+
ref: triggerProps.ref,
|
|
104
104
|
hideProfilecard: hideProfilecard,
|
|
105
105
|
showProfilecard: showProfilecard,
|
|
106
106
|
children: children,
|
|
@@ -35,7 +35,7 @@ var fireEvent = exports.fireEvent = function fireEvent(createAnalyticsEvent, bod
|
|
|
35
35
|
|
|
36
36
|
var TEAM_SUBJECT = 'teamProfileCard';
|
|
37
37
|
var USER_SUBJECT = 'profilecard';
|
|
38
|
-
var AGENT_SUBJECT = '
|
|
38
|
+
var AGENT_SUBJECT = 'rovoAgentProfilecard';
|
|
39
39
|
var createEvent = function createEvent(eventType, action, actionSubject, actionSubjectId) {
|
|
40
40
|
var attributes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
41
41
|
return {
|
|
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
45
45
|
actionSubjectId: actionSubjectId,
|
|
46
46
|
attributes: _objectSpread(_objectSpread({
|
|
47
47
|
packageName: "@atlaskit/profilecard",
|
|
48
|
-
packageVersion: "19.25.
|
|
48
|
+
packageVersion: "19.25.1"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -67,7 +67,7 @@ export const addHeaders = headers => {
|
|
|
67
67
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
68
68
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
69
69
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
70
|
-
headers.append('atl-client-version', "19.25.
|
|
70
|
+
headers.append('atl-client-version', "19.25.1");
|
|
71
71
|
return headers;
|
|
72
72
|
};
|
|
73
73
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -6,7 +6,6 @@ const ROVO_PARAM_PREFIX = 'rovoChat';
|
|
|
6
6
|
const createRovoParams = params => {
|
|
7
7
|
const rovoParams = {};
|
|
8
8
|
Object.entries(params).forEach(([key, value]) => {
|
|
9
|
-
rovoParams[`${ROVO_PARAM_PREFIX}.${key}`] = encodeURIComponent(value);
|
|
10
9
|
rovoParams[`${ROVO_PARAM_PREFIX}${firstCharUpper(key)}`] = encodeURIComponent(value);
|
|
11
10
|
});
|
|
12
11
|
return rovoParams;
|
|
@@ -49,7 +48,8 @@ export const useAgentUrlActions = ({
|
|
|
49
48
|
...createRovoParams({
|
|
50
49
|
cloudId,
|
|
51
50
|
agentId,
|
|
52
|
-
prompt
|
|
51
|
+
prompt,
|
|
52
|
+
pathway: 'chat'
|
|
53
53
|
})
|
|
54
54
|
});
|
|
55
55
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useMemo } from 'react';
|
|
3
|
-
|
|
3
|
+
const PopupTriggerInner = ({
|
|
4
4
|
children,
|
|
5
5
|
trigger,
|
|
6
|
-
forwardRef,
|
|
7
6
|
showProfilecard,
|
|
8
7
|
hideProfilecard,
|
|
9
8
|
ariaLabelledBy,
|
|
10
9
|
...props
|
|
11
|
-
}) => {
|
|
10
|
+
}, ref) => {
|
|
12
11
|
const onMouseEnter = useCallback(() => {
|
|
13
12
|
showProfilecard();
|
|
14
13
|
}, [showProfilecard]);
|
|
@@ -19,23 +18,22 @@ export const PopupTrigger = ({
|
|
|
19
18
|
}
|
|
20
19
|
}, [showProfilecard]);
|
|
21
20
|
const onClick = useCallback(event => {
|
|
22
|
-
//
|
|
23
|
-
// propagate out to parent containers. For example when clicking a mention
|
|
24
|
-
// lozenge in an inline-edit.
|
|
21
|
+
// Prevent the click event from propagating to parent containers.
|
|
25
22
|
event.stopPropagation();
|
|
26
23
|
showProfilecard();
|
|
27
24
|
}, [showProfilecard]);
|
|
28
25
|
const containerListeners = useMemo(() => trigger === 'hover' ? {
|
|
29
|
-
onMouseEnter
|
|
26
|
+
onMouseEnter,
|
|
30
27
|
onMouseLeave: hideProfilecard,
|
|
31
28
|
onBlur: hideProfilecard,
|
|
32
|
-
onKeyPress
|
|
29
|
+
onKeyPress
|
|
33
30
|
} : {
|
|
34
|
-
onClick
|
|
35
|
-
onKeyPress
|
|
31
|
+
onClick,
|
|
32
|
+
onKeyPress
|
|
36
33
|
}, [hideProfilecard, onClick, onKeyPress, onMouseEnter, trigger]);
|
|
37
34
|
return /*#__PURE__*/React.createElement("span", _extends({}, props, containerListeners, {
|
|
38
|
-
ref:
|
|
35
|
+
ref: ref,
|
|
39
36
|
"aria-labelledby": ariaLabelledBy
|
|
40
37
|
}), children);
|
|
41
|
-
};
|
|
38
|
+
};
|
|
39
|
+
export const PopupTrigger = /*#__PURE__*/React.forwardRef(PopupTriggerInner);
|
|
@@ -77,7 +77,7 @@ function ProfileCardTrigger({
|
|
|
77
77
|
...restInnerProps
|
|
78
78
|
} = triggerProps;
|
|
79
79
|
return /*#__PURE__*/React.createElement(PopupTrigger, _extends({}, disabledAriaAttributes ? restInnerProps : triggerProps, {
|
|
80
|
-
|
|
80
|
+
ref: triggerProps.ref,
|
|
81
81
|
hideProfilecard: hideProfilecard,
|
|
82
82
|
showProfilecard: showProfilecard,
|
|
83
83
|
children: children,
|
|
@@ -24,7 +24,7 @@ export const fireEvent = (createAnalyticsEvent, body) => {
|
|
|
24
24
|
|
|
25
25
|
const TEAM_SUBJECT = 'teamProfileCard';
|
|
26
26
|
const USER_SUBJECT = 'profilecard';
|
|
27
|
-
const AGENT_SUBJECT = '
|
|
27
|
+
const AGENT_SUBJECT = 'rovoAgentProfilecard';
|
|
28
28
|
const createEvent = (eventType, action, actionSubject, actionSubjectId, attributes = {}) => ({
|
|
29
29
|
eventType,
|
|
30
30
|
action,
|
|
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
32
32
|
actionSubjectId,
|
|
33
33
|
attributes: {
|
|
34
34
|
packageName: "@atlaskit/profilecard",
|
|
35
|
-
packageVersion: "19.25.
|
|
35
|
+
packageVersion: "19.25.1",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -48,7 +48,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
48
48
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
49
49
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
50
50
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
51
|
-
headers.append('atl-client-version', "19.25.
|
|
51
|
+
headers.append('atl-client-version', "19.25.1");
|
|
52
52
|
return headers;
|
|
53
53
|
};
|
|
54
54
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -15,7 +15,6 @@ var createRovoParams = function createRovoParams(params) {
|
|
|
15
15
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
16
16
|
key = _ref2[0],
|
|
17
17
|
value = _ref2[1];
|
|
18
|
-
rovoParams["".concat(ROVO_PARAM_PREFIX, ".").concat(key)] = encodeURIComponent(value);
|
|
19
18
|
rovoParams["".concat(ROVO_PARAM_PREFIX).concat(firstCharUpper(key))] = encodeURIComponent(value);
|
|
20
19
|
});
|
|
21
20
|
return rovoParams;
|
|
@@ -54,7 +53,8 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
|
|
|
54
53
|
}, createRovoParams({
|
|
55
54
|
cloudId: cloudId,
|
|
56
55
|
agentId: agentId,
|
|
57
|
-
prompt: prompt
|
|
56
|
+
prompt: prompt,
|
|
57
|
+
pathway: 'chat'
|
|
58
58
|
})));
|
|
59
59
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
60
60
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "trigger", "
|
|
3
|
+
var _excluded = ["children", "trigger", "showProfilecard", "hideProfilecard", "ariaLabelledBy"];
|
|
4
4
|
import React, { useCallback, useMemo } from 'react';
|
|
5
|
-
|
|
5
|
+
var PopupTriggerInner = function PopupTriggerInner(_ref, ref) {
|
|
6
6
|
var children = _ref.children,
|
|
7
7
|
trigger = _ref.trigger,
|
|
8
|
-
forwardRef = _ref.forwardRef,
|
|
9
8
|
showProfilecard = _ref.showProfilecard,
|
|
10
9
|
hideProfilecard = _ref.hideProfilecard,
|
|
11
10
|
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
@@ -20,9 +19,7 @@ export var PopupTrigger = function PopupTrigger(_ref) {
|
|
|
20
19
|
}
|
|
21
20
|
}, [showProfilecard]);
|
|
22
21
|
var onClick = useCallback(function (event) {
|
|
23
|
-
//
|
|
24
|
-
// propagate out to parent containers. For example when clicking a mention
|
|
25
|
-
// lozenge in an inline-edit.
|
|
22
|
+
// Prevent the click event from propagating to parent containers.
|
|
26
23
|
event.stopPropagation();
|
|
27
24
|
showProfilecard();
|
|
28
25
|
}, [showProfilecard]);
|
|
@@ -38,7 +35,8 @@ export var PopupTrigger = function PopupTrigger(_ref) {
|
|
|
38
35
|
};
|
|
39
36
|
}, [hideProfilecard, onClick, onKeyPress, onMouseEnter, trigger]);
|
|
40
37
|
return /*#__PURE__*/React.createElement("span", _extends({}, props, containerListeners, {
|
|
41
|
-
ref:
|
|
38
|
+
ref: ref,
|
|
42
39
|
"aria-labelledby": ariaLabelledBy
|
|
43
40
|
}), children);
|
|
44
|
-
};
|
|
41
|
+
};
|
|
42
|
+
export var PopupTrigger = /*#__PURE__*/React.forwardRef(PopupTriggerInner);
|
|
@@ -90,7 +90,7 @@ function ProfileCardTrigger(_ref) {
|
|
|
90
90
|
__ = triggerProps['aria-haspopup'],
|
|
91
91
|
restInnerProps = _objectWithoutProperties(triggerProps, _excluded2);
|
|
92
92
|
return /*#__PURE__*/React.createElement(PopupTrigger, _extends({}, disabledAriaAttributes ? restInnerProps : triggerProps, {
|
|
93
|
-
|
|
93
|
+
ref: triggerProps.ref,
|
|
94
94
|
hideProfilecard: hideProfilecard,
|
|
95
95
|
showProfilecard: showProfilecard,
|
|
96
96
|
children: children,
|
|
@@ -29,7 +29,7 @@ export var fireEvent = function fireEvent(createAnalyticsEvent, body) {
|
|
|
29
29
|
|
|
30
30
|
var TEAM_SUBJECT = 'teamProfileCard';
|
|
31
31
|
var USER_SUBJECT = 'profilecard';
|
|
32
|
-
var AGENT_SUBJECT = '
|
|
32
|
+
var AGENT_SUBJECT = 'rovoAgentProfilecard';
|
|
33
33
|
var createEvent = function createEvent(eventType, action, actionSubject, actionSubjectId) {
|
|
34
34
|
var attributes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
35
35
|
return {
|
|
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
39
39
|
actionSubjectId: actionSubjectId,
|
|
40
40
|
attributes: _objectSpread(_objectSpread({
|
|
41
41
|
packageName: "@atlaskit/profilecard",
|
|
42
|
-
packageVersion: "19.25.
|
|
42
|
+
packageVersion: "19.25.1"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type TriggerProps } from '@atlaskit/popup';
|
|
3
3
|
import { type ProfileCardTriggerProps } from './types';
|
|
4
|
-
export declare const PopupTrigger: <T>(
|
|
4
|
+
export declare const PopupTrigger: <T>(props: Partial<TriggerProps> & {
|
|
5
5
|
showProfilecard: () => void;
|
|
6
6
|
hideProfilecard: () => void;
|
|
7
|
-
|
|
8
|
-
} & Pick<ProfileCardTriggerProps<T>, "trigger" | "children" | "ariaLabelledBy">) => JSX.Element;
|
|
7
|
+
} & Pick<ProfileCardTriggerProps<T>, 'ariaLabelledBy' | 'trigger' | 'children'> & React.RefAttributes<HTMLSpanElement>) => JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type TriggerProps } from '@atlaskit/popup';
|
|
3
3
|
import { type ProfileCardTriggerProps } from './types';
|
|
4
|
-
export declare const PopupTrigger: <T>(
|
|
4
|
+
export declare const PopupTrigger: <T>(props: Partial<TriggerProps> & {
|
|
5
5
|
showProfilecard: () => void;
|
|
6
6
|
hideProfilecard: () => void;
|
|
7
|
-
|
|
8
|
-
} & Pick<ProfileCardTriggerProps<T>, "trigger" | "children" | "ariaLabelledBy">) => JSX.Element;
|
|
7
|
+
} & Pick<ProfileCardTriggerProps<T>, 'ariaLabelledBy' | 'trigger' | 'children'> & React.RefAttributes<HTMLSpanElement>) => JSX.Element;
|