@atlaskit/editor-plugin-selection-toolbar 4.3.8 → 4.3.10

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,21 @@
1
1
  # @atlaskit/editor-plugin-selection-toolbar
2
2
 
3
+ ## 4.3.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+ - Updated dependencies
10
+
11
+ ## 4.3.9
12
+
13
+ ### Patch Changes
14
+
15
+ - [`b27824f2875be`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b27824f2875be) -
16
+ [ux] [ED-28821] Add pin button to full page primary toolbar
17
+ - Updated dependencies
18
+
3
19
  ## 4.3.8
4
20
 
5
21
  ### Patch Changes
@@ -47,7 +47,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
47
47
  contextualFormattingEnabled = config.contextualFormattingEnabled;
48
48
  if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc', 'isEnabled', true)) {
49
49
  var _api$toolbar;
50
- api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api));
50
+ api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api, contextualFormattingEnabled));
51
51
  } else {
52
52
  if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
53
53
  exposure: true
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.PinButton = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactIntlNext = require("react-intl-next");
10
+ var _messages = require("@atlaskit/editor-common/messages");
11
+ var _editorToolbar = require("@atlaskit/editor-toolbar");
12
+ var PinButton = exports.PinButton = function PinButton(_ref) {
13
+ var api = _ref.api;
14
+ var intl = (0, _reactIntlNext.useIntl)();
15
+ var message = intl.formatMessage(_messages.selectionToolbarMessages.toolbarPositionPinedAtTop);
16
+ var onClick = function onClick() {
17
+ var _api$selectionToolbar, _api$selectionToolbar2;
18
+ if (!api) {
19
+ return;
20
+ }
21
+ (_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');
22
+ };
23
+ return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
24
+ content: message
25
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButton, {
26
+ iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.PinnedIcon, {
27
+ size: "small",
28
+ label: ""
29
+ }),
30
+ label: message,
31
+ onClick: onClick
32
+ }));
33
+ };
@@ -7,9 +7,10 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getToolbarComponents = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _toolbar = require("@atlaskit/editor-common/toolbar");
10
+ var _PinButton = require("./PinButton");
10
11
  var _PinMenuItem = require("./PinMenuItem");
