@elementor/editor-site-navigation 4.5.0-1207 → 4.5.0-1209
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/dist/index.js +308 -234
- package/dist/index.mjs +274 -200
- package/package.json +10 -10
- package/src/api/post.ts +16 -0
- package/src/components/panel/actions-menu/actions/duplicate.tsx +3 -5
- package/src/components/panel/content-panel-header-add.tsx +35 -27
- package/src/components/panel/posts-list/list-items/list-item-view.tsx +13 -4
- package/src/components/panel/section-add-button.tsx +4 -5
- package/src/components/panel/shell-panel-body-content.tsx +44 -0
- package/src/components/panel/shell.tsx +10 -15
- package/src/components/panel/user-load-error.tsx +16 -0
- package/src/env.ts +2 -0
- package/src/hooks/use-accessible-panel-post-types.ts +29 -0
- package/src/hooks/use-can-create.ts +9 -0
- package/src/init.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-site-navigation",
|
|
3
|
-
"version": "4.5.0-
|
|
3
|
+
"version": "4.5.0-1209",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor-app-bar": "4.5.0-
|
|
43
|
-
"@elementor/editor-documents": "4.5.0-
|
|
44
|
-
"@elementor/editor-panels": "4.5.0-
|
|
45
|
-
"@elementor/editor-sidebar": "4.5.0-
|
|
46
|
-
"@elementor/editor-ui": "4.5.0-
|
|
47
|
-
"@elementor/editor-v1-adapters": "4.5.0-
|
|
48
|
-
"@elementor/env": "4.5.0-
|
|
42
|
+
"@elementor/editor-app-bar": "4.5.0-1209",
|
|
43
|
+
"@elementor/editor-documents": "4.5.0-1209",
|
|
44
|
+
"@elementor/editor-panels": "4.5.0-1209",
|
|
45
|
+
"@elementor/editor-sidebar": "4.5.0-1209",
|
|
46
|
+
"@elementor/editor-ui": "4.5.0-1209",
|
|
47
|
+
"@elementor/editor-v1-adapters": "4.5.0-1209",
|
|
48
|
+
"@elementor/env": "4.5.0-1209",
|
|
49
49
|
"@elementor/icons": "~1.78.1",
|
|
50
|
-
"@elementor/events": "4.5.0-
|
|
51
|
-
"@elementor/query": "4.5.0-
|
|
50
|
+
"@elementor/events": "4.5.0-1209",
|
|
51
|
+
"@elementor/query": "4.5.0-1209",
|
|
52
52
|
"@elementor/ui": "1.41.4",
|
|
53
53
|
"@wordpress/api-fetch": "^6.42.0",
|
|
54
54
|
"@wordpress/i18n": "^5.13.0"
|
package/src/api/post.ts
CHANGED
|
@@ -40,6 +40,22 @@ export function getPostTypeCreateCapability( postTypeSlug: Slug ): string {
|
|
|
40
40
|
return postTypesMap[ postTypeSlug ].createCapability;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
export function getAccessiblePanelPostTypes( capabilities: Record< string, boolean > ): Slug[] {
|
|
44
|
+
return panelPostTypeSlugs.filter( ( slug ) => capabilities[ getPostTypeCreateCapability( slug ) ] );
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function canAccessSiteContentPanel( capabilities: Record< string, boolean > ): boolean {
|
|
48
|
+
return getAccessiblePanelPostTypes( capabilities ).length > 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getCannotEditPanelItemMessage( postTypeSlug: Slug ): string {
|
|
52
|
+
if ( 'page' === postTypeSlug ) {
|
|
53
|
+
return __( 'You cannot edit this page.', 'elementor' );
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return __( 'You cannot edit this post.', 'elementor' );
|
|
57
|
+
}
|
|
58
|
+
|
|
43
59
|
export const POST_PER_PAGE = 10;
|
|
44
60
|
|
|
45
61
|
type WpPostsResponse = {
|
|
@@ -3,16 +3,14 @@ import { CopyIcon } from '@elementor/icons';
|
|
|
3
3
|
import { type PopupState } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
|
-
import { getPostTypeCreateCapability } from '../../../../api/post';
|
|
7
6
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
8
|
-
import
|
|
7
|
+
import useCanCreate from '../../../../hooks/use-can-create';
|
|
9
8
|
import { type Post } from '../../../../types';
|
|
10
9
|
import ActionMenuItem from '../action-menu-item';
|
|
11
10
|
|
|
12
11
|
export default function Duplicate( { post, popupState }: { post: Post; popupState: PopupState } ) {
|
|
13
12
|
const { setEditMode, type } = usePostListContext();
|
|
14
|
-
const
|
|
15
|
-
const createCapability = getPostTypeCreateCapability( type );
|
|
13
|
+
const canCreate = useCanCreate( type );
|
|
16
14
|
const onClick = () => {
|
|
17
15
|
popupState.close();
|
|
18
16
|
|
|
@@ -25,7 +23,7 @@ export default function Duplicate( { post, popupState }: { post: Post; popupStat
|
|
|
25
23
|
} );
|
|
26
24
|
};
|
|
27
25
|
|
|
28
|
-
const isDisabled = !
|
|
26
|
+
const isDisabled = ! canCreate;
|
|
29
27
|
|
|
30
28
|
return (
|
|
31
29
|
<ActionMenuItem
|
|
@@ -3,9 +3,10 @@ import { PageTypeIcon, PostTypeIcon } from '@elementor/icons';
|
|
|
3
3
|
import { bindMenu, bindTrigger, ListItemIcon, ListItemText, Menu, MenuItem, usePopupState } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { postTypesMap, type Slug } from '../../api/post';
|
|
7
7
|
import { useContentPanelCoordinator } from '../../contexts/content-panel-coordinator';
|
|
8
|
-
import
|
|
8
|
+
import useAccessiblePanelPostTypes from '../../hooks/use-accessible-panel-post-types';
|
|
9
|
+
import useCanCreate from '../../hooks/use-can-create';
|
|
9
10
|
import ContentPanelAddIconButton from './content-panel-add-icon-button';
|
|
10
11
|
|
|
11
12
|
const typeIcons: Record< Slug, typeof PageTypeIcon > = {
|
|
@@ -13,44 +14,51 @@ const typeIcons: Record< Slug, typeof PageTypeIcon > = {
|
|
|
13
14
|
post: PostTypeIcon,
|
|
14
15
|
};
|
|
15
16
|
|
|
17
|
+
function HeaderAddMenuItem( { slug, onSelect }: { slug: Slug; onSelect: ( slug: Slug ) => void } ) {
|
|
18
|
+
const canCreate = useCanCreate( slug );
|
|
19
|
+
const Icon = typeIcons[ slug ];
|
|
20
|
+
const singularName = postTypesMap[ slug ].labels.singular_name;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<MenuItem disabled={ ! canCreate } onClick={ () => onSelect( slug ) }>
|
|
24
|
+
<ListItemIcon>
|
|
25
|
+
<Icon fontSize="small" />
|
|
26
|
+
</ListItemIcon>
|
|
27
|
+
<ListItemText primary={ singularName } primaryTypographyProps={ { variant: 'body2' } } />
|
|
28
|
+
</MenuItem>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
export default function ContentPanelHeaderAdd() {
|
|
17
33
|
const { requestCreate } = useContentPanelCoordinator();
|
|
18
|
-
const {
|
|
34
|
+
const { accessiblePostTypes: accessibleSlugs } = useAccessiblePanelPostTypes();
|
|
19
35
|
const popupState = usePopupState( {
|
|
20
36
|
variant: 'popover',
|
|
21
37
|
popupId: 'elementor-content-panel-header-add',
|
|
22
38
|
} );
|
|
39
|
+
const canAddAny = accessibleSlugs.length > 0;
|
|
23
40
|
|
|
24
41
|
const buttonProps = bindTrigger( popupState );
|
|
25
42
|
const menuProps = bindMenu( popupState );
|
|
26
43
|
|
|
44
|
+
const handleSelectType = ( slug: Slug ) => {
|
|
45
|
+
popupState.close();
|
|
46
|
+
requestAnimationFrame( () => {
|
|
47
|
+
requestCreate( slug );
|
|
48
|
+
} );
|
|
49
|
+
};
|
|
50
|
+
|
|
27
51
|
return (
|
|
28
52
|
<>
|
|
29
|
-
<ContentPanelAddIconButton
|
|
53
|
+
<ContentPanelAddIconButton
|
|
54
|
+
aria-label={ __( 'Add new', 'elementor' ) }
|
|
55
|
+
{ ...buttonProps }
|
|
56
|
+
disabled={ ! canAddAny }
|
|
57
|
+
/>
|
|
30
58
|
<Menu { ...menuProps }>
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const singularName = postTypesMap[ slug ].labels.singular_name;
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<MenuItem
|
|
38
|
-
key={ slug }
|
|
39
|
-
disabled={ ! user?.capabilities?.[ createCapability ] }
|
|
40
|
-
onClick={ () => {
|
|
41
|
-
popupState.close();
|
|
42
|
-
requestAnimationFrame( () => {
|
|
43
|
-
requestCreate( slug );
|
|
44
|
-
} );
|
|
45
|
-
} }
|
|
46
|
-
>
|
|
47
|
-
<ListItemIcon>
|
|
48
|
-
<Icon fontSize="small" />
|
|
49
|
-
</ListItemIcon>
|
|
50
|
-
<ListItemText primary={ singularName } primaryTypographyProps={ { variant: 'body2' } } />
|
|
51
|
-
</MenuItem>
|
|
52
|
-
);
|
|
53
|
-
} ) }
|
|
59
|
+
{ accessibleSlugs.map( ( slug ) => (
|
|
60
|
+
<HeaderAddMenuItem key={ slug } onSelect={ handleSelectType } slug={ slug } />
|
|
61
|
+
) ) }
|
|
54
62
|
</Menu>
|
|
55
63
|
</>
|
|
56
64
|
);
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
} from '@elementor/ui';
|
|
20
20
|
import { __ } from '@wordpress/i18n';
|
|
21
21
|
|
|
22
|
+
import { getCannotEditPanelItemMessage, type Slug } from '../../../../api/post';
|
|
22
23
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
23
24
|
import { type Post } from '../../../../types';
|
|
24
25
|
import PageTitleAndStatus from '../../../shared/page-title-and-status';
|
|
@@ -29,13 +30,21 @@ import SetHome from '../../actions-menu/actions/set-home';
|
|
|
29
30
|
import View from '../../actions-menu/actions/view';
|
|
30
31
|
import { contentPanelListItemButtonSx, contentPanelListRowPaddingSx } from '../../content-panel-chrome';
|
|
31
32
|
|
|
32
|
-
const DisabledPostTooltip = ( {
|
|
33
|
+
const DisabledPostTooltip = ( {
|
|
34
|
+
children,
|
|
35
|
+
isDisabled,
|
|
36
|
+
postTypeSlug,
|
|
37
|
+
}: {
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
isDisabled: boolean;
|
|
40
|
+
postTypeSlug: Slug;
|
|
41
|
+
} ) => {
|
|
33
42
|
if ( isDisabled ) {
|
|
34
43
|
const title = (
|
|
35
44
|
<Typography variant="caption">
|
|
36
|
-
|
|
45
|
+
{ getCannotEditPanelItemMessage( postTypeSlug ) }
|
|
37
46
|
<br />
|
|
38
|
-
To edit it directly, contact the site owner
|
|
47
|
+
{ __( 'To edit it directly, contact the site owner', 'elementor' ) }
|
|
39
48
|
</Typography>
|
|
40
49
|
);
|
|
41
50
|
|
|
@@ -69,7 +78,7 @@ export default function ListItemView( { post }: { post: Post } ) {
|
|
|
69
78
|
|
|
70
79
|
return (
|
|
71
80
|
<>
|
|
72
|
-
<DisabledPostTooltip isDisabled={ isDisabled }>
|
|
81
|
+
<DisabledPostTooltip isDisabled={ isDisabled } postTypeSlug={ type }>
|
|
73
82
|
<ListItem
|
|
74
83
|
disablePadding
|
|
75
84
|
sx={ contentPanelListRowPaddingSx }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { __, sprintf } from '@wordpress/i18n';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { postTypesMap } from '../../api/post';
|
|
5
5
|
import { usePostListContext } from '../../contexts/post-list-context';
|
|
6
|
-
import
|
|
6
|
+
import useCanCreate from '../../hooks/use-can-create';
|
|
7
7
|
import ContentPanelAddIconButton from './content-panel-add-icon-button';
|
|
8
8
|
|
|
9
9
|
type Props = {
|
|
@@ -12,8 +12,7 @@ type Props = {
|
|
|
12
12
|
|
|
13
13
|
export default function SectionAddButton( { onBeforeCreate }: Props ) {
|
|
14
14
|
const { type, setEditMode } = usePostListContext();
|
|
15
|
-
const
|
|
16
|
-
const createCapability = getPostTypeCreateCapability( type );
|
|
15
|
+
const canCreate = useCanCreate( type );
|
|
17
16
|
const singularName = postTypesMap[ type ].labels.singular_name;
|
|
18
17
|
const ariaLabel = sprintf(
|
|
19
18
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
@@ -24,7 +23,7 @@ export default function SectionAddButton( { onBeforeCreate }: Props ) {
|
|
|
24
23
|
return (
|
|
25
24
|
<ContentPanelAddIconButton
|
|
26
25
|
aria-label={ ariaLabel }
|
|
27
|
-
disabled={ !
|
|
26
|
+
disabled={ ! canCreate }
|
|
28
27
|
onClick={ ( event ) => {
|
|
29
28
|
event.stopPropagation();
|
|
30
29
|
onBeforeCreate?.();
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { List, Skeleton, Stack } from '@elementor/ui';
|
|
3
|
+
|
|
4
|
+
import { type Slug } from '../../api/post';
|
|
5
|
+
import { PostListContextProvider } from '../../contexts/post-list-context';
|
|
6
|
+
import PostsCollapsibleList from './posts-list/posts-collapsible-list';
|
|
7
|
+
import UserLoadError from './user-load-error';
|
|
8
|
+
|
|
9
|
+
type ShellPanelBodyContentProps = {
|
|
10
|
+
accessiblePostTypes: Slug[];
|
|
11
|
+
isUserPending: boolean;
|
|
12
|
+
onListError: () => void;
|
|
13
|
+
showUserLoadError: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default function ShellPanelBodyContent( {
|
|
17
|
+
accessiblePostTypes,
|
|
18
|
+
isUserPending,
|
|
19
|
+
onListError,
|
|
20
|
+
showUserLoadError,
|
|
21
|
+
}: ShellPanelBodyContentProps ) {
|
|
22
|
+
if ( isUserPending ) {
|
|
23
|
+
return (
|
|
24
|
+
<Stack spacing={ 1 } sx={ { px: 2, py: 1 } }>
|
|
25
|
+
<Skeleton animation="wave" height={ 28 } variant="rounded" width="100%" />
|
|
26
|
+
<Skeleton animation="wave" height={ 28 } variant="rounded" width="80%" />
|
|
27
|
+
</Stack>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if ( showUserLoadError ) {
|
|
32
|
+
return <UserLoadError />;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<List dense disablePadding sx={ { py: 0, width: '100%' } }>
|
|
37
|
+
{ accessiblePostTypes.map( ( postTypeSlug, index ) => (
|
|
38
|
+
<PostListContextProvider key={ postTypeSlug } type={ postTypeSlug } setError={ onListError }>
|
|
39
|
+
<PostsCollapsibleList isOpenByDefault={ index === 0 } />
|
|
40
|
+
</PostListContextProvider>
|
|
41
|
+
) ) }
|
|
42
|
+
</List>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';
|
|
4
|
-
import { Divider,
|
|
4
|
+
import { Divider, Stack } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
|
-
import { panelPostTypeSlugs } from '../../api/post';
|
|
8
7
|
import { ContentPanelCoordinatorProvider } from '../../contexts/content-panel-coordinator';
|
|
9
|
-
import
|
|
8
|
+
import useAccessiblePanelPostTypes from '../../hooks/use-accessible-panel-post-types';
|
|
10
9
|
import { contentPanelHeaderStackSx } from './content-panel-chrome';
|
|
11
10
|
import ContentPanelHeaderAdd from './content-panel-header-add';
|
|
12
11
|
import ContentPanelSearch from './content-panel-search';
|
|
13
12
|
import ErrorSnackbar from './error-snackbar';
|
|
14
|
-
import
|
|
13
|
+
import ShellPanelBodyContent from './shell-panel-body-content';
|
|
15
14
|
|
|
16
15
|
const Shell = () => {
|
|
17
16
|
const [ isErrorSnackbarOpen, setIsErrorSnackbarOpen ] = useState( false );
|
|
17
|
+
const { accessiblePostTypes, isUserPending, showUserLoadError } = useAccessiblePanelPostTypes();
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<ContentPanelCoordinatorProvider>
|
|
@@ -37,17 +37,12 @@ const Shell = () => {
|
|
|
37
37
|
<Divider />
|
|
38
38
|
<PanelBody>
|
|
39
39
|
<ContentPanelSearch />
|
|
40
|
-
<
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
>
|
|
47
|
-
<PostsCollapsibleList isOpenByDefault={ index === 0 } />
|
|
48
|
-
</PostListContextProvider>
|
|
49
|
-
) ) }
|
|
50
|
-
</List>
|
|
40
|
+
<ShellPanelBodyContent
|
|
41
|
+
accessiblePostTypes={ accessiblePostTypes }
|
|
42
|
+
isUserPending={ isUserPending }
|
|
43
|
+
onListError={ () => setIsErrorSnackbarOpen( true ) }
|
|
44
|
+
showUserLoadError={ showUserLoadError }
|
|
45
|
+
/>
|
|
51
46
|
<ErrorSnackbar open={ isErrorSnackbarOpen } onClose={ () => setIsErrorSnackbarOpen( false ) } />
|
|
52
47
|
</PanelBody>
|
|
53
48
|
</Panel>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Box, Typography } from '@elementor/ui';
|
|
3
|
+
import { __ } from '@wordpress/i18n';
|
|
4
|
+
|
|
5
|
+
export default function UserLoadError() {
|
|
6
|
+
return (
|
|
7
|
+
<Box sx={ { px: 2, py: 2 } }>
|
|
8
|
+
<Typography variant="body2" color="text.secondary">
|
|
9
|
+
{ __(
|
|
10
|
+
'We couldn’t load your content permissions. Try closing and reopening this panel.',
|
|
11
|
+
'elementor'
|
|
12
|
+
) }
|
|
13
|
+
</Typography>
|
|
14
|
+
</Box>
|
|
15
|
+
);
|
|
16
|
+
}
|
package/src/env.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { parseEnv } from '@elementor/env';
|
|
2
2
|
|
|
3
3
|
export const { env } = parseEnv< {
|
|
4
|
+
can_access_site_content_panel: boolean;
|
|
4
5
|
is_pages_panel_active: boolean;
|
|
5
6
|
} >( '@elementor/editor-site-navigation', ( envData ) => {
|
|
6
7
|
return envData as {
|
|
8
|
+
can_access_site_content_panel: boolean;
|
|
7
9
|
is_pages_panel_active: boolean;
|
|
8
10
|
};
|
|
9
11
|
} );
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { getAccessiblePanelPostTypes, panelPostTypeSlugs } from '../api/post';
|
|
4
|
+
import { env } from '../env';
|
|
5
|
+
import useUser from './use-user';
|
|
6
|
+
|
|
7
|
+
export default function useAccessiblePanelPostTypes() {
|
|
8
|
+
const { data: user, isPending: isUserPending, isError: isUserError } = useUser();
|
|
9
|
+
|
|
10
|
+
const accessiblePostTypes = useMemo( () => {
|
|
11
|
+
if ( user?.capabilities ) {
|
|
12
|
+
return getAccessiblePanelPostTypes( user.capabilities );
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if ( isUserError && env.can_access_site_content_panel ) {
|
|
16
|
+
return panelPostTypeSlugs;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return [];
|
|
20
|
+
}, [ user, isUserError ] );
|
|
21
|
+
|
|
22
|
+
const showUserLoadError = isUserError && accessiblePostTypes.length === 0;
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
accessiblePostTypes,
|
|
26
|
+
isUserPending,
|
|
27
|
+
showUserLoadError,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getPostTypeCreateCapability, type Slug } from '../api/post';
|
|
2
|
+
import useUser from './use-user';
|
|
3
|
+
|
|
4
|
+
export default function useCanCreate( postTypeSlug: Slug ): boolean {
|
|
5
|
+
const { data: user } = useUser();
|
|
6
|
+
const capability = getPostTypeCreateCapability( postTypeSlug );
|
|
7
|
+
|
|
8
|
+
return !! user?.capabilities?.[ capability ];
|
|
9
|
+
}
|
package/src/init.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { useToggleButtonProps } from './hooks/use-toggle-button-props';
|
|
|
10
10
|
export function init() {
|
|
11
11
|
registerTopBarMenuItems();
|
|
12
12
|
// TODO 06/06/2023 : remove if when we are production ready
|
|
13
|
-
if ( env.is_pages_panel_active ) {
|
|
13
|
+
if ( env.is_pages_panel_active && env.can_access_site_content_panel ) {
|
|
14
14
|
registerPanel( panel );
|
|
15
15
|
registerButton();
|
|
16
16
|
}
|