@atlaskit/editor-plugin-metrics 3.5.2 → 3.6.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.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#177157](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/177157)
8
+ [`6bcf8912217df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6bcf8912217df) -
9
+ ED-27284 additional integration with user preference plugin
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 3.5.3
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 3.5.2
4
22
 
5
23
  ### Patch Changes
@@ -62,8 +62,8 @@ var metricsPlugin = exports.metricsPlugin = function metricsPlugin(_ref) {
62
62
  var _api$analytics;
63
63
  var toolbarDocking;
64
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');
65
+ var _api$userPreferences, _config$userPreferenc;
66
+ toolbarDocking = toolbarDocking = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition : config === null || config === void 0 || (_config$userPreferenc = config.userPreferencesProvider) === null || _config$userPreferenc === void 0 ? void 0 : _config$userPreferenc.getPreference('toolbarDockingInitialPosition');
67
67
  }
68
68
  var payloadToSend = (0, _analytics.getAnalyticsPayload)({
69
69
  currentContent: tr.doc.content,
@@ -52,8 +52,8 @@ export const metricsPlugin = ({
52
52
  var _api$analytics;
53
53
  let toolbarDocking;
54
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');
55
+ var _api$userPreferences, _api$userPreferences$, _api$userPreferences$2, _config$userPreferenc;
56
+ toolbarDocking = toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : (_api$userPreferences$ = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences$ === void 0 ? void 0 : (_api$userPreferences$2 = _api$userPreferences$.preferences) === null || _api$userPreferences$2 === void 0 ? void 0 : _api$userPreferences$2.toolbarDockingPosition : config === null || config === void 0 ? void 0 : (_config$userPreferenc = config.userPreferencesProvider) === null || _config$userPreferenc === void 0 ? void 0 : _config$userPreferenc.getPreference('toolbarDockingInitialPosition');
57
57
  }
58
58
  const payloadToSend = getAnalyticsPayload({
59
59
  currentContent: tr.doc.content,
@@ -56,8 +56,8 @@ export var metricsPlugin = function metricsPlugin(_ref) {
56
56
  var _api$analytics;
57
57
  var toolbarDocking;
58
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');
59
+ var _api$userPreferences, _config$userPreferenc;
60
+ toolbarDocking = toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.preferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.toolbarDockingPosition : config === null || config === void 0 || (_config$userPreferenc = config.userPreferencesProvider) === null || _config$userPreferenc === void 0 ? void 0 : _config$userPreferenc.getPreference('toolbarDockingInitialPosition');
61
61
  }
62
62
  var payloadToSend = getAnalyticsPayload({
63
63
  currentContent: tr.doc.content,
@@ -1,5 +1,6 @@
1
1
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
3
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
5
  import type { MetricsState } from './pm-plugins/main';
5
6
  type handleIntentToStartEditProps = {
@@ -12,7 +13,7 @@ export type MetricsPluginOptions = {
12
13
  };
13
14
  export type MetricsPlugin = NextEditorPlugin<'metrics', {
14
15
  pluginConfiguration?: MetricsPluginOptions;
15
- dependencies: [OptionalPlugin<AnalyticsPlugin>];
16
+ dependencies: [OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<UserPreferencesPlugin>];
16
17
  sharedState: MetricsState;
17
18
  commands: {
18
19
  setContentMoved: () => EditorCommand;
@@ -1,3 +1,3 @@
1
- import { Step } from '@atlaskit/editor-prosemirror/transform';
1
+ import { type Step } from '@atlaskit/editor-prosemirror/transform';
2
2
  import { type MarkChangeAction } from '../types';
3
3
  export declare const checkMarkChanged: (step: Step) => MarkChangeAction | undefined;
@@ -1,5 +1,6 @@
1
1
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
3
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
5
  import type { MetricsState } from './pm-plugins/main';
5
6
  type handleIntentToStartEditProps = {
@@ -13,7 +14,8 @@ export type MetricsPluginOptions = {
13
14
  export type MetricsPlugin = NextEditorPlugin<'metrics', {
14
15
  pluginConfiguration?: MetricsPluginOptions;
15
16
  dependencies: [
16
- OptionalPlugin<AnalyticsPlugin>
17
+ OptionalPlugin<AnalyticsPlugin>,
18
+ OptionalPlugin<UserPreferencesPlugin>
17
19
  ];
18
20
  sharedState: MetricsState;
19
21
  commands: {
@@ -1,3 +1,3 @@
1
- import { Step } from '@atlaskit/editor-prosemirror/transform';
1
+ import { type Step } from '@atlaskit/editor-prosemirror/transform';
2
2
  import { type MarkChangeAction } from '../types';
3
3
  export declare const checkMarkChanged: (step: Step) => MarkChangeAction | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-metrics",
3
- "version": "3.5.2",
3
+ "version": "3.6.0",
4
4
  "description": "Metrics plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -10,8 +10,7 @@
10
10
  "atlassian": {
11
11
  "team": "Editor: Jenga",
12
12
  "singleton": true,
13
- "releaseModel": "continuous",
14
- "runReact18": true
13
+ "releaseModel": "continuous"
15
14
  },
16
15
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
17
16
  "main": "dist/cjs/index.js",
@@ -33,11 +32,12 @@
33
32
  },
34
33
  "dependencies": {
35
34
  "@atlaskit/adf-schema": "^47.6.0",
36
- "@atlaskit/editor-common": "^107.0.0",
35
+ "@atlaskit/editor-common": "^107.4.0",
37
36
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
37
+ "@atlaskit/editor-plugin-user-preferences": "^0.3.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
- "@atlaskit/tmp-editor-statsig": "^7.1.0",
40
+ "@atlaskit/tmp-editor-statsig": "^8.5.0",
41
41
  "@babel/runtime": "^7.0.0",
42
42
  "bind-event-listener": "^3.0.0"
43
43
  },
@@ -83,6 +83,9 @@
83
83
  }
84
84
  },
85
85
  "platform-feature-flags": {
86
+ "platform_editor_use_preferences_plugin": {
87
+ "type": "boolean"
88
+ },
86
89
  "platform_editor_controls_patch_13": {
87
90
  "type": "boolean"
88
91
  }