Commit Graph
100 Commits
Author SHA1 Message Date
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 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 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 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
Gazook89 c1288ce4bb Use index to find and remove tags
Fixes issue in last commit, so removing a tag that has duplicate value of other tags only removes the correct one, not the others as well.
2024-09-18 23:24:10 -05:00
Gazook89 c65210b3ed Add 'remove' button and method
New button that triggers `submitTag()` method directly (rather than throw onKeyDown event) and passes `null` as the newValue.  New `if` condition checks for null on newValue and if true, removes the tag that matches the originalValue.

This *does* currently delete all duplicate tags if they match the one you are deleting.  Not sure when you'd ever want duplicate tags, but regardless i'll likely switch this to work via Index, not value.
2024-09-18 23:13:46 -05:00
Gazook89 70a3cb9ef9 Add method for adding new tags
Component now accepts new tags entered in the always-present input field.  Entering a value and hitting Enter submits the tag, and it appears as a new tag.

Updated the tag list keys to be unique (via `index`).

To-Do: empty 'new tag' input after submitting.
2024-09-18 22:46:00 -05:00
Gazook89 d1686c4c8f Add in handlers for TagInput value changes
Now brew metadata is actually updated and preserved across reloads to match updated tag values.  useEffect calls the props.onChange event from the parent component on every change to the valueContext state of this component (right now, after hitting Enter in a tag input).
2024-09-18 22:18:18 -05:00
Gazook89 c5033db336 add editing of input functionality
Currently uses uncontrolled inputs with a `defaultValue` attribute set to the values passed in via props.  The input can then be edited, and when `Enter` is pressed, it updates the stored value state.  Later, this can be updated to be trigger with `Tab` or clicking outside the active input element.
2024-09-18 21:00:24 -05:00
Gazook89 36aa4ea508 Add click handler for readTags to open text input
Clicking on a readTag now converts that tag to a text input, and maintains the tag value.  It also closes any other open text inputs amongst the tags (but leaves the "new tag" input open).
2024-09-17 23:50:59 -05:00
Gazook89 d5c5b4315b Render tags as "write" or "read"
Tags are now either "readTag" or "writeTag", with the former being a div with the tag value and the latter a text input with the value.

Minor class name change in LESS.
2024-09-17 23:28:56 -05:00
Gazook89 d505e4e24c Render element for each value from props
Take an array of values from props, load it into valueContext state with an "editing" boolean for each value.  Then, when rendering the component, take each value in the valueContext array and create a div for each --

at this point, if the value is "being edited", it returns a div with text "editing".  If not being edited, it returns a div with the value as text.

Nothing is being edited at this point since that functionality doesn't exist yet.
2024-09-17 23:16:06 -05:00
Gazook89 ea7f18e3b0 Merge branch 'master' into Functional-Tag-Editor 2024-09-17 14:50:31 -05:00
Gazook89 e8e16f4d66 Initial commit: Rename component, set basic structure
No actual functionality implemented yet, just renames the component from "StringArrayEditor" to "TagInput", for brevity at the possible cost of clarity.  For now, the original StringArrayEditor is kept and named "TagInput-class.jsx" so that I can reference it as I work on the functional component.
2024-09-17 14:46:56 -05:00
Gazook89 03c14e5847 adds meta tags for the Vault page
So they show up when sharing the link in Discord or wherever.
2024-09-05 11:24:59 -05:00
Gazook89 e0be7a5db3 Move rules out of body and into more specific elements 2024-09-05 11:13:08 -05:00
Gazook89 49e072f03f Add button to toggle Preview tools
Toggles a state variable to either visible or hidden which is used to set a related class on the toolbar.  The hiding is done with CSS, just reducing the width of the toolbar and the opacity of the tools.
2024-09-04 13:54:55 -05:00
Gazook89 3c6f49aa0a Move focus method to handleViewChange 2024-09-03 14:48:45 -05:00
Gazook89 afa1e7974a Set focus on editor after tab switch
This sets the focus on the editor (and thus reveals cursor position) between editor changes (style to text to meta and back).
2024-09-02 21:07:19 -05:00
Gazook89 a7ddeafd06 revert change 2024-08-27 11:59:29 -05:00
Gazook89 a7c4b78ec8 set position relative, remove padding 2024-08-27 09:03:24 -05:00
Gazook89 aa321fe2c3 Merge branch 'master' into Fill-Pane-Buttons 2024-08-27 08:43:19 -05:00
Gazook89 7bc0af9a8c utilize Infinity and reduce() 2024-08-27 08:42:45 -05:00
Gazook89 e06611a90f set all zoom buttons to use handleZoomButton
All zoom buttons run through same handler now.

They no longer take only the delta of the current zoom and desired zoom-- they take the actual desired zoom.

calculateZoom is now calculateChange, to help get the desired delta.
2024-08-26 16:16:13 -05:00
Gazook89 7b767368df Change icons to mask-image
Removes icons as components, uses mask-image instead.

