@elementor/editor-site-navigation 0.22.5 → 0.22.7

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +38 -328
  2. package/dist/index.js +147 -156
  3. package/dist/index.mjs +168 -175
  4. package/package.json +49 -49
  5. package/src/api/post.ts +18 -18
  6. package/src/api/recent-posts.ts +1 -1
  7. package/src/api/settings.ts +4 -4
  8. package/src/api/user.ts +4 -4
  9. package/src/components/panel/actions-menu/action-menu-item.tsx +7 -10
  10. package/src/components/panel/actions-menu/actions/__tests__/set-home.test.tsx +12 -9
  11. package/src/components/panel/actions-menu/actions/delete.tsx +27 -25
  12. package/src/components/panel/actions-menu/actions/duplicate.tsx +5 -7
  13. package/src/components/panel/actions-menu/actions/rename.tsx +11 -13
  14. package/src/components/panel/actions-menu/actions/set-home.tsx +6 -8
  15. package/src/components/panel/actions-menu/actions/view.tsx +3 -5
  16. package/src/components/panel/error-snackbar.tsx +4 -3
  17. package/src/components/panel/panel.ts +1 -5
  18. package/src/components/panel/posts-list/__tests__/posts-collapsible-list.test.tsx +66 -19
  19. package/src/components/panel/posts-list/collapsible-list.tsx +38 -29
  20. package/src/components/panel/posts-list/error-state.tsx +35 -27
  21. package/src/components/panel/posts-list/list-items/edit-mode-template.tsx +18 -40
  22. package/src/components/panel/posts-list/list-items/list-item-create.tsx +5 -1
  23. package/src/components/panel/posts-list/list-items/list-item-duplicate.tsx +5 -1
  24. package/src/components/panel/posts-list/list-items/list-item-rename.tsx +3 -5
  25. package/src/components/panel/posts-list/list-items/list-item-view.tsx +20 -19
  26. package/src/components/panel/posts-list/posts-collapsible-list.tsx +22 -24
  27. package/src/components/shared/page-title-and-status.tsx +4 -2
  28. package/src/components/top-bar/__tests__/add-new-page.test.tsx +33 -16
  29. package/src/components/top-bar/__tests__/recently-edited.test.tsx +157 -120
  30. package/src/components/top-bar/chip-doc-type.tsx +1 -3
  31. package/src/components/top-bar/create-post-list-item.tsx +1 -1
  32. package/src/components/top-bar/indicator.tsx +17 -15
  33. package/src/components/top-bar/post-list-item.tsx +2 -6
  34. package/src/components/top-bar/recently-edited.tsx +13 -19
  35. package/src/contexts/post-list-context.tsx +40 -34
  36. package/src/env.ts +2 -2
  37. package/src/hooks/__tests__/use-posts.test.ts +19 -3
  38. package/src/hooks/use-create-page.ts +2 -2
  39. package/src/hooks/use-homepage.ts +1 -1
  40. package/src/hooks/use-posts.ts +1 -1
  41. package/src/hooks/use-toggle-button-props.ts +1 -5
  42. package/src/hooks/use-user.ts +1 -1
  43. package/src/icons-map.ts +1 -1
  44. package/src/types.ts +22 -22
package/dist/index.mjs CHANGED
@@ -35,7 +35,10 @@ import {
35
35
  MenuItem as MenuItem3
36
36
  } from "@elementor/ui";
37
37
  import { ChevronDownIcon } from "@elementor/icons";
38
- import { __useActiveDocument as useActiveDocument, __useHostDocument as useHostDocument } from "@elementor/editor-documents";
38
+ import {
39
+ __useActiveDocument as useActiveDocument,
40
+ __useHostDocument as useHostDocument
41
+ } from "@elementor/editor-documents";
39
42
 
40
43
  // src/components/top-bar/indicator.tsx
41
44
  import * as React from "react";
@@ -87,9 +90,7 @@ function useRecentPosts() {
87
90
  import { __ as __2 } from "@wordpress/i18n";
88
91
 
89
92
  // src/components/top-bar/chip-doc-type.tsx
90
- import {
91
- PostTypeIcon as PostTypeIcon2
92
- } from "@elementor/icons";
93
+ import { PostTypeIcon as PostTypeIcon2 } from "@elementor/icons";
93
94
  import { Chip } from "@elementor/ui";
94
95
  import * as React2 from "react";
95
96
  var iconsMap2 = getIconsMap();
@@ -150,14 +151,7 @@ function PostListItem({ post, closePopup, ...props }) {
150
151
  primary: postTitle
151
152
  }
152
153
  ),
