@atlaskit/editor-plugin-type-ahead 16.0.0 → 16.1.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,16 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 16.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6997a74055219`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6997a74055219) -
8
+ Add profile card on hover in the mentions typeahead for agent mentions
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 16.0.0
4
15
 
5
16
  ### Patch Changes
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.skipForwardToSafeItem = exports.skipBackwardToSafeItem = exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadListAriaLabels = exports.getTypeAheadHandler = exports.getPluginState = exports.findHandlerByTrigger = exports.findHandler = void 0;
7
7
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
8
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
9
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
9
10
  var _updateSelectedIndex = require("./commands/update-selected-index");
10
11
  var _itemIsDisabled = require("./item-is-disabled");
@@ -162,16 +163,26 @@ var moveSelectedIndex = exports.moveSelectedIndex = function moveSelectedIndex(_
162
163
  };
163
164
  };
164
165
  var getTypeAheadListAriaLabels = exports.getTypeAheadListAriaLabels = function getTypeAheadListAriaLabels(trigger, intl, item) {
165
- var _item$mention, _item$mention2, _item$emoji, _item$emoji2, _item$emoji3;
166
+ var _item$emoji, _item$emoji2, _item$emoji3;
166
167
  switch (trigger) {
167
168
  case '@':
168
- return {
169
- popupAriaLabel: intl.formatMessage(_typeAhead.typeAheadListMessages.mentionPopupLabel),
170
- listItemAriaLabel: intl.formatMessage(_typeAhead.typeAheadListMessages.metionListItemLabel, {
171
- name: (item === null || item === void 0 || (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.name) || '',
172
- shortName: (item === null || item === void 0 || (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.mentionName) || ''
173
- })
174
- };
169
+ {
170
+ var _item$mention, _item$mention2, _item$mention3;
171
+ var description = (0, _experiments.editorExperiment)('platform_editor_agent_mentions', true) && (0, _platformFeatureFlags.fg)('platform_editor_mention_typeahead_profilecard') ? item === null || item === void 0 || (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.description : undefined;
172
+ var name = (item === null || item === void 0 || (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.name) || '';
173
+ var shortName = (item === null || item === void 0 || (_item$mention3 = item.mention) === null || _item$mention3 === void 0 ? void 0 : _item$mention3.mentionName) || '';
174
+ return {
175
+ popupAriaLabel: intl.formatMessage(_typeAhead.typeAheadListMessages.mentionPopupLabel),
176
+ listItemAriaLabel: description ? intl.formatMessage(_typeAhead.typeAheadListMessages.mentionListItemLabelWithDescription, {
177
+ name: name,
178
+ shortName: shortName,
179
+ description: description
180
+ }) : intl.formatMessage(_typeAhead.typeAheadListMessages.metionListItemLabel, {
181
+ name: name,
182
+ shortName: shortName
183
+ })
184
+ };
185
+ }
175
186
  case '/':
176
187
  return {
177
188
  popupAriaLabel: intl.formatMessage(_typeAhead.typeAheadListMessages.quickInsertPopupLabel),
@@ -1,4 +1,5 @@
1
1
  import { TypeAheadAvailableNodes, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
4
  import { updateSelectedIndex } from './commands/update-selected-index';
4
5
  import { itemIsDisabled } from './item-is-disabled';
@@ -158,16 +159,26 @@ export const moveSelectedIndex = ({
158
159
  updateSelectedIndex(nextIndex, api)(editorView.state, editorView.dispatch);
159
160
  };
160
161
  export const getTypeAheadListAriaLabels = (trigger, intl, item) => {
161
- var _item$mention, _item$mention2, _item$emoji, _item$emoji2, _item$emoji3;
162
+ var _item$emoji, _item$emoji2, _item$emoji3;
162
163
  switch (trigger) {
163
164
  case '@':
164
- return {
165
- popupAriaLabel: intl.formatMessage(typeAheadListMessages.mentionPopupLabel),
166
- listItemAriaLabel: intl.formatMessage(typeAheadListMessages.metionListItemLabel, {
167
- name: (item === null || item === void 0 ? void 0 : (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.name) || '',
168
- shortName: (item === null || item === void 0 ? void 0 : (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.mentionName) || ''
169
- })
170
- };
165
+ {
166
+ var _item$mention, _item$mention2, _item$mention3;
167
+ const description = editorExperiment('platform_editor_agent_mentions', true) && fg('platform_editor_mention_typeahead_profilecard') ? item === null || item === void 0 ? void 0 : (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.description : undefined;
168
+ const name = (item === null || item === void 0 ? void 0 : (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.name) || '';
169
+ const shortName = (item === null || item === void 0 ? void 0 : (_item$mention3 = item.mention) === null || _item$mention3 === void 0 ? void 0 : _item$mention3.mentionName) || '';
170
+ return {
171
+ popupAriaLabel: intl.formatMessage(typeAheadListMessages.mentionPopupLabel),
172
+ listItemAriaLabel: description ? intl.formatMessage(typeAheadListMessages.mentionListItemLabelWithDescription, {
173
+ name,
174
+ shortName,
175
+ description
176
+ }) : intl.formatMessage(typeAheadListMessages.metionListItemLabel, {
177
+ name,
178
+ shortName
179
+ })
180
+ };
181
+ }
171
182
  case '/':
172
183
  return {
173
184
  popupAriaLabel: intl.formatMessage(typeAheadListMessages.quickInsertPopupLabel),
@@ -1,4 +1,5 @@
1
1
  import { TypeAheadAvailableNodes, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
4
  import { updateSelectedIndex } from './commands/update-selected-index';
4
5
  import { itemIsDisabled } from './item-is-disabled';
@@ -156,16 +157,26 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref4) {
156
157
  };
157
158
  };
158
159
  export var getTypeAheadListAriaLabels = function getTypeAheadListAriaLabels(trigger, intl, item) {
159
- var _item$mention, _item$mention2, _item$emoji, _item$emoji2, _item$emoji3;
160
+ var _item$emoji, _item$emoji2, _item$emoji3;
160
161
  switch (trigger) {
161
162
  case '@':
162
- return {
163
- popupAriaLabel: intl.formatMessage(typeAheadListMessages.mentionPopupLabel),
164
- listItemAriaLabel: intl.formatMessage(typeAheadListMessages.metionListItemLabel, {
165
- name: (item === null || item === void 0 || (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.name) || '',
166
- shortName: (item === null || item === void 0 || (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.mentionName) || ''
167
- })
168
- };
163
+ {
164
+ var _item$mention, _item$mention2, _item$mention3;
165
+ var description = editorExperiment('platform_editor_agent_mentions', true) && fg('platform_editor_mention_typeahead_profilecard') ? item === null || item === void 0 || (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.description : undefined;
166
+ var name = (item === null || item === void 0 || (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.name) || '';
167
+ var shortName = (item === null || item === void 0 || (_item$mention3 = item.mention) === null || _item$mention3 === void 0 ? void 0 : _item$mention3.mentionName) || '';
168
+ return {
169
+ popupAriaLabel: intl.formatMessage(typeAheadListMessages.mentionPopupLabel),
170
+ listItemAriaLabel: description ? intl.formatMessage(typeAheadListMessages.mentionListItemLabelWithDescription, {
171
+ name: name,
172
+ shortName: shortName,
173
+ description: description
174
+ }) : intl.formatMessage(typeAheadListMessages.metionListItemLabel, {
175
+ name: name,
176
+ shortName: shortName
177
+ })
178
+ };
179
+ }
169
180
  case '/':
170
181
  return {
171
182
  popupAriaLabel: intl.formatMessage(typeAheadListMessages.quickInsertPopupLabel),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "16.0.0",
3
+ "version": "16.1.0",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -53,7 +53,7 @@
53
53
  "w3c-keyname": "^2.1.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^119.0.0",
56
+ "@atlaskit/editor-common": "^119.2.0",
57
57
  "react": "^18.2.0 || ^19.2.0",
58
58
  "react-dom": "^18.2.0 || ^19.2.0",
59
59
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -98,6 +98,9 @@
98
98
  },
99
99
  "platform_editor_agent_mentions_drop_one_fixes": {
100
100
  "type": "boolean"
101
+ },
102
+ "platform_editor_mention_typeahead_profilecard": {
103
+ "type": "boolean"
101
104
  }
102
105
  }
103
106
  }