@elementor/editor-global-classes 4.0.0-573 → 4.0.0-597
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 +135 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +131 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/components/class-manager/class-manager-panel.tsx +69 -26
- package/src/components/class-manager/global-classes-list.tsx +4 -1
- package/src/components/class-manager/start-sync-to-v3-modal.tsx +76 -0
package/dist/index.js
CHANGED
|
@@ -564,12 +564,12 @@ var import_editor_styles_repository5 = require("@elementor/editor-styles-reposit
|
|
|
564
564
|
var import_store26 = require("@elementor/store");
|
|
565
565
|
|
|
566
566
|
// src/components/class-manager/class-manager-button.tsx
|
|
567
|
-
var
|
|
567
|
+
var React20 = __toESM(require("react"));
|
|
568
568
|
var import_editor_documents4 = require("@elementor/editor-documents");
|
|
569
569
|
var import_editor_styles_repository3 = require("@elementor/editor-styles-repository");
|
|
570
570
|
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
571
|
-
var
|
|
572
|
-
var
|
|
571
|
+
var import_ui17 = require("@elementor/ui");
|
|
572
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
573
573
|
|
|
574
574
|
// src/hooks/use-prefetch-css-class-usage.ts
|
|
575
575
|
var import_query = require("@elementor/query");
|
|
@@ -593,8 +593,9 @@ var PrefetchCssClassUsage = () => {
|
|
|
593
593
|
};
|
|
594
594
|
|
|
595
595
|
// src/components/class-manager/class-manager-panel.tsx
|
|
596
|
-
var
|
|
597
|
-
var
|
|
596
|
+
var React19 = __toESM(require("react"));
|
|
597
|
+
var import_react9 = require("react");
|
|
598
|
+
var import_editor_current_user2 = require("@elementor/editor-current-user");
|
|
598
599
|
var import_editor_documents3 = require("@elementor/editor-documents");
|
|
599
600
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
600
601
|
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
@@ -602,8 +603,8 @@ var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
|
602
603
|
var import_icons11 = require("@elementor/icons");
|
|
603
604
|
var import_query3 = require("@elementor/query");
|
|
604
605
|
var import_store20 = require("@elementor/store");
|
|
605
|
-
var
|
|
606
|
-
var
|
|
606
|
+
var import_ui16 = require("@elementor/ui");
|
|
607
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
607
608
|
|
|
608
609
|
// src/hooks/use-classes-order.ts
|
|
609
610
|
var import_store6 = require("@elementor/store");
|
|
@@ -1893,7 +1894,7 @@ var NotFoundLayout = ({ onClear, searchValue, mainText, sceneryText, icon }) =>
|
|
|
1893
1894
|
);
|
|
1894
1895
|
|
|
1895
1896
|
// src/components/class-manager/global-classes-list.tsx
|
|
1896
|
-
var GlobalClassesList = ({ disabled, onStopSyncRequest }) => {
|
|
1897
|
+
var GlobalClassesList = ({ disabled, onStopSyncRequest, onStartSyncRequest }) => {
|
|
1897
1898
|
const {
|
|
1898
1899
|
search: { debouncedValue: searchValue }
|
|
1899
1900
|
} = useSearchAndFilters();
|
|
@@ -1974,6 +1975,8 @@ var GlobalClassesList = ({ disabled, onStopSyncRequest }) => {
|
|
|
1974
1975
|
onToggleSync: (id2, newValue) => {
|
|
1975
1976
|
if (!newValue && onStopSyncRequest) {
|
|
1976
1977
|
onStopSyncRequest(id2);
|
|
1978
|
+
} else if (newValue && onStartSyncRequest) {
|
|
1979
|
+
onStartSyncRequest(id2);
|
|
1977
1980
|
} else {
|
|
1978
1981
|
dispatch5(
|
|
1979
1982
|
slice.actions.update({
|
|
@@ -2052,7 +2055,41 @@ function unblockPanelInteractions() {
|
|
|
2052
2055
|
extendedWindow.$e?.components?.get?.("panel")?.unblockUserInteractions?.();
|
|
2053
2056
|
}
|
|
2054
2057
|
|
|
2058
|
+
// src/components/class-manager/start-sync-to-v3-modal.tsx
|
|
2059
|
+
var React18 = __toESM(require("react"));
|
|
2060
|
+
var import_react8 = require("react");
|
|
2061
|
+
var import_ui15 = require("@elementor/ui");
|
|
2062
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
2063
|
+
var IMAGE_URL = "https://assets.elementor.com/packages/v1/images/class-manager-sync-modal.png";
|
|
2064
|
+
var StartSyncToV3Modal = ({ externalOpen, onExternalClose, onConfirm } = {}) => {
|
|
2065
|
+
const [shouldShowAgain, setShouldShowAgain] = (0, import_react8.useState)(true);
|
|
2066
|
+
const handleClose = () => {
|
|
2067
|
+
onExternalClose?.();
|
|
2068
|
+
};
|
|
2069
|
+
const handleConfirm = () => {
|
|
2070
|
+
onConfirm?.();
|
|
2071
|
+
onExternalClose?.();
|
|
2072
|
+
};
|
|
2073
|
+
return /* @__PURE__ */ React18.createElement(import_ui15.Dialog, { open: !!externalOpen, onClose: handleClose, maxWidth: "sm", fullWidth: true }, /* @__PURE__ */ React18.createElement(import_ui15.DialogContent, { sx: { p: 0 } }, /* @__PURE__ */ React18.createElement(import_ui15.Box, { component: "img", src: IMAGE_URL, alt: "", sx: { width: "100%", display: "block" } }), /* @__PURE__ */ React18.createElement(import_ui15.Box, { sx: { px: 3, pt: 4, pb: 1 } }, /* @__PURE__ */ React18.createElement(import_ui15.Typography, { variant: "h6" }, (0, import_i18n14.__)("Sync class to version 3 Global Fonts", "elementor")), /* @__PURE__ */ React18.createElement(import_ui15.Typography, { variant: "body2", color: "secondary", sx: { mb: 2, pt: 1 } }, (0, import_i18n14.__)(
|
|
2074
|
+
"Only typography settings supported in version 3 will be applied, including: font family, responsive font sizes, weight, text transform, decoration, line height, letter spacing, and word spacing. Changes made in the class will automatically apply to version 3.",
|
|
2075
|
+
"elementor"
|
|
2076
|
+
)))), /* @__PURE__ */ React18.createElement(import_ui15.DialogActions, { sx: { justifyContent: "space-between", px: 3, pb: 2 } }, /* @__PURE__ */ React18.createElement(
|
|
2077
|
+
import_ui15.FormControlLabel,
|
|
2078
|
+
{
|
|
2079
|
+
control: /* @__PURE__ */ React18.createElement(
|
|
2080
|
+
import_ui15.Checkbox,
|
|
2081
|
+
{
|
|
2082
|
+
checked: !shouldShowAgain,
|
|
2083
|
+
onChange: (e) => setShouldShowAgain(!e.target.checked)
|
|
2084
|
+
}
|
|
2085
|
+
),
|
|
2086
|
+
label: /* @__PURE__ */ React18.createElement(import_ui15.Typography, { variant: "body2", color: "secondary" }, (0, import_i18n14.__)("Don't show again", "elementor"))
|
|
2087
|
+
}
|
|
2088
|
+
), /* @__PURE__ */ React18.createElement(import_ui15.Box, { sx: { display: "flex", gap: 1 } }, /* @__PURE__ */ React18.createElement(import_ui15.Button, { onClick: handleClose, color: "secondary", size: "small" }, (0, import_i18n14.__)("Cancel", "elementor")), /* @__PURE__ */ React18.createElement(import_ui15.Button, { onClick: handleConfirm, variant: "contained", size: "small" }, (0, import_i18n14.__)("Sync to version 3", "elementor")))));
|
|
2089
|
+
};
|
|
2090
|
+
|
|
2055
2091
|
// src/components/class-manager/class-manager-panel.tsx
|
|
2092
|
+
var STOP_SYNC_MESSAGE_KEY = "stop-sync-class";
|
|
2056
2093
|
var id = "global-classes-manager";
|
|
2057
2094
|
var reloadDocument = () => {
|
|
2058
2095
|
const currentDocument = (0, import_editor_documents3.getCurrentDocument)();
|
|
@@ -2083,13 +2120,15 @@ function ClassManagerPanel() {
|
|
|
2083
2120
|
const isDirty2 = useDirtyState();
|
|
2084
2121
|
const { close: closePanel } = usePanelActions();
|
|
2085
2122
|
const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = (0, import_editor_ui9.useDialog)();
|
|
2086
|
-
const [stopSyncConfirmation, setStopSyncConfirmation] = (0,
|
|
2123
|
+
const [stopSyncConfirmation, setStopSyncConfirmation] = (0, import_react9.useState)(null);
|
|
2124
|
+
const [startSyncConfirmation, setStartSyncConfirmation] = (0, import_react9.useState)(null);
|
|
2125
|
+
const [isStopSyncSuppressed] = (0, import_editor_current_user2.useSuppressedMessage)(STOP_SYNC_MESSAGE_KEY);
|
|
2087
2126
|
const { mutateAsync: publish, isPending: isPublishing } = usePublish();
|
|
2088
2127
|
const resetAndClosePanel = () => {
|
|
2089
2128
|
(0, import_store20.__dispatch)(slice.actions.resetToInitialState({ context: "frontend" }));
|
|
2090
2129
|
closeSaveChangesDialog();
|
|
2091
2130
|
};
|
|
2092
|
-
const handleStopSync = (0,
|
|
2131
|
+
const handleStopSync = (0, import_react9.useCallback)((classId) => {
|
|
2093
2132
|
(0, import_store20.__dispatch)(
|
|
2094
2133
|
slice.actions.update({
|
|
2095
2134
|
style: {
|
|
@@ -2100,8 +2139,29 @@ function ClassManagerPanel() {
|
|
|
2100
2139
|
);
|
|
2101
2140
|
setStopSyncConfirmation(null);
|
|
2102
2141
|
}, []);
|
|
2142
|
+
const handleStartSync = (0, import_react9.useCallback)((classId) => {
|
|
2143
|
+
(0, import_store20.__dispatch)(
|
|
2144
|
+
slice.actions.update({
|
|
2145
|
+
style: {
|
|
2146
|
+
id: classId,
|
|
2147
|
+
sync_to_v3: true
|
|
2148
|
+
}
|
|
2149
|
+
})
|
|
2150
|
+
);
|
|
2151
|
+
setStartSyncConfirmation(null);
|
|
2152
|
+
}, []);
|
|
2153
|
+
const handleStopSyncRequest = (0, import_react9.useCallback)(
|
|
2154
|
+
(classId) => {
|
|
2155
|
+
if (!isStopSyncSuppressed) {
|
|
2156
|
+
setStopSyncConfirmation(classId);
|
|
2157
|
+
} else {
|
|
2158
|
+
handleStopSync(classId);
|
|
2159
|
+
}
|
|
2160
|
+
},
|
|
2161
|
+
[isStopSyncSuppressed, handleStopSync]
|
|
2162
|
+
);
|
|
2103
2163
|
usePreventUnload();
|
|
2104
|
-
return /* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ React19.createElement(import_editor_ui9.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_i18n15.__)("Class Manager", "elementor")), /* @__PURE__ */ React19.createElement(TotalCssClassCounter, null)), /* @__PURE__ */ React19.createElement(
|
|
2105
2165
|
CloseButton,
|
|
2106
2166
|
{
|
|
2107
2167
|
sx: { marginLeft: "auto" },
|
|
@@ -2114,7 +2174,7 @@ function ClassManagerPanel() {
|
|
|
2114
2174
|
closePanel();
|
|
2115
2175
|
}
|
|
2116
2176
|
}
|
|
2117
|
-
))), /* @__PURE__ */
|
|
2177
|
+
))), /* @__PURE__ */ React19.createElement(
|
|
2118
2178
|
import_editor_panels.PanelBody,
|
|
2119
2179
|
{
|
|
2120
2180
|
sx: {
|
|
@@ -2123,10 +2183,10 @@ function ClassManagerPanel() {
|
|
|
2123
2183
|
height: "100%"
|
|
2124
2184
|
}
|
|
2125
2185
|
},
|
|
2126
|
-
/* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
|
|
2186
|
+
/* @__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)),
|
|
2187
|
+
/* @__PURE__ */ React19.createElement(import_ui16.Divider, null),
|
|
2188
|
+
/* @__PURE__ */ React19.createElement(
|
|
2189
|
+
import_ui16.Box,
|
|
2130
2190
|
{
|
|
2131
2191
|
px: 2,
|
|
2132
2192
|
sx: {
|
|
@@ -2134,16 +2194,17 @@ function ClassManagerPanel() {
|
|
|
2134
2194
|
overflowY: "auto"
|
|
2135
2195
|
}
|
|
2136
2196
|
},
|
|
2137
|
-
/* @__PURE__ */
|
|
2197
|
+
/* @__PURE__ */ React19.createElement(
|
|
2138
2198
|
GlobalClassesList,
|
|
2139
2199
|
{
|
|
2140
2200
|
disabled: isPublishing,
|
|
2141
|
-
onStopSyncRequest:
|
|
2201
|
+
onStopSyncRequest: handleStopSyncRequest,
|
|
2202
|
+
onStartSyncRequest: (classId) => setStartSyncConfirmation(classId)
|
|
2142
2203
|
}
|
|
2143
2204
|
)
|
|
2144
2205
|
)
|
|
2145
|
-
), /* @__PURE__ */
|
|
2146
|
-
|
|
2206
|
+
), /* @__PURE__ */ React19.createElement(import_editor_panels.PanelFooter, null, /* @__PURE__ */ React19.createElement(
|
|
2207
|
+
import_ui16.Button,
|
|
2147
2208
|
{
|
|
2148
2209
|
fullWidth: true,
|
|
2149
2210
|
size: "small",
|
|
@@ -2153,26 +2214,33 @@ function ClassManagerPanel() {
|
|
|
2153
2214
|
disabled: !isDirty2,
|
|
2154
2215
|
loading: isPublishing
|
|
2155
2216
|
},
|
|
2156
|
-
(0,
|
|
2157
|
-
))))), /* @__PURE__ */
|
|
2217
|
+
(0, import_i18n15.__)("Save changes", "elementor")
|
|
2218
|
+
))))), /* @__PURE__ */ React19.createElement(ClassManagerIntroduction, null), startSyncConfirmation && /* @__PURE__ */ React19.createElement(
|
|
2219
|
+
StartSyncToV3Modal,
|
|
2220
|
+
{
|
|
2221
|
+
externalOpen: true,
|
|
2222
|
+
onExternalClose: () => setStartSyncConfirmation(null),
|
|
2223
|
+
onConfirm: () => handleStartSync(startSyncConfirmation)
|
|
2224
|
+
}
|
|
2225
|
+
), stopSyncConfirmation && /* @__PURE__ */ React19.createElement(
|
|
2158
2226
|
StopSyncConfirmationDialog,
|
|
2159
2227
|
{
|
|
2160
2228
|
open: true,
|
|
2161
2229
|
onClose: () => setStopSyncConfirmation(null),
|
|
2162
2230
|
onConfirm: () => handleStopSync(stopSyncConfirmation)
|
|
2163
2231
|
}
|
|
2164
|
-
), isSaveChangesDialogOpen && /* @__PURE__ */
|
|
2232
|
+
), isSaveChangesDialogOpen && /* @__PURE__ */ React19.createElement(import_editor_ui9.SaveChangesDialog, null, /* @__PURE__ */ React19.createElement(import_ui16.DialogHeader, { onClose: closeSaveChangesDialog, logo: false }, /* @__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, null, (0, import_i18n15.__)("You have unsaved changes in the Class Manager.", "elementor")), /* @__PURE__ */ React19.createElement(import_editor_ui9.SaveChangesDialog.ContentText, null, (0, import_i18n15.__)("To avoid losing your updates, save your changes before leaving.", "elementor"))), /* @__PURE__ */ React19.createElement(
|
|
2165
2233
|
import_editor_ui9.SaveChangesDialog.Actions,
|
|
2166
2234
|
{
|
|
2167
2235
|
actions: {
|
|
2168
2236
|
discard: {
|
|
2169
|
-
label: (0,
|
|
2237
|
+
label: (0, import_i18n15.__)("Discard", "elementor"),
|
|
2170
2238
|
action: () => {
|
|
2171
2239
|
resetAndClosePanel();
|
|
2172
2240
|
}
|
|
2173
2241
|
},
|
|
2174
2242
|
confirm: {
|
|
2175
|
-
label: (0,
|
|
2243
|
+
label: (0, import_i18n15.__)("Save & Continue", "elementor"),
|
|
2176
2244
|
action: async () => {
|
|
2177
2245
|
await publish();
|
|
2178
2246
|
closeSaveChangesDialog();
|
|
@@ -2183,11 +2251,11 @@ function ClassManagerPanel() {
|
|
|
2183
2251
|
}
|
|
2184
2252
|
)));
|
|
2185
2253
|
}
|
|
2186
|
-
var CloseButton = ({ onClose, ...props }) => /* @__PURE__ */
|
|
2187
|
-
var ErrorBoundaryFallback = () => /* @__PURE__ */
|
|
2254
|
+
var CloseButton = ({ onClose, ...props }) => /* @__PURE__ */ React19.createElement(import_ui16.IconButton, { size: "small", color: "secondary", onClick: onClose, "aria-label": "Close", ...props }, /* @__PURE__ */ React19.createElement(import_icons11.XIcon, { fontSize: "small" }));
|
|
2255
|
+
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_i18n15.__)("Something went wrong", "elementor"))));
|
|
2188
2256
|
var usePreventUnload = () => {
|
|
2189
2257
|
const isDirty2 = useDirtyState();
|
|
2190
|
-
(0,
|
|
2258
|
+
(0, import_react9.useEffect)(() => {
|
|
2191
2259
|
const handleBeforeUnload = (event) => {
|
|
2192
2260
|
if (isDirty2) {
|
|
2193
2261
|
event.preventDefault();
|
|
@@ -2213,27 +2281,32 @@ var usePublish = () => {
|
|
|
2213
2281
|
var TotalCssClassCounter = () => {
|
|
2214
2282
|
const filters = useFilters();
|
|
2215
2283
|
const cssClasses = useClassesOrder();
|
|
2216
|
-
return /* @__PURE__ */
|
|
2217
|
-
|
|
2284
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2285
|
+
import_ui16.Chip,
|
|
2218
2286
|
{
|
|
2219
2287
|
size: "small",
|
|
2220
2288
|
label: filters ? `${filters.length} / ${cssClasses?.length}` : cssClasses?.length
|
|
2221
2289
|
}
|
|
2222
2290
|
);
|
|
2223
2291
|
};
|
|
2224
|
-
var StopSyncConfirmationDialog = ({ open, onClose, onConfirm }) =>
|
|
2225
|
-
|
|
2226
|
-
"elementor"
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2292
|
+
var StopSyncConfirmationDialog = ({ open, onClose, onConfirm }) => {
|
|
2293
|
+
const [, suppressStopSyncMessage] = (0, import_editor_current_user2.useSuppressedMessage)(STOP_SYNC_MESSAGE_KEY);
|
|
2294
|
+
return /* @__PURE__ */ React19.createElement(import_editor_ui9.ConfirmationDialog, { open, onClose }, /* @__PURE__ */ React19.createElement(import_editor_ui9.ConfirmationDialog.Title, { icon: FlippedColorSwatchIcon, iconColor: "primary" }, (0, import_i18n15.__)("Un-sync typography class", "elementor")), /* @__PURE__ */ React19.createElement(import_editor_ui9.ConfirmationDialog.Content, null, /* @__PURE__ */ React19.createElement(import_editor_ui9.ConfirmationDialog.ContentText, null, (0, import_i18n15.__)("You're about to stop syncing a typography class to version 3.", "elementor")), /* @__PURE__ */ React19.createElement(import_editor_ui9.ConfirmationDialog.ContentText, { sx: { mt: 1 } }, (0, import_i18n15.__)(
|
|
2295
|
+
"Note that if it's being used anywhere, the affected elements will inherit the default typography.",
|
|
2296
|
+
"elementor"
|
|
2297
|
+
))), /* @__PURE__ */ React19.createElement(
|
|
2298
|
+
import_editor_ui9.ConfirmationDialog.Actions,
|
|
2299
|
+
{
|
|
2300
|
+
onClose,
|
|
2301
|
+
onConfirm,
|
|
2302
|
+
cancelLabel: (0, import_i18n15.__)("Cancel", "elementor"),
|
|
2303
|
+
confirmLabel: (0, import_i18n15.__)("Got it", "elementor"),
|
|
2304
|
+
color: "primary",
|
|
2305
|
+
onSuppressMessage: suppressStopSyncMessage,
|
|
2306
|
+
suppressLabel: (0, import_i18n15.__)("Don't show again", "elementor")
|
|
2307
|
+
}
|
|
2308
|
+
));
|
|
2309
|
+
};
|
|
2237
2310
|
|
|
2238
2311
|
// src/components/class-manager/class-manager-button.tsx
|
|
2239
2312
|
var trackGlobalClassesButton = () => {
|
|
@@ -2266,19 +2339,19 @@ var ClassManagerButton = () => {
|
|
|
2266
2339
|
});
|
|
2267
2340
|
prefetchClassesUsage();
|
|
2268
2341
|
};
|
|
2269
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(import_ui17.Tooltip, { title: (0, import_i18n16.__)("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(import_editor_ui10.SaveChangesDialog, null, /* @__PURE__ */ React20.createElement(import_editor_ui10.SaveChangesDialog.Title, null, (0, import_i18n16.__)("You have unsaved changes", "elementor")), /* @__PURE__ */ React20.createElement(import_editor_ui10.SaveChangesDialog.Content, null, /* @__PURE__ */ React20.createElement(import_editor_ui10.SaveChangesDialog.ContentText, { sx: { mb: 2 } }, (0, import_i18n16.__)(
|
|
2270
2343
|
"To open the Class Manager, save your page first. You can't continue without saving.",
|
|
2271
2344
|
"elementor"
|
|
2272
|
-
))), /* @__PURE__ */
|
|
2345
|
+
))), /* @__PURE__ */ React20.createElement(
|
|
2273
2346
|
import_editor_ui10.SaveChangesDialog.Actions,
|
|
2274
2347
|
{
|
|
2275
2348
|
actions: {
|
|
2276
2349
|
cancel: {
|
|
2277
|
-
label: (0,
|
|
2350
|
+
label: (0, import_i18n16.__)("Stay here", "elementor"),
|
|
2278
2351
|
action: closeSaveChangesDialog
|
|
2279
2352
|
},
|
|
2280
2353
|
confirm: {
|
|
2281
|
-
label: (0,
|
|
2354
|
+
label: (0, import_i18n16.__)("Save & Continue", "elementor"),
|
|
2282
2355
|
action: async () => {
|
|
2283
2356
|
await saveDocument();
|
|
2284
2357
|
closeSaveChangesDialog();
|
|
@@ -2293,11 +2366,11 @@ var ClassManagerButton = () => {
|
|
|
2293
2366
|
};
|
|
2294
2367
|
|
|
2295
2368
|
// src/components/convert-local-class-to-global-class.tsx
|
|
2296
|
-
var
|
|
2369
|
+
var React21 = __toESM(require("react"));
|
|
2297
2370
|
var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
|
|
2298
2371
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
2299
|
-
var
|
|
2300
|
-
var
|
|
2372
|
+
var import_ui18 = require("@elementor/ui");
|
|
2373
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
2301
2374
|
var ConvertLocalClassToGlobalClass = (props) => {
|
|
2302
2375
|
const localStyleData = props.styleDef;
|
|
2303
2376
|
const handleConversion = () => {
|
|
@@ -2316,7 +2389,7 @@ var ConvertLocalClassToGlobalClass = (props) => {
|
|
|
2316
2389
|
});
|
|
2317
2390
|
}
|
|
2318
2391
|
};
|
|
2319
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
2320
2393
|
import_editor_ui11.MenuListItem,
|
|
2321
2394
|
{
|
|
2322
2395
|
disabled: !props.canConvert,
|
|
@@ -2330,8 +2403,8 @@ var ConvertLocalClassToGlobalClass = (props) => {
|
|
|
2330
2403
|
}
|
|
2331
2404
|
}
|
|
2332
2405
|
},
|
|
2333
|
-
(0,
|
|
2334
|
-
), /* @__PURE__ */
|
|
2406
|
+
(0, import_i18n17.__)("Convert to global class", "elementor")
|
|
2407
|
+
), /* @__PURE__ */ React21.createElement(import_ui18.Divider, null));
|
|
2335
2408
|
};
|
|
2336
2409
|
function createClassName(prefix) {
|
|
2337
2410
|
let i = 1;
|
|
@@ -2343,15 +2416,15 @@ function createClassName(prefix) {
|
|
|
2343
2416
|
}
|
|
2344
2417
|
|
|
2345
2418
|
// src/components/open-panel-from-url.tsx
|
|
2346
|
-
var
|
|
2419
|
+
var import_react10 = require("react");
|
|
2347
2420
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2348
2421
|
var ACTIVE_PANEL_PARAM = "active-panel";
|
|
2349
2422
|
var PANEL_ID = "global-classes-manager";
|
|
2350
2423
|
var DEFAULT_PANEL_ROUTE = "panel/elements";
|
|
2351
2424
|
function OpenPanelFromUrl() {
|
|
2352
2425
|
const { open } = usePanelActions();
|
|
2353
|
-
const hasOpened = (0,
|
|
2354
|
-
(0,
|
|
2426
|
+
const hasOpened = (0, import_react10.useRef)(false);
|
|
2427
|
+
(0, import_react10.useEffect)(() => {
|
|
2355
2428
|
const urlParams = new URLSearchParams(window.location.search);
|
|
2356
2429
|
const activePanel = urlParams.get(ACTIVE_PANEL_PARAM);
|
|
2357
2430
|
if (activePanel !== PANEL_ID) {
|
|
@@ -2372,11 +2445,11 @@ function OpenPanelFromUrl() {
|
|
|
2372
2445
|
}
|
|
2373
2446
|
|
|
2374
2447
|
// src/components/populate-store.tsx
|
|
2375
|
-
var
|
|
2448
|
+
var import_react11 = require("react");
|
|
2376
2449
|
var import_store22 = require("@elementor/store");
|
|
2377
2450
|
function PopulateStore() {
|
|
2378
2451
|
const dispatch5 = (0, import_store22.__useDispatch)();
|
|
2379
|
-
(0,
|
|
2452
|
+
(0, import_react11.useEffect)(() => {
|
|
2380
2453
|
Promise.all([apiClient.all("preview"), apiClient.all("frontend")]).then(
|
|
2381
2454
|
([previewRes, frontendRes]) => {
|
|
2382
2455
|
const { data: previewData } = previewRes;
|
|
@@ -2841,11 +2914,11 @@ var initMcpIntegration = () => {
|
|
|
2841
2914
|
};
|
|
2842
2915
|
|
|
2843
2916
|
// src/sync-with-document.tsx
|
|
2844
|
-
var
|
|
2917
|
+
var import_react12 = require("react");
|
|
2845
2918
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
2846
2919
|
|
|
2847
2920
|
// src/sync-with-document-save.ts
|
|
2848
|
-
var
|
|
2921
|
+
var import_editor_current_user3 = require("@elementor/editor-current-user");
|
|
2849
2922
|
var import_editor_documents5 = require("@elementor/editor-documents");
|
|
2850
2923
|
var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
|
|
2851
2924
|
var import_store24 = require("@elementor/store");
|
|
@@ -2864,7 +2937,7 @@ function syncDirtyState() {
|
|
|
2864
2937
|
}
|
|
2865
2938
|
function bindSaveAction(panelActions) {
|
|
2866
2939
|
(0, import_editor_v1_adapters5.registerDataHook)("dependency", "document/save/save", (args) => {
|
|
2867
|
-
const user = (0,
|
|
2940
|
+
const user = (0, import_editor_current_user3.getCurrentUser)();
|
|
2868
2941
|
const canEdit = user?.capabilities.includes(UPDATE_CLASS_CAPABILITY_KEY);
|
|
2869
2942
|
if (!canEdit) {
|
|
2870
2943
|
return true;
|
|
@@ -2883,7 +2956,7 @@ function isDirty() {
|
|
|
2883
2956
|
// src/sync-with-document.tsx
|
|
2884
2957
|
function SyncWithDocumentSave() {
|
|
2885
2958
|
const panelActions = usePanelActions();
|
|
2886
|
-
(0,
|
|
2959
|
+
(0, import_react12.useEffect)(() => {
|
|
2887
2960
|
(0, import_editor_v1_adapters6.__privateListenTo)((0, import_editor_v1_adapters6.v1ReadyEvent)(), () => {
|
|
2888
2961
|
syncWithDocumentSave(panelActions);
|
|
2889
2962
|
});
|