@babylonjs/core 6.30.0 → 6.32.0

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.
Files changed (227) hide show
  1. package/Actions/action.js.map +1 -1
  2. package/Animations/animation.d.ts +8 -2
  3. package/Animations/animation.js +21 -13
  4. package/Animations/animation.js.map +1 -1
  5. package/Animations/runtimeAnimation.js +6 -15
  6. package/Animations/runtimeAnimation.js.map +1 -1
  7. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
  8. package/Cameras/camera.js +1 -1
  9. package/Cameras/camera.js.map +1 -1
  10. package/Culling/ray.js +24 -24
  11. package/Culling/ray.js.map +1 -1
  12. package/Debug/skeletonViewer.d.ts +2 -2
  13. package/Debug/skeletonViewer.js +38 -12
  14. package/Debug/skeletonViewer.js.map +1 -1
  15. package/DeviceInput/InputDevices/deviceSource.js.map +1 -1
  16. package/DeviceInput/InputDevices/deviceTypes.js.map +1 -1
  17. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  18. package/Engines/Extensions/engine.views.d.ts +8 -5
  19. package/Engines/Extensions/engine.views.js +14 -8
  20. package/Engines/Extensions/engine.views.js.map +1 -1
  21. package/Engines/Processors/shaderCodeNode.js.map +1 -1
  22. package/Engines/WebGPU/Extensions/engine.multiRender.js +6 -3
  23. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  24. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  25. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  26. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  27. package/Engines/engine.d.ts +16 -1
  28. package/Engines/engine.js +1 -1
  29. package/Engines/engine.js.map +1 -1
  30. package/Engines/thinEngine.js +2 -2
  31. package/Engines/thinEngine.js.map +1 -1
  32. package/Engines/webgpuEngine.js.map +1 -1
  33. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +12 -12
  34. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +1 -1
  35. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +4 -4
  36. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +1 -1
  37. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +9 -9
  38. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +1 -1
  39. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +11 -11
  40. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +1 -1
  41. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +10 -10
  42. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +1 -1
  43. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +2 -2
  44. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  45. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +1 -1
  46. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  47. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +4 -4
  48. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
  49. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +1 -1
  50. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
  51. package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js +4 -4
  52. package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
  53. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +2 -2
  54. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  55. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
  56. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
  57. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +4 -4
  58. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +16 -6
  59. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
  60. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +1 -0
  61. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +5 -1
  62. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  63. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +1 -1
  64. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  65. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +17 -6
  66. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +16 -9
  67. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  68. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +1 -1
  69. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  70. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +1 -1
  71. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
  72. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +1 -1
  73. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
  74. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +1 -1
  75. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
  76. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +1 -1
  77. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  78. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -2
  79. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  80. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +2 -2
  81. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  82. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +1 -1
  83. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
  84. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +4 -4
  85. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  86. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +1 -0
  87. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +8 -1
  88. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
  89. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +1 -0
  90. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +5 -1
  91. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
  92. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +2 -2
  93. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  94. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +1 -1
  95. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
  96. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +1 -0
  97. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -0
  98. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  99. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +1 -0
  100. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -1
  101. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  102. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +1 -1
  103. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
  104. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +2 -2
  105. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
  106. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +8 -12
  107. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +9 -19
  108. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  109. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +2 -2
  110. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  111. package/FlowGraph/flowGraphBlock.d.ts +2 -2
  112. package/FlowGraph/flowGraphBlock.js +20 -4
  113. package/FlowGraph/flowGraphBlock.js.map +1 -1
  114. package/FlowGraph/flowGraphContext.d.ts +4 -4
  115. package/FlowGraph/flowGraphContext.js +22 -40
  116. package/FlowGraph/flowGraphContext.js.map +1 -1
  117. package/FlowGraph/flowGraphPath.d.ts +27 -0
  118. package/FlowGraph/flowGraphPath.js +136 -0
  119. package/FlowGraph/flowGraphPath.js.map +1 -0
  120. package/FlowGraph/flowGraphPathComponent.d.ts +42 -0
  121. package/FlowGraph/flowGraphPathComponent.js +51 -0
  122. package/FlowGraph/flowGraphPathComponent.js.map +1 -0
  123. package/FlowGraph/index.d.ts +1 -0
  124. package/FlowGraph/index.js +1 -0
  125. package/FlowGraph/index.js.map +1 -1
  126. package/Gizmos/axisDragGizmo.d.ts +4 -2
  127. package/Gizmos/axisDragGizmo.js +18 -6
  128. package/Gizmos/axisDragGizmo.js.map +1 -1
  129. package/Gizmos/axisScaleGizmo.d.ts +2 -2
  130. package/Gizmos/axisScaleGizmo.js +1 -1
  131. package/Gizmos/axisScaleGizmo.js.map +1 -1
  132. package/Gizmos/planeDragGizmo.d.ts +4 -4
  133. package/Gizmos/planeDragGizmo.js +1 -1
  134. package/Gizmos/planeDragGizmo.js.map +1 -1
  135. package/Gizmos/planeRotationGizmo.d.ts +13 -7
  136. package/Gizmos/planeRotationGizmo.js +26 -10
  137. package/Gizmos/planeRotationGizmo.js.map +1 -1
  138. package/Lights/Shadows/shadowGenerator.d.ts +8 -0
  139. package/Lights/Shadows/shadowGenerator.js +12 -0
  140. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  141. package/Loading/sceneLoader.js.map +1 -1
  142. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  143. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  144. package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +6 -0
  145. package/Materials/Node/Blocks/Teleport/teleportInBlock.js +22 -0
  146. package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  147. package/Materials/Node/Blocks/modBlock.js +1 -0
  148. package/Materials/Node/Blocks/modBlock.js.map +1 -1
  149. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +1 -1
  150. package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
  151. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  152. package/Materials/Textures/multiRenderTarget.d.ts +14 -10
  153. package/Materials/Textures/multiRenderTarget.js +7 -5
  154. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  155. package/Materials/imageProcessingConfiguration.d.ts +2 -2
  156. package/Materials/imageProcessingConfiguration.js +2 -2
  157. package/Materials/imageProcessingConfiguration.js.map +1 -1
  158. package/Maths/math.size.d.ts +6 -0
  159. package/Maths/math.size.js +8 -0
  160. package/Maths/math.size.js.map +1 -1
  161. package/Maths/math.vector.d.ts +5 -5
  162. package/Maths/math.vector.js +6 -5
  163. package/Maths/math.vector.js.map +1 -1
  164. package/Meshes/Builders/linesBuilder.js +4 -2
  165. package/Meshes/Builders/linesBuilder.js.map +1 -1
  166. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +1 -1
  167. package/Meshes/GreasedLine/greasedLineBaseMesh.js +1 -1
  168. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  169. package/Meshes/geometry.d.ts +8 -0
  170. package/Meshes/geometry.js +20 -1
  171. package/Meshes/geometry.js.map +1 -1
  172. package/Meshes/groundMesh.js +1 -1
  173. package/Meshes/groundMesh.js.map +1 -1
  174. package/Meshes/mesh.d.ts +8 -0
  175. package/Meshes/mesh.js +14 -2
  176. package/Meshes/mesh.js.map +1 -1
  177. package/Meshes/mesh.vertexData.js.map +1 -1
  178. package/Misc/dds.js.map +1 -1
  179. package/Misc/greasedLineTools.js.map +1 -1
  180. package/Misc/tools.js.map +1 -1
  181. package/Physics/physicsHelper.d.ts +1 -1
  182. package/Physics/physicsHelper.js +1 -1
  183. package/Physics/physicsHelper.js.map +1 -1
  184. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.d.ts +1 -1
  185. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +1 -1
  186. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  187. package/PostProcesses/bloomEffect.d.ts +1 -1
  188. package/PostProcesses/bloomEffect.js +1 -1
  189. package/PostProcesses/bloomEffect.js.map +1 -1
  190. package/PostProcesses/postProcess.d.ts +10 -2
  191. package/PostProcesses/postProcess.js +17 -7
  192. package/PostProcesses/postProcess.js.map +1 -1
  193. package/Rendering/depthPeelingRenderer.d.ts +5 -0
  194. package/Rendering/depthPeelingRenderer.js +33 -9
  195. package/Rendering/depthPeelingRenderer.js.map +1 -1
  196. package/Rendering/depthRenderer.js +9 -0
  197. package/Rendering/depthRenderer.js.map +1 -1
  198. package/Rendering/geometryBufferRenderer.d.ts +6 -3
  199. package/Rendering/geometryBufferRenderer.js +28 -10
  200. package/Rendering/geometryBufferRenderer.js.map +1 -1
  201. package/Rendering/geometryBufferRendererSceneComponent.d.ts +5 -2
  202. package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
  203. package/Shaders/ShadersInclude/bonesDeclaration.js +1 -1
  204. package/Shaders/ShadersInclude/bonesDeclaration.js.map +1 -1
  205. package/Shaders/depth.vertex.d.ts +2 -0
  206. package/Shaders/depth.vertex.js +4 -0
  207. package/Shaders/depth.vertex.js.map +1 -1
  208. package/XR/features/WebXRAbstractFeature.d.ts +10 -1
  209. package/XR/features/WebXRAbstractFeature.js +13 -0
  210. package/XR/features/WebXRAbstractFeature.js.map +1 -1
  211. package/XR/features/WebXRLightEstimation.d.ts +5 -0
  212. package/XR/features/WebXRLightEstimation.js +14 -2
  213. package/XR/features/WebXRLightEstimation.js.map +1 -1
  214. package/XR/features/WebXRRawCameraAccess.d.ts +81 -0
  215. package/XR/features/WebXRRawCameraAccess.js +169 -0
  216. package/XR/features/WebXRRawCameraAccess.js.map +1 -0
  217. package/XR/features/index.d.ts +1 -0
  218. package/XR/features/index.js +1 -0
  219. package/XR/features/index.js.map +1 -1
  220. package/XR/webXRFeaturesManager.d.ts +13 -0
  221. package/XR/webXRFeaturesManager.js +4 -0
  222. package/XR/webXRFeaturesManager.js.map +1 -1
  223. package/package.json +1 -1
  224. package/scene.d.ts +1 -1
  225. package/scene.js +11 -6
  226. package/scene.js.map +1 -1
  227. package/types.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY3D;;;GAGG;AACH,MAAM,OAAO,q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OAAyB,EAAE,aAAwC;QAC/E,MAAM,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,EAAE;YAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;gBACnD,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC9B;SACJ;aAAM,IAAI,aAAa,KAAK,IAAI,CAAC,OAAO,EAAE;YACvC,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;SAC7B;aAAM;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YAClD,IAAI,KAAK,IAAI,CAAC,EAAE;gBACZ,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;aACrC;SACJ;QAED,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;QAEhF,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE;YAClD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;gBACnD,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC9B;SACJ;IACL,CAAC;IAEM,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for the wait all block.\r\n */\r\nexport interface IFlowGraphWaitAllBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The number of input flows. There will always be at least one input flow.\r\n */\r\n numberInputFlows: number;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that waits for all input flows to be activated before activating its output flow.\r\n */\r\nexport class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: Resets the block.\r\n */\r\n public reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The 2nd to nth input flows (the first is named onStart)\r\n */\r\n public readonly inFlows: FlowGraphSignalConnection[] = [];\r\n private _cachedActivationState: boolean[] = [];\r\n\r\n constructor(public config: IFlowGraphWaitAllBlockConfiguration) {\r\n super(config);\r\n\r\n this.reset = this._registerSignalInput(\"reset\");\r\n }\r\n\r\n configure(): void {\r\n // The first inFlow is the default input signal all execution blocks have\r\n for (let i = 1; i < this.config.numberInputFlows; i++) {\r\n this.inFlows.push(this._registerSignalInput(`in${i}`));\r\n }\r\n }\r\n\r\n private _getCurrentActivationState(context: FlowGraphContext) {\r\n const activationState = this._cachedActivationState;\r\n activationState.length = 0;\r\n if (!context._hasExecutionVariable(this, \"activationState\")) {\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState.push(false);\r\n }\r\n } else {\r\n const contextActivationState = context._getExecutionVariable(this, \"activationState\");\r\n for (let i = 0; i < contextActivationState.length; i++) {\r\n activationState.push(contextActivationState[i]);\r\n }\r\n }\r\n return activationState;\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const activationState = this._getCurrentActivationState(context);\r\n if (callingSignal === this.reset) {\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n } else if (callingSignal === this.onStart) {\r\n activationState[0] = true;\r\n } else {\r\n const index = this.inFlows.indexOf(callingSignal);\r\n if (index >= 0) {\r\n activationState[index + 1] = true;\r\n }\r\n }\r\n\r\n context._setExecutionVariable(this, \"activationState\", activationState.slice());\r\n\r\n if (activationState.every((value: boolean) => value)) {\r\n this.onDone._activateSignal(context);\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGWaitAllBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGWaitAllBlock\", FlowGraphWaitAllBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iCAAiC;IAWxE,YAAmB,MAA2C;QAC1D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAqC;QAN9D;;WAEG;QACa,YAAO,GAAgC,EAAE,CAAC;QAClD,2BAAsB,GAAc,EAAE,CAAC;QAK3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,SAAS;QACL,yEAAyE;QACzE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;YACnD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC,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,IAAI,KAAK,IAAI,CAAC,EAAE;gBACZ,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;aACrC;SACJ;QAED,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;QAEhF,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE;YAClD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;gBACnD,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC9B;SACJ;IACL,CAAC;IAEM,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAEM,SAAS,CAAC,mBAAyB;QACtC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAC/E,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for the wait all block.\r\n */\r\nexport interface IFlowGraphWaitAllBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The number of input flows. There will always be at least one input flow.\r\n */\r\n numberInputFlows: number;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that waits for all input flows to be activated before activating its output flow.\r\n */\r\nexport class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: Resets the block.\r\n */\r\n public reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The 2nd to nth input flows (the first is named onStart)\r\n */\r\n public readonly inFlows: FlowGraphSignalConnection[] = [];\r\n private _cachedActivationState: boolean[] = [];\r\n\r\n constructor(public config: IFlowGraphWaitAllBlockConfiguration) {\r\n super(config);\r\n\r\n this.reset = this._registerSignalInput(\"reset\");\r\n }\r\n\r\n configure(): void {\r\n // The first inFlow is the default input signal all execution blocks have\r\n for (let i = 1; i < this.config.numberInputFlows; i++) {\r\n this.inFlows.push(this._registerSignalInput(`in${i}`));\r\n }\r\n }\r\n\r\n private _getCurrentActivationState(context: FlowGraphContext) {\r\n const activationState = this._cachedActivationState;\r\n activationState.length = 0;\r\n if (!context._hasExecutionVariable(this, \"activationState\")) {\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState.push(false);\r\n }\r\n } else {\r\n const contextActivationState = context._getExecutionVariable(this, \"activationState\");\r\n for (let i = 0; i < contextActivationState.length; i++) {\r\n activationState.push(contextActivationState[i]);\r\n }\r\n }\r\n return activationState;\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const activationState = this._getCurrentActivationState(context);\r\n if (callingSignal === this.reset) {\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n } else if (callingSignal === this.onStart) {\r\n activationState[0] = true;\r\n } else {\r\n const index = this.inFlows.indexOf(callingSignal);\r\n if (index >= 0) {\r\n activationState[index + 1] = true;\r\n }\r\n }\r\n\r\n context._setExecutionVariable(this, \"activationState\", activationState.slice());\r\n\r\n if (activationState.every((value: boolean) => value)) {\r\n this.onDone._activateSignal(context);\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGWaitAllBlock\";\r\n }\r\n\r\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.config.numberInputFlows = this.config.numberInputFlows;\r\n }\r\n}\r\nRegisterClass(\"FGWaitAllBlock\", FlowGraphWaitAllBlock);\r\n"]}