153
- /* @__PURE__ */ React3.createElement(
154
- DocTypeChip,
155
- {
156
- postType: post.type.post_type,
157
- docType: post.type.doc_type,
158
- label: post.type.label
159
- }
160
- )
154
+ /* @__PURE__ */ React3.createElement(DocTypeChip, { postType: post.type.post_type, docType: post.type.doc_type, label: post.type.label })
161
155
  );
162
156
  }
163
157
 
@@ -277,26 +271,17 @@ function RecentlyEdited() {
277
271
  const extendedWindow = window;
278
272
  const config = extendedWindow?.elementor?.editorEvents?.config;
279
273
  if (config) {
280
- extendedWindow.elementor.editorEvents.dispatchEvent(
281
- config.names.topBar.documentNameDropdown,
282
- {
283
- location: config.locations.topBar,
284
- secondaryLocation: config.secondaryLocations.documentNameDropdown,
285
- trigger: config.triggers.dropdownClick,
286
- element: config.elements.dropdown
287
- }
288
- );
274
+ extendedWindow.elementor.editorEvents.dispatchEvent(config.names.topBar.documentNameDropdown, {
275
+ location: config.locations.topBar,
276
+ secondaryLocation: config.secondaryLocations.documentNameDropdown,
277
+ trigger: config.triggers.dropdownClick,
278
+ element: config.elements.dropdown
279
+ });
289
280
  }
290
281
  buttonProps.onClick(e);
291
282
  }
292
283
  },
