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