11
- var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(api) {
12
- return [{
12
+ var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(api, contextualFormattingEnabled) {
13
+ var components = [{
13
14
  type: _toolbar.PIN_MENU_SECTION.type,
14
15
  key: _toolbar.PIN_MENU_SECTION.key,
15
16
  parents: [{
@@ -31,4 +32,32 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
31
32
  });
32
33
  }
33
34
  }];
35
+
36
+ // Add pin button to primary toolbar when contextual formatting is enabled
37
+ if (contextualFormattingEnabled) {
38
+ var pinButtonComponents = [{
39
+ type: _toolbar.PIN_GROUP.type,
40
+ key: _toolbar.PIN_GROUP.key,
41
+ parents: [{
42
+ type: _toolbar.PIN_SECTION.type,
43
+ key: _toolbar.PIN_SECTION.key,
44
+ rank: _toolbar.PIN_SECTION_RANK[_toolbar.PIN_GROUP.key]
45
+ }]
46
+ }, {
47
+ type: _toolbar.PIN_BUTTON.type,
48
+ key: _toolbar.PIN_BUTTON.key,
49
+ parents: [{
50
+ type: _toolbar.PIN_GROUP.type,
51
+ key: _toolbar.PIN_GROUP.key,
52
+ rank: _toolbar.PIN_GROUP_RANK[_toolbar.PIN_BUTTON.key]
53
+ }],
54
+ component: function component() {
55
+ return /*#__PURE__*/_react.default.createElement(_PinButton.PinButton, {
56
+ api: api
57
+ });
58
+ }
59
+ }];
60
+ components.push.apply(components, pinButtonComponents);
61
+ }
62
+ return components;
34
63
  };
@@ -39,7 +39,7 @@ export const selectionToolbarPlugin = ({
39
39
  } = config;
40
40
  if (expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true)) {
41
41
  var _api$toolbar;
42
- api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents(api));
42
+ api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents(api, contextualFormattingEnabled));
43
43
  } else {
44
44
  if (editorExperiment('platform_editor_controls', 'variant1', {
45
45
  exposure: true
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { selectionToolbarMessages } from '@atlaskit/editor-common/messages';
4
+ import { PinnedIcon, ToolbarButton, ToolbarTooltip } from '@atlaskit/editor-toolbar';
5
+ export const PinButton = ({
6
+ api
7
+ }) => {
8
+ const intl = useIntl();
9
+ const message = intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop);
10
+ const onClick = () => {
11
+ var _api$selectionToolbar, _api$selectionToolbar2;
12
+ if (!api) {
13
+ return;
14
+ }
15
+ (_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');
16
+ };
17
+ return /*#__PURE__*/React.createElement(ToolbarTooltip, {
18
+ content: message
19
+ }, /*#__PURE__*/React.createElement(ToolbarButton, {
20
+ iconBefore: /*#__PURE__*/React.createElement(PinnedIcon, {
21
+ size: "small",
22
+ label: ""
23
+ }),
24
+ label: message,
25
+ onClick: onClick
26
+ }));
27
+ };
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import { OVERFLOW_MENU, OVERFLOW_MENU_RANK, PIN_MENU_ITEM, PIN_MENU_SECTION, PIN_MENU_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
2
+ import { OVERFLOW_MENU, OVERFLOW_MENU_RANK, PIN_BUTTON, PIN_GROUP, PIN_MENU_ITEM, PIN_MENU_SECTION, PIN_MENU_SECTION_RANK, PIN_GROUP_RANK, PIN_SECTION, PIN_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
3
+ import { PinButton } from './PinButton';
3
4
  import { PinMenuItem } from './PinMenuItem';
4
- export const getToolbarComponents = api => {
5
- return [{
5
+ export const getToolbarComponents = (api, contextualFormattingEnabled) => {
6
+ const components = [{
6
7
  type: PIN_MENU_SECTION.type,
7
8
  key: PIN_MENU_SECTION.key,
8
9
  parents: [{
@@ -24,4 +25,32 @@ export const getToolbarComponents = api => {
24
25
  });
25
26
  }
26
27
  }];
28
+
29
+ // Add pin button to primary toolbar when contextual formatting is enabled
30
+ if (contextualFormattingEnabled) {
31
+ const pinButtonComponents = [{
32
+ type: PIN_GROUP.type,
33
+ key: PIN_GROUP.key,
34
+ parents: [{
35
+ type: PIN_SECTION.type,
36
+ key: PIN_SECTION.key,
37
+ rank: PIN_SECTION_RANK[PIN_GROUP.key]
38
+ }]
39
+ }, {
40
+ type: PIN_BUTTON.type,
41
+ key: PIN_BUTTON.key,
42
+ parents: [{
43
+ type: PIN_GROUP.type,
44
+ key: PIN_GROUP.key,
45
+ rank: PIN_GROUP_RANK[PIN_BUTTON.key]
46
+ }],
47
+ component: () => {
48
+ return /*#__PURE__*/React.createElement(PinButton, {
49
+ api: api
50
+ });
51
+ }
52
+ }];
53
+ components.push(...pinButtonComponents);
54
+ }
55
+ return components;
27
56
  };
@@ -40,7 +40,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
40
40
  contextualFormattingEnabled = config.contextualFormattingEnabled;
41
41
  if (expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true)) {
42
42
  var _api$toolbar;
43
- api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents(api));
43
+ api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents(api, contextualFormattingEnabled));
44
44
  } else {
45
45
  if (editorExperiment('platform_editor_controls', 'variant1', {
46
46
  exposure: true
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { selectionToolbarMessages } from '@atlaskit/editor-common/messages';
4
+ import { PinnedIcon, ToolbarButton, ToolbarTooltip } from '@atlaskit/editor-toolbar';
5
+ export var PinButton = function PinButton(_ref) {
6
+ var api = _ref.api;
7
+ var intl = useIntl();
8
+ var message = intl.formatMessage(selectionToolbarMessages.toolbarPositionPinedAtTop);
9
+ var onClick = function onClick() {
10
+ var _api$selectionToolbar, _api$selectionToolbar2;
11
+ if (!api) {
12
+ return;
13
+ }
14
+ (_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');
15
+ };
16
+ return /*#__PURE__*/React.createElement(ToolbarTooltip, {
17
+ content: message
18
+ }, /*#__PURE__*/React.createElement(ToolbarButton, {
19
+ iconBefore: /*#__PURE__*/React.createElement(PinnedIcon, {
20
+ size: "small",
21
+ label: ""
22
+ }),
23
+ label: message,
24
+ onClick: onClick
25
+ }));
26
+ };
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import { OVERFLOW_MENU, OVERFLOW_MENU_RANK, PIN_MENU_ITEM, PIN_MENU_SECTION, PIN_MENU_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
2
+ import { OVERFLOW_MENU, OVERFLOW_MENU_RANK, PIN_BUTTON, PIN_GROUP, PIN_MENU_ITEM, PIN_MENU_SECTION, PIN_MENU_SECTION_RANK, PIN_GROUP_RANK, PIN_SECTION, PIN_SECTION_RANK } from '@atlaskit/editor-common/toolbar';
3
+ import { PinButton } from './PinButton';
3
4
  import { PinMenuItem } from './PinMenuItem';
4
- export var getToolbarComponents = function getToolbarComponents(api) {
5
- return [{
5
+ export var getToolbarComponents = function getToolbarComponents(api, contextualFormattingEnabled) {
6
+ var components = [{
6
7
  type: PIN_MENU_SECTION.type,
7
8
  key: PIN_MENU_SECTION.key,
8
9
  parents: [{
@@ -24,4 +25,32 @@ export var getToolbarComponents = function getToolbarComponents(api) {
24
25
  });
25
26
  }
26
27
  }];
28
+
29
+ // Add pin button to primary toolbar when contextual formatting is enabled
30
+ if (contextualFormattingEnabled) {
31
+ var pinButtonComponents = [{
32
+ type: PIN_GROUP.type,
33
+ key: PIN_GROUP.key,
34
+ parents: [{
35
+ type: PIN_SECTION.type,
36
+ key: PIN_SECTION.key,
37
+ rank: PIN_SECTION_RANK[PIN_GROUP.key]
38
+ }]
39
+ }, {
40
+ type: PIN_BUTTON.type,
41
+ key: PIN_BUTTON.key,
42
+ parents: [{
43
+ type: PIN_GROUP.type,
44
+ key: PIN_GROUP.key,
45
+ rank: PIN_GROUP_RANK[PIN_BUTTON.key]
46
+ }],
47
+ component: function component() {
48
+ return /*#__PURE__*/React.createElement(PinButton, {
49
+ api: api
50
+ });
51
+ }
52
+ }];
53
+ components.push.apply(components, pinButtonComponents);
54
+ }
55
+ return components;
27
56
  };
@@ -7,8 +7,8 @@ import type { PopupPosition as Position } from '@atlaskit/editor-common/ui';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  export declare const calculateToolbarPositionTrackHead: (toolbarTitle: string) => (editorView: EditorView, nextPos: Position) => Position;
9
9
  export type CoordsAtPos = {
10
- top: number;
11
10
  bottom: number;
12
11
  left: number;
13
12
  right: number;
13
+ top: number;
14
14
  };
@@ -8,9 +8,9 @@ export declare const updateToolbarDocking: ({ toolbarDocking }: {
8
8
  toolbarDocking: ToolbarDocking;
9
9
  }) => EditorCommand;
10
10
  export declare const setToolbarDocking: ({ toolbarDocking, userPreferencesProvider, editorAnalyticsApi, }: {
11
+ editorAnalyticsApi?: EditorAnalyticsAPI | undefined;
11
12
  toolbarDocking: ToolbarDocking;
12
13
  userPreferencesProvider?: UserPreferencesProvider;
13
- editorAnalyticsApi?: EditorAnalyticsAPI | undefined;
14
14
  }) => EditorCommand;
15
15
  export declare const forceToolbarDockingWithoutAnalytics: ({ toolbarDocking, userPreferencesProvider, }: {
16
16
  toolbarDocking: ToolbarDocking;
@@ -9,16 +9,23 @@ import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
9
9
  import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
10
10
  import type { ToolbarDocking } from './types';
11
11
  export type SelectionToolbarPluginOptions = {
12
+ contextualFormattingEnabled?: boolean;
12
13
  /** @defaults false */
13
14
  preferenceToolbarAboveSelection?: boolean;
14
15
  userPreferencesProvider?: UserPreferencesProvider;
15
- contextualFormattingEnabled?: boolean;
16
16
  };
17
17
  export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
18
- sharedState: {
19
- toolbarDocking: ToolbarDocking;
18
+ actions?: {
19
+ forceToolbarDockingWithoutAnalytics?: (toolbarDocking: ToolbarDocking) => boolean;
20
+ refreshToolbarDocking?: () => boolean;
21
+ /**
22
+ * @private
23
+ * @deprecated use userPreference API to set toolbar docking instead
24
+ */
25
+ setToolbarDocking?: (toolbarDocking: ToolbarDocking) => boolean;
26
+ suppressToolbar?: () => boolean;
27
+ unsuppressToolbar?: () => boolean;
20
28
  };
21
- pluginConfiguration: SelectionToolbarPluginOptions;
22
29
  dependencies: [
23
30
  OptionalPlugin<EditorViewModePlugin>,
24
31
  OptionalPlugin<PrimaryToolbarPlugin>,
@@ -29,15 +36,8 @@ export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
29
36
  OptionalPlugin<ToolbarPlugin>,
30
37
  OptionalPlugin<UserIntentPlugin>
31
38
  ];
32
- actions?: {
33
- suppressToolbar?: () => boolean;
34
- unsuppressToolbar?: () => boolean;
35
- /**
36
- * @private
37
- * @deprecated use userPreference API to set toolbar docking instead
38
- */
39
- setToolbarDocking?: (toolbarDocking: ToolbarDocking) => boolean;
40
- forceToolbarDockingWithoutAnalytics?: (toolbarDocking: ToolbarDocking) => boolean;
41
- refreshToolbarDocking?: () => boolean;
39
+ pluginConfiguration: SelectionToolbarPluginOptions;
40
+ sharedState: {
41
+ toolbarDocking: ToolbarDocking;
42
42
  };
43
43
  }>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
4
+ export declare const PinButton: ({ api }: {
5
+ api?: ExtractInjectionAPI<SelectionToolbarPlugin>;
6
+ }) => React.JSX.Element;
@@ -9,8 +9,8 @@ import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
9
9
  import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
10
10
  type OverflowToobarConfigOptions = {
11
11
  api?: ExtractInjectionAPI<SelectionToolbarPlugin>;
12
- toolbarDocking?: 'top' | 'none';
13
12
  intl: IntlShape;
13
+ toolbarDocking?: 'top' | 'none';
14
14
  };
15
15
  export declare const getOverflowPrimaryToolbarConfig: ({ api, intl, }: OverflowToobarConfigOptions) => {
16
16
  items: MenuItem[];
@@ -4,8 +4,8 @@ import type { Command, FloatingToolbarItem } from '@atlaskit/editor-common/types
4
4
  import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
5
5
  type PinToobarConfig = {
6
6
  api?: ExtractInjectionAPI<SelectionToolbarPlugin>;
7
- toolbarDocking?: 'top' | 'none';
8
7
  intl: IntlShape;
8
+ toolbarDocking?: 'top' | 'none';
9
9
  };
10
10
  export declare const getPinOptionToolbarConfig: ({ api, toolbarDocking, intl, }: PinToobarConfig) => FloatingToolbarItem<Command>[];
11
11
  export {};
@@ -1,4 +1,4 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
3
3
  import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
4
- export declare const getToolbarComponents: (api?: ExtractInjectionAPI<SelectionToolbarPlugin>) => RegisterComponent[];
4
+ export declare const getToolbarComponents: (api?: ExtractInjectionAPI<SelectionToolbarPlugin>, contextualFormattingEnabled?: boolean) => RegisterComponent[];
@@ -7,8 +7,8 @@ import type { PopupPosition as Position } from '@atlaskit/editor-common/ui';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  export declare const calculateToolbarPositionTrackHead: (toolbarTitle: string) => (editorView: EditorView, nextPos: Position) => Position;
9
9
  export type CoordsAtPos = {
10
- top: number;
11
10
  bottom: number;
12
11
  left: number;
13
12
  right: number;
13
+ top: number;
14
14
  };
@@ -8,9 +8,9 @@ export declare const updateToolbarDocking: ({ toolbarDocking }: {
8
8
  toolbarDocking: ToolbarDocking;
9
9
  }) => EditorCommand;
10
10
  export declare const setToolbarDocking: ({ toolbarDocking, userPreferencesProvider, editorAnalyticsApi, }: {
11
+ editorAnalyticsApi?: EditorAnalyticsAPI | undefined;
11
12
  toolbarDocking: ToolbarDocking;
12
13
  userPreferencesProvider?: UserPreferencesProvider;
13
- editorAnalyticsApi?: EditorAnalyticsAPI | undefined;
14
14
  }) => EditorCommand;
15
15
  export declare const forceToolbarDockingWithoutAnalytics: ({ toolbarDocking, userPreferencesProvider, }: {
16
16
  toolbarDocking: ToolbarDocking;
@@ -9,16 +9,23 @@ import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
9
9
  import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
10
10
  import type { ToolbarDocking } from './types';
11
11
  export type SelectionToolbarPluginOptions = {
12
+ contextualFormattingEnabled?: boolean;
12
13
  /** @defaults false */
13
14
  preferenceToolbarAboveSelection?: boolean;
14
15
  userPreferencesProvider?: UserPreferencesProvider;
15
- contextualFormattingEnabled?: boolean;
16
16
  };
17
17
  export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
18
- sharedState: {
19
- toolbarDocking: ToolbarDocking;
18
+ actions?: {
19
+ forceToolbarDockingWithoutAnalytics?: (toolbarDocking: ToolbarDocking) => boolean;
20
+ refreshToolbarDocking?: () => boolean;
21
+ /**
22
+ * @private
23
+ * @deprecated use userPreference API to set toolbar docking instead
24
+ */
25
+ setToolbarDocking?: (toolbarDocking: ToolbarDocking) => boolean;
26
+ suppressToolbar?: () => boolean;
27
+ unsuppressToolbar?: () => boolean;
20
28
  };
21
- pluginConfiguration: SelectionToolbarPluginOptions;
22
29
  dependencies: [
23
30
  OptionalPlugin<EditorViewModePlugin>,
24
31
  OptionalPlugin<PrimaryToolbarPlugin>,
@@ -29,15 +36,8 @@ export type SelectionToolbarPlugin = NextEditorPlugin<'selectionToolbar', {
29
36
  OptionalPlugin<ToolbarPlugin>,
30
37
  OptionalPlugin<UserIntentPlugin>
31
38
  ];
32
- actions?: {
33
- suppressToolbar?: () => boolean;
34
- unsuppressToolbar?: () => boolean;
35
- /**
36
- * @private
37
- * @deprecated use userPreference API to set toolbar docking instead
38
- */
39
- setToolbarDocking?: (toolbarDocking: ToolbarDocking) => boolean;
40
- forceToolbarDockingWithoutAnalytics?: (toolbarDocking: ToolbarDocking) => boolean;
41
- refreshToolbarDocking?: () => boolean;
39
+ pluginConfiguration: SelectionToolbarPluginOptions;
40
+ sharedState: {
41
+ toolbarDocking: ToolbarDocking;
42
42
  };
43
43
  }>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
4
+ export declare const PinButton: ({ api }: {
5
+ api?: ExtractInjectionAPI<SelectionToolbarPlugin>;
6
+ }) => React.JSX.Element;
@@ -9,8 +9,8 @@ import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
9
9
  import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
10
10
  type OverflowToobarConfigOptions = {
11
11
  api?: ExtractInjectionAPI<SelectionToolbarPlugin>;
12
- toolbarDocking?: 'top' | 'none';
13
12
  intl: IntlShape;
13
+ toolbarDocking?: 'top' | 'none';
14
14
  };
15
15
  export declare const getOverflowPrimaryToolbarConfig: ({ api, intl, }: OverflowToobarConfigOptions) => {
16
16
  items: MenuItem[];
@@ -4,8 +4,8 @@ import type { Command, FloatingToolbarItem } from '@atlaskit/editor-common/types
4
4
  import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
5
5
  type PinToobarConfig = {
6
6
  api?: ExtractInjectionAPI<SelectionToolbarPlugin>;
7
- toolbarDocking?: 'top' | 'none';
8
7
  intl: IntlShape;
8
+ toolbarDocking?: 'top' | 'none';
9
9
  };
10
10
  export declare const getPinOptionToolbarConfig: ({ api, toolbarDocking, intl, }: PinToobarConfig) => FloatingToolbarItem<Command>[];
11
11
  export {};
@@ -1,4 +1,4 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
3
3
  import type { SelectionToolbarPlugin } from '../selectionToolbarPluginType';
4
- export declare const getToolbarComponents: (api?: ExtractInjectionAPI<SelectionToolbarPlugin>) => RegisterComponent[];
4
+ export declare const getToolbarComponents: (api?: ExtractInjectionAPI<SelectionToolbarPlugin>, contextualFormattingEnabled?: boolean) => RegisterComponent[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "4.3.8",
3
+ "version": "4.3.10",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/editor-plugin-connectivity": "^3.1.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
40
40
  "@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
41
- "@atlaskit/editor-plugin-toolbar": "^0.3.0",
41
+ "@atlaskit/editor-plugin-toolbar": "^0.4.0",
42
42
  "@atlaskit/editor-plugin-user-intent": "^1.1.0",
43
43
  "@atlaskit/editor-plugin-user-preferences": "^1.2.0",
44
44
  "@atlaskit/editor-prosemirror": "7.0.0",
@@ -48,13 +48,13 @@
48
48
  "@atlaskit/icon-lab": "^5.6.0",
49
49
  "@atlaskit/menu": "^8.3.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
- "@atlaskit/tmp-editor-statsig": "^11.3.0",
51
+ "@atlaskit/tmp-editor-statsig": "^11.5.0",
52
52
  "@atlaskit/tokens": "^6.0.0",
53
53
  "@babel/runtime": "^7.0.0",
54
54
  "bind-event-listener": "^3.0.0"
55
55
  },
56
56
  "peerDependencies": {
57
- "@atlaskit/editor-common": "^107.27.0",
57
+ "@atlaskit/editor-common": "^107.28.0",
58
58
  "react": "^18.2.0",
59
59
  "react-dom": "^18.2.0",
60
60
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -62,7 +62,6 @@
62
62
  "devDependencies": {
63
63
  "@af/visual-regression": "workspace:^",
64
64
  "@atlaskit/ssr": "workspace:^",
65
- "@atlaskit/visual-regression": "workspace:^",
66
65
  "@testing-library/react": "^13.4.0",
67
66
  "wait-for-expect": "^1.2.0"
68
67
  },