@elementor/editor-site-navigation 4.5.0-1216 → 4.5.0-1217
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 +787 -336
- package/dist/index.mjs +741 -281
- package/package.json +10 -10
- package/src/api/post.ts +21 -5
- package/src/components/panel/actions-menu/action-menu-item.tsx +4 -3
- package/src/components/panel/actions-menu/actions/force-delete.tsx +99 -0
- package/src/components/panel/actions-menu/actions/restore.tsx +33 -0
- package/src/components/panel/content-panel-active-filters.tsx +53 -0
- package/src/components/panel/content-panel-clear-filters-button.tsx +22 -0
- package/src/components/panel/content-panel-search.tsx +1 -2
- package/src/components/panel/content-panel-status-filter-list.tsx +70 -0
- package/src/components/panel/content-panel-status-filter.tsx +75 -0
- package/src/components/panel/content-panel-toolbar.tsx +23 -0
- package/src/components/panel/posts-list/collapsible-list.tsx +7 -4
- package/src/components/panel/posts-list/list-items/list-item-view.tsx +69 -46
- package/src/components/panel/posts-list/posts-collapsible-list.tsx +30 -9
- package/src/components/panel/shell.tsx +3 -2
- package/src/contexts/content-panel-coordinator.tsx +34 -3
- package/src/hooks/use-posts-actions.ts +20 -1
- package/src/hooks/use-posts-baseline-total.ts +22 -0
- package/src/hooks/use-posts.ts +19 -13
- package/src/hooks/use-site-content-status-filter-counts.ts +56 -0
- package/src/site-content-restore.ts +1 -0
- package/src/site-content-status-filter.ts +111 -0
package/dist/index.mjs
CHANGED
|
@@ -30,19 +30,102 @@ 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 React34 from "react";
|
|
34
|
+
import { useState as useState8 } from "react";
|
|
35
35
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
36
|
-
import { Divider as
|
|
37
|
-
import { __ as
|
|
36
|
+
import { Divider as Divider6, Stack as Stack7 } from "@elementor/ui";
|
|
37
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
38
38
|
|
|
39
39
|
// src/contexts/content-panel-coordinator.tsx
|
|
40
40
|
import * as React from "react";
|
|
41
41
|
import { createContext, useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
42
|
+
|
|
43
|
+
// src/site-content-status-filter.ts
|
|
44
|
+
import { __ } from "@wordpress/i18n";
|
|
45
|
+
var SITE_CONTENT_SELECTABLE_STATUS_FILTERS = [
|
|
46
|
+
"publish",
|
|
47
|
+
"draft",
|
|
48
|
+
"pending",
|
|
49
|
+
"private",
|
|
50
|
+
"future",
|
|
51
|
+
"trash"
|
|
52
|
+
];
|
|
53
|
+
var EMPTY_SITE_CONTENT_STATUS_FILTERS = {
|
|
54
|
+
draft: false,
|
|
55
|
+
future: false,
|
|
56
|
+
pending: false,
|
|
57
|
+
private: false,
|
|
58
|
+
publish: false,
|
|
59
|
+
trash: false
|
|
60
|
+
};
|
|
61
|
+
var filterLabels = {
|
|
62
|
+
publish: __("Published", "elementor"),
|
|
63
|
+
draft: __("Drafts", "elementor"),
|
|
64
|
+
pending: __("Pending", "elementor"),
|
|
65
|
+
private: __("Private", "elementor"),
|
|
66
|
+
future: __("Scheduled", "elementor"),
|
|
67
|
+
trash: __("Trash", "elementor")
|
|
68
|
+
};
|
|
69
|
+
var SITE_CONTENT_ALL_FILTER_LABEL = __("All", "elementor");
|
|
70
|
+
var SITE_CONTENT_FILTER_POPOVER_WIDTH_PX = 280;
|
|
71
|
+
function getSiteContentStatusFilterLabel(filter) {
|
|
72
|
+
return filterLabels[filter];
|
|
73
|
+
}
|
|
74
|
+
function hasActiveSiteContentStatusFilters(filters) {
|
|
75
|
+
return SITE_CONTENT_SELECTABLE_STATUS_FILTERS.some((key) => filters[key]);
|
|
76
|
+
}
|
|
77
|
+
function getActiveSiteContentStatusFilterKeys(filters) {
|
|
78
|
+
return SITE_CONTENT_SELECTABLE_STATUS_FILTERS.filter((key) => filters[key]);
|
|
79
|
+
}
|
|
80
|
+
var serializeSiteContentStatusFilters = (statusFilters) => SITE_CONTENT_SELECTABLE_STATUS_FILTERS.map((key) => statusFilters[key] ? key : "").join("|");
|
|
81
|
+
function getRestStatusForSiteContentFilters(filters) {
|
|
82
|
+
if (filters.trash) {
|
|
83
|
+
return "trash";
|
|
84
|
+
}
|
|
85
|
+
const active = getActiveSiteContentStatusFilterKeys(filters);
|
|
86
|
+
if (0 === active.length) {
|
|
87
|
+
return "any";
|
|
88
|
+
}
|
|
89
|
+
return active.join(",");
|
|
90
|
+
}
|
|
91
|
+
function isSiteContentTrashFilterActive(filters) {
|
|
92
|
+
return filters.trash;
|
|
93
|
+
}
|
|
94
|
+
function isSiteContentListNarrowed(filters, search) {
|
|
95
|
+
return hasActiveSiteContentStatusFilters(filters) || search.trim().length > 0;
|
|
96
|
+
}
|
|
97
|
+
function toggleSiteContentStatusFilter(filters, filter) {
|
|
98
|
+
if ("trash" === filter) {
|
|
99
|
+
const isTrashOn = !filters.trash;
|
|
100
|
+
return {
|
|
101
|
+
...EMPTY_SITE_CONTENT_STATUS_FILTERS,
|
|
102
|
+
trash: isTrashOn
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
...filters,
|
|
107
|
+
trash: false,
|
|
108
|
+
[filter]: !filters[filter]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function shouldShowSiteContentStatusFilterRow(count, isLoadingCounts, isSelected) {
|
|
112
|
+
if (isSelected) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
if (isLoadingCounts || void 0 === count) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
return count > 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// src/contexts/content-panel-coordinator.tsx
|
|
42
122
|
var ContentPanelCoordinatorContext = createContext(null);
|
|
43
123
|
function ContentPanelCoordinatorProvider({ children }) {
|
|
44
124
|
const sectionsRef = useRef(/* @__PURE__ */ new Map());
|
|
45
125
|
const [searchQuery, setSearchQuery] = useState("");
|
|
126
|
+
const [statusFilters, setStatusFilters] = useState(
|
|
127
|
+
EMPTY_SITE_CONTENT_STATUS_FILTERS
|
|
128
|
+
);
|
|
46
129
|
const registerSection = useCallback((type, handlers) => {
|
|
47
130
|
sectionsRef.current.set(type, handlers);
|
|
48
131
|
}, []);
|
|
@@ -57,15 +140,32 @@ function ContentPanelCoordinatorProvider({ children }) {
|
|
|
57
140
|
handlers.setExpanded(true);
|
|
58
141
|
handlers.startCreate();
|
|
59
142
|
}, []);
|
|
143
|
+
const clearStatusFilters = useCallback(() => {
|
|
144
|
+
setStatusFilters(EMPTY_SITE_CONTENT_STATUS_FILTERS);
|
|
145
|
+
}, []);
|
|
146
|
+
const toggleStatusFilter = useCallback((filter) => {
|
|
147
|
+
setStatusFilters((current) => toggleSiteContentStatusFilter(current, filter));
|
|
148
|
+
}, []);
|
|
60
149
|
const value = useMemo(
|
|
61
150
|
() => ({
|
|
151
|
+
clearStatusFilters,
|
|
62
152
|
registerSection,
|
|
63
|
-
unregisterSection,
|
|
64
153
|
requestCreate,
|
|
65
154
|
searchQuery,
|
|
66
|
-
setSearchQuery
|
|
155
|
+
setSearchQuery,
|
|
156
|
+
statusFilters,
|
|
157
|
+
toggleStatusFilter,
|
|
158
|
+
unregisterSection
|
|
67
159
|
}),
|
|
68
|
-
[
|
|
160
|
+
[
|
|
161
|
+
clearStatusFilters,
|
|
162
|
+
registerSection,
|
|
163
|
+
requestCreate,
|
|
164
|
+
searchQuery,
|
|
165
|
+
statusFilters,
|
|
166
|
+
toggleStatusFilter,
|
|
167
|
+
unregisterSection
|
|
168
|
+
]
|
|
69
169
|
);
|
|
70
170
|
return /* @__PURE__ */ React.createElement(ContentPanelCoordinatorContext.Provider, { value }, children);
|
|
71
171
|
}
|
|
@@ -84,20 +184,20 @@ import { useMemo as useMemo2 } from "react";
|
|
|
84
184
|
|
|
85
185
|
// src/api/post.ts
|
|
86
186
|
import apiFetch from "@wordpress/api-fetch";
|
|
87
|
-
import { __ } from "@wordpress/i18n";
|
|
187
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
88
188
|
var postTypesMap = {
|
|
89
189
|
page: {
|
|
90
190
|
labels: {
|
|
91
|
-
singular_name:
|
|
92
|
-
plural_name:
|
|
191
|
+
singular_name: __2("Page", "elementor"),
|
|
192
|
+
plural_name: __2("Pages", "elementor")
|
|
93
193
|
},
|
|
94
194
|
rest_base: "pages",
|
|
95
195
|
createCapability: "edit_pages"
|
|
96
196
|
},
|
|
97
197
|
post: {
|
|
98
198
|
labels: {
|
|
99
|
-
singular_name:
|
|
100
|
-
plural_name:
|
|
199
|
+
singular_name: __2("Post", "elementor"),
|
|
200
|
+
plural_name: __2("Posts", "elementor")
|
|
101
201
|
},
|
|
102
202
|
rest_base: "posts",
|
|
103
203
|
createCapability: "edit_posts"
|
|
@@ -112,19 +212,20 @@ function getAccessiblePanelPostTypes(capabilities) {
|
|
|
112
212
|
}
|
|
113
213
|
function getCannotEditPanelItemMessage(postTypeSlug) {
|
|
114
214
|
if ("page" === postTypeSlug) {
|
|
115
|
-
return
|
|
215
|
+
return __2("You cannot edit this page.", "elementor");
|
|
116
216
|
}
|
|
117
|
-
return
|
|
217
|
+
return __2("You cannot edit this post.", "elementor");
|
|
118
218
|
}
|
|
119
219
|
var POST_PER_PAGE = 10;
|
|
120
|
-
var
|
|
220
|
+
var COUNT_QUERY_PER_PAGE = 1;
|
|
221
|
+
var getRequest = async (postTypeSlug, page, search = "", status = "any", perPage = POST_PER_PAGE) => {
|
|
121
222
|
const baseUri = `/wp/v2/${postTypesMap[postTypeSlug].rest_base}`;
|
|
122
223
|
const keys = ["id", "type", "title", "link", "status", "user_can"];
|
|
123
224
|
const queryParams = new URLSearchParams({
|
|
124
|
-
status
|
|
225
|
+
status,
|
|
125
226
|
order: "asc",
|
|
126
227
|
page: page.toString(),
|
|
127
|
-
per_page:
|
|
228
|
+
per_page: perPage.toString(),
|
|
128
229
|
_fields: keys.join(",")
|
|
129
230
|
});
|
|
130
231
|
const trimmedSearch = search.trim();
|
|
@@ -160,13 +261,18 @@ var updateRequest = (postTypeSlug, updatedPost) => {
|
|
|
160
261
|
data
|
|
161
262
|
});
|
|
162
263
|
};
|
|
163
|
-
var deleteRequest = (postTypeSlug, postId) => {
|
|
264
|
+
var deleteRequest = (postTypeSlug, postId, force = false) => {
|
|
164
265
|
const path = `/wp/v2/${postTypesMap[postTypeSlug].rest_base}`;
|
|
266
|
+
const forceQuery = force ? "?force=true" : "";
|
|
165
267
|
return apiFetch({
|
|
166
|
-
path: `${path}/${postId}`,
|
|
268
|
+
path: `${path}/${postId}${forceQuery}`,
|
|
167
269
|
method: "DELETE"
|
|
168
270
|
});
|
|
169
271
|
};
|
|
272
|
+
var fetchPostsTotal = async (postTypeSlug, status = "any", search = "") => {
|
|
273
|
+
const response = await getRequest(postTypeSlug, 1, search, status, COUNT_QUERY_PER_PAGE);
|
|
274
|
+
return response.totalPosts;
|
|
275
|
+
};
|
|
170
276
|
var duplicateRequest = (originalPost) => {
|
|
171
277
|
const path = `/elementor/v1/site-navigation/duplicate-post`;
|
|
172
278
|
return apiFetch({
|
|
@@ -287,7 +393,7 @@ var contentPanelListItemButtonSx = {
|
|
|
287
393
|
import * as React3 from "react";
|
|
288
394
|
import { PageTypeIcon as PageTypeIcon2, PostTypeIcon as PostTypeIcon2 } from "@elementor/icons";
|
|
289
395
|
import { bindMenu, bindTrigger, ListItemIcon, ListItemText, Menu, MenuItem, usePopupState } from "@elementor/ui";
|
|
290
|
-
import { __ as
|
|
396
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
291
397
|
|
|
292
398
|
// src/hooks/use-can-create.ts
|
|
293
399
|
function useCanCreate(postTypeSlug) {
|
|
@@ -335,43 +441,248 @@ function ContentPanelHeaderAdd() {
|
|
|
335
441
|
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
336
442
|
ContentPanelAddIconButton,
|
|
337
443
|
{
|
|
338
|
-
"aria-label":
|
|
444
|
+
"aria-label": __3("Add new", "elementor"),
|
|
339
445
|
...buttonProps,
|
|
340
446
|
disabled: !canAddAny
|
|
341
447
|
}
|
|
342
448
|
), /* @__PURE__ */ React3.createElement(Menu, { ...menuProps }, accessibleSlugs.map((slug) => /* @__PURE__ */ React3.createElement(HeaderAddMenuItem, { key: slug, onSelect: handleSelectType, slug }))));
|
|
343
449
|
}
|
|
344
450
|
|
|
345
|
-
// src/components/panel/content-panel-
|
|
451
|
+
// src/components/panel/content-panel-toolbar.tsx
|
|
452
|
+
import * as React9 from "react";
|
|
453
|
+
import { Box as Box3, Stack as Stack3 } from "@elementor/ui";
|
|
454
|
+
|
|
455
|
+
// src/components/panel/content-panel-active-filters.tsx
|
|
456
|
+
import * as React5 from "react";
|
|
457
|
+
import { Chip, Stack } from "@elementor/ui";
|
|
458
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
459
|
+
|
|
460
|
+
// src/components/panel/content-panel-clear-filters-button.tsx
|
|
346
461
|
import * as React4 from "react";
|
|
462
|
+
import { BrushBigIcon } from "@elementor/icons";
|
|
463
|
+
import { Box, IconButton as IconButton2, Tooltip } from "@elementor/ui";
|
|
464
|
+
function ContentPanelClearFiltersButton({ ariaLabel, onClear, sx, tooltipText }) {
|
|
465
|
+
return /* @__PURE__ */ React4.createElement(Tooltip, { disableInteractive: true, placement: "top", title: tooltipText }, /* @__PURE__ */ React4.createElement(Box, null, /* @__PURE__ */ React4.createElement(IconButton2, { "aria-label": ariaLabel, onClick: onClear, size: "tiny", sx }, /* @__PURE__ */ React4.createElement(BrushBigIcon, { fontSize: "tiny" }))));
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// src/components/panel/content-panel-active-filters.tsx
|
|
469
|
+
var contentPanelFilterChipSx = {
|
|
470
|
+
"& .MuiChip-deleteIcon": {
|
|
471
|
+
display: "none",
|
|
472
|
+
transition: "opacity 0.2s"
|
|
473
|
+
},
|
|
474
|
+
"&:hover .MuiChip-deleteIcon": {
|
|
475
|
+
display: "block"
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
function ContentPanelActiveFilters() {
|
|
479
|
+
const { clearStatusFilters, statusFilters, toggleStatusFilter } = useContentPanelCoordinator();
|
|
480
|
+
if (!hasActiveSiteContentStatusFilters(statusFilters)) {
|
|
481
|
+
return null;
|
|
482
|
+
}
|
|
483
|
+
const activeKeys = getActiveSiteContentStatusFilterKeys(statusFilters);
|
|
484
|
+
return /* @__PURE__ */ React5.createElement(Stack, { alignItems: "center", direction: "row", justifyContent: "space-between" }, /* @__PURE__ */ React5.createElement(Stack, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 0.5 }, activeKeys.map((key) => /* @__PURE__ */ React5.createElement(
|
|
485
|
+
Chip,
|
|
486
|
+
{
|
|
487
|
+
key,
|
|
488
|
+
label: getSiteContentStatusFilterLabel(key),
|
|
489
|
+
onDelete: () => toggleStatusFilter(key),
|
|
490
|
+
size: "tiny",
|
|
491
|
+
sx: contentPanelFilterChipSx
|
|
492
|
+
}
|
|
493
|
+
))), /* @__PURE__ */ React5.createElement(
|
|
494
|
+
ContentPanelClearFiltersButton,
|
|
495
|
+
{
|
|
496
|
+
ariaLabel: __4("Clear Filters", "elementor"),
|
|
497
|
+
onClear: clearStatusFilters,
|
|
498
|
+
sx: { margin: "0 0 auto auto" },
|
|
499
|
+
tooltipText: __4("Clear Filters", "elementor")
|
|
500
|
+
}
|
|
501
|
+
));
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// src/components/panel/content-panel-search.tsx
|
|
505
|
+
import * as React6 from "react";
|
|
347
506
|
import { SearchIcon } from "@elementor/icons";
|
|
348
|
-
import { Box, InputAdornment, TextField } from "@elementor/ui";
|
|
349
|
-
import { __ as
|
|
507
|
+
import { Box as Box2, InputAdornment, TextField } from "@elementor/ui";
|
|
508
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
350
509
|
function ContentPanelSearch() {
|
|
351
510
|
const { searchQuery, setSearchQuery } = useContentPanelCoordinator();
|
|
352
|
-
return /* @__PURE__ */
|
|
511
|
+
return /* @__PURE__ */ React6.createElement(Box2, { component: "search", "aria-label": __5("Search site content", "elementor") }, /* @__PURE__ */ React6.createElement(
|
|
353
512
|
TextField,
|
|
354
513
|
{
|
|
355
514
|
fullWidth: true,
|
|
356
515
|
size: "tiny",
|
|
357
516
|
value: searchQuery,
|
|
358
|
-
placeholder:
|
|
517
|
+
placeholder: __5("Search", "elementor"),
|
|
359
518
|
onChange: (event) => setSearchQuery(event.target.value),
|
|
360
519
|
inputProps: {
|
|
361
|
-
"aria-label":
|
|
520
|
+
"aria-label": __5("Search", "elementor")
|
|
362
521
|
},
|
|
363
522
|
InputProps: {
|
|
364
|
-
startAdornment: /* @__PURE__ */
|
|
523
|
+
startAdornment: /* @__PURE__ */ React6.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React6.createElement(SearchIcon, { fontSize: "tiny" }))
|
|
365
524
|
}
|
|
366
525
|
}
|
|
367
526
|
));
|
|
368
527
|
}
|
|
369
528
|
|
|
529
|
+
// src/components/panel/content-panel-status-filter.tsx
|
|
530
|
+
import * as React8 from "react";
|
|
531
|
+
import { PopoverBody, PopoverHeader } from "@elementor/editor-ui";
|
|
532
|
+
import { FilterIcon } from "@elementor/icons";
|
|
533
|
+
import { bindPopover, bindToggle, Divider, Popover, ToggleButton, Tooltip as Tooltip2, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
534
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
535
|
+
|
|
536
|
+
// src/components/panel/content-panel-status-filter-list.tsx
|
|
537
|
+
import * as React7 from "react";
|
|
538
|
+
import { CheckIcon } from "@elementor/icons";
|
|
539
|
+
import { MenuItem as MenuItem2, MenuList, Stack as Stack2, Typography } from "@elementor/ui";
|
|
540
|
+
|
|
541
|
+
// src/hooks/use-site-content-status-filter-counts.ts
|
|
542
|
+
import { useQuery as useQuery2 } from "@elementor/query";
|
|
543
|
+
var STATUS_FILTER_COUNTS_STALE_TIME_MS = 30 * 1e3;
|
|
544
|
+
var siteContentStatusFilterCountsQueryKeyBase = ["site-navigation", "status-filter-counts"];
|
|
545
|
+
var siteContentStatusFilterCountsQueryKey = (postTypes) => [
|
|
546
|
+
...siteContentStatusFilterCountsQueryKeyBase,
|
|
547
|
+
postTypes.join(",")
|
|
548
|
+
];
|
|
549
|
+
var sumFulfilledTotals = (results) => {
|
|
550
|
+
const fulfilled = results.filter(
|
|
551
|
+
(result) => "fulfilled" === result.status
|
|
552
|
+
);
|
|
553
|
+
if (fulfilled.length !== results.length) {
|
|
554
|
+
return void 0;
|
|
555
|
+
}
|
|
556
|
+
return fulfilled.reduce((sum, result) => sum + result.value, 0);
|
|
557
|
+
};
|
|
558
|
+
var fetchStatusFilterCounts = async (postTypes) => {
|
|
559
|
+
const entries = await Promise.all(
|
|
560
|
+
SITE_CONTENT_SELECTABLE_STATUS_FILTERS.map(async (status) => {
|
|
561
|
+
const results = await Promise.allSettled(postTypes.map((slug) => fetchPostsTotal(slug, status)));
|
|
562
|
+
const total = sumFulfilledTotals(results);
|
|
563
|
+
if (void 0 === total) {
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
return [status, total];
|
|
567
|
+
})
|
|
568
|
+
);
|
|
569
|
+
return Object.fromEntries(entries.filter((entry) => null !== entry));
|
|
570
|
+
};
|
|
571
|
+
function useSiteContentStatusFilterCounts(postTypes, enabled) {
|
|
572
|
+
return useQuery2({
|
|
573
|
+
enabled: enabled && postTypes.length > 0,
|
|
574
|
+
queryFn: () => fetchStatusFilterCounts(postTypes),
|
|
575
|
+
queryKey: siteContentStatusFilterCountsQueryKey(postTypes),
|
|
576
|
+
staleTime: STATUS_FILTER_COUNTS_STALE_TIME_MS
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// src/components/panel/content-panel-status-filter-list.tsx
|
|
581
|
+
var renderFilterMenuItemContent = (label, selected) => /* @__PURE__ */ React7.createElement(Stack2, { alignItems: "center", direction: "row", gap: 1, width: "100%" }, /* @__PURE__ */ React7.createElement(Typography, { sx: { color: "text.secondary", flex: 1 }, variant: "caption" }, label), selected ? /* @__PURE__ */ React7.createElement(CheckIcon, { "aria-hidden": true, fontSize: "tiny" }) : null);
|
|
582
|
+
function ContentPanelStatusFilterList({ loadCounts }) {
|
|
583
|
+
const { clearStatusFilters, statusFilters, toggleStatusFilter } = useContentPanelCoordinator();
|
|
584
|
+
const { accessiblePostTypes } = useAccessiblePanelPostTypes();
|
|
585
|
+
const { data: statusCounts, isPending: isLoadingCounts } = useSiteContentStatusFilterCounts(
|
|
586
|
+
accessiblePostTypes,
|
|
587
|
+
loadCounts
|
|
588
|
+
);
|
|
589
|
+
const isAllSelected = !hasActiveSiteContentStatusFilters(statusFilters);
|
|
590
|
+
const visibleFilters = SITE_CONTENT_SELECTABLE_STATUS_FILTERS.filter(
|
|
591
|
+
(filter) => shouldShowSiteContentStatusFilterRow(statusCounts?.[filter], isLoadingCounts, statusFilters[filter])
|
|
592
|
+
);
|
|
593
|
+
return /* @__PURE__ */ React7.createElement(MenuList, { dense: true }, /* @__PURE__ */ React7.createElement(
|
|
594
|
+
MenuItem2,
|
|
595
|
+
{
|
|
596
|
+
"aria-checked": isAllSelected,
|
|
597
|
+
onClick: clearStatusFilters,
|
|
598
|
+
role: "menuitemcheckbox",
|
|
599
|
+
selected: isAllSelected
|
|
600
|
+
},
|
|
601
|
+
renderFilterMenuItemContent(SITE_CONTENT_ALL_FILTER_LABEL, isAllSelected)
|
|
602
|
+
), visibleFilters.map((filter) => {
|
|
603
|
+
const isSelected = statusFilters[filter];
|
|
604
|
+
return /* @__PURE__ */ React7.createElement(
|
|
605
|
+
MenuItem2,
|
|
606
|
+
{
|
|
607
|
+
key: filter,
|
|
608
|
+
"aria-checked": isSelected,
|
|
609
|
+
onClick: () => toggleStatusFilter(filter),
|
|
610
|
+
role: "menuitemcheckbox",
|
|
611
|
+
selected: isSelected
|
|
612
|
+
},
|
|
613
|
+
renderFilterMenuItemContent(getSiteContentStatusFilterLabel(filter), isSelected)
|
|
614
|
+
);
|
|
615
|
+
}));
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
// src/components/panel/content-panel-status-filter.tsx
|
|
619
|
+
function ContentPanelStatusFilter() {
|
|
620
|
+
const { clearStatusFilters, statusFilters } = useContentPanelCoordinator();
|
|
621
|
+
const popupState = usePopupState2({
|
|
622
|
+
variant: "popover",
|
|
623
|
+
disableAutoFocus: true
|
|
624
|
+
});
|
|
625
|
+
const hasActiveFilters = hasActiveSiteContentStatusFilters(statusFilters);
|
|
626
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Tooltip2, { placement: "top", title: __6("Filters", "elementor") }, /* @__PURE__ */ React8.createElement(
|
|
627
|
+
ToggleButton,
|
|
628
|
+
{
|
|
629
|
+
"aria-label": __6("Filters", "elementor"),
|
|
630
|
+
selected: popupState.isOpen || hasActiveFilters,
|
|
631
|
+
size: "tiny",
|
|
632
|
+
value: "filter",
|
|
633
|
+
...bindToggle(popupState)
|
|
634
|
+
},
|
|
635
|
+
/* @__PURE__ */ React8.createElement(FilterIcon, { fontSize: "tiny" })
|
|
636
|
+
)), /* @__PURE__ */ React8.createElement(
|
|
637
|
+
Popover,
|
|
638
|
+
{
|
|
639
|
+
anchorOrigin: {
|
|
640
|
+
horizontal: "right",
|
|
641
|
+
vertical: "top"
|
|
642
|
+
},
|
|
643
|
+
sx: {
|
|
644
|
+
maxWidth: `${SITE_CONTENT_FILTER_POPOVER_WIDTH_PX}px`
|
|
645
|
+
},
|
|
646
|
+
transformOrigin: {
|
|
647
|
+
horizontal: -21,
|
|
648
|
+
vertical: "top"
|
|
649
|
+
},
|
|
650
|
+
...bindPopover(popupState)
|
|
651
|
+
},
|
|
652
|
+
/* @__PURE__ */ React8.createElement(
|
|
653
|
+
PopoverHeader,
|
|
654
|
+
{
|
|
655
|
+
actions: hasActiveFilters ? [
|
|
656
|
+
/* @__PURE__ */ React8.createElement(
|
|
657
|
+
ContentPanelClearFiltersButton,
|
|
658
|
+
{
|
|
659
|
+
ariaLabel: __6("Clear all", "elementor"),
|
|
660
|
+
key: "clear-all-filters",
|
|
661
|
+
onClear: clearStatusFilters,
|
|
662
|
+
tooltipText: __6("Clear all", "elementor")
|
|
663
|
+
}
|
|
664
|
+
)
|
|
665
|
+
] : [],
|
|
666
|
+
icon: /* @__PURE__ */ React8.createElement(FilterIcon, { fontSize: "tiny" }),
|
|
667
|
+
onClose: popupState.close,
|
|
668
|
+
title: __6("Filters", "elementor")
|
|
669
|
+
}
|
|
670
|
+
),
|
|
671
|
+
/* @__PURE__ */ React8.createElement(Divider, { sx: { borderWidth: "1px 0 0 0" } }),
|
|
672
|
+
/* @__PURE__ */ React8.createElement(PopoverBody, { height: "auto", width: SITE_CONTENT_FILTER_POPOVER_WIDTH_PX }, /* @__PURE__ */ React8.createElement(ContentPanelStatusFilterList, { loadCounts: popupState.isOpen }))
|
|
673
|
+
));
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// src/components/panel/content-panel-toolbar.tsx
|
|
677
|
+
function ContentPanelToolbar() {
|
|
678
|
+
return /* @__PURE__ */ React9.createElement(Box3, { sx: contentPanelSearchBoxSx }, /* @__PURE__ */ React9.createElement(Stack3, { gap: 0.75, width: "100%" }, /* @__PURE__ */ React9.createElement(Stack3, { alignItems: "center", direction: "row", gap: 0.5, width: "100%" }, /* @__PURE__ */ React9.createElement(Box3, { sx: { flexGrow: 1, minWidth: 0 } }, /* @__PURE__ */ React9.createElement(ContentPanelSearch, null)), /* @__PURE__ */ React9.createElement(ContentPanelStatusFilter, null)), /* @__PURE__ */ React9.createElement(ContentPanelActiveFilters, null)));
|
|
679
|
+
}
|
|
680
|
+
|
|
370
681
|
// src/components/panel/error-snackbar.tsx
|
|
371
|
-
import * as
|
|
372
|
-
import { Alert, Snackbar, Typography } from "@elementor/ui";
|
|
682
|
+
import * as React10 from "react";
|
|
683
|
+
import { Alert, Snackbar, Typography as Typography2 } from "@elementor/ui";
|
|
373
684
|
var ErrorSnackbar = ({ open, onClose }) => {
|
|
374
|
-
return /* @__PURE__ */
|
|
685
|
+
return /* @__PURE__ */ React10.createElement(
|
|
375
686
|
Snackbar,
|
|
376
687
|
{
|
|
377
688
|
open,
|
|
@@ -381,8 +692,8 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
381
692
|
horizontal: "left"
|
|
382
693
|
}
|
|
383
694
|
},
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
|
|
695
|
+
/* @__PURE__ */ React10.createElement(Alert, { onClose, severity: "error", sx: { width: "100%" } }, /* @__PURE__ */ React10.createElement(
|
|
696
|
+
Typography2,
|
|
386
697
|
{
|
|
387
698
|
component: "span",
|
|
388
699
|
sx: {
|
|
@@ -396,11 +707,11 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
396
707
|
var error_snackbar_default = ErrorSnackbar;
|
|
397
708
|
|
|
398
709
|
// src/components/panel/shell-panel-body-content.tsx
|
|
399
|
-
import * as
|
|
400
|
-
import { List as List2, Skeleton as Skeleton2, Stack as
|
|
710
|
+
import * as React33 from "react";
|
|
711
|
+
import { List as List2, Skeleton as Skeleton2, Stack as Stack6 } from "@elementor/ui";
|
|
401
712
|
|
|
402
713
|
// src/contexts/post-list-context.tsx
|
|
403
|
-
import * as
|
|
714
|
+
import * as React11 from "react";
|
|
404
715
|
import { createContext as createContext2, useContext as useContext2, useState as useState2 } from "react";
|
|
405
716
|
var defaultValues = {
|
|
406
717
|
type: "page",
|
|
@@ -419,7 +730,7 @@ var PostListContextProvider = ({
|
|
|
419
730
|
const resetEditMode = () => {
|
|
420
731
|
setEditMode(defaultValues.editMode);
|
|
421
732
|
};
|
|
422
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ React11.createElement(
|
|
423
734
|
PostListContext.Provider,
|
|
424
735
|
{
|
|
425
736
|
value: {
|
|
@@ -442,13 +753,13 @@ function usePostListContext() {
|
|
|
442
753
|
}
|
|
443
754
|
|
|
444
755
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
445
|
-
import * as
|
|
446
|
-
import { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef4, useState as
|
|
447
|
-
import { Box as
|
|
448
|
-
import { __ as
|
|
756
|
+
import * as React31 from "react";
|
|
757
|
+
import { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef4, useState as useState7 } from "react";
|
|
758
|
+
import { Box as Box9, Skeleton, Typography as Typography6 } from "@elementor/ui";
|
|
759
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
449
760
|
|
|
450
761
|
// src/hooks/use-homepage.ts
|
|
451
|
-
import { useQuery as
|
|
762
|
+
import { useQuery as useQuery3 } from "@elementor/query";
|
|
452
763
|
|
|
453
764
|
// src/api/settings.ts
|
|
454
765
|
import apiFetch3 from "@wordpress/api-fetch";
|
|
@@ -468,7 +779,7 @@ var updateSettings = (settings) => {
|
|
|
468
779
|
// src/hooks/use-homepage.ts
|
|
469
780
|
var settingsQueryKey = () => ["site-navigation", "homepage"];
|
|
470
781
|
function useHomepage() {
|
|
471
|
-
return
|
|
782
|
+
return useQuery3({
|
|
472
783
|
queryKey: settingsQueryKey(),
|
|
473
784
|
queryFn: () => getSettings()
|
|
474
785
|
});
|
|
@@ -541,13 +852,11 @@ function usePostListPagination({
|
|
|
541
852
|
// src/hooks/use-posts.ts
|
|
542
853
|
import { keepPreviousData, useInfiniteQuery } from "@elementor/query";
|
|
543
854
|
var postsQueryKeyBase = (postTypeSlug) => ["site-navigation", "posts", postTypeSlug];
|
|
544
|
-
var postsQueryKey = (postTypeSlug,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
return [...postsQueryKeyBase(postTypeSlug), trimmedSearch];
|
|
550
|
-
};
|
|
855
|
+
var postsQueryKey = (postTypeSlug, trimmedSearch = "", restStatus = "any") => [
|
|
856
|
+
...postsQueryKeyBase(postTypeSlug),
|
|
857
|
+
restStatus,
|
|
858
|
+
trimmedSearch
|
|
859
|
+
];
|
|
551
860
|
var flattenData = (data) => {
|
|
552
861
|
if (!data) {
|
|
553
862
|
return data;
|
|
@@ -558,11 +867,12 @@ var flattenData = (data) => {
|
|
|
558
867
|
});
|
|
559
868
|
return flattened;
|
|
560
869
|
};
|
|
561
|
-
function usePosts(postTypeSlug, search = "") {
|
|
870
|
+
function usePosts(postTypeSlug, search = "", statusFilters = EMPTY_SITE_CONTENT_STATUS_FILTERS) {
|
|
562
871
|
const trimmedSearch = search.trim();
|
|
872
|
+
const restStatus = getRestStatusForSiteContentFilters(statusFilters);
|
|
563
873
|
const query = useInfiniteQuery({
|
|
564
|
-
queryKey: postsQueryKey(postTypeSlug, trimmedSearch),
|
|
565
|
-
queryFn: ({ pageParam = 1 }) => getRequest(postTypeSlug, pageParam, trimmedSearch),
|
|
874
|
+
queryKey: postsQueryKey(postTypeSlug, trimmedSearch, restStatus),
|
|
875
|
+
queryFn: ({ pageParam = 1 }) => getRequest(postTypeSlug, pageParam, trimmedSearch, restStatus),
|
|
566
876
|
initialPageParam: 1,
|
|
567
877
|
getNextPageParam: (lastPage) => {
|
|
568
878
|
return lastPage.currentPage < lastPage.totalPages ? lastPage.currentPage + 1 : void 0;
|
|
@@ -572,19 +882,38 @@ function usePosts(postTypeSlug, search = "") {
|
|
|
572
882
|
return { ...query, data: { posts: flattenData(query.data), total: query.data?.pages[0]?.totalPosts ?? 0 } };
|
|
573
883
|
}
|
|
574
884
|
|
|
885
|
+
// src/hooks/use-posts-baseline-total.ts
|
|
886
|
+
import { useQuery as useQuery4 } from "@elementor/query";
|
|
887
|
+
var postsBaselineTotalQueryKeyBase = (postTypeSlug) => [
|
|
888
|
+
"site-navigation",
|
|
889
|
+
"posts-baseline-total",
|
|
890
|
+
postTypeSlug
|
|
891
|
+
];
|
|
892
|
+
var postsBaselineTotalQueryKey = (postTypeSlug, status = "any") => [
|
|
893
|
+
...postsBaselineTotalQueryKeyBase(postTypeSlug),
|
|
894
|
+
status
|
|
895
|
+
];
|
|
896
|
+
function usePostsBaselineTotal(postTypeSlug, enabled, status = "any") {
|
|
897
|
+
return useQuery4({
|
|
898
|
+
enabled,
|
|
899
|
+
queryFn: () => fetchPostsTotal(postTypeSlug, status),
|
|
900
|
+
queryKey: postsBaselineTotalQueryKey(postTypeSlug, status)
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
|
|
575
904
|
// src/components/panel/section-add-button.tsx
|
|
576
|
-
import * as
|
|
577
|
-
import { __ as
|
|
905
|
+
import * as React12 from "react";
|
|
906
|
+
import { __ as __7, sprintf } from "@wordpress/i18n";
|
|
578
907
|
function SectionAddButton({ onBeforeCreate }) {
|
|
579
908
|
const { type, setEditMode } = usePostListContext();
|
|
580
909
|
const canCreate = useCanCreate(type);
|
|
581
910
|
const singularName = postTypesMap[type].labels.singular_name;
|
|
582
911
|
const ariaLabel = sprintf(
|
|
583
912
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
584
|
-
|
|
913
|
+
__7("New %s", "elementor"),
|
|
585
914
|
singularName
|
|
586
915
|
);
|
|
587
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ React12.createElement(
|
|
588
917
|
ContentPanelAddIconButton,
|
|
589
918
|
{
|
|
590
919
|
"aria-label": ariaLabel,
|
|
@@ -599,10 +928,10 @@ function SectionAddButton({ onBeforeCreate }) {
|
|
|
599
928
|
}
|
|
600
929
|
|
|
601
930
|
// src/components/panel/posts-list/collapsible-list.tsx
|
|
602
|
-
import * as
|
|
931
|
+
import * as React13 from "react";
|
|
603
932
|
import { useId } from "react";
|
|
604
933
|
import { CollapseIcon } from "@elementor/editor-ui";
|
|
605
|
-
import { Box as
|
|
934
|
+
import { Box as Box4, Chip as Chip2, Collapse, Divider as Divider2, List, ListItemButton, ListItemText as ListItemText2, Stack as Stack4 } from "@elementor/ui";
|
|
606
935
|
var sectionHeaderListItemButtonSx = {
|
|
607
936
|
flexGrow: 1,
|
|
608
937
|
justifyContent: "flex-start",
|
|
@@ -612,11 +941,12 @@ var sectionHeaderListItemButtonSx = {
|
|
|
612
941
|
"&:hover": { backgroundColor: "transparent" },
|
|
613
942
|
"&.Mui-focusVisible": { backgroundColor: "transparent" }
|
|
614
943
|
};
|
|
615
|
-
function getSectionHeaderAriaLabel(title,
|
|
616
|
-
return `${title} (${
|
|
944
|
+
function getSectionHeaderAriaLabel(title, countLabel) {
|
|
945
|
+
return `${title} (${countLabel})`;
|
|
617
946
|
}
|
|
618
947
|
function CollapsibleList({
|
|
619
948
|
count,
|
|
949
|
+
countChipLabel,
|
|
620
950
|
headerRef,
|
|
621
951
|
isOpen,
|
|
622
952
|
onOpenChange,
|
|
@@ -627,10 +957,11 @@ function CollapsibleList({
|
|
|
627
957
|
const id = useId();
|
|
628
958
|
const labelId = `label-${id}`;
|
|
629
959
|
const contentId = `content-${id}`;
|
|
630
|
-
const
|
|
960
|
+
const chipLabel = countChipLabel ?? count.toString();
|
|
961
|
+
const sectionHeaderAriaLabel = getSectionHeaderAriaLabel(title, chipLabel);
|
|
631
962
|
const handleClick = () => onOpenChange(!isOpen);
|
|
632
|
-
return /* @__PURE__ */
|
|
633
|
-
|
|
963
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
964
|
+
Box4,
|
|
634
965
|
{
|
|
635
966
|
sx: {
|
|
636
967
|
...contentPanelSectionHeaderSx,
|
|
@@ -640,7 +971,7 @@ function CollapsibleList({
|
|
|
640
971
|
width: "100%"
|
|
641
972
|
}
|
|
642
973
|
},
|
|
643
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ React13.createElement(
|
|
644
975
|
ListItemButton,
|
|
645
976
|
{
|
|
646
977
|
ref: headerRef,
|
|
@@ -654,7 +985,7 @@ function CollapsibleList({
|
|
|
654
985
|
onClick: handleClick,
|
|
655
986
|
sx: sectionHeaderListItemButtonSx
|
|
656
987
|
},
|
|
657
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ React13.createElement(Stack4, { alignItems: "center", direction: "row", flexGrow: 1, gap: 0.5, minWidth: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Stack4, { alignItems: "center", direction: "row", flex: 1, gap: 0.5, minWidth: 0 }, /* @__PURE__ */ React13.createElement(
|
|
658
989
|
ListItemText2,
|
|
659
990
|
{
|
|
660
991
|
secondary: title,
|
|
@@ -665,10 +996,10 @@ function CollapsibleList({
|
|
|
665
996
|
},
|
|
666
997
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
667
998
|
}
|
|
668
|
-
), /* @__PURE__ */
|
|
999
|
+
), /* @__PURE__ */ React13.createElement(Chip2, { label: chipLabel, size: "tiny" })), /* @__PURE__ */ React13.createElement(CollapseIcon, { color: "secondary", fontSize: "tiny", open: isOpen, sx: { flexShrink: 0 } }))
|
|
669
1000
|
),
|
|
670
|
-
trailingActions && /* @__PURE__ */
|
|
671
|
-
|
|
1001
|
+
trailingActions && /* @__PURE__ */ React13.createElement(
|
|
1002
|
+
Stack4,
|
|
672
1003
|
{
|
|
673
1004
|
alignItems: "center",
|
|
674
1005
|
direction: "row",
|
|
@@ -678,17 +1009,17 @@ function CollapsibleList({
|
|
|
678
1009
|
},
|
|
679
1010
|
trailingActions
|
|
680
1011
|
)
|
|
681
|
-
), /* @__PURE__ */
|
|
1012
|
+
), /* @__PURE__ */ React13.createElement(Collapse, { "aria-labelledby": labelId, id: contentId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React13.createElement(List, { dense: true, disablePadding: true, sx: contentPanelListSectionListSx }, children)), /* @__PURE__ */ React13.createElement(Divider2, null));
|
|
682
1013
|
}
|
|
683
1014
|
|
|
684
1015
|
// src/components/panel/posts-list/error-state.tsx
|
|
685
|
-
import * as
|
|
1016
|
+
import * as React14 from "react";
|
|
686
1017
|
import { Error404TemplateIcon } from "@elementor/icons";
|
|
687
|
-
import { Box as
|
|
688
|
-
import { __ as
|
|
1018
|
+
import { Box as Box5, Link, Typography as Typography3 } from "@elementor/ui";
|
|
1019
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
689
1020
|
function ErrorState() {
|
|
690
|
-
return /* @__PURE__ */
|
|
691
|
-
|
|
1021
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1022
|
+
Box5,
|
|
692
1023
|
{
|
|
693
1024
|
sx: {
|
|
694
1025
|
display: "flex",
|
|
@@ -699,9 +1030,9 @@ function ErrorState() {
|
|
|
699
1030
|
gap: "16px"
|
|
700
1031
|
}
|
|
701
1032
|
},
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
|
|
1033
|
+
/* @__PURE__ */ React14.createElement(Error404TemplateIcon, null),
|
|
1034
|
+
/* @__PURE__ */ React14.createElement(
|
|
1035
|
+
Box5,
|
|
705
1036
|
{
|
|
706
1037
|
sx: {
|
|
707
1038
|
display: "flex",
|
|
@@ -711,25 +1042,28 @@ function ErrorState() {
|
|
|
711
1042
|
gap: "8px"
|
|
712
1043
|
}
|
|
713
1044
|
},
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ React14.createElement(Typography3, { variant: "body1", color: "text.primary" }, __8("We couldn\u2019t display your pages.", "elementor")),
|
|
1046
|
+
/* @__PURE__ */ React14.createElement(Box5, null, /* @__PURE__ */ React14.createElement(Typography3, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __8("It\u2019s probably a temporary issue.", "elementor")), /* @__PURE__ */ React14.createElement(Typography3, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __8("If the problem persists,", "elementor"), " ", /* @__PURE__ */ React14.createElement(Link, { target: "_blank", href: "https://go.elementor.com/wp-editor-support-open-ticket/" }, "Notify support")))
|
|
716
1047
|
)
|
|
717
1048
|
);
|
|
718
1049
|
}
|
|
719
1050
|
|
|
720
1051
|
// src/components/panel/posts-list/post-list-item.tsx
|
|
721
|
-
import * as
|
|
1052
|
+
import * as React29 from "react";
|
|
722
1053
|
|
|
723
1054
|
// src/components/panel/posts-list/list-items/list-item-create.tsx
|
|
724
|
-
import * as
|
|
1055
|
+
import * as React16 from "react";
|
|
725
1056
|
import { __useNavigateToDocument as useNavigateToDocument } from "@elementor/editor-documents";
|
|
726
|
-
import { __ as
|
|
1057
|
+
import { __ as __10, sprintf as sprintf2 } from "@wordpress/i18n";
|
|
727
1058
|
|
|
728
1059
|
// src/hooks/use-posts-actions.ts
|
|
729
1060
|
import { useMutation, useQueryClient } from "@elementor/query";
|
|
730
1061
|
|
|
1062
|
+
// src/site-content-restore.ts
|
|
1063
|
+
var SITE_CONTENT_V1_RESTORE_STATUS = "draft";
|
|
1064
|
+
|
|
731
1065
|
// src/hooks/use-recent-posts.ts
|
|
732
|
-
import { useQuery as
|
|
1066
|
+
import { useQuery as useQuery5 } from "@elementor/query";
|
|
733
1067
|
|
|
734
1068
|
// src/api/recent-posts.ts
|
|
735
1069
|
import apiFetch4 from "@wordpress/api-fetch";
|
|
@@ -746,7 +1080,7 @@ var getRequest2 = () => {
|
|
|
746
1080
|
// src/hooks/use-recent-posts.ts
|
|
747
1081
|
var recentPostsQueryKey = ["site-navigation", "recent-posts"];
|
|
748
1082
|
function useRecentPosts() {
|
|
749
|
-
return
|
|
1083
|
+
return useQuery5({
|
|
750
1084
|
queryKey: recentPostsQueryKey,
|
|
751
1085
|
queryFn: () => getRequest2()
|
|
752
1086
|
});
|
|
@@ -768,15 +1102,25 @@ function usePostActions(postTypeSlug) {
|
|
|
768
1102
|
mutationFn: (postId) => deleteRequest(postTypeSlug, postId),
|
|
769
1103
|
onSuccess
|
|
770
1104
|
});
|
|
1105
|
+
const forceDeletePost = useMutation({
|
|
1106
|
+
mutationFn: (postId) => deleteRequest(postTypeSlug, postId, true),
|
|
1107
|
+
onSuccess
|
|
1108
|
+
});
|
|
1109
|
+
const restorePost = useMutation({
|
|
1110
|
+
mutationFn: (postId) => updateRequest(postTypeSlug, { id: postId, status: SITE_CONTENT_V1_RESTORE_STATUS }),
|
|
1111
|
+
onSuccess
|
|
1112
|
+
});
|
|
771
1113
|
const duplicatePost = useMutation({
|
|
772
1114
|
mutationFn: (originalPost) => duplicateRequest(originalPost),
|
|
773
1115
|
onSuccess
|
|
774
1116
|
});
|
|
775
1117
|
return {
|
|
776
1118
|
createPost,
|
|
777
|
-
updatePost,
|
|
778
1119
|
deletePost,
|
|
779
|
-
duplicatePost
|
|
1120
|
+
duplicatePost,
|
|
1121
|
+
forceDeletePost,
|
|
1122
|
+
restorePost,
|
|
1123
|
+
updatePost
|
|
780
1124
|
};
|
|
781
1125
|
}
|
|
782
1126
|
function useInvalidatePosts(postTypeSlug) {
|
|
@@ -784,16 +1128,18 @@ function useInvalidatePosts(postTypeSlug) {
|
|
|
784
1128
|
return () => {
|
|
785
1129
|
const queryKey = postsQueryKeyBase(postTypeSlug);
|
|
786
1130
|
queryClient.invalidateQueries({ queryKey: recentPostsQueryKey });
|
|
1131
|
+
queryClient.invalidateQueries({ queryKey: postsBaselineTotalQueryKeyBase(postTypeSlug) });
|
|
1132
|
+
queryClient.invalidateQueries({ queryKey: siteContentStatusFilterCountsQueryKeyBase });
|
|
787
1133
|
return queryClient.invalidateQueries({ queryKey });
|
|
788
1134
|
};
|
|
789
1135
|
}
|
|
790
1136
|
|
|
791
1137
|
// src/components/panel/posts-list/list-items/edit-mode-template.tsx
|
|
792
|
-
import * as
|
|
1138
|
+
import * as React15 from "react";
|
|
793
1139
|
import { useRef as useRef3, useState as useState4 } from "react";
|
|
794
1140
|
import { XIcon } from "@elementor/icons";
|
|
795
|
-
import { Box as
|
|
796
|
-
import { __ as
|
|
1141
|
+
import { Box as Box6, CircularProgress, IconButton as IconButton3, ListItem, ListItemText as ListItemText3 } from "@elementor/ui";
|
|
1142
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
797
1143
|
var EDIT_ROW_FOCUS_BORDER_WIDTH_PX = 2;
|
|
798
1144
|
var EDIT_ROW_MIN_HEIGHT_PX = 36;
|
|
799
1145
|
var editModeListItemButtonSx = {
|
|
@@ -865,32 +1211,32 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
865
1211
|
}
|
|
866
1212
|
const value = e.target.value;
|
|
867
1213
|
if (!validateInput(value)) {
|
|
868
|
-
setInputError(
|
|
1214
|
+
setInputError(__9("Name is required", "elementor"));
|
|
869
1215
|
} else {
|
|
870
1216
|
setInputError(null);
|
|
871
1217
|
}
|
|
872
1218
|
setTitle(value);
|
|
873
1219
|
};
|
|
874
|
-
return /* @__PURE__ */
|
|
1220
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
875
1221
|
ListItem,
|
|
876
1222
|
{
|
|
877
1223
|
disablePadding: true,
|
|
878
1224
|
sx: contentPanelListRowPaddingSx,
|
|
879
|
-
secondaryAction: /* @__PURE__ */
|
|
1225
|
+
secondaryAction: /* @__PURE__ */ React15.createElement(CloseButton, { isLoading, closeButton })
|
|
880
1226
|
},
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
|
|
1227
|
+
/* @__PURE__ */ React15.createElement(
|
|
1228
|
+
Box6,
|
|
883
1229
|
{
|
|
884
1230
|
component: "form",
|
|
885
1231
|
onSubmit: onFormSubmit,
|
|
886
1232
|
sx: { ...editModeListItemButtonSx, display: "flex", width: "100%" }
|
|
887
1233
|
},
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
|
|
1234
|
+
/* @__PURE__ */ React15.createElement(Box6, { sx: editRowIndicatorSx(!!inputError) }, /* @__PURE__ */ React15.createElement(
|
|
1235
|
+
Box6,
|
|
890
1236
|
{
|
|
891
1237
|
autoFocus: true,
|
|
892
1238
|
"aria-invalid": !!inputError,
|
|
893
|
-
"aria-label":
|
|
1239
|
+
"aria-label": __9("Name", "elementor"),
|
|
894
1240
|
component: "input",
|
|
895
1241
|
disabled: isLoading,
|
|
896
1242
|
onBlur,
|
|
@@ -901,11 +1247,11 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
901
1247
|
}
|
|
902
1248
|
))
|
|
903
1249
|
)
|
|
904
|
-
), inputError && /* @__PURE__ */
|
|
1250
|
+
), inputError && /* @__PURE__ */ React15.createElement(ListItem, { disablePadding: true, sx: contentPanelListRowPaddingSx }, /* @__PURE__ */ React15.createElement(ListItemText3, { sx: { color: "error.main", ...contentPanelListRowTitleSx } }, inputError)));
|
|
905
1251
|
}
|
|
906
1252
|
function CloseButton({ isLoading, closeButton }) {
|
|
907
1253
|
const { resetEditMode } = usePostListContext();
|
|
908
|
-
return /* @__PURE__ */
|
|
1254
|
+
return /* @__PURE__ */ React15.createElement(IconButton3, { size: "tiny", color: "secondary", onClick: resetEditMode, ref: closeButton, disabled: isLoading }, isLoading ? /* @__PURE__ */ React15.createElement(CircularProgress, { size: "1rem" }) : /* @__PURE__ */ React15.createElement(XIcon, { fontSize: "tiny" }));
|
|
909
1255
|
}
|
|
910
1256
|
|
|
911
1257
|
// src/components/panel/posts-list/list-items/list-item-create.tsx
|
|
@@ -929,10 +1275,10 @@ function ListItemCreate() {
|
|
|
929
1275
|
};
|
|
930
1276
|
const newItemLabel = sprintf2(
|
|
931
1277
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
932
|
-
|
|
1278
|
+
__10("New %s", "elementor"),
|
|
933
1279
|
postTypesMap[type].labels.singular_name
|
|
934
1280
|
);
|
|
935
|
-
return /* @__PURE__ */
|
|
1281
|
+
return /* @__PURE__ */ React16.createElement(
|
|
936
1282
|
EditModeTemplate,
|
|
937
1283
|
{
|
|
938
1284
|
postTitle: newItemLabel,
|
|
@@ -943,9 +1289,9 @@ function ListItemCreate() {
|
|
|
943
1289
|
}
|
|
944
1290
|
|
|
945
1291
|
// src/components/panel/posts-list/list-items/list-item-duplicate.tsx
|
|
946
|
-
import * as
|
|
1292
|
+
import * as React17 from "react";
|
|
947
1293
|
import { __useNavigateToDocument as useNavigateToDocument2 } from "@elementor/editor-documents";
|
|
948
|
-
import { __ as
|
|
1294
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
949
1295
|
function ListItemDuplicate() {
|
|
950
1296
|
const { type, editMode, resetEditMode } = usePostListContext();
|
|
951
1297
|
const navigateToDocument = useNavigateToDocument2();
|
|
@@ -967,10 +1313,10 @@ function ListItemDuplicate() {
|
|
|
967
1313
|
resetEditMode();
|
|
968
1314
|
}
|
|
969
1315
|
};
|
|
970
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ React17.createElement(
|
|
971
1317
|
EditModeTemplate,
|
|
972
1318
|
{
|
|
973
|
-
postTitle: `${editMode.details.title} ${
|
|
1319
|
+
postTitle: `${editMode.details.title} ${__11("copy", "elementor")}`,
|
|
974
1320
|
isLoading: duplicatePost.isPending,
|
|
975
1321
|
callback: duplicatePostCallback
|
|
976
1322
|
}
|
|
@@ -978,7 +1324,7 @@ function ListItemDuplicate() {
|
|
|
978
1324
|
}
|
|
979
1325
|
|
|
980
1326
|
// src/components/panel/posts-list/list-items/list-item-rename.tsx
|
|
981
|
-
import * as
|
|
1327
|
+
import * as React18 from "react";
|
|
982
1328
|
import { __useActiveDocument as useActiveDocument } from "@elementor/editor-documents";
|
|
983
1329
|
|
|
984
1330
|
// src/hooks/use-rename-active-document.ts
|
|
@@ -1029,11 +1375,11 @@ function ListItemRename({ post }) {
|
|
|
1029
1375
|
resetEditMode();
|
|
1030
1376
|
}
|
|
1031
1377
|
};
|
|
1032
|
-
return /* @__PURE__ */
|
|
1378
|
+
return /* @__PURE__ */ React18.createElement(EditModeTemplate, { postTitle: title, isLoading: updatePost.isPending, callback: renamePostCallback });
|
|
1033
1379
|
}
|
|
1034
1380
|
|
|
1035
1381
|
// src/components/panel/posts-list/list-items/list-item-view.tsx
|
|
1036
|
-
import * as
|
|
1382
|
+
import * as React28 from "react";
|
|
1037
1383
|
import {
|
|
1038
1384
|
__useActiveDocument as useActiveDocument3,
|
|
1039
1385
|
__useNavigateToDocument as useNavigateToDocument3
|
|
@@ -1042,22 +1388,22 @@ import { DotsVerticalIcon, HomeIcon as HomeIcon2 } from "@elementor/icons";
|
|
|
1042
1388
|
import {
|
|
1043
1389
|
bindMenu as bindMenu2,
|
|
1044
1390
|
bindTrigger as bindTrigger2,
|
|
1045
|
-
Divider as
|
|
1046
|
-
IconButton as
|
|
1391
|
+
Divider as Divider5,
|
|
1392
|
+
IconButton as IconButton4,
|
|
1047
1393
|
ListItem as ListItem2,
|
|
1048
1394
|
ListItemButton as ListItemButton2,
|
|
1049
1395
|
ListItemText as ListItemText5,
|
|
1050
1396
|
Menu as Menu2,
|
|
1051
|
-
Tooltip,
|
|
1052
|
-
Typography as
|
|
1053
|
-
usePopupState as
|
|
1397
|
+
Tooltip as Tooltip3,
|
|
1398
|
+
Typography as Typography5,
|
|
1399
|
+
usePopupState as usePopupState3
|
|
1054
1400
|
} from "@elementor/ui";
|
|
1055
|
-
import { __ as
|
|
1401
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1056
1402
|
|
|
1057
1403
|
// src/components/shared/page-title-and-status.tsx
|
|
1058
|
-
import * as
|
|
1059
|
-
import { Box as
|
|
1060
|
-
import { __ as
|
|
1404
|
+
import * as React19 from "react";
|
|
1405
|
+
import { Box as Box7, Chip as Chip3, Typography as Typography4 } from "@elementor/ui";
|
|
1406
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1061
1407
|
|
|
1062
1408
|
// src/hooks/use-reverse-html-entities.ts
|
|
1063
1409
|
import { useMemo as useMemo3 } from "react";
|
|
@@ -1084,19 +1430,19 @@ function humanizeStatusSlug(status) {
|
|
|
1084
1430
|
var statusChipConfig = {
|
|
1085
1431
|
draft: {
|
|
1086
1432
|
color: "default",
|
|
1087
|
-
label:
|
|
1433
|
+
label: __12("Draft", "elementor")
|
|
1088
1434
|
},
|
|
1089
1435
|
future: {
|
|
1090
1436
|
color: "default",
|
|
1091
|
-
label:
|
|
1437
|
+
label: __12("Scheduled", "elementor")
|
|
1092
1438
|
},
|
|
1093
1439
|
pending: {
|
|
1094
1440
|
color: "warning",
|
|
1095
|
-
label:
|
|
1441
|
+
label: __12("Pending Review", "elementor")
|
|
1096
1442
|
},
|
|
1097
1443
|
private: {
|
|
1098
1444
|
color: "default",
|
|
1099
|
-
label:
|
|
1445
|
+
label: __12("Private", "elementor")
|
|
1100
1446
|
}
|
|
1101
1447
|
};
|
|
1102
1448
|
function getStatusChipConfig(status) {
|
|
@@ -1118,8 +1464,8 @@ var PageStatus = ({ status }) => {
|
|
|
1118
1464
|
}
|
|
1119
1465
|
const { color, label } = getStatusChipConfig(status);
|
|
1120
1466
|
const isKnownStatus = isKnownPanelStatus(status);
|
|
1121
|
-
return /* @__PURE__ */
|
|
1122
|
-
|
|
1467
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1468
|
+
Chip3,
|
|
1123
1469
|
{
|
|
1124
1470
|
color,
|
|
1125
1471
|
component: "span",
|
|
@@ -1143,8 +1489,8 @@ var PageStatus = ({ status }) => {
|
|
|
1143
1489
|
};
|
|
1144
1490
|
var PageTitle = ({ title }) => {
|
|
1145
1491
|
const modifiedTitle = useReverseHtmlEntities(title);
|
|
1146
|
-
return /* @__PURE__ */
|
|
1147
|
-
|
|
1492
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1493
|
+
Typography4,
|
|
1148
1494
|
{
|
|
1149
1495
|
component: "span",
|
|
1150
1496
|
variant: "body2",
|
|
@@ -1159,11 +1505,11 @@ var PageTitle = ({ title }) => {
|
|
|
1159
1505
|
);
|
|
1160
1506
|
};
|
|
1161
1507
|
function PageTitleAndStatus({ title, status }) {
|
|
1162
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ React19.createElement(Box7, { alignItems: "center", display: "flex", minWidth: 0 }, /* @__PURE__ */ React19.createElement(PageTitle, { title }), /* @__PURE__ */ React19.createElement(PageStatus, { status }));
|
|
1163
1509
|
}
|
|
1164
1510
|
|
|
1165
1511
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
1166
|
-
import * as
|
|
1512
|
+
import * as React21 from "react";
|
|
1167
1513
|
import { useState as useState5 } from "react";
|
|
1168
1514
|
import { __useActiveDocument as useActiveDocument2 } from "@elementor/editor-documents";
|
|
1169
1515
|
import { TrashIcon } from "@elementor/icons";
|
|
@@ -1175,23 +1521,23 @@ import {
|
|
|
1175
1521
|
DialogContent,
|
|
1176
1522
|
DialogContentText,
|
|
1177
1523
|
DialogTitle,
|
|
1178
|
-
Divider as
|
|
1524
|
+
Divider as Divider3
|
|
1179
1525
|
} from "@elementor/ui";
|
|
1180
|
-
import { __ as
|
|
1526
|
+
import { __ as __13, sprintf as sprintf3 } from "@wordpress/i18n";
|
|
1181
1527
|
|
|
1182
1528
|
// src/components/panel/actions-menu/action-menu-item.tsx
|
|
1183
|
-
import * as
|
|
1184
|
-
import { ListItemIcon as ListItemIcon2, ListItemText as ListItemText4, MenuItem as
|
|
1185
|
-
function ActionMenuItem({
|
|
1186
|
-
return /* @__PURE__ */
|
|
1529
|
+
import * as React20 from "react";
|
|
1530
|
+
import { ListItemIcon as ListItemIcon2, ListItemText as ListItemText4, MenuItem as MenuItem3 } from "@elementor/ui";
|
|
1531
|
+
function ActionMenuItem({ description, icon: Icon, MenuItemProps, title }) {
|
|
1532
|
+
return /* @__PURE__ */ React20.createElement(MenuItem3, { ...MenuItemProps }, /* @__PURE__ */ React20.createElement(
|
|
1187
1533
|
ListItemIcon2,
|
|
1188
1534
|
{
|
|
1189
1535
|
sx: {
|
|
1190
1536
|
color: "inherit"
|
|
1191
1537
|
}
|
|
1192
1538
|
},
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
), /* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ React20.createElement(Icon, null)
|
|
1540
|
+
), /* @__PURE__ */ React20.createElement(ListItemText4, { primary: title, secondary: description }));
|
|
1195
1541
|
}
|
|
1196
1542
|
|
|
1197
1543
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
@@ -1201,10 +1547,10 @@ function Delete({ post }) {
|
|
|
1201
1547
|
const isPostActive = activeDocument?.id === post.id;
|
|
1202
1548
|
const userCanDelete = post.user_can.delete;
|
|
1203
1549
|
const isDisabled = !userCanDelete || post.isHome || isPostActive;
|
|
1204
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
1205
1551
|
ActionMenuItem,
|
|
1206
1552
|
{
|
|
1207
|
-
title:
|
|
1553
|
+
title: __13("Delete", "elementor"),
|
|
1208
1554
|
icon: TrashIcon,
|
|
1209
1555
|
MenuItemProps: {
|
|
1210
1556
|
disabled: isDisabled,
|
|
@@ -1212,7 +1558,7 @@ function Delete({ post }) {
|
|
|
1212
1558
|
sx: { "&:hover": { color: "error.main" } }
|
|
1213
1559
|
}
|
|
1214
1560
|
}
|
|
1215
|
-
), isDialogOpen && /* @__PURE__ */
|
|
1561
|
+
), isDialogOpen && /* @__PURE__ */ React21.createElement(DeleteDialog, { post, setIsDialogOpen }));
|
|
1216
1562
|
}
|
|
1217
1563
|
function DeleteDialog({
|
|
1218
1564
|
post,
|
|
@@ -1221,11 +1567,11 @@ function DeleteDialog({
|
|
|
1221
1567
|
const { type } = usePostListContext();
|
|
1222
1568
|
const { deletePost } = usePostActions(type);
|
|
1223
1569
|
const { setError } = usePostListContext();
|
|
1224
|
-
const dialogTitle = sprintf3(
|
|
1225
|
-
const dialogBody = type === "post" ?
|
|
1570
|
+
const dialogTitle = sprintf3(__13('Delete "%s"?', "elementor"), post.title.rendered);
|
|
1571
|
+
const dialogBody = type === "post" ? __13(
|
|
1226
1572
|
"The post and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1227
1573
|
"elementor"
|
|
1228
|
-
) :
|
|
1574
|
+
) : __13(
|
|
1229
1575
|
"The page and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1230
1576
|
"elementor"
|
|
1231
1577
|
);
|
|
@@ -1243,7 +1589,7 @@ function DeleteDialog({
|
|
|
1243
1589
|
}
|
|
1244
1590
|
setIsDialogOpen(false);
|
|
1245
1591
|
};
|
|
1246
|
-
return /* @__PURE__ */
|
|
1592
|
+
return /* @__PURE__ */ React21.createElement(Dialog, { open: true, onClose: handleCancel, "aria-labelledby": "delete-dialog" }, /* @__PURE__ */ React21.createElement(DialogTitle, { noWrap: true }, dialogTitle), /* @__PURE__ */ React21.createElement(Divider3, null), /* @__PURE__ */ React21.createElement(DialogContent, null, /* @__PURE__ */ React21.createElement(DialogContentText, null, dialogBody)), /* @__PURE__ */ React21.createElement(DialogActions, null, /* @__PURE__ */ React21.createElement(
|
|
1247
1593
|
Button,
|
|
1248
1594
|
{
|
|
1249
1595
|
variant: "contained",
|
|
@@ -1251,14 +1597,14 @@ function DeleteDialog({
|
|
|
1251
1597
|
onClick: handleCancel,
|
|
1252
1598
|
disabled: deletePost.isPending
|
|
1253
1599
|
},
|
|
1254
|
-
|
|
1255
|
-
), /* @__PURE__ */
|
|
1600
|
+
__13("Cancel", "elementor")
|
|
1601
|
+
), /* @__PURE__ */ React21.createElement(Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? __13("Delete", "elementor") : /* @__PURE__ */ React21.createElement(CircularProgress2, null))));
|
|
1256
1602
|
}
|
|
1257
1603
|
|
|
1258
1604
|
// src/components/panel/actions-menu/actions/duplicate.tsx
|
|
1259
|
-
import * as
|
|
1605
|
+
import * as React22 from "react";
|
|
1260
1606
|
import { CopyIcon } from "@elementor/icons";
|
|
1261
|
-
import { __ as
|
|
1607
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1262
1608
|
function Duplicate({ post, popupState }) {
|
|
1263
1609
|
const { setEditMode, type } = usePostListContext();
|
|
1264
1610
|
const canCreate = useCanCreate(type);
|
|
@@ -1273,10 +1619,10 @@ function Duplicate({ post, popupState }) {
|
|
|
1273
1619
|
});
|
|
1274
1620
|
};
|
|
1275
1621
|
const isDisabled = !canCreate;
|
|
1276
|
-
return /* @__PURE__ */
|
|
1622
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1277
1623
|
ActionMenuItem,
|
|
1278
1624
|
{
|
|
1279
|
-
title:
|
|
1625
|
+
title: __14("Duplicate", "elementor"),
|
|
1280
1626
|
icon: CopyIcon,
|
|
1281
1627
|
MenuItemProps: {
|
|
1282
1628
|
disabled: isDisabled,
|
|
@@ -1286,16 +1632,90 @@ function Duplicate({ post, popupState }) {
|
|
|
1286
1632
|
);
|
|
1287
1633
|
}
|
|
1288
1634
|
|
|
1635
|
+
// src/components/panel/actions-menu/actions/force-delete.tsx
|
|
1636
|
+
import * as React23 from "react";
|
|
1637
|
+
import { useState as useState6 } from "react";
|
|
1638
|
+
import { TrashIcon as TrashIcon2 } from "@elementor/icons";
|
|
1639
|
+
import {
|
|
1640
|
+
Button as Button2,
|
|
1641
|
+
CircularProgress as CircularProgress3,
|
|
1642
|
+
Dialog as Dialog2,
|
|
1643
|
+
DialogActions as DialogActions2,
|
|
1644
|
+
DialogContent as DialogContent2,
|
|
1645
|
+
DialogContentText as DialogContentText2,
|
|
1646
|
+
DialogTitle as DialogTitle2,
|
|
1647
|
+
Divider as Divider4
|
|
1648
|
+
} from "@elementor/ui";
|
|
1649
|
+
import { __ as __15, sprintf as sprintf4 } from "@wordpress/i18n";
|
|
1650
|
+
function ForceDelete({ post }) {
|
|
1651
|
+
const [isDialogOpen, setIsDialogOpen] = useState6(false);
|
|
1652
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
1653
|
+
ActionMenuItem,
|
|
1654
|
+
{
|
|
1655
|
+
icon: TrashIcon2,
|
|
1656
|
+
MenuItemProps: {
|
|
1657
|
+
disabled: !post.user_can.delete,
|
|
1658
|
+
onClick: () => setIsDialogOpen(true),
|
|
1659
|
+
sx: { "&:hover": { color: "error.main" } }
|
|
1660
|
+
},
|
|
1661
|
+
title: __15("Delete permanently", "elementor")
|
|
1662
|
+
}
|
|
1663
|
+
), isDialogOpen && /* @__PURE__ */ React23.createElement(ForceDeleteDialog, { post, setIsDialogOpen }));
|
|
1664
|
+
}
|
|
1665
|
+
function ForceDeleteDialog({
|
|
1666
|
+
post,
|
|
1667
|
+
setIsDialogOpen
|
|
1668
|
+
}) {
|
|
1669
|
+
const { setError, type } = usePostListContext();
|
|
1670
|
+
const { forceDeletePost } = usePostActions(type);
|
|
1671
|
+
const dialogTitle = sprintf4(__15('Delete "%s" permanently?', "elementor"), post.title.rendered);
|
|
1672
|
+
const dialogBody = __15("This will permanently delete the item. You cannot undo this action.", "elementor");
|
|
1673
|
+
const handleDelete = async () => {
|
|
1674
|
+
try {
|
|
1675
|
+
await forceDeletePost.mutateAsync(post.id);
|
|
1676
|
+
setIsDialogOpen(false);
|
|
1677
|
+
} catch {
|
|
1678
|
+
setError();
|
|
1679
|
+
setIsDialogOpen(false);
|
|
1680
|
+
}
|
|
1681
|
+
};
|
|
1682
|
+
const handleCancel = () => {
|
|
1683
|
+
if (forceDeletePost.isPending) {
|
|
1684
|
+
return;
|
|
1685
|
+
}
|
|
1686
|
+
setIsDialogOpen(false);
|
|
1687
|
+
};
|
|
1688
|
+
return /* @__PURE__ */ React23.createElement(Dialog2, { "aria-labelledby": "force-delete-dialog", onClose: handleCancel, open: true }, /* @__PURE__ */ React23.createElement(DialogTitle2, { noWrap: true }, dialogTitle), /* @__PURE__ */ React23.createElement(Divider4, null), /* @__PURE__ */ React23.createElement(DialogContent2, null, /* @__PURE__ */ React23.createElement(DialogContentText2, null, dialogBody)), /* @__PURE__ */ React23.createElement(DialogActions2, null, /* @__PURE__ */ React23.createElement(
|
|
1689
|
+
Button2,
|
|
1690
|
+
{
|
|
1691
|
+
variant: "contained",
|
|
1692
|
+
color: "secondary",
|
|
1693
|
+
onClick: handleCancel,
|
|
1694
|
+
disabled: forceDeletePost.isPending
|
|
1695
|
+
},
|
|
1696
|
+
__15("Cancel", "elementor")
|
|
1697
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1698
|
+
Button2,
|
|
1699
|
+
{
|
|
1700
|
+
variant: "contained",
|
|
1701
|
+
color: "error",
|
|
1702
|
+
onClick: () => void handleDelete(),
|
|
1703
|
+
disabled: forceDeletePost.isPending
|
|
1704
|
+
},
|
|
1705
|
+
!forceDeletePost.isPending ? __15("Delete permanently", "elementor") : /* @__PURE__ */ React23.createElement(CircularProgress3, null)
|
|
1706
|
+
)));
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1289
1709
|
// src/components/panel/actions-menu/actions/rename.tsx
|
|
1290
|
-
import * as
|
|
1710
|
+
import * as React24 from "react";
|
|
1291
1711
|
import { EraseIcon } from "@elementor/icons";
|
|
1292
|
-
import { __ as
|
|
1712
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1293
1713
|
function Rename({ post }) {
|
|
1294
1714
|
const { setEditMode } = usePostListContext();
|
|
1295
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1296
1716
|
ActionMenuItem,
|
|
1297
1717
|
{
|
|
1298
|
-
title:
|
|
1718
|
+
title: __16("Rename", "elementor"),
|
|
1299
1719
|
icon: EraseIcon,
|
|
1300
1720
|
MenuItemProps: {
|
|
1301
1721
|
disabled: !post.user_can.edit,
|
|
@@ -1312,11 +1732,39 @@ function Rename({ post }) {
|
|
|
1312
1732
|
);
|
|
1313
1733
|
}
|
|
1314
1734
|
|
|
1735
|
+
// src/components/panel/actions-menu/actions/restore.tsx
|
|
1736
|
+
import * as React25 from "react";
|
|
1737
|
+
import { RefreshIcon } from "@elementor/icons";
|
|
1738
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
1739
|
+
function Restore({ post }) {
|
|
1740
|
+
const { setError, type } = usePostListContext();
|
|
1741
|
+
const { restorePost } = usePostActions(type);
|
|
1742
|
+
const handleClick = async () => {
|
|
1743
|
+
try {
|
|
1744
|
+
await restorePost.mutateAsync(post.id);
|
|
1745
|
+
} catch {
|
|
1746
|
+
setError();
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
return /* @__PURE__ */ React25.createElement(
|
|
1750
|
+
ActionMenuItem,
|
|
1751
|
+
{
|
|
1752
|
+
description: __17("Restored as draft", "elementor"),
|
|
1753
|
+
title: __17("Restore", "elementor"),
|
|
1754
|
+
icon: RefreshIcon,
|
|
1755
|
+
MenuItemProps: {
|
|
1756
|
+
disabled: restorePost.isPending || !post.user_can.delete,
|
|
1757
|
+
onClick: () => void handleClick()
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
);
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1315
1763
|
// src/components/panel/actions-menu/actions/set-home.tsx
|
|
1316
|
-
import * as
|
|
1764
|
+
import * as React26 from "react";
|
|
1317
1765
|
import { HomeIcon } from "@elementor/icons";
|
|
1318
|
-
import { CircularProgress as
|
|
1319
|
-
import { __ as
|
|
1766
|
+
import { CircularProgress as CircularProgress4 } from "@elementor/ui";
|
|
1767
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1320
1768
|
|
|
1321
1769
|
// src/hooks/use-homepage-actions.ts
|
|
1322
1770
|
import { useMutation as useMutation2, useQueryClient as useQueryClient2 } from "@elementor/query";
|
|
@@ -1355,11 +1803,11 @@ function SetHome({ post, closeMenu }) {
|
|
|
1355
1803
|
const isPostPublished = post.status === "publish";
|
|
1356
1804
|
const isPostHomepage = !!post.isHome;
|
|
1357
1805
|
const isDisabled = !canManageOptions || isPostHomepage || !isPostPublished || updateSettingsMutation.isPending;
|
|
1358
|
-
return /* @__PURE__ */
|
|
1806
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1359
1807
|
ActionMenuItem,
|
|
1360
1808
|
{
|
|
1361
|
-
title:
|
|
1362
|
-
icon: !updateSettingsMutation.isPending ? HomeIcon :
|
|
1809
|
+
title: __18("Set as homepage", "elementor"),
|
|
1810
|
+
icon: !updateSettingsMutation.isPending ? HomeIcon : CircularProgress4,
|
|
1363
1811
|
MenuItemProps: {
|
|
1364
1812
|
disabled: isDisabled,
|
|
1365
1813
|
onClick: handleClick
|
|
@@ -1369,13 +1817,13 @@ function SetHome({ post, closeMenu }) {
|
|
|
1369
1817
|
}
|
|
1370
1818
|
|
|
1371
1819
|
// src/components/panel/actions-menu/actions/view.tsx
|
|
1372
|
-
import * as
|
|
1820
|
+
import * as React27 from "react";
|
|
1373
1821
|
import { EyeIcon } from "@elementor/icons";
|
|
1374
|
-
import { __ as
|
|
1822
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1375
1823
|
function View({ post }) {
|
|
1376
1824
|
const { type } = usePostListContext();
|
|
1377
|
-
const title =
|
|
1378
|
-
return /* @__PURE__ */
|
|
1825
|
+
const title = __19("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
|
|
1826
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1379
1827
|
ActionMenuItem,
|
|
1380
1828
|
{
|
|
1381
1829
|
title,
|
|
@@ -1394,16 +1842,16 @@ var DisabledPostTooltip = ({
|
|
|
1394
1842
|
postTypeSlug
|
|
1395
1843
|
}) => {
|
|
1396
1844
|
if (isDisabled) {
|
|
1397
|
-
const title = /* @__PURE__ */
|
|
1398
|
-
return /* @__PURE__ */
|
|
1845
|
+
const title = /* @__PURE__ */ React28.createElement(Typography5, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React28.createElement("br", null), __20("To edit it directly, contact the site owner", "elementor"));
|
|
1846
|
+
return /* @__PURE__ */ React28.createElement(Tooltip3, { title, placement: "bottom", arrow: false }, /* @__PURE__ */ React28.createElement("span", null, children));
|
|
1399
1847
|
}
|
|
1400
|
-
return /* @__PURE__ */
|
|
1848
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, children);
|
|
1401
1849
|
};
|
|
1402
1850
|
function ListItemView({ post }) {
|
|
1403
1851
|
const { type } = usePostListContext();
|
|
1404
1852
|
const activeDocument = useActiveDocument3();
|
|
1405
1853
|
const navigateToDocument = useNavigateToDocument3();
|
|
1406
|
-
const popupState =
|
|
1854
|
+
const popupState = usePopupState3({
|
|
1407
1855
|
variant: "popover",
|
|
1408
1856
|
popupId: "post-actions",
|
|
1409
1857
|
disableAutoFocus: true
|
|
@@ -1411,17 +1859,19 @@ function ListItemView({ post }) {
|
|
|
1411
1859
|
const isActive = activeDocument?.id === post.id;
|
|
1412
1860
|
const status = isActive ? activeDocument?.status.value : post.status;
|
|
1413
1861
|
const title = isActive ? activeDocument?.title : post.title.rendered;
|
|
1414
|
-
const
|
|
1862
|
+
const isTrashed = "trash" === post.status;
|
|
1863
|
+
const isEditBlocked = !post.user_can.edit && !isTrashed;
|
|
1864
|
+
const isRowDisabled = isEditBlocked || isTrashed;
|
|
1415
1865
|
const menuTriggerProps = bindTrigger2(popupState);
|
|
1416
|
-
|
|
1866
|
+
const listRow = /* @__PURE__ */ React28.createElement(
|
|
1417
1867
|
ListItem2,
|
|
1418
1868
|
{
|
|
1419
1869
|
disablePadding: true,
|
|
1420
1870
|
sx: contentPanelListRowPaddingSx,
|
|
1421
|
-
secondaryAction: /* @__PURE__ */
|
|
1422
|
-
|
|
1871
|
+
secondaryAction: /* @__PURE__ */ React28.createElement(
|
|
1872
|
+
IconButton4,
|
|
1423
1873
|
{
|
|
1424
|
-
"aria-label":
|
|
1874
|
+
"aria-label": __20("More actions", "elementor"),
|
|
1425
1875
|
size: "tiny",
|
|
1426
1876
|
...menuTriggerProps,
|
|
1427
1877
|
onClick: (event) => {
|
|
@@ -1429,39 +1879,37 @@ function ListItemView({ post }) {
|
|
|
1429
1879
|
menuTriggerProps.onClick?.(event);
|
|
1430
1880
|
}
|
|
1431
1881
|
},
|
|
1432
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ React28.createElement(DotsVerticalIcon, { fontSize: "tiny" })
|
|
1433
1883
|
)
|
|
1434
1884
|
},
|
|
1435
|
-
/* @__PURE__ */
|
|
1885
|
+
/* @__PURE__ */ React28.createElement(
|
|
1436
1886
|
ListItemButton2,
|
|
1437
1887
|
{
|
|
1438
1888
|
dense: true,
|
|
1439
1889
|
disableGutters: true,
|
|
1440
|
-
disabled:
|
|
1890
|
+
disabled: isRowDisabled,
|
|
1441
1891
|
onClick: () => {
|
|
1442
|
-
if (
|
|
1443
|
-
|
|
1892
|
+
if (isTrashed || isActive) {
|
|
1893
|
+
return;
|
|
1444
1894
|
}
|
|
1895
|
+
navigateToDocument(post.id);
|
|
1445
1896
|
},
|
|
1446
1897
|
selected: isActive,
|
|
1447
1898
|
shape: "rounded",
|
|
1448
1899
|
sx: contentPanelListItemButtonSx
|
|
1449
1900
|
},
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
post.isHome && /* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ React28.createElement(ListItemText5, { disableTypography: true, sx: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React28.createElement(PageTitleAndStatus, { title, status })),
|
|
1902
|
+
post.isHome && /* @__PURE__ */ React28.createElement(HomeIcon2, { titleAccess: __20("Homepage", "elementor"), color: "disabled" })
|
|
1452
1903
|
)
|
|
1453
|
-
)
|
|
1904
|
+
);
|
|
1905
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, isEditBlocked ? /* @__PURE__ */ React28.createElement(DisabledPostTooltip, { isDisabled: true, postTypeSlug: type }, listRow) : listRow, /* @__PURE__ */ React28.createElement(
|
|
1454
1906
|
Menu2,
|
|
1455
1907
|
{
|
|
1456
1908
|
PaperProps: { sx: { mt: 2, width: 200 } },
|
|
1457
1909
|
MenuListProps: { dense: true },
|
|
1458
1910
|
...bindMenu2(popupState)
|
|
1459
1911
|
},
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */ React21.createElement(Duplicate, { post, popupState }),
|
|
1462
|
-
/* @__PURE__ */ React21.createElement(Delete, { post }),
|
|
1463
|
-
/* @__PURE__ */ React21.createElement(View, { post }),
|
|
1464
|
-
type === "page" && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(Divider3, null), /* @__PURE__ */ React21.createElement(SetHome, { post, closeMenu: () => popupState.close() }))
|
|
1912
|
+
isTrashed ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Restore, { post }), /* @__PURE__ */ React28.createElement(ForceDelete, { post })) : /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Rename, { post }), /* @__PURE__ */ React28.createElement(Duplicate, { post, popupState }), /* @__PURE__ */ React28.createElement(Delete, { post }), /* @__PURE__ */ React28.createElement(View, { post }), type === "page" && /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Divider5, null), /* @__PURE__ */ React28.createElement(SetHome, { post, closeMenu: () => popupState.close() })))
|
|
1465
1913
|
));
|
|
1466
1914
|
}
|
|
1467
1915
|
|
|
@@ -1469,25 +1917,25 @@ function ListItemView({ post }) {
|
|
|
1469
1917
|
function PostListItem({ post }) {
|
|
1470
1918
|
const { editMode } = usePostListContext();
|
|
1471
1919
|
if ("rename" === editMode.mode && post?.id && post?.id === editMode.details.postId) {
|
|
1472
|
-
return /* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ React29.createElement(ListItemRename, { post });
|
|
1473
1921
|
}
|
|
1474
1922
|
if ("create" === editMode.mode && !post) {
|
|
1475
|
-
return /* @__PURE__ */
|
|
1923
|
+
return /* @__PURE__ */ React29.createElement(ListItemCreate, null);
|
|
1476
1924
|
}
|
|
1477
1925
|
if ("duplicate" === editMode.mode && !post) {
|
|
1478
|
-
return /* @__PURE__ */
|
|
1926
|
+
return /* @__PURE__ */ React29.createElement(ListItemDuplicate, null);
|
|
1479
1927
|
}
|
|
1480
1928
|
if (!post) {
|
|
1481
1929
|
return null;
|
|
1482
1930
|
}
|
|
1483
|
-
return /* @__PURE__ */
|
|
1931
|
+
return /* @__PURE__ */ React29.createElement(ListItemView, { post });
|
|
1484
1932
|
}
|
|
1485
1933
|
|
|
1486
1934
|
// src/components/panel/posts-list/post-list-pagination-actions.tsx
|
|
1487
|
-
import * as
|
|
1935
|
+
import * as React30 from "react";
|
|
1488
1936
|
import { CollapseIcon as CollapseIcon2 } from "@elementor/editor-ui";
|
|
1489
|
-
import { Box as
|
|
1490
|
-
import { __ as
|
|
1937
|
+
import { Box as Box8, Button as Button3, CircularProgress as CircularProgress5, Stack as Stack5 } from "@elementor/ui";
|
|
1938
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1491
1939
|
var listPaginationButtonProps = {
|
|
1492
1940
|
color: "secondary",
|
|
1493
1941
|
size: "small",
|
|
@@ -1504,28 +1952,28 @@ function PostListPaginationActions({
|
|
|
1504
1952
|
if (!canLoadMore && !canShowLess) {
|
|
1505
1953
|
return null;
|
|
1506
1954
|
}
|
|
1507
|
-
const loadMoreLabel =
|
|
1508
|
-
const showLessLabel =
|
|
1509
|
-
const loadMoreButton = /* @__PURE__ */
|
|
1510
|
-
|
|
1955
|
+
const loadMoreLabel = __21("Load more", "elementor");
|
|
1956
|
+
const showLessLabel = __21("Show less", "elementor");
|
|
1957
|
+
const loadMoreButton = /* @__PURE__ */ React30.createElement(
|
|
1958
|
+
Button3,
|
|
1511
1959
|
{
|
|
1512
1960
|
...listPaginationButtonProps,
|
|
1513
1961
|
ref: loadMoreButtonRef,
|
|
1514
1962
|
"aria-label": loadMoreLabel,
|
|
1515
1963
|
disabled: isLoadingMore,
|
|
1516
|
-
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */
|
|
1964
|
+
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */ React30.createElement(CollapseIcon2, { open: false }),
|
|
1517
1965
|
fullWidth: true,
|
|
1518
1966
|
onClick: onLoadMore,
|
|
1519
1967
|
sx: { flex: 1, my: 0.5 }
|
|
1520
1968
|
},
|
|
1521
|
-
isLoadingMore ? /* @__PURE__ */
|
|
1969
|
+
isLoadingMore ? /* @__PURE__ */ React30.createElement(CircularProgress5, { size: 20 }) : loadMoreLabel
|
|
1522
1970
|
);
|
|
1523
|
-
const showLessButton = /* @__PURE__ */
|
|
1524
|
-
|
|
1971
|
+
const showLessButton = /* @__PURE__ */ React30.createElement(
|
|
1972
|
+
Button3,
|
|
1525
1973
|
{
|
|
1526
1974
|
...listPaginationButtonProps,
|
|
1527
1975
|
"aria-label": showLessLabel,
|
|
1528
|
-
endIcon: /* @__PURE__ */
|
|
1976
|
+
endIcon: /* @__PURE__ */ React30.createElement(CollapseIcon2, { open: true }),
|
|
1529
1977
|
fullWidth: true,
|
|
1530
1978
|
onClick: onShowLess,
|
|
1531
1979
|
sx: { flex: 1, my: 0.5 }
|
|
@@ -1533,19 +1981,19 @@ function PostListPaginationActions({
|
|
|
1533
1981
|
showLessLabel
|
|
1534
1982
|
);
|
|
1535
1983
|
if (canShowLess && canLoadMore) {
|
|
1536
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ React30.createElement(Box8, { sx: { px: 2, width: "100%" } }, /* @__PURE__ */ React30.createElement(Stack5, { direction: "row", spacing: 1 }, showLessButton, loadMoreButton));
|
|
1537
1985
|
}
|
|
1538
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ React30.createElement(Box8, { sx: { px: 2, width: "100%" } }, canShowLess ? showLessButton : loadMoreButton);
|
|
1539
1987
|
}
|
|
1540
1988
|
|
|
1541
1989
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
1542
1990
|
var SEARCH_DEBOUNCE_MS = 300;
|
|
1543
1991
|
function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
1544
|
-
const { type, editMode, setEditMode } = usePostListContext();
|
|
1545
|
-
const { registerSection,
|
|
1546
|
-
const [isOpen, setIsOpen] =
|
|
1992
|
+
const { type, editMode, resetEditMode, setEditMode } = usePostListContext();
|
|
1993
|
+
const { registerSection, searchQuery, statusFilters, unregisterSection } = useContentPanelCoordinator();
|
|
1994
|
+
const [isOpen, setIsOpen] = useState7(isOpenByDefault);
|
|
1547
1995
|
const trimmedSearch = searchQuery.trim();
|
|
1548
|
-
const [debouncedSearch, setDebouncedSearch] =
|
|
1996
|
+
const [debouncedSearch, setDebouncedSearch] = useState7(trimmedSearch);
|
|
1549
1997
|
const focusAfterShowLessRef = useRef4(false);
|
|
1550
1998
|
const listTopRef = useRef4(null);
|
|
1551
1999
|
const loadMoreButtonRef = useRef4(null);
|
|
@@ -1561,9 +2009,19 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
1561
2009
|
fetchNextPage,
|
|
1562
2010
|
hasNextPage,
|
|
1563
2011
|
isFetchingNextPage
|
|
1564
|
-
} = usePosts(type, debouncedSearch);
|
|
2012
|
+
} = usePosts(type, debouncedSearch, statusFilters);
|
|
2013
|
+
const isNarrowed = isSiteContentListNarrowed(statusFilters, debouncedSearch);
|
|
2014
|
+
const isTrashFilter = isSiteContentTrashFilterActive(statusFilters);
|
|
2015
|
+
const baselineStatus = isTrashFilter ? "trash" : "any";
|
|
2016
|
+
const { data: baselineTotal } = usePostsBaselineTotal(type, isNarrowed, baselineStatus);
|
|
1565
2017
|
const { data: homepageId } = useHomepage();
|
|
1566
2018
|
const isPageType = type === "page";
|
|
2019
|
+
const statusFiltersKey = serializeSiteContentStatusFilters(statusFilters);
|
|
2020
|
+
useEffect2(() => {
|
|
2021
|
+
if (isTrashFilter) {
|
|
2022
|
+
resetEditMode();
|
|
2023
|
+
}
|
|
2024
|
+
}, [isTrashFilter, resetEditMode]);
|
|
1567
2025
|
useEffect2(() => {
|
|
1568
2026
|
registerSection(type, {
|
|
1569
2027
|
setExpanded: setIsOpen,
|
|
@@ -1592,7 +2050,7 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
1592
2050
|
hasNextPage,
|
|
1593
2051
|
isFetchingNextPage,
|
|
1594
2052
|
loadedCount: filteredPosts.length,
|
|
1595
|
-
resetKey: `${type}:${debouncedSearch}`,
|
|
2053
|
+
resetKey: `${type}:${debouncedSearch}:${statusFiltersKey}`,
|
|
1596
2054
|
totalCount: total
|
|
1597
2055
|
});
|
|
1598
2056
|
const displayedPosts = useMemo4(
|
|
@@ -1620,36 +2078,38 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
1620
2078
|
sectionHeaderRef.current?.focus();
|
|
1621
2079
|
}, [pagination.canLoadMore, pagination.visibleCount]);
|
|
1622
2080
|
useEffect2(() => {
|
|
1623
|
-
if (debouncedSearch && filteredPosts.length > 0) {
|
|
2081
|
+
if ((debouncedSearch || hasActiveSiteContentStatusFilters(statusFilters)) && filteredPosts.length > 0) {
|
|
1624
2082
|
setIsOpen(true);
|
|
1625
2083
|
}
|
|
1626
|
-
}, [debouncedSearch, filteredPosts.length]);
|
|
2084
|
+
}, [debouncedSearch, filteredPosts.length, statusFilters]);
|
|
1627
2085
|
if (postsError) {
|
|
1628
|
-
return /* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ React31.createElement(ErrorState, null);
|
|
1629
2087
|
}
|
|
1630
2088
|
if (postsPending && !posts?.length) {
|
|
1631
|
-
return /* @__PURE__ */
|
|
2089
|
+
return /* @__PURE__ */ React31.createElement(Box9, { sx: { px: 2 } }, /* @__PURE__ */ React31.createElement(Box9, null, /* @__PURE__ */ React31.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "100%", height: "24px" }), /* @__PURE__ */ React31.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React31.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React31.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" })));
|
|
1632
2090
|
}
|
|
1633
2091
|
const displayCount = total;
|
|
1634
2092
|
const sectionTitle = postTypesMap[type].labels.plural_name;
|
|
1635
|
-
const showNoResults = debouncedSearch && filteredPosts.length === 0;
|
|
1636
|
-
|
|
2093
|
+
const showNoResults = (debouncedSearch || hasActiveSiteContentStatusFilters(statusFilters)) && filteredPosts.length === 0;
|
|
2094
|
+
const countChipLabel = isNarrowed && baselineTotal !== void 0 ? `${total} / ${baselineTotal}` : void 0;
|
|
2095
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1637
2096
|
CollapsibleList,
|
|
1638
2097
|
{
|
|
1639
2098
|
count: displayCount,
|
|
2099
|
+
countChipLabel,
|
|
1640
2100
|
headerRef: sectionHeaderRef,
|
|
1641
2101
|
isOpen,
|
|
1642
2102
|
onOpenChange: setIsOpen,
|
|
1643
2103
|
title: sectionTitle,
|
|
1644
|
-
trailingActions: /* @__PURE__ */
|
|
2104
|
+
trailingActions: isTrashFilter ? null : /* @__PURE__ */ React31.createElement(SectionAddButton, { onBeforeCreate: () => setIsOpen(true) })
|
|
1645
2105
|
},
|
|
1646
|
-
showNoResults && /* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
2106
|
+
showNoResults && /* @__PURE__ */ React31.createElement(Box9, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React31.createElement(Typography6, { variant: "body2", color: "text.secondary" }, __22("No results found", "elementor"))),
|
|
2107
|
+
/* @__PURE__ */ React31.createElement(Box9, { ref: listTopRef }),
|
|
1648
2108
|
displayedPosts.map((post) => {
|
|
1649
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ React31.createElement(PostListItem, { key: post.id, post });
|
|
1650
2110
|
}),
|
|
1651
|
-
["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */
|
|
1652
|
-
/* @__PURE__ */
|
|
2111
|
+
!isTrashFilter && ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */ React31.createElement(PostListItem, null),
|
|
2112
|
+
/* @__PURE__ */ React31.createElement(
|
|
1653
2113
|
PostListPaginationActions,
|
|
1654
2114
|
{
|
|
1655
2115
|
canLoadMore: pagination.canLoadMore,
|
|
@@ -1664,11 +2124,11 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
1664
2124
|
}
|
|
1665
2125
|
|
|
1666
2126
|
// src/components/panel/user-load-error.tsx
|
|
1667
|
-
import * as
|
|
1668
|
-
import { Box as
|
|
1669
|
-
import { __ as
|
|
2127
|
+
import * as React32 from "react";
|
|
2128
|
+
import { Box as Box10, Typography as Typography7 } from "@elementor/ui";
|
|
2129
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1670
2130
|
function UserLoadError() {
|
|
1671
|
-
return /* @__PURE__ */
|
|
2131
|
+
return /* @__PURE__ */ React32.createElement(Box10, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React32.createElement(Typography7, { variant: "body2", color: "text.secondary" }, __23(
|
|
1672
2132
|
"We couldn\u2019t load your content permissions. Try closing and reopening this panel.",
|
|
1673
2133
|
"elementor"
|
|
1674
2134
|
)));
|
|
@@ -1682,20 +2142,20 @@ function ShellPanelBodyContent({
|
|
|
1682
2142
|
showUserLoadError
|
|
1683
2143
|
}) {
|
|
1684
2144
|
if (isUserPending) {
|
|
1685
|
-
return /* @__PURE__ */
|
|
2145
|
+
return /* @__PURE__ */ React33.createElement(Stack6, { spacing: 1, sx: { px: 2, py: 1 } }, /* @__PURE__ */ React33.createElement(Skeleton2, { animation: "wave", height: 28, variant: "rounded", width: "100%" }), /* @__PURE__ */ React33.createElement(Skeleton2, { animation: "wave", height: 28, variant: "rounded", width: "80%" }));
|
|
1686
2146
|
}
|
|
1687
2147
|
if (showUserLoadError) {
|
|
1688
|
-
return /* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ React33.createElement(UserLoadError, null);
|
|
1689
2149
|
}
|
|
1690
|
-
return /* @__PURE__ */
|
|
2150
|
+
return /* @__PURE__ */ React33.createElement(List2, { dense: true, disablePadding: true, sx: { py: 0, width: "100%" } }, accessiblePostTypes.map((postTypeSlug, index) => /* @__PURE__ */ React33.createElement(PostListContextProvider, { key: postTypeSlug, type: postTypeSlug, setError: onListError }, /* @__PURE__ */ React33.createElement(PostsCollapsibleList, { isOpenByDefault: index === 0 }))));
|
|
1691
2151
|
}
|
|
1692
2152
|
|
|
1693
2153
|
// src/components/panel/shell.tsx
|
|
1694
2154
|
var Shell = () => {
|
|
1695
|
-
const [isErrorSnackbarOpen, setIsErrorSnackbarOpen] =
|
|
2155
|
+
const [isErrorSnackbarOpen, setIsErrorSnackbarOpen] = useState8(false);
|
|
1696
2156
|
const { accessiblePostTypes, isUserPending, showUserLoadError } = useAccessiblePanelPostTypes();
|
|
1697
|
-
return /* @__PURE__ */
|
|
1698
|
-
|
|
2157
|
+
return /* @__PURE__ */ React34.createElement(ContentPanelCoordinatorProvider, null, /* @__PURE__ */ React34.createElement(Panel, null, /* @__PURE__ */ React34.createElement(PanelHeader, null, /* @__PURE__ */ React34.createElement(
|
|
2158
|
+
Stack7,
|
|
1699
2159
|
{
|
|
1700
2160
|
alignItems: "center",
|
|
1701
2161
|
direction: "row",
|
|
@@ -1704,9 +2164,9 @@ var Shell = () => {
|
|
|
1704
2164
|
...contentPanelHeaderStackSx
|
|
1705
2165
|
}
|
|
1706
2166
|
},
|
|
1707
|
-
/* @__PURE__ */
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
)), /* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ React34.createElement(PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, __24("Site content", "elementor")),
|
|
2168
|
+
/* @__PURE__ */ React34.createElement(ContentPanelHeaderAdd, null)
|
|
2169
|
+
)), /* @__PURE__ */ React34.createElement(Divider6, null), /* @__PURE__ */ React34.createElement(PanelBody, null, /* @__PURE__ */ React34.createElement(ContentPanelToolbar, null), /* @__PURE__ */ React34.createElement(Divider6, null), /* @__PURE__ */ React34.createElement(
|
|
1710
2170
|
ShellPanelBodyContent,
|
|
1711
2171
|
{
|
|
1712
2172
|
accessiblePostTypes,
|
|
@@ -1714,7 +2174,7 @@ var Shell = () => {
|
|
|
1714
2174
|
onListError: () => setIsErrorSnackbarOpen(true),
|
|
1715
2175
|
showUserLoadError
|
|
1716
2176
|
}
|
|
1717
|
-
), /* @__PURE__ */
|
|
2177
|
+
), /* @__PURE__ */ React34.createElement(error_snackbar_default, { open: isErrorSnackbarOpen, onClose: () => setIsErrorSnackbarOpen(false) }))));
|
|
1718
2178
|
};
|
|
1719
2179
|
var shell_default = Shell;
|
|
1720
2180
|
|
|
@@ -1725,7 +2185,7 @@ var { panel, usePanelStatus, usePanelActions } = createPanel({
|
|
|
1725
2185
|
});
|
|
1726
2186
|
|
|
1727
2187
|
// src/components/top-bar/recently-edited.tsx
|
|
1728
|
-
import * as
|
|
2188
|
+
import * as React39 from "react";
|
|
1729
2189
|
import {
|
|
1730
2190
|
__useActiveDocument as useActiveDocument4,
|
|
1731
2191
|
__useHostDocument as useHostDocument
|
|
@@ -1734,30 +2194,30 @@ import { ChevronDownIcon } from "@elementor/icons";
|
|
|
1734
2194
|
import {
|
|
1735
2195
|
bindMenu as bindMenu3,
|
|
1736
2196
|
bindTrigger as bindTrigger3,
|
|
1737
|
-
Button as
|
|
1738
|
-
Divider as
|
|
2197
|
+
Button as Button4,
|
|
2198
|
+
Divider as Divider7,
|
|
1739
2199
|
ListItemText as ListItemText8,
|
|
1740
2200
|
ListSubheader,
|
|
1741
2201
|
Menu as Menu3,
|
|
1742
|
-
MenuItem as
|
|
1743
|
-
usePopupState as
|
|
2202
|
+
MenuItem as MenuItem6,
|
|
2203
|
+
usePopupState as usePopupState4
|
|
1744
2204
|
} from "@elementor/ui";
|
|
1745
|
-
import { __ as
|
|
2205
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
1746
2206
|
|
|
1747
2207
|
// src/components/top-bar/create-post-list-item.tsx
|
|
1748
|
-
import * as
|
|
2208
|
+
import * as React35 from "react";
|
|
1749
2209
|
import { __useNavigateToDocument as useNavigateToDocument4 } from "@elementor/editor-documents";
|
|
1750
2210
|
import { useMixpanel } from "@elementor/events";
|
|
1751
2211
|
import { PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1752
|
-
import { CircularProgress as
|
|
1753
|
-
import { __ as
|
|
2212
|
+
import { CircularProgress as CircularProgress6, ListItemIcon as ListItemIcon3, ListItemText as ListItemText6, MenuItem as MenuItem4 } from "@elementor/ui";
|
|
2213
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
1754
2214
|
|
|
1755
2215
|
// src/hooks/use-create-page.ts
|
|
1756
|
-
import { useState as
|
|
2216
|
+
import { useState as useState9 } from "react";
|
|
1757
2217
|
import apiFetch5 from "@wordpress/api-fetch";
|
|
1758
2218
|
var endpointPath = "/elementor/v1/site-navigation/add-new-post";
|
|
1759
2219
|
function useCreatePage() {
|
|
1760
|
-
const [isLoading, setIsLoading] =
|
|
2220
|
+
const [isLoading, setIsLoading] = useState9(false);
|
|
1761
2221
|
return {
|
|
1762
2222
|
create: () => {
|
|
1763
2223
|
setIsLoading(true);
|
|
@@ -1780,8 +2240,8 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
1780
2240
|
const navigateToDocument = useNavigateToDocument4();
|
|
1781
2241
|
const { data: user } = useUser();
|
|
1782
2242
|
const { dispatchEvent, config } = useMixpanel();
|
|
1783
|
-
return /* @__PURE__ */
|
|
1784
|
-
|
|
2243
|
+
return /* @__PURE__ */ React35.createElement(
|
|
2244
|
+
MenuItem4,
|
|
1785
2245
|
{
|
|
1786
2246
|
disabled: isLoading || !user?.capabilities?.edit_pages,
|
|
1787
2247
|
onClick: async () => {
|
|
@@ -1804,25 +2264,25 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
1804
2264
|
},
|
|
1805
2265
|
...props
|
|
1806
2266
|
},
|
|
1807
|
-
/* @__PURE__ */
|
|
1808
|
-
/* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ React35.createElement(ListItemIcon3, null, isLoading ? /* @__PURE__ */ React35.createElement(CircularProgress6, { size: "1.25rem" }) : /* @__PURE__ */ React35.createElement(PlusIcon2, { fontSize: "small" })),
|
|
2268
|
+
/* @__PURE__ */ React35.createElement(
|
|
1809
2269
|
ListItemText6,
|
|
1810
2270
|
{
|
|
1811
2271
|
primaryTypographyProps: { variant: "body2" },
|
|
1812
|
-
primary:
|
|
2272
|
+
primary: __25("Add new page", "elementor")
|
|
1813
2273
|
}
|
|
1814
2274
|
)
|
|
1815
2275
|
);
|
|
1816
2276
|
}
|
|
1817
2277
|
|
|
1818
2278
|
// src/components/top-bar/indicator.tsx
|
|
1819
|
-
import * as
|
|
1820
|
-
import { Stack as
|
|
2279
|
+
import * as React36 from "react";
|
|
2280
|
+
import { Stack as Stack8, Tooltip as BaseTooltip, Typography as Typography8 } from "@elementor/ui";
|
|
1821
2281
|
function Indicator({ title, status }) {
|
|
1822
|
-
return /* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ React36.createElement(Tooltip4, { title }, /* @__PURE__ */ React36.createElement(Stack8, { component: "span", direction: "row", alignItems: "center", spacing: 0.5 }, /* @__PURE__ */ React36.createElement(Typography8, { component: "span", variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React36.createElement(Typography8, { component: "span", variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
1823
2283
|
}
|
|
1824
|
-
function
|
|
1825
|
-
return /* @__PURE__ */
|
|
2284
|
+
function Tooltip4(props) {
|
|
2285
|
+
return /* @__PURE__ */ React36.createElement(
|
|
1826
2286
|
BaseTooltip,
|
|
1827
2287
|
{
|
|
1828
2288
|
PopperProps: {
|
|
@@ -1838,21 +2298,21 @@ function Tooltip2(props) {
|
|
|
1838
2298
|
}
|
|
1839
2299
|
|
|
1840
2300
|
// src/components/top-bar/post-list-item.tsx
|
|
1841
|
-
import * as
|
|
2301
|
+
import * as React38 from "react";
|
|
1842
2302
|
import { __useNavigateToDocument as useNavigateToDocument5 } from "@elementor/editor-documents";
|
|
1843
2303
|
import { useMixpanel as useMixpanel2 } from "@elementor/events";
|
|
1844
|
-
import { ListItemText as ListItemText7, MenuItem as
|
|
2304
|
+
import { ListItemText as ListItemText7, MenuItem as MenuItem5 } from "@elementor/ui";
|
|
1845
2305
|
|
|
1846
2306
|
// src/components/top-bar/chip-doc-type.tsx
|
|
1847
|
-
import * as
|
|
2307
|
+
import * as React37 from "react";
|
|
1848
2308
|
import { PostTypeIcon as PostTypeIcon3 } from "@elementor/icons";
|
|
1849
|
-
import { Chip as
|
|
2309
|
+
import { Chip as Chip4 } from "@elementor/ui";
|
|
1850
2310
|
var iconsMap2 = getIconsMap();
|
|
1851
2311
|
function DocTypeChip({ postType, docType, label }) {
|
|
1852
2312
|
const color = "elementor_library" === postType ? "global" : "accent";
|
|
1853
2313
|
const Icon = iconsMap2[docType] || PostTypeIcon3;
|
|
1854
|
-
return /* @__PURE__ */
|
|
1855
|
-
|
|
2314
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2315
|
+
Chip4,
|
|
1856
2316
|
{
|
|
1857
2317
|
component: "span",
|
|
1858
2318
|
size: "small",
|
|
@@ -1860,7 +2320,7 @@ function DocTypeChip({ postType, docType, label }) {
|
|
|
1860
2320
|
label,
|
|
1861
2321
|
"data-value": docType,
|
|
1862
2322
|
color,
|
|
1863
|
-
icon: /* @__PURE__ */
|
|
2323
|
+
icon: /* @__PURE__ */ React37.createElement(Icon, null),
|
|
1864
2324
|
sx: { ml: 1, cursor: "inherit" }
|
|
1865
2325
|
}
|
|
1866
2326
|
);
|
|
@@ -1871,8 +2331,8 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
1871
2331
|
const navigateToDocument = useNavigateToDocument5();
|
|
1872
2332
|
const postTitle = useReverseHtmlEntities(post.title);
|
|
1873
2333
|
const { dispatchEvent, config } = useMixpanel2();
|
|
1874
|
-
return /* @__PURE__ */
|
|
1875
|
-
|
|
2334
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2335
|
+
MenuItem5,
|
|
1876
2336
|
{
|
|
1877
2337
|
disabled: !post.user_can.edit,
|
|
1878
2338
|
onClick: async () => {
|
|
@@ -1894,7 +2354,7 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
1894
2354
|
},
|
|
1895
2355
|
...props
|
|
1896
2356
|
},
|
|
1897
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ React38.createElement(
|
|
1898
2358
|
ListItemText7,
|
|
1899
2359
|
{
|
|
1900
2360
|
sx: { flexGrow: 0 },
|
|
@@ -1902,7 +2362,7 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
1902
2362
|
primary: postTitle
|
|
1903
2363
|
}
|
|
1904
2364
|
),
|
|
1905
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ React38.createElement(DocTypeChip, { postType: post.type.post_type, docType: post.type.doc_type, label: post.type.label })
|
|
1906
2366
|
);
|
|
1907
2367
|
}
|
|
1908
2368
|
|
|
@@ -1919,7 +2379,7 @@ function RecentlyEdited() {
|
|
|
1919
2379
|
return data.filter((post) => post.id !== document2?.id).splice(0, NUMBER_OF_RECENT_POSTS - 1);
|
|
1920
2380
|
};
|
|
1921
2381
|
const recentPosts = getRecentPosts();
|
|
1922
|
-
const popupState =
|
|
2382
|
+
const popupState = usePopupState4({
|
|
1923
2383
|
variant: "popover",
|
|
1924
2384
|
popupId: "elementor-v2-top-bar-recently-edited"
|
|
1925
2385
|
});
|
|
@@ -1928,12 +2388,12 @@ function RecentlyEdited() {
|
|
|
1928
2388
|
return null;
|
|
1929
2389
|
}
|
|
1930
2390
|
const buttonProps = bindTrigger3(popupState);
|
|
1931
|
-
return /* @__PURE__ */
|
|
1932
|
-
|
|
2391
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(
|
|
2392
|
+
Button4,
|
|
1933
2393
|
{
|
|
1934
2394
|
color: "inherit",
|
|
1935
2395
|
size: "small",
|
|
1936
|
-
endIcon: /* @__PURE__ */
|
|
2396
|
+
endIcon: /* @__PURE__ */ React39.createElement(ChevronDownIcon, { fontSize: "small" }),
|
|
1937
2397
|
...buttonProps,
|
|
1938
2398
|
onClick: (e) => {
|
|
1939
2399
|
const extendedWindow = window;
|
|
@@ -1952,40 +2412,40 @@ function RecentlyEdited() {
|
|
|
1952
2412
|
buttonProps.onClick(e);
|
|
1953
2413
|
}
|
|
1954
2414
|
},
|
|
1955
|
-
/* @__PURE__ */
|
|
1956
|
-
), /* @__PURE__ */
|
|
2415
|
+
/* @__PURE__ */ React39.createElement(Indicator, { title: documentTitle, status: document2.status })
|
|
2416
|
+
), /* @__PURE__ */ React39.createElement(
|
|
1957
2417
|
Menu3,
|
|
1958
2418
|
{
|
|
1959
2419
|
MenuListProps: {
|
|
1960
|
-
subheader: /* @__PURE__ */
|
|
2420
|
+
subheader: /* @__PURE__ */ React39.createElement(ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, __26("Recent", "elementor"))
|
|
1961
2421
|
},
|
|
1962
2422
|
PaperProps: { sx: { mt: 2.5, width: 320 } },
|
|
1963
2423
|
...bindMenu3(popupState)
|
|
1964
2424
|
},
|
|
1965
|
-
recentPosts.map((post) => /* @__PURE__ */
|
|
1966
|
-
recentPosts.length === 0 && /* @__PURE__ */
|
|
2425
|
+
recentPosts.map((post) => /* @__PURE__ */ React39.createElement(PostListItem2, { key: post.id, post, closePopup: popupState.close })),
|
|
2426
|
+
recentPosts.length === 0 && /* @__PURE__ */ React39.createElement(MenuItem6, { disabled: true }, /* @__PURE__ */ React39.createElement(
|
|
1967
2427
|
ListItemText8,
|
|
1968
2428
|
{
|
|
1969
2429
|
primaryTypographyProps: {
|
|
1970
2430
|
variant: "caption",
|
|
1971
2431
|
fontStyle: "italic"
|
|
1972
2432
|
},
|
|
1973
|
-
primary:
|
|
2433
|
+
primary: __26("There are no other pages or templates on this site yet.", "elementor")
|
|
1974
2434
|
}
|
|
1975
2435
|
)),
|
|
1976
|
-
/* @__PURE__ */
|
|
1977
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ React39.createElement(Divider7, { disabled: recentPosts.length === 0 }),
|
|
2437
|
+
/* @__PURE__ */ React39.createElement(CreatePostListItem, { closePopup: popupState.close })
|
|
1978
2438
|
));
|
|
1979
2439
|
}
|
|
1980
2440
|
|
|
1981
2441
|
// src/hooks/use-toggle-button-props.ts
|
|
1982
2442
|
import { PagesIcon } from "@elementor/icons";
|
|
1983
|
-
import { __ as
|
|
2443
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
1984
2444
|
function useToggleButtonProps() {
|
|
1985
2445
|
const { isOpen: selectedState, isBlocked } = usePanelStatus();
|
|
1986
2446
|
const { open, close } = usePanelActions();
|
|
1987
2447
|
return {
|
|
1988
|
-
title:
|
|
2448
|
+
title: __27("Site content", "elementor"),
|
|
1989
2449
|
icon: PagesIcon,
|
|
1990
2450
|
onClick: () => {
|
|
1991
2451
|
const extendedWindow = window;
|