@elementor/editor-global-classes 4.0.0-515 → 4.0.0-516

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.mjs CHANGED
@@ -574,7 +574,7 @@ var PrefetchCssClassUsage = () => {
574
574
  // src/components/class-manager/class-manager-panel.tsx
575
575
  import * as React18 from "react";
576
576
  import { useEffect as useEffect3 } from "react";
577
- import { setDocumentModifiedStatus } from "@elementor/editor-documents";
577
+ import { getCurrentDocument, getV1DocumentsManager, setDocumentModifiedStatus } from "@elementor/editor-documents";
578
578
  import {
579
579
  __createPanel as createPanel,
580
580
  Panel,
@@ -584,7 +584,7 @@ import {
584
584
  PanelHeaderTitle
585
585
  } from "@elementor/editor-panels";
586
586
  import { SaveChangesDialog, ThemeProvider, useDialog } from "@elementor/editor-ui";
587
- import { changeEditMode } from "@elementor/editor-v1-adapters";
587
+ import { __privateRunCommand as runCommand, changeEditMode } from "@elementor/editor-v1-adapters";
588
588
  import { XIcon } from "@elementor/icons";
589
589
  import { useMutation } from "@elementor/query";
590
590
  import { __dispatch as dispatch4 } from "@elementor/store";
@@ -1214,8 +1214,6 @@ var IntroductionContent = () => {
1214
1214
  };
1215
1215
 
1216
1216
  // src/components/class-manager/delete-class.ts
1217
- import { getCurrentDocument, getV1DocumentsManager } from "@elementor/editor-documents";
1218
- import { __privateRunCommand as runCommand } from "@elementor/editor-v1-adapters";
1219
1217
  import { __dispatch as dispatch3 } from "@elementor/store";
1220
1218
  var isDeleted = false;
1221
1219
  var deleteClass = (id2) => {
@@ -1229,20 +1227,9 @@ var deleteClass = (id2) => {
1229
1227
  });
1230
1228
  };
1231
1229
  var onDelete = async () => {
1232
- await reloadDocument();
1233
1230
  isDeleted = false;
1234
1231
  };
1235
1232
  var hasDeletedItems = () => isDeleted;
1236
- var reloadDocument = () => {
1237
- const currentDocument = getCurrentDocument();
1238
- const documentsManager = getV1DocumentsManager();
1239
- documentsManager.invalidateCache();
1240
- return runCommand("editor/documents/switch", {
1241
- id: currentDocument?.id,
1242
- shouldScroll: false,
1243
- shouldNavigateToDefaultRoute: false
1244
- });
1245
- };
1246
1233
 
1247
1234
  // src/components/class-manager/flipped-color-swatch-icon.tsx
1248
1235
  import * as React10 from "react";
@@ -2086,6 +2073,16 @@ function unblockPanelInteractions() {
2086
2073
 
2087
2074
  // src/components/class-manager/class-manager-panel.tsx
2088
2075
  var id = "global-classes-manager";
2076
+ var reloadDocument = () => {
2077
+ const currentDocument = getCurrentDocument();
2078
+ const documentsManager = getV1DocumentsManager();
2079
+ documentsManager.invalidateCache();
2080
+ return runCommand("editor/documents/switch", {
2081
+ id: currentDocument?.id,
2082
+ shouldScroll: false,
2083
+ shouldNavigateToDefaultRoute: false
2084
+ });
2085
+ };
2089
2086
  var { panel, usePanelActions } = createPanel({
2090
2087
  id,
2091
2088
  component: ClassManagerPanel,
@@ -2094,8 +2091,9 @@ var { panel, usePanelActions } = createPanel({
2094
2091
  changeEditMode(id);
2095
2092
  blockPanelInteractions();
2096
2093
  },
2097
- onClose: () => {
2094
+ onClose: async () => {
2098
2095
  changeEditMode("edit");
2096
+ await reloadDocument();
2099
2097
  unblockPanelInteractions();
2100
2098
  },
2101
2099
  isOpenPreviousElement: true