@atlaskit/editor-plugin-selection-toolbar 17.0.6 → 17.0.8

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,17 @@
1
1
  # @atlaskit/editor-plugin-selection-toolbar
2
2
 
3
+ ## 17.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 17.0.7
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 17.0.6
4
16
 
5
17
  ### Patch Changes
@@ -14,7 +14,7 @@ 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 _fg = require("@atlaskit/platform-feature-flags/fg");
17
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
17
+ var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
18
18
  var _commands = require("./pm-plugins/commands");
19
19
  var _pluginKey = require("./pm-plugins/plugin-key");
20
20
  var _PageVisibilityWatcher = require("./ui/PageVisibilityWatcher");
@@ -24,14 +24,14 @@ var _toolbarComponents = require("./ui/toolbar-components");
24
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
25
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
26
  var getToolbarDocking = function getToolbarDocking(contextualFormattingEnabled, userPreferencesProvider) {
27
- if (contextualFormattingEnabled && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
27
+ if (contextualFormattingEnabled && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
28
28
  var _userPreferencesProvi;
29
29
  return (_userPreferencesProvi = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition')) !== null && _userPreferencesProvi !== void 0 ? _userPreferencesProvi : 'none';
30
30
  }
31
31
  return 'top';
32
32
  };
33
33
  var getToolbarDockingV2 = function getToolbarDockingV2(contextualFormattingEnabled, dockingPreference) {
34
- if (contextualFormattingEnabled && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
34
+ if (contextualFormattingEnabled && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
35
35
  return dockingPreference !== null && dockingPreference !== void 0 ? dockingPreference : 'none';
36
36
  }
37
37
  return 'top';
@@ -55,7 +55,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
55
55
  api === null || api === void 0 || (_api$toolbar2 = api.toolbar) === null || _api$toolbar2 === void 0 || _api$toolbar2.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api, true, disablePin));
56
56
  }
57
57
  } else {
58
- if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
58
+ if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
59
59
  exposure: true
60
60
  })) {
61
61
  var _api$primaryToolbar;
@@ -177,7 +177,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
177
177
  if (meta) {
178
178
  return _objectSpread(_objectSpread({}, newPluginState), meta);
179
179
  }
180
- if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
180
+ if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
181
181
  var _api$userIntent;
182
182
  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';
183
183
  newPluginState = _objectSpread(_objectSpread({}, newPluginState), {}, {
@@ -246,7 +246,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
246
246
  if ((0, _fg.fg)('platform_editor_use_preferences_plugin')) {
247
247
  return null;
248
248
  }
249
- if (!isPreferenceInitialized && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
249
+ if (!isPreferenceInitialized && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
250
250
  var toolbarDockingPreference = userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition');
251
251
  if (toolbarDockingPreference !== undefined) {
252
252
  var _api$analytics2;
@@ -289,7 +289,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
289
289
  toolbarDocking = _ref3.toolbarDocking,
290
290
  isBlockMenuOpen = _ref3.isBlockMenuOpen;
291
291
  var isCellSelection = ('$anchorCell' in state.selection);
292
- var isEditorControlsEnabled = (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1');
292
+ var isEditorControlsEnabled = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1');
293
293
  if (state.selection.empty || !selectionStable || hide || state.selection instanceof _state.NodeSelection ||
294
294
  // $anchorCell is only available in CellSelection, this check is to
295
295
  // avoid importing CellSelection from @atlaskit/editor-tables
@@ -306,7 +306,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
306
306
  return;
307
307
  }
308
308
  }
309
- if (isBlockMenuOpen && isEditorControlsEnabled && (0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
309
+ if (isBlockMenuOpen && isEditorControlsEnabled && (0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
310
310
  // If the block menu is open, do not show the selection toolbar.
311
311
  return;
312
312
  }
@@ -342,7 +342,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
342
342
  if (Array.isArray((_resolved$i = resolved[i]) === null || _resolved$i === void 0 ? void 0 : _resolved$i.items)) {
343
343
  items.push.apply(items, (0, _toConsumableArray2.default)(resolved[i].items));
344
344
  }
345
- if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
345
+ if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
346
346
  if (resolved[i] && resolved[i + 1]) {
347
347
  var _resolved;
348
348
  if (((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'annotation') {
@@ -389,13 +389,13 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
389
389
  });
390
390
  }
391
391
  },
392
- contentComponent: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && !(0, _fg.fg)('platform_editor_use_preferences_plugin') ? function () {
392
+ contentComponent: (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') && !(0, _fg.fg)('platform_editor_use_preferences_plugin') ? function () {
393
393
  return /*#__PURE__*/_react.default.createElement(_PageVisibilityWatcher.PageVisibilityWatcher, {
394
394
  api: api,
395
395
  userPreferencesProvider: userPreferencesProvider
396
396
  });
397
397
  } : undefined,
398
- primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
398
+ primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
399
399
  exposure: true
400
400
  }) ? primaryToolbarComponent : undefined
401
401
  };
@@ -5,7 +5,7 @@ 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/fg';
8
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
9
9
  import { setToolbarDocking, toggleToolbar, updateToolbarDocking, forceToolbarDockingWithoutAnalytics } from './pm-plugins/commands';
10
10
  import { selectionToolbarPluginKey } from './pm-plugins/plugin-key';
11
11
  import { PageVisibilityWatcher } from './ui/PageVisibilityWatcher';
@@ -9,7 +9,7 @@ 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/fg';
12
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
12
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
13
13
  import { setToolbarDocking as _setToolbarDocking, toggleToolbar, updateToolbarDocking, forceToolbarDockingWithoutAnalytics as _forceToolbarDockingWithoutAnalytics } from './pm-plugins/commands';
14
14
  import { selectionToolbarPluginKey } from './pm-plugins/plugin-key';
15
15
  import { PageVisibilityWatcher } from './ui/PageVisibilityWatcher';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "17.0.6",
3
+ "version": "17.0.8",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,13 +37,13 @@
37
37
  "@atlaskit/icon-lab": "^7.7.0",
38
38
  "@atlaskit/menu": "^10.1.0",
39
39
  "@atlaskit/platform-feature-flags": "^2.1.0",
40
- "@atlaskit/tmp-editor-statsig": "^166.0.0",
41
- "@atlaskit/tokens": "^16.8.0",
40
+ "@atlaskit/tmp-editor-statsig": "^168.0.0",
41
+ "@atlaskit/tokens": "^16.9.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "bind-event-listener": "^3.0.0"
44
44
  },
45
45
  "peerDependencies": {
46
- "@atlaskit/editor-common": "^120.6.0",
46
+ "@atlaskit/editor-common": "^120.7.0",
47
47
  "react": "^18.2.0 || ^19.2.0",
48
48
  "react-dom": "^18.2.0 || ^19.2.0",
49
49
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"