Commit Graph
100 Commits
Author SHA1 Message Date
Gazook89 6e86b1001c Update package-lock.json 2026-06-10 12:34:14 -05:00
Gazook89 80e14898be Update package-lock.json 2026-06-10 12:31:29 -05:00
Gazook89 e02ce4f898 Merge remote-tracking branch 'upstream/master' 2026-06-10 12:30:33 -05:00
Gazook89 1861d036b9 add key to dropdown menuitem 2026-06-09 06:25:31 -05:00
Gazook89 a3469a172a Move tests to tests/components directory 2026-05-29 15:58:00 -05:00
Gazook89 cf8f809eec Cleanup some loose ends. 2026-05-29 15:57:41 -05:00
Gazook89 03890fd329 Update package-lock.json 2026-05-29 13:03:40 -05:00
Gazook89 9c21e6dc8e update the reset to better vertically align icons 2026-05-29 11:38:14 -05:00
Gazook89 fa07af2d82 Add tests for the Dropdown structure and behavior
Largely this is written by an LLM after I provided the targets, and I've looked through the tests themselves to confirm they are accurate.  There may be improvements in how to actually *set up* the tests, though, as I am less familiar with those.

This has two test suites:  the first for html structure, the second for behavior.  Each of them calls another script that provides helper functions for setting things up and taking them down.  This keeps the test suites themselves fairly lean.
2026-05-29 11:08:05 -05:00
Gazook89 f716c390b9 Add some defaults to dropdown 2026-05-29 10:54:58 -05:00
Gazook89 e7df5d1160 remove experimental/beta tags on snippets. 2026-05-28 21:28:52 -05:00
Gazook89 bb3f6fe642 remove nonexistent icons. 2026-05-28 21:05:12 -05:00
Gazook89 af0804fd6f Remove non-existent icons 2026-05-28 11:46:12 -05:00
Gazook89 c12a188196 Be sure snippet icon is getting passed in 2026-05-28 11:45:14 -05:00
Gazook89 13196941eb popovertarget is typically not camelcase in html 2026-05-28 11:43:33 -05:00
Gazook89 3110d2cc69 Add icons to menu triggers
This fixes the odd alignments of menu-wrapper names by ensuring that both menuitems and menu-wrappers (actually their child triggers) both have space for icons.
2026-05-28 11:43:05 -05:00
Gazook89 2e4439c9f4 Remove ID collisions on repeated menu names
Add React `useId()` method, safely stripped of invalid characters for use in CSS/HTML, to make each trigger/menu unique to avoid collisions.
2026-05-28 11:41:27 -05:00
Gazook89 5e122626d4 Merge branch 'master' into Better-Dropdowns 2026-05-27 22:22:34 -05:00
Gazook89 2812f30ac1 Merge remote-tracking branch 'upstream/master' 2026-05-27 22:21:54 -05:00
Gazook89 612614fa12 menu items dismiss menu on click by default
Unless a menu item has the `no-dismiss` attribute (set to either `''` or `'true'`), clicking a menu item will dismiss the menu.  Clicking a submenu trigger will not dismiss the menu.

