I'm looking for an efficient way to define and set toolbars/docked cells for paclets. I know about TextResources folder, but it seems that one needs to put there definitions in terms of box expressions, which I dislike because: 1. It makes it more difficult to modify, especially when the toolbar contains dynamic elements which should extract some elements (say section names) from the notebook. 2. It appears that I could just as well put the expressions in terms of boxes in the stylesheet itself, without loading from resource file.
I've tried defining the toolbar within the main part of the paclet (in .m/.wl file), but this requires importing the package twice to initialize the toolbar properly. Is there a better solution?