@atlaskit/editor-plugin-selection-extension 10.0.5 → 10.0.6

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,12 @@
1
1
  # @atlaskit/editor-plugin-selection-extension
2
2
 
3
+ ## 10.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2fc345bb747f4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2fc345bb747f4) -
8
+ [ux] Add isHidden check for extensions to be true if no extensions were registered in block menu.
9
+
3
10
  ## 10.0.5
4
11
 
5
12
  ### Patch Changes
@@ -43,6 +43,9 @@ function registerBlockMenuItems(_ref) {
43
43
  api.blockMenu.actions.registerBlockMenuComponents([{
44
44
  type: 'block-menu-item',
45
45
  key: "selection-extension-".concat(key),
46
+ isHidden: function isHidden() {
47
+ return blockMenu.getMenuItems().length === 0;
48
+ },
46
49
  parent: {
47
50
  type: 'block-menu-section',
48
51
  key: _blockMenu.TRANSFORM_CREATE_MENU_SECTION.key,
@@ -38,6 +38,7 @@ export function registerBlockMenuItems({
38
38
  api.blockMenu.actions.registerBlockMenuComponents([{
39
39
  type: 'block-menu-item',
40
40
  key: `selection-extension-${key}`,
41
+ isHidden: () => blockMenu.getMenuItems().length === 0,
41
42
  parent: {
42
43
  type: 'block-menu-section',
43
44
  key: TRANSFORM_CREATE_MENU_SECTION.key,
@@ -36,6 +36,9 @@ export function registerBlockMenuItems(_ref) {
36
36
  api.blockMenu.actions.registerBlockMenuComponents([{
37
37
  type: 'block-menu-item',
38
38
  key: "selection-extension-".concat(key),
39
+ isHidden: function isHidden() {
40
+ return blockMenu.getMenuItems().length === 0;
41
+ },
39
42
  parent: {
40
43
  type: 'block-menu-section',
41
44
  key: TRANSFORM_CREATE_MENU_SECTION.key,
@@ -3,11 +3,11 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
4
4
  import type { ExtensionConfiguration } from '../../types';
5
5
  type RegisterBlockMenuItemsOptions = {
6
- extensionList: ExtensionConfiguration[];
7
6
  api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
8
7
  editorViewRef?: {
9
8
  current?: EditorView;
10
9
  };
10
+ extensionList: ExtensionConfiguration[];
11
11
  };
12
12
  export declare function registerBlockMenuItems({ extensionList, api, editorViewRef, }: RegisterBlockMenuItemsOptions): void;
13
13
  export {};
@@ -3,11 +3,11 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
4
4
  import type { ExtensionConfiguration } from '../../types';
5
5
  type RegisterBlockMenuItemsOptions = {
6
- extensionList: ExtensionConfiguration[];
7
6
  api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
8
7
  editorViewRef?: {
9
8
  current?: EditorView;
10
9
  };
10
+ extensionList: ExtensionConfiguration[];
11
11
  };
12
12
  export declare function registerBlockMenuItems({ extensionList, api, editorViewRef, }: RegisterBlockMenuItemsOptions): void;
13
13
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-extension",
3
- "version": "10.0.5",
3
+ "version": "10.0.6",
4
4
  "description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -53,7 +53,7 @@
53
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
54
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
55
55
  "@atlaskit/primitives": "^17.0.0",
56
- "@atlaskit/tmp-editor-statsig": "^16.11.0",
56
+ "@atlaskit/tmp-editor-statsig": "^16.15.0",
57
57
  "@atlaskit/tokens": "^9.1.0",
58
58
  "@babel/runtime": "^7.0.0",
59
59
  "lodash": "^4.17.21",