@@ -30,4 +30,5 @@ export declare class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutio
30
30
  constructor(config?: IFlowGraphWhileLoopBlockConfiguration | undefined);
31
31
  _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
32
32
  getClassName(): string;
33
+ serialize(serializationObject?: any): void;
33
34
  }
@@ -9,7 +9,7 @@ export class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
9
9
  constructor(config) {
10
10
  super(config);
11
11
  this.config = config;
12
- this.condition = this._registerDataInput("condition", RichTypeBoolean);
12
+ this.condition = this.registerDataInput("condition", RichTypeBoolean);
13
13
  this.loopBody = this._registerSignalOutput("loopBody");
14
14
  }
15
15
  _execute(context, _callingSignal) {
@@ -27,6 +27,11 @@ export class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
27
27
  getClassName() {
28
28
  return "FGWhileLoopBlock";
29
29
  }
30
+ serialize(serializationObject) {
31
+ var _a;
32
+ super.serialize(serializationObject);
33
+ serializationObject.isDo = (_a = this.config) === null || _a === void 0 ? void 0 : _a.isDo;
34
+ }
30
35
  }
31
36
  RegisterClass("FGWhileLoopBlock", FlowGraphWhileLoopBlock);
32
37
  //# sourceMappingURL=flowGraphWhileLoopBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphWhileLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY3D;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iCAAiC;IAU1E,YAAmB,MAA8C;QAC7D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAwC;QAG7D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;;QAChF,IAAI,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,KAAI,CAAC,cAAc,EAAE;YACtC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SAC1C;QACD,OAAO,cAAc,EAAE;YACnB,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACvC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACrD;QACD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,kBAAkB,CAAC;IAC9B,CAAC;CACJ;AACD,aAAa,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for the while loop block.\r\n */\r\nexport interface IFlowGraphWhileLoopBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * If true, the loop body will be executed at least once.\r\n */\r\n isDo?: boolean;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that executes a branch while a condition is true.\r\n */\r\nexport class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The condition to evaluate.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Output connection: The loop body.\r\n */\r\n public readonly loopBody: FlowGraphSignalConnection;\r\n\r\n constructor(public config?: IFlowGraphWhileLoopBlockConfiguration) {\r\n super(config);\r\n\r\n this.condition = this._registerDataInput(\"condition\", RichTypeBoolean);\r\n this.loopBody = this._registerSignalOutput(\"loopBody\");\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n let conditionValue = this.condition.getValue(context);\r\n if (this.config?.isDo && !conditionValue) {\r\n this.loopBody._activateSignal(context);\r\n }\r\n while (conditionValue) {\r\n this.loopBody._activateSignal(context);\r\n conditionValue = this.condition.getValue(context);\r\n }\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGWhileLoopBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGWhileLoopBlock\", FlowGraphWhileLoopBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphWhileLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,iCAAiC,EA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raphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for the while loop block.\r\n */\r\nexport interface IFlowGraphWhileLoopBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * If true, the loop body will be executed at least once.\r\n */\r\n isDo?: boolean;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that executes a branch while a condition is true.\r\n */\r\nexport class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The condition to evaluate.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Output connection: The loop body.\r\n */\r\n public readonly loopBody: FlowGraphSignalConnection;\r\n\r\n constructor(public config?: IFlowGraphWhileLoopBlockConfiguration) {\r\n super(config);\r\n\r\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\r\n this.loopBody = this._registerSignalOutput(\"loopBody\");\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n let conditionValue = this.condition.getValue(context);\r\n if (this.config?.isDo && !conditionValue) {\r\n this.loopBody._activateSignal(context);\r\n }\r\n while (conditionValue) {\r\n this.loopBody._activateSignal(context);\r\n conditionValue = this.condition.getValue(context);\r\n }\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGWhileLoopBlock\";\r\n }\r\n\r\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.isDo = this.config?.isDo;\r\n }\r\n}\r\nRegisterClass(\"FGWhileLoopBlock\", FlowGraphWhileLoopBlock);\r\n"]}