The `no-dismiss` attribute must take a string, either empty or `'true'` because react doesn't allow boolean custom attributes.
2026-05-27 22:21:28 -05:00
Gazook89 f5acb27c34 Revert "Fix font snippet "Open Sans""
This reverts commit 34d634a349.
2026-05-05 22:38:43 -05:00
Gazook89 a34a5d187b Fix issue with closing brace not highlighting 2026-05-02 15:36:56 -05:00
Gazook89 34d634a349 Fix font snippet "Open Sans"
Previously it was using 'OpenSans' as the font name, when it's actually 'Open Sans'.
2026-05-01 15:17:30 -05:00
Gazook89 137b6bc690 remove unused 300 & 600 font weights
Only 400 and "800" are used in the codebase for Open Sans.  And, we've only ever had up to 700 as available weights, so everything that is set to "800" is actually getting weight 700 (which looks better).
2026-05-01 11:03:52 -05:00
Gazook89 d3566d896b Move Code Bold/Light to fonts directory 2026-04-30 22:28:56 -05:00
Gazook89 e34c5f9b32 Add font files, remove google fonts references
Adds a `shared/naturalcrit/styles/fonts` directory, and Open Sans font files for the 4 weights we were pulling from Google Fonts.
2026-04-30 22:28:04 -05:00
Gazook89 d79c4d92f5 Merge remote-tracking branch 'upstream/master' 2026-04-30 21:25:21 -05:00
Gazook89 9935f54080 Update variables.test.js 2026-04-30 21:11:33 -05:00
Gazook89 9af2577c6e Add print cycle events and loading msg
Since the print cycle now loads all images not-yet-loaded (due to lazy loading), there can be a moment of time where it appears pressing Get PDF is doing nothing, depending on connection speed.  To add a "loading" message, a custom event is fired at the start and end of the print cycle (before the print dialog comes up).
2026-04-30 21:05:08 -05:00
Gazook89 d04f401c90 Fix lazy loading Print issues
When initiating the print dialog, it first grabs all img elements with `loading="lazy"` attribute, flips that to `eager`,  and then waits for every image to load before resolving a promise and opening the Print dialog.
2026-04-29 23:38:37 -05:00
Gazook89 a973a5db0d Update mustache-syntax.test.js 2026-04-28 22:51:27 -05:00
Gazook89 a2e5688ede Add lazy loading to images 2026-04-28 22:21:35 -05:00
Gazook89 00efbb7244 fix state variable themeSelector 2026-04-26 21:09:18 -05:00
Gazook89 d368e53b30 add some comments 2026-04-26 10:44:52 -05:00
Gazook89 5b11827c56 fix disabled attribute 2026-04-25 23:33:04 -05:00
Gazook89 4d3179fc35 remove unused less file 2026-04-25 23:32:48 -05:00
Gazook89andCopilot d686c78fdf fix oddbird polyfill so custom properties are used correctly
Co-authored-by: Copilot <copilot@github.com>
2026-04-25 22:16:25 -05:00
Gazook89 359d87440b add oddbird polyfill - not quite working
Not quite working yet.  polyfill is loaded, but positioned elements are spanning whole viewport.  Parking this for now.
2026-04-24 22:06:52 -05:00
Gazook89 87ed5d107d add jsdoc documentation. 2026-04-24 20:32:05 -05:00
Gazook89 c0c4db95a4 remove id attribute from component 2026-04-24 10:19:16 -05:00
Gazook89 285522d820 all snippet buttons are actually buttons now 2026-04-23 22:56:29 -05:00
Gazook89 904b14af19 icons in triggers and menus are aligned. 2026-04-23 22:52:39 -05:00
Gazook89 0c78a23c76 remove testing menu 2026-04-23 22:28:21 -05:00
Gazook89 992b72ee6f empty menus styled as disabled 2026-04-23 22:17:52 -05:00
Gazook89andCopilot 8bebbdac5d restore styling to work with new structure.
Co-authored-by: Copilot <copilot@github.com>
2026-04-23 22:10:51 -05:00
Gazook89 4f953da0fe caret menu indicators work, point correct direction 2026-04-23 10:54:27 -05:00
Gazook89andCopilot 3b6c7acdbf snippet submenu triggers don't fire events onclick
Co-authored-by: Copilot <copilot@github.com>
2026-04-23 10:42:58 -05:00
Gazook89andCopilot 2232d5265f Add basic nesting dropdown component
Co-authored-by: Copilot <copilot@github.com>
2026-04-23 10:21:52 -05:00
Gazook89 b5cd7b7a40 package-lock change? 2026-04-23 10:21:20 -05:00
Gazook89 dc8ff1ceab Merge remote-tracking branch 'upstream/master' 2026-04-22 21:38:38 -05:00
Gazook89 399f04d0b4 Merge remote-tracking branch 'upstream/master' 2026-04-08 22:02:08 -05:00
Gazook89 9f6ec87101 Update package-lock.json 2026-03-09 15:35:13 -05:00
Gazook89 f8683ebbc8 Update custom snippets to allow inline
Removes the additional line after a snippet, so it doesn't effectively create a `\n` at the end of the snippet.  This allows snippets to be inline with text.
2026-02-22 22:38:01 -06:00
Gazook89 f9f33955bc Merge branch 'master' into move-codeEditor-to-components 2025-11-09 23:30:53 -06:00
Gazook89 2ce13f61e1 update relative paths to absolute paths 2025-11-09 23:29:55 -06:00
Gazook89 6db4bf2274 Merge branch 'master' into Move-Nav.JSX 2025-11-09 23:24:21 -06:00
Gazook89 c5aa774daa Move markdown.js and markdownlegacy.js
Moves the two files up a level, directly in `/shared/`.  Everything else is just updating paths for that.
2025-11-04 22:29:28 -06:00
Gazook89 29fe6430ce Move codeEditor to components directory
This simply moves the codeEditor folder to the components directory.  `codeEditor.jsx` simply builds a component which is then used elsewhere, and isn't shared between client and server, so it should be in the client directory.

