Commit Graph
100 Commits
Author SHA1 Message Date
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 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 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
Gazook89 96ae07a456 Small style change on checkbox inputs 2024-10-13 09:39:41 -05:00
Gazook89 b33d9264d3 unify terms to 'spreads'
This commit only renames things, changes no logic.  Any mention of "book", "view", or "mode" is renamed in relation to "spreads".

The AnchoredBox.jsx file is renamed to Anchored.jsx

Extra icons are deleted, and the remaining ones are renamed.
2024-10-12 23:25:14 -05:00
Gazook89 0855c5c181 remove errant console.log 2024-10-12 23:12:37 -05:00
Gazook89 1741abc3fe Refactor AnchoredBox for greater flexibility
Big change to how the AnchoredBox component is structured so that it can be used in more than just one spot.  Now composed of the wrapper Anchored, with two children AnchoredTrigger and AnchoredBox, each of which can have their own arbitrary children.

Next steps will involve renaming the component file to Anchored.jsx, moving most styling out of the attached stylesheet (and into brewRenderer.less), and adding props to pass in Anchor Positioning properties.
2024-10-12 23:12:27 -05:00
Gazook89 27f471791d Small change in title phrasing 2024-10-12 13:28:25 -05:00
Gazook89 ae11da2bc7 Fix the styles overriding previous styles
If there were two inputs sending styles to the same target (ie row and column gap), they would override each other.

This change fixes that by deepening the merges.  Admittedly, I turned to cGPT to help me with this as the nesting was throwing me for a loop.  It works, though, and I understand it now that I can read it.
2024-10-12 11:53:52 -05:00
Gazook89 b58b9ca8f0 Merge branch 'View-Modes-Radio-Options' into View-Modes 2024-10-12 11:06:09 -05:00
Gazook89 ba0b3e7d93 Add toggle for Page Shadows
Reworks the pagesStyles to a broader object previewStyles.  This new object has this structure:

```
{
  targetElement : { cssProperty: value }
}
```
2024-10-12 11:05:23 -05:00
Gazook89 6fca21b6ed set defaultValue of gap sliders
defaultValue matches the normal styled values of the gap property on the .pages element.

removed the "tooltip" that showed the current value from the range sliders inside the anchoredbox (the gap sliders).
2024-10-11 22:53:38 -05:00
Gazook89 a3dbaf9e6a refactor anchoredBox to handle focus
Refactoring the AnchoredBox component because I wanted to set focus on the trigger button when the expanded box was closed.  Wrapping the trigger into it's own component, with forwardRef, allows for passing the `ref` to the actual DOM node.  Then the `.focus()` method will work on it.
2024-10-11 22:34:40 -05:00
Gazook89 835305bcf6 Add a title to each button
add a role to the toolbr.
2024-10-11 22:32:53 -05:00
Gazook89 395f2d16fa change view mode toggles to indiv buttons
Rather than a single button with three states, it is three buttons.  Went with buttons with `role='radio'` rather than true radios mostly because that is what Radix does.
2024-10-11 22:06:41 -05:00
Gazook89 6cabdc0a67 add alternative icons in
the `-alt` icons have better sizing/readability than the originals.  The originals likely will be removed.

Also adds back in 'fit-width' icon which was mistakenly overwritten earlier.
2024-10-11 22:05:18 -05:00
Gazook89 e80588b234 Add icons 2024-10-11 13:51:41 -05:00
Gazook89 73504a3386 Setting a padding-top to avoid pages hugging toolbar 2024-10-11 13:51:06 -05:00
Gazook89 9c4b936ddd bump node to avoid experimental flag issues from another merge 2024-10-11 13:50:40 -05:00
Gazook89 c4074d67f5 Merge branch 'master' into View-Modes 2024-10-10 23:34:26 -05:00
Gazook89 a6efaf0e8b Remove unused Nav components 2024-10-08 10:12:53 -05:00
Gazook89 68c75fbfd2 adjust CSS to support Firefox
Set's a non-ideal but functional css style for the box when using Firefox so the box is at least visible.
2024-10-06 22:16:46 -05:00
Gazook89 d6d6cc1e29 Add View Mode Options
Adds a new AnchoredBox component that is functionally a clone of the "saving error" notifications, but drops a lot of the JS in favor of the new (chrome-only!) CSS Anchor Positioning API.  In subsequent commits, either alternate styling or a polyfill will be added non-supported browsers.

