@atlaskit/editor-common 116.30.4 → 116.31.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,36 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 116.31.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2aa9853a2c07d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2aa9853a2c07d) -
8
+ `ResourcedMention` and the editor-common `Mention` now accept an `isDisabled` (and
9
+ `disabledTooltip`) prop, forwarding the disabled mention visual state through the layered mention
10
+ components. A disabled mention bypasses the profile-card wrapper as it is non-interactive, while
11
+ retaining a readable neutral visual treatment so meaningful mention text remains perceivable.
12
+
13
+ Example usage:
14
+
15
+ ```tsx
16
+ <Mention
17
+ id="agent-2"
18
+ text="@Researcher"
19
+ isDisabled
20
+ disabledTooltip="Only one agent can be active at a time"
21
+ />
22
+ ```
23
+
24
+ Used in Rovo chat to grey out inactive (non-responding) agent @mentions in sent user messages: the
25
+ agent that responded to the turn stays fully styled while other mentioned agents render disabled.
26
+
27
+ - [`f4cf0276c2938`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f4cf0276c2938) -
28
+ Add metric attributes for tracking agent inclusion and selection from the mention picker
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies
33
+
3
34
  ## 116.30.4
4
35
 
5
36
  ### Patch Changes
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
28
28
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
29
29
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
30
30
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
31
- var packageVersion = "116.30.3";
31
+ var packageVersion = "116.30.4";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "116.30.3";
27
+ var packageVersion = "116.30.4";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -32,7 +32,9 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
32
32
  id = _this$props.id,
33
33
  text = _this$props.text,
34
34
  localId = _this$props.localId,
35
- userType = _this$props.userType;
35
+ userType = _this$props.userType,
36
+ isDisabled = _this$props.isDisabled,
37
+ disabledTooltip = _this$props.disabledTooltip;
36
38
  var mentionProvider = providers.mentionProvider,
37
39
  profilecardProvider = providers.profilecardProvider;
