@babylonjs/node-editor 7.24.0 → 7.25.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,7 +60,6 @@ export * from "@babylonjs/node-editor/nodeEditor";
60
60
  }
61
61
  declare module "@babylonjs/node-editor/graphEditor" {
62
62
  import * as React from "react";
63
- import { GlobalState } from "@babylonjs/node-editor/globalState";
64
63
  import { NodeMaterialBlock } from "@babylonjs/core/Materials/Node/nodeMaterialBlock";
65
64
  import { Nullable } from "@babylonjs/core/types";
66
65
  import { IInspectorOptions } from "@babylonjs/core/Debug/debugLayer";
@@ -68,6 +67,7 @@ import "@babylonjs/node-editor/main.scss";
68
67
  import { GraphNode } from "@babylonjs/node-editor/nodeGraphSystem/graphNode";
69
68
  import { IEditorData } from "@babylonjs/node-editor/nodeGraphSystem/interfaces/nodeLocationInfo";
70
69
  import { INodeData } from "@babylonjs/node-editor/nodeGraphSystem/interfaces/nodeData";
70
+ import { GlobalState } from "@babylonjs/node-editor/globalState";
71
71
  interface IGraphEditorProps {
72
72
  globalState: GlobalState;
73
73
  }
@@ -92,6 +92,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
92
92
  private _moveInProgress;
93
93
  private _leftWidth;
94
94
  private _rightWidth;
95
+ private _historyStack;
95
96
  private _previewManager;
96
97
  private _mouseLocationX;
97
98
  private _mouseLocationY;
@@ -100,6 +101,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
100
101
  private _popUpWindow;
101
102
  appendBlock(dataToAppend: NodeMaterialBlock | INodeData, recursion?: boolean): GraphNode;
102
103
  addValueNode(type: string): GraphNode;
104
+ prepareHistoryStack(): void;
103
105
  componentDidMount(): void;
104
106
  componentWillUnmount(): void;
105
107
  constructor(props: IGraphEditorProps);
@@ -151,6 +153,7 @@ export class GlobalState {
151
153
  stateManager: StateManager;
152
154
  onBuiltObservable: Observable<void>;
153
155
  onResetRequiredObservable: Observable<boolean>;
156
+ onClearUndoStack: Observable<void>;
154
157
  onZoomToFitRequiredObservable: Observable<void>;
155
158
  onReOrganizedRequiredObservable: Observable<void>;
156
159
  onLogRequiredObservable: Observable<LogEntry>;
@@ -1448,6 +1451,50 @@ export class PropertyChangedEvent {
1448
1451
  allowNullValue?: boolean;
1449
1452
  }
1450
1453
 
1454
+ }
1455
+ declare module "@babylonjs/node-editor/historyStack" {
1456
+ import { IDisposable } from "@babylonjs/core/scene";
1457
+ /**
1458
+ * Class handling undo / redo operations
1459
+ */
1460
+ export class HistoryStack implements IDisposable {
1461
+ private _history;
1462
+ private _redoStack;
1463
+ private readonly _maxHistoryLength;
1464
+ private _locked;
1465
+ private _dataProvider;
1466
+ private _applyUpdate;
1467
+ /**
1468
+ * Constructor
1469
+ * @param dataProvider defines the data provider function
1470
+ * @param applyUpdate defines the code to execute when undo/redo operation is required
1471
+ */
1472
+ constructor(dataProvider: () => any, applyUpdate: (data: any) => void);
1473
+ /**
1474
+ * Resets the stack
1475
+ */
1476
+ reset(): void;
1477
+ private _generateJSONDiff;
1478
+ private _applyJSONDiff;
1479
+ private _rebuildState;
1480
+ /**
1481
+ * Stores the current state
1482
+ */
1483
+ store(): void;
1484
+ /**
1485
+ * Undo the latest operation
1486
+ */
1487
+ undo(): void;
1488
+ /**
1489
+ * Redo the latest undo operation
1490
+ */
1491
+ redo(): void;
1492
+ /**
1493
+ * Disposes the stack
1494
+ */
1495
+ dispose(): void;
1496
+ }
1497
+
1451
1498
  }
1452
1499
  declare module "@babylonjs/node-editor/copyCommandToClipboard" {
1453
1500
  export function copyCommandToClipboard(strCommand: string): void;
@@ -1812,6 +1859,7 @@ export class StateManager {
1812
1859
  onCandidatePortSelectedObservable: Observable<Nullable<FrameNodePort | NodePort>>;
1813
1860
  onNewNodeCreatedObservable: Observable<GraphNode>;
1814
1861
  onRebuildRequiredObservable: Observable<void>;
1862
+ onNodeMovedObservable: Observable<GraphNode>;
1815
1863
  onErrorMessageDialogRequiredObservable: Observable<string>;
1816
1864
  onExposePortOnFrameObservable: Observable<GraphNode>;
1817
1865
  onGridSizeChanged: Observable<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/node-editor",
3
- "version": "7.24.0",
3
+ "version": "7.25.1",
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.24.0",
26
+ "@babylonjs/core": "^7.25.1",
27
27
  "react": "^17.0.2",
28
28
  "react-dom": "^17.0.2"
29
29
  },