@babylonjs/node-editor 7.23.1 → 7.25.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,10 +57,57 @@ export class NodeEditor {
57
57
  declare module "@babylonjs/node-editor/index" {
58
58
  export * from "@babylonjs/node-editor/nodeEditor";
59
59
 
60
+ }
61
+ declare module "@babylonjs/node-editor/historyStack" {
62
+ import { GlobalState } from "@babylonjs/node-editor/globalState";
63
+ import { IDisposable } from "@babylonjs/core/scene";
64
+ /**
65
+ * Class handling undo / redo operations
66
+ */
67
+ export class HistoryStack implements IDisposable {
68
+ /**
69
+ * Url to use to load the fflate library (for zip decompression)
70
+ */
71
+ private _onUpdateRequiredObserver;
72
+ private _onClearUndoStackObserver;
73
+ private _onRebuildRequiredObserver;
74
+ private _onNodeMovedObserver;
75
+ private _onNodeAddedObserver;
76
+ private _globalState;
77
+ private _nodeMaterial;
78
+ private _history;
79
+ private _redoStack;
80
+ private readonly _maxHistoryLength;
81
+ private _locked;
82
+ /**
83
+ * Constructor
84
+ * @param globalState defines the hosting global state
85
+ */
86
+ constructor(globalState: GlobalState);
87
+ /**
88
+ * Resets the stack
89
+ */
90
+ reset(): void;
91
+ private _compress;
92
+ private _decompress;
93
+ private _store;
94
+ /**
95
+ * Undo the latest operation
96
+ */
97
+ undo(): void;
98
+ /**
99
+ * Redo the latest undo operation
100
+ */
101
+ redo(): void;
102
+ /**
103
+ * Disposes the stack
104
+ */
105
+ dispose(): void;
106
+ }
107
+
60
108
  }
61
109
  declare module "@babylonjs/node-editor/graphEditor" {
62
110
  import * as React from "react";
63
- import { GlobalState } from "@babylonjs/node-editor/globalState";
64
111
  import { NodeMaterialBlock } from "@babylonjs/core/Materials/Node/nodeMaterialBlock";
65
112
  import { Nullable } from "@babylonjs/core/types";
66
113
  import { IInspectorOptions } from "@babylonjs/core/Debug/debugLayer";
@@ -68,6 +115,7 @@ import "@babylonjs/node-editor/main.scss";
68
115
  import { GraphNode } from "@babylonjs/node-editor/nodeGraphSystem/graphNode";
69
116
  import { IEditorData } from "@babylonjs/node-editor/nodeGraphSystem/interfaces/nodeLocationInfo";
70
117
  import { INodeData } from "@babylonjs/node-editor/nodeGraphSystem/interfaces/nodeData";
118
+ import { GlobalState } from "@babylonjs/node-editor/globalState";
71
119
  interface IGraphEditorProps {
72
120
  globalState: GlobalState;
73
121
  }
@@ -92,6 +140,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
92
140
  private _moveInProgress;
93
141
  private _leftWidth;
94
142
  private _rightWidth;
143
+ private _historyStack;
95
144
  private _previewManager;
96
145
  private _mouseLocationX;
97
146
  private _mouseLocationY;
@@ -151,6 +200,7 @@ export class GlobalState {
151
200
  stateManager: StateManager;
152
201
  onBuiltObservable: Observable<void>;
153
202
  onResetRequiredObservable: Observable<boolean>;
203
+ onClearUndoStack: Observable<void>;
154
204
  onZoomToFitRequiredObservable: Observable<void>;
155
205
  onReOrganizedRequiredObservable: Observable<void>;
156
206
  onLogRequiredObservable: Observable<LogEntry>;
@@ -1812,6 +1862,7 @@ export class StateManager {
1812
1862
  onCandidatePortSelectedObservable: Observable<Nullable<FrameNodePort | NodePort>>;
1813
1863
  onNewNodeCreatedObservable: Observable<GraphNode>;
1814
1864
  onRebuildRequiredObservable: Observable<void>;
1865
+ onNodeMovedObservable: Observable<GraphNode>;
1815
1866
  onErrorMessageDialogRequiredObservable: Observable<string>;
1816
1867
  onExposePortOnFrameObservable: Observable<GraphNode>;
1817
1868
  onGridSizeChanged: Observable<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/node-editor",
3
- "version": "7.23.1",
3
+ "version": "7.25.0",
4
4
  "main": "dist/babylon.nodeEditor.max.js",
5
5
  "module": "dist/babylon.nodeEditor.max.js",
6
6
  "esnext": "dist/babylon.nodeEditor.max.js",
@@ -23,7 +23,7 @@
23
23
  "@types/react-dom": ">=16.0.9"
24
24
  },
25
25
  "devDependencies": {
26
- "@babylonjs/core": "^7.23.1",
26
+ "@babylonjs/core": "^7.25.0",
27
27
  "react": "^17.0.2",
28
28
  "react-dom": "^17.0.2"
29
29
  },