@atlaskit/editor-plugin-selection-toolbar 9.0.9 → 9.0.11

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-toolbar
2
2
 
3
+ ## 9.0.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 9.0.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [`9ed32aea2c1d3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ed32aea2c1d3) -
14
+ Replace feature experiment util with cross platform alternative for platform_editor_block_menu
15
+ - Updated dependencies
16
+
3
17
  ## 9.0.9
4
18
 
5
19
  ### Patch Changes
@@ -14,7 +14,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
14
14
  var _utils = require("@atlaskit/editor-common/utils");
15
15
  var _state = require("@atlaskit/editor-prosemirror/state");
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
18
17
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
19
18
  var _commands = require("./pm-plugins/commands");
20
19
  var _pluginKey = require("./pm-plugins/plugin-key");
@@ -154,7 +153,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
154
153
  if (meta) {
155
154
  return _objectSpread(_objectSpread({}, newPluginState), meta);
156
155
  }
157
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
156
+ if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
158
157
  var _api$userIntent;
159
158
  var isBlockMenuOpen = (api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent) === 'blockMenuOpen';
160
159
  newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
@@ -283,7 +282,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
283
282
  return;
284
283
  }
285
284
  }
286
- if (isBlockMenuOpen && isEditorControlsEnabled && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
285
+ if (isBlockMenuOpen && isEditorControlsEnabled && (0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
287
286
  // If the block menu is open, do not show the selection toolbar.
288
287
  return;
289
288
  }
@@ -42,7 +42,9 @@ var PrimaryToolbarComponent = exports.PrimaryToolbarComponent = function Primary
42
42
  iconBefore: /*#__PURE__*/React.createElement(_pinFilled.default, {
43
43
  label: "",
44
44
  spacing: "spacious"
45
- }),
45
+ })
46
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
47
+ ,
46
48
  onClick: function onClick() {
47
49
  var _api$core$actions$exe, _api$userPreferences2;
48
50
  return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
@@ -60,7 +62,9 @@ var PrimaryToolbarComponent = exports.PrimaryToolbarComponent = function Primary
60
62
  iconBefore: /*#__PURE__*/React.createElement(_pin.default, {
61
63
  label: "",
62
64
  spacing: "spacious"
63
- }),
65
+ })
66
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
67
+ ,
64
68
  onClick: function onClick() {
65
69
  var _api$core$actions$exe2, _api$userPreferences3;
66
70
  return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
@@ -5,7 +5,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { calculateToolbarPositionAboveSelection, calculateToolbarPositionOnCellSelection, calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils';
6
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
8
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
9
  import { setToolbarDocking, toggleToolbar, updateToolbarDocking, forceToolbarDockingWithoutAnalytics } from './pm-plugins/commands';
11
10
  import { selectionToolbarPluginKey } from './pm-plugins/plugin-key';
@@ -150,7 +149,7 @@ export const selectionToolbarPlugin = ({
150
149
  ...meta
151
150
  };
152
151
  }
153
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
152
+ if (editorExperiment('platform_editor_block_menu', true)) {
154
153
  var _api$userIntent, _api$userIntent$share;
155
154
  const isBlockMenuOpen = (api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : (_api$userIntent$share = _api$userIntent.sharedState.currentState()) === null || _api$userIntent$share === void 0 ? void 0 : _api$userIntent$share.currentUserIntent) === 'blockMenuOpen';
156
155
  newPluginState = {
@@ -282,7 +281,7 @@ export const selectionToolbarPlugin = ({
282
281
  return;
283
282
  }
284
283
  }
285
- if (isBlockMenuOpen && isEditorControlsEnabled && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
284
+ if (isBlockMenuOpen && isEditorControlsEnabled && editorExperiment('platform_editor_block_menu', true)) {
286
285
  // If the block menu is open, do not show the selection toolbar.
287
286
  return;
288
287
  }
@@ -34,7 +34,9 @@ export const PrimaryToolbarComponent = ({
34
34
  iconBefore: /*#__PURE__*/React.createElement(PinFilledIcon, {
35
35
  label: "",
36
36
  spacing: "spacious"
37
- }),
37
+ })
38
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
39
+ ,
38
40
  onClick: () => {
39
41
  var _api$core$actions$exe, _api$userPreferences2;
40
42
  return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
@@ -52,7 +54,9 @@ export const PrimaryToolbarComponent = ({
52
54
  iconBefore: /*#__PURE__*/React.createElement(PinIcon, {
53
55
  label: "",
54
56
  spacing: "spacious"
55
- }),
57
+ })
58
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
59
+ ,
56
60
  onClick: () => {
57
61
  var _api$core$actions$exe2, _api$userPreferences3;
58
62
  return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
@@ -9,7 +9,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
9
9
  import { calculateToolbarPositionAboveSelection, calculateToolbarPositionOnCellSelection, calculateToolbarPositionTrackHead } from '@atlaskit/editor-common/utils';
10
10
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
13
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
13
  import { setToolbarDocking as _setToolbarDocking, toggleToolbar, updateToolbarDocking, forceToolbarDockingWithoutAnalytics as _forceToolbarDockingWithoutAnalytics } from './pm-plugins/commands';
15
14
  import { selectionToolbarPluginKey } from './pm-plugins/plugin-key';
@@ -147,7 +146,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
147
146
  if (meta) {
148
147
  return _objectSpread(_objectSpread({}, newPluginState), meta);
149
148
  }
150
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
149
+ if (editorExperiment('platform_editor_block_menu', true)) {
151
150
  var _api$userIntent;
152
151
  var isBlockMenuOpen = (api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || (_api$userIntent = _api$userIntent.sharedState.currentState()) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.currentUserIntent) === 'blockMenuOpen';
153
152
  newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
@@ -276,7 +275,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
276
275
  return;
277
276
  }
278
277
  }
279
- if (isBlockMenuOpen && isEditorControlsEnabled && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
278
+ if (isBlockMenuOpen && isEditorControlsEnabled && editorExperiment('platform_editor_block_menu', true)) {
280
279
  // If the block menu is open, do not show the selection toolbar.
281
280
  return;
282
281
  }
@@ -33,7 +33,9 @@ export var PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
33
33
  iconBefore: /*#__PURE__*/React.createElement(PinFilledIcon, {
34
34
  label: "",
35
35
  spacing: "spacious"
36
- }),
36
+ })
37
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
38
+ ,
37
39
  onClick: function onClick() {
38
40
  var _api$core$actions$exe, _api$userPreferences2;
39
41
  return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences2 = api.userPreferences) === null || _api$userPreferences2 === void 0 ? void 0 : _api$userPreferences2.actions.updateUserPreference('toolbarDockingPosition', 'none'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
@@ -51,7 +53,9 @@ export var PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
51
53
  iconBefore: /*#__PURE__*/React.createElement(PinIcon, {
52
54
  label: "",
53
55
  spacing: "spacious"
54
- }),
56
+ })
57
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
58
+ ,
55
59
  onClick: function onClick() {
56
60
  var _api$core$actions$exe2, _api$userPreferences3;
57
61
  return (_api$core$actions$exe2 = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences3 = api.userPreferences) === null || _api$userPreferences3 === void 0 ? void 0 : _api$userPreferences3.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe2 !== void 0 ? _api$core$actions$exe2 : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "9.0.9",
3
+ "version": "9.0.11",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/icon-lab": "^6.0.0",
46
46
  "@atlaskit/menu": "^8.4.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
- "@atlaskit/tmp-editor-statsig": "^43.0.0",
48
+ "@atlaskit/tmp-editor-statsig": "^44.0.0",
49
49
  "@atlaskit/tokens": "^11.1.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "bind-event-listener": "^3.0.0"