@atlaskit/mention 19.9.0 → 19.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/api/MentionResource.js +1 -1
- package/dist/cjs/api/PresenceResource.js +1 -1
- package/dist/cjs/api/SmartMentionResource.js +8 -10
- package/dist/cjs/api/analytics.js +1 -1
- package/dist/cjs/api/recommendationClient.js +2 -1
- package/dist/cjs/components/Mention/index.js +1 -1
- package/dist/cjs/components/MentionItem/styles.js +1 -1
- package/dist/cjs/components/MentionListError/styles.js +1 -1
- package/dist/cjs/components/MentionPicker/styles.js +1 -1
- package/dist/cjs/components/TeamMentionHighlight/TeamMentionHighlightController.js +1 -1
- package/dist/cjs/components/TeamMentionHighlight/styles.js +1 -1
- package/dist/cjs/config/index.js +3 -27
- package/dist/cjs/default-mention-name-resolver/default-mention-name-resolver.js +4 -3
- package/dist/cjs/i18n/index.js +36 -36
- package/dist/cjs/index.js +39 -39
- package/dist/cjs/item.js +4 -4
- package/dist/cjs/resource.js +22 -22
- package/dist/cjs/shared-styles.js +1 -1
- package/dist/cjs/team-resource.js +16 -16
- package/dist/cjs/types.js +4 -3
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/cjs/util/i18n.js +1 -1
- package/dist/cjs/util/logger.js +1 -1
- package/dist/cjs/util/mouse.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/SmartMentionResource.js +7 -7
- package/dist/es2019/api/recommendationClient.js +2 -2
- package/dist/es2019/config/index.js +2 -20
- package/dist/es2019/default-mention-name-resolver/default-mention-name-resolver.js +5 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/SmartMentionResource.js +8 -9
- package/dist/esm/api/recommendationClient.js +2 -2
- package/dist/esm/config/index.js +1 -20
- package/dist/esm/default-mention-name-resolver/default-mention-name-resolver.js +5 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/api/SmartMentionResource.d.ts +4 -6
- package/dist/types/api/SmartMentionTypes.d.ts +1 -2
- package/dist/types/config/index.d.ts +5 -8
- package/dist/types/default-mention-name-resolver/default-mention-name-resolver.d.ts +8 -0
- package/docs/1-in-editor.tsx +7 -9
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/mention
|
|
2
2
|
|
|
3
|
+
## 19.9.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e770c0c16d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e770c0c16d9) - Remove non-prod API configs from mentions, and update docs to mock out API calls.
|
|
8
|
+
|
|
9
|
+
## 19.9.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`d1ed723c1e0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d1ed723c1e0) - Fix bug where includeTeams in smartMentionResource was not being passed in correctly
|
|
14
|
+
|
|
15
|
+
## 19.9.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`570ccaa00bd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/570ccaa00bd) - Add the ability for users in Default Mention Name Resolver to be nullable
|
|
20
|
+
|
|
21
|
+
## 19.9.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [`a92e3bdb515`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a92e3bdb515) - Relaxed product enum typing to take in any string
|
|
26
|
+
|
|
3
27
|
## 19.9.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.isResolvingMentionProvider = exports.default = exports.MentionResource = exports.HttpError = exports.AbstractResource = exports.AbstractMentionResource = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
8
|
+
exports.default = exports.DefaultPresenceParser = exports.DefaultPresenceCache = exports.AbstractPresenceResource = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -27,8 +27,6 @@ var _analytics = require("./analytics");
|
|
|
27
27
|
|
|
28
28
|
var _recommendationClient = _interopRequireDefault(require("./recommendationClient"));
|
|
29
29
|
|
|
30
|
-
var _config = require("../config");
|
|
31
|
-
|
|
32
30
|
var _SmartMentionTypes = require("./SmartMentionTypes");
|
|
33
31
|
|
|
34
32
|
var _types = require("../types");
|
|
@@ -74,12 +72,7 @@ var SmartMentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
|
|
|
74
72
|
_this.smartMentionConfig = isSmartMentionConfigWithMentionNameResolver(smartMentionConfig) ? smartMentionConfig : _objectSpread(_objectSpread({}, smartMentionConfig), {}, {
|
|
75
73
|
mentionNameResolver: new _defaultMentionNameResolver.DefaultMentionNameResolver(smartMentionConfig.baseUrl)
|
|
76
74
|
});
|
|
77
|
-
_this.lastReturnedSearch = 0;
|
|
78
|
-
|
|
79
|
-
if (smartMentionConfig.env) {
|
|
80
|
-
(0, _config.setEnv)(smartMentionConfig.env);
|
|
81
|
-
}
|
|
82
|
-
|
|
75
|
+
_this.lastReturnedSearch = 0;
|
|
83
76
|
return _this;
|
|
84
77
|
}
|
|
85
78
|
|
|
@@ -165,17 +158,22 @@ var SmartMentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
|
|
|
165
158
|
maxNumberOfResults = conf.maxNumberOfResults || 100;
|
|
166
159
|
request = {
|
|
167
160
|
baseUrl: conf.baseUrl,
|
|
168
|
-
context:
|
|
161
|
+
context: {
|
|
162
|
+
productKey: conf.productKey,
|
|
169
163
|
contextType: CONTEXT_TYPE,
|
|
170
164
|
principalId: conf.principalId || 'context',
|
|
171
165
|
containerId: contextIdentifier && contextIdentifier.containerId,
|
|
166
|
+
siteId: conf.siteId,
|
|
172
167
|
objectId: contextIdentifier && contextIdentifier.objectId || 'undefined',
|
|
173
168
|
childObjectId: contextIdentifier && contextIdentifier.childObjectId || 'undefined',
|
|
174
169
|
mentionsSessionId: contextIdentifier && contextIdentifier.sessionId || 'undefined',
|
|
175
170
|
sessionId: contextIdentifier && contextIdentifier.sessionId || 'undefined'
|
|
176
|
-
}
|
|
171
|
+
},
|
|
172
|
+
includeGroups: conf.includeGroups,
|
|
173
|
+
includeTeams: conf.includeTeams,
|
|
177
174
|
includeUsers: typeof conf.includeUsers === 'undefined' ? true : conf.includeUsers,
|
|
178
175
|
maxNumberOfResults: maxNumberOfResults,
|
|
176
|
+
searchQueryFilter: conf.searchQueryFilter,
|
|
179
177
|
query: query
|
|
180
178
|
};
|
|
181
179
|
_context2.prev = 4;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getUsersForAnalytics = exports.defaultAttributes = exports.
|
|
6
|
+
exports.getUsersForAnalytics = exports.defaultAttributes = exports.SMART_EVENT_TYPE = exports.Actions = void 0;
|
|
7
7
|
var SMART_EVENT_TYPE = 'smart';
|
|
8
8
|
exports.SMART_EVENT_TYPE = SMART_EVENT_TYPE;
|
|
9
9
|
var Actions;
|
|
@@ -8,7 +8,8 @@ exports.default = void 0;
|
|
|
8
8
|
var _config = require("../config");
|
|
9
9
|
|
|
10
10
|
var getUserRecommendations = function getUserRecommendations(request) {
|
|
11
|
-
var url =
|
|
11
|
+
var url = _config.config.getRecommendationServiceUrl(request.baseUrl);
|
|
12
|
+
|
|
12
13
|
return fetch(url, {
|
|
13
14
|
method: 'POST',
|
|
14
15
|
credentials: 'include',
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
8
|
+
exports.default = exports.UNKNOWN_USER_ID = exports.MentionInternal = exports.ANALYTICS_HOVER_DELAY = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.TimeStyle = exports.RowStyle = exports.NameSectionStyle = exports.MentionItemStyle = exports.MENTION_ITEM_HEIGHT = exports.InfoSectionStyle = exports.FullNameStyle = exports.AvatarStyle = exports.AccessSectionStyle = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.MentionListErrorStyle = exports.MentionListErrorHeadlineStyle = exports.MentionListAdviceStyle = exports.GenericErrorVisualStyle = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.MentionPickerStyle = exports.MentionPickerInfoStyle = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.mentionHighlightLocalStorageKey = exports.default = void 0;
|
|
9
9
|
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.Title = exports.Section = exports.Heading = exports.Content = exports.Card = exports.Body = exports.Aside = exports.Actions = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -3,21 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
var STG_INSTANCE = 'https://api-private.stg.atlassian.com';
|
|
9
|
-
var LOCAL_CONFIG = {
|
|
10
|
-
getRecommendationServiceUrl: function getRecommendationServiceUrl(baseUrl) {
|
|
11
|
-
return baseUrl ? "".concat(STG_INSTANCE, "/").concat(baseUrl, "/gateway/api/v1/recommendations") : "".concat(STG_INSTANCE, "/gateway/api/v1/recommendations");
|
|
12
|
-
},
|
|
13
|
-
getUsersServiceUrl: function getUsersServiceUrl(productKey) {
|
|
14
|
-
return productKey === 'jira' ? "https://jdog.jira-dev.com/rest/api/3/user/bulk" : "https://pug.jira-dev.com/wiki/rest/api/user/bulk";
|
|
15
|
-
},
|
|
16
|
-
getGraphQLUrl: function getGraphQLUrl(baseUrl) {
|
|
17
|
-
return baseUrl ? "".concat(STG_INSTANCE, "/").concat(baseUrl, "/graphql") : "".concat(STG_INSTANCE, "/gateway/api/graphql");
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var PRD_CONFIG = {
|
|
6
|
+
exports.config = void 0;
|
|
7
|
+
var config = {
|
|
21
8
|
getRecommendationServiceUrl: function getRecommendationServiceUrl(baseUrl) {
|
|
22
9
|
return baseUrl ? "/".concat(baseUrl, "/v1/recommendations") : '/gateway/api/v1/recommendations';
|
|
23
10
|
},
|
|
@@ -28,15 +15,4 @@ var PRD_CONFIG = {
|
|
|
28
15
|
return baseUrl ? "/".concat(baseUrl, "/graphql") : '/gateway/api/graphql';
|
|
29
16
|
}
|
|
30
17
|
};
|
|
31
|
-
|
|
32
|
-
var setEnv = function setEnv(newEnv) {
|
|
33
|
-
return env = newEnv;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
exports.setEnv = setEnv;
|
|
37
|
-
|
|
38
|
-
var getConfig = function getConfig() {
|
|
39
|
-
return env === 'local' ? LOCAL_CONFIG : PRD_CONFIG;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
exports.getConfig = getConfig;
|
|
18
|
+
exports.config = config;
|
|
@@ -64,7 +64,8 @@ var DefaultMentionNameResolver = /*#__PURE__*/function () {
|
|
|
64
64
|
key: "lookupName",
|
|
65
65
|
value: function () {
|
|
66
66
|
var _lookupName = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(id) {
|
|
67
|
-
var url, data, userInfo;
|
|
67
|
+
var _data$users, url, data, userInfo;
|
|
68
|
+
|
|
68
69
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
69
70
|
while (1) {
|
|
70
71
|
switch (_context2.prev = _context2.next) {
|
|
@@ -83,13 +84,13 @@ var DefaultMentionNameResolver = /*#__PURE__*/function () {
|
|
|
83
84
|
});
|
|
84
85
|
|
|
85
86
|
case 3:
|
|
86
|
-
url =
|
|
87
|
+
url = _config.config.getGraphQLUrl(this.baseUrl);
|
|
87
88
|
_context2.next = 6;
|
|
88
89
|
return makeRequest(url, [id]);
|
|
89
90
|
|
|
90
91
|
case 6:
|
|
91
92
|
data = _context2.sent;
|
|
92
|
-
userInfo = data.users.find(function (user) {
|
|
93
|
+
userInfo = (_data$users = data.users) === null || _data$users === void 0 ? void 0 : _data$users.find(function (user) {
|
|
93
94
|
return user.accountId === id;
|
|
94
95
|
});
|
|
95
96
|
return _context2.abrupt("return", userInfo ? {
|
package/dist/cjs/i18n/index.js
CHANGED
|
@@ -5,34 +5,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "cs", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _cs.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "da", {
|
|
15
15
|
enumerable: true,
|
|
16
16
|
get: function get() {
|
|
17
|
-
return
|
|
17
|
+
return _da.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
Object.defineProperty(exports, "
|
|
20
|
+
Object.defineProperty(exports, "de", {
|
|
21
21
|
enumerable: true,
|
|
22
22
|
get: function get() {
|
|
23
|
-
return
|
|
23
|
+
return _de.default;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
Object.defineProperty(exports, "
|
|
26
|
+
Object.defineProperty(exports, "en", {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function get() {
|
|
29
|
-
return
|
|
29
|
+
return _en.default;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
Object.defineProperty(exports, "
|
|
32
|
+
Object.defineProperty(exports, "en_GB", {
|
|
33
33
|
enumerable: true,
|
|
34
34
|
get: function get() {
|
|
35
|
-
return
|
|
35
|
+
return _en_GB.default;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "es", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _es.default;
|
|
36
42
|
}
|
|
37
43
|
});
|
|
38
44
|
Object.defineProperty(exports, "et", {
|
|
@@ -53,16 +59,16 @@ Object.defineProperty(exports, "fr", {
|
|
|
53
59
|
return _fr.default;
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
|
-
Object.defineProperty(exports, "
|
|
62
|
+
Object.defineProperty(exports, "hu", {
|
|
57
63
|
enumerable: true,
|
|
58
64
|
get: function get() {
|
|
59
|
-
return
|
|
65
|
+
return _hu.default;
|
|
60
66
|
}
|
|
61
67
|
});
|
|
62
|
-
Object.defineProperty(exports, "
|
|
68
|
+
Object.defineProperty(exports, "is", {
|
|
63
69
|
enumerable: true,
|
|
64
70
|
get: function get() {
|
|
65
|
-
return
|
|
71
|
+
return _is.default;
|
|
66
72
|
}
|
|
67
73
|
});
|
|
68
74
|
Object.defineProperty(exports, "it", {
|
|
@@ -89,6 +95,12 @@ Object.defineProperty(exports, "nb", {
|
|
|
89
95
|
return _nb.default;
|
|
90
96
|
}
|
|
91
97
|
});
|
|
98
|
+
Object.defineProperty(exports, "nl", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function get() {
|
|
101
|
+
return _nl.default;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
92
104
|
Object.defineProperty(exports, "pl", {
|
|
93
105
|
enumerable: true,
|
|
94
106
|
get: function get() {
|
|
@@ -107,22 +119,22 @@ Object.defineProperty(exports, "pt_PT", {
|
|
|
107
119
|
return _pt_PT.default;
|
|
108
120
|
}
|
|
109
121
|
});
|
|
110
|
-
Object.defineProperty(exports, "
|
|
122
|
+
Object.defineProperty(exports, "ro", {
|
|
111
123
|
enumerable: true,
|
|
112
124
|
get: function get() {
|
|
113
|
-
return
|
|
125
|
+
return _ro.default;
|
|
114
126
|
}
|
|
115
127
|
});
|
|
116
|
-
Object.defineProperty(exports, "
|
|
128
|
+
Object.defineProperty(exports, "ru", {
|
|
117
129
|
enumerable: true,
|
|
118
130
|
get: function get() {
|
|
119
|
-
return
|
|
131
|
+
return _ru.default;
|
|
120
132
|
}
|
|
121
133
|
});
|
|
122
|
-
Object.defineProperty(exports, "
|
|
134
|
+
Object.defineProperty(exports, "sk", {
|
|
123
135
|
enumerable: true,
|
|
124
136
|
get: function get() {
|
|
125
|
-
return
|
|
137
|
+
return _sk.default;
|
|
126
138
|
}
|
|
127
139
|
});
|
|
128
140
|
Object.defineProperty(exports, "sv", {
|
|
@@ -155,28 +167,16 @@ Object.defineProperty(exports, "vi", {
|
|
|
155
167
|
return _vi.default;
|
|
156
168
|
}
|
|
157
169
|
});
|
|
158
|
-
Object.defineProperty(exports, "
|
|
159
|
-
enumerable: true,
|
|
160
|
-
get: function get() {
|
|
161
|
-
return _en.default;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(exports, "en_GB", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function get() {
|
|
167
|
-
return _en_GB.default;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
Object.defineProperty(exports, "is", {
|
|
170
|
+
Object.defineProperty(exports, "zh", {
|
|
171
171
|
enumerable: true,
|
|
172
172
|
get: function get() {
|
|
173
|
-
return
|
|
173
|
+
return _zh.default;
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
|
-
Object.defineProperty(exports, "
|
|
176
|
+
Object.defineProperty(exports, "zh_TW", {
|
|
177
177
|
enumerable: true,
|
|
178
178
|
get: function get() {
|
|
179
|
-
return
|
|
179
|
+
return _zh_TW.default;
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -7,52 +7,40 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
Object.defineProperty(exports, "MentionResource", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _MentionResource.default;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
10
|
Object.defineProperty(exports, "AbstractMentionResource", {
|
|
17
11
|
enumerable: true,
|
|
18
12
|
get: function get() {
|
|
19
13
|
return _MentionResource.AbstractMentionResource;
|
|
20
14
|
}
|
|
21
15
|
});
|
|
22
|
-
Object.defineProperty(exports, "
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function get() {
|
|
25
|
-
return _MentionResource.isResolvingMentionProvider;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "SmartMentionResource", {
|
|
16
|
+
Object.defineProperty(exports, "AbstractPresenceResource", {
|
|
29
17
|
enumerable: true,
|
|
30
18
|
get: function get() {
|
|
31
|
-
return
|
|
19
|
+
return _PresenceResource.AbstractPresenceResource;
|
|
32
20
|
}
|
|
33
21
|
});
|
|
34
|
-
Object.defineProperty(exports, "
|
|
22
|
+
Object.defineProperty(exports, "ContextMentionResource", {
|
|
35
23
|
enumerable: true,
|
|
36
24
|
get: function get() {
|
|
37
|
-
return
|
|
25
|
+
return _ContextMentionResource.default;
|
|
38
26
|
}
|
|
39
27
|
});
|
|
40
|
-
Object.defineProperty(exports, "
|
|
28
|
+
Object.defineProperty(exports, "DefaultMentionNameResolver", {
|
|
41
29
|
enumerable: true,
|
|
42
30
|
get: function get() {
|
|
43
|
-
return
|
|
31
|
+
return _MentionNameResolver.DefaultMentionNameResolver;
|
|
44
32
|
}
|
|
45
33
|
});
|
|
46
|
-
Object.defineProperty(exports, "
|
|
34
|
+
Object.defineProperty(exports, "ELEMENTS_CHANNEL", {
|
|
47
35
|
enumerable: true,
|
|
48
36
|
get: function get() {
|
|
49
|
-
return
|
|
37
|
+
return _constants.ELEMENTS_CHANNEL;
|
|
50
38
|
}
|
|
51
39
|
});
|
|
52
|
-
Object.defineProperty(exports, "
|
|
40
|
+
Object.defineProperty(exports, "Mention", {
|
|
53
41
|
enumerable: true,
|
|
54
42
|
get: function get() {
|
|
55
|
-
return
|
|
43
|
+
return _Mention.default;
|
|
56
44
|
}
|
|
57
45
|
});
|
|
58
46
|
Object.defineProperty(exports, "MentionItem", {
|
|
@@ -67,10 +55,10 @@ Object.defineProperty(exports, "MentionList", {
|
|
|
67
55
|
return _MentionList.default;
|
|
68
56
|
}
|
|
69
57
|
});
|
|
70
|
-
Object.defineProperty(exports, "
|
|
58
|
+
Object.defineProperty(exports, "MentionNameStatus", {
|
|
71
59
|
enumerable: true,
|
|
72
60
|
get: function get() {
|
|
73
|
-
return
|
|
61
|
+
return _types.MentionNameStatus;
|
|
74
62
|
}
|
|
75
63
|
});
|
|
76
64
|
Object.defineProperty(exports, "MentionPicker", {
|
|
@@ -79,10 +67,16 @@ Object.defineProperty(exports, "MentionPicker", {
|
|
|
79
67
|
return _MentionPicker.MentionPickerWithAnalytics;
|
|
80
68
|
}
|
|
81
69
|
});
|
|
82
|
-
Object.defineProperty(exports, "
|
|
70
|
+
Object.defineProperty(exports, "MentionResource", {
|
|
83
71
|
enumerable: true,
|
|
84
72
|
get: function get() {
|
|
85
|
-
return
|
|
73
|
+
return _MentionResource.default;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "PresenceResource", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function get() {
|
|
79
|
+
return _PresenceResource.default;
|
|
86
80
|
}
|
|
87
81
|
});
|
|
88
82
|
Object.defineProperty(exports, "ResourcedMention", {
|
|
@@ -91,43 +85,49 @@ Object.defineProperty(exports, "ResourcedMention", {
|
|
|
91
85
|
return _ResourcedMention.default;
|
|
92
86
|
}
|
|
93
87
|
});
|
|
94
|
-
Object.defineProperty(exports, "
|
|
88
|
+
Object.defineProperty(exports, "ResourcedMentionList", {
|
|
95
89
|
enumerable: true,
|
|
96
90
|
get: function get() {
|
|
97
|
-
return
|
|
91
|
+
return _ResourcedMentionList.default;
|
|
98
92
|
}
|
|
99
93
|
});
|
|
100
|
-
Object.defineProperty(exports, "
|
|
94
|
+
Object.defineProperty(exports, "SmartMentionResource", {
|
|
101
95
|
enumerable: true,
|
|
102
96
|
get: function get() {
|
|
103
|
-
return
|
|
97
|
+
return _SmartMentionResource.default;
|
|
104
98
|
}
|
|
105
99
|
});
|
|
106
|
-
Object.defineProperty(exports, "
|
|
100
|
+
Object.defineProperty(exports, "TeamMentionHighlight", {
|
|
107
101
|
enumerable: true,
|
|
108
102
|
get: function get() {
|
|
109
|
-
return
|
|
103
|
+
return _TeamMentionHighlight.default;
|
|
110
104
|
}
|
|
111
105
|
});
|
|
112
|
-
Object.defineProperty(exports, "
|
|
106
|
+
Object.defineProperty(exports, "TeamMentionHighlightController", {
|
|
113
107
|
enumerable: true,
|
|
114
108
|
get: function get() {
|
|
115
|
-
return
|
|
109
|
+
return _TeamMentionHighlightController.default;
|
|
116
110
|
}
|
|
117
111
|
});
|
|
118
|
-
Object.defineProperty(exports, "
|
|
112
|
+
Object.defineProperty(exports, "TeamMentionResource", {
|
|
119
113
|
enumerable: true,
|
|
120
114
|
get: function get() {
|
|
121
|
-
return
|
|
115
|
+
return _TeamMentionResource.default;
|
|
122
116
|
}
|
|
123
117
|
});
|
|
124
|
-
|
|
118
|
+
exports.default = void 0;
|
|
119
|
+
Object.defineProperty(exports, "isResolvingMentionProvider", {
|
|
125
120
|
enumerable: true,
|
|
126
121
|
get: function get() {
|
|
127
|
-
return
|
|
122
|
+
return _MentionResource.isResolvingMentionProvider;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(exports, "isSpecialMention", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
get: function get() {
|
|
128
|
+
return _types.isSpecialMention;
|
|
128
129
|
}
|
|
129
130
|
});
|
|
130
|
-
exports.default = void 0;
|
|
131
131
|
|
|
132
132
|
var _MentionResource = _interopRequireWildcard(require("./api/MentionResource"));
|
|
133
133
|
|
package/dist/cjs/item.js
CHANGED
|
@@ -5,16 +5,16 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "MENTION_ITEM_HEIGHT", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return _MentionItem.
|
|
11
|
+
return _MentionItem.MENTION_ITEM_HEIGHT;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "MentionItem", {
|
|
15
15
|
enumerable: true,
|
|
16
16
|
get: function get() {
|
|
17
|
-
return _MentionItem.
|
|
17
|
+
return _MentionItem.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
|
package/dist/cjs/resource.js
CHANGED
|
@@ -7,34 +7,22 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
Object.defineProperty(exports, "MentionResource", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _MentionResource.default;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
10
|
Object.defineProperty(exports, "AbstractMentionResource", {
|
|
17
11
|
enumerable: true,
|
|
18
12
|
get: function get() {
|
|
19
13
|
return _MentionResource.AbstractMentionResource;
|
|
20
14
|
}
|
|
21
15
|
});
|
|
22
|
-
Object.defineProperty(exports, "
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function get() {
|
|
25
|
-
return _MentionResource.isResolvingMentionProvider;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(exports, "PresenceResource", {
|
|
16
|
+
Object.defineProperty(exports, "AbstractPresenceResource", {
|
|
29
17
|
enumerable: true,
|
|
30
18
|
get: function get() {
|
|
31
|
-
return _PresenceResource.
|
|
19
|
+
return _PresenceResource.AbstractPresenceResource;
|
|
32
20
|
}
|
|
33
21
|
});
|
|
34
|
-
Object.defineProperty(exports, "
|
|
22
|
+
Object.defineProperty(exports, "ContextMentionResource", {
|
|
35
23
|
enumerable: true,
|
|
36
24
|
get: function get() {
|
|
37
|
-
return
|
|
25
|
+
return _ContextMentionResource.default;
|
|
38
26
|
}
|
|
39
27
|
});
|
|
40
28
|
Object.defineProperty(exports, "DefaultMentionNameResolver", {
|
|
@@ -43,10 +31,10 @@ Object.defineProperty(exports, "DefaultMentionNameResolver", {
|
|
|
43
31
|
return _MentionNameResolver.DefaultMentionNameResolver;
|
|
44
32
|
}
|
|
45
33
|
});
|
|
46
|
-
Object.defineProperty(exports, "
|
|
34
|
+
Object.defineProperty(exports, "ELEMENTS_CHANNEL", {
|
|
47
35
|
enumerable: true,
|
|
48
36
|
get: function get() {
|
|
49
|
-
return
|
|
37
|
+
return _constants.ELEMENTS_CHANNEL;
|
|
50
38
|
}
|
|
51
39
|
});
|
|
52
40
|
Object.defineProperty(exports, "MentionNameStatus", {
|
|
@@ -55,16 +43,16 @@ Object.defineProperty(exports, "MentionNameStatus", {
|
|
|
55
43
|
return _types.MentionNameStatus;
|
|
56
44
|
}
|
|
57
45
|
});
|
|
58
|
-
Object.defineProperty(exports, "
|
|
46
|
+
Object.defineProperty(exports, "MentionResource", {
|
|
59
47
|
enumerable: true,
|
|
60
48
|
get: function get() {
|
|
61
|
-
return
|
|
49
|
+
return _MentionResource.default;
|
|
62
50
|
}
|
|
63
51
|
});
|
|
64
|
-
Object.defineProperty(exports, "
|
|
52
|
+
Object.defineProperty(exports, "PresenceResource", {
|
|
65
53
|
enumerable: true,
|
|
66
54
|
get: function get() {
|
|
67
|
-
return
|
|
55
|
+
return _PresenceResource.default;
|
|
68
56
|
}
|
|
69
57
|
});
|
|
70
58
|
Object.defineProperty(exports, "SLI_EVENT_TYPE", {
|
|
@@ -85,6 +73,18 @@ Object.defineProperty(exports, "buildSliPayload", {
|
|
|
85
73
|
return _analytics.buildSliPayload;
|
|
86
74
|
}
|
|
87
75
|
});
|
|
76
|
+
Object.defineProperty(exports, "isResolvingMentionProvider", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function get() {
|
|
79
|
+
return _MentionResource.isResolvingMentionProvider;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "isSpecialMention", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function get() {
|
|
85
|
+
return _types.isSpecialMention;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
88
|
|
|
89
89
|
var _MentionResource = _interopRequireWildcard(require("./api/MentionResource"));
|
|
90
90
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.scrollableMaxHeight = exports.noDialogContainerBoxShadow = exports.noDialogContainerBorderRadius = exports.noDialogContainerBorderColor = exports.mentionListWidth = void 0;
|
|
7
7
|
|
|
8
8
|
var _constants = require("@atlaskit/theme/constants");
|
|
9
9
|
|
|
@@ -7,52 +7,52 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
Object.defineProperty(exports, "
|
|
10
|
+
Object.defineProperty(exports, "AbstractMentionResource", {
|
|
11
11
|
enumerable: true,
|
|
12
12
|
get: function get() {
|
|
13
|
-
return _MentionResource.
|
|
13
|
+
return _MentionResource.AbstractMentionResource;
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
Object.defineProperty(exports, "
|
|
16
|
+
Object.defineProperty(exports, "AbstractPresenceResource", {
|
|
17
17
|
enumerable: true,
|
|
18
18
|
get: function get() {
|
|
19
|
-
return
|
|
19
|
+
return _PresenceResource.AbstractPresenceResource;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
Object.defineProperty(exports, "
|
|
22
|
+
Object.defineProperty(exports, "ContextMentionResource", {
|
|
23
23
|
enumerable: true,
|
|
24
24
|
get: function get() {
|
|
25
|
-
return
|
|
25
|
+
return _ContextMentionResource.default;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
Object.defineProperty(exports, "
|
|
28
|
+
Object.defineProperty(exports, "ELEMENTS_CHANNEL", {
|
|
29
29
|
enumerable: true,
|
|
30
30
|
get: function get() {
|
|
31
|
-
return
|
|
31
|
+
return _constants.ELEMENTS_CHANNEL;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
Object.defineProperty(exports, "
|
|
34
|
+
Object.defineProperty(exports, "MentionResource", {
|
|
35
35
|
enumerable: true,
|
|
36
36
|
get: function get() {
|
|
37
|
-
return
|
|
37
|
+
return _MentionResource.default;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
Object.defineProperty(exports, "
|
|
40
|
+
Object.defineProperty(exports, "PresenceResource", {
|
|
41
41
|
enumerable: true,
|
|
42
42
|
get: function get() {
|
|
43
|
-
return
|
|
43
|
+
return _PresenceResource.default;
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
Object.defineProperty(exports, "
|
|
46
|
+
Object.defineProperty(exports, "TeamMentionResource", {
|
|
47
47
|
enumerable: true,
|
|
48
48
|
get: function get() {
|
|
49
|
-
return
|
|
49
|
+
return _TeamMentionResource.default;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
Object.defineProperty(exports, "
|
|
52
|
+
Object.defineProperty(exports, "isSpecialMention", {
|
|
53
53
|
enumerable: true,
|
|
54
54
|
get: function get() {
|
|
55
|
-
return
|
|
55
|
+
return _types.isSpecialMention;
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
|
package/dist/cjs/types.js
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.UserType = exports.UserAccessLevel = exports.MentionType = exports.MentionNameStatus = void 0;
|
|
7
|
+
exports.isAppMention = isAppMention;
|
|
8
|
+
exports.isPromise = void 0;
|
|
6
9
|
exports.isRestricted = isRestricted;
|
|
7
10
|
exports.isSpecialMention = isSpecialMention;
|
|
8
|
-
exports.isAppMention = isAppMention;
|
|
9
|
-
exports.isTeamMention = isTeamMention;
|
|
10
11
|
exports.isSpecialMentionText = isSpecialMentionText;
|
|
11
|
-
exports.
|
|
12
|
+
exports.isTeamMention = isTeamMention;
|
|
12
13
|
// data is returned from team search service
|
|
13
14
|
var MentionType;
|
|
14
15
|
exports.MentionType = MentionType;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.fireSliAnalyticsEvent = exports.fireAnalyticsTeamMentionHighlightEvent = exports.fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionHydrationEvent = exports.fireAnalyticsMentionEvent = exports.fireAnalytics = exports.buildSliPayload = exports.SliNames = exports.SMART_EVENT_TYPE = exports.SLI_EVENT_TYPE = exports.ComponentNames = exports.Actions = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
package/dist/cjs/util/i18n.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.noPropFormatter = exports.TeamMentionHighlightTitle = exports.TeamMentionHighlightDescriptionLink = exports.TeamMentionHighlightDescription = exports.TeamMentionHighlightCloseTooltip = exports.NoAccessWarning = exports.NoAccessLabel = exports.LoginAgain = exports.DifferentText = exports.DefaultHeadline = exports.DefaultAdvisedAction = void 0;
|
|
9
9
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
|
package/dist/cjs/util/logger.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.default = debug;
|
|
6
7
|
exports.enableLogger = enableLogger;
|
|
7
8
|
exports.enableStacktraces = enableStacktraces;
|
|
8
9
|
exports.logStacktrace = logStacktrace;
|
|
9
|
-
exports.default = debug;
|
|
10
10
|
var debugEnabled = false;
|
|
11
11
|
var stacktracesEnabled = false;
|
|
12
12
|
|
package/dist/cjs/util/mouse.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.mouseLocation = mouseLocation;
|
|
7
6
|
exports.actualMouseMove = actualMouseMove;
|
|
8
7
|
exports.leftClick = leftClick;
|
|
8
|
+
exports.mouseLocation = mouseLocation;
|
|
9
9
|
|
|
10
10
|
function mouseLocation(event) {
|
|
11
11
|
return {
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SMART_EVENT_TYPE, Actions, getUsersForAnalytics, defaultAttributes } from './analytics';
|
|
2
2
|
import getUserRecommendations from './recommendationClient';
|
|
3
|
-
import { setEnv } from '../config';
|
|
4
3
|
import { EntityType } from './SmartMentionTypes';
|
|
5
4
|
import { UserAccessLevel, UserType as MentionUserType } from '../types';
|
|
6
5
|
import { AbstractMentionResource } from '../resource';
|
|
@@ -25,11 +24,7 @@ class SmartMentionResource extends AbstractMentionResource {
|
|
|
25
24
|
this.smartMentionConfig = isSmartMentionConfigWithMentionNameResolver(smartMentionConfig) ? smartMentionConfig : { ...smartMentionConfig,
|
|
26
25
|
mentionNameResolver: new DefaultMentionNameResolver(smartMentionConfig.baseUrl)
|
|
27
26
|
};
|
|
28
|
-
this.lastReturnedSearch = 0;
|
|
29
|
-
|
|
30
|
-
if (smartMentionConfig.env) {
|
|
31
|
-
setEnv(smartMentionConfig.env);
|
|
32
|
-
}
|
|
27
|
+
this.lastReturnedSearch = 0;
|
|
33
28
|
}
|
|
34
29
|
|
|
35
30
|
shouldHighlightMention(mention) {
|
|
@@ -74,17 +69,22 @@ class SmartMentionResource extends AbstractMentionResource {
|
|
|
74
69
|
const maxNumberOfResults = conf.maxNumberOfResults || 100;
|
|
75
70
|
const request = {
|
|
76
71
|
baseUrl: conf.baseUrl,
|
|
77
|
-
context: {
|
|
72
|
+
context: {
|
|
73
|
+
productKey: conf.productKey,
|
|
78
74
|
contextType: CONTEXT_TYPE,
|
|
79
75
|
principalId: conf.principalId || 'context',
|
|
80
76
|
containerId: contextIdentifier && contextIdentifier.containerId,
|
|
77
|
+
siteId: conf.siteId,
|
|
81
78
|
objectId: contextIdentifier && contextIdentifier.objectId || 'undefined',
|
|
82
79
|
childObjectId: contextIdentifier && contextIdentifier.childObjectId || 'undefined',
|
|
83
80
|
mentionsSessionId: contextIdentifier && contextIdentifier.sessionId || 'undefined',
|
|
84
81
|
sessionId: contextIdentifier && contextIdentifier.sessionId || 'undefined'
|
|
85
82
|
},
|
|
83
|
+
includeGroups: conf.includeGroups,
|
|
84
|
+
includeTeams: conf.includeTeams,
|
|
86
85
|
includeUsers: typeof conf.includeUsers === 'undefined' ? true : conf.includeUsers,
|
|
87
86
|
maxNumberOfResults: maxNumberOfResults,
|
|
87
|
+
searchQueryFilter: conf.searchQueryFilter,
|
|
88
88
|
query
|
|
89
89
|
};
|
|
90
90
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { config } from '../config';
|
|
2
2
|
|
|
3
3
|
const getUserRecommendations = request => {
|
|
4
|
-
const url =
|
|
4
|
+
const url = config.getRecommendationServiceUrl(request.baseUrl);
|
|
5
5
|
return fetch(url, {
|
|
6
6
|
method: 'POST',
|
|
7
7
|
credentials: 'include',
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const STG_INSTANCE = 'https://api-private.stg.atlassian.com';
|
|
3
|
-
const LOCAL_CONFIG = {
|
|
4
|
-
getRecommendationServiceUrl(baseUrl) {
|
|
5
|
-
return baseUrl ? `${STG_INSTANCE}/${baseUrl}/gateway/api/v1/recommendations` : `${STG_INSTANCE}/gateway/api/v1/recommendations`;
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
getUsersServiceUrl(productKey) {
|
|
9
|
-
return productKey === 'jira' ? `https://jdog.jira-dev.com/rest/api/3/user/bulk` : `https://pug.jira-dev.com/wiki/rest/api/user/bulk`;
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
getGraphQLUrl(baseUrl) {
|
|
13
|
-
return baseUrl ? `${STG_INSTANCE}/${baseUrl}/graphql` : `${STG_INSTANCE}/gateway/api/graphql`;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
const PRD_CONFIG = {
|
|
1
|
+
export const config = {
|
|
18
2
|
getRecommendationServiceUrl(baseUrl) {
|
|
19
3
|
return baseUrl ? `/${baseUrl}/v1/recommendations` : '/gateway/api/v1/recommendations';
|
|
20
4
|
},
|
|
@@ -27,6 +11,4 @@ const PRD_CONFIG = {
|
|
|
27
11
|
return baseUrl ? `/${baseUrl}/graphql` : '/gateway/api/graphql';
|
|
28
12
|
}
|
|
29
13
|
|
|
30
|
-
};
|
|
31
|
-
export const setEnv = newEnv => env = newEnv;
|
|
32
|
-
export const getConfig = () => env === 'local' ? LOCAL_CONFIG : PRD_CONFIG;
|
|
14
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MentionNameStatus } from '../types';
|
|
2
2
|
import { graphqlQuery } from './graphqlUtils';
|
|
3
|
-
import {
|
|
3
|
+
import { config } from '../config';
|
|
4
4
|
|
|
5
5
|
const buildUsersQuery = accountIds => ({
|
|
6
6
|
query: `query usersQuery($accountIds: [ID!]!) {
|
|
@@ -27,6 +27,8 @@ export class DefaultMentionNameResolver {
|
|
|
27
27
|
|
|
28
28
|
async lookupName(id) {
|
|
29
29
|
try {
|
|
30
|
+
var _data$users;
|
|
31
|
+
|
|
30
32
|
if (this.cache.has(id)) {
|
|
31
33
|
return {
|
|
32
34
|
id,
|
|
@@ -35,9 +37,9 @@ export class DefaultMentionNameResolver {
|
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
const url =
|
|
40
|
+
const url = config.getGraphQLUrl(this.baseUrl);
|
|
39
41
|
const data = await makeRequest(url, [id]);
|
|
40
|
-
const userInfo = data.users.find(user => user.accountId === id);
|
|
42
|
+
const userInfo = (_data$users = data.users) === null || _data$users === void 0 ? void 0 : _data$users.find(user => user.accountId === id);
|
|
41
43
|
return userInfo ? {
|
|
42
44
|
id,
|
|
43
45
|
name: userInfo.name,
|
package/dist/es2019/version.json
CHANGED
|
@@ -17,7 +17,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
17
17
|
|
|
18
18
|
import { SMART_EVENT_TYPE, Actions, getUsersForAnalytics, defaultAttributes } from './analytics';
|
|
19
19
|
import getUserRecommendations from './recommendationClient';
|
|
20
|
-
import { setEnv } from '../config';
|
|
21
20
|
import { EntityType } from './SmartMentionTypes';
|
|
22
21
|
import { UserAccessLevel, UserType as MentionUserType } from '../types';
|
|
23
22
|
import { AbstractMentionResource } from '../resource';
|
|
@@ -52,12 +51,7 @@ var SmartMentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
|
|
|
52
51
|
_this.smartMentionConfig = isSmartMentionConfigWithMentionNameResolver(smartMentionConfig) ? smartMentionConfig : _objectSpread(_objectSpread({}, smartMentionConfig), {}, {
|
|
53
52
|
mentionNameResolver: new DefaultMentionNameResolver(smartMentionConfig.baseUrl)
|
|
54
53
|
});
|
|
55
|
-
_this.lastReturnedSearch = 0;
|
|
56
|
-
|
|
57
|
-
if (smartMentionConfig.env) {
|
|
58
|
-
setEnv(smartMentionConfig.env);
|
|
59
|
-
}
|
|
60
|
-
|
|
54
|
+
_this.lastReturnedSearch = 0;
|
|
61
55
|
return _this;
|
|
62
56
|
}
|
|
63
57
|
|
|
@@ -143,17 +137,22 @@ var SmartMentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
|
|
|
143
137
|
maxNumberOfResults = conf.maxNumberOfResults || 100;
|
|
144
138
|
request = {
|
|
145
139
|
baseUrl: conf.baseUrl,
|
|
146
|
-
context:
|
|
140
|
+
context: {
|
|
141
|
+
productKey: conf.productKey,
|
|
147
142
|
contextType: CONTEXT_TYPE,
|
|
148
143
|
principalId: conf.principalId || 'context',
|
|
149
144
|
containerId: contextIdentifier && contextIdentifier.containerId,
|
|
145
|
+
siteId: conf.siteId,
|
|
150
146
|
objectId: contextIdentifier && contextIdentifier.objectId || 'undefined',
|
|
151
147
|
childObjectId: contextIdentifier && contextIdentifier.childObjectId || 'undefined',
|
|
152
148
|
mentionsSessionId: contextIdentifier && contextIdentifier.sessionId || 'undefined',
|
|
153
149
|
sessionId: contextIdentifier && contextIdentifier.sessionId || 'undefined'
|
|
154
|
-
}
|
|
150
|
+
},
|
|
151
|
+
includeGroups: conf.includeGroups,
|
|
152
|
+
includeTeams: conf.includeTeams,
|
|
155
153
|
includeUsers: typeof conf.includeUsers === 'undefined' ? true : conf.includeUsers,
|
|
156
154
|
maxNumberOfResults: maxNumberOfResults,
|
|
155
|
+
searchQueryFilter: conf.searchQueryFilter,
|
|
157
156
|
query: query
|
|
158
157
|
};
|
|
159
158
|
_context2.prev = 4;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { config } from '../config';
|
|
2
2
|
|
|
3
3
|
var getUserRecommendations = function getUserRecommendations(request) {
|
|
4
|
-
var url =
|
|
4
|
+
var url = config.getRecommendationServiceUrl(request.baseUrl);
|
|
5
5
|
return fetch(url, {
|
|
6
6
|
method: 'POST',
|
|
7
7
|
credentials: 'include',
|
package/dist/esm/config/index.js
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
var
|
|
2
|
-
var STG_INSTANCE = 'https://api-private.stg.atlassian.com';
|
|
3
|
-
var LOCAL_CONFIG = {
|
|
4
|
-
getRecommendationServiceUrl: function getRecommendationServiceUrl(baseUrl) {
|
|
5
|
-
return baseUrl ? "".concat(STG_INSTANCE, "/").concat(baseUrl, "/gateway/api/v1/recommendations") : "".concat(STG_INSTANCE, "/gateway/api/v1/recommendations");
|
|
6
|
-
},
|
|
7
|
-
getUsersServiceUrl: function getUsersServiceUrl(productKey) {
|
|
8
|
-
return productKey === 'jira' ? "https://jdog.jira-dev.com/rest/api/3/user/bulk" : "https://pug.jira-dev.com/wiki/rest/api/user/bulk";
|
|
9
|
-
},
|
|
10
|
-
getGraphQLUrl: function getGraphQLUrl(baseUrl) {
|
|
11
|
-
return baseUrl ? "".concat(STG_INSTANCE, "/").concat(baseUrl, "/graphql") : "".concat(STG_INSTANCE, "/gateway/api/graphql");
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
var PRD_CONFIG = {
|
|
1
|
+
export var config = {
|
|
15
2
|
getRecommendationServiceUrl: function getRecommendationServiceUrl(baseUrl) {
|
|
16
3
|
return baseUrl ? "/".concat(baseUrl, "/v1/recommendations") : '/gateway/api/v1/recommendations';
|
|
17
4
|
},
|
|
@@ -21,10 +8,4 @@ var PRD_CONFIG = {
|
|
|
21
8
|
getGraphQLUrl: function getGraphQLUrl(baseUrl) {
|
|
22
9
|
return baseUrl ? "/".concat(baseUrl, "/graphql") : '/gateway/api/graphql';
|
|
23
10
|
}
|
|
24
|
-
};
|
|
25
|
-
export var setEnv = function setEnv(newEnv) {
|
|
26
|
-
return env = newEnv;
|
|
27
|
-
};
|
|
28
|
-
export var getConfig = function getConfig() {
|
|
29
|
-
return env === 'local' ? LOCAL_CONFIG : PRD_CONFIG;
|
|
30
11
|
};
|
|
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
4
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
5
|
import { MentionNameStatus } from '../types';
|
|
6
6
|
import { graphqlQuery } from './graphqlUtils';
|
|
7
|
-
import {
|
|
7
|
+
import { config } from '../config';
|
|
8
8
|
|
|
9
9
|
var buildUsersQuery = function buildUsersQuery(accountIds) {
|
|
10
10
|
return {
|
|
@@ -50,7 +50,8 @@ export var DefaultMentionNameResolver = /*#__PURE__*/function () {
|
|
|
50
50
|
key: "lookupName",
|
|
51
51
|
value: function () {
|
|
52
52
|
var _lookupName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
|
|
53
|
-
var url, data, userInfo;
|
|
53
|
+
var _data$users, url, data, userInfo;
|
|
54
|
+
|
|
54
55
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
55
56
|
while (1) {
|
|
56
57
|
switch (_context2.prev = _context2.next) {
|
|
@@ -69,13 +70,13 @@ export var DefaultMentionNameResolver = /*#__PURE__*/function () {
|
|
|
69
70
|
});
|
|
70
71
|
|
|
71
72
|
case 3:
|
|
72
|
-
url =
|
|
73
|
+
url = config.getGraphQLUrl(this.baseUrl);
|
|
73
74
|
_context2.next = 6;
|
|
74
75
|
return makeRequest(url, [id]);
|
|
75
76
|
|
|
76
77
|
case 6:
|
|
77
78
|
data = _context2.sent;
|
|
78
|
-
userInfo = data.users.find(function (user) {
|
|
79
|
+
userInfo = (_data$users = data.users) === null || _data$users === void 0 ? void 0 : _data$users.find(function (user) {
|
|
79
80
|
return user.accountId === id;
|
|
80
81
|
});
|
|
81
82
|
return _context2.abrupt("return", userInfo ? {
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SupportedProduct } from './SmartMentionTypes';
|
|
2
1
|
import { MentionContextIdentifier, MentionsResult, MentionDescription, MentionNameDetails, MentionNameResolver } from '../types';
|
|
3
2
|
import { AbstractMentionResource, ResolvingMentionProvider } from '../resource';
|
|
4
3
|
export interface SmartMentionConfig {
|
|
@@ -13,12 +12,11 @@ export interface SmartMentionConfig {
|
|
|
13
12
|
*/
|
|
14
13
|
principalId?: string;
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* to add your product onto the SupportedProduct enum.
|
|
15
|
+
* Platform search is only available for certain products. Please
|
|
16
|
+
* reach out to #help-smart-experiences to check.
|
|
17
|
+
* Use productKey='people' if you are waiting for a product scope.
|
|
20
18
|
*/
|
|
21
|
-
productKey:
|
|
19
|
+
productKey: string;
|
|
22
20
|
/**
|
|
23
21
|
* Lucene-type query to proxy onto the search service.
|
|
24
22
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare type SupportedProduct = 'jira' | 'confluence' | 'people' | 'bitbucket';
|
|
2
1
|
export interface RecommendationRequest {
|
|
3
2
|
baseUrl?: string;
|
|
4
3
|
context: Context;
|
|
@@ -21,7 +20,7 @@ export interface Context {
|
|
|
21
20
|
sessionId?: string;
|
|
22
21
|
principalId: string;
|
|
23
22
|
childObjectId?: string;
|
|
24
|
-
productKey:
|
|
23
|
+
productKey: string;
|
|
25
24
|
siteId: string;
|
|
26
25
|
productAttributes?: ProductAttributes;
|
|
27
26
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
getRecommendationServiceUrl(baseUrl
|
|
3
|
-
getUsersServiceUrl(productKey: string):
|
|
4
|
-
getGraphQLUrl(baseUrl
|
|
5
|
-
}
|
|
6
|
-
export declare const setEnv: (newEnv: 'prod' | 'local') => "prod" | "local";
|
|
7
|
-
export declare const getConfig: () => Config;
|
|
8
|
-
export {};
|
|
1
|
+
export declare const config: {
|
|
2
|
+
getRecommendationServiceUrl(baseUrl?: string | undefined): string;
|
|
3
|
+
getUsersServiceUrl(productKey: string): "/rest/api/3/user/bulk" | "/wiki/rest/api/user/bulk";
|
|
4
|
+
getGraphQLUrl(baseUrl?: string | undefined): string;
|
|
5
|
+
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { MentionNameResolver, MentionNameDetails } from '../types';
|
|
2
|
+
interface UserData {
|
|
3
|
+
accountId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ApiClientResponse {
|
|
7
|
+
users: UserData[] | null;
|
|
8
|
+
}
|
|
2
9
|
export declare class DefaultMentionNameResolver implements MentionNameResolver {
|
|
3
10
|
private baseUrl?;
|
|
4
11
|
private readonly cache;
|
|
@@ -6,3 +13,4 @@ export declare class DefaultMentionNameResolver implements MentionNameResolver {
|
|
|
6
13
|
lookupName(id: string): Promise<MentionNameDetails>;
|
|
7
14
|
cacheName(id: string, name: string): void;
|
|
8
15
|
}
|
|
16
|
+
export {};
|
package/docs/1-in-editor.tsx
CHANGED
|
@@ -23,9 +23,7 @@ export default md`
|
|
|
23
23
|
<>
|
|
24
24
|
<p>
|
|
25
25
|
To use Mention in{' '}
|
|
26
|
-
<a href="
|
|
27
|
-
@atlaskit/editor-core
|
|
28
|
-
</a>
|
|
26
|
+
<a href="/packages/editor/editor-core">@atlaskit/editor-core</a>
|
|
29
27
|
{', '}
|
|
30
28
|
check the 'Editor with mentions' section in editor-core, then follow
|
|
31
29
|
these steps for a more involved tutorial:
|
|
@@ -33,11 +31,11 @@ export default md`
|
|
|
33
31
|
</>
|
|
34
32
|
)}
|
|
35
33
|
|
|
36
|
-
### Option 1: Instantiate a MentionResource
|
|
34
|
+
### Option 1: Instantiate a \`MentionResource\`
|
|
37
35
|
|
|
38
36
|
You can choose to instantiate the existing MentionResource that have defaults in place.
|
|
39
37
|
|
|
40
|
-
Ensure you plug in the mentionNameResolver to resolve names that have been pre-selected in the Editor
|
|
38
|
+
Ensure you plug in the \`mentionNameResolver\` to resolve names that have been pre-selected in the Editor
|
|
41
39
|
(else they will show up as @Unknown). You will need a backing service to search and resolve names.
|
|
42
40
|
|
|
43
41
|
${code`
|
|
@@ -65,9 +63,9 @@ export default md`
|
|
|
65
63
|
)
|
|
66
64
|
}`}
|
|
67
65
|
|
|
68
|
-
### Option 2: Extend and
|
|
66
|
+
### Option 2: Extend and instantiate an \`AbstractMentionResource\`
|
|
69
67
|
|
|
70
|
-
Extend the AbstractMentionResource to provide a more customized mentions experience.
|
|
68
|
+
Extend the \`AbstractMentionResource\` to provide a more customized mentions experience.
|
|
71
69
|
|
|
72
70
|
${(
|
|
73
71
|
<Example
|
|
@@ -79,7 +77,7 @@ export default md`
|
|
|
79
77
|
)}
|
|
80
78
|
|
|
81
79
|
|
|
82
|
-
### Option 3: Extend and
|
|
80
|
+
### Option 3: Extend and instantiate a \`SmartMentionResource\`
|
|
83
81
|
|
|
84
82
|
|
|
85
83
|
${(
|
|
@@ -92,7 +90,7 @@ export default md`
|
|
|
92
90
|
</SectionMessage>
|
|
93
91
|
)}
|
|
94
92
|
|
|
95
|
-
Use the SmartMentionResource
|
|
93
|
+
Use the \`SmartMentionResource\`, which has defaults set for both the provider and the name resolver.
|
|
96
94
|
The provider will attempt to rerank your suggestions based on the users relevant to you.
|
|
97
95
|
|
|
98
96
|
${(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/mention",
|
|
3
|
-
"version": "19.9.
|
|
3
|
+
"version": "19.9.4",
|
|
4
4
|
"description": "A React component used to display user profiles in a list for 'Mention' functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"styled-components": "^3.2.6"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@atlaskit/adf-utils": "^14.
|
|
49
|
+
"@atlaskit/adf-utils": "^14.4.0",
|
|
50
50
|
"@atlaskit/build-utils": "*",
|
|
51
51
|
"@atlaskit/docs": "^9.0.0",
|
|
52
|
-
"@atlaskit/editor-core": "^
|
|
53
|
-
"@atlaskit/editor-test-helpers": "^15.
|
|
52
|
+
"@atlaskit/editor-core": "^152.0.0",
|
|
53
|
+
"@atlaskit/editor-test-helpers": "^15.6.0",
|
|
54
54
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
55
55
|
"@atlaskit/section-message": "^6.0.0",
|
|
56
56
|
"@atlaskit/ssr": "*",
|
|
57
|
-
"@atlaskit/util-data-test": "^
|
|
57
|
+
"@atlaskit/util-data-test": "^17.0.0",
|
|
58
58
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
59
59
|
"@types/query-string": "^4.3.1",
|
|
60
60
|
"@types/serialize-javascript": "^5.0.0",
|