@atlaskit/editor-plugin-selection-toolbar 2.0.9 → 2.1.1

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,30 @@
1
1
  # @atlaskit/editor-plugin-selection-toolbar
2
2
 
3
+ ## 2.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#127441](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/127441)
8
+ [`f2f4b5971e0b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2f4b5971e0b2) -
9
+ [ux] Updates Text Formatting toolbar separators, active option style and removes range selection
10
+ when the toolbar is docked to top.
11
+ - Updated dependencies
12
+
13
+ ## 2.1.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#126588](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/126588)
18
+ [`d4160d5f8b246`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d4160d5f8b246) -
19
+ ED-26876 implement editor api for user preference
20
+
21
+ ### Patch Changes
22
+
23
+ - [#126588](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/126588)
24
+ [`d4160d5f8b246`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d4160d5f8b246) -
25
+ ED-26876 add tests for selectionToolbarPlugin
26
+ - Updated dependencies
27
+
3
28
  ## 2.0.9
4
29
 
5
30
  ### Patch Changes
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.toggleToolbar = exports.setToolbarDocking = void 0;
7
+ var _state = require("@atlaskit/editor-prosemirror/state");
7
8
  var _pluginKey = require("./plugin-key");
8
9
  var toggleToolbar = exports.toggleToolbar = function toggleToolbar(_ref) {
9
10
  var hide = _ref.hide;
@@ -16,12 +17,19 @@ var toggleToolbar = exports.toggleToolbar = function toggleToolbar(_ref) {
16
17
  };
17
18
  };
18
19
  var setToolbarDocking = exports.setToolbarDocking = function setToolbarDocking(_ref3) {
19
- var toolbarDocking = _ref3.toolbarDocking;
20
+ var toolbarDocking = _ref3.toolbarDocking,
21
+ userPreferencesProvider = _ref3.userPreferencesProvider;
20
22
  return function (_ref4) {
21
23
  var tr = _ref4.tr;
24
+ // We currently ignore any update failures, need to confirm this is the desired behaviour
25
+ userPreferencesProvider === null || userPreferencesProvider === void 0 || userPreferencesProvider.updatePreference('toolbarDockingInitialPosition', toolbarDocking);
22
26
  tr.setMeta(_pluginKey.selectionToolbarPluginKey, {
23
27
  toolbarDocking: toolbarDocking
24
28
  });
29
+ if (toolbarDocking === 'top') {
30
+ // Remove the selection if the toolbar is docked to the top
31
+ tr.setSelection(_state.TextSelection.create(tr.doc, tr.selection.head));
32
+ }
25
33
  return tr;
26
34
  };
27
35
  };
@@ -24,6 +24,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
24
24
  config = _ref.config;
25
25
  var __selectionToolbarHandlers = [];
26
26
  var primaryToolbarComponent;
27
+ var userPreferencesProvider = config.userPreferencesProvider;
27
28
  if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
28
29
  exposure: true
29
30
  })) {
@@ -62,7 +63,8 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
62
63
  setToolbarDocking: function setToolbarDocking(toolbarDocking) {
63
64
  var _api$core$actions$exe3;
64
65
  return (_api$core$actions$exe3 = api === null || api === void 0 ? void 0 : api.core.actions.execute((0, _commands.setToolbarDocking)({
65
- toolbarDocking: toolbarDocking
66
+ toolbarDocking: toolbarDocking,
67
+ userPreferencesProvider: userPreferencesProvider
66
68
  }))) !== null && _api$core$actions$exe3 !== void 0 ? _api$core$actions$exe3 : false;
67
69
  }
68
70
  },
@@ -83,10 +85,14 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
83
85
  key: _pluginKey.selectionToolbarPluginKey,
84
86
  state: {
85
87
  init: function init() {
88
+ var toolbarDocking = 'top';
89
+ if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
90
+ toolbarDocking = (userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition')) || 'none';
91
+ }
86
92
  return {
87
93
  selectionStable: false,
88
94
  hide: false,
89
- toolbarDocking: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? 'none' : 'top'
95
+ toolbarDocking: toolbarDocking
90
96
  };
91
97
  },
92
98
  apply: function apply(tr, pluginState) {
@@ -188,15 +194,22 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
188
194
  items.push.apply(items, (0, _toConsumableArray2.default)(resolved[i].items));
189
195
  }
190
196
  if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
191
- var shouldNotAddSeparator = false;
192
197
  if (resolved[i] && resolved[i + 1]) {
193
- var _resolved$i2, _resolved, _resolved$i3, _resolved2;
194
- shouldNotAddSeparator = ((_resolved$i2 = resolved[i]) === null || _resolved$i2 === void 0 ? void 0 : _resolved$i2.pluginName) === 'textColor' && ((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'highlight' || ((_resolved$i3 = resolved[i]) === null || _resolved$i3 === void 0 ? void 0 : _resolved$i3.pluginName) === 'alignment' && ((_resolved2 = resolved[i + 1]) === null || _resolved2 === void 0 ? void 0 : _resolved2.pluginName) === 'toolbarListsIndentation';
195
- }
196
- if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
197
- items.push({
198
- type: 'separator'
199
- });
198
+ var _resolved$i2, _resolved, _resolved$i3, _resolved2, _resolved3;
199
+ var shouldNotAddSeparator = ((_resolved$i2 = resolved[i]) === null || _resolved$i2 === void 0 ? void 0 : _resolved$i2.pluginName) === 'textColor' && ((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'highlight' || ((_resolved$i3 = resolved[i]) === null || _resolved$i3 === void 0 ? void 0 : _resolved$i3.pluginName) === 'alignment' && ((_resolved2 = resolved[i + 1]) === null || _resolved2 === void 0 ? void 0 : _resolved2.pluginName) === 'toolbarListsIndentation';
200
+ if (((_resolved3 = resolved[i + 1]) === null || _resolved3 === void 0 ? void 0 : _resolved3.pluginName) === 'annotation') {
201
+ items.push({
202
+ type: 'separator',
203
+ fullHeight: true
204
+ });
205
+ } else {
206
+ if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
207
+ items.push({
208
+ type: 'separator',
209
+ fullHeight: false
210
+ });
211
+ }
212
+ }
200
213
  }
201
214
  } else {
202
215
  if (i !== resolved.length - 1) {
@@ -1 +1,5 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -75,7 +75,8 @@ var getOverflowFloatingToolbarConfig = exports.getOverflowFloatingToolbarConfig
75
75
  });
76
76
  }
77
77
  return [{
78
- type: 'separator'
78
+ type: 'separator',
79
+ fullHeight: true
79
80
  }, {
80
81
  type: 'overflow-dropdown',
81
82
  dropdownWidth: 240,
@@ -1,3 +1,4 @@
1
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
1
2
  import { selectionToolbarPluginKey } from './plugin-key';
2
3
  export const toggleToolbar = ({
3
4
  hide
@@ -10,12 +11,19 @@ export const toggleToolbar = ({
10
11
  return tr;
11
12
  };
12
13
  export const setToolbarDocking = ({
13
- toolbarDocking
14
+ toolbarDocking,
15
+ userPreferencesProvider
14
16
  }) => ({
15
17
  tr
16
18
  }) => {
19
+ // We currently ignore any update failures, need to confirm this is the desired behaviour
20
+ userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.updatePreference('toolbarDockingInitialPosition', toolbarDocking);
17
21
  tr.setMeta(selectionToolbarPluginKey, {
18
22
  toolbarDocking
19
23
  });
24
+ if (toolbarDocking === 'top') {
25
+ // Remove the selection if the toolbar is docked to the top
26
+ tr.setSelection(TextSelection.create(tr.doc, tr.selection.head));
27
+ }
20
28
  return tr;
21
29
  };
@@ -14,6 +14,9 @@ export const selectionToolbarPlugin = ({
14
14
  }) => {
15
15
  const __selectionToolbarHandlers = [];
16
16
  let primaryToolbarComponent;
17
+ const {
18
+ userPreferencesProvider
19
+ } = config;
17
20
  if (editorExperiment('platform_editor_controls', 'variant1', {
18
21
  exposure: true
19
22
  })) {
@@ -51,7 +54,8 @@ export const selectionToolbarPlugin = ({
51
54
  setToolbarDocking: toolbarDocking => {
52
55
  var _api$core$actions$exe3;
53
56
  return (_api$core$actions$exe3 = api === null || api === void 0 ? void 0 : api.core.actions.execute(setToolbarDocking({
54
- toolbarDocking
57
+ toolbarDocking,
58
+ userPreferencesProvider
55
59
  }))) !== null && _api$core$actions$exe3 !== void 0 ? _api$core$actions$exe3 : false;
56
60
  }
57
61
  },
@@ -72,10 +76,14 @@ export const selectionToolbarPlugin = ({
72
76
  key: selectionToolbarPluginKey,
73
77
  state: {
74
78
  init() {
79
+ let toolbarDocking = 'top';
80
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
81
+ toolbarDocking = (userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition')) || 'none';
82
+ }
75
83
  return {
76
84
  selectionStable: false,
77
85
  hide: false,
78
- toolbarDocking: editorExperiment('platform_editor_controls', 'variant1') ? 'none' : 'top'
86
+ toolbarDocking
79
87
  };
80
88
  },
81
89
  apply(tr, pluginState) {
@@ -177,15 +185,22 @@ export const selectionToolbarPlugin = ({
177
185
  items.push(...resolved[i].items);
178
186
  }
179
187
  if (editorExperiment('platform_editor_controls', 'variant1')) {
180
- let shouldNotAddSeparator = false;
181
188
  if (resolved[i] && resolved[i + 1]) {
182
- var _resolved$i2, _resolved, _resolved$i3, _resolved2;
183
- shouldNotAddSeparator = ((_resolved$i2 = resolved[i]) === null || _resolved$i2 === void 0 ? void 0 : _resolved$i2.pluginName) === 'textColor' && ((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'highlight' || ((_resolved$i3 = resolved[i]) === null || _resolved$i3 === void 0 ? void 0 : _resolved$i3.pluginName) === 'alignment' && ((_resolved2 = resolved[i + 1]) === null || _resolved2 === void 0 ? void 0 : _resolved2.pluginName) === 'toolbarListsIndentation';
184
- }
185
- if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
186
- items.push({
187
- type: 'separator'
188
- });
189
+ var _resolved$i2, _resolved, _resolved$i3, _resolved2, _resolved3;
190
+ const shouldNotAddSeparator = ((_resolved$i2 = resolved[i]) === null || _resolved$i2 === void 0 ? void 0 : _resolved$i2.pluginName) === 'textColor' && ((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'highlight' || ((_resolved$i3 = resolved[i]) === null || _resolved$i3 === void 0 ? void 0 : _resolved$i3.pluginName) === 'alignment' && ((_resolved2 = resolved[i + 1]) === null || _resolved2 === void 0 ? void 0 : _resolved2.pluginName) === 'toolbarListsIndentation';
191
+ if (((_resolved3 = resolved[i + 1]) === null || _resolved3 === void 0 ? void 0 : _resolved3.pluginName) === 'annotation') {
192
+ items.push({
193
+ type: 'separator',
194
+ fullHeight: true
195
+ });
196
+ } else {
197
+ if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
198
+ items.push({
199
+ type: 'separator',
200
+ fullHeight: false
201
+ });
202
+ }
203
+ }
189
204
  }
190
205
  } else {
191
206
  if (i !== resolved.length - 1) {
@@ -0,0 +1 @@
1
+ export {};
@@ -68,7 +68,8 @@ export const getOverflowFloatingToolbarConfig = ({
68
68
  });
69
69
  }
70
70
  return [{
71
- type: 'separator'
71
+ type: 'separator',
72
+ fullHeight: true
72
73
  }, {
73
74
  type: 'overflow-dropdown',
74
75
  dropdownWidth: 240,
@@ -1,3 +1,4 @@
1
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
1
2
  import { selectionToolbarPluginKey } from './plugin-key';
2
3
  export var toggleToolbar = function toggleToolbar(_ref) {
3
4
  var hide = _ref.hide;
@@ -10,12 +11,19 @@ export var toggleToolbar = function toggleToolbar(_ref) {
10
11
  };
11
12
  };
12
13
  export var setToolbarDocking = function setToolbarDocking(_ref3) {
13
- var toolbarDocking = _ref3.toolbarDocking;
14
+ var toolbarDocking = _ref3.toolbarDocking,
15
+ userPreferencesProvider = _ref3.userPreferencesProvider;
14
16
  return function (_ref4) {
15
17
  var tr = _ref4.tr;
18
+ // We currently ignore any update failures, need to confirm this is the desired behaviour
19
+ userPreferencesProvider === null || userPreferencesProvider === void 0 || userPreferencesProvider.updatePreference('toolbarDockingInitialPosition', toolbarDocking);
16
20
  tr.setMeta(selectionToolbarPluginKey, {
17
21
  toolbarDocking: toolbarDocking
18
22
  });
23
+ if (toolbarDocking === 'top') {
24
+ // Remove the selection if the toolbar is docked to the top
25
+ tr.setSelection(TextSelection.create(tr.doc, tr.selection.head));
26
+ }
19
27
  return tr;
20
28
  };
21
29
  };
@@ -17,6 +17,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
17
17
  config = _ref.config;
18
18
  var __selectionToolbarHandlers = [];
19
19
  var primaryToolbarComponent;
20
+ var userPreferencesProvider = config.userPreferencesProvider;
20
21
  if (editorExperiment('platform_editor_controls', 'variant1', {
21
22
  exposure: true
22
23
  })) {
@@ -55,7 +56,8 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
55
56
  setToolbarDocking: function setToolbarDocking(toolbarDocking) {
56
57
  var _api$core$actions$exe3;
57
58
  return (_api$core$actions$exe3 = api === null || api === void 0 ? void 0 : api.core.actions.execute(_setToolbarDocking({
58
- toolbarDocking: toolbarDocking
59
+ toolbarDocking: toolbarDocking,
60
+ userPreferencesProvider: userPreferencesProvider
59
61
  }))) !== null && _api$core$actions$exe3 !== void 0 ? _api$core$actions$exe3 : false;
60
62
  }
61
63
  },
@@ -76,10 +78,14 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
76
78
  key: selectionToolbarPluginKey,
77
79
  state: {
78
80
  init: function init() {
81
+ var toolbarDocking = 'top';
82
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
83
+ toolbarDocking = (userPreferencesProvider === null || userPreferencesProvider === void 0 ? void 0 : userPreferencesProvider.getPreference('toolbarDockingInitialPosition')) || 'none';
84
+ }
79
85
  return {
80
86
  selectionStable: false,
81
87
  hide: false,
82
- toolbarDocking: editorExperiment('platform_editor_controls', 'variant1') ? 'none' : 'top'
88
+ toolbarDocking: toolbarDocking
83
89
  };
84
90
  },
85
91
  apply: function apply(tr, pluginState) {
@@ -181,15 +187,22 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
181
187
  items.push.apply(items, _toConsumableArray(resolved[i].items));
182
188
  }
183
189
  if (editorExperiment('platform_editor_controls', 'variant1')) {
184
- var shouldNotAddSeparator = false;
185
190
  if (resolved[i] && resolved[i + 1]) {
186
- var _resolved$i2, _resolved, _resolved$i3, _resolved2;
187
- shouldNotAddSeparator = ((_resolved$i2 = resolved[i]) === null || _resolved$i2 === void 0 ? void 0 : _resolved$i2.pluginName) === 'textColor' && ((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'highlight' || ((_resolved$i3 = resolved[i]) === null || _resolved$i3 === void 0 ? void 0 : _resolved$i3.pluginName) === 'alignment' && ((_resolved2 = resolved[i + 1]) === null || _resolved2 === void 0 ? void 0 : _resolved2.pluginName) === 'toolbarListsIndentation';
188
- }
189
- if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
190
- items.push({
191
- type: 'separator'
192
- });
191
+ var _resolved$i2, _resolved, _resolved$i3, _resolved2, _resolved3;
192
+ var shouldNotAddSeparator = ((_resolved$i2 = resolved[i]) === null || _resolved$i2 === void 0 ? void 0 : _resolved$i2.pluginName) === 'textColor' && ((_resolved = resolved[i + 1]) === null || _resolved === void 0 ? void 0 : _resolved.pluginName) === 'highlight' || ((_resolved$i3 = resolved[i]) === null || _resolved$i3 === void 0 ? void 0 : _resolved$i3.pluginName) === 'alignment' && ((_resolved2 = resolved[i + 1]) === null || _resolved2 === void 0 ? void 0 : _resolved2.pluginName) === 'toolbarListsIndentation';
193
+ if (((_resolved3 = resolved[i + 1]) === null || _resolved3 === void 0 ? void 0 : _resolved3.pluginName) === 'annotation') {
194
+ items.push({
195
+ type: 'separator',
196
+ fullHeight: true
197
+ });
198
+ } else {
199
+ if (i !== resolved.length - 1 && !shouldNotAddSeparator) {
200
+ items.push({
201
+ type: 'separator',
202
+ fullHeight: false
203
+ });
204
+ }
205
+ }
193
206
  }
194
207
  } else {
195
208
  if (i !== resolved.length - 1) {
@@ -0,0 +1 @@
1
+ export {};
@@ -67,7 +67,8 @@ export var getOverflowFloatingToolbarConfig = function getOverflowFloatingToolba
67
67
  });
68
68
  }
69
69
  return [{
70
- type: 'separator'
70
+ type: 'separator',
71
+ fullHeight: true
71
72
  }, {
72
73
  type: 'overflow-dropdown',
73
74
  dropdownWidth: 240,
@@ -1,8 +1,9 @@
1
- import type { EditorCommand } from '@atlaskit/editor-common/types';
1
+ import type { EditorCommand, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
2
  import type { ToolbarDocking } from '../types';
3
3
  export declare const toggleToolbar: ({ hide }: {
4
4
  hide: boolean;
5
5
  }) => EditorCommand;
6
- export declare const setToolbarDocking: ({ toolbarDocking }: {
6
+ export declare const setToolbarDocking: ({ toolbarDocking, userPreferencesProvider, }: {
7
7
  toolbarDocking: ToolbarDocking;
8
+ userPreferencesProvider?: UserPreferencesProvider | undefined;
8
9
  }) => EditorCommand;
@@ -1,4 +1,4 @@
1
- import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
1
+ import type { NextEditorPlugin, OptionalPlugin, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
2
  import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
3
3
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
4
4
  import type { ToolbarDocking } from './types';
@@ -11,6 +11,7 @@ export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
11
11
  * Defaults to false
12
12
  */
13
13
  preferenceToolbarAboveSelection?: boolean;
14
+ userPreferencesProvider?: UserPreferencesProvider;
14
15
  };
15
16
  dependencies: [OptionalPlugin<EditorViewModePlugin>, OptionalPlugin<PrimaryToolbarPlugin>];
16
17
  actions?: {
@@ -1,7 +1,8 @@
1
+ import { UserPreferences } from '@atlaskit/editor-common/types';
1
2
  export type SelectionToolbarPluginOptions = {
2
3
  /**
3
4
  * When set to true, placing the toolbar above the selection will be preferenced.
4
5
  */
5
6
  preferenceToolbarAboveSelection?: boolean;
6
7
  };
7
- export type ToolbarDocking = 'top' | 'none';
8
+ export type ToolbarDocking = NonNullable<UserPreferences['toolbarDockingInitialPosition']>;
@@ -1,8 +1,9 @@
1
- import type { EditorCommand } from '@atlaskit/editor-common/types';
1
+ import type { EditorCommand, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
2
  import type { ToolbarDocking } from '../types';
3
3
  export declare const toggleToolbar: ({ hide }: {
4
4
  hide: boolean;
5
5
  }) => EditorCommand;
6
- export declare const setToolbarDocking: ({ toolbarDocking }: {
6
+ export declare const setToolbarDocking: ({ toolbarDocking, userPreferencesProvider, }: {
7
7
  toolbarDocking: ToolbarDocking;
8
+ userPreferencesProvider?: UserPreferencesProvider | undefined;
8
9
  }) => EditorCommand;
@@ -1,4 +1,4 @@
1
- import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
1
+ import type { NextEditorPlugin, OptionalPlugin, UserPreferencesProvider } from '@atlaskit/editor-common/types';
2
2
  import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
3
3
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
4
4
  import type { ToolbarDocking } from './types';
@@ -11,6 +11,7 @@ export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
11
11
  * Defaults to false
12
12
  */
13
13
  preferenceToolbarAboveSelection?: boolean;
14
+ userPreferencesProvider?: UserPreferencesProvider;
14
15
  };
15
16
  dependencies: [
16
17
  OptionalPlugin<EditorViewModePlugin>,
@@ -1,7 +1,8 @@
1
+ import { UserPreferences } from '@atlaskit/editor-common/types';
1
2
  export type SelectionToolbarPluginOptions = {
2
3
  /**
3
4
  * When set to true, placing the toolbar above the selection will be preferenced.
4
5
  */
5
6
  preferenceToolbarAboveSelection?: boolean;
6
7
  };
7
- export type ToolbarDocking = 'top' | 'none';
8
+ export type ToolbarDocking = NonNullable<UserPreferences['toolbarDockingInitialPosition']>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "2.0.9",
3
+ "version": "2.1.1",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,14 +33,14 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/editor-common": "^102.8.0",
36
+ "@atlaskit/editor-common": "^102.10.0",
37
37
  "@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
38
38
  "@atlaskit/editor-plugin-primary-toolbar": "^3.0.0",
39
39
  "@atlaskit/editor-prosemirror": "7.0.0",
40
40
  "@atlaskit/icon": "^25.0.0",
41
41
  "@atlaskit/menu": "^3.1.0",
42
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^4.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^4.1.0",
44
44
  "@atlaskit/tokens": "^4.5.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@emotion/react": "^11.7.1",