@atlaskit/editor-plugin-mentions 1.5.1 → 1.6.1

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,23 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 1.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#110390](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110390)
8
+ [`bead123202369`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bead123202369) -
9
+ [ux] [ED-23642] Reordering the typeahead so that date, status, code block & info panel are above
10
+ the fold (in the top 5 results)
11
+ - Updated dependencies
12
+
13
+ ## 1.6.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#108100](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108100)
18
+ [`c854f5415176c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c854f5415176c) -
19
+ Add localId to mentionTypeahead click event attributes
20
+
3
21
  ## 1.5.1
4
22
 
5
23
  ### Patch Changes
@@ -95,7 +95,7 @@ var buildTypeAheadInviteItemClickedPayload = exports.buildTypeAheadInviteItemCli
95
95
  userRole: userRole
96
96
  });
97
97
  };
98
- var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionList, query, contextIdentifierProvider, taskListId, taskItemId) {
98
+ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId) {
99
99
  var _extractAttributesFro3 = extractAttributesFromQuery(query),
100
100
  queryLength = _extractAttributesFro3.queryLength,
101
101
  spaceInQuery = _extractAttributesFro3.spaceInQuery;
@@ -115,7 +115,8 @@ var buildTypeAheadInsertedPayload = exports.buildTypeAheadInsertedPayload = func
115
115
  memberCount: (0, _utils.isTeamType)(mention.userType) && mention.context ? mention.context.memberCount : null,
116
116
  includesYou: (0, _utils.isTeamType)(mention.userType) && mention.context ? mention.context.includesYou : null,
117
117
  taskListId: taskListId,
118
- taskItemId: taskItemId
118
+ taskItemId: taskItemId,
119
+ localId: mentionLocalId
119
120
  });
120
121
  if (contextIdentifierProvider) {
121
122
  analyticsPayload.containerId = contextIdentifierProvider.containerId || undefined;
@@ -88,13 +88,14 @@ var mentionsPlugin = exports.mentionsPlugin = function mentionsPlugin(_ref) {
88
88
  },
89
89
  pluginsOptions: {
90
90
  quickInsert: function quickInsert(_ref4) {
91
+ var _options$getEditorFea;
91
92
  var formatMessage = _ref4.formatMessage;
92
93
  return [{
93
94
  id: 'mention',
94
95
  title: formatMessage(_messages.toolbarInsertBlockMessages.mention),
95
96
  description: formatMessage(_messages.toolbarInsertBlockMessages.mentionDescription),
96
97
  keywords: ['team', 'user'],
97
- priority: 400,
98
+ priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 700 : 400,
98
99
  keyshortcut: '@',
99
100
  icon: function icon() {
100
101
  return /*#__PURE__*/_react.default.createElement(_quickInsert.IconMention, null);
@@ -315,7 +315,8 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
315
315
  taskItemId = taskItem.node.attrs.localId;
316
316
  }
317
317
  }
318
- fireEvent((0, _analytics.buildTypeAheadInsertedPayload)(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, sourceListItem.map(function (x) {
318
+ var mentionLocalId = (0, _uuid.default)();
319
+ fireEvent((0, _analytics.buildTypeAheadInsertedPayload)(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(function (x) {
319
320
  return x.mention;
320
321
  }), query, contextIdentifierProvider, taskListId, taskItemId));
321
322
  sessionId = (0, _uuid.default)();
@@ -334,7 +335,7 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
334
335
  id: id,
335
336
  accessLevel: accessLevel,
336
337
  userType: userType === 'DEFAULT' ? null : userType,
337
- localId: (0, _uuid.default)()
338
+ localId: mentionLocalId
338
339
  });
339
340
  var space = schema.text(' ');
340
341
  return insert(_model.Fragment.from([mentionNode, space]));
@@ -49,6 +49,7 @@ var InviteItem = function InviteItem(_ref) {
49
49
  }
50
50
  }, [onMount]);
51
51
  return (0, _react2.jsx)("div", {
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
52
53
  css: [_styles.mentionItemStyle, selected && _styles.mentionItemSelectedStyle],
53
54
  onMouseDown: onSelected,
54
55
  onMouseEnter: onItemMouseEnter,
@@ -66,7 +67,9 @@ var InviteItem = function InviteItem(_ref) {
66
67
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.mentionMessages.inviteItemTitle, {
67
68
  values: {
68
69
  userRole: userRole || 'basic',
69
- productName: (0, _react2.jsx)("span", {
70
+ productName:
71
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
72
+ (0, _react2.jsx)("span", {
70
73
  css: _styles.capitalizedStyle,
71
74
  "data-testid": "capitalized-message"
72
75
  }, productName)
@@ -7,6 +7,7 @@ exports.rowStyle = exports.nameSectionStyle = exports.mentionItemStyle = exports
7
7
  var _react = require("@emotion/react");
8
8
  var _colors = require("@atlaskit/theme/colors");
9
9
  var ROW_SIDE_PADDING = exports.ROW_SIDE_PADDING = 14;
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
10
11
  var rowStyle = exports.rowStyle = (0, _react.css)({
11
12
  alignItems: 'center',
12
13
  display: 'flex',
@@ -18,18 +19,22 @@ var rowStyle = exports.rowStyle = (0, _react.css)({
18
19
  verticalAlign: 'middle'
19
20
  });
20
21
  var AVATAR_HEIGHT = exports.AVATAR_HEIGHT = 36;
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
21
23
  var avatarStyle = exports.avatarStyle = (0, _react.css)({
22
24
  position: 'relative',
23
25
  flex: 'initial',
24
26
  opacity: 'inherit',
25
27
  width: '36px',
26
28
  height: "".concat(AVATAR_HEIGHT, "px"),
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
27
30
  '> span': {
28
31
  width: '24px',
29
32
  height: '24px',
30
33
  padding: "var(--ds-space-075, 6px)"
31
34
  }
32
35
  });
36
+
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
33
38
  var nameSectionStyle = exports.nameSectionStyle = (0, _react.css)({
34
39
  flex: 1,
35
40
  minWidth: 0,
@@ -38,6 +43,8 @@ var nameSectionStyle = exports.nameSectionStyle = (0, _react.css)({
38
43
  color: "var(--ds-text-subtle, ".concat(_colors.N300, ")"),
39
44
  opacity: 'inherit'
40
45
  });
46
+
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
41
48
  var mentionItemStyle = exports.mentionItemStyle = (0, _react.css)({
42
49
  backgroundColor: 'transparent',
43
50
  display: 'block',
@@ -45,9 +52,13 @@ var mentionItemStyle = exports.mentionItemStyle = (0, _react.css)({
45
52
  listStyleType: 'none',
46
53
  cursor: 'pointer'
47
54
  });
55
+
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
48
57
  var mentionItemSelectedStyle = exports.mentionItemSelectedStyle = (0, _react.css)({
49
58
  backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")")
50
59
  });
60
+
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
51
62
  var capitalizedStyle = exports.capitalizedStyle = (0, _react.css)({
52
63
  textTransform: 'capitalize'
53
64
  });
@@ -82,7 +82,7 @@ export const buildTypeAheadInviteItemClickedPayload = (duration, upKeyCount, dow
82
82
  userRole
83
83
  });
84
84
  };
85
- export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionList, query, contextIdentifierProvider, taskListId, taskItemId) => {
85
+ export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId) => {
86
86
  const {
87
87
  queryLength,
88
88
  spaceInQuery
@@ -103,7 +103,8 @@ export const buildTypeAheadInsertedPayload = (duration, upKeyCount, downKeyCount
103
103
  memberCount: isTeamType(mention.userType) && mention.context ? mention.context.memberCount : null,
104
104
  includesYou: isTeamType(mention.userType) && mention.context ? mention.context.includesYou : null,
105
105
  taskListId,
106
- taskItemId
106
+ taskItemId,
107
+ localId: mentionLocalId
107
108
  });
108
109
  if (contextIdentifierProvider) {
109
110
  analyticsPayload.containerId = contextIdentifierProvider.containerId || undefined;
@@ -81,28 +81,31 @@ const mentionsPlugin = ({
81
81
  pluginsOptions: {
82
82
  quickInsert: ({
83
83
  formatMessage
84
- }) => [{
85
- id: 'mention',
86
- title: formatMessage(messages.mention),
87
- description: formatMessage(messages.mentionDescription),
88
- keywords: ['team', 'user'],
89
- priority: 400,
90
- keyshortcut: '@',
91
- icon: () => /*#__PURE__*/React.createElement(IconMention, null),
92
- action(insert, state) {
93
- var _api$typeAhead2;
94
- const tr = insert(undefined);
95
- const pluginState = mentionPluginKey.getState(state);
96
- if (pluginState && pluginState.canInsertMention === false) {
97
- return false;
84
+ }) => {
85
+ var _options$getEditorFea;
86
+ return [{
87
+ id: 'mention',
88
+ title: formatMessage(messages.mention),
89
+ description: formatMessage(messages.mentionDescription),
90
+ keywords: ['team', 'user'],
91
+ priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 700 : 400,
92
+ keyshortcut: '@',
93
+ icon: () => /*#__PURE__*/React.createElement(IconMention, null),
94
+ action(insert, state) {
95
+ var _api$typeAhead2;
96
+ const tr = insert(undefined);
97
+ const pluginState = mentionPluginKey.getState(state);
98
+ if (pluginState && pluginState.canInsertMention === false) {
99
+ return false;
100
+ }
101
+ api === null || api === void 0 ? void 0 : (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.openAtTransaction({
102
+ triggerHandler: typeAhead,
103
+ inputMethod: INPUT_METHOD.QUICK_INSERT
104
+ })(tr);
105
+ return tr;
98
106
  }
99
- api === null || api === void 0 ? void 0 : (_api$typeAhead2 = api.typeAhead) === null || _api$typeAhead2 === void 0 ? void 0 : _api$typeAhead2.actions.openAtTransaction({
100
- triggerHandler: typeAhead,
101
- inputMethod: INPUT_METHOD.QUICK_INSERT
102
- })(tr);
103
- return tr;
104
- }
105
- }],
107
+ }];
108
+ },
106
109
  typeAhead
107
110
  }
108
111
  };
@@ -301,7 +301,8 @@ export const createTypeAheadConfig = ({
301
301
  taskItemId = taskItem.node.attrs.localId;
302
302
  }
303
303
  }
304
- fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, sourceListItem.map(x => x.mention), query, contextIdentifierProvider, taskListId, taskItemId));
304
+ const mentionLocalId = uuid();
305
+ fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(x => x.mention), query, contextIdentifierProvider, taskListId, taskItemId));
305
306
  sessionId = uuid();
306
307
  if (mentionProvider && isTeamType(userType)) {
307
308
  return insert(buildNodesForTeamMention(schema, item.mention, mentionProvider, sanitizePrivateContent));
@@ -318,7 +319,7 @@ export const createTypeAheadConfig = ({
318
319
  id,
319
320
  accessLevel,
320
321
  userType: userType === 'DEFAULT' ? null : userType,
321
- localId: uuid()
322
+ localId: mentionLocalId
322
323
  });
323
324
  const space = schema.text(' ');
324
325
  return insert(Fragment.from([mentionNode, space]));
@@ -40,6 +40,7 @@ const InviteItem = ({
40
40
  }
41
41
  }, [onMount]);
42
42
  return jsx("div", {
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
43
44
  css: [mentionItemStyle, selected && mentionItemSelectedStyle],
44
45
  onMouseDown: onSelected,
45
46
  onMouseEnter: onItemMouseEnter,
@@ -57,7 +58,9 @@ const InviteItem = ({
57
58
  }, jsx(FormattedMessage, _extends({}, messages.inviteItemTitle, {
58
59
  values: {
59
60
  userRole: userRole || 'basic',
60
- productName: jsx("span", {
61
+ productName:
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
63
+ jsx("span", {
61
64
  css: capitalizedStyle,
62
65
  "data-testid": "capitalized-message"
63
66
  }, productName)
@@ -1,6 +1,7 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { N30, N300 } from '@atlaskit/theme/colors';
3
3
  export const ROW_SIDE_PADDING = 14;
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
4
5
  export const rowStyle = css({
5
6
  alignItems: 'center',
6
7
  display: 'flex',
@@ -12,18 +13,22 @@ export const rowStyle = css({
12
13
  verticalAlign: 'middle'
13
14
  });
14
15
  export const AVATAR_HEIGHT = 36;
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
15
17
  export const avatarStyle = css({
16
18
  position: 'relative',
17
19
  flex: 'initial',
18
20
  opacity: 'inherit',
19
21
  width: '36px',
20
22
  height: `${AVATAR_HEIGHT}px`,
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
24
  '> span': {
22
25
  width: '24px',
23
26
  height: '24px',
24
27
  padding: "var(--ds-space-075, 6px)"
25
28
  }
26
29
  });
30
+
31
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
27
32
  export const nameSectionStyle = css({
28
33
  flex: 1,
29
34
  minWidth: 0,
@@ -32,6 +37,8 @@ export const nameSectionStyle = css({
32
37
  color: `var(--ds-text-subtle, ${N300})`,
33
38
  opacity: 'inherit'
34
39
  });
40
+
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
35
42
  export const mentionItemStyle = css({
36
43
  backgroundColor: 'transparent',
37
44
  display: 'block',
@@ -39,9 +46,13 @@ export const mentionItemStyle = css({
39
46
  listStyleType: 'none',
40
47
  cursor: 'pointer'
41
48
  });
49
+
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
42
51
  export const mentionItemSelectedStyle = css({
43
52
  backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N30})`
44
53
  });
