At this point, only text and textbin contents are still in google drive. Which is the majority of the file still. Renderer and Pagecount may become useful for Vault page, and Renderer is needed for themes.
Now that we have a dedicated /theme/ route for the recursive theming, the CSS endpoint can be simpler for only getting the `style` of a single brew. #3075 already has this simpler version, but no testing, so I have copied this into a comment there for implementation when it is ready.
Original handling of snippets only worked if the current selected theme was a staticTheme. This now fully merges all snippets through the theme chain no matter what the top-level theme is. So user themes built on 5ePHB can benefit from 5ePHB snippets too.
User input of user snippets will be a later PR, but merging them into static snippets is now supported.
Each theme in the theme chain, including user brews, must use the same renderer. When moving to V4 or future versions, it will be important to distinguish which themes are compatible with each other
Since /edit and /new endpoints now have an `await` inside that could return an error (`getUsersBrewThemes()`), asyncHandler must be added to pass errors along instead of just crashing
`getBrew()` should do one thing only; retrieve a brew. UI elements like the list of themes available to the user are not part of a brew.
Moved into the handers for the `/edit/` and `/new/` endpoints
This removes the existing endpoints and replaces them with /theme.
/theme/:id - return a theme bundle containing all styling from this USER theme and any parents.
/theme/:engine/:id - return a theme bundle containing all styling from this STATIC theme and any parents
The theme bundle returns a marshalled JSON object containing:
styles - an array of strings representing the collected styles in loading order
snippets - an array ( currently empty ) of collected snippets.
The various bits of theme rendering code for <style> an style <link> have been swapped out with an 'onDidMount' call that loads the thendpoint and appends a series of <style> blocks to the brewRender's head.
This loses some caching advantages, but probably won't matter in the long run.
rename `getStaticTheme` to `getStaticThemeCSS`
rename `getBrewThemeWithCSS` to `getBrewThemeCSS`
rename `getBrewThemeParent` to `getBrewThemeParentCSS`
to avoid confusion with other "get" endpoints like `getBrew`, and unify naming for endpoint functions that return CSS.
Simplify `isStaticTheme` function (getting the parent theme is handled elsewhere)