Sets a size on the .fac icons to 1em so by default they are 1em and retain their aspect ratio.

rename the icon files for consistency.
2024-08-26 15:51:35 -05:00
Gazook89 2b79583e8c Merge branch 'pr/3499' into View-Modes 2024-08-24 22:03:06 -05:00
Gazook89 35a0a12f16 Merge branch 'pr/3499' into Fill-Pane-Buttons 2024-08-24 22:02:56 -05:00
Gazook89 504bb78a8d switching padding to margin
using `padding-top` was breaking the navbar dropdowns (they would lose focus).
2024-08-24 22:02:43 -05:00
Gazook89 609b40e84c Merge branch 'pr/3499' into View-Modes 2024-08-24 21:28:39 -05:00
Gazook89 94ae33d328 Merge branch 'pr/3499' into Fill-Pane-Buttons 2024-08-24 21:28:13 -05:00
Gazook89 690c683943 select text when clicking into page input 2024-08-24 09:08:19 -05:00
Gazook89 3acf90dfdb Add handlePageChange() to control input
Reintroducing handlePageChange() method to handle the page input separately from the scroll function.  It tests the regex pattern on the string, parses to integer, and sets pageNum state.

scrollToPage also now sets the pageNum state after performing the scroll so the input box matches the new current page.
2024-08-24 09:05:43 -05:00
Gazook89 07c574fa42 Merge branch 'Fill-Pane-Buttons' into View-Modes 2024-08-23 23:26:24 -05:00
Gazook89 6bb5d04f07 round the calculated zoom level 2024-08-23 23:02:04 -05:00
Gazook89 b0b1f7fd0b update method calls for zoom buttons
update method names in onClick events to match latest changes to the branch this builds from.
2024-08-23 22:58:43 -05:00
Gazook89 c25bf95a66 Merge branch 'pr/3499' into Fill-Pane-Buttons 2024-08-23 22:56:37 -05:00
Gazook89 370c480670 Merge branch 'master' into pr/3499 2024-08-23 22:55:13 -05:00
Gazook89 a351013359 remove some odd if statement in onChange 2024-08-23 22:54:29 -05:00
Gazook89 1f86b4c3d0 add mainRef back in
This was previously in the .pageInfo widget, probably not for any good reason, but I'm moving it to the popups div for probably not a good reason.

It's used to get the parent .pane div, and pull its `height` value which is then passed to the `.brewRenderer` div to set the height.

I tried alternate methods that would make this obsolete (CSS methods mostly), but due to some complexity am just ditching those alternatives and popping this sucker into `.popups` for now.
2024-08-23 22:41:12 -05:00
Gazook89 627a6a732b remove .ppr_msg styling
This message doesn't exist anymore (i'm pretty sure), so this is just unused styling.  Unrleated to the PR, but just minor.
2024-08-23 19:26:41 -05:00
Gazook89 77421c2950 remove .pageInfo widget in bottom of preview
page counter function is in toolbar now, so this isn't necessary.
2024-08-23 19:25:49 -05:00
Gazook89 f3ed174b0e eslint and stylelint
stylelint has a problem with the `:horizontal` pseudo selector in brewRenderer.jsx, which is being used to apply some styling to the custom scrollbars.  As far as i can tell, the selector is not standards-track, so that is probably why.  Not sure if we want to adjsut our stylelint config to allow it?
2024-08-23 19:16:59 -05:00
Gazook89 977d0ea73a eslint 2024-08-23 19:05:23 -05:00
Gazook89 04effa2150 removed whitepsace 2024-08-23 18:59:32 -05:00
Gazook89 7f694e6ca7 fold handlePageChange directly into input onChange
Moved the single-line handler to operate directly in the onChange handler of the input that is calling it.

Considered doing the same with handleZoomChange, but that handler is used by two buttons rather than just one.
2024-08-23 18:58:51 -05:00
Gazook89 769a03916b rename pageInput state variable to pageNum 2024-08-23 18:48:36 -05:00
Gazook89 e3c90a8295 unset padding on brewRenderer in @print
Fixes an issue with the padding being reflected in pdfs as a white stripe at the top.
2024-08-23 18:45:08 -05:00
Gazook89 561ff6283a remove redundant handleScroll() method
handleScroll is replaced by getCurrentPage(), which effectively does the same thing.  The math is slightly different, though very similar, and result seems to be the same.
2024-08-23 18:33:14 -05:00
Gazook89 f34107ee1d fix typo 2024-08-23 15:06:48 -05:00
Gazook89 2246944dd2 Remove duplicate ErrorBar/popups tray
Removed duplicated components.

Restyled the popups to accomodate extra height of viewer tools.
2024-08-23 14:40:19 -05:00
Gazook89 960ecae861 setup styles for different view modes
added styles for different modes-- basically a grid for 'facing' and flex for 'flow'.
2024-08-23 14:29:52 -05:00