@@ -8,7 +8,7 @@ import { RegisterClass } from "../../../Misc/typeStore.js";
8
8
  export class FlowGraphLogBlock extends FlowGraphWithOnDoneExecutionBlock {
9
9
  constructor(config) {
10
10
  super(config);
11
- this.message = this._registerDataInput("message", RichTypeAny);
11
+ this.message = this.registerDataInput("message", RichTypeAny);
12
12
  }
13
13
  /**
14
14
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iCAAiC;IAMpE,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,iCAAiC;QACjC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ;AACD,aAAa,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphLogBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The message to log.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.message = this._registerDataInput(\"message\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const messageValue = this.message.getValue(context);\r\n console.log(messageValue);\r\n // activate the output flow block\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGLogBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGLogBlock\", FlowGraphLogBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iCAAiC;IAMpE,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,iCAAiC;QACjC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ;AACD,aAAa,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphLogBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The message to log.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.message = this.registerDataInput(\"message\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const messageValue = this.message.getValue(context);\r\n console.log(messageValue);\r\n // activate the output flow block\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGLogBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGLogBlock\", FlowGraphLogBlock);\r\n"]}
@@ -7,8 +7,8 @@ import { RegisterClass } from "../../../Misc/typeStore.js";
7
7
  export class FlowGraphSendCustomEventBlock extends FlowGraphWithOnDoneExecutionBlock {
8
8
  constructor(config) {
9
9
  super(config);
10
- this.eventId = this._registerDataInput("eventId", RichTypeString);
11
- this.eventData = this._registerDataInput("eventData", RichTypeAny);
10
+ this.eventId = this.registerDataInput("eventId", RichTypeString);
11
+ this.eventData = this.registerDataInput("eventData", RichTypeAny);
12
12
  }
13
13
  _execute(context) {
14
14
  const eventId = this.eventId.getValue(context);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSendCustomEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oCAA0C;AAEhF,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAE5F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,iCAAiC;IAUhF,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACvE,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEnD,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAExE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,wBAAwB,CAAC;IACpC,CAAC;CACJ;AACD,aAAa,CAAC,wBAAwB,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import { RichTypeAny, RichTypeString } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport class FlowGraphSendCustomEventBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The id of the event to send.\r\n */\r\n public readonly eventId: FlowGraphDataConnection<string>;\r\n /**\r\n * Input connection: The data to send with the event.\r\n */\r\n public readonly eventData: FlowGraphDataConnection<any>;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.eventId = this._registerDataInput(\"eventId\", RichTypeString);\r\n this.eventData = this._registerDataInput(\"eventData\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const eventId = this.eventId.getValue(context);\r\n const eventData = this.eventData.getValue(context);\r\n\r\n context.configuration.coordinator.notifyCustomEvent(eventId, eventData);\r\n\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGSendCustomEventBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGSendCustomEventBlock\", FlowGraphSendCustomEventBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphSendCustomEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oCAA0C;AAEhF,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAE5F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,iCAAiC;IAUhF,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACjE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACtE,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEnD,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAExE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,wBAAwB,CAAC;IACpC,CAAC;CACJ;AACD,aAAa,CAAC,wBAAwB,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import { RichTypeAny, RichTypeString } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport class FlowGraphSendCustomEventBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The id of the event to send.\r\n */\r\n public readonly eventId: FlowGraphDataConnection<string>;\r\n /**\r\n * Input connection: The data to send with the event.\r\n */\r\n public readonly eventData: FlowGraphDataConnection<any>;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.eventId = this.registerDataInput(\"eventId\", RichTypeString);\r\n this.eventData = this.registerDataInput(\"eventData\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const eventId = this.eventId.getValue(context);\r\n const eventData = this.eventData.getValue(context);\r\n\r\n context.configuration.coordinator.notifyCustomEvent(eventId, eventData);\r\n\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGSendCustomEventBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGSendCustomEventBlock\", FlowGraphSendCustomEventBlock);\r\n"]}
