@atlaskit/editor-plugin-block-type 4.4.0 → 4.5.0

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-block-type
2
2
 
3
+ ## 4.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#116949](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116949)
8
+ [`9154f7b89e3d2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9154f7b89e3d2) -
9
+ [ux] ED-26674 Hiding contextual toolbar menu items when the menu is docked to top
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 4.4.0
4
16
 
5
17
  ### Minor Changes
@@ -212,6 +212,12 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
212
212
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
213
213
  pluginsOptions: {
214
214
  selectionToolbar: function selectionToolbar() {
215
+ var _api$selectionToolbar;
216
+ if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
217
+ exposure: true
218
+ })) {
219
+ return undefined;
220
+ }
215
221
  if ((0, _experiments.editorExperiment)('contextual_formatting_toolbar', true, {
216
222
  exposure: true
217
223
  }) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
@@ -202,6 +202,12 @@ const blockTypePlugin = ({
202
202
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
203
203
  pluginsOptions: {
204
204
  selectionToolbar: () => {
205
+ var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
206
+ if ((api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking) === 'top' && editorExperiment('platform_editor_controls', 'variant1', {
207
+ exposure: true
208
+ })) {
209
+ return undefined;
210
+ }
205
211
  if (editorExperiment('contextual_formatting_toolbar', true, {
206
212
  exposure: true
207
213
  }) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
@@ -205,6 +205,12 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
205
205
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
206
206
  pluginsOptions: {
207
207
  selectionToolbar: function selectionToolbar() {
208
+ var _api$selectionToolbar;
209
+ if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top' && editorExperiment('platform_editor_controls', 'variant1', {
210
+ exposure: true
211
+ })) {
212
+ return undefined;
213
+ }
208
214
  if (editorExperiment('contextual_formatting_toolbar', true, {
209
215
  exposure: true
210
216
  }) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
@@ -1,13 +1,18 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
4
+ import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
4
5
  import type { TextBlockTypes } from './pm-plugins/block-types';
5
- import type { InputMethod, ClearFormattingInputMethod } from './pm-plugins/commands/block-type';
6
+ import type { ClearFormattingInputMethod, InputMethod } from './pm-plugins/commands/block-type';
6
7
  import type { BlockTypeState } from './pm-plugins/main';
7
8
  import type { BlockTypePluginOptions } from './pm-plugins/types';
8
9
  export type BlockTypePlugin = NextEditorPlugin<'blockType', {
9
10
  pluginConfiguration: BlockTypePluginOptions | undefined;
10
- dependencies: [OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<PrimaryToolbarPlugin>];
11
+ dependencies: [
12
+ OptionalPlugin<AnalyticsPlugin>,
13
+ OptionalPlugin<PrimaryToolbarPlugin>,
14
+ OptionalPlugin<SelectionToolbarPlugin>
15
+ ];
11
16
  sharedState: BlockTypeState | undefined;
12
17
  actions: {
13
18
  insertBlockQuote: (inputMethod: InputMethod) => Command;
@@ -1,15 +1,17 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
3
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
4
+ import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
4
5
  import type { TextBlockTypes } from './pm-plugins/block-types';
5
- import type { InputMethod, ClearFormattingInputMethod } from './pm-plugins/commands/block-type';
6
+ import type { ClearFormattingInputMethod, InputMethod } from './pm-plugins/commands/block-type';
6
7
  import type { BlockTypeState } from './pm-plugins/main';
7
8
  import type { BlockTypePluginOptions } from './pm-plugins/types';
8
9
  export type BlockTypePlugin = NextEditorPlugin<'blockType', {
9
10
  pluginConfiguration: BlockTypePluginOptions | undefined;
10
11
  dependencies: [
11
12
  OptionalPlugin<AnalyticsPlugin>,
12
- OptionalPlugin<PrimaryToolbarPlugin>
13
+ OptionalPlugin<PrimaryToolbarPlugin>,
14
+ OptionalPlugin<SelectionToolbarPlugin>
13
15
  ];
14
16
  sharedState: BlockTypeState | undefined;
15
17
  actions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,10 +37,11 @@
37
37
  "@atlaskit/editor-common": "^99.18.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.12.0",
39
39
  "@atlaskit/editor-plugin-primary-toolbar": "^2.3.0",
40
+ "@atlaskit/editor-plugin-selection-toolbar": "^1.9.0",
40
41
  "@atlaskit/editor-prosemirror": "7.0.0",
41
42
  "@atlaskit/editor-shared-styles": "^3.3.0",
42
43
  "@atlaskit/editor-tables": "^2.9.0",
43
- "@atlaskit/icon": "^23.10.0",
44
+ "@atlaskit/icon": "^23.11.0",
44
45
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
46
  "@atlaskit/primitives": "^13.6.0",
46
47
  "@atlaskit/prosemirror-input-rules": "^3.3.0",