@atlaskit/editor-plugin-metrics 3.4.7 → 3.5.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,23 @@
1
1
  # @atlaskit/editor-plugin-metrics
2
2
 
3
+ ## 3.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#168315](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/168315)
8
+ [`9b42791b3f3c2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b42791b3f3c2) -
9
+ ED-28215 Add toolbar docking preference to activitySession ended event
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 3.4.8
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 3.4.7
4
22
 
5
23
  ### Patch Changes
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.metricsPlugin = void 0;
7
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
7
9
  var _main = require("./pm-plugins/main");
8
10
  var _analytics = require("./pm-plugins/utils/analytics");
9
11
  /**
@@ -12,14 +14,15 @@ var _analytics = require("./pm-plugins/utils/analytics");
12
14
  */
13
15
 
14
16
  var metricsPlugin = exports.metricsPlugin = function metricsPlugin(_ref) {
15
- var api = _ref.api;
17
+ var config = _ref.config,
18
+ api = _ref.api;
16
19
  return {
17
20
  name: 'metrics',
18
21
  pmPlugins: function pmPlugins() {
19
22
  return [{
20
23
  name: 'metrics',
21
24
  plugin: function plugin() {
22
- return (0, _main.createPlugin)(api);
25
+ return (0, _main.createPlugin)(api, config === null || config === void 0 ? void 0 : config.userPreferencesProvider);
23
26
  }
24
27
  }];
25
28
  },
@@ -57,9 +60,15 @@ var metricsPlugin = exports.metricsPlugin = function metricsPlugin(_ref) {
57
60
  }
58
61
  if (pluginState && pluginState.totalActionCount > 0 && pluginState.activeSessionTime > 0) {
59
62
  var _api$analytics;
63
+ var toolbarDocking;
64
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_13')) {
65
+ var _config$userPreferenc;
66
+ toolbarDocking = config === null || config === void 0 || (_config$userPreferenc = config.userPreferencesProvider) === null || _config$userPreferenc === void 0 ? void 0 : _config$userPreferenc.getPreference('toolbarDockingInitialPosition');
67
+ }
60
68
  var payloadToSend = (0, _analytics.getAnalyticsPayload)({
61
69
  currentContent: tr.doc.content,
62
- pluginState: pluginState
70
+ pluginState: pluginState,
71
+ toolbarDocking: toolbarDocking || undefined
63
72
  });
64
73
  api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.attachAnalyticsEvent(payloadToSend)(tr);
65
74
  }
@@ -67,6 +76,7 @@ var metricsPlugin = exports.metricsPlugin = function metricsPlugin(_ref) {
67
76
  stopActiveSession: true
68
77
  });
69
78
  tr.setMeta('scrollIntoView', false);
79
+ tr.setMeta('addToHistory', false);
70
80
  return tr;
71
81
  };
72
82
  },
@@ -9,6 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _bindEventListener = require("bind-event-listener");
10
10
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
11
11
  var _state = require("@atlaskit/editor-prosemirror/state");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
12
14
  var _activeSessionTimer = require("./utils/active-session-timer");
13
15
  var _analytics = require("./utils/analytics");
14
16
  var _getNewPluginState = require("./utils/get-new-plugin-state");
@@ -39,7 +41,7 @@ var initialPluginState = exports.initialPluginState = {
39
41
  repeatedActionCount: 0,
40
42
  safeInsertCount: 0
41
43
  };
42
- var createPlugin = exports.createPlugin = function createPlugin(api) {
44
+ var createPlugin = exports.createPlugin = function createPlugin(api, userPreferencesProvider) {
43
45
  var timer = new _activeSessionTimer.ActiveSessionTimer(api);
44
46
  return new _safePlugin.SafePlugin({
45
47
  key: metricsKey,
@@ -117,13 +119,18 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
117
119
  if (!pluginState) {
118
120
  return;
119
121
  }
122
+ var toolbarDocking;
123
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_13')) {
124
+ toolbarDocking = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
125
+ }
120
126
  var payloadToSend = (0, _analytics.getAnalyticsPayload)({
121
127
  currentContent: _view.state.doc.content,
122
- pluginState: pluginState
128
+ pluginState: pluginState,
129
+ toolbarDocking: toolbarDocking || undefined
123
130
  });
124
131
  if (pluginState && pluginState.totalActionCount > 0 && pluginState.activeSessionTime > 0) {
125
132
  var _api$analytics;
126
- api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent(payloadToSend, undefined, {
133
+ api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.fireAnalyticsEvent(payloadToSend, undefined, {
127
134
  immediate: true
128
135
  });
129
136
  }
@@ -14,7 +14,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
14
14
  var getAnalyticsPayload = exports.getAnalyticsPayload = function getAnalyticsPayload(_ref) {
15
15
  var _pluginState$actionTy;
16
16
  var currentContent = _ref.currentContent,
17
- pluginState = _ref.pluginState;
17
+ pluginState = _ref.pluginState,
18
+ toolbarDocking = _ref.toolbarDocking;
18
19
  var nodeChanges = (0, _getNodeChanges.getNodeChanges)({
19
20
  currentContent: currentContent,
20
21
  pluginState: pluginState
@@ -60,7 +61,8 @@ var getAnalyticsPayload = exports.getAnalyticsPayload = function getAnalyticsPay
60
61
  repeatedActionCount: pluginState.repeatedActionCount,
61
62
  safeInsertCount: pluginState.safeInsertCount
62
63
  },
63
- contentSizeChanged: pluginState.contentSizeChanged
64
+ contentSizeChanged: pluginState.contentSizeChanged,
65
+ toolbarDocking: toolbarDocking
64
66
  },
65
67
  eventType: _analytics.EVENT_TYPE.TRACK
66
68
  };
@@ -1,3 +1,5 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
2
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
1
3
  import { createPlugin, initialPluginState, metricsKey } from './pm-plugins/main';
2
4
  import { getAnalyticsPayload } from './pm-plugins/utils/analytics';
3
5
  /**
@@ -6,13 +8,14 @@ import { getAnalyticsPayload } from './pm-plugins/utils/analytics';
6
8
  */
7
9
 
8
10
  export const metricsPlugin = ({
11
+ config,
9
12
  api
10
13
  }) => ({
11
14
  name: 'metrics',
12
15
  pmPlugins() {
13
16
  return [{
14
17
  name: 'metrics',
15
- plugin: () => createPlugin(api)
18
+ plugin: () => createPlugin(api, config === null || config === void 0 ? void 0 : config.userPreferencesProvider)
16
19
  }];
17
20
  },
18
21
  commands: {
@@ -47,9 +50,15 @@ export const metricsPlugin = ({
47
50
  }
48
51
  if (pluginState && pluginState.totalActionCount > 0 && pluginState.activeSessionTime > 0) {
49
52
  var _api$analytics;
53
+ let toolbarDocking;
54
+ if (expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_13')) {
55
+ var _config$userPreferenc;
56
+ toolbarDocking = config === null || config === void 0 ? void 0 : (_config$userPreferenc = config.userPreferencesProvider) === null || _config$userPreferenc === void 0 ? void 0 : _config$userPreferenc.getPreference('toolbarDockingInitialPosition');
57
+ }
50
58
  const payloadToSend = getAnalyticsPayload({
51
59
  currentContent: tr.doc.content,
52
- pluginState
60
+ pluginState,
61
+ toolbarDocking: toolbarDocking || undefined
53
62
  });
54
63
  api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.attachAnalyticsEvent(payloadToSend)(tr);
55
64
  }
@@ -57,6 +66,7 @@ export const metricsPlugin = ({
57
66
  stopActiveSession: true
58
67
  });
59
68
  tr.setMeta('scrollIntoView', false);
69
+ tr.setMeta('addToHistory', false);
60
70
  return tr;
61
71
  },
62
72
  handleIntentToStartEdit: ({
@@ -1,6 +1,8 @@
1
1
  import { bind } from 'bind-event-listener';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
4
6
  import { ActiveSessionTimer } from './utils/active-session-timer';
5
7
  import { getAnalyticsPayload } from './utils/analytics';
6
8
  import { getNewPluginState } from './utils/get-new-plugin-state';
@@ -29,7 +31,7 @@ export const initialPluginState = {
29
31
  repeatedActionCount: 0,
30
32
  safeInsertCount: 0
31
33
  };
32
- export const createPlugin = api => {
34
+ export const createPlugin = (api, userPreferencesProvider) => {
33
35
  const timer = new ActiveSessionTimer(api);
34
36
  return new SafePlugin({
35
37
  key: metricsKey,
@@ -112,13 +114,18 @@ export const createPlugin = api => {
112
114
  if (!pluginState) {
113
115
  return;
114
116
  }
117
+ let toolbarDocking;
118
+ if (expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_13')) {
119
+ toolbarDocking = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
120
+ }
115
121
  const payloadToSend = getAnalyticsPayload({
116
122
  currentContent: view.state.doc.content,
117
- pluginState
123
+ pluginState,
124
+ toolbarDocking: toolbarDocking || undefined
118
125
  });
119
126
  if (pluginState && pluginState.totalActionCount > 0 && pluginState.activeSessionTime > 0) {
120
- var _api$analytics;
121
- api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent(payloadToSend, undefined, {
127
+ var _api$analytics, _api$analytics$action;
128
+ api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent(payloadToSend, undefined, {
122
129
  immediate: true
123
130
  });
124
131
  }
@@ -2,7 +2,8 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit
2
2
  import { getNodeChanges } from './get-node-changes';
3
3
  export const getAnalyticsPayload = ({
4
4
  currentContent,
5
- pluginState
5
+ pluginState,
6
+ toolbarDocking
6
7
  }) => {
7
8
  var _pluginState$actionTy;
8
9
  const nodeChanges = getNodeChanges({
@@ -45,7 +46,8 @@ export const getAnalyticsPayload = ({
45
46
  repeatedActionCount: pluginState.repeatedActionCount,
46
47
  safeInsertCount: pluginState.safeInsertCount
47
48
  },
48
- contentSizeChanged: pluginState.contentSizeChanged
49
+ contentSizeChanged: pluginState.contentSizeChanged,
50
+ toolbarDocking
49
51
  },
50
52
  eventType: EVENT_TYPE.TRACK
51
53
  };
@@ -1,3 +1,5 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
2
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
1
3
  import { createPlugin, initialPluginState, metricsKey } from './pm-plugins/main';
2
4
  import { getAnalyticsPayload } from './pm-plugins/utils/analytics';
3
5
  /**
@@ -6,14 +8,15 @@ import { getAnalyticsPayload } from './pm-plugins/utils/analytics';
6
8
  */
7
9
 
8
10
  export var metricsPlugin = function metricsPlugin(_ref) {
9
- var api = _ref.api;
11
+ var config = _ref.config,
12
+ api = _ref.api;
10
13
  return {
11
14
  name: 'metrics',
12
15
  pmPlugins: function pmPlugins() {
13
16
  return [{
14
17
  name: 'metrics',
15
18
  plugin: function plugin() {
16
- return createPlugin(api);
19
+ return createPlugin(api, config === null || config === void 0 ? void 0 : config.userPreferencesProvider);
17
20
  }
18
21
  }];
19
22
  },
@@ -51,9 +54,15 @@ export var metricsPlugin = function metricsPlugin(_ref) {
51
54
  }
52
55
  if (pluginState && pluginState.totalActionCount > 0 && pluginState.activeSessionTime > 0) {
53
56
  var _api$analytics;
57
+ var toolbarDocking;
58
+ if (expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_13')) {
59
+ var _config$userPreferenc;
60
+ toolbarDocking = config === null || config === void 0 || (_config$userPreferenc = config.userPreferencesProvider) === null || _config$userPreferenc === void 0 ? void 0 : _config$userPreferenc.getPreference('toolbarDockingInitialPosition');
61
+ }
54
62
  var payloadToSend = getAnalyticsPayload({
55
63
  currentContent: tr.doc.content,
56
- pluginState: pluginState
64
+ pluginState: pluginState,
65
+ toolbarDocking: toolbarDocking || undefined
57
66
  });
58
67
  api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.attachAnalyticsEvent(payloadToSend)(tr);
59
68
  }
@@ -61,6 +70,7 @@ export var metricsPlugin = function metricsPlugin(_ref) {
61
70
  stopActiveSession: true
62
71
  });
63
72
  tr.setMeta('scrollIntoView', false);
73
+ tr.setMeta('addToHistory', false);
64
74
  return tr;
65
75
  };
66
76
  },
@@ -4,6 +4,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { bind } from 'bind-event-listener';
5
5
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
7
9
  import { ActiveSessionTimer } from './utils/active-session-timer';
8
10
  import { getAnalyticsPayload } from './utils/analytics';
9
11
  import { getNewPluginState } from './utils/get-new-plugin-state';
@@ -32,7 +34,7 @@ export var initialPluginState = {
32
34
  repeatedActionCount: 0,
33
35
  safeInsertCount: 0
34
36
  };
35
- export var createPlugin = function createPlugin(api) {
37
+ export var createPlugin = function createPlugin(api, userPreferencesProvider) {
36
38
  var timer = new ActiveSessionTimer(api);
37
39
  return new SafePlugin({
38
40
  key: metricsKey,
@@ -110,13 +112,18 @@ export var createPlugin = function createPlugin(api) {
110
112
  if (!pluginState) {
111
113
  return;
112
114
  }
115
+ var toolbarDocking;
116
+ if (expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_13')) {
117
+ toolbarDocking = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
118
+ }
113
119
  var payloadToSend = getAnalyticsPayload({
114
120
  currentContent: _view.state.doc.content,
115
- pluginState: pluginState
121
+ pluginState: pluginState,
122
+ toolbarDocking: toolbarDocking || undefined
116
123
  });
117
124
  if (pluginState && pluginState.totalActionCount > 0 && pluginState.activeSessionTime > 0) {
118
125
  var _api$analytics;
119
- api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent(payloadToSend, undefined, {
126
+ api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.fireAnalyticsEvent(payloadToSend, undefined, {
120
127
  immediate: true
121
128
  });
122
129
  }
@@ -7,7 +7,8 @@ import { getNodeChanges } from './get-node-changes';
7
7
  export var getAnalyticsPayload = function getAnalyticsPayload(_ref) {
8
8
  var _pluginState$actionTy;
9
9
  var currentContent = _ref.currentContent,
10
- pluginState = _ref.pluginState;
10
+ pluginState = _ref.pluginState,
11
+ toolbarDocking = _ref.toolbarDocking;
11
12
  var nodeChanges = getNodeChanges({
12
13
  currentContent: currentContent,
13
14
  pluginState: pluginState
@@ -53,7 +54,8 @@ export var getAnalyticsPayload = function getAnalyticsPayload(_ref) {
53
54
  repeatedActionCount: pluginState.repeatedActionCount,
54
55
  safeInsertCount: pluginState.safeInsertCount
55
56
  },
56
- contentSizeChanged: pluginState.contentSizeChanged
57
+ contentSizeChanged: pluginState.contentSizeChanged,
58
+ toolbarDocking: toolbarDocking
57
59
  },
58
60
  eventType: EVENT_TYPE.TRACK
59
61
  };
@@ -1,3 +1,3 @@
1
1
  export { metricsPlugin } from './metricsPlugin';
2
- export type { MetricsPlugin } from './metricsPluginType';
2
+ export type { MetricsPlugin, MetricsPluginOptions } from './metricsPluginType';
3
3
  export type { MetricsState } from './pm-plugins/main';
@@ -1,4 +1,4 @@
1
- import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
1
+ import type { EditorCommand, NextEditorPlugin, OptionalPlugin, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { MetricsState } from './pm-plugins/main';
@@ -7,7 +7,11 @@ type handleIntentToStartEditProps = {
7
7
  shouldStartTimer?: boolean;
8
8
  shouldPersistActiveSession?: boolean;
9
9
  };
10
+ export type MetricsPluginOptions = {
11
+ userPreferencesProvider?: UserPreferencesProvider;
12
+ };
10
13
  export type MetricsPlugin = NextEditorPlugin<'metrics', {
14
+ pluginConfiguration?: MetricsPluginOptions;
11
15
  dependencies: [OptionalPlugin<AnalyticsPlugin>];
12
16
  sharedState: MetricsState;
13
17
  commands: {
@@ -1,5 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import { UserPreferencesProvider, type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
4
  import { PluginKey, Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { type MetricsPlugin } from '../metricsPluginType';
@@ -30,4 +30,4 @@ export type ActionByType = {
30
30
  contentDeletedCount: number;
31
31
  };
32
32
  export declare const initialPluginState: MetricsState;
33
- export declare const createPlugin: (api: ExtractInjectionAPI<MetricsPlugin> | undefined) => SafePlugin<MetricsState>;
33
+ export declare const createPlugin: (api: ExtractInjectionAPI<MetricsPlugin> | undefined, userPreferencesProvider?: UserPreferencesProvider) => SafePlugin<MetricsState>;
@@ -1,7 +1,8 @@
1
1
  import { type ActiveSessionEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { MetricsState } from '../main';
4
- export declare const getAnalyticsPayload: ({ currentContent, pluginState, }: {
4
+ export declare const getAnalyticsPayload: ({ currentContent, pluginState, toolbarDocking, }: {
5
5
  currentContent: Fragment;
6
6
  pluginState: MetricsState;
7
+ toolbarDocking?: "top" | "none" | undefined;
7
8
  }) => ActiveSessionEventPayload;
@@ -1,3 +1,3 @@
1
1
  export { metricsPlugin } from './metricsPlugin';
2
- export type { MetricsPlugin } from './metricsPluginType';
2
+ export type { MetricsPlugin, MetricsPluginOptions } from './metricsPluginType';
3
3
  export type { MetricsState } from './pm-plugins/main';
@@ -1,4 +1,4 @@
1
- import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
1
+ import type { EditorCommand, NextEditorPlugin, OptionalPlugin, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { MetricsState } from './pm-plugins/main';
@@ -7,7 +7,11 @@ type handleIntentToStartEditProps = {
7
7
  shouldStartTimer?: boolean;
8
8
  shouldPersistActiveSession?: boolean;
9
9
  };
10
+ export type MetricsPluginOptions = {
11
+ userPreferencesProvider?: UserPreferencesProvider;
12
+ };
10
13
  export type MetricsPlugin = NextEditorPlugin<'metrics', {
14
+ pluginConfiguration?: MetricsPluginOptions;
11
15
  dependencies: [
12
16
  OptionalPlugin<AnalyticsPlugin>
13
17
  ];
@@ -1,5 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import { UserPreferencesProvider, type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
4
  import { PluginKey, Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { type MetricsPlugin } from '../metricsPluginType';
@@ -30,4 +30,4 @@ export type ActionByType = {
30
30
  contentDeletedCount: number;
31
31
  };
32
32
  export declare const initialPluginState: MetricsState;
33
- export declare const createPlugin: (api: ExtractInjectionAPI<MetricsPlugin> | undefined) => SafePlugin<MetricsState>;
33
+ export declare const createPlugin: (api: ExtractInjectionAPI<MetricsPlugin> | undefined, userPreferencesProvider?: UserPreferencesProvider) => SafePlugin<MetricsState>;
@@ -1,7 +1,8 @@
1
1
  import { type ActiveSessionEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { MetricsState } from '../main';
4
- export declare const getAnalyticsPayload: ({ currentContent, pluginState, }: {
4
+ export declare const getAnalyticsPayload: ({ currentContent, pluginState, toolbarDocking, }: {
5
5
  currentContent: Fragment;
6
6
  pluginState: MetricsState;
7
+ toolbarDocking?: "top" | "none" | undefined;
7
8
  }) => ActiveSessionEventPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-metrics",
3
- "version": "3.4.7",
3
+ "version": "3.5.0",
4
4
  "description": "Metrics plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,10 +33,11 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^47.6.0",
36
- "@atlaskit/editor-common": "^105.0.0",
37
- "@atlaskit/editor-plugin-analytics": "^2.2.0",
36
+ "@atlaskit/editor-common": "^106.5.0",
37
+ "@atlaskit/editor-plugin-analytics": "^2.3.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
+ "@atlaskit/tmp-editor-statsig": "^6.1.0",
40
41
  "@babel/runtime": "^7.0.0",
41
42
  "bind-event-listener": "^3.0.0"
42
43
  },
@@ -80,5 +81,10 @@
80
81
  "static"
81
82
  ]
82
83
  }
84
+ },
85
+ "platform-feature-flags": {
86
+ "platform_editor_controls_patch_13": {
87
+ "type": "boolean"
88
+ }
83
89
  }
84
90
  }