@elementor/editor-site-navigation 0.26.0 → 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/CHANGELOG.md +38 -0
- package/dist/index.js +726 -730
- package/dist/index.mjs +767 -771
- package/package.json +12 -13
- package/src/api/post.ts +2 -1
- package/src/api/recent-posts.ts +2 -1
- package/src/components/panel/actions-menu/action-menu-item.tsx +2 -2
- package/src/components/panel/actions-menu/actions/delete.tsx +7 -6
- package/src/components/panel/actions-menu/actions/duplicate.tsx +4 -3
- package/src/components/panel/actions-menu/actions/rename.tsx +3 -2
- package/src/components/panel/actions-menu/actions/set-home.tsx +5 -4
- package/src/components/panel/actions-menu/actions/view.tsx +3 -2
- package/src/components/panel/add-new-button.tsx +2 -1
- package/src/components/panel/error-snackbar.tsx +1 -1
- package/src/components/panel/panel.ts +1 -0
- package/src/components/panel/posts-list/collapsible-list.tsx +4 -4
- package/src/components/panel/posts-list/error-state.tsx +1 -1
- package/src/components/panel/posts-list/list-items/edit-mode-template.tsx +3 -2
- package/src/components/panel/posts-list/list-items/list-item-create.tsx +2 -1
- package/src/components/panel/posts-list/list-items/list-item-duplicate.tsx +2 -1
- package/src/components/panel/posts-list/list-items/list-item-rename.tsx +4 -3
- package/src/components/panel/posts-list/list-items/list-item-view.tsx +11 -10
- package/src/components/panel/posts-list/post-list-item.tsx +4 -3
- package/src/components/panel/posts-list/posts-collapsible-list.tsx +6 -5
- package/src/components/panel/shell.tsx +2 -1
- package/src/components/shared/page-title-and-status.tsx +1 -0
- package/src/components/top-bar/chip-doc-type.tsx +2 -1
- package/src/components/top-bar/create-post-list-item.tsx +4 -3
- package/src/components/top-bar/indicator.tsx +2 -2
- package/src/components/top-bar/post-list-item.tsx +4 -3
- package/src/components/top-bar/recently-edited.tsx +15 -14
- package/src/contexts/post-list-context.tsx +3 -2
- package/src/hooks/use-create-page.ts +1 -1
- package/src/hooks/use-homepage-actions.ts +2 -1
- package/src/hooks/use-homepage.ts +1 -0
- package/src/hooks/use-posts-actions.ts +11 -2
- package/src/hooks/use-posts.ts +3 -2
- package/src/hooks/use-recent-posts.ts +1 -0
- package/src/hooks/use-rename-active-document.ts +1 -1
- package/src/hooks/use-toggle-button-props.ts +2 -1
- package/src/hooks/use-user.ts +1 -0
- package/src/icons-map.ts +4 -5
- package/src/init.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-site-navigation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
13
14
|
"import": "./dist/index.mjs",
|
|
14
|
-
"require": "./dist/index.js"
|
|
15
|
-
"types": "./dist/index.d.ts"
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./package.json": "./package.json"
|
|
18
18
|
},
|
|
@@ -39,17 +39,16 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor-app-bar": "^0.
|
|
43
|
-
"@elementor/editor-documents": "^0.11.
|
|
44
|
-
"@elementor/editor-panels": "^0.
|
|
45
|
-
"@elementor/editor-v1-adapters": "^0.8.
|
|
46
|
-
"@elementor/env": "^0.3.
|
|
47
|
-
"@elementor/icons": "^1.
|
|
48
|
-
"@elementor/query": "^0.2.
|
|
49
|
-
"@elementor/ui": "^1.21.
|
|
42
|
+
"@elementor/editor-app-bar": "^0.22.0",
|
|
43
|
+
"@elementor/editor-documents": "^0.11.12",
|
|
44
|
+
"@elementor/editor-panels": "^0.10.0",
|
|
45
|
+
"@elementor/editor-v1-adapters": "^0.8.4",
|
|
46
|
+
"@elementor/env": "^0.3.5",
|
|
47
|
+
"@elementor/icons": "^1.18.1",
|
|
48
|
+
"@elementor/query": "^0.2.3",
|
|
49
|
+
"@elementor/ui": "^1.21.13",
|
|
50
50
|
"@wordpress/api-fetch": "^6.42.0",
|
|
51
|
-
"@wordpress/i18n": "^4.45.0"
|
|
52
|
-
"@wordpress/url": "^3.46.0"
|
|
51
|
+
"@wordpress/i18n": "^4.45.0"
|
|
53
52
|
},
|
|
54
53
|
"peerDependencies": {
|
|
55
54
|
"react": "^18.3.1"
|
package/src/api/post.ts
CHANGED
package/src/api/recent-posts.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { type ComponentType } from 'react';
|
|
3
|
+
import { ListItemIcon, ListItemText, MenuItem, type MenuItemProps as MenuItemPropsType } from '@elementor/ui';
|
|
4
4
|
|
|
5
5
|
export type Props = {
|
|
6
6
|
title: string;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { __useActiveDocument as useActiveDocument } from '@elementor/editor-documents';
|
|
2
4
|
import { TrashIcon } from '@elementor/icons';
|
|
3
|
-
import { Post } from '../../../../types';
|
|
4
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
-
import ActionMenuItem from '../action-menu-item';
|
|
6
|
-
import { usePostActions } from '../../../../hooks/use-posts-actions';
|
|
7
5
|
import {
|
|
8
6
|
Button,
|
|
9
7
|
CircularProgress,
|
|
@@ -14,9 +12,12 @@ import {
|
|
|
14
12
|
DialogTitle,
|
|
15
13
|
Divider,
|
|
16
14
|
} from '@elementor/ui';
|
|
15
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
16
|
+
|
|
17
17
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { usePostActions } from '../../../../hooks/use-posts-actions';
|
|
19
|
+
import { type Post } from '../../../../types';
|
|
20
|
+
import ActionMenuItem from '../action-menu-item';
|
|
20
21
|
|
|
21
22
|
export default function Delete( { post }: { post: Post } ) {
|
|
22
23
|
const [ isDialogOpen, setIsDialogOpen ] = useState( false );
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { PopupState } from '@elementor/ui';
|
|
3
2
|
import { CopyIcon } from '@elementor/icons';
|
|
3
|
+
import { type PopupState } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
7
|
-
import { Post } from '../../../../types';
|
|
8
7
|
import useUser from '../../../../hooks/use-user';
|
|
8
|
+
import { type Post } from '../../../../types';
|
|
9
|
+
import ActionMenuItem from '../action-menu-item';
|
|
9
10
|
|
|
10
11
|
export default function Duplicate( { post, popupState }: { post: Post; popupState: PopupState } ) {
|
|
11
12
|
const { setEditMode } = usePostListContext();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { EraseIcon } from '@elementor/icons';
|
|
3
3
|
import { __ } from '@wordpress/i18n';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
6
|
-
import { Post } from '../../../../types';
|
|
6
|
+
import { type Post } from '../../../../types';
|
|
7
|
+
import ActionMenuItem from '../action-menu-item';
|
|
7
8
|
|
|
8
9
|
export default function Rename( { post }: { post: Post } ) {
|
|
9
10
|
const { setEditMode } = usePostListContext();
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Post } from '../../../../types';
|
|
3
2
|
import { HomeIcon } from '@elementor/icons';
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import ActionMenuItem from '../action-menu-item';
|
|
6
|
-
import { useHomepageActions } from '../../../../hooks/use-homepage-actions';
|
|
7
3
|
import { CircularProgress } from '@elementor/ui';
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
8
6
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
7
|
+
import { useHomepageActions } from '../../../../hooks/use-homepage-actions';
|
|
9
8
|
import useUser from '../../../../hooks/use-user';
|
|
9
|
+
import { type Post } from '../../../../types';
|
|
10
|
+
import ActionMenuItem from '../action-menu-item';
|
|
10
11
|
|
|
11
12
|
export default function SetHome( { post, closeMenu }: { post: Post; closeMenu: () => void } ) {
|
|
12
13
|
const { updateSettingsMutation } = useHomepageActions();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { EyeIcon } from '@elementor/icons';
|
|
3
3
|
import { __ } from '@wordpress/i18n';
|
|
4
|
-
|
|
5
|
-
import { Post } from '../../../../types';
|
|
4
|
+
|
|
6
5
|
import { postTypesMap } from '../../../../api/post';
|
|
7
6
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
7
|
+
import { type Post } from '../../../../types';
|
|
8
|
+
import ActionMenuItem from '../action-menu-item';
|
|
8
9
|
|
|
9
10
|
export default function View( { post }: { post: Post } ) {
|
|
10
11
|
const { type } = usePostListContext();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Button } from '@elementor/ui';
|
|
3
2
|
import { PlusIcon } from '@elementor/icons';
|
|
3
|
+
import { Button } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
5
6
|
import { usePostListContext } from '../../contexts/post-list-context';
|
|
6
7
|
import useUser from '../../hooks/use-user';
|
|
7
8
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { PropsWithChildren, useState } from 'react';
|
|
2
|
+
import { type PropsWithChildren, useState } from 'react';
|
|
3
|
+
import { ChevronDownIcon } from '@elementor/icons';
|
|
3
4
|
import {
|
|
4
5
|
Collapse,
|
|
6
|
+
Divider,
|
|
5
7
|
IconButton,
|
|
6
8
|
List,
|
|
7
9
|
ListItem,
|
|
8
10
|
ListItemIcon,
|
|
9
11
|
ListItemText,
|
|
10
12
|
styled,
|
|
11
|
-
SvgIconProps,
|
|
12
|
-
Divider,
|
|
13
|
+
type SvgIconProps,
|
|
13
14
|
} from '@elementor/ui';
|
|
14
|
-
import { ChevronDownIcon } from '@elementor/icons';
|
|
15
15
|
|
|
16
16
|
type Props = {
|
|
17
17
|
label: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { Error404TemplateIcon } from '@elementor/icons';
|
|
2
3
|
import { Box, Link, Typography } from '@elementor/ui';
|
|
3
4
|
import { __ } from '@wordpress/i18n';
|
|
4
|
-
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
export default function ErrorState() {
|
|
7
7
|
return (
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Box, ListItem, TextField, IconButton, CircularProgress, ListItemText } from '@elementor/ui';
|
|
2
|
+
import { type FocusEvent, type FormEvent, type MutableRefObject, useRef, useState } from 'react';
|
|
4
3
|
import { XIcon } from '@elementor/icons';
|
|
4
|
+
import { Box, CircularProgress, IconButton, ListItem, ListItemText, TextField } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
6
7
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
7
8
|
|
|
8
9
|
type Props = {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { __useNavigateToDocument as useNavigateToDocument } from '@elementor/editor-documents';
|
|
2
3
|
import { __ } from '@wordpress/i18n';
|
|
4
|
+
|
|
3
5
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
4
6
|
import { usePostActions } from '../../../../hooks/use-posts-actions';
|
|
5
7
|
import EditModeTemplate from './edit-mode-template';
|
|
6
|
-
import { __useNavigateToDocument as useNavigateToDocument } from '@elementor/editor-documents';
|
|
7
8
|
|
|
8
9
|
export default function ListItemCreate() {
|
|
9
10
|
const { type, resetEditMode } = usePostListContext();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { __useNavigateToDocument as useNavigateToDocument } from '@elementor/editor-documents';
|
|
2
3
|
import { __ } from '@wordpress/i18n';
|
|
4
|
+
|
|
3
5
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
4
6
|
import { usePostActions } from '../../../../hooks/use-posts-actions';
|
|
5
7
|
import EditModeTemplate from './edit-mode-template';
|
|
6
|
-
import { __useNavigateToDocument as useNavigateToDocument } from '@elementor/editor-documents';
|
|
7
8
|
|
|
8
9
|
export default function ListItemDuplicate() {
|
|
9
10
|
const { type, editMode, resetEditMode } = usePostListContext();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { __useActiveDocument as useActiveDocument } from '@elementor/editor-documents';
|
|
3
|
+
|
|
2
4
|
import { usePostListContext } from '../../../../contexts/post-list-context';
|
|
3
5
|
import { usePostActions } from '../../../../hooks/use-posts-actions';
|
|
4
|
-
import { Post } from '../../../../types';
|
|
5
|
-
import EditModeTemplate from './edit-mode-template';
|
|
6
|
-
import { __useActiveDocument as useActiveDocument } from '@elementor/editor-documents';
|
|
7
6
|
import useRenameActiveDocument from '../../../../hooks/use-rename-active-document';
|
|
7
|
+
import { type Post } from '../../../../types';
|
|
8
|
+
import EditModeTemplate from './edit-mode-template';
|
|
8
9
|
|
|
9
10
|
type Props = {
|
|
10
11
|
post: Post;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
__useActiveDocument as useActiveDocument,
|
|
4
|
+
__useNavigateToDocument as useNavigateToDocument,
|
|
5
|
+
} from '@elementor/editor-documents';
|
|
6
|
+
import { DotsVerticalIcon, HomeIcon } from '@elementor/icons';
|
|
2
7
|
import {
|
|
3
8
|
bindMenu,
|
|
4
9
|
bindTrigger,
|
|
@@ -12,19 +17,15 @@ import {
|
|
|
12
17
|
Typography,
|
|
13
18
|
usePopupState,
|
|
14
19
|
} from '@elementor/ui';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
__useNavigateToDocument as useNavigateToDocument,
|
|
19
|
-
} from '@elementor/editor-documents';
|
|
20
|
+
import { __ } from '@wordpress/i18n';
|
|
21
|
+
|
|
22
|
+
import { type Post } from '../../../../types';
|
|
20
23
|
import PageTitleAndStatus from '../../../shared/page-title-and-status';
|
|
21
|
-
import Rename from '../../actions-menu/actions/rename';
|
|
22
|
-
import Duplicate from '../../actions-menu/actions/duplicate';
|
|
23
24
|
import Delete from '../../actions-menu/actions/delete';
|
|
24
|
-
import
|
|
25
|
+
import Duplicate from '../../actions-menu/actions/duplicate';
|
|
26
|
+
import Rename from '../../actions-menu/actions/rename';
|
|
25
27
|
import SetHome from '../../actions-menu/actions/set-home';
|
|
26
|
-
import
|
|
27
|
-
import { __ } from '@wordpress/i18n';
|
|
28
|
+
import View from '../../actions-menu/actions/view';
|
|
28
29
|
|
|
29
30
|
const DisabledPostTooltip = ( { children, isDisabled }: { children: React.ReactNode; isDisabled: boolean } ) => {
|
|
30
31
|
if ( isDisabled ) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import
|
|
2
|
+
|
|
3
|
+
import { usePostListContext } from '../../../contexts/post-list-context';
|
|
4
|
+
import { type Post } from '../../../types';
|
|
4
5
|
import ListItemCreate from './list-items/list-item-create';
|
|
5
6
|
import ListItemDuplicate from './list-items/list-item-duplicate';
|
|
7
|
+
import ListItemRename from './list-items/list-item-rename';
|
|
6
8
|
import ListItemView from './list-items/list-item-view';
|
|
7
|
-
import { usePostListContext } from '../../../contexts/post-list-context';
|
|
8
9
|
|
|
9
10
|
export default function PostListItem( { post }: { post?: Post } ) {
|
|
10
11
|
const { editMode } = usePostListContext();
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PageTypeIcon } from '@elementor/icons';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { usePostListContext } from '../../../contexts/post-list-context';
|
|
3
|
+
import { Box, Button, CircularProgress, List, Skeleton } from '@elementor/ui';
|
|
4
|
+
|
|
6
5
|
import { postTypesMap } from '../../../api/post';
|
|
7
|
-
import
|
|
8
|
-
import PostListItem from './post-list-item';
|
|
6
|
+
import { usePostListContext } from '../../../contexts/post-list-context';
|
|
9
7
|
import { useHomepage } from '../../../hooks/use-homepage';
|
|
8
|
+
import { usePosts } from '../../../hooks/use-posts';
|
|
10
9
|
import AddNewButton from '../add-new-button';
|
|
10
|
+
import CollapsibleList from './collapsible-list';
|
|
11
11
|
import ErrorState from './error-state';
|
|
12
|
+
import PostListItem from './post-list-item';
|
|
12
13
|
|
|
13
14
|
type Props = {
|
|
14
15
|
isOpenByDefault?: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';
|
|
3
3
|
import { __ } from '@wordpress/i18n';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { PostListContextProvider } from '../../contexts/post-list-context';
|
|
6
6
|
import ErrorSnackbar from './error-snackbar';
|
|
7
|
+
import PostsCollapsibleList from './posts-list/posts-collapsible-list';
|
|
7
8
|
|
|
8
9
|
const Shell = () => {
|
|
9
10
|
const [ isErrorSnackbarOpen, setIsErrorSnackbarOpen ] = React.useState( false );
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { CircularProgress, ListItemIcon, ListItemText, MenuItem, MenuItemProps } from '@elementor/ui';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { __useNavigateToDocument as useNavigateToDocument } from '@elementor/editor-documents';
|
|
4
3
|
import { PlusIcon } from '@elementor/icons';
|
|
4
|
+
import { CircularProgress, ListItemIcon, ListItemText, MenuItem, type MenuItemProps } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
import useCreatePage from '../../hooks/use-create-page';
|
|
7
8
|
import useUser from '../../hooks/use-user';
|
|
8
9
|
|
|
9
10
|
type Props = MenuItemProps & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { type Document } from '@elementor/editor-documents';
|
|
3
|
+
import { Stack, Tooltip as BaseTooltip, type TooltipProps, Typography } from '@elementor/ui';
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
title: Document[ 'title' ];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import DocTypeChip from './chip-doc-type';
|
|
2
|
-
import { MenuItem, MenuItemProps, ListItemText } from '@elementor/ui';
|
|
3
1
|
import * as React from 'react';
|
|
4
2
|
import { __useNavigateToDocument as useNavigateToDocument } from '@elementor/editor-documents';
|
|
3
|
+
import { ListItemText, MenuItem, type MenuItemProps } from '@elementor/ui';
|
|
4
|
+
|
|
5
5
|
import { useReverseHtmlEntities } from '../../hooks/use-reverse-html-entities';
|
|
6
|
-
import { RecentPost } from '../../types';
|
|
6
|
+
import { type RecentPost } from '../../types';
|
|
7
|
+
import DocTypeChip from './chip-doc-type';
|
|
7
8
|
|
|
8
9
|
type Props = MenuItemProps & {
|
|
9
10
|
post: RecentPost;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
__useActiveDocument as useActiveDocument,
|
|
4
|
+
__useHostDocument as useHostDocument,
|
|
5
|
+
} from '@elementor/editor-documents';
|
|
6
|
+
import { ChevronDownIcon } from '@elementor/icons';
|
|
2
7
|
import {
|
|
3
8
|
bindMenu,
|
|
4
|
-
usePopupState,
|
|
5
9
|
bindTrigger,
|
|
6
|
-
Menu,
|
|
7
10
|
Button,
|
|
8
|
-
ListSubheader,
|
|
9
11
|
Divider,
|
|
10
12
|
ListItemText,
|
|
13
|
+
ListSubheader,
|
|
14
|
+
Menu,
|
|
11
15
|
MenuItem,
|
|
16
|
+
usePopupState,
|
|
12
17
|
} from '@elementor/ui';
|
|
13
|
-
import { ChevronDownIcon } from '@elementor/icons';
|
|
14
|
-
import {
|
|
15
|
-
__useActiveDocument as useActiveDocument,
|
|
16
|
-
__useHostDocument as useHostDocument,
|
|
17
|
-
} from '@elementor/editor-documents';
|
|
18
|
-
import Indicator from './indicator';
|
|
19
|
-
import useRecentPosts from '../../hooks/use-recent-posts';
|
|
20
18
|
import { __ } from '@wordpress/i18n';
|
|
21
|
-
|
|
22
|
-
import { CreatePostListItem } from './create-post-list-item';
|
|
23
|
-
import { useReverseHtmlEntities } from '../../hooks/use-reverse-html-entities';
|
|
19
|
+
|
|
24
20
|
import { NUMBER_OF_RECENT_POSTS } from '../../api/recent-posts';
|
|
25
|
-
import
|
|
21
|
+
import useRecentPosts from '../../hooks/use-recent-posts';
|
|
22
|
+
import { useReverseHtmlEntities } from '../../hooks/use-reverse-html-entities';
|
|
23
|
+
import { type ExtendedWindow } from '../../types';
|
|
24
|
+
import { CreatePostListItem } from './create-post-list-item';
|
|
25
|
+
import Indicator from './indicator';
|
|
26
|
+
import { PostListItem } from './post-list-item';
|
|
26
27
|
|
|
27
28
|
export default function RecentlyEdited() {
|
|
28
29
|
const activeDocument = useActiveDocument();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { createContext, type Dispatch, type ReactNode, type SetStateAction, useContext, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { type Slug } from '../api/post';
|
|
4
5
|
|
|
5
6
|
export type EditMode =
|
|
6
7
|
| {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useMutation, useQueryClient } from '@elementor/query';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { type Settings, updateSettings } from '../api/settings';
|
|
3
4
|
import { settingsQueryKey } from './use-homepage';
|
|
4
5
|
|
|
5
6
|
export function useHomepageActions() {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { useMutation, useQueryClient } from '@elementor/query';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createRequest,
|
|
5
|
+
deleteRequest,
|
|
6
|
+
duplicateRequest,
|
|
7
|
+
type NewPost,
|
|
8
|
+
type Slug,
|
|
9
|
+
type UpdatePost,
|
|
10
|
+
updateRequest,
|
|
11
|
+
} from '../api/post';
|
|
3
12
|
import { postsQueryKey } from './use-posts';
|
|
4
13
|
import { recentPostsQueryKey } from './use-recent-posts';
|
|
5
14
|
|
package/src/hooks/use-posts.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useInfiniteQuery } from '@elementor/query';
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { getRequest, type PostsResponse, type Slug } from '../api/post';
|
|
4
|
+
import { type Post } from '../types';
|
|
4
5
|
|
|
5
6
|
export const postsQueryKey = ( postTypeSlug: string ) => [ 'site-navigation', 'posts', postTypeSlug ];
|
|
6
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type ExtendedWindow } from '@elementor/editor-documents';
|
|
1
2
|
import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';
|
|
2
|
-
import { ExtendedWindow } from '@elementor/editor-documents';
|
|
3
3
|
|
|
4
4
|
function getV1DocumentsManager() {
|
|
5
5
|
const documentsManager = ( window as unknown as ExtendedWindow ).elementor?.documents;
|
package/src/hooks/use-user.ts
CHANGED
package/src/icons-map.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
PageTypeIcon,
|
|
3
|
+
ContainerTemplateIcon,
|
|
4
4
|
PageTemplateIcon,
|
|
5
|
+
PageTypeIcon,
|
|
6
|
+
PostTypeIcon,
|
|
5
7
|
SectionTemplateIcon,
|
|
6
|
-
ContainerTemplateIcon,
|
|
7
8
|
} from '@elementor/icons';
|
|
8
9
|
|
|
9
|
-
import * as React from 'react';
|
|
10
|
-
|
|
11
10
|
type IconsMap = {
|
|
12
11
|
[ key: string ]: React.ElementType;
|
|
13
12
|
};
|
package/src/init.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import RecentlyEdited from './components/top-bar/recently-edited';
|
|
2
1
|
import { injectIntoPageIndication, toolsMenu } from '@elementor/editor-app-bar';
|
|
3
|
-
import { useToggleButtonProps } from './hooks/use-toggle-button-props';
|
|
4
2
|
import { __registerPanel } from '@elementor/editor-panels';
|
|
3
|
+
|
|
5
4
|
import { panel } from './components/panel/panel';
|
|
5
|
+
import RecentlyEdited from './components/top-bar/recently-edited';
|
|
6
6
|
import { env } from './env';
|
|
7
|
+
import { useToggleButtonProps } from './hooks/use-toggle-button-props';
|
|
7
8
|
|
|
8
9
|
export default function init() {
|
|
9
10
|
registerTopBarMenuItems();
|