@@ -2,6 +2,8 @@ import type { FlowGraphContext } from "../../flowGraphContext";
2
2
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
3
3
  import { FlowGraphWithOnDoneExecutionBlock } from "../../flowGraphWithOnDoneExecutionBlock";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
+ import type { FlowGraphPath } from "../../flowGraphPath";
6
+ import { FlowGraphPathComponent } from "../../flowGraphPathComponent";
5
7
  /**
6
8
  * @experimental
7
9
  * Configuration for the set property block.
@@ -11,17 +13,7 @@ export interface IFlowGraphSetPropertyBlockConfiguration extends IFlowGraphBlock
11
13
  * The path of the entity whose property will be set. Needs a corresponding
12
14
  * entity on the context variables.
13
15
  */
14
- path: string;
15
- /**
16
- * The property to set on the target object.
17
- */
18
- property: string;
19
- /**
20
- * A string that will be substituted by a node with the same name, if encountered enclosed by \{\}.
21
- * It will create an input data node which expects a number. The value of the node will be used
22
- * to substitute the string.
23
- */
24
- subString: string;
16
+ path: FlowGraphPath;
25
17
  }
26
18
  /**
27
19
  * @experimental
@@ -33,8 +25,12 @@ export declare class FlowGraphSetPropertyBlock<ValueT> extends FlowGraphWithOnDo
33
25
  * Input connection: The value to set on the property.
34
26
  */
35
27
  readonly value: FlowGraphDataConnection<ValueT>;
28
+ /**
29
+ * The component with the templated inputs for the provided path.
30
+ */
31
+ readonly templateComponent: FlowGraphPathComponent;
36
32
  constructor(config: IFlowGraphSetPropertyBlockConfiguration);
37
- private _setProperty;
38
33
  _execute(context: FlowGraphContext): void;
34
+ serialize(serializationObject?: any): void;
39
35
  getClassName(): string;
40
36
  }
@@ -1,6 +1,7 @@
1
- import { RichTypeAny, RichTypeNumber } from "../../flowGraphRichTypes.js";
1
+ import { RichTypeAny } from "../../flowGraphRichTypes.js";
2
2
  import { FlowGraphWithOnDoneExecutionBlock } from "../../flowGraphWithOnDoneExecutionBlock.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
