0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-25 22:42:41 +00:00
Commit Graph

5460 Commits

Author SHA1 Message Date
Trevor Buckner
460358ce1f Simplify some logic 2024-07-19 00:09:21 -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
d741878f78 Also remove userthemes from Brew object in sharePage 2024-07-19 00:00:06 -04:00
Trevor Buckner
d22cd88446 fix crash in metadataeditor 2024-07-15 23:47:19 -04:00
Trevor Buckner
1444581c86 pass userThemes prop to Editor -> MetadataEditor 2024-07-15 23:44:07 -04:00
Trevor Buckner
dfbd85a8ce pass userThemes as a new prop, rather than inside of the brew 2024-07-15 23:29:16 -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
4951b9bf1a Add async error handler to /edit and /new
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
2024-07-13 19:46:12 -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
f392216ff4 Spacing 2024-07-13 18:08:29 -04:00
Trevor Buckner
591cae0e8f more renaming engine to renderer 2024-07-13 18:08:00 -04:00
Trevor Buckner
e222811d03 Rename engine to renderer to unify naming
This value is named `renderer` everywhere else. Relabeling to a consistent name.
2024-07-13 18:06:46 -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
2fa3c0f311 themeClass is never used 2024-07-11 00:26:50 -04:00
Trevor Buckner
5c0a072115 userThemes passed to SnippetBar.jsx is never used 2024-07-11 00:25:11 -04: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
24c86dd199 Remove unused test 2024-07-10 17:49:57 -04:00
Trevor Buckner
7eb96ee6be Simplify brewRenderer output to only emit current theme
Instead of Blank, Parent, and Theme, just make use of the @include chaining, to handle all parent themes down to and including Blank
2024-07-10 17:46:51 -04:00
Trevor Buckner
27aebf0e3b Give 5ePHB and Journal themes a baseTheme of "Blank" 2024-07-10 17:15:45 -04:00
Trevor Buckner
88578a3d16 Fix failing test 2024-07-10 14:22:42 -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
ea6595d4d6 Merge branch 'master' into brew_themes_user_selection
Fixes a regression for legacy brews.
2024-07-07 12:03:15 -05:00
Trevor Buckner
5b02132e57 Merge pull request #3561 from naturalcrit/v3.13.1
Up Version to 3.13.1
2024-07-06 18:20:34 -04:00
Trevor Buckner
f8841c068f Up Version to 3.13.1 v3.13.1 2024-07-06 18:20:11 -04:00
Trevor Buckner
da1d08f8a9 Merge pull request #3560 from G-Ambatte/fixAttributeLeaking-#3559
Limit htmlString to the first element ONLY
2024-07-06 18:01:26 -04:00
Trevor Buckner
0a199e750f Simplify string splitting code
String.split will return the substring before > or the whole string if no > exists.
2024-07-06 18:00:18 -04:00
Trevor Buckner
5433cda52f Add test case 2024-07-06 17:05:23 -04:00
G.Ambatte
9c4de58161 Limit htmlString to the first element ONLY 2024-07-06 13:22:47 +12:00
Trevor Buckner
1b96dae27f Merge pull request #3543 from naturalcrit/dependabot/npm_and_yarn/googleapis/drive-8.11.0
Bump @googleapis/drive from 8.10.0 to 8.11.0
2024-07-05 18:09:10 -04:00
David Bolack
16ca52756d Merge branch 'master' into brew_themes_user_selection 2024-07-05 16:55:14 -05:00
David Bolack
645da7ae5f Merge branch 'brew_themes_user_selection' of github.com:dbolack-ab/homebrewery into brew_themes_user_selection 2024-07-05 16:54:11 -05:00
David Bolack
8570335d79 Consolidate variable redundancy. 2024-07-05 16:53:21 -05:00
dependabot[bot]
1564bc7448 Bump @googleapis/drive from 8.10.0 to 8.11.0
Bumps [@googleapis/drive](https://github.com/googleapis/google-api-nodejs-client) from 8.10.0 to 8.11.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/main/release-please-config.json)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/drive-v8.10.0...drive-v8.11.0)

---
updated-dependencies:
- dependency-name: "@googleapis/drive"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-05 18:59:10 +00:00
Trevor Buckner
8e20d3ba10 Merge pull request #3539 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.34.3
Bump eslint-plugin-react from 7.34.2 to 7.34.3
2024-07-05 14:57:59 -04:00
dependabot[bot]
450baee66a Bump eslint-plugin-react from 7.34.2 to 7.34.3
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.34.2 to 7.34.3.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.34.2...v7.34.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-05 18:55:32 +00:00
Trevor Buckner
4b588786c4 Merge pull request #3538 from naturalcrit/dependabot/npm_and_yarn/ws-7.5.10
Bump ws from 7.5.9 to 7.5.10
2024-07-05 14:54:32 -04:00
dependabot[bot]
e07a04ebfa Bump ws from 7.5.9 to 7.5.10
Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.5.9...7.5.10)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-05 18:53:33 +00:00
Trevor Buckner
f707752c26 Merge pull request #3558 from naturalcrit/dependabot/npm_and_yarn/mongoose-8.4.5
Bump mongoose from 8.4.1 to 8.4.5
2024-07-05 14:52:35 -04:00
dependabot[bot]
80e039b194 Bump mongoose from 8.4.1 to 8.4.5
Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.4.1 to 8.4.5.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/8.4.1...8.4.5)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-05 18:41:01 +00:00
Trevor Buckner
c888df28aa Merge pull request #3533 from naturalcrit/dependabot/npm_and_yarn/marked-emoji-1.4.1
Bump marked-emoji from 1.4.0 to 1.4.1
2024-07-05 14:39:58 -04:00