38
40
  return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProviders, {
@@ -41,6 +43,8 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
41
43
  accessLevel: accessLevel,
42
44
  localId: localId,
43
45
  userType: userType,
46
+ isDisabled: isDisabled,
47
+ disabledTooltip: disabledTooltip,
44
48
  eventHandlers: eventHandlers,
45
49
  mentionProvider: mentionProvider,
46
50
  profilecardProvider: profilecardProvider
@@ -14,8 +14,10 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
14
14
  var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
15
15
  var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.default.memo(function (_ref) {
16
16
  var accessLevel = _ref.accessLevel,
17
+ disabledTooltip = _ref.disabledTooltip,
17
18
  eventHandlers = _ref.eventHandlers,
18
19
  id = _ref.id,
20
+ isDisabled = _ref.isDisabled,
19
21
  mentionProvider = _ref.mentionProvider,
20
22
  profilecardProviderResolver = _ref.profilecardProvider,
21
23
  text = _ref.text,
@@ -49,6 +51,24 @@ var MentionWithProviders = exports.MentionWithProviders = /*#__PURE__*/_react.de
49
51
  }, [profilecardProviderResolver]);
50
52
  var MentionComponent = profilecardProvider && profilecardProviderResolver && GENERIC_USER_IDS.indexOf(id) === -1 ? _mentionWithProfilecard.default : _element.ResourcedMention;
51
53
  var ssrPlaceholderId = "mention-".concat(id);
54
+
55
+ // A disabled mention is non-interactive, so it bypasses the profile-card
56
+ // wrapper and renders the disabled resourced mention directly.
57
+ if (isDisabled) {
58
+ return /*#__PURE__*/_react.default.createElement(_element.ResourcedMention, {
59
+ id: id,
60
+ text: text,
61
+ accessLevel: accessLevel,
62
+ localId: localId,
63
+ mentionProvider: mentionProvider,
64
+ isDisabled: true,
65
+ disabledTooltip: disabledTooltip,
66
+ onClick: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick,
67
+ onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
68
+ onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
69
+ ssrPlaceholderId: ssrPlaceholderId
70
+ });
71
+ }
52
72
  return /*#__PURE__*/_react.default.createElement(MentionComponent, {
53
73
  id: id,
54
74
  text: text,
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
14
14
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
15
15
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
16
16
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
17
- const packageVersion = "116.30.3";
17
+ const packageVersion = "116.30.4";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "116.30.3";
17
+ const packageVersion = "116.30.4";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -15,7 +15,9 @@ export default class Mention extends PureComponent {
15
15
  id,
16
16
  text,
17
17
  localId,
18
- userType
18
+ userType,
19
+ isDisabled,
20
+ disabledTooltip
19
21
  } = this.props;
20
22
  const {
21
23
  mentionProvider,
@@ -27,6 +29,8 @@ export default class Mention extends PureComponent {
27
29
  accessLevel: accessLevel,
28
30
  localId: localId,
29
31
  userType: userType,
32
+ isDisabled: isDisabled,
33
+ disabledTooltip: disabledTooltip,
30
34
  eventHandlers: eventHandlers,
31
35
  mentionProvider: mentionProvider,
32
36
  profilecardProvider: profilecardProvider
@@ -4,8 +4,10 @@ import ResourcedMentionWithProfilecard from './mention-with-profilecard';
4
4
  const GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
5
5
  export const MentionWithProviders = /*#__PURE__*/React.memo(({
6
6
  accessLevel,
7
+ disabledTooltip,
7
8
  eventHandlers,
8
9
  id,
10
+ isDisabled,
9
11
  mentionProvider,
10
12
  profilecardProvider: profilecardProviderResolver,
11
13
  text,
@@ -37,6 +39,24 @@ export const MentionWithProviders = /*#__PURE__*/React.memo(({
37
39
  }, [profilecardProviderResolver]);
38
40
  const MentionComponent = profilecardProvider && profilecardProviderResolver && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
39
41
  const ssrPlaceholderId = `mention-${id}`;
42
+
43
+ // A disabled mention is non-interactive, so it bypasses the profile-card
44
+ // wrapper and renders the disabled resourced mention directly.
45
+ if (isDisabled) {
46
+ return /*#__PURE__*/React.createElement(ResourcedMention, {
47
+ id: id,
48
+ text: text,
49
+ accessLevel: accessLevel,
50
+ localId: localId,
51
+ mentionProvider: mentionProvider,
52
+ isDisabled: true,
53
+ disabledTooltip: disabledTooltip,
54
+ onClick: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick,
55
+ onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
56
+ onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
57
+ ssrPlaceholderId: ssrPlaceholderId
58
+ });
59
+ }
40
60
  return /*#__PURE__*/React.createElement(MentionComponent, {
41
61
  id: id,
42
62
  text: text,
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
20
20
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
21
21
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
22
22
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
23
- var packageVersion = "116.30.3";
23
+ var packageVersion = "116.30.4";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "116.30.3";
24
+ var packageVersion = "116.30.4";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -24,7 +24,9 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
24
24
  id = _this$props.id,
25
25
  text = _this$props.text,
26
26
  localId = _this$props.localId,
27
- userType = _this$props.userType;
27
+ userType = _this$props.userType,
28
+ isDisabled = _this$props.isDisabled,
29
+ disabledTooltip = _this$props.disabledTooltip;
28
30
  var mentionProvider = providers.mentionProvider,
29
31
  profilecardProvider = providers.profilecardProvider;
30
32
  return /*#__PURE__*/React.createElement(MentionWithProviders, {
@@ -33,6 +35,8 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
33
35
  accessLevel: accessLevel,
34
36
  localId: localId,
35
37
  userType: userType,
38
+ isDisabled: isDisabled,
39
+ disabledTooltip: disabledTooltip,
36
40
  eventHandlers: eventHandlers,
37
41
  mentionProvider: mentionProvider,
38
42
  profilecardProvider: profilecardProvider
@@ -5,8 +5,10 @@ import ResourcedMentionWithProfilecard from './mention-with-profilecard';
5
5
  var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
6
6
  export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref) {
7
7
  var accessLevel = _ref.accessLevel,
8
+ disabledTooltip = _ref.disabledTooltip,
8
9
  eventHandlers = _ref.eventHandlers,
9
10
  id = _ref.id,
11
+ isDisabled = _ref.isDisabled,
10
12
  mentionProvider = _ref.mentionProvider,
11
13
  profilecardProviderResolver = _ref.profilecardProvider,
12
14
  text = _ref.text,
@@ -40,6 +42,24 @@ export var MentionWithProviders = /*#__PURE__*/React.memo(function (_ref) {
40
42
  }, [profilecardProviderResolver]);
41
43
  var MentionComponent = profilecardProvider && profilecardProviderResolver && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
42
44
  var ssrPlaceholderId = "mention-".concat(id);
45
+
46
+ // A disabled mention is non-interactive, so it bypasses the profile-card
47
+ // wrapper and renders the disabled resourced mention directly.
48
+ if (isDisabled) {
49
+ return /*#__PURE__*/React.createElement(ResourcedMention, {
50
+ id: id,
51
+ text: text,
52
+ accessLevel: accessLevel,
53
+ localId: localId,
54
+ mentionProvider: mentionProvider,
55
+ isDisabled: true,
56
+ disabledTooltip: disabledTooltip,
57
+ onClick: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick,
58
+ onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
59
+ onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave,
60
+ ssrPlaceholderId: ssrPlaceholderId
61
+ });
62
+ }
43
63
  return /*#__PURE__*/React.createElement(MentionComponent, {
44
64
  id: id,
45
65
  text: text,
@@ -37,6 +37,7 @@ type MentionTypeaheadInviteItemClickedPayload = UIAEP<ACTION.CLICKED | ACTION.PR
37
37
  }, undefined>;
38
38
  type MentionTypeaheadInsertedPayload = UIAEP<ACTION.CLICKED | ACTION.PRESSED, ACTION_SUBJECT.MENTION_TYPEAHEAD, undefined, {
39
39
  accessLevel: string;
40
+ agentSectioningEnabled?: boolean;
40
41
  childObjectId?: string;
41
42
  containerId?: string;
42
43
  downKeyCount: number;
@@ -60,6 +61,9 @@ type MentionTypeaheadInsertedPayload = UIAEP<ACTION.CLICKED | ACTION.PRESSED, AC
60
61
  userType?: string;
61
62
  }, undefined, string | undefined, string | undefined, string | undefined>;
62
63
  type MentionTypeaheadRenderedPayload = OperationalAEP<ACTION.RENDERED, ACTION_SUBJECT.MENTION_TYPEAHEAD | ACTION_SUBJECT.TEAM_MENTION_TYPEAHEAD, undefined, {
64
+ agentCount?: number;
65
+ agentSectioningEnabled?: boolean;
66
+ agentsShown?: boolean;
63
67
  componentName: string;
64
68
  duration: number;
65
69
  queryLength?: number;
@@ -5,8 +5,10 @@ import type { ProfilecardProvider } from '../../provider-factory/profile-card-pr
5
5
  import type { MentionEventHandlers } from '../EventHandlers';
6
6
  export interface MentionProps {
7
7
  accessLevel?: string;
8
+ disabledTooltip?: string;
8
9
  eventHandlers?: MentionEventHandlers;
9
10
  id: string;
11
+ isDisabled?: boolean;
10
12
  localId?: string;
11
13
  providers?: ProviderFactory;
12
14
  text: string;
@@ -5,8 +5,10 @@ import type { ProfilecardProvider } from '../../provider-factory/profile-card-pr
5
5
  import type { MentionEventHandlers } from '../EventHandlers';
6
6
  export interface Props {
7
7
  accessLevel?: string;
8
+ disabledTooltip?: string;
8
9
  eventHandlers?: MentionEventHandlers;
9
10
  id: string;
11
+ isDisabled?: boolean;
10
12
  localId?: string;
11
13
  mentionProvider?: Promise<MentionProvider>;
12
14
  profilecardProvider?: Promise<ProfilecardProvider>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "116.30.4",
3
+ "version": "116.31.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/media-picker": "^72.1.0",
63
63
  "@atlaskit/media-ui": "^30.7.0",
64
64
  "@atlaskit/media-viewer": "^54.5.0",
65
- "@atlaskit/mention": "^27.5.0",
65
+ "@atlaskit/mention": "^27.6.0",
66
66
  "@atlaskit/menu": "^9.2.0",
67
67
  "@atlaskit/object": "^2.2.0",
68
68
  "@atlaskit/onboarding": "^15.1.0",
@@ -80,7 +80,7 @@
80
80
  "@atlaskit/task-decision": "^21.4.0",
81
81
  "@atlaskit/teams-app-config": "^2.1.0",
82
82
  "@atlaskit/textfield": "^9.1.0",
83
- "@atlaskit/tmp-editor-statsig": "^126.0.0",
83
+ "@atlaskit/tmp-editor-statsig": "^126.1.0",
84
84
  "@atlaskit/tokens": "^15.8.0",
85
85
  "@atlaskit/tooltip": "^23.1.0",
86
86
  "@atlaskit/width-detector": "^6.2.0",