@babylonjs/node-editor 7.25.2 → 7.26.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -316,8 +316,12 @@ import { CurveBlock } from "@babylonjs/core/Materials/Node/Blocks/curveBlock";
316
316
  import { PrePassTextureBlock } from "@babylonjs/core/Materials/Node/Blocks/Input/prePassTextureBlock";
317
317
  import { NodeMaterialTeleportInBlock } from "@babylonjs/core/Materials/Node/Blocks/Teleport/teleportInBlock";
318
318
  import { NodeMaterialTeleportOutBlock } from "@babylonjs/core/Materials/Node/Blocks/Teleport/teleportOutBlock";
319
+ import { ColorConverterBlock } from "@babylonjs/core/Materials/Node/Blocks/colorConverterBlock";
320
+ import { LoopBlock } from "@babylonjs/core/Materials/Node/Blocks/loopBlock";
321
+ import { StorageReadBlock } from "@babylonjs/core/Materials/Node/Blocks/storageReadBlock";
322
+ import { StorageWriteBlock } from "@babylonjs/core/Materials/Node/Blocks/storageWriteBlock";
319
323
  export class BlockTools {
320
- static GetBlockFromString(data: string, scene: Scene, nodeMaterial: NodeMaterial): NodeMaterialTeleportInBlock | NodeMaterialTeleportOutBlock | HeightToNormalBlock | ElbowBlock | TwirlBlock | VoronoiNoiseBlock | ScreenSpaceBlock | CloudBlock | MatrixBuilderBlock | DesaturateBlock | RefractBlock | ReflectBlock | DerivativeBlock | Rotate2dBlock | NormalBlendBlock | WorleyNoise3DBlock | SimplexPerlin3DBlock | BonesBlock | InstancesBlock | MorphTargetsBlock | DiscardBlock | PrePassTextureBlock | ImageProcessingBlock | ColorMergerBlock | VectorMergerBlock | ColorSplitterBlock | VectorSplitterBlock | TextureBlock | ReflectionTextureBlock | LightBlock | FogBlock | VertexOutputBlock | FragmentOutputBlock | PrePassOutputBlock | AddBlock | ClampBlock | ScaleBlock | CrossBlock | DotBlock | PowBlock | MultiplyBlock | TransformBlock | TrigonometryBlock | RemapBlock | NormalizeBlock | FresnelBlock | LerpBlock | NLerpBlock | DivideBlock | SubtractBlock | ModBlock | StepBlock | SmoothStepBlock | OneMinusBlock | ReciprocalBlock | ViewDirectionBlock | LightInformationBlock | MaxBlock | MinBlock | LengthBlock | DistanceBlock | NegateBlock | PerturbNormalBlock | TBNBlock | RandomNumberBlock | ReplaceColorBlock | PosterizeBlock | ArcTan2Block | GradientBlock | FrontFacingBlock | MeshAttributeExistsBlock | WaveBlock | InputBlock | PBRMetallicRoughnessBlock | SheenBlock | AnisotropyBlock | ReflectionBlock | ClearCoatBlock | RefractionBlock | SubSurfaceBlock | CurrentScreenBlock | ParticleTextureBlock | ParticleRampGradientBlock | ParticleBlendMultiplyBlock | FragCoordBlock | ScreenSizeBlock | SceneDepthBlock | ConditionalBlock | ImageSourceBlock | ClipPlanesBlock | FragDepthBlock | ShadowMapBlock | TriPlanarBlock | MatrixTransposeBlock | MatrixDeterminantBlock | CurveBlock | null;
324
+ static GetBlockFromString(data: string, scene: Scene, nodeMaterial: NodeMaterial): StorageWriteBlock | StorageReadBlock | LoopBlock | ColorConverterBlock | NodeMaterialTeleportInBlock | NodeMaterialTeleportOutBlock | HeightToNormalBlock | ElbowBlock | TwirlBlock | VoronoiNoiseBlock | ScreenSpaceBlock | CloudBlock | MatrixBuilderBlock | DesaturateBlock | RefractBlock | ReflectBlock | DerivativeBlock | Rotate2dBlock | NormalBlendBlock | WorleyNoise3DBlock | SimplexPerlin3DBlock | BonesBlock | InstancesBlock | MorphTargetsBlock | DiscardBlock | PrePassTextureBlock | ImageProcessingBlock | ColorMergerBlock | VectorMergerBlock | ColorSplitterBlock | VectorSplitterBlock | TextureBlock | ReflectionTextureBlock | LightBlock | FogBlock | VertexOutputBlock | FragmentOutputBlock | PrePassOutputBlock | AddBlock | ClampBlock | ScaleBlock | CrossBlock | DotBlock | PowBlock | MultiplyBlock | TransformBlock | TrigonometryBlock | RemapBlock | NormalizeBlock | FresnelBlock | LerpBlock | NLerpBlock | DivideBlock | SubtractBlock | ModBlock | StepBlock | SmoothStepBlock | OneMinusBlock | ReciprocalBlock | ViewDirectionBlock | LightInformationBlock | MaxBlock | MinBlock | LengthBlock | DistanceBlock | NegateBlock | PerturbNormalBlock | TBNBlock | RandomNumberBlock | ReplaceColorBlock | PosterizeBlock | ArcTan2Block | GradientBlock | FrontFacingBlock | MeshAttributeExistsBlock | WaveBlock | InputBlock | PBRMetallicRoughnessBlock | SheenBlock | AnisotropyBlock | ReflectionBlock | ClearCoatBlock | RefractionBlock | SubSurfaceBlock | CurrentScreenBlock | ParticleTextureBlock | ParticleRampGradientBlock | ParticleBlendMultiplyBlock | FragCoordBlock | ScreenSizeBlock | SceneDepthBlock | ConditionalBlock | ImageSourceBlock | ClipPlanesBlock | FragDepthBlock | ShadowMapBlock | TriPlanarBlock | MatrixTransposeBlock | MatrixDeterminantBlock | CurveBlock | null;
321
325
  static GetColorFromConnectionNodeType(type: NodeMaterialBlockConnectionPointTypes): string;
322
326
  static GetConnectionNodeTypeFromString(type: string): NodeMaterialBlockConnectionPointTypes.Float | NodeMaterialBlockConnectionPointTypes.Vector2 | NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4 | NodeMaterialBlockConnectionPointTypes.Matrix | NodeMaterialBlockConnectionPointTypes.AutoDetect;
323
327
  static GetStringFromConnectionNodeType(type: NodeMaterialBlockConnectionPointTypes): "" | "Float" | "Vector2" | "Vector3" | "Vector4" | "Matrix" | "Color3" | "Color4";
@@ -974,6 +978,18 @@ export class MeshAttributeExistsDisplayManager implements IDisplayManager {
974
978
  updatePreviewContent(): void;
975
979
  }
976
980
 
981
+ }
982
+ declare module "@babylonjs/node-editor/graphSystem/display/loopDisplayManager" {
983
+ import { IDisplayManager } from "@babylonjs/node-editor/nodeGraphSystem/interfaces/displayManager";
984
+ import { INodeData } from "@babylonjs/node-editor/nodeGraphSystem/interfaces/nodeData";
985
+ export class LoopDisplayManager implements IDisplayManager {
986
+ getHeaderClass(): string;
987
+ shouldDisplayPortLabels(): boolean;
988
+ getHeaderText(nodeData: INodeData): string;
989
+ getBackgroundColor(): string;
990
+ updatePreviewContent(nodeData: INodeData, contentArea: HTMLDivElement): void;
991
+ }
992
+
977
993
  }