54
+
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
45
56
  export const capitalizedStyle = css({
46
57
  textTransform: 'capitalize'
47
58
  });
@@ -88,7 +88,7 @@ export var buildTypeAheadInviteItemClickedPayload = function buildTypeAheadInvit
88
88
  userRole: userRole
89
89
  });
90
90
  };
91
- export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionList, query, contextIdentifierProvider, taskListId, taskItemId) {
91
+ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayload(duration, upKeyCount, downKeyCount, sessionId, insertType, mention, mentionLocalId, mentionList, query, contextIdentifierProvider, taskListId, taskItemId) {
92
92
  var _extractAttributesFro3 = extractAttributesFromQuery(query),
93
93
  queryLength = _extractAttributesFro3.queryLength,
94
94
  spaceInQuery = _extractAttributesFro3.spaceInQuery;
@@ -108,7 +108,8 @@ export var buildTypeAheadInsertedPayload = function buildTypeAheadInsertedPayloa
108
108
  memberCount: isTeamType(mention.userType) && mention.context ? mention.context.memberCount : null,
109
109
  includesYou: isTeamType(mention.userType) && mention.context ? mention.context.includesYou : null,
110
110
  taskListId: taskListId,
111
- taskItemId: taskItemId
111
+ taskItemId: taskItemId,
112
+ localId: mentionLocalId
112
113
  });
