@babylonjs/core 6.36.0 → 6.37.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 (194) hide show
  1. package/Cameras/Inputs/arcRotateCameraGamepadInput.js +4 -0
  2. package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
  3. package/Engines/Extensions/engine.dynamicTexture.d.ts +2 -2
  4. package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
  5. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +28 -3
  6. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
  7. package/Engines/WebGPU/Extensions/engine.rawTexture.js +4 -0
  8. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  9. package/Engines/WebGPU/webgpuBufferManager.js +6 -2
  10. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  11. package/Engines/WebGPU/webgpuCacheBindGroups.d.ts +1 -0
  12. package/Engines/WebGPU/webgpuCacheBindGroups.js +12 -0
  13. package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
  14. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +2 -1
  15. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  16. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.d.ts +2 -2
  17. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js +5 -2
  18. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
  19. package/Engines/WebGPU/webgpuCacheSampler.js +3 -0
  20. package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
  21. package/Engines/WebGPU/webgpuClearQuad.js +2 -1
  22. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  23. package/Engines/WebGPU/webgpuHardwareTexture.d.ts +1 -1
  24. package/Engines/WebGPU/webgpuHardwareTexture.js +23 -5
  25. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  26. package/Engines/WebGPU/webgpuPipelineContext.js +4 -5
  27. package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
  28. package/Engines/WebGPU/webgpuQuerySet.js +10 -4
  29. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  30. package/Engines/WebGPU/webgpuTextureHelper.d.ts +8 -53
  31. package/Engines/WebGPU/webgpuTextureHelper.js +4 -996
  32. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  33. package/Engines/WebGPU/webgpuTextureManager.d.ts +56 -0
  34. package/Engines/WebGPU/webgpuTextureManager.js +1012 -0
  35. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -0
  36. package/Engines/engine.d.ts +1 -0
  37. package/Engines/engine.js +9 -2
  38. package/Engines/engine.js.map +1 -1
  39. package/Engines/renderTargetWrapper.d.ts +1 -0
  40. package/Engines/renderTargetWrapper.js +5 -1
  41. package/Engines/renderTargetWrapper.js.map +1 -1
  42. package/Engines/thinEngine.d.ts +1 -0
  43. package/Engines/thinEngine.js +11 -7
  44. package/Engines/thinEngine.js.map +1 -1
  45. package/Engines/webgpuEngine.d.ts +9 -2
  46. package/Engines/webgpuEngine.js +75 -3
  47. package/Engines/webgpuEngine.js.map +1 -1
  48. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +23 -6
  49. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +14 -3
  50. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
  51. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +14 -3
  52. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +12 -11
  53. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
  54. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +1 -1
  55. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +1 -1
  56. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  57. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +22 -7
  58. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +15 -9
  59. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  60. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +1 -1
  61. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +1 -1
  62. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  63. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +1 -1
  64. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +1 -1
  65. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
  66. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +1 -1
  67. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +1 -1
  68. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
  69. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +1 -1
  70. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +1 -1
  71. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  72. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +1 -1
  73. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +1 -1
  74. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  75. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +1 -1
  76. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +1 -1
  77. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  78. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +1 -1
  79. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +1 -1
  80. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  81. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +1 -1
  82. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +1 -1
  83. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  84. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +1 -1
  85. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +1 -1
  86. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  87. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +1 -1
  88. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +1 -1
  89. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  90. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +1 -1
  91. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +1 -1
  92. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
  93. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +1 -1
  94. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +1 -1
  95. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
  96. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +13 -5
  97. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +9 -5
  98. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  99. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +1 -1
  100. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +1 -1
  101. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  102. package/FlowGraph/flowGraph.d.ts +24 -6
  103. package/FlowGraph/flowGraph.js +12 -12
  104. package/FlowGraph/flowGraph.js.map +1 -1
  105. package/FlowGraph/flowGraphBlock.d.ts +31 -2
  106. package/FlowGraph/flowGraphBlock.js +8 -3
  107. package/FlowGraph/flowGraphBlock.js.map +1 -1
  108. package/FlowGraph/flowGraphContext.d.ts +5 -1
  109. package/FlowGraph/flowGraphContext.js +4 -2
  110. package/FlowGraph/flowGraphContext.js.map +1 -1
  111. package/FlowGraph/flowGraphCoordinator.d.ts +22 -2
  112. package/FlowGraph/flowGraphCoordinator.js +7 -11
  113. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  114. package/FlowGraph/{flowGraphWithOnDoneExecutionBlock.js → flowGraphExecutionBlockWithOutSignal.js} +1 -1
  115. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js.map +1 -0
  116. package/FlowGraph/flowGraphPathConverter.d.ts +13 -0
  117. package/FlowGraph/flowGraphPathConverter.js +31 -0
  118. package/FlowGraph/flowGraphPathConverter.js.map +1 -0
  119. package/FlowGraph/flowGraphPathConverterComponent.d.ts +19 -0
  120. package/FlowGraph/flowGraphPathConverterComponent.js +31 -0
  121. package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -0
  122. package/FlowGraph/index.d.ts +0 -1
  123. package/FlowGraph/index.js +0 -1
  124. package/FlowGraph/index.js.map +1 -1
  125. package/FlowGraph/serialization.d.ts +8 -0
  126. package/FlowGraph/serialization.js +12 -4
  127. package/FlowGraph/serialization.js.map +1 -1
  128. package/FlowGraph/typeDefinitions.d.ts +86 -1
  129. package/FlowGraph/typeDefinitions.js.map +1 -1
  130. package/Materials/Textures/dynamicTexture.js +2 -1
  131. package/Materials/Textures/dynamicTexture.js.map +1 -1
  132. package/Materials/Textures/hardwareTextureWrapper.d.ts +1 -1
  133. package/Materials/Textures/hardwareTextureWrapper.js.map +1 -1
  134. package/Materials/Textures/internalTexture.d.ts +6 -2
  135. package/Materials/Textures/internalTexture.js +6 -4
  136. package/Materials/Textures/internalTexture.js.map +1 -1
  137. package/Materials/Textures/renderTargetTexture.js +10 -10
  138. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  139. package/Materials/material.d.ts +1 -1
  140. package/Materials/material.js +3 -1
  141. package/Materials/material.js.map +1 -1
  142. package/Materials/shaderMaterial.js +2 -2
  143. package/Materials/shaderMaterial.js.map +1 -1
  144. package/Materials/uniformBuffer.d.ts +2 -0
  145. package/Materials/uniformBuffer.js +16 -0
  146. package/Materials/uniformBuffer.js.map +1 -1
  147. package/Meshes/GreasedLine/greasedLineMesh.d.ts +2 -1
  148. package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
  149. package/Meshes/GreasedLine/greasedLineRibbonMesh.d.ts +2 -1
  150. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  151. package/Meshes/WebGPU/webgpuDataBuffer.d.ts +1 -0
  152. package/Meshes/WebGPU/webgpuDataBuffer.js +2 -0
  153. package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
  154. package/Meshes/geometry.js +3 -3
  155. package/Meshes/geometry.js.map +1 -1
  156. package/Misc/brdfTextureTools.js +9 -7
  157. package/Misc/brdfTextureTools.js.map +1 -1
  158. package/Misc/rgbdTextureTools.js +37 -37
  159. package/Misc/rgbdTextureTools.js.map +1 -1
  160. package/ObjectModel/index.d.ts +1 -0
  161. package/ObjectModel/index.js +2 -0
  162. package/ObjectModel/index.js.map +1 -0
  163. package/ObjectModel/objectModelInterfaces.d.ts +21 -0
  164. package/ObjectModel/objectModelInterfaces.js +2 -0
  165. package/ObjectModel/objectModelInterfaces.js.map +1 -0
  166. package/Particles/computeShaderParticleSystem.js +2 -2
  167. package/Particles/computeShaderParticleSystem.js.map +1 -1
  168. package/Particles/gpuParticleSystem.js +1 -1
  169. package/Particles/gpuParticleSystem.js.map +1 -1
  170. package/Particles/particleSystem.js +2 -5
  171. package/Particles/particleSystem.js.map +1 -1
  172. package/Rendering/fluidRenderer/fluidRenderer.js +1 -6
  173. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  174. package/Rendering/renderingManager.js +1 -1
  175. package/Rendering/renderingManager.js.map +1 -1
  176. package/XR/features/WebXRControllerTeleportation.d.ts +9 -1
  177. package/XR/features/WebXRControllerTeleportation.js +10 -0
  178. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  179. package/XR/webXRCamera.js.map +1 -1
  180. package/index.d.ts +1 -0
  181. package/index.js +1 -0
  182. package/index.js.map +1 -1
  183. package/package.json +1 -1
  184. package/types.d.ts +5 -1
  185. package/types.js +0 -2
  186. package/types.js.map +1 -1
  187. package/FlowGraph/flowGraphPath.d.ts +0 -45
  188. package/FlowGraph/flowGraphPath.js +0 -156
  189. package/FlowGraph/flowGraphPath.js.map +0 -1
  190. package/FlowGraph/flowGraphPathComponent.d.ts +0 -42
  191. package/FlowGraph/flowGraphPathComponent.js +0 -51
  192. package/FlowGraph/flowGraphPathComponent.js.map +0 -1
  193. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +0 -1
  194. /package/FlowGraph/{flowGraphWithOnDoneExecutionBlock.d.ts → flowGraphExecutionBlockWithOutSignal.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphDebounceBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,uCAA0C;AAEnE,OAAO,EAAE,oCAAoC,EAAE,sDAAyD;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,oCA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import type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"core/FlowGraph/flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"core/FlowGraph/flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * This block debounces the execution of a input, i.e. ensures that the input is only executed once every X times\r\n */\r\nexport class FlowGraphDebounceBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input: The number of times the input must be executed before the onDone signal is activated\r\n */\r\n public readonly count: FlowGraphDataConnection<number>;\r\n /**\r\n * Input: Resets the debounce counter\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output: The current count of the debounce counter\r\n */\r\n public readonly currentCount: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.count = this.registerDataInput(\"count\", RichTypeNumber);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.currentCount = this.registerDataOutput(\"currentCount\", RichTypeNumber);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n context._setExecutionVariable(this, \"debounceCount\", 0);\r\n return;\r\n }\r\n const count = this.count.getValue(context);\r\n const currentCount = context._getExecutionVariable(this, \"debounceCount\", 0);\r\n const newCount = currentCount + 1;\r\n\r\n this.currentCount.setValue(newCount, context);\r\n context._setExecutionVariable(this, \"debounceCount\", newCount);\r\n if (newCount >= count) {\r\n this.out._activateSignal(context);\r\n context._setExecutionVariable(this, \"debounceCount\", 0);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGDebounceBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGDebounceBlock\", FlowGraphDebounceBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphDebounceBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,uCAA0C;AAEnE,OAAO,EAAE,oCAAoC,EAAE,yDAA4D;AAC3G,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,oCAAoC;IAc5E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAChF,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;QAC/E,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,EAAE;YAC9B,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;YACxD,OAAO;SACV;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;QAC7E,MAAM,QAAQ,GAAG,YAAY,GAAG,CAAC,CAAC;QAElC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9C,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;QAC/D,IAAI,QAAQ,IAAI,KAAK,EAAE;YACnB,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAClC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;SAC3D;IACL,CAAC;IAEM,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"core/FlowGraph/flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"core/FlowGraph/flowGraphExecutionBlockWithOutSignal\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * This block debounces the execution of a input, i.e. ensures that the input is only executed once every X times\r\n */\r\nexport class FlowGraphDebounceBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input: The number of times the input must be executed before the onDone signal is activated\r\n */\r\n public readonly count: FlowGraphDataConnection<number>;\r\n /**\r\n * Input: Resets the debounce counter\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output: The current count of the debounce counter\r\n */\r\n public readonly currentCount: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.count = this.registerDataInput(\"count\", RichTypeNumber);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.currentCount = this.registerDataOutput(\"currentCount\", RichTypeNumber);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n context._setExecutionVariable(this, \"debounceCount\", 0);\r\n return;\r\n }\r\n const count = this.count.getValue(context);\r\n const currentCount = context._getExecutionVariable(this, \"debounceCount\", 0);\r\n const newCount = currentCount + 1;\r\n\r\n this.currentCount.setValue(newCount, context);\r\n context._setExecutionVariable(this, \"debounceCount\", newCount);\r\n if (newCount >= count) {\r\n this.out._activateSignal(context);\r\n context._setExecutionVariable(this, \"debounceCount\", 0);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGDebounceBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGDebounceBlock\", FlowGraphDebounceBlock);\r\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { FlowGraphContext } from "../../../flowGraphContext";
2
2
  import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
3
3
  import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
4
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
4
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
5
5
  import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
6
6
  /**
7
7
  * @experimental
@@ -1,5 +1,5 @@
1
1
  import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
2
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
2
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
3
3
  import { RegisterClass } from "../../../../Misc/typeStore.js";
4
4
  /**
5
5
  * A block that executes a branch a set number of times.
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphDoNBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAAE,M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../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphDoNBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n startIndex: number;\r\n}\r\n/**\r\n * A block that executes a branch a set number of times.\r\n * @experimental\r\n */\r\nexport class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: Resets the counter\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The maximum number of times the block can be executed.\r\n */\r\n public readonly n: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The number of times the block has been executed.\r\n */\r\n public readonly value: FlowGraphDataConnection<number>;\r\n\r\n constructor(public config: IFlowGraphDoNBlockConfiguration = { startIndex: 0 }) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.n = this.registerDataInput(\"n\", RichTypeNumber);\r\n this.value = this.registerDataOutput(\"value\", RichTypeNumber);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n this.value.setValue(this.config.startIndex, context);\r\n } else {\r\n const currentCountValue = this.value.getValue(context);\r\n if (currentCountValue < this.n.getValue(context)) {\r\n this.value.setValue(currentCountValue + 1, context);\r\n this.out._activateSignal(context);\r\n }\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphDoNBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGDoNBlock\";\r\n}\r\nRegisterClass(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphDoNBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,oCAAoC;IAcvE,YAAmB,SAA0C,EAAE,UAAU,EAAE,CAAC,EAAE;QAC1E,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAqD;QAE1E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAClE,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;QAC/E,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,EAAE;YAC9B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;SACxD;aAAM;YACH,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACvD,IAAI,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;gBAC9C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,iBAAiB,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;gBACpD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;aACrC;SACJ;IACL,CAAC;IAEM,YAAY;QACf,OAAO,iBAAiB,CAAC,SAAS,CAAC;IACvC,CAAC;;AAEa,2BAAS,GAAG,YAAY,CAAC;AAE3C,aAAa,CAAC,iBAAiB,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphDoNBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n startIndex: number;\r\n}\r\n/**\r\n * A block that executes a branch a set number of times.\r\n * @experimental\r\n */\r\nexport class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: Resets the counter\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The maximum number of times the block can be executed.\r\n */\r\n public readonly n: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The number of times the block has been executed.\r\n */\r\n public readonly value: FlowGraphDataConnection<number>;\r\n\r\n constructor(public config: IFlowGraphDoNBlockConfiguration = { startIndex: 0 }) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.n = this.registerDataInput(\"n\", RichTypeNumber);\r\n this.value = this.registerDataOutput(\"value\", RichTypeNumber);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n this.value.setValue(this.config.startIndex, context);\r\n } else {\r\n const currentCountValue = this.value.getValue(context);\r\n if (currentCountValue < this.n.getValue(context)) {\r\n this.value.setValue(currentCountValue + 1, context);\r\n this.out._activateSignal(context);\r\n }\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphDoNBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGDoNBlock\";\r\n}\r\nRegisterClass(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock);\r\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
2
2
  import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
3
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
3
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
4
4
  import type { FlowGraphContext } from "../../../flowGraphContext";
5
5
  import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
1
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
2
2
  import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
3
3
  import { RegisterClass } from "../../../../Misc/typeStore.js";
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphForLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,sDAAyD;AAExG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,oCAAoC;IAsB3E,YAAmB,MAAqC;QACpD,KAAK,CA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,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC1D,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"core/FlowGraph/flowGraphWithOnDoneExecutionBlock\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n/**\r\n * @experimental\r\n * Block that executes an action in a loop.\r\n */\r\nexport class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The start index of the loop.\r\n */\r\n public readonly startIndex: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The end index of the loop.\r\n */\r\n public readonly endIndex: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The step of the loop.\r\n */\r\n public readonly step: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The current index of the loop.\r\n */\r\n public readonly index: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The signal that is activated when the loop body is executed.\r\n */\r\n public readonly onLoop: FlowGraphSignalConnection;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.startIndex = this.registerDataInput(\"startIndex\", RichTypeNumber);\r\n this.endIndex = this.registerDataInput(\"endIndex\", RichTypeNumber);\r\n this.step = this.registerDataInput(\"step\", RichTypeNumber);\r\n\r\n this.index = this.registerDataOutput(\"index\", RichTypeNumber);\r\n this.onLoop = this._registerSignalOutput(\"onLoop\");\r\n }\r\n\r\n private _executeLoop(context: FlowGraphContext) {\r\n let index = context._getExecutionVariable(this, \"index\");\r\n const endIndex = context._getExecutionVariable(this, \"endIndex\");\r\n if (index < endIndex) {\r\n this.index.setValue(index, context);\r\n this.onLoop._activateSignal(context);\r\n const step = context._getExecutionVariable(this, \"step\", 1);\r\n index += step;\r\n context._setExecutionVariable(this, \"index\", index);\r\n this._executeLoop(context);\r\n } else {\r\n this.out._activateSignal(context);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const index = this.startIndex.getValue(context);\r\n const endIndex = this.endIndex.getValue(context);\r\n const step = this.step.getValue(context);\r\n context._setExecutionVariable(this, \"index\", index);\r\n context._setExecutionVariable(this, \"endIndex\", endIndex);\r\n context._setExecutionVariable(this, \"step\", step);\r\n this._executeLoop(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGForLoopBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGForLoopBlock\", FlowGraphForLoopBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphForLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,yDAA4D;AAE3G,OAAO,EAAE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CAAC,CAAC;SAC9B;aAAM;YACH,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SACrC;IACL,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC1D,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"core/FlowGraph/flowGraphExecutionBlockWithOutSignal\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n/**\r\n * @experimental\r\n * Block that executes an action in a loop.\r\n */\r\nexport class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The start index of the loop.\r\n */\r\n public readonly startIndex: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The end index of the loop.\r\n */\r\n public readonly endIndex: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The step of the loop.\r\n */\r\n public readonly step: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The current index of the loop.\r\n */\r\n public readonly index: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The signal that is activated when the loop body is executed.\r\n */\r\n public readonly onLoop: FlowGraphSignalConnection;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.startIndex = this.registerDataInput(\"startIndex\", RichTypeNumber);\r\n this.endIndex = this.registerDataInput(\"endIndex\", RichTypeNumber);\r\n this.step = this.registerDataInput(\"step\", RichTypeNumber);\r\n\r\n this.index = this.registerDataOutput(\"index\", RichTypeNumber);\r\n this.onLoop = this._registerSignalOutput(\"onLoop\");\r\n }\r\n\r\n private _executeLoop(context: FlowGraphContext) {\r\n let index = context._getExecutionVariable(this, \"index\");\r\n const endIndex = context._getExecutionVariable(this, \"endIndex\");\r\n if (index < endIndex) {\r\n this.index.setValue(index, context);\r\n this.onLoop._activateSignal(context);\r\n const step = context._getExecutionVariable(this, \"step\", 1);\r\n index += step;\r\n context._setExecutionVariable(this, \"index\", index);\r\n this._executeLoop(context);\r\n } else {\r\n this.out._activateSignal(context);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const index = this.startIndex.getValue(context);\r\n const endIndex = this.endIndex.getValue(context);\r\n const step = this.step.getValue(context);\r\n context._setExecutionVariable(this, \"index\", index);\r\n context._setExecutionVariable(this, \"endIndex\", endIndex);\r\n context._setExecutionVariable(this, \"step\", step);\r\n this._executeLoop(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGForLoopBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGForLoopBlock\", FlowGraphForLoopBlock);\r\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { FlowGraphContext } from "../../../flowGraphContext";
2
2
  import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
3
3
  import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
4
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
4
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
5
5
  import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
6
6
  /**
7
7
  * @experimental
@@ -1,5 +1,5 @@
1
1
  import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
2
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
2
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
3
3
  import { RegisterClass } from "../../../../Misc/typeStore.js";
4
4
  /**
5
5
  * @experimental
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphThrottleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,oCAAoC;IAc5E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IAClF,CAAC;IACM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;QAC/E,MAAM,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACjF,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtD,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/B,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,IAAI,gBAAgB,KAAK,SAAS,IAAI,WAAW,GAAG,gBAAgB,GAAG,aAAa,EAAE;YAClH,0BAA0B;YAC1B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACxC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAClC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;SACxE;aAAM;YACH,mDAAmD;YACnD,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,WAAW,GAAG,gBAAgB,CAAC,CAAC;YACnE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;SACnD;IACL,CAAC;IACM,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * A block that throttles the execution of its output flow.\r\n */\r\nexport class FlowGraphThrottleBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The duration of the throttle, in ms.\r\n */\r\n public readonly duration: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Resets the throttle.\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: The time remaining before the throttle is done, in ms.\r\n */\r\n public readonly timeRemaining: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.duration = this.registerDataInput(\"duration\", RichTypeNumber);\r\n this.timeRemaining = this.registerDataOutput(\"timeRemaining\", RichTypeNumber);\r\n }\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const lastExecutedTime = context._getExecutionVariable(this, \"lastExecutedTime\");\r\n const durationValue = this.duration.getValue(context);\r\n const currentTime = Date.now();\r\n if (callingSignal === this.reset || lastExecutedTime === undefined || currentTime - lastExecutedTime > durationValue) {\r\n //activate the output flow\r\n this.timeRemaining.setValue(0, context);\r\n this.out._activateSignal(context);\r\n context._setExecutionVariable(this, \"lastExecutedTime\", currentTime);\r\n } else {\r\n //activate the output flow after the remaining time\r\n const remaining = durationValue - (currentTime - lastExecutedTime);\r\n this.timeRemaining.setValue(remaining, context);\r\n }\r\n }\r\n public getClassName(): string {\r\n return \"FGThrottleBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGThrottleBlock\", FlowGraphThrottleBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphThrottleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAA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CAAC;IACM,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * A block that throttles the execution of its output flow.\r\n */\r\nexport class FlowGraphThrottleBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The duration of the throttle, in ms.\r\n */\r\n public readonly duration: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Resets the throttle.\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: The time remaining before the throttle is done, in ms.\r\n */\r\n public readonly timeRemaining: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.duration = this.registerDataInput(\"duration\", RichTypeNumber);\r\n this.timeRemaining = this.registerDataOutput(\"timeRemaining\", RichTypeNumber);\r\n }\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const lastExecutedTime = context._getExecutionVariable(this, \"lastExecutedTime\");\r\n const durationValue = this.duration.getValue(context);\r\n const currentTime = Date.now();\r\n if (callingSignal === this.reset || lastExecutedTime === undefined || currentTime - lastExecutedTime > durationValue) {\r\n //activate the output flow\r\n this.timeRemaining.setValue(0, context);\r\n this.out._activateSignal(context);\r\n context._setExecutionVariable(this, \"lastExecutedTime\", currentTime);\r\n } else {\r\n //activate the output flow after the remaining time\r\n const remaining = durationValue - (currentTime - lastExecutedTime);\r\n this.timeRemaining.setValue(remaining, context);\r\n }\r\n }\r\n public getClassName(): string {\r\n return \"FGThrottleBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGThrottleBlock\", FlowGraphThrottleBlock);\r\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { FlowGraphContext } from "../../../flowGraphContext";
2
2
  import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
3
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
3
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
5
5
  /**
6
6
  * @experimental
@@ -1,4 +1,4 @@
1
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
1
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
2
2
  import { RegisterClass } from "../../../../Misc/typeStore.js";
3
3
  /**
4
4
  * @experimental
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,oCAAoC;IAW3E,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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,CAAC,EAAE,EAAE;gBACnD,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC9B;SACJ;aAAM,IAAI,aAAa,KAAK,IAAI,CAAC,EAAE,EAAE;YAClC,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,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAClC,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 { FlowGraphExecutionBlockWithOutSignal } 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 FlowGraphExecutionBlockWithOutSignal {\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.in) {\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.out._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"]}
1
+ {"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,oCAAoC;IAW3E,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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O,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,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAClC,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 { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\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 FlowGraphExecutionBlockWithOutSignal {\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.in) {\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.out._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"]}
@@ -2,7 +2,7 @@ import type { FlowGraphContext } from "../../../flowGraphContext";
2
2
  import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
3
3
  import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
5
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
5
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
6
6
  /**
7
7
  * @experimental
8
8
  * Configuration for the while loop block.
@@ -1,6 +1,6 @@
1
1
  import { RichTypeBoolean } from "../../../flowGraphRichTypes.js";
2
2
  import { RegisterClass } from "../../../../Misc/typeStore.js";
3
- import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
3
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
4
4
  /**
5
5
  * @experimental
6
6
  * A block that executes a branch while a condition is true.
@@ -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;AAG9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAYlG;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,oCAAoC;IAU7E,YAAmB,MAA8C;QAC7D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAwC;QAG7D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACtE,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,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,uBAAuB,CAAC,SAAS,CAAC;IAC7C,CAAC;IAIM,SAAS,CAAC,mBAAyB;;QACtC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,IAAI,GAAG,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,CAAC;IACjD,CAAC;;AALa,iCAAS,GAAG,kBAAkB,CAAC;AAOjD,aAAa,CAAC,uBAAuB,CAAC,SAAS,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 type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphWithOnDoneExecutionBlock\";\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 FlowGraphExecutionBlockWithOutSignal {\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.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphWhileLoopBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGWhileLoopBlock\";\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(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock);\r\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AS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,IAAI,GAAG,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,CAAC;IACjD,CAAC;;AALa,iCAAS,GAAG,kBAAkB,CAAC;AAOjD,aAAa,CAAC,uBAAuB,CAAC,SAAS,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 type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\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 FlowGraphExecutionBlockWithOutSignal {\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.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphWhileLoopBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGWhileLoopBlock\";\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(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock);\r\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { FlowGraphContext } from "../../flowGraphContext";
2
2
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
3
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphWithOnDoneExecutionBlock";
3
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
5
  /**
6
6
  * @experimental
@@ -1,4 +1,4 @@
1
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphWithOnDoneExecutionBlock.js";
1
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
2
2
  import { RichTypeAny } from "../../flowGraphRichTypes.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
4
  import { Logger } from "../../../Misc/logger.js";
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphConsoleLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAE1C;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,oCAAoC;IAM9E,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,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzB,iCAAiC;QACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,wBAAwB,CAAC,SAAS,CAAC;IAC9C,CAAC;;AAEa,kCAAS,GAAG,mBAAmB,CAAC;AAElD,aAAa,CAAC,wBAAwB,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * @experimental\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {\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 Logger.Log(messageValue);\r\n // activate the output flow block\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphConsoleLogBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGConsoleLogBlock\";\r\n}\r\nRegisterClass(FlowGraphConsoleLogBlock.ClassName, FlowGraphConsoleLogBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphConsoleLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAE1C;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,oCAAoC;IAM9E,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,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzB,iCAAiC;QACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,wBAAwB,CAAC,SAAS,CAAC;IAC9C,CAAC;;AAEa,kCAAS,GAAG,mBAAmB,CAAC;AAElD,aAAa,CAAC,wBAAwB,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * @experimental\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {\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 Logger.Log(messageValue);\r\n // activate the output flow block\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphConsoleLogBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGConsoleLogBlock\";\r\n}\r\nRegisterClass(FlowGraphConsoleLogBlock.ClassName, FlowGraphConsoleLogBlock);\r\n"]}
@@ -1,4 +1,4 @@
1
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphWithOnDoneExecutionBlock";
1
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal";
2
2
  import type { FlowGraphContext } from "../../flowGraphContext";
3
3
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { RichTypeAny } from "../../flowGraphRichTypes.js";
2
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphWithOnDoneExecutionBlock.js";
2
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
4
  /**
5
5
  * @experimental
@@ -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,oCAA0C;AAChE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yCAAyC,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAiBxD;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,oCAAoC;IACnF,YAA0B,MAAmD;QACzE,KAAK,CAAC,MAAM,CAAC,CAAC;QADQ,WAAM,GAAN,MAAM,CAA6C;IAE7E,CAAC;IAEM,SAAS;QACZ,KAAK,CAAC,SAAS,EAAE,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC1C,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;SACjD;IACL,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAEzE,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAEzE,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,6BAA6B,CAAC,SAAS,CAAC;IACnD,CAAC;;AAEa,uCAAS,GAAG,wBAAwB,CAAC;AAEvD,aAAa,CAAC,wBAAwB,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } 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 * Parameters used to create a FlowGraphSendCustomEventBlock.\r\n */\r\nexport interface IFlowGraphSendCustomEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The id of the event to send.\r\n */\r\n eventId: string;\r\n /**\r\n * The names of the data inputs for that event.\r\n */\r\n eventData: string[];\r\n}\r\n/**\r\n * @experimental\r\n */\r\nexport class FlowGraphSendCustomEventBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n public constructor(public config: IFlowGraphSendCustomEventBlockConfiguration) {\r\n super(config);\r\n }\r\n\r\n public configure(): void {\r\n super.configure();\r\n for (let i = 0; i < this.config.eventData.length; i++) {\r\n const dataName = this.config.eventData[i];\r\n this.registerDataInput(dataName, RichTypeAny);\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const eventId = this.config.eventId;\r\n const eventDatas = this.dataInputs.map((port) => port.getValue(context));\r\n\r\n context.configuration.coordinator.notifyCustomEvent(eventId, eventDatas);\r\n\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphSendCustomEventBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGSendCustomEventBlock\";\r\n}\r\nRegisterClass(\"FGSendCustomEventBlock\", FlowGraphSendCustomEventBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphSendCustomEventBlock.js","sourceRo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A6B,CAAC,CAAC","sourcesContent":["import { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\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 * Parameters used to create a FlowGraphSendCustomEventBlock.\r\n */\r\nexport interface IFlowGraphSendCustomEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The id of the event to send.\r\n */\r\n eventId: string;\r\n /**\r\n * The names of the data inputs for that event.\r\n */\r\n eventData: string[];\r\n}\r\n/**\r\n * @experimental\r\n */\r\nexport class FlowGraphSendCustomEventBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n public constructor(public config: IFlowGraphSendCustomEventBlockConfiguration) {\r\n super(config);\r\n }\r\n\r\n public configure(): void {\r\n super.configure();\r\n for (let i = 0; i < this.config.eventData.length; i++) {\r\n const dataName = this.config.eventData[i];\r\n this.registerDataInput(dataName, RichTypeAny);\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const eventId = this.config.eventId;\r\n const eventDatas = this.dataInputs.map((port) => port.getValue(context));\r\n\r\n context.configuration.coordinator.notifyCustomEvent(eventId, eventDatas);\r\n\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphSendCustomEventBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGSendCustomEventBlock\";\r\n}\r\nRegisterClass(\"FGSendCustomEventBlock\", FlowGraphSendCustomEventBlock);\r\n"]}
@@ -1,9 +1,10 @@
1
1
  import type { FlowGraphContext } from "../../flowGraphContext";
2
2
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
3
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphWithOnDoneExecutionBlock";
3
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
- import type { FlowGraphPath } from "../../flowGraphPath";
6
- import { FlowGraphPathComponent } from "../../flowGraphPathComponent";
5
+ import { FlowGraphPathConverterComponent } from "../../flowGraphPathConverterComponent";
6
+ import type { IPathToObjectConverter } from "../../../ObjectModel/objectModelInterfaces";
7
+ import type { IObjectAccessor } from "../../typeDefinitions";
7
8
  /**
8
9
  * @experimental
9
10
  * Configuration for the set property block.
@@ -13,7 +14,11 @@ export interface IFlowGraphSetPropertyBlockConfiguration extends IFlowGraphBlock
13
14
  * The path of the entity whose property will be set. Needs a corresponding
14
15
  * entity on the context variables.
15
16
  */
16
- path: FlowGraphPath;
17
+ path: string;
18
+ /**
19
+ * The path converter to use to convert the path to an object accessor.
20
+ */
21
+ pathConverter: IPathToObjectConverter<IObjectAccessor>;
17
22
  }
18
23
  /**
19
24
  * @experimental
@@ -28,10 +33,13 @@ export declare class FlowGraphSetPropertyBlock<ValueT> extends FlowGraphExecutio
28
33
  /**
29
34
  * The component with the templated inputs for the provided path.
30
35
  */
31
- readonly templateComponent: FlowGraphPathComponent;
36
+ readonly templateComponent: FlowGraphPathConverterComponent;
32
37
  constructor(config: IFlowGraphSetPropertyBlockConfiguration);
33
38
  _execute(context: FlowGraphContext): void;
34
39
  serialize(serializationObject?: any): void;
35
40
  getClassName(): string;
41
+ /**
42
+ * Class name of the block.
43
+ */
36
44
  static ClassName: string;
37
45
  }
@@ -1,7 +1,7 @@
1
1
  import { RichTypeAny } from "../../flowGraphRichTypes.js";
2
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphWithOnDoneExecutionBlock.js";
2
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
- import { FlowGraphPathComponent } from "../../flowGraphPathComponent.js";
4
+ import { FlowGraphPathConverterComponent } from "../../flowGraphPathConverterComponent.js";
5
5
  /**
6
6
  * @experimental
7
7
  * Block that sets a property on a target object.
@@ -11,21 +11,25 @@ export class FlowGraphSetPropertyBlock extends FlowGraphExecutionBlockWithOutSig
11
11
  super(config);
12
12
  this.config = config;
13
13
  this.a = this.registerDataInput("a", RichTypeAny);
14
- this.templateComponent = new FlowGraphPathComponent(config.path, this);
14
+ this.templateComponent = new FlowGraphPathConverterComponent(config.path, this);
15
15
  }
16
16
  _execute(context) {
17
17
  const value = this.a.getValue(context);
18
- this.templateComponent.setProperty(context, value);
18
+ const accessor = this.templateComponent.getAccessor(this.config.pathConverter, context);
19
+ accessor.info.set(value, accessor.object);
19
20
  this.out._activateSignal(context);
20
21
  }
21
22
  serialize(serializationObject = {}) {
22
23
  super.serialize(serializationObject);
23
- serializationObject.config.path = this.config.path.serialize();
24
+ serializationObject.config.path = this.config.path;
24
25
  }
25
26
  getClassName() {
26
27
  return FlowGraphSetPropertyBlock.ClassName;
27
28
  }
28
29
  }
30
+ /**
31
+ * Class name of the block.
32
+ */
29
33
  FlowGraphSetPropertyBlock.ClassName = "FGSetPropertyBlock";
30
34
  RegisterClass("FGSetPropertyBlock", FlowGraphSetPropertyBlock);
31
35
  //# sourceMappingURL=flowGraphSetPropertyBlock.js.map
@@ -1 +1 @@
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,oCAAoC,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AActE;;;GAGG;AACH,MAAM,OAAO,yBAAkC,SAAQ,oCAAoC;IAUvF,YAA0B,MAA+C;QACrE,KAAK,CAAC,MAAM,CAAC,CAAC;QADQ,WAAM,GAAN,MAAM,CAAyC;QAGrE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAClD,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,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAEnD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,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,yBAAyB,CAAC,SAAS,CAAC;IAC/C,CAAC;;AAEa,mCAAS,GAAG,oBAAoB,CAAC;AAEnD,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 { FlowGraphExecutionBlockWithOutSignal } 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 FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The value to set on the property.\r\n */\r\n public readonly a: 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.a = this.registerDataInput(\"a\", 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.a.getValue(context);\r\n this.templateComponent.setProperty(context, value);\r\n\r\n this.out._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 FlowGraphSetPropertyBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGSetPropertyBlock\";\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,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAoBxF;;;GAGG;AACH,MAAM,OAAO,yBAAkC,SAAQ,oCAAoC;IAUvF,YAA0B,MAA+C;QACrE,KAAK,CAAC,MAAM,CAAC,CAAC;QADQ,WAAM,GAAN,MAAM,CAAyC;QAGrE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAClD,IAAI,CAAC,iBAAiB,GAAG,IAAI,+BAA+B,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACxF,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAE1C,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,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;IACvD,CAAC;IAEM,YAAY;QACf,OAAO,yBAAyB,CAAC,SAAS,CAAC;IAC/C,CAAC;;AAED;;GAEG;AACW,mCAAS,GAAG,oBAAoB,CAAC;AAEnD,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 { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphPathConverterComponent } from \"../../flowGraphPathConverterComponent\";\r\nimport type { IPathToObjectConverter } from \"../../../ObjectModel/objectModelInterfaces\";\r\nimport type { IObjectAccessor } from \"../../typeDefinitions\";\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 path converter to use to convert the path to an object accessor.\r\n */\r\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\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 FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The value to set on the property.\r\n */\r\n public readonly a: FlowGraphDataConnection<ValueT>;\r\n /**\r\n * The component with the templated inputs for the provided path.\r\n */\r\n public readonly templateComponent: FlowGraphPathConverterComponent;\r\n\r\n public constructor(public config: IFlowGraphSetPropertyBlockConfiguration) {\r\n super(config);\r\n\r\n this.a = this.registerDataInput(\"a\", RichTypeAny);\r\n this.templateComponent = new FlowGraphPathConverterComponent(config.path, this);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const value = this.a.getValue(context);\r\n const accessor = this.templateComponent.getAccessor(this.config.pathConverter, context);\r\n accessor.info.set(value, accessor.object);\r\n\r\n this.out._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;\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphSetPropertyBlock.ClassName;\r\n }\r\n\r\n /**\r\n * Class name of the block.\r\n */\r\n public static ClassName = \"FGSetPropertyBlock\";\r\n}\r\nRegisterClass(\"FGSetPropertyBlock\", FlowGraphSetPropertyBlock);\r\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { FlowGraphContext } from "../../flowGraphContext";
2
2
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
3
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphWithOnDoneExecutionBlock";
3
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal";
4
4
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
5
5
  /**
6
6
  * @experimental
@@ -1,5 +1,5 @@
1
1
  import { RichTypeAny } from "../../flowGraphRichTypes.js";
2
- import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphWithOnDoneExecutionBlock.js";
2
+ import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
4
  /**
5
5
  * Block to set a variable.
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,oCAAoC,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAWpD;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,oCAAoC;IAMlF,YAAmB,MAA+C;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAyC;QAG9D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC1E,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QACnD,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,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,yBAAyB,CAAC,SAAS,CAAC;IAC/C,CAAC;;AAEa,mCAAS,GAAG,oBAAoB,CAAC;AAEnD,aAAa,CAAC,yBAAyB,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * The variable block configuration.\r\n */\r\nexport interface IFlowGraphSetVariableBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n variableName: string;\r\n}\r\n\r\n/**\r\n * Block to set a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphSetVariableBlock<T> extends FlowGraphExecutionBlockWithOutSignal {\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(public config: IFlowGraphSetVariableBlockConfiguration) {\r\n super(config);\r\n\r\n this.input = this.registerDataInput(config.variableName, RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const variableNameValue = this.config.variableName;\r\n const inputValue = this.input.getValue(context);\r\n context.setVariable(variableNameValue, inputValue);\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphSetVariableBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGSetVariableBlock\";\r\n}\r\nRegisterClass(FlowGraphSetVariableBlock.ClassName, FlowGraphSetVariableBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphSetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAWpD;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,oCAAoC;IAMlF,YAAmB,MAA+C;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAyC;QAG9D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC1E,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QACnD,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,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,yBAAyB,CAAC,SAAS,CAAC;IAC/C,CAAC;;AAEa,mCAAS,GAAG,oBAAoB,CAAC;AAEnD,aAAa,CAAC,yBAAyB,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * The variable block configuration.\r\n */\r\nexport interface IFlowGraphSetVariableBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n variableName: string;\r\n}\r\n\r\n/**\r\n * Block to set a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphSetVariableBlock<T> extends FlowGraphExecutionBlockWithOutSignal {\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(public config: IFlowGraphSetVariableBlockConfiguration) {\r\n super(config);\r\n\r\n this.input = this.registerDataInput(config.variableName, RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const variableNameValue = this.config.variableName;\r\n const inputValue = this.input.getValue(context);\r\n context.setVariable(variableNameValue, inputValue);\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphSetVariableBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGSetVariableBlock\";\r\n}\r\nRegisterClass(FlowGraphSetVariableBlock.ClassName, FlowGraphSetVariableBlock);\r\n"]}
@@ -5,7 +5,8 @@ import { FlowGraphBlock } from "./flowGraphBlock";
5
5
  import type { FlowGraphCoordinator } from "./flowGraphCoordinator";
6
6
  import type { FlowGraphSignalConnection } from "./flowGraphSignalConnection";
7
7
  import type { FlowGraphDataConnection } from "./flowGraphDataConnection";
8
- import type { ISerializedFlowGraph } from "./typeDefinitions";
8
+ import type { ISerializedFlowGraph, IObjectAccessor } from "./typeDefinitions";
9
+ import type { IPathToObjectConverter } from "../ObjectModel/objectModelInterfaces";
9
10
  export declare enum FlowGraphState {
10
11
  /**
11
12
  * The graph is stopped
@@ -20,7 +21,7 @@ export declare enum FlowGraphState {
20
21
  * @experimental
21
22
  * Parameters used to create a flow graph.
22
23
  */
23
- export interface FlowGraphParams {
24
+ export interface IFlowGraphParams {
24
25
  /**
25
26
  * The scene that the flow graph belongs to.
26
27
  */
@@ -30,6 +31,24 @@ export interface FlowGraphParams {
30
31
  */
31
32
  coordinator: FlowGraphCoordinator;
32
33
  }
34
+ /**
35
+ * @experimental
36
+ * Options for parsing a flow graph.
37
+ */
38
+ export interface IFlowGraphParseOptions {
39
+ /**
40
+ * A function that parses complex values in a scene.
41
+ */
42
+ valueParseFunction?: (key: string, serializationObject: any, scene: Scene) => any;
43
+ /**
44
+ * The flow graph coordinator.
45
+ */
46
+ coordinator: FlowGraphCoordinator;
47
+ /**
48
+ * A function that converts a path to an object accessor.
49
+ */
50
+ pathConverter: IPathToObjectConverter<IObjectAccessor>;
51
+ }
33
52
  /**
34
53
  * @experimental
35
54
  * Class used to represent a flow graph.
@@ -55,7 +74,7 @@ export declare class FlowGraph {
55
74
  * Construct a Flow Graph
56
75
  * @param params construction parameters. currently only the scene
57
76
  */
58
- constructor(params: FlowGraphParams);
77
+ constructor(params: IFlowGraphParams);
59
78
  /**
60
79
  * Create a context. A context represents one self contained execution for the graph, with its own variables.
61
80
  * @returns the context, where you can get and set variables
@@ -105,9 +124,8 @@ export declare class FlowGraph {
105
124
  /**
106
125
  * Parses a graph from a given serialization object
107
126
  * @param serializationObject the object where the values are written
108
- * @param coordinator the flow graph coordinator
109
- * @param valueParseFunction a function to parse complex values in a scene
127
+ * @param options options for parsing the graph
110
128
  * @returns
111
129
  */
112
- static Parse(serializationObject: ISerializedFlowGraph, coordinator: FlowGraphCoordinator, valueParseFunction?: (key: string, serializationObject: any, scene: Scene) => any): FlowGraph;
130
+ static Parse(serializationObject: ISerializedFlowGraph, options: IFlowGraphParseOptions): FlowGraph;
113
131
  }
@@ -4,6 +4,7 @@ import { FlowGraphBlock } from "./flowGraphBlock.js";
4
4
  import { FlowGraphExecutionBlock } from "./flowGraphExecutionBlock.js";
5
5
  import { FlowGraphMeshPickEventBlock } from "./Blocks/Event/flowGraphMeshPickEventBlock.js";
6
6
  import { _isADescendantOf } from "./utils.js";
7
+ import { defaultValueParseFunction } from "./serialization.js";
7
8
  export var FlowGraphState;
8
9
  (function (FlowGraphState) {
9
10
  /**
@@ -57,8 +58,6 @@ export class FlowGraph {
57
58
  * @param block
58
59
  */
59
60
  addEventBlock(block) {
60
- // todo: when adding a mesh pick block, check if the target of the pick is child of a mesh that is already on the list
61
- // if it is, put the child before the parent
62
61
  this._eventBlocks.push(block);
63
62
  }
64
63
  /**
@@ -73,22 +72,22 @@ export class FlowGraph {
73
72
  this.createContext();
74
73
  }
75
74
  for (const context of this._executionContexts) {
76
- const contextualOrder = this._getContextualOrder(context);
75
+ const contextualOrder = this._getContextualOrder();
77
76
  for (const block of contextualOrder) {
78
77
  block._startPendingTasks(context);
79
78
  }
80
79
  }
81
80
  }
82
- _getContextualOrder(context) {
81
+ _getContextualOrder() {
83
82
  const order = [];
84
83
  for (const block1 of this._eventBlocks) {
85
84
  // If the block is a mesh pick, guarantee that picks of children meshes come before picks of parent meshes
86
85
  if (block1.getClassName() === FlowGraphMeshPickEventBlock.ClassName) {
87
- const mesh1 = block1._getReferencedMesh(context);
86
+ const mesh1 = block1._getReferencedMesh();
88
87
  let i = 0;
89
88
  for (; i < order.length; i++) {
90
89
  const block2 = order[i];
91
- const mesh2 = block2._getReferencedMesh(context);
90
+ const mesh2 = block2._getReferencedMesh();
92
91
  if (mesh1 && mesh2 && _isADescendantOf(mesh1, mesh2)) {
93
92
  break;
94
93
  }
@@ -207,16 +206,17 @@ export class FlowGraph {
207
206
  /**
208
207
  * Parses a graph from a given serialization object
209
208
  * @param serializationObject the object where the values are written
210
- * @param coordinator the flow graph coordinator
211
- * @param valueParseFunction a function to parse complex values in a scene
209
+ * @param options options for parsing the graph
212
210
  * @returns
213
211
  */
214
- static Parse(serializationObject, coordinator, valueParseFunction) {
215
- const graph = coordinator.createGraph();
212
+ static Parse(serializationObject, options) {
213
+ var _a;
214
+ const graph = options.coordinator.createGraph();
216
215
  const blocks = [];
216
+ const valueParseFunction = (_a = options.valueParseFunction) !== null && _a !== void 0 ? _a : defaultValueParseFunction;
217
217
  // Parse all blocks
218
218
  for (const serializedBlock of serializationObject.allBlocks) {
219
- const block = FlowGraphBlock.Parse(serializedBlock, coordinator.config.scene, valueParseFunction);
219
+ const block = FlowGraphBlock.Parse(serializedBlock, { scene: options.coordinator.config.scene, pathConverter: options.pathConverter, valueParseFunction });
220
220
  blocks.push(block);
221
221
  if (block instanceof FlowGraphEventBlock) {
222
222
  graph.addEventBlock(block);
@@ -240,7 +240,7 @@ export class FlowGraph {
240
240
  }
241
241
  }
242
242
  for (const serializedContext of serializationObject.executionContexts) {
243
- FlowGraphContext.Parse(serializedContext, graph, valueParseFunction);
243
+ FlowGraphContext.Parse(serializedContext, { graph, valueParseFunction });
244
244
  }
245
245
  return graph;
246
246
  }