Commit Graph
100 Commits
Author SHA1 Message Date
Trevor Buckner 11f8809c5e Merge pull request #3606 from naturalcrit/FixUserThemesCrashes
Fix user themes crashes
2024-07-31 17:05:52 -04:00
Trevor Buckner 27a4831ea0 Add a theme to our reference pages (changelog, FAQ, migrate) 2024-07-31 16:53:54 -04:00
Trevor Buckner 1abced20d6 Do not fetch user themes if there is no user. 2024-07-31 16:53:34 -04:00
Trevor Buckner 1c1d331df9 Merge pull request #3597 from naturalcrit/v3.14.0
Up to v3.14.0
2024-07-29 21:55:19 -04:00
Trevor Buckner 8609925da8 Merge branch 'master' into v3.14.0 2024-07-29 21:54:38 -04:00
Trevor Buckner 607244d6e1 Merge pull request #3321 from dbolack-ab/brew_themes_user_selection
Enable User Brew theme selection
2024-07-29 21:54:28 -04:00
Trevor Buckner 9cc81d2ff9 Up to v3.14.0 2024-07-29 21:52:09 -04:00
Trevor Buckner 32fa50d608 Fallback to showing "Blank" theme if themes fail to load. 2024-07-29 12:30:13 -04:00
Trevor Buckner 8221579b6a Linting 2024-07-28 18:03:25 -04:00
Trevor Buckner 88eaebfd49 Raise test coverage threshold
This PR adds tests which means we are now covering a larger % of the codebase. Raise the coverage thresholds to match.
2024-07-28 18:00:33 -04:00
Trevor Buckner ee9f2c8c83 Remove unused CSS endpoints in favor of #3075
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.
2024-07-28 17:53:25 -04:00
Trevor Buckner 2870caaae6 Clean up metadataEditor theme dropdown 2024-07-28 17:18:30 -04:00
Trevor Buckner e0425ec6c0 Simplify API call url 2024-07-28 16:47:16 -04:00
Trevor Buckner 8aa88a2e45 Add proper error popup when theme fails to load 2024-07-28 16:45:01 -04:00
Trevor Buckner edec9369ec Finish adding test cases 2024-07-27 19:17:19 -04:00
Trevor Buckner f2d933410e Add error handling for missing themes 2024-07-27 19:17:05 -04:00
Trevor Buckner b64a0c5200 Start adding tests for /theme/ endpoint 2024-07-27 03:30:51 -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 ddc5693778 revert package-lock 2024-07-23 17:31:07 -04:00
Trevor Buckner 82f73fb21d cleanup 2024-07-23 17:24:50 -04:00
Trevor Buckner 27c52fc244 Fix loading CSS for Legacy 2024-07-23 17:11:48 -04:00
Trevor Buckner ac82e3ecb2 Add to home page 2024-07-23 16:50:29 -04:00
Trevor Buckner 22b6aa14f0 Add to /new page 2024-07-23 16:43:23 -04:00
Trevor Buckner 24ab3d3392 Merge branch 'brew_themes_user_selection' of https://github.com/dbolack-ab/homebrewery into pr/3321 2024-07-23 16:26:35 -04:00
Trevor Buckner 0b01f27d11 Load theme bundles on /share page 2024-07-23 16:26:33 -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 45f7080afd Move loadAllBrewStylesAndSnippets to the parent page component
Themes contain both CSS and Snippets. The brewRenderer only cares about the CSS, but other components need the Snippets. Better to have the parent "editPage", etc. load the theme bundles and pass them down to each child that needs it, rather than trying to pass from the child up.

This also fixes the `metadataEditor.jsx` not being able to change themes live; A new theme bundle is now loaded when a new theme is selected, instead of only the first time the BrewRenderer mounts.

Also renamed to "fetchThemeBundle"
2024-07-21 16:25:24 -04:00
Trevor Buckner 0a5ff213de use same theme endpoint for user and static themes
`getThemeBundle()` rework no longer needs two separate endpoints
2024-07-20 11:39:23 -04:00
Trevor Buckner f364f054f8 restore renderStyle
`renderStyle` is still necessary; it allows us to update the style live in the component render step as the user types into the style tab. Otherwise the style is only rendered once and never updates.

React also discourages directly editing the DOM ourselves, because it makes changes to the DOM that react cannot track; we should aim to provide all DOM writes inside of the component render function instead of using `document.createElement`, etc.