113
114
  if (contextIdentifierProvider) {
114
115
  analyticsPayload.containerId = contextIdentifierProvider.containerId || undefined;
@@ -81,13 +81,14 @@ var mentionsPlugin = function mentionsPlugin(_ref) {
81
81
  },
82
82
  pluginsOptions: {
83
83
  quickInsert: function quickInsert(_ref4) {
84
+ var _options$getEditorFea;
84
85
  var formatMessage = _ref4.formatMessage;
85
86
  return [{
86
87
  id: 'mention',
87
88
  title: formatMessage(messages.mention),
88
89
  description: formatMessage(messages.mentionDescription),
89
90
  keywords: ['team', 'user'],
90
- priority: 400,
91
+ priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 700 : 400,
91
92
  keyshortcut: '@',
92
93
  icon: function icon() {
93
94
  return /*#__PURE__*/React.createElement(IconMention, null);
@@ -303,7 +303,8 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
303
303
  taskItemId = taskItem.node.attrs.localId;
304
304
  }
305
305
  }
306
- fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, sourceListItem.map(function (x) {
306
+ var mentionLocalId = uuid();
307
+ fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(function (x) {
307
308
  return x.mention;
308
309
  }), query, contextIdentifierProvider, taskListId, taskItemId));
309
310
  sessionId = uuid();
@@ -322,7 +323,7 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
322
323
  id: id,
323
324
  accessLevel: accessLevel,
324
325
  userType: userType === 'DEFAULT' ? null : userType,
325
- localId: uuid()
326
+ localId: mentionLocalId
326
327
  });
327
328
  var space = schema.text(' ');
328
329
  return insert(Fragment.from([mentionNode, space]));
@@ -39,6 +39,7 @@ var InviteItem = function InviteItem(_ref) {
39
39
  }
40
40
  }, [onMount]);
