babylonjs-node-geometry-editor 7.25.2 → 7.26.1
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.
|
@@ -92,6 +92,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
|
|
|
92
92
|
private _diagramContainerRef;
|
|
93
93
|
private _graphCanvas;
|
|
94
94
|
private _diagramContainer;
|
|
95
|
+
private _historyStack;
|
|
95
96
|
private _startX;
|
|
96
97
|
private _moveInProgress;
|
|
97
98
|
private _leftWidth;
|
|
@@ -104,6 +105,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
|
|
|
104
105
|
private _popUpWindow;
|
|
105
106
|
appendBlock(dataToAppend: NodeGeometryBlock | INodeData, recursion?: boolean): GraphNode;
|
|
106
107
|
addValueNode(type: string): GraphNode;
|
|
108
|
+
prepareHistoryStack(): void;
|
|
107
109
|
componentDidMount(): void;
|
|
108
110
|
componentWillUnmount(): void;
|
|
109
111
|
constructor(props: IGraphEditorProps);
|
|
@@ -155,6 +157,7 @@ export class GlobalState {
|
|
|
155
157
|
stateManager: StateManager;
|
|
156
158
|
onBuiltObservable: Observable<void>;
|
|
157
159
|
onResetRequiredObservable: Observable<boolean>;
|
|
160
|
+
onClearUndoStack: Observable<void>;
|
|
158
161
|
onZoomToFitRequiredObservable: Observable<void>;
|
|
159
162
|
onReOrganizedRequiredObservable: Observable<void>;
|
|
160
163
|
onPreviewModeChanged: Observable<void>;
|
|
@@ -1098,8 +1101,9 @@ import { IDisposable } from "babylonjs/scene";
|
|
|
1098
1101
|
* Class handling undo / redo operations
|
|
1099
1102
|
*/
|
|
1100
1103
|
export class HistoryStack implements IDisposable {
|
|
1101
|
-
private
|
|
1104
|
+
private _historyStack;
|
|
1102
1105
|
private _redoStack;
|
|
1106
|
+
private _activeData;
|
|
1103
1107
|
private readonly _maxHistoryLength;
|
|
1104
1108
|
private _locked;
|
|
1105
1109
|
private _dataProvider;
|
|
@@ -1110,13 +1114,19 @@ export class HistoryStack implements IDisposable {
|
|
|
1110
1114
|
* @param applyUpdate defines the code to execute when undo/redo operation is required
|
|
1111
1115
|
*/
|
|
1112
1116
|
constructor(dataProvider: () => any, applyUpdate: (data: any) => void);
|
|
1117
|
+
/**
|
|
1118
|
+
* Process key event to handle undo / redo
|
|
1119
|
+
* @param evt defines the keyboard event to process
|
|
1120
|
+
* @returns true if the event was processed
|
|
1121
|
+
*/
|
|
1122
|
+
processKeyEvent(evt: KeyboardEvent): boolean;
|
|
1113
1123
|
/**
|
|
1114
1124
|
* Resets the stack
|
|
1115
1125
|
*/
|
|
1116
1126
|
reset(): void;
|
|
1117
1127
|
private _generateJSONDiff;
|
|
1118
1128
|
private _applyJSONDiff;
|
|
1119
|
-
private
|
|
1129
|
+
private _copy;
|
|
1120
1130
|
/**
|
|
1121
1131
|
* Stores the current state
|
|
1122
1132
|
*/
|
|
@@ -1635,6 +1645,8 @@ export class NodeLink {
|
|
|
1635
1645
|
get nodeB(): GraphNode | undefined;
|
|
1636
1646
|
intersectsWith(rect: DOMRect): boolean;
|
|
1637
1647
|
update(endX?: number, endY?: number, straight?: boolean): void;
|
|
1648
|
+
get path(): SVGPathElement;
|
|
1649
|
+
get selectionPath(): SVGPathElement;
|
|
1638
1650
|
constructor(graphCanvas: GraphCanvasComponent, portA: NodePort, nodeA: GraphNode, portB?: NodePort, nodeB?: GraphNode);
|
|
1639
1651
|
onClick(evt: MouseEvent): void;
|
|
1640
1652
|
dispose(notify?: boolean): void;
|
|
@@ -1715,6 +1727,7 @@ export class GraphNode {
|
|
|
1715
1727
|
set enclosingFrameId(value: number);
|
|
1716
1728
|
set isSelected(value: boolean);
|
|
1717
1729
|
setIsSelected(value: boolean, marqueeSelection: boolean): void;
|
|
1730
|
+
get rootElement(): HTMLDivElement;
|
|
1718
1731
|
constructor(content: INodeData, stateManager: StateManager);
|
|
1719
1732
|
isOverlappingFrame(frame: GraphFrame): boolean;
|
|
1720
1733
|
getPortForPortData(portData: IPortData): NodePort | null;
|
|
@@ -1765,6 +1778,7 @@ export class GraphFrame {
|
|
|
1765
1778
|
private _headerTextElement;
|
|
1766
1779
|
private _headerCollapseElement;
|
|
1767
1780
|
private _headerCloseElement;
|
|
1781
|
+
private _headerFocusElement;
|
|
1768
1782
|
private _commentsElement;
|
|
1769
1783
|
private _portContainer;
|
|
1770
1784
|
private _outputPortContainer;
|
|
@@ -1794,6 +1808,7 @@ export class GraphFrame {
|
|
|
1794
1808
|
private readonly _closeSVG;
|
|
1795
1809
|
private readonly _expandSVG;
|
|
1796
1810
|
private readonly _collapseSVG;
|
|
1811
|
+
private readonly _focusSVG;
|
|
1797
1812
|
get id(): number;
|
|
1798
1813
|
get isCollapsed(): boolean;
|
|
1799
1814
|
private _createInputPort;
|
|
@@ -1822,6 +1837,11 @@ export class GraphFrame {
|
|
|
1822
1837
|
get comments(): string;
|
|
1823
1838
|
set comments(comments: string);
|
|
1824
1839
|
constructor(candidate: Nullable<HTMLDivElement>, canvas: GraphCanvasComponent, doNotCaptureNodes?: boolean);
|
|
1840
|
+
private _isFocused;
|
|
1841
|
+
/**
|
|
1842
|
+
* Enter/leave focus mode
|
|
1843
|
+
*/
|
|
1844
|
+
switchFocusMode(): void;
|
|
1825
1845
|
refresh(): void;
|
|
1826
1846
|
addNode(node: GraphNode): void;
|
|
1827
1847
|
removeNode(node: GraphNode): void;
|
|
@@ -4260,6 +4280,7 @@ declare module BABYLON.NodeGeometryEditor {
|
|
|
4260
4280
|
private _diagramContainerRef;
|
|
4261
4281
|
private _graphCanvas;
|
|
4262
4282
|
private _diagramContainer;
|
|
4283
|
+
private _historyStack;
|
|
4263
4284
|
private _startX;
|
|
4264
4285
|
private _moveInProgress;
|
|
4265
4286
|
private _leftWidth;
|
|
@@ -4272,6 +4293,7 @@ declare module BABYLON.NodeGeometryEditor {
|
|
|
4272
4293
|
private _popUpWindow;
|
|
4273
4294
|
appendBlock(dataToAppend: BABYLON.NodeGeometryBlock | BABYLON.NodeGeometryEditor.SharedUIComponents.INodeData, recursion?: boolean): BABYLON.NodeGeometryEditor.SharedUIComponents.GraphNode;
|
|
4274
4295
|
addValueNode(type: string): BABYLON.NodeGeometryEditor.SharedUIComponents.GraphNode;
|
|
4296
|
+
prepareHistoryStack(): void;
|
|
4275
4297
|
componentDidMount(): void;
|
|
4276
4298
|
componentWillUnmount(): void;
|
|
4277
4299
|
constructor(props: IGraphEditorProps);
|
|
@@ -4310,6 +4332,7 @@ declare module BABYLON.NodeGeometryEditor {
|
|
|
4310
4332
|
stateManager: BABYLON.NodeGeometryEditor.SharedUIComponents.StateManager;
|
|
4311
4333
|
onBuiltObservable: BABYLON.Observable<void>;
|
|
4312
4334
|
onResetRequiredObservable: BABYLON.Observable<boolean>;
|
|
4335
|
+
onClearUndoStack: BABYLON.Observable<void>;
|
|
4313
4336
|
onZoomToFitRequiredObservable: BABYLON.Observable<void>;
|
|
4314
4337
|
onReOrganizedRequiredObservable: BABYLON.Observable<void>;
|
|
4315
4338
|
onPreviewModeChanged: BABYLON.Observable<void>;
|
|
@@ -5005,8 +5028,9 @@ declare module BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
5005
5028
|
* Class handling undo / redo operations
|
|
5006
5029
|
*/
|
|
5007
5030
|
export class HistoryStack implements BABYLON.IDisposable {
|
|
5008
|
-
private
|
|
5031
|
+
private _historyStack;
|
|
5009
5032
|
private _redoStack;
|
|
5033
|
+
private _activeData;
|
|
5010
5034
|
private readonly _maxHistoryLength;
|
|
5011
5035
|
private _locked;
|
|
5012
5036
|
private _dataProvider;
|
|
@@ -5017,13 +5041,19 @@ declare module BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
5017
5041
|
* @param applyUpdate defines the code to execute when undo/redo operation is required
|
|
5018
5042
|
*/
|
|
5019
5043
|
constructor(dataProvider: () => any, applyUpdate: (data: any) => void);
|
|
5044
|
+
/**
|
|
5045
|
+
* Process key event to handle undo / redo
|
|
5046
|
+
* @param evt defines the keyboard event to process
|
|
5047
|
+
* @returns true if the event was processed
|
|
5048
|
+
*/
|
|
5049
|
+
processKeyEvent(evt: KeyboardEvent): boolean;
|
|
5020
5050
|
/**
|
|
5021
5051
|
* Resets the stack
|
|
5022
5052
|
*/
|
|
5023
5053
|
reset(): void;
|
|
5024
5054
|
private _generateJSONDiff;
|
|
5025
5055
|
private _applyJSONDiff;
|
|
5026
|
-
private
|
|
5056
|
+
private _copy;
|
|
5027
5057
|
/**
|
|
5028
5058
|
* Stores the current state
|
|
5029
5059
|
*/
|
|
@@ -5558,6 +5588,8 @@ declare module BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
5558
5588
|
get nodeB(): BABYLON.NodeGeometryEditor.SharedUIComponents.GraphNode | undefined;
|
|
5559
5589
|
intersectsWith(rect: DOMRect): boolean;
|
|
5560
5590
|
update(endX?: number, endY?: number, straight?: boolean): void;
|
|
5591
|
+
get path(): SVGPathElement;
|
|
5592
|
+
get selectionPath(): SVGPathElement;
|
|
5561
5593
|
constructor(graphCanvas: BABYLON.NodeGeometryEditor.SharedUIComponents.GraphCanvasComponent, portA: BABYLON.NodeGeometryEditor.SharedUIComponents.NodePort, nodeA: BABYLON.NodeGeometryEditor.SharedUIComponents.GraphNode, portB?: BABYLON.NodeGeometryEditor.SharedUIComponents.NodePort, nodeB?: BABYLON.NodeGeometryEditor.SharedUIComponents.GraphNode);
|
|
5562
5594
|
onClick(evt: MouseEvent): void;
|
|
5563
5595
|
dispose(notify?: boolean): void;
|
|
@@ -5642,6 +5674,7 @@ declare module BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
5642
5674
|
set enclosingFrameId(value: number);
|
|
5643
5675
|
set isSelected(value: boolean);
|
|
5644
5676
|
setIsSelected(value: boolean, marqueeSelection: boolean): void;
|
|
5677
|
+
get rootElement(): HTMLDivElement;
|
|
5645
5678
|
constructor(content: BABYLON.NodeGeometryEditor.SharedUIComponents.INodeData, stateManager: BABYLON.NodeGeometryEditor.SharedUIComponents.StateManager);
|
|
5646
5679
|
isOverlappingFrame(frame: BABYLON.NodeGeometryEditor.SharedUIComponents.GraphFrame): boolean;
|
|
5647
5680
|
getPortForPortData(portData: BABYLON.NodeGeometryEditor.SharedUIComponents.IPortData): BABYLON.NodeGeometryEditor.SharedUIComponents.NodePort | null;
|
|
@@ -5691,6 +5724,7 @@ declare module BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
5691
5724
|
private _headerTextElement;
|
|
5692
5725
|
private _headerCollapseElement;
|
|
5693
5726
|
private _headerCloseElement;
|
|
5727
|
+
private _headerFocusElement;
|
|
5694
5728
|
private _commentsElement;
|
|
5695
5729
|
private _portContainer;
|
|
5696
5730
|
private _outputPortContainer;
|
|
@@ -5720,6 +5754,7 @@ declare module BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
5720
5754
|
private readonly _closeSVG;
|
|
5721
5755
|
private readonly _expandSVG;
|
|
5722
5756
|
private readonly _collapseSVG;
|
|
5757
|
+
private readonly _focusSVG;
|
|
5723
5758
|
get id(): number;
|
|
5724
5759
|
get isCollapsed(): boolean;
|
|
5725
5760
|
private _createInputPort;
|
|
@@ -5748,6 +5783,11 @@ declare module BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
5748
5783
|
get comments(): string;
|
|
5749
5784
|
set comments(comments: string);
|
|
5750
5785
|
constructor(candidate: BABYLON.Nullable<HTMLDivElement>, canvas: BABYLON.NodeGeometryEditor.SharedUIComponents.GraphCanvasComponent, doNotCaptureNodes?: boolean);
|
|
5786
|
+
private _isFocused;
|
|
5787
|
+
/**
|
|
5788
|
+
* Enter/leave focus mode
|
|
5789
|
+
*/
|
|
5790
|
+
switchFocusMode(): void;
|
|
5751
5791
|
refresh(): void;
|
|
5752
5792
|
addNode(node: BABYLON.NodeGeometryEditor.SharedUIComponents.GraphNode): void;
|
|
5753
5793
|
removeNode(node: BABYLON.NodeGeometryEditor.SharedUIComponents.GraphNode): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylonjs-node-geometry-editor",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.26.1",
|
|
4
4
|
"main": "babylon.nodeGeometryEditor.js",
|
|
5
5
|
"types": "babylon.nodeGeometryEditor.module.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"clean": "rimraf dist && rimraf babylon*.* -g"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"babylonjs": "^7.
|
|
17
|
+
"babylonjs": "^7.26.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@dev/build-tools": "1.0.0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react": "^17.0.2",
|
|
27
27
|
"react-contextmenu": "RaananW/react-contextmenu",
|
|
28
28
|
"react-dom": "^17.0.2",
|
|
29
|
-
"sass-loader": "^
|
|
29
|
+
"sass-loader": "^16.0.0",
|
|
30
30
|
"source-map-loader": "^4.0.0",
|
|
31
31
|
"ts-loader": "^9.2.6",
|
|
32
32
|
"webpack": "^5.73.0",
|