@atlaskit/editor-plugin-user-preferences 8.2.5 → 8.2.7

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,22 @@
1
1
  # @atlaskit/editor-plugin-user-preferences
2
2
 
3
+ ## 8.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 8.2.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`a777e9d5513bb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a777e9d5513bb) - -
14
+ Add exposure event for improve formatting toolbar experiment, fired only when pinned toolbar is
15
+ visible
16
+ - Swap render-path gate checks to expValEqualsNoExposure in toolbar.tsx and
17
+ ResponsiveContainer.tsx
18
+ - Updated dependencies
19
+
3
20
  ## 8.2.5
4
21
 
5
22
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useUserPreferencesInitListener = void 0;
7
7
  var _react = require("react");
8
8
  var _analytics = require("@atlaskit/editor-common/analytics");
9
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
10
  var useUserPreferencesInitListener = exports.useUserPreferencesInitListener = function useUserPreferencesInitListener(isInitialized, resolvedUserPreferences, api) {
10
11
  var isInitializedRef = (0, _react.useRef)(false);
11
12
  (0, _react.useEffect)(function () {
@@ -21,6 +22,14 @@ var useUserPreferencesInitListener = exports.useUserPreferencesInitListener = fu
21
22
  },
22
23
  eventType: _analytics.EVENT_TYPE.OPERATIONAL
23
24
  });
25
+
26
+ // Only users with the toolbar docked at the top will see the button, so we
27
+ // constrain the experiment population here rather than on every editor load.
28
+ // This call is purely to log the exposure.
29
+ if (resolvedUserPreferences.toolbarDockingPosition === 'top') {
30
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
31
+ (0, _expValEquals.expValEquals)('platform_editor_ai_improve_formatting_toolbar', 'isEnabled', true);
32
+ }
24
33
  }
25
34
  }, [api, isInitialized, resolvedUserPreferences]);
26
35
  };
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useRef } from 'react';
2
2
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
4
  export const useUserPreferencesInitListener = (isInitialized, resolvedUserPreferences, api) => {
4
5
  const isInitializedRef = useRef(false);
5
6
  useEffect(() => {
@@ -15,6 +16,14 @@ export const useUserPreferencesInitListener = (isInitialized, resolvedUserPrefer
15
16
  },
16
17
  eventType: EVENT_TYPE.OPERATIONAL
17
18
  });
19
+
20
+ // Only users with the toolbar docked at the top will see the button, so we
21
+ // constrain the experiment population here rather than on every editor load.
22
+ // This call is purely to log the exposure.
23
+ if (resolvedUserPreferences.toolbarDockingPosition === 'top') {
24
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
25
+ expValEquals('platform_editor_ai_improve_formatting_toolbar', 'isEnabled', true);
26
+ }
18
27
  }
19
28
  }, [api, isInitialized, resolvedUserPreferences]);
20
29
  };
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useRef } from 'react';
2
2
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
4
  export var useUserPreferencesInitListener = function useUserPreferencesInitListener(isInitialized, resolvedUserPreferences, api) {
4
5
  var isInitializedRef = useRef(false);
5
6
  useEffect(function () {
@@ -15,6 +16,14 @@ export var useUserPreferencesInitListener = function useUserPreferencesInitListe
15
16
  },
16
17
  eventType: EVENT_TYPE.OPERATIONAL
17
18
  });
19
+
20
+ // Only users with the toolbar docked at the top will see the button, so we
21
+ // constrain the experiment population here rather than on every editor load.
22
+ // This call is purely to log the exposure.
23
+ if (resolvedUserPreferences.toolbarDockingPosition === 'top') {
24
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
25
+ expValEquals('platform_editor_ai_improve_formatting_toolbar', 'isEnabled', true);
26
+ }
18
27
  }
19
28
  }, [api, isInitialized, resolvedUserPreferences]);
20
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-user-preferences",
3
- "version": "8.2.5",
3
+ "version": "8.2.7",
4
4
  "description": "UserPreferences plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,12 +30,12 @@
30
30
  "dependencies": {
31
31
  "@atlaskit/editor-plugin-analytics": "^10.1.0",
32
32
  "@atlaskit/editor-prosemirror": "^7.3.0",
33
- "@atlaskit/tmp-editor-statsig": "^85.0.0",
33
+ "@atlaskit/tmp-editor-statsig": "^86.0.0",
34
34
  "@babel/runtime": "^7.0.0",
35
35
  "bind-event-listener": "^3.0.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@atlaskit/editor-common": "^114.50.0",
38
+ "@atlaskit/editor-common": "^114.54.0",
39
39
  "react": "^18.2.0"
40
40
  },
41
41
  "techstack": {