@atlaskit/mention 27.17.0 → 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 +40 -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 -227
- 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 -200
- 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 -227
- 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 +3 -3
- 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,223 +1,11 @@
|
|
|
1
|
-
|
|
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
|
-
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; }
|
|
10
|
-
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; }
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
|
-
import uniqueId from '../../util/id';
|
|
14
|
-
import debug from '../../util/logger';
|
|
15
|
-
import MentionList from '../MentionList';
|
|
16
|
-
import { fireSliAnalyticsEvent, SLI_EVENT_TYPE } from '../../util/analytics';
|
|
17
|
-
function applyPresence(mentions, presences) {
|
|
18
|
-
var updatedMentions = [];
|
|
19
|
-
for (var i = 0; i < mentions.length; i++) {
|
|
20
|
-
// Shallow copy
|
|
21
|
-
var mention = _objectSpread({}, mentions[i]);
|
|
22
|
-
var presence = presences[mention.id];
|
|
23
|
-
if (presence) {
|
|
24
|
-
mention.presence = presence;
|
|
25
|
-
}
|
|
26
|
-
updatedMentions.push(mention);
|
|
27
|
-
}
|
|
28
|
-
return updatedMentions;
|
|
29
|
-
}
|
|
30
|
-
function extractPresences(mentions) {
|
|
31
|
-
var presences = {};
|
|
32
|
-
for (var i = 0; i < mentions.length; i++) {
|
|
33
|
-
var mention = mentions[i];
|
|
34
|
-
if (mention.presence) {
|
|
35
|
-
presences[mention.id] = mention.presence;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return presences;
|
|
39
|
-
}
|
|
40
|
-
export var ResourcedMentionListWithoutAnalytics = /*#__PURE__*/function (_React$PureComponent) {
|
|
41
|
-
function ResourcedMentionListWithoutAnalytics(props) {
|
|
42
|
-
var _this;
|
|
43
|
-
_classCallCheck(this, ResourcedMentionListWithoutAnalytics);
|
|
44
|
-
_this = _callSuper(this, ResourcedMentionListWithoutAnalytics, [props]);
|
|
45
|
-
// API
|
|
46
|
-
_defineProperty(_this, "selectNext", function () {
|
|
47
|
-
if (_this.mentionListRef) {
|
|
48
|
-
_this.mentionListRef.selectNext();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
_defineProperty(_this, "selectPrevious", function () {
|
|
52
|
-
if (_this.mentionListRef) {
|
|
53
|
-
_this.mentionListRef.selectPrevious();
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
_defineProperty(_this, "selectIndex", function (index, callback) {
|
|
57
|
-
if (_this.mentionListRef) {
|
|
58
|
-
_this.mentionListRef.selectIndex(index, callback);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
_defineProperty(_this, "selectId", function (id, callback) {
|
|
62
|
-
if (_this.mentionListRef) {
|
|
63
|
-
_this.mentionListRef.selectId(id, callback);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
_defineProperty(_this, "chooseCurrentSelection", function () {
|
|
67
|
-
if (_this.mentionListRef) {
|
|
68
|
-
_this.mentionListRef.chooseCurrentSelection();
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
_defineProperty(_this, "mentionsCount", function () {
|
|
72
|
-
if (_this.mentionListRef) {
|
|
73
|
-
return _this.mentionListRef.mentionsCount();
|
|
74
|
-
}
|
|
75
|
-
return 0;
|
|
76
|
-
});
|
|
77
|
-
// internal, used for callbacks
|
|
78
|
-
_defineProperty(_this, "filterChange", function (mentions) {
|
|
79
|
-
// Retain known presence
|
|
80
|
-
var currentPresences = extractPresences(_this.state.mentions);
|
|
81
|
-
_this.setState({
|
|
82
|
-
resourceError: undefined,
|
|
83
|
-
mentions: applyPresence(mentions, currentPresences)
|
|
84
|
-
});
|
|
85
|
-
_this.refreshPresences(mentions);
|
|
86
|
-
});
|
|
87
|
-
_defineProperty(_this, "sendAnalytics", function (event, actionSubject, action) {
|
|
88
|
-
if (event === SLI_EVENT_TYPE) {
|
|
89
|
-
fireSliAnalyticsEvent(_this.props)(actionSubject, action);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
_defineProperty(_this, "filterError", function (error) {
|
|
93
|
-
debug('ak-resourced-mentions-list._filterError', error);
|
|
94
|
-
_this.setState({
|
|
95
|
-
resourceError: error
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
_defineProperty(_this, "presenceUpdate", function (presences) {
|
|
99
|
-
_this.setState({
|
|
100
|
-
mentions: applyPresence(_this.state.mentions, presences)
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
_defineProperty(_this, "notifySelection", function (mention) {
|
|
104
|
-
_this.props.resourceProvider.recordMentionSelection(mention);
|
|
105
|
-
if (_this.props.onSelection) {
|
|
106
|
-
_this.props.onSelection(mention);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
_defineProperty(_this, "handleMentionListRef", function (ref) {
|
|
110
|
-
_this.mentionListRef = ref;
|
|
111
|
-
});
|
|
112
|
-
_this.subscriberKey = uniqueId('ak-resourced-mention-list');
|
|
113
|
-
_this.state = {
|
|
114
|
-
resourceError: undefined,
|
|
115
|
-
mentions: []
|
|
116
|
-
};
|
|
117
|
-
_this.applyPropChanges({}, props);
|
|
118
|
-
return _this;
|
|
119
|
-
}
|
|
120
|
-
_inherits(ResourcedMentionListWithoutAnalytics, _React$PureComponent);
|
|
121
|
-
return _createClass(ResourcedMentionListWithoutAnalytics, [{
|
|
122
|
-
key: "componentDidMount",
|
|
123
|
-
value: function componentDidMount() {
|
|
124
|
-
this.subscribeMentionProvider(this.props.resourceProvider);
|
|
125
|
-
this.subscribePresenceProvider(this.props.presenceProvider);
|
|
126
|
-
}
|
|
127
|
-
}, {
|
|
128
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
129
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
130
|
-
this.applyPropChanges(this.props, nextProps);
|
|
131
|
-
}
|
|
132
|
-
}, {
|
|
133
|
-
key: "componentWillUnmount",
|
|
134
|
-
value: function componentWillUnmount() {
|
|
135
|
-
this.unsubscribeMentionProvider(this.props.resourceProvider);
|
|
136
|
-
this.unsubscribePresenceProvider(this.props.presenceProvider);
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
key: "subscribeMentionProvider",
|
|
140
|
-
value:
|
|
141
|
-
// internal
|
|
142
|
-
function subscribeMentionProvider(mentionProvider) {
|
|
143
|
-
if (mentionProvider) {
|
|
144
|
-
mentionProvider.subscribe(this.subscriberKey, this.filterChange, this.filterError, undefined, undefined, this.sendAnalytics);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}, {
|
|
148
|
-
key: "subscribePresenceProvider",
|
|
149
|
-
value: function subscribePresenceProvider(presenceProvider) {
|
|
150
|
-
if (presenceProvider) {
|
|
151
|
-
presenceProvider.subscribe(this.subscriberKey, this.presenceUpdate);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "unsubscribeMentionProvider",
|
|
156
|
-
value: function unsubscribeMentionProvider(mentionProvider) {
|
|
157
|
-
if (mentionProvider) {
|
|
158
|
-
mentionProvider.unsubscribe(this.subscriberKey);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}, {
|
|
162
|
-
key: "unsubscribePresenceProvider",
|
|
163
|
-
value: function unsubscribePresenceProvider(presenceProvider) {
|
|
164
|
-
if (presenceProvider) {
|
|
165
|
-
presenceProvider.unsubscribe(this.subscriberKey);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}, {
|
|
169
|
-
key: "applyPropChanges",
|
|
170
|
-
value: function applyPropChanges(prevProps, nextProps) {
|
|
171
|
-
var oldResourceProvider = prevProps.resourceProvider;
|
|
172
|
-
var oldPresenceProvider = prevProps.presenceProvider;
|
|
173
|
-
var oldQuery = prevProps.query;
|
|
174
|
-
var newResourceProvider = nextProps.resourceProvider;
|
|
175
|
-
var newPresenceProvider = nextProps.presenceProvider;
|
|
176
|
-
var newQuery = nextProps.query;
|
|
177
|
-
var resourceProviderChanged = oldResourceProvider !== newResourceProvider;
|
|
178
|
-
var queryChanged = oldQuery !== newQuery;
|
|
179
|
-
var canFilter = !!(typeof newQuery === 'string' && newResourceProvider);
|
|
180
|
-
var shouldFilter = canFilter && (queryChanged || resourceProviderChanged);
|
|
181
|
-
|
|
182
|
-
// resource provider
|
|
183
|
-
if (resourceProviderChanged) {
|
|
184
|
-
this.unsubscribeMentionProvider(oldResourceProvider);
|
|
185
|
-
this.subscribeMentionProvider(newResourceProvider);
|
|
186
|
-
}
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
187
2
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
this.unsubscribePresenceProvider(oldPresenceProvider);
|
|
191
|
-
this.subscribePresenceProvider(newPresenceProvider);
|
|
192
|
-
}
|
|
193
|
-
if (shouldFilter) {
|
|
194
|
-
newResourceProvider.filter(newQuery);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}, {
|
|
198
|
-
key: "refreshPresences",
|
|
199
|
-
value: function refreshPresences(mentions) {
|
|
200
|
-
if (this.props.presenceProvider) {
|
|
201
|
-
var ids = mentions.map(function (mention) {
|
|
202
|
-
return mention.id;
|
|
203
|
-
});
|
|
204
|
-
this.props.presenceProvider.refreshPresence(ids);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}, {
|
|
208
|
-
key: "render",
|
|
209
|
-
value: function render() {
|
|
210
|
-
var _this$state = this.state,
|
|
211
|
-
mentions = _this$state.mentions,
|
|
212
|
-
resourceError = _this$state.resourceError;
|
|
213
|
-
return /*#__PURE__*/React.createElement(MentionList, {
|
|
214
|
-
mentions: mentions,
|
|
215
|
-
resourceError: resourceError,
|
|
216
|
-
onSelection: this.notifySelection,
|
|
217
|
-
ref: this.handleMentionListRef
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}]);
|
|
221
|
-
}(React.PureComponent);
|
|
3
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
+
import { ResourcedMentionListWithoutAnalytics } from './ResourcedMentionListWithoutAnalytics';
|
|
222
5
|
var ResourcedMentionList = withAnalyticsEvents({})(ResourcedMentionListWithoutAnalytics);
|
|
223
|
-
export default ResourcedMentionList;
|
|
6
|
+
export default ResourcedMentionList;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `import { ResourcedMentionListWithoutAnalytics } from '@atlaskit/mention/resourced-mention-list'` instead.
|
|
10
|
+
*/
|
|
11
|
+
export { ResourcedMentionListWithoutAnalytics } from './ResourcedMentionListWithoutAnalytics';
|
package/dist/esm/element.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
1
2
|
import Mention from './components/Mention';
|
|
2
3
|
import ResourcedMention from './components/Mention/ResourcedMention';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `import Mention from '@atlaskit/mention/mention'` instead.
|
|
7
|
+
*/
|
|
3
8
|
export {
|
|
4
9
|
// Components
|
|
5
10
|
Mention, ResourcedMention };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ELEMENTS_CHANNEL } from './_constants';
|
|
2
|
+
import { AbstractMentionResource } from './api/AbstractMentionResource';
|
|
3
|
+
import { AbstractPresenceResource } from './api/AbstractPresenceResource';
|
|
4
|
+
import ContextMentionResource from './api/ContextMentionResource';
|
|
5
|
+
import { DefaultMentionNameResolver } from './api/DefaultMentionNameResolver';
|
|
6
|
+
import MentionResource from './api/MentionResource';
|
|
7
|
+
import { isResolvingMentionProvider } from './api/isResolvingMentionProvider';
|
|
8
|
+
import PresenceResource from './api/PresenceResource';
|
|
2
9
|
import TeamMentionResource from './api/TeamMentionResource';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
10
|
+
import Mention from './components/Mention';
|
|
11
|
+
import ResourcedMention from './components/Mention/ResourcedMention';
|
|
5
12
|
import MentionItem from './components/MentionItem';
|
|
6
13
|
import MentionList from './components/MentionList';
|
|
7
|
-
import ResourcedMentionList from './components/ResourcedMentionList';
|
|
8
14
|
import { MentionPickerWithAnalytics as MentionPicker } from './components/MentionPicker';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { MentionNameStatus,
|
|
12
|
-
import { ELEMENTS_CHANNEL } from './_constants';
|
|
13
|
-
import ContextMentionResource from './api/ContextMentionResource';
|
|
15
|
+
import ResourcedMentionList from './components/ResourcedMentionList';
|
|
16
|
+
import { isSpecialMention } from './is-special-mention';
|
|
17
|
+
import { MentionNameStatus, UserAccessLevel, UserType, ComponentNames, Actions, SliNames } from './types';
|
|
14
18
|
export {
|
|
15
19
|
// Classes
|
|
16
20
|
ContextMentionResource, MentionResource, TeamMentionResource, PresenceResource, DefaultMentionNameResolver, AbstractMentionResource, AbstractPresenceResource, MentionNameStatus,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UserType } from './types';
|
|
2
|
+
export function isAgentMention(mention) {
|
|
3
|
+
// Like `isAgentTypeAheadItem` in `editor-plugin-mentions/src/ui/type-ahead/index.tsx`
|
|
4
|
+
// and `isAgentUserType` in `editor-plugin-mentions/src/pm-plugins/agent.ts`
|
|
5
|
+
return mention.userType === UserType[UserType.APP] || mention.userType === 'AGENT' || mention.appType === 'agent';
|
|
6
|
+
}
|
package/dist/esm/item.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
1
2
|
import MentionItem, { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from './components/MentionItem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `import MentionItem, { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from '@atlaskit/mention/mention-item'` instead.
|
|
6
|
+
*/
|
|
2
7
|
export {
|
|
3
8
|
// Components
|
|
4
9
|
MentionItem, MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED };
|
package/dist/esm/resource.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import PresenceResource, { AbstractPresenceResource } from './api/PresenceResource';
|
|
3
|
-
import { DefaultMentionNameResolver } from './api/MentionNameResolver';
|
|
4
|
-
import { isSpecialMention, MentionNameStatus } from './types';
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
5
2
|
import { ELEMENTS_CHANNEL } from './_constants';
|
|
3
|
+
import { AbstractMentionResource } from './api/AbstractMentionResource';
|
|
4
|
+
import { AbstractPresenceResource } from './api/AbstractPresenceResource';
|
|
6
5
|
import ContextMentionResource from './api/ContextMentionResource';
|
|
7
|
-
import {
|
|
6
|
+
import { DefaultMentionNameResolver } from './api/DefaultMentionNameResolver';
|
|
7
|
+
import MentionResource from './api/MentionResource';
|
|
8
|
+
import { isResolvingMentionProvider } from './api/isResolvingMentionProvider';
|
|
9
|
+
import PresenceResource from './api/PresenceResource';
|
|
10
|
+
import { isSpecialMention } from './is-special-mention';
|
|
11
|
+
import { MentionNameStatus } from './types';
|
|
12
|
+
import { SLI_EVENT_TYPE, SMART_EVENT_TYPE } from './util/analytics';
|
|
13
|
+
import { buildSliPayload } from './util/build-sli-payload';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `import ContextMentionResource, { MentionResource, PresenceResource, DefaultMentionNameResolver, MentionNameStatus, isSpecialMention, isResolvingMentionProvider, ELEMENTS_CHANNEL, SLI_EVENT_TYPE, SMART_EVENT_TYPE, buildSliPayload } from '@atlaskit/mention/context-mention-resource'` instead.
|
|
17
|
+
*/
|
|
8
18
|
export {
|
|
9
19
|
// Classes
|
|
10
20
|
ContextMentionResource, MentionResource, PresenceResource, AbstractMentionResource, AbstractPresenceResource, DefaultMentionNameResolver, MentionNameStatus,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import TeamMentionResource from './api/TeamMentionResource';
|
|
3
|
-
import PresenceResource, { AbstractPresenceResource } from './api/PresenceResource';
|
|
4
|
-
import { isSpecialMention } from './types';
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
5
2
|
import { ELEMENTS_CHANNEL } from './_constants';
|
|
3
|
+
import { AbstractMentionResource } from './api/AbstractMentionResource';
|
|
4
|
+
import { AbstractPresenceResource } from './api/AbstractPresenceResource';
|
|
6
5
|
import ContextMentionResource from './api/ContextMentionResource';
|
|
6
|
+
import MentionResource from './api/MentionResource';
|
|
7
|
+
import PresenceResource from './api/PresenceResource';
|
|
8
|
+
import TeamMentionResource from './api/TeamMentionResource';
|
|
9
|
+
import { isSpecialMention } from './is-special-mention';
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `import ContextMentionResource, { MentionResource, PresenceResource, isSpecialMention, ELEMENTS_CHANNEL } from '@atlaskit/mention/context-mention-resource'` instead.
|
|
12
|
+
*/
|
|
7
13
|
export {
|
|
8
14
|
// Classes
|
|
9
15
|
ContextMentionResource, MentionResource, TeamMentionResource, PresenceResource, AbstractMentionResource, AbstractPresenceResource,
|
package/dist/esm/typeahead.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
1
2
|
import { MentionPickerWithAnalytics as MentionPicker } from './components/MentionPicker';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `import { MentionPickerWithAnalytics } from '@atlaskit/mention/mention-picker'` instead.
|
|
6
|
+
*/
|
|
2
7
|
export {
|
|
3
8
|
// Components
|
|
4
9
|
MentionPicker as MentionTypeAhead };
|
package/dist/esm/types.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Configuration for the MentionResource, which provides a JavaScript API
|
|
3
5
|
* for fetching and searching user mentions from a remote service.
|
|
@@ -87,26 +89,31 @@ export var MentionNameStatus = /*#__PURE__*/function (MentionNameStatus) {
|
|
|
87
89
|
MentionNameStatus[MentionNameStatus["OK"] = 2] = "OK";
|
|
88
90
|
return MentionNameStatus;
|
|
89
91
|
}({});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
export
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Use `import { isRestricted } from '@atlaskit/mention/types'` instead.
|
|
94
|
+
*/
|
|
95
|
+
export { isRestricted } from './is-restricted';
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated Use `import { isSpecialMention } from '@atlaskit/mention/types'` instead.
|
|
98
|
+
*/
|
|
99
|
+
export { isSpecialMention } from './is-special-mention';
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated Use `import { isAppMention } from '@atlaskit/mention/types'` instead.
|
|
102
|
+
*/
|
|
103
|
+
export { isAppMention } from './is-app-mention';
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated Use `import { isAgentMention } from '@atlaskit/mention/types'` instead.
|
|
106
|
+
*/
|
|
107
|
+
export { isAgentMention } from './is-agent-mention';
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated Use `import { isTeamMention } from '@atlaskit/mention/types'` instead.
|
|
110
|
+
*/
|
|
111
|
+
export { isTeamMention } from './is-team-mention';
|
|
112
|
+
/**
|
|
113
|
+
* @deprecated Use `import { isSpecialMentionText } from '@atlaskit/mention/types'` instead.
|
|
114
|
+
*/
|
|
115
|
+
export { isSpecialMentionText } from './is-special-mention-text';
|
|
116
|
+
/**
|
|
117
|
+
* @deprecated Use `import { isPromise } from '@atlaskit/mention/types'` instead.
|
|
118
|
+
*/
|
|
119
|
+
export { isPromise } from './is-promise';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Used to prevent invalid mouse move detection on scroll
|
|
2
|
+
// lastPosition is object (x, y)
|
|
3
|
+
export function actualMouseMove(oldPosition, newPosition) {
|
|
4
|
+
if (!oldPosition || oldPosition.x !== newPosition.x || oldPosition.y !== newPosition.y) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
@@ -1,109 +1,39 @@
|
|
|
1
|
-
|
|
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 { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
5
|
-
import { ELEMENTS_CHANNEL } from '../_constants';
|
|
6
|
-
import { ComponentNames, isSpecialMentionText } from '../types';
|
|
7
|
-
var packageName = "@atlaskit/mention";
|
|
8
|
-
var packageVersion = "27.16.0";
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
9
2
|
export var SLI_EVENT_TYPE = 'sli';
|
|
10
3
|
export var SMART_EVENT_TYPE = 'smart';
|
|
11
|
-
export var fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
|
|
12
|
-
return function (action, duration) {
|
|
13
|
-
var userIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
14
|
-
var query = arguments.length > 3 ? arguments[3] : undefined;
|
|
15
|
-
if (props.createAnalyticsEvent) {
|
|
16
|
-
var eventPayload = {
|
|
17
|
-
action: action,
|
|
18
|
-
actionSubject: ComponentNames.TYPEAHEAD,
|
|
19
|
-
attributes: {
|
|
20
|
-
packageName: packageName,
|
|
21
|
-
packageVersion: packageVersion,
|
|
22
|
-
componentName: ComponentNames.MENTION,
|
|
23
|
-
duration: Math.round(duration),
|
|
24
|
-
userIds: userIds,
|
|
25
|
-
queryLength: query ? query.length : 0
|
|
26
|
-
},
|
|
27
|
-
eventType: OPERATIONAL_EVENT_TYPE
|
|
28
|
-
};
|
|
29
|
-
var analyticsEvent = props.createAnalyticsEvent(eventPayload);
|
|
30
|
-
analyticsEvent.fire(ELEMENTS_CHANNEL);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export var fireAnalyticsMentionEvent = function fireAnalyticsMentionEvent(createEvent) {
|
|
35
|
-
return function (actionSubject, action, text, id, accessLevel) {
|
|
36
|
-
var payload = {
|
|
37
|
-
action: action,
|
|
38
|
-
actionSubject: actionSubject,
|
|
39
|
-
eventType: UI_EVENT_TYPE,
|
|
40
|
-
attributes: {
|
|
41
|
-
packageName: packageName,
|
|
42
|
-
packageVersion: packageVersion,
|
|
43
|
-
componentName: ComponentNames.MENTION,
|
|
44
|
-
accessLevel: accessLevel,
|
|
45
|
-
isSpecial: isSpecialMentionText(text),
|
|
46
|
-
userId: id
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var event = createEvent(payload);
|
|
50
|
-
event.fire(ELEMENTS_CHANNEL);
|
|
51
|
-
return event;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
export var fireSliAnalyticsEvent = function fireSliAnalyticsEvent(props) {
|
|
55
|
-
return function (actionSubject, action) {
|
|
56
|
-
if (props.createAnalyticsEvent) {
|
|
57
|
-
var eventPayload = buildSliPayload(actionSubject, action);
|
|
58
|
-
props.createAnalyticsEvent(eventPayload).fire(ELEMENTS_CHANNEL);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export var buildSliPayload = function buildSliPayload(actionSubject, action, attributes) {
|
|
63
|
-
var eventPayload = {
|
|
64
|
-
action: action,
|
|
65
|
-
actionSubject: actionSubject,
|
|
66
|
-
eventType: OPERATIONAL_EVENT_TYPE,
|
|
67
|
-
attributes: _objectSpread({
|
|
68
|
-
packageName: packageName,
|
|
69
|
-
packageVersion: packageVersion,
|
|
70
|
-
componentName: ComponentNames.MENTION
|
|
71
|
-
}, attributes)
|
|
72
|
-
};
|
|
73
|
-
return eventPayload;
|
|
74
|
-
};
|
|
75
|
-
export var fireAnalyticsMentionHydrationEvent = function fireAnalyticsMentionHydrationEvent(props) {
|
|
76
|
-
return function (action, userId, fromCache, duration) {
|
|
77
|
-
if (props.createAnalyticsEvent) {
|
|
78
|
-
var eventPayload = {
|
|
79
|
-
action: action,
|
|
80
|
-
actionSubject: ComponentNames.MENTION,
|
|
81
|
-
actionSubjectId: 'hydration',
|
|
82
|
-
attributes: {
|
|
83
|
-
packageName: packageName,
|
|
84
|
-
packageVersion: packageVersion,
|
|
85
|
-
componentName: ComponentNames.MENTION,
|
|
86
|
-
userId: userId,
|
|
87
|
-
fromCache: fromCache,
|
|
88
|
-
duration: Math.round(duration)
|
|
89
|
-
},
|
|
90
|
-
eventType: OPERATIONAL_EVENT_TYPE
|
|
91
|
-
};
|
|
92
|
-
var analyticsEvent = props.createAnalyticsEvent(eventPayload);
|
|
93
|
-
analyticsEvent.fire(ELEMENTS_CHANNEL);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
4
|
|
|
98
5
|
// OLD Analytics
|
|
99
|
-
var MENTION_ANALYTICS_PREFIX = 'atlassian.fabric.mention';
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
6
|
+
export var MENTION_ANALYTICS_PREFIX = 'atlassian.fabric.mention';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `import { fireAnalyticsMentionTypeaheadEvent } from '@atlaskit/mention/analytics'` instead.
|
|
10
|
+
*/
|
|
11
|
+
export { fireAnalyticsMentionTypeaheadEvent } from './fire-analytics-mention-typeahead-event';
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `import { fireAnalyticsMentionEvent } from '@atlaskit/mention/analytics'` instead.
|
|
14
|
+
*/
|
|
15
|
+
export { fireAnalyticsMentionEvent } from './fire-analytics-mention-event';
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use `import { fireSliAnalyticsEvent } from '@atlaskit/mention/analytics'` instead.
|
|
18
|
+
*/
|
|
19
|
+
export { fireSliAnalyticsEvent } from './fire-sli-analytics-event';
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use `import { buildSliPayload } from '@atlaskit/mention/analytics'` instead.
|
|
22
|
+
*/
|
|
23
|
+
export { buildSliPayload } from './build-sli-payload';
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use `import { fireAnalyticsMentionHydrationEvent } from '@atlaskit/mention/analytics'` instead.
|
|
26
|
+
*/
|
|
27
|
+
export { fireAnalyticsMentionHydrationEvent } from './fire-analytics-mention-hydration-event';
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use `import { fireAnalytics } from '@atlaskit/mention/analytics'` instead.
|
|
30
|
+
*/
|
|
31
|
+
export { fireAnalytics } from './fire-analytics';
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `import { packageName } from '@atlaskit/mention/analytics'` instead.
|
|
34
|
+
*/
|
|
35
|
+
export { packageName } from './package-name';
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use `import { packageVersion } from '@atlaskit/mention/analytics'` instead.
|
|
38
|
+
*/
|
|
39
|
+
export { packageVersion } from './package-version';
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
5
|
+
import { ComponentNames } from '../types';
|
|
6
|
+
import { packageName } from './package-name';
|
|
7
|
+
import { packageVersion } from './package-version';
|
|
8
|
+
export var buildSliPayload = function buildSliPayload(actionSubject, action, attributes) {
|
|
9
|
+
var eventPayload = {
|
|
10
|
+
action: action,
|
|
11
|
+
actionSubject: actionSubject,
|
|
12
|
+
eventType: OPERATIONAL_EVENT_TYPE,
|
|
13
|
+
attributes: _objectSpread({
|
|
14
|
+
packageName: packageName,
|
|
15
|
+
packageVersion: packageVersion,
|
|
16
|
+
componentName: ComponentNames.MENTION
|
|
17
|
+
}, attributes)
|
|
18
|
+
};
|
|
19
|
+
return eventPayload;
|
|
20
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UI_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
2
|
+
import { ELEMENTS_CHANNEL } from '../_constants';
|
|
3
|
+
import { isSpecialMentionText } from '../is-special-mention-text';
|
|
4
|
+
import { ComponentNames } from '../types';
|
|
5
|
+
import { packageName } from './package-name';
|
|
6
|
+
import { packageVersion } from './package-version';
|
|
7
|
+
export var fireAnalyticsMentionEvent = function fireAnalyticsMentionEvent(createEvent) {
|
|
8
|
+
return function (actionSubject, action, text, id, accessLevel) {
|
|
9
|
+
var payload = {
|
|
10
|
+
action: action,
|
|
11
|
+
actionSubject: actionSubject,
|
|
12
|
+
eventType: UI_EVENT_TYPE,
|
|
13
|
+
attributes: {
|
|
14
|
+
packageName: packageName,
|
|
15
|
+
packageVersion: packageVersion,
|
|
16
|
+
componentName: ComponentNames.MENTION,
|
|
17
|
+
accessLevel: accessLevel,
|
|
18
|
+
isSpecial: isSpecialMentionText(text),
|
|
19
|
+
userId: id
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var event = createEvent(payload);
|
|
23
|
+
event.fire(ELEMENTS_CHANNEL);
|
|
24
|
+
return event;
|
|
25
|
+
};
|
|
26
|
+
};
|