@elementor/editor-site-navigation 4.5.0-1220 → 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.js
CHANGED
|
@@ -63,19 +63,44 @@ var import_editor_sidebar2 = require("@elementor/editor-sidebar");
|
|
|
63
63
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
64
64
|
|
|
65
65
|
// src/components/panel/shell.tsx
|
|
66
|
-
var
|
|
66
|
+
var React36 = __toESM(require("react"));
|
|
67
67
|
var import_react11 = require("react");
|
|
68
68
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
69
69
|
var import_editor_sidebar = require("@elementor/editor-sidebar");
|
|
70
|
-
var
|
|
71
|
-
var
|
|
70
|
+
var import_ui25 = require("@elementor/ui");
|
|
71
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
72
72
|
|
|
73
73
|
// src/contexts/content-panel-coordinator.tsx
|
|
74
74
|
var React = __toESM(require("react"));
|
|
75
75
|
var import_react = require("react");
|
|
76
76
|
|
|
77
|
-
// src/site-content-
|
|
77
|
+
// src/site-content-sort.ts
|
|
78
78
|
var import_i18n = require("@wordpress/i18n");
|
|
79
|
+
var SITE_CONTENT_SORT_OPTIONS = ["oldest", "newest"];
|
|
80
|
+
var DEFAULT_SITE_CONTENT_SORT = "oldest";
|
|
81
|
+
var SITE_CONTENT_SORT_POPOVER_WIDTH_PX = 280;
|
|
82
|
+
var sortLabels = {
|
|
83
|
+
oldest: (0, import_i18n.__)("Oldest", "elementor"),
|
|
84
|
+
newest: (0, import_i18n.__)("Newest", "elementor")
|
|
85
|
+
};
|
|
86
|
+
function getSiteContentSortLabel(sort) {
|
|
87
|
+
return sortLabels[sort];
|
|
88
|
+
}
|
|
89
|
+
function hasActiveSiteContentSort(sort) {
|
|
90
|
+
return sort !== DEFAULT_SITE_CONTENT_SORT;
|
|
91
|
+
}
|
|
92
|
+
function getRestOrderForSiteContentSort(sort) {
|
|
93
|
+
if (sort === "newest") {
|
|
94
|
+
return { order: "desc", orderby: "date" };
|
|
95
|
+
}
|
|
96
|
+
return { order: "asc", orderby: "date" };
|
|
97
|
+
}
|
|
98
|
+
function shouldPinHomepageForSiteContentSort(sort) {
|
|
99
|
+
return sort === DEFAULT_SITE_CONTENT_SORT;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/site-content-status-filter.ts
|
|
103
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
79
104
|
var SITE_CONTENT_SELECTABLE_STATUS_FILTERS = [
|
|
80
105
|
"publish",
|
|
81
106
|
"draft",
|
|
@@ -93,14 +118,14 @@ var EMPTY_SITE_CONTENT_STATUS_FILTERS = {
|
|
|
93
118
|
trash: false
|
|
94
119
|
};
|
|
95
120
|
var filterLabels = {
|
|
96
|
-
publish: (0,
|
|
97
|
-
draft: (0,
|
|
98
|
-
pending: (0,
|
|
99
|
-
private: (0,
|
|
100
|
-
future: (0,
|
|
101
|
-
trash: (0,
|
|
121
|
+
publish: (0, import_i18n2.__)("Published", "elementor"),
|
|
122
|
+
draft: (0, import_i18n2.__)("Drafts", "elementor"),
|
|
123
|
+
pending: (0, import_i18n2.__)("Pending", "elementor"),
|
|
124
|
+
private: (0, import_i18n2.__)("Private", "elementor"),
|
|
125
|
+
future: (0, import_i18n2.__)("Scheduled", "elementor"),
|
|
126
|
+
trash: (0, import_i18n2.__)("Trash", "elementor")
|
|
102
127
|
};
|
|
103
|
-
var SITE_CONTENT_ALL_FILTER_LABEL = (0,
|
|
128
|
+
var SITE_CONTENT_ALL_FILTER_LABEL = (0, import_i18n2.__)("All", "elementor");
|
|
104
129
|
var SITE_CONTENT_FILTER_POPOVER_WIDTH_PX = 280;
|
|
105
130
|
function getSiteContentStatusFilterLabel(filter) {
|
|
106
131
|
return filterLabels[filter];
|
|
@@ -157,6 +182,7 @@ var ContentPanelCoordinatorContext = (0, import_react.createContext)(null);
|
|
|
157
182
|
function ContentPanelCoordinatorProvider({ children }) {
|
|
158
183
|
const sectionsRef = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
159
184
|
const [searchQuery, setSearchQuery] = (0, import_react.useState)("");
|
|
185
|
+
const [siteContentSort, setSiteContentSortState] = (0, import_react.useState)(DEFAULT_SITE_CONTENT_SORT);
|
|
160
186
|
const [statusFilters, setStatusFilters] = (0, import_react.useState)(
|
|
161
187
|
EMPTY_SITE_CONTENT_STATUS_FILTERS
|
|
162
188
|
);
|
|
@@ -174,28 +200,46 @@ function ContentPanelCoordinatorProvider({ children }) {
|
|
|
174
200
|
handlers.setExpanded(true);
|
|
175
201
|
handlers.startCreate();
|
|
176
202
|
}, []);
|
|
203
|
+
const clearActiveToolbarFilters = (0, import_react.useCallback)(() => {
|
|
204
|
+
setSiteContentSortState(DEFAULT_SITE_CONTENT_SORT);
|
|
205
|
+
setStatusFilters(EMPTY_SITE_CONTENT_STATUS_FILTERS);
|
|
206
|
+
}, []);
|
|
207
|
+
const clearSiteContentSort = (0, import_react.useCallback)(() => {
|
|
208
|
+
setSiteContentSortState(DEFAULT_SITE_CONTENT_SORT);
|
|
209
|
+
}, []);
|
|
177
210
|
const clearStatusFilters = (0, import_react.useCallback)(() => {
|
|
178
211
|
setStatusFilters(EMPTY_SITE_CONTENT_STATUS_FILTERS);
|
|
179
212
|
}, []);
|
|
213
|
+
const setSiteContentSort = (0, import_react.useCallback)((sort) => {
|
|
214
|
+
setSiteContentSortState(sort);
|
|
215
|
+
}, []);
|
|
180
216
|
const toggleStatusFilter = (0, import_react.useCallback)((filter) => {
|
|
181
217
|
setStatusFilters((current) => toggleSiteContentStatusFilter(current, filter));
|
|
182
218
|
}, []);
|
|
183
219
|
const value = (0, import_react.useMemo)(
|
|
184
220
|
() => ({
|
|
221
|
+
clearActiveToolbarFilters,
|
|
222
|
+
clearSiteContentSort,
|
|
185
223
|
clearStatusFilters,
|
|
186
224
|
registerSection,
|
|
187
225
|
requestCreate,
|
|
188
226
|
searchQuery,
|
|
189
227
|
setSearchQuery,
|
|
228
|
+
setSiteContentSort,
|
|
229
|
+
siteContentSort,
|
|
190
230
|
statusFilters,
|
|
191
231
|
toggleStatusFilter,
|
|
192
232
|
unregisterSection
|
|
193
233
|
}),
|
|
194
234
|
[
|
|
235
|
+
clearActiveToolbarFilters,
|
|
236
|
+
clearSiteContentSort,
|
|
195
237
|
clearStatusFilters,
|
|
196
238
|
registerSection,
|
|
197
239
|
requestCreate,
|
|
198
240
|
searchQuery,
|
|
241
|
+
siteContentSort,
|
|
242
|
+
setSiteContentSort,
|
|
199
243
|
statusFilters,
|
|
200
244
|
toggleStatusFilter,
|
|
201
245
|
unregisterSection
|
|
@@ -218,20 +262,20 @@ var import_react2 = require("react");
|
|
|
218
262
|
|
|
219
263
|
// src/api/post.ts
|
|
220
264
|
var import_api_fetch = __toESM(require("@wordpress/api-fetch"));
|
|
221
|
-
var
|
|
265
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
222
266
|
var postTypesMap = {
|
|
223
267
|
page: {
|
|
224
268
|
labels: {
|
|
225
|
-
singular_name: (0,
|
|
226
|
-
plural_name: (0,
|
|
269
|
+
singular_name: (0, import_i18n3.__)("Page", "elementor"),
|
|
270
|
+
plural_name: (0, import_i18n3.__)("Pages", "elementor")
|
|
227
271
|
},
|
|
228
272
|
rest_base: "pages",
|
|
229
273
|
createCapability: "edit_pages"
|
|
230
274
|
},
|
|
231
275
|
post: {
|
|
232
276
|
labels: {
|
|
233
|
-
singular_name: (0,
|
|
234
|
-
plural_name: (0,
|
|
277
|
+
singular_name: (0, import_i18n3.__)("Post", "elementor"),
|
|
278
|
+
plural_name: (0, import_i18n3.__)("Posts", "elementor")
|
|
235
279
|
},
|
|
236
280
|
rest_base: "posts",
|
|
237
281
|
createCapability: "edit_posts"
|
|
@@ -246,18 +290,20 @@ function getAccessiblePanelPostTypes(capabilities) {
|
|
|
246
290
|
}
|
|
247
291
|
function getCannotEditPanelItemMessage(postTypeSlug) {
|
|
248
292
|
if ("page" === postTypeSlug) {
|
|
249
|
-
return (0,
|
|
293
|
+
return (0, import_i18n3.__)("You cannot edit this page.", "elementor");
|
|
250
294
|
}
|
|
251
|
-
return (0,
|
|
295
|
+
return (0, import_i18n3.__)("You cannot edit this post.", "elementor");
|
|
252
296
|
}
|
|
253
297
|
var POST_PER_PAGE = 10;
|
|
254
298
|
var COUNT_QUERY_PER_PAGE = 1;
|
|
255
|
-
var getRequest = async (postTypeSlug, page, search = "", status = "any", perPage = POST_PER_PAGE) => {
|
|
299
|
+
var getRequest = async (postTypeSlug, page, search = "", status = "any", perPage = POST_PER_PAGE, sort = DEFAULT_SITE_CONTENT_SORT) => {
|
|
256
300
|
const baseUri = `/wp/v2/${postTypesMap[postTypeSlug].rest_base}`;
|
|
257
301
|
const keys = ["id", "type", "title", "link", "status", "user_can"];
|
|
302
|
+
const { order, orderby } = getRestOrderForSiteContentSort(sort);
|
|
258
303
|
const queryParams = new URLSearchParams({
|
|
259
304
|
status,
|
|
260
|
-
order
|
|
305
|
+
order,
|
|
306
|
+
orderby,
|
|
261
307
|
page: page.toString(),
|
|
262
308
|
per_page: perPage.toString(),
|
|
263
309
|
_fields: keys.join(",")
|
|
@@ -443,7 +489,7 @@ var contentPanelListItemButtonSx = {
|
|
|
443
489
|
var React3 = __toESM(require("react"));
|
|
444
490
|
var import_icons3 = require("@elementor/icons");
|
|
445
491
|
var import_ui2 = require("@elementor/ui");
|
|
446
|
-
var
|
|
492
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
447
493
|
|
|
448
494
|
// src/hooks/use-can-create.ts
|
|
449
495
|
function useCanCreate(postTypeSlug) {
|
|
@@ -491,7 +537,7 @@ function ContentPanelHeaderAdd() {
|
|
|
491
537
|
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
492
538
|
ContentPanelAddIconButton,
|
|
493
539
|
{
|
|
494
|
-
"aria-label": (0,
|
|
540
|
+
"aria-label": (0, import_i18n4.__)("Add new", "elementor"),
|
|
495
541
|
...buttonProps,
|
|
496
542
|
disabled: !canAddAny
|
|
497
543
|
}
|
|
@@ -499,13 +545,13 @@ function ContentPanelHeaderAdd() {
|
|
|
499
545
|
}
|
|
500
546
|
|
|
501
547
|
// src/components/panel/content-panel-toolbar.tsx
|
|
502
|
-
var
|
|
503
|
-
var
|
|
548
|
+
var React11 = __toESM(require("react"));
|
|
549
|
+
var import_ui10 = require("@elementor/ui");
|
|
504
550
|
|
|
505
551
|
// src/components/panel/content-panel-active-filters.tsx
|
|
506
552
|
var React5 = __toESM(require("react"));
|
|
507
553
|
var import_ui4 = require("@elementor/ui");
|
|
508
|
-
var
|
|
554
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
509
555
|
|
|
510
556
|
// src/components/panel/content-panel-clear-filters-button.tsx
|
|
511
557
|
var React4 = __toESM(require("react"));
|
|
@@ -526,12 +572,22 @@ var contentPanelFilterChipSx = {
|
|
|
526
572
|
}
|
|
527
573
|
};
|
|
528
574
|
function ContentPanelActiveFilters() {
|
|
529
|
-
const {
|
|
530
|
-
|
|
575
|
+
const { clearActiveToolbarFilters, setSiteContentSort, siteContentSort, statusFilters, toggleStatusFilter } = useContentPanelCoordinator();
|
|
576
|
+
const hasStatusFilters = hasActiveSiteContentStatusFilters(statusFilters);
|
|
577
|
+
const hasSort = hasActiveSiteContentSort(siteContentSort);
|
|
578
|
+
if (!hasStatusFilters && !hasSort) {
|
|
531
579
|
return null;
|
|
532
580
|
}
|
|
533
581
|
const activeKeys = getActiveSiteContentStatusFilterKeys(statusFilters);
|
|
534
|
-
return /* @__PURE__ */ React5.createElement(import_ui4.Stack, { alignItems: "center", direction: "row", justifyContent: "space-between" }, /* @__PURE__ */ React5.createElement(import_ui4.Stack, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 0.5 },
|
|
582
|
+
return /* @__PURE__ */ React5.createElement(import_ui4.Stack, { alignItems: "center", direction: "row", justifyContent: "space-between" }, /* @__PURE__ */ React5.createElement(import_ui4.Stack, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 0.5 }, hasSort && /* @__PURE__ */ React5.createElement(
|
|
583
|
+
import_ui4.Chip,
|
|
584
|
+
{
|
|
585
|
+
label: getSiteContentSortLabel(siteContentSort),
|
|
586
|
+
onDelete: () => setSiteContentSort(DEFAULT_SITE_CONTENT_SORT),
|
|
587
|
+
size: "tiny",
|
|
588
|
+
sx: contentPanelFilterChipSx
|
|
589
|
+
}
|
|
590
|
+
), activeKeys.map((key) => /* @__PURE__ */ React5.createElement(
|
|
535
591
|
import_ui4.Chip,
|
|
536
592
|
{
|
|
537
593
|
key,
|
|
@@ -543,10 +599,10 @@ function ContentPanelActiveFilters() {
|
|
|
543
599
|
))), /* @__PURE__ */ React5.createElement(
|
|
544
600
|
ContentPanelClearFiltersButton,
|
|
545
601
|
{
|
|
546
|
-
ariaLabel: (0,
|
|
547
|
-
onClear:
|
|
602
|
+
ariaLabel: (0, import_i18n5.__)("Clear Filters", "elementor"),
|
|
603
|
+
onClear: clearActiveToolbarFilters,
|
|
548
604
|
sx: { margin: "0 0 auto auto" },
|
|
549
|
-
tooltipText: (0,
|
|
605
|
+
tooltipText: (0, import_i18n5.__)("Clear Filters", "elementor")
|
|
550
606
|
}
|
|
551
607
|
));
|
|
552
608
|
}
|
|
@@ -555,19 +611,19 @@ function ContentPanelActiveFilters() {
|
|
|
555
611
|
var React6 = __toESM(require("react"));
|
|
556
612
|
var import_icons5 = require("@elementor/icons");
|
|
557
613
|
var import_ui5 = require("@elementor/ui");
|
|
558
|
-
var
|
|
614
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
559
615
|
function ContentPanelSearch() {
|
|
560
616
|
const { searchQuery, setSearchQuery } = useContentPanelCoordinator();
|
|
561
|
-
return /* @__PURE__ */ React6.createElement(import_ui5.Box, { component: "search", "aria-label": (0,
|
|
617
|
+
return /* @__PURE__ */ React6.createElement(import_ui5.Box, { component: "search", "aria-label": (0, import_i18n6.__)("Search site content", "elementor") }, /* @__PURE__ */ React6.createElement(
|
|
562
618
|
import_ui5.TextField,
|
|
563
619
|
{
|
|
564
620
|
fullWidth: true,
|
|
565
621
|
size: "tiny",
|
|
566
622
|
value: searchQuery,
|
|
567
|
-
placeholder: (0,
|
|
623
|
+
placeholder: (0, import_i18n6.__)("Search", "elementor"),
|
|
568
624
|
onChange: (event) => setSearchQuery(event.target.value),
|
|
569
625
|
inputProps: {
|
|
570
|
-
"aria-label": (0,
|
|
626
|
+
"aria-label": (0, import_i18n6.__)("Search", "elementor")
|
|
571
627
|
},
|
|
572
628
|
InputProps: {
|
|
573
629
|
startAdornment: /* @__PURE__ */ React6.createElement(import_ui5.InputAdornment, { position: "start" }, /* @__PURE__ */ React6.createElement(import_icons5.SearchIcon, { fontSize: "tiny" }))
|
|
@@ -576,17 +632,105 @@ function ContentPanelSearch() {
|
|
|
576
632
|
));
|
|
577
633
|
}
|
|
578
634
|
|
|
579
|
-
// src/components/panel/content-panel-
|
|
635
|
+
// src/components/panel/content-panel-sort.tsx
|
|
580
636
|
var React8 = __toESM(require("react"));
|
|
581
637
|
var import_editor_ui = require("@elementor/editor-ui");
|
|
582
638
|
var import_icons7 = require("@elementor/icons");
|
|
583
639
|
var import_ui7 = require("@elementor/ui");
|
|
584
|
-
var
|
|
640
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
585
641
|
|
|
586
|
-
// src/components/panel/content-panel-
|
|
642
|
+
// src/components/panel/content-panel-sort-list.tsx
|
|
587
643
|
var React7 = __toESM(require("react"));
|
|
588
644
|
var import_icons6 = require("@elementor/icons");
|
|
589
645
|
var import_ui6 = require("@elementor/ui");
|
|
646
|
+
var renderSortMenuItemContent = (label, selected) => /* @__PURE__ */ React7.createElement(import_ui6.Stack, { alignItems: "center", direction: "row", gap: 1, width: "100%" }, /* @__PURE__ */ React7.createElement(import_ui6.Typography, { sx: { color: "text.secondary", flex: 1 }, variant: "caption" }, label), selected ? /* @__PURE__ */ React7.createElement(import_icons6.CheckIcon, { "aria-hidden": true, fontSize: "tiny" }) : null);
|
|
647
|
+
function ContentPanelSortList() {
|
|
648
|
+
const { setSiteContentSort, siteContentSort } = useContentPanelCoordinator();
|
|
649
|
+
return /* @__PURE__ */ React7.createElement(import_ui6.MenuList, { dense: true }, SITE_CONTENT_SORT_OPTIONS.map((option) => {
|
|
650
|
+
const isSelected = siteContentSort === option;
|
|
651
|
+
return /* @__PURE__ */ React7.createElement(
|
|
652
|
+
import_ui6.MenuItem,
|
|
653
|
+
{
|
|
654
|
+
key: option,
|
|
655
|
+
"aria-checked": isSelected,
|
|
656
|
+
onClick: () => setSiteContentSort(option),
|
|
657
|
+
role: "menuitemradio",
|
|
658
|
+
selected: isSelected
|
|
659
|
+
},
|
|
660
|
+
renderSortMenuItemContent(getSiteContentSortLabel(option), isSelected)
|
|
661
|
+
);
|
|
662
|
+
}));
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// src/components/panel/content-panel-sort.tsx
|
|
666
|
+
function ContentPanelSort() {
|
|
667
|
+
const { clearSiteContentSort, siteContentSort } = useContentPanelCoordinator();
|
|
668
|
+
const popupState = (0, import_ui7.usePopupState)({
|
|
669
|
+
variant: "popover",
|
|
670
|
+
disableAutoFocus: true
|
|
671
|
+
});
|
|
672
|
+
const hasActiveSort = hasActiveSiteContentSort(siteContentSort);
|
|
673
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(import_ui7.Tooltip, { placement: "top", title: (0, import_i18n7.__)("Sort", "elementor") }, /* @__PURE__ */ React8.createElement(
|
|
674
|
+
import_ui7.ToggleButton,
|
|
675
|
+
{
|
|
676
|
+
"aria-label": (0, import_i18n7.__)("Sort", "elementor"),
|
|
677
|
+
selected: popupState.isOpen || hasActiveSort,
|
|
678
|
+
size: "tiny",
|
|
679
|
+
value: "sort",
|
|
680
|
+
...(0, import_ui7.bindToggle)(popupState)
|
|
681
|
+
},
|
|
682
|
+
/* @__PURE__ */ React8.createElement(import_icons7.ArrowsSortIcon, { fontSize: "tiny" })
|
|
683
|
+
)), /* @__PURE__ */ React8.createElement(
|
|
684
|
+
import_ui7.Popover,
|
|
685
|
+
{
|
|
686
|
+
anchorOrigin: {
|
|
687
|
+
horizontal: "right",
|
|
688
|
+
vertical: "top"
|
|
689
|
+
},
|
|
690
|
+
sx: {
|
|
691
|
+
maxWidth: `${SITE_CONTENT_SORT_POPOVER_WIDTH_PX}px`
|
|
692
|
+
},
|
|
693
|
+
transformOrigin: {
|
|
694
|
+
horizontal: -21,
|
|
695
|
+
vertical: "top"
|
|
696
|
+
},
|
|
697
|
+
...(0, import_ui7.bindPopover)(popupState)
|
|
698
|
+
},
|
|
699
|
+
/* @__PURE__ */ React8.createElement(
|
|
700
|
+
import_editor_ui.PopoverHeader,
|
|
701
|
+
{
|
|
702
|
+
actions: hasActiveSort ? [
|
|
703
|
+
/* @__PURE__ */ React8.createElement(
|
|
704
|
+
ContentPanelClearFiltersButton,
|
|
705
|
+
{
|
|
706
|
+
ariaLabel: (0, import_i18n7.__)("Clear sort", "elementor"),
|
|
707
|
+
key: "clear-sort",
|
|
708
|
+
onClear: clearSiteContentSort,
|
|
709
|
+
tooltipText: (0, import_i18n7.__)("Clear sort", "elementor")
|
|
710
|
+
}
|
|
711
|
+
)
|
|
712
|
+
] : [],
|
|
713
|
+
icon: /* @__PURE__ */ React8.createElement(import_icons7.ArrowsSortIcon, { fontSize: "tiny" }),
|
|
714
|
+
onClose: popupState.close,
|
|
715
|
+
title: (0, import_i18n7.__)("Sort", "elementor")
|
|
716
|
+
}
|
|
717
|
+
),
|
|
718
|
+
/* @__PURE__ */ React8.createElement(import_ui7.Divider, { sx: { borderWidth: "1px 0 0 0" } }),
|
|
719
|
+
/* @__PURE__ */ React8.createElement(import_editor_ui.PopoverBody, { height: "auto", width: SITE_CONTENT_SORT_POPOVER_WIDTH_PX }, /* @__PURE__ */ React8.createElement(ContentPanelSortList, null))
|
|
720
|
+
));
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// src/components/panel/content-panel-status-filter.tsx
|
|
724
|
+
var React10 = __toESM(require("react"));
|
|
725
|
+
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
726
|
+
var import_icons9 = require("@elementor/icons");
|
|
727
|
+
var import_ui9 = require("@elementor/ui");
|
|
728
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
729
|
+
|
|
730
|
+
// src/components/panel/content-panel-status-filter-list.tsx
|
|
731
|
+
var React9 = __toESM(require("react"));
|
|
732
|
+
var import_icons8 = require("@elementor/icons");
|
|
733
|
+
var import_ui8 = require("@elementor/ui");
|
|
590
734
|
|
|
591
735
|
// src/hooks/use-site-content-status-filter-counts.ts
|
|
592
736
|
var import_query2 = require("@elementor/query");
|
|
@@ -628,7 +772,7 @@ function useSiteContentStatusFilterCounts(postTypes, enabled) {
|
|
|
628
772
|
}
|
|
629
773
|
|
|
630
774
|
// src/components/panel/content-panel-status-filter-list.tsx
|
|
631
|
-
var renderFilterMenuItemContent = (label, selected) => /* @__PURE__ */
|
|
775
|
+
var renderFilterMenuItemContent = (label, selected) => /* @__PURE__ */ React9.createElement(import_ui8.Stack, { alignItems: "center", direction: "row", gap: 1, width: "100%" }, /* @__PURE__ */ React9.createElement(import_ui8.Typography, { sx: { color: "text.secondary", flex: 1 }, variant: "caption" }, label), selected ? /* @__PURE__ */ React9.createElement(import_icons8.CheckIcon, { "aria-hidden": true, fontSize: "tiny" }) : null);
|
|
632
776
|
function ContentPanelStatusFilterList({ loadCounts }) {
|
|
633
777
|
const { clearStatusFilters, statusFilters, toggleStatusFilter } = useContentPanelCoordinator();
|
|
634
778
|
const { accessiblePostTypes } = useAccessiblePanelPostTypes();
|
|
@@ -640,8 +784,8 @@ function ContentPanelStatusFilterList({ loadCounts }) {
|
|
|
640
784
|
const visibleFilters = SITE_CONTENT_SELECTABLE_STATUS_FILTERS.filter(
|
|
641
785
|
(filter) => shouldShowSiteContentStatusFilterRow(statusCounts?.[filter], isLoadingCounts, statusFilters[filter])
|
|
642
786
|
);
|
|
643
|
-
return /* @__PURE__ */
|
|
644
|
-
|
|
787
|
+
return /* @__PURE__ */ React9.createElement(import_ui8.MenuList, { dense: true }, /* @__PURE__ */ React9.createElement(
|
|
788
|
+
import_ui8.MenuItem,
|
|
645
789
|
{
|
|
646
790
|
"aria-checked": isAllSelected,
|
|
647
791
|
onClick: clearStatusFilters,
|
|
@@ -651,8 +795,8 @@ function ContentPanelStatusFilterList({ loadCounts }) {
|
|
|
651
795
|
renderFilterMenuItemContent(SITE_CONTENT_ALL_FILTER_LABEL, isAllSelected)
|
|
652
796
|
), visibleFilters.map((filter) => {
|
|
653
797
|
const isSelected = statusFilters[filter];
|
|
654
|
-
return /* @__PURE__ */
|
|
655
|
-
|
|
798
|
+
return /* @__PURE__ */ React9.createElement(
|
|
799
|
+
import_ui8.MenuItem,
|
|
656
800
|
{
|
|
657
801
|
key: filter,
|
|
658
802
|
"aria-checked": isSelected,
|
|
@@ -668,23 +812,23 @@ function ContentPanelStatusFilterList({ loadCounts }) {
|
|
|
668
812
|
// src/components/panel/content-panel-status-filter.tsx
|
|
669
813
|
function ContentPanelStatusFilter() {
|
|
670
814
|
const { clearStatusFilters, statusFilters } = useContentPanelCoordinator();
|
|
671
|
-
const popupState = (0,
|
|
815
|
+
const popupState = (0, import_ui9.usePopupState)({
|
|
672
816
|
variant: "popover",
|
|
673
817
|
disableAutoFocus: true
|
|
674
818
|
});
|
|
675
819
|
const hasActiveFilters = hasActiveSiteContentStatusFilters(statusFilters);
|
|
676
|
-
return /* @__PURE__ */
|
|
677
|
-
|
|
820
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(import_ui9.Tooltip, { placement: "top", title: (0, import_i18n8.__)("Filters", "elementor") }, /* @__PURE__ */ React10.createElement(
|
|
821
|
+
import_ui9.ToggleButton,
|
|
678
822
|
{
|
|
679
|
-
"aria-label": (0,
|
|
823
|
+
"aria-label": (0, import_i18n8.__)("Filters", "elementor"),
|
|
680
824
|
selected: popupState.isOpen || hasActiveFilters,
|
|
681
825
|
size: "tiny",
|
|
682
826
|
value: "filter",
|
|
683
|
-
...(0,
|
|
827
|
+
...(0, import_ui9.bindToggle)(popupState)
|
|
684
828
|
},
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
)), /* @__PURE__ */
|
|
687
|
-
|
|
829
|
+
/* @__PURE__ */ React10.createElement(import_icons9.FilterIcon, { fontSize: "tiny" })
|
|
830
|
+
)), /* @__PURE__ */ React10.createElement(
|
|
831
|
+
import_ui9.Popover,
|
|
688
832
|
{
|
|
689
833
|
anchorOrigin: {
|
|
690
834
|
horizontal: "right",
|
|
@@ -697,43 +841,43 @@ function ContentPanelStatusFilter() {
|
|
|
697
841
|
horizontal: -21,
|
|
698
842
|
vertical: "top"
|
|
699
843
|
},
|
|
700
|
-
...(0,
|
|
844
|
+
...(0, import_ui9.bindPopover)(popupState)
|
|
701
845
|
},
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
|
|
846
|
+
/* @__PURE__ */ React10.createElement(
|
|
847
|
+
import_editor_ui2.PopoverHeader,
|
|
704
848
|
{
|
|
705
849
|
actions: hasActiveFilters ? [
|
|
706
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ React10.createElement(
|
|
707
851
|
ContentPanelClearFiltersButton,
|
|
708
852
|
{
|
|
709
|
-
ariaLabel: (0,
|
|
853
|
+
ariaLabel: (0, import_i18n8.__)("Clear all", "elementor"),
|
|
710
854
|
key: "clear-all-filters",
|
|
711
855
|
onClear: clearStatusFilters,
|
|
712
|
-
tooltipText: (0,
|
|
856
|
+
tooltipText: (0, import_i18n8.__)("Clear all", "elementor")
|
|
713
857
|
}
|
|
714
858
|
)
|
|
715
859
|
] : [],
|
|
716
|
-
icon: /* @__PURE__ */
|
|
860
|
+
icon: /* @__PURE__ */ React10.createElement(import_icons9.FilterIcon, { fontSize: "tiny" }),
|
|
717
861
|
onClose: popupState.close,
|
|
718
|
-
title: (0,
|
|
862
|
+
title: (0, import_i18n8.__)("Filters", "elementor")
|
|
719
863
|
}
|
|
720
864
|
),
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ React10.createElement(import_ui9.Divider, { sx: { borderWidth: "1px 0 0 0" } }),
|
|
866
|
+
/* @__PURE__ */ React10.createElement(import_editor_ui2.PopoverBody, { height: "auto", width: SITE_CONTENT_FILTER_POPOVER_WIDTH_PX }, /* @__PURE__ */ React10.createElement(ContentPanelStatusFilterList, { loadCounts: popupState.isOpen }))
|
|
723
867
|
));
|
|
724
868
|
}
|
|
725
869
|
|
|
726
870
|
// src/components/panel/content-panel-toolbar.tsx
|
|
727
871
|
function ContentPanelToolbar() {
|
|
728
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: contentPanelSearchBoxSx }, /* @__PURE__ */ React11.createElement(import_ui10.Stack, { gap: 0.75, width: "100%" }, /* @__PURE__ */ React11.createElement(import_ui10.Stack, { alignItems: "center", direction: "row", gap: 0.5, width: "100%" }, /* @__PURE__ */ React11.createElement(import_ui10.Box, { 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)));
|
|
729
873
|
}
|
|
730
874
|
|
|
731
875
|
// src/components/panel/error-snackbar.tsx
|
|
732
|
-
var
|
|
733
|
-
var
|
|
876
|
+
var React12 = __toESM(require("react"));
|
|
877
|
+
var import_ui11 = require("@elementor/ui");
|
|
734
878
|
var ErrorSnackbar = ({ open, onClose }) => {
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
|
|
879
|
+
return /* @__PURE__ */ React12.createElement(
|
|
880
|
+
import_ui11.Snackbar,
|
|
737
881
|
{
|
|
738
882
|
open,
|
|
739
883
|
onClose,
|
|
@@ -742,8 +886,8 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
742
886
|
horizontal: "left"
|
|
743
887
|
}
|
|
744
888
|
},
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
|
|
889
|
+
/* @__PURE__ */ React12.createElement(import_ui11.Alert, { onClose, severity: "error", sx: { width: "100%" } }, /* @__PURE__ */ React12.createElement(
|
|
890
|
+
import_ui11.Typography,
|
|
747
891
|
{
|
|
748
892
|
component: "span",
|
|
749
893
|
sx: {
|
|
@@ -757,11 +901,11 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
757
901
|
var error_snackbar_default = ErrorSnackbar;
|
|
758
902
|
|
|
759
903
|
// src/components/panel/shell-panel-body-content.tsx
|
|
760
|
-
var
|
|
761
|
-
var
|
|
904
|
+
var React35 = __toESM(require("react"));
|
|
905
|
+
var import_ui24 = require("@elementor/ui");
|
|
762
906
|
|
|
763
907
|
// src/contexts/post-list-context.tsx
|
|
764
|
-
var
|
|
908
|
+
var React13 = __toESM(require("react"));
|
|
765
909
|
var import_react3 = require("react");
|
|
766
910
|
var defaultValues = {
|
|
767
911
|
type: "page",
|
|
@@ -780,7 +924,7 @@ var PostListContextProvider = ({
|
|
|
780
924
|
const resetEditMode = () => {
|
|
781
925
|
setEditMode(defaultValues.editMode);
|
|
782
926
|
};
|
|
783
|
-
return /* @__PURE__ */
|
|
927
|
+
return /* @__PURE__ */ React13.createElement(
|
|
784
928
|
PostListContext.Provider,
|
|
785
929
|
{
|
|
786
930
|
value: {
|
|
@@ -803,10 +947,10 @@ function usePostListContext() {
|
|
|
803
947
|
}
|
|
804
948
|
|
|
805
949
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
806
|
-
var
|
|
950
|
+
var React33 = __toESM(require("react"));
|
|
807
951
|
var import_react10 = require("react");
|
|
808
|
-
var
|
|
809
|
-
var
|
|
952
|
+
var import_ui22 = require("@elementor/ui");
|
|
953
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
810
954
|
|
|
811
955
|
// src/hooks/use-homepage.ts
|
|
812
956
|
var import_query3 = require("@elementor/query");
|
|
@@ -902,27 +1046,30 @@ function usePostListPagination({
|
|
|
902
1046
|
// src/hooks/use-posts.ts
|
|
903
1047
|
var import_query4 = require("@elementor/query");
|
|
904
1048
|
var postsQueryKeyBase = (postTypeSlug) => ["site-navigation", "posts", postTypeSlug];
|
|
905
|
-
var postsQueryKey = (postTypeSlug, trimmedSearch = "", restStatus = "any") => [
|
|
906
|
-
...postsQueryKeyBase(postTypeSlug),
|
|
907
|
-
restStatus,
|
|
908
|
-
trimmedSearch
|
|
909
|
-
];
|
|
1049
|
+
var postsQueryKey = (postTypeSlug, trimmedSearch = "", restStatus = "any", sort = DEFAULT_SITE_CONTENT_SORT) => [...postsQueryKeyBase(postTypeSlug), restStatus, trimmedSearch, sort];
|
|
910
1050
|
var flattenData = (data) => {
|
|
911
1051
|
if (!data) {
|
|
912
1052
|
return data;
|
|
913
1053
|
}
|
|
914
1054
|
const flattened = [];
|
|
1055
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
915
1056
|
data.pages.forEach((page) => {
|
|
916
|
-
|
|
1057
|
+
page.data.forEach((post) => {
|
|
1058
|
+
if (seenIds.has(post.id)) {
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
seenIds.add(post.id);
|
|
1062
|
+
flattened.push(post);
|
|
1063
|
+
});
|
|
917
1064
|
});
|
|
918
1065
|
return flattened;
|
|
919
1066
|
};
|
|
920
|
-
function usePosts(postTypeSlug, search = "", statusFilters = EMPTY_SITE_CONTENT_STATUS_FILTERS) {
|
|
1067
|
+
function usePosts(postTypeSlug, search = "", statusFilters = EMPTY_SITE_CONTENT_STATUS_FILTERS, sort = DEFAULT_SITE_CONTENT_SORT) {
|
|
921
1068
|
const trimmedSearch = search.trim();
|
|
922
1069
|
const restStatus = getRestStatusForSiteContentFilters(statusFilters);
|
|
923
1070
|
const query = (0, import_query4.useInfiniteQuery)({
|
|
924
|
-
queryKey: postsQueryKey(postTypeSlug, trimmedSearch, restStatus),
|
|
925
|
-
queryFn: ({ pageParam = 1 }) => getRequest(postTypeSlug, pageParam, trimmedSearch, restStatus),
|
|
1071
|
+
queryKey: postsQueryKey(postTypeSlug, trimmedSearch, restStatus, sort),
|
|
1072
|
+
queryFn: ({ pageParam = 1 }) => getRequest(postTypeSlug, pageParam, trimmedSearch, restStatus, POST_PER_PAGE, sort),
|
|
926
1073
|
initialPageParam: 1,
|
|
927
1074
|
getNextPageParam: (lastPage) => {
|
|
928
1075
|
return lastPage.currentPage < lastPage.totalPages ? lastPage.currentPage + 1 : void 0;
|
|
@@ -952,18 +1099,18 @@ function usePostsBaselineTotal(postTypeSlug, enabled, status = "any") {
|
|
|
952
1099
|
}
|
|
953
1100
|
|
|
954
1101
|
// src/components/panel/section-add-button.tsx
|
|
955
|
-
var
|
|
956
|
-
var
|
|
1102
|
+
var React14 = __toESM(require("react"));
|
|
1103
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
957
1104
|
function SectionAddButton({ onBeforeCreate }) {
|
|
958
1105
|
const { type, setEditMode } = usePostListContext();
|
|
959
1106
|
const canCreate = useCanCreate(type);
|
|
960
1107
|
const singularName = postTypesMap[type].labels.singular_name;
|
|
961
|
-
const ariaLabel = (0,
|
|
1108
|
+
const ariaLabel = (0, import_i18n9.sprintf)(
|
|
962
1109
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
963
|
-
(0,
|
|
1110
|
+
(0, import_i18n9.__)("New %s", "elementor"),
|
|
964
1111
|
singularName
|
|
965
1112
|
);
|
|
966
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ React14.createElement(
|
|
967
1114
|
ContentPanelAddIconButton,
|
|
968
1115
|
{
|
|
969
1116
|
"aria-label": ariaLabel,
|
|
@@ -978,10 +1125,10 @@ function SectionAddButton({ onBeforeCreate }) {
|
|
|
978
1125
|
}
|
|
979
1126
|
|
|
980
1127
|
// src/components/panel/posts-list/collapsible-list.tsx
|
|
981
|
-
var
|
|
1128
|
+
var React15 = __toESM(require("react"));
|
|
982
1129
|
var import_react5 = require("react");
|
|
983
|
-
var
|
|
984
|
-
var
|
|
1130
|
+
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1131
|
+
var import_ui12 = require("@elementor/ui");
|
|
985
1132
|
var sectionHeaderListItemButtonSx = {
|
|
986
1133
|
flexGrow: 1,
|
|
987
1134
|
justifyContent: "flex-start",
|
|
@@ -1010,8 +1157,8 @@ function CollapsibleList({
|
|
|
1010
1157
|
const chipLabel = countChipLabel ?? count.toString();
|
|
1011
1158
|
const sectionHeaderAriaLabel = getSectionHeaderAriaLabel(title, chipLabel);
|
|
1012
1159
|
const handleClick = () => onOpenChange(!isOpen);
|
|
1013
|
-
return /* @__PURE__ */
|
|
1014
|
-
|
|
1160
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
1161
|
+
import_ui12.Box,
|
|
1015
1162
|
{
|
|
1016
1163
|
sx: {
|
|
1017
1164
|
...contentPanelSectionHeaderSx,
|
|
@@ -1021,8 +1168,8 @@ function CollapsibleList({
|
|
|
1021
1168
|
width: "100%"
|
|
1022
1169
|
}
|
|
1023
1170
|
},
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
|
|
1171
|
+
/* @__PURE__ */ React15.createElement(
|
|
1172
|
+
import_ui12.ListItemButton,
|
|
1026
1173
|
{
|
|
1027
1174
|
ref: headerRef,
|
|
1028
1175
|
id: labelId,
|
|
@@ -1035,8 +1182,8 @@ function CollapsibleList({
|
|
|
1035
1182
|
onClick: handleClick,
|
|
1036
1183
|
sx: sectionHeaderListItemButtonSx
|
|
1037
1184
|
},
|
|
1038
|
-
/* @__PURE__ */
|
|
1039
|
-
|
|
1185
|
+
/* @__PURE__ */ React15.createElement(import_ui12.Stack, { alignItems: "center", direction: "row", flexGrow: 1, gap: 0.5, minWidth: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(import_ui12.Stack, { alignItems: "center", direction: "row", flex: 1, gap: 0.5, minWidth: 0 }, /* @__PURE__ */ React15.createElement(
|
|
1186
|
+
import_ui12.ListItemText,
|
|
1040
1187
|
{
|
|
1041
1188
|
secondary: title,
|
|
1042
1189
|
secondaryTypographyProps: {
|
|
@@ -1046,10 +1193,10 @@ function CollapsibleList({
|
|
|
1046
1193
|
},
|
|
1047
1194
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
1048
1195
|
}
|
|
1049
|
-
), /* @__PURE__ */
|
|
1196
|
+
), /* @__PURE__ */ React15.createElement(import_ui12.Chip, { label: chipLabel, size: "tiny" })), /* @__PURE__ */ React15.createElement(import_editor_ui3.CollapseIcon, { color: "secondary", fontSize: "tiny", open: isOpen, sx: { flexShrink: 0 } }))
|
|
1050
1197
|
),
|
|
1051
|
-
trailingActions && /* @__PURE__ */
|
|
1052
|
-
|
|
1198
|
+
trailingActions && /* @__PURE__ */ React15.createElement(
|
|
1199
|
+
import_ui12.Stack,
|
|
1053
1200
|
{
|
|
1054
1201
|
alignItems: "center",
|
|
1055
1202
|
direction: "row",
|
|
@@ -1059,17 +1206,17 @@ function CollapsibleList({
|
|
|
1059
1206
|
},
|
|
1060
1207
|
trailingActions
|
|
1061
1208
|
)
|
|
1062
|
-
), /* @__PURE__ */
|
|
1209
|
+
), /* @__PURE__ */ React15.createElement(import_ui12.Collapse, { "aria-labelledby": labelId, id: contentId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React15.createElement(import_ui12.List, { dense: true, disablePadding: true, sx: contentPanelListSectionListSx }, children)), /* @__PURE__ */ React15.createElement(import_ui12.Divider, null));
|
|
1063
1210
|
}
|
|
1064
1211
|
|
|
1065
1212
|
// src/components/panel/posts-list/error-state.tsx
|
|
1066
|
-
var
|
|
1067
|
-
var
|
|
1068
|
-
var
|
|
1069
|
-
var
|
|
1213
|
+
var React16 = __toESM(require("react"));
|
|
1214
|
+
var import_icons10 = require("@elementor/icons");
|
|
1215
|
+
var import_ui13 = require("@elementor/ui");
|
|
1216
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1070
1217
|
function ErrorState() {
|
|
1071
|
-
return /* @__PURE__ */
|
|
1072
|
-
|
|
1218
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1219
|
+
import_ui13.Box,
|
|
1073
1220
|
{
|
|
1074
1221
|
sx: {
|
|
1075
1222
|
display: "flex",
|
|
@@ -1080,9 +1227,9 @@ function ErrorState() {
|
|
|
1080
1227
|
gap: "16px"
|
|
1081
1228
|
}
|
|
1082
1229
|
},
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
|
|
1230
|
+
/* @__PURE__ */ React16.createElement(import_icons10.Error404TemplateIcon, null),
|
|
1231
|
+
/* @__PURE__ */ React16.createElement(
|
|
1232
|
+
import_ui13.Box,
|
|
1086
1233
|
{
|
|
1087
1234
|
sx: {
|
|
1088
1235
|
display: "flex",
|
|
@@ -1092,19 +1239,19 @@ function ErrorState() {
|
|
|
1092
1239
|
gap: "8px"
|
|
1093
1240
|
}
|
|
1094
1241
|
},
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ React16.createElement(import_ui13.Typography, { variant: "body1", color: "text.primary" }, (0, import_i18n10.__)("We couldn\u2019t display your pages.", "elementor")),
|
|
1243
|
+
/* @__PURE__ */ React16.createElement(import_ui13.Box, null, /* @__PURE__ */ React16.createElement(import_ui13.Typography, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, (0, import_i18n10.__)("It\u2019s probably a temporary issue.", "elementor")), /* @__PURE__ */ React16.createElement(import_ui13.Typography, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, (0, import_i18n10.__)("If the problem persists,", "elementor"), " ", /* @__PURE__ */ React16.createElement(import_ui13.Link, { target: "_blank", href: "https://go.elementor.com/wp-editor-support-open-ticket/" }, "Notify support")))
|
|
1097
1244
|
)
|
|
1098
1245
|
);
|
|
1099
1246
|
}
|
|
1100
1247
|
|
|
1101
1248
|
// src/components/panel/posts-list/post-list-item.tsx
|
|
1102
|
-
var
|
|
1249
|
+
var React31 = __toESM(require("react"));
|
|
1103
1250
|
|
|
1104
1251
|
// src/components/panel/posts-list/list-items/list-item-create.tsx
|
|
1105
|
-
var
|
|
1252
|
+
var React18 = __toESM(require("react"));
|
|
1106
1253
|
var import_editor_documents = require("@elementor/editor-documents");
|
|
1107
|
-
var
|
|
1254
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1108
1255
|
|
|
1109
1256
|
// src/hooks/use-posts-actions.ts
|
|
1110
1257
|
var import_query7 = require("@elementor/query");
|
|
@@ -1185,11 +1332,11 @@ function useInvalidatePosts(postTypeSlug) {
|
|
|
1185
1332
|
}
|
|
1186
1333
|
|
|
1187
1334
|
// src/components/panel/posts-list/list-items/edit-mode-template.tsx
|
|
1188
|
-
var
|
|
1335
|
+
var React17 = __toESM(require("react"));
|
|
1189
1336
|
var import_react6 = require("react");
|
|
1190
|
-
var
|
|
1191
|
-
var
|
|
1192
|
-
var
|
|
1337
|
+
var import_icons11 = require("@elementor/icons");
|
|
1338
|
+
var import_ui14 = require("@elementor/ui");
|
|
1339
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1193
1340
|
var EDIT_ROW_FOCUS_BORDER_WIDTH_PX = 2;
|
|
1194
1341
|
var EDIT_ROW_MIN_HEIGHT_PX = 36;
|
|
1195
1342
|
var editModeListItemButtonSx = {
|
|
@@ -1261,32 +1408,32 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
1261
1408
|
}
|
|
1262
1409
|
const value = e.target.value;
|
|
1263
1410
|
if (!validateInput(value)) {
|
|
1264
|
-
setInputError((0,
|
|
1411
|
+
setInputError((0, import_i18n11.__)("Name is required", "elementor"));
|
|
1265
1412
|
} else {
|
|
1266
1413
|
setInputError(null);
|
|
1267
1414
|
}
|
|
1268
1415
|
setTitle(value);
|
|
1269
1416
|
};
|
|
1270
|
-
return /* @__PURE__ */
|
|
1271
|
-
|
|
1417
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
1418
|
+
import_ui14.ListItem,
|
|
1272
1419
|
{
|
|
1273
1420
|
disablePadding: true,
|
|
1274
1421
|
sx: contentPanelListRowPaddingSx,
|
|
1275
|
-
secondaryAction: /* @__PURE__ */
|
|
1422
|
+
secondaryAction: /* @__PURE__ */ React17.createElement(CloseButton, { isLoading, closeButton })
|
|
1276
1423
|
},
|
|
1277
|
-
/* @__PURE__ */
|
|
1278
|
-
|
|
1424
|
+
/* @__PURE__ */ React17.createElement(
|
|
1425
|
+
import_ui14.Box,
|
|
1279
1426
|
{
|
|
1280
1427
|
component: "form",
|
|
1281
1428
|
onSubmit: onFormSubmit,
|
|
1282
1429
|
sx: { ...editModeListItemButtonSx, display: "flex", width: "100%" }
|
|
1283
1430
|
},
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
|
|
1431
|
+
/* @__PURE__ */ React17.createElement(import_ui14.Box, { sx: editRowIndicatorSx(!!inputError) }, /* @__PURE__ */ React17.createElement(
|
|
1432
|
+
import_ui14.Box,
|
|
1286
1433
|
{
|
|
1287
1434
|
autoFocus: true,
|
|
1288
1435
|
"aria-invalid": !!inputError,
|
|
1289
|
-
"aria-label": (0,
|
|
1436
|
+
"aria-label": (0, import_i18n11.__)("Name", "elementor"),
|
|
1290
1437
|
component: "input",
|
|
1291
1438
|
disabled: isLoading,
|
|
1292
1439
|
onBlur,
|
|
@@ -1297,11 +1444,11 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
1297
1444
|
}
|
|
1298
1445
|
))
|
|
1299
1446
|
)
|
|
1300
|
-
), inputError && /* @__PURE__ */
|
|
1447
|
+
), inputError && /* @__PURE__ */ React17.createElement(import_ui14.ListItem, { disablePadding: true, sx: contentPanelListRowPaddingSx }, /* @__PURE__ */ React17.createElement(import_ui14.ListItemText, { sx: { color: "error.main", ...contentPanelListRowTitleSx } }, inputError)));
|
|
1301
1448
|
}
|
|
1302
1449
|
function CloseButton({ isLoading, closeButton }) {
|
|
1303
1450
|
const { resetEditMode } = usePostListContext();
|
|
1304
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ React17.createElement(import_ui14.IconButton, { size: "tiny", color: "secondary", onClick: resetEditMode, ref: closeButton, disabled: isLoading }, isLoading ? /* @__PURE__ */ React17.createElement(import_ui14.CircularProgress, { size: "1rem" }) : /* @__PURE__ */ React17.createElement(import_icons11.XIcon, { fontSize: "tiny" }));
|
|
1305
1452
|
}
|
|
1306
1453
|
|
|
1307
1454
|
// src/components/panel/posts-list/list-items/list-item-create.tsx
|
|
@@ -1323,12 +1470,12 @@ function ListItemCreate() {
|
|
|
1323
1470
|
resetEditMode();
|
|
1324
1471
|
}
|
|
1325
1472
|
};
|
|
1326
|
-
const newItemLabel = (0,
|
|
1473
|
+
const newItemLabel = (0, import_i18n12.sprintf)(
|
|
1327
1474
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
1328
|
-
(0,
|
|
1475
|
+
(0, import_i18n12.__)("New %s", "elementor"),
|
|
1329
1476
|
postTypesMap[type].labels.singular_name
|
|
1330
1477
|
);
|
|
1331
|
-
return /* @__PURE__ */
|
|
1478
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1332
1479
|
EditModeTemplate,
|
|
1333
1480
|
{
|
|
1334
1481
|
postTitle: newItemLabel,
|
|
@@ -1339,9 +1486,9 @@ function ListItemCreate() {
|
|
|
1339
1486
|
}
|
|
1340
1487
|
|
|
1341
1488
|
// src/components/panel/posts-list/list-items/list-item-duplicate.tsx
|
|
1342
|
-
var
|
|
1489
|
+
var React19 = __toESM(require("react"));
|
|
1343
1490
|
var import_editor_documents2 = require("@elementor/editor-documents");
|
|
1344
|
-
var
|
|
1491
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1345
1492
|
function ListItemDuplicate() {
|
|
1346
1493
|
const { type, editMode, resetEditMode } = usePostListContext();
|
|
1347
1494
|
const navigateToDocument = (0, import_editor_documents2.__useNavigateToDocument)();
|
|
@@ -1363,10 +1510,10 @@ function ListItemDuplicate() {
|
|
|
1363
1510
|
resetEditMode();
|
|
1364
1511
|
}
|
|
1365
1512
|
};
|
|
1366
|
-
return /* @__PURE__ */
|
|
1513
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1367
1514
|
EditModeTemplate,
|
|
1368
1515
|
{
|
|
1369
|
-
postTitle: `${editMode.details.title} ${(0,
|
|
1516
|
+
postTitle: `${editMode.details.title} ${(0, import_i18n13.__)("copy", "elementor")}`,
|
|
1370
1517
|
isLoading: duplicatePost.isPending,
|
|
1371
1518
|
callback: duplicatePostCallback
|
|
1372
1519
|
}
|
|
@@ -1374,7 +1521,7 @@ function ListItemDuplicate() {
|
|
|
1374
1521
|
}
|
|
1375
1522
|
|
|
1376
1523
|
// src/components/panel/posts-list/list-items/list-item-rename.tsx
|
|
1377
|
-
var
|
|
1524
|
+
var React20 = __toESM(require("react"));
|
|
1378
1525
|
var import_editor_documents3 = require("@elementor/editor-documents");
|
|
1379
1526
|
|
|
1380
1527
|
// src/hooks/use-rename-active-document.ts
|
|
@@ -1425,20 +1572,20 @@ function ListItemRename({ post }) {
|
|
|
1425
1572
|
resetEditMode();
|
|
1426
1573
|
}
|
|
1427
1574
|
};
|
|
1428
|
-
return /* @__PURE__ */
|
|
1575
|
+
return /* @__PURE__ */ React20.createElement(EditModeTemplate, { postTitle: title, isLoading: updatePost.isPending, callback: renamePostCallback });
|
|
1429
1576
|
}
|
|
1430
1577
|
|
|
1431
1578
|
// src/components/panel/posts-list/list-items/list-item-view.tsx
|
|
1432
|
-
var
|
|
1579
|
+
var React30 = __toESM(require("react"));
|
|
1433
1580
|
var import_editor_documents5 = require("@elementor/editor-documents");
|
|
1434
|
-
var
|
|
1435
|
-
var
|
|
1436
|
-
var
|
|
1581
|
+
var import_icons19 = require("@elementor/icons");
|
|
1582
|
+
var import_ui20 = require("@elementor/ui");
|
|
1583
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
1437
1584
|
|
|
1438
1585
|
// src/components/shared/page-title-and-status.tsx
|
|
1439
|
-
var
|
|
1440
|
-
var
|
|
1441
|
-
var
|
|
1586
|
+
var React21 = __toESM(require("react"));
|
|
1587
|
+
var import_ui15 = require("@elementor/ui");
|
|
1588
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1442
1589
|
|
|
1443
1590
|
// src/hooks/use-reverse-html-entities.ts
|
|
1444
1591
|
var import_react7 = require("react");
|
|
@@ -1465,19 +1612,19 @@ function humanizeStatusSlug(status) {
|
|
|
1465
1612
|
var statusChipConfig = {
|
|
1466
1613
|
draft: {
|
|
1467
1614
|
color: "default",
|
|
1468
|
-
label: (0,
|
|
1615
|
+
label: (0, import_i18n14.__)("Draft", "elementor")
|
|
1469
1616
|
},
|
|
1470
1617
|
future: {
|
|
1471
1618
|
color: "default",
|
|
1472
|
-
label: (0,
|
|
1619
|
+
label: (0, import_i18n14.__)("Scheduled", "elementor")
|
|
1473
1620
|
},
|
|
1474
1621
|
pending: {
|
|
1475
1622
|
color: "warning",
|
|
1476
|
-
label: (0,
|
|
1623
|
+
label: (0, import_i18n14.__)("Pending Review", "elementor")
|
|
1477
1624
|
},
|
|
1478
1625
|
private: {
|
|
1479
1626
|
color: "default",
|
|
1480
|
-
label: (0,
|
|
1627
|
+
label: (0, import_i18n14.__)("Private", "elementor")
|
|
1481
1628
|
}
|
|
1482
1629
|
};
|
|
1483
1630
|
function getStatusChipConfig(status) {
|
|
@@ -1499,8 +1646,8 @@ var PageStatus = ({ status }) => {
|
|
|
1499
1646
|
}
|
|
1500
1647
|
const { color, label } = getStatusChipConfig(status);
|
|
1501
1648
|
const isKnownStatus = isKnownPanelStatus(status);
|
|
1502
|
-
return /* @__PURE__ */
|
|
1503
|
-
|
|
1649
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1650
|
+
import_ui15.Chip,
|
|
1504
1651
|
{
|
|
1505
1652
|
color,
|
|
1506
1653
|
component: "span",
|
|
@@ -1524,8 +1671,8 @@ var PageStatus = ({ status }) => {
|
|
|
1524
1671
|
};
|
|
1525
1672
|
var PageTitle = ({ title }) => {
|
|
1526
1673
|
const modifiedTitle = useReverseHtmlEntities(title);
|
|
1527
|
-
return /* @__PURE__ */
|
|
1528
|
-
|
|
1674
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1675
|
+
import_ui15.Typography,
|
|
1529
1676
|
{
|
|
1530
1677
|
component: "span",
|
|
1531
1678
|
variant: "body2",
|
|
@@ -1542,30 +1689,30 @@ var PageTitle = ({ title }) => {
|
|
|
1542
1689
|
);
|
|
1543
1690
|
};
|
|
1544
1691
|
function PageTitleAndStatus({ title, status }) {
|
|
1545
|
-
return /* @__PURE__ */
|
|
1692
|
+
return /* @__PURE__ */ React21.createElement(import_ui15.Box, { alignItems: "center", display: "flex", minWidth: 0 }, /* @__PURE__ */ React21.createElement(PageTitle, { title }), /* @__PURE__ */ React21.createElement(PageStatus, { status }));
|
|
1546
1693
|
}
|
|
1547
1694
|
|
|
1548
1695
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
1549
|
-
var
|
|
1696
|
+
var React23 = __toESM(require("react"));
|
|
1550
1697
|
var import_react8 = require("react");
|
|
1551
1698
|
var import_editor_documents4 = require("@elementor/editor-documents");
|
|
1552
|
-
var
|
|
1553
|
-
var
|
|
1554
|
-
var
|
|
1699
|
+
var import_icons12 = require("@elementor/icons");
|
|
1700
|
+
var import_ui17 = require("@elementor/ui");
|
|
1701
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
1555
1702
|
|
|
1556
1703
|
// src/components/panel/actions-menu/action-menu-item.tsx
|
|
1557
|
-
var
|
|
1558
|
-
var
|
|
1704
|
+
var React22 = __toESM(require("react"));
|
|
1705
|
+
var import_ui16 = require("@elementor/ui");
|
|
1559
1706
|
function ActionMenuItem({ description, icon: Icon, MenuItemProps, title }) {
|
|
1560
|
-
return /* @__PURE__ */
|
|
1561
|
-
|
|
1707
|
+
return /* @__PURE__ */ React22.createElement(import_ui16.MenuItem, { ...MenuItemProps }, /* @__PURE__ */ React22.createElement(
|
|
1708
|
+
import_ui16.ListItemIcon,
|
|
1562
1709
|
{
|
|
1563
1710
|
sx: {
|
|
1564
1711
|
color: "inherit"
|
|
1565
1712
|
}
|
|
1566
1713
|
},
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
), /* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ React22.createElement(Icon, null)
|
|
1715
|
+
), /* @__PURE__ */ React22.createElement(import_ui16.ListItemText, { primary: title, secondary: description }));
|
|
1569
1716
|
}
|
|
1570
1717
|
|
|
1571
1718
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
@@ -1575,18 +1722,18 @@ function Delete({ post }) {
|
|
|
1575
1722
|
const isPostActive = activeDocument?.id === post.id;
|
|
1576
1723
|
const userCanDelete = post.user_can.delete;
|
|
1577
1724
|
const isDisabled = !userCanDelete || post.isHome || isPostActive;
|
|
1578
|
-
return /* @__PURE__ */
|
|
1725
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
1579
1726
|
ActionMenuItem,
|
|
1580
1727
|
{
|
|
1581
|
-
title: (0,
|
|
1582
|
-
icon:
|
|
1728
|
+
title: (0, import_i18n15.__)("Delete", "elementor"),
|
|
1729
|
+
icon: import_icons12.TrashIcon,
|
|
1583
1730
|
MenuItemProps: {
|
|
1584
1731
|
disabled: isDisabled,
|
|
1585
1732
|
onClick: () => setIsDialogOpen(true),
|
|
1586
1733
|
sx: { "&:hover": { color: "error.main" } }
|
|
1587
1734
|
}
|
|
1588
1735
|
}
|
|
1589
|
-
), isDialogOpen && /* @__PURE__ */
|
|
1736
|
+
), isDialogOpen && /* @__PURE__ */ React23.createElement(DeleteDialog, { post, setIsDialogOpen }));
|
|
1590
1737
|
}
|
|
1591
1738
|
function DeleteDialog({
|
|
1592
1739
|
post,
|
|
@@ -1595,11 +1742,11 @@ function DeleteDialog({
|
|
|
1595
1742
|
const { type } = usePostListContext();
|
|
1596
1743
|
const { deletePost } = usePostActions(type);
|
|
1597
1744
|
const { setError } = usePostListContext();
|
|
1598
|
-
const dialogTitle = (0,
|
|
1599
|
-
const dialogBody = type === "post" ? (0,
|
|
1745
|
+
const dialogTitle = (0, import_i18n15.sprintf)((0, import_i18n15.__)('Delete "%s"?', "elementor"), post.title.rendered);
|
|
1746
|
+
const dialogBody = type === "post" ? (0, import_i18n15.__)(
|
|
1600
1747
|
"The post and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1601
1748
|
"elementor"
|
|
1602
|
-
) : (0,
|
|
1749
|
+
) : (0, import_i18n15.__)(
|
|
1603
1750
|
"The page and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1604
1751
|
"elementor"
|
|
1605
1752
|
);
|
|
@@ -1617,22 +1764,22 @@ function DeleteDialog({
|
|
|
1617
1764
|
}
|
|
1618
1765
|
setIsDialogOpen(false);
|
|
1619
1766
|
};
|
|
1620
|
-
return /* @__PURE__ */
|
|
1621
|
-
|
|
1767
|
+
return /* @__PURE__ */ React23.createElement(import_ui17.Dialog, { open: true, onClose: handleCancel, "aria-labelledby": "delete-dialog" }, /* @__PURE__ */ React23.createElement(import_ui17.DialogTitle, { noWrap: true }, dialogTitle), /* @__PURE__ */ React23.createElement(import_ui17.Divider, null), /* @__PURE__ */ React23.createElement(import_ui17.DialogContent, null, /* @__PURE__ */ React23.createElement(import_ui17.DialogContentText, null, dialogBody)), /* @__PURE__ */ React23.createElement(import_ui17.DialogActions, null, /* @__PURE__ */ React23.createElement(
|
|
1768
|
+
import_ui17.Button,
|
|
1622
1769
|
{
|
|
1623
1770
|
variant: "contained",
|
|
1624
1771
|
color: "secondary",
|
|
1625
1772
|
onClick: handleCancel,
|
|
1626
1773
|
disabled: deletePost.isPending
|
|
1627
1774
|
},
|
|
1628
|
-
(0,
|
|
1629
|
-
), /* @__PURE__ */
|
|
1775
|
+
(0, import_i18n15.__)("Cancel", "elementor")
|
|
1776
|
+
), /* @__PURE__ */ React23.createElement(import_ui17.Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? (0, import_i18n15.__)("Delete", "elementor") : /* @__PURE__ */ React23.createElement(import_ui17.CircularProgress, null))));
|
|
1630
1777
|
}
|
|
1631
1778
|
|
|
1632
1779
|
// src/components/panel/actions-menu/actions/duplicate.tsx
|
|
1633
|
-
var
|
|
1634
|
-
var
|
|
1635
|
-
var
|
|
1780
|
+
var React24 = __toESM(require("react"));
|
|
1781
|
+
var import_icons13 = require("@elementor/icons");
|
|
1782
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1636
1783
|
function Duplicate({ post, popupState }) {
|
|
1637
1784
|
const { setEditMode, type } = usePostListContext();
|
|
1638
1785
|
const canCreate = useCanCreate(type);
|
|
@@ -1647,11 +1794,11 @@ function Duplicate({ post, popupState }) {
|
|
|
1647
1794
|
});
|
|
1648
1795
|
};
|
|
1649
1796
|
const isDisabled = !canCreate;
|
|
1650
|
-
return /* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1651
1798
|
ActionMenuItem,
|
|
1652
1799
|
{
|
|
1653
|
-
title: (0,
|
|
1654
|
-
icon:
|
|
1800
|
+
title: (0, import_i18n16.__)("Duplicate", "elementor"),
|
|
1801
|
+
icon: import_icons13.CopyIcon,
|
|
1655
1802
|
MenuItemProps: {
|
|
1656
1803
|
disabled: isDisabled,
|
|
1657
1804
|
onClick
|
|
@@ -1661,25 +1808,25 @@ function Duplicate({ post, popupState }) {
|
|
|
1661
1808
|
}
|
|
1662
1809
|
|
|
1663
1810
|
// src/components/panel/actions-menu/actions/force-delete.tsx
|
|
1664
|
-
var
|
|
1811
|
+
var React25 = __toESM(require("react"));
|
|
1665
1812
|
var import_react9 = require("react");
|
|
1666
|
-
var
|
|
1667
|
-
var
|
|
1668
|
-
var
|
|
1813
|
+
var import_icons14 = require("@elementor/icons");
|
|
1814
|
+
var import_ui18 = require("@elementor/ui");
|
|
1815
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
1669
1816
|
function ForceDelete({ post }) {
|
|
1670
1817
|
const [isDialogOpen, setIsDialogOpen] = (0, import_react9.useState)(false);
|
|
1671
|
-
return /* @__PURE__ */
|
|
1818
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
|
|
1672
1819
|
ActionMenuItem,
|
|
1673
1820
|
{
|
|
1674
|
-
icon:
|
|
1821
|
+
icon: import_icons14.TrashIcon,
|
|
1675
1822
|
MenuItemProps: {
|
|
1676
1823
|
disabled: !post.user_can.delete,
|
|
1677
1824
|
onClick: () => setIsDialogOpen(true),
|
|
1678
1825
|
sx: { "&:hover": { color: "error.main" } }
|
|
1679
1826
|
},
|
|
1680
|
-
title: (0,
|
|
1827
|
+
title: (0, import_i18n17.__)("Delete permanently", "elementor")
|
|
1681
1828
|
}
|
|
1682
|
-
), isDialogOpen && /* @__PURE__ */
|
|
1829
|
+
), isDialogOpen && /* @__PURE__ */ React25.createElement(ForceDeleteDialog, { post, setIsDialogOpen }));
|
|
1683
1830
|
}
|
|
1684
1831
|
function ForceDeleteDialog({
|
|
1685
1832
|
post,
|
|
@@ -1687,8 +1834,8 @@ function ForceDeleteDialog({
|
|
|
1687
1834
|
}) {
|
|
1688
1835
|
const { setError, type } = usePostListContext();
|
|
1689
1836
|
const { forceDeletePost } = usePostActions(type);
|
|
1690
|
-
const dialogTitle = (0,
|
|
1691
|
-
const dialogBody = (0,
|
|
1837
|
+
const dialogTitle = (0, import_i18n17.sprintf)((0, import_i18n17.__)('Delete "%s" permanently?', "elementor"), post.title.rendered);
|
|
1838
|
+
const dialogBody = (0, import_i18n17.__)("This will permanently delete the item. You cannot undo this action.", "elementor");
|
|
1692
1839
|
const handleDelete = async () => {
|
|
1693
1840
|
try {
|
|
1694
1841
|
await forceDeletePost.mutateAsync(post.id);
|
|
@@ -1704,38 +1851,38 @@ function ForceDeleteDialog({
|
|
|
1704
1851
|
}
|
|
1705
1852
|
setIsDialogOpen(false);
|
|
1706
1853
|
};
|
|
1707
|
-
return /* @__PURE__ */
|
|
1708
|
-
|
|
1854
|
+
return /* @__PURE__ */ React25.createElement(import_ui18.Dialog, { "aria-labelledby": "force-delete-dialog", onClose: handleCancel, open: true }, /* @__PURE__ */ React25.createElement(import_ui18.DialogTitle, { noWrap: true }, dialogTitle), /* @__PURE__ */ React25.createElement(import_ui18.Divider, null), /* @__PURE__ */ React25.createElement(import_ui18.DialogContent, null, /* @__PURE__ */ React25.createElement(import_ui18.DialogContentText, null, dialogBody)), /* @__PURE__ */ React25.createElement(import_ui18.DialogActions, null, /* @__PURE__ */ React25.createElement(
|
|
1855
|
+
import_ui18.Button,
|
|
1709
1856
|
{
|
|
1710
1857
|
variant: "contained",
|
|
1711
1858
|
color: "secondary",
|
|
1712
1859
|
onClick: handleCancel,
|
|
1713
1860
|
disabled: forceDeletePost.isPending
|
|
1714
1861
|
},
|
|
1715
|
-
(0,
|
|
1716
|
-
), /* @__PURE__ */
|
|
1717
|
-
|
|
1862
|
+
(0, import_i18n17.__)("Cancel", "elementor")
|
|
1863
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1864
|
+
import_ui18.Button,
|
|
1718
1865
|
{
|
|
1719
1866
|
variant: "contained",
|
|
1720
1867
|
color: "error",
|
|
1721
1868
|
onClick: () => void handleDelete(),
|
|
1722
1869
|
disabled: forceDeletePost.isPending
|
|
1723
1870
|
},
|
|
1724
|
-
!forceDeletePost.isPending ? (0,
|
|
1871
|
+
!forceDeletePost.isPending ? (0, import_i18n17.__)("Delete permanently", "elementor") : /* @__PURE__ */ React25.createElement(import_ui18.CircularProgress, null)
|
|
1725
1872
|
)));
|
|
1726
1873
|
}
|
|
1727
1874
|
|
|
1728
1875
|
// src/components/panel/actions-menu/actions/rename.tsx
|
|
1729
|
-
var
|
|
1730
|
-
var
|
|
1731
|
-
var
|
|
1876
|
+
var React26 = __toESM(require("react"));
|
|
1877
|
+
var import_icons15 = require("@elementor/icons");
|
|
1878
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
1732
1879
|
function Rename({ post }) {
|
|
1733
1880
|
const { setEditMode } = usePostListContext();
|
|
1734
|
-
return /* @__PURE__ */
|
|
1881
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1735
1882
|
ActionMenuItem,
|
|
1736
1883
|
{
|
|
1737
|
-
title: (0,
|
|
1738
|
-
icon:
|
|
1884
|
+
title: (0, import_i18n18.__)("Rename", "elementor"),
|
|
1885
|
+
icon: import_icons15.EraseIcon,
|
|
1739
1886
|
MenuItemProps: {
|
|
1740
1887
|
disabled: !post.user_can.edit,
|
|
1741
1888
|
onClick: () => {
|
|
@@ -1752,9 +1899,9 @@ function Rename({ post }) {
|
|
|
1752
1899
|
}
|
|
1753
1900
|
|
|
1754
1901
|
// src/components/panel/actions-menu/actions/restore.tsx
|
|
1755
|
-
var
|
|
1756
|
-
var
|
|
1757
|
-
var
|
|
1902
|
+
var React27 = __toESM(require("react"));
|
|
1903
|
+
var import_icons16 = require("@elementor/icons");
|
|
1904
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
1758
1905
|
function Restore({ post }) {
|
|
1759
1906
|
const { setError, type } = usePostListContext();
|
|
1760
1907
|
const { restorePost } = usePostActions(type);
|
|
@@ -1765,12 +1912,12 @@ function Restore({ post }) {
|
|
|
1765
1912
|
setError();
|
|
1766
1913
|
}
|
|
1767
1914
|
};
|
|
1768
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1769
1916
|
ActionMenuItem,
|
|
1770
1917
|
{
|
|
1771
|
-
description: (0,
|
|
1772
|
-
title: (0,
|
|
1773
|
-
icon:
|
|
1918
|
+
description: (0, import_i18n19.__)("Restored as draft", "elementor"),
|
|
1919
|
+
title: (0, import_i18n19.__)("Restore", "elementor"),
|
|
1920
|
+
icon: import_icons16.RefreshIcon,
|
|
1774
1921
|
MenuItemProps: {
|
|
1775
1922
|
disabled: restorePost.isPending || !post.user_can.delete,
|
|
1776
1923
|
onClick: () => void handleClick()
|
|
@@ -1780,10 +1927,10 @@ function Restore({ post }) {
|
|
|
1780
1927
|
}
|
|
1781
1928
|
|
|
1782
1929
|
// src/components/panel/actions-menu/actions/set-home.tsx
|
|
1783
|
-
var
|
|
1784
|
-
var
|
|
1785
|
-
var
|
|
1786
|
-
var
|
|
1930
|
+
var React28 = __toESM(require("react"));
|
|
1931
|
+
var import_icons17 = require("@elementor/icons");
|
|
1932
|
+
var import_ui19 = require("@elementor/ui");
|
|
1933
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1787
1934
|
|
|
1788
1935
|
// src/hooks/use-homepage-actions.ts
|
|
1789
1936
|
var import_query8 = require("@elementor/query");
|
|
@@ -1822,11 +1969,11 @@ function SetHome({ post, closeMenu }) {
|
|
|
1822
1969
|
const isPostPublished = post.status === "publish";
|
|
1823
1970
|
const isPostHomepage = !!post.isHome;
|
|
1824
1971
|
const isDisabled = !canManageOptions || isPostHomepage || !isPostPublished || updateSettingsMutation.isPending;
|
|
1825
|
-
return /* @__PURE__ */
|
|
1972
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1826
1973
|
ActionMenuItem,
|
|
1827
1974
|
{
|
|
1828
|
-
title: (0,
|
|
1829
|
-
icon: !updateSettingsMutation.isPending ?
|
|
1975
|
+
title: (0, import_i18n20.__)("Set as homepage", "elementor"),
|
|
1976
|
+
icon: !updateSettingsMutation.isPending ? import_icons17.HomeIcon : import_ui19.CircularProgress,
|
|
1830
1977
|
MenuItemProps: {
|
|
1831
1978
|
disabled: isDisabled,
|
|
1832
1979
|
onClick: handleClick
|
|
@@ -1836,17 +1983,17 @@ function SetHome({ post, closeMenu }) {
|
|
|
1836
1983
|
}
|
|
1837
1984
|
|
|
1838
1985
|
// src/components/panel/actions-menu/actions/view.tsx
|
|
1839
|
-
var
|
|
1840
|
-
var
|
|
1841
|
-
var
|
|
1986
|
+
var React29 = __toESM(require("react"));
|
|
1987
|
+
var import_icons18 = require("@elementor/icons");
|
|
1988
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
1842
1989
|
function View({ post }) {
|
|
1843
1990
|
const { type } = usePostListContext();
|
|
1844
|
-
const title = (0,
|
|
1845
|
-
return /* @__PURE__ */
|
|
1991
|
+
const title = (0, import_i18n21.__)("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
|
|
1992
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1846
1993
|
ActionMenuItem,
|
|
1847
1994
|
{
|
|
1848
1995
|
title,
|
|
1849
|
-
icon:
|
|
1996
|
+
icon: import_icons18.EyeIcon,
|
|
1850
1997
|
MenuItemProps: {
|
|
1851
1998
|
onClick: () => window.open(post.link, "_blank")
|
|
1852
1999
|
}
|
|
@@ -1869,16 +2016,16 @@ var DisabledPostTooltip = ({
|
|
|
1869
2016
|
postTypeSlug
|
|
1870
2017
|
}) => {
|
|
1871
2018
|
if (isDisabled) {
|
|
1872
|
-
const title = /* @__PURE__ */
|
|
1873
|
-
return /* @__PURE__ */
|
|
2019
|
+
const title = /* @__PURE__ */ React30.createElement(import_ui20.Typography, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React30.createElement("br", null), (0, import_i18n22.__)("To edit it directly, contact the site owner", "elementor"));
|
|
2020
|
+
return /* @__PURE__ */ React30.createElement(import_ui20.Tooltip, { title, placement: "bottom", arrow: false }, /* @__PURE__ */ React30.createElement("span", null, children));
|
|
1874
2021
|
}
|
|
1875
|
-
return /* @__PURE__ */
|
|
2022
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, children);
|
|
1876
2023
|
};
|
|
1877
2024
|
function ListItemView({ post }) {
|
|
1878
2025
|
const { type } = usePostListContext();
|
|
1879
2026
|
const activeDocument = (0, import_editor_documents5.__useActiveDocument)();
|
|
1880
2027
|
const navigateToDocument = (0, import_editor_documents5.__useNavigateToDocument)();
|
|
1881
|
-
const popupState = (0,
|
|
2028
|
+
const popupState = (0, import_ui20.usePopupState)({
|
|
1882
2029
|
variant: "popover",
|
|
1883
2030
|
popupId: "post-actions",
|
|
1884
2031
|
disableAutoFocus: true
|
|
@@ -1889,18 +2036,18 @@ function ListItemView({ post }) {
|
|
|
1889
2036
|
const isTrashed = "trash" === post.status;
|
|
1890
2037
|
const isEditBlocked = !post.user_can.edit && !isTrashed;
|
|
1891
2038
|
const isRowDisabled = isEditBlocked || isTrashed;
|
|
1892
|
-
const menuTriggerProps = (0,
|
|
2039
|
+
const menuTriggerProps = (0, import_ui20.bindTrigger)(popupState);
|
|
1893
2040
|
const hasListItemActions = useSiteContentListItemActionsInjections().length > 0;
|
|
1894
2041
|
const showListItemActions = isActive && post.user_can.edit && !isTrashed && hasListItemActions;
|
|
1895
|
-
const listRow = /* @__PURE__ */
|
|
1896
|
-
|
|
2042
|
+
const listRow = /* @__PURE__ */ React30.createElement(
|
|
2043
|
+
import_ui20.ListItem,
|
|
1897
2044
|
{
|
|
1898
2045
|
disablePadding: true,
|
|
1899
2046
|
sx: getContentPanelListItemSx(showListItemActions),
|
|
1900
|
-
secondaryAction: /* @__PURE__ */
|
|
1901
|
-
|
|
2047
|
+
secondaryAction: /* @__PURE__ */ React30.createElement(import_ui20.Stack, { alignItems: "center", direction: "row", spacing: 0 }, showListItemActions && /* @__PURE__ */ React30.createElement(SiteContentListItemActionsSlot, { post, title }), /* @__PURE__ */ React30.createElement(
|
|
2048
|
+
import_ui20.IconButton,
|
|
1902
2049
|
{
|
|
1903
|
-
"aria-label": (0,
|
|
2050
|
+
"aria-label": (0, import_i18n22.__)("More actions", "elementor"),
|
|
1904
2051
|
size: "tiny",
|
|
1905
2052
|
...menuTriggerProps,
|
|
1906
2053
|
onClick: (event) => {
|
|
@@ -1908,11 +2055,11 @@ function ListItemView({ post }) {
|
|
|
1908
2055
|
menuTriggerProps.onClick?.(event);
|
|
1909
2056
|
}
|
|
1910
2057
|
},
|
|
1911
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ React30.createElement(import_icons19.DotsVerticalIcon, { fontSize: "tiny" })
|
|
1912
2059
|
))
|
|
1913
2060
|
},
|
|
1914
|
-
/* @__PURE__ */
|
|
1915
|
-
|
|
2061
|
+
/* @__PURE__ */ React30.createElement(
|
|
2062
|
+
import_ui20.ListItemButton,
|
|
1916
2063
|
{
|
|
1917
2064
|
dense: true,
|
|
1918
2065
|
disableGutters: true,
|
|
@@ -1927,18 +2074,18 @@ function ListItemView({ post }) {
|
|
|
1927
2074
|
shape: "rounded",
|
|
1928
2075
|
sx: contentPanelListItemButtonSx
|
|
1929
2076
|
},
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
post.isHome && /* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ React30.createElement(import_ui20.ListItemText, { disableTypography: true, sx: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React30.createElement(PageTitleAndStatus, { title, status })),
|
|
2078
|
+
post.isHome && /* @__PURE__ */ React30.createElement(import_icons19.HomeIcon, { titleAccess: (0, import_i18n22.__)("Homepage", "elementor"), color: "disabled" })
|
|
1932
2079
|
)
|
|
1933
2080
|
);
|
|
1934
|
-
return /* @__PURE__ */
|
|
1935
|
-
|
|
2081
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, isEditBlocked ? /* @__PURE__ */ React30.createElement(DisabledPostTooltip, { isDisabled: true, postTypeSlug: type }, listRow) : listRow, /* @__PURE__ */ React30.createElement(
|
|
2082
|
+
import_ui20.Menu,
|
|
1936
2083
|
{
|
|
1937
2084
|
PaperProps: { sx: { mt: 2, width: 200 } },
|
|
1938
2085
|
MenuListProps: { dense: true },
|
|
1939
|
-
...(0,
|
|
2086
|
+
...(0, import_ui20.bindMenu)(popupState)
|
|
1940
2087
|
},
|
|
1941
|
-
isTrashed ? /* @__PURE__ */
|
|
2088
|
+
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(import_ui20.Divider, null), /* @__PURE__ */ React30.createElement(SetHome, { post, closeMenu: () => popupState.close() })))
|
|
1942
2089
|
));
|
|
1943
2090
|
}
|
|
1944
2091
|
|
|
@@ -1946,25 +2093,25 @@ function ListItemView({ post }) {
|
|
|
1946
2093
|
function PostListItem({ post }) {
|
|
1947
2094
|
const { editMode } = usePostListContext();
|
|
1948
2095
|
if ("rename" === editMode.mode && post?.id && post?.id === editMode.details.postId) {
|
|
1949
|
-
return /* @__PURE__ */
|
|
2096
|
+
return /* @__PURE__ */ React31.createElement(ListItemRename, { post });
|
|
1950
2097
|
}
|
|
1951
2098
|
if ("create" === editMode.mode && !post) {
|
|
1952
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ React31.createElement(ListItemCreate, null);
|
|
1953
2100
|
}
|
|
1954
2101
|
if ("duplicate" === editMode.mode && !post) {
|
|
1955
|
-
return /* @__PURE__ */
|
|
2102
|
+
return /* @__PURE__ */ React31.createElement(ListItemDuplicate, null);
|
|
1956
2103
|
}
|
|
1957
2104
|
if (!post) {
|
|
1958
2105
|
return null;
|
|
1959
2106
|
}
|
|
1960
|
-
return /* @__PURE__ */
|
|
2107
|
+
return /* @__PURE__ */ React31.createElement(ListItemView, { post });
|
|
1961
2108
|
}
|
|
1962
2109
|
|
|
1963
2110
|
// src/components/panel/posts-list/post-list-pagination-actions.tsx
|
|
1964
|
-
var
|
|
1965
|
-
var
|
|
1966
|
-
var
|
|
1967
|
-
var
|
|
2111
|
+
var React32 = __toESM(require("react"));
|
|
2112
|
+
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
2113
|
+
var import_ui21 = require("@elementor/ui");
|
|
2114
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
1968
2115
|
var listPaginationButtonProps = {
|
|
1969
2116
|
color: "secondary",
|
|
1970
2117
|
size: "small",
|
|
@@ -1981,28 +2128,28 @@ function PostListPaginationActions({
|
|
|
1981
2128
|
if (!canLoadMore && !canShowLess) {
|
|
1982
2129
|
return null;
|
|
1983
2130
|
}
|
|
1984
|
-
const loadMoreLabel = (0,
|
|
1985
|
-
const showLessLabel = (0,
|
|
1986
|
-
const loadMoreButton = /* @__PURE__ */
|
|
1987
|
-
|
|
2131
|
+
const loadMoreLabel = (0, import_i18n23.__)("Load more", "elementor");
|
|
2132
|
+
const showLessLabel = (0, import_i18n23.__)("Show less", "elementor");
|
|
2133
|
+
const loadMoreButton = /* @__PURE__ */ React32.createElement(
|
|
2134
|
+
import_ui21.Button,
|
|
1988
2135
|
{
|
|
1989
2136
|
...listPaginationButtonProps,
|
|
1990
2137
|
ref: loadMoreButtonRef,
|
|
1991
2138
|
"aria-label": loadMoreLabel,
|
|
1992
2139
|
disabled: isLoadingMore,
|
|
1993
|
-
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */
|
|
2140
|
+
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */ React32.createElement(import_editor_ui4.CollapseIcon, { open: false }),
|
|
1994
2141
|
fullWidth: true,
|
|
1995
2142
|
onClick: onLoadMore,
|
|
1996
2143
|
sx: { flex: 1, my: 0.5 }
|
|
1997
2144
|
},
|
|
1998
|
-
isLoadingMore ? /* @__PURE__ */
|
|
2145
|
+
isLoadingMore ? /* @__PURE__ */ React32.createElement(import_ui21.CircularProgress, { size: 20 }) : loadMoreLabel
|
|
1999
2146
|
);
|
|
2000
|
-
const showLessButton = /* @__PURE__ */
|
|
2001
|
-
|
|
2147
|
+
const showLessButton = /* @__PURE__ */ React32.createElement(
|
|
2148
|
+
import_ui21.Button,
|
|
2002
2149
|
{
|
|
2003
2150
|
...listPaginationButtonProps,
|
|
2004
2151
|
"aria-label": showLessLabel,
|
|
2005
|
-
endIcon: /* @__PURE__ */
|
|
2152
|
+
endIcon: /* @__PURE__ */ React32.createElement(import_editor_ui4.CollapseIcon, { open: true }),
|
|
2006
2153
|
fullWidth: true,
|
|
2007
2154
|
onClick: onShowLess,
|
|
2008
2155
|
sx: { flex: 1, my: 0.5 }
|
|
@@ -2010,16 +2157,16 @@ function PostListPaginationActions({
|
|
|
2010
2157
|
showLessLabel
|
|
2011
2158
|
);
|
|
2012
2159
|
if (canShowLess && canLoadMore) {
|
|
2013
|
-
return /* @__PURE__ */
|
|
2160
|
+
return /* @__PURE__ */ React32.createElement(import_ui21.Box, { sx: { px: 2, width: "100%" } }, /* @__PURE__ */ React32.createElement(import_ui21.Stack, { direction: "row", spacing: 1 }, showLessButton, loadMoreButton));
|
|
2014
2161
|
}
|
|
2015
|
-
return /* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ React32.createElement(import_ui21.Box, { sx: { px: 2, width: "100%" } }, canShowLess ? showLessButton : loadMoreButton);
|
|
2016
2163
|
}
|
|
2017
2164
|
|
|
2018
2165
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
2019
2166
|
var SEARCH_DEBOUNCE_MS = 300;
|
|
2020
2167
|
function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
2021
2168
|
const { type, editMode, resetEditMode, setEditMode } = usePostListContext();
|
|
2022
|
-
const { registerSection, searchQuery, statusFilters, unregisterSection } = useContentPanelCoordinator();
|
|
2169
|
+
const { registerSection, searchQuery, siteContentSort, statusFilters, unregisterSection } = useContentPanelCoordinator();
|
|
2023
2170
|
const [isOpen, setIsOpen] = (0, import_react10.useState)(isOpenByDefault);
|
|
2024
2171
|
const trimmedSearch = searchQuery.trim();
|
|
2025
2172
|
const [debouncedSearch, setDebouncedSearch] = (0, import_react10.useState)(trimmedSearch);
|
|
@@ -2038,7 +2185,7 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2038
2185
|
fetchNextPage,
|
|
2039
2186
|
hasNextPage,
|
|
2040
2187
|
isFetchingNextPage
|
|
2041
|
-
} = usePosts(type, debouncedSearch, statusFilters);
|
|
2188
|
+
} = usePosts(type, debouncedSearch, statusFilters, siteContentSort);
|
|
2042
2189
|
const isNarrowed = isSiteContentListNarrowed(statusFilters, debouncedSearch);
|
|
2043
2190
|
const isTrashFilter = isSiteContentTrashFilterActive(statusFilters);
|
|
2044
2191
|
const baselineStatus = isTrashFilter ? "trash" : "any";
|
|
@@ -2063,7 +2210,8 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2063
2210
|
return [];
|
|
2064
2211
|
}
|
|
2065
2212
|
const mappedPosts = isPageType ? posts.map((post) => post.id === homepageId ? { ...post, isHome: true } : post) : posts;
|
|
2066
|
-
const
|
|
2213
|
+
const shouldPinHomepage = isPageType && shouldPinHomepageForSiteContentSort(siteContentSort);
|
|
2214
|
+
const sorted = shouldPinHomepage ? [...mappedPosts].sort((a, b) => {
|
|
2067
2215
|
if (a.id === homepageId) {
|
|
2068
2216
|
return -1;
|
|
2069
2217
|
}
|
|
@@ -2073,13 +2221,13 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2073
2221
|
return 0;
|
|
2074
2222
|
}) : mappedPosts;
|
|
2075
2223
|
return sorted;
|
|
2076
|
-
}, [
|
|
2224
|
+
}, [homepageId, isPageType, posts, siteContentSort]);
|
|
2077
2225
|
const pagination = usePostListPagination({
|
|
2078
2226
|
fetchNextPage,
|
|
2079
2227
|
hasNextPage,
|
|
2080
2228
|
isFetchingNextPage,
|
|
2081
2229
|
loadedCount: filteredPosts.length,
|
|
2082
|
-
resetKey: `${type}:${debouncedSearch}:${statusFiltersKey}`,
|
|
2230
|
+
resetKey: `${type}:${debouncedSearch}:${statusFiltersKey}:${siteContentSort}`,
|
|
2083
2231
|
totalCount: total
|
|
2084
2232
|
});
|
|
2085
2233
|
const displayedPosts = (0, import_react10.useMemo)(
|
|
@@ -2112,16 +2260,16 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2112
2260
|
}
|
|
2113
2261
|
}, [debouncedSearch, filteredPosts.length, statusFilters]);
|
|
2114
2262
|
if (postsError) {
|
|
2115
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ React33.createElement(ErrorState, null);
|
|
2116
2264
|
}
|
|
2117
2265
|
if (postsPending && !posts?.length) {
|
|
2118
|
-
return /* @__PURE__ */
|
|
2266
|
+
return /* @__PURE__ */ React33.createElement(import_ui22.Box, { sx: { px: 2 } }, /* @__PURE__ */ React33.createElement(import_ui22.Box, null, /* @__PURE__ */ React33.createElement(import_ui22.Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "100%", height: "24px" }), /* @__PURE__ */ React33.createElement(import_ui22.Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React33.createElement(import_ui22.Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React33.createElement(import_ui22.Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" })));
|
|
2119
2267
|
}
|
|
2120
2268
|
const displayCount = total;
|
|
2121
2269
|
const sectionTitle = postTypesMap[type].labels.plural_name;
|
|
2122
2270
|
const showNoResults = (debouncedSearch || hasActiveSiteContentStatusFilters(statusFilters)) && filteredPosts.length === 0;
|
|
2123
2271
|
const countChipLabel = isNarrowed && baselineTotal !== void 0 ? `${total} / ${baselineTotal}` : void 0;
|
|
2124
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ React33.createElement(
|
|
2125
2273
|
CollapsibleList,
|
|
2126
2274
|
{
|
|
2127
2275
|
count: displayCount,
|
|
@@ -2130,15 +2278,15 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2130
2278
|
isOpen,
|
|
2131
2279
|
onOpenChange: setIsOpen,
|
|
2132
2280
|
title: sectionTitle,
|
|
2133
|
-
trailingActions: isTrashFilter ? null : /* @__PURE__ */
|
|
2281
|
+
trailingActions: isTrashFilter ? null : /* @__PURE__ */ React33.createElement(SectionAddButton, { onBeforeCreate: () => setIsOpen(true) })
|
|
2134
2282
|
},
|
|
2135
|
-
showNoResults && /* @__PURE__ */
|
|
2136
|
-
/* @__PURE__ */
|
|
2283
|
+
showNoResults && /* @__PURE__ */ React33.createElement(import_ui22.Box, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React33.createElement(import_ui22.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n24.__)("No results found", "elementor"))),
|
|
2284
|
+
/* @__PURE__ */ React33.createElement(import_ui22.Box, { ref: listTopRef }),
|
|
2137
2285
|
displayedPosts.map((post) => {
|
|
2138
|
-
return /* @__PURE__ */
|
|
2286
|
+
return /* @__PURE__ */ React33.createElement(PostListItem, { key: post.id, post });
|
|
2139
2287
|
}),
|
|
2140
|
-
!isTrashFilter && ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */
|
|
2141
|
-
/* @__PURE__ */
|
|
2288
|
+
!isTrashFilter && ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */ React33.createElement(PostListItem, null),
|
|
2289
|
+
/* @__PURE__ */ React33.createElement(
|
|
2142
2290
|
PostListPaginationActions,
|
|
2143
2291
|
{
|
|
2144
2292
|
canLoadMore: pagination.canLoadMore,
|
|
@@ -2153,11 +2301,11 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2153
2301
|
}
|
|
2154
2302
|
|
|
2155
2303
|
// src/components/panel/user-load-error.tsx
|
|
2156
|
-
var
|
|
2157
|
-
var
|
|
2158
|
-
var
|
|
2304
|
+
var React34 = __toESM(require("react"));
|
|
2305
|
+
var import_ui23 = require("@elementor/ui");
|
|
2306
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
2159
2307
|
function UserLoadError() {
|
|
2160
|
-
return /* @__PURE__ */
|
|
2308
|
+
return /* @__PURE__ */ React34.createElement(import_ui23.Box, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React34.createElement(import_ui23.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n25.__)(
|
|
2161
2309
|
"We couldn\u2019t load your content permissions. Try closing and reopening this panel.",
|
|
2162
2310
|
"elementor"
|
|
2163
2311
|
)));
|
|
@@ -2171,12 +2319,12 @@ function ShellPanelBodyContent({
|
|
|
2171
2319
|
showUserLoadError
|
|
2172
2320
|
}) {
|
|
2173
2321
|
if (isUserPending) {
|
|
2174
|
-
return /* @__PURE__ */
|
|
2322
|
+
return /* @__PURE__ */ React35.createElement(import_ui24.Stack, { spacing: 1, sx: { px: 2, py: 1 } }, /* @__PURE__ */ React35.createElement(import_ui24.Skeleton, { animation: "wave", height: 28, variant: "rounded", width: "100%" }), /* @__PURE__ */ React35.createElement(import_ui24.Skeleton, { animation: "wave", height: 28, variant: "rounded", width: "80%" }));
|
|
2175
2323
|
}
|
|
2176
2324
|
if (showUserLoadError) {
|
|
2177
|
-
return /* @__PURE__ */
|
|
2325
|
+
return /* @__PURE__ */ React35.createElement(UserLoadError, null);
|
|
2178
2326
|
}
|
|
2179
|
-
return /* @__PURE__ */
|
|
2327
|
+
return /* @__PURE__ */ React35.createElement(import_ui24.List, { 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 }))));
|
|
2180
2328
|
}
|
|
2181
2329
|
|
|
2182
2330
|
// src/components/panel/shell.tsx
|
|
@@ -2184,8 +2332,8 @@ var Shell = () => {
|
|
|
2184
2332
|
const sidebarPanelChrome = (0, import_editor_sidebar.isSidebarEnabled)();
|
|
2185
2333
|
const [isErrorSnackbarOpen, setIsErrorSnackbarOpen] = (0, import_react11.useState)(false);
|
|
2186
2334
|
const { accessiblePostTypes, isUserPending, showUserLoadError } = useAccessiblePanelPostTypes();
|
|
2187
|
-
return /* @__PURE__ */
|
|
2188
|
-
|
|
2335
|
+
return /* @__PURE__ */ React36.createElement(ContentPanelCoordinatorProvider, null, /* @__PURE__ */ React36.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React36.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React36.createElement(
|
|
2336
|
+
import_ui25.Stack,
|
|
2189
2337
|
{
|
|
2190
2338
|
alignItems: "center",
|
|
2191
2339
|
direction: "row",
|
|
@@ -2195,9 +2343,9 @@ var Shell = () => {
|
|
|
2195
2343
|
...sidebarPanelChrome ? {} : { p: 1, pl: 2 }
|
|
2196
2344
|
}
|
|
2197
2345
|
},
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
)), /* @__PURE__ */
|
|
2346
|
+
/* @__PURE__ */ React36.createElement(import_editor_panels.PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, (0, import_i18n26.__)("Site content", "elementor")),
|
|
2347
|
+
/* @__PURE__ */ React36.createElement(ContentPanelHeaderAdd, null)
|
|
2348
|
+
)), /* @__PURE__ */ React36.createElement(import_ui25.Divider, null), /* @__PURE__ */ React36.createElement(import_editor_panels.PanelBody, null, /* @__PURE__ */ React36.createElement(ContentPanelToolbar, null), /* @__PURE__ */ React36.createElement(import_ui25.Divider, null), /* @__PURE__ */ React36.createElement(
|
|
2201
2349
|
ShellPanelBodyContent,
|
|
2202
2350
|
{
|
|
2203
2351
|
accessiblePostTypes,
|
|
@@ -2205,7 +2353,7 @@ var Shell = () => {
|
|
|
2205
2353
|
onListError: () => setIsErrorSnackbarOpen(true),
|
|
2206
2354
|
showUserLoadError
|
|
2207
2355
|
}
|
|
2208
|
-
), /* @__PURE__ */
|
|
2356
|
+
), /* @__PURE__ */ React36.createElement(error_snackbar_default, { open: isErrorSnackbarOpen, onClose: () => setIsErrorSnackbarOpen(false) }))));
|
|
2209
2357
|
};
|
|
2210
2358
|
var shell_default = Shell;
|
|
2211
2359
|
|
|
@@ -2216,19 +2364,19 @@ var { panel, usePanelStatus, usePanelActions } = (0, import_editor_panels2.creat
|
|
|
2216
2364
|
});
|
|
2217
2365
|
|
|
2218
2366
|
// src/components/top-bar/recently-edited.tsx
|
|
2219
|
-
var
|
|
2367
|
+
var React41 = __toESM(require("react"));
|
|
2220
2368
|
var import_editor_documents8 = require("@elementor/editor-documents");
|
|
2221
|
-
var
|
|
2222
|
-
var
|
|
2223
|
-
var
|
|
2369
|
+
var import_icons22 = require("@elementor/icons");
|
|
2370
|
+
var import_ui30 = require("@elementor/ui");
|
|
2371
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
2224
2372
|
|
|
2225
2373
|
// src/components/top-bar/create-post-list-item.tsx
|
|
2226
|
-
var
|
|
2374
|
+
var React37 = __toESM(require("react"));
|
|
2227
2375
|
var import_editor_documents6 = require("@elementor/editor-documents");
|
|
2228
2376
|
var import_events = require("@elementor/events");
|
|
2229
|
-
var
|
|
2230
|
-
var
|
|
2231
|
-
var
|
|
2377
|
+
var import_icons20 = require("@elementor/icons");
|
|
2378
|
+
var import_ui26 = require("@elementor/ui");
|
|
2379
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
2232
2380
|
|
|
2233
2381
|
// src/hooks/use-create-page.ts
|
|
2234
2382
|
var import_react12 = require("react");
|
|
@@ -2258,8 +2406,8 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
2258
2406
|
const navigateToDocument = (0, import_editor_documents6.__useNavigateToDocument)();
|
|
2259
2407
|
const { data: user } = useUser();
|
|
2260
2408
|
const { dispatchEvent, config } = (0, import_events.useMixpanel)();
|
|
2261
|
-
return /* @__PURE__ */
|
|
2262
|
-
|
|
2409
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2410
|
+
import_ui26.MenuItem,
|
|
2263
2411
|
{
|
|
2264
2412
|
disabled: isLoading || !user?.capabilities?.edit_pages,
|
|
2265
2413
|
onClick: async () => {
|
|
@@ -2282,26 +2430,26 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
2282
2430
|
},
|
|
2283
2431
|
...props
|
|
2284
2432
|
},
|
|
2285
|
-
/* @__PURE__ */
|
|
2286
|
-
/* @__PURE__ */
|
|
2287
|
-
|
|
2433
|
+
/* @__PURE__ */ React37.createElement(import_ui26.ListItemIcon, null, isLoading ? /* @__PURE__ */ React37.createElement(import_ui26.CircularProgress, { size: "1.25rem" }) : /* @__PURE__ */ React37.createElement(import_icons20.PlusIcon, { fontSize: "small" })),
|
|
2434
|
+
/* @__PURE__ */ React37.createElement(
|
|
2435
|
+
import_ui26.ListItemText,
|
|
2288
2436
|
{
|
|
2289
2437
|
primaryTypographyProps: { variant: "body2" },
|
|
2290
|
-
primary: (0,
|
|
2438
|
+
primary: (0, import_i18n27.__)("Add new page", "elementor")
|
|
2291
2439
|
}
|
|
2292
2440
|
)
|
|
2293
2441
|
);
|
|
2294
2442
|
}
|
|
2295
2443
|
|
|
2296
2444
|
// src/components/top-bar/indicator.tsx
|
|
2297
|
-
var
|
|
2298
|
-
var
|
|
2445
|
+
var React38 = __toESM(require("react"));
|
|
2446
|
+
var import_ui27 = require("@elementor/ui");
|
|
2299
2447
|
function Indicator({ title, status }) {
|
|
2300
|
-
return /* @__PURE__ */
|
|
2448
|
+
return /* @__PURE__ */ React38.createElement(Tooltip5, { title }, /* @__PURE__ */ React38.createElement(import_ui27.Stack, { component: "span", direction: "row", alignItems: "center", spacing: 0.5 }, /* @__PURE__ */ React38.createElement(import_ui27.Typography, { component: "span", variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React38.createElement(import_ui27.Typography, { component: "span", variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
2301
2449
|
}
|
|
2302
|
-
function
|
|
2303
|
-
return /* @__PURE__ */
|
|
2304
|
-
|
|
2450
|
+
function Tooltip5(props) {
|
|
2451
|
+
return /* @__PURE__ */ React38.createElement(
|
|
2452
|
+
import_ui27.Tooltip,
|
|
2305
2453
|
{
|
|
2306
2454
|
PopperProps: {
|
|
2307
2455
|
sx: {
|
|
@@ -2316,21 +2464,21 @@ function Tooltip4(props) {
|
|
|
2316
2464
|
}
|
|
2317
2465
|
|
|
2318
2466
|
// src/components/top-bar/post-list-item.tsx
|
|
2319
|
-
var
|
|
2467
|
+
var React40 = __toESM(require("react"));
|
|
2320
2468
|
var import_editor_documents7 = require("@elementor/editor-documents");
|
|
2321
2469
|
var import_events2 = require("@elementor/events");
|
|
2322
|
-
var
|
|
2470
|
+
var import_ui29 = require("@elementor/ui");
|
|
2323
2471
|
|
|
2324
2472
|
// src/components/top-bar/chip-doc-type.tsx
|
|
2325
|
-
var
|
|
2326
|
-
var
|
|
2327
|
-
var
|
|
2473
|
+
var React39 = __toESM(require("react"));
|
|
2474
|
+
var import_icons21 = require("@elementor/icons");
|
|
2475
|
+
var import_ui28 = require("@elementor/ui");
|
|
2328
2476
|
var iconsMap2 = getIconsMap();
|
|
2329
2477
|
function DocTypeChip({ postType, docType, label }) {
|
|
2330
2478
|
const color = "elementor_library" === postType ? "global" : "accent";
|
|
2331
|
-
const Icon = iconsMap2[docType] ||
|
|
2332
|
-
return /* @__PURE__ */
|
|
2333
|
-
|
|
2479
|
+
const Icon = iconsMap2[docType] || import_icons21.PostTypeIcon;
|
|
2480
|
+
return /* @__PURE__ */ React39.createElement(
|
|
2481
|
+
import_ui28.Chip,
|
|
2334
2482
|
{
|
|
2335
2483
|
component: "span",
|
|
2336
2484
|
size: "small",
|
|
@@ -2338,7 +2486,7 @@ function DocTypeChip({ postType, docType, label }) {
|
|
|
2338
2486
|
label,
|
|
2339
2487
|
"data-value": docType,
|
|
2340
2488
|
color,
|
|
2341
|
-
icon: /* @__PURE__ */
|
|
2489
|
+
icon: /* @__PURE__ */ React39.createElement(Icon, null),
|
|
2342
2490
|
sx: { ml: 1, cursor: "inherit" }
|
|
2343
2491
|
}
|
|
2344
2492
|
);
|
|
@@ -2349,8 +2497,8 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
2349
2497
|
const navigateToDocument = (0, import_editor_documents7.__useNavigateToDocument)();
|
|
2350
2498
|
const postTitle = useReverseHtmlEntities(post.title);
|
|
2351
2499
|
const { dispatchEvent, config } = (0, import_events2.useMixpanel)();
|
|
2352
|
-
return /* @__PURE__ */
|
|
2353
|
-
|
|
2500
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2501
|
+
import_ui29.MenuItem,
|
|
2354
2502
|
{
|
|
2355
2503
|
disabled: !post.user_can.edit,
|
|
2356
2504
|
onClick: async () => {
|
|
@@ -2372,15 +2520,15 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
2372
2520
|
},
|
|
2373
2521
|
...props
|
|
2374
2522
|
},
|
|
2375
|
-
/* @__PURE__ */
|
|
2376
|
-
|
|
2523
|
+
/* @__PURE__ */ React40.createElement(
|
|
2524
|
+
import_ui29.ListItemText,
|
|
2377
2525
|
{
|
|
2378
2526
|
sx: { flexGrow: 0 },
|
|
2379
2527
|
primaryTypographyProps: { variant: "body2", noWrap: true },
|
|
2380
2528
|
primary: postTitle
|
|
2381
2529
|
}
|
|
2382
2530
|
),
|
|
2383
|
-
/* @__PURE__ */
|
|
2531
|
+
/* @__PURE__ */ React40.createElement(DocTypeChip, { postType: post.type.post_type, docType: post.type.doc_type, label: post.type.label })
|
|
2384
2532
|
);
|
|
2385
2533
|
}
|
|
2386
2534
|
|
|
@@ -2397,7 +2545,7 @@ function RecentlyEdited() {
|
|
|
2397
2545
|
return data.filter((post) => post.id !== document2?.id).splice(0, NUMBER_OF_RECENT_POSTS - 1);
|
|
2398
2546
|
};
|
|
2399
2547
|
const recentPosts = getRecentPosts();
|
|
2400
|
-
const popupState = (0,
|
|
2548
|
+
const popupState = (0, import_ui30.usePopupState)({
|
|
2401
2549
|
variant: "popover",
|
|
2402
2550
|
popupId: "elementor-v2-top-bar-recently-edited"
|
|
2403
2551
|
});
|
|
@@ -2405,13 +2553,13 @@ function RecentlyEdited() {
|
|
|
2405
2553
|
if (!document2) {
|
|
2406
2554
|
return null;
|
|
2407
2555
|
}
|
|
2408
|
-
const buttonProps = (0,
|
|
2409
|
-
return /* @__PURE__ */
|
|
2410
|
-
|
|
2556
|
+
const buttonProps = (0, import_ui30.bindTrigger)(popupState);
|
|
2557
|
+
return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(
|
|
2558
|
+
import_ui30.Button,
|
|
2411
2559
|
{
|
|
2412
2560
|
color: "inherit",
|
|
2413
2561
|
size: "small",
|
|
2414
|
-
endIcon: /* @__PURE__ */
|
|
2562
|
+
endIcon: /* @__PURE__ */ React41.createElement(import_icons22.ChevronDownIcon, { fontSize: "small" }),
|
|
2415
2563
|
...buttonProps,
|
|
2416
2564
|
onClick: (e) => {
|
|
2417
2565
|
const extendedWindow = window;
|
|
@@ -2430,41 +2578,41 @@ function RecentlyEdited() {
|
|
|
2430
2578
|
buttonProps.onClick(e);
|
|
2431
2579
|
}
|
|
2432
2580
|
},
|
|
2433
|
-
/* @__PURE__ */
|
|
2434
|
-
), /* @__PURE__ */
|
|
2435
|
-
|
|
2581
|
+
/* @__PURE__ */ React41.createElement(Indicator, { title: documentTitle, status: document2.status })
|
|
2582
|
+
), /* @__PURE__ */ React41.createElement(
|
|
2583
|
+
import_ui30.Menu,
|
|
2436
2584
|
{
|
|
2437
2585
|
MenuListProps: {
|
|
2438
|
-
subheader: /* @__PURE__ */
|
|
2586
|
+
subheader: /* @__PURE__ */ React41.createElement(import_ui30.ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, (0, import_i18n28.__)("Recent", "elementor"))
|
|
2439
2587
|
},
|
|
2440
2588
|
PaperProps: { sx: { mt: 2.5, width: 320 } },
|
|
2441
|
-
...(0,
|
|
2589
|
+
...(0, import_ui30.bindMenu)(popupState)
|
|
2442
2590
|
},
|
|
2443
|
-
recentPosts.map((post) => /* @__PURE__ */
|
|
2444
|
-
recentPosts.length === 0 && /* @__PURE__ */
|
|
2445
|
-
|
|
2591
|
+
recentPosts.map((post) => /* @__PURE__ */ React41.createElement(PostListItem2, { key: post.id, post, closePopup: popupState.close })),
|
|
2592
|
+
recentPosts.length === 0 && /* @__PURE__ */ React41.createElement(import_ui30.MenuItem, { disabled: true }, /* @__PURE__ */ React41.createElement(
|
|
2593
|
+
import_ui30.ListItemText,
|
|
2446
2594
|
{
|
|
2447
2595
|
primaryTypographyProps: {
|
|
2448
2596
|
variant: "caption",
|
|
2449
2597
|
fontStyle: "italic"
|
|
2450
2598
|
},
|
|
2451
|
-
primary: (0,
|
|
2599
|
+
primary: (0, import_i18n28.__)("There are no other pages or templates on this site yet.", "elementor")
|
|
2452
2600
|
}
|
|
2453
2601
|
)),
|
|
2454
|
-
/* @__PURE__ */
|
|
2455
|
-
/* @__PURE__ */
|
|
2602
|
+
/* @__PURE__ */ React41.createElement(import_ui30.Divider, { disabled: recentPosts.length === 0 }),
|
|
2603
|
+
/* @__PURE__ */ React41.createElement(CreatePostListItem, { closePopup: popupState.close })
|
|
2456
2604
|
));
|
|
2457
2605
|
}
|
|
2458
2606
|
|
|
2459
2607
|
// src/hooks/use-toggle-button-props.ts
|
|
2460
|
-
var
|
|
2461
|
-
var
|
|
2608
|
+
var import_icons23 = require("@elementor/icons");
|
|
2609
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
2462
2610
|
function useToggleButtonProps() {
|
|
2463
2611
|
const { isOpen: selectedState, isBlocked } = usePanelStatus();
|
|
2464
2612
|
const { open, close } = usePanelActions();
|
|
2465
2613
|
return {
|
|
2466
|
-
title: (0,
|
|
2467
|
-
icon:
|
|
2614
|
+
title: (0, import_i18n29.__)("Site content", "elementor"),
|
|
2615
|
+
icon: import_icons23.PagesIcon,
|
|
2468
2616
|
onClick: () => {
|
|
2469
2617
|
const extendedWindow = window;
|
|
2470
2618
|
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|