Preheat oven to 200°C.
Melt the butter in a saucepan over medium heat. Add the onions and brown sugar. Season with salt, pepper and thyme. Sauté for 8-10 minutes, stirring occasionally until the onions become tender and start to caramelise.
Add the white wine. Bring back to the boil and simmer a further 5-8 minutes until the onions are wilted and caramelised throughout.
Remove from the heat and set them aside to cool.
Prepare the mascarpone mixture. In a bowl, combine the mascarpone, egg yolk, salt and pepper and a tablespoon of the caramelised onions.
Place the puff pastry on a work surface and roll onto a rectangle. Transfer on a sheet of parchment paper.
Leaving 1 cm of pastry uncovered around the edges, spread the mascarpone mixture then scatter extra caramelised onions. Using the parchment paper, roll the dough to create a pinwheel. Tightly close the parchment paper around the pinwheel and place in the fridge for 20-30 minute to allow the pastry to set again.
Remove from the fridge and slice into portions or 1-2 cm long. Place on a baking tray, scatter some sunflower seeds and bake for 15 to 25 minutes, until the pastry has puffed up, turned golden, and crisped.
Remove from the oven and sprinkle the chopped spring onions.
Serve warm or at room temperature.