@atlaskit/editor-plugin-selection-toolbar 7.0.13 → 7.0.15

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,18 @@
1
1
  # @atlaskit/editor-plugin-selection-toolbar
2
2
 
3
+ ## 7.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.0.14
10
+
11
+ ### Patch Changes
12
+
13
+ - [`4b4188d469ef6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b4188d469ef6) -
14
+ Migrate usage of setToolbarDocking to use user preferences
15
+
3
16
  ## 7.0.13
4
17
 
5
18
  ### Patch Changes
@@ -23,6 +23,11 @@ var PinButton = exports.PinButton = function PinButton(_ref) {
23
23
  if (!api || isDisabled) {
24
24
  return;
25
25
  }
26
+ if ((0, _platformFeatureFlags.fg)('platform_editor_migrate_toolbar_docking')) {
27
+ var _api$userPreferences;
28
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
29
+ return;
30
+ }
26
31
  (_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
27
32
  };
28
33
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
@@ -59,6 +59,11 @@ var PinMenuItem = exports.PinMenuItem = function PinMenuItem(_ref) {
59
59
  if (!api || isDisabled) {
60
60
  return;
61
61
  }
62
+ if ((0, _platformFeatureFlags.fg)('platform_editor_migrate_toolbar_docking')) {
63
+ var _api$userPreferences;
64
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
65
+ return;
66
+ }
62
67
  if (isToolbarDocked) {
63
68
  var _api$selectionToolbar, _api$selectionToolbar2;
64
69
  (_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
@@ -44,6 +44,10 @@ var PrimaryToolbarComponent = exports.PrimaryToolbarComponent = function Primary
44
44
  }),
45
45
  onClick: function onClick() {
46
46
  var _api$selectionToolbar2, _api$selectionToolbar3, _api$selectionToolbar4;
47
+ if ((0, _platformFeatureFlags.fg)('platform_editor_migrate_toolbar_docking')) {
48
+ var _api$core$actions$exe, _api$userPreferences2;
49
+ 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;
50
+ }
47
51
  return (_api$selectionToolbar2 = api === null || api === void 0 || (_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 || (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 ? void 0 : _api$selectionToolbar4.call(_api$selectionToolbar3, 'none')) !== null && _api$selectionToolbar2 !== void 0 ? _api$selectionToolbar2 : false;
48
52
  },
49
53
  title: intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionPinedAtTop),
@@ -62,6 +66,10 @@ var PrimaryToolbarComponent = exports.PrimaryToolbarComponent = function Primary
62
66
  }),
63
67
  onClick: function onClick() {
64
68
  var _api$selectionToolbar5, _api$selectionToolbar6, _api$selectionToolbar7;
69
+ if ((0, _platformFeatureFlags.fg)('platform_editor_migrate_toolbar_docking')) {
70
+ var _api$core$actions$exe2, _api$userPreferences3;
71
+ 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;
72
+ }
65
73
  return (_api$selectionToolbar5 = api === null || api === void 0 || (_api$selectionToolbar6 = api.selectionToolbar.actions) === null || _api$selectionToolbar6 === void 0 || (_api$selectionToolbar7 = _api$selectionToolbar6.setToolbarDocking) === null || _api$selectionToolbar7 === void 0 ? void 0 : _api$selectionToolbar7.call(_api$selectionToolbar6, 'top')) !== null && _api$selectionToolbar5 !== void 0 ? _api$selectionToolbar5 : false;
66
74
  },
67
75
  title: intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionUnpined),
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _messages = require("@atlaskit/editor-common/messages");
10
10
  var _pin = _interopRequireDefault(require("@atlaskit/icon/core/pin"));
11
11
  var _pinFilled = _interopRequireDefault(require("@atlaskit/icon/core/pin-filled"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var getPinOptionToolbarConfig = exports.getPinOptionToolbarConfig = function getPinOptionToolbarConfig(_ref) {
13
14
  var _api$connectivity;
14
15
  var api = _ref.api,
@@ -25,6 +26,10 @@ var getPinOptionToolbarConfig = exports.getPinOptionToolbarConfig = function get
25
26
  },
26
27
  onClick: function onClick() {
27
28
  var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
29
+ if ((0, _platformFeatureFlags.fg)('platform_editor_migrate_toolbar_docking')) {
30
+ var _api$core$actions$exe, _api$userPreferences;
31
+ return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
32
+ }
28
33
  return (_api$selectionToolbar = api === null || api === void 0 || (_api$selectionToolbar2 = api.selectionToolbar.actions) === null || _api$selectionToolbar2 === void 0 || (_api$selectionToolbar3 = _api$selectionToolbar2.setToolbarDocking) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.call(_api$selectionToolbar2, 'top')) !== null && _api$selectionToolbar !== void 0 ? _api$selectionToolbar : false;
29
34
  },
30
35
  title: intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionUnpined),
@@ -42,6 +47,10 @@ var getPinOptionToolbarConfig = exports.getPinOptionToolbarConfig = function get
42
47
  },
43
48
  onClick: function onClick() {
44
49
  var _api$selectionToolbar4, _api$selectionToolbar5, _api$selectionToolbar6;
50
+ if ((0, _platformFeatureFlags.fg)('platform_editor_migrate_toolbar_docking')) {
51
+ var _api$core$actions$exe2, _api$userPreferences2;
52
+ return (_api$core$actions$exe2 = 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$exe2 !== void 0 ? _api$core$actions$exe2 : false;
53
+ }
45
54
  return (_api$selectionToolbar4 = api === null || api === void 0 || (_api$selectionToolbar5 = api.selectionToolbar.actions) === null || _api$selectionToolbar5 === void 0 || (_api$selectionToolbar6 = _api$selectionToolbar5.setToolbarDocking) === null || _api$selectionToolbar6 === void 0 ? void 0 : _api$selectionToolbar6.call(_api$selectionToolbar5, 'none')) !== null && _api$selectionToolbar4 !== void 0 ? _api$selectionToolbar4 : false;
46
55
  },
47
56
  type: 'button',
@@ -18,6 +18,11 @@ export const PinButton = ({
18
18
  if (!api || isDisabled) {
19
19
  return;
20
20
  }
21
+ if (fg('platform_editor_migrate_toolbar_docking')) {
22
+ var _api$userPreferences;
23
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
24
+ return;
25
+ }
21
26
  (_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 ? void 0 : _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
22
27
  };
23
28
  return /*#__PURE__*/React.createElement(ToolbarTooltip, {
@@ -53,6 +53,11 @@ export const PinMenuItem = ({
53
53
  if (!api || isDisabled) {
54
54
  return;
55
55
  }
56
+ if (fg('platform_editor_migrate_toolbar_docking')) {
57
+ var _api$userPreferences;
58
+ api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
59
+ return;
60
+ }
56
61
  if (isToolbarDocked) {
57
62
  var _api$selectionToolbar, _api$selectionToolbar2;
58
63
  (_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 ? void 0 : _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
@@ -36,6 +36,10 @@ export const PrimaryToolbarComponent = ({
36
36
  }),
37
37
  onClick: () => {
38
38
  var _api$selectionToolbar2, _api$selectionToolbar3, _api$selectionToolbar4;
39
+ if (fg('platform_editor_migrate_toolbar_docking')) {
40
+ var _api$core$actions$exe, _api$userPreferences2;
41
+ 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;
42
+ }
39
43
  return (_api$selectionToolbar2 = api === null || api === void 0 ? void 0 : (_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 ? void 0 : (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 ? void 0 : _api$selectionToolbar4.call(_api$selectionToolbar3, 'none')) !== null && _api$selectionToolbar2 !== void 0 ? _api$selectionToolbar2 : false;
40
44
  },
41
45
  title: intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop),
@@ -54,6 +58,10 @@ export const PrimaryToolbarComponent = ({
54
58
  }),
55
59
  onClick: () => {
56
60
  var _api$selectionToolbar5, _api$selectionToolbar6, _api$selectionToolbar7;
61
+ if (fg('platform_editor_migrate_toolbar_docking')) {
62
+ var _api$core$actions$exe2, _api$userPreferences3;
63
+ 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;
64
+ }
57
65
  return (_api$selectionToolbar5 = api === null || api === void 0 ? void 0 : (_api$selectionToolbar6 = api.selectionToolbar.actions) === null || _api$selectionToolbar6 === void 0 ? void 0 : (_api$selectionToolbar7 = _api$selectionToolbar6.setToolbarDocking) === null || _api$selectionToolbar7 === void 0 ? void 0 : _api$selectionToolbar7.call(_api$selectionToolbar6, 'top')) !== null && _api$selectionToolbar5 !== void 0 ? _api$selectionToolbar5 : false;
58
66
  },
59
67
  title: intl.formatMessage(selectionToolbarMessages.toolbarPositionUnpined),
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { selectionToolbarMessages } from '@atlaskit/editor-common/messages';
3
3
  import PinIcon from '@atlaskit/icon/core/pin';
4
4
  import PinFilledIcon from '@atlaskit/icon/core/pin-filled';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  export const getPinOptionToolbarConfig = ({
6
7
  api,
7
8
  toolbarDocking,
@@ -17,6 +18,10 @@ export const getPinOptionToolbarConfig = ({
17
18
  }),
18
19
  onClick: () => {
19
20
  var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
21
+ if (fg('platform_editor_migrate_toolbar_docking')) {
22
+ var _api$core$actions$exe, _api$userPreferences;
23
+ return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
24
+ }
20
25
  return (_api$selectionToolbar = api === null || api === void 0 ? void 0 : (_api$selectionToolbar2 = api.selectionToolbar.actions) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.setToolbarDocking) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.call(_api$selectionToolbar2, 'top')) !== null && _api$selectionToolbar !== void 0 ? _api$selectionToolbar : false;
21
26
  },
22
27
  title: intl.formatMessage(selectionToolbarMessages.toolbarPositionUnpined),
@@ -32,6 +37,10 @@ export const getPinOptionToolbarConfig = ({
32
37
  }),
33
38
  onClick: () => {
34
39
  var _api$selectionToolbar4, _api$selectionToolbar5, _api$selectionToolbar6;
40
+ if (fg('platform_editor_migrate_toolbar_docking')) {
41
+ var _api$core$actions$exe2, _api$userPreferences2;
42
+ return (_api$core$actions$exe2 = 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$exe2 !== void 0 ? _api$core$actions$exe2 : false;
43
+ }
35
44
  return (_api$selectionToolbar4 = api === null || api === void 0 ? void 0 : (_api$selectionToolbar5 = api.selectionToolbar.actions) === null || _api$selectionToolbar5 === void 0 ? void 0 : (_api$selectionToolbar6 = _api$selectionToolbar5.setToolbarDocking) === null || _api$selectionToolbar6 === void 0 ? void 0 : _api$selectionToolbar6.call(_api$selectionToolbar5, 'none')) !== null && _api$selectionToolbar4 !== void 0 ? _api$selectionToolbar4 : false;
36
45
  },
37
46
  type: 'button',
@@ -16,6 +16,11 @@ export var PinButton = function PinButton(_ref) {
16
16
  if (!api || isDisabled) {
17
17
  return;
18
18
  }
19
+ if (fg('platform_editor_migrate_toolbar_docking')) {
20
+ var _api$userPreferences;
21
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'none'));
22
+ return;
23
+ }
19
24
  (_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
20
25
  };
21
26
  return /*#__PURE__*/React.createElement(ToolbarTooltip, {
@@ -52,6 +52,11 @@ export var PinMenuItem = function PinMenuItem(_ref) {
52
52
  if (!api || isDisabled) {
53
53
  return;
54
54
  }
55
+ if (fg('platform_editor_migrate_toolbar_docking')) {
56
+ var _api$userPreferences;
57
+ api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', isToolbarDocked ? 'none' : 'top'));
58
+ return;
59
+ }
55
60
  if (isToolbarDocked) {
56
61
  var _api$selectionToolbar, _api$selectionToolbar2;
57
62
  (_api$selectionToolbar = api.selectionToolbar.actions) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar2 = _api$selectionToolbar.setToolbarDocking) === null || _api$selectionToolbar2 === void 0 || _api$selectionToolbar2.call(_api$selectionToolbar, 'none');
@@ -35,6 +35,10 @@ export var PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
35
35
  }),
36
36
  onClick: function onClick() {
37
37
  var _api$selectionToolbar2, _api$selectionToolbar3, _api$selectionToolbar4;
38
+ if (fg('platform_editor_migrate_toolbar_docking')) {
39
+ var _api$core$actions$exe, _api$userPreferences2;
40
+ 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;
41
+ }
38
42
  return (_api$selectionToolbar2 = api === null || api === void 0 || (_api$selectionToolbar3 = api.selectionToolbar.actions) === null || _api$selectionToolbar3 === void 0 || (_api$selectionToolbar4 = _api$selectionToolbar3.setToolbarDocking) === null || _api$selectionToolbar4 === void 0 ? void 0 : _api$selectionToolbar4.call(_api$selectionToolbar3, 'none')) !== null && _api$selectionToolbar2 !== void 0 ? _api$selectionToolbar2 : false;
39
43
  },
40
44
  title: intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop),
@@ -53,6 +57,10 @@ export var PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
53
57
  }),
54
58
  onClick: function onClick() {
55
59
  var _api$selectionToolbar5, _api$selectionToolbar6, _api$selectionToolbar7;
60
+ if (fg('platform_editor_migrate_toolbar_docking')) {
61
+ var _api$core$actions$exe2, _api$userPreferences3;
62
+ 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;
63
+ }
56
64
  return (_api$selectionToolbar5 = api === null || api === void 0 || (_api$selectionToolbar6 = api.selectionToolbar.actions) === null || _api$selectionToolbar6 === void 0 || (_api$selectionToolbar7 = _api$selectionToolbar6.setToolbarDocking) === null || _api$selectionToolbar7 === void 0 ? void 0 : _api$selectionToolbar7.call(_api$selectionToolbar6, 'top')) !== null && _api$selectionToolbar5 !== void 0 ? _api$selectionToolbar5 : false;
57
65
  },
58
66
  title: intl.formatMessage(selectionToolbarMessages.toolbarPositionUnpined),
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { selectionToolbarMessages } from '@atlaskit/editor-common/messages';
3
3
  import PinIcon from '@atlaskit/icon/core/pin';
4
4
  import PinFilledIcon from '@atlaskit/icon/core/pin-filled';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  export var getPinOptionToolbarConfig = function getPinOptionToolbarConfig(_ref) {
6
7
  var _api$connectivity;
7
8
  var api = _ref.api,
@@ -18,6 +19,10 @@ export var getPinOptionToolbarConfig = function getPinOptionToolbarConfig(_ref)
18
19
  },
19
20
  onClick: function onClick() {
20
21
  var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
22
+ if (fg('platform_editor_migrate_toolbar_docking')) {
23
+ var _api$core$actions$exe, _api$userPreferences;
24
+ return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.actions.updateUserPreference('toolbarDockingPosition', 'top'))) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
25
+ }
21
26
  return (_api$selectionToolbar = api === null || api === void 0 || (_api$selectionToolbar2 = api.selectionToolbar.actions) === null || _api$selectionToolbar2 === void 0 || (_api$selectionToolbar3 = _api$selectionToolbar2.setToolbarDocking) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.call(_api$selectionToolbar2, 'top')) !== null && _api$selectionToolbar !== void 0 ? _api$selectionToolbar : false;
22
27
  },
23
28
  title: intl.formatMessage(selectionToolbarMessages.toolbarPositionUnpined),
@@ -35,6 +40,10 @@ export var getPinOptionToolbarConfig = function getPinOptionToolbarConfig(_ref)
35
40
  },
36
41
  onClick: function onClick() {
37
42
  var _api$selectionToolbar4, _api$selectionToolbar5, _api$selectionToolbar6;
43
+ if (fg('platform_editor_migrate_toolbar_docking')) {
44
+ var _api$core$actions$exe2, _api$userPreferences2;
45
+ return (_api$core$actions$exe2 = 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$exe2 !== void 0 ? _api$core$actions$exe2 : false;
46
+ }
38
47
  return (_api$selectionToolbar4 = api === null || api === void 0 || (_api$selectionToolbar5 = api.selectionToolbar.actions) === null || _api$selectionToolbar5 === void 0 || (_api$selectionToolbar6 = _api$selectionToolbar5.setToolbarDocking) === null || _api$selectionToolbar6 === void 0 ? void 0 : _api$selectionToolbar6.call(_api$selectionToolbar5, 'none')) !== null && _api$selectionToolbar4 !== void 0 ? _api$selectionToolbar4 : false;
39
48
  },
40
49
  type: 'button',
@@ -17,6 +17,10 @@ export type SelectionToolbarPluginOptions = {
17
17
  export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
18
18
  actions?: {
19
19
  forceToolbarDockingWithoutAnalytics?: (toolbarDocking: ToolbarDocking) => boolean;
20
+ /**
21
+ * @private
22
+ * @deprecated not in use
23
+ */
20
24
  refreshToolbarDocking?: () => boolean;
21
25
  /**
22
26
  * @private
@@ -17,6 +17,10 @@ export type SelectionToolbarPluginOptions = {
17
17
  export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
18
18
  actions?: {
19
19
  forceToolbarDockingWithoutAnalytics?: (toolbarDocking: ToolbarDocking) => boolean;
20
+ /**
21
+ * @private
22
+ * @deprecated not in use
23
+ */
20
24
  refreshToolbarDocking?: () => boolean;
21
25
  /**
22
26
  * @private
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "7.0.13",
3
+ "version": "7.0.15",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,8 +30,8 @@
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
32
  "@atlaskit/css": "^0.15.0",
33
- "@atlaskit/editor-plugin-analytics": "^6.1.0",
34
- "@atlaskit/editor-plugin-block-controls": "^7.2.0",
33
+ "@atlaskit/editor-plugin-analytics": "^6.2.0",
34
+ "@atlaskit/editor-plugin-block-controls": "^7.4.0",
35
35
  "@atlaskit/editor-plugin-connectivity": "^6.0.0",
36
36
  "@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
37
37
  "@atlaskit/editor-plugin-primary-toolbar": "^7.0.0",
@@ -39,20 +39,20 @@
39
39
  "@atlaskit/editor-plugin-user-intent": "^4.0.0",
40
40
  "@atlaskit/editor-plugin-user-preferences": "^4.0.0",
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
- "@atlaskit/editor-toolbar": "^0.15.0",
42
+ "@atlaskit/editor-toolbar": "^0.16.0",
43
43
  "@atlaskit/editor-toolbar-model": "^0.2.0",
44
44
  "@atlaskit/icon": "^28.5.0",
45
45
  "@atlaskit/icon-lab": "^5.10.0",
46
46
  "@atlaskit/menu": "^8.4.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
49
- "@atlaskit/tmp-editor-statsig": "^13.13.0",
49
+ "@atlaskit/tmp-editor-statsig": "^13.18.0",
50
50
  "@atlaskit/tokens": "^7.0.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "bind-event-listener": "^3.0.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^110.13.0",
55
+ "@atlaskit/editor-common": "^110.16.0",
56
56
  "react": "^18.2.0",
57
57
  "react-dom": "^18.2.0",
58
58
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -110,6 +110,9 @@
110
110
  },
111
111
  "platform_editor_lcm_toolbar_docking_fix": {
112
112
  "type": "boolean"
113
+ },
114
+ "platform_editor_migrate_toolbar_docking": {
115
+ "type": "boolean"
113
116
  }
114
117
  }
115
118
  }