The box contains a few inputs that modify the CSS applied to `.pages`, most critically a "start on right" toggle for the Facing Pages mode.
2024-10-06 21:51:44 -05:00
Gazook89 9fce94af63 Small CSS tweaks/display 'value' tooltip only if exists
The range slider should only display a tooltip for the value if the value attribute exists.  For example, the difference between controlled and uncontrolled inputs.

Update toolBar.less
2024-10-06 21:26:48 -05:00
Gazook89 41f390b305 Add a classname to recto configuration
Adding class name so that it can be toggled between 'recto' and 'verso'.  Verso being the normal left/right configuration, no styling is needed.  With recto, the first page is shifted to the second slot, or right side.
2024-10-06 21:24:50 -05:00
Gazook89 8115b1504e Add flex property to pages 2024-10-05 23:01:08 -05:00
Gazook89 34fa724fdd Change .pages margin to .brewRenderer padding
More consistent visuals since the zooming of the .pages element affects the spacing around the edges, and the brewRenderer padding isn't affected.
2024-10-05 22:43:13 -05:00
Gazook89 24544e713e Basically revert previous change
Adding the margin resets back in because otherwise each .page margin is set to "auto" on the sides, and that makes them zoom awkwardly when in facing and flow modes.
2024-10-05 22:35:42 -05:00
Gazook89 06a806e260 preserve margin around .pages
Keep margin around .pages element such that the pages are never bumped right against the divider.
2024-10-05 21:55:42 -05:00
Gazook89 4259931b67 Merge branch 'master' into View-Modes 2024-10-05 21:39:06 -05:00
Gazook89 a96ff6ecb3 Variable name changes for clarity
Followed suggestions on the PR.
2024-09-23 21:05:37 -05:00
Gazook89 5af45f16b0 remove tagInput-class
This file was just the old StringArrayEditor that I kept around for easy reference.  Can be deleted now.
2024-09-23 14:54:24 -05:00
Gazook89 a9b6d5ff38 Merge branch 'master' into Functional-Tag-Editor 2024-09-23 14:53:41 -05:00
Gazook89 433f016c25 rename tag container class to unify with fields 2024-09-19 15:57:40 -05:00
Gazook89 10a9bc2906 Merge branch 'master' into Functional-Tag-Editor 2024-09-19 15:54:08 -05:00
Gazook89 b585e85f0f Fix multiple duplicate tags updating at once
Fixes an issue where tags with duplicate values would all update to the same value after editing just one.

Also an adjustment to the parameters that are passed to handleInputKeyDown-- they are now one object.  This helps handle an "options" object where more optional features can be turned on and off.
2024-09-19 15:48:47 -05:00
Gazook89 544f4c6103 tweak headers 2024-09-19 15:29:35 -05:00
Gazook89 8a67e1eccd Merge branch 'Functional-Tag-Editor' into Func-Tag-Editor-Features 2024-09-19 14:54:28 -05:00
Gazook89 a6ac6b98c2 some fixes and updates
This fixes something i broke with last commit, but should be final commit.
2024-09-19 11:09:22 -05:00
Gazook89 2336f8508b Rearrange CSS and small HTML changes
Simplified and unified some font-size declarations, adjusted the "descriptions" for various inputs to be similar structure and appearance, change the components h1 label from "Brew" to "Properties Editor", updated the comment about Publishing.
2024-09-19 10:57:55 -05:00
Gazook89 7ea1696065 Adjust html structure to handle tags as list
Begin work on setting a better html structure for the component.

Create a .less file for the component, which I may not actually use.
2024-09-19 10:40:09 -05:00
Gazook89 5b4a7c168f Add comma to "submit" buttons
Now comma (`,`) submits a tag, like `Enter`
2024-09-18 23:54:12 -05:00
Gazook89 a54adc1e4b Set new tag input to clear itself after submission
Now whenever a new tag is submitted, the input element is cleared and ready for the next tag.

Whitespace cleanup.
2024-09-18 23:39:26 -05:00