293
- /* @__PURE__ */ React5.createElement(
294
- Indicator,
295
- {
296
- title: documentTitle,
297
- status: document2.status
298
- }
299
- )
284
+ /* @__PURE__ */ React5.createElement(Indicator, { title: documentTitle, status: document2.status })
300
285
  ), /* @__PURE__ */ React5.createElement(
301
286
  Menu,
302
287
  {
@@ -460,13 +445,19 @@ var PostListContextProvider = ({
460
445
  const resetEditMode = () => {
461
446
  setEditMode(defaultValues.editMode);
462
447
  };
463
- return /* @__PURE__ */ React6.createElement(PostListContext.Provider, { value: {
464
- type,
465
- editMode,
466
- setEditMode,
467
- resetEditMode,
468
- setError
469
- } }, children);
448
+ return /* @__PURE__ */ React6.createElement(
449
+ PostListContext.Provider,
450
+ {
451
+ value: {
452
+ type,
453
+ editMode,
454
+ setEditMode,
455
+ resetEditMode,
456
+ setError
457
+ }
458
+ },
459
+ children
460
+ );
470
461
  };
471
462
  function usePostListContext() {
472
463
  const context = useContext(PostListContext);
@@ -479,7 +470,16 @@ function usePostListContext() {
479
470
  // src/components/panel/posts-list/collapsible-list.tsx
480
471
  import * as React7 from "react";
481
472
  import { useState as useState3 } from "react";
482
- import { Collapse, IconButton, List, ListItem, ListItemIcon as ListItemIcon2, ListItemText as ListItemText4, styled, Divider as Divider2 } from "@elementor/ui";
473
+ import {
474
+ Collapse,
475
+ IconButton,
476
+ List,
477
+ ListItem,
478
+ ListItemIcon as ListItemIcon2,
479
+ ListItemText as ListItemText4,
480
+ styled,
481
+ Divider as Divider2
482
+ } from "@elementor/ui";
483
483
  import { ChevronDownIcon as ChevronDownIcon2 } from "@elementor/icons";
484
484
  var RotateIcon = styled(ChevronDownIcon2, {
485
485
  shouldForwardProp: (prop) => prop !== "isOpen"
@@ -499,19 +499,25 @@ function CollapsibleList({
499
499
  children
500
500
  }) {
501
501
  const [isOpen, setIsOpen] = useState3(isOpenByDefault);
502
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(ListItem, null, /* @__PURE__ */ React7.createElement(StyledListItemIcon, { sx: {
503
- color: "text.secondary"
504
- } }, /* @__PURE__ */ React7.createElement(
505
- IconButton,
502
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(ListItem, null, /* @__PURE__ */ React7.createElement(
503
+ StyledListItemIcon,
506
504
  {
507
- onClick: () => setIsOpen((prev) => !prev),
508
- size: "small",
509
505
  sx: {
510
- color: "inherit"
506
+ color: "text.secondary"
511
507
  }
512
508
  },
513
- /* @__PURE__ */ React7.createElement(RotateIcon, { fontSize: "small", isOpen })
514
- )), /* @__PURE__ */ React7.createElement(
509
+ /* @__PURE__ */ React7.createElement(
510
+ IconButton,
511
+ {
512
+ onClick: () => setIsOpen((prev) => !prev),
513
+ size: "small",
514
+ sx: {
515
+ color: "inherit"
516
+ }
517
+ },
518
+ /* @__PURE__ */ React7.createElement(RotateIcon, { fontSize: "small", isOpen })
519
+ )
520
+ ), /* @__PURE__ */ React7.createElement(
515
521
  StyledListItemIcon,
516
522
  {
517
523
  size: "small",
@@ -520,15 +526,13 @@ function CollapsibleList({
520
526
  }
521
527
  },
522
528
  /* @__PURE__ */ React7.createElement(Icon, { fontSize: "small" })
523
- ), /* @__PURE__ */ React7.createElement(ListItemText4, { primaryTypographyProps: { variant: "subtitle2", component: "span" }, primary: label })), /* @__PURE__ */ React7.createElement(
524
- Collapse,
529
+ ), /* @__PURE__ */ React7.createElement(
530
+ ListItemText4,
525
531
  {
526
- in: isOpen,
527
- timeout: "auto",
528
- unmountOnExit: true
529
- },
530
- /* @__PURE__ */ React7.createElement(List, { dense: true }, children)
531
- ), /* @__PURE__ */ React7.createElement(Divider2, { sx: { mt: 1 } }));
532
+ primaryTypographyProps: { variant: "subtitle2", component: "span" },
533
+ primary: label
534
+ }
535
+ )), /* @__PURE__ */ React7.createElement(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React7.createElement(List, { dense: true }, children)), /* @__PURE__ */ React7.createElement(Divider2, { sx: { mt: 1 } }));
532
536
  }
533
537
 
534
538
  // src/components/panel/posts-list/post-list-item.tsx
@@ -577,14 +581,7 @@ function useInvalidatePosts(postTypeSlug) {
577
581
  // src/components/panel/posts-list/list-items/edit-mode-template.tsx
578
582
  import * as React8 from "react";
579
583
  import { useState as useState4, useRef } from "react";
580
- import {
581
- Box,
582
- ListItem as ListItem2,
583
- TextField,
584
- IconButton as IconButton2,
585
- CircularProgress as CircularProgress2,
586
- ListItemText as ListItemText5
587
- } from "@elementor/ui";
584
+ import { Box, ListItem as ListItem2, TextField, IconButton as IconButton2, CircularProgress as CircularProgress2, ListItemText as ListItemText5 } from "@elementor/ui";
588
585
  import { XIcon } from "@elementor/icons";
589
586
  import { __ as __4 } from "@wordpress/i18n";
590
587
  function EditModeTemplate({ postTitle, isLoading, callback }) {
@@ -623,41 +620,25 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
623
620
  }
624
621
  setTitle(value);
625
622
  };
626
- return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
627
- ListItem2,
623
+ return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(ListItem2, { secondaryAction: /* @__PURE__ */ React8.createElement(CloseButton, { isLoading, closeButton }) }, /* @__PURE__ */ React8.createElement(Box, { width: "100%", component: "form", onSubmit: onFormSubmit }, /* @__PURE__ */ React8.createElement(
624
+ TextField,
628
625
  {
629
- secondaryAction: /* @__PURE__ */ React8.createElement(CloseButton, { isLoading, closeButton })
630
- },
631
- /* @__PURE__ */ React8.createElement(Box, { width: "100%", component: "form", onSubmit: onFormSubmit }, /* @__PURE__ */ React8.createElement(
632
- TextField,
633
- {
634
- autoFocus: true,
635
- fullWidth: true,
636
- value: title,
637
- onChange,
638
- disabled: isLoading,
639
- error: !!inputError,
640
- onBlur,
641
- variant: "outlined",
642
- color: "secondary",
643
- size: "small"
644
- }
645
- ))
646
- ), inputError && /* @__PURE__ */ React8.createElement(ListItem2, null, /* @__PURE__ */ React8.createElement(ListItemText5, { sx: { color: "error.main" } }, inputError)));
626
+ autoFocus: true,
627
+ fullWidth: true,
628
+ value: title,
629
+ onChange,
630
+ disabled: isLoading,
631
+ error: !!inputError,
632
+ onBlur,
633
+ variant: "outlined",
634
+ color: "secondary",
635
+ size: "small"
636
+ }
637
+ ))), inputError && /* @__PURE__ */ React8.createElement(ListItem2, null, /* @__PURE__ */ React8.createElement(ListItemText5, { sx: { color: "error.main" } }, inputError)));
647
638
  }
