@atlaskit/editor-common 95.1.1 → 95.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 95.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#166957](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/166957)
8
+ [`32cc3cebd2ed7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32cc3cebd2ed7) -
9
+ ED-25632 Ensure table nesting transform errors are logged to analytics. This includes an upgrade
10
+ to core-plugin to allow it to receive an anaylytics callback.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 95.1.1
4
17
 
5
18
  ### Patch Changes
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "95.1.1";
20
+ var packageVersion = "95.2.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -49,7 +49,7 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
49
49
  requestDocument: function requestDocument(onReceive, options) {
50
50
  var _config$getEditorView;
51
51
  var view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
52
- (0, _requestDocument.scheduleDocumentRequest)(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer);
52
+ (0, _requestDocument.scheduleDocumentRequest)(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent);
53
53
  },
54
54
  createTransformer: function createTransformer(cb) {
55
55
  var _config$getEditorView2;
@@ -9,6 +9,7 @@ exports.toJSON = toJSON;
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
11
11
  var _model = require("@atlaskit/editor-prosemirror/model");
12
+ var _analytics = require("../../analytics");
12
13
  var transformer = new _editorJsonTransformer.JSONTransformer();
13
14
  function toJSON(node) {
14
15
  return transformer.encode(node);
@@ -44,7 +45,7 @@ function createThrottleSchedule(callback) {
44
45
  return wrapperFn;
45
46
  }
46
47
  var scheduleDocumentRequest = exports.scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
47
- function returnDocumentRequest(editorView, callback, transformer) {
48
+ function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
48
49
  var _editorView$state;
49
50
  var _ref = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {},
50
51
  doc = _ref.doc,
@@ -52,11 +53,25 @@ function returnDocumentRequest(editorView, callback, transformer) {
52
53
  if (!doc || !schema) {
53
54
  return undefined;
54
55
  }
55
- var json = toJSON(doc);
56
- if (typeof transformer === 'undefined') {
57
- callback(json);
58
- } else {
59
- var nodeSanitized = _model.Node.fromJSON(schema, json);
60
- callback(transformer.encode(nodeSanitized));
56
+ try {
57
+ var json = toJSON(doc);
58
+ if (typeof transformer === 'undefined') {
59
+ callback(json);
60
+ } else {
61
+ var nodeSanitized = _model.Node.fromJSON(schema, json);
62
+ callback(transformer.encode(nodeSanitized));
63
+ }
64
+ } catch (e) {
65
+ fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
66
+ payload: {
67
+ action: _analytics.ACTION.DOCUMENT_PROCESSING_ERROR,
68
+ actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
69
+ eventType: _analytics.EVENT_TYPE.OPERATIONAL,
70
+ attributes: {
71
+ errorMessage: "".concat(e instanceof Error && e.name === 'NodeNestingTransformError' ? 'NodeNestingTransformError - Failed to transform one or more nested tables' : undefined)
72
+ }
73
+ }
74
+ });
75
+ throw e;
61
76
  }
62
77
  }
@@ -244,7 +244,8 @@ var EditorPluginInjectionAPI = exports.EditorPluginInjectionAPI = /*#__PURE__*/f
244
244
  function EditorPluginInjectionAPI(_ref6) {
245
245
  var _this2 = this;
246
246
  var getEditorState = _ref6.getEditorState,
247
- getEditorView = _ref6.getEditorView;
247
+ getEditorView = _ref6.getEditorView,
248
+ fireAnalyticsEvent = _ref6.fireAnalyticsEvent;
248
249
  (0, _classCallCheck2.default)(this, EditorPluginInjectionAPI);
249
250
  (0, _defineProperty2.default)(this, "onEditorViewUpdated", function (_ref7) {
250
251
  var newEditorState = _ref7.newEditorState,
@@ -280,7 +281,8 @@ var EditorPluginInjectionAPI = exports.EditorPluginInjectionAPI = /*#__PURE__*/f
280
281
  // Special core plugin that is always added
281
282
  this.addPlugin((0, _corePlugin.corePlugin)({
282
283
  config: {
283
- getEditorView: getEditorView
284
+ getEditorView: getEditorView,
285
+ fireAnalyticsEvent: fireAnalyticsEvent
284
286
  }
285
287
  }));
286
288
  }
@@ -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 = "95.1.1";
27
+ var packageVersion = "95.2.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -38,7 +38,7 @@ var transformNestedTablesWithAnalytics = function transformNestedTablesWithAnaly
38
38
  actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
39
39
  eventType: _analytics.EVENT_TYPE.OPERATIONAL,
40
40
  attributes: {
41
- errorMessage: 'Failed to transform one or more nested tables in the document'
41
+ errorMessage: "".concat(e instanceof Error && e.name === 'NodeNestingTransformError' ? 'NodeNestingTransformError - Failed to transform one or more nested tables' : undefined)
42
42
  }
43
43
  });
44
44
  }
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "95.1.1";
4
+ const packageVersion = "95.2.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -47,7 +47,7 @@ export const corePlugin = ({
47
47
  requestDocument(onReceive, options) {
48
48
  var _config$getEditorView;
49
49
  const view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
50
- scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer);
50
+ scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent);
51
51
  },
52
52
  createTransformer(cb) {
53
53
  var _config$getEditorView2;
@@ -1,5 +1,6 @@
1
1
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
2
2
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics';
3
4
  const transformer = new JSONTransformer();
4
5
  export function toJSON(node) {
5
6
  return transformer.encode(node);
@@ -32,7 +33,7 @@ function createThrottleSchedule(callback) {
32
33
  return wrapperFn;
33
34
  }
34
35
  export const scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
35
- function returnDocumentRequest(editorView, callback, transformer) {
36
+ function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
36
37
  var _editorView$state;
37
38
  const {
38
39
  doc,
@@ -41,11 +42,25 @@ function returnDocumentRequest(editorView, callback, transformer) {
41
42
  if (!doc || !schema) {
42
43
  return undefined;
43
44
  }
44
- const json = toJSON(doc);
45
- if (typeof transformer === 'undefined') {
46
- callback(json);
47
- } else {
48
- const nodeSanitized = PMNode.fromJSON(schema, json);
49
- callback(transformer.encode(nodeSanitized));
45
+ try {
46
+ const json = toJSON(doc);
47
+ if (typeof transformer === 'undefined') {
48
+ callback(json);
49
+ } else {
50
+ const nodeSanitized = PMNode.fromJSON(schema, json);
51
+ callback(transformer.encode(nodeSanitized));
52
+ }
53
+ } catch (e) {
54
+ fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 ? void 0 : fireAnalyticsEvent({
55
+ payload: {
56
+ action: ACTION.DOCUMENT_PROCESSING_ERROR,
57
+ actionSubject: ACTION_SUBJECT.EDITOR,
58
+ eventType: EVENT_TYPE.OPERATIONAL,
59
+ attributes: {
60
+ errorMessage: `${e instanceof Error && e.name === 'NodeNestingTransformError' ? 'NodeNestingTransformError - Failed to transform one or more nested tables' : undefined}`
61
+ }
62
+ }
63
+ });
64
+ throw e;
50
65
  }
51
66
  }
@@ -163,7 +163,8 @@ const editorAPICache = new WeakMap();
163
163
  export class EditorPluginInjectionAPI {
164
164
  constructor({
165
165
  getEditorState,
166
- getEditorView
166
+ getEditorView,
167
+ fireAnalyticsEvent
167
168
  }) {
168
169
  _defineProperty(this, "onEditorViewUpdated", ({
169
170
  newEditorState,
@@ -201,7 +202,8 @@ export class EditorPluginInjectionAPI {
201
202
  // Special core plugin that is always added
202
203
  this.addPlugin(corePlugin({
203
204
  config: {
204
- getEditorView
205
+ getEditorView,
206
+ fireAnalyticsEvent
205
207
  }
206
208
  }));
207
209
  }
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "95.1.1";
16
+ const packageVersion = "95.2.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  class DropList extends Component {
@@ -31,7 +31,7 @@ const transformNestedTablesWithAnalytics = (node, dispatchAnalyticsEvent) => {
31
31
  actionSubject: ACTION_SUBJECT.EDITOR,
32
32
  eventType: EVENT_TYPE.OPERATIONAL,
33
33
  attributes: {
34
- errorMessage: 'Failed to transform one or more nested tables in the document'
34
+ errorMessage: `${e instanceof Error && e.name === 'NodeNestingTransformError' ? 'NodeNestingTransformError - Failed to transform one or more nested tables' : undefined}`
35
35
  }
36
36
  });
37
37
  }
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "95.1.1";
10
+ var packageVersion = "95.2.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -44,7 +44,7 @@ export var corePlugin = function corePlugin(_ref) {
44
44
  requestDocument: function requestDocument(onReceive, options) {
45
45
  var _config$getEditorView;
46
46
  var view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
47
- scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer);
47
+ scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent);
48
48
  },
49
49
  createTransformer: function createTransformer(cb) {
50
50
  var _config$getEditorView2;
@@ -1,6 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
3
3
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics';
4
5
  var transformer = new JSONTransformer();
5
6
  export function toJSON(node) {
6
7
  return transformer.encode(node);
@@ -36,7 +37,7 @@ function createThrottleSchedule(callback) {
36
37
  return wrapperFn;
37
38
  }
38
39
  export var scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
39
- function returnDocumentRequest(editorView, callback, transformer) {
40
+ function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
40
41
  var _editorView$state;
41
42
  var _ref = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {},
42
43
  doc = _ref.doc,
@@ -44,11 +45,25 @@ function returnDocumentRequest(editorView, callback, transformer) {
44
45
  if (!doc || !schema) {
45
46
  return undefined;
46
47
  }
47
- var json = toJSON(doc);
48
- if (typeof transformer === 'undefined') {
49
- callback(json);
50
- } else {
51
- var nodeSanitized = PMNode.fromJSON(schema, json);
52
- callback(transformer.encode(nodeSanitized));
48
+ try {
49
+ var json = toJSON(doc);
50
+ if (typeof transformer === 'undefined') {
51
+ callback(json);
52
+ } else {
53
+ var nodeSanitized = PMNode.fromJSON(schema, json);
54
+ callback(transformer.encode(nodeSanitized));
55
+ }
56
+ } catch (e) {
57
+ fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
58
+ payload: {
59
+ action: ACTION.DOCUMENT_PROCESSING_ERROR,
60
+ actionSubject: ACTION_SUBJECT.EDITOR,
61
+ eventType: EVENT_TYPE.OPERATIONAL,
62
+ attributes: {
63
+ errorMessage: "".concat(e instanceof Error && e.name === 'NodeNestingTransformError' ? 'NodeNestingTransformError - Failed to transform one or more nested tables' : undefined)
64
+ }
65
+ }
66
+ });
67
+ throw e;
53
68
  }
54
69
  }
@@ -237,7 +237,8 @@ export var EditorPluginInjectionAPI = /*#__PURE__*/function () {
237
237
  function EditorPluginInjectionAPI(_ref6) {
238
238
  var _this2 = this;
239
239
  var getEditorState = _ref6.getEditorState,
240
- getEditorView = _ref6.getEditorView;
240
+ getEditorView = _ref6.getEditorView,
241
+ fireAnalyticsEvent = _ref6.fireAnalyticsEvent;
241
242
  _classCallCheck(this, EditorPluginInjectionAPI);
242
243
  _defineProperty(this, "onEditorViewUpdated", function (_ref7) {
243
244
  var newEditorState = _ref7.newEditorState,
@@ -273,7 +274,8 @@ export var EditorPluginInjectionAPI = /*#__PURE__*/function () {
273
274
  // Special core plugin that is always added
274
275
  this.addPlugin(corePlugin({
275
276
  config: {
276
- getEditorView: getEditorView
277
+ getEditorView: getEditorView,
278
+ fireAnalyticsEvent: fireAnalyticsEvent
277
279
  }
278
280
  }));
279
281
  }
@@ -21,7 +21,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
21
21
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "95.1.1";
24
+ var packageVersion = "95.2.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var DropList = /*#__PURE__*/function (_Component) {
@@ -30,7 +30,7 @@ var transformNestedTablesWithAnalytics = function transformNestedTablesWithAnaly
30
30
  actionSubject: ACTION_SUBJECT.EDITOR,
31
31
  eventType: EVENT_TYPE.OPERATIONAL,
32
32
  attributes: {
33
- errorMessage: 'Failed to transform one or more nested tables in the document'
33
+ errorMessage: "".concat(e instanceof Error && e.name === 'NodeNestingTransformError' ? 'NodeNestingTransformError - Failed to transform one or more nested tables' : undefined)
34
34
  }
35
35
  });
36
36
  }
@@ -1,6 +1,7 @@
1
1
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
2
2
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import { type FireAnalyticsCallback } from '../../analytics';
4
5
  import type { InferTransformerResultCallback, Transformer } from '../../types';
5
6
  export declare function toJSON(node: PMNode): JSONDocNode;
6
- export declare const scheduleDocumentRequest: <GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: InferTransformerResultCallback<Transformer<any>>, transformer?: Transformer<any> | undefined) => void;
7
+ export declare const scheduleDocumentRequest: <GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: InferTransformerResultCallback<Transformer<any>>, transformer?: Transformer<any> | undefined, fireAnalyticsEvent?: FireAnalyticsCallback | undefined) => void;
@@ -1,5 +1,6 @@
1
1
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import { type FireAnalyticsCallback } from '../analytics';
3
4
  import type { BasePluginDependenciesAPI, CorePlugin, NextEditorPlugin, PluginDependenciesAPI } from '../types/next-editor-plugin';
4
5
  type NextEditorPluginInitializedType = ReturnType<NextEditorPlugin<any>>;
5
6
  type SharedStateAPIProps = {
@@ -7,6 +8,7 @@ type SharedStateAPIProps = {
7
8
  };
8
9
  interface PluginInjectionAPIProps extends SharedStateAPIProps {
9
10
  getEditorView: () => EditorView | undefined;
11
+ fireAnalyticsEvent?: FireAnalyticsCallback;
10
12
  }
11
13
  export type EditorStateDiff = {
12
14
  readonly newEditorState: EditorState;
@@ -44,7 +46,7 @@ export declare class EditorPluginInjectionAPI implements PluginInjectionAPIDefin
44
46
  private actionsAPI;
45
47
  private commandsAPI;
46
48
  private plugins;
47
- constructor({ getEditorState, getEditorView }: PluginInjectionAPIProps);
49
+ constructor({ getEditorState, getEditorView, fireAnalyticsEvent }: PluginInjectionAPIProps);
48
50
  private createAPI;
49
51
  api(): GenericAPIWithCore;
50
52
  onEditorViewUpdated: ({ newEditorState, oldEditorState }: EditorStateDiff) => void;
@@ -8,6 +8,7 @@ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
8
8
  import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
10
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
+ import type { FireAnalyticsCallback } from '../analytics';
11
12
  import type { EditorCommand, EditorCommandWithMetadata } from './editor-command';
12
13
  import type { EditorPlugin } from './editor-plugin';
13
14
  export interface Transformer<T> {
@@ -17,6 +18,7 @@ export interface Transformer<T> {
17
18
  export type CorePlugin = NextEditorPlugin<'core', {
18
19
  pluginConfiguration: {
19
20
  getEditorView: () => EditorView | undefined;
21
+ fireAnalyticsEvent?: FireAnalyticsCallback;
20
22
  };
21
23
  actions: {
22
24
  /**
@@ -1,6 +1,7 @@
1
1
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
2
2
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import { type FireAnalyticsCallback } from '../../analytics';
4
5
  import type { InferTransformerResultCallback, Transformer } from '../../types';
5
6
  export declare function toJSON(node: PMNode): JSONDocNode;
6
- export declare const scheduleDocumentRequest: <GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: InferTransformerResultCallback<Transformer<any>>, transformer?: Transformer<any> | undefined) => void;
7
+ export declare const scheduleDocumentRequest: <GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: InferTransformerResultCallback<Transformer<any>>, transformer?: Transformer<any> | undefined, fireAnalyticsEvent?: FireAnalyticsCallback | undefined) => void;
@@ -1,5 +1,6 @@
1
1
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import { type FireAnalyticsCallback } from '../analytics';
3
4
  import type { BasePluginDependenciesAPI, CorePlugin, NextEditorPlugin, PluginDependenciesAPI } from '../types/next-editor-plugin';
4
5
  type NextEditorPluginInitializedType = ReturnType<NextEditorPlugin<any>>;
5
6
  type SharedStateAPIProps = {
@@ -7,6 +8,7 @@ type SharedStateAPIProps = {
7
8
  };
8
9
  interface PluginInjectionAPIProps extends SharedStateAPIProps {
9
10
  getEditorView: () => EditorView | undefined;
11
+ fireAnalyticsEvent?: FireAnalyticsCallback;
10
12
  }
11
13
  export type EditorStateDiff = {
12
14
  readonly newEditorState: EditorState;
@@ -44,7 +46,7 @@ export declare class EditorPluginInjectionAPI implements PluginInjectionAPIDefin
44
46
  private actionsAPI;
45
47
  private commandsAPI;
46
48
  private plugins;
47
- constructor({ getEditorState, getEditorView }: PluginInjectionAPIProps);
49
+ constructor({ getEditorState, getEditorView, fireAnalyticsEvent }: PluginInjectionAPIProps);
48
50
  private createAPI;
49
51
  api(): GenericAPIWithCore;
50
52
  onEditorViewUpdated: ({ newEditorState, oldEditorState }: EditorStateDiff) => void;
@@ -8,6 +8,7 @@ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
8
8
  import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
10
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
+ import type { FireAnalyticsCallback } from '../analytics';
11
12
  import type { EditorCommand, EditorCommandWithMetadata } from './editor-command';
12
13
  import type { EditorPlugin } from './editor-plugin';
13
14
  export interface Transformer<T> {
@@ -17,6 +18,7 @@ export interface Transformer<T> {
17
18
  export type CorePlugin = NextEditorPlugin<'core', {
18
19
  pluginConfiguration: {
19
20
  getEditorView: () => EditorView | undefined;
21
+ fireAnalyticsEvent?: FireAnalyticsCallback;
20
22
  };
21
23
  actions: {
22
24
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "95.1.1",
3
+ "version": "95.2.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/"
@@ -147,7 +147,7 @@
147
147
  "@atlaskit/popper": "^6.3.0",
148
148
  "@atlaskit/primitives": "^13.2.0",
149
149
  "@atlaskit/profilecard": "^20.12.0",
150
- "@atlaskit/section-message": "^6.6.0",
150
+ "@atlaskit/section-message": "^6.7.0",
151
151
  "@atlaskit/smart-card": "^30.3.0",
152
152
  "@atlaskit/smart-user-picker": "^6.11.0",
153
153
  "@atlaskit/spinner": "^16.3.0",