Arguably it could go in `client/homebrew/editor` but I think the `/homebrew/` folder should be eliminated down the line and it's contents just re-sorted.

When working on the editor right now it's a pain to switch between `shared` and `client` hunting for the right file.
2025-11-04 13:12:56 -06:00
Gazook89 c38cc77fd0 Move SVG components to components folder
Move the SVGs out of the `shared` directory, closer to where they are actually used.  They are svg jsx files, setup as components, so i've moved them to the components directory.

Deleted `combat.svg.jsx` because we don't use it anywhere.

renamed the remaining two to be more descriptive of the image for additional clarity.
2025-11-04 12:52:12 -06:00
Gazook89 fc569e560b Move renderWarnings from shared to client
Moving this component to the component folder so it's closer to where it is actually used.  Not moving to the `homebrew` folder because ultimately i think pretty much everything in that folder should move to the components as well (`homebrew` isn't a helpful folder distinction).

Deletes a directory, moves 2 files.
2025-11-03 21:50:31 -06:00
Gazook89 081fd6f39d Move nav.jsx from shared to client directory
Moving the one file, changing a lot of imports (18 files), and deleting a directory.
2025-11-03 20:58:00 -06:00
Gazook89 1a56c393ab Merge branch 'master' into Update-core-and-reset 2024-11-10 21:50:03 -06:00
Gazook89 9bc4b1fb56 Changes to core.less, reset.less, and toolbar
Making some changes to the reset.less so that some default UA button styling is removed.

Then, changing core.less so that the classic "HB" button styling is scoped to a certain class `.colorButton`.  This will make it easier to use the button element in other places.
2024-11-10 21:48:01 -06:00
Gazook89 4bad047f93 Merge branch 'master' into Intersection-Observer 2024-11-10 15:56:03 -06:00
Gazook89 234d484a74 Merge remote-tracking branch 'upstream/master' 2024-11-10 15:55:54 -06:00
Gazook89 bc5a9c9039 lint 2024-11-08 21:57:13 -06:00
Gazook89 f7dfedcd44 give dismisskeys a default 2024-11-08 21:57:13 -06:00
Gazook89 b7b1981bde lint 2024-11-08 21:56:45 -06:00
Gazook89 2e8368d08c give dismisskeys a default 2024-11-08 21:56:35 -06:00
Gazook89 28a7f24989 add scrollToHash method back in
pretty much completely unchanged, was originally moved just to help with merging master in (ie it was erroneously removed)
2024-11-07 20:32:30 -06:00
Gazook89 28855d02a6 dynamic text input width to match characters 2024-11-07 19:46:07 -06:00
Gazook89 650ec04417 fix 'disabled' attribute on min/max of page range 2024-11-07 18:56:19 -06:00
Gazook89 9ef11bca99 lint and refactor 2024-11-07 10:40:44 -06:00
Gazook89 88b34a7ba3 Fix 'current page' input when zoomed in close
When the page is zoomed in very close, such that <30% of the page is in view, it doesn't register changes to the 'current page'.  This fixes that, passing in the 'centerPage' if 'visiblePages' is empty.

