@elementor/editor-global-classes 3.33.0-118 → 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 +38 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- 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/save-changes-dialog.tsx +0 -92
package/dist/index.js
CHANGED
|
@@ -42,10 +42,11 @@ var import_editor_styles_repository5 = require("@elementor/editor-styles-reposit
|
|
|
42
42
|
var import_store24 = require("@elementor/store");
|
|
43
43
|
|
|
44
44
|
// src/components/class-manager/class-manager-button.tsx
|
|
45
|
-
var
|
|
45
|
+
var React19 = __toESM(require("react"));
|
|
46
46
|
var import_editor_documents5 = require("@elementor/editor-documents");
|
|
47
47
|
var import_editor_styles_repository3 = require("@elementor/editor-styles-repository");
|
|
48
|
-
var
|
|
48
|
+
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
49
|
+
var import_ui16 = require("@elementor/ui");
|
|
49
50
|
var import_i18n15 = require("@wordpress/i18n");
|
|
50
51
|
|
|
51
52
|
// src/global-classes-styles-provider.ts
|
|
@@ -420,16 +421,16 @@ function usePrefetchCssClassUsage() {
|
|
|
420
421
|
}
|
|
421
422
|
|
|
422
423
|
// src/components/class-manager/class-manager-panel.tsx
|
|
423
|
-
var
|
|
424
|
-
var
|
|
424
|
+
var React18 = __toESM(require("react"));
|
|
425
|
+
var import_react8 = require("react");
|
|
425
426
|
var import_editor_documents4 = require("@elementor/editor-documents");
|
|
426
427
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
427
428
|
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
428
429
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
429
|
-
var
|
|
430
|
+
var import_icons12 = require("@elementor/icons");
|
|
430
431
|
var import_query3 = require("@elementor/query");
|
|
431
432
|
var import_store18 = require("@elementor/store");
|
|
432
|
-
var
|
|
433
|
+
var import_ui15 = require("@elementor/ui");
|
|
433
434
|
var import_i18n14 = require("@wordpress/i18n");
|
|
434
435
|
|
|
435
436
|
// src/hooks/use-classes-order.ts
|
|
@@ -1787,37 +1788,6 @@ function unblockPanelInteractions() {
|
|
|
1787
1788
|
extendedWindow.$e?.components?.get?.("panel")?.unblockUserInteractions?.();
|
|
1788
1789
|
}
|
|
1789
1790
|
|
|
1790
|
-
// src/components/class-manager/save-changes-dialog.tsx
|
|
1791
|
-
var React18 = __toESM(require("react"));
|
|
1792
|
-
var import_react8 = require("react");
|
|
1793
|
-
var import_icons12 = require("@elementor/icons");
|
|
1794
|
-
var import_ui15 = require("@elementor/ui");
|
|
1795
|
-
var TITLE_ID2 = "save-changes-dialog";
|
|
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 });
|
|
1800
|
-
var SaveChangesDialogActions = ({ actions }) => {
|
|
1801
|
-
const [isConfirming, setIsConfirming] = (0, import_react8.useState)(false);
|
|
1802
|
-
const { cancel, confirm, discard } = actions;
|
|
1803
|
-
const onConfirm = async () => {
|
|
1804
|
-
setIsConfirming(true);
|
|
1805
|
-
await confirm.action();
|
|
1806
|
-
setIsConfirming(false);
|
|
1807
|
-
};
|
|
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));
|
|
1809
|
-
};
|
|
1810
|
-
SaveChangesDialog.Title = SaveChangesDialogTitle;
|
|
1811
|
-
SaveChangesDialog.Content = SaveChangesDialogContent;
|
|
1812
|
-
SaveChangesDialog.ContentText = SaveChangesDialogContentText;
|
|
1813
|
-
SaveChangesDialog.Actions = SaveChangesDialogActions;
|
|
1814
|
-
var useDialog = () => {
|
|
1815
|
-
const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
|
|
1816
|
-
const open = () => setIsOpen(true);
|
|
1817
|
-
const close = () => setIsOpen(false);
|
|
1818
|
-
return { isOpen, open, close };
|
|
1819
|
-
};
|
|
1820
|
-
|
|
1821
1791
|
// src/components/class-manager/class-manager-panel.tsx
|
|
1822
1792
|
var id = "global-classes-manager";
|
|
1823
1793
|
var { panel, usePanelActions } = (0, import_editor_panels.__createPanel)({
|
|
@@ -1836,14 +1806,14 @@ var { panel, usePanelActions } = (0, import_editor_panels.__createPanel)({
|
|
|
1836
1806
|
function ClassManagerPanel() {
|
|
1837
1807
|
const isDirty2 = useDirtyState();
|
|
1838
1808
|
const { close: closePanel } = usePanelActions();
|
|
1839
|
-
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = useDialog();
|
|
1809
|
+
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = (0, import_editor_ui8.useDialog)();
|
|
1840
1810
|
const { mutateAsync: publish, isPending: isPublishing } = usePublish();
|
|
1841
1811
|
const resetAndClosePanel = () => {
|
|
1842
1812
|
(0, import_store18.__dispatch)(slice.actions.resetToInitialState({ context: "frontend" }));
|
|
1843
1813
|
closeSaveChangesDialog();
|
|
1844
1814
|
};
|
|
1845
1815
|
usePreventUnload();
|
|
1846
|
-
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(
|
|
1847
1817
|
CloseButton,
|
|
1848
1818
|
{
|
|
1849
1819
|
sx: { marginLeft: "auto" },
|
|
@@ -1856,7 +1826,7 @@ function ClassManagerPanel() {
|
|
|
1856
1826
|
closePanel();
|
|
1857
1827
|
}
|
|
1858
1828
|
}
|
|
1859
|
-
))), /* @__PURE__ */
|
|
1829
|
+
))), /* @__PURE__ */ React18.createElement(
|
|
1860
1830
|
import_editor_panels.PanelBody,
|
|
1861
1831
|
{
|
|
1862
1832
|
sx: {
|
|
@@ -1865,10 +1835,10 @@ function ClassManagerPanel() {
|
|
|
1865
1835
|
height: "100%"
|
|
1866
1836
|
}
|
|
1867
1837
|
},
|
|
1868
|
-
/* @__PURE__ */
|
|
1869
|
-
/* @__PURE__ */
|
|
1870
|
-
/* @__PURE__ */
|
|
1871
|
-
|
|
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(
|
|
1841
|
+
import_ui15.Box,
|
|
1872
1842
|
{
|
|
1873
1843
|
px: 2,
|
|
1874
1844
|
sx: {
|
|
@@ -1876,10 +1846,10 @@ function ClassManagerPanel() {
|
|
|
1876
1846
|
overflowY: "auto"
|
|
1877
1847
|
}
|
|
1878
1848
|
},
|
|
1879
|
-
/* @__PURE__ */
|
|
1849
|
+
/* @__PURE__ */ React18.createElement(GlobalClassesList, { disabled: isPublishing })
|
|
1880
1850
|
)
|
|
1881
|
-
), /* @__PURE__ */
|
|
1882
|
-
|
|
1851
|
+
), /* @__PURE__ */ React18.createElement(import_editor_panels.PanelFooter, null, /* @__PURE__ */ React18.createElement(
|
|
1852
|
+
import_ui15.Button,
|
|
1883
1853
|
{
|
|
1884
1854
|
fullWidth: true,
|
|
1885
1855
|
size: "small",
|
|
@@ -1890,8 +1860,8 @@ function ClassManagerPanel() {
|
|
|
1890
1860
|
loading: isPublishing
|
|
1891
1861
|
},
|
|
1892
1862
|
(0, import_i18n14.__)("Save changes", "elementor")
|
|
1893
|
-
))))), /* @__PURE__ */
|
|
1894
|
-
SaveChangesDialog.Actions,
|
|
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,
|
|
1895
1865
|
{
|
|
1896
1866
|
actions: {
|
|
1897
1867
|
discard: {
|
|
@@ -1912,11 +1882,11 @@ function ClassManagerPanel() {
|
|
|
1912
1882
|
}
|
|
1913
1883
|
)));
|
|
1914
1884
|
}
|
|
1915
|
-
var CloseButton = ({ onClose, ...props }) => /* @__PURE__ */
|
|
1916
|
-
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"))));
|
|
1917
1887
|
var usePreventUnload = () => {
|
|
1918
1888
|
const isDirty2 = useDirtyState();
|
|
1919
|
-
(0,
|
|
1889
|
+
(0, import_react8.useEffect)(() => {
|
|
1920
1890
|
const handleBeforeUnload = (event) => {
|
|
1921
1891
|
if (isDirty2) {
|
|
1922
1892
|
event.preventDefault();
|
|
@@ -1942,8 +1912,8 @@ var usePublish = () => {
|
|
|
1942
1912
|
var TotalCssClassCounter = () => {
|
|
1943
1913
|
const filters = useFilters();
|
|
1944
1914
|
const cssClasses = useClassesOrder();
|
|
1945
|
-
return /* @__PURE__ */
|
|
1946
|
-
|
|
1915
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1916
|
+
import_ui15.Chip,
|
|
1947
1917
|
{
|
|
1948
1918
|
size: "small",
|
|
1949
1919
|
label: filters ? `${filters.length} / ${cssClasses?.length}` : cssClasses?.length
|
|
@@ -1956,7 +1926,7 @@ var ClassManagerButton = () => {
|
|
|
1956
1926
|
const document = (0, import_editor_documents5.__useActiveDocument)();
|
|
1957
1927
|
const { open: openPanel } = usePanelActions();
|
|
1958
1928
|
const { save: saveDocument } = (0, import_editor_documents5.__useActiveDocumentActions)();
|
|
1959
|
-
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = useDialog();
|
|
1929
|
+
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = (0, import_editor_ui9.useDialog)();
|
|
1960
1930
|
const { prefetchClassesUsage } = usePrefetchCssClassUsage();
|
|
1961
1931
|
const { userCan } = (0, import_editor_styles_repository3.useUserStylesCapability)();
|
|
1962
1932
|
const isUserAllowedToUpdateClass = userCan(globalClassesStylesProvider.getKey()).update;
|
|
@@ -1971,11 +1941,11 @@ var ClassManagerButton = () => {
|
|
|
1971
1941
|
openPanel();
|
|
1972
1942
|
prefetchClassesUsage();
|
|
1973
1943
|
};
|
|
1974
|
-
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.__)(
|
|
1975
1945
|
"To open the Class Manager, save your page first. You can't continue without saving.",
|
|
1976
1946
|
"elementor"
|
|
1977
|
-
))), /* @__PURE__ */
|
|
1978
|
-
SaveChangesDialog.Actions,
|
|
1947
|
+
))), /* @__PURE__ */ React19.createElement(
|
|
1948
|
+
import_editor_ui9.SaveChangesDialog.Actions,
|
|
1979
1949
|
{
|
|
1980
1950
|
actions: {
|
|
1981
1951
|
cancel: {
|
|
@@ -1997,10 +1967,10 @@ var ClassManagerButton = () => {
|
|
|
1997
1967
|
};
|
|
1998
1968
|
|
|
1999
1969
|
// src/components/convert-local-class-to-global-class.tsx
|
|
2000
|
-
var
|
|
1970
|
+
var React20 = __toESM(require("react"));
|
|
2001
1971
|
var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
|
|
2002
|
-
var
|
|
2003
|
-
var
|
|
1972
|
+
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
1973
|
+
var import_ui17 = require("@elementor/ui");
|
|
2004
1974
|
var import_i18n16 = require("@wordpress/i18n");
|
|
2005
1975
|
var ConvertLocalClassToGlobalClass = (props) => {
|
|
2006
1976
|
const localStyleData = props.styleDef;
|
|
@@ -2014,8 +1984,8 @@ var ConvertLocalClassToGlobalClass = (props) => {
|
|
|
2014
1984
|
props.successCallback(newId);
|
|
2015
1985
|
}
|
|
2016
1986
|
};
|
|
2017
|
-
return /* @__PURE__ */
|
|
2018
|
-
|
|
1987
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
1988
|
+
import_editor_ui10.MenuListItem,
|
|
2019
1989
|
{
|
|
2020
1990
|
disabled: !props.canConvert,
|
|
2021
1991
|
onClick: handleConversion,
|
|
@@ -2029,7 +1999,7 @@ var ConvertLocalClassToGlobalClass = (props) => {
|
|
|
2029
1999
|
}
|
|
2030
2000
|
},
|
|
2031
2001
|
(0, import_i18n16.__)("Convert to global class", "elementor")
|
|
2032
|
-
), /* @__PURE__ */
|
|
2002
|
+
), /* @__PURE__ */ React20.createElement(import_ui17.Divider, null));
|
|
2033
2003
|
};
|
|
2034
2004
|
function createClassName(prefix) {
|
|
2035
2005
|
let i = 1;
|
|
@@ -2041,11 +2011,11 @@ function createClassName(prefix) {
|
|
|
2041
2011
|
}
|
|
2042
2012
|
|
|
2043
2013
|
// src/components/populate-store.tsx
|
|
2044
|
-
var
|
|
2014
|
+
var import_react9 = require("react");
|
|
2045
2015
|
var import_store20 = require("@elementor/store");
|
|
2046
2016
|
function PopulateStore() {
|
|
2047
2017
|
const dispatch5 = (0, import_store20.__useDispatch)();
|
|
2048
|
-
(0,
|
|
2018
|
+
(0, import_react9.useEffect)(() => {
|
|
2049
2019
|
Promise.all([apiClient.all("preview"), apiClient.all("frontend")]).then(
|
|
2050
2020
|
([previewRes, frontendRes]) => {
|
|
2051
2021
|
const { data: previewData } = previewRes;
|
|
@@ -2069,7 +2039,7 @@ function PopulateStore() {
|
|
|
2069
2039
|
}
|
|
2070
2040
|
|
|
2071
2041
|
// src/sync-with-document.tsx
|
|
2072
|
-
var
|
|
2042
|
+
var import_react10 = require("react");
|
|
2073
2043
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2074
2044
|
|
|
2075
2045
|
// src/sync-with-document-save.ts
|
|
@@ -2110,7 +2080,7 @@ function isDirty() {
|
|
|
2110
2080
|
// src/sync-with-document.tsx
|
|
2111
2081
|
function SyncWithDocumentSave() {
|
|
2112
2082
|
const panelActions = usePanelActions();
|
|
2113
|
-
(0,
|
|
2083
|
+
(0, import_react10.useEffect)(() => {
|
|
2114
2084
|
(0, import_editor_v1_adapters5.__privateListenTo)((0, import_editor_v1_adapters5.v1ReadyEvent)(), () => {
|
|
2115
2085
|
syncWithDocumentSave(panelActions);
|
|
2116
2086
|
});
|