@atlaskit/editor-plugin-mentions 26.0.4 → 26.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/ui/type-ahead/MentionItemWithProfileCard.js +1 -1
- package/dist/cjs/ui/type-ahead/index.js +5 -5
- package/dist/cjs/ui/type-ahead/utils.js +1 -2
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/ui/type-ahead/MentionItemWithProfileCard.js +1 -1
- package/dist/es2019/ui/type-ahead/index.js +5 -5
- package/dist/es2019/ui/type-ahead/utils.js +1 -2
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/ui/type-ahead/MentionItemWithProfileCard.js +1 -1
- package/dist/esm/ui/type-ahead/index.js +5 -5
- package/dist/esm/ui/type-ahead/utils.js +1 -2
- package/dist/types/types/index.d.ts +1 -2
- package/dist/types/ui/type-ahead/utils.d.ts +1 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 26.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ec8f6864239eb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ec8f6864239eb) -
|
|
8
|
+
Clean up experiment `platform_editor_mention_search_order`
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 26.0.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -45,7 +45,7 @@ var ACTIONS = exports.ACTIONS = {
|
|
|
45
45
|
CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
|
|
46
46
|
};
|
|
47
47
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
48
|
-
var PACKAGE_VERSION = "26.0.
|
|
48
|
+
var PACKAGE_VERSION = "26.0.4";
|
|
49
49
|
var setProvider = function setProvider(provider) {
|
|
50
50
|
return function (state, dispatch) {
|
|
51
51
|
if (dispatch) {
|
|
@@ -152,7 +152,7 @@ function MentionItemWithProfileCard(_ref2) {
|
|
|
152
152
|
}
|
|
153
153
|
return [0, CARD_GAP_PX + getScrollbarWidth(referenceElement)];
|
|
154
154
|
}, [referenceElement]);
|
|
155
|
-
if (mention.isPlaceholder
|
|
155
|
+
if (mention.isPlaceholder) {
|
|
156
156
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
157
157
|
testId: "mention-item-with-profile-card",
|
|
158
158
|
xcss: styles.placeholderContainer
|
|
@@ -52,7 +52,7 @@ var isSearchOrderedPersonTypeAheadItem = function isSearchOrderedPersonTypeAhead
|
|
|
52
52
|
return !!item.mention && !(0, _utils3.isInviteItem)(item.mention) && !(0, _utils3.isExplicitAgentMention)(item.mention) && !(0, _utils3.isBotOrTeamMention)(item.mention);
|
|
53
53
|
};
|
|
54
54
|
var shouldApplyMentionSearchOrder = function shouldApplyMentionSearchOrder(query) {
|
|
55
|
-
return
|
|
55
|
+
return query.trim().length > 0;
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
// A non-selectable loading placeholder injected by the provider (e.g.
|
|
@@ -140,7 +140,7 @@ var makeMentionToTypeaheadItem = function makeMentionToTypeaheadItem(_ref4) {
|
|
|
140
140
|
mention: mention
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
if (isLoadingPlaceholder(mention)
|
|
143
|
+
if (isLoadingPlaceholder(mention)) {
|
|
144
144
|
return {
|
|
145
145
|
title: mention.id,
|
|
146
146
|
isNonInteractive: true,
|
|
@@ -793,7 +793,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
793
793
|
var _initialResolve;
|
|
794
794
|
initialResolved = true;
|
|
795
795
|
(_initialResolve = initialResolve) === null || _initialResolve === void 0 || _initialResolve(items);
|
|
796
|
-
} else if (enableAgentSectioning &&
|
|
796
|
+
} else if (enableAgentSectioning && !updateCallback) {
|
|
797
797
|
// Agent Studio can resolve before the typeahead installs its update subscriber.
|
|
798
798
|
pendingUpdate = items;
|
|
799
799
|
} else {
|
|
@@ -821,7 +821,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
821
821
|
throw new Error('TypeAhead mention updates support only one subscriber');
|
|
822
822
|
}
|
|
823
823
|
updateCallback = update;
|
|
824
|
-
if (enableAgentSectioning &&
|
|
824
|
+
if (enableAgentSectioning && pendingUpdate) {
|
|
825
825
|
updateCallback(pendingUpdate);
|
|
826
826
|
pendingUpdate = null;
|
|
827
827
|
}
|
|
@@ -843,7 +843,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
|
|
|
843
843
|
}
|
|
844
844
|
};
|
|
845
845
|
};
|
|
846
|
-
if (enableAgentSectioning
|
|
846
|
+
if (enableAgentSectioning) {
|
|
847
847
|
typeAhead.subscribeToItemsUpdates = subscribeToItemsUpdates;
|
|
848
848
|
}
|
|
849
849
|
|
|
@@ -37,8 +37,7 @@ var isAgentMention = exports.isAgentMention = function isAgentMention(mention) {
|
|
|
37
37
|
/**
|
|
38
38
|
* True when the mention is explicitly an agent, not a generic APP/bot.
|
|
39
39
|
* Prefer this over `isAgentMention` when ordering the search display
|
|
40
|
-
* list
|
|
41
|
-
* is a bot unless `appType === 'agent'`.
|
|
40
|
+
* list — bare `userType: 'APP'` is a bot unless `appType === 'agent'`.
|
|
42
41
|
*/
|
|
43
42
|
var isExplicitAgentMention = exports.isExplicitAgentMention = function isExplicitAgentMention(mention) {
|
|
44
43
|
return mention.appType === 'agent' || mention.userType === 'AGENT';
|
|
@@ -34,7 +34,7 @@ export const ACTIONS = {
|
|
|
34
34
|
CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
|
|
35
35
|
};
|
|
36
36
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
37
|
-
const PACKAGE_VERSION = "26.0.
|
|
37
|
+
const PACKAGE_VERSION = "26.0.4";
|
|
38
38
|
const setProvider = provider => (state, dispatch) => {
|
|
39
39
|
if (dispatch) {
|
|
40
40
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -135,7 +135,7 @@ export function MentionItemWithProfileCard({
|
|
|
135
135
|
}
|
|
136
136
|
return [0, CARD_GAP_PX + getScrollbarWidth(referenceElement)];
|
|
137
137
|
}, [referenceElement]);
|
|
138
|
-
if (mention.isPlaceholder
|
|
138
|
+
if (mention.isPlaceholder) {
|
|
139
139
|
return /*#__PURE__*/React.createElement(Box, {
|
|
140
140
|
testId: "mention-item-with-profile-card",
|
|
141
141
|
xcss: styles.placeholderContainer
|
|
@@ -27,7 +27,7 @@ const isAgentTypeAheadItem = item => item.mention ? isAgentMention(item.mention)
|
|
|
27
27
|
const isAgentMentionLoadErrorEnabled = mention => isExperimentEnabled('platform_editor_agent_mentions_rovo_query_timeout') && isAgentMentionLoadError(mention);
|
|
28
28
|
const isSearchOrderedAgentTypeAheadItem = item => !!item.mention && isExplicitAgentMention(item.mention);
|
|
29
29
|
const isSearchOrderedPersonTypeAheadItem = item => !!item.mention && !isInviteItem(item.mention) && !isExplicitAgentMention(item.mention) && !isBotOrTeamMention(item.mention);
|
|
30
|
-
const shouldApplyMentionSearchOrder = query =>
|
|
30
|
+
const shouldApplyMentionSearchOrder = query => query.trim().length > 0;
|
|
31
31
|
|
|
32
32
|
// A non-selectable loading placeholder injected by the provider (e.g.
|
|
33
33
|
// `RovoChatMentionResource`) while the slower agent source resolves. It
|
|
@@ -108,7 +108,7 @@ const makeMentionToTypeaheadItem = ({
|
|
|
108
108
|
mention
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
if (isLoadingPlaceholder(mention)
|
|
111
|
+
if (isLoadingPlaceholder(mention)) {
|
|
112
112
|
return {
|
|
113
113
|
title: mention.id,
|
|
114
114
|
isNonInteractive: true,
|
|
@@ -750,7 +750,7 @@ export const createTypeAheadConfig = ({
|
|
|
750
750
|
var _initialResolve;
|
|
751
751
|
initialResolved = true;
|
|
752
752
|
(_initialResolve = initialResolve) === null || _initialResolve === void 0 ? void 0 : _initialResolve(items);
|
|
753
|
-
} else if (enableAgentSectioning &&
|
|
753
|
+
} else if (enableAgentSectioning && !updateCallback) {
|
|
754
754
|
// Agent Studio can resolve before the typeahead installs its update subscriber.
|
|
755
755
|
pendingUpdate = items;
|
|
756
756
|
} else {
|
|
@@ -779,7 +779,7 @@ export const createTypeAheadConfig = ({
|
|
|
779
779
|
throw new Error('TypeAhead mention updates support only one subscriber');
|
|
780
780
|
}
|
|
781
781
|
updateCallback = update;
|
|
782
|
-
if (enableAgentSectioning &&
|
|
782
|
+
if (enableAgentSectioning && pendingUpdate) {
|
|
783
783
|
updateCallback(pendingUpdate);
|
|
784
784
|
pendingUpdate = null;
|
|
785
785
|
}
|
|
@@ -801,7 +801,7 @@ export const createTypeAheadConfig = ({
|
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
803
|
};
|
|
804
|
-
if (enableAgentSectioning
|
|
804
|
+
if (enableAgentSectioning) {
|
|
805
805
|
typeAhead.subscribeToItemsUpdates = subscribeToItemsUpdates;
|
|
806
806
|
}
|
|
807
807
|
|
|
@@ -19,8 +19,7 @@ export const isAgentMention = mention => isAgentUserType(mention.userType) || me
|
|
|
19
19
|
/**
|
|
20
20
|
* True when the mention is explicitly an agent, not a generic APP/bot.
|
|
21
21
|
* Prefer this over `isAgentMention` when ordering the search display
|
|
22
|
-
* list
|
|
23
|
-
* is a bot unless `appType === 'agent'`.
|
|
22
|
+
* list — bare `userType: 'APP'` is a bot unless `appType === 'agent'`.
|
|
24
23
|
*/
|
|
25
24
|
export const isExplicitAgentMention = mention => mention.appType === 'agent' || mention.userType === 'AGENT';
|
|
26
25
|
export const isAgentMentionLoadError = mention => (mention === null || mention === void 0 ? void 0 : mention.id) === AGENT_MENTION_LOAD_ERROR_ID && mention.isPlaceholder === true && mention.placeholderType === 'error' && mention.appType === 'agent';
|
|
@@ -37,7 +37,7 @@ export var ACTIONS = {
|
|
|
37
37
|
CLEAR_PENDING_PASTED_AGENT_MENTION: 'CLEAR_PENDING_PASTED_AGENT_MENTION'
|
|
38
38
|
};
|
|
39
39
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
40
|
-
var PACKAGE_VERSION = "26.0.
|
|
40
|
+
var PACKAGE_VERSION = "26.0.4";
|
|
41
41
|
var setProvider = function setProvider(provider) {
|
|
42
42
|
return function (state, dispatch) {
|
|
43
43
|
if (dispatch) {
|
|
@@ -144,7 +144,7 @@ export function MentionItemWithProfileCard(_ref2) {
|
|
|
144
144
|
}
|
|
145
145
|
return [0, CARD_GAP_PX + getScrollbarWidth(referenceElement)];
|
|
146
146
|
}, [referenceElement]);
|
|
147
|
-
if (mention.isPlaceholder
|
|
147
|
+
if (mention.isPlaceholder) {
|
|
148
148
|
return /*#__PURE__*/React.createElement(Box, {
|
|
149
149
|
testId: "mention-item-with-profile-card",
|
|
150
150
|
xcss: styles.placeholderContainer
|
|
@@ -43,7 +43,7 @@ var isSearchOrderedPersonTypeAheadItem = function isSearchOrderedPersonTypeAhead
|
|
|
43
43
|
return !!item.mention && !isInviteItem(item.mention) && !isExplicitAgentMention(item.mention) && !isBotOrTeamMention(item.mention);
|
|
44
44
|
};
|
|
45
45
|
var shouldApplyMentionSearchOrder = function shouldApplyMentionSearchOrder(query) {
|
|
46
|
-
return
|
|
46
|
+
return query.trim().length > 0;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
// A non-selectable loading placeholder injected by the provider (e.g.
|
|
@@ -131,7 +131,7 @@ var makeMentionToTypeaheadItem = function makeMentionToTypeaheadItem(_ref4) {
|
|
|
131
131
|
mention: mention
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
if (isLoadingPlaceholder(mention)
|
|
134
|
+
if (isLoadingPlaceholder(mention)) {
|
|
135
135
|
return {
|
|
136
136
|
title: mention.id,
|
|
137
137
|
isNonInteractive: true,
|
|
@@ -784,7 +784,7 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref1) {
|
|
|
784
784
|
var _initialResolve;
|
|
785
785
|
initialResolved = true;
|
|
786
786
|
(_initialResolve = initialResolve) === null || _initialResolve === void 0 || _initialResolve(items);
|
|
787
|
-
} else if (enableAgentSectioning &&
|
|
787
|
+
} else if (enableAgentSectioning && !updateCallback) {
|
|
788
788
|
// Agent Studio can resolve before the typeahead installs its update subscriber.
|
|
789
789
|
pendingUpdate = items;
|
|
790
790
|
} else {
|
|
@@ -812,7 +812,7 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref1) {
|
|
|
812
812
|
throw new Error('TypeAhead mention updates support only one subscriber');
|
|
813
813
|
}
|
|
814
814
|
updateCallback = update;
|
|
815
|
-
if (enableAgentSectioning &&
|
|
815
|
+
if (enableAgentSectioning && pendingUpdate) {
|
|
816
816
|
updateCallback(pendingUpdate);
|
|
817
817
|
pendingUpdate = null;
|
|
818
818
|
}
|
|
@@ -834,7 +834,7 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref1) {
|
|
|
834
834
|
}
|
|
835
835
|
};
|
|
836
836
|
};
|
|
837
|
-
if (enableAgentSectioning
|
|
837
|
+
if (enableAgentSectioning) {
|
|
838
838
|
typeAhead.subscribeToItemsUpdates = subscribeToItemsUpdates;
|
|
839
839
|
}
|
|
840
840
|
|
|
@@ -32,8 +32,7 @@ export var isAgentMention = function isAgentMention(mention) {
|
|
|
32
32
|
/**
|
|
33
33
|
* True when the mention is explicitly an agent, not a generic APP/bot.
|
|
34
34
|
* Prefer this over `isAgentMention` when ordering the search display
|
|
35
|
-
* list
|
|
36
|
-
* is a bot unless `appType === 'agent'`.
|
|
35
|
+
* list — bare `userType: 'APP'` is a bot unless `appType === 'agent'`.
|
|
37
36
|
*/
|
|
38
37
|
export var isExplicitAgentMention = function isExplicitAgentMention(mention) {
|
|
39
38
|
return mention.appType === 'agent' || mention.userType === 'AGENT';
|
|
@@ -46,8 +46,7 @@ export interface MentionsPluginOptions extends MentionPluginConfig {
|
|
|
46
46
|
*
|
|
47
47
|
* Consumers own the rollout decision for their editor surface; the shared
|
|
48
48
|
* mentions plugin only applies the resulting presentation option.
|
|
49
|
-
* Search-time ordering
|
|
50
|
-
* `platform_editor_mention_search_order`.
|
|
49
|
+
* Search-time ordering places agents above bots/teams.
|
|
51
50
|
*/
|
|
52
51
|
enableAgentSectioning?: boolean;
|
|
53
52
|
/**
|
|
@@ -7,8 +7,7 @@ export declare const isAgentMention: (mention: Pick<MentionDescription, 'appType
|
|
|
7
7
|
/**
|
|
8
8
|
* True when the mention is explicitly an agent, not a generic APP/bot.
|
|
9
9
|
* Prefer this over `isAgentMention` when ordering the search display
|
|
10
|
-
* list
|
|
11
|
-
* is a bot unless `appType === 'agent'`.
|
|
10
|
+
* list — bare `userType: 'APP'` is a bot unless `appType === 'agent'`.
|
|
12
11
|
*/
|
|
13
12
|
export declare const isExplicitAgentMention: (mention: Pick<MentionDescription, 'appType' | 'userType'>) => boolean;
|
|
14
13
|
export declare const isAgentMentionLoadError: (mention: (Partial<Pick<MentionDescription, 'appType' | 'id' | 'isPlaceholder' | 'userType'>> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "26.0.
|
|
3
|
+
"version": "26.0.5",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"uuid": "^11.1.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@atlaskit/editor-common": "^128.
|
|
63
|
+
"@atlaskit/editor-common": "^128.4.0",
|
|
64
64
|
"react": "^18.2.0 || ^19.2.0",
|
|
65
65
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
66
66
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|