648
639
  function CloseButton({ isLoading, closeButton }) {
649
640
  const { resetEditMode } = usePostListContext();
650
- return /* @__PURE__ */ React8.createElement(
651
- IconButton2,
652
- {
653
- size: "small",
654
- color: "secondary",
655
- onClick: resetEditMode,
656
- ref: closeButton,
657
- disabled: isLoading
658
- },
659
- isLoading ? /* @__PURE__ */ React8.createElement(CircularProgress2, null) : /* @__PURE__ */ React8.createElement(XIcon, { fontSize: "small" })
660
- );
641
+ return /* @__PURE__ */ React8.createElement(IconButton2, { size: "small", color: "secondary", onClick: resetEditMode, ref: closeButton, disabled: isLoading }, isLoading ? /* @__PURE__ */ React8.createElement(CircularProgress2, null) : /* @__PURE__ */ React8.createElement(XIcon, { fontSize: "small" }));
661
642
  }
662
643
 
663
644
  // src/components/panel/posts-list/list-items/list-item-rename.tsx
@@ -736,7 +717,14 @@ function ListItemCreate() {
736
717
  resetEditMode();
737
718
  }
738
719
  };
739
- return /* @__PURE__ */ React10.createElement(EditModeTemplate, { postTitle: __5("New Page", "elementor"), isLoading: createPost.isPending, callback: createPostCallback });
720
+ return /* @__PURE__ */ React10.createElement(
721
+ EditModeTemplate,
722
+ {
723
+ postTitle: __5("New Page", "elementor"),
724
+ isLoading: createPost.isPending,
725
+ callback: createPostCallback
726
+ }
727
+ );
740
728
  }
741
729
 
742
730
  // src/components/panel/posts-list/list-items/list-item-duplicate.tsx
@@ -764,7 +752,14 @@ function ListItemDuplicate() {
764
752
  resetEditMode();
765
753
  }
766
754
  };
767
- return /* @__PURE__ */ React11.createElement(EditModeTemplate, { postTitle: `${editMode.details.title} ${__6("copy", "elementor")}`, isLoading: duplicatePost.isPending, callback: duplicatePostCallback });
755
+ return /* @__PURE__ */ React11.createElement(
756
+ EditModeTemplate,
757
+ {
758
+ postTitle: `${editMode.details.title} ${__6("copy", "elementor")}`,
759
+ isLoading: duplicatePost.isPending,
760
+ callback: duplicatePostCallback
761
+ }
762
+ );
768
763
  }
769
764
 
770
765
  // src/components/panel/posts-list/list-items/list-item-view.tsx
@@ -783,7 +778,10 @@ import {
783
778
  usePopupState as usePopupState2
784
779
  } from "@elementor/ui";
785
780
  import { DotsVerticalIcon, HomeIcon as HomeIcon2 } from "@elementor/icons";
786
- import { __useActiveDocument as useActiveDocument4, __useNavigateToDocument as useNavigateToDocument5 } from "@elementor/editor-documents";
781
+ import {
782
+ __useActiveDocument as useActiveDocument4,
783
+ __useNavigateToDocument as useNavigateToDocument5
784
+ } from "@elementor/editor-documents";
787
785
 
788
786
  // src/components/shared/page-title-and-status.tsx
789
787
  import * as React12 from "react";
@@ -837,15 +835,17 @@ import { __ as __7 } from "@wordpress/i18n";
837
835
 
838
836
  // src/components/panel/actions-menu/action-menu-item.tsx
839
837
  import * as React13 from "react";
