@orion-studios/payload-studio 0.6.0-beta.136 → 0.6.0-beta.137

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.
@@ -2878,6 +2878,12 @@ function GrapesPageEditor({
2878
2878
  historyRestoreActiveRef.current = true;
2879
2879
  restoreCustomHistoryEntry(customEntry, action === "undo" ? "before" : "after");
2880
2880
  if (action === "undo") {
2881
+ if (!customEntry.before && customEntry.after) {
2882
+ const removedComponent = customEntry.after.component;
2883
+ customUndoStackRef.current = customUndoStackRef.current.filter(
2884
+ (entry) => entry.before?.component !== removedComponent && entry.after?.component !== removedComponent
2885
+ );
2886
+ }
2881
2887
  customRedoStackRef.current.push(customEntry);
2882
2888
  } else {
2883
2889
  customUndoStackRef.current.push(customEntry);
@@ -2754,6 +2754,12 @@ function GrapesPageEditor({
2754
2754
  historyRestoreActiveRef.current = true;
2755
2755
  restoreCustomHistoryEntry(customEntry, action === "undo" ? "before" : "after");
2756
2756
  if (action === "undo") {
2757
+ if (!customEntry.before && customEntry.after) {
2758
+ const removedComponent = customEntry.after.component;
2759
+ customUndoStackRef.current = customUndoStackRef.current.filter(
2760
+ (entry) => entry.before?.component !== removedComponent && entry.after?.component !== removedComponent
2761
+ );
2762
+ }
2757
2763
  customRedoStackRef.current.push(customEntry);
2758
2764
  } else {
2759
2765
  customUndoStackRef.current.push(customEntry);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.136",
3
+ "version": "0.6.0-beta.137",
4
4
  "description": "Base CMS, builder, and custom admin toolkit for Orion Studios websites",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",