@elementor/editor-site-navigation 4.5.0-1229 → 4.5.0-1231
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.d.mts +167 -1
- package/dist/index.d.ts +167 -1
- package/dist/index.js +659 -431
- package/dist/index.mjs +527 -320
- package/package.json +12 -11
- package/src/components/panel/content-panel-chrome.ts +4 -1
- package/src/components/panel/content-panel-header-add.tsx +23 -1
- package/src/components/panel/popups/popup-header-create-menu-item.tsx +50 -0
- package/src/components/panel/popups/popup-section-add-button.tsx +70 -0
- package/src/components/panel/popups/site-content-popups-promotion-chip.tsx +62 -0
- package/src/components/panel/posts-list/list-items/edit-mode-template.tsx +10 -7
- package/src/components/panel/shell-panel-body-content.tsx +6 -0
- package/src/components/shared/page-title-and-status.tsx +4 -2
- package/src/contexts/content-panel-coordinator.tsx +9 -7
- package/src/env.ts +7 -0
- package/src/index.ts +33 -0
- package/src/popups/constants.ts +3 -0
- package/src/site-content-header-create-items.ts +28 -0
- package/src/site-content-sections.ts +26 -0
package/dist/index.mjs
CHANGED
|
@@ -30,12 +30,12 @@ import { isSidebarEnabled as isSidebarEnabled2, sidebarTools } from "@elementor/
|
|
|
30
30
|
import { createPanel } from "@elementor/editor-panels";
|
|
31
31
|
|
|
32
32
|
// src/components/panel/shell.tsx
|
|
33
|
-
import * as
|
|
34
|
-
import { useState as
|
|
33
|
+
import * as React38 from "react";
|
|
34
|
+
import { useState as useState10 } from "react";
|
|
35
35
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
36
36
|
import { isSidebarEnabled } from "@elementor/editor-sidebar";
|
|
37
37
|
import { Divider as Divider7, Stack as Stack9 } from "@elementor/ui";
|
|
38
|
-
import { __ as
|
|
38
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
39
39
|
|
|
40
40
|
// src/contexts/content-panel-coordinator.tsx
|
|
41
41
|
import * as React from "react";
|
|
@@ -388,7 +388,9 @@ function useAccessiblePanelPostTypes() {
|
|
|
388
388
|
var CONTENT_PANEL_INSET_SPACING = 2;
|
|
389
389
|
var CONTENT_PANEL_LIST_ROW_GAP = 0.5;
|
|
390
390
|
var CONTENT_PANEL_LIST_ROW_INSET_INLINE = 0.75;
|
|
391
|
-
var
|
|
391
|
+
var CONTENT_PANEL_LIST_ROW_ACTIVE_SECONDARY_ACTIONS_COUNT = 2;
|
|
392
|
+
var CONTENT_PANEL_LIST_ROW_ACTIVE_SECONDARY_ACTION_SLOT_WIDTH = 5.5;
|
|
393
|
+
var CONTENT_PANEL_LIST_ROW_ACTIVE_SECONDARY_INSET = CONTENT_PANEL_LIST_ROW_ACTIVE_SECONDARY_ACTIONS_COUNT * CONTENT_PANEL_LIST_ROW_ACTIVE_SECONDARY_ACTION_SLOT_WIDTH;
|
|
392
394
|
var CONTENT_PANEL_LIST_ROW_TITLE_FONT_SIZE = "0.75rem";
|
|
393
395
|
var CONTENT_PANEL_LIST_SECTION_BOTTOM_SPACING = 1;
|
|
394
396
|
var CONTENT_PANEL_SECTION_HEADER_PADDING_BLOCK = 1.25;
|
|
@@ -453,10 +455,10 @@ var contentPanelListItemButtonSx = {
|
|
|
453
455
|
};
|
|
454
456
|
|
|
455
457
|
// src/components/panel/content-panel-header-add.tsx
|
|
456
|
-
import * as
|
|
458
|
+
import * as React5 from "react";
|
|
457
459
|
import { PageTypeIcon as PageTypeIcon2, PostTypeIcon as PostTypeIcon2 } from "@elementor/icons";
|
|
458
|
-
import { bindMenu, bindTrigger, ListItemIcon, ListItemText, Menu, MenuItem, usePopupState } from "@elementor/ui";
|
|
459
|
-
import { __ as
|
|
460
|
+
import { bindMenu, bindTrigger, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2, Menu, MenuItem as MenuItem2, usePopupState } from "@elementor/ui";
|
|
461
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
460
462
|
|
|
461
463
|
// src/hooks/use-can-create.ts
|
|
462
464
|
function useCanCreate(postTypeSlug) {
|
|
@@ -465,6 +467,27 @@ function useCanCreate(postTypeSlug) {
|
|
|
465
467
|
return !!user?.capabilities?.[capability];
|
|
466
468
|
}
|
|
467
469
|
|
|
470
|
+
// src/popups/constants.ts
|
|
471
|
+
var POPUPS_SITE_CONTENT_SECTION_ID = "popups";
|
|
472
|
+
var POPUP_SITE_CONTENT_UPGRADE_URL = "https://go.elementor.com/go-pro-site-content-popups/";
|
|
473
|
+
|
|
474
|
+
// src/site-content-header-create-items.ts
|
|
475
|
+
var registeredHeaderCreateItems = /* @__PURE__ */ new Map();
|
|
476
|
+
var DEFAULT_HEADER_CREATE_PRIORITY = 0;
|
|
477
|
+
function registerSiteContentHeaderCreateItem(item) {
|
|
478
|
+
registeredHeaderCreateItems.set(item.id, item);
|
|
479
|
+
}
|
|
480
|
+
function getSiteContentHeaderCreateItems() {
|
|
481
|
+
return Array.from(registeredHeaderCreateItems.values()).sort((first, second) => {
|
|
482
|
+
const firstPriority = first.priority ?? DEFAULT_HEADER_CREATE_PRIORITY;
|
|
483
|
+
const secondPriority = second.priority ?? DEFAULT_HEADER_CREATE_PRIORITY;
|
|
484
|
+
return firstPriority - secondPriority;
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
function resetSiteContentHeaderCreateItems() {
|
|
488
|
+
registeredHeaderCreateItems.clear();
|
|
489
|
+
}
|
|
490
|
+
|
|
468
491
|
// src/components/panel/content-panel-add-icon-button.tsx
|
|
469
492
|
import * as React2 from "react";
|
|
470
493
|
import { PlusIcon } from "@elementor/icons";
|
|
@@ -474,6 +497,89 @@ function ContentPanelAddIconButton(props) {
|
|
|
474
497
|
return /* @__PURE__ */ React2.createElement(IconButton, { size: CONTENT_PANEL_ADD_ICON_SIZE, variant: "outlined", ...props }, /* @__PURE__ */ React2.createElement(PlusIcon, { fontSize: CONTENT_PANEL_ADD_ICON_SIZE }));
|
|
475
498
|
}
|
|
476
499
|
|
|
500
|
+
// src/components/panel/popups/popup-header-create-menu-item.tsx
|
|
501
|
+
import * as React4 from "react";
|
|
502
|
+
import { useRef as useRef2 } from "react";
|
|
503
|
+
import { PopupTemplateIcon } from "@elementor/icons";
|
|
504
|
+
import { Box as Box2, ListItemIcon, ListItemText, MenuItem } from "@elementor/ui";
|
|
505
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
506
|
+
|
|
507
|
+
// src/components/panel/popups/site-content-popups-promotion-chip.tsx
|
|
508
|
+
import * as React3 from "react";
|
|
509
|
+
import { forwardRef, useCallback as useCallback2, useImperativeHandle, useState as useState2 } from "react";
|
|
510
|
+
import { trackUpgradePromotionClick, trackViewPromotion } from "@elementor/editor-controls";
|
|
511
|
+
import { PromotionChip, PromotionPopover, useCanvasClickHandler } from "@elementor/editor-ui";
|
|
512
|
+
import { Box } from "@elementor/ui";
|
|
513
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
514
|
+
var TRACKING_DATA = {
|
|
515
|
+
target_name: "popups",
|
|
516
|
+
target_location: "widget_panel"
|
|
517
|
+
};
|
|
518
|
+
var SiteContentPopupsPromotionChip = forwardRef((_, ref) => {
|
|
519
|
+
const [isOpen, setIsOpen] = useState2(false);
|
|
520
|
+
const upgradeUrl = env.popups?.upgrade_url ?? POPUP_SITE_CONTENT_UPGRADE_URL;
|
|
521
|
+
useCanvasClickHandler(isOpen, () => setIsOpen(false));
|
|
522
|
+
const toggle = useCallback2(() => {
|
|
523
|
+
setIsOpen((previous) => {
|
|
524
|
+
if (!previous) {
|
|
525
|
+
trackViewPromotion(TRACKING_DATA);
|
|
526
|
+
}
|
|
527
|
+
return !previous;
|
|
528
|
+
});
|
|
529
|
+
}, []);
|
|
530
|
+
useImperativeHandle(ref, () => ({ toggle }), [toggle]);
|
|
531
|
+
return /* @__PURE__ */ React3.createElement(
|
|
532
|
+
PromotionPopover,
|
|
533
|
+
{
|
|
534
|
+
open: isOpen,
|
|
535
|
+
title: __4("Popups", "elementor"),
|
|
536
|
+
content: __4("Upgrade to continue creating and editing popups.", "elementor"),
|
|
537
|
+
ctaText: __4("Upgrade now", "elementor"),
|
|
538
|
+
ctaUrl: upgradeUrl,
|
|
539
|
+
onClose: (event) => {
|
|
540
|
+
event.stopPropagation();
|
|
541
|
+
setIsOpen(false);
|
|
542
|
+
},
|
|
543
|
+
onCtaClick: () => trackUpgradePromotionClick(TRACKING_DATA)
|
|
544
|
+
},
|
|
545
|
+
/* @__PURE__ */ React3.createElement(
|
|
546
|
+
Box,
|
|
547
|
+
{
|
|
548
|
+
onClick: (event) => {
|
|
549
|
+
event.stopPropagation();
|
|
550
|
+
toggle();
|
|
551
|
+
},
|
|
552
|
+
sx: { cursor: "pointer", display: "inline-flex" }
|
|
553
|
+
},
|
|
554
|
+
/* @__PURE__ */ React3.createElement(PromotionChip, null)
|
|
555
|
+
)
|
|
556
|
+
);
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
// src/components/panel/popups/popup-header-create-menu-item.tsx
|
|
560
|
+
function PopupHeaderCreateMenuItem({ onSelect }) {
|
|
561
|
+
const promotionRef = useRef2(null);
|
|
562
|
+
const canCreate = env.popups?.can_use ?? false;
|
|
563
|
+
const label = __5("Popup", "elementor");
|
|
564
|
+
const handleClick = () => {
|
|
565
|
+
if (!canCreate) {
|
|
566
|
+
promotionRef.current?.toggle();
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
onSelect();
|
|
570
|
+
};
|
|
571
|
+
return /* @__PURE__ */ React4.createElement(MenuItem, { onClick: handleClick }, /* @__PURE__ */ React4.createElement(ListItemIcon, null, /* @__PURE__ */ React4.createElement(PopupTemplateIcon, { fontSize: "small", color: canCreate ? "action" : "disabled" })), /* @__PURE__ */ React4.createElement(
|
|
572
|
+
ListItemText,
|
|
573
|
+
{
|
|
574
|
+
primary: label,
|
|
575
|
+
primaryTypographyProps: {
|
|
576
|
+
variant: "body2",
|
|
577
|
+
color: canCreate ? "text.primary" : "text.disabled"
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
), !canCreate && /* @__PURE__ */ React4.createElement(Box2, { sx: { flexShrink: 0, ml: "auto", pl: 1 } }, /* @__PURE__ */ React4.createElement(SiteContentPopupsPromotionChip, { ref: promotionRef })));
|
|
581
|
+
}
|
|
582
|
+
|
|
477
583
|
// src/components/panel/content-panel-header-add.tsx
|
|
478
584
|
var typeIcons = {
|
|
479
585
|
page: PageTypeIcon2,
|
|
@@ -483,7 +589,7 @@ function HeaderAddMenuItem({ slug, onSelect }) {
|
|
|
483
589
|
const canCreate = useCanCreate(slug);
|
|
484
590
|
const Icon = typeIcons[slug];
|
|
485
591
|
const singularName = postTypesMap[slug].labels.singular_name;
|
|
486
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ React5.createElement(MenuItem2, { disabled: !canCreate, onClick: () => onSelect(slug) }, /* @__PURE__ */ React5.createElement(ListItemIcon2, null, /* @__PURE__ */ React5.createElement(Icon, { fontSize: "small" })), /* @__PURE__ */ React5.createElement(ListItemText2, { primary: singularName, primaryTypographyProps: { variant: "body2" } }));
|
|
487
593
|
}
|
|
488
594
|
function ContentPanelHeaderAdd() {
|
|
489
595
|
const { requestCreate } = useContentPanelCoordinator();
|
|
@@ -492,7 +598,8 @@ function ContentPanelHeaderAdd() {
|
|
|
492
598
|
variant: "popover",
|
|
493
599
|
popupId: "elementor-content-panel-header-add"
|
|
494
600
|
});
|
|
495
|
-
const
|
|
601
|
+
const headerCreateItems = getSiteContentHeaderCreateItems();
|
|
602
|
+
const canAddAny = true;
|
|
496
603
|
const buttonProps = bindTrigger(popupState);
|
|
497
604
|
const menuProps = bindMenu(popupState);
|
|
498
605
|
const handleSelectType = (slug) => {
|
|
@@ -501,31 +608,42 @@ function ContentPanelHeaderAdd() {
|
|
|
501
608
|
requestCreate(slug);
|
|
502
609
|
});
|
|
503
610
|
};
|
|
504
|
-
|
|
611
|
+
const handleSelectPopup = () => {
|
|
612
|
+
popupState.close();
|
|
613
|
+
requestAnimationFrame(() => {
|
|
614
|
+
requestCreate(POPUPS_SITE_CONTENT_SECTION_ID);
|
|
615
|
+
});
|
|
616
|
+
};
|
|
617
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
505
618
|
ContentPanelAddIconButton,
|
|
506
619
|
{
|
|
507
|
-
"aria-label":
|
|
620
|
+
"aria-label": __6("Add new", "elementor"),
|
|
508
621
|
...buttonProps,
|
|
509
622
|
disabled: !canAddAny
|
|
510
623
|
}
|
|
511
|
-
), /* @__PURE__ */
|
|
624
|
+
), /* @__PURE__ */ React5.createElement(Menu, { ...menuProps }, accessibleSlugs.map((slug) => /* @__PURE__ */ React5.createElement(HeaderAddMenuItem, { key: slug, onSelect: handleSelectType, slug })), /* @__PURE__ */ React5.createElement(PopupHeaderCreateMenuItem, { onSelect: handleSelectPopup }), headerCreateItems.map((item) => /* @__PURE__ */ React5.createElement(React5.Fragment, { key: item.id }, item.renderMenuItem(() => {
|
|
625
|
+
popupState.close();
|
|
626
|
+
requestAnimationFrame(() => {
|
|
627
|
+
requestCreate(item.id);
|
|
628
|
+
});
|
|
629
|
+
})))));
|
|
512
630
|
}
|
|
513
631
|
|
|
514
632
|
// src/components/panel/content-panel-toolbar.tsx
|
|
515
|
-
import * as
|
|
516
|
-
import { Box as
|
|
633
|
+
import * as React13 from "react";
|
|
634
|
+
import { Box as Box5, Stack as Stack4 } from "@elementor/ui";
|
|
517
635
|
|
|
518
636
|
// src/components/panel/content-panel-active-filters.tsx
|
|
519
|
-
import * as
|
|
637
|
+
import * as React7 from "react";
|
|
520
638
|
import { Chip, Stack } from "@elementor/ui";
|
|
521
|
-
import { __ as
|
|
639
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
522
640
|
|
|
523
641
|
// src/components/panel/content-panel-clear-filters-button.tsx
|
|
524
|
-
import * as
|
|
642
|
+
import * as React6 from "react";
|
|
525
643
|
import { BrushBigIcon } from "@elementor/icons";
|
|
526
|
-
import { Box, IconButton as IconButton2, Tooltip } from "@elementor/ui";
|
|
644
|
+
import { Box as Box3, IconButton as IconButton2, Tooltip } from "@elementor/ui";
|
|
527
645
|
function ContentPanelClearFiltersButton({ ariaLabel, onClear, sx, tooltipText }) {
|
|
528
|
-
return /* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ React6.createElement(Tooltip, { disableInteractive: true, placement: "top", title: tooltipText }, /* @__PURE__ */ React6.createElement(Box3, null, /* @__PURE__ */ React6.createElement(IconButton2, { "aria-label": ariaLabel, onClick: onClear, size: "tiny", sx }, /* @__PURE__ */ React6.createElement(BrushBigIcon, { fontSize: "tiny" }))));
|
|
529
647
|
}
|
|
530
648
|
|
|
531
649
|
// src/components/panel/content-panel-active-filters.tsx
|
|
@@ -546,7 +664,7 @@ function ContentPanelActiveFilters() {
|
|
|
546
664
|
return null;
|
|
547
665
|
}
|
|
548
666
|
const activeKeys = getActiveSiteContentStatusFilterKeys(statusFilters);
|
|
549
|
-
return /* @__PURE__ */
|
|
667
|
+
return /* @__PURE__ */ React7.createElement(Stack, { alignItems: "center", direction: "row", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(Stack, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 0.5 }, hasSort && /* @__PURE__ */ React7.createElement(
|
|
550
668
|
Chip,
|
|
551
669
|
{
|
|
552
670
|
label: getSiteContentSortLabel(siteContentSort),
|
|
@@ -554,7 +672,7 @@ function ContentPanelActiveFilters() {
|
|
|
554
672
|
size: "tiny",
|
|
555
673
|
sx: contentPanelFilterChipSx
|
|
556
674
|
}
|
|
557
|
-
), activeKeys.map((key) => /* @__PURE__ */
|
|
675
|
+
), activeKeys.map((key) => /* @__PURE__ */ React7.createElement(
|
|
558
676
|
Chip,
|
|
559
677
|
{
|
|
560
678
|
key,
|
|
@@ -563,60 +681,60 @@ function ContentPanelActiveFilters() {
|
|
|
563
681
|
size: "tiny",
|
|
564
682
|
sx: contentPanelFilterChipSx
|
|
565
683
|
}
|
|
566
|
-
))), /* @__PURE__ */
|
|
684
|
+
))), /* @__PURE__ */ React7.createElement(
|
|
567
685
|
ContentPanelClearFiltersButton,
|
|
568
686
|
{
|
|
569
|
-
ariaLabel:
|
|
687
|
+
ariaLabel: __7("Clear Filters", "elementor"),
|
|
570
688
|
onClear: clearActiveToolbarFilters,
|
|
571
689
|
sx: { margin: "0 0 auto auto" },
|
|
572
|
-
tooltipText:
|
|
690
|
+
tooltipText: __7("Clear Filters", "elementor")
|
|
573
691
|
}
|
|
574
692
|
));
|
|
575
693
|
}
|
|
576
694
|
|
|
577
695
|
// src/components/panel/content-panel-search.tsx
|
|
578
|
-
import * as
|
|
696
|
+
import * as React8 from "react";
|
|
579
697
|
import { SearchIcon } from "@elementor/icons";
|
|
580
|
-
import { Box as
|
|
581
|
-
import { __ as
|
|
698
|
+
import { Box as Box4, InputAdornment, TextField } from "@elementor/ui";
|
|
699
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
582
700
|
function ContentPanelSearch() {
|
|
583
701
|
const { searchQuery, setSearchQuery } = useContentPanelCoordinator();
|
|
584
|
-
return /* @__PURE__ */
|
|
702
|
+
return /* @__PURE__ */ React8.createElement(Box4, { component: "search", "aria-label": __8("Search site content", "elementor") }, /* @__PURE__ */ React8.createElement(
|
|
585
703
|
TextField,
|
|
586
704
|
{
|
|
587
705
|
fullWidth: true,
|
|
588
706
|
size: "tiny",
|
|
589
707
|
value: searchQuery,
|
|
590
|
-
placeholder:
|
|
708
|
+
placeholder: __8("Search", "elementor"),
|
|
591
709
|
onChange: (event) => setSearchQuery(event.target.value),
|
|
592
710
|
inputProps: {
|
|
593
|
-
"aria-label":
|
|
711
|
+
"aria-label": __8("Search", "elementor")
|
|
594
712
|
},
|
|
595
713
|
InputProps: {
|
|
596
|
-
startAdornment: /* @__PURE__ */
|
|
714
|
+
startAdornment: /* @__PURE__ */ React8.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React8.createElement(SearchIcon, { fontSize: "tiny" }))
|
|
597
715
|
}
|
|
598
716
|
}
|
|
599
717
|
));
|
|
600
718
|
}
|
|
601
719
|
|
|
602
720
|
// src/components/panel/content-panel-sort.tsx
|
|
603
|
-
import * as
|
|
721
|
+
import * as React10 from "react";
|
|
604
722
|
import { PopoverBody, PopoverHeader } from "@elementor/editor-ui";
|
|
605
723
|
import { ArrowsSortIcon } from "@elementor/icons";
|
|
606
724
|
import { bindPopover, bindToggle, Divider, Popover, ToggleButton, Tooltip as Tooltip2, usePopupState as usePopupState2 } from "@elementor/ui";
|
|
607
|
-
import { __ as
|
|
725
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
608
726
|
|
|
609
727
|
// src/components/panel/content-panel-sort-list.tsx
|
|
610
|
-
import * as
|
|
728
|
+
import * as React9 from "react";
|
|
611
729
|
import { CheckIcon } from "@elementor/icons";
|
|
612
|
-
import { MenuItem as
|
|
613
|
-
var renderSortMenuItemContent = (label, selected) => /* @__PURE__ */
|
|
730
|
+
import { MenuItem as MenuItem3, MenuList, Stack as Stack2, Typography } from "@elementor/ui";
|
|
731
|
+
var renderSortMenuItemContent = (label, selected) => /* @__PURE__ */ React9.createElement(Stack2, { alignItems: "center", direction: "row", gap: 1, width: "100%" }, /* @__PURE__ */ React9.createElement(Typography, { sx: { color: "text.secondary", flex: 1 }, variant: "caption" }, label), selected ? /* @__PURE__ */ React9.createElement(CheckIcon, { "aria-hidden": true, fontSize: "tiny" }) : null);
|
|
614
732
|
function ContentPanelSortList() {
|
|
615
733
|
const { setSiteContentSort, siteContentSort } = useContentPanelCoordinator();
|
|
616
|
-
return /* @__PURE__ */
|
|
734
|
+
return /* @__PURE__ */ React9.createElement(MenuList, { dense: true }, SITE_CONTENT_SORT_OPTIONS.map((option) => {
|
|
617
735
|
const isSelected = siteContentSort === option;
|
|
618
|
-
return /* @__PURE__ */
|
|
619
|
-
|
|
736
|
+
return /* @__PURE__ */ React9.createElement(
|
|
737
|
+
MenuItem3,
|
|
620
738
|
{
|
|
621
739
|
key: option,
|
|
622
740
|
"aria-checked": isSelected,
|
|
@@ -637,17 +755,17 @@ function ContentPanelSort() {
|
|
|
637
755
|
disableAutoFocus: true
|
|
638
756
|
});
|
|
639
757
|
const hasActiveSort = hasActiveSiteContentSort(siteContentSort);
|
|
640
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(Tooltip2, { placement: "top", title: __9("Sort", "elementor") }, /* @__PURE__ */ React10.createElement(
|
|
641
759
|
ToggleButton,
|
|
642
760
|
{
|
|
643
|
-
"aria-label":
|
|
761
|
+
"aria-label": __9("Sort", "elementor"),
|
|
644
762
|
selected: popupState.isOpen || hasActiveSort,
|
|
645
763
|
size: "tiny",
|
|
646
764
|
value: "sort",
|
|
647
765
|
...bindToggle(popupState)
|
|
648
766
|
},
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
)), /* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ React10.createElement(ArrowsSortIcon, { fontSize: "tiny" })
|
|
768
|
+
)), /* @__PURE__ */ React10.createElement(
|
|
651
769
|
Popover,
|
|
652
770
|
{
|
|
653
771
|
anchorOrigin: {
|
|
@@ -663,41 +781,41 @@ function ContentPanelSort() {
|
|
|
663
781
|
},
|
|
664
782
|
...bindPopover(popupState)
|
|
665
783
|
},
|
|
666
|
-
/* @__PURE__ */
|
|
784
|
+
/* @__PURE__ */ React10.createElement(
|
|
667
785
|
PopoverHeader,
|
|
668
786
|
{
|
|
669
787
|
actions: hasActiveSort ? [
|
|
670
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ React10.createElement(
|
|
671
789
|
ContentPanelClearFiltersButton,
|
|
672
790
|
{
|
|
673
|
-
ariaLabel:
|
|
791
|
+
ariaLabel: __9("Clear sort", "elementor"),
|
|
674
792
|
key: "clear-sort",
|
|
675
793
|
onClear: clearSiteContentSort,
|
|
676
|
-
tooltipText:
|
|
794
|
+
tooltipText: __9("Clear sort", "elementor")
|
|
677
795
|
}
|
|
678
796
|
)
|
|
679
797
|
] : [],
|
|
680
|
-
icon: /* @__PURE__ */
|
|
798
|
+
icon: /* @__PURE__ */ React10.createElement(ArrowsSortIcon, { fontSize: "tiny" }),
|
|
681
799
|
onClose: popupState.close,
|
|
682
|
-
title:
|
|
800
|
+
title: __9("Sort", "elementor")
|
|
683
801
|
}
|
|
684
802
|
),
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ React10.createElement(Divider, { sx: { borderWidth: "1px 0 0 0" } }),
|
|
804
|
+
/* @__PURE__ */ React10.createElement(PopoverBody, { height: "auto", width: SITE_CONTENT_SORT_POPOVER_WIDTH_PX }, /* @__PURE__ */ React10.createElement(ContentPanelSortList, null))
|
|
687
805
|
));
|
|
688
806
|
}
|
|
689
807
|
|
|
690
808
|
// src/components/panel/content-panel-status-filter.tsx
|
|
691
|
-
import * as
|
|
809
|
+
import * as React12 from "react";
|
|
692
810
|
import { PopoverBody as PopoverBody2, PopoverHeader as PopoverHeader2 } from "@elementor/editor-ui";
|
|
693
811
|
import { FilterIcon } from "@elementor/icons";
|
|
694
812
|
import { bindPopover as bindPopover2, bindToggle as bindToggle2, Divider as Divider2, Popover as Popover2, ToggleButton as ToggleButton2, Tooltip as Tooltip3, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
695
|
-
import { __ as
|
|
813
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
696
814
|
|
|
697
815
|
// src/components/panel/content-panel-status-filter-list.tsx
|
|
698
|
-
import * as
|
|
816
|
+
import * as React11 from "react";
|
|
699
817
|
import { CheckIcon as CheckIcon2 } from "@elementor/icons";
|
|
700
|
-
import { MenuItem as
|
|
818
|
+
import { MenuItem as MenuItem4, MenuList as MenuList2, Stack as Stack3, Typography as Typography2 } from "@elementor/ui";
|
|
701
819
|
|
|
702
820
|
// src/hooks/use-site-content-status-filter-counts.ts
|
|
703
821
|
import { useQuery as useQuery2 } from "@elementor/query";
|
|
@@ -739,7 +857,7 @@ function useSiteContentStatusFilterCounts(postTypes, enabled) {
|
|
|
739
857
|
}
|
|
740
858
|
|
|
741
859
|
// src/components/panel/content-panel-status-filter-list.tsx
|
|
742
|
-
var renderFilterMenuItemContent = (label, selected) => /* @__PURE__ */
|
|
860
|
+
var renderFilterMenuItemContent = (label, selected) => /* @__PURE__ */ React11.createElement(Stack3, { alignItems: "center", direction: "row", gap: 1, width: "100%" }, /* @__PURE__ */ React11.createElement(Typography2, { sx: { color: "text.secondary", flex: 1 }, variant: "caption" }, label), selected ? /* @__PURE__ */ React11.createElement(CheckIcon2, { "aria-hidden": true, fontSize: "tiny" }) : null);
|
|
743
861
|
function ContentPanelStatusFilterList({ loadCounts }) {
|
|
744
862
|
const { clearStatusFilters, statusFilters, toggleStatusFilter } = useContentPanelCoordinator();
|
|
745
863
|
const { accessiblePostTypes } = useAccessiblePanelPostTypes();
|
|
@@ -751,8 +869,8 @@ function ContentPanelStatusFilterList({ loadCounts }) {
|
|
|
751
869
|
const visibleFilters = SITE_CONTENT_SELECTABLE_STATUS_FILTERS.filter(
|
|
752
870
|
(filter) => shouldShowSiteContentStatusFilterRow(statusCounts?.[filter], isLoadingCounts, statusFilters[filter])
|
|
753
871
|
);
|
|
754
|
-
return /* @__PURE__ */
|
|
755
|
-
|
|
872
|
+
return /* @__PURE__ */ React11.createElement(MenuList2, { dense: true }, /* @__PURE__ */ React11.createElement(
|
|
873
|
+
MenuItem4,
|
|
756
874
|
{
|
|
757
875
|
"aria-checked": isAllSelected,
|
|
758
876
|
onClick: clearStatusFilters,
|
|
@@ -762,8 +880,8 @@ function ContentPanelStatusFilterList({ loadCounts }) {
|
|
|
762
880
|
renderFilterMenuItemContent(SITE_CONTENT_ALL_FILTER_LABEL, isAllSelected)
|
|
763
881
|
), visibleFilters.map((filter) => {
|
|
764
882
|
const isSelected = statusFilters[filter];
|
|
765
|
-
return /* @__PURE__ */
|
|
766
|
-
|
|
883
|
+
return /* @__PURE__ */ React11.createElement(
|
|
884
|
+
MenuItem4,
|
|
767
885
|
{
|
|
768
886
|
key: filter,
|
|
769
887
|
"aria-checked": isSelected,
|
|
@@ -784,17 +902,17 @@ function ContentPanelStatusFilter() {
|
|
|
784
902
|
disableAutoFocus: true
|
|
785
903
|
});
|
|
786
904
|
const hasActiveFilters = hasActiveSiteContentStatusFilters(statusFilters);
|
|
787
|
-
return /* @__PURE__ */
|
|
905
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(Tooltip3, { placement: "top", title: __10("Filters", "elementor") }, /* @__PURE__ */ React12.createElement(
|
|
788
906
|
ToggleButton2,
|
|
789
907
|
{
|
|
790
|
-
"aria-label":
|
|
908
|
+
"aria-label": __10("Filters", "elementor"),
|
|
791
909
|
selected: popupState.isOpen || hasActiveFilters,
|
|
792
910
|
size: "tiny",
|
|
793
911
|
value: "filter",
|
|
794
912
|
...bindToggle2(popupState)
|
|
795
913
|
},
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
)), /* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ React12.createElement(FilterIcon, { fontSize: "tiny" })
|
|
915
|
+
)), /* @__PURE__ */ React12.createElement(
|
|
798
916
|
Popover2,
|
|
799
917
|
{
|
|
800
918
|
anchorOrigin: {
|
|
@@ -810,40 +928,40 @@ function ContentPanelStatusFilter() {
|
|
|
810
928
|
},
|
|
811
929
|
...bindPopover2(popupState)
|
|
812
930
|
},
|
|
813
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ React12.createElement(
|
|
814
932
|
PopoverHeader2,
|
|
815
933
|
{
|
|
816
934
|
actions: hasActiveFilters ? [
|
|
817
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ React12.createElement(
|
|
818
936
|
ContentPanelClearFiltersButton,
|
|
819
937
|
{
|
|
820
|
-
ariaLabel:
|
|
938
|
+
ariaLabel: __10("Clear all", "elementor"),
|
|
821
939
|
key: "clear-all-filters",
|
|
822
940
|
onClear: clearStatusFilters,
|
|
823
|
-
tooltipText:
|
|
941
|
+
tooltipText: __10("Clear all", "elementor")
|
|
824
942
|
}
|
|
825
943
|
)
|
|
826
944
|
] : [],
|
|
827
|
-
icon: /* @__PURE__ */
|
|
945
|
+
icon: /* @__PURE__ */ React12.createElement(FilterIcon, { fontSize: "tiny" }),
|
|
828
946
|
onClose: popupState.close,
|
|
829
|
-
title:
|
|
947
|
+
title: __10("Filters", "elementor")
|
|
830
948
|
}
|
|
831
949
|
),
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ React12.createElement(Divider2, { sx: { borderWidth: "1px 0 0 0" } }),
|
|
951
|
+
/* @__PURE__ */ React12.createElement(PopoverBody2, { height: "auto", width: SITE_CONTENT_FILTER_POPOVER_WIDTH_PX }, /* @__PURE__ */ React12.createElement(ContentPanelStatusFilterList, { loadCounts: popupState.isOpen }))
|
|
834
952
|
));
|
|
835
953
|
}
|
|
836
954
|
|
|
837
955
|
// src/components/panel/content-panel-toolbar.tsx
|
|
838
956
|
function ContentPanelToolbar() {
|
|
839
|
-
return /* @__PURE__ */
|
|
957
|
+
return /* @__PURE__ */ React13.createElement(Box5, { sx: contentPanelSearchBoxSx }, /* @__PURE__ */ React13.createElement(Stack4, { gap: 0.75, width: "100%" }, /* @__PURE__ */ React13.createElement(Stack4, { alignItems: "center", direction: "row", gap: 0.5, width: "100%" }, /* @__PURE__ */ React13.createElement(Box5, { sx: { flexGrow: 1, minWidth: 0 } }, /* @__PURE__ */ React13.createElement(ContentPanelSearch, null)), /* @__PURE__ */ React13.createElement(ContentPanelStatusFilter, null), /* @__PURE__ */ React13.createElement(ContentPanelSort, null)), /* @__PURE__ */ React13.createElement(ContentPanelActiveFilters, null)));
|
|
840
958
|
}
|
|
841
959
|
|
|
842
960
|
// src/components/panel/error-snackbar.tsx
|
|
843
|
-
import * as
|
|
961
|
+
import * as React14 from "react";
|
|
844
962
|
import { Alert, Snackbar, Typography as Typography3 } from "@elementor/ui";
|
|
845
963
|
var ErrorSnackbar = ({ open, onClose }) => {
|
|
846
|
-
return /* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ React14.createElement(
|
|
847
965
|
Snackbar,
|
|
848
966
|
{
|
|
849
967
|
open,
|
|
@@ -853,7 +971,7 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
853
971
|
horizontal: "left"
|
|
854
972
|
}
|
|
855
973
|
},
|
|
856
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ React14.createElement(Alert, { onClose, severity: "error", sx: { width: "100%" } }, /* @__PURE__ */ React14.createElement(
|
|
857
975
|
Typography3,
|
|
858
976
|
{
|
|
859
977
|
component: "span",
|
|
@@ -868,12 +986,12 @@ var ErrorSnackbar = ({ open, onClose }) => {
|
|
|
868
986
|
var error_snackbar_default = ErrorSnackbar;
|
|
869
987
|
|
|
870
988
|
// src/components/panel/shell-panel-body-content.tsx
|
|
871
|
-
import * as
|
|
989
|
+
import * as React37 from "react";
|
|
872
990
|
import { List as List2, Skeleton as Skeleton2, Stack as Stack8 } from "@elementor/ui";
|
|
873
991
|
|
|
874
992
|
// src/contexts/post-list-context.tsx
|
|
875
|
-
import * as
|
|
876
|
-
import { createContext as createContext2, useContext as useContext2, useState as
|
|
993
|
+
import * as React15 from "react";
|
|
994
|
+
import { createContext as createContext2, useContext as useContext2, useState as useState3 } from "react";
|
|
877
995
|
var defaultValues = {
|
|
878
996
|
type: "page",
|
|
879
997
|
editMode: { mode: "none", details: {} },
|
|
@@ -887,11 +1005,11 @@ var PostListContextProvider = ({
|
|
|
887
1005
|
setError,
|
|
888
1006
|
children
|
|
889
1007
|
}) => {
|
|
890
|
-
const [editMode, setEditMode] =
|
|
1008
|
+
const [editMode, setEditMode] = useState3(defaultValues.editMode);
|
|
891
1009
|
const resetEditMode = () => {
|
|
892
1010
|
setEditMode(defaultValues.editMode);
|
|
893
1011
|
};
|
|
894
|
-
return /* @__PURE__ */
|
|
1012
|
+
return /* @__PURE__ */ React15.createElement(
|
|
895
1013
|
PostListContext.Provider,
|
|
896
1014
|
{
|
|
897
1015
|
value: {
|
|
@@ -913,11 +1031,26 @@ function usePostListContext() {
|
|
|
913
1031
|
return context;
|
|
914
1032
|
}
|
|
915
1033
|
|
|
1034
|
+
// src/site-content-sections.ts
|
|
1035
|
+
var registeredSections = /* @__PURE__ */ new Map();
|
|
1036
|
+
var DEFAULT_SECTION_PRIORITY = 0;
|
|
1037
|
+
function registerSiteContentSection(section) {
|
|
1038
|
+
registeredSections.set(section.id, section);
|
|
1039
|
+
}
|
|
1040
|
+
function getSiteContentSections() {
|
|
1041
|
+
return Array.from(registeredSections.values()).sort(
|
|
1042
|
+
(first, second) => (first.priority ?? DEFAULT_SECTION_PRIORITY) - (second.priority ?? DEFAULT_SECTION_PRIORITY)
|
|
1043
|
+
);
|
|
1044
|
+
}
|
|
1045
|
+
function resetSiteContentSections() {
|
|
1046
|
+
registeredSections.clear();
|
|
1047
|
+
}
|
|
1048
|
+
|
|
916
1049
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
917
|
-
import * as
|
|
918
|
-
import { useEffect as useEffect2, useMemo as useMemo4, useRef as
|
|
919
|
-
import { Box as
|
|
920
|
-
import { __ as
|
|
1050
|
+
import * as React35 from "react";
|
|
1051
|
+
import { useEffect as useEffect2, useMemo as useMemo4, useRef as useRef5, useState as useState9 } from "react";
|
|
1052
|
+
import { Box as Box11, Skeleton, Typography as Typography7 } from "@elementor/ui";
|
|
1053
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
921
1054
|
|
|
922
1055
|
// src/hooks/use-homepage.ts
|
|
923
1056
|
import { useQuery as useQuery3 } from "@elementor/query";
|
|
@@ -947,7 +1080,7 @@ function useHomepage() {
|
|
|
947
1080
|
}
|
|
948
1081
|
|
|
949
1082
|
// src/hooks/use-post-list-pagination.ts
|
|
950
|
-
import { useCallback as
|
|
1083
|
+
import { useCallback as useCallback3, useEffect, useRef as useRef3, useState as useState4 } from "react";
|
|
951
1084
|
function usePostListPagination({
|
|
952
1085
|
fetchNextPage,
|
|
953
1086
|
hasNextPage,
|
|
@@ -956,8 +1089,8 @@ function usePostListPagination({
|
|
|
956
1089
|
resetKey,
|
|
957
1090
|
totalCount
|
|
958
1091
|
}) {
|
|
959
|
-
const [visibleCount, setVisibleCount] =
|
|
960
|
-
const pendingVisibleTargetRef =
|
|
1092
|
+
const [visibleCount, setVisibleCount] = useState4(POST_PER_PAGE);
|
|
1093
|
+
const pendingVisibleTargetRef = useRef3(null);
|
|
961
1094
|
useEffect(() => {
|
|
962
1095
|
setVisibleCount(POST_PER_PAGE);
|
|
963
1096
|
pendingVisibleTargetRef.current = null;
|
|
@@ -979,7 +1112,7 @@ function usePostListPagination({
|
|
|
979
1112
|
}, [isFetchingNextPage, loadedCount]);
|
|
980
1113
|
const canShowLess = visibleCount > POST_PER_PAGE;
|
|
981
1114
|
const canLoadMore = visibleCount < loadedCount || hasNextPage;
|
|
982
|
-
const handleLoadMore =
|
|
1115
|
+
const handleLoadMore = useCallback3(() => {
|
|
983
1116
|
if (isFetchingNextPage || !canLoadMore) {
|
|
984
1117
|
return;
|
|
985
1118
|
}
|
|
@@ -997,7 +1130,7 @@ function usePostListPagination({
|
|
|
997
1130
|
setVisibleCount(Math.min(visibleCount + POST_PER_PAGE, loadedCount));
|
|
998
1131
|
}
|
|
999
1132
|
}, [canLoadMore, fetchNextPage, hasNextPage, isFetchingNextPage, loadedCount, totalCount, visibleCount]);
|
|
1000
|
-
const handleShowLess =
|
|
1133
|
+
const handleShowLess = useCallback3(() => {
|
|
1001
1134
|
pendingVisibleTargetRef.current = null;
|
|
1002
1135
|
setVisibleCount(POST_PER_PAGE);
|
|
1003
1136
|
}, []);
|
|
@@ -1066,18 +1199,18 @@ function usePostsBaselineTotal(postTypeSlug, enabled, status = "any") {
|
|
|
1066
1199
|
}
|
|
1067
1200
|
|
|
1068
1201
|
// src/components/panel/section-add-button.tsx
|
|
1069
|
-
import * as
|
|
1070
|
-
import { __ as
|
|
1202
|
+
import * as React16 from "react";
|
|
1203
|
+
import { __ as __11, sprintf } from "@wordpress/i18n";
|
|
1071
1204
|
function SectionAddButton({ onBeforeCreate }) {
|
|
1072
1205
|
const { type, setEditMode } = usePostListContext();
|
|
1073
1206
|
const canCreate = useCanCreate(type);
|
|
1074
1207
|
const singularName = postTypesMap[type].labels.singular_name;
|
|
1075
1208
|
const ariaLabel = sprintf(
|
|
1076
1209
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
1077
|
-
|
|
1210
|
+
__11("New %s", "elementor"),
|
|
1078
1211
|
singularName
|
|
1079
1212
|
);
|
|
1080
|
-
return /* @__PURE__ */
|
|
1213
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1081
1214
|
ContentPanelAddIconButton,
|
|
1082
1215
|
{
|
|
1083
1216
|
"aria-label": ariaLabel,
|
|
@@ -1092,10 +1225,10 @@ function SectionAddButton({ onBeforeCreate }) {
|
|
|
1092
1225
|
}
|
|
1093
1226
|
|
|
1094
1227
|
// src/components/panel/posts-list/collapsible-list.tsx
|
|
1095
|
-
import * as
|
|
1228
|
+
import * as React17 from "react";
|
|
1096
1229
|
import { useId } from "react";
|
|
1097
1230
|
import { CollapseIcon } from "@elementor/editor-ui";
|
|
1098
|
-
import { Box as
|
|
1231
|
+
import { Box as Box6, Chip as Chip2, Collapse, Divider as Divider3, List, ListItemButton, ListItemText as ListItemText3, Stack as Stack5 } from "@elementor/ui";
|
|
1099
1232
|
var sectionHeaderListItemButtonSx = {
|
|
1100
1233
|
flexGrow: 1,
|
|
1101
1234
|
justifyContent: "flex-start",
|
|
@@ -1124,8 +1257,8 @@ function CollapsibleList({
|
|
|
1124
1257
|
const chipLabel = countChipLabel ?? count.toString();
|
|
1125
1258
|
const sectionHeaderAriaLabel = getSectionHeaderAriaLabel(title, chipLabel);
|
|
1126
1259
|
const handleClick = () => onOpenChange(!isOpen);
|
|
1127
|
-
return /* @__PURE__ */
|
|
1128
|
-
|
|
1260
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
1261
|
+
Box6,
|
|
1129
1262
|
{
|
|
1130
1263
|
sx: {
|
|
1131
1264
|
...contentPanelSectionHeaderSx,
|
|
@@ -1135,7 +1268,7 @@ function CollapsibleList({
|
|
|
1135
1268
|
width: "100%"
|
|
1136
1269
|
}
|
|
1137
1270
|
},
|
|
1138
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ React17.createElement(
|
|
1139
1272
|
ListItemButton,
|
|
1140
1273
|
{
|
|
1141
1274
|
ref: headerRef,
|
|
@@ -1149,8 +1282,8 @@ function CollapsibleList({
|
|
|
1149
1282
|
onClick: handleClick,
|
|
1150
1283
|
sx: sectionHeaderListItemButtonSx
|
|
1151
1284
|
},
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
|
|
1285
|
+
/* @__PURE__ */ React17.createElement(Stack5, { alignItems: "center", direction: "row", flexGrow: 1, gap: 0.5, minWidth: 0, width: "100%" }, /* @__PURE__ */ React17.createElement(Stack5, { alignItems: "center", direction: "row", flex: 1, gap: 0.5, minWidth: 0 }, /* @__PURE__ */ React17.createElement(
|
|
1286
|
+
ListItemText3,
|
|
1154
1287
|
{
|
|
1155
1288
|
secondary: title,
|
|
1156
1289
|
secondaryTypographyProps: {
|
|
@@ -1160,9 +1293,9 @@ function CollapsibleList({
|
|
|
1160
1293
|
},
|
|
1161
1294
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
1162
1295
|
}
|
|
1163
|
-
), /* @__PURE__ */
|
|
1296
|
+
), /* @__PURE__ */ React17.createElement(Chip2, { label: chipLabel, size: "tiny" })), /* @__PURE__ */ React17.createElement(CollapseIcon, { color: "secondary", fontSize: "tiny", open: isOpen, sx: { flexShrink: 0 } }))
|
|
1164
1297
|
),
|
|
1165
|
-
trailingActions && /* @__PURE__ */
|
|
1298
|
+
trailingActions && /* @__PURE__ */ React17.createElement(
|
|
1166
1299
|
Stack5,
|
|
1167
1300
|
{
|
|
1168
1301
|
alignItems: "center",
|
|
@@ -1173,17 +1306,17 @@ function CollapsibleList({
|
|
|
1173
1306
|
},
|
|
1174
1307
|
trailingActions
|
|
1175
1308
|
)
|
|
1176
|
-
), /* @__PURE__ */
|
|
1309
|
+
), /* @__PURE__ */ React17.createElement(Collapse, { "aria-labelledby": labelId, id: contentId, in: isOpen, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React17.createElement(List, { dense: true, disablePadding: true, sx: contentPanelListSectionListSx }, children)), /* @__PURE__ */ React17.createElement(Divider3, null));
|
|
1177
1310
|
}
|
|
1178
1311
|
|
|
1179
1312
|
// src/components/panel/posts-list/error-state.tsx
|
|
1180
|
-
import * as
|
|
1313
|
+
import * as React18 from "react";
|
|
1181
1314
|
import { Error404TemplateIcon } from "@elementor/icons";
|
|
1182
|
-
import { Box as
|
|
1183
|
-
import { __ as
|
|
1315
|
+
import { Box as Box7, Link, Typography as Typography4 } from "@elementor/ui";
|
|
1316
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1184
1317
|
function ErrorState() {
|
|
1185
|
-
return /* @__PURE__ */
|
|
1186
|
-
|
|
1318
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1319
|
+
Box7,
|
|
1187
1320
|
{
|
|
1188
1321
|
sx: {
|
|
1189
1322
|
display: "flex",
|
|
@@ -1194,9 +1327,9 @@ function ErrorState() {
|
|
|
1194
1327
|
gap: "16px"
|
|
1195
1328
|
}
|
|
1196
1329
|
},
|
|
1197
|
-
/* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1199
|
-
|
|
1330
|
+
/* @__PURE__ */ React18.createElement(Error404TemplateIcon, null),
|
|
1331
|
+
/* @__PURE__ */ React18.createElement(
|
|
1332
|
+
Box7,
|
|
1200
1333
|
{
|
|
1201
1334
|
sx: {
|
|
1202
1335
|
display: "flex",
|
|
@@ -1206,19 +1339,19 @@ function ErrorState() {
|
|
|
1206
1339
|
gap: "8px"
|
|
1207
1340
|
}
|
|
1208
1341
|
},
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ React18.createElement(Typography4, { variant: "body1", color: "text.primary" }, __12("We couldn\u2019t display your pages.", "elementor")),
|
|
1343
|
+
/* @__PURE__ */ React18.createElement(Box7, null, /* @__PURE__ */ React18.createElement(Typography4, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __12("It\u2019s probably a temporary issue.", "elementor")), /* @__PURE__ */ React18.createElement(Typography4, { variant: "body2", color: "text.primary", sx: { textAlign: "center" } }, __12("If the problem persists,", "elementor"), " ", /* @__PURE__ */ React18.createElement(Link, { target: "_blank", href: "https://go.elementor.com/wp-editor-support-open-ticket/" }, "Notify support")))
|
|
1211
1344
|
)
|
|
1212
1345
|
);
|
|
1213
1346
|
}
|
|
1214
1347
|
|
|
1215
1348
|
// src/components/panel/posts-list/post-list-item.tsx
|
|
1216
|
-
import * as
|
|
1349
|
+
import * as React33 from "react";
|
|
1217
1350
|
|
|
1218
1351
|
// src/components/panel/posts-list/list-items/list-item-create.tsx
|
|
1219
|
-
import * as
|
|
1352
|
+
import * as React20 from "react";
|
|
1220
1353
|
import { __useNavigateToDocument as useNavigateToDocument } from "@elementor/editor-documents";
|
|
1221
|
-
import { __ as
|
|
1354
|
+
import { __ as __14, sprintf as sprintf2 } from "@wordpress/i18n";
|
|
1222
1355
|
|
|
1223
1356
|
// src/hooks/use-posts-actions.ts
|
|
1224
1357
|
import { useMutation, useQueryClient } from "@elementor/query";
|
|
@@ -1299,11 +1432,11 @@ function useInvalidatePosts(postTypeSlug) {
|
|
|
1299
1432
|
}
|
|
1300
1433
|
|
|
1301
1434
|
// src/components/panel/posts-list/list-items/edit-mode-template.tsx
|
|
1302
|
-
import * as
|
|
1303
|
-
import { useRef as
|
|
1435
|
+
import * as React19 from "react";
|
|
1436
|
+
import { useRef as useRef4, useState as useState5 } from "react";
|
|
1304
1437
|
import { XIcon } from "@elementor/icons";
|
|
1305
|
-
import { Box as
|
|
1306
|
-
import { __ as
|
|
1438
|
+
import { Box as Box8, CircularProgress, IconButton as IconButton3, ListItem, ListItemText as ListItemText4 } from "@elementor/ui";
|
|
1439
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1307
1440
|
var EDIT_ROW_FOCUS_BORDER_WIDTH_PX = 2;
|
|
1308
1441
|
var EDIT_ROW_MIN_HEIGHT_PX = 36;
|
|
1309
1442
|
var editModeListItemButtonSx = {
|
|
@@ -1340,18 +1473,19 @@ var editRowInputSx = {
|
|
|
1340
1473
|
padding: 0,
|
|
1341
1474
|
width: "100%"
|
|
1342
1475
|
};
|
|
1343
|
-
function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
1476
|
+
function EditModeTemplate({ postTitle, isLoading, callback, onDismiss }) {
|
|
1344
1477
|
const { resetEditMode } = usePostListContext();
|
|
1345
|
-
const
|
|
1346
|
-
const [
|
|
1347
|
-
const [
|
|
1348
|
-
const
|
|
1478
|
+
const dismissEditMode = onDismiss ?? resetEditMode;
|
|
1479
|
+
const [title, setTitle] = useState5(postTitle);
|
|
1480
|
+
const [touched, setTouched] = useState5(false);
|
|
1481
|
+
const [inputError, setInputError] = useState5(null);
|
|
1482
|
+
const closeButton = useRef4();
|
|
1349
1483
|
const onBlur = (e) => {
|
|
1350
1484
|
if (closeButton.current === e.relatedTarget) {
|
|
1351
1485
|
return;
|
|
1352
1486
|
}
|
|
1353
1487
|
if (!touched) {
|
|
1354
|
-
|
|
1488
|
+
dismissEditMode();
|
|
1355
1489
|
return;
|
|
1356
1490
|
}
|
|
1357
1491
|
runCallback();
|
|
@@ -1375,32 +1509,32 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
1375
1509
|
}
|
|
1376
1510
|
const value = e.target.value;
|
|
1377
1511
|
if (!validateInput(value)) {
|
|
1378
|
-
setInputError(
|
|
1512
|
+
setInputError(__13("Name is required", "elementor"));
|
|
1379
1513
|
} else {
|
|
1380
1514
|
setInputError(null);
|
|
1381
1515
|
}
|
|
1382
1516
|
setTitle(value);
|
|
1383
1517
|
};
|
|
1384
|
-
return /* @__PURE__ */
|
|
1518
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
1385
1519
|
ListItem,
|
|
1386
1520
|
{
|
|
1387
1521
|
disablePadding: true,
|
|
1388
1522
|
sx: contentPanelListRowPaddingSx,
|
|
1389
|
-
secondaryAction: /* @__PURE__ */
|
|
1523
|
+
secondaryAction: /* @__PURE__ */ React19.createElement(CloseButton, { isLoading, closeButton, onDismiss: dismissEditMode })
|
|
1390
1524
|
},
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
|
|
1525
|
+
/* @__PURE__ */ React19.createElement(
|
|
1526
|
+
Box8,
|
|
1393
1527
|
{
|
|
1394
1528
|
component: "form",
|
|
1395
1529
|
onSubmit: onFormSubmit,
|
|
1396
1530
|
sx: { ...editModeListItemButtonSx, display: "flex", width: "100%" }
|
|
1397
1531
|
},
|
|
1398
|
-
/* @__PURE__ */
|
|
1399
|
-
|
|
1532
|
+
/* @__PURE__ */ React19.createElement(Box8, { sx: editRowIndicatorSx(!!inputError) }, /* @__PURE__ */ React19.createElement(
|
|
1533
|
+
Box8,
|
|
1400
1534
|
{
|
|
1401
1535
|
autoFocus: true,
|
|
1402
1536
|
"aria-invalid": !!inputError,
|
|
1403
|
-
"aria-label":
|
|
1537
|
+
"aria-label": __13("Name", "elementor"),
|
|
1404
1538
|
component: "input",
|
|
1405
1539
|
disabled: isLoading,
|
|
1406
1540
|
onBlur,
|
|
@@ -1411,11 +1545,10 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
1411
1545
|
}
|
|
1412
1546
|
))
|
|
1413
1547
|
)
|
|
1414
|
-
), inputError && /* @__PURE__ */
|
|
1548
|
+
), inputError && /* @__PURE__ */ React19.createElement(ListItem, { disablePadding: true, sx: contentPanelListRowPaddingSx }, /* @__PURE__ */ React19.createElement(ListItemText4, { sx: { color: "error.main", ...contentPanelListRowTitleSx } }, inputError)));
|
|
1415
1549
|
}
|
|
1416
|
-
function CloseButton({ isLoading, closeButton }) {
|
|
1417
|
-
|
|
1418
|
-
return /* @__PURE__ */ React17.createElement(IconButton3, { size: "tiny", color: "secondary", onClick: resetEditMode, ref: closeButton, disabled: isLoading }, isLoading ? /* @__PURE__ */ React17.createElement(CircularProgress, { size: "1rem" }) : /* @__PURE__ */ React17.createElement(XIcon, { fontSize: "tiny" }));
|
|
1550
|
+
function CloseButton({ isLoading, closeButton, onDismiss }) {
|
|
1551
|
+
return /* @__PURE__ */ React19.createElement(IconButton3, { size: "tiny", color: "secondary", onClick: onDismiss, ref: closeButton, disabled: isLoading }, isLoading ? /* @__PURE__ */ React19.createElement(CircularProgress, { size: "1rem" }) : /* @__PURE__ */ React19.createElement(XIcon, { fontSize: "tiny" }));
|
|
1419
1552
|
}
|
|
1420
1553
|
|
|
1421
1554
|
// src/components/panel/posts-list/list-items/list-item-create.tsx
|
|
@@ -1439,10 +1572,10 @@ function ListItemCreate() {
|
|
|
1439
1572
|
};
|
|
1440
1573
|
const newItemLabel = sprintf2(
|
|
1441
1574
|
/* translators: %s: Post type singular name (e.g. Page, Post). */
|
|
1442
|
-
|
|
1575
|
+
__14("New %s", "elementor"),
|
|
1443
1576
|
postTypesMap[type].labels.singular_name
|
|
1444
1577
|
);
|
|
1445
|
-
return /* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1446
1579
|
EditModeTemplate,
|
|
1447
1580
|
{
|
|
1448
1581
|
postTitle: newItemLabel,
|
|
@@ -1453,9 +1586,9 @@ function ListItemCreate() {
|
|
|
1453
1586
|
}
|
|
1454
1587
|
|
|
1455
1588
|
// src/components/panel/posts-list/list-items/list-item-duplicate.tsx
|
|
1456
|
-
import * as
|
|
1589
|
+
import * as React21 from "react";
|
|
1457
1590
|
import { __useNavigateToDocument as useNavigateToDocument2 } from "@elementor/editor-documents";
|
|
1458
|
-
import { __ as
|
|
1591
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1459
1592
|
function ListItemDuplicate() {
|
|
1460
1593
|
const { type, editMode, resetEditMode } = usePostListContext();
|
|
1461
1594
|
const navigateToDocument = useNavigateToDocument2();
|
|
@@ -1477,10 +1610,10 @@ function ListItemDuplicate() {
|
|
|
1477
1610
|
resetEditMode();
|
|
1478
1611
|
}
|
|
1479
1612
|
};
|
|
1480
|
-
return /* @__PURE__ */
|
|
1613
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1481
1614
|
EditModeTemplate,
|
|
1482
1615
|
{
|
|
1483
|
-
postTitle: `${editMode.details.title} ${
|
|
1616
|
+
postTitle: `${editMode.details.title} ${__15("copy", "elementor")}`,
|
|
1484
1617
|
isLoading: duplicatePost.isPending,
|
|
1485
1618
|
callback: duplicatePostCallback
|
|
1486
1619
|
}
|
|
@@ -1488,7 +1621,7 @@ function ListItemDuplicate() {
|
|
|
1488
1621
|
}
|
|
1489
1622
|
|
|
1490
1623
|
// src/components/panel/posts-list/list-items/list-item-rename.tsx
|
|
1491
|
-
import * as
|
|
1624
|
+
import * as React22 from "react";
|
|
1492
1625
|
import { __useActiveDocument as useActiveDocument } from "@elementor/editor-documents";
|
|
1493
1626
|
|
|
1494
1627
|
// src/hooks/use-rename-active-document.ts
|
|
@@ -1539,12 +1672,12 @@ function ListItemRename({ post }) {
|
|
|
1539
1672
|
resetEditMode();
|
|
1540
1673
|
}
|
|
1541
1674
|
};
|
|
1542
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ React22.createElement(EditModeTemplate, { postTitle: title, isLoading: updatePost.isPending, callback: renamePostCallback });
|
|
1543
1676
|
}
|
|
1544
1677
|
|
|
1545
1678
|
// src/components/panel/posts-list/list-items/list-item-view.tsx
|
|
1546
|
-
import * as
|
|
1547
|
-
import { useState as
|
|
1679
|
+
import * as React32 from "react";
|
|
1680
|
+
import { useState as useState8 } from "react";
|
|
1548
1681
|
import {
|
|
1549
1682
|
__useActiveDocument as useActiveDocument3,
|
|
1550
1683
|
__useNavigateToDocument as useNavigateToDocument3
|
|
@@ -1557,19 +1690,19 @@ import {
|
|
|
1557
1690
|
IconButton as IconButton4,
|
|
1558
1691
|
ListItem as ListItem2,
|
|
1559
1692
|
ListItemButton as ListItemButton2,
|
|
1560
|
-
ListItemText as
|
|
1693
|
+
ListItemText as ListItemText6,
|
|
1561
1694
|
Menu as Menu2,
|
|
1562
1695
|
Stack as Stack6,
|
|
1563
1696
|
Tooltip as Tooltip4,
|
|
1564
1697
|
Typography as Typography6,
|
|
1565
1698
|
usePopupState as usePopupState4
|
|
1566
1699
|
} from "@elementor/ui";
|
|
1567
|
-
import { __ as
|
|
1700
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
1568
1701
|
|
|
1569
1702
|
// src/components/shared/page-title-and-status.tsx
|
|
1570
|
-
import * as
|
|
1571
|
-
import { Box as
|
|
1572
|
-
import { __ as
|
|
1703
|
+
import * as React23 from "react";
|
|
1704
|
+
import { Box as Box9, Chip as Chip3, Typography as Typography5 } from "@elementor/ui";
|
|
1705
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
1573
1706
|
|
|
1574
1707
|
// src/hooks/use-reverse-html-entities.ts
|
|
1575
1708
|
import { useMemo as useMemo3 } from "react";
|
|
@@ -1596,19 +1729,19 @@ function humanizeStatusSlug(status) {
|
|
|
1596
1729
|
var statusChipConfig = {
|
|
1597
1730
|
draft: {
|
|
1598
1731
|
color: "default",
|
|
1599
|
-
label:
|
|
1732
|
+
label: __16("Draft", "elementor")
|
|
1600
1733
|
},
|
|
1601
1734
|
future: {
|
|
1602
1735
|
color: "default",
|
|
1603
|
-
label:
|
|
1736
|
+
label: __16("Scheduled", "elementor")
|
|
1604
1737
|
},
|
|
1605
1738
|
pending: {
|
|
1606
1739
|
color: "warning",
|
|
1607
|
-
label:
|
|
1740
|
+
label: __16("Pending Review", "elementor")
|
|
1608
1741
|
},
|
|
1609
1742
|
private: {
|
|
1610
1743
|
color: "default",
|
|
1611
|
-
label:
|
|
1744
|
+
label: __16("Private", "elementor")
|
|
1612
1745
|
}
|
|
1613
1746
|
};
|
|
1614
1747
|
function getStatusChipConfig(status) {
|
|
@@ -1630,7 +1763,7 @@ var PageStatus = ({ status }) => {
|
|
|
1630
1763
|
}
|
|
1631
1764
|
const { color, label } = getStatusChipConfig(status);
|
|
1632
1765
|
const isKnownStatus = isKnownPanelStatus(status);
|
|
1633
|
-
return /* @__PURE__ */
|
|
1766
|
+
return /* @__PURE__ */ React23.createElement(
|
|
1634
1767
|
Chip3,
|
|
1635
1768
|
{
|
|
1636
1769
|
color,
|
|
@@ -1655,7 +1788,7 @@ var PageStatus = ({ status }) => {
|
|
|
1655
1788
|
};
|
|
1656
1789
|
var PageTitle = ({ title }) => {
|
|
1657
1790
|
const modifiedTitle = useReverseHtmlEntities(title);
|
|
1658
|
-
return /* @__PURE__ */
|
|
1791
|
+
return /* @__PURE__ */ React23.createElement(
|
|
1659
1792
|
Typography5,
|
|
1660
1793
|
{
|
|
1661
1794
|
component: "span",
|
|
@@ -1664,21 +1797,23 @@ var PageTitle = ({ title }) => {
|
|
|
1664
1797
|
noWrap: true,
|
|
1665
1798
|
sx: {
|
|
1666
1799
|
...contentPanelListRowTitleSx,
|
|
1667
|
-
flex: 1,
|
|
1668
1800
|
flexBasis: "auto",
|
|
1669
|
-
|
|
1801
|
+
flexShrink: 1,
|
|
1802
|
+
minWidth: 0,
|
|
1803
|
+
overflow: "hidden",
|
|
1804
|
+
textOverflow: "ellipsis"
|
|
1670
1805
|
}
|
|
1671
1806
|
},
|
|
1672
1807
|
modifiedTitle
|
|
1673
1808
|
);
|
|
1674
1809
|
};
|
|
1675
1810
|
function PageTitleAndStatus({ title, status }) {
|
|
1676
|
-
return /* @__PURE__ */
|
|
1811
|
+
return /* @__PURE__ */ React23.createElement(Box9, { alignItems: "center", display: "flex", minWidth: 0, sx: { overflow: "hidden" } }, /* @__PURE__ */ React23.createElement(PageTitle, { title }), /* @__PURE__ */ React23.createElement(PageStatus, { status }));
|
|
1677
1812
|
}
|
|
1678
1813
|
|
|
1679
1814
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
1680
|
-
import * as
|
|
1681
|
-
import { useState as
|
|
1815
|
+
import * as React25 from "react";
|
|
1816
|
+
import { useState as useState6 } from "react";
|
|
1682
1817
|
import { __useActiveDocument as useActiveDocument2 } from "@elementor/editor-documents";
|
|
1683
1818
|
import { TrashIcon } from "@elementor/icons";
|
|
1684
1819
|
import {
|
|
@@ -1691,34 +1826,34 @@ import {
|
|
|
1691
1826
|
DialogTitle,
|
|
1692
1827
|
Divider as Divider4
|
|
1693
1828
|
} from "@elementor/ui";
|
|
1694
|
-
import { __ as
|
|
1829
|
+
import { __ as __17, sprintf as sprintf3 } from "@wordpress/i18n";
|
|
1695
1830
|
|
|
1696
1831
|
// src/components/panel/actions-menu/action-menu-item.tsx
|
|
1697
|
-
import * as
|
|
1698
|
-
import { ListItemIcon as
|
|
1832
|
+
import * as React24 from "react";
|
|
1833
|
+
import { ListItemIcon as ListItemIcon3, ListItemText as ListItemText5, MenuItem as MenuItem5 } from "@elementor/ui";
|
|
1699
1834
|
function ActionMenuItem({ description, icon: Icon, MenuItemProps, title }) {
|
|
1700
|
-
return /* @__PURE__ */
|
|
1701
|
-
|
|
1835
|
+
return /* @__PURE__ */ React24.createElement(MenuItem5, { ...MenuItemProps }, /* @__PURE__ */ React24.createElement(
|
|
1836
|
+
ListItemIcon3,
|
|
1702
1837
|
{
|
|
1703
1838
|
sx: {
|
|
1704
1839
|
color: "inherit"
|
|
1705
1840
|
}
|
|
1706
1841
|
},
|
|
1707
|
-
/* @__PURE__ */
|
|
1708
|
-
), /* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ React24.createElement(Icon, null)
|
|
1843
|
+
), /* @__PURE__ */ React24.createElement(ListItemText5, { primary: title, secondary: description }));
|
|
1709
1844
|
}
|
|
1710
1845
|
|
|
1711
1846
|
// src/components/panel/actions-menu/actions/delete.tsx
|
|
1712
1847
|
function Delete({ post }) {
|
|
1713
|
-
const [isDialogOpen, setIsDialogOpen] =
|
|
1848
|
+
const [isDialogOpen, setIsDialogOpen] = useState6(false);
|
|
1714
1849
|
const activeDocument = useActiveDocument2();
|
|
1715
1850
|
const isPostActive = activeDocument?.id === post.id;
|
|
1716
1851
|
const userCanDelete = post.user_can.delete;
|
|
1717
1852
|
const isDisabled = !userCanDelete || post.isHome || isPostActive;
|
|
1718
|
-
return /* @__PURE__ */
|
|
1853
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
|
|
1719
1854
|
ActionMenuItem,
|
|
1720
1855
|
{
|
|
1721
|
-
title:
|
|
1856
|
+
title: __17("Delete", "elementor"),
|
|
1722
1857
|
icon: TrashIcon,
|
|
1723
1858
|
MenuItemProps: {
|
|
1724
1859
|
disabled: isDisabled,
|
|
@@ -1726,7 +1861,7 @@ function Delete({ post }) {
|
|
|
1726
1861
|
sx: { "&:hover": { color: "error.main" } }
|
|
1727
1862
|
}
|
|
1728
1863
|
}
|
|
1729
|
-
), isDialogOpen && /* @__PURE__ */
|
|
1864
|
+
), isDialogOpen && /* @__PURE__ */ React25.createElement(DeleteDialog, { post, setIsDialogOpen }));
|
|
1730
1865
|
}
|
|
1731
1866
|
function DeleteDialog({
|
|
1732
1867
|
post,
|
|
@@ -1735,11 +1870,11 @@ function DeleteDialog({
|
|
|
1735
1870
|
const { type } = usePostListContext();
|
|
1736
1871
|
const { deletePost } = usePostActions(type);
|
|
1737
1872
|
const { setError } = usePostListContext();
|
|
1738
|
-
const dialogTitle = sprintf3(
|
|
1739
|
-
const dialogBody = type === "post" ?
|
|
1873
|
+
const dialogTitle = sprintf3(__17('Delete "%s"?', "elementor"), post.title.rendered);
|
|
1874
|
+
const dialogBody = type === "post" ? __17(
|
|
1740
1875
|
"The post and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1741
1876
|
"elementor"
|
|
1742
|
-
) :
|
|
1877
|
+
) : __17(
|
|
1743
1878
|
"The page and its content will be deleted forever and we won\u2019t be able to recover them.",
|
|
1744
1879
|
"elementor"
|
|
1745
1880
|
);
|
|
@@ -1757,7 +1892,7 @@ function DeleteDialog({
|
|
|
1757
1892
|
}
|
|
1758
1893
|
setIsDialogOpen(false);
|
|
1759
1894
|
};
|
|
1760
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ React25.createElement(Dialog, { open: true, onClose: handleCancel, "aria-labelledby": "delete-dialog" }, /* @__PURE__ */ React25.createElement(DialogTitle, { noWrap: true }, dialogTitle), /* @__PURE__ */ React25.createElement(Divider4, null), /* @__PURE__ */ React25.createElement(DialogContent, null, /* @__PURE__ */ React25.createElement(DialogContentText, null, dialogBody)), /* @__PURE__ */ React25.createElement(DialogActions, null, /* @__PURE__ */ React25.createElement(
|
|
1761
1896
|
Button,
|
|
1762
1897
|
{
|
|
1763
1898
|
variant: "contained",
|
|
@@ -1765,14 +1900,14 @@ function DeleteDialog({
|
|
|
1765
1900
|
onClick: handleCancel,
|
|
1766
1901
|
disabled: deletePost.isPending
|
|
1767
1902
|
},
|
|
1768
|
-
|
|
1769
|
-
), /* @__PURE__ */
|
|
1903
|
+
__17("Cancel", "elementor")
|
|
1904
|
+
), /* @__PURE__ */ React25.createElement(Button, { variant: "contained", color: "error", onClick: deletePage, disabled: deletePost.isPending }, !deletePost.isPending ? __17("Delete", "elementor") : /* @__PURE__ */ React25.createElement(CircularProgress2, null))));
|
|
1770
1905
|
}
|
|
1771
1906
|
|
|
1772
1907
|
// src/components/panel/actions-menu/actions/duplicate.tsx
|
|
1773
|
-
import * as
|
|
1908
|
+
import * as React26 from "react";
|
|
1774
1909
|
import { CopyIcon } from "@elementor/icons";
|
|
1775
|
-
import { __ as
|
|
1910
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
1776
1911
|
function Duplicate({ post, popupState }) {
|
|
1777
1912
|
const { setEditMode, type } = usePostListContext();
|
|
1778
1913
|
const canCreate = useCanCreate(type);
|
|
@@ -1787,10 +1922,10 @@ function Duplicate({ post, popupState }) {
|
|
|
1787
1922
|
});
|
|
1788
1923
|
};
|
|
1789
1924
|
const isDisabled = !canCreate;
|
|
1790
|
-
return /* @__PURE__ */
|
|
1925
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1791
1926
|
ActionMenuItem,
|
|
1792
1927
|
{
|
|
1793
|
-
title:
|
|
1928
|
+
title: __18("Duplicate", "elementor"),
|
|
1794
1929
|
icon: CopyIcon,
|
|
1795
1930
|
MenuItemProps: {
|
|
1796
1931
|
disabled: isDisabled,
|
|
@@ -1801,8 +1936,8 @@ function Duplicate({ post, popupState }) {
|
|
|
1801
1936
|
}
|
|
1802
1937
|
|
|
1803
1938
|
// src/components/panel/actions-menu/actions/force-delete.tsx
|
|
1804
|
-
import * as
|
|
1805
|
-
import { useState as
|
|
1939
|
+
import * as React27 from "react";
|
|
1940
|
+
import { useState as useState7 } from "react";
|
|
1806
1941
|
import { TrashIcon as TrashIcon2 } from "@elementor/icons";
|
|
1807
1942
|
import {
|
|
1808
1943
|
Button as Button2,
|
|
@@ -1814,10 +1949,10 @@ import {
|
|
|
1814
1949
|
DialogTitle as DialogTitle2,
|
|
1815
1950
|
Divider as Divider5
|
|
1816
1951
|
} from "@elementor/ui";
|
|
1817
|
-
import { __ as
|
|
1952
|
+
import { __ as __19, sprintf as sprintf4 } from "@wordpress/i18n";
|
|
1818
1953
|
function ForceDelete({ post }) {
|
|
1819
|
-
const [isDialogOpen, setIsDialogOpen] =
|
|
1820
|
-
return /* @__PURE__ */
|
|
1954
|
+
const [isDialogOpen, setIsDialogOpen] = useState7(false);
|
|
1955
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(
|
|
1821
1956
|
ActionMenuItem,
|
|
1822
1957
|
{
|
|
1823
1958
|
icon: TrashIcon2,
|
|
@@ -1826,9 +1961,9 @@ function ForceDelete({ post }) {
|
|
|
1826
1961
|
onClick: () => setIsDialogOpen(true),
|
|
1827
1962
|
sx: { "&:hover": { color: "error.main" } }
|
|
1828
1963
|
},
|
|
1829
|
-
title:
|
|
1964
|
+
title: __19("Delete permanently", "elementor")
|
|
1830
1965
|
}
|
|
1831
|
-
), isDialogOpen && /* @__PURE__ */
|
|
1966
|
+
), isDialogOpen && /* @__PURE__ */ React27.createElement(ForceDeleteDialog, { post, setIsDialogOpen }));
|
|
1832
1967
|
}
|
|
1833
1968
|
function ForceDeleteDialog({
|
|
1834
1969
|
post,
|
|
@@ -1836,8 +1971,8 @@ function ForceDeleteDialog({
|
|
|
1836
1971
|
}) {
|
|
1837
1972
|
const { setError, type } = usePostListContext();
|
|
1838
1973
|
const { forceDeletePost } = usePostActions(type);
|
|
1839
|
-
const dialogTitle = sprintf4(
|
|
1840
|
-
const dialogBody =
|
|
1974
|
+
const dialogTitle = sprintf4(__19('Delete "%s" permanently?', "elementor"), post.title.rendered);
|
|
1975
|
+
const dialogBody = __19("This will permanently delete the item. You cannot undo this action.", "elementor");
|
|
1841
1976
|
const handleDelete = async () => {
|
|
1842
1977
|
try {
|
|
1843
1978
|
await forceDeletePost.mutateAsync(post.id);
|
|
@@ -1853,7 +1988,7 @@ function ForceDeleteDialog({
|
|
|
1853
1988
|
}
|
|
1854
1989
|
setIsDialogOpen(false);
|
|
1855
1990
|
};
|
|
1856
|
-
return /* @__PURE__ */
|
|
1991
|
+
return /* @__PURE__ */ React27.createElement(Dialog2, { "aria-labelledby": "force-delete-dialog", onClose: handleCancel, open: true }, /* @__PURE__ */ React27.createElement(DialogTitle2, { noWrap: true }, dialogTitle), /* @__PURE__ */ React27.createElement(Divider5, null), /* @__PURE__ */ React27.createElement(DialogContent2, null, /* @__PURE__ */ React27.createElement(DialogContentText2, null, dialogBody)), /* @__PURE__ */ React27.createElement(DialogActions2, null, /* @__PURE__ */ React27.createElement(
|
|
1857
1992
|
Button2,
|
|
1858
1993
|
{
|
|
1859
1994
|
variant: "contained",
|
|
@@ -1861,8 +1996,8 @@ function ForceDeleteDialog({
|
|
|
1861
1996
|
onClick: handleCancel,
|
|
1862
1997
|
disabled: forceDeletePost.isPending
|
|
1863
1998
|
},
|
|
1864
|
-
|
|
1865
|
-
), /* @__PURE__ */
|
|
1999
|
+
__19("Cancel", "elementor")
|
|
2000
|
+
), /* @__PURE__ */ React27.createElement(
|
|
1866
2001
|
Button2,
|
|
1867
2002
|
{
|
|
1868
2003
|
variant: "contained",
|
|
@@ -1870,20 +2005,20 @@ function ForceDeleteDialog({
|
|
|
1870
2005
|
onClick: () => void handleDelete(),
|
|
1871
2006
|
disabled: forceDeletePost.isPending
|
|
1872
2007
|
},
|
|
1873
|
-
!forceDeletePost.isPending ?
|
|
2008
|
+
!forceDeletePost.isPending ? __19("Delete permanently", "elementor") : /* @__PURE__ */ React27.createElement(CircularProgress3, null)
|
|
1874
2009
|
)));
|
|
1875
2010
|
}
|
|
1876
2011
|
|
|
1877
2012
|
// src/components/panel/actions-menu/actions/rename.tsx
|
|
1878
|
-
import * as
|
|
2013
|
+
import * as React28 from "react";
|
|
1879
2014
|
import { EraseIcon } from "@elementor/icons";
|
|
1880
|
-
import { __ as
|
|
2015
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
1881
2016
|
function Rename({ post }) {
|
|
1882
2017
|
const { setEditMode } = usePostListContext();
|
|
1883
|
-
return /* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1884
2019
|
ActionMenuItem,
|
|
1885
2020
|
{
|
|
1886
|
-
title:
|
|
2021
|
+
title: __20("Rename", "elementor"),
|
|
1887
2022
|
icon: EraseIcon,
|
|
1888
2023
|
MenuItemProps: {
|
|
1889
2024
|
disabled: !post.user_can.edit,
|
|
@@ -1901,9 +2036,9 @@ function Rename({ post }) {
|
|
|
1901
2036
|
}
|
|
1902
2037
|
|
|
1903
2038
|
// src/components/panel/actions-menu/actions/restore.tsx
|
|
1904
|
-
import * as
|
|
2039
|
+
import * as React29 from "react";
|
|
1905
2040
|
import { RefreshIcon } from "@elementor/icons";
|
|
1906
|
-
import { __ as
|
|
2041
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
1907
2042
|
function Restore({ post }) {
|
|
1908
2043
|
const { setError, type } = usePostListContext();
|
|
1909
2044
|
const { restorePost } = usePostActions(type);
|
|
@@ -1914,11 +2049,11 @@ function Restore({ post }) {
|
|
|
1914
2049
|
setError();
|
|
1915
2050
|
}
|
|
1916
2051
|
};
|
|
1917
|
-
return /* @__PURE__ */
|
|
2052
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1918
2053
|
ActionMenuItem,
|
|
1919
2054
|
{
|
|
1920
|
-
description:
|
|
1921
|
-
title:
|
|
2055
|
+
description: __21("Restored as draft", "elementor"),
|
|
2056
|
+
title: __21("Restore", "elementor"),
|
|
1922
2057
|
icon: RefreshIcon,
|
|
1923
2058
|
MenuItemProps: {
|
|
1924
2059
|
disabled: restorePost.isPending || !post.user_can.delete,
|
|
@@ -1929,11 +2064,11 @@ function Restore({ post }) {
|
|
|
1929
2064
|
}
|
|
1930
2065
|
|
|
1931
2066
|
// src/components/panel/actions-menu/actions/set-home.tsx
|
|
1932
|
-
import * as
|
|
2067
|
+
import * as React30 from "react";
|
|
1933
2068
|
import { ConfirmationDialog } from "@elementor/editor-ui";
|
|
1934
2069
|
import { HomeIcon } from "@elementor/icons";
|
|
1935
2070
|
import { Button as Button3, CircularProgress as CircularProgress4, DialogActions as DialogActions3 } from "@elementor/ui";
|
|
1936
|
-
import { __ as
|
|
2071
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
1937
2072
|
|
|
1938
2073
|
// src/hooks/use-homepage-actions.ts
|
|
1939
2074
|
import { useMutation as useMutation2, useQueryClient as useQueryClient2 } from "@elementor/query";
|
|
@@ -1982,8 +2117,8 @@ function SetHome({ post, closeMenu, onRequestRemoveHomepage }) {
|
|
|
1982
2117
|
const isSetHomeDisabled = !canManageOptions || !isPostPublished || updateSettingsMutation.isPending;
|
|
1983
2118
|
const isRemoveHomeDisabled = !canManageOptions || updateSettingsMutation.isPending;
|
|
1984
2119
|
const isDisabled = isPostHomepage ? isRemoveHomeDisabled : isSetHomeDisabled;
|
|
1985
|
-
const title = isPostHomepage ?
|
|
1986
|
-
return /* @__PURE__ */
|
|
2120
|
+
const title = isPostHomepage ? __22("Remove as homepage", "elementor") : __22("Set as homepage", "elementor");
|
|
2121
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1987
2122
|
ActionMenuItem,
|
|
1988
2123
|
{
|
|
1989
2124
|
title,
|
|
@@ -2020,11 +2155,11 @@ function RemoveHomepageDialog({ open, onClose }) {
|
|
|
2020
2155
|
}
|
|
2021
2156
|
};
|
|
2022
2157
|
const isPending = updateSettingsMutation.isPending;
|
|
2023
|
-
const removeHomepageLabel =
|
|
2024
|
-
return /* @__PURE__ */
|
|
2158
|
+
const removeHomepageLabel = __22("Remove as homepage", "elementor");
|
|
2159
|
+
return /* @__PURE__ */ React30.createElement(ConfirmationDialog, { open: true, onClose: handleCancel }, /* @__PURE__ */ React30.createElement(ConfirmationDialog.Title, { iconColor: "secondary" }, __22("Remove this page as your homepage?", "elementor")), /* @__PURE__ */ React30.createElement(ConfirmationDialog.Content, null, /* @__PURE__ */ React30.createElement(ConfirmationDialog.ContentText, null, __22(
|
|
2025
2160
|
"Your homepage will go back to showing your latest posts. You can set a page as your homepage again at any time.",
|
|
2026
2161
|
"elementor"
|
|
2027
|
-
))), /* @__PURE__ */
|
|
2162
|
+
))), /* @__PURE__ */ React30.createElement(DialogActions3, null, /* @__PURE__ */ React30.createElement(Button3, { color: "secondary", disabled: isPending, onClick: handleCancel }, __22("Not now", "elementor")), /* @__PURE__ */ React30.createElement(
|
|
2028
2163
|
Button3,
|
|
2029
2164
|
{
|
|
2030
2165
|
color: "secondary",
|
|
@@ -2033,18 +2168,18 @@ function RemoveHomepageDialog({ open, onClose }) {
|
|
|
2033
2168
|
sx: { ml: 1 },
|
|
2034
2169
|
variant: "contained"
|
|
2035
2170
|
},
|
|
2036
|
-
!isPending ? removeHomepageLabel : /* @__PURE__ */
|
|
2171
|
+
!isPending ? removeHomepageLabel : /* @__PURE__ */ React30.createElement(CircularProgress4, null)
|
|
2037
2172
|
)));
|
|
2038
2173
|
}
|
|
2039
2174
|
|
|
2040
2175
|
// src/components/panel/actions-menu/actions/view.tsx
|
|
2041
|
-
import * as
|
|
2176
|
+
import * as React31 from "react";
|
|
2042
2177
|
import { EyeIcon } from "@elementor/icons";
|
|
2043
|
-
import { __ as
|
|
2178
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
2044
2179
|
function View({ post }) {
|
|
2045
2180
|
const { type } = usePostListContext();
|
|
2046
|
-
const title =
|
|
2047
|
-
return /* @__PURE__ */
|
|
2181
|
+
const title = __23("View %s", "elementor").replace("%s", postTypesMap[type].labels.singular_name);
|
|
2182
|
+
return /* @__PURE__ */ React31.createElement(
|
|
2048
2183
|
ActionMenuItem,
|
|
2049
2184
|
{
|
|
2050
2185
|
title,
|
|
@@ -2071,14 +2206,14 @@ var DisabledPostTooltip = ({
|
|
|
2071
2206
|
postTypeSlug
|
|
2072
2207
|
}) => {
|
|
2073
2208
|
if (isDisabled) {
|
|
2074
|
-
const title = /* @__PURE__ */
|
|
2075
|
-
return /* @__PURE__ */
|
|
2209
|
+
const title = /* @__PURE__ */ React32.createElement(Typography6, { variant: "caption" }, getCannotEditPanelItemMessage(postTypeSlug), /* @__PURE__ */ React32.createElement("br", null), __24("To edit it directly, contact the site owner", "elementor"));
|
|
2210
|
+
return /* @__PURE__ */ React32.createElement(Tooltip4, { title, placement: "bottom", arrow: false }, /* @__PURE__ */ React32.createElement("span", null, children));
|
|
2076
2211
|
}
|
|
2077
|
-
return /* @__PURE__ */
|
|
2212
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, children);
|
|
2078
2213
|
};
|
|
2079
2214
|
function ListItemView({ post }) {
|
|
2080
2215
|
const { type } = usePostListContext();
|
|
2081
|
-
const [isRemoveHomeDialogOpen, setIsRemoveHomeDialogOpen] =
|
|
2216
|
+
const [isRemoveHomeDialogOpen, setIsRemoveHomeDialogOpen] = useState8(false);
|
|
2082
2217
|
const activeDocument = useActiveDocument3();
|
|
2083
2218
|
const navigateToDocument = useNavigateToDocument3();
|
|
2084
2219
|
const popupState = usePopupState4({
|
|
@@ -2095,15 +2230,15 @@ function ListItemView({ post }) {
|
|
|
2095
2230
|
const menuTriggerProps = bindTrigger2(popupState);
|
|
2096
2231
|
const hasListItemActions = useSiteContentListItemActionsInjections().length > 0;
|
|
2097
2232
|
const showListItemActions = isActive && post.user_can.edit && !isTrashed && hasListItemActions;
|
|
2098
|
-
const listRow = /* @__PURE__ */
|
|
2233
|
+
const listRow = /* @__PURE__ */ React32.createElement(
|
|
2099
2234
|
ListItem2,
|
|
2100
2235
|
{
|
|
2101
2236
|
disablePadding: true,
|
|
2102
2237
|
sx: getContentPanelListItemSx(showListItemActions),
|
|
2103
|
-
secondaryAction: /* @__PURE__ */
|
|
2238
|
+
secondaryAction: /* @__PURE__ */ React32.createElement(Stack6, { alignItems: "center", direction: "row", spacing: 0 }, showListItemActions && /* @__PURE__ */ React32.createElement(SiteContentListItemActionsSlot, { post, title }), /* @__PURE__ */ React32.createElement(
|
|
2104
2239
|
IconButton4,
|
|
2105
2240
|
{
|
|
2106
|
-
"aria-label":
|
|
2241
|
+
"aria-label": __24("More actions", "elementor"),
|
|
2107
2242
|
size: "tiny",
|
|
2108
2243
|
...menuTriggerProps,
|
|
2109
2244
|
onClick: (event) => {
|
|
@@ -2111,10 +2246,10 @@ function ListItemView({ post }) {
|
|
|
2111
2246
|
menuTriggerProps.onClick?.(event);
|
|
2112
2247
|
}
|
|
2113
2248
|
},
|
|
2114
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ React32.createElement(DotsVerticalIcon, { fontSize: "tiny" })
|
|
2115
2250
|
))
|
|
2116
2251
|
},
|
|
2117
|
-
/* @__PURE__ */
|
|
2252
|
+
/* @__PURE__ */ React32.createElement(
|
|
2118
2253
|
ListItemButton2,
|
|
2119
2254
|
{
|
|
2120
2255
|
dense: true,
|
|
@@ -2130,18 +2265,18 @@ function ListItemView({ post }) {
|
|
|
2130
2265
|
shape: "rounded",
|
|
2131
2266
|
sx: contentPanelListItemButtonSx
|
|
2132
2267
|
},
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
post.isHome && /* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ React32.createElement(ListItemText6, { disableTypography: true, sx: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React32.createElement(PageTitleAndStatus, { title, status })),
|
|
2269
|
+
post.isHome && /* @__PURE__ */ React32.createElement(HomeIcon2, { titleAccess: __24("Homepage", "elementor"), color: "disabled" })
|
|
2135
2270
|
)
|
|
2136
2271
|
);
|
|
2137
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, isEditBlocked ? /* @__PURE__ */ React32.createElement(DisabledPostTooltip, { isDisabled: true, postTypeSlug: type }, listRow) : listRow, /* @__PURE__ */ React32.createElement(
|
|
2138
2273
|
Menu2,
|
|
2139
2274
|
{
|
|
2140
2275
|
PaperProps: { sx: { mt: 2, width: 200 } },
|
|
2141
2276
|
MenuListProps: { dense: true },
|
|
2142
2277
|
...bindMenu2(popupState)
|
|
2143
2278
|
},
|
|
2144
|
-
isTrashed ? /* @__PURE__ */
|
|
2279
|
+
isTrashed ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Restore, { post }), /* @__PURE__ */ React32.createElement(ForceDelete, { post })) : /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Rename, { post }), /* @__PURE__ */ React32.createElement(Duplicate, { post, popupState }), /* @__PURE__ */ React32.createElement(Delete, { post }), /* @__PURE__ */ React32.createElement(View, { post }), type === "page" && /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Divider6, null), /* @__PURE__ */ React32.createElement(
|
|
2145
2280
|
SetHome,
|
|
2146
2281
|
{
|
|
2147
2282
|
post,
|
|
@@ -2149,7 +2284,7 @@ function ListItemView({ post }) {
|
|
|
2149
2284
|
onRequestRemoveHomepage: () => setIsRemoveHomeDialogOpen(true)
|
|
2150
2285
|
}
|
|
2151
2286
|
)))
|
|
2152
|
-
), /* @__PURE__ */
|
|
2287
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2153
2288
|
RemoveHomepageDialog,
|
|
2154
2289
|
{
|
|
2155
2290
|
open: isRemoveHomeDialogOpen,
|
|
@@ -2162,25 +2297,25 @@ function ListItemView({ post }) {
|
|
|
2162
2297
|
function PostListItem({ post }) {
|
|
2163
2298
|
const { editMode } = usePostListContext();
|
|
2164
2299
|
if ("rename" === editMode.mode && post?.id && post?.id === editMode.details.postId) {
|
|
2165
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ React33.createElement(ListItemRename, { post });
|
|
2166
2301
|
}
|
|
2167
2302
|
if ("create" === editMode.mode && !post) {
|
|
2168
|
-
return /* @__PURE__ */
|
|
2303
|
+
return /* @__PURE__ */ React33.createElement(ListItemCreate, null);
|
|
2169
2304
|
}
|
|
2170
2305
|
if ("duplicate" === editMode.mode && !post) {
|
|
2171
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ React33.createElement(ListItemDuplicate, null);
|
|
2172
2307
|
}
|
|
2173
2308
|
if (!post) {
|
|
2174
2309
|
return null;
|
|
2175
2310
|
}
|
|
2176
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ React33.createElement(ListItemView, { post });
|
|
2177
2312
|
}
|
|
2178
2313
|
|
|
2179
2314
|
// src/components/panel/posts-list/post-list-pagination-actions.tsx
|
|
2180
|
-
import * as
|
|
2315
|
+
import * as React34 from "react";
|
|
2181
2316
|
import { CollapseIcon as CollapseIcon2 } from "@elementor/editor-ui";
|
|
2182
|
-
import { Box as
|
|
2183
|
-
import { __ as
|
|
2317
|
+
import { Box as Box10, Button as Button4, CircularProgress as CircularProgress5, Stack as Stack7 } from "@elementor/ui";
|
|
2318
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
2184
2319
|
var listPaginationButtonProps = {
|
|
2185
2320
|
color: "secondary",
|
|
2186
2321
|
size: "small",
|
|
@@ -2197,28 +2332,28 @@ function PostListPaginationActions({
|
|
|
2197
2332
|
if (!canLoadMore && !canShowLess) {
|
|
2198
2333
|
return null;
|
|
2199
2334
|
}
|
|
2200
|
-
const loadMoreLabel =
|
|
2201
|
-
const showLessLabel =
|
|
2202
|
-
const loadMoreButton = /* @__PURE__ */
|
|
2335
|
+
const loadMoreLabel = __25("Load more", "elementor");
|
|
2336
|
+
const showLessLabel = __25("Show less", "elementor");
|
|
2337
|
+
const loadMoreButton = /* @__PURE__ */ React34.createElement(
|
|
2203
2338
|
Button4,
|
|
2204
2339
|
{
|
|
2205
2340
|
...listPaginationButtonProps,
|
|
2206
2341
|
ref: loadMoreButtonRef,
|
|
2207
2342
|
"aria-label": loadMoreLabel,
|
|
2208
2343
|
disabled: isLoadingMore,
|
|
2209
|
-
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */
|
|
2344
|
+
endIcon: isLoadingMore ? void 0 : /* @__PURE__ */ React34.createElement(CollapseIcon2, { open: false }),
|
|
2210
2345
|
fullWidth: true,
|
|
2211
2346
|
onClick: onLoadMore,
|
|
2212
2347
|
sx: { flex: 1, my: 0.5 }
|
|
2213
2348
|
},
|
|
2214
|
-
isLoadingMore ? /* @__PURE__ */
|
|
2349
|
+
isLoadingMore ? /* @__PURE__ */ React34.createElement(CircularProgress5, { size: 20 }) : loadMoreLabel
|
|
2215
2350
|
);
|
|
2216
|
-
const showLessButton = /* @__PURE__ */
|
|
2351
|
+
const showLessButton = /* @__PURE__ */ React34.createElement(
|
|
2217
2352
|
Button4,
|
|
2218
2353
|
{
|
|
2219
2354
|
...listPaginationButtonProps,
|
|
2220
2355
|
"aria-label": showLessLabel,
|
|
2221
|
-
endIcon: /* @__PURE__ */
|
|
2356
|
+
endIcon: /* @__PURE__ */ React34.createElement(CollapseIcon2, { open: true }),
|
|
2222
2357
|
fullWidth: true,
|
|
2223
2358
|
onClick: onShowLess,
|
|
2224
2359
|
sx: { flex: 1, my: 0.5 }
|
|
@@ -2226,9 +2361,9 @@ function PostListPaginationActions({
|
|
|
2226
2361
|
showLessLabel
|
|
2227
2362
|
);
|
|
2228
2363
|
if (canShowLess && canLoadMore) {
|
|
2229
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ React34.createElement(Box10, { sx: { px: 2, width: "100%" } }, /* @__PURE__ */ React34.createElement(Stack7, { direction: "row", spacing: 1 }, showLessButton, loadMoreButton));
|
|
2230
2365
|
}
|
|
2231
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ React34.createElement(Box10, { sx: { px: 2, width: "100%" } }, canShowLess ? showLessButton : loadMoreButton);
|
|
2232
2367
|
}
|
|
2233
2368
|
|
|
2234
2369
|
// src/components/panel/posts-list/posts-collapsible-list.tsx
|
|
@@ -2236,13 +2371,13 @@ var SEARCH_DEBOUNCE_MS = 300;
|
|
|
2236
2371
|
function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
2237
2372
|
const { type, editMode, resetEditMode, setEditMode } = usePostListContext();
|
|
2238
2373
|
const { registerSection, searchQuery, siteContentSort, statusFilters, unregisterSection } = useContentPanelCoordinator();
|
|
2239
|
-
const [isOpen, setIsOpen] =
|
|
2374
|
+
const [isOpen, setIsOpen] = useState9(isOpenByDefault);
|
|
2240
2375
|
const trimmedSearch = searchQuery.trim();
|
|
2241
|
-
const [debouncedSearch, setDebouncedSearch] =
|
|
2242
|
-
const focusAfterShowLessRef =
|
|
2243
|
-
const listTopRef =
|
|
2244
|
-
const loadMoreButtonRef =
|
|
2245
|
-
const sectionHeaderRef =
|
|
2376
|
+
const [debouncedSearch, setDebouncedSearch] = useState9(trimmedSearch);
|
|
2377
|
+
const focusAfterShowLessRef = useRef5(false);
|
|
2378
|
+
const listTopRef = useRef5(null);
|
|
2379
|
+
const loadMoreButtonRef = useRef5(null);
|
|
2380
|
+
const sectionHeaderRef = useRef5(null);
|
|
2246
2381
|
useEffect2(() => {
|
|
2247
2382
|
const handle = window.setTimeout(() => setDebouncedSearch(trimmedSearch), SEARCH_DEBOUNCE_MS);
|
|
2248
2383
|
return () => window.clearTimeout(handle);
|
|
@@ -2329,16 +2464,16 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2329
2464
|
}
|
|
2330
2465
|
}, [debouncedSearch, filteredPosts.length, statusFilters]);
|
|
2331
2466
|
if (postsError) {
|
|
2332
|
-
return /* @__PURE__ */
|
|
2467
|
+
return /* @__PURE__ */ React35.createElement(ErrorState, null);
|
|
2333
2468
|
}
|
|
2334
2469
|
if (postsPending && !posts?.length) {
|
|
2335
|
-
return /* @__PURE__ */
|
|
2470
|
+
return /* @__PURE__ */ React35.createElement(Box11, { sx: { px: 2 } }, /* @__PURE__ */ React35.createElement(Box11, null, /* @__PURE__ */ React35.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "100%", height: "24px" }), /* @__PURE__ */ React35.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React35.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" }), /* @__PURE__ */ React35.createElement(Skeleton, { sx: { my: 3 }, animation: "wave", variant: "rounded", width: "70%", height: "24px" })));
|
|
2336
2471
|
}
|
|
2337
2472
|
const displayCount = total;
|
|
2338
2473
|
const sectionTitle = postTypesMap[type].labels.plural_name;
|
|
2339
2474
|
const showNoResults = (debouncedSearch || hasActiveSiteContentStatusFilters(statusFilters)) && filteredPosts.length === 0;
|
|
2340
2475
|
const countChipLabel = isNarrowed && baselineTotal !== void 0 ? `${total} / ${baselineTotal}` : void 0;
|
|
2341
|
-
return /* @__PURE__ */
|
|
2476
|
+
return /* @__PURE__ */ React35.createElement(
|
|
2342
2477
|
CollapsibleList,
|
|
2343
2478
|
{
|
|
2344
2479
|
count: displayCount,
|
|
@@ -2347,15 +2482,15 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2347
2482
|
isOpen,
|
|
2348
2483
|
onOpenChange: setIsOpen,
|
|
2349
2484
|
title: sectionTitle,
|
|
2350
|
-
trailingActions: isTrashFilter ? null : /* @__PURE__ */
|
|
2485
|
+
trailingActions: isTrashFilter ? null : /* @__PURE__ */ React35.createElement(SectionAddButton, { onBeforeCreate: () => setIsOpen(true) })
|
|
2351
2486
|
},
|
|
2352
|
-
showNoResults && /* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
2487
|
+
showNoResults && /* @__PURE__ */ React35.createElement(Box11, { sx: { py: 2, px: 2 } }, /* @__PURE__ */ React35.createElement(Typography7, { variant: "body2", color: "text.secondary" }, __26("No results found", "elementor"))),
|
|
2488
|
+
/* @__PURE__ */ React35.createElement(Box11, { ref: listTopRef }),
|
|
2354
2489
|
displayedPosts.map((post) => {
|
|
2355
|
-
return /* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ React35.createElement(PostListItem, { key: post.id, post });
|
|
2356
2491
|
}),
|
|
2357
|
-
!isTrashFilter && ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */
|
|
2358
|
-
/* @__PURE__ */
|
|
2492
|
+
!isTrashFilter && ["duplicate", "create"].includes(editMode.mode) && /* @__PURE__ */ React35.createElement(PostListItem, null),
|
|
2493
|
+
/* @__PURE__ */ React35.createElement(
|
|
2359
2494
|
PostListPaginationActions,
|
|
2360
2495
|
{
|
|
2361
2496
|
canLoadMore: pagination.canLoadMore,
|
|
@@ -2370,11 +2505,11 @@ function PostsCollapsibleList({ isOpenByDefault = false }) {
|
|
|
2370
2505
|
}
|
|
2371
2506
|
|
|
2372
2507
|
// src/components/panel/user-load-error.tsx
|
|
2373
|
-
import * as
|
|
2374
|
-
import { Box as
|
|
2375
|
-
import { __ as
|
|
2508
|
+
import * as React36 from "react";
|
|
2509
|
+
import { Box as Box12, Typography as Typography8 } from "@elementor/ui";
|
|
2510
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
2376
2511
|
function UserLoadError() {
|
|
2377
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ React36.createElement(Box12, { sx: { px: 2, py: 2 } }, /* @__PURE__ */ React36.createElement(Typography8, { variant: "body2", color: "text.secondary" }, __27(
|
|
2378
2513
|
"We couldn\u2019t load your content permissions. Try closing and reopening this panel.",
|
|
2379
2514
|
"elementor"
|
|
2380
2515
|
)));
|
|
@@ -2388,20 +2523,21 @@ function ShellPanelBodyContent({
|
|
|
2388
2523
|
showUserLoadError
|
|
2389
2524
|
}) {
|
|
2390
2525
|
if (isUserPending) {
|
|
2391
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ React37.createElement(Stack8, { spacing: 1, sx: { px: 2, py: 1 } }, /* @__PURE__ */ React37.createElement(Skeleton2, { animation: "wave", height: 28, variant: "rounded", width: "100%" }), /* @__PURE__ */ React37.createElement(Skeleton2, { animation: "wave", height: 28, variant: "rounded", width: "80%" }));
|
|
2392
2527
|
}
|
|
2393
2528
|
if (showUserLoadError) {
|
|
2394
|
-
return /* @__PURE__ */
|
|
2529
|
+
return /* @__PURE__ */ React37.createElement(UserLoadError, null);
|
|
2395
2530
|
}
|
|
2396
|
-
|
|
2531
|
+
const extraSections = getSiteContentSections();
|
|
2532
|
+
return /* @__PURE__ */ React37.createElement(List2, { dense: true, disablePadding: true, sx: { py: 0, width: "100%" } }, accessiblePostTypes.map((postTypeSlug, index) => /* @__PURE__ */ React37.createElement(PostListContextProvider, { key: postTypeSlug, type: postTypeSlug, setError: onListError }, /* @__PURE__ */ React37.createElement(PostsCollapsibleList, { isOpenByDefault: index === 0 }))), extraSections.map((section) => /* @__PURE__ */ React37.createElement(React37.Fragment, { key: section.id }, section.render())));
|
|
2397
2533
|
}
|
|
2398
2534
|
|
|
2399
2535
|
// src/components/panel/shell.tsx
|
|
2400
2536
|
var Shell = () => {
|
|
2401
2537
|
const sidebarPanelChrome = isSidebarEnabled();
|
|
2402
|
-
const [isErrorSnackbarOpen, setIsErrorSnackbarOpen] =
|
|
2538
|
+
const [isErrorSnackbarOpen, setIsErrorSnackbarOpen] = useState10(false);
|
|
2403
2539
|
const { accessiblePostTypes, isUserPending, showUserLoadError } = useAccessiblePanelPostTypes();
|
|
2404
|
-
return /* @__PURE__ */
|
|
2540
|
+
return /* @__PURE__ */ React38.createElement(ContentPanelCoordinatorProvider, null, /* @__PURE__ */ React38.createElement(Panel, null, /* @__PURE__ */ React38.createElement(PanelHeader, null, /* @__PURE__ */ React38.createElement(
|
|
2405
2541
|
Stack9,
|
|
2406
2542
|
{
|
|
2407
2543
|
alignItems: "center",
|
|
@@ -2412,9 +2548,9 @@ var Shell = () => {
|
|
|
2412
2548
|
...sidebarPanelChrome ? {} : { p: 1, pl: 2 }
|
|
2413
2549
|
}
|
|
2414
2550
|
},
|
|
2415
|
-
/* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2417
|
-
)), /* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ React38.createElement(PanelHeaderTitle, { sx: { flex: 1, minWidth: 0, textAlign: "start" } }, __28("Site content", "elementor")),
|
|
2552
|
+
/* @__PURE__ */ React38.createElement(ContentPanelHeaderAdd, null)
|
|
2553
|
+
)), /* @__PURE__ */ React38.createElement(Divider7, null), /* @__PURE__ */ React38.createElement(PanelBody, null, /* @__PURE__ */ React38.createElement(ContentPanelToolbar, null), /* @__PURE__ */ React38.createElement(Divider7, null), /* @__PURE__ */ React38.createElement(
|
|
2418
2554
|
ShellPanelBodyContent,
|
|
2419
2555
|
{
|
|
2420
2556
|
accessiblePostTypes,
|
|
@@ -2422,7 +2558,7 @@ var Shell = () => {
|
|
|
2422
2558
|
onListError: () => setIsErrorSnackbarOpen(true),
|
|
2423
2559
|
showUserLoadError
|
|
2424
2560
|
}
|
|
2425
|
-
), /* @__PURE__ */
|
|
2561
|
+
), /* @__PURE__ */ React38.createElement(error_snackbar_default, { open: isErrorSnackbarOpen, onClose: () => setIsErrorSnackbarOpen(false) }))));
|
|
2426
2562
|
};
|
|
2427
2563
|
var shell_default = Shell;
|
|
2428
2564
|
|
|
@@ -2433,7 +2569,7 @@ var { panel, usePanelStatus, usePanelActions } = createPanel({
|
|
|
2433
2569
|
});
|
|
2434
2570
|
|
|
2435
2571
|
// src/components/top-bar/recently-edited.tsx
|
|
2436
|
-
import * as
|
|
2572
|
+
import * as React43 from "react";
|
|
2437
2573
|
import {
|
|
2438
2574
|
__useActiveDocument as useActiveDocument4,
|
|
2439
2575
|
__useHostDocument as useHostDocument
|
|
@@ -2444,28 +2580,28 @@ import {
|
|
|
2444
2580
|
bindTrigger as bindTrigger3,
|
|
2445
2581
|
Button as Button5,
|
|
2446
2582
|
Divider as Divider8,
|
|
2447
|
-
ListItemText as
|
|
2583
|
+
ListItemText as ListItemText9,
|
|
2448
2584
|
ListSubheader,
|
|
2449
2585
|
Menu as Menu3,
|
|
2450
|
-
MenuItem as
|
|
2586
|
+
MenuItem as MenuItem8,
|
|
2451
2587
|
usePopupState as usePopupState5
|
|
2452
2588
|
} from "@elementor/ui";
|
|
2453
|
-
import { __ as
|
|
2589
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
2454
2590
|
|
|
2455
2591
|
// src/components/top-bar/create-post-list-item.tsx
|
|
2456
|
-
import * as
|
|
2592
|
+
import * as React39 from "react";
|
|
2457
2593
|
import { __useNavigateToDocument as useNavigateToDocument4 } from "@elementor/editor-documents";
|
|
2458
2594
|
import { useMixpanel } from "@elementor/events";
|
|
2459
2595
|
import { PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
2460
|
-
import { CircularProgress as CircularProgress6, ListItemIcon as
|
|
2461
|
-
import { __ as
|
|
2596
|
+
import { CircularProgress as CircularProgress6, ListItemIcon as ListItemIcon4, ListItemText as ListItemText7, MenuItem as MenuItem6 } from "@elementor/ui";
|
|
2597
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
2462
2598
|
|
|
2463
2599
|
// src/hooks/use-create-page.ts
|
|
2464
|
-
import { useState as
|
|
2600
|
+
import { useState as useState11 } from "react";
|
|
2465
2601
|
import apiFetch5 from "@wordpress/api-fetch";
|
|
2466
2602
|
var endpointPath = "/elementor/v1/site-navigation/add-new-post";
|
|
2467
2603
|
function useCreatePage() {
|
|
2468
|
-
const [isLoading, setIsLoading] =
|
|
2604
|
+
const [isLoading, setIsLoading] = useState11(false);
|
|
2469
2605
|
return {
|
|
2470
2606
|
create: () => {
|
|
2471
2607
|
setIsLoading(true);
|
|
@@ -2488,8 +2624,8 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
2488
2624
|
const navigateToDocument = useNavigateToDocument4();
|
|
2489
2625
|
const { data: user } = useUser();
|
|
2490
2626
|
const { dispatchEvent, config } = useMixpanel();
|
|
2491
|
-
return /* @__PURE__ */
|
|
2492
|
-
|
|
2627
|
+
return /* @__PURE__ */ React39.createElement(
|
|
2628
|
+
MenuItem6,
|
|
2493
2629
|
{
|
|
2494
2630
|
disabled: isLoading || !user?.capabilities?.edit_pages,
|
|
2495
2631
|
onClick: async () => {
|
|
@@ -2512,25 +2648,25 @@ function CreatePostListItem({ closePopup, ...props }) {
|
|
|
2512
2648
|
},
|
|
2513
2649
|
...props
|
|
2514
2650
|
},
|
|
2515
|
-
/* @__PURE__ */
|
|
2516
|
-
/* @__PURE__ */
|
|
2517
|
-
|
|
2651
|
+
/* @__PURE__ */ React39.createElement(ListItemIcon4, null, isLoading ? /* @__PURE__ */ React39.createElement(CircularProgress6, { size: "1.25rem" }) : /* @__PURE__ */ React39.createElement(PlusIcon2, { fontSize: "small" })),
|
|
2652
|
+
/* @__PURE__ */ React39.createElement(
|
|
2653
|
+
ListItemText7,
|
|
2518
2654
|
{
|
|
2519
2655
|
primaryTypographyProps: { variant: "body2" },
|
|
2520
|
-
primary:
|
|
2656
|
+
primary: __29("Add new page", "elementor")
|
|
2521
2657
|
}
|
|
2522
2658
|
)
|
|
2523
2659
|
);
|
|
2524
2660
|
}
|
|
2525
2661
|
|
|
2526
2662
|
// src/components/top-bar/indicator.tsx
|
|
2527
|
-
import * as
|
|
2663
|
+
import * as React40 from "react";
|
|
2528
2664
|
import { Stack as Stack10, Tooltip as BaseTooltip, Typography as Typography9 } from "@elementor/ui";
|
|
2529
2665
|
function Indicator({ title, status }) {
|
|
2530
|
-
return /* @__PURE__ */
|
|
2666
|
+
return /* @__PURE__ */ React40.createElement(Tooltip5, { title }, /* @__PURE__ */ React40.createElement(Stack10, { component: "span", direction: "row", alignItems: "center", spacing: 0.5 }, /* @__PURE__ */ React40.createElement(Typography9, { component: "span", variant: "body2", sx: { maxWidth: "120px" }, noWrap: true }, title), status.value !== "publish" && /* @__PURE__ */ React40.createElement(Typography9, { component: "span", variant: "body2", sx: { fontStyle: "italic" } }, "(", status.label, ")")));
|
|
2531
2667
|
}
|
|
2532
2668
|
function Tooltip5(props) {
|
|
2533
|
-
return /* @__PURE__ */
|
|
2669
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2534
2670
|
BaseTooltip,
|
|
2535
2671
|
{
|
|
2536
2672
|
PopperProps: {
|
|
@@ -2546,20 +2682,20 @@ function Tooltip5(props) {
|
|
|
2546
2682
|
}
|
|
2547
2683
|
|
|
2548
2684
|
// src/components/top-bar/post-list-item.tsx
|
|
2549
|
-
import * as
|
|
2685
|
+
import * as React42 from "react";
|
|
2550
2686
|
import { __useNavigateToDocument as useNavigateToDocument5 } from "@elementor/editor-documents";
|
|
2551
2687
|
import { useMixpanel as useMixpanel2 } from "@elementor/events";
|
|
2552
|
-
import { ListItemText as
|
|
2688
|
+
import { ListItemText as ListItemText8, MenuItem as MenuItem7 } from "@elementor/ui";
|
|
2553
2689
|
|
|
2554
2690
|
// src/components/top-bar/chip-doc-type.tsx
|
|
2555
|
-
import * as
|
|
2691
|
+
import * as React41 from "react";
|
|
2556
2692
|
import { PostTypeIcon as PostTypeIcon3 } from "@elementor/icons";
|
|
2557
2693
|
import { Chip as Chip4 } from "@elementor/ui";
|
|
2558
2694
|
var iconsMap2 = getIconsMap();
|
|
2559
2695
|
function DocTypeChip({ postType, docType, label }) {
|
|
2560
2696
|
const color = "elementor_library" === postType ? "global" : "accent";
|
|
2561
2697
|
const Icon = iconsMap2[docType] || PostTypeIcon3;
|
|
2562
|
-
return /* @__PURE__ */
|
|
2698
|
+
return /* @__PURE__ */ React41.createElement(
|
|
2563
2699
|
Chip4,
|
|
2564
2700
|
{
|
|
2565
2701
|
component: "span",
|
|
@@ -2568,7 +2704,7 @@ function DocTypeChip({ postType, docType, label }) {
|
|
|
2568
2704
|
label,
|
|
2569
2705
|
"data-value": docType,
|
|
2570
2706
|
color,
|
|
2571
|
-
icon: /* @__PURE__ */
|
|
2707
|
+
icon: /* @__PURE__ */ React41.createElement(Icon, null),
|
|
2572
2708
|
sx: { ml: 1, cursor: "inherit" }
|
|
2573
2709
|
}
|
|
2574
2710
|
);
|
|
@@ -2579,8 +2715,8 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
2579
2715
|
const navigateToDocument = useNavigateToDocument5();
|
|
2580
2716
|
const postTitle = useReverseHtmlEntities(post.title);
|
|
2581
2717
|
const { dispatchEvent, config } = useMixpanel2();
|
|
2582
|
-
return /* @__PURE__ */
|
|
2583
|
-
|
|
2718
|
+
return /* @__PURE__ */ React42.createElement(
|
|
2719
|
+
MenuItem7,
|
|
2584
2720
|
{
|
|
2585
2721
|
disabled: !post.user_can.edit,
|
|
2586
2722
|
onClick: async () => {
|
|
@@ -2602,15 +2738,15 @@ function PostListItem2({ post, closePopup, ...props }) {
|
|
|
2602
2738
|
},
|
|
2603
2739
|
...props
|
|
2604
2740
|
},
|
|
2605
|
-
/* @__PURE__ */
|
|
2606
|
-
|
|
2741
|
+
/* @__PURE__ */ React42.createElement(
|
|
2742
|
+
ListItemText8,
|
|
2607
2743
|
{
|
|
2608
2744
|
sx: { flexGrow: 0 },
|
|
2609
2745
|
primaryTypographyProps: { variant: "body2", noWrap: true },
|
|
2610
2746
|
primary: postTitle
|
|
2611
2747
|
}
|
|
2612
2748
|
),
|
|
2613
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ React42.createElement(DocTypeChip, { postType: post.type.post_type, docType: post.type.doc_type, label: post.type.label })
|
|
2614
2750
|
);
|
|
2615
2751
|
}
|
|
2616
2752
|
|
|
@@ -2636,12 +2772,12 @@ function RecentlyEdited() {
|
|
|
2636
2772
|
return null;
|
|
2637
2773
|
}
|
|
2638
2774
|
const buttonProps = bindTrigger3(popupState);
|
|
2639
|
-
return /* @__PURE__ */
|
|
2775
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
|
|
2640
2776
|
Button5,
|
|
2641
2777
|
{
|
|
2642
2778
|
color: "inherit",
|
|
2643
2779
|
size: "small",
|
|
2644
|
-
endIcon: /* @__PURE__ */
|
|
2780
|
+
endIcon: /* @__PURE__ */ React43.createElement(ChevronDownIcon, { fontSize: "small" }),
|
|
2645
2781
|
...buttonProps,
|
|
2646
2782
|
onClick: (e) => {
|
|
2647
2783
|
const extendedWindow = window;
|
|
@@ -2660,40 +2796,40 @@ function RecentlyEdited() {
|
|
|
2660
2796
|
buttonProps.onClick(e);
|
|
2661
2797
|
}
|
|
2662
2798
|
},
|
|
2663
|
-
/* @__PURE__ */
|
|
2664
|
-
), /* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ React43.createElement(Indicator, { title: documentTitle, status: document2.status })
|
|
2800
|
+
), /* @__PURE__ */ React43.createElement(
|
|
2665
2801
|
Menu3,
|
|
2666
2802
|
{
|
|
2667
2803
|
MenuListProps: {
|
|
2668
|
-
subheader: /* @__PURE__ */
|
|
2804
|
+
subheader: /* @__PURE__ */ React43.createElement(ListSubheader, { sx: { color: "accent.main", fontStyle: "italic", fontWeight: "300" } }, __30("Recent", "elementor"))
|
|
2669
2805
|
},
|
|
2670
2806
|
PaperProps: { sx: { mt: 2.5, width: 320 } },
|
|
2671
2807
|
...bindMenu3(popupState)
|
|
2672
2808
|
},
|
|
2673
|
-
recentPosts.map((post) => /* @__PURE__ */
|
|
2674
|
-
recentPosts.length === 0 && /* @__PURE__ */
|
|
2675
|
-
|
|
2809
|
+
recentPosts.map((post) => /* @__PURE__ */ React43.createElement(PostListItem2, { key: post.id, post, closePopup: popupState.close })),
|
|
2810
|
+
recentPosts.length === 0 && /* @__PURE__ */ React43.createElement(MenuItem8, { disabled: true }, /* @__PURE__ */ React43.createElement(
|
|
2811
|
+
ListItemText9,
|
|
2676
2812
|
{
|
|
2677
2813
|
primaryTypographyProps: {
|
|
2678
2814
|
variant: "caption",
|
|
2679
2815
|
fontStyle: "italic"
|
|
2680
2816
|
},
|
|
2681
|
-
primary:
|
|
2817
|
+
primary: __30("There are no other pages or templates on this site yet.", "elementor")
|
|
2682
2818
|
}
|
|
2683
2819
|
)),
|
|
2684
|
-
/* @__PURE__ */
|
|
2685
|
-
/* @__PURE__ */
|
|
2820
|
+
/* @__PURE__ */ React43.createElement(Divider8, { disabled: recentPosts.length === 0 }),
|
|
2821
|
+
/* @__PURE__ */ React43.createElement(CreatePostListItem, { closePopup: popupState.close })
|
|
2686
2822
|
));
|
|
2687
2823
|
}
|
|
2688
2824
|
|
|
2689
2825
|
// src/hooks/use-toggle-button-props.ts
|
|
2690
2826
|
import { PagesIcon } from "@elementor/icons";
|
|
2691
|
-
import { __ as
|
|
2827
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
2692
2828
|
function useToggleButtonProps() {
|
|
2693
2829
|
const { isOpen: selectedState, isBlocked } = usePanelStatus();
|
|
2694
2830
|
const { open, close } = usePanelActions();
|
|
2695
2831
|
return {
|
|
2696
|
-
title:
|
|
2832
|
+
title: __31("Site content", "elementor"),
|
|
2697
2833
|
icon: PagesIcon,
|
|
2698
2834
|
onClick: () => {
|
|
2699
2835
|
const extendedWindow = window;
|
|
@@ -2735,9 +2871,80 @@ function registerButton() {
|
|
|
2735
2871
|
useProps: useToggleButtonProps
|
|
2736
2872
|
});
|
|
2737
2873
|
}
|
|
2874
|
+
|
|
2875
|
+
// src/components/panel/popups/popup-section-add-button.tsx
|
|
2876
|
+
import * as React44 from "react";
|
|
2877
|
+
import { forwardRef as forwardRef2, useCallback as useCallback4, useImperativeHandle as useImperativeHandle2, useRef as useRef6 } from "react";
|
|
2878
|
+
import { Stack as Stack11 } from "@elementor/ui";
|
|
2879
|
+
import { __ as __32, sprintf as sprintf5 } from "@wordpress/i18n";
|
|
2880
|
+
var PopupSectionAddButton = forwardRef2(
|
|
2881
|
+
({ disabled, onBeforeCreate, onCreate }, ref) => {
|
|
2882
|
+
const promotionRef = useRef6(null);
|
|
2883
|
+
const canCreate = env.popups?.can_use ?? false;
|
|
2884
|
+
const togglePromotion = useCallback4(() => {
|
|
2885
|
+
promotionRef.current?.toggle();
|
|
2886
|
+
}, []);
|
|
2887
|
+
useImperativeHandle2(ref, () => ({ togglePromotion }), [togglePromotion]);
|
|
2888
|
+
const ariaLabel = sprintf5(
|
|
2889
|
+
/* translators: %s: Document type singular name. */
|
|
2890
|
+
__32("New %s", "elementor"),
|
|
2891
|
+
__32("Popup", "elementor")
|
|
2892
|
+
);
|
|
2893
|
+
if (canCreate) {
|
|
2894
|
+
return /* @__PURE__ */ React44.createElement(
|
|
2895
|
+
ContentPanelAddIconButton,
|
|
2896
|
+
{
|
|
2897
|
+
"aria-label": ariaLabel,
|
|
2898
|
+
disabled,
|
|
2899
|
+
onClick: (event) => {
|
|
2900
|
+
event.stopPropagation();
|
|
2901
|
+
onBeforeCreate?.();
|
|
2902
|
+
onCreate();
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
);
|
|
2906
|
+
}
|
|
2907
|
+
return /* @__PURE__ */ React44.createElement(
|
|
2908
|
+
Stack11,
|
|
2909
|
+
{
|
|
2910
|
+
alignItems: "center",
|
|
2911
|
+
direction: "row",
|
|
2912
|
+
onClick: (event) => {
|
|
2913
|
+
event.stopPropagation();
|
|
2914
|
+
onBeforeCreate?.();
|
|
2915
|
+
togglePromotion();
|
|
2916
|
+
},
|
|
2917
|
+
sx: { cursor: "pointer" }
|
|
2918
|
+
},
|
|
2919
|
+
/* @__PURE__ */ React44.createElement(ContentPanelAddIconButton, { "aria-label": ariaLabel, tabIndex: -1 }),
|
|
2920
|
+
/* @__PURE__ */ React44.createElement(SiteContentPopupsPromotionChip, { ref: promotionRef })
|
|
2921
|
+
);
|
|
2922
|
+
}
|
|
2923
|
+
);
|
|
2738
2924
|
export {
|
|
2925
|
+
ContentPanelAddIconButton,
|
|
2926
|
+
ContentPanelCoordinatorProvider,
|
|
2927
|
+
POPUPS_SITE_CONTENT_SECTION_ID,
|
|
2928
|
+
POST_PER_PAGE,
|
|
2929
|
+
PopupSectionAddButton,
|
|
2930
|
+
CollapsibleList as SiteContentCollapsibleList,
|
|
2931
|
+
EditModeTemplate as SiteContentEditModeTemplate,
|
|
2932
|
+
ErrorState as SiteContentListErrorState,
|
|
2739
2933
|
SiteContentListItemActionsSlot,
|
|
2934
|
+
PageTitleAndStatus as SiteContentPageTitleAndStatus,
|
|
2935
|
+
PostListPaginationActions as SiteContentPaginationActions,
|
|
2936
|
+
contentPanelListItemButtonSx,
|
|
2937
|
+
contentPanelListRowPaddingSx,
|
|
2938
|
+
env,
|
|
2740
2939
|
extendIconsMap,
|
|
2940
|
+
getSiteContentHeaderCreateItems,
|
|
2941
|
+
getSiteContentSections,
|
|
2741
2942
|
init,
|
|
2742
|
-
injectIntoSiteContentListItemActions
|
|
2943
|
+
injectIntoSiteContentListItemActions,
|
|
2944
|
+
registerSiteContentHeaderCreateItem,
|
|
2945
|
+
registerSiteContentSection,
|
|
2946
|
+
resetSiteContentHeaderCreateItems,
|
|
2947
|
+
resetSiteContentSections,
|
|
2948
|
+
useContentPanelCoordinator,
|
|
2949
|
+
usePostListPagination
|
|
2743
2950
|
};
|