@atlaskit/editor-plugin-mentions 2.6.7 → 2.7.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,27 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 2.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#149581](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/149581)
8
+ [`e98d687b864ab`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e98d687b864ab) -
9
+ [ED-23460] Track when mention providers are undefined
10
+ - Updated dependencies
11
+
12
+ ## 2.7.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#148601](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/148601)
17
+ [`e11f6a141cfe5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e11f6a141cfe5) -
18
+ [ED-23460] **@atlaskit/editor-plugin-mentions**: Track when mention providers fail to resolve
19
+ **@atlaskit/editor-common**: Add enums for mention provider reporting
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 2.6.7
4
26
 
5
27
  ### Patch Changes
@@ -6,12 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.createMentionPlugin = createMentionPlugin;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _analytics = require("@atlaskit/editor-common/analytics");
9
10
  var _reactNodeView = require("@atlaskit/editor-common/react-node-view");
10
11
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
11
12
  var _utils = require("@atlaskit/editor-prosemirror/utils");
12
13
  var _resource = require("@atlaskit/mention/resource");
13
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _mention = require("../nodeviews/mention");
16
+ var _types = require("../types");
15
17
  var _key = require("./key");
16
18
  var _utils2 = require("./utils");
17
19
  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; }
@@ -95,6 +97,15 @@ function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
95
97
  switch (name) {
96
98
  case 'mentionProvider':
97
99
  if (!providerPromise) {
100
+ fireEvent({
101
+ action: _analytics.ACTION.ERRORED,
102
+ actionSubject: _analytics.ACTION_SUBJECT.MENTION,
103
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.MENTION_PROVIDER,
104
+ eventType: _analytics.EVENT_TYPE.OPERATIONAL,
105
+ attributes: {
106
+ reason: _types.MENTION_PROVIDER_UNDEFINED
107
+ }
108
+ });
98
109
  return setProvider(undefined)(editorView.state, editorView.dispatch);
99
110
  }
100
111
  providerPromise.then(function (provider) {
@@ -105,6 +116,15 @@ function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
105
116
  setProvider(provider)(editorView.state, editorView.dispatch);
106
117
  provider.subscribe('mentionPlugin', undefined, undefined, undefined, undefined, sendAnalytics);
107
118
  }).catch(function () {
119
+ fireEvent({
120
+ action: _analytics.ACTION.ERRORED,
121
+ actionSubject: _analytics.ACTION_SUBJECT.MENTION,
122
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.MENTION_PROVIDER,
123
+ eventType: _analytics.EVENT_TYPE.OPERATIONAL,
124
+ attributes: {
125
+ reason: _types.MENTION_PROVIDER_REJECTED
126
+ }
127
+ });
108
128
  return setProvider(undefined)(editorView.state, editorView.dispatch);
109
129
  });
110
130
  break;
package/dist/cjs/types.js CHANGED
@@ -2,4 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
5
+ });
6
+ exports.MENTION_PROVIDER_UNDEFINED = exports.MENTION_PROVIDER_REJECTED = void 0;
7
+ var MENTION_PROVIDER_REJECTED = exports.MENTION_PROVIDER_REJECTED = 'REJECTED';
8
+ var MENTION_PROVIDER_UNDEFINED = exports.MENTION_PROVIDER_UNDEFINED = 'UNDEFINED';
@@ -1,9 +1,11 @@
1
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
1
2
  import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
2
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
4
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
4
5
  import { buildSliPayload, SLI_EVENT_TYPE, SMART_EVENT_TYPE } from '@atlaskit/mention/resource';
5
6
  import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { MentionNodeView } from '../nodeviews/mention';
8
+ import { MENTION_PROVIDER_REJECTED, MENTION_PROVIDER_UNDEFINED } from '../types';
7
9
  import { mentionPluginKey } from './key';
8
10
  import { canMentionBeCreatedInRange } from './utils';
9
11
  const ACTIONS = {
@@ -86,6 +88,15 @@ export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
86
88
  switch (name) {
87
89
  case 'mentionProvider':
88
90
  if (!providerPromise) {
91
+ fireEvent({
92
+ action: ACTION.ERRORED,
93
+ actionSubject: ACTION_SUBJECT.MENTION,
94
+ actionSubjectId: ACTION_SUBJECT_ID.MENTION_PROVIDER,
95
+ eventType: EVENT_TYPE.OPERATIONAL,
96
+ attributes: {
97
+ reason: MENTION_PROVIDER_UNDEFINED
98
+ }
99
+ });
89
100
  return setProvider(undefined)(editorView.state, editorView.dispatch);
90
101
  }
91
102
  providerPromise.then(provider => {
@@ -95,7 +106,18 @@ export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
95
106
  mentionProvider = provider;
96
107
  setProvider(provider)(editorView.state, editorView.dispatch);
97
108
  provider.subscribe('mentionPlugin', undefined, undefined, undefined, undefined, sendAnalytics);
98
- }).catch(() => setProvider(undefined)(editorView.state, editorView.dispatch));
109
+ }).catch(() => {
110
+ fireEvent({
111
+ action: ACTION.ERRORED,
112
+ actionSubject: ACTION_SUBJECT.MENTION,
113
+ actionSubjectId: ACTION_SUBJECT_ID.MENTION_PROVIDER,
114
+ eventType: EVENT_TYPE.OPERATIONAL,
115
+ attributes: {
116
+ reason: MENTION_PROVIDER_REJECTED
117
+ }
118
+ });
119
+ return setProvider(undefined)(editorView.state, editorView.dispatch);
120
+ });
99
121
  break;
100
122
  }
101
123
  return;
@@ -1 +1,2 @@
1
- export {};
1
+ export const MENTION_PROVIDER_REJECTED = 'REJECTED';
2
+ export const MENTION_PROVIDER_UNDEFINED = 'UNDEFINED';
@@ -1,12 +1,14 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  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) { _defineProperty(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; }
4
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
4
5
  import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
5
6
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
7
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
7
8
  import { buildSliPayload, SLI_EVENT_TYPE, SMART_EVENT_TYPE } from '@atlaskit/mention/resource';
8
9
  import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { MentionNodeView } from '../nodeviews/mention';
11
+ import { MENTION_PROVIDER_REJECTED, MENTION_PROVIDER_UNDEFINED } from '../types';
10
12
  import { mentionPluginKey } from './key';
11
13
  import { canMentionBeCreatedInRange } from './utils';
12
14
  var ACTIONS = {
@@ -88,6 +90,15 @@ export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
88
90
  switch (name) {
89
91
  case 'mentionProvider':
90
92
  if (!providerPromise) {
93
+ fireEvent({
94
+ action: ACTION.ERRORED,
95
+ actionSubject: ACTION_SUBJECT.MENTION,
96
+ actionSubjectId: ACTION_SUBJECT_ID.MENTION_PROVIDER,
97
+ eventType: EVENT_TYPE.OPERATIONAL,
98
+ attributes: {
99
+ reason: MENTION_PROVIDER_UNDEFINED
100
+ }
101
+ });
91
102
  return setProvider(undefined)(editorView.state, editorView.dispatch);
92
103
  }
93
104
  providerPromise.then(function (provider) {
@@ -98,6 +109,15 @@ export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
98
109
  setProvider(provider)(editorView.state, editorView.dispatch);
99
110
  provider.subscribe('mentionPlugin', undefined, undefined, undefined, undefined, sendAnalytics);
100
111
  }).catch(function () {
112
+ fireEvent({
113
+ action: ACTION.ERRORED,
114
+ actionSubject: ACTION_SUBJECT.MENTION,
115
+ actionSubjectId: ACTION_SUBJECT_ID.MENTION_PROVIDER,
116
+ eventType: EVENT_TYPE.OPERATIONAL,
117
+ attributes: {
118
+ reason: MENTION_PROVIDER_REJECTED
119
+ }
120
+ });
101
121
  return setProvider(undefined)(editorView.state, editorView.dispatch);
102
122
  });
103
123
  break;
package/dist/esm/types.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ export var MENTION_PROVIDER_REJECTED = 'REJECTED';
2
+ export var MENTION_PROVIDER_UNDEFINED = 'UNDEFINED';
@@ -1,5 +1,5 @@
1
1
  import type { GasPayload } from '@atlaskit/analytics-gas-types';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
4
- import type { MentionPluginOptions, MentionPluginState } from '../types';
4
+ import { type MentionPluginOptions, type MentionPluginState } from '../types';
5
5
  export declare function createMentionPlugin(pmPluginFactoryParams: PMPluginFactoryParams, fireEvent: (payload: GasPayload) => void, options?: MentionPluginOptions): SafePlugin<MentionPluginState>;
@@ -6,6 +6,8 @@ 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';
8
8
  import type { MentionDescription, MentionProvider } from '@atlaskit/mention';
9
+ export declare const MENTION_PROVIDER_REJECTED = "REJECTED";
10
+ export declare const MENTION_PROVIDER_UNDEFINED = "UNDEFINED";
9
11
  export interface TeamInfoAttrAnalytics {
10
12
  teamId: string;
11
13
  includesYou: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { GasPayload } from '@atlaskit/analytics-gas-types';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
4
- import type { MentionPluginOptions, MentionPluginState } from '../types';
4
+ import { type MentionPluginOptions, type MentionPluginState } from '../types';
5
5
  export declare function createMentionPlugin(pmPluginFactoryParams: PMPluginFactoryParams, fireEvent: (payload: GasPayload) => void, options?: MentionPluginOptions): SafePlugin<MentionPluginState>;
@@ -6,6 +6,8 @@ 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';
8
8
  import type { MentionDescription, MentionProvider } from '@atlaskit/mention';
9
+ export declare const MENTION_PROVIDER_REJECTED = "REJECTED";
10
+ export declare const MENTION_PROVIDER_UNDEFINED = "UNDEFINED";
9
11
  export interface TeamInfoAttrAnalytics {
10
12
  teamId: string;
11
13
  includesYou: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "2.6.7",
3
+ "version": "2.7.1",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,12 +33,12 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^40.9.0",
35
35
  "@atlaskit/analytics-gas-types": "^5.1.0",
36
- "@atlaskit/editor-common": "^93.0.0",
36
+ "@atlaskit/editor-common": "^93.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
38
38
  "@atlaskit/editor-plugin-context-identifier": "^1.3.0",
39
39
  "@atlaskit/editor-plugin-type-ahead": "^1.8.0",
40
40
  "@atlaskit/editor-prosemirror": "6.0.0",
41
- "@atlaskit/icon": "^22.20.0",
41
+ "@atlaskit/icon": "^22.21.0",
42
42
  "@atlaskit/mention": "^23.3.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
44
  "@atlaskit/theme": "^13.0.0",