@atlaskit/mention 26.0.4 → 26.2.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 +78 -0
- package/dist/cjs/api/ContextMentionResource.js +14 -0
- package/dist/cjs/api/MentionResource.js +6 -0
- package/dist/cjs/components/DisabledMentionTooltip/index.js +20 -0
- package/dist/cjs/components/DisabledMentionTooltip/main.js +24 -0
- package/dist/cjs/components/Mention/PrimitiveMention.js +8 -1
- package/dist/cjs/components/Mention/index.js +51 -12
- package/dist/cjs/components/MentionItem/index.js +9 -1
- package/dist/cjs/components/MentionItem/styles.js +5 -2
- package/dist/cjs/item.js +6 -0
- package/dist/cjs/types.js +10 -0
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/api/ContextMentionResource.js +12 -0
- package/dist/es2019/api/MentionResource.js +4 -0
- package/dist/es2019/components/DisabledMentionTooltip/index.js +7 -0
- package/dist/es2019/components/DisabledMentionTooltip/main.js +14 -0
- package/dist/es2019/components/Mention/PrimitiveMention.js +8 -0
- package/dist/es2019/components/Mention/index.js +50 -12
- package/dist/es2019/components/MentionItem/index.js +4 -2
- package/dist/es2019/components/MentionItem/styles.js +16 -11
- package/dist/es2019/item.js +2 -2
- package/dist/es2019/types.js +12 -0
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/api/ContextMentionResource.js +14 -0
- package/dist/esm/api/MentionResource.js +6 -0
- package/dist/esm/components/DisabledMentionTooltip/index.js +9 -0
- package/dist/esm/components/DisabledMentionTooltip/main.js +17 -0
- package/dist/esm/components/Mention/PrimitiveMention.js +8 -1
- package/dist/esm/components/Mention/index.js +51 -12
- package/dist/esm/components/MentionItem/index.js +4 -2
- package/dist/esm/components/MentionItem/styles.js +4 -1
- package/dist/esm/item.js +2 -2
- package/dist/esm/types.js +12 -0
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/api/ContextMentionResource.d.ts +6 -1
- package/dist/types/api/MentionResource.d.ts +2 -1
- package/dist/types/components/DisabledMentionTooltip/index.d.ts +6 -0
- package/dist/types/components/DisabledMentionTooltip/main.d.ts +12 -0
- package/dist/types/components/Mention/index.d.ts +12 -0
- package/dist/types/components/MentionItem/index.d.ts +2 -1
- package/dist/types/components/MentionItem/styles.d.ts +2 -0
- package/dist/types/item.d.ts +2 -2
- package/dist/types/types.d.ts +67 -1
- package/dist/types-ts4.5/api/ContextMentionResource.d.ts +6 -1
- package/dist/types-ts4.5/api/MentionResource.d.ts +2 -1
- package/dist/types-ts4.5/components/DisabledMentionTooltip/index.d.ts +6 -0
- package/dist/types-ts4.5/components/DisabledMentionTooltip/main.d.ts +12 -0
- package/dist/types-ts4.5/components/Mention/index.d.ts +12 -0
- package/dist/types-ts4.5/components/MentionItem/index.d.ts +2 -1
- package/dist/types-ts4.5/components/MentionItem/styles.d.ts +2 -0
- package/dist/types-ts4.5/item.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +67 -1
- package/docs/0-intro.tsx +21 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,83 @@
|
|
|
1
1
|
# @atlaskit/mention
|
|
2
2
|
|
|
3
|
+
## 26.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`971e92e232624`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/971e92e232624) -
|
|
8
|
+
Added a new `DISABLED` visual variant for mention chips so rendering surfaces (such as the editor
|
|
9
|
+
mentions plugin) can render a chip in a non-interactive disabled state with an explanatory
|
|
10
|
+
tooltip. Includes optional `MentionProvider` hooks that let consumers drive the disabled state
|
|
11
|
+
reactively and observe mention deletions.
|
|
12
|
+
|
|
13
|
+
**`@atlaskit/mention`**
|
|
14
|
+
- New `MentionType.DISABLED` enum value and matching style on `PrimitiveMention`.
|
|
15
|
+
- New optional `isDisabled` and `disabledTooltip` props on the React `<Mention>` component. When
|
|
16
|
+
`isDisabled` is set the chip becomes non-clickable, exposes `aria-disabled="true"`, remains
|
|
17
|
+
keyboard-focusable (`tabindex="0"`), and — when `disabledTooltip` is also set — is wrapped in an
|
|
18
|
+
ADS `<Tooltip>` whose content is mirrored into `aria-label` for screen readers.
|
|
19
|
+
- New `MentionDisabledState` (`{ disabled: boolean; tooltip?: string }`) and
|
|
20
|
+
`MentionDisabledStateInput` (`{ id: string }`) types, re-exported from `@atlaskit/mention` and
|
|
21
|
+
`@atlaskit/mention/resource`.
|
|
22
|
+
- New optional `MentionResource` config option `getMentionDisabledState` (forwarded by
|
|
23
|
+
`ContextMentionResource`) that surfaces through three new optional methods on the
|
|
24
|
+
`MentionProvider` interface:
|
|
25
|
+
- `getMentionDisabledState?(mention)` — predicate the editor calls to determine whether a chip
|
|
26
|
+
should render disabled.
|
|
27
|
+
- `subscribeToDisabledStateChanges?(listener)` — lets the editor re-evaluate the predicate when
|
|
28
|
+
the consumer's inputs change.
|
|
29
|
+
- `notifyMentionDestroyed?(mention)` — lets the consumer observe chip removals (e.g. to update
|
|
30
|
+
its source of truth).
|
|
31
|
+
|
|
32
|
+
All three methods are optional so existing `MentionProvider` implementations continue to compile
|
|
33
|
+
and behave identically.
|
|
34
|
+
|
|
35
|
+
**`@atlaskit/editor-plugin-mentions` + `@atlaskit/editor-core`**
|
|
36
|
+
- The mention `NodeView` now reads `MentionProvider.getMentionDisabledState?.({ id })` on every
|
|
37
|
+
state update and re-evaluates whenever `subscribeToDisabledStateChanges` notifies. When the
|
|
38
|
+
predicate returns `{ disabled: true }` the chip gets a new `.mention-disabled` class,
|
|
39
|
+
`aria-disabled="true"`, and an ADS `<Tooltip>` (anchored to the chip via `portalProviderAPI`)
|
|
40
|
+
carrying the `tooltip` text. The chip remains keyboard-focusable.
|
|
41
|
+
- The mention `NodeView.destroy()` calls `notifyMentionDestroyed?.({ id })` on the subscribed
|
|
42
|
+
provider so consumers can react to chip removals without depending on the editor's `onChange`.
|
|
43
|
+
- Added a matching `.editor-mention-primitive.mention-disabled` style in `@atlaskit/editor-core`
|
|
44
|
+
so the new class renders correctly inside the editor content container.
|
|
45
|
+
- Providers that don't implement the new optional methods are entirely unaffected.
|
|
46
|
+
|
|
47
|
+
**`@atlassian/conversation-assistant`, `@atlassian/conversation-assistant-widget` (chat store)**
|
|
48
|
+
- New `addSelectedAgentId({ conversationId, agentId })` action — append-only, no-dedup push onto
|
|
49
|
+
the conversation's `selectedAgentIds` history. Each call adds exactly one entry; duplicates are
|
|
50
|
+
preserved so the history is a 1-to-1 log of every agent chip currently in the editor.
|
|
51
|
+
- New `removeSelectedAgentId({ conversationId, agentId })` action — removes the **rightmost**
|
|
52
|
+
occurrence of an id (preserving order of other entries) for use when a single agent chip is
|
|
53
|
+
deleted from the editor.
|
|
54
|
+
- `setSelectedAgentIds` retains its wholesale-replace semantics (unchanged externally).
|
|
55
|
+
- The picker callback in `chat-input-refresh` is now wired to `addSelectedAgentId`; chip-deletion
|
|
56
|
+
is wired to `removeSelectedAgentId`. The active agent is always `selectedAgentIds.at(-1)`.
|
|
57
|
+
|
|
58
|
+
**`@atlassian/conversation-assistant-chat-prompt-input`**
|
|
59
|
+
- `useChatMentionResource` accepts new options `getSelectedAgentIds`, `disabledAgentTooltip`, and
|
|
60
|
+
`onAgentMentionDestroyed` that wire the new `MentionProvider` capabilities described above.
|
|
61
|
+
- `withAgentSupport` extended with the same options, plus a `notifyMentionDestroyed`
|
|
62
|
+
implementation that forwards to the consumer when a known agent chip is destroyed (sourced from
|
|
63
|
+
the editor `NodeView` rather than from `onChange`, which is not reliably called on every chat
|
|
64
|
+
surface).
|
|
65
|
+
- `<RovoChatPromptInput>` exposes new optional `selectedAgentIds`, `disabledAgentTooltip`, and
|
|
66
|
+
`onAgentMentionDeleted` props for consumers that want to drive the disabled-agent chip state
|
|
67
|
+
from their own store.
|
|
68
|
+
|
|
69
|
+
**`@atlassian/conversation-assistant-store`**
|
|
70
|
+
- JSDoc on the `selectedAgentIds` conversation field updated to document the new append-only /
|
|
71
|
+
rightmost-remove semantics and the canonical read pattern (`.at(-1)` for the active agent). No
|
|
72
|
+
runtime or type-shape change.
|
|
73
|
+
|
|
74
|
+
## 26.1.0
|
|
75
|
+
|
|
76
|
+
### Minor Changes
|
|
77
|
+
|
|
78
|
+
- [`7567557c596c7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7567557c596c7) -
|
|
79
|
+
[ux] Update mention item styling platform_editor_agent_mentions
|
|
80
|
+
|
|
3
81
|
## 26.0.4
|
|
4
82
|
|
|
5
83
|
### Patch Changes
|
|
@@ -42,6 +42,20 @@ var ContextMentionResource = exports.default = /*#__PURE__*/function () {
|
|
|
42
42
|
(0, _defineProperty2.default)(this, "filter", this.callWithContextIds('filter', 1));
|
|
43
43
|
(0, _defineProperty2.default)(this, "recordMentionSelection", this.callWithContextIds('recordMentionSelection', 1));
|
|
44
44
|
(0, _defineProperty2.default)(this, "shouldHighlightMention", this.callDefault('shouldHighlightMention'));
|
|
45
|
+
(0, _defineProperty2.default)(this, "getMentionDisabledState", function (mention) {
|
|
46
|
+
var _this$mentionProvider3, _this$mentionProvider4;
|
|
47
|
+
return (_this$mentionProvider3 = (_this$mentionProvider4 = _this.mentionProvider).getMentionDisabledState) === null || _this$mentionProvider3 === void 0 ? void 0 : _this$mentionProvider3.call(_this$mentionProvider4, mention);
|
|
48
|
+
});
|
|
49
|
+
(0, _defineProperty2.default)(this, "subscribeToDisabledStateChanges", function (listener) {
|
|
50
|
+
var _this$mentionProvider5, _this$mentionProvider6, _this$mentionProvider7;
|
|
51
|
+
return (_this$mentionProvider5 = (_this$mentionProvider6 = (_this$mentionProvider7 = _this.mentionProvider).subscribeToDisabledStateChanges) === null || _this$mentionProvider6 === void 0 ? void 0 : _this$mentionProvider6.call(_this$mentionProvider7, listener)) !== null && _this$mentionProvider5 !== void 0 ? _this$mentionProvider5 : function () {
|
|
52
|
+
return undefined;
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
(0, _defineProperty2.default)(this, "notifyMentionDestroyed", function (mention) {
|
|
56
|
+
var _this$mentionProvider8, _this$mentionProvider9;
|
|
57
|
+
return (_this$mentionProvider8 = (_this$mentionProvider9 = _this.mentionProvider).notifyMentionDestroyed) === null || _this$mentionProvider8 === void 0 ? void 0 : _this$mentionProvider8.call(_this$mentionProvider9, mention);
|
|
58
|
+
});
|
|
45
59
|
(0, _defineProperty2.default)(this, "isFiltering", this.callDefault('isFiltering'));
|
|
46
60
|
this.mentionProvider = mentionProvider;
|
|
47
61
|
this.contextIdentifier = contextIdentifier;
|
|
@@ -210,6 +210,12 @@ var MentionResource = exports.MentionResource = /*#__PURE__*/function (_Abstract
|
|
|
210
210
|
}
|
|
211
211
|
return false;
|
|
212
212
|
}
|
|
213
|
+
}, {
|
|
214
|
+
key: "getMentionDisabledState",
|
|
215
|
+
value: function getMentionDisabledState(mention) {
|
|
216
|
+
var _this$config$getMenti, _this$config;
|
|
217
|
+
return (_this$config$getMenti = (_this$config = this.config).getMentionDisabledState) === null || _this$config$getMenti === void 0 ? void 0 : _this$config$getMenti.call(_this$config, mention);
|
|
218
|
+
}
|
|
213
219
|
}, {
|
|
214
220
|
key: "notify",
|
|
215
221
|
value: function notify(searchTime, mentionResult, query) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
|
+
var AsyncDisabledMentionTooltip = /*#__PURE__*/_react.default.lazy(function () {
|
|
12
|
+
return Promise.resolve().then(function () {
|
|
13
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_@atlaskit/mention/disabled-mention-tooltip" */'./main'));
|
|
14
|
+
}).then(function (module) {
|
|
15
|
+
return {
|
|
16
|
+
default: module.DisabledMentionTooltip
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
var _default = exports.default = AsyncDisabledMentionTooltip;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.DisabledMentionTooltip = void 0;
|
|
8
|
+
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a disabled `<Mention>` chip with a tooltip explaining why the chip
|
|
12
|
+
* is disabled. The chip itself remains non-interactive; the tooltip is the
|
|
13
|
+
* sole hover affordance.
|
|
14
|
+
*/
|
|
15
|
+
var DisabledMentionTooltip = exports.DisabledMentionTooltip = function DisabledMentionTooltip(_ref) {
|
|
16
|
+
var tooltip = _ref.tooltip,
|
|
17
|
+
children = _ref.children;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
19
|
+
content: tooltip,
|
|
20
|
+
position: "top"
|
|
21
|
+
}, function (triggerProps) {
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("span", triggerProps, children);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -20,7 +20,7 @@ var _excluded = ["mentionType"];
|
|
|
20
20
|
* @jsx jsx
|
|
21
21
|
*/
|
|
22
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
23
|
-
var mentionStyle = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.MentionType.SELF, {
|
|
23
|
+
var mentionStyle = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.MentionType.SELF, {
|
|
24
24
|
background: "var(--ds-background-brand-bold, #1868DB)",
|
|
25
25
|
borderColor: 'transparent',
|
|
26
26
|
text: "var(--ds-text-inverse, #FFFFFF)",
|
|
@@ -38,6 +38,13 @@ var mentionStyle = (0, _defineProperty2.default)((0, _defineProperty2.default)((
|
|
|
38
38
|
text: "var(--ds-text-subtle, #505258)",
|
|
39
39
|
hoveredBackground: "var(--ds-background-neutral-hovered, #0B120E24)",
|
|
40
40
|
pressedBackground: "var(--ds-background-neutral-pressed, #080F214A)"
|
|
41
|
+
}), _types.MentionType.DISABLED, {
|
|
42
|
+
background: "var(--ds-background-disabled, #0515240F)",
|
|
43
|
+
borderColor: 'transparent',
|
|
44
|
+
text: "var(--ds-text-disabled, #080F214A)",
|
|
45
|
+
// Disabled chips do not change on hover / press.
|
|
46
|
+
hoveredBackground: "var(--ds-background-disabled, #0515240F)",
|
|
47
|
+
pressedBackground: "var(--ds-background-disabled, #0515240F)"
|
|
41
48
|
});
|
|
42
49
|
var getStyle = function getStyle(_ref, property) {
|
|
43
50
|
var mentionType = _ref.mentionType;
|
|
@@ -17,12 +17,15 @@ var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
|
17
17
|
var _MessagesIntlProvider = _interopRequireDefault(require("../MessagesIntlProvider"));
|
|
18
18
|
var _PrimitiveMention = _interopRequireDefault(require("./PrimitiveMention"));
|
|
19
19
|
var _NoAccessTooltip = _interopRequireDefault(require("../NoAccessTooltip"));
|
|
20
|
+
var _DisabledMentionTooltip = _interopRequireDefault(require("../DisabledMentionTooltip"));
|
|
20
21
|
var _types = require("../../types");
|
|
21
22
|
var _analytics = require("../../util/analytics");
|
|
22
23
|
var _withAnalyticsEvents = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsEvents"));
|
|
23
24
|
var _ufo = require("@atlaskit/ufo");
|
|
24
25
|
var _i18n = require("../../util/i18n");
|
|
25
26
|
var _ufoExperiences = require("./ufoExperiences");
|
|
27
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
29
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
27
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
31
|
var ANALYTICS_HOVER_DELAY = exports.ANALYTICS_HOVER_DELAY = 1000;
|
|
@@ -36,7 +39,12 @@ var MentionInternal = exports.MentionInternal = /*#__PURE__*/function (_React$Pu
|
|
|
36
39
|
var _this$props = _this.props,
|
|
37
40
|
id = _this$props.id,
|
|
38
41
|
text = _this$props.text,
|
|
39
|
-
onClick = _this$props.onClick
|
|
42
|
+
onClick = _this$props.onClick,
|
|
43
|
+
isDisabled = _this$props.isDisabled;
|
|
44
|
+
if (isDisabled) {
|
|
45
|
+
// Disabled chips do not invoke their click handler.
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
40
48
|
if (onClick) {
|
|
41
49
|
onClick(id, text, e);
|
|
42
50
|
}
|
|
@@ -72,7 +80,11 @@ var MentionInternal = exports.MentionInternal = /*#__PURE__*/function (_React$Pu
|
|
|
72
80
|
(0, _defineProperty2.default)(_this, "getMentionType", function () {
|
|
73
81
|
var _this$props4 = _this.props,
|
|
74
82
|
accessLevel = _this$props4.accessLevel,
|
|
75
|
-
isHighlighted = _this$props4.isHighlighted
|
|
83
|
+
isHighlighted = _this$props4.isHighlighted,
|
|
84
|
+
isDisabled = _this$props4.isDisabled;
|
|
85
|
+
if (isDisabled) {
|
|
86
|
+
return _types.MentionType.DISABLED;
|
|
87
|
+
}
|
|
76
88
|
if (isHighlighted) {
|
|
77
89
|
return _types.MentionType.SELF;
|
|
78
90
|
}
|
|
@@ -122,11 +134,25 @@ var MentionInternal = exports.MentionInternal = /*#__PURE__*/function (_React$Pu
|
|
|
122
134
|
var text = props.text,
|
|
123
135
|
id = props.id,
|
|
124
136
|
accessLevel = props.accessLevel,
|
|
125
|
-
localId = props.localId
|
|
137
|
+
localId = props.localId,
|
|
138
|
+
disabledTooltip = props.disabledTooltip;
|
|
126
139
|
var mentionType = this.getMentionType();
|
|
127
140
|
var failedMention = text === "@".concat(UNKNOWN_USER_ID);
|
|
128
|
-
var
|
|
129
|
-
var
|
|
141
|
+
var showRestrictedTooltip = mentionType === _types.MentionType.RESTRICTED;
|
|
142
|
+
var showDisabledTooltip = mentionType === _types.MentionType.DISABLED && !!disabledTooltip;
|
|
143
|
+
|
|
144
|
+
// A11y: when the chip is in the disabled visual state, expose
|
|
145
|
+
// `aria-disabled` so assistive tech announces it as such. The
|
|
146
|
+
// disabled-tooltip text is mirrored into `aria-label` so the
|
|
147
|
+
// announcement carries the reason even without portal-id wiring for
|
|
148
|
+
// `aria-describedby`.
|
|
149
|
+
var isDisabledChip = mentionType === _types.MentionType.DISABLED;
|
|
150
|
+
var disabledA11yProps = isDisabledChip ? _objectSpread({
|
|
151
|
+
'aria-disabled': true
|
|
152
|
+
}, disabledTooltip ? {
|
|
153
|
+
'aria-label': "".concat(text || '@...', " \u2014 ").concat(disabledTooltip)
|
|
154
|
+
} : {}) : {};
|
|
155
|
+
var mentionComponent = /*#__PURE__*/_react.default.createElement(_focusRing.default, null, /*#__PURE__*/_react.default.createElement(_PrimitiveMention.default, (0, _extends2.default)({
|
|
130
156
|
mentionType: mentionType,
|
|
131
157
|
onClick: handleOnClick,
|
|
132
158
|
onMouseEnter: handleOnMouseEnter,
|
|
@@ -134,11 +160,28 @@ var MentionInternal = exports.MentionInternal = /*#__PURE__*/function (_React$Pu
|
|
|
134
160
|
spellCheck: false,
|
|
135
161
|
"data-testid": "mention-".concat(id),
|
|
136
162
|
"data-mention-type": mentionType,
|
|
137
|
-
"data-mention-tooltip":
|
|
138
|
-
}, failedMention ? this.renderUnknownUserError(id) : text || '@...'));
|
|
163
|
+
"data-mention-tooltip": showRestrictedTooltip || showDisabledTooltip
|
|
164
|
+
}, disabledA11yProps), failedMention ? this.renderUnknownUserError(id) : text || '@...'));
|
|
139
165
|
var ssrPlaceholderProp = props.ssrPlaceholderId ? {
|
|
140
166
|
'data-ssr-placeholder': props.ssrPlaceholderId
|
|
141
167
|
} : {};
|
|
168
|
+
var wrappedMention = function () {
|
|
169
|
+
if (showRestrictedTooltip) {
|
|
170
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Suspense, {
|
|
171
|
+
fallback: mentionComponent
|
|
172
|
+
}, /*#__PURE__*/_react.default.createElement(_NoAccessTooltip.default, {
|
|
173
|
+
name: text
|
|
174
|
+
}, mentionComponent));
|
|
175
|
+
}
|
|
176
|
+
if (showDisabledTooltip) {
|
|
177
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Suspense, {
|
|
178
|
+
fallback: mentionComponent
|
|
179
|
+
}, /*#__PURE__*/_react.default.createElement(_DisabledMentionTooltip.default, {
|
|
180
|
+
tooltip: disabledTooltip
|
|
181
|
+
}, mentionComponent));
|
|
182
|
+
}
|
|
183
|
+
return mentionComponent;
|
|
184
|
+
}();
|
|
142
185
|
return /*#__PURE__*/_react.default.createElement(_ufoExperiences.UfoErrorBoundary, {
|
|
143
186
|
id: id
|
|
144
187
|
}, /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({
|
|
@@ -147,11 +190,7 @@ var MentionInternal = exports.MentionInternal = /*#__PURE__*/function (_React$Pu
|
|
|
147
190
|
"data-local-id": localId,
|
|
148
191
|
"data-access-level": accessLevel,
|
|
149
192
|
spellCheck: false
|
|
150
|
-
}, ssrPlaceholderProp), /*#__PURE__*/_react.default.createElement(_MessagesIntlProvider.default, null,
|
|
151
|
-
fallback: mentionComponent
|
|
152
|
-
}, /*#__PURE__*/_react.default.createElement(_NoAccessTooltip.default, {
|
|
153
|
-
name: text
|
|
154
|
-
}, mentionComponent)) : mentionComponent)));
|
|
193
|
+
}, ssrPlaceholderProp), /*#__PURE__*/_react.default.createElement(_MessagesIntlProvider.default, null, wrappedMention)));
|
|
155
194
|
}
|
|
156
195
|
}]);
|
|
157
196
|
}(_react.default.PureComponent);
|
|
@@ -10,6 +10,12 @@ Object.defineProperty(exports, "MENTION_ITEM_HEIGHT", {
|
|
|
10
10
|
return _styles.MENTION_ITEM_HEIGHT;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
+
Object.defineProperty(exports, "MENTION_ITEM_HEIGHT_REFRESHED", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _styles.MENTION_ITEM_HEIGHT_REFRESHED;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
13
19
|
exports.default = exports.MentionItemWithRef = void 0;
|
|
14
20
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
21
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -119,7 +125,8 @@ var MentionItem = exports.default = /*#__PURE__*/function (_React$PureComponent)
|
|
|
119
125
|
var _this$props = this.props,
|
|
120
126
|
mention = _this$props.mention,
|
|
121
127
|
selected = _this$props.selected,
|
|
122
|
-
forwardedRef = _this$props.forwardedRef
|
|
128
|
+
forwardedRef = _this$props.forwardedRef,
|
|
129
|
+
height = _this$props.height;
|
|
123
130
|
var id = mention.id,
|
|
124
131
|
highlight = mention.highlight,
|
|
125
132
|
presence = mention.presence,
|
|
@@ -135,6 +142,7 @@ var MentionItem = exports.default = /*#__PURE__*/function (_React$PureComponent)
|
|
|
135
142
|
var xProductUserInfoIconColor = selected ? "var(--ds-icon-selected, #1868DB)" : "var(--ds-icon, #292A2E)";
|
|
136
143
|
return /*#__PURE__*/_react.default.createElement(_MessagesIntlProvider.default, null, /*#__PURE__*/_react.default.createElement(_styles.MentionItemStyle, {
|
|
137
144
|
selected: selected,
|
|
145
|
+
height: height,
|
|
138
146
|
onMouseDown: this.onMentionSelected,
|
|
139
147
|
onMouseMove: this.onMentionMenuItemMouseMove,
|
|
140
148
|
onMouseEnter: this.onMentionMenuItemMouseEnter,
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.TimeStyle = exports.RowStyle = exports.NameSectionStyle = exports.MentionItemStyle = exports.MENTION_ITEM_HEIGHT = exports.InfoSectionStyle = exports.FullNameStyle = exports.AvatarStyle = exports.AccessSectionStyle = void 0;
|
|
7
|
+
exports.TimeStyle = exports.RowStyle = exports.NameSectionStyle = exports.MentionItemStyle = exports.MENTION_ITEM_HEIGHT_REFRESHED = exports.MENTION_ITEM_HEIGHT = exports.InfoSectionStyle = exports.FullNameStyle = exports.AvatarStyle = exports.AccessSectionStyle = void 0;
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
9
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -83,15 +83,18 @@ var TimeStyle = exports.TimeStyle = _styled.default.div({
|
|
|
83
83
|
font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
|
|
84
84
|
});
|
|
85
85
|
var MENTION_ITEM_HEIGHT = exports.MENTION_ITEM_HEIGHT = 48;
|
|
86
|
+
var MENTION_ITEM_HEIGHT_REFRESHED = exports.MENTION_ITEM_HEIGHT_REFRESHED = 44;
|
|
86
87
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
87
88
|
var MentionItemStyle = exports.MentionItemStyle = _styled.default.div(function (props) {
|
|
89
|
+
var _props$height;
|
|
88
90
|
return {
|
|
89
91
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
90
92
|
backgroundColor: props.selected ? "var(--ds-background-selected, #E9F2FE)" : 'transparent',
|
|
91
93
|
display: 'block',
|
|
92
94
|
overflow: 'hidden',
|
|
93
95
|
listStyleType: 'none',
|
|
94
|
-
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
97
|
+
height: "".concat((_props$height = props.height) !== null && _props$height !== void 0 ? _props$height : MENTION_ITEM_HEIGHT, "px"),
|
|
95
98
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
96
99
|
lineHeight: 1.2,
|
|
97
100
|
cursor: 'pointer'
|
package/dist/cjs/item.js
CHANGED
|
@@ -10,6 +10,12 @@ Object.defineProperty(exports, "MENTION_ITEM_HEIGHT", {
|
|
|
10
10
|
return _MentionItem.MENTION_ITEM_HEIGHT;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
+
Object.defineProperty(exports, "MENTION_ITEM_HEIGHT_REFRESHED", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _MentionItem.MENTION_ITEM_HEIGHT_REFRESHED;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
13
19
|
Object.defineProperty(exports, "MentionItem", {
|
|
14
20
|
enumerable: true,
|
|
15
21
|
get: function get() {
|
package/dist/cjs/types.js
CHANGED
|
@@ -17,11 +17,21 @@ exports.isTeamMention = isTeamMention;
|
|
|
17
17
|
* Extends {@link ServiceConfig} which provides the base `url`, `securityProvider`,
|
|
18
18
|
* and `refreshedSecurityProvider` fields.
|
|
19
19
|
*/
|
|
20
|
+
/**
|
|
21
|
+
* Describes whether a mention should be rendered in its disabled visual
|
|
22
|
+
* state and what tooltip (if any) should be shown on hover.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The minimal input shape used by `getMentionDisabledState`. Kept as a named
|
|
26
|
+
* type so the config callback and the provider method share the same input
|
|
27
|
+
* surface, and so callers do not have to fabricate fields they do not have.
|
|
28
|
+
*/
|
|
20
29
|
// data is returned from team search service
|
|
21
30
|
var MentionType = exports.MentionType = /*#__PURE__*/function (MentionType) {
|
|
22
31
|
MentionType[MentionType["SELF"] = 0] = "SELF";
|
|
23
32
|
MentionType[MentionType["RESTRICTED"] = 1] = "RESTRICTED";
|
|
24
33
|
MentionType[MentionType["DEFAULT"] = 2] = "DEFAULT";
|
|
34
|
+
MentionType[MentionType["DISABLED"] = 3] = "DISABLED";
|
|
25
35
|
return MentionType;
|
|
26
36
|
}({});
|
|
27
37
|
var UserAccessLevel = exports.UserAccessLevel = /*#__PURE__*/function (UserAccessLevel) {
|
|
@@ -12,7 +12,7 @@ var _types = require("../types");
|
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var packageName = "@atlaskit/mention";
|
|
15
|
-
var packageVersion = "26.0
|
|
15
|
+
var packageVersion = "26.1.0";
|
|
16
16
|
var SLI_EVENT_TYPE = exports.SLI_EVENT_TYPE = 'sli';
|
|
17
17
|
var SMART_EVENT_TYPE = exports.SMART_EVENT_TYPE = 'smart';
|
|
18
18
|
var fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
|
|
@@ -20,6 +20,18 @@ export default class ContextMentionResource {
|
|
|
20
20
|
_defineProperty(this, "filter", this.callWithContextIds('filter', 1));
|
|
21
21
|
_defineProperty(this, "recordMentionSelection", this.callWithContextIds('recordMentionSelection', 1));
|
|
22
22
|
_defineProperty(this, "shouldHighlightMention", this.callDefault('shouldHighlightMention'));
|
|
23
|
+
_defineProperty(this, "getMentionDisabledState", mention => {
|
|
24
|
+
var _this$mentionProvider, _this$mentionProvider2;
|
|
25
|
+
return (_this$mentionProvider = (_this$mentionProvider2 = this.mentionProvider).getMentionDisabledState) === null || _this$mentionProvider === void 0 ? void 0 : _this$mentionProvider.call(_this$mentionProvider2, mention);
|
|
26
|
+
});
|
|
27
|
+
_defineProperty(this, "subscribeToDisabledStateChanges", listener => {
|
|
28
|
+
var _this$mentionProvider3, _this$mentionProvider4, _this$mentionProvider5;
|
|
29
|
+
return (_this$mentionProvider3 = (_this$mentionProvider4 = (_this$mentionProvider5 = this.mentionProvider).subscribeToDisabledStateChanges) === null || _this$mentionProvider4 === void 0 ? void 0 : _this$mentionProvider4.call(_this$mentionProvider5, listener)) !== null && _this$mentionProvider3 !== void 0 ? _this$mentionProvider3 : () => undefined;
|
|
30
|
+
});
|
|
31
|
+
_defineProperty(this, "notifyMentionDestroyed", mention => {
|
|
32
|
+
var _this$mentionProvider6, _this$mentionProvider7;
|
|
33
|
+
return (_this$mentionProvider6 = (_this$mentionProvider7 = this.mentionProvider).notifyMentionDestroyed) === null || _this$mentionProvider6 === void 0 ? void 0 : _this$mentionProvider6.call(_this$mentionProvider7, mention);
|
|
34
|
+
});
|
|
23
35
|
_defineProperty(this, "isFiltering", this.callDefault('isFiltering'));
|
|
24
36
|
this.mentionProvider = mentionProvider;
|
|
25
37
|
this.contextIdentifier = contextIdentifier;
|
|
@@ -156,6 +156,10 @@ export class MentionResource extends AbstractMentionResource {
|
|
|
156
156
|
}
|
|
157
157
|
return false;
|
|
158
158
|
}
|
|
159
|
+
getMentionDisabledState(mention) {
|
|
160
|
+
var _this$config$getMenti, _this$config;
|
|
161
|
+
return (_this$config$getMenti = (_this$config = this.config).getMentionDisabledState) === null || _this$config$getMenti === void 0 ? void 0 : _this$config$getMenti.call(_this$config, mention);
|
|
162
|
+
}
|
|
159
163
|
notify(searchTime, mentionResult, query) {
|
|
160
164
|
if (searchTime > this.lastReturnedSearch) {
|
|
161
165
|
this.lastReturnedSearch = searchTime;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const AsyncDisabledMentionTooltip = /*#__PURE__*/React.lazy(() => import( /* webpackChunkName: "@atlaskit-internal_@atlaskit/mention/disabled-mention-tooltip" */'./main').then(module => {
|
|
3
|
+
return {
|
|
4
|
+
default: module.DisabledMentionTooltip
|
|
5
|
+
};
|
|
6
|
+
}));
|
|
7
|
+
export default AsyncDisabledMentionTooltip;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps a disabled `<Mention>` chip with a tooltip explaining why the chip
|
|
5
|
+
* is disabled. The chip itself remains non-interactive; the tooltip is the
|
|
6
|
+
* sole hover affordance.
|
|
7
|
+
*/
|
|
8
|
+
export const DisabledMentionTooltip = ({
|
|
9
|
+
tooltip,
|
|
10
|
+
children
|
|
11
|
+
}) => /*#__PURE__*/React.createElement(Tooltip, {
|
|
12
|
+
content: tooltip,
|
|
13
|
+
position: "top"
|
|
14
|
+
}, triggerProps => /*#__PURE__*/React.createElement("span", triggerProps, children));
|
|
@@ -29,6 +29,14 @@ const mentionStyle = {
|
|
|
29
29
|
text: "var(--ds-text-subtle, #505258)",
|
|
30
30
|
hoveredBackground: "var(--ds-background-neutral-hovered, #0B120E24)",
|
|
31
31
|
pressedBackground: "var(--ds-background-neutral-pressed, #080F214A)"
|
|
32
|
+
},
|
|
33
|
+
[MentionType.DISABLED]: {
|
|
34
|
+
background: "var(--ds-background-disabled, #0515240F)",
|
|
35
|
+
borderColor: 'transparent',
|
|
36
|
+
text: "var(--ds-text-disabled, #080F214A)",
|
|
37
|
+
// Disabled chips do not change on hover / press.
|
|
38
|
+
hoveredBackground: "var(--ds-background-disabled, #0515240F)",
|
|
39
|
+
pressedBackground: "var(--ds-background-disabled, #0515240F)"
|
|
32
40
|
}
|
|
33
41
|
};
|
|
34
42
|
const getStyle = ({
|
|
@@ -5,6 +5,7 @@ import FocusRing from '@atlaskit/focus-ring';
|
|
|
5
5
|
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
6
6
|
import PrimitiveMention from './PrimitiveMention';
|
|
7
7
|
import AsyncNoAccessTooltip from '../NoAccessTooltip';
|
|
8
|
+
import AsyncDisabledMentionTooltip from '../DisabledMentionTooltip';
|
|
8
9
|
import { isRestricted, MentionType } from '../../types';
|
|
9
10
|
import { fireAnalyticsMentionEvent } from '../../util/analytics';
|
|
10
11
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
@@ -20,8 +21,13 @@ export class MentionInternal extends React.PureComponent {
|
|
|
20
21
|
const {
|
|
21
22
|
id,
|
|
22
23
|
text,
|
|
23
|
-
onClick
|
|
24
|
+
onClick,
|
|
25
|
+
isDisabled
|
|
24
26
|
} = this.props;
|
|
27
|
+
if (isDisabled) {
|
|
28
|
+
// Disabled chips do not invoke their click handler.
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
25
31
|
if (onClick) {
|
|
26
32
|
onClick(id, text, e);
|
|
27
33
|
}
|
|
@@ -59,8 +65,12 @@ export class MentionInternal extends React.PureComponent {
|
|
|
59
65
|
_defineProperty(this, "getMentionType", () => {
|
|
60
66
|
const {
|
|
61
67
|
accessLevel,
|
|
62
|
-
isHighlighted
|
|
68
|
+
isHighlighted,
|
|
69
|
+
isDisabled
|
|
63
70
|
} = this.props;
|
|
71
|
+
if (isDisabled) {
|
|
72
|
+
return MentionType.DISABLED;
|
|
73
|
+
}
|
|
64
74
|
if (isHighlighted) {
|
|
65
75
|
return MentionType.SELF;
|
|
66
76
|
}
|
|
@@ -101,12 +111,27 @@ export class MentionInternal extends React.PureComponent {
|
|
|
101
111
|
text,
|
|
102
112
|
id,
|
|
103
113
|
accessLevel,
|
|
104
|
-
localId
|
|
114
|
+
localId,
|
|
115
|
+
disabledTooltip
|
|
105
116
|
} = props;
|
|
106
117
|
const mentionType = this.getMentionType();
|
|
107
118
|
const failedMention = text === `@${UNKNOWN_USER_ID}`;
|
|
108
|
-
const
|
|
109
|
-
const
|
|
119
|
+
const showRestrictedTooltip = mentionType === MentionType.RESTRICTED;
|
|
120
|
+
const showDisabledTooltip = mentionType === MentionType.DISABLED && !!disabledTooltip;
|
|
121
|
+
|
|
122
|
+
// A11y: when the chip is in the disabled visual state, expose
|
|
123
|
+
// `aria-disabled` so assistive tech announces it as such. The
|
|
124
|
+
// disabled-tooltip text is mirrored into `aria-label` so the
|
|
125
|
+
// announcement carries the reason even without portal-id wiring for
|
|
126
|
+
// `aria-describedby`.
|
|
127
|
+
const isDisabledChip = mentionType === MentionType.DISABLED;
|
|
128
|
+
const disabledA11yProps = isDisabledChip ? {
|
|
129
|
+
'aria-disabled': true,
|
|
130
|
+
...(disabledTooltip ? {
|
|
131
|
+
'aria-label': `${text || '@...'} — ${disabledTooltip}`
|
|
132
|
+
} : {})
|
|
133
|
+
} : {};
|
|
134
|
+
const mentionComponent = /*#__PURE__*/React.createElement(FocusRing, null, /*#__PURE__*/React.createElement(PrimitiveMention, _extends({
|
|
110
135
|
mentionType: mentionType,
|
|
111
136
|
onClick: handleOnClick,
|
|
112
137
|
onMouseEnter: handleOnMouseEnter,
|
|
@@ -114,11 +139,28 @@ export class MentionInternal extends React.PureComponent {
|
|
|
114
139
|
spellCheck: false,
|
|
115
140
|
"data-testid": `mention-${id}`,
|
|
116
141
|
"data-mention-type": mentionType,
|
|
117
|
-
"data-mention-tooltip":
|
|
118
|
-
}, failedMention ? this.renderUnknownUserError(id) : text || '@...'));
|
|
142
|
+
"data-mention-tooltip": showRestrictedTooltip || showDisabledTooltip
|
|
143
|
+
}, disabledA11yProps), failedMention ? this.renderUnknownUserError(id) : text || '@...'));
|
|
119
144
|
const ssrPlaceholderProp = props.ssrPlaceholderId ? {
|
|
120
145
|
'data-ssr-placeholder': props.ssrPlaceholderId
|
|
121
146
|
} : {};
|
|
147
|
+
const wrappedMention = (() => {
|
|
148
|
+
if (showRestrictedTooltip) {
|
|
149
|
+
return /*#__PURE__*/React.createElement(React.Suspense, {
|
|
150
|
+
fallback: mentionComponent
|
|
151
|
+
}, /*#__PURE__*/React.createElement(AsyncNoAccessTooltip, {
|
|
152
|
+
name: text
|
|
153
|
+
}, mentionComponent));
|
|
154
|
+
}
|
|
155
|
+
if (showDisabledTooltip) {
|
|
156
|
+
return /*#__PURE__*/React.createElement(React.Suspense, {
|
|
157
|
+
fallback: mentionComponent
|
|
158
|
+
}, /*#__PURE__*/React.createElement(AsyncDisabledMentionTooltip, {
|
|
159
|
+
tooltip: disabledTooltip
|
|
160
|
+
}, mentionComponent));
|
|
161
|
+
}
|
|
162
|
+
return mentionComponent;
|
|
163
|
+
})();
|
|
122
164
|
return /*#__PURE__*/React.createElement(UfoErrorBoundary, {
|
|
123
165
|
id: id
|
|
124
166
|
}, /*#__PURE__*/React.createElement("span", _extends({
|
|
@@ -127,11 +169,7 @@ export class MentionInternal extends React.PureComponent {
|
|
|
127
169
|
"data-local-id": localId,
|
|
128
170
|
"data-access-level": accessLevel,
|
|
129
171
|
spellCheck: false
|
|
130
|
-
}, ssrPlaceholderProp), /*#__PURE__*/React.createElement(MessagesIntlProvider, null,
|
|
131
|
-
fallback: mentionComponent
|
|
132
|
-
}, /*#__PURE__*/React.createElement(AsyncNoAccessTooltip, {
|
|
133
|
-
name: text
|
|
134
|
-
}, mentionComponent)) : mentionComponent)));
|
|
172
|
+
}, ssrPlaceholderProp), /*#__PURE__*/React.createElement(MessagesIntlProvider, null, wrappedMention)));
|
|
135
173
|
}
|
|
136
174
|
}
|
|
137
175
|
const MentionWithAnalytics = withAnalyticsEvents({
|
|
@@ -15,7 +15,7 @@ import { renderHighlight } from './MentionHighlightHelpers';
|
|
|
15
15
|
import MentionDescriptionByline from '../MentionDescriptionByline';
|
|
16
16
|
import MessagesIntlProvider from '../MessagesIntlProvider';
|
|
17
17
|
import { MentionAvatar } from '../MentionAvatar';
|
|
18
|
-
export { MENTION_ITEM_HEIGHT } from './styles';
|
|
18
|
+
export { MENTION_ITEM_HEIGHT, MENTION_ITEM_HEIGHT_REFRESHED } from './styles';
|
|
19
19
|
const lozengeAppearanceToTagColor = {
|
|
20
20
|
default: 'standard',
|
|
21
21
|
success: 'lime',
|
|
@@ -94,7 +94,8 @@ export default class MentionItem extends React.PureComponent {
|
|
|
94
94
|
const {
|
|
95
95
|
mention,
|
|
96
96
|
selected,
|
|
97
|
-
forwardedRef
|
|
97
|
+
forwardedRef,
|
|
98
|
+
height
|
|
98
99
|
} = this.props;
|
|
99
100
|
const {
|
|
100
101
|
id,
|
|
@@ -114,6 +115,7 @@ export default class MentionItem extends React.PureComponent {
|
|
|
114
115
|
const xProductUserInfoIconColor = selected ? "var(--ds-icon-selected, #1868DB)" : "var(--ds-icon, #292A2E)";
|
|
115
116
|
return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement(MentionItemStyle, {
|
|
116
117
|
selected: selected,
|
|
118
|
+
height: height,
|
|
117
119
|
onMouseDown: this.onMentionSelected,
|
|
118
120
|
onMouseMove: this.onMentionMenuItemMouseMove,
|
|
119
121
|
onMouseEnter: this.onMentionMenuItemMouseEnter,
|