@atlaskit/mention 27.17.1 → 27.18.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 +34 -0
- package/dist/cjs/api/AbstractMentionResource.js +111 -0
- package/dist/cjs/api/AbstractPresenceResource.js +41 -0
- package/dist/cjs/api/AbstractResource.js +48 -0
- package/dist/cjs/api/Callback.js +5 -0
- package/dist/cjs/api/DefaultMentionNameResolver.js +178 -0
- package/dist/cjs/api/DefaultPresenceCache.js +159 -0
- package/dist/cjs/api/DefaultPresenceParser.js +91 -0
- package/dist/cjs/api/HttpError.js +16 -0
- package/dist/cjs/api/MentionNameResolver.js +13 -201
- package/dist/cjs/api/MentionResource.js +52 -157
- package/dist/cjs/api/PresenceResource.js +39 -263
- package/dist/cjs/api/Queue.js +5 -0
- package/dist/cjs/api/isResolvingMentionProvider.js +9 -0
- package/dist/cjs/api/mergeNameResolverQueues.js +36 -0
- package/dist/cjs/components/Mention/MentionInternal.js +247 -0
- package/dist/cjs/components/Mention/ResourcedMention.js +5 -4
- package/dist/cjs/components/Mention/index.js +29 -243
- package/dist/cjs/components/MentionAvatar/index.js +5 -4
- package/dist/cjs/components/MentionItem/index.js +18 -12
- package/dist/cjs/components/MentionList/index.js +4 -3
- package/dist/cjs/components/MentionPicker/MentionPicker.js +231 -0
- package/dist/cjs/components/MentionPicker/index.js +18 -225
- package/dist/cjs/components/MessagesIntlProvider/index.js +2 -2
- package/dist/cjs/components/ResourcedMentionList/ResourcedMentionListWithoutAnalytics.js +228 -0
- package/dist/cjs/components/ResourcedMentionList/index.js +14 -223
- package/dist/cjs/index.js +17 -15
- package/dist/cjs/is-agent-mention.js +12 -0
- package/dist/cjs/is-app-mention.js +10 -0
- package/dist/cjs/is-promise.js +9 -0
- package/dist/cjs/is-restricted.js +10 -0
- package/dist/cjs/is-special-mention-text.js +9 -0
- package/dist/cjs/is-special-mention.js +10 -0
- package/dist/cjs/is-team-mention.js +10 -0
- package/dist/cjs/resource.js +15 -12
- package/dist/cjs/team-resource.js +9 -9
- package/dist/cjs/typeahead.js +4 -0
- package/dist/cjs/types.js +71 -30
- package/dist/cjs/util/actual-mouse-move.js +14 -0
- package/dist/cjs/util/analytics.js +91 -107
- package/dist/cjs/util/build-sli-payload.js +27 -0
- package/dist/cjs/util/fire-analytics-mention-event.js +32 -0
- package/dist/cjs/util/fire-analytics-mention-hydration-event.js +33 -0
- package/dist/cjs/util/fire-analytics-mention-typeahead-event.js +34 -0
- package/dist/cjs/util/fire-analytics.js +18 -0
- package/dist/cjs/util/fire-sli-analytics-event.js +16 -0
- package/dist/cjs/util/get-messages-for-locale.js +233 -0
- package/dist/cjs/util/i18n.js +9 -254
- package/dist/cjs/util/left-click.js +9 -0
- package/dist/cjs/util/mouse-location.js +12 -0
- package/dist/cjs/util/mouse.js +1 -26
- package/dist/cjs/util/package-name.js +7 -0
- package/dist/cjs/util/package-version.js +7 -0
- package/dist/cjs/util/prop-formatter.js +25 -0
- package/dist/es2019/api/AbstractMentionResource.js +73 -0
- package/dist/es2019/api/AbstractPresenceResource.js +17 -0
- package/dist/es2019/api/AbstractResource.js +33 -0
- package/dist/es2019/api/Callback.js +1 -0
- package/dist/es2019/api/DefaultMentionNameResolver.js +152 -0
- package/dist/es2019/api/DefaultPresenceCache.js +111 -0
- package/dist/es2019/api/DefaultPresenceParser.js +58 -0
- package/dist/es2019/api/HttpError.js +8 -0
- package/dist/es2019/api/MentionNameResolver.js +13 -176
- package/dist/es2019/api/MentionResource.js +28 -122
- package/dist/es2019/api/PresenceResource.js +19 -185
- package/dist/es2019/api/Queue.js +1 -0
- package/dist/es2019/api/isResolvingMentionProvider.js +1 -0
- package/dist/es2019/api/mergeNameResolverQueues.js +25 -0
- package/dist/es2019/components/Mention/MentionInternal.js +225 -0
- package/dist/es2019/components/Mention/ResourcedMention.js +4 -3
- package/dist/es2019/components/Mention/index.js +19 -223
- package/dist/es2019/components/MentionAvatar/index.js +3 -2
- package/dist/es2019/components/MentionItem/index.js +14 -8
- package/dist/es2019/components/MentionList/index.js +2 -1
- package/dist/es2019/components/MentionPicker/MentionPicker.js +198 -0
- package/dist/es2019/components/MentionPicker/index.js +15 -198
- package/dist/es2019/components/MessagesIntlProvider/index.js +1 -1
- package/dist/es2019/components/ResourcedMentionList/ResourcedMentionListWithoutAnalytics.js +187 -0
- package/dist/es2019/components/ResourcedMentionList/index.js +9 -187
- package/dist/es2019/element.js +5 -0
- package/dist/es2019/index.js +13 -9
- package/dist/es2019/is-agent-mention.js +6 -0
- package/dist/es2019/is-app-mention.js +4 -0
- package/dist/es2019/is-promise.js +1 -0
- package/dist/es2019/is-restricted.js +4 -0
- package/dist/es2019/is-special-mention-text.js +3 -0
- package/dist/es2019/is-special-mention.js +4 -0
- package/dist/es2019/is-team-mention.js +4 -0
- package/dist/es2019/item.js +5 -0
- package/dist/es2019/resource.js +15 -5
- package/dist/es2019/team-resource.js +10 -4
- package/dist/es2019/typeahead.js +5 -0
- package/dist/es2019/types.js +30 -21
- package/dist/es2019/util/actual-mouse-move.js +8 -0
- package/dist/es2019/util/analytics.js +35 -91
- package/dist/es2019/util/build-sli-payload.js +18 -0
- package/dist/es2019/util/fire-analytics-mention-event.js +24 -0
- package/dist/es2019/util/fire-analytics-mention-hydration-event.js +25 -0
- package/dist/es2019/util/fire-analytics-mention-typeahead-event.js +24 -0
- package/dist/es2019/util/fire-analytics.js +10 -0
- package/dist/es2019/util/fire-sli-analytics-event.js +8 -0
- package/dist/es2019/util/get-messages-for-locale.js +145 -0
- package/dist/es2019/util/i18n.js +2 -165
- package/dist/es2019/util/left-click.js +3 -0
- package/dist/es2019/util/mouse-location.js +6 -0
- package/dist/es2019/util/mouse.js +0 -18
- package/dist/es2019/util/package-name.js +1 -0
- package/dist/es2019/util/package-version.js +1 -0
- package/dist/es2019/util/prop-formatter.js +18 -0
- package/dist/esm/api/AbstractMentionResource.js +104 -0
- package/dist/esm/api/AbstractPresenceResource.js +34 -0
- package/dist/esm/api/AbstractResource.js +41 -0
- package/dist/esm/api/Callback.js +1 -0
- package/dist/esm/api/DefaultMentionNameResolver.js +171 -0
- package/dist/esm/api/DefaultPresenceCache.js +152 -0
- package/dist/esm/api/DefaultPresenceParser.js +84 -0
- package/dist/esm/api/HttpError.js +9 -0
- package/dist/esm/api/MentionNameResolver.js +13 -198
- package/dist/esm/api/MentionResource.js +30 -154
- package/dist/esm/api/PresenceResource.js +22 -256
- package/dist/esm/api/Queue.js +1 -0
- package/dist/esm/api/isResolvingMentionProvider.js +3 -0
- package/dist/esm/api/mergeNameResolverQueues.js +29 -0
- package/dist/esm/components/Mention/MentionInternal.js +242 -0
- package/dist/esm/components/Mention/ResourcedMention.js +4 -3
- package/dist/esm/components/Mention/index.js +19 -240
- package/dist/esm/components/MentionAvatar/index.js +3 -2
- package/dist/esm/components/MentionItem/index.js +14 -8
- package/dist/esm/components/MentionList/index.js +2 -1
- package/dist/esm/components/MentionPicker/MentionPicker.js +225 -0
- package/dist/esm/components/MentionPicker/index.js +15 -225
- package/dist/esm/components/MessagesIntlProvider/index.js +1 -1
- package/dist/esm/components/ResourcedMentionList/ResourcedMentionListWithoutAnalytics.js +221 -0
- package/dist/esm/components/ResourcedMentionList/index.js +9 -221
- package/dist/esm/element.js +5 -0
- package/dist/esm/index.js +13 -9
- package/dist/esm/is-agent-mention.js +6 -0
- package/dist/esm/is-app-mention.js +4 -0
- package/dist/esm/is-promise.js +3 -0
- package/dist/esm/is-restricted.js +4 -0
- package/dist/esm/is-special-mention-text.js +3 -0
- package/dist/esm/is-special-mention.js +4 -0
- package/dist/esm/is-team-mention.js +4 -0
- package/dist/esm/item.js +5 -0
- package/dist/esm/resource.js +15 -5
- package/dist/esm/team-resource.js +10 -4
- package/dist/esm/typeahead.js +5 -0
- package/dist/esm/types.js +30 -23
- package/dist/esm/util/actual-mouse-move.js +8 -0
- package/dist/esm/util/analytics.js +35 -105
- package/dist/esm/util/build-sli-payload.js +20 -0
- package/dist/esm/util/fire-analytics-mention-event.js +26 -0
- package/dist/esm/util/fire-analytics-mention-hydration-event.js +27 -0
- package/dist/esm/util/fire-analytics-mention-typeahead-event.js +28 -0
- package/dist/esm/util/fire-analytics.js +12 -0
- package/dist/esm/util/fire-sli-analytics-event.js +10 -0
- package/dist/esm/util/get-messages-for-locale.js +163 -0
- package/dist/esm/util/i18n.js +2 -183
- package/dist/esm/util/left-click.js +3 -0
- package/dist/esm/util/mouse-location.js +6 -0
- package/dist/esm/util/mouse.js +0 -18
- package/dist/esm/util/package-name.js +1 -0
- package/dist/esm/util/package-version.js +1 -0
- package/dist/esm/util/prop-formatter.js +18 -0
- package/dist/types/api/AbstractMentionResource.d.ts +15 -0
- package/dist/types/api/AbstractPresenceResource.d.ts +6 -0
- package/dist/types/api/AbstractResource.d.ts +11 -0
- package/dist/types/api/Callback.d.ts +4 -0
- package/dist/types/api/DefaultMentionNameResolver.d.ts +27 -0
- package/dist/types/api/DefaultPresenceCache.d.ts +57 -0
- package/dist/types/api/DefaultPresenceParser.d.ts +8 -0
- package/dist/types/api/HttpError.d.ts +7 -0
- package/dist/types/api/MentionNameResolver.d.ts +14 -35
- package/dist/types/api/MentionResource.d.ts +18 -33
- package/dist/types/api/PresenceResource.d.ts +15 -69
- package/dist/types/api/Queue.d.ts +2 -0
- package/dist/types/api/isResolvingMentionProvider.d.ts +2 -0
- package/dist/types/api/mergeNameResolverQueues.d.ts +6 -0
- package/dist/types/components/Mention/MentionInternal.d.ts +27 -0
- package/dist/types/components/Mention/ResourcedMention.d.ts +1 -1
- package/dist/types/components/Mention/index.d.ts +9 -20
- package/dist/types/components/MentionAvatar/index.d.ts +1 -1
- package/dist/types/components/MentionItem/index.d.ts +4 -1
- package/dist/types/components/MentionPicker/MentionPicker.d.ts +46 -0
- package/dist/types/components/MentionPicker/index.d.ts +5 -42
- package/dist/types/components/ResourcedMentionList/ResourcedMentionListWithoutAnalytics.d.ts +30 -0
- package/dist/types/components/ResourcedMentionList/index.d.ts +5 -27
- package/dist/types/element.d.ts +3 -0
- package/dist/types/index.d.ts +15 -10
- package/dist/types/is-agent-mention.d.ts +2 -0
- package/dist/types/is-app-mention.d.ts +2 -0
- package/dist/types/is-promise.d.ts +1 -0
- package/dist/types/is-restricted.d.ts +1 -0
- package/dist/types/is-special-mention-text.d.ts +1 -0
- package/dist/types/is-special-mention.d.ts +2 -0
- package/dist/types/is-team-mention.d.ts +2 -0
- package/dist/types/item.d.ts +3 -0
- package/dist/types/resource.d.ts +15 -6
- package/dist/types/team-resource.d.ts +10 -4
- package/dist/types/typeahead.d.ts +3 -0
- package/dist/types/types.d.ts +28 -8
- package/dist/types/util/actual-mouse-move.d.ts +2 -0
- package/dist/types/util/analytics.d.ts +33 -10
- package/dist/types/util/build-sli-payload.d.ts +4 -0
- package/dist/types/util/fire-analytics-mention-event.d.ts +1 -0
- package/dist/types/util/fire-analytics-mention-hydration-event.d.ts +1 -0
- package/dist/types/util/fire-analytics-mention-typeahead-event.d.ts +1 -0
- package/dist/types/util/fire-analytics.d.ts +1 -0
- package/dist/types/util/fire-sli-analytics-event.d.ts +1 -0
- package/dist/types/util/get-messages-for-locale.d.ts +11 -0
- package/dist/types/util/i18n.d.ts +0 -15
- package/dist/types/util/left-click.d.ts +2 -0
- package/dist/types/util/mouse-location.d.ts +3 -0
- package/dist/types/util/mouse.d.ts +0 -4
- package/dist/types/util/package-name.d.ts +1 -0
- package/dist/types/util/package-version.d.ts +1 -0
- package/dist/types/util/prop-formatter.d.ts +5 -0
- package/package.json +1 -1
- package/dist/cjs/i18n/index.js +0 -216
- package/dist/es2019/i18n/index.js +0 -37
- package/dist/esm/i18n/index.js +0 -37
- package/dist/types/i18n/index.d.ts +0 -37
- /package/dist/cjs/components/Mention/{index.compiled.css → MentionInternal.compiled.css} +0 -0
- /package/dist/es2019/components/Mention/{index.compiled.css → MentionInternal.compiled.css} +0 -0
- /package/dist/esm/components/Mention/{index.compiled.css → MentionInternal.compiled.css} +0 -0
|
@@ -1,246 +1,20 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import "./index.compiled.css";
|
|
10
|
-
import { ax, ix } from "@compiled/react/runtime";
|
|
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) { _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; }
|
|
13
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
* @jsxFrag React.Fragment
|
|
6
|
+
*/
|
|
15
7
|
/* eslint-disable @atlaskit/design-system/no-deprecated-imports, @typescript-eslint/ban-types -- Preserve existing mention implementation while focus-ring usage is reviewed separately. */
|
|
16
|
-
|
|
17
|
-
import FocusRing from '@atlaskit/focus-ring';
|
|
18
|
-
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
19
|
-
import PrimitiveMention from './PrimitiveMention';
|
|
20
|
-
import AsyncNoAccessTooltip from '../NoAccessTooltip';
|
|
21
|
-
import AsyncDisabledMentionTooltip from '../DisabledMentionTooltip';
|
|
22
|
-
import { UNKNOWN_USER_ID } from '../../_constants';
|
|
23
|
-
import { isRestricted, MentionType } from '../../types';
|
|
24
|
-
import { fireAnalyticsMentionEvent } from '../../util/analytics';
|
|
8
|
+
|
|
25
9
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { UfoErrorBoundary, mentionRenderedUfoExperience } from './ufoExperiences';
|
|
10
|
+
import { fireAnalyticsMentionEvent } from '../../util/fire-analytics-mention-event';
|
|
11
|
+
import { MentionInternal } from './MentionInternal';
|
|
29
12
|
export var ANALYTICS_HOVER_DELAY = 1000;
|
|
30
|
-
export { UNKNOWN_USER_ID } from '../../_constants';
|
|
31
|
-
var avatarStyles = null;
|
|
32
|
-
var avatarFallbackStyles = null;
|
|
33
|
-
var avatarImageStyles = null;
|
|
34
|
-
var agentAvatarStyles = null;
|
|
35
|
-
export var MentionInternal = /*#__PURE__*/function (_React$PureComponent) {
|
|
36
|
-
function MentionInternal(props) {
|
|
37
|
-
var _this;
|
|
38
|
-
_classCallCheck(this, MentionInternal);
|
|
39
|
-
_this = _callSuper(this, MentionInternal, [props]);
|
|
40
|
-
_defineProperty(_this, "state", {
|
|
41
|
-
hasAvatarError: false
|
|
42
|
-
});
|
|
43
|
-
_defineProperty(_this, "handleAvatarError", function () {
|
|
44
|
-
_this.setState({
|
|
45
|
-
hasAvatarError: true
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
_defineProperty(_this, "handleOnClick", function (e) {
|
|
49
|
-
var _this$props = _this.props,
|
|
50
|
-
id = _this$props.id,
|
|
51
|
-
text = _this$props.text,
|
|
52
|
-
onClick = _this$props.onClick,
|
|
53
|
-
isDisabled = _this$props.isDisabled;
|
|
54
|
-
if (isDisabled) {
|
|
55
|
-
// Disabled chips do not invoke their click handler.
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (onClick) {
|
|
59
|
-
onClick(id, text, e);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(_this, "handleOnMouseEnter", function (e) {
|
|
63
|
-
var _this$props2 = _this.props,
|
|
64
|
-
id = _this$props2.id,
|
|
65
|
-
text = _this$props2.text,
|
|
66
|
-
onMouseEnter = _this$props2.onMouseEnter,
|
|
67
|
-
onHover = _this$props2.onHover;
|
|
68
|
-
if (onMouseEnter) {
|
|
69
|
-
onMouseEnter(id, text, e);
|
|
70
|
-
}
|
|
71
|
-
_this.hoverTimeout = window.setTimeout(function () {
|
|
72
|
-
if (onHover) {
|
|
73
|
-
onHover();
|
|
74
|
-
}
|
|
75
|
-
_this.hoverTimeout = undefined;
|
|
76
|
-
}, ANALYTICS_HOVER_DELAY);
|
|
77
|
-
});
|
|
78
|
-
_defineProperty(_this, "handleOnMouseLeave", function (e) {
|
|
79
|
-
var _this$props3 = _this.props,
|
|
80
|
-
id = _this$props3.id,
|
|
81
|
-
text = _this$props3.text,
|
|
82
|
-
onMouseLeave = _this$props3.onMouseLeave;
|
|
83
|
-
if (onMouseLeave) {
|
|
84
|
-
onMouseLeave(id, text, e);
|
|
85
|
-
}
|
|
86
|
-
if (_this.hoverTimeout) {
|
|
87
|
-
clearTimeout(_this.hoverTimeout);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
_defineProperty(_this, "getMentionType", function () {
|
|
91
|
-
var _this$props4 = _this.props,
|
|
92
|
-
accessLevel = _this$props4.accessLevel,
|
|
93
|
-
isHighlighted = _this$props4.isHighlighted,
|
|
94
|
-
isDisabled = _this$props4.isDisabled;
|
|
95
|
-
if (isDisabled) {
|
|
96
|
-
return MentionType.DISABLED;
|
|
97
|
-
}
|
|
98
|
-
if (isHighlighted) {
|
|
99
|
-
return MentionType.SELF;
|
|
100
|
-
}
|
|
101
|
-
if (isRestricted(accessLevel)) {
|
|
102
|
-
return MentionType.RESTRICTED;
|
|
103
|
-
}
|
|
104
|
-
return MentionType.DEFAULT;
|
|
105
|
-
});
|
|
106
|
-
mentionRenderedUfoExperience.getInstance(props.id).start();
|
|
107
|
-
return _this;
|
|
108
|
-
}
|
|
109
|
-
_inherits(MentionInternal, _React$PureComponent);
|
|
110
|
-
return _createClass(MentionInternal, [{
|
|
111
|
-
key: "componentDidMount",
|
|
112
|
-
value: function componentDidMount() {
|
|
113
|
-
mentionRenderedUfoExperience.getInstance(this.props.id).success();
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
key: "componentWillUnmount",
|
|
117
|
-
value: function componentWillUnmount() {
|
|
118
|
-
if (this.hoverTimeout) {
|
|
119
|
-
clearTimeout(this.hoverTimeout);
|
|
120
|
-
}
|
|
121
|
-
var ufoInstance = mentionRenderedUfoExperience.getInstance(this.props.id);
|
|
122
|
-
if ([UFOExperienceState['STARTED'], UFOExperienceState['IN_PROGRESS']].includes(ufoInstance.state)) {
|
|
123
|
-
ufoInstance.abort();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, {
|
|
127
|
-
key: "renderUnknownUserError",
|
|
128
|
-
value: function renderUnknownUserError(id) {
|
|
129
|
-
return /*#__PURE__*/React.createElement(UnknownUserError, {
|
|
130
|
-
values: {
|
|
131
|
-
userId: id.slice(-5)
|
|
132
|
-
}
|
|
133
|
-
}, function (message) {
|
|
134
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, "@".concat(message));
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}, {
|
|
138
|
-
key: "render",
|
|
139
|
-
value: function render() {
|
|
140
|
-
var handleAvatarError = this.handleAvatarError,
|
|
141
|
-
handleOnClick = this.handleOnClick,
|
|
142
|
-
handleOnMouseEnter = this.handleOnMouseEnter,
|
|
143
|
-
handleOnMouseLeave = this.handleOnMouseLeave,
|
|
144
|
-
props = this.props;
|
|
145
|
-
var appType = props.appType,
|
|
146
|
-
avatarUrl = props.avatarUrl,
|
|
147
|
-
text = props.text,
|
|
148
|
-
id = props.id,
|
|
149
|
-
accessLevel = props.accessLevel,
|
|
150
|
-
localId = props.localId,
|
|
151
|
-
disabledTooltip = props.disabledTooltip,
|
|
152
|
-
isAvatarImagePreShaped = props.isAvatarImagePreShaped,
|
|
153
|
-
renderAvatarSlot = props.renderAvatarSlot;
|
|
154
|
-
var mentionType = this.getMentionType();
|
|
155
|
-
var failedMention = text === "@".concat(UNKNOWN_USER_ID);
|
|
156
|
-
var showAvatarSlot = Boolean(renderAvatarSlot) && !failedMention;
|
|
157
|
-
var visibleText = showAvatarSlot && text.startsWith('@') ? text.slice(1) : text;
|
|
158
|
-
var shouldApplyAgentShape = appType === 'agent' && !isAvatarImagePreShaped;
|
|
159
|
-
var shouldRenderAvatar = avatarUrl && !this.state.hasAvatarError;
|
|
160
|
-
var showRestrictedTooltip = mentionType === MentionType.RESTRICTED;
|
|
161
|
-
var showDisabledTooltip = mentionType === MentionType.DISABLED && !!disabledTooltip;
|
|
162
13
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
// `aria-describedby`.
|
|
168
|
-
var isDisabledChip = mentionType === MentionType.DISABLED;
|
|
169
|
-
var disabledA11yProps = isDisabledChip ? _objectSpread({
|
|
170
|
-
'aria-disabled': true,
|
|
171
|
-
tabIndex: 0
|
|
172
|
-
}, disabledTooltip ? {
|
|
173
|
-
'aria-label': "".concat(text || '@...', " \u2014 ").concat(disabledTooltip)
|
|
174
|
-
} : {}) : {};
|
|
175
|
-
var mentionComponent = /*#__PURE__*/React.createElement(FocusRing, null, /*#__PURE__*/React.createElement(PrimitiveMention, _extends({
|
|
176
|
-
isAvatarVisible: showAvatarSlot,
|
|
177
|
-
mentionType: mentionType,
|
|
178
|
-
onClick: handleOnClick,
|
|
179
|
-
onMouseEnter: handleOnMouseEnter,
|
|
180
|
-
onMouseLeave: handleOnMouseLeave,
|
|
181
|
-
spellCheck: false,
|
|
182
|
-
"data-testid": "mention-".concat(id),
|
|
183
|
-
"data-mention-type": mentionType,
|
|
184
|
-
"data-mention-tooltip": showRestrictedTooltip || showDisabledTooltip
|
|
185
|
-
}, disabledA11yProps), failedMention ? this.renderUnknownUserError(id) : showAvatarSlot ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
186
|
-
"aria-hidden": "true",
|
|
187
|
-
"data-testid": "mention-avatar-slot",
|
|
188
|
-
className: ax(["_1reo15vq _18m915vq _2rko1rr0 _1e0c116y _1bsb7vkz _4t3i7vkz _4cvr1h6o _1bah1h6o _1o9zidpf _12l21b66 _s7n410e5", shouldApplyAgentShape && "_2rkoidpf _mkrz1l17", this.state.hasAvatarError && "_s7n41q9y"])
|
|
189
|
-
}, shouldRenderAvatar ? /*#__PURE__*/React.createElement("img", {
|
|
190
|
-
alt: "",
|
|
191
|
-
decoding: "async",
|
|
192
|
-
draggable: false,
|
|
193
|
-
height: 16,
|
|
194
|
-
loading: "lazy",
|
|
195
|
-
onError: handleAvatarError,
|
|
196
|
-
src: avatarUrl,
|
|
197
|
-
"data-testid": "mention-avatar",
|
|
198
|
-
width: 16,
|
|
199
|
-
className: ax(["_1e0c1ule _1bsb1osq _4t3i1osq _5ral1dfr"])
|
|
200
|
-
}) : this.state.hasAvatarError ? '@' : null), /*#__PURE__*/React.createElement("span", null, visibleText || '...')) : text || '@...'));
|
|
201
|
-
var ssrPlaceholderProp = props.ssrPlaceholderId ? {
|
|
202
|
-
'data-ssr-placeholder': props.ssrPlaceholderId
|
|
203
|
-
} : {};
|
|
204
|
-
var wrappedMention = function () {
|
|
205
|
-
if (showRestrictedTooltip) {
|
|
206
|
-
return /*#__PURE__*/React.createElement(React.Suspense, {
|
|
207
|
-
fallback: mentionComponent
|
|
208
|
-
}, /*#__PURE__*/React.createElement(AsyncNoAccessTooltip, {
|
|
209
|
-
name: text
|
|
210
|
-
}, mentionComponent));
|
|
211
|
-
}
|
|
212
|
-
if (showDisabledTooltip) {
|
|
213
|
-
return /*#__PURE__*/React.createElement(React.Suspense, {
|
|
214
|
-
fallback: mentionComponent
|
|
215
|
-
}, /*#__PURE__*/React.createElement(AsyncDisabledMentionTooltip, {
|
|
216
|
-
tooltip: disabledTooltip
|
|
217
|
-
}, mentionComponent));
|
|
218
|
-
}
|
|
219
|
-
return mentionComponent;
|
|
220
|
-
}();
|
|
221
|
-
return /*#__PURE__*/React.createElement(UfoErrorBoundary, {
|
|
222
|
-
id: id
|
|
223
|
-
}, /*#__PURE__*/React.createElement("span", _extends({
|
|
224
|
-
id: localId,
|
|
225
|
-
"data-mention-id": id,
|
|
226
|
-
"data-local-id": localId,
|
|
227
|
-
"data-access-level": accessLevel,
|
|
228
|
-
spellCheck: false
|
|
229
|
-
}, ssrPlaceholderProp), /*#__PURE__*/React.createElement(MessagesIntlProvider, null, wrappedMention)));
|
|
230
|
-
}
|
|
231
|
-
}], [{
|
|
232
|
-
key: "getDerivedStateFromProps",
|
|
233
|
-
value: function getDerivedStateFromProps(props, state) {
|
|
234
|
-
if (props.avatarUrl !== state.avatarUrl) {
|
|
235
|
-
return {
|
|
236
|
-
avatarUrl: props.avatarUrl,
|
|
237
|
-
hasAvatarError: false
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
}]);
|
|
243
|
-
}(React.PureComponent);
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `import { UNKNOWN_USER_ID } from '@atlaskit/mention/constants'` instead.
|
|
16
|
+
*/
|
|
17
|
+
export { UNKNOWN_USER_ID } from '../../_constants';
|
|
244
18
|
var MentionWithAnalytics = withAnalyticsEvents({
|
|
245
19
|
onClick: function onClick(createEvent, props) {
|
|
246
20
|
var id = props.id,
|
|
@@ -258,4 +32,9 @@ var MentionWithAnalytics = withAnalyticsEvents({
|
|
|
258
32
|
}
|
|
259
33
|
})(MentionInternal);
|
|
260
34
|
var Mention = MentionWithAnalytics;
|
|
261
|
-
export default Mention;
|
|
35
|
+
export default Mention;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use `import { MentionInternal } from '@atlaskit/mention/mention'` instead.
|
|
39
|
+
*/
|
|
40
|
+
export { MentionInternal } from './MentionInternal';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Avatar, { getAppearanceForAppType } from '@atlaskit/avatar';
|
|
3
|
-
import TeamAvatar from '@atlaskit/teams-avatar/teams-avatar';
|
|
4
3
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
5
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import
|
|
5
|
+
import TeamAvatar from '@atlaskit/teams-avatar/teams-avatar';
|
|
6
|
+
import { isAppMention } from '../../is-app-mention';
|
|
7
|
+
import { isTeamMention } from '../../is-team-mention';
|
|
7
8
|
export var MentionAvatar = function MentionAvatar(_ref) {
|
|
8
9
|
var mention = _ref.mention,
|
|
9
10
|
selected = _ref.selected;
|
|
@@ -8,22 +8,24 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
9
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import EditorPanelIcon from '@atlaskit/icon/core/status-information';
|
|
11
14
|
import Lozenge from '@atlaskit/lozenge';
|
|
12
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
16
|
import Tag from '@atlaskit/tag';
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import EditorPanelIcon from '@atlaskit/icon/core/status-information';
|
|
16
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
|
-
import { isAgentMention
|
|
18
|
+
import { isAgentMention } from '../../is-agent-mention';
|
|
19
|
+
import { isRestricted } from '../../is-restricted';
|
|
18
20
|
import { NoAccessLabel } from '../../util/i18n';
|
|
19
|
-
import { leftClick } from '../../util/
|
|
20
|
-
import AsyncNoAccessTooltip from '../NoAccessTooltip';
|
|
21
|
+
import { leftClick } from '../../util/left-click';
|
|
21
22
|
import AsyncLockCircleIcon from '../LockCircleIcon';
|
|
22
|
-
import {
|
|
23
|
-
import { renderHighlight } from './MentionHighlightHelpers';
|
|
23
|
+
import { MentionAvatar } from '../MentionAvatar';
|
|
24
24
|
import MentionDescriptionByline from '../MentionDescriptionByline';
|
|
25
25
|
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
26
|
-
import
|
|
26
|
+
import AsyncNoAccessTooltip from '../NoAccessTooltip';
|
|
27
|
+
import { renderHighlight } from './MentionHighlightHelpers';
|
|
28
|
+
import { AccessSectionStyle, AvatarStyle, FullNameStyle, InfoSectionStyle, MentionItemStyle, NameSectionStyle, RowStyle as RowStyleLegacy, RowStyleNext, TimeStyle } from './styles';
|
|
27
29
|
|
|
28
30
|
// Lazy-loaded so `@atlaskit/skeleton` (only needed for the loading
|
|
29
31
|
// placeholder) doesn't enter the bundle for every `@atlaskit/mention`
|
|
@@ -31,6 +33,10 @@ import { MentionAvatar } from '../MentionAvatar';
|
|
|
31
33
|
var MentionItemPlaceholder = /*#__PURE__*/React.lazy(function () {
|
|
32
34
|
return import( /* webpackChunkName: "@atlaskit-internal_mention-item-placeholder" */'./MentionItemPlaceholder');
|
|
33
35
|
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use `import { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from '@atlaskit/mention/mention-item/styles'` instead.
|
|
39
|
+
*/
|
|
34
40
|
export { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from './styles';
|
|
35
41
|
var lozengeAppearanceToTagColor = {
|
|
36
42
|
default: 'standard',
|
|
@@ -7,8 +7,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
|
+
import { actualMouseMove } from '../../util/actual-mouse-move';
|
|
10
11
|
import debug from '../../util/logger';
|
|
11
|
-
import {
|
|
12
|
+
import { mouseLocation } from '../../util/mouse-location';
|
|
12
13
|
import { MentionItemWithRef } from '../MentionItem';
|
|
13
14
|
import MentionListError from '../MentionListError';
|
|
14
15
|
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { IntlProvider } from 'react-intl';
|
|
11
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
12
|
+
import { fireAnalyticsMentionTypeaheadEvent } from '../../util/fire-analytics-mention-typeahead-event';
|
|
13
|
+
import uniqueId from '../../util/id';
|
|
14
|
+
import debug from '../../util/logger';
|
|
15
|
+
import Popup from '../Popup';
|
|
16
|
+
import ResourcedMentionList from '../ResourcedMentionList';
|
|
17
|
+
import { MentionPickerInfoStyle, MentionPickerStyle } from './styles';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @class MentionPicker
|
|
21
|
+
*/
|
|
22
|
+
export var MentionPicker = /*#__PURE__*/function (_React$PureComponent) {
|
|
23
|
+
function MentionPicker(props) {
|
|
24
|
+
var _this;
|
|
25
|
+
_classCallCheck(this, MentionPicker);
|
|
26
|
+
_this = _callSuper(this, MentionPicker, [props]);
|
|
27
|
+
_defineProperty(_this, "selectNext", function () {
|
|
28
|
+
if (_this.mentionListRef) {
|
|
29
|
+
_this.mentionListRef.selectNext();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
_defineProperty(_this, "selectPrevious", function () {
|
|
33
|
+
if (_this.mentionListRef) {
|
|
34
|
+
_this.mentionListRef.selectPrevious();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
_defineProperty(_this, "selectIndex", function (index, callback) {
|
|
38
|
+
if (_this.mentionListRef) {
|
|
39
|
+
_this.mentionListRef.selectIndex(index, callback);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
_defineProperty(_this, "selectId", function (id, callback) {
|
|
43
|
+
if (_this.mentionListRef) {
|
|
44
|
+
_this.mentionListRef.selectId(id, callback);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
_defineProperty(_this, "chooseCurrentSelection", function () {
|
|
48
|
+
if (_this.mentionListRef) {
|
|
49
|
+
_this.mentionListRef.chooseCurrentSelection();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
_defineProperty(_this, "mentionsCount", function () {
|
|
53
|
+
if (_this.mentionListRef) {
|
|
54
|
+
return _this.mentionListRef.mentionsCount();
|
|
55
|
+
}
|
|
56
|
+
return 0;
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Called after the 'visible' state is changed to decide whether the onOpen or onClose
|
|
60
|
+
* handlers should be called.
|
|
61
|
+
*
|
|
62
|
+
* It should be noted that the visible state of the component is not considered in
|
|
63
|
+
* this function. Instead the old state and new state should be passed as parameters.
|
|
64
|
+
*/
|
|
65
|
+
_defineProperty(_this, "onFilterVisibilityChange", function (oldVisibility, newVisibility) {
|
|
66
|
+
if (oldVisibility !== newVisibility) {
|
|
67
|
+
if (newVisibility) {
|
|
68
|
+
if (_this.props.onOpen) {
|
|
69
|
+
_this.props.onOpen();
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
if (_this.props.onClose) {
|
|
73
|
+
_this.props.onClose();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
// internal, used for callbacks
|
|
79
|
+
_defineProperty(_this, "filterChange", function (mentions, query, stats) {
|
|
80
|
+
debug('ak-mention-picker.filterChange', mentions.length);
|
|
81
|
+
var wasVisible = _this.state.visible;
|
|
82
|
+
var visible = mentions.length > 0;
|
|
83
|
+
_this.setState({
|
|
84
|
+
visible: visible
|
|
85
|
+
});
|
|
86
|
+
_this.onFilterVisibilityChange(wasVisible, visible);
|
|
87
|
+
fireAnalyticsMentionTypeaheadEvent(_this.props)('rendered', stats && stats.duration, mentions.map(function (mention) {
|
|
88
|
+
return mention.id;
|
|
89
|
+
}), query);
|
|
90
|
+
});
|
|
91
|
+
_defineProperty(_this, "filterError", function (error) {
|
|
92
|
+
debug('ak-mention-picker.filterError', error);
|
|
93
|
+
var wasVisible = _this.state.visible;
|
|
94
|
+
_this.setState({
|
|
95
|
+
visible: true,
|
|
96
|
+
info: undefined
|
|
97
|
+
});
|
|
98
|
+
_this.onFilterVisibilityChange(wasVisible, true);
|
|
99
|
+
});
|
|
100
|
+
_defineProperty(_this, "filterInfo", function (info) {
|
|
101
|
+
debug('ak-mention-picker.filterInfo', info);
|
|
102
|
+
_this.setState({
|
|
103
|
+
info: info
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
_defineProperty(_this, "handleMentionListRef", function (ref) {
|
|
107
|
+
_this.mentionListRef = ref;
|
|
108
|
+
});
|
|
109
|
+
_this.subscriberKey = uniqueId('ak-mention-picker');
|
|
110
|
+
_this.state = {
|
|
111
|
+
visible: false
|
|
112
|
+
};
|
|
113
|
+
_this.applyPropChanges({}, props);
|
|
114
|
+
return _this;
|
|
115
|
+
}
|
|
116
|
+
_inherits(MentionPicker, _React$PureComponent);
|
|
117
|
+
return _createClass(MentionPicker, [{
|
|
118
|
+
key: "componentDidMount",
|
|
119
|
+
value: function componentDidMount() {
|
|
120
|
+
this.subscribeResourceProvider(this.props.resourceProvider);
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
124
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
125
|
+
this.applyPropChanges(this.props, nextProps);
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
key: "componentWillUnmount",
|
|
129
|
+
value: function componentWillUnmount() {
|
|
130
|
+
this.unsubscribeResourceProvider(this.props.resourceProvider);
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
key: "applyPropChanges",
|
|
134
|
+
value:
|
|
135
|
+
// Internal
|
|
136
|
+
function applyPropChanges(prevProps, nextProps) {
|
|
137
|
+
var oldResourceProvider = prevProps.resourceProvider;
|
|
138
|
+
var newResourceProvider = nextProps.resourceProvider;
|
|
139
|
+
var resourceProviderChanged = oldResourceProvider !== newResourceProvider;
|
|
140
|
+
|
|
141
|
+
// resource provider
|
|
142
|
+
if (resourceProviderChanged) {
|
|
143
|
+
this.unsubscribeResourceProvider(oldResourceProvider);
|
|
144
|
+
this.subscribeResourceProvider(newResourceProvider);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "subscribeResourceProvider",
|
|
149
|
+
value: function subscribeResourceProvider(resourceProvider) {
|
|
150
|
+
if (resourceProvider) {
|
|
151
|
+
resourceProvider.subscribe(this.subscriberKey, this.filterChange, this.filterError, this.filterInfo, undefined);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: "unsubscribeResourceProvider",
|
|
156
|
+
value: function unsubscribeResourceProvider(resourceProvider) {
|
|
157
|
+
if (resourceProvider) {
|
|
158
|
+
resourceProvider.unsubscribe(this.subscriberKey);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "render",
|
|
163
|
+
value: function render() {
|
|
164
|
+
var _this$props = this.props,
|
|
165
|
+
resourceProvider = _this$props.resourceProvider,
|
|
166
|
+
presenceProvider = _this$props.presenceProvider,
|
|
167
|
+
onSelection = _this$props.onSelection,
|
|
168
|
+
query = _this$props.query,
|
|
169
|
+
target = _this$props.target,
|
|
170
|
+
position = _this$props.position,
|
|
171
|
+
zIndex = _this$props.zIndex,
|
|
172
|
+
offsetX = _this$props.offsetX,
|
|
173
|
+
offsetY = _this$props.offsetY,
|
|
174
|
+
intl = _this$props.intl;
|
|
175
|
+
var _this$state = this.state,
|
|
176
|
+
visible = _this$state.visible,
|
|
177
|
+
info = _this$state.info;
|
|
178
|
+
var resourceMentionList = /*#__PURE__*/React.createElement(ResourcedMentionList, {
|
|
179
|
+
resourceProvider: resourceProvider,
|
|
180
|
+
presenceProvider: presenceProvider,
|
|
181
|
+
onSelection: onSelection,
|
|
182
|
+
query: query,
|
|
183
|
+
ref: this.handleMentionListRef
|
|
184
|
+
});
|
|
185
|
+
var infoContent = info && !visible ? /*#__PURE__*/React.createElement(MentionPickerInfoStyle, null, /*#__PURE__*/React.createElement(Text, {
|
|
186
|
+
as: "p"
|
|
187
|
+
}, info)) : null;
|
|
188
|
+
var content;
|
|
189
|
+
if (position) {
|
|
190
|
+
debug('target, position', target, position);
|
|
191
|
+
if (target) {
|
|
192
|
+
content = /*#__PURE__*/React.createElement(Popup, {
|
|
193
|
+
target: target,
|
|
194
|
+
relativePosition: position,
|
|
195
|
+
zIndex: zIndex,
|
|
196
|
+
offsetX: offsetX,
|
|
197
|
+
offsetY: offsetY
|
|
198
|
+
}, /*#__PURE__*/React.createElement(IntlProvider, {
|
|
199
|
+
locale: (intl === null || intl === void 0 ? void 0 : intl.locale) || 'en'
|
|
200
|
+
}, /*#__PURE__*/React.createElement("div", null, resourceMentionList, infoContent)));
|
|
201
|
+
} else {
|
|
202
|
+
// don't show if we have a position, but no target yet
|
|
203
|
+
content = null;
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
content = /*#__PURE__*/React.createElement("div", null, resourceMentionList, infoContent);
|
|
207
|
+
}
|
|
208
|
+
return (
|
|
209
|
+
/*#__PURE__*/
|
|
210
|
+
/* old classnames are essential for Confluence tests */
|
|
211
|
+
React.createElement(MentionPickerStyle
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
213
|
+
, {
|
|
214
|
+
className: "ak-mention-picker",
|
|
215
|
+
visible: visible || info
|
|
216
|
+
}, content)
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
}]);
|
|
220
|
+
}(React.PureComponent);
|
|
221
|
+
_defineProperty(MentionPicker, "defaultProps", {
|
|
222
|
+
onSelection: function onSelection() {},
|
|
223
|
+
onOpen: function onOpen() {},
|
|
224
|
+
onClose: function onClose() {}
|
|
225
|
+
});
|