@atlaskit/editor-plugin-selection-marker 8.0.7 → 8.0.9

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,19 @@
1
1
  # @atlaskit/editor-plugin-selection-marker
2
2
 
3
+ ## 8.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9ed32aea2c1d3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ed32aea2c1d3) -
8
+ Replace feature experiment util with cross platform alternative for platform_editor_block_menu
9
+ - Updated dependencies
10
+
11
+ ## 8.0.8
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 8.0.7
4
18
 
5
19
  ### Patch Changes
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _hooks = require("@atlaskit/editor-common/hooks");
10
10
  var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
11
11
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
12
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
13
  var _main = require("./pm-plugins/main");
13
14
  var _globalStyles = require("./ui/global-styles");
14
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -105,7 +106,7 @@ var selectionMarkerPlugin = exports.selectionMarkerPlugin = function selectionMa
105
106
  if (hasFocus === true) {
106
107
  editorHasNotBeenFocused.current = false;
107
108
  }
108
- var isBlockMenuOpen = currentUserIntent === 'blockMenuOpen' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true);
109
+ var isBlockMenuOpen = currentUserIntent === 'blockMenuOpen' && (0, _experiments.editorExperiment)('platform_editor_block_menu', true);
109
110
 
110
111
  /**
111
112
  * There are a number of conditions we should not show the marker,
@@ -116,7 +117,7 @@ var selectionMarkerPlugin = exports.selectionMarkerPlugin = function selectionMa
116
117
  * - Via the API: If another plugin has requested it to be hidden (force hidden).
117
118
  * - If danger styles is shown in decorationsPlugin, then we don't need to show the selection marker
118
119
  */
119
- var shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) || isBlockMenuOpen;
120
+ var shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations && (0, _experiments.editorExperiment)('platform_editor_block_menu', true) || isBlockMenuOpen;
120
121
  requestAnimationFrame(function () {
121
122
  return (0, _main.dispatchShouldHideDecorations)(editorView, shouldHide);
122
123
  });
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.GlobalStylesWrapper = void 0;
7
7
  var _react = require("@emotion/react");
8
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
8
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
9
9
  /**
10
10
  * @jsxRuntime classic
11
11
  * @jsx jsx
@@ -35,6 +35,6 @@ var hideSelectionStyles = (0, _react.css)({
35
35
  });
36
36
  var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper() {
37
37
  return (0, _react.jsx)(_react.Global, {
38
- styles: [globalStyles, (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && hideSelectionStyles]
38
+ styles: [globalStyles, (0, _experiments.editorExperiment)('platform_editor_block_menu', true) && hideSelectionStyles]
39
39
  });
40
40
  };
@@ -2,6 +2,7 @@ import React, { useEffect, useRef } from 'react';
2
2
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
4
4
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
5
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
6
  import { createPlugin, dispatchShouldHideDecorations, key } from './pm-plugins/main';
6
7
  import { GlobalStylesWrapper } from './ui/global-styles';
7
8
  export const selectionMarkerPlugin = ({
@@ -98,7 +99,7 @@ export const selectionMarkerPlugin = ({
98
99
  if (hasFocus === true) {
99
100
  editorHasNotBeenFocused.current = false;
100
101
  }
101
- const isBlockMenuOpen = currentUserIntent === 'blockMenuOpen' && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true);
102
+ const isBlockMenuOpen = currentUserIntent === 'blockMenuOpen' && editorExperiment('platform_editor_block_menu', true);
102
103
 
103
104
  /**
104
105
  * There are a number of conditions we should not show the marker,
@@ -109,7 +110,7 @@ export const selectionMarkerPlugin = ({
109
110
  * - Via the API: If another plugin has requested it to be hidden (force hidden).
110
111
  * - If danger styles is shown in decorationsPlugin, then we don't need to show the selection marker
111
112
  */
112
- const shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) || isBlockMenuOpen;
113
+ const shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations && editorExperiment('platform_editor_block_menu', true) || isBlockMenuOpen;
113
114
  requestAnimationFrame(() => dispatchShouldHideDecorations(editorView, shouldHide));
114
115
  }, [editorView, hasFocus, isOpen, isForcedHidden, editorDisabled, showToolbar, hasDangerDecorations, currentUserIntent]);
115
116
  },
@@ -4,7 +4,7 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
6
6
  import { css, Global, jsx } from '@emotion/react';
7
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
 
9
9
  /**
10
10
  * Unset the selection background color as we are using our own
@@ -29,6 +29,6 @@ const hideSelectionStyles = css({
29
29
  });
30
30
  export const GlobalStylesWrapper = () => {
31
31
  return jsx(Global, {
32
- styles: [globalStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && hideSelectionStyles]
32
+ styles: [globalStyles, editorExperiment('platform_editor_block_menu', true) && hideSelectionStyles]
33
33
  });
34
34
  };
@@ -2,6 +2,7 @@ import React, { useEffect, useRef } from 'react';
2
2
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
4
4
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
5
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
6
  import { createPlugin, dispatchShouldHideDecorations, key } from './pm-plugins/main';
6
7
  import { GlobalStylesWrapper } from './ui/global-styles';
7
8
  export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
@@ -97,7 +98,7 @@ export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
97
98
  if (hasFocus === true) {
98
99
  editorHasNotBeenFocused.current = false;
99
100
  }
100
- var isBlockMenuOpen = currentUserIntent === 'blockMenuOpen' && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true);
101
+ var isBlockMenuOpen = currentUserIntent === 'blockMenuOpen' && editorExperiment('platform_editor_block_menu', true);
101
102
 
102
103
  /**
103
104
  * There are a number of conditions we should not show the marker,
@@ -108,7 +109,7 @@ export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
108
109
  * - Via the API: If another plugin has requested it to be hidden (force hidden).
109
110
  * - If danger styles is shown in decorationsPlugin, then we don't need to show the selection marker
110
111
  */
111
- var shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) || isBlockMenuOpen;
112
+ var shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations && editorExperiment('platform_editor_block_menu', true) || isBlockMenuOpen;
112
113
  requestAnimationFrame(function () {
113
114
  return dispatchShouldHideDecorations(editorView, shouldHide);
114
115
  });
@@ -4,7 +4,7 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
6
6
  import { css, Global, jsx } from '@emotion/react';
7
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
 
9
9
  /**
10
10
  * Unset the selection background color as we are using our own
@@ -29,6 +29,6 @@ var hideSelectionStyles = css({
29
29
  });
30
30
  export var GlobalStylesWrapper = function GlobalStylesWrapper() {
31
31
  return jsx(Global, {
32
- styles: [globalStyles, expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && hideSelectionStyles]
32
+ styles: [globalStyles, editorExperiment('platform_editor_block_menu', true) && hideSelectionStyles]
33
33
  });
34
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-marker",
3
- "version": "8.0.7",
3
+ "version": "8.0.9",
4
4
  "description": "Selection marker plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/link": "^3.3.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
40
  "@atlaskit/theme": "^22.0.0",
41
- "@atlaskit/tmp-editor-statsig": "^42.0.0",
41
+ "@atlaskit/tmp-editor-statsig": "^43.0.0",
42
42
  "@atlaskit/tokens": "^11.1.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "@emotion/react": "^11.7.1",