@elementor/editor-global-classes 4.0.0-564 → 4.0.0-591

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 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 React19 = __toESM(require("react"));
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 import_ui16 = require("@elementor/ui");
572
- var import_i18n15 = require("@wordpress/i18n");
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,17 +593,18 @@ var PrefetchCssClassUsage = () => {
593
593
  };
594
594
 
595
595
  // src/components/class-manager/class-manager-panel.tsx
596
- var React18 = __toESM(require("react"));
597
- var import_react8 = require("react");
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");
601
- var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
602
+ 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 import_ui15 = require("@elementor/ui");
606
- var import_i18n14 = require("@wordpress/i18n");
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");
@@ -1247,6 +1248,7 @@ var React15 = __toESM(require("react"));
1247
1248
  var import_react6 = require("react");
1248
1249
  var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
1249
1250
  var import_editor_ui8 = require("@elementor/editor-ui");
1251
+ var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
1250
1252
  var import_icons9 = require("@elementor/icons");
1251
1253
  var import_ui12 = require("@elementor/ui");
1252
1254
  var import_i18n11 = require("@wordpress/i18n");
@@ -1611,7 +1613,9 @@ var ClassItem = ({
1611
1613
  selected,
1612
1614
  disabled,
1613
1615
  sortableTriggerProps,
1614
- showSortIndicator
1616
+ showSortIndicator,
1617
+ syncToV3,
1618
+ onToggleSync
1615
1619
  }) => {
1616
1620
  const itemRef = (0, import_react6.useRef)(null);
1617
1621
  const {
@@ -1700,6 +1704,16 @@ var ClassItem = ({
1700
1704
  },
1701
1705
  /* @__PURE__ */ React15.createElement(import_ui12.Typography, { variant: "caption", sx: { color: "text.primary" } }, (0, import_i18n11.__)("Rename", "elementor"))
1702
1706
  ),
1707
+ (0, import_editor_v1_adapters2.isExperimentActive)("e_design_system_sync") && onToggleSync && /* @__PURE__ */ React15.createElement(
1708
+ import_editor_ui8.MenuListItem,
1709
+ {
1710
+ onClick: () => {
1711
+ popupState.close();
1712
+ onToggleSync(id2, !syncToV3);
1713
+ }
1714
+ },
1715
+ /* @__PURE__ */ React15.createElement(import_ui12.Typography, { variant: "caption", sx: { color: "text.primary" } }, syncToV3 ? (0, import_i18n11.__)("Stop syncing to Version 3", "elementor") : (0, import_i18n11.__)("Sync to Version 3", "elementor"))
1716
+ ),
1703
1717
  /* @__PURE__ */ React15.createElement(
1704
1718
  import_editor_ui8.MenuListItem,
1705
1719
  {
@@ -1880,7 +1894,7 @@ var NotFoundLayout = ({ onClear, searchValue, mainText, sceneryText, icon }) =>
1880
1894
  );
1881
1895
 
1882
1896
  // src/components/class-manager/global-classes-list.tsx
1883
- var GlobalClassesList = ({ disabled }) => {
1897
+ var GlobalClassesList = ({ disabled, onStopSyncRequest, onStartSyncRequest }) => {
1884
1898
  const {
1885
1899
  search: { debouncedValue: searchValue }
1886
1900
  } = useSearchAndFilters();
@@ -1924,27 +1938,27 @@ var GlobalClassesList = ({ disabled }) => {
1924
1938
  onChange: reorderClasses,
1925
1939
  disableDragOverlay: !allowSorting
1926
1940
  },
1927
- filteredCssClasses?.map(({ id: id2, label }) => /* @__PURE__ */ React17.createElement(SortableItem, { key: id2, id: id2 }, ({ isDragged, isDragPlaceholder, triggerProps, triggerStyle }) => {
1941
+ filteredCssClasses?.map((cssClass) => /* @__PURE__ */ React17.createElement(SortableItem, { key: cssClass.id, id: cssClass.id }, ({ isDragged, isDragPlaceholder, triggerProps, triggerStyle }) => {
1928
1942
  if (isDragged && !draggedItemId) {
1929
- setDraggedItemId(id2);
1943
+ setDraggedItemId(cssClass.id);
1930
1944
  }
1931
1945
  return /* @__PURE__ */ React17.createElement(
1932
1946
  ClassItem,
1933
1947
  {
1934
- id: id2,
1935
- label,
1948
+ id: cssClass.id,
1949
+ label: cssClass.label,
1936
1950
  renameClass: (newLabel) => {
1937
1951
  trackGlobalClasses({
1938
1952
  event: "classRenamed",
1939
- classId: id2,
1940
- oldValue: label,
1953
+ classId: cssClass.id,
1954
+ oldValue: cssClass.label,
1941
1955
  newValue: newLabel,
1942
1956
  source: "class-manager"
1943
1957
  });
1944
1958
  dispatch5(
1945
1959
  slice.actions.update({
1946
1960
  style: {
1947
- id: id2,
1961
+ id: cssClass.id,
1948
1962
  label: newLabel
1949
1963
  }
1950
1964
  })
@@ -1956,7 +1970,24 @@ var GlobalClassesList = ({ disabled }) => {
1956
1970
  ...triggerProps,
1957
1971
  style: triggerStyle
1958
1972
  },
1959
- showSortIndicator: allowSorting
1973
+ showSortIndicator: allowSorting,
1974
+ syncToV3: cssClass.sync_to_v3,
1975
+ onToggleSync: (id2, newValue) => {
1976
+ if (!newValue && onStopSyncRequest) {
1977
+ onStopSyncRequest(id2);
1978
+ } else if (newValue && onStartSyncRequest) {
1979
+ onStartSyncRequest(id2);
1980
+ } else {
1981
+ dispatch5(
1982
+ slice.actions.update({
1983
+ style: {
1984
+ id: id2,
1985
+ sync_to_v3: newValue
1986
+ }
1987
+ })
1988
+ );
1989
+ }
1990
+ }
1960
1991
  }
1961
1992
  );
1962
1993
  }))
@@ -2024,13 +2055,47 @@ function unblockPanelInteractions() {
2024
2055
  extendedWindow.$e?.components?.get?.("panel")?.unblockUserInteractions?.();
2025
2056
  }
2026
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
+
2027
2091
  // src/components/class-manager/class-manager-panel.tsx
2092
+ var STOP_SYNC_MESSAGE_KEY = "stop-sync-class";
2028
2093
  var id = "global-classes-manager";
2029
2094
  var reloadDocument = () => {
2030
2095
  const currentDocument = (0, import_editor_documents3.getCurrentDocument)();
2031
2096
  const documentsManager = (0, import_editor_documents3.getV1DocumentsManager)();
2032
2097
  documentsManager.invalidateCache();
2033
- return (0, import_editor_v1_adapters2.__privateRunCommand)("editor/documents/switch", {
2098
+ return (0, import_editor_v1_adapters3.__privateRunCommand)("editor/documents/switch", {
2034
2099
  id: currentDocument?.id,
2035
2100
  shouldScroll: false,
2036
2101
  shouldNavigateToDefaultRoute: false
@@ -2041,11 +2106,11 @@ var { panel, usePanelActions } = (0, import_editor_panels.__createPanel)({
2041
2106
  component: ClassManagerPanel,
2042
2107
  allowedEditModes: ["edit", id],
2043
2108
  onOpen: () => {
2044
- (0, import_editor_v1_adapters2.changeEditMode)(id);
2109
+ (0, import_editor_v1_adapters3.changeEditMode)(id);
2045
2110
  blockPanelInteractions();
2046
2111
  },
2047
2112
  onClose: async () => {
2048
- (0, import_editor_v1_adapters2.changeEditMode)("edit");
2113
+ (0, import_editor_v1_adapters3.changeEditMode)("edit");
2049
2114
  await reloadDocument();
2050
2115
  unblockPanelInteractions();
2051
2116
  },
@@ -2055,13 +2120,48 @@ function ClassManagerPanel() {
2055
2120
  const isDirty2 = useDirtyState();
2056
2121
  const { close: closePanel } = usePanelActions();
2057
2122
  const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = (0, import_editor_ui9.useDialog)();
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);
2058
2126
  const { mutateAsync: publish, isPending: isPublishing } = usePublish();
2059
2127
  const resetAndClosePanel = () => {
2060
2128
  (0, import_store20.__dispatch)(slice.actions.resetToInitialState({ context: "frontend" }));
2061
2129
  closeSaveChangesDialog();
2062
2130
  };
2131
+ const handleStopSync = (0, import_react9.useCallback)((classId) => {
2132
+ (0, import_store20.__dispatch)(
2133
+ slice.actions.update({
2134
+ style: {
2135
+ id: classId,
2136
+ sync_to_v3: false
2137
+ }
2138
+ })
2139
+ );
2140
+ setStopSyncConfirmation(null);
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
+ );
2063
2163
  usePreventUnload();
2064
- return /* @__PURE__ */ React18.createElement(import_editor_ui9.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(
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(
2065
2165
  CloseButton,
2066
2166
  {
2067
2167
  sx: { marginLeft: "auto" },
@@ -2074,7 +2174,7 @@ function ClassManagerPanel() {
2074
2174
  closePanel();
2075
2175
  }
2076
2176
  }
2077
- ))), /* @__PURE__ */ React18.createElement(
2177
+ ))), /* @__PURE__ */ React19.createElement(
2078
2178
  import_editor_panels.PanelBody,
2079
2179
  {
2080
2180
  sx: {
@@ -2083,10 +2183,10 @@ function ClassManagerPanel() {
2083
2183
  height: "100%"
2084
2184
  }
2085
2185
  },
2086
- /* @__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)),
2087
- /* @__PURE__ */ React18.createElement(import_ui15.Divider, null),
2088
- /* @__PURE__ */ React18.createElement(
2089
- import_ui15.Box,
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,
2090
2190
  {
2091
2191
  px: 2,
2092
2192
  sx: {
@@ -2094,10 +2194,17 @@ function ClassManagerPanel() {
2094
2194
  overflowY: "auto"
2095
2195
  }
2096
2196
  },
2097
- /* @__PURE__ */ React18.createElement(GlobalClassesList, { disabled: isPublishing })
2197
+ /* @__PURE__ */ React19.createElement(
2198
+ GlobalClassesList,
2199
+ {
2200
+ disabled: isPublishing,
2201
+ onStopSyncRequest: handleStopSyncRequest,
2202
+ onStartSyncRequest: (classId) => setStartSyncConfirmation(classId)
2203
+ }
2204
+ )
2098
2205
  )
2099
- ), /* @__PURE__ */ React18.createElement(import_editor_panels.PanelFooter, null, /* @__PURE__ */ React18.createElement(
2100
- import_ui15.Button,
2206
+ ), /* @__PURE__ */ React19.createElement(import_editor_panels.PanelFooter, null, /* @__PURE__ */ React19.createElement(
2207
+ import_ui16.Button,
2101
2208
  {
2102
2209
  fullWidth: true,
2103
2210
  size: "small",
@@ -2107,19 +2214,33 @@ function ClassManagerPanel() {
2107
2214
  disabled: !isDirty2,
2108
2215
  loading: isPublishing
2109
2216
  },
2110
- (0, import_i18n14.__)("Save changes", "elementor")
2111
- ))))), /* @__PURE__ */ React18.createElement(ClassManagerIntroduction, null), isSaveChangesDialogOpen && /* @__PURE__ */ React18.createElement(import_editor_ui9.SaveChangesDialog, null, /* @__PURE__ */ React18.createElement(import_ui15.DialogHeader, { onClose: closeSaveChangesDialog, logo: false }, /* @__PURE__ */ React18.createElement(import_editor_ui9.SaveChangesDialog.Title, null, (0, import_i18n14.__)("You have unsaved changes", "elementor"))), /* @__PURE__ */ React18.createElement(import_editor_ui9.SaveChangesDialog.Content, null, /* @__PURE__ */ React18.createElement(import_editor_ui9.SaveChangesDialog.ContentText, null, (0, import_i18n14.__)("You have unsaved changes in the Class Manager.", "elementor")), /* @__PURE__ */ React18.createElement(import_editor_ui9.SaveChangesDialog.ContentText, null, (0, import_i18n14.__)("To avoid losing your updates, save your changes before leaving.", "elementor"))), /* @__PURE__ */ React18.createElement(
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(
2226
+ StopSyncConfirmationDialog,
2227
+ {
2228
+ open: true,
2229
+ onClose: () => setStopSyncConfirmation(null),
2230
+ onConfirm: () => handleStopSync(stopSyncConfirmation)
2231
+ }
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(
2112
2233
  import_editor_ui9.SaveChangesDialog.Actions,
2113
2234
  {
2114
2235
  actions: {
2115
2236
  discard: {
2116
- label: (0, import_i18n14.__)("Discard", "elementor"),
2237
+ label: (0, import_i18n15.__)("Discard", "elementor"),
2117
2238
  action: () => {
2118
2239
  resetAndClosePanel();
2119
2240
  }
2120
2241
  },
2121
2242
  confirm: {
2122
- label: (0, import_i18n14.__)("Save & Continue", "elementor"),
2243
+ label: (0, import_i18n15.__)("Save & Continue", "elementor"),
2123
2244
  action: async () => {
2124
2245
  await publish();
2125
2246
  closeSaveChangesDialog();
@@ -2130,11 +2251,11 @@ function ClassManagerPanel() {
2130
2251
  }
2131
2252
  )));
2132
2253
  }
2133
- var CloseButton = ({ onClose, ...props }) => /* @__PURE__ */ React18.createElement(import_ui15.IconButton, { size: "small", color: "secondary", onClick: onClose, "aria-label": "Close", ...props }, /* @__PURE__ */ React18.createElement(import_icons11.XIcon, { fontSize: "small" }));
2134
- 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"))));
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"))));
2135
2256
  var usePreventUnload = () => {
2136
2257
  const isDirty2 = useDirtyState();
2137
- (0, import_react8.useEffect)(() => {
2258
+ (0, import_react9.useEffect)(() => {
2138
2259
  const handleBeforeUnload = (event) => {
2139
2260
  if (isDirty2) {
2140
2261
  event.preventDefault();
@@ -2160,14 +2281,32 @@ var usePublish = () => {
2160
2281
  var TotalCssClassCounter = () => {
2161
2282
  const filters = useFilters();
2162
2283
  const cssClasses = useClassesOrder();
2163
- return /* @__PURE__ */ React18.createElement(
2164
- import_ui15.Chip,
2284
+ return /* @__PURE__ */ React19.createElement(
2285
+ import_ui16.Chip,
2165
2286
  {
2166
2287
  size: "small",
2167
2288
  label: filters ? `${filters.length} / ${cssClasses?.length}` : cssClasses?.length
2168
2289
  }
2169
2290
  );
2170
2291
  };
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
+ };
2171
2310
 
2172
2311
  // src/components/class-manager/class-manager-button.tsx
2173
2312
  var trackGlobalClassesButton = () => {
@@ -2200,19 +2339,19 @@ var ClassManagerButton = () => {
2200
2339
  });
2201
2340
  prefetchClassesUsage();
2202
2341
  };
2203
- 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_ui10.SaveChangesDialog, null, /* @__PURE__ */ React19.createElement(import_editor_ui10.SaveChangesDialog.Title, null, (0, import_i18n15.__)("You have unsaved changes", "elementor")), /* @__PURE__ */ React19.createElement(import_editor_ui10.SaveChangesDialog.Content, null, /* @__PURE__ */ React19.createElement(import_editor_ui10.SaveChangesDialog.ContentText, { sx: { mb: 2 } }, (0, import_i18n15.__)(
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.__)(
2204
2343
  "To open the Class Manager, save your page first. You can't continue without saving.",
2205
2344
  "elementor"
2206
- ))), /* @__PURE__ */ React19.createElement(
2345
+ ))), /* @__PURE__ */ React20.createElement(
2207
2346
  import_editor_ui10.SaveChangesDialog.Actions,
2208
2347
  {
2209
2348
  actions: {
2210
2349
  cancel: {
2211
- label: (0, import_i18n15.__)("Stay here", "elementor"),
2350
+ label: (0, import_i18n16.__)("Stay here", "elementor"),
2212
2351
  action: closeSaveChangesDialog
2213
2352
  },
2214
2353
  confirm: {
2215
- label: (0, import_i18n15.__)("Save & Continue", "elementor"),
2354
+ label: (0, import_i18n16.__)("Save & Continue", "elementor"),
2216
2355
  action: async () => {
2217
2356
  await saveDocument();
2218
2357
  closeSaveChangesDialog();
@@ -2227,11 +2366,11 @@ var ClassManagerButton = () => {
2227
2366
  };
2228
2367
 
2229
2368
  // src/components/convert-local-class-to-global-class.tsx
2230
- var React20 = __toESM(require("react"));
2369
+ var React21 = __toESM(require("react"));
2231
2370
  var import_editor_styles_repository4 = require("@elementor/editor-styles-repository");
2232
2371
  var import_editor_ui11 = require("@elementor/editor-ui");
2233
- var import_ui17 = require("@elementor/ui");
2234
- var import_i18n16 = require("@wordpress/i18n");
2372
+ var import_ui18 = require("@elementor/ui");
2373
+ var import_i18n17 = require("@wordpress/i18n");
2235
2374
  var ConvertLocalClassToGlobalClass = (props) => {
2236
2375
  const localStyleData = props.styleDef;
2237
2376
  const handleConversion = () => {
@@ -2250,7 +2389,7 @@ var ConvertLocalClassToGlobalClass = (props) => {
2250
2389
  });
2251
2390
  }
2252
2391
  };
2253
- return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
2392
+ return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
2254
2393
  import_editor_ui11.MenuListItem,
2255
2394
  {
2256
2395
  disabled: !props.canConvert,
@@ -2264,8 +2403,8 @@ var ConvertLocalClassToGlobalClass = (props) => {
2264
2403
  }
2265
2404
  }
2266
2405
  },
2267
- (0, import_i18n16.__)("Convert to global class", "elementor")
2268
- ), /* @__PURE__ */ React20.createElement(import_ui17.Divider, null));
2406
+ (0, import_i18n17.__)("Convert to global class", "elementor")
2407
+ ), /* @__PURE__ */ React21.createElement(import_ui18.Divider, null));
2269
2408
  };
2270
2409
  function createClassName(prefix) {
2271
2410
  let i = 1;
@@ -2277,21 +2416,21 @@ function createClassName(prefix) {
2277
2416
  }
2278
2417
 
2279
2418
  // src/components/open-panel-from-url.tsx
2280
- var import_react9 = require("react");
2281
- var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
2419
+ var import_react10 = require("react");
2420
+ var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
2282
2421
  var ACTIVE_PANEL_PARAM = "active-panel";
2283
2422
  var PANEL_ID = "global-classes-manager";
2284
2423
  var DEFAULT_PANEL_ROUTE = "panel/elements";
2285
2424
  function OpenPanelFromUrl() {
2286
2425
  const { open } = usePanelActions();
2287
- const hasOpened = (0, import_react9.useRef)(false);
2288
- (0, import_react9.useEffect)(() => {
2426
+ const hasOpened = (0, import_react10.useRef)(false);
2427
+ (0, import_react10.useEffect)(() => {
2289
2428
  const urlParams = new URLSearchParams(window.location.search);
2290
2429
  const activePanel = urlParams.get(ACTIVE_PANEL_PARAM);
2291
2430
  if (activePanel !== PANEL_ID) {
2292
2431
  return;
2293
2432
  }
2294
- const cleanup = (0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.routeOpenEvent)(DEFAULT_PANEL_ROUTE), () => {
2433
+ const cleanup = (0, import_editor_v1_adapters4.__privateListenTo)((0, import_editor_v1_adapters4.routeOpenEvent)(DEFAULT_PANEL_ROUTE), () => {
2295
2434
  if (hasOpened.current) {
2296
2435
  return;
2297
2436
  }
@@ -2306,11 +2445,11 @@ function OpenPanelFromUrl() {
2306
2445
  }
2307
2446
 
2308
2447
  // src/components/populate-store.tsx
2309
- var import_react10 = require("react");
2448
+ var import_react11 = require("react");
2310
2449
  var import_store22 = require("@elementor/store");
2311
2450
  function PopulateStore() {
2312
2451
  const dispatch5 = (0, import_store22.__useDispatch)();
2313
- (0, import_react10.useEffect)(() => {
2452
+ (0, import_react11.useEffect)(() => {
2314
2453
  Promise.all([apiClient.all("preview"), apiClient.all("frontend")]).then(
2315
2454
  ([previewRes, frontendRes]) => {
2316
2455
  const { data: previewData } = previewRes;
@@ -2775,13 +2914,13 @@ var initMcpIntegration = () => {
2775
2914
  };
2776
2915
 
2777
2916
  // src/sync-with-document.tsx
2778
- var import_react11 = require("react");
2779
- var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
2917
+ var import_react12 = require("react");
2918
+ var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
2780
2919
 
2781
2920
  // src/sync-with-document-save.ts
2782
- var import_editor_current_user2 = require("@elementor/editor-current-user");
2921
+ var import_editor_current_user3 = require("@elementor/editor-current-user");
2783
2922
  var import_editor_documents5 = require("@elementor/editor-documents");
2784
- var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
2923
+ var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
2785
2924
  var import_store24 = require("@elementor/store");
2786
2925
  function syncWithDocumentSave(panelActions) {
2787
2926
  const unsubscribe = syncDirtyState();
@@ -2797,8 +2936,8 @@ function syncDirtyState() {
2797
2936
  });
2798
2937
  }
2799
2938
  function bindSaveAction(panelActions) {
2800
- (0, import_editor_v1_adapters4.registerDataHook)("dependency", "document/save/save", (args) => {
2801
- const user = (0, import_editor_current_user2.getCurrentUser)();
2939
+ (0, import_editor_v1_adapters5.registerDataHook)("dependency", "document/save/save", (args) => {
2940
+ const user = (0, import_editor_current_user3.getCurrentUser)();
2802
2941
  const canEdit = user?.capabilities.includes(UPDATE_CLASS_CAPABILITY_KEY);
2803
2942
  if (!canEdit) {
2804
2943
  return true;
@@ -2817,8 +2956,8 @@ function isDirty() {
2817
2956
  // src/sync-with-document.tsx
2818
2957
  function SyncWithDocumentSave() {
2819
2958
  const panelActions = usePanelActions();
2820
- (0, import_react11.useEffect)(() => {
2821
- (0, import_editor_v1_adapters5.__privateListenTo)((0, import_editor_v1_adapters5.v1ReadyEvent)(), () => {
2959
+ (0, import_react12.useEffect)(() => {
2960
+ (0, import_editor_v1_adapters6.__privateListenTo)((0, import_editor_v1_adapters6.v1ReadyEvent)(), () => {
2822
2961
  syncWithDocumentSave(panelActions);
2823
2962
  });
2824
2963
  }, []);