978
994
  declare module "@babylonjs/node-editor/graphSystem/display/inputDisplayManager" {
979
995
  import { NodeMaterialBlockConnectionPointTypes } from "@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes";
@@ -1458,8 +1474,9 @@ import { IDisposable } from "@babylonjs/core/scene";
1458
1474
  * Class handling undo / redo operations
1459
1475
  */
1460
1476
  export class HistoryStack implements IDisposable {
1461
- private _history;
1477
+ private _historyStack;
1462
1478
  private _redoStack;
1479
+ private _activeData;
1463
1480
  private readonly _maxHistoryLength;
1464
1481
  private _locked;
1465
1482
  private _dataProvider;
@@ -1470,13 +1487,19 @@ export class HistoryStack implements IDisposable {
1470
1487
  * @param applyUpdate defines the code to execute when undo/redo operation is required
1471
1488
  */
1472
1489
  constructor(dataProvider: () => any, applyUpdate: (data: any) => void);
1490
+ /**
1491
+ * Process key event to handle undo / redo
1492
+ * @param evt defines the keyboard event to process
1493
+ * @returns true if the event was processed
1494
+ */
1495
+ processKeyEvent(evt: KeyboardEvent): boolean;
1473
1496
  /**
1474
1497
  * Resets the stack
1475
1498
  */
1476
1499
  reset(): void;
1477
1500
  private _generateJSONDiff;
1478
1501
  private _applyJSONDiff;
1479
- private _rebuildState;
1502
+ private _copy;
1480
1503
  /**
1481
1504
  * Stores the current state
1482
1505
  */
@@ -1995,6 +2018,8 @@ export class NodeLink {
1995
2018
  get nodeB(): GraphNode | undefined;
1996
2019
  intersectsWith(rect: DOMRect): boolean;
1997
2020
  update(endX?: number, endY?: number, straight?: boolean): void;
2021
+ get path(): SVGPathElement;
2022
+ get selectionPath(): SVGPathElement;
1998
2023
  constructor(graphCanvas: GraphCanvasComponent, portA: NodePort, nodeA: GraphNode, portB?: NodePort, nodeB?: GraphNode);
1999
2024
  onClick(evt: MouseEvent): void;
2000
2025
  dispose(notify?: boolean): void;
@@ -2075,6 +2100,7 @@ export class GraphNode {
2075
2100
  set enclosingFrameId(value: number);
2076
2101
  set isSelected(value: boolean);
2077
2102
  setIsSelected(value: boolean, marqueeSelection: boolean): void;
2103
+ get rootElement(): HTMLDivElement;
2078
2104
  constructor(content: INodeData, stateManager: StateManager);
2079
2105
  isOverlappingFrame(frame: GraphFrame): boolean;
2080
2106
  getPortForPortData(portData: IPortData): NodePort | null;
@@ -2125,6 +2151,7 @@ export class GraphFrame {
2125
2151
  private _headerTextElement;
2126
2152
  private _headerCollapseElement;
2127
2153
  private _headerCloseElement;
2154
+ private _headerFocusElement;
2128
2155
  private _commentsElement;
2129
2156
  private _portContainer;
2130
2157
  private _outputPortContainer;
@@ -2154,6 +2181,7 @@ export class GraphFrame {
2154
2181
  private readonly _closeSVG;
2155
2182
  private readonly _expandSVG;
2156
2183
  private readonly _collapseSVG;
2184
+ private readonly _focusSVG;
2157
2185
  get id(): number;
2158
2186
  get isCollapsed(): boolean;
2159
2187
  private _createInputPort;
@@ -2182,6 +2210,11 @@ export class GraphFrame {
2182
2210
  get comments(): string;
2183
2211
  set comments(comments: string);
2184
2212
  constructor(candidate: Nullable<HTMLDivElement>, canvas: GraphCanvasComponent, doNotCaptureNodes?: boolean);
2213
+ private _isFocused;
2214
+ /**
2215
+ * Enter/leave focus mode
2216
+ */
2217
+ switchFocusMode(): void;
2185
2218
  refresh(): void;
2186
2219
  addNode(node: GraphNode): void;
2187
2220
  removeNode(node: GraphNode): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/node-editor",
3
- "version": "7.25.2",
3
+ "version": "7.26.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.25.2",
26
+ "@babylonjs/core": "^7.26.1",
27
27
  "react": "^17.0.2",
28
28
  "react-dom": "^17.0.2"
29
29
  },