@elementor/editor-global-classes 3.33.0-117 → 3.33.0-119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +430 -316
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +394 -276
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/api.ts +4 -0
- package/src/components/class-manager/class-manager-button.tsx +1 -1
- package/src/components/class-manager/class-manager-panel.tsx +1 -2
- package/src/components/class-manager/duplicate-label-dialog.tsx +159 -0
- package/src/components/search-and-filter/context.tsx +11 -1
- package/src/hooks/use-css-class-by-id.ts +8 -0
- package/src/init.ts +6 -6
- package/src/save-global-classes.tsx +50 -0
- package/src/store.ts +15 -0
- package/src/sync-with-document-save.ts +5 -4
- package/src/sync-with-document.tsx +20 -0
- package/src/components/class-manager/save-changes-dialog.tsx +0 -92
- package/src/save-global-classes.ts +0 -42
package/dist/index.js
CHANGED
|
@@ -39,15 +39,15 @@ var import_editor = require("@elementor/editor");
|
|
|
39
39
|
var import_editor_editing_panel = require("@elementor/editor-editing-panel");
|
|
40
40
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
41
41
|
var import_editor_styles_repository5 = require("@elementor/editor-styles-repository");
|
|
42
|
-
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
43
42
|
var import_store24 = require("@elementor/store");
|
|
44
43
|
|
|
45
44
|
// src/components/class-manager/class-manager-button.tsx
|
|
46
|
-
var
|
|
45
|
+
var React19 = __toESM(require("react"));
|
|
47
46
|
var import_editor_documents5 = require("@elementor/editor-documents");
|
|
48
47
|
var import_editor_styles_repository3 = require("@elementor/editor-styles-repository");
|
|
48
|
+
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
49
49
|
var import_ui16 = require("@elementor/ui");
|
|
50
|
-
var
|
|
50
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
51
51
|
|
|
52
52
|
// src/global-classes-styles-provider.ts
|
|
53
53
|
var import_editor_styles2 = require("@elementor/editor-styles");
|
|
@@ -199,6 +199,13 @@ var slice = (0, import_store.__createSlice)({
|
|
|
199
199
|
state.data.items[payload.style.id] = mergedData;
|
|
200
200
|
state.isDirty = true;
|
|
201
201
|
},
|
|
202
|
+
updateMultiple(state, { payload }) {
|
|
203
|
+
localHistory.next(state.data);
|
|
204
|
+
Object.entries(payload).forEach(([id2, { modified }]) => {
|
|
205
|
+
state.data.items[id2].label = modified;
|
|
206
|
+
});
|
|
207
|
+
state.isDirty = false;
|
|
208
|
+
},
|
|
202
209
|
updateProps(state, {
|
|
203
210
|
payload
|
|
204
211
|
}) {
|
|
@@ -381,6 +388,9 @@ var apiClient = {
|
|
|
381
388
|
}
|
|
382
389
|
})
|
|
383
390
|
};
|
|
391
|
+
var API_ERROR_CODES = {
|
|
392
|
+
DUPLICATED_LABEL: "DUPLICATED_LABEL"
|
|
393
|
+
};
|
|
384
394
|
|
|
385
395
|
// src/components/css-class-usage/utils.ts
|
|
386
396
|
var transformData = (data) => Object.entries(data).reduce((acc, [key, value]) => {
|
|
@@ -411,17 +421,17 @@ function usePrefetchCssClassUsage() {
|
|
|
411
421
|
}
|
|
412
422
|
|
|
413
423
|
// src/components/class-manager/class-manager-panel.tsx
|
|
414
|
-
var
|
|
415
|
-
var
|
|
424
|
+
var React18 = __toESM(require("react"));
|
|
425
|
+
var import_react8 = require("react");
|
|
416
426
|
var import_editor_documents4 = require("@elementor/editor-documents");
|
|
417
427
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
418
|
-
var
|
|
428
|
+
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
419
429
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
420
430
|
var import_icons12 = require("@elementor/icons");
|
|
421
431
|
var import_query3 = require("@elementor/query");
|
|
422
432
|
var import_store18 = require("@elementor/store");
|
|
423
433
|
var import_ui15 = require("@elementor/ui");
|
|
424
|
-
var
|
|
434
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
425
435
|
|
|
426
436
|
// src/hooks/use-classes-order.ts
|
|
427
437
|
var import_store4 = require("@elementor/store");
|
|
@@ -450,9 +460,17 @@ var INIT_CHECKED_FILTERS = {
|
|
|
450
460
|
};
|
|
451
461
|
var SearchAndFilterProvider = ({ children }) => {
|
|
452
462
|
const [filters, setFilters] = React.useState(INIT_CHECKED_FILTERS);
|
|
463
|
+
const getInitialSearchValue = () => {
|
|
464
|
+
const storedValue = localStorage.getItem("elementor-global-classes-search");
|
|
465
|
+
if (storedValue) {
|
|
466
|
+
localStorage.removeItem("elementor-global-classes-search");
|
|
467
|
+
return storedValue;
|
|
468
|
+
}
|
|
469
|
+
return "";
|
|
470
|
+
};
|
|
453
471
|
const { debouncedValue, inputValue, handleChange } = (0, import_utils3.useDebounceState)({
|
|
454
472
|
delay: 300,
|
|
455
|
-
initialValue:
|
|
473
|
+
initialValue: getInitialSearchValue()
|
|
456
474
|
});
|
|
457
475
|
const onClearSearch = () => {
|
|
458
476
|
handleChange("");
|
|
@@ -583,25 +601,135 @@ var useFilters = () => {
|
|
|
583
601
|
}, [filters, allFilters]);
|
|
584
602
|
};
|
|
585
603
|
|
|
586
|
-
// src/save-global-classes.
|
|
604
|
+
// src/save-global-classes.tsx
|
|
605
|
+
var React3 = __toESM(require("react"));
|
|
606
|
+
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
587
607
|
var import_store10 = require("@elementor/store");
|
|
588
608
|
var import_utils4 = require("@elementor/utils");
|
|
589
|
-
|
|
609
|
+
|
|
610
|
+
// src/components/class-manager/duplicate-label-dialog.tsx
|
|
611
|
+
var React2 = __toESM(require("react"));
|
|
612
|
+
var import_editor_ui = require("@elementor/editor-ui");
|
|
613
|
+
var import_icons = require("@elementor/icons");
|
|
614
|
+
var import_ui = require("@elementor/ui");
|
|
615
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
616
|
+
var DUP_PREFIX = "DUP_";
|
|
617
|
+
var DuplicateLabelDialog = ({
|
|
618
|
+
modifiedLabels,
|
|
619
|
+
onApprove
|
|
620
|
+
}) => {
|
|
621
|
+
const handleButtonClick = () => {
|
|
622
|
+
localStorage.setItem("elementor-global-classes-search", DUP_PREFIX);
|
|
623
|
+
onApprove?.();
|
|
624
|
+
(0, import_editor_ui.closeDialog)();
|
|
625
|
+
};
|
|
626
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(import_ui.DialogHeader, { logo: false }, /* @__PURE__ */ React2.createElement(import_ui.Box, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React2.createElement(import_ui.Icon, { color: "secondary" }, /* @__PURE__ */ React2.createElement(import_icons.InfoCircleFilledIcon, { fontSize: "medium" })), /* @__PURE__ */ React2.createElement(import_ui.Typography, { variant: "subtitle1" }, (0, import_i18n2.__)("We've published your page and updated class names.", "elementor")))), /* @__PURE__ */ React2.createElement(import_ui.DialogContent, null, /* @__PURE__ */ React2.createElement(import_ui.Stack, { spacing: 2, direction: "column" }, /* @__PURE__ */ React2.createElement(import_ui.Typography, { variant: "body2" }, (0, import_i18n2.__)(
|
|
627
|
+
"Some new classes used the same names as existing ones. To prevent conflicts, we added the prefix",
|
|
628
|
+
"elementor"
|
|
629
|
+
), /* @__PURE__ */ React2.createElement("strong", null, " ", DUP_PREFIX)), /* @__PURE__ */ React2.createElement(import_ui.Box, null, /* @__PURE__ */ React2.createElement(
|
|
630
|
+
import_ui.Box,
|
|
631
|
+
{
|
|
632
|
+
sx: {
|
|
633
|
+
width: "100%",
|
|
634
|
+
display: "flex",
|
|
635
|
+
gap: 2,
|
|
636
|
+
alignItems: "flex-start"
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
/* @__PURE__ */ React2.createElement(
|
|
640
|
+
import_ui.Typography,
|
|
641
|
+
{
|
|
642
|
+
variant: "subtitle2",
|
|
643
|
+
sx: {
|
|
644
|
+
fontWeight: "bold",
|
|
645
|
+
flex: 1,
|
|
646
|
+
flexShrink: 1,
|
|
647
|
+
flexGrow: 1,
|
|
648
|
+
minWidth: 0
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
(0, import_i18n2.__)("Before", "elementor")
|
|
652
|
+
),
|
|
653
|
+
/* @__PURE__ */ React2.createElement(
|
|
654
|
+
import_ui.Typography,
|
|
655
|
+
{
|
|
656
|
+
variant: "subtitle2",
|
|
657
|
+
sx: {
|
|
658
|
+
minWidth: "200px",
|
|
659
|
+
fontWeight: "bold",
|
|
660
|
+
flexShrink: 0,
|
|
661
|
+
flexGrow: 0,
|
|
662
|
+
width: "200px",
|
|
663
|
+
maxWidth: "200px"
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
(0, import_i18n2.__)("After", "elementor")
|
|
667
|
+
)
|
|
668
|
+
), /* @__PURE__ */ React2.createElement(import_ui.Divider, { sx: { mt: 0.5, mb: 0.5 } }), /* @__PURE__ */ React2.createElement(import_ui.Stack, { direction: "column", gap: 0.5, sx: { pb: 2 } }, Object.values(modifiedLabels).map(({ original, modified }, index) => /* @__PURE__ */ React2.createElement(
|
|
669
|
+
import_ui.Box,
|
|
670
|
+
{
|
|
671
|
+
key: index,
|
|
672
|
+
sx: {
|
|
673
|
+
width: "100%",
|
|
674
|
+
display: "flex",
|
|
675
|
+
gap: 2,
|
|
676
|
+
alignItems: "flex-start"
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
/* @__PURE__ */ React2.createElement(
|
|
680
|
+
import_ui.Box,
|
|
681
|
+
{
|
|
682
|
+
sx: {
|
|
683
|
+
flex: 1,
|
|
684
|
+
flexShrink: 1,
|
|
685
|
+
flexGrow: 1,
|
|
686
|
+
minWidth: 0
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
/* @__PURE__ */ React2.createElement(import_editor_ui.EllipsisWithTooltip, { title: original }, /* @__PURE__ */ React2.createElement(import_ui.Typography, { variant: "body2", sx: { color: "text.secondary" } }, original))
|
|
690
|
+
),
|
|
691
|
+
/* @__PURE__ */ React2.createElement(
|
|
692
|
+
import_ui.Box,
|
|
693
|
+
{
|
|
694
|
+
sx: {
|
|
695
|
+
minWidth: "200px",
|
|
696
|
+
flexShrink: 0,
|
|
697
|
+
flexGrow: 0,
|
|
698
|
+
width: "200px",
|
|
699
|
+
maxWidth: "200px"
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
/* @__PURE__ */ React2.createElement(import_editor_ui.EllipsisWithTooltip, { title: modified }, /* @__PURE__ */ React2.createElement(import_ui.Typography, { variant: "body2", sx: { color: "text.primary" } }, modified))
|
|
703
|
+
)
|
|
704
|
+
))), /* @__PURE__ */ React2.createElement(import_ui.Box, null, /* @__PURE__ */ React2.createElement(import_ui.Alert, { severity: "info", size: "small", color: "secondary" }, /* @__PURE__ */ React2.createElement("strong", null, (0, import_i18n2.__)("Your designs and classes are safe.", "elementor")), (0, import_i18n2.__)(
|
|
705
|
+
"Only the prefixes were added.Find them in Class Manager by searching",
|
|
706
|
+
"elementor"
|
|
707
|
+
), /* @__PURE__ */ React2.createElement("strong", null, DUP_PREFIX)))))), /* @__PURE__ */ React2.createElement(import_ui.DialogActions, null, /* @__PURE__ */ React2.createElement(import_ui.Button, { color: "secondary", variant: "text", onClick: handleButtonClick }, (0, import_i18n2.__)("Go to Class Manager", "elementor")), /* @__PURE__ */ React2.createElement(import_ui.Button, { color: "secondary", variant: "contained", onClick: import_editor_ui.closeDialog }, (0, import_i18n2.__)("Done", "elementor"))));
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
// src/save-global-classes.tsx
|
|
711
|
+
async function saveGlobalClasses({ context: context2, onApprove }) {
|
|
590
712
|
const state = selectData((0, import_store10.__getState)());
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
713
|
+
const apiAction = context2 === "preview" ? apiClient.saveDraft : apiClient.publish;
|
|
714
|
+
const currentContext = context2 === "preview" ? selectPreviewInitialData : selectFrontendInitialData;
|
|
715
|
+
const response = await apiAction({
|
|
716
|
+
items: state.items,
|
|
717
|
+
order: state.order,
|
|
718
|
+
changes: calculateChanges(state, currentContext((0, import_store10.__getState)()))
|
|
719
|
+
});
|
|
720
|
+
(0, import_store10.__dispatch)(slice.actions.reset({ context: context2 }));
|
|
721
|
+
if (response?.data?.data?.code === API_ERROR_CODES.DUPLICATED_LABEL) {
|
|
722
|
+
(0, import_store10.__dispatch)(slice.actions.updateMultiple(response.data.data.modifiedLabels));
|
|
723
|
+
(0, import_editor_ui2.openDialog)({
|
|
724
|
+
component: /* @__PURE__ */ React3.createElement(
|
|
725
|
+
DuplicateLabelDialog,
|
|
726
|
+
{
|
|
727
|
+
modifiedLabels: response.data.data.modifiedLabels || [],
|
|
728
|
+
onApprove
|
|
729
|
+
}
|
|
730
|
+
)
|
|
602
731
|
});
|
|
603
732
|
}
|
|
604
|
-
(0, import_store10.__dispatch)(slice.actions.reset({ context: context2 }));
|
|
605
733
|
}
|
|
606
734
|
function calculateChanges(state, initialData) {
|
|
607
735
|
const stateIds = Object.keys(state.items);
|
|
@@ -616,21 +744,21 @@ function calculateChanges(state, initialData) {
|
|
|
616
744
|
}
|
|
617
745
|
|
|
618
746
|
// src/components/search-and-filter/components/filter/active-filters.tsx
|
|
619
|
-
var
|
|
620
|
-
var
|
|
621
|
-
var
|
|
747
|
+
var React6 = __toESM(require("react"));
|
|
748
|
+
var import_ui4 = require("@elementor/ui");
|
|
749
|
+
var import_i18n4 = require("@wordpress/i18n");
|
|
622
750
|
|
|
623
751
|
// src/components/search-and-filter/components/filter/clear-icon-button.tsx
|
|
624
|
-
var
|
|
625
|
-
var
|
|
626
|
-
var
|
|
752
|
+
var React4 = __toESM(require("react"));
|
|
753
|
+
var import_icons2 = require("@elementor/icons");
|
|
754
|
+
var import_ui2 = require("@elementor/ui");
|
|
627
755
|
var ClearIconButton = ({ tooltipText, sx }) => {
|
|
628
756
|
const {
|
|
629
757
|
filters: { onClearFilter }
|
|
630
758
|
} = useSearchAndFilters();
|
|
631
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ React4.createElement(import_ui2.Tooltip, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React4.createElement(import_ui2.Box, null, /* @__PURE__ */ React4.createElement(CustomIconButton, { "aria-label": tooltipText, size: "tiny", onClick: onClearFilter, sx }, /* @__PURE__ */ React4.createElement(import_icons2.BrushBigIcon, { fontSize: "tiny" }))));
|
|
632
760
|
};
|
|
633
|
-
var CustomIconButton = (0,
|
|
761
|
+
var CustomIconButton = (0, import_ui2.styled)(import_ui2.IconButton)(({ theme }) => ({
|
|
634
762
|
"&.Mui-disabled": {
|
|
635
763
|
pointerEvents: "auto",
|
|
636
764
|
"&:hover": {
|
|
@@ -640,13 +768,13 @@ var CustomIconButton = (0, import_ui.styled)(import_ui.IconButton)(({ theme }) =
|
|
|
640
768
|
}));
|
|
641
769
|
|
|
642
770
|
// src/components/search-and-filter/components/filter/filter-list.tsx
|
|
643
|
-
var
|
|
644
|
-
var
|
|
645
|
-
var
|
|
771
|
+
var React5 = __toESM(require("react"));
|
|
772
|
+
var import_ui3 = require("@elementor/ui");
|
|
773
|
+
var import_i18n3 = require("@wordpress/i18n");
|
|
646
774
|
var filterConfig = {
|
|
647
|
-
unused: (0,
|
|
648
|
-
empty: (0,
|
|
649
|
-
onThisPage: (0,
|
|
775
|
+
unused: (0, import_i18n3.__)("Unused", "elementor"),
|
|
776
|
+
empty: (0, import_i18n3.__)("Empty", "elementor"),
|
|
777
|
+
onThisPage: (0, import_i18n3.__)("On this page", "elementor")
|
|
650
778
|
};
|
|
651
779
|
var FilterList = () => {
|
|
652
780
|
const {
|
|
@@ -656,31 +784,31 @@ var FilterList = () => {
|
|
|
656
784
|
const handleOnClick = (value) => {
|
|
657
785
|
setFilters((prev) => ({ ...prev, [value]: !prev[value] }));
|
|
658
786
|
};
|
|
659
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ React5.createElement(import_ui3.MenuList, null, /* @__PURE__ */ React5.createElement(import_ui3.MenuItem, { onClick: () => handleOnClick("unused") }, /* @__PURE__ */ React5.createElement(
|
|
660
788
|
LabeledCheckbox,
|
|
661
789
|
{
|
|
662
790
|
label: filterConfig.unused,
|
|
663
791
|
checked: filters.unused,
|
|
664
|
-
suffix: /* @__PURE__ */
|
|
792
|
+
suffix: /* @__PURE__ */ React5.createElement(import_ui3.Chip, { size: "tiny", sx: { ml: "auto" }, label: filteredCssClass.unused.length })
|
|
665
793
|
}
|
|
666
|
-
)), /* @__PURE__ */
|
|
794
|
+
)), /* @__PURE__ */ React5.createElement(import_ui3.MenuItem, { onClick: () => handleOnClick("empty") }, /* @__PURE__ */ React5.createElement(
|
|
667
795
|
LabeledCheckbox,
|
|
668
796
|
{
|
|
669
797
|
label: filterConfig.empty,
|
|
670
798
|
checked: filters.empty,
|
|
671
|
-
suffix: /* @__PURE__ */
|
|
799
|
+
suffix: /* @__PURE__ */ React5.createElement(import_ui3.Chip, { size: "tiny", sx: { ml: "auto" }, label: filteredCssClass.empty.length })
|
|
672
800
|
}
|
|
673
|
-
)), /* @__PURE__ */
|
|
801
|
+
)), /* @__PURE__ */ React5.createElement(import_ui3.MenuItem, { onClick: () => handleOnClick("onThisPage") }, /* @__PURE__ */ React5.createElement(
|
|
674
802
|
LabeledCheckbox,
|
|
675
803
|
{
|
|
676
804
|
label: filterConfig.onThisPage,
|
|
677
805
|
checked: filters.onThisPage,
|
|
678
|
-
suffix: /* @__PURE__ */
|
|
806
|
+
suffix: /* @__PURE__ */ React5.createElement(import_ui3.Chip, { size: "tiny", sx: { ml: "auto" }, label: filteredCssClass.onThisPage.length })
|
|
679
807
|
}
|
|
680
808
|
)));
|
|
681
809
|
};
|
|
682
|
-
var LabeledCheckbox = ({ label, suffix, checked }) => /* @__PURE__ */
|
|
683
|
-
|
|
810
|
+
var LabeledCheckbox = ({ label, suffix, checked }) => /* @__PURE__ */ React5.createElement(import_ui3.Stack, { direction: "row", alignItems: "center", gap: 0.5, flex: 1 }, /* @__PURE__ */ React5.createElement(
|
|
811
|
+
import_ui3.Checkbox,
|
|
684
812
|
{
|
|
685
813
|
size: "small",
|
|
686
814
|
checked,
|
|
@@ -692,7 +820,7 @@ var LabeledCheckbox = ({ label, suffix, checked }) => /* @__PURE__ */ React3.cre
|
|
|
692
820
|
}
|
|
693
821
|
}
|
|
694
822
|
}
|
|
695
|
-
), /* @__PURE__ */
|
|
823
|
+
), /* @__PURE__ */ React5.createElement(import_ui3.Typography, { variant: "caption", sx: { color: "text.secondary" } }, label), suffix);
|
|
696
824
|
|
|
697
825
|
// src/components/search-and-filter/components/filter/active-filters.tsx
|
|
698
826
|
var ActiveFilters = () => {
|
|
@@ -704,8 +832,8 @@ var ActiveFilters = () => {
|
|
|
704
832
|
};
|
|
705
833
|
const activeKeys = Object.keys(filters).filter((key) => filters[key]);
|
|
706
834
|
const showClearIcon = activeKeys.length > 0;
|
|
707
|
-
return /* @__PURE__ */
|
|
708
|
-
|
|
835
|
+
return /* @__PURE__ */ React6.createElement(import_ui4.Stack, { direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React6.createElement(import_ui4.Stack, { direction: "row", gap: 0.5, alignItems: "center", flexWrap: "wrap" }, activeKeys.map((key) => /* @__PURE__ */ React6.createElement(
|
|
836
|
+
import_ui4.Chip,
|
|
709
837
|
{
|
|
710
838
|
key,
|
|
711
839
|
label: filterConfig[key],
|
|
@@ -713,10 +841,10 @@ var ActiveFilters = () => {
|
|
|
713
841
|
sx: chipSx,
|
|
714
842
|
size: "tiny"
|
|
715
843
|
}
|
|
716
|
-
))), showClearIcon && /* @__PURE__ */
|
|
844
|
+
))), showClearIcon && /* @__PURE__ */ React6.createElement(
|
|
717
845
|
ClearIconButton,
|
|
718
846
|
{
|
|
719
|
-
tooltipText: (0,
|
|
847
|
+
tooltipText: (0, import_i18n4.__)("Clear Filters", "elementor"),
|
|
720
848
|
sx: { margin: "0 0 auto auto" }
|
|
721
849
|
}
|
|
722
850
|
));
|
|
@@ -732,31 +860,31 @@ var chipSx = {
|
|
|
732
860
|
};
|
|
733
861
|
|
|
734
862
|
// src/components/search-and-filter/components/filter/css-class-filter.tsx
|
|
735
|
-
var
|
|
736
|
-
var
|
|
737
|
-
var
|
|
738
|
-
var
|
|
739
|
-
var
|
|
863
|
+
var React7 = __toESM(require("react"));
|
|
864
|
+
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
865
|
+
var import_icons3 = require("@elementor/icons");
|
|
866
|
+
var import_ui5 = require("@elementor/ui");
|
|
867
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
740
868
|
var CssClassFilter = () => {
|
|
741
869
|
const {
|
|
742
870
|
filters: { filters }
|
|
743
871
|
} = useSearchAndFilters();
|
|
744
|
-
const popupState = (0,
|
|
872
|
+
const popupState = (0, import_ui5.usePopupState)({
|
|
745
873
|
variant: "popover",
|
|
746
874
|
disableAutoFocus: true
|
|
747
875
|
});
|
|
748
876
|
const showCleanIcon = Object.values(filters).some((value) => value);
|
|
749
|
-
return /* @__PURE__ */
|
|
750
|
-
|
|
877
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(import_ui5.Tooltip, { title: (0, import_i18n5.__)("Filters", "elementor"), placement: "top" }, /* @__PURE__ */ React7.createElement(
|
|
878
|
+
import_ui5.ToggleButton,
|
|
751
879
|
{
|
|
752
880
|
value: "filter",
|
|
753
881
|
size: "tiny",
|
|
754
882
|
selected: popupState.isOpen,
|
|
755
|
-
...(0,
|
|
883
|
+
...(0, import_ui5.bindToggle)(popupState)
|
|
756
884
|
},
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
)), /* @__PURE__ */
|
|
759
|
-
|
|
885
|
+
/* @__PURE__ */ React7.createElement(import_icons3.FilterIcon, { fontSize: "tiny" })
|
|
886
|
+
)), /* @__PURE__ */ React7.createElement(
|
|
887
|
+
import_ui5.Popover,
|
|
760
888
|
{
|
|
761
889
|
sx: {
|
|
762
890
|
maxWidth: "344px"
|
|
@@ -769,78 +897,78 @@ var CssClassFilter = () => {
|
|
|
769
897
|
vertical: "top",
|
|
770
898
|
horizontal: -21
|
|
771
899
|
},
|
|
772
|
-
...(0,
|
|
900
|
+
...(0, import_ui5.bindPopover)(popupState)
|
|
773
901
|
},
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
|
|
902
|
+
/* @__PURE__ */ React7.createElement(
|
|
903
|
+
import_editor_ui3.PopoverHeader,
|
|
776
904
|
{
|
|
777
905
|
actions: showCleanIcon ? [
|
|
778
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ React7.createElement(
|
|
779
907
|
ClearIconButton,
|
|
780
908
|
{
|
|
781
909
|
key: "clear-all-button",
|
|
782
|
-
tooltipText: (0,
|
|
910
|
+
tooltipText: (0, import_i18n5.__)("Clear all", "elementor")
|
|
783
911
|
}
|
|
784
912
|
)
|
|
785
913
|
] : [],
|
|
786
914
|
onClose: popupState.close,
|
|
787
|
-
title: (0,
|
|
788
|
-
icon: /* @__PURE__ */
|
|
915
|
+
title: (0, import_i18n5.__)("Filters", "elementor"),
|
|
916
|
+
icon: /* @__PURE__ */ React7.createElement(import_icons3.FilterIcon, { fontSize: "tiny" })
|
|
789
917
|
}
|
|
790
918
|
),
|
|
791
|
-
/* @__PURE__ */
|
|
792
|
-
|
|
919
|
+
/* @__PURE__ */ React7.createElement(
|
|
920
|
+
import_ui5.Divider,
|
|
793
921
|
{
|
|
794
922
|
sx: {
|
|
795
923
|
borderWidth: "1px 0 0 0"
|
|
796
924
|
}
|
|
797
925
|
}
|
|
798
926
|
),
|
|
799
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ React7.createElement(import_editor_ui3.PopoverBody, { width: 344, height: 125 }, /* @__PURE__ */ React7.createElement(FilterList, null))
|
|
800
928
|
));
|
|
801
929
|
};
|
|
802
930
|
|
|
803
931
|
// src/components/search-and-filter/components/search/class-manager-search.tsx
|
|
804
|
-
var
|
|
805
|
-
var
|
|
806
|
-
var
|
|
807
|
-
var
|
|
932
|
+
var React8 = __toESM(require("react"));
|
|
933
|
+
var import_icons4 = require("@elementor/icons");
|
|
934
|
+
var import_ui6 = require("@elementor/ui");
|
|
935
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
808
936
|
var ClassManagerSearch = () => {
|
|
809
937
|
const {
|
|
810
938
|
search: { inputValue, handleChange }
|
|
811
939
|
} = useSearchAndFilters();
|
|
812
|
-
return /* @__PURE__ */
|
|
813
|
-
|
|
940
|
+
return /* @__PURE__ */ React8.createElement(import_ui6.Stack, { direction: "row", gap: 0.5, sx: { width: "100%" } }, /* @__PURE__ */ React8.createElement(import_ui6.Box, { sx: { flexGrow: 1 } }, /* @__PURE__ */ React8.createElement(
|
|
941
|
+
import_ui6.TextField,
|
|
814
942
|
{
|
|
815
943
|
role: "search",
|
|
816
944
|
fullWidth: true,
|
|
817
945
|
size: "tiny",
|
|
818
946
|
value: inputValue,
|
|
819
|
-
placeholder: (0,
|
|
947
|
+
placeholder: (0, import_i18n6.__)("Search", "elementor"),
|
|
820
948
|
onChange: (e) => handleChange(e.target.value),
|
|
821
949
|
InputProps: {
|
|
822
|
-
startAdornment: /* @__PURE__ */
|
|
950
|
+
startAdornment: /* @__PURE__ */ React8.createElement(import_ui6.InputAdornment, { position: "start" }, /* @__PURE__ */ React8.createElement(import_icons4.SearchIcon, { fontSize: "tiny" }))
|
|
823
951
|
}
|
|
824
952
|
}
|
|
825
953
|
)));
|
|
826
954
|
};
|
|
827
955
|
|
|
828
956
|
// src/components/class-manager/class-manager-introduction.tsx
|
|
829
|
-
var
|
|
957
|
+
var React9 = __toESM(require("react"));
|
|
830
958
|
var import_react4 = require("react");
|
|
831
959
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
832
|
-
var
|
|
833
|
-
var
|
|
834
|
-
var
|
|
960
|
+
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
961
|
+
var import_ui7 = require("@elementor/ui");
|
|
962
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
835
963
|
var MESSAGE_KEY = "global-class-manager";
|
|
836
964
|
var ClassManagerIntroduction = () => {
|
|
837
965
|
const [isMessageSuppressed, suppressMessage] = (0, import_editor_current_user.useSuppressedMessage)(MESSAGE_KEY);
|
|
838
966
|
const [shouldShowIntroduction, setShouldShowIntroduction] = (0, import_react4.useState)(!isMessageSuppressed);
|
|
839
|
-
return /* @__PURE__ */
|
|
840
|
-
|
|
967
|
+
return /* @__PURE__ */ React9.createElement(
|
|
968
|
+
import_editor_ui4.IntroductionModal,
|
|
841
969
|
{
|
|
842
970
|
open: shouldShowIntroduction,
|
|
843
|
-
title: (0,
|
|
971
|
+
title: (0, import_i18n7.__)("Class Manager", "elementor"),
|
|
844
972
|
handleClose: (shouldShowAgain) => {
|
|
845
973
|
if (!shouldShowAgain) {
|
|
846
974
|
suppressMessage();
|
|
@@ -848,22 +976,22 @@ var ClassManagerIntroduction = () => {
|
|
|
848
976
|
setShouldShowIntroduction(false);
|
|
849
977
|
}
|
|
850
978
|
},
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
|
|
979
|
+
/* @__PURE__ */ React9.createElement(
|
|
980
|
+
import_ui7.Image,
|
|
853
981
|
{
|
|
854
982
|
sx: { width: "100%", aspectRatio: "16 / 9" },
|
|
855
983
|
src: "https://assets.elementor.com/packages/v1/images/class-manager-intro.svg",
|
|
856
984
|
alt: ""
|
|
857
985
|
}
|
|
858
986
|
),
|
|
859
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ React9.createElement(IntroductionContent, null)
|
|
860
988
|
);
|
|
861
989
|
};
|
|
862
990
|
var IntroductionContent = () => {
|
|
863
|
-
return /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ React9.createElement(import_ui7.Box, { p: 3 }, /* @__PURE__ */ React9.createElement(import_ui7.Typography, { variant: "body2" }, (0, import_i18n7.__)(
|
|
864
992
|
"The Class Manager lets you see all the classes you've created, plus adjust their priority, rename them, and delete unused classes to keep your CSS structured.",
|
|
865
993
|
"elementor"
|
|
866
|
-
)), /* @__PURE__ */
|
|
994
|
+
)), /* @__PURE__ */ React9.createElement("br", null), /* @__PURE__ */ React9.createElement(import_ui7.Typography, { variant: "body2" }, (0, import_i18n7.__)(
|
|
867
995
|
"Remember, when editing an item within a specific class, any changes you make will apply across all elements in that class.",
|
|
868
996
|
"elementor"
|
|
869
997
|
)));
|
|
@@ -895,16 +1023,16 @@ var reloadDocument = () => {
|
|
|
895
1023
|
};
|
|
896
1024
|
|
|
897
1025
|
// src/components/class-manager/flipped-color-swatch-icon.tsx
|
|
898
|
-
var
|
|
899
|
-
var
|
|
900
|
-
var FlippedColorSwatchIcon = ({ sx, ...props }) => /* @__PURE__ */
|
|
1026
|
+
var React10 = __toESM(require("react"));
|
|
1027
|
+
var import_icons5 = require("@elementor/icons");
|
|
1028
|
+
var FlippedColorSwatchIcon = ({ sx, ...props }) => /* @__PURE__ */ React10.createElement(import_icons5.ColorSwatchIcon, { sx: { transform: "rotate(90deg)", ...sx }, ...props });
|
|
901
1029
|
|
|
902
1030
|
// src/components/class-manager/global-classes-list.tsx
|
|
903
|
-
var
|
|
1031
|
+
var React17 = __toESM(require("react"));
|
|
904
1032
|
var import_react7 = require("react");
|
|
905
1033
|
var import_store16 = require("@elementor/store");
|
|
906
|
-
var
|
|
907
|
-
var
|
|
1034
|
+
var import_ui14 = require("@elementor/ui");
|
|
1035
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
908
1036
|
|
|
909
1037
|
// src/hooks/use-ordered-classes.ts
|
|
910
1038
|
var import_store14 = require("@elementor/store");
|
|
@@ -913,21 +1041,21 @@ var useOrderedClasses = () => {
|
|
|
913
1041
|
};
|
|
914
1042
|
|
|
915
1043
|
// src/components/class-manager/class-item.tsx
|
|
916
|
-
var
|
|
1044
|
+
var React15 = __toESM(require("react"));
|
|
917
1045
|
var import_react6 = require("react");
|
|
918
1046
|
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
919
|
-
var
|
|
920
|
-
var
|
|
921
|
-
var
|
|
922
|
-
var
|
|
1047
|
+
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
1048
|
+
var import_icons10 = require("@elementor/icons");
|
|
1049
|
+
var import_ui12 = require("@elementor/ui");
|
|
1050
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
923
1051
|
|
|
924
1052
|
// src/components/css-class-usage/components/css-class-usage-popover.tsx
|
|
925
|
-
var
|
|
1053
|
+
var React11 = __toESM(require("react"));
|
|
926
1054
|
var import_editor_documents3 = require("@elementor/editor-documents");
|
|
927
|
-
var
|
|
928
|
-
var
|
|
929
|
-
var
|
|
930
|
-
var
|
|
1055
|
+
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
1056
|
+
var import_icons6 = require("@elementor/icons");
|
|
1057
|
+
var import_ui8 = require("@elementor/ui");
|
|
1058
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
931
1059
|
|
|
932
1060
|
// src/hooks/use-css-class-usage-by-id.ts
|
|
933
1061
|
var EMPTY_CLASS_USAGE = {
|
|
@@ -943,24 +1071,24 @@ var useCssClassUsageByID = (id2) => {
|
|
|
943
1071
|
// src/components/css-class-usage/components/css-class-usage-popover.tsx
|
|
944
1072
|
var iconMapper = {
|
|
945
1073
|
"wp-post": {
|
|
946
|
-
label: (0,
|
|
947
|
-
icon: /* @__PURE__ */
|
|
1074
|
+
label: (0, import_i18n8.__)("Post", "elementor"),
|
|
1075
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons6.PostTypeIcon, { fontSize: "inherit" })
|
|
948
1076
|
},
|
|
949
1077
|
"wp-page": {
|
|
950
|
-
label: (0,
|
|
951
|
-
icon: /* @__PURE__ */
|
|
1078
|
+
label: (0, import_i18n8.__)("Page", "elementor"),
|
|
1079
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons6.PagesIcon, { fontSize: "inherit" })
|
|
952
1080
|
},
|
|
953
1081
|
popup: {
|
|
954
|
-
label: (0,
|
|
955
|
-
icon: /* @__PURE__ */
|
|
1082
|
+
label: (0, import_i18n8.__)("Popup", "elementor"),
|
|
1083
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons6.PopupTemplateIcon, { fontSize: "inherit" })
|
|
956
1084
|
},
|
|
957
1085
|
header: {
|
|
958
|
-
label: (0,
|
|
959
|
-
icon: /* @__PURE__ */
|
|
1086
|
+
label: (0, import_i18n8.__)("Header", "elementor"),
|
|
1087
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons6.HeaderTemplateIcon, { fontSize: "inherit" })
|
|
960
1088
|
},
|
|
961
1089
|
footer: {
|
|
962
|
-
label: (0,
|
|
963
|
-
icon: /* @__PURE__ */
|
|
1090
|
+
label: (0, import_i18n8.__)("Footer", "elementor"),
|
|
1091
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons6.FooterTemplateIcon, { fontSize: "inherit" })
|
|
964
1092
|
}
|
|
965
1093
|
};
|
|
966
1094
|
var CssClassUsagePopover = ({
|
|
@@ -978,42 +1106,42 @@ var CssClassUsagePopover = ({
|
|
|
978
1106
|
docType: type
|
|
979
1107
|
})
|
|
980
1108
|
) ?? [];
|
|
981
|
-
return /* @__PURE__ */
|
|
982
|
-
|
|
1109
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
|
1110
|
+
import_editor_ui5.PopoverHeader,
|
|
983
1111
|
{
|
|
984
|
-
icon: /* @__PURE__ */
|
|
985
|
-
title: /* @__PURE__ */
|
|
1112
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons6.CurrentLocationIcon, { fontSize: "tiny" }),
|
|
1113
|
+
title: /* @__PURE__ */ React11.createElement(import_ui8.Stack, { flexDirection: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React11.createElement(import_ui8.Box, { "aria-label": "header-title" }, (0, import_i18n8.__)("Locator", "elementor")), /* @__PURE__ */ React11.createElement(import_ui8.Box, null, /* @__PURE__ */ React11.createElement(import_ui8.Chip, { sx: { lineHeight: 1 }, size: "tiny", label: classUsage.total }))),
|
|
986
1114
|
onClose
|
|
987
1115
|
}
|
|
988
|
-
), /* @__PURE__ */
|
|
989
|
-
|
|
1116
|
+
), /* @__PURE__ */ React11.createElement(import_ui8.Divider, null), /* @__PURE__ */ React11.createElement(import_editor_ui5.PopoverBody, { width: 300 }, /* @__PURE__ */ React11.createElement(
|
|
1117
|
+
import_editor_ui5.PopoverMenuList,
|
|
990
1118
|
{
|
|
991
1119
|
onSelect: (value) => onNavigate(+value),
|
|
992
1120
|
items: cssClassUsageRecords,
|
|
993
1121
|
onClose: () => {
|
|
994
1122
|
},
|
|
995
1123
|
menuListTemplate: StyledCssClassUsageItem,
|
|
996
|
-
menuItemContentTemplate: (cssClassUsageRecord) => /* @__PURE__ */
|
|
997
|
-
|
|
1124
|
+
menuItemContentTemplate: (cssClassUsageRecord) => /* @__PURE__ */ React11.createElement(import_ui8.Stack, { flexDirection: "row", flex: 1, alignItems: "center" }, /* @__PURE__ */ React11.createElement(import_ui8.Box, { display: "flex", sx: { pr: 1 } }, /* @__PURE__ */ React11.createElement(
|
|
1125
|
+
import_ui8.Tooltip,
|
|
998
1126
|
{
|
|
999
1127
|
disableInteractive: true,
|
|
1000
1128
|
title: iconMapper?.[cssClassUsageRecord.docType]?.label ?? cssClassUsageRecord.docType,
|
|
1001
1129
|
placement: "top"
|
|
1002
1130
|
},
|
|
1003
|
-
/* @__PURE__ */
|
|
1004
|
-
)), /* @__PURE__ */
|
|
1005
|
-
|
|
1131
|
+
/* @__PURE__ */ React11.createElement(import_ui8.Icon, { fontSize: "small" }, iconMapper?.[cssClassUsageRecord.docType]?.icon || /* @__PURE__ */ React11.createElement(import_icons6.PagesIcon, { fontSize: "inherit" }))
|
|
1132
|
+
)), /* @__PURE__ */ React11.createElement(import_ui8.Box, { sx: { pr: 0.5, maxWidth: "173px" }, display: "flex" }, /* @__PURE__ */ React11.createElement(
|
|
1133
|
+
import_editor_ui5.EllipsisWithTooltip,
|
|
1006
1134
|
{
|
|
1007
1135
|
title: cssClassUsageRecord.label,
|
|
1008
|
-
as:
|
|
1136
|
+
as: import_ui8.Typography,
|
|
1009
1137
|
variant: "caption",
|
|
1010
1138
|
maxWidth: "173px",
|
|
1011
1139
|
sx: {
|
|
1012
1140
|
lineHeight: 1
|
|
1013
1141
|
}
|
|
1014
1142
|
}
|
|
1015
|
-
)), /* @__PURE__ */
|
|
1016
|
-
|
|
1143
|
+
)), /* @__PURE__ */ React11.createElement(import_icons6.ExternalLinkIcon, { className: "hover-only-icon", fontSize: "tiny" }), /* @__PURE__ */ React11.createElement(
|
|
1144
|
+
import_ui8.Chip,
|
|
1017
1145
|
{
|
|
1018
1146
|
sx: {
|
|
1019
1147
|
ml: "auto"
|
|
@@ -1025,7 +1153,7 @@ var CssClassUsagePopover = ({
|
|
|
1025
1153
|
}
|
|
1026
1154
|
)));
|
|
1027
1155
|
};
|
|
1028
|
-
var StyledCssClassUsageItem = (0,
|
|
1156
|
+
var StyledCssClassUsageItem = (0, import_ui8.styled)(import_ui8.MenuList)(({ theme }) => ({
|
|
1029
1157
|
"& > li": {
|
|
1030
1158
|
display: "flex",
|
|
1031
1159
|
cursor: "pointer",
|
|
@@ -1059,37 +1187,37 @@ var StyledCssClassUsageItem = (0, import_ui7.styled)(import_ui7.MenuList)(({ the
|
|
|
1059
1187
|
}));
|
|
1060
1188
|
|
|
1061
1189
|
// src/components/css-class-usage/components/css-class-usage-trigger.tsx
|
|
1062
|
-
var
|
|
1063
|
-
var
|
|
1064
|
-
var
|
|
1065
|
-
var
|
|
1066
|
-
var
|
|
1190
|
+
var React12 = __toESM(require("react"));
|
|
1191
|
+
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
1192
|
+
var import_icons7 = require("@elementor/icons");
|
|
1193
|
+
var import_ui9 = require("@elementor/ui");
|
|
1194
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1067
1195
|
var CssClassUsageTrigger = ({ id: id2, onClick }) => {
|
|
1068
1196
|
const {
|
|
1069
1197
|
data: { total },
|
|
1070
1198
|
isLoading
|
|
1071
1199
|
} = useCssClassUsageByID(id2);
|
|
1072
|
-
const cssClassUsagePopover = (0,
|
|
1200
|
+
const cssClassUsagePopover = (0, import_ui9.usePopupState)({ variant: "popover", popupId: "css-class-usage-popover" });
|
|
1073
1201
|
if (isLoading) {
|
|
1074
1202
|
return null;
|
|
1075
1203
|
}
|
|
1076
1204
|
const WrapperComponent = total !== 0 ? TooltipWrapper : InfoAlertMessage;
|
|
1077
|
-
return /* @__PURE__ */
|
|
1205
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(import_ui9.Box, { position: "relative" }, /* @__PURE__ */ React12.createElement(WrapperComponent, { total }, /* @__PURE__ */ React12.createElement(
|
|
1078
1206
|
CustomIconButton2,
|
|
1079
1207
|
{
|
|
1080
1208
|
disabled: total === 0,
|
|
1081
1209
|
size: "tiny",
|
|
1082
|
-
...(0,
|
|
1210
|
+
...(0, import_ui9.bindTrigger)(cssClassUsagePopover),
|
|
1083
1211
|
onClick: (e) => {
|
|
1084
1212
|
if (total !== 0) {
|
|
1085
|
-
(0,
|
|
1213
|
+
(0, import_ui9.bindTrigger)(cssClassUsagePopover).onClick(e);
|
|
1086
1214
|
onClick(id2);
|
|
1087
1215
|
}
|
|
1088
1216
|
}
|
|
1089
1217
|
},
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
-
))), /* @__PURE__ */
|
|
1092
|
-
|
|
1218
|
+
/* @__PURE__ */ React12.createElement(import_icons7.CurrentLocationIcon, { fontSize: "tiny" })
|
|
1219
|
+
))), /* @__PURE__ */ React12.createElement(import_ui9.Box, null, /* @__PURE__ */ React12.createElement(
|
|
1220
|
+
import_ui9.Popover,
|
|
1093
1221
|
{
|
|
1094
1222
|
anchorOrigin: {
|
|
1095
1223
|
vertical: "center",
|
|
@@ -1099,13 +1227,13 @@ var CssClassUsageTrigger = ({ id: id2, onClick }) => {
|
|
|
1099
1227
|
vertical: 15,
|
|
1100
1228
|
horizontal: -50
|
|
1101
1229
|
},
|
|
1102
|
-
...(0,
|
|
1230
|
+
...(0, import_ui9.bindPopover)(cssClassUsagePopover),
|
|
1103
1231
|
onClose: () => {
|
|
1104
|
-
(0,
|
|
1232
|
+
(0, import_ui9.bindPopover)(cssClassUsagePopover).onClose();
|
|
1105
1233
|
onClick("");
|
|
1106
1234
|
}
|
|
1107
1235
|
},
|
|
1108
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ React12.createElement(
|
|
1109
1237
|
CssClassUsagePopover,
|
|
1110
1238
|
{
|
|
1111
1239
|
onClose: cssClassUsagePopover.close,
|
|
@@ -1115,7 +1243,7 @@ var CssClassUsageTrigger = ({ id: id2, onClick }) => {
|
|
|
1115
1243
|
)
|
|
1116
1244
|
)));
|
|
1117
1245
|
};
|
|
1118
|
-
var CustomIconButton2 = (0,
|
|
1246
|
+
var CustomIconButton2 = (0, import_ui9.styled)(import_ui9.IconButton)(({ theme }) => ({
|
|
1119
1247
|
"&.Mui-disabled": {
|
|
1120
1248
|
pointerEvents: "auto",
|
|
1121
1249
|
// Enable hover
|
|
@@ -1127,72 +1255,72 @@ var CustomIconButton2 = (0, import_ui8.styled)(import_ui8.IconButton)(({ theme }
|
|
|
1127
1255
|
height: "22px",
|
|
1128
1256
|
width: "22px"
|
|
1129
1257
|
}));
|
|
1130
|
-
var TooltipWrapper = ({ children, total }) => /* @__PURE__ */
|
|
1131
|
-
|
|
1258
|
+
var TooltipWrapper = ({ children, total }) => /* @__PURE__ */ React12.createElement(
|
|
1259
|
+
import_ui9.Tooltip,
|
|
1132
1260
|
{
|
|
1133
1261
|
disableInteractive: true,
|
|
1134
1262
|
placement: "top",
|
|
1135
|
-
title: `${(0,
|
|
1263
|
+
title: `${(0, import_i18n9.__)("Show {{number}} {{locations}}", "elementor").replace("{{number}}", total.toString()).replace(
|
|
1136
1264
|
"{{locations}}",
|
|
1137
|
-
total === 1 ? (0,
|
|
1265
|
+
total === 1 ? (0, import_i18n9.__)("location", "elementor") : (0, import_i18n9.__)("locations", "elementor")
|
|
1138
1266
|
)}`
|
|
1139
1267
|
},
|
|
1140
|
-
/* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ React12.createElement("span", null, children)
|
|
1141
1269
|
);
|
|
1142
|
-
var InfoAlertMessage = ({ children }) => /* @__PURE__ */
|
|
1143
|
-
|
|
1270
|
+
var InfoAlertMessage = ({ children }) => /* @__PURE__ */ React12.createElement(
|
|
1271
|
+
import_ui9.Infotip,
|
|
1144
1272
|
{
|
|
1145
1273
|
disableInteractive: true,
|
|
1146
1274
|
placement: "top",
|
|
1147
1275
|
color: "secondary",
|
|
1148
|
-
content: /* @__PURE__ */
|
|
1276
|
+
content: /* @__PURE__ */ React12.createElement(import_editor_ui6.InfoAlert, { sx: { mt: 1 } }, (0, import_i18n9.__)("This class isn\u2019t being used yet.", "elementor"))
|
|
1149
1277
|
},
|
|
1150
|
-
/* @__PURE__ */
|
|
1278
|
+
/* @__PURE__ */ React12.createElement("span", null, children)
|
|
1151
1279
|
);
|
|
1152
1280
|
|
|
1153
1281
|
// src/components/class-manager/delete-confirmation-dialog.tsx
|
|
1154
|
-
var
|
|
1282
|
+
var React13 = __toESM(require("react"));
|
|
1155
1283
|
var import_react5 = require("react");
|
|
1156
|
-
var
|
|
1157
|
-
var
|
|
1158
|
-
var
|
|
1284
|
+
var import_icons8 = require("@elementor/icons");
|
|
1285
|
+
var import_ui10 = require("@elementor/ui");
|
|
1286
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1159
1287
|
var context = (0, import_react5.createContext)(null);
|
|
1160
1288
|
var DeleteConfirmationProvider = ({ children }) => {
|
|
1161
1289
|
const [dialogProps, setDialogProps] = (0, import_react5.useState)(null);
|
|
1162
|
-
const
|
|
1290
|
+
const openDialog2 = (props) => {
|
|
1163
1291
|
setDialogProps(props);
|
|
1164
1292
|
};
|
|
1165
|
-
const
|
|
1293
|
+
const closeDialog2 = () => {
|
|
1166
1294
|
setDialogProps(null);
|
|
1167
1295
|
};
|
|
1168
|
-
return /* @__PURE__ */
|
|
1296
|
+
return /* @__PURE__ */ React13.createElement(context.Provider, { value: { openDialog: openDialog2, closeDialog: closeDialog2, dialogProps } }, children, !!dialogProps && /* @__PURE__ */ React13.createElement(DeleteConfirmationDialog, { ...dialogProps }));
|
|
1169
1297
|
};
|
|
1170
1298
|
var TITLE_ID = "delete-class-dialog";
|
|
1171
1299
|
var DeleteConfirmationDialog = ({ label, id: id2 }) => {
|
|
1172
|
-
const { closeDialog } = useDeleteConfirmation();
|
|
1300
|
+
const { closeDialog: closeDialog2 } = useDeleteConfirmation();
|
|
1173
1301
|
const {
|
|
1174
1302
|
data: { total, content }
|
|
1175
1303
|
} = useCssClassUsageByID(id2);
|
|
1176
1304
|
const onConfirm = () => {
|
|
1177
1305
|
deleteClass(id2);
|
|
1178
|
-
|
|
1306
|
+
closeDialog2();
|
|
1179
1307
|
};
|
|
1180
|
-
const text = total && content.length ? (0,
|
|
1308
|
+
const text = total && content.length ? (0, import_i18n10.__)(
|
|
1181
1309
|
"Will permanently remove it from your project and may affect the design across all elements using it. Used %1 times across %2 pages. This action cannot be undone.",
|
|
1182
1310
|
"elementor"
|
|
1183
|
-
).replace("%1", total.toString()).replace("%2", content.length.toString()) : (0,
|
|
1311
|
+
).replace("%1", total.toString()).replace("%2", content.length.toString()) : (0, import_i18n10.__)(
|
|
1184
1312
|
"Will permanently remove it from your project and may affect the design across all elements using it. This action cannot be undone.",
|
|
1185
1313
|
"elementor"
|
|
1186
1314
|
);
|
|
1187
|
-
return /* @__PURE__ */
|
|
1188
|
-
|
|
1315
|
+
return /* @__PURE__ */ React13.createElement(import_ui10.Dialog, { open: true, onClose: closeDialog2, "aria-labelledby": TITLE_ID, maxWidth: "xs" }, /* @__PURE__ */ React13.createElement(import_ui10.DialogTitle, { id: TITLE_ID, display: "flex", alignItems: "center", gap: 1, sx: { lineHeight: 1 } }, /* @__PURE__ */ React13.createElement(import_icons8.AlertOctagonFilledIcon, { color: "error" }), (0, import_i18n10.__)("Delete this class?", "elementor")), /* @__PURE__ */ React13.createElement(import_ui10.DialogContent, null, /* @__PURE__ */ React13.createElement(import_ui10.DialogContentText, { variant: "body2", color: "textPrimary" }, (0, import_i18n10.__)("Deleting", "elementor"), /* @__PURE__ */ React13.createElement(import_ui10.Typography, { variant: "subtitle2", component: "span" }, "\xA0", label, "\xA0"), text)), /* @__PURE__ */ React13.createElement(import_ui10.DialogActions, null, /* @__PURE__ */ React13.createElement(import_ui10.Button, { color: "secondary", onClick: closeDialog2 }, (0, import_i18n10.__)("Not now", "elementor")), /* @__PURE__ */ React13.createElement(
|
|
1316
|
+
import_ui10.Button,
|
|
1189
1317
|
{
|
|
1190
1318
|
autoFocus: true,
|
|
1191
1319
|
variant: "contained",
|
|
1192
1320
|
color: "error",
|
|
1193
1321
|
onClick: onConfirm
|
|
1194
1322
|
},
|
|
1195
|
-
(0,
|
|
1323
|
+
(0, import_i18n10.__)("Delete", "elementor")
|
|
1196
1324
|
)));
|
|
1197
1325
|
};
|
|
1198
1326
|
var useDeleteConfirmation = () => {
|
|
@@ -1204,14 +1332,14 @@ var useDeleteConfirmation = () => {
|
|
|
1204
1332
|
};
|
|
1205
1333
|
|
|
1206
1334
|
// src/components/class-manager/sortable.tsx
|
|
1207
|
-
var
|
|
1208
|
-
var
|
|
1209
|
-
var
|
|
1210
|
-
var SortableProvider = (props) => /* @__PURE__ */
|
|
1211
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
1335
|
+
var React14 = __toESM(require("react"));
|
|
1336
|
+
var import_icons9 = require("@elementor/icons");
|
|
1337
|
+
var import_ui11 = require("@elementor/ui");
|
|
1338
|
+
var SortableProvider = (props) => /* @__PURE__ */ React14.createElement(import_ui11.UnstableSortableProvider, { restrictAxis: true, variant: "static", dragPlaceholderStyle: { opacity: "1" }, ...props });
|
|
1339
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React14.createElement(StyledSortableTrigger, { ...props, role: "button", className: "class-item-sortable-trigger", "aria-label": "sort" }, /* @__PURE__ */ React14.createElement(import_icons9.GripVerticalIcon, { fontSize: "tiny" }));
|
|
1212
1340
|
var SortableItem = ({ children, id: id2, ...props }) => {
|
|
1213
|
-
return /* @__PURE__ */
|
|
1214
|
-
|
|
1341
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1342
|
+
import_ui11.UnstableSortableItem,
|
|
1215
1343
|
{
|
|
1216
1344
|
...props,
|
|
1217
1345
|
id: id2,
|
|
@@ -1226,8 +1354,8 @@ var SortableItem = ({ children, id: id2, ...props }) => {
|
|
|
1226
1354
|
isDragOverlay,
|
|
1227
1355
|
isDragPlaceholder
|
|
1228
1356
|
}) => {
|
|
1229
|
-
return /* @__PURE__ */
|
|
1230
|
-
|
|
1357
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1358
|
+
import_ui11.Box,
|
|
1231
1359
|
{
|
|
1232
1360
|
...itemProps,
|
|
1233
1361
|
style: itemStyle,
|
|
@@ -1245,20 +1373,20 @@ var SortableItem = ({ children, id: id2, ...props }) => {
|
|
|
1245
1373
|
triggerStyle,
|
|
1246
1374
|
isDragPlaceholder
|
|
1247
1375
|
}),
|
|
1248
|
-
showDropIndication && /* @__PURE__ */
|
|
1376
|
+
showDropIndication && /* @__PURE__ */ React14.createElement(SortableItemIndicator, { style: dropIndicationStyle })
|
|
1249
1377
|
);
|
|
1250
1378
|
}
|
|
1251
1379
|
}
|
|
1252
1380
|
);
|
|
1253
1381
|
};
|
|
1254
|
-
var StyledSortableTrigger = (0,
|
|
1382
|
+
var StyledSortableTrigger = (0, import_ui11.styled)("div")(({ theme }) => ({
|
|
1255
1383
|
position: "absolute",
|
|
1256
1384
|
left: 0,
|
|
1257
1385
|
top: "50%",
|
|
1258
1386
|
transform: `translate( -${theme.spacing(1.5)}, -50% )`,
|
|
1259
1387
|
color: theme.palette.action.active
|
|
1260
1388
|
}));
|
|
1261
|
-
var SortableItemIndicator = (0,
|
|
1389
|
+
var SortableItemIndicator = (0, import_ui11.styled)(import_ui11.Box)`
|
|
1262
1390
|
width: 100%;
|
|
1263
1391
|
height: 1px;
|
|
1264
1392
|
background-color: ${({ theme }) => theme.palette.text.primary};
|
|
@@ -1281,20 +1409,20 @@ var ClassItem = ({
|
|
|
1281
1409
|
isEditing,
|
|
1282
1410
|
error,
|
|
1283
1411
|
getProps: getEditableProps
|
|
1284
|
-
} = (0,
|
|
1412
|
+
} = (0, import_editor_ui7.useEditable)({
|
|
1285
1413
|
value: label,
|
|
1286
1414
|
onSubmit: renameClass,
|
|
1287
1415
|
validation: validateLabel
|
|
1288
1416
|
});
|
|
1289
1417
|
const [selectedCssUsage, setSelectedCssUsage] = (0, import_react6.useState)("");
|
|
1290
|
-
const { openDialog } = useDeleteConfirmation();
|
|
1291
|
-
const popupState = (0,
|
|
1418
|
+
const { openDialog: openDialog2 } = useDeleteConfirmation();
|
|
1419
|
+
const popupState = (0, import_ui12.usePopupState)({
|
|
1292
1420
|
variant: "popover",
|
|
1293
1421
|
disableAutoFocus: true
|
|
1294
1422
|
});
|
|
1295
1423
|
const isSelected = (selectedCssUsage === id2 || selected || popupState.isOpen) && !disabled;
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
|
|
1424
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(import_ui12.Stack, { p: 0 }, /* @__PURE__ */ React15.createElement(
|
|
1425
|
+
import_editor_ui7.WarningInfotip,
|
|
1298
1426
|
{
|
|
1299
1427
|
open: Boolean(error),
|
|
1300
1428
|
text: error ?? "",
|
|
@@ -1302,7 +1430,7 @@ var ClassItem = ({
|
|
|
1302
1430
|
width: itemRef.current?.getBoundingClientRect().width,
|
|
1303
1431
|
offset: [0, -15]
|
|
1304
1432
|
},
|
|
1305
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ React15.createElement(
|
|
1306
1434
|
StyledListItemButton,
|
|
1307
1435
|
{
|
|
1308
1436
|
ref: itemRef,
|
|
@@ -1316,31 +1444,31 @@ var ClassItem = ({
|
|
|
1316
1444
|
disabled,
|
|
1317
1445
|
focusVisibleClassName: "visible-class-item"
|
|
1318
1446
|
},
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
|
|
1447
|
+
/* @__PURE__ */ React15.createElement(SortableTrigger, { ...sortableTriggerProps }),
|
|
1448
|
+
/* @__PURE__ */ React15.createElement(Indicator, { isActive: isEditing, isError: !!error }, isEditing ? /* @__PURE__ */ React15.createElement(
|
|
1449
|
+
import_editor_ui7.EditableField,
|
|
1322
1450
|
{
|
|
1323
1451
|
ref: editableRef,
|
|
1324
|
-
as:
|
|
1452
|
+
as: import_ui12.Typography,
|
|
1325
1453
|
variant: "caption",
|
|
1326
1454
|
...getEditableProps()
|
|
1327
1455
|
}
|
|
1328
|
-
) : /* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
|
|
1456
|
+
) : /* @__PURE__ */ React15.createElement(import_editor_ui7.EllipsisWithTooltip, { title: label, as: import_ui12.Typography, variant: "caption" })),
|
|
1457
|
+
/* @__PURE__ */ React15.createElement(import_ui12.Box, { className: "class-item-locator" }, /* @__PURE__ */ React15.createElement(CssClassUsageTrigger, { id: id2, onClick: setSelectedCssUsage })),
|
|
1458
|
+
/* @__PURE__ */ React15.createElement(
|
|
1459
|
+
import_ui12.Tooltip,
|
|
1332
1460
|
{
|
|
1333
1461
|
placement: "top",
|
|
1334
1462
|
className: "class-item-more-actions",
|
|
1335
|
-
title: (0,
|
|
1463
|
+
title: (0, import_i18n11.__)("More actions", "elementor")
|
|
1336
1464
|
},
|
|
1337
|
-
/* @__PURE__ */
|
|
1465
|
+
/* @__PURE__ */ React15.createElement(import_ui12.IconButton, { size: "tiny", ...(0, import_ui12.bindTrigger)(popupState), "aria-label": "More actions" }, /* @__PURE__ */ React15.createElement(import_icons10.DotsVerticalIcon, { fontSize: "tiny" }))
|
|
1338
1466
|
)
|
|
1339
1467
|
)
|
|
1340
|
-
)), /* @__PURE__ */
|
|
1341
|
-
|
|
1468
|
+
)), /* @__PURE__ */ React15.createElement(
|
|
1469
|
+
import_ui12.Menu,
|
|
1342
1470
|
{
|
|
1343
|
-
...(0,
|
|
1471
|
+
...(0, import_ui12.bindMenu)(popupState),
|
|
1344
1472
|
anchorOrigin: {
|
|
1345
1473
|
vertical: "bottom",
|
|
1346
1474
|
horizontal: "right"
|
|
@@ -1350,8 +1478,8 @@ var ClassItem = ({
|
|
|
1350
1478
|
horizontal: "right"
|
|
1351
1479
|
}
|
|
1352
1480
|
},
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
|
|
1481
|
+
/* @__PURE__ */ React15.createElement(
|
|
1482
|
+
import_editor_ui7.MenuListItem,
|
|
1355
1483
|
{
|
|
1356
1484
|
sx: { minWidth: "160px" },
|
|
1357
1485
|
onClick: () => {
|
|
@@ -1359,21 +1487,21 @@ var ClassItem = ({
|
|
|
1359
1487
|
openEditMode();
|
|
1360
1488
|
}
|
|
1361
1489
|
},
|
|
1362
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ React15.createElement(import_ui12.Typography, { variant: "caption", sx: { color: "text.primary" } }, (0, import_i18n11.__)("Rename", "elementor"))
|
|
1363
1491
|
),
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
|
|
1492
|
+
/* @__PURE__ */ React15.createElement(
|
|
1493
|
+
import_editor_ui7.MenuListItem,
|
|
1366
1494
|
{
|
|
1367
1495
|
onClick: () => {
|
|
1368
1496
|
popupState.close();
|
|
1369
|
-
|
|
1497
|
+
openDialog2({ id: id2, label });
|
|
1370
1498
|
}
|
|
1371
1499
|
},
|
|
1372
|
-
/* @__PURE__ */
|
|
1500
|
+
/* @__PURE__ */ React15.createElement(import_ui12.Typography, { variant: "caption", sx: { color: "error.light" } }, (0, import_i18n11.__)("Delete", "elementor"))
|
|
1373
1501
|
)
|
|
1374
1502
|
));
|
|
1375
1503
|
};
|
|
1376
|
-
var StyledListItemButton = (0,
|
|
1504
|
+
var StyledListItemButton = (0, import_ui12.styled)(import_ui12.ListItemButton, {
|
|
1377
1505
|
shouldForwardProp: (prop) => !["showActions", "showSortIndicator"].includes(prop)
|
|
1378
1506
|
})(
|
|
1379
1507
|
({ showActions, showSortIndicator }) => `
|
|
@@ -1402,7 +1530,7 @@ var StyledListItemButton = (0, import_ui11.styled)(import_ui11.ListItemButton, {
|
|
|
1402
1530
|
}
|
|
1403
1531
|
`
|
|
1404
1532
|
);
|
|
1405
|
-
var Indicator = (0,
|
|
1533
|
+
var Indicator = (0, import_ui12.styled)(import_ui12.Box, {
|
|
1406
1534
|
shouldForwardProp: (prop) => !["isActive", "isError"].includes(prop)
|
|
1407
1535
|
})(({ theme, isActive, isError }) => ({
|
|
1408
1536
|
display: "flex",
|
|
@@ -1432,10 +1560,10 @@ var validateLabel = (newLabel) => {
|
|
|
1432
1560
|
};
|
|
1433
1561
|
|
|
1434
1562
|
// src/components/class-manager/not-found.tsx
|
|
1435
|
-
var
|
|
1436
|
-
var
|
|
1437
|
-
var
|
|
1438
|
-
var
|
|
1563
|
+
var React16 = __toESM(require("react"));
|
|
1564
|
+
var import_icons11 = require("@elementor/icons");
|
|
1565
|
+
var import_ui13 = require("@elementor/ui");
|
|
1566
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1439
1567
|
var getNotFoundType = (searchValue, filters, filteredClasses) => {
|
|
1440
1568
|
const searchNotFound = filteredClasses.length <= 0 && searchValue.length > 1;
|
|
1441
1569
|
const filterNotFound = filters && filters.length === 0;
|
|
@@ -1453,19 +1581,19 @@ var getNotFoundType = (searchValue, filters, filteredClasses) => {
|
|
|
1453
1581
|
};
|
|
1454
1582
|
var notFound = {
|
|
1455
1583
|
filterAndSearch: {
|
|
1456
|
-
mainText: (0,
|
|
1457
|
-
sceneryText: (0,
|
|
1458
|
-
icon: /* @__PURE__ */
|
|
1584
|
+
mainText: (0, import_i18n12.__)("Sorry, nothing matched.", "elementor"),
|
|
1585
|
+
sceneryText: (0, import_i18n12.__)("Try something else.", "elementor"),
|
|
1586
|
+
icon: /* @__PURE__ */ React16.createElement(import_icons11.PhotoIcon, { color: "inherit", fontSize: "large" })
|
|
1459
1587
|
},
|
|
1460
1588
|
search: {
|
|
1461
|
-
mainText: (0,
|
|
1462
|
-
sceneryText: (0,
|
|
1463
|
-
icon: /* @__PURE__ */
|
|
1589
|
+
mainText: (0, import_i18n12.__)("Sorry, nothing matched", "elementor"),
|
|
1590
|
+
sceneryText: (0, import_i18n12.__)("Clear your input and try something else.", "elementor"),
|
|
1591
|
+
icon: /* @__PURE__ */ React16.createElement(import_icons11.PhotoIcon, { color: "inherit", fontSize: "large" })
|
|
1464
1592
|
},
|
|
1465
1593
|
filter: {
|
|
1466
|
-
mainText: (0,
|
|
1467
|
-
sceneryText: (0,
|
|
1468
|
-
icon: /* @__PURE__ */
|
|
1594
|
+
mainText: (0, import_i18n12.__)("Sorry, nothing matched that search.", "elementor"),
|
|
1595
|
+
sceneryText: (0, import_i18n12.__)("Clear the filters and try something else.", "elementor"),
|
|
1596
|
+
icon: /* @__PURE__ */ React16.createElement(import_icons11.ColorSwatchIcon, { color: "inherit", fontSize: "large" })
|
|
1469
1597
|
}
|
|
1470
1598
|
};
|
|
1471
1599
|
var NotFound = ({ notFoundType }) => {
|
|
@@ -1475,11 +1603,11 @@ var NotFound = ({ notFoundType }) => {
|
|
|
1475
1603
|
} = useSearchAndFilters();
|
|
1476
1604
|
switch (notFoundType) {
|
|
1477
1605
|
case "filter":
|
|
1478
|
-
return /* @__PURE__ */
|
|
1606
|
+
return /* @__PURE__ */ React16.createElement(NotFoundLayout, { ...notFound.filter, onClear: onClearFilter });
|
|
1479
1607
|
case "search":
|
|
1480
|
-
return /* @__PURE__ */
|
|
1608
|
+
return /* @__PURE__ */ React16.createElement(NotFoundLayout, { ...notFound.search, searchValue: inputValue, onClear: onClearSearch });
|
|
1481
1609
|
case "filterAndSearch":
|
|
1482
|
-
return /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1483
1611
|
NotFoundLayout,
|
|
1484
1612
|
{
|
|
1485
1613
|
...notFound.filterAndSearch,
|
|
@@ -1491,8 +1619,8 @@ var NotFound = ({ notFoundType }) => {
|
|
|
1491
1619
|
);
|
|
1492
1620
|
}
|
|
1493
1621
|
};
|
|
1494
|
-
var NotFoundLayout = ({ onClear, searchValue, mainText, sceneryText, icon }) => /* @__PURE__ */
|
|
1495
|
-
|
|
1622
|
+
var NotFoundLayout = ({ onClear, searchValue, mainText, sceneryText, icon }) => /* @__PURE__ */ React16.createElement(
|
|
1623
|
+
import_ui13.Stack,
|
|
1496
1624
|
{
|
|
1497
1625
|
color: "text.secondary",
|
|
1498
1626
|
pt: 5,
|
|
@@ -1502,16 +1630,16 @@ var NotFoundLayout = ({ onClear, searchValue, mainText, sceneryText, icon }) =>
|
|
|
1502
1630
|
justifySelf: "center"
|
|
1503
1631
|
},
|
|
1504
1632
|
icon,
|
|
1505
|
-
/* @__PURE__ */
|
|
1506
|
-
|
|
1633
|
+
/* @__PURE__ */ React16.createElement(
|
|
1634
|
+
import_ui13.Box,
|
|
1507
1635
|
{
|
|
1508
1636
|
sx: {
|
|
1509
1637
|
width: "100%"
|
|
1510
1638
|
}
|
|
1511
1639
|
},
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
searchValue && /* @__PURE__ */
|
|
1514
|
-
|
|
1640
|
+
/* @__PURE__ */ React16.createElement(import_ui13.Typography, { align: "center", variant: "subtitle2", color: "inherit" }, mainText),
|
|
1641
|
+
searchValue && /* @__PURE__ */ React16.createElement(
|
|
1642
|
+
import_ui13.Typography,
|
|
1515
1643
|
{
|
|
1516
1644
|
variant: "subtitle2",
|
|
1517
1645
|
color: "inherit",
|
|
@@ -1521,8 +1649,8 @@ var NotFoundLayout = ({ onClear, searchValue, mainText, sceneryText, icon }) =>
|
|
|
1521
1649
|
justifyContent: "center"
|
|
1522
1650
|
}
|
|
1523
1651
|
},
|
|
1524
|
-
/* @__PURE__ */
|
|
1525
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ React16.createElement("span", null, "\u201C"),
|
|
1653
|
+
/* @__PURE__ */ React16.createElement(
|
|
1526
1654
|
"span",
|
|
1527
1655
|
{
|
|
1528
1656
|
style: {
|
|
@@ -1533,11 +1661,11 @@ var NotFoundLayout = ({ onClear, searchValue, mainText, sceneryText, icon }) =>
|
|
|
1533
1661
|
},
|
|
1534
1662
|
searchValue
|
|
1535
1663
|
),
|
|
1536
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ React16.createElement("span", null, "\u201D.")
|
|
1537
1665
|
)
|
|
1538
1666
|
),
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */
|
|
1667
|
+
/* @__PURE__ */ React16.createElement(import_ui13.Typography, { align: "center", variant: "caption", color: "inherit" }, sceneryText),
|
|
1668
|
+
/* @__PURE__ */ React16.createElement(import_ui13.Typography, { align: "center", variant: "caption", color: "inherit" }, /* @__PURE__ */ React16.createElement(import_ui13.Link, { color: "secondary", variant: "caption", component: "button", onClick: onClear }, (0, import_i18n12.__)("Clear & try again", "elementor")))
|
|
1541
1669
|
);
|
|
1542
1670
|
|
|
1543
1671
|
// src/components/class-manager/global-classes-list.tsx
|
|
@@ -1568,22 +1696,22 @@ var GlobalClassesList = ({ disabled }) => {
|
|
|
1568
1696
|
return () => window.removeEventListener("keydown", handler);
|
|
1569
1697
|
}, [dispatch5]);
|
|
1570
1698
|
if (!cssClasses?.length) {
|
|
1571
|
-
return /* @__PURE__ */
|
|
1699
|
+
return /* @__PURE__ */ React17.createElement(EmptyState, null);
|
|
1572
1700
|
}
|
|
1573
1701
|
const notFoundType = getNotFoundType(searchValue, filters, filteredCssClasses);
|
|
1574
1702
|
if (notFoundType) {
|
|
1575
|
-
return /* @__PURE__ */
|
|
1703
|
+
return /* @__PURE__ */ React17.createElement(NotFound, { notFoundType });
|
|
1576
1704
|
}
|
|
1577
1705
|
const isFiltersApplied = filters?.length || searchValue;
|
|
1578
1706
|
const allowSorting = filteredCssClasses.length > 1 && !isFiltersApplied;
|
|
1579
|
-
return /* @__PURE__ */
|
|
1707
|
+
return /* @__PURE__ */ React17.createElement(DeleteConfirmationProvider, null, /* @__PURE__ */ React17.createElement(import_ui14.List, { sx: { display: "flex", flexDirection: "column", gap: 0.5 } }, /* @__PURE__ */ React17.createElement(
|
|
1580
1708
|
SortableProvider,
|
|
1581
1709
|
{
|
|
1582
1710
|
value: classesOrder,
|
|
1583
1711
|
onChange: reorderClasses,
|
|
1584
1712
|
disableDragOverlay: !allowSorting
|
|
1585
1713
|
},
|
|
1586
|
-
filteredCssClasses?.map(({ id: id2, label }) => /* @__PURE__ */
|
|
1714
|
+
filteredCssClasses?.map(({ id: id2, label }) => /* @__PURE__ */ React17.createElement(SortableItem, { key: id2, id: id2 }, ({ isDragged, isDragPlaceholder, triggerProps, triggerStyle }) => /* @__PURE__ */ React17.createElement(
|
|
1587
1715
|
ClassItem,
|
|
1588
1716
|
{
|
|
1589
1717
|
id: id2,
|
|
@@ -1606,11 +1734,11 @@ var GlobalClassesList = ({ disabled }) => {
|
|
|
1606
1734
|
)))
|
|
1607
1735
|
)));
|
|
1608
1736
|
};
|
|
1609
|
-
var EmptyState = () => /* @__PURE__ */
|
|
1737
|
+
var EmptyState = () => /* @__PURE__ */ React17.createElement(import_ui14.Stack, { alignItems: "center", gap: 1.5, pt: 10, px: 0.5, maxWidth: "260px", margin: "auto" }, /* @__PURE__ */ React17.createElement(FlippedColorSwatchIcon, { fontSize: "large" }), /* @__PURE__ */ React17.createElement(StyledHeader, { variant: "subtitle2", component: "h2", color: "text.secondary" }, (0, import_i18n13.__)("There are no global classes yet.", "elementor")), /* @__PURE__ */ React17.createElement(import_ui14.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n13.__)(
|
|
1610
1738
|
"CSS classes created in the editor panel will appear here. Once they are available, you can arrange their hierarchy, rename them, or delete them as needed.",
|
|
1611
1739
|
"elementor"
|
|
1612
1740
|
)));
|
|
1613
|
-
var StyledHeader = (0,
|
|
1741
|
+
var StyledHeader = (0, import_ui14.styled)(import_ui14.Typography)(({ theme, variant }) => ({
|
|
1614
1742
|
"&.MuiTypography-root": {
|
|
1615
1743
|
...theme.typography[variant]
|
|
1616
1744
|
}
|
|
@@ -1660,37 +1788,6 @@ function unblockPanelInteractions() {
|
|
|
1660
1788
|
extendedWindow.$e?.components?.get?.("panel")?.unblockUserInteractions?.();
|
|
1661
1789
|
}
|
|
1662
1790
|
|
|
1663
|
-
// src/components/class-manager/save-changes-dialog.tsx
|
|
1664
|
-
var React16 = __toESM(require("react"));
|
|
1665
|
-
var import_react8 = require("react");
|
|
1666
|
-
var import_icons11 = require("@elementor/icons");
|
|
1667
|
-
var import_ui14 = require("@elementor/ui");
|
|
1668
|
-
var TITLE_ID2 = "save-changes-dialog";
|
|
1669
|
-
var SaveChangesDialog = ({ children, onClose }) => /* @__PURE__ */ React16.createElement(import_ui14.Dialog, { open: true, onClose, "aria-labelledby": TITLE_ID2, maxWidth: "xs" }, children);
|
|
1670
|
-
var SaveChangesDialogTitle = ({ children }) => /* @__PURE__ */ React16.createElement(import_ui14.DialogTitle, { id: TITLE_ID2, display: "flex", alignItems: "center", gap: 1, sx: { lineHeight: 1 } }, /* @__PURE__ */ React16.createElement(import_icons11.AlertTriangleFilledIcon, { color: "secondary" }), children);
|
|
1671
|
-
var SaveChangesDialogContent = ({ children }) => /* @__PURE__ */ React16.createElement(import_ui14.DialogContent, null, children);
|
|
1672
|
-
var SaveChangesDialogContentText = (props) => /* @__PURE__ */ React16.createElement(import_ui14.DialogContentText, { variant: "body2", color: "textPrimary", display: "flex", flexDirection: "column", ...props });
|
|
1673
|
-
var SaveChangesDialogActions = ({ actions }) => {
|
|
1674
|
-
const [isConfirming, setIsConfirming] = (0, import_react8.useState)(false);
|
|
1675
|
-
const { cancel, confirm, discard } = actions;
|
|
1676
|
-
const onConfirm = async () => {
|
|
1677
|
-
setIsConfirming(true);
|
|
1678
|
-
await confirm.action();
|
|
1679
|
-
setIsConfirming(false);
|
|
1680
|
-
};
|
|
1681
|
-
return /* @__PURE__ */ React16.createElement(import_ui14.DialogActions, null, cancel && /* @__PURE__ */ React16.createElement(import_ui14.Button, { variant: "text", color: "secondary", onClick: cancel.action }, cancel.label), discard && /* @__PURE__ */ React16.createElement(import_ui14.Button, { variant: "text", color: "secondary", onClick: discard.action }, discard.label), /* @__PURE__ */ React16.createElement(import_ui14.Button, { variant: "contained", color: "secondary", onClick: onConfirm, loading: isConfirming }, confirm.label));
|
|
1682
|
-
};
|
|
1683
|
-
SaveChangesDialog.Title = SaveChangesDialogTitle;
|
|
1684
|
-
SaveChangesDialog.Content = SaveChangesDialogContent;
|
|
1685
|
-
SaveChangesDialog.ContentText = SaveChangesDialogContentText;
|
|
1686
|
-
SaveChangesDialog.Actions = SaveChangesDialogActions;
|
|
1687
|
-
var useDialog = () => {
|
|
1688
|
-
const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
|
|
1689
|
-
const open = () => setIsOpen(true);
|
|
1690
|
-
const close = () => setIsOpen(false);
|
|
1691
|
-
return { isOpen, open, close };
|
|
1692
|
-
};
|
|
1693
|
-
|
|
1694
1791
|
// src/components/class-manager/class-manager-panel.tsx
|
|
1695
1792
|
var id = "global-classes-manager";
|
|
1696
1793
|
var { panel, usePanelActions } = (0, import_editor_panels.__createPanel)({
|
|
@@ -1709,14 +1806,14 @@ var { panel, usePanelActions } = (0, import_editor_panels.__createPanel)({
|
|
|
1709
1806
|
function ClassManagerPanel() {
|
|
1710
1807
|
const isDirty2 = useDirtyState();
|
|
1711
1808
|
const { close: closePanel } = usePanelActions();
|
|
1712
|
-
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = useDialog();
|
|
1809
|
+
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = (0, import_editor_ui8.useDialog)();
|
|
1713
1810
|
const { mutateAsync: publish, isPending: isPublishing } = usePublish();
|
|
1714
1811
|
const resetAndClosePanel = () => {
|
|
1715
1812
|
(0, import_store18.__dispatch)(slice.actions.resetToInitialState({ context: "frontend" }));
|
|
1716
1813
|
closeSaveChangesDialog();
|
|
1717
1814
|
};
|
|
1718
1815
|
usePreventUnload();
|
|
1719
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ React18.createElement(import_editor_ui8.ThemeProvider, null, /* @__PURE__ */ React18.createElement(import_ui15.ErrorBoundary, { fallback: /* @__PURE__ */ React18.createElement(ErrorBoundaryFallback, null) }, /* @__PURE__ */ React18.createElement(import_editor_panels.Panel, null, /* @__PURE__ */ React18.createElement(SearchAndFilterProvider, null, /* @__PURE__ */ React18.createElement(import_editor_panels.PanelHeader, null, /* @__PURE__ */ React18.createElement(import_ui15.Stack, { p: 1, pl: 2, width: "100%", direction: "row", alignItems: "center" }, /* @__PURE__ */ React18.createElement(import_ui15.Stack, { width: "100%", direction: "row", gap: 1 }, /* @__PURE__ */ React18.createElement(import_editor_panels.PanelHeaderTitle, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React18.createElement(FlippedColorSwatchIcon, { fontSize: "inherit" }), (0, import_i18n14.__)("Class Manager", "elementor")), /* @__PURE__ */ React18.createElement(TotalCssClassCounter, null)), /* @__PURE__ */ React18.createElement(
|
|
1720
1817
|
CloseButton,
|
|
1721
1818
|
{
|
|
1722
1819
|
sx: { marginLeft: "auto" },
|
|
@@ -1729,7 +1826,7 @@ function ClassManagerPanel() {
|
|
|
1729
1826
|
closePanel();
|
|
1730
1827
|
}
|
|
1731
1828
|
}
|
|
1732
|
-
))), /* @__PURE__ */
|
|
1829
|
+
))), /* @__PURE__ */ React18.createElement(
|
|
1733
1830
|
import_editor_panels.PanelBody,
|
|
1734
1831
|
{
|
|
1735
1832
|
sx: {
|
|
@@ -1738,9 +1835,9 @@ function ClassManagerPanel() {
|
|
|
1738
1835
|
height: "100%"
|
|
1739
1836
|
}
|
|
1740
1837
|
},
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
1743
|
-
/* @__PURE__ */
|
|
1838
|
+
/* @__PURE__ */ React18.createElement(import_ui15.Box, { px: 2, pb: 1 }, /* @__PURE__ */ React18.createElement(import_ui15.Stack, { direction: "row", justifyContent: "spaceBetween", gap: 0.5, sx: { pb: 0.5 } }, /* @__PURE__ */ React18.createElement(import_ui15.Box, { sx: { flexGrow: 1 } }, /* @__PURE__ */ React18.createElement(ClassManagerSearch, null)), /* @__PURE__ */ React18.createElement(CssClassFilter, null)), /* @__PURE__ */ React18.createElement(ActiveFilters, null)),
|
|
1839
|
+
/* @__PURE__ */ React18.createElement(import_ui15.Divider, null),
|
|
1840
|
+
/* @__PURE__ */ React18.createElement(
|
|
1744
1841
|
import_ui15.Box,
|
|
1745
1842
|
{
|
|
1746
1843
|
px: 2,
|
|
@@ -1749,9 +1846,9 @@ function ClassManagerPanel() {
|
|
|
1749
1846
|
overflowY: "auto"
|
|
1750
1847
|
}
|
|
1751
1848
|
},
|
|
1752
|
-
/* @__PURE__ */
|
|
1849
|
+
/* @__PURE__ */ React18.createElement(GlobalClassesList, { disabled: isPublishing })
|
|
1753
1850
|
)
|
|
1754
|
-
), /* @__PURE__ */
|
|
1851
|
+
), /* @__PURE__ */ React18.createElement(import_editor_panels.PanelFooter, null, /* @__PURE__ */ React18.createElement(
|
|
1755
1852
|
import_ui15.Button,
|
|
1756
1853
|
{
|
|
1757
1854
|
fullWidth: true,
|
|
@@ -1762,19 +1859,19 @@ function ClassManagerPanel() {
|
|
|
1762
1859
|
disabled: !isDirty2,
|
|
1763
1860
|
loading: isPublishing
|
|
1764
1861
|
},
|
|
1765
|
-
(0,
|
|
1766
|
-
))))), /* @__PURE__ */
|
|
1767
|
-
SaveChangesDialog.Actions,
|
|
1862
|
+
(0, import_i18n14.__)("Save changes", "elementor")
|
|
1863
|
+
))))), /* @__PURE__ */ React18.createElement(ClassManagerIntroduction, null), isSaveChangesDialogOpen && /* @__PURE__ */ React18.createElement(import_editor_ui8.SaveChangesDialog, null, /* @__PURE__ */ React18.createElement(import_ui15.DialogHeader, { onClose: closeSaveChangesDialog, logo: false }, /* @__PURE__ */ React18.createElement(import_editor_ui8.SaveChangesDialog.Title, null, (0, import_i18n14.__)("You have unsaved changes", "elementor"))), /* @__PURE__ */ React18.createElement(import_editor_ui8.SaveChangesDialog.Content, null, /* @__PURE__ */ React18.createElement(import_editor_ui8.SaveChangesDialog.ContentText, null, (0, import_i18n14.__)("You have unsaved changes in the Class Manager.", "elementor")), /* @__PURE__ */ React18.createElement(import_editor_ui8.SaveChangesDialog.ContentText, null, (0, import_i18n14.__)("To avoid losing your updates, save your changes before leaving.", "elementor"))), /* @__PURE__ */ React18.createElement(
|
|
1864
|
+
import_editor_ui8.SaveChangesDialog.Actions,
|
|
1768
1865
|
{
|
|
1769
1866
|
actions: {
|
|
1770
1867
|
discard: {
|
|
1771
|
-
label: (0,
|
|
1868
|
+
label: (0, import_i18n14.__)("Discard", "elementor"),
|
|
1772
1869
|
action: () => {
|
|
1773
1870
|
resetAndClosePanel();
|
|
1774
1871
|
}
|
|
1775
1872
|
},
|
|
1776
1873
|
confirm: {
|
|
1777
|
-
label: (0,
|
|
1874
|
+
label: (0, import_i18n14.__)("Save & Continue", "elementor"),
|
|
1778
1875
|
action: async () => {
|
|
1779
1876
|
await publish();
|
|
1780
1877
|
closeSaveChangesDialog();
|
|
@@ -1785,11 +1882,11 @@ function ClassManagerPanel() {
|
|
|
1785
1882
|
}
|
|
1786
1883
|
)));
|
|
1787
1884
|
}
|
|
1788
|
-
var CloseButton = ({ onClose, ...props }) => /* @__PURE__ */
|
|
1789
|
-
var ErrorBoundaryFallback = () => /* @__PURE__ */
|
|
1885
|
+
var CloseButton = ({ onClose, ...props }) => /* @__PURE__ */ React18.createElement(import_ui15.IconButton, { size: "small", color: "secondary", onClick: onClose, "aria-label": "Close", ...props }, /* @__PURE__ */ React18.createElement(import_icons12.XIcon, { fontSize: "small" }));
|
|
1886
|
+
var ErrorBoundaryFallback = () => /* @__PURE__ */ React18.createElement(import_ui15.Box, { role: "alert", sx: { minHeight: "100%", p: 2 } }, /* @__PURE__ */ React18.createElement(import_ui15.Alert, { severity: "error", sx: { mb: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React18.createElement("strong", null, (0, import_i18n14.__)("Something went wrong", "elementor"))));
|
|
1790
1887
|
var usePreventUnload = () => {
|
|
1791
1888
|
const isDirty2 = useDirtyState();
|
|
1792
|
-
(0,
|
|
1889
|
+
(0, import_react8.useEffect)(() => {
|
|
1793
1890
|
const handleBeforeUnload = (event) => {
|
|
1794
1891
|
if (isDirty2) {
|
|
1795
1892
|
event.preventDefault();
|
|
@@ -1815,7 +1912,7 @@ var usePublish = () => {
|
|
|
1815
1912
|
var TotalCssClassCounter = () => {
|
|
1816
1913
|
const filters = useFilters();
|
|
1817
1914
|
const cssClasses = useClassesOrder();
|
|
1818
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1819
1916
|
import_ui15.Chip,
|
|
1820
1917
|
{
|
|
1821
1918
|
size: "small",
|
|
@@ -1829,7 +1926,7 @@ var ClassManagerButton = () => {
|
|
|
1829
1926
|
const document = (0, import_editor_documents5.__useActiveDocument)();
|
|
1830
1927
|
const { open: openPanel } = usePanelActions();
|
|
1831
1928
|
const { save: saveDocument } = (0, import_editor_documents5.__useActiveDocumentActions)();
|
|
1832
|
-
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = useDialog();
|
|
1929
|
+
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = (0, import_editor_ui9.useDialog)();
|
|
1833
1930
|
const { prefetchClassesUsage } = usePrefetchCssClassUsage();
|
|
1834
1931
|
const { userCan } = (0, import_editor_styles_repository3.useUserStylesCapability)();
|
|
1835
1932
|
const isUserAllowedToUpdateClass = userCan(globalClassesStylesProvider.getKey()).update;
|
|
@@ -1844,19 +1941,19 @@ var ClassManagerButton = () => {
|
|
|
1844
1941
|
openPanel();
|
|
1845
1942
|
prefetchClassesUsage();
|
|
1846
1943
|
};
|
|
1847
|
-
return /* @__PURE__ */
|
|
1944
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(import_ui16.Tooltip, { title: (0, import_i18n15.__)("Class Manager", "elementor"), placement: "top" }, /* @__PURE__ */ React19.createElement(import_ui16.IconButton, { size: "tiny", onClick: handleOpenPanel, sx: { marginInlineEnd: -0.75 } }, /* @__PURE__ */ React19.createElement(FlippedColorSwatchIcon, { fontSize: "tiny" }))), isSaveChangesDialogOpen && /* @__PURE__ */ React19.createElement(import_editor_ui9.SaveChangesDialog, null, /* @__PURE__ */ React19.createElement(import_editor_ui9.SaveChangesDialog.Title, null, (0, import_i18n15.__)("You have unsaved changes", "elementor")), /* @__PURE__ */ React19.createElement(import_editor_ui9.SaveChangesDialog.Content, null, /* @__PURE__ */ React19.createElement(import_editor_ui9.SaveChangesDialog.ContentText, { sx: { mb: 2 } }, (0, import_i18n15.__)(
|
|
1848
1945
|
"To open the Class Manager, save your page first. You can't continue without saving.",
|
|
1849
1946
|
"elementor"
|
|
1850
|
-
))), /* @__PURE__ */
|
|
1851
|
-
SaveChangesDialog.Actions,
|
|
1947
|
+
))), /* @__PURE__ */ React19.createElement(
|
|
1948
|
+
import_editor_ui9.SaveChangesDialog.Actions,
|
|
1852
1949
|
{
|
|
1853
1950
|
actions: {
|
|
1854
1951
|
cancel: {
|
|
1855
|
-
label: (0,
|
|
1952
|
+
label: (0, import_i18n15.__)("Stay here", "elementor"),
|
|
1856
1953
|
action: closeSaveChangesDialog
|
|
1857
1954
|
},
|
|
1858
1955
|
confirm: {
|
|
1859
|
-
label: (0,
|
|
1956
|
+
label: (0, import_i18n15.__)("Save & Continue", "elementor"),
|
|
1860
1957
|
action: async () => {
|
|
1861
1958
|
await saveDocument();
|
|
1862
1959
|
closeSaveChangesDialog();
|
|
@@ -1870,11 +1967,11 @@ var ClassManagerButton = () => {
|
|
|
1870
1967
|
};
|
|
1871
1968
|
|
|
1872
1969
|
// src/components/convert-local-class-to-global-class.tsx
|
|
1873
|
-
var
|
|
1970
|
+
var React20 = __toESM(require("react"));
|
|
1874
1971
|
var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
|
|
1875
|
-
var
|
|
1972
|
+
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
1876
1973
|
var import_ui17 = require("@elementor/ui");
|
|
1877
|
-
var
|
|
1974
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1878
1975
|
var ConvertLocalClassToGlobalClass = (props) => {
|
|
1879
1976
|
const localStyleData = props.styleDef;
|
|
1880
1977
|
const handleConversion = () => {
|
|
@@ -1887,8 +1984,8 @@ var ConvertLocalClassToGlobalClass = (props) => {
|
|
|
1887
1984
|
props.successCallback(newId);
|
|
1888
1985
|
}
|
|
1889
1986
|
};
|
|
1890
|
-
return /* @__PURE__ */
|
|
1891
|
-
|
|
1987
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
1988
|
+
import_editor_ui10.MenuListItem,
|
|
1892
1989
|
{
|
|
1893
1990
|
disabled: !props.canConvert,
|
|
1894
1991
|
onClick: handleConversion,
|
|
@@ -1901,8 +1998,8 @@ var ConvertLocalClassToGlobalClass = (props) => {
|
|
|
1901
1998
|
}
|
|
1902
1999
|
}
|
|
1903
2000
|
},
|
|
1904
|
-
(0,
|
|
1905
|
-
), /* @__PURE__ */
|
|
2001
|
+
(0, import_i18n16.__)("Convert to global class", "elementor")
|
|
2002
|
+
), /* @__PURE__ */ React20.createElement(import_ui17.Divider, null));
|
|
1906
2003
|
};
|
|
1907
2004
|
function createClassName(prefix) {
|
|
1908
2005
|
let i = 1;
|
|
@@ -1914,11 +2011,11 @@ function createClassName(prefix) {
|
|
|
1914
2011
|
}
|
|
1915
2012
|
|
|
1916
2013
|
// src/components/populate-store.tsx
|
|
1917
|
-
var
|
|
2014
|
+
var import_react9 = require("react");
|
|
1918
2015
|
var import_store20 = require("@elementor/store");
|
|
1919
2016
|
function PopulateStore() {
|
|
1920
2017
|
const dispatch5 = (0, import_store20.__useDispatch)();
|
|
1921
|
-
(0,
|
|
2018
|
+
(0, import_react9.useEffect)(() => {
|
|
1922
2019
|
Promise.all([apiClient.all("preview"), apiClient.all("frontend")]).then(
|
|
1923
2020
|
([previewRes, frontendRes]) => {
|
|
1924
2021
|
const { data: previewData } = previewRes;
|
|
@@ -1941,14 +2038,18 @@ function PopulateStore() {
|
|
|
1941
2038
|
return null;
|
|
1942
2039
|
}
|
|
1943
2040
|
|
|
2041
|
+
// src/sync-with-document.tsx
|
|
2042
|
+
var import_react10 = require("react");
|
|
2043
|
+
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2044
|
+
|
|
1944
2045
|
// src/sync-with-document-save.ts
|
|
1945
2046
|
var import_editor_current_user2 = require("@elementor/editor-current-user");
|
|
1946
2047
|
var import_editor_documents6 = require("@elementor/editor-documents");
|
|
1947
2048
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
1948
2049
|
var import_store22 = require("@elementor/store");
|
|
1949
|
-
function syncWithDocumentSave() {
|
|
2050
|
+
function syncWithDocumentSave(panelActions) {
|
|
1950
2051
|
const unsubscribe = syncDirtyState();
|
|
1951
|
-
bindSaveAction();
|
|
2052
|
+
bindSaveAction(panelActions);
|
|
1952
2053
|
return unsubscribe;
|
|
1953
2054
|
}
|
|
1954
2055
|
function syncDirtyState() {
|
|
@@ -1959,15 +2060,16 @@ function syncDirtyState() {
|
|
|
1959
2060
|
(0, import_editor_documents6.setDocumentModifiedStatus)(true);
|
|
1960
2061
|
});
|
|
1961
2062
|
}
|
|
1962
|
-
function bindSaveAction() {
|
|
2063
|
+
function bindSaveAction(panelActions) {
|
|
1963
2064
|
(0, import_editor_v1_adapters4.registerDataHook)("after", "document/save/save", (args) => {
|
|
1964
2065
|
const user = (0, import_editor_current_user2.getCurrentUser)();
|
|
1965
2066
|
const canEdit = user?.capabilities.includes(UPDATE_CLASS_CAPABILITY_KEY);
|
|
1966
2067
|
if (!canEdit) {
|
|
1967
2068
|
return;
|
|
1968
2069
|
}
|
|
1969
|
-
|
|
1970
|
-
context: args.status === "publish" ? "frontend" : "preview"
|
|
2070
|
+
saveGlobalClasses({
|
|
2071
|
+
context: args.status === "publish" ? "frontend" : "preview",
|
|
2072
|
+
onApprove: panelActions?.open
|
|
1971
2073
|
});
|
|
1972
2074
|
});
|
|
1973
2075
|
}
|
|
@@ -1975,6 +2077,17 @@ function isDirty() {
|
|
|
1975
2077
|
return selectIsDirty((0, import_store22.__getState)());
|
|
1976
2078
|
}
|
|
1977
2079
|
|
|
2080
|
+
// src/sync-with-document.tsx
|
|
2081
|
+
function SyncWithDocumentSave() {
|
|
2082
|
+
const panelActions = usePanelActions();
|
|
2083
|
+
(0, import_react10.useEffect)(() => {
|
|
2084
|
+
(0, import_editor_v1_adapters5.__privateListenTo)((0, import_editor_v1_adapters5.v1ReadyEvent)(), () => {
|
|
2085
|
+
syncWithDocumentSave(panelActions);
|
|
2086
|
+
});
|
|
2087
|
+
}, []);
|
|
2088
|
+
return null;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
1978
2091
|
// src/init.ts
|
|
1979
2092
|
function init() {
|
|
1980
2093
|
(0, import_store24.__registerSlice)(slice);
|
|
@@ -1984,6 +2097,10 @@ function init() {
|
|
|
1984
2097
|
id: "global-classes-populate-store",
|
|
1985
2098
|
component: PopulateStore
|
|
1986
2099
|
});
|
|
2100
|
+
(0, import_editor.injectIntoLogic)({
|
|
2101
|
+
id: "global-classes-sync-with-document",
|
|
2102
|
+
component: SyncWithDocumentSave
|
|
2103
|
+
});
|
|
1987
2104
|
(0, import_editor_editing_panel.injectIntoCssClassConvert)({
|
|
1988
2105
|
id: "global-classes-convert-from-local-class",
|
|
1989
2106
|
component: ConvertLocalClassToGlobalClass
|
|
@@ -1996,9 +2113,6 @@ function init() {
|
|
|
1996
2113
|
name: "global",
|
|
1997
2114
|
getThemeColor: (theme) => theme.palette.global.dark
|
|
1998
2115
|
});
|
|
1999
|
-
(0, import_editor_v1_adapters5.__privateListenTo)((0, import_editor_v1_adapters5.v1ReadyEvent)(), () => {
|
|
2000
|
-
syncWithDocumentSave();
|
|
2001
|
-
});
|
|
2002
2116
|
}
|
|
2003
2117
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2004
2118
|
0 && (module.exports = {
|