+ import { FlowGraphPathComponent } from "../../flowGraphPathComponent.js";
4
5
  /**
5
6
  * @experimental
6
7
  * Block that sets a property on a target object.
@@ -9,29 +10,18 @@ export class FlowGraphSetPropertyBlock extends FlowGraphWithOnDoneExecutionBlock
9
10
  constructor(config) {
10
11
  super(config);
11
12
  this.config = config;
12
- this.value = this._registerDataInput("value", RichTypeAny);
13
- this._registerDataInput(config.subString, RichTypeNumber);
14
- }
15
- _setProperty(target, property, value) {
16
- const splitProp = property.split(".");
17
- let currentTarget = target;
18
- for (let i = 0; i < splitProp.length - 1; i++) {
19
- currentTarget = currentTarget[splitProp[i]];
20
- }
21
- currentTarget[splitProp[splitProp.length - 1]] = value;
13
+ this.value = this.registerDataInput("value", RichTypeAny);
14
+ this.templateComponent = new FlowGraphPathComponent(config.path, this);
22
15
  }
23
16
  _execute(context) {
24
- const target = context._getTargetFromPath(this.config.path, this.config.subString, this);
25
- const property = this.config.property;
26
17
  const value = this.value.getValue(context);
27
- if (target && property) {
28
- this._setProperty(target, property, value);
29
- }
30
- else {
31
- throw new Error("Invalid target or property");
32
- }
18
+ this.templateComponent.setProperty(context, value);
33
19
  this.onDone._activateSignal(context);
34
20
  }
21
+ serialize(serializationObject = {}) {
22
+ super.serialize(serializationObject);
23
+ serializationObject.config.path = this.config.path.serialize();
24
+ }
35
25
  getClassName() {
36
26
  return "FGSetPropertyBlock";
37
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSetPropertyBlock.js","sourceRoot":"","sources":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AC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAE3C,IAAI,MAAM,IAAI,QAAQ,EAAE;YACpB,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;SAC9C;aAAM;YACH,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;SACjD;QAED,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AACD,aAAa,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RichTypeAny, RichTypeNumber } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * Configuration for the set property block.\r\n */\r\nexport interface IFlowGraphSetPropertyBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The path of the entity whose property will be set. Needs a corresponding\r\n * entity on the context variables.\r\n */\r\n path: string;\r\n /**\r\n * The property to set on the target object.\r\n */\r\n property: string;\r\n /**\r\n * A string that will be substituted by a node with the same name, if encountered enclosed by \\{\\}.\r\n * It will create an input data node which expects a number. The value of the node will be used\r\n * to substitute the string.\r\n */\r\n subString: string;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * Block that sets a property on a target object.\r\n */\r\nexport class FlowGraphSetPropertyBlock<ValueT> extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The value to set on the property.\r\n */\r\n public readonly value: FlowGraphDataConnection<ValueT>;\r\n\r\n public constructor(public config: IFlowGraphSetPropertyBlockConfiguration) {\r\n super(config);\r\n\r\n this.value = this._registerDataInput(\"value\", RichTypeAny);\r\n this._registerDataInput(config.subString, RichTypeNumber);\r\n }\r\n\r\n private _setProperty(target: any, property: string, value: any): void {\r\n const splitProp = property.split(\".\");\r\n\r\n let currentTarget = target;\r\n for (let i = 0; i < splitProp.length - 1; i++) {\r\n currentTarget = currentTarget[splitProp[i]];\r\n }\r\n\r\n currentTarget[splitProp[splitProp.length - 1]] = value;\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const target = context._getTargetFromPath(this.config.path, this.config.subString, this);\r\n const property = this.config.property;\r\n const value = this.value.getValue(context);\r\n\r\n if (target && property) {\r\n this._setProperty(target, property, value);\r\n } else {\r\n throw new Error(\"Invalid target or property\");\r\n }\r\n\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGSetPropertyBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGSetPropertyBlock\", FlowGraphSetPropertyBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphSetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AActE;;;GAGG;AACH,MAAM,OAAO,yBAAkC,SAAQ,iCAAiC;IAUpF,YAA0B,MAA+C;QACrE,KAAK,CAAC,MAAM,CAAC,CAAC;QADQ,WAAM,GAAN,MAAM,CAAyC;QAGrE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,iBAAiB,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAEnD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,SAAS,CAAC,sBAA2B,EAAE;QAC1C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IACnE,CAAC;IAEM,YAAY;QACf,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AACD,aAAa,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphPath } from \"../../flowGraphPath\";\r\nimport { FlowGraphPathComponent } from \"../../flowGraphPathComponent\";\r\n\r\n/**\r\n * @experimental\r\n * Configuration for the set property block.\r\n */\r\nexport interface IFlowGraphSetPropertyBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The path of the entity whose property will be set. Needs a corresponding\r\n * entity on the context variables.\r\n */\r\n path: FlowGraphPath;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * Block that sets a property on a target object.\r\n */\r\nexport class FlowGraphSetPropertyBlock<ValueT> extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The value to set on the property.\r\n */\r\n public readonly value: FlowGraphDataConnection<ValueT>;\r\n /**\r\n * The component with the templated inputs for the provided path.\r\n */\r\n public readonly templateComponent: FlowGraphPathComponent;\r\n\r\n public constructor(public config: IFlowGraphSetPropertyBlockConfiguration) {\r\n super(config);\r\n\r\n this.value = this.registerDataInput(\"value\", RichTypeAny);\r\n this.templateComponent = new FlowGraphPathComponent(config.path, this);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const value = this.value.getValue(context);\r\n this.templateComponent.setProperty(context, value);\r\n\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.path = this.config.path.serialize();\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGSetPropertyBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGSetPropertyBlock\", FlowGraphSetPropertyBlock);\r\n"]}
@@ -8,8 +8,8 @@ import { RegisterClass } from "../../../Misc/typeStore.js";
8
8
  export class FlowGraphSetVariableBlock extends FlowGraphWithOnDoneExecutionBlock {
9
9
  constructor(config) {
10
10
  super(config);
11
- this.variableName = this._registerDataInput("variableName", RichTypeString);
12
- this.input = this._registerDataInput("input", RichTypeAny);
11
+ this.variableName = this.registerDataInput("variableName", RichTypeString);
12
+ this.input = this.registerDataInput("input", RichTypeAny);
13
13
  }
14
14
  _execute(context) {
15
15
  const variableNameValue = this.variableName.getValue(context);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAGpD;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,iCAAiC;IAU/E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAC5E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/D,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AACD,aAAa,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RichTypeString, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * Block to set a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphSetVariableBlock<T> extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The name of the variable to set.\r\n */\r\n public readonly variableName: FlowGraphDataConnection<string>;\r\n /**\r\n * Input connection: The value to set on the variable.\r\n */\r\n public readonly input: FlowGraphDataConnection<T>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.variableName = this._registerDataInput(\"variableName\", RichTypeString);\r\n this.input = this._registerDataInput(\"input\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const variableNameValue = this.variableName.getValue(context);\r\n const inputValue = this.input.getValue(context);\r\n context.setVariable(variableNameValue, inputValue);\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGSetVariableBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGSetVariableBlock\", FlowGraphSetVariableBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphSetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAGpD;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,iCAAiC;IAU/E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AACD,aAAa,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RichTypeString, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * Block to set a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphSetVariableBlock<T> extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The name of the variable to set.\r\n */\r\n public readonly variableName: FlowGraphDataConnection<string>;\r\n /**\r\n * Input connection: The value to set on the variable.\r\n */\r\n public readonly input: FlowGraphDataConnection<T>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.variableName = this.registerDataInput(\"variableName\", RichTypeString);\r\n this.input = this.registerDataInput(\"input\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const variableNameValue = this.variableName.getValue(context);\r\n const inputValue = this.input.getValue(context);\r\n context.setVariable(variableNameValue, inputValue);\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGSetVariableBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGSetVariableBlock\", FlowGraphSetVariableBlock);\r\n"]}
@@ -35,8 +35,8 @@ export declare class FlowGraphBlock {
35
35
  * @internal
36
36
  */
37
37
  _updateOutputs(_context: FlowGraphContext): void;
38
- protected _registerDataInput<T>(name: string, className: RichType<T>): FlowGraphDataConnection<T>;
39
- protected _registerDataOutput<T>(name: string, className: RichType<T>): FlowGraphDataConnection<T>;
38
+ registerDataInput<T>(name: string, className: RichType<T>): FlowGraphDataConnection<T>;
39
+ registerDataOutput<T>(name: string, className: RichType<T>): FlowGraphDataConnection<T>;
40
40
  getDataInput(name: string): FlowGraphDataConnection<any> | undefined;
41
41
  serialize(serializationObject?: any): void;
42
42
  getClassName(): string;
@@ -32,12 +32,12 @@ export class FlowGraphBlock {
32
32
  _updateOutputs(_context) {
33
33
  // empty by default, overriden in data blocks
34
34
  }
35
- _registerDataInput(name, className) {
35
+ registerDataInput(name, className) {
36
36
  const input = new FlowGraphDataConnection(name, FlowGraphConnectionType.Input, this, className);
37
37
  this.dataInputs.push(input);
38
38
  return input;
39
39
  }
40
- _registerDataOutput(name, className) {
40
+ registerDataOutput(name, className) {
41
41
  const output = new FlowGraphDataConnection(name, FlowGraphConnectionType.Output, this, className);
42
42
  this.dataOutputs.push(output);
43
43
  return output;
@@ -47,7 +47,10 @@ export class FlowGraphBlock {
47
47
  }
48
48
  serialize(serializationObject = {}) {
49
49
  serializationObject.uniqueId = this.uniqueId;
50
- serializationObject.config = this.config;
50
+ serializationObject.config = {};
51
+ if (this.config) {
52
+ serializationObject.config["name"] = this.config.name;
53
+ }
51
54
  serializationObject.dataInputs = [];
52
55
  serializationObject.dataOutputs = [];
53
56
  serializationObject.className = this.getClassName();
@@ -67,7 +70,20 @@ export class FlowGraphBlock {
67
70
  }
68
71
  static Parse(serializationObject) {
69
72
  const classType = Tools.Instantiate(serializationObject.className);
70
- const obj = new classType(serializationObject.config);
73
+ const parsedConfig = {};
74
+ if (serializationObject.config) {
75
+ for (const key in serializationObject.config) {
76
+ const value = serializationObject.config[key];
77
+ if (value && value.className) {
78
+ const valueClassType = Tools.Instantiate(value.className);
79
+ parsedConfig[key] = valueClassType.prototype.Parse(value);
80
+ }
81
+ else {
82
+ parsedConfig[key] = value;
83
+ }
84
+ }
85
+ }
86
+ const obj = new classType(parsedConfig);
71
87
  obj.uniqueId = serializationObject.uniqueId;
72
88
  for (let i = 0; i < serializationObject.dataInputs.length; i++) {
73
89
  obj.dataInputs[i].deserialize(serializationObject.dataInputs[i]);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphBlock.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,KAAK,EAAE,yBAAwB;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAMpE;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IAkBvB,sEAAsE;IACtE,YAA6B,MAAqC;QAArC,WAAM,GAAN,MAAM,CAA+B;QAlBlE;;WAEG;QACI,aAAQ,GAAG,UAAU,EAAE,CAAC;QAgB3B,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;IAEM,SAAS;;QACZ,0CAA0C;QAC1C,IAAI,CAAC,IAAI,GAAG,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,mCAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,QAA0B;QAC5C,6CAA6C;IACjD,CAAC;IAES,kBAAkB,CAAI,IAAY,EAAE,SAAsB;QAChE,MAAM,KAAK,GAAG,IAAI,uBAAuB,CAAC,IAAI,EAAE,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;QAChG,IAAI,CAAC,UAAU,CAAC,IAAI,CA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D,OAAO,GAAG,CAAC;IACf,CAAC;CACJ","sourcesContent":["import { RandomGUID } from \"../Misc/guid\";\r\nimport { FlowGraphConnectionType } from \"./flowGraphConnection\";\r\nimport type { FlowGraphContext } from \"./flowGraphContext\";\r\nimport { FlowGraphDataConnection } from \"./flowGraphDataConnection\";\r\nimport type { RichType } from \"./flowGraphRichTypes\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\n\r\nexport interface IFlowGraphBlockConfiguration {\r\n name?: string;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block in a flow graph. The most basic form\r\n * of a block has inputs and outputs that contain\r\n * data.\r\n */\r\nexport class FlowGraphBlock {\r\n /**\r\n * A randomly generated GUID for each block.\r\n */\r\n public uniqueId = RandomGUID();\r\n /**\r\n * The name of the block.\r\n */\r\n public name: string;\r\n /**\r\n * The data inputs of the block.\r\n */\r\n public dataInputs: FlowGraphDataConnection<any>[];\r\n /**\r\n * The data outputs of the block.\r\n */\r\n public dataOutputs: FlowGraphDataConnection<any>[];\r\n\r\n /** Constructor is protected so only subclasses can be instantiated */\r\n protected constructor(public config?: IFlowGraphBlockConfiguration) {\r\n this.configure();\r\n }\r\n\r\n public configure() {\r\n // overriden in child classes, uses config\r\n this.name = this.config?.name ?? this.getClassName();\r\n this.dataInputs = [];\r\n this.dataOutputs = [];\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n // empty by default, overriden in data blocks\r\n }\r\n\r\n protected _registerDataInput<T>(name: string, className: RichType<T>): FlowGraphDataConnection<T> {\r\n const input = new FlowGraphDataConnection(name, FlowGraphConnectionType.Input, this, className);\r\n this.dataInputs.push(input);\r\n return input;\r\n }\r\n\r\n protected _registerDataOutput<T>(name: string, className: RichType<T>): FlowGraphDataConnection<T> {\r\n const output = new FlowGraphDataConnection(name, FlowGraphConnectionType.Output, this, className);\r\n this.dataOutputs.push(output);\r\n return output;\r\n }\r\n\r\n public getDataInput(name: string): FlowGraphDataConnection<any> | undefined {\r\n return this.dataInputs.find((i) => i.name === name);\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n serializationObject.uniqueId = this.uniqueId;\r\n serializationObject.config = this.config;\r\n serializationObject.dataInputs = [];\r\n serializationObject.dataOutputs = [];\r\n serializationObject.className = this.getClassName();\r\n for (const input of this.dataInputs) {\r\n const serializedInput: any = {};\r\n input.serialize(serializedInput);\r\n serializationObject.dataInputs.push(serializedInput);\r\n }\r\n for (const output of this.dataOutputs) {\r\n const serializedOutput: any = {};\r\n output.serialize(serializedOutput);\r\n serializationObject.dataOutputs.push(serializedOutput);\r\n }\r\n }\r\n\r\n public getClassName() {\r\n return \"FGBlock\";\r\n }\r\n\r\n public static Parse(serializationObject: any): FlowGraphBlock {\r\n const classType = Tools.Instantiate(serializationObject.className);\r\n const obj = new classType(serializationObject.config);\r\n obj.uniqueId = serializationObject.uniqueId;\r\n for (let i = 0; i < serializationObject.dataInputs.length; i++) {\r\n obj.dataInputs[i].deserialize(serializationObject.dataInputs[i]);\r\n }\r\n for (let i = 0; i < serializationObject.dataOutputs.length; i++) {\r\n obj.dataOutputs[i].deserialize(serializationObject.dataOutputs[i]);\r\n }\r\n if (obj instanceof FlowGraphExecutionBlock) {\r\n for (let i = 0; i < serializationObject.signalInputs.length; i++) {\r\n obj.signalInputs[i].deserialize(serializationObject.signalInputs[i]);\r\n }\r\n for (let i = 0; i < serializationObject.signalOutputs.length; i++) {\r\n obj.signalOutputs[i].deserialize(serializationObject.signalOutputs[i]);\r\n }\r\n }\r\n return obj;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphBlock.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,O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AAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC/D,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;aAC1E;SACJ;QACD,OAAO,GAAG,CAAC;IACf,CAAC;CACJ","sourcesContent":["import { RandomGUID } from \"../Misc/guid\";\r\nimport { FlowGraphConnectionType } from \"./flowGraphConnection\";\r\nimport type { FlowGraphContext } from \"./flowGraphContext\";\r\nimport { FlowGraphDataConnection } from \"./flowGraphDataConnection\";\r\nimport type { RichType } from \"./flowGraphRichTypes\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\n\r\nexport interface IFlowGraphBlockConfiguration {\r\n name?: string;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block in a flow graph. The most basic form\r\n * of a block has inputs and outputs that contain\r\n * data.\r\n */\r\nexport class FlowGraphBlock {\r\n /**\r\n * A randomly generated GUID for each block.\r\n */\r\n public uniqueId = RandomGUID();\r\n /**\r\n * The name of the block.\r\n */\r\n public name: string;\r\n /**\r\n * The data inputs of the block.\r\n */\r\n public dataInputs: FlowGraphDataConnection<any>[];\r\n /**\r\n * The data outputs of the block.\r\n */\r\n public dataOutputs: FlowGraphDataConnection<any>[];\r\n\r\n /** Constructor is protected so only subclasses can be instantiated */\r\n protected constructor(public config?: IFlowGraphBlockConfiguration) {\r\n this.configure();\r\n }\r\n\r\n public configure() {\r\n // overriden in child classes, uses config\r\n this.name = this.config?.name ?? this.getClassName();\r\n this.dataInputs = [];\r\n this.dataOutputs = [];\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n // empty by default, overriden in data blocks\r\n }\r\n\r\n public registerDataInput<T>(name: string, className: RichType<T>): FlowGraphDataConnection<T> {\r\n const input = new FlowGraphDataConnection(name, FlowGraphConnectionType.Input, this, className);\r\n this.dataInputs.push(input);\r\n return input;\r\n }\r\n\r\n public registerDataOutput<T>(name: string, className: RichType<T>): FlowGraphDataConnection<T> {\r\n const output = new FlowGraphDataConnection(name, FlowGraphConnectionType.Output, this, className);\r\n this.dataOutputs.push(output);\r\n return output;\r\n }\r\n\r\n public getDataInput(name: string): FlowGraphDataConnection<any> | undefined {\r\n return this.dataInputs.find((i) => i.name === name);\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n serializationObject.uniqueId = this.uniqueId;\r\n serializationObject.config = {};\r\n if (this.config) {\r\n serializationObject.config[\"name\"] = this.config.name;\r\n }\r\n serializationObject.dataInputs = [];\r\n serializationObject.dataOutputs = [];\r\n serializationObject.className = this.getClassName();\r\n for (const input of this.dataInputs) {\r\n const serializedInput: any = {};\r\n input.serialize(serializedInput);\r\n serializationObject.dataInputs.push(serializedInput);\r\n }\r\n for (const output of this.dataOutputs) {\r\n const serializedOutput: any = {};\r\n output.serialize(serializedOutput);\r\n serializationObject.dataOutputs.push(serializedOutput);\r\n }\r\n }\r\n\r\n public getClassName() {\r\n return \"FGBlock\";\r\n }\r\n\r\n public static Parse(serializationObject: any): FlowGraphBlock {\r\n const classType = Tools.Instantiate(serializationObject.className);\r\n const parsedConfig: any = {};\r\n if (serializationObject.config) {\r\n for (const key in serializationObject.config) {\r\n const value = serializationObject.config[key];\r\n if (value && value.className) {\r\n const valueClassType = Tools.Instantiate(value.className);\r\n parsedConfig[key] = valueClassType.prototype.Parse(value);\r\n } else {\r\n parsedConfig[key] = value;\r\n }\r\n }\r\n }\r\n const obj = new classType(parsedConfig);\r\n obj.uniqueId = serializationObject.uniqueId;\r\n for (let i = 0; i < serializationObject.dataInputs.length; i++) {\r\n obj.dataInputs[i].deserialize(serializationObject.dataInputs[i]);\r\n }\r\n for (let i = 0; i < serializationObject.dataOutputs.length; i++) {\r\n obj.dataOutputs[i].deserialize(serializationObject.dataOutputs[i]);\r\n }\r\n if (obj instanceof FlowGraphExecutionBlock) {\r\n for (let i = 0; i < serializationObject.signalInputs.length; i++) {\r\n obj.signalInputs[i].deserialize(serializationObject.signalInputs[i]);\r\n }\r\n for (let i = 0; i < serializationObject.signalOutputs.length; i++) {\r\n obj.signalOutputs[i].deserialize(serializationObject.signalOutputs[i]);\r\n }\r\n }\r\n return obj;\r\n }\r\n}\r\n"]}
@@ -32,9 +32,12 @@ export declare class FlowGraphContext {
32
32
  */
33
33
  uniqueId: string;
34
34
  /**
35
+ * @internal
35
36
  * These are the variables defined by a user.
36
37
  */
37
- private _userVariables;
38
+ _userVariables: {
39
+ [key: string]: any;
40
+ };
38
41
  /**
39
42
  * These are the variables set by the blocks.
40
43
  */
@@ -169,9 +172,6 @@ export declare class FlowGraphContext {
169
172
  * Incremented for every block executed.
170
173
  */
171
174
  get executionId(): number;
172
- private _getEnclosedSubstring;
173
- /** @internal */
174
- _getTargetFromPath(path: string, subString: string, block: FlowGraphBlock): any;
175
175
  /**
176
176
  * Serializes a context
177
177
  * @param serializationObject the object to write the values in
@@ -17,17 +17,18 @@ export class FlowGraphContext {
17
17
  */
18
18
  this.uniqueId = RandomGUID();
19
19
  /**
20
+ * @internal
20
21
  * These are the variables defined by a user.
21
22
  */
22
- this._userVariables = new Map();
23
+ this._userVariables = {};
23
24
  /**
24
25
  * These are the variables set by the blocks.
25
26
  */
26
- this._executionVariables = new Map();
27
+ this._executionVariables = {};
27
28
  /**
28
29
  * These are the values for the data connection points
29
30
  */
30
- this._connectionValues = new Map();
31
+ this._connectionValues = {};
31
32
  /**
32
33
  * These are blocks that have currently pending tasks/listeners that need to be cleaned up.
33
34
  */
@@ -49,7 +50,7 @@ export class FlowGraphContext {
49
50
  * @returns
50
51
  */
51
52
  hasVariable(name) {
52
- return this._userVariables.has(name);
53
+ return name in this._userVariables;
53
54
  }
54
55
  /**
55
56
  * Set a user-defined variable.
@@ -57,7 +58,7 @@ export class FlowGraphContext {
57
58
  * @param value
58
59
  */
59
60
  setVariable(name, value) {
60
- this._userVariables.set(name, value);
61
+ this._userVariables[name] = value;
61
62
  }
62
63
  /**
63
64
  * Get a user-defined variable.
@@ -65,7 +66,7 @@ export class FlowGraphContext {
65
66
  * @returns
66
67
  */
67
68
  getVariable(name) {
68
- return this._userVariables.get(name);
69
+ return this._userVariables[name];
69
70
  }
70
71
  _getUniqueIdPrefixedName(obj, name) {
71
72
  return `${obj.uniqueId}_${name}`;
@@ -77,7 +78,7 @@ export class FlowGraphContext {
77
78
  * @param value
78
79
  */
79
80
  _setExecutionVariable(block, name, value) {
80
- this._executionVariables.set(this._getUniqueIdPrefixedName(block, name), value);
81
+ this._executionVariables[this._getUniqueIdPrefixedName(block, name)] = value;
81
82
  }
82
83
  /**
83
84
  * Get an internal execution variable
@@ -87,7 +88,7 @@ export class FlowGraphContext {
87
88
  */
88
89
  _getExecutionVariable(block, name, defaultValue) {
89
90
  if (this._hasExecutionVariable(block, name)) {
90
- return this._executionVariables.get(this._getUniqueIdPrefixedName(block, name));
91
+ return this._executionVariables[this._getUniqueIdPrefixedName(block, name)];
91
92
  }
92
93
  else {
93
94
  return defaultValue;
@@ -100,7 +101,7 @@ export class FlowGraphContext {
100
101
  * @param name
101
102
  */
102
103
  _deleteExecutionVariable(block, name) {
103
- this._executionVariables.delete(this._getUniqueIdPrefixedName(block, name));
104
+ delete this._executionVariables[this._getUniqueIdPrefixedName(block, name)];
104
105
  }
105
106
  /**
106
107
  * Check if an internal execution variable is defined
@@ -110,7 +111,7 @@ export class FlowGraphContext {
110
111
  * @returns
111
112
  */
112
113
  _hasExecutionVariable(block, name) {
113
- return this._executionVariables.has(this._getUniqueIdPrefixedName(block, name));
114
+ return this._getUniqueIdPrefixedName(block, name) in this._executionVariables;
114
115
  }
115
116
  /**
116
117
  * Check if a connection value is defined
@@ -119,7 +120,7 @@ export class FlowGraphContext {
119
120
  * @returns
120
121
  */
121
122
  _hasConnectionValue(connectionPoint) {
122
- return this._connectionValues.has(connectionPoint.uniqueId);
123
+ return connectionPoint.uniqueId in this._connectionValues;
123
124
  }
124
125
  /**
125
126
  * Set a connection value
@@ -128,7 +129,7 @@ export class FlowGraphContext {
128
129
  * @param value
129
130
  */
130
131
  _setConnectionValue(connectionPoint, value) {
131
- this._connectionValues.set(connectionPoint.uniqueId, value);
132
+ this._connectionValues[connectionPoint.uniqueId] = value;
132
133
  }
133
134
  /**
134
135
  * Get a connection value
@@ -137,7 +138,7 @@ export class FlowGraphContext {
137
138
  * @returns
138
139
  */
139
140
  _getConnectionValue(connectionPoint) {
140
- return this._connectionValues.get(connectionPoint.uniqueId);
141
+ return this._connectionValues[connectionPoint.uniqueId];
141
142
  }
142
143
  /**
143
144
  * Get the configuration
@@ -198,25 +199,6 @@ export class FlowGraphContext {
198
199
  get executionId() {
199
200
  return this._executionId;
200
201
  }
201
- _getEnclosedSubstring(subString) {
202
- return `{${subString}}`;
203
- }
204
- /** @internal */
205
- _getTargetFromPath(path, subString, block) {
206
- let finalPath = path;
207
- if (subString && path.indexOf(this._getEnclosedSubstring(subString)) !== -1) {
208
- const nodeToSub = block.getDataInput(subString);
209
- if (!nodeToSub) {
210
- throw new Error(`Invalid substitution input for substitution string ${subString}`);
211
- }
212
- const index = Math.floor(nodeToSub.getValue(this));
213
- if (isNaN(index)) {
214
- throw new Error(`Invalid substitution value for substitution string ${subString}`);
215
- }
216
- finalPath = path.replace(this._getEnclosedSubstring(subString), index.toString());
217
- }
218
- return this.getVariable(finalPath);
219
- }
220
202
  /**
221
203
  * Serializes a context
222
204
  * @param serializationObject the object to write the values in
@@ -225,13 +207,13 @@ export class FlowGraphContext {
225
207
  serialize(serializationObject = {}, valueSerializationFunction = defaultValueSerializationFunction) {
226
208
  serializationObject.uniqueId = this.uniqueId;
227
209
  serializationObject._userVariables = {};
228
- this._userVariables.forEach((value, key) => {
229
- valueSerializationFunction(key, value, serializationObject._userVariables);
230
- });
210
+ for (const key in this._userVariables) {
211
+ valueSerializationFunction(key, this._userVariables[key], serializationObject._userVariables);
212
+ }
231
213
  serializationObject._connectionValues = {};
232
- this._connectionValues.forEach((value, key) => {
233
- valueSerializationFunction(key, value, serializationObject._connectionValues);
234
- });
214
+ for (const key in this._connectionValues) {
215
+ valueSerializationFunction(key, this._connectionValues[key], serializationObject._connectionValues);
216
+ }
235
217
  }
236
218
  getClassName() {
237
219
  return "FGContext";
@@ -248,11 +230,11 @@ export class FlowGraphContext {
248
230
  result.uniqueId = serializationObject.uniqueId;
249
231
  for (const key in serializationObject._userVariables) {
250
232
  const value = valueParseFunction(key, serializationObject._userVariables, result._configuration.scene);
251
- result._userVariables.set(key, value);
233
+ result._userVariables[key] = value;
252
234
  }
253
235
  for (const key in serializationObject._connectionValues) {
254
236
  const value = valueParseFunction(key, serializationObject._connectionValues, result._configuration.scene);
255
- result._connectionValues.set(key, value);
237
+ result._connectionValues[key] = value;
256
238
  }
257
239
  return result;
258
240
  }