@elementor/editor-app-bar 0.27.1 → 0.28.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-app-bar",
3
3
  "description": "App Bar extension for @elementor/editor",
4
- "version": "0.27.1",
4
+ "version": "0.28.0",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,11 +40,11 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor": "0.18.1",
44
- "@elementor/editor-documents": "0.11.19",
45
- "@elementor/editor-responsive": "0.13.1",
46
- "@elementor/editor-v1-adapters": "0.10.1",
47
- "@elementor/icons": "1.31.0",
43
+ "@elementor/editor": "0.18.2",
44
+ "@elementor/editor-documents": "0.11.20",
45
+ "@elementor/editor-responsive": "0.13.2",
46
+ "@elementor/editor-v1-adapters": "0.10.2",
47
+ "@elementor/icons": "1.35.0",
48
48
  "@elementor/locations": "0.7.6",
49
49
  "@elementor/menus": "0.1.3",
50
50
  "@elementor/ui": "1.26.0",
@@ -4,7 +4,7 @@ import {
4
4
  __useActiveDocumentActions as useActiveDocumentActions,
5
5
  type Document,
6
6
  } from '@elementor/editor-documents';
7
- import { __privateUseIsPreviewMode as useIsPreviewMode } from '@elementor/editor-v1-adapters';
7
+ import { useEditMode } from '@elementor/editor-v1-adapters';
8
8
  import { ChevronDownIcon } from '@elementor/icons';
9
9
  import {
10
10
  bindMenu,
@@ -24,7 +24,9 @@ import PrimaryActionMenu from './primary-action-menu';
24
24
  export default function PrimaryAction() {
25
25
  const document = useActiveDocument();
26
26
  const { save } = useActiveDocumentActions();
27
- const isPreviewMode = useIsPreviewMode();
27
+ const editMode = useEditMode();
28
+
29
+ const isEditMode = editMode === 'edit';
28
30
 
29
31
  const popupState = usePopupState( {
30
32
  variant: 'popover',
@@ -35,8 +37,8 @@ export default function PrimaryAction() {
35
37
  return null;
36
38
  }
37
39
 
38
- const isPublishDisabled = isPreviewMode || ! isPublishEnabled( document );
39
- const isSaveOptionsDisabled = isPreviewMode || document.type.value === 'kit';
40
+ const isPublishDisabled = ! isEditMode || ! isPublishEnabled( document );
41
+ const isSaveOptionsDisabled = ! isEditMode || document.type.value === 'kit';
40
42
 
41
43
  // When the document is being saved, the spinner should not appear.
42
44
  // Usually happens when the Kit is being saved.
@@ -1,18 +1,10 @@
1
- import {
2
- __privateRunCommand as runCommand,
3
- __privateUseRouteStatus as useRouteStatus,
4
- } from '@elementor/editor-v1-adapters';
1
+ import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';
5
2
  import { SearchIcon } from '@elementor/icons';
6
3
  import { __ } from '@wordpress/i18n';
7
4
 
8
- import { type ExtendedWindow } from '../../../types';
5
+ import { type ActionProps, type ExtendedWindow } from '../../../types';
9
6
 
10
7
  export default function useActionProps() {
11
- const { isBlocked } = useRouteStatus( 'finder', {
12
- blockOnKitRoutes: false,
13
- blockOnPreviewMode: false,
14
- } );
15
-
16
8
  return {
17
9
  title: __( 'Finder', 'elementor' ),
18
10
  icon: SearchIcon,
@@ -31,6 +23,5 @@ export default function useActionProps() {
31
23
 
32
24
  runCommand( 'finder/toggle' );
33
25
  },
34
- disabled: isBlocked,
35
- };
26
+ } satisfies ActionProps;
36
27
  }