@atlaskit/editor-plugin-mentions 26.0.4 → 27.0.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 27.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 26.0.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`ec8f6864239eb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ec8f6864239eb) -
14
+ Clean up experiment `platform_editor_mention_search_order`
15
+ - Updated dependencies
16
+
3
17
  ## 26.0.4
4
18
 
5
19
  ### 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.3";
48
+ var PACKAGE_VERSION = "26.0.5";
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 && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_search_order')) {
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 (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_search_order') && query.trim().length > 0;
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) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_search_order')) {
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 && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_search_order') && !updateCallback) {
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 && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_search_order') && pendingUpdate) {
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 && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_search_order')) {
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 behind `platform_editor_mention_search_order` — bare `userType: 'APP'`
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.3";
37
+ const PACKAGE_VERSION = "26.0.5";
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 && isExperimentEnabled('platform_editor_mention_search_order')) {
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 => isExperimentEnabled('platform_editor_mention_search_order') && query.trim().length > 0;
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) && isExperimentEnabled('platform_editor_mention_search_order')) {
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 && isExperimentEnabled('platform_editor_mention_search_order') && !updateCallback) {
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 && isExperimentEnabled('platform_editor_mention_search_order') && pendingUpdate) {
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 && isExperimentEnabled('platform_editor_mention_search_order')) {
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 behind `platform_editor_mention_search_order` — bare `userType: 'APP'`
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.3";
40
+ var PACKAGE_VERSION = "26.0.5";
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 && isExperimentEnabled('platform_editor_mention_search_order')) {
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 isExperimentEnabled('platform_editor_mention_search_order') && query.trim().length > 0;
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) && isExperimentEnabled('platform_editor_mention_search_order')) {
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 && isExperimentEnabled('platform_editor_mention_search_order') && !updateCallback) {
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 && isExperimentEnabled('platform_editor_mention_search_order') && pendingUpdate) {
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 && isExperimentEnabled('platform_editor_mention_search_order')) {
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 behind `platform_editor_mention_search_order` — bare `userType: 'APP'`
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 of agents above bots/teams is gated by
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 behind `platform_editor_mention_search_order` — bare `userType: 'APP'`
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.4",
3
+ "version": "27.0.0",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,14 +21,14 @@
21
21
  ],
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
- "@atlaskit/adf-schema": "^57.6.0",
24
+ "@atlaskit/adf-schema": "^57.7.0",
25
25
  "@atlaskit/css": "^1.1.0",
26
26
  "@atlaskit/editor-json-transformer": "^10.0.0",
27
- "@atlaskit/editor-plugin-analytics": "^24.0.0",
28
- "@atlaskit/editor-plugin-base": "^25.1.0",
29
- "@atlaskit/editor-plugin-context-identifier": "^24.0.0",
30
- "@atlaskit/editor-plugin-selection": "^24.0.0",
31
- "@atlaskit/editor-plugin-type-ahead": "^25.0.0",
27
+ "@atlaskit/editor-plugin-analytics": "^25.0.0",
28
+ "@atlaskit/editor-plugin-base": "^26.0.0",
29
+ "@atlaskit/editor-plugin-context-identifier": "^25.0.0",
30
+ "@atlaskit/editor-plugin-selection": "^25.0.0",
31
+ "@atlaskit/editor-plugin-type-ahead": "^26.0.0",
32
32
  "@atlaskit/editor-prosemirror": "^9.0.0",
33
33
  "@atlaskit/feature-gate-js-client": "^7.0.0",
34
34
  "@atlaskit/icon": "^38.0.0",
@@ -36,7 +36,7 @@
36
36
  "@atlaskit/link": "^5.1.0",
37
37
  "@atlaskit/lozenge": "^17.0.0",
38
38
  "@atlaskit/mention": "^30.1.0",
39
- "@atlaskit/node-data-provider": "^25.0.0",
39
+ "@atlaskit/node-data-provider": "^26.0.0",
40
40
  "@atlaskit/platform-feature-experiments": "^0.3.0",
41
41
  "@atlaskit/platform-feature-flags": "^2.2.0",
42
42
  "@atlaskit/popper": "^9.4.0",
@@ -60,14 +60,14 @@
60
60
  "uuid": "^11.1.1"
61
61
  },
62
62
  "peerDependencies": {
63
- "@atlaskit/editor-common": "^128.3.0",
63
+ "@atlaskit/editor-common": "^129.0.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"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@atlaskit/button": "^25.4.0",
70
- "@atlaskit/editor-core": "^234.3.0",
70
+ "@atlaskit/editor-core": "^235.0.0",
71
71
  "@atlassian/workbench": "workspace:*",
72
72
  "@testing-library/react": "^16.3.0",
73
73
  "react": "^19.2.0",