@elementor/editor-site-navigation 4.5.0-1221 → 4.5.0-1222
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 +492 -344
- package/dist/index.mjs +438 -290
- package/package.json +11 -11
- package/src/api/post.ts +6 -2
- package/src/components/panel/content-panel-active-filters.tsx +16 -3
- package/src/components/panel/content-panel-sort-list.tsx +39 -0
- package/src/components/panel/content-panel-sort.tsx +72 -0
- package/src/components/panel/content-panel-toolbar.tsx +2 -0
- package/src/components/panel/posts-list/posts-collapsible-list.tsx +9 -5
- package/src/contexts/content-panel-coordinator.tsx +27 -0
- package/src/hooks/use-posts.ts +22 -10
- package/src/site-content-sort.ts +39 -0
package/dist/index.mjs
CHANGED
|
@@ -30,19 +30,44 @@ import { isSidebarEnabled as isSidebarEnabled2, sidebarTools } from "@elementor/
|
|
|
30
30
|
import { createPanel } from "@elementor/editor-panels";
|
|
31
31
|
|
|
32
32
|
// src/components/panel/shell.tsx
|
|
33
|
-
import * as
|
|
33
|
+
import * as React36 from "react";
|
|
34
34
|
import { useState as useState8 } from "react";
|
|
35
35
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
36
36
|
import { isSidebarEnabled } from "@elementor/editor-sidebar";
|
|
37
|
-
import { Divider as
|
|
38
|
-
import { __ as
|
|
37
|
+
import { Divider as Divider7, Stack as Stack9 } from "@elementor/ui";
|
|
38
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
39
39
|
|
|
40
40
|
// src/contexts/content-panel-coordinator.tsx
|
|
41
41
|
import * as React from "react";
|
|
42
42
|
import { createContext, useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
43
43
|
|
|
44
|
-
// src/site-content-
|
|
44
|
+
// src/site-content-sort.ts
|
|
45
45
|
import { __ } from "@wordpress/i18n";
|
|
46
|
+
var SITE_CONTENT_SORT_OPTIONS = ["oldest", "newest"];
|
|
47
|
+
var DEFAULT_SITE_CONTENT_SORT = "oldest";
|
|
48
|
+
var SITE_CONTENT_SORT_POPOVER_WIDTH_PX = 280;
|
|
49
|
+
var sortLabels = {
|
|
50
|
+
oldest: __("Oldest", "elementor"),
|
|
51
|
+
newest: __("Newest", "elementor")
|
|
52
|
+
};
|
|
53
|
+
function getSiteContentSortLabel(sort) {
|
|
54
|
+
return sortLabels[sort];
|
|
55
|
+
}
|
|
56
|
+
function hasActiveSiteContentSort(sort) {
|
|
57
|
+
return sort !== DEFAULT_SITE_CONTENT_SORT;
|
|
58
|
+
}
|
|
59
|
+
function getRestOrderForSiteContentSort(sort) {
|
|
60
|
+
if (sort === "newest") {
|
|
61
|
+
return { order: "desc", orderby: "date" };
|
|
62
|
+
}
|
|
63
|
+
return { order: "asc", orderby: "date" };
|
|
64
|
+
}
|
|
65
|
+
function shouldPinHomepageForSiteContentSort(sort) {
|
|
66
|
+
return sort === DEFAULT_SITE_CONTENT_SORT;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/site-content-status-filter.ts
|
|
70
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
46
71
|
var SITE_CONTENT_SELECTABLE_STATUS_FILTERS = [
|
|
47
72
|
"publish",
|
|
48
73
|
"draft",
|
|
@@ -60,14 +85,14 @@ var EMPTY_SITE_CONTENT_STATUS_FILTERS = {
|
|
|
60
85
|
trash: false
|
|
61
86
|
};
|
|
62
87
|
var filterLabels = {
|
|
63
|
-
publish:
|
|
64
|
-
draft:
|
|
65
|
-
pending:
|
|
66
|
-
private:
|
|
67
|
-
future:
|
|
68
|
-
trash:
|
|
88
|
+
publish: __2("Published", "elementor"),
|
|
89
|
+
draft: __2("Drafts", "elementor"),
|
|
90
|
+
pending: __2("Pending", "elementor"),
|
|
91
|
+
private: __2("Private", "elementor"),
|
|
92
|
+
future: __2("Scheduled", "elementor"),
|
|
93
|
+
trash: __2("Trash", "elementor")
|
|
69
94
|
};
|
|
70
|
-
var SITE_CONTENT_ALL_FILTER_LABEL =
|
|
95
|
+
var SITE_CONTENT_ALL_FILTER_LABEL = __2("All", "elementor");
|
|
71
96
|
var SITE_CONTENT_FILTER_POPOVER_WIDTH_PX = 280;
|
|
72
97
|
function getSiteContentStatusFilterLabel(filter) {
|
|
73
98
|
return filterLabels[filter];
|
|
@@ -124,6 +149,7 @@ var ContentPanelCoordinatorContext = createContext(null);
|
|
|
124
149
|
function ContentPanelCoordinatorProvider({ children }) {
|
|
125
150
|
const sectionsRef = useRef(/* @__PURE__ */ new Map());
|
|
126
151
|
const [searchQuery, setSearchQuery] = useState("");
|
|
152
|
+
const [siteContentSort, setSiteContentSortState] = useState(DEFAULT_SITE_CONTENT_SORT);
|
|
127
153
|
const [statusFilters, setStatusFilters] = useState(
|
|
128
154
|
EMPTY_SITE_CONTENT_STATUS_FILTERS
|
|
129
155
|
);
|
|
@@ -141,28 +167,46 @@ function ContentPanelCoordinatorProvider({ children }) {
|
|
|
141
167
|
handlers.setExpanded(true);
|
|
142
168
|
handlers.startCreate();
|
|
143
169
|
}, []);
|
|
170
|
+
const clearActiveToolbarFilters = useCallback(() => {
|
|
171
|
+
setSiteContentSortState(DEFAULT_SITE_CONTENT_SORT);
|
|
172
|
+
setStatusFilters(EMPTY_SITE_CONTENT_STATUS_FILTERS);
|
|
173
|
+
}, []);
|
|
174
|
+
const clearSiteContentSort = useCallback(() => {
|
|
175
|
+
setSiteContentSortState(DEFAULT_SITE_CONTENT_SORT);
|
|
176
|
+
}, []);
|
|
144
177
|
const clearStatusFilters = useCallback(() => {
|
|
145
178
|
setStatusFilters(EMPTY_SITE_CONTENT_STATUS_FILTERS);
|
|
146
179
|
}, []);
|
|
180
|
+
const setSiteContentSort = useCallback((sort) => {
|
|
181
|
+
setSiteContentSortState(sort);
|
|
182
|
+
}, []);
|
|
147
183
|
const toggleStatusFilter = useCallback((filter) => {
|
|
148
184
|
setStatusFilters((current) => toggleSiteContentStatusFilter(current, filter));
|
|
149
185
|
}, []);
|
|
150
186
|
const value = useMemo(
|
|
151
187
|
() => ({
|
|
188
|
+
clearActiveToolbarFilters,
|
|
189
|
+
clearSiteContentSort,
|
|
152
190
|
clearStatusFilters,
|
|
153
191
|
registerSection,
|
|
154
192
|
requestCreate,
|
|
155
193
|
searchQuery,
|
|
156
194
|
setSearchQuery,
|
|
195
|
+
setSiteContentSort,
|
|
196
|
+
siteContentSort,
|
|
157
197
|
statusFilters,
|
|
158
198
|
toggleStatusFilter,
|
|
159
199
|
unregisterSection
|
|
160
200
|
}),
|
|
161
201
|
[
|
|
202
|
+
clearActiveToolbarFilters,
|
|
203
|
+
clearSiteContentSort,
|
|
162
204
|
clearStatusFilters,
|
|
163
205
|
registerSection,
|
|
164
206
|
requestCreate,
|
|
165
207
|
searchQuery,
|
|
208
|
+
siteContentSort,
|
|
209
|
+
setSiteContentSort,
|
|
166
210
|
statusFilters,
|
|
167
211
|
toggleStatusFilter,
|
|
168
212
|
unregisterSection
|
|
@@ -185,20 +229,20 @@ import { useMemo as useMemo2 } from "react";
|
|
|
185
229
|
|
|
186
230
|
// src/api/post.ts
|
|
187
231
|
import apiFetch from "@wordpress/api-fetch";
|
|
188
|
-
import { __ as
|
|
232
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
189
233
|
var postTypesMap = {
|
|
190
234
|
page: {
|
|
191
235
|
labels: {
|
|
192
|
-
singular_name:
|
|
193
|
-
plural_name:
|
|
236
|
+
singular_name: __3("Page", "elementor"),
|
|
237
|
+
plural_name: __3("Pages", "elementor")
|
|
194
238
|
},
|
|
195
239
|
rest_base: "pages",
|
|
196
240
|
createCapability: "edit_pages"
|
|
197
241
|
},
|
|
198
242
|
post: {
|
|
199
243
|
labels: {
|
|
200
|
-
singular_name:
|
|
201
|
-
plural_name:
|
|
244
|
+
singular_name: __3("Post", "elementor"),
|
|
245
|
+
plural_name: __3("Posts", "elementor")
|
|
202
246
|
},
|
|
203
247
|
rest_base: "posts",
|
|
204
248
|
createCapability: "edit_posts"
|
|
@@ -213,18 +257,20 @@ function getAccessiblePanelPostTypes(capabilities) {
|
|
|
213
257
|
}
|
|
214
258
|
function getCannotEditPanelItemMessage(postTypeSlug) {
|
|
215
259
|
if ("page" === postTypeSlug) {
|
|
216
|
-
return
|
|
260
|
+
return __3("You cannot edit this page.", "elementor");
|
|
217
261
|
}
|
|
218
|
-
return
|
|
262
|
+
return __3("You cannot edit this post.", "elementor");
|
|
219
263
|
}
|
|
220
264
|
var POST_PER_PAGE = 10;
|
|
221
265
|
var COUNT_QUERY_PER_PAGE = 1;
|
|
222
|
-
var getRequest = async (postTypeSlug, page, search = "", status = "any", perPage = POST_PER_PAGE) => {
|
|
266
|
+
var getRequest = async (postTypeSlug, page, search = "", status = "any", perPage = POST_PER_PAGE, sort = DEFAULT_SITE_CONTENT_SORT) => {
|
|
223
267
|
const baseUri = `/wp/v2/${postTypesMap[postTypeSlug].rest_base}`;
|
|
224
268
|
const keys = ["id", "type", "title", "link", "status", "user_can"];
|
|
269
|
+
const { order, orderby } = getRestOrderForSiteContentSort(sort);
|
|
225
270
|
const queryParams = new URLSearchParams({
|
|
226
271
|
status,
|
|
227
|
-
order
|
|
272
|
+
order,
|
|
273
|
+
orderby,
|
|
228
274
|
page: page.toString(),
|
|
229
275
|
per_page: perPage.toString(),
|
|
230
276
|
_fields: keys.join(",")
|
|
@@ -410,7 +456,7 @@ var contentPanelListItemButtonSx = {
|
|
|
410
456
|
import * as React3 from "react";
|
|
411
457
|
import { PageTypeIcon as PageTypeIcon2, PostTypeIcon as PostTypeIcon2 } from "@elementor/icons";
|
|
412
458
|
import { bindMenu, bindTrigger, ListItemIcon, ListItemText, Menu, MenuItem, usePopupState } from "@elementor/ui";
|
|
413
|
-
import { __ as
|
|
459
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
414
460
|
|
|
415
461
|
// src/hooks/use-can-create.ts
|
|
416
462
|
function useCanCreate(postTypeSlug) {
|
|
@@ -458,7 +504,7 @@ function ContentPanelHeaderAdd() {
|
|
|
458
504
|
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
459
505
|
ContentPanelAddIconButton,
|
|
460
506
|
{
|
|
461
|
-
"aria-label":
|
|
507
|
+
"aria-label": __4("Add new", "elementor"),
|
|
462
508
|
...buttonProps,
|
|
463
509
|
disabled: !canAddAny
|
|
464
510
|
}
|
|
@@ -466,13 +512,13 @@ function ContentPanelHeaderAdd() {
|
|
|
466
512
|
}
|
|
467
513
|
|
|
468
514
|
// src/components/panel/content-panel-toolbar.tsx
|
|
469
|
-
import * as
|
|
470
|
-
import { Box as Box3, Stack as
|
|
515
|
+
import * as React11 from "react";
|
|
516
|
+
import { Box as Box3, Stack as Stack4 } from "@elementor/ui";
|
|
471
517
|
|
|
472
518
|
// src/components/panel/content-panel-active-filters.tsx
|
|
473
519
|
import * as React5 from "react";
|
|
474
520
|
import { Chip, Stack } from "@elementor/ui";
|
|
475
|
-
import { __ as
|
|
521
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
476
522
|
|
|
477
523
|
// src/components/panel/content-panel-clear-filters-button.tsx
|
|
478
524
|
import * as React4 from "react";
|
|
@@ -493,12 +539,22 @@ var contentPanelFilterChipSx = {
|
|
|
493
539
|
}
|
|
494
540
|
};
|
|
495
541
|
function ContentPanelActiveFilters() {
|
|
496
|
-
const {
|
|
497
|
-
|
|
542
|
+
const { clearActiveToolbarFilters, setSiteContentSort, siteContentSort, statusFilters, toggleStatusFilter } = useContentPanelCoordinator();
|
|
543
|
+
const hasStatusFilters = hasActiveSiteContentStatusFilters(statusFilters);
|
|
544
|
+
const hasSort = hasActiveSiteContentSort(siteContentSort);
|
|
545
|
+
if (!hasStatusFilters && !hasSort) {
|
|
498
546
|
return null;
|
|
499
547
|
}
|
|
500
548
|
const activeKeys = getActiveSiteContentStatusFilterKeys(statusFilters);
|
|
501
|
-
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 },
|
|
549
|
+
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 }, hasSort && /* @__PURE__ */ React5.createElement(
|
|
550
|
+
Chip,
|
|
551
|
+
{
|
|
552
|
+
label: getSiteContentSortLabel(siteContentSort),
|
|
553
|
+
onDelete: () => setSiteContentSort(DEFAULT_SITE_CONTENT_SORT),
|
|
554
|
+
size: "tiny",
|
|
555
|
+
sx: contentPanelFilterChipSx
|
|
556
|
+
}
|
|
557
|
+
), activeKeys.map((key) => /* @__PURE__ */ React5.createElement(
|
|
502
558
|
Chip,
|
|
503
559
|
{
|
|
504
560
|
key,
|
|
@@ -510,10 +566,10 @@ function ContentPanelActiveFilters() {
|
|
|
510
566
|
))), /* @__PURE__ */ React5.createElement(
|
|
511
567
|
ContentPanelClearFiltersButton,
|
|
512
568
|
{
|
|
513
|
-
ariaLabel:
|
|
514
|
-
onClear:
|
|
569
|
+
ariaLabel: __5("Clear Filters", "elementor"),
|
|
570
|
+
onClear: clearActiveToolbarFilters,
|
|
515
571
|
sx: { margin: "0 0 auto auto" },
|
|
516
|
-
tooltipText:
|
|
572
|
+
tooltipText: __5("Clear Filters", "elementor")
|
|
517
573
|
}
|
|
518
574
|
));
|
|
519
575
|
}
|
|
@@ -522,19 +578,19 @@ function ContentPanelActiveFilters() {
|
|
|
522
578
|
import * as React6 from "react";
|
|
523
579
|
import { SearchIcon } from "@elementor/icons";
|
|
524
580
|
import { Box as Box2, InputAdornment, TextField } from "@elementor/ui";
|
|
525
|
-
import { __ as
|
|
581
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
526
582
|
function ContentPanelSearch() {
|
|
527
583
|
const { searchQuery, setSearchQuery } = useContentPanelCoordinator();
|
|
528
|
-
return /* @__PURE__ */ React6.createElement(Box2, { component: "search", "aria-label":
|
|
584
|
+
return /* @__PURE__ */ React6.createElement(Box2, { component: "search", "aria-label": __6("Search site content", "elementor") }, /* @__PURE__ */ React6.createElement(
|
|
529
585
|
TextField,
|
|
530
586
|
{
|
|
531
587
|
fullWidth: true,
|
|
532
588
|
size: "tiny",
|
|
533
589
|
value: searchQuery,
|
|
534
|
-
placeholder:
|
|
590
|
+
placeholder: __6("Search", "elementor"),
|
|
535
591
|
onChange: (event) => setSearchQuery(event.target.value),
|
|
536
592
|
inputProps: {
|
|
537
|
-
"aria-label":
|
|
593
|
+
"aria-label": __6("Search", "elementor")
|
|
538
594
|
},
|
|
539
595
|
InputProps: {
|
|
540
596
|
startAdornment: /* @__PURE__ */ React6.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React6.createElement(SearchIcon, { fontSize: "tiny" }))
|
|
@@ -543,17 +599,105 @@ function ContentPanelSearch() {
|
|
|
543
599
|
));
|
|
544
600
|
}
|
|
545
601
|
|
|
546
|
-
// src/components/panel/content-panel-
|
|
602
|
+
// src/components/panel/content-panel-sort.tsx
|
|
547
603
|
import * as React8 from "react";
|
|
548
604
|
import { PopoverBody, PopoverHeader } from "@elementor/editor-ui";
|
|
549
|
-
import {
|
|
605
|
+
import { ArrowsSortIcon } from "@elementor/icons";
|
|
550
606
|
import { bindPopover, bindToggle, Divider, Popover, ToggleButton, Tooltip as Tooltip2, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
551
|
-
import { __ as
|
|
607
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
552
608
|
|
|
553
|
-
// src/components/panel/content-panel-
|
|
609
|
+
// src/components/panel/content-panel-sort-list.tsx
|
|
554
610
|
import * as React7 from "react";
|
|
555
611
|
import { CheckIcon } from "@elementor/icons";
|
|
556
612
|
import { MenuItem as MenuItem2, MenuList, Stack as Stack2, Typography } from "@elementor/ui";
|
|
613
|
+
var renderSortMenuItemContent = (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);
|
|
614
|
+
function ContentPanelSortList() {
|
|
615
|
+
const { setSiteContentSort, siteContentSort } = useContentPanelCoordinator();
|
|
616
|
+
return /* @__PURE__ */ React7.createElement(MenuList, { dense: true }, SITE_CONTENT_SORT_OPTIONS.map((option) => {
|
|
617
|
+
const isSelected = siteContentSort === option;
|
|
618
|
+
return /* @__PURE__ */ React7.createElement(
|
|
619
|
+
MenuItem2,
|
|
620
|
+
{
|
|
621
|
+
key: option,
|
|
622
|
+
"aria-checked": isSelected,
|
|
623
|
+
onClick: () => setSiteContentSort(option),
|
|
624
|
+
role: "menuitemradio",
|
|
625
|
+
selected: isSelected
|
|
626
|
+
},
|
|
627
|
+
renderSortMenuItemContent(getSiteContentSortLabel(option), isSelected)
|
|
628
|
+
);
|
|
629
|
+
}));
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// src/components/panel/content-panel-sort.tsx
|
|
633
|
+
function ContentPanelSort() {
|
|
634
|
+
const { clearSiteContentSort, siteContentSort } = useContentPanelCoordinator();
|
|
635
|
+
const popupState = usePopupState2({
|
|
636
|
+
variant: "popover",
|
|
637
|
+
disableAutoFocus: true
|
|
638
|
+
});
|
|
639
|
+
const hasActiveSort = hasActiveSiteContentSort(siteContentSort);
|
|
640
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Tooltip2, { placement: "top", title: __7("Sort", "elementor") }, /* @__PURE__ */ React8.createElement(
|
|
641
|
+
ToggleButton,
|
|
642
|
+
{
|
|
643
|
+
"aria-label": __7("Sort", "elementor"),
|
|
644
|
+
selected: popupState.isOpen || hasActiveSort,
|
|
645
|
+
size: "tiny",
|
|
646
|
+
value: "sort",
|
|
647
|
+
...bindToggle(popupState)
|
|
648
|
+
},
|
|
649
|
+
/* @__PURE__ */ React8.createElement(ArrowsSortIcon, { fontSize: "tiny" })
|
|
650
|
+
)), /* @__PURE__ */ React8.createElement(
|
|
651
|
+
Popover,
|
|
652
|
+
{
|
|
653
|
+
anchorOrigin: {
|
|
654
|
+
horizontal: "right",
|
|
655
|
+
vertical: "top"
|
|
656
|
+
},
|
|
657
|
+
sx: {
|
|
658
|
+
maxWidth: `${SITE_CONTENT_SORT_POPOVER_WIDTH_PX}px`
|
|
659
|
+
},
|
|
660
|
+
transformOrigin: {
|
|
661
|
+
horizontal: -21,
|
|
662
|
+
vertical: "top"
|
|
663
|
+
},
|
|
664
|
+
...bindPopover(popupState)
|
|
665
|
+
},
|
|
666
|
+
/* @__PURE__ */ React8.createElement(
|
|
667
|
+
PopoverHeader,
|
|
668
|
+
{
|
|
669
|
+
actions: hasActiveSort ? [
|
|
670
|
+
/* @__PURE__ */ React8.createElement(
|
|
671
|
+
ContentPanelClearFiltersButton,
|
|
672
|
+
{
|
|
673
|
+
ariaLabel: __7("Clear sort", "elementor"),
|
|
674
|
+
key: "clear-sort",
|
|
675
|
+
onClear: clearSiteContentSort,
|
|
676
|
+
tooltipText: __7("Clear sort", "elementor")
|
|
677
|
+
}
|
|
678
|
+
)
|
|
679
|
+
] : [],
|
|
680
|
+
icon: /* @__PURE__ */ React8.createElement(ArrowsSortIcon, { fontSize: "tiny" }),
|
|
681
|
+
onClose: popupState.close,
|
|
682
|
+
title: __7("Sort", "elementor")
|
|
683
|
+
}
|
|
684
|
+
),
|
|
685
|
+
/* @__PURE__ */ React8.createElement(Divider, { sx: { borderWidth: "1px 0 0 0" } }),
|
|
686
|
+
/* @__PURE__ */ React8.createElement(PopoverBody, { height: "auto", width: SITE_CONTENT_SORT_POPOVER_WIDTH_PX }, /* @__PURE__ */ React8.createElement(ContentPanelSortList, null))
|
|
687
|
+
));
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// src/components/panel/content-panel-status-filter.tsx
|
|
691
|
+
import * as React10 from "react";
|
|
692
|
+
import { PopoverBody as PopoverBody2, PopoverHeader as PopoverHeader2 } from "@elementor/editor-ui";
|
|
693
|
+
import { FilterIcon } from "@elementor/icons";
|
|
694
|
+
import { bindPopover as bindPopover2, bindToggle as bindToggle2, Divider as Divider2, Popover as Popover2, ToggleButton as ToggleButton2, Tooltip as Tooltip3, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
695
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
696
|
+
|
|
697
|
+
// src/components/panel/content-panel-status-filter-list.tsx
|
|
698
|
+
import * as React9 from "react";
|
|
699
|
+
import { CheckIcon as CheckIcon2 } from "@elementor/icons";
|
|
700
|
+
import { MenuItem as MenuItem3, MenuList as MenuList2, Stack as Stack3, Typography as Typography2 } from "@elementor/ui";
|
|
557
701
|
|
|
558
702
|
// src/hooks/use-site-content-status-filter-counts.ts
|
|
559
703
|
import { useQuery as useQuery2 } from "@elementor/query";
|
|
@@ -595,7 +739,7 @@ function useSiteContentStatusFilterCounts(postTypes, enabled) {
|
|
|
595
739
|
}
|
|
596
740
|
|
|
597
741
|
// src/components/panel/content-panel-status-filter-list.tsx
|
|
598
|
-
var renderFilterMenuItemContent = (label, selected) => /* @__PURE__ */
|
|
742
|
+
var renderFilterMenuItemContent = (label, selected) => /* @__PURE__ */ React9.createElement(Stack3, { alignItems: "center", direction: "row", gap: 1, width: "100%" }, /* @__PURE__ */ React9.createElement(Typography2, { sx: { color: "text.secondary", flex: 1 }, variant: "caption" }, label), selected ? /* @__PURE__ */ React9.createElement(CheckIcon2, { "aria-hidden": true, fontSize: "tiny" }) : null);
|
|
599
743
|
function ContentPanelStatusFilterList({ loadCounts }) {
|
|
600
744
|
const { clearStatusFilters, statusFilters, toggleStatusFilter } = useContentPanelCoordinator();
|
|
601
745
|
const { accessiblePostTypes } = useAccessiblePanelPostTypes();
|
|
@@ -607,8 +751,8 @@ function ContentPanelStatusFilterList({ loadCounts }) {
|
|
|
607
751
|
const visibleFilters = SITE_CONTENT_SELECTABLE_STATUS_FILTERS.filter(
|
|
608
752
|
(filter) => shouldShowSiteContentStatusFilterRow(statusCounts?.[filter], isLoadingCounts, statusFilters[filter])
|
|
609
753
|
);
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
|
|
754
|
+
return /* @__PURE__ */ React9.createElement(MenuList2, { dense: true }, /* @__PURE__ */ React9.createElement(
|
|
755
|
+
MenuItem3,
|
|
612
756
|
{
|
|
613
757
|
"aria-checked": isAllSelected,
|
|
614
758
|
onClick: clearStatusFilters,
|
|
@@ -618,8 +762,8 @@ function ContentPanelStatusFilterList({ loadCounts }) {
|
|
|
618
762
|
renderFilterMenuItemContent(SITE_CONTENT_ALL_FILTER_LABEL, isAllSelected)
|
|
619
763
|
), visibleFilters.map((filter) => {
|
|
620
764
|
const isSelected = statusFilters[filter];
|
|
621
|
-
return /* @__PURE__ */
|
|
622
|
-
|
|
765
|
+
return /* @__PURE__ */ React9.createElement(
|
|
766
|
+
MenuItem3,
|
|
623
767
|
{
|
|
624
768
|
key: filter,
|
|
625
769
|
"aria-checked": isSelected,
|
|
@@ -635,23 +779,23 @@ function ContentPanelStatusFilterList({ loadCounts }) {
|
|
|
635
779
|
// src/components/panel/content-panel-status-filter.tsx
|
|
636
780
|
function ContentPanelStatusFilter() {
|
|
637
781
|
const { clearStatusFilters, statusFilters } = useContentPanelCoordinator();
|
|
638
|
-
const popupState =
|
|
782
|
+
const popupState = usePopupState3({
|
|
639
783
|
variant: "popover",
|
|
640
784
|
disableAutoFocus: true
|
|
641
785
|
});
|
|
642
786
|
const hasActiveFilters = hasActiveSiteContentStatusFilters(statusFilters);
|
|
643
|
-
return /* @__PURE__ */
|
|
644
|
-
|
|
787
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(Tooltip3, { placement: "top", title: __8("Filters", "elementor") }, /* @__PURE__ */ React10.createElement(
|
|
788
|
+
ToggleButton2,
|
|
645
789
|
{
|
|
646
|
-
"aria-label":
|
|
790
|
+
"aria-label": __8("Filters", "elementor"),
|
|
647
791
|
selected: popupState.isOpen || hasActiveFilters,
|
|
648
792
|
size: "tiny",
|
|
649
793
|
value: "filter",
|
|
650
|
-
...
|
|
794
|
+
...bindToggle2(popupState)
|
|
651
795
|
},
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
)), /* @__PURE__ */
|
|
654
|
-
|
|
796
|
+
/* @__PURE__ */ React10.createElement(FilterIcon, { fontSize: "tiny" })
|
|
797
|
+
)), /* @__PURE__ */ React10.createElement(
|
|
798
|
+
Popover2,
|
|
655
799
|
{
|
|
656
800
|
anchorOrigin: {
|
|
657
801
|
horizontal: "right",
|
|
@@ -664,42 +808,42 @@ function ContentPanelStatusFilter() {
|
|
|
664
808
|
horizontal: -21,
|
|
665
809
|
vertical: "top"
|
|
666
810
|
},
|
|
667
|
-
...
|
|
811
|
+
...bindPopover2(popupState)
|
|
668
812
|
},
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
|
|
813
|
+
/* @__PURE__ */ React10.createElement(
|
|
814
|
+
PopoverHeader2,
|
|
671
815
|
{
|
|
672
816
|
actions: hasActiveFilters ? [
|
|
673
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ React10.createElement(
|
|
674
818
|
ContentPanelClearFiltersButton,
|
|
675
819
|
{
|
|
676
|
-
ariaLabel:
|
|
820
|
+
ariaLabel: __8("Clear all", "elementor"),
|
|
677
821
|
key: "clear-all-filters",
|
|
678
822
|
onClear: clearStatusFilters,
|
|
679
|
-
tooltipText:
|
|
823
|
+
tooltipText: __8("Clear all", "elementor")
|
|
680
824
|
}
|
|
681
825
|
)
|
|
682
826
|
] : [],
|
|
683
|
-
icon: /* @__PURE__ */
|
|
827
|
+
icon: /* @__PURE__ */ React10.createElement(FilterIcon, { fontSize: "tiny" }),
|
|
684
828
|
onClose: popupState.close,
|
|
685
|
-
title:
|
|
829
|
+
title: __8("Filters", "elementor")
|
|
686
830
|
}
|
|
687
831
|
),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ React10.createElement(Divider2, { sx: { borderWidth: "1px 0 0 0" } }),
|
|
833
|
+
/* @__PURE__ */ React10.createElement(PopoverBody2, { height: "auto", width: SITE_CONTENT_FILTER_POPOVER_WIDTH_PX }, /* @__PURE__ */ React10.createElement(ContentPanelStatusFilterList, { loadCounts: popupState.isOpen }))
|
|
690
834
|
));
|
|
691
835
|
}
|
|
692
836
|
|
|
693
837
|
// src/components/panel/content-panel-toolbar.tsx
|
|
694
838
|
function ContentPanelToolbar() {
|
|
695
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ React11.createElement(Box3, { sx: contentPanelSearchBoxSx }, /* @__PURE__ */ React11.createElement(Stack4, { gap: 0.75, width: "100%" }, /* @__PURE__ */ React11.createElement(Stack4, { alignItems: "center", direction: "row", gap: 0.5, width: "100%" }, /* @__PURE__ */ React11.createElement(Box3, { sx: { flexGrow: 1, minWidth: 0 } }, /* @__PURE__ */ React11.createElement(ContentPanelSearch, null)), /* @__PURE__ */ React11.createElement(ContentPanelStatusFilter, null), /* @__PURE__ */ React11.createElement(ContentPanelSort, null)), /* @__PURE__ */ React11.createElement(ContentPanelActiveFilters, null)));
|
|
696
840
|
}
|
|
697
841
|
|
|
698
842
|
// src/components/panel/error-snackbar.tsx
|
|
699
|
-
import * as
|
|
700
|
-
import { Alert, Snackbar, Typography as
|
|
843
|
+
import * as React12 from "react";
|
|
844
|
+
import { Alert, Snackbar, Typography as Typography3 } from "@elementor/ui";
|
|
701
845
|
var ErrorSnackbar = ({ open, onClose }) => {
|
|
702
|
-
return /* @__PURE__ */
|
|
846
|
+
return /* @__PURE__ */ React12.createElement(
|
|
703
847
|
Snackbar,
|
|
704
848
|
{
|
|
705
849
|
open,
|
|
@@ -709,8 +853,8 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
709
853
|
horizontal: "left"
|
|
710
854
|
}
|
|
711
855
|
},
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
|
|
856
|
+
/* @__PURE__ */ React12.createElement(Alert, { onClose, severity: "error", sx: { width: "100%" } }, /* @__PURE__ */ React12.createElement(
|
|
857
|
+
Typography3,
|
|
714
858
|
{
|
|
715
859
|
component: "span",
|
|
716
860
|
sx: {
|
|
@@ -724,11 +868,11 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
724
868
|
var error_snackbar_default = ErrorSnackbar;
|
|
725
869
|
|
|
726
870
|
// src/components/panel/shell-panel-body-content.tsx
|
|
727
|
-
import * as
|
|
728
|
-
import { List as List2, Skeleton as Skeleton2, Stack as
|
|
871
|
+
import * as React35 from "react";
|
|
872
|
+
import { List as List2, Skeleton as Skeleton2, Stack as Stack8 } from "@elementor/ui";
|
|
729
873
|
|
|
730
874
|
// src/contexts/post-list-context.tsx
|
|
731
|
-
import * as
|
|
875
|
+
import * as React13 from "react";
|
|
732
876
|
import { createContext as createContext2, useContext as useContext2, useState as useState2 } from "react";
|
|
733
877
|
var defaultValues = {
|
|
734
878
|
type: "page",
|
|
@@ -747,7 +891,7 @@ var PostListContextProvider = ({
|
|
|
747
891
|
const resetEditMode = () => {
|
|
748
892
|
setEditMode(defaultValues.editMode);
|
|
749
893
|
};
|
|
750
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ React13.createElement(
|
|
751
895
|
PostListContext.Provider,
|
|
752
896
|
{
|
|
753
897
|
value: {
|
|
@@ -770,10 +914,10 @@ function usePostListContext() {
|
|
|
770
914
|
}
|
|
771
915
|
|
|
772
916
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
773
|
-
import * as
|
|
917
|
+
import * as React33 from "react";
|
|
774
918
|
import { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef4, useState as useState7 } from "react";
|
|
775
|
-
import { Box as Box9, Skeleton, Typography as
|
|
776
|
-
import { __ as
|
|
919
|
+
import { Box as Box9, Skeleton, Typography as Typography7 } from "@elementor/ui";
|
|
920
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
777
921
|
|
|
778
922
|
// src/hooks/use-homepage.ts
|
|
779
923
|
import { useQuery as useQuery3 } from "@elementor/query";
|
|
@@ -869,27 +1013,30 @@ function usePostListPagination({
|
|
|
869
1013
|
// src/hooks/use-posts.ts
|
|
870
1014
|
import { keepPreviousData, useInfiniteQuery } from "@elementor/query";
|
|
871
1015
|
var postsQueryKeyBase = (postTypeSlug) => ["site-navigation", "posts", postTypeSlug];
|
|
872
|
-
var postsQueryKey = (postTypeSlug, trimmedSearch = "", restStatus = "any") => [
|
|
873
|
-
...postsQueryKeyBase(postTypeSlug),
|
|
874
|
-
restStatus,
|
|
875
|
-
trimmedSearch
|
|
876
|
-
];
|
|
1016
|
+
var postsQueryKey = (postTypeSlug, trimmedSearch = "", restStatus = "any", sort = DEFAULT_SITE_CONTENT_SORT) => [...postsQueryKeyBase(postTypeSlug), restStatus, trimmedSearch, sort];
|
|
877
1017
|
var flattenData = (data) => {
|
|
878
1018
|
if (!data) {
|
|
879
1019
|
return data;
|
|
880
1020
|
}
|
|
881
1021
|
const flattened = [];
|
|
1022
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
882
1023
|
data.pages.forEach((page) => {
|
|
883
|
-
|
|
1024
|
+
page.data.forEach((post) => {
|
|
1025
|
+
if (seenIds.has(post.id)) {
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
seenIds.add(post.id);
|
|
1029
|
+
flattened.push(post);
|
|
1030
|
+
});
|
|
884
1031
|
});
|
|
885
1032
|
return flattened;
|
|
886
1033
|
};
|
|
887
|
-
function usePosts(postTypeSlug, search = "", statusFilters = EMPTY_SITE_CONTENT_STATUS_FILTERS) {
|
|
1034
|
+
function usePosts(postTypeSlug, search = "", statusFilters = EMPTY_SITE_CONTENT_STATUS_FILTERS, sort = DEFAULT_SITE_CONTENT_SORT) {
|
|
888
1035
|
const trimmedSearch = search.trim();
|
|
889
1036
|
const restStatus = getRestStatusForSiteContentFilters(statusFilters);
|
|
890
1037
|
const query = useInfiniteQuery({
|
|
891
|
-
queryKey: postsQueryKey(postTypeSlug, trimmedSearch, restStatus),
|
|
892
|
-
queryFn: ({ pageParam = 1 }) => getRequest(postTypeSlug, pageParam, trimmedSearch, restStatus),
|
|
1038
|
+
queryKey: postsQueryKey(postTypeSlug, trimmedSearch, restStatus, sort),
|
|
1039
|
+
queryFn: ({ pageParam = 1 }) => getRequest(postTypeSlug, pageParam, trimmedSearch, restStatus, POST_PER_PAGE, sort),
|
|
893
1040
|
initialPageParam: 1,
|
|
894
1041
|
getNextPageParam: (lastPage) => {
|
|
895
1042
|
return lastPage.currentPage < lastPage.totalPages ? lastPage.currentPage + 1 : void 0;
|
|
@@ -919,18 +1066,18 @@ function usePostsBaselineTotal(postTypeSlug, enabled, status = "any") {
|
|
|
919
1066
|
}
|
|
920
1067
|
|
|
921
1068
|
// src/components/panel/section-add-button.tsx
|
|
922
|
-
import * as
|
|
923
|
-
import { __ as
|
|
1069
|
+
import * as React14 from "react";
|
|
1070
|
+
import { __ as __9, sprintf } from "@wordpress/i18n";
|
|
924
1071
|
function SectionAddButton({ onBeforeCreate }) {
|
|
925
1072
|
const { type, setEditMode } = usePostListContext();
|
|
926
1073
|
const canCreate = useCanCreate(type);
|
|
927
1074
|
const singularName = postTypesMap[type].labels.singular_name;
|
|
928
1075
|
const ariaLabel = sprintf(
|
|
929
1076
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
930
|
-
|
|
1077
|
+
__9("New %s", "elementor"),
|
|
931
1078
|
singularName
|
|
932
1079
|
);
|
|
933
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ React14.createElement(
|
|
934
1081
|
ContentPanelAddIconButton,
|
|
935
1082
|
{
|
|
936
1083
|
"aria-label": ariaLabel,
|
|
@@ -945,10 +1092,10 @@ function SectionAddButton({ onBeforeCreate }) {
|
|
|
945
1092
|
}
|
|
946
1093
|
|
|
947
1094
|
// src/components/panel/posts-list/collapsible-list.tsx
|
|
948
|
-
import * as
|
|
1095
|
+
import * as React15 from "react";
|
|
949
1096
|
import { useId } from "react";
|
|
950
1097
|
import { CollapseIcon } from "@elementor/editor-ui";
|
|
951
|
-
import { Box as Box4, Chip as Chip2, Collapse, Divider as
|
|
1098
|
+
import { Box as Box4, Chip as Chip2, Collapse, Divider as Divider3, List, ListItemButton, ListItemText as ListItemText2, Stack as Stack5 } from "@elementor/ui";
|
|
952
1099
|
var sectionHeaderListItemButtonSx = {
|
|
953
1100
|
flexGrow: 1,
|
|
954
1101
|
justifyContent: "flex-start",
|
|
@@ -977,7 +1124,7 @@ function CollapsibleList({
|
|
|
977
1124
|
const chipLabel = countChipLabel ?? count.toString();
|
|
978
1125
|
const sectionHeaderAriaLabel = getSectionHeaderAriaLabel(title, chipLabel);
|
|
979
1126
|
const handleClick = () => onOpenChange(!isOpen);
|
|
980
|
-
return /* @__PURE__ */
|
|
1127
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
981
1128
|
Box4,
|
|
982
1129
|
{
|
|
983
1130
|
sx: {
|
|
@@ -988,7 +1135,7 @@ function CollapsibleList({
|
|
|
988
1135
|
width: "100%"
|
|
989
1136
|
}
|
|
990
1137
|
},
|
|
991
|
-
/* @__PURE__ */
|
|
1138
|
+
/* @__PURE__ */ React15.createElement(
|
|
992
1139
|
ListItemButton,
|
|
993
1140
|
{
|
|
994
1141
|
ref: headerRef,
|
|
@@ -1002,7 +1149,7 @@ function CollapsibleList({
|
|
|
1002
1149
|
onClick: handleClick,
|
|
1003
1150
|
sx: sectionHeaderListItemButtonSx
|
|
1004
1151
|
},
|
|
1005
|
-
/* @__PURE__ */
|
|
1152
|
+
/* @__PURE__ */ React15.createElement(Stack5, { alignItems: "center", direction: "row", flexGrow: 1, gap: 0.5, minWidth: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Stack5, { alignItems: "center", direction: "row", flex: 1, gap: 0.5, minWidth: 0 }, /* @__PURE__ */ React15.createElement(
|
|
1006
1153
|
ListItemText2,
|
|
1007
1154
|
{
|
|
1008
1155
|
secondary: title,
|
|
@@ -1013,10 +1160,10 @@ function CollapsibleList({
|
|
|
1013
1160
|
},
|
|
1014
1161
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
1015
1162
|
}
|
|
1016
|
-
), /* @__PURE__ */
|
|
1163
|
+
), /* @__PURE__ */ React15.createElement(Chip2, { label: chipLabel, size: "tiny" })), /* @__PURE__ */ React15.createElement(CollapseIcon, { color: "secondary", fontSize: "tiny", open: isOpen, sx: { flexShrink: 0 } }))
|
|
1017
1164
|
),
|
|
1018
|
-
trailingActions && /* @__PURE__ */
|
|
1019
|
-
|
|
1165
|
+
trailingActions && /* @__PURE__ */ React15.createElement(
|
|
1166
|
+
Stack5,
|
|
1020
1167
|
{
|
|
1021
1168
|
alignItems: "center",
|
|
1022
1169
|
direction: "row",
|
|
@@ -1026,16 +1173,16 @@ function CollapsibleList({
|
|
|
1026
1173
|
},
|
|
1027
1174
|
trailingActions
|
|
1028
1175
|
)
|
|
1029
|
-
), /* @__PURE__ */
|
|
1176
|
+
), /* @__PURE__ */ React15.createElement(Collapse, { "aria-labelledby": labelId, id: contentId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React15.createElement(List, { dense: true, disablePadding: true, sx: contentPanelListSectionListSx }, children)), /* @__PURE__ */ React15.createElement(Divider3, null));
|
|
1030
1177
|
}
|
|
1031
1178
|
|
|
1032
1179
|
// src/components/panel/posts-list/error-state.tsx
|
|
1033
|
-
import * as
|
|
1180
|
+
import * as React16 from "react";
|
|
1034
1181
|
import { Error404TemplateIcon } from "@elementor/icons";
|
|
1035
|
-
import { Box as Box5, Link, Typography as
|
|
1036
|
-
import { __ as
|
|
1182
|
+
import { Box as Box5, Link, Typography as Typography4 } from "@elementor/ui";
|
|
1183
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
1037
1184
|
function ErrorState() {
|
|
1038
|
-
return /* @__PURE__ */
|
|
1185
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1039
1186
|
Box5,
|
|
1040
1187
|
{
|
|
1041
1188
|
sx: {
|
|
@@ -1047,8 +1194,8 @@ function ErrorState() {
|
|
|
1047
1194
|
gap: "16px"
|
|
1048
1195
|
}
|
|
1049
1196
|
},
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1197
|
+
/* @__PURE__ */ React16.createElement(Error404TemplateIcon, null),
|
|
1198
|
+
/* @__PURE__ */ React16.createElement(
|
|
1052
1199
|
Box5,
|
|
1053
1200
|
{
|
|
1054
1201
|
sx: {
|
|
@@ -1059,19 +1206,19 @@ function ErrorState() {
|
|
|
1059
1206
|
gap: "8px"
|
|
1060
1207
|
}
|
|
1061
1208
|
},
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ React16.createElement(Typography4, { variant: "body1", color: "text.primary" }, __10("We couldn\u2019t display your pages.", "elementor")),
|
|
1210
|
+
/* @__PURE__ */ React16.createElement(Box5, null, /* @__PURE__ */ React16.createElement(Typography4, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __10("It\u2019s probably a temporary issue.", "elementor")), /* @__PURE__ */ React16.createElement(Typography4, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __10("If the problem persists,", "elementor"), " ", /* @__PURE__ */ React16.createElement(Link, { target: "_blank", href: "https://go.elementor.com/wp-editor-support-open-ticket/" }, "Notify support")))
|
|
1064
1211
|
)
|
|
1065
1212
|
);
|
|
1066
1213
|
}
|
|
1067
1214
|
|
|
1068
1215
|
// src/components/panel/posts-list/post-list-item.tsx
|
|
1069
|
-
import * as
|
|
1216
|
+
import * as React31 from "react";
|
|
1070
1217
|
|
|
1071
1218
|
// src/components/panel/posts-list/list-items/list-item-create.tsx
|
|
1072
|
-
import * as
|
|
1219
|
+
import * as React18 from "react";
|
|
1073
1220
|
import { __useNavigateToDocument as useNavigateToDocument } from "@elementor/editor-documents";
|
|
1074
|
-
import { __ as
|
|
1221
|
+
import { __ as __12, sprintf as sprintf2 } from "@wordpress/i18n";
|
|
1075
1222
|
|
|
1076
1223
|
// src/hooks/use-posts-actions.ts
|
|
1077
1224
|
import { useMutation, useQueryClient } from "@elementor/query";
|
|
@@ -1152,11 +1299,11 @@ function useInvalidatePosts(postTypeSlug) {
|
|
|
1152
1299
|
}
|
|
1153
1300
|
|
|
1154
1301
|
// src/components/panel/posts-list/list-items/edit-mode-template.tsx
|
|
1155
|
-
import * as
|
|
1302
|
+
import * as React17 from "react";
|
|
1156
1303
|
import { useRef as useRef3, useState as useState4 } from "react";
|
|
1157
1304
|
import { XIcon } from "@elementor/icons";
|
|
1158
1305
|
import { Box as Box6, CircularProgress, IconButton as IconButton3, ListItem, ListItemText as ListItemText3 } from "@elementor/ui";
|
|
1159
|
-
import { __ as
|
|
1306
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1160
1307
|
var EDIT_ROW_FOCUS_BORDER_WIDTH_PX = 2;
|
|
1161
1308
|
var EDIT_ROW_MIN_HEIGHT_PX = 36;
|
|
1162
1309
|
var editModeListItemButtonSx = {
|
|
@@ -1228,32 +1375,32 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
1228
1375
|
}
|
|
1229
1376
|
const value = e.target.value;
|
|
1230
1377
|
if (!validateInput(value)) {
|
|
1231
|
-
setInputError(
|
|
1378
|
+
setInputError(__11("Name is required", "elementor"));
|
|
1232
1379
|
} else {
|
|
1233
1380
|
setInputError(null);
|
|
1234
1381
|
}
|
|
1235
1382
|
setTitle(value);
|
|
1236
1383
|
};
|
|
1237
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
1238
1385
|
ListItem,
|
|
1239
1386
|
{
|
|
1240
1387
|
disablePadding: true,
|
|
1241
1388
|
sx: contentPanelListRowPaddingSx,
|
|
1242
|
-
secondaryAction: /* @__PURE__ */
|
|
1389
|
+
secondaryAction: /* @__PURE__ */ React17.createElement(CloseButton, { isLoading, closeButton })
|
|
1243
1390
|
},
|
|
1244
|
-
/* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ React17.createElement(
|
|
1245
1392
|
Box6,
|
|
1246
1393
|
{
|
|
1247
1394
|
component: "form",
|
|
1248
1395
|
onSubmit: onFormSubmit,
|
|
1249
1396
|
sx: { ...editModeListItemButtonSx, display: "flex", width: "100%" }
|
|
1250
1397
|
},
|
|
1251
|
-
/* @__PURE__ */
|
|
1398
|
+
/* @__PURE__ */ React17.createElement(Box6, { sx: editRowIndicatorSx(!!inputError) }, /* @__PURE__ */ React17.createElement(
|
|
1252
1399
|
Box6,
|
|
1253
1400
|
{
|
|
1254
1401
|
autoFocus: true,
|
|
1255
1402
|
"aria-invalid": !!inputError,
|
|
1256
|
-
"aria-label":
|
|
1403
|
+
"aria-label": __11("Name", "elementor"),
|
|
1257
1404
|
component: "input",
|
|
1258
1405
|
disabled: isLoading,
|
|
1259
1406
|
onBlur,
|
|
@@ -1264,11 +1411,11 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
1264
1411
|
}
|
|
1265
1412
|
))
|
|
1266
1413
|
)
|
|
1267
|
-
), inputError && /* @__PURE__ */
|
|
1414
|
+
), inputError && /* @__PURE__ */ React17.createElement(ListItem, { disablePadding: true, sx: contentPanelListRowPaddingSx }, /* @__PURE__ */ React17.createElement(ListItemText3, { sx: { color: "error.main", ...contentPanelListRowTitleSx } }, inputError)));
|
|
1268
1415
|
}
|
|
1269
1416
|
function CloseButton({ isLoading, closeButton }) {
|
|
1270
1417
|
const { resetEditMode } = usePostListContext();
|
|
1271
|
-
return /* @__PURE__ */
|
|
1418
|
+
return /* @__PURE__ */ React17.createElement(IconButton3, { size: "tiny", color: "secondary", onClick: resetEditMode, ref: closeButton, disabled: isLoading }, isLoading ? /* @__PURE__ */ React17.createElement(CircularProgress, { size: "1rem" }) : /* @__PURE__ */ React17.createElement(XIcon, { fontSize: "tiny" }));
|
|
1272
1419
|
}
|
|
1273
1420
|
|
|
1274
1421
|
// src/components/panel/posts-list/list-items/list-item-create.tsx
|
|
@@ -1292,10 +1439,10 @@ function ListItemCreate() {
|
|
|
1292
1439
|
};
|
|
1293
1440
|
const newItemLabel = sprintf2(
|
|
1294
1441
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
1295
|
-
|
|
1442
|
+
__12("New %s", "elementor"),
|
|
1296
1443
|
postTypesMap[type].labels.singular_name
|
|
1297
1444
|
);
|
|
1298
|
-
return /* @__PURE__ */
|
|
1445
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1299
1446
|
EditModeTemplate,
|
|
1300
1447
|
{
|
|
1301
1448
|
postTitle: newItemLabel,
|
|
@@ -1306,9 +1453,9 @@ function ListItemCreate() {
|
|
|
1306
1453
|
}
|
|
1307
1454
|
|
|
1308
1455
|
// src/components/panel/posts-list/list-items/list-item-duplicate.tsx
|
|
1309
|
-
import * as
|
|
1456
|
+
import * as React19 from "react";
|
|
1310
1457
|
import { __useNavigateToDocument as useNavigateToDocument2 } from "@elementor/editor-documents";
|
|
1311
|
-
import { __ as
|
|
1458
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1312
1459
|
function ListItemDuplicate() {
|
|
1313
1460
|
const { type, editMode, resetEditMode } = usePostListContext();
|
|
1314
1461
|
const navigateToDocument = useNavigateToDocument2();
|
|
@@ -1330,10 +1477,10 @@ function ListItemDuplicate() {
|
|
|
1330
1477
|
resetEditMode();
|
|
1331
1478
|
}
|
|
1332
1479
|
};
|
|
1333
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1334
1481
|
EditModeTemplate,
|
|
1335
1482
|
{
|
|
1336
|
-
postTitle: `${editMode.details.title} ${
|
|
1483
|
+
postTitle: `${editMode.details.title} ${__13("copy", "elementor")}`,
|
|
1337
1484
|
isLoading: duplicatePost.isPending,
|
|
1338
1485
|
callback: duplicatePostCallback
|
|
1339
1486
|
}
|
|
@@ -1341,7 +1488,7 @@ function ListItemDuplicate() {
|
|
|
1341
1488
|
}
|
|
1342
1489
|
|
|
1343
1490
|
// src/components/panel/posts-list/list-items/list-item-rename.tsx
|
|
1344
|
-
import * as
|
|
1491
|
+
import * as React20 from "react";
|
|
1345
1492
|
import { __useActiveDocument as useActiveDocument } from "@elementor/editor-documents";
|
|
1346
1493
|
|
|
1347
1494
|
// src/hooks/use-rename-active-document.ts
|
|
@@ -1392,11 +1539,11 @@ function ListItemRename({ post }) {
|
|
|
1392
1539
|
resetEditMode();
|
|
1393
1540
|
}
|
|
1394
1541
|
};
|
|
1395
|
-
return /* @__PURE__ */
|
|
1542
|
+
return /* @__PURE__ */ React20.createElement(EditModeTemplate, { postTitle: title, isLoading: updatePost.isPending, callback: renamePostCallback });
|
|
1396
1543
|
}
|
|
1397
1544
|
|
|
1398
1545
|
// src/components/panel/posts-list/list-items/list-item-view.tsx
|
|
1399
|
-
import * as
|
|
1546
|
+
import * as React30 from "react";
|
|
1400
1547
|
import {
|
|
1401
1548
|
__useActiveDocument as useActiveDocument3,
|
|
1402
1549
|
__useNavigateToDocument as useNavigateToDocument3
|
|
@@ -1405,23 +1552,23 @@ import { DotsVerticalIcon, HomeIcon as HomeIcon2 } from "@elementor/icons";
|
|
|
1405
1552
|
import {
|
|
1406
1553
|
bindMenu as bindMenu2,
|
|
1407
1554
|
bindTrigger as bindTrigger2,
|
|
1408
|
-
Divider as
|
|
1555
|
+
Divider as Divider6,
|
|
1409
1556
|
IconButton as IconButton4,
|
|
1410
1557
|
ListItem as ListItem2,
|
|
1411
1558
|
ListItemButton as ListItemButton2,
|
|
1412
1559
|
ListItemText as ListItemText5,
|
|
1413
1560
|
Menu as Menu2,
|
|
1414
|
-
Stack as
|
|
1415
|
-
Tooltip as
|
|
1416
|
-
Typography as
|
|
1417
|
-
usePopupState as
|
|
1561
|
+
Stack as Stack6,
|
|
1562
|
+
Tooltip as Tooltip4,
|
|
1563
|
+
Typography as Typography6,
|
|
1564
|
+
usePopupState as usePopupState4
|
|
1418
1565
|
} from "@elementor/ui";
|
|
1419
|
-
import { __ as
|
|
1566
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1420
1567
|
|
|
1421
1568
|
// src/components/shared/page-title-and-status.tsx
|
|
1422
|
-
import * as
|
|
1423
|
-
import { Box as Box7, Chip as Chip3, Typography as
|
|
1424
|
-
import { __ as
|
|
1569
|
+
import * as React21 from "react";
|
|
1570
|
+
import { Box as Box7, Chip as Chip3, Typography as Typography5 } from "@elementor/ui";
|
|
1571
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1425
1572
|
|
|
1426
1573
|
// src/hooks/use-reverse-html-entities.ts
|
|
1427
1574
|
import { useMemo as useMemo3 } from "react";
|
|
@@ -1448,19 +1595,19 @@ function humanizeStatusSlug(status) {
|
|
|
1448
1595
|
var statusChipConfig = {
|
|
1449
1596
|
draft: {
|
|
1450
1597
|
color: "default",
|
|
1451
|
-
label:
|
|
1598
|
+
label: __14("Draft", "elementor")
|
|
1452
1599
|
},
|
|
1453
1600
|
future: {
|
|
1454
1601
|
color: "default",
|
|
1455
|
-
label:
|
|
1602
|
+
label: __14("Scheduled", "elementor")
|
|
1456
1603
|
},
|
|
1457
1604
|
pending: {
|
|
1458
1605
|
color: "warning",
|
|
1459
|
-
label:
|
|
1606
|
+
label: __14("Pending Review", "elementor")
|
|
1460
1607
|
},
|
|
1461
1608
|
private: {
|
|
1462
1609
|
color: "default",
|
|
1463
|
-
label:
|
|
1610
|
+
label: __14("Private", "elementor")
|
|
1464
1611
|
}
|
|
1465
1612
|
};
|
|
1466
1613
|
function getStatusChipConfig(status) {
|
|
@@ -1482,7 +1629,7 @@ var PageStatus = ({ status }) => {
|
|
|
1482
1629
|
}
|
|
1483
1630
|
const { color, label } = getStatusChipConfig(status);
|
|
1484
1631
|
const isKnownStatus = isKnownPanelStatus(status);
|
|
1485
|
-
return /* @__PURE__ */
|
|
1632
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1486
1633
|
Chip3,
|
|
1487
1634
|
{
|
|
1488
1635
|
color,
|
|
@@ -1507,8 +1654,8 @@ var PageStatus = ({ status }) => {
|
|
|
1507
1654
|
};
|
|
1508
1655
|
var PageTitle = ({ title }) => {
|
|
1509
1656
|
const modifiedTitle = useReverseHtmlEntities(title);
|
|
1510
|
-
return /* @__PURE__ */
|
|
1511
|
-
|
|
1657
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1658
|
+
Typography5,
|
|
1512
1659
|
{
|
|
1513
1660
|
component: "span",
|
|
1514
1661
|
variant: "body2",
|
|
@@ -1525,11 +1672,11 @@ var PageTitle = ({ title }) => {
|
|
|
1525
1672
|
);
|
|
1526
1673
|
};
|
|
1527
1674
|
function PageTitleAndStatus({ title, status }) {
|
|
1528
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ React21.createElement(Box7, { alignItems: "center", display: "flex", minWidth: 0 }, /* @__PURE__ */ React21.createElement(PageTitle, { title }), /* @__PURE__ */ React21.createElement(PageStatus, { status }));
|
|
1529
1676
|
}
|
|
1530
1677
|
|
|
1531
1678
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
1532
|
-
import * as
|
|
1679
|
+
import * as React23 from "react";
|
|
1533
1680
|
import { useState as useState5 } from "react";
|
|
1534
1681
|
import { __useActiveDocument as useActiveDocument2 } from "@elementor/editor-documents";
|
|
1535
1682
|
import { TrashIcon } from "@elementor/icons";
|
|
@@ -1541,23 +1688,23 @@ import {
|
|
|
1541
1688
|
DialogContent,
|
|
1542
1689
|
DialogContentText,
|
|
1543
1690
|
DialogTitle,
|
|
1544
|
-
Divider as
|
|
1691
|
+
Divider as Divider4
|
|
1545
1692
|
} from "@elementor/ui";
|
|
1546
|
-
import { __ as
|
|
1693
|
+
import { __ as __15, sprintf as sprintf3 } from "@wordpress/i18n";
|
|
1547
1694
|
|
|
1548
1695
|
// src/components/panel/actions-menu/action-menu-item.tsx
|
|
1549
|
-
import * as
|
|
1550
|
-
import { ListItemIcon as ListItemIcon2, ListItemText as ListItemText4, MenuItem as
|
|
1696
|
+
import * as React22 from "react";
|
|
1697
|
+
import { ListItemIcon as ListItemIcon2, ListItemText as ListItemText4, MenuItem as MenuItem4 } from "@elementor/ui";
|
|
1551
1698
|
function ActionMenuItem({ description, icon: Icon, MenuItemProps, title }) {
|
|
1552
|
-
return /* @__PURE__ */
|
|
1699
|
+
return /* @__PURE__ */ React22.createElement(MenuItem4, { ...MenuItemProps }, /* @__PURE__ */ React22.createElement(
|
|
1553
1700
|
ListItemIcon2,
|
|
1554
1701
|
{
|
|
1555
1702
|
sx: {
|
|
1556
1703
|
color: "inherit"
|
|
1557
1704
|
}
|
|
1558
1705
|
},
|
|
1559
|
-
/* @__PURE__ */
|
|
1560
|
-
), /* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ React22.createElement(Icon, null)
|
|
1707
|
+
), /* @__PURE__ */ React22.createElement(ListItemText4, { primary: title, secondary: description }));
|
|
1561
1708
|
}
|
|
1562
1709
|
|
|
1563
1710
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
@@ -1567,10 +1714,10 @@ function Delete({ post }) {
|
|
|
1567
1714
|
const isPostActive = activeDocument?.id === post.id;
|
|
1568
1715
|
const userCanDelete = post.user_can.delete;
|
|
1569
1716
|
const isDisabled = !userCanDelete || post.isHome || isPostActive;
|
|
1570
|
-
return /* @__PURE__ */
|
|
1717
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
1571
1718
|
ActionMenuItem,
|
|
1572
1719
|
{
|
|
1573
|
-
title:
|
|
1720
|
+
title: __15("Delete", "elementor"),
|
|
1574
1721
|
icon: TrashIcon,
|
|
1575
1722
|
MenuItemProps: {
|
|
1576
1723
|
disabled: isDisabled,
|
|
@@ -1578,7 +1725,7 @@ function Delete({ post }) {
|
|
|
1578
1725
|
sx: { "&:hover": { color: "error.main" } }
|
|
1579
1726
|
}
|
|
1580
1727
|
}
|
|
1581
|
-
), isDialogOpen && /* @__PURE__ */
|
|
1728
|
+
), isDialogOpen && /* @__PURE__ */ React23.createElement(DeleteDialog, { post, setIsDialogOpen }));
|
|
1582
1729
|
}
|
|
1583
1730
|
function DeleteDialog({
|
|
1584
1731
|
post,
|
|
@@ -1587,11 +1734,11 @@ function DeleteDialog({
|
|
|
1587
1734
|
const { type } = usePostListContext();
|
|
1588
1735
|
const { deletePost } = usePostActions(type);
|
|
1589
1736
|
const { setError } = usePostListContext();
|
|
1590
|
-
const dialogTitle = sprintf3(
|
|
1591
|
-
const dialogBody = type === "post" ?
|
|
1737
|
+
const dialogTitle = sprintf3(__15('Delete "%s"?', "elementor"), post.title.rendered);
|
|
1738
|
+
const dialogBody = type === "post" ? __15(
|
|
1592
1739
|
"The post and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1593
1740
|
"elementor"
|
|
1594
|
-
) :
|
|
1741
|
+
) : __15(
|
|
1595
1742
|
"The page and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1596
1743
|
"elementor"
|
|
1597
1744
|
);
|
|
@@ -1609,7 +1756,7 @@ function DeleteDialog({
|
|
|
1609
1756
|
}
|
|
1610
1757
|
setIsDialogOpen(false);
|
|
1611
1758
|
};
|
|
1612
|
-
return /* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ React23.createElement(Dialog, { open: true, onClose: handleCancel, "aria-labelledby": "delete-dialog" }, /* @__PURE__ */ React23.createElement(DialogTitle, { noWrap: true }, dialogTitle), /* @__PURE__ */ React23.createElement(Divider4, null), /* @__PURE__ */ React23.createElement(DialogContent, null, /* @__PURE__ */ React23.createElement(DialogContentText, null, dialogBody)), /* @__PURE__ */ React23.createElement(DialogActions, null, /* @__PURE__ */ React23.createElement(
|
|
1613
1760
|
Button,
|
|
1614
1761
|
{
|
|
1615
1762
|
variant: "contained",
|
|
@@ -1617,14 +1764,14 @@ function DeleteDialog({
|
|
|
1617
1764
|
onClick: handleCancel,
|
|
1618
1765
|
disabled: deletePost.isPending
|
|
1619
1766
|
},
|
|
1620
|
-
|
|
1621
|
-
), /* @__PURE__ */
|
|
1767
|
+
__15("Cancel", "elementor")
|
|
1768
|
+
), /* @__PURE__ */ React23.createElement(Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? __15("Delete", "elementor") : /* @__PURE__ */ React23.createElement(CircularProgress2, null))));
|
|
1622
1769
|
}
|
|
1623
1770
|
|
|
1624
1771
|
// src/components/panel/actions-menu/actions/duplicate.tsx
|
|
1625
|
-
import * as
|
|
1772
|
+
import * as React24 from "react";
|
|
1626
1773
|
import { CopyIcon } from "@elementor/icons";
|
|
1627
|
-
import { __ as
|
|
1774
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1628
1775
|
function Duplicate({ post, popupState }) {
|
|
1629
1776
|
const { setEditMode, type } = usePostListContext();
|
|
1630
1777
|
const canCreate = useCanCreate(type);
|
|
@@ -1639,10 +1786,10 @@ function Duplicate({ post, popupState }) {
|
|
|
1639
1786
|
});
|
|
1640
1787
|
};
|
|
1641
1788
|
const isDisabled = !canCreate;
|
|
1642
|
-
return /* @__PURE__ */
|
|
1789
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1643
1790
|
ActionMenuItem,
|
|
1644
1791
|
{
|
|
1645
|
-
title:
|
|
1792
|
+
title: __16("Duplicate", "elementor"),
|
|
1646
1793
|
icon: CopyIcon,
|
|
1647
1794
|
MenuItemProps: {
|
|
1648
1795
|
disabled: isDisabled,
|
|
@@ -1653,7 +1800,7 @@ function Duplicate({ post, popupState }) {
|
|
|
1653
1800
|
}
|
|
1654
1801
|
|
|
1655
1802
|
// src/components/panel/actions-menu/actions/force-delete.tsx
|
|
1656
|
-
import * as
|
|
1803
|
+
import * as React25 from "react";
|
|
1657
1804
|
import { useState as useState6 } from "react";
|
|
1658
1805
|
import { TrashIcon as TrashIcon2 } from "@elementor/icons";
|
|
1659
1806
|
import {
|
|
@@ -1664,12 +1811,12 @@ import {
|
|
|
1664
1811
|
DialogContent as DialogContent2,
|
|
1665
1812
|
DialogContentText as DialogContentText2,
|
|
1666
1813
|
DialogTitle as DialogTitle2,
|
|
1667
|
-
Divider as
|
|
1814
|
+
Divider as Divider5
|
|
1668
1815
|
} from "@elementor/ui";
|
|
1669
|
-
import { __ as
|
|
1816
|
+
import { __ as __17, sprintf as sprintf4 } from "@wordpress/i18n";
|
|
1670
1817
|
function ForceDelete({ post }) {
|
|
1671
1818
|
const [isDialogOpen, setIsDialogOpen] = useState6(false);
|
|
1672
|
-
return /* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
|
|
1673
1820
|
ActionMenuItem,
|
|
1674
1821
|
{
|
|
1675
1822
|
icon: TrashIcon2,
|
|
@@ -1678,9 +1825,9 @@ function ForceDelete({ post }) {
|
|
|
1678
1825
|
onClick: () => setIsDialogOpen(true),
|
|
1679
1826
|
sx: { "&:hover": { color: "error.main" } }
|
|
1680
1827
|
},
|
|
1681
|
-
title:
|
|
1828
|
+
title: __17("Delete permanently", "elementor")
|
|
1682
1829
|
}
|
|
1683
|
-
), isDialogOpen && /* @__PURE__ */
|
|
1830
|
+
), isDialogOpen && /* @__PURE__ */ React25.createElement(ForceDeleteDialog, { post, setIsDialogOpen }));
|
|
1684
1831
|
}
|
|
1685
1832
|
function ForceDeleteDialog({
|
|
1686
1833
|
post,
|
|
@@ -1688,8 +1835,8 @@ function ForceDeleteDialog({
|
|
|
1688
1835
|
}) {
|
|
1689
1836
|
const { setError, type } = usePostListContext();
|
|
1690
1837
|
const { forceDeletePost } = usePostActions(type);
|
|
1691
|
-
const dialogTitle = sprintf4(
|
|
1692
|
-
const dialogBody =
|
|
1838
|
+
const dialogTitle = sprintf4(__17('Delete "%s" permanently?', "elementor"), post.title.rendered);
|
|
1839
|
+
const dialogBody = __17("This will permanently delete the item. You cannot undo this action.", "elementor");
|
|
1693
1840
|
const handleDelete = async () => {
|
|
1694
1841
|
try {
|
|
1695
1842
|
await forceDeletePost.mutateAsync(post.id);
|
|
@@ -1705,7 +1852,7 @@ function ForceDeleteDialog({
|
|
|
1705
1852
|
}
|
|
1706
1853
|
setIsDialogOpen(false);
|
|
1707
1854
|
};
|
|
1708
|
-
return /* @__PURE__ */
|
|
1855
|
+
return /* @__PURE__ */ React25.createElement(Dialog2, { "aria-labelledby": "force-delete-dialog", onClose: handleCancel, open: true }, /* @__PURE__ */ React25.createElement(DialogTitle2, { noWrap: true }, dialogTitle), /* @__PURE__ */ React25.createElement(Divider5, null), /* @__PURE__ */ React25.createElement(DialogContent2, null, /* @__PURE__ */ React25.createElement(DialogContentText2, null, dialogBody)), /* @__PURE__ */ React25.createElement(DialogActions2, null, /* @__PURE__ */ React25.createElement(
|
|
1709
1856
|
Button2,
|
|
1710
1857
|
{
|
|
1711
1858
|
variant: "contained",
|
|
@@ -1713,8 +1860,8 @@ function ForceDeleteDialog({
|
|
|
1713
1860
|
onClick: handleCancel,
|
|
1714
1861
|
disabled: forceDeletePost.isPending
|
|
1715
1862
|
},
|
|
1716
|
-
|
|
1717
|
-
), /* @__PURE__ */
|
|
1863
|
+
__17("Cancel", "elementor")
|
|
1864
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1718
1865
|
Button2,
|
|
1719
1866
|
{
|
|
1720
1867
|
variant: "contained",
|
|
@@ -1722,20 +1869,20 @@ function ForceDeleteDialog({
|
|
|
1722
1869
|
onClick: () => void handleDelete(),
|
|
1723
1870
|
disabled: forceDeletePost.isPending
|
|
1724
1871
|
},
|
|
1725
|
-
!forceDeletePost.isPending ?
|
|
1872
|
+
!forceDeletePost.isPending ? __17("Delete permanently", "elementor") : /* @__PURE__ */ React25.createElement(CircularProgress3, null)
|
|
1726
1873
|
)));
|
|
1727
1874
|
}
|
|
1728
1875
|
|
|
1729
1876
|
// src/components/panel/actions-menu/actions/rename.tsx
|
|
1730
|
-
import * as
|
|
1877
|
+
import * as React26 from "react";
|
|
1731
1878
|
import { EraseIcon } from "@elementor/icons";
|
|
1732
|
-
import { __ as
|
|
1879
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1733
1880
|
function Rename({ post }) {
|
|
1734
1881
|
const { setEditMode } = usePostListContext();
|
|
1735
|
-
return /* @__PURE__ */
|
|
1882
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1736
1883
|
ActionMenuItem,
|
|
1737
1884
|
{
|
|
1738
|
-
title:
|
|
1885
|
+
title: __18("Rename", "elementor"),
|
|
1739
1886
|
icon: EraseIcon,
|
|
1740
1887
|
MenuItemProps: {
|
|
1741
1888
|
disabled: !post.user_can.edit,
|
|
@@ -1753,9 +1900,9 @@ function Rename({ post }) {
|
|
|
1753
1900
|
}
|
|
1754
1901
|
|
|
1755
1902
|
// src/components/panel/actions-menu/actions/restore.tsx
|
|
1756
|
-
import * as
|
|
1903
|
+
import * as React27 from "react";
|
|
1757
1904
|
import { RefreshIcon } from "@elementor/icons";
|
|
1758
|
-
import { __ as
|
|
1905
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
1759
1906
|
function Restore({ post }) {
|
|
1760
1907
|
const { setError, type } = usePostListContext();
|
|
1761
1908
|
const { restorePost } = usePostActions(type);
|
|
@@ -1766,11 +1913,11 @@ function Restore({ post }) {
|
|
|
1766
1913
|
setError();
|
|
1767
1914
|
}
|
|
1768
1915
|
};
|
|
1769
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1770
1917
|
ActionMenuItem,
|
|
1771
1918
|
{
|
|
1772
|
-
description:
|
|
1773
|
-
title:
|
|
1919
|
+
description: __19("Restored as draft", "elementor"),
|
|
1920
|
+
title: __19("Restore", "elementor"),
|
|
1774
1921
|
icon: RefreshIcon,
|
|
1775
1922
|
MenuItemProps: {
|
|
1776
1923
|
disabled: restorePost.isPending || !post.user_can.delete,
|
|
@@ -1781,10 +1928,10 @@ function Restore({ post }) {
|
|
|
1781
1928
|
}
|
|
1782
1929
|
|
|
1783
1930
|
// src/components/panel/actions-menu/actions/set-home.tsx
|
|
1784
|
-
import * as
|
|
1931
|
+
import * as React28 from "react";
|
|
1785
1932
|
import { HomeIcon } from "@elementor/icons";
|
|
1786
1933
|
import { CircularProgress as CircularProgress4 } from "@elementor/ui";
|
|
1787
|
-
import { __ as
|
|
1934
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1788
1935
|
|
|
1789
1936
|
// src/hooks/use-homepage-actions.ts
|
|
1790
1937
|
import { useMutation as useMutation2, useQueryClient as useQueryClient2 } from "@elementor/query";
|
|
@@ -1823,10 +1970,10 @@ function SetHome({ post, closeMenu }) {
|
|
|
1823
1970
|
const isPostPublished = post.status === "publish";
|
|
1824
1971
|
const isPostHomepage = !!post.isHome;
|
|
1825
1972
|
const isDisabled = !canManageOptions || isPostHomepage || !isPostPublished || updateSettingsMutation.isPending;
|
|
1826
|
-
return /* @__PURE__ */
|
|
1973
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1827
1974
|
ActionMenuItem,
|
|
1828
1975
|
{
|
|
1829
|
-
title:
|
|
1976
|
+
title: __20("Set as homepage", "elementor"),
|
|
1830
1977
|
icon: !updateSettingsMutation.isPending ? HomeIcon : CircularProgress4,
|
|
1831
1978
|
MenuItemProps: {
|
|
1832
1979
|
disabled: isDisabled,
|
|
@@ -1837,13 +1984,13 @@ function SetHome({ post, closeMenu }) {
|
|
|
1837
1984
|
}
|
|
1838
1985
|
|
|
1839
1986
|
// src/components/panel/actions-menu/actions/view.tsx
|
|
1840
|
-
import * as
|
|
1987
|
+
import * as React29 from "react";
|
|
1841
1988
|
import { EyeIcon } from "@elementor/icons";
|
|
1842
|
-
import { __ as
|
|
1989
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1843
1990
|
function View({ post }) {
|
|
1844
1991
|
const { type } = usePostListContext();
|
|
1845
|
-
const title =
|
|
1846
|
-
return /* @__PURE__ */
|
|
1992
|
+
const title = __21("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
|
|
1993
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1847
1994
|
ActionMenuItem,
|
|
1848
1995
|
{
|
|
1849
1996
|
title,
|
|
@@ -1870,16 +2017,16 @@ var DisabledPostTooltip = ({
|
|
|
1870
2017
|
postTypeSlug
|
|
1871
2018
|
}) => {
|
|
1872
2019
|
if (isDisabled) {
|
|
1873
|
-
const title = /* @__PURE__ */
|
|
1874
|
-
return /* @__PURE__ */
|
|
2020
|
+
const title = /* @__PURE__ */ React30.createElement(Typography6, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React30.createElement("br", null), __22("To edit it directly, contact the site owner", "elementor"));
|
|
2021
|
+
return /* @__PURE__ */ React30.createElement(Tooltip4, { title, placement: "bottom", arrow: false }, /* @__PURE__ */ React30.createElement("span", null, children));
|
|
1875
2022
|
}
|
|
1876
|
-
return /* @__PURE__ */
|
|
2023
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, children);
|
|
1877
2024
|
};
|
|
1878
2025
|
function ListItemView({ post }) {
|
|
1879
2026
|
const { type } = usePostListContext();
|
|
1880
2027
|
const activeDocument = useActiveDocument3();
|
|
1881
2028
|
const navigateToDocument = useNavigateToDocument3();
|
|
1882
|
-
const popupState =
|
|
2029
|
+
const popupState = usePopupState4({
|
|
1883
2030
|
variant: "popover",
|
|
1884
2031
|
popupId: "post-actions",
|
|
1885
2032
|
disableAutoFocus: true
|
|
@@ -1893,15 +2040,15 @@ function ListItemView({ post }) {
|
|
|
1893
2040
|
const menuTriggerProps = bindTrigger2(popupState);
|
|
1894
2041
|
const hasListItemActions = useSiteContentListItemActionsInjections().length > 0;
|
|
1895
2042
|
const showListItemActions = isActive && post.user_can.edit && !isTrashed && hasListItemActions;
|
|
1896
|
-
const listRow = /* @__PURE__ */
|
|
2043
|
+
const listRow = /* @__PURE__ */ React30.createElement(
|
|
1897
2044
|
ListItem2,
|
|
1898
2045
|
{
|
|
1899
2046
|
disablePadding: true,
|
|
1900
2047
|
sx: getContentPanelListItemSx(showListItemActions),
|
|
1901
|
-
secondaryAction: /* @__PURE__ */
|
|
2048
|
+
secondaryAction: /* @__PURE__ */ React30.createElement(Stack6, { alignItems: "center", direction: "row", spacing: 0 }, showListItemActions && /* @__PURE__ */ React30.createElement(SiteContentListItemActionsSlot, { post, title }), /* @__PURE__ */ React30.createElement(
|
|
1902
2049
|
IconButton4,
|
|
1903
2050
|
{
|
|
1904
|
-
"aria-label":
|
|
2051
|
+
"aria-label": __22("More actions", "elementor"),
|
|
1905
2052
|
size: "tiny",
|
|
1906
2053
|
...menuTriggerProps,
|
|
1907
2054
|
onClick: (event) => {
|
|
@@ -1909,10 +2056,10 @@ function ListItemView({ post }) {
|
|
|
1909
2056
|
menuTriggerProps.onClick?.(event);
|
|
1910
2057
|
}
|
|
1911
2058
|
},
|
|
1912
|
-
/* @__PURE__ */
|
|
2059
|
+
/* @__PURE__ */ React30.createElement(DotsVerticalIcon, { fontSize: "tiny" })
|
|
1913
2060
|
))
|
|
1914
2061
|
},
|
|
1915
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ React30.createElement(
|
|
1916
2063
|
ListItemButton2,
|
|
1917
2064
|
{
|
|
1918
2065
|
dense: true,
|
|
@@ -1928,18 +2075,18 @@ function ListItemView({ post }) {
|
|
|
1928
2075
|
shape: "rounded",
|
|
1929
2076
|
sx: contentPanelListItemButtonSx
|
|
1930
2077
|
},
|
|
1931
|
-
/* @__PURE__ */
|
|
1932
|
-
post.isHome && /* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ React30.createElement(ListItemText5, { disableTypography: true, sx: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React30.createElement(PageTitleAndStatus, { title, status })),
|
|
2079
|
+
post.isHome && /* @__PURE__ */ React30.createElement(HomeIcon2, { titleAccess: __22("Homepage", "elementor"), color: "disabled" })
|
|
1933
2080
|
)
|
|
1934
2081
|
);
|
|
1935
|
-
return /* @__PURE__ */
|
|
2082
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, isEditBlocked ? /* @__PURE__ */ React30.createElement(DisabledPostTooltip, { isDisabled: true, postTypeSlug: type }, listRow) : listRow, /* @__PURE__ */ React30.createElement(
|
|
1936
2083
|
Menu2,
|
|
1937
2084
|
{
|
|
1938
2085
|
PaperProps: { sx: { mt: 2, width: 200 } },
|
|
1939
2086
|
MenuListProps: { dense: true },
|
|
1940
2087
|
...bindMenu2(popupState)
|
|
1941
2088
|
},
|
|
1942
|
-
isTrashed ? /* @__PURE__ */
|
|
2089
|
+
isTrashed ? /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(Restore, { post }), /* @__PURE__ */ React30.createElement(ForceDelete, { post })) : /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(Rename, { post }), /* @__PURE__ */ React30.createElement(Duplicate, { post, popupState }), /* @__PURE__ */ React30.createElement(Delete, { post }), /* @__PURE__ */ React30.createElement(View, { post }), type === "page" && /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(Divider6, null), /* @__PURE__ */ React30.createElement(SetHome, { post, closeMenu: () => popupState.close() })))
|
|
1943
2090
|
));
|
|
1944
2091
|
}
|
|
1945
2092
|
|
|
@@ -1947,25 +2094,25 @@ function ListItemView({ post }) {
|
|
|
1947
2094
|
function PostListItem({ post }) {
|
|
1948
2095
|
const { editMode } = usePostListContext();
|
|
1949
2096
|
if ("rename" === editMode.mode && post?.id && post?.id === editMode.details.postId) {
|
|
1950
|
-
return /* @__PURE__ */
|
|
2097
|
+
return /* @__PURE__ */ React31.createElement(ListItemRename, { post });
|
|
1951
2098
|
}
|
|
1952
2099
|
if ("create" === editMode.mode && !post) {
|
|
1953
|
-
return /* @__PURE__ */
|
|
2100
|
+
return /* @__PURE__ */ React31.createElement(ListItemCreate, null);
|
|
1954
2101
|
}
|
|
1955
2102
|
if ("duplicate" === editMode.mode && !post) {
|
|
1956
|
-
return /* @__PURE__ */
|
|
2103
|
+
return /* @__PURE__ */ React31.createElement(ListItemDuplicate, null);
|
|
1957
2104
|
}
|
|
1958
2105
|
if (!post) {
|
|
1959
2106
|
return null;
|
|
1960
2107
|
}
|
|
1961
|
-
return /* @__PURE__ */
|
|
2108
|
+
return /* @__PURE__ */ React31.createElement(ListItemView, { post });
|
|
1962
2109
|
}
|
|
1963
2110
|
|
|
1964
2111
|
// src/components/panel/posts-list/post-list-pagination-actions.tsx
|
|
1965
|
-
import * as
|
|
2112
|
+
import * as React32 from "react";
|
|
1966
2113
|
import { CollapseIcon as CollapseIcon2 } from "@elementor/editor-ui";
|
|
1967
|
-
import { Box as Box8, Button as Button3, CircularProgress as CircularProgress5, Stack as
|
|
1968
|
-
import { __ as
|
|
2114
|
+
import { Box as Box8, Button as Button3, CircularProgress as CircularProgress5, Stack as Stack7 } from "@elementor/ui";
|
|
2115
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
1969
2116
|
var listPaginationButtonProps = {
|
|
1970
2117
|
color: "secondary",
|
|
1971
2118
|
size: "small",
|
|
@@ -1982,28 +2129,28 @@ function PostListPaginationActions({
|
|
|
1982
2129
|
if (!canLoadMore && !canShowLess) {
|
|
1983
2130
|
return null;
|
|
1984
2131
|
}
|
|
1985
|
-
const loadMoreLabel =
|
|
1986
|
-
const showLessLabel =
|
|
1987
|
-
const loadMoreButton = /* @__PURE__ */
|
|
2132
|
+
const loadMoreLabel = __23("Load more", "elementor");
|
|
2133
|
+
const showLessLabel = __23("Show less", "elementor");
|
|
2134
|
+
const loadMoreButton = /* @__PURE__ */ React32.createElement(
|
|
1988
2135
|
Button3,
|
|
1989
2136
|
{
|
|
1990
2137
|
...listPaginationButtonProps,
|
|
1991
2138
|
ref: loadMoreButtonRef,
|
|
1992
2139
|
"aria-label": loadMoreLabel,
|
|
1993
2140
|
disabled: isLoadingMore,
|
|
1994
|
-
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */
|
|
2141
|
+
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */ React32.createElement(CollapseIcon2, { open: false }),
|
|
1995
2142
|
fullWidth: true,
|
|
1996
2143
|
onClick: onLoadMore,
|
|
1997
2144
|
sx: { flex: 1, my: 0.5 }
|
|
1998
2145
|
},
|
|
1999
|
-
isLoadingMore ? /* @__PURE__ */
|
|
2146
|
+
isLoadingMore ? /* @__PURE__ */ React32.createElement(CircularProgress5, { size: 20 }) : loadMoreLabel
|
|
2000
2147
|
);
|
|
2001
|
-
const showLessButton = /* @__PURE__ */
|
|
2148
|
+
const showLessButton = /* @__PURE__ */ React32.createElement(
|
|
2002
2149
|
Button3,
|
|
2003
2150
|
{
|
|
2004
2151
|
...listPaginationButtonProps,
|
|
2005
2152
|
"aria-label": showLessLabel,
|
|
2006
|
-
endIcon: /* @__PURE__ */
|
|
2153
|
+
endIcon: /* @__PURE__ */ React32.createElement(CollapseIcon2, { open: true }),
|
|
2007
2154
|
fullWidth: true,
|
|
2008
2155
|
onClick: onShowLess,
|
|
2009
2156
|
sx: { flex: 1, my: 0.5 }
|
|
@@ -2011,16 +2158,16 @@ function PostListPaginationActions({
|
|
|
2011
2158
|
showLessLabel
|
|
2012
2159
|
);
|
|
2013
2160
|
if (canShowLess && canLoadMore) {
|
|
2014
|
-
return /* @__PURE__ */
|
|
2161
|
+
return /* @__PURE__ */ React32.createElement(Box8, { sx: { px: 2, width: "100%" } }, /* @__PURE__ */ React32.createElement(Stack7, { direction: "row", spacing: 1 }, showLessButton, loadMoreButton));
|
|
2015
2162
|
}
|
|
2016
|
-
return /* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ React32.createElement(Box8, { sx: { px: 2, width: "100%" } }, canShowLess ? showLessButton : loadMoreButton);
|
|
2017
2164
|
}
|
|
2018
2165
|
|
|
2019
2166
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
2020
2167
|
var SEARCH_DEBOUNCE_MS = 300;
|
|
2021
2168
|
function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
2022
2169
|
const { type, editMode, resetEditMode, setEditMode } = usePostListContext();
|
|
2023
|
-
const { registerSection, searchQuery, statusFilters, unregisterSection } = useContentPanelCoordinator();
|
|
2170
|
+
const { registerSection, searchQuery, siteContentSort, statusFilters, unregisterSection } = useContentPanelCoordinator();
|
|
2024
2171
|
const [isOpen, setIsOpen] = useState7(isOpenByDefault);
|
|
2025
2172
|
const trimmedSearch = searchQuery.trim();
|
|
2026
2173
|
const [debouncedSearch, setDebouncedSearch] = useState7(trimmedSearch);
|
|
@@ -2039,7 +2186,7 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2039
2186
|
fetchNextPage,
|
|
2040
2187
|
hasNextPage,
|
|
2041
2188
|
isFetchingNextPage
|
|
2042
|
-
} = usePosts(type, debouncedSearch, statusFilters);
|
|
2189
|
+
} = usePosts(type, debouncedSearch, statusFilters, siteContentSort);
|
|
2043
2190
|
const isNarrowed = isSiteContentListNarrowed(statusFilters, debouncedSearch);
|
|
2044
2191
|
const isTrashFilter = isSiteContentTrashFilterActive(statusFilters);
|
|
2045
2192
|
const baselineStatus = isTrashFilter ? "trash" : "any";
|
|
@@ -2064,7 +2211,8 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2064
2211
|
return [];
|
|
2065
2212
|
}
|
|
2066
2213
|
const mappedPosts = isPageType ? posts.map((post) => post.id === homepageId ? { ...post, isHome: true } : post) : posts;
|
|
2067
|
-
const
|
|
2214
|
+
const shouldPinHomepage = isPageType && shouldPinHomepageForSiteContentSort(siteContentSort);
|
|
2215
|
+
const sorted = shouldPinHomepage ? [...mappedPosts].sort((a, b) => {
|
|
2068
2216
|
if (a.id === homepageId) {
|
|
2069
2217
|
return -1;
|
|
2070
2218
|
}
|
|
@@ -2074,13 +2222,13 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2074
2222
|
return 0;
|
|
2075
2223
|
}) : mappedPosts;
|
|
2076
2224
|
return sorted;
|
|
2077
|
-
}, [
|
|
2225
|
+
}, [homepageId, isPageType, posts, siteContentSort]);
|
|
2078
2226
|
const pagination = usePostListPagination({
|
|
2079
2227
|
fetchNextPage,
|
|
2080
2228
|
hasNextPage,
|
|
2081
2229
|
isFetchingNextPage,
|
|
2082
2230
|
loadedCount: filteredPosts.length,
|
|
2083
|
-
resetKey: `${type}:${debouncedSearch}:${statusFiltersKey}`,
|
|
2231
|
+
resetKey: `${type}:${debouncedSearch}:${statusFiltersKey}:${siteContentSort}`,
|
|
2084
2232
|
totalCount: total
|
|
2085
2233
|
});
|
|
2086
2234
|
const displayedPosts = useMemo4(
|
|
@@ -2113,16 +2261,16 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2113
2261
|
}
|
|
2114
2262
|
}, [debouncedSearch, filteredPosts.length, statusFilters]);
|
|
2115
2263
|
if (postsError) {
|
|
2116
|
-
return /* @__PURE__ */
|
|
2264
|
+
return /* @__PURE__ */ React33.createElement(ErrorState, null);
|
|
2117
2265
|
}
|
|
2118
2266
|
if (postsPending && !posts?.length) {
|
|
2119
|
-
return /* @__PURE__ */
|
|
2267
|
+
return /* @__PURE__ */ React33.createElement(Box9, { sx: { px: 2 } }, /* @__PURE__ */ React33.createElement(Box9, null, /* @__PURE__ */ React33.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "100%", height: "24px" }), /* @__PURE__ */ React33.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React33.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React33.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" })));
|
|
2120
2268
|
}
|
|
2121
2269
|
const displayCount = total;
|
|
2122
2270
|
const sectionTitle = postTypesMap[type].labels.plural_name;
|
|
2123
2271
|
const showNoResults = (debouncedSearch || hasActiveSiteContentStatusFilters(statusFilters)) && filteredPosts.length === 0;
|
|
2124
2272
|
const countChipLabel = isNarrowed && baselineTotal !== void 0 ? `${total} / ${baselineTotal}` : void 0;
|
|
2125
|
-
return /* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ React33.createElement(
|
|
2126
2274
|
CollapsibleList,
|
|
2127
2275
|
{
|
|
2128
2276
|
count: displayCount,
|
|
@@ -2131,15 +2279,15 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2131
2279
|
isOpen,
|
|
2132
2280
|
onOpenChange: setIsOpen,
|
|
2133
2281
|
title: sectionTitle,
|
|
2134
|
-
trailingActions: isTrashFilter ? null : /* @__PURE__ */
|
|
2282
|
+
trailingActions: isTrashFilter ? null : /* @__PURE__ */ React33.createElement(SectionAddButton, { onBeforeCreate: () => setIsOpen(true) })
|
|
2135
2283
|
},
|
|
2136
|
-
showNoResults && /* @__PURE__ */
|
|
2137
|
-
/* @__PURE__ */
|
|
2284
|
+
showNoResults && /* @__PURE__ */ React33.createElement(Box9, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React33.createElement(Typography7, { variant: "body2", color: "text.secondary" }, __24("No results found", "elementor"))),
|
|
2285
|
+
/* @__PURE__ */ React33.createElement(Box9, { ref: listTopRef }),
|
|
2138
2286
|
displayedPosts.map((post) => {
|
|
2139
|
-
return /* @__PURE__ */
|
|
2287
|
+
return /* @__PURE__ */ React33.createElement(PostListItem, { key: post.id, post });
|
|
2140
2288
|
}),
|
|
2141
|
-
!isTrashFilter && ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2289
|
+
!isTrashFilter && ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */ React33.createElement(PostListItem, null),
|
|
2290
|
+
/* @__PURE__ */ React33.createElement(
|
|
2143
2291
|
PostListPaginationActions,
|
|
2144
2292
|
{
|
|
2145
2293
|
canLoadMore: pagination.canLoadMore,
|
|
@@ -2154,11 +2302,11 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2154
2302
|
}
|
|
2155
2303
|
|
|
2156
2304
|
// src/components/panel/user-load-error.tsx
|
|
2157
|
-
import * as
|
|
2158
|
-
import { Box as Box10, Typography as
|
|
2159
|
-
import { __ as
|
|
2305
|
+
import * as React34 from "react";
|
|
2306
|
+
import { Box as Box10, Typography as Typography8 } from "@elementor/ui";
|
|
2307
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
2160
2308
|
function UserLoadError() {
|
|
2161
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ React34.createElement(Box10, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React34.createElement(Typography8, { variant: "body2", color: "text.secondary" }, __25(
|
|
2162
2310
|
"We couldn\u2019t load your content permissions. Try closing and reopening this panel.",
|
|
2163
2311
|
"elementor"
|
|
2164
2312
|
)));
|
|
@@ -2172,12 +2320,12 @@ function ShellPanelBodyContent({
|
|
|
2172
2320
|
showUserLoadError
|
|
2173
2321
|
}) {
|
|
2174
2322
|
if (isUserPending) {
|
|
2175
|
-
return /* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ React35.createElement(Stack8, { spacing: 1, sx: { px: 2, py: 1 } }, /* @__PURE__ */ React35.createElement(Skeleton2, { animation: "wave", height: 28, variant: "rounded", width: "100%" }), /* @__PURE__ */ React35.createElement(Skeleton2, { animation: "wave", height: 28, variant: "rounded", width: "80%" }));
|
|
2176
2324
|
}
|
|
2177
2325
|
if (showUserLoadError) {
|
|
2178
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ React35.createElement(UserLoadError, null);
|
|
2179
2327
|
}
|
|
2180
|
-
return /* @__PURE__ */
|
|
2328
|
+
return /* @__PURE__ */ React35.createElement(List2, { dense: true, disablePadding: true, sx: { py: 0, width: "100%" } }, accessiblePostTypes.map((postTypeSlug, index) => /* @__PURE__ */ React35.createElement(PostListContextProvider, { key: postTypeSlug, type: postTypeSlug, setError: onListError }, /* @__PURE__ */ React35.createElement(PostsCollapsibleList, { isOpenByDefault: index === 0 }))));
|
|
2181
2329
|
}
|
|
2182
2330
|
|
|
2183
2331
|
// src/components/panel/shell.tsx
|
|
@@ -2185,8 +2333,8 @@ var Shell = () => {
|
|
|
2185
2333
|
const sidebarPanelChrome = isSidebarEnabled();
|
|
2186
2334
|
const [isErrorSnackbarOpen, setIsErrorSnackbarOpen] = useState8(false);
|
|
2187
2335
|
const { accessiblePostTypes, isUserPending, showUserLoadError } = useAccessiblePanelPostTypes();
|
|
2188
|
-
return /* @__PURE__ */
|
|
2189
|
-
|
|
2336
|
+
return /* @__PURE__ */ React36.createElement(ContentPanelCoordinatorProvider, null, /* @__PURE__ */ React36.createElement(Panel, null, /* @__PURE__ */ React36.createElement(PanelHeader, null, /* @__PURE__ */ React36.createElement(
|
|
2337
|
+
Stack9,
|
|
2190
2338
|
{
|
|
2191
2339
|
alignItems: "center",
|
|
2192
2340
|
direction: "row",
|
|
@@ -2196,9 +2344,9 @@ var Shell = () => {
|
|
|
2196
2344
|
...sidebarPanelChrome ? {} : { p: 1, pl: 2 }
|
|
2197
2345
|
}
|
|
2198
2346
|
},
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2201
|
-
)), /* @__PURE__ */
|
|
2347
|
+
/* @__PURE__ */ React36.createElement(PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, __26("Site content", "elementor")),
|
|
2348
|
+
/* @__PURE__ */ React36.createElement(ContentPanelHeaderAdd, null)
|
|
2349
|
+
)), /* @__PURE__ */ React36.createElement(Divider7, null), /* @__PURE__ */ React36.createElement(PanelBody, null, /* @__PURE__ */ React36.createElement(ContentPanelToolbar, null), /* @__PURE__ */ React36.createElement(Divider7, null), /* @__PURE__ */ React36.createElement(
|
|
2202
2350
|
ShellPanelBodyContent,
|
|
2203
2351
|
{
|
|
2204
2352
|
accessiblePostTypes,
|
|
@@ -2206,7 +2354,7 @@ var Shell = () => {
|
|
|
2206
2354
|
onListError: () => setIsErrorSnackbarOpen(true),
|
|
2207
2355
|
showUserLoadError
|
|
2208
2356
|
}
|
|
2209
|
-
), /* @__PURE__ */
|
|
2357
|
+
), /* @__PURE__ */ React36.createElement(error_snackbar_default, { open: isErrorSnackbarOpen, onClose: () => setIsErrorSnackbarOpen(false) }))));
|
|
2210
2358
|
};
|
|
2211
2359
|
var shell_default = Shell;
|
|
2212
2360
|
|
|
@@ -2217,7 +2365,7 @@ var { panel, usePanelStatus, usePanelActions } = createPanel({
|
|
|
2217
2365
|
});
|
|
2218
2366
|
|
|
2219
2367
|
// src/components/top-bar/recently-edited.tsx
|
|
2220
|
-
import * as
|
|
2368
|
+
import * as React41 from "react";
|
|
2221
2369
|
import {
|
|
2222
2370
|
__useActiveDocument as useActiveDocument4,
|
|
2223
2371
|
__useHostDocument as useHostDocument
|
|
@@ -2227,22 +2375,22 @@ import {
|
|
|
2227
2375
|
bindMenu as bindMenu3,
|
|
2228
2376
|
bindTrigger as bindTrigger3,
|
|
2229
2377
|
Button as Button4,
|
|
2230
|
-
Divider as
|
|
2378
|
+
Divider as Divider8,
|
|
2231
2379
|
ListItemText as ListItemText8,
|
|
2232
2380
|
ListSubheader,
|
|
2233
2381
|
Menu as Menu3,
|
|
2234
|
-
MenuItem as
|
|
2235
|
-
usePopupState as
|
|
2382
|
+
MenuItem as MenuItem7,
|
|
2383
|
+
usePopupState as usePopupState5
|
|
2236
2384
|
} from "@elementor/ui";
|
|
2237
|
-
import { __ as
|
|
2385
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
2238
2386
|
|
|
2239
2387
|
// src/components/top-bar/create-post-list-item.tsx
|
|
2240
|
-
import * as
|
|
2388
|
+
import * as React37 from "react";
|
|
2241
2389
|
import { __useNavigateToDocument as useNavigateToDocument4 } from "@elementor/editor-documents";
|
|
2242
2390
|
import { useMixpanel } from "@elementor/events";
|
|
2243
2391
|
import { PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
2244
|
-
import { CircularProgress as CircularProgress6, ListItemIcon as ListItemIcon3, ListItemText as ListItemText6, MenuItem as
|
|
2245
|
-
import { __ as
|
|
2392
|
+
import { CircularProgress as CircularProgress6, ListItemIcon as ListItemIcon3, ListItemText as ListItemText6, MenuItem as MenuItem5 } from "@elementor/ui";
|
|
2393
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
2246
2394
|
|
|
2247
2395
|
// src/hooks/use-create-page.ts
|
|
2248
2396
|
import { useState as useState9 } from "react";
|
|
@@ -2272,8 +2420,8 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
2272
2420
|
const navigateToDocument = useNavigateToDocument4();
|
|
2273
2421
|
const { data: user } = useUser();
|
|
2274
2422
|
const { dispatchEvent, config } = useMixpanel();
|
|
2275
|
-
return /* @__PURE__ */
|
|
2276
|
-
|
|
2423
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2424
|
+
MenuItem5,
|
|
2277
2425
|
{
|
|
2278
2426
|
disabled: isLoading || !user?.capabilities?.edit_pages,
|
|
2279
2427
|
onClick: async () => {
|
|
@@ -2296,25 +2444,25 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
2296
2444
|
},
|
|
2297
2445
|
...props
|
|
2298
2446
|
},
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ React37.createElement(ListItemIcon3, null, isLoading ? /* @__PURE__ */ React37.createElement(CircularProgress6, { size: "1.25rem" }) : /* @__PURE__ */ React37.createElement(PlusIcon2, { fontSize: "small" })),
|
|
2448
|
+
/* @__PURE__ */ React37.createElement(
|
|
2301
2449
|
ListItemText6,
|
|
2302
2450
|
{
|
|
2303
2451
|
primaryTypographyProps: { variant: "body2" },
|
|
2304
|
-
primary:
|
|
2452
|
+
primary: __27("Add new page", "elementor")
|
|
2305
2453
|
}
|
|
2306
2454
|
)
|
|
2307
2455
|
);
|
|
2308
2456
|
}
|
|
2309
2457
|
|
|
2310
2458
|
// src/components/top-bar/indicator.tsx
|
|
2311
|
-
import * as
|
|
2312
|
-
import { Stack as
|
|
2459
|
+
import * as React38 from "react";
|
|
2460
|
+
import { Stack as Stack10, Tooltip as BaseTooltip, Typography as Typography9 } from "@elementor/ui";
|
|
2313
2461
|
function Indicator({ title, status }) {
|
|
2314
|
-
return /* @__PURE__ */
|
|
2462
|
+
return /* @__PURE__ */ React38.createElement(Tooltip5, { title }, /* @__PURE__ */ React38.createElement(Stack10, { component: "span", direction: "row", alignItems: "center", spacing: 0.5 }, /* @__PURE__ */ React38.createElement(Typography9, { component: "span", variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React38.createElement(Typography9, { component: "span", variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
2315
2463
|
}
|
|
2316
|
-
function
|
|
2317
|
-
return /* @__PURE__ */
|
|
2464
|
+
function Tooltip5(props) {
|
|
2465
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2318
2466
|
BaseTooltip,
|
|
2319
2467
|
{
|
|
2320
2468
|
PopperProps: {
|
|
@@ -2330,20 +2478,20 @@ function Tooltip4(props) {
|
|
|
2330
2478
|
}
|
|
2331
2479
|
|
|
2332
2480
|
// src/components/top-bar/post-list-item.tsx
|
|
2333
|
-
import * as
|
|
2481
|
+
import * as React40 from "react";
|
|
2334
2482
|
import { __useNavigateToDocument as useNavigateToDocument5 } from "@elementor/editor-documents";
|
|
2335
2483
|
import { useMixpanel as useMixpanel2 } from "@elementor/events";
|
|
2336
|
-
import { ListItemText as ListItemText7, MenuItem as
|
|
2484
|
+
import { ListItemText as ListItemText7, MenuItem as MenuItem6 } from "@elementor/ui";
|
|
2337
2485
|
|
|
2338
2486
|
// src/components/top-bar/chip-doc-type.tsx
|
|
2339
|
-
import * as
|
|
2487
|
+
import * as React39 from "react";
|
|
2340
2488
|
import { PostTypeIcon as PostTypeIcon3 } from "@elementor/icons";
|
|
2341
2489
|
import { Chip as Chip4 } from "@elementor/ui";
|
|
2342
2490
|
var iconsMap2 = getIconsMap();
|
|
2343
2491
|
function DocTypeChip({ postType, docType, label }) {
|
|
2344
2492
|
const color = "elementor_library" === postType ? "global" : "accent";
|
|
2345
2493
|
const Icon = iconsMap2[docType] || PostTypeIcon3;
|
|
2346
|
-
return /* @__PURE__ */
|
|
2494
|
+
return /* @__PURE__ */ React39.createElement(
|
|
2347
2495
|
Chip4,
|
|
2348
2496
|
{
|
|
2349
2497
|
component: "span",
|
|
@@ -2352,7 +2500,7 @@ function DocTypeChip({ postType, docType, label }) {
|
|
|
2352
2500
|
label,
|
|
2353
2501
|
"data-value": docType,
|
|
2354
2502
|
color,
|
|
2355
|
-
icon: /* @__PURE__ */
|
|
2503
|
+
icon: /* @__PURE__ */ React39.createElement(Icon, null),
|
|
2356
2504
|
sx: { ml: 1, cursor: "inherit" }
|
|
2357
2505
|
}
|
|
2358
2506
|
);
|
|
@@ -2363,8 +2511,8 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
2363
2511
|
const navigateToDocument = useNavigateToDocument5();
|
|
2364
2512
|
const postTitle = useReverseHtmlEntities(post.title);
|
|
2365
2513
|
const { dispatchEvent, config } = useMixpanel2();
|
|
2366
|
-
return /* @__PURE__ */
|
|
2367
|
-
|
|
2514
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2515
|
+
MenuItem6,
|
|
2368
2516
|
{
|
|
2369
2517
|
disabled: !post.user_can.edit,
|
|
2370
2518
|
onClick: async () => {
|
|
@@ -2386,7 +2534,7 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
2386
2534
|
},
|
|
2387
2535
|
...props
|
|
2388
2536
|
},
|
|
2389
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ React40.createElement(
|
|
2390
2538
|
ListItemText7,
|
|
2391
2539
|
{
|
|
2392
2540
|
sx: { flexGrow: 0 },
|
|
@@ -2394,7 +2542,7 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
2394
2542
|
primary: postTitle
|
|
2395
2543
|
}
|
|
2396
2544
|
),
|
|
2397
|
-
/* @__PURE__ */
|
|
2545
|
+
/* @__PURE__ */ React40.createElement(DocTypeChip, { postType: post.type.post_type, docType: post.type.doc_type, label: post.type.label })
|
|
2398
2546
|
);
|
|
2399
2547
|
}
|
|
2400
2548
|
|
|
@@ -2411,7 +2559,7 @@ function RecentlyEdited() {
|
|
|
2411
2559
|
return data.filter((post) => post.id !== document2?.id).splice(0, NUMBER_OF_RECENT_POSTS - 1);
|
|
2412
2560
|
};
|
|
2413
2561
|
const recentPosts = getRecentPosts();
|
|
2414
|
-
const popupState =
|
|
2562
|
+
const popupState = usePopupState5({
|
|
2415
2563
|
variant: "popover",
|
|
2416
2564
|
popupId: "elementor-v2-top-bar-recently-edited"
|
|
2417
2565
|
});
|
|
@@ -2420,12 +2568,12 @@ function RecentlyEdited() {
|
|
|
2420
2568
|
return null;
|
|
2421
2569
|
}
|
|
2422
2570
|
const buttonProps = bindTrigger3(popupState);
|
|
2423
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(
|
|
2424
2572
|
Button4,
|
|
2425
2573
|
{
|
|
2426
2574
|
color: "inherit",
|
|
2427
2575
|
size: "small",
|
|
2428
|
-
endIcon: /* @__PURE__ */
|
|
2576
|
+
endIcon: /* @__PURE__ */ React41.createElement(ChevronDownIcon, { fontSize: "small" }),
|
|
2429
2577
|
...buttonProps,
|
|
2430
2578
|
onClick: (e) => {
|
|
2431
2579
|
const extendedWindow = window;
|
|
@@ -2444,40 +2592,40 @@ function RecentlyEdited() {
|
|
|
2444
2592
|
buttonProps.onClick(e);
|
|
2445
2593
|
}
|
|
2446
2594
|
},
|
|
2447
|
-
/* @__PURE__ */
|
|
2448
|
-
), /* @__PURE__ */
|
|
2595
|
+
/* @__PURE__ */ React41.createElement(Indicator, { title: documentTitle, status: document2.status })
|
|
2596
|
+
), /* @__PURE__ */ React41.createElement(
|
|
2449
2597
|
Menu3,
|
|
2450
2598
|
{
|
|
2451
2599
|
MenuListProps: {
|
|
2452
|
-
subheader: /* @__PURE__ */
|
|
2600
|
+
subheader: /* @__PURE__ */ React41.createElement(ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, __28("Recent", "elementor"))
|
|
2453
2601
|
},
|
|
2454
2602
|
PaperProps: { sx: { mt: 2.5, width: 320 } },
|
|
2455
2603
|
...bindMenu3(popupState)
|
|
2456
2604
|
},
|
|
2457
|
-
recentPosts.map((post) => /* @__PURE__ */
|
|
2458
|
-
recentPosts.length === 0 && /* @__PURE__ */
|
|
2605
|
+
recentPosts.map((post) => /* @__PURE__ */ React41.createElement(PostListItem2, { key: post.id, post, closePopup: popupState.close })),
|
|
2606
|
+
recentPosts.length === 0 && /* @__PURE__ */ React41.createElement(MenuItem7, { disabled: true }, /* @__PURE__ */ React41.createElement(
|
|
2459
2607
|
ListItemText8,
|
|
2460
2608
|
{
|
|
2461
2609
|
primaryTypographyProps: {
|
|
2462
2610
|
variant: "caption",
|
|
2463
2611
|
fontStyle: "italic"
|
|
2464
2612
|
},
|
|
2465
|
-
primary:
|
|
2613
|
+
primary: __28("There are no other pages or templates on this site yet.", "elementor")
|
|
2466
2614
|
}
|
|
2467
2615
|
)),
|
|
2468
|
-
/* @__PURE__ */
|
|
2469
|
-
/* @__PURE__ */
|
|
2616
|
+
/* @__PURE__ */ React41.createElement(Divider8, { disabled: recentPosts.length === 0 }),
|
|
2617
|
+
/* @__PURE__ */ React41.createElement(CreatePostListItem, { closePopup: popupState.close })
|
|
2470
2618
|
));
|
|
2471
2619
|
}
|
|
2472
2620
|
|
|
2473
2621
|
// src/hooks/use-toggle-button-props.ts
|
|
2474
2622
|
import { PagesIcon } from "@elementor/icons";
|
|
2475
|
-
import { __ as
|
|
2623
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
2476
2624
|
function useToggleButtonProps() {
|
|
2477
2625
|
const { isOpen: selectedState, isBlocked } = usePanelStatus();
|
|
2478
2626
|
const { open, close } = usePanelActions();
|
|
2479
2627
|
return {
|
|
2480
|
-
title:
|
|
2628
|
+
title: __29("Site content", "elementor"),
|
|
2481
2629
|
icon: PagesIcon,
|
|
2482
2630
|
onClick: () => {
|
|
2483
2631
|
const extendedWindow = window;
|