41
41
  return jsx("div", {
42
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
42
43
  css: [mentionItemStyle, selected && mentionItemSelectedStyle],
43
44
  onMouseDown: onSelected,
44
45
  onMouseEnter: onItemMouseEnter,
@@ -56,7 +57,9 @@ var InviteItem = function InviteItem(_ref) {
56
57
  }, jsx(FormattedMessage, _extends({}, messages.inviteItemTitle, {
57
58
  values: {
58
59
  userRole: userRole || 'basic',
59
- productName: jsx("span", {
60
+ productName:
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
62
+ jsx("span", {
60
63
  css: capitalizedStyle,
61
64
  "data-testid": "capitalized-message"
62
65
  }, productName)
@@ -1,6 +1,7 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { N30, N300 } from '@atlaskit/theme/colors';
3
3
  export var ROW_SIDE_PADDING = 14;
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
4
5
  export var rowStyle = css({
5
6
  alignItems: 'center',
6
7
  display: 'flex',
@@ -12,18 +13,22 @@ export var rowStyle = css({
12
13
  verticalAlign: 'middle'
13
14
  });
14
15
  export var AVATAR_HEIGHT = 36;
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
15
17
  export var avatarStyle = css({
16
18
  position: 'relative',
17
19
  flex: 'initial',
18
20
  opacity: 'inherit',
19
21
  width: '36px',
20
22
  height: "".concat(AVATAR_HEIGHT, "px"),
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
24
  '> span': {
22
25
  width: '24px',
23
26
  height: '24px',
24
27
  padding: "var(--ds-space-075, 6px)"
25
28
  }
26
29
  });
30
+
31
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
27
32
  export var nameSectionStyle = css({
28
33
  flex: 1,
29
34
  minWidth: 0,
@@ -32,6 +37,8 @@ export var nameSectionStyle = css({
32
37
  color: "var(--ds-text-subtle, ".concat(N300, ")"),
33
38
  opacity: 'inherit'
34
39
  });
40
+
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
35
42
  export var mentionItemStyle = css({
36
43
  backgroundColor: 'transparent',
37
44
  display: 'block',
@@ -39,9 +46,13 @@ export var mentionItemStyle = css({
39
46
  listStyleType: 'none',
40
47
  cursor: 'pointer'
41
48
  });
49
+
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
42
51
  export var mentionItemSelectedStyle = css({
43
52
  backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N30, ")")
44
53
  });
54
+
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
45
56
  export var capitalizedStyle = css({
46
57
  textTransform: 'capitalize'
47
58
  });
@@ -8,5 +8,5 @@ export declare const buildAnalyticsPayload: (actionSubject: string, action: stri
8
8
  export declare const buildTypeAheadCancelPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, query?: string) => GasPayload;
9
9
  export declare const buildTypeAheadInviteItemViewedPayload: (sessionId: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole) => GasPayload;
10
10
  export declare const buildTypeAheadInviteItemClickedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, query?: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole) => GasPayload;
11
- export declare const buildTypeAheadInsertedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, mention: MentionDescription, mentionList?: MentionDescription[], query?: string, contextIdentifierProvider?: ContextIdentifierProvider, taskListId?: string, taskItemId?: string) => GasPayload;
11
+ export declare const buildTypeAheadInsertedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, mention: MentionDescription, mentionLocalId: string, mentionList?: MentionDescription[], query?: string, contextIdentifierProvider?: ContextIdentifierProvider, taskListId?: string, taskItemId?: string) => GasPayload;
12
12
  export declare const buildTypeAheadRenderedPayload: (duration: number, userIds: Array<string> | null, query: string, teams: TeamInfoAttrAnalytics[] | null) => GasPayload;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { AnalyticsEventPayload } from '@atlaskit/analytics-next';
3
3
  import { type ProfilecardProvider } from '@atlaskit/editor-common/src/provider-factory/profile-card-provider';
4
- import type { NextEditorPlugin, OptionalPlugin, TypeAheadHandler } from '@atlaskit/editor-common/types';
4
+ import type { GetEditorFeatureFlags, NextEditorPlugin, OptionalPlugin, TypeAheadHandler } from '@atlaskit/editor-common/types';
5
5
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
6
  import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
7
7
  import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
@@ -15,6 +15,7 @@ export interface MentionPluginConfig {
15
15
  HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
16
16
  insertDisplayName?: boolean;
17
17
  profilecardProvider?: Promise<ProfilecardProvider>;
18
+ getEditorFeatureFlags?: GetEditorFeatureFlags;
18
19
  }
19
20
  export interface MentionPluginOptions extends MentionPluginConfig {
20
21
  sanitizePrivateContent?: boolean;
@@ -8,5 +8,5 @@ export declare const buildAnalyticsPayload: (actionSubject: string, action: stri
8
8
  export declare const buildTypeAheadCancelPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, query?: string) => GasPayload;
9
9
  export declare const buildTypeAheadInviteItemViewedPayload: (sessionId: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole) => GasPayload;
10
10
  export declare const buildTypeAheadInviteItemClickedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, query?: string, contextIdentifierProvider?: ContextIdentifierProvider, userRole?: UserRole) => GasPayload;
11
- export declare const buildTypeAheadInsertedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, mention: MentionDescription, mentionList?: MentionDescription[], query?: string, contextIdentifierProvider?: ContextIdentifierProvider, taskListId?: string, taskItemId?: string) => GasPayload;
11
+ export declare const buildTypeAheadInsertedPayload: (duration: number, upKeyCount: number, downKeyCount: number, sessionId: string, insertType: SelectItemMode, mention: MentionDescription, mentionLocalId: string, mentionList?: MentionDescription[], query?: string, contextIdentifierProvider?: ContextIdentifierProvider, taskListId?: string, taskItemId?: string) => GasPayload;
12
12
  export declare const buildTypeAheadRenderedPayload: (duration: number, userIds: Array<string> | null, query: string, teams: TeamInfoAttrAnalytics[] | null) => GasPayload;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { AnalyticsEventPayload } from '@atlaskit/analytics-next';
3
3
  import { type ProfilecardProvider } from '@atlaskit/editor-common/src/provider-factory/profile-card-provider';
4
- import type { NextEditorPlugin, OptionalPlugin, TypeAheadHandler } from '@atlaskit/editor-common/types';
4
+ import type { GetEditorFeatureFlags, NextEditorPlugin, OptionalPlugin, TypeAheadHandler } from '@atlaskit/editor-common/types';
5
5
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
6
  import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
7
7
  import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
@@ -15,6 +15,7 @@ export interface MentionPluginConfig {
15
15
  HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
16
16
  insertDisplayName?: boolean;
17
17
  profilecardProvider?: Promise<ProfilecardProvider>;
18
+ getEditorFeatureFlags?: GetEditorFeatureFlags;
18
19
  }
19
20
  export interface MentionPluginOptions extends MentionPluginConfig {
20
21
  sanitizePrivateContent?: boolean;
package/package.json CHANGED
@@ -1,112 +1,88 @@
1
1
  {
2
- "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "1.5.1",
4
- "description": "Mentions plugin for @atlaskit/editor-core",
5
- "author": "Atlassian Pty Ltd",
6
- "license": "Apache-2.0",
7
- "publishConfig": {
8
- "registry": "https://registry.npmjs.org/"
9
- },
10
- "atlassian": {
11
- "team": "Editor: AI",
12
- "singleton": true,
13
- "inPublicMirror": false,
14
- "releaseModel": "continuous",
15
- "runReact18": false
16
- },
17
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
- "main": "dist/cjs/index.js",
19
- "module": "dist/esm/index.js",
20
- "module:es2019": "dist/es2019/index.js",
21
- "types": "dist/types/index.d.ts",
22
- "typesVersions": {
23
- ">=4.5 <4.9": {
24
- "*": [
25
- "dist/types-ts4.5/*",
26
- "dist/types-ts4.5/index.d.ts"
27
- ]
28
- }
29
- },
30
- "sideEffects": false,
31
- "atlaskit:src": "src/index.ts",
32
- "af:exports": {
33
- ".": "./src/index.ts"
34
- },
35
- "dependencies": {
36
- "@atlaskit/adf-schema": "^36.10.7",
37
- "@atlaskit/analytics-gas-types": "^5.1.0",
38
- "@atlaskit/editor-common": "^82.0.0",
39
- "@atlaskit/editor-plugin-analytics": "^1.2.0",
40
- "@atlaskit/editor-plugin-context-identifier": "^1.1.0",
41
- "@atlaskit/editor-plugin-type-ahead": "^1.2.0",
42
- "@atlaskit/editor-prosemirror": "4.0.1",
43
- "@atlaskit/icon": "^22.3.0",
44
- "@atlaskit/mention": "^23.1.0",
45
- "@atlaskit/platform-feature-flags": "^0.2.5",
46
- "@atlaskit/theme": "^12.8.0",
47
- "@atlaskit/tokens": "^1.49.0",
48
- "@babel/runtime": "^7.0.0",
49
- "@emotion/react": "^11.7.1",
50
- "uuid": "^3.1.0"
51
- },
52
- "peerDependencies": {
53
- "react": "^16.8.0",
54
- "react-dom": "^16.8.0",
55
- "react-intl-next": "npm:react-intl@^5.18.1"
56
- },
57
- "devDependencies": {
58
- "@af/visual-regression": "*",
59
- "@atlaskit/ssr": "*",
60
- "@atlaskit/visual-regression": "*",
61
- "@testing-library/react": "^12.1.5",
62
- "react-dom": "^16.8.0",
63
- "typescript": "~5.4.2",
64
- "wait-for-expect": "^1.2.0"
65
- },
66
- "techstack": {
67
- "@atlassian/frontend": {
68
- "code-structure": [
69
- "tangerine-next"
70
- ],
71
- "import-structure": [
72
- "atlassian-conventions"
73
- ],
74
- "circular-dependencies": [
75
- "file-and-folder-level"
76
- ]
77
- },
78
- "@repo/internal": {
79
- "dom-events": "use-bind-event-listener",
80
- "analytics": [
81
- "analytics-next"
82
- ],
83
- "design-tokens": [
84
- "color"
85
- ],
86
- "theming": [
87
- "react-context"
88
- ],
89
- "ui-components": [
90
- "lite-mode"
91
- ],
92
- "deprecation": "no-deprecated-imports",
93
- "styling": [
94
- "emotion",
95
- "emotion"
96
- ],
97
- "imports": [
98
- "import-no-extraneous-disable-for-examples-and-docs"
99
- ]
100
- }
101
- },
102
- "techstackIgnore": {
103
- "stricter": [
104
- "@atlassian/tangerine/project-structure"
105
- ]
106
- },
107
- "platform-feature-flags": {
108
- "platform.editor.mentions-in-editor-popup-on-click": {
109
- "type": "boolean"
110
- }
111
- }
112
- }
2
+ "name": "@atlaskit/editor-plugin-mentions",
3
+ "version": "1.6.1",
4
+ "description": "Mentions plugin for @atlaskit/editor-core",
5
+ "author": "Atlassian Pty Ltd",
6
+ "license": "Apache-2.0",
7
+ "publishConfig": {
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "atlassian": {
11
+ "team": "Editor: AI",
12
+ "singleton": true,
13
+ "inPublicMirror": false,
14
+ "releaseModel": "continuous",
15
+ "runReact18": false
16
+ },
17
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
+ "main": "dist/cjs/index.js",
19
+ "module": "dist/esm/index.js",
20
+ "module:es2019": "dist/es2019/index.js",
21
+ "types": "dist/types/index.d.ts",
22
+ "typesVersions": {
23
+ ">=4.5 <4.9": {
24
+ "*": ["dist/types-ts4.5/*", "dist/types-ts4.5/index.d.ts"]
25
+ }
26
+ },
27
+ "sideEffects": false,
28
+ "atlaskit:src": "src/index.ts",
29
+ "af:exports": {
30
+ ".": "./src/index.ts"
31
+ },
32
+ "dependencies": {
33
+ "@atlaskit/adf-schema": "^36.10.7",
34
+ "@atlaskit/analytics-gas-types": "^5.1.0",
35
+ "@atlaskit/editor-common": "^82.6.0",
36
+ "@atlaskit/editor-plugin-analytics": "^1.2.0",
37
+ "@atlaskit/editor-plugin-context-identifier": "^1.1.0",
38
+ "@atlaskit/editor-plugin-type-ahead": "^1.2.0",
39
+ "@atlaskit/editor-prosemirror": "4.0.1",
40
+ "@atlaskit/icon": "^22.3.0",
41
+ "@atlaskit/mention": "^23.2.0",
42
+ "@atlaskit/platform-feature-flags": "^0.2.5",
43
+ "@atlaskit/theme": "^12.9.0",
44
+ "@atlaskit/tokens": "^1.50.0",
45
+ "@babel/runtime": "^7.0.0",
46
+ "@emotion/react": "^11.7.1",
47
+ "uuid": "^3.1.0"
48
+ },
49
+ "peerDependencies": {
50
+ "react": "^16.8.0",
51
+ "react-dom": "^16.8.0",
52
+ "react-intl-next": "npm:react-intl@^5.18.1"
53
+ },
54
+ "devDependencies": {
55
+ "@af/visual-regression": "*",
56
+ "@atlaskit/ssr": "*",
57
+ "@atlaskit/visual-regression": "*",
58
+ "@testing-library/react": "^12.1.5",
59
+ "react-dom": "^16.8.0",
60
+ "typescript": "~5.4.2",
61
+ "wait-for-expect": "^1.2.0"
62
+ },
63
+ "techstack": {
64
+ "@atlassian/frontend": {
65
+ "code-structure": ["tangerine-next"],
66
+ "import-structure": ["atlassian-conventions"],
67
+ "circular-dependencies": ["file-and-folder-level"]
68
+ },
69
+ "@repo/internal": {
70
+ "dom-events": "use-bind-event-listener",
71
+ "analytics": ["analytics-next"],
72
+ "design-tokens": ["color"],
73
+ "theming": ["react-context"],
74
+ "ui-components": ["lite-mode"],
75
+ "deprecation": "no-deprecated-imports",
76
+ "styling": ["emotion", "emotion"],
77
+ "imports": ["import-no-extraneous-disable-for-examples-and-docs"]
78
+ }
79
+ },
80
+ "techstackIgnore": {
81
+ "stricter": ["@atlassian/tangerine/project-structure"]
82
+ },
83
+ "platform-feature-flags": {
84
+ "platform.editor.mentions-in-editor-popup-on-click": {
85
+ "type": "boolean"
86
+ }
87
+ }
88
+ }