Too that end, this commit reduces the `loadAllStylesAndSnippets` function to just fetch and parse the data; actual rendering is moved back to `renderStyle()`
2024-07-19 01:33:56 -04:00
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
Trevor Buckner 4fe38e3929 Merge pull request #3567 from G-Ambatte/fixUglyDropCap-#3551
Add additional styles to SolberaImitationRemake font declaration
2024-07-11 09:47:26 -04:00
Trevor Buckner b6d69173cd Merge branch 'master' into fixUglyDropCap-#3551 2024-07-11 09:46:45 -04:00
Trevor Buckner 8b085e1806 Merge pull request #3569 from G-Ambatte/fixBrewItemLinkUnderlining-#3568
Unset text-decoration on Brew Item links
2024-07-11 09:46:36 -04: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
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 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
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
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
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
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
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
Trevor Buckner 94cc1c642c Merge branch 'master' into dependabot/npm_and_yarn/marked-emoji-1.4.1 2024-07-05 09:03:10 -04:00
Trevor Buckner 9a02a351fa Merge pull request #3528 from naturalcrit/dependabot/npm_and_yarn/marked-gfm-heading-id-3.2.0
Bump marked-gfm-heading-id from 3.1.3 to 3.2.0
2024-07-05 09:02:39 -04:00
Trevor Buckner e987da498b Merge pull request #3557 from naturalcrit/dependabot/npm_and_yarn/react-router-dom-6.24.1
Bump react-router-dom from 6.23.1 to 6.24.1
2024-07-03 23:20:35 -04:00
Trevor Buckner e4bde91f6a Merge branch 'master' into brew_themes_user_selection 2024-07-02 12:04:17 -04:00
Trevor Buckner 3eb071fbdc Merge pull request #3555 from G-Ambatte/fixToC-#3548
Fix ToC generator snippet
2024-07-02 11:55:39 -04:00
Trevor Buckner 81e17b420c Merge branch 'master' into fixToC-#3548 2024-07-02 11:55:31 -04:00
Trevor Buckner e8ccd094e8 Merge pull request #3552 from naturalcrit/Allow=InAttributes
Allow `=` in attributes
2024-07-02 11:54:59 -04:00
Trevor Buckner 2d570924d1 Add tests 2024-07-01 12:21:36 -04:00
Trevor Buckner 8ee70b0928 Only split curly attributes on on first =, allow ?, = in attributes 2024-07-01 12:21:29 -04:00
Trevor Buckner 2cdd65b083 revert DOMPURIFY for now 2024-06-29 11:29:31 -04:00
Trevor Buckner 758a06e58a Merge pull request #3545 from naturalcrit/3.13.0
Up version to 3.13.0
2024-06-28 22:47:31 -04:00
Trevor Buckner a87e420437 Up version to 3.13.0 2024-06-28 22:46:56 -04:00
Trevor Buckner 46085c8d44 Merge pull request #3544 from naturalcrit/unifyEmojiFontSpacing
Unify some emoji CSS across fonts
2024-06-28 22:02:19 -04:00
Trevor Buckner 179e21755c Unify some emoji CSS across fonts 2024-06-28 22:01:55 -04:00
Trevor Buckner e9ca68e7d3 Merge pull request #3261 from dbolacksn/issue_2994_css_style
Table of Contents Snippet exclusion system
2024-06-28 11:05:14 -04:00
Trevor Buckner 9886200fa9 Fix partCover H1 inclusion rule 2024-06-28 09:39:49 -04:00
Trevor Buckner 9a1070bb06 Merge branch 'master' into issue_2994_css_style 2024-06-27 17:22:23 -04:00
Trevor Buckner 35ae5e09ee Merge branch 'master' into issue_2994_css_style 2024-06-07 15:04:26 -04:00
Trevor Buckner 552a23585b Merge pull request #3524 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-jest-28.6.0
Bump eslint-plugin-jest from 28.5.0 to 28.6.0
2024-06-07 13:56:12 -04:00
Trevor Buckner e635877b66 Merge branch 'master' into dependabot/npm_and_yarn/eslint-plugin-jest-28.6.0 2024-06-07 13:53:49 -04:00
Trevor Buckner 954bcbdaf6 Merge pull request #3523 from naturalcrit/dependabot/npm_and_yarn/googleapis/drive-8.10.0
Bump @googleapis/drive from 8.8.0 to 8.10.0
2024-06-07 13:53:38 -04:00
Trevor Buckner ea380ae6a9 Merge pull request #3521 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.24.7
Bump @babel/preset-env from 7.24.5 to 7.24.7
2024-06-07 12:43:17 -04:00
Trevor Buckner 75926e34a2 Merge pull request #3520 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.24.7
Bump @babel/core from 7.24.5 to 7.24.7
2024-06-07 12:27:07 -04:00
Trevor Buckner 528359dd9f Merge pull request #3519 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.24.7
Bump @babel/plugin-transform-runtime from 7.24.3 to 7.24.7
2024-06-07 12:04:28 -04:00
Trevor Buckner 2d9b80a81e Merge pull request #3510 from naturalcrit/dependabot/npm_and_yarn/dompurify-3.1.5
Bump dompurify from 3.1.4 to 3.1.5
2024-06-07 11:58:48 -04:00
Trevor Buckner 299acfb92c Merge branch 'master' into dependabot/npm_and_yarn/dompurify-3.1.5 2024-06-07 11:53:17 -04:00
Trevor Buckner 8fc97493c5 Merge pull request #3500 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.34.2
Bump eslint-plugin-react from 7.34.1 to 7.34.2
2024-06-07 11:53:05 -04:00