@elementor/editor-site-navigation 4.5.0-1209 → 4.5.0-1211
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 +340 -139
- package/dist/index.mjs +322 -121
- package/package.json +10 -10
- package/src/components/panel/posts-list/collapsible-list.tsx +4 -1
- package/src/components/panel/posts-list/post-list-pagination-actions.tsx +76 -0
- package/src/components/panel/posts-list/posts-collapsible-list.tsx +61 -15
- package/src/components/shared/page-title-and-status.tsx +67 -14
- package/src/hooks/use-post-list-pagination.ts +87 -0
package/dist/index.mjs
CHANGED
|
@@ -30,11 +30,11 @@ import { isSidebarEnabled, sidebarTools } from "@elementor/editor-sidebar";
|
|
|
30
30
|
import { createPanel } from "@elementor/editor-panels";
|
|
31
31
|
|
|
32
32
|
// src/components/panel/shell.tsx
|
|
33
|
-
import * as
|
|
34
|
-
import { useState as
|
|
33
|
+
import * as React27 from "react";
|
|
34
|
+
import { useState as useState7 } from "react";
|
|
35
35
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
36
|
-
import { Divider as Divider4, Stack as
|
|
37
|
-
import { __ as
|
|
36
|
+
import { Divider as Divider4, Stack as Stack4 } from "@elementor/ui";
|
|
37
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
38
38
|
|
|
39
39
|
// src/contexts/content-panel-coordinator.tsx
|
|
40
40
|
import * as React from "react";
|
|
@@ -396,8 +396,8 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
396
396
|
var error_snackbar_default = ErrorSnackbar;
|
|
397
397
|
|
|
398
398
|
// src/components/panel/shell-panel-body-content.tsx
|
|
399
|
-
import * as
|
|
400
|
-
import { List as List2, Skeleton as Skeleton2, Stack as
|
|
399
|
+
import * as React26 from "react";
|
|
400
|
+
import { List as List2, Skeleton as Skeleton2, Stack as Stack3 } from "@elementor/ui";
|
|
401
401
|
|
|
402
402
|
// src/contexts/post-list-context.tsx
|
|
403
403
|
import * as React6 from "react";
|
|
@@ -442,10 +442,10 @@ function usePostListContext() {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
445
|
-
import * as
|
|
446
|
-
import { useEffect, useMemo as useMemo4, useState as
|
|
447
|
-
import { Box as
|
|
448
|
-
import { __ as
|
|
445
|
+
import * as React24 from "react";
|
|
446
|
+
import { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef4, useState as useState6 } from "react";
|
|
447
|
+
import { Box as Box7, Skeleton, Typography as Typography5 } from "@elementor/ui";
|
|
448
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
449
449
|
|
|
450
450
|
// src/hooks/use-homepage.ts
|
|
451
451
|
import { useQuery as useQuery2 } from "@elementor/query";
|
|
@@ -474,6 +474,70 @@ function useHomepage() {
|
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
+
// src/hooks/use-post-list-pagination.ts
|
|
478
|
+
import { useCallback as useCallback2, useEffect, useRef as useRef2, useState as useState3 } from "react";
|
|
479
|
+
function usePostListPagination({
|
|
480
|
+
fetchNextPage,
|
|
481
|
+
hasNextPage,
|
|
482
|
+
isFetchingNextPage,
|
|
483
|
+
loadedCount,
|
|
484
|
+
resetKey,
|
|
485
|
+
totalCount
|
|
486
|
+
}) {
|
|
487
|
+
const [visibleCount, setVisibleCount] = useState3(POST_PER_PAGE);
|
|
488
|
+
const pendingVisibleTargetRef = useRef2(null);
|
|
489
|
+
useEffect(() => {
|
|
490
|
+
setVisibleCount(POST_PER_PAGE);
|
|
491
|
+
pendingVisibleTargetRef.current = null;
|
|
492
|
+
}, [resetKey]);
|
|
493
|
+
useEffect(() => {
|
|
494
|
+
const target = pendingVisibleTargetRef.current;
|
|
495
|
+
if (target === null) {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
if (loadedCount >= target) {
|
|
499
|
+
setVisibleCount(target);
|
|
500
|
+
pendingVisibleTargetRef.current = null;
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
if (!isFetchingNextPage) {
|
|
504
|
+
setVisibleCount(Math.min(target, loadedCount));
|
|
505
|
+
pendingVisibleTargetRef.current = null;
|
|
506
|
+
}
|
|
507
|
+
}, [isFetchingNextPage, loadedCount]);
|
|
508
|
+
const canShowLess = visibleCount > POST_PER_PAGE;
|
|
509
|
+
const canLoadMore = visibleCount < loadedCount || hasNextPage;
|
|
510
|
+
const handleLoadMore = useCallback2(() => {
|
|
511
|
+
if (isFetchingNextPage || !canLoadMore) {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
const targetVisible = Math.min(visibleCount + POST_PER_PAGE, totalCount);
|
|
515
|
+
if (targetVisible <= loadedCount) {
|
|
516
|
+
setVisibleCount(Math.min(targetVisible, loadedCount));
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
if (hasNextPage) {
|
|
520
|
+
pendingVisibleTargetRef.current = targetVisible;
|
|
521
|
+
fetchNextPage();
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
if (visibleCount < loadedCount) {
|
|
525
|
+
setVisibleCount(Math.min(visibleCount + POST_PER_PAGE, loadedCount));
|
|
526
|
+
}
|
|
527
|
+
}, [canLoadMore, fetchNextPage, hasNextPage, isFetchingNextPage, loadedCount, totalCount, visibleCount]);
|
|
528
|
+
const handleShowLess = useCallback2(() => {
|
|
529
|
+
pendingVisibleTargetRef.current = null;
|
|
530
|
+
setVisibleCount(POST_PER_PAGE);
|
|
531
|
+
}, []);
|
|
532
|
+
return {
|
|
533
|
+
canLoadMore,
|
|
534
|
+
canShowLess,
|
|
535
|
+
handleLoadMore,
|
|
536
|
+
handleShowLess,
|
|
537
|
+
visibleCount
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
|
|
477
541
|
// src/hooks/use-posts.ts
|
|
478
542
|
import { keepPreviousData, useInfiniteQuery } from "@elementor/query";
|
|
479
543
|
var postsQueryKeyBase = (postTypeSlug) => ["site-navigation", "posts", postTypeSlug];
|
|
@@ -553,6 +617,7 @@ function getSectionHeaderAriaLabel(title, count) {
|
|
|
553
617
|
}
|
|
554
618
|
function CollapsibleList({
|
|
555
619
|
count,
|
|
620
|
+
headerRef,
|
|
556
621
|
isOpen,
|
|
557
622
|
onOpenChange,
|
|
558
623
|
title,
|
|
@@ -578,6 +643,7 @@ function CollapsibleList({
|
|
|
578
643
|
/* @__PURE__ */ React8.createElement(
|
|
579
644
|
ListItemButton,
|
|
580
645
|
{
|
|
646
|
+
ref: headerRef,
|
|
581
647
|
id: labelId,
|
|
582
648
|
"aria-controls": contentId,
|
|
583
649
|
"aria-expanded": isOpen,
|
|
@@ -724,7 +790,7 @@ function useInvalidatePosts(postTypeSlug) {
|
|
|
724
790
|
|
|
725
791
|
// src/components/panel/posts-list/list-items/edit-mode-template.tsx
|
|
726
792
|
import * as React10 from "react";
|
|
727
|
-
import { useRef as
|
|
793
|
+
import { useRef as useRef3, useState as useState4 } from "react";
|
|
728
794
|
import { XIcon } from "@elementor/icons";
|
|
729
795
|
import { Box as Box4, CircularProgress, IconButton as IconButton2, ListItem, ListItemText as ListItemText3 } from "@elementor/ui";
|
|
730
796
|
import { __ as __6 } from "@wordpress/i18n";
|
|
@@ -766,10 +832,10 @@ var editRowInputSx = {
|
|
|
766
832
|
};
|
|
767
833
|
function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
768
834
|
const { resetEditMode } = usePostListContext();
|
|
769
|
-
const [title, setTitle] =
|
|
770
|
-
const [touched, setTouched] =
|
|
771
|
-
const [inputError, setInputError] =
|
|
772
|
-
const closeButton =
|
|
835
|
+
const [title, setTitle] = useState4(postTitle);
|
|
836
|
+
const [touched, setTouched] = useState4(false);
|
|
837
|
+
const [inputError, setInputError] = useState4(null);
|
|
838
|
+
const closeButton = useRef3();
|
|
773
839
|
const onBlur = (e) => {
|
|
774
840
|
if (closeButton.current === e.relatedTarget) {
|
|
775
841
|
return;
|
|
@@ -986,11 +1052,12 @@ import {
|
|
|
986
1052
|
Typography as Typography4,
|
|
987
1053
|
usePopupState as usePopupState2
|
|
988
1054
|
} from "@elementor/ui";
|
|
989
|
-
import { __ as
|
|
1055
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
990
1056
|
|
|
991
1057
|
// src/components/shared/page-title-and-status.tsx
|
|
992
1058
|
import * as React14 from "react";
|
|
993
|
-
import { Box as Box5, Typography as Typography3 } from "@elementor/ui";
|
|
1059
|
+
import { Box as Box5, Chip as Chip2, Typography as Typography3 } from "@elementor/ui";
|
|
1060
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
994
1061
|
|
|
995
1062
|
// src/hooks/use-reverse-html-entities.ts
|
|
996
1063
|
import { useMemo as useMemo3 } from "react";
|
|
@@ -1011,27 +1078,67 @@ function useReverseHtmlEntities(escapedHTML = "") {
|
|
|
1011
1078
|
}
|
|
1012
1079
|
|
|
1013
1080
|
// src/components/shared/page-title-and-status.tsx
|
|
1081
|
+
function humanizeStatusSlug(status) {
|
|
1082
|
+
return status.replace(/[-_]+/g, " ").trim();
|
|
1083
|
+
}
|
|
1084
|
+
var statusChipConfig = {
|
|
1085
|
+
draft: {
|
|
1086
|
+
color: "default",
|
|
1087
|
+
label: __9("Draft", "elementor")
|
|
1088
|
+
},
|
|
1089
|
+
future: {
|
|
1090
|
+
color: "default",
|
|
1091
|
+
label: __9("Scheduled", "elementor")
|
|
1092
|
+
},
|
|
1093
|
+
pending: {
|
|
1094
|
+
color: "warning",
|
|
1095
|
+
label: __9("Pending Review", "elementor")
|
|
1096
|
+
},
|
|
1097
|
+
private: {
|
|
1098
|
+
color: "default",
|
|
1099
|
+
label: __9("Private", "elementor")
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
function getStatusChipConfig(status) {
|
|
1103
|
+
const known = statusChipConfig[status];
|
|
1104
|
+
if (known) {
|
|
1105
|
+
return known;
|
|
1106
|
+
}
|
|
1107
|
+
return {
|
|
1108
|
+
color: "default",
|
|
1109
|
+
label: humanizeStatusSlug(status)
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
function isKnownPanelStatus(status) {
|
|
1113
|
+
return status in statusChipConfig;
|
|
1114
|
+
}
|
|
1014
1115
|
var PageStatus = ({ status }) => {
|
|
1015
1116
|
if ("publish" === status) {
|
|
1016
1117
|
return null;
|
|
1017
1118
|
}
|
|
1119
|
+
const { color, label } = getStatusChipConfig(status);
|
|
1120
|
+
const isKnownStatus = isKnownPanelStatus(status);
|
|
1018
1121
|
return /* @__PURE__ */ React14.createElement(
|
|
1019
|
-
|
|
1122
|
+
Chip2,
|
|
1020
1123
|
{
|
|
1124
|
+
color,
|
|
1021
1125
|
component: "span",
|
|
1022
|
-
|
|
1023
|
-
|
|
1126
|
+
label,
|
|
1127
|
+
size: "tiny",
|
|
1024
1128
|
sx: {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1129
|
+
flexShrink: isKnownStatus ? 0 : 1,
|
|
1130
|
+
maxWidth: isKnownStatus ? void 0 : "45%",
|
|
1131
|
+
minWidth: 0,
|
|
1132
|
+
ml: 0.5,
|
|
1133
|
+
"& .MuiChip-label": {
|
|
1134
|
+
overflow: "hidden",
|
|
1135
|
+
textOverflow: "ellipsis",
|
|
1136
|
+
whiteSpace: "nowrap"
|
|
1137
|
+
}
|
|
1138
|
+
},
|
|
1139
|
+
title: label,
|
|
1140
|
+
variant: "standard"
|
|
1141
|
+
}
|
|
1035
1142
|
);
|
|
1036
1143
|
};
|
|
1037
1144
|
var PageTitle = ({ title }) => {
|
|
@@ -1052,12 +1159,12 @@ var PageTitle = ({ title }) => {
|
|
|
1052
1159
|
);
|
|
1053
1160
|
};
|
|
1054
1161
|
function PageTitleAndStatus({ title, status }) {
|
|
1055
|
-
return /* @__PURE__ */ React14.createElement(Box5, { display: "flex" }, /* @__PURE__ */ React14.createElement(PageTitle, { title }),
|
|
1162
|
+
return /* @__PURE__ */ React14.createElement(Box5, { alignItems: "center", display: "flex", minWidth: 0 }, /* @__PURE__ */ React14.createElement(PageTitle, { title }), /* @__PURE__ */ React14.createElement(PageStatus, { status }));
|
|
1056
1163
|
}
|
|
1057
1164
|
|
|
1058
1165
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
1059
1166
|
import * as React16 from "react";
|
|
1060
|
-
import { useState as
|
|
1167
|
+
import { useState as useState5 } from "react";
|
|
1061
1168
|
import { __useActiveDocument as useActiveDocument2 } from "@elementor/editor-documents";
|
|
1062
1169
|
import { TrashIcon } from "@elementor/icons";
|
|
1063
1170
|
import {
|
|
@@ -1070,7 +1177,7 @@ import {
|
|
|
1070
1177
|
DialogTitle,
|
|
1071
1178
|
Divider as Divider2
|
|
1072
1179
|
} from "@elementor/ui";
|
|
1073
|
-
import { __ as
|
|
1180
|
+
import { __ as __10, sprintf as sprintf3 } from "@wordpress/i18n";
|
|
1074
1181
|
|
|
1075
1182
|
// src/components/panel/actions-menu/action-menu-item.tsx
|
|
1076
1183
|
import * as React15 from "react";
|
|
@@ -1089,7 +1196,7 @@ function ActionMenuItem({ title, icon: Icon, MenuItemProps }) {
|
|
|
1089
1196
|
|
|
1090
1197
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
1091
1198
|
function Delete({ post }) {
|
|
1092
|
-
const [isDialogOpen, setIsDialogOpen] =
|
|
1199
|
+
const [isDialogOpen, setIsDialogOpen] = useState5(false);
|
|
1093
1200
|
const activeDocument = useActiveDocument2();
|
|
1094
1201
|
const isPostActive = activeDocument?.id === post.id;
|
|
1095
1202
|
const userCanDelete = post.user_can.delete;
|
|
@@ -1097,7 +1204,7 @@ function Delete({ post }) {
|
|
|
1097
1204
|
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
1098
1205
|
ActionMenuItem,
|
|
1099
1206
|
{
|
|
1100
|
-
title:
|
|
1207
|
+
title: __10("Delete", "elementor"),
|
|
1101
1208
|
icon: TrashIcon,
|
|
1102
1209
|
MenuItemProps: {
|
|
1103
1210
|
disabled: isDisabled,
|
|
@@ -1114,11 +1221,11 @@ function DeleteDialog({
|
|
|
1114
1221
|
const { type } = usePostListContext();
|
|
1115
1222
|
const { deletePost } = usePostActions(type);
|
|
1116
1223
|
const { setError } = usePostListContext();
|
|
1117
|
-
const dialogTitle = sprintf3(
|
|
1118
|
-
const dialogBody = type === "post" ?
|
|
1224
|
+
const dialogTitle = sprintf3(__10('Delete "%s"?', "elementor"), post.title.rendered);
|
|
1225
|
+
const dialogBody = type === "post" ? __10(
|
|
1119
1226
|
"The post and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1120
1227
|
"elementor"
|
|
1121
|
-
) :
|
|
1228
|
+
) : __10(
|
|
1122
1229
|
"The page and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1123
1230
|
"elementor"
|
|
1124
1231
|
);
|
|
@@ -1144,14 +1251,14 @@ function DeleteDialog({
|
|
|
1144
1251
|
onClick: handleCancel,
|
|
1145
1252
|
disabled: deletePost.isPending
|
|
1146
1253
|
},
|
|
1147
|
-
|
|
1148
|
-
), /* @__PURE__ */ React16.createElement(Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ?
|
|
1254
|
+
__10("Cancel", "elementor")
|
|
1255
|
+
), /* @__PURE__ */ React16.createElement(Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? __10("Delete", "elementor") : /* @__PURE__ */ React16.createElement(CircularProgress2, null))));
|
|
1149
1256
|
}
|
|
1150
1257
|
|
|
1151
1258
|
// src/components/panel/actions-menu/actions/duplicate.tsx
|
|
1152
1259
|
import * as React17 from "react";
|
|
1153
1260
|
import { CopyIcon } from "@elementor/icons";
|
|
1154
|
-
import { __ as
|
|
1261
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1155
1262
|
function Duplicate({ post, popupState }) {
|
|
1156
1263
|
const { setEditMode, type } = usePostListContext();
|
|
1157
1264
|
const canCreate = useCanCreate(type);
|
|
@@ -1169,7 +1276,7 @@ function Duplicate({ post, popupState }) {
|
|
|
1169
1276
|
return /* @__PURE__ */ React17.createElement(
|
|
1170
1277
|
ActionMenuItem,
|
|
1171
1278
|
{
|
|
1172
|
-
title:
|
|
1279
|
+
title: __11("Duplicate", "elementor"),
|
|
1173
1280
|
icon: CopyIcon,
|
|
1174
1281
|
MenuItemProps: {
|
|
1175
1282
|
disabled: isDisabled,
|
|
@@ -1182,13 +1289,13 @@ function Duplicate({ post, popupState }) {
|
|
|
1182
1289
|
// src/components/panel/actions-menu/actions/rename.tsx
|
|
1183
1290
|
import * as React18 from "react";
|
|
1184
1291
|
import { EraseIcon } from "@elementor/icons";
|
|
1185
|
-
import { __ as
|
|
1292
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1186
1293
|
function Rename({ post }) {
|
|
1187
1294
|
const { setEditMode } = usePostListContext();
|
|
1188
1295
|
return /* @__PURE__ */ React18.createElement(
|
|
1189
1296
|
ActionMenuItem,
|
|
1190
1297
|
{
|
|
1191
|
-
title:
|
|
1298
|
+
title: __12("Rename", "elementor"),
|
|
1192
1299
|
icon: EraseIcon,
|
|
1193
1300
|
MenuItemProps: {
|
|
1194
1301
|
disabled: !post.user_can.edit,
|
|
@@ -1209,7 +1316,7 @@ function Rename({ post }) {
|
|
|
1209
1316
|
import * as React19 from "react";
|
|
1210
1317
|
import { HomeIcon } from "@elementor/icons";
|
|
1211
1318
|
import { CircularProgress as CircularProgress3 } from "@elementor/ui";
|
|
1212
|
-
import { __ as
|
|
1319
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1213
1320
|
|
|
1214
1321
|
// src/hooks/use-homepage-actions.ts
|
|
1215
1322
|
import { useMutation as useMutation2, useQueryClient as useQueryClient2 } from "@elementor/query";
|
|
@@ -1251,7 +1358,7 @@ function SetHome({ post, closeMenu }) {
|
|
|
1251
1358
|
return /* @__PURE__ */ React19.createElement(
|
|
1252
1359
|
ActionMenuItem,
|
|
1253
1360
|
{
|
|
1254
|
-
title:
|
|
1361
|
+
title: __13("Set as homepage", "elementor"),
|
|
1255
1362
|
icon: !updateSettingsMutation.isPending ? HomeIcon : CircularProgress3,
|
|
1256
1363
|
MenuItemProps: {
|
|
1257
1364
|
disabled: isDisabled,
|
|
@@ -1264,10 +1371,10 @@ function SetHome({ post, closeMenu }) {
|
|
|
1264
1371
|
// src/components/panel/actions-menu/actions/view.tsx
|
|
1265
1372
|
import * as React20 from "react";
|
|
1266
1373
|
import { EyeIcon } from "@elementor/icons";
|
|
1267
|
-
import { __ as
|
|
1374
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1268
1375
|
function View({ post }) {
|
|
1269
1376
|
const { type } = usePostListContext();
|
|
1270
|
-
const title =
|
|
1377
|
+
const title = __14("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
|
|
1271
1378
|
return /* @__PURE__ */ React20.createElement(
|
|
1272
1379
|
ActionMenuItem,
|
|
1273
1380
|
{
|
|
@@ -1287,7 +1394,7 @@ var DisabledPostTooltip = ({
|
|
|
1287
1394
|
postTypeSlug
|
|
1288
1395
|
}) => {
|
|
1289
1396
|
if (isDisabled) {
|
|
1290
|
-
const title = /* @__PURE__ */ React21.createElement(Typography4, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React21.createElement("br", null),
|
|
1397
|
+
const title = /* @__PURE__ */ React21.createElement(Typography4, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React21.createElement("br", null), __15("To edit it directly, contact the site owner", "elementor"));
|
|
1291
1398
|
return /* @__PURE__ */ React21.createElement(Tooltip, { title, placement: "bottom", arrow: false }, /* @__PURE__ */ React21.createElement("span", null, children));
|
|
1292
1399
|
}
|
|
1293
1400
|
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, children);
|
|
@@ -1314,7 +1421,7 @@ function ListItemView({ post }) {
|
|
|
1314
1421
|
secondaryAction: /* @__PURE__ */ React21.createElement(
|
|
1315
1422
|
IconButton3,
|
|
1316
1423
|
{
|
|
1317
|
-
"aria-label":
|
|
1424
|
+
"aria-label": __15("More actions", "elementor"),
|
|
1318
1425
|
size: "tiny",
|
|
1319
1426
|
...menuTriggerProps,
|
|
1320
1427
|
onClick: (event) => {
|
|
@@ -1341,7 +1448,7 @@ function ListItemView({ post }) {
|
|
|
1341
1448
|
sx: contentPanelListItemButtonSx
|
|
1342
1449
|
},
|
|
1343
1450
|
/* @__PURE__ */ React21.createElement(ListItemText5, { disableTypography: true, sx: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React21.createElement(PageTitleAndStatus, { title, status })),
|
|
1344
|
-
post.isHome && /* @__PURE__ */ React21.createElement(HomeIcon2, { titleAccess:
|
|
1451
|
+
post.isHome && /* @__PURE__ */ React21.createElement(HomeIcon2, { titleAccess: __15("Homepage", "elementor"), color: "disabled" })
|
|
1345
1452
|
)
|
|
1346
1453
|
)), /* @__PURE__ */ React21.createElement(
|
|
1347
1454
|
Menu2,
|
|
@@ -1376,15 +1483,74 @@ function PostListItem({ post }) {
|
|
|
1376
1483
|
return /* @__PURE__ */ React22.createElement(ListItemView, { post });
|
|
1377
1484
|
}
|
|
1378
1485
|
|
|
1486
|
+
// src/components/panel/posts-list/post-list-pagination-actions.tsx
|
|
1487
|
+
import * as React23 from "react";
|
|
1488
|
+
import { CollapseIcon as CollapseIcon2 } from "@elementor/editor-ui";
|
|
1489
|
+
import { Box as Box6, Button as Button2, CircularProgress as CircularProgress4, Stack as Stack2 } from "@elementor/ui";
|
|
1490
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1491
|
+
var listPaginationButtonProps = {
|
|
1492
|
+
color: "secondary",
|
|
1493
|
+
size: "small",
|
|
1494
|
+
variant: "outlined"
|
|
1495
|
+
};
|
|
1496
|
+
function PostListPaginationActions({
|
|
1497
|
+
canLoadMore,
|
|
1498
|
+
canShowLess,
|
|
1499
|
+
isLoadingMore,
|
|
1500
|
+
loadMoreButtonRef,
|
|
1501
|
+
onLoadMore,
|
|
1502
|
+
onShowLess
|
|
1503
|
+
}) {
|
|
1504
|
+
if (!canLoadMore && !canShowLess) {
|
|
1505
|
+
return null;
|
|
1506
|
+
}
|
|
1507
|
+
const loadMoreLabel = __16("Load more", "elementor");
|
|
1508
|
+
const showLessLabel = __16("Show less", "elementor");
|
|
1509
|
+
const loadMoreButton = /* @__PURE__ */ React23.createElement(
|
|
1510
|
+
Button2,
|
|
1511
|
+
{
|
|
1512
|
+
...listPaginationButtonProps,
|
|
1513
|
+
ref: loadMoreButtonRef,
|
|
1514
|
+
"aria-label": loadMoreLabel,
|
|
1515
|
+
disabled: isLoadingMore,
|
|
1516
|
+
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */ React23.createElement(CollapseIcon2, { open: false }),
|
|
1517
|
+
fullWidth: true,
|
|
1518
|
+
onClick: onLoadMore,
|
|
1519
|
+
sx: { flex: 1, my: 0.5 }
|
|
1520
|
+
},
|
|
1521
|
+
isLoadingMore ? /* @__PURE__ */ React23.createElement(CircularProgress4, { size: 20 }) : loadMoreLabel
|
|
1522
|
+
);
|
|
1523
|
+
const showLessButton = /* @__PURE__ */ React23.createElement(
|
|
1524
|
+
Button2,
|
|
1525
|
+
{
|
|
1526
|
+
...listPaginationButtonProps,
|
|
1527
|
+
"aria-label": showLessLabel,
|
|
1528
|
+
endIcon: /* @__PURE__ */ React23.createElement(CollapseIcon2, { open: true }),
|
|
1529
|
+
fullWidth: true,
|
|
1530
|
+
onClick: onShowLess,
|
|
1531
|
+
sx: { flex: 1, my: 0.5 }
|
|
1532
|
+
},
|
|
1533
|
+
showLessLabel
|
|
1534
|
+
);
|
|
1535
|
+
if (canShowLess && canLoadMore) {
|
|
1536
|
+
return /* @__PURE__ */ React23.createElement(Box6, { sx: { px: 2, width: "100%" } }, /* @__PURE__ */ React23.createElement(Stack2, { direction: "row", spacing: 1 }, showLessButton, loadMoreButton));
|
|
1537
|
+
}
|
|
1538
|
+
return /* @__PURE__ */ React23.createElement(Box6, { sx: { px: 2, width: "100%" } }, canShowLess ? showLessButton : loadMoreButton);
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1379
1541
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
1380
1542
|
var SEARCH_DEBOUNCE_MS = 300;
|
|
1381
1543
|
function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
1382
1544
|
const { type, editMode, setEditMode } = usePostListContext();
|
|
1383
1545
|
const { registerSection, unregisterSection, searchQuery } = useContentPanelCoordinator();
|
|
1384
|
-
const [isOpen, setIsOpen] =
|
|
1546
|
+
const [isOpen, setIsOpen] = useState6(isOpenByDefault);
|
|
1385
1547
|
const trimmedSearch = searchQuery.trim();
|
|
1386
|
-
const [debouncedSearch, setDebouncedSearch] =
|
|
1387
|
-
|
|
1548
|
+
const [debouncedSearch, setDebouncedSearch] = useState6(trimmedSearch);
|
|
1549
|
+
const focusAfterShowLessRef = useRef4(false);
|
|
1550
|
+
const listTopRef = useRef4(null);
|
|
1551
|
+
const loadMoreButtonRef = useRef4(null);
|
|
1552
|
+
const sectionHeaderRef = useRef4(null);
|
|
1553
|
+
useEffect2(() => {
|
|
1388
1554
|
const handle = window.setTimeout(() => setDebouncedSearch(trimmedSearch), SEARCH_DEBOUNCE_MS);
|
|
1389
1555
|
return () => window.clearTimeout(handle);
|
|
1390
1556
|
}, [trimmedSearch]);
|
|
@@ -1398,7 +1564,7 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
1398
1564
|
} = usePosts(type, debouncedSearch);
|
|
1399
1565
|
const { data: homepageId } = useHomepage();
|
|
1400
1566
|
const isPageType = type === "page";
|
|
1401
|
-
|
|
1567
|
+
useEffect2(() => {
|
|
1402
1568
|
registerSection(type, {
|
|
1403
1569
|
setExpanded: setIsOpen,
|
|
1404
1570
|
startCreate: () => setEditMode({ mode: "create", details: {} })
|
|
@@ -1421,53 +1587,88 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
1421
1587
|
}) : mappedPosts;
|
|
1422
1588
|
return sorted;
|
|
1423
1589
|
}, [posts, isPageType, homepageId]);
|
|
1424
|
-
|
|
1590
|
+
const pagination = usePostListPagination({
|
|
1591
|
+
fetchNextPage,
|
|
1592
|
+
hasNextPage,
|
|
1593
|
+
isFetchingNextPage,
|
|
1594
|
+
loadedCount: filteredPosts.length,
|
|
1595
|
+
resetKey: `${type}:${debouncedSearch}`,
|
|
1596
|
+
totalCount: total
|
|
1597
|
+
});
|
|
1598
|
+
const displayedPosts = useMemo4(
|
|
1599
|
+
() => filteredPosts.slice(0, pagination.visibleCount),
|
|
1600
|
+
[filteredPosts, pagination.visibleCount]
|
|
1601
|
+
);
|
|
1602
|
+
const handleShowLess = () => {
|
|
1603
|
+
focusAfterShowLessRef.current = true;
|
|
1604
|
+
pagination.handleShowLess();
|
|
1605
|
+
const listTop = listTopRef.current;
|
|
1606
|
+
if (listTop && typeof listTop.scrollIntoView === "function") {
|
|
1607
|
+
listTop.scrollIntoView({ block: "nearest" });
|
|
1608
|
+
}
|
|
1609
|
+
};
|
|
1610
|
+
useEffect2(() => {
|
|
1611
|
+
if (!focusAfterShowLessRef.current) {
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
focusAfterShowLessRef.current = false;
|
|
1615
|
+
const loadMoreButton = loadMoreButtonRef.current;
|
|
1616
|
+
if (loadMoreButton) {
|
|
1617
|
+
loadMoreButton.focus();
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1620
|
+
sectionHeaderRef.current?.focus();
|
|
1621
|
+
}, [pagination.canLoadMore, pagination.visibleCount]);
|
|
1622
|
+
useEffect2(() => {
|
|
1425
1623
|
if (debouncedSearch && filteredPosts.length > 0) {
|
|
1426
1624
|
setIsOpen(true);
|
|
1427
1625
|
}
|
|
1428
1626
|
}, [debouncedSearch, filteredPosts.length]);
|
|
1429
1627
|
if (postsError) {
|
|
1430
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ React24.createElement(ErrorState, null);
|
|
1431
1629
|
}
|
|
1432
1630
|
if (postsPending && !posts?.length) {
|
|
1433
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ React24.createElement(Box7, { sx: { px: 2 } }, /* @__PURE__ */ React24.createElement(Box7, null, /* @__PURE__ */ React24.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "100%", height: "24px" }), /* @__PURE__ */ React24.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React24.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React24.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" })));
|
|
1434
1632
|
}
|
|
1435
1633
|
const displayCount = total;
|
|
1436
1634
|
const sectionTitle = postTypesMap[type].labels.plural_name;
|
|
1437
1635
|
const showNoResults = debouncedSearch && filteredPosts.length === 0;
|
|
1438
|
-
return /* @__PURE__ */
|
|
1636
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1439
1637
|
CollapsibleList,
|
|
1440
1638
|
{
|
|
1441
1639
|
count: displayCount,
|
|
1640
|
+
headerRef: sectionHeaderRef,
|
|
1442
1641
|
isOpen,
|
|
1443
1642
|
onOpenChange: setIsOpen,
|
|
1444
1643
|
title: sectionTitle,
|
|
1445
|
-
trailingActions: /* @__PURE__ */
|
|
1644
|
+
trailingActions: /* @__PURE__ */ React24.createElement(SectionAddButton, { onBeforeCreate: () => setIsOpen(true) })
|
|
1446
1645
|
},
|
|
1447
|
-
showNoResults && /* @__PURE__ */
|
|
1448
|
-
|
|
1449
|
-
|
|
1646
|
+
showNoResults && /* @__PURE__ */ React24.createElement(Box7, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React24.createElement(Typography5, { variant: "body2", color: "text.secondary" }, __17("No results found", "elementor"))),
|
|
1647
|
+
/* @__PURE__ */ React24.createElement(Box7, { ref: listTopRef }),
|
|
1648
|
+
displayedPosts.map((post) => {
|
|
1649
|
+
return /* @__PURE__ */ React24.createElement(PostListItem, { key: post.id, post });
|
|
1450
1650
|
}),
|
|
1451
|
-
["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */
|
|
1452
|
-
|
|
1453
|
-
|
|
1651
|
+
["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */ React24.createElement(PostListItem, null),
|
|
1652
|
+
/* @__PURE__ */ React24.createElement(
|
|
1653
|
+
PostListPaginationActions,
|
|
1454
1654
|
{
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1655
|
+
canLoadMore: pagination.canLoadMore,
|
|
1656
|
+
canShowLess: pagination.canShowLess,
|
|
1657
|
+
isLoadingMore: isFetchingNextPage,
|
|
1658
|
+
loadMoreButtonRef,
|
|
1659
|
+
onLoadMore: pagination.handleLoadMore,
|
|
1660
|
+
onShowLess: handleShowLess
|
|
1661
|
+
}
|
|
1461
1662
|
)
|
|
1462
1663
|
);
|
|
1463
1664
|
}
|
|
1464
1665
|
|
|
1465
1666
|
// src/components/panel/user-load-error.tsx
|
|
1466
|
-
import * as
|
|
1467
|
-
import { Box as
|
|
1468
|
-
import { __ as
|
|
1667
|
+
import * as React25 from "react";
|
|
1668
|
+
import { Box as Box8, Typography as Typography6 } from "@elementor/ui";
|
|
1669
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1469
1670
|
function UserLoadError() {
|
|
1470
|
-
return /* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ React25.createElement(Box8, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React25.createElement(Typography6, { variant: "body2", color: "text.secondary" }, __18(
|
|
1471
1672
|
"We couldn\u2019t load your content permissions. Try closing and reopening this panel.",
|
|
1472
1673
|
"elementor"
|
|
1473
1674
|
)));
|
|
@@ -1481,20 +1682,20 @@ function ShellPanelBodyContent({
|
|
|
1481
1682
|
showUserLoadError
|
|
1482
1683
|
}) {
|
|
1483
1684
|
if (isUserPending) {
|
|
1484
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ React26.createElement(Stack3, { spacing: 1, sx: { px: 2, py: 1 } }, /* @__PURE__ */ React26.createElement(Skeleton2, { animation: "wave", height: 28, variant: "rounded", width: "100%" }), /* @__PURE__ */ React26.createElement(Skeleton2, { animation: "wave", height: 28, variant: "rounded", width: "80%" }));
|
|
1485
1686
|
}
|
|
1486
1687
|
if (showUserLoadError) {
|
|
1487
|
-
return /* @__PURE__ */
|
|
1688
|
+
return /* @__PURE__ */ React26.createElement(UserLoadError, null);
|
|
1488
1689
|
}
|
|
1489
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ React26.createElement(List2, { dense: true, disablePadding: true, sx: { py: 0, width: "100%" } }, accessiblePostTypes.map((postTypeSlug, index) => /* @__PURE__ */ React26.createElement(PostListContextProvider, { key: postTypeSlug, type: postTypeSlug, setError: onListError }, /* @__PURE__ */ React26.createElement(PostsCollapsibleList, { isOpenByDefault: index === 0 }))));
|
|
1490
1691
|
}
|
|
1491
1692
|
|
|
1492
1693
|
// src/components/panel/shell.tsx
|
|
1493
1694
|
var Shell = () => {
|
|
1494
|
-
const [isErrorSnackbarOpen, setIsErrorSnackbarOpen] =
|
|
1695
|
+
const [isErrorSnackbarOpen, setIsErrorSnackbarOpen] = useState7(false);
|
|
1495
1696
|
const { accessiblePostTypes, isUserPending, showUserLoadError } = useAccessiblePanelPostTypes();
|
|
1496
|
-
return /* @__PURE__ */
|
|
1497
|
-
|
|
1697
|
+
return /* @__PURE__ */ React27.createElement(ContentPanelCoordinatorProvider, null, /* @__PURE__ */ React27.createElement(Panel, null, /* @__PURE__ */ React27.createElement(PanelHeader, null, /* @__PURE__ */ React27.createElement(
|
|
1698
|
+
Stack4,
|
|
1498
1699
|
{
|
|
1499
1700
|
alignItems: "center",
|
|
1500
1701
|
direction: "row",
|
|
@@ -1503,9 +1704,9 @@ var Shell = () => {
|
|
|
1503
1704
|
...contentPanelHeaderStackSx
|
|
1504
1705
|
}
|
|
1505
1706
|
},
|
|
1506
|
-
/* @__PURE__ */
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
)), /* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ React27.createElement(PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, __19("Site content", "elementor")),
|
|
1708
|
+
/* @__PURE__ */ React27.createElement(ContentPanelHeaderAdd, null)
|
|
1709
|
+
)), /* @__PURE__ */ React27.createElement(Divider4, null), /* @__PURE__ */ React27.createElement(PanelBody, null, /* @__PURE__ */ React27.createElement(ContentPanelSearch, null), /* @__PURE__ */ React27.createElement(
|
|
1509
1710
|
ShellPanelBodyContent,
|
|
1510
1711
|
{
|
|
1511
1712
|
accessiblePostTypes,
|
|
@@ -1513,7 +1714,7 @@ var Shell = () => {
|
|
|
1513
1714
|
onListError: () => setIsErrorSnackbarOpen(true),
|
|
1514
1715
|
showUserLoadError
|
|
1515
1716
|
}
|
|
1516
|
-
), /* @__PURE__ */
|
|
1717
|
+
), /* @__PURE__ */ React27.createElement(error_snackbar_default, { open: isErrorSnackbarOpen, onClose: () => setIsErrorSnackbarOpen(false) }))));
|
|
1517
1718
|
};
|
|
1518
1719
|
var shell_default = Shell;
|
|
1519
1720
|
|
|
@@ -1524,7 +1725,7 @@ var { panel, usePanelStatus, usePanelActions } = createPanel({
|
|
|
1524
1725
|
});
|
|
1525
1726
|
|
|
1526
1727
|
// src/components/top-bar/recently-edited.tsx
|
|
1527
|
-
import * as
|
|
1728
|
+
import * as React32 from "react";
|
|
1528
1729
|
import {
|
|
1529
1730
|
__useActiveDocument as useActiveDocument4,
|
|
1530
1731
|
__useHostDocument as useHostDocument
|
|
@@ -1541,22 +1742,22 @@ import {
|
|
|
1541
1742
|
MenuItem as MenuItem5,
|
|
1542
1743
|
usePopupState as usePopupState3
|
|
1543
1744
|
} from "@elementor/ui";
|
|
1544
|
-
import { __ as
|
|
1745
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1545
1746
|
|
|
1546
1747
|
// src/components/top-bar/create-post-list-item.tsx
|
|
1547
|
-
import * as
|
|
1748
|
+
import * as React28 from "react";
|
|
1548
1749
|
import { __useNavigateToDocument as useNavigateToDocument4 } from "@elementor/editor-documents";
|
|
1549
1750
|
import { useMixpanel } from "@elementor/events";
|
|
1550
1751
|
import { PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1551
1752
|
import { CircularProgress as CircularProgress5, ListItemIcon as ListItemIcon3, ListItemText as ListItemText6, MenuItem as MenuItem3 } from "@elementor/ui";
|
|
1552
|
-
import { __ as
|
|
1753
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1553
1754
|
|
|
1554
1755
|
// src/hooks/use-create-page.ts
|
|
1555
|
-
import { useState as
|
|
1756
|
+
import { useState as useState8 } from "react";
|
|
1556
1757
|
import apiFetch5 from "@wordpress/api-fetch";
|
|
1557
1758
|
var endpointPath = "/elementor/v1/site-navigation/add-new-post";
|
|
1558
1759
|
function useCreatePage() {
|
|
1559
|
-
const [isLoading, setIsLoading] =
|
|
1760
|
+
const [isLoading, setIsLoading] = useState8(false);
|
|
1560
1761
|
return {
|
|
1561
1762
|
create: () => {
|
|
1562
1763
|
setIsLoading(true);
|
|
@@ -1579,7 +1780,7 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
1579
1780
|
const navigateToDocument = useNavigateToDocument4();
|
|
1580
1781
|
const { data: user } = useUser();
|
|
1581
1782
|
const { dispatchEvent, config } = useMixpanel();
|
|
1582
|
-
return /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1583
1784
|
MenuItem3,
|
|
1584
1785
|
{
|
|
1585
1786
|
disabled: isLoading || !user?.capabilities?.edit_pages,
|
|
@@ -1603,25 +1804,25 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
1603
1804
|
},
|
|
1604
1805
|
...props
|
|
1605
1806
|
},
|
|
1606
|
-
/* @__PURE__ */
|
|
1607
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ React28.createElement(ListItemIcon3, null, isLoading ? /* @__PURE__ */ React28.createElement(CircularProgress5, { size: "1.25rem" }) : /* @__PURE__ */ React28.createElement(PlusIcon2, { fontSize: "small" })),
|
|
1808
|
+
/* @__PURE__ */ React28.createElement(
|
|
1608
1809
|
ListItemText6,
|
|
1609
1810
|
{
|
|
1610
1811
|
primaryTypographyProps: { variant: "body2" },
|
|
1611
|
-
primary:
|
|
1812
|
+
primary: __20("Add new page", "elementor")
|
|
1612
1813
|
}
|
|
1613
1814
|
)
|
|
1614
1815
|
);
|
|
1615
1816
|
}
|
|
1616
1817
|
|
|
1617
1818
|
// src/components/top-bar/indicator.tsx
|
|
1618
|
-
import * as
|
|
1619
|
-
import { Stack as
|
|
1819
|
+
import * as React29 from "react";
|
|
1820
|
+
import { Stack as Stack5, Tooltip as BaseTooltip, Typography as Typography7 } from "@elementor/ui";
|
|
1620
1821
|
function Indicator({ title, status }) {
|
|
1621
|
-
return /* @__PURE__ */
|
|
1822
|
+
return /* @__PURE__ */ React29.createElement(Tooltip2, { title }, /* @__PURE__ */ React29.createElement(Stack5, { component: "span", direction: "row", alignItems: "center", spacing: 0.5 }, /* @__PURE__ */ React29.createElement(Typography7, { component: "span", variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React29.createElement(Typography7, { component: "span", variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
1622
1823
|
}
|
|
1623
1824
|
function Tooltip2(props) {
|
|
1624
|
-
return /* @__PURE__ */
|
|
1825
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1625
1826
|
BaseTooltip,
|
|
1626
1827
|
{
|
|
1627
1828
|
PopperProps: {
|
|
@@ -1637,21 +1838,21 @@ function Tooltip2(props) {
|
|
|
1637
1838
|
}
|
|
1638
1839
|
|
|
1639
1840
|
// src/components/top-bar/post-list-item.tsx
|
|
1640
|
-
import * as
|
|
1841
|
+
import * as React31 from "react";
|
|
1641
1842
|
import { __useNavigateToDocument as useNavigateToDocument5 } from "@elementor/editor-documents";
|
|
1642
1843
|
import { useMixpanel as useMixpanel2 } from "@elementor/events";
|
|
1643
1844
|
import { ListItemText as ListItemText7, MenuItem as MenuItem4 } from "@elementor/ui";
|
|
1644
1845
|
|
|
1645
1846
|
// src/components/top-bar/chip-doc-type.tsx
|
|
1646
|
-
import * as
|
|
1847
|
+
import * as React30 from "react";
|
|
1647
1848
|
import { PostTypeIcon as PostTypeIcon3 } from "@elementor/icons";
|
|
1648
|
-
import { Chip as
|
|
1849
|
+
import { Chip as Chip3 } from "@elementor/ui";
|
|
1649
1850
|
var iconsMap2 = getIconsMap();
|
|
1650
1851
|
function DocTypeChip({ postType, docType, label }) {
|
|
1651
1852
|
const color = "elementor_library" === postType ? "global" : "accent";
|
|
1652
1853
|
const Icon = iconsMap2[docType] || PostTypeIcon3;
|
|
1653
|
-
return /* @__PURE__ */
|
|
1654
|
-
|
|
1854
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1855
|
+
Chip3,
|
|
1655
1856
|
{
|
|
1656
1857
|
component: "span",
|
|
1657
1858
|
size: "small",
|
|
@@ -1659,7 +1860,7 @@ function DocTypeChip({ postType, docType, label }) {
|
|
|
1659
1860
|
label,
|
|
1660
1861
|
"data-value": docType,
|
|
1661
1862
|
color,
|
|
1662
|
-
icon: /* @__PURE__ */
|
|
1863
|
+
icon: /* @__PURE__ */ React30.createElement(Icon, null),
|
|
1663
1864
|
sx: { ml: 1, cursor: "inherit" }
|
|
1664
1865
|
}
|
|
1665
1866
|
);
|
|
@@ -1670,7 +1871,7 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
1670
1871
|
const navigateToDocument = useNavigateToDocument5();
|
|
1671
1872
|
const postTitle = useReverseHtmlEntities(post.title);
|
|
1672
1873
|
const { dispatchEvent, config } = useMixpanel2();
|
|
1673
|
-
return /* @__PURE__ */
|
|
1874
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1674
1875
|
MenuItem4,
|
|
1675
1876
|
{
|
|
1676
1877
|
disabled: !post.user_can.edit,
|
|
@@ -1693,7 +1894,7 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
1693
1894
|
},
|
|
1694
1895
|
...props
|
|
1695
1896
|
},
|
|
1696
|
-
/* @__PURE__ */
|
|
1897
|
+
/* @__PURE__ */ React31.createElement(
|
|
1697
1898
|
ListItemText7,
|
|
1698
1899
|
{
|
|
1699
1900
|
sx: { flexGrow: 0 },
|
|
@@ -1701,7 +1902,7 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
1701
1902
|
primary: postTitle
|
|
1702
1903
|
}
|
|
1703
1904
|
),
|
|
1704
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ React31.createElement(DocTypeChip, { postType: post.type.post_type, docType: post.type.doc_type, label: post.type.label })
|
|
1705
1906
|
);
|
|
1706
1907
|
}
|
|
1707
1908
|
|
|
@@ -1727,12 +1928,12 @@ function RecentlyEdited() {
|
|
|
1727
1928
|
return null;
|
|
1728
1929
|
}
|
|
1729
1930
|
const buttonProps = bindTrigger3(popupState);
|
|
1730
|
-
return /* @__PURE__ */
|
|
1931
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(
|
|
1731
1932
|
Button3,
|
|
1732
1933
|
{
|
|
1733
1934
|
color: "inherit",
|
|
1734
1935
|
size: "small",
|
|
1735
|
-
endIcon: /* @__PURE__ */
|
|
1936
|
+
endIcon: /* @__PURE__ */ React32.createElement(ChevronDownIcon, { fontSize: "small" }),
|
|
1736
1937
|
...buttonProps,
|
|
1737
1938
|
onClick: (e) => {
|
|
1738
1939
|
const extendedWindow = window;
|
|
@@ -1751,40 +1952,40 @@ function RecentlyEdited() {
|
|
|
1751
1952
|
buttonProps.onClick(e);
|
|
1752
1953
|
}
|
|
1753
1954
|
},
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
), /* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ React32.createElement(Indicator, { title: documentTitle, status: document2.status })
|
|
1956
|
+
), /* @__PURE__ */ React32.createElement(
|
|
1756
1957
|
Menu3,
|
|
1757
1958
|
{
|
|
1758
1959
|
MenuListProps: {
|
|
1759
|
-
subheader: /* @__PURE__ */
|
|
1960
|
+
subheader: /* @__PURE__ */ React32.createElement(ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, __21("Recent", "elementor"))
|
|
1760
1961
|
},
|
|
1761
1962
|
PaperProps: { sx: { mt: 2.5, width: 320 } },
|
|
1762
1963
|
...bindMenu3(popupState)
|
|
1763
1964
|
},
|
|
1764
|
-
recentPosts.map((post) => /* @__PURE__ */
|
|
1765
|
-
recentPosts.length === 0 && /* @__PURE__ */
|
|
1965
|
+
recentPosts.map((post) => /* @__PURE__ */ React32.createElement(PostListItem2, { key: post.id, post, closePopup: popupState.close })),
|
|
1966
|
+
recentPosts.length === 0 && /* @__PURE__ */ React32.createElement(MenuItem5, { disabled: true }, /* @__PURE__ */ React32.createElement(
|
|
1766
1967
|
ListItemText8,
|
|
1767
1968
|
{
|
|
1768
1969
|
primaryTypographyProps: {
|
|
1769
1970
|
variant: "caption",
|
|
1770
1971
|
fontStyle: "italic"
|
|
1771
1972
|
},
|
|
1772
|
-
primary:
|
|
1973
|
+
primary: __21("There are no other pages or templates on this site yet.", "elementor")
|
|
1773
1974
|
}
|
|
1774
1975
|
)),
|
|
1775
|
-
/* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */
|
|
1976
|
+
/* @__PURE__ */ React32.createElement(Divider5, { disabled: recentPosts.length === 0 }),
|
|
1977
|
+
/* @__PURE__ */ React32.createElement(CreatePostListItem, { closePopup: popupState.close })
|
|
1777
1978
|
));
|
|
1778
1979
|
}
|
|
1779
1980
|
|
|
1780
1981
|
// src/hooks/use-toggle-button-props.ts
|
|
1781
1982
|
import { PagesIcon } from "@elementor/icons";
|
|
1782
|
-
import { __ as
|
|
1983
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1783
1984
|
function useToggleButtonProps() {
|
|
1784
1985
|
const { isOpen: selectedState, isBlocked } = usePanelStatus();
|
|
1785
1986
|
const { open, close } = usePanelActions();
|
|
1786
1987
|
return {
|
|
1787
|
-
title:
|
|
1988
|
+
title: __22("Site content", "elementor"),
|
|
1788
1989
|
icon: PagesIcon,
|
|
1789
1990
|
onClick: () => {
|
|
1790
1991
|
const extendedWindow = window;
|