I don't love this fix, i think the visiblePages should always have *something* in it, but I can't quite figure out how to set that (since the normal update to visiblePages is happening in an observer that doesn't fire if nothing is in view).
2024-11-07 10:17:43 -06:00
Gazook89 9d86384032 refactor styles 2024-11-06 23:07:46 -06:00
Gazook89 a6bc87bcea apply displayOptions to legacy brews as well. 2024-11-06 23:07:03 -06:00
Gazook89 63add047b6 'fit page' zoom button fits two pages in "facing" spread
If the 'facing' spread is active, the 'fit to view' zoom button fits two pages side by side in the view, rather than setting only one page in view.
2024-11-06 23:03:24 -06:00
Gazook89 a0e88bb24f Add comment about future Popover API use 2024-11-06 21:55:30 -06:00
Gazook89 5b14e0e9b5 tweak alignment of spreads
the `safe` keyword for `justify-content`, in combo with `center`, means that the content will be centered in the viewport unless there is not enough space for it.  If there is not enough space, it aligns it to the *start*/left edge, rather than keeping it centered and clipping the left edge of the page.
2024-11-06 21:55:16 -06:00
Gazook89 274e734135 add displayOptions to dependency array for memo
The memoization of the renderPages() method prevents a re-render when something like pageShadows is updated, so displayOptions are added to the dependency array in the memo method.
2024-11-06 21:53:14 -06:00
Gazook89 3818424251 Adjust "next page" button
Prior to fix, the "next page" button in the toolbar wouldn't work well if there were multiple pages in view that were in a single 'row'.  This is because the logic is to take the pages that are "visible", take the max of those pages, and then scroll to that page.  But the issue is that if the 'max' page is in the same row as other pages, the range of visible pages doesn't change....the max will always be the same.

So the change here basically runs the scroll function twice-- if the first run results in the same 'max' page as before the scroll, it runs it again but with the target page being "max + 1", which will bump the target to the next row.
2024-11-06 21:24:18 -06:00
Gazook89 2222550669 Merge branch 'master' into Observer-Master-merge 2024-11-06 21:19:35 -06:00
Gazook89 93b9f1d1da Merge branch 'Intersection-Observer' into Observer-Master-merge 2024-11-05 14:03:09 -06:00
Gazook89 172a3eaadf fix memoization on brewRenderer.jsx 2024-11-05 12:45:41 -06:00
Gazook89 89a16956b9 Merge branch 'master' into View-Modes 2024-11-04 14:22:54 -06:00
Gazook89 b098d28407 linting 2024-11-04 14:08:06 -06:00
Gazook89 1be1b3b747 small accessibility changes. 2024-11-04 13:55:18 -06:00
Gazook89 5ab867f21e adjust prev/next page buttons to meet expectations
i hope
2024-10-22 22:36:13 -05:00
Gazook89 4126188df1 linting 2024-10-21 22:29:58 -05:00
Gazook89 26050e2134 add comment 2024-10-21 22:20:52 -05:00
Gazook89 5c0d6e6012 move formatting of visible pages to toolbar
Doesn't need to be set in brewRenderer state and passed as a prop, when it can just do it's work directly in the toolbar.
2024-10-21 22:18:25 -05:00
Gazook89 de7b13bc15 Add some comments and cleanup
Little changes like removing console.logs and adding comments.
2024-10-21 22:13:12 -05:00
Gazook89 b6bd7ccf67 Merge branch 'master' into Intersection-Observer 2024-10-21 21:33:30 -05:00
Gazook89 822d0c7738 Fix NaN/undefined showing on first load
Removes currentPage as a variable since it's been replaced.
2024-10-21 21:27:06 -05:00
Gazook89 183dd63021 style change on page text input
Reduce the visual prominence of the page input by using a darker background and a text color that matches the rest of the toolbar icons.  Darker background still indicates this is an interactive item (is an input), hopefully.
2024-10-21 21:19:49 -05:00
Gazook89 0afc2ab2e6 modify effect to enable Jump Editor button
This fixes the "jump editor to preview position" button.
2024-10-21 20:43:32 -05:00
Gazook89 119755e23a Merge branch 'master' into Intersection-Observer 2024-10-21 00:33:56 -05:00
Gazook89 41fdf48ad3 Setup Intersection Observers & more...
Bad commit here with too much stuff.  I apologize.

This sets up two Intersection Observers: the first captures every page that is at least 30% visible inside the `.pages` container, and the second captures every page that has at least one pixel on the horizontal center line of `.pages`.  Both can be arrays of integers (page index).

The "visiblePages" array is duplicated and formatted into a "formattedPages" state, which gets displayed in the toolbar.

The toolbar displays that, unless the user clicks into the page input and enters their own integer (only a single integer, no range), which can then jump the preview to that page on Enter or blur().

The Arrow 'change page' buttons jump the preview back and forth by a 'full set'.
 If one page is viewed at a time, this is moved on page a time, and if 10 pages are viewed at a time it jumps the pages by 10.

Left to do:  adapt the "jump editor to match preview" divider button to work with new "centerPage".
2024-10-21 00:30:45 -05:00
Gazook89 810c2140c9 move some toolbar specific styling to toolbar.less 2024-10-13 20:45:05 -05:00
Gazook89 c4fbc8d827 Merge branch 'master' into View-Modes 2024-10-13 09:40:05 -05:00