840
- import {
841
- ListItemIcon as ListItemIcon3,
842
- ListItemText as ListItemText6,
843
- MenuItem as MenuItem4
844
- } from "@elementor/ui";
838
+ import { ListItemIcon as ListItemIcon3, ListItemText as ListItemText6, MenuItem as MenuItem4 } from "@elementor/ui";
845
839
  function ActionMenuItem({ title, icon: Icon, MenuItemProps: MenuItemProps3 }) {
846
- return /* @__PURE__ */ React13.createElement(MenuItem4, { ...MenuItemProps3 }, /* @__PURE__ */ React13.createElement(ListItemIcon3, { sx: {
847
- color: "inherit"
848
- } }, /* @__PURE__ */ React13.createElement(Icon, null)), /* @__PURE__ */ React13.createElement(ListItemText6, { primary: title }));
840
+ return /* @__PURE__ */ React13.createElement(MenuItem4, { ...MenuItemProps3 }, /* @__PURE__ */ React13.createElement(
841
+ ListItemIcon3,
842
+ {
843
+ sx: {
844
+ color: "inherit"
845
+ }
846
+ },
847
+ /* @__PURE__ */ React13.createElement(Icon, null)
848
+ ), /* @__PURE__ */ React13.createElement(ListItemText6, { primary: title }));
849
849
  }
850
850
 
851
851
  // src/components/panel/actions-menu/actions/rename.tsx
@@ -937,7 +937,10 @@ function Delete({ post }) {
937
937
  }
938
938
  ), isDialogOpen && /* @__PURE__ */ React16.createElement(DeleteDialog, { post, setIsDialogOpen }));
939
939
  }
940
- function DeleteDialog({ post, setIsDialogOpen }) {
940
+ function DeleteDialog({
941
+ post,
942
+ setIsDialogOpen
943
+ }) {
941
944
  const { type } = usePostListContext();
942
945
  const { deletePost } = usePostActions(type);
943
946
  const { setError } = usePostListContext();
@@ -956,18 +959,19 @@ function DeleteDialog({ post, setIsDialogOpen }) {
956
959
  }
957
960
  setIsDialogOpen(false);
958
961
  };
959
- return /* @__PURE__ */ React16.createElement(
960
- Dialog,
962
+ return /* @__PURE__ */ React16.createElement(Dialog, { open: true, onClose: handleCancel, "aria-labelledby": "delete-dialog" }, /* @__PURE__ */ React16.createElement(DialogTitle, { noWrap: true }, dialogTitle), /* @__PURE__ */ React16.createElement(Divider3, null), /* @__PURE__ */ React16.createElement(DialogContent, null, /* @__PURE__ */ React16.createElement(DialogContentText, null, __9(
963
+ "The page and its content will be deleted forever and we won\u2019t be able to recover them.",
964
+ "elementor"
965
+ ))), /* @__PURE__ */ React16.createElement(DialogActions, null, /* @__PURE__ */ React16.createElement(
966
+ Button2,
961
967
  {
962
- open: true,
963
- onClose: handleCancel,
964
- "aria-labelledby": "delete-dialog"
968
+ variant: "contained",
969
+ color: "secondary",
970
+ onClick: handleCancel,
971
+ disabled: deletePost.isPending
965
972
  },
966
- /* @__PURE__ */ React16.createElement(DialogTitle, { noWrap: true }, dialogTitle),
967
- /* @__PURE__ */ React16.createElement(Divider3, null),
968
- /* @__PURE__ */ React16.createElement(DialogContent, null, /* @__PURE__ */ React16.createElement(DialogContentText, null, __9("The page and its content will be deleted forever and we won\u2019t be able to recover them.", "elementor"))),
969
- /* @__PURE__ */ React16.createElement(DialogActions, null, /* @__PURE__ */ React16.createElement(Button2, { variant: "contained", color: "secondary", onClick: handleCancel, disabled: deletePost.isPending }, __9("Cancel", "elementor")), /* @__PURE__ */ React16.createElement(Button2, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? __9("Delete", "elementor") : /* @__PURE__ */ React16.createElement(CircularProgress3, null)))
970
- );
973
+ __9("Cancel", "elementor")
974
+ ), /* @__PURE__ */ React16.createElement(Button2, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? __9("Delete", "elementor") : /* @__PURE__ */ React16.createElement(CircularProgress3, null))));
971
975
  }
972
976
 
973
977
  // src/components/panel/actions-menu/actions/view.tsx
@@ -1077,15 +1081,7 @@ import { __ as __12 } from "@wordpress/i18n";
1077
1081
  var DisabledPostTooltip = ({ children, isDisabled }) => {
1078
1082
  if (isDisabled) {
1079
1083
  const title = /* @__PURE__ */ React19.createElement(Typography3, { variant: "caption" }, "You cannot edit this page.", /* @__PURE__ */ React19.createElement("br", null), "To edit it directly, contact the site owner");
1080
- return /* @__PURE__ */ React19.createElement(
1081
- Tooltip2,
1082
- {
1083
- title,
1084
- placement: "bottom",
1085
- arrow: false
1086
- },
1087
- children
1088
- );
1084
+ return /* @__PURE__ */ React19.createElement(Tooltip2, { title, placement: "bottom", arrow: false }, children);
1089
1085
  }
1090
1086
  return /* @__PURE__ */ React19.createElement(React19.Fragment, null, children);
1091
1087
  };
@@ -1105,15 +1101,7 @@ function ListItemView({ post }) {
1105
1101
  ListItem3,
1106
1102
  {
1107
1103
  disablePadding: true,
1108
- secondaryAction: /* @__PURE__ */ React19.createElement(
1109
- IconButton3,
1110
- {
1111
- value: true,
1112
- size: "small",
1113
- ...bindTrigger2(popupState)
1114
- },
1115
- /* @__PURE__ */ React19.createElement(DotsVerticalIcon, { fontSize: "small" })
1116
- )
1104
+ secondaryAction: /* @__PURE__ */ React19.createElement(IconButton3, { value: true, size: "small", ...bindTrigger2(popupState) }, /* @__PURE__ */ React19.createElement(DotsVerticalIcon, { fontSize: "small" }))
1117
1105
  },
1118
1106
  /* @__PURE__ */ React19.createElement(
1119
1107
  ListItemButton,
@@ -1195,40 +1183,53 @@ import { Box as Box3, Link, Typography as Typography4 } from "@elementor/ui";
1195
1183
  import { __ as __14 } from "@wordpress/i18n";
1196
1184
  import * as React22 from "react";
1197
1185
  function ErrorState() {
1198
- return /* @__PURE__ */ React22.createElement(Box3, { sx: {
1199
- display: "flex",
1200
- flexDirection: "column",
1201
- justifyContent: "center",
1202
- alignItems: "center",
1203
- pt: "40px",
1204
- gap: "16px"
1205
- } }, /* @__PURE__ */ React22.createElement(Error404TemplateIcon, null), /* @__PURE__ */ React22.createElement(Box3, { sx: {
1206
- display: "flex",
1207
- flexDirection: "column",
1208
- justifyContent: "center",
1209
- alignItems: "center",
1210
- gap: "8px"
1211
- } }, /* @__PURE__ */ React22.createElement(Typography4, { variant: "body1", color: "text.primary" }, __14("We couldn\u2019t display your pages.", "elementor")), /* @__PURE__ */ React22.createElement(Box3, null, /* @__PURE__ */ React22.createElement(Typography4, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __14("It\u2019s probably a temporary issue.", "elementor")), /* @__PURE__ */ React22.createElement(Typography4, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __14("If the problem persists,", "elementor"), " ", /* @__PURE__ */ React22.createElement(Link, { target: "_blank", href: "https://go.elementor.com/wp-editor-support-open-ticket/" }, "Notify support")))));
1186
+ return /* @__PURE__ */ React22.createElement(
1187
+ Box3,
1188
+ {
1189
+ sx: {
1190
+ display: "flex",
1191
+ flexDirection: "column",
1192
+ justifyContent: "center",
1193
+ alignItems: "center",
1194
+ pt: "40px",
1195
+ gap: "16px"
1196
+ }
1197
+ },
1198
+ /* @__PURE__ */ React22.createElement(Error404TemplateIcon, null),
1199
+ /* @__PURE__ */ React22.createElement(
1200
+ Box3,
1201
+ {
1202
+ sx: {
1203
+ display: "flex",
1204
+ flexDirection: "column",
1205
+ justifyContent: "center",
1206
+ alignItems: "center",
1207
+ gap: "8px"
1208
+ }
1209
+ },
1210
+ /* @__PURE__ */ React22.createElement(Typography4, { variant: "body1", color: "text.primary" }, __14("We couldn\u2019t display your pages.", "elementor")),
1211
+ /* @__PURE__ */ React22.createElement(Box3, null, /* @__PURE__ */ React22.createElement(Typography4, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __14("It\u2019s probably a temporary issue.", "elementor")), /* @__PURE__ */ React22.createElement(Typography4, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __14("If the problem persists,", "elementor"), " ", /* @__PURE__ */ React22.createElement(Link, { target: "_blank", href: "https://go.elementor.com/wp-editor-support-open-ticket/" }, "Notify support")))
1212
+ )
1213
+ );
1212
1214
  }
1213
1215
 
1214
1216
  // src/components/panel/posts-list/posts-collapsible-list.tsx
1215
1217
  function PostsCollapsibleList({ isOpenByDefault = false }) {
1216
1218
  const { type, editMode } = usePostListContext();
1217
- const { data: { posts, total }, isLoading: postsLoading, isError: postsError, fetchNextPage, hasNextPage, isFetchingNextPage } = usePosts(type);
1219
+ const {
1220
+ data: { posts, total },
1221
+ isLoading: postsLoading,
1222
+ isError: postsError,
1223
+ fetchNextPage,
1224
+ hasNextPage,
1225
+ isFetchingNextPage
1226
+ } = usePosts(type);
1218
1227
  const { data: homepageId } = useHomepage();
1219
1228
  if (postsError) {
1220
1229
  return /* @__PURE__ */ React23.createElement(ErrorState, null);
1221
1230
  }
1222
1231
  if (!posts || postsLoading) {
1223
- return /* @__PURE__ */ React23.createElement(Box4, { sx: { px: 5 } }, /* @__PURE__ */ React23.createElement(
1224
- Box4,
1225
- {
1226
- display: "flex",
1227
- justifyContent: "flex-end",
1228
- alignItems: "center"
1229
- },
1230
- /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 4 }, animation: "wave", variant: "rounded", width: "110px", height: "28px" })
1231
- ), /* @__PURE__ */ React23.createElement(Box4, null, /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "100%", height: "24px" }), /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" })));
1232
+ return /* @__PURE__ */ React23.createElement(Box4, { sx: { px: 5 } }, /* @__PURE__ */ React23.createElement(Box4, { display: "flex", justifyContent: "flex-end", alignItems: "center" }, /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 4 }, animation: "wave", variant: "rounded", width: "110px", height: "28px" })), /* @__PURE__ */ React23.createElement(Box4, null, /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "100%", height: "24px" }), /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React23.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" })));
1232
1233
  }
1233
1234
  const label = `${postTypesMap[type].labels.plural_name} (${total.toString()})`;
1234
1235
  const mappedPosts = posts.map((post) => {
@@ -1258,22 +1259,18 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
1258
1259
  }
1259
1260
  },
1260
1261
  /* @__PURE__ */ React23.createElement(AddNewButton, null)
1261
- ), /* @__PURE__ */ React23.createElement(List2, { dense: true }, /* @__PURE__ */ React23.createElement(
1262
- CollapsibleList,
1262
+ ), /* @__PURE__ */ React23.createElement(List2, { dense: true }, /* @__PURE__ */ React23.createElement(CollapsibleList, { label, Icon: PageTypeIcon2, isOpenByDefault: isOpenByDefault || false }, sortedPosts.map((post) => {
1263
+ return /* @__PURE__ */ React23.createElement(PostListItem2, { key: post.id, post });
1264
+ }), ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */ React23.createElement(PostListItem2, null), hasNextPage && /* @__PURE__ */ React23.createElement(
1265
+ Box4,
1263
1266
  {
1264
- label,
1265
- Icon: PageTypeIcon2,
1266
- isOpenByDefault: isOpenByDefault || false
1267
+ sx: {
1268
+ display: "flex",
1269
+ justifyContent: "center"
1270
+ }
1267
1271
  },
1268
- sortedPosts.map((post) => {
1269
- return /* @__PURE__ */ React23.createElement(PostListItem2, { key: post.id, post });
1270
- }),
1271
- ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */ React23.createElement(PostListItem2, null),
1272
- hasNextPage && /* @__PURE__ */ React23.createElement(Box4, { sx: {
1273
- display: "flex",
1274
- justifyContent: "center"
1275
- } }, /* @__PURE__ */ React23.createElement(Button4, { onClick: fetchNextPage, color: "secondary" }, isFetchingNextPage ? /* @__PURE__ */ React23.createElement(CircularProgress5, null) : "Load More"))
1276
- )));
1272
+ /* @__PURE__ */ React23.createElement(Button4, { onClick: fetchNextPage, color: "secondary" }, isFetchingNextPage ? /* @__PURE__ */ React23.createElement(CircularProgress5, null) : "Load More")
1273
+ ))));
1277
1274
  }
1278
1275
 
1279
1276
  // src/components/panel/error-snackbar.tsx
@@ -1312,11 +1309,7 @@ var Shell = () => {
1312
1309
  var shell_default = Shell;
1313
1310
 
1314
1311
  // src/components/panel/panel.ts
1315
- var {
1316
- panel,
1317
- usePanelStatus,
1318
- usePanelActions
1319
- } = __createPanel({
1312
+ var { panel, usePanelStatus, usePanelActions } = __createPanel({
1320
1313
  id: "site-navigation-panel",
1321
1314
  component: shell_default
1322
1315
  });
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
1
  {
2
- "name": "@elementor/editor-site-navigation",
3
- "version": "0.22.5",
4
- "private": false,
5
- "author": "Elementor Team",
6
- "homepage": "https://elementor.com/",
7
- "license": "GPL-3.0-or-later",
8
- "main": "dist/index.js",
9
- "module": "dist/index.mjs",
10
- "types": "dist/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.mjs",
14
- "require": "./dist/index.js",
15
- "types": "./dist/index.d.ts"
16
- },
17
- "./package.json": "./package.json"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/elementor/elementor-packages.git",
22
- "directory": "packages/core/editor-site-navigation"
23
- },
24
- "bugs": {
25
- "url": "https://github.com/elementor/elementor-packages/issues"
26
- },
27
- "publishConfig": {
28
- "access": "public"
29
- },
30
- "scripts": {
31
- "build": "tsup src/index.ts --format esm,cjs --dts --clean",
32
- "dev": "tsup --config=../../tsup.dev.ts"
33
- },
34
- "dependencies": {
35
- "@elementor/editor-app-bar": "^0.14.5",
36
- "@elementor/editor-documents": "^0.11.4",
37
- "@elementor/editor-panels": "^0.4.16",
38
- "@elementor/editor-v1-adapters": "^0.7.0",
39
- "@elementor/env": "^0.3.2",
40
- "@elementor/icons": "^0.8.1",
41
- "@elementor/query": "^0.2.1",
42
- "@elementor/ui": "^1.4.61",
43
- "@wordpress/api-fetch": "^6.42.0",
44
- "@wordpress/i18n": "^4.45.0",
45
- "@wordpress/url": "^3.46.0"
46
- },
47
- "peerDependencies": {
48
- "react": "^18.3.1"
49
- },
50
- "gitHead": "ea48212f4a9084fa323c3e70af093c5c0f6aa2d1"
2
+ "name": "@elementor/editor-site-navigation",
3
+ "version": "0.22.7",
4
+ "private": false,
5
+ "author": "Elementor Team",
6
+ "homepage": "https://elementor.com/",
7
+ "license": "GPL-3.0-or-later",
8
+ "main": "dist/index.js",
9
+ "module": "dist/index.mjs",
10
+ "types": "dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.mjs",
14
+ "require": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ },
17
+ "./package.json": "./package.json"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/elementor/elementor-packages.git",
22
+ "directory": "packages/core/editor-site-navigation"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/elementor/elementor-packages/issues"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "scripts": {
31
+ "build": "tsup src/index.ts --format esm,cjs --dts --clean",
32
+ "dev": "tsup --config=../../tsup.dev.ts"
33
+ },
34
+ "dependencies": {
35
+ "@elementor/editor-app-bar": "^0.15.0",
36
+ "@elementor/editor-documents": "^0.11.5",
37
+ "@elementor/editor-panels": "^0.4.17",
38
+ "@elementor/editor-v1-adapters": "^0.8.0",
39
+ "@elementor/env": "^0.3.3",
40
+ "@elementor/icons": "^0.8.2",
41
+ "@elementor/query": "^0.2.1",
42
+ "@elementor/ui": "^1.4.61",
43
+ "@wordpress/api-fetch": "^6.42.0",
44
+ "@wordpress/i18n": "^4.45.0",
45
+ "@wordpress/url": "^3.46.0"
46
+ },
47
+ "peerDependencies": {
48
+ "react": "^18.3.1"
49
+ },
50
+ "gitHead": "7d626115b07f3425b679f7508230f7776f3fe17b"
51
51
  }