@atlaskit/editor-plugin-user-preferences 8.2.4 → 8.2.6

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.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a777e9d5513bb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a777e9d5513bb) - -
8
+ Add exposure event for improve formatting toolbar experiment, fired only when pinned toolbar is
9
+ visible
10
+ - Swap render-path gate checks to expValEqualsNoExposure in toolbar.tsx and
11
+ ResponsiveContainer.tsx
12
+ - Updated dependencies
13
+
14
+ ## 8.2.5
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 8.2.4
4
21
 
5
22
  ### Patch Changes
@@ -15,30 +15,31 @@ var useDocumentVisibilityWatcher = exports.useDocumentVisibilityWatcher = functi
15
15
  if (userPreferencesProvider) {
16
16
  var refreshPreferences = /*#__PURE__*/function () {
17
17
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
18
- return _regenerator.default.wrap(function _callee$(_context) {
18
+ var _t;
19
+ return _regenerator.default.wrap(function (_context) {
19
20
  while (1) switch (_context.prev = _context.next) {
20
21
  case 0:
21
22
  if (!(document.visibilityState === 'visible')) {
22
- _context.next = 9;
23
+ _context.next = 4;
23
24
  break;
24
25
  }
25
26
  _context.prev = 1;
26
- _context.next = 4;
27
+ _context.next = 2;
27
28
  return userPreferencesProvider.loadPreferences();
28
- case 4:
29
- _context.next = 9;
29
+ case 2:
30
+ _context.next = 4;
30
31
  break;
31
- case 6:
32
- _context.prev = 6;
33
- _context.t0 = _context["catch"](1);
34
- (0, _monitoring.logException)(_context.t0, {
32
+ case 3:
33
+ _context.prev = 3;
34
+ _t = _context["catch"](1);
35
+ (0, _monitoring.logException)(_t, {
35
36
  location: 'editor-plugin-user-preferences/userPreferencesPlugin'
36
37
  });
37
- case 9:
38
+ case 4:
38
39
  case "end":
39
40
  return _context.stop();
40
41
  }
41
- }, _callee, null, [[1, 6]]);
42
+ }, _callee, null, [[1, 3]]);
42
43
  }));
43
44
  return function refreshPreferences() {
44
45
  return _ref.apply(this, arguments);
@@ -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
  };
@@ -8,30 +8,31 @@ export var useDocumentVisibilityWatcher = function useDocumentVisibilityWatcher(
8
8
  if (userPreferencesProvider) {
9
9
  var refreshPreferences = /*#__PURE__*/function () {
10
10
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
11
- return _regeneratorRuntime.wrap(function _callee$(_context) {
11
+ var _t;
12
+ return _regeneratorRuntime.wrap(function (_context) {
12
13
  while (1) switch (_context.prev = _context.next) {
13
14
  case 0:
14
15
  if (!(document.visibilityState === 'visible')) {
15
- _context.next = 9;
16
+ _context.next = 4;
16
17
  break;
17
18
  }
18
19
  _context.prev = 1;
19
- _context.next = 4;
20
+ _context.next = 2;
20
21
  return userPreferencesProvider.loadPreferences();
21
- case 4:
22
- _context.next = 9;
22
+ case 2:
23
+ _context.next = 4;
23
24
  break;
24
- case 6:
25
- _context.prev = 6;
26
- _context.t0 = _context["catch"](1);
27
- logException(_context.t0, {
25
+ case 3:
26
+ _context.prev = 3;
27
+ _t = _context["catch"](1);
28
+ logException(_t, {
28
29
  location: 'editor-plugin-user-preferences/userPreferencesPlugin'
29
30
  });
30
- case 9:
31
+ case 4:
31
32
  case "end":
32
33
  return _context.stop();
33
34
  }
34
- }, _callee, null, [[1, 6]]);
35
+ }, _callee, null, [[1, 3]]);
35
36
  }));
36
37
  return function refreshPreferences() {
37
38
  return _ref.apply(this, arguments);
@@ -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.4",
3
+ "version": "8.2.6",
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": "^84.0.0",
33
+ "@atlaskit/tmp-editor-statsig": "^85.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.47.0",
38
+ "@atlaskit/editor-common": "^114.53.0",
39
39
  "react": "^18.2.0"
40
40
  },
41
41
  "techstack": {