0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00
Commit Graph

244 Commits

Author SHA1 Message Date
Trevor Buckner
f2d933410e Add error handling for missing themes 2024-07-27 19:17:05 -04:00
Trevor Buckner
113f9b3fe3 No need to stringify Theme Bundle object 2024-07-27 02:00:38 -04:00
Trevor Buckner
8e7baca47d Fix tests 2024-07-23 17:40:32 -04:00
Trevor Buckner
27c52fc244 Fix loading CSS for Legacy 2024-07-23 17:11:48 -04:00
Trevor Buckner
6ae249a527 Lint 2024-07-22 02:46:26 -04:00
Trevor Buckner
c0123b96eb Support snippet compilation
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.
2024-07-22 02:44:41 -04:00
Trevor Buckner
0448f15322 Classify user brews as V3 if they use V3
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
2024-07-19 00:05:45 -04:00
Trevor Buckner
af5434c9b7 cleanup 2024-07-15 16:45:55 -04:00
Trevor Buckner
484b0a6dff simplify getThemeBundle() by using just one loop
Also, removes need for special handling of the "first" theme.
2024-07-15 16:38:19 -04:00
Trevor Buckner
62c619de24 userThemes need not be nested inside a Brew object 2024-07-13 19:38:51 -04:00
Trevor Buckner
44c96aad04 spacing 2024-07-13 18:11:04 -04:00
Trevor Buckner
591cae0e8f more renaming engine to renderer 2024-07-13 18:08:00 -04:00
Trevor Buckner
c9b885f868 include theme as baseTheme when getting user brew themes
`baseTheme` for a user brew theme is just the `theme` value of that brew.
2024-07-13 18:01:50 -04:00
Trevor Buckner
47f912750b Extract getting userThemes from getBrew()
`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
2024-07-13 17:44:23 -04:00
Trevor Buckner
f29a5e346e Remove id parameter from getUsersBrewThemes
Filtering out the current brew can be done later as needed; certain situations may call for retrieving the whole list.
2024-07-13 17:35:19 -04:00
Trevor Buckner
ee381c91fe Simplify getUserBrewThemes function a bit 2024-07-13 17:26:38 -04:00
Trevor Buckner
5f8d46f1b6 Reuse splitTextStyleAndMetadata from helpers.js 2024-07-13 17:09:45 -04:00
David Bolack
ade819c70c A not so light rework.
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.
2024-07-13 12:12:05 -05:00
Trevor Buckner
29c2274a19 Unify some variable naming 2024-07-10 18:54:45 -04:00
Trevor Buckner
a6f787ea8f Remove getBrewThemeParentCSS 2024-07-10 17:56:39 -04:00
Trevor Buckner
28446d3ae2 Comments for theme CSS endpoints 2024-07-10 14:21:23 -04:00
Trevor Buckner
a247e50c9f renaming "get" functions
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)
2024-07-10 14:15:03 -04:00
David Bolack
656edb07ea Rework detection of user brews to look up themeid in static themes list before assuming is a user brew.
Ended up being a fairly straightforward change. A few ternaries got smooshed or inverted. Passes builtin and local tests. Need to compare on the test instance.
2024-07-08 18:12:58 -05:00
David Bolack
0945a5e47e Merge branch 'master' into brew_themes_user_selection 2024-06-13 15:15:30 -05:00
David Bolack
5442f232d5 Merge branch 'master' into brew_themes_user_selection 2024-05-31 22:32:14 -05:00
Trevor Buckner
e62e185214 Lint a bunch of things 2024-05-21 17:32:17 -04:00
David Bolack
c6f62142e1 Change the ID used for User Brews to the shareId for future-proofing. 2024-05-17 20:53:06 -05:00
David Bolack
66e39d9c65 Update Theme Selector display
For User/Brew Themes, display the first author instead of Brew/V3 in the first column.
2024-05-13 22:24:41 -05:00
David Bolack
b6c2f96b82 Change tag filtering for theme detection to require meta prefix 2024-05-10 01:40:01 -04:00
David Bolack
65495b4e7c Prevent Legacy renderer brews from being listed as themes. 2024-05-08 12:51:10 -05:00
David Bolack
9f04c34b06 Missed $ 2024-05-06 20:07:33 -05:00
David Bolack
c9d416fec0 Small User Brew theme changes.
Move the Static Theme shortcut to getBrewThemeWithCSS to drop an unneeded URL load.

Change the comment in the CSS to refer to the shareURL for the theme
instead of its name if it is a user theme.
2024-05-06 19:39:27 -05:00
David Bolack
3dde6a098c Test code to reduce duplicate theme loading
This shorts out loading of 5ePHB and/or blank from getBrewThemeParent
2024-05-06 12:12:46 -05:00
G.Ambatte
4c6953a4e0 Differentiate between Edit and Share messages 2024-04-20 13:57:33 +12:00
David Bolack
1292d9ad9b Merge branch 'master' into brew_themes_user_selection 2024-04-18 21:13:01 -05:00
Trevor Buckner
7097897df8 Remove "stub.published" from thrown error, since no longer used 2024-04-09 15:24:04 -04:00
Víctor Losada Hernández
99f9b10348 initial commit 2024-04-07 16:16:21 +02:00
David Bolack
57f0aefbc8 Merge branch 'master' into brew_themes_user_selection 2024-03-25 20:38:28 -05:00
G.Ambatte
21c0916693 Switch to boolean lock state 2024-03-17 21:34:31 +13:00
David Bolack
e487f9a951 Fix remaining jest issues 2024-03-06 23:27:43 -06:00
David Bolack
eb4ecf853b Fix Jest issues I was able to understand 2024-03-06 22:50:24 -06:00
David Bolack
54e2deaddc Merge branch 'master' into brew_themes_user_selection 2024-03-06 19:28:37 -06:00
David Bolack
a666c8def3 Heroku debug 2024-03-06 19:20:16 -06:00
David Bolack
87502f4249 Heavy rework for usertheme parents. 2024-03-06 18:55:12 -06:00
David Bolack
9adafbd473 more heroku debug 2024-03-06 14:12:13 -06:00
David Bolack
47ea2f6ed7 more heroku debug 2024-03-06 14:04:16 -06:00
David Bolack
e2ba0ec059 more heroku debug 2024-03-06 13:59:36 -06:00
David Bolack
870cbc103d more heroku debug 2024-03-06 13:57:32 -06:00
David Bolack
dfca664f6e more heroku debug 2024-03-06 13:53:54 -06:00
David Bolack
00cfd427b1 more heroku debug 2